@hyperframes/core 0.8.46 → 0.8.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";(()=>{var oh=Object.create;var Ro=Object.defineProperty;var ah=Object.getOwnPropertyDescriptor;var sh=Object.getOwnPropertyNames;var lh=Object.getPrototypeOf,uh=Object.prototype.hasOwnProperty;var ch=(e,t,n)=>t in e?Ro(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var dh=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of sh(t))!uh.call(e,i)&&i!==n&&Ro(e,i,{get:()=>t[i],enumerable:!(r=ah(t,i))||r.enumerable});return e};var mh=(e,t,n)=>(n=e!=null?oh(lh(e)):{},dh(t||!e||!e.__esModule?Ro(n,"default",{value:e,enumerable:!0}):n,e));var ye=(e,t,n)=>ch(e,typeof t!="symbol"?t+"":t,n);var Mc=oe((VE,Ma)=>{var ee=String,kc=function(){return{isColorSupported:!1,reset:ee,bold:ee,dim:ee,italic:ee,underline:ee,inverse:ee,hidden:ee,strikethrough:ee,black:ee,red:ee,green:ee,yellow:ee,blue:ee,magenta:ee,cyan:ee,white:ee,gray:ee,bgBlack:ee,bgRed:ee,bgGreen:ee,bgYellow:ee,bgBlue:ee,bgMagenta:ee,bgCyan:ee,bgWhite:ee,blackBright:ee,redBright:ee,greenBright:ee,yellowBright:ee,blueBright:ee,magentaBright:ee,cyanBright:ee,whiteBright:ee,bgBlackBright:ee,bgRedBright:ee,bgGreenBright:ee,bgYellowBright:ee,bgBlueBright:ee,bgMagentaBright:ee,bgCyanBright:ee,bgWhiteBright:ee}};Ma.exports=kc();Ma.exports.createColors=kc});var Fa=oe(()=>{});var Ai=oe(($E,Lc)=>{"use strict";var Fc=Mc(),Nc=Fa(),Jn=class e extends Error{constructor(t,n,r,i,o,a){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),a&&(this.plugin=a),typeof n<"u"&&typeof r<"u"&&(typeof n=="number"?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let n=this.source;t==null&&(t=Fc.isColorSupported);let r=d=>d,i=d=>d,o=d=>d;if(t){let{bold:d,gray:f,red:m}=Fc.createColors(!0);i=h=>d(m(h)),r=h=>f(h),Nc&&(o=h=>Nc(h))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),s=Math.min(this.line+2,a.length),u=String(s).length;return a.slice(l,s).map((d,f)=>{let m=l+1+f,h=" "+(" "+m).slice(-u)+" | ";if(m===this.line){if(d.length>160){let v=20,x=Math.max(0,this.column-v),_=Math.max(this.column+v,this.endColumn+v),T=d.slice(x,_),C=r(h.replace(/\d/g," "))+d.slice(0,Math.min(this.column-1,v-1)).replace(/[^\t]/g," ");return i(">")+r(h)+o(T)+`
1
+ "use strict";(()=>{var oh=Object.create;var Ro=Object.defineProperty;var ah=Object.getOwnPropertyDescriptor;var sh=Object.getOwnPropertyNames;var lh=Object.getPrototypeOf,uh=Object.prototype.hasOwnProperty;var ch=(e,t,n)=>t in e?Ro(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var dh=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of sh(t))!uh.call(e,i)&&i!==n&&Ro(e,i,{get:()=>t[i],enumerable:!(r=ah(t,i))||r.enumerable});return e};var mh=(e,t,n)=>(n=e!=null?oh(lh(e)):{},dh(t||!e||!e.__esModule?Ro(n,"default",{value:e,enumerable:!0}):n,e));var ge=(e,t,n)=>ch(e,typeof t!="symbol"?t+"":t,n);var Mc=oe((VE,Ma)=>{var ee=String,kc=function(){return{isColorSupported:!1,reset:ee,bold:ee,dim:ee,italic:ee,underline:ee,inverse:ee,hidden:ee,strikethrough:ee,black:ee,red:ee,green:ee,yellow:ee,blue:ee,magenta:ee,cyan:ee,white:ee,gray:ee,bgBlack:ee,bgRed:ee,bgGreen:ee,bgYellow:ee,bgBlue:ee,bgMagenta:ee,bgCyan:ee,bgWhite:ee,blackBright:ee,redBright:ee,greenBright:ee,yellowBright:ee,blueBright:ee,magentaBright:ee,cyanBright:ee,whiteBright:ee,bgBlackBright:ee,bgRedBright:ee,bgGreenBright:ee,bgYellowBright:ee,bgBlueBright:ee,bgMagentaBright:ee,bgCyanBright:ee,bgWhiteBright:ee}};Ma.exports=kc();Ma.exports.createColors=kc});var Fa=oe(()=>{});var Ai=oe(($E,Lc)=>{"use strict";var Fc=Mc(),Nc=Fa(),Jn=class e extends Error{constructor(t,n,r,i,o,a){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),a&&(this.plugin=a),typeof n<"u"&&typeof r<"u"&&(typeof n=="number"?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let n=this.source;t==null&&(t=Fc.isColorSupported);let r=d=>d,i=d=>d,o=d=>d;if(t){let{bold:d,gray:f,red:m}=Fc.createColors(!0);i=h=>d(m(h)),r=h=>f(h),Nc&&(o=h=>Nc(h))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),s=Math.min(this.line+2,a.length),u=String(s).length;return a.slice(l,s).map((d,f)=>{let m=l+1+f,h=" "+(" "+m).slice(-u)+" | ";if(m===this.line){if(d.length>160){let v=20,x=Math.max(0,this.column-v),_=Math.max(this.column+v,this.endColumn+v),T=d.slice(x,_),C=r(h.replace(/\d/g," "))+d.slice(0,Math.min(this.column-1,v-1)).replace(/[^\t]/g," ");return i(">")+r(h)+o(T)+`
2
2
  `+C+i("^")}let b=r(h.replace(/\d/g," "))+d.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+r(h)+o(d)+`
3
3
  `+b+i("^")}return" "+r(h)+o(d)}).join(`
4
4
  `)}toString(){let t=this.showSourceCode();return t&&(t=`
@@ -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 ko=null;function Pl(e){ko=e}function Be(e,t){if(ko)try{ko({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){L("runtime.analytics.site1",n)}}function Ah(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 Kt(e){return`--${Ah(e)}`}function Ol(e){let t=new Map;for(let n of e){let r=Kt(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 Hl(){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,Tn(i));let n=Jr(),r={...t,...n};for(let i of e)Fo(i,r);return r}var Gl=new Set;function Bl(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 Eh(e,t){return t?.trim()||e.getAttribute("data-composition-id")?.trim()||e.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()||"composition"}function wh(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 _h(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=wh(e);return r.length===0||r.some(i=>String(i)===String(n))?null:{id:e.id,value:n,allowed:r}}function Fo(e,t,n){if(!e)return;let r=Bl(e);if(r.length===0)return;let i=Eh(e,n);for(let o of r){let a=_h(o,t);if(!a)continue;let l=`${i}|${a.id}|${String(a.value)}`;if(Gl.has(l))continue;Gl.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 Tn(e){let t={};for(let n of Bl(e))typeof n.id!="string"||!("default"in n)||(t[n.id]=n.default);return t}var Mo="data-hf-css-vars";function Xr(e){return"style"in e&&typeof e.style?.setProperty=="function"}function No(e,t){if(!Xr(e))return;let n=[];for(let[r,i]of Object.entries(t))if(typeof i=="string"&&i!==""||typeof i=="number"){let o=Kt(r);e.style.setProperty(o,String(i)),n.push(o)}n.length>0&&e.setAttribute(Mo,n.join(" "))}function Ul(e,t,n){let r={};for(let[i,o]of Object.entries(t)){let a=Kt(i);((Xr(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(r[i]=o)}return r}function Wl(e){if(!Xr(e))return;let t=e.getAttribute(Mo);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(Mo)}}function Vl(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=Jr(),r=[];for(let i of t)r.push(...Ch(i,n,e.defaultView));for(let i of Ol(r))console.warn(`composition variables ${i.join(", ")} collapse to the same CSS property ${Kt(i[0]??"")} \u2014 rename one to avoid cross-talk`)}function Ch(e,t,n){if(!Xr(e))return[];let r=Tn(e),i={};for(let[o,a]of Object.entries(r)){if(o in t)continue;let l=Kt(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 No(e,i),Object.keys(r)}function zl(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 Jr(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}var ql="http://www.w3.org/1999/xhtml";function Ne(e){return e!=null&&e.nodeType===1}function Se(e){return Ne(e)&&e.namespaceURI===ql}function kn(e,t){return Se(e)&&e.localName===t}function fe(e){return kn(e,"video")}function Lo(e){return kn(e,"audio")}function ge(e){return fe(e)||Lo(e)}function Oe(e){return kn(e,"img")}function $l(e){return kn(e,"style")}function jl(e){return kn(e,"link")}function Do(e){return Ne(e)&&(e.namespaceURI===ql||e.namespaceURI==="http://www.w3.org/2000/svg")}function Kl(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,d)=>{let f=null;try{f=u.effect?.getComputedTiming?.()??null}catch(h){L("runtime.adapters.css.site5",h)}if(!f)return{};let m=Number(f.endTime);return Number.isFinite(m)?{endSeconds:d+m/1e3}:{unbounded:!0}},o=(u,d)=>{for(let f of u){try{f.currentTime=d}catch(m){L("runtime.adapters.css.site1",m)}try{f.pause()}catch(m){L("runtime.adapters.css.site2",m)}}},a=u=>{for(let d of u)try{d.play()}catch(f){L("runtime.adapters.css.site3",f)}},l=u=>{for(let d of u)try{d.pause()}catch(f){L("runtime.adapters.css.site4",f)}},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 d of u){if(!Se(d))continue;let f=window.getComputedStyle(d);!f.animationName||f.animationName==="none"||t.push({el:d,baseDelay:d.style.animationDelay||"",basePlayState:d.style.animationPlayState||"",animations:n(d)})}},getInferredDurationSeconds:()=>{let u=0;for(let d of t){if(!d.el.isConnected)continue;let f=r(d.el);for(let m of n(d.el)){let h=i(m,f);h.endSeconds!=null&&(u=Math.max(u,h.endSeconds))}}return u>0?u:null},seek:u=>{let d=Number(u.time)||0;for(let f of t){if(!f.el.isConnected)continue;let m=r(f.el),h=Math.max(0,d-m)*1e3,b=f.animations;if(b.length>0){o(b,h);continue}f.el.style.animationPlayState="paused",f.el.style.animationDelay=`-${(h/1e3).toFixed(3)}s`}},pause:()=>{for(let u of t){if(!u.el.isConnected)continue;let d=u.animations;d.length>0&&l(d),s(u)}},play:()=>{for(let u of t)u.el.isConnected&&(s(u),a(u.animations))},revert:()=>{t=[]}}}function Yl(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 Xl(){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 Ql(){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(Io(r))r.goToAndStop(t*1e3,!1);else if(Po(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??0;if(Number.isFinite(i)&&i>0){let 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{(Io(t)||Po(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=Rh(r)}catch(o){L("runtime.adapters.lottie.site4",o)}i!=null&&(n=!0,t=Math.max(t,i))}return n?t:null}}}function Jl(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function Rh(e){return Io(e)?Jl(e.totalFrames,e.frameRate):Po(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:Jl(e.totalFrames,e.frameRate):null}function Io(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function Po(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}var Oo=-1,Qr=new Set,Yt,Go=0;function Zl(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}));Qr.add(i),i.then(o=>{Qr.delete(i)&&o.status==="rejected"&&Yt===void 0&&(Yt={reason:o.reason})})}function Zr(e){e!==Oo&&(Oo=e,Zl(e))}function ei(e){Oo=e,Zl(e)}function eu(){return Go>0}async function Ho(){Go+=1;let e=Yt;try{for(await Promise.resolve();Qr.size>0;){let r=(await Promise.all([...Qr])).find(i=>i.status==="rejected");e===void 0&&r?.status==="rejected"&&(e={reason:r.reason})}let t=Yt;if(e===void 0&&(e=t),Yt===t&&(Yt=void 0),e)throw e.reason}finally{Go-=1}}function tu(){let e=null,t=0,n=null,r=null,i=null,o=null,a=()=>{if(typeof window>"u")return null;let d=window.THREE?.DefaultLoadingManager;return!d||typeof d!="object"||typeof d.itemsLoaded!="number"||typeof d.itemsTotal!="number"?null:d},l=u=>{o||u.itemsTotal<=u.itemsLoaded||(o=new Promise(d=>{u.onLoad=function(){try{i?.call(this)}finally{o=null,u.onLoad=i??null,d()}}}))},s=u=>{n!==u&&(n=u,r=u.onStart??null,i=u.onLoad??null,u.onStart=function(d,f,m){try{r?.call(this,d,f,m)}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,Zr(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 Je(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 nu(){return Je({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 ru(){return Je({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 iu(){return Je({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 ou(){return Je({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 au(){return Je({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}var Th=250;function su(){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&&(eu()||(window.__hfTypegpuTime=e,ei(e)))},Th))};return{name:"typegpu",discover:()=>{},seek:o=>{e=Math.max(0,Number(o.time)||0),t=e,window.__hfTypegpuTime=e,Zr(e)},pause:()=>{e==null&&(e=Math.max(0,t)),i()},play:()=>{r(),e=null},revert:()=>{r(),e=null,t=0}}}var Mn="data-hf-render-id",lu="data-hf-group-render-id";function kh(e){return e.getAttribute(Mn)||e.id||null}var Mh="__render_frame_",Fh="__";function Nh(e){return`${Mh}${e}${Fh}`}function Lh(e){let t=kh(e);return t?Nh(t):null}function bt(e){let t=Lh(e);if(!t)return null;let n=document.getElementById(t);return Oe(n)?n:null}function uu(e){let t=e.nextElementSibling;if(Oe(t)&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;let n=bt(e);return n&&n.complete&&n.naturalWidth>0?n:null}function cu(){let e=globalThis.GPUQueue;if(!e?.prototype?.copyExternalImageToTexture)return;let t=e.prototype.copyExternalImageToTexture;e.prototype.copyExternalImageToTexture=function(n,r,i){if(fe(n?.source)){let o=uu(n.source);if(o)return t.call(this,{...n,source:o},r,i)}return t.call(this,n,r,i)}}function du(){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(fe(u)){let d=uu(u);d&&(l[s]=d)}return o.apply(this,l)};a.__hfVideoPatched=!0,r[i]=a}}}function mu(){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},d=(x,_)=>_<=0?x:x>=_?Math.max(0,x-_):x,f=(x,_)=>{let T=l.get(x);if(T)return T;let C={compositionTimeMs:_,animationTimeMs:e?d(u(x),_):u(x)};return l.set(x,C),C},m=(x,_)=>{if(!a.has(x)){a.add(x);let T=()=>{a.delete(x)};try{x.addEventListener("finish",T,{once:!0}),x.addEventListener("cancel",T,{once:!0})}catch(C){L("runtime.adapters.waapi.site4",C)}}f(x,_)},h=(x,_)=>{for(let T of x)m(T,_)},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 T=function(...C){let F=_.apply(this,C);return m(F,t),F};x.animate=T,r=x,i=_,o=T,n=!0}catch{}},v=x=>{let _=null;try{_=x.effect?.getComputedTiming?.()??null}catch(F){L("runtime.adapters.waapi.site4",F)}if(!_)return{};let T=Number(_.endTime);return Number.isFinite(T)?{endSeconds:(l.get(x)?.compositionTimeMs??0)/1e3+T/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,b(),h(s(),t)},seek:x=>{let _=Math.max(0,(Number(x.time)||0)*1e3);t=_,(!e||a.size>0)&&h(s(),e?_:0);for(let T of a){let C=e?f(T,_):f(T,0),F=C.animationTimeMs+Math.max(0,_-C.compositionTimeMs);try{T.currentTime=F}catch(D){L("runtime.adapters.waapi.site1",D)}try{T.pause()}catch(D){L("runtime.adapters.waapi.site2",D)}}},pause:()=>{e||h(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 T=v(_);T.endSeconds!=null&&(x=Math.max(x,T.endSeconds))}return x>0?x:null}}}var Bo=3.981071705534972;function Ue(e){return Number.isFinite(e)?Math.max(0,Math.min(Bo,e)):1}function ti(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function fu(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,ti(o))}});try{return t()}finally{delete e.volume,i.call(e,ti(o))}}var Xt=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),j1=Object.freeze([Xt.start,Xt.duration,Xt.trackIndex]),K1=Object.freeze([Xt.derivedEnd]),Y1=Object.freeze([Xt.derivedEnd,Xt.legacyTrack]);function ni(e){if(e==null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}var hu=/^[A-Za-z0-9_.:-]+$/;function gu(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function pu(e,t){let n=t;for(;n>=0&&gu(e,n);)n--;return n}function Dh(e,t){let n=t;for(;n>=0&&(e[n]??"").trim()==="";)n--;return n}function Ih(e){let t=e.length-1;if(!gu(e,t))return null;let n=pu(e,t);return e[n]==="."&&(n=pu(e,n-1)),n+1}function Ph(e){let t=Ih(e);if(t==null)return null;let n=Dh(e,t-1),r=e[n];if(r!=="+"&&r!=="-")return null;let i=e.slice(0,n).trim();if(!hu.test(i))return null;let o=Number(e.slice(t));return Number.isFinite(o)?{refId:i,operator:r,magnitude:o}:null}function Uo(e){let t=(e??"").trim();if(!t)return null;let n=ni(t);if(n!=null)return{kind:"absolute",value:n};if(hu.test(t))return{kind:"reference",refId:t,offset:0};let r=Ph(t);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}function bu(e){return Number.isFinite(e)&&e>0?Math.max(.1,Math.min(5,e)):1}function Ce(e){return ni(e)}function Le(e){let t=Number.parseFloat(e.getAttribute("data-playback-rate")??""),n=Number.isFinite(t)&&t>0?t:ge(e)?e.defaultPlaybackRate:1;return bu(n)}function Fn(e){let t=n=>{let r=Ce(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 xt(e,t){return Oh(t,Fn(e),Le(e))}function ri(e){let t=Ce(e.getAttribute("data-duration"));return t!=null&&t>0?t:Number.isFinite(e.duration)?xt(e,e.duration):null}function Oh(e,t,n){return Number.isFinite(e)?Math.max(0,e-t)/bu(n):null}function Nn(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 Jt(e){let t=Nn(e.start);if(t==null)return null;let n=Math.max(0,t),r=Nn(e.duration),i=Nn(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=Nn(e.end),l=Nn(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 ii="data-hf-media-start-basis";function Gh(e){return e?.trim().toLowerCase()==="global"?"global":"local"}function xu(e){return Gh(e.basis)==="global"?e.authoredStart:e.hostStart+e.authoredStart}function st(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,i=new WeakMap,o=new WeakMap,a=new Set,l=m=>{let h=r.getElementById(m);return h||(r.querySelector(`[data-composition-id="${CSS.escape(m)}"]`)??null)},s=m=>{let h=o.get(m);if(h!==void 0)return h;let b=null,v=Jt({start:0,duration:m.getAttribute("data-duration"),authoredDuration:n?m.getAttribute("data-hf-authored-duration"):null});if(v?.duration!=null&&v.duration>0&&(b=v.duration),b==null||b<=0){let x=d(m,0),_=Jt({start:x,end:m.getAttribute("data-end"),authoredEnd:n?m.getAttribute("data-hf-authored-end"):null});_?.duration!=null&&_.duration>0&&(b=_.duration)}if((b==null||b<=0)&&ge(m)){let x=Fn(m);Number.isFinite(m.duration)&&m.duration>x&&(b=(m.duration-x)/Le(m))}if(b==null||b<=0){let x=m.getAttribute("data-composition-id");if(x){let _=t[x]??null;if(_&&typeof _.duration=="function")try{let T=Number(_.duration());Number.isFinite(T)&&T>0&&(b=T)}catch(T){L("runtime.startResolver.site1",T)}}}return b!=null&&Number.isFinite(b)&&b>0?(o.set(m,b),b):(o.set(m,null),null)},u=(m,h)=>{if(m.hasAttribute("data-composition-id")){let v=m.parentElement?.closest("[data-composition-id]");return v?d(v,h):0}let b=m.closest("[data-composition-id]");return b?d(b,h):0},d=(m,h)=>{let b=i.get(m);if(b!==void 0)return b??h;if(a.has(m))return h;a.add(m);try{let v=Uo(m.getAttribute("data-start"));if(!v){if(m.hasAttribute("data-composition-id")){let F=m.parentElement;if(F&&(F.hasAttribute("data-composition-src")||F.hasAttribute("data-composition-id")||F.hasAttribute("data-composition-file"))){let D=d(F,h);return i.set(m,D),D}}return i.set(m,h),h}if(v.kind==="absolute"){let F=Math.max(0,v.value),D=Math.max(0,u(m,h)+F);return i.set(m,D),D}let x=l(v.refId);if(!x)return i.set(m,h),h;let _=d(x,0),T=s(x);if(T==null||T<=0){let F=Math.max(0,_+v.offset);return i.set(m,F),F}let C=Math.max(0,_+T+v.offset);return i.set(m,C),C}finally{a.delete(m)}};return{resolveStartForElement:(m,h=0)=>d(m,Math.max(0,h)),resolveDurationForElement:m=>s(m),resolveMediaStartForElement:m=>{let h=m.closest("[data-composition-id]"),b=h?d(h,0):0,v=Ce(m.getAttribute("data-start"));return m.hasAttribute("data-hf-auto-start")||v==null||b<=0?d(m,b):xu({authoredStart:v,hostStart:b,basis:m.getAttribute(ii)})}}}function Hh(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:Ue(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:Ue(n)}),i}function yu(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 Bh(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 Uh(e){let t=Number.parseFloat(e??"");return Number.isFinite(t)?t:void 0}function Wh(e,t){let n=st({timelineRegistry:window.__timelines,includeAuthoredTimingAttrs:!0}).resolveMediaStartForElement(e),r=Ce(e.dataset.end)??void 0,i=Ce(e.dataset.duration)??void 0,o=t;i!==void 0&&i>0?o=n+i:r!==void 0&&r>n&&(o=r);let a=Uh(e.dataset.volume)??1;return{start:n,end:o,staticVolume:Ue(a)}}function Vh(e,t,n,r,{start:i,end:o,staticVolume:a}){let l=1/Math.min(60,Math.max(1,r)),s=Math.max(0,i),u=Math.min(n,o),d=fu(e,()=>{e.volume=a;let m=[],h;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(Ue(v).toFixed(6))};Bh(m,h,x,b===u),h=x}if(b===u)break}return m});return d.some(m=>Math.abs(m.volume-a)>1e-4)?d:null}function vu(e,t,n,r,i={}){if(i.allowLiveTimelineSeek===!1||!t||!ge(e)||n<=0)return;let o=u=>{try{typeof t.totalTime=="function"?t.totalTime(u,!0):typeof t.seek=="function"&&t.seek(u,!0)}catch{}},a=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,l=Wh(e,n),s=Vh(e,o,n,60,l);if(Number.isFinite(a)&&o(a),s){let u=Hh(s,l.start,l.staticVolume);u.length>0&&r.set(e,u)}}var It="data-fx-chain",bA=It.slice(5),Su=1,Ln=(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}),Wo=(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}),oi=(e=-40,t=40,n=0)=>({kind:"number",key:"gain",label:"Gain",unit:"dB",min:e,max:t,step:.1,default:n,automatable:!0}),Au={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."},wu=[{id:"gain",label:"Gain",group:"dynamics",description:"Raise or lower the whole signal. Automate it to duck under something else.",params:[oi(-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:[Ln("frequency","Frequency",1e3),oi(-40,40,0),Wo(1)],web:"biquad-peaking"},{id:"lowshelf",label:"Low Shelf",group:"filter",description:"Lift or drop everything below the corner frequency.",params:[Ln("frequency","Frequency",200,20,2e3),oi(-40,40,0)],web:"biquad-lowshelf"},{id:"highshelf",label:"High Shelf",group:"filter",description:"Lift or drop everything above the corner frequency.",params:[Ln("frequency","Frequency",4e3,500,2e4),oi(-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:[Ln("frequency","Cutoff",300,20,2e4),Wo(.707),Au],web:"biquad-highpass"},{id:"lowpass",label:"Low-pass",group:"filter",description:"Remove high frequencies \u2014 darkens or muffles a track.",params:[Ln("frequency","Cutoff",8e3,100,2e4),Wo(.707),Au],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"}],Vo=new Map(wu.map(e=>[e.id,e]));function Dn(e){return Vo.get(e)}var xA=wu.map(e=>e.id);function In(e,t){let n=Vo.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 yt=class extends Error{constructor(t){super(t),this.name="AudioFxChainError"}};function _u(e){let t;try{t=JSON.parse(e)}catch(i){throw new yt(`Chain file is not valid JSON: ${i.message}`)}if(typeof t!="object"||t===null)throw new yt("Chain file must be a JSON object.");let n=t;if(n.version!==Su)throw new yt(`Unsupported chain version: ${String(n.version)}`);if(!Array.isArray(n.nodes))throw new yt("Chain file is missing a `nodes` array.");let r=n.nodes.map(zh);return{version:Su,nodes:r}}function Pn(e){return e.nodes.filter(t=>t.enabled!==!1)}function zh(e,t){if(typeof e!="object"||e===null)throw new yt(`Node ${t} is not an object.`);let n=e;if(typeof n.type!="string"||!Vo.has(n.type))throw new yt(`Node ${t} has unknown effect type: ${String(n.type)}`);return $h({type:n.type,id:ai(n.id),fromCarve:Eu(n.fromCarve),fromPreset:ai(n.fromPreset),label:ai(n.label),fromEq:ai(n.fromEq),fromLeveller:Eu(n.fromLeveller),presetAmount:qh(n.presetAmount),enabled:n.enabled!==!1,params:In(n.type,n.params??void 0)})}function ai(e){return typeof e=="string"&&e?e:void 0}function Eu(e){return e===!0?!0:void 0}function qh(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(1,Math.max(0,e))}function $h(e){for(let t of Object.keys(e))e[t]===void 0&&delete e[t];return e}var ut="data-automation",AA=ut.slice(5),si=1,jh=512,lt=class extends Error{constructor(t){super(t),this.name="AudioAutomationError"}},Qt="volume";function Gn(e){if(e===Qt)return{kind:"volume"};let t=e.split(".");if(t.length===3&&t[0]==="fx"&&t[1]===Kh){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 Kh="preset";var Yh={min:0,max:1,step:.01,unit:"",label:"Amount",scale:"linear",default:1},li={min:0,max:Bo,step:.01,unit:"",label:"Volume",scale:"linear",default:1};function zo(e,t){let n=Gn(e);if(!n)return null;if(n.kind==="volume")return li;if(n.kind==="preset")return t?.nodes.some(l=>l.fromPreset===n.presetId)?{...Yh,label:`${n.presetId} \xB7 Amount`}:null;let r=t?.nodes.find(a=>a.id===n.nodeId);if(!r)return null;let i=Dn(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 On(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 Xh(e){let t=On(e);return t===null||t===0?0:Math.min(1,Math.max(-1,t))}function Cu(e,t){let n=On(e),r=On(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 Jh(e){let t=Xh(e?.curve),n=Cu(e?.viaX,e?.viaY);return{...t?{curve:t}:{},...n?{viaX:n.x,viaY:n.y}:{}}}function Qh(e,t){let n=On(e?.t),r=On(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,...Jh(e)}}function Ru(e,t){let n=e.map(i=>Qh(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,jh)}function Zh(e){let t=[];for(let n of e.lanes){if(!Gn(n.target))continue;let r=n.target===Qt?li:null,i=Ru(n.points??[],r);i.length>0&&t.push({target:n.target,points:i})}return{version:si,lanes:t}}function Tu(e,t){let n=[];for(let r of e.lanes){let i=zo(r.target,t);if(!i)continue;let o=Ru(r.points,i);o.length>0&&n.push({target:r.target,points:o})}return{version:si,lanes:n}}function ui(e){let t;try{t=JSON.parse(e)}catch(i){throw new lt(`Automation is not valid JSON: ${i.message}`)}if(typeof t!="object"||t===null)throw new lt("Automation must be a JSON object.");let n=t;if(n.version!==si)throw new lt(`Unsupported automation version: ${String(n.version)}`);if(!Array.isArray(n.lanes))throw new lt("Automation is missing a `lanes` array.");let r=n.lanes.map((i,o)=>{if(typeof i!="object"||i===null)throw new lt(`Lane ${o} is not an object.`);let a=i;if(typeof a.target!="string"||!Gn(a.target))throw new lt(`Lane ${o} has an unreadable target: ${String(a.target)}`);if(!Array.isArray(a.points))throw new lt(`Lane ${o} is missing a \`points\` array.`);return{target:a.target,points:a.points}});return Zh({version:si,lanes:r})}function e0(e,t){return t?Math.pow(e,Math.pow(2,2*t)):e}function t0(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 n0(e,t,n){let{cx:r,cy:i,w:o}=t0(t,n),a=2-2*o,l=e*a-1+2*o*r,s=-e*a-2*o*r,u=r0(l,s,e),d=1-u,f=d*d+2*o*u*d+u*u;return f>0?(2*o*i*u*d+u*u)/f:e}function r0(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 i0(e,t){let n=Cu(t.viaX,t.viaY);return n?n0(Math.min(1,Math.max(0,e)),n.x,n.y):e0(e,t.curve)}function o0(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 Hn(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 f=a+l>>1;r[f].t<=t?a=f:l=f}let s=r[a],u=r[l],d=u.t-s.t;return d<=0?u.v:o0(s.v,u.v,i0((t-s.t)/d,s),n)}function ku(e){return e.points.length<=1||e.points.every(t=>t.v===e.points[0].v)}function Mu(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]=Hn(e,t+l*s/(o-1),i);return a}var ci=new Map,a0=64;function s0(e){let t=ci.get(e);if(t!==void 0)return t;let n=null;try{n=ui(e).lanes.find(r=>r.target===Qt)??null}catch{n=null}return ci.size>a0&&ci.clear(),ci.set(e,n),n}function Fu(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(ut):null)??"";if(!n)return null;let r=s0(n);return!r||r.points.length===0?null:Hn(r,t)}var Zt="hf-audio-group",di="data-audio-group";function qo(e){let t=e?.getAttribute("data-volume"),n=t?parseFloat(t):1;return Number.isFinite(n)?n:1}function $o(e,t){let n=Array.from(e?.querySelectorAll?.(`${Zt}[${Mn}]`)??[]).find(i=>i.getAttribute(Mn)===t);if(n)return n;let r=e?.getElementById(t)??null;return r&&r.tagName?.toLowerCase()===Zt?r:null}function mi(e,t){let n=t?.getAttribute?.(lu)??t?.getAttribute?.(di);return n?$o(e,n)?.hasAttribute("data-hidden")??!1:!1}function Nu(e){return typeof e.tagName!="string"||e.tagName.toLowerCase()!=="audio"||typeof e.getAttribute!="function"?null:e.getAttribute(di)||null}function Lu(e){let t="__hf-audio-group-inert";if(!e?.head||e.getElementById(t))return;let n=e.createElement("style");n.id=t,n.textContent=`${Zt}{display:none!important}`,e.head.appendChild(n)}function Qe(e){return Fn(e)}function Du(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 Iu(e){let t=e?.elements??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=Qe(a),u=Le(a),d=a.loop,f=Number.isFinite(a.duration)&&a.duration>0?a.duration:null,m=e?.resolveDurationSeconds?.(a)??Number.parseFloat(a.dataset.duration??"");(!Number.isFinite(m)||m<0)&&f!=null&&(m=Math.max(0,(f-s)/u));let h=Number.isFinite(m)&&m>=0,b=h?l+m:Number.POSITIVE_INFINITY,v=Number.parseFloat(a.dataset.volume??""),x={el:a,start:l,mediaStart:s,duration:h?m:Number.POSITIVE_INFINITY,end:b,volume:Number.isFinite(v)?v:null,playbackRate:u,loop:d,sourceDuration:f};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 Ko=new WeakMap,fi=new WeakMap,Bn=new WeakMap,Yo=new WeakSet,en=new WeakSet;function l0(e){if(en.has(e))return;en.add(e);let t=()=>en.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}var u0=3;function c0(e){return e.error!=null||e.networkState===u0}var Xo=new WeakMap;function jo(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function Jo(e){Ko.delete(e),fi.delete(e),Bn.delete(e),Yo.delete(e),Xo.delete(e)}function Pu(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=fi.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(fi.set(r,i),n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let G=n.sourceDuration-n.mediaStart;G>0&&i>=n.sourceDuration&&(i=n.mediaStart+(i-n.mediaStart)%G)}let m=jo(e.userVolume??1),h=Ue(n.volume??1),b=Xo.get(r),v=jo(r.volume),x,_=Fu(r,e.timeSeconds-n.start);if(_!==null)x=Ue(_);else if(n.volumeKeyframes&&n.volumeKeyframes.length>0){let G=e.timeSeconds-n.start;x=Ue(yu(n.volumeKeyframes,G))}else e.isWebAudioRouted?.(r)?x=h:b===void 0?x=h>1?h:v:Math.abs(v-b)>1e-4?x=v:x=h;let C=r.closest("[data-hidden]")!==null||mi(r.ownerDocument,r)?0:jo(x*m);r.volume=C,Xo.set(r,C),e.onElementVolume?.(r,C,x),(t||e.isWebAudioOwned?.(r))&&(r.muted=!0),r.preload!=="auto"&&(r.preload="auto");try{r.playbackRate=n.playbackRate*e.playbackRate}catch(G){L("runtime.media.site1",G)}let F=.04,D=2,M=r.currentTime||0,S=Math.abs(M-i),A=i-M,w=Ko.get(r);Ko.set(r,A);let R=w===void 0,I=!R&&Math.abs(A-w)>.5,H=S>3,j=r.tagName==="AUDIO"&&R&&M-i>F,X=a&&S>.001||r.ended&&u&&S>.001||j||S>.5&&(R||I||H),k=r.tagName==="VIDEO"&&!r.paused,U=w!==void 0&&Math.abs(A-w)<.004,te=!1;if(!k&&!X&&!R&&U&&S>F){let G=(Bn.get(r)??0)+1;Bn.set(r,G),G>=D&&(te=!0,Bn.set(r,0))}else S<=F&&Bn.set(r,0);let B=!k&&e.forceSync&&S>.02;if(X||te||B){if(!(r.tagName==="VIDEO"&&!!bt(r))){try{r.currentTime=i}catch(W){L("runtime.media.site2",W)}if(Math.abs(r.currentTime-i)>.5&&!Yo.has(r)){Yo.add(r),r.load();try{r.currentTime=i}catch(W){L("runtime.media.site3",W)}}}en.delete(r)}a?r.paused||r.pause():e.playing&&r.paused&&!en.has(r)&&!c0(r)?(l0(r),r.play().catch(G=>{en.delete(r),(G&&typeof G=="object"&&"name"in G?String(G.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!e.playing&&!r.paused&&r.pause();continue}let f=e.timeSeconds>=n.start&&e.timeSeconds<n.end;Jo(r),f&&fi.set(r,i),r.paused||r.pause()}}var d0="hf-proxy",Ou="runtime_media_proxy_fallback",Gu="runtime_media_proxy_unavailable",Un=new WeakSet,Hu=new WeakSet;function pi(e){return e.currentSrc||e.src}function Qo(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:fe(e)&&!!bt(e)}function Zo(e){let t=pi(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 m0(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 f0(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 ea(e,t){return t[e]??m0(e,t)??f0(e,t)}function p0(e,t){let n=new URL(e,document.baseURI);return n.searchParams.set(d0,t?t.hasAlpha?"vp8":"h264":"auto"),n.href}var h0={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 Pt(e,t,n){if(Hu.has(e))return;Hu.add(e);let r=h0[t];ve({source:"hf-preview",type:"diagnostic",code:Gu,details:{asset:n,codecName:null,reason:t,note:r}}),console.info(`[hyperframes] ${Gu}: "${n}" (${t}): ${r}`)}function ta(e,t=null,n="reactive"){if(Un.has(e))return;let r=pi(e),i;try{i=p0(r,t)}catch(l){L("runtime.mediaProxy.swap",l),Pt(e,"invalid_source_url",r);return}Un.add(e),Jo(e),e.src=i,e.load();let o=t?.codecName??null;ve({source:"hf-preview",type:"diagnostic",code:Ou,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] ${Ou}: "${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 Bu(e){if(Qo(e)||!fe(e)||Un.has(e))return;let t=window.__HF_MEDIA_CODEC_MAP__;if(!t)return;let n=Zo(e);if(n===null)return;let r=ea(n,t);if(!r||!r.browserHostile)return;let i=r.representativeMime?e.canPlayType(r.representativeMime):"";i==="probably"||i==="maybe"||ta(e,r,"proactive")}function Uu(e){if(Qo(e)||!fe(e)||e.videoWidth!==0)return;let t=pi(e);if(Un.has(e)){Pt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=Zo(e);if(r===null){Pt(e,"cross_origin",t);return}let i=ea(r,n);if(i&&!i.browserHostile){Pt(e,"browser_safe_codec",t);return}ta(e,i,"reactive")}function Wu(e){if(Qo(e)||!fe(e))return;let t=pi(e);if(Un.has(e)){Pt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=Zo(e);if(r===null){Pt(e,"cross_origin",t);return}let i=ea(r,n);if(i&&!i.browserHostile){Pt(e,"browser_safe_codec",t);return}ta(e,i,"tertiary")}var Te=class extends Error{constructor(n,r=null){super(r==null?n:`${n} at line ${r}`);ye(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=r}},g0=[0,0,0],b0=[1,1,1],hi=64;function x0(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 vt(e,t){let n=Number(e);if(!Number.isFinite(n))throw new Te(`Invalid number "${e}"`,t);return n}function Vu(e,t,n){if(e.length!==3)throw new Te(`${t} expects three numbers`,n);return[vt(e[0],n),vt(e[1],n),vt(e[2],n)]}function zu(e,t,n){if(!e)throw new Te(`${t} expects a size`,n);let r=Number(e);if(!Number.isInteger(r)||r<2)throw new Te(`${t} must be an integer greater than 1`,n);return r}function y0(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new Te("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function v0(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 S0(e){return/^[+-]?(?:\d|\.\d)/.test(e)}function qu(e,t={}){let n=t.maxSize??hi,r=null,i=g0,o=b0,a=null,l=null,s=[],u=e.replace(/^\uFEFF/,"").split(/\r?\n/);for(let f=0;f<u.length;f++){let m=f+1,h=x0(u[f]??"").trim();if(!h)continue;let b=h.split(/\s+/),v=(b[0]??"").toUpperCase(),x=b.slice(1);if(v==="TITLE"){r=v0(h);continue}if(v==="DOMAIN_MIN"){i=Vu(x,v,m);continue}if(v==="DOMAIN_MAX"){o=Vu(x,v,m);continue}if(v==="LUT_3D_INPUT_RANGE"){if(x.length!==2)throw new Te(`${v} expects two numbers`,m);let _=vt(x[0],m),T=vt(x[1],m);if(T<=_)throw new Te("LUT_3D_INPUT_RANGE max must exceed min",m);i=[_,_,_],o=[T,T,T];continue}if(v==="LUT_1D_SIZE"){a=zu(x[0],v,m);continue}if(v==="LUT_3D_SIZE"){if(l=zu(x[0],v,m),l>n)throw new Te(`LUT_3D_SIZE ${l} exceeds max ${n}`,m);continue}if(!S0(v)){if(v.startsWith("LUT_"))throw new Te(`Unsupported cube keyword ${v}`,m);continue}if(!l)throw a?new Te("1D cube LUTs are not supported yet",m):new Te("LUT data appears before LUT_3D_SIZE",m);if(b.length!==3)throw new Te("LUT data rows must contain three numbers",m);s.push(vt(b[0],m),vt(b[1],m),vt(b[2],m))}if(a&&l)throw new Te("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw a?new Te("1D cube LUTs are not supported yet"):new Te("Missing LUT_3D_SIZE");y0(i,o);let d=l*l*l;if(s.length!==d*3)throw new Te(`Expected ${d} LUT rows for size ${l}, found ${s.length/3}`);return{title:r,size:l,domainMin:i,domainMax:o,data:new Float32Array(s)}}function A0(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function Wn(e){return Math.round(A0(e)*255)}function na(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]=Wn(e.data[s]??0),i[u+1]=Wn(e.data[s+1]??0),i[u+2]=Wn(e.data[s+2]??0),i[u+3]=255}return{width:n,height:r,data:i}}var $u="rec709";var he={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 ju=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"],Ku=["shadows","midtones","highlights"],Yu=["master","red","green","blue"],Xu=["hueVsHue","hueVsSaturation","hueVsLuma"];var Ju=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],Qu=["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 jA=he.unit,KA=he.signedUnit,YA=he.effects;var Ze=1024,Vn=16;function Zu(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 ke(e,t){let n=e[t];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function E0(e){let t=[],n=[],r=ke(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=ke(n,0);if(e.length===2)return[i,i];let o=new Array(e.length);o[0]=Zu(ke(t,0),ke(t,1),i,ke(n,1)),o[o.length-1]=Zu(ke(t,t.length-1),ke(t,t.length-2),ke(n,n.length-1),ke(n,n.length-2));for(let a=1;a<e.length-1;a+=1){let l=ke(n,a-1),s=ke(n,a);if(l===0||s===0||Math.sign(l)!==Math.sign(s)){o[a]=0;continue}let u=ke(t,a-1),d=ke(t,a),f=2*d+u,m=d+2*u;o[a]=(f+m)/(f/l+m/s)}return o}function ec(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 w0(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 _0(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 tc(e,t,n,r,i){w0(e,r,i);let o=E0(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>ke(e,l+1)[0];)l+=1;let d=ke(e,l),f=ke(e,l+1),m=_0(u,d,f,ke(o,l),ke(o,l+1));a[s]=Math.min(i,Math.max(r,m))}return a}function tn(e,t=Ze){if(ec(e,t),e.length>Vn)throw new RangeError(`A color curve supports at most ${Vn} 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 tc(e,t,n=>n/(t-1),0,1)}function ia(e,t,n,r=Ze){if(e.length<3)throw new RangeError("A hue curve requires at least three points");if(e.length>Vn)throw new RangeError(`A hue curve supports at most ${Vn} 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 ec(l,r),tc(l,r,s=>s/r*360,t,n)}var zn="data-color-grading",qn="data-hf-color-grading-source-hidden",xi="data-hf-authored-opacity",ac="__hf_color_grading_",R0=$u,sa={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},la={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},ua={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 yi=ju,sc=Ku,lc=Yu,uc=Xu,da=Ju,ma=Qu,nc={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},rc={vignette:.18};function Me(e,t,n={},r={},i={},o=1){return{id:e,label:t,intensity:o,adjust:{...sa,...n},details:{...la,...r},effects:{...ua,...i}}}var fa=[Me("neutral","Neutral"),Me("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),Me("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),Me("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),Me("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),Me("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),Me("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),Me("vintage-wash","Vintage Wash",nc,rc),Me("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),Me("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),Me("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),Me("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),Me("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),Me("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),Me("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}),Me("home-movie-8mm","8mm Home Movie",nc,{...rc,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),Me("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),Me("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],T0=new Map(fa.map(e=>[e.id,e])),k0=/^\$(?:\{([A-Za-z0-9_.:-]+)\}|([A-Za-z0-9_.:-]+))$/,M0={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}},nn={hue:0,amount:0,level:0},ic={amount:he.unit,level:he.signedUnit},St=[[0,0],[1,1]],rn=[],F0={hueVsHue:he.secondaryHueShift,hueVsSaturation:he.signedUnit,hueVsLuma:he.signedUnit},oa={center:0,range:180,softness:0},aa={min:0,max:1,softness:.05},N0={vignette:he.unit,vignetteMidpoint:he.unit,vignetteRoundness:he.signedUnit,vignetteFeather:he.unit,grain:he.unit,grainSize:he.unit,grainRoughness:he.unit},ca=he.unit,L0=he.effects,cc=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"];var D0=fa.filter(e=>cc.some(t=>e.effects[t]>1e-4)),rE=fa.filter(e=>!D0.includes(e)),iE={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}},dc=[{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 I0=/^#[0-9a-f]{6}$/i;function P0(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&I0.test(t))?null:e.map(t=>t.toLowerCase())}function De(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function bi(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function mc(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function Ie(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?bi(n,t.min,t.max):0}function pa(e,t=0){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?(n%360+360)%360:t}function O0(e){let t=De(e)?e:{};return sc.reduce((n,r)=>{let i=De(t[r])?t[r]:{};return n[r]={hue:pa(i.hue,nn.hue),amount:Ie(i.amount??nn.amount,ic.amount),level:Ie(i.level??nn.level,ic.level)},n},{shadows:{...nn},midtones:{...nn},highlights:{...nn}})}function G0(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)?[bi(t,0,1),bi(n,0,1)]:null}function fc(e){return e.some((t,n)=>n>0&&t[0]===e[n-1]?.[0])}function H0(e){(e[0]?.[0]??0)>0&&e.unshift([0,0]),(e.at(-1)?.[0]??1)<1&&e.push([1,1])}function B0(e){if(!Array.isArray(e)||e.length<2)return St;let t=[];for(let n of e){let r=G0(n);if(!r)return St;t.push(r)}return t.sort((n,r)=>n[0]-r[0]),fc(t)||(H0(t),t.length>16)?St:t}function U0(e){let t=De(e)?e:{};return lc.reduce((n,r)=>(n[r]=B0(t[r]),n),{master:St,red:St,green:St,blue:St})}function W0(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)?[pa(n),bi(r,t.min,t.max)]:null}function V0(e,t){if(!Array.isArray(e)||e.length<3||e.length>16)return rn;let n=[];for(let r of e){let i=W0(r,t);if(!i)return rn;n.push(i)}return n.sort((r,i)=>r[0]-i[0]),fc(n)?rn:n}function z0(e){let t=De(e)?e:{};return uc.reduce((n,r)=>(n[r]=V0(t[r],F0[r]),n),{hueVsHue:rn,hueVsSaturation:rn,hueVsLuma:rn})}function oc(e){let t=De(e)?e:{},n=Ie(t.min??aa.min,ca),r=Ie(t.max??aa.max,ca);return{min:Math.min(n,r),max:Math.max(n,r),softness:Ie(t.softness??aa.softness,he.secondarySoftRangeSoftness)}}function q0(e){let t=De(e)?e:{},n=Ie(t.range??oa.range,he.secondaryHueRange);return{center:pa(t.center,oa.center),range:n,softness:Ie(t.softness??oa.softness,{min:he.secondaryHueSoftness.min,max:he.secondaryHueCombinedMax-n})}}function $0(e){return{hueShift:Ie(e.hueShift??0,he.secondaryHueShift),saturation:Ie(e.saturation??0,he.signedUnit),luma:Ie(e.luma??0,he.signedUnit),temperature:Ie(e.temperature??0,he.signedUnit),tint:Ie(e.tint??0,he.signedUnit)}}function j0(e){return!De(e)||!De(e.key)||!De(e.correction)?null:{enabled:e.enabled!==!1,key:{hue:q0(e.key.hue),saturation:oc(e.key.saturation),luma:oc(e.key.luma)},correction:$0(e.correction)}}function K0(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,4)){let r=j0(n);r&&t.push(r)}return t}function Y0(e){if(e==null)return null;let t=String(e).trim();return t||null}function X0(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!De(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:mc(e.intensity,1)}}function J0(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return De(n)?n:null}catch{return null}return{preset:t}}return De(e)?e:null}function Q0(e,t){let n=e.trim().match(k0);if(!n)return e;let r=n[1]??n[2]??"";return r&&Object.hasOwn(t,r)?t[r]:e}function gi(e,t){if(typeof e=="string"){let r=Q0(e,t);if(r!==e)return r;let i=e.trim();if(!i.startsWith("{"))return e;try{return gi(JSON.parse(i),t)}catch{return e}}if(Array.isArray(e))return e.map(r=>gi(r,t));if(!De(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=gi(i,t);return n}function Z0(e){return e?T0.get(e)??null:null}function vi(e){let t=J0(e);if(!t||t.enabled===!1)return null;let n=Y0(t.preset),r=Z0(n),i=r?.adjust??sa,o=r?.details??la,a=r?.effects??ua,l=De(t.adjust)?t.adjust:{},s=De(t.details)?t.details:{},u=De(t.effects)?t.effects:{},d=yi.reduce((h,b)=>(h[b]=Ie(l[b]??i[b],M0[b]),h),{...sa}),f=da.reduce((h,b)=>(h[b]=Ie(s[b]??o[b],N0[b]),h),{...la}),m=ma.reduce((h,b)=>(h[b]=Ie(u[b]??a[b],L0[b]??ca),h),{...ua});return{enabled:!0,preset:n,intensity:mc(t.intensity,r?.intensity??1),adjust:d,wheels:O0(t.wheels),curves:U0(t.curves),hueCurves:z0(t.hueCurves),secondaries:K0(t.secondaries),details:f,effects:m,palette:P0(t.palette),lut:X0(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():R0}}function pc(e,t){return vi(gi(e,t))}function eg(e){return sc.some(t=>Math.abs(e[t].amount)>1e-4||Math.abs(e[t].level)>1e-4)}function ha(e){return lc.some(t=>e[t].some(([n,r])=>Math.abs(n-r)>1e-4))}function ga(e){return uc.some(t=>e[t].some(([,n])=>Math.abs(n)>1e-4))}function ba(e){return e.some(t=>t.enabled&&Object.values(t.correction).some(n=>Math.abs(n)>1e-4))}function hc(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||cc.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:yi.some(n=>Math.abs(e.adjust[n])>1e-4)||(e.wheels?eg(e.wheels):!1)||(e.curves?ha(e.curves):!1)||(e.hueCurves?ga(e.hueCurves):!1)||(e.secondaries?ba(e.secondaries):!1):!1}var tg=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),ng=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function gc(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(w){L("runtime.picker.site1",w)}}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 w=S;for(;w&&w!==document.body&&w!==document.documentElement;){let R=A.getComputedStyle(w);if(R.display==="none"||R.visibility==="hidden"||R.pointerEvents==="none")return!0;let I=Number.parseFloat(R.opacity);if(Number.isFinite(I)&&I<=.01&&!w.hasAttribute(qn))return!0;w=w.parentElement}return!1}function d(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(tg)||u(S))}function f(S){return!!S?.closest(ng)}function m(S){let A=S;if(A.id)return`#${CSS.escape(A.id)}`;let w=S.getAttribute("data-composition-id");if(w)return`[data-composition-id="${CSS.escape(w)}"]`;let R=S.getAttribute("data-composition-src");if(R)return`[data-composition-src="${CSS.escape(R)}"]`;let I=S.getAttribute("data-track-index");if(I)return`[data-track-index="${CSS.escape(I)}"]`;let H=S.tagName.toLowerCase(),j=S.parentElement;if(!j)return H;let X=j.querySelectorAll(`:scope > ${H}`);if(X.length===1)return H;for(let k=0;k<X.length;k+=1)if(X[k]===S)return`${H}:nth-of-type(${k+1})`;return H}function h(S){let A=S.tagName.toLowerCase(),w=(S.textContent??"").trim().replace(/\s+/g," "),R=(I,H)=>I.length>H?`${I.slice(0,H-1)}\u2026`:I;return A==="h1"||A==="h2"||A==="h3"?"Heading":A==="p"||A==="span"||A==="div"?w.length>0?R(w,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,w){let R=typeof w=="number"&&w>0?w:8,I=[];if(document.elementsFromPoint)I=document.elementsFromPoint(S,A);else if(document.elementFromPoint){let X=document.elementFromPoint(S,A);I=X?[X]:[]}if(f(I[0]??null))return[];let H={},j=[];for(let[X,k]of I.entries()){if(!d(k))continue;let U=`${k.tagName}::${k.id||""}::${X}`;if(!H[U]&&(H[U]=!0,j.push(k),j.length>=R))break}return j}function v(S){let A=S.getBoundingClientRect(),w={};for(let I of Array.from(S.attributes))I.name.startsWith("data-")&&(w[I.name]=I.value);return{id:S.id||null,tagName:S.tagName.toLowerCase(),selector:m(S),label:h(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:w}}function x(S,A,w){return b(S,A,w).map(v)}function _(S){if(!t)return;let w=b(S.clientX,S.clientY,1)[0]??(Ne(S.target)?S.target:null);if(!d(w)||n===w)return;n&&n.classList.remove("__hf-pick-highlight"),n=w,w.classList.add("__hf-pick-highlight");let R=v(w);l(R),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:R})}function T(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 C(S){S.key==="Escape"&&(D(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function F(){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",T,!0),document.addEventListener("keydown",C,!0),a("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function D(){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",T,!0),document.removeEventListener("keydown",C,!0),a("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function M(){window.__HF_PICKER_API={enable:F,disable:D,isActive:()=>t,getHovered:()=>i,getSelected:()=>o,getCandidatesAtPoint:(S,A,w)=>Number.isFinite(S)&&Number.isFinite(A)?x(S,A,w):[],pickAtPoint:(S,A,w)=>{if(!Number.isFinite(S)||!Number.isFinite(A))return null;let R=x(S,A,8);if(!R.length)return null;let I=Math.max(0,Math.min(R.length-1,Number(w??0))),H=R[I]??null;return H?(s(H),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:H}),D(),H):null},pickManyAtPoint:(S,A,w)=>{if(!Number.isFinite(S)||!Number.isFinite(A))return[];let R=x(S,A,8);if(!R.length)return[];let I=[],H=Array.isArray(w)?w:[0];for(let j of H){let X=Math.max(0,Math.min(R.length-1,Math.floor(Number(j)))),k=R[X];if(!k)continue;I.some(te=>te.selector===k.selector&&te.tagName===k.tagName)||I.push(k)}return I.length?(s(I[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:I}),D(),I):[]}},a("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:F,disablePickMode:D,installPickerApi:M}}var rg=["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 xa(e){return Number.isFinite(e)&&e>0?e:30}function ya(e){return Number.isFinite(e)&&e>0?e:0}function va(e,t){let n=xa(t);return Math.floor(ya(e)*n+1e-9)/n}function $n(e,t,n){let r=Number.isInteger(n)?n:1;if(r<=1)return va(e,t);let i=xa(t)*r;return Math.round(ya(e)*i)/i}function Sa(e,t){let n=xa(t),r=ya(e),i=r*n,o=Math.round(i);return Math.abs(i-o)<=.001?o/n:r}function bc(e,t,n=rg){for(let r of n){let i=t.getPropertyValue(r);i&&e.setProperty(r,i)}}function jn(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 $e(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 Kn(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 xc(e,t,n,r){let i=$n(t,n,r?.subFrameDivisions),o=r?.suppressEvents===!0;return $e(e,"pause"),typeof e.totalTime=="function"?e.totalTime(i,o):typeof e.seek=="function"&&e.seek(i,o),i}function ig(e,t,n,r,i){let o=[];Kn(e,t,a=>{$e(a,"play"),o.push(a)});try{return xc(t,n,r,i)}finally{for(let a of o)try{$e(a,"pause")}catch(l){L("runtime.player.site2",l)}}}function og(e,t){Kn(e,t,n=>{$e(n,"play")})}function yc(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?.()??jn(n,"duration",0))||0);r>0&&Math.max(0,jn(n,"time",0))>=r&&($e(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()),$e(n,"play"),Kn(e.getTimelineRegistry?.(),n,i=>{typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),$e(i,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;$e(n,"pause"),Kn(e.getTimelineRegistry?.(),n,i=>{$e(i,"pause")});let r=Math.max(0,jn(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=ig(e.getTimelineRegistry?.(),i,o,e.getCanonicalFps());e.onDeterministicSeek(l),r?.keepPlaying&&a?(typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),$e(i,"play"),Kn(e.getTimelineRegistry?.(),i,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),$e(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?(og(e.getTimelineRegistry?.(),i),xc(i,n,o,r)):$n(Math.max(0,Number(n)||0),o,r?.subFrameDivisions);e.onDeterministicSeek(a,r),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>jn(e.getTimeline(),"time",0),getDuration:()=>jn(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function vc(){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 ag=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function Aa(e){return e.id||e.getAttribute("data-hf-id")||null}function sg(e){return Ce(e)}function lg(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 ug(e){return!ge(e)||!Number.isFinite(e.duration)?null:xt(e,e.duration)}function cg(e,t,n,r){let i=sg(e.getAttribute("data-duration"));return i!=null&&i>0?i:lg(e,t)??ug(e)??Math.max(0,n-r)}function dg(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 Sc(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||ag.has(l.tagName))continue;let s=t.resolveStartForElement(l,0);if(cg(l,n,r,s)<=0)continue;let u={id:Aa(l)??`__clip-${a++}`,element:l,parentId:null,children:[]};i.set(l,u)}return dg(i),{roots:Array.from(i.values()).filter(l=>l.parentId===null)}}var Ea="css:root",Ac=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],mg=new Set([...Ac,"contain","isolation","mask-border","mix-blend-mode","opacity"]),fg=new Set(["absolute","relative"]),pg=new Set(["flex","inline-flex","grid","inline-grid"]),hg=new Set(["layout","paint","strict","content"]),gg=new Set(["size","inline-size"]);function bg(e){return e.position==="fixed"||e.position==="sticky"}function xg(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(fg.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&pg.has(n)}function yg(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:Ac.some(r=>{let i=e.getPropertyValue(r);return i!==""&&i!=="none"})}function vg(e){return e.getPropertyValue("contain").split(/\s+/).some(n=>hg.has(n))?!0:gg.has(e.getPropertyValue("container-type"))}function Sg(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>mg.has(t))}function Ag(e,t){return bg(t)||xg(e,t)||yg(t)||vg(t)?!0:Sg(t)}function Eg(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 Si(e){let t=e.ownerDocument.defaultView;if(!t)return Ea;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(Ag(n,t.getComputedStyle(n)))return Eg(n)}catch{return Ea}n=n.parentElement}return Ea}function wa(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}function Ot(e){return Ce(e)}function _a(e){let t=e.getAttribute("data-duration"),n=e.getAttribute("data-hf-authored-duration"),r=Jt({start:0,duration:t,authoredDuration:n})?.duration;return r??([t,n].map(Ot).some(o=>o!=null&&o<=0)?0:null)}function Ec(e){return Jt({start:0,end:e.getAttribute("data-end"),authoredEnd:e.getAttribute("data-hf-authored-end")})?.end??null}function Ca(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 Ra(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function Ta(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 Xn(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 wc(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return Xn(t);let n=e.getAttribute("data-composition-src");if(n)return Xn(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?Xn(r.getAttribute("src")):null}function _g(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 Cg(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 Rg(e){let t=e.textContent?.replace(/\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function Yn(e){let t=e.replace(/\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return t?t.replace(/\b\w/g,n=>n.toUpperCase()):e}function Tg(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 Yn(i);let o=e.id;if(o)return Yn(o);let a=_g(e);if(a)return Yn(a);let l=Cg(wc(e));if(l)return Yn(l);let s=Rg(e);return s||`${Yn(t)} ${n+1}`}function _c(e){let n=window.__timelines??{},r=st({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),i=q=>{if(!q)return null;let O=n[q]??null;if(!O||typeof O.duration!="function")return null;try{let V=Number(O.duration());return Number.isFinite(V)&&V>0?V:null}catch{return null}},o=()=>{let q=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(q.length===0)return null;let O=0;for(let V of q){let Z=r.resolveMediaStartForElement(V);if(!Number.isFinite(Z))continue;let pe=ri(V);pe==null||pe<=0||(O=Math.max(O,Math.max(0,Z)+pe))}return O>0?O:null},a=(q,O)=>{let V=[],Z=null,pe=null,re=null,z=q.parentElement;for(;z;){let J=z.getAttribute("data-composition-id");J&&(V.push(J),!re&&z!==O&&(re=J),Z==null&&(Z=r.resolveStartForElement(z,0)),pe==null&&(pe=Ot(z.getAttribute("data-duration"))??i(J)??null)),z=z.parentElement}return{parentCompositionId:re,compositionAncestors:V.reverse(),inheritedStart:Z,inheritedDuration:pe}},l=document.querySelector("[data-composition-id]"),s=Array.from(document.querySelectorAll("[data-composition-id]")),u=l?.getAttribute("data-composition-id")??null,d=l?r.resolveStartForElement(l,0):0,f=o(),m=f!=null?Math.max(0,f-Math.max(0,d)):null,h=i(u),b=_a(l??document.body),v=Ra(...s.filter(q=>q!==l).map(q=>{let O=r.resolveStartForElement(q,0),V=r.resolveDurationForElement(q)??i(q.getAttribute("data-composition-id"))??null;return!Number.isFinite(O)||V==null||V<=0?null:Math.max(0,O)+V})),x=v!=null?Math.max(0,v-Math.max(0,d)):null,_=typeof h=="number"&&Number.isFinite(h)&&h>0?h:null,T=typeof b=="number"&&Number.isFinite(b)&&b>0?b:null,C=typeof m=="number"&&Number.isFinite(m)&&m>0?m:null,F=typeof x=="number"&&Number.isFinite(x)&&x>0?x:null,D=Ra(C,F),M=_!=null&&D!=null&&_>D+1,A=T??(M?D:Ra(_,C,F))??null,R=(A!=null?d+A:null)??(typeof f=="number"&&Number.isFinite(f)&&f>0?f:null),I=(q,O)=>!Number.isFinite(O)||O<=0?0:R==null||!Number.isFinite(R)?O:!Number.isFinite(q)||q>=R?0:Math.max(0,Math.min(O,R-q)),H=[],j=[],X=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),k=0;for(let[q,O]of X.entries()){if(O===l||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(O.tagName))continue;let V=a(O,l),Z=O.tagName.toLowerCase(),pe=Z==="video"||Z==="audio"?r.resolveMediaStartForElement(O):r.resolveStartForElement(O,V.inheritedStart??0),re=O.getAttribute("data-composition-id"),z=_a(O);if(z==null&&re&&re!==u&&(z=i(re)),z==null&&ge(O)&&Number.isFinite(O.duration)&&(z=xt(O,O.duration)),z==null){let ce=V.inheritedDuration;if(ce!=null&&ce>0){let it=(V.inheritedStart??0)+ce;z=Math.max(0,it-pe)}}if(z==null||z<=0||(z=I(pe,z),z<=0))continue;let J=pe+z;k=Math.max(k,J);let Ae=re&&re!==u?"composition":Z==="video"?"video":Z==="audio"?"audio":Z==="img"?"image":"element";H.push({id:Aa(O)??re??null,label:Tg(O,Ae,H.length),start:pe,duration:z,track:Ta(O,q),zIndex:Ca(O),stackingContextId:Si(O),kind:Ae,tagName:Z,compositionId:O.getAttribute("data-composition-id"),compositionAncestors:V.compositionAncestors,parentCompositionId:V.parentCompositionId,nodePath:null,compositionSrc:Xn(O.getAttribute("data-composition-src")),playbackStart:Qe(O),playbackRate:Le(O),assetUrl:wc(O),timelineRole:O.getAttribute("data-timeline-role"),timelineLabel:O.getAttribute("data-timeline-label"),timelineGroup:O.getAttribute("data-timeline-group"),timelinePriority:Ot(O.getAttribute("data-timeline-priority"))})}let U=new Set(H.map(q=>q.id)),te=l?.getAttribute("data-composition-id")??null,B=te?n[te]??null:null;if(B&&l){let q=B;if(typeof q.getChildren=="function")try{let O=q.getChildren(!0,!0,!1)??[],V=new Map;for(let re of l.children){let z=re;if(!z.id)continue;let J=z.tagName.toLowerCase();J==="script"||J==="style"||J==="link"||V.set(z,{id:z.id,start:1/0,end:-1/0})}let Z=re=>{let z=re;for(;z;){if(V.has(z))return z;if(z===l)return null;z=z.parentElement}return null};for(let re of O){if(typeof re.targets!="function"||typeof re.startTime!="function"||typeof re.duration!="function")continue;let z=re.startTime(),J=re.parent;for(;J&&J!==B&&typeof J.startTime=="function";)z+=J.startTime(),J=J.parent;let Ae=z+re.duration();if(!(!Number.isFinite(z)||!Number.isFinite(Ae)))for(let ce of re.targets()){if(!Ne(ce))continue;let vn=Z(ce);if(!vn)continue;let it=V.get(vn);it&&(it.start=Math.min(it.start,z),it.end=Math.max(it.end,Ae))}}let pe=H.length>0?Math.max(...H.map(re=>re.track))+1:0;for(let[re,z]of V){if(z.start===1/0||z.end===-1/0)continue;let J=re;if(U.has(J.id))continue;let Ae=Math.max(0,z.end-z.start);if(Ae<=0)continue;let ce=I(z.start,Ae);ce<=0||(k=Math.max(k,z.start+ce),H.push({id:J.id,label:J.getAttribute("data-timeline-label")??J.getAttribute("data-label")??J.getAttribute("aria-label")??J.id,start:z.start,duration:ce,track:Ta(J,pe),zIndex:Ca(J),stackingContextId:Si(J),kind:"element",tagName:J.tagName.toLowerCase(),compositionId:J.getAttribute("data-composition-id"),compositionAncestors:te?[te]:[],parentCompositionId:te,nodePath:null,compositionSrc:null,playbackStart:Qe(J),playbackRate:Le(J),assetUrl:null,timelineRole:J.getAttribute("data-timeline-role"),timelineLabel:J.getAttribute("data-timeline-label"),timelineGroup:J.getAttribute("data-timeline-group"),timelinePriority:Ot(J.getAttribute("data-timeline-priority"))}),U.add(J.id))}}catch(O){L("runtime.timeline.site1",O)}}if(l&&A!=null&&A>0){let q=H.length>0?Math.max(...H.map(O=>O.track))+1:0;for(let O of l.children){let V=O;if(!V.id||U.has(V.id))continue;let Z=V.getAttribute("data-timeline-role");if(Z!=="overlay"&&Z!=="persistent-overlay")continue;let pe=V.tagName.toLowerCase();if(pe==="script"||pe==="style"||pe==="link"||pe==="meta"||window.getComputedStyle(V).display==="none")continue;let z=I(0,A);z<=0||(k=Math.max(k,z),H.push({id:V.id,label:V.getAttribute("data-timeline-label")??V.getAttribute("data-label")??V.getAttribute("aria-label")??V.id,start:0,duration:z,track:Ta(V,q),zIndex:Ca(V),stackingContextId:Si(V),kind:"element",tagName:pe,compositionId:V.getAttribute("data-composition-id"),compositionAncestors:te?[te]:[],parentCompositionId:te,nodePath:null,compositionSrc:null,playbackStart:Qe(V),playbackRate:Le(V),assetUrl:null,timelineRole:Z,timelineLabel:V.getAttribute("data-timeline-label"),timelineGroup:V.getAttribute("data-timeline-group"),timelinePriority:Ot(V.getAttribute("data-timeline-priority"))}),U.add(V.id))}}for(let q of s){if(q===l)continue;let O=q.getAttribute("data-composition-id");if(!O||!wa(O))continue;let V=r.resolveStartForElement(q,0),Z=_a(q);if((Z==null||Z<=0)&&Ec(q)!=null){let J=Ec(q);Z=Math.max(0,J-V)}let pe=i(O),re=Z&&Z>0?Z:pe;if(re==null||re<=0)continue;let z=I(V,re);z<=0||j.push({id:O,label:q.getAttribute("data-label")??O,start:V,duration:z,thumbnailUrl:Xn(q.getAttribute("data-thumbnail-url")),avatarName:null})}let G=Math.max(1,k||1,A??0),W=M&&T==null,Q=W?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(G*Math.max(1,e.canonicalFps)));return{...Yr(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:W?Number.POSITIVE_INFINITY:G,durationInFrames:Q,clips:H,scenes:j,compositionWidth:Ot(l?.getAttribute("data-width"))??1920,compositionHeight:Ot(l?.getAttribute("data-height"))??1080}}var ka="data-composition-id",kg="data-composition-src",Mg=`[${ka}]`,UE=`[${kg}]`,Cc="style",Rc="script",Fg='link[rel="stylesheet"], link[rel="preconnect"]';function on(e){return e?Array.from(e):[]}function Tc(e){let{contentNode:t,head:n,documentElement:r,hasTemplate:i,compositionId:o}=e,a=on(t.querySelectorAll(Mg)),l=o?a.find(d=>d.getAttribute(ka)===o)??null:a[0]??null,s=(l??a[0])?.getAttribute(ka)?.trim()||"",u=i?null:n??null;return{innerRoot:l,authoredCompositionId:o||s||null,scriptCompositionId:s||o||null,authoredRootId:l?.getAttribute("id")?.trim()||null,styleSources:[...on(u?.querySelectorAll(Cc)),...on(t.querySelectorAll(Cc))],scriptSources:[...on(u?.querySelectorAll(Rc)),...on(t.querySelectorAll(Rc))],linkSources:on(n?.querySelectorAll(Fg)),variableDefaultCarriers:[r,l].filter(d=>d!=null)}}var be=mh(Zd(),1),em=be.default,Mw=be.default.stringify,Fw=be.default.fromJSON,Nw=be.default.plugin,Lw=be.default.parse,Dw=be.default.list,Iw=be.default.document,Pw=be.default.comment,Ow=be.default.atRule,Gw=be.default.rule,Hw=be.default.decl,Bw=be.default.root,Uw=be.default.CssSyntaxError,Ww=be.default.Declaration,Vw=be.default.Container,zw=be.default.Processor,qw=be.default.Document,$w=be.default.Comment,jw=be.default.Warning,Kw=be.default.AtRule,Yw=be.default.Result,Xw=be.default.Input,Jw=be.default.Rule,Qw=be.default.Root,Zw=be.default.Node;var ts="data-hf-authored-id",tm="data-hf-inner-root";function ns(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rs(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Zb(e){return e&&e.replace(/[^a-zA-Z0-9_-]/g,n=>`\\${n}`).replace(/^-?\d/,n=>`\\${n}`)}function rm(e){let t=e.trim();return t?Array.from(new Set([t,Zb(t)])).filter(Boolean):[]}function ex(e){return!!e&&/[\w-]/.test(e)}function tx(e,t,n){let r=rm(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 d=r.find(f=>e.startsWith(f,l+1));if(d){let f=e[l+1+d.length];if(!ex(f)){i+=n,l+=d.length;continue}}}i+=s}return i}function nx(e,t){let n=t?.trim();return n?tx(e,n,`[${ts}="${rs(n)}"]`):e}function nm(e){return`${e}:not(:has([${tm}])), ${e} > [${tm}]`}function rx(e,t,n,r,i,o){let a=nx(e,r),l=ix(a,t,n),s=l.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return o?nm(t):e;let u=new RegExp(`\\[\\s*data-composition-id\\s*[\\^\\*\\$]?=\\s*(["'])${ns(n)}\\1\\s*\\]`,"g");if(u.test(s))return s.replace(u,"").trim()===""?nm(t):l.replace(u,t);let d=l.match(/^\s*/)?.[0]??"",f=l.match(/\s*$/)?.[0]??"";if(i){let m=r?`[${ts}="${rs(r)}"]`:null;if(m&&s.startsWith(m)){let h=s.slice(m.length);return`${d}${t}${m}${h}${f}`}}return`${d}${t} ${s}${f}`}function ix(e,t,n){let r=ns(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 ox=new Set(["keyframes","-webkit-keyframes","font-face"]);function ax(e){return e?.type==="atrule"}function sx(e){let t=e.parent;for(;t;){if(ax(t)&&ox.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function lx(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function im(e,t,n,r,i){let o=t.trim();if(!e||!o)return e;let a=n||`[data-composition-id="${rs(o)}"]`,l;try{l=em.parse(e)}catch{return""}return l.walkRules(s=>{sx(s)||lx(s)||(s.selectors=s.selectors.map(u=>rx(u,a,o,r,i?.compoundAuthoredRoot,i?.scopeRootSelectors)))}),l.toResult({map:!1}).css}function dt(e){return JSON.stringify(e).replace(/</g,"\\u003c")}function om(e,t,n="[HyperFrames] composition script error:",r,i=t,o){let a=dt(t),l=dt(i),s=dt(n),u=ns(t),d=dt(o?.trim()||null),f=dt(r??null),m=dt(String.raw`\[\s*data-composition-id\s*=\s*(?:"${u}"|'${u}')\s*\]`),h=dt(String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`),b=dt(rm(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 ko=null;function Pl(e){ko=e}function Be(e,t){if(ko)try{ko({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){L("runtime.analytics.site1",n)}}function Ah(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 Kt(e){return`--${Ah(e)}`}function Ol(e){let t=new Map;for(let n of e){let r=Kt(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 Hl(){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,Tn(i));let n=Jr(),r={...t,...n};for(let i of e)Fo(i,r);return r}var Gl=new Set;function Bl(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 Eh(e,t){return t?.trim()||e.getAttribute("data-composition-id")?.trim()||e.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()||"composition"}function wh(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 _h(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=wh(e);return r.length===0||r.some(i=>String(i)===String(n))?null:{id:e.id,value:n,allowed:r}}function Fo(e,t,n){if(!e)return;let r=Bl(e);if(r.length===0)return;let i=Eh(e,n);for(let o of r){let a=_h(o,t);if(!a)continue;let l=`${i}|${a.id}|${String(a.value)}`;if(Gl.has(l))continue;Gl.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 Tn(e){let t={};for(let n of Bl(e))typeof n.id!="string"||!("default"in n)||(t[n.id]=n.default);return t}var Mo="data-hf-css-vars";function Xr(e){return"style"in e&&typeof e.style?.setProperty=="function"}function No(e,t){if(!Xr(e))return;let n=[];for(let[r,i]of Object.entries(t))if(typeof i=="string"&&i!==""||typeof i=="number"){let o=Kt(r);e.style.setProperty(o,String(i)),n.push(o)}n.length>0&&e.setAttribute(Mo,n.join(" "))}function Ul(e,t,n){let r={};for(let[i,o]of Object.entries(t)){let a=Kt(i);((Xr(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(r[i]=o)}return r}function Wl(e){if(!Xr(e))return;let t=e.getAttribute(Mo);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(Mo)}}function Vl(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=Jr(),r=[];for(let i of t)r.push(...Ch(i,n,e.defaultView));for(let i of Ol(r))console.warn(`composition variables ${i.join(", ")} collapse to the same CSS property ${Kt(i[0]??"")} \u2014 rename one to avoid cross-talk`)}function Ch(e,t,n){if(!Xr(e))return[];let r=Tn(e),i={};for(let[o,a]of Object.entries(r)){if(o in t)continue;let l=Kt(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 No(e,i),Object.keys(r)}function zl(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 Jr(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}var ql="http://www.w3.org/1999/xhtml";function Ne(e){return e!=null&&e.nodeType===1}function Se(e){return Ne(e)&&e.namespaceURI===ql}function kn(e,t){return Se(e)&&e.localName===t}function fe(e){return kn(e,"video")}function Lo(e){return kn(e,"audio")}function be(e){return fe(e)||Lo(e)}function Oe(e){return kn(e,"img")}function $l(e){return kn(e,"style")}function jl(e){return kn(e,"link")}function Do(e){return Ne(e)&&(e.namespaceURI===ql||e.namespaceURI==="http://www.w3.org/2000/svg")}function Kl(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,d)=>{let f=null;try{f=u.effect?.getComputedTiming?.()??null}catch(h){L("runtime.adapters.css.site5",h)}if(!f)return{};let m=Number(f.endTime);return Number.isFinite(m)?{endSeconds:d+m/1e3}:{unbounded:!0}},o=(u,d)=>{for(let f of u){try{f.currentTime=d}catch(m){L("runtime.adapters.css.site1",m)}try{f.pause()}catch(m){L("runtime.adapters.css.site2",m)}}},a=u=>{for(let d of u)try{d.play()}catch(f){L("runtime.adapters.css.site3",f)}},l=u=>{for(let d of u)try{d.pause()}catch(f){L("runtime.adapters.css.site4",f)}},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 d of u){if(!Se(d))continue;let f=window.getComputedStyle(d);!f.animationName||f.animationName==="none"||t.push({el:d,baseDelay:d.style.animationDelay||"",basePlayState:d.style.animationPlayState||"",animations:n(d)})}},getInferredDurationSeconds:()=>{let u=0;for(let d of t){if(!d.el.isConnected)continue;let f=r(d.el);for(let m of n(d.el)){let h=i(m,f);h.endSeconds!=null&&(u=Math.max(u,h.endSeconds))}}return u>0?u:null},seek:u=>{let d=Number(u.time)||0;for(let f of t){if(!f.el.isConnected)continue;let m=r(f.el),h=Math.max(0,d-m)*1e3,b=f.animations;if(b.length>0){o(b,h);continue}f.el.style.animationPlayState="paused",f.el.style.animationDelay=`-${(h/1e3).toFixed(3)}s`}},pause:()=>{for(let u of t){if(!u.el.isConnected)continue;let d=u.animations;d.length>0&&l(d),s(u)}},play:()=>{for(let u of t)u.el.isConnected&&(s(u),a(u.animations))},revert:()=>{t=[]}}}function Yl(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 Xl(){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 Ql(){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(Io(r))r.goToAndStop(t*1e3,!1);else if(Po(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??0;if(Number.isFinite(i)&&i>0){let 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{(Io(t)||Po(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=Rh(r)}catch(o){L("runtime.adapters.lottie.site4",o)}i!=null&&(n=!0,t=Math.max(t,i))}return n?t:null}}}function Jl(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function Rh(e){return Io(e)?Jl(e.totalFrames,e.frameRate):Po(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:Jl(e.totalFrames,e.frameRate):null}function Io(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function Po(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}var Oo=-1,Qr=new Set,Yt,Go=0;function Zl(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}));Qr.add(i),i.then(o=>{Qr.delete(i)&&o.status==="rejected"&&Yt===void 0&&(Yt={reason:o.reason})})}function Zr(e){e!==Oo&&(Oo=e,Zl(e))}function ei(e){Oo=e,Zl(e)}function eu(){return Go>0}async function Ho(){Go+=1;let e=Yt;try{for(await Promise.resolve();Qr.size>0;){let r=(await Promise.all([...Qr])).find(i=>i.status==="rejected");e===void 0&&r?.status==="rejected"&&(e={reason:r.reason})}let t=Yt;if(e===void 0&&(e=t),Yt===t&&(Yt=void 0),e)throw e.reason}finally{Go-=1}}function tu(){let e=null,t=0,n=null,r=null,i=null,o=null,a=()=>{if(typeof window>"u")return null;let d=window.THREE?.DefaultLoadingManager;return!d||typeof d!="object"||typeof d.itemsLoaded!="number"||typeof d.itemsTotal!="number"?null:d},l=u=>{o||u.itemsTotal<=u.itemsLoaded||(o=new Promise(d=>{u.onLoad=function(){try{i?.call(this)}finally{o=null,u.onLoad=i??null,d()}}}))},s=u=>{n!==u&&(n=u,r=u.onStart??null,i=u.onLoad??null,u.onStart=function(d,f,m){try{r?.call(this,d,f,m)}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,Zr(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 Je(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 nu(){return Je({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 ru(){return Je({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 iu(){return Je({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 ou(){return Je({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 au(){return Je({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}var Th=250;function su(){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&&(eu()||(window.__hfTypegpuTime=e,ei(e)))},Th))};return{name:"typegpu",discover:()=>{},seek:o=>{e=Math.max(0,Number(o.time)||0),t=e,window.__hfTypegpuTime=e,Zr(e)},pause:()=>{e==null&&(e=Math.max(0,t)),i()},play:()=>{r(),e=null},revert:()=>{r(),e=null,t=0}}}var Mn="data-hf-render-id",lu="data-hf-group-render-id";function kh(e){return e.getAttribute(Mn)||e.id||null}var Mh="__render_frame_",Fh="__";function Nh(e){return`${Mh}${e}${Fh}`}function Lh(e){let t=kh(e);return t?Nh(t):null}function bt(e){let t=Lh(e);if(!t)return null;let n=document.getElementById(t);return Oe(n)?n:null}function uu(e){let t=e.nextElementSibling;if(Oe(t)&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;let n=bt(e);return n&&n.complete&&n.naturalWidth>0?n:null}function cu(){let e=globalThis.GPUQueue;if(!e?.prototype?.copyExternalImageToTexture)return;let t=e.prototype.copyExternalImageToTexture;e.prototype.copyExternalImageToTexture=function(n,r,i){if(fe(n?.source)){let o=uu(n.source);if(o)return t.call(this,{...n,source:o},r,i)}return t.call(this,n,r,i)}}function du(){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(fe(u)){let d=uu(u);d&&(l[s]=d)}return o.apply(this,l)};a.__hfVideoPatched=!0,r[i]=a}}}function mu(){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},d=(x,_)=>_<=0?x:x>=_?Math.max(0,x-_):x,f=(x,_)=>{let T=l.get(x);if(T)return T;let C={compositionTimeMs:_,animationTimeMs:e?d(u(x),_):u(x)};return l.set(x,C),C},m=(x,_)=>{if(!a.has(x)){a.add(x);let T=()=>{a.delete(x)};try{x.addEventListener("finish",T,{once:!0}),x.addEventListener("cancel",T,{once:!0})}catch(C){L("runtime.adapters.waapi.site4",C)}}f(x,_)},h=(x,_)=>{for(let T of x)m(T,_)},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 T=function(...C){let F=_.apply(this,C);return m(F,t),F};x.animate=T,r=x,i=_,o=T,n=!0}catch{}},v=x=>{let _=null;try{_=x.effect?.getComputedTiming?.()??null}catch(F){L("runtime.adapters.waapi.site4",F)}if(!_)return{};let T=Number(_.endTime);return Number.isFinite(T)?{endSeconds:(l.get(x)?.compositionTimeMs??0)/1e3+T/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,b(),h(s(),t)},seek:x=>{let _=Math.max(0,(Number(x.time)||0)*1e3);t=_,(!e||a.size>0)&&h(s(),e?_:0);for(let T of a){let C=e?f(T,_):f(T,0),F=C.animationTimeMs+Math.max(0,_-C.compositionTimeMs);try{T.currentTime=F}catch(D){L("runtime.adapters.waapi.site1",D)}try{T.pause()}catch(D){L("runtime.adapters.waapi.site2",D)}}},pause:()=>{e||h(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 T=v(_);T.endSeconds!=null&&(x=Math.max(x,T.endSeconds))}return x>0?x:null}}}var Bo=3.981071705534972;function Ue(e){return Number.isFinite(e)?Math.max(0,Math.min(Bo,e)):1}function ti(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function fu(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,ti(o))}});try{return t()}finally{delete e.volume,i.call(e,ti(o))}}var Xt=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),j1=Object.freeze([Xt.start,Xt.duration,Xt.trackIndex]),K1=Object.freeze([Xt.derivedEnd]),Y1=Object.freeze([Xt.derivedEnd,Xt.legacyTrack]);function ni(e){if(e==null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}var hu=/^[A-Za-z0-9_.:-]+$/;function gu(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function pu(e,t){let n=t;for(;n>=0&&gu(e,n);)n--;return n}function Dh(e,t){let n=t;for(;n>=0&&(e[n]??"").trim()==="";)n--;return n}function Ih(e){let t=e.length-1;if(!gu(e,t))return null;let n=pu(e,t);return e[n]==="."&&(n=pu(e,n-1)),n+1}function Ph(e){let t=Ih(e);if(t==null)return null;let n=Dh(e,t-1),r=e[n];if(r!=="+"&&r!=="-")return null;let i=e.slice(0,n).trim();if(!hu.test(i))return null;let o=Number(e.slice(t));return Number.isFinite(o)?{refId:i,operator:r,magnitude:o}:null}function Uo(e){let t=(e??"").trim();if(!t)return null;let n=ni(t);if(n!=null)return{kind:"absolute",value:n};if(hu.test(t))return{kind:"reference",refId:t,offset:0};let r=Ph(t);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}function bu(e){return Number.isFinite(e)&&e>0?Math.max(.1,Math.min(5,e)):1}function Ce(e){return ni(e)}function Le(e){let t=Number.parseFloat(e.getAttribute("data-playback-rate")??""),n=Number.isFinite(t)&&t>0?t:be(e)?e.defaultPlaybackRate:1;return bu(n)}function Fn(e){let t=n=>{let r=Ce(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 xt(e,t){return Oh(t,Fn(e),Le(e))}function ri(e){let t=Ce(e.getAttribute("data-duration"));return t!=null&&t>0?t:Number.isFinite(e.duration)?xt(e,e.duration):null}function Oh(e,t,n){return Number.isFinite(e)?Math.max(0,e-t)/bu(n):null}function Nn(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 Jt(e){let t=Nn(e.start);if(t==null)return null;let n=Math.max(0,t),r=Nn(e.duration),i=Nn(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=Nn(e.end),l=Nn(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 ii="data-hf-media-start-basis";function Gh(e){return e?.trim().toLowerCase()==="global"?"global":"local"}function xu(e){return Gh(e.basis)==="global"?e.authoredStart:e.hostStart+e.authoredStart}function st(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,i=new WeakMap,o=new WeakMap,a=new Set,l=m=>{let h=r.getElementById(m);return h||(r.querySelector(`[data-composition-id="${CSS.escape(m)}"]`)??null)},s=m=>{let h=o.get(m);if(h!==void 0)return h;let b=null,v=Jt({start:0,duration:m.getAttribute("data-duration"),authoredDuration:n?m.getAttribute("data-hf-authored-duration"):null});if(v?.duration!=null&&v.duration>0&&(b=v.duration),b==null||b<=0){let x=d(m,0),_=Jt({start:x,end:m.getAttribute("data-end"),authoredEnd:n?m.getAttribute("data-hf-authored-end"):null});_?.duration!=null&&_.duration>0&&(b=_.duration)}if((b==null||b<=0)&&be(m)){let x=Fn(m);Number.isFinite(m.duration)&&m.duration>x&&(b=(m.duration-x)/Le(m))}if(b==null||b<=0){let x=m.getAttribute("data-composition-id");if(x){let _=t[x]??null;if(_&&typeof _.duration=="function")try{let T=Number(_.duration());Number.isFinite(T)&&T>0&&(b=T)}catch(T){L("runtime.startResolver.site1",T)}}}return b!=null&&Number.isFinite(b)&&b>0?(o.set(m,b),b):(o.set(m,null),null)},u=(m,h)=>{if(m.hasAttribute("data-composition-id")){let v=m.parentElement?.closest("[data-composition-id]");return v?d(v,h):0}let b=m.closest("[data-composition-id]");return b?d(b,h):0},d=(m,h)=>{let b=i.get(m);if(b!==void 0)return b??h;if(a.has(m))return h;a.add(m);try{let v=Uo(m.getAttribute("data-start"));if(!v){if(m.hasAttribute("data-composition-id")){let F=m.parentElement;if(F&&(F.hasAttribute("data-composition-src")||F.hasAttribute("data-composition-id")||F.hasAttribute("data-composition-file"))){let D=d(F,h);return i.set(m,D),D}}return i.set(m,h),h}if(v.kind==="absolute"){let F=Math.max(0,v.value),D=Math.max(0,u(m,h)+F);return i.set(m,D),D}let x=l(v.refId);if(!x)return i.set(m,h),h;let _=d(x,0),T=s(x);if(T==null||T<=0){let F=Math.max(0,_+v.offset);return i.set(m,F),F}let C=Math.max(0,_+T+v.offset);return i.set(m,C),C}finally{a.delete(m)}};return{resolveStartForElement:(m,h=0)=>d(m,Math.max(0,h)),resolveDurationForElement:m=>s(m),resolveMediaStartForElement:m=>{let h=m.closest("[data-composition-id]"),b=h?d(h,0):0,v=Ce(m.getAttribute("data-start"));return m.hasAttribute("data-hf-auto-start")||v==null||b<=0?d(m,b):xu({authoredStart:v,hostStart:b,basis:m.getAttribute(ii)})}}}function Hh(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:Ue(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:Ue(n)}),i}function yu(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 Bh(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 Uh(e){let t=Number.parseFloat(e??"");return Number.isFinite(t)?t:void 0}function Wh(e,t){let n=st({timelineRegistry:window.__timelines,includeAuthoredTimingAttrs:!0}).resolveMediaStartForElement(e),r=Ce(e.dataset.end)??void 0,i=Ce(e.dataset.duration)??void 0,o=t;i!==void 0&&i>0?o=n+i:r!==void 0&&r>n&&(o=r);let a=Uh(e.dataset.volume)??1;return{start:n,end:o,staticVolume:Ue(a)}}function Vh(e,t,n,r,{start:i,end:o,staticVolume:a}){let l=1/Math.min(60,Math.max(1,r)),s=Math.max(0,i),u=Math.min(n,o),d=fu(e,()=>{e.volume=a;let m=[],h;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(Ue(v).toFixed(6))};Bh(m,h,x,b===u),h=x}if(b===u)break}return m});return d.some(m=>Math.abs(m.volume-a)>1e-4)?d:null}function vu(e,t,n,r,i={}){if(i.allowLiveTimelineSeek===!1||!t||!be(e)||n<=0)return;let o=u=>{try{typeof t.totalTime=="function"?t.totalTime(u,!0):typeof t.seek=="function"&&t.seek(u,!0)}catch{}},a=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,l=Wh(e,n),s=Vh(e,o,n,60,l);if(Number.isFinite(a)&&o(a),s){let u=Hh(s,l.start,l.staticVolume);u.length>0&&r.set(e,u)}}var It="data-fx-chain",bA=It.slice(5),Su=1,Ln=(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}),Wo=(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}),oi=(e=-40,t=40,n=0)=>({kind:"number",key:"gain",label:"Gain",unit:"dB",min:e,max:t,step:.1,default:n,automatable:!0}),Au={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."},wu=[{id:"gain",label:"Gain",group:"dynamics",description:"Raise or lower the whole signal. Automate it to duck under something else.",params:[oi(-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:[Ln("frequency","Frequency",1e3),oi(-40,40,0),Wo(1)],web:"biquad-peaking"},{id:"lowshelf",label:"Low Shelf",group:"filter",description:"Lift or drop everything below the corner frequency.",params:[Ln("frequency","Frequency",200,20,2e3),oi(-40,40,0)],web:"biquad-lowshelf"},{id:"highshelf",label:"High Shelf",group:"filter",description:"Lift or drop everything above the corner frequency.",params:[Ln("frequency","Frequency",4e3,500,2e4),oi(-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:[Ln("frequency","Cutoff",300,20,2e4),Wo(.707),Au],web:"biquad-highpass"},{id:"lowpass",label:"Low-pass",group:"filter",description:"Remove high frequencies \u2014 darkens or muffles a track.",params:[Ln("frequency","Cutoff",8e3,100,2e4),Wo(.707),Au],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"}],Vo=new Map(wu.map(e=>[e.id,e]));function Dn(e){return Vo.get(e)}var xA=wu.map(e=>e.id);function In(e,t){let n=Vo.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 yt=class extends Error{constructor(t){super(t),this.name="AudioFxChainError"}};function _u(e){let t;try{t=JSON.parse(e)}catch(i){throw new yt(`Chain file is not valid JSON: ${i.message}`)}if(typeof t!="object"||t===null)throw new yt("Chain file must be a JSON object.");let n=t;if(n.version!==Su)throw new yt(`Unsupported chain version: ${String(n.version)}`);if(!Array.isArray(n.nodes))throw new yt("Chain file is missing a `nodes` array.");let r=n.nodes.map(zh);return{version:Su,nodes:r}}function Pn(e){return e.nodes.filter(t=>t.enabled!==!1)}function zh(e,t){if(typeof e!="object"||e===null)throw new yt(`Node ${t} is not an object.`);let n=e;if(typeof n.type!="string"||!Vo.has(n.type))throw new yt(`Node ${t} has unknown effect type: ${String(n.type)}`);return $h({type:n.type,id:ai(n.id),fromCarve:Eu(n.fromCarve),fromPreset:ai(n.fromPreset),label:ai(n.label),fromEq:ai(n.fromEq),fromLeveller:Eu(n.fromLeveller),presetAmount:qh(n.presetAmount),enabled:n.enabled!==!1,params:In(n.type,n.params??void 0)})}function ai(e){return typeof e=="string"&&e?e:void 0}function Eu(e){return e===!0?!0:void 0}function qh(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(1,Math.max(0,e))}function $h(e){for(let t of Object.keys(e))e[t]===void 0&&delete e[t];return e}var ut="data-automation",AA=ut.slice(5),si=1,jh=512,lt=class extends Error{constructor(t){super(t),this.name="AudioAutomationError"}},Qt="volume";function Gn(e){if(e===Qt)return{kind:"volume"};let t=e.split(".");if(t.length===3&&t[0]==="fx"&&t[1]===Kh){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 Kh="preset";var Yh={min:0,max:1,step:.01,unit:"",label:"Amount",scale:"linear",default:1},li={min:0,max:Bo,step:.01,unit:"",label:"Volume",scale:"linear",default:1};function zo(e,t){let n=Gn(e);if(!n)return null;if(n.kind==="volume")return li;if(n.kind==="preset")return t?.nodes.some(l=>l.fromPreset===n.presetId)?{...Yh,label:`${n.presetId} \xB7 Amount`}:null;let r=t?.nodes.find(a=>a.id===n.nodeId);if(!r)return null;let i=Dn(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 On(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 Xh(e){let t=On(e);return t===null||t===0?0:Math.min(1,Math.max(-1,t))}function Cu(e,t){let n=On(e),r=On(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 Jh(e){let t=Xh(e?.curve),n=Cu(e?.viaX,e?.viaY);return{...t?{curve:t}:{},...n?{viaX:n.x,viaY:n.y}:{}}}function Qh(e,t){let n=On(e?.t),r=On(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,...Jh(e)}}function Ru(e,t){let n=e.map(i=>Qh(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,jh)}function Zh(e){let t=[];for(let n of e.lanes){if(!Gn(n.target))continue;let r=n.target===Qt?li:null,i=Ru(n.points??[],r);i.length>0&&t.push({target:n.target,points:i})}return{version:si,lanes:t}}function Tu(e,t){let n=[];for(let r of e.lanes){let i=zo(r.target,t);if(!i)continue;let o=Ru(r.points,i);o.length>0&&n.push({target:r.target,points:o})}return{version:si,lanes:n}}function ui(e){let t;try{t=JSON.parse(e)}catch(i){throw new lt(`Automation is not valid JSON: ${i.message}`)}if(typeof t!="object"||t===null)throw new lt("Automation must be a JSON object.");let n=t;if(n.version!==si)throw new lt(`Unsupported automation version: ${String(n.version)}`);if(!Array.isArray(n.lanes))throw new lt("Automation is missing a `lanes` array.");let r=n.lanes.map((i,o)=>{if(typeof i!="object"||i===null)throw new lt(`Lane ${o} is not an object.`);let a=i;if(typeof a.target!="string"||!Gn(a.target))throw new lt(`Lane ${o} has an unreadable target: ${String(a.target)}`);if(!Array.isArray(a.points))throw new lt(`Lane ${o} is missing a \`points\` array.`);return{target:a.target,points:a.points}});return Zh({version:si,lanes:r})}function e0(e,t){return t?Math.pow(e,Math.pow(2,2*t)):e}function t0(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 n0(e,t,n){let{cx:r,cy:i,w:o}=t0(t,n),a=2-2*o,l=e*a-1+2*o*r,s=-e*a-2*o*r,u=r0(l,s,e),d=1-u,f=d*d+2*o*u*d+u*u;return f>0?(2*o*i*u*d+u*u)/f:e}function r0(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 i0(e,t){let n=Cu(t.viaX,t.viaY);return n?n0(Math.min(1,Math.max(0,e)),n.x,n.y):e0(e,t.curve)}function o0(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 Hn(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 f=a+l>>1;r[f].t<=t?a=f:l=f}let s=r[a],u=r[l],d=u.t-s.t;return d<=0?u.v:o0(s.v,u.v,i0((t-s.t)/d,s),n)}function ku(e){return e.points.length<=1||e.points.every(t=>t.v===e.points[0].v)}function Mu(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]=Hn(e,t+l*s/(o-1),i);return a}var ci=new Map,a0=64;function s0(e){let t=ci.get(e);if(t!==void 0)return t;let n=null;try{n=ui(e).lanes.find(r=>r.target===Qt)??null}catch{n=null}return ci.size>a0&&ci.clear(),ci.set(e,n),n}function Fu(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(ut):null)??"";if(!n)return null;let r=s0(n);return!r||r.points.length===0?null:Hn(r,t)}var Zt="hf-audio-group",di="data-audio-group";function qo(e){let t=e?.getAttribute("data-volume"),n=t?parseFloat(t):1;return Number.isFinite(n)?n:1}function $o(e,t){let n=Array.from(e?.querySelectorAll?.(`${Zt}[${Mn}]`)??[]).find(i=>i.getAttribute(Mn)===t);if(n)return n;let r=e?.getElementById(t)??null;return r&&r.tagName?.toLowerCase()===Zt?r:null}function mi(e,t){let n=t?.getAttribute?.(lu)??t?.getAttribute?.(di);return n?$o(e,n)?.hasAttribute("data-hidden")??!1:!1}function Nu(e){return typeof e.tagName!="string"||e.tagName.toLowerCase()!=="audio"||typeof e.getAttribute!="function"?null:e.getAttribute(di)||null}function Lu(e){let t="__hf-audio-group-inert";if(!e?.head||e.getElementById(t))return;let n=e.createElement("style");n.id=t,n.textContent=`${Zt}{display:none!important}`,e.head.appendChild(n)}function Qe(e){return Fn(e)}function Du(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 Iu(e){let t=e?.elements??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=Qe(a),u=Le(a),d=a.loop,f=Number.isFinite(a.duration)&&a.duration>0?a.duration:null,m=e?.resolveDurationSeconds?.(a)??Number.parseFloat(a.dataset.duration??"");(!Number.isFinite(m)||m<0)&&f!=null&&(m=Math.max(0,(f-s)/u));let h=Number.isFinite(m)&&m>=0,b=h?l+m:Number.POSITIVE_INFINITY,v=Number.parseFloat(a.dataset.volume??""),x={el:a,start:l,mediaStart:s,duration:h?m:Number.POSITIVE_INFINITY,end:b,volume:Number.isFinite(v)?v:null,playbackRate:u,loop:d,sourceDuration:f};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 Ko=new WeakMap,fi=new WeakMap,Bn=new WeakMap,Yo=new WeakSet,en=new WeakSet;function l0(e){if(en.has(e))return;en.add(e);let t=()=>en.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}var u0=3;function c0(e){return e.error!=null||e.networkState===u0}var Xo=new WeakMap;function jo(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function Jo(e){Ko.delete(e),fi.delete(e),Bn.delete(e),Yo.delete(e),Xo.delete(e)}function Pu(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=fi.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(fi.set(r,i),n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let G=n.sourceDuration-n.mediaStart;G>0&&i>=n.sourceDuration&&(i=n.mediaStart+(i-n.mediaStart)%G)}let m=jo(e.userVolume??1),h=Ue(n.volume??1),b=Xo.get(r),v=jo(r.volume),x,_=Fu(r,e.timeSeconds-n.start);if(_!==null)x=Ue(_);else if(n.volumeKeyframes&&n.volumeKeyframes.length>0){let G=e.timeSeconds-n.start;x=Ue(yu(n.volumeKeyframes,G))}else e.isWebAudioRouted?.(r)?x=h:b===void 0?x=h>1?h:v:Math.abs(v-b)>1e-4?x=v:x=h;let C=r.closest("[data-hidden]")!==null||mi(r.ownerDocument,r)?0:jo(x*m);r.volume=C,Xo.set(r,C),e.onElementVolume?.(r,C,x),(t||e.isWebAudioOwned?.(r))&&(r.muted=!0),r.preload!=="auto"&&(r.preload="auto");try{r.playbackRate=n.playbackRate*e.playbackRate}catch(G){L("runtime.media.site1",G)}let F=.04,D=2,M=r.currentTime||0,S=Math.abs(M-i),A=i-M,w=Ko.get(r);Ko.set(r,A);let R=w===void 0,I=!R&&Math.abs(A-w)>.5,H=S>3,j=r.tagName==="AUDIO"&&R&&M-i>F,X=a&&S>.001||r.ended&&u&&S>.001||j||S>.5&&(R||I||H),k=r.tagName==="VIDEO"&&!r.paused,U=w!==void 0&&Math.abs(A-w)<.004,te=!1;if(!k&&!X&&!R&&U&&S>F){let G=(Bn.get(r)??0)+1;Bn.set(r,G),G>=D&&(te=!0,Bn.set(r,0))}else S<=F&&Bn.set(r,0);let B=!k&&e.forceSync&&S>.02;if(X||te||B){if(!(r.tagName==="VIDEO"&&!!bt(r))){try{r.currentTime=i}catch(W){L("runtime.media.site2",W)}if(Math.abs(r.currentTime-i)>.5&&!Yo.has(r)){Yo.add(r),r.load();try{r.currentTime=i}catch(W){L("runtime.media.site3",W)}}}en.delete(r)}a?r.paused||r.pause():e.playing&&r.paused&&!en.has(r)&&!c0(r)?(l0(r),r.play().catch(G=>{en.delete(r),(G&&typeof G=="object"&&"name"in G?String(G.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!e.playing&&!r.paused&&r.pause();continue}let f=e.timeSeconds>=n.start&&e.timeSeconds<n.end;Jo(r),f&&fi.set(r,i),r.paused||r.pause()}}var d0="hf-proxy",Ou="runtime_media_proxy_fallback",Gu="runtime_media_proxy_unavailable",Un=new WeakSet,Hu=new WeakSet;function pi(e){return e.currentSrc||e.src}function Qo(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:fe(e)&&!!bt(e)}function Zo(e){let t=pi(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 m0(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 f0(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 ea(e,t){return t[e]??m0(e,t)??f0(e,t)}function p0(e,t){let n=new URL(e,document.baseURI);return n.searchParams.set(d0,t?t.hasAlpha?"vp8":"h264":"auto"),n.href}var h0={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 Pt(e,t,n){if(Hu.has(e))return;Hu.add(e);let r=h0[t];ve({source:"hf-preview",type:"diagnostic",code:Gu,details:{asset:n,codecName:null,reason:t,note:r}}),console.info(`[hyperframes] ${Gu}: "${n}" (${t}): ${r}`)}function ta(e,t=null,n="reactive"){if(Un.has(e))return;let r=pi(e),i;try{i=p0(r,t)}catch(l){L("runtime.mediaProxy.swap",l),Pt(e,"invalid_source_url",r);return}Un.add(e),Jo(e),e.src=i,e.load();let o=t?.codecName??null;ve({source:"hf-preview",type:"diagnostic",code:Ou,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] ${Ou}: "${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 Bu(e){if(Qo(e)||!fe(e)||Un.has(e))return;let t=window.__HF_MEDIA_CODEC_MAP__;if(!t)return;let n=Zo(e);if(n===null)return;let r=ea(n,t);if(!r||!r.browserHostile)return;let i=r.representativeMime?e.canPlayType(r.representativeMime):"";i==="probably"||i==="maybe"||ta(e,r,"proactive")}function Uu(e){if(Qo(e)||!fe(e)||e.videoWidth!==0)return;let t=pi(e);if(Un.has(e)){Pt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=Zo(e);if(r===null){Pt(e,"cross_origin",t);return}let i=ea(r,n);if(i&&!i.browserHostile){Pt(e,"browser_safe_codec",t);return}ta(e,i,"reactive")}function Wu(e){if(Qo(e)||!fe(e))return;let t=pi(e);if(Un.has(e)){Pt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=Zo(e);if(r===null){Pt(e,"cross_origin",t);return}let i=ea(r,n);if(i&&!i.browserHostile){Pt(e,"browser_safe_codec",t);return}ta(e,i,"tertiary")}var Te=class extends Error{constructor(n,r=null){super(r==null?n:`${n} at line ${r}`);ge(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=r}},g0=[0,0,0],b0=[1,1,1],hi=64;function x0(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 vt(e,t){let n=Number(e);if(!Number.isFinite(n))throw new Te(`Invalid number "${e}"`,t);return n}function Vu(e,t,n){if(e.length!==3)throw new Te(`${t} expects three numbers`,n);return[vt(e[0],n),vt(e[1],n),vt(e[2],n)]}function zu(e,t,n){if(!e)throw new Te(`${t} expects a size`,n);let r=Number(e);if(!Number.isInteger(r)||r<2)throw new Te(`${t} must be an integer greater than 1`,n);return r}function y0(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new Te("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function v0(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 S0(e){return/^[+-]?(?:\d|\.\d)/.test(e)}function qu(e,t={}){let n=t.maxSize??hi,r=null,i=g0,o=b0,a=null,l=null,s=[],u=e.replace(/^\uFEFF/,"").split(/\r?\n/);for(let f=0;f<u.length;f++){let m=f+1,h=x0(u[f]??"").trim();if(!h)continue;let b=h.split(/\s+/),v=(b[0]??"").toUpperCase(),x=b.slice(1);if(v==="TITLE"){r=v0(h);continue}if(v==="DOMAIN_MIN"){i=Vu(x,v,m);continue}if(v==="DOMAIN_MAX"){o=Vu(x,v,m);continue}if(v==="LUT_3D_INPUT_RANGE"){if(x.length!==2)throw new Te(`${v} expects two numbers`,m);let _=vt(x[0],m),T=vt(x[1],m);if(T<=_)throw new Te("LUT_3D_INPUT_RANGE max must exceed min",m);i=[_,_,_],o=[T,T,T];continue}if(v==="LUT_1D_SIZE"){a=zu(x[0],v,m);continue}if(v==="LUT_3D_SIZE"){if(l=zu(x[0],v,m),l>n)throw new Te(`LUT_3D_SIZE ${l} exceeds max ${n}`,m);continue}if(!S0(v)){if(v.startsWith("LUT_"))throw new Te(`Unsupported cube keyword ${v}`,m);continue}if(!l)throw a?new Te("1D cube LUTs are not supported yet",m):new Te("LUT data appears before LUT_3D_SIZE",m);if(b.length!==3)throw new Te("LUT data rows must contain three numbers",m);s.push(vt(b[0],m),vt(b[1],m),vt(b[2],m))}if(a&&l)throw new Te("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw a?new Te("1D cube LUTs are not supported yet"):new Te("Missing LUT_3D_SIZE");y0(i,o);let d=l*l*l;if(s.length!==d*3)throw new Te(`Expected ${d} LUT rows for size ${l}, found ${s.length/3}`);return{title:r,size:l,domainMin:i,domainMax:o,data:new Float32Array(s)}}function A0(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function Wn(e){return Math.round(A0(e)*255)}function na(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]=Wn(e.data[s]??0),i[u+1]=Wn(e.data[s+1]??0),i[u+2]=Wn(e.data[s+2]??0),i[u+3]=255}return{width:n,height:r,data:i}}var $u="rec709";var he={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 ju=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"],Ku=["shadows","midtones","highlights"],Yu=["master","red","green","blue"],Xu=["hueVsHue","hueVsSaturation","hueVsLuma"];var Ju=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],Qu=["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 jA=he.unit,KA=he.signedUnit,YA=he.effects;var Ze=1024,Vn=16;function Zu(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 ke(e,t){let n=e[t];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function E0(e){let t=[],n=[],r=ke(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=ke(n,0);if(e.length===2)return[i,i];let o=new Array(e.length);o[0]=Zu(ke(t,0),ke(t,1),i,ke(n,1)),o[o.length-1]=Zu(ke(t,t.length-1),ke(t,t.length-2),ke(n,n.length-1),ke(n,n.length-2));for(let a=1;a<e.length-1;a+=1){let l=ke(n,a-1),s=ke(n,a);if(l===0||s===0||Math.sign(l)!==Math.sign(s)){o[a]=0;continue}let u=ke(t,a-1),d=ke(t,a),f=2*d+u,m=d+2*u;o[a]=(f+m)/(f/l+m/s)}return o}function ec(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 w0(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 _0(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 tc(e,t,n,r,i){w0(e,r,i);let o=E0(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>ke(e,l+1)[0];)l+=1;let d=ke(e,l),f=ke(e,l+1),m=_0(u,d,f,ke(o,l),ke(o,l+1));a[s]=Math.min(i,Math.max(r,m))}return a}function tn(e,t=Ze){if(ec(e,t),e.length>Vn)throw new RangeError(`A color curve supports at most ${Vn} 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 tc(e,t,n=>n/(t-1),0,1)}function ia(e,t,n,r=Ze){if(e.length<3)throw new RangeError("A hue curve requires at least three points");if(e.length>Vn)throw new RangeError(`A hue curve supports at most ${Vn} 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 ec(l,r),tc(l,r,s=>s/r*360,t,n)}var zn="data-color-grading",qn="data-hf-color-grading-source-hidden",xi="data-hf-authored-opacity",ac="__hf_color_grading_",R0=$u,sa={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},la={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},ua={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 yi=ju,sc=Ku,lc=Yu,uc=Xu,da=Ju,ma=Qu,nc={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},rc={vignette:.18};function Me(e,t,n={},r={},i={},o=1){return{id:e,label:t,intensity:o,adjust:{...sa,...n},details:{...la,...r},effects:{...ua,...i}}}var fa=[Me("neutral","Neutral"),Me("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),Me("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),Me("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),Me("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),Me("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),Me("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),Me("vintage-wash","Vintage Wash",nc,rc),Me("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),Me("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),Me("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),Me("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),Me("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),Me("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),Me("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}),Me("home-movie-8mm","8mm Home Movie",nc,{...rc,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),Me("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),Me("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],T0=new Map(fa.map(e=>[e.id,e])),k0=/^\$(?:\{([A-Za-z0-9_.:-]+)\}|([A-Za-z0-9_.:-]+))$/,M0={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}},nn={hue:0,amount:0,level:0},ic={amount:he.unit,level:he.signedUnit},St=[[0,0],[1,1]],rn=[],F0={hueVsHue:he.secondaryHueShift,hueVsSaturation:he.signedUnit,hueVsLuma:he.signedUnit},oa={center:0,range:180,softness:0},aa={min:0,max:1,softness:.05},N0={vignette:he.unit,vignetteMidpoint:he.unit,vignetteRoundness:he.signedUnit,vignetteFeather:he.unit,grain:he.unit,grainSize:he.unit,grainRoughness:he.unit},ca=he.unit,L0=he.effects,cc=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"];var D0=fa.filter(e=>cc.some(t=>e.effects[t]>1e-4)),rE=fa.filter(e=>!D0.includes(e)),iE={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}},dc=[{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 I0=/^#[0-9a-f]{6}$/i;function P0(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&I0.test(t))?null:e.map(t=>t.toLowerCase())}function De(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function bi(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function mc(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function Ie(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?bi(n,t.min,t.max):0}function pa(e,t=0){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?(n%360+360)%360:t}function O0(e){let t=De(e)?e:{};return sc.reduce((n,r)=>{let i=De(t[r])?t[r]:{};return n[r]={hue:pa(i.hue,nn.hue),amount:Ie(i.amount??nn.amount,ic.amount),level:Ie(i.level??nn.level,ic.level)},n},{shadows:{...nn},midtones:{...nn},highlights:{...nn}})}function G0(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)?[bi(t,0,1),bi(n,0,1)]:null}function fc(e){return e.some((t,n)=>n>0&&t[0]===e[n-1]?.[0])}function H0(e){(e[0]?.[0]??0)>0&&e.unshift([0,0]),(e.at(-1)?.[0]??1)<1&&e.push([1,1])}function B0(e){if(!Array.isArray(e)||e.length<2)return St;let t=[];for(let n of e){let r=G0(n);if(!r)return St;t.push(r)}return t.sort((n,r)=>n[0]-r[0]),fc(t)||(H0(t),t.length>16)?St:t}function U0(e){let t=De(e)?e:{};return lc.reduce((n,r)=>(n[r]=B0(t[r]),n),{master:St,red:St,green:St,blue:St})}function W0(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)?[pa(n),bi(r,t.min,t.max)]:null}function V0(e,t){if(!Array.isArray(e)||e.length<3||e.length>16)return rn;let n=[];for(let r of e){let i=W0(r,t);if(!i)return rn;n.push(i)}return n.sort((r,i)=>r[0]-i[0]),fc(n)?rn:n}function z0(e){let t=De(e)?e:{};return uc.reduce((n,r)=>(n[r]=V0(t[r],F0[r]),n),{hueVsHue:rn,hueVsSaturation:rn,hueVsLuma:rn})}function oc(e){let t=De(e)?e:{},n=Ie(t.min??aa.min,ca),r=Ie(t.max??aa.max,ca);return{min:Math.min(n,r),max:Math.max(n,r),softness:Ie(t.softness??aa.softness,he.secondarySoftRangeSoftness)}}function q0(e){let t=De(e)?e:{},n=Ie(t.range??oa.range,he.secondaryHueRange);return{center:pa(t.center,oa.center),range:n,softness:Ie(t.softness??oa.softness,{min:he.secondaryHueSoftness.min,max:he.secondaryHueCombinedMax-n})}}function $0(e){return{hueShift:Ie(e.hueShift??0,he.secondaryHueShift),saturation:Ie(e.saturation??0,he.signedUnit),luma:Ie(e.luma??0,he.signedUnit),temperature:Ie(e.temperature??0,he.signedUnit),tint:Ie(e.tint??0,he.signedUnit)}}function j0(e){return!De(e)||!De(e.key)||!De(e.correction)?null:{enabled:e.enabled!==!1,key:{hue:q0(e.key.hue),saturation:oc(e.key.saturation),luma:oc(e.key.luma)},correction:$0(e.correction)}}function K0(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,4)){let r=j0(n);r&&t.push(r)}return t}function Y0(e){if(e==null)return null;let t=String(e).trim();return t||null}function X0(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!De(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:mc(e.intensity,1)}}function J0(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return De(n)?n:null}catch{return null}return{preset:t}}return De(e)?e:null}function Q0(e,t){let n=e.trim().match(k0);if(!n)return e;let r=n[1]??n[2]??"";return r&&Object.hasOwn(t,r)?t[r]:e}function gi(e,t){if(typeof e=="string"){let r=Q0(e,t);if(r!==e)return r;let i=e.trim();if(!i.startsWith("{"))return e;try{return gi(JSON.parse(i),t)}catch{return e}}if(Array.isArray(e))return e.map(r=>gi(r,t));if(!De(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=gi(i,t);return n}function Z0(e){return e?T0.get(e)??null:null}function vi(e){let t=J0(e);if(!t||t.enabled===!1)return null;let n=Y0(t.preset),r=Z0(n),i=r?.adjust??sa,o=r?.details??la,a=r?.effects??ua,l=De(t.adjust)?t.adjust:{},s=De(t.details)?t.details:{},u=De(t.effects)?t.effects:{},d=yi.reduce((h,b)=>(h[b]=Ie(l[b]??i[b],M0[b]),h),{...sa}),f=da.reduce((h,b)=>(h[b]=Ie(s[b]??o[b],N0[b]),h),{...la}),m=ma.reduce((h,b)=>(h[b]=Ie(u[b]??a[b],L0[b]??ca),h),{...ua});return{enabled:!0,preset:n,intensity:mc(t.intensity,r?.intensity??1),adjust:d,wheels:O0(t.wheels),curves:U0(t.curves),hueCurves:z0(t.hueCurves),secondaries:K0(t.secondaries),details:f,effects:m,palette:P0(t.palette),lut:X0(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():R0}}function pc(e,t){return vi(gi(e,t))}function eg(e){return sc.some(t=>Math.abs(e[t].amount)>1e-4||Math.abs(e[t].level)>1e-4)}function ha(e){return lc.some(t=>e[t].some(([n,r])=>Math.abs(n-r)>1e-4))}function ga(e){return uc.some(t=>e[t].some(([,n])=>Math.abs(n)>1e-4))}function ba(e){return e.some(t=>t.enabled&&Object.values(t.correction).some(n=>Math.abs(n)>1e-4))}function hc(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||cc.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:yi.some(n=>Math.abs(e.adjust[n])>1e-4)||(e.wheels?eg(e.wheels):!1)||(e.curves?ha(e.curves):!1)||(e.hueCurves?ga(e.hueCurves):!1)||(e.secondaries?ba(e.secondaries):!1):!1}var tg=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),ng=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function gc(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(w){L("runtime.picker.site1",w)}}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 w=S;for(;w&&w!==document.body&&w!==document.documentElement;){let R=A.getComputedStyle(w);if(R.display==="none"||R.visibility==="hidden"||R.pointerEvents==="none")return!0;let I=Number.parseFloat(R.opacity);if(Number.isFinite(I)&&I<=.01&&!w.hasAttribute(qn))return!0;w=w.parentElement}return!1}function d(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(tg)||u(S))}function f(S){return!!S?.closest(ng)}function m(S){let A=S;if(A.id)return`#${CSS.escape(A.id)}`;let w=S.getAttribute("data-composition-id");if(w)return`[data-composition-id="${CSS.escape(w)}"]`;let R=S.getAttribute("data-composition-src");if(R)return`[data-composition-src="${CSS.escape(R)}"]`;let I=S.getAttribute("data-track-index");if(I)return`[data-track-index="${CSS.escape(I)}"]`;let H=S.tagName.toLowerCase(),j=S.parentElement;if(!j)return H;let X=j.querySelectorAll(`:scope > ${H}`);if(X.length===1)return H;for(let k=0;k<X.length;k+=1)if(X[k]===S)return`${H}:nth-of-type(${k+1})`;return H}function h(S){let A=S.tagName.toLowerCase(),w=(S.textContent??"").trim().replace(/\s+/g," "),R=(I,H)=>I.length>H?`${I.slice(0,H-1)}\u2026`:I;return A==="h1"||A==="h2"||A==="h3"?"Heading":A==="p"||A==="span"||A==="div"?w.length>0?R(w,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,w){let R=typeof w=="number"&&w>0?w:8,I=[];if(document.elementsFromPoint)I=document.elementsFromPoint(S,A);else if(document.elementFromPoint){let X=document.elementFromPoint(S,A);I=X?[X]:[]}if(f(I[0]??null))return[];let H={},j=[];for(let[X,k]of I.entries()){if(!d(k))continue;let U=`${k.tagName}::${k.id||""}::${X}`;if(!H[U]&&(H[U]=!0,j.push(k),j.length>=R))break}return j}function v(S){let A=S.getBoundingClientRect(),w={};for(let I of Array.from(S.attributes))I.name.startsWith("data-")&&(w[I.name]=I.value);return{id:S.id||null,tagName:S.tagName.toLowerCase(),selector:m(S),label:h(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:w}}function x(S,A,w){return b(S,A,w).map(v)}function _(S){if(!t)return;let w=b(S.clientX,S.clientY,1)[0]??(Ne(S.target)?S.target:null);if(!d(w)||n===w)return;n&&n.classList.remove("__hf-pick-highlight"),n=w,w.classList.add("__hf-pick-highlight");let R=v(w);l(R),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:R})}function T(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 C(S){S.key==="Escape"&&(D(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function F(){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",T,!0),document.addEventListener("keydown",C,!0),a("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function D(){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",T,!0),document.removeEventListener("keydown",C,!0),a("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function M(){window.__HF_PICKER_API={enable:F,disable:D,isActive:()=>t,getHovered:()=>i,getSelected:()=>o,getCandidatesAtPoint:(S,A,w)=>Number.isFinite(S)&&Number.isFinite(A)?x(S,A,w):[],pickAtPoint:(S,A,w)=>{if(!Number.isFinite(S)||!Number.isFinite(A))return null;let R=x(S,A,8);if(!R.length)return null;let I=Math.max(0,Math.min(R.length-1,Number(w??0))),H=R[I]??null;return H?(s(H),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:H}),D(),H):null},pickManyAtPoint:(S,A,w)=>{if(!Number.isFinite(S)||!Number.isFinite(A))return[];let R=x(S,A,8);if(!R.length)return[];let I=[],H=Array.isArray(w)?w:[0];for(let j of H){let X=Math.max(0,Math.min(R.length-1,Math.floor(Number(j)))),k=R[X];if(!k)continue;I.some(te=>te.selector===k.selector&&te.tagName===k.tagName)||I.push(k)}return I.length?(s(I[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:I}),D(),I):[]}},a("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:F,disablePickMode:D,installPickerApi:M}}var rg=["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 xa(e){return Number.isFinite(e)&&e>0?e:30}function ya(e){return Number.isFinite(e)&&e>0?e:0}function va(e,t){let n=xa(t);return Math.floor(ya(e)*n+1e-9)/n}function $n(e,t,n){let r=Number.isInteger(n)?n:1;if(r<=1)return va(e,t);let i=xa(t)*r;return Math.round(ya(e)*i)/i}function Sa(e,t){let n=xa(t),r=ya(e),i=r*n,o=Math.round(i);return Math.abs(i-o)<=.001?o/n:r}function bc(e,t,n=rg){for(let r of n){let i=t.getPropertyValue(r);i&&e.setProperty(r,i)}}function jn(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 $e(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 Kn(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 xc(e,t,n,r){let i=$n(t,n,r?.subFrameDivisions),o=r?.suppressEvents===!0;return $e(e,"pause"),typeof e.totalTime=="function"?e.totalTime(i,o):typeof e.seek=="function"&&e.seek(i,o),i}function ig(e,t,n,r,i){let o=[];Kn(e,t,a=>{$e(a,"play"),o.push(a)});try{return xc(t,n,r,i)}finally{for(let a of o)try{$e(a,"pause")}catch(l){L("runtime.player.site2",l)}}}function og(e,t){Kn(e,t,n=>{$e(n,"play")})}function yc(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?.()??jn(n,"duration",0))||0);r>0&&Math.max(0,jn(n,"time",0))>=r&&($e(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()),$e(n,"play"),Kn(e.getTimelineRegistry?.(),n,i=>{typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),$e(i,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;$e(n,"pause"),Kn(e.getTimelineRegistry?.(),n,i=>{$e(i,"pause")});let r=Math.max(0,jn(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=ig(e.getTimelineRegistry?.(),i,o,e.getCanonicalFps());e.onDeterministicSeek(l),r?.keepPlaying&&a?(typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),$e(i,"play"),Kn(e.getTimelineRegistry?.(),i,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),$e(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?(og(e.getTimelineRegistry?.(),i),xc(i,n,o,r)):$n(Math.max(0,Number(n)||0),o,r?.subFrameDivisions);e.onDeterministicSeek(a,r),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>jn(e.getTimeline(),"time",0),getDuration:()=>jn(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function vc(){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 ag=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function Aa(e){return e.id||e.getAttribute("data-hf-id")||null}function sg(e){return Ce(e)}function lg(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 ug(e){return!be(e)||!Number.isFinite(e.duration)?null:xt(e,e.duration)}function cg(e,t,n,r){let i=sg(e.getAttribute("data-duration"));return i!=null&&i>0?i:lg(e,t)??ug(e)??Math.max(0,n-r)}function dg(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 Sc(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||ag.has(l.tagName))continue;let s=t.resolveStartForElement(l,0);if(cg(l,n,r,s)<=0)continue;let u={id:Aa(l)??`__clip-${a++}`,element:l,parentId:null,children:[]};i.set(l,u)}return dg(i),{roots:Array.from(i.values()).filter(l=>l.parentId===null)}}var Ea="css:root",Ac=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],mg=new Set([...Ac,"contain","isolation","mask-border","mix-blend-mode","opacity"]),fg=new Set(["absolute","relative"]),pg=new Set(["flex","inline-flex","grid","inline-grid"]),hg=new Set(["layout","paint","strict","content"]),gg=new Set(["size","inline-size"]);function bg(e){return e.position==="fixed"||e.position==="sticky"}function xg(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(fg.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&pg.has(n)}function yg(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:Ac.some(r=>{let i=e.getPropertyValue(r);return i!==""&&i!=="none"})}function vg(e){return e.getPropertyValue("contain").split(/\s+/).some(n=>hg.has(n))?!0:gg.has(e.getPropertyValue("container-type"))}function Sg(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>mg.has(t))}function Ag(e,t){return bg(t)||xg(e,t)||yg(t)||vg(t)?!0:Sg(t)}function Eg(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 Si(e){let t=e.ownerDocument.defaultView;if(!t)return Ea;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(Ag(n,t.getComputedStyle(n)))return Eg(n)}catch{return Ea}n=n.parentElement}return Ea}function wa(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}function Ot(e){return Ce(e)}function _a(e){let t=e.getAttribute("data-duration"),n=e.getAttribute("data-hf-authored-duration"),r=Jt({start:0,duration:t,authoredDuration:n})?.duration;return r??([t,n].map(Ot).some(o=>o!=null&&o<=0)?0:null)}function Ec(e){return Jt({start:0,end:e.getAttribute("data-end"),authoredEnd:e.getAttribute("data-hf-authored-end")})?.end??null}function Ca(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 Ra(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function Ta(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 Xn(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 wc(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return Xn(t);let n=e.getAttribute("data-composition-src");if(n)return Xn(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?Xn(r.getAttribute("src")):null}function _g(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 Cg(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 Rg(e){let t=e.textContent?.replace(/\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function Yn(e){let t=e.replace(/\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return t?t.replace(/\b\w/g,n=>n.toUpperCase()):e}function Tg(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 Yn(i);let o=e.id;if(o)return Yn(o);let a=_g(e);if(a)return Yn(a);let l=Cg(wc(e));if(l)return Yn(l);let s=Rg(e);return s||`${Yn(t)} ${n+1}`}function _c(e){let n=window.__timelines??{},r=st({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),i=q=>{if(!q)return null;let O=n[q]??null;if(!O||typeof O.duration!="function")return null;try{let V=Number(O.duration());return Number.isFinite(V)&&V>0?V:null}catch{return null}},o=()=>{let q=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(q.length===0)return null;let O=0;for(let V of q){let Z=r.resolveMediaStartForElement(V);if(!Number.isFinite(Z))continue;let pe=ri(V);pe==null||pe<=0||(O=Math.max(O,Math.max(0,Z)+pe))}return O>0?O:null},a=(q,O)=>{let V=[],Z=null,pe=null,re=null,z=q.parentElement;for(;z;){let J=z.getAttribute("data-composition-id");J&&(V.push(J),!re&&z!==O&&(re=J),Z==null&&(Z=r.resolveStartForElement(z,0)),pe==null&&(pe=Ot(z.getAttribute("data-duration"))??i(J)??null)),z=z.parentElement}return{parentCompositionId:re,compositionAncestors:V.reverse(),inheritedStart:Z,inheritedDuration:pe}},l=document.querySelector("[data-composition-id]"),s=Array.from(document.querySelectorAll("[data-composition-id]")),u=l?.getAttribute("data-composition-id")??null,d=l?r.resolveStartForElement(l,0):0,f=o(),m=f!=null?Math.max(0,f-Math.max(0,d)):null,h=i(u),b=_a(l??document.body),v=Ra(...s.filter(q=>q!==l).map(q=>{let O=r.resolveStartForElement(q,0),V=r.resolveDurationForElement(q)??i(q.getAttribute("data-composition-id"))??null;return!Number.isFinite(O)||V==null||V<=0?null:Math.max(0,O)+V})),x=v!=null?Math.max(0,v-Math.max(0,d)):null,_=typeof h=="number"&&Number.isFinite(h)&&h>0?h:null,T=typeof b=="number"&&Number.isFinite(b)&&b>0?b:null,C=typeof m=="number"&&Number.isFinite(m)&&m>0?m:null,F=typeof x=="number"&&Number.isFinite(x)&&x>0?x:null,D=Ra(C,F),M=_!=null&&D!=null&&_>D+1,A=T??(M?D:Ra(_,C,F))??null,R=(A!=null?d+A:null)??(typeof f=="number"&&Number.isFinite(f)&&f>0?f:null),I=(q,O)=>!Number.isFinite(O)||O<=0?0:R==null||!Number.isFinite(R)?O:!Number.isFinite(q)||q>=R?0:Math.max(0,Math.min(O,R-q)),H=[],j=[],X=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),k=0;for(let[q,O]of X.entries()){if(O===l||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(O.tagName))continue;let V=a(O,l),Z=O.tagName.toLowerCase(),pe=Z==="video"||Z==="audio"?r.resolveMediaStartForElement(O):r.resolveStartForElement(O,V.inheritedStart??0),re=O.getAttribute("data-composition-id"),z=_a(O);if(z==null&&re&&re!==u&&(z=i(re)),z==null&&be(O)&&Number.isFinite(O.duration)&&(z=xt(O,O.duration)),z==null){let ce=V.inheritedDuration;if(ce!=null&&ce>0){let it=(V.inheritedStart??0)+ce;z=Math.max(0,it-pe)}}if(z==null||z<=0||(z=I(pe,z),z<=0))continue;let J=pe+z;k=Math.max(k,J);let Ae=re&&re!==u?"composition":Z==="video"?"video":Z==="audio"?"audio":Z==="img"?"image":"element";H.push({id:Aa(O)??re??null,label:Tg(O,Ae,H.length),start:pe,duration:z,track:Ta(O,q),zIndex:Ca(O),stackingContextId:Si(O),kind:Ae,tagName:Z,compositionId:O.getAttribute("data-composition-id"),compositionAncestors:V.compositionAncestors,parentCompositionId:V.parentCompositionId,nodePath:null,compositionSrc:Xn(O.getAttribute("data-composition-src")),playbackStart:Qe(O),playbackRate:Le(O),assetUrl:wc(O),timelineRole:O.getAttribute("data-timeline-role"),timelineLabel:O.getAttribute("data-timeline-label"),timelineGroup:O.getAttribute("data-timeline-group"),timelinePriority:Ot(O.getAttribute("data-timeline-priority"))})}let U=new Set(H.map(q=>q.id)),te=l?.getAttribute("data-composition-id")??null,B=te?n[te]??null:null;if(B&&l){let q=B;if(typeof q.getChildren=="function")try{let O=q.getChildren(!0,!0,!1)??[],V=new Map;for(let re of l.children){let z=re;if(!z.id)continue;let J=z.tagName.toLowerCase();J==="script"||J==="style"||J==="link"||V.set(z,{id:z.id,start:1/0,end:-1/0})}let Z=re=>{let z=re;for(;z;){if(V.has(z))return z;if(z===l)return null;z=z.parentElement}return null};for(let re of O){if(typeof re.targets!="function"||typeof re.startTime!="function"||typeof re.duration!="function")continue;let z=re.startTime(),J=re.parent;for(;J&&J!==B&&typeof J.startTime=="function";)z+=J.startTime(),J=J.parent;let Ae=z+re.duration();if(!(!Number.isFinite(z)||!Number.isFinite(Ae)))for(let ce of re.targets()){if(!Ne(ce))continue;let vn=Z(ce);if(!vn)continue;let it=V.get(vn);it&&(it.start=Math.min(it.start,z),it.end=Math.max(it.end,Ae))}}let pe=H.length>0?Math.max(...H.map(re=>re.track))+1:0;for(let[re,z]of V){if(z.start===1/0||z.end===-1/0)continue;let J=re;if(U.has(J.id))continue;let Ae=Math.max(0,z.end-z.start);if(Ae<=0)continue;let ce=I(z.start,Ae);ce<=0||(k=Math.max(k,z.start+ce),H.push({id:J.id,label:J.getAttribute("data-timeline-label")??J.getAttribute("data-label")??J.getAttribute("aria-label")??J.id,start:z.start,duration:ce,track:Ta(J,pe),zIndex:Ca(J),stackingContextId:Si(J),kind:"element",tagName:J.tagName.toLowerCase(),compositionId:J.getAttribute("data-composition-id"),compositionAncestors:te?[te]:[],parentCompositionId:te,nodePath:null,compositionSrc:null,playbackStart:Qe(J),playbackRate:Le(J),assetUrl:null,timelineRole:J.getAttribute("data-timeline-role"),timelineLabel:J.getAttribute("data-timeline-label"),timelineGroup:J.getAttribute("data-timeline-group"),timelinePriority:Ot(J.getAttribute("data-timeline-priority"))}),U.add(J.id))}}catch(O){L("runtime.timeline.site1",O)}}if(l&&A!=null&&A>0){let q=H.length>0?Math.max(...H.map(O=>O.track))+1:0;for(let O of l.children){let V=O;if(!V.id||U.has(V.id))continue;let Z=V.getAttribute("data-timeline-role");if(Z!=="overlay"&&Z!=="persistent-overlay")continue;let pe=V.tagName.toLowerCase();if(pe==="script"||pe==="style"||pe==="link"||pe==="meta"||window.getComputedStyle(V).display==="none")continue;let z=I(0,A);z<=0||(k=Math.max(k,z),H.push({id:V.id,label:V.getAttribute("data-timeline-label")??V.getAttribute("data-label")??V.getAttribute("aria-label")??V.id,start:0,duration:z,track:Ta(V,q),zIndex:Ca(V),stackingContextId:Si(V),kind:"element",tagName:pe,compositionId:V.getAttribute("data-composition-id"),compositionAncestors:te?[te]:[],parentCompositionId:te,nodePath:null,compositionSrc:null,playbackStart:Qe(V),playbackRate:Le(V),assetUrl:null,timelineRole:Z,timelineLabel:V.getAttribute("data-timeline-label"),timelineGroup:V.getAttribute("data-timeline-group"),timelinePriority:Ot(V.getAttribute("data-timeline-priority"))}),U.add(V.id))}}for(let q of s){if(q===l)continue;let O=q.getAttribute("data-composition-id");if(!O||!wa(O))continue;let V=r.resolveStartForElement(q,0),Z=_a(q);if((Z==null||Z<=0)&&Ec(q)!=null){let J=Ec(q);Z=Math.max(0,J-V)}let pe=i(O),re=Z&&Z>0?Z:pe;if(re==null||re<=0)continue;let z=I(V,re);z<=0||j.push({id:O,label:q.getAttribute("data-label")??O,start:V,duration:z,thumbnailUrl:Xn(q.getAttribute("data-thumbnail-url")),avatarName:null})}let G=Math.max(1,k||1,A??0),W=M&&T==null,Q=W?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(G*Math.max(1,e.canonicalFps)));return{...Yr(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:W?Number.POSITIVE_INFINITY:G,durationInFrames:Q,clips:H,scenes:j,compositionWidth:Ot(l?.getAttribute("data-width"))??1920,compositionHeight:Ot(l?.getAttribute("data-height"))??1080}}var ka="data-composition-id",kg="data-composition-src",Mg=`[${ka}]`,UE=`[${kg}]`,Cc="style",Rc="script",Fg='link[rel="stylesheet"], link[rel="preconnect"]';function on(e){return e?Array.from(e):[]}function Tc(e){let{contentNode:t,head:n,documentElement:r,hasTemplate:i,compositionId:o}=e,a=on(t.querySelectorAll(Mg)),l=o?a.find(d=>d.getAttribute(ka)===o)??null:a[0]??null,s=(l??a[0])?.getAttribute(ka)?.trim()||"",u=i?null:n??null;return{innerRoot:l,authoredCompositionId:o||s||null,scriptCompositionId:s||o||null,authoredRootId:l?.getAttribute("id")?.trim()||null,styleSources:[...on(u?.querySelectorAll(Cc)),...on(t.querySelectorAll(Cc))],scriptSources:[...on(u?.querySelectorAll(Rc)),...on(t.querySelectorAll(Rc))],linkSources:on(n?.querySelectorAll(Fg)),variableDefaultCarriers:[r,l].filter(d=>d!=null)}}var xe=mh(Zd(),1),em=xe.default,Mw=xe.default.stringify,Fw=xe.default.fromJSON,Nw=xe.default.plugin,Lw=xe.default.parse,Dw=xe.default.list,Iw=xe.default.document,Pw=xe.default.comment,Ow=xe.default.atRule,Gw=xe.default.rule,Hw=xe.default.decl,Bw=xe.default.root,Uw=xe.default.CssSyntaxError,Ww=xe.default.Declaration,Vw=xe.default.Container,zw=xe.default.Processor,qw=xe.default.Document,$w=xe.default.Comment,jw=xe.default.Warning,Kw=xe.default.AtRule,Yw=xe.default.Result,Xw=xe.default.Input,Jw=xe.default.Rule,Qw=xe.default.Root,Zw=xe.default.Node;var ts="data-hf-authored-id",tm="data-hf-inner-root";function ns(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rs(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Zb(e){return e&&e.replace(/[^a-zA-Z0-9_-]/g,n=>`\\${n}`).replace(/^-?\d/,n=>`\\${n}`)}function rm(e){let t=e.trim();return t?Array.from(new Set([t,Zb(t)])).filter(Boolean):[]}function ex(e){return!!e&&/[\w-]/.test(e)}function tx(e,t,n){let r=rm(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 d=r.find(f=>e.startsWith(f,l+1));if(d){let f=e[l+1+d.length];if(!ex(f)){i+=n,l+=d.length;continue}}}i+=s}return i}function nx(e,t){let n=t?.trim();return n?tx(e,n,`[${ts}="${rs(n)}"]`):e}function nm(e){return`${e}:not(:has([${tm}])), ${e} > [${tm}]`}function rx(e,t,n,r,i,o){let a=nx(e,r),l=ix(a,t,n),s=l.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return o?nm(t):e;let u=new RegExp(`\\[\\s*data-composition-id\\s*[\\^\\*\\$]?=\\s*(["'])${ns(n)}\\1\\s*\\]`,"g");if(u.test(s))return s.replace(u,"").trim()===""?nm(t):l.replace(u,t);let d=l.match(/^\s*/)?.[0]??"",f=l.match(/\s*$/)?.[0]??"";if(i){let m=r?`[${ts}="${rs(r)}"]`:null;if(m&&s.startsWith(m)){let h=s.slice(m.length);return`${d}${t}${m}${h}${f}`}}return`${d}${t} ${s}${f}`}function ix(e,t,n){let r=ns(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 ox=new Set(["keyframes","-webkit-keyframes","font-face"]);function ax(e){return e?.type==="atrule"}function sx(e){let t=e.parent;for(;t;){if(ax(t)&&ox.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function lx(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function im(e,t,n,r,i){let o=t.trim();if(!e||!o)return e;let a=n||`[data-composition-id="${rs(o)}"]`,l;try{l=em.parse(e)}catch{return""}return l.walkRules(s=>{sx(s)||lx(s)||(s.selectors=s.selectors.map(u=>rx(u,a,o,r,i?.compoundAuthoredRoot,i?.scopeRootSelectors)))}),l.toResult({map:!1}).css}function dt(e){return JSON.stringify(e).replace(/</g,"\\u003c")}function om(e,t,n="[HyperFrames] composition script error:",r,i=t,o){let a=dt(t),l=dt(i),s=dt(n),u=ns(t),d=dt(o?.trim()||null),f=dt(r??null),m=dt(String.raw`\[\s*data-composition-id\s*=\s*(?:"${u}"|'${u}')\s*\]`),h=dt(String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`),b=dt(rm(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
  `),Zx=["#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
  `),ey=["#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
  `),ty=["#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 Ut(e){return fe(e)||Oe(e)}function _m(e){let t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function Cm(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 ji(e,t=Qx){let n=Cm(e,Jx,e.VERTEX_SHADER),r=Cm(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 Vi(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 ny(e,t){let n=ji(e,Zx);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 ry(e,t){let n=ji(e,ey);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 iy(e,t){let n=ji(e,ty);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 br(e,t=e.UNSIGNED_BYTE,n=e.LINEAR){let r=Vi(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 qi(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 xs(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 Rm(e,t,n){t&&e.deleteProgram(t);for(let r of n)r&&e.deleteTexture(r)}function As(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});if(!t)return null;let n=ji(t),r=Vi(t),i=Vi(t,t.NEAREST),o=Vi(t,t.NEAREST);if(!n||!r||!i||!o)return Rm(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:xs(t,n,yi),detailUniforms:xs(t,n,da),effectUniforms:xs(t,n,ma),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")}}):(Rm(t,n,[r,i,o]),null)}function oy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ay(e){if(!oy(e))return{...fn};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,fn.position,0,1),softness:t(e.softness,fn.softness,0,.25),lineWidth:t(e.lineWidth,fn.lineWidth,0,12)}}function Im(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 Ki(e){return e instanceof Error?e.message:"LUT failed to load"}function sy(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 Pm(e){let t=e.id||e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return sy(t)}function Es(e){let t=Im(e);if("error"in t)return{state:"error",message:t.error};let n=mt.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=>qu(o,{maxSize:hi})),i={state:"pending",promise:r};for(;mt.size>=zx;){let o=mt.keys().next().value;if(!o)break;mt.delete(o)}return mt.set(t.href,i),r.then(o=>{mt.get(t.href)===i&&mt.set(t.href,{state:"ready",lut:o})},o=>{mt.get(t.href)===i&&mt.set(t.href,{state:"error",message:Ki(o)})}),i}function Tm(e,t,n){if(e.lut?.src===t)return e.lut;let r=na(n),{gl:i,program:o}=e;try{return Om(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=Ki(a),e.lutLoadingSrc=null,L("runtime.colorGrading.uploadLut",a),null}}async function ly(e){let t=Es(e);if(t.state==="ready")return t.lut;if(t.state==="pending")return t.promise;throw new Error(t.message)}function Om(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 uy(e,t,n){let r=na(n),{gl:i,program:o}=e;return Om(i,o.lutTexture,r),{src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height}}function nt(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function ws(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),nt(e.gl,t.scratch),nt(e.gl,t.blur),t.bloom&&nt(e.gl,t.bloom),e.effectTargets=null)}function _s(e){let t=e.kuwaharaTargets;t&&(e.gl.deleteProgram(t.horizontalProgram.program),e.gl.deleteProgram(t.resolveProgram.program),nt(e.gl,t.moments),nt(e.gl,t.output),e.kuwaharaTargets=null)}function zi(e,t=!1){ws(e),_s(e),cy(e.gl,e.program),t&&e.gl.getExtension("WEBGL_lose_context")?.loseContext()}function cy(e,t){e.deleteTexture(t.texture),e.deleteTexture(t.lutTexture),e.deleteTexture(t.advancedTexture),e.deleteBuffer(t.quad),e.deleteProgram(t.program)}function dy(e){let t=As(e.canvas);return t?(zi(e),e.gl=t.gl,e.program=t.program,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function Ss(e){if(!e.sourceHidden)return;e.element.removeAttribute(qn);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 my(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=ny(t,e.program.quad),r=br(t),i=br(t);return!n||!r||!i?(n&&t.deleteProgram(n.program),r&&nt(t,r),i&&nt(t,i),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:r,blur:i,bloom:null},e.effectTargets)}function fy(e,t){return t.bloom||(t.bloom=br(e.gl),e.effectError=t.bloom?null:"Framebuffer effects unavailable"),t.bloom}function km(e){let t=e.effectTargets;t?.bloom&&(nt(e.gl,t.bloom),t.bloom=null)}function py(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=ry(t,e.program.quad),o=iy(t,e.program.quad),a=br(t,n.HALF_FLOAT_OES,t.NEAREST),l=br(t);return!i||!o||!a||!l?(hy(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 hy(e,t,n,r,i){t&&e.deleteProgram(t.program),n&&e.deleteProgram(n.program),r&&nt(e,r),i&&nt(e,i)}function Gm(e,t,n,r,i){let o=Math.max(1,Math.ceil(r)),a=Math.max(1,Math.ceil(i));return qi(e,t,o,a),qi(e,n,o,a),{width:o,height:a}}function $i(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),xr(e,t)}function gy(e,t,n,r,i,o,a){let l=Gm(e,t.scratch,r,i/2,o/2),s=a/2;$i(e,t.blurProgram,n,t.scratch,l,{x:1,y:0},s,!0,.5),$i(e,t.blurProgram,t.scratch.texture,r,l,{x:0,y:1},s,!0)}function by(e,t,n,r,i,o,a){let l=n;for(let s=0;s<Math.max(1,Math.floor(a));s++)$i(e,t.blurProgram,l,t.scratch,i,{x:1,y:0},o),$i(e,t.blurProgram,t.scratch.texture,r,i,{x:0,y:1},o),l=r.texture}function xr(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 xy(e,t,n,r,i,o,a,l){qi(e,t.moments,i.width,i.height),qi(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),xr(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),xr(e,u)}function yy(e,t,n,r){if(n<=0)return!1;let i=Gm(e.gl,t.scratch,t.blur,r.width,r.height);return by(e.gl,t,e.program.texture,t.blur,i,.75+Math.pow(n,1.35)*32,n>.55?3:2),!0}function vy(e,t,n,r,i,o){if(n<=0)return km(e),null;o||km(e);let a=o?fy(e,t):t.blur;return a?(gy(e.gl,t,e.program.texture,a,i.width,i.height,r),a.texture):null}function Sy(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&&ws(e),{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let l=my(e);if(!l)return{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let s=yy(e,l,o,n),u=vy(e,l,a,t.effects.bloomRadius,n,s);return{blurReady:s,bloomReady:u!==null,blurTexture:l.blur.texture,bloomTexture:u??i.texture}}function Ay(e,t,n,r,i,o,a){let l=t.effects.kuwahara;if(l<=0&&!o)return e.kuwaharaTargets&&a&&_s(e),{kuwaharaReady:!1,kuwaharaTexture:e.program.texture};let s=py(e);return!s||l<=0?{kuwaharaReady:!1,kuwaharaTexture:s?.output.texture??e.program.texture}:(xy(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 Hm(e,t,n,r,i={}){let o=i.releaseIdleTargets??!0;e.effectError=null;let a=Sy(e,t,n,o),l=Ay(e,t,n,r,a.blurReady,i.preserveKuwahara??!1,o);return{...a,...l}}function Ey(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=Im(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=Es(t);return i.state==="ready"?Tm(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||(Tm(e,r.href,o),We(e))},o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=Ki(o),e.lutLoadingSrc=null,We(e))})),null)}function hr(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&&Ut(n))return n;try{let r=document.querySelector(t);return r&&Ut(r)?r:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&Ut(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&Ut(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&&Ut(r)?r:null}catch{return null}}function Bm(e){return fe(e)?e.videoWidth>0&&e.videoHeight>0?{width:e.videoWidth,height:e.videoHeight}:null:Oe(e)&&e.naturalWidth>0&&e.naturalHeight>0?{width:e.naturalWidth,height:e.naturalHeight}:null}function Um(e){return fe(e)?e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&e.videoWidth>0&&e.videoHeight>0:Oe(e)?e.complete&&e.naturalWidth>0&&e.naturalHeight>0:!1}function Wm(e){let t=bt(e);return t&&Um(t)?t:null}function Mm(e){if(!fe(e))return!1;let t=Wm(e);if(!t)return!1;let n=window.getComputedStyle(t);return n.display!=="none"&&n.visibility!=="hidden"}function wy(e){return Oe(e)&&e.classList.contains("__render_frame__")}function _y(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}function Vm(e){if(fe(e)){let t=Wm(e);if(t)return t}return Um(e)?e:null}function Fm(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 Cy(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=Fm(o,"x"),l=Fm(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 zm(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 m=a==="cover"?Math.max(e/n,t/r):Math.min(e/n,t/r);l=n*m,s=r*m,a==="scale-down"&&l>n&&s>r&&(l=n,s=r)}else a==="none"&&(l=n,s=r);let u=Cy(o||"center"),d=(e-l)*u.x/e,f=(t-s)*u.y/t;return{scaleX:l/e,scaleY:s/t,offsetX:d,offsetY:f}}function Ry(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function Nm(e,t){return Math.max(0,Math.round(e>0?e:t))}function Ty(e,t){let{element:n,canvas:r}=e,i=n.parentElement;i&&Ry(e,i);let o=window.getComputedStyle(t);bc(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=Nm(n.offsetWidth,a.width),s=Nm(n.offsetHeight,a.height);if(l<=0||s<=0)return r.style.display="none",null;let u=Math.max(1,window.devicePixelRatio||1),d=Math.round(l*u),f=Math.round(s*u);return r.width!==d&&(r.width=d),r.height!==f&&(r.height=f),{width:d,height:f}}function mn(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 Wt(e,t,n,r){e.set(r,(t*Ze+n)*4)}function Ct(e,t){return Math.min(1,Math.max(1/255,(e*(127/t)+128)/255))}function ys(e,t,n){return e.length>=3?ia(e,t,n):new Float32Array(Ze)}function Bt(e,t){return e[t]??0}function ky(e,t,n){let r=tn(t.red),i=tn(t.green),o=tn(t.blue),a=tn(t.master),l=ys(n.hueVsHue,-180,180),s=ys(n.hueVsSaturation,-1,1),u=ys(n.hueVsLuma,-1,1);for(let d=0;d<Ze;d+=1)Wt(e,0,d,[Bt(r,d),Bt(i,d),Bt(o,d),Bt(a,d)]),Wt(e,1,d,[Ct(Bt(l,d),180),Ct(Bt(s,d),1),Ct(Bt(u,d),1),1])}function My(e,t,n){let r=n*Kx;Wt(e,2,r,[t.key.hue.center/360,t.key.hue.range/180,t.key.hue.softness/180,1]),Wt(e,2,r+1,[t.key.saturation.min,t.key.saturation.max,t.key.saturation.softness/.5,0]),Wt(e,2,r+2,[t.key.luma.min,t.key.luma.max,t.key.luma.softness/.5,0]),Wt(e,2,r+3,[Ct(t.correction.hueShift,180),Ct(t.correction.saturation,1),Ct(t.correction.luma,1),Ct(t.correction.temperature,1)]),Wt(e,2,r+4,[Ct(t.correction.tint,1),.5,.5,1])}function Fy(e,t,n){let r=new Float32Array(Ze*vr*4);ky(r,e,t);let i=0;for(let o of n)o.enabled&&(My(r,o,i),i+=1);return r}var Lm=new WeakMap;function Ny(e,t,n){let r=Lm.get(e);if(r?.hueCurves===t&&r.secondaries===n)return r.signature;let i=JSON.stringify([e,t,n]);return Lm.set(e,{hueCurves:t,secondaries:n,signature:i}),i}function Ly(e,t,n,r){let{curves:i,hueCurves:o}=n,a=Ny(i,o,r);if(t.advancedSignature===a)return;let l=Uint8Array.from(Fy(i,o,r),Wn);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,Ze,vr,0,e.RGBA,e.UNSIGNED_BYTE,l),t.advancedSignature=a}function vs(e,t,n){e.uniform3f(t,n.hue/360,n.amount,n.level)}function qm(e,t,n,r,i,o,a,l,s,u,d,f){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:m,hueCurves:h,secondaries:b}=n,v=ha(m),x=ga(h),_=ba(b)?b.reduce((F,D)=>F+Number(D.enabled),0):0;(v||x||_>0)&&Ly(e,t,n,b),vs(e,t.shadowWheel,n.wheels.shadows),vs(e,t.midtoneWheel,n.wheels.midtones),vs(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[F,D]of t.adjustUniforms)e.uniform1f(D,n.adjust[F]);for(let[F,D]of t.detailUniforms)e.uniform1f(D,n.details[F]);e.uniform1f(t.grainSeed,d),e.uniform1f(t.effectTime,f);for(let[F,D]of t.effectUniforms)e.uniform1f(D,n.effects[F]);let T=n.palette??(n.effects.engraving>0||n.effects.crosshatch>0?$x:gs),C=T[T.length-1]??gs[1];e.uniform1f(t.paletteSize,T.length),mn(e,t.palette0,T[0]??gs[0]),mn(e,t.palette1,T[1]??C),mn(e,t.palette2,T[2]??C),mn(e,t.palette3,T[3]??C),mn(e,t.palette4,T[4]??C),mn(e,t.palette5,T[5]??C),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 Dy(e){if(!e.sourceHidden){let t=e.element.getAttribute(xi);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(qn,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function ft(e){let t=dc.find(n=>n.path===e);if(!t)throw new Error(`Missing color-grading animation property: ${e}`);return t}var $m=ft("intensity"),jm=ft("lut.intensity"),Km=ft("adjust.exposure"),Ym=ft("effects.kuwahara"),Xm=[["blur",ft("effects.blur")],["bloom",ft("effects.bloom")],["kuwahara",Ym],["pixelate",ft("effects.pixelate")],["ascii",ft("effects.ascii")],["dither",ft("effects.dither")]],Jm=[$m,jm,Km,...Xm.map(([,e])=>e)];function Vt(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 gr(e,t){return t!==null&&(hc(t)||Jm.some(n=>Vt(e,n)!==null))}function Iy(e,t){let n=null;for(let[r,i]of Xm){let o=Vt(e,i);o!==null&&(n??(n={...t.effects}),n[r]=o)}return n}function Py(e){let{element:t,grading:n}=e,r=Vt(t,$m),i=Vt(t,jm),o=Vt(t,Km),a=Iy(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 Qm(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 Zm(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 We(e){if(e.destroyed||e.contextLost)return!1;let t=Vm(e.element);if(!t)return e.hasDrawn||(e.canvas.style.display="none"),!1;let n=Bm(t);if(!n)return!1;let r=Se(t)?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=wy(t);s&&_y(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 d=Ty(e,r);if(!d)return!1;let f=window.getComputedStyle(r),m=zm(d.width,d.height,n.width,n.height,f.objectFit,f.objectPosition),{gl:h,program:b}=e;try{let v=Py(e),x=Ey(e);Qm(h,b.texture,t);let _=Vt(e.element,Ym)!==null,T=Hm(e,v,d,m,{preserveKuwahara:_});h.bindFramebuffer(h.FRAMEBUFFER,null),h.viewport(0,0,d.width,d.height),h.useProgram(b.program),Zm(h,b,T);let C=window.__player?.getTime?.(),F=typeof C=="number"&&Number.isFinite(C)?Math.max(0,C):fe(e.element)?Math.max(0,e.element.currentTime):0,D=e.grainSeed+Math.floor(F*60);return qm(h,b,v,x,T.blurReady,T.bloomReady,T.kuwaharaReady,e.compare,d,m,D,F),xr(h,b),Dy(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 Oy(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 Gy(){let e=document.createElement("canvas"),t=As(e);return t?{canvas:e,...t,lut:null,effectTargets:null,kuwaharaTargets:null,effectError:null}:null}function Hy(e,t){let n=t?void 0:window.__player?.getTime?.();return typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):fe(e)?Math.max(0,e.currentTime):0}function By(e,t,n,r){let i=Vm(t);if(!i)return null;let o=Bm(i);if(!o)return null;let a=Oy(t,o,n);e.canvas.width=a.width,e.canvas.height=a.height;let l=Se(i)?i:t,s=window.getComputedStyle(l),u=zm(a.width,a.height,o.width,o.height,s.objectFit,s.objectPosition);return Qm(e.gl,e.program.texture,i),{dimensions:a,uv:u,effectTime:Hy(t,r),grainSeed:Pm(t)+(fe(t)?Math.floor(t.currentTime*60):0)}}async function Uy(e,t,n,r,i=!1){let o=By(e,t,r,i);if(!o)return null;let{dimensions:a,uv:l,grainSeed:s,effectTime:u}=o,d=[];for(let f of n.slice(0,32)){let m=vi(f.grading);if(!m){d.push({id:f.id,dataUrl:null,error:"Invalid grading"});continue}let h=null;try{m.lut&&(e.lut?.src!==m.lut.src&&(e.lut=uy(e,m.lut.src,await ly(m.lut.src))),h=e.lut),d.push({id:f.id,dataUrl:Wy(e,m,h,a,l,s,u)})}catch(b){d.push({id:f.id,dataUrl:null,error:Ki(b)})}}return{...a,images:d}}function Wy(e,t,n,r,i,o,a){let{canvas:l,gl:s,program:u}=e,d=Hm(e,t,r,i,{releaseIdleTargets:!1});return s.bindFramebuffer(s.FRAMEBUFFER,null),s.viewport(0,0,r.width,r.height),s.useProgram(u.program),Zm(s,u,d),n||(e.lut=null),qm(s,u,t,n,d.blurReady,d.bloomReady,d.kuwaharaReady,fn,r,i,o,a),xr(s,u),l.toDataURL("image/png")}function tt(e,t,n,r){t.addEventListener(n,r),e.cleanup.push(()=>t.removeEventListener(n,r))}function Vy(e){e.animationFrame!==null&&(window.cancelAnimationFrame(e.animationFrame),e.animationFrame=null),e.videoFrameHandle!==null&&fe(e.element)&&(e.element.cancelVideoFrameCallback?.(e.videoFrameHandle),e.videoFrameHandle=null)}function yr(e){if(e.destroyed||!fe(e.element)||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,We(e),!e.destroyed&&!t.paused&&!t.ended&&yr(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,We(e),!e.destroyed&&!t.paused&&!t.ended&&yr(e)})}function zy(e){let t=()=>{We(e)};if(tt(e,e.element,"load",t),tt(e,e.element,"loadedmetadata",t),tt(e,e.element,"loadeddata",t),tt(e,e.element,"seeked",t),tt(e,e.element,"timeupdate",t),tt(e,window,"resize",t),fe(e.element)&&(tt(e,e.element,"play",()=>yr(e)),tt(e,e.element,"pause",t)),tt(e,e.canvas,"webglcontextlost",n=>{n.preventDefault(),e.contextLost=!0,e.drawError="WebGL context lost",e.canvas.style.display="none",Ss(e)}),tt(e,e.canvas,"webglcontextrestored",()=>{if(e.contextLost=!1,!dy(e)){e.contextLost=!0,e.drawError="WebGL context restore failed",Ss(e);return}e.drawError=null,We(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(),We(e)}))});o.observe(e.element,{attributes:!0,attributeFilter:["style"]}),e.cleanup.push(()=>o.disconnect())}}function qy(e){if(e.destroyed)return null;e.destroyed=!0,Vy(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();return e.cleanup.length=0,e.canvas.remove(),ws(e),_s(e),Ss(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 ef(e,t){return e.removeAttribute("style"),t.id?e.id=`${ac}${t.id}`:e.removeAttribute("id"),e.className=Vx,e.setAttribute(Wx,"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 $y(e){return ef(document.createElement("canvas"),e)}function tf(e){let t=new WeakMap,n=new Set,r=[],i=null,o=null,a=Promise.resolve(),l=!1,s=(S,A,w)=>{let R=t.get(S);if(R)return R.grading=A,R.source=w,We(R),fe(S)&&!S.paused&&yr(R),!0;let I=r.pop();if(I)ef(I.canvas,S);else{let j=$y(S),X=As(j);if(!X)return j.remove(),!1;I={canvas:j,gl:X.gl,program:X.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}let H={element:S,...I,grading:A,compare:{...fn},lut:null,lutLoadingSrc:null,lutError:null,drawError:null,effectTargets:null,kuwaharaTargets:null,effectError:null,source:w,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(S).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(S).visibility!=="hidden",hasDrawn:!1,contextLost:!1,grainSeed:Pm(S),destroyed:!1};return t.set(S,H),n.add(S),zy(H),We(H),fe(S)&&!S.paused&&yr(H),!0},u=(S,A)=>{if(l)return!1;let w=hr(S);if(!w)return!1;let R=t.get(w);if(!R){let I=Wi(w);if(!gr(w,I)||!s(w,I,"attribute"))return!1;R=t.get(w)}return R?(R.compare=ay(A),We(R),!0):!1},d=S=>{let A=t.get(S);if(!A)return;let w=qy(A);w&&(A.contextLost||r.length>=qx?zi(w,!0):r.push(w)),t.delete(S),n.delete(S)},f=()=>{if(l)return 0;let S=new Set;document.querySelectorAll(`video[${zn}], img[${zn}]`).forEach(w=>{if(!Ut(w))return;S.add(w);let R=Wi(w);gr(w,R)&&(_m(w)||Mm(w))?s(w,R,"attribute"):d(w)});for(let w of n){let R=t.get(w);R&&(!w.isConnected||R.source==="attribute"&&!S.has(w))&&d(w)}return n.size},m=()=>{if(l)return 0;let S=0;for(let A of n){let w=t.get(A);w&&We(w)&&(S+=1)}return S},h=async()=>{let S=new Set;for(let A of n){let w=t.get(A)?.grading.lut;if(!w?.src.trim()||(w.intensity??1)<=0)continue;let R=Es(w.src);R.state==="pending"&&S.add(R.promise)}return S.size>0&&await Promise.allSettled(S),m(),S.size},b=()=>{if(l)return 0;let S=0;for(let A of n){let w=t.get(A);!w||!Jm.some(I=>Vt(A,I)!==null)||fe(A)&&!A.paused&&!A.ended||We(w)&&(S+=1)}return S},v=(S,A)=>{if(l)return!1;let w=hr(S);if(!w)return!1;let R=vi(A);return gr(w,R)?s(w,R,"live"):(d(w),!0)},x=(S,A)=>{if(!Ut(S))return!1;let w=t.get(S);if(!w){if(!A)return!1;let R=Wi(S);return gr(S,R)&&s(S,R,"attribute")}return w.sourceVisibleForCanvas=A,!A&&w.source==="attribute"&&d(S),!0},_=S=>{let A=hr(S);if(!A)return{state:"missing",message:"Media not found"};let w=t.get(A);if(w)return w.effectError?{state:"unavailable",message:w.effectError}:w.drawError?{state:"unavailable",message:w.drawError}:w.lutError?{state:"unavailable",message:`LUT error: ${w.lutError}`}:w.grading.lut&&w.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:w.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:w.lut?"Shader + LUT active":"Shader active"};let R=Wi(A);return gr(A,R)?!_m(A)&&!Mm(A)?{state:"pending",message:"Waiting for visible media"}:{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},T=async(S,A,w)=>{let R=async()=>{if(l||A.length===0)return null;let H=hr(S);return!H||(o??(o=Gy()),!o)?null:Uy(o,H,A,w?.maxDimension,w?.useMediaTime)},I=a.then(R,R);return a=I.then(()=>{},()=>{}),I},C=S=>{let A=hr(S);if(!fe(A))return null;if(!A.paused)return()=>{};let w=A.currentTime,R=A.loop,I=A.muted;return A.loop=!0,A.muted=!0,(A.ended||Number.isFinite(A.duration)&&w>=A.duration)&&(A.currentTime=0),e?.lease(A),A.play().catch(()=>{}),()=>{e?.release(A),A.pause(),A.loop=R,A.muted=I,A.currentTime=w}},F=()=>{if(!l){l=!0,i?.disconnect(),i=null;for(let S of n)d(S);for(let S of r)zi(S,!0);r.length=0,o&&(zi(o,!0),o=null)}};document.body&&(i=new MutationObserver(()=>f()),i.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[zn]}));let D={refresh:f,redraw:m,redrawAnimated:b,waitForActiveLuts:h,setGrading:v,setCompare:u,setSourceVisibility:x,getStatus:_,renderPreviews:T,startPreviewPlayback:C,destroy:F},M=window;return M.__hf=M.__hf||{},M.__hf.colorGrading=D,f(),D}var Yi=class{constructor(t){ye(this,"_baseTime",0);ye(this,"_playStartMs",null);ye(this,"_rate",1);ye(this,"_duration",1/0);ye(this,"_nowMs");ye(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 jy=100,Ky=8,Yy=4096,Cs=e=>e;function Xy(e,t,n){return!(!!e.curve||e.viaX!==void 0&&e.viaY!==void 0)&&t==="linear"&&!n}function Jy(e){let t=Math.ceil(e*jy);return Math.min(Yy,Math.max(Ky,t))}function Qy(e,t,n,r,i){let{scheduledAt:o,elapsed:a,rate:l}=r,s=i??Cs,u=T=>o+(T-a)/l,d=e.points[t],f=e.points[t+1],m=u(f.t);if(m<=o)return null;let h=Math.max(o,u(d.t)),b=m-h;if(b<=0)return null;if(Xy(d,n,i))return{kind:"ramp",time:m,value:s(f.v)};let v=Jy(b),x=Mu(e,Math.max(d.t,a),f.t,v,n),_=new Float32Array(v);for(let T=0;T<v;T+=1)_[T]=s(x[T]??0);return{kind:"curve",time:h,duration:b,values:_}}function Zy(e,t,n,r){let i=[];for(let a=0;a+1<e.points.length;a+=1){let l=Qy(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??Cs)(Hn(e,n.elapsed,t))}),i}function ev(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 Sr(e){for(let t of e)t.param.cancelScheduledValues(0)}function pn(e,t){for(let n of e)typeof n.param.cancelAndHoldAtTime=="function"?n.param.cancelAndHoldAtTime(t):n.param.cancelScheduledValues(t)}function Rs(e,t,n,r){if(t.points.length!==0)for(let i of e){if(Sr([i]),ku(t)){let o=(i.map??Cs)(t.points[0].v);i.param.setValueAtTime(o,r.scheduledAt);continue}ev(i.param,Zy(t,n,r,i.map))}}function nf(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=Gn(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 d=zo(l.target,t);d&&(Rs(u,l,d.scale,r),a.push(...u))}return a}function rf(e){return e.lanes.find(t=>t.target===Qt)??null}var tv=`
368
+ `);function Ut(e){return fe(e)||Oe(e)}function _m(e){let t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function Cm(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 ji(e,t=Qx){let n=Cm(e,Jx,e.VERTEX_SHADER),r=Cm(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 Vi(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 ny(e,t){let n=ji(e,Zx);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 ry(e,t){let n=ji(e,ey);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 iy(e,t){let n=ji(e,ty);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 br(e,t=e.UNSIGNED_BYTE,n=e.LINEAR){let r=Vi(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 qi(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 xs(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 Rm(e,t,n){t&&e.deleteProgram(t);for(let r of n)r&&e.deleteTexture(r)}function As(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});if(!t)return null;let n=ji(t),r=Vi(t),i=Vi(t,t.NEAREST),o=Vi(t,t.NEAREST);if(!n||!r||!i||!o)return Rm(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:xs(t,n,yi),detailUniforms:xs(t,n,da),effectUniforms:xs(t,n,ma),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")}}):(Rm(t,n,[r,i,o]),null)}function oy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ay(e){if(!oy(e))return{...fn};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,fn.position,0,1),softness:t(e.softness,fn.softness,0,.25),lineWidth:t(e.lineWidth,fn.lineWidth,0,12)}}function Im(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 Ki(e){return e instanceof Error?e.message:"LUT failed to load"}function sy(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 Pm(e){let t=e.id||e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return sy(t)}function Es(e){let t=Im(e);if("error"in t)return{state:"error",message:t.error};let n=mt.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=>qu(o,{maxSize:hi})),i={state:"pending",promise:r};for(;mt.size>=zx;){let o=mt.keys().next().value;if(!o)break;mt.delete(o)}return mt.set(t.href,i),r.then(o=>{mt.get(t.href)===i&&mt.set(t.href,{state:"ready",lut:o})},o=>{mt.get(t.href)===i&&mt.set(t.href,{state:"error",message:Ki(o)})}),i}function Tm(e,t,n){if(e.lut?.src===t)return e.lut;let r=na(n),{gl:i,program:o}=e;try{return Om(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=Ki(a),e.lutLoadingSrc=null,L("runtime.colorGrading.uploadLut",a),null}}async function ly(e){let t=Es(e);if(t.state==="ready")return t.lut;if(t.state==="pending")return t.promise;throw new Error(t.message)}function Om(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 uy(e,t,n){let r=na(n),{gl:i,program:o}=e;return Om(i,o.lutTexture,r),{src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height}}function nt(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function ws(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),nt(e.gl,t.scratch),nt(e.gl,t.blur),t.bloom&&nt(e.gl,t.bloom),e.effectTargets=null)}function _s(e){let t=e.kuwaharaTargets;t&&(e.gl.deleteProgram(t.horizontalProgram.program),e.gl.deleteProgram(t.resolveProgram.program),nt(e.gl,t.moments),nt(e.gl,t.output),e.kuwaharaTargets=null)}function zi(e,t=!1){ws(e),_s(e),cy(e.gl,e.program),t&&e.gl.getExtension("WEBGL_lose_context")?.loseContext()}function cy(e,t){e.deleteTexture(t.texture),e.deleteTexture(t.lutTexture),e.deleteTexture(t.advancedTexture),e.deleteBuffer(t.quad),e.deleteProgram(t.program)}function dy(e){let t=As(e.canvas);return t?(zi(e),e.gl=t.gl,e.program=t.program,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function Ss(e){if(!e.sourceHidden)return;e.element.removeAttribute(qn);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 my(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=ny(t,e.program.quad),r=br(t),i=br(t);return!n||!r||!i?(n&&t.deleteProgram(n.program),r&&nt(t,r),i&&nt(t,i),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:r,blur:i,bloom:null},e.effectTargets)}function fy(e,t){return t.bloom||(t.bloom=br(e.gl),e.effectError=t.bloom?null:"Framebuffer effects unavailable"),t.bloom}function km(e){let t=e.effectTargets;t?.bloom&&(nt(e.gl,t.bloom),t.bloom=null)}function py(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=ry(t,e.program.quad),o=iy(t,e.program.quad),a=br(t,n.HALF_FLOAT_OES,t.NEAREST),l=br(t);return!i||!o||!a||!l?(hy(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 hy(e,t,n,r,i){t&&e.deleteProgram(t.program),n&&e.deleteProgram(n.program),r&&nt(e,r),i&&nt(e,i)}function Gm(e,t,n,r,i){let o=Math.max(1,Math.ceil(r)),a=Math.max(1,Math.ceil(i));return qi(e,t,o,a),qi(e,n,o,a),{width:o,height:a}}function $i(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),xr(e,t)}function gy(e,t,n,r,i,o,a){let l=Gm(e,t.scratch,r,i/2,o/2),s=a/2;$i(e,t.blurProgram,n,t.scratch,l,{x:1,y:0},s,!0,.5),$i(e,t.blurProgram,t.scratch.texture,r,l,{x:0,y:1},s,!0)}function by(e,t,n,r,i,o,a){let l=n;for(let s=0;s<Math.max(1,Math.floor(a));s++)$i(e,t.blurProgram,l,t.scratch,i,{x:1,y:0},o),$i(e,t.blurProgram,t.scratch.texture,r,i,{x:0,y:1},o),l=r.texture}function xr(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 xy(e,t,n,r,i,o,a,l){qi(e,t.moments,i.width,i.height),qi(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),xr(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),xr(e,u)}function yy(e,t,n,r){if(n<=0)return!1;let i=Gm(e.gl,t.scratch,t.blur,r.width,r.height);return by(e.gl,t,e.program.texture,t.blur,i,.75+Math.pow(n,1.35)*32,n>.55?3:2),!0}function vy(e,t,n,r,i,o){if(n<=0)return km(e),null;o||km(e);let a=o?fy(e,t):t.blur;return a?(gy(e.gl,t,e.program.texture,a,i.width,i.height,r),a.texture):null}function Sy(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&&ws(e),{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let l=my(e);if(!l)return{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let s=yy(e,l,o,n),u=vy(e,l,a,t.effects.bloomRadius,n,s);return{blurReady:s,bloomReady:u!==null,blurTexture:l.blur.texture,bloomTexture:u??i.texture}}function Ay(e,t,n,r,i,o,a){let l=t.effects.kuwahara;if(l<=0&&!o)return e.kuwaharaTargets&&a&&_s(e),{kuwaharaReady:!1,kuwaharaTexture:e.program.texture};let s=py(e);return!s||l<=0?{kuwaharaReady:!1,kuwaharaTexture:s?.output.texture??e.program.texture}:(xy(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 Hm(e,t,n,r,i={}){let o=i.releaseIdleTargets??!0;e.effectError=null;let a=Sy(e,t,n,o),l=Ay(e,t,n,r,a.blurReady,i.preserveKuwahara??!1,o);return{...a,...l}}function Ey(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=Im(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=Es(t);return i.state==="ready"?Tm(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||(Tm(e,r.href,o),We(e))},o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=Ki(o),e.lutLoadingSrc=null,We(e))})),null)}function hr(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&&Ut(n))return n;try{let r=document.querySelector(t);return r&&Ut(r)?r:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&Ut(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&Ut(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&&Ut(r)?r:null}catch{return null}}function Bm(e){return fe(e)?e.videoWidth>0&&e.videoHeight>0?{width:e.videoWidth,height:e.videoHeight}:null:Oe(e)&&e.naturalWidth>0&&e.naturalHeight>0?{width:e.naturalWidth,height:e.naturalHeight}:null}function Um(e){return fe(e)?e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&e.videoWidth>0&&e.videoHeight>0:Oe(e)?e.complete&&e.naturalWidth>0&&e.naturalHeight>0:!1}function Wm(e){let t=bt(e);return t&&Um(t)?t:null}function Mm(e){if(!fe(e))return!1;let t=Wm(e);if(!t)return!1;let n=window.getComputedStyle(t);return n.display!=="none"&&n.visibility!=="hidden"}function wy(e){return Oe(e)&&e.classList.contains("__render_frame__")}function _y(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}function Vm(e){if(fe(e)){let t=Wm(e);if(t)return t}return Um(e)?e:null}function Fm(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 Cy(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=Fm(o,"x"),l=Fm(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 zm(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 m=a==="cover"?Math.max(e/n,t/r):Math.min(e/n,t/r);l=n*m,s=r*m,a==="scale-down"&&l>n&&s>r&&(l=n,s=r)}else a==="none"&&(l=n,s=r);let u=Cy(o||"center"),d=(e-l)*u.x/e,f=(t-s)*u.y/t;return{scaleX:l/e,scaleY:s/t,offsetX:d,offsetY:f}}function Ry(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function Nm(e,t){return Math.max(0,Math.round(e>0?e:t))}function Ty(e,t){let{element:n,canvas:r}=e,i=n.parentElement;i&&Ry(e,i);let o=window.getComputedStyle(t);bc(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=Nm(n.offsetWidth,a.width),s=Nm(n.offsetHeight,a.height);if(l<=0||s<=0)return r.style.display="none",null;let u=Math.max(1,window.devicePixelRatio||1),d=Math.round(l*u),f=Math.round(s*u);return r.width!==d&&(r.width=d),r.height!==f&&(r.height=f),{width:d,height:f}}function mn(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 Wt(e,t,n,r){e.set(r,(t*Ze+n)*4)}function Ct(e,t){return Math.min(1,Math.max(1/255,(e*(127/t)+128)/255))}function ys(e,t,n){return e.length>=3?ia(e,t,n):new Float32Array(Ze)}function Bt(e,t){return e[t]??0}function ky(e,t,n){let r=tn(t.red),i=tn(t.green),o=tn(t.blue),a=tn(t.master),l=ys(n.hueVsHue,-180,180),s=ys(n.hueVsSaturation,-1,1),u=ys(n.hueVsLuma,-1,1);for(let d=0;d<Ze;d+=1)Wt(e,0,d,[Bt(r,d),Bt(i,d),Bt(o,d),Bt(a,d)]),Wt(e,1,d,[Ct(Bt(l,d),180),Ct(Bt(s,d),1),Ct(Bt(u,d),1),1])}function My(e,t,n){let r=n*Kx;Wt(e,2,r,[t.key.hue.center/360,t.key.hue.range/180,t.key.hue.softness/180,1]),Wt(e,2,r+1,[t.key.saturation.min,t.key.saturation.max,t.key.saturation.softness/.5,0]),Wt(e,2,r+2,[t.key.luma.min,t.key.luma.max,t.key.luma.softness/.5,0]),Wt(e,2,r+3,[Ct(t.correction.hueShift,180),Ct(t.correction.saturation,1),Ct(t.correction.luma,1),Ct(t.correction.temperature,1)]),Wt(e,2,r+4,[Ct(t.correction.tint,1),.5,.5,1])}function Fy(e,t,n){let r=new Float32Array(Ze*vr*4);ky(r,e,t);let i=0;for(let o of n)o.enabled&&(My(r,o,i),i+=1);return r}var Lm=new WeakMap;function Ny(e,t,n){let r=Lm.get(e);if(r?.hueCurves===t&&r.secondaries===n)return r.signature;let i=JSON.stringify([e,t,n]);return Lm.set(e,{hueCurves:t,secondaries:n,signature:i}),i}function Ly(e,t,n,r){let{curves:i,hueCurves:o}=n,a=Ny(i,o,r);if(t.advancedSignature===a)return;let l=Uint8Array.from(Fy(i,o,r),Wn);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,Ze,vr,0,e.RGBA,e.UNSIGNED_BYTE,l),t.advancedSignature=a}function vs(e,t,n){e.uniform3f(t,n.hue/360,n.amount,n.level)}function qm(e,t,n,r,i,o,a,l,s,u,d,f){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:m,hueCurves:h,secondaries:b}=n,v=ha(m),x=ga(h),_=ba(b)?b.reduce((F,D)=>F+Number(D.enabled),0):0;(v||x||_>0)&&Ly(e,t,n,b),vs(e,t.shadowWheel,n.wheels.shadows),vs(e,t.midtoneWheel,n.wheels.midtones),vs(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[F,D]of t.adjustUniforms)e.uniform1f(D,n.adjust[F]);for(let[F,D]of t.detailUniforms)e.uniform1f(D,n.details[F]);e.uniform1f(t.grainSeed,d),e.uniform1f(t.effectTime,f);for(let[F,D]of t.effectUniforms)e.uniform1f(D,n.effects[F]);let T=n.palette??(n.effects.engraving>0||n.effects.crosshatch>0?$x:gs),C=T[T.length-1]??gs[1];e.uniform1f(t.paletteSize,T.length),mn(e,t.palette0,T[0]??gs[0]),mn(e,t.palette1,T[1]??C),mn(e,t.palette2,T[2]??C),mn(e,t.palette3,T[3]??C),mn(e,t.palette4,T[4]??C),mn(e,t.palette5,T[5]??C),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 Dy(e){if(!e.sourceHidden){let t=e.element.getAttribute(xi);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(qn,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function ft(e){let t=dc.find(n=>n.path===e);if(!t)throw new Error(`Missing color-grading animation property: ${e}`);return t}var $m=ft("intensity"),jm=ft("lut.intensity"),Km=ft("adjust.exposure"),Ym=ft("effects.kuwahara"),Xm=[["blur",ft("effects.blur")],["bloom",ft("effects.bloom")],["kuwahara",Ym],["pixelate",ft("effects.pixelate")],["ascii",ft("effects.ascii")],["dither",ft("effects.dither")]],Jm=[$m,jm,Km,...Xm.map(([,e])=>e)];function Vt(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 gr(e,t){return t!==null&&(hc(t)||Jm.some(n=>Vt(e,n)!==null))}function Iy(e,t){let n=null;for(let[r,i]of Xm){let o=Vt(e,i);o!==null&&(n??(n={...t.effects}),n[r]=o)}return n}function Py(e){let{element:t,grading:n}=e,r=Vt(t,$m),i=Vt(t,jm),o=Vt(t,Km),a=Iy(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 Qm(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 Zm(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 We(e){if(e.destroyed||e.contextLost)return!1;let t=Vm(e.element);if(!t)return e.hasDrawn||(e.canvas.style.display="none"),!1;let n=Bm(t);if(!n)return!1;let r=Se(t)?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=wy(t);s&&_y(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 d=Ty(e,r);if(!d)return!1;let f=window.getComputedStyle(r),m=zm(d.width,d.height,n.width,n.height,f.objectFit,f.objectPosition),{gl:h,program:b}=e;try{let v=Py(e),x=Ey(e);Qm(h,b.texture,t);let _=Vt(e.element,Ym)!==null,T=Hm(e,v,d,m,{preserveKuwahara:_});h.bindFramebuffer(h.FRAMEBUFFER,null),h.viewport(0,0,d.width,d.height),h.useProgram(b.program),Zm(h,b,T);let C=window.__player?.getTime?.(),F=typeof C=="number"&&Number.isFinite(C)?Math.max(0,C):fe(e.element)?Math.max(0,e.element.currentTime):0,D=e.grainSeed+Math.floor(F*60);return qm(h,b,v,x,T.blurReady,T.bloomReady,T.kuwaharaReady,e.compare,d,m,D,F),xr(h,b),Dy(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 Oy(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 Gy(){let e=document.createElement("canvas"),t=As(e);return t?{canvas:e,...t,lut:null,effectTargets:null,kuwaharaTargets:null,effectError:null}:null}function Hy(e,t){let n=t?void 0:window.__player?.getTime?.();return typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):fe(e)?Math.max(0,e.currentTime):0}function By(e,t,n,r){let i=Vm(t);if(!i)return null;let o=Bm(i);if(!o)return null;let a=Oy(t,o,n);e.canvas.width=a.width,e.canvas.height=a.height;let l=Se(i)?i:t,s=window.getComputedStyle(l),u=zm(a.width,a.height,o.width,o.height,s.objectFit,s.objectPosition);return Qm(e.gl,e.program.texture,i),{dimensions:a,uv:u,effectTime:Hy(t,r),grainSeed:Pm(t)+(fe(t)?Math.floor(t.currentTime*60):0)}}async function Uy(e,t,n,r,i=!1){let o=By(e,t,r,i);if(!o)return null;let{dimensions:a,uv:l,grainSeed:s,effectTime:u}=o,d=[];for(let f of n.slice(0,32)){let m=vi(f.grading);if(!m){d.push({id:f.id,dataUrl:null,error:"Invalid grading"});continue}let h=null;try{m.lut&&(e.lut?.src!==m.lut.src&&(e.lut=uy(e,m.lut.src,await ly(m.lut.src))),h=e.lut),d.push({id:f.id,dataUrl:Wy(e,m,h,a,l,s,u)})}catch(b){d.push({id:f.id,dataUrl:null,error:Ki(b)})}}return{...a,images:d}}function Wy(e,t,n,r,i,o,a){let{canvas:l,gl:s,program:u}=e,d=Hm(e,t,r,i,{releaseIdleTargets:!1});return s.bindFramebuffer(s.FRAMEBUFFER,null),s.viewport(0,0,r.width,r.height),s.useProgram(u.program),Zm(s,u,d),n||(e.lut=null),qm(s,u,t,n,d.blurReady,d.bloomReady,d.kuwaharaReady,fn,r,i,o,a),xr(s,u),l.toDataURL("image/png")}function tt(e,t,n,r){t.addEventListener(n,r),e.cleanup.push(()=>t.removeEventListener(n,r))}function Vy(e){e.animationFrame!==null&&(window.cancelAnimationFrame(e.animationFrame),e.animationFrame=null),e.videoFrameHandle!==null&&fe(e.element)&&(e.element.cancelVideoFrameCallback?.(e.videoFrameHandle),e.videoFrameHandle=null)}function yr(e){if(e.destroyed||!fe(e.element)||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,We(e),!e.destroyed&&!t.paused&&!t.ended&&yr(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,We(e),!e.destroyed&&!t.paused&&!t.ended&&yr(e)})}function zy(e){let t=()=>{We(e)};if(tt(e,e.element,"load",t),tt(e,e.element,"loadedmetadata",t),tt(e,e.element,"loadeddata",t),tt(e,e.element,"seeked",t),tt(e,e.element,"timeupdate",t),tt(e,window,"resize",t),fe(e.element)&&(tt(e,e.element,"play",()=>yr(e)),tt(e,e.element,"pause",t)),tt(e,e.canvas,"webglcontextlost",n=>{n.preventDefault(),e.contextLost=!0,e.drawError="WebGL context lost",e.canvas.style.display="none",Ss(e)}),tt(e,e.canvas,"webglcontextrestored",()=>{if(e.contextLost=!1,!dy(e)){e.contextLost=!0,e.drawError="WebGL context restore failed",Ss(e);return}e.drawError=null,We(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(),We(e)}))});o.observe(e.element,{attributes:!0,attributeFilter:["style"]}),e.cleanup.push(()=>o.disconnect())}}function qy(e){if(e.destroyed)return null;e.destroyed=!0,Vy(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();return e.cleanup.length=0,e.canvas.remove(),ws(e),_s(e),Ss(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 ef(e,t){return e.removeAttribute("style"),t.id?e.id=`${ac}${t.id}`:e.removeAttribute("id"),e.className=Vx,e.setAttribute(Wx,"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 $y(e){return ef(document.createElement("canvas"),e)}function tf(e){let t=new WeakMap,n=new Set,r=[],i=null,o=null,a=Promise.resolve(),l=!1,s=(S,A,w)=>{let R=t.get(S);if(R)return R.grading=A,R.source=w,We(R),fe(S)&&!S.paused&&yr(R),!0;let I=r.pop();if(I)ef(I.canvas,S);else{let j=$y(S),X=As(j);if(!X)return j.remove(),!1;I={canvas:j,gl:X.gl,program:X.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}let H={element:S,...I,grading:A,compare:{...fn},lut:null,lutLoadingSrc:null,lutError:null,drawError:null,effectTargets:null,kuwaharaTargets:null,effectError:null,source:w,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(S).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(S).visibility!=="hidden",hasDrawn:!1,contextLost:!1,grainSeed:Pm(S),destroyed:!1};return t.set(S,H),n.add(S),zy(H),We(H),fe(S)&&!S.paused&&yr(H),!0},u=(S,A)=>{if(l)return!1;let w=hr(S);if(!w)return!1;let R=t.get(w);if(!R){let I=Wi(w);if(!gr(w,I)||!s(w,I,"attribute"))return!1;R=t.get(w)}return R?(R.compare=ay(A),We(R),!0):!1},d=S=>{let A=t.get(S);if(!A)return;let w=qy(A);w&&(A.contextLost||r.length>=qx?zi(w,!0):r.push(w)),t.delete(S),n.delete(S)},f=()=>{if(l)return 0;let S=new Set;document.querySelectorAll(`video[${zn}], img[${zn}]`).forEach(w=>{if(!Ut(w))return;S.add(w);let R=Wi(w);gr(w,R)&&(_m(w)||Mm(w))?s(w,R,"attribute"):d(w)});for(let w of n){let R=t.get(w);R&&(!w.isConnected||R.source==="attribute"&&!S.has(w))&&d(w)}return n.size},m=()=>{if(l)return 0;let S=0;for(let A of n){let w=t.get(A);w&&We(w)&&(S+=1)}return S},h=async()=>{let S=new Set;for(let A of n){let w=t.get(A)?.grading.lut;if(!w?.src.trim()||(w.intensity??1)<=0)continue;let R=Es(w.src);R.state==="pending"&&S.add(R.promise)}return S.size>0&&await Promise.allSettled(S),m(),S.size},b=()=>{if(l)return 0;let S=0;for(let A of n){let w=t.get(A);!w||!Jm.some(I=>Vt(A,I)!==null)||fe(A)&&!A.paused&&!A.ended||We(w)&&(S+=1)}return S},v=(S,A)=>{if(l)return!1;let w=hr(S);if(!w)return!1;let R=vi(A);return gr(w,R)?s(w,R,"live"):(d(w),!0)},x=(S,A)=>{if(!Ut(S))return!1;let w=t.get(S);if(!w){if(!A)return!1;let R=Wi(S);return gr(S,R)&&s(S,R,"attribute")}return w.sourceVisibleForCanvas=A,!A&&w.source==="attribute"&&d(S),!0},_=S=>{let A=hr(S);if(!A)return{state:"missing",message:"Media not found"};let w=t.get(A);if(w)return w.effectError?{state:"unavailable",message:w.effectError}:w.drawError?{state:"unavailable",message:w.drawError}:w.lutError?{state:"unavailable",message:`LUT error: ${w.lutError}`}:w.grading.lut&&w.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:w.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:w.lut?"Shader + LUT active":"Shader active"};let R=Wi(A);return gr(A,R)?!_m(A)&&!Mm(A)?{state:"pending",message:"Waiting for visible media"}:{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},T=async(S,A,w)=>{let R=async()=>{if(l||A.length===0)return null;let H=hr(S);return!H||(o??(o=Gy()),!o)?null:Uy(o,H,A,w?.maxDimension,w?.useMediaTime)},I=a.then(R,R);return a=I.then(()=>{},()=>{}),I},C=S=>{let A=hr(S);if(!fe(A))return null;if(!A.paused)return()=>{};let w=A.currentTime,R=A.loop,I=A.muted;return A.loop=!0,A.muted=!0,(A.ended||Number.isFinite(A.duration)&&w>=A.duration)&&(A.currentTime=0),e?.lease(A),A.play().catch(()=>{}),()=>{e?.release(A),A.pause(),A.loop=R,A.muted=I,A.currentTime=w}},F=()=>{if(!l){l=!0,i?.disconnect(),i=null;for(let S of n)d(S);for(let S of r)zi(S,!0);r.length=0,o&&(zi(o,!0),o=null)}};document.body&&(i=new MutationObserver(()=>f()),i.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[zn]}));let D={refresh:f,redraw:m,redrawAnimated:b,waitForActiveLuts:h,setGrading:v,setCompare:u,setSourceVisibility:x,getStatus:_,renderPreviews:T,startPreviewPlayback:C,destroy:F},M=window;return M.__hf=M.__hf||{},M.__hf.colorGrading=D,f(),D}var Yi=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);ge(this,"_lastReadMs",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 this._lastReadMs=null,Number.isFinite(this._duration)&&r>=this._duration?this._duration:Math.max(0,r)}this._applyStallCorrection();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)}_applyStallCorrection(){if(this._playStartMs===null)return;let t=this._nowMs();if(this._lastReadMs!==null){let n=t-this._lastReadMs;n>500&&(this._playStartMs+=n-33)}this._lastReadMs=t}play(){return this._playStartMs!==null||Number.isFinite(this._duration)&&this._baseTime>=this._duration?!1:(this._playStartMs=this._nowMs(),this._lastReadMs=null,!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(),this._lastReadMs=null)}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._lastReadMs=null),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._lastReadMs=null),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 jy=100,Ky=8,Yy=4096,Cs=e=>e;function Xy(e,t,n){return!(!!e.curve||e.viaX!==void 0&&e.viaY!==void 0)&&t==="linear"&&!n}function Jy(e){let t=Math.ceil(e*jy);return Math.min(Yy,Math.max(Ky,t))}function Qy(e,t,n,r,i){let{scheduledAt:o,elapsed:a,rate:l}=r,s=i??Cs,u=T=>o+(T-a)/l,d=e.points[t],f=e.points[t+1],m=u(f.t);if(m<=o)return null;let h=Math.max(o,u(d.t)),b=m-h;if(b<=0)return null;if(Xy(d,n,i))return{kind:"ramp",time:m,value:s(f.v)};let v=Jy(b),x=Mu(e,Math.max(d.t,a),f.t,v,n),_=new Float32Array(v);for(let T=0;T<v;T+=1)_[T]=s(x[T]??0);return{kind:"curve",time:h,duration:b,values:_}}function Zy(e,t,n,r){let i=[];for(let a=0;a+1<e.points.length;a+=1){let l=Qy(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??Cs)(Hn(e,n.elapsed,t))}),i}function ev(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 Sr(e){for(let t of e)t.param.cancelScheduledValues(0)}function pn(e,t){for(let n of e)typeof n.param.cancelAndHoldAtTime=="function"?n.param.cancelAndHoldAtTime(t):n.param.cancelScheduledValues(t)}function Rs(e,t,n,r){if(t.points.length!==0)for(let i of e){if(Sr([i]),ku(t)){let o=(i.map??Cs)(t.points[0].v);i.param.setValueAtTime(o,r.scheduledAt);continue}ev(i.param,Zy(t,n,r,i.map))}}function nf(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=Gn(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 d=zo(l.target,t);d&&(Rs(u,l,d.scale,r),a.push(...u))}return a}function rf(e){return e.lanes.find(t=>t.target===Qt)??null}var tv=`
369
369
  const dbToLin = (db) => Math.pow(10, db / 20);
370
370
 
371
371
  /**
@@ -701,7 +701,7 @@ class HfPitchshift extends AudioWorkletProcessor {
701
701
  }
702
702
  }
703
703
  registerProcessor("hf-pitchshift", HfPitchshift);
704
- `,Ts=new WeakMap;function ks(e){return of.has(e)}var of=new WeakSet;function Ms(e){let t=Ts.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(tv)))}`;await e.audioWorklet.addModule(n),of.add(e)})().catch(n=>{throw Ts.delete(e),n}),Ts.set(e,t)),t}function nv(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,d=0;for(let m=0;m<i;m++){u+=s*(l()-u);let h=u*Math.pow(1-m/i,2.5);o[m]=h,d+=h*h}let f=Math.sqrt(d);if(f>0)for(let m=0;m<i;m++)o[m]=(o[m]??0)/f;return o}var ue=e=>typeof e=="number"?e:Number(e??0),Fs=e=>e/1e3;function uf(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 d=u/i;a[u]=t==="sine"?Math.sin(2*Math.PI*d):4*Math.abs((d+.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 cf(e){try{e.stop()}catch{}e.disconnect()}function Ns(e,t){return[{param:e},{param:t,map:n=>1-n}]}function df(e,t,n){e.gain.value=n,t.gain.value=1-n}function Ls(e,t,n){return{input:e,output:e,update:t,automation:n,dispose:()=>e.disconnect()}}var rv=new Set(["peaking","highpass","lowpass"]),af=e=>Math.pow(10,e/20),iv=(e,t)=>{let n=e.createGain(),r=i=>{n.gain.value=af(ue(i.gain))};return r(t),Ls(n,r,{gain:[{param:n.gain,map:af}]})};function Ar(e,t){return(n,r)=>{let i=n.createBiquadFilter();i.type=e;let o=a=>{i.frequency.value=ue(a.frequency),a.q!==void 0&&(i.Q.value=ue(a.q)),t&&(i.gain.value=ue(a.gain))};return o(r),Ls(i,o,{frequency:[{param:i.frequency}],...rv.has(e)?{q:[{param:i.Q}]}:{},...t?{gain:[{param:i.gain}]}:{}})}}function ov(e){return(t,n)=>{let r=Math.tan(Math.PI*ue(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 Ls(i,()=>{})}}function Er(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 av={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))},sv=(e,t)=>{let n=e.createWaveShaper(),r=e.createGain(),i=e.createGain();r.connect(n).connect(i);let o=a=>{let l=av[String(a.type)]??Math.tanh,s=Math.pow(10,ue(a.threshold)/20),u=8192,d=new Float32Array(u);for(let f=0;f<u;f++){let m=f/(u-1)*2-1;d[f]=l(m/Math.max(1e-6,s))*s}n.curve=d,n.oversample=ue(a.oversample)>=4?"4x":ue(a.oversample)>=2?"2x":"none",i.gain.value=Math.pow(10,ue(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()}}},lv=(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,ue(u.time)/1e3),o.gain.value=ue(u.feedback),df(a,l,ue(u.mix))};return s(t),{input:n,output:r,update:s,automation:{time:[{param:i.delayTime,map:u=>Math.min(5,Fs(u))}],feedback:[{param:o.gain}],mix:Ns(a.gain,l.gain)},dispose:()=>[n,r,i,o,a,l].forEach(u=>u.disconnect())}},uv=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createDelay(.5),a=uf(e,"sine",ue(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 d=f=>{o.delayTime.value=ue(f.delay)/1e3,l.gain.value=ue(f.depth)/1e3,a.playbackRate.value=ue(f.speed),df(s,u,ue(f.mix))};return d(t),{input:r,output:i,update:d,automation:{delay:[{param:o.delayTime,map:Fs}],depth:[{param:l.gain,map:Fs}],speed:[{param:a.playbackRate}],mix:Ns(s.gain,u.gain)},dispose:()=>{cf(a),[r,i,o,l,s,u].forEach(f=>f.disconnect())}}},cv=6,dv=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createGain(),a=e.createGain(),l=uf(e,String(t.type)==="1"?"sine":"triangle",ue(t.speed),n),s=e.createGain(),u=e.createGain(),d=e.createGain(),f=[];r.connect(o);let m=o;for(let b=0;b<cv;b++){let v=e.createBiquadFilter();v.type="allpass",v.Q.value=.7071,s.connect(v.frequency),m.connect(v),m=v,f.push(v)}l.connect(s),m.connect(u).connect(a),o.connect(d).connect(a),a.connect(i);let h=b=>{let v=1e3/Math.max(.1,ue(b.delay));for(let x of f)x.frequency.value=v;s.gain.value=v*ue(b.decay),l.playbackRate.value=ue(b.speed),o.gain.value=ue(b.in_gain),a.gain.value=ue(b.out_gain),u.gain.value=1,d.gain.value=1};return h(t),{input:r,output:i,update:h,automation:{speed:[{param:l.playbackRate}],in_gain:[{param:o.gain}],out_gain:[{param:a.gain}]},dispose:()=>{cf(l),[r,i,o,a,s,u,d,...f].forEach(b=>b.disconnect())}}},mv=(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 d=`${ue(u.size)}:${ue(u.damping)}`;if(d!==l){let f=nv(e.sampleRate,ue(u.size),ue(u.damping)),m=e.createBuffer(1,f.length,e.sampleRate);m.getChannelData(0).set(f),i.buffer=m,l=d}o.gain.value=ue(u.wet),a.gain.value=ue(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())}},fv={"gain-node":iv,"biquad-peaking":Ar("peaking",!0),"biquad-lowshelf":Ar("lowshelf",!0),"biquad-highshelf":Ar("highshelf",!0),"biquad-highpass":Ar("highpass",!1),"biquad-lowpass":Ar("lowpass",!1),"worklet-compressor":Er("hf-compressor"),"worklet-limiter":Er("hf-limiter"),"worklet-gate":Er("hf-gate"),"worklet-bitcrush":Er("hf-bitcrush"),"worklet-pitchshift":Er("hf-pitchshift"),waveshaper:sv,"delay-feedback":lv,"chorus-lfo":uv,"allpass-phaser":dv,convolver:mv};function mf(e){return e.nodes.some(t=>Dn(t.type)?.web.startsWith("worklet-")??!1)}function pv(e,t,n,r=0){let i=Dn(t);if(!i)throw new Error(`Unknown effect type: ${t}`);let o=In(t,n);if((t==="highpass"||t==="lowpass")&&String(o.poles)==="1")return ov(t)(e,o,r);let a=fv[i.web];if(!a)throw new Error(`No Web Audio builder for ${i.web}`);return a(e,o,r)}function sf(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 lf(e){return Pn(e).map(t=>{let n=In(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 ff(e,t,n=0){var f;let r=e.createGain(),i=e.createGain(),o=[],a=[],l=sf(Pn(t)),s=r;for(let m of l){let h=null;if(m.preset){let b=e.createGain(),v=e.createGain(),x=e.createGain(),_=e.createGain();x.gain.value=m.amount,v.gain.value=1-m.amount,s.connect(b),b.connect(v).connect(_),h={entry:b,wet:x,dry:v,join:_},s=b}for(let b of m.nodes){let v=pv(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})}h&&m.preset&&(s.connect(h.wet).connect(h.join),a.push({id:m.preset,...h}),s=h.join)}s.connect(i);let u=lf(t),d={};for(let m of a)(d[f=m.id]??(d[f]=[])).push(...Ns(m.wet.gain,m.dry.gain));return{input:r,output:i,presets:d,nodes:o,update(m){if(lf(m)!==u)return!1;Pn(m).forEach((b,v)=>{let x=o[v];x&&(x.handle.update(In(b.type,b.params)),b.id===void 0?delete x.id:x.id=b.id)});let h=0;for(let b of sf(Pn(m))){if(!b.preset)continue;let v=a[h++];!v||v.id!==b.preset||(v.wet.gain.value=b.amount,v.dry.gain.value=1-b.amount)}return!0},dispose(){for(let{handle:m}of o)m.dispose();for(let{entry:m,wet:h,dry:b,join:v}of a)m.disconnect(),h.disconnect(),b.disconnect(),v.disconnect();r.disconnect(),i.disconnect()}}}var pf={version:1,nodes:[]},hf={version:1,lanes:[]};function gf(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(ut):null)??"";if(!n)return hf;try{return Tu(ui(n),t)}catch{return hf}}function hn(e){let t=(typeof e.getAttribute=="function"?e.getAttribute(It):null)??"";if(!t)return{chain:pf,raw:""};try{return{chain:_u(t),raw:t}}catch{return{chain:pf,raw:""}}}function bf(e){return gf(e,hn(e).chain)}function Xi(e,t,n,r,i){let{chain:o}=hn(t),a=null,l=[],s=!1,u=0,d=()=>{try{a?(n.disconnect(a.input),a.output.disconnect(r),a.dispose()):n.disconnect(r)}catch{}a=null},f=(C,F)=>{if(C.nodes.length===0){n.connect(r);return}if(mf(C)&&!ks(e)){n.connect(r);let D=++u;Ms(e).then(()=>{s||D!==u||x(hn(t).chain)}).catch(()=>{});return}try{let D=ff(e,C,F);n.connect(D.input),D.output.connect(r),a=D}catch{n.connect(r)}},m=(C,F)=>{l=F&&a?nf(gf(t,C),C,a.nodes,F,a.presets):[]},h=i?{...i}:null;f(o,h?.elapsed??0),m(o,h);let b=()=>{if(!h)return null;let C=typeof e.currentTime=="number"?e.currentTime:h.scheduledAt;return{scheduledAt:C,elapsed:h.elapsed+(C-h.scheduledAt)*h.rate,rate:h.rate}},v=C=>{let F=b();F&&(pn(l,F.scheduledAt),m(C,F))},x=C=>{let F=b();pn(l,F?.scheduledAt??0),d(),f(C,F?.elapsed??0),m(C,F)},_=null,T=t;return typeof MutationObserver<"u"&&typeof T?.nodeType=="number"&&(_=new MutationObserver(()=>{let C=hn(t);l.length>0&&Sr(l),!a||!a.update(C.chain)?x(C.chain):v(C.chain)}),_.observe(T,{attributes:!0,attributeFilter:[It,ut]})),{reanchor:C=>{if(s)return;let F=b();F&&pn(l,F.scheduledAt),h={...C},m(hn(t).chain,h)},setRate:C=>{let F=b();s||!F||!Number.isFinite(C)||C<=0||C===F.rate||(h={...F,rate:C},pn(l,F.scheduledAt),m(hn(t).chain,h))},dispose:()=>{s=!0,_?.disconnect(),l.length>0&&pn(l,typeof e.currentTime=="number"?e.currentTime:0),a?.dispose()}}}var xf="runtime_web_audio_bypass";function Ds(e,t){return typeof e.getAttribute=="function"?e.getAttribute(t):null}function wr(e,t){return Ds(e,t)!==null}function hv(e){return wr(e,"crossorigin")?!0:e.crossOrigin!=null}function gv(e){return typeof e.baseURI=="string"&&e.baseURI?e.baseURI:typeof document<"u"?document.baseURI:""}function bv(e){let t=typeof e.currentSrc=="string"?e.currentSrc:"";if(t)return[t];let n=Ds(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 xv(e,t){let n;try{n=new URL(e,gv(t))}catch{return null}return n.protocol!=="http:"&&n.protocol!=="https:"?null:n}function yv(){return typeof window.origin=="string"?window.origin:window.location.origin}function vv(e,t){if(typeof window>"u")return null;let n=xv(e,t);if(!n)return null;let r=yv(),i=r==="null";return!i&&n.origin===r||hv(t)?null:i?"opaque_document_origin":"cross_origin_no_cors"}function vf(e){return(typeof e.currentSrc=="string"?e.currentSrc:"")?!0:wr(e,"src")}function gn(e){for(let t of bv(e)){let n=vv(t,e);if(n)return{kind:"decode-only",reason:n,asset:t}}return{kind:"web-audio"}}function Sv(e){let t=[];wr(e,It)&&t.push("fx-chain"),wr(e,ut)&&t.push("automation"),wr(e,di)&&t.push("audio-group");let n=Number.parseFloat(Ds(e,"data-volume")??"");return Number.isFinite(n)&&n>1&&t.push("above-unity-gain"),t}function Av(){return typeof window<"u"&&!!window.__HF_EXPORT_RENDER_SEEK_CONFIG}var yf=new WeakSet,Ev={cross_origin_no_cors:"cross-origin media without a `crossorigin` opt-in is silent through createMediaElementSource (Web Audio spec); using native playback instead",opaque_document_origin:"this document's security origin is opaque (a sandbox without `allow-same-origin`), so no media is same-origin with it and createMediaElementSource would be silent (Web Audio spec); using native playback instead"},wv={cross_origin_no_cors:"proxy or download the asset to a same-origin URL to keep it.",opaque_document_origin:"add `allow-same-origin` to the sandbox, or serve the asset with a `crossorigin` attribute and an `Access-Control-Allow-Origin` of `null` or `*`, to keep it."};function bn(e,t){if(t.kind==="web-audio"||Av()||yf.has(e))return;let n=Sv(e);yf.add(e);let r={asset:t.asset,reason:t.reason,lostProcessing:n,note:Ev[t.reason]};ve({source:"hf-preview",type:"diagnostic",code:xf,details:r});let i=n.length>0?` Native playback cannot reproduce: ${n.join(", ")} \u2014 ${wv[t.reason]}`:"";console.info(`[hyperframes] ${xf}: "${t.asset}" (${t.reason}): Web Audio capture withheld; the track plays through native HTMLMediaElement output.${i}`)}function Is(e){return!Number.isFinite(e)||e<=0?1:e}function Sf(e){return Ue(e)}function _v(e,t){t||e.paused||!Kr().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function Cv(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 f=n*a,m=u-f;return s&&m<=0?!1:(s?e.start(0,f+r,m):e.start(0,f+r),!0)}let d=-n/o;return s?e.start(i+d,r,u):e.start(i+d,r),!0}function Ji(e,t,n){let r=rf(bf(e));r&&Rs([{param:t.gain}],r,li.scale,n)}function _r(e){return e.sourceKind==="buffer"}var Qi=class{constructor(){ye(this,"_ctx",null);ye(this,"_bufferCache",new Map);ye(this,"_failedSrcs",new Set);ye(this,"_mediaElementSources",new WeakMap);ye(this,"_activeSources",[]);ye(this,"_masterGain",null);ye(this,"_masterVolume",1);ye(this,"_masterMuted",!1);ye(this,"_groups",new Map);ye(this,"_rateAnchorCtx",0);ye(this,"_rateAnchorComp",0);ye(this,"_rate",1);ye(this,"_paused",!0);ye(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=gn(t);if(o.kind!=="web-audio"){try{n.disconnect()}catch{}return this._mediaElementSources.delete(t),bn(t,o),null}return n}if(!this._ctx)return null;let r=gn(t);if(r.kind!=="web-audio")return bn(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=Is(l),d=this._ctx.createGain();d.gain.value=o;let f=this._ctx.currentTime,m=i-n,h={scheduledAt:f,elapsed:m,rate:u},b=Xi(this._ctx,t,s,d,h);d.connect(this.resolveDestination(t,f,i,u)??this._masterGain),Ji(t,d,h),this._rate=u,this._rateAnchorCtx=f,this._rateAnchorComp=i;let v={fx:b,el:t,sourceNode:s,sourceKind:"media-element",gainNode:d,compositionStart:n,mediaStart:r,scheduledAt:f,priorMuted:t.muted,priorVolume:t.volume,mediaPlaybackRate:Le(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(m){L("webAudioTransport.groupReanchor",m)}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=()=>$o(n,t),s=l(),u=this._ctx.createGain();u.gain.value=s?.hasAttribute("data-hidden")?0:1,u.connect(a);let d=this._ctx.createGain();d.gain.value=Sf(qo(s)),d.connect(u);let f=Xi(this._ctx,s??{getAttribute:()=>null},o,d,r);return s&&Ji(s,d,r),this._groups.set(t,{input:o,fader:d,muteGain:u,fx:f,generation:this._playGeneration,reanchor:m=>{Sr([{param:d.gain}]);let h=l();d.gain.value=Sf(qo(h)),u.gain.value=h?.hasAttribute("data-hidden")?0:1,f?.reanchor(m),h&&Ji(h,d,m)},dispose:()=>{try{f?.dispose(),o.disconnect(),d.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=Nu(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 d=Is(s),f=Le(t),m=d*f,h=this._ctx.createBufferSource();h.buffer=n,h.playbackRate.value=m;let b=this._ctx.createGain();b.gain.value=a;let v=o-r,x=this._ctx.currentTime,_={scheduledAt:x,elapsed:v,rate:d},T=Xi(this._ctx,t,h,b,_);if(b.connect(this.resolveDestination(t,x,o,d)??this._masterGain),Ji(t,b,_),this._rate=d,this._rateAnchorCtx=x,this._rateAnchorComp=o,!Cv(h,{elapsed:v,mediaStart:i,scheduledAt:x,globalRate:d,mediaRate:f,clipDuration:u}))return h.disconnect(),T?.dispose(),b.disconnect(),null;let C=t.muted;t.muted=!0,_v(t,C);let F={fx:T,el:t,sourceNode:h,sourceKind:"buffer",gainNode:b,compositionStart:r,mediaStart:i,scheduledAt:x,priorMuted:C,priorVolume:t.volume,mediaPlaybackRate:f,bounded:Number.isFinite(u)&&u>0};return this._activeSources.push(F),this._paused=!1,h.addEventListener("ended",()=>this.handleSourceEnded(h,F,t,C)),F}catch(d){return L("webAudioTransport.schedule",d),null}}setRate(t){let n=Is(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{_r(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=>_r(t)&&t.bounded)}stopAll(){for(let t of this._activeSources){try{_r(t)&&t.sourceNode.stop(),t.sourceNode.disconnect(),t.fx?.dispose(),t.gainNode.disconnect()}catch{}_r(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=Ue(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&&_r(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 Cr="data-hf-studio-manual-edit-gesture";var Af=`[${Cr}]`;function Ef(e,t){let n=e.defaultView?.MutationObserver??globalThis.MutationObserver;if(!n||!e.documentElement)return{isActive:()=>e.querySelector(Af)!=null,observing:!1,disconnect:()=>{}};let r=new Set(e.querySelectorAll(Af)),i=l=>{for(let s of l){let u=s.target;Ne(u)&&(u.hasAttribute(Cr)?r.add(u):r.delete(u))}},o=l=>{l.length!==0&&(i(l),t())},a=new n(o);return a.observe(e.documentElement,{subtree:!0,attributes:!0,attributeFilter:[Cr]}),{observing:!0,isActive:()=>{o(a.takeRecords());for(let l of r){if(l.isConnected&&l.hasAttribute(Cr))return!0;r.delete(l)}return!1},disconnect:()=>{a.disconnect(),r.clear()}}}var wf=333.3333333333333;function _f(e){return e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2?!1:e.compositionChanged===!0?!0:Number.isInteger(e.tick)&&e.tick>0&&e.tick%60===0}var Rv=/^\s*spring\(\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*\)\s*$/;function Cf(e){return Math.max(0,Math.min(1,e))}function Rf(e){let t=Rv.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?Cf(n):null}function Tf(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=Cf(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 Tv=/^\s*wiggle\(\s*(\d+)\s*,\s*(easeOut|easeInOut|anticipate|uniform)\s*(?:,\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?)\s*)?\)\s*$/,kv=Math.PI*2;function Mv(e){let t=Tv.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 Fv(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(kv*t*e)}function kf(e,t){let n=Mv(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=>Fv(a,n.wiggles,n.type,n.amplitude);return t?.set(r,o),o}var Nv=24,Mf=e=>e>=1?1:0,Lv=e=>e,Zi=String.raw`([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)`,Dv=new RegExp(String.raw`^\s*M\s*0\s*,\s*0\s+C\s*${Zi}\s*,\s*${Zi}\s+${Zi}\s*,\s*${Zi}\s+1\s*,\s*1\s*$`,"i");function Ff(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function Iv(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<Nv;l+=1){let s=(o+a)/2;Ff(s,t,r)<e?o=s:a=s}return Ff((o+a)/2,n,i)}function Pv(e){let t=Dv.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=>Iv(a,n,r,i,o)}function Ov(e,t){if(!e.startsWith("spring("))return null;let n=Rf(e);if(n===null)return null;let r=t.get(n);if(r)return r;let i=o=>Tf(o,n);return t.set(n,i),i}function Gv(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=Pv(n);return i&&t.set(n,i),i}function Nf(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"?Mf:kf(s,i)??Ov(s,r)??Gv(s,n),a=(s,u,d=[])=>{let f=o(s);return f||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\(|$)/.test(s.trim())&&Be("custom_ease_parse_failed",{ease:s}),t.call(u,s,...d)??Lv)};e.parseEase=function(u,...d){return a(u,this,d)};let l=e.registerEase;if(typeof l=="function"){l("hold",Mf);let s=u=>{let d=f=>f;d.config=(...f)=>a(`${u}(${f.join(",")})`,e),l(u,d)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}var Gs=new Map,Rr=new Map,Ps=new Map,Os=()=>{},Df=()=>{},Lf=0;function Hs(e){return/^[a-z][a-z0-9-]{0,63}$/.test(e)}function If(e){let t=(Ps.get(e)??0)+1;return Ps.set(e,t),t}function Pf(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:(Lf-=1,Lf)}function Bs(e,t){let n=Rr.get(e);if(!n)return;let r=()=>Ps.get(e)===t.generation&&Rr.get(e)===n;try{Promise.resolve(n(t.payload)).then(()=>{r()&&Df(e,t.requestId)},i=>{r()&&Os(e,t.requestId,i)})}catch(i){r()&&Os(e,t.requestId,i)}}function Of(e){Os=e}function Gf(e){Df=e}function eo(e,t,n){if(!Hs(e))return;let r={payload:t,requestId:Pf(n),generation:If(e)};Gs.set(e,r),Bs(e,r)}function to(e,t){Hs(e)&&(Gs.delete(e),Bs(e,{payload:void 0,requestId:Pf(t),generation:If(e)}))}function Hf(e,t){if(!Hs(e))throw new Error(`Invalid HyperFrames runtime-data channel: ${e}`);Rr.set(e,t);let n=Gs.get(e);return n&&Bs(e,n),()=>{Rr.get(e)===t&&Rr.delete(e)}}var Us="data-hf-authored-duration",Ws="data-hf-authored-end",Bf=!1;function rt(e){if(e){if(typeof e.pause!="function"){Bf||(Bf=!0,Be("timeline_missing_pause",{}));return}try{e.pause()}catch(t){L("runtime.timeline.pause",t)}}}function Uv(){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 Uf(){let e=vc(),t=()=>{};Pl(ve),Of((c,p,g)=>{ve({source:"hf-preview",type:"runtime-data-error",channel:c,requestId:p,message:g instanceof Error?g.message:String(g)})}),Gf((c,p)=>{try{t()}catch(g){ve({source:"hf-preview",type:"runtime-data-error",channel:c,requestId:p,message:g instanceof Error?g.message:String(g)});return}ve({source:"hf-preview",type:"runtime-data-applied",channel:c,requestId:p})}),Hi(document),hs(document),Lu(document);let n=Uv();e.canonicalFps=n.fps??e.canonicalFps,Dl(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG&&console.info("[hyperframes] render runtime fps",{canonicalFps:e.canonicalFps,source:n.source,rawFpsSource:n.rawFpsSource,rawFps:n.rawFps,fallbackReason:n.fallbackReason});let r=null,i=null,o=null,a=[],l=new Set,s=null,u=new Set,d=(c,p,g)=>{u.has(c)||(u.add(c),Be(p,g))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(c){L("runtime.init.site1",c)}let f=new Yi;e.transportClock=f;let m=new Qi,h=!1;m.init().then(c=>{h=c}),window.__hf=window.__hf||{};let b=c=>c.closest("[data-hidden]")!==null||mi(c.ownerDocument,c),v=()=>{let c=window.gsap,p=window;if(!(!c?.registerPlugin||p.__hfAutoNoopRegistered))try{c.registerPlugin({name:"_auto",init:()=>!1}),p.__hfAutoNoopRegistered=!0}catch(g){d("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),L("runtime.autoMarker.install",g)}},x=()=>{let c=window.gsap;if(!c){d("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{Nf(c)||d("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(p){d("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),L("runtime.customEase.install",p)}};v(),x(),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{Vl(document)}catch(c){L("runtime.init.cssVariables",c)}window.__timelines=window.__timelines||{};let _=()=>{let c=document.querySelector('[data-composition-id][data-root="true"]');if(Se(c))return c;let p=Array.from(document.querySelectorAll("[data-composition-id]"));return p.find(g=>!g.parentElement?.closest("[data-composition-id]"))??p[0]??null};if(Array.isArray(window.__timelines)){let c=window.__timelines,p=_()?.getAttribute("data-composition-id")??"root",g={};if(c.length===1)g[p]=c[0];else for(let y=0;y<c.length;y++)g[`tl-${y}`]=c[y];window.__timelines=g}let T=_();T&&!T.hasAttribute("data-start")&&T.setAttribute("data-start","0");let C=c=>{a.push(c)},F=(c,p,g)=>{let y=g??`${c}:${JSON.stringify(p)}`;l.has(y)||(l.add(y),ve({source:"hf-preview",type:"diagnostic",code:c,details:p}))},D=c=>{let p={scale:1,focusX:960,focusY:540},g=[],y=[],E={time:c.getTime(),duration:c.getDuration(),isPlaying:c.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:c.play,pause:c.pause,seek:c.seek,getTime:c.getTime,getDuration:c.getDuration,isPlaying:c.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>p,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>g,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:c.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>y,getRenderState:()=>({...E,time:c.getTime(),duration:c.getDuration(),isPlaying:c.isPlaying()})}},M=1/60,S=.75,A=.05,w=100,R=240,I=c=>{if(c instanceof Error)return c.message||String(c);if(typeof c=="string")return c;try{return JSON.stringify(c)}catch{return String(c??"")}},H=c=>{let p=c.toLowerCase();return p.includes("cannot read properties of null")||p.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:p.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:p.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},j=c=>{if(c==null||c.trim()==="")return null;let p=Number.parseFloat(c);return!Number.isFinite(p)||p<=0?null:`${p}px`},X=()=>_(),k=()=>{let c=X();if(!c)return;let p=j(c.getAttribute("data-width")),g=j(c.getAttribute("data-height"));p&&(c.style.width=p),g&&(c.style.height=g),p&&c.style.setProperty("--comp-width",p),g&&c.style.setProperty("--comp-height",g),p&&(document.documentElement.style.width=p),g&&(document.documentElement.style.height=g),p&&(document.body.style.width=p),g&&(document.body.style.height=g)},U=()=>{let c=X(),p=Array.from(document.querySelectorAll("[data-composition-id]")).filter(g=>g.hasAttribute("data-duration")||g.hasAttribute("data-end"));for(let g of p){if(c&&g===c)continue;let y=g.getAttribute("data-duration"),E=g.getAttribute("data-end");y!=null&&!g.hasAttribute(Us)&&g.setAttribute(Us,y),E!=null&&!g.hasAttribute(Ws)&&g.setAttribute(Ws,E),g.removeAttribute("data-duration"),g.removeAttribute("data-end")}},te=()=>{let c=X();if(!c)return;c.style.position||(c.style.position="relative"),c.style.overflow="hidden";let p=j(c.getAttribute("data-width")),g=j(c.getAttribute("data-height"));p&&(c.style.width=p),g&&(c.style.height=g);let y=Array.from(c.children);for(let E of y){let N=E.tagName.toLowerCase();if(N==="script"||N==="style"||N==="link"||N==="meta"||!E.hasAttribute("data-start")||E.hasAttribute("data-hf-autostamped"))continue;let P=(E.style.top==="0px"||E.style.top==="0")&&(E.style.left==="0px"||E.style.left==="0")&&E.style.width==="100%"&&E.style.height==="100%",K=/translate\(\s*-50%\s*,\s*-50%\s*\)/.test(E.style.transform);if(P&&K&&!E.hasAttribute("data-width")&&!E.hasAttribute("data-height")){let Y=E.style.top,Re=E.style.left,Dt=E.style.width,Fe=E.style.height;E.style.top="",E.style.left="",E.style.width="",E.style.height="";let Xe=window.getComputedStyle(E);Xe.top!=="auto"||Xe.bottom!=="auto"||Xe.left!=="auto"||Xe.right!=="auto"||Xe.width!=="0px"||Xe.height!=="0px"||(E.style.top=Y,E.style.left=Re,E.style.width=Dt,E.style.height=Fe)}let $=window.getComputedStyle(E),ne=$.position;if(ne!=="absolute"&&ne!=="fixed"&&(E.style.position="absolute"),!!E.style.top||!!E.style.bottom||$.top!=="auto"||$.bottom!=="auto"||(E.style.top="0"),!!E.style.left||!!E.style.right||$.left!=="auto"||$.right!=="auto"||(E.style.left="0"),N!=="audio"){let Y=j(E.getAttribute("data-width")),Re=j(E.getAttribute("data-height")),Dt=$.width!=="0px"&&$.width!=="auto",Fe=$.height!=="0px"&&$.height!=="auto";Y?!E.style.width&&!Dt&&(E.style.width=Y):!E.style.width&&$.width==="0px"&&(E.style.width="100%"),Re?!E.style.height&&!Fe&&(E.style.height=Re):!E.style.height&&$.height==="0px"&&(E.style.height="100%")}}},B=c=>st({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:c}),G=null,W=c=>{let p=G;G=B(!0);try{return c()}finally{G=p}},Q=c=>c&&G?G:B(c),q=(c,p=0,g)=>Q(g?.includeAuthoredTimingAttrs??!0).resolveStartForElement(c,p),O=(c,p)=>Q(p?.includeAuthoredTimingAttrs??!0).resolveDurationForElement(c),V=c=>{let p=c.closest("[data-composition-id]"),g=p?q(p,0):null,y=p?O(p,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:p,inheritedStart:g,inheritedDuration:y}},Z=c=>Q(!0).resolveMediaStartForElement(c);window.__hfResolveMediaStartSeconds=Z,a.push(()=>{window.__hfResolveMediaStartSeconds===Z&&delete window.__hfResolveMediaStartSeconds});let pe=(c,p)=>{let g=c.tagName.toLowerCase();if(g==="script"||g==="style"||g==="link"||g==="meta")return!1;let E=g==="video"||g==="audio"?Z(c):q(c,0),N=O(c),P=c.getAttribute("data-composition-id");if(P){let Ee=(window.__timelines??{})[P],He=null;if(Ee&&typeof Ee.duration=="function"){let Y=Number(Ee.duration());Number.isFinite(Y)&&Y>0&&(He=Y)}!(c.hasAttribute("data-duration")||c.hasAttribute("data-end")||c.hasAttribute(Us)||c.hasAttribute(Ws))&&(N==null||N<=0)&&He!=null&&(N=He)}let K=N!=null&&N>0?E+N:Number.POSITIVE_INFINITY,$=window.__HF_EXPORT_RENDER_SEEK_CONFIG?Sa(E,e.canonicalFps):E,ne=window.__HF_EXPORT_RENDER_SEEK_CONFIG&&Number.isFinite(K)?Sa(K,e.canonicalFps):K;return p>=$&&(Number.isFinite(ne)?p<ne:!0)},re=!!document.querySelector("[data-composition-src]"),z=!1;{let c=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let p of c){let g=p.getAttribute("data-composition-id");if(g&&p.children.length===0&&document.querySelector(`template#${CSS.escape(g)}-template`)){z=!0;break}}}let J=!re&&!z,Ae=c=>{if(!c||typeof c.duration!="function")return null;try{let p=Number(c.duration());return Number.isFinite(p)?Math.max(0,p):null}catch{return null}},ce=c=>typeof c=="number"&&Number.isFinite(c)&&c>M,vn=()=>{let c=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));return c.length===0?null:W(()=>{let p=0;for(let g of c){let y=Z(g);if(!Number.isFinite(y))continue;let E=ri(g);E==null||E<=M||(p=Math.max(p,Math.max(0,y)+E))}return p>M?p:null})},it=()=>{let c=X();if(!c)return null;let p=window.__timelines??{},g=st({timelineRegistry:p,includeAuthoredTimingAttrs:!0}),y=0,E=Ce(c.getAttribute("data-duration"));E!=null&&E>0&&(y=E);let N=Array.from(c.querySelectorAll("[data-composition-id][data-start]"));for(let P of N){if(!Ne(P)||P.parentElement?.closest("[data-composition-id]")!==c)continue;let $=g.resolveStartForElement(P,0),ne=g.resolveDurationForElement(P);!Number.isFinite($)||ne==null||ne<=0||(y=Math.max(y,Math.max(0,$)+ne))}return y>M?y:null},Ap=()=>{let c=vn();return typeof c!="number"||!Number.isFinite(c)||c<=M?null:c},Ep=c=>ce(c)?Math.max(M,c*S):M,Qs=()=>{let c=0;for(let p of e.deterministicAdapters){let g=p.getInferredDurationSeconds;if(typeof g!="function")continue;let y=null;try{y=g()}catch(E){L("runtime.init.adapterDuration",E)}typeof y=="number"&&Number.isFinite(y)&&y>0&&(c=Math.max(c,y))}return c>M?c:null},Mr=!1,Zs=()=>Mr&&window.__HF_EXPORT_RENDER_SEEK_CONFIG!=null,wp=["data-start","data-duration","data-end","data-composition-id","data-composition-src","data-composition-file","data-root","data-hf-authored-duration","data-hf-authored-end","data-hf-auto-start",ii,"data-playback-rate","data-playback-start","data-media-start","id","src"],el=["loadedmetadata","durationchange","emptied"],Fr=null,tl=-1,nl=null,Mt=null,rl=0,zt=()=>{},qt=()=>{rl+=1,zt()},il=()=>({media:Ap(),authoredComposition:it()}),_p=()=>{let c=window.__timelines??{},p="";for(let g of Object.keys(c)){let y=c[g];y&&(p+=`${g}=${Ae(y)??"?"};`)}return p},Cp=()=>{if(!(Mt||typeof MutationObserver>"u")){Mt=new MutationObserver(qt),Mt.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:wp});for(let c of el)document.addEventListener(c,qt,!0);a.push(()=>{Mt?.disconnect(),Mt=null,qt();for(let c of el)document.removeEventListener(c,qt,!0)})}},Nr=()=>{Cp(),Mt&&Mt.takeRecords().length>0&&qt();let c=_p();return c!==nl&&(nl=c,qt()),rl},ol=c=>Mr?il():(c??(c=Nr()),Fr&&tl===c||(tl=c,Fr=il()),Fr),ot=(c,p=0,g)=>{let y=Ae(c),{media:E,authoredComposition:N}=ol(g),P=Qs(),K=Math.max(E??0,N??0,P??0),$=Number.isFinite(p)&&p>M?p:0,ne=0;return ce(y)?ne=Math.max(y,K,$):ce(K)?ne=Math.max(K,$):ne=$,ne>0?Math.max(0,ne):0},uo=()=>{let c=window.__timelines??{},p=de=>{let se=Object.entries(c).filter(me=>!!me[1]&&typeof me[1].play=="function"&&typeof me[1].pause=="function");if(se.length!==1)return{timeline:null};let ie=se[0];if(!ie)return{timeline:null};let[xe,we]=ie;return{timeline:we,selectedTimelineIds:[xe],selectedDurationSeconds:Ae(we),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:de,soleTimelineId:xe}}}},g=st({timelineRegistry:c,includeAuthoredTimingAttrs:!0}),{media:y,authoredComposition:E}=ol(),N=Math.max(y??0,E??0)||null,P=Ep(N),K=de=>{let se=document.querySelector(`[data-composition-id="${CSS.escape(de)}"]`);return se?g.resolveStartForElement(se,0):0},$=de=>{let se=window.gsap;if(!se||typeof se.timeline!="function")return null;let ie=se.timeline({paused:!0});for(let xe of de)ie.add(xe.timeline,K(xe.compositionId));return ie},ne=(de,se)=>{if(!ce(de))return null;let ie=window.gsap;if(!ie||typeof ie.timeline!="function")return null;let xe=ie.timeline({paused:!0});if(se)try{xe.add(se,0)}catch(me){L("runtime.init.site2",me)}let we=xe;if(typeof we.to=="function")try{we.to({},{duration:de})}catch(me){L("runtime.init.site3",me)}return xe},Ee=(de,se)=>{if(!de||typeof de.getChildren!="function")return[];try{let ie=de.getChildren(!0,!0,!0);return Array.isArray(ie)?se.filter(xe=>ie.includes(xe.timeline)):[]}catch{return[]}},He=(de,se)=>{let ie=de,xe={addedIds:[],nested:[]};if(typeof ie.getChildren!="function")return xe;try{let we=ie.getChildren(!0,!0,!0)??[];if(!Array.isArray(we))return xe;let me=[];for(let _e of se)if(!we.some(at=>at===_e.timeline))try{let at=K(_e.compositionId);de.add(_e.timeline,at),me.push(_e.compositionId)}catch(at){L("runtime.init.site4",at)}return{addedIds:me,nested:Ee(de,se)}}catch{return xe}},ae=X(),Y=ae?.getAttribute("data-composition-id")??null;if(!Y)return p("root_missing_composition_id");let Re=c[Y]??null,Fe=(()=>{if(!ae)return[];let de=new Set,se=Array.from(ae.querySelectorAll("[data-composition-id]")),ie=[];for(let xe of se){let we=xe.getAttribute("data-composition-id");if(!we||we===Y||de.has(we))continue;de.add(we);let me=c[we]??null;if(!me||typeof me.play!="function"||typeof me.pause!="function")continue;let _e=Ae(me);ie.push({compositionId:we,timeline:me,durationSeconds:_e??0})}return ie})(),Xe=de=>{for(let se of de){let ie=se.timeline;if(typeof ie.paused=="function")try{ie.paused(!1)}catch(xe){L("runtime.init.site5",xe)}}};if(Re){let de=Fe.length>0?He(Re,Fe):{addedIds:[],nested:[]},se=de.addedIds;if(Xe(de.nested),(Fe.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id='"+Y+"'])"))&&(Lr=!0),se.length>0)try{let me=Re.time();Re.seek(me,!1)}catch{}let ie=Ae(Re);if(!ce(ie)&&Fe.length>0){let me=Fe.map(ih=>ih.compositionId),_e=$(Fe),jt=Ae(_e);if(_e&&ce(jt))return Xe(Ee(_e,Fe)),{timeline:_e,selectedTimelineIds:me,selectedDurationSeconds:jt,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:Y,rootDurationSeconds:ie,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:P,selectedDurationSeconds:jt,mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:E,selectedTimelineIds:me,autoNestedChildren:se}}};let at=ne(N??0,Re),Co=Ae(at);if(at&&ce(Co))return{timeline:at,selectedTimelineIds:[Y],selectedDurationSeconds:Co,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:Y,rootDurationSeconds:ie,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:E,selectedDurationSeconds:Co,selectedTimelineIds:[Y],autoNestedChildren:se}}}}if(!ce(ie)&&Fe.length===0){let me=ne(N??0,Re),_e=Ae(me);if(me&&ce(_e))return{timeline:me,selectedTimelineIds:[Y],selectedDurationSeconds:_e,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:Y,rootDurationSeconds:ie,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:E,selectedDurationSeconds:_e,selectedTimelineIds:[Y]}}}}let xe=Ce(ae?.getAttribute("data-duration")),we=Math.max(ce(xe)?xe:0,E??0);if(we>0&&ce(we)&&ce(ie)&&we>=ie+.5){let me=Re;if(typeof me.to=="function")try{me.to({},{duration:0},we)}catch(jt){L("runtime.init.site6",jt)}let _e=Ae(Re);if(ce(_e))return{timeline:Re,selectedTimelineIds:[Y],selectedDurationSeconds:_e,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:Y,rootDurationSeconds:ie,rootDeclaredDur:xe,authoredCompositionDurationFloorSeconds:E,newDur:_e}}}}return{timeline:Re,selectedTimelineIds:[Y],selectedDurationSeconds:ie,mediaDurationFloorSeconds:y,diagnostics:se.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:Y,selectedDurationSeconds:ie,autoNestedChildren:se}}:void 0}}if(Fe.length>0){let de=Fe.map(xe=>xe.compositionId),se=$(Fe),ie=Ae(se);if(se)return Xe(Ee(se,Fe)),{timeline:se,selectedTimelineIds:de,selectedDurationSeconds:ie,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:Y,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:P,selectedDurationSeconds:ie,mediaDurationFloorSeconds:y,selectedTimelineIds:de}}}}return p("root_composition_id_unmatched_in_registry")},Lr=!1,Rp=c=>{let p=window.gsap,g=c;if(!(!g||typeof g.getChildren!="function"||!p||typeof p.parseEase!="function"))for(let y of g.getChildren(!0,!0,!0)){let E=y,N=E.timeline;if(!N||!("_ease"in N)||typeof N._ease=="function")continue;let P=E.vars?.keyframes,$=(P&&!Array.isArray(P)?P.ease:void 0)??E.vars?.ease??"none";try{let ne=p.parseEase($);typeof ne=="function"&&(N._ease=ne)}catch(ne){Be("keyframe_ease_repair_failed",{ease:typeof $=="string"?$:String($)}),L("runtime.keyframeEase.repair",ne)}}},Sn=()=>{if(x(),!J)return!1;let c=e.capturedTimeline,p=Ae(c),g=ce(p);if(c&&g&&Lr)return!1;let y=uo();if(!y.timeline)return!1;if(c&&c===y.timeline)return typeof c.timeScale=="function"&&c.timeScale(e.playbackRate),!1;e.capturedTimeline=y.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),Rp(e.capturedTimeline);let E=ot(e.capturedTimeline,0);if(E<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),rt(e.capturedTimeline)),E>0){try{f.setDuration(E)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let P=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(P,!1),rt(e.capturedTimeline)}let N=window.__hfStudioManualEditsApply;typeof N=="function"&&N(),Hi(document)}if(y.diagnostics&&ve({source:"hf-preview",type:"diagnostic",code:y.diagnostics.code,details:y.diagnostics.details}),ve({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:y.selectedTimelineIds??[],selectedDurationSeconds:y.selectedDurationSeconds??null,mediaDurationFloorSeconds:y.mediaDurationFloorSeconds??null}}),window.parent!==window){let N=X(),P=E>0?E:0,K=String(P>0?P:1),$=new Set,ne=ae=>ae.tagName.toLowerCase()===Zt,Ee=new Set(document.querySelectorAll("[data-start]")),He=ae=>{let Y=ae.parentElement;for(;Y&&Y!==N;){if(Ee.has(Y))return!0;Y=Y.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let ae of e.capturedTimeline.getChildren(!0))if(typeof ae.targets=="function")for(let Y of ae.targets())Se(Y)&&Y!==N&&(ne(Y)||Y.hasAttribute("data-start")||He(Y)||$.has(Y)||($.add(Y),Y.setAttribute("data-start","0"),Y.setAttribute("data-duration",K),Y.setAttribute("data-hf-autostamped","1")))}catch{}if(Se(N))for(let ae of N.querySelectorAll("[id]"))Se(ae)&&ae!==N&&(ae.hasAttribute("data-start")||He(ae)||$.has(ae)||ae.tagName==="SCRIPT"||ae.tagName==="STYLE"||ae.tagName==="LINK"||ne(ae)||($.add(ae),ae.setAttribute("data-start","0"),ae.setAttribute("data-duration",K),ae.setAttribute("data-hf-autostamped","1")))}for(let N of An)Dr.delete(N),ml(N);return!0},al=()=>{if(e.tornDown)return;let c=uo();if(!c.timeline){e.capturedTimeline=null,Lr=!1,f.setDuration(0),Hr(e.currentTime);return}e.capturedTimeline!==c.timeline&&(Lr=!1,Sn()),Hr(e.currentTime)};t=()=>{al(),ht()},window.__hfForceTimelineRebind=al;let Tp=()=>{let c=X();if(!Se(c))return;let p=c.getBoundingClientRect(),g=Number(c.getAttribute("data-width")),y=Number(c.getAttribute("data-height")),E=window.getComputedStyle(c),N=Number.isFinite(g)&&g>0&&Number.isFinite(y)&&y>0,P=p.width<=0||p.height<=0||c.clientWidth<=0||c.clientHeight<=0;!N||!P||F("root_stage_layout_zero",{compositionId:c.getAttribute("data-composition-id")??null,declaredWidth:g,declaredHeight:y,rectWidth:Math.round(p.width),rectHeight:Math.round(p.height),clientWidth:c.clientWidth,clientHeight:c.clientHeight,display:E.display,visibility:E.visibility,overflow:E.overflow},`root-stage-layout-zero:${c.getAttribute("data-composition-id")??"unknown"}`)},kp=()=>{e.tornDown||(s!=null&&window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{s=null,Tp()}))},Mp=()=>{i=c=>{let p=I(c.error??c.message).slice(0,R);if(!p)return;let g=H(p);ve({source:"hf-preview",type:"diagnostic",code:g.code,details:{category:g.category,message:p,filename:c.filename||null,line:Number.isFinite(c.lineno)?c.lineno:null,column:Number.isFinite(c.colno)?c.colno:null}})},o=c=>{let p=I(c.reason).slice(0,R);if(!p)return;let g=H(p);ve({source:"hf-preview",type:"diagnostic",code:`${g.code}_unhandled_rejection`,details:{category:`${g.category}-unhandled-rejection`,message:p}})},window.addEventListener("error",i),window.addEventListener("unhandledrejection",o)},Fp=()=>{let c=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let g of c){let y=()=>{if(!Ne(g))return;let E=g.tagName.toLowerCase(),N=g.getAttribute("src")??g.getAttribute("href")??g.getAttribute("poster")??null,P=E==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";F(P,{tagName:E,assetUrl:N,currentSrc:(Oe(g)||ge(g))&&g.currentSrc||null,readyState:ge(g)?g.readyState:null,networkState:ge(g)?g.networkState:null},`${P}:${E}:${N??"unknown"}`)};g.addEventListener("error",y),C(()=>{g.removeEventListener("error",y)})}let p=document.fonts;p&&p.ready.then(()=>{if(e.tornDown)return;let g=Array.from(p).filter(y=>y.status==="error").map(y=>y.family).filter(y=>!!y).slice(0,10);g.length!==0&&F("runtime_font_load_issue",{failedFamilies:g,totalFaces:Array.from(p).length},`runtime-font-load-issue:${g.join("|")}`)}).catch(()=>{})},Np=(c,p)=>{if(!c.timeline)return!1;let g=e.capturedTimeline;if(g&&g===c.timeline)return!1;let y=Math.max(0,e.currentTime||0),E=e.isPlaying;e.capturedTimeline=c.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{rt(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&e.capturedTimeline.seek(y,!1),E&&typeof e.capturedTimeline.play=="function"&&e.capturedTimeline.play()}catch(N){L("runtime.init.site7",N)}return ve({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:p,previousTime:y,selectedTimelineIds:c.selectedTimelineIds??[],selectedDurationSeconds:c.selectedDurationSeconds??null,mediaDurationFloorSeconds:c.mediaDurationFloorSeconds??null}}),!0},Ft=null,sl=!1,An=new Set,Dr=new WeakMap,Ir=()=>{e.tornDown||(Ft!=null&&window.clearTimeout(Ft),Ft=window.setTimeout(()=>{if(e.tornDown||(Ft=null,Zs()))return;let c=uo();if(!c.timeline||!ce(c.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){Sn()&&(ht(),Pe(!0));return}if(sl)return;let g=Ae(e.capturedTimeline),y=c.selectedDurationSeconds??Ae(c.timeline);ce(y)&&(!ce(g)||y>=g+A)&&Np(c,"manual")&&(sl=!0,ve({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:g??null,selectedDurationSeconds:y??null,selectedTimelineIds:c.selectedTimelineIds??[],mediaDurationFloorSeconds:c.mediaDurationFloorSeconds??null}}),ht(),Pe(!0))},w))},ll=c=>{ge(c.currentTarget)&&Uu(c.currentTarget)},ul=c=>{ge(c.currentTarget)&&Wu(c.currentTarget)},cl=c=>{Lo(c)&&vf(c)&&bn(c,gn(c))},dl=c=>{let p=c.currentTarget;ge(p)&&cl(p)},Lp=()=>{for(let c of An)c.removeEventListener("loadedmetadata",Ir),c.removeEventListener("durationchange",Ir),c.removeEventListener("loadedmetadata",ll),c.removeEventListener("loadedmetadata",dl),c.removeEventListener("error",ul);An.clear()},co=()=>{if(e.tornDown)return;let c=Array.from(document.querySelectorAll("video, audio"));for(let p of c){if(An.has(p))continue;An.add(p);let g=Number.parseFloat(p.dataset.volume??"");Number.isFinite(g)&&(p.volume=Math.max(0,Math.min(1,g))),p.addEventListener("loadedmetadata",Ir),p.addEventListener("durationchange",Ir),p.addEventListener("loadedmetadata",dl),cl(p),p.addEventListener("loadedmetadata",ll),p.addEventListener("error",ul),Bu(p),p.preload!=="auto"&&(p.preload="auto"),p.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&p.load(),ml(p)}},ml=c=>{Dr.has(c)||vu(c,e.capturedTimeline,ot(e.capturedTimeline,0),Dr,{allowLiveTimelineSeek:!window.__HF_RENDER_CAPTURE_MODE})},mo=new WeakMap,Dp=c=>{let p=mo.get(c);if(p!==void 0)return p;let g=window.getComputedStyle(c).position,y=g==="static"||g==="relative"||g==="sticky";return mo.set(c,y),y},fo=new WeakMap,Ip=c=>{let p=fo.get(c);if(p!==void 0)return p;let g=c.querySelector("[data-start]")===null;return fo.set(c,g),g},Pp=()=>{mo=new WeakMap,fo=new WeakMap},po=new WeakSet,ho=new WeakMap,Pr=new WeakSet,Or=!1,fl=c=>c.matches("audio[data-start]")||c.querySelector("audio[data-start]")!==null,pl=new WeakMap,Gr=!0,Op=()=>{if(Gr){Gr=!1;for(let c of document.querySelectorAll(Zt)){let p=c.hasAttribute("data-hidden");pl.get(c)!==p&&(pl.set(c,p),c.id&&m.setGroupMuted(c.id,p))}}},Gp=(c,p)=>{let g=X();for(let y of p){if(!Se(y))continue;if(y.hasAttribute("data-hidden")){Pr.has(y)||(ho.set(y,y.style.getPropertyValue("display")),Pr.add(y),fl(y)&&(Or=!0),Gr=!0),y.style.display="none",(fe(y)||Oe(y))&&r?.setSourceVisibility(y,!1);continue}if(Pr.has(y)){let N=ho.get(y);N?y.style.display=N:y.style.removeProperty("display"),ho.delete(y),Pr.delete(y),fl(y)&&(Or=!0),Gr=!0}let E=pe(y,c);if(E){let N=y.parentElement;for(;N&&N!==g;){if(Se(N)&&N.hasAttribute("data-start")&&!pe(N,c)){E=!1;break}N=N.parentElement}}y.style.visibility=E?"visible":"hidden",(fe(y)||Oe(y))&&r?.setSourceVisibility(y,E),E?po.has(y)&&(y.style.removeProperty("display"),po.delete(y)):Dp(y)&&Ip(y)&&(y.style.display="none",po.add(y))}Or&&f.isPlaying()&&(m.stopAll(),wo()),Or=!1,Op()},Hr=(c,p=Array.from(document.querySelectorAll("[data-start]")))=>W(()=>Gp(c,p)),En=null,wn=null,Br=[],hl=c=>c.hasAttribute("data-start")||!!V(c).compositionRoot,go=c=>Iu({elements:c,shouldIncludeElement:hl,resolveStartSeconds:p=>Z(p),resolveDurationSeconds:p=>{let g=V(p),y=Z(p),E=g.inheritedStart!=null&&g.inheritedDuration!=null&&g.inheritedDuration>0?Math.max(0,g.inheritedStart+g.inheritedDuration-y):null,N=Number.isFinite(p.duration)?xt(p,p.duration):null,P=Ce(p.dataset.duration),K=P!=null&&P>0?P:null;return Du({isVideo:p.tagName==="VIDEO",sourceDuration:N,hostRemaining:E,explicitDuration:K})}}),Hp=()=>{let c=Nr();if(En&&En.revision===c)return En;let p=go().mediaClips;return En={revision:c,clips:p,byStart:[...p].sort((g,y)=>g.start-y.start),byEnd:[...p].sort((g,y)=>g.end-y.end)},wn=null,Br=[],En},gl=(c,p,g,y)=>{let E=0,N=c.length;for(;E<N;){let K=E+N>>1;p(c[K])<g?E=K+1:N=K}let P=[];for(let K=E;K<c.length&&p(c[K])<=y;K+=1)P.push(c[K]);return P},Bp=(c,p)=>{let g=wn;if(g===null)return c.clips.map(P=>P.el);let y=Math.min(g,p),E=Math.max(g,p),N=new Set;for(let P of Br)N.add(P.el);for(let P of gl(c.byStart,K=>K.start,y,E))N.add(P.el);for(let P of gl(c.byEnd,K=>K.end,y,E))N.add(P.el);return[...N]},Ur=new WeakSet,bl=c=>{Ur.add(c)},xl=c=>{Ur.delete(c)};window.__hf.leasePausedMedia=bl,window.__hf.releasePausedMedia=xl;let Up=()=>{for(let c of document.querySelectorAll("video, audio"))if(ge(c)&&!c.paused&&hl(c)&&!Ur.has(c))return!0;return!1},yl=()=>zt();document.addEventListener("play",yl,!0),a.push(()=>{document.removeEventListener("play",yl,!0)});let Ge=()=>{let c=!Mr,p=W(()=>{if(!c)return go().mediaClips;let E=Hp();return go(Bp(E,e.currentTime)).mediaClips});for(let E of p){let N=Dr.get(E.el);N&&(E.volumeKeyframes=N)}let g=e.isPlaying?p:p.filter(E=>!Ur.has(E.el)),y=e.mediaForceSyncNextTick;y&&(e.mediaForceSyncNextTick=!1),e.nativeMediaSyncDisabled||(Pu({clips:g,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted,userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:y,onElementVolume:(E,N,P)=>m.setElementVolume(E,P),isWebAudioOwned:E=>m.ownsElement(E),isWebAudioRouted:E=>m.routesElement(E),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,ve({source:"hf-preview",type:"media-autoplay-blocked"}))}}),c?(wn=e.currentTime,Br=p.filter(E=>e.currentTime>=E.start&&e.currentTime<E.end)):(wn=null,Br=[])),Hr(e.currentTime)},Pe=c=>{c&&zt();let p=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),g=Date.now();(c||p!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||g-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=p,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=g,ve({source:"hf-preview",type:"state",frame:p,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},bo="",vl=0,Wp=()=>{let c="";for(let p of document.querySelectorAll("[data-start]"))c+=`${p.id}:${p.tagName}|`;return c},ht=()=>{U(),k(),te();let c=X();if(c){let y=j(c.getAttribute("data-width")),E=j(c.getAttribute("data-height")),N=y?parseInt(y,10):0,P=E?parseInt(E,10):0;N>0&&P>0&&ve({source:"hf-preview",type:"stage-size",width:N,height:P})}Sn();let p=_c({canonicalFps:e.canonicalFps});window.__clipManifest=p;let g=Wp();if(bo!==g&&Pp(),!window.__clipTree||bo!==g){let y=window;window.__clipTree=Sc({startResolver:st({timelineRegistry:y.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:y.__timelines??{},rootDuration:p.durationInFrames/e.canonicalFps}),bo=g}ve(p),kp()},xo=c=>typeof c=="number"&&Number.isFinite(c)&&c>0?c:0,Vp=c=>{let p=xo(Number(c));if(p<=0)return;let g=X(),y=xo(Ce(g?.getAttribute("data-duration"))),E=Math.max(vl,xo(f.getDuration()),y);p<=E||(vl=p,g?.setAttribute("data-duration",String(p)),f.setDuration(p),ht(),Pe(!0))},ze=(c,p=0)=>{for(let g of e.deterministicAdapters){try{c==="discover"&&g.discover(),c==="pause"&&g.pause(),c==="play"&&g.play&&g.play()}catch(y){L("runtime.init.site8",y)}if(c==="discover")try{g.seek({time:p,suppressEvents:!0})}catch(y){L("runtime.init.site9",y)}}},Nt=()=>{window.__renderReady=!1},_n=null,Cn=!0,zp=()=>{let c=[];for(let p of e.deterministicAdapters){let g=p.getReadyPromise;if(typeof g=="function")try{let y=g();y&&c.push(y)}catch(y){L("runtime.init.adapterReady",y)}}return c},qp=()=>{let c=zp();if(c.length===0)return _n=null,Cn=!0,!0;let p=c[0];if(!p)return!0;let g=c.length===1?p:Promise.all(c);return g!==_n&&(_n=g,Cn=!1,Promise.resolve(g).then(()=>{_n===g&&(Cn=!0,Nt())},y=>{_n===g&&(Cn=!0,L("runtime.init.adapterReady",y),Nt())})),Cn};if(J)ls();else{let c={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:j,onDiagnostic:({code:p,details:g})=>{ve({source:"hf-preview",type:"diagnostic",code:p,details:g})}};gm(c).then(()=>hm(c)).finally(()=>{J=!0,co(),Fp(),ls(),hs(document),Nt()})}let Wr=gc({postMessage:c=>ve(c)});Wr.installPickerApi(),Hr(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let Ye=tf({lease:bl,release:xl});r=Ye,C(()=>{Ye.destroy(),r=null});let yo=c=>{let p=Number(c);!Number.isFinite(p)||p<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,p)),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(ge(y))try{y.playbackRate=e.playbackRate}catch(E){L("runtime.init.site10",E)}},Sl={play:()=>{let c=e.capturedTimeline;if(f.isPlaying())return;let p=ot(c,0);if(p>0)f.setDuration(p),f.reachedEnd()&&(f.seek(0),e.currentTime=0,Lt(0));else{let g=X(),y=Number(g?.getAttribute("data-duration")??0);y>0&&f.setDuration(y)}rt(c),f.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,Ml(f.now()),h&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&wo(),ze("play"),Ge(),Ye.redraw(),Pe(!0))},pause:()=>{if(!f.isPlaying())return;m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1,e.currentTime=f.now(),e.mediaForceSyncNextTick=!0,Ml(e.currentTime);let c=e.capturedTimeline;rt(c),ze("pause"),Ge(),Ye.redraw(),Pe(!0)},seek:(c,p)=>{let g=va(Math.max(0,Number(c)||0),e.canonicalFps);m.stopAll(),f.detachAudioSource();let y=f.isPlaying();y&&f.pause(),f.seek(g),e.currentTime=f.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let E=e.capturedTimeline;if(rt(E),Lt(e.currentTime),ze("pause"),p?.keepPlaying&&y){Sl.play();return}Ge(),Ye.redraw(),Pe(!0)},renderSeek:(c,p)=>{Mr=!0;let g=$n(Math.max(0,Number(c)||0),e.canonicalFps,p?.subFrameDivisions);m.stopAll(),f.detachAudioSource(),f.isPlaying()&&f.pause(),f.seek(g),e.currentTime=f.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0,Lt(e.currentTime,{activateChildren:!0,suppressEvents:p?.suppressEvents}),ze("pause"),Ge(),Ye.redraw(),Pe(!0)},getTime:()=>f.now(),getDuration:()=>{let c=f.getDuration();return Number.isFinite(c)?c:0},isPlaying:()=>f.isPlaying(),setPlaybackRate:c=>{yo(c),f.setRate(e.playbackRate),Fl()},getPlaybackRate:()=>e.playbackRate},Al=ot(e.capturedTimeline,0);Al>0&&f.setDuration(Al);let qe=yc({getTimeline:()=>e.capturedTimeline,setTimeline:c=>{e.capturedTimeline=c},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:c=>{e.isPlaying!==c&&(e.mediaForceSyncNextTick=!0),e.isPlaying=c},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:yo,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(c,p)=>{e.currentTime=Math.max(0,Number(c)||0),e.isPlaying!==p&&(e.mediaForceSyncNextTick=!0),e.isPlaying=p,Ge()},onStatePost:Pe,onDeterministicSeek:(c,p)=>{for(let g of e.deterministicAdapters)if(!(g.name==="gsap"&&e.capturedTimeline))try{g.seek({time:Number(c)||0,suppressEvents:p?.suppressEvents})}catch(y){L("runtime.init.site11",y)}},onDeterministicPause:()=>ze("pause"),onDeterministicPlay:()=>ze("play"),onRenderFrameSeek:()=>{Ye.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>ot(e.capturedTimeline,0),transport:Sl});window.__player=D(qe),window.__playerReady=!0,Be("composition_loaded",{duration:qe.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[mu(),Kl({resolveStartSeconds:c=>q(c,0)}),Xl(),Ql(),tu(),nu(),ru(),iu(),ou(),au(),su(),Yl({getTimeline:()=>e.capturedTimeline})],cu(),du(),window.__hfReseekGpu=c=>{let p=Math.max(0,Number(c)||0);window.__hfThreeTime=p,window.__hfTypegpuTime=p,ei(p)},window.__hfWaitForSeekCompletion=Ho,a.push(()=>{window.__hfWaitForSeekCompletion===Ho&&delete window.__hfWaitForSeekCompletion}),Mp(),co(),ze("discover");let $p=()=>{let c=e.capturedTimeline,p=Sn();e.capturedTimeline&&(p||e.capturedTimeline!==c||!qe._timeline)&&(qe._timeline=e.capturedTimeline);let g=ot(e.capturedTimeline,0);if(g>0&&f.setDuration(g),ze("discover",e.currentTime),!e.capturedTimeline){let y=window.__timelines??{},E=Object.keys(y).filter(N=>y[N]);if(E.length>0){let P=X()?.getAttribute("data-composition-id")??null;F("root_timeline_unbound_registry_present",{reason:P?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:P,registeredTimelineKeys:E},"root_timeline_unbound_registry_present"),console.warn("[hyperframes] Root timeline not bound \u2014 render will freeze at t=0. "+(P?`Root data-composition-id is "${P}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${E.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${P??"<root-id>"}"] = tl).`)}}window.__renderReady=!0,ht(),Pe(!0)},$t=null,jp=()=>{if($t)return;let c=()=>{window.removeEventListener("hf-timelines-built",c),$t=null,Nt()};$t=c,window.addEventListener("hf-timelines-built",c)};C(()=>{$t&&(window.removeEventListener("hf-timelines-built",$t),$t=null)}),Nt=()=>{if(!J){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,jp();return}if(ze("discover",e.currentTime),!qp()){window.__renderReady=!1;return}$p()},Nt(),J&&setTimeout(()=>{Nt()},0);let Vr=0,zr=!1,vo=Number.NaN,So=null,qr=!1,gt=null,$r=!1,El="",wl=-1,jr=!1,_l=Number.NEGATIVE_INFINITY,Kp=(c,p,g,y)=>{try{let E=y?.suppressEvents===!0;rt(c),typeof c.totalTime=="function"?c.totalTime(p,E):c.seek(p,E)}catch(E){L(g,E)}},Yp=(c,p)=>{let g=window.__timelines??{},y=X()?.getAttribute("data-composition-id")??null;for(let[E,N]of Object.entries(g)){if(!N||E===y)continue;let P=document.querySelector(`[data-composition-id="${CSS.escape(E)}"]`);if(!P)continue;let K=q(P,0);if(!Number.isFinite(K))continue;let $=Ae(N),ne=Qe(P)+Math.max(0,c-K)*Le(P),Ee=Math.max(0,$!=null&&$>0?Math.min($,ne):ne);Kp(N,Ee,"runtime.init.transport.childTimeline",p)}},Xp=c=>{let p=window.__timelines??{},g=[];for(let y of Object.values(p))if(!(!y||y===c)){g.push(y);try{y.play()}catch(E){L("runtime.init.activateSiblings",E)}}return g},Cl=c=>typeof c=="object"&&c!==null,Rn=new WeakMap,Jp=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],Rl=(c,p)=>{let g=c[p];if(typeof g!="function")return null;try{let y=Number(g.call(c));return Number.isFinite(y)?y:null}catch(y){return L("runtime.init.gsapCallbackDuration",y),null}},Qp=c=>{let p=Rn.get(c);if(p!=null)return p;if(!("getChildren"in c)||typeof c.getChildren!="function")return!1;let g;try{g=c.getChildren(!0,!0,!0)}catch(y){return L("runtime.init.gsapCallbackChildren",y),Rn.set(c,!1),!1}if(!Array.isArray(g))return Rn.set(c,!1),!1;for(let y of g){if(!Cl(y))continue;let E=y.vars;if(!Cl(E)||!Jp.some($=>typeof E[$]=="function"))continue;let K=Rl(y,"totalDuration")??Rl(y,"duration");if(K!=null&&K<=1e-6)return Rn.set(c,!0),!0}return Rn.set(c,!1),!1};function Lt(c,p){let g=e.capturedTimeline,y=g&&p?.activateChildren?Xp(g):[];try{Zp(g,c,p)}finally{for(let E of y)rt(E)}}function Zp(c,p,g){let y=g?.suppressEvents===!0;if(c){let E=c,N=p;if(typeof E.totalDuration=="function")try{let P=Number(E.totalDuration());Number.isFinite(P)&&P>0&&p>P&&(N=P)}catch(P){L("runtime.init.transport.clampDuration",P)}try{typeof c.totalTime=="function"?(c.totalTime(N,y),!y&&!Qp(c)&&(c.totalTime(N+.001,!0),c.totalTime(N,!0))):c.seek(N,y)}catch(P){L("runtime.init.transport.seek",P)}}Yp(p,g);for(let E of e.deterministicAdapters)if(!(E.name==="gsap"&&c))try{E.seek({time:p,suppressEvents:y})}catch(N){L("runtime.init.transport.adapter",N)}}let Ao=Ef(document,()=>{zt()});a.push(()=>Ao.disconnect());let eh=()=>{try{return Ao.isActive()}catch{return!1}},th=()=>!f.isPlaying()&&!Zs()&&Ao.observing&&!qr&&!jr&&e.currentTime===vo&&e.capturedTimeline===So,Tl=()=>`${Nr()}|${Qs()??""}`,kl=()=>{gt=window.setTimeout(nh,e.bridgeMaxPostIntervalMs)},nh=()=>{if(gt=null,!e.tornDown&&!(typeof window>"u"||typeof document>"u")){if(Tl()!==El){zt();return}Pe(!1),kl()}},rh=()=>{if(e.transportRafId=null,e.tornDown)return;let c=$r;if($r=!1,c||!th()){e.transportRafId=window.requestAnimationFrame(Eo);return}El=Tl(),kl()};zt=()=>{e.tornDown||($r=!0,!(zr||e.transportRafId!=null)&&(gt!=null&&(window.clearTimeout(gt),gt=null),$r=!1,e.transportRafId=window.requestAnimationFrame(Eo)))};let Eo=()=>{if(!(e.tornDown||zr)){zr=!0;try{Vr+=1;let c=Nr();c!==wl&&(wl=c,jr=!0);let p=Date.now(),g=jr&&!f.isPlaying()&&p-_l>=wf;if(g&&(_l=p),_f({tick:Vr,isPlaying:f.isPlaying(),hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:f.now(),compositionChanged:g})){let P=e.capturedTimeline;if(Sn()){e.capturedTimeline&&!qe._timeline&&(qe._timeline=e.capturedTimeline),e.capturedTimeline&&e.capturedTimeline!==P&&rt(e.capturedTimeline);let K=ot(e.capturedTimeline,0,c);K>0&&f.setDuration(K),ht()}}if((g||Vr%20===0)&&(ht(),jr=!1),(g||Vr%30===0)&&co(),e.capturedTimeline){let P=ot(e.capturedTimeline,0,c);P>0&&(!f.isPlaying()||P>=f.getDuration())&&f.setDuration(P)}if(f.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&m.isActive()&&m.context){let P=m.getTime();P>=0&&f.attachAudioSource({currentTimeSeconds:P})}else{let P=document.querySelectorAll("audio[data-start]"),K=!1;for(let $ of P){if(!ge($)||!$.isConnected||b($))continue;let ne=Z($),Ee=Ce($.dataset.duration),He=Ee!=null&&Ee>0?ne+Ee:1/0,ae=Qe($);if(Number.isFinite(ne)&&e.currentTime>=ne&&e.currentTime<He){$.paused?!$.error&&$.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(f.attachAudioSource({currentTimeSeconds:e.currentTime}),K=!0):(f.attachAudioSource({el:$,compositionStart:ne,mediaStart:ae}),K=!0);break}}!K&&f.hasAudioSource()&&f.detachAudioSource()}else f.hasAudioSource()&&f.detachAudioSource();let y=f.now();e.currentTime=y;let E=f.isPlaying();if(!E&&eh()?qr=!0:(E||qr||y!==vo||e.capturedTimeline!==So)&&(Lt(y),vo=y,So=e.capturedTimeline,E||(qr=!1)),E&&Ye.redrawAnimated(),f.isPlaying()&&f.reachedEnd()){m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1;let P=f.getDuration();Number.isFinite(P)&&(f.seek(P),e.currentTime=P,Lt(P)),ze("pause"),Ge(),Pe(!0);return}f.isPlaying()?Ge():Up()&&(wn=null,Ge()),Pe(!1)}finally{zr=!1,rh()}}},Ml=c=>{let p=document.querySelectorAll("video, audio");for(let g of p){if(!ge(g)||!g.isConnected||!g.hasAttribute("data-start"))continue;let y=Z(g);if(!Number.isFinite(y))continue;let E=Ce(g.dataset.duration),N=E!=null&&E>0?y+E:1/0;if(c<y||c>=N)continue;let P=Qe(g),K=c-y+P;if(K>=0)try{g.currentTime=K}catch{}}},wo=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let c=m.startGeneration(),p=document.querySelectorAll("audio[data-start]");for(let g of p){if(!ge(g)||!g.isConnected||b(g))continue;let y=Z(g);if(!Number.isFinite(y))continue;let E=Qe(g),N=Number.parseFloat(g.dataset.volume??""),P=Number.isFinite(N)?N:1,K=Ce(g.dataset.duration),$=K!=null&&K>0?K:Number.POSITIVE_INFINITY,ne=g.closest("[data-composition-id]");if(ne){let ae=q(ne,0),Y=O(ne,{includeAuthoredTimingAttrs:!0});Y!=null&&Y>0&&($=Math.min($,Math.max(0,ae+Y-y)))}let Ee=gn(g);bn(g,Ee),(Ee.kind==="web-audio"?m.scheduleMediaElementPlayback(g,y,E,f.now(),P,c,e.playbackRate):Promise.resolve(null)).then(ae=>{if(ae||!f.isPlaying())return;let Y=e.playbackRate*Le(g),Re=g.hasAttribute("data-fx-chain")||g.hasAttribute("data-automation");if(Math.abs(Y-1)>1e-9){Ee.kind==="web-audio"&&Re&&(g.muted=!0);return}m.decodeAudioElement(g).then(Dt=>{!Dt||!f.isPlaying()||m.schedulePlayback(g,Dt,y,E,f.now(),P,c,e.playbackRate,$)})})}};function Fl(){m.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&h&&f.isPlaying()&&m.hasBoundedActiveSources()&&(m.stopAll(),wo())}if(e.capturedTimeline){let c=ot(e.capturedTimeline,0);c>0&&f.setDuration(c),rt(e.capturedTimeline)}Am(window),e.transportRafId=window.requestAnimationFrame(Eo),ht(),Pe(!0),e.controlBridgeHandler=Il({onPlay:()=>{qe.play(),Be("composition_played",{time:qe.getTime()})},onPause:()=>{qe.pause(),Be("composition_paused",{time:qe.getTime()})},onStopMedia:()=>{m.stopAll();let c=document.querySelectorAll("video, audio");for(let p of c)ge(p)&&!p.paused&&p.pause()},onSeek:(c,p)=>{qe.seek(c),Be("composition_seeked",{time:c})},onSetMuted:c=>{e.bridgeMuted=c;let p=c||e.mediaOutputMuted;m.setMuted(p);let g=document.querySelectorAll("video, audio");for(let y of g)ge(y)&&(y.muted=p||y.defaultMuted)},onSetVolume:c=>{e.bridgeVolume=c,m.setVolume(c);let p=document.querySelectorAll("video, audio");for(let g of p){if(!ge(g))continue;let y=parseFloat(g.dataset.volume??""),E=Number.isFinite(y)?y:1;g.volume=ti(E*c)}},onSetMediaOutputMuted:c=>{e.mediaOutputMuted=c;let p=c||e.bridgeMuted;m.setMuted(p);let g=document.querySelectorAll("video, audio");for(let y of g)ge(y)&&(y.muted=p||y.defaultMuted)},onSetNativeMediaSyncDisabled:c=>{e.nativeMediaSyncDisabled!==c&&(e.nativeMediaSyncDisabled=c,e.mediaForceSyncNextTick=!0,c?(m.stopAll(),f.detachAudioSource()):Ge())},onSetWebAudioMediaDisabled:c=>{e.webAudioMediaDisabled!==c&&(e.webAudioMediaDisabled=c,e.mediaForceSyncNextTick=!0,c&&(m.stopAll(),f.detachAudioSource()),Ge())},onSetPlaybackRate:c=>{yo(c),e.transportClock&&e.transportClock.setRate(e.playbackRate),Fl()},onSetRootDuration:Vp,onSetColorGrading:(c,p)=>{Ye.setGrading(c,p)},onSetColorGradingCompare:(c,p)=>{Ye.setCompare(c,p)},onTick:()=>{if(e.tornDown||!f.isPlaying())return;let c=f.now();if(e.currentTime=c,Lt(c),f.reachedEnd()){m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1;let p=f.getDuration();Number.isFinite(p)&&(f.seek(p),e.currentTime=p,Lt(p)),ze("pause"),Ge(),Pe(!0)}},onEnablePickMode:()=>Wr.enablePickMode(),onDisablePickMode:()=>Wr.disablePickMode(),onSetRuntimeData:eo,onClearRuntimeData:to,getCanonicalFps:()=>e.canonicalFps});let _o=()=>{if(!e.tornDown){e.tornDown=!0,e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),gt!=null&&(window.clearTimeout(gt),gt=null),e.transportClock=null,m.destroy(),Ft!=null&&(window.clearTimeout(Ft),Ft=null),s!=null&&(window.cancelAnimationFrame(s),s=null),Lp(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),i&&(window.removeEventListener("error",i),i=null),o&&(window.removeEventListener("unhandledrejection",o),o=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),Wr.disablePickMode();for(let c of e.deterministicAdapters)if(!(!c||typeof c.revert!="function"))try{c.revert()}catch(p){L("runtime.init.site12",p)}e.deterministicAdapters=[];for(let c of a.splice(0))try{c()}catch(p){L("runtime.init.site13",p)}for(let c of e.injectedCompStyles)try{c.remove()}catch(p){L("runtime.init.site14",p)}e.injectedCompStyles=[];for(let c of e.injectedCompLinks)try{c.remove()}catch(p){L("runtime.init.site15",p)}e.injectedCompLinks=[];for(let c of e.injectedCompScripts)try{c.remove()}catch(p){L("runtime.init.site16",p)}e.injectedCompScripts=[],e.capturedTimeline=null,t=()=>{},window.__hfRuntimeTeardown===_o&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=_o,e.beforeUnloadHandler=_o,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var Wf=["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"],Vs=[[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 Wv(e){if(e<=255)return Wf[e];let t=0,n=Vs.length-1;for(;t<=n;){let r=t+n>>1,i=Vs[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return"L"}function Vv(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let u=0;u<t;){let d=e.charCodeAt(u),f=d,m=1;if(d>=55296&&d<=56319&&u+1<t){let b=e.charCodeAt(u+1);b>=56320&&b<=57343&&(f=(d-55296<<10)+(b-56320)+65536,m=2)}let h=Wv(f);(h==="R"||h==="AL"||h==="AN")&&(r=!0);for(let b=0;b<m;b++)n[u+b]=h;u+=m}if(!r)return null;let i=0;for(let u=0;u<t;u++){let d=n[u];if(d==="L"){i=0;break}if(d==="R"||d==="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 d=n[u];d==="EN"?n[u]=s==="AL"?"AN":"EN":(d==="R"||d==="L"||d==="AL")&&(s=d)}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 d;for(d=u-1;d>=0&&n[d]==="ET";d--)n[d]="EN";for(d=u+1;d<t&&n[d]==="ET";d++)n[d]="EN"}for(let u=0;u<t;u++){let d=n[u];(d==="WS"||d==="ES"||d==="ET"||d==="CS")&&(n[u]="ON")}s=l;for(let u=0;u<t;u++){let d=n[u];d==="EN"?n[u]=s==="L"?"L":"EN":(d==="R"||d==="L")&&(s=d)}for(let u=0;u<t;u++){if(n[u]!=="ON")continue;let d=u+1;for(;d<t&&n[d]==="ON";)d++;let f=u>0?n[u-1]:l,m=d<t?n[d]:l,h=f!=="L"?"R":"L";if(h===(m!=="L"?"R":"L"))for(let v=u;v<d;v++)n[v]=h;u=d-1}for(let u=0;u<t;u++)n[u]==="ON"&&(n[u]=a);for(let u=0;u<t;u++){let d=n[u];(o[u]&1)===0?d==="R"?o[u]++:(d==="AN"||d==="EN")&&(o[u]+=2):(d==="L"||d==="AN"||d==="EN")&&o[u]++}return o}function Vf(e,t){let n=Vv(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 zv=/[ \t\n\r\f]+/g,qv=/[\t\n\r\f]| {2,}|^ | $/;function $v(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function jv(e){if(!qv.test(e))return e;let t=e.replace(zv," ");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 Kv(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
704
+ `,Ts=new WeakMap;function ks(e){return of.has(e)}var of=new WeakSet;function Ms(e){let t=Ts.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(tv)))}`;await e.audioWorklet.addModule(n),of.add(e)})().catch(n=>{throw Ts.delete(e),n}),Ts.set(e,t)),t}function nv(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,d=0;for(let m=0;m<i;m++){u+=s*(l()-u);let h=u*Math.pow(1-m/i,2.5);o[m]=h,d+=h*h}let f=Math.sqrt(d);if(f>0)for(let m=0;m<i;m++)o[m]=(o[m]??0)/f;return o}var ue=e=>typeof e=="number"?e:Number(e??0),Fs=e=>e/1e3;function uf(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 d=u/i;a[u]=t==="sine"?Math.sin(2*Math.PI*d):4*Math.abs((d+.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 cf(e){try{e.stop()}catch{}e.disconnect()}function Ns(e,t){return[{param:e},{param:t,map:n=>1-n}]}function df(e,t,n){e.gain.value=n,t.gain.value=1-n}function Ls(e,t,n){return{input:e,output:e,update:t,automation:n,dispose:()=>e.disconnect()}}var rv=new Set(["peaking","highpass","lowpass"]),af=e=>Math.pow(10,e/20),iv=(e,t)=>{let n=e.createGain(),r=i=>{n.gain.value=af(ue(i.gain))};return r(t),Ls(n,r,{gain:[{param:n.gain,map:af}]})};function Ar(e,t){return(n,r)=>{let i=n.createBiquadFilter();i.type=e;let o=a=>{i.frequency.value=ue(a.frequency),a.q!==void 0&&(i.Q.value=ue(a.q)),t&&(i.gain.value=ue(a.gain))};return o(r),Ls(i,o,{frequency:[{param:i.frequency}],...rv.has(e)?{q:[{param:i.Q}]}:{},...t?{gain:[{param:i.gain}]}:{}})}}function ov(e){return(t,n)=>{let r=Math.tan(Math.PI*ue(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 Ls(i,()=>{})}}function Er(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 av={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))},sv=(e,t)=>{let n=e.createWaveShaper(),r=e.createGain(),i=e.createGain();r.connect(n).connect(i);let o=a=>{let l=av[String(a.type)]??Math.tanh,s=Math.pow(10,ue(a.threshold)/20),u=8192,d=new Float32Array(u);for(let f=0;f<u;f++){let m=f/(u-1)*2-1;d[f]=l(m/Math.max(1e-6,s))*s}n.curve=d,n.oversample=ue(a.oversample)>=4?"4x":ue(a.oversample)>=2?"2x":"none",i.gain.value=Math.pow(10,ue(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()}}},lv=(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,ue(u.time)/1e3),o.gain.value=ue(u.feedback),df(a,l,ue(u.mix))};return s(t),{input:n,output:r,update:s,automation:{time:[{param:i.delayTime,map:u=>Math.min(5,Fs(u))}],feedback:[{param:o.gain}],mix:Ns(a.gain,l.gain)},dispose:()=>[n,r,i,o,a,l].forEach(u=>u.disconnect())}},uv=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createDelay(.5),a=uf(e,"sine",ue(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 d=f=>{o.delayTime.value=ue(f.delay)/1e3,l.gain.value=ue(f.depth)/1e3,a.playbackRate.value=ue(f.speed),df(s,u,ue(f.mix))};return d(t),{input:r,output:i,update:d,automation:{delay:[{param:o.delayTime,map:Fs}],depth:[{param:l.gain,map:Fs}],speed:[{param:a.playbackRate}],mix:Ns(s.gain,u.gain)},dispose:()=>{cf(a),[r,i,o,l,s,u].forEach(f=>f.disconnect())}}},cv=6,dv=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createGain(),a=e.createGain(),l=uf(e,String(t.type)==="1"?"sine":"triangle",ue(t.speed),n),s=e.createGain(),u=e.createGain(),d=e.createGain(),f=[];r.connect(o);let m=o;for(let b=0;b<cv;b++){let v=e.createBiquadFilter();v.type="allpass",v.Q.value=.7071,s.connect(v.frequency),m.connect(v),m=v,f.push(v)}l.connect(s),m.connect(u).connect(a),o.connect(d).connect(a),a.connect(i);let h=b=>{let v=1e3/Math.max(.1,ue(b.delay));for(let x of f)x.frequency.value=v;s.gain.value=v*ue(b.decay),l.playbackRate.value=ue(b.speed),o.gain.value=ue(b.in_gain),a.gain.value=ue(b.out_gain),u.gain.value=1,d.gain.value=1};return h(t),{input:r,output:i,update:h,automation:{speed:[{param:l.playbackRate}],in_gain:[{param:o.gain}],out_gain:[{param:a.gain}]},dispose:()=>{cf(l),[r,i,o,a,s,u,d,...f].forEach(b=>b.disconnect())}}},mv=(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 d=`${ue(u.size)}:${ue(u.damping)}`;if(d!==l){let f=nv(e.sampleRate,ue(u.size),ue(u.damping)),m=e.createBuffer(1,f.length,e.sampleRate);m.getChannelData(0).set(f),i.buffer=m,l=d}o.gain.value=ue(u.wet),a.gain.value=ue(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())}},fv={"gain-node":iv,"biquad-peaking":Ar("peaking",!0),"biquad-lowshelf":Ar("lowshelf",!0),"biquad-highshelf":Ar("highshelf",!0),"biquad-highpass":Ar("highpass",!1),"biquad-lowpass":Ar("lowpass",!1),"worklet-compressor":Er("hf-compressor"),"worklet-limiter":Er("hf-limiter"),"worklet-gate":Er("hf-gate"),"worklet-bitcrush":Er("hf-bitcrush"),"worklet-pitchshift":Er("hf-pitchshift"),waveshaper:sv,"delay-feedback":lv,"chorus-lfo":uv,"allpass-phaser":dv,convolver:mv};function mf(e){return e.nodes.some(t=>Dn(t.type)?.web.startsWith("worklet-")??!1)}function pv(e,t,n,r=0){let i=Dn(t);if(!i)throw new Error(`Unknown effect type: ${t}`);let o=In(t,n);if((t==="highpass"||t==="lowpass")&&String(o.poles)==="1")return ov(t)(e,o,r);let a=fv[i.web];if(!a)throw new Error(`No Web Audio builder for ${i.web}`);return a(e,o,r)}function sf(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 lf(e){return Pn(e).map(t=>{let n=In(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 ff(e,t,n=0){var f;let r=e.createGain(),i=e.createGain(),o=[],a=[],l=sf(Pn(t)),s=r;for(let m of l){let h=null;if(m.preset){let b=e.createGain(),v=e.createGain(),x=e.createGain(),_=e.createGain();x.gain.value=m.amount,v.gain.value=1-m.amount,s.connect(b),b.connect(v).connect(_),h={entry:b,wet:x,dry:v,join:_},s=b}for(let b of m.nodes){let v=pv(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})}h&&m.preset&&(s.connect(h.wet).connect(h.join),a.push({id:m.preset,...h}),s=h.join)}s.connect(i);let u=lf(t),d={};for(let m of a)(d[f=m.id]??(d[f]=[])).push(...Ns(m.wet.gain,m.dry.gain));return{input:r,output:i,presets:d,nodes:o,update(m){if(lf(m)!==u)return!1;Pn(m).forEach((b,v)=>{let x=o[v];x&&(x.handle.update(In(b.type,b.params)),b.id===void 0?delete x.id:x.id=b.id)});let h=0;for(let b of sf(Pn(m))){if(!b.preset)continue;let v=a[h++];!v||v.id!==b.preset||(v.wet.gain.value=b.amount,v.dry.gain.value=1-b.amount)}return!0},dispose(){for(let{handle:m}of o)m.dispose();for(let{entry:m,wet:h,dry:b,join:v}of a)m.disconnect(),h.disconnect(),b.disconnect(),v.disconnect();r.disconnect(),i.disconnect()}}}var pf={version:1,nodes:[]},hf={version:1,lanes:[]};function gf(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(ut):null)??"";if(!n)return hf;try{return Tu(ui(n),t)}catch{return hf}}function hn(e){let t=(typeof e.getAttribute=="function"?e.getAttribute(It):null)??"";if(!t)return{chain:pf,raw:""};try{return{chain:_u(t),raw:t}}catch{return{chain:pf,raw:""}}}function bf(e){return gf(e,hn(e).chain)}function Xi(e,t,n,r,i){let{chain:o}=hn(t),a=null,l=[],s=!1,u=0,d=()=>{try{a?(n.disconnect(a.input),a.output.disconnect(r),a.dispose()):n.disconnect(r)}catch{}a=null},f=(C,F)=>{if(C.nodes.length===0){n.connect(r);return}if(mf(C)&&!ks(e)){n.connect(r);let D=++u;Ms(e).then(()=>{s||D!==u||x(hn(t).chain)}).catch(()=>{});return}try{let D=ff(e,C,F);n.connect(D.input),D.output.connect(r),a=D}catch{n.connect(r)}},m=(C,F)=>{l=F&&a?nf(gf(t,C),C,a.nodes,F,a.presets):[]},h=i?{...i}:null;f(o,h?.elapsed??0),m(o,h);let b=()=>{if(!h)return null;let C=typeof e.currentTime=="number"?e.currentTime:h.scheduledAt;return{scheduledAt:C,elapsed:h.elapsed+(C-h.scheduledAt)*h.rate,rate:h.rate}},v=C=>{let F=b();F&&(pn(l,F.scheduledAt),m(C,F))},x=C=>{let F=b();pn(l,F?.scheduledAt??0),d(),f(C,F?.elapsed??0),m(C,F)},_=null,T=t;return typeof MutationObserver<"u"&&typeof T?.nodeType=="number"&&(_=new MutationObserver(()=>{let C=hn(t);l.length>0&&Sr(l),!a||!a.update(C.chain)?x(C.chain):v(C.chain)}),_.observe(T,{attributes:!0,attributeFilter:[It,ut]})),{reanchor:C=>{if(s)return;let F=b();F&&pn(l,F.scheduledAt),h={...C},m(hn(t).chain,h)},setRate:C=>{let F=b();s||!F||!Number.isFinite(C)||C<=0||C===F.rate||(h={...F,rate:C},pn(l,F.scheduledAt),m(hn(t).chain,h))},dispose:()=>{s=!0,_?.disconnect(),l.length>0&&pn(l,typeof e.currentTime=="number"?e.currentTime:0),a?.dispose()}}}var xf="runtime_web_audio_bypass";function Ds(e,t){return typeof e.getAttribute=="function"?e.getAttribute(t):null}function wr(e,t){return Ds(e,t)!==null}function hv(e){return wr(e,"crossorigin")?!0:e.crossOrigin!=null}function gv(e){return typeof e.baseURI=="string"&&e.baseURI?e.baseURI:typeof document<"u"?document.baseURI:""}function bv(e){let t=typeof e.currentSrc=="string"?e.currentSrc:"";if(t)return[t];let n=Ds(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 xv(e,t){let n;try{n=new URL(e,gv(t))}catch{return null}return n.protocol!=="http:"&&n.protocol!=="https:"?null:n}function yv(){return typeof window.origin=="string"?window.origin:window.location.origin}function vv(e,t){if(typeof window>"u")return null;let n=xv(e,t);if(!n)return null;let r=yv(),i=r==="null";return!i&&n.origin===r||hv(t)?null:i?"opaque_document_origin":"cross_origin_no_cors"}function vf(e){return(typeof e.currentSrc=="string"?e.currentSrc:"")?!0:wr(e,"src")}function gn(e){for(let t of bv(e)){let n=vv(t,e);if(n)return{kind:"decode-only",reason:n,asset:t}}return{kind:"web-audio"}}function Sv(e){let t=[];wr(e,It)&&t.push("fx-chain"),wr(e,ut)&&t.push("automation"),wr(e,di)&&t.push("audio-group");let n=Number.parseFloat(Ds(e,"data-volume")??"");return Number.isFinite(n)&&n>1&&t.push("above-unity-gain"),t}function Av(){return typeof window<"u"&&!!window.__HF_EXPORT_RENDER_SEEK_CONFIG}var yf=new WeakSet,Ev={cross_origin_no_cors:"cross-origin media without a `crossorigin` opt-in is silent through createMediaElementSource (Web Audio spec); using native playback instead",opaque_document_origin:"this document's security origin is opaque (a sandbox without `allow-same-origin`), so no media is same-origin with it and createMediaElementSource would be silent (Web Audio spec); using native playback instead"},wv={cross_origin_no_cors:"proxy or download the asset to a same-origin URL to keep it.",opaque_document_origin:"add `allow-same-origin` to the sandbox, or serve the asset with a `crossorigin` attribute and an `Access-Control-Allow-Origin` of `null` or `*`, to keep it."};function bn(e,t){if(t.kind==="web-audio"||Av()||yf.has(e))return;let n=Sv(e);yf.add(e);let r={asset:t.asset,reason:t.reason,lostProcessing:n,note:Ev[t.reason]};ve({source:"hf-preview",type:"diagnostic",code:xf,details:r});let i=n.length>0?` Native playback cannot reproduce: ${n.join(", ")} \u2014 ${wv[t.reason]}`:"";console.info(`[hyperframes] ${xf}: "${t.asset}" (${t.reason}): Web Audio capture withheld; the track plays through native HTMLMediaElement output.${i}`)}function Is(e){return!Number.isFinite(e)||e<=0?1:e}function Sf(e){return Ue(e)}function _v(e,t){t||e.paused||!Kr().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function Cv(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 f=n*a,m=u-f;return s&&m<=0?!1:(s?e.start(0,f+r,m):e.start(0,f+r),!0)}let d=-n/o;return s?e.start(i+d,r,u):e.start(i+d,r),!0}function Ji(e,t,n){let r=rf(bf(e));r&&Rs([{param:t.gain}],r,li.scale,n)}function _r(e){return e.sourceKind==="buffer"}var Qi=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=gn(t);if(o.kind!=="web-audio"){try{n.disconnect()}catch{}return this._mediaElementSources.delete(t),bn(t,o),null}return n}if(!this._ctx)return null;let r=gn(t);if(r.kind!=="web-audio")return bn(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=Is(l),d=this._ctx.createGain();d.gain.value=o;let f=this._ctx.currentTime,m=i-n,h={scheduledAt:f,elapsed:m,rate:u},b=Xi(this._ctx,t,s,d,h);d.connect(this.resolveDestination(t,f,i,u)??this._masterGain),Ji(t,d,h),this._rate=u,this._rateAnchorCtx=f,this._rateAnchorComp=i;let v={fx:b,el:t,sourceNode:s,sourceKind:"media-element",gainNode:d,compositionStart:n,mediaStart:r,scheduledAt:f,priorMuted:t.muted,priorVolume:t.volume,mediaPlaybackRate:Le(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(m){L("webAudioTransport.groupReanchor",m)}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=()=>$o(n,t),s=l(),u=this._ctx.createGain();u.gain.value=s?.hasAttribute("data-hidden")?0:1,u.connect(a);let d=this._ctx.createGain();d.gain.value=Sf(qo(s)),d.connect(u);let f=Xi(this._ctx,s??{getAttribute:()=>null},o,d,r);return s&&Ji(s,d,r),this._groups.set(t,{input:o,fader:d,muteGain:u,fx:f,generation:this._playGeneration,reanchor:m=>{Sr([{param:d.gain}]);let h=l();d.gain.value=Sf(qo(h)),u.gain.value=h?.hasAttribute("data-hidden")?0:1,f?.reanchor(m),h&&Ji(h,d,m)},dispose:()=>{try{f?.dispose(),o.disconnect(),d.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=Nu(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 d=Is(s),f=Le(t),m=d*f,h=this._ctx.createBufferSource();h.buffer=n,h.playbackRate.value=m;let b=this._ctx.createGain();b.gain.value=a;let v=o-r,x=this._ctx.currentTime,_={scheduledAt:x,elapsed:v,rate:d},T=Xi(this._ctx,t,h,b,_);if(b.connect(this.resolveDestination(t,x,o,d)??this._masterGain),Ji(t,b,_),this._rate=d,this._rateAnchorCtx=x,this._rateAnchorComp=o,!Cv(h,{elapsed:v,mediaStart:i,scheduledAt:x,globalRate:d,mediaRate:f,clipDuration:u}))return h.disconnect(),T?.dispose(),b.disconnect(),null;let C=t.muted;t.muted=!0,_v(t,C);let F={fx:T,el:t,sourceNode:h,sourceKind:"buffer",gainNode:b,compositionStart:r,mediaStart:i,scheduledAt:x,priorMuted:C,priorVolume:t.volume,mediaPlaybackRate:f,bounded:Number.isFinite(u)&&u>0};return this._activeSources.push(F),this._paused=!1,h.addEventListener("ended",()=>this.handleSourceEnded(h,F,t,C)),F}catch(d){return L("webAudioTransport.schedule",d),null}}setRate(t){let n=Is(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{_r(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=>_r(t)&&t.bounded)}stopAll(){for(let t of this._activeSources){try{_r(t)&&t.sourceNode.stop(),t.sourceNode.disconnect(),t.fx?.dispose(),t.gainNode.disconnect()}catch{}_r(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=Ue(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&&_r(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 Cr="data-hf-studio-manual-edit-gesture";var Af=`[${Cr}]`;function Ef(e,t){let n=e.defaultView?.MutationObserver??globalThis.MutationObserver;if(!n||!e.documentElement)return{isActive:()=>e.querySelector(Af)!=null,observing:!1,disconnect:()=>{}};let r=new Set(e.querySelectorAll(Af)),i=l=>{for(let s of l){let u=s.target;Ne(u)&&(u.hasAttribute(Cr)?r.add(u):r.delete(u))}},o=l=>{l.length!==0&&(i(l),t())},a=new n(o);return a.observe(e.documentElement,{subtree:!0,attributes:!0,attributeFilter:[Cr]}),{observing:!0,isActive:()=>{o(a.takeRecords());for(let l of r){if(l.isConnected&&l.hasAttribute(Cr))return!0;r.delete(l)}return!1},disconnect:()=>{a.disconnect(),r.clear()}}}var wf=333.3333333333333;function _f(e){return e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2?!1:e.compositionChanged===!0?!0:Number.isInteger(e.tick)&&e.tick>0&&e.tick%60===0}var Rv=/^\s*spring\(\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*\)\s*$/;function Cf(e){return Math.max(0,Math.min(1,e))}function Rf(e){let t=Rv.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?Cf(n):null}function Tf(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=Cf(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 Tv=/^\s*wiggle\(\s*(\d+)\s*,\s*(easeOut|easeInOut|anticipate|uniform)\s*(?:,\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?)\s*)?\)\s*$/,kv=Math.PI*2;function Mv(e){let t=Tv.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 Fv(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(kv*t*e)}function kf(e,t){let n=Mv(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=>Fv(a,n.wiggles,n.type,n.amplitude);return t?.set(r,o),o}var Nv=24,Mf=e=>e>=1?1:0,Lv=e=>e,Zi=String.raw`([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)`,Dv=new RegExp(String.raw`^\s*M\s*0\s*,\s*0\s+C\s*${Zi}\s*,\s*${Zi}\s+${Zi}\s*,\s*${Zi}\s+1\s*,\s*1\s*$`,"i");function Ff(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function Iv(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<Nv;l+=1){let s=(o+a)/2;Ff(s,t,r)<e?o=s:a=s}return Ff((o+a)/2,n,i)}function Pv(e){let t=Dv.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=>Iv(a,n,r,i,o)}function Ov(e,t){if(!e.startsWith("spring("))return null;let n=Rf(e);if(n===null)return null;let r=t.get(n);if(r)return r;let i=o=>Tf(o,n);return t.set(n,i),i}function Gv(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=Pv(n);return i&&t.set(n,i),i}function Nf(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"?Mf:kf(s,i)??Ov(s,r)??Gv(s,n),a=(s,u,d=[])=>{let f=o(s);return f||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\(|$)/.test(s.trim())&&Be("custom_ease_parse_failed",{ease:s}),t.call(u,s,...d)??Lv)};e.parseEase=function(u,...d){return a(u,this,d)};let l=e.registerEase;if(typeof l=="function"){l("hold",Mf);let s=u=>{let d=f=>f;d.config=(...f)=>a(`${u}(${f.join(",")})`,e),l(u,d)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}var Gs=new Map,Rr=new Map,Ps=new Map,Os=()=>{},Df=()=>{},Lf=0;function Hs(e){return/^[a-z][a-z0-9-]{0,63}$/.test(e)}function If(e){let t=(Ps.get(e)??0)+1;return Ps.set(e,t),t}function Pf(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:(Lf-=1,Lf)}function Bs(e,t){let n=Rr.get(e);if(!n)return;let r=()=>Ps.get(e)===t.generation&&Rr.get(e)===n;try{Promise.resolve(n(t.payload)).then(()=>{r()&&Df(e,t.requestId)},i=>{r()&&Os(e,t.requestId,i)})}catch(i){r()&&Os(e,t.requestId,i)}}function Of(e){Os=e}function Gf(e){Df=e}function eo(e,t,n){if(!Hs(e))return;let r={payload:t,requestId:Pf(n),generation:If(e)};Gs.set(e,r),Bs(e,r)}function to(e,t){Hs(e)&&(Gs.delete(e),Bs(e,{payload:void 0,requestId:Pf(t),generation:If(e)}))}function Hf(e,t){if(!Hs(e))throw new Error(`Invalid HyperFrames runtime-data channel: ${e}`);Rr.set(e,t);let n=Gs.get(e);return n&&Bs(e,n),()=>{Rr.get(e)===t&&Rr.delete(e)}}var Us="data-hf-authored-duration",Ws="data-hf-authored-end",Bf=!1;function rt(e){if(e){if(typeof e.pause!="function"){Bf||(Bf=!0,Be("timeline_missing_pause",{}));return}try{e.pause()}catch(t){L("runtime.timeline.pause",t)}}}function Uv(){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 Uf(){let e=vc(),t=()=>{};Pl(ve),Of((c,p,g)=>{ve({source:"hf-preview",type:"runtime-data-error",channel:c,requestId:p,message:g instanceof Error?g.message:String(g)})}),Gf((c,p)=>{try{t()}catch(g){ve({source:"hf-preview",type:"runtime-data-error",channel:c,requestId:p,message:g instanceof Error?g.message:String(g)});return}ve({source:"hf-preview",type:"runtime-data-applied",channel:c,requestId:p})}),Hi(document),hs(document),Lu(document);let n=Uv();e.canonicalFps=n.fps??e.canonicalFps,Dl(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG&&console.info("[hyperframes] render runtime fps",{canonicalFps:e.canonicalFps,source:n.source,rawFpsSource:n.rawFpsSource,rawFps:n.rawFps,fallbackReason:n.fallbackReason});let r=null,i=null,o=null,a=[],l=new Set,s=null,u=new Set,d=(c,p,g)=>{u.has(c)||(u.add(c),Be(p,g))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(c){L("runtime.init.site1",c)}let f=new Yi;e.transportClock=f;let m=new Qi,h=!1;m.init().then(c=>{h=c}),window.__hf=window.__hf||{};let b=c=>c.closest("[data-hidden]")!==null||mi(c.ownerDocument,c),v=()=>{let c=window.gsap,p=window;if(!(!c?.registerPlugin||p.__hfAutoNoopRegistered))try{c.registerPlugin({name:"_auto",init:()=>!1}),p.__hfAutoNoopRegistered=!0}catch(g){d("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),L("runtime.autoMarker.install",g)}},x=()=>{let c=window.gsap;if(!c){d("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{Nf(c)||d("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(p){d("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),L("runtime.customEase.install",p)}};v(),x(),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{Vl(document)}catch(c){L("runtime.init.cssVariables",c)}window.__timelines=window.__timelines||{};let _=()=>{let c=document.querySelector('[data-composition-id][data-root="true"]');if(Se(c))return c;let p=Array.from(document.querySelectorAll("[data-composition-id]"));return p.find(g=>!g.parentElement?.closest("[data-composition-id]"))??p[0]??null};if(Array.isArray(window.__timelines)){let c=window.__timelines,p=_()?.getAttribute("data-composition-id")??"root",g={};if(c.length===1)g[p]=c[0];else for(let y=0;y<c.length;y++)g[`tl-${y}`]=c[y];window.__timelines=g}let T=_();T&&!T.hasAttribute("data-start")&&T.setAttribute("data-start","0");let C=c=>{a.push(c)},F=(c,p,g)=>{let y=g??`${c}:${JSON.stringify(p)}`;l.has(y)||(l.add(y),ve({source:"hf-preview",type:"diagnostic",code:c,details:p}))},D=c=>{let p={scale:1,focusX:960,focusY:540},g=[],y=[],E={time:c.getTime(),duration:c.getDuration(),isPlaying:c.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:c.play,pause:c.pause,seek:c.seek,getTime:c.getTime,getDuration:c.getDuration,isPlaying:c.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>p,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>g,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:c.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>y,getRenderState:()=>({...E,time:c.getTime(),duration:c.getDuration(),isPlaying:c.isPlaying()})}},M=1/60,S=.75,A=.05,w=100,R=240,I=c=>{if(c instanceof Error)return c.message||String(c);if(typeof c=="string")return c;try{return JSON.stringify(c)}catch{return String(c??"")}},H=c=>{let p=c.toLowerCase();return p.includes("cannot read properties of null")||p.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:p.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:p.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},j=c=>{if(c==null||c.trim()==="")return null;let p=Number.parseFloat(c);return!Number.isFinite(p)||p<=0?null:`${p}px`},X=()=>_(),k=()=>{let c=X();if(!c)return;let p=j(c.getAttribute("data-width")),g=j(c.getAttribute("data-height"));p&&(c.style.width=p),g&&(c.style.height=g),p&&c.style.setProperty("--comp-width",p),g&&c.style.setProperty("--comp-height",g),p&&(document.documentElement.style.width=p),g&&(document.documentElement.style.height=g),p&&(document.body.style.width=p),g&&(document.body.style.height=g)},U=()=>{let c=X(),p=Array.from(document.querySelectorAll("[data-composition-id]")).filter(g=>g.hasAttribute("data-duration")||g.hasAttribute("data-end"));for(let g of p){if(c&&g===c)continue;let y=g.getAttribute("data-duration"),E=g.getAttribute("data-end");y!=null&&!g.hasAttribute(Us)&&g.setAttribute(Us,y),E!=null&&!g.hasAttribute(Ws)&&g.setAttribute(Ws,E),g.removeAttribute("data-duration"),g.removeAttribute("data-end")}},te=()=>{let c=X();if(!c)return;c.style.position||(c.style.position="relative"),c.style.overflow="hidden";let p=j(c.getAttribute("data-width")),g=j(c.getAttribute("data-height"));p&&(c.style.width=p),g&&(c.style.height=g);let y=Array.from(c.children);for(let E of y){let N=E.tagName.toLowerCase();if(N==="script"||N==="style"||N==="link"||N==="meta"||!E.hasAttribute("data-start")||E.hasAttribute("data-hf-autostamped"))continue;let P=(E.style.top==="0px"||E.style.top==="0")&&(E.style.left==="0px"||E.style.left==="0")&&E.style.width==="100%"&&E.style.height==="100%",K=/translate\(\s*-50%\s*,\s*-50%\s*\)/.test(E.style.transform);if(P&&K&&!E.hasAttribute("data-width")&&!E.hasAttribute("data-height")){let Y=E.style.top,Re=E.style.left,Dt=E.style.width,Fe=E.style.height;E.style.top="",E.style.left="",E.style.width="",E.style.height="";let Xe=window.getComputedStyle(E);Xe.top!=="auto"||Xe.bottom!=="auto"||Xe.left!=="auto"||Xe.right!=="auto"||Xe.width!=="0px"||Xe.height!=="0px"||(E.style.top=Y,E.style.left=Re,E.style.width=Dt,E.style.height=Fe)}let $=window.getComputedStyle(E),ne=$.position;if(ne!=="absolute"&&ne!=="fixed"&&(E.style.position="absolute"),!!E.style.top||!!E.style.bottom||$.top!=="auto"||$.bottom!=="auto"||(E.style.top="0"),!!E.style.left||!!E.style.right||$.left!=="auto"||$.right!=="auto"||(E.style.left="0"),N!=="audio"){let Y=j(E.getAttribute("data-width")),Re=j(E.getAttribute("data-height")),Dt=$.width!=="0px"&&$.width!=="auto",Fe=$.height!=="0px"&&$.height!=="auto";Y?!E.style.width&&!Dt&&(E.style.width=Y):!E.style.width&&$.width==="0px"&&(E.style.width="100%"),Re?!E.style.height&&!Fe&&(E.style.height=Re):!E.style.height&&$.height==="0px"&&(E.style.height="100%")}}},B=c=>st({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:c}),G=null,W=c=>{let p=G;G=B(!0);try{return c()}finally{G=p}},Q=c=>c&&G?G:B(c),q=(c,p=0,g)=>Q(g?.includeAuthoredTimingAttrs??!0).resolveStartForElement(c,p),O=(c,p)=>Q(p?.includeAuthoredTimingAttrs??!0).resolveDurationForElement(c),V=c=>{let p=c.closest("[data-composition-id]"),g=p?q(p,0):null,y=p?O(p,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:p,inheritedStart:g,inheritedDuration:y}},Z=c=>Q(!0).resolveMediaStartForElement(c);window.__hfResolveMediaStartSeconds=Z,a.push(()=>{window.__hfResolveMediaStartSeconds===Z&&delete window.__hfResolveMediaStartSeconds});let pe=(c,p)=>{let g=c.tagName.toLowerCase();if(g==="script"||g==="style"||g==="link"||g==="meta")return!1;let E=g==="video"||g==="audio"?Z(c):q(c,0),N=O(c),P=c.getAttribute("data-composition-id");if(P){let Ee=(window.__timelines??{})[P],He=null;if(Ee&&typeof Ee.duration=="function"){let Y=Number(Ee.duration());Number.isFinite(Y)&&Y>0&&(He=Y)}!(c.hasAttribute("data-duration")||c.hasAttribute("data-end")||c.hasAttribute(Us)||c.hasAttribute(Ws))&&(N==null||N<=0)&&He!=null&&(N=He)}let K=N!=null&&N>0?E+N:Number.POSITIVE_INFINITY,$=window.__HF_EXPORT_RENDER_SEEK_CONFIG?Sa(E,e.canonicalFps):E,ne=window.__HF_EXPORT_RENDER_SEEK_CONFIG&&Number.isFinite(K)?Sa(K,e.canonicalFps):K;return p>=$&&(Number.isFinite(ne)?p<ne:!0)},re=!!document.querySelector("[data-composition-src]"),z=!1;{let c=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let p of c){let g=p.getAttribute("data-composition-id");if(g&&p.children.length===0&&document.querySelector(`template#${CSS.escape(g)}-template`)){z=!0;break}}}let J=!re&&!z,Ae=c=>{if(!c||typeof c.duration!="function")return null;try{let p=Number(c.duration());return Number.isFinite(p)?Math.max(0,p):null}catch{return null}},ce=c=>typeof c=="number"&&Number.isFinite(c)&&c>M,vn=()=>{let c=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));return c.length===0?null:W(()=>{let p=0;for(let g of c){let y=Z(g);if(!Number.isFinite(y))continue;let E=ri(g);E==null||E<=M||(p=Math.max(p,Math.max(0,y)+E))}return p>M?p:null})},it=()=>{let c=X();if(!c)return null;let p=window.__timelines??{},g=st({timelineRegistry:p,includeAuthoredTimingAttrs:!0}),y=0,E=Ce(c.getAttribute("data-duration"));E!=null&&E>0&&(y=E);let N=Array.from(c.querySelectorAll("[data-composition-id][data-start]"));for(let P of N){if(!Ne(P)||P.parentElement?.closest("[data-composition-id]")!==c)continue;let $=g.resolveStartForElement(P,0),ne=g.resolveDurationForElement(P);!Number.isFinite($)||ne==null||ne<=0||(y=Math.max(y,Math.max(0,$)+ne))}return y>M?y:null},Ap=()=>{let c=vn();return typeof c!="number"||!Number.isFinite(c)||c<=M?null:c},Ep=c=>ce(c)?Math.max(M,c*S):M,Qs=()=>{let c=0;for(let p of e.deterministicAdapters){let g=p.getInferredDurationSeconds;if(typeof g!="function")continue;let y=null;try{y=g()}catch(E){L("runtime.init.adapterDuration",E)}typeof y=="number"&&Number.isFinite(y)&&y>0&&(c=Math.max(c,y))}return c>M?c:null},Mr=!1,Zs=()=>Mr&&window.__HF_EXPORT_RENDER_SEEK_CONFIG!=null,wp=["data-start","data-duration","data-end","data-composition-id","data-composition-src","data-composition-file","data-root","data-hf-authored-duration","data-hf-authored-end","data-hf-auto-start",ii,"data-playback-rate","data-playback-start","data-media-start","id","src"],el=["loadedmetadata","durationchange","emptied"],Fr=null,tl=-1,nl=null,Mt=null,rl=0,zt=()=>{},qt=()=>{rl+=1,zt()},il=()=>({media:Ap(),authoredComposition:it()}),_p=()=>{let c=window.__timelines??{},p="";for(let g of Object.keys(c)){let y=c[g];y&&(p+=`${g}=${Ae(y)??"?"};`)}return p},Cp=()=>{if(!(Mt||typeof MutationObserver>"u")){Mt=new MutationObserver(qt),Mt.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:wp});for(let c of el)document.addEventListener(c,qt,!0);a.push(()=>{Mt?.disconnect(),Mt=null,qt();for(let c of el)document.removeEventListener(c,qt,!0)})}},Nr=()=>{Cp(),Mt&&Mt.takeRecords().length>0&&qt();let c=_p();return c!==nl&&(nl=c,qt()),rl},ol=c=>Mr?il():(c??(c=Nr()),Fr&&tl===c||(tl=c,Fr=il()),Fr),ot=(c,p=0,g)=>{let y=Ae(c),{media:E,authoredComposition:N}=ol(g),P=Qs(),K=Math.max(E??0,N??0,P??0),$=Number.isFinite(p)&&p>M?p:0,ne=0;return ce(y)?ne=Math.max(y,K,$):ce(K)?ne=Math.max(K,$):ne=$,ne>0?Math.max(0,ne):0},uo=()=>{let c=window.__timelines??{},p=de=>{let se=Object.entries(c).filter(me=>!!me[1]&&typeof me[1].play=="function"&&typeof me[1].pause=="function");if(se.length!==1)return{timeline:null};let ie=se[0];if(!ie)return{timeline:null};let[ye,we]=ie;return{timeline:we,selectedTimelineIds:[ye],selectedDurationSeconds:Ae(we),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:de,soleTimelineId:ye}}}},g=st({timelineRegistry:c,includeAuthoredTimingAttrs:!0}),{media:y,authoredComposition:E}=ol(),N=Math.max(y??0,E??0)||null,P=Ep(N),K=de=>{let se=document.querySelector(`[data-composition-id="${CSS.escape(de)}"]`);return se?g.resolveStartForElement(se,0):0},$=de=>{let se=window.gsap;if(!se||typeof se.timeline!="function")return null;let ie=se.timeline({paused:!0});for(let ye of de)ie.add(ye.timeline,K(ye.compositionId));return ie},ne=(de,se)=>{if(!ce(de))return null;let ie=window.gsap;if(!ie||typeof ie.timeline!="function")return null;let ye=ie.timeline({paused:!0});if(se)try{ye.add(se,0)}catch(me){L("runtime.init.site2",me)}let we=ye;if(typeof we.to=="function")try{we.to({},{duration:de})}catch(me){L("runtime.init.site3",me)}return ye},Ee=(de,se)=>{if(!de||typeof de.getChildren!="function")return[];try{let ie=de.getChildren(!0,!0,!0);return Array.isArray(ie)?se.filter(ye=>ie.includes(ye.timeline)):[]}catch{return[]}},He=(de,se)=>{let ie=de,ye={addedIds:[],nested:[]};if(typeof ie.getChildren!="function")return ye;try{let we=ie.getChildren(!0,!0,!0)??[];if(!Array.isArray(we))return ye;let me=[];for(let _e of se)if(!we.some(at=>at===_e.timeline))try{let at=K(_e.compositionId);de.add(_e.timeline,at),me.push(_e.compositionId)}catch(at){L("runtime.init.site4",at)}return{addedIds:me,nested:Ee(de,se)}}catch{return ye}},ae=X(),Y=ae?.getAttribute("data-composition-id")??null;if(!Y)return p("root_missing_composition_id");let Re=c[Y]??null,Fe=(()=>{if(!ae)return[];let de=new Set,se=Array.from(ae.querySelectorAll("[data-composition-id]")),ie=[];for(let ye of se){let we=ye.getAttribute("data-composition-id");if(!we||we===Y||de.has(we))continue;de.add(we);let me=c[we]??null;if(!me||typeof me.play!="function"||typeof me.pause!="function")continue;let _e=Ae(me);ie.push({compositionId:we,timeline:me,durationSeconds:_e??0})}return ie})(),Xe=de=>{for(let se of de){let ie=se.timeline;if(typeof ie.paused=="function")try{ie.paused(!1)}catch(ye){L("runtime.init.site5",ye)}}};if(Re){let de=Fe.length>0?He(Re,Fe):{addedIds:[],nested:[]},se=de.addedIds;if(Xe(de.nested),(Fe.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id='"+Y+"'])"))&&(Lr=!0),se.length>0)try{let me=Re.time();Re.seek(me,!1)}catch{}let ie=Ae(Re);if(!ce(ie)&&Fe.length>0){let me=Fe.map(ih=>ih.compositionId),_e=$(Fe),jt=Ae(_e);if(_e&&ce(jt))return Xe(Ee(_e,Fe)),{timeline:_e,selectedTimelineIds:me,selectedDurationSeconds:jt,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:Y,rootDurationSeconds:ie,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:P,selectedDurationSeconds:jt,mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:E,selectedTimelineIds:me,autoNestedChildren:se}}};let at=ne(N??0,Re),Co=Ae(at);if(at&&ce(Co))return{timeline:at,selectedTimelineIds:[Y],selectedDurationSeconds:Co,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:Y,rootDurationSeconds:ie,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:E,selectedDurationSeconds:Co,selectedTimelineIds:[Y],autoNestedChildren:se}}}}if(!ce(ie)&&Fe.length===0){let me=ne(N??0,Re),_e=Ae(me);if(me&&ce(_e))return{timeline:me,selectedTimelineIds:[Y],selectedDurationSeconds:_e,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:Y,rootDurationSeconds:ie,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:E,selectedDurationSeconds:_e,selectedTimelineIds:[Y]}}}}let ye=Ce(ae?.getAttribute("data-duration")),we=Math.max(ce(ye)?ye:0,E??0);if(we>0&&ce(we)&&ce(ie)&&we>=ie+.5){let me=Re;if(typeof me.to=="function")try{me.to({},{duration:0},we)}catch(jt){L("runtime.init.site6",jt)}let _e=Ae(Re);if(ce(_e))return{timeline:Re,selectedTimelineIds:[Y],selectedDurationSeconds:_e,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:Y,rootDurationSeconds:ie,rootDeclaredDur:ye,authoredCompositionDurationFloorSeconds:E,newDur:_e}}}}return{timeline:Re,selectedTimelineIds:[Y],selectedDurationSeconds:ie,mediaDurationFloorSeconds:y,diagnostics:se.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:Y,selectedDurationSeconds:ie,autoNestedChildren:se}}:void 0}}if(Fe.length>0){let de=Fe.map(ye=>ye.compositionId),se=$(Fe),ie=Ae(se);if(se)return Xe(Ee(se,Fe)),{timeline:se,selectedTimelineIds:de,selectedDurationSeconds:ie,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:Y,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:P,selectedDurationSeconds:ie,mediaDurationFloorSeconds:y,selectedTimelineIds:de}}}}return p("root_composition_id_unmatched_in_registry")},Lr=!1,Rp=c=>{let p=window.gsap,g=c;if(!(!g||typeof g.getChildren!="function"||!p||typeof p.parseEase!="function"))for(let y of g.getChildren(!0,!0,!0)){let E=y,N=E.timeline;if(!N||!("_ease"in N)||typeof N._ease=="function")continue;let P=E.vars?.keyframes,$=(P&&!Array.isArray(P)?P.ease:void 0)??E.vars?.ease??"none";try{let ne=p.parseEase($);typeof ne=="function"&&(N._ease=ne)}catch(ne){Be("keyframe_ease_repair_failed",{ease:typeof $=="string"?$:String($)}),L("runtime.keyframeEase.repair",ne)}}},Sn=()=>{if(x(),!J)return!1;let c=e.capturedTimeline,p=Ae(c),g=ce(p);if(c&&g&&Lr)return!1;let y=uo();if(!y.timeline)return!1;if(c&&c===y.timeline)return typeof c.timeScale=="function"&&c.timeScale(e.playbackRate),!1;e.capturedTimeline=y.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),Rp(e.capturedTimeline);let E=ot(e.capturedTimeline,0);if(E<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),rt(e.capturedTimeline)),E>0){try{f.setDuration(E)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let P=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(P,!1),rt(e.capturedTimeline)}let N=window.__hfStudioManualEditsApply;typeof N=="function"&&N(),Hi(document)}if(y.diagnostics&&ve({source:"hf-preview",type:"diagnostic",code:y.diagnostics.code,details:y.diagnostics.details}),ve({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:y.selectedTimelineIds??[],selectedDurationSeconds:y.selectedDurationSeconds??null,mediaDurationFloorSeconds:y.mediaDurationFloorSeconds??null}}),window.parent!==window){let N=X(),P=E>0?E:0,K=String(P>0?P:1),$=new Set,ne=ae=>ae.tagName.toLowerCase()===Zt,Ee=new Set(document.querySelectorAll("[data-start]")),He=ae=>{let Y=ae.parentElement;for(;Y&&Y!==N;){if(Ee.has(Y))return!0;Y=Y.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let ae of e.capturedTimeline.getChildren(!0))if(typeof ae.targets=="function")for(let Y of ae.targets())Se(Y)&&Y!==N&&(ne(Y)||Y.hasAttribute("data-start")||He(Y)||$.has(Y)||($.add(Y),Y.setAttribute("data-start","0"),Y.setAttribute("data-duration",K),Y.setAttribute("data-hf-autostamped","1")))}catch{}if(Se(N))for(let ae of N.querySelectorAll("[id]"))Se(ae)&&ae!==N&&(ae.hasAttribute("data-start")||He(ae)||$.has(ae)||ae.tagName==="SCRIPT"||ae.tagName==="STYLE"||ae.tagName==="LINK"||ne(ae)||($.add(ae),ae.setAttribute("data-start","0"),ae.setAttribute("data-duration",K),ae.setAttribute("data-hf-autostamped","1")))}for(let N of An)Dr.delete(N),ml(N);return!0},al=()=>{if(e.tornDown)return;let c=uo();if(!c.timeline){e.capturedTimeline=null,Lr=!1,f.setDuration(0),Hr(e.currentTime);return}e.capturedTimeline!==c.timeline&&(Lr=!1,Sn()),Hr(e.currentTime)};t=()=>{al(),ht()},window.__hfForceTimelineRebind=al;let Tp=()=>{let c=X();if(!Se(c))return;let p=c.getBoundingClientRect(),g=Number(c.getAttribute("data-width")),y=Number(c.getAttribute("data-height")),E=window.getComputedStyle(c),N=Number.isFinite(g)&&g>0&&Number.isFinite(y)&&y>0,P=p.width<=0||p.height<=0||c.clientWidth<=0||c.clientHeight<=0;!N||!P||F("root_stage_layout_zero",{compositionId:c.getAttribute("data-composition-id")??null,declaredWidth:g,declaredHeight:y,rectWidth:Math.round(p.width),rectHeight:Math.round(p.height),clientWidth:c.clientWidth,clientHeight:c.clientHeight,display:E.display,visibility:E.visibility,overflow:E.overflow},`root-stage-layout-zero:${c.getAttribute("data-composition-id")??"unknown"}`)},kp=()=>{e.tornDown||(s!=null&&window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{s=null,Tp()}))},Mp=()=>{i=c=>{let p=I(c.error??c.message).slice(0,R);if(!p)return;let g=H(p);ve({source:"hf-preview",type:"diagnostic",code:g.code,details:{category:g.category,message:p,filename:c.filename||null,line:Number.isFinite(c.lineno)?c.lineno:null,column:Number.isFinite(c.colno)?c.colno:null}})},o=c=>{let p=I(c.reason).slice(0,R);if(!p)return;let g=H(p);ve({source:"hf-preview",type:"diagnostic",code:`${g.code}_unhandled_rejection`,details:{category:`${g.category}-unhandled-rejection`,message:p}})},window.addEventListener("error",i),window.addEventListener("unhandledrejection",o)},Fp=()=>{let c=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let g of c){let y=()=>{if(!Ne(g))return;let E=g.tagName.toLowerCase(),N=g.getAttribute("src")??g.getAttribute("href")??g.getAttribute("poster")??null,P=E==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";F(P,{tagName:E,assetUrl:N,currentSrc:(Oe(g)||be(g))&&g.currentSrc||null,readyState:be(g)?g.readyState:null,networkState:be(g)?g.networkState:null},`${P}:${E}:${N??"unknown"}`)};g.addEventListener("error",y),C(()=>{g.removeEventListener("error",y)})}let p=document.fonts;p&&p.ready.then(()=>{if(e.tornDown)return;let g=Array.from(p).filter(y=>y.status==="error").map(y=>y.family).filter(y=>!!y).slice(0,10);g.length!==0&&F("runtime_font_load_issue",{failedFamilies:g,totalFaces:Array.from(p).length},`runtime-font-load-issue:${g.join("|")}`)}).catch(()=>{})},Np=(c,p)=>{if(!c.timeline)return!1;let g=e.capturedTimeline;if(g&&g===c.timeline)return!1;let y=Math.max(0,e.currentTime||0),E=e.isPlaying;e.capturedTimeline=c.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{rt(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&e.capturedTimeline.seek(y,!1),E&&typeof e.capturedTimeline.play=="function"&&e.capturedTimeline.play()}catch(N){L("runtime.init.site7",N)}return ve({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:p,previousTime:y,selectedTimelineIds:c.selectedTimelineIds??[],selectedDurationSeconds:c.selectedDurationSeconds??null,mediaDurationFloorSeconds:c.mediaDurationFloorSeconds??null}}),!0},Ft=null,sl=!1,An=new Set,Dr=new WeakMap,Ir=()=>{e.tornDown||(Ft!=null&&window.clearTimeout(Ft),Ft=window.setTimeout(()=>{if(e.tornDown||(Ft=null,Zs()))return;let c=uo();if(!c.timeline||!ce(c.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){Sn()&&(ht(),Pe(!0));return}if(sl)return;let g=Ae(e.capturedTimeline),y=c.selectedDurationSeconds??Ae(c.timeline);ce(y)&&(!ce(g)||y>=g+A)&&Np(c,"manual")&&(sl=!0,ve({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:g??null,selectedDurationSeconds:y??null,selectedTimelineIds:c.selectedTimelineIds??[],mediaDurationFloorSeconds:c.mediaDurationFloorSeconds??null}}),ht(),Pe(!0))},w))},ll=c=>{be(c.currentTarget)&&Uu(c.currentTarget)},ul=c=>{be(c.currentTarget)&&Wu(c.currentTarget)},cl=c=>{Lo(c)&&vf(c)&&bn(c,gn(c))},dl=c=>{let p=c.currentTarget;be(p)&&cl(p)},Lp=()=>{for(let c of An)c.removeEventListener("loadedmetadata",Ir),c.removeEventListener("durationchange",Ir),c.removeEventListener("loadedmetadata",ll),c.removeEventListener("loadedmetadata",dl),c.removeEventListener("error",ul);An.clear()},co=()=>{if(e.tornDown)return;let c=Array.from(document.querySelectorAll("video, audio"));for(let p of c){if(An.has(p))continue;An.add(p);let g=Number.parseFloat(p.dataset.volume??"");Number.isFinite(g)&&(p.volume=Math.max(0,Math.min(1,g))),p.addEventListener("loadedmetadata",Ir),p.addEventListener("durationchange",Ir),p.addEventListener("loadedmetadata",dl),cl(p),p.addEventListener("loadedmetadata",ll),p.addEventListener("error",ul),Bu(p),p.preload!=="auto"&&(p.preload="auto"),p.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&p.load(),ml(p)}},ml=c=>{Dr.has(c)||vu(c,e.capturedTimeline,ot(e.capturedTimeline,0),Dr,{allowLiveTimelineSeek:!window.__HF_RENDER_CAPTURE_MODE})},mo=new WeakMap,Dp=c=>{let p=mo.get(c);if(p!==void 0)return p;let g=window.getComputedStyle(c).position,y=g==="static"||g==="relative"||g==="sticky";return mo.set(c,y),y},fo=new WeakMap,Ip=c=>{let p=fo.get(c);if(p!==void 0)return p;let g=c.querySelector("[data-start]")===null;return fo.set(c,g),g},Pp=()=>{mo=new WeakMap,fo=new WeakMap},po=new WeakSet,ho=new WeakMap,Pr=new WeakSet,Or=!1,fl=c=>c.matches("audio[data-start]")||c.querySelector("audio[data-start]")!==null,pl=new WeakMap,Gr=!0,Op=()=>{if(Gr){Gr=!1;for(let c of document.querySelectorAll(Zt)){let p=c.hasAttribute("data-hidden");pl.get(c)!==p&&(pl.set(c,p),c.id&&m.setGroupMuted(c.id,p))}}},Gp=(c,p)=>{let g=X();for(let y of p){if(!Se(y))continue;if(y.hasAttribute("data-hidden")){Pr.has(y)||(ho.set(y,y.style.getPropertyValue("display")),Pr.add(y),fl(y)&&(Or=!0),Gr=!0),y.style.display="none",(fe(y)||Oe(y))&&r?.setSourceVisibility(y,!1);continue}if(Pr.has(y)){let N=ho.get(y);N?y.style.display=N:y.style.removeProperty("display"),ho.delete(y),Pr.delete(y),fl(y)&&(Or=!0),Gr=!0}let E=pe(y,c);if(E){let N=y.parentElement;for(;N&&N!==g;){if(Se(N)&&N.hasAttribute("data-start")&&!pe(N,c)){E=!1;break}N=N.parentElement}}y.style.visibility=E?"visible":"hidden",(fe(y)||Oe(y))&&r?.setSourceVisibility(y,E),E?po.has(y)&&(y.style.removeProperty("display"),po.delete(y)):Dp(y)&&Ip(y)&&(y.style.display="none",po.add(y))}Or&&f.isPlaying()&&(m.stopAll(),wo()),Or=!1,Op()},Hr=(c,p=Array.from(document.querySelectorAll("[data-start]")))=>W(()=>Gp(c,p)),En=null,wn=null,Br=[],hl=c=>c.hasAttribute("data-start")||!!V(c).compositionRoot,go=c=>Iu({elements:c,shouldIncludeElement:hl,resolveStartSeconds:p=>Z(p),resolveDurationSeconds:p=>{let g=V(p),y=Z(p),E=g.inheritedStart!=null&&g.inheritedDuration!=null&&g.inheritedDuration>0?Math.max(0,g.inheritedStart+g.inheritedDuration-y):null,N=Number.isFinite(p.duration)?xt(p,p.duration):null,P=Ce(p.dataset.duration),K=P!=null&&P>0?P:null;return Du({isVideo:p.tagName==="VIDEO",sourceDuration:N,hostRemaining:E,explicitDuration:K})}}),Hp=()=>{let c=Nr();if(En&&En.revision===c)return En;let p=go().mediaClips;return En={revision:c,clips:p,byStart:[...p].sort((g,y)=>g.start-y.start),byEnd:[...p].sort((g,y)=>g.end-y.end)},wn=null,Br=[],En},gl=(c,p,g,y)=>{let E=0,N=c.length;for(;E<N;){let K=E+N>>1;p(c[K])<g?E=K+1:N=K}let P=[];for(let K=E;K<c.length&&p(c[K])<=y;K+=1)P.push(c[K]);return P},Bp=(c,p)=>{let g=wn;if(g===null)return c.clips.map(P=>P.el);let y=Math.min(g,p),E=Math.max(g,p),N=new Set;for(let P of Br)N.add(P.el);for(let P of gl(c.byStart,K=>K.start,y,E))N.add(P.el);for(let P of gl(c.byEnd,K=>K.end,y,E))N.add(P.el);return[...N]},Ur=new WeakSet,bl=c=>{Ur.add(c)},xl=c=>{Ur.delete(c)};window.__hf.leasePausedMedia=bl,window.__hf.releasePausedMedia=xl;let Up=()=>{for(let c of document.querySelectorAll("video, audio"))if(be(c)&&!c.paused&&hl(c)&&!Ur.has(c))return!0;return!1},yl=()=>zt();document.addEventListener("play",yl,!0),a.push(()=>{document.removeEventListener("play",yl,!0)});let Ge=()=>{let c=!Mr,p=W(()=>{if(!c)return go().mediaClips;let E=Hp();return go(Bp(E,e.currentTime)).mediaClips});for(let E of p){let N=Dr.get(E.el);N&&(E.volumeKeyframes=N)}let g=e.isPlaying?p:p.filter(E=>!Ur.has(E.el)),y=e.mediaForceSyncNextTick;y&&(e.mediaForceSyncNextTick=!1),e.nativeMediaSyncDisabled||(Pu({clips:g,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted,userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:y,onElementVolume:(E,N,P)=>m.setElementVolume(E,P),isWebAudioOwned:E=>m.ownsElement(E),isWebAudioRouted:E=>m.routesElement(E),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,ve({source:"hf-preview",type:"media-autoplay-blocked"}))}}),c?(wn=e.currentTime,Br=p.filter(E=>e.currentTime>=E.start&&e.currentTime<E.end)):(wn=null,Br=[])),Hr(e.currentTime)},Pe=c=>{c&&zt();let p=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),g=Date.now();(c||p!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||g-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=p,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=g,ve({source:"hf-preview",type:"state",frame:p,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},bo="",vl=0,Wp=()=>{let c="";for(let p of document.querySelectorAll("[data-start]"))c+=`${p.id}:${p.tagName}|`;return c},ht=()=>{U(),k(),te();let c=X();if(c){let y=j(c.getAttribute("data-width")),E=j(c.getAttribute("data-height")),N=y?parseInt(y,10):0,P=E?parseInt(E,10):0;N>0&&P>0&&ve({source:"hf-preview",type:"stage-size",width:N,height:P})}Sn();let p=_c({canonicalFps:e.canonicalFps});window.__clipManifest=p;let g=Wp();if(bo!==g&&Pp(),!window.__clipTree||bo!==g){let y=window;window.__clipTree=Sc({startResolver:st({timelineRegistry:y.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:y.__timelines??{},rootDuration:p.durationInFrames/e.canonicalFps}),bo=g}ve(p),kp()},xo=c=>typeof c=="number"&&Number.isFinite(c)&&c>0?c:0,Vp=c=>{let p=xo(Number(c));if(p<=0)return;let g=X(),y=xo(Ce(g?.getAttribute("data-duration"))),E=Math.max(vl,xo(f.getDuration()),y);p<=E||(vl=p,g?.setAttribute("data-duration",String(p)),f.setDuration(p),ht(),Pe(!0))},ze=(c,p=0)=>{for(let g of e.deterministicAdapters){try{c==="discover"&&g.discover(),c==="pause"&&g.pause(),c==="play"&&g.play&&g.play()}catch(y){L("runtime.init.site8",y)}if(c==="discover")try{g.seek({time:p,suppressEvents:!0})}catch(y){L("runtime.init.site9",y)}}},Nt=()=>{window.__renderReady=!1},_n=null,Cn=!0,zp=()=>{let c=[];for(let p of e.deterministicAdapters){let g=p.getReadyPromise;if(typeof g=="function")try{let y=g();y&&c.push(y)}catch(y){L("runtime.init.adapterReady",y)}}return c},qp=()=>{let c=zp();if(c.length===0)return _n=null,Cn=!0,!0;let p=c[0];if(!p)return!0;let g=c.length===1?p:Promise.all(c);return g!==_n&&(_n=g,Cn=!1,Promise.resolve(g).then(()=>{_n===g&&(Cn=!0,Nt())},y=>{_n===g&&(Cn=!0,L("runtime.init.adapterReady",y),Nt())})),Cn};if(J)ls();else{let c={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:j,onDiagnostic:({code:p,details:g})=>{ve({source:"hf-preview",type:"diagnostic",code:p,details:g})}};gm(c).then(()=>hm(c)).finally(()=>{J=!0,co(),Fp(),ls(),hs(document),Nt()})}let Wr=gc({postMessage:c=>ve(c)});Wr.installPickerApi(),Hr(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let Ye=tf({lease:bl,release:xl});r=Ye,C(()=>{Ye.destroy(),r=null});let yo=c=>{let p=Number(c);!Number.isFinite(p)||p<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,p)),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(be(y))try{y.playbackRate=e.playbackRate}catch(E){L("runtime.init.site10",E)}},Sl={play:()=>{let c=e.capturedTimeline;if(f.isPlaying())return;let p=ot(c,0);if(p>0)f.setDuration(p),f.reachedEnd()&&(f.seek(0),e.currentTime=0,Lt(0));else{let g=X(),y=Number(g?.getAttribute("data-duration")??0);y>0&&f.setDuration(y)}rt(c),f.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,Ml(f.now()),h&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&wo(),ze("play"),Ge(),Ye.redraw(),Pe(!0))},pause:()=>{if(!f.isPlaying())return;m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1,e.currentTime=f.now(),e.mediaForceSyncNextTick=!0,Ml(e.currentTime);let c=e.capturedTimeline;rt(c),ze("pause"),Ge(),Ye.redraw(),Pe(!0)},seek:(c,p)=>{let g=va(Math.max(0,Number(c)||0),e.canonicalFps);m.stopAll(),f.detachAudioSource();let y=f.isPlaying();y&&f.pause(),f.seek(g),e.currentTime=f.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let E=e.capturedTimeline;if(rt(E),Lt(e.currentTime),ze("pause"),p?.keepPlaying&&y){Sl.play();return}Ge(),Ye.redraw(),Pe(!0)},renderSeek:(c,p)=>{Mr=!0;let g=$n(Math.max(0,Number(c)||0),e.canonicalFps,p?.subFrameDivisions);m.stopAll(),f.detachAudioSource(),f.isPlaying()&&f.pause(),f.seek(g),e.currentTime=f.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0,Lt(e.currentTime,{activateChildren:!0,suppressEvents:p?.suppressEvents}),ze("pause"),Ge(),Ye.redraw(),Pe(!0)},getTime:()=>f.now(),getDuration:()=>{let c=f.getDuration();return Number.isFinite(c)?c:0},isPlaying:()=>f.isPlaying(),setPlaybackRate:c=>{yo(c),f.setRate(e.playbackRate),Fl()},getPlaybackRate:()=>e.playbackRate},Al=ot(e.capturedTimeline,0);Al>0&&f.setDuration(Al);let qe=yc({getTimeline:()=>e.capturedTimeline,setTimeline:c=>{e.capturedTimeline=c},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:c=>{e.isPlaying!==c&&(e.mediaForceSyncNextTick=!0),e.isPlaying=c},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:yo,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(c,p)=>{e.currentTime=Math.max(0,Number(c)||0),e.isPlaying!==p&&(e.mediaForceSyncNextTick=!0),e.isPlaying=p,Ge()},onStatePost:Pe,onDeterministicSeek:(c,p)=>{for(let g of e.deterministicAdapters)if(!(g.name==="gsap"&&e.capturedTimeline))try{g.seek({time:Number(c)||0,suppressEvents:p?.suppressEvents})}catch(y){L("runtime.init.site11",y)}},onDeterministicPause:()=>ze("pause"),onDeterministicPlay:()=>ze("play"),onRenderFrameSeek:()=>{Ye.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>ot(e.capturedTimeline,0),transport:Sl});window.__player=D(qe),window.__playerReady=!0,Be("composition_loaded",{duration:qe.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[mu(),Kl({resolveStartSeconds:c=>q(c,0)}),Xl(),Ql(),tu(),nu(),ru(),iu(),ou(),au(),su(),Yl({getTimeline:()=>e.capturedTimeline})],cu(),du(),window.__hfReseekGpu=c=>{let p=Math.max(0,Number(c)||0);window.__hfThreeTime=p,window.__hfTypegpuTime=p,ei(p)},window.__hfWaitForSeekCompletion=Ho,a.push(()=>{window.__hfWaitForSeekCompletion===Ho&&delete window.__hfWaitForSeekCompletion}),Mp(),co(),ze("discover");let $p=()=>{let c=e.capturedTimeline,p=Sn();e.capturedTimeline&&(p||e.capturedTimeline!==c||!qe._timeline)&&(qe._timeline=e.capturedTimeline);let g=ot(e.capturedTimeline,0);if(g>0&&f.setDuration(g),ze("discover",e.currentTime),!e.capturedTimeline){let y=window.__timelines??{},E=Object.keys(y).filter(N=>y[N]);if(E.length>0){let P=X()?.getAttribute("data-composition-id")??null;F("root_timeline_unbound_registry_present",{reason:P?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:P,registeredTimelineKeys:E},"root_timeline_unbound_registry_present"),console.warn("[hyperframes] Root timeline not bound \u2014 render will freeze at t=0. "+(P?`Root data-composition-id is "${P}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${E.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${P??"<root-id>"}"] = tl).`)}}window.__renderReady=!0,ht(),Pe(!0)},$t=null,jp=()=>{if($t)return;let c=()=>{window.removeEventListener("hf-timelines-built",c),$t=null,Nt()};$t=c,window.addEventListener("hf-timelines-built",c)};C(()=>{$t&&(window.removeEventListener("hf-timelines-built",$t),$t=null)}),Nt=()=>{if(!J){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,jp();return}if(ze("discover",e.currentTime),!qp()){window.__renderReady=!1;return}$p()},Nt(),J&&setTimeout(()=>{Nt()},0);let Vr=0,zr=!1,vo=Number.NaN,So=null,qr=!1,gt=null,$r=!1,El="",wl=-1,jr=!1,_l=Number.NEGATIVE_INFINITY,Kp=(c,p,g,y)=>{try{let E=y?.suppressEvents===!0;rt(c),typeof c.totalTime=="function"?c.totalTime(p,E):c.seek(p,E)}catch(E){L(g,E)}},Yp=(c,p)=>{let g=window.__timelines??{},y=X()?.getAttribute("data-composition-id")??null;for(let[E,N]of Object.entries(g)){if(!N||E===y)continue;let P=document.querySelector(`[data-composition-id="${CSS.escape(E)}"]`);if(!P)continue;let K=q(P,0);if(!Number.isFinite(K))continue;let $=Ae(N),ne=Qe(P)+Math.max(0,c-K)*Le(P),Ee=Math.max(0,$!=null&&$>0?Math.min($,ne):ne);Kp(N,Ee,"runtime.init.transport.childTimeline",p)}},Xp=c=>{let p=window.__timelines??{},g=[];for(let y of Object.values(p))if(!(!y||y===c)){g.push(y);try{y.play()}catch(E){L("runtime.init.activateSiblings",E)}}return g},Cl=c=>typeof c=="object"&&c!==null,Rn=new WeakMap,Jp=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],Rl=(c,p)=>{let g=c[p];if(typeof g!="function")return null;try{let y=Number(g.call(c));return Number.isFinite(y)?y:null}catch(y){return L("runtime.init.gsapCallbackDuration",y),null}},Qp=c=>{let p=Rn.get(c);if(p!=null)return p;if(!("getChildren"in c)||typeof c.getChildren!="function")return!1;let g;try{g=c.getChildren(!0,!0,!0)}catch(y){return L("runtime.init.gsapCallbackChildren",y),Rn.set(c,!1),!1}if(!Array.isArray(g))return Rn.set(c,!1),!1;for(let y of g){if(!Cl(y))continue;let E=y.vars;if(!Cl(E)||!Jp.some($=>typeof E[$]=="function"))continue;let K=Rl(y,"totalDuration")??Rl(y,"duration");if(K!=null&&K<=1e-6)return Rn.set(c,!0),!0}return Rn.set(c,!1),!1};function Lt(c,p){let g=e.capturedTimeline,y=g&&p?.activateChildren?Xp(g):[];try{Zp(g,c,p)}finally{for(let E of y)rt(E)}}function Zp(c,p,g){let y=g?.suppressEvents===!0;if(c){let E=c,N=p;if(typeof E.totalDuration=="function")try{let P=Number(E.totalDuration());Number.isFinite(P)&&P>0&&p>P&&(N=P)}catch(P){L("runtime.init.transport.clampDuration",P)}try{typeof c.totalTime=="function"?(c.totalTime(N,y),!y&&!Qp(c)&&(c.totalTime(N+.001,!0),c.totalTime(N,!0))):c.seek(N,y)}catch(P){L("runtime.init.transport.seek",P)}}Yp(p,g);for(let E of e.deterministicAdapters)if(!(E.name==="gsap"&&c))try{E.seek({time:p,suppressEvents:y})}catch(N){L("runtime.init.transport.adapter",N)}}let Ao=Ef(document,()=>{zt()});a.push(()=>Ao.disconnect());let eh=()=>{try{return Ao.isActive()}catch{return!1}},th=()=>!f.isPlaying()&&!Zs()&&Ao.observing&&!qr&&!jr&&e.currentTime===vo&&e.capturedTimeline===So,Tl=()=>`${Nr()}|${Qs()??""}`,kl=()=>{gt=window.setTimeout(nh,e.bridgeMaxPostIntervalMs)},nh=()=>{if(gt=null,!e.tornDown&&!(typeof window>"u"||typeof document>"u")){if(Tl()!==El){zt();return}Pe(!1),kl()}},rh=()=>{if(e.transportRafId=null,e.tornDown)return;let c=$r;if($r=!1,c||!th()){e.transportRafId=window.requestAnimationFrame(Eo);return}El=Tl(),kl()};zt=()=>{e.tornDown||($r=!0,!(zr||e.transportRafId!=null)&&(gt!=null&&(window.clearTimeout(gt),gt=null),$r=!1,e.transportRafId=window.requestAnimationFrame(Eo)))};let Eo=()=>{if(!(e.tornDown||zr)){zr=!0;try{Vr+=1;let c=Nr();c!==wl&&(wl=c,jr=!0);let p=Date.now(),g=jr&&!f.isPlaying()&&p-_l>=wf;if(g&&(_l=p),_f({tick:Vr,isPlaying:f.isPlaying(),hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:f.now(),compositionChanged:g})){let P=e.capturedTimeline;if(Sn()){e.capturedTimeline&&!qe._timeline&&(qe._timeline=e.capturedTimeline),e.capturedTimeline&&e.capturedTimeline!==P&&rt(e.capturedTimeline);let K=ot(e.capturedTimeline,0,c);K>0&&f.setDuration(K),ht()}}if((g||Vr%20===0)&&(ht(),jr=!1),(g||Vr%30===0)&&co(),e.capturedTimeline){let P=ot(e.capturedTimeline,0,c);P>0&&(!f.isPlaying()||P>=f.getDuration())&&f.setDuration(P)}if(f.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&m.isActive()&&m.context){let P=m.getTime();P>=0&&f.attachAudioSource({currentTimeSeconds:P})}else{let P=document.querySelectorAll("audio[data-start]"),K=!1;for(let $ of P){if(!be($)||!$.isConnected||b($))continue;let ne=Z($),Ee=Ce($.dataset.duration),He=Ee!=null&&Ee>0?ne+Ee:1/0,ae=Qe($);if(Number.isFinite(ne)&&e.currentTime>=ne&&e.currentTime<He){$.paused?!$.error&&$.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(f.attachAudioSource({currentTimeSeconds:e.currentTime}),K=!0):(f.attachAudioSource({el:$,compositionStart:ne,mediaStart:ae}),K=!0);break}}!K&&f.hasAudioSource()&&f.detachAudioSource()}else f.hasAudioSource()&&f.detachAudioSource();let y=f.now();e.currentTime=y;let E=f.isPlaying();if(!E&&eh()?qr=!0:(E||qr||y!==vo||e.capturedTimeline!==So)&&(Lt(y),vo=y,So=e.capturedTimeline,E||(qr=!1)),E&&Ye.redrawAnimated(),f.isPlaying()&&f.reachedEnd()){m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1;let P=f.getDuration();Number.isFinite(P)&&(f.seek(P),e.currentTime=P,Lt(P)),ze("pause"),Ge(),Pe(!0);return}f.isPlaying()?Ge():Up()&&(wn=null,Ge()),Pe(!1)}finally{zr=!1,rh()}}},Ml=c=>{let p=document.querySelectorAll("video, audio");for(let g of p){if(!be(g)||!g.isConnected||!g.hasAttribute("data-start"))continue;let y=Z(g);if(!Number.isFinite(y))continue;let E=Ce(g.dataset.duration),N=E!=null&&E>0?y+E:1/0;if(c<y||c>=N)continue;let P=Qe(g),K=c-y+P;if(K>=0)try{g.currentTime=K}catch{}}},wo=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let c=m.startGeneration(),p=document.querySelectorAll("audio[data-start]");for(let g of p){if(!be(g)||!g.isConnected||b(g))continue;let y=Z(g);if(!Number.isFinite(y))continue;let E=Qe(g),N=Number.parseFloat(g.dataset.volume??""),P=Number.isFinite(N)?N:1,K=Ce(g.dataset.duration),$=K!=null&&K>0?K:Number.POSITIVE_INFINITY,ne=g.closest("[data-composition-id]");if(ne){let ae=q(ne,0),Y=O(ne,{includeAuthoredTimingAttrs:!0});Y!=null&&Y>0&&($=Math.min($,Math.max(0,ae+Y-y)))}let Ee=gn(g);bn(g,Ee),(Ee.kind==="web-audio"?m.scheduleMediaElementPlayback(g,y,E,f.now(),P,c,e.playbackRate):Promise.resolve(null)).then(ae=>{if(ae||!f.isPlaying())return;let Y=e.playbackRate*Le(g),Re=g.hasAttribute("data-fx-chain")||g.hasAttribute("data-automation");if(Math.abs(Y-1)>1e-9){Ee.kind==="web-audio"&&Re&&(g.muted=!0);return}m.decodeAudioElement(g).then(Dt=>{!Dt||!f.isPlaying()||m.schedulePlayback(g,Dt,y,E,f.now(),P,c,e.playbackRate,$)})})}};function Fl(){m.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&h&&f.isPlaying()&&m.hasBoundedActiveSources()&&(m.stopAll(),wo())}if(e.capturedTimeline){let c=ot(e.capturedTimeline,0);c>0&&f.setDuration(c),rt(e.capturedTimeline)}Am(window),e.transportRafId=window.requestAnimationFrame(Eo),ht(),Pe(!0),e.controlBridgeHandler=Il({onPlay:()=>{qe.play(),Be("composition_played",{time:qe.getTime()})},onPause:()=>{qe.pause(),Be("composition_paused",{time:qe.getTime()})},onStopMedia:()=>{m.stopAll();let c=document.querySelectorAll("video, audio");for(let p of c)be(p)&&!p.paused&&p.pause()},onSeek:(c,p)=>{qe.seek(c),Be("composition_seeked",{time:c})},onSetMuted:c=>{e.bridgeMuted=c;let p=c||e.mediaOutputMuted;m.setMuted(p);let g=document.querySelectorAll("video, audio");for(let y of g)be(y)&&(y.muted=p||y.defaultMuted)},onSetVolume:c=>{e.bridgeVolume=c,m.setVolume(c);let p=document.querySelectorAll("video, audio");for(let g of p){if(!be(g))continue;let y=parseFloat(g.dataset.volume??""),E=Number.isFinite(y)?y:1;g.volume=ti(E*c)}},onSetMediaOutputMuted:c=>{e.mediaOutputMuted=c;let p=c||e.bridgeMuted;m.setMuted(p);let g=document.querySelectorAll("video, audio");for(let y of g)be(y)&&(y.muted=p||y.defaultMuted)},onSetNativeMediaSyncDisabled:c=>{e.nativeMediaSyncDisabled!==c&&(e.nativeMediaSyncDisabled=c,e.mediaForceSyncNextTick=!0,c?(m.stopAll(),f.detachAudioSource()):Ge())},onSetWebAudioMediaDisabled:c=>{e.webAudioMediaDisabled!==c&&(e.webAudioMediaDisabled=c,e.mediaForceSyncNextTick=!0,c&&(m.stopAll(),f.detachAudioSource()),Ge())},onSetPlaybackRate:c=>{yo(c),e.transportClock&&e.transportClock.setRate(e.playbackRate),Fl()},onSetRootDuration:Vp,onSetColorGrading:(c,p)=>{Ye.setGrading(c,p)},onSetColorGradingCompare:(c,p)=>{Ye.setCompare(c,p)},onTick:()=>{if(e.tornDown||!f.isPlaying())return;let c=f.now();if(e.currentTime=c,Lt(c),f.reachedEnd()){m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1;let p=f.getDuration();Number.isFinite(p)&&(f.seek(p),e.currentTime=p,Lt(p)),ze("pause"),Ge(),Pe(!0)}},onEnablePickMode:()=>Wr.enablePickMode(),onDisablePickMode:()=>Wr.disablePickMode(),onSetRuntimeData:eo,onClearRuntimeData:to,getCanonicalFps:()=>e.canonicalFps});let _o=()=>{if(!e.tornDown){e.tornDown=!0,e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),gt!=null&&(window.clearTimeout(gt),gt=null),e.transportClock=null,m.destroy(),Ft!=null&&(window.clearTimeout(Ft),Ft=null),s!=null&&(window.cancelAnimationFrame(s),s=null),Lp(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),i&&(window.removeEventListener("error",i),i=null),o&&(window.removeEventListener("unhandledrejection",o),o=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),Wr.disablePickMode();for(let c of e.deterministicAdapters)if(!(!c||typeof c.revert!="function"))try{c.revert()}catch(p){L("runtime.init.site12",p)}e.deterministicAdapters=[];for(let c of a.splice(0))try{c()}catch(p){L("runtime.init.site13",p)}for(let c of e.injectedCompStyles)try{c.remove()}catch(p){L("runtime.init.site14",p)}e.injectedCompStyles=[];for(let c of e.injectedCompLinks)try{c.remove()}catch(p){L("runtime.init.site15",p)}e.injectedCompLinks=[];for(let c of e.injectedCompScripts)try{c.remove()}catch(p){L("runtime.init.site16",p)}e.injectedCompScripts=[],e.capturedTimeline=null,t=()=>{},window.__hfRuntimeTeardown===_o&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=_o,e.beforeUnloadHandler=_o,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var Wf=["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"],Vs=[[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 Wv(e){if(e<=255)return Wf[e];let t=0,n=Vs.length-1;for(;t<=n;){let r=t+n>>1,i=Vs[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return"L"}function Vv(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let u=0;u<t;){let d=e.charCodeAt(u),f=d,m=1;if(d>=55296&&d<=56319&&u+1<t){let b=e.charCodeAt(u+1);b>=56320&&b<=57343&&(f=(d-55296<<10)+(b-56320)+65536,m=2)}let h=Wv(f);(h==="R"||h==="AL"||h==="AN")&&(r=!0);for(let b=0;b<m;b++)n[u+b]=h;u+=m}if(!r)return null;let i=0;for(let u=0;u<t;u++){let d=n[u];if(d==="L"){i=0;break}if(d==="R"||d==="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 d=n[u];d==="EN"?n[u]=s==="AL"?"AN":"EN":(d==="R"||d==="L"||d==="AL")&&(s=d)}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 d;for(d=u-1;d>=0&&n[d]==="ET";d--)n[d]="EN";for(d=u+1;d<t&&n[d]==="ET";d++)n[d]="EN"}for(let u=0;u<t;u++){let d=n[u];(d==="WS"||d==="ES"||d==="ET"||d==="CS")&&(n[u]="ON")}s=l;for(let u=0;u<t;u++){let d=n[u];d==="EN"?n[u]=s==="L"?"L":"EN":(d==="R"||d==="L")&&(s=d)}for(let u=0;u<t;u++){if(n[u]!=="ON")continue;let d=u+1;for(;d<t&&n[d]==="ON";)d++;let f=u>0?n[u-1]:l,m=d<t?n[d]:l,h=f!=="L"?"R":"L";if(h===(m!=="L"?"R":"L"))for(let v=u;v<d;v++)n[v]=h;u=d-1}for(let u=0;u<t;u++)n[u]==="ON"&&(n[u]=a);for(let u=0;u<t;u++){let d=n[u];(o[u]&1)===0?d==="R"?o[u]++:(d==="AN"||d==="EN")&&(o[u]+=2):(d==="L"||d==="AN"||d==="EN")&&o[u]++}return o}function Vf(e,t){let n=Vv(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 zv=/[ \t\n\r\f]+/g,qv=/[\t\n\r\f]| {2,}|^ | $/;function $v(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function jv(e){if(!qv.test(e))return e;let t=e.replace(zv," ");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 Kv(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 zs=null,Yv;function Xv(){return zs===null&&(zs=new Intl.Segmenter(Yv,{granularity:"word"})),zs}var Jv=/\p{Script=Arabic}/u,no=/\p{M}/u,Jf=/\p{Nd}/u;function zf(e){return Jv.test(e)}function qf(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 Ke(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(qf(i))return!0;t++;continue}}if(qf(n))return!0}}return!1}function Qv(e){let t=oo(e);return t!==null&&(io.has(t)||Rt.has(t))}var Zv=new Set(["\xA0","\u202F","\u2060","\uFEFF"]);function eS(e){return Ke(e)}function tS(e){let t=oo(e);return t!==null&&Zv.has(t)}function ro(e){return!Qv(e)&&!tS(e)}var io=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"]),kr=new Set(['"',"(","[","{","\u201C","\u2018","\xAB","\u2039","\uFF08","\u3014","\u3008","\u300A","\u300C","\u300E","\u3010","\u3016","\u3018","\u301A"]),$s=new Set(["'","\u2019"]),Rt=new Set([".",",","!","?",":",";","\u060C","\u061B","\u061F","\u0964","\u0965","\u104A","\u104B","\u104C","\u104D","\u104F",")","]","}","%",'"',"\u201D","\u2019","\xBB","\u203A","\u2026"]),nS=new Set([":",".","\u060C","\u061B"]),rS=new Set(["\u104F"]),iS=new Set(["\u201D","\u2019","\xBB","\u203A","\u300D","\u300F","\u3011","\u300B","\u3009","\u3015","\uFF09"]);function oS(e){if(js(e))return!0;let t=!1;for(let n of e){if(Rt.has(n)){t=!0;continue}if(!(t&&no.test(n)))return!1}return t}function aS(e){for(let t of e)if(!io.has(t)&&!Rt.has(t))return!1;return e.length>0}function sS(e){if(js(e))return!0;for(let t of e)if(!kr.has(t)&&!$s.has(t)&&!no.test(t))return!1;return e.length>0}function js(e){let t=!1;for(let n of e)if(!(n==="\\"||no.test(n))){if(kr.has(n)||Rt.has(n)||$s.has(n)){t=!0;continue}return!1}return t}function Qf(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 oo(e){if(e.length===0)return null;let t=Qf(e,e.length);return e.slice(t)}function lS(e){let t=Array.from(e),n=t.length;for(;n>0;){let r=t[n-1];if(no.test(r)){n--;continue}if(kr.has(r)||$s.has(r)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function uS(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="\u2014"?e:null}function $f(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 jf(e,t){return e&&t!==null&&nS.has(t)}function cS(e){let t=oo(e);return t!==null&&rS.has(t)}function dS(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 ao(e){let t=e.length;for(;t>0;){let n=Qf(e,t),r=e.slice(n,t);if(iS.has(r))return!0;if(!Rt.has(r))return!1;t=n}return!1}function mS(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`