@hyperframes/core 0.8.17 → 0.8.18

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.
@@ -36,8 +36,8 @@ https://www.w3ctech.com/topic/2226`));let l=n(...a);return l.postcssPlugin=t,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 e)try{document.querySelectorAll(n).forEach(i=>{i.classList.add("__hf-flash"),setTimeout(()=>i.classList.remove("__hf-flash"),t)})}catch(r){L("bridge.flashElements.querySelector",r)}}var Ji=null;function Is(e){Ji=e}function Ne(e,t){if(Ji)try{Ji({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){L("runtime.analytics.site1",n)}}function Jm(e){let t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-"),n=0,r=t.length;for(;n<r&&t[n]==="-";)n++;for(;r>n&&t[r-1]==="-";)r--;let i=t.slice(n,r);return i.length>0?i:"node"}function Ot(e){return`--${Jm(e)}`}function Ps(e){let t=new Map;for(let n of e){let r=Ot(n),i=t.get(r);i?i.includes(n)||i.push(n):t.set(r,[n])}return[...t.values()].filter(n=>n.length>1)}function Hs(){if(typeof document>"u")return{};let e=new Set;document.documentElement?.hasAttribute("data-composition-variables")&&e.add(document.documentElement);for(let i of Array.from(document.querySelectorAll("[data-composition-variables]")))e.add(i);let t={};for(let i of e)Object.assign(t,bn(i));let n=Cr(),r={...t,...n};for(let i of e)Zi(i,r);return r}var Os=new Set;function Gs(e){let t=e?.getAttribute("data-composition-variables");if(!t)return[];let n;try{n=JSON.parse(t)}catch{return[]}return Array.isArray(n)?n.filter(r=>!!r&&typeof r=="object"):[]}function Qm(e,t){return t?.trim()||e.getAttribute("data-composition-id")?.trim()||e.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()||"composition"}function Zm(e){return Array.isArray(e.options)?e.options.map(t=>t&&typeof t=="object"?t.value:t).filter(t=>typeof t=="string"||typeof t=="number"):[]}function ep(e,t){if(typeof e.id!="string")return null;let n=t[e.id];if(n==null||"default"in e&&String(n)===String(e.default))return null;let r=Zm(e);return r.length===0||r.some(i=>String(i)===String(n))?null:{id:e.id,value:n,allowed:r}}function Zi(e,t,n){if(!e)return;let r=Gs(e);if(r.length===0)return;let i=Qm(e,n);for(let o of r){let a=ep(o,t);if(!a)continue;let l=`${i}|${a.id}|${String(a.value)}`;if(Os.has(l))continue;Os.add(l);let s="default"in o?JSON.stringify(o.default):"the composition default";console.warn(`[hyperframes] runtime_unknown_enum_value: ${i} variable "${a.id}" got ${JSON.stringify(a.value)}, which is not a declared option (${a.allowed.join(", ")}). Rendering ${s} instead.`)}}function bn(e){let t={};for(let n of Gs(e))typeof n.id!="string"||!("default"in n)||(t[n.id]=n.default);return t}var Qi="data-hf-css-vars";function wr(e){return"style"in e&&typeof e.style?.setProperty=="function"}function eo(e,t){if(!wr(e))return;let n=[];for(let[r,i]of Object.entries(t))if(typeof i=="string"&&i!==""||typeof i=="number"){let o=Ot(r);e.style.setProperty(o,String(i)),n.push(o)}n.length>0&&e.setAttribute(Qi,n.join(" "))}function Bs(e,t,n){let r={};for(let[i,o]of Object.entries(t)){let a=Ot(i);((wr(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(r[i]=o)}return r}function Us(e){if(!wr(e))return;let t=e.getAttribute(Qi);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(Qi)}}function Ws(e){let t=new Set;e.documentElement?.hasAttribute("data-composition-variables")&&t.add(e.documentElement);for(let i of Array.from(e.querySelectorAll("[data-composition-variables]")))t.add(i);let n=Cr(),r=[];for(let i of t)r.push(...tp(i,n,e.defaultView));for(let i of Ps(r))console.warn(`composition variables ${i.join(", ")} collapse to the same CSS property ${Ot(i[0]??"")} \u2014 rename one to avoid cross-talk`)}function tp(e,t,n){if(!wr(e))return[];let r=bn(e),i={};for(let[o,a]of Object.entries(r)){if(o in t)continue;let l=Ot(o);(e.style.getPropertyValue(l)||(n?n.getComputedStyle(e).getPropertyValue(l):"")).trim()===""&&(i[o]=a)}for(let[o,a]of Object.entries(t))o in r&&(i[o]=a);return eo(e,i),Object.keys(r)}function Vs(e){let t=e.getAttribute("data-variable-values");if(!t)return{};let n;try{n=JSON.parse(t)}catch{return{}}return!n||typeof n!="object"||Array.isArray(n)?{}:n}function Cr(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}function zs(e){let t=[],n=u=>{if(typeof u.getAnimations!="function")return[];try{return u.getAnimations()}catch{return[]}},r=u=>e?.resolveStartSeconds?e.resolveStartSeconds(u):Number.parseFloat(u.getAttribute("data-start")??"0")||0,i=(u,c)=>{let m=null;try{m=u.effect?.getComputedTiming?.()??null}catch(p){L("runtime.adapters.css.site5",p)}if(!m)return{};let f=Number(m.endTime);return Number.isFinite(f)?{endSeconds:c+f/1e3}:{unbounded:!0}},o=(u,c)=>{for(let m of u){try{m.currentTime=c}catch(f){L("runtime.adapters.css.site1",f)}try{m.pause()}catch(f){L("runtime.adapters.css.site2",f)}}},a=u=>{for(let c of u)try{c.play()}catch(m){L("runtime.adapters.css.site3",m)}},l=u=>{for(let c of u)try{c.pause()}catch(m){L("runtime.adapters.css.site4",m)}},s=u=>{u.baseDelay?u.el.style.animationDelay=u.baseDelay:u.el.style.removeProperty("animation-delay"),u.basePlayState?u.el.style.animationPlayState=u.basePlayState:u.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{t=[];let u=document.querySelectorAll("*");for(let c of u){if(!(c instanceof HTMLElement))continue;let m=window.getComputedStyle(c);!m.animationName||m.animationName==="none"||t.push({el:c,baseDelay:c.style.animationDelay||"",basePlayState:c.style.animationPlayState||"",animations:n(c)})}},getInferredDurationSeconds:()=>{let u=0;for(let c of t){if(!c.el.isConnected)continue;let m=r(c.el);for(let f of n(c.el)){let p=i(f,m);p.endSeconds!=null&&(u=Math.max(u,p.endSeconds))}}return u>0?u:null},seek:u=>{let c=Number(u.time)||0;for(let m of t){if(!m.el.isConnected)continue;let f=r(m.el),p=Math.max(0,c-f)*1e3,b=m.animations;if(b.length>0){o(b,p);continue}m.el.style.animationPlayState="paused",m.el.style.animationDelay=`-${(p/1e3).toFixed(3)}s`}},pause:()=>{for(let u of t){if(!u.el.isConnected)continue;let c=u.animations;c.length>0&&l(c),s(u)}},play:()=>{for(let u of t)u.el.isConnected&&(s(u),a(u.animations))},revert:()=>{t=[]}}}function qs(e){return{name:"gsap",discover:()=>{},seek:t=>{let n=e.getTimeline();if(!n)return;n.pause();let r=Math.max(0,Number(t.time)||0),i=t.suppressEvents===!0;typeof n.totalTime=="function"?(n.totalTime(r+.001,!0),n.totalTime(r,i)):n.seek(r,i)},pause:()=>{let t=e.getTimeline();t&&t.pause()}}}function $s(){return{name:"animejs",discover:()=>{try{let e=window.anime;if(!e||typeof e.running>"u")return;let t=e.running;if(!Array.isArray(t)||t.length===0)return;let n=window.__hfAnime??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfAnime=n}catch(e){L("runtime.adapters.animejs.site1",e)}},seek:e=>{let t=Math.max(0,(Number(e.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let r of n)try{typeof r.seek=="function"&&r.seek(t)}catch(i){L("runtime.adapters.animejs.site2",i)}},pause:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.pause=="function"&&t.pause()}catch(n){L("runtime.adapters.animejs.site3",n)}},play:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.play=="function"&&t.play()}catch(n){L("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function Ks(){return{name:"lottie",discover:()=>{try{let e=window.lottie;if(e&&typeof e.getRegisteredAnimations=="function"){let t=e.getRegisteredAnimations();if(Array.isArray(t)&&t.length>0){let n=window.__hfLottie??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfLottie=n}}}catch(e){L("runtime.adapters.lottie.site1",e)}},seek:e=>{let t=Math.max(0,Number(e.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let r of n)try{if(to(r))r.goToAndStop(t*1e3,!1);else if(no(r)){if(typeof r.setCurrentRawFrameValue=="function"){let i=r.totalFrames??0,o=r.frameRate??30,a=t*o;i>0&&r.setCurrentRawFrameValue(Math.min(a,i-1))}else if(typeof r.seek=="function"){let i=r.duration??1,o=Math.min(100,t/i*100);r.seek(o)}}}catch(i){L("runtime.adapters.lottie.site2",i)}},pause:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let t of e)try{(to(t)||no(t))&&t.pause()}catch(n){L("runtime.adapters.lottie.site3",n)}},revert:()=>{},getInferredDurationSeconds:()=>{let e=window.__hfLottie;if(!e||e.length===0)return null;let t=0,n=!1;for(let r of e){let i=null;try{i=np(r)}catch(o){L("runtime.adapters.lottie.site4",o)}i!=null&&(n=!0,t=Math.max(t,i))}return n?t:null}}}function js(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function np(e){return to(e)?js(e.totalFrames,e.frameRate):no(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:js(e.totalFrames,e.frameRate):null}function to(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function no(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}var ro=-1,_r=new Set,Ht,io=0;function Ys(e){let t=[],n=!0,r={time:e,waitUntil:o=>{if(!n)throw new Error("hf-seek waitUntil() must be called synchronously from the event listener");t.push(o)}};try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:r}))}catch(o){L("runtime.adapters.seek-dispatch.site1",o)}finally{n=!1}if(t.length===0)return;let i=Promise.all(t).then(()=>({status:"fulfilled"})).catch(o=>({status:"rejected",reason:o}));_r.add(i),i.then(o=>{_r.delete(i)&&o.status==="rejected"&&Ht===void 0&&(Ht={reason:o.reason})})}function Tr(e){e!==ro&&(ro=e,Ys(e))}function Rr(e){ro=e,Ys(e)}function Xs(){return io>0}async function oo(){io+=1;let e=Ht;try{for(await Promise.resolve();_r.size>0;){let r=(await Promise.all([..._r])).find(i=>i.status==="rejected");e===void 0&&r?.status==="rejected"&&(e={reason:r.reason})}let t=Ht;if(e===void 0&&(e=t),Ht===t&&(Ht=void 0),e)throw e.reason}finally{io-=1}}function Js(){let e=null,t=0,n=null,r=null,i=null,o=null,a=()=>{if(typeof window>"u")return null;let c=window.THREE?.DefaultLoadingManager;return!c||typeof c!="object"||typeof c.itemsLoaded!="number"||typeof c.itemsTotal!="number"?null:c},l=u=>{o||u.itemsTotal<=u.itemsLoaded||(o=new Promise(c=>{u.onLoad=function(){try{i?.call(this)}finally{o=null,u.onLoad=i??null,c()}}}))},s=u=>{n!==u&&(n=u,r=u.onStart??null,i=u.onLoad??null,u.onStart=function(c,m,f){try{r?.call(this,c,m,f)}finally{l(u)}})};return{name:"three",discover:()=>{let u=a();u&&(s(u),l(u))},seek:u=>{e=Math.max(0,Number(u.time)||0),t=e,window.__hfThreeTime=e,Tr(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0},getReadyPromise:()=>{let u=a();return!u||u.itemsTotal<=u.itemsLoaded?null:(o||l(u),o)}}}function $e(e){let t=null,n=new WeakSet;return{name:e.name,discover:()=>{},seek:()=>{},pause:()=>{},play:()=>{},revert:()=>{},getReadyPromise:()=>{let r=e.getInstances();if(r.length===0)return null;let i=r.filter(o=>!n.has(o));return i.length===0?null:t||(t=Promise.allSettled(i.map(o=>e.waitFor(o).then(()=>{n.add(o)}))).then(()=>{t=null}),t)}}}function Qs(){return $e({name:"mapbox",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfMapbox;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{if(e.loaded()){t();return}e.on("load",t)})})}function Zs(){return $e({name:"leaflet",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfLeaflet;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>e.whenReady(t))})}function el(){return $e({name:"google-maps",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfGoogleMaps;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{let n=e.addListener("tilesloaded",()=>{n.remove(),t()})})})}function tl(){return $e({name:"maplibre",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfMaplibre;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{if(e.loaded()){t();return}e.on("load",t)})})}function nl(){return $e({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}var rp=250;function rl(){let e=null,t=0,n=null,r=()=>{n!==null&&(window.clearInterval(n),n=null)},i=()=>{n===null&&document.querySelector("[data-composition-id][data-requires-webgpu]")&&(n=window.setInterval(()=>{e!==null&&(Xs()||(window.__hfTypegpuTime=e,Rr(e)))},rp))};return{name:"typegpu",discover:()=>{},seek:o=>{e=Math.max(0,Number(o.time)||0),t=e,window.__hfTypegpuTime=e,Tr(e)},pause:()=>{e==null&&(e=Math.max(0,t)),i()},play:()=>{r(),e=null},revert:()=>{r(),e=null,t=0}}}var xn="data-hf-render-id",il="data-hf-group-render-id";function ip(e){return e.getAttribute(xn)||e.id||null}var op="__render_frame_",ap="__";function sp(e){return`${op}${e}${ap}`}function lp(e){let t=ip(e);return t?sp(t):null}function ut(e){let t=lp(e);if(!t)return null;let n=document.getElementById(t);return n instanceof HTMLImageElement?n:null}function ol(e){let t=e.nextElementSibling;if(t instanceof HTMLImageElement&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;let n=ut(e);return n&&n.complete&&n.naturalWidth>0?n:null}function al(){let e=globalThis.GPUQueue;if(!e?.prototype?.copyExternalImageToTexture)return;let t=e.prototype.copyExternalImageToTexture;e.prototype.copyExternalImageToTexture=function(n,r,i){if(n?.source instanceof HTMLVideoElement){let o=ol(n.source);if(o)return t.call(this,{...n,source:o},r,i)}return t.call(this,n,r,i)}}function sl(){let e=[globalThis.WebGL2RenderingContext,globalThis.WebGLRenderingContext],t=["texImage2D","texSubImage2D"];for(let n of e){let r=n?.prototype;if(r)for(let i of t){let o=r[i];if(typeof o!="function"||o.__hfVideoPatched)continue;let a=function(...l){let s=l.length-1,u=l[s];if(u instanceof HTMLVideoElement){let c=ol(u);c&&(l[s]=c)}return o.apply(this,l)};a.__hfVideoPatched=!0,r[i]=a}}}function ll(){let e=!1,t=0,n=!1,r,i,o,a=new Set,l=new WeakMap,s=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},u=x=>{let _=Number(x.currentTime);return Number.isFinite(_)&&_>0?_:0},c=(x,_)=>_<=0?x:x>=_?Math.max(0,x-_):x,m=(x,_)=>{let R=l.get(x);if(R)return R;let T={compositionTimeMs:_,animationTimeMs:e?c(u(x),_):u(x)};return l.set(x,T),T},f=(x,_)=>{if(!a.has(x)){a.add(x);let R=()=>{a.delete(x)};try{x.addEventListener("finish",R,{once:!0}),x.addEventListener("cancel",R,{once:!0})}catch(T){L("runtime.adapters.waapi.site4",T)}}m(x,_)},p=(x,_)=>{for(let R of x)f(R,_)},b=()=>{if(n||typeof Element>"u")return;let x=Element.prototype;if(typeof x.animate!="function"||x.__hfOriginalAnimate)return;let _=x.animate;try{Object.defineProperty(x,"__hfOriginalAnimate",{value:_,configurable:!0});let R=function(...T){let M=_.apply(this,T);return f(M,t),M};x.animate=R,r=x,i=_,o=R,n=!0}catch{}},v=x=>{let _=null;try{_=x.effect?.getComputedTiming?.()??null}catch(M){L("runtime.adapters.waapi.site4",M)}if(!_)return{};let R=Number(_.endTime);return Number.isFinite(R)?{endSeconds:(l.get(x)?.compositionTimeMs??0)/1e3+R/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,b(),p(s(),t)},seek:x=>{let _=Math.max(0,(Number(x.time)||0)*1e3);t=_,(!e||a.size>0)&&p(s(),e?_:0);for(let R of a){let T=e?m(R,_):m(R,0),M=T.animationTimeMs+Math.max(0,_-T.compositionTimeMs);try{R.currentTime=M}catch(F){L("runtime.adapters.waapi.site1",F)}try{R.pause()}catch(F){L("runtime.adapters.waapi.site2",F)}}},pause:()=>{e||p(s(),t);for(let x of a)try{x.pause()}catch(_){L("runtime.adapters.waapi.site3",_)}},revert:()=>{if(a.clear(),l=new WeakMap,e=!1,t=0,r&&i&&o&&r.animate===o)try{r.animate=i,r.__hfOriginalAnimate===i&&delete r.__hfOriginalAnimate}catch(x){L("runtime.adapters.waapi.site5",x)}r=void 0,i=void 0,o=void 0,n=!1},getInferredDurationSeconds:()=>{let x=0;for(let _ of s()){let R=v(_);R.endSeconds!=null&&(x=Math.max(x,R.endSeconds))}return x>0?x:null}}}var ao=3.981071705534972;function Le(e){return Number.isFinite(e)?Math.max(0,Math.min(ao,e)):1}function kr(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function ul(e,t){let n=typeof HTMLMediaElement>"u"?void 0:Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"volume"),r=n?.get,i=n?.set;if(!r||!i)return t();let o=Number(r.call(e));Object.defineProperty(e,"volume",{configurable:!0,get:()=>o,set:a=>{o=Number(a),i.call(e,kr(o))}});try{return t()}finally{delete e.volume,i.call(e,kr(o))}}var Gt=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),lv=Object.freeze([Gt.start,Gt.duration,Gt.trackIndex]),uv=Object.freeze([Gt.derivedEnd]),cv=Object.freeze([Gt.derivedEnd,Gt.legacyTrack]);function Bt(e){if(e==null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}var dl=/^[A-Za-z0-9_.:-]+$/;function fl(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function cl(e,t){let n=t;for(;n>=0&&fl(e,n);)n--;return n}function up(e,t){let n=t;for(;n>=0&&(e[n]??"").trim()==="";)n--;return n}function cp(e){let t=e.length-1;if(!fl(e,t))return null;let n=cl(e,t);return e[n]==="."&&(n=cl(e,n-1)),n+1}function dp(e){let t=cp(e);if(t==null)return null;let n=up(e,t-1),r=e[n];if(r!=="+"&&r!=="-")return null;let i=e.slice(0,n).trim();if(!dl.test(i))return null;let o=Number(e.slice(t));return Number.isFinite(o)?{refId:i,operator:r,magnitude:o}:null}function so(e){let t=(e??"").trim();if(!t)return null;let n=Bt(t);if(n!=null)return{kind:"absolute",value:n};if(dl.test(t))return{kind:"reference",refId:t,offset:0};let r=dp(t);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}function ml(e){return Number.isFinite(e)&&e>0?Math.max(.1,Math.min(5,e)):1}function ve(e){return Bt(e)}function Ce(e){let t=Number.parseFloat(e.getAttribute("data-playback-rate")??""),n=Number.isFinite(t)&&t>0?t:typeof HTMLMediaElement<"u"&&e instanceof HTMLMediaElement?e.defaultPlaybackRate:1;return ml(n)}function yn(e){let t=n=>{let r=ve(n);return r==null?null:Number.isFinite(r)&&r>=0?r:null};return t(e.getAttribute("data-playback-start"))??t(e.getAttribute("data-media-start"))??0}function Ze(e,t){return fp(t,yn(e),Ce(e))}function fp(e,t,n){return Number.isFinite(e)?Math.max(0,e-t)/ml(n):null}function mp(e,t,n){let r=e.filter(o=>Number.isFinite(o.time)&&Number.isFinite(o.volume)).map(o=>({time:Math.max(0,o.time-t),volume:Le(o.volume)})).sort((o,a)=>o.time-a.time),i=[];for(let o of r){let a=i.at(-1);a&&Math.abs(a.time-o.time)<1e-9?a.volume=o.volume:i.push(o)}return i.length===0||i[0].time>0&&i.unshift({time:0,volume:Le(n)}),i}function pl(e,t){if(e.length===0)return 1;let n=0;for(;n<e.length-2&&t>=e[n+1].time;)n+=1;let r=e[n],i=e[n+1]??r,o=i.time-r.time,a=o<=0?0:Math.min(1,Math.max(0,(t-r.time)/o));return r.volume+(i.volume-r.volume)*a}function pp(e,t,n,r){let i=e.at(-1);!i||Math.abs(i.volume-n.volume)>1e-4?(i&&t&&t.time>i.time&&e.push(t),e.push(n)):r&&n.time>i.time&&e.push(n)}function hp(e){let t=Number.parseFloat(e??"");return Number.isFinite(t)?t:void 0}function hl(e,t){let n=ve(e.dataset.start)??0,r=ve(e.dataset.end)??void 0,i=ve(e.dataset.duration)??void 0,o=t;i!==void 0&&i>0?o=n+i:r!==void 0&&r>n&&(o=r);let a=hp(e.dataset.volume)??1;return{start:n,end:o,staticVolume:Le(a)}}function gp(e,t,n,r){let{start:i,end:o,staticVolume:a}=hl(e,n),l=1/Math.min(60,Math.max(1,r)),s=Math.max(0,i),u=Math.min(n,o),c=ul(e,()=>{e.volume=a;let f=[],p;for(let b=s;b<=u+1e-6;b=Math.min(u,b+l)){t(b);let v=Number(e.volume);if(Number.isFinite(v)){let x={time:Number(b.toFixed(6)),volume:Number(Le(v).toFixed(6))};pp(f,p,x,b===u),p=x}if(b===u)break}return f});return c.some(f=>Math.abs(f.volume-a)>1e-4)?c:null}function gl(e,t,n,r,i={}){if(i.allowLiveTimelineSeek===!1||!t||!(e instanceof HTMLAudioElement)&&!(e instanceof HTMLVideoElement)||n<=0)return;let o=s=>{try{typeof t.totalTime=="function"?t.totalTime(s,!0):typeof t.seek=="function"&&t.seek(s,!0)}catch{}},a=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,l=gp(e,o,n,60);if(Number.isFinite(a)&&o(a),l){let{start:s,staticVolume:u}=hl(e,n),c=mp(l,s,u);c.length>0&&r.set(e,c)}}var Rt="data-fx-chain",vv=Rt.slice(5),bl=1,vn=(e="frequency",t="Frequency",n=1e3,r=20,i=2e4)=>({kind:"number",key:e,label:t,unit:"Hz",min:r,max:i,step:1,default:n,scale:"log",automatable:!0}),lo=(e=.707,t="Bandwidth \u2014 higher is narrower.")=>({kind:"number",key:"q",label:"Q",unit:"",min:.1,max:20,step:.01,default:e,scale:"log",automatable:!0,hint:t}),Mr=(e=-40,t=40,n=0)=>({kind:"number",key:"gain",label:"Gain",unit:"dB",min:e,max:t,step:.1,default:n,automatable:!0}),xl={kind:"enum",key:"poles",label:"Slope",options:[{value:"1",label:"6 dB/oct"},{value:"2",label:"12 dB/oct"}],default:"2",hint:"Two poles is the usual biquad; one pole is gentler."},vl=[{id:"gain",label:"Gain",group:"dynamics",description:"Raise or lower the whole signal. Automate it to duck under something else.",params:[Mr(-60,12,0)],web:"gain-node"},{id:"peaking",label:"Peaking EQ",group:"filter",description:"Boost or cut a band, leaving everything either side alone.",params:[vn("frequency","Frequency",1e3),Mr(-40,40,0),lo(1)],web:"biquad-peaking"},{id:"lowshelf",label:"Low Shelf",group:"filter",description:"Lift or drop everything below the corner frequency.",params:[vn("frequency","Frequency",200,20,2e3),Mr(-40,40,0)],web:"biquad-lowshelf"},{id:"highshelf",label:"High Shelf",group:"filter",description:"Lift or drop everything above the corner frequency.",params:[vn("frequency","Frequency",4e3,500,2e4),Mr(-40,40,0)],web:"biquad-highshelf"},{id:"highpass",label:"High-pass",group:"filter",description:"Remove low frequencies \u2014 the usual fix for rumble on a voice.",params:[vn("frequency","Cutoff",300,20,2e4),lo(.707),xl],web:"biquad-highpass"},{id:"lowpass",label:"Low-pass",group:"filter",description:"Remove high frequencies \u2014 darkens or muffles a track.",params:[vn("frequency","Cutoff",8e3,100,2e4),lo(.707),xl],web:"biquad-lowpass"},{id:"compressor",label:"Compressor",group:"dynamics",description:"Pull loud parts down so the quiet ones can come up.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-60,max:0,step:.5,default:-24,hint:"Level above which the compressor starts working."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:4},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:2e3,step:.1,default:20,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:250,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83,hint:"1 is a hard corner; higher eases into it."},{kind:"number",key:"makeup",label:"Makeup",unit:"dB",min:0,max:36,step:.1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1,hint:"Below 1 blends the dry signal back in."}],web:"worklet-compressor"},{id:"limiter",label:"Limiter",group:"dynamics",description:"Hard ceiling \u2014 nothing gets past the limit.",params:[{kind:"number",key:"limit",label:"Ceiling",unit:"dB",min:-24,max:0,step:.1,default:-1},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.1,max:80,step:.1,default:5},{kind:"number",key:"release",label:"Release",unit:"ms",min:1,max:8e3,step:1,default:50,scale:"log"},{kind:"number",key:"level_out",label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0}],web:"worklet-limiter"},{id:"gate",label:"Noise Gate",group:"dynamics",description:"Silence the track when it drops below the threshold.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-80,max:0,step:.5,default:-35},{kind:"number",key:"range",label:"Range",unit:"dB",min:-80,max:0,step:.5,default:-24,hint:"How far down the gate pulls when closed."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:10},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:9e3,step:.1,default:1,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:100,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83}],web:"worklet-gate"},{id:"saturate",label:"Saturation",group:"nonlinear",description:"Soft-clip the waveform for warmth or outright distortion.",params:[{kind:"enum",key:"type",label:"Curve",options:[{value:"tanh",label:"Tanh"},{value:"atan",label:"Arctan"},{value:"cubic",label:"Cubic"},{value:"exp",label:"Exponential"},{value:"alg",label:"Algebraic"},{value:"quintic",label:"Quintic"},{value:"sin",label:"Sine"},{value:"erf",label:"Error function"},{value:"hard",label:"Hard clip"}],default:"tanh"},{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-40,max:0,step:.1,default:-6},{kind:"number",key:"output",automatable:!0,label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0},{kind:"number",key:"oversample",label:"Oversample",unit:"x",min:1,max:8,step:1,default:4,hint:"Higher costs more but keeps aliasing down."}],web:"waveshaper"},{id:"bitcrush",label:"Bitcrush",group:"nonlinear",description:"Drop bit depth and sample rate for a lo-fi, digital sound.",params:[{kind:"number",key:"bits",label:"Bit depth",unit:"bit",min:1,max:32,step:.1,default:8},{kind:"number",key:"samples",label:"Sample hold",unit:"x",min:1,max:250,step:1,default:1,hint:"Repeats each sample N times \u2014 a crude downsample."},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-bitcrush"},{id:"pitchshift",label:"Pitch shift",group:"time",description:"Shifts pitch up or down without changing playback speed. Adds ~50 ms of latency.",params:[{kind:"number",key:"semitones",label:"Semitones",unit:"st",min:-12,max:12,step:1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-pitchshift"},{id:"delay",label:"Delay",group:"time",description:"Repeating echoes behind the dry signal.",params:[{kind:"number",key:"time",automatable:!0,label:"Time",unit:"ms",min:1,max:5e3,step:1,default:250,scale:"log"},{kind:"number",key:"feedback",automatable:!0,label:"Feedback",unit:"",min:.01,max:.95,step:.01,default:.35},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.4}],web:"delay-feedback"},{id:"chorus",label:"Chorus",group:"time",description:"Detuned copies of the signal for width and thickness.",params:[{kind:"number",key:"delay",automatable:!0,label:"Delay",unit:"ms",min:1,max:100,step:.1,default:7},{kind:"number",key:"depth",automatable:!0,label:"Depth",unit:"ms",min:0,max:10,step:.01,default:2},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.01,max:10,step:.01,default:1},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.5}],web:"chorus-lfo"},{id:"phaser",label:"Phaser",group:"time",description:"Sweeping notches moving through the spectrum.",params:[{kind:"number",key:"in_gain",automatable:!0,label:"Input",unit:"",min:0,max:1,step:.01,default:.4},{kind:"number",key:"out_gain",automatable:!0,label:"Output",unit:"",min:0,max:2,step:.01,default:.74},{kind:"number",key:"delay",label:"Delay",unit:"ms",min:.1,max:5,step:.1,default:3},{kind:"number",key:"decay",label:"Decay",unit:"",min:0,max:.99,step:.01,default:.4},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.1,max:2,step:.01,default:.5},{kind:"enum",key:"type",label:"Waveform",options:[{value:"0",label:"Triangular"},{value:"1",label:"Sinusoidal"}],default:"0"}],web:"allpass-phaser"},{id:"reverb",label:"Reverb",group:"time",description:"Room tail. Both ends convolve the same generated impulse, so preview matches render.",params:[{kind:"number",key:"size",label:"Room size",unit:"",min:.05,max:1,step:.01,default:.7},{kind:"number",key:"damping",label:"Damping",unit:"",min:0,max:1,step:.01,default:.5,hint:"Higher rolls the top off the tail faster."},{kind:"number",key:"wet",automatable:!0,label:"Wet",unit:"",min:0,max:1,step:.01,default:.35},{kind:"number",key:"dry",automatable:!0,label:"Dry",unit:"",min:0,max:1,step:.01,default:.7}],web:"convolver"}],uo=new Map(vl.map(e=>[e.id,e]));function Sn(e){return uo.get(e)}var Sv=vl.map(e=>e.id);function An(e,t){let n=uo.get(e);if(!n)return{};let r={};for(let i of n.params){let o=t?.[i.key];if(i.kind==="enum"){let l=i.options.some(s=>s.value===o);r[i.key]=l?o:i.default;continue}let a=typeof o=="number"?o:typeof o=="string"&&o.trim()!==""?Number(o):Number.NaN;r[i.key]=Number.isFinite(a)?Math.min(i.max,Math.max(i.min,a)):i.default}return r}var ct=class extends Error{constructor(t){super(t),this.name="AudioFxChainError"}};function Sl(e){let t;try{t=JSON.parse(e)}catch(i){throw new ct(`Chain file is not valid JSON: ${i.message}`)}if(typeof t!="object"||t===null)throw new ct("Chain file must be a JSON object.");let n=t;if(n.version!==bl)throw new ct(`Unsupported chain version: ${String(n.version)}`);if(!Array.isArray(n.nodes))throw new ct("Chain file is missing a `nodes` array.");let r=n.nodes.map(bp);return{version:bl,nodes:r}}function En(e){return e.nodes.filter(t=>t.enabled!==!1)}function bp(e,t){if(typeof e!="object"||e===null)throw new ct(`Node ${t} is not an object.`);let n=e;if(typeof n.type!="string"||!uo.has(n.type))throw new ct(`Node ${t} has unknown effect type: ${String(n.type)}`);return yp({type:n.type,id:Fr(n.id),fromCarve:yl(n.fromCarve),fromPreset:Fr(n.fromPreset),label:Fr(n.label),fromEq:Fr(n.fromEq),fromLeveller:yl(n.fromLeveller),presetAmount:xp(n.presetAmount),enabled:n.enabled!==!1,params:An(n.type,n.params??void 0)})}function Fr(e){return typeof e=="string"&&e?e:void 0}function yl(e){return e===!0?!0:void 0}function xp(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(1,Math.max(0,e))}function yp(e){for(let t of Object.keys(e))e[t]===void 0&&delete e[t];return e}var tt="data-automation",Cv=tt.slice(5),Nr=1,vp=512,et=class extends Error{constructor(t){super(t),this.name="AudioAutomationError"}},Ut="volume";function Cn(e){if(e===Ut)return{kind:"volume"};let t=e.split(".");if(t.length===3&&t[0]==="fx"&&t[1]===Sp){let i=t[2];return i?{kind:"preset",presetId:i}:null}if(t.length!==3||t[0]!=="fx")return null;let[,n,r]=t;return!n||!r?null:{kind:"fx",nodeId:n,param:r}}var Sp="preset";var Ap={min:0,max:1,step:.01,unit:"",label:"Amount",scale:"linear",default:1},Lr={min:0,max:ao,step:.01,unit:"",label:"Volume",scale:"linear",default:1};function co(e,t){let n=Cn(e);if(!n)return null;if(n.kind==="volume")return Lr;if(n.kind==="preset")return t?.nodes.some(l=>l.fromPreset===n.presetId)?{...Ap,label:`${n.presetId} \xB7 Amount`}:null;let r=t?.nodes.find(a=>a.id===n.nodeId);if(!r)return null;let i=Sn(r.type),o=i?.params.find(a=>a.key===n.param);return!o||o.kind!=="number"?null:{min:o.min,max:o.max,step:o.step,unit:o.unit,label:`${i?.label??r.type} \xB7 ${o.label}`,scale:o.scale==="log"&&o.min>0?"log":"linear",default:o.default}}function wn(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null}function Ep(e){let t=wn(e);return t===null||t===0?0:Math.min(1,Math.max(-1,t))}function Al(e,t){let n=wn(e),r=wn(t);if(n===null||r===null)return null;let i=l=>Math.min(.999,Math.max(.001,l)),o=i(n),a=i(r);return Math.abs(o-a)<1e-6?null:{x:o,y:a}}function wp(e){let t=Ep(e?.curve),n=Al(e?.viaX,e?.viaY);return{...t?{curve:t}:{},...n?{viaX:n.x,viaY:n.y}:{}}}function Cp(e,t){let n=wn(e?.t),r=wn(e?.v);if(n===null||r===null)return null;let i=t?Math.min(t.max,Math.max(t.min,r)):r;return{t:Math.max(0,n),v:i,...wp(e)}}function El(e,t){let n=e.map(i=>Cp(i,t)).filter(i=>i!==null).sort((i,o)=>i.t-o.t),r=[];for(let i of n)r.length>0&&r[r.length-1].t===i.t?r[r.length-1]=i:r.push(i);return r.slice(0,vp)}function _p(e){let t=[];for(let n of e.lanes){if(!Cn(n.target))continue;let r=n.target===Ut?Lr:null,i=El(n.points??[],r);i.length>0&&t.push({target:n.target,points:i})}return{version:Nr,lanes:t}}function wl(e,t){let n=[];for(let r of e.lanes){let i=co(r.target,t);if(!i)continue;let o=El(r.points,i);o.length>0&&n.push({target:r.target,points:o})}return{version:Nr,lanes:n}}function Dr(e){let t;try{t=JSON.parse(e)}catch(i){throw new et(`Automation is not valid JSON: ${i.message}`)}if(typeof t!="object"||t===null)throw new et("Automation must be a JSON object.");let n=t;if(n.version!==Nr)throw new et(`Unsupported automation version: ${String(n.version)}`);if(!Array.isArray(n.lanes))throw new et("Automation is missing a `lanes` array.");let r=n.lanes.map((i,o)=>{if(typeof i!="object"||i===null)throw new et(`Lane ${o} is not an object.`);let a=i;if(typeof a.target!="string"||!Cn(a.target))throw new et(`Lane ${o} has an unreadable target: ${String(a.target)}`);if(!Array.isArray(a.points))throw new et(`Lane ${o} is missing a \`points\` array.`);return{target:a.target,points:a.points}});return _p({version:Nr,lanes:r})}function Tp(e,t){return t?Math.pow(e,Math.pow(2,2*t)):e}function Rp(e,t){let n=e-.5,r=t-.5,i=.999,o=1e6,a=n>0?n/(i-e):n<0?-n/(e-(1-i)):0,l=r>0?r/(i-t):r<0?-r/(t-(1-i)):0,s=Math.min(o,Math.max(1,a,l));return{cx:e+n/s,cy:t+r/s,w:s}}function kp(e,t,n){let{cx:r,cy:i,w:o}=Rp(t,n),a=2-2*o,l=e*a-1+2*o*r,s=-e*a-2*o*r,u=Mp(l,s,e),c=1-u,m=c*c+2*o*u*c+u*u;return m>0?(2*o*i*u*c+u*u)/m:e}function Mp(e,t,n){if(Math.abs(e)<1e-12)return Math.abs(t)<1e-12?n:-n/t;let r=Math.sqrt(Math.max(0,t*t-4*e*n)),i=(-t+r)/(2*e),o=(-t-r)/(2*e),a=l=>l>=-1e-9&&l<=1+1e-9;return a(i)?Math.min(1,Math.max(0,i)):a(o)?Math.min(1,Math.max(0,o)):n}function Fp(e,t){let n=Al(t.viaX,t.viaY);return n?kp(Math.min(1,Math.max(0,e)),n.x,n.y):Tp(e,t.curve)}function Np(e,t,n,r){return r==="log"&&e>0&&t>0?Math.exp(Math.log(e)+(Math.log(t)-Math.log(e))*n):e+(t-e)*n}function _n(e,t,n="linear"){let r=e.points;if(r.length===0)return 0;let i=r[0];if(t<=i.t)return i.v;let o=r[r.length-1];if(t>=o.t)return o.v;let a=0,l=r.length-1;for(;l-a>1;){let m=a+l>>1;r[m].t<=t?a=m:l=m}let s=r[a],u=r[l],c=u.t-s.t;return c<=0?u.v:Np(s.v,u.v,Fp((t-s.t)/c,s),n)}function Cl(e){return e.points.length<=1||e.points.every(t=>t.v===e.points[0].v)}function _l(e,t,n,r,i="linear"){let o=Math.max(2,Math.floor(r)),a=new Float32Array(o),l=n-t;for(let s=0;s<o;s+=1)a[s]=_n(e,t+l*s/(o-1),i);return a}var Ir=new Map,Lp=64;function Dp(e){let t=Ir.get(e);if(t!==void 0)return t;let n=null;try{n=Dr(e).lanes.find(r=>r.target===Ut)??null}catch{n=null}return Ir.size>Lp&&Ir.clear(),Ir.set(e,n),n}function Tl(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(tt):null)??"";if(!n)return null;let r=Dp(n);return!r||r.points.length===0?null:_n(r,t)}var Wt="hf-audio-group",Pr="data-audio-group";function fo(e){let t=e?.getAttribute("data-volume"),n=t?parseFloat(t):1;return Number.isFinite(n)?n:1}function mo(e,t){let n=Array.from(e?.querySelectorAll?.(`${Wt}[${xn}]`)??[]).find(i=>i.getAttribute(xn)===t);if(n)return n;let r=e?.getElementById(t)??null;return r&&r.tagName?.toLowerCase()===Wt?r:null}function Or(e,t){let n=t?.getAttribute?.(il)??t?.getAttribute?.(Pr);return n?mo(e,n)?.hasAttribute("data-hidden")??!1:!1}function Rl(e){return typeof e.tagName!="string"||e.tagName.toLowerCase()!=="audio"||typeof e.getAttribute!="function"?null:e.getAttribute(Pr)||null}function kl(e){let t="__hf-audio-group-inert";if(!e?.head||e.getElementById(t))return;let n=e.createElement("style");n.id=t,n.textContent=`${Wt}{display:none!important}`,e.head.appendChild(n)}function je(e){return yn(e)}function Ml(e){let t=e.isVideo?e.explicitDuration??e.sourceDuration:e.sourceDuration,n=(e.isVideo?[t,e.hostRemaining]:[t,e.hostRemaining,e.explicitDuration]).filter(r=>r!=null&&Number.isFinite(r)&&r>=0);return n.length>0?Math.min(...n):null}function Fl(e){let t=Array.from(document.querySelectorAll("video, audio")),n=e?.shouldIncludeElement?t.filter(a=>e.shouldIncludeElement?.(a)):t.filter(a=>a.hasAttribute("data-start")),r=[],i=[],o=0;for(let a of n){let l=e?.resolveStartSeconds?e.resolveStartSeconds(a):Number.parseFloat(a.dataset.start??"0");if(!Number.isFinite(l))continue;let s=je(a),u=Ce(a),c=a.loop,m=Number.isFinite(a.duration)&&a.duration>0?a.duration:null,f=e?.resolveDurationSeconds?.(a)??Number.parseFloat(a.dataset.duration??"");(!Number.isFinite(f)||f<0)&&m!=null&&(f=Math.max(0,(m-s)/u));let p=Number.isFinite(f)&&f>=0,b=p?l+f:Number.POSITIVE_INFINITY,v=Number.parseFloat(a.dataset.volume??""),x={el:a,start:l,mediaStart:s,duration:p?f:Number.POSITIVE_INFINITY,end:b,volume:Number.isFinite(v)?v:null,playbackRate:u,loop:c,sourceDuration:m};r.push(x),a.tagName==="VIDEO"&&i.push(x),Number.isFinite(b)&&(o=Math.max(o,b))}return{timedMediaEls:n,mediaClips:r,videoClips:i,maxMediaEnd:o}}var ho=new WeakMap,Hr=new WeakMap,Tn=new WeakMap,go=new WeakSet,Vt=new WeakSet;function Ip(e){if(Vt.has(e))return;Vt.add(e);let t=()=>Vt.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}var Pp=3;function Op(e){return e.error!=null||e.networkState===Pp}var bo=new WeakMap;function po(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function xo(e){ho.delete(e),Hr.delete(e),Tn.delete(e),go.delete(e),bo.delete(e)}function Nl(e){let t=!!(e.outputMuted||e.userMuted);for(let n of e.clips){let{el:r}=n;if(!r.isConnected)continue;let i=(e.timeSeconds-n.start)*n.playbackRate+n.mediaStart,o=r.tagName==="VIDEO"&&!n.loop,a=o&&n.sourceDuration!=null&&i>=n.sourceDuration&&e.timeSeconds>=n.start&&e.timeSeconds<n.end;a&&n.sourceDuration!=null&&(i=n.sourceDuration);let l=Hr.get(r),s=r.tagName==="AUDIO"&&(l===void 0||i<l-.04),u=!n.loop&&n.sourceDuration!=null&&i>=n.mediaStart&&i<n.sourceDuration&&(o||s);if(e.timeSeconds>=n.start&&e.timeSeconds<n.end&&i>=0&&(!r.ended||n.loop||a||u)){if(Hr.set(r,i),n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let H=n.sourceDuration-n.mediaStart;H>0&&i>=n.sourceDuration&&(i=n.mediaStart+(i-n.mediaStart)%H)}let f=po(e.userVolume??1),p=Le(n.volume??1),b=bo.get(r),v=po(r.volume),x,_=Tl(r,e.timeSeconds-n.start);if(_!==null)x=Le(_);else if(n.volumeKeyframes&&n.volumeKeyframes.length>0){let H=e.timeSeconds-n.start;x=Le(pl(n.volumeKeyframes,H))}else e.isWebAudioRouted?.(r)?x=p:b===void 0?x=p>1?p:v:Math.abs(v-b)>1e-4?x=v:x=p;let T=r.closest("[data-hidden]")!==null||Or(r.ownerDocument,r)?0:po(x*f);r.volume=T,bo.set(r,T),e.onElementVolume?.(r,T,x),(t||e.isWebAudioOwned?.(r))&&(r.muted=!0),r.preload!=="auto"&&(r.preload="auto");try{r.playbackRate=n.playbackRate*e.playbackRate}catch(H){L("runtime.media.site1",H)}let M=.04,F=2,E=r.currentTime||0,S=Math.abs(E-i),A=i-E,C=ho.get(r);ho.set(r,A);let N=C===void 0,I=!N&&Math.abs(A-C)>.5,W=S>3,U=r.tagName==="AUDIO"&&N&&E-i>M,oe=a&&S>.001||r.ended&&u&&S>.001||U||S>.5&&(N||I||W),k=r.tagName==="VIDEO"&&!r.paused,V=C!==void 0&&Math.abs(A-C)<.004,Q=!1;if(!k&&!oe&&!N&&V&&S>M){let H=(Tn.get(r)??0)+1;Tn.set(r,H),H>=F&&(Q=!0,Tn.set(r,0))}else S<=M&&Tn.set(r,0);let G=!k&&e.forceSync&&S>.02;if(oe||Q||G){if(!(r.tagName==="VIDEO"&&!!ut(r))){try{r.currentTime=i}catch(z){L("runtime.media.site2",z)}if(Math.abs(r.currentTime-i)>.5&&!go.has(r)){go.add(r),r.load();try{r.currentTime=i}catch(z){L("runtime.media.site3",z)}}}Vt.delete(r)}a?r.paused||r.pause():e.playing&&r.paused&&!Vt.has(r)&&!Op(r)?(Ip(r),r.play().catch(H=>{Vt.delete(r),(H&&typeof H=="object"&&"name"in H?String(H.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!e.playing&&!r.paused&&r.pause();continue}let m=e.timeSeconds>=n.start&&e.timeSeconds<n.end;xo(r),m&&Hr.set(r,i),r.paused||r.pause()}}var Hp="hf-proxy",Ll="runtime_media_proxy_fallback",Dl="runtime_media_proxy_unavailable",Rn=new WeakSet,Il=new WeakSet;function Gr(e){return e.currentSrc||e.src}function yo(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:e instanceof HTMLVideoElement&&!!ut(e)}function vo(e){let t=Gr(e);if(!t)return null;let n;try{n=new URL(t,document.baseURI)}catch{return null}if(n.origin!==window.location.origin)return null;try{return decodeURIComponent(n.pathname)}catch{return n.pathname}}function Gp(e,t){let n=null;for(let r of Object.keys(t))e.endsWith(r)&&(n===null||r.length>n.length)&&(n=r);return n?t[n]??null:null}function Bp(e,t){let n=e.normalize("NFC").toLowerCase(),r=-1,i=null,o=!1;for(let[a,l]of Object.entries(t)){let s=a.normalize("NFC").toLowerCase();n.endsWith(s)&&(s.length>r?(r=s.length,i=l,o=!1):s.length===r&&(o=!0))}return o?null:i}function So(e,t){return t[e]??Gp(e,t)??Bp(e,t)}function Up(e,t){let n=new URL(e,document.baseURI);return n.searchParams.set(Hp,t?t.hasAlpha?"vp8":"h264":"auto"),n.href}var Wp={cross_origin:"video reports zero decodable width but its source is cross-origin; no local proxy can be served for it",proxy_playback_failed:"the authoring proxy itself failed to decode; render output is unaffected",browser_safe_codec:"the file errored but its codec is browser-decodable; a proxy cannot help (the file itself is likely corrupt)",invalid_source_url:"the media source URL is malformed and cannot be proxied"};function kt(e,t,n){if(Il.has(e))return;Il.add(e);let r=Wp[t];xe({source:"hf-preview",type:"diagnostic",code:Dl,details:{asset:n,codecName:null,reason:t,note:r}}),console.info(`[hyperframes] ${Dl}: "${n}" (${t}): ${r}`)}function Ao(e,t=null,n="reactive"){if(Rn.has(e))return;let r=Gr(e),i;try{i=Up(r,t)}catch(l){L("runtime.mediaProxy.swap",l),kt(e,"invalid_source_url",r);return}Rn.add(e),xo(e),e.src=i,e.load();let o=t?.codecName??null;xe({source:"hf-preview",type:"diagnostic",code:Ll,details:{asset:r,codecName:o,trigger:n,note:"render output is unaffected; only this preview element was swapped to an authoring proxy"}}),console.info(`[hyperframes] ${Ll}: "${r}" uses a codec (${o??"unknown"}) this browser can't decode; auto-swapped to an authoring proxy for this preview only. Render output is unaffected.`)}function Pl(e){if(yo(e)||!(e instanceof HTMLVideoElement)||Rn.has(e))return;let t=window.__HF_MEDIA_CODEC_MAP__;if(!t)return;let n=vo(e);if(n===null)return;let r=So(n,t);if(!r||!r.browserHostile)return;let i=r.representativeMime?e.canPlayType(r.representativeMime):"";i==="probably"||i==="maybe"||Ao(e,r,"proactive")}function Ol(e){if(yo(e)||!(e instanceof HTMLVideoElement)||e.videoWidth!==0)return;let t=Gr(e);if(Rn.has(e)){kt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=vo(e);if(r===null){kt(e,"cross_origin",t);return}let i=So(r,n);if(i&&!i.browserHostile){kt(e,"browser_safe_codec",t);return}Ao(e,i,"reactive")}function Hl(e){if(yo(e)||!(e instanceof HTMLVideoElement))return;let t=Gr(e);if(Rn.has(e)){kt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=vo(e);if(r===null){kt(e,"cross_origin",t);return}let i=So(r,n);if(i&&!i.browserHostile){kt(e,"browser_safe_codec",t);return}Ao(e,i,"tertiary")}var Se=class extends Error{constructor(n,r=null){super(r==null?n:`${n} at line ${r}`);ge(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=r}},Vp=[0,0,0],zp=[1,1,1],Br=64;function qp(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r==='"'&&(t=!t),r==="#"&&!t)return e.slice(0,n)}return e}function dt(e,t){let n=Number(e);if(!Number.isFinite(n))throw new Se(`Invalid number "${e}"`,t);return n}function Gl(e,t,n){if(e.length!==3)throw new Se(`${t} expects three numbers`,n);return[dt(e[0],n),dt(e[1],n),dt(e[2],n)]}function Bl(e,t,n){if(!e)throw new Se(`${t} expects a size`,n);let r=Number(e);if(!Number.isInteger(r)||r<2)throw new Se(`${t} must be an integer greater than 1`,n);return r}function $p(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new Se("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function jp(e){let t=/^TITLE\s+"([^"]*)"\s*$/i.exec(e);if(t)return t[1]??null;let n=/^TITLE\s+(.+)\s*$/i.exec(e);return n&&(n[1]??"").trim()||null}function Kp(e){return/^[+-]?(?:\d|\.\d)/.test(e)}function Ul(e,t={}){let n=t.maxSize??Br,r=null,i=Vp,o=zp,a=null,l=null,s=[],u=e.replace(/^\uFEFF/,"").split(/\r?\n/);for(let m=0;m<u.length;m++){let f=m+1,p=qp(u[m]??"").trim();if(!p)continue;let b=p.split(/\s+/),v=(b[0]??"").toUpperCase(),x=b.slice(1);if(v==="TITLE"){r=jp(p);continue}if(v==="DOMAIN_MIN"){i=Gl(x,v,f);continue}if(v==="DOMAIN_MAX"){o=Gl(x,v,f);continue}if(v==="LUT_3D_INPUT_RANGE"){if(x.length!==2)throw new Se(`${v} expects two numbers`,f);let _=dt(x[0],f),R=dt(x[1],f);if(R<=_)throw new Se("LUT_3D_INPUT_RANGE max must exceed min",f);i=[_,_,_],o=[R,R,R];continue}if(v==="LUT_1D_SIZE"){a=Bl(x[0],v,f);continue}if(v==="LUT_3D_SIZE"){if(l=Bl(x[0],v,f),l>n)throw new Se(`LUT_3D_SIZE ${l} exceeds max ${n}`,f);continue}if(!Kp(v)){if(v.startsWith("LUT_"))throw new Se(`Unsupported cube keyword ${v}`,f);continue}if(!l)throw a?new Se("1D cube LUTs are not supported yet",f):new Se("LUT data appears before LUT_3D_SIZE",f);if(b.length!==3)throw new Se("LUT data rows must contain three numbers",f);s.push(dt(b[0],f),dt(b[1],f),dt(b[2],f))}if(a&&l)throw new Se("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw a?new Se("1D cube LUTs are not supported yet"):new Se("Missing LUT_3D_SIZE");$p(i,o);let c=l*l*l;if(s.length!==c*3)throw new Se(`Expected ${c} LUT rows for size ${l}, found ${s.length/3}`);return{title:r,size:l,domainMin:i,domainMax:o,data:new Float32Array(s)}}function Yp(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function kn(e){return Math.round(Yp(e)*255)}function Eo(e){let t=e.size,n=t*t,r=t,i=new Uint8Array(n*r*4);for(let o=0;o<t;o++)for(let a=0;a<t;a++)for(let l=0;l<t;l++){let s=((o*t+a)*t+l)*3,u=(a*n+o*t+l)*4;i[u]=kn(e.data[s]??0),i[u+1]=kn(e.data[s+1]??0),i[u+2]=kn(e.data[s+2]??0),i[u+3]=255}return{width:n,height:r,data:i}}var Wl="rec709";var me={hueDegrees:{min:0,max:360,inclusiveMax:!1},unit:{min:0,max:1},signedUnit:{min:-1,max:1},secondaryHueRange:{min:0,max:180},secondaryHueSoftness:{min:0,max:180},secondaryHueCombinedMax:180,secondarySoftRangeSoftness:{min:0,max:.5},secondaryHueShift:{min:-180,max:180},effects:{asciiStyle:{min:0,max:7},bloom:{min:0,max:3},bloomRadius:{min:1,max:100},monoScreenShape:{min:0,max:4}}};var Vl=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"],zl=["shadows","midtones","highlights"],ql=["master","red","green","blue"],$l=["hueVsHue","hueVsSaturation","hueVsLuma"];var jl=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],Kl=["blur","pixelate","chromaBleed","tapeDamage","tapeTracking","tapeNoise","tapeSpeed","filmArtifacts","halftone","halftoneSize","twoInkPrint","twoInkPrintSize","ascii","asciiSize","asciiInvert","asciiStyle","asciiColor","asciiRotation","dither","ditherSize","bloom","bloomRadius","monoScreen","monoScreenSize","monoScreenAngle","monoScreenSpread","monoScreenShape","monoScreenInvert","scanlines","scanlineCount","scanlineSoftness","chromaticAberration","chromaticAngle","crtCurvature","digitalGlitch","digitalGlitchColorSplit","digitalGlitchLineTear","digitalGlitchPixelate","digitalGlitchBlockAmount","digitalGlitchBlockDisplacement","digitalGlitchBlockOpacity","digitalGlitchSpeed","engraving","engravingSpacing","engravingMinThickness","engravingMaxThickness","engravingAngle","engravingContrast","engravingSharpness","engravingWave","engravingWaveFrequency","crosshatch","crosshatchSpacing","crosshatchThickness","crosshatchAngle","crosshatchContrast","crosshatchEdges","crosshatchLineWeight","crosshatchWave","crosshatchWaveFrequency","kuwahara","kuwaharaRadius","kuwaharaSharpness","kuwaharaSaturation"];var Yv=me.unit,Xv=me.signedUnit,Jv=me.effects;var Ke=1024,Mn=16;function Yl(e,t,n,r){let i=((2*e+t)*n-e*r)/(e+t);return Math.sign(i)!==Math.sign(n)?0:Math.sign(n)!==Math.sign(r)&&Math.abs(i)>3*Math.abs(n)?3*n:i}function Ae(e,t){let n=e[t];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function Xp(e){let t=[],n=[],r=Ae(e,0);for(let a of e.slice(1)){let l=a[0]-r[0];t.push(l),n.push((a[1]-r[1])/l),r=a}let i=Ae(n,0);if(e.length===2)return[i,i];let o=new Array(e.length);o[0]=Yl(Ae(t,0),Ae(t,1),i,Ae(n,1)),o[o.length-1]=Yl(Ae(t,t.length-1),Ae(t,t.length-2),Ae(n,n.length-1),Ae(n,n.length-2));for(let a=1;a<e.length-1;a+=1){let l=Ae(n,a-1),s=Ae(n,a);if(l===0||s===0||Math.sign(l)!==Math.sign(s)){o[a]=0;continue}let u=Ae(t,a-1),c=Ae(t,a),m=2*c+u,f=c+2*u;o[a]=(m+f)/(m/l+f/s)}return o}function Xl(e,t){if(e.length<2)throw new RangeError("A color curve requires at least two points");if(!Number.isInteger(t)||t<2)throw new RangeError("Curve LUT size must be at least 2");let n=Number.NEGATIVE_INFINITY;for(let[r,i]of e){if(!Number.isFinite(r)||!Number.isFinite(i))throw new TypeError("Color curve points must be finite");if(r<=n)throw new RangeError("Color curve inputs must be strictly increasing");n=r}}function Jp(e,t,n){if(!Number.isFinite(t)||!Number.isFinite(n)||t>=n)throw new RangeError("Curve output bounds must be finite and increasing");if(e.some(([,r])=>r<t||r>n))throw new RangeError(`Curve outputs must be between ${t} and ${n}`)}function Qp(e,t,n,r,i){let o=n[0]-t[0],a=Math.min(1,Math.max(0,(e-t[0])/o)),l=a*a,s=l*a;return(2*s-3*l+1)*t[1]+(s-2*l+a)*o*r+(-2*s+3*l)*n[1]+(s-l)*o*i}function Jl(e,t,n,r,i){Jp(e,r,i);let o=Xp(e),a=new Float32Array(t),l=0;for(let s=0;s<t;s+=1){let u=n(s);for(;l<e.length-2&&u>Ae(e,l+1)[0];)l+=1;let c=Ae(e,l),m=Ae(e,l+1),f=Qp(u,c,m,Ae(o,l),Ae(o,l+1));a[s]=Math.min(i,Math.max(r,f))}return a}function zt(e,t=Ke){if(Xl(e,t),e.length>Mn)throw new RangeError(`A color curve supports at most ${Mn} points`);if(e.some(([n])=>n<0||n>1))throw new RangeError("Color curve inputs must be between 0 and 1");if(e[0]?.[0]!==0||e[e.length-1]?.[0]!==1)throw new RangeError("Color curves must include input endpoints 0 and 1");return Jl(e,t,n=>n/(t-1),0,1)}function Co(e,t,n,r=Ke){if(e.length<3)throw new RangeError("A hue curve requires at least three points");if(e.length>Mn)throw new RangeError(`A hue curve supports at most ${Mn} points`);let i=[...e].sort((s,u)=>s[0]-u[0]);for(let s=0;s<i.length;s+=1){let u=i[s];if(!u||u[0]<0||u[0]>=360)throw new RangeError("Hue curve inputs must be from 0 up to 360 degrees");if(s>0&&u[0]===i[s-1]?.[0])throw new RangeError("Hue curve inputs must be unique")}let o=i.slice(-2).map(([s,u])=>[s-360,u]),a=i.slice(0,2).map(([s,u])=>[s+360,u]),l=[...o,...i,...a];return Xl(l,r),Jl(l,r,s=>s/r*360,t,n)}var Fn="data-color-grading",Nn="data-hf-color-grading-source-hidden",Vr="data-hf-authored-opacity",nu="__hf_color_grading_",eh=Wl,Ro={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},ko={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},Mo={blur:0,pixelate:0,chromaBleed:0,tapeDamage:0,tapeTracking:0,tapeNoise:1,tapeSpeed:.5,filmArtifacts:0,halftone:0,halftoneSize:0,twoInkPrint:0,twoInkPrintSize:0,ascii:0,asciiSize:5/76,asciiInvert:0,asciiStyle:0,asciiColor:1,asciiRotation:0,dither:0,ditherSize:0,bloom:0,bloomRadius:8,monoScreen:0,monoScreenSize:0,monoScreenAngle:0,monoScreenSpread:0,monoScreenShape:0,monoScreenInvert:0,scanlines:0,scanlineCount:0,scanlineSoftness:0,chromaticAberration:0,chromaticAngle:0,crtCurvature:0,digitalGlitch:0,digitalGlitchColorSplit:0,digitalGlitchLineTear:0,digitalGlitchPixelate:0,digitalGlitchBlockAmount:0,digitalGlitchBlockDisplacement:0,digitalGlitchBlockOpacity:0,digitalGlitchSpeed:0,engraving:0,engravingSpacing:7/17,engravingMinThickness:.2,engravingMaxThickness:3.2/7,engravingAngle:.25,engravingContrast:7/15,engravingSharpness:.59,engravingWave:.2,engravingWaveFrequency:2/9,crosshatch:0,crosshatchSpacing:7/25,crosshatchThickness:.25,crosshatchAngle:.25,crosshatchContrast:1/3,crosshatchEdges:.5,crosshatchLineWeight:0,crosshatchWave:.33,crosshatchWaveFrequency:2/9,kuwahara:0,kuwaharaRadius:1/7,kuwaharaSharpness:5/16,kuwaharaSaturation:.5};var zr=Vl,ru=zl,iu=ql,ou=$l,No=jl,Lo=Kl,Ql={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},Zl={vignette:.18};function Ee(e,t,n={},r={},i={},o=1){return{id:e,label:t,intensity:o,adjust:{...Ro,...n},details:{...ko,...r},effects:{...Mo,...i}}}var Do=[Ee("neutral","Neutral"),Ee("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),Ee("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),Ee("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),Ee("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),Ee("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),Ee("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),Ee("vintage-wash","Vintage Wash",Ql,Zl),Ee("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),Ee("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),Ee("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),Ee("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),Ee("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),Ee("creator-camcorder","Creator Camcorder",{contrast:.08,highlights:-.05,shadows:.02,whites:.03,blacks:-.04,temperature:-.03,tint:-.015,vibrance:-.03,saturation:-.06},{vignette:.06,grain:.08,grainSize:.18,grainRoughness:.58},{chromaBleed:.55},.72),Ee("vhs-playback","VHS Playback",{contrast:-.04,saturation:-.08},{grain:.16,grainSize:.12,grainRoughness:.72},{tapeDamage:.82,tapeTracking:.85,tapeNoise:.3,tapeSpeed:.5,chromaBleed:.5,chromaticAberration:.18,scanlines:.35,scanlineCount:.17,scanlineSoftness:1,digitalGlitch:.32,digitalGlitchLineTear:.08,digitalGlitchSpeed:.5}),Ee("home-movie-8mm","8mm Home Movie",Ql,{...Zl,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),Ee("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),Ee("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],th=new Map(Do.map(e=>[e.id,e])),nh=/^\$(?:\{([A-Za-z0-9_.:-]+)\}|([A-Za-z0-9_.:-]+))$/,rh={exposure:{min:-2,max:2},contrast:{min:-1,max:1},highlights:{min:-1,max:1},shadows:{min:-1,max:1},whites:{min:-1,max:1},blacks:{min:-1,max:1},temperature:{min:-1,max:1},tint:{min:-1,max:1},vibrance:{min:-1,max:1},saturation:{min:-1,max:1}},qt={hue:0,amount:0,level:0},eu={amount:me.unit,level:me.signedUnit},ft=[[0,0],[1,1]],$t=[],ih={hueVsHue:me.secondaryHueShift,hueVsSaturation:me.signedUnit,hueVsLuma:me.signedUnit},_o={center:0,range:180,softness:0},To={min:0,max:1,softness:.05},oh={vignette:me.unit,vignetteMidpoint:me.unit,vignetteRoundness:me.signedUnit,vignetteFeather:me.unit,grain:me.unit,grainSize:me.unit,grainRoughness:me.unit},Fo=me.unit,ah=me.effects,au=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"];var sh=Do.filter(e=>au.some(t=>e.effects[t]>1e-4)),oS=Do.filter(e=>!sh.includes(e)),aS={blur:{blur:.45},pixelate:{pixelate:.55},bloom:{bloom:.55,bloomRadius:8},chromaBleed:{chromaBleed:.55},tapeDamage:{tapeDamage:.65,tapeTracking:.55,tapeNoise:.25,tapeSpeed:.5},filmArtifacts:{filmArtifacts:.55},scanlines:{scanlines:.35,scanlineCount:.17,scanlineSoftness:1},chromaticAberration:{chromaticAberration:.15,chromaticAngle:0},crtCurvature:{crtCurvature:.2},digitalGlitch:{digitalGlitch:.55,digitalGlitchColorSplit:.25,digitalGlitchLineTear:.25,digitalGlitchPixelate:.15,digitalGlitchBlockAmount:.5,digitalGlitchBlockDisplacement:.25,digitalGlitchBlockOpacity:0,digitalGlitchSpeed:.5},halftone:{halftone:.94,halftoneSize:.36},twoInkPrint:{twoInkPrint:1,twoInkPrintSize:.42},ascii:{ascii:1,asciiSize:5/76,asciiInvert:0,asciiStyle:0,asciiColor:1,asciiRotation:0},dither:{dither:1,ditherSize:.5},monoScreen:{monoScreen:1,monoScreenSize:.35,monoScreenAngle:.25,monoScreenSpread:.3,monoScreenShape:0,monoScreenInvert:0},engraving:{engraving:1,engravingSpacing:7/17,engravingMinThickness:.2,engravingMaxThickness:3.2/7,engravingAngle:.25,engravingContrast:7/15,engravingSharpness:.59,engravingWave:.2,engravingWaveFrequency:2/9},crosshatch:{crosshatch:1,crosshatchSpacing:7/25,crosshatchThickness:.25,crosshatchAngle:.25,crosshatchContrast:1/3,crosshatchEdges:.5,crosshatchLineWeight:0,crosshatchWave:.33,crosshatchWaveFrequency:2/9},kuwahara:{kuwahara:1,kuwaharaRadius:1/7,kuwaharaSharpness:5/16,kuwaharaSaturation:.5}},su=[{path:"intensity",name:"--hf-color-grading-intensity",min:0,max:1},{path:"lut.intensity",name:"--hf-color-grading-lut-intensity",min:0,max:1},{path:"adjust.exposure",name:"--hf-color-grading-exposure",min:-2,max:2},{path:"effects.blur",name:"--hf-color-grading-blur",min:0,max:1},{path:"effects.bloom",name:"--hf-color-grading-bloom",min:0,max:3},{path:"effects.kuwahara",name:"--hf-color-grading-kuwahara",min:0,max:1},{path:"effects.pixelate",name:"--hf-color-grading-pixelate",min:0,max:1},{path:"effects.ascii",name:"--hf-color-grading-ascii",min:0,max:1},{path:"effects.dither",name:"--hf-color-grading-dither",min:0,max:1}];var lh=/^#[0-9a-f]{6}$/i;function uh(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&lh.test(t))?null:e.map(t=>t.toLowerCase())}function _e(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Wr(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function lu(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function Te(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Wr(n,t.min,t.max):0}function Io(e,t=0){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?(n%360+360)%360:t}function ch(e){let t=_e(e)?e:{};return ru.reduce((n,r)=>{let i=_e(t[r])?t[r]:{};return n[r]={hue:Io(i.hue,qt.hue),amount:Te(i.amount??qt.amount,eu.amount),level:Te(i.level??qt.level,eu.level)},n},{shadows:{...qt},midtones:{...qt},highlights:{...qt}})}function dh(e){if(!Array.isArray(e)||e.length!==2)return null;let t=Number(e[0]),n=Number(e[1]);return Number.isFinite(t)&&Number.isFinite(n)?[Wr(t,0,1),Wr(n,0,1)]:null}function uu(e){return e.some((t,n)=>n>0&&t[0]===e[n-1]?.[0])}function fh(e){(e[0]?.[0]??0)>0&&e.unshift([0,0]),(e.at(-1)?.[0]??1)<1&&e.push([1,1])}function mh(e){if(!Array.isArray(e)||e.length<2)return ft;let t=[];for(let n of e){let r=dh(n);if(!r)return ft;t.push(r)}return t.sort((n,r)=>n[0]-r[0]),uu(t)||(fh(t),t.length>16)?ft:t}function ph(e){let t=_e(e)?e:{};return iu.reduce((n,r)=>(n[r]=mh(t[r]),n),{master:ft,red:ft,green:ft,blue:ft})}function hh(e,t){if(!Array.isArray(e)||e.length!==2)return null;let n=Number(e[0]),r=Number(e[1]);return Number.isFinite(n)&&Number.isFinite(r)?[Io(n),Wr(r,t.min,t.max)]:null}function gh(e,t){if(!Array.isArray(e)||e.length<3||e.length>16)return $t;let n=[];for(let r of e){let i=hh(r,t);if(!i)return $t;n.push(i)}return n.sort((r,i)=>r[0]-i[0]),uu(n)?$t:n}function bh(e){let t=_e(e)?e:{};return ou.reduce((n,r)=>(n[r]=gh(t[r],ih[r]),n),{hueVsHue:$t,hueVsSaturation:$t,hueVsLuma:$t})}function tu(e){let t=_e(e)?e:{},n=Te(t.min??To.min,Fo),r=Te(t.max??To.max,Fo);return{min:Math.min(n,r),max:Math.max(n,r),softness:Te(t.softness??To.softness,me.secondarySoftRangeSoftness)}}function xh(e){let t=_e(e)?e:{},n=Te(t.range??_o.range,me.secondaryHueRange);return{center:Io(t.center,_o.center),range:n,softness:Te(t.softness??_o.softness,{min:me.secondaryHueSoftness.min,max:me.secondaryHueCombinedMax-n})}}function yh(e){return{hueShift:Te(e.hueShift??0,me.secondaryHueShift),saturation:Te(e.saturation??0,me.signedUnit),luma:Te(e.luma??0,me.signedUnit),temperature:Te(e.temperature??0,me.signedUnit),tint:Te(e.tint??0,me.signedUnit)}}function vh(e){return!_e(e)||!_e(e.key)||!_e(e.correction)?null:{enabled:e.enabled!==!1,key:{hue:xh(e.key.hue),saturation:tu(e.key.saturation),luma:tu(e.key.luma)},correction:yh(e.correction)}}function Sh(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,4)){let r=vh(n);r&&t.push(r)}return t}function Ah(e){if(e==null)return null;let t=String(e).trim();return t||null}function Eh(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!_e(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:lu(e.intensity,1)}}function wh(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return _e(n)?n:null}catch{return null}return{preset:t}}return _e(e)?e:null}function Ch(e,t){let n=e.trim().match(nh);if(!n)return e;let r=n[1]??n[2]??"";return r&&Object.hasOwn(t,r)?t[r]:e}function Ur(e,t){if(typeof e=="string"){let r=Ch(e,t);if(r!==e)return r;let i=e.trim();if(!i.startsWith("{"))return e;try{return Ur(JSON.parse(i),t)}catch{return e}}if(Array.isArray(e))return e.map(r=>Ur(r,t));if(!_e(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=Ur(i,t);return n}function _h(e){return e?th.get(e)??null:null}function qr(e){let t=wh(e);if(!t||t.enabled===!1)return null;let n=Ah(t.preset),r=_h(n),i=r?.adjust??Ro,o=r?.details??ko,a=r?.effects??Mo,l=_e(t.adjust)?t.adjust:{},s=_e(t.details)?t.details:{},u=_e(t.effects)?t.effects:{},c=zr.reduce((p,b)=>(p[b]=Te(l[b]??i[b],rh[b]),p),{...Ro}),m=No.reduce((p,b)=>(p[b]=Te(s[b]??o[b],oh[b]),p),{...ko}),f=Lo.reduce((p,b)=>(p[b]=Te(u[b]??a[b],ah[b]??Fo),p),{...Mo});return{enabled:!0,preset:n,intensity:lu(t.intensity,r?.intensity??1),adjust:c,wheels:ch(t.wheels),curves:ph(t.curves),hueCurves:bh(t.hueCurves),secondaries:Sh(t.secondaries),details:m,effects:f,palette:uh(t.palette),lut:Eh(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():eh}}function cu(e,t){return qr(Ur(e,t))}function Th(e){return ru.some(t=>Math.abs(e[t].amount)>1e-4||Math.abs(e[t].level)>1e-4)}function Po(e){return iu.some(t=>e[t].some(([n,r])=>Math.abs(n-r)>1e-4))}function Oo(e){return ou.some(t=>e[t].some(([,n])=>Math.abs(n)>1e-4))}function Ho(e){return e.some(t=>t.enabled&&Object.values(t.correction).some(n=>Math.abs(n)>1e-4))}function du(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||au.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:zr.some(n=>Math.abs(e.adjust[n])>1e-4)||(e.wheels?Th(e.wheels):!1)||(e.curves?Po(e.curves):!1)||(e.hueCurves?Oo(e.hueCurves):!1)||(e.secondaries?Ho(e.secondaries):!1):!1}var Rh=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),kh=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function fu(e){let t=!1,n=null,r=null,i=null,o=null;function a(S,A){try{window.dispatchEvent(new CustomEvent(S,{detail:A}))}catch(C){L("runtime.picker.site1",C)}}function l(S){i=S,a("hyperframe:picker:hovered",{elementInfo:i,isPickMode:t,timestamp:Date.now()})}function s(S){o=S,a("hyperframe:picker:selected",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function u(S){let A=S.ownerDocument.defaultView;if(!A)return!1;let C=S;for(;C&&C!==document.body&&C!==document.documentElement;){let N=A.getComputedStyle(C);if(N.display==="none"||N.visibility==="hidden"||N.pointerEvents==="none")return!0;let I=Number.parseFloat(N.opacity);if(Number.isFinite(I)&&I<=.01&&!C.hasAttribute(Nn))return!0;C=C.parentElement}return!1}function c(S){if(!S||S===document.body||S===document.documentElement)return!1;let A=S.tagName.toLowerCase();return!(A==="script"||A==="style"||A==="link"||A==="meta"||S.classList.contains("__hf-pick-highlight")||S.closest(Rh)||u(S))}function m(S){return!!S?.closest(kh)}function f(S){let A=S;if(A.id)return`#${CSS.escape(A.id)}`;let C=S.getAttribute("data-composition-id");if(C)return`[data-composition-id="${CSS.escape(C)}"]`;let N=S.getAttribute("data-composition-src");if(N)return`[data-composition-src="${CSS.escape(N)}"]`;let I=S.getAttribute("data-track-index");if(I)return`[data-track-index="${CSS.escape(I)}"]`;let W=S.tagName.toLowerCase(),U=S.parentElement;if(!U)return W;let oe=U.querySelectorAll(`:scope > ${W}`);if(oe.length===1)return W;for(let k=0;k<oe.length;k+=1)if(oe[k]===S)return`${W}:nth-of-type(${k+1})`;return W}function p(S){let A=S.tagName.toLowerCase(),C=(S.textContent??"").trim().replace(/\s+/g," "),N=(I,W)=>I.length>W?`${I.slice(0,W-1)}\u2026`:I;return A==="h1"||A==="h2"||A==="h3"?"Heading":A==="p"||A==="span"||A==="div"?C.length>0?N(C,56):"Text":A==="img"?"Image":A==="video"?"Video":A==="audio"?"Audio":A==="svg"?"Shape":S.getAttribute("data-composition-src")?"Composition":A==="section"?"Section":`${A.charAt(0).toUpperCase()}${A.slice(1)}`}function b(S,A,C){let N=typeof C=="number"&&C>0?C:8,I=[];if(document.elementsFromPoint)I=document.elementsFromPoint(S,A);else if(document.elementFromPoint){let oe=document.elementFromPoint(S,A);I=oe?[oe]:[]}if(m(I[0]??null))return[];let W={},U=[];for(let[oe,k]of I.entries()){if(!c(k))continue;let V=`${k.tagName}::${k.id||""}::${oe}`;if(!W[V]&&(W[V]=!0,U.push(k),U.length>=N))break}return U}function v(S){let A=S.getBoundingClientRect(),C={};for(let I of Array.from(S.attributes))I.name.startsWith("data-")&&(C[I.name]=I.value);return{id:S.id||null,tagName:S.tagName.toLowerCase(),selector:f(S),label:p(S),boundingBox:{x:A.left,y:A.top,width:A.width,height:A.height},textContent:S.textContent?S.textContent.trim().slice(0,200):null,src:S.getAttribute("src")||S.getAttribute("data-composition-src")||null,dataAttributes:C}}function x(S,A,C){return b(S,A,C).map(v)}function _(S){if(!t)return;let C=b(S.clientX,S.clientY,1)[0]??(S.target instanceof Element?S.target:null);if(!c(C)||n===C)return;n&&n.classList.remove("__hf-pick-highlight"),n=C,C.classList.add("__hf-pick-highlight");let N=v(C);l(N),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:N})}function R(S){if(!t)return;S.preventDefault(),S.stopPropagation(),S.stopImmediatePropagation();let A=x(S.clientX,S.clientY,8);A.length!==0&&(l(A[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:A,selectedIndex:0,point:{x:S.clientX,y:S.clientY}}))}function T(S){S.key==="Escape"&&(F(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function M(){t||(t=!0,r=document.createElement("style"),r.textContent=[".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",".__hf-pick-active * { cursor: crosshair !important; }"].join(`
40
- `),document.head.appendChild(r),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",_,!0),document.addEventListener("click",R,!0),document.addEventListener("keydown",T,!0),a("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function F(){t&&(t=!1,n&&(n.classList.remove("__hf-pick-highlight"),n=null),r&&(r.remove(),r=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",_,!0),document.removeEventListener("click",R,!0),document.removeEventListener("keydown",T,!0),a("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function E(){window.__HF_PICKER_API={enable:M,disable:F,isActive:()=>t,getHovered:()=>i,getSelected:()=>o,getCandidatesAtPoint:(S,A,C)=>Number.isFinite(S)&&Number.isFinite(A)?x(S,A,C):[],pickAtPoint:(S,A,C)=>{if(!Number.isFinite(S)||!Number.isFinite(A))return null;let N=x(S,A,8);if(!N.length)return null;let I=Math.max(0,Math.min(N.length-1,Number(C??0))),W=N[I]??null;return W?(s(W),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:W}),F(),W):null},pickManyAtPoint:(S,A,C)=>{if(!Number.isFinite(S)||!Number.isFinite(A))return[];let N=x(S,A,8);if(!N.length)return[];let I=[],W=Array.isArray(C)?C:[0];for(let U of W){let oe=Math.max(0,Math.min(N.length-1,Math.floor(Number(U)))),k=N[oe];if(!k)continue;I.some(Q=>Q.selector===k.selector&&Q.tagName===k.tagName)||I.push(k)}return I.length?(s(I[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:I}),F(),I):[]}},a("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:M,disablePickMode:F,installPickerApi:E}}var Mh=["width","height","top","left","right","bottom","inset","object-fit","object-position","z-index","opacity","visibility","filter","mix-blend-mode","backdrop-filter","border-radius","overflow","clip-path","mask","mask-image","mask-size","mask-position","mask-repeat","transform","transform-origin","translate","rotate","scale","box-sizing"];function jt(e,t){let n=Number.isFinite(t)&&t>0?t:30,r=Number.isFinite(e)&&e>0?e:0;return Math.floor(r*n+1e-9)/n}function mu(e,t,n=Mh){for(let r of n){let i=t.getPropertyValue(r);i&&e.setProperty(r,i)}}function Ln(e,t,n){let r=e?.[t];return typeof r=="function"?Number(r.call(e))||n:typeof r=="number"&&Number.isFinite(r)?r:(r!=null&&L("runtime.player.nonConformantNum",{prop:t,actual:typeof r}),n)}function Be(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&L("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function Dn(e,t,n){if(e){for(let r of Object.values(e))if(!(!r||r===t))try{n(r)}catch(i){L("runtime.player.site1",i)}}}function pu(e,t,n,r){let i=jt(t,n),o=r?.suppressEvents===!0;return Be(e,"pause"),typeof e.totalTime=="function"?e.totalTime(i,o):typeof e.seek=="function"&&e.seek(i,o),i}function Fh(e,t,n,r,i){let o=[];Dn(e,t,a=>{Be(a,"play"),o.push(a)});try{return pu(t,n,r,i)}finally{for(let a of o)try{Be(a,"pause")}catch(l){L("runtime.player.site2",l)}}}function Nh(e,t){Dn(e,t,n=>{Be(n,"play")})}function hu(e){let t=e.transport;return t?{_timeline:null,play:()=>t.play(),pause:()=>t.pause(),seek:(n,r)=>t.seek(n,r),renderSeek:(n,r)=>t.renderSeek(n,r),getTime:()=>t.getTime(),getDuration:()=>t.getDuration(),isPlaying:()=>t.isPlaying(),setPlaybackRate:n=>t.setPlaybackRate(n),getPlaybackRate:()=>t.getPlaybackRate()}:{_timeline:null,play:()=>{let n=e.getTimeline();if(!n||e.getIsPlaying())return;let r=Math.max(0,Number(e.getSafeDuration?.()??Ln(n,"duration",0))||0);r>0&&Math.max(0,Ln(n,"time",0))>=r&&(Be(n,"pause"),typeof n.seek=="function"&&n.seek(0,!1),e.onDeterministicSeek(0),e.setIsPlaying(!1),e.onSyncMedia(0,!1),e.onRenderFrameSeek(0)),typeof n.timeScale=="function"&&n.timeScale(e.getPlaybackRate()),Be(n,"play"),Dn(e.getTimelineRegistry?.(),n,i=>{typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),Be(i,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;Be(n,"pause"),Dn(e.getTimelineRegistry?.(),n,i=>{Be(i,"pause")});let r=Math.max(0,Ln(n,"time",0));e.onDeterministicSeek(r),e.onDeterministicPause(),e.setIsPlaying(!1),e.onSyncMedia(r,!1),e.onRenderFrameSeek(r),e.onStatePost(!0)},seek:(n,r)=>{let i=e.getTimeline();if(!i)return;let o=Math.max(0,Number(n)||0),a=e.getIsPlaying(),l=Fh(e.getTimelineRegistry?.(),i,o,e.getCanonicalFps());e.onDeterministicSeek(l),r?.keepPlaying&&a?(typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),Be(i,"play"),Dn(e.getTimelineRegistry?.(),i,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),Be(s,"play")}),e.onDeterministicPlay(),e.onShowNativeVideos(),e.onSyncMedia(l,!0)):(e.setIsPlaying(!1),e.onSyncMedia(l,!1)),e.onRenderFrameSeek(l),e.onStatePost(!0)},renderSeek:(n,r)=>{let i=e.getTimeline(),o=e.getCanonicalFps(),a=i?(Nh(e.getTimelineRegistry?.(),i),pu(i,n,o,r)):jt(Math.max(0,Number(n)||0),o);e.onDeterministicSeek(a,r),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>Ln(e.getTimeline(),"time",0),getDuration:()=>Ln(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function gu(){return{capturedTimeline:null,isPlaying:!1,currentTime:0,deterministicAdapters:[],canonicalFps:30,bridgeMuted:!1,bridgeVolume:1,mediaOutputMuted:!1,nativeMediaSyncDisabled:!1,webAudioMediaDisabled:!1,mediaAutoplayBlockedPosted:!1,mediaForceSyncNextTick:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,controlBridgeHandler:null,beforeUnloadHandler:null,injectedCompStyles:[],injectedCompScripts:[],injectedCompLinks:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,transportClock:null,transportRafId:null}}var Lh=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function Go(e){return e.id||e.getAttribute("data-hf-id")||null}function Dh(e){return ve(e)}function Ih(e,t){let n=e.getAttribute("data-composition-id");if(!n)return null;let r=Number(t[n]?.duration?.());return Number.isFinite(r)&&r>0?r:null}function Ph(e){return!(e instanceof HTMLMediaElement)||!Number.isFinite(e.duration)?null:Ze(e,e.duration)}function Oh(e,t,n,r){let i=Dh(e.getAttribute("data-duration"));return i!=null&&i>0?i:Ih(e,t)??Ph(e)??Math.max(0,n-r)}function Hh(e){for(let[t,n]of e){let r=t.parentElement;for(;r;){let i=e.get(r);if(i){n.parentId=i.id,i.children.push(n);break}r=r.parentElement}}}function bu(e){let{startResolver:t,timelineRegistry:n,rootDuration:r}=e,i=new Map,o=document.querySelector("[data-composition-id]"),a=0;for(let l of document.querySelectorAll("[data-start]")){if(l===o||Lh.has(l.tagName))continue;let s=t.resolveStartForElement(l,0);if(Oh(l,n,r,s)<=0)continue;let u={id:Go(l)??`__clip-${a++}`,element:l,parentId:null,children:[]};i.set(l,u)}return Hh(i),{roots:Array.from(i.values()).filter(l=>l.parentId===null)}}function In(e){if(e==null||typeof e=="string"&&e.trim()==="")return null;let t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null}function Kt(e){let t=In(e.start);if(t==null)return null;let n=Math.max(0,t),r=In(e.duration),i=In(e.authoredDuration),o=r!=null&&r>0?r:i!=null&&i>0?i:null;if(o!=null)return{start:n,duration:o,end:n+o};let a=In(e.end),l=In(e.authoredEnd),s=a!=null&&a>n?a:l!=null&&l>n?l:null;return{start:n,duration:s==null?null:s-n,end:s}}var Bo="css:root",xu=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],Gh=new Set([...xu,"contain","isolation","mask-border","mix-blend-mode","opacity"]),Bh=new Set(["absolute","relative"]),Uh=new Set(["flex","inline-flex","grid","inline-grid"]),Wh=new Set(["layout","paint","strict","content"]),Vh=new Set(["size","inline-size"]);function zh(e){return e.position==="fixed"||e.position==="sticky"}function qh(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(Bh.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&Uh.has(n)}function $h(e){let t=Number.parseFloat(e.opacity);if(Number.isFinite(t)&&t<1||e.getPropertyValue("isolation")==="isolate")return!0;let n=e.getPropertyValue("mix-blend-mode");return n&&n!=="normal"?!0:xu.some(r=>{let i=e.getPropertyValue(r);return i!==""&&i!=="none"})}function jh(e){return e.getPropertyValue("contain").split(/\s+/).some(n=>Wh.has(n))?!0:Vh.has(e.getPropertyValue("container-type"))}function Kh(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>Gh.has(t))}function Yh(e,t){return zh(t)||qh(e,t)||$h(t)||jh(t)?!0:Kh(t)}function Xh(e){let t=[],n=e;for(;n?.parentElement;)t.push(Array.prototype.indexOf.call(n.parentElement.children,n)),n=n.parentElement;return`css:${t.reverse().join(".")}`}function $r(e){let t=e.ownerDocument.defaultView;if(!t)return Bo;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(Yh(n,t.getComputedStyle(n)))return Xh(n)}catch{return Bo}n=n.parentElement}return Bo}function mt(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,i=new WeakMap,o=new WeakMap,a=new Set,l=f=>{let p=r.getElementById(f);return p||(r.querySelector(`[data-composition-id="${CSS.escape(f)}"]`)??null)},s=f=>{let p=f.ownerDocument.defaultView?.HTMLMediaElement;return p?f instanceof p:typeof HTMLMediaElement<"u"&&f instanceof HTMLMediaElement},u=f=>{let p=o.get(f);if(p!==void 0)return p;let b=null,v=Kt({start:0,duration:f.getAttribute("data-duration"),authoredDuration:n?f.getAttribute("data-hf-authored-duration"):null});if(v?.duration!=null&&v.duration>0&&(b=v.duration),b==null||b<=0){let x=m(f,0),_=Kt({start:x,end:f.getAttribute("data-end"),authoredEnd:n?f.getAttribute("data-hf-authored-end"):null});_?.duration!=null&&_.duration>0&&(b=_.duration)}if((b==null||b<=0)&&s(f)){let x=yn(f);Number.isFinite(f.duration)&&f.duration>x&&(b=(f.duration-x)/Ce(f))}if(b==null||b<=0){let x=f.getAttribute("data-composition-id");if(x){let _=t[x]??null;if(_&&typeof _.duration=="function")try{let R=Number(_.duration());Number.isFinite(R)&&R>0&&(b=R)}catch(R){L("runtime.startResolver.site1",R)}}}return b!=null&&Number.isFinite(b)&&b>0?(o.set(f,b),b):(o.set(f,null),null)},c=(f,p)=>{if(f.hasAttribute("data-composition-id")){let v=f.parentElement?.closest("[data-composition-id]");return v?m(v,p):0}let b=f.closest("[data-composition-id]");return b?m(b,p):0},m=(f,p)=>{let b=i.get(f);if(b!==void 0)return b??p;if(a.has(f))return p;a.add(f);try{let v=so(f.getAttribute("data-start"));if(!v){if(f.hasAttribute("data-composition-id")){let M=f.parentElement;if(M&&(M.hasAttribute("data-composition-src")||M.hasAttribute("data-composition-id")||M.hasAttribute("data-composition-file"))){let F=m(M,p);return i.set(f,F),F}}return i.set(f,p),p}if(v.kind==="absolute"){let M=Math.max(0,v.value),F=Math.max(0,c(f,p)+M);return i.set(f,F),F}let x=l(v.refId);if(!x)return i.set(f,p),p;let _=m(x,0),R=u(x);if(R==null||R<=0){let M=Math.max(0,_+v.offset);return i.set(f,M),M}let T=Math.max(0,_+R+v.offset);return i.set(f,T),T}finally{a.delete(f)}};return{resolveStartForElement:(f,p=0)=>m(f,Math.max(0,p)),resolveDurationForElement:f=>u(f)}}function Uo(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}function pt(e){return ve(e)}function Wo(e){let t=e.getAttribute("data-duration"),n=e.getAttribute("data-hf-authored-duration"),r=Kt({start:0,duration:t,authoredDuration:n})?.duration;return r??([t,n].map(pt).some(o=>o!=null&&o<=0)?0:null)}function yu(e){return Kt({start:0,end:e.getAttribute("data-end"),authoredEnd:e.getAttribute("data-hf-authored-end")})?.end??null}function Vo(e){try{let t=e.style?.zIndex;if(t&&t!=="auto"){let n=parseInt(t,10);if(Number.isFinite(n))return n}return 0}catch{return 0}}function zo(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function qo(e,t){let n=e.getAttribute("data-track-index")??e.getAttribute("data-track");if(n==null)return t;let r=Number.parseInt(n,10);return Number.isFinite(r)?r:t}function On(e){let t=String(e??"").trim();if(!t)return null;let n=t.toLowerCase();if(n.startsWith("data:")||n.startsWith("javascript:"))return null;try{return new URL(t,document.baseURI).toString()}catch{return t}}function vu(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return On(t);let n=e.getAttribute("data-composition-src");if(n)return On(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?On(r.getAttribute("src")):null}function Qh(e){let t=e.className;return typeof t!="string"?null:t.split(/\s+/).map(n=>n.trim()).find(n=>n&&n!=="clip"&&!n.startsWith("__hf-"))??null}function Zh(e){if(!e)return null;try{return new URL(e,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return e.split(/[\\/]/).filter(Boolean).at(-1)??null}}function e0(e){let t=e.textContent?.replace(/\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function Pn(e){let t=e.replace(/\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return t?t.replace(/\b\w/g,n=>n.toUpperCase()):e}function t0(e,t,n){let r=e.getAttribute("data-timeline-label")??e.getAttribute("data-label")??e.getAttribute("aria-label")??null;if(r?.trim())return r.trim();let i=e.getAttribute("data-composition-id");if(i)return Pn(i);let o=e.id;if(o)return Pn(o);let a=Qh(e);if(a)return Pn(a);let l=Zh(vu(e));if(l)return Pn(l);let s=e0(e);return s||`${Pn(t)} ${n+1}`}function Su(e){let n=window.__timelines??{},r=mt({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),i=q=>{if(!q)return null;let P=n[q]??null;if(!P||typeof P.duration!="function")return null;try{let O=Number(P.duration());return Number.isFinite(O)&&O>0?O:null}catch{return null}},o=q=>{let P=pt(q.getAttribute("data-duration"));return P!=null&&P>0?P:Number.isFinite(q.duration)?Ze(q,q.duration):null},a=()=>{let q=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(q.length===0)return null;let P=0;for(let O of q){let j=O.hasAttribute("data-hf-auto-start")?r.resolveStartForElement(O,0):Math.max(0,Number(O.getAttribute("data-start")??0)||0);if(!Number.isFinite(j))continue;let le=o(O);le==null||le<=0||(P=Math.max(P,Math.max(0,j)+le))}return P>0?P:null},l=(q,P)=>{let O=[],j=null,le=null,ee=null,K=q.parentElement;for(;K;){let Y=K.getAttribute("data-composition-id");Y&&(O.push(Y),!ee&&K!==P&&(ee=Y),j==null&&(j=r.resolveStartForElement(K,0)),le==null&&(le=pt(K.getAttribute("data-duration"))??i(Y)??null)),K=K.parentElement}return{parentCompositionId:ee,compositionAncestors:O.reverse(),inheritedStart:j,inheritedDuration:le}},s=document.querySelector("[data-composition-id]"),u=Array.from(document.querySelectorAll("[data-composition-id]")),c=s?.getAttribute("data-composition-id")??null,m=s?r.resolveStartForElement(s,0):0,f=a(),p=f!=null?Math.max(0,f-Math.max(0,m)):null,b=i(c),v=Wo(s??document.body),x=zo(...u.filter(q=>q!==s).map(q=>{let P=r.resolveStartForElement(q,0),O=r.resolveDurationForElement(q)??i(q.getAttribute("data-composition-id"))??null;return!Number.isFinite(P)||O==null||O<=0?null:Math.max(0,P)+O})),_=x!=null?Math.max(0,x-Math.max(0,m)):null,R=typeof b=="number"&&Number.isFinite(b)&&b>0?b:null,T=typeof v=="number"&&Number.isFinite(v)&&v>0?v:null,M=typeof p=="number"&&Number.isFinite(p)&&p>0?p:null,F=typeof _=="number"&&Number.isFinite(_)&&_>0?_:null,E=zo(M,F),S=R!=null&&E!=null&&R>E+1,C=T??(S?E:zo(R,M,F))??null,I=(C!=null?m+C:null)??(typeof f=="number"&&Number.isFinite(f)&&f>0?f:null),W=(q,P)=>!Number.isFinite(P)||P<=0?0:I==null||!Number.isFinite(I)?P:!Number.isFinite(q)||q>=I?0:Math.max(0,Math.min(P,I-q)),U=[],oe=[],k=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),V=0;for(let[q,P]of k.entries()){if(P===s||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(P.tagName))continue;let O=l(P,s),j=r.resolveStartForElement(P,O.inheritedStart??0),le=P.getAttribute("data-composition-id"),ee=Wo(P);if(ee==null&&le&&le!==c&&(ee=i(le)),ee==null&&P instanceof HTMLMediaElement&&Number.isFinite(P.duration)&&(ee=Ze(P,P.duration)),ee==null){let Fe=O.inheritedDuration;if(Fe!=null&&Fe>0){let ze=(O.inheritedStart??0)+Fe;ee=Math.max(0,ze-j)}}if(ee==null||ee<=0||(ee=W(j,ee),ee<=0))continue;let K=j+ee;V=Math.max(V,K);let Y=P.tagName.toLowerCase(),Ve=le&&le!==c?"composition":Y==="video"?"video":Y==="audio"?"audio":Y==="img"?"image":"element";U.push({id:Go(P)??le??null,label:t0(P,Ve,U.length),start:j,duration:ee,track:qo(P,q),zIndex:Vo(P),stackingContextId:$r(P),kind:Ve,tagName:Y,compositionId:P.getAttribute("data-composition-id"),compositionAncestors:O.compositionAncestors,parentCompositionId:O.parentCompositionId,nodePath:null,compositionSrc:On(P.getAttribute("data-composition-src")),playbackStart:je(P),playbackRate:Ce(P),assetUrl:vu(P),timelineRole:P.getAttribute("data-timeline-role"),timelineLabel:P.getAttribute("data-timeline-label"),timelineGroup:P.getAttribute("data-timeline-group"),timelinePriority:pt(P.getAttribute("data-timeline-priority"))})}let Q=new Set(U.map(q=>q.id)),G=s?.getAttribute("data-composition-id")??null,H=G?n[G]??null:null;if(H&&s){let q=H;if(typeof q.getChildren=="function")try{let P=q.getChildren(!0,!0,!1)??[],O=new Map;for(let ee of s.children){let K=ee;if(!K.id)continue;let Y=K.tagName.toLowerCase();Y==="script"||Y==="style"||Y==="link"||O.set(K,{id:K.id,start:1/0,end:-1/0})}let j=ee=>{let K=ee;for(;K;){if(O.has(K))return K;if(K===s)return null;K=K.parentElement}return null};for(let ee of P){if(typeof ee.targets!="function"||typeof ee.startTime!="function"||typeof ee.duration!="function")continue;let K=ee.startTime(),Y=ee.parent;for(;Y&&Y!==H&&typeof Y.startTime=="function";)K+=Y.startTime(),Y=Y.parent;let Ve=K+ee.duration();if(!(!Number.isFinite(K)||!Number.isFinite(Ve)))for(let Fe of ee.targets()){if(!(Fe instanceof Element))continue;let Re=j(Fe);if(!Re)continue;let ze=O.get(Re);ze&&(ze.start=Math.min(ze.start,K),ze.end=Math.max(ze.end,Ve))}}let le=U.length>0?Math.max(...U.map(ee=>ee.track))+1:0;for(let[ee,K]of O){if(K.start===1/0||K.end===-1/0)continue;let Y=ee;if(Q.has(Y.id))continue;let Ve=Math.max(0,K.end-K.start);if(Ve<=0)continue;let Fe=W(K.start,Ve);Fe<=0||(V=Math.max(V,K.start+Fe),U.push({id:Y.id,label:Y.getAttribute("data-timeline-label")??Y.getAttribute("data-label")??Y.getAttribute("aria-label")??Y.id,start:K.start,duration:Fe,track:qo(Y,le),zIndex:Vo(Y),stackingContextId:$r(Y),kind:"element",tagName:Y.tagName.toLowerCase(),compositionId:Y.getAttribute("data-composition-id"),compositionAncestors:G?[G]:[],parentCompositionId:G,nodePath:null,compositionSrc:null,playbackStart:je(Y),playbackRate:Ce(Y),assetUrl:null,timelineRole:Y.getAttribute("data-timeline-role"),timelineLabel:Y.getAttribute("data-timeline-label"),timelineGroup:Y.getAttribute("data-timeline-group"),timelinePriority:pt(Y.getAttribute("data-timeline-priority"))}),Q.add(Y.id))}}catch(P){L("runtime.timeline.site1",P)}}if(s&&C!=null&&C>0){let q=U.length>0?Math.max(...U.map(P=>P.track))+1:0;for(let P of s.children){let O=P;if(!O.id||Q.has(O.id))continue;let j=O.getAttribute("data-timeline-role");if(j!=="overlay"&&j!=="persistent-overlay")continue;let le=O.tagName.toLowerCase();if(le==="script"||le==="style"||le==="link"||le==="meta"||window.getComputedStyle(O).display==="none")continue;let K=W(0,C);K<=0||(V=Math.max(V,K),U.push({id:O.id,label:O.getAttribute("data-timeline-label")??O.getAttribute("data-label")??O.getAttribute("aria-label")??O.id,start:0,duration:K,track:qo(O,q),zIndex:Vo(O),stackingContextId:$r(O),kind:"element",tagName:le,compositionId:O.getAttribute("data-composition-id"),compositionAncestors:G?[G]:[],parentCompositionId:G,nodePath:null,compositionSrc:null,playbackStart:je(O),playbackRate:Ce(O),assetUrl:null,timelineRole:j,timelineLabel:O.getAttribute("data-timeline-label"),timelineGroup:O.getAttribute("data-timeline-group"),timelinePriority:pt(O.getAttribute("data-timeline-priority"))}),Q.add(O.id))}}for(let q of u){if(q===s)continue;let P=q.getAttribute("data-composition-id");if(!P||!Uo(P))continue;let O=r.resolveStartForElement(q,0),j=Wo(q);if((j==null||j<=0)&&yu(q)!=null){let Y=yu(q);j=Math.max(0,Y-O)}let le=i(P),ee=j&&j>0?j:le;if(ee==null||ee<=0)continue;let K=W(O,ee);K<=0||oe.push({id:P,label:q.getAttribute("data-label")??P,start:O,duration:K,thumbnailUrl:On(q.getAttribute("data-thumbnail-url")),avatarName:null})}let z=Math.max(1,V||1,C??0),X=S&&T==null,we=X?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(z*Math.max(1,e.canonicalFps)));return{...Er(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:X?Number.POSITIVE_INFINITY:z,durationInFrames:we,clips:U,scenes:oe,compositionWidth:pt(s?.getAttribute("data-width"))??1920,compositionHeight:pt(s?.getAttribute("data-height"))??1080}}var $o="data-composition-id",n0="data-composition-src",r0=`[${$o}]`,jS=`[${n0}]`,Au="style",Eu="script",i0='link[rel="stylesheet"], link[rel="preconnect"]';function Yt(e){return e?Array.from(e):[]}function wu(e){let{contentNode:t,head:n,documentElement:r,hasTemplate:i,compositionId:o}=e,a=Yt(t.querySelectorAll(r0)),l=o?a.find(c=>c.getAttribute($o)===o)??null:a[0]??null,s=(l??a[0])?.getAttribute($o)?.trim()||"",u=i?null:n??null;return{innerRoot:l,authoredCompositionId:o||s||null,scriptCompositionId:s||o||null,authoredRootId:l?.getAttribute("id")?.trim()||null,styleSources:[...Yt(u?.querySelectorAll(Au)),...Yt(t.querySelectorAll(Au))],scriptSources:[...Yt(u?.querySelectorAll(Eu)),...Yt(t.querySelectorAll(Eu))],linkSources:Yt(n?.querySelectorAll(i0)),variableDefaultCarriers:[r,l].filter(c=>c!=null)}}var pe=Um(Yc(),1),Xc=pe.default,PA=pe.default.stringify,OA=pe.default.fromJSON,HA=pe.default.plugin,GA=pe.default.parse,BA=pe.default.list,UA=pe.default.document,WA=pe.default.comment,VA=pe.default.atRule,zA=pe.default.rule,qA=pe.default.decl,$A=pe.default.root,jA=pe.default.CssSyntaxError,KA=pe.default.Declaration,YA=pe.default.Container,XA=pe.default.Processor,JA=pe.default.Document,QA=pe.default.Comment,ZA=pe.default.Warning,eE=pe.default.AtRule,tE=pe.default.Result,nE=pe.default.Input,rE=pe.default.Rule,iE=pe.default.Root,oE=pe.default.Node;var xa="data-hf-authored-id",Jc="data-hf-inner-root";function ya(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function va(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function _g(e){return e&&e.replace(/[^a-zA-Z0-9_-]/g,n=>`\\${n}`).replace(/^-?\d/,n=>`\\${n}`)}function Zc(e){let t=e.trim();return t?Array.from(new Set([t,_g(t)])).filter(Boolean):[]}function Tg(e){return!!e&&/[\w-]/.test(e)}function Rg(e,t,n){let r=Zc(t).sort((l,s)=>s.length-l.length);if(r.length===0)return e;let i="",o=0,a=null;for(let l=0;l<e.length;l+=1){let s=e[l],u=l>0?e[l-1]:"";if(a){i+=s,s===a&&u!=="\\"&&(a=null);continue}if(s==='"'||s==="'"){a=s,i+=s;continue}if(s==="["){o+=1,i+=s;continue}if(s==="]"){o=Math.max(0,o-1),i+=s;continue}if(s==="#"&&o===0){let c=r.find(m=>e.startsWith(m,l+1));if(c){let m=e[l+1+c.length];if(!Tg(m)){i+=n,l+=c.length;continue}}}i+=s}return i}function kg(e,t){let n=t?.trim();return n?Rg(e,n,`[${xa}="${va(n)}"]`):e}function Qc(e){return`${e}:not(:has([${Jc}])), ${e} > [${Jc}]`}function Mg(e,t,n,r,i,o){let a=kg(e,r),l=Fg(a,t,n),s=l.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return o?Qc(t):e;let u=new RegExp(`\\[\\s*data-composition-id\\s*=\\s*(["'])${ya(n)}\\1\\s*\\]`,"g");if(u.test(s))return s.replace(u,"").trim()===""?Qc(t):l.replace(u,t);let c=l.match(/^\s*/)?.[0]??"",m=l.match(/\s*$/)?.[0]??"";if(i){let f=r?`[${xa}="${va(r)}"]`:null;if(f&&s.startsWith(f)){let p=s.slice(f.length);return`${c}${t}${f}${p}${m}`}}return`${c}${t} ${s}${m}`}function Fg(e,t,n){let r=ya(n),i=String.raw`\[\s*data-composition-id\s*=\s*(?:"${r}"|'${r}')\s*\]`,o=String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`;return e.replace(new RegExp(`${i}(?:${o})+`,"g"),t).replace(new RegExp(`(?:${o})+${i}`,"g"),t)}var Ng=new Set(["keyframes","-webkit-keyframes","font-face"]);function Lg(e){return e?.type==="atrule"}function Dg(e){let t=e.parent;for(;t;){if(Lg(t)&&Ng.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function Ig(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function ed(e,t,n,r,i){let o=t.trim();if(!e||!o)return e;let a=n||`[data-composition-id="${va(o)}"]`,l=Xc.parse(e);return l.walkRules(s=>{Dg(s)||Ig(s)||(s.selectors=s.selectors.map(u=>Mg(u,a,o,r,i?.compoundAuthoredRoot,i?.scopeRootSelectors)))}),l.toResult({map:!1}).css}function rt(e){return JSON.stringify(e).replace(/</g,"\\u003c")}function td(e,t,n="[HyperFrames] composition script error:",r,i=t,o){let a=rt(t),l=rt(i),s=rt(n),u=ya(t),c=rt(o?.trim()||null),m=rt(r??null),f=rt(String.raw`\[\s*data-composition-id\s*=\s*(?:"${u}"|'${u}')\s*\]`),p=rt(String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`),b=rt(Zc(o?.trim()||""));return`(function(){
39
+ `,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(i=>{i.classList.add("__hf-flash"),setTimeout(()=>i.classList.remove("__hf-flash"),t)})}catch(r){L("bridge.flashElements.querySelector",r)}}var Ji=null;function Is(e){Ji=e}function Ne(e,t){if(Ji)try{Ji({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){L("runtime.analytics.site1",n)}}function Jm(e){let t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-"),n=0,r=t.length;for(;n<r&&t[n]==="-";)n++;for(;r>n&&t[r-1]==="-";)r--;let i=t.slice(n,r);return i.length>0?i:"node"}function Ot(e){return`--${Jm(e)}`}function Ps(e){let t=new Map;for(let n of e){let r=Ot(n),i=t.get(r);i?i.includes(n)||i.push(n):t.set(r,[n])}return[...t.values()].filter(n=>n.length>1)}function Hs(){if(typeof document>"u")return{};let e=new Set;document.documentElement?.hasAttribute("data-composition-variables")&&e.add(document.documentElement);for(let i of Array.from(document.querySelectorAll("[data-composition-variables]")))e.add(i);let t={};for(let i of e)Object.assign(t,bn(i));let n=Cr(),r={...t,...n};for(let i of e)Zi(i,r);return r}var Os=new Set;function Gs(e){let t=e?.getAttribute("data-composition-variables");if(!t)return[];let n;try{n=JSON.parse(t)}catch{return[]}return Array.isArray(n)?n.filter(r=>!!r&&typeof r=="object"):[]}function Qm(e,t){return t?.trim()||e.getAttribute("data-composition-id")?.trim()||e.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()||"composition"}function Zm(e){return Array.isArray(e.options)?e.options.map(t=>t&&typeof t=="object"?t.value:t).filter(t=>typeof t=="string"||typeof t=="number"):[]}function ep(e,t){if(typeof e.id!="string")return null;let n=t[e.id];if(n==null||"default"in e&&String(n)===String(e.default))return null;let r=Zm(e);return r.length===0||r.some(i=>String(i)===String(n))?null:{id:e.id,value:n,allowed:r}}function Zi(e,t,n){if(!e)return;let r=Gs(e);if(r.length===0)return;let i=Qm(e,n);for(let o of r){let a=ep(o,t);if(!a)continue;let l=`${i}|${a.id}|${String(a.value)}`;if(Os.has(l))continue;Os.add(l);let s="default"in o?JSON.stringify(o.default):"the composition default";console.warn(`[hyperframes] runtime_unknown_enum_value: ${i} variable "${a.id}" got ${JSON.stringify(a.value)}, which is not a declared option (${a.allowed.join(", ")}). Rendering ${s} instead.`)}}function bn(e){let t={};for(let n of Gs(e))typeof n.id!="string"||!("default"in n)||(t[n.id]=n.default);return t}var Qi="data-hf-css-vars";function wr(e){return"style"in e&&typeof e.style?.setProperty=="function"}function eo(e,t){if(!wr(e))return;let n=[];for(let[r,i]of Object.entries(t))if(typeof i=="string"&&i!==""||typeof i=="number"){let o=Ot(r);e.style.setProperty(o,String(i)),n.push(o)}n.length>0&&e.setAttribute(Qi,n.join(" "))}function Bs(e,t,n){let r={};for(let[i,o]of Object.entries(t)){let a=Ot(i);((wr(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(r[i]=o)}return r}function Us(e){if(!wr(e))return;let t=e.getAttribute(Qi);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(Qi)}}function Ws(e){let t=new Set;e.documentElement?.hasAttribute("data-composition-variables")&&t.add(e.documentElement);for(let i of Array.from(e.querySelectorAll("[data-composition-variables]")))t.add(i);let n=Cr(),r=[];for(let i of t)r.push(...tp(i,n,e.defaultView));for(let i of Ps(r))console.warn(`composition variables ${i.join(", ")} collapse to the same CSS property ${Ot(i[0]??"")} \u2014 rename one to avoid cross-talk`)}function tp(e,t,n){if(!wr(e))return[];let r=bn(e),i={};for(let[o,a]of Object.entries(r)){if(o in t)continue;let l=Ot(o);(e.style.getPropertyValue(l)||(n?n.getComputedStyle(e).getPropertyValue(l):"")).trim()===""&&(i[o]=a)}for(let[o,a]of Object.entries(t))o in r&&(i[o]=a);return eo(e,i),Object.keys(r)}function Vs(e){let t=e.getAttribute("data-variable-values");if(!t)return{};let n;try{n=JSON.parse(t)}catch{return{}}return!n||typeof n!="object"||Array.isArray(n)?{}:n}function Cr(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}function zs(e){let t=[],n=u=>{if(typeof u.getAnimations!="function")return[];try{return u.getAnimations()}catch{return[]}},r=u=>e?.resolveStartSeconds?e.resolveStartSeconds(u):Number.parseFloat(u.getAttribute("data-start")??"0")||0,i=(u,c)=>{let m=null;try{m=u.effect?.getComputedTiming?.()??null}catch(p){L("runtime.adapters.css.site5",p)}if(!m)return{};let f=Number(m.endTime);return Number.isFinite(f)?{endSeconds:c+f/1e3}:{unbounded:!0}},o=(u,c)=>{for(let m of u){try{m.currentTime=c}catch(f){L("runtime.adapters.css.site1",f)}try{m.pause()}catch(f){L("runtime.adapters.css.site2",f)}}},a=u=>{for(let c of u)try{c.play()}catch(m){L("runtime.adapters.css.site3",m)}},l=u=>{for(let c of u)try{c.pause()}catch(m){L("runtime.adapters.css.site4",m)}},s=u=>{u.baseDelay?u.el.style.animationDelay=u.baseDelay:u.el.style.removeProperty("animation-delay"),u.basePlayState?u.el.style.animationPlayState=u.basePlayState:u.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{t=[];let u=document.querySelectorAll("*");for(let c of u){if(!(c instanceof HTMLElement))continue;let m=window.getComputedStyle(c);!m.animationName||m.animationName==="none"||t.push({el:c,baseDelay:c.style.animationDelay||"",basePlayState:c.style.animationPlayState||"",animations:n(c)})}},getInferredDurationSeconds:()=>{let u=0;for(let c of t){if(!c.el.isConnected)continue;let m=r(c.el);for(let f of n(c.el)){let p=i(f,m);p.endSeconds!=null&&(u=Math.max(u,p.endSeconds))}}return u>0?u:null},seek:u=>{let c=Number(u.time)||0;for(let m of t){if(!m.el.isConnected)continue;let f=r(m.el),p=Math.max(0,c-f)*1e3,b=m.animations;if(b.length>0){o(b,p);continue}m.el.style.animationPlayState="paused",m.el.style.animationDelay=`-${(p/1e3).toFixed(3)}s`}},pause:()=>{for(let u of t){if(!u.el.isConnected)continue;let c=u.animations;c.length>0&&l(c),s(u)}},play:()=>{for(let u of t)u.el.isConnected&&(s(u),a(u.animations))},revert:()=>{t=[]}}}function qs(e){return{name:"gsap",discover:()=>{},seek:t=>{let n=e.getTimeline();if(!n)return;n.pause();let r=Math.max(0,Number(t.time)||0),i=t.suppressEvents===!0;typeof n.totalTime=="function"?(n.totalTime(r+.001,!0),n.totalTime(r,i)):n.seek(r,i)},pause:()=>{let t=e.getTimeline();t&&t.pause()}}}function $s(){return{name:"animejs",discover:()=>{try{let e=window.anime;if(!e||typeof e.running>"u")return;let t=e.running;if(!Array.isArray(t)||t.length===0)return;let n=window.__hfAnime??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfAnime=n}catch(e){L("runtime.adapters.animejs.site1",e)}},seek:e=>{let t=Math.max(0,(Number(e.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let r of n)try{typeof r.seek=="function"&&r.seek(t)}catch(i){L("runtime.adapters.animejs.site2",i)}},pause:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.pause=="function"&&t.pause()}catch(n){L("runtime.adapters.animejs.site3",n)}},play:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.play=="function"&&t.play()}catch(n){L("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function Ks(){return{name:"lottie",discover:()=>{try{let e=window.lottie;if(e&&typeof e.getRegisteredAnimations=="function"){let t=e.getRegisteredAnimations();if(Array.isArray(t)&&t.length>0){let n=window.__hfLottie??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfLottie=n}}}catch(e){L("runtime.adapters.lottie.site1",e)}},seek:e=>{let t=Math.max(0,Number(e.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let r of n)try{if(to(r))r.goToAndStop(t*1e3,!1);else if(no(r)){if(typeof r.setCurrentRawFrameValue=="function"){let i=r.totalFrames??0,o=r.frameRate??30,a=t*o;i>0&&r.setCurrentRawFrameValue(Math.min(a,i-1))}else if(typeof r.seek=="function"){let i=r.duration??1,o=Math.min(100,t/i*100);r.seek(o)}}}catch(i){L("runtime.adapters.lottie.site2",i)}},pause:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let t of e)try{(to(t)||no(t))&&t.pause()}catch(n){L("runtime.adapters.lottie.site3",n)}},revert:()=>{},getInferredDurationSeconds:()=>{let e=window.__hfLottie;if(!e||e.length===0)return null;let t=0,n=!1;for(let r of e){let i=null;try{i=np(r)}catch(o){L("runtime.adapters.lottie.site4",o)}i!=null&&(n=!0,t=Math.max(t,i))}return n?t:null}}}function js(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function np(e){return to(e)?js(e.totalFrames,e.frameRate):no(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:js(e.totalFrames,e.frameRate):null}function to(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function no(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}var ro=-1,_r=new Set,Ht,io=0;function Ys(e){let t=[],n=!0,r={time:e,waitUntil:o=>{if(!n)throw new Error("hf-seek waitUntil() must be called synchronously from the event listener");t.push(o)}};try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:r}))}catch(o){L("runtime.adapters.seek-dispatch.site1",o)}finally{n=!1}if(t.length===0)return;let i=Promise.all(t).then(()=>({status:"fulfilled"})).catch(o=>({status:"rejected",reason:o}));_r.add(i),i.then(o=>{_r.delete(i)&&o.status==="rejected"&&Ht===void 0&&(Ht={reason:o.reason})})}function Tr(e){e!==ro&&(ro=e,Ys(e))}function Rr(e){ro=e,Ys(e)}function Xs(){return io>0}async function oo(){io+=1;let e=Ht;try{for(await Promise.resolve();_r.size>0;){let r=(await Promise.all([..._r])).find(i=>i.status==="rejected");e===void 0&&r?.status==="rejected"&&(e={reason:r.reason})}let t=Ht;if(e===void 0&&(e=t),Ht===t&&(Ht=void 0),e)throw e.reason}finally{io-=1}}function Js(){let e=null,t=0,n=null,r=null,i=null,o=null,a=()=>{if(typeof window>"u")return null;let c=window.THREE?.DefaultLoadingManager;return!c||typeof c!="object"||typeof c.itemsLoaded!="number"||typeof c.itemsTotal!="number"?null:c},l=u=>{o||u.itemsTotal<=u.itemsLoaded||(o=new Promise(c=>{u.onLoad=function(){try{i?.call(this)}finally{o=null,u.onLoad=i??null,c()}}}))},s=u=>{n!==u&&(n=u,r=u.onStart??null,i=u.onLoad??null,u.onStart=function(c,m,f){try{r?.call(this,c,m,f)}finally{l(u)}})};return{name:"three",discover:()=>{let u=a();u&&(s(u),l(u))},seek:u=>{e=Math.max(0,Number(u.time)||0),t=e,window.__hfThreeTime=e,Tr(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0},getReadyPromise:()=>{let u=a();return!u||u.itemsTotal<=u.itemsLoaded?null:(o||l(u),o)}}}function $e(e){let t=null,n=new WeakSet;return{name:e.name,discover:()=>{},seek:()=>{},pause:()=>{},play:()=>{},revert:()=>{},getReadyPromise:()=>{let r=e.getInstances();if(r.length===0)return null;let i=r.filter(o=>!n.has(o));return i.length===0?null:t||(t=Promise.allSettled(i.map(o=>e.waitFor(o).then(()=>{n.add(o)}))).then(()=>{t=null}),t)}}}function Qs(){return $e({name:"mapbox",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfMapbox;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{if(e.loaded()){t();return}e.on("load",t)})})}function Zs(){return $e({name:"leaflet",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfLeaflet;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>e.whenReady(t))})}function el(){return $e({name:"google-maps",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfGoogleMaps;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{let n=e.addListener("tilesloaded",()=>{n.remove(),t()})})})}function tl(){return $e({name:"maplibre",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfMaplibre;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{if(e.loaded()){t();return}e.on("load",t)})})}function nl(){return $e({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}var rp=250;function rl(){let e=null,t=0,n=null,r=()=>{n!==null&&(window.clearInterval(n),n=null)},i=()=>{n===null&&document.querySelector("[data-composition-id][data-requires-webgpu]")&&(n=window.setInterval(()=>{e!==null&&(Xs()||(window.__hfTypegpuTime=e,Rr(e)))},rp))};return{name:"typegpu",discover:()=>{},seek:o=>{e=Math.max(0,Number(o.time)||0),t=e,window.__hfTypegpuTime=e,Tr(e)},pause:()=>{e==null&&(e=Math.max(0,t)),i()},play:()=>{r(),e=null},revert:()=>{r(),e=null,t=0}}}var xn="data-hf-render-id",il="data-hf-group-render-id";function ip(e){return e.getAttribute(xn)||e.id||null}var op="__render_frame_",ap="__";function sp(e){return`${op}${e}${ap}`}function lp(e){let t=ip(e);return t?sp(t):null}function ut(e){let t=lp(e);if(!t)return null;let n=document.getElementById(t);return n instanceof HTMLImageElement?n:null}function ol(e){let t=e.nextElementSibling;if(t instanceof HTMLImageElement&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;let n=ut(e);return n&&n.complete&&n.naturalWidth>0?n:null}function al(){let e=globalThis.GPUQueue;if(!e?.prototype?.copyExternalImageToTexture)return;let t=e.prototype.copyExternalImageToTexture;e.prototype.copyExternalImageToTexture=function(n,r,i){if(n?.source instanceof HTMLVideoElement){let o=ol(n.source);if(o)return t.call(this,{...n,source:o},r,i)}return t.call(this,n,r,i)}}function sl(){let e=[globalThis.WebGL2RenderingContext,globalThis.WebGLRenderingContext],t=["texImage2D","texSubImage2D"];for(let n of e){let r=n?.prototype;if(r)for(let i of t){let o=r[i];if(typeof o!="function"||o.__hfVideoPatched)continue;let a=function(...l){let s=l.length-1,u=l[s];if(u instanceof HTMLVideoElement){let c=ol(u);c&&(l[s]=c)}return o.apply(this,l)};a.__hfVideoPatched=!0,r[i]=a}}}function ll(){let e=!1,t=0,n=!1,r,i,o,a=new Set,l=new WeakMap,s=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},u=x=>{let _=Number(x.currentTime);return Number.isFinite(_)&&_>0?_:0},c=(x,_)=>_<=0?x:x>=_?Math.max(0,x-_):x,m=(x,_)=>{let R=l.get(x);if(R)return R;let T={compositionTimeMs:_,animationTimeMs:e?c(u(x),_):u(x)};return l.set(x,T),T},f=(x,_)=>{if(!a.has(x)){a.add(x);let R=()=>{a.delete(x)};try{x.addEventListener("finish",R,{once:!0}),x.addEventListener("cancel",R,{once:!0})}catch(T){L("runtime.adapters.waapi.site4",T)}}m(x,_)},p=(x,_)=>{for(let R of x)f(R,_)},b=()=>{if(n||typeof Element>"u")return;let x=Element.prototype;if(typeof x.animate!="function"||x.__hfOriginalAnimate)return;let _=x.animate;try{Object.defineProperty(x,"__hfOriginalAnimate",{value:_,configurable:!0});let R=function(...T){let M=_.apply(this,T);return f(M,t),M};x.animate=R,r=x,i=_,o=R,n=!0}catch{}},v=x=>{let _=null;try{_=x.effect?.getComputedTiming?.()??null}catch(M){L("runtime.adapters.waapi.site4",M)}if(!_)return{};let R=Number(_.endTime);return Number.isFinite(R)?{endSeconds:(l.get(x)?.compositionTimeMs??0)/1e3+R/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,b(),p(s(),t)},seek:x=>{let _=Math.max(0,(Number(x.time)||0)*1e3);t=_,(!e||a.size>0)&&p(s(),e?_:0);for(let R of a){let T=e?m(R,_):m(R,0),M=T.animationTimeMs+Math.max(0,_-T.compositionTimeMs);try{R.currentTime=M}catch(F){L("runtime.adapters.waapi.site1",F)}try{R.pause()}catch(F){L("runtime.adapters.waapi.site2",F)}}},pause:()=>{e||p(s(),t);for(let x of a)try{x.pause()}catch(_){L("runtime.adapters.waapi.site3",_)}},revert:()=>{if(a.clear(),l=new WeakMap,e=!1,t=0,r&&i&&o&&r.animate===o)try{r.animate=i,r.__hfOriginalAnimate===i&&delete r.__hfOriginalAnimate}catch(x){L("runtime.adapters.waapi.site5",x)}r=void 0,i=void 0,o=void 0,n=!1},getInferredDurationSeconds:()=>{let x=0;for(let _ of s()){let R=v(_);R.endSeconds!=null&&(x=Math.max(x,R.endSeconds))}return x>0?x:null}}}var ao=3.981071705534972;function Le(e){return Number.isFinite(e)?Math.max(0,Math.min(ao,e)):1}function kr(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function ul(e,t){let n=typeof HTMLMediaElement>"u"?void 0:Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"volume"),r=n?.get,i=n?.set;if(!r||!i)return t();let o=Number(r.call(e));Object.defineProperty(e,"volume",{configurable:!0,get:()=>o,set:a=>{o=Number(a),i.call(e,kr(o))}});try{return t()}finally{delete e.volume,i.call(e,kr(o))}}var Gt=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),lv=Object.freeze([Gt.start,Gt.duration,Gt.trackIndex]),uv=Object.freeze([Gt.derivedEnd]),cv=Object.freeze([Gt.derivedEnd,Gt.legacyTrack]);function Bt(e){if(e==null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}var dl=/^[A-Za-z0-9_.:-]+$/;function fl(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function cl(e,t){let n=t;for(;n>=0&&fl(e,n);)n--;return n}function up(e,t){let n=t;for(;n>=0&&(e[n]??"").trim()==="";)n--;return n}function cp(e){let t=e.length-1;if(!fl(e,t))return null;let n=cl(e,t);return e[n]==="."&&(n=cl(e,n-1)),n+1}function dp(e){let t=cp(e);if(t==null)return null;let n=up(e,t-1),r=e[n];if(r!=="+"&&r!=="-")return null;let i=e.slice(0,n).trim();if(!dl.test(i))return null;let o=Number(e.slice(t));return Number.isFinite(o)?{refId:i,operator:r,magnitude:o}:null}function so(e){let t=(e??"").trim();if(!t)return null;let n=Bt(t);if(n!=null)return{kind:"absolute",value:n};if(dl.test(t))return{kind:"reference",refId:t,offset:0};let r=dp(t);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}function ml(e){return Number.isFinite(e)&&e>0?Math.max(.1,Math.min(5,e)):1}function ve(e){return Bt(e)}function Ce(e){let t=Number.parseFloat(e.getAttribute("data-playback-rate")??""),n=Number.isFinite(t)&&t>0?t:typeof HTMLMediaElement<"u"&&e instanceof HTMLMediaElement?e.defaultPlaybackRate:1;return ml(n)}function yn(e){let t=n=>{let r=ve(n);return r==null?null:Number.isFinite(r)&&r>=0?r:null};return t(e.getAttribute("data-playback-start"))??t(e.getAttribute("data-media-start"))??0}function Ze(e,t){return fp(t,yn(e),Ce(e))}function fp(e,t,n){return Number.isFinite(e)?Math.max(0,e-t)/ml(n):null}function mp(e,t,n){let r=e.filter(o=>Number.isFinite(o.time)&&Number.isFinite(o.volume)).map(o=>({time:Math.max(0,o.time-t),volume:Le(o.volume)})).sort((o,a)=>o.time-a.time),i=[];for(let o of r){let a=i.at(-1);a&&Math.abs(a.time-o.time)<1e-9?a.volume=o.volume:i.push(o)}return i.length===0||i[0].time>0&&i.unshift({time:0,volume:Le(n)}),i}function pl(e,t){if(e.length===0)return 1;let n=0;for(;n<e.length-2&&t>=e[n+1].time;)n+=1;let r=e[n],i=e[n+1]??r,o=i.time-r.time,a=o<=0?0:Math.min(1,Math.max(0,(t-r.time)/o));return r.volume+(i.volume-r.volume)*a}function pp(e,t,n,r){let i=e.at(-1);!i||Math.abs(i.volume-n.volume)>1e-4?(i&&t&&t.time>i.time&&e.push(t),e.push(n)):r&&n.time>i.time&&e.push(n)}function hp(e){let t=Number.parseFloat(e??"");return Number.isFinite(t)?t:void 0}function hl(e,t){let n=ve(e.dataset.start)??0,r=ve(e.dataset.end)??void 0,i=ve(e.dataset.duration)??void 0,o=t;i!==void 0&&i>0?o=n+i:r!==void 0&&r>n&&(o=r);let a=hp(e.dataset.volume)??1;return{start:n,end:o,staticVolume:Le(a)}}function gp(e,t,n,r){let{start:i,end:o,staticVolume:a}=hl(e,n),l=1/Math.min(60,Math.max(1,r)),s=Math.max(0,i),u=Math.min(n,o),c=ul(e,()=>{e.volume=a;let f=[],p;for(let b=s;b<=u+1e-6;b=Math.min(u,b+l)){t(b);let v=Number(e.volume);if(Number.isFinite(v)){let x={time:Number(b.toFixed(6)),volume:Number(Le(v).toFixed(6))};pp(f,p,x,b===u),p=x}if(b===u)break}return f});return c.some(f=>Math.abs(f.volume-a)>1e-4)?c:null}function gl(e,t,n,r,i={}){if(i.allowLiveTimelineSeek===!1||!t||!(e instanceof HTMLAudioElement)&&!(e instanceof HTMLVideoElement)||n<=0)return;let o=s=>{try{typeof t.totalTime=="function"?t.totalTime(s,!0):typeof t.seek=="function"&&t.seek(s,!0)}catch{}},a=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,l=gp(e,o,n,60);if(Number.isFinite(a)&&o(a),l){let{start:s,staticVolume:u}=hl(e,n),c=mp(l,s,u);c.length>0&&r.set(e,c)}}var Rt="data-fx-chain",vv=Rt.slice(5),bl=1,vn=(e="frequency",t="Frequency",n=1e3,r=20,i=2e4)=>({kind:"number",key:e,label:t,unit:"Hz",min:r,max:i,step:1,default:n,scale:"log",automatable:!0}),lo=(e=.707,t="Bandwidth \u2014 higher is narrower.")=>({kind:"number",key:"q",label:"Q",unit:"",min:.1,max:20,step:.01,default:e,scale:"log",automatable:!0,hint:t}),Mr=(e=-40,t=40,n=0)=>({kind:"number",key:"gain",label:"Gain",unit:"dB",min:e,max:t,step:.1,default:n,automatable:!0}),xl={kind:"enum",key:"poles",label:"Slope",options:[{value:"1",label:"6 dB/oct"},{value:"2",label:"12 dB/oct"}],default:"2",hint:"Two poles is the usual biquad; one pole is gentler."},vl=[{id:"gain",label:"Gain",group:"dynamics",description:"Raise or lower the whole signal. Automate it to duck under something else.",params:[Mr(-60,12,0)],web:"gain-node"},{id:"peaking",label:"Peaking EQ",group:"filter",description:"Boost or cut a band, leaving everything either side alone.",params:[vn("frequency","Frequency",1e3),Mr(-40,40,0),lo(1)],web:"biquad-peaking"},{id:"lowshelf",label:"Low Shelf",group:"filter",description:"Lift or drop everything below the corner frequency.",params:[vn("frequency","Frequency",200,20,2e3),Mr(-40,40,0)],web:"biquad-lowshelf"},{id:"highshelf",label:"High Shelf",group:"filter",description:"Lift or drop everything above the corner frequency.",params:[vn("frequency","Frequency",4e3,500,2e4),Mr(-40,40,0)],web:"biquad-highshelf"},{id:"highpass",label:"High-pass",group:"filter",description:"Remove low frequencies \u2014 the usual fix for rumble on a voice.",params:[vn("frequency","Cutoff",300,20,2e4),lo(.707),xl],web:"biquad-highpass"},{id:"lowpass",label:"Low-pass",group:"filter",description:"Remove high frequencies \u2014 darkens or muffles a track.",params:[vn("frequency","Cutoff",8e3,100,2e4),lo(.707),xl],web:"biquad-lowpass"},{id:"compressor",label:"Compressor",group:"dynamics",description:"Pull loud parts down so the quiet ones can come up.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-60,max:0,step:.5,default:-24,hint:"Level above which the compressor starts working."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:4},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:2e3,step:.1,default:20,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:250,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83,hint:"1 is a hard corner; higher eases into it."},{kind:"number",key:"makeup",label:"Makeup",unit:"dB",min:0,max:36,step:.1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1,hint:"Below 1 blends the dry signal back in."}],web:"worklet-compressor"},{id:"limiter",label:"Limiter",group:"dynamics",description:"Hard ceiling \u2014 nothing gets past the limit.",params:[{kind:"number",key:"limit",label:"Ceiling",unit:"dB",min:-24,max:0,step:.1,default:-1},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.1,max:80,step:.1,default:5},{kind:"number",key:"release",label:"Release",unit:"ms",min:1,max:8e3,step:1,default:50,scale:"log"},{kind:"number",key:"level_out",label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0}],web:"worklet-limiter"},{id:"gate",label:"Noise Gate",group:"dynamics",description:"Silence the track when it drops below the threshold.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-80,max:0,step:.5,default:-35},{kind:"number",key:"range",label:"Range",unit:"dB",min:-80,max:0,step:.5,default:-24,hint:"How far down the gate pulls when closed."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:10},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:9e3,step:.1,default:1,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:100,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83}],web:"worklet-gate"},{id:"saturate",label:"Saturation",group:"nonlinear",description:"Soft-clip the waveform for warmth or outright distortion.",params:[{kind:"enum",key:"type",label:"Curve",options:[{value:"tanh",label:"Tanh"},{value:"atan",label:"Arctan"},{value:"cubic",label:"Cubic"},{value:"exp",label:"Exponential"},{value:"alg",label:"Algebraic"},{value:"quintic",label:"Quintic"},{value:"sin",label:"Sine"},{value:"erf",label:"Error function"},{value:"hard",label:"Hard clip"}],default:"tanh"},{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-40,max:0,step:.1,default:-6},{kind:"number",key:"output",automatable:!0,label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0},{kind:"number",key:"oversample",label:"Oversample",unit:"x",min:1,max:8,step:1,default:4,hint:"Higher costs more but keeps aliasing down."}],web:"waveshaper"},{id:"bitcrush",label:"Bitcrush",group:"nonlinear",description:"Drop bit depth and sample rate for a lo-fi, digital sound.",params:[{kind:"number",key:"bits",label:"Bit depth",unit:"bit",min:1,max:32,step:.1,default:8},{kind:"number",key:"samples",label:"Sample hold",unit:"x",min:1,max:250,step:1,default:1,hint:"Repeats each sample N times \u2014 a crude downsample."},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-bitcrush"},{id:"pitchshift",label:"Pitch shift",group:"time",description:"Shifts pitch up or down without changing playback speed. Adds ~50 ms of latency.",params:[{kind:"number",key:"semitones",label:"Semitones",unit:"st",min:-12,max:12,step:1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-pitchshift"},{id:"delay",label:"Delay",group:"time",description:"Repeating echoes behind the dry signal.",params:[{kind:"number",key:"time",automatable:!0,label:"Time",unit:"ms",min:1,max:5e3,step:1,default:250,scale:"log"},{kind:"number",key:"feedback",automatable:!0,label:"Feedback",unit:"",min:.01,max:.95,step:.01,default:.35},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.4}],web:"delay-feedback"},{id:"chorus",label:"Chorus",group:"time",description:"Detuned copies of the signal for width and thickness.",params:[{kind:"number",key:"delay",automatable:!0,label:"Delay",unit:"ms",min:1,max:100,step:.1,default:7},{kind:"number",key:"depth",automatable:!0,label:"Depth",unit:"ms",min:0,max:10,step:.01,default:2},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.01,max:10,step:.01,default:1},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.5}],web:"chorus-lfo"},{id:"phaser",label:"Phaser",group:"time",description:"Sweeping notches moving through the spectrum.",params:[{kind:"number",key:"in_gain",automatable:!0,label:"Input",unit:"",min:0,max:1,step:.01,default:.4},{kind:"number",key:"out_gain",automatable:!0,label:"Output",unit:"",min:0,max:2,step:.01,default:.74},{kind:"number",key:"delay",label:"Delay",unit:"ms",min:.1,max:5,step:.1,default:3},{kind:"number",key:"decay",label:"Decay",unit:"",min:0,max:.99,step:.01,default:.4},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.1,max:2,step:.01,default:.5},{kind:"enum",key:"type",label:"Waveform",options:[{value:"0",label:"Triangular"},{value:"1",label:"Sinusoidal"}],default:"0"}],web:"allpass-phaser"},{id:"reverb",label:"Reverb",group:"time",description:"Room tail. Both ends convolve the same generated impulse, so preview matches render.",params:[{kind:"number",key:"size",label:"Room size",unit:"",min:.05,max:1,step:.01,default:.7},{kind:"number",key:"damping",label:"Damping",unit:"",min:0,max:1,step:.01,default:.5,hint:"Higher rolls the top off the tail faster."},{kind:"number",key:"wet",automatable:!0,label:"Wet",unit:"",min:0,max:1,step:.01,default:.35},{kind:"number",key:"dry",automatable:!0,label:"Dry",unit:"",min:0,max:1,step:.01,default:.7}],web:"convolver"}],uo=new Map(vl.map(e=>[e.id,e]));function Sn(e){return uo.get(e)}var Sv=vl.map(e=>e.id);function An(e,t){let n=uo.get(e);if(!n)return{};let r={};for(let i of n.params){let o=t?.[i.key];if(i.kind==="enum"){let l=i.options.some(s=>s.value===o);r[i.key]=l?o:i.default;continue}let a=typeof o=="number"?o:typeof o=="string"&&o.trim()!==""?Number(o):Number.NaN;r[i.key]=Number.isFinite(a)?Math.min(i.max,Math.max(i.min,a)):i.default}return r}var ct=class extends Error{constructor(t){super(t),this.name="AudioFxChainError"}};function Sl(e){let t;try{t=JSON.parse(e)}catch(i){throw new ct(`Chain file is not valid JSON: ${i.message}`)}if(typeof t!="object"||t===null)throw new ct("Chain file must be a JSON object.");let n=t;if(n.version!==bl)throw new ct(`Unsupported chain version: ${String(n.version)}`);if(!Array.isArray(n.nodes))throw new ct("Chain file is missing a `nodes` array.");let r=n.nodes.map(bp);return{version:bl,nodes:r}}function En(e){return e.nodes.filter(t=>t.enabled!==!1)}function bp(e,t){if(typeof e!="object"||e===null)throw new ct(`Node ${t} is not an object.`);let n=e;if(typeof n.type!="string"||!uo.has(n.type))throw new ct(`Node ${t} has unknown effect type: ${String(n.type)}`);return yp({type:n.type,id:Fr(n.id),fromCarve:yl(n.fromCarve),fromPreset:Fr(n.fromPreset),label:Fr(n.label),fromEq:Fr(n.fromEq),fromLeveller:yl(n.fromLeveller),presetAmount:xp(n.presetAmount),enabled:n.enabled!==!1,params:An(n.type,n.params??void 0)})}function Fr(e){return typeof e=="string"&&e?e:void 0}function yl(e){return e===!0?!0:void 0}function xp(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(1,Math.max(0,e))}function yp(e){for(let t of Object.keys(e))e[t]===void 0&&delete e[t];return e}var tt="data-automation",Cv=tt.slice(5),Nr=1,vp=512,et=class extends Error{constructor(t){super(t),this.name="AudioAutomationError"}},Ut="volume";function Cn(e){if(e===Ut)return{kind:"volume"};let t=e.split(".");if(t.length===3&&t[0]==="fx"&&t[1]===Sp){let i=t[2];return i?{kind:"preset",presetId:i}:null}if(t.length!==3||t[0]!=="fx")return null;let[,n,r]=t;return!n||!r?null:{kind:"fx",nodeId:n,param:r}}var Sp="preset";var Ap={min:0,max:1,step:.01,unit:"",label:"Amount",scale:"linear",default:1},Lr={min:0,max:ao,step:.01,unit:"",label:"Volume",scale:"linear",default:1};function co(e,t){let n=Cn(e);if(!n)return null;if(n.kind==="volume")return Lr;if(n.kind==="preset")return t?.nodes.some(l=>l.fromPreset===n.presetId)?{...Ap,label:`${n.presetId} \xB7 Amount`}:null;let r=t?.nodes.find(a=>a.id===n.nodeId);if(!r)return null;let i=Sn(r.type),o=i?.params.find(a=>a.key===n.param);return!o||o.kind!=="number"?null:{min:o.min,max:o.max,step:o.step,unit:o.unit,label:`${i?.label??r.type} \xB7 ${o.label}`,scale:o.scale==="log"&&o.min>0?"log":"linear",default:o.default}}function wn(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null}function Ep(e){let t=wn(e);return t===null||t===0?0:Math.min(1,Math.max(-1,t))}function Al(e,t){let n=wn(e),r=wn(t);if(n===null||r===null)return null;let i=l=>Math.min(.999,Math.max(.001,l)),o=i(n),a=i(r);return Math.abs(o-a)<1e-6?null:{x:o,y:a}}function wp(e){let t=Ep(e?.curve),n=Al(e?.viaX,e?.viaY);return{...t?{curve:t}:{},...n?{viaX:n.x,viaY:n.y}:{}}}function Cp(e,t){let n=wn(e?.t),r=wn(e?.v);if(n===null||r===null)return null;let i=t?Math.min(t.max,Math.max(t.min,r)):r;return{t:Math.max(0,n),v:i,...wp(e)}}function El(e,t){let n=e.map(i=>Cp(i,t)).filter(i=>i!==null).sort((i,o)=>i.t-o.t),r=[];for(let i of n)r.length>0&&r[r.length-1].t===i.t?r[r.length-1]=i:r.push(i);return r.slice(0,vp)}function _p(e){let t=[];for(let n of e.lanes){if(!Cn(n.target))continue;let r=n.target===Ut?Lr:null,i=El(n.points??[],r);i.length>0&&t.push({target:n.target,points:i})}return{version:Nr,lanes:t}}function wl(e,t){let n=[];for(let r of e.lanes){let i=co(r.target,t);if(!i)continue;let o=El(r.points,i);o.length>0&&n.push({target:r.target,points:o})}return{version:Nr,lanes:n}}function Dr(e){let t;try{t=JSON.parse(e)}catch(i){throw new et(`Automation is not valid JSON: ${i.message}`)}if(typeof t!="object"||t===null)throw new et("Automation must be a JSON object.");let n=t;if(n.version!==Nr)throw new et(`Unsupported automation version: ${String(n.version)}`);if(!Array.isArray(n.lanes))throw new et("Automation is missing a `lanes` array.");let r=n.lanes.map((i,o)=>{if(typeof i!="object"||i===null)throw new et(`Lane ${o} is not an object.`);let a=i;if(typeof a.target!="string"||!Cn(a.target))throw new et(`Lane ${o} has an unreadable target: ${String(a.target)}`);if(!Array.isArray(a.points))throw new et(`Lane ${o} is missing a \`points\` array.`);return{target:a.target,points:a.points}});return _p({version:Nr,lanes:r})}function Tp(e,t){return t?Math.pow(e,Math.pow(2,2*t)):e}function Rp(e,t){let n=e-.5,r=t-.5,i=.999,o=1e6,a=n>0?n/(i-e):n<0?-n/(e-(1-i)):0,l=r>0?r/(i-t):r<0?-r/(t-(1-i)):0,s=Math.min(o,Math.max(1,a,l));return{cx:e+n/s,cy:t+r/s,w:s}}function kp(e,t,n){let{cx:r,cy:i,w:o}=Rp(t,n),a=2-2*o,l=e*a-1+2*o*r,s=-e*a-2*o*r,u=Mp(l,s,e),c=1-u,m=c*c+2*o*u*c+u*u;return m>0?(2*o*i*u*c+u*u)/m:e}function Mp(e,t,n){if(Math.abs(e)<1e-12)return Math.abs(t)<1e-12?n:-n/t;let r=Math.sqrt(Math.max(0,t*t-4*e*n)),i=(-t+r)/(2*e),o=(-t-r)/(2*e),a=l=>l>=-1e-9&&l<=1+1e-9;return a(i)?Math.min(1,Math.max(0,i)):a(o)?Math.min(1,Math.max(0,o)):n}function Fp(e,t){let n=Al(t.viaX,t.viaY);return n?kp(Math.min(1,Math.max(0,e)),n.x,n.y):Tp(e,t.curve)}function Np(e,t,n,r){return r==="log"&&e>0&&t>0?Math.exp(Math.log(e)+(Math.log(t)-Math.log(e))*n):e+(t-e)*n}function _n(e,t,n="linear"){let r=e.points;if(r.length===0)return 0;let i=r[0];if(t<=i.t)return i.v;let o=r[r.length-1];if(t>=o.t)return o.v;let a=0,l=r.length-1;for(;l-a>1;){let m=a+l>>1;r[m].t<=t?a=m:l=m}let s=r[a],u=r[l],c=u.t-s.t;return c<=0?u.v:Np(s.v,u.v,Fp((t-s.t)/c,s),n)}function Cl(e){return e.points.length<=1||e.points.every(t=>t.v===e.points[0].v)}function _l(e,t,n,r,i="linear"){let o=Math.max(2,Math.floor(r)),a=new Float32Array(o),l=n-t;for(let s=0;s<o;s+=1)a[s]=_n(e,t+l*s/(o-1),i);return a}var Ir=new Map,Lp=64;function Dp(e){let t=Ir.get(e);if(t!==void 0)return t;let n=null;try{n=Dr(e).lanes.find(r=>r.target===Ut)??null}catch{n=null}return Ir.size>Lp&&Ir.clear(),Ir.set(e,n),n}function Tl(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(tt):null)??"";if(!n)return null;let r=Dp(n);return!r||r.points.length===0?null:_n(r,t)}var Wt="hf-audio-group",Pr="data-audio-group";function fo(e){let t=e?.getAttribute("data-volume"),n=t?parseFloat(t):1;return Number.isFinite(n)?n:1}function mo(e,t){let n=Array.from(e?.querySelectorAll?.(`${Wt}[${xn}]`)??[]).find(i=>i.getAttribute(xn)===t);if(n)return n;let r=e?.getElementById(t)??null;return r&&r.tagName?.toLowerCase()===Wt?r:null}function Or(e,t){let n=t?.getAttribute?.(il)??t?.getAttribute?.(Pr);return n?mo(e,n)?.hasAttribute("data-hidden")??!1:!1}function Rl(e){return typeof e.tagName!="string"||e.tagName.toLowerCase()!=="audio"||typeof e.getAttribute!="function"?null:e.getAttribute(Pr)||null}function kl(e){let t="__hf-audio-group-inert";if(!e?.head||e.getElementById(t))return;let n=e.createElement("style");n.id=t,n.textContent=`${Wt}{display:none!important}`,e.head.appendChild(n)}function je(e){return yn(e)}function Ml(e){let t=e.isVideo?e.explicitDuration??e.sourceDuration:e.sourceDuration,n=(e.isVideo?[t,e.hostRemaining]:[t,e.hostRemaining,e.explicitDuration]).filter(r=>r!=null&&Number.isFinite(r)&&r>=0);return n.length>0?Math.min(...n):null}function Fl(e){let t=Array.from(document.querySelectorAll("video, audio")),n=e?.shouldIncludeElement?t.filter(a=>e.shouldIncludeElement?.(a)):t.filter(a=>a.hasAttribute("data-start")),r=[],i=[],o=0;for(let a of n){let l=e?.resolveStartSeconds?e.resolveStartSeconds(a):Number.parseFloat(a.dataset.start??"0");if(!Number.isFinite(l))continue;let s=je(a),u=Ce(a),c=a.loop,m=Number.isFinite(a.duration)&&a.duration>0?a.duration:null,f=e?.resolveDurationSeconds?.(a)??Number.parseFloat(a.dataset.duration??"");(!Number.isFinite(f)||f<0)&&m!=null&&(f=Math.max(0,(m-s)/u));let p=Number.isFinite(f)&&f>=0,b=p?l+f:Number.POSITIVE_INFINITY,v=Number.parseFloat(a.dataset.volume??""),x={el:a,start:l,mediaStart:s,duration:p?f:Number.POSITIVE_INFINITY,end:b,volume:Number.isFinite(v)?v:null,playbackRate:u,loop:c,sourceDuration:m};r.push(x),a.tagName==="VIDEO"&&i.push(x),Number.isFinite(b)&&(o=Math.max(o,b))}return{timedMediaEls:n,mediaClips:r,videoClips:i,maxMediaEnd:o}}var ho=new WeakMap,Hr=new WeakMap,Tn=new WeakMap,go=new WeakSet,Vt=new WeakSet;function Ip(e){if(Vt.has(e))return;Vt.add(e);let t=()=>Vt.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}var Pp=3;function Op(e){return e.error!=null||e.networkState===Pp}var bo=new WeakMap;function po(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function xo(e){ho.delete(e),Hr.delete(e),Tn.delete(e),go.delete(e),bo.delete(e)}function Nl(e){let t=!!(e.outputMuted||e.userMuted);for(let n of e.clips){let{el:r}=n;if(!r.isConnected)continue;let i=(e.timeSeconds-n.start)*n.playbackRate+n.mediaStart,o=r.tagName==="VIDEO"&&!n.loop,a=o&&n.sourceDuration!=null&&i>=n.sourceDuration&&e.timeSeconds>=n.start&&e.timeSeconds<n.end;a&&n.sourceDuration!=null&&(i=n.sourceDuration);let l=Hr.get(r),s=r.tagName==="AUDIO"&&(l===void 0||i<l-.04),u=!n.loop&&n.sourceDuration!=null&&i>=n.mediaStart&&i<n.sourceDuration&&(o||s);if(e.timeSeconds>=n.start&&e.timeSeconds<n.end&&i>=0&&(!r.ended||n.loop||a||u)){if(Hr.set(r,i),n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let H=n.sourceDuration-n.mediaStart;H>0&&i>=n.sourceDuration&&(i=n.mediaStart+(i-n.mediaStart)%H)}let f=po(e.userVolume??1),p=Le(n.volume??1),b=bo.get(r),v=po(r.volume),x,_=Tl(r,e.timeSeconds-n.start);if(_!==null)x=Le(_);else if(n.volumeKeyframes&&n.volumeKeyframes.length>0){let H=e.timeSeconds-n.start;x=Le(pl(n.volumeKeyframes,H))}else e.isWebAudioRouted?.(r)?x=p:b===void 0?x=p>1?p:v:Math.abs(v-b)>1e-4?x=v:x=p;let T=r.closest("[data-hidden]")!==null||Or(r.ownerDocument,r)?0:po(x*f);r.volume=T,bo.set(r,T),e.onElementVolume?.(r,T,x),(t||e.isWebAudioOwned?.(r))&&(r.muted=!0),r.preload!=="auto"&&(r.preload="auto");try{r.playbackRate=n.playbackRate*e.playbackRate}catch(H){L("runtime.media.site1",H)}let M=.04,F=2,E=r.currentTime||0,S=Math.abs(E-i),A=i-E,C=ho.get(r);ho.set(r,A);let N=C===void 0,I=!N&&Math.abs(A-C)>.5,W=S>3,B=r.tagName==="AUDIO"&&N&&E-i>M,oe=a&&S>.001||r.ended&&u&&S>.001||B||S>.5&&(N||I||W),k=r.tagName==="VIDEO"&&!r.paused,V=C!==void 0&&Math.abs(A-C)<.004,Q=!1;if(!k&&!oe&&!N&&V&&S>M){let H=(Tn.get(r)??0)+1;Tn.set(r,H),H>=F&&(Q=!0,Tn.set(r,0))}else S<=M&&Tn.set(r,0);let G=!k&&e.forceSync&&S>.02;if(oe||Q||G){if(!(r.tagName==="VIDEO"&&!!ut(r))){try{r.currentTime=i}catch(z){L("runtime.media.site2",z)}if(Math.abs(r.currentTime-i)>.5&&!go.has(r)){go.add(r),r.load();try{r.currentTime=i}catch(z){L("runtime.media.site3",z)}}}Vt.delete(r)}a?r.paused||r.pause():e.playing&&r.paused&&!Vt.has(r)&&!Op(r)?(Ip(r),r.play().catch(H=>{Vt.delete(r),(H&&typeof H=="object"&&"name"in H?String(H.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!e.playing&&!r.paused&&r.pause();continue}let m=e.timeSeconds>=n.start&&e.timeSeconds<n.end;xo(r),m&&Hr.set(r,i),r.paused||r.pause()}}var Hp="hf-proxy",Ll="runtime_media_proxy_fallback",Dl="runtime_media_proxy_unavailable",Rn=new WeakSet,Il=new WeakSet;function Gr(e){return e.currentSrc||e.src}function yo(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:e instanceof HTMLVideoElement&&!!ut(e)}function vo(e){let t=Gr(e);if(!t)return null;let n;try{n=new URL(t,document.baseURI)}catch{return null}if(n.origin!==window.location.origin)return null;try{return decodeURIComponent(n.pathname)}catch{return n.pathname}}function Gp(e,t){let n=null;for(let r of Object.keys(t))e.endsWith(r)&&(n===null||r.length>n.length)&&(n=r);return n?t[n]??null:null}function Bp(e,t){let n=e.normalize("NFC").toLowerCase(),r=-1,i=null,o=!1;for(let[a,l]of Object.entries(t)){let s=a.normalize("NFC").toLowerCase();n.endsWith(s)&&(s.length>r?(r=s.length,i=l,o=!1):s.length===r&&(o=!0))}return o?null:i}function So(e,t){return t[e]??Gp(e,t)??Bp(e,t)}function Up(e,t){let n=new URL(e,document.baseURI);return n.searchParams.set(Hp,t?t.hasAlpha?"vp8":"h264":"auto"),n.href}var Wp={cross_origin:"video reports zero decodable width but its source is cross-origin; no local proxy can be served for it",proxy_playback_failed:"the authoring proxy itself failed to decode; render output is unaffected",browser_safe_codec:"the file errored but its codec is browser-decodable; a proxy cannot help (the file itself is likely corrupt)",invalid_source_url:"the media source URL is malformed and cannot be proxied"};function kt(e,t,n){if(Il.has(e))return;Il.add(e);let r=Wp[t];xe({source:"hf-preview",type:"diagnostic",code:Dl,details:{asset:n,codecName:null,reason:t,note:r}}),console.info(`[hyperframes] ${Dl}: "${n}" (${t}): ${r}`)}function Ao(e,t=null,n="reactive"){if(Rn.has(e))return;let r=Gr(e),i;try{i=Up(r,t)}catch(l){L("runtime.mediaProxy.swap",l),kt(e,"invalid_source_url",r);return}Rn.add(e),xo(e),e.src=i,e.load();let o=t?.codecName??null;xe({source:"hf-preview",type:"diagnostic",code:Ll,details:{asset:r,codecName:o,trigger:n,note:"render output is unaffected; only this preview element was swapped to an authoring proxy"}}),console.info(`[hyperframes] ${Ll}: "${r}" uses a codec (${o??"unknown"}) this browser can't decode; auto-swapped to an authoring proxy for this preview only. Render output is unaffected.`)}function Pl(e){if(yo(e)||!(e instanceof HTMLVideoElement)||Rn.has(e))return;let t=window.__HF_MEDIA_CODEC_MAP__;if(!t)return;let n=vo(e);if(n===null)return;let r=So(n,t);if(!r||!r.browserHostile)return;let i=r.representativeMime?e.canPlayType(r.representativeMime):"";i==="probably"||i==="maybe"||Ao(e,r,"proactive")}function Ol(e){if(yo(e)||!(e instanceof HTMLVideoElement)||e.videoWidth!==0)return;let t=Gr(e);if(Rn.has(e)){kt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=vo(e);if(r===null){kt(e,"cross_origin",t);return}let i=So(r,n);if(i&&!i.browserHostile){kt(e,"browser_safe_codec",t);return}Ao(e,i,"reactive")}function Hl(e){if(yo(e)||!(e instanceof HTMLVideoElement))return;let t=Gr(e);if(Rn.has(e)){kt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=vo(e);if(r===null){kt(e,"cross_origin",t);return}let i=So(r,n);if(i&&!i.browserHostile){kt(e,"browser_safe_codec",t);return}Ao(e,i,"tertiary")}var Se=class extends Error{constructor(n,r=null){super(r==null?n:`${n} at line ${r}`);ge(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=r}},Vp=[0,0,0],zp=[1,1,1],Br=64;function qp(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r==='"'&&(t=!t),r==="#"&&!t)return e.slice(0,n)}return e}function dt(e,t){let n=Number(e);if(!Number.isFinite(n))throw new Se(`Invalid number "${e}"`,t);return n}function Gl(e,t,n){if(e.length!==3)throw new Se(`${t} expects three numbers`,n);return[dt(e[0],n),dt(e[1],n),dt(e[2],n)]}function Bl(e,t,n){if(!e)throw new Se(`${t} expects a size`,n);let r=Number(e);if(!Number.isInteger(r)||r<2)throw new Se(`${t} must be an integer greater than 1`,n);return r}function $p(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new Se("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function jp(e){let t=/^TITLE\s+"([^"]*)"\s*$/i.exec(e);if(t)return t[1]??null;let n=/^TITLE\s+(.+)\s*$/i.exec(e);return n&&(n[1]??"").trim()||null}function Kp(e){return/^[+-]?(?:\d|\.\d)/.test(e)}function Ul(e,t={}){let n=t.maxSize??Br,r=null,i=Vp,o=zp,a=null,l=null,s=[],u=e.replace(/^\uFEFF/,"").split(/\r?\n/);for(let m=0;m<u.length;m++){let f=m+1,p=qp(u[m]??"").trim();if(!p)continue;let b=p.split(/\s+/),v=(b[0]??"").toUpperCase(),x=b.slice(1);if(v==="TITLE"){r=jp(p);continue}if(v==="DOMAIN_MIN"){i=Gl(x,v,f);continue}if(v==="DOMAIN_MAX"){o=Gl(x,v,f);continue}if(v==="LUT_3D_INPUT_RANGE"){if(x.length!==2)throw new Se(`${v} expects two numbers`,f);let _=dt(x[0],f),R=dt(x[1],f);if(R<=_)throw new Se("LUT_3D_INPUT_RANGE max must exceed min",f);i=[_,_,_],o=[R,R,R];continue}if(v==="LUT_1D_SIZE"){a=Bl(x[0],v,f);continue}if(v==="LUT_3D_SIZE"){if(l=Bl(x[0],v,f),l>n)throw new Se(`LUT_3D_SIZE ${l} exceeds max ${n}`,f);continue}if(!Kp(v)){if(v.startsWith("LUT_"))throw new Se(`Unsupported cube keyword ${v}`,f);continue}if(!l)throw a?new Se("1D cube LUTs are not supported yet",f):new Se("LUT data appears before LUT_3D_SIZE",f);if(b.length!==3)throw new Se("LUT data rows must contain three numbers",f);s.push(dt(b[0],f),dt(b[1],f),dt(b[2],f))}if(a&&l)throw new Se("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw a?new Se("1D cube LUTs are not supported yet"):new Se("Missing LUT_3D_SIZE");$p(i,o);let c=l*l*l;if(s.length!==c*3)throw new Se(`Expected ${c} LUT rows for size ${l}, found ${s.length/3}`);return{title:r,size:l,domainMin:i,domainMax:o,data:new Float32Array(s)}}function Yp(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function kn(e){return Math.round(Yp(e)*255)}function Eo(e){let t=e.size,n=t*t,r=t,i=new Uint8Array(n*r*4);for(let o=0;o<t;o++)for(let a=0;a<t;a++)for(let l=0;l<t;l++){let s=((o*t+a)*t+l)*3,u=(a*n+o*t+l)*4;i[u]=kn(e.data[s]??0),i[u+1]=kn(e.data[s+1]??0),i[u+2]=kn(e.data[s+2]??0),i[u+3]=255}return{width:n,height:r,data:i}}var Wl="rec709";var me={hueDegrees:{min:0,max:360,inclusiveMax:!1},unit:{min:0,max:1},signedUnit:{min:-1,max:1},secondaryHueRange:{min:0,max:180},secondaryHueSoftness:{min:0,max:180},secondaryHueCombinedMax:180,secondarySoftRangeSoftness:{min:0,max:.5},secondaryHueShift:{min:-180,max:180},effects:{asciiStyle:{min:0,max:7},bloom:{min:0,max:3},bloomRadius:{min:1,max:100},monoScreenShape:{min:0,max:4}}};var Vl=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"],zl=["shadows","midtones","highlights"],ql=["master","red","green","blue"],$l=["hueVsHue","hueVsSaturation","hueVsLuma"];var jl=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],Kl=["blur","pixelate","chromaBleed","tapeDamage","tapeTracking","tapeNoise","tapeSpeed","filmArtifacts","halftone","halftoneSize","twoInkPrint","twoInkPrintSize","ascii","asciiSize","asciiInvert","asciiStyle","asciiColor","asciiRotation","dither","ditherSize","bloom","bloomRadius","monoScreen","monoScreenSize","monoScreenAngle","monoScreenSpread","monoScreenShape","monoScreenInvert","scanlines","scanlineCount","scanlineSoftness","chromaticAberration","chromaticAngle","crtCurvature","digitalGlitch","digitalGlitchColorSplit","digitalGlitchLineTear","digitalGlitchPixelate","digitalGlitchBlockAmount","digitalGlitchBlockDisplacement","digitalGlitchBlockOpacity","digitalGlitchSpeed","engraving","engravingSpacing","engravingMinThickness","engravingMaxThickness","engravingAngle","engravingContrast","engravingSharpness","engravingWave","engravingWaveFrequency","crosshatch","crosshatchSpacing","crosshatchThickness","crosshatchAngle","crosshatchContrast","crosshatchEdges","crosshatchLineWeight","crosshatchWave","crosshatchWaveFrequency","kuwahara","kuwaharaRadius","kuwaharaSharpness","kuwaharaSaturation"];var Yv=me.unit,Xv=me.signedUnit,Jv=me.effects;var Ke=1024,Mn=16;function Yl(e,t,n,r){let i=((2*e+t)*n-e*r)/(e+t);return Math.sign(i)!==Math.sign(n)?0:Math.sign(n)!==Math.sign(r)&&Math.abs(i)>3*Math.abs(n)?3*n:i}function Ae(e,t){let n=e[t];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function Xp(e){let t=[],n=[],r=Ae(e,0);for(let a of e.slice(1)){let l=a[0]-r[0];t.push(l),n.push((a[1]-r[1])/l),r=a}let i=Ae(n,0);if(e.length===2)return[i,i];let o=new Array(e.length);o[0]=Yl(Ae(t,0),Ae(t,1),i,Ae(n,1)),o[o.length-1]=Yl(Ae(t,t.length-1),Ae(t,t.length-2),Ae(n,n.length-1),Ae(n,n.length-2));for(let a=1;a<e.length-1;a+=1){let l=Ae(n,a-1),s=Ae(n,a);if(l===0||s===0||Math.sign(l)!==Math.sign(s)){o[a]=0;continue}let u=Ae(t,a-1),c=Ae(t,a),m=2*c+u,f=c+2*u;o[a]=(m+f)/(m/l+f/s)}return o}function Xl(e,t){if(e.length<2)throw new RangeError("A color curve requires at least two points");if(!Number.isInteger(t)||t<2)throw new RangeError("Curve LUT size must be at least 2");let n=Number.NEGATIVE_INFINITY;for(let[r,i]of e){if(!Number.isFinite(r)||!Number.isFinite(i))throw new TypeError("Color curve points must be finite");if(r<=n)throw new RangeError("Color curve inputs must be strictly increasing");n=r}}function Jp(e,t,n){if(!Number.isFinite(t)||!Number.isFinite(n)||t>=n)throw new RangeError("Curve output bounds must be finite and increasing");if(e.some(([,r])=>r<t||r>n))throw new RangeError(`Curve outputs must be between ${t} and ${n}`)}function Qp(e,t,n,r,i){let o=n[0]-t[0],a=Math.min(1,Math.max(0,(e-t[0])/o)),l=a*a,s=l*a;return(2*s-3*l+1)*t[1]+(s-2*l+a)*o*r+(-2*s+3*l)*n[1]+(s-l)*o*i}function Jl(e,t,n,r,i){Jp(e,r,i);let o=Xp(e),a=new Float32Array(t),l=0;for(let s=0;s<t;s+=1){let u=n(s);for(;l<e.length-2&&u>Ae(e,l+1)[0];)l+=1;let c=Ae(e,l),m=Ae(e,l+1),f=Qp(u,c,m,Ae(o,l),Ae(o,l+1));a[s]=Math.min(i,Math.max(r,f))}return a}function zt(e,t=Ke){if(Xl(e,t),e.length>Mn)throw new RangeError(`A color curve supports at most ${Mn} points`);if(e.some(([n])=>n<0||n>1))throw new RangeError("Color curve inputs must be between 0 and 1");if(e[0]?.[0]!==0||e[e.length-1]?.[0]!==1)throw new RangeError("Color curves must include input endpoints 0 and 1");return Jl(e,t,n=>n/(t-1),0,1)}function Co(e,t,n,r=Ke){if(e.length<3)throw new RangeError("A hue curve requires at least three points");if(e.length>Mn)throw new RangeError(`A hue curve supports at most ${Mn} points`);let i=[...e].sort((s,u)=>s[0]-u[0]);for(let s=0;s<i.length;s+=1){let u=i[s];if(!u||u[0]<0||u[0]>=360)throw new RangeError("Hue curve inputs must be from 0 up to 360 degrees");if(s>0&&u[0]===i[s-1]?.[0])throw new RangeError("Hue curve inputs must be unique")}let o=i.slice(-2).map(([s,u])=>[s-360,u]),a=i.slice(0,2).map(([s,u])=>[s+360,u]),l=[...o,...i,...a];return Xl(l,r),Jl(l,r,s=>s/r*360,t,n)}var Fn="data-color-grading",Nn="data-hf-color-grading-source-hidden",Vr="data-hf-authored-opacity",nu="__hf_color_grading_",eh=Wl,Ro={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},ko={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},Mo={blur:0,pixelate:0,chromaBleed:0,tapeDamage:0,tapeTracking:0,tapeNoise:1,tapeSpeed:.5,filmArtifacts:0,halftone:0,halftoneSize:0,twoInkPrint:0,twoInkPrintSize:0,ascii:0,asciiSize:5/76,asciiInvert:0,asciiStyle:0,asciiColor:1,asciiRotation:0,dither:0,ditherSize:0,bloom:0,bloomRadius:8,monoScreen:0,monoScreenSize:0,monoScreenAngle:0,monoScreenSpread:0,monoScreenShape:0,monoScreenInvert:0,scanlines:0,scanlineCount:0,scanlineSoftness:0,chromaticAberration:0,chromaticAngle:0,crtCurvature:0,digitalGlitch:0,digitalGlitchColorSplit:0,digitalGlitchLineTear:0,digitalGlitchPixelate:0,digitalGlitchBlockAmount:0,digitalGlitchBlockDisplacement:0,digitalGlitchBlockOpacity:0,digitalGlitchSpeed:0,engraving:0,engravingSpacing:7/17,engravingMinThickness:.2,engravingMaxThickness:3.2/7,engravingAngle:.25,engravingContrast:7/15,engravingSharpness:.59,engravingWave:.2,engravingWaveFrequency:2/9,crosshatch:0,crosshatchSpacing:7/25,crosshatchThickness:.25,crosshatchAngle:.25,crosshatchContrast:1/3,crosshatchEdges:.5,crosshatchLineWeight:0,crosshatchWave:.33,crosshatchWaveFrequency:2/9,kuwahara:0,kuwaharaRadius:1/7,kuwaharaSharpness:5/16,kuwaharaSaturation:.5};var zr=Vl,ru=zl,iu=ql,ou=$l,No=jl,Lo=Kl,Ql={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},Zl={vignette:.18};function Ee(e,t,n={},r={},i={},o=1){return{id:e,label:t,intensity:o,adjust:{...Ro,...n},details:{...ko,...r},effects:{...Mo,...i}}}var Do=[Ee("neutral","Neutral"),Ee("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),Ee("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),Ee("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),Ee("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),Ee("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),Ee("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),Ee("vintage-wash","Vintage Wash",Ql,Zl),Ee("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),Ee("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),Ee("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),Ee("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),Ee("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),Ee("creator-camcorder","Creator Camcorder",{contrast:.08,highlights:-.05,shadows:.02,whites:.03,blacks:-.04,temperature:-.03,tint:-.015,vibrance:-.03,saturation:-.06},{vignette:.06,grain:.08,grainSize:.18,grainRoughness:.58},{chromaBleed:.55},.72),Ee("vhs-playback","VHS Playback",{contrast:-.04,saturation:-.08},{grain:.16,grainSize:.12,grainRoughness:.72},{tapeDamage:.82,tapeTracking:.85,tapeNoise:.3,tapeSpeed:.5,chromaBleed:.5,chromaticAberration:.18,scanlines:.35,scanlineCount:.17,scanlineSoftness:1,digitalGlitch:.32,digitalGlitchLineTear:.08,digitalGlitchSpeed:.5}),Ee("home-movie-8mm","8mm Home Movie",Ql,{...Zl,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),Ee("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),Ee("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],th=new Map(Do.map(e=>[e.id,e])),nh=/^\$(?:\{([A-Za-z0-9_.:-]+)\}|([A-Za-z0-9_.:-]+))$/,rh={exposure:{min:-2,max:2},contrast:{min:-1,max:1},highlights:{min:-1,max:1},shadows:{min:-1,max:1},whites:{min:-1,max:1},blacks:{min:-1,max:1},temperature:{min:-1,max:1},tint:{min:-1,max:1},vibrance:{min:-1,max:1},saturation:{min:-1,max:1}},qt={hue:0,amount:0,level:0},eu={amount:me.unit,level:me.signedUnit},ft=[[0,0],[1,1]],$t=[],ih={hueVsHue:me.secondaryHueShift,hueVsSaturation:me.signedUnit,hueVsLuma:me.signedUnit},_o={center:0,range:180,softness:0},To={min:0,max:1,softness:.05},oh={vignette:me.unit,vignetteMidpoint:me.unit,vignetteRoundness:me.signedUnit,vignetteFeather:me.unit,grain:me.unit,grainSize:me.unit,grainRoughness:me.unit},Fo=me.unit,ah=me.effects,au=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"];var sh=Do.filter(e=>au.some(t=>e.effects[t]>1e-4)),oS=Do.filter(e=>!sh.includes(e)),aS={blur:{blur:.45},pixelate:{pixelate:.55},bloom:{bloom:.55,bloomRadius:8},chromaBleed:{chromaBleed:.55},tapeDamage:{tapeDamage:.65,tapeTracking:.55,tapeNoise:.25,tapeSpeed:.5},filmArtifacts:{filmArtifacts:.55},scanlines:{scanlines:.35,scanlineCount:.17,scanlineSoftness:1},chromaticAberration:{chromaticAberration:.15,chromaticAngle:0},crtCurvature:{crtCurvature:.2},digitalGlitch:{digitalGlitch:.55,digitalGlitchColorSplit:.25,digitalGlitchLineTear:.25,digitalGlitchPixelate:.15,digitalGlitchBlockAmount:.5,digitalGlitchBlockDisplacement:.25,digitalGlitchBlockOpacity:0,digitalGlitchSpeed:.5},halftone:{halftone:.94,halftoneSize:.36},twoInkPrint:{twoInkPrint:1,twoInkPrintSize:.42},ascii:{ascii:1,asciiSize:5/76,asciiInvert:0,asciiStyle:0,asciiColor:1,asciiRotation:0},dither:{dither:1,ditherSize:.5},monoScreen:{monoScreen:1,monoScreenSize:.35,monoScreenAngle:.25,monoScreenSpread:.3,monoScreenShape:0,monoScreenInvert:0},engraving:{engraving:1,engravingSpacing:7/17,engravingMinThickness:.2,engravingMaxThickness:3.2/7,engravingAngle:.25,engravingContrast:7/15,engravingSharpness:.59,engravingWave:.2,engravingWaveFrequency:2/9},crosshatch:{crosshatch:1,crosshatchSpacing:7/25,crosshatchThickness:.25,crosshatchAngle:.25,crosshatchContrast:1/3,crosshatchEdges:.5,crosshatchLineWeight:0,crosshatchWave:.33,crosshatchWaveFrequency:2/9},kuwahara:{kuwahara:1,kuwaharaRadius:1/7,kuwaharaSharpness:5/16,kuwaharaSaturation:.5}},su=[{path:"intensity",name:"--hf-color-grading-intensity",min:0,max:1},{path:"lut.intensity",name:"--hf-color-grading-lut-intensity",min:0,max:1},{path:"adjust.exposure",name:"--hf-color-grading-exposure",min:-2,max:2},{path:"effects.blur",name:"--hf-color-grading-blur",min:0,max:1},{path:"effects.bloom",name:"--hf-color-grading-bloom",min:0,max:3},{path:"effects.kuwahara",name:"--hf-color-grading-kuwahara",min:0,max:1},{path:"effects.pixelate",name:"--hf-color-grading-pixelate",min:0,max:1},{path:"effects.ascii",name:"--hf-color-grading-ascii",min:0,max:1},{path:"effects.dither",name:"--hf-color-grading-dither",min:0,max:1}];var lh=/^#[0-9a-f]{6}$/i;function uh(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&lh.test(t))?null:e.map(t=>t.toLowerCase())}function _e(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Wr(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function lu(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function Te(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Wr(n,t.min,t.max):0}function Io(e,t=0){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?(n%360+360)%360:t}function ch(e){let t=_e(e)?e:{};return ru.reduce((n,r)=>{let i=_e(t[r])?t[r]:{};return n[r]={hue:Io(i.hue,qt.hue),amount:Te(i.amount??qt.amount,eu.amount),level:Te(i.level??qt.level,eu.level)},n},{shadows:{...qt},midtones:{...qt},highlights:{...qt}})}function dh(e){if(!Array.isArray(e)||e.length!==2)return null;let t=Number(e[0]),n=Number(e[1]);return Number.isFinite(t)&&Number.isFinite(n)?[Wr(t,0,1),Wr(n,0,1)]:null}function uu(e){return e.some((t,n)=>n>0&&t[0]===e[n-1]?.[0])}function fh(e){(e[0]?.[0]??0)>0&&e.unshift([0,0]),(e.at(-1)?.[0]??1)<1&&e.push([1,1])}function mh(e){if(!Array.isArray(e)||e.length<2)return ft;let t=[];for(let n of e){let r=dh(n);if(!r)return ft;t.push(r)}return t.sort((n,r)=>n[0]-r[0]),uu(t)||(fh(t),t.length>16)?ft:t}function ph(e){let t=_e(e)?e:{};return iu.reduce((n,r)=>(n[r]=mh(t[r]),n),{master:ft,red:ft,green:ft,blue:ft})}function hh(e,t){if(!Array.isArray(e)||e.length!==2)return null;let n=Number(e[0]),r=Number(e[1]);return Number.isFinite(n)&&Number.isFinite(r)?[Io(n),Wr(r,t.min,t.max)]:null}function gh(e,t){if(!Array.isArray(e)||e.length<3||e.length>16)return $t;let n=[];for(let r of e){let i=hh(r,t);if(!i)return $t;n.push(i)}return n.sort((r,i)=>r[0]-i[0]),uu(n)?$t:n}function bh(e){let t=_e(e)?e:{};return ou.reduce((n,r)=>(n[r]=gh(t[r],ih[r]),n),{hueVsHue:$t,hueVsSaturation:$t,hueVsLuma:$t})}function tu(e){let t=_e(e)?e:{},n=Te(t.min??To.min,Fo),r=Te(t.max??To.max,Fo);return{min:Math.min(n,r),max:Math.max(n,r),softness:Te(t.softness??To.softness,me.secondarySoftRangeSoftness)}}function xh(e){let t=_e(e)?e:{},n=Te(t.range??_o.range,me.secondaryHueRange);return{center:Io(t.center,_o.center),range:n,softness:Te(t.softness??_o.softness,{min:me.secondaryHueSoftness.min,max:me.secondaryHueCombinedMax-n})}}function yh(e){return{hueShift:Te(e.hueShift??0,me.secondaryHueShift),saturation:Te(e.saturation??0,me.signedUnit),luma:Te(e.luma??0,me.signedUnit),temperature:Te(e.temperature??0,me.signedUnit),tint:Te(e.tint??0,me.signedUnit)}}function vh(e){return!_e(e)||!_e(e.key)||!_e(e.correction)?null:{enabled:e.enabled!==!1,key:{hue:xh(e.key.hue),saturation:tu(e.key.saturation),luma:tu(e.key.luma)},correction:yh(e.correction)}}function Sh(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,4)){let r=vh(n);r&&t.push(r)}return t}function Ah(e){if(e==null)return null;let t=String(e).trim();return t||null}function Eh(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!_e(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:lu(e.intensity,1)}}function wh(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return _e(n)?n:null}catch{return null}return{preset:t}}return _e(e)?e:null}function Ch(e,t){let n=e.trim().match(nh);if(!n)return e;let r=n[1]??n[2]??"";return r&&Object.hasOwn(t,r)?t[r]:e}function Ur(e,t){if(typeof e=="string"){let r=Ch(e,t);if(r!==e)return r;let i=e.trim();if(!i.startsWith("{"))return e;try{return Ur(JSON.parse(i),t)}catch{return e}}if(Array.isArray(e))return e.map(r=>Ur(r,t));if(!_e(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=Ur(i,t);return n}function _h(e){return e?th.get(e)??null:null}function qr(e){let t=wh(e);if(!t||t.enabled===!1)return null;let n=Ah(t.preset),r=_h(n),i=r?.adjust??Ro,o=r?.details??ko,a=r?.effects??Mo,l=_e(t.adjust)?t.adjust:{},s=_e(t.details)?t.details:{},u=_e(t.effects)?t.effects:{},c=zr.reduce((p,b)=>(p[b]=Te(l[b]??i[b],rh[b]),p),{...Ro}),m=No.reduce((p,b)=>(p[b]=Te(s[b]??o[b],oh[b]),p),{...ko}),f=Lo.reduce((p,b)=>(p[b]=Te(u[b]??a[b],ah[b]??Fo),p),{...Mo});return{enabled:!0,preset:n,intensity:lu(t.intensity,r?.intensity??1),adjust:c,wheels:ch(t.wheels),curves:ph(t.curves),hueCurves:bh(t.hueCurves),secondaries:Sh(t.secondaries),details:m,effects:f,palette:uh(t.palette),lut:Eh(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():eh}}function cu(e,t){return qr(Ur(e,t))}function Th(e){return ru.some(t=>Math.abs(e[t].amount)>1e-4||Math.abs(e[t].level)>1e-4)}function Po(e){return iu.some(t=>e[t].some(([n,r])=>Math.abs(n-r)>1e-4))}function Oo(e){return ou.some(t=>e[t].some(([,n])=>Math.abs(n)>1e-4))}function Ho(e){return e.some(t=>t.enabled&&Object.values(t.correction).some(n=>Math.abs(n)>1e-4))}function du(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||au.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:zr.some(n=>Math.abs(e.adjust[n])>1e-4)||(e.wheels?Th(e.wheels):!1)||(e.curves?Po(e.curves):!1)||(e.hueCurves?Oo(e.hueCurves):!1)||(e.secondaries?Ho(e.secondaries):!1):!1}var Rh=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),kh=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function fu(e){let t=!1,n=null,r=null,i=null,o=null;function a(S,A){try{window.dispatchEvent(new CustomEvent(S,{detail:A}))}catch(C){L("runtime.picker.site1",C)}}function l(S){i=S,a("hyperframe:picker:hovered",{elementInfo:i,isPickMode:t,timestamp:Date.now()})}function s(S){o=S,a("hyperframe:picker:selected",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function u(S){let A=S.ownerDocument.defaultView;if(!A)return!1;let C=S;for(;C&&C!==document.body&&C!==document.documentElement;){let N=A.getComputedStyle(C);if(N.display==="none"||N.visibility==="hidden"||N.pointerEvents==="none")return!0;let I=Number.parseFloat(N.opacity);if(Number.isFinite(I)&&I<=.01&&!C.hasAttribute(Nn))return!0;C=C.parentElement}return!1}function c(S){if(!S||S===document.body||S===document.documentElement)return!1;let A=S.tagName.toLowerCase();return!(A==="script"||A==="style"||A==="link"||A==="meta"||S.classList.contains("__hf-pick-highlight")||S.closest(Rh)||u(S))}function m(S){return!!S?.closest(kh)}function f(S){let A=S;if(A.id)return`#${CSS.escape(A.id)}`;let C=S.getAttribute("data-composition-id");if(C)return`[data-composition-id="${CSS.escape(C)}"]`;let N=S.getAttribute("data-composition-src");if(N)return`[data-composition-src="${CSS.escape(N)}"]`;let I=S.getAttribute("data-track-index");if(I)return`[data-track-index="${CSS.escape(I)}"]`;let W=S.tagName.toLowerCase(),B=S.parentElement;if(!B)return W;let oe=B.querySelectorAll(`:scope > ${W}`);if(oe.length===1)return W;for(let k=0;k<oe.length;k+=1)if(oe[k]===S)return`${W}:nth-of-type(${k+1})`;return W}function p(S){let A=S.tagName.toLowerCase(),C=(S.textContent??"").trim().replace(/\s+/g," "),N=(I,W)=>I.length>W?`${I.slice(0,W-1)}\u2026`:I;return A==="h1"||A==="h2"||A==="h3"?"Heading":A==="p"||A==="span"||A==="div"?C.length>0?N(C,56):"Text":A==="img"?"Image":A==="video"?"Video":A==="audio"?"Audio":A==="svg"?"Shape":S.getAttribute("data-composition-src")?"Composition":A==="section"?"Section":`${A.charAt(0).toUpperCase()}${A.slice(1)}`}function b(S,A,C){let N=typeof C=="number"&&C>0?C:8,I=[];if(document.elementsFromPoint)I=document.elementsFromPoint(S,A);else if(document.elementFromPoint){let oe=document.elementFromPoint(S,A);I=oe?[oe]:[]}if(m(I[0]??null))return[];let W={},B=[];for(let[oe,k]of I.entries()){if(!c(k))continue;let V=`${k.tagName}::${k.id||""}::${oe}`;if(!W[V]&&(W[V]=!0,B.push(k),B.length>=N))break}return B}function v(S){let A=S.getBoundingClientRect(),C={};for(let I of Array.from(S.attributes))I.name.startsWith("data-")&&(C[I.name]=I.value);return{id:S.id||null,tagName:S.tagName.toLowerCase(),selector:f(S),label:p(S),boundingBox:{x:A.left,y:A.top,width:A.width,height:A.height},textContent:S.textContent?S.textContent.trim().slice(0,200):null,src:S.getAttribute("src")||S.getAttribute("data-composition-src")||null,dataAttributes:C}}function x(S,A,C){return b(S,A,C).map(v)}function _(S){if(!t)return;let C=b(S.clientX,S.clientY,1)[0]??(S.target instanceof Element?S.target:null);if(!c(C)||n===C)return;n&&n.classList.remove("__hf-pick-highlight"),n=C,C.classList.add("__hf-pick-highlight");let N=v(C);l(N),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:N})}function R(S){if(!t)return;S.preventDefault(),S.stopPropagation(),S.stopImmediatePropagation();let A=x(S.clientX,S.clientY,8);A.length!==0&&(l(A[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:A,selectedIndex:0,point:{x:S.clientX,y:S.clientY}}))}function T(S){S.key==="Escape"&&(F(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function M(){t||(t=!0,r=document.createElement("style"),r.textContent=[".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",".__hf-pick-active * { cursor: crosshair !important; }"].join(`
40
+ `),document.head.appendChild(r),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",_,!0),document.addEventListener("click",R,!0),document.addEventListener("keydown",T,!0),a("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function F(){t&&(t=!1,n&&(n.classList.remove("__hf-pick-highlight"),n=null),r&&(r.remove(),r=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",_,!0),document.removeEventListener("click",R,!0),document.removeEventListener("keydown",T,!0),a("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function E(){window.__HF_PICKER_API={enable:M,disable:F,isActive:()=>t,getHovered:()=>i,getSelected:()=>o,getCandidatesAtPoint:(S,A,C)=>Number.isFinite(S)&&Number.isFinite(A)?x(S,A,C):[],pickAtPoint:(S,A,C)=>{if(!Number.isFinite(S)||!Number.isFinite(A))return null;let N=x(S,A,8);if(!N.length)return null;let I=Math.max(0,Math.min(N.length-1,Number(C??0))),W=N[I]??null;return W?(s(W),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:W}),F(),W):null},pickManyAtPoint:(S,A,C)=>{if(!Number.isFinite(S)||!Number.isFinite(A))return[];let N=x(S,A,8);if(!N.length)return[];let I=[],W=Array.isArray(C)?C:[0];for(let B of W){let oe=Math.max(0,Math.min(N.length-1,Math.floor(Number(B)))),k=N[oe];if(!k)continue;I.some(Q=>Q.selector===k.selector&&Q.tagName===k.tagName)||I.push(k)}return I.length?(s(I[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:I}),F(),I):[]}},a("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:M,disablePickMode:F,installPickerApi:E}}var Mh=["width","height","top","left","right","bottom","inset","object-fit","object-position","z-index","opacity","visibility","filter","mix-blend-mode","backdrop-filter","border-radius","overflow","clip-path","mask","mask-image","mask-size","mask-position","mask-repeat","transform","transform-origin","translate","rotate","scale","box-sizing"];function jt(e,t){let n=Number.isFinite(t)&&t>0?t:30,r=Number.isFinite(e)&&e>0?e:0;return Math.floor(r*n+1e-9)/n}function mu(e,t,n=Mh){for(let r of n){let i=t.getPropertyValue(r);i&&e.setProperty(r,i)}}function Ln(e,t,n){let r=e?.[t];return typeof r=="function"?Number(r.call(e))||n:typeof r=="number"&&Number.isFinite(r)?r:(r!=null&&L("runtime.player.nonConformantNum",{prop:t,actual:typeof r}),n)}function Be(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&L("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function Dn(e,t,n){if(e){for(let r of Object.values(e))if(!(!r||r===t))try{n(r)}catch(i){L("runtime.player.site1",i)}}}function pu(e,t,n,r){let i=jt(t,n),o=r?.suppressEvents===!0;return Be(e,"pause"),typeof e.totalTime=="function"?e.totalTime(i,o):typeof e.seek=="function"&&e.seek(i,o),i}function Fh(e,t,n,r,i){let o=[];Dn(e,t,a=>{Be(a,"play"),o.push(a)});try{return pu(t,n,r,i)}finally{for(let a of o)try{Be(a,"pause")}catch(l){L("runtime.player.site2",l)}}}function Nh(e,t){Dn(e,t,n=>{Be(n,"play")})}function hu(e){let t=e.transport;return t?{_timeline:null,play:()=>t.play(),pause:()=>t.pause(),seek:(n,r)=>t.seek(n,r),renderSeek:(n,r)=>t.renderSeek(n,r),getTime:()=>t.getTime(),getDuration:()=>t.getDuration(),isPlaying:()=>t.isPlaying(),setPlaybackRate:n=>t.setPlaybackRate(n),getPlaybackRate:()=>t.getPlaybackRate()}:{_timeline:null,play:()=>{let n=e.getTimeline();if(!n||e.getIsPlaying())return;let r=Math.max(0,Number(e.getSafeDuration?.()??Ln(n,"duration",0))||0);r>0&&Math.max(0,Ln(n,"time",0))>=r&&(Be(n,"pause"),typeof n.seek=="function"&&n.seek(0,!1),e.onDeterministicSeek(0),e.setIsPlaying(!1),e.onSyncMedia(0,!1),e.onRenderFrameSeek(0)),typeof n.timeScale=="function"&&n.timeScale(e.getPlaybackRate()),Be(n,"play"),Dn(e.getTimelineRegistry?.(),n,i=>{typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),Be(i,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;Be(n,"pause"),Dn(e.getTimelineRegistry?.(),n,i=>{Be(i,"pause")});let r=Math.max(0,Ln(n,"time",0));e.onDeterministicSeek(r),e.onDeterministicPause(),e.setIsPlaying(!1),e.onSyncMedia(r,!1),e.onRenderFrameSeek(r),e.onStatePost(!0)},seek:(n,r)=>{let i=e.getTimeline();if(!i)return;let o=Math.max(0,Number(n)||0),a=e.getIsPlaying(),l=Fh(e.getTimelineRegistry?.(),i,o,e.getCanonicalFps());e.onDeterministicSeek(l),r?.keepPlaying&&a?(typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),Be(i,"play"),Dn(e.getTimelineRegistry?.(),i,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),Be(s,"play")}),e.onDeterministicPlay(),e.onShowNativeVideos(),e.onSyncMedia(l,!0)):(e.setIsPlaying(!1),e.onSyncMedia(l,!1)),e.onRenderFrameSeek(l),e.onStatePost(!0)},renderSeek:(n,r)=>{let i=e.getTimeline(),o=e.getCanonicalFps(),a=i?(Nh(e.getTimelineRegistry?.(),i),pu(i,n,o,r)):jt(Math.max(0,Number(n)||0),o);e.onDeterministicSeek(a,r),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>Ln(e.getTimeline(),"time",0),getDuration:()=>Ln(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function gu(){return{capturedTimeline:null,isPlaying:!1,currentTime:0,deterministicAdapters:[],canonicalFps:30,bridgeMuted:!1,bridgeVolume:1,mediaOutputMuted:!1,nativeMediaSyncDisabled:!1,webAudioMediaDisabled:!1,mediaAutoplayBlockedPosted:!1,mediaForceSyncNextTick:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,controlBridgeHandler:null,beforeUnloadHandler:null,injectedCompStyles:[],injectedCompScripts:[],injectedCompLinks:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,transportClock:null,transportRafId:null}}var Lh=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function Go(e){return e.id||e.getAttribute("data-hf-id")||null}function Dh(e){return ve(e)}function Ih(e,t){let n=e.getAttribute("data-composition-id");if(!n)return null;let r=Number(t[n]?.duration?.());return Number.isFinite(r)&&r>0?r:null}function Ph(e){return!(e instanceof HTMLMediaElement)||!Number.isFinite(e.duration)?null:Ze(e,e.duration)}function Oh(e,t,n,r){let i=Dh(e.getAttribute("data-duration"));return i!=null&&i>0?i:Ih(e,t)??Ph(e)??Math.max(0,n-r)}function Hh(e){for(let[t,n]of e){let r=t.parentElement;for(;r;){let i=e.get(r);if(i){n.parentId=i.id,i.children.push(n);break}r=r.parentElement}}}function bu(e){let{startResolver:t,timelineRegistry:n,rootDuration:r}=e,i=new Map,o=document.querySelector("[data-composition-id]"),a=0;for(let l of document.querySelectorAll("[data-start]")){if(l===o||Lh.has(l.tagName))continue;let s=t.resolveStartForElement(l,0);if(Oh(l,n,r,s)<=0)continue;let u={id:Go(l)??`__clip-${a++}`,element:l,parentId:null,children:[]};i.set(l,u)}return Hh(i),{roots:Array.from(i.values()).filter(l=>l.parentId===null)}}function In(e){if(e==null||typeof e=="string"&&e.trim()==="")return null;let t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null}function Kt(e){let t=In(e.start);if(t==null)return null;let n=Math.max(0,t),r=In(e.duration),i=In(e.authoredDuration),o=r!=null&&r>0?r:i!=null&&i>0?i:null;if(o!=null)return{start:n,duration:o,end:n+o};let a=In(e.end),l=In(e.authoredEnd),s=a!=null&&a>n?a:l!=null&&l>n?l:null;return{start:n,duration:s==null?null:s-n,end:s}}var Bo="css:root",xu=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],Gh=new Set([...xu,"contain","isolation","mask-border","mix-blend-mode","opacity"]),Bh=new Set(["absolute","relative"]),Uh=new Set(["flex","inline-flex","grid","inline-grid"]),Wh=new Set(["layout","paint","strict","content"]),Vh=new Set(["size","inline-size"]);function zh(e){return e.position==="fixed"||e.position==="sticky"}function qh(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(Bh.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&Uh.has(n)}function $h(e){let t=Number.parseFloat(e.opacity);if(Number.isFinite(t)&&t<1||e.getPropertyValue("isolation")==="isolate")return!0;let n=e.getPropertyValue("mix-blend-mode");return n&&n!=="normal"?!0:xu.some(r=>{let i=e.getPropertyValue(r);return i!==""&&i!=="none"})}function jh(e){return e.getPropertyValue("contain").split(/\s+/).some(n=>Wh.has(n))?!0:Vh.has(e.getPropertyValue("container-type"))}function Kh(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>Gh.has(t))}function Yh(e,t){return zh(t)||qh(e,t)||$h(t)||jh(t)?!0:Kh(t)}function Xh(e){let t=[],n=e;for(;n?.parentElement;)t.push(Array.prototype.indexOf.call(n.parentElement.children,n)),n=n.parentElement;return`css:${t.reverse().join(".")}`}function $r(e){let t=e.ownerDocument.defaultView;if(!t)return Bo;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(Yh(n,t.getComputedStyle(n)))return Xh(n)}catch{return Bo}n=n.parentElement}return Bo}function mt(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,i=new WeakMap,o=new WeakMap,a=new Set,l=f=>{let p=r.getElementById(f);return p||(r.querySelector(`[data-composition-id="${CSS.escape(f)}"]`)??null)},s=f=>{let p=f.ownerDocument.defaultView?.HTMLMediaElement;return p?f instanceof p:typeof HTMLMediaElement<"u"&&f instanceof HTMLMediaElement},u=f=>{let p=o.get(f);if(p!==void 0)return p;let b=null,v=Kt({start:0,duration:f.getAttribute("data-duration"),authoredDuration:n?f.getAttribute("data-hf-authored-duration"):null});if(v?.duration!=null&&v.duration>0&&(b=v.duration),b==null||b<=0){let x=m(f,0),_=Kt({start:x,end:f.getAttribute("data-end"),authoredEnd:n?f.getAttribute("data-hf-authored-end"):null});_?.duration!=null&&_.duration>0&&(b=_.duration)}if((b==null||b<=0)&&s(f)){let x=yn(f);Number.isFinite(f.duration)&&f.duration>x&&(b=(f.duration-x)/Ce(f))}if(b==null||b<=0){let x=f.getAttribute("data-composition-id");if(x){let _=t[x]??null;if(_&&typeof _.duration=="function")try{let R=Number(_.duration());Number.isFinite(R)&&R>0&&(b=R)}catch(R){L("runtime.startResolver.site1",R)}}}return b!=null&&Number.isFinite(b)&&b>0?(o.set(f,b),b):(o.set(f,null),null)},c=(f,p)=>{if(f.hasAttribute("data-composition-id")){let v=f.parentElement?.closest("[data-composition-id]");return v?m(v,p):0}let b=f.closest("[data-composition-id]");return b?m(b,p):0},m=(f,p)=>{let b=i.get(f);if(b!==void 0)return b??p;if(a.has(f))return p;a.add(f);try{let v=so(f.getAttribute("data-start"));if(!v){if(f.hasAttribute("data-composition-id")){let M=f.parentElement;if(M&&(M.hasAttribute("data-composition-src")||M.hasAttribute("data-composition-id")||M.hasAttribute("data-composition-file"))){let F=m(M,p);return i.set(f,F),F}}return i.set(f,p),p}if(v.kind==="absolute"){let M=Math.max(0,v.value),F=Math.max(0,c(f,p)+M);return i.set(f,F),F}let x=l(v.refId);if(!x)return i.set(f,p),p;let _=m(x,0),R=u(x);if(R==null||R<=0){let M=Math.max(0,_+v.offset);return i.set(f,M),M}let T=Math.max(0,_+R+v.offset);return i.set(f,T),T}finally{a.delete(f)}};return{resolveStartForElement:(f,p=0)=>m(f,Math.max(0,p)),resolveDurationForElement:f=>u(f)}}function Uo(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}function pt(e){return ve(e)}function Wo(e){let t=e.getAttribute("data-duration"),n=e.getAttribute("data-hf-authored-duration"),r=Kt({start:0,duration:t,authoredDuration:n})?.duration;return r??([t,n].map(pt).some(o=>o!=null&&o<=0)?0:null)}function yu(e){return Kt({start:0,end:e.getAttribute("data-end"),authoredEnd:e.getAttribute("data-hf-authored-end")})?.end??null}function Vo(e){try{let t=e.style?.zIndex;if(t&&t!=="auto"){let n=parseInt(t,10);if(Number.isFinite(n))return n}return 0}catch{return 0}}function zo(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function qo(e,t){let n=e.getAttribute("data-track-index")??e.getAttribute("data-track");if(n==null)return t;let r=Number.parseInt(n,10);return Number.isFinite(r)?r:t}function On(e){let t=String(e??"").trim();if(!t)return null;let n=t.toLowerCase();if(n.startsWith("data:")||n.startsWith("javascript:"))return null;try{return new URL(t,document.baseURI).toString()}catch{return t}}function vu(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return On(t);let n=e.getAttribute("data-composition-src");if(n)return On(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?On(r.getAttribute("src")):null}function Qh(e){let t=e.className;return typeof t!="string"?null:t.split(/\s+/).map(n=>n.trim()).find(n=>n&&n!=="clip"&&!n.startsWith("__hf-"))??null}function Zh(e){if(!e)return null;try{return new URL(e,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return e.split(/[\\/]/).filter(Boolean).at(-1)??null}}function e0(e){let t=e.textContent?.replace(/\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function Pn(e){let t=e.replace(/\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return t?t.replace(/\b\w/g,n=>n.toUpperCase()):e}function t0(e,t,n){let r=e.getAttribute("data-timeline-label")??e.getAttribute("data-label")??e.getAttribute("aria-label")??null;if(r?.trim())return r.trim();let i=e.getAttribute("data-composition-id");if(i)return Pn(i);let o=e.id;if(o)return Pn(o);let a=Qh(e);if(a)return Pn(a);let l=Zh(vu(e));if(l)return Pn(l);let s=e0(e);return s||`${Pn(t)} ${n+1}`}function Su(e){let n=window.__timelines??{},r=mt({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),i=q=>{if(!q)return null;let P=n[q]??null;if(!P||typeof P.duration!="function")return null;try{let O=Number(P.duration());return Number.isFinite(O)&&O>0?O:null}catch{return null}},o=q=>{let P=pt(q.getAttribute("data-duration"));return P!=null&&P>0?P:Number.isFinite(q.duration)?Ze(q,q.duration):null},a=()=>{let q=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(q.length===0)return null;let P=0;for(let O of q){let j=O.hasAttribute("data-hf-auto-start")?r.resolveStartForElement(O,0):Math.max(0,Number(O.getAttribute("data-start")??0)||0);if(!Number.isFinite(j))continue;let le=o(O);le==null||le<=0||(P=Math.max(P,Math.max(0,j)+le))}return P>0?P:null},l=(q,P)=>{let O=[],j=null,le=null,ee=null,K=q.parentElement;for(;K;){let Y=K.getAttribute("data-composition-id");Y&&(O.push(Y),!ee&&K!==P&&(ee=Y),j==null&&(j=r.resolveStartForElement(K,0)),le==null&&(le=pt(K.getAttribute("data-duration"))??i(Y)??null)),K=K.parentElement}return{parentCompositionId:ee,compositionAncestors:O.reverse(),inheritedStart:j,inheritedDuration:le}},s=document.querySelector("[data-composition-id]"),u=Array.from(document.querySelectorAll("[data-composition-id]")),c=s?.getAttribute("data-composition-id")??null,m=s?r.resolveStartForElement(s,0):0,f=a(),p=f!=null?Math.max(0,f-Math.max(0,m)):null,b=i(c),v=Wo(s??document.body),x=zo(...u.filter(q=>q!==s).map(q=>{let P=r.resolveStartForElement(q,0),O=r.resolveDurationForElement(q)??i(q.getAttribute("data-composition-id"))??null;return!Number.isFinite(P)||O==null||O<=0?null:Math.max(0,P)+O})),_=x!=null?Math.max(0,x-Math.max(0,m)):null,R=typeof b=="number"&&Number.isFinite(b)&&b>0?b:null,T=typeof v=="number"&&Number.isFinite(v)&&v>0?v:null,M=typeof p=="number"&&Number.isFinite(p)&&p>0?p:null,F=typeof _=="number"&&Number.isFinite(_)&&_>0?_:null,E=zo(M,F),S=R!=null&&E!=null&&R>E+1,C=T??(S?E:zo(R,M,F))??null,I=(C!=null?m+C:null)??(typeof f=="number"&&Number.isFinite(f)&&f>0?f:null),W=(q,P)=>!Number.isFinite(P)||P<=0?0:I==null||!Number.isFinite(I)?P:!Number.isFinite(q)||q>=I?0:Math.max(0,Math.min(P,I-q)),B=[],oe=[],k=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),V=0;for(let[q,P]of k.entries()){if(P===s||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(P.tagName))continue;let O=l(P,s),j=r.resolveStartForElement(P,O.inheritedStart??0),le=P.getAttribute("data-composition-id"),ee=Wo(P);if(ee==null&&le&&le!==c&&(ee=i(le)),ee==null&&P instanceof HTMLMediaElement&&Number.isFinite(P.duration)&&(ee=Ze(P,P.duration)),ee==null){let Fe=O.inheritedDuration;if(Fe!=null&&Fe>0){let ze=(O.inheritedStart??0)+Fe;ee=Math.max(0,ze-j)}}if(ee==null||ee<=0||(ee=W(j,ee),ee<=0))continue;let K=j+ee;V=Math.max(V,K);let Y=P.tagName.toLowerCase(),Ve=le&&le!==c?"composition":Y==="video"?"video":Y==="audio"?"audio":Y==="img"?"image":"element";B.push({id:Go(P)??le??null,label:t0(P,Ve,B.length),start:j,duration:ee,track:qo(P,q),zIndex:Vo(P),stackingContextId:$r(P),kind:Ve,tagName:Y,compositionId:P.getAttribute("data-composition-id"),compositionAncestors:O.compositionAncestors,parentCompositionId:O.parentCompositionId,nodePath:null,compositionSrc:On(P.getAttribute("data-composition-src")),playbackStart:je(P),playbackRate:Ce(P),assetUrl:vu(P),timelineRole:P.getAttribute("data-timeline-role"),timelineLabel:P.getAttribute("data-timeline-label"),timelineGroup:P.getAttribute("data-timeline-group"),timelinePriority:pt(P.getAttribute("data-timeline-priority"))})}let Q=new Set(B.map(q=>q.id)),G=s?.getAttribute("data-composition-id")??null,H=G?n[G]??null:null;if(H&&s){let q=H;if(typeof q.getChildren=="function")try{let P=q.getChildren(!0,!0,!1)??[],O=new Map;for(let ee of s.children){let K=ee;if(!K.id)continue;let Y=K.tagName.toLowerCase();Y==="script"||Y==="style"||Y==="link"||O.set(K,{id:K.id,start:1/0,end:-1/0})}let j=ee=>{let K=ee;for(;K;){if(O.has(K))return K;if(K===s)return null;K=K.parentElement}return null};for(let ee of P){if(typeof ee.targets!="function"||typeof ee.startTime!="function"||typeof ee.duration!="function")continue;let K=ee.startTime(),Y=ee.parent;for(;Y&&Y!==H&&typeof Y.startTime=="function";)K+=Y.startTime(),Y=Y.parent;let Ve=K+ee.duration();if(!(!Number.isFinite(K)||!Number.isFinite(Ve)))for(let Fe of ee.targets()){if(!(Fe instanceof Element))continue;let Re=j(Fe);if(!Re)continue;let ze=O.get(Re);ze&&(ze.start=Math.min(ze.start,K),ze.end=Math.max(ze.end,Ve))}}let le=B.length>0?Math.max(...B.map(ee=>ee.track))+1:0;for(let[ee,K]of O){if(K.start===1/0||K.end===-1/0)continue;let Y=ee;if(Q.has(Y.id))continue;let Ve=Math.max(0,K.end-K.start);if(Ve<=0)continue;let Fe=W(K.start,Ve);Fe<=0||(V=Math.max(V,K.start+Fe),B.push({id:Y.id,label:Y.getAttribute("data-timeline-label")??Y.getAttribute("data-label")??Y.getAttribute("aria-label")??Y.id,start:K.start,duration:Fe,track:qo(Y,le),zIndex:Vo(Y),stackingContextId:$r(Y),kind:"element",tagName:Y.tagName.toLowerCase(),compositionId:Y.getAttribute("data-composition-id"),compositionAncestors:G?[G]:[],parentCompositionId:G,nodePath:null,compositionSrc:null,playbackStart:je(Y),playbackRate:Ce(Y),assetUrl:null,timelineRole:Y.getAttribute("data-timeline-role"),timelineLabel:Y.getAttribute("data-timeline-label"),timelineGroup:Y.getAttribute("data-timeline-group"),timelinePriority:pt(Y.getAttribute("data-timeline-priority"))}),Q.add(Y.id))}}catch(P){L("runtime.timeline.site1",P)}}if(s&&C!=null&&C>0){let q=B.length>0?Math.max(...B.map(P=>P.track))+1:0;for(let P of s.children){let O=P;if(!O.id||Q.has(O.id))continue;let j=O.getAttribute("data-timeline-role");if(j!=="overlay"&&j!=="persistent-overlay")continue;let le=O.tagName.toLowerCase();if(le==="script"||le==="style"||le==="link"||le==="meta"||window.getComputedStyle(O).display==="none")continue;let K=W(0,C);K<=0||(V=Math.max(V,K),B.push({id:O.id,label:O.getAttribute("data-timeline-label")??O.getAttribute("data-label")??O.getAttribute("aria-label")??O.id,start:0,duration:K,track:qo(O,q),zIndex:Vo(O),stackingContextId:$r(O),kind:"element",tagName:le,compositionId:O.getAttribute("data-composition-id"),compositionAncestors:G?[G]:[],parentCompositionId:G,nodePath:null,compositionSrc:null,playbackStart:je(O),playbackRate:Ce(O),assetUrl:null,timelineRole:j,timelineLabel:O.getAttribute("data-timeline-label"),timelineGroup:O.getAttribute("data-timeline-group"),timelinePriority:pt(O.getAttribute("data-timeline-priority"))}),Q.add(O.id))}}for(let q of u){if(q===s)continue;let P=q.getAttribute("data-composition-id");if(!P||!Uo(P))continue;let O=r.resolveStartForElement(q,0),j=Wo(q);if((j==null||j<=0)&&yu(q)!=null){let Y=yu(q);j=Math.max(0,Y-O)}let le=i(P),ee=j&&j>0?j:le;if(ee==null||ee<=0)continue;let K=W(O,ee);K<=0||oe.push({id:P,label:q.getAttribute("data-label")??P,start:O,duration:K,thumbnailUrl:On(q.getAttribute("data-thumbnail-url")),avatarName:null})}let z=Math.max(1,V||1,C??0),X=S&&T==null,we=X?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(z*Math.max(1,e.canonicalFps)));return{...Er(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:X?Number.POSITIVE_INFINITY:z,durationInFrames:we,clips:B,scenes:oe,compositionWidth:pt(s?.getAttribute("data-width"))??1920,compositionHeight:pt(s?.getAttribute("data-height"))??1080}}var $o="data-composition-id",n0="data-composition-src",r0=`[${$o}]`,jS=`[${n0}]`,Au="style",Eu="script",i0='link[rel="stylesheet"], link[rel="preconnect"]';function Yt(e){return e?Array.from(e):[]}function wu(e){let{contentNode:t,head:n,documentElement:r,hasTemplate:i,compositionId:o}=e,a=Yt(t.querySelectorAll(r0)),l=o?a.find(c=>c.getAttribute($o)===o)??null:a[0]??null,s=(l??a[0])?.getAttribute($o)?.trim()||"",u=i?null:n??null;return{innerRoot:l,authoredCompositionId:o||s||null,scriptCompositionId:s||o||null,authoredRootId:l?.getAttribute("id")?.trim()||null,styleSources:[...Yt(u?.querySelectorAll(Au)),...Yt(t.querySelectorAll(Au))],scriptSources:[...Yt(u?.querySelectorAll(Eu)),...Yt(t.querySelectorAll(Eu))],linkSources:Yt(n?.querySelectorAll(i0)),variableDefaultCarriers:[r,l].filter(c=>c!=null)}}var pe=Um(Yc(),1),Xc=pe.default,PA=pe.default.stringify,OA=pe.default.fromJSON,HA=pe.default.plugin,GA=pe.default.parse,BA=pe.default.list,UA=pe.default.document,WA=pe.default.comment,VA=pe.default.atRule,zA=pe.default.rule,qA=pe.default.decl,$A=pe.default.root,jA=pe.default.CssSyntaxError,KA=pe.default.Declaration,YA=pe.default.Container,XA=pe.default.Processor,JA=pe.default.Document,QA=pe.default.Comment,ZA=pe.default.Warning,eE=pe.default.AtRule,tE=pe.default.Result,nE=pe.default.Input,rE=pe.default.Rule,iE=pe.default.Root,oE=pe.default.Node;var xa="data-hf-authored-id",Jc="data-hf-inner-root";function ya(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function va(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function _g(e){return e&&e.replace(/[^a-zA-Z0-9_-]/g,n=>`\\${n}`).replace(/^-?\d/,n=>`\\${n}`)}function Zc(e){let t=e.trim();return t?Array.from(new Set([t,_g(t)])).filter(Boolean):[]}function Tg(e){return!!e&&/[\w-]/.test(e)}function Rg(e,t,n){let r=Zc(t).sort((l,s)=>s.length-l.length);if(r.length===0)return e;let i="",o=0,a=null;for(let l=0;l<e.length;l+=1){let s=e[l],u=l>0?e[l-1]:"";if(a){i+=s,s===a&&u!=="\\"&&(a=null);continue}if(s==='"'||s==="'"){a=s,i+=s;continue}if(s==="["){o+=1,i+=s;continue}if(s==="]"){o=Math.max(0,o-1),i+=s;continue}if(s==="#"&&o===0){let c=r.find(m=>e.startsWith(m,l+1));if(c){let m=e[l+1+c.length];if(!Tg(m)){i+=n,l+=c.length;continue}}}i+=s}return i}function kg(e,t){let n=t?.trim();return n?Rg(e,n,`[${xa}="${va(n)}"]`):e}function Qc(e){return`${e}:not(:has([${Jc}])), ${e} > [${Jc}]`}function Mg(e,t,n,r,i,o){let a=kg(e,r),l=Fg(a,t,n),s=l.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return o?Qc(t):e;let u=new RegExp(`\\[\\s*data-composition-id\\s*=\\s*(["'])${ya(n)}\\1\\s*\\]`,"g");if(u.test(s))return s.replace(u,"").trim()===""?Qc(t):l.replace(u,t);let c=l.match(/^\s*/)?.[0]??"",m=l.match(/\s*$/)?.[0]??"";if(i){let f=r?`[${xa}="${va(r)}"]`:null;if(f&&s.startsWith(f)){let p=s.slice(f.length);return`${c}${t}${f}${p}${m}`}}return`${c}${t} ${s}${m}`}function Fg(e,t,n){let r=ya(n),i=String.raw`\[\s*data-composition-id\s*=\s*(?:"${r}"|'${r}')\s*\]`,o=String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`;return e.replace(new RegExp(`${i}(?:${o})+`,"g"),t).replace(new RegExp(`(?:${o})+${i}`,"g"),t)}var Ng=new Set(["keyframes","-webkit-keyframes","font-face"]);function Lg(e){return e?.type==="atrule"}function Dg(e){let t=e.parent;for(;t;){if(Lg(t)&&Ng.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function Ig(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function ed(e,t,n,r,i){let o=t.trim();if(!e||!o)return e;let a=n||`[data-composition-id="${va(o)}"]`,l=Xc.parse(e);return l.walkRules(s=>{Dg(s)||Ig(s)||(s.selectors=s.selectors.map(u=>Mg(u,a,o,r,i?.compoundAuthoredRoot,i?.scopeRootSelectors)))}),l.toResult({map:!1}).css}function rt(e){return JSON.stringify(e).replace(/</g,"\\u003c")}function td(e,t,n="[HyperFrames] composition script error:",r,i=t,o){let a=rt(t),l=rt(i),s=rt(n),u=ya(t),c=rt(o?.trim()||null),m=rt(r??null),f=rt(String.raw`\[\s*data-composition-id\s*=\s*(?:"${u}"|'${u}')\s*\]`),p=rt(String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`),b=rt(Zc(o?.trim()||""));return`(function(){
41
41
  var __hfCompId = ${a};
42
42
  var __hfTimelineCompId = ${l};
43
43
  var __hfErrorLabel = ${s};
@@ -365,7 +365,7 @@ ${e.replace(/<\/(script)/gi,"<\\/$1")}
365
365
  `),wb=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform vec2 u_resolution;","uniform vec2 u_direction;","uniform float u_radius;","uniform float u_bloomPass;","uniform float u_threshold;","vec4 readSource(vec2 uv){"," vec4 color = texture2D(u_source, clamp(uv, vec2(0.0), vec2(1.0)));"," if (u_bloomPass > 0.5) {"," float luminance = dot(color.rgb, vec3(0.299, 0.587, 0.114));"," if (u_threshold >= 0.0 && luminance <= u_threshold) color.rgb = vec3(0.0);"," return vec4(color.rgb, 1.0);"," }"," color.rgb *= color.a;"," return color;","}","void main(){"," if (u_bloomPass > 0.5) {"," vec2 stepUv = u_direction * max(u_radius, 0.0) / max(u_resolution, vec2(1.0)) * 0.5;"," vec4 bloom = readSource(v_uv) * 0.227027;"," bloom += readSource(v_uv + stepUv) * 0.1945946;"," bloom += readSource(v_uv - stepUv) * 0.1945946;"," bloom += readSource(v_uv + stepUv * 2.0) * 0.1216216;"," bloom += readSource(v_uv - stepUv * 2.0) * 0.1216216;"," bloom += readSource(v_uv + stepUv * 3.0) * 0.054054;"," bloom += readSource(v_uv - stepUv * 3.0) * 0.054054;"," bloom += readSource(v_uv + stepUv * 4.0) * 0.016216;"," bloom += readSource(v_uv - stepUv * 4.0) * 0.016216;"," gl_FragColor = bloom;"," return;"," }"," vec2 stepUv = u_direction * max(u_radius, 0.0) / max(u_resolution, vec2(1.0)) / 12.0;"," vec4 color = readSource(v_uv) * 0.08077993;"," color += readSource(v_uv + stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv - stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv + stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv - stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv + stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv - stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv + stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv - stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv + stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv - stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv + stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv - stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv + stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv - stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv + stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv - stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv + stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv - stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv + stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv - stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv + stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv - stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv + stepUv * 12.0) * 0.00453456;"," color += readSource(v_uv - stepUv * 12.0) * 0.00453456;"," if (color.a > 0.0001) color.rgb /= color.a;"," gl_FragColor = color;","}"].join(`
366
366
  `),Cb=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform sampler2D u_blurSource;","uniform vec2 u_texel;","uniform vec2 u_uvScale;","uniform vec2 u_uvOffset;","uniform float u_blurReady;","uniform float u_blur;","uniform float u_kuwaharaRadius;","vec3 readPrepared(vec2 displayUv){"," vec2 uv = (displayUv - u_uvOffset) / u_uvScale;"," vec3 color = texture2D(u_source, clamp(uv, vec2(0.0), vec2(1.0))).rgb;"," if (u_blurReady > 0.5 && u_blur > 0.0) {"," vec3 blurred = texture2D(u_blurSource, clamp(uv, vec2(0.0), vec2(1.0))).rgb;"," color = mix(color, blurred, clamp(u_blur, 0.0, 1.0));"," }"," return color;","}","void main(){"," float radius = floor(mix(2.0, 16.0, clamp(u_kuwaharaRadius, 0.0, 1.0)) + 0.5);"," vec3 sum = vec3(0.0);"," float sumSquares = 0.0;"," float count = 0.0;"," for (int offset = 0; offset <= 16; offset++) {"," if (float(offset) > radius) continue;"," vec3 color = readPrepared(v_uv + vec2(float(offset), 0.0) * u_texel);"," sum += color;"," sumSquares += dot(color, color) / 3.0;"," count += 1.0;"," }"," gl_FragColor = vec4(sum / count, sumSquares / count);","}"].join(`
367
367
  `),_b=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_kuwaharaMoments;","uniform vec2 u_texel;","uniform float u_kuwaharaRadius;","uniform float u_kuwaharaSharpness;","uniform float u_kuwaharaSaturation;","void main(){"," float radius = floor(mix(2.0, 16.0, clamp(u_kuwaharaRadius, 0.0, 1.0)) + 0.5);"," vec2 origins[4];"," origins[0] = vec2(-radius, -radius);"," origins[1] = vec2(0.0, -radius);"," origins[2] = vec2(-radius, 0.0);"," origins[3] = vec2(0.0, 0.0);"," vec3 means[4];"," float variances[4];"," float minVariance = 1.0;"," for (int quadrant = 0; quadrant < 4; quadrant++) {"," vec4 moment = vec4(0.0);"," float count = 0.0;"," for (int offset = 0; offset <= 16; offset++) {"," if (float(offset) > radius) continue;"," vec2 sampleOffset = origins[quadrant] + vec2(0.0, float(offset));"," moment += texture2D(u_kuwaharaMoments, clamp(v_uv + sampleOffset * u_texel, vec2(0.0), vec2(1.0)));"," count += 1.0;"," }"," moment /= count;"," vec3 mean = moment.rgb;"," float meanSquare = moment.a * 3.0;"," float variance = max(meanSquare - dot(mean, mean), 0.0);"," means[quadrant] = mean;"," variances[quadrant] = variance;"," minVariance = min(minVariance, variance);"," }"," float exponent = 1.0 + clamp(u_kuwaharaSharpness, 0.0, 1.0) * 8.0;"," vec3 result = vec3(0.0);"," float totalWeight = 0.0;"," for (int quadrant = 0; quadrant < 4; quadrant++) {"," float weight = pow((minVariance + 0.0001) / (variances[quadrant] + 0.0001), exponent);"," result += means[quadrant] * weight;"," totalWeight += weight;"," }"," result /= max(totalWeight, 0.0001);"," float luma = dot(result, vec3(0.2126, 0.7152, 0.0722));"," float saturation = clamp(u_kuwaharaSaturation, 0.0, 1.0) * 2.0;"," gl_FragColor = vec4(clamp(mix(vec3(luma), result, saturation), 0.0, 1.0), 1.0);","}"].join(`
368
- `);function Lt(e){return e instanceof HTMLVideoElement||e instanceof HTMLImageElement}function Sd(e){let t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function Ad(e,t,n){let r=e.createShader(n);return r?(e.shaderSource(r,t),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(L("runtime.colorGrading.compileShader",e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function xi(e,t=Eb){let n=Ad(e,Ab,e.VERTEX_SHADER),r=Ad(e,t,e.FRAGMENT_SHADER);if(!n||!r)return n&&e.deleteShader(n),r&&e.deleteShader(r),null;let i=e.createProgram();return i?(e.attachShader(i,n),e.attachShader(i,r),e.linkProgram(i),e.deleteShader(n),e.deleteShader(r),e.getProgramParameter(i,e.LINK_STATUS)?i:(L("runtime.colorGrading.linkProgram",e.getProgramInfoLog(i)),e.deleteProgram(i),null)):null}function pi(e,t=e.LINEAR,n=e.UNSIGNED_BYTE){let r=e.createTexture();return r?(e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,n,null),r):null}function Tb(e,t){let n=xi(e,wb);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),resolution:e.getUniformLocation(n,"u_resolution"),direction:e.getUniformLocation(n,"u_direction"),radius:e.getUniformLocation(n,"u_radius"),bloomPass:e.getUniformLocation(n,"u_bloomPass"),threshold:e.getUniformLocation(n,"u_threshold")}:null}function Rb(e,t){let n=xi(e,Cb);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),blurSource:e.getUniformLocation(n,"u_blurSource"),texel:e.getUniformLocation(n,"u_texel"),uvScale:e.getUniformLocation(n,"u_uvScale"),uvOffset:e.getUniformLocation(n,"u_uvOffset"),blurReady:e.getUniformLocation(n,"u_blurReady"),blur:e.getUniformLocation(n,"u_blur"),radius:e.getUniformLocation(n,"u_kuwaharaRadius")}:null}function kb(e,t){let n=xi(e,_b);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),moments:e.getUniformLocation(n,"u_kuwaharaMoments"),texel:e.getUniformLocation(n,"u_texel"),radius:e.getUniformLocation(n,"u_kuwaharaRadius"),sharpness:e.getUniformLocation(n,"u_kuwaharaSharpness"),saturation:e.getUniformLocation(n,"u_kuwaharaSaturation")}:null}function ir(e,t=e.UNSIGNED_BYTE,n=e.LINEAR){let r=pi(e,n,t),i=e.createFramebuffer();if(!r||!i)return r&&e.deleteTexture(r),i&&e.deleteFramebuffer(i),null;e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),o!==e.FRAMEBUFFER_COMPLETE?(e.deleteTexture(r),e.deleteFramebuffer(i),null):{texture:r,framebuffer:i,type:t,width:1,height:1}}function gi(e,t,n,r){t.width===n&&t.height===r||(t.width=n,t.height=r,e.bindTexture(e.TEXTURE_2D,t.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,r,0,e.RGBA,t.type,null))}function Ia(e,t,n){let r=[];for(let i of n){let o=e.getUniformLocation(t,`u_${i}`);o!==null&&r.push([i,o])}return r}function Ed(e,t,n){t&&e.deleteProgram(t);for(let r of n)r&&e.deleteTexture(r)}function Ga(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});if(!t)return null;let n=xi(t),r=pi(t),i=pi(t,t.NEAREST),o=pi(t,t.NEAREST);if(!n||!r||!i||!o)return Ed(t,n,[r,i,o]),null;let a=t.createBuffer();return a?(t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW),{gl:t,program:{program:n,texture:r,lutTexture:i,advancedTexture:o,advancedSignature:null,quad:a,position:t.getAttribLocation(n,"a_pos"),source:t.getUniformLocation(n,"u_source"),blurSource:t.getUniformLocation(n,"u_blurSource"),bloomSource:t.getUniformLocation(n,"u_bloomSource"),kuwaharaSource:t.getUniformLocation(n,"u_kuwaharaSource"),lut:t.getUniformLocation(n,"u_lut"),advanced:t.getUniformLocation(n,"u_advanced"),resolution:t.getUniformLocation(n,"u_resolution"),uvScale:t.getUniformLocation(n,"u_uvScale"),uvOffset:t.getUniformLocation(n,"u_uvOffset"),blurReady:t.getUniformLocation(n,"u_blurReady"),bloomReady:t.getUniformLocation(n,"u_bloomReady"),kuwaharaReady:t.getUniformLocation(n,"u_kuwaharaReady"),lutEnabled:t.getUniformLocation(n,"u_lutEnabled"),lutSize:t.getUniformLocation(n,"u_lutSize"),lutTextureSize:t.getUniformLocation(n,"u_lutTextureSize"),lutDomainMin:t.getUniformLocation(n,"u_lutDomainMin"),lutDomainMax:t.getUniformLocation(n,"u_lutDomainMax"),lutIntensity:t.getUniformLocation(n,"u_lutIntensity"),shadowWheel:t.getUniformLocation(n,"u_shadowWheel"),midtoneWheel:t.getUniformLocation(n,"u_midtoneWheel"),highlightWheel:t.getUniformLocation(n,"u_highlightWheel"),rgbCurvesEnabled:t.getUniformLocation(n,"u_rgbCurvesEnabled"),hueCurvesEnabled:t.getUniformLocation(n,"u_hueCurvesEnabled"),secondaryCount:t.getUniformLocation(n,"u_secondaryCount"),adjustUniforms:Ia(t,n,zr),detailUniforms:Ia(t,n,No),effectUniforms:Ia(t,n,Lo),grainSeed:t.getUniformLocation(n,"u_grainSeed"),effectTime:t.getUniformLocation(n,"u_effectTime"),paletteSize:t.getUniformLocation(n,"u_paletteSize"),palette0:t.getUniformLocation(n,"u_palette0"),palette1:t.getUniformLocation(n,"u_palette1"),palette2:t.getUniformLocation(n,"u_palette2"),palette3:t.getUniformLocation(n,"u_palette3"),palette4:t.getUniformLocation(n,"u_palette4"),palette5:t.getUniformLocation(n,"u_palette5"),intensity:t.getUniformLocation(n,"u_intensity"),compareEnabled:t.getUniformLocation(n,"u_compareEnabled"),comparePosition:t.getUniformLocation(n,"u_comparePosition"),compareSoftness:t.getUniformLocation(n,"u_compareSoftness"),compareLineWidth:t.getUniformLocation(n,"u_compareLineWidth")}}):(Ed(t,n,[r,i,o]),null)}function Mb(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Fb(e){if(!Mb(e))return{...rn};let t=(n,r,i,o)=>{let a=typeof n=="number"?n:Number(n);return Math.min(o,Math.max(i,Number.isFinite(a)?a:r))};return{enabled:e.enabled===!0,position:t(e.position,rn.position,0,1),softness:t(e.softness,rn.softness,0,.25),lineWidth:t(e.lineWidth,rn.lineWidth,0,12)}}function Fd(e){try{let t=new URL(e,document.baseURI);return t.protocol==="data:"?{href:t.href}:t.protocol!=="http:"&&t.protocol!=="https:"?{error:"LUT must be project-local or a data URL"}:t.origin!==window.location.origin?{error:"Remote LUT URLs are not supported"}:{href:t.href}}catch{return{error:"Invalid LUT URL"}}}function yi(e){return e instanceof Error?e.message:"LUT failed to load"}function Nb(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0)%1e4}function Nd(e){let t=e.id||e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return Nb(t)}function Ba(e){let t=Fd(e);if("error"in t)return{state:"error",message:t.error};let n=it.get(t.href);if(n)return n;let r=fetch(t.href,{credentials:"same-origin"}).then(o=>{if(!o.ok)throw new Error(`Failed to load LUT (${o.status})`);return o.text()}).then(o=>Ul(o,{maxSize:Br})),i={state:"pending",promise:r};for(;it.size>=hb;){let o=it.keys().next().value;if(!o)break;it.delete(o)}return it.set(t.href,i),r.then(o=>{it.get(t.href)===i&&it.set(t.href,{state:"ready",lut:o})},o=>{it.get(t.href)===i&&it.set(t.href,{state:"error",message:yi(o)})}),i}function wd(e,t,n){if(e.lut?.src===t)return e.lut;let r=Eo(n),{gl:i,program:o}=e;try{return Ld(i,o.lutTexture,r),e.lut={src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height},e.lutError=null,e.lutLoadingSrc=null,e.lut}catch(a){return e.lut=null,e.lutError=yi(a),e.lutLoadingSrc=null,L("runtime.colorGrading.uploadLut",a),null}}async function Lb(e){let t=Ba(e);if(t.state==="ready")return t.lut;if(t.state==="pending")return t.promise;throw new Error(t.message)}function Ld(e,t,n){e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)}function Db(e,t,n){let r=Eo(n),{gl:i,program:o}=e;return Ld(i,o.lutTexture,r),{src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height}}function Je(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function Ua(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),Je(e.gl,t.scratch),Je(e.gl,t.blur),t.bloom&&Je(e.gl,t.bloom),e.effectTargets=null)}function Wa(e){let t=e.kuwaharaTargets;t&&(e.gl.deleteProgram(t.horizontalProgram.program),e.gl.deleteProgram(t.resolveProgram.program),Je(e.gl,t.moments),Je(e.gl,t.output),e.kuwaharaTargets=null)}function hi(e,t=!1){Ua(e),Wa(e),Ib(e.gl,e.program),t&&e.gl.getExtension("WEBGL_lose_context")?.loseContext()}function Ib(e,t){e.deleteTexture(t.texture),e.deleteTexture(t.lutTexture),e.deleteTexture(t.advancedTexture),e.deleteBuffer(t.quad),e.deleteProgram(t.program)}function Pb(e){let t=Ga(e.canvas);return t?(hi(e),e.gl=t.gl,e.program=t.program,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function Ha(e){if(!e.sourceHidden)return;e.element.removeAttribute(Nn);let t=e.element.style.getPropertyValue("opacity"),n=e.element.style.getPropertyPriority("opacity");t==="0"&&n==="important"&&(e.sourceInlineOpacity===null?e.element.style.removeProperty("opacity"):e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority)),e.sourceHidden=!1}function Ob(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=Tb(t,e.program.quad),r=ir(t),i=ir(t);return!n||!r||!i?(n&&t.deleteProgram(n.program),r&&Je(t,r),i&&Je(t,i),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:r,blur:i,bloom:null},e.effectTargets)}function Hb(e,t){return t.bloom||(t.bloom=ir(e.gl),e.effectError=t.bloom?null:"Framebuffer effects unavailable"),t.bloom}function Cd(e){let t=e.effectTargets;t?.bloom&&(Je(e.gl,t.bloom),t.bloom=null)}function Gb(e){if(e.kuwaharaTargets)return e.kuwaharaTargets;let{gl:t}=e,n=t.getExtension("OES_texture_half_float"),r=t.getExtension("EXT_color_buffer_half_float");if(!n||!r)return e.effectError="Kuwahara requires half-float framebuffer support",null;let i=Rb(t,e.program.quad),o=kb(t,e.program.quad),a=ir(t,n.HALF_FLOAT_OES,t.NEAREST),l=ir(t);return!i||!o||!a||!l?(Bb(t,i,o,a,l),e.effectError="Kuwahara framebuffer effects unavailable",null):(e.kuwaharaTargets={horizontalProgram:i,resolveProgram:o,moments:a,output:l},e.kuwaharaTargets)}function Bb(e,t,n,r,i){t&&e.deleteProgram(t.program),n&&e.deleteProgram(n.program),r&&Je(e,r),i&&Je(e,i)}function Dd(e,t,n,r,i){let o=Math.max(1,Math.ceil(r)),a=Math.max(1,Math.ceil(i));return gi(e,t,o,a),gi(e,n,o,a),{width:o,height:a}}function bi(e,t,n,r,i,o,a,l=!1,s=-1){e.bindFramebuffer(e.FRAMEBUFFER,r.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(t.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(t.source,0),e.uniform2f(t.resolution,i.width,i.height),e.uniform2f(t.direction,o.x,o.y),e.uniform1f(t.radius,a),e.uniform1f(t.bloomPass,l?1:0),e.uniform1f(t.threshold,s),or(e,t)}function Ub(e,t,n,r,i,o,a){let l=Dd(e,t.scratch,r,i/2,o/2),s=a/2;bi(e,t.blurProgram,n,t.scratch,l,{x:1,y:0},s,!0,.5),bi(e,t.blurProgram,t.scratch.texture,r,l,{x:0,y:1},s,!0)}function Wb(e,t,n,r,i,o,a){let l=n;for(let s=0;s<Math.max(1,Math.floor(a));s++)bi(e,t.blurProgram,l,t.scratch,i,{x:1,y:0},o),bi(e,t.blurProgram,t.scratch.texture,r,i,{x:0,y:1},o),l=r.texture}function or(e,t){e.bindBuffer(e.ARRAY_BUFFER,t.quad),e.enableVertexAttribArray(t.position),e.vertexAttribPointer(t.position,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLE_STRIP,0,4)}function Vb(e,t,n,r,i,o,a,l){gi(e,t.moments,i.width,i.height),gi(e,t.output,i.width,i.height);let s=t.horizontalProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.moments.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(s.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,r),e.uniform1i(s.source,0),e.uniform1i(s.blurSource,1),e.uniform2f(s.texel,1/i.width,1/i.height),e.uniform2f(s.uvScale,o.scaleX,o.scaleY),e.uniform2f(s.uvOffset,o.offsetX,o.offsetY),e.uniform1f(s.blurReady,a?1:0),e.uniform1f(s.blur,l.blur),e.uniform1f(s.radius,l.kuwaharaRadius),or(e,s);let u=t.resolveProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.output.framebuffer),e.useProgram(u.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.moments.texture),e.uniform1i(u.moments,0),e.uniform2f(u.texel,1/i.width,1/i.height),e.uniform1f(u.radius,l.kuwaharaRadius),e.uniform1f(u.sharpness,l.kuwaharaSharpness),e.uniform1f(u.saturation,l.kuwaharaSaturation),or(e,u)}function zb(e,t,n,r){if(n<=0)return!1;let i=Dd(e.gl,t.scratch,t.blur,r.width,r.height);return Wb(e.gl,t,e.program.texture,t.blur,i,.75+Math.pow(n,1.35)*32,n>.55?3:2),!0}function qb(e,t,n,r,i,o){if(n<=0)return Cd(e),null;o||Cd(e);let a=o?Hb(e,t):t.blur;return a?(Ub(e.gl,t,e.program.texture,a,i.width,i.height,r),a.texture):null}function $b(e,t,n,r){let{program:i}=e,o=t.effects.blur,a=t.effects.bloom;if(o<=0&&a<=0)return e.effectTargets&&r&&Ua(e),{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let l=Ob(e);if(!l)return{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let s=zb(e,l,o,n),u=qb(e,l,a,t.effects.bloomRadius,n,s);return{blurReady:s,bloomReady:u!==null,blurTexture:l.blur.texture,bloomTexture:u??i.texture}}function jb(e,t,n,r,i,o,a){let l=t.effects.kuwahara;if(l<=0&&!o)return e.kuwaharaTargets&&a&&Wa(e),{kuwaharaReady:!1,kuwaharaTexture:e.program.texture};let s=Gb(e);return!s||l<=0?{kuwaharaReady:!1,kuwaharaTexture:s?.output.texture??e.program.texture}:(Vb(e.gl,s,e.program.texture,e.effectTargets?.blur.texture??e.program.texture,n,r,i,t.effects),{kuwaharaReady:!0,kuwaharaTexture:s.output.texture})}function Id(e,t,n,r,i={}){let o=i.releaseIdleTargets??!0;e.effectError=null;let a=$b(e,t,n,o),l=jb(e,t,n,r,a.blurReady,i.preserveKuwahara??!1,o);return{...a,...l}}function Kb(e){let t=e.grading.lut?.src.trim()??"",n=e.grading.lut?.intensity??1;if(!t||n<=0)return e.lut=null,e.lutLoadingSrc=null,e.lutError=null,null;let r=Fd(t);if("error"in r)return e.lut=null,e.lutLoadingSrc=null,e.lutError=r.error,null;if(e.lut?.src===r.href)return e.lut;e.lut=null;let i=Ba(t);return i.state==="ready"?wd(e,r.href,i.lut):i.state==="error"?(e.lutError=i.message,e.lutLoadingSrc=null,null):(e.lutLoadingSrc!==r.href&&(e.lutLoadingSrc=r.href,e.lutError=null,i.promise.then(o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(wd(e,r.href,o),De(e))},o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=yi(o),e.lutLoadingSrc=null,De(e))})),null)}function nr(e){if(!e)return null;if(typeof e=="string"){let t=e.trim();if(!t)return null;let n=document.getElementById(t.replace(/^#/,""));if(n&&Lt(n))return n;try{let r=document.querySelector(t);return r&&Lt(r)?r:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&Lt(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&Lt(t))return t}if(!e.selector)return null;try{let t=Array.from(document.querySelectorAll(e.selector)),n=Math.max(0,Math.floor(Number(e.selectorIndex??0)||0)),r=t[n]??null;return r&&Lt(r)?r:null}catch{return null}}function Pd(e){return e instanceof HTMLVideoElement?e.videoWidth>0&&e.videoHeight>0?{width:e.videoWidth,height:e.videoHeight}:null:e instanceof HTMLImageElement&&e.naturalWidth>0&&e.naturalHeight>0?{width:e.naturalWidth,height:e.naturalHeight}:null}function Od(e){return e instanceof HTMLVideoElement?e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&e.videoWidth>0&&e.videoHeight>0:e instanceof HTMLImageElement?e.complete&&e.naturalWidth>0&&e.naturalHeight>0:!1}function Hd(e){let t=ut(e);return t&&Od(t)?t:null}function _d(e){if(!(e instanceof HTMLVideoElement))return!1;let t=Hd(e);if(!t)return!1;let n=window.getComputedStyle(t);return n.display!=="none"&&n.visibility!=="hidden"}function Yb(e){return e instanceof HTMLImageElement&&e.classList.contains("__render_frame__")}function Xb(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}function Gd(e){if(e instanceof HTMLVideoElement){let t=Hd(e);if(t)return t}return Od(e)?e:null}function Td(e,t){let n=e.toLowerCase();if(n==="center")return .5;if(t==="x"){if(n==="left")return 0;if(n==="right")return 1}else{if(n==="top")return 0;if(n==="bottom")return 1}if(n.endsWith("%")){let r=Number.parseFloat(n);return Number.isFinite(r)?r/100:null}return null}function Jb(e){let t=e.trim().split(/\s+/).filter(Boolean),n=.5,r=.5;for(let i=0;i<t.length;i++){let o=t[i]??"",a=Td(o,"x"),l=Td(o,"y");if(a!==null&&(o==="left"||o==="right"||o.endsWith("%")&&i===0)){n=a;continue}if(l!==null&&(o==="top"||o==="bottom"||o.endsWith("%")&&i>0)){r=l;continue}}return{x:n,y:r}}function Bd(e,t,n,r,i,o){if(e<=0||t<=0||n<=0||r<=0)return{scaleX:1,scaleY:1,offsetX:0,offsetY:0};let a=i||"fill",l=e,s=t;if(a==="contain"||a==="cover"||a==="scale-down"){let f=a==="cover"?Math.max(e/n,t/r):Math.min(e/n,t/r);l=n*f,s=r*f,a==="scale-down"&&l>n&&s>r&&(l=n,s=r)}else a==="none"&&(l=n,s=r);let u=Jb(o||"center"),c=(e-l)*u.x/e,m=(t-s)*u.y/t;return{scaleX:l/e,scaleY:s/t,offsetX:c,offsetY:m}}function Qb(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function Rd(e,t){return Math.max(0,Math.round(e>0?e:t))}function Zb(e,t){let{element:n,canvas:r}=e,i=n.parentElement;i&&Qb(e,i);let o=window.getComputedStyle(t);mu(r.style,o),r.style.pointerEvents="none",r.style.position="absolute",r.style.inset="auto",r.style.left=`${n.offsetLeft}px`,r.style.top=`${n.offsetTop}px`,r.style.right="auto",r.style.bottom="auto",r.style.width=`${n.offsetWidth}px`,r.style.height=`${n.offsetHeight}px`,r.style.display="block",r.style.opacity=e.sourceOpacityForCanvas,r.style.visibility=e.sourceVisibleForCanvas?"visible":"hidden";let a=n.getBoundingClientRect(),l=Rd(n.offsetWidth,a.width),s=Rd(n.offsetHeight,a.height);if(l<=0||s<=0)return r.style.display="none",null;let u=Math.max(1,window.devicePixelRatio||1),c=Math.round(l*u),m=Math.round(s*u);return r.width!==c&&(r.width=c),r.height!==m&&(r.height=m),{width:c,height:m}}function nn(e,t,n){e.uniform3f(t,Number.parseInt(n.slice(1,3),16)/255,Number.parseInt(n.slice(3,5),16)/255,Number.parseInt(n.slice(5,7),16)/255)}function Dt(e,t,n,r){e.set(r,(t*Ke+n)*4)}function yt(e,t){return Math.min(1,Math.max(1/255,(e*(127/t)+128)/255))}function Pa(e,t,n){return e.length>=3?Co(e,t,n):new Float32Array(Ke)}function Nt(e,t){return e[t]??0}function ex(e,t,n){let r=zt(t.red),i=zt(t.green),o=zt(t.blue),a=zt(t.master),l=Pa(n.hueVsHue,-180,180),s=Pa(n.hueVsSaturation,-1,1),u=Pa(n.hueVsLuma,-1,1);for(let c=0;c<Ke;c+=1)Dt(e,0,c,[Nt(r,c),Nt(i,c),Nt(o,c),Nt(a,c)]),Dt(e,1,c,[yt(Nt(l,c),180),yt(Nt(s,c),1),yt(Nt(u,c),1),1])}function tx(e,t,n){let r=n*yb;Dt(e,2,r,[t.key.hue.center/360,t.key.hue.range/180,t.key.hue.softness/180,1]),Dt(e,2,r+1,[t.key.saturation.min,t.key.saturation.max,t.key.saturation.softness/.5,0]),Dt(e,2,r+2,[t.key.luma.min,t.key.luma.max,t.key.luma.softness/.5,0]),Dt(e,2,r+3,[yt(t.correction.hueShift,180),yt(t.correction.saturation,1),yt(t.correction.luma,1),yt(t.correction.temperature,1)]),Dt(e,2,r+4,[yt(t.correction.tint,1),.5,.5,1])}function nx(e,t,n){let r=new Float32Array(Ke*sr*4);ex(r,e,t);let i=0;for(let o of n)o.enabled&&(tx(r,o,i),i+=1);return r}var kd=new WeakMap;function rx(e,t,n){let r=kd.get(e);if(r?.hueCurves===t&&r.secondaries===n)return r.signature;let i=JSON.stringify([e,t,n]);return kd.set(e,{hueCurves:t,secondaries:n,signature:i}),i}function ix(e,t,n,r){let{curves:i,hueCurves:o}=n,a=rx(i,o,r);if(t.advancedSignature===a)return;let l=Uint8Array.from(nx(i,o,r),kn);e.activeTexture(e.TEXTURE5),e.bindTexture(e.TEXTURE_2D,t.advancedTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,Ke,sr,0,e.RGBA,e.UNSIGNED_BYTE,l),t.advancedSignature=a}function Oa(e,t,n){e.uniform3f(t,n.hue/360,n.amount,n.level)}function Ud(e,t,n,r,i,o,a,l,s,u,c,m){e.uniform1i(t.source,0),e.uniform1i(t.blurSource,1),e.uniform1i(t.lut,2),e.uniform1i(t.kuwaharaSource,3),e.uniform1i(t.bloomSource,4),e.uniform1i(t.advanced,5),e.uniform2f(t.resolution,s.width,s.height),e.uniform2f(t.uvScale,u.scaleX,u.scaleY),e.uniform2f(t.uvOffset,u.offsetX,u.offsetY),e.uniform1f(t.blurReady,i?1:0),e.uniform1f(t.bloomReady,o?1:0),e.uniform1f(t.kuwaharaReady,a?1:0),e.uniform1f(t.lutEnabled,r?1:0),e.uniform1f(t.lutSize,r?.size??2),e.uniform2f(t.lutTextureSize,r?.textureWidth??1,r?.textureHeight??1),e.uniform3f(t.lutDomainMin,r?.domainMin[0]??0,r?.domainMin[1]??0,r?.domainMin[2]??0),e.uniform3f(t.lutDomainMax,r?.domainMax[0]??1,r?.domainMax[1]??1,r?.domainMax[2]??1),e.uniform1f(t.lutIntensity,n.lut?.intensity??0);let{curves:f,hueCurves:p,secondaries:b}=n,v=Po(f),x=Oo(p),_=Ho(b)?b.reduce((M,F)=>M+Number(F.enabled),0):0;(v||x||_>0)&&ix(e,t,n,b),Oa(e,t.shadowWheel,n.wheels.shadows),Oa(e,t.midtoneWheel,n.wheels.midtones),Oa(e,t.highlightWheel,n.wheels.highlights),e.uniform1f(t.rgbCurvesEnabled,v?1:0),e.uniform1f(t.hueCurvesEnabled,x?1:0),e.uniform1f(t.secondaryCount,_);for(let[M,F]of t.adjustUniforms)e.uniform1f(F,n.adjust[M]);for(let[M,F]of t.detailUniforms)e.uniform1f(F,n.details[M]);e.uniform1f(t.grainSeed,c),e.uniform1f(t.effectTime,m);for(let[M,F]of t.effectUniforms)e.uniform1f(F,n.effects[M]);let R=n.palette??(n.effects.engraving>0||n.effects.crosshatch>0?bb:La),T=R[R.length-1]??La[1];e.uniform1f(t.paletteSize,R.length),nn(e,t.palette0,R[0]??La[0]),nn(e,t.palette1,R[1]??T),nn(e,t.palette2,R[2]??T),nn(e,t.palette3,R[3]??T),nn(e,t.palette4,R[4]??T),nn(e,t.palette5,R[5]??T),e.uniform1f(t.intensity,n.intensity),e.uniform1f(t.compareEnabled,l.enabled?1:0),e.uniform1f(t.comparePosition,l.position),e.uniform1f(t.compareSoftness,l.softness),e.uniform1f(t.compareLineWidth,l.lineWidth)}function ox(e){if(!e.sourceHidden){let t=e.element.getAttribute(Vr);t!==null?(e.sourceInlineOpacity=t===""?null:t,e.sourceInlineOpacityPriority=""):(e.sourceInlineOpacity=e.element.style.getPropertyValue("opacity")||null,e.sourceInlineOpacityPriority=e.element.style.getPropertyPriority("opacity"))}e.element.setAttribute(Nn,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function ot(e){let t=su.find(n=>n.path===e);if(!t)throw new Error(`Missing color-grading animation property: ${e}`);return t}var Wd=ot("intensity"),Vd=ot("lut.intensity"),zd=ot("adjust.exposure"),qd=ot("effects.kuwahara"),$d=[["blur",ot("effects.blur")],["bloom",ot("effects.bloom")],["kuwahara",qd],["pixelate",ot("effects.pixelate")],["ascii",ot("effects.ascii")],["dither",ot("effects.dither")]],jd=[Wd,Vd,zd,...$d.map(([,e])=>e)];function It(e,t){let n=e.style.getPropertyValue(t.name);if(!n)return null;let r=Number(n);return Number.isFinite(r)?Math.min(t.max,Math.max(t.min,r)):null}function rr(e,t){return t!==null&&(du(t)||jd.some(n=>It(e,n)!==null))}function ax(e,t){let n=null;for(let[r,i]of $d){let o=It(e,i);o!==null&&(n??(n={...t.effects}),n[r]=o)}return n}function sx(e){let{element:t,grading:n}=e,r=It(t,Wd),i=It(t,Vd),o=It(t,zd),a=ax(t,n);if(![r,i,o].some(u=>u!==null)&&a===null)return n;let s={...n,adjust:o===null?n.adjust:{...n.adjust,exposure:o},effects:a??n.effects};return r!==null&&(s.intensity=r),n.lut&&i!==null&&(s.lut={...n.lut,intensity:i}),s}function Kd(e,t,n){e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)}function Yd(e,t,n){let r=[t.texture,n.blurTexture,t.lutTexture,n.kuwaharaTexture,n.bloomTexture,t.advancedTexture];for(let[i,o]of r.entries())e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,o)}function De(e){if(e.destroyed||e.contextLost)return!1;let t=Gd(e.element);if(!t)return e.hasDrawn||(e.canvas.style.display="none"),!1;let n=Pd(t);if(!n)return!1;let r=t instanceof HTMLElement?t:e.element,i=e.element.style.getPropertyValue("opacity"),o=e.element.style.getPropertyPriority("opacity"),a=e.sourceHidden&&i==="0"&&o==="important",l=e.element.style.getPropertyValue("visibility"),s=Yb(t);s&&Xb(e,t),a&&!s&&(e.sourceInlineOpacity!==null?e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority||""):e.element.style.removeProperty("opacity"));let u=window.getComputedStyle(s?t:e.element);e.sourceOpacityForCanvas=u.opacity||"1",a&&!s&&e.element.style.setProperty("opacity","0","important"),e.sourceVisibleForCanvas=(s||l!=="hidden")&&u.visibility!=="hidden";let c=Zb(e,r);if(!c)return!1;let m=window.getComputedStyle(r),f=Bd(c.width,c.height,n.width,n.height,m.objectFit,m.objectPosition),{gl:p,program:b}=e;try{let v=sx(e),x=Kb(e);Kd(p,b.texture,t);let _=It(e.element,qd)!==null,R=Id(e,v,c,f,{preserveKuwahara:_});p.bindFramebuffer(p.FRAMEBUFFER,null),p.viewport(0,0,c.width,c.height),p.useProgram(b.program),Yd(p,b,R);let T=window.__player?.getTime?.(),M=typeof T=="number"&&Number.isFinite(T)?Math.max(0,T):e.element instanceof HTMLVideoElement?Math.max(0,e.element.currentTime):0,F=e.grainSeed+Math.floor(M*60);return Ud(p,b,v,x,R.blurReady,R.bloomReady,R.kuwaharaReady,e.compare,c,f,F,M),or(p,b),ox(e),e.hasDrawn=!0,e.drawError=null,!0}catch(v){return e.drawError=v instanceof Error?v.message:"Shader draw failed",L("runtime.colorGrading.drawEntry",v),!1}}function lx(e,t,n){let r=e.getBoundingClientRect(),i=e.offsetWidth||r.width||t.width,o=e.offsetHeight||r.height||t.height,a=Math.min(320,Math.max(64,Math.round(n??160))),l=i>0&&o>0?i/o:t.width/t.height;return l>=1?{width:a,height:Math.max(1,Math.round(a/l))}:{width:Math.max(1,Math.round(a*l)),height:a}}function ux(){let e=document.createElement("canvas"),t=Ga(e);return t?{canvas:e,...t,lut:null,effectTargets:null,kuwaharaTargets:null,effectError:null}:null}function cx(e,t){let n=t?void 0:window.__player?.getTime?.();return typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):e instanceof HTMLVideoElement?Math.max(0,e.currentTime):0}function dx(e,t,n,r){let i=Gd(t);if(!i)return null;let o=Pd(i);if(!o)return null;let a=lx(t,o,n);e.canvas.width=a.width,e.canvas.height=a.height;let l=i instanceof HTMLElement?i:t,s=window.getComputedStyle(l),u=Bd(a.width,a.height,o.width,o.height,s.objectFit,s.objectPosition);return Kd(e.gl,e.program.texture,i),{dimensions:a,uv:u,effectTime:cx(t,r),grainSeed:Nd(t)+(t instanceof HTMLVideoElement?Math.floor(t.currentTime*60):0)}}async function fx(e,t,n,r,i=!1){let o=dx(e,t,r,i);if(!o)return null;let{dimensions:a,uv:l,grainSeed:s,effectTime:u}=o,c=[];for(let m of n.slice(0,32)){let f=qr(m.grading);if(!f){c.push({id:m.id,dataUrl:null,error:"Invalid grading"});continue}let p=null;try{f.lut&&(e.lut?.src!==f.lut.src&&(e.lut=Db(e,f.lut.src,await Lb(f.lut.src))),p=e.lut),c.push({id:m.id,dataUrl:mx(e,f,p,a,l,s,u)})}catch(b){c.push({id:m.id,dataUrl:null,error:yi(b)})}}return{...a,images:c}}function mx(e,t,n,r,i,o,a){let{canvas:l,gl:s,program:u}=e,c=Id(e,t,r,i,{releaseIdleTargets:!1});return s.bindFramebuffer(s.FRAMEBUFFER,null),s.viewport(0,0,r.width,r.height),s.useProgram(u.program),Yd(s,u,c),n||(e.lut=null),Ud(s,u,t,n,c.blurReady,c.bloomReady,c.kuwaharaReady,rn,r,i,o,a),or(s,u),l.toDataURL("image/png")}function Xe(e,t,n,r){t.addEventListener(n,r),e.cleanup.push(()=>t.removeEventListener(n,r))}function px(e){e.animationFrame!==null&&(window.cancelAnimationFrame(e.animationFrame),e.animationFrame=null),e.videoFrameHandle!==null&&e.element instanceof HTMLVideoElement&&(e.element.cancelVideoFrameCallback?.(e.videoFrameHandle),e.videoFrameHandle=null)}function ar(e){if(e.destroyed||!(e.element instanceof HTMLVideoElement)||e.videoFrameHandle!==null||e.animationFrame!==null)return;let t=e.element,n=t;if(typeof n.requestVideoFrameCallback=="function"){e.videoFrameHandle=n.requestVideoFrameCallback(()=>{e.videoFrameHandle=null,De(e),!e.destroyed&&!t.paused&&!t.ended&&ar(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,De(e),!e.destroyed&&!t.paused&&!t.ended&&ar(e)})}function hx(e){let t=()=>{De(e)};if(Xe(e,e.element,"load",t),Xe(e,e.element,"loadedmetadata",t),Xe(e,e.element,"loadeddata",t),Xe(e,e.element,"seeked",t),Xe(e,e.element,"timeupdate",t),Xe(e,window,"resize",t),e.element instanceof HTMLVideoElement&&(Xe(e,e.element,"play",()=>ar(e)),Xe(e,e.element,"pause",t)),Xe(e,e.canvas,"webglcontextlost",n=>{n.preventDefault(),e.contextLost=!0,e.drawError="WebGL context lost",e.canvas.style.display="none",Ha(e)}),Xe(e,e.canvas,"webglcontextrestored",()=>{if(e.contextLost=!1,!Pb(e)){e.contextLost=!0,e.drawError="WebGL context restore failed",Ha(e);return}e.drawError=null,De(e)}),typeof ResizeObserver<"u"&&(e.resizeObserver=new ResizeObserver(t),e.resizeObserver.observe(e.element)),typeof MutationObserver<"u"){let n=()=>{let a=e.element.style;return`${a.transform}|${a.translate}|${a.rotate}|${a.scale}|${a.left}|${a.top}|${a.width}|${a.height}`},r=n(),i=!1,o=new MutationObserver(()=>{i||n()!==r&&(i=!0,requestAnimationFrame(()=>{i=!1,r=n(),De(e)}))});o.observe(e.element,{attributes:!0,attributeFilter:["style"]}),e.cleanup.push(()=>o.disconnect())}}function gx(e){if(e.destroyed)return null;e.destroyed=!0,px(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();return e.cleanup.length=0,e.canvas.remove(),Ua(e),Wa(e),Ha(e),e.touchedParent&&(e.parentInlinePosition===null?e.touchedParent.style.removeProperty("position"):e.touchedParent.style.position=e.parentInlinePosition),{canvas:e.canvas,gl:e.gl,program:e.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}function Xd(e,t){return e.removeAttribute("style"),t.id?e.id=`${nu}${t.id}`:e.removeAttribute("id"),e.className=pb,e.setAttribute(mb,"true"),e.setAttribute("data-hyperframes-ignore",""),e.setAttribute("data-hyperframes-picker-ignore",""),e.setAttribute("data-hf-ignore",""),e.setAttribute("aria-hidden","true"),e.style.pointerEvents="none",e.style.display="none",t.parentNode?.insertBefore(e,t.nextSibling),e}function bx(e){return Xd(document.createElement("canvas"),e)}function Jd(){let e=new WeakMap,t=new Set,n=[],r=null,i=null,o=Promise.resolve(),a=!1,l=(E,S,A)=>{let C=e.get(E);if(C)return C.grading=S,C.source=A,De(C),E instanceof HTMLVideoElement&&!E.paused&&ar(C),!0;let N=n.pop();if(N)Xd(N.canvas,E);else{let W=bx(E),U=Ga(W);if(!U)return W.remove(),!1;N={canvas:W,gl:U.gl,program:U.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}let I={element:E,...N,grading:S,compare:{...rn},lut:null,lutLoadingSrc:null,lutError:null,drawError:null,effectTargets:null,kuwaharaTargets:null,effectError:null,source:A,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(E).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(E).visibility!=="hidden",hasDrawn:!1,contextLost:!1,grainSeed:Nd(E),destroyed:!1};return e.set(E,I),t.add(E),hx(I),De(I),E instanceof HTMLVideoElement&&!E.paused&&ar(I),!0},s=(E,S)=>{if(a)return!1;let A=nr(E);if(!A)return!1;let C=e.get(A);if(!C){let N=mi(A);if(!rr(A,N)||!l(A,N,"attribute"))return!1;C=e.get(A)}return C?(C.compare=Fb(S),De(C),!0):!1},u=E=>{let S=e.get(E);if(!S)return;let A=gx(S);A&&(S.contextLost||n.length>=gb?hi(A,!0):n.push(A)),e.delete(E),t.delete(E)},c=()=>{if(a)return 0;let E=new Set;document.querySelectorAll(`video[${Fn}], img[${Fn}]`).forEach(A=>{if(!Lt(A))return;E.add(A);let C=mi(A);rr(A,C)&&(Sd(A)||_d(A))?l(A,C,"attribute"):u(A)});for(let A of t){let C=e.get(A);C&&(!A.isConnected||C.source==="attribute"&&!E.has(A))&&u(A)}return t.size},m=()=>{if(a)return 0;let E=0;for(let S of t){let A=e.get(S);A&&De(A)&&(E+=1)}return E},f=async()=>{let E=new Set;for(let S of t){let A=e.get(S)?.grading.lut;if(!A?.src.trim()||(A.intensity??1)<=0)continue;let C=Ba(A.src);C.state==="pending"&&E.add(C.promise)}return E.size>0&&await Promise.allSettled(E),m(),E.size},p=()=>{if(a)return 0;let E=0;for(let S of t){let A=e.get(S);!A||!jd.some(N=>It(S,N)!==null)||S instanceof HTMLVideoElement&&!S.paused&&!S.ended||De(A)&&(E+=1)}return E},b=(E,S)=>{if(a)return!1;let A=nr(E);if(!A)return!1;let C=qr(S);return rr(A,C)?l(A,C,"live"):(u(A),!0)},v=(E,S)=>{if(!Lt(E))return!1;let A=e.get(E);if(!A){if(!S)return!1;let C=mi(E);return rr(E,C)&&l(E,C,"attribute")}return A.sourceVisibleForCanvas=S,!S&&A.source==="attribute"&&u(E),!0},x=E=>{let S=nr(E);if(!S)return{state:"missing",message:"Media not found"};let A=e.get(S);if(A)return A.effectError?{state:"unavailable",message:A.effectError}:A.drawError?{state:"unavailable",message:A.drawError}:A.lutError?{state:"unavailable",message:`LUT error: ${A.lutError}`}:A.grading.lut&&A.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:A.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:A.lut?"Shader + LUT active":"Shader active"};let C=mi(S);return rr(S,C)?!Sd(S)&&!_d(S)?{state:"pending",message:"Waiting for visible media"}:{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},_=async(E,S,A)=>{let C=async()=>{if(a||S.length===0)return null;let I=nr(E);return!I||(i??(i=ux()),!i)?null:fx(i,I,S,A?.maxDimension,A?.useMediaTime)},N=o.then(C,C);return o=N.then(()=>{},()=>{}),N},R=E=>{let S=nr(E);if(!(S instanceof HTMLVideoElement))return null;if(!S.paused)return()=>{};let A=S.currentTime,C=S.loop,N=S.muted;return S.loop=!0,S.muted=!0,(S.ended||Number.isFinite(S.duration)&&A>=S.duration)&&(S.currentTime=0),S.play().catch(()=>{}),()=>{S.pause(),S.loop=C,S.muted=N,S.currentTime=A}},T=()=>{if(!a){a=!0,r?.disconnect(),r=null;for(let E of t)u(E);for(let E of n)hi(E,!0);n.length=0,i&&(hi(i,!0),i=null)}};document.body&&(r=new MutationObserver(()=>c()),r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[Fn]}));let M={refresh:c,redraw:m,redrawAnimated:p,waitForActiveLuts:f,setGrading:b,setCompare:s,setSourceVisibility:v,getStatus:x,renderPreviews:_,startPreviewPlayback:R,destroy:T},F=window;return F.__hf=F.__hf||{},F.__hf.colorGrading=M,c(),M}var vi=class{constructor(t){ge(this,"_baseTime",0);ge(this,"_playStartMs",null);ge(this,"_rate",1);ge(this,"_duration",1/0);ge(this,"_nowMs");ge(this,"_audioSource",null);this._baseTime=t?.initialTime??0,this._rate=t?.rate??1,this._duration=t?.duration??1/0,this._nowMs=t?.nowMs??(()=>performance.now())}now(){if(this._playStartMs===null)return this._baseTime;if(this._audioSource){let r=null;if("currentTimeSeconds"in this._audioSource)r=this._audioSource.currentTimeSeconds;else{let{el:i,compositionStart:o,mediaStart:a}=this._audioSource;!i.paused&&Number.isFinite(i.currentTime)&&(r=(i.currentTime-a)/(i.playbackRate>0?i.playbackRate:1)*this._rate+o)}if(r!==null)return Number.isFinite(this._duration)&&r>=this._duration?this._duration:Math.max(0,r)}let t=(this._nowMs()-this._playStartMs)/1e3,n=this._baseTime+t*this._rate;return Number.isFinite(this._duration)&&n>=this._duration?this._duration:Math.max(0,n)}play(){return this._playStartMs!==null||Number.isFinite(this._duration)&&this._baseTime>=this._duration?!1:(this._playStartMs=this._nowMs(),!0)}pause(){return this._playStartMs===null?!1:(this._baseTime=this.now(),this._playStartMs=null,!0)}seek(t){let n=Number.isFinite(this._duration)?Math.max(0,Math.min(t,this._duration)):Math.max(0,t);this._baseTime=n,this._playStartMs!==null&&(this._playStartMs=this._nowMs())}isPlaying(){return this._playStartMs!==null}setRate(t){let n=Number.isFinite(t)&&t>0?Math.max(.1,Math.min(5,t)):1;this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs()),this._rate=n}getRate(){return this._rate}setDuration(t){this._duration=Number.isFinite(t)&&t>0?t:1/0,this._baseTime>this._duration&&(this._baseTime=this._duration)}getDuration(){return this._duration}attachAudioSource(t){this._audioSource=t}detachAudioSource(){this._audioSource&&this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs()),this._audioSource=null}hasAudioSource(){return this._audioSource!==null}getSource(){if(this._audioSource&&this._playStartMs!==null){if("currentTimeSeconds"in this._audioSource)return"audio";let{el:t}=this._audioSource;if(!t.paused&&Number.isFinite(t.currentTime))return"audio"}return"monotonic"}snapshot(){return{time:this.now(),playing:this.isPlaying(),rate:this._rate,duration:this._duration,source:this.getSource()}}reachedEnd(){return Number.isFinite(this._duration)&&this.now()>=this._duration}};var xx=100,yx=8,vx=4096,Va=e=>e;function Sx(e,t,n){return!(!!e.curve||e.viaX!==void 0&&e.viaY!==void 0)&&t==="linear"&&!n}function Ax(e){let t=Math.ceil(e*xx);return Math.min(vx,Math.max(yx,t))}function Ex(e,t,n,r,i){let{scheduledAt:o,elapsed:a,rate:l}=r,s=i??Va,u=R=>o+(R-a)/l,c=e.points[t],m=e.points[t+1],f=u(m.t);if(f<=o)return null;let p=Math.max(o,u(c.t)),b=f-p;if(b<=0)return null;if(Sx(c,n,i))return{kind:"ramp",time:f,value:s(m.v)};let v=Ax(b),x=_l(e,Math.max(c.t,a),m.t,v,n),_=new Float32Array(v);for(let R=0;R<v;R+=1)_[R]=s(x[R]??0);return{kind:"curve",time:p,duration:b,values:_}}function wx(e,t,n,r){let i=[];for(let a=0;a+1<e.points.length;a+=1){let l=Ex(e,a,t,n,r);l&&i.push(l)}let o=i[0];return o?.kind==="curve"&&o.time<=n.scheduledAt||i.unshift({kind:"set",time:n.scheduledAt,value:(r??Va)(_n(e,n.elapsed,t))}),i}function Cx(e,t){for(let n of t)if(n.kind==="set")e.setValueAtTime(n.value,n.time);else if(n.kind==="ramp")e.linearRampToValueAtTime(n.value,n.time);else try{e.setValueCurveAtTime(n.values,n.time,n.duration)}catch{let r=n.values[n.values.length-1]??0;e.linearRampToValueAtTime(r,n.time+n.duration)}}function lr(e){for(let t of e)t.param.cancelScheduledValues(0)}function on(e,t){for(let n of e)typeof n.param.cancelAndHoldAtTime=="function"?n.param.cancelAndHoldAtTime(t):n.param.cancelScheduledValues(t)}function za(e,t,n,r){if(t.points.length!==0)for(let i of e){if(lr([i]),Cl(t)){let o=(i.map??Va)(t.points[0].v);i.param.setValueAtTime(o,r.scheduledAt);continue}Cx(i.param,wx(t,n,r,i.map))}}function Qd(e,t,n,r,i){let o=new Map(n.filter(l=>l.id).map(l=>[l.id,l.handle])),a=[];for(let l of e.lanes){let s=Cn(l.target);if(!s)continue;let u=s.kind==="preset"?i?.[s.presetId]:s.kind==="fx"?o.get(s.nodeId)?.automation?.[s.param]:void 0;if(!u||u.length===0)continue;let c=co(l.target,t);c&&(za(u,l,c.scale,r),a.push(...u))}return a}function Zd(e){return e.lanes.find(t=>t.target===Ut)??null}var _x=`
368
+ `);function Lt(e){return e instanceof HTMLVideoElement||e instanceof HTMLImageElement}function Sd(e){let t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function Ad(e,t,n){let r=e.createShader(n);return r?(e.shaderSource(r,t),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(L("runtime.colorGrading.compileShader",e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function xi(e,t=Eb){let n=Ad(e,Ab,e.VERTEX_SHADER),r=Ad(e,t,e.FRAGMENT_SHADER);if(!n||!r)return n&&e.deleteShader(n),r&&e.deleteShader(r),null;let i=e.createProgram();return i?(e.attachShader(i,n),e.attachShader(i,r),e.linkProgram(i),e.deleteShader(n),e.deleteShader(r),e.getProgramParameter(i,e.LINK_STATUS)?i:(L("runtime.colorGrading.linkProgram",e.getProgramInfoLog(i)),e.deleteProgram(i),null)):null}function pi(e,t=e.LINEAR,n=e.UNSIGNED_BYTE){let r=e.createTexture();return r?(e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,n,null),r):null}function Tb(e,t){let n=xi(e,wb);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),resolution:e.getUniformLocation(n,"u_resolution"),direction:e.getUniformLocation(n,"u_direction"),radius:e.getUniformLocation(n,"u_radius"),bloomPass:e.getUniformLocation(n,"u_bloomPass"),threshold:e.getUniformLocation(n,"u_threshold")}:null}function Rb(e,t){let n=xi(e,Cb);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),blurSource:e.getUniformLocation(n,"u_blurSource"),texel:e.getUniformLocation(n,"u_texel"),uvScale:e.getUniformLocation(n,"u_uvScale"),uvOffset:e.getUniformLocation(n,"u_uvOffset"),blurReady:e.getUniformLocation(n,"u_blurReady"),blur:e.getUniformLocation(n,"u_blur"),radius:e.getUniformLocation(n,"u_kuwaharaRadius")}:null}function kb(e,t){let n=xi(e,_b);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),moments:e.getUniformLocation(n,"u_kuwaharaMoments"),texel:e.getUniformLocation(n,"u_texel"),radius:e.getUniformLocation(n,"u_kuwaharaRadius"),sharpness:e.getUniformLocation(n,"u_kuwaharaSharpness"),saturation:e.getUniformLocation(n,"u_kuwaharaSaturation")}:null}function ir(e,t=e.UNSIGNED_BYTE,n=e.LINEAR){let r=pi(e,n,t),i=e.createFramebuffer();if(!r||!i)return r&&e.deleteTexture(r),i&&e.deleteFramebuffer(i),null;e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),o!==e.FRAMEBUFFER_COMPLETE?(e.deleteTexture(r),e.deleteFramebuffer(i),null):{texture:r,framebuffer:i,type:t,width:1,height:1}}function gi(e,t,n,r){t.width===n&&t.height===r||(t.width=n,t.height=r,e.bindTexture(e.TEXTURE_2D,t.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,r,0,e.RGBA,t.type,null))}function Ia(e,t,n){let r=[];for(let i of n){let o=e.getUniformLocation(t,`u_${i}`);o!==null&&r.push([i,o])}return r}function Ed(e,t,n){t&&e.deleteProgram(t);for(let r of n)r&&e.deleteTexture(r)}function Ga(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});if(!t)return null;let n=xi(t),r=pi(t),i=pi(t,t.NEAREST),o=pi(t,t.NEAREST);if(!n||!r||!i||!o)return Ed(t,n,[r,i,o]),null;let a=t.createBuffer();return a?(t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW),{gl:t,program:{program:n,texture:r,lutTexture:i,advancedTexture:o,advancedSignature:null,quad:a,position:t.getAttribLocation(n,"a_pos"),source:t.getUniformLocation(n,"u_source"),blurSource:t.getUniformLocation(n,"u_blurSource"),bloomSource:t.getUniformLocation(n,"u_bloomSource"),kuwaharaSource:t.getUniformLocation(n,"u_kuwaharaSource"),lut:t.getUniformLocation(n,"u_lut"),advanced:t.getUniformLocation(n,"u_advanced"),resolution:t.getUniformLocation(n,"u_resolution"),uvScale:t.getUniformLocation(n,"u_uvScale"),uvOffset:t.getUniformLocation(n,"u_uvOffset"),blurReady:t.getUniformLocation(n,"u_blurReady"),bloomReady:t.getUniformLocation(n,"u_bloomReady"),kuwaharaReady:t.getUniformLocation(n,"u_kuwaharaReady"),lutEnabled:t.getUniformLocation(n,"u_lutEnabled"),lutSize:t.getUniformLocation(n,"u_lutSize"),lutTextureSize:t.getUniformLocation(n,"u_lutTextureSize"),lutDomainMin:t.getUniformLocation(n,"u_lutDomainMin"),lutDomainMax:t.getUniformLocation(n,"u_lutDomainMax"),lutIntensity:t.getUniformLocation(n,"u_lutIntensity"),shadowWheel:t.getUniformLocation(n,"u_shadowWheel"),midtoneWheel:t.getUniformLocation(n,"u_midtoneWheel"),highlightWheel:t.getUniformLocation(n,"u_highlightWheel"),rgbCurvesEnabled:t.getUniformLocation(n,"u_rgbCurvesEnabled"),hueCurvesEnabled:t.getUniformLocation(n,"u_hueCurvesEnabled"),secondaryCount:t.getUniformLocation(n,"u_secondaryCount"),adjustUniforms:Ia(t,n,zr),detailUniforms:Ia(t,n,No),effectUniforms:Ia(t,n,Lo),grainSeed:t.getUniformLocation(n,"u_grainSeed"),effectTime:t.getUniformLocation(n,"u_effectTime"),paletteSize:t.getUniformLocation(n,"u_paletteSize"),palette0:t.getUniformLocation(n,"u_palette0"),palette1:t.getUniformLocation(n,"u_palette1"),palette2:t.getUniformLocation(n,"u_palette2"),palette3:t.getUniformLocation(n,"u_palette3"),palette4:t.getUniformLocation(n,"u_palette4"),palette5:t.getUniformLocation(n,"u_palette5"),intensity:t.getUniformLocation(n,"u_intensity"),compareEnabled:t.getUniformLocation(n,"u_compareEnabled"),comparePosition:t.getUniformLocation(n,"u_comparePosition"),compareSoftness:t.getUniformLocation(n,"u_compareSoftness"),compareLineWidth:t.getUniformLocation(n,"u_compareLineWidth")}}):(Ed(t,n,[r,i,o]),null)}function Mb(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Fb(e){if(!Mb(e))return{...rn};let t=(n,r,i,o)=>{let a=typeof n=="number"?n:Number(n);return Math.min(o,Math.max(i,Number.isFinite(a)?a:r))};return{enabled:e.enabled===!0,position:t(e.position,rn.position,0,1),softness:t(e.softness,rn.softness,0,.25),lineWidth:t(e.lineWidth,rn.lineWidth,0,12)}}function Fd(e){try{let t=new URL(e,document.baseURI);return t.protocol==="data:"?{href:t.href}:t.protocol!=="http:"&&t.protocol!=="https:"?{error:"LUT must be project-local or a data URL"}:t.origin!==window.location.origin?{error:"Remote LUT URLs are not supported"}:{href:t.href}}catch{return{error:"Invalid LUT URL"}}}function yi(e){return e instanceof Error?e.message:"LUT failed to load"}function Nb(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0)%1e4}function Nd(e){let t=e.id||e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return Nb(t)}function Ba(e){let t=Fd(e);if("error"in t)return{state:"error",message:t.error};let n=it.get(t.href);if(n)return n;let r=fetch(t.href,{credentials:"same-origin"}).then(o=>{if(!o.ok)throw new Error(`Failed to load LUT (${o.status})`);return o.text()}).then(o=>Ul(o,{maxSize:Br})),i={state:"pending",promise:r};for(;it.size>=hb;){let o=it.keys().next().value;if(!o)break;it.delete(o)}return it.set(t.href,i),r.then(o=>{it.get(t.href)===i&&it.set(t.href,{state:"ready",lut:o})},o=>{it.get(t.href)===i&&it.set(t.href,{state:"error",message:yi(o)})}),i}function wd(e,t,n){if(e.lut?.src===t)return e.lut;let r=Eo(n),{gl:i,program:o}=e;try{return Ld(i,o.lutTexture,r),e.lut={src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height},e.lutError=null,e.lutLoadingSrc=null,e.lut}catch(a){return e.lut=null,e.lutError=yi(a),e.lutLoadingSrc=null,L("runtime.colorGrading.uploadLut",a),null}}async function Lb(e){let t=Ba(e);if(t.state==="ready")return t.lut;if(t.state==="pending")return t.promise;throw new Error(t.message)}function Ld(e,t,n){e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)}function Db(e,t,n){let r=Eo(n),{gl:i,program:o}=e;return Ld(i,o.lutTexture,r),{src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height}}function Je(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function Ua(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),Je(e.gl,t.scratch),Je(e.gl,t.blur),t.bloom&&Je(e.gl,t.bloom),e.effectTargets=null)}function Wa(e){let t=e.kuwaharaTargets;t&&(e.gl.deleteProgram(t.horizontalProgram.program),e.gl.deleteProgram(t.resolveProgram.program),Je(e.gl,t.moments),Je(e.gl,t.output),e.kuwaharaTargets=null)}function hi(e,t=!1){Ua(e),Wa(e),Ib(e.gl,e.program),t&&e.gl.getExtension("WEBGL_lose_context")?.loseContext()}function Ib(e,t){e.deleteTexture(t.texture),e.deleteTexture(t.lutTexture),e.deleteTexture(t.advancedTexture),e.deleteBuffer(t.quad),e.deleteProgram(t.program)}function Pb(e){let t=Ga(e.canvas);return t?(hi(e),e.gl=t.gl,e.program=t.program,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function Ha(e){if(!e.sourceHidden)return;e.element.removeAttribute(Nn);let t=e.element.style.getPropertyValue("opacity"),n=e.element.style.getPropertyPriority("opacity");t==="0"&&n==="important"&&(e.sourceInlineOpacity===null?e.element.style.removeProperty("opacity"):e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority)),e.sourceHidden=!1}function Ob(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=Tb(t,e.program.quad),r=ir(t),i=ir(t);return!n||!r||!i?(n&&t.deleteProgram(n.program),r&&Je(t,r),i&&Je(t,i),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:r,blur:i,bloom:null},e.effectTargets)}function Hb(e,t){return t.bloom||(t.bloom=ir(e.gl),e.effectError=t.bloom?null:"Framebuffer effects unavailable"),t.bloom}function Cd(e){let t=e.effectTargets;t?.bloom&&(Je(e.gl,t.bloom),t.bloom=null)}function Gb(e){if(e.kuwaharaTargets)return e.kuwaharaTargets;let{gl:t}=e,n=t.getExtension("OES_texture_half_float"),r=t.getExtension("EXT_color_buffer_half_float");if(!n||!r)return e.effectError="Kuwahara requires half-float framebuffer support",null;let i=Rb(t,e.program.quad),o=kb(t,e.program.quad),a=ir(t,n.HALF_FLOAT_OES,t.NEAREST),l=ir(t);return!i||!o||!a||!l?(Bb(t,i,o,a,l),e.effectError="Kuwahara framebuffer effects unavailable",null):(e.kuwaharaTargets={horizontalProgram:i,resolveProgram:o,moments:a,output:l},e.kuwaharaTargets)}function Bb(e,t,n,r,i){t&&e.deleteProgram(t.program),n&&e.deleteProgram(n.program),r&&Je(e,r),i&&Je(e,i)}function Dd(e,t,n,r,i){let o=Math.max(1,Math.ceil(r)),a=Math.max(1,Math.ceil(i));return gi(e,t,o,a),gi(e,n,o,a),{width:o,height:a}}function bi(e,t,n,r,i,o,a,l=!1,s=-1){e.bindFramebuffer(e.FRAMEBUFFER,r.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(t.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(t.source,0),e.uniform2f(t.resolution,i.width,i.height),e.uniform2f(t.direction,o.x,o.y),e.uniform1f(t.radius,a),e.uniform1f(t.bloomPass,l?1:0),e.uniform1f(t.threshold,s),or(e,t)}function Ub(e,t,n,r,i,o,a){let l=Dd(e,t.scratch,r,i/2,o/2),s=a/2;bi(e,t.blurProgram,n,t.scratch,l,{x:1,y:0},s,!0,.5),bi(e,t.blurProgram,t.scratch.texture,r,l,{x:0,y:1},s,!0)}function Wb(e,t,n,r,i,o,a){let l=n;for(let s=0;s<Math.max(1,Math.floor(a));s++)bi(e,t.blurProgram,l,t.scratch,i,{x:1,y:0},o),bi(e,t.blurProgram,t.scratch.texture,r,i,{x:0,y:1},o),l=r.texture}function or(e,t){e.bindBuffer(e.ARRAY_BUFFER,t.quad),e.enableVertexAttribArray(t.position),e.vertexAttribPointer(t.position,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLE_STRIP,0,4)}function Vb(e,t,n,r,i,o,a,l){gi(e,t.moments,i.width,i.height),gi(e,t.output,i.width,i.height);let s=t.horizontalProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.moments.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(s.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,r),e.uniform1i(s.source,0),e.uniform1i(s.blurSource,1),e.uniform2f(s.texel,1/i.width,1/i.height),e.uniform2f(s.uvScale,o.scaleX,o.scaleY),e.uniform2f(s.uvOffset,o.offsetX,o.offsetY),e.uniform1f(s.blurReady,a?1:0),e.uniform1f(s.blur,l.blur),e.uniform1f(s.radius,l.kuwaharaRadius),or(e,s);let u=t.resolveProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.output.framebuffer),e.useProgram(u.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.moments.texture),e.uniform1i(u.moments,0),e.uniform2f(u.texel,1/i.width,1/i.height),e.uniform1f(u.radius,l.kuwaharaRadius),e.uniform1f(u.sharpness,l.kuwaharaSharpness),e.uniform1f(u.saturation,l.kuwaharaSaturation),or(e,u)}function zb(e,t,n,r){if(n<=0)return!1;let i=Dd(e.gl,t.scratch,t.blur,r.width,r.height);return Wb(e.gl,t,e.program.texture,t.blur,i,.75+Math.pow(n,1.35)*32,n>.55?3:2),!0}function qb(e,t,n,r,i,o){if(n<=0)return Cd(e),null;o||Cd(e);let a=o?Hb(e,t):t.blur;return a?(Ub(e.gl,t,e.program.texture,a,i.width,i.height,r),a.texture):null}function $b(e,t,n,r){let{program:i}=e,o=t.effects.blur,a=t.effects.bloom;if(o<=0&&a<=0)return e.effectTargets&&r&&Ua(e),{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let l=Ob(e);if(!l)return{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let s=zb(e,l,o,n),u=qb(e,l,a,t.effects.bloomRadius,n,s);return{blurReady:s,bloomReady:u!==null,blurTexture:l.blur.texture,bloomTexture:u??i.texture}}function jb(e,t,n,r,i,o,a){let l=t.effects.kuwahara;if(l<=0&&!o)return e.kuwaharaTargets&&a&&Wa(e),{kuwaharaReady:!1,kuwaharaTexture:e.program.texture};let s=Gb(e);return!s||l<=0?{kuwaharaReady:!1,kuwaharaTexture:s?.output.texture??e.program.texture}:(Vb(e.gl,s,e.program.texture,e.effectTargets?.blur.texture??e.program.texture,n,r,i,t.effects),{kuwaharaReady:!0,kuwaharaTexture:s.output.texture})}function Id(e,t,n,r,i={}){let o=i.releaseIdleTargets??!0;e.effectError=null;let a=$b(e,t,n,o),l=jb(e,t,n,r,a.blurReady,i.preserveKuwahara??!1,o);return{...a,...l}}function Kb(e){let t=e.grading.lut?.src.trim()??"",n=e.grading.lut?.intensity??1;if(!t||n<=0)return e.lut=null,e.lutLoadingSrc=null,e.lutError=null,null;let r=Fd(t);if("error"in r)return e.lut=null,e.lutLoadingSrc=null,e.lutError=r.error,null;if(e.lut?.src===r.href)return e.lut;e.lut=null;let i=Ba(t);return i.state==="ready"?wd(e,r.href,i.lut):i.state==="error"?(e.lutError=i.message,e.lutLoadingSrc=null,null):(e.lutLoadingSrc!==r.href&&(e.lutLoadingSrc=r.href,e.lutError=null,i.promise.then(o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(wd(e,r.href,o),De(e))},o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=yi(o),e.lutLoadingSrc=null,De(e))})),null)}function nr(e){if(!e)return null;if(typeof e=="string"){let t=e.trim();if(!t)return null;let n=document.getElementById(t.replace(/^#/,""));if(n&&Lt(n))return n;try{let r=document.querySelector(t);return r&&Lt(r)?r:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&Lt(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&Lt(t))return t}if(!e.selector)return null;try{let t=Array.from(document.querySelectorAll(e.selector)),n=Math.max(0,Math.floor(Number(e.selectorIndex??0)||0)),r=t[n]??null;return r&&Lt(r)?r:null}catch{return null}}function Pd(e){return e instanceof HTMLVideoElement?e.videoWidth>0&&e.videoHeight>0?{width:e.videoWidth,height:e.videoHeight}:null:e instanceof HTMLImageElement&&e.naturalWidth>0&&e.naturalHeight>0?{width:e.naturalWidth,height:e.naturalHeight}:null}function Od(e){return e instanceof HTMLVideoElement?e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&e.videoWidth>0&&e.videoHeight>0:e instanceof HTMLImageElement?e.complete&&e.naturalWidth>0&&e.naturalHeight>0:!1}function Hd(e){let t=ut(e);return t&&Od(t)?t:null}function _d(e){if(!(e instanceof HTMLVideoElement))return!1;let t=Hd(e);if(!t)return!1;let n=window.getComputedStyle(t);return n.display!=="none"&&n.visibility!=="hidden"}function Yb(e){return e instanceof HTMLImageElement&&e.classList.contains("__render_frame__")}function Xb(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}function Gd(e){if(e instanceof HTMLVideoElement){let t=Hd(e);if(t)return t}return Od(e)?e:null}function Td(e,t){let n=e.toLowerCase();if(n==="center")return .5;if(t==="x"){if(n==="left")return 0;if(n==="right")return 1}else{if(n==="top")return 0;if(n==="bottom")return 1}if(n.endsWith("%")){let r=Number.parseFloat(n);return Number.isFinite(r)?r/100:null}return null}function Jb(e){let t=e.trim().split(/\s+/).filter(Boolean),n=.5,r=.5;for(let i=0;i<t.length;i++){let o=t[i]??"",a=Td(o,"x"),l=Td(o,"y");if(a!==null&&(o==="left"||o==="right"||o.endsWith("%")&&i===0)){n=a;continue}if(l!==null&&(o==="top"||o==="bottom"||o.endsWith("%")&&i>0)){r=l;continue}}return{x:n,y:r}}function Bd(e,t,n,r,i,o){if(e<=0||t<=0||n<=0||r<=0)return{scaleX:1,scaleY:1,offsetX:0,offsetY:0};let a=i||"fill",l=e,s=t;if(a==="contain"||a==="cover"||a==="scale-down"){let f=a==="cover"?Math.max(e/n,t/r):Math.min(e/n,t/r);l=n*f,s=r*f,a==="scale-down"&&l>n&&s>r&&(l=n,s=r)}else a==="none"&&(l=n,s=r);let u=Jb(o||"center"),c=(e-l)*u.x/e,m=(t-s)*u.y/t;return{scaleX:l/e,scaleY:s/t,offsetX:c,offsetY:m}}function Qb(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function Rd(e,t){return Math.max(0,Math.round(e>0?e:t))}function Zb(e,t){let{element:n,canvas:r}=e,i=n.parentElement;i&&Qb(e,i);let o=window.getComputedStyle(t);mu(r.style,o),r.style.pointerEvents="none",r.style.position="absolute",r.style.inset="auto",r.style.left=`${n.offsetLeft}px`,r.style.top=`${n.offsetTop}px`,r.style.right="auto",r.style.bottom="auto",r.style.width=`${n.offsetWidth}px`,r.style.height=`${n.offsetHeight}px`,r.style.display="block",r.style.opacity=e.sourceOpacityForCanvas,r.style.visibility=e.sourceVisibleForCanvas?"visible":"hidden";let a=n.getBoundingClientRect(),l=Rd(n.offsetWidth,a.width),s=Rd(n.offsetHeight,a.height);if(l<=0||s<=0)return r.style.display="none",null;let u=Math.max(1,window.devicePixelRatio||1),c=Math.round(l*u),m=Math.round(s*u);return r.width!==c&&(r.width=c),r.height!==m&&(r.height=m),{width:c,height:m}}function nn(e,t,n){e.uniform3f(t,Number.parseInt(n.slice(1,3),16)/255,Number.parseInt(n.slice(3,5),16)/255,Number.parseInt(n.slice(5,7),16)/255)}function Dt(e,t,n,r){e.set(r,(t*Ke+n)*4)}function yt(e,t){return Math.min(1,Math.max(1/255,(e*(127/t)+128)/255))}function Pa(e,t,n){return e.length>=3?Co(e,t,n):new Float32Array(Ke)}function Nt(e,t){return e[t]??0}function ex(e,t,n){let r=zt(t.red),i=zt(t.green),o=zt(t.blue),a=zt(t.master),l=Pa(n.hueVsHue,-180,180),s=Pa(n.hueVsSaturation,-1,1),u=Pa(n.hueVsLuma,-1,1);for(let c=0;c<Ke;c+=1)Dt(e,0,c,[Nt(r,c),Nt(i,c),Nt(o,c),Nt(a,c)]),Dt(e,1,c,[yt(Nt(l,c),180),yt(Nt(s,c),1),yt(Nt(u,c),1),1])}function tx(e,t,n){let r=n*yb;Dt(e,2,r,[t.key.hue.center/360,t.key.hue.range/180,t.key.hue.softness/180,1]),Dt(e,2,r+1,[t.key.saturation.min,t.key.saturation.max,t.key.saturation.softness/.5,0]),Dt(e,2,r+2,[t.key.luma.min,t.key.luma.max,t.key.luma.softness/.5,0]),Dt(e,2,r+3,[yt(t.correction.hueShift,180),yt(t.correction.saturation,1),yt(t.correction.luma,1),yt(t.correction.temperature,1)]),Dt(e,2,r+4,[yt(t.correction.tint,1),.5,.5,1])}function nx(e,t,n){let r=new Float32Array(Ke*sr*4);ex(r,e,t);let i=0;for(let o of n)o.enabled&&(tx(r,o,i),i+=1);return r}var kd=new WeakMap;function rx(e,t,n){let r=kd.get(e);if(r?.hueCurves===t&&r.secondaries===n)return r.signature;let i=JSON.stringify([e,t,n]);return kd.set(e,{hueCurves:t,secondaries:n,signature:i}),i}function ix(e,t,n,r){let{curves:i,hueCurves:o}=n,a=rx(i,o,r);if(t.advancedSignature===a)return;let l=Uint8Array.from(nx(i,o,r),kn);e.activeTexture(e.TEXTURE5),e.bindTexture(e.TEXTURE_2D,t.advancedTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,Ke,sr,0,e.RGBA,e.UNSIGNED_BYTE,l),t.advancedSignature=a}function Oa(e,t,n){e.uniform3f(t,n.hue/360,n.amount,n.level)}function Ud(e,t,n,r,i,o,a,l,s,u,c,m){e.uniform1i(t.source,0),e.uniform1i(t.blurSource,1),e.uniform1i(t.lut,2),e.uniform1i(t.kuwaharaSource,3),e.uniform1i(t.bloomSource,4),e.uniform1i(t.advanced,5),e.uniform2f(t.resolution,s.width,s.height),e.uniform2f(t.uvScale,u.scaleX,u.scaleY),e.uniform2f(t.uvOffset,u.offsetX,u.offsetY),e.uniform1f(t.blurReady,i?1:0),e.uniform1f(t.bloomReady,o?1:0),e.uniform1f(t.kuwaharaReady,a?1:0),e.uniform1f(t.lutEnabled,r?1:0),e.uniform1f(t.lutSize,r?.size??2),e.uniform2f(t.lutTextureSize,r?.textureWidth??1,r?.textureHeight??1),e.uniform3f(t.lutDomainMin,r?.domainMin[0]??0,r?.domainMin[1]??0,r?.domainMin[2]??0),e.uniform3f(t.lutDomainMax,r?.domainMax[0]??1,r?.domainMax[1]??1,r?.domainMax[2]??1),e.uniform1f(t.lutIntensity,n.lut?.intensity??0);let{curves:f,hueCurves:p,secondaries:b}=n,v=Po(f),x=Oo(p),_=Ho(b)?b.reduce((M,F)=>M+Number(F.enabled),0):0;(v||x||_>0)&&ix(e,t,n,b),Oa(e,t.shadowWheel,n.wheels.shadows),Oa(e,t.midtoneWheel,n.wheels.midtones),Oa(e,t.highlightWheel,n.wheels.highlights),e.uniform1f(t.rgbCurvesEnabled,v?1:0),e.uniform1f(t.hueCurvesEnabled,x?1:0),e.uniform1f(t.secondaryCount,_);for(let[M,F]of t.adjustUniforms)e.uniform1f(F,n.adjust[M]);for(let[M,F]of t.detailUniforms)e.uniform1f(F,n.details[M]);e.uniform1f(t.grainSeed,c),e.uniform1f(t.effectTime,m);for(let[M,F]of t.effectUniforms)e.uniform1f(F,n.effects[M]);let R=n.palette??(n.effects.engraving>0||n.effects.crosshatch>0?bb:La),T=R[R.length-1]??La[1];e.uniform1f(t.paletteSize,R.length),nn(e,t.palette0,R[0]??La[0]),nn(e,t.palette1,R[1]??T),nn(e,t.palette2,R[2]??T),nn(e,t.palette3,R[3]??T),nn(e,t.palette4,R[4]??T),nn(e,t.palette5,R[5]??T),e.uniform1f(t.intensity,n.intensity),e.uniform1f(t.compareEnabled,l.enabled?1:0),e.uniform1f(t.comparePosition,l.position),e.uniform1f(t.compareSoftness,l.softness),e.uniform1f(t.compareLineWidth,l.lineWidth)}function ox(e){if(!e.sourceHidden){let t=e.element.getAttribute(Vr);t!==null?(e.sourceInlineOpacity=t===""?null:t,e.sourceInlineOpacityPriority=""):(e.sourceInlineOpacity=e.element.style.getPropertyValue("opacity")||null,e.sourceInlineOpacityPriority=e.element.style.getPropertyPriority("opacity"))}e.element.setAttribute(Nn,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function ot(e){let t=su.find(n=>n.path===e);if(!t)throw new Error(`Missing color-grading animation property: ${e}`);return t}var Wd=ot("intensity"),Vd=ot("lut.intensity"),zd=ot("adjust.exposure"),qd=ot("effects.kuwahara"),$d=[["blur",ot("effects.blur")],["bloom",ot("effects.bloom")],["kuwahara",qd],["pixelate",ot("effects.pixelate")],["ascii",ot("effects.ascii")],["dither",ot("effects.dither")]],jd=[Wd,Vd,zd,...$d.map(([,e])=>e)];function It(e,t){let n=e.style.getPropertyValue(t.name);if(!n)return null;let r=Number(n);return Number.isFinite(r)?Math.min(t.max,Math.max(t.min,r)):null}function rr(e,t){return t!==null&&(du(t)||jd.some(n=>It(e,n)!==null))}function ax(e,t){let n=null;for(let[r,i]of $d){let o=It(e,i);o!==null&&(n??(n={...t.effects}),n[r]=o)}return n}function sx(e){let{element:t,grading:n}=e,r=It(t,Wd),i=It(t,Vd),o=It(t,zd),a=ax(t,n);if(![r,i,o].some(u=>u!==null)&&a===null)return n;let s={...n,adjust:o===null?n.adjust:{...n.adjust,exposure:o},effects:a??n.effects};return r!==null&&(s.intensity=r),n.lut&&i!==null&&(s.lut={...n.lut,intensity:i}),s}function Kd(e,t,n){e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)}function Yd(e,t,n){let r=[t.texture,n.blurTexture,t.lutTexture,n.kuwaharaTexture,n.bloomTexture,t.advancedTexture];for(let[i,o]of r.entries())e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,o)}function De(e){if(e.destroyed||e.contextLost)return!1;let t=Gd(e.element);if(!t)return e.hasDrawn||(e.canvas.style.display="none"),!1;let n=Pd(t);if(!n)return!1;let r=t instanceof HTMLElement?t:e.element,i=e.element.style.getPropertyValue("opacity"),o=e.element.style.getPropertyPriority("opacity"),a=e.sourceHidden&&i==="0"&&o==="important",l=e.element.style.getPropertyValue("visibility"),s=Yb(t);s&&Xb(e,t),a&&!s&&(e.sourceInlineOpacity!==null?e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority||""):e.element.style.removeProperty("opacity"));let u=window.getComputedStyle(s?t:e.element);e.sourceOpacityForCanvas=u.opacity||"1",a&&!s&&e.element.style.setProperty("opacity","0","important"),e.sourceVisibleForCanvas=(s||l!=="hidden")&&u.visibility!=="hidden";let c=Zb(e,r);if(!c)return!1;let m=window.getComputedStyle(r),f=Bd(c.width,c.height,n.width,n.height,m.objectFit,m.objectPosition),{gl:p,program:b}=e;try{let v=sx(e),x=Kb(e);Kd(p,b.texture,t);let _=It(e.element,qd)!==null,R=Id(e,v,c,f,{preserveKuwahara:_});p.bindFramebuffer(p.FRAMEBUFFER,null),p.viewport(0,0,c.width,c.height),p.useProgram(b.program),Yd(p,b,R);let T=window.__player?.getTime?.(),M=typeof T=="number"&&Number.isFinite(T)?Math.max(0,T):e.element instanceof HTMLVideoElement?Math.max(0,e.element.currentTime):0,F=e.grainSeed+Math.floor(M*60);return Ud(p,b,v,x,R.blurReady,R.bloomReady,R.kuwaharaReady,e.compare,c,f,F,M),or(p,b),ox(e),e.hasDrawn=!0,e.drawError=null,!0}catch(v){return e.drawError=v instanceof Error?v.message:"Shader draw failed",L("runtime.colorGrading.drawEntry",v),!1}}function lx(e,t,n){let r=e.getBoundingClientRect(),i=e.offsetWidth||r.width||t.width,o=e.offsetHeight||r.height||t.height,a=Math.min(320,Math.max(64,Math.round(n??160))),l=i>0&&o>0?i/o:t.width/t.height;return l>=1?{width:a,height:Math.max(1,Math.round(a/l))}:{width:Math.max(1,Math.round(a*l)),height:a}}function ux(){let e=document.createElement("canvas"),t=Ga(e);return t?{canvas:e,...t,lut:null,effectTargets:null,kuwaharaTargets:null,effectError:null}:null}function cx(e,t){let n=t?void 0:window.__player?.getTime?.();return typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):e instanceof HTMLVideoElement?Math.max(0,e.currentTime):0}function dx(e,t,n,r){let i=Gd(t);if(!i)return null;let o=Pd(i);if(!o)return null;let a=lx(t,o,n);e.canvas.width=a.width,e.canvas.height=a.height;let l=i instanceof HTMLElement?i:t,s=window.getComputedStyle(l),u=Bd(a.width,a.height,o.width,o.height,s.objectFit,s.objectPosition);return Kd(e.gl,e.program.texture,i),{dimensions:a,uv:u,effectTime:cx(t,r),grainSeed:Nd(t)+(t instanceof HTMLVideoElement?Math.floor(t.currentTime*60):0)}}async function fx(e,t,n,r,i=!1){let o=dx(e,t,r,i);if(!o)return null;let{dimensions:a,uv:l,grainSeed:s,effectTime:u}=o,c=[];for(let m of n.slice(0,32)){let f=qr(m.grading);if(!f){c.push({id:m.id,dataUrl:null,error:"Invalid grading"});continue}let p=null;try{f.lut&&(e.lut?.src!==f.lut.src&&(e.lut=Db(e,f.lut.src,await Lb(f.lut.src))),p=e.lut),c.push({id:m.id,dataUrl:mx(e,f,p,a,l,s,u)})}catch(b){c.push({id:m.id,dataUrl:null,error:yi(b)})}}return{...a,images:c}}function mx(e,t,n,r,i,o,a){let{canvas:l,gl:s,program:u}=e,c=Id(e,t,r,i,{releaseIdleTargets:!1});return s.bindFramebuffer(s.FRAMEBUFFER,null),s.viewport(0,0,r.width,r.height),s.useProgram(u.program),Yd(s,u,c),n||(e.lut=null),Ud(s,u,t,n,c.blurReady,c.bloomReady,c.kuwaharaReady,rn,r,i,o,a),or(s,u),l.toDataURL("image/png")}function Xe(e,t,n,r){t.addEventListener(n,r),e.cleanup.push(()=>t.removeEventListener(n,r))}function px(e){e.animationFrame!==null&&(window.cancelAnimationFrame(e.animationFrame),e.animationFrame=null),e.videoFrameHandle!==null&&e.element instanceof HTMLVideoElement&&(e.element.cancelVideoFrameCallback?.(e.videoFrameHandle),e.videoFrameHandle=null)}function ar(e){if(e.destroyed||!(e.element instanceof HTMLVideoElement)||e.videoFrameHandle!==null||e.animationFrame!==null)return;let t=e.element,n=t;if(typeof n.requestVideoFrameCallback=="function"){e.videoFrameHandle=n.requestVideoFrameCallback(()=>{e.videoFrameHandle=null,De(e),!e.destroyed&&!t.paused&&!t.ended&&ar(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,De(e),!e.destroyed&&!t.paused&&!t.ended&&ar(e)})}function hx(e){let t=()=>{De(e)};if(Xe(e,e.element,"load",t),Xe(e,e.element,"loadedmetadata",t),Xe(e,e.element,"loadeddata",t),Xe(e,e.element,"seeked",t),Xe(e,e.element,"timeupdate",t),Xe(e,window,"resize",t),e.element instanceof HTMLVideoElement&&(Xe(e,e.element,"play",()=>ar(e)),Xe(e,e.element,"pause",t)),Xe(e,e.canvas,"webglcontextlost",n=>{n.preventDefault(),e.contextLost=!0,e.drawError="WebGL context lost",e.canvas.style.display="none",Ha(e)}),Xe(e,e.canvas,"webglcontextrestored",()=>{if(e.contextLost=!1,!Pb(e)){e.contextLost=!0,e.drawError="WebGL context restore failed",Ha(e);return}e.drawError=null,De(e)}),typeof ResizeObserver<"u"&&(e.resizeObserver=new ResizeObserver(t),e.resizeObserver.observe(e.element)),typeof MutationObserver<"u"){let n=()=>{let a=e.element.style;return`${a.transform}|${a.translate}|${a.rotate}|${a.scale}|${a.left}|${a.top}|${a.width}|${a.height}`},r=n(),i=!1,o=new MutationObserver(()=>{i||n()!==r&&(i=!0,requestAnimationFrame(()=>{i=!1,r=n(),De(e)}))});o.observe(e.element,{attributes:!0,attributeFilter:["style"]}),e.cleanup.push(()=>o.disconnect())}}function gx(e){if(e.destroyed)return null;e.destroyed=!0,px(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();return e.cleanup.length=0,e.canvas.remove(),Ua(e),Wa(e),Ha(e),e.touchedParent&&(e.parentInlinePosition===null?e.touchedParent.style.removeProperty("position"):e.touchedParent.style.position=e.parentInlinePosition),{canvas:e.canvas,gl:e.gl,program:e.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}function Xd(e,t){return e.removeAttribute("style"),t.id?e.id=`${nu}${t.id}`:e.removeAttribute("id"),e.className=pb,e.setAttribute(mb,"true"),e.setAttribute("data-hyperframes-ignore",""),e.setAttribute("data-hyperframes-picker-ignore",""),e.setAttribute("data-hf-ignore",""),e.setAttribute("aria-hidden","true"),e.style.pointerEvents="none",e.style.display="none",t.parentNode?.insertBefore(e,t.nextSibling),e}function bx(e){return Xd(document.createElement("canvas"),e)}function Jd(){let e=new WeakMap,t=new Set,n=[],r=null,i=null,o=Promise.resolve(),a=!1,l=(E,S,A)=>{let C=e.get(E);if(C)return C.grading=S,C.source=A,De(C),E instanceof HTMLVideoElement&&!E.paused&&ar(C),!0;let N=n.pop();if(N)Xd(N.canvas,E);else{let W=bx(E),B=Ga(W);if(!B)return W.remove(),!1;N={canvas:W,gl:B.gl,program:B.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}let I={element:E,...N,grading:S,compare:{...rn},lut:null,lutLoadingSrc:null,lutError:null,drawError:null,effectTargets:null,kuwaharaTargets:null,effectError:null,source:A,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(E).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(E).visibility!=="hidden",hasDrawn:!1,contextLost:!1,grainSeed:Nd(E),destroyed:!1};return e.set(E,I),t.add(E),hx(I),De(I),E instanceof HTMLVideoElement&&!E.paused&&ar(I),!0},s=(E,S)=>{if(a)return!1;let A=nr(E);if(!A)return!1;let C=e.get(A);if(!C){let N=mi(A);if(!rr(A,N)||!l(A,N,"attribute"))return!1;C=e.get(A)}return C?(C.compare=Fb(S),De(C),!0):!1},u=E=>{let S=e.get(E);if(!S)return;let A=gx(S);A&&(S.contextLost||n.length>=gb?hi(A,!0):n.push(A)),e.delete(E),t.delete(E)},c=()=>{if(a)return 0;let E=new Set;document.querySelectorAll(`video[${Fn}], img[${Fn}]`).forEach(A=>{if(!Lt(A))return;E.add(A);let C=mi(A);rr(A,C)&&(Sd(A)||_d(A))?l(A,C,"attribute"):u(A)});for(let A of t){let C=e.get(A);C&&(!A.isConnected||C.source==="attribute"&&!E.has(A))&&u(A)}return t.size},m=()=>{if(a)return 0;let E=0;for(let S of t){let A=e.get(S);A&&De(A)&&(E+=1)}return E},f=async()=>{let E=new Set;for(let S of t){let A=e.get(S)?.grading.lut;if(!A?.src.trim()||(A.intensity??1)<=0)continue;let C=Ba(A.src);C.state==="pending"&&E.add(C.promise)}return E.size>0&&await Promise.allSettled(E),m(),E.size},p=()=>{if(a)return 0;let E=0;for(let S of t){let A=e.get(S);!A||!jd.some(N=>It(S,N)!==null)||S instanceof HTMLVideoElement&&!S.paused&&!S.ended||De(A)&&(E+=1)}return E},b=(E,S)=>{if(a)return!1;let A=nr(E);if(!A)return!1;let C=qr(S);return rr(A,C)?l(A,C,"live"):(u(A),!0)},v=(E,S)=>{if(!Lt(E))return!1;let A=e.get(E);if(!A){if(!S)return!1;let C=mi(E);return rr(E,C)&&l(E,C,"attribute")}return A.sourceVisibleForCanvas=S,!S&&A.source==="attribute"&&u(E),!0},x=E=>{let S=nr(E);if(!S)return{state:"missing",message:"Media not found"};let A=e.get(S);if(A)return A.effectError?{state:"unavailable",message:A.effectError}:A.drawError?{state:"unavailable",message:A.drawError}:A.lutError?{state:"unavailable",message:`LUT error: ${A.lutError}`}:A.grading.lut&&A.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:A.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:A.lut?"Shader + LUT active":"Shader active"};let C=mi(S);return rr(S,C)?!Sd(S)&&!_d(S)?{state:"pending",message:"Waiting for visible media"}:{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},_=async(E,S,A)=>{let C=async()=>{if(a||S.length===0)return null;let I=nr(E);return!I||(i??(i=ux()),!i)?null:fx(i,I,S,A?.maxDimension,A?.useMediaTime)},N=o.then(C,C);return o=N.then(()=>{},()=>{}),N},R=E=>{let S=nr(E);if(!(S instanceof HTMLVideoElement))return null;if(!S.paused)return()=>{};let A=S.currentTime,C=S.loop,N=S.muted;return S.loop=!0,S.muted=!0,(S.ended||Number.isFinite(S.duration)&&A>=S.duration)&&(S.currentTime=0),S.play().catch(()=>{}),()=>{S.pause(),S.loop=C,S.muted=N,S.currentTime=A}},T=()=>{if(!a){a=!0,r?.disconnect(),r=null;for(let E of t)u(E);for(let E of n)hi(E,!0);n.length=0,i&&(hi(i,!0),i=null)}};document.body&&(r=new MutationObserver(()=>c()),r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[Fn]}));let M={refresh:c,redraw:m,redrawAnimated:p,waitForActiveLuts:f,setGrading:b,setCompare:s,setSourceVisibility:v,getStatus:x,renderPreviews:_,startPreviewPlayback:R,destroy:T},F=window;return F.__hf=F.__hf||{},F.__hf.colorGrading=M,c(),M}var vi=class{constructor(t){ge(this,"_baseTime",0);ge(this,"_playStartMs",null);ge(this,"_rate",1);ge(this,"_duration",1/0);ge(this,"_nowMs");ge(this,"_audioSource",null);this._baseTime=t?.initialTime??0,this._rate=t?.rate??1,this._duration=t?.duration??1/0,this._nowMs=t?.nowMs??(()=>performance.now())}now(){if(this._playStartMs===null)return this._baseTime;if(this._audioSource){let r=null;if("currentTimeSeconds"in this._audioSource)r=this._audioSource.currentTimeSeconds;else{let{el:i,compositionStart:o,mediaStart:a}=this._audioSource;!i.paused&&Number.isFinite(i.currentTime)&&(r=(i.currentTime-a)/(i.playbackRate>0?i.playbackRate:1)*this._rate+o)}if(r!==null)return Number.isFinite(this._duration)&&r>=this._duration?this._duration:Math.max(0,r)}let t=(this._nowMs()-this._playStartMs)/1e3,n=this._baseTime+t*this._rate;return Number.isFinite(this._duration)&&n>=this._duration?this._duration:Math.max(0,n)}play(){return this._playStartMs!==null||Number.isFinite(this._duration)&&this._baseTime>=this._duration?!1:(this._playStartMs=this._nowMs(),!0)}pause(){return this._playStartMs===null?!1:(this._baseTime=this.now(),this._playStartMs=null,!0)}seek(t){let n=Number.isFinite(this._duration)?Math.max(0,Math.min(t,this._duration)):Math.max(0,t);this._baseTime=n,this._playStartMs!==null&&(this._playStartMs=this._nowMs())}isPlaying(){return this._playStartMs!==null}setRate(t){let n=Number.isFinite(t)&&t>0?Math.max(.1,Math.min(5,t)):1;this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs()),this._rate=n}getRate(){return this._rate}setDuration(t){this._duration=Number.isFinite(t)&&t>0?t:1/0,this._baseTime>this._duration&&(this._baseTime=this._duration)}getDuration(){return this._duration}attachAudioSource(t){this._audioSource=t}detachAudioSource(){this._audioSource&&this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs()),this._audioSource=null}hasAudioSource(){return this._audioSource!==null}getSource(){if(this._audioSource&&this._playStartMs!==null){if("currentTimeSeconds"in this._audioSource)return"audio";let{el:t}=this._audioSource;if(!t.paused&&Number.isFinite(t.currentTime))return"audio"}return"monotonic"}snapshot(){return{time:this.now(),playing:this.isPlaying(),rate:this._rate,duration:this._duration,source:this.getSource()}}reachedEnd(){return Number.isFinite(this._duration)&&this.now()>=this._duration}};var xx=100,yx=8,vx=4096,Va=e=>e;function Sx(e,t,n){return!(!!e.curve||e.viaX!==void 0&&e.viaY!==void 0)&&t==="linear"&&!n}function Ax(e){let t=Math.ceil(e*xx);return Math.min(vx,Math.max(yx,t))}function Ex(e,t,n,r,i){let{scheduledAt:o,elapsed:a,rate:l}=r,s=i??Va,u=R=>o+(R-a)/l,c=e.points[t],m=e.points[t+1],f=u(m.t);if(f<=o)return null;let p=Math.max(o,u(c.t)),b=f-p;if(b<=0)return null;if(Sx(c,n,i))return{kind:"ramp",time:f,value:s(m.v)};let v=Ax(b),x=_l(e,Math.max(c.t,a),m.t,v,n),_=new Float32Array(v);for(let R=0;R<v;R+=1)_[R]=s(x[R]??0);return{kind:"curve",time:p,duration:b,values:_}}function wx(e,t,n,r){let i=[];for(let a=0;a+1<e.points.length;a+=1){let l=Ex(e,a,t,n,r);l&&i.push(l)}let o=i[0];return o?.kind==="curve"&&o.time<=n.scheduledAt||i.unshift({kind:"set",time:n.scheduledAt,value:(r??Va)(_n(e,n.elapsed,t))}),i}function Cx(e,t){for(let n of t)if(n.kind==="set")e.setValueAtTime(n.value,n.time);else if(n.kind==="ramp")e.linearRampToValueAtTime(n.value,n.time);else try{e.setValueCurveAtTime(n.values,n.time,n.duration)}catch{let r=n.values[n.values.length-1]??0;e.linearRampToValueAtTime(r,n.time+n.duration)}}function lr(e){for(let t of e)t.param.cancelScheduledValues(0)}function on(e,t){for(let n of e)typeof n.param.cancelAndHoldAtTime=="function"?n.param.cancelAndHoldAtTime(t):n.param.cancelScheduledValues(t)}function za(e,t,n,r){if(t.points.length!==0)for(let i of e){if(lr([i]),Cl(t)){let o=(i.map??Va)(t.points[0].v);i.param.setValueAtTime(o,r.scheduledAt);continue}Cx(i.param,wx(t,n,r,i.map))}}function Qd(e,t,n,r,i){let o=new Map(n.filter(l=>l.id).map(l=>[l.id,l.handle])),a=[];for(let l of e.lanes){let s=Cn(l.target);if(!s)continue;let u=s.kind==="preset"?i?.[s.presetId]:s.kind==="fx"?o.get(s.nodeId)?.automation?.[s.param]:void 0;if(!u||u.length===0)continue;let c=co(l.target,t);c&&(za(u,l,c.scale,r),a.push(...u))}return a}function Zd(e){return e.lanes.find(t=>t.target===Ut)??null}var _x=`
369
369
  const dbToLin = (db) => Math.pow(10, db / 20);
370
370
 
371
371
  /**
@@ -701,9 +701,9 @@ class HfPitchshift extends AudioWorkletProcessor {
701
701
  }
702
702
  }
703
703
  registerProcessor("hf-pitchshift", HfPitchshift);
704
- `,qa=new WeakMap;function $a(e){return ef.has(e)}var ef=new WeakSet;function ja(e){let t=qa.get(e);return t||(t=(async()=>{if(!e.audioWorklet)throw new Error("AudioWorklet is unavailable \u2014 the page needs a secure context (https, localhost or file://)");let n=`data:text/javascript;base64,${btoa(String.fromCharCode(...new TextEncoder().encode(_x)))}`;await e.audioWorklet.addModule(n),ef.add(e)})().catch(n=>{throw qa.delete(e),n}),qa.set(e,t)),t}function Tx(e,t,n){let r=.6+Math.max(0,Math.min(1,t))*2.6,i=Math.max(1,Math.floor(e*r)),o=new Float32Array(i),a=Math.round(t*1e3)*2654435761+Math.round(n*1e3)*40503>>>0,l=()=>(a=a*1664525+1013904223>>>0,a/4294967295*2-1),s=Math.max(.001,1-Math.max(0,Math.min(1,n))),u=0,c=0;for(let f=0;f<i;f++){u+=s*(l()-u);let p=u*Math.pow(1-f/i,2.5);o[f]=p,c+=p*p}let m=Math.sqrt(c);if(m>0)for(let f=0;f<i;f++)o[f]=(o[f]??0)/m;return o}var ce=e=>typeof e=="number"?e:Number(e??0),Ka=e=>e/1e3;function of(e,t,n,r){let i=Math.max(1,Math.round(e.sampleRate)),o=e.createBuffer(1,i,e.sampleRate),a=o.getChannelData(0);for(let u=0;u<i;u++){let c=u/i;a[u]=t==="sine"?Math.sin(2*Math.PI*c):4*Math.abs((c+.75)%1-.5)-1}let l=e.createBufferSource();l.buffer=o,l.loop=!0,l.playbackRate.value=n;let s=(r*n%1+1)%1*(i/e.sampleRate);return l.start(typeof e.currentTime=="number"?e.currentTime:0,s),l}function af(e){try{e.stop()}catch{}e.disconnect()}function Ya(e,t){return[{param:e},{param:t,map:n=>1-n}]}function sf(e,t,n){e.gain.value=n,t.gain.value=1-n}function Xa(e,t,n){return{input:e,output:e,update:t,automation:n,dispose:()=>e.disconnect()}}var Rx=new Set(["peaking","highpass","lowpass"]),tf=e=>Math.pow(10,e/20),kx=(e,t)=>{let n=e.createGain(),r=i=>{n.gain.value=tf(ce(i.gain))};return r(t),Xa(n,r,{gain:[{param:n.gain,map:tf}]})};function ur(e,t){return(n,r)=>{let i=n.createBiquadFilter();i.type=e;let o=a=>{i.frequency.value=ce(a.frequency),a.q!==void 0&&(i.Q.value=ce(a.q)),t&&(i.gain.value=ce(a.gain))};return o(r),Xa(i,o,{frequency:[{param:i.frequency}],...Rx.has(e)?{q:[{param:i.Q}]}:{},...t?{gain:[{param:i.gain}]}:{}})}}function Mx(e){return(t,n)=>{let r=Math.tan(Math.PI*ce(n.frequency)/t.sampleRate),i=e==="highpass"?t.createIIRFilter([1/(1+r),-1/(1+r)],[1,(r-1)/(r+1)]):t.createIIRFilter([r/(1+r),r/(1+r)],[1,(r-1)/(r+1)]);return Xa(i,()=>{})}}function cr(e){return(t,n)=>{let r=new AudioWorkletNode(t,e,{processorOptions:{...n}});return{input:r,output:r,update:i=>r.port.postMessage({...i}),dispose:()=>{r.port.postMessage({__hfDispose:!0}),r.disconnect()}}}}var Fx={tanh:Math.tanh,atan:e=>2/Math.PI*Math.atan(Math.PI/2*e),cubic:e=>Math.abs(e)>=1?Math.sign(e):e-e**3/3,exp:e=>Math.sign(e)*(1-Math.exp(-Math.abs(e))),alg:e=>e/Math.sqrt(1+e*e),quintic:e=>Math.abs(e)>=1?Math.sign(e):e-e**5/5,sin:e=>Math.abs(e)>=1?Math.sign(e):Math.sin(Math.PI/2*e),erf:e=>Math.tanh(1.20211*e),hard:e=>Math.max(-1,Math.min(1,e))},Nx=(e,t)=>{let n=e.createWaveShaper(),r=e.createGain(),i=e.createGain();r.connect(n).connect(i);let o=a=>{let l=Fx[String(a.type)]??Math.tanh,s=Math.pow(10,ce(a.threshold)/20),u=8192,c=new Float32Array(u);for(let m=0;m<u;m++){let f=m/(u-1)*2-1;c[m]=l(f/Math.max(1e-6,s))*s}n.curve=c,n.oversample=ce(a.oversample)>=4?"4x":ce(a.oversample)>=2?"2x":"none",i.gain.value=Math.pow(10,ce(a.output)/20)};return o(t),{input:r,output:i,update:o,automation:{output:[{param:i.gain,map:a=>Math.pow(10,a/20)}]},dispose:()=>{r.disconnect(),n.disconnect(),i.disconnect()}}},Lx=(e,t)=>{let n=e.createGain(),r=e.createGain(),i=e.createDelay(5),o=e.createGain(),a=e.createGain(),l=e.createGain();n.connect(i),i.connect(o),o.connect(i),i.connect(a).connect(r),n.connect(l).connect(r);let s=u=>{i.delayTime.value=Math.min(5,ce(u.time)/1e3),o.gain.value=ce(u.feedback),sf(a,l,ce(u.mix))};return s(t),{input:n,output:r,update:s,automation:{time:[{param:i.delayTime,map:u=>Math.min(5,Ka(u))}],feedback:[{param:o.gain}],mix:Ya(a.gain,l.gain)},dispose:()=>[n,r,i,o,a,l].forEach(u=>u.disconnect())}},Dx=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createDelay(.5),a=of(e,"sine",ce(t.speed),n),l=e.createGain(),s=e.createGain(),u=e.createGain();a.connect(l).connect(o.delayTime),r.connect(o).connect(s).connect(i),r.connect(u).connect(i);let c=m=>{o.delayTime.value=ce(m.delay)/1e3,l.gain.value=ce(m.depth)/1e3,a.playbackRate.value=ce(m.speed),sf(s,u,ce(m.mix))};return c(t),{input:r,output:i,update:c,automation:{delay:[{param:o.delayTime,map:Ka}],depth:[{param:l.gain,map:Ka}],speed:[{param:a.playbackRate}],mix:Ya(s.gain,u.gain)},dispose:()=>{af(a),[r,i,o,l,s,u].forEach(m=>m.disconnect())}}},Ix=6,Px=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createGain(),a=e.createGain(),l=of(e,String(t.type)==="1"?"sine":"triangle",ce(t.speed),n),s=e.createGain(),u=e.createGain(),c=e.createGain(),m=[];r.connect(o);let f=o;for(let b=0;b<Ix;b++){let v=e.createBiquadFilter();v.type="allpass",v.Q.value=.7071,s.connect(v.frequency),f.connect(v),f=v,m.push(v)}l.connect(s),f.connect(u).connect(a),o.connect(c).connect(a),a.connect(i);let p=b=>{let v=1e3/Math.max(.1,ce(b.delay));for(let x of m)x.frequency.value=v;s.gain.value=v*ce(b.decay),l.playbackRate.value=ce(b.speed),o.gain.value=ce(b.in_gain),a.gain.value=ce(b.out_gain),u.gain.value=1,c.gain.value=1};return p(t),{input:r,output:i,update:p,automation:{speed:[{param:l.playbackRate}],in_gain:[{param:o.gain}],out_gain:[{param:a.gain}]},dispose:()=>{af(l),[r,i,o,a,s,u,c,...m].forEach(b=>b.disconnect())}}},Ox=(e,t)=>{let n=e.createGain(),r=e.createGain(),i=e.createConvolver(),o=e.createGain(),a=e.createGain();i.normalize=!1,n.connect(i).connect(o).connect(r),n.connect(a).connect(r);let l="",s=u=>{let c=`${ce(u.size)}:${ce(u.damping)}`;if(c!==l){let m=Tx(e.sampleRate,ce(u.size),ce(u.damping)),f=e.createBuffer(1,m.length,e.sampleRate);f.getChannelData(0).set(m),i.buffer=f,l=c}o.gain.value=ce(u.wet),a.gain.value=ce(u.dry)};return s(t),{input:n,output:r,update:s,automation:{wet:[{param:o.gain}],dry:[{param:a.gain}]},dispose:()=>[n,r,i,o,a].forEach(u=>u.disconnect())}},Hx={"gain-node":kx,"biquad-peaking":ur("peaking",!0),"biquad-lowshelf":ur("lowshelf",!0),"biquad-highshelf":ur("highshelf",!0),"biquad-highpass":ur("highpass",!1),"biquad-lowpass":ur("lowpass",!1),"worklet-compressor":cr("hf-compressor"),"worklet-limiter":cr("hf-limiter"),"worklet-gate":cr("hf-gate"),"worklet-bitcrush":cr("hf-bitcrush"),"worklet-pitchshift":cr("hf-pitchshift"),waveshaper:Nx,"delay-feedback":Lx,"chorus-lfo":Dx,"allpass-phaser":Px,convolver:Ox};function lf(e){return e.nodes.some(t=>Sn(t.type)?.web.startsWith("worklet-")??!1)}function Gx(e,t,n,r=0){let i=Sn(t);if(!i)throw new Error(`Unknown effect type: ${t}`);let o=An(t,n);if((t==="highpass"||t==="lowpass")&&String(o.poles)==="1")return Mx(t)(e,o,r);let a=Hx[i.web];if(!a)throw new Error(`No Web Audio builder for ${i.web}`);return a(e,o,r)}function nf(e){let t=[];for(let n of e){let r=n.fromPreset,i=t.at(-1);if(i&&i.preset===r)i.nodes.push(n);else{let o=typeof n.presetAmount=="number"?n.presetAmount:1;t.push({...r?{preset:r}:{},amount:Math.min(1,Math.max(0,o)),nodes:[n]})}}return t}function rf(e){return En(e).map(t=>{let n=An(t.type,t.params),r=n.poles!==void 0?`:${n.poles}`:"",i=String(n.poles)==="1"?`@${n.frequency}`:"",o=t.type==="phaser"?`~${n.type}`:"",a=t.fromPreset?`%${t.fromPreset}`:"";return`${t.type}${r}${i}${o}${a}`}).join("|")}function uf(e,t,n=0){var m;let r=e.createGain(),i=e.createGain(),o=[],a=[],l=nf(En(t)),s=r;for(let f of l){let p=null;if(f.preset){let b=e.createGain(),v=e.createGain(),x=e.createGain(),_=e.createGain();x.gain.value=f.amount,v.gain.value=1-f.amount,s.connect(b),b.connect(v).connect(_),p={entry:b,wet:x,dry:v,join:_},s=b}for(let b of f.nodes){let v=Gx(e,b.type,b.params??{},n);s.connect(v.input),s=v.output,o.push({...b.id?{id:b.id}:{},type:b.type,handle:v})}p&&f.preset&&(s.connect(p.wet).connect(p.join),a.push({id:f.preset,...p}),s=p.join)}s.connect(i);let u=rf(t),c={};for(let f of a)(c[m=f.id]??(c[m]=[])).push(...Ya(f.wet.gain,f.dry.gain));return{input:r,output:i,presets:c,nodes:o,update(f){if(rf(f)!==u)return!1;En(f).forEach((b,v)=>{let x=o[v];x&&(x.handle.update(An(b.type,b.params)),b.id===void 0?delete x.id:x.id=b.id)});let p=0;for(let b of nf(En(f))){if(!b.preset)continue;let v=a[p++];!v||v.id!==b.preset||(v.wet.gain.value=b.amount,v.dry.gain.value=1-b.amount)}return!0},dispose(){for(let{handle:f}of o)f.dispose();for(let{entry:f,wet:p,dry:b,join:v}of a)f.disconnect(),p.disconnect(),b.disconnect(),v.disconnect();r.disconnect(),i.disconnect()}}}var cf={version:1,nodes:[]},df={version:1,lanes:[]};function ff(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(tt):null)??"";if(!n)return df;try{return wl(Dr(n),t)}catch{return df}}function an(e){let t=(typeof e.getAttribute=="function"?e.getAttribute(Rt):null)??"";if(!t)return{chain:cf,raw:""};try{return{chain:Sl(t),raw:t}}catch{return{chain:cf,raw:""}}}function mf(e){return ff(e,an(e).chain)}function Si(e,t,n,r,i){let{chain:o}=an(t),a=null,l=[],s=!1,u=0,c=()=>{try{a?(n.disconnect(a.input),a.output.disconnect(r),a.dispose()):n.disconnect(r)}catch{}a=null},m=(T,M)=>{if(T.nodes.length===0){n.connect(r);return}if(lf(T)&&!$a(e)){n.connect(r);let F=++u;ja(e).then(()=>{s||F!==u||x(an(t).chain)}).catch(()=>{});return}try{let F=uf(e,T,M);n.connect(F.input),F.output.connect(r),a=F}catch{n.connect(r)}},f=(T,M)=>{l=M&&a?Qd(ff(t,T),T,a.nodes,M,a.presets):[]},p=i?{...i}:null;m(o,p?.elapsed??0),f(o,p);let b=()=>{if(!p)return null;let T=typeof e.currentTime=="number"?e.currentTime:p.scheduledAt;return{scheduledAt:T,elapsed:p.elapsed+(T-p.scheduledAt)*p.rate,rate:p.rate}},v=T=>{let M=b();M&&(on(l,M.scheduledAt),f(T,M))},x=T=>{let M=b();on(l,M?.scheduledAt??0),c(),m(T,M?.elapsed??0),f(T,M)},_=null,R=t;return typeof MutationObserver<"u"&&typeof R?.nodeType=="number"&&(_=new MutationObserver(()=>{let T=an(t);l.length>0&&lr(l),!a||!a.update(T.chain)?x(T.chain):v(T.chain)}),_.observe(R,{attributes:!0,attributeFilter:[Rt,tt]})),{reanchor:T=>{if(s)return;let M=b();M&&on(l,M.scheduledAt),p={...T},f(an(t).chain,p)},setRate:T=>{let M=b();s||!M||!Number.isFinite(T)||T<=0||T===M.rate||(p={...M,rate:T},on(l,M.scheduledAt),f(an(t).chain,p))},dispose:()=>{s=!0,_?.disconnect(),l.length>0&&on(l,typeof e.currentTime=="number"?e.currentTime:0),a?.dispose()}}}var pf="runtime_web_audio_bypass";function Ja(e,t){return typeof e.getAttribute=="function"?e.getAttribute(t):null}function dr(e,t){return Ja(e,t)!==null}function Bx(e){return dr(e,"crossorigin")?!0:e.crossOrigin!=null}function Ux(e){return typeof e.baseURI=="string"&&e.baseURI?e.baseURI:typeof document<"u"?document.baseURI:""}function Wx(e){let t=typeof e.currentSrc=="string"?e.currentSrc:"";if(t)return[t];let n=Ja(e,"src");if(n)return[n];if(typeof e.querySelectorAll!="function")return[];let r=[];for(let i of Array.from(e.querySelectorAll("source"))){let o=i.getAttribute("src");o&&r.push(o)}return r}function Vx(e,t){if(typeof window>"u")return!1;let n;try{n=new URL(e,Ux(t))}catch{return!1}return n.protocol!=="http:"&&n.protocol!=="https:"||n.origin===window.location.origin?!1:!Bx(t)}function gf(e){return(typeof e.currentSrc=="string"?e.currentSrc:"")?!0:dr(e,"src")}function sn(e){for(let t of Wx(e))if(Vx(t,e))return{kind:"decode-only",reason:"cross_origin_no_cors",asset:t};return{kind:"web-audio"}}function zx(e){let t=[];dr(e,Rt)&&t.push("fx-chain"),dr(e,tt)&&t.push("automation"),dr(e,Pr)&&t.push("audio-group");let n=Number.parseFloat(Ja(e,"data-volume")??"");return Number.isFinite(n)&&n>1&&t.push("above-unity-gain"),t}function qx(){return typeof window<"u"&&!!window.__HF_EXPORT_RENDER_SEEK_CONFIG}var hf=new WeakSet;function ln(e,t){if(t.kind==="web-audio"||qx()||hf.has(e))return;let n=zx(e);hf.add(e);let r={asset:t.asset,reason:t.reason,lostProcessing:n,note:"cross-origin media without a `crossorigin` opt-in is silent through createMediaElementSource (Web Audio spec); using native playback instead"};xe({source:"hf-preview",type:"diagnostic",code:pf,details:r});let i=n.length>0?` Native playback cannot reproduce: ${n.join(", ")} \u2014 proxy or download the asset to a same-origin URL to keep it.`:"";console.info(`[hyperframes] ${pf}: "${t.asset}" (${t.reason}): Web Audio capture withheld; the track plays through native HTMLMediaElement output.${i}`)}function Qa(e){return!Number.isFinite(e)||e<=0?1:e}function bf(e){return Le(e)}function $x(e,t){t||e.paused||!Ar().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function jx(e,t){let{elapsed:n,mediaStart:r,scheduledAt:i,globalRate:o,mediaRate:a,clipDuration:l}=t,s=Number.isFinite(l)&&l>0,u=l*a;if(n>=0){let m=n*a,f=u-m;return s&&f<=0?!1:(s?e.start(0,m+r,f):e.start(0,m+r),!0)}let c=-n/o;return s?e.start(i+c,r,u):e.start(i+c,r),!0}function Ai(e,t,n){let r=Zd(mf(e));r&&za([{param:t.gain}],r,Lr.scale,n)}function fr(e){return e.sourceKind==="buffer"}var Ei=class{constructor(){ge(this,"_ctx",null);ge(this,"_bufferCache",new Map);ge(this,"_failedSrcs",new Set);ge(this,"_mediaElementSources",new WeakMap);ge(this,"_activeSources",[]);ge(this,"_masterGain",null);ge(this,"_masterVolume",1);ge(this,"_masterMuted",!1);ge(this,"_groups",new Map);ge(this,"_rateAnchorCtx",0);ge(this,"_rateAnchorComp",0);ge(this,"_rate",1);ge(this,"_paused",!0);ge(this,"_playGeneration",0)}async init(){try{return this._ctx=new AudioContext,this._masterGain=this._ctx.createGain(),this._masterGain.connect(this._ctx.destination),this.applyMasterGain(),!0}catch{return!1}}get context(){return this._ctx}getTime(){return!this._ctx||this._paused?-1:this._rateAnchorComp+(this._ctx.currentTime-this._rateAnchorCtx)*this._rate}async decodeAudioElement(t){let n=t.currentSrc||t.getAttribute("src");if(!n)return null;if(this._bufferCache.has(n))return this._bufferCache.get(n);if(this._failedSrcs.has(n)||!this._ctx)return null;let r;try{let i=await fetch(n,{cache:"no-store"});if(!i.ok)return L("webAudioTransport.fetch",new Error(`${i.status} ${n}`)),null;r=await i.arrayBuffer()}catch(i){return L("webAudioTransport.fetch",i),null}try{let i=await this._ctx.decodeAudioData(r);return this._bufferCache.set(n,i),i}catch(i){return this._failedSrcs.add(n),L("webAudioTransport.decode",i),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}acquireMediaElementSource(t){let n=this._mediaElementSources.get(t);if(n){let o=sn(t);if(o.kind!=="web-audio"){try{n.disconnect()}catch{}return this._mediaElementSources.delete(t),ln(t,o),null}return n}if(!this._ctx)return null;let r=sn(t);if(r.kind!=="web-audio")return ln(t,r),null;let i=this._ctx.createMediaElementSource(t);return this._mediaElementSources.set(t,i),i}async scheduleMediaElementPlayback(t,n,r,i,o,a,l=1){if(!this._ctx||!this._masterGain||a!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),a!==this._playGeneration)return null;let s=this.acquireMediaElementSource(t);if(!s)return null;let u=Qa(l),c=this._ctx.createGain();c.gain.value=o;let m=this._ctx.currentTime,f=i-n,p={scheduledAt:m,elapsed:f,rate:u},b=Si(this._ctx,t,s,c,p);c.connect(this.resolveDestination(t,m,i,u)??this._masterGain),Ai(t,c,p),this._rate=u,this._rateAnchorCtx=m,this._rateAnchorComp=i;let v={fx:b,el:t,sourceNode:s,sourceKind:"media-element",gainNode:c,compositionStart:n,mediaStart:r,scheduledAt:m,priorMuted:t.muted,priorVolume:t.volume,mediaPlaybackRate:Ce(t),bounded:!1};return t.volume=1,this._activeSources.push(v),this._paused=!1,v}catch(s){return L("webAudioTransport.mediaElementSource",s),null}}groupInput(t,n,r){let i=this._groups.get(t);if(i){if(i.generation!==this._playGeneration)try{i.reanchor(r),i.generation=this._playGeneration}catch(f){L("webAudioTransport.groupReanchor",f)}return i.input}if(!this._ctx||!this._masterGain)return null;let o=this._ctx.createGain(),a=this._ctx.createGain();a.connect(this._masterGain);let l=()=>mo(n,t),s=l(),u=this._ctx.createGain();u.gain.value=s?.hasAttribute("data-hidden")?0:1,u.connect(a);let c=this._ctx.createGain();c.gain.value=bf(fo(s)),c.connect(u);let m=Si(this._ctx,s??{getAttribute:()=>null},o,c,r);return s&&Ai(s,c,r),this._groups.set(t,{input:o,fader:c,muteGain:u,fx:m,generation:this._playGeneration,reanchor:f=>{lr([{param:c.gain}]);let p=l();c.gain.value=bf(fo(p)),u.gain.value=p?.hasAttribute("data-hidden")?0:1,m?.reanchor(f),p&&Ai(p,c,f)},dispose:()=>{try{m?.dispose(),o.disconnect(),c.disconnect(),u.disconnect(),a.disconnect()}catch{}}}),o}setGroupMuted(t,n){let r=this._groups.get(t);if(r)try{r.muteGain.gain.value=n?0:1}catch(i){L("webAudioTransport.setGroupMuted",i)}}resolveDestination(t,n,r,i){if(!this._masterGain)return null;let o=Rl(t);if(!o)return this._masterGain;let a={scheduledAt:n,elapsed:r,rate:i};return this.groupInput(o,t.ownerDocument,a)??this._masterGain}handleSourceEnded(t,n,r,i){let o=this._activeSources.indexOf(n);if(o!==-1){this._activeSources.splice(o,1),r.muted=i;try{t.disconnect(),n.fx?.dispose(),n.gainNode.disconnect()}catch{}this._activeSources.length===0&&(this._paused=!0)}}async schedulePlayback(t,n,r,i,o,a,l,s=1,u=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||l!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),l!==this._playGeneration)return null;let c=Qa(s),m=Ce(t),f=c*m,p=this._ctx.createBufferSource();p.buffer=n,p.playbackRate.value=f;let b=this._ctx.createGain();b.gain.value=a;let v=o-r,x=this._ctx.currentTime,_={scheduledAt:x,elapsed:v,rate:c},R=Si(this._ctx,t,p,b,_);if(b.connect(this.resolveDestination(t,x,o,c)??this._masterGain),Ai(t,b,_),this._rate=c,this._rateAnchorCtx=x,this._rateAnchorComp=o,!jx(p,{elapsed:v,mediaStart:i,scheduledAt:x,globalRate:c,mediaRate:m,clipDuration:u}))return p.disconnect(),R?.dispose(),b.disconnect(),null;let T=t.muted;t.muted=!0,$x(t,T);let M={fx:R,el:t,sourceNode:p,sourceKind:"buffer",gainNode:b,compositionStart:r,mediaStart:i,scheduledAt:x,priorMuted:T,priorVolume:t.volume,mediaPlaybackRate:m,bounded:Number.isFinite(u)&&u>0};return this._activeSources.push(M),this._paused=!1,p.addEventListener("ended",()=>this.handleSourceEnded(p,M,t,T)),M}catch(c){return L("webAudioTransport.schedule",c),null}}setRate(t){let n=Qa(t);if(n===this._rate)return!1;this._ctx&&!this._paused&&(this._rateAnchorComp=this.getTime(),this._rateAnchorCtx=this._ctx.currentTime),this._rate=n;for(let r of this._activeSources)try{fr(r)&&(r.sourceNode.playbackRate.value=n*r.mediaPlaybackRate),r.fx?.setRate(n)}catch(i){L("webAudioTransport.setRate",i)}for(let r of this._groups.values())try{r.fx?.setRate(n)}catch(i){L("webAudioTransport.setRate.group",i)}return!0}hasBoundedActiveSources(){return this._activeSources.some(t=>fr(t)&&t.bounded)}stopAll(){for(let t of this._activeSources){try{fr(t)&&t.sourceNode.stop(),t.sourceNode.disconnect(),t.fx?.dispose(),t.gainNode.disconnect()}catch{}fr(t)?t.el.muted=t.priorMuted:t.el.volume=t.priorVolume}this._activeSources=[],this._paused=!0}setVolume(t){this._masterVolume=Math.max(0,Math.min(1,t)),this.applyMasterGain()}setElementVolume(t,n){let r=Le(n);for(let i of this._activeSources)if(i.el===t)try{i.sourceKind==="media-element"&&(i.el.volume=1),i.gainNode.gain.value=r}catch(o){L("webAudioTransport.setElementVolume",o)}}setMuted(t){this._masterMuted=t,this.applyMasterGain()}applyMasterGain(){this._masterGain&&(this._masterGain.gain.value=this._masterMuted?0:this._masterVolume)}isActive(){return this._activeSources.length>0&&!this._paused}ownsElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t&&fr(n))}routesElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t)}destroy(){this.stopAll();for(let t of this._groups.values())t.dispose();if(this._groups.clear(),this._bufferCache.clear(),this._failedSrcs.clear(),this._mediaElementSources=new WeakMap,this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null,this._masterVolume=1,this._masterMuted=!1}};var xf="data-hf-studio-manual-edit-gesture";function yf(e){return!Number.isInteger(e.tick)||e.tick<=0||e.tick%60!==0?!1:!(e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2)}var Kx=/^\s*spring\(\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*\)\s*$/;function vf(e){return Math.max(0,Math.min(1,e))}function Sf(e){let t=Kx.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?vf(n):null}function Af(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=vf(t),r=12-n*6,i=Math.PI*2*(1+n*1.5),o=1-Math.exp(-r)*Math.cos(i);return(1-Math.exp(-r*e)*Math.cos(i*e))/o}var Yx=/^\s*wiggle\(\s*(\d+)\s*,\s*(easeOut|easeInOut|anticipate|uniform)\s*(?:,\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?)\s*)?\)\s*$/,Xx=Math.PI*2;function Jx(e){let t=Yx.exec(e);if(!t)return null;let n=Number(t[1]);if(!Number.isSafeInteger(n)||n<1)return null;let r=t[2];if(r!=="easeOut"&&r!=="easeInOut"&&r!=="anticipate"&&r!=="uniform")return null;if(t[3]===void 0)return{wiggles:n,type:r};let i=Number(t[3]);return!Number.isFinite(i)||i<0||i>1?null:{wiggles:n,type:r,amplitude:i}}function Qx(e,t,n,r){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let i=r??(n==="easeInOut"?.08:n==="uniform"?.14:n==="anticipate"?.12:.16),o=n==="easeInOut"?i*Math.sin(Math.PI*e):n==="uniform"?i:i*(1-e);return e+(n==="anticipate"?-1:1)*o*Math.sin(Xx*t*e)}function Ef(e,t){let n=Jx(e);if(!n)return null;let r=`${n.wiggles}:${n.type}:${n.amplitude??"default"}`,i=t?.get(r);if(i)return i;let o=a=>Qx(a,n.wiggles,n.type,n.amplitude);return t?.set(r,o),o}var Zx=24,wf=e=>e>=1?1:0,ey=e=>e,wi=String.raw`([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)`,ty=new RegExp(String.raw`^\s*M\s*0\s*,\s*0\s+C\s*${wi}\s*,\s*${wi}\s+${wi}\s*,\s*${wi}\s+1\s*,\s*1\s*$`,"i");function Cf(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function ny(e,t,n,r,i){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let o=0,a=1;for(let l=0;l<Zx;l+=1){let s=(o+a)/2;Cf(s,t,r)<e?o=s:a=s}return Cf((o+a)/2,n,i)}function ry(e){let t=ty.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),o=Number(t[4]);return Math.min(n,i)<0||Math.max(n,i)>1?null:a=>ny(a,n,r,i,o)}function iy(e,t){if(!e.startsWith("spring("))return null;let n=Sf(e);if(n===null)return null;let r=t.get(n);if(r)return r;let i=o=>Af(o,n);return t.set(n,i),i}function oy(e,t){if(!e.startsWith("custom(")||!e.endsWith(")"))return null;let n=e.slice(7,-1),r=t.get(n);if(r)return r;let i=ry(n);return i&&t.set(n,i),i}function _f(e){if(e.__hfCustomEaseInstalled)return!0;let t=e.parseEase;if(!t)return!1;let n=new Map,r=new Map,i=new Map,o=s=>typeof s!="string"?null:s==="hold"?wf:Ef(s,i)??iy(s,r)??oy(s,n),a=(s,u,c=[])=>{let m=o(s);return m||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\(|$)/.test(s.trim())&&Ne("custom_ease_parse_failed",{ease:s}),t.call(u,s,...c)??ey)};e.parseEase=function(u,...c){return a(u,this,c)};let l=e.registerEase;if(typeof l=="function"){l("hold",wf);let s=u=>{let c=m=>m;c.config=(...m)=>a(`${u}(${m.join(",")})`,e),l(u,c)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}var _i=new Map,Ci=new Map,Tf=()=>{};function Za(e){return/^[a-z][a-z0-9-]{0,63}$/.test(e)}function es(e,t){let n=Ci.get(e);if(n)try{n(t)}catch(r){Tf(e,r)}}function Rf(e){Tf=e}function Ti(e,t){Za(e)&&(_i.set(e,t),es(e,t))}function Ri(e){Za(e)&&(_i.delete(e),es(e,void 0))}function kf(e,t){if(!Za(e))throw new Error(`Invalid HyperFrames runtime-data channel: ${e}`);return Ci.set(e,t),_i.has(e)&&es(e,_i.get(e)),()=>{Ci.get(e)===t&&Ci.delete(e)}}var ts="data-hf-authored-duration",ns="data-hf-authored-end",Mf=!1;function at(e){if(e){if(typeof e.pause!="function"){Mf||(Mf=!0,Ne("timeline_missing_pause",{}));return}try{e.pause()}catch(t){L("runtime.timeline.pause",t)}}}function ay(){let e=window.__HF_EXPORT_RENDER_SEEK_CONFIG,t=e?.fps,n=e?.fpsSource,r=Number(t);return!e||t==null?{fps:null,source:"default",rawFpsSource:n,rawFps:t,fallbackReason:"missing"}:!Number.isFinite(r)||r<=0?{fps:null,source:"default",rawFpsSource:n,rawFps:t,fallbackReason:"invalid"}:{fps:r,source:n==="render-options"||n==="default"?n:"unknown",rawFpsSource:n,rawFps:t,fallbackReason:e.fpsFallbackReason}}function Ff(){let e=gu();Is(xe),Rf((d,h)=>{xe({source:"hf-preview",type:"runtime-data-error",channel:d,message:h instanceof Error?h.message:String(h)})}),ci(document),Na(document),kl(document);let t=ay();e.canonicalFps=t.fps??e.canonicalFps,Ls(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG&&console.info("[hyperframes] render runtime fps",{canonicalFps:e.canonicalFps,source:t.source,rawFpsSource:t.rawFpsSource,rawFps:t.rawFps,fallbackReason:t.fallbackReason});let n=null,r=null,i=null,o=[],a=new Set,l=null,s=new Set,u=(d,h,g)=>{s.has(d)||(s.add(d),Ne(h,g))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(d){L("runtime.init.site1",d)}let c=new vi;e.transportClock=c;let m=new Ei,f=!1;m.init().then(d=>{f=d}),window.__hf=window.__hf||{};let p=d=>d.closest("[data-hidden]")!==null||Or(d.ownerDocument,d),b=()=>{let d=window.gsap,h=window;if(!(!d?.registerPlugin||h.__hfAutoNoopRegistered))try{d.registerPlugin({name:"_auto",init:()=>!1}),h.__hfAutoNoopRegistered=!0}catch(g){u("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),L("runtime.autoMarker.install",g)}},v=()=>{let d=window.gsap;if(!d){u("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{_f(d)||u("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(h){u("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),L("runtime.customEase.install",h)}};b(),v(),document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden");try{Ws(document)}catch(d){L("runtime.init.cssVariables",d)}window.__timelines=window.__timelines||{};let x=()=>{let d=document.querySelector('[data-composition-id][data-root="true"]');if(d instanceof HTMLElement)return d;let h=Array.from(document.querySelectorAll("[data-composition-id]"));return h.find(g=>!g.parentElement?.closest("[data-composition-id]"))??h[0]??null};if(Array.isArray(window.__timelines)){let d=window.__timelines,h=x()?.getAttribute("data-composition-id")??"root",g={};if(d.length===1)g[h]=d[0];else for(let y=0;y<d.length;y++)g[`tl-${y}`]=d[y];window.__timelines=g}let _=x();_&&!_.hasAttribute("data-start")&&_.setAttribute("data-start","0");let R=d=>{o.push(d)},T=(d,h,g)=>{let y=g??`${d}:${JSON.stringify(h)}`;a.has(y)||(a.add(y),xe({source:"hf-preview",type:"diagnostic",code:d,details:h}))},M=d=>{let h={scale:1,focusX:960,focusY:540},g=[],y=[],w={time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:d.play,pause:d.pause,seek:d.seek,getTime:d.getTime,getDuration:d.getDuration,isPlaying:d.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>h,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>g,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:d.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>y,getRenderState:()=>({...w,time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying()})}},F=1/60,E=.75,S=.05,A=100,C=240,N=d=>{if(d instanceof Error)return d.message||String(d);if(typeof d=="string")return d;try{return JSON.stringify(d)}catch{return String(d??"")}},I=d=>{let h=d.toLowerCase();return h.includes("cannot read properties of null")||h.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:h.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:h.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},W=d=>{if(d==null||d.trim()==="")return null;let h=Number.parseFloat(d);return!Number.isFinite(h)||h<=0?null:`${h}px`},U=()=>x(),oe=()=>{let d=U();if(!d)return;let h=W(d.getAttribute("data-width")),g=W(d.getAttribute("data-height"));h&&(d.style.width=h),g&&(d.style.height=g),h&&d.style.setProperty("--comp-width",h),g&&d.style.setProperty("--comp-height",g)},k=()=>{let d=U(),h=Array.from(document.querySelectorAll("[data-composition-id]")).filter(g=>g.hasAttribute("data-duration")||g.hasAttribute("data-end"));for(let g of h){if(d&&g===d)continue;let y=g.getAttribute("data-duration"),w=g.getAttribute("data-end");y!=null&&!g.hasAttribute(ts)&&g.setAttribute(ts,y),w!=null&&!g.hasAttribute(ns)&&g.setAttribute(ns,w),g.removeAttribute("data-duration"),g.removeAttribute("data-end")}},V=()=>{let d=U();if(!d)return;d.style.position||(d.style.position="relative"),d.style.overflow="hidden";let h=W(d.getAttribute("data-width")),g=W(d.getAttribute("data-height"));h&&(d.style.width=h),g&&(d.style.height=g);let y=Array.from(d.children);for(let w of y){let D=w.tagName.toLowerCase();if(D==="script"||D==="style"||D==="link"||D==="meta"||!w.hasAttribute("data-start")||w.hasAttribute("data-hf-autostamped"))continue;let B=(w.style.top==="0px"||w.style.top==="0")&&(w.style.left==="0px"||w.style.left==="0")&&w.style.width==="100%"&&w.style.height==="100%",ne=/translate\(\s*-50%\s*,\s*-50%\s*\)/.test(w.style.transform);if(B&&ne&&!w.hasAttribute("data-width")&&!w.hasAttribute("data-height")){let te=w.style.top,Tt=w.style.left,ye=w.style.width,gn=w.style.height;w.style.top="",w.style.left="",w.style.width="",w.style.height="";let ae=window.getComputedStyle(w);ae.top!=="auto"||ae.bottom!=="auto"||ae.left!=="auto"||ae.right!=="auto"||ae.width!=="0px"||ae.height!=="0px"||(w.style.top=te,w.style.left=Tt,w.style.width=ye,w.style.height=gn)}let $=window.getComputedStyle(w),de=$.position;if(de!=="absolute"&&de!=="fixed"&&(w.style.position="absolute"),!!w.style.top||!!w.style.bottom||$.top!=="auto"||$.bottom!=="auto"||(w.style.top="0"),!!w.style.left||!!w.style.right||$.left!=="auto"||$.right!=="auto"||(w.style.left="0"),D!=="audio"){let te=W(w.getAttribute("data-width")),Tt=W(w.getAttribute("data-height")),ye=$.width!=="0px"&&$.width!=="auto",gn=$.height!=="0px"&&$.height!=="auto";te?!w.style.width&&!ye&&(w.style.width=te):!w.style.width&&$.width==="0px"&&(w.style.width="100%"),Tt?!w.style.height&&!gn&&(w.style.height=Tt):!w.style.height&&$.height==="0px"&&(w.style.height="100%")}}},Q=(d,h=0,g)=>mt({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:g?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(d,h),G=(d,h)=>mt({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:h?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(d),H=d=>{let h=d.closest("[data-composition-id]"),g=h?Q(h,0):null,y=h?G(h,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:h,inheritedStart:g,inheritedDuration:y}},z=d=>{let h=H(d),g=h.inheritedStart??0,y=Bt(d.getAttribute("data-start"));if(d.hasAttribute("data-hf-auto-start")||y==null||g<=0)return Q(d,g);let w=ve(d.getAttribute("data-duration")),D=h.inheritedDuration,B=D!=null&&D>0?g+D:null,ne=w!=null&&w>0?y+w:y;return(B==null?y>=g:y<B&&(ne>g||y===g))?y:g+y};window.__hfResolveMediaStartSeconds=z,o.push(()=>{window.__hfResolveMediaStartSeconds===z&&delete window.__hfResolveMediaStartSeconds});let X=(d,h)=>{let g=d.tagName.toLowerCase();if(g==="script"||g==="style"||g==="link"||g==="meta")return!1;let w=g==="video"||g==="audio"?z(d):Q(d,0),D=G(d),B=d.getAttribute("data-composition-id");if(B){let $=(window.__timelines??{})[B],de=null;if($&&typeof $.duration=="function"){let Me=Number($.duration());Number.isFinite(Me)&&Me>0&&(de=Me)}!(d.hasAttribute("data-duration")||d.hasAttribute("data-end")||d.hasAttribute(ts)||d.hasAttribute(ns))&&(D==null||D<=0)&&de!=null&&(D=de)}let ne=D!=null&&D>0?w+D:Number.POSITIVE_INFINITY;return h>=w&&(Number.isFinite(ne)?h<ne:!0)},we=!!document.querySelector("[data-composition-src]"),q=!1;{let d=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let h of d){let g=h.getAttribute("data-composition-id");if(g&&h.children.length===0&&document.querySelector(`template#${CSS.escape(g)}-template`)){q=!0;break}}}let P=!we&&!q,O=d=>{if(!d||typeof d.duration!="function")return null;try{let h=Number(d.duration());return Number.isFinite(h)?Math.max(0,h):null}catch{return null}},j=d=>typeof d=="number"&&Number.isFinite(d)&&d>F,le=d=>{let h=ve(d.getAttribute("data-duration"));return h!=null&&h>0?h:Number.isFinite(d.duration)?Ze(d,d.duration):null},ee=()=>{let d=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(d.length===0)return null;let h=0;for(let g of d){let y=z(g);if(!Number.isFinite(y))continue;let w=le(g);w==null||w<=F||(h=Math.max(h,Math.max(0,y)+w))}return h>F?h:null},K=()=>{let d=U();if(!d)return null;let h=window.__timelines??{},g=mt({timelineRegistry:h,includeAuthoredTimingAttrs:!0}),y=0,w=ve(d.getAttribute("data-duration"));w!=null&&w>0&&(y=w);let D=Array.from(d.querySelectorAll("[data-composition-id][data-start]"));for(let B of D){if(!(B instanceof Element)||B.parentElement?.closest("[data-composition-id]")!==d)continue;let $=g.resolveStartForElement(B,0),de=g.resolveDurationForElement(B);!Number.isFinite($)||de==null||de<=0||(y=Math.max(y,Math.max(0,$)+de))}return y>F?y:null},Y=()=>{let d=ee();return typeof d!="number"||!Number.isFinite(d)||d<=F?null:d},Ve=d=>j(d)?Math.max(F,d*E):F,Fe=()=>{let d=0;for(let h of e.deterministicAdapters){let g=h.getInferredDurationSeconds;if(typeof g!="function")continue;let y=null;try{y=g()}catch(w){L("runtime.init.adapterDuration",w)}typeof y=="number"&&Number.isFinite(y)&&y>0&&(d=Math.max(d,y))}return d>F?d:null},Re=(d,h=0)=>{let g=O(d),y=Y(),w=K(),D=Fe(),B=Math.max(y??0,w??0,D??0),ne=Number.isFinite(h)&&h>F?h:0,$=0;return j(g)?$=Math.max(g,B,ne):j(B)?$=Math.max(B,ne):$=ne,$>0?Math.max(0,$):0},ze=()=>{let d=window.__timelines??{},h=ae=>{let re=Object.entries(d).filter(se=>!!se[1]&&typeof se[1].play=="function"&&typeof se[1].pause=="function");if(re.length!==1)return{timeline:null};let he=re[0];if(!he)return{timeline:null};let[be,fe]=he;return{timeline:fe,selectedTimelineIds:[be],selectedDurationSeconds:O(fe),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:ae,soleTimelineId:be}}}},g=mt({timelineRegistry:d,includeAuthoredTimingAttrs:!0}),y=Y(),w=K(),D=Math.max(y??0,w??0)||null,B=Ve(D),ne=ae=>{let re=document.querySelector(`[data-composition-id="${CSS.escape(ae)}"]`);return re?g.resolveStartForElement(re,0):0},$=ae=>{let re=window.gsap;if(!re||typeof re.timeline!="function")return null;let he=re.timeline({paused:!0});for(let be of ae)he.add(be.timeline,ne(be.compositionId));return he},de=(ae,re)=>{if(!j(ae))return null;let he=window.gsap;if(!he||typeof he.timeline!="function")return null;let be=he.timeline({paused:!0});if(re)try{be.add(re,0)}catch(se){L("runtime.init.site2",se)}let fe=be;if(typeof fe.to=="function")try{fe.to({},{duration:ae})}catch(se){L("runtime.init.site3",se)}return be},Ge=(ae,re)=>{let he=ae;if(typeof he.getChildren!="function")return[];try{let be=he.getChildren(!0,!0,!0)??[];if(!Array.isArray(be))return[];let fe=[];for(let se of re)if(!be.some(Qe=>Qe===se.timeline))try{let Qe=ne(se.compositionId);ae.add(se.timeline,Qe),fe.push(se.compositionId)}catch(Qe){L("runtime.init.site4",Qe)}return fe}catch{return[]}},Me=U(),J=Me?.getAttribute("data-composition-id")??null;if(!J)return h("root_missing_composition_id");let te=d[J]??null,ye=(()=>{if(!Me)return[];let ae=new Set,re=Array.from(Me.querySelectorAll("[data-composition-id]")),he=[];for(let be of re){let fe=be.getAttribute("data-composition-id");if(!fe||fe===J||ae.has(fe))continue;ae.add(fe);let se=d[fe]??null;if(!se||typeof se.play!="function"||typeof se.pause!="function")continue;let lt=O(se);he.push({compositionId:fe,timeline:se,durationSeconds:lt??0})}return he})(),gn=ae=>{for(let re of ae){let he=re.timeline;if(typeof he.paused=="function")try{he.paused(!1)}catch(be){L("runtime.init.site5",be)}}};if(ye.length>0&&gn(ye),te){let ae=ye.length>0?Ge(te,ye):[];if((ye.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id='"+J+"'])"))&&(Pi=!0),ae.length>0)try{let fe=te.time();te.seek(fe,!1)}catch{}let re=O(te);if(!j(re)&&ye.length>0){let fe=ye.map(Lm=>Lm.compositionId),se=$(ye),lt=O(se);if(se&&j(lt))return{timeline:se,selectedTimelineIds:fe,selectedDurationSeconds:lt,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:J,rootDurationSeconds:re,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:B,selectedDurationSeconds:lt,mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:w,selectedTimelineIds:fe,autoNestedChildren:ae}}};let Qe=de(D??0,te),Ki=O(Qe);if(Qe&&j(Ki))return{timeline:Qe,selectedTimelineIds:[J],selectedDurationSeconds:Ki,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:J,rootDurationSeconds:re,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:w,selectedDurationSeconds:Ki,selectedTimelineIds:[J],autoNestedChildren:ae}}}}if(!j(re)&&ye.length===0){let fe=de(D??0,te),se=O(fe);if(fe&&j(se))return{timeline:fe,selectedTimelineIds:[J],selectedDurationSeconds:se,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:J,rootDurationSeconds:re,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:w,selectedDurationSeconds:se,selectedTimelineIds:[J]}}}}let he=ve(Me?.getAttribute("data-duration")),be=Math.max(j(he)?he:0,w??0);if(be>0&&j(be)&&j(re)&&be>=re+.5){let fe=te;if(typeof fe.to=="function")try{fe.to({},{duration:0},be)}catch(lt){L("runtime.init.site6",lt)}let se=O(te);if(j(se))return{timeline:te,selectedTimelineIds:[J],selectedDurationSeconds:se,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:J,rootDurationSeconds:re,rootDeclaredDur:he,authoredCompositionDurationFloorSeconds:w,newDur:se}}}}return{timeline:te,selectedTimelineIds:[J],selectedDurationSeconds:re,mediaDurationFloorSeconds:y,diagnostics:ae.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:J,selectedDurationSeconds:re,autoNestedChildren:ae}}:void 0}}if(ye.length>0){let ae=ye.map(be=>be.compositionId),re=$(ye),he=O(re);if(re)return{timeline:re,selectedTimelineIds:ae,selectedDurationSeconds:he,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:J,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:B,selectedDurationSeconds:he,mediaDurationFloorSeconds:y,selectedTimelineIds:ae}}}}return h("root_composition_id_unmatched_in_registry")},Pi=!1,fm=d=>{let h=window.gsap,g=d;if(!(!g||typeof g.getChildren!="function"||!h||typeof h.parseEase!="function"))for(let y of g.getChildren(!0,!0,!0)){let w=y,D=w.timeline;if(!D||!("_ease"in D)||typeof D._ease=="function")continue;let B=w.vars?.keyframes,$=(B&&!Array.isArray(B)?B.ease:void 0)??w.vars?.ease??"none";try{let de=h.parseEase($);typeof de=="function"&&(D._ease=de)}catch(de){Ne("keyframe_ease_repair_failed",{ease:typeof $=="string"?$:String($)}),L("runtime.keyframeEase.repair",de)}}},dn=()=>{if(v(),!P)return!1;let d=e.capturedTimeline,h=O(d),g=j(h);if(d&&g&&Pi)return!1;let y=ze();if(!y.timeline)return!1;if(d&&d===y.timeline)return typeof d.timeScale=="function"&&d.timeScale(e.playbackRate),!1;e.capturedTimeline=y.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),fm(e.capturedTimeline);let w=Re(e.capturedTimeline,0);if(w<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),at(e.capturedTimeline)),w>0){try{c.setDuration(w)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let B=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(B,!1),at(e.capturedTimeline)}let D=window.__hfStudioManualEditsApply;typeof D=="function"&&D(),ci(document)}if(y.diagnostics&&xe({source:"hf-preview",type:"diagnostic",code:y.diagnostics.code,details:y.diagnostics.details}),xe({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:y.selectedTimelineIds??[],selectedDurationSeconds:y.selectedDurationSeconds??null,mediaDurationFloorSeconds:y.mediaDurationFloorSeconds??null}}),window.parent!==window){let D=U(),B=w>0?w:0,ne=String(B>0?B:1),$=new Set,de=J=>J.tagName.toLowerCase()===Wt,Ge=new Set(document.querySelectorAll("[data-start]")),Me=J=>{let te=J.parentElement;for(;te&&te!==D;){if(Ge.has(te))return!0;te=te.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let J of e.capturedTimeline.getChildren(!0))if(typeof J.targets=="function")for(let te of J.targets())te instanceof HTMLElement&&te!==D&&(de(te)||te.hasAttribute("data-start")||Me(te)||$.has(te)||($.add(te),te.setAttribute("data-start","0"),te.setAttribute("data-duration",ne),te.setAttribute("data-hf-autostamped","1")))}catch{}if(D instanceof HTMLElement)for(let J of D.querySelectorAll("[id]"))J instanceof HTMLElement&&J!==D&&(J.hasAttribute("data-start")||Me(J)||$.has(J)||J.tagName==="SCRIPT"||J.tagName==="STYLE"||J.tagName==="LINK"||de(J)||($.add(J),J.setAttribute("data-start","0"),J.setAttribute("data-duration",ne),J.setAttribute("data-hf-autostamped","1")))}for(let D of fn)hr.delete(D),xs(D);return!0};window.__hfForceTimelineRebind=()=>{Pi=!1,dn(),Ui(e.currentTime)};let mm=()=>{let d=U();if(!(d instanceof HTMLElement))return;let h=d.getBoundingClientRect(),g=Number(d.getAttribute("data-width")),y=Number(d.getAttribute("data-height")),w=window.getComputedStyle(d),D=Number.isFinite(g)&&g>0&&Number.isFinite(y)&&y>0,B=h.width<=0||h.height<=0||d.clientWidth<=0||d.clientHeight<=0;!D||!B||T("root_stage_layout_zero",{compositionId:d.getAttribute("data-composition-id")??null,declaredWidth:g,declaredHeight:y,rectWidth:Math.round(h.width),rectHeight:Math.round(h.height),clientWidth:d.clientWidth,clientHeight:d.clientHeight,display:w.display,visibility:w.visibility,overflow:w.overflow},`root-stage-layout-zero:${d.getAttribute("data-composition-id")??"unknown"}`)},pm=()=>{e.tornDown||(l!=null&&window.cancelAnimationFrame(l),l=window.requestAnimationFrame(()=>{l=null,mm()}))},hm=()=>{r=d=>{let h=N(d.error??d.message).slice(0,C);if(!h)return;let g=I(h);xe({source:"hf-preview",type:"diagnostic",code:g.code,details:{category:g.category,message:h,filename:d.filename||null,line:Number.isFinite(d.lineno)?d.lineno:null,column:Number.isFinite(d.colno)?d.colno:null}})},i=d=>{let h=N(d.reason).slice(0,C);if(!h)return;let g=I(h);xe({source:"hf-preview",type:"diagnostic",code:`${g.code}_unhandled_rejection`,details:{category:`${g.category}-unhandled-rejection`,message:h}})},window.addEventListener("error",r),window.addEventListener("unhandledrejection",i)},gm=()=>{let d=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let g of d){let y=()=>{if(!(g instanceof Element))return;let w=g.tagName.toLowerCase(),D=g.getAttribute("src")??g.getAttribute("href")??g.getAttribute("poster")??null,B=w==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";T(B,{tagName:w,assetUrl:D,currentSrc:(g instanceof HTMLImageElement||g instanceof HTMLMediaElement)&&g.currentSrc||null,readyState:g instanceof HTMLMediaElement?g.readyState:null,networkState:g instanceof HTMLMediaElement?g.networkState:null},`${B}:${w}:${D??"unknown"}`)};g.addEventListener("error",y),R(()=>{g.removeEventListener("error",y)})}let h=document.fonts;h&&h.ready.then(()=>{if(e.tornDown)return;let g=Array.from(h).filter(y=>y.status==="error").map(y=>y.family).filter(y=>!!y).slice(0,10);g.length!==0&&T("runtime_font_load_issue",{failedFamilies:g,totalFaces:Array.from(h).length},`runtime-font-load-issue:${g.join("|")}`)}).catch(()=>{})},bm=(d,h)=>{if(!d.timeline)return!1;let g=e.capturedTimeline;if(g&&g===d.timeline)return!1;let y=Math.max(0,e.currentTime||0),w=e.isPlaying;e.capturedTimeline=d.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{at(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&e.capturedTimeline.seek(y,!1),w&&typeof e.capturedTimeline.play=="function"&&e.capturedTimeline.play()}catch(D){L("runtime.init.site7",D)}return xe({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:h,previousTime:y,selectedTimelineIds:d.selectedTimelineIds??[],selectedDurationSeconds:d.selectedDurationSeconds??null,mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),!0},Et=null,fs=!1,ms=!1,fn=new Set,hr=new WeakMap,gr=()=>{e.tornDown||(Et!=null&&window.clearTimeout(Et),Et=window.setTimeout(()=>{if(e.tornDown||(Et=null,ms&&window.__HF_EXPORT_RENDER_SEEK_CONFIG))return;let d=ze();if(!d.timeline||!j(d.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){dn()&&(wt(),ke(!0));return}if(fs)return;let g=O(e.capturedTimeline),y=d.selectedDurationSeconds??O(d.timeline);j(y)&&(!j(g)||y>=g+S)&&bm(d,"manual")&&(fs=!0,xe({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:g??null,selectedDurationSeconds:y??null,selectedTimelineIds:d.selectedTimelineIds??[],mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),wt(),ke(!0))},A))},ps=d=>{d.currentTarget instanceof HTMLMediaElement&&Ol(d.currentTarget)},hs=d=>{d.currentTarget instanceof HTMLMediaElement&&Hl(d.currentTarget)},gs=d=>{d instanceof HTMLAudioElement&&gf(d)&&ln(d,sn(d))},bs=d=>{let h=d.currentTarget;h instanceof HTMLMediaElement&&gs(h)},xm=()=>{for(let d of fn)d.removeEventListener("loadedmetadata",gr),d.removeEventListener("durationchange",gr),d.removeEventListener("loadedmetadata",ps),d.removeEventListener("loadedmetadata",bs),d.removeEventListener("error",hs);fn.clear()},Oi=()=>{if(e.tornDown)return;let d=Array.from(document.querySelectorAll("video, audio"));for(let h of d){if(fn.has(h))continue;fn.add(h);let g=Number.parseFloat(h.dataset.volume??"");Number.isFinite(g)&&(h.volume=Math.max(0,Math.min(1,g))),h.addEventListener("loadedmetadata",gr),h.addEventListener("durationchange",gr),h.addEventListener("loadedmetadata",bs),gs(h),h.addEventListener("loadedmetadata",ps),h.addEventListener("error",hs),Pl(h),h.preload!=="auto"&&(h.preload="auto"),h.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&h.load(),xs(h)}},xs=d=>{hr.has(d)||gl(d,e.capturedTimeline,Re(e.capturedTimeline,0),hr,{allowLiveTimelineSeek:!window.__HF_RENDER_CAPTURE_MODE})},Hi=new WeakMap,ys=d=>{let h=Hi.get(d);if(h!==void 0)return h;let g=window.getComputedStyle(d).position,y=g==="static"||g==="relative"||g==="sticky";return Hi.set(d,y),y},Gi=new WeakMap,ym=d=>{let h=Gi.get(d);if(h!==void 0)return h;let g=d.querySelector("[data-start]")===null;return Gi.set(d,g),g},vm=()=>{Hi=new WeakMap,Gi=new WeakMap},Bi=new WeakMap,br=new WeakSet,xr=!1,vs=d=>d.matches("audio[data-start]")||d.querySelector("audio[data-start]")!==null,Ss=new WeakMap,yr=!0,Sm=()=>{if(yr){yr=!1;for(let d of document.querySelectorAll(Wt)){let h=d.hasAttribute("data-hidden");Ss.get(d)!==h&&(Ss.set(d,h),d.id&&m.setGroupMuted(d.id,h))}}},Ui=(d,h=Array.from(document.querySelectorAll("[data-start]")))=>{let g=U();for(let y of h){if(!(y instanceof HTMLElement))continue;if(y.hasAttribute("data-hidden")){br.has(y)||(Bi.set(y,y.style.getPropertyValue("display")),br.add(y),vs(y)&&(xr=!0),yr=!0),y.style.display="none",(y instanceof HTMLVideoElement||y instanceof HTMLImageElement)&&n?.setSourceVisibility(y,!1);continue}if(br.has(y)){let D=Bi.get(y);D?y.style.display=D:y.style.removeProperty("display"),Bi.delete(y),br.delete(y),vs(y)&&(xr=!0),yr=!0}let w=X(y,d);if(w){let D=y.parentElement;for(;D&&D!==g;){if(D instanceof HTMLElement&&D.hasAttribute("data-start")&&!X(D,d)){w=!1;break}D=D.parentElement}}y.style.visibility=w?"visible":"hidden",(y instanceof HTMLVideoElement||y instanceof HTMLImageElement)&&n?.setSourceVisibility(y,w),w?ys(y)&&y.style.removeProperty("display"):ys(y)&&ym(y)&&(y.style.display="none")}xr&&c.isPlaying()&&(m.stopAll(),$i()),xr=!1,Sm()},Pe=()=>{let d=Fl({shouldIncludeElement:g=>g.hasAttribute("data-start")||!!H(g).compositionRoot,resolveStartSeconds:g=>z(g),resolveDurationSeconds:g=>{let y=H(g),w=z(g),D=y.inheritedStart!=null&&y.inheritedDuration!=null&&y.inheritedDuration>0?Math.max(0,y.inheritedStart+y.inheritedDuration-w):null,B=Number.isFinite(g.duration)?Ze(g,g.duration):null,ne=ve(g.dataset.duration),$=ne!=null&&ne>0?ne:null;return Ml({isVideo:g.tagName==="VIDEO",sourceDuration:B,hostRemaining:D,explicitDuration:$})}});for(let g of d.mediaClips){let y=hr.get(g.el);y&&(g.volumeKeyframes=y)}let h=e.mediaForceSyncNextTick;h&&(e.mediaForceSyncNextTick=!1),e.nativeMediaSyncDisabled||Nl({clips:d.mediaClips,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted,userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:h,onElementVolume:(g,y,w)=>m.setElementVolume(g,w),isWebAudioOwned:g=>m.ownsElement(g),isWebAudioRouted:g=>m.routesElement(g),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,xe({source:"hf-preview",type:"media-autoplay-blocked"}))}}),Ui(e.currentTime)},ke=d=>{let h=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),g=Date.now();(d||h!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||g-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=h,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=g,xe({source:"hf-preview",type:"state",frame:h,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},Wi="",As=0,Am=()=>{let d="";for(let h of document.querySelectorAll("[data-start]"))d+=`${h.id}:${h.tagName}|`;return d},wt=()=>{k(),oe(),V();let d=U();if(d){let y=W(d.getAttribute("data-width")),w=W(d.getAttribute("data-height")),D=y?parseInt(y,10):0,B=w?parseInt(w,10):0;D>0&&B>0&&xe({source:"hf-preview",type:"stage-size",width:D,height:B})}dn();let h=Su({canonicalFps:e.canonicalFps});window.__clipManifest=h;let g=Am();if(Wi!==g&&vm(),!window.__clipTree||Wi!==g){let y=window;window.__clipTree=bu({startResolver:mt({timelineRegistry:y.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:y.__timelines??{},rootDuration:h.durationInFrames/e.canonicalFps}),Wi=g}xe(h),pm()},Vi=d=>typeof d=="number"&&Number.isFinite(d)&&d>0?d:0,Em=d=>{let h=Vi(Number(d));if(h<=0)return;let g=U(),y=Vi(ve(g?.getAttribute("data-duration"))),w=Math.max(As,Vi(c.getDuration()),y);h<=w||(As=h,g?.setAttribute("data-duration",String(h)),c.setDuration(h),wt(),ke(!0))},Oe=(d,h=0)=>{for(let g of e.deterministicAdapters){try{d==="discover"&&g.discover(),d==="pause"&&g.pause(),d==="play"&&g.play&&g.play()}catch(y){L("runtime.init.site8",y)}if(d==="discover")try{g.seek({time:h,suppressEvents:!0})}catch(y){L("runtime.init.site9",y)}}},Ct=()=>{window.__renderReady=!1},mn=null,pn=!0,wm=()=>{let d=[];for(let h of e.deterministicAdapters){let g=h.getReadyPromise;if(typeof g=="function")try{let y=g();y&&d.push(y)}catch(y){L("runtime.init.adapterReady",y)}}return d},Cm=()=>{let d=wm();if(d.length===0)return mn=null,pn=!0,!0;let h=d[0];if(!h)return!0;let g=d.length===1?h:Promise.all(d);return g!==mn&&(mn=g,pn=!1,Promise.resolve(g).then(()=>{mn===g&&(pn=!0,Ct())},y=>{mn===g&&(pn=!0,L("runtime.init.adapterReady",y),Ct())})),pn};if(P)Ca();else{let d={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:W,onDiagnostic:({code:h,details:g})=>{xe({source:"hf-preview",type:"diagnostic",code:h,details:g})}};fd(d).then(()=>dd(d)).finally(()=>{P=!0,Oi(),gm(),Ca(),Na(document),Ct()})}let vr=fu({postMessage:d=>xe(d)});vr.installPickerApi(),Ui(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let qe=Jd();n=qe,R(()=>{qe.destroy(),n=null});let zi=d=>{let h=Number(d);!Number.isFinite(h)||h<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,h)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let g=document.querySelectorAll("video, audio");for(let y of g)if(y instanceof HTMLMediaElement)try{y.playbackRate=e.playbackRate}catch(w){L("runtime.init.site10",w)}},Es={play:()=>{let d=e.capturedTimeline;if(c.isPlaying())return;let h=Re(d,0);if(h>0)c.setDuration(h),c.reachedEnd()&&(c.seek(0),e.currentTime=0,_t(0));else{let g=U(),y=Number(g?.getAttribute("data-duration")??0);y>0&&c.setDuration(y)}at(d),c.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,ks(c.now()),f&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&$i(),Oe("play"),Pe(),qe.redraw(),ke(!0))},pause:()=>{if(!c.isPlaying())return;m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1,e.currentTime=c.now(),e.mediaForceSyncNextTick=!0,ks(e.currentTime);let d=e.capturedTimeline;at(d),Oe("pause"),Pe(),qe.redraw(),ke(!0)},seek:(d,h)=>{let g=jt(Math.max(0,Number(d)||0),e.canonicalFps);m.stopAll(),c.detachAudioSource();let y=c.isPlaying();y&&c.pause(),c.seek(g),e.currentTime=c.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let w=e.capturedTimeline;if(at(w),_t(e.currentTime),Oe("pause"),h?.keepPlaying&&y){Es.play();return}Pe(),qe.redraw(),ke(!0)},renderSeek:(d,h)=>{ms=!0;let g=jt(Math.max(0,Number(d)||0),e.canonicalFps);m.stopAll(),c.detachAudioSource(),c.isPlaying()&&c.pause(),c.seek(g),e.currentTime=c.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0,_t(e.currentTime,{activateChildren:!0,suppressEvents:h?.suppressEvents}),Oe("pause"),Pe(),qe.redraw(),ke(!0)},getTime:()=>c.now(),getDuration:()=>{let d=c.getDuration();return Number.isFinite(d)?d:0},isPlaying:()=>c.isPlaying(),setPlaybackRate:d=>{zi(d),c.setRate(e.playbackRate),Ms()},getPlaybackRate:()=>e.playbackRate},ws=Re(e.capturedTimeline,0);ws>0&&c.setDuration(ws);let He=hu({getTimeline:()=>e.capturedTimeline,setTimeline:d=>{e.capturedTimeline=d},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:d=>{e.isPlaying!==d&&(e.mediaForceSyncNextTick=!0),e.isPlaying=d},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:zi,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(d,h)=>{e.currentTime=Math.max(0,Number(d)||0),e.isPlaying!==h&&(e.mediaForceSyncNextTick=!0),e.isPlaying=h,Pe()},onStatePost:ke,onDeterministicSeek:(d,h)=>{for(let g of e.deterministicAdapters)if(!(g.name==="gsap"&&e.capturedTimeline))try{g.seek({time:Number(d)||0,suppressEvents:h?.suppressEvents})}catch(y){L("runtime.init.site11",y)}},onDeterministicPause:()=>Oe("pause"),onDeterministicPlay:()=>Oe("play"),onRenderFrameSeek:()=>{qe.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>Re(e.capturedTimeline,0),transport:Es});window.__player=M(He),window.__playerReady=!0,Ne("composition_loaded",{duration:He.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[ll(),zs({resolveStartSeconds:d=>Q(d,0)}),$s(),Ks(),Js(),Qs(),Zs(),el(),tl(),nl(),rl(),qs({getTimeline:()=>e.capturedTimeline})],al(),sl(),window.__hfReseekGpu=d=>{let h=Math.max(0,Number(d)||0);window.__hfThreeTime=h,window.__hfTypegpuTime=h,Rr(h)},window.__hfWaitForSeekCompletion=oo,o.push(()=>{window.__hfWaitForSeekCompletion===oo&&delete window.__hfWaitForSeekCompletion}),hm(),Oi(),Oe("discover");let _m=()=>{let d=e.capturedTimeline,h=dn();e.capturedTimeline&&(h||e.capturedTimeline!==d||!He._timeline)&&(He._timeline=e.capturedTimeline);let g=Re(e.capturedTimeline,0);if(g>0&&c.setDuration(g),Oe("discover",e.currentTime),!e.capturedTimeline){let y=window.__timelines??{},w=Object.keys(y).filter(D=>y[D]);if(w.length>0){let B=U()?.getAttribute("data-composition-id")??null;T("root_timeline_unbound_registry_present",{reason:B?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:B,registeredTimelineKeys:w},"root_timeline_unbound_registry_present"),console.warn("[hyperframes] Root timeline not bound \u2014 render will freeze at t=0. "+(B?`Root data-composition-id is "${B}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${w.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${B??"<root-id>"}"] = tl).`)}}window.__renderReady=!0,wt(),ke(!0)},Pt=null,Tm=()=>{if(Pt)return;let d=()=>{window.removeEventListener("hf-timelines-built",d),Pt=null,Ct()};Pt=d,window.addEventListener("hf-timelines-built",d)};R(()=>{Pt&&(window.removeEventListener("hf-timelines-built",Pt),Pt=null)}),Ct=()=>{if(!P){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,Tm();return}if(Oe("discover",e.currentTime),!Cm()){window.__renderReady=!1;return}_m()},Ct(),P&&setTimeout(()=>{Ct()},0);let Sr=0,qi=!1,Rm=(d,h,g,y)=>{try{let w=y?.suppressEvents===!0;at(d),typeof d.totalTime=="function"?d.totalTime(h,w):d.seek(h,w)}catch(w){L(g,w)}},km=(d,h)=>{let g=window.__timelines??{},y=U()?.getAttribute("data-composition-id")??null;for(let[w,D]of Object.entries(g)){if(!D||w===y)continue;let B=document.querySelector(`[data-composition-id="${CSS.escape(w)}"]`);if(!B)continue;let ne=Q(B,0);if(!Number.isFinite(ne))continue;let $=O(D),de=je(B)+Math.max(0,d-ne)*Ce(B),Ge=Math.max(0,$!=null&&$>0?Math.min($,de):de);Rm(D,Ge,"runtime.init.transport.childTimeline",h)}},Cs=d=>{let h=window.__timelines??{};for(let g of Object.values(h))if(!(!g||g===d))try{g.play()}catch(y){L("runtime.init.activateSiblings",y)}},_s=d=>typeof d=="object"&&d!==null,hn=new WeakMap,Mm=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],Ts=(d,h)=>{let g=d[h];if(typeof g!="function")return null;try{let y=Number(g.call(d));return Number.isFinite(y)?y:null}catch(y){return L("runtime.init.gsapCallbackDuration",y),null}},Fm=d=>{let h=hn.get(d);if(h!=null)return h;if(!("getChildren"in d)||typeof d.getChildren!="function")return!1;let g;try{g=d.getChildren(!0,!0,!0)}catch(y){return L("runtime.init.gsapCallbackChildren",y),hn.set(d,!1),!1}if(!Array.isArray(g))return hn.set(d,!1),!1;for(let y of g){if(!_s(y))continue;let w=y.vars;if(!_s(w)||!Mm.some($=>typeof w[$]=="function"))continue;let ne=Ts(y,"totalDuration")??Ts(y,"duration");if(ne!=null&&ne<=1e-6)return hn.set(d,!0),!0}return hn.set(d,!1),!1};function _t(d,h){let g=e.capturedTimeline,y=h?.suppressEvents===!0;if(g){h?.activateChildren&&Cs(g);let w=g,D=d;if(typeof w.totalDuration=="function")try{let B=Number(w.totalDuration());Number.isFinite(B)&&B>0&&d>B&&(D=B)}catch(B){L("runtime.init.transport.clampDuration",B)}try{typeof g.totalTime=="function"?(g.totalTime(D,y),!y&&!Fm(g)&&(g.totalTime(D+.001,!0),g.totalTime(D,!0))):g.seek(D,y)}catch(B){L("runtime.init.transport.seek",B)}}km(d,h),g&&h?.activateChildren&&Cs(g);for(let w of e.deterministicAdapters)if(!(w.name==="gsap"&&g))try{w.seek({time:d,suppressEvents:y})}catch(D){L("runtime.init.transport.adapter",D)}}let Nm=()=>{try{return document.querySelector(`[${xf}]`)!=null}catch{return!1}},Rs=()=>{if(!(e.tornDown||qi)){qi=!0;try{if(e.transportRafId=window.requestAnimationFrame(Rs),Sr+=1,yf({tick:Sr,isPlaying:c.isPlaying(),hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:c.now()})){let h=e.capturedTimeline;if(dn()){e.capturedTimeline&&!He._timeline&&(He._timeline=e.capturedTimeline),e.capturedTimeline&&e.capturedTimeline!==h&&at(e.capturedTimeline);let g=Re(e.capturedTimeline,0);g>0&&c.setDuration(g),wt()}}if(Sr%20===0&&wt(),Sr%30===0&&Oi(),e.capturedTimeline){let h=Re(e.capturedTimeline,0);h>0&&(!c.isPlaying()||h>=c.getDuration())&&c.setDuration(h)}if(c.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&m.isActive()&&m.context){let h=m.getTime();h>=0&&c.attachAudioSource({currentTimeSeconds:h})}else{let h=document.querySelectorAll("audio[data-start]"),g=!1;for(let y of h){if(!(y instanceof HTMLMediaElement)||!y.isConnected||p(y))continue;let w=Number.parseFloat(y.dataset.start??""),D=ve(y.dataset.duration),B=D!=null&&D>0?w+D:1/0,ne=je(y);if(Number.isFinite(w)&&e.currentTime>=w&&e.currentTime<B){y.paused?!y.error&&y.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(c.attachAudioSource({currentTimeSeconds:e.currentTime}),g=!0):(c.attachAudioSource({el:y,compositionStart:w,mediaStart:ne}),g=!0);break}}!g&&c.hasAudioSource()&&c.detachAudioSource()}else c.hasAudioSource()&&c.detachAudioSource();let d=c.now();if(e.currentTime=d,(c.isPlaying()||!Nm())&&_t(d),c.isPlaying()&&qe.redrawAnimated(),c.isPlaying()&&c.reachedEnd()){m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1;let h=c.getDuration();Number.isFinite(h)&&(c.seek(h),e.currentTime=h,_t(h)),Oe("pause"),Pe(),ke(!0);return}c.isPlaying()&&Pe(),ke(!1)}finally{qi=!1}}},ks=d=>{let h=document.querySelectorAll("video, audio");for(let g of h){if(!(g instanceof HTMLMediaElement)||!g.isConnected)continue;let y=Number.parseFloat(g.dataset.start??"");if(!Number.isFinite(y))continue;let w=ve(g.dataset.duration),D=w!=null&&w>0?y+w:1/0;if(d<y||d>=D)continue;let B=je(g),ne=d-y+B;if(ne>=0)try{g.currentTime=ne}catch{}}},$i=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let d=m.startGeneration(),h=document.querySelectorAll("audio[data-start]");for(let g of h){if(!(g instanceof HTMLMediaElement)||!g.isConnected||p(g))continue;let y=Number.parseFloat(g.dataset.start??"");if(!Number.isFinite(y))continue;let w=je(g),D=Number.parseFloat(g.dataset.volume??""),B=Number.isFinite(D)?D:1,ne=ve(g.dataset.duration),$=ne!=null&&ne>0?ne:Number.POSITIVE_INFINITY,de=g.closest("[data-composition-id]");if(de){let J=Q(de,0),te=G(de,{includeAuthoredTimingAttrs:!0});te!=null&&te>0&&($=Math.min($,Math.max(0,J+te-y)))}let Ge=sn(g);ln(g,Ge),(Ge.kind==="web-audio"?m.scheduleMediaElementPlayback(g,y,w,c.now(),B,d,e.playbackRate):Promise.resolve(null)).then(J=>{if(J||!c.isPlaying())return;let te=e.playbackRate*Ce(g),Tt=g.hasAttribute("data-fx-chain")||g.hasAttribute("data-automation");if(Math.abs(te-1)>1e-9){Ge.kind==="web-audio"&&Tt&&(g.muted=!0);return}m.decodeAudioElement(g).then(ye=>{!ye||!c.isPlaying()||m.schedulePlayback(g,ye,y,w,c.now(),B,d,e.playbackRate,$)})})}};function Ms(){m.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&f&&c.isPlaying()&&m.hasBoundedActiveSources()&&(m.stopAll(),$i())}if(e.capturedTimeline){let d=Re(e.capturedTimeline,0);d>0&&c.setDuration(d),at(e.capturedTimeline)}xd(window),e.transportRafId=window.requestAnimationFrame(Rs),wt(),ke(!0),e.controlBridgeHandler=Ds({onPlay:()=>{He.play(),Ne("composition_played",{time:He.getTime()})},onPause:()=>{He.pause(),Ne("composition_paused",{time:He.getTime()})},onStopMedia:()=>{m.stopAll();let d=document.querySelectorAll("video, audio");for(let h of d)h instanceof HTMLMediaElement&&!h.paused&&h.pause()},onSeek:(d,h)=>{He.seek(d),Ne("composition_seeked",{time:d})},onSetMuted:d=>{e.bridgeMuted=d;let h=d||e.mediaOutputMuted;m.setMuted(h);let g=document.querySelectorAll("video, audio");for(let y of g)y instanceof HTMLMediaElement&&(y.muted=h||y.defaultMuted)},onSetVolume:d=>{e.bridgeVolume=d,m.setVolume(d);let h=document.querySelectorAll("video, audio");for(let g of h){if(!(g instanceof HTMLMediaElement))continue;let y=parseFloat(g.dataset.volume??""),w=Number.isFinite(y)?y:1;g.volume=kr(w*d)}},onSetMediaOutputMuted:d=>{e.mediaOutputMuted=d;let h=d||e.bridgeMuted;m.setMuted(h);let g=document.querySelectorAll("video, audio");for(let y of g)y instanceof HTMLMediaElement&&(y.muted=h||y.defaultMuted)},onSetNativeMediaSyncDisabled:d=>{e.nativeMediaSyncDisabled!==d&&(e.nativeMediaSyncDisabled=d,e.mediaForceSyncNextTick=!0,d?(m.stopAll(),c.detachAudioSource()):Pe())},onSetWebAudioMediaDisabled:d=>{e.webAudioMediaDisabled!==d&&(e.webAudioMediaDisabled=d,e.mediaForceSyncNextTick=!0,d&&(m.stopAll(),c.detachAudioSource()),Pe())},onSetPlaybackRate:d=>{zi(d),e.transportClock&&e.transportClock.setRate(e.playbackRate),Ms()},onSetRootDuration:Em,onSetColorGrading:(d,h)=>{qe.setGrading(d,h)},onSetColorGradingCompare:(d,h)=>{qe.setCompare(d,h)},onTick:()=>{if(e.tornDown||!c.isPlaying())return;let d=c.now();if(e.currentTime=d,_t(d),c.reachedEnd()){m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1;let h=c.getDuration();Number.isFinite(h)&&(c.seek(h),e.currentTime=h,_t(h)),Oe("pause"),Pe(),ke(!0)}},onEnablePickMode:()=>vr.enablePickMode(),onDisablePickMode:()=>vr.disablePickMode(),onSetRuntimeData:Ti,onClearRuntimeData:Ri,getCanonicalFps:()=>e.canonicalFps});let ji=()=>{if(!e.tornDown){e.tornDown=!0,e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),e.transportClock=null,m.destroy(),Et!=null&&(window.clearTimeout(Et),Et=null),l!=null&&(window.cancelAnimationFrame(l),l=null),xm(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),r&&(window.removeEventListener("error",r),r=null),i&&(window.removeEventListener("unhandledrejection",i),i=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),vr.disablePickMode();for(let d of e.deterministicAdapters)if(!(!d||typeof d.revert!="function"))try{d.revert()}catch(h){L("runtime.init.site12",h)}e.deterministicAdapters=[];for(let d of o.splice(0))try{d()}catch(h){L("runtime.init.site13",h)}for(let d of e.injectedCompStyles)try{d.remove()}catch(h){L("runtime.init.site14",h)}e.injectedCompStyles=[];for(let d of e.injectedCompLinks)try{d.remove()}catch(h){L("runtime.init.site15",h)}e.injectedCompLinks=[];for(let d of e.injectedCompScripts)try{d.remove()}catch(h){L("runtime.init.site16",h)}e.injectedCompScripts=[],e.capturedTimeline=null,window.__hfRuntimeTeardown===ji&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=ji,e.beforeUnloadHandler=ji,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var Nf=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],rs=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function sy(e){if(e<=255)return Nf[e];let t=0,n=rs.length-1;for(;t<=n;){let r=t+n>>1,i=rs[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return"L"}function ly(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let u=0;u<t;){let c=e.charCodeAt(u),m=c,f=1;if(c>=55296&&c<=56319&&u+1<t){let b=e.charCodeAt(u+1);b>=56320&&b<=57343&&(m=(c-55296<<10)+(b-56320)+65536,f=2)}let p=sy(m);(p==="R"||p==="AL"||p==="AN")&&(r=!0);for(let b=0;b<f;b++)n[u+b]=p;u+=f}if(!r)return null;let i=0;for(let u=0;u<t;u++){let c=n[u];if(c==="L"){i=0;break}if(c==="R"||c==="AL"){i=1;break}}let o=new Int8Array(t);for(let u=0;u<t;u++)o[u]=i;let a=i&1?"R":"L",l=a,s=l;for(let u=0;u<t;u++)n[u]==="NSM"?n[u]=s:s=n[u];s=l;for(let u=0;u<t;u++){let c=n[u];c==="EN"?n[u]=s==="AL"?"AN":"EN":(c==="R"||c==="L"||c==="AL")&&(s=c)}for(let u=0;u<t;u++)n[u]==="AL"&&(n[u]="R");for(let u=1;u<t-1;u++)n[u]==="ES"&&n[u-1]==="EN"&&n[u+1]==="EN"&&(n[u]="EN"),n[u]==="CS"&&(n[u-1]==="EN"||n[u-1]==="AN")&&n[u+1]===n[u-1]&&(n[u]=n[u-1]);for(let u=0;u<t;u++){if(n[u]!=="EN")continue;let c;for(c=u-1;c>=0&&n[c]==="ET";c--)n[c]="EN";for(c=u+1;c<t&&n[c]==="ET";c++)n[c]="EN"}for(let u=0;u<t;u++){let c=n[u];(c==="WS"||c==="ES"||c==="ET"||c==="CS")&&(n[u]="ON")}s=l;for(let u=0;u<t;u++){let c=n[u];c==="EN"?n[u]=s==="L"?"L":"EN":(c==="R"||c==="L")&&(s=c)}for(let u=0;u<t;u++){if(n[u]!=="ON")continue;let c=u+1;for(;c<t&&n[c]==="ON";)c++;let m=u>0?n[u-1]:l,f=c<t?n[c]:l,p=m!=="L"?"R":"L";if(p===(f!=="L"?"R":"L"))for(let v=u;v<c;v++)n[v]=p;u=c-1}for(let u=0;u<t;u++)n[u]==="ON"&&(n[u]=a);for(let u=0;u<t;u++){let c=n[u];(o[u]&1)===0?c==="R"?o[u]++:(c==="AN"||c==="EN")&&(o[u]+=2):(c==="L"||c==="AN"||c==="EN")&&o[u]++}return o}function Lf(e,t){let n=ly(e);if(n===null)return null;let r=new Int8Array(t.length);for(let i=0;i<t.length;i++)r[i]=n[t[i]];return r}var uy=/[ \t\n\r\f]+/g,cy=/[\t\n\r\f]| {2,}|^ | $/;function dy(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function fy(e){if(!cy.test(e))return e;let t=e.replace(uy," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function my(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
704
+ `,qa=new WeakMap;function $a(e){return ef.has(e)}var ef=new WeakSet;function ja(e){let t=qa.get(e);return t||(t=(async()=>{if(!e.audioWorklet)throw new Error("AudioWorklet is unavailable \u2014 the page needs a secure context (https, localhost or file://)");let n=`data:text/javascript;base64,${btoa(String.fromCharCode(...new TextEncoder().encode(_x)))}`;await e.audioWorklet.addModule(n),ef.add(e)})().catch(n=>{throw qa.delete(e),n}),qa.set(e,t)),t}function Tx(e,t,n){let r=.6+Math.max(0,Math.min(1,t))*2.6,i=Math.max(1,Math.floor(e*r)),o=new Float32Array(i),a=Math.round(t*1e3)*2654435761+Math.round(n*1e3)*40503>>>0,l=()=>(a=a*1664525+1013904223>>>0,a/4294967295*2-1),s=Math.max(.001,1-Math.max(0,Math.min(1,n))),u=0,c=0;for(let f=0;f<i;f++){u+=s*(l()-u);let p=u*Math.pow(1-f/i,2.5);o[f]=p,c+=p*p}let m=Math.sqrt(c);if(m>0)for(let f=0;f<i;f++)o[f]=(o[f]??0)/m;return o}var ce=e=>typeof e=="number"?e:Number(e??0),Ka=e=>e/1e3;function of(e,t,n,r){let i=Math.max(1,Math.round(e.sampleRate)),o=e.createBuffer(1,i,e.sampleRate),a=o.getChannelData(0);for(let u=0;u<i;u++){let c=u/i;a[u]=t==="sine"?Math.sin(2*Math.PI*c):4*Math.abs((c+.75)%1-.5)-1}let l=e.createBufferSource();l.buffer=o,l.loop=!0,l.playbackRate.value=n;let s=(r*n%1+1)%1*(i/e.sampleRate);return l.start(typeof e.currentTime=="number"?e.currentTime:0,s),l}function af(e){try{e.stop()}catch{}e.disconnect()}function Ya(e,t){return[{param:e},{param:t,map:n=>1-n}]}function sf(e,t,n){e.gain.value=n,t.gain.value=1-n}function Xa(e,t,n){return{input:e,output:e,update:t,automation:n,dispose:()=>e.disconnect()}}var Rx=new Set(["peaking","highpass","lowpass"]),tf=e=>Math.pow(10,e/20),kx=(e,t)=>{let n=e.createGain(),r=i=>{n.gain.value=tf(ce(i.gain))};return r(t),Xa(n,r,{gain:[{param:n.gain,map:tf}]})};function ur(e,t){return(n,r)=>{let i=n.createBiquadFilter();i.type=e;let o=a=>{i.frequency.value=ce(a.frequency),a.q!==void 0&&(i.Q.value=ce(a.q)),t&&(i.gain.value=ce(a.gain))};return o(r),Xa(i,o,{frequency:[{param:i.frequency}],...Rx.has(e)?{q:[{param:i.Q}]}:{},...t?{gain:[{param:i.gain}]}:{}})}}function Mx(e){return(t,n)=>{let r=Math.tan(Math.PI*ce(n.frequency)/t.sampleRate),i=e==="highpass"?t.createIIRFilter([1/(1+r),-1/(1+r)],[1,(r-1)/(r+1)]):t.createIIRFilter([r/(1+r),r/(1+r)],[1,(r-1)/(r+1)]);return Xa(i,()=>{})}}function cr(e){return(t,n)=>{let r=new AudioWorkletNode(t,e,{processorOptions:{...n}});return{input:r,output:r,update:i=>r.port.postMessage({...i}),dispose:()=>{r.port.postMessage({__hfDispose:!0}),r.disconnect()}}}}var Fx={tanh:Math.tanh,atan:e=>2/Math.PI*Math.atan(Math.PI/2*e),cubic:e=>Math.abs(e)>=1?Math.sign(e):e-e**3/3,exp:e=>Math.sign(e)*(1-Math.exp(-Math.abs(e))),alg:e=>e/Math.sqrt(1+e*e),quintic:e=>Math.abs(e)>=1?Math.sign(e):e-e**5/5,sin:e=>Math.abs(e)>=1?Math.sign(e):Math.sin(Math.PI/2*e),erf:e=>Math.tanh(1.20211*e),hard:e=>Math.max(-1,Math.min(1,e))},Nx=(e,t)=>{let n=e.createWaveShaper(),r=e.createGain(),i=e.createGain();r.connect(n).connect(i);let o=a=>{let l=Fx[String(a.type)]??Math.tanh,s=Math.pow(10,ce(a.threshold)/20),u=8192,c=new Float32Array(u);for(let m=0;m<u;m++){let f=m/(u-1)*2-1;c[m]=l(f/Math.max(1e-6,s))*s}n.curve=c,n.oversample=ce(a.oversample)>=4?"4x":ce(a.oversample)>=2?"2x":"none",i.gain.value=Math.pow(10,ce(a.output)/20)};return o(t),{input:r,output:i,update:o,automation:{output:[{param:i.gain,map:a=>Math.pow(10,a/20)}]},dispose:()=>{r.disconnect(),n.disconnect(),i.disconnect()}}},Lx=(e,t)=>{let n=e.createGain(),r=e.createGain(),i=e.createDelay(5),o=e.createGain(),a=e.createGain(),l=e.createGain();n.connect(i),i.connect(o),o.connect(i),i.connect(a).connect(r),n.connect(l).connect(r);let s=u=>{i.delayTime.value=Math.min(5,ce(u.time)/1e3),o.gain.value=ce(u.feedback),sf(a,l,ce(u.mix))};return s(t),{input:n,output:r,update:s,automation:{time:[{param:i.delayTime,map:u=>Math.min(5,Ka(u))}],feedback:[{param:o.gain}],mix:Ya(a.gain,l.gain)},dispose:()=>[n,r,i,o,a,l].forEach(u=>u.disconnect())}},Dx=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createDelay(.5),a=of(e,"sine",ce(t.speed),n),l=e.createGain(),s=e.createGain(),u=e.createGain();a.connect(l).connect(o.delayTime),r.connect(o).connect(s).connect(i),r.connect(u).connect(i);let c=m=>{o.delayTime.value=ce(m.delay)/1e3,l.gain.value=ce(m.depth)/1e3,a.playbackRate.value=ce(m.speed),sf(s,u,ce(m.mix))};return c(t),{input:r,output:i,update:c,automation:{delay:[{param:o.delayTime,map:Ka}],depth:[{param:l.gain,map:Ka}],speed:[{param:a.playbackRate}],mix:Ya(s.gain,u.gain)},dispose:()=>{af(a),[r,i,o,l,s,u].forEach(m=>m.disconnect())}}},Ix=6,Px=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createGain(),a=e.createGain(),l=of(e,String(t.type)==="1"?"sine":"triangle",ce(t.speed),n),s=e.createGain(),u=e.createGain(),c=e.createGain(),m=[];r.connect(o);let f=o;for(let b=0;b<Ix;b++){let v=e.createBiquadFilter();v.type="allpass",v.Q.value=.7071,s.connect(v.frequency),f.connect(v),f=v,m.push(v)}l.connect(s),f.connect(u).connect(a),o.connect(c).connect(a),a.connect(i);let p=b=>{let v=1e3/Math.max(.1,ce(b.delay));for(let x of m)x.frequency.value=v;s.gain.value=v*ce(b.decay),l.playbackRate.value=ce(b.speed),o.gain.value=ce(b.in_gain),a.gain.value=ce(b.out_gain),u.gain.value=1,c.gain.value=1};return p(t),{input:r,output:i,update:p,automation:{speed:[{param:l.playbackRate}],in_gain:[{param:o.gain}],out_gain:[{param:a.gain}]},dispose:()=>{af(l),[r,i,o,a,s,u,c,...m].forEach(b=>b.disconnect())}}},Ox=(e,t)=>{let n=e.createGain(),r=e.createGain(),i=e.createConvolver(),o=e.createGain(),a=e.createGain();i.normalize=!1,n.connect(i).connect(o).connect(r),n.connect(a).connect(r);let l="",s=u=>{let c=`${ce(u.size)}:${ce(u.damping)}`;if(c!==l){let m=Tx(e.sampleRate,ce(u.size),ce(u.damping)),f=e.createBuffer(1,m.length,e.sampleRate);f.getChannelData(0).set(m),i.buffer=f,l=c}o.gain.value=ce(u.wet),a.gain.value=ce(u.dry)};return s(t),{input:n,output:r,update:s,automation:{wet:[{param:o.gain}],dry:[{param:a.gain}]},dispose:()=>[n,r,i,o,a].forEach(u=>u.disconnect())}},Hx={"gain-node":kx,"biquad-peaking":ur("peaking",!0),"biquad-lowshelf":ur("lowshelf",!0),"biquad-highshelf":ur("highshelf",!0),"biquad-highpass":ur("highpass",!1),"biquad-lowpass":ur("lowpass",!1),"worklet-compressor":cr("hf-compressor"),"worklet-limiter":cr("hf-limiter"),"worklet-gate":cr("hf-gate"),"worklet-bitcrush":cr("hf-bitcrush"),"worklet-pitchshift":cr("hf-pitchshift"),waveshaper:Nx,"delay-feedback":Lx,"chorus-lfo":Dx,"allpass-phaser":Px,convolver:Ox};function lf(e){return e.nodes.some(t=>Sn(t.type)?.web.startsWith("worklet-")??!1)}function Gx(e,t,n,r=0){let i=Sn(t);if(!i)throw new Error(`Unknown effect type: ${t}`);let o=An(t,n);if((t==="highpass"||t==="lowpass")&&String(o.poles)==="1")return Mx(t)(e,o,r);let a=Hx[i.web];if(!a)throw new Error(`No Web Audio builder for ${i.web}`);return a(e,o,r)}function nf(e){let t=[];for(let n of e){let r=n.fromPreset,i=t.at(-1);if(i&&i.preset===r)i.nodes.push(n);else{let o=typeof n.presetAmount=="number"?n.presetAmount:1;t.push({...r?{preset:r}:{},amount:Math.min(1,Math.max(0,o)),nodes:[n]})}}return t}function rf(e){return En(e).map(t=>{let n=An(t.type,t.params),r=n.poles!==void 0?`:${n.poles}`:"",i=String(n.poles)==="1"?`@${n.frequency}`:"",o=t.type==="phaser"?`~${n.type}`:"",a=t.fromPreset?`%${t.fromPreset}`:"";return`${t.type}${r}${i}${o}${a}`}).join("|")}function uf(e,t,n=0){var m;let r=e.createGain(),i=e.createGain(),o=[],a=[],l=nf(En(t)),s=r;for(let f of l){let p=null;if(f.preset){let b=e.createGain(),v=e.createGain(),x=e.createGain(),_=e.createGain();x.gain.value=f.amount,v.gain.value=1-f.amount,s.connect(b),b.connect(v).connect(_),p={entry:b,wet:x,dry:v,join:_},s=b}for(let b of f.nodes){let v=Gx(e,b.type,b.params??{},n);s.connect(v.input),s=v.output,o.push({...b.id?{id:b.id}:{},type:b.type,handle:v})}p&&f.preset&&(s.connect(p.wet).connect(p.join),a.push({id:f.preset,...p}),s=p.join)}s.connect(i);let u=rf(t),c={};for(let f of a)(c[m=f.id]??(c[m]=[])).push(...Ya(f.wet.gain,f.dry.gain));return{input:r,output:i,presets:c,nodes:o,update(f){if(rf(f)!==u)return!1;En(f).forEach((b,v)=>{let x=o[v];x&&(x.handle.update(An(b.type,b.params)),b.id===void 0?delete x.id:x.id=b.id)});let p=0;for(let b of nf(En(f))){if(!b.preset)continue;let v=a[p++];!v||v.id!==b.preset||(v.wet.gain.value=b.amount,v.dry.gain.value=1-b.amount)}return!0},dispose(){for(let{handle:f}of o)f.dispose();for(let{entry:f,wet:p,dry:b,join:v}of a)f.disconnect(),p.disconnect(),b.disconnect(),v.disconnect();r.disconnect(),i.disconnect()}}}var cf={version:1,nodes:[]},df={version:1,lanes:[]};function ff(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(tt):null)??"";if(!n)return df;try{return wl(Dr(n),t)}catch{return df}}function an(e){let t=(typeof e.getAttribute=="function"?e.getAttribute(Rt):null)??"";if(!t)return{chain:cf,raw:""};try{return{chain:Sl(t),raw:t}}catch{return{chain:cf,raw:""}}}function mf(e){return ff(e,an(e).chain)}function Si(e,t,n,r,i){let{chain:o}=an(t),a=null,l=[],s=!1,u=0,c=()=>{try{a?(n.disconnect(a.input),a.output.disconnect(r),a.dispose()):n.disconnect(r)}catch{}a=null},m=(T,M)=>{if(T.nodes.length===0){n.connect(r);return}if(lf(T)&&!$a(e)){n.connect(r);let F=++u;ja(e).then(()=>{s||F!==u||x(an(t).chain)}).catch(()=>{});return}try{let F=uf(e,T,M);n.connect(F.input),F.output.connect(r),a=F}catch{n.connect(r)}},f=(T,M)=>{l=M&&a?Qd(ff(t,T),T,a.nodes,M,a.presets):[]},p=i?{...i}:null;m(o,p?.elapsed??0),f(o,p);let b=()=>{if(!p)return null;let T=typeof e.currentTime=="number"?e.currentTime:p.scheduledAt;return{scheduledAt:T,elapsed:p.elapsed+(T-p.scheduledAt)*p.rate,rate:p.rate}},v=T=>{let M=b();M&&(on(l,M.scheduledAt),f(T,M))},x=T=>{let M=b();on(l,M?.scheduledAt??0),c(),m(T,M?.elapsed??0),f(T,M)},_=null,R=t;return typeof MutationObserver<"u"&&typeof R?.nodeType=="number"&&(_=new MutationObserver(()=>{let T=an(t);l.length>0&&lr(l),!a||!a.update(T.chain)?x(T.chain):v(T.chain)}),_.observe(R,{attributes:!0,attributeFilter:[Rt,tt]})),{reanchor:T=>{if(s)return;let M=b();M&&on(l,M.scheduledAt),p={...T},f(an(t).chain,p)},setRate:T=>{let M=b();s||!M||!Number.isFinite(T)||T<=0||T===M.rate||(p={...M,rate:T},on(l,M.scheduledAt),f(an(t).chain,p))},dispose:()=>{s=!0,_?.disconnect(),l.length>0&&on(l,typeof e.currentTime=="number"?e.currentTime:0),a?.dispose()}}}var pf="runtime_web_audio_bypass";function Ja(e,t){return typeof e.getAttribute=="function"?e.getAttribute(t):null}function dr(e,t){return Ja(e,t)!==null}function Bx(e){return dr(e,"crossorigin")?!0:e.crossOrigin!=null}function Ux(e){return typeof e.baseURI=="string"&&e.baseURI?e.baseURI:typeof document<"u"?document.baseURI:""}function Wx(e){let t=typeof e.currentSrc=="string"?e.currentSrc:"";if(t)return[t];let n=Ja(e,"src");if(n)return[n];if(typeof e.querySelectorAll!="function")return[];let r=[];for(let i of Array.from(e.querySelectorAll("source"))){let o=i.getAttribute("src");o&&r.push(o)}return r}function Vx(e,t){if(typeof window>"u")return!1;let n;try{n=new URL(e,Ux(t))}catch{return!1}return n.protocol!=="http:"&&n.protocol!=="https:"||n.origin===window.location.origin?!1:!Bx(t)}function gf(e){return(typeof e.currentSrc=="string"?e.currentSrc:"")?!0:dr(e,"src")}function sn(e){for(let t of Wx(e))if(Vx(t,e))return{kind:"decode-only",reason:"cross_origin_no_cors",asset:t};return{kind:"web-audio"}}function zx(e){let t=[];dr(e,Rt)&&t.push("fx-chain"),dr(e,tt)&&t.push("automation"),dr(e,Pr)&&t.push("audio-group");let n=Number.parseFloat(Ja(e,"data-volume")??"");return Number.isFinite(n)&&n>1&&t.push("above-unity-gain"),t}function qx(){return typeof window<"u"&&!!window.__HF_EXPORT_RENDER_SEEK_CONFIG}var hf=new WeakSet;function ln(e,t){if(t.kind==="web-audio"||qx()||hf.has(e))return;let n=zx(e);hf.add(e);let r={asset:t.asset,reason:t.reason,lostProcessing:n,note:"cross-origin media without a `crossorigin` opt-in is silent through createMediaElementSource (Web Audio spec); using native playback instead"};xe({source:"hf-preview",type:"diagnostic",code:pf,details:r});let i=n.length>0?` Native playback cannot reproduce: ${n.join(", ")} \u2014 proxy or download the asset to a same-origin URL to keep it.`:"";console.info(`[hyperframes] ${pf}: "${t.asset}" (${t.reason}): Web Audio capture withheld; the track plays through native HTMLMediaElement output.${i}`)}function Qa(e){return!Number.isFinite(e)||e<=0?1:e}function bf(e){return Le(e)}function $x(e,t){t||e.paused||!Ar().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function jx(e,t){let{elapsed:n,mediaStart:r,scheduledAt:i,globalRate:o,mediaRate:a,clipDuration:l}=t,s=Number.isFinite(l)&&l>0,u=l*a;if(n>=0){let m=n*a,f=u-m;return s&&f<=0?!1:(s?e.start(0,m+r,f):e.start(0,m+r),!0)}let c=-n/o;return s?e.start(i+c,r,u):e.start(i+c,r),!0}function Ai(e,t,n){let r=Zd(mf(e));r&&za([{param:t.gain}],r,Lr.scale,n)}function fr(e){return e.sourceKind==="buffer"}var Ei=class{constructor(){ge(this,"_ctx",null);ge(this,"_bufferCache",new Map);ge(this,"_failedSrcs",new Set);ge(this,"_mediaElementSources",new WeakMap);ge(this,"_activeSources",[]);ge(this,"_masterGain",null);ge(this,"_masterVolume",1);ge(this,"_masterMuted",!1);ge(this,"_groups",new Map);ge(this,"_rateAnchorCtx",0);ge(this,"_rateAnchorComp",0);ge(this,"_rate",1);ge(this,"_paused",!0);ge(this,"_playGeneration",0)}async init(){try{return this._ctx=new AudioContext,this._masterGain=this._ctx.createGain(),this._masterGain.connect(this._ctx.destination),this.applyMasterGain(),!0}catch{return!1}}get context(){return this._ctx}getTime(){return!this._ctx||this._paused?-1:this._rateAnchorComp+(this._ctx.currentTime-this._rateAnchorCtx)*this._rate}async decodeAudioElement(t){let n=t.currentSrc||t.getAttribute("src");if(!n)return null;if(this._bufferCache.has(n))return this._bufferCache.get(n);if(this._failedSrcs.has(n)||!this._ctx)return null;let r;try{let i=await fetch(n,{cache:"no-store"});if(!i.ok)return L("webAudioTransport.fetch",new Error(`${i.status} ${n}`)),null;r=await i.arrayBuffer()}catch(i){return L("webAudioTransport.fetch",i),null}try{let i=await this._ctx.decodeAudioData(r);return this._bufferCache.set(n,i),i}catch(i){return this._failedSrcs.add(n),L("webAudioTransport.decode",i),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}acquireMediaElementSource(t){let n=this._mediaElementSources.get(t);if(n){let o=sn(t);if(o.kind!=="web-audio"){try{n.disconnect()}catch{}return this._mediaElementSources.delete(t),ln(t,o),null}return n}if(!this._ctx)return null;let r=sn(t);if(r.kind!=="web-audio")return ln(t,r),null;let i=this._ctx.createMediaElementSource(t);return this._mediaElementSources.set(t,i),i}async scheduleMediaElementPlayback(t,n,r,i,o,a,l=1){if(!this._ctx||!this._masterGain||a!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),a!==this._playGeneration)return null;let s=this.acquireMediaElementSource(t);if(!s)return null;let u=Qa(l),c=this._ctx.createGain();c.gain.value=o;let m=this._ctx.currentTime,f=i-n,p={scheduledAt:m,elapsed:f,rate:u},b=Si(this._ctx,t,s,c,p);c.connect(this.resolveDestination(t,m,i,u)??this._masterGain),Ai(t,c,p),this._rate=u,this._rateAnchorCtx=m,this._rateAnchorComp=i;let v={fx:b,el:t,sourceNode:s,sourceKind:"media-element",gainNode:c,compositionStart:n,mediaStart:r,scheduledAt:m,priorMuted:t.muted,priorVolume:t.volume,mediaPlaybackRate:Ce(t),bounded:!1};return t.volume=1,this._activeSources.push(v),this._paused=!1,v}catch(s){return L("webAudioTransport.mediaElementSource",s),null}}groupInput(t,n,r){let i=this._groups.get(t);if(i){if(i.generation!==this._playGeneration)try{i.reanchor(r),i.generation=this._playGeneration}catch(f){L("webAudioTransport.groupReanchor",f)}return i.input}if(!this._ctx||!this._masterGain)return null;let o=this._ctx.createGain(),a=this._ctx.createGain();a.connect(this._masterGain);let l=()=>mo(n,t),s=l(),u=this._ctx.createGain();u.gain.value=s?.hasAttribute("data-hidden")?0:1,u.connect(a);let c=this._ctx.createGain();c.gain.value=bf(fo(s)),c.connect(u);let m=Si(this._ctx,s??{getAttribute:()=>null},o,c,r);return s&&Ai(s,c,r),this._groups.set(t,{input:o,fader:c,muteGain:u,fx:m,generation:this._playGeneration,reanchor:f=>{lr([{param:c.gain}]);let p=l();c.gain.value=bf(fo(p)),u.gain.value=p?.hasAttribute("data-hidden")?0:1,m?.reanchor(f),p&&Ai(p,c,f)},dispose:()=>{try{m?.dispose(),o.disconnect(),c.disconnect(),u.disconnect(),a.disconnect()}catch{}}}),o}setGroupMuted(t,n){let r=this._groups.get(t);if(r)try{r.muteGain.gain.value=n?0:1}catch(i){L("webAudioTransport.setGroupMuted",i)}}resolveDestination(t,n,r,i){if(!this._masterGain)return null;let o=Rl(t);if(!o)return this._masterGain;let a={scheduledAt:n,elapsed:r,rate:i};return this.groupInput(o,t.ownerDocument,a)??this._masterGain}handleSourceEnded(t,n,r,i){let o=this._activeSources.indexOf(n);if(o!==-1){this._activeSources.splice(o,1),r.muted=i;try{t.disconnect(),n.fx?.dispose(),n.gainNode.disconnect()}catch{}this._activeSources.length===0&&(this._paused=!0)}}async schedulePlayback(t,n,r,i,o,a,l,s=1,u=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||l!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),l!==this._playGeneration)return null;let c=Qa(s),m=Ce(t),f=c*m,p=this._ctx.createBufferSource();p.buffer=n,p.playbackRate.value=f;let b=this._ctx.createGain();b.gain.value=a;let v=o-r,x=this._ctx.currentTime,_={scheduledAt:x,elapsed:v,rate:c},R=Si(this._ctx,t,p,b,_);if(b.connect(this.resolveDestination(t,x,o,c)??this._masterGain),Ai(t,b,_),this._rate=c,this._rateAnchorCtx=x,this._rateAnchorComp=o,!jx(p,{elapsed:v,mediaStart:i,scheduledAt:x,globalRate:c,mediaRate:m,clipDuration:u}))return p.disconnect(),R?.dispose(),b.disconnect(),null;let T=t.muted;t.muted=!0,$x(t,T);let M={fx:R,el:t,sourceNode:p,sourceKind:"buffer",gainNode:b,compositionStart:r,mediaStart:i,scheduledAt:x,priorMuted:T,priorVolume:t.volume,mediaPlaybackRate:m,bounded:Number.isFinite(u)&&u>0};return this._activeSources.push(M),this._paused=!1,p.addEventListener("ended",()=>this.handleSourceEnded(p,M,t,T)),M}catch(c){return L("webAudioTransport.schedule",c),null}}setRate(t){let n=Qa(t);if(n===this._rate)return!1;this._ctx&&!this._paused&&(this._rateAnchorComp=this.getTime(),this._rateAnchorCtx=this._ctx.currentTime),this._rate=n;for(let r of this._activeSources)try{fr(r)&&(r.sourceNode.playbackRate.value=n*r.mediaPlaybackRate),r.fx?.setRate(n)}catch(i){L("webAudioTransport.setRate",i)}for(let r of this._groups.values())try{r.fx?.setRate(n)}catch(i){L("webAudioTransport.setRate.group",i)}return!0}hasBoundedActiveSources(){return this._activeSources.some(t=>fr(t)&&t.bounded)}stopAll(){for(let t of this._activeSources){try{fr(t)&&t.sourceNode.stop(),t.sourceNode.disconnect(),t.fx?.dispose(),t.gainNode.disconnect()}catch{}fr(t)?t.el.muted=t.priorMuted:t.el.volume=t.priorVolume}this._activeSources=[],this._paused=!0}setVolume(t){this._masterVolume=Math.max(0,Math.min(1,t)),this.applyMasterGain()}setElementVolume(t,n){let r=Le(n);for(let i of this._activeSources)if(i.el===t)try{i.sourceKind==="media-element"&&(i.el.volume=1),i.gainNode.gain.value=r}catch(o){L("webAudioTransport.setElementVolume",o)}}setMuted(t){this._masterMuted=t,this.applyMasterGain()}applyMasterGain(){this._masterGain&&(this._masterGain.gain.value=this._masterMuted?0:this._masterVolume)}isActive(){return this._activeSources.length>0&&!this._paused}ownsElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t&&fr(n))}routesElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t)}destroy(){this.stopAll();for(let t of this._groups.values())t.dispose();if(this._groups.clear(),this._bufferCache.clear(),this._failedSrcs.clear(),this._mediaElementSources=new WeakMap,this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null,this._masterVolume=1,this._masterMuted=!1}};var xf="data-hf-studio-manual-edit-gesture";function yf(e){return!Number.isInteger(e.tick)||e.tick<=0||e.tick%60!==0?!1:!(e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2)}var Kx=/^\s*spring\(\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*\)\s*$/;function vf(e){return Math.max(0,Math.min(1,e))}function Sf(e){let t=Kx.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?vf(n):null}function Af(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=vf(t),r=12-n*6,i=Math.PI*2*(1+n*1.5),o=1-Math.exp(-r)*Math.cos(i);return(1-Math.exp(-r*e)*Math.cos(i*e))/o}var Yx=/^\s*wiggle\(\s*(\d+)\s*,\s*(easeOut|easeInOut|anticipate|uniform)\s*(?:,\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?)\s*)?\)\s*$/,Xx=Math.PI*2;function Jx(e){let t=Yx.exec(e);if(!t)return null;let n=Number(t[1]);if(!Number.isSafeInteger(n)||n<1)return null;let r=t[2];if(r!=="easeOut"&&r!=="easeInOut"&&r!=="anticipate"&&r!=="uniform")return null;if(t[3]===void 0)return{wiggles:n,type:r};let i=Number(t[3]);return!Number.isFinite(i)||i<0||i>1?null:{wiggles:n,type:r,amplitude:i}}function Qx(e,t,n,r){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let i=r??(n==="easeInOut"?.08:n==="uniform"?.14:n==="anticipate"?.12:.16),o=n==="easeInOut"?i*Math.sin(Math.PI*e):n==="uniform"?i:i*(1-e);return e+(n==="anticipate"?-1:1)*o*Math.sin(Xx*t*e)}function Ef(e,t){let n=Jx(e);if(!n)return null;let r=`${n.wiggles}:${n.type}:${n.amplitude??"default"}`,i=t?.get(r);if(i)return i;let o=a=>Qx(a,n.wiggles,n.type,n.amplitude);return t?.set(r,o),o}var Zx=24,wf=e=>e>=1?1:0,ey=e=>e,wi=String.raw`([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)`,ty=new RegExp(String.raw`^\s*M\s*0\s*,\s*0\s+C\s*${wi}\s*,\s*${wi}\s+${wi}\s*,\s*${wi}\s+1\s*,\s*1\s*$`,"i");function Cf(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function ny(e,t,n,r,i){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let o=0,a=1;for(let l=0;l<Zx;l+=1){let s=(o+a)/2;Cf(s,t,r)<e?o=s:a=s}return Cf((o+a)/2,n,i)}function ry(e){let t=ty.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),o=Number(t[4]);return Math.min(n,i)<0||Math.max(n,i)>1?null:a=>ny(a,n,r,i,o)}function iy(e,t){if(!e.startsWith("spring("))return null;let n=Sf(e);if(n===null)return null;let r=t.get(n);if(r)return r;let i=o=>Af(o,n);return t.set(n,i),i}function oy(e,t){if(!e.startsWith("custom(")||!e.endsWith(")"))return null;let n=e.slice(7,-1),r=t.get(n);if(r)return r;let i=ry(n);return i&&t.set(n,i),i}function _f(e){if(e.__hfCustomEaseInstalled)return!0;let t=e.parseEase;if(!t)return!1;let n=new Map,r=new Map,i=new Map,o=s=>typeof s!="string"?null:s==="hold"?wf:Ef(s,i)??iy(s,r)??oy(s,n),a=(s,u,c=[])=>{let m=o(s);return m||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\(|$)/.test(s.trim())&&Ne("custom_ease_parse_failed",{ease:s}),t.call(u,s,...c)??ey)};e.parseEase=function(u,...c){return a(u,this,c)};let l=e.registerEase;if(typeof l=="function"){l("hold",wf);let s=u=>{let c=m=>m;c.config=(...m)=>a(`${u}(${m.join(",")})`,e),l(u,c)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}var _i=new Map,Ci=new Map,Tf=()=>{};function Za(e){return/^[a-z][a-z0-9-]{0,63}$/.test(e)}function es(e,t){let n=Ci.get(e);if(n)try{n(t)}catch(r){Tf(e,r)}}function Rf(e){Tf=e}function Ti(e,t){Za(e)&&(_i.set(e,t),es(e,t))}function Ri(e){Za(e)&&(_i.delete(e),es(e,void 0))}function kf(e,t){if(!Za(e))throw new Error(`Invalid HyperFrames runtime-data channel: ${e}`);return Ci.set(e,t),_i.has(e)&&es(e,_i.get(e)),()=>{Ci.get(e)===t&&Ci.delete(e)}}var ts="data-hf-authored-duration",ns="data-hf-authored-end",Mf=!1;function at(e){if(e){if(typeof e.pause!="function"){Mf||(Mf=!0,Ne("timeline_missing_pause",{}));return}try{e.pause()}catch(t){L("runtime.timeline.pause",t)}}}function ay(){let e=window.__HF_EXPORT_RENDER_SEEK_CONFIG,t=e?.fps,n=e?.fpsSource,r=Number(t);return!e||t==null?{fps:null,source:"default",rawFpsSource:n,rawFps:t,fallbackReason:"missing"}:!Number.isFinite(r)||r<=0?{fps:null,source:"default",rawFpsSource:n,rawFps:t,fallbackReason:"invalid"}:{fps:r,source:n==="render-options"||n==="default"?n:"unknown",rawFpsSource:n,rawFps:t,fallbackReason:e.fpsFallbackReason}}function Ff(){let e=gu();Is(xe),Rf((d,h)=>{xe({source:"hf-preview",type:"runtime-data-error",channel:d,message:h instanceof Error?h.message:String(h)})}),ci(document),Na(document),kl(document);let t=ay();e.canonicalFps=t.fps??e.canonicalFps,Ls(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG&&console.info("[hyperframes] render runtime fps",{canonicalFps:e.canonicalFps,source:t.source,rawFpsSource:t.rawFpsSource,rawFps:t.rawFps,fallbackReason:t.fallbackReason});let n=null,r=null,i=null,o=[],a=new Set,l=null,s=new Set,u=(d,h,g)=>{s.has(d)||(s.add(d),Ne(h,g))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(d){L("runtime.init.site1",d)}let c=new vi;e.transportClock=c;let m=new Ei,f=!1;m.init().then(d=>{f=d}),window.__hf=window.__hf||{};let p=d=>d.closest("[data-hidden]")!==null||Or(d.ownerDocument,d),b=()=>{let d=window.gsap,h=window;if(!(!d?.registerPlugin||h.__hfAutoNoopRegistered))try{d.registerPlugin({name:"_auto",init:()=>!1}),h.__hfAutoNoopRegistered=!0}catch(g){u("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),L("runtime.autoMarker.install",g)}},v=()=>{let d=window.gsap;if(!d){u("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{_f(d)||u("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(h){u("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),L("runtime.customEase.install",h)}};b(),v(),document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden");try{Ws(document)}catch(d){L("runtime.init.cssVariables",d)}window.__timelines=window.__timelines||{};let x=()=>{let d=document.querySelector('[data-composition-id][data-root="true"]');if(d instanceof HTMLElement)return d;let h=Array.from(document.querySelectorAll("[data-composition-id]"));return h.find(g=>!g.parentElement?.closest("[data-composition-id]"))??h[0]??null};if(Array.isArray(window.__timelines)){let d=window.__timelines,h=x()?.getAttribute("data-composition-id")??"root",g={};if(d.length===1)g[h]=d[0];else for(let y=0;y<d.length;y++)g[`tl-${y}`]=d[y];window.__timelines=g}let _=x();_&&!_.hasAttribute("data-start")&&_.setAttribute("data-start","0");let R=d=>{o.push(d)},T=(d,h,g)=>{let y=g??`${d}:${JSON.stringify(h)}`;a.has(y)||(a.add(y),xe({source:"hf-preview",type:"diagnostic",code:d,details:h}))},M=d=>{let h={scale:1,focusX:960,focusY:540},g=[],y=[],w={time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:d.play,pause:d.pause,seek:d.seek,getTime:d.getTime,getDuration:d.getDuration,isPlaying:d.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>h,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>g,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:d.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>y,getRenderState:()=>({...w,time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying()})}},F=1/60,E=.75,S=.05,A=100,C=240,N=d=>{if(d instanceof Error)return d.message||String(d);if(typeof d=="string")return d;try{return JSON.stringify(d)}catch{return String(d??"")}},I=d=>{let h=d.toLowerCase();return h.includes("cannot read properties of null")||h.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:h.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:h.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},W=d=>{if(d==null||d.trim()==="")return null;let h=Number.parseFloat(d);return!Number.isFinite(h)||h<=0?null:`${h}px`},B=()=>x(),oe=()=>{let d=B();if(!d)return;let h=W(d.getAttribute("data-width")),g=W(d.getAttribute("data-height"));h&&(d.style.width=h),g&&(d.style.height=g),h&&d.style.setProperty("--comp-width",h),g&&d.style.setProperty("--comp-height",g)},k=()=>{let d=B(),h=Array.from(document.querySelectorAll("[data-composition-id]")).filter(g=>g.hasAttribute("data-duration")||g.hasAttribute("data-end"));for(let g of h){if(d&&g===d)continue;let y=g.getAttribute("data-duration"),w=g.getAttribute("data-end");y!=null&&!g.hasAttribute(ts)&&g.setAttribute(ts,y),w!=null&&!g.hasAttribute(ns)&&g.setAttribute(ns,w),g.removeAttribute("data-duration"),g.removeAttribute("data-end")}},V=()=>{let d=B();if(!d)return;d.style.position||(d.style.position="relative"),d.style.overflow="hidden";let h=W(d.getAttribute("data-width")),g=W(d.getAttribute("data-height"));h&&(d.style.width=h),g&&(d.style.height=g);let y=Array.from(d.children);for(let w of y){let D=w.tagName.toLowerCase();if(D==="script"||D==="style"||D==="link"||D==="meta"||!w.hasAttribute("data-start")||w.hasAttribute("data-hf-autostamped"))continue;let U=(w.style.top==="0px"||w.style.top==="0")&&(w.style.left==="0px"||w.style.left==="0")&&w.style.width==="100%"&&w.style.height==="100%",ne=/translate\(\s*-50%\s*,\s*-50%\s*\)/.test(w.style.transform);if(U&&ne&&!w.hasAttribute("data-width")&&!w.hasAttribute("data-height")){let te=w.style.top,Tt=w.style.left,ye=w.style.width,gn=w.style.height;w.style.top="",w.style.left="",w.style.width="",w.style.height="";let ae=window.getComputedStyle(w);ae.top!=="auto"||ae.bottom!=="auto"||ae.left!=="auto"||ae.right!=="auto"||ae.width!=="0px"||ae.height!=="0px"||(w.style.top=te,w.style.left=Tt,w.style.width=ye,w.style.height=gn)}let $=window.getComputedStyle(w),de=$.position;if(de!=="absolute"&&de!=="fixed"&&(w.style.position="absolute"),!!w.style.top||!!w.style.bottom||$.top!=="auto"||$.bottom!=="auto"||(w.style.top="0"),!!w.style.left||!!w.style.right||$.left!=="auto"||$.right!=="auto"||(w.style.left="0"),D!=="audio"){let te=W(w.getAttribute("data-width")),Tt=W(w.getAttribute("data-height")),ye=$.width!=="0px"&&$.width!=="auto",gn=$.height!=="0px"&&$.height!=="auto";te?!w.style.width&&!ye&&(w.style.width=te):!w.style.width&&$.width==="0px"&&(w.style.width="100%"),Tt?!w.style.height&&!gn&&(w.style.height=Tt):!w.style.height&&$.height==="0px"&&(w.style.height="100%")}}},Q=(d,h=0,g)=>mt({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:g?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(d,h),G=(d,h)=>mt({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:h?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(d),H=d=>{let h=d.closest("[data-composition-id]"),g=h?Q(h,0):null,y=h?G(h,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:h,inheritedStart:g,inheritedDuration:y}},z=d=>{let h=H(d),g=h.inheritedStart??0,y=Bt(d.getAttribute("data-start"));if(d.hasAttribute("data-hf-auto-start")||y==null||g<=0)return Q(d,g);let w=h.inheritedDuration,D=w!=null&&w>0?g+w:null;return y>=g&&(D==null||y<D)?y:g+y};window.__hfResolveMediaStartSeconds=z,o.push(()=>{window.__hfResolveMediaStartSeconds===z&&delete window.__hfResolveMediaStartSeconds});let X=(d,h)=>{let g=d.tagName.toLowerCase();if(g==="script"||g==="style"||g==="link"||g==="meta")return!1;let w=g==="video"||g==="audio"?z(d):Q(d,0),D=G(d),U=d.getAttribute("data-composition-id");if(U){let $=(window.__timelines??{})[U],de=null;if($&&typeof $.duration=="function"){let Me=Number($.duration());Number.isFinite(Me)&&Me>0&&(de=Me)}!(d.hasAttribute("data-duration")||d.hasAttribute("data-end")||d.hasAttribute(ts)||d.hasAttribute(ns))&&(D==null||D<=0)&&de!=null&&(D=de)}let ne=D!=null&&D>0?w+D:Number.POSITIVE_INFINITY;return h>=w&&(Number.isFinite(ne)?h<ne:!0)},we=!!document.querySelector("[data-composition-src]"),q=!1;{let d=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let h of d){let g=h.getAttribute("data-composition-id");if(g&&h.children.length===0&&document.querySelector(`template#${CSS.escape(g)}-template`)){q=!0;break}}}let P=!we&&!q,O=d=>{if(!d||typeof d.duration!="function")return null;try{let h=Number(d.duration());return Number.isFinite(h)?Math.max(0,h):null}catch{return null}},j=d=>typeof d=="number"&&Number.isFinite(d)&&d>F,le=d=>{let h=ve(d.getAttribute("data-duration"));return h!=null&&h>0?h:Number.isFinite(d.duration)?Ze(d,d.duration):null},ee=()=>{let d=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(d.length===0)return null;let h=0;for(let g of d){let y=z(g);if(!Number.isFinite(y))continue;let w=le(g);w==null||w<=F||(h=Math.max(h,Math.max(0,y)+w))}return h>F?h:null},K=()=>{let d=B();if(!d)return null;let h=window.__timelines??{},g=mt({timelineRegistry:h,includeAuthoredTimingAttrs:!0}),y=0,w=ve(d.getAttribute("data-duration"));w!=null&&w>0&&(y=w);let D=Array.from(d.querySelectorAll("[data-composition-id][data-start]"));for(let U of D){if(!(U instanceof Element)||U.parentElement?.closest("[data-composition-id]")!==d)continue;let $=g.resolveStartForElement(U,0),de=g.resolveDurationForElement(U);!Number.isFinite($)||de==null||de<=0||(y=Math.max(y,Math.max(0,$)+de))}return y>F?y:null},Y=()=>{let d=ee();return typeof d!="number"||!Number.isFinite(d)||d<=F?null:d},Ve=d=>j(d)?Math.max(F,d*E):F,Fe=()=>{let d=0;for(let h of e.deterministicAdapters){let g=h.getInferredDurationSeconds;if(typeof g!="function")continue;let y=null;try{y=g()}catch(w){L("runtime.init.adapterDuration",w)}typeof y=="number"&&Number.isFinite(y)&&y>0&&(d=Math.max(d,y))}return d>F?d:null},Re=(d,h=0)=>{let g=O(d),y=Y(),w=K(),D=Fe(),U=Math.max(y??0,w??0,D??0),ne=Number.isFinite(h)&&h>F?h:0,$=0;return j(g)?$=Math.max(g,U,ne):j(U)?$=Math.max(U,ne):$=ne,$>0?Math.max(0,$):0},ze=()=>{let d=window.__timelines??{},h=ae=>{let re=Object.entries(d).filter(se=>!!se[1]&&typeof se[1].play=="function"&&typeof se[1].pause=="function");if(re.length!==1)return{timeline:null};let he=re[0];if(!he)return{timeline:null};let[be,fe]=he;return{timeline:fe,selectedTimelineIds:[be],selectedDurationSeconds:O(fe),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:ae,soleTimelineId:be}}}},g=mt({timelineRegistry:d,includeAuthoredTimingAttrs:!0}),y=Y(),w=K(),D=Math.max(y??0,w??0)||null,U=Ve(D),ne=ae=>{let re=document.querySelector(`[data-composition-id="${CSS.escape(ae)}"]`);return re?g.resolveStartForElement(re,0):0},$=ae=>{let re=window.gsap;if(!re||typeof re.timeline!="function")return null;let he=re.timeline({paused:!0});for(let be of ae)he.add(be.timeline,ne(be.compositionId));return he},de=(ae,re)=>{if(!j(ae))return null;let he=window.gsap;if(!he||typeof he.timeline!="function")return null;let be=he.timeline({paused:!0});if(re)try{be.add(re,0)}catch(se){L("runtime.init.site2",se)}let fe=be;if(typeof fe.to=="function")try{fe.to({},{duration:ae})}catch(se){L("runtime.init.site3",se)}return be},Ge=(ae,re)=>{let he=ae;if(typeof he.getChildren!="function")return[];try{let be=he.getChildren(!0,!0,!0)??[];if(!Array.isArray(be))return[];let fe=[];for(let se of re)if(!be.some(Qe=>Qe===se.timeline))try{let Qe=ne(se.compositionId);ae.add(se.timeline,Qe),fe.push(se.compositionId)}catch(Qe){L("runtime.init.site4",Qe)}return fe}catch{return[]}},Me=B(),J=Me?.getAttribute("data-composition-id")??null;if(!J)return h("root_missing_composition_id");let te=d[J]??null,ye=(()=>{if(!Me)return[];let ae=new Set,re=Array.from(Me.querySelectorAll("[data-composition-id]")),he=[];for(let be of re){let fe=be.getAttribute("data-composition-id");if(!fe||fe===J||ae.has(fe))continue;ae.add(fe);let se=d[fe]??null;if(!se||typeof se.play!="function"||typeof se.pause!="function")continue;let lt=O(se);he.push({compositionId:fe,timeline:se,durationSeconds:lt??0})}return he})(),gn=ae=>{for(let re of ae){let he=re.timeline;if(typeof he.paused=="function")try{he.paused(!1)}catch(be){L("runtime.init.site5",be)}}};if(ye.length>0&&gn(ye),te){let ae=ye.length>0?Ge(te,ye):[];if((ye.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id='"+J+"'])"))&&(Pi=!0),ae.length>0)try{let fe=te.time();te.seek(fe,!1)}catch{}let re=O(te);if(!j(re)&&ye.length>0){let fe=ye.map(Lm=>Lm.compositionId),se=$(ye),lt=O(se);if(se&&j(lt))return{timeline:se,selectedTimelineIds:fe,selectedDurationSeconds:lt,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:J,rootDurationSeconds:re,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:U,selectedDurationSeconds:lt,mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:w,selectedTimelineIds:fe,autoNestedChildren:ae}}};let Qe=de(D??0,te),Ki=O(Qe);if(Qe&&j(Ki))return{timeline:Qe,selectedTimelineIds:[J],selectedDurationSeconds:Ki,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:J,rootDurationSeconds:re,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:w,selectedDurationSeconds:Ki,selectedTimelineIds:[J],autoNestedChildren:ae}}}}if(!j(re)&&ye.length===0){let fe=de(D??0,te),se=O(fe);if(fe&&j(se))return{timeline:fe,selectedTimelineIds:[J],selectedDurationSeconds:se,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:J,rootDurationSeconds:re,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:w,selectedDurationSeconds:se,selectedTimelineIds:[J]}}}}let he=ve(Me?.getAttribute("data-duration")),be=Math.max(j(he)?he:0,w??0);if(be>0&&j(be)&&j(re)&&be>=re+.5){let fe=te;if(typeof fe.to=="function")try{fe.to({},{duration:0},be)}catch(lt){L("runtime.init.site6",lt)}let se=O(te);if(j(se))return{timeline:te,selectedTimelineIds:[J],selectedDurationSeconds:se,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:J,rootDurationSeconds:re,rootDeclaredDur:he,authoredCompositionDurationFloorSeconds:w,newDur:se}}}}return{timeline:te,selectedTimelineIds:[J],selectedDurationSeconds:re,mediaDurationFloorSeconds:y,diagnostics:ae.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:J,selectedDurationSeconds:re,autoNestedChildren:ae}}:void 0}}if(ye.length>0){let ae=ye.map(be=>be.compositionId),re=$(ye),he=O(re);if(re)return{timeline:re,selectedTimelineIds:ae,selectedDurationSeconds:he,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:J,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:U,selectedDurationSeconds:he,mediaDurationFloorSeconds:y,selectedTimelineIds:ae}}}}return h("root_composition_id_unmatched_in_registry")},Pi=!1,fm=d=>{let h=window.gsap,g=d;if(!(!g||typeof g.getChildren!="function"||!h||typeof h.parseEase!="function"))for(let y of g.getChildren(!0,!0,!0)){let w=y,D=w.timeline;if(!D||!("_ease"in D)||typeof D._ease=="function")continue;let U=w.vars?.keyframes,$=(U&&!Array.isArray(U)?U.ease:void 0)??w.vars?.ease??"none";try{let de=h.parseEase($);typeof de=="function"&&(D._ease=de)}catch(de){Ne("keyframe_ease_repair_failed",{ease:typeof $=="string"?$:String($)}),L("runtime.keyframeEase.repair",de)}}},dn=()=>{if(v(),!P)return!1;let d=e.capturedTimeline,h=O(d),g=j(h);if(d&&g&&Pi)return!1;let y=ze();if(!y.timeline)return!1;if(d&&d===y.timeline)return typeof d.timeScale=="function"&&d.timeScale(e.playbackRate),!1;e.capturedTimeline=y.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),fm(e.capturedTimeline);let w=Re(e.capturedTimeline,0);if(w<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),at(e.capturedTimeline)),w>0){try{c.setDuration(w)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let U=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(U,!1),at(e.capturedTimeline)}let D=window.__hfStudioManualEditsApply;typeof D=="function"&&D(),ci(document)}if(y.diagnostics&&xe({source:"hf-preview",type:"diagnostic",code:y.diagnostics.code,details:y.diagnostics.details}),xe({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:y.selectedTimelineIds??[],selectedDurationSeconds:y.selectedDurationSeconds??null,mediaDurationFloorSeconds:y.mediaDurationFloorSeconds??null}}),window.parent!==window){let D=B(),U=w>0?w:0,ne=String(U>0?U:1),$=new Set,de=J=>J.tagName.toLowerCase()===Wt,Ge=new Set(document.querySelectorAll("[data-start]")),Me=J=>{let te=J.parentElement;for(;te&&te!==D;){if(Ge.has(te))return!0;te=te.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let J of e.capturedTimeline.getChildren(!0))if(typeof J.targets=="function")for(let te of J.targets())te instanceof HTMLElement&&te!==D&&(de(te)||te.hasAttribute("data-start")||Me(te)||$.has(te)||($.add(te),te.setAttribute("data-start","0"),te.setAttribute("data-duration",ne),te.setAttribute("data-hf-autostamped","1")))}catch{}if(D instanceof HTMLElement)for(let J of D.querySelectorAll("[id]"))J instanceof HTMLElement&&J!==D&&(J.hasAttribute("data-start")||Me(J)||$.has(J)||J.tagName==="SCRIPT"||J.tagName==="STYLE"||J.tagName==="LINK"||de(J)||($.add(J),J.setAttribute("data-start","0"),J.setAttribute("data-duration",ne),J.setAttribute("data-hf-autostamped","1")))}for(let D of fn)hr.delete(D),xs(D);return!0};window.__hfForceTimelineRebind=()=>{Pi=!1,dn(),Ui(e.currentTime)};let mm=()=>{let d=B();if(!(d instanceof HTMLElement))return;let h=d.getBoundingClientRect(),g=Number(d.getAttribute("data-width")),y=Number(d.getAttribute("data-height")),w=window.getComputedStyle(d),D=Number.isFinite(g)&&g>0&&Number.isFinite(y)&&y>0,U=h.width<=0||h.height<=0||d.clientWidth<=0||d.clientHeight<=0;!D||!U||T("root_stage_layout_zero",{compositionId:d.getAttribute("data-composition-id")??null,declaredWidth:g,declaredHeight:y,rectWidth:Math.round(h.width),rectHeight:Math.round(h.height),clientWidth:d.clientWidth,clientHeight:d.clientHeight,display:w.display,visibility:w.visibility,overflow:w.overflow},`root-stage-layout-zero:${d.getAttribute("data-composition-id")??"unknown"}`)},pm=()=>{e.tornDown||(l!=null&&window.cancelAnimationFrame(l),l=window.requestAnimationFrame(()=>{l=null,mm()}))},hm=()=>{r=d=>{let h=N(d.error??d.message).slice(0,C);if(!h)return;let g=I(h);xe({source:"hf-preview",type:"diagnostic",code:g.code,details:{category:g.category,message:h,filename:d.filename||null,line:Number.isFinite(d.lineno)?d.lineno:null,column:Number.isFinite(d.colno)?d.colno:null}})},i=d=>{let h=N(d.reason).slice(0,C);if(!h)return;let g=I(h);xe({source:"hf-preview",type:"diagnostic",code:`${g.code}_unhandled_rejection`,details:{category:`${g.category}-unhandled-rejection`,message:h}})},window.addEventListener("error",r),window.addEventListener("unhandledrejection",i)},gm=()=>{let d=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let g of d){let y=()=>{if(!(g instanceof Element))return;let w=g.tagName.toLowerCase(),D=g.getAttribute("src")??g.getAttribute("href")??g.getAttribute("poster")??null,U=w==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";T(U,{tagName:w,assetUrl:D,currentSrc:(g instanceof HTMLImageElement||g instanceof HTMLMediaElement)&&g.currentSrc||null,readyState:g instanceof HTMLMediaElement?g.readyState:null,networkState:g instanceof HTMLMediaElement?g.networkState:null},`${U}:${w}:${D??"unknown"}`)};g.addEventListener("error",y),R(()=>{g.removeEventListener("error",y)})}let h=document.fonts;h&&h.ready.then(()=>{if(e.tornDown)return;let g=Array.from(h).filter(y=>y.status==="error").map(y=>y.family).filter(y=>!!y).slice(0,10);g.length!==0&&T("runtime_font_load_issue",{failedFamilies:g,totalFaces:Array.from(h).length},`runtime-font-load-issue:${g.join("|")}`)}).catch(()=>{})},bm=(d,h)=>{if(!d.timeline)return!1;let g=e.capturedTimeline;if(g&&g===d.timeline)return!1;let y=Math.max(0,e.currentTime||0),w=e.isPlaying;e.capturedTimeline=d.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{at(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&e.capturedTimeline.seek(y,!1),w&&typeof e.capturedTimeline.play=="function"&&e.capturedTimeline.play()}catch(D){L("runtime.init.site7",D)}return xe({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:h,previousTime:y,selectedTimelineIds:d.selectedTimelineIds??[],selectedDurationSeconds:d.selectedDurationSeconds??null,mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),!0},Et=null,fs=!1,ms=!1,fn=new Set,hr=new WeakMap,gr=()=>{e.tornDown||(Et!=null&&window.clearTimeout(Et),Et=window.setTimeout(()=>{if(e.tornDown||(Et=null,ms&&window.__HF_EXPORT_RENDER_SEEK_CONFIG))return;let d=ze();if(!d.timeline||!j(d.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){dn()&&(wt(),ke(!0));return}if(fs)return;let g=O(e.capturedTimeline),y=d.selectedDurationSeconds??O(d.timeline);j(y)&&(!j(g)||y>=g+S)&&bm(d,"manual")&&(fs=!0,xe({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:g??null,selectedDurationSeconds:y??null,selectedTimelineIds:d.selectedTimelineIds??[],mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),wt(),ke(!0))},A))},ps=d=>{d.currentTarget instanceof HTMLMediaElement&&Ol(d.currentTarget)},hs=d=>{d.currentTarget instanceof HTMLMediaElement&&Hl(d.currentTarget)},gs=d=>{d instanceof HTMLAudioElement&&gf(d)&&ln(d,sn(d))},bs=d=>{let h=d.currentTarget;h instanceof HTMLMediaElement&&gs(h)},xm=()=>{for(let d of fn)d.removeEventListener("loadedmetadata",gr),d.removeEventListener("durationchange",gr),d.removeEventListener("loadedmetadata",ps),d.removeEventListener("loadedmetadata",bs),d.removeEventListener("error",hs);fn.clear()},Oi=()=>{if(e.tornDown)return;let d=Array.from(document.querySelectorAll("video, audio"));for(let h of d){if(fn.has(h))continue;fn.add(h);let g=Number.parseFloat(h.dataset.volume??"");Number.isFinite(g)&&(h.volume=Math.max(0,Math.min(1,g))),h.addEventListener("loadedmetadata",gr),h.addEventListener("durationchange",gr),h.addEventListener("loadedmetadata",bs),gs(h),h.addEventListener("loadedmetadata",ps),h.addEventListener("error",hs),Pl(h),h.preload!=="auto"&&(h.preload="auto"),h.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&h.load(),xs(h)}},xs=d=>{hr.has(d)||gl(d,e.capturedTimeline,Re(e.capturedTimeline,0),hr,{allowLiveTimelineSeek:!window.__HF_RENDER_CAPTURE_MODE})},Hi=new WeakMap,ys=d=>{let h=Hi.get(d);if(h!==void 0)return h;let g=window.getComputedStyle(d).position,y=g==="static"||g==="relative"||g==="sticky";return Hi.set(d,y),y},Gi=new WeakMap,ym=d=>{let h=Gi.get(d);if(h!==void 0)return h;let g=d.querySelector("[data-start]")===null;return Gi.set(d,g),g},vm=()=>{Hi=new WeakMap,Gi=new WeakMap},Bi=new WeakMap,br=new WeakSet,xr=!1,vs=d=>d.matches("audio[data-start]")||d.querySelector("audio[data-start]")!==null,Ss=new WeakMap,yr=!0,Sm=()=>{if(yr){yr=!1;for(let d of document.querySelectorAll(Wt)){let h=d.hasAttribute("data-hidden");Ss.get(d)!==h&&(Ss.set(d,h),d.id&&m.setGroupMuted(d.id,h))}}},Ui=(d,h=Array.from(document.querySelectorAll("[data-start]")))=>{let g=B();for(let y of h){if(!(y instanceof HTMLElement))continue;if(y.hasAttribute("data-hidden")){br.has(y)||(Bi.set(y,y.style.getPropertyValue("display")),br.add(y),vs(y)&&(xr=!0),yr=!0),y.style.display="none",(y instanceof HTMLVideoElement||y instanceof HTMLImageElement)&&n?.setSourceVisibility(y,!1);continue}if(br.has(y)){let D=Bi.get(y);D?y.style.display=D:y.style.removeProperty("display"),Bi.delete(y),br.delete(y),vs(y)&&(xr=!0),yr=!0}let w=X(y,d);if(w){let D=y.parentElement;for(;D&&D!==g;){if(D instanceof HTMLElement&&D.hasAttribute("data-start")&&!X(D,d)){w=!1;break}D=D.parentElement}}y.style.visibility=w?"visible":"hidden",(y instanceof HTMLVideoElement||y instanceof HTMLImageElement)&&n?.setSourceVisibility(y,w),w?ys(y)&&y.style.removeProperty("display"):ys(y)&&ym(y)&&(y.style.display="none")}xr&&c.isPlaying()&&(m.stopAll(),$i()),xr=!1,Sm()},Pe=()=>{let d=Fl({shouldIncludeElement:g=>g.hasAttribute("data-start")||!!H(g).compositionRoot,resolveStartSeconds:g=>z(g),resolveDurationSeconds:g=>{let y=H(g),w=z(g),D=y.inheritedStart!=null&&y.inheritedDuration!=null&&y.inheritedDuration>0?Math.max(0,y.inheritedStart+y.inheritedDuration-w):null,U=Number.isFinite(g.duration)?Ze(g,g.duration):null,ne=ve(g.dataset.duration),$=ne!=null&&ne>0?ne:null;return Ml({isVideo:g.tagName==="VIDEO",sourceDuration:U,hostRemaining:D,explicitDuration:$})}});for(let g of d.mediaClips){let y=hr.get(g.el);y&&(g.volumeKeyframes=y)}let h=e.mediaForceSyncNextTick;h&&(e.mediaForceSyncNextTick=!1),e.nativeMediaSyncDisabled||Nl({clips:d.mediaClips,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted,userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:h,onElementVolume:(g,y,w)=>m.setElementVolume(g,w),isWebAudioOwned:g=>m.ownsElement(g),isWebAudioRouted:g=>m.routesElement(g),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,xe({source:"hf-preview",type:"media-autoplay-blocked"}))}}),Ui(e.currentTime)},ke=d=>{let h=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),g=Date.now();(d||h!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||g-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=h,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=g,xe({source:"hf-preview",type:"state",frame:h,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},Wi="",As=0,Am=()=>{let d="";for(let h of document.querySelectorAll("[data-start]"))d+=`${h.id}:${h.tagName}|`;return d},wt=()=>{k(),oe(),V();let d=B();if(d){let y=W(d.getAttribute("data-width")),w=W(d.getAttribute("data-height")),D=y?parseInt(y,10):0,U=w?parseInt(w,10):0;D>0&&U>0&&xe({source:"hf-preview",type:"stage-size",width:D,height:U})}dn();let h=Su({canonicalFps:e.canonicalFps});window.__clipManifest=h;let g=Am();if(Wi!==g&&vm(),!window.__clipTree||Wi!==g){let y=window;window.__clipTree=bu({startResolver:mt({timelineRegistry:y.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:y.__timelines??{},rootDuration:h.durationInFrames/e.canonicalFps}),Wi=g}xe(h),pm()},Vi=d=>typeof d=="number"&&Number.isFinite(d)&&d>0?d:0,Em=d=>{let h=Vi(Number(d));if(h<=0)return;let g=B(),y=Vi(ve(g?.getAttribute("data-duration"))),w=Math.max(As,Vi(c.getDuration()),y);h<=w||(As=h,g?.setAttribute("data-duration",String(h)),c.setDuration(h),wt(),ke(!0))},Oe=(d,h=0)=>{for(let g of e.deterministicAdapters){try{d==="discover"&&g.discover(),d==="pause"&&g.pause(),d==="play"&&g.play&&g.play()}catch(y){L("runtime.init.site8",y)}if(d==="discover")try{g.seek({time:h,suppressEvents:!0})}catch(y){L("runtime.init.site9",y)}}},Ct=()=>{window.__renderReady=!1},mn=null,pn=!0,wm=()=>{let d=[];for(let h of e.deterministicAdapters){let g=h.getReadyPromise;if(typeof g=="function")try{let y=g();y&&d.push(y)}catch(y){L("runtime.init.adapterReady",y)}}return d},Cm=()=>{let d=wm();if(d.length===0)return mn=null,pn=!0,!0;let h=d[0];if(!h)return!0;let g=d.length===1?h:Promise.all(d);return g!==mn&&(mn=g,pn=!1,Promise.resolve(g).then(()=>{mn===g&&(pn=!0,Ct())},y=>{mn===g&&(pn=!0,L("runtime.init.adapterReady",y),Ct())})),pn};if(P)Ca();else{let d={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:W,onDiagnostic:({code:h,details:g})=>{xe({source:"hf-preview",type:"diagnostic",code:h,details:g})}};fd(d).then(()=>dd(d)).finally(()=>{P=!0,Oi(),gm(),Ca(),Na(document),Ct()})}let vr=fu({postMessage:d=>xe(d)});vr.installPickerApi(),Ui(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let qe=Jd();n=qe,R(()=>{qe.destroy(),n=null});let zi=d=>{let h=Number(d);!Number.isFinite(h)||h<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,h)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let g=document.querySelectorAll("video, audio");for(let y of g)if(y instanceof HTMLMediaElement)try{y.playbackRate=e.playbackRate}catch(w){L("runtime.init.site10",w)}},Es={play:()=>{let d=e.capturedTimeline;if(c.isPlaying())return;let h=Re(d,0);if(h>0)c.setDuration(h),c.reachedEnd()&&(c.seek(0),e.currentTime=0,_t(0));else{let g=B(),y=Number(g?.getAttribute("data-duration")??0);y>0&&c.setDuration(y)}at(d),c.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,ks(c.now()),f&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&$i(),Oe("play"),Pe(),qe.redraw(),ke(!0))},pause:()=>{if(!c.isPlaying())return;m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1,e.currentTime=c.now(),e.mediaForceSyncNextTick=!0,ks(e.currentTime);let d=e.capturedTimeline;at(d),Oe("pause"),Pe(),qe.redraw(),ke(!0)},seek:(d,h)=>{let g=jt(Math.max(0,Number(d)||0),e.canonicalFps);m.stopAll(),c.detachAudioSource();let y=c.isPlaying();y&&c.pause(),c.seek(g),e.currentTime=c.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let w=e.capturedTimeline;if(at(w),_t(e.currentTime),Oe("pause"),h?.keepPlaying&&y){Es.play();return}Pe(),qe.redraw(),ke(!0)},renderSeek:(d,h)=>{ms=!0;let g=jt(Math.max(0,Number(d)||0),e.canonicalFps);m.stopAll(),c.detachAudioSource(),c.isPlaying()&&c.pause(),c.seek(g),e.currentTime=c.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0,_t(e.currentTime,{activateChildren:!0,suppressEvents:h?.suppressEvents}),Oe("pause"),Pe(),qe.redraw(),ke(!0)},getTime:()=>c.now(),getDuration:()=>{let d=c.getDuration();return Number.isFinite(d)?d:0},isPlaying:()=>c.isPlaying(),setPlaybackRate:d=>{zi(d),c.setRate(e.playbackRate),Ms()},getPlaybackRate:()=>e.playbackRate},ws=Re(e.capturedTimeline,0);ws>0&&c.setDuration(ws);let He=hu({getTimeline:()=>e.capturedTimeline,setTimeline:d=>{e.capturedTimeline=d},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:d=>{e.isPlaying!==d&&(e.mediaForceSyncNextTick=!0),e.isPlaying=d},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:zi,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(d,h)=>{e.currentTime=Math.max(0,Number(d)||0),e.isPlaying!==h&&(e.mediaForceSyncNextTick=!0),e.isPlaying=h,Pe()},onStatePost:ke,onDeterministicSeek:(d,h)=>{for(let g of e.deterministicAdapters)if(!(g.name==="gsap"&&e.capturedTimeline))try{g.seek({time:Number(d)||0,suppressEvents:h?.suppressEvents})}catch(y){L("runtime.init.site11",y)}},onDeterministicPause:()=>Oe("pause"),onDeterministicPlay:()=>Oe("play"),onRenderFrameSeek:()=>{qe.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>Re(e.capturedTimeline,0),transport:Es});window.__player=M(He),window.__playerReady=!0,Ne("composition_loaded",{duration:He.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[ll(),zs({resolveStartSeconds:d=>Q(d,0)}),$s(),Ks(),Js(),Qs(),Zs(),el(),tl(),nl(),rl(),qs({getTimeline:()=>e.capturedTimeline})],al(),sl(),window.__hfReseekGpu=d=>{let h=Math.max(0,Number(d)||0);window.__hfThreeTime=h,window.__hfTypegpuTime=h,Rr(h)},window.__hfWaitForSeekCompletion=oo,o.push(()=>{window.__hfWaitForSeekCompletion===oo&&delete window.__hfWaitForSeekCompletion}),hm(),Oi(),Oe("discover");let _m=()=>{let d=e.capturedTimeline,h=dn();e.capturedTimeline&&(h||e.capturedTimeline!==d||!He._timeline)&&(He._timeline=e.capturedTimeline);let g=Re(e.capturedTimeline,0);if(g>0&&c.setDuration(g),Oe("discover",e.currentTime),!e.capturedTimeline){let y=window.__timelines??{},w=Object.keys(y).filter(D=>y[D]);if(w.length>0){let U=B()?.getAttribute("data-composition-id")??null;T("root_timeline_unbound_registry_present",{reason:U?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:U,registeredTimelineKeys:w},"root_timeline_unbound_registry_present"),console.warn("[hyperframes] Root timeline not bound \u2014 render will freeze at t=0. "+(U?`Root data-composition-id is "${U}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${w.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${U??"<root-id>"}"] = tl).`)}}window.__renderReady=!0,wt(),ke(!0)},Pt=null,Tm=()=>{if(Pt)return;let d=()=>{window.removeEventListener("hf-timelines-built",d),Pt=null,Ct()};Pt=d,window.addEventListener("hf-timelines-built",d)};R(()=>{Pt&&(window.removeEventListener("hf-timelines-built",Pt),Pt=null)}),Ct=()=>{if(!P){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,Tm();return}if(Oe("discover",e.currentTime),!Cm()){window.__renderReady=!1;return}_m()},Ct(),P&&setTimeout(()=>{Ct()},0);let Sr=0,qi=!1,Rm=(d,h,g,y)=>{try{let w=y?.suppressEvents===!0;at(d),typeof d.totalTime=="function"?d.totalTime(h,w):d.seek(h,w)}catch(w){L(g,w)}},km=(d,h)=>{let g=window.__timelines??{},y=B()?.getAttribute("data-composition-id")??null;for(let[w,D]of Object.entries(g)){if(!D||w===y)continue;let U=document.querySelector(`[data-composition-id="${CSS.escape(w)}"]`);if(!U)continue;let ne=Q(U,0);if(!Number.isFinite(ne))continue;let $=O(D),de=je(U)+Math.max(0,d-ne)*Ce(U),Ge=Math.max(0,$!=null&&$>0?Math.min($,de):de);Rm(D,Ge,"runtime.init.transport.childTimeline",h)}},Cs=d=>{let h=window.__timelines??{};for(let g of Object.values(h))if(!(!g||g===d))try{g.play()}catch(y){L("runtime.init.activateSiblings",y)}},_s=d=>typeof d=="object"&&d!==null,hn=new WeakMap,Mm=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],Ts=(d,h)=>{let g=d[h];if(typeof g!="function")return null;try{let y=Number(g.call(d));return Number.isFinite(y)?y:null}catch(y){return L("runtime.init.gsapCallbackDuration",y),null}},Fm=d=>{let h=hn.get(d);if(h!=null)return h;if(!("getChildren"in d)||typeof d.getChildren!="function")return!1;let g;try{g=d.getChildren(!0,!0,!0)}catch(y){return L("runtime.init.gsapCallbackChildren",y),hn.set(d,!1),!1}if(!Array.isArray(g))return hn.set(d,!1),!1;for(let y of g){if(!_s(y))continue;let w=y.vars;if(!_s(w)||!Mm.some($=>typeof w[$]=="function"))continue;let ne=Ts(y,"totalDuration")??Ts(y,"duration");if(ne!=null&&ne<=1e-6)return hn.set(d,!0),!0}return hn.set(d,!1),!1};function _t(d,h){let g=e.capturedTimeline,y=h?.suppressEvents===!0;if(g){h?.activateChildren&&Cs(g);let w=g,D=d;if(typeof w.totalDuration=="function")try{let U=Number(w.totalDuration());Number.isFinite(U)&&U>0&&d>U&&(D=U)}catch(U){L("runtime.init.transport.clampDuration",U)}try{typeof g.totalTime=="function"?(g.totalTime(D,y),!y&&!Fm(g)&&(g.totalTime(D+.001,!0),g.totalTime(D,!0))):g.seek(D,y)}catch(U){L("runtime.init.transport.seek",U)}}km(d,h),g&&h?.activateChildren&&Cs(g);for(let w of e.deterministicAdapters)if(!(w.name==="gsap"&&g))try{w.seek({time:d,suppressEvents:y})}catch(D){L("runtime.init.transport.adapter",D)}}let Nm=()=>{try{return document.querySelector(`[${xf}]`)!=null}catch{return!1}},Rs=()=>{if(!(e.tornDown||qi)){qi=!0;try{if(e.transportRafId=window.requestAnimationFrame(Rs),Sr+=1,yf({tick:Sr,isPlaying:c.isPlaying(),hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:c.now()})){let h=e.capturedTimeline;if(dn()){e.capturedTimeline&&!He._timeline&&(He._timeline=e.capturedTimeline),e.capturedTimeline&&e.capturedTimeline!==h&&at(e.capturedTimeline);let g=Re(e.capturedTimeline,0);g>0&&c.setDuration(g),wt()}}if(Sr%20===0&&wt(),Sr%30===0&&Oi(),e.capturedTimeline){let h=Re(e.capturedTimeline,0);h>0&&(!c.isPlaying()||h>=c.getDuration())&&c.setDuration(h)}if(c.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&m.isActive()&&m.context){let h=m.getTime();h>=0&&c.attachAudioSource({currentTimeSeconds:h})}else{let h=document.querySelectorAll("audio[data-start]"),g=!1;for(let y of h){if(!(y instanceof HTMLMediaElement)||!y.isConnected||p(y))continue;let w=Number.parseFloat(y.dataset.start??""),D=ve(y.dataset.duration),U=D!=null&&D>0?w+D:1/0,ne=je(y);if(Number.isFinite(w)&&e.currentTime>=w&&e.currentTime<U){y.paused?!y.error&&y.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(c.attachAudioSource({currentTimeSeconds:e.currentTime}),g=!0):(c.attachAudioSource({el:y,compositionStart:w,mediaStart:ne}),g=!0);break}}!g&&c.hasAudioSource()&&c.detachAudioSource()}else c.hasAudioSource()&&c.detachAudioSource();let d=c.now();if(e.currentTime=d,(c.isPlaying()||!Nm())&&_t(d),c.isPlaying()&&qe.redrawAnimated(),c.isPlaying()&&c.reachedEnd()){m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1;let h=c.getDuration();Number.isFinite(h)&&(c.seek(h),e.currentTime=h,_t(h)),Oe("pause"),Pe(),ke(!0);return}c.isPlaying()&&Pe(),ke(!1)}finally{qi=!1}}},ks=d=>{let h=document.querySelectorAll("video, audio");for(let g of h){if(!(g instanceof HTMLMediaElement)||!g.isConnected)continue;let y=Number.parseFloat(g.dataset.start??"");if(!Number.isFinite(y))continue;let w=ve(g.dataset.duration),D=w!=null&&w>0?y+w:1/0;if(d<y||d>=D)continue;let U=je(g),ne=d-y+U;if(ne>=0)try{g.currentTime=ne}catch{}}},$i=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let d=m.startGeneration(),h=document.querySelectorAll("audio[data-start]");for(let g of h){if(!(g instanceof HTMLMediaElement)||!g.isConnected||p(g))continue;let y=Number.parseFloat(g.dataset.start??"");if(!Number.isFinite(y))continue;let w=je(g),D=Number.parseFloat(g.dataset.volume??""),U=Number.isFinite(D)?D:1,ne=ve(g.dataset.duration),$=ne!=null&&ne>0?ne:Number.POSITIVE_INFINITY,de=g.closest("[data-composition-id]");if(de){let J=Q(de,0),te=G(de,{includeAuthoredTimingAttrs:!0});te!=null&&te>0&&($=Math.min($,Math.max(0,J+te-y)))}let Ge=sn(g);ln(g,Ge),(Ge.kind==="web-audio"?m.scheduleMediaElementPlayback(g,y,w,c.now(),U,d,e.playbackRate):Promise.resolve(null)).then(J=>{if(J||!c.isPlaying())return;let te=e.playbackRate*Ce(g),Tt=g.hasAttribute("data-fx-chain")||g.hasAttribute("data-automation");if(Math.abs(te-1)>1e-9){Ge.kind==="web-audio"&&Tt&&(g.muted=!0);return}m.decodeAudioElement(g).then(ye=>{!ye||!c.isPlaying()||m.schedulePlayback(g,ye,y,w,c.now(),U,d,e.playbackRate,$)})})}};function Ms(){m.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&f&&c.isPlaying()&&m.hasBoundedActiveSources()&&(m.stopAll(),$i())}if(e.capturedTimeline){let d=Re(e.capturedTimeline,0);d>0&&c.setDuration(d),at(e.capturedTimeline)}xd(window),e.transportRafId=window.requestAnimationFrame(Rs),wt(),ke(!0),e.controlBridgeHandler=Ds({onPlay:()=>{He.play(),Ne("composition_played",{time:He.getTime()})},onPause:()=>{He.pause(),Ne("composition_paused",{time:He.getTime()})},onStopMedia:()=>{m.stopAll();let d=document.querySelectorAll("video, audio");for(let h of d)h instanceof HTMLMediaElement&&!h.paused&&h.pause()},onSeek:(d,h)=>{He.seek(d),Ne("composition_seeked",{time:d})},onSetMuted:d=>{e.bridgeMuted=d;let h=d||e.mediaOutputMuted;m.setMuted(h);let g=document.querySelectorAll("video, audio");for(let y of g)y instanceof HTMLMediaElement&&(y.muted=h||y.defaultMuted)},onSetVolume:d=>{e.bridgeVolume=d,m.setVolume(d);let h=document.querySelectorAll("video, audio");for(let g of h){if(!(g instanceof HTMLMediaElement))continue;let y=parseFloat(g.dataset.volume??""),w=Number.isFinite(y)?y:1;g.volume=kr(w*d)}},onSetMediaOutputMuted:d=>{e.mediaOutputMuted=d;let h=d||e.bridgeMuted;m.setMuted(h);let g=document.querySelectorAll("video, audio");for(let y of g)y instanceof HTMLMediaElement&&(y.muted=h||y.defaultMuted)},onSetNativeMediaSyncDisabled:d=>{e.nativeMediaSyncDisabled!==d&&(e.nativeMediaSyncDisabled=d,e.mediaForceSyncNextTick=!0,d?(m.stopAll(),c.detachAudioSource()):Pe())},onSetWebAudioMediaDisabled:d=>{e.webAudioMediaDisabled!==d&&(e.webAudioMediaDisabled=d,e.mediaForceSyncNextTick=!0,d&&(m.stopAll(),c.detachAudioSource()),Pe())},onSetPlaybackRate:d=>{zi(d),e.transportClock&&e.transportClock.setRate(e.playbackRate),Ms()},onSetRootDuration:Em,onSetColorGrading:(d,h)=>{qe.setGrading(d,h)},onSetColorGradingCompare:(d,h)=>{qe.setCompare(d,h)},onTick:()=>{if(e.tornDown||!c.isPlaying())return;let d=c.now();if(e.currentTime=d,_t(d),c.reachedEnd()){m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1;let h=c.getDuration();Number.isFinite(h)&&(c.seek(h),e.currentTime=h,_t(h)),Oe("pause"),Pe(),ke(!0)}},onEnablePickMode:()=>vr.enablePickMode(),onDisablePickMode:()=>vr.disablePickMode(),onSetRuntimeData:Ti,onClearRuntimeData:Ri,getCanonicalFps:()=>e.canonicalFps});let ji=()=>{if(!e.tornDown){e.tornDown=!0,e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),e.transportClock=null,m.destroy(),Et!=null&&(window.clearTimeout(Et),Et=null),l!=null&&(window.cancelAnimationFrame(l),l=null),xm(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),r&&(window.removeEventListener("error",r),r=null),i&&(window.removeEventListener("unhandledrejection",i),i=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),vr.disablePickMode();for(let d of e.deterministicAdapters)if(!(!d||typeof d.revert!="function"))try{d.revert()}catch(h){L("runtime.init.site12",h)}e.deterministicAdapters=[];for(let d of o.splice(0))try{d()}catch(h){L("runtime.init.site13",h)}for(let d of e.injectedCompStyles)try{d.remove()}catch(h){L("runtime.init.site14",h)}e.injectedCompStyles=[];for(let d of e.injectedCompLinks)try{d.remove()}catch(h){L("runtime.init.site15",h)}e.injectedCompLinks=[];for(let d of e.injectedCompScripts)try{d.remove()}catch(h){L("runtime.init.site16",h)}e.injectedCompScripts=[],e.capturedTimeline=null,window.__hfRuntimeTeardown===ji&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=ji,e.beforeUnloadHandler=ji,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var Nf=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],rs=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function sy(e){if(e<=255)return Nf[e];let t=0,n=rs.length-1;for(;t<=n;){let r=t+n>>1,i=rs[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return"L"}function ly(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let u=0;u<t;){let c=e.charCodeAt(u),m=c,f=1;if(c>=55296&&c<=56319&&u+1<t){let b=e.charCodeAt(u+1);b>=56320&&b<=57343&&(m=(c-55296<<10)+(b-56320)+65536,f=2)}let p=sy(m);(p==="R"||p==="AL"||p==="AN")&&(r=!0);for(let b=0;b<f;b++)n[u+b]=p;u+=f}if(!r)return null;let i=0;for(let u=0;u<t;u++){let c=n[u];if(c==="L"){i=0;break}if(c==="R"||c==="AL"){i=1;break}}let o=new Int8Array(t);for(let u=0;u<t;u++)o[u]=i;let a=i&1?"R":"L",l=a,s=l;for(let u=0;u<t;u++)n[u]==="NSM"?n[u]=s:s=n[u];s=l;for(let u=0;u<t;u++){let c=n[u];c==="EN"?n[u]=s==="AL"?"AN":"EN":(c==="R"||c==="L"||c==="AL")&&(s=c)}for(let u=0;u<t;u++)n[u]==="AL"&&(n[u]="R");for(let u=1;u<t-1;u++)n[u]==="ES"&&n[u-1]==="EN"&&n[u+1]==="EN"&&(n[u]="EN"),n[u]==="CS"&&(n[u-1]==="EN"||n[u-1]==="AN")&&n[u+1]===n[u-1]&&(n[u]=n[u-1]);for(let u=0;u<t;u++){if(n[u]!=="EN")continue;let c;for(c=u-1;c>=0&&n[c]==="ET";c--)n[c]="EN";for(c=u+1;c<t&&n[c]==="ET";c++)n[c]="EN"}for(let u=0;u<t;u++){let c=n[u];(c==="WS"||c==="ES"||c==="ET"||c==="CS")&&(n[u]="ON")}s=l;for(let u=0;u<t;u++){let c=n[u];c==="EN"?n[u]=s==="L"?"L":"EN":(c==="R"||c==="L")&&(s=c)}for(let u=0;u<t;u++){if(n[u]!=="ON")continue;let c=u+1;for(;c<t&&n[c]==="ON";)c++;let m=u>0?n[u-1]:l,f=c<t?n[c]:l,p=m!=="L"?"R":"L";if(p===(f!=="L"?"R":"L"))for(let v=u;v<c;v++)n[v]=p;u=c-1}for(let u=0;u<t;u++)n[u]==="ON"&&(n[u]=a);for(let u=0;u<t;u++){let c=n[u];(o[u]&1)===0?c==="R"?o[u]++:(c==="AN"||c==="EN")&&(o[u]+=2):(c==="L"||c==="AN"||c==="EN")&&o[u]++}return o}function Lf(e,t){let n=ly(e);if(n===null)return null;let r=new Int8Array(t.length);for(let i=0;i<t.length;i++)r[i]=n[t[i]];return r}var uy=/[ \t\n\r\f]+/g,cy=/[\t\n\r\f]| {2,}|^ | $/;function dy(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function fy(e){if(!cy.test(e))return e;let t=e.replace(uy," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function my(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
705
705
  `).replace(/[\r\f]/g,`
706
706
  `):e.replace(/\r\n/g,`
707
707
  `)}var is=null,py;function hy(){return is===null&&(is=new Intl.Segmenter(py,{granularity:"word"})),is}var gy=/\p{Script=Arabic}/u,ki=/\p{M}/u,Uf=/\p{Nd}/u;function Df(e){return gy.test(e)}function If(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519}function We(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){let r=e.charCodeAt(t+1);if(r>=56320&&r<=57343){let i=(n-55296<<10)+(r-56320)+65536;if(If(i))return!0;t++;continue}}if(If(n))return!0}}return!1}function by(e){let t=Ni(e);return t!==null&&(Fi.has(t)||vt.has(t))}var xy=new Set(["\xA0","\u202F","\u2060","\uFEFF"]);function yy(e){return We(e)}function vy(e){let t=Ni(e);return t!==null&&xy.has(t)}function Mi(e){return!by(e)&&!vy(e)}var Fi=new Set(["\uFF0C","\uFF0E","\uFF01","\uFF1A","\uFF1B","\uFF1F","\u3001","\u3002","\u30FB","\uFF09","\u3015","\u3009","\u300B","\u300D","\u300F","\u3011","\u3017","\u3019","\u301B","\u30FC","\u3005","\u303B","\u309D","\u309E","\u30FD","\u30FE"]),pr=new Set(['"',"(","[","{","\u201C","\u2018","\xAB","\u2039","\uFF08","\u3014","\u3008","\u300A","\u300C","\u300E","\u3010","\u3016","\u3018","\u301A"]),as=new Set(["'","\u2019"]),vt=new Set([".",",","!","?",":",";","\u060C","\u061B","\u061F","\u0964","\u0965","\u104A","\u104B","\u104C","\u104D","\u104F",")","]","}","%",'"',"\u201D","\u2019","\xBB","\u203A","\u2026"]),Sy=new Set([":",".","\u060C","\u061B"]),Ay=new Set(["\u104F"]),Ey=new Set(["\u201D","\u2019","\xBB","\u203A","\u300D","\u300F","\u3011","\u300B","\u3009","\u3015","\uFF09"]);function wy(e){if(ss(e))return!0;let t=!1;for(let n of e){if(vt.has(n)){t=!0;continue}if(!(t&&ki.test(n)))return!1}return t}function Cy(e){for(let t of e)if(!Fi.has(t)&&!vt.has(t))return!1;return e.length>0}function _y(e){if(ss(e))return!0;for(let t of e)if(!pr.has(t)&&!as.has(t)&&!ki.test(t))return!1;return e.length>0}function ss(e){let t=!1;for(let n of e)if(!(n==="\\"||ki.test(n))){if(pr.has(n)||vt.has(n)||as.has(n)){t=!0;continue}return!1}return t}function Wf(e,t){let n=t-1;if(n<=0)return Math.max(n,0);let r=e.charCodeAt(n);if(r<56320||r>57343)return n;let i=n-1;if(i<0)return n;let o=e.charCodeAt(i);return o>=55296&&o<=56319?i:n}function Ni(e){if(e.length===0)return null;let t=Wf(e,e.length);return e.slice(t)}function Ty(e){let t=Array.from(e),n=t.length;for(;n>0;){let r=t[n-1];if(ki.test(r)){n--;continue}if(pr.has(r)||as.has(r)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Ry(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="\u2014"?e:null}function Pf(e,t,n,r){let i=t[r],o=e[r];if(i==null)return o;let a=n[r];if(o.length===a)return o;let l=i.repeat(a);return e[r]=l,l}function Of(e,t){return e&&t!==null&&Sy.has(t)}function ky(e){let t=Ni(e);return t!==null&&Ay.has(t)}function My(e){if(e.length<2||e[0]!==" ")return null;let t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function Li(e){let t=e.length;for(;t>0;){let n=Wf(e,t),r=e.slice(n,t);if(Ey.has(r))return!0;if(!vt.has(r))return!1;t=n}return!1}function Fy(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
708
- `)return"hard-break"}return e===" "?"space":e==="\xA0"||e==="\u202F"||e==="\u2060"||e==="\uFEFF"?"glue":e==="\u200B"?"zero-width-break":e==="\xAD"?"soft-hyphen":"text"}var Ny=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ie(e){return e.length===1?e[0]:e.join("")}function Ly(e,t){let n=[];for(let r=e.length-1;r>=0;r--)n.push(e[r]);return n.push(t),Ie(n)}function Dy(e,t,n,r){if(!Ny.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];let i=[],o=null,a=[],l=n,s=!1,u=0;for(let c of e){let m=Fy(c,r),f=m==="text"&&t;if(o!==null&&m===o&&f===s){a.push(c),u+=c.length;continue}o!==null&&i.push({text:Ie(a),isWordLike:s,kind:o,start:l}),o=m,a=[c],l=n+u,s=f,u+=c.length}return o!==null&&i.push({text:Ie(a),isWordLike:s,kind:o,start:l}),i}function os(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var Iy=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Py(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:Iy.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Oy(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Hy(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let a=0;a<e.len;a++){if(r[a]!=="text"||!Py(e,a))continue;let l=[t[a]],s=a+1;for(;s<e.len&&!os(r[s]);){l.push(t[s]),n[a]=!0;let u=t[s].includes("?");if(r[s]="text",t[s]="",s++,u)break}t[a]=Ie(l)}let o=0;for(let a=0;a<t.length;a++){let l=t[a];l.length!==0&&(o!==a&&(t[o]=l,n[o]=n[a],r[o]=r[a],i[o]=i[a]),o++)}return t.length=o,n.length=o,r.length=o,i.length=o,{len:o,texts:t,isWordLike:n,kinds:r,starts:i}}function Gy(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o]),!Oy(a))continue;let l=o+1;if(l>=e.len||os(e.kinds[l]))continue;let s=[],u=e.starts[l],c=l;for(;c<e.len&&!os(e.kinds[c]);)s.push(e.texts[c]),c++;s.length>0&&(t.push(Ie(s)),n.push(!0),r.push("text"),i.push(u),o=c-1)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}var By=new Set([":","-","/","\xD7",",",".","+","\u2013","\u2014"]),Hf=/^[A-Za-z0-9_]+[,:;]*$/,Gf=/[,:;]+$/;function Vf(e){for(let t of e)if(Uf.test(t))return!0;return!1}function mr(e){if(e.length===0)return!1;for(let t of e)if(!(Uf.test(t)||By.has(t)))return!1;return!0}function Uy(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o];if(l==="text"&&mr(a)&&Vf(a)){let s=[a],u=o+1;for(;u<e.len&&e.kinds[u]==="text"&&mr(e.texts[u]);)s.push(e.texts[u]),u++;t.push(Ie(s)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=u-1;continue}t.push(a),n.push(e.isWordLike[o]),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Wy(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o],s=e.isWordLike[o];if(l==="text"&&s&&Hf.test(a)){let u=[a],c=Gf.test(a),m=o+1;for(;c&&m<e.len&&e.kinds[m]==="text"&&e.isWordLike[m]&&Hf.test(e.texts[m]);){let f=e.texts[m];u.push(f),c=Gf.test(f),m++}t.push(Ie(u)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=m-1;continue}t.push(a),n.push(s),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Vy(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(e.kinds[o]==="text"&&a.includes("-")){let l=a.split("-"),s=l.length>1;for(let u=0;u<l.length;u++){let c=l[u];if(!s)break;(c.length===0||!Vf(c)||!mr(c))&&(s=!1)}if(s){let u=0;for(let c=0;c<l.length;c++){let m=l[c],f=c<l.length-1?`${m}-`:m;t.push(f),n.push(!0),r.push("text"),i.push(e.starts[o]+u),u+=f.length}continue}}t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function zy(e){let t=[],n=[],r=[],i=[],o=0;for(;o<e.len;){let a=[e.texts[o]],l=e.isWordLike[o],s=e.kinds[o],u=e.starts[o];if(s==="glue"){let c=[a[0]],m=u;for(o++;o<e.len&&e.kinds[o]==="glue";)c.push(e.texts[o]),o++;let f=Ie(c);if(o<e.len&&e.kinds[o]==="text")a[0]=f,a.push(e.texts[o]),l=e.isWordLike[o],s="text",u=m,o++;else{t.push(f),n.push(!1),r.push("glue"),i.push(m);continue}}else o++;if(s==="text")for(;o<e.len&&e.kinds[o]==="glue";){let c=[];for(;o<e.len&&e.kinds[o]==="glue";)c.push(e.texts[o]),o++;let m=Ie(c);if(o<e.len&&e.kinds[o]==="text"){a.push(m,e.texts[o]),l=l||e.isWordLike[o],o++;continue}a.push(m)}t.push(Ie(a)),n.push(l),r.push(s),i.push(u)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function qy(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let o=0;o<t.length-1;o++){if(r[o]!=="text"||r[o+1]!=="text"||!We(t[o])||!We(t[o+1]))continue;let a=Ty(t[o]);a!==null&&(t[o]=a.head,t[o+1]=a.tail+t[o+1],i[o+1]=i[o]+a.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Bf(e,t,n){let r=hy(),i=0,o=[],a=[],l=[],s=[],u=[],c=[],m=[],f=[],p=[],b=[],v=[],x=[];for(let E of r.segment(e))for(let S of Dy(E.segment,E.isWordLike??!1,E.index,n)){let V=function(){c[k]!==null&&(a[k]=[Pf(o,c,m,k)],c[k]=null),a[k].push(S.text),l[k]=l[k]||S.isWordLike,f[k]=f[k]||N,p[k]=p[k]||I,b[k]=U,v[k]=oe,x[k]=Of(p[k],W)},A=S.kind==="text",C=Ry(S.text,S.isWordLike,S.kind),N=We(S.text),I=Df(S.text),W=Ni(S.text),U=Li(S.text),oe=ky(S.text),k=i-1;t.carryCJKAfterClosingQuote&&A&&i>0&&s[k]==="text"&&N&&f[k]&&b[k]||A&&i>0&&s[k]==="text"&&Cy(S.text)&&f[k]||A&&i>0&&s[k]==="text"&&v[k]?V():A&&i>0&&s[k]==="text"&&S.isWordLike&&I&&x[k]?(V(),l[k]=!0):C!==null&&i>0&&s[k]==="text"&&c[k]===C?m[k]=(m[k]??1)+1:A&&!S.isWordLike&&i>0&&s[k]==="text"&&(wy(S.text)||S.text==="-"&&l[k])?V():(o[i]=S.text,a[i]=[S.text],l[i]=S.isWordLike,s[i]=S.kind,u[i]=S.start,c[i]=C,m[i]=C===null?0:1,f[i]=N,p[i]=I,b[i]=U,v[i]=oe,x[i]=Of(I,W),i++)}for(let E=0;E<i;E++){if(c[E]!==null){o[E]=Pf(o,c,m,E);continue}o[E]=Ie(a[E])}for(let E=1;E<i;E++)s[E]==="text"&&!l[E]&&ss(o[E])&&s[E-1]==="text"&&(o[E-1]+=o[E],l[E-1]=l[E-1]||l[E],o[E]="");let _=Array.from({length:i},()=>null),R=-1;for(let E=i-1;E>=0;E--){let S=o[E];if(S.length!==0){if(s[E]==="text"&&!l[E]&&_y(S)&&R>=0&&s[R]==="text"){let A=_[R]??[];A.push(S),_[R]=A,u[R]=u[E],o[E]="";continue}R=E}}for(let E=0;E<i;E++){let S=_[E];S!=null&&(o[E]=Ly(S,o[E]))}let T=0;for(let E=0;E<i;E++){let S=o[E];S.length!==0&&(T!==E&&(o[T]=S,l[T]=l[E],s[T]=s[E],u[T]=u[E]),T++)}o.length=T,l.length=T,s.length=T,u.length=T;let M=zy({len:T,texts:o,isWordLike:l,kinds:s,starts:u}),F=qy(Wy(Vy(Uy(Gy(Hy(M))))));for(let E=0;E<F.len-1;E++){let S=My(F.texts[E]);S!==null&&(F.kinds[E]!=="space"&&F.kinds[E]!=="preserved-space"||F.kinds[E+1]!=="text"||!Df(F.texts[E+1])||(F.texts[E]=S.space,F.isWordLike[E]=!1,F.kinds[E]=F.kinds[E]==="preserved-space"?"preserved-space":"space",F.texts[E+1]=S.marks+F.texts[E+1],F.starts[E+1]=F.starts[E]+S.space.length))}return F}function $y(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];let n=[],r=0;for(let i=0;i<e.len;i++)e.kinds[i]==="hard-break"&&(n.push({startSegmentIndex:r,endSegmentIndex:i,consumedEndSegmentIndex:i+1}),r=i+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function jy(e){if(e.len<=1)return e;let t=[],n=[],r=[],i=[],o=null,a=!1,l=0,s=!1,u=!1;function c(){o!==null&&(t.push(Ie(o)),n.push(a),r.push("text"),i.push(l),o=null)}for(let m=0;m<e.len;m++){let f=e.texts[m],p=e.kinds[m],b=e.isWordLike[m],v=e.starts[m];if(p==="text"){let x=yy(f),_=Mi(f);if(o!==null&&s&&u){o.push(f),a=a||b,s=s||x,u=_;continue}c(),o=[f],a=b,l=v,s=x,u=_;continue}c(),t.push(f),n.push(b),r.push(p),i.push(v)}return c(),{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function zf(e,t,n="normal",r="normal"){let i=dy(n),o=i.mode==="pre-wrap"?my(e):fy(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let a=r==="keep-all"?jy(Bf(o,t,i)):Bf(o,t,i);return{normalized:o,chunks:$y(a,i),...a}}var un=null,qf=new Map,cn=null,Ky=96,Yy=/\p{Emoji_Presentation}/u,Xy=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u,ls=null,$f=new Map;function us(){if(un!==null)return un;if(typeof OffscreenCanvas<"u")return un=new OffscreenCanvas(1,1).getContext("2d"),un;if(typeof document<"u")return un=document.createElement("canvas").getContext("2d"),un;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Jy(e){let t=qf.get(e);return t||(t=new Map,qf.set(e,t)),t}function st(e,t){let n=t.get(e);return n===void 0&&(n={width:us().measureText(e).width,containsCJK:We(e)},t.set(e,n)),n}function At(){if(cn!==null)return cn;if(typeof navigator>"u")return cn={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},cn;let e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),r=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return cn={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:r,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},cn}function Qy(e){let t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function jf(){return ls===null&&(ls=new Intl.Segmenter(void 0,{granularity:"grapheme"})),ls}function Zy(e){return Yy.test(e)||e.includes("\uFE0F")}function Kf(e){return Xy.test(e)}function e1(e,t){let n=$f.get(e);if(n!==void 0)return n;let r=us();r.font=e;let i=r.measureText("\u{1F600}").width;if(n=0,i>t+.5&&typeof document<"u"&&document.body!==null){let o=document.createElement("span");o.style.font=e,o.style.display="inline-block",o.style.visibility="hidden",o.style.position="absolute",o.textContent="\u{1F600}",document.body.appendChild(o);let a=o.getBoundingClientRect().width;document.body.removeChild(o),i-a>.5&&(n=i-a)}return $f.set(e,n),n}function t1(e){let t=0,n=jf();for(let r of n.segment(e))Zy(r.segment)&&t++;return t}function n1(e,t){return t.emojiCount===void 0&&(t.emojiCount=t1(e)),t.emojiCount}function St(e,t,n){return n===0?t.width:t.width-n1(e,t)*n}function Yf(e,t,n,r,i){if(t.breakableFitAdvances!==void 0)return t.breakableFitAdvances;let o=jf(),a=[];for(let c of o.segment(e))a.push(c.segment);if(a.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(i==="sum-graphemes"){let c=[];for(let m of a){let f=st(m,n);c.push(St(m,f,r))}return t.breakableFitAdvances=c,t.breakableFitAdvances}if(i==="pair-context"||a.length>Ky){let c=[],m=null,f=0;for(let p of a){let b=st(p,n),v=St(p,b,r);if(m===null)c.push(v);else{let x=m+p,_=st(x,n);c.push(St(x,_,r)-f)}m=p,f=v}return t.breakableFitAdvances=c,t.breakableFitAdvances}let l=[],s="",u=0;for(let c of a){s+=c;let m=st(s,n),f=St(s,m,r);l.push(f-u),u=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function Xf(e,t){let n=us();n.font=e;let r=Jy(e),i=Qy(e),o=t?e1(e,i):0;return{cache:r,fontSize:i,emojiCorrection:o}}function r1(e,t){for(;t<e.widths.length;){let n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function Jf(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Qf(e,t,n,r,i){let o=0,a=t;for(;o<e.length;){let l=a+e[o];if((o+1<e.length?l+i:l)>n+r)break;a=l,o++}return{fitCount:o,fittedWidth:a}}function i1(e,t){let n=0,r=e.chunks.length;for(;n<r;){let i=Math.floor((n+r)/2);t<e.chunks[i].consumedEndSegmentIndex?r=i:n=i+1}return n<e.chunks.length?n:-1}function Zf(e,t,n){let r=n.segmentIndex;if(n.graphemeIndex>0)return t;let i=e.chunks[t];if(i.startSegmentIndex===i.endSegmentIndex&&r===i.startSegmentIndex)return n.segmentIndex=r,n.graphemeIndex=0,t;for(r<i.startSegmentIndex&&(r=i.startSegmentIndex);r<i.endSegmentIndex;){let o=e.kinds[r];if(o!=="space"&&o!=="zero-width-break"&&o!=="soft-hyphen")return n.segmentIndex=r,n.graphemeIndex=0,t;r++}return i.consumedEndSegmentIndex>=e.widths.length?-1:(n.segmentIndex=i.consumedEndSegmentIndex,n.graphemeIndex=0,t+1)}function em(e,t){if(t.segmentIndex>=e.widths.length)return-1;let n=i1(e,t.segmentIndex);return n<0?-1:Zf(e,n,t)}function o1(e,t,n){if(n.segmentIndex>=e.widths.length)return-1;let r=t;for(;r<e.chunks.length&&n.segmentIndex>=e.chunks[r].consumedEndSegmentIndex;)r++;return r>=e.chunks.length?-1:Zf(e,r,n)}function tm(e,t){return e.simpleLineWalkFastPath?nm(e,t):cs(e,t)}function nm(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:o}=e;if(r.length===0)return 0;let l=At().lineFitEpsilon,s=t+l,u=0,c=0,m=!1,f=0,p=0,b=0,v=0,x=-1,_=0;function R(){x=-1,_=0}function T(C=b,N=v,I=c){u++,n?.({startSegmentIndex:f,startGraphemeIndex:p,endSegmentIndex:C,endGraphemeIndex:N,width:I}),c=0,m=!1,R()}function M(C,N){m=!0,f=C,p=0,b=C+1,v=0,c=N}function F(C,N,I){m=!0,f=C,p=N,b=C,v=N+1,c=I}function E(C,N){if(!m){M(C,N);return}c+=N,b=C+1,v=0}function S(C,N){let I=o[C];for(let W=N;W<I.length;W++){let U=I[W];m?c+U>s?(T(),F(C,W,U)):(c+=U,b=C,v=W+1):F(C,W,U)}m&&b===C&&v===I.length&&(b=C+1,v=0)}let A=0;for(;A<r.length&&!(!m&&(A=r1(e,A),A>=r.length));){let C=r[A],N=i[A],I=N==="space"||N==="preserved-space"||N==="tab"||N==="zero-width-break"||N==="soft-hyphen";if(!m){C>t&&o[A]!==null?S(A,0):M(A,C),I&&(x=A+1,_=c-C),A++;continue}if(c+C>s){if(I){E(A,C),T(A+1,0,c-C),A++;continue}if(x>=0){if(b>x||b===x&&v>0){T();continue}T(x,0,_);continue}if(C>t&&o[A]!==null){T(),S(A,0),A++;continue}T();continue}E(A,C),I&&(x=A+1,_=c-C),A++}return m&&T(),u}function cs(e,t,n){if(e.simpleLineWalkFastPath)return nm(e,t,n);let{widths:r,lineEndFitAdvances:i,lineEndPaintAdvances:o,kinds:a,breakableFitAdvances:l,discretionaryHyphenWidth:s,tabStopAdvance:u,chunks:c}=e;if(r.length===0||c.length===0)return 0;let m=At(),f=m.lineFitEpsilon,p=t+f,b=0,v=0,x=!1,_=0,R=0,T=0,M=0,F=-1,E=0,S=0,A=null;function C(){F=-1,E=0,S=0,A=null}function N(G=T,H=M,z=v){b++,n?.({startSegmentIndex:_,startGraphemeIndex:R,endSegmentIndex:G,endGraphemeIndex:H,width:z}),v=0,x=!1,C()}function I(G,H){x=!0,_=G,R=0,T=G+1,M=0,v=H}function W(G,H,z){x=!0,_=G,R=H,T=G,M=H+1,v=z}function U(G,H){if(!x){I(G,H);return}v+=H,T=G+1,M=0}function oe(G,H,z,X){if(!H)return;let we=G==="tab"?0:i[z],q=G==="tab"?X:o[z];F=z+1,E=v-X+we,S=v-X+q,A=G}function k(G,H){let z=l[G];for(let X=H;X<z.length;X++){let we=z[X];x?v+we>p?(N(),W(G,X,we)):(v+=we,T=G,M=X+1):W(G,X,we)}x&&T===G&&M===z.length&&(T=G+1,M=0)}function V(G){if(A!=="soft-hyphen")return!1;let H=l[G];if(H==null)return!1;let{fitCount:z,fittedWidth:X}=Qf(H,v,t,f,s);return z===0?!1:(v=X,T=G,M=z,C(),z===H.length?(T=G+1,M=0,!0):(N(G,z,X+s),k(G,z),!0))}function Q(G){b++,n?.({startSegmentIndex:G.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:G.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),C()}for(let G=0;G<c.length;G++){let H=c[G];if(H.startSegmentIndex===H.endSegmentIndex){Q(H);continue}x=!1,v=0,_=H.startSegmentIndex,R=0,T=H.startSegmentIndex,M=0,C();let z=H.startSegmentIndex;for(;z<H.endSegmentIndex;){let X=a[z],we=X==="space"||X==="preserved-space"||X==="tab"||X==="zero-width-break"||X==="soft-hyphen",q=X==="tab"?Jf(v,u):r[z];if(X==="soft-hyphen"){x&&(T=z+1,M=0,F=z+1,E=v+s,S=v+s,A=X),z++;continue}if(!x){q>t&&l[z]!==null?k(z,0):I(z,q),oe(X,we,z,q),z++;continue}if(v+q>p){let O=v+(X==="tab"?0:i[z]),j=v+(X==="tab"?q:o[z]);if(A==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&E<=p){N(F,0,S);continue}if(A==="soft-hyphen"&&V(z)){z++;continue}if(we&&O<=p){U(z,q),N(z+1,0,j),z++;continue}if(F>=0&&E<=p){if(T>F||T===F&&M>0){N();continue}let le=F;N(le,0,S),z=le;continue}if(q>t&&l[z]!==null){N(),k(z,0),z++;continue}N();continue}U(z,q),oe(X,we,z,q),z++}if(x){let X=F===H.consumedEndSegmentIndex?S:v;N(H.consumedEndSegmentIndex,0,X)}}return b}function rm(e,t,n,r){let i=e.chunks[n];if(i.startSegmentIndex===i.endSegmentIndex)return t.segmentIndex=i.consumedEndSegmentIndex,t.graphemeIndex=0,0;let{widths:o,lineEndFitAdvances:a,lineEndPaintAdvances:l,kinds:s,breakableFitAdvances:u,discretionaryHyphenWidth:c,tabStopAdvance:m}=e,f=At(),p=f.lineFitEpsilon,b=r+p,v=0,x=!1,_=t.segmentIndex,R=t.graphemeIndex,T=-1,M=0,F=0,E=null;function S(){T=-1,M=0,F=0,E=null}function A(k=_,V=R,Q=v){return x?(t.segmentIndex=k,t.graphemeIndex=V,Q):null}function C(k,V){x=!0,_=k+1,R=0,v=V}function N(k,V,Q){x=!0,_=k,R=V+1,v=Q}function I(k,V){if(!x){C(k,V);return}v+=V,_=k+1,R=0}function W(k,V,Q,G){if(!V)return;let H=k==="tab"?0:a[Q],z=k==="tab"?G:l[Q];T=Q+1,M=v-G+H,F=v-G+z,E=k}function U(k,V){let Q=u[k];for(let G=V;G<Q.length;G++){let H=Q[G];if(!x)N(k,G,H);else{if(v+H>b)return A();v+=H,_=k,R=G+1}}return x&&_===k&&R===Q.length&&(_=k+1,R=0),null}function oe(k){if(E!=="soft-hyphen"||T<0)return null;let V=u[k]??null;if(V!==null){let{fitCount:Q,fittedWidth:G}=Qf(V,v,r,p,c);if(Q===V.length)return v=G,_=k+1,R=0,S(),null;if(Q>0)return A(k,Q,G+c)}return M<=b?A(T,0,F):null}for(let k=t.segmentIndex;k<i.endSegmentIndex;k++){let V=s[k],Q=V==="space"||V==="preserved-space"||V==="tab"||V==="zero-width-break"||V==="soft-hyphen",G=k===t.segmentIndex?t.graphemeIndex:0,H=V==="tab"?Jf(v,m):o[k];if(V==="soft-hyphen"&&G===0){x&&(_=k+1,R=0,T=k+1,M=v+c,F=v+c,E=V);continue}if(!x){if(G>0){let X=U(k,G);if(X!==null)return X}else if(H>r&&u[k]!==null){let X=U(k,0);if(X!==null)return X}else C(k,H);W(V,Q,k,H);continue}if(v+H>b){let X=v+(V==="tab"?0:a[k]),we=v+(V==="tab"?H:l[k]);if(E==="soft-hyphen"&&f.preferEarlySoftHyphenBreak&&M<=b)return A(T,0,F);let q=oe(k);if(q!==null)return q;if(Q&&X<=b)return I(k,H),A(k+1,0,we);if(T>=0&&M<=b)return _>T||_===T&&R>0?A():A(T,0,F);if(H>r&&u[k]!==null){let P=A();if(P!==null)return P;let O=U(k,0);if(O!==null)return O}return A()}I(k,H),W(V,Q,k,H)}return T===i.consumedEndSegmentIndex&&R===0?A(i.consumedEndSegmentIndex,0,F):A(i.consumedEndSegmentIndex,0,v)}function a1(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:o}=e,l=At().lineFitEpsilon,s=n+l,u=0,c=!1,m=t.segmentIndex,f=t.graphemeIndex,p=-1,b=0;for(let v=t.segmentIndex;v<r.length;v++){let x=r[v],_=i[v],R=_==="space"||_==="preserved-space"||_==="tab"||_==="zero-width-break"||_==="soft-hyphen",T=v===t.segmentIndex?t.graphemeIndex:0,M=o[v];if(!c){if(T>0||x>n&&M!==null){let F=M,E=F[T];c=!0,u=E,m=v,f=T+1;for(let S=T+1;S<F.length;S++){let A=F[S];if(u+A>s)return t.segmentIndex=m,t.graphemeIndex=f,u;u+=A,m=v,f=S+1}m===v&&f===F.length&&(m=v+1,f=0)}else c=!0,u=x,m=v+1,f=0;R&&(p=v+1,b=u-x);continue}if(u+x>s)return R?(t.segmentIndex=v+1,t.graphemeIndex=0,u):p>=0?m>p||m===p&&f>0?(t.segmentIndex=m,t.graphemeIndex=f,u):(t.segmentIndex=p,t.graphemeIndex=0,b):(t.segmentIndex=m,t.graphemeIndex=f,u);u+=x,m=v+1,f=0,R&&(p=v+1,b=u-x)}return c?(t.segmentIndex=m,t.graphemeIndex=f,u):null}function s1(e,t,n){let r=em(e,t);return r<0?null:e.simpleLineWalkFastPath?a1(e,t,n):rm(e,t,r,n)}function im(e,t){if(e.widths.length===0)return{lineCount:0,maxLineWidth:0};let n={segmentIndex:0,graphemeIndex:0},r=0,i=0;if(!e.simpleLineWalkFastPath){let o=em(e,n);for(;o>=0;){let a=rm(e,n,o,t);if(a===null)return{lineCount:r,maxLineWidth:i};r++,a>i&&(i=a),o=o1(e,o,n)}return{lineCount:r,maxLineWidth:i}}for(;;){let o=s1(e,n,t);if(o===null)return{lineCount:r,maxLineWidth:i};r++,o>i&&(i=o)}}var ds=null;function l1(){return ds===null&&(ds=new Intl.Segmenter(void 0,{granularity:"grapheme"})),ds}function u1(e){return e?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function c1(e,t){let n=[],r=[],i=0,o=!1,a=!1,l=!1;function s(){r.length!==0&&(n.push({text:r.length===1?r[0]:r.join(""),start:i}),r=[],o=!1,a=!1,l=!1)}function u(m,f,p){r=[m],i=f,o=p,a=Li(m),l=pr.has(m)}function c(m,f){r.push(m),o=o||f;let p=Li(m);m.length===1&&vt.has(m)?a=a||p:a=p,l=!1}for(let m of l1().segment(e)){let f=m.segment,p=We(f);if(r.length===0){u(f,m.index,p);continue}if(l||Fi.has(f)||vt.has(f)||t.carryCJKAfterClosingQuote&&p&&a){c(f,p);continue}if(!o&&!p){c(f,p);continue}s(),u(f,m.index,p)}return s(),n}function d1(e){if(e.length<=1)return e;let t=[],n=[e[0].text],r=e[0].start,i=We(e[0].text),o=Mi(e[0].text);function a(){t.push({text:n.length===1?n[0]:n.join(""),start:r})}for(let l=1;l<e.length;l++){let s=e[l],u=We(s.text),c=Mi(s.text);if(i&&o){n.push(s.text),i=i||u,o=c;continue}a(),n=[s.text],r=s.start,i=u,o=c}return a(),t}function f1(e,t,n,r){let i=At(),{cache:o,emojiCorrection:a}=Xf(t,Kf(e.normalized)),l=St("-",st("-",o),a),u=St(" ",st(" ",o),a)*8;if(e.len===0)return u1(n);let c=[],m=[],f=[],p=[],b=e.chunks.length<=1,v=n?[]:null,x=[],_=n?[]:null,R=Array.from({length:e.len});function T(S,A,C,N,I,W,U){I!=="text"&&I!=="space"&&I!=="zero-width-break"&&(b=!1),c.push(A),m.push(C),f.push(N),p.push(I),v?.push(W),x.push(U),_!==null&&_.push(S)}function M(S,A,C,N,I){let W=st(S,o),U=St(S,W,a),oe=A==="space"||A==="preserved-space"||A==="zero-width-break"?0:U,k=A==="space"||A==="zero-width-break"?0:U;if(I&&N&&S.length>1){let V="sum-graphemes";mr(S)?V="pair-context":i.preferPrefixWidthsForBreakableRuns&&(V="segment-prefixes");let Q=Yf(S,W,o,a,V);T(S,U,oe,k,A,C,Q);return}T(S,U,oe,k,A,C,null)}for(let S=0;S<e.len;S++){R[S]=c.length;let A=e.texts[S],C=e.isWordLike[S],N=e.kinds[S],I=e.starts[S];if(N==="soft-hyphen"){T(A,0,l,l,N,I,null);continue}if(N==="hard-break"){T(A,0,0,0,N,I,null);continue}if(N==="tab"){T(A,0,0,0,N,I,null);continue}let W=st(A,o);if(N==="text"&&W.containsCJK){let U=c1(A,i),oe=r==="keep-all"?d1(U):U;for(let k=0;k<oe.length;k++){let V=oe[k];M(V.text,"text",I+V.start,C,r==="keep-all"||!We(V.text))}continue}M(A,N,I,C,!0)}let F=m1(e.chunks,R,c.length),E=v===null?null:Lf(e.normalized,v);return _!==null?{widths:c,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:p,simpleLineWalkFastPath:b,segLevels:E,breakableFitAdvances:x,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:F,segments:_}:{widths:c,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:p,simpleLineWalkFastPath:b,segLevels:E,breakableFitAdvances:x,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:F}}function m1(e,t,n){let r=[];for(let i=0;i<e.length;i++){let o=e[i],a=o.startSegmentIndex<t.length?t[o.startSegmentIndex]:n,l=o.endSegmentIndex<t.length?t[o.endSegmentIndex]:n,s=o.consumedEndSegmentIndex<t.length?t[o.consumedEndSegmentIndex]:n;r.push({startSegmentIndex:a,endSegmentIndex:l,consumedEndSegmentIndex:s})}return r}function om(e,t,n,r){let i=r?.wordBreak??"normal",o=zf(e,At(),r?.whiteSpace,i);return f1(o,t,n,i)}function Di(e,t,n){return om(e,t,!1,n)}function am(e,t,n){return om(e,t,!0,n)}function Ii(e,t,n){let r=tm(e,t);return{lineCount:r,height:r*n}}function p1(e){return{width:e.width,start:{segmentIndex:e.startSegmentIndex,graphemeIndex:e.startGraphemeIndex},end:{segmentIndex:e.endSegmentIndex,graphemeIndex:e.endGraphemeIndex}}}function h1(e,t,n){return e.widths.length===0?0:cs(e,t,r=>{n(p1(r))})}function sm(e,t){return im(e,t)}function lm(e){let t=0;return h1(e,Number.POSITIVE_INFINITY,n=>{n.width>t&&(t=n.width)}),t}var g1={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function um(e,t){let n={...g1,...t},r=1.2;for(let i=n.baseFontSize;i>=n.minFontSize;i-=n.step){let o=`${n.fontWeight} ${i}px ${n.fontFamily}`,a=Di(e,o),{lineCount:l}=Ii(a,n.maxWidth,i*r);if(l<=1)return{fontSize:i,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}var cm={prepare:Di,layout:Ii,prepareWithSegments:am,measureLineStats:sm,measureNaturalWidth:lm};window.__timelines=window.__timelines||{};Md();window.__hyperframes={fitTextFontSize:um,getVariables:Hs,pretext:cm,registerRuntimeDataHandler:kf,setRuntimeData:Ti,clearRuntimeData:Ri};function dm(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,Ff())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",dm,{once:!0}):dm();})();
708
+ `)return"hard-break"}return e===" "?"space":e==="\xA0"||e==="\u202F"||e==="\u2060"||e==="\uFEFF"?"glue":e==="\u200B"?"zero-width-break":e==="\xAD"?"soft-hyphen":"text"}var Ny=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ie(e){return e.length===1?e[0]:e.join("")}function Ly(e,t){let n=[];for(let r=e.length-1;r>=0;r--)n.push(e[r]);return n.push(t),Ie(n)}function Dy(e,t,n,r){if(!Ny.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];let i=[],o=null,a=[],l=n,s=!1,u=0;for(let c of e){let m=Fy(c,r),f=m==="text"&&t;if(o!==null&&m===o&&f===s){a.push(c),u+=c.length;continue}o!==null&&i.push({text:Ie(a),isWordLike:s,kind:o,start:l}),o=m,a=[c],l=n+u,s=f,u+=c.length}return o!==null&&i.push({text:Ie(a),isWordLike:s,kind:o,start:l}),i}function os(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var Iy=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Py(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:Iy.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Oy(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Hy(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let a=0;a<e.len;a++){if(r[a]!=="text"||!Py(e,a))continue;let l=[t[a]],s=a+1;for(;s<e.len&&!os(r[s]);){l.push(t[s]),n[a]=!0;let u=t[s].includes("?");if(r[s]="text",t[s]="",s++,u)break}t[a]=Ie(l)}let o=0;for(let a=0;a<t.length;a++){let l=t[a];l.length!==0&&(o!==a&&(t[o]=l,n[o]=n[a],r[o]=r[a],i[o]=i[a]),o++)}return t.length=o,n.length=o,r.length=o,i.length=o,{len:o,texts:t,isWordLike:n,kinds:r,starts:i}}function Gy(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o]),!Oy(a))continue;let l=o+1;if(l>=e.len||os(e.kinds[l]))continue;let s=[],u=e.starts[l],c=l;for(;c<e.len&&!os(e.kinds[c]);)s.push(e.texts[c]),c++;s.length>0&&(t.push(Ie(s)),n.push(!0),r.push("text"),i.push(u),o=c-1)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}var By=new Set([":","-","/","\xD7",",",".","+","\u2013","\u2014"]),Hf=/^[A-Za-z0-9_]+[,:;]*$/,Gf=/[,:;]+$/;function Vf(e){for(let t of e)if(Uf.test(t))return!0;return!1}function mr(e){if(e.length===0)return!1;for(let t of e)if(!(Uf.test(t)||By.has(t)))return!1;return!0}function Uy(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o];if(l==="text"&&mr(a)&&Vf(a)){let s=[a],u=o+1;for(;u<e.len&&e.kinds[u]==="text"&&mr(e.texts[u]);)s.push(e.texts[u]),u++;t.push(Ie(s)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=u-1;continue}t.push(a),n.push(e.isWordLike[o]),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Wy(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o],s=e.isWordLike[o];if(l==="text"&&s&&Hf.test(a)){let u=[a],c=Gf.test(a),m=o+1;for(;c&&m<e.len&&e.kinds[m]==="text"&&e.isWordLike[m]&&Hf.test(e.texts[m]);){let f=e.texts[m];u.push(f),c=Gf.test(f),m++}t.push(Ie(u)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=m-1;continue}t.push(a),n.push(s),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Vy(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(e.kinds[o]==="text"&&a.includes("-")){let l=a.split("-"),s=l.length>1;for(let u=0;u<l.length;u++){let c=l[u];if(!s)break;(c.length===0||!Vf(c)||!mr(c))&&(s=!1)}if(s){let u=0;for(let c=0;c<l.length;c++){let m=l[c],f=c<l.length-1?`${m}-`:m;t.push(f),n.push(!0),r.push("text"),i.push(e.starts[o]+u),u+=f.length}continue}}t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function zy(e){let t=[],n=[],r=[],i=[],o=0;for(;o<e.len;){let a=[e.texts[o]],l=e.isWordLike[o],s=e.kinds[o],u=e.starts[o];if(s==="glue"){let c=[a[0]],m=u;for(o++;o<e.len&&e.kinds[o]==="glue";)c.push(e.texts[o]),o++;let f=Ie(c);if(o<e.len&&e.kinds[o]==="text")a[0]=f,a.push(e.texts[o]),l=e.isWordLike[o],s="text",u=m,o++;else{t.push(f),n.push(!1),r.push("glue"),i.push(m);continue}}else o++;if(s==="text")for(;o<e.len&&e.kinds[o]==="glue";){let c=[];for(;o<e.len&&e.kinds[o]==="glue";)c.push(e.texts[o]),o++;let m=Ie(c);if(o<e.len&&e.kinds[o]==="text"){a.push(m,e.texts[o]),l=l||e.isWordLike[o],o++;continue}a.push(m)}t.push(Ie(a)),n.push(l),r.push(s),i.push(u)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function qy(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let o=0;o<t.length-1;o++){if(r[o]!=="text"||r[o+1]!=="text"||!We(t[o])||!We(t[o+1]))continue;let a=Ty(t[o]);a!==null&&(t[o]=a.head,t[o+1]=a.tail+t[o+1],i[o+1]=i[o]+a.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Bf(e,t,n){let r=hy(),i=0,o=[],a=[],l=[],s=[],u=[],c=[],m=[],f=[],p=[],b=[],v=[],x=[];for(let E of r.segment(e))for(let S of Dy(E.segment,E.isWordLike??!1,E.index,n)){let V=function(){c[k]!==null&&(a[k]=[Pf(o,c,m,k)],c[k]=null),a[k].push(S.text),l[k]=l[k]||S.isWordLike,f[k]=f[k]||N,p[k]=p[k]||I,b[k]=B,v[k]=oe,x[k]=Of(p[k],W)},A=S.kind==="text",C=Ry(S.text,S.isWordLike,S.kind),N=We(S.text),I=Df(S.text),W=Ni(S.text),B=Li(S.text),oe=ky(S.text),k=i-1;t.carryCJKAfterClosingQuote&&A&&i>0&&s[k]==="text"&&N&&f[k]&&b[k]||A&&i>0&&s[k]==="text"&&Cy(S.text)&&f[k]||A&&i>0&&s[k]==="text"&&v[k]?V():A&&i>0&&s[k]==="text"&&S.isWordLike&&I&&x[k]?(V(),l[k]=!0):C!==null&&i>0&&s[k]==="text"&&c[k]===C?m[k]=(m[k]??1)+1:A&&!S.isWordLike&&i>0&&s[k]==="text"&&(wy(S.text)||S.text==="-"&&l[k])?V():(o[i]=S.text,a[i]=[S.text],l[i]=S.isWordLike,s[i]=S.kind,u[i]=S.start,c[i]=C,m[i]=C===null?0:1,f[i]=N,p[i]=I,b[i]=B,v[i]=oe,x[i]=Of(I,W),i++)}for(let E=0;E<i;E++){if(c[E]!==null){o[E]=Pf(o,c,m,E);continue}o[E]=Ie(a[E])}for(let E=1;E<i;E++)s[E]==="text"&&!l[E]&&ss(o[E])&&s[E-1]==="text"&&(o[E-1]+=o[E],l[E-1]=l[E-1]||l[E],o[E]="");let _=Array.from({length:i},()=>null),R=-1;for(let E=i-1;E>=0;E--){let S=o[E];if(S.length!==0){if(s[E]==="text"&&!l[E]&&_y(S)&&R>=0&&s[R]==="text"){let A=_[R]??[];A.push(S),_[R]=A,u[R]=u[E],o[E]="";continue}R=E}}for(let E=0;E<i;E++){let S=_[E];S!=null&&(o[E]=Ly(S,o[E]))}let T=0;for(let E=0;E<i;E++){let S=o[E];S.length!==0&&(T!==E&&(o[T]=S,l[T]=l[E],s[T]=s[E],u[T]=u[E]),T++)}o.length=T,l.length=T,s.length=T,u.length=T;let M=zy({len:T,texts:o,isWordLike:l,kinds:s,starts:u}),F=qy(Wy(Vy(Uy(Gy(Hy(M))))));for(let E=0;E<F.len-1;E++){let S=My(F.texts[E]);S!==null&&(F.kinds[E]!=="space"&&F.kinds[E]!=="preserved-space"||F.kinds[E+1]!=="text"||!Df(F.texts[E+1])||(F.texts[E]=S.space,F.isWordLike[E]=!1,F.kinds[E]=F.kinds[E]==="preserved-space"?"preserved-space":"space",F.texts[E+1]=S.marks+F.texts[E+1],F.starts[E+1]=F.starts[E]+S.space.length))}return F}function $y(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];let n=[],r=0;for(let i=0;i<e.len;i++)e.kinds[i]==="hard-break"&&(n.push({startSegmentIndex:r,endSegmentIndex:i,consumedEndSegmentIndex:i+1}),r=i+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function jy(e){if(e.len<=1)return e;let t=[],n=[],r=[],i=[],o=null,a=!1,l=0,s=!1,u=!1;function c(){o!==null&&(t.push(Ie(o)),n.push(a),r.push("text"),i.push(l),o=null)}for(let m=0;m<e.len;m++){let f=e.texts[m],p=e.kinds[m],b=e.isWordLike[m],v=e.starts[m];if(p==="text"){let x=yy(f),_=Mi(f);if(o!==null&&s&&u){o.push(f),a=a||b,s=s||x,u=_;continue}c(),o=[f],a=b,l=v,s=x,u=_;continue}c(),t.push(f),n.push(b),r.push(p),i.push(v)}return c(),{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function zf(e,t,n="normal",r="normal"){let i=dy(n),o=i.mode==="pre-wrap"?my(e):fy(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let a=r==="keep-all"?jy(Bf(o,t,i)):Bf(o,t,i);return{normalized:o,chunks:$y(a,i),...a}}var un=null,qf=new Map,cn=null,Ky=96,Yy=/\p{Emoji_Presentation}/u,Xy=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u,ls=null,$f=new Map;function us(){if(un!==null)return un;if(typeof OffscreenCanvas<"u")return un=new OffscreenCanvas(1,1).getContext("2d"),un;if(typeof document<"u")return un=document.createElement("canvas").getContext("2d"),un;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Jy(e){let t=qf.get(e);return t||(t=new Map,qf.set(e,t)),t}function st(e,t){let n=t.get(e);return n===void 0&&(n={width:us().measureText(e).width,containsCJK:We(e)},t.set(e,n)),n}function At(){if(cn!==null)return cn;if(typeof navigator>"u")return cn={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},cn;let e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),r=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return cn={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:r,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},cn}function Qy(e){let t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function jf(){return ls===null&&(ls=new Intl.Segmenter(void 0,{granularity:"grapheme"})),ls}function Zy(e){return Yy.test(e)||e.includes("\uFE0F")}function Kf(e){return Xy.test(e)}function e1(e,t){let n=$f.get(e);if(n!==void 0)return n;let r=us();r.font=e;let i=r.measureText("\u{1F600}").width;if(n=0,i>t+.5&&typeof document<"u"&&document.body!==null){let o=document.createElement("span");o.style.font=e,o.style.display="inline-block",o.style.visibility="hidden",o.style.position="absolute",o.textContent="\u{1F600}",document.body.appendChild(o);let a=o.getBoundingClientRect().width;document.body.removeChild(o),i-a>.5&&(n=i-a)}return $f.set(e,n),n}function t1(e){let t=0,n=jf();for(let r of n.segment(e))Zy(r.segment)&&t++;return t}function n1(e,t){return t.emojiCount===void 0&&(t.emojiCount=t1(e)),t.emojiCount}function St(e,t,n){return n===0?t.width:t.width-n1(e,t)*n}function Yf(e,t,n,r,i){if(t.breakableFitAdvances!==void 0)return t.breakableFitAdvances;let o=jf(),a=[];for(let c of o.segment(e))a.push(c.segment);if(a.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(i==="sum-graphemes"){let c=[];for(let m of a){let f=st(m,n);c.push(St(m,f,r))}return t.breakableFitAdvances=c,t.breakableFitAdvances}if(i==="pair-context"||a.length>Ky){let c=[],m=null,f=0;for(let p of a){let b=st(p,n),v=St(p,b,r);if(m===null)c.push(v);else{let x=m+p,_=st(x,n);c.push(St(x,_,r)-f)}m=p,f=v}return t.breakableFitAdvances=c,t.breakableFitAdvances}let l=[],s="",u=0;for(let c of a){s+=c;let m=st(s,n),f=St(s,m,r);l.push(f-u),u=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function Xf(e,t){let n=us();n.font=e;let r=Jy(e),i=Qy(e),o=t?e1(e,i):0;return{cache:r,fontSize:i,emojiCorrection:o}}function r1(e,t){for(;t<e.widths.length;){let n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function Jf(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Qf(e,t,n,r,i){let o=0,a=t;for(;o<e.length;){let l=a+e[o];if((o+1<e.length?l+i:l)>n+r)break;a=l,o++}return{fitCount:o,fittedWidth:a}}function i1(e,t){let n=0,r=e.chunks.length;for(;n<r;){let i=Math.floor((n+r)/2);t<e.chunks[i].consumedEndSegmentIndex?r=i:n=i+1}return n<e.chunks.length?n:-1}function Zf(e,t,n){let r=n.segmentIndex;if(n.graphemeIndex>0)return t;let i=e.chunks[t];if(i.startSegmentIndex===i.endSegmentIndex&&r===i.startSegmentIndex)return n.segmentIndex=r,n.graphemeIndex=0,t;for(r<i.startSegmentIndex&&(r=i.startSegmentIndex);r<i.endSegmentIndex;){let o=e.kinds[r];if(o!=="space"&&o!=="zero-width-break"&&o!=="soft-hyphen")return n.segmentIndex=r,n.graphemeIndex=0,t;r++}return i.consumedEndSegmentIndex>=e.widths.length?-1:(n.segmentIndex=i.consumedEndSegmentIndex,n.graphemeIndex=0,t+1)}function em(e,t){if(t.segmentIndex>=e.widths.length)return-1;let n=i1(e,t.segmentIndex);return n<0?-1:Zf(e,n,t)}function o1(e,t,n){if(n.segmentIndex>=e.widths.length)return-1;let r=t;for(;r<e.chunks.length&&n.segmentIndex>=e.chunks[r].consumedEndSegmentIndex;)r++;return r>=e.chunks.length?-1:Zf(e,r,n)}function tm(e,t){return e.simpleLineWalkFastPath?nm(e,t):cs(e,t)}function nm(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:o}=e;if(r.length===0)return 0;let l=At().lineFitEpsilon,s=t+l,u=0,c=0,m=!1,f=0,p=0,b=0,v=0,x=-1,_=0;function R(){x=-1,_=0}function T(C=b,N=v,I=c){u++,n?.({startSegmentIndex:f,startGraphemeIndex:p,endSegmentIndex:C,endGraphemeIndex:N,width:I}),c=0,m=!1,R()}function M(C,N){m=!0,f=C,p=0,b=C+1,v=0,c=N}function F(C,N,I){m=!0,f=C,p=N,b=C,v=N+1,c=I}function E(C,N){if(!m){M(C,N);return}c+=N,b=C+1,v=0}function S(C,N){let I=o[C];for(let W=N;W<I.length;W++){let B=I[W];m?c+B>s?(T(),F(C,W,B)):(c+=B,b=C,v=W+1):F(C,W,B)}m&&b===C&&v===I.length&&(b=C+1,v=0)}let A=0;for(;A<r.length&&!(!m&&(A=r1(e,A),A>=r.length));){let C=r[A],N=i[A],I=N==="space"||N==="preserved-space"||N==="tab"||N==="zero-width-break"||N==="soft-hyphen";if(!m){C>t&&o[A]!==null?S(A,0):M(A,C),I&&(x=A+1,_=c-C),A++;continue}if(c+C>s){if(I){E(A,C),T(A+1,0,c-C),A++;continue}if(x>=0){if(b>x||b===x&&v>0){T();continue}T(x,0,_);continue}if(C>t&&o[A]!==null){T(),S(A,0),A++;continue}T();continue}E(A,C),I&&(x=A+1,_=c-C),A++}return m&&T(),u}function cs(e,t,n){if(e.simpleLineWalkFastPath)return nm(e,t,n);let{widths:r,lineEndFitAdvances:i,lineEndPaintAdvances:o,kinds:a,breakableFitAdvances:l,discretionaryHyphenWidth:s,tabStopAdvance:u,chunks:c}=e;if(r.length===0||c.length===0)return 0;let m=At(),f=m.lineFitEpsilon,p=t+f,b=0,v=0,x=!1,_=0,R=0,T=0,M=0,F=-1,E=0,S=0,A=null;function C(){F=-1,E=0,S=0,A=null}function N(G=T,H=M,z=v){b++,n?.({startSegmentIndex:_,startGraphemeIndex:R,endSegmentIndex:G,endGraphemeIndex:H,width:z}),v=0,x=!1,C()}function I(G,H){x=!0,_=G,R=0,T=G+1,M=0,v=H}function W(G,H,z){x=!0,_=G,R=H,T=G,M=H+1,v=z}function B(G,H){if(!x){I(G,H);return}v+=H,T=G+1,M=0}function oe(G,H,z,X){if(!H)return;let we=G==="tab"?0:i[z],q=G==="tab"?X:o[z];F=z+1,E=v-X+we,S=v-X+q,A=G}function k(G,H){let z=l[G];for(let X=H;X<z.length;X++){let we=z[X];x?v+we>p?(N(),W(G,X,we)):(v+=we,T=G,M=X+1):W(G,X,we)}x&&T===G&&M===z.length&&(T=G+1,M=0)}function V(G){if(A!=="soft-hyphen")return!1;let H=l[G];if(H==null)return!1;let{fitCount:z,fittedWidth:X}=Qf(H,v,t,f,s);return z===0?!1:(v=X,T=G,M=z,C(),z===H.length?(T=G+1,M=0,!0):(N(G,z,X+s),k(G,z),!0))}function Q(G){b++,n?.({startSegmentIndex:G.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:G.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),C()}for(let G=0;G<c.length;G++){let H=c[G];if(H.startSegmentIndex===H.endSegmentIndex){Q(H);continue}x=!1,v=0,_=H.startSegmentIndex,R=0,T=H.startSegmentIndex,M=0,C();let z=H.startSegmentIndex;for(;z<H.endSegmentIndex;){let X=a[z],we=X==="space"||X==="preserved-space"||X==="tab"||X==="zero-width-break"||X==="soft-hyphen",q=X==="tab"?Jf(v,u):r[z];if(X==="soft-hyphen"){x&&(T=z+1,M=0,F=z+1,E=v+s,S=v+s,A=X),z++;continue}if(!x){q>t&&l[z]!==null?k(z,0):I(z,q),oe(X,we,z,q),z++;continue}if(v+q>p){let O=v+(X==="tab"?0:i[z]),j=v+(X==="tab"?q:o[z]);if(A==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&E<=p){N(F,0,S);continue}if(A==="soft-hyphen"&&V(z)){z++;continue}if(we&&O<=p){B(z,q),N(z+1,0,j),z++;continue}if(F>=0&&E<=p){if(T>F||T===F&&M>0){N();continue}let le=F;N(le,0,S),z=le;continue}if(q>t&&l[z]!==null){N(),k(z,0),z++;continue}N();continue}B(z,q),oe(X,we,z,q),z++}if(x){let X=F===H.consumedEndSegmentIndex?S:v;N(H.consumedEndSegmentIndex,0,X)}}return b}function rm(e,t,n,r){let i=e.chunks[n];if(i.startSegmentIndex===i.endSegmentIndex)return t.segmentIndex=i.consumedEndSegmentIndex,t.graphemeIndex=0,0;let{widths:o,lineEndFitAdvances:a,lineEndPaintAdvances:l,kinds:s,breakableFitAdvances:u,discretionaryHyphenWidth:c,tabStopAdvance:m}=e,f=At(),p=f.lineFitEpsilon,b=r+p,v=0,x=!1,_=t.segmentIndex,R=t.graphemeIndex,T=-1,M=0,F=0,E=null;function S(){T=-1,M=0,F=0,E=null}function A(k=_,V=R,Q=v){return x?(t.segmentIndex=k,t.graphemeIndex=V,Q):null}function C(k,V){x=!0,_=k+1,R=0,v=V}function N(k,V,Q){x=!0,_=k,R=V+1,v=Q}function I(k,V){if(!x){C(k,V);return}v+=V,_=k+1,R=0}function W(k,V,Q,G){if(!V)return;let H=k==="tab"?0:a[Q],z=k==="tab"?G:l[Q];T=Q+1,M=v-G+H,F=v-G+z,E=k}function B(k,V){let Q=u[k];for(let G=V;G<Q.length;G++){let H=Q[G];if(!x)N(k,G,H);else{if(v+H>b)return A();v+=H,_=k,R=G+1}}return x&&_===k&&R===Q.length&&(_=k+1,R=0),null}function oe(k){if(E!=="soft-hyphen"||T<0)return null;let V=u[k]??null;if(V!==null){let{fitCount:Q,fittedWidth:G}=Qf(V,v,r,p,c);if(Q===V.length)return v=G,_=k+1,R=0,S(),null;if(Q>0)return A(k,Q,G+c)}return M<=b?A(T,0,F):null}for(let k=t.segmentIndex;k<i.endSegmentIndex;k++){let V=s[k],Q=V==="space"||V==="preserved-space"||V==="tab"||V==="zero-width-break"||V==="soft-hyphen",G=k===t.segmentIndex?t.graphemeIndex:0,H=V==="tab"?Jf(v,m):o[k];if(V==="soft-hyphen"&&G===0){x&&(_=k+1,R=0,T=k+1,M=v+c,F=v+c,E=V);continue}if(!x){if(G>0){let X=B(k,G);if(X!==null)return X}else if(H>r&&u[k]!==null){let X=B(k,0);if(X!==null)return X}else C(k,H);W(V,Q,k,H);continue}if(v+H>b){let X=v+(V==="tab"?0:a[k]),we=v+(V==="tab"?H:l[k]);if(E==="soft-hyphen"&&f.preferEarlySoftHyphenBreak&&M<=b)return A(T,0,F);let q=oe(k);if(q!==null)return q;if(Q&&X<=b)return I(k,H),A(k+1,0,we);if(T>=0&&M<=b)return _>T||_===T&&R>0?A():A(T,0,F);if(H>r&&u[k]!==null){let P=A();if(P!==null)return P;let O=B(k,0);if(O!==null)return O}return A()}I(k,H),W(V,Q,k,H)}return T===i.consumedEndSegmentIndex&&R===0?A(i.consumedEndSegmentIndex,0,F):A(i.consumedEndSegmentIndex,0,v)}function a1(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:o}=e,l=At().lineFitEpsilon,s=n+l,u=0,c=!1,m=t.segmentIndex,f=t.graphemeIndex,p=-1,b=0;for(let v=t.segmentIndex;v<r.length;v++){let x=r[v],_=i[v],R=_==="space"||_==="preserved-space"||_==="tab"||_==="zero-width-break"||_==="soft-hyphen",T=v===t.segmentIndex?t.graphemeIndex:0,M=o[v];if(!c){if(T>0||x>n&&M!==null){let F=M,E=F[T];c=!0,u=E,m=v,f=T+1;for(let S=T+1;S<F.length;S++){let A=F[S];if(u+A>s)return t.segmentIndex=m,t.graphemeIndex=f,u;u+=A,m=v,f=S+1}m===v&&f===F.length&&(m=v+1,f=0)}else c=!0,u=x,m=v+1,f=0;R&&(p=v+1,b=u-x);continue}if(u+x>s)return R?(t.segmentIndex=v+1,t.graphemeIndex=0,u):p>=0?m>p||m===p&&f>0?(t.segmentIndex=m,t.graphemeIndex=f,u):(t.segmentIndex=p,t.graphemeIndex=0,b):(t.segmentIndex=m,t.graphemeIndex=f,u);u+=x,m=v+1,f=0,R&&(p=v+1,b=u-x)}return c?(t.segmentIndex=m,t.graphemeIndex=f,u):null}function s1(e,t,n){let r=em(e,t);return r<0?null:e.simpleLineWalkFastPath?a1(e,t,n):rm(e,t,r,n)}function im(e,t){if(e.widths.length===0)return{lineCount:0,maxLineWidth:0};let n={segmentIndex:0,graphemeIndex:0},r=0,i=0;if(!e.simpleLineWalkFastPath){let o=em(e,n);for(;o>=0;){let a=rm(e,n,o,t);if(a===null)return{lineCount:r,maxLineWidth:i};r++,a>i&&(i=a),o=o1(e,o,n)}return{lineCount:r,maxLineWidth:i}}for(;;){let o=s1(e,n,t);if(o===null)return{lineCount:r,maxLineWidth:i};r++,o>i&&(i=o)}}var ds=null;function l1(){return ds===null&&(ds=new Intl.Segmenter(void 0,{granularity:"grapheme"})),ds}function u1(e){return e?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function c1(e,t){let n=[],r=[],i=0,o=!1,a=!1,l=!1;function s(){r.length!==0&&(n.push({text:r.length===1?r[0]:r.join(""),start:i}),r=[],o=!1,a=!1,l=!1)}function u(m,f,p){r=[m],i=f,o=p,a=Li(m),l=pr.has(m)}function c(m,f){r.push(m),o=o||f;let p=Li(m);m.length===1&&vt.has(m)?a=a||p:a=p,l=!1}for(let m of l1().segment(e)){let f=m.segment,p=We(f);if(r.length===0){u(f,m.index,p);continue}if(l||Fi.has(f)||vt.has(f)||t.carryCJKAfterClosingQuote&&p&&a){c(f,p);continue}if(!o&&!p){c(f,p);continue}s(),u(f,m.index,p)}return s(),n}function d1(e){if(e.length<=1)return e;let t=[],n=[e[0].text],r=e[0].start,i=We(e[0].text),o=Mi(e[0].text);function a(){t.push({text:n.length===1?n[0]:n.join(""),start:r})}for(let l=1;l<e.length;l++){let s=e[l],u=We(s.text),c=Mi(s.text);if(i&&o){n.push(s.text),i=i||u,o=c;continue}a(),n=[s.text],r=s.start,i=u,o=c}return a(),t}function f1(e,t,n,r){let i=At(),{cache:o,emojiCorrection:a}=Xf(t,Kf(e.normalized)),l=St("-",st("-",o),a),u=St(" ",st(" ",o),a)*8;if(e.len===0)return u1(n);let c=[],m=[],f=[],p=[],b=e.chunks.length<=1,v=n?[]:null,x=[],_=n?[]:null,R=Array.from({length:e.len});function T(S,A,C,N,I,W,B){I!=="text"&&I!=="space"&&I!=="zero-width-break"&&(b=!1),c.push(A),m.push(C),f.push(N),p.push(I),v?.push(W),x.push(B),_!==null&&_.push(S)}function M(S,A,C,N,I){let W=st(S,o),B=St(S,W,a),oe=A==="space"||A==="preserved-space"||A==="zero-width-break"?0:B,k=A==="space"||A==="zero-width-break"?0:B;if(I&&N&&S.length>1){let V="sum-graphemes";mr(S)?V="pair-context":i.preferPrefixWidthsForBreakableRuns&&(V="segment-prefixes");let Q=Yf(S,W,o,a,V);T(S,B,oe,k,A,C,Q);return}T(S,B,oe,k,A,C,null)}for(let S=0;S<e.len;S++){R[S]=c.length;let A=e.texts[S],C=e.isWordLike[S],N=e.kinds[S],I=e.starts[S];if(N==="soft-hyphen"){T(A,0,l,l,N,I,null);continue}if(N==="hard-break"){T(A,0,0,0,N,I,null);continue}if(N==="tab"){T(A,0,0,0,N,I,null);continue}let W=st(A,o);if(N==="text"&&W.containsCJK){let B=c1(A,i),oe=r==="keep-all"?d1(B):B;for(let k=0;k<oe.length;k++){let V=oe[k];M(V.text,"text",I+V.start,C,r==="keep-all"||!We(V.text))}continue}M(A,N,I,C,!0)}let F=m1(e.chunks,R,c.length),E=v===null?null:Lf(e.normalized,v);return _!==null?{widths:c,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:p,simpleLineWalkFastPath:b,segLevels:E,breakableFitAdvances:x,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:F,segments:_}:{widths:c,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:p,simpleLineWalkFastPath:b,segLevels:E,breakableFitAdvances:x,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:F}}function m1(e,t,n){let r=[];for(let i=0;i<e.length;i++){let o=e[i],a=o.startSegmentIndex<t.length?t[o.startSegmentIndex]:n,l=o.endSegmentIndex<t.length?t[o.endSegmentIndex]:n,s=o.consumedEndSegmentIndex<t.length?t[o.consumedEndSegmentIndex]:n;r.push({startSegmentIndex:a,endSegmentIndex:l,consumedEndSegmentIndex:s})}return r}function om(e,t,n,r){let i=r?.wordBreak??"normal",o=zf(e,At(),r?.whiteSpace,i);return f1(o,t,n,i)}function Di(e,t,n){return om(e,t,!1,n)}function am(e,t,n){return om(e,t,!0,n)}function Ii(e,t,n){let r=tm(e,t);return{lineCount:r,height:r*n}}function p1(e){return{width:e.width,start:{segmentIndex:e.startSegmentIndex,graphemeIndex:e.startGraphemeIndex},end:{segmentIndex:e.endSegmentIndex,graphemeIndex:e.endGraphemeIndex}}}function h1(e,t,n){return e.widths.length===0?0:cs(e,t,r=>{n(p1(r))})}function sm(e,t){return im(e,t)}function lm(e){let t=0;return h1(e,Number.POSITIVE_INFINITY,n=>{n.width>t&&(t=n.width)}),t}var g1={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function um(e,t){let n={...g1,...t},r=1.2;for(let i=n.baseFontSize;i>=n.minFontSize;i-=n.step){let o=`${n.fontWeight} ${i}px ${n.fontFamily}`,a=Di(e,o),{lineCount:l}=Ii(a,n.maxWidth,i*r);if(l<=1)return{fontSize:i,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}var cm={prepare:Di,layout:Ii,prepareWithSegments:am,measureLineStats:sm,measureNaturalWidth:lm};window.__timelines=window.__timelines||{};Md();window.__hyperframes={fitTextFontSize:um,getVariables:Hs,pretext:cm,registerRuntimeDataHandler:kf,setRuntimeData:Ti,clearRuntimeData:Ri};function dm(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,Ff())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",dm,{once:!0}):dm();})();
709
709