@hyperframes/core 0.8.203 → 0.8.204
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,10 +1,10 @@
|
|
|
1
|
-
"use strict";(()=>{var PC=Object.create;var Qu=Object.defineProperty;var IC=Object.getOwnPropertyDescriptor;var DC=Object.getOwnPropertyNames;var OC=Object.getPrototypeOf,HC=Object.prototype.hasOwnProperty;var GC=(e,t,n)=>t in e?Qu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ae=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var BC=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of DC(t))!HC.call(e,o)&&o!==n&&Qu(e,o,{get:()=>t[o],enumerable:!(r=IC(t,o))||r.enumerable});return e};var UC=(e,t,n)=>(n=e!=null?PC(OC(e)):{},BC(t||!e||!e.__esModule?Qu(n,"default",{value:e,enumerable:!0}):n,e));var Se=(e,t,n)=>GC(e,typeof t!="symbol"?t+"":t,n);var fx=Ae((
|
|
1
|
+
"use strict";(()=>{var PC=Object.create;var Qu=Object.defineProperty;var IC=Object.getOwnPropertyDescriptor;var DC=Object.getOwnPropertyNames;var OC=Object.getPrototypeOf,HC=Object.prototype.hasOwnProperty;var GC=(e,t,n)=>t in e?Qu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ae=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var BC=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of DC(t))!HC.call(e,o)&&o!==n&&Qu(e,o,{get:()=>t[o],enumerable:!(r=IC(t,o))||r.enumerable});return e};var UC=(e,t,n)=>(n=e!=null?PC(OC(e)):{},BC(t||!e||!e.__esModule?Qu(n,"default",{value:e,enumerable:!0}):n,e));var Se=(e,t,n)=>GC(e,typeof t!="symbol"?t+"":t,n);var fx=Ae((UW,Jd)=>{var xe=String,dx=function(){return{isColorSupported:!1,reset:xe,bold:xe,dim:xe,italic:xe,underline:xe,inverse:xe,hidden:xe,strikethrough:xe,black:xe,red:xe,green:xe,yellow:xe,blue:xe,magenta:xe,cyan:xe,white:xe,gray:xe,bgBlack:xe,bgRed:xe,bgGreen:xe,bgYellow:xe,bgBlue:xe,bgMagenta:xe,bgCyan:xe,bgWhite:xe,blackBright:xe,redBright:xe,greenBright:xe,yellowBright:xe,blueBright:xe,magentaBright:xe,cyanBright:xe,whiteBright:xe,bgBlackBright:xe,bgRedBright:xe,bgGreenBright:xe,bgYellowBright:xe,bgBlueBright:xe,bgMagentaBright:xe,bgCyanBright:xe,bgWhiteBright:xe}};Jd.exports=dx();Jd.exports.createColors=dx});var Qd=Ae(()=>{});var ll=Ae(($W,hx)=>{"use strict";var mx=fx(),px=Qd(),_i=class e extends Error{constructor(t,n,r,o,i,a){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),o&&(this.source=o),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=mx.isColorSupported);let r=d=>d,o=d=>d,i=d=>d;if(t){let{bold:d,gray:f,red:m}=mx.createColors(!0);o=p=>d(m(p)),r=p=>f(p),px&&(i=p=>px(p))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),s=Math.min(this.line+2,a.length),c=String(s).length;return a.slice(l,s).map((d,f)=>{let m=l+1+f,p=" "+(" "+m).slice(-c)+" | ";if(m===this.line){if(d.length>160){let y=20,x=Math.max(0,this.column-y),E=Math.max(this.column+y,this.endColumn+y),v=d.slice(x,E),_=r(p.replace(/\d/g," "))+d.slice(0,Math.min(this.column-1,y-1)).replace(/[^\t]/g," ");return o(">")+r(p)+i(v)+`
|
|
2
2
|
`+_+o("^")}let b=r(p.replace(/\d/g," "))+d.slice(0,this.column-1).replace(/[^\t]/g," ");return o(">")+r(p)+i(d)+`
|
|
3
3
|
`+b+o("^")}return" "+r(p)+i(d)}).join(`
|
|
4
4
|
`)}toString(){let t=this.showSourceCode();return t&&(t=`
|
|
5
5
|
|
|
6
6
|
`+t+`
|
|
7
|
-
`),this.name+": "+this.message+t}};hx.exports=_i;_i.default=_i});var Zd=Ae((
|
|
7
|
+
`),this.name+": "+this.message+t}};hx.exports=_i;_i.default=_i});var Zd=Ae((qW,Sx)=>{"use strict";var JM=/(<)(\/?style\b)/gi,QM=/(<)(!--)/g,ZM=/[\t\n\f\r "#'()/;[\\\]{}]/;function kt(e){return typeof e!="string"||!e.includes("<")?e:e.replace(JM,"\\3c $2").replace(QM,"\\3c $2")}var gx={after:`
|
|
8
8
|
`,beforeClose:`
|
|
9
9
|
`,beforeComment:`
|
|
10
10
|
`,beforeDecl:`
|
|
@@ -15,22 +15,22 @@
|
|
|
15
15
|
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(t,n){let r;return t.walkDecls(o=>{if(typeof o.raws.before<"u")return r=o.raws.before,r.includes(`
|
|
16
16
|
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(t){let n;return t.walk(r=>{if(r.type!=="decl"&&(n=r.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(t){let n;return t.walk(r=>{if(r.nodes&&(r.parent!==t||t.first!==r)&&typeof r.raws.before<"u")return n=r.raws.before,n.includes(`
|
|
17
17
|
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawColon(t){let n;return t.walkDecls(r=>{if(typeof r.raws.between<"u")return n=r.raws.between.replace(/[^\s:]/g,""),!1}),n}rawEmptyBody(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length===0&&(n=r.raws.after,typeof n<"u"))return!1}),n}rawIndent(t){if(t.raws.indent)return t.raws.indent;let n;return t.walk(r=>{let o=r.parent;if(o&&o!==t&&o.parent&&o.parent===t&&typeof r.raws.before<"u"){let i=r.raws.before.split(`
|
|
18
|
-
`);return n=i[i.length-1],n=n.replace(/\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(n=r.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let r=t[n],o=t.raws[n];return o&&o.value===r?o.raw:r}root(t){if(t.source&&t.source.input.hasBOM&&this.builder("\uFEFF",t,"start"),this.body(t),t.raws.after){let n=t.raws.after,r=t.parent&&t.parent.type==="document";this.builder(r?n:kt(n))}}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(kt(t.raws.ownSemicolon),t,"end")}stringify(t,n){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,n)}};Sx.exports=Ci;Ci.default=Ci});var Ti=Ae((
|
|
18
|
+
`);return n=i[i.length-1],n=n.replace(/\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(n=r.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let r=t[n],o=t.raws[n];return o&&o.value===r?o.raw:r}root(t){if(t.source&&t.source.input.hasBOM&&this.builder("\uFEFF",t,"start"),this.body(t),t.raws.after){let n=t.raws.after,r=t.parent&&t.parent.type==="document";this.builder(r?n:kt(n))}}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(kt(t.raws.ownSemicolon),t,"end")}stringify(t,n){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,n)}};Sx.exports=Ci;Ci.default=Ci});var Ti=Ae((zW,Ex)=>{"use strict";var nk=Zd();function ef(e,t){new nk(t).stringify(e)}Ex.exports=ef;ef.default=ef});var Ri=Ae((jW,tf)=>{"use strict";tf.exports.isClean=Symbol("isClean");tf.exports.my=Symbol("my")});var Li=Ae((KW,vx)=>{"use strict";var rk=ll(),ok=Zd(),ik=Ti(),{isClean:Mi,my:ak}=Ri();function sk(e,t){let n=new e.constructor,r=[[e,n,t]];for(;r.length>0;){let[o,i,a]=r.pop();for(let l in o){if(!Object.prototype.hasOwnProperty.call(o,l)||l==="proxyCache")continue;let s=o[l],c=typeof s;if(l==="parent"&&c==="object")a&&(i[l]=a);else if(l==="source")i[l]=s;else if(Array.isArray(s)){let d=[];i[l]=d;for(let f of s){let m=new f.constructor;d.push(m),r.push([f,m,i])}}else{if(c==="object"&&s!==null){let d=new s.constructor;r.push([s,d,void 0]),s=d}i[l]=s}}}return n}function Vt(e,t){if(t&&typeof t.offset<"u")return t.offset;let n=1,r=1,o=0;for(let i=0;i<e.length;i++){if(r===t.line&&n===t.column){o=i;break}e[i]===`
|
|
19
19
|
`?(n=1,r+=1):n+=1}return o}var ki=class e{get proxyOf(){return this}constructor(t={}){this.raws={},this[Mi]=!1,this[ak]=!0;for(let n of Object.keys(t))if(n!=="__proto__")if(n==="nodes"){this.nodes=[];for(let r of t[n])typeof r.clone=="function"&&r.parent?this.append(r.clone()):this.append(r)}else this[n]=t[n]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let n=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let n in t)this[n]=t[n];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let n=sk(this);for(let r in t)n[r]=t[r];return n}cloneAfter(t={}){let n=this.clone(t);return this.parent.insertAfter(this,n),n}cloneBefore(t={}){let n=this.clone(t);return this.parent.insertBefore(this,n),n}error(t,n={}){if(this.source){let{end:r,start:o}=this.rangeBy(n);return this.source.input.error(t,{column:o.column,line:o.line},{column:r.column,line:r.line},n)}return new rk(t)}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:n==="root"?()=>t.root().toProxy():t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&t.markDirty()),!0}}}markClean(){this[Mi]=!0}markDirty(){if(this[Mi]){this[Mi]=!1;let t=this;for(;t=t.parent;)t[Mi]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:Vt(n,this.source.start)};if(t.index)r=this.positionInside(t.index);else if(t.word){let i=n.slice(Vt(n,this.source.start),Vt(n,this.source.end)).indexOf(t.word);i!==-1&&(r=this.positionInside(i))}return r}positionInside(t){let n=this.source.start.column,r=this.source.start.line,o="document"in this.source.input?this.source.input.document:this.source.input.css,i=Vt(o,this.source.start),a=i+t;for(let l=i;l<a;l++)o[l]===`
|
|
20
|
-
`?(n=1,r+=1):n+=1;return{column:n,line:r,offset:a}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:Vt(n,this.source.start)},o=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:Vt(n,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(t.word){let a=n.slice(Vt(n,this.source.start),Vt(n,this.source.end)).indexOf(t.word);a!==-1&&(r=this.positionInside(a),o=this.positionInside(a+t.word.length))}else t.start?r={column:t.start.column,line:t.start.line,offset:Vt(n,t.start)}:typeof t.index=="number"&&(r=this.positionInside(t.index)),t.end?o={column:t.end.column,line:t.end.line,offset:Vt(n,t.end)}:typeof t.endIndex=="number"?o=this.positionInside(t.endIndex):typeof t.index=="number"&&(o=this.positionInside(t.index+1));return(o.line<r.line||o.line===r.line&&o.column<=r.column)&&(o={column:r.column+1,line:r.line,offset:r.offset+1}),{end:o,start:r}}raw(t,n){return new ok().raw(this,t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let n=this,r=!1;for(let o of t)o===this?r=!0:r?(this.parent.insertAfter(n,o),n=o):this.parent.insertBefore(n,o);r||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let r=n==null;n=n||new Map;let o=[],i=[[this,o,0]];for(let l=0;l<i.length;l++){let[s,c,d]=i[l],f={};c[d]=f;for(let m in s){if(!Object.prototype.hasOwnProperty.call(s,m)||m==="parent"||m==="proxyCache")continue;let p=s[m];if(Array.isArray(p)){let b=[];f[m]=b;for(let y=0;y<p.length;y++){let x=p[y];typeof x=="object"&&x.toJSON?x.toJSON===e.prototype.toJSON?i.push([x,b,y]):b[y]=x.toJSON(null,n):b[y]=x}}else if(typeof p=="object"&&p.toJSON)p.toJSON===e.prototype.toJSON?i.push([p,f,m]):f[m]=p.toJSON(null,n);else if(m==="source"){if(p==null)continue;let b=n.get(p.input);b==null&&(b=n.size,n.set(p.input,b)),f[m]={end:p.end,inputId:b,start:p.start}}else f[m]=p}}let a=o[0];return r&&(a.inputs=[...n.keys()].map(l=>l.toJSON())),a}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=ik){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r={}){let o={node:this};for(let i in r)o[i]=r[i];return t.warn(n,o)}};vx.exports=ki;ki.default=ki});var Fi=Ae((KW,Ax)=>{"use strict";var lk=Li(),Ni=class extends lk{constructor(t){super(t),this.type="comment"}};Ax.exports=Ni;Ni.default=Ni});var Ii=Ae((YW,wx)=>{"use strict";var uk=Li(),Pi=class extends uk{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}};wx.exports=Pi;Pi.default=Pi});var sn=Ae((XW,Nx)=>{"use strict";var Cx=Fi(),Tx=Ii(),_x=Li(),{isClean:Rx,my:Mx}=Ri(),nf,kx,Lx,rf;function ck(e){let t=e.slice();for(;t.length>0;){let n=t.pop();if(delete n.source,n.nodes){n.nodes=n.nodes.slice();for(let r of n.nodes)t.push(r)}}return e.slice()}function dk(e){let t=[e];for(;t.length>0;){let n=t.pop();if(n[Rx]=!1,n.proxyOf.nodes)for(let r of n.proxyOf.nodes)t.push(r)}}var $t=class e extends _x{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...t){for(let n of t){let r=this.normalize(n,this.last);for(let o of r)this.proxyOf.nodes.push(o)}return this.markDirty(),this}cleanRaws(t){let n=[this];for(;n.length>0;){let r=n.pop();if(r!==this&&r.cleanRaws!==e.prototype.cleanRaws){r.cleanRaws(t);continue}if(_x.prototype.cleanRaws.call(r,t),r.nodes)for(let o of r.nodes)n.push(o)}}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,o;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],o=t(this.proxyOf.nodes[r],r),o!==!1);)this.indexes[n]+=1;return delete this.indexes[n],o}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:t[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...r)=>t[n](...r.map(o=>typeof o=="function"?(i,a)=>o(i.toProxy(),a):o)):n==="every"||n==="some"?r=>t[n]((o,...i)=>r(o.toProxy(),...i)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(r=>r.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="name"||n==="params"||n==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,n){let r=this.index(t),o=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let a of o)this.proxyOf.nodes.splice(r+1,0,a);let i;for(let a in this.indexes)i=this.indexes[a],r<i&&(this.indexes[a]=i+o.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),o=r===0?"prepend":!1,i=this.normalize(n,this.proxyOf.nodes[r],o).reverse();r=this.index(t);for(let l of i)this.proxyOf.nodes.splice(r,0,l);let a;for(let l in this.indexes)a=this.indexes[l],r<=a&&(this.indexes[l]=a+i.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=ck(kx(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let o of t)o.parent&&o.parent.removeChild(o,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let o of t)o.parent&&o.parent.removeChild(o,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new Tx(t)]}else if(t.selector||t.selectors)t=[new rf(t)];else if(t.name)t=[new nf(t)];else if(t.text)t=[new Cx(t)];else throw new Error("Unknown node type in node creation");return t.map(o=>(o[Mx]||e.rebuild(o),o=o.proxyOf,o.parent&&o.parent.removeChild(o),o[Rx]&&dk(o),o.raws||(o.raws={}),typeof o.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(o.raws.before=n.raws.before.replace(/\S/g,"")),o.parent=this.proxyOf,o))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let o of r)this.proxyOf.nodes.unshift(o);for(let o in this.indexes)this.indexes[o]=this.indexes[o]+r.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let n;for(let r in this.indexes)n=this.indexes[r],n>=t&&(this.indexes[r]=n-1);return this.markDirty(),this}replaceValues(t,n,r){return r||(r=n,n={}),this.walkDecls(o=>{n.props&&!n.props.includes(o.prop)||n.fast&&!o.value.includes(n.fast)||(o.value=o.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){if(!this.proxyOf.nodes)return;let n=[{iterator:this.getIterator(),node:this.proxyOf}];for(;n.length>0;){let{iterator:r,node:o}=n[n.length-1],i=o.indexes[r];if(i>=o.proxyOf.nodes.length){delete o.indexes[r],n.pop();let s=n[n.length-1];s&&(s.node.indexes[s.iterator]+=1);continue}let a=o.proxyOf.nodes[i],l;try{l=t(a,i)}catch(s){throw a.addToError(s)}if(l===!1){for(let s of n)delete s.node.indexes[s.iterator];return!1}a.walk&&a.proxyOf.nodes?n.push({iterator:a.getIterator(),node:a}):o.indexes[r]+=1}}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,o)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,o)}):this.walk((r,o)=>{if(r.type==="atrule"&&r.name===t)return n(r,o)}):(n=t,this.walk((r,o)=>{if(r.type==="atrule")return n(r,o)}))}walkComments(t){return this.walk((n,r)=>{if(n.type==="comment")return t(n,r)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((r,o)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,o)}):this.walk((r,o)=>{if(r.type==="decl"&&r.prop===t)return n(r,o)}):(n=t,this.walk((r,o)=>{if(r.type==="decl")return n(r,o)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,o)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,o)}):this.walk((r,o)=>{if(r.type==="rule"&&r.selector===t)return n(r,o)}):(n=t,this.walk((r,o)=>{if(r.type==="rule")return n(r,o)}))}};$t.registerParse=e=>{kx=e};$t.registerRule=e=>{rf=e};$t.registerAtRule=e=>{nf=e};$t.registerRoot=e=>{Lx=e};Nx.exports=$t;$t.default=$t;$t.rebuild=e=>{let t=[e];for(;t.length>0;){let n=t.pop();if(n.type==="atrule"?Object.setPrototypeOf(n,nf.prototype):n.type==="rule"?Object.setPrototypeOf(n,rf.prototype):n.type==="decl"?Object.setPrototypeOf(n,Tx.prototype):n.type==="comment"?Object.setPrototypeOf(n,Cx.prototype):n.type==="root"&&Object.setPrototypeOf(n,Lx.prototype),n[Mx]=!0,n.nodes)for(let r of n.nodes)t.push(r)}}});var ul=Ae((JW,Px)=>{"use strict";var Fx=sn(),so=class extends Fx{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};Px.exports=so;so.default=so;Fx.registerAtRule(so)});var cl=Ae((QW,Ox)=>{"use strict";var fk=sn(),Ix,Dx,yr=class extends fk{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Ix(new Dx,this,t).stringify()}};yr.registerLazyResult=e=>{Ix=e};yr.registerProcessor=e=>{Dx=e};Ox.exports=yr;yr.default=yr});var Gx=Ae((ZW,Hx)=>{var mk="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",pk=(e,t=21)=>(n=t)=>{let r="",o=n|0;for(;o-- >0;)r+=e[Math.random()*e.length|0];return r},hk=(e=21)=>{let t="",n=e|0;for(;n-- >0;)t+=mk[Math.random()*64|0];return t};Hx.exports={nanoid:hk,customAlphabet:pk}});var dl=Ae(()=>{});var fl=Ae(()=>{});var of=Ae(()=>{});var Bx=Ae(()=>{});var af=Ae((lV,$x)=>{"use strict";var{existsSync:gk,readFileSync:bk,realpathSync:yk}=Bx(),{dirname:ml,isAbsolute:xk,join:Sk,relative:Ek,sep:vk}=dl(),{SourceMapConsumer:Ux,SourceMapGenerator:Wx}=fl();function Vx(e){try{return yk(e)}catch{return e}}function Ak(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var Di=class{constructor(t,n){if(n.map===!1)return;n.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let r=n.map?n.map.prev:void 0,o=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=ml(this.mapFile)),o&&(this.text=o)}consumer(){return this.consumerCache||(this.consumerCache=new Ux(this.json||this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,o=/^data:application\/json;charset=utf-?8,/,i=/^data:application\/json,/,a=t.match(o)||t.match(i);if(a)return decodeURIComponent(t.substr(a[0].length));let l=t.match(n)||t.match(r);if(l)return Ak(t.substr(l[0].length));let s=t.slice(22);throw s=s.slice(0,s.indexOf(",")),new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let n=t.match(/\/\*\s*# sourceMappingURL=/g);if(!n)return;let r=t.lastIndexOf(n.pop()),o=t.indexOf("*/",r);r>-1&&o>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,o)))}loadFile(t,n,r){if(!r&&!this.unsafeMap){if(!/\.map$/i.test(t)||!n)return;let o=Ek(Vx(ml(n)),Vx(t));if(o===".."||o.startsWith(".."+vk)||xk(o))return}if(this.root=ml(t),gk(t))return this.mapFile=t,bk(t,"utf-8").toString().trim()}loadMap(t,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let r=n(t);if(r){let o=this.loadFile(r,t,!0);if(!o)throw new Error("Unable to load previous source map: "+r.toString());return o}}else{if(n instanceof Ux)return Wx.fromSourceMap(n).toString();if(n instanceof Wx)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;t&&(r=Sk(ml(t),r));let o=this.loadFile(r,t,!1);if(o)try{this.json=JSON.parse(o.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return o}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};$x.exports=Di;Di.default=Di});var Oi=Ae((uV,Yx)=>{"use strict";var{nanoid:wk}=Gx(),{isAbsolute:uf,resolve:cf}=dl(),{SourceMapConsumer:_k,SourceMapGenerator:Ck}=fl(),{fileURLToPath:qx,pathToFileURL:pl}=of(),zx=ll(),Tk=af(),sf=Qd(),lf=Symbol("lineToIndexCache"),Rk=!!(_k&&Ck),jx=!!(cf&&uf);function Kx(e){if(e[lf])return e[lf];let t=e.css.split(`
|
|
21
|
-
`),n=new Array(t.length),r=0;for(let o=0,i=t.length;o<i;o++)n[o]=r,r+=t[o].length+1;return e[lf]=n,n}var lo=class{get from(){return this.file||this.id}constructor(t,n={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,n.document&&(this.document=n.document.toString()),n.from&&(!jx||/^\w+:\/\//.test(n.from)||uf(n.from)?this.file=n.from:this.file=cf(n.from)),jx&&Rk){let r=new Tk(this.css,n);if(r.text){this.map=r;let o=r.consumer().file;!this.file&&o&&(this.file=this.mapResolve(o))}}this.file||(this.id="<input css "+wk(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,o={}){let i,a,l,s,c;if(n&&typeof n=="object"){let f=n,m=r;if(typeof f.offset=="number"){s=f.offset;let p=this.fromOffset(s);n=p.line,r=p.col}else n=f.line,r=f.column,s=this.fromLineAndColumn(n,r);if(typeof m.offset=="number"){l=m.offset;let p=this.fromOffset(l);a=p.line,i=p.col}else a=m.line,i=m.column,l=this.fromLineAndColumn(m.line,m.column)}else if(r)s=this.fromLineAndColumn(n,r);else{s=n;let f=this.fromOffset(s);n=f.line,r=f.col}let d=this.origin(n,r,a,i);return d?c=new zx(t,d.endLine===void 0?d.line:{column:d.column,line:d.line},d.endLine===void 0?d.column:{column:d.endColumn,line:d.endLine},d.source,d.file,o.plugin):c=new zx(t,a===void 0?n:{column:r,line:n},a===void 0?r:{column:i,line:a},this.css,this.file,o.plugin),c.input={column:r,endColumn:i,endLine:a,endOffset:l,line:n,offset:s,source:this.css},this.file&&(pl&&(c.input.url=pl(this.file).toString()),c.input.file=this.file),c}fromLineAndColumn(t,n){return Kx(this)[t-1]+n-1}fromOffset(t){let n=Kx(this),r=n[n.length-1],o=0;if(t>=r)o=n.length-1;else{let i=n.length-2,a;for(;o<i;)if(a=o+(i-o>>1),t<n[a])i=a-1;else if(t>=n[a+1])o=a+1;else{o=a;break}}return{col:t-n[o]+1,line:o+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:cf(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,o){if(!this.map)return!1;let i=this.map.consumer(),a=i.originalPositionFor({column:n-1,line:t});if(!a.source)return!1;let l;if(typeof r=="number"){let f=i.originalPositionFor({column:o-1,line:r});f.source&&(l=f)}let s;uf(a.source)?s=pl(a.source):s=new URL(a.source,this.map.consumer().sourceRoot||pl(this.map.mapFile));let c={column:a.column+1,endColumn:l&&l.column+1,endLine:l&&l.line,line:a.line,url:s.toString()};if(s.protocol==="file:")if(qx)c.file=qx(s);else throw new Error("file: protocol is not available in this PostCSS build");let d=i.sourceContentFor(a.source);return d&&(c.source=d),c}toJSON(){let t={};for(let n of["hasBOM","css","file","id"])this[n]!=null&&(t[n]=this[n]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}};Yx.exports=lo;lo.default=lo;sf&&sf.registerInput&&sf.registerInput(lo)});var uo=Ae((
|
|
22
|
-
`," "];return Hi.split(e,t)},split(e,t,n){if(typeof e!="string")return[];let r=[],o="",i=!1,a=0,l=!1,s="",c=!1;for(let f of e)if(c?c=!1:f==="\\"?c=!0:l?f===s&&(l=!1):f==='"'||f==="'"?(l=!0,s=f):f==="("?a+=1:f===")"?a>0&&(a-=1):a===0&&t.includes(f)&&(i=!0),i){let m=o.trim();(n||m!=="")&&r.push(m),o="",i=!1}else o+=f;let d=o.trim();return(n||d!=="")&&r.push(d),r}};eS.exports=Hi;Hi.default=Hi});var hl=Ae((
|
|
20
|
+
`?(n=1,r+=1):n+=1;return{column:n,line:r,offset:a}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:Vt(n,this.source.start)},o=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:Vt(n,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(t.word){let a=n.slice(Vt(n,this.source.start),Vt(n,this.source.end)).indexOf(t.word);a!==-1&&(r=this.positionInside(a),o=this.positionInside(a+t.word.length))}else t.start?r={column:t.start.column,line:t.start.line,offset:Vt(n,t.start)}:typeof t.index=="number"&&(r=this.positionInside(t.index)),t.end?o={column:t.end.column,line:t.end.line,offset:Vt(n,t.end)}:typeof t.endIndex=="number"?o=this.positionInside(t.endIndex):typeof t.index=="number"&&(o=this.positionInside(t.index+1));return(o.line<r.line||o.line===r.line&&o.column<=r.column)&&(o={column:r.column+1,line:r.line,offset:r.offset+1}),{end:o,start:r}}raw(t,n){return new ok().raw(this,t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let n=this,r=!1;for(let o of t)o===this?r=!0:r?(this.parent.insertAfter(n,o),n=o):this.parent.insertBefore(n,o);r||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let r=n==null;n=n||new Map;let o=[],i=[[this,o,0]];for(let l=0;l<i.length;l++){let[s,c,d]=i[l],f={};c[d]=f;for(let m in s){if(!Object.prototype.hasOwnProperty.call(s,m)||m==="parent"||m==="proxyCache")continue;let p=s[m];if(Array.isArray(p)){let b=[];f[m]=b;for(let y=0;y<p.length;y++){let x=p[y];typeof x=="object"&&x.toJSON?x.toJSON===e.prototype.toJSON?i.push([x,b,y]):b[y]=x.toJSON(null,n):b[y]=x}}else if(typeof p=="object"&&p.toJSON)p.toJSON===e.prototype.toJSON?i.push([p,f,m]):f[m]=p.toJSON(null,n);else if(m==="source"){if(p==null)continue;let b=n.get(p.input);b==null&&(b=n.size,n.set(p.input,b)),f[m]={end:p.end,inputId:b,start:p.start}}else f[m]=p}}let a=o[0];return r&&(a.inputs=[...n.keys()].map(l=>l.toJSON())),a}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=ik){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r={}){let o={node:this};for(let i in r)o[i]=r[i];return t.warn(n,o)}};vx.exports=ki;ki.default=ki});var Fi=Ae((YW,Ax)=>{"use strict";var lk=Li(),Ni=class extends lk{constructor(t){super(t),this.type="comment"}};Ax.exports=Ni;Ni.default=Ni});var Ii=Ae((XW,wx)=>{"use strict";var uk=Li(),Pi=class extends uk{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}};wx.exports=Pi;Pi.default=Pi});var sn=Ae((JW,Nx)=>{"use strict";var Cx=Fi(),Tx=Ii(),_x=Li(),{isClean:Rx,my:Mx}=Ri(),nf,kx,Lx,rf;function ck(e){let t=e.slice();for(;t.length>0;){let n=t.pop();if(delete n.source,n.nodes){n.nodes=n.nodes.slice();for(let r of n.nodes)t.push(r)}}return e.slice()}function dk(e){let t=[e];for(;t.length>0;){let n=t.pop();if(n[Rx]=!1,n.proxyOf.nodes)for(let r of n.proxyOf.nodes)t.push(r)}}var $t=class e extends _x{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...t){for(let n of t){let r=this.normalize(n,this.last);for(let o of r)this.proxyOf.nodes.push(o)}return this.markDirty(),this}cleanRaws(t){let n=[this];for(;n.length>0;){let r=n.pop();if(r!==this&&r.cleanRaws!==e.prototype.cleanRaws){r.cleanRaws(t);continue}if(_x.prototype.cleanRaws.call(r,t),r.nodes)for(let o of r.nodes)n.push(o)}}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,o;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],o=t(this.proxyOf.nodes[r],r),o!==!1);)this.indexes[n]+=1;return delete this.indexes[n],o}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:t[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...r)=>t[n](...r.map(o=>typeof o=="function"?(i,a)=>o(i.toProxy(),a):o)):n==="every"||n==="some"?r=>t[n]((o,...i)=>r(o.toProxy(),...i)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(r=>r.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="name"||n==="params"||n==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,n){let r=this.index(t),o=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let a of o)this.proxyOf.nodes.splice(r+1,0,a);let i;for(let a in this.indexes)i=this.indexes[a],r<i&&(this.indexes[a]=i+o.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),o=r===0?"prepend":!1,i=this.normalize(n,this.proxyOf.nodes[r],o).reverse();r=this.index(t);for(let l of i)this.proxyOf.nodes.splice(r,0,l);let a;for(let l in this.indexes)a=this.indexes[l],r<=a&&(this.indexes[l]=a+i.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=ck(kx(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let o of t)o.parent&&o.parent.removeChild(o,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let o of t)o.parent&&o.parent.removeChild(o,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new Tx(t)]}else if(t.selector||t.selectors)t=[new rf(t)];else if(t.name)t=[new nf(t)];else if(t.text)t=[new Cx(t)];else throw new Error("Unknown node type in node creation");return t.map(o=>(o[Mx]||e.rebuild(o),o=o.proxyOf,o.parent&&o.parent.removeChild(o),o[Rx]&&dk(o),o.raws||(o.raws={}),typeof o.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(o.raws.before=n.raws.before.replace(/\S/g,"")),o.parent=this.proxyOf,o))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let o of r)this.proxyOf.nodes.unshift(o);for(let o in this.indexes)this.indexes[o]=this.indexes[o]+r.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let n;for(let r in this.indexes)n=this.indexes[r],n>=t&&(this.indexes[r]=n-1);return this.markDirty(),this}replaceValues(t,n,r){return r||(r=n,n={}),this.walkDecls(o=>{n.props&&!n.props.includes(o.prop)||n.fast&&!o.value.includes(n.fast)||(o.value=o.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){if(!this.proxyOf.nodes)return;let n=[{iterator:this.getIterator(),node:this.proxyOf}];for(;n.length>0;){let{iterator:r,node:o}=n[n.length-1],i=o.indexes[r];if(i>=o.proxyOf.nodes.length){delete o.indexes[r],n.pop();let s=n[n.length-1];s&&(s.node.indexes[s.iterator]+=1);continue}let a=o.proxyOf.nodes[i],l;try{l=t(a,i)}catch(s){throw a.addToError(s)}if(l===!1){for(let s of n)delete s.node.indexes[s.iterator];return!1}a.walk&&a.proxyOf.nodes?n.push({iterator:a.getIterator(),node:a}):o.indexes[r]+=1}}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,o)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,o)}):this.walk((r,o)=>{if(r.type==="atrule"&&r.name===t)return n(r,o)}):(n=t,this.walk((r,o)=>{if(r.type==="atrule")return n(r,o)}))}walkComments(t){return this.walk((n,r)=>{if(n.type==="comment")return t(n,r)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((r,o)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,o)}):this.walk((r,o)=>{if(r.type==="decl"&&r.prop===t)return n(r,o)}):(n=t,this.walk((r,o)=>{if(r.type==="decl")return n(r,o)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,o)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,o)}):this.walk((r,o)=>{if(r.type==="rule"&&r.selector===t)return n(r,o)}):(n=t,this.walk((r,o)=>{if(r.type==="rule")return n(r,o)}))}};$t.registerParse=e=>{kx=e};$t.registerRule=e=>{rf=e};$t.registerAtRule=e=>{nf=e};$t.registerRoot=e=>{Lx=e};Nx.exports=$t;$t.default=$t;$t.rebuild=e=>{let t=[e];for(;t.length>0;){let n=t.pop();if(n.type==="atrule"?Object.setPrototypeOf(n,nf.prototype):n.type==="rule"?Object.setPrototypeOf(n,rf.prototype):n.type==="decl"?Object.setPrototypeOf(n,Tx.prototype):n.type==="comment"?Object.setPrototypeOf(n,Cx.prototype):n.type==="root"&&Object.setPrototypeOf(n,Lx.prototype),n[Mx]=!0,n.nodes)for(let r of n.nodes)t.push(r)}}});var ul=Ae((QW,Px)=>{"use strict";var Fx=sn(),so=class extends Fx{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};Px.exports=so;so.default=so;Fx.registerAtRule(so)});var cl=Ae((ZW,Ox)=>{"use strict";var fk=sn(),Ix,Dx,yr=class extends fk{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Ix(new Dx,this,t).stringify()}};yr.registerLazyResult=e=>{Ix=e};yr.registerProcessor=e=>{Dx=e};Ox.exports=yr;yr.default=yr});var Gx=Ae((eV,Hx)=>{var mk="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",pk=(e,t=21)=>(n=t)=>{let r="",o=n|0;for(;o-- >0;)r+=e[Math.random()*e.length|0];return r},hk=(e=21)=>{let t="",n=e|0;for(;n-- >0;)t+=mk[Math.random()*64|0];return t};Hx.exports={nanoid:hk,customAlphabet:pk}});var dl=Ae(()=>{});var fl=Ae(()=>{});var of=Ae(()=>{});var Bx=Ae(()=>{});var af=Ae((uV,$x)=>{"use strict";var{existsSync:gk,readFileSync:bk,realpathSync:yk}=Bx(),{dirname:ml,isAbsolute:xk,join:Sk,relative:Ek,sep:vk}=dl(),{SourceMapConsumer:Ux,SourceMapGenerator:Wx}=fl();function Vx(e){try{return yk(e)}catch{return e}}function Ak(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var Di=class{constructor(t,n){if(n.map===!1)return;n.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let r=n.map?n.map.prev:void 0,o=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=ml(this.mapFile)),o&&(this.text=o)}consumer(){return this.consumerCache||(this.consumerCache=new Ux(this.json||this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,o=/^data:application\/json;charset=utf-?8,/,i=/^data:application\/json,/,a=t.match(o)||t.match(i);if(a)return decodeURIComponent(t.substr(a[0].length));let l=t.match(n)||t.match(r);if(l)return Ak(t.substr(l[0].length));let s=t.slice(22);throw s=s.slice(0,s.indexOf(",")),new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let n=t.match(/\/\*\s*# sourceMappingURL=/g);if(!n)return;let r=t.lastIndexOf(n.pop()),o=t.indexOf("*/",r);r>-1&&o>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,o)))}loadFile(t,n,r){if(!r&&!this.unsafeMap){if(!/\.map$/i.test(t)||!n)return;let o=Ek(Vx(ml(n)),Vx(t));if(o===".."||o.startsWith(".."+vk)||xk(o))return}if(this.root=ml(t),gk(t))return this.mapFile=t,bk(t,"utf-8").toString().trim()}loadMap(t,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let r=n(t);if(r){let o=this.loadFile(r,t,!0);if(!o)throw new Error("Unable to load previous source map: "+r.toString());return o}}else{if(n instanceof Ux)return Wx.fromSourceMap(n).toString();if(n instanceof Wx)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;t&&(r=Sk(ml(t),r));let o=this.loadFile(r,t,!1);if(o)try{this.json=JSON.parse(o.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return o}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};$x.exports=Di;Di.default=Di});var Oi=Ae((cV,Yx)=>{"use strict";var{nanoid:wk}=Gx(),{isAbsolute:uf,resolve:cf}=dl(),{SourceMapConsumer:_k,SourceMapGenerator:Ck}=fl(),{fileURLToPath:qx,pathToFileURL:pl}=of(),zx=ll(),Tk=af(),sf=Qd(),lf=Symbol("lineToIndexCache"),Rk=!!(_k&&Ck),jx=!!(cf&&uf);function Kx(e){if(e[lf])return e[lf];let t=e.css.split(`
|
|
21
|
+
`),n=new Array(t.length),r=0;for(let o=0,i=t.length;o<i;o++)n[o]=r,r+=t[o].length+1;return e[lf]=n,n}var lo=class{get from(){return this.file||this.id}constructor(t,n={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,n.document&&(this.document=n.document.toString()),n.from&&(!jx||/^\w+:\/\//.test(n.from)||uf(n.from)?this.file=n.from:this.file=cf(n.from)),jx&&Rk){let r=new Tk(this.css,n);if(r.text){this.map=r;let o=r.consumer().file;!this.file&&o&&(this.file=this.mapResolve(o))}}this.file||(this.id="<input css "+wk(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,o={}){let i,a,l,s,c;if(n&&typeof n=="object"){let f=n,m=r;if(typeof f.offset=="number"){s=f.offset;let p=this.fromOffset(s);n=p.line,r=p.col}else n=f.line,r=f.column,s=this.fromLineAndColumn(n,r);if(typeof m.offset=="number"){l=m.offset;let p=this.fromOffset(l);a=p.line,i=p.col}else a=m.line,i=m.column,l=this.fromLineAndColumn(m.line,m.column)}else if(r)s=this.fromLineAndColumn(n,r);else{s=n;let f=this.fromOffset(s);n=f.line,r=f.col}let d=this.origin(n,r,a,i);return d?c=new zx(t,d.endLine===void 0?d.line:{column:d.column,line:d.line},d.endLine===void 0?d.column:{column:d.endColumn,line:d.endLine},d.source,d.file,o.plugin):c=new zx(t,a===void 0?n:{column:r,line:n},a===void 0?r:{column:i,line:a},this.css,this.file,o.plugin),c.input={column:r,endColumn:i,endLine:a,endOffset:l,line:n,offset:s,source:this.css},this.file&&(pl&&(c.input.url=pl(this.file).toString()),c.input.file=this.file),c}fromLineAndColumn(t,n){return Kx(this)[t-1]+n-1}fromOffset(t){let n=Kx(this),r=n[n.length-1],o=0;if(t>=r)o=n.length-1;else{let i=n.length-2,a;for(;o<i;)if(a=o+(i-o>>1),t<n[a])i=a-1;else if(t>=n[a+1])o=a+1;else{o=a;break}}return{col:t-n[o]+1,line:o+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:cf(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,o){if(!this.map)return!1;let i=this.map.consumer(),a=i.originalPositionFor({column:n-1,line:t});if(!a.source)return!1;let l;if(typeof r=="number"){let f=i.originalPositionFor({column:o-1,line:r});f.source&&(l=f)}let s;uf(a.source)?s=pl(a.source):s=new URL(a.source,this.map.consumer().sourceRoot||pl(this.map.mapFile));let c={column:a.column+1,endColumn:l&&l.column+1,endLine:l&&l.line,line:a.line,url:s.toString()};if(s.protocol==="file:")if(qx)c.file=qx(s);else throw new Error("file: protocol is not available in this PostCSS build");let d=i.sourceContentFor(a.source);return d&&(c.source=d),c}toJSON(){let t={};for(let n of["hasBOM","css","file","id"])this[n]!=null&&(t[n]=this[n]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}};Yx.exports=lo;lo.default=lo;sf&&sf.registerInput&&sf.registerInput(lo)});var uo=Ae((dV,Zx)=>{"use strict";var Xx=sn(),Jx,Qx,Hn=class extends Xx{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,r){let o=new Set;for(let a of Array.isArray(t)?t:[t])a&&typeof a=="object"&&!a.parent&&a.raws&&typeof a.raws.before<"u"&&o.add(a.raws);let i=super.normalize(t);if(n){if(r==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let a of i)o.has(a.raws)||(a.raws.before=n.raws.before)}return i}removeChild(t,n){let r=this.index(t);return!n&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(t)}toResult(t={}){return new Jx(new Qx,this,t).stringify()}};Hn.registerLazyResult=e=>{Jx=e};Hn.registerProcessor=e=>{Qx=e};Zx.exports=Hn;Hn.default=Hn;Xx.registerRoot(Hn)});var df=Ae((fV,eS)=>{"use strict";var Hi={comma(e){return Hi.split(e,[","],!0)},space(e){let t=[" ",`
|
|
22
|
+
`," "];return Hi.split(e,t)},split(e,t,n){if(typeof e!="string")return[];let r=[],o="",i=!1,a=0,l=!1,s="",c=!1;for(let f of e)if(c?c=!1:f==="\\"?c=!0:l?f===s&&(l=!1):f==='"'||f==="'"?(l=!0,s=f):f==="("?a+=1:f===")"?a>0&&(a-=1):a===0&&t.includes(f)&&(i=!0),i){let m=o.trim();(n||m!=="")&&r.push(m),o="",i=!1}else o+=f;let d=o.trim();return(n||d!=="")&&r.push(d),r}};eS.exports=Hi;Hi.default=Hi});var hl=Ae((mV,nS)=>{"use strict";var tS=sn(),Mk=df(),co=class extends tS{get selectors(){return Mk.comma(this.selector)}set selectors(t){let n=this.selector?this.selector.match(/,\s*/):null,r=n?n[0]:","+this.raw("between","beforeOpen");this.selector=t.join(r)}constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}};nS.exports=co;co.default=co;tS.registerRule(co)});var iS=Ae((pV,oS)=>{"use strict";var kk=ul(),Lk=Fi(),Nk=Ii(),Fk=Oi(),Pk=af(),Ik=uo(),Dk=hl();function rS(e,t){return e.inputs?e.inputs.map(n=>{let r={...n,__proto__:Fk.prototype};return r.map&&(r.map={...r.map,__proto__:Pk.prototype}),r}):t}function Ok(e,t,n){let r={...e};if(delete r.inputs,delete r.nodes,r.source){let{inputId:i,...a}=r.source;r.source=a,i!=null&&(r.source.input=t[i])}let o;if(r.type==="root")o=new Ik(r);else if(r.type==="decl")o=new Nk(r);else if(r.type==="rule")o=new Dk(r);else if(r.type==="comment")o=new Lk(r);else if(r.type==="atrule")o=new kk(r);else throw new Error("Unknown node type: "+e.type);if(n){o.nodes=n;for(let i of n)i.parent=o}return o}function gl(e,t){if(Array.isArray(e))return e.map(o=>gl(o));let n,r=[{childIndex:0,children:[],inputs:rS(e,t),json:e}];for(;r.length>0;){let o=r[r.length-1],i=o.json.nodes;if(i&&o.childIndex<i.length){let l=i[o.childIndex];o.childIndex+=1,r.push({childIndex:0,children:[],inputs:rS(l,o.inputs),json:l});continue}r.pop();let a=Ok(o.json,o.inputs,i?o.children:void 0);r.length>0?r[r.length-1].children.push(a):n=a}return n}oS.exports=gl;gl.default=gl});var mf=Ae((hV,dS)=>{"use strict";var{dirname:bl,relative:sS,resolve:lS,sep:uS}=dl(),{SourceMapConsumer:cS,SourceMapGenerator:yl}=fl(),{pathToFileURL:aS}=of(),Hk=Oi(),Gk=!!(cS&&yl),Bk=!!(bl&&lS&&sS&&uS),ff=class{constructor(t,n,r,o){this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=o,this.originalCSS=o,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let n=`
|
|
23
23
|
`;this.css.includes(`\r
|
|
24
24
|
`)&&(n=`\r
|
|
25
25
|
`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||bl(t.file),o;this.mapOpts.sourcesContent===!1?(o=new cS(t.text),o.sourcesContent&&(o.sourcesContent=null)):o=t.consumer(),this.map.applySourceMap(o,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let t;for(let n=this.root.nodes.length-1;n>=0;n--)t=this.root.nodes[n],t.type==="comment"&&t.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(n)}else if(this.css){let t="/*# sourceMappingURL=",n;for(;(n=this.css.lastIndexOf(t))!==-1;){let r=this.css.indexOf("*/",n+t.length);if(r===-1)break;for(;n>0&&this.css[n-1]===`
|
|
26
26
|
`;)n--;this.css=this.css.slice(0,n)+this.css.slice(r+2)}}}}generate(){if(this.clearAnnotation(),Bk&&Gk&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,n=>{t+=n}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=yl.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new yl({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new yl({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,r="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},i,a;this.stringify(this.root,(l,s,c)=>{if(this.css+=l,s&&c!=="end"&&(o.generated.line=t,o.generated.column=n-1,s.source&&s.source.start?(o.source=this.sourcePath(s),o.original.line=s.source.start.line,o.original.column=s.source.start.column-1,this.map.addMapping(o)):(o.source=r,o.original.line=1,o.original.column=0,this.map.addMapping(o))),a=l.match(/\n/g),a?(t+=a.length,i=l.lastIndexOf(`
|
|
27
|
-
`),n=l.length-i):n+=l.length,s&&c!=="start"){let d=s.parent||{raws:{}};(!(s.type==="decl"||s.type==="atrule"&&!s.nodes)||s!==d.last||d.raws.semicolon)&&(s.source&&s.source.end?(o.source=this.sourcePath(s),o.original.line=s.source.end.line,o.original.column=s.source.end.column-1,o.generated.line=t,o.generated.column=n-2,this.map.addMapping(o)):(o.source=r,o.original.line=1,o.original.column=0,o.generated.line=t,o.generated.column=n-1,this.map.addMapping(o)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(n=>n.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let n=this.memoizedPaths.get(t);if(n)return n;let r=this.opts.to?bl(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=bl(lS(r,this.mapOpts.annotation)));let o=sS(r,t);return this.memoizedPaths.set(t,o),o}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let n=t.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let t=new Hk(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(n=>{if(n.source){let r=n.source.input.from;if(r&&!t[r]){t[r]=!0;let o=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(o,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let n=this.memoizedFileURLs.get(t);if(n)return n;if(aS){let r=aS(t).toString();return this.memoizedFileURLs.set(t,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let n=this.memoizedURLs.get(t);if(n)return n;uS==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}};dS.exports=ff});var pS=Ae((hV,mS)=>{"use strict";var xl=/[\t\n\f\r "#'()/;[\\\]{}]/g,Sl=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Uk=/.[\r\n"'(/\\]/,fS=/[\da-f]/i;mS.exports=function(t,n={}){let r=t.css.valueOf(),o=n.ignoreErrors,i,a,l,s,c,d,f,m,p,b,y=r.length,x=0,E=[],v=[],_=-1;function U(){return x}function G(H){throw t.error("Unclosed "+H,x)}function R(){return v.length===0&&x>=y}function D(H){if(v.length)return v.pop();if(x>=y)return;let I=H?H.ignoreUnclosed:!1;switch(i=r.charCodeAt(x),i){case 10:case 32:case 9:case 13:case 12:{s=x;do s+=1,i=r.charCodeAt(s);while(i===32||i===10||i===9||i===13||i===12);d=["space",r.slice(x,s)],x=s-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let Y=String.fromCharCode(i);d=[Y,Y,x];break}case 40:{if(b=E.length?E.pop()[1]:"",p=r.charCodeAt(x+1),b==="url"&&p!==39&&p!==34&&p!==32&&p!==10&&p!==9&&p!==12&&p!==13){s=x;do{if(f=!1,s=r.indexOf(")",s+1),s===-1)if(o||I){s=x;break}else G("bracket");for(m=s;r.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);d=["brackets",r.slice(x,s+1),x,s],x=s}else x<=_?d=["(","(",x]:(s=r.indexOf(")",x+1),a=r.slice(x,s+1),s===-1||Uk.test(a)?(_=s===-1?y:s,d=["(","(",x]):(d=["brackets",a,x,s],x=s));break}case 39:case 34:{c=i===39?"'":'"',s=x;do{if(f=!1,s=r.indexOf(c,s+1),s===-1)if(o||I){s=x+1;break}else G("string");for(m=s;r.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);d=["string",r.slice(x,s+1),x,s],x=s;break}case 64:{xl.lastIndex=x+1,xl.test(r),xl.lastIndex===0?s=r.length-1:s=xl.lastIndex-2,d=["at-word",r.slice(x,s+1),x,s],x=s;break}case 92:{for(s=x,l=!0;r.charCodeAt(s+1)===92;)s+=1,l=!l;if(i=r.charCodeAt(s+1),l&&i!==47&&i!==32&&i!==10&&i!==9&&i!==13&&i!==12&&(s+=1,fS.test(r.charAt(s)))){for(;fS.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===32&&(s+=1)}d=["word",r.slice(x,s+1),x,s],x=s;break}default:{i===47&&r.charCodeAt(x+1)===42?(s=r.indexOf("*/",x+2)+1,s===0&&(o||I?s=r.length:G("comment")),d=["comment",r.slice(x,s+1),x,s],x=s):(Sl.lastIndex=x+1,Sl.test(r),Sl.lastIndex===0?s=r.length-1:s=Sl.lastIndex-2,d=["word",r.slice(x,s+1),x,s],E.push(d),x=s);break}}return x++,d}function T(H){v.push(H)}return{back:T,endOfFile:R,nextToken:D,position:U}}});var yS=Ae((gV,bS)=>{"use strict";var Wk=ul(),Vk=Fi(),$k=Ii(),qk=uo(),hS=hl(),zk=pS(),gS={empty:!0,space:!0};function jk(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}function pf(e,t,n){let r="";for(let o=t;o<n;o++)r+=e[o][1];return r}var hf=class{constructor(t){this.input=t,this.root=new qk,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let n=new Wk;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,o,i,a=!1,l=!1,s=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?c.push(r==="("?")":"]"):r==="{"&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),c.length===0)if(r===";"){n.source.end=this.getPosition(t[2]),n.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(s.length>0){for(i=s.length-1,o=s[i];o&&o[0]==="space";)o=s[--i];o&&(n.source.end=this.getPosition(o[3]||o[2]),n.source.end.offset++)}this.end(t);break}else s.push(t);else s.push(t);if(this.tokenizer.endOfFile()){a=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(n.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(n,"params",s),a&&(t=s[s.length-1],n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),l&&(n.nodes=[],this.current=n)}checkMissedSemicolon(t){let n=this.colon(t);if(n===!1)return;let r=0,o;for(let i=n-1;i>=0&&(o=t[i],!(o[0]!=="space"&&(r+=1,r===2)));i--);throw this.input.error("Missed semicolon",o[0]==="word"?o[3]+1:o[2])}colon(t){let n=0,r,o,i;for(let[a,l]of t.entries()){if(o=l,i=o[0],i==="("&&(n+=1),i===")"&&(n-=1),n===0&&i===":")if(!r)this.doubleColon(o);else{if(r[0]==="word"&&r[1]==="progid")continue;return a}r=o}return!1}comment(t){let n=new Vk;this.init(n,t[2]),n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++;let r=t[1].slice(2,-2);if(!r.trim())n.text="",n.raws.left=r,n.raws.right="";else{let o=r.match(/^(\s*)([^]*\S)(\s*)$/);n.text=o[2],n.raws.left=o[1],n.raws.right=o[3]}}createTokenizer(){this.tokenizer=zk(this.input)}decl(t,n){let r=new $k;this.init(r,t[0][2]);let o=t[t.length-1];o[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(o[3]||o[2]||jk(t)),r.source.end.offset++;let i=0;for(;t[i][0]!=="word";)i===t.length-1&&this.unknownWord([t[i]]),i++;r.raws.before+=pf(t,0,i),r.source.start=this.getPosition(t[i][2]);let a=i;for(;i<t.length;){let m=t[i][0];if(m===":"||m==="space"||m==="comment")break;i++}r.prop=pf(t,a,i);let l=i,s;for(;i<t.length&&(s=t[i],i++,s[0]!==":");)s[0]==="word"&&/\w/.test(s[1])&&this.unknownWord([s]);r.raws.between=pf(t,l,i),(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let c=i;for(;i<t.length;){let m=t[i][0];if(m!=="space"&&m!=="comment")break;i++}let d=t.slice(c,i);t=t.slice(i),this.precheckMissedSemicolon(t);for(let m=t.length-1;m>=0;m--){if(s=t[m],s[1].toLowerCase()==="!important"){r.important=!0;let p=this.stringFrom(t,m);p=this.spacesFromEnd(t)+p,p!==" !important"&&(r.raws.important=p);break}else if(s[1].toLowerCase()==="important"){let p=t.slice(0),b="";for(let y=m;y>0;y--){let x=p[y][0];if(b.trim().startsWith("!")&&x!=="space")break;b=p.pop()[1]+b}b.trim().startsWith("!")&&(r.important=!0,r.raws.important=b,t=p)}if(s[0]!=="space"&&s[0]!=="comment")break}t.some(m=>m[0]!=="space"&&m[0]!=="comment")&&(r.raws.between+=d.map(m=>m[1]).join(""),d=[]),this.raw(r,"value",d.concat(t),n),r.value.includes(":")&&!n&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let n=new hS;this.init(n,t[2]),n.selector="",n.raws.between="",this.current=n}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="",n.source.end=this.getPosition(t[2]),n.source.end.offset++)}}getPosition(t){let n=this.input.fromOffset(t);return{column:n.col,line:n.line,offset:t}}init(t,n){this.current.push(t),t.source={input:this.input,start:this.getPosition(n)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let n=!1,r=null,o=!1,i=null,a=[],l=t[1].startsWith("--"),s=[],c=t;for(;c;){if(r=c[0],s.push(c),r==="("||r==="[")i||(i=c),a.push(r==="("?")":"]");else if(l&&o&&r==="{")i||(i=c),a.push("}");else if(a.length===0)if(r===";")if(o){this.decl(s,l);return}else break;else if(r==="{"){this.rule(s);return}else if(r==="}"){this.tokenizer.back(s.pop()),n=!0;break}else r===":"&&(o=!0);else r===a[a.length-1]&&(a.pop(),a.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),a.length>0&&this.unclosedBracket(i),n&&o){if(!l)for(;s.length&&(c=s[s.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(s.pop());this.decl(s,l)}else this.unknownWord(s)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,n,r,o){let i,a,l=r.length,s="",c=!0,d,f;for(let m=0;m<l;m+=1)i=r[m],a=i[0],a==="space"&&m===l-1&&!o?c=!1:a==="comment"?(f=r[m-1]?r[m-1][0]:"empty",d=r[m+1]?r[m+1][0]:"empty",!gS[f]&&!gS[d]?s.slice(-1)===","?c=!1:s+=i[1]:c=!1):s+=i[1];if(!c){let m=r.reduce((p,b)=>p+b[1],"");t.raws[n]={raw:m,value:s}}t[n]=s}rule(t){t.pop();let n=new hS;this.init(n,t[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(n,"selector",t),this.current=n}spacesAndCommentsFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],!(n!=="space"&&n!=="comment"));)r=t.pop()[1]+r;return r}spacesAndCommentsFromStart(t){let n,r="";for(;t.length&&(n=t[0][0],!(n!=="space"&&n!=="comment"));)r+=t.shift()[1];return r}spacesFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],n==="space");)r=t.pop()[1]+r;return r}stringFrom(t,n){let r="";for(let o=n;o<t.length;o++)r+=t[o][1];return t.splice(n,t.length-n),r}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}};bS.exports=hf});var vl=Ae((bV,xS)=>{"use strict";var Kk=sn(),Yk=Oi(),Xk=yS();function El(e,t){let n=new Yk(e,t),r=new Xk(n);try{r.parse()}catch(o){throw o}return r.root}xS.exports=El;El.default=El;Kk.registerParse(El)});var gf=Ae((yV,SS)=>{"use strict";var Jk=sn(),{my:Qk}=Ri(),Gi=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){n.node[Qk]||Jk.rebuild(n.node);let r=n.node.rangeBy(n);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in n)this[r]=n[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};SS.exports=Gi;Gi.default=Gi});var Al=Ae((xV,ES)=>{"use strict";var Zk=gf(),Bi=class{get content(){return this.css}constructor(t,n,r){this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css="",this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new Zk(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}};ES.exports=Bi;Bi.default=Bi});var bf=Ae((SV,AS)=>{"use strict";var vS={};AS.exports=function(t){vS[t]||(vS[t]=!0,typeof globalThis.console<"u"&&globalThis.console.warn&&globalThis.console.warn(t))}});var Sf=Ae((vV,TS)=>{"use strict";var eL=sn(),tL=cl(),nL=mf(),rL=vl(),wS=Al(),oL=uo(),iL=Ti(),{isClean:Lt,my:aL}=Ri(),EV=bf(),sL={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},lL={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},uL={Once:!0,postcssPlugin:!0,prepare:!0},fo=0;function Ui(e){return typeof e=="object"&&typeof e.then=="function"}function yf(e){let t=!1,n=sL[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,fo,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,fo,n+"Exit"]:[n,n+"Exit"]}function _S(e){let t;return e.type==="document"?t=["Document",fo,"DocumentExit"]:e.type==="root"?t=["Root",fo,"RootExit"]:t=yf(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function CS(e){let t=[e];for(;t.length>0;){let n=t.pop();if(n[Lt]=!1,n.nodes)for(let r of n.nodes)t.push(r)}return e}var xf={},Gn=class e{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(t,n,r){this.stringified=!1,this.processed=!1;let o;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))o=CS(n);else if(n instanceof e||n instanceof wS)o=CS(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let i=rL;r.syntax&&(i=r.syntax.parse),r.parser&&(i=r.parser),i.parse&&(i=i.parse);try{o=i(n,r)}catch(a){this.processed=!0,this.error=a}o&&!o[aL]&&eL.rebuild(o)}this.result=new wS(t,o,r),this.helpers={...xf,postcss:xf,result:this.result},this.plugins=this.processor.plugins.map(i=>typeof i=="object"&&i.prepare?{...i,...i.prepare(this.result)}:i)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,n){let r=this.result.lastPlugin;try{n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin?(t.plugin=r.postcssPlugin,t.setMessage()):r.postcssVersion}catch(o){globalThis.console&&globalThis.console.error&&globalThis.console.error(o)}return t}prepareVisitors(){this.listeners={};let t=(n,r,o)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,o])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!lL[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!uL[r])if(typeof n[r]=="object")for(let o in n[r])o==="*"?t(n,r,n[r][o]):t(n,r+"-"+o.toLowerCase(),n[r][o]);else typeof n[r]=="function"&&t(n,r,n[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let n=this.plugins[t],r=this.runOnRoot(n);if(Ui(r))try{await r}catch(o){throw this.handleError(o)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Lt];){t[Lt]=!0;let n=[_S(t)];for(;n.length>0;){let r=this.visitTick(n);if(Ui(r))try{await r}catch(o){let i=n[n.length-1].node;throw this.handleError(o,i)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let o=t.nodes.map(i=>r(i,this.helpers));await Promise.all(o)}else await r(t,this.helpers)}catch(o){throw this.handleError(o)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let n=this.result.root.nodes.map(r=>t.Once(r,this.helpers));return Ui(n[0])?Promise.all(n):n}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(n){throw this.handleError(n)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,n=iL;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let r=this.result.root.source;if(t.map===void 0&&!(r&&r.input&&r.input.map)){let a="";return n(this.result.root,l=>{a+=l}),this.result.css=a,this.result}let i=new nL(n,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let n=this.runOnRoot(t);if(Ui(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Lt];)t[Lt]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let n of t.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,n){return this.async().then(t,n)}toString(){return this.css}visitSync(t,n){for(let[r,o]of t){this.result.lastPlugin=r;let i;try{i=o(n,this.helpers)}catch(a){throw this.handleError(a,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(Ui(i))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:o}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(o.length>0&&n.visitorIndex<o.length){let[a,l]=o[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===o.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=a;try{return l(r.toProxy(),this.helpers)}catch(s){throw this.handleError(s,r)}}if(n.iterator!==0){let a=n.iterator;n.descending&&(n.descending=!1,r.indexes[a]+=1);let l;for(;l=r.nodes[r.indexes[a]];){if(!l[Lt]){l[Lt]=!0,n.descending=!0,t.push(_S(l));return}r.indexes[a]+=1}n.iterator=0,delete r.indexes[a]}let i=n.events;for(;n.eventIndex<i.length;){let a=i[n.eventIndex];if(n.eventIndex+=1,a===fo){r.nodes&&r.nodes.length&&(r[Lt]=!0,n.iterator=r.getIterator());return}else if(this.listeners[a]){n.visitors=this.listeners[a];return}}t.pop()}walkSync(t){t[Lt]=!0;let n=[{eventIndex:0,events:yf(t),iterator:0,node:t}];for(;n.length>0;){let r=n[n.length-1],o=r.node;if(r.iterator!==0){let i=r.iterator;r.descending&&(r.descending=!1,o.indexes[i]+=1);let a,l=!1;for(;a=o.nodes[o.indexes[i]];){if(!a[Lt]){a[Lt]=!0,r.descending=!0,n.push({eventIndex:0,events:yf(a),iterator:0,node:a}),l=!0;break}o.indexes[i]+=1}if(l)continue;r.iterator=0,delete o.indexes[i]}if(r.eventIndex<r.events.length){let i=r.events[r.eventIndex];if(r.eventIndex+=1,i===fo)o.nodes&&o.nodes.length&&(r.iterator=o.getIterator());else{let a=this.listeners[i];a&&this.visitSync(a,o.toProxy())&&n.pop()}continue}n.pop()}}warnings(){return this.sync().warnings()}};Gn.registerPostcss=e=>{xf=e};TS.exports=Gn;Gn.default=Gn;oL.registerLazyResult(Gn);tL.registerLazyResult(Gn)});var MS=Ae((wV,RS)=>{"use strict";var cL=mf(),dL=vl(),fL=Al(),mL=Ti(),AV=bf(),Wi=class{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,n=dL;try{t=n(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,n,r){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;let o=mL;this.result=new fL(this._processor,void 0,this._opts),this.result.css=n;let i=this;Object.defineProperty(this.result,"root",{get(){return i.root}});let a=new cL(o,void 0,this._opts,n);if(a.isMap()){let[l,s]=a.generate();l&&(this.result.css=l),s&&(this.result.map=s)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,n){return this.async().then(t,n)}toString(){return this._css}warnings(){return[]}};RS.exports=Wi;Wi.default=Wi});var LS=Ae((_V,kS)=>{"use strict";var pL=cl(),hL=Sf(),gL=MS(),bL=uo(),xr=class{constructor(t=[]){this.version="8.5.28",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let r of t)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)n.push(r);else if(typeof r=="function")n.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new gL(this,t,n):new hL(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};kS.exports=xr;xr.default=xr;bL.registerProcessor(xr);pL.registerProcessor(xr)});var GS=Ae((CV,HS)=>{"use strict";var NS=ul(),FS=Fi(),yL=sn(),xL=ll(),PS=Ii(),IS=cl(),SL=iS(),EL=Oi(),vL=Sf(),AL=df(),wL=Li(),_L=vl(),Ef=LS(),CL=Al(),DS=uo(),OS=hl(),TL=Ti(),RL=gf();function Ne(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Ef(e)}Ne.plugin=function(t,n){let r=!1;function o(...a){globalThis.console&&globalThis.console.warn&&!r&&(r=!0,globalThis.console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
27
|
+
`),n=l.length-i):n+=l.length,s&&c!=="start"){let d=s.parent||{raws:{}};(!(s.type==="decl"||s.type==="atrule"&&!s.nodes)||s!==d.last||d.raws.semicolon)&&(s.source&&s.source.end?(o.source=this.sourcePath(s),o.original.line=s.source.end.line,o.original.column=s.source.end.column-1,o.generated.line=t,o.generated.column=n-2,this.map.addMapping(o)):(o.source=r,o.original.line=1,o.original.column=0,o.generated.line=t,o.generated.column=n-1,this.map.addMapping(o)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(n=>n.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let n=this.memoizedPaths.get(t);if(n)return n;let r=this.opts.to?bl(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=bl(lS(r,this.mapOpts.annotation)));let o=sS(r,t);return this.memoizedPaths.set(t,o),o}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let n=t.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let t=new Hk(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(n=>{if(n.source){let r=n.source.input.from;if(r&&!t[r]){t[r]=!0;let o=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(o,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let n=this.memoizedFileURLs.get(t);if(n)return n;if(aS){let r=aS(t).toString();return this.memoizedFileURLs.set(t,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let n=this.memoizedURLs.get(t);if(n)return n;uS==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}};dS.exports=ff});var pS=Ae((gV,mS)=>{"use strict";var xl=/[\t\n\f\r "#'()/;[\\\]{}]/g,Sl=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Uk=/.[\r\n"'(/\\]/,fS=/[\da-f]/i;mS.exports=function(t,n={}){let r=t.css.valueOf(),o=n.ignoreErrors,i,a,l,s,c,d,f,m,p,b,y=r.length,x=0,E=[],v=[],_=-1;function U(){return x}function G(H){throw t.error("Unclosed "+H,x)}function R(){return v.length===0&&x>=y}function D(H){if(v.length)return v.pop();if(x>=y)return;let I=H?H.ignoreUnclosed:!1;switch(i=r.charCodeAt(x),i){case 10:case 32:case 9:case 13:case 12:{s=x;do s+=1,i=r.charCodeAt(s);while(i===32||i===10||i===9||i===13||i===12);d=["space",r.slice(x,s)],x=s-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let Y=String.fromCharCode(i);d=[Y,Y,x];break}case 40:{if(b=E.length?E.pop()[1]:"",p=r.charCodeAt(x+1),b==="url"&&p!==39&&p!==34&&p!==32&&p!==10&&p!==9&&p!==12&&p!==13){s=x;do{if(f=!1,s=r.indexOf(")",s+1),s===-1)if(o||I){s=x;break}else G("bracket");for(m=s;r.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);d=["brackets",r.slice(x,s+1),x,s],x=s}else x<=_?d=["(","(",x]:(s=r.indexOf(")",x+1),a=r.slice(x,s+1),s===-1||Uk.test(a)?(_=s===-1?y:s,d=["(","(",x]):(d=["brackets",a,x,s],x=s));break}case 39:case 34:{c=i===39?"'":'"',s=x;do{if(f=!1,s=r.indexOf(c,s+1),s===-1)if(o||I){s=x+1;break}else G("string");for(m=s;r.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);d=["string",r.slice(x,s+1),x,s],x=s;break}case 64:{xl.lastIndex=x+1,xl.test(r),xl.lastIndex===0?s=r.length-1:s=xl.lastIndex-2,d=["at-word",r.slice(x,s+1),x,s],x=s;break}case 92:{for(s=x,l=!0;r.charCodeAt(s+1)===92;)s+=1,l=!l;if(i=r.charCodeAt(s+1),l&&i!==47&&i!==32&&i!==10&&i!==9&&i!==13&&i!==12&&(s+=1,fS.test(r.charAt(s)))){for(;fS.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===32&&(s+=1)}d=["word",r.slice(x,s+1),x,s],x=s;break}default:{i===47&&r.charCodeAt(x+1)===42?(s=r.indexOf("*/",x+2)+1,s===0&&(o||I?s=r.length:G("comment")),d=["comment",r.slice(x,s+1),x,s],x=s):(Sl.lastIndex=x+1,Sl.test(r),Sl.lastIndex===0?s=r.length-1:s=Sl.lastIndex-2,d=["word",r.slice(x,s+1),x,s],E.push(d),x=s);break}}return x++,d}function T(H){v.push(H)}return{back:T,endOfFile:R,nextToken:D,position:U}}});var yS=Ae((bV,bS)=>{"use strict";var Wk=ul(),Vk=Fi(),$k=Ii(),qk=uo(),hS=hl(),zk=pS(),gS={empty:!0,space:!0};function jk(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}function pf(e,t,n){let r="";for(let o=t;o<n;o++)r+=e[o][1];return r}var hf=class{constructor(t){this.input=t,this.root=new qk,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let n=new Wk;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,o,i,a=!1,l=!1,s=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?c.push(r==="("?")":"]"):r==="{"&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),c.length===0)if(r===";"){n.source.end=this.getPosition(t[2]),n.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(s.length>0){for(i=s.length-1,o=s[i];o&&o[0]==="space";)o=s[--i];o&&(n.source.end=this.getPosition(o[3]||o[2]),n.source.end.offset++)}this.end(t);break}else s.push(t);else s.push(t);if(this.tokenizer.endOfFile()){a=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(n.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(n,"params",s),a&&(t=s[s.length-1],n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),l&&(n.nodes=[],this.current=n)}checkMissedSemicolon(t){let n=this.colon(t);if(n===!1)return;let r=0,o;for(let i=n-1;i>=0&&(o=t[i],!(o[0]!=="space"&&(r+=1,r===2)));i--);throw this.input.error("Missed semicolon",o[0]==="word"?o[3]+1:o[2])}colon(t){let n=0,r,o,i;for(let[a,l]of t.entries()){if(o=l,i=o[0],i==="("&&(n+=1),i===")"&&(n-=1),n===0&&i===":")if(!r)this.doubleColon(o);else{if(r[0]==="word"&&r[1]==="progid")continue;return a}r=o}return!1}comment(t){let n=new Vk;this.init(n,t[2]),n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++;let r=t[1].slice(2,-2);if(!r.trim())n.text="",n.raws.left=r,n.raws.right="";else{let o=r.match(/^(\s*)([^]*\S)(\s*)$/);n.text=o[2],n.raws.left=o[1],n.raws.right=o[3]}}createTokenizer(){this.tokenizer=zk(this.input)}decl(t,n){let r=new $k;this.init(r,t[0][2]);let o=t[t.length-1];o[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(o[3]||o[2]||jk(t)),r.source.end.offset++;let i=0;for(;t[i][0]!=="word";)i===t.length-1&&this.unknownWord([t[i]]),i++;r.raws.before+=pf(t,0,i),r.source.start=this.getPosition(t[i][2]);let a=i;for(;i<t.length;){let m=t[i][0];if(m===":"||m==="space"||m==="comment")break;i++}r.prop=pf(t,a,i);let l=i,s;for(;i<t.length&&(s=t[i],i++,s[0]!==":");)s[0]==="word"&&/\w/.test(s[1])&&this.unknownWord([s]);r.raws.between=pf(t,l,i),(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let c=i;for(;i<t.length;){let m=t[i][0];if(m!=="space"&&m!=="comment")break;i++}let d=t.slice(c,i);t=t.slice(i),this.precheckMissedSemicolon(t);for(let m=t.length-1;m>=0;m--){if(s=t[m],s[1].toLowerCase()==="!important"){r.important=!0;let p=this.stringFrom(t,m);p=this.spacesFromEnd(t)+p,p!==" !important"&&(r.raws.important=p);break}else if(s[1].toLowerCase()==="important"){let p=t.slice(0),b="";for(let y=m;y>0;y--){let x=p[y][0];if(b.trim().startsWith("!")&&x!=="space")break;b=p.pop()[1]+b}b.trim().startsWith("!")&&(r.important=!0,r.raws.important=b,t=p)}if(s[0]!=="space"&&s[0]!=="comment")break}t.some(m=>m[0]!=="space"&&m[0]!=="comment")&&(r.raws.between+=d.map(m=>m[1]).join(""),d=[]),this.raw(r,"value",d.concat(t),n),r.value.includes(":")&&!n&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let n=new hS;this.init(n,t[2]),n.selector="",n.raws.between="",this.current=n}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="",n.source.end=this.getPosition(t[2]),n.source.end.offset++)}}getPosition(t){let n=this.input.fromOffset(t);return{column:n.col,line:n.line,offset:t}}init(t,n){this.current.push(t),t.source={input:this.input,start:this.getPosition(n)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let n=!1,r=null,o=!1,i=null,a=[],l=t[1].startsWith("--"),s=[],c=t;for(;c;){if(r=c[0],s.push(c),r==="("||r==="[")i||(i=c),a.push(r==="("?")":"]");else if(l&&o&&r==="{")i||(i=c),a.push("}");else if(a.length===0)if(r===";")if(o){this.decl(s,l);return}else break;else if(r==="{"){this.rule(s);return}else if(r==="}"){this.tokenizer.back(s.pop()),n=!0;break}else r===":"&&(o=!0);else r===a[a.length-1]&&(a.pop(),a.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),a.length>0&&this.unclosedBracket(i),n&&o){if(!l)for(;s.length&&(c=s[s.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(s.pop());this.decl(s,l)}else this.unknownWord(s)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,n,r,o){let i,a,l=r.length,s="",c=!0,d,f;for(let m=0;m<l;m+=1)i=r[m],a=i[0],a==="space"&&m===l-1&&!o?c=!1:a==="comment"?(f=r[m-1]?r[m-1][0]:"empty",d=r[m+1]?r[m+1][0]:"empty",!gS[f]&&!gS[d]?s.slice(-1)===","?c=!1:s+=i[1]:c=!1):s+=i[1];if(!c){let m=r.reduce((p,b)=>p+b[1],"");t.raws[n]={raw:m,value:s}}t[n]=s}rule(t){t.pop();let n=new hS;this.init(n,t[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(n,"selector",t),this.current=n}spacesAndCommentsFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],!(n!=="space"&&n!=="comment"));)r=t.pop()[1]+r;return r}spacesAndCommentsFromStart(t){let n,r="";for(;t.length&&(n=t[0][0],!(n!=="space"&&n!=="comment"));)r+=t.shift()[1];return r}spacesFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],n==="space");)r=t.pop()[1]+r;return r}stringFrom(t,n){let r="";for(let o=n;o<t.length;o++)r+=t[o][1];return t.splice(n,t.length-n),r}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}};bS.exports=hf});var vl=Ae((yV,xS)=>{"use strict";var Kk=sn(),Yk=Oi(),Xk=yS();function El(e,t){let n=new Yk(e,t),r=new Xk(n);try{r.parse()}catch(o){throw o}return r.root}xS.exports=El;El.default=El;Kk.registerParse(El)});var gf=Ae((xV,SS)=>{"use strict";var Jk=sn(),{my:Qk}=Ri(),Gi=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){n.node[Qk]||Jk.rebuild(n.node);let r=n.node.rangeBy(n);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in n)this[r]=n[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};SS.exports=Gi;Gi.default=Gi});var Al=Ae((SV,ES)=>{"use strict";var Zk=gf(),Bi=class{get content(){return this.css}constructor(t,n,r){this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css="",this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new Zk(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}};ES.exports=Bi;Bi.default=Bi});var bf=Ae((EV,AS)=>{"use strict";var vS={};AS.exports=function(t){vS[t]||(vS[t]=!0,typeof globalThis.console<"u"&&globalThis.console.warn&&globalThis.console.warn(t))}});var Sf=Ae((AV,TS)=>{"use strict";var eL=sn(),tL=cl(),nL=mf(),rL=vl(),wS=Al(),oL=uo(),iL=Ti(),{isClean:Lt,my:aL}=Ri(),vV=bf(),sL={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},lL={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},uL={Once:!0,postcssPlugin:!0,prepare:!0},fo=0;function Ui(e){return typeof e=="object"&&typeof e.then=="function"}function yf(e){let t=!1,n=sL[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,fo,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,fo,n+"Exit"]:[n,n+"Exit"]}function _S(e){let t;return e.type==="document"?t=["Document",fo,"DocumentExit"]:e.type==="root"?t=["Root",fo,"RootExit"]:t=yf(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function CS(e){let t=[e];for(;t.length>0;){let n=t.pop();if(n[Lt]=!1,n.nodes)for(let r of n.nodes)t.push(r)}return e}var xf={},Gn=class e{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(t,n,r){this.stringified=!1,this.processed=!1;let o;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))o=CS(n);else if(n instanceof e||n instanceof wS)o=CS(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let i=rL;r.syntax&&(i=r.syntax.parse),r.parser&&(i=r.parser),i.parse&&(i=i.parse);try{o=i(n,r)}catch(a){this.processed=!0,this.error=a}o&&!o[aL]&&eL.rebuild(o)}this.result=new wS(t,o,r),this.helpers={...xf,postcss:xf,result:this.result},this.plugins=this.processor.plugins.map(i=>typeof i=="object"&&i.prepare?{...i,...i.prepare(this.result)}:i)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,n){let r=this.result.lastPlugin;try{n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin?(t.plugin=r.postcssPlugin,t.setMessage()):r.postcssVersion}catch(o){globalThis.console&&globalThis.console.error&&globalThis.console.error(o)}return t}prepareVisitors(){this.listeners={};let t=(n,r,o)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,o])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!lL[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!uL[r])if(typeof n[r]=="object")for(let o in n[r])o==="*"?t(n,r,n[r][o]):t(n,r+"-"+o.toLowerCase(),n[r][o]);else typeof n[r]=="function"&&t(n,r,n[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let n=this.plugins[t],r=this.runOnRoot(n);if(Ui(r))try{await r}catch(o){throw this.handleError(o)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Lt];){t[Lt]=!0;let n=[_S(t)];for(;n.length>0;){let r=this.visitTick(n);if(Ui(r))try{await r}catch(o){let i=n[n.length-1].node;throw this.handleError(o,i)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let o=t.nodes.map(i=>r(i,this.helpers));await Promise.all(o)}else await r(t,this.helpers)}catch(o){throw this.handleError(o)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let n=this.result.root.nodes.map(r=>t.Once(r,this.helpers));return Ui(n[0])?Promise.all(n):n}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(n){throw this.handleError(n)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,n=iL;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let r=this.result.root.source;if(t.map===void 0&&!(r&&r.input&&r.input.map)){let a="";return n(this.result.root,l=>{a+=l}),this.result.css=a,this.result}let i=new nL(n,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let n=this.runOnRoot(t);if(Ui(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Lt];)t[Lt]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let n of t.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,n){return this.async().then(t,n)}toString(){return this.css}visitSync(t,n){for(let[r,o]of t){this.result.lastPlugin=r;let i;try{i=o(n,this.helpers)}catch(a){throw this.handleError(a,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(Ui(i))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:o}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(o.length>0&&n.visitorIndex<o.length){let[a,l]=o[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===o.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=a;try{return l(r.toProxy(),this.helpers)}catch(s){throw this.handleError(s,r)}}if(n.iterator!==0){let a=n.iterator;n.descending&&(n.descending=!1,r.indexes[a]+=1);let l;for(;l=r.nodes[r.indexes[a]];){if(!l[Lt]){l[Lt]=!0,n.descending=!0,t.push(_S(l));return}r.indexes[a]+=1}n.iterator=0,delete r.indexes[a]}let i=n.events;for(;n.eventIndex<i.length;){let a=i[n.eventIndex];if(n.eventIndex+=1,a===fo){r.nodes&&r.nodes.length&&(r[Lt]=!0,n.iterator=r.getIterator());return}else if(this.listeners[a]){n.visitors=this.listeners[a];return}}t.pop()}walkSync(t){t[Lt]=!0;let n=[{eventIndex:0,events:yf(t),iterator:0,node:t}];for(;n.length>0;){let r=n[n.length-1],o=r.node;if(r.iterator!==0){let i=r.iterator;r.descending&&(r.descending=!1,o.indexes[i]+=1);let a,l=!1;for(;a=o.nodes[o.indexes[i]];){if(!a[Lt]){a[Lt]=!0,r.descending=!0,n.push({eventIndex:0,events:yf(a),iterator:0,node:a}),l=!0;break}o.indexes[i]+=1}if(l)continue;r.iterator=0,delete o.indexes[i]}if(r.eventIndex<r.events.length){let i=r.events[r.eventIndex];if(r.eventIndex+=1,i===fo)o.nodes&&o.nodes.length&&(r.iterator=o.getIterator());else{let a=this.listeners[i];a&&this.visitSync(a,o.toProxy())&&n.pop()}continue}n.pop()}}warnings(){return this.sync().warnings()}};Gn.registerPostcss=e=>{xf=e};TS.exports=Gn;Gn.default=Gn;oL.registerLazyResult(Gn);tL.registerLazyResult(Gn)});var MS=Ae((_V,RS)=>{"use strict";var cL=mf(),dL=vl(),fL=Al(),mL=Ti(),wV=bf(),Wi=class{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,n=dL;try{t=n(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,n,r){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;let o=mL;this.result=new fL(this._processor,void 0,this._opts),this.result.css=n;let i=this;Object.defineProperty(this.result,"root",{get(){return i.root}});let a=new cL(o,void 0,this._opts,n);if(a.isMap()){let[l,s]=a.generate();l&&(this.result.css=l),s&&(this.result.map=s)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,n){return this.async().then(t,n)}toString(){return this._css}warnings(){return[]}};RS.exports=Wi;Wi.default=Wi});var LS=Ae((CV,kS)=>{"use strict";var pL=cl(),hL=Sf(),gL=MS(),bL=uo(),xr=class{constructor(t=[]){this.version="8.5.28",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let r of t)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)n.push(r);else if(typeof r=="function")n.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new gL(this,t,n):new hL(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};kS.exports=xr;xr.default=xr;bL.registerProcessor(xr);pL.registerProcessor(xr)});var GS=Ae((TV,HS)=>{"use strict";var NS=ul(),FS=Fi(),yL=sn(),xL=ll(),PS=Ii(),IS=cl(),SL=iS(),EL=Oi(),vL=Sf(),AL=df(),wL=Li(),_L=vl(),Ef=LS(),CL=Al(),DS=uo(),OS=hl(),TL=Ti(),RL=gf();function Ne(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Ef(e)}Ne.plugin=function(t,n){let r=!1;function o(...a){globalThis.console&&globalThis.console.warn&&!r&&(r=!0,globalThis.console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
28
28
|
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("zh")&&globalThis.console.warn(t+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
29
29
|
https://www.w3ctech.com/topic/2226`));let l=n(...a);return l.postcssPlugin=t,l.postcssVersion=new Ef().version,l}let i;return Object.defineProperty(o,"postcss",{get(){return i||(i=o()),i}}),o.process=function(a,l,s){return Ne([o(s)]).process(a,l)},o};Ne.stringify=TL;Ne.parse=_L;Ne.fromJSON=SL;Ne.list=AL;Ne.comment=e=>new FS(e);Ne.atRule=e=>new NS(e);Ne.decl=e=>new PS(e);Ne.rule=e=>new OS(e);Ne.root=e=>new DS(e);Ne.document=e=>new IS(e);Ne.CssSyntaxError=xL;Ne.Declaration=PS;Ne.Container=yL;Ne.Processor=Ef;Ne.Document=IS;Ne.Comment=FS;Ne.Warning=RL;Ne.AtRule=NS;Ne.Result=CL;Ne.Input=EL;Ne.Rule=OS;Ne.Root=DS;Ne.Node=wL;vL.registerPostcss(Ne);HS.exports=Ne;Ne.default=Ne});function Vh(e){return e?/[\w-]/.test(e)||e.charCodeAt(0)>=128:!1}function $h(e){return e===" "||e===" "||e===`
|
|
30
30
|
`||e==="\r"||e==="\f"}var WC=/^[0-9a-fA-F]{1,6}/;function VC(e){let t=e>=55296&&e<=57343;return e===0||e>1114111||t?65533:e}function qh(e,t){return e[t]==="\r"&&e[t+1]===`
|
|
31
31
|
`?t+2:$h(e[t])?t+1:t}function Zu(e,t){let n=e[t+1];if(n===void 0||/[\n\r\f]/.test(n))return null;let r=WC.exec(e.slice(t+1,t+7));if(!r)return{value:n,end:t+2};let o=VC(Number.parseInt(r[0],16));return{value:String.fromCodePoint(o),end:qh(e,t+1+r[0].length)}}function $C(e,t){let n=o=>Vh(o)&&!/[0-9-]/.test(o),r=o=>e[o]==="\\"&&Zu(e,o)!==null;return e[t]==="-"?e[t+1]==="-"||n(e[t+1])||r(t+1):n(e[t])||r(t)}function Va(e,t){let n=t;for(;e.startsWith("/*",n);){let r=e.indexOf("*/",n+2);n=r<0?e.length:r+2}return n}function Vo(e,t){let n=Va(e,t);for(;$h(e[n]);)n=Va(e,n+1);return n}function $o(e,t){if(!$C(e,t))return null;let n=t,r="";for(;n<e.length;){let o=e[n];if(o==="\\"){let i=Zu(e,n);if(!i)break;r+=i.value,n=i.end;continue}if(!Vh(o))break;r+=o,n+=1}return n===t?null:{value:r,end:n}}var ec=45;function zh(e){return e>=48&&e<=57}function qC(e){return e>=128||e===ec||e===95||zh(e)||e>=65&&e<=90||e>=97&&e<=122}function zC(e,t){let n=e.charCodeAt(t);return n>=1&&n<=31||n===127?!0:zh(n)?t===0||t===1&&e.charCodeAt(0)===ec:!1}function Xt(e){let t="";for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n),o=e[n];r===0?t+="\uFFFD":zC(e,n)?t+=`\\${r.toString(16)} `:n===0&&e.length===1&&r===ec?t+=`\\${o}`:qC(r)?t+=o:t+=`\\${o}`}return t}var jh=/\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:[0-9a-fA-F]{1,6}(?:\r\n|[ \t\r\n\f])?|[\s\S])|"(?:[^"\\]|\\[\s\S])*"|'(?:[^'\\]|\\[\s\S])*'|\[(?:\/\*(?:[^*]|\*(?!\/))*\*\/|\\[\s\S]|"(?:[^"\\]|\\[\s\S])*"|'(?:[^'\\]|\\[\s\S])*'|[^\]"'\\/]|\/(?!\*))*\]/g;function jC(e){let t=new Array(e.length).fill(!0);for(let n of e.matchAll(jh)){let r=n.index;t.fill(!1,r,r+n[0].length)}return t}function $a(e,t,n){if(t.length===0||!e.includes("#"))return e;let r=new Set(t),o=jC(e),i="",a=0;for(;a<e.length;){let l=o[a]&&e[a]==="#"?$o(e,a+1):null;l&&r.has(l.value)?(i+=n(l.value),a=l.end):(i+=e[a],a+=1)}return i}function KC(e){let t="";for(let n=0;n<e.length;n+=1){if(e[n]==="\\"){let r=e[n+1];if(r!==void 0&&/[\n\r\f]/.test(r)){n=qh(e,n+1)-1;continue}let o=Zu(e,n);if(o){t+=o.value,n=o.end-1;continue}}t+=e[n]}return t}function tc(e){return Array.from(e,t=>{let n=t.charCodeAt(0);return n===0?"\uFFFD":n<32||n===127?`\\${n.toString(16)} `:t==='"'||t==="\\"?`\\${t}`:t}).join("")}function YC(e,t){return e?{kind:"any"}:t===void 0?{kind:"none"}:{kind:"named",prefix:t}}function XC(e,t){return e[t]==="|"&&e[t+1]!=="="}function JC(e,t){let n=e[t]==="*",r=n?{value:"*",end:t+1}:$o(e,t),o=Va(e,r?.end??t);if(!XC(e,o))return n?null:r?{token:r,namespace:{kind:"none"}}:null;let i=$o(e,Va(e,o+1));return i?{token:i,namespace:YC(n,r?.value)}:null}function QC(e){if(e[0]!=="[")return null;let t=Vo(e,1),n=JC(e,t);if(!n)return null;let{token:r,namespace:o}=n;return{name:r.value,rawName:e.slice(t,r.end),namespace:o,end:r.end}}function ZC(e,t){let n=/^(?:"((?:\\[\s\S]|[^"\\])*)"|'((?:\\[\s\S]|[^'\\])*)')/.exec(e.slice(t));return n?{value:KC(n[1]??n[2]),end:t+n[0].length}:$o(e,t)}function eT(e,t){let n=Vo(e,t),r=$o(e,n);if(r){if(!/^[is]$/i.test(r.value))return null;n=Vo(e,r.end)}return e[n]!=="]"||n!==e.length-1?null:{flag:r?.value}}function Kh(e){let t=QC(e);if(!t)return null;let n=Vo(e,t.end),o=["=","~=","|=","^=","$=","*="].find(l=>e.startsWith(l,n));if(!o)return null;let i=ZC(e,Vo(e,n+o.length));if(!i)return null;let a=eT(e,i.end);return a?{name:t.name,rawName:t.rawName,namespace:t.namespace,operator:o,value:i.value,flag:a.flag}:null}function nc(e,t){return e.replace(jh,n=>n.startsWith("[")?t(n):n)}var _t="data-hf-svg-reference-aliases";function qa(e,t,n,r){let o={"=":(f,m)=>f===m,"~=":(f,m)=>f.split(/[ \t\r\n\f]+/).includes(m),"|=":(f,m)=>f===m||f.startsWith(m+"-"),"^=":(f,m)=>f.startsWith(m),"$=":(f,m)=>f.endsWith(m),"*=":(f,m)=>f.includes(m)},i=(f,m,p)=>!m&&p!=="="&&p!=="|="?!1:o[p](f,m),a=f=>f.replace(/[A-Z]/g,m=>m.toLowerCase()),l=f=>{let m=Kh(f);if(!m)return f;let{name:p,rawName:b,namespace:y,operator:x,value:E,flag:v}=m;if(y.kind==="named"!=(r!==void 0))return f;let _=v?.toLowerCase()==="i"?a:D=>D,U=a(p),G=n.filter(D=>{let T=y.kind==="none"?D.name:D.localName,H=y.kind==="named"?r.get(y.prefix):null;return(y.kind==="any"||D.namespaceURI===H)&&a(T)===U}),R=new Set([f]);for(let D of G)i(_(D.before),_(E),x)&&R.add(`[${b}="${tc(D.after)}"${v?` ${v}`:""}]`);return R.size===1?f:`:is(${[...R].join(", ")})`};if(r)return nc(e,l);let s=new Map(t.map(({id:f,replacement:m})=>[f,m])),c=new Map;for(let f of n){if(f.name!=="id"||f.before===f.after||s.has(f.before))continue;let m=c.get(f.before);m||(m=new Set([`#${Xt(f.before)}`]),c.set(f.before,m)),m.add(`#${Xt(f.after)}`)}for(let[f,m]of c)s.set(f,`:is(${[...m].join(", ")})`);let d=$a(e,[...s.keys()],f=>s.get(f));return nc(d,l)}function nr(e,t,n=!0){let r=[],i=(n?[...e.querySelectorAll(`[${t}]`)]:[]).map(l=>l.getAttribute(t)),a=e.getAttribute?.(t);a&&i.unshift(a);for(let l of i){let s;try{s=JSON.parse(l)}catch{continue}if(!Array.isArray(s))continue;let c=s;for(let d of c){if(!nT(d))continue;let{name:f,localName:m,namespaceURI:p,before:b,after:y}=d;r.push({name:f,localName:m,namespaceURI:p,before:b,after:y})}}return r}function nT(e){if(!e||typeof e!="object")return!1;let{name:t,localName:n,namespaceURI:r,before:o,after:i}=e;return typeof t=="string"&&typeof n=="string"&&(r===null||typeof r=="string")&&typeof o=="string"&&typeof i=="string"}function rT(e){let t=[],n=[],r=!1,o,i=new WeakMap,a=(c,d)=>{for(let f of c){if("selectorText"in f){let m=f,p=i.get(m),b=m.selectorText,y=p?.applied===b?p.authored:b,x=qa(y,[],n,d);x!==b&&(m.selectorText=x),x===y?i.delete(m):i.set(m,{authored:y,applied:m.selectorText})}"cssRules"in f&&a(f.cssRules,d)}},l=()=>{if(n.length)for(let c of e.document.styleSheets){let d;try{d=c.cssRules}catch{continue}let f=new Map;for(let m of d){if(!("namespaceURI"in m))continue;let{prefix:p,namespaceURI:b}=m;p&&f.set(p,b||null)}f.size&&a(d,f)}},s={rewrite:(c,d=[])=>{if(typeof c!="string"||!c.includes("#")&&!c.includes("["))return c;let f=qa(c,d.length?[...d,...t]:t,n);if(f!==c){if(!o){let m=e.document.createElement("div");o=m.matches.bind(m)}o(c)}return f},refresh(){n=nr(e.document,_t).filter(m=>m.before!==m.after);let c=new Set(n.filter(m=>m.name==="id").map(m=>m.before)),d=new Set;t=[];for(let m of e.document.querySelectorAll("[data-hf-authored-id][id]")){let p=m.getAttribute("data-hf-authored-id");if(!p||p===m.id||d.has(p)||c.has(p))continue;d.add(p);let b=tc(p);t.push({id:p,replacement:`:is(#${Xt(p)}, [data-hf-authored-id="${b}"])`})}if(l(),r||!t.length&&!n.length)return;let f=e.Element.prototype;f.querySelector=new Proxy(f.querySelector,{apply(m,p,b){return Reflect.apply(m,p,[s.rewrite(b[0])])}}),f.querySelectorAll=new Proxy(f.querySelectorAll,{apply(m,p,b){return Reflect.apply(m,p,[s.rewrite(b[0])])}}),r=!0}};e.__hfSvgSelectorAliases=s,s.refresh()}function rr(){let e=window;e.__hfSvgSelectorAliases?e.__hfSvgSelectorAliases.refresh():rT(e)}function za(){return globalThis}function qo(e){let t="unknown error";try{e instanceof Error?(t=`${e.name}: ${e.message}`,t+=iT(e,t)):t=String(e)}catch(n){V("runtime.startupError",n)}t=t.replace(/\s+/g," ").trim(),window.__hfStartupError=`HyperFrames runtime failed: ${t}. Check the composition's scripts and window.__timelines entries; if they look right, report this as a HyperFrames bug.`}var Yh="[hyperframes] scene timeline callback threw:";function V(e,t){if(typeof window>"u")return;let n=za(),r=n.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(o){}(n.__hfDebug||n.__HYPERFRAMES_DEBUG)&&globalThis.console.debug(`[hyperframes] ${e} swallowed:`,t)}function oT(e){let t=/(?:\(|@|\bat )(\S+?):\d+(?::\d+)?\)?$/.exec(e)?.[1];return!t||t.startsWith("hyperframes://")?!1:t.startsWith("hyperframes-composition://")||/\.html?(?:[?#]|$)/i.test(t)||typeof document<"u"&&t===document.URL}function iT(e,t){try{let n=e.stack;if(typeof n!="string")return"";let i=(n===t||n.startsWith(`${t}
|
|
32
|
-
`)||n.startsWith(`${t}\r`)?n.slice(t.length):n).split(/[\r\n]+/).map(s=>s.trim().replace(/\s+/g," ")).filter(s=>/^at\s+\S/.test(s)||/^[^@]*@.+:\d+(?::\d+)?$/.test(s)),a=i.slice(0,3),l=i.find(oT);return l&&!a.includes(l)&&a.push(l),a.length?` [thrown at: ${a.join(" <- ")}]`:""}catch(n){return V("runtime.startupError.stack",n),""}}var ja="hyperframes-studio-preview",Xh="capture",or="data-hf-upcoming",Ka="data-hf-preview-lazy";var ir="data-hf-preview-raster",Dt="data-hf-autostamped",Ct="data-hf-far-scene",vn="data-hf-parked-scene",Ya=[or,Ct,vn,Ka,ir,Dt];var Jh="http://www.w3.org/1999/xhtml";function Oe(e){return e!=null&&e.nodeType===1}function we(e){return Oe(e)&&e.namespaceURI===Jh}function Ir(e,t){return we(e)&&e.localName===t}function Le(e){return Ir(e,"video")}function Xa(e){return Ir(e,"audio")}function _e(e){return Le(e)||Xa(e)}function Je(e){return Ir(e,"img")}function Jt(e){return Ir(e,"canvas")}function Qh(e){return Ir(e,"style")}function Zh(e){return Ir(e,"link")}function ar(e){return Oe(e)&&(e.namespaceURI===Jh||e.namespaceURI==="http://www.w3.org/2000/svg")}
|
|
33
|
-
`),n.isConnected||document.head.appendChild(n)};return s=>{if((!t||t.some(d=>!d.isConnected))&&o.watch(t=Array.from(document.querySelectorAll(ET))),t.length===0)return;let c=wT(i(t),s);(a(c)||!n?.isConnected)&&l();for(let d of t)c.has(d)!==d.hasAttribute(Ct)&&d.toggleAttribute(Ct)}}var Dr=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),lG=Object.freeze([Dr.start,Dr.duration,Dr.trackIndex]),uG=Object.freeze([Dr.derivedEnd]),cG=Object.freeze([Dr.derivedEnd,Dr.legacyTrack]);function _n(e){if(e==null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}var Tg=/^[A-Za-z0-9_.:-]+$/;function Rg(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function Cg(e,t){let n=t;for(;n>=0&&Rg(e,n);)n--;return n}function CT(e,t){let n=t;for(;n>=0&&(e[n]??"").trim()==="";)n--;return n}function TT(e){let t=e.length-1;if(!Rg(e,t))return null;let n=Cg(e,t);return e[n]==="."&&(n=Cg(e,n-1)),n+1}function RT(e){let t=TT(e);if(t==null)return null;let n=CT(e,t-1),r=e[n];if(r!=="+"&&r!=="-")return null;let o=e.slice(0,n).trim();if(!Tg.test(o))return null;let i=Number(e.slice(t));return Number.isFinite(i)?{refId:o,operator:r,magnitude:i}:null}function ts(e){let t=(e??"").trim();if(!t)return null;let n=_n(t);if(n!=null)return{kind:"absolute",value:n};if(Tg.test(t))return{kind:"reference",refId:t,offset:0};let r=RT(t);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}var Mg=e=>{let t=_n(e);return t!==null&&t>=0?t:null};function ns(e){return Mg(e("data-playback-start"))??Mg(e("data-media-start"))??0}var jo=.1,Ko=10;function hc(e){return Number.isFinite(e)&&e>0?Math.max(jo,Math.min(Ko,e)):1}function kg(e,t=1){let n=Number.parseFloat(e("data-playback-rate")??"");return hc(Number.isFinite(n)&&n>0?n:t)}function gc(e){let t=_n(e("data-duration"));return t!==null&&t>0?t:null}function Lg(e,t){let n=gc(e);if(n!==null)return n;let r=_n(e("data-end"));return r!==null?r-t:null}var MT=3;function bc(e,t,n){return Number.isFinite(e)?Math.max(0,e-t)/hc(n):null}function yc(e){let{tag:t,authoredDurationSeconds:n,sourceDurationSeconds:r,mediaStartSeconds:o,playbackRate:i}=e;if(n!==null&&n>0)return{seconds:n,source:"authored"};if(t==="img")return{seconds:MT,source:"default"};if(r===null)return{seconds:null,source:"pending",reason:"source duration not yet probed"};let a=bc(r,o,i);return a===null?{seconds:null,source:"pending",reason:"source reported a non-finite duration"}:{seconds:a,source:"media"}}var Tn="data-fx-chain",hG=Tn.slice(5),Ng=1,Yo=(e="frequency",t="Frequency",n=1e3,r=20,o=2e4)=>({kind:"number",key:e,label:t,unit:"Hz",min:r,max:o,step:1,default:n,scale:"log",automatable:!0}),xc=(e=.707,t="Bandwidth: higher is narrower.")=>({kind:"number",key:"q",label:"Q",unit:"",min:.1,max:20,step:.01,default:e,scale:"log",automatable:!0,hint:t}),rs=(e=-40,t=40,n=0)=>({kind:"number",key:"gain",label:"Gain",unit:"dB",min:e,max:t,step:.1,default:n,automatable:!0}),Fg={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."},Ig=[{id:"gain",label:"Gain",group:"dynamics",description:"Raise or lower the whole signal. Automate it to duck under something else.",params:[rs(-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:[Yo("frequency","Frequency",1e3),rs(-40,40,0),xc(1)],web:"biquad-peaking"},{id:"lowshelf",label:"Low Shelf",group:"filter",description:"Lift or drop everything below the corner frequency.",params:[Yo("frequency","Frequency",200,20,2e3),rs(-40,40,0)],web:"biquad-lowshelf"},{id:"highshelf",label:"High Shelf",group:"filter",description:"Lift or drop everything above the corner frequency.",params:[Yo("frequency","Frequency",4e3,500,2e4),rs(-40,40,0)],web:"biquad-highshelf"},{id:"highpass",label:"High-pass",group:"filter",description:"Remove low frequencies: the usual fix for rumble on a voice.",params:[Yo("frequency","Cutoff",300,20,2e4),xc(.707),Fg],web:"biquad-highpass"},{id:"lowpass",label:"Low-pass",group:"filter",description:"Remove high frequencies, which darkens or muffles a track.",params:[Yo("frequency","Cutoff",8e3,100,2e4),xc(.707),Fg],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:"Peak limiter that follows the signal's level. It has no lookahead, so a fast peak or an inter-sample peak can pass the ceiling; use the true-peak limiter for a delivery 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:"truepeak",label:"True-peak limiter",group:"dynamics",description:"Lookahead limiter that holds a 4x estimate of the inter-sample peak at a dBTP ceiling; full-band noise can land up to about 1.7 dB above it. Adds lookahead plus about 0.3 ms of latency.",params:[{kind:"number",key:"ceiling",label:"Ceiling",unit:"dBTP",min:-24,max:0,step:.1,default:-1,hint:"Target true peak, measured on a 4x oversampled signal. Dense full-band sound can end up to about 1.7 dB above it."},{kind:"number",key:"lookahead",label:"Lookahead",unit:"ms",min:.5,max:10,step:.1,default:3,hint:"How far ahead the gain starts falling. Longer is smoother and adds the same latency."},{kind:"number",key:"release",label:"Release",unit:"ms",min:10,max:2e3,step:1,default:80,scale:"log"}],web:"worklet-truepeak"},{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, 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"}],Sc=new Map(Ig.map(e=>[e.id,e]));function Xo(e){return Sc.get(e)}var gG=Ig.map(e=>e.id);function Jo(e,t){let n=Sc.get(e);if(!n)return{};let r={};for(let o of n.params){let i=t?.[o.key];if(o.kind==="enum"){let l=o.options.some(s=>s.value===i);r[o.key]=l?i:o.default;continue}let a=typeof i=="number"?i:typeof i=="string"&&i.trim()!==""?Number(i):Number.NaN;r[o.key]=Number.isFinite(a)?Math.min(o.max,Math.max(o.min,a)):o.default}return r}var Cn=class extends Error{constructor(t){super(t),this.name="AudioFxChainError"}};function Dg(e){let t;try{t=JSON.parse(e)}catch(o){throw new Cn(`Chain file is not valid JSON: ${o.message}`)}if(typeof t!="object"||t===null)throw new Cn("Chain file must be a JSON object.");let n=t;if(n.version!==Ng)throw new Cn(`Unsupported chain version: ${String(n.version)}`);if(!Array.isArray(n.nodes))throw new Cn("Chain file is missing a `nodes` array.");let r=n.nodes.map(kT);return{version:Ng,nodes:r}}function Qo(e){return e.nodes.filter(t=>t.enabled!==!1)}function kT(e,t){if(typeof e!="object"||e===null)throw new Cn(`Node ${t} is not an object.`);let n=e;if(typeof n.type!="string"||!Sc.has(n.type))throw new Cn(`Node ${t} has unknown effect type: ${String(n.type)}`);return NT({type:n.type,id:os(n.id),fromCarve:Pg(n.fromCarve),fromPreset:os(n.fromPreset),label:os(n.label),fromEq:os(n.fromEq),fromLeveller:Pg(n.fromLeveller),presetAmount:LT(n.presetAmount),enabled:n.enabled!==!1,params:Jo(n.type,n.params??void 0)})}function os(e){return typeof e=="string"&&e?e:void 0}function Pg(e){return e===!0?!0:void 0}function LT(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(1,Math.max(0,e))}function NT(e){for(let t of Object.keys(e))e[t]===void 0&&delete e[t];return e}function FT(e){return 10**(e/20)}var ur=FT(12);function Be(e){return Number.isFinite(e)?Math.max(0,Math.min(ur,e)):1}function as(e,t){return Be(e*t)}function Og(e,t){return t?1:Be(e)}function is(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function Hg(e,t){let n=typeof HTMLMediaElement>"u"?void 0:Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"volume"),r=n?.get,o=n?.set;if(!r||!o)return t();let i=Number(r.call(e));Object.defineProperty(e,"volume",{configurable:!0,get:()=>i,set:a=>{i=Number(a),o.call(e,is(i))}});try{return t()}finally{delete e.volume,o.call(e,is(i))}}var Zt="data-automation",wG=Zt.slice(5),ls=1,PT=512,Qt=class extends Error{constructor(t){super(t),this.name="AudioAutomationError"}},Or="volume",us="rate";function ei(e){if(e===Or)return{kind:"volume"};if(e===us)return{kind:"rate"};let t=e.split(".");if(t.length===3&&t[0]==="fx"&&t[1]===IT){let o=t[2];return o?{kind:"preset",presetId:o}: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 IT="preset";var DT={min:0,max:1,step:.01,unit:"",label:"Amount",scale:"linear",default:1},cs={min:0,max:ur,step:.01,unit:"",label:"Volume",scale:"linear",default:1};function OT(e){return Math.min(4096,Math.max(2,Math.ceil(e*30)))}function Ec(e){return!!e.curve||e.viaX!==void 0&&e.viaY!==void 0}function ss(e,t,n=!1){let r=Be(t),o=as(r,e);return n&&r>0?o/r:o}function Gg(e,t,n=!1){let r=[],o=e.points,i=Be(t);for(let a=0;a<o.length;a+=1){let l=o[a],s=o[a+1];if(!(s!==void 0&&(i*l.v-ur)*(i*s.v-ur)<0)){r.push({...l,v:ss(l.v,t,n)});continue}if(r.push({t:l.t,v:ss(l.v,t,n)}),Ec(l)){let d=OT(s.t-l.t);for(let f=1;f<d;f+=1){let m=l.t+(s.t-l.t)*f/d;r.push({t:m,v:ss(Ot(e,m),t,n)})}}else{let d=l.t+(ur/i-l.v)/(s.v-l.v)*(s.t-l.t);r.push({t:d,v:ss(ur/i,i,n)})}}return r}var Bg={min:jo,max:Ko,step:.05,unit:"x",label:"Speed",scale:"log",default:1};function vc(e,t){let n=ei(e);if(!n)return null;if(n.kind==="volume")return cs;if(n.kind==="rate")return Bg;if(n.kind==="preset")return t?.nodes.some(l=>l.fromPreset===n.presetId)?{...DT,label:`${n.presetId} \xB7 Amount`}:null;let r=t?.nodes.find(a=>a.id===n.nodeId);if(!r)return null;let o=Xo(r.type),i=o?.params.find(a=>a.key===n.param);return!i||i.kind!=="number"?null:{min:i.min,max:i.max,step:i.step,unit:i.unit,label:`${o?.label??r.type} \xB7 ${i.label}`,scale:i.scale==="log"&&i.min>0?"log":"linear",default:i.default}}function Zo(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 HT(e){let t=Zo(e);return t===null||t===0?0:Math.min(1,Math.max(-1,t))}function Ug(e,t){let n=Zo(e),r=Zo(t);if(n===null||r===null)return null;let o=l=>Math.min(.999,Math.max(.001,l)),i=o(n),a=o(r);return Math.abs(i-a)<1e-6?null:{x:i,y:a}}function GT(e){let t=HT(e?.curve),n=Ug(e?.viaX,e?.viaY);return{...t?{curve:t}:{},...n?{viaX:n.x,viaY:n.y}:{}}}function BT(e,t){let n=Zo(e?.t),r=Zo(e?.v);if(n===null||r===null)return null;let o=t?Math.min(t.max,Math.max(t.min,r)):r;return{t:Math.max(0,n),v:o,...GT(e)}}function Wg(e,t){let n=e.map(o=>BT(o,t)).filter(o=>o!==null).sort((o,i)=>o.t-i.t),r=[];for(let o of n)r.length>0&&r[r.length-1].t===o.t?r[r.length-1]=o:r.push(o);return r.slice(0,PT)}function UT(e){let t=[];for(let n of e.lanes){if(!ei(n.target))continue;let r=n.target===Or?cs:n.target===us?Bg:null,o=Wg(n.points??[],r);o.length>0&&t.push({target:n.target,points:o})}return{version:ls,lanes:t}}function Vg(e,t){let n=[];for(let r of e.lanes){let o=vc(r.target,t);if(!o)continue;let i=Wg(r.points,o);i.length>0&&n.push({target:r.target,points:i})}return{version:ls,lanes:n}}function ds(e){let t;try{t=JSON.parse(e)}catch(o){throw new Qt(`Automation is not valid JSON: ${o.message}`)}if(typeof t!="object"||t===null)throw new Qt("Automation must be a JSON object.");let n=t;if(n.version!==ls)throw new Qt(`Unsupported automation version: ${String(n.version)}`);if(!Array.isArray(n.lanes))throw new Qt("Automation is missing a `lanes` array.");let r=n.lanes.map((o,i)=>{if(typeof o!="object"||o===null)throw new Qt(`Lane ${i} is not an object.`);let a=o;if(typeof a.target!="string"||!ei(a.target))throw new Qt(`Lane ${i} has an unreadable target: ${String(a.target)}`);if(!Array.isArray(a.points))throw new Qt(`Lane ${i} is missing a \`points\` array.`);return{target:a.target,points:a.points}});return UT({version:ls,lanes:r})}function WT(e,t){return t?Math.pow(e,Math.pow(2,2*t)):e}function VT(e,t){let n=e-.5,r=t-.5,o=.999,i=1e6,a=n>0?n/(o-e):n<0?-n/(e-(1-o)):0,l=r>0?r/(o-t):r<0?-r/(t-(1-o)):0,s=Math.min(i,Math.max(1,a,l));return{cx:e+n/s,cy:t+r/s,w:s}}function $T(e,t,n){let{cx:r,cy:o,w:i}=VT(t,n),a=2-2*i,l=e*a-1+2*i*r,s=-e*a-2*i*r,c=qT(l,s,e),d=1-c,f=d*d+2*i*c*d+c*c;return f>0?(2*i*o*c*d+c*c)/f:e}function qT(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)),o=(-t+r)/(2*e),i=(-t-r)/(2*e),a=l=>l>=-1e-9&&l<=1+1e-9;return a(o)?Math.min(1,Math.max(0,o)):a(i)?Math.min(1,Math.max(0,i)):n}function zT(e,t){let n=Ug(t.viaX,t.viaY);return n?$T(Math.min(1,Math.max(0,e)),n.x,n.y):WT(e,t.curve)}function jT(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 Ot(e,t,n="linear"){let r=e.points;if(r.length===0)return 0;let o=r[0];if(t<=o.t)return o.v;let i=r[r.length-1];if(t>=i.t)return i.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],c=r[l],d=c.t-s.t;return d<=0?c.v:jT(s.v,c.v,zT((t-s.t)/d,s),n)}function $g(e){return e.points.length<=1||e.points.every(t=>t.v===e.points[0].v)}function qg(e,t,n,r,o="linear"){let i=Math.max(2,Math.floor(r)),a=new Float32Array(i),l=n-t;for(let s=0;s<i;s+=1)a[s]=Ot(e,t+l*s/(i-1),o);return a}var fs=new Map,KT=64;function Ac(e,t=Or){let n=`${t}\0${e}`,r=fs.get(n);if(r!==void 0)return r;let o=null;try{o=ds(e).lanes.find(i=>i.target===t)??null}catch{o=null}return fs.size>KT&&fs.clear(),fs.set(n,o),o}function zg(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(Zt):null)??"";if(!n)return null;let r=Ac(n);return!r||r.points.length===0?null:Ot(r,t)}var jg=48,Kg=new WeakMap;function YT(e){let t=e.points,n=t[0].v,r=t[t.length-1].v,o=[0],i=[0],a=s=>{let c=o[o.length-1];if(s<=c)return;let d=Ot(e,c,"log");o.push(s),i.push(i[i.length-1]+(d+Ot(e,s,"log"))/2*(s-c))},l=Math.max(0,t[0].t);a(l);for(let s=1;s<t.length;s+=1){let c=t[s-1].t,d=t[s].t;if(!(d<=0))for(let f=1;f<=jg;f+=1)a(Math.max(c,0)+(d-c)*f/jg)}return{ts:Float64Array.from(o),ss:Float64Array.from(i),firstRate:n,lastRate:r}}function Yg(e){let t=Kg.get(e);return t||(t=YT(e),Kg.set(e,t)),t}function wc(e){return typeof e!="number"&&e.points.length>0}function _c(e,t){return typeof e=="number"?e:wc(e)?Ot(e,t,"log"):1}function Xg(e,t,n){let r=0,o=e.length-1;for(;o-r>1;){let i=r+o>>1;e[i]<=n?r=i:o=i}return t[r]+(t[o]-t[r])*(n-e[r])/(e[o]-e[r])}function Hr(e,t){if(typeof e=="number")return t*e;if(!wc(e))return t;let{ts:n,ss:r,firstRate:o,lastRate:i}=Yg(e),a=n.length-1;return t<=0?t*o:t>=n[a]?r[a]+(t-n[a])*i:Xg(n,r,t)}function cr(e,t){if(typeof e=="number")return t/e;if(!wc(e))return t;let{ts:n,ss:r,firstRate:o,lastRate:i}=Yg(e),a=n.length-1;return t<=0?t/o:t>=r[a]?n[a]+(t-r[a])/i:Xg(r,n,t)}function XT(e){return e?Ac(e,us):null}function Jg(e,t){return XT(e)??t}var LG=[{id:"montage",label:"Montage",points:[[0,.9],[.15,.3],[.5,2.5],[.85,.3],[1,.9]]},{id:"hero",label:"Hero",points:[[0,1],[.25,1.6],[.5,.25],[.75,1.6],[1,1]]},{id:"bullet",label:"Bullet",points:[[0,3],[.4,3],[.5,.15],[.6,3],[1,3]]},{id:"jump-cut",label:"Jump cut",points:[[0,.5],[.24,.5],[.26,3],[.5,3],[.52,.5],[.74,.5],[.76,3],[1,3]]},{id:"flash-in",label:"Flash in",points:[[0,.3],[.6,.6],[1,5]]},{id:"flash-out",label:"Flash out",points:[[0,5],[.4,.6],[1,.3]]},{id:"ramp-in",label:"Ramp in",points:[[0,.5],[1,1]]},{id:"ramp-out",label:"Ramp out",points:[[0,1],[1,.5]]},{id:"slowmo-middle",label:"Slow-mo middle",points:[[0,1],[1/3,.35],[2/3,.35],[1,1]]}];function Ge(e){return _n(e)}function mt(e){return kg(t=>e.getAttribute(t),_e(e)?e.defaultPlaybackRate:1)}function Ht(e){return Jg(e.getAttribute("data-automation"),mt(e))}function Rn(e){return ns(t=>e.getAttribute(t))}function Gt(e,t){return JT(t,Rn(e),Ht(e))}function Gr(e){let t=yc({tag:"video",authoredDurationSeconds:gc(n=>e.getAttribute(n)),sourceDurationSeconds:Number.isFinite(e.duration)?e.duration:null,mediaStartSeconds:Rn(e),playbackRate:mt(e)});return t.source==="media"?Gt(e,e.duration):t.seconds}function Br(e,t=0){return!Je(e)||!e.hasAttribute("data-start")&&!e.hasAttribute("data-track-index")?null:yc({tag:"img",authoredDurationSeconds:Lg(n=>e.getAttribute(n),t),sourceDurationSeconds:null,mediaStartSeconds:0,playbackRate:1}).seconds}function JT(e,t,n){return typeof n=="number"?bc(e,t,n):Number.isFinite(e)?cr(n,Math.max(0,e-t)):null}var QT=e=>e.paused?.()===!0?(e.startTime?.()??0)+(e.totalDuration?.()??0)/Math.abs(e.timeScale?.()||1):0;function en(e){try{if(typeof e?.duration!="function")return null;let t=e.getChildren?.(!1,!1,!0),n=Array.isArray(t)?t:[],r=Math.max(Number(e.duration()),...n.map(QT));return Number.isFinite(r)?r:null}catch(t){return V("runtime.timelineDuration",t),null}}function dr(e){if(e==null||e.trim()==="")return null;let t=Number.parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function Ur(e){if(e==null||e.trim()==="")return null;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:null}function xt(e=document){let t=e.querySelector('[data-composition-id][data-root="true"]');return we(t)?t:e.querySelector("[data-composition-id]")}var ZT=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function Cc(e){return e.id||e.getAttribute("data-hf-id")||null}function eR(e){return Ge(e)}function tR(e,t){let n=e.getAttribute("data-composition-id");if(!n)return null;let r=en(t[n]);return r!=null&&r>0?r:null}function nR(e){return _e(e)?Number.isFinite(e.duration)?Gt(e,e.duration):null:Br(e)}function rR(e,t,n,r){let o=eR(e.getAttribute("data-duration"));return o!=null&&o>0?o:tR(e,t)??nR(e)??Math.max(0,n-r)}function oR(e){for(let[t,n]of e){let r=t.parentElement;for(;r;){let o=e.get(r);if(o){n.parentId=o.id,o.children.push(n);break}r=r.parentElement}}}function Qg(e){let{startResolver:t,timelineRegistry:n,rootDuration:r}=e,o=new Map,i=xt(),a=0;for(let l of document.querySelectorAll("[data-start]")){if(l===i||ZT.has(l.tagName))continue;let s=t.resolveStartForElement(l,0);if(rR(l,n,r,s)<=0)continue;let c={id:Cc(l)??`__clip-${a++}`,element:l,parentId:null,children:[]};o.set(l,c)}return oR(o),{roots:Array.from(o.values()).filter(l=>l.parentId===null)}}var Wr="data-hf-authored-duration",Vr="data-hf-authored-end";function ti(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 $r(e){let t=ti(e.start);if(t==null)return null;let n=Math.max(0,t),r=ti(e.duration),o=ti(e.authoredDuration),i=r!=null&&r>0?r:o!=null&&o>0?o:null;if(i!=null)return{start:n,duration:i,end:n+i};let a=ti(e.end),l=ti(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 ni=e=>4*Number.EPSILON*Math.max(1,Math.abs(e));function qr(e,t){return!Number.isFinite(e)||!Number.isFinite(t)?e===t:Math.abs(e-t)<=ni(Math.max(Math.abs(e),Math.abs(t)))}var Zg=(e,t)=>e>=t||qr(e,t),Mn=(e,t,n)=>Zg(e,t)&&e<n&&!qr(e,n),iR=1e-6,zr=(e,t,n,r)=>Mn(e,t,n)||Zg(e,t)&&r>0&&n>=r-iR;var ms="data-hf-media-start-basis";function e0(e){return e?.trim().toLowerCase()==="global"?"global":"local"}function aR(e){return e0(e.basis)==="global"?e.authoredStart:e.hostStart+e.authoredStart}function t0(e){return r0(e)?aR({authoredStart:e.authoredStart,hostStart:e.hostStart,basis:e.basis}):e.ordinaryStart()}function n0(e){return r0(e)&&e0(e.basis)==="global"}function r0(e){return!e.hasAutoStart&&e.authoredStart!=null&&e.hostStart!==0}function Tc(e){return ns(t=>e.getAttribute(t))}function o0(e,t){return e-Tc(t)}function fr(e,t){return t.reduce((n,r)=>{let o=Math.max(n.start,r.start);return{start:o,end:Math.max(o,Math.min(n.end,r.end))}},e)}function st(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,o=new WeakMap,i=new WeakMap,a=new Set,l=T=>(T.hasAttribute("data-composition-id")?T.parentElement:T)?.closest("[data-composition-id]")??null,s=(T,H)=>{let I=l(H);if(I){for(let W of I.querySelectorAll(`[id="${T}"]`))if(l(W)===I)return W}let Y=r.getElementById(T);return Y||(Array.from(r.querySelectorAll("[data-composition-id]")).find(W=>W.getAttribute("data-composition-id")===T)??null)},c=(T,H)=>n?T.getAttribute(H):null,d=T=>$r({start:0,duration:T.getAttribute("data-duration"),authoredDuration:c(T,"data-hf-authored-duration")})?.duration??$r({start:_(T,0),end:T.getAttribute("data-end"),authoredEnd:c(T,"data-hf-authored-end")})?.duration??null,f=T=>T!=null&&Number.isFinite(T)&&T>0?T:null,m=T=>{let H=T.getAttribute("data-composition-id");return H?f(en(t[H])):null},p=T=>{let H=i.get(T);if(H!==void 0)return H;let I=d(T)??f(_e(T)?Gt(T,T.duration):null)??f(Br(T))??m(T);return i.set(T,I),I},b=T=>T.hasAttribute("data-composition-src")||T.hasAttribute("data-composition-id")||T.hasAttribute("data-composition-file"),y=T=>{let H=T.parentElement;return!H||!T.hasAttribute("data-composition-id")||ts(T.getAttribute("data-start"))?null:b(H)?H:null},x=(T,H)=>o0(_(T,H),y(T)??T),E=(T,H)=>{let I=T.hasAttribute("data-composition-id")?T.parentElement?.closest("[data-composition-id]"):T.closest("[data-composition-id]");return I?x(I,H):0},v=(T,H)=>{let I=ts(T.getAttribute("data-start"));if(!I){let F=y(T);return F?_(F,H):H}if(I.kind==="absolute")return E(T,H)+Math.max(0,I.value);let Y=s(I.refId,T);if(!Y)return H;let W=_(Y,0),X=p(Y)??0,ie=Math.min(0,E(T,0));return Math.max(ie,W+X+I.offset)},_=(T,H)=>{let I=o.get(T);if(I!==void 0)return I??H;if(a.has(T))return H;a.add(T);try{let Y=v(T,H);return o.set(T,Y),Y}finally{a.delete(T)}},U=T=>{let H=T.closest("[data-composition-id]");return{authoredStart:Ge(T.getAttribute("data-start")),hostStart:H?x(H,0):0,hasAutoStart:T.hasAttribute("data-hf-auto-start"),basis:T.getAttribute(ms)}};return{resolveStartForElement:(T,H=0)=>_(T,Math.max(0,H)),resolveDurationForElement:T=>p(T),resolveMediaStartForElement:T=>{let H=U(T);return t0({...H,ordinaryStart:()=>_(T,H.hostStart)})},resolveHostStartForElement:T=>E(T,0),resolveHostSlotsForElement:T=>{let H=[];for(let I=T.parentElement;I;I=I.parentElement){if(!b(I)||y(I)||Tc(I)<=0)continue;let Y=_(I,0),W=d(I);H.push({start:Y,end:W?Y+W:1/0})}return H},isRootGlobalMediaStartForElement:T=>_e(T)&&n0(U(T))}}function sR(e,t,n){let r=e.filter(i=>Number.isFinite(i.time)&&Number.isFinite(i.volume)).map(i=>({time:Math.max(0,i.time-t),volume:Be(i.volume)})).sort((i,a)=>i.time-a.time),o=[];for(let i of r){let a=o.at(-1);a&&Math.abs(a.time-i.time)<1e-9?a.volume=i.volume:o.push(i)}return o.length===0||o[0].time>0&&o.unshift({time:0,volume:Be(n)}),o}function i0(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],o=e[n+1]??r,i=o.time-r.time,a=i<=0?0:Math.min(1,Math.max(0,(t-r.time)/i));return r.volume+(o.volume-r.volume)*a}function lR(e,t,n,r){let o=e.at(-1);!o||Math.abs(o.volume-n.volume)>1e-4?(o&&t&&t.time>o.time&&e.push(t),e.push(n)):r&&n.time>o.time&&e.push(n)}function uR(e){let t=Number.parseFloat(e??"");return Number.isFinite(t)?t:void 0}function cR(e,t){let n=st({timelineRegistry:window.__timelines,includeAuthoredTimingAttrs:!0}).resolveMediaStartForElement(e),r=Ge(e.dataset.end)??void 0,o=Ge(e.dataset.duration)??void 0,i=t;o!==void 0&&o>0?i=n+o:r!==void 0&&r>n&&(i=r);let a=uR(e.dataset.volume)??1;return{start:n,end:i,staticVolume:Be(a)}}function dR(e,t,n,r,{start:o,end:i,staticVolume:a}){let l=1/Math.min(60,Math.max(1,r)),s=Math.max(0,o),c=Math.min(n,i),d=Hg(e,()=>{e.volume=a;let m=[],p;for(let b=s;b<=c+1e-6;b=Math.min(c,b+l)){t(b);let y=Number(e.volume);if(Number.isFinite(y)){let x={time:Number(b.toFixed(6)),volume:Number(Be(y).toFixed(6))};lR(m,p,x,b===c),p=x}if(b===c)break}return m});return d.some(m=>Math.abs(m.volume-a)>1e-4)?d:null}function ps(e,t,n=0){return n>3||e===null||typeof e!="object"?!1:Array.isArray(e)?e.some(r=>ps(r,t,n+1)):Object.getPrototypeOf(e)!==Object.prototype?!1:Object.entries(e).some(([r,o])=>t(r)||ps(o,t,n+1))}var fR=e=>typeof e?.nodeType=="number";function mR(e,t){for(let n=Object(e);n;n=Object.getPrototypeOf(n)){let r=Object.getOwnPropertyDescriptor(n,t);if(r)return typeof r.set=="function"}return!1}function Rc(e){let t={elements:new Set,anySetter:!1,unknown:!0};if(typeof e.getChildren!="function")return t;try{let n={elements:new Set,anySetter:!1,unknown:!1};for(let r of e.getChildren(!0,!0,!1)){let o=r.targets?.()??[];for(let i of o)fR(i)?ps(r.vars,a=>a==="volume")&&n.elements.add(i):!n.anySetter&&ps(r.vars,a=>mR(i,a))&&(n.anySetter=!0)}return n}catch{return t}}var pR=(e,t)=>e.unknown||e.anySetter||e.elements.has(t);function a0(e,t,n,r,o={}){if(o.allowLiveTimelineSeek===!1||!t||!_e(e)||n<=0||!pR(o.movers?.()??Rc(t),e))return;let i=c=>{try{typeof t.totalTime=="function"?t.totalTime(c,!0):typeof t.seek=="function"&&t.seek(c,!0)}catch{}},a=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,l=cR(e,n),s=dR(e,i,n,60,l);if(Number.isFinite(a)&&i(a),s){let c=sR(s,l.start,l.staticVolume);c.length>0&&r.set(e,c)}}var u0="data-fade-in",c0="data-fade-out",SB=u0.slice(5),EB=c0.slice(5),d0=Object.freeze({fadeIn:0,fadeOut:0});function Mc(e){return Number.isFinite(e)&&e>0?e:0}function s0(e){return e==null||e===""?0:Mc(Number.parseFloat(e))}function hs(e){return{fadeIn:s0(e.getAttribute(u0)),fadeOut:s0(e.getAttribute(c0))}}function kc(e,t){let n=Mc(e.fadeIn),r=Mc(e.fadeOut);if(!Number.isFinite(t)||t<=0)return{fadeIn:n,fadeOut:r};let o=n+r;if(o<=t)return{fadeIn:n,fadeOut:r};let i=t/o;return{fadeIn:n*i,fadeOut:r*i}}function gs(e,t,n){if(!Number.isFinite(e))return 1;let{fadeIn:r,fadeOut:o}=kc(n,t),i=1;return r>0&&(i*=l0(e/r)),o>0&&Number.isFinite(t)&&(i*=l0((t-e)/o)),i}function l0(e){return!Number.isFinite(e)||e<0?0:e>1?1:e}var f0=':not([muted]):is(:not([data-has-audio]),[data-has-audio="true"])',AB=`audio[data-start], video[data-start]${f0}`;function bs(e){if(e.tagName.toLowerCase()!=="video"||e.hasAttribute("muted"))return!1;let t=e.getAttribute("data-has-audio");return t===null||t==="true"}function m0(e){return(e.volume??1)>1||!!(e.fxChain||e.automation||e.audioGroup||e.masterChain)}var ri="data-hf-render-id",p0="data-hf-group-render-id";var tn="hf-audio-group",ys="data-audio-group";function oi(e){let t=e?.getAttribute("data-volume"),n=t?parseFloat(t):1;return Number.isFinite(n)?n:1}function Lc(e,t){let n=Array.from(e?.querySelectorAll?.(`${tn}[${ri}]`)??[]).find(o=>o.getAttribute(ri)===t);if(n)return n;let r=e?.getElementById(t)??null;return r&&r.tagName?.toLowerCase()===tn?r:null}function xs(e,t){let n=t?.getAttribute?.(p0)??t?.getAttribute?.(ys);return n?Lc(e,n)?.hasAttribute("data-hidden")??!1:!1}function Nc(e){let t=e.querySelector("[data-composition-id]");return t&&!t.parentElement?.closest("[data-composition-id]")?t:null}function h0(e){return Nc(e)?.getAttribute(Tn)||void 0}function Ss(e){return typeof e.tagName!="string"||typeof e.getAttribute!="function"||!hR(e)?null:e.getAttribute(ys)||null}function hR(e){return e.tagName.toLowerCase()==="audio"?!0:typeof e.hasAttribute=="function"&&bs(e)}function g0(e){let t="__hf-audio-group-inert";if(!e?.head||e.getElementById(t))return;let n=e.createElement("style");n.id=t,n.textContent=`${tn}{display:contents!important}${tn}[data-hidden]{display:none!important}`,e.head.appendChild(n)}function Fc(e){return e.getAttribute(ri)||e.id||null}var gR="__render_frame_",bR="__";function yR(e){return`${gR}${e}${bR}`}function xR(e){let t=Fc(e);return t?yR(t):null}function Tt(e){let t=xR(e),n=t?document.getElementById(t):null;if(!n)return null;let r=e.nextElementSibling;for(;r&&r.id!==t;)r=r.nextElementSibling;return r??(r=n),Je(r)?r:null}function Es(e){let t=window.__HF_RENDER_FRAME_VIDEO_IDS;return e.tagName==="VIDEO"&&t?.includes(Fc(e)??"")===!0}function vs(e){if(Es(e))return;e.preload!=="auto"&&(e.preload="auto");let t=e.tagName==="VIDEO"&&e.networkState===2;e.readyState<3&&!t&&e.load()}var Pc=new WeakMap;function b0(e){Pc.get(e)?.()}function y0(e,t){if(b0(e),e.tagName!=="VIDEO"||Es(e))return;let n=()=>{if(!e.isConnected||!e.paused||e.seeking||!t())return;let i=Rn(e);if(!(Math.abs(e.currentTime-i)<=.02))try{e.currentTime=i}catch(a){V("runtime.preload.playbackStart",a)}};if(e.readyState>0){n();return}let r=()=>{e.removeEventListener("loadedmetadata",o),e.removeEventListener("error",r),e.removeEventListener("abort",r),Pc.delete(e)},o=()=>{r(),n()};Pc.set(e,r),e.addEventListener("loadedmetadata",o),e.addEventListener("error",r),e.addEventListener("abort",r)}function Ic(e){b0(e);for(let t of e.querySelectorAll("source"))t.remove();e.removeAttribute("src"),e.load()}function x0(e){if(e.querySelector("source"))return;let t=e.getAttribute("src");Ic(e),t!==null&&e.setAttribute("src",t)}function As(e){return Ge(e.getAttribute("data-duration"))!=null}function S0(){let e=window;if(e.__hfMediaDeferral?.disconnect(),e.__hfMediaDeferral=void 0,!Qa())return;let t=(n,r)=>{Ge(n.getAttribute("data-start"))!=null&&As(n)&&r(n)>0&&(n.preload="none")};e.__hfMediaDeferral=new MutationObserver(n=>{let r=st({}).resolveMediaStartForElement;for(let o of n)for(let i of o.addedNodes){if(i.nodeType!==1)continue;let a=i;a.matches("video, audio")&&t(a,r);for(let l of a.querySelectorAll("video, audio"))t(l,r)}}),e.__hfMediaDeferral.observe(document.documentElement,{childList:!0,subtree:!0})}var Dc=-1,Kr=new Set,E0=new WeakSet,jr,Oc=0;function v0(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){V("runtime.adapters.seek-dispatch.site1",o)}finally{n=!1}t.length!==0&&Qe(Promise.all(t))}function Qe(e,t){let n=e.then(()=>({status:"fulfilled"})).catch(r=>({status:"rejected",reason:r}));Kr.add(n),t==="video-frame"&&E0.add(n),n.then(r=>{Kr.delete(n)&&r.status==="rejected"&&jr===void 0&&(jr={reason:r.reason})})}function ws(e){e!==Dc&&(Dc=e,v0(e))}function _s(e){Dc=e,v0(e)}function A0(){return Oc>0}async function w0(){for(let e=[...Kr];e.length>0;e=[...Kr])await Promise.all(e)}function _0(){return Kr.size>0}async function C0(e){let t=()=>[...Kr].filter(r=>e?.videoFrames!==!1||!E0.has(r));Oc+=1;let n=jr;try{await Promise.resolve();for(let o=t();o.length>0;o=t()){let a=(await Promise.all(o)).find(l=>l.status==="rejected");n===void 0&&a?.status==="rejected"&&(n={reason:a.reason})}let r=jr;if(n===void 0&&(n=r),jr===r&&(jr=void 0),n)throw n.reason}finally{Oc-=1}}function nn(e){return Rn(e)}var T0=["seeked","loadeddata","error","emptied","abort"],Vc=5e3,Cs=new WeakMap;function R0(e){let t=e.readyState<e.HAVE_CURRENT_DATA&&e.networkState===e.NETWORK_LOADING&&!window.__HF_EXPORT_RENDER_SEEK_CONFIG;e.tagName!=="VIDEO"||!(e.seeking||t)||Tt(e)||(Cs.get(e)?.(),Qe(new Promise(n=>{let r=i=>{if(!(i?.type==="loadeddata"&&e.seeking)){clearTimeout(o);for(let a of T0)e.removeEventListener(a,r,!0);Cs.get(e)===r&&Cs.delete(e),n()}},o=setTimeout(r,Vc);for(let i of T0)e.addEventListener(i,r,!0);Cs.set(e,r)}),"video-frame"))}function k0(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 L0(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=[],o=[],i=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=nn(a),c=mt(a),d=Ht(a),f=a.loop,m=Number.isFinite(a.duration)&&a.duration>0?a.duration:null,p=e?.resolveDurationSeconds?.(a)??Number.parseFloat(a.dataset.duration??"");(!Number.isFinite(p)||p<0)&&m!=null&&(p=Math.max(0,cr(d,m-s)));let y=Number.isFinite(p)&&p>=0?l+p:Number.POSITIVE_INFINITY,x=l,E=fr({start:l,end:y},e?.resolveHostSlots?.(a)??[]);(E.start!==l||E.end!==y)&&({start:l,end:y}=E,p=y-l);let v=Number.parseFloat(a.dataset.volume??""),_={el:a,start:l,origin:x,mediaStart:s,duration:Number.isFinite(y)?p:Number.POSITIVE_INFINITY,end:y,volume:Number.isFinite(v)?v:null,playbackRate:c,rate:d,loop:f,sourceDuration:m,fades:hs(a)};r.push(_),a.tagName==="VIDEO"&&o.push(_),Number.isFinite(y)&&(i=Math.max(i,y))}return{timedMediaEls:n,mediaClips:r,videoClips:o,maxMediaEnd:i}}var Bc=new WeakMap,Ts=new WeakMap,ii=new WeakMap,Uc=new WeakSet,Yr=new WeakSet,Hc=new WeakSet;function SR(e){if(Yr.has(e))return;Yr.add(e);let t=()=>Yr.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}var ER=3;function $c(e){return e.error!=null||e.networkState===ER}var Wc=new WeakMap;function Gc(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function Rs(e){Bc.delete(e),Ts.delete(e),ii.delete(e),Uc.delete(e),Wc.delete(e),ai.delete(e)}var qc=.5,zc=1.5;function Ms(e,t){let n=Math.max(0,Math.min(t,e.end)-(e.origin??e.start)),r=e.mediaStart+Hr(e.rate??e.playbackRate,n);if(e.sourceDuration==null)return r;let o=e.sourceDuration-e.mediaStart;return e.loop&&o>0&&r>=e.sourceDuration?e.mediaStart+(r-e.mediaStart)%o:!e.loop&&e.el.tagName==="VIDEO"?Math.min(r,e.sourceDuration):r}function vR(e,t,n,r){let{el:o}=e,i=e.start-t;if(!n||o.tagName!=="VIDEO"||i<=0||i>zc*r||!o.paused||o.seeking||o.readyState<o.HAVE_METADATA||Tt(o)||"__HF_EXPORT_RENDER_SEEK_CONFIG"in window&&window.__HF_EXPORT_RENDER_SEEK_CONFIG)return;let a=Ms(e,e.start);if(!(!Number.isFinite(a)||a<0||Math.abs(o.currentTime-a)<=.001))try{o.currentTime=a}catch(l){V("runtime.media.preseek",l)}}var kn=.04,M0=1/16,AR=.03,wR=[[.3,.25],[.1,.1]],_R=.01,ai=new WeakMap;function CR(e,t,n){let r=Math.sign(t),o=ai.get(e);if(Math.abs(t)>kn)ai.set(e,r);else if(o!==r||Math.abs(t)<=_R)return ai.delete(e),n;let i=Math.abs(t),a=wR.find(([l])=>i>l)?.[1]??AR;return n*(1+r*a)}function N0(e){let t=!!(e.outputMuted||e.userMuted);for(let n of e.clips){let{el:r}=n;if(!r.isConnected)continue;let o=n.rate??n.playbackRate,i=n.origin??n.start,a=r.tagName==="VIDEO"&&!n.loop,l=Mn(e.timeSeconds,n.start,n.end),s=n.start-e.timeSeconds,c=r.tagName==="AUDIO"&&!l&&s>0&&s*Math.max(1,_c(o,n.start-i))<=Math.max(e.cueAheadSeconds??0,Hc.has(r)?kn:0);c?Hc.add(r):Hc.delete(r);let d=a&&!l&&(e.timeSeconds>=n.end||qr(e.timeSeconds,n.end))&&zr(e.timeSeconds,n.start,n.end,e.getCompositionDuration()),f=Ms(n,e.timeSeconds),m=d||a&&n.sourceDuration!=null&&f>=n.sourceDuration&&l,p=Ts.get(r),b=r.tagName==="AUDIO"&&(p===void 0||f<p-.04),y=!n.loop&&n.sourceDuration!=null&&f>=n.mediaStart&&f<n.sourceDuration&&(a||b);if((l||d||c)&&f>=0&&(!r.ended||n.loop||m||y)){Ts.set(r,f);let v=Gc(e.userVolume??1),_=Be(n.volume??1),U=Wc.get(r),G=Gc(r.volume),R,D=zg(r,e.timeSeconds-i),T=e.isWebAudioRouted?.(r)===!0,H=D===null&&(n.volumeKeyframes?.length??0)>0,I=T?Og(_,H):1;if(D!==null)R=T?1:as(_,D);else if(n.volumeKeyframes&&n.volumeKeyframes.length>0){let ne=e.timeSeconds-i;R=Be(i0(n.volumeKeyframes,ne))}else T?R=1:U===void 0?R=_>1?_:G:Math.abs(G-U)>1e-4?R=G:R=_;let Y=R,W=n.fades??d0;(W.fadeIn>0||W.fadeOut>0)&&(R*=gs(e.timeSeconds-i,n.duration+n.start-i,W));let ie=r.closest("[data-hidden]")!==null||xs(r.ownerDocument,r)?0:Gc(R*v);Math.abs(r.volume-ie)>1e-6&&(r.volume=ie),Wc.set(r,ie),Y===R?e.onElementVolume?.(r,ie,R,I):e.onElementVolume?.(r,ie,R,I,Y),(t||e.isWebAudioOwned?.(r))&&!r.muted&&(r.muted=!0),r.preload!=="auto"&&!Es(r)&&(r.preload="auto");let F=_c(o,e.timeSeconds-i)*e.playbackRate,z=e.playing&&F>=M0,O=2,N=r.currentTime||0,L=Math.abs(N-f),w=f-N,k=Bc.get(r);Bc.set(r,w);let K=k===void 0,oe=!K&&Math.abs(w-k)>.5,ge=L>3,Ee=r.tagName==="AUDIO"&&K&&N-f>kn,$=m&&L>.001||r.ended&&y&&L>.001||Ee||L>qc&&(K||oe||ge),Q=r.tagName==="VIDEO"&&!r.paused&&z,me=e.playing&&!z||k!==void 0&&Math.abs(w-k)<.004,he=!1;if(!Q&&!$&&!K&&me&&L>kn){let ne=(ii.get(r)??0)+1;ii.set(r,ne),ne>=O&&(he=!0,ii.set(r,0))}else L<=kn&&ii.set(r,0);let le=!Q&&e.forceSync&&L>.02;try{(!Q||$)&&ai.delete(r);let ne=Math.max(M0,Q&&!$?CR(r,w,F):F);Math.abs(r.playbackRate-ne)>1e-6&&(r.playbackRate=ne)}catch(ne){V("runtime.media.site1",ne)}if($||he||le){if(!(r.tagName==="VIDEO"&&!!Tt(r))){try{r.currentTime=f}catch(te){V("runtime.media.site2",te)}if(Math.abs(r.currentTime-f)>.5&&!Uc.has(r)){Uc.add(r),r.load();try{r.currentTime=f}catch(te){V("runtime.media.site3",te)}}R0(r)}Yr.delete(r)}else z||R0(r);m?r.paused||r.pause():z&&r.paused&&!Yr.has(r)&&!$c(r)?(SR(r),r.play().catch(ne=>{Yr.delete(r),(ne&&typeof ne=="object"&&"name"in ne?String(ne.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!z&&!r.paused&&r.pause();continue}let E=Mn(e.timeSeconds,n.start,n.end);Rs(r),E&&Ts.set(r,f),r.paused||r.pause(),vR(n,e.timeSeconds,e.playing,e.playbackRate)}}var jc="css:root",F0=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],TR=new Set([...F0,"contain","isolation","mask-border","mix-blend-mode","opacity"]),RR=new Set(["absolute","relative"]),MR=new Set(["flex","inline-flex","grid","inline-grid"]),kR=new Set(["layout","paint","strict","content"]),LR=new Set(["size","inline-size"]);function NR(e){return e.position==="fixed"||e.position==="sticky"}function FR(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(RR.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&MR.has(n)}function PR(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:F0.some(r=>{let o=e.getPropertyValue(r);return o!==""&&o!=="none"})}function IR(e){return e.getPropertyValue("contain").split(/\s+/).some(n=>kR.has(n))?!0:LR.has(e.getPropertyValue("container-type"))}function DR(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>TR.has(t))}function OR(e,t){return e.hasAttribute(ir)||NR(t)||FR(e,t)||PR(t)||IR(t)?!0:DR(t)}function HR(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 ks(e,t){let n=t?.get(e.parentElement);if(n!==void 0)return n;let r=GR(e);return t?.set(e.parentElement,r),r}function GR(e){let t=e.ownerDocument.defaultView;if(!t)return jc;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(OR(n,t.getComputedStyle(n)))return HR(n)}catch{return jc}n=n.parentElement}return jc}var BR=["width","height","top","left","right","bottom","inset","object-fit","object-position","z-index","opacity","visibility","filter","mix-blend-mode","backdrop-filter","border-width","border-style","border-color","border-radius","overflow","clip-path","mask","mask-image","mask-size","mask-position","mask-repeat","transform","transform-origin","translate","rotate","scale","box-sizing"];function Kc(e){return Number.isFinite(e)&&e>0?e:30}function Yc(e){return Number.isFinite(e)&&e>0?e:0}function Xc(e,t){let n=Kc(t);return Math.floor(Yc(e)*n+1e-9)/n}function I0(e,t,n){let r=Number.isInteger(n)?n:1;if(r<=1)return Xc(e,t);let o=Kc(t)*r;return Math.round(Yc(e)*o)/o}function P0(e,t){let n=Kc(t),r=Yc(e),o=r*n,i=Math.round(o);return Math.abs(o-i)<=.001?i/n:r}function Ls(e,t,n){return{start:P0(e,n),end:Number.isFinite(t)?P0(t,n):t}}function D0(e,t,n=BR){for(let r of n){let o=t.getPropertyValue(r);o&&e.setProperty(r,o)}}function Jc(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}var si="hf-runtime-filler",UR=["seconds-time","rational-fps","seek-keep-playing","composition-manifest-v1","runtime-data","play-range"];function WR(e,t){let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let o=n%r;n=r,r=o}return n||1}function VR(e){let t=Number.isFinite(e)&&e>0?e:30,n=Number.isInteger(t)?1:1e6,r=Math.round(t*n),o=WR(r,n);return{numerator:r/o,denominator:n/o}}function O0(e,t,n){return Math.max(e,(Math.ceil(t*n-1e-6)-1)/n)}function Qc(e){if(typeof e!="object"||e===null)return null;let t=e;return!Number.isFinite(t.numerator)||!Number.isFinite(t.denominator)||(t.numerator??0)<=0||(t.denominator??0)<=0?null:Number(t.numerator)/Number(t.denominator)}function Ns(e){return{protocolVersion:1,capabilities:UR,fps:VR(e)}}function $R(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function H0(e,t=30){if(typeof e!="object"||e===null)return{status:"legacy",fps:t};let n=e;if(n.protocolVersion===void 0)return{status:"legacy",fps:t};if(n.protocolVersion!==1)return{status:"unsupported",code:"unsupported_protocol_version",receivedVersion:n.protocolVersion};let r=Qc(n.fps);return r===null||!$R(n.capabilities)?{status:"unsupported",code:"invalid_protocol_metadata",receivedVersion:n.protocolVersion}:{status:"supported",fps:r,metadata:n}}var G0=e=>e!==null&&Number.isFinite(e)&&e>0;function Xr(e){let t=e.clipEndsSeconds.filter(r=>r===null).length;if(G0(e.authoredDurationSeconds))return{seconds:e.authoredDurationSeconds,source:"authored",pendingClips:t};let n=e.clipEndsSeconds.filter(G0);return n.length>0?{seconds:Math.max(...n),source:"derived",pendingClips:t}:{seconds:null,source:"unresolved",pendingClips:t,reason:t>0?"every clip's length is still pending":"no authored duration and no clip with a length"}}function Zc(){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 Jr=7200,rn=1/60,li=e=>e!==null&&e>rn?e:null;function B0(e){return{width:Ur(e.getAttribute("data-width")),height:Ur(e.getAttribute("data-height"))}}function U0(e,t){let n=[];for(let r of e.querySelectorAll("video[data-start], audio[data-start]")){let o=t.mediaStart(r);if(!Number.isFinite(o))continue;let i=t.mediaDuration(r);i==null||i<=rn||n.push(Math.max(0,o)+i)}return li(Xr({authoredDurationSeconds:null,clipEndsSeconds:n}).seconds)}function W0(e,t){let n=[];for(let o of e.querySelectorAll("[data-composition-id][data-start]")){if(o.parentElement?.closest("[data-composition-id]")!==e)continue;let i=t.resolveStartForElement(o,0),a=t.resolveDurationForElement(o);!Number.isFinite(i)||a==null||a<=0||n.push(Math.max(0,i)+a)}let r=Ge(e.getAttribute("data-duration"));return li(Xr({authoredDurationSeconds:null,clipEndsSeconds:[r,...n]}).seconds)}var qR=e=>e.hasAttribute("data-composition-id")||e.hasAttribute("data-composition-src");function V0(e,t,{unregisteredLottie:n}){let r=[];for(let i of e.querySelectorAll("[data-start]")){let a=t.resolveStartForElement(i,0);if(!Number.isFinite(a))continue;let l=t.resolveDurationForElement(i);l!=null?r.push(Math.max(0,a)+l):(_e(i)||qR(i))&&r.push(null)}(n||e.querySelector("[data-lottie-src]"))&&r.push(null);let o=Xr({authoredDurationSeconds:null,clipEndsSeconds:r});return o.pendingClips>0?{...o,seconds:null,source:"unresolved",reason:"a clip's length is pending"}:o}function $0(e){if(e.declared!==null&&Number.isFinite(e.declared)&&e.declared>0)return e.declared;let t=li(e.timeline()),n=Math.max(0,...e.floors().map(s=>s??0)),r=Number.isFinite(e.fallback)&&e.fallback>rn?e.fallback:0,o=Math.max(n,r),a=t!==null&&t>=Jr&&li(o)!==null?null:t,l;return a!==null?l=Math.max(a,o):li(n)!==null?l=o:r>0?l=r:l=e.derived(),l>0?l:0}function Fs(e,t){let n=e.tagName.toLowerCase();if(n==="script"||n==="style"||n==="link"||n==="meta")return null;let o=n==="video"||n==="audio"?t.resolver.resolveMediaStartForElement(e):t.resolver.resolveStartForElement(e,0),i=t.resolver.resolveDurationForElement(e),a=e.getAttribute("data-composition-id");if(a){let s=t.timelineRegistry[a],c=en(s);!(e.hasAttribute("data-duration")||e.hasAttribute("data-end")||e.hasAttribute(Wr)||e.hasAttribute(Vr))&&(i==null||i<=0)&&c!=null&&c>0&&(i=c)}let l=a!==null&&e===xt(e.ownerDocument);return{start:o,end:!l&&i!=null&&i>0?o+i:Number.POSITIVE_INFINITY}}function Ps(e,t){let n=Fs(e,t);if(!n)return!1;let r=t.exportRenderSeek?Ls(n.start,n.end,t.canonicalFps):n;return zr(t.currentTime,r.start,r.end,t.compositionDuration)}function ci(e){return Ge(e)}function di(e){let t=e.getAttribute("data-duration"),n=e.getAttribute(Wr),r=$r({start:0,duration:t,authoredDuration:n})?.duration;return r??([t,n].map(ci).some(i=>i!=null&&i<=0)?0:null)}function q0(e){return $r({start:0,end:e.getAttribute("data-end"),authoredEnd:e.getAttribute(Vr)})?.end??null}function ed(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 td(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function Qr(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 fi(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 z0(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return fi(t);let n=e.getAttribute("data-composition-src");if(n)return fi(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?fi(r.getAttribute("src")):null}function jR(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 KR(e){if(!e)return null;let t;try{t=new URL(e,document.baseURI).pathname.split("/").filter(Boolean).at(-1)}catch{t=e.replace(/[?#].*$/,"").split(/[\\/]/).filter(Boolean).at(-1)}if(!t)return null;try{return decodeURIComponent(t)}catch{return t}}function YR(e){let t=e.textContent?.replace(/\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function ui(e){let t=e.replace(/\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return t?t.replace(/\b\w/g,n=>n.toUpperCase()):e}function j0(e){return e.getAttribute("data-hf-original-composition-id")??e.getAttribute("data-composition-id")}function XR(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 o=j0(e);if(o)return ui(o);let i=e.id;if(i)return ui(i);let a=jR(e);if(a)return ui(a);let l=KR(z0(e));if(l)return ui(l);let s=YR(e);return s||`${ui(t)} ${n+1}`}function nd(e){let t=new Map,r=window.__timelines??{},o=st({timelineRegistry:r,includeAuthoredTimingAttrs:!0}),i=$=>{if(!$)return null;let Q=en(r[$]);return Q!=null&&Q>0?Q:null},a=()=>{let $=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if($.length===0)return null;let Q=0;for(let Z of $){let me=o.resolveMediaStartForElement(Z);if(!Number.isFinite(me))continue;let he=Gr(Z);he==null||he<=0||(Q=Math.max(Q,Math.max(0,me)+he))}return Q>0?Q:null},l=($,Q)=>{let Z=[],me=null,he=null,le=null,ne=$.parentElement;for(;ne;){let te=ne.getAttribute("data-composition-id");te&&(Z.push(te),!le&&ne!==Q&&(le=te),me==null&&(me=o.resolveStartForElement(ne,0)),he==null&&(he=ci(ne.getAttribute("data-duration"))??i(te)??null)),ne=ne.parentElement}return{parentCompositionId:le,compositionAncestors:Z.reverse(),inheritedStart:me,inheritedDuration:he}},s=xt(),c=Array.from(document.querySelectorAll("[data-composition-id]")),d=s?.getAttribute("data-composition-id")??null,f=s?o.resolveStartForElement(s,0):0,m=a(),p=m!=null?Math.max(0,m-Math.max(0,f)):null,b=i(d),y=di(s??document.body),x=td(...c.filter($=>$!==s).map($=>{let Q=o.resolveStartForElement($,0),Z=o.resolveDurationForElement($)??i($.getAttribute("data-composition-id"))??null;return!Number.isFinite(Q)||Z==null||Z<=0?null:Math.max(0,Q)+Z})),E=x!=null?Math.max(0,x-Math.max(0,f)):null,v=typeof b=="number"&&Number.isFinite(b)&&b>0?b:null,_=typeof y=="number"&&Number.isFinite(y)&&y>0?y:null,U=typeof p=="number"&&Number.isFinite(p)&&p>0?p:null,G=typeof E=="number"&&Number.isFinite(E)&&E>0?E:null,R=td(U,G),D=v!=null&&R!=null&&v>=Jr,H=_??(D?R:td(v,U,G))??null,Y=(H!=null?f+H:null)??(typeof m=="number"&&Number.isFinite(m)&&m>0?m:null),W=($,Q)=>!Number.isFinite(Q)||Q<=0?0:Y==null||!Number.isFinite(Y)?Q:!Number.isFinite($)||$>=Y?0:Math.max(0,Math.min(Q,Y-$)),X=[],ie=[],F="[data-start], [data-track-index], [data-composition-id], video, audio, img",z=Array.from(document.querySelectorAll(F)),O=0,N=($,Q)=>{if($===s||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes($.tagName))return null;let Z=l($,s),me=$.tagName.toLowerCase(),he=me==="video"||me==="audio"?o.resolveMediaStartForElement($):o.resolveStartForElement($,Z.inheritedStart??0),le=$.getAttribute("data-composition-id"),ne=!!le&&le!==d,te=di($);if(te==null&&ne&&(te=i(le)),te==null&&_e($)&&Number.isFinite($.duration)&&(te=Gt($,$.duration)),te==null&&(te=Br($,he)),te==null){let Te=Z.inheritedDuration;if(Te!=null&&Te>0){let _r=(Z.inheritedStart??0)+Te;te=Math.max(0,_r-he)}}if(te==null||te<=0||(te=W(he,te),te<=0))return null;let Ue=o.resolveHostSlotsForElement($);if(Ue.length>0){let Te=fr({start:he,end:he+te},Ue),ut=ne;if(Te.end<=Te.start&&!ut)return null;he=Te.start,te=Te.end-Te.start}let ke=le&&le!==d?"composition":me==="video"?"video":me==="audio"?"audio":me==="img"?"image":"element";return{id:Cc($)??le??null,label:XR($,ke,X.length),start:he,duration:te,track:Qr($,Q),zIndex:ed($),stackingContextId:ks($,t),kind:ke,tagName:me,compositionId:$.getAttribute("data-composition-id"),compositionAncestors:Z.compositionAncestors,parentCompositionId:Z.parentCompositionId,nodePath:null,compositionSrc:fi($.getAttribute("data-composition-src")),playbackStart:nn($),playbackRate:mt($),assetUrl:z0($),timelineRole:$.getAttribute("data-timeline-role"),timelineLabel:$.getAttribute("data-timeline-label"),timelineGroup:$.getAttribute("data-timeline-group"),timelinePriority:ci($.getAttribute("data-timeline-priority"))}},L=$=>{X.push($),O=Math.max(O,$.start+$.duration)};for(let[$,Q]of z.entries()){let Z=N(Q,$);Z&&L(Z)}for(let $ of e.parked??[]){let Q=e.parkedClips?.get($.name);if(!Q){let Z=z.length;Q=Array.from($.host().querySelectorAll(F)).flatMap((me,he)=>N(me,Z+he)??[]),e.parkedClips?.set($.name,Q)}for(let Z of Q)L(Z)}let w=new Set(X.map($=>$.id)),k=s?.getAttribute("data-composition-id")??null,K=k?r[k]??null:null;if(K&&s){let $=K;if(typeof $.getChildren=="function")try{let Q=$.getChildren(!0,!0,!1)??[],Z=new Map;for(let le of s.children){let ne=le;if(!ne.id)continue;let te=ne.tagName.toLowerCase();te==="script"||te==="style"||te==="link"||Z.set(ne,{id:ne.id,start:1/0,end:-1/0})}let me=le=>{let ne=le;for(;ne;){if(Z.has(ne))return ne;if(ne===s)return null;ne=ne.parentElement}return null};for(let le of Q){if(typeof le.targets!="function"||typeof le.startTime!="function"||typeof le.duration!="function")continue;let ne=le.startTime(),te=le.parent;for(;te&&te!==K&&typeof te.startTime=="function";)ne+=te.startTime(),te=te.parent;let Ue=ne+le.duration();if(!(!Number.isFinite(ne)||!Number.isFinite(Ue)))for(let ke of le.targets()){if(!Oe(ke))continue;let Te=me(ke);if(!Te)continue;let ut=Z.get(Te);ut&&(ut.start=Math.min(ut.start,ne),ut.end=Math.max(ut.end,Ue))}}let he=X.length>0?Math.max(...X.map(le=>le.track))+1:0;for(let[le,ne]of Z){if(ne.start===1/0||ne.end===-1/0)continue;let te=le;if(w.has(te.id))continue;let Ue=Math.max(0,ne.end-ne.start);if(Ue<=0)continue;let ke=W(ne.start,Ue);ke<=0||(O=Math.max(O,ne.start+ke),X.push({id:te.id,label:te.getAttribute("data-timeline-label")??te.getAttribute("data-label")??te.getAttribute("aria-label")??te.id,start:ne.start,duration:ke,track:Qr(te,he),zIndex:ed(te),stackingContextId:ks(te,t),kind:"element",tagName:te.tagName.toLowerCase(),compositionId:te.getAttribute("data-composition-id"),compositionAncestors:k?[k]:[],parentCompositionId:k,nodePath:null,compositionSrc:null,playbackStart:nn(te),playbackRate:mt(te),assetUrl:null,timelineRole:te.getAttribute("data-timeline-role"),timelineLabel:te.getAttribute("data-timeline-label"),timelineGroup:te.getAttribute("data-timeline-group"),timelinePriority:ci(te.getAttribute("data-timeline-priority"))}),w.add(te.id))}}catch(Q){V("runtime.timeline.site1",Q)}}if(s&&H!=null&&H>0){let $=X.length>0?Math.max(...X.map(Q=>Q.track))+1:0;for(let Q of s.children){let Z=Q;if(!Z.id||w.has(Z.id))continue;let me=Z.getAttribute("data-timeline-role");if(me!=="overlay"&&me!=="persistent-overlay")continue;let he=Z.tagName.toLowerCase();if(he==="script"||he==="style"||he==="link"||he==="meta"||window.getComputedStyle(Z).display==="none")continue;let ne=W(0,H);ne<=0||(O=Math.max(O,ne),X.push({id:Z.id,label:Z.getAttribute("data-timeline-label")??Z.getAttribute("data-label")??Z.getAttribute("aria-label")??Z.id,start:0,duration:ne,track:Qr(Z,$),zIndex:ed(Z),stackingContextId:ks(Z,t),kind:"element",tagName:he,compositionId:Z.getAttribute("data-composition-id"),compositionAncestors:k?[k]:[],parentCompositionId:k,nodePath:null,compositionSrc:null,playbackStart:nn(Z),playbackRate:mt(Z),assetUrl:null,timelineRole:me,timelineLabel:Z.getAttribute("data-timeline-label"),timelineGroup:Z.getAttribute("data-timeline-group"),timelinePriority:ci(Z.getAttribute("data-timeline-priority"))}),w.add(Z.id))}}for(let $ of c){if($===s)continue;let Q=$.getAttribute("data-composition-id");if(!Q||!Jc(Q))continue;let Z=o.resolveStartForElement($,0),me=di($);if((me==null||me<=0)&&q0($)!=null){let te=q0($);me=Math.max(0,te-Z)}let he=i(Q),le=me&&me>0?me:he;if(le==null||le<=0)continue;let ne=W(Z,le);ne<=0||ie.push({id:Q,label:$.getAttribute("data-label")??j0($)??Q,start:Z,duration:ne,thumbnailUrl:fi($.getAttribute("data-thumbnail-url")),avatarName:null})}let oe=Math.max(O||0,H??0),ge=oe>0?oe:1,Ee=Math.max(1,Math.ceil(ge*Math.max(1,e.canonicalFps)));return{...Ns(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:ge,durationInFrames:Ee,clips:X,scenes:ie,compositionWidth:Ur(s?.getAttribute("data-width"))??1920,compositionHeight:Ur(s?.getAttribute("data-height"))??1080}}var Ln=new Map,rd=(e,t="")=>`${t}[${ft}="${CSS.escape(e)}"]`,K0=e=>di(e)??0,od=e=>Array.from(e.querySelectorAll("video, audio, [data-composition-id]")).every(t=>K0(t)>0),JR=e=>{let t=e.parentElement;return!e.hasAttribute(wn)&&!e.hasAttribute("data-hf-original-composition-id")&&(mr(e)||od(e))&&t?.hasAttribute("data-composition-id")===!0&&t.closest(`[${ft}]`)===null};function Y0(){return document.querySelector(`meta[name="${An}"]`)?Array.from(document.querySelectorAll(`[${ft}]:not(style, script)`)).flatMap(e=>{let t=Number(e.getAttribute("data-start")?.trim()||Number.NaN),n=K0(e),r=e.getAttribute(ft);return Number.isFinite(t)&&n>0&&JR(e)?[{name:r,host:e,start:t,end:t+n}]:[]}).sort((e,t)=>e.start-t.start):[]}var id=()=>Y0().filter(({name:e})=>Ln.has(e)).map(({name:e,start:t,end:n})=>({name:e,start:t,end:n})),QR=10;function Is(e,t,n){let r=e.find(i=>i.start>t),o=i=>i.start<=t?t<=i.end:n?i.start<=t+QR:i===r;return new Set(e.filter(o).map(i=>i.name))}var mi=e=>document.querySelector(`${rd(e)}:not(style, script)`),mr=e=>e.hasAttribute(vn);function ad(e){let t=mi(e);if(!t||mr(t))return t;for(let r of document.querySelectorAll(rd(e,"script")))r.remove();let n=t.cloneNode(!1);return n.setAttribute(vn,""),t.replaceWith(n),n}function X0(e){let t=mi(e),n=Ln.get(e);if(!t||!mr(t)||!n)return null;let r=document.createElement("template");r.innerHTML=n.html;let o=document.importNode(r.content.firstElementChild,!0);for(let{name:i,value:a}of Array.from(t.attributes))i!==vn&&o.setAttribute(i,a);return t.replaceWith(o),{host:o,placeholder:t,scripts:n.scripts.map(i=>i.cloneNode(!0))}}function J0(e=0){Ln.clear(),Ds.clear();let t=Y0(),n=Is(t,e,!1);for(let{name:r,host:o}of t){let i=Array.from(document.querySelectorAll(rd(r,"script")));Ln.set(r,{html:o.outerHTML,scripts:i.map(a=>a.cloneNode(!0))}),n.has(r)||ad(r)}}function sd(e,t,n){Ln.has(e)&&(Ds.delete(e),Ln.set(e,{html:t.outerHTML,scripts:n.map(r=>r.cloneNode(!0))}))}var Ds=new Map,Q0=e=>{let t=mr(e)?e.getAttribute(ft):null;return t!==null&&Ln.has(t)&&e.parentElement?t:null};function ld(e){let t=Q0(e);if(t===null)return null;let n=e.parentElement.cloneNode(!1),r=document.createElement("template");return r.innerHTML=Ln.get(t).html,n.append(r.content),n.firstElementChild}var Z0=()=>Array.from(document.querySelectorAll(`[${vn}]`)).flatMap(e=>{let t=Q0(e);return t===null?[]:[{name:t,host:()=>ld(e)}]});var ZR=e=>(e.timeScale?.()??1)===1&&(e.repeat?.()??0)===0,eb=(e,t)=>t+(e.startTime?.()??0),e1=(e,t)=>t+(e.totalDuration?.()??1/0),t1=e=>e.targets?.()??[];function n1(e,t){for(let n=Oe(e)?e:null;n;n=n.parentElement)n.hasAttribute(Ve)&&t.add(n)}function tb(e,t,n){let r=new Set,o=(c,d)=>d>t&&c<=n,i=c=>c.getChildren?.(!1,!1,!0)??[],a=(c,d)=>c.getChildren?.(!1,!0,!1,t-d)??[],l=(c,d)=>{let f=eb(c,d);if(f>t&&f<=n)for(let m of t1(c))n1(m,r)},s=(c,d)=>{let f=i(c).every(m=>{let p=eb(m,d);return ZR(m)&&(!o(p,e1(m,p))||s(m,p))});if(f)for(let m of a(c,d))l(m,d);return f};return s(e,0)?r:null}var nb=30;function rb(e){nb=Number.isFinite(e)&&e>0?e:30}function Ce(e){try{window.parent.postMessage({...e,...Ns(nb)},"*")}catch(t){V("bridge.postMessage",t)}}var r1=new Map(Object.entries({play:(e,t)=>t.onPlay(),pause:(e,t)=>t.onPause(),"stop-media":(e,t)=>t.onStopMedia(),seek:(e,t)=>t.onSeek(o1(e,t),e.seekMode??"commit"),tick:(e,t)=>t.onTick(),"set-muted":(e,t)=>t.onSetMuted(!!e.muted),"set-volume":(e,t)=>t.onSetVolume(Math.max(0,Math.min(1,Number(e.volume??1)))),"set-media-output-muted":(e,t)=>t.onSetMediaOutputMuted(!!e.muted),"set-native-media-sync-disabled":(e,t)=>t.onSetNativeMediaSyncDisabled(!!e.disabled),"set-web-audio-media-disabled":(e,t)=>t.onSetWebAudioMediaDisabled(!!e.disabled),"set-playback-rate":(e,t)=>t.onSetPlaybackRate(Number(e.playbackRate??1)),"set-idle-heartbeat":(e,t)=>t.onSetIdleHeartbeat(!!e.slow),"set-display-scale":(e,t)=>t.onSetDisplayScale?.(Number(e.scale)),"set-preview-quality":(e,t)=>t.onSetPreviewQuality?.(Number(e.level)),"retry-preview-copies":(e,t)=>t.onRetryPreviewCopies?.(),"request-preview-facts":(e,t)=>t.onRequestPreviewFacts?.(),"set-root-duration":(e,t)=>t.onSetRootDuration(Number(e.durationSeconds??0)),"set-play-range":(e,t)=>t.onSetPlayRange(Number(e.startSeconds??0),e.endSeconds==null?null:Number(e.endSeconds)),"set-color-grading":(e,t)=>t.onSetColorGrading(e.target??null,e.grading??null),"set-color-grading-compare":(e,t)=>t.onSetColorGradingCompare(e.target??null,e.compare??null),"enable-pick-mode":(e,t)=>t.onEnablePickMode(),"disable-pick-mode":(e,t)=>t.onDisablePickMode(),"flash-elements":e=>a1(e),"set-runtime-data":(e,t)=>{typeof e.channel=="string"&&t.onSetRuntimeData?.(e.channel,e.payload,e.requestId)},"clear-runtime-data":(e,t)=>{typeof e.channel=="string"&&t.onClearRuntimeData?.(e.channel,e.requestId)}}));function o1(e,t){let n=Number(e.timeSeconds);if(Number.isFinite(n))return Math.max(0,n);let o=Qc(e.fps)??t.getCanonicalFps();return Math.max(0,Number(e.frame??0))/o}function i1(e){let t=H0(e);return t.status!=="unsupported"?!1:(Ce({source:"hf-preview",type:"diagnostic",code:`runtime.protocol.${t.code}`,details:{receivedVersion:typeof t.receivedVersion=="string"||typeof t.receivedVersion=="number"?t.receivedVersion:null}}),!0)}function a1(e){let t=e.selectors,n=e.duration||800;t&&s1(t,n)}function ob(e){let t=n=>{if(n.source!==window.parent&&n.source!==window)return;let r=n.data;if(!r||r.source!=="hf-parent"||r.type!=="control"||i1(r))return;let o=r.action;if(typeof o!="string")return;let i=r1.get(o);i&&i(r,e)};return window.addEventListener("message",t),Ce({source:"hf-preview",type:"ready"}),t}function s1(e,t){if(!document.getElementById("__hf-flash-styles")){let n=document.createElement("style");n.id="__hf-flash-styles",n.textContent=`
|
|
32
|
+
`)||n.startsWith(`${t}\r`)?n.slice(t.length):n).split(/[\r\n]+/).map(s=>s.trim().replace(/\s+/g," ")).filter(s=>/^at\s+\S/.test(s)||/^[^@]*@.+:\d+(?::\d+)?$/.test(s)),a=i.slice(0,3),l=i.find(oT);return l&&!a.includes(l)&&a.push(l),a.length?` [thrown at: ${a.join(" <- ")}]`:""}catch(n){return V("runtime.startupError.stack",n),""}}var ja="hyperframes-studio-preview",Xh="capture",or="data-hf-upcoming",Ka="data-hf-preview-lazy";var ir="data-hf-preview-raster",Dt="data-hf-autostamped",Be="data-hf-clip-hidden",Ct="data-hf-far-scene",vn="data-hf-parked-scene",Ya=[or,Ct,vn,Ka,ir,Dt];var Jh="http://www.w3.org/1999/xhtml";function Oe(e){return e!=null&&e.nodeType===1}function we(e){return Oe(e)&&e.namespaceURI===Jh}function Ir(e,t){return we(e)&&e.localName===t}function Le(e){return Ir(e,"video")}function Xa(e){return Ir(e,"audio")}function _e(e){return Le(e)||Xa(e)}function Je(e){return Ir(e,"img")}function Jt(e){return Ir(e,"canvas")}function Qh(e){return Ir(e,"style")}function Zh(e){return Ir(e,"link")}function ar(e){return Oe(e)&&(e.namespaceURI===Jh||e.namespaceURI==="http://www.w3.org/2000/svg")}function eg(e,t=""){return e.style.setProperty("visibility","visible",t),e.hasAttribute(Be)?(e.removeAttribute(Be),function(){e.setAttribute(Be,"")}):()=>{}}function tg(){let e=window;return(e.HyperShader!==void 0||e.__hf?.transitions!==void 0)&&e.__hfClipRevealAware!==!0}var ig="data-hf-first-pass-hide",ng="[data-start]:not(video, audio, img) { visibility: hidden !important; }",aT='img[loading="lazy"] { display: none !important; }',ic="data-hf-skip-hidden-images";var ag=`[data-start]:not(video, audio, img, [${or}], [${Dt}])`,Ja=`${ag}[${Be}]`,sg=`meta[name="${ja}"]`,oc="data-hf-hidden-clip-contents",rg=`[${Be}][${Be}]`,og=`[${Be}][style*="visibility: hidden"]`,lg=e=>`${ag}${e} img { display: none !important; }`,ug=e=>{let t=[e,`${e} *`].flatMap(n=>[n,`${n}::before`,`${n}::after`]).join(", ");return`${e} * { visibility: hidden !important; } ${t} { filter: none !important; }`};function cg(e=()=>!0){return ac(Array.from(document.querySelectorAll(`[${Be}]`)).filter(e))}function ac(e){let t=e.map(n=>eg(n));return()=>{for(let n of e)n.style.getPropertyValue("visibility")!=="hidden"&&n.style.setProperty("visibility","hidden","important");for(let n of t)n()}}function rc(e,t,n){let r=document.createElement("style");r.setAttribute(t,""),r.textContent=n,e.appendChild(r)}function Qa(){return document.querySelector(sg)!==null}function sc(){return document.querySelector(`style[${ic}]`)!==null}function dg(){if(typeof document>"u")return;let e=document.head??document.documentElement;if(!e)return;let t=document.querySelector(sg),n=t!==null,r=t?.getAttribute("content")===Xh;n&&!r&&!sc()&&rc(e,ic,lg(rg)),document.querySelector(`style[${oc}]`)||rc(e,oc,ug(rg));let o=window;if(o.__hfFirstPassHidden||o.__hyperframeRuntimeBootstrapped)return;let i=n?`${ng} ${aT}`:ng;rc(e,ig,i),o.__hfFirstPassHidden=!0}function fg(){let e=window;if(!e.__hfFirstPassHidden)return!1;e.__hfFirstPassHidden=!1;for(let t of document.querySelectorAll(`style[${ig}]`))t.remove();return!0}function mg(){if(!tg())return;let e=document.querySelector(`style[${ic}]`);e&&(e.textContent=lg(og));let t=document.querySelector(`style[${oc}]`);t&&(t.textContent=ug(og))}var sT=new Set(["transform","translate","rotate","scale"]),Za=`[${ir}]`,lT=`${Za} { will-change: auto !important; }`,pg=new Set([...Ya,Be]),sr=null,lr=null,es=null,lc=null,yt=new Set,hg=new WeakMap;function uT(e){return e.willChange.split(",").every(t=>sT.has(t.trim()))}function uc(e,t,n=!0){for(let r of n?[null,"::before","::after"]:["::before","::after"]){let o=getComputedStyle(e,r);if(!(r&&o.content==="none")&&(o.position==="fixed"||!t&&(o.zIndex!=="auto"||o.mixBlendMode!=="normal")))return!0}return!1}function cT(e,t){if(t.position==="static")return!1;let n=t.zIndex!=="auto";if(uc(e,n,!1))return!1;for(let r of e.querySelectorAll("*"))if(uc(r,n))return!1;return!0}function gg(e,t){return`${t.zIndex}|${e.style?.willChange??""}`}function dc(e,t){if(e===sr)return!1;let n=yt.has(e);n&&t&&zo(e,!1);let r=getComputedStyle(e),i=(n&&!t||uT(r))&&cT(e,r);return i&&hg.set(e,gg(e,r)),i}function zo(e,t){e.toggleAttribute(ir,t),t?yt.add(e):yt.delete(e)}function dT(e){e.hasAttribute(ir)&&yt.add(e)}function bg(e,t){t!==yt.has(e)&&zo(e,t)}function fT(e,t){bg(e,dc(e,t))}function yg(e){let t=e.parentElement?.closest(Za);for(;t;)uc(e,getComputedStyle(t).zIndex!=="auto")&&zo(t,!1),t=t.parentElement?.closest(Za)}function mT(){let e=[],t=(n,r)=>{for(let o of n){let i=o.type===CSSRule.STYLE_RULE;i&&o.style.getPropertyValue("will-change")&&e.push(r?"*":o.selectorText);let a=o.styleSheet;a&&t(a.cssRules,r),"cssRules"in o&&t(o.cssRules,r||i)}};try{for(let n of[...document.styleSheets,...document.adoptedStyleSheets??[]])n!==sr?.sheet&&t(n.cssRules,!1);document.createDocumentFragment().querySelector(e.join(",")||"*")}catch{return"*"}return e.join(",")}function xg(){return es??(es=mT())}function Sg(e){if(yt.has(e)||e.style?.getPropertyValue("will-change"))return!0;let t=xg();return t!==""&&e.matches(t)}function Eg(e,t){let n=[];for(let r of[e,...e.querySelectorAll("*")]){if(t.checked.has(r))continue;t.checked.add(r),dT(r);let o=r===e||t.changed.has(r);n.push([r,Sg(r)&&dc(r,o)])}for(let[r,o]of n)bg(r,o);if(yt.size)for(let[r]of n)yg(r)}function pT(e){if(yt.has(e)){let t=getComputedStyle(e);(t.position==="static"||gg(e,t)!==hg.get(e))&&fT(e,!0)}yg(e)}function vg(){for(let e of document.querySelectorAll(Za))zo(e,!1);yt.clear()}function cc(){vg(),es=null;let e=[...document.querySelectorAll("*")].filter(t=>Sg(t)&&dc(t,!0));for(let t of e)zo(t,!0);fc()}function hT(e,t){!Oe(e.target)||pg.has(e.attributeName??"")||(e.attributeName==="style"?pT(e.target):Eg(e.target,t))}function gT(e){return[...e.addedNodes].filter(t=>Oe(t)&&(t.localName==="style"||t.localName==="link"))}function bT(e){let t=new Set;for(let n of e){let r=n.attributeName;r===null||r==="style"||pg.has(r)||Oe(n.target)&&t.add(n.target)}return t}function fc(){let e=yt.size>0||xg()!=="";!lr||e===lc||(lc=e,lr.observe(document.documentElement,{subtree:!0,childList:!0,attributes:e}))}function yT(e){if(e.some(t=>t.removedNodes.length))for(let t of yt)t.isConnected||yt.delete(t)}function xT(e){let t=e.flatMap(gT);for(let r of t)r.addEventListener("load",()=>lr&&cc(),{once:!0});if(t.length)return cc();yT(e);let n={changed:bT(e),checked:new Set};for(let r of e)if(r.type==="attributes")hT(r,n);else for(let o of r.addedNodes)Oe(o)&&Eg(o,n);fc()}function ST(){lr?.disconnect(),lr=null,sr?.remove(),sr=null,es=null,lc=null,vg()}function Ag(e){if(!(!(e>0)||!Number.isFinite(e))){if(e>=1)return ST();lr||(sr=document.createElement("style"),sr.textContent=lT,(document.head??document.documentElement).append(sr),cc(),lr=new MutationObserver(xT),fc())}}var ft="data-hf-scene",An="hf-scene-parts",mc="data-hf-scene-fonts",pc=e=>e.match(/@font-face\s*\{[^}]*\}/gi)??[],wn="data-hf-scene-no-swap";var ET=`[${ft}]:not(style, script)`,vT=new Set(["absolute","fixed"]);function AT(e,t){let n=e.flatMap((a,l)=>a.start<=t&&t<=a.end?[l]:[]),r=e.filter(a=>a.start<=t).length-1,o=n.length>0?n[0]:r,i=n.length>0?n[n.length-1]:r;return e.map((a,l)=>l>=o-1&&l<=i+1)}function wT(e,t){let n=AT(e.map(r=>r.span),t);return new Set(e.filter((r,o)=>!n[o]).map(r=>r.host))}var wg=(e,t)=>({size:t,outOfFlow:vT.has(getComputedStyle(e).position)});function _T(){let e=new WeakMap,t=typeof ResizeObserver=="function"?new ResizeObserver(r=>{for(let{target:o,borderBoxSize:i}of r){let a=i?.[0];a&&e.set(o,wg(o,`${Math.round(a.inlineSize)}px ${Math.round(a.blockSize)}px`))}}):null,n=[];return{watch(r){for(let o of n)o.isConnected||t?.unobserve(o);for(let o of r)t?.observe(o);n=r},of:r=>e.get(r)??wg(r,`${r.offsetWidth}px ${r.offsetHeight}px`)}}function _g(e){let t=null,n=null,r=new Map,o=_T(),i=s=>s.map(c=>({host:c,span:e(c)})).filter(c=>Number.isFinite(c.span?.start)).sort((c,d)=>c.span.start-d.span.start),a=s=>{let c=!1;for(let d of s){if(d.hasAttribute(Ct))continue;let{size:f,outOfFlow:m}=o.of(d);if(!m){s.delete(d);continue}let p=d.getAttribute(ft);c||(c=r.get(p)!==f),r.set(p,f)}return c},l=()=>{n??(n=document.createElement("style")),n.textContent=[`[${Ct}] { content-visibility: hidden; }`,...Array.from(r,([s,c])=>`[${ft}="${CSS.escape(s)}"][${Ct}] { contain-intrinsic-size: ${c}; }`)].join(`
|
|
33
|
+
`),n.isConnected||document.head.appendChild(n)};return s=>{if((!t||t.some(d=>!d.isConnected))&&o.watch(t=Array.from(document.querySelectorAll(ET))),t.length===0)return;let c=wT(i(t),s);(a(c)||!n?.isConnected)&&l();for(let d of t)c.has(d)!==d.hasAttribute(Ct)&&d.toggleAttribute(Ct)}}var Dr=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),uG=Object.freeze([Dr.start,Dr.duration,Dr.trackIndex]),cG=Object.freeze([Dr.derivedEnd]),dG=Object.freeze([Dr.derivedEnd,Dr.legacyTrack]);function _n(e){if(e==null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}var Tg=/^[A-Za-z0-9_.:-]+$/;function Rg(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function Cg(e,t){let n=t;for(;n>=0&&Rg(e,n);)n--;return n}function CT(e,t){let n=t;for(;n>=0&&(e[n]??"").trim()==="";)n--;return n}function TT(e){let t=e.length-1;if(!Rg(e,t))return null;let n=Cg(e,t);return e[n]==="."&&(n=Cg(e,n-1)),n+1}function RT(e){let t=TT(e);if(t==null)return null;let n=CT(e,t-1),r=e[n];if(r!=="+"&&r!=="-")return null;let o=e.slice(0,n).trim();if(!Tg.test(o))return null;let i=Number(e.slice(t));return Number.isFinite(i)?{refId:o,operator:r,magnitude:i}:null}function ts(e){let t=(e??"").trim();if(!t)return null;let n=_n(t);if(n!=null)return{kind:"absolute",value:n};if(Tg.test(t))return{kind:"reference",refId:t,offset:0};let r=RT(t);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}var Mg=e=>{let t=_n(e);return t!==null&&t>=0?t:null};function ns(e){return Mg(e("data-playback-start"))??Mg(e("data-media-start"))??0}var jo=.1,Ko=10;function hc(e){return Number.isFinite(e)&&e>0?Math.max(jo,Math.min(Ko,e)):1}function kg(e,t=1){let n=Number.parseFloat(e("data-playback-rate")??"");return hc(Number.isFinite(n)&&n>0?n:t)}function gc(e){let t=_n(e("data-duration"));return t!==null&&t>0?t:null}function Lg(e,t){let n=gc(e);if(n!==null)return n;let r=_n(e("data-end"));return r!==null?r-t:null}var MT=3;function bc(e,t,n){return Number.isFinite(e)?Math.max(0,e-t)/hc(n):null}function yc(e){let{tag:t,authoredDurationSeconds:n,sourceDurationSeconds:r,mediaStartSeconds:o,playbackRate:i}=e;if(n!==null&&n>0)return{seconds:n,source:"authored"};if(t==="img")return{seconds:MT,source:"default"};if(r===null)return{seconds:null,source:"pending",reason:"source duration not yet probed"};let a=bc(r,o,i);return a===null?{seconds:null,source:"pending",reason:"source reported a non-finite duration"}:{seconds:a,source:"media"}}var Tn="data-fx-chain",gG=Tn.slice(5),Ng=1,Yo=(e="frequency",t="Frequency",n=1e3,r=20,o=2e4)=>({kind:"number",key:e,label:t,unit:"Hz",min:r,max:o,step:1,default:n,scale:"log",automatable:!0}),xc=(e=.707,t="Bandwidth: higher is narrower.")=>({kind:"number",key:"q",label:"Q",unit:"",min:.1,max:20,step:.01,default:e,scale:"log",automatable:!0,hint:t}),rs=(e=-40,t=40,n=0)=>({kind:"number",key:"gain",label:"Gain",unit:"dB",min:e,max:t,step:.1,default:n,automatable:!0}),Fg={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."},Ig=[{id:"gain",label:"Gain",group:"dynamics",description:"Raise or lower the whole signal. Automate it to duck under something else.",params:[rs(-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:[Yo("frequency","Frequency",1e3),rs(-40,40,0),xc(1)],web:"biquad-peaking"},{id:"lowshelf",label:"Low Shelf",group:"filter",description:"Lift or drop everything below the corner frequency.",params:[Yo("frequency","Frequency",200,20,2e3),rs(-40,40,0)],web:"biquad-lowshelf"},{id:"highshelf",label:"High Shelf",group:"filter",description:"Lift or drop everything above the corner frequency.",params:[Yo("frequency","Frequency",4e3,500,2e4),rs(-40,40,0)],web:"biquad-highshelf"},{id:"highpass",label:"High-pass",group:"filter",description:"Remove low frequencies: the usual fix for rumble on a voice.",params:[Yo("frequency","Cutoff",300,20,2e4),xc(.707),Fg],web:"biquad-highpass"},{id:"lowpass",label:"Low-pass",group:"filter",description:"Remove high frequencies, which darkens or muffles a track.",params:[Yo("frequency","Cutoff",8e3,100,2e4),xc(.707),Fg],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:"Peak limiter that follows the signal's level. It has no lookahead, so a fast peak or an inter-sample peak can pass the ceiling; use the true-peak limiter for a delivery 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:"truepeak",label:"True-peak limiter",group:"dynamics",description:"Lookahead limiter that holds a 4x estimate of the inter-sample peak at a dBTP ceiling; full-band noise can land up to about 1.7 dB above it. Adds lookahead plus about 0.3 ms of latency.",params:[{kind:"number",key:"ceiling",label:"Ceiling",unit:"dBTP",min:-24,max:0,step:.1,default:-1,hint:"Target true peak, measured on a 4x oversampled signal. Dense full-band sound can end up to about 1.7 dB above it."},{kind:"number",key:"lookahead",label:"Lookahead",unit:"ms",min:.5,max:10,step:.1,default:3,hint:"How far ahead the gain starts falling. Longer is smoother and adds the same latency."},{kind:"number",key:"release",label:"Release",unit:"ms",min:10,max:2e3,step:1,default:80,scale:"log"}],web:"worklet-truepeak"},{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, 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"}],Sc=new Map(Ig.map(e=>[e.id,e]));function Xo(e){return Sc.get(e)}var bG=Ig.map(e=>e.id);function Jo(e,t){let n=Sc.get(e);if(!n)return{};let r={};for(let o of n.params){let i=t?.[o.key];if(o.kind==="enum"){let l=o.options.some(s=>s.value===i);r[o.key]=l?i:o.default;continue}let a=typeof i=="number"?i:typeof i=="string"&&i.trim()!==""?Number(i):Number.NaN;r[o.key]=Number.isFinite(a)?Math.min(o.max,Math.max(o.min,a)):o.default}return r}var Cn=class extends Error{constructor(t){super(t),this.name="AudioFxChainError"}};function Dg(e){let t;try{t=JSON.parse(e)}catch(o){throw new Cn(`Chain file is not valid JSON: ${o.message}`)}if(typeof t!="object"||t===null)throw new Cn("Chain file must be a JSON object.");let n=t;if(n.version!==Ng)throw new Cn(`Unsupported chain version: ${String(n.version)}`);if(!Array.isArray(n.nodes))throw new Cn("Chain file is missing a `nodes` array.");let r=n.nodes.map(kT);return{version:Ng,nodes:r}}function Qo(e){return e.nodes.filter(t=>t.enabled!==!1)}function kT(e,t){if(typeof e!="object"||e===null)throw new Cn(`Node ${t} is not an object.`);let n=e;if(typeof n.type!="string"||!Sc.has(n.type))throw new Cn(`Node ${t} has unknown effect type: ${String(n.type)}`);return NT({type:n.type,id:os(n.id),fromCarve:Pg(n.fromCarve),fromPreset:os(n.fromPreset),label:os(n.label),fromEq:os(n.fromEq),fromLeveller:Pg(n.fromLeveller),presetAmount:LT(n.presetAmount),enabled:n.enabled!==!1,params:Jo(n.type,n.params??void 0)})}function os(e){return typeof e=="string"&&e?e:void 0}function Pg(e){return e===!0?!0:void 0}function LT(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(1,Math.max(0,e))}function NT(e){for(let t of Object.keys(e))e[t]===void 0&&delete e[t];return e}function FT(e){return 10**(e/20)}var ur=FT(12);function Ue(e){return Number.isFinite(e)?Math.max(0,Math.min(ur,e)):1}function as(e,t){return Ue(e*t)}function Og(e,t){return t?1:Ue(e)}function is(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function Hg(e,t){let n=typeof HTMLMediaElement>"u"?void 0:Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"volume"),r=n?.get,o=n?.set;if(!r||!o)return t();let i=Number(r.call(e));Object.defineProperty(e,"volume",{configurable:!0,get:()=>i,set:a=>{i=Number(a),o.call(e,is(i))}});try{return t()}finally{delete e.volume,o.call(e,is(i))}}var Zt="data-automation",_G=Zt.slice(5),ls=1,PT=512,Qt=class extends Error{constructor(t){super(t),this.name="AudioAutomationError"}},Or="volume",us="rate";function ei(e){if(e===Or)return{kind:"volume"};if(e===us)return{kind:"rate"};let t=e.split(".");if(t.length===3&&t[0]==="fx"&&t[1]===IT){let o=t[2];return o?{kind:"preset",presetId:o}: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 IT="preset";var DT={min:0,max:1,step:.01,unit:"",label:"Amount",scale:"linear",default:1},cs={min:0,max:ur,step:.01,unit:"",label:"Volume",scale:"linear",default:1};function OT(e){return Math.min(4096,Math.max(2,Math.ceil(e*30)))}function Ec(e){return!!e.curve||e.viaX!==void 0&&e.viaY!==void 0}function ss(e,t,n=!1){let r=Ue(t),o=as(r,e);return n&&r>0?o/r:o}function Gg(e,t,n=!1){let r=[],o=e.points,i=Ue(t);for(let a=0;a<o.length;a+=1){let l=o[a],s=o[a+1];if(!(s!==void 0&&(i*l.v-ur)*(i*s.v-ur)<0)){r.push({...l,v:ss(l.v,t,n)});continue}if(r.push({t:l.t,v:ss(l.v,t,n)}),Ec(l)){let d=OT(s.t-l.t);for(let f=1;f<d;f+=1){let m=l.t+(s.t-l.t)*f/d;r.push({t:m,v:ss(Ot(e,m),t,n)})}}else{let d=l.t+(ur/i-l.v)/(s.v-l.v)*(s.t-l.t);r.push({t:d,v:ss(ur/i,i,n)})}}return r}var Bg={min:jo,max:Ko,step:.05,unit:"x",label:"Speed",scale:"log",default:1};function vc(e,t){let n=ei(e);if(!n)return null;if(n.kind==="volume")return cs;if(n.kind==="rate")return Bg;if(n.kind==="preset")return t?.nodes.some(l=>l.fromPreset===n.presetId)?{...DT,label:`${n.presetId} \xB7 Amount`}:null;let r=t?.nodes.find(a=>a.id===n.nodeId);if(!r)return null;let o=Xo(r.type),i=o?.params.find(a=>a.key===n.param);return!i||i.kind!=="number"?null:{min:i.min,max:i.max,step:i.step,unit:i.unit,label:`${o?.label??r.type} \xB7 ${i.label}`,scale:i.scale==="log"&&i.min>0?"log":"linear",default:i.default}}function Zo(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 HT(e){let t=Zo(e);return t===null||t===0?0:Math.min(1,Math.max(-1,t))}function Ug(e,t){let n=Zo(e),r=Zo(t);if(n===null||r===null)return null;let o=l=>Math.min(.999,Math.max(.001,l)),i=o(n),a=o(r);return Math.abs(i-a)<1e-6?null:{x:i,y:a}}function GT(e){let t=HT(e?.curve),n=Ug(e?.viaX,e?.viaY);return{...t?{curve:t}:{},...n?{viaX:n.x,viaY:n.y}:{}}}function BT(e,t){let n=Zo(e?.t),r=Zo(e?.v);if(n===null||r===null)return null;let o=t?Math.min(t.max,Math.max(t.min,r)):r;return{t:Math.max(0,n),v:o,...GT(e)}}function Wg(e,t){let n=e.map(o=>BT(o,t)).filter(o=>o!==null).sort((o,i)=>o.t-i.t),r=[];for(let o of n)r.length>0&&r[r.length-1].t===o.t?r[r.length-1]=o:r.push(o);return r.slice(0,PT)}function UT(e){let t=[];for(let n of e.lanes){if(!ei(n.target))continue;let r=n.target===Or?cs:n.target===us?Bg:null,o=Wg(n.points??[],r);o.length>0&&t.push({target:n.target,points:o})}return{version:ls,lanes:t}}function Vg(e,t){let n=[];for(let r of e.lanes){let o=vc(r.target,t);if(!o)continue;let i=Wg(r.points,o);i.length>0&&n.push({target:r.target,points:i})}return{version:ls,lanes:n}}function ds(e){let t;try{t=JSON.parse(e)}catch(o){throw new Qt(`Automation is not valid JSON: ${o.message}`)}if(typeof t!="object"||t===null)throw new Qt("Automation must be a JSON object.");let n=t;if(n.version!==ls)throw new Qt(`Unsupported automation version: ${String(n.version)}`);if(!Array.isArray(n.lanes))throw new Qt("Automation is missing a `lanes` array.");let r=n.lanes.map((o,i)=>{if(typeof o!="object"||o===null)throw new Qt(`Lane ${i} is not an object.`);let a=o;if(typeof a.target!="string"||!ei(a.target))throw new Qt(`Lane ${i} has an unreadable target: ${String(a.target)}`);if(!Array.isArray(a.points))throw new Qt(`Lane ${i} is missing a \`points\` array.`);return{target:a.target,points:a.points}});return UT({version:ls,lanes:r})}function WT(e,t){return t?Math.pow(e,Math.pow(2,2*t)):e}function VT(e,t){let n=e-.5,r=t-.5,o=.999,i=1e6,a=n>0?n/(o-e):n<0?-n/(e-(1-o)):0,l=r>0?r/(o-t):r<0?-r/(t-(1-o)):0,s=Math.min(i,Math.max(1,a,l));return{cx:e+n/s,cy:t+r/s,w:s}}function $T(e,t,n){let{cx:r,cy:o,w:i}=VT(t,n),a=2-2*i,l=e*a-1+2*i*r,s=-e*a-2*i*r,c=qT(l,s,e),d=1-c,f=d*d+2*i*c*d+c*c;return f>0?(2*i*o*c*d+c*c)/f:e}function qT(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)),o=(-t+r)/(2*e),i=(-t-r)/(2*e),a=l=>l>=-1e-9&&l<=1+1e-9;return a(o)?Math.min(1,Math.max(0,o)):a(i)?Math.min(1,Math.max(0,i)):n}function zT(e,t){let n=Ug(t.viaX,t.viaY);return n?$T(Math.min(1,Math.max(0,e)),n.x,n.y):WT(e,t.curve)}function jT(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 Ot(e,t,n="linear"){let r=e.points;if(r.length===0)return 0;let o=r[0];if(t<=o.t)return o.v;let i=r[r.length-1];if(t>=i.t)return i.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],c=r[l],d=c.t-s.t;return d<=0?c.v:jT(s.v,c.v,zT((t-s.t)/d,s),n)}function $g(e){return e.points.length<=1||e.points.every(t=>t.v===e.points[0].v)}function qg(e,t,n,r,o="linear"){let i=Math.max(2,Math.floor(r)),a=new Float32Array(i),l=n-t;for(let s=0;s<i;s+=1)a[s]=Ot(e,t+l*s/(i-1),o);return a}var fs=new Map,KT=64;function Ac(e,t=Or){let n=`${t}\0${e}`,r=fs.get(n);if(r!==void 0)return r;let o=null;try{o=ds(e).lanes.find(i=>i.target===t)??null}catch{o=null}return fs.size>KT&&fs.clear(),fs.set(n,o),o}function zg(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(Zt):null)??"";if(!n)return null;let r=Ac(n);return!r||r.points.length===0?null:Ot(r,t)}var jg=48,Kg=new WeakMap;function YT(e){let t=e.points,n=t[0].v,r=t[t.length-1].v,o=[0],i=[0],a=s=>{let c=o[o.length-1];if(s<=c)return;let d=Ot(e,c,"log");o.push(s),i.push(i[i.length-1]+(d+Ot(e,s,"log"))/2*(s-c))},l=Math.max(0,t[0].t);a(l);for(let s=1;s<t.length;s+=1){let c=t[s-1].t,d=t[s].t;if(!(d<=0))for(let f=1;f<=jg;f+=1)a(Math.max(c,0)+(d-c)*f/jg)}return{ts:Float64Array.from(o),ss:Float64Array.from(i),firstRate:n,lastRate:r}}function Yg(e){let t=Kg.get(e);return t||(t=YT(e),Kg.set(e,t)),t}function wc(e){return typeof e!="number"&&e.points.length>0}function _c(e,t){return typeof e=="number"?e:wc(e)?Ot(e,t,"log"):1}function Xg(e,t,n){let r=0,o=e.length-1;for(;o-r>1;){let i=r+o>>1;e[i]<=n?r=i:o=i}return t[r]+(t[o]-t[r])*(n-e[r])/(e[o]-e[r])}function Hr(e,t){if(typeof e=="number")return t*e;if(!wc(e))return t;let{ts:n,ss:r,firstRate:o,lastRate:i}=Yg(e),a=n.length-1;return t<=0?t*o:t>=n[a]?r[a]+(t-n[a])*i:Xg(n,r,t)}function cr(e,t){if(typeof e=="number")return t/e;if(!wc(e))return t;let{ts:n,ss:r,firstRate:o,lastRate:i}=Yg(e),a=n.length-1;return t<=0?t/o:t>=r[a]?n[a]+(t-r[a])/i:Xg(r,n,t)}function XT(e){return e?Ac(e,us):null}function Jg(e,t){return XT(e)??t}var NG=[{id:"montage",label:"Montage",points:[[0,.9],[.15,.3],[.5,2.5],[.85,.3],[1,.9]]},{id:"hero",label:"Hero",points:[[0,1],[.25,1.6],[.5,.25],[.75,1.6],[1,1]]},{id:"bullet",label:"Bullet",points:[[0,3],[.4,3],[.5,.15],[.6,3],[1,3]]},{id:"jump-cut",label:"Jump cut",points:[[0,.5],[.24,.5],[.26,3],[.5,3],[.52,.5],[.74,.5],[.76,3],[1,3]]},{id:"flash-in",label:"Flash in",points:[[0,.3],[.6,.6],[1,5]]},{id:"flash-out",label:"Flash out",points:[[0,5],[.4,.6],[1,.3]]},{id:"ramp-in",label:"Ramp in",points:[[0,.5],[1,1]]},{id:"ramp-out",label:"Ramp out",points:[[0,1],[1,.5]]},{id:"slowmo-middle",label:"Slow-mo middle",points:[[0,1],[1/3,.35],[2/3,.35],[1,1]]}];function Ge(e){return _n(e)}function mt(e){return kg(t=>e.getAttribute(t),_e(e)?e.defaultPlaybackRate:1)}function Ht(e){return Jg(e.getAttribute("data-automation"),mt(e))}function Rn(e){return ns(t=>e.getAttribute(t))}function Gt(e,t){return JT(t,Rn(e),Ht(e))}function Gr(e){let t=yc({tag:"video",authoredDurationSeconds:gc(n=>e.getAttribute(n)),sourceDurationSeconds:Number.isFinite(e.duration)?e.duration:null,mediaStartSeconds:Rn(e),playbackRate:mt(e)});return t.source==="media"?Gt(e,e.duration):t.seconds}function Br(e,t=0){return!Je(e)||!e.hasAttribute("data-start")&&!e.hasAttribute("data-track-index")?null:yc({tag:"img",authoredDurationSeconds:Lg(n=>e.getAttribute(n),t),sourceDurationSeconds:null,mediaStartSeconds:0,playbackRate:1}).seconds}function JT(e,t,n){return typeof n=="number"?bc(e,t,n):Number.isFinite(e)?cr(n,Math.max(0,e-t)):null}var QT=e=>e.paused?.()===!0?(e.startTime?.()??0)+(e.totalDuration?.()??0)/Math.abs(e.timeScale?.()||1):0;function en(e){try{if(typeof e?.duration!="function")return null;let t=e.getChildren?.(!1,!1,!0),n=Array.isArray(t)?t:[],r=Math.max(Number(e.duration()),...n.map(QT));return Number.isFinite(r)?r:null}catch(t){return V("runtime.timelineDuration",t),null}}function dr(e){if(e==null||e.trim()==="")return null;let t=Number.parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function Ur(e){if(e==null||e.trim()==="")return null;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:null}function xt(e=document){let t=e.querySelector('[data-composition-id][data-root="true"]');return we(t)?t:e.querySelector("[data-composition-id]")}var ZT=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function Cc(e){return e.id||e.getAttribute("data-hf-id")||null}function eR(e){return Ge(e)}function tR(e,t){let n=e.getAttribute("data-composition-id");if(!n)return null;let r=en(t[n]);return r!=null&&r>0?r:null}function nR(e){return _e(e)?Number.isFinite(e.duration)?Gt(e,e.duration):null:Br(e)}function rR(e,t,n,r){let o=eR(e.getAttribute("data-duration"));return o!=null&&o>0?o:tR(e,t)??nR(e)??Math.max(0,n-r)}function oR(e){for(let[t,n]of e){let r=t.parentElement;for(;r;){let o=e.get(r);if(o){n.parentId=o.id,o.children.push(n);break}r=r.parentElement}}}function Qg(e){let{startResolver:t,timelineRegistry:n,rootDuration:r}=e,o=new Map,i=xt(),a=0;for(let l of document.querySelectorAll("[data-start]")){if(l===i||ZT.has(l.tagName))continue;let s=t.resolveStartForElement(l,0);if(rR(l,n,r,s)<=0)continue;let c={id:Cc(l)??`__clip-${a++}`,element:l,parentId:null,children:[]};o.set(l,c)}return oR(o),{roots:Array.from(o.values()).filter(l=>l.parentId===null)}}var Wr="data-hf-authored-duration",Vr="data-hf-authored-end";function ti(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 $r(e){let t=ti(e.start);if(t==null)return null;let n=Math.max(0,t),r=ti(e.duration),o=ti(e.authoredDuration),i=r!=null&&r>0?r:o!=null&&o>0?o:null;if(i!=null)return{start:n,duration:i,end:n+i};let a=ti(e.end),l=ti(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 ni=e=>4*Number.EPSILON*Math.max(1,Math.abs(e));function qr(e,t){return!Number.isFinite(e)||!Number.isFinite(t)?e===t:Math.abs(e-t)<=ni(Math.max(Math.abs(e),Math.abs(t)))}var Zg=(e,t)=>e>=t||qr(e,t),Mn=(e,t,n)=>Zg(e,t)&&e<n&&!qr(e,n),iR=1e-6,zr=(e,t,n,r)=>Mn(e,t,n)||Zg(e,t)&&r>0&&n>=r-iR;var ms="data-hf-media-start-basis";function e0(e){return e?.trim().toLowerCase()==="global"?"global":"local"}function aR(e){return e0(e.basis)==="global"?e.authoredStart:e.hostStart+e.authoredStart}function t0(e){return r0(e)?aR({authoredStart:e.authoredStart,hostStart:e.hostStart,basis:e.basis}):e.ordinaryStart()}function n0(e){return r0(e)&&e0(e.basis)==="global"}function r0(e){return!e.hasAutoStart&&e.authoredStart!=null&&e.hostStart!==0}function Tc(e){return ns(t=>e.getAttribute(t))}function o0(e,t){return e-Tc(t)}function fr(e,t){return t.reduce((n,r)=>{let o=Math.max(n.start,r.start);return{start:o,end:Math.max(o,Math.min(n.end,r.end))}},e)}function st(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,o=new WeakMap,i=new WeakMap,a=new Set,l=T=>(T.hasAttribute("data-composition-id")?T.parentElement:T)?.closest("[data-composition-id]")??null,s=(T,H)=>{let I=l(H);if(I){for(let W of I.querySelectorAll(`[id="${T}"]`))if(l(W)===I)return W}let Y=r.getElementById(T);return Y||(Array.from(r.querySelectorAll("[data-composition-id]")).find(W=>W.getAttribute("data-composition-id")===T)??null)},c=(T,H)=>n?T.getAttribute(H):null,d=T=>$r({start:0,duration:T.getAttribute("data-duration"),authoredDuration:c(T,"data-hf-authored-duration")})?.duration??$r({start:_(T,0),end:T.getAttribute("data-end"),authoredEnd:c(T,"data-hf-authored-end")})?.duration??null,f=T=>T!=null&&Number.isFinite(T)&&T>0?T:null,m=T=>{let H=T.getAttribute("data-composition-id");return H?f(en(t[H])):null},p=T=>{let H=i.get(T);if(H!==void 0)return H;let I=d(T)??f(_e(T)?Gt(T,T.duration):null)??f(Br(T))??m(T);return i.set(T,I),I},b=T=>T.hasAttribute("data-composition-src")||T.hasAttribute("data-composition-id")||T.hasAttribute("data-composition-file"),y=T=>{let H=T.parentElement;return!H||!T.hasAttribute("data-composition-id")||ts(T.getAttribute("data-start"))?null:b(H)?H:null},x=(T,H)=>o0(_(T,H),y(T)??T),E=(T,H)=>{let I=T.hasAttribute("data-composition-id")?T.parentElement?.closest("[data-composition-id]"):T.closest("[data-composition-id]");return I?x(I,H):0},v=(T,H)=>{let I=ts(T.getAttribute("data-start"));if(!I){let F=y(T);return F?_(F,H):H}if(I.kind==="absolute")return E(T,H)+Math.max(0,I.value);let Y=s(I.refId,T);if(!Y)return H;let W=_(Y,0),X=p(Y)??0,ie=Math.min(0,E(T,0));return Math.max(ie,W+X+I.offset)},_=(T,H)=>{let I=o.get(T);if(I!==void 0)return I??H;if(a.has(T))return H;a.add(T);try{let Y=v(T,H);return o.set(T,Y),Y}finally{a.delete(T)}},U=T=>{let H=T.closest("[data-composition-id]");return{authoredStart:Ge(T.getAttribute("data-start")),hostStart:H?x(H,0):0,hasAutoStart:T.hasAttribute("data-hf-auto-start"),basis:T.getAttribute(ms)}};return{resolveStartForElement:(T,H=0)=>_(T,Math.max(0,H)),resolveDurationForElement:T=>p(T),resolveMediaStartForElement:T=>{let H=U(T);return t0({...H,ordinaryStart:()=>_(T,H.hostStart)})},resolveHostStartForElement:T=>E(T,0),resolveHostSlotsForElement:T=>{let H=[];for(let I=T.parentElement;I;I=I.parentElement){if(!b(I)||y(I)||Tc(I)<=0)continue;let Y=_(I,0),W=d(I);H.push({start:Y,end:W?Y+W:1/0})}return H},isRootGlobalMediaStartForElement:T=>_e(T)&&n0(U(T))}}function sR(e,t,n){let r=e.filter(i=>Number.isFinite(i.time)&&Number.isFinite(i.volume)).map(i=>({time:Math.max(0,i.time-t),volume:Ue(i.volume)})).sort((i,a)=>i.time-a.time),o=[];for(let i of r){let a=o.at(-1);a&&Math.abs(a.time-i.time)<1e-9?a.volume=i.volume:o.push(i)}return o.length===0||o[0].time>0&&o.unshift({time:0,volume:Ue(n)}),o}function i0(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],o=e[n+1]??r,i=o.time-r.time,a=i<=0?0:Math.min(1,Math.max(0,(t-r.time)/i));return r.volume+(o.volume-r.volume)*a}function lR(e,t,n,r){let o=e.at(-1);!o||Math.abs(o.volume-n.volume)>1e-4?(o&&t&&t.time>o.time&&e.push(t),e.push(n)):r&&n.time>o.time&&e.push(n)}function uR(e){let t=Number.parseFloat(e??"");return Number.isFinite(t)?t:void 0}function cR(e,t){let n=st({timelineRegistry:window.__timelines,includeAuthoredTimingAttrs:!0}).resolveMediaStartForElement(e),r=Ge(e.dataset.end)??void 0,o=Ge(e.dataset.duration)??void 0,i=t;o!==void 0&&o>0?i=n+o:r!==void 0&&r>n&&(i=r);let a=uR(e.dataset.volume)??1;return{start:n,end:i,staticVolume:Ue(a)}}function dR(e,t,n,r,{start:o,end:i,staticVolume:a}){let l=1/Math.min(60,Math.max(1,r)),s=Math.max(0,o),c=Math.min(n,i),d=Hg(e,()=>{e.volume=a;let m=[],p;for(let b=s;b<=c+1e-6;b=Math.min(c,b+l)){t(b);let y=Number(e.volume);if(Number.isFinite(y)){let x={time:Number(b.toFixed(6)),volume:Number(Ue(y).toFixed(6))};lR(m,p,x,b===c),p=x}if(b===c)break}return m});return d.some(m=>Math.abs(m.volume-a)>1e-4)?d:null}function ps(e,t,n=0){return n>3||e===null||typeof e!="object"?!1:Array.isArray(e)?e.some(r=>ps(r,t,n+1)):Object.getPrototypeOf(e)!==Object.prototype?!1:Object.entries(e).some(([r,o])=>t(r)||ps(o,t,n+1))}var fR=e=>typeof e?.nodeType=="number";function mR(e,t){for(let n=Object(e);n;n=Object.getPrototypeOf(n)){let r=Object.getOwnPropertyDescriptor(n,t);if(r)return typeof r.set=="function"}return!1}function Rc(e){let t={elements:new Set,anySetter:!1,unknown:!0};if(typeof e.getChildren!="function")return t;try{let n={elements:new Set,anySetter:!1,unknown:!1};for(let r of e.getChildren(!0,!0,!1)){let o=r.targets?.()??[];for(let i of o)fR(i)?ps(r.vars,a=>a==="volume")&&n.elements.add(i):!n.anySetter&&ps(r.vars,a=>mR(i,a))&&(n.anySetter=!0)}return n}catch{return t}}var pR=(e,t)=>e.unknown||e.anySetter||e.elements.has(t);function a0(e,t,n,r,o={}){if(o.allowLiveTimelineSeek===!1||!t||!_e(e)||n<=0||!pR(o.movers?.()??Rc(t),e))return;let i=c=>{try{typeof t.totalTime=="function"?t.totalTime(c,!0):typeof t.seek=="function"&&t.seek(c,!0)}catch{}},a=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,l=cR(e,n),s=dR(e,i,n,60,l);if(Number.isFinite(a)&&i(a),s){let c=sR(s,l.start,l.staticVolume);c.length>0&&r.set(e,c)}}var u0="data-fade-in",c0="data-fade-out",EB=u0.slice(5),vB=c0.slice(5),d0=Object.freeze({fadeIn:0,fadeOut:0});function Mc(e){return Number.isFinite(e)&&e>0?e:0}function s0(e){return e==null||e===""?0:Mc(Number.parseFloat(e))}function hs(e){return{fadeIn:s0(e.getAttribute(u0)),fadeOut:s0(e.getAttribute(c0))}}function kc(e,t){let n=Mc(e.fadeIn),r=Mc(e.fadeOut);if(!Number.isFinite(t)||t<=0)return{fadeIn:n,fadeOut:r};let o=n+r;if(o<=t)return{fadeIn:n,fadeOut:r};let i=t/o;return{fadeIn:n*i,fadeOut:r*i}}function gs(e,t,n){if(!Number.isFinite(e))return 1;let{fadeIn:r,fadeOut:o}=kc(n,t),i=1;return r>0&&(i*=l0(e/r)),o>0&&Number.isFinite(t)&&(i*=l0((t-e)/o)),i}function l0(e){return!Number.isFinite(e)||e<0?0:e>1?1:e}var f0=':not([muted]):is(:not([data-has-audio]),[data-has-audio="true"])',wB=`audio[data-start], video[data-start]${f0}`;function bs(e){if(e.tagName.toLowerCase()!=="video"||e.hasAttribute("muted"))return!1;let t=e.getAttribute("data-has-audio");return t===null||t==="true"}function m0(e){return(e.volume??1)>1||!!(e.fxChain||e.automation||e.audioGroup||e.masterChain)}var ri="data-hf-render-id",p0="data-hf-group-render-id";var tn="hf-audio-group",ys="data-audio-group";function oi(e){let t=e?.getAttribute("data-volume"),n=t?parseFloat(t):1;return Number.isFinite(n)?n:1}function Lc(e,t){let n=Array.from(e?.querySelectorAll?.(`${tn}[${ri}]`)??[]).find(o=>o.getAttribute(ri)===t);if(n)return n;let r=e?.getElementById(t)??null;return r&&r.tagName?.toLowerCase()===tn?r:null}function xs(e,t){let n=t?.getAttribute?.(p0)??t?.getAttribute?.(ys);return n?Lc(e,n)?.hasAttribute("data-hidden")??!1:!1}function Nc(e){let t=e.querySelector("[data-composition-id]");return t&&!t.parentElement?.closest("[data-composition-id]")?t:null}function h0(e){return Nc(e)?.getAttribute(Tn)||void 0}function Ss(e){return typeof e.tagName!="string"||typeof e.getAttribute!="function"||!hR(e)?null:e.getAttribute(ys)||null}function hR(e){return e.tagName.toLowerCase()==="audio"?!0:typeof e.hasAttribute=="function"&&bs(e)}function g0(e){let t="__hf-audio-group-inert";if(!e?.head||e.getElementById(t))return;let n=e.createElement("style");n.id=t,n.textContent=`${tn}{display:contents!important}${tn}[data-hidden]{display:none!important}`,e.head.appendChild(n)}function Fc(e){return e.getAttribute(ri)||e.id||null}var gR="__render_frame_",bR="__";function yR(e){return`${gR}${e}${bR}`}function xR(e){let t=Fc(e);return t?yR(t):null}function Tt(e){let t=xR(e),n=t?document.getElementById(t):null;if(!n)return null;let r=e.nextElementSibling;for(;r&&r.id!==t;)r=r.nextElementSibling;return r??(r=n),Je(r)?r:null}function Es(e){let t=window.__HF_RENDER_FRAME_VIDEO_IDS;return e.tagName==="VIDEO"&&t?.includes(Fc(e)??"")===!0}function vs(e){if(Es(e))return;e.preload!=="auto"&&(e.preload="auto");let t=e.tagName==="VIDEO"&&e.networkState===2;e.readyState<3&&!t&&e.load()}var Pc=new WeakMap;function b0(e){Pc.get(e)?.()}function y0(e,t){if(b0(e),e.tagName!=="VIDEO"||Es(e))return;let n=()=>{if(!e.isConnected||!e.paused||e.seeking||!t())return;let i=Rn(e);if(!(Math.abs(e.currentTime-i)<=.02))try{e.currentTime=i}catch(a){V("runtime.preload.playbackStart",a)}};if(e.readyState>0){n();return}let r=()=>{e.removeEventListener("loadedmetadata",o),e.removeEventListener("error",r),e.removeEventListener("abort",r),Pc.delete(e)},o=()=>{r(),n()};Pc.set(e,r),e.addEventListener("loadedmetadata",o),e.addEventListener("error",r),e.addEventListener("abort",r)}function Ic(e){b0(e);for(let t of e.querySelectorAll("source"))t.remove();e.removeAttribute("src"),e.load()}function x0(e){if(e.querySelector("source"))return;let t=e.getAttribute("src");Ic(e),t!==null&&e.setAttribute("src",t)}function As(e){return Ge(e.getAttribute("data-duration"))!=null}function S0(){let e=window;if(e.__hfMediaDeferral?.disconnect(),e.__hfMediaDeferral=void 0,!Qa())return;let t=(n,r)=>{Ge(n.getAttribute("data-start"))!=null&&As(n)&&r(n)>0&&(n.preload="none")};e.__hfMediaDeferral=new MutationObserver(n=>{let r=st({}).resolveMediaStartForElement;for(let o of n)for(let i of o.addedNodes){if(i.nodeType!==1)continue;let a=i;a.matches("video, audio")&&t(a,r);for(let l of a.querySelectorAll("video, audio"))t(l,r)}}),e.__hfMediaDeferral.observe(document.documentElement,{childList:!0,subtree:!0})}var Dc=-1,Kr=new Set,E0=new WeakSet,jr,Oc=0;function v0(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){V("runtime.adapters.seek-dispatch.site1",o)}finally{n=!1}t.length!==0&&Qe(Promise.all(t))}function Qe(e,t){let n=e.then(()=>({status:"fulfilled"})).catch(r=>({status:"rejected",reason:r}));Kr.add(n),t==="video-frame"&&E0.add(n),n.then(r=>{Kr.delete(n)&&r.status==="rejected"&&jr===void 0&&(jr={reason:r.reason})})}function ws(e){e!==Dc&&(Dc=e,v0(e))}function _s(e){Dc=e,v0(e)}function A0(){return Oc>0}async function w0(){for(let e=[...Kr];e.length>0;e=[...Kr])await Promise.all(e)}function _0(){return Kr.size>0}async function C0(e){let t=()=>[...Kr].filter(r=>e?.videoFrames!==!1||!E0.has(r));Oc+=1;let n=jr;try{await Promise.resolve();for(let o=t();o.length>0;o=t()){let a=(await Promise.all(o)).find(l=>l.status==="rejected");n===void 0&&a?.status==="rejected"&&(n={reason:a.reason})}let r=jr;if(n===void 0&&(n=r),jr===r&&(jr=void 0),n)throw n.reason}finally{Oc-=1}}function nn(e){return Rn(e)}var T0=["seeked","loadeddata","error","emptied","abort"],Vc=5e3,Cs=new WeakMap;function R0(e){let t=e.readyState<e.HAVE_CURRENT_DATA&&e.networkState===e.NETWORK_LOADING&&!window.__HF_EXPORT_RENDER_SEEK_CONFIG;e.tagName!=="VIDEO"||!(e.seeking||t)||Tt(e)||(Cs.get(e)?.(),Qe(new Promise(n=>{let r=i=>{if(!(i?.type==="loadeddata"&&e.seeking)){clearTimeout(o);for(let a of T0)e.removeEventListener(a,r,!0);Cs.get(e)===r&&Cs.delete(e),n()}},o=setTimeout(r,Vc);for(let i of T0)e.addEventListener(i,r,!0);Cs.set(e,r)}),"video-frame"))}function k0(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 L0(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=[],o=[],i=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=nn(a),c=mt(a),d=Ht(a),f=a.loop,m=Number.isFinite(a.duration)&&a.duration>0?a.duration:null,p=e?.resolveDurationSeconds?.(a)??Number.parseFloat(a.dataset.duration??"");(!Number.isFinite(p)||p<0)&&m!=null&&(p=Math.max(0,cr(d,m-s)));let y=Number.isFinite(p)&&p>=0?l+p:Number.POSITIVE_INFINITY,x=l,E=fr({start:l,end:y},e?.resolveHostSlots?.(a)??[]);(E.start!==l||E.end!==y)&&({start:l,end:y}=E,p=y-l);let v=Number.parseFloat(a.dataset.volume??""),_={el:a,start:l,origin:x,mediaStart:s,duration:Number.isFinite(y)?p:Number.POSITIVE_INFINITY,end:y,volume:Number.isFinite(v)?v:null,playbackRate:c,rate:d,loop:f,sourceDuration:m,fades:hs(a)};r.push(_),a.tagName==="VIDEO"&&o.push(_),Number.isFinite(y)&&(i=Math.max(i,y))}return{timedMediaEls:n,mediaClips:r,videoClips:o,maxMediaEnd:i}}var Bc=new WeakMap,Ts=new WeakMap,ii=new WeakMap,Uc=new WeakSet,Yr=new WeakSet,Hc=new WeakSet;function SR(e){if(Yr.has(e))return;Yr.add(e);let t=()=>Yr.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}var ER=3;function $c(e){return e.error!=null||e.networkState===ER}var Wc=new WeakMap;function Gc(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function Rs(e){Bc.delete(e),Ts.delete(e),ii.delete(e),Uc.delete(e),Wc.delete(e),ai.delete(e)}var qc=.5,zc=1.5;function Ms(e,t){let n=Math.max(0,Math.min(t,e.end)-(e.origin??e.start)),r=e.mediaStart+Hr(e.rate??e.playbackRate,n);if(e.sourceDuration==null)return r;let o=e.sourceDuration-e.mediaStart;return e.loop&&o>0&&r>=e.sourceDuration?e.mediaStart+(r-e.mediaStart)%o:!e.loop&&e.el.tagName==="VIDEO"?Math.min(r,e.sourceDuration):r}function vR(e,t,n,r){let{el:o}=e,i=e.start-t;if(!n||o.tagName!=="VIDEO"||i<=0||i>zc*r||!o.paused||o.seeking||o.readyState<o.HAVE_METADATA||Tt(o)||"__HF_EXPORT_RENDER_SEEK_CONFIG"in window&&window.__HF_EXPORT_RENDER_SEEK_CONFIG)return;let a=Ms(e,e.start);if(!(!Number.isFinite(a)||a<0||Math.abs(o.currentTime-a)<=.001))try{o.currentTime=a}catch(l){V("runtime.media.preseek",l)}}var kn=.04,M0=1/16,AR=.03,wR=[[.3,.25],[.1,.1]],_R=.01,ai=new WeakMap;function CR(e,t,n){let r=Math.sign(t),o=ai.get(e);if(Math.abs(t)>kn)ai.set(e,r);else if(o!==r||Math.abs(t)<=_R)return ai.delete(e),n;let i=Math.abs(t),a=wR.find(([l])=>i>l)?.[1]??AR;return n*(1+r*a)}function N0(e){let t=!!(e.outputMuted||e.userMuted);for(let n of e.clips){let{el:r}=n;if(!r.isConnected)continue;let o=n.rate??n.playbackRate,i=n.origin??n.start,a=r.tagName==="VIDEO"&&!n.loop,l=Mn(e.timeSeconds,n.start,n.end),s=n.start-e.timeSeconds,c=r.tagName==="AUDIO"&&!l&&s>0&&s*Math.max(1,_c(o,n.start-i))<=Math.max(e.cueAheadSeconds??0,Hc.has(r)?kn:0);c?Hc.add(r):Hc.delete(r);let d=a&&!l&&(e.timeSeconds>=n.end||qr(e.timeSeconds,n.end))&&zr(e.timeSeconds,n.start,n.end,e.getCompositionDuration()),f=Ms(n,e.timeSeconds),m=d||a&&n.sourceDuration!=null&&f>=n.sourceDuration&&l,p=Ts.get(r),b=r.tagName==="AUDIO"&&(p===void 0||f<p-.04),y=!n.loop&&n.sourceDuration!=null&&f>=n.mediaStart&&f<n.sourceDuration&&(a||b);if((l||d||c)&&f>=0&&(!r.ended||n.loop||m||y)){Ts.set(r,f);let v=Gc(e.userVolume??1),_=Ue(n.volume??1),U=Wc.get(r),G=Gc(r.volume),R,D=zg(r,e.timeSeconds-i),T=e.isWebAudioRouted?.(r)===!0,H=D===null&&(n.volumeKeyframes?.length??0)>0,I=T?Og(_,H):1;if(D!==null)R=T?1:as(_,D);else if(n.volumeKeyframes&&n.volumeKeyframes.length>0){let ne=e.timeSeconds-i;R=Ue(i0(n.volumeKeyframes,ne))}else T?R=1:U===void 0?R=_>1?_:G:Math.abs(G-U)>1e-4?R=G:R=_;let Y=R,W=n.fades??d0;(W.fadeIn>0||W.fadeOut>0)&&(R*=gs(e.timeSeconds-i,n.duration+n.start-i,W));let ie=r.closest("[data-hidden]")!==null||xs(r.ownerDocument,r)?0:Gc(R*v);Math.abs(r.volume-ie)>1e-6&&(r.volume=ie),Wc.set(r,ie),Y===R?e.onElementVolume?.(r,ie,R,I):e.onElementVolume?.(r,ie,R,I,Y),(t||e.isWebAudioOwned?.(r))&&!r.muted&&(r.muted=!0),r.preload!=="auto"&&!Es(r)&&(r.preload="auto");let F=_c(o,e.timeSeconds-i)*e.playbackRate,z=e.playing&&F>=M0,O=2,N=r.currentTime||0,L=Math.abs(N-f),w=f-N,k=Bc.get(r);Bc.set(r,w);let K=k===void 0,oe=!K&&Math.abs(w-k)>.5,ge=L>3,Ee=r.tagName==="AUDIO"&&K&&N-f>kn,$=m&&L>.001||r.ended&&y&&L>.001||Ee||L>qc&&(K||oe||ge),Q=r.tagName==="VIDEO"&&!r.paused&&z,me=e.playing&&!z||k!==void 0&&Math.abs(w-k)<.004,he=!1;if(!Q&&!$&&!K&&me&&L>kn){let ne=(ii.get(r)??0)+1;ii.set(r,ne),ne>=O&&(he=!0,ii.set(r,0))}else L<=kn&&ii.set(r,0);let le=!Q&&e.forceSync&&L>.02;try{(!Q||$)&&ai.delete(r);let ne=Math.max(M0,Q&&!$?CR(r,w,F):F);Math.abs(r.playbackRate-ne)>1e-6&&(r.playbackRate=ne)}catch(ne){V("runtime.media.site1",ne)}if($||he||le){if(!(r.tagName==="VIDEO"&&!!Tt(r))){try{r.currentTime=f}catch(te){V("runtime.media.site2",te)}if(Math.abs(r.currentTime-f)>.5&&!Uc.has(r)){Uc.add(r),r.load();try{r.currentTime=f}catch(te){V("runtime.media.site3",te)}}R0(r)}Yr.delete(r)}else z||R0(r);m?r.paused||r.pause():z&&r.paused&&!Yr.has(r)&&!$c(r)?(SR(r),r.play().catch(ne=>{Yr.delete(r),(ne&&typeof ne=="object"&&"name"in ne?String(ne.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!z&&!r.paused&&r.pause();continue}let E=Mn(e.timeSeconds,n.start,n.end);Rs(r),E&&Ts.set(r,f),r.paused||r.pause(),vR(n,e.timeSeconds,e.playing,e.playbackRate)}}var jc="css:root",F0=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],TR=new Set([...F0,"contain","isolation","mask-border","mix-blend-mode","opacity"]),RR=new Set(["absolute","relative"]),MR=new Set(["flex","inline-flex","grid","inline-grid"]),kR=new Set(["layout","paint","strict","content"]),LR=new Set(["size","inline-size"]);function NR(e){return e.position==="fixed"||e.position==="sticky"}function FR(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(RR.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&MR.has(n)}function PR(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:F0.some(r=>{let o=e.getPropertyValue(r);return o!==""&&o!=="none"})}function IR(e){return e.getPropertyValue("contain").split(/\s+/).some(n=>kR.has(n))?!0:LR.has(e.getPropertyValue("container-type"))}function DR(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>TR.has(t))}function OR(e,t){return e.hasAttribute(ir)||NR(t)||FR(e,t)||PR(t)||IR(t)?!0:DR(t)}function HR(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 ks(e,t){let n=t?.get(e.parentElement);if(n!==void 0)return n;let r=GR(e);return t?.set(e.parentElement,r),r}function GR(e){let t=e.ownerDocument.defaultView;if(!t)return jc;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(OR(n,t.getComputedStyle(n)))return HR(n)}catch{return jc}n=n.parentElement}return jc}var BR=["width","height","top","left","right","bottom","inset","object-fit","object-position","z-index","opacity","visibility","filter","mix-blend-mode","backdrop-filter","border-width","border-style","border-color","border-radius","overflow","clip-path","mask","mask-image","mask-size","mask-position","mask-repeat","transform","transform-origin","translate","rotate","scale","box-sizing"];function Kc(e){return Number.isFinite(e)&&e>0?e:30}function Yc(e){return Number.isFinite(e)&&e>0?e:0}function Xc(e,t){let n=Kc(t);return Math.floor(Yc(e)*n+1e-9)/n}function I0(e,t,n){let r=Number.isInteger(n)?n:1;if(r<=1)return Xc(e,t);let o=Kc(t)*r;return Math.round(Yc(e)*o)/o}function P0(e,t){let n=Kc(t),r=Yc(e),o=r*n,i=Math.round(o);return Math.abs(o-i)<=.001?i/n:r}function Ls(e,t,n){return{start:P0(e,n),end:Number.isFinite(t)?P0(t,n):t}}function D0(e,t,n=BR){for(let r of n){let o=t.getPropertyValue(r);o&&e.setProperty(r,o)}}function Jc(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}var si="hf-runtime-filler",UR=["seconds-time","rational-fps","seek-keep-playing","composition-manifest-v1","runtime-data","play-range"];function WR(e,t){let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let o=n%r;n=r,r=o}return n||1}function VR(e){let t=Number.isFinite(e)&&e>0?e:30,n=Number.isInteger(t)?1:1e6,r=Math.round(t*n),o=WR(r,n);return{numerator:r/o,denominator:n/o}}function O0(e,t,n){return Math.max(e,(Math.ceil(t*n-1e-6)-1)/n)}function Qc(e){if(typeof e!="object"||e===null)return null;let t=e;return!Number.isFinite(t.numerator)||!Number.isFinite(t.denominator)||(t.numerator??0)<=0||(t.denominator??0)<=0?null:Number(t.numerator)/Number(t.denominator)}function Ns(e){return{protocolVersion:1,capabilities:UR,fps:VR(e)}}function $R(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function H0(e,t=30){if(typeof e!="object"||e===null)return{status:"legacy",fps:t};let n=e;if(n.protocolVersion===void 0)return{status:"legacy",fps:t};if(n.protocolVersion!==1)return{status:"unsupported",code:"unsupported_protocol_version",receivedVersion:n.protocolVersion};let r=Qc(n.fps);return r===null||!$R(n.capabilities)?{status:"unsupported",code:"invalid_protocol_metadata",receivedVersion:n.protocolVersion}:{status:"supported",fps:r,metadata:n}}var G0=e=>e!==null&&Number.isFinite(e)&&e>0;function Xr(e){let t=e.clipEndsSeconds.filter(r=>r===null).length;if(G0(e.authoredDurationSeconds))return{seconds:e.authoredDurationSeconds,source:"authored",pendingClips:t};let n=e.clipEndsSeconds.filter(G0);return n.length>0?{seconds:Math.max(...n),source:"derived",pendingClips:t}:{seconds:null,source:"unresolved",pendingClips:t,reason:t>0?"every clip's length is still pending":"no authored duration and no clip with a length"}}function Zc(){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 Jr=7200,rn=1/60,li=e=>e!==null&&e>rn?e:null;function B0(e){return{width:Ur(e.getAttribute("data-width")),height:Ur(e.getAttribute("data-height"))}}function U0(e,t){let n=[];for(let r of e.querySelectorAll("video[data-start], audio[data-start]")){let o=t.mediaStart(r);if(!Number.isFinite(o))continue;let i=t.mediaDuration(r);i==null||i<=rn||n.push(Math.max(0,o)+i)}return li(Xr({authoredDurationSeconds:null,clipEndsSeconds:n}).seconds)}function W0(e,t){let n=[];for(let o of e.querySelectorAll("[data-composition-id][data-start]")){if(o.parentElement?.closest("[data-composition-id]")!==e)continue;let i=t.resolveStartForElement(o,0),a=t.resolveDurationForElement(o);!Number.isFinite(i)||a==null||a<=0||n.push(Math.max(0,i)+a)}let r=Ge(e.getAttribute("data-duration"));return li(Xr({authoredDurationSeconds:null,clipEndsSeconds:[r,...n]}).seconds)}var qR=e=>e.hasAttribute("data-composition-id")||e.hasAttribute("data-composition-src");function V0(e,t,{unregisteredLottie:n}){let r=[];for(let i of e.querySelectorAll("[data-start]")){let a=t.resolveStartForElement(i,0);if(!Number.isFinite(a))continue;let l=t.resolveDurationForElement(i);l!=null?r.push(Math.max(0,a)+l):(_e(i)||qR(i))&&r.push(null)}(n||e.querySelector("[data-lottie-src]"))&&r.push(null);let o=Xr({authoredDurationSeconds:null,clipEndsSeconds:r});return o.pendingClips>0?{...o,seconds:null,source:"unresolved",reason:"a clip's length is pending"}:o}function $0(e){if(e.declared!==null&&Number.isFinite(e.declared)&&e.declared>0)return e.declared;let t=li(e.timeline()),n=Math.max(0,...e.floors().map(s=>s??0)),r=Number.isFinite(e.fallback)&&e.fallback>rn?e.fallback:0,o=Math.max(n,r),a=t!==null&&t>=Jr&&li(o)!==null?null:t,l;return a!==null?l=Math.max(a,o):li(n)!==null?l=o:r>0?l=r:l=e.derived(),l>0?l:0}function Fs(e,t){let n=e.tagName.toLowerCase();if(n==="script"||n==="style"||n==="link"||n==="meta")return null;let o=n==="video"||n==="audio"?t.resolver.resolveMediaStartForElement(e):t.resolver.resolveStartForElement(e,0),i=t.resolver.resolveDurationForElement(e),a=e.getAttribute("data-composition-id");if(a){let s=t.timelineRegistry[a],c=en(s);!(e.hasAttribute("data-duration")||e.hasAttribute("data-end")||e.hasAttribute(Wr)||e.hasAttribute(Vr))&&(i==null||i<=0)&&c!=null&&c>0&&(i=c)}let l=a!==null&&e===xt(e.ownerDocument);return{start:o,end:!l&&i!=null&&i>0?o+i:Number.POSITIVE_INFINITY}}function Ps(e,t){let n=Fs(e,t);if(!n)return!1;let r=t.exportRenderSeek?Ls(n.start,n.end,t.canonicalFps):n;return zr(t.currentTime,r.start,r.end,t.compositionDuration)}function ci(e){return Ge(e)}function di(e){let t=e.getAttribute("data-duration"),n=e.getAttribute(Wr),r=$r({start:0,duration:t,authoredDuration:n})?.duration;return r??([t,n].map(ci).some(i=>i!=null&&i<=0)?0:null)}function q0(e){return $r({start:0,end:e.getAttribute("data-end"),authoredEnd:e.getAttribute(Vr)})?.end??null}function ed(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 td(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function Qr(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 fi(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 z0(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return fi(t);let n=e.getAttribute("data-composition-src");if(n)return fi(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?fi(r.getAttribute("src")):null}function jR(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 KR(e){if(!e)return null;let t;try{t=new URL(e,document.baseURI).pathname.split("/").filter(Boolean).at(-1)}catch{t=e.replace(/[?#].*$/,"").split(/[\\/]/).filter(Boolean).at(-1)}if(!t)return null;try{return decodeURIComponent(t)}catch{return t}}function YR(e){let t=e.textContent?.replace(/\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function ui(e){let t=e.replace(/\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return t?t.replace(/\b\w/g,n=>n.toUpperCase()):e}function j0(e){return e.getAttribute("data-hf-original-composition-id")??e.getAttribute("data-composition-id")}function XR(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 o=j0(e);if(o)return ui(o);let i=e.id;if(i)return ui(i);let a=jR(e);if(a)return ui(a);let l=KR(z0(e));if(l)return ui(l);let s=YR(e);return s||`${ui(t)} ${n+1}`}function nd(e){let t=new Map,r=window.__timelines??{},o=st({timelineRegistry:r,includeAuthoredTimingAttrs:!0}),i=$=>{if(!$)return null;let Q=en(r[$]);return Q!=null&&Q>0?Q:null},a=()=>{let $=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if($.length===0)return null;let Q=0;for(let Z of $){let me=o.resolveMediaStartForElement(Z);if(!Number.isFinite(me))continue;let he=Gr(Z);he==null||he<=0||(Q=Math.max(Q,Math.max(0,me)+he))}return Q>0?Q:null},l=($,Q)=>{let Z=[],me=null,he=null,le=null,ne=$.parentElement;for(;ne;){let te=ne.getAttribute("data-composition-id");te&&(Z.push(te),!le&&ne!==Q&&(le=te),me==null&&(me=o.resolveStartForElement(ne,0)),he==null&&(he=ci(ne.getAttribute("data-duration"))??i(te)??null)),ne=ne.parentElement}return{parentCompositionId:le,compositionAncestors:Z.reverse(),inheritedStart:me,inheritedDuration:he}},s=xt(),c=Array.from(document.querySelectorAll("[data-composition-id]")),d=s?.getAttribute("data-composition-id")??null,f=s?o.resolveStartForElement(s,0):0,m=a(),p=m!=null?Math.max(0,m-Math.max(0,f)):null,b=i(d),y=di(s??document.body),x=td(...c.filter($=>$!==s).map($=>{let Q=o.resolveStartForElement($,0),Z=o.resolveDurationForElement($)??i($.getAttribute("data-composition-id"))??null;return!Number.isFinite(Q)||Z==null||Z<=0?null:Math.max(0,Q)+Z})),E=x!=null?Math.max(0,x-Math.max(0,f)):null,v=typeof b=="number"&&Number.isFinite(b)&&b>0?b:null,_=typeof y=="number"&&Number.isFinite(y)&&y>0?y:null,U=typeof p=="number"&&Number.isFinite(p)&&p>0?p:null,G=typeof E=="number"&&Number.isFinite(E)&&E>0?E:null,R=td(U,G),D=v!=null&&R!=null&&v>=Jr,H=_??(D?R:td(v,U,G))??null,Y=(H!=null?f+H:null)??(typeof m=="number"&&Number.isFinite(m)&&m>0?m:null),W=($,Q)=>!Number.isFinite(Q)||Q<=0?0:Y==null||!Number.isFinite(Y)?Q:!Number.isFinite($)||$>=Y?0:Math.max(0,Math.min(Q,Y-$)),X=[],ie=[],F="[data-start], [data-track-index], [data-composition-id], video, audio, img",z=Array.from(document.querySelectorAll(F)),O=0,N=($,Q)=>{if($===s||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes($.tagName))return null;let Z=l($,s),me=$.tagName.toLowerCase(),he=me==="video"||me==="audio"?o.resolveMediaStartForElement($):o.resolveStartForElement($,Z.inheritedStart??0),le=$.getAttribute("data-composition-id"),ne=!!le&&le!==d,te=di($);if(te==null&&ne&&(te=i(le)),te==null&&_e($)&&Number.isFinite($.duration)&&(te=Gt($,$.duration)),te==null&&(te=Br($,he)),te==null){let Te=Z.inheritedDuration;if(Te!=null&&Te>0){let _r=(Z.inheritedStart??0)+Te;te=Math.max(0,_r-he)}}if(te==null||te<=0||(te=W(he,te),te<=0))return null;let We=o.resolveHostSlotsForElement($);if(We.length>0){let Te=fr({start:he,end:he+te},We),ut=ne;if(Te.end<=Te.start&&!ut)return null;he=Te.start,te=Te.end-Te.start}let ke=le&&le!==d?"composition":me==="video"?"video":me==="audio"?"audio":me==="img"?"image":"element";return{id:Cc($)??le??null,label:XR($,ke,X.length),start:he,duration:te,track:Qr($,Q),zIndex:ed($),stackingContextId:ks($,t),kind:ke,tagName:me,compositionId:$.getAttribute("data-composition-id"),compositionAncestors:Z.compositionAncestors,parentCompositionId:Z.parentCompositionId,nodePath:null,compositionSrc:fi($.getAttribute("data-composition-src")),playbackStart:nn($),playbackRate:mt($),assetUrl:z0($),timelineRole:$.getAttribute("data-timeline-role"),timelineLabel:$.getAttribute("data-timeline-label"),timelineGroup:$.getAttribute("data-timeline-group"),timelinePriority:ci($.getAttribute("data-timeline-priority"))}},L=$=>{X.push($),O=Math.max(O,$.start+$.duration)};for(let[$,Q]of z.entries()){let Z=N(Q,$);Z&&L(Z)}for(let $ of e.parked??[]){let Q=e.parkedClips?.get($.name);if(!Q){let Z=z.length;Q=Array.from($.host().querySelectorAll(F)).flatMap((me,he)=>N(me,Z+he)??[]),e.parkedClips?.set($.name,Q)}for(let Z of Q)L(Z)}let w=new Set(X.map($=>$.id)),k=s?.getAttribute("data-composition-id")??null,K=k?r[k]??null:null;if(K&&s){let $=K;if(typeof $.getChildren=="function")try{let Q=$.getChildren(!0,!0,!1)??[],Z=new Map;for(let le of s.children){let ne=le;if(!ne.id)continue;let te=ne.tagName.toLowerCase();te==="script"||te==="style"||te==="link"||Z.set(ne,{id:ne.id,start:1/0,end:-1/0})}let me=le=>{let ne=le;for(;ne;){if(Z.has(ne))return ne;if(ne===s)return null;ne=ne.parentElement}return null};for(let le of Q){if(typeof le.targets!="function"||typeof le.startTime!="function"||typeof le.duration!="function")continue;let ne=le.startTime(),te=le.parent;for(;te&&te!==K&&typeof te.startTime=="function";)ne+=te.startTime(),te=te.parent;let We=ne+le.duration();if(!(!Number.isFinite(ne)||!Number.isFinite(We)))for(let ke of le.targets()){if(!Oe(ke))continue;let Te=me(ke);if(!Te)continue;let ut=Z.get(Te);ut&&(ut.start=Math.min(ut.start,ne),ut.end=Math.max(ut.end,We))}}let he=X.length>0?Math.max(...X.map(le=>le.track))+1:0;for(let[le,ne]of Z){if(ne.start===1/0||ne.end===-1/0)continue;let te=le;if(w.has(te.id))continue;let We=Math.max(0,ne.end-ne.start);if(We<=0)continue;let ke=W(ne.start,We);ke<=0||(O=Math.max(O,ne.start+ke),X.push({id:te.id,label:te.getAttribute("data-timeline-label")??te.getAttribute("data-label")??te.getAttribute("aria-label")??te.id,start:ne.start,duration:ke,track:Qr(te,he),zIndex:ed(te),stackingContextId:ks(te,t),kind:"element",tagName:te.tagName.toLowerCase(),compositionId:te.getAttribute("data-composition-id"),compositionAncestors:k?[k]:[],parentCompositionId:k,nodePath:null,compositionSrc:null,playbackStart:nn(te),playbackRate:mt(te),assetUrl:null,timelineRole:te.getAttribute("data-timeline-role"),timelineLabel:te.getAttribute("data-timeline-label"),timelineGroup:te.getAttribute("data-timeline-group"),timelinePriority:ci(te.getAttribute("data-timeline-priority"))}),w.add(te.id))}}catch(Q){V("runtime.timeline.site1",Q)}}if(s&&H!=null&&H>0){let $=X.length>0?Math.max(...X.map(Q=>Q.track))+1:0;for(let Q of s.children){let Z=Q;if(!Z.id||w.has(Z.id))continue;let me=Z.getAttribute("data-timeline-role");if(me!=="overlay"&&me!=="persistent-overlay")continue;let he=Z.tagName.toLowerCase();if(he==="script"||he==="style"||he==="link"||he==="meta"||window.getComputedStyle(Z).display==="none")continue;let ne=W(0,H);ne<=0||(O=Math.max(O,ne),X.push({id:Z.id,label:Z.getAttribute("data-timeline-label")??Z.getAttribute("data-label")??Z.getAttribute("aria-label")??Z.id,start:0,duration:ne,track:Qr(Z,$),zIndex:ed(Z),stackingContextId:ks(Z,t),kind:"element",tagName:he,compositionId:Z.getAttribute("data-composition-id"),compositionAncestors:k?[k]:[],parentCompositionId:k,nodePath:null,compositionSrc:null,playbackStart:nn(Z),playbackRate:mt(Z),assetUrl:null,timelineRole:me,timelineLabel:Z.getAttribute("data-timeline-label"),timelineGroup:Z.getAttribute("data-timeline-group"),timelinePriority:ci(Z.getAttribute("data-timeline-priority"))}),w.add(Z.id))}}for(let $ of c){if($===s)continue;let Q=$.getAttribute("data-composition-id");if(!Q||!Jc(Q))continue;let Z=o.resolveStartForElement($,0),me=di($);if((me==null||me<=0)&&q0($)!=null){let te=q0($);me=Math.max(0,te-Z)}let he=i(Q),le=me&&me>0?me:he;if(le==null||le<=0)continue;let ne=W(Z,le);ne<=0||ie.push({id:Q,label:$.getAttribute("data-label")??j0($)??Q,start:Z,duration:ne,thumbnailUrl:fi($.getAttribute("data-thumbnail-url")),avatarName:null})}let oe=Math.max(O||0,H??0),ge=oe>0?oe:1,Ee=Math.max(1,Math.ceil(ge*Math.max(1,e.canonicalFps)));return{...Ns(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:ge,durationInFrames:Ee,clips:X,scenes:ie,compositionWidth:Ur(s?.getAttribute("data-width"))??1920,compositionHeight:Ur(s?.getAttribute("data-height"))??1080}}var Ln=new Map,rd=(e,t="")=>`${t}[${ft}="${CSS.escape(e)}"]`,K0=e=>di(e)??0,od=e=>Array.from(e.querySelectorAll("video, audio, [data-composition-id]")).every(t=>K0(t)>0),JR=e=>{let t=e.parentElement;return!e.hasAttribute(wn)&&!e.hasAttribute("data-hf-original-composition-id")&&(mr(e)||od(e))&&t?.hasAttribute("data-composition-id")===!0&&t.closest(`[${ft}]`)===null};function Y0(){return document.querySelector(`meta[name="${An}"]`)?Array.from(document.querySelectorAll(`[${ft}]:not(style, script)`)).flatMap(e=>{let t=Number(e.getAttribute("data-start")?.trim()||Number.NaN),n=K0(e),r=e.getAttribute(ft);return Number.isFinite(t)&&n>0&&JR(e)?[{name:r,host:e,start:t,end:t+n}]:[]}).sort((e,t)=>e.start-t.start):[]}var id=()=>Y0().filter(({name:e})=>Ln.has(e)).map(({name:e,start:t,end:n})=>({name:e,start:t,end:n})),QR=10;function Is(e,t,n){let r=e.find(i=>i.start>t),o=i=>i.start<=t?t<=i.end:n?i.start<=t+QR:i===r;return new Set(e.filter(o).map(i=>i.name))}var mi=e=>document.querySelector(`${rd(e)}:not(style, script)`),mr=e=>e.hasAttribute(vn);function ad(e){let t=mi(e);if(!t||mr(t))return t;for(let r of document.querySelectorAll(rd(e,"script")))r.remove();let n=t.cloneNode(!1);return n.setAttribute(vn,""),t.replaceWith(n),n}function X0(e){let t=mi(e),n=Ln.get(e);if(!t||!mr(t)||!n)return null;let r=document.createElement("template");r.innerHTML=n.html;let o=document.importNode(r.content.firstElementChild,!0);for(let{name:i,value:a}of Array.from(t.attributes))i!==vn&&o.setAttribute(i,a);return t.replaceWith(o),{host:o,placeholder:t,scripts:n.scripts.map(i=>i.cloneNode(!0))}}function J0(e=0){Ln.clear(),Ds.clear();let t=Y0(),n=Is(t,e,!1);for(let{name:r,host:o}of t){let i=Array.from(document.querySelectorAll(rd(r,"script")));Ln.set(r,{html:o.outerHTML,scripts:i.map(a=>a.cloneNode(!0))}),n.has(r)||ad(r)}}function sd(e,t,n){Ln.has(e)&&(Ds.delete(e),Ln.set(e,{html:t.outerHTML,scripts:n.map(r=>r.cloneNode(!0))}))}var Ds=new Map,Q0=e=>{let t=mr(e)?e.getAttribute(ft):null;return t!==null&&Ln.has(t)&&e.parentElement?t:null};function ld(e){let t=Q0(e);if(t===null)return null;let n=e.parentElement.cloneNode(!1),r=document.createElement("template");return r.innerHTML=Ln.get(t).html,n.append(r.content),n.firstElementChild}var Z0=()=>Array.from(document.querySelectorAll(`[${vn}]`)).flatMap(e=>{let t=Q0(e);return t===null?[]:[{name:t,host:()=>ld(e)}]});var ZR=e=>(e.timeScale?.()??1)===1&&(e.repeat?.()??0)===0,eb=(e,t)=>t+(e.startTime?.()??0),e1=(e,t)=>t+(e.totalDuration?.()??1/0),t1=e=>e.targets?.()??[];function n1(e,t){for(let n=Oe(e)?e:null;n;n=n.parentElement)n.hasAttribute(Be)&&t.add(n)}function tb(e,t,n){let r=new Set,o=(c,d)=>d>t&&c<=n,i=c=>c.getChildren?.(!1,!1,!0)??[],a=(c,d)=>c.getChildren?.(!1,!0,!1,t-d)??[],l=(c,d)=>{let f=eb(c,d);if(f>t&&f<=n)for(let m of t1(c))n1(m,r)},s=(c,d)=>{let f=i(c).every(m=>{let p=eb(m,d);return ZR(m)&&(!o(p,e1(m,p))||s(m,p))});if(f)for(let m of a(c,d))l(m,d);return f};return s(e,0)?r:null}var nb=30;function rb(e){nb=Number.isFinite(e)&&e>0?e:30}function Ce(e){try{window.parent.postMessage({...e,...Ns(nb)},"*")}catch(t){V("bridge.postMessage",t)}}var r1=new Map(Object.entries({play:(e,t)=>t.onPlay(),pause:(e,t)=>t.onPause(),"stop-media":(e,t)=>t.onStopMedia(),seek:(e,t)=>t.onSeek(o1(e,t),e.seekMode??"commit"),tick:(e,t)=>t.onTick(),"set-muted":(e,t)=>t.onSetMuted(!!e.muted),"set-volume":(e,t)=>t.onSetVolume(Math.max(0,Math.min(1,Number(e.volume??1)))),"set-media-output-muted":(e,t)=>t.onSetMediaOutputMuted(!!e.muted),"set-native-media-sync-disabled":(e,t)=>t.onSetNativeMediaSyncDisabled(!!e.disabled),"set-web-audio-media-disabled":(e,t)=>t.onSetWebAudioMediaDisabled(!!e.disabled),"set-playback-rate":(e,t)=>t.onSetPlaybackRate(Number(e.playbackRate??1)),"set-idle-heartbeat":(e,t)=>t.onSetIdleHeartbeat(!!e.slow),"set-display-scale":(e,t)=>t.onSetDisplayScale?.(Number(e.scale)),"set-preview-quality":(e,t)=>t.onSetPreviewQuality?.(Number(e.level)),"retry-preview-copies":(e,t)=>t.onRetryPreviewCopies?.(),"request-preview-facts":(e,t)=>t.onRequestPreviewFacts?.(),"set-root-duration":(e,t)=>t.onSetRootDuration(Number(e.durationSeconds??0)),"set-play-range":(e,t)=>t.onSetPlayRange(Number(e.startSeconds??0),e.endSeconds==null?null:Number(e.endSeconds)),"set-color-grading":(e,t)=>t.onSetColorGrading(e.target??null,e.grading??null),"set-color-grading-compare":(e,t)=>t.onSetColorGradingCompare(e.target??null,e.compare??null),"enable-pick-mode":(e,t)=>t.onEnablePickMode(),"disable-pick-mode":(e,t)=>t.onDisablePickMode(),"flash-elements":e=>a1(e),"set-runtime-data":(e,t)=>{typeof e.channel=="string"&&t.onSetRuntimeData?.(e.channel,e.payload,e.requestId)},"clear-runtime-data":(e,t)=>{typeof e.channel=="string"&&t.onClearRuntimeData?.(e.channel,e.requestId)}}));function o1(e,t){let n=Number(e.timeSeconds);if(Number.isFinite(n))return Math.max(0,n);let o=Qc(e.fps)??t.getCanonicalFps();return Math.max(0,Number(e.frame??0))/o}function i1(e){let t=H0(e);return t.status!=="unsupported"?!1:(Ce({source:"hf-preview",type:"diagnostic",code:`runtime.protocol.${t.code}`,details:{receivedVersion:typeof t.receivedVersion=="string"||typeof t.receivedVersion=="number"?t.receivedVersion:null}}),!0)}function a1(e){let t=e.selectors,n=e.duration||800;t&&s1(t,n)}function ob(e){let t=n=>{if(n.source!==window.parent&&n.source!==window)return;let r=n.data;if(!r||r.source!=="hf-parent"||r.type!=="control"||i1(r))return;let o=r.action;if(typeof o!="string")return;let i=r1.get(o);i&&i(r,e)};return window.addEventListener("message",t),Ce({source:"hf-preview",type:"ready"}),t}function s1(e,t){if(!document.getElementById("__hf-flash-styles")){let n=document.createElement("style");n.id="__hf-flash-styles",n.textContent=`
|
|
34
34
|
.__hf-flash {
|
|
35
35
|
outline: 2px solid rgba(59, 130, 246, 0.6) !important;
|
|
36
36
|
outline-offset: 2px !important;
|
|
@@ -40,8 +40,8 @@ https://www.w3ctech.com/topic/2226`));let l=n(...a);return l.postcssPlugin=t,l.p
|
|
|
40
40
|
0% { outline-color: rgba(59, 130, 246, 0.8); }
|
|
41
41
|
100% { outline-color: transparent; }
|
|
42
42
|
}
|
|
43
|
-
`,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(o=>{o.classList.add("__hf-flash"),setTimeout(()=>o.classList.remove("__hf-flash"),t)})}catch(r){V("bridge.flashElements.querySelector",r)}}var pi={windowSeconds:3,choppyShare:.25,warmupSeconds:1,reportEveryMs:1e3},l1=.5,on=[],Os=null,ud=0,ib="",cd=!1,dd=0;function sb(e){Ce({source:"hf-preview",type:"preview-health",health:e})}function hi(){on=[],Os=null,cd&&sb(null),cd=!1,dd=0}var ab=null;function lb(e){e!==ab&&(ab=e,hi())}function Hs(){hi()}function u1(e,t,n){let r=pi.windowSeconds*1e3;for(;on[0]&&on[0].atMs<e-r;)on.shift();let o=on[0];if(!o)return;let i=e-(o.atMs-o.gapMs);if(i<r||e-dd<pi.reportEveryMs)return;let a=on.filter(f=>f.drawn).length,l=i/1e3*t*n,s=l>0?1-Math.min(a,l)/l:0,c=on.reduce((f,m)=>f+(m.waiting?m.gapMs:0),0),d=Math.max(s,c/i);cd=!0,dd=e,sb({droppedShare:Math.round(d*1e3)/1e3,seconds:Math.round(i/100)/10,choppy:d>=pi.choppyShare,fps:Math.round(a/(i/1e3)*10)/10,worstFrameMs:Math.round(Math.max(...on.map(f=>f.gapMs))),mode:"play"})}function ub(e){let{nowMs:t,filmTime:n,fps:r,rate:o}=e,i=`${r}|${o}|${e.layoutKey}`;if(!e.playing||e.hidden){hi();return}i!==ib&&(ib=i,hi());let a=Math.floor(n*r+1e-6),l=Os;if(Os={ms:t,film:n,frame:a},!l){ud=t+pi.warmupSeconds*1e3;return}let s=t-l.ms,c=l.film+s/1e3*o;if(n<l.film||n>c+l1){hi(),Os={ms:t,film:n,frame:a},ud=t+pi.warmupSeconds*1e3;return}t<ud||(on.push({atMs:t,gapMs:s,drawn:a!==l.frame,waiting:e.waiting}),u1(t,r,o))}var c1=1e3,pr=new Map,fd=!1,cb=!1,gi,Gs=!1;function d1(){for(let r of pr.keys())r.isConnected||pr.delete(r);let e=[...pr.values()],t=fd&&e.length>0;if(!t&&!cb)return!1;cb=t;let n=e.reduce((r,o)=>r+(o.state==="ready"?1:o.progress??0),0);return Ce({source:"hf-preview",type:"preview-copies",copies:t?{total:e.length,ready:e.filter(r=>r.state==="ready").length,failed:e.filter(r=>r.state==="failed").length,progress:n/e.length,error:e.some(r=>r.state==="failed")?"failed":null}:null}),!0}function md(){if(gi!==void 0){Gs=!0;return}d1()&&(gi=setTimeout(()=>{gi=void 0,Gs&&(Gs=!1,md())},c1))}function db(e){pr.clear(),fd=e<1,clearTimeout(gi),gi=void 0,Gs=!1,md()}function Nn(e,t,n=null){fd&&(pr.set(e,{state:t,progress:n}),md())}function fb(){return[...pr].filter(([,e])=>e.state==="failed").map(([e])=>e)}function mb(){return[...pr.values()].every(e=>e.state==="ready")}var pd=null;function pb(e){pd=e}function St(e,t){if(pd)try{pd({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){V("runtime.analytics.site1",n)}}function f1(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 o=t.slice(n,r);return o.length>0?o:"node"}function Zr(e){return`--${f1(e)}`}function hb(e){let t=new Map;for(let n of e){let r=Zr(n),o=t.get(r);o?o.includes(n)||o.push(n):t.set(r,[n])}return[...t.values()].filter(n=>n.length>1)}function bb(){if(typeof document>"u")return{};let e=new Set;document.documentElement?.hasAttribute("data-composition-variables")&&e.add(document.documentElement);for(let o of Array.from(document.querySelectorAll("[data-composition-variables]")))e.add(o);let t={};for(let o of e)Object.assign(t,bi(o));let n=Us(),r={...t,...n};for(let o of e)gd(o,r);return r}var gb=new Set;function yb(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 m1(e,t){return t?.trim()||e.getAttribute("data-composition-id")?.trim()||e.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()||"composition"}function p1(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 h1(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=p1(e);return r.length===0||r.some(o=>String(o)===String(n))?null:{id:e.id,value:n,allowed:r}}function gd(e,t,n){if(!e)return;let r=yb(e);if(r.length===0)return;let o=m1(e,n);for(let i of r){let a=h1(i,t);if(!a)continue;let l=`${o}|${a.id}|${String(a.value)}`;if(gb.has(l))continue;gb.add(l);let s="default"in i?JSON.stringify(i.default):"the composition default";globalThis.console.warn(`[hyperframes] runtime_unknown_enum_value: ${o} variable "${a.id}" got ${JSON.stringify(a.value)}, which is not a declared option (${a.allowed.join(", ")}). Rendering ${s} instead.`)}}function bi(e){let t={};for(let n of yb(e))typeof n.id!="string"||!("default"in n)||(t[n.id]=n.default);return t}var hd="data-hf-css-vars";function Bs(e){return"style"in e&&typeof e.style?.setProperty=="function"}function bd(e,t){if(!Bs(e))return;let n=[];for(let[r,o]of Object.entries(t))if(typeof o=="string"&&o!==""||typeof o=="number"){let i=Zr(r);e.style.setProperty(i,String(o)),n.push(i)}n.length>0&&e.setAttribute(hd,n.join(" "))}function xb(e,t,n){let r={};for(let[o,i]of Object.entries(t)){let a=Zr(o);((Bs(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(r[o]=i)}return r}function Sb(e){if(!Bs(e))return;let t=e.getAttribute(hd);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(hd)}}function Eb(e){let t=new Set;e.documentElement?.hasAttribute("data-composition-variables")&&t.add(e.documentElement);for(let o of Array.from(e.querySelectorAll("[data-composition-variables]")))t.add(o);let n=Us(),r=[];for(let o of t)r.push(...g1(o,n,e.defaultView));for(let o of hb(r))globalThis.console.warn(`composition variables ${o.join(", ")} collapse to the same CSS property ${Zr(o[0]??"")}. Rename one to avoid cross-talk`)}function g1(e,t,n){if(!Bs(e))return[];let r=bi(e),o={};for(let[i,a]of Object.entries(r)){if(i in t)continue;let l=Zr(i);(e.style.getPropertyValue(l)||(n?n.getComputedStyle(e).getPropertyValue(l):"")).trim()===""&&(o[i]=a)}for(let[i,a]of Object.entries(t))i in r&&(o[i]=a);return bd(e,o),Object.keys(r)}function vb(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 Us(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}function Ws(e,t,n,r){let o=!1;try{e.pause()}catch(i){o=!0,V(r,i)}try{e.currentTime=t}catch(i){V(n,i)}if(o)try{e.pause()}catch(i){V(r,i)}}function Ab(e){let t=[],n=(m,p=()=>m.getAnimations())=>{if(typeof m.getAnimations!="function")return[];try{return p()}catch{return[]}},r=m=>{let p=new Map;if(t.length===0)return p;let b=typeof CSSAnimation<"u";for(let y of n(document,m)){if(b&&!(y instanceof CSSAnimation))continue;let x=y.effect;if(!x?.target||x.pseudoElement)continue;let E=p.get(x.target);E?E.push(y):p.set(x.target,[y])}return p},o=(m=[],p=[])=>[...p,...m.filter(b=>!p.includes(b)&&b.playState!=="idle")],i=m=>{let p=m.closest("[data-start]")??m;return e?.resolveStartSeconds?e.resolveStartSeconds(p):Number.parseFloat(p.getAttribute("data-start")??"0")||0},a=m=>{let p=v=>(v||"").split(",").map(_=>Number.parseFloat(_)/(_.trim().endsWith("ms")?1e3:1)),b=p(m.animationDuration),y=p(m.animationDelay),x=m.animationName.split(","),E=0;return x.forEach((v,_)=>{if(v.trim()==="none")return;let U=y[_%y.length]+b[_%b.length];U>E&&(E=U)}),{cycleSeconds:E,delays:x.map((v,_)=>y[_%y.length]||0)}},l=(m,p)=>{let b=null;try{b=m.effect?.getComputedTiming?.()??null}catch(x){V("runtime.adapters.css.site5",x)}if(!b)return{};let y=Number(b.endTime);return Number.isFinite(y)?{endSeconds:p+y/1e3}:{unbounded:!0}},s=(m,p)=>{for(let b of m)Ws(b,p,"runtime.adapters.css.site1","runtime.adapters.css.site2")},c=m=>{for(let p of m)try{p.play()}catch(b){V("runtime.adapters.css.site3",b)}},d=m=>{for(let p of m)try{p.pause()}catch(b){V("runtime.adapters.css.site4",b)}},f=m=>{m.baseDelay?m.el.style.animationDelay=m.baseDelay:m.el.style.removeProperty("animation-delay"),m.basePlayState?m.el.style.animationPlayState=m.basePlayState:m.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{for(let b of t)f(b);let m=new Map(t.map(b=>[b.el,b.handles]));t=[];let p=document.querySelectorAll("*");for(let b of p){if(!we(b))continue;let y=window.getComputedStyle(b);!y.animationName||y.animationName==="none"||t.push({el:b,baseDelay:b.style.animationDelay||"",basePlayState:b.style.animationPlayState||"",...a(y),handles:m.get(b)})}},getAnimationCycleEndSeconds:()=>{let m=0;for(let p of t)!p.el.isConnected||p.cycleSeconds<=0||(m=Math.max(m,i(p.el)+p.cycleSeconds));return m>0?m:null},getInferredDurationSeconds:()=>{let m=0;for(let p of t){if(!p.el.isConnected)continue;let b=i(p.el);for(let y of n(p.el)){let x=l(y,b);x.endSeconds!=null&&(m=Math.max(m,x.endSeconds))}}return m>0?m:null},seek:m=>{let p=Number(m.time)||0,b=r(m.pageAnimations);for(let y of t)y.handles=o(y.handles,b.get(y.el));for(let y of t){if(!y.el.isConnected)continue;let x=i(y.el),E=Math.max(0,p-x)*1e3;if(y.handles?.length){y.el.style.animationDelay!==y.baseDelay&&f(y),s(y.handles,E);continue}y.el.style.animationPlayState="paused",y.el.style.animationDelay=y.delays.map(v=>`${Number((v-E/1e3).toFixed(3))}s`).join(", ")}},pause:m=>{let p=r(m?.pageAnimations);for(let b of t){if(!b.el.isConnected)continue;let y=p.get(b.el);y&&(d(y),f(b))}},play:()=>{let m=r();for(let p of t)p.el.isConnected&&(f(p),c(m.get(p.el)??[]))},revert:()=>{t=[]}}}function qs(e,t,n){e.totalDuration?.();let r=e.getChildren?.(!1,!0,!0)??[],o=v1(e,n,t).map(s=>[s,s.ratio,s._zTime,s._act]),i=Tb(r,t).map(s=>[s,s._ts]),a=new Set;for(let[s]of i)for(let c=s.parent;c&&!a.has(c);c=c.parent)a.add(c);let l=[...a].map(s=>[s,s._dur,s._tDur,s._end,s._dirty]);for(let[s]of i)s._ts=0;try{b1(e,r,t,n)}finally{for(let[s,c]of i)s._ts=c;for(let[s,c,d,f,m]of l)Object.assign(s,{_dur:c,_tDur:d,_end:f,_dirty:m})}for(let[s,c,d,f]of o)s.ratio=c,s._zTime=d,s._act=f}function b1(e,t,n,r){let o=n>=Vs;e.totalTime(o?n-Vs:n+Vs,!0),Lb(t,n,o?Vs:0),e.totalTime(n,!0),!o&&r&&Cb(e,r,n)}function Cb(e,t,n){for(let r of E1(e,t,n)){let{ratio:o,_zTime:i,_act:a}=r;r.render(0,!0,!0),Object.assign(r,{ratio:o,_zTime:i,_act:a})}}function y1(e){let t=e,[n]="_first"in t?t._first?[t._first]:[]:e.getChildren?.(!1,!0,!0)??[],r=n?.parent;return r!==void 0&&!r._initted}function yi(e,t,n,r){if(typeof e.totalTime!="function")return typeof e.seek=="function"&&e.seek(t,n),!1;let o=Number(e.totalTime());return e.totalTime(t,n),t<o&&r&&Cb(e,r,t),o!==t||!y1(e)?!1:(qs({totalTime:e.totalTime.bind(e),totalDuration:e.totalDuration?.bind(e),getChildren:e.getChildren?.bind(e)},t,r),!0)}var yd=1e-6;function Tb(e,t,n=[]){for(let r of e)r.startTime()>t+yd?n.push(r):r.getChildren&&r.endTime()>=t&&Tb(r.getChildren(!1,!0,!0),r.time(),n);return n}function Rb(e){return(e.getChildren?.(!0,!0,!0)??[]).filter(t=>{let n=t;return typeof n.getChildren=="function"||n.totalDuration?.()===0})}var wb=new WeakMap,_b=.05;function x1(e,t){let n=Number(e._start);for(let r=e.parent;r&&r!==t;r=r.parent){if(r._repeat||!r._ts)return null;n=Number(r._start)+n/r._ts}return Number.isFinite(n)?n:null}function S1(e,t){let n={version:t.version,always:[],points:[]};for(let r of Rb(e)){let o=r,i=typeof o.getChildren=="function"?null:x1(o,t.owner);i===null?n.always.push(r):n.points.push({at:i,mark:r})}return n.points.sort((r,o)=>r.at-o.at),n}function Mb(e,t){let n=0,r=e.length;for(;n<r;){let o=n+r>>1;e[o].at<t?n=o+1:r=o}return n}function kb(e,t){let n=wb.get(t.owner);return n?.version!==t.version&&(n=S1(e,t),wb.set(t.owner,n)),n}function E1(e,t,n){let{points:r}=kb(e,t),o=[];for(let i=Mb(r,n-yd);i<r.length&&!(r[i].at>n+yd);i++)o.push(r[i].mark);return o}function v1(e,t,n){if(!t)return Rb(e);let r=kb(e,t),{points:o}=r,i=[...r.always],a=n+_b;for(let l=Mb(o,n-_b);l<o.length&&!(o[l].at>a);l++)i.push(o[l].mark);return i}var $s=2e-8,Vs=.001,A1=e=>{let t=e;return typeof t?.render=="function"&&typeof t.startTime=="function"&&typeof t.paused=="function"&&typeof t.timeScale=="function"&&t.timeScale()>0&&!t.paused()};function w1(e){return e.vars?.keyframes&&(e.render($s,!0),e.render(-$s,!0)),e._startAt&&e._startAt.render($s,!0,!0),!!(e.vars?.keyframes||e._startAt)}function Lb(e,t,n){for(let r of e.filter(A1)){let o=(t-r.startTime())*r.timeScale();Math.abs(o)<1e-9&&w1(r)||o>0&&_1(r,o,n*r.timeScale())}}function _1(e,t,n){t<n&&e._startAt&&e._startAt.render($s,!0,!0);let r=e.getChildren?e:e.timeline;r?.getChildren&&t<=e.totalDuration()&&Lb(r.getChildren(!1,!0,!0),t,n)}function Nb(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),o=t.suppressEvents===!0;typeof n.totalTime=="function"?(n.totalTime(r,o),qs({totalTime:n.totalTime.bind(n),totalDuration:n.totalDuration?.bind(n),getChildren:n.getChildren?.bind(n)},r)):n.seek(r,o)},pause:()=>{let t=e.getTimeline();t&&t.pause()}}}function Fb(){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 o of t)r.has(o)||n.push(o);window.__hfAnime=n}catch(e){V("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(o){V("runtime.adapters.animejs.site2",o)}},pause:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.pause=="function"&&t.pause()}catch(n){V("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){V("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function Ob(e){let t=r=>{let o=Ib(r),i=o&&typeof o.closest=="function"?o.closest("[data-composition-id]"):null;return i&&e?.resolveStartSeconds?e.resolveStartSeconds(i):0},n=(r,o)=>Math.max(0,o-t(r));return{name:"lottie",discover:()=>{try{let r=window.lottie;if(r&&typeof r.getRegisteredAnimations=="function"){let o=r.getRegisteredAnimations();if(Array.isArray(o)&&o.length>0){let i=window.__hfLottie??[],a=new Set(i);for(let l of o)a.has(l)||i.push(l);window.__hfLottie=i}}}catch(r){V("runtime.adapters.lottie.site1",r)}},seek:r=>{let o=Math.max(0,Number(r.time)||0),i=window.__hfLottie;if(!(!i||i.length===0))for(let a of i)try{let l=n(a,o),s=a.loop===!0;if(zs(a)){let c=l*a.frameRate;a.totalFrames>0&&s?a.goToAndStop(xd(c,a.totalFrames),!0):a.totalFrames>0&&c>=a.totalFrames?a.goToAndStop(a.totalFrames-1,!0):a.goToAndStop(l*1e3,!1)}else if(Sd(a)){if(typeof a.setFrame=="function"){let c=a.totalFrames??0,d=a.duration??0;if(!Number.isFinite(c)||c<=0||!Number.isFinite(d)||d<=0)continue;let f=l*c/d;a.setFrame(Math.min(s?xd(f,c):f,c-1))}else if(typeof a.setCurrentRawFrameValue=="function"){let c=a.totalFrames??0,d=a.frameRate??30,f=s&&c>0?xd(l*d,c):l*d;c>0&&a.setCurrentRawFrameValue(Math.min(f,c-1))}else if(typeof a.seek=="function"){let c=a.duration??0;if(Number.isFinite(c)&&c>0){let d=Math.min(100,(s?l%c:l)/c*100);a.seek(d)}}}}catch(l){V("runtime.adapters.lottie.site2",l)}},pause:()=>{let r=window.__hfLottie;if(!(!r||r.length===0))for(let o of r)try{(zs(o)||Sd(o))&&o.pause()}catch(i){V("runtime.adapters.lottie.site3",i)}},revert:()=>{},getInferredDurationSeconds:()=>Pb((r,o)=>o),getAnimationCycleEndSeconds:()=>Pb((r,o)=>Ib(r)?.isConnected===!1?null:t(r)+o)}}function Pb(e){let t=window.__hfLottie;if(!t||t.length===0)return null;let n=0,r=!1;for(let o of t){let i=null;try{let a=C1(o);i=a==null?null:e(o,a)}catch(a){V("runtime.adapters.lottie.site4",a)}i!=null&&(r=!0,n=Math.max(n,i))}return r?n:null}function Ib(e){return zs(e)?e.wrapper:e.canvas}function xd(e,t){let n=e%t;return t-n<1e-6?0:n}function Db(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function C1(e){return zs(e)?Db(e.totalFrames,e.frameRate):Sd(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:Db(e.totalFrames,e.frameRate):null}function zs(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function Sd(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}function Hb(){let e=null,t=0,n=null,r=null,o=null,i=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=c=>{i||c.itemsTotal<=c.itemsLoaded||(i=new Promise(d=>{c.onLoad=function(){try{o?.call(this)}finally{i=null,c.onLoad=o??null,d()}}}))},s=c=>{n!==c&&(n=c,r=c.onStart??null,o=c.onLoad??null,c.onStart=function(d,f,m){try{r?.call(this,d,f,m)}finally{l(c)}})};return{name:"three",discover:()=>{let c=a();c&&(s(c),l(c))},seek:c=>{e=Math.max(0,Number(c.time)||0),t=e,window.__hfThreeTime=e,ws(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0},getReadyPromise:()=>{let c=a();return!c||c.itemsTotal<=c.itemsLoaded?null:(i||l(c),i)}}}function Bt(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 o=r.filter(i=>!n.has(i));return o.length===0?null:t||(t=Promise.allSettled(o.map(i=>e.waitFor(i).then(()=>{n.add(i)}))).then(()=>{t=null}),t)}}}function Gb(){return Bt({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 Bb(){return Bt({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 Ub(){return Bt({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 Wb(){return Bt({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 Vb(){return Bt({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}var T1=250;function $b(){let e=null,t=0,n=null,r=()=>{n!==null&&(window.clearInterval(n),n=null)},o=()=>{n===null&&document.querySelector("[data-composition-id][data-requires-webgpu]")&&(n=window.setInterval(()=>{e!==null&&(A0()||(window.__hfTypegpuTime=e,_s(e)))},T1))};return{name:"typegpu",discover:()=>{},seek:i=>{e=Math.max(0,Number(i.time)||0),t=e,window.__hfTypegpuTime=e,ws(e)},pause:()=>{e==null&&(e=Math.max(0,t)),o()},play:()=>{r(),e=null},revert:()=>{r(),e=null,t=0}}}var eo=new Map,qb=()=>eo.size>0;function zb(e){if(eo.has(e.element))throw new Error("This element already has a frame source");let t=e.sourceRange;if(t&&(!Number.isFinite(t.start)||t.start<0||!Number.isFinite(t.duration)||t.duration<=0||!Number.isFinite(t.fps)||t.fps<=0))throw new Error("Frame source ranges require a nonnegative start, positive duration and FPS");let n=new AbortController,r=new Promise(c=>{n.signal.addEventListener("abort",()=>c(),{once:!0})}),o=Promise.race([Promise.resolve(e.ready),r]);o.catch(()=>{});let i=null,a=null,l=async()=>{let c;try{for(await o;!n.signal.aborted&&i!==null;){let d=i;i=null;try{await Promise.race([e.render(d,n.signal),r])}catch(f){c??(c={reason:f})}}if(c)throw c.reason}finally{i=null,a=null}},s={element:e.element,ready:o,seek(c){return i=t?t.start+Math.min(Math.max(0,c),Math.max(0,t.duration-1/t.fps)):c,a??(a=l()),a},dispose(){n.signal.aborted||(n.abort(),i=null,eo.delete(e.element),e.dispose?.())}};return eo.set(e.element,s),s.dispose}function jb(e){let t=new Set,n=[],r=null,o=()=>{for(let l of t)eo.get(l.element)!==l&&t.delete(l);let a=[];for(let[l,s]of eo){if(!l.isConnected){s.dispose();continue}t.has(s)||(t.add(s),Qe(s.ready)),a.push([l,s])}return a},i=new MutationObserver(()=>{o()});return i.observe(document,{childList:!0,subtree:!0}),{name:"frame-source",discover:()=>{o()},pause:()=>{},seek:({time:a})=>{for(let[l,s]of o()){let c=e.start(l),d=e.duration(l),f=c+(d??1/0),m=e.exportRenderSeek()?Ls(c,f,e.canonicalFps()):{start:c,end:f};if(!zr(a,m.start,m.end,e.compositionDuration()))continue;let p=Math.max(0,a-c),b=Rn(l)+Hr(Ht(l),p);Qe(s.seek(b))}},getReadyPromise:()=>{let a=o().map(([,l])=>l);return a.length===0?null:((a.length!==n.length||a.some((l,s)=>l!==n[s]))&&(n=a,r=Promise.all(a.map(l=>l.ready))),r)},revert:()=>{i.disconnect();for(let a of t)a.dispose();t.clear()}}}function Kb(e){let t=e.nextElementSibling;if(Je(t)&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;let n=Tt(e);return n&&n.complete&&n.naturalWidth>0?n:null}function Yb(){let e=globalThis.GPUQueue;if(!e?.prototype?.copyExternalImageToTexture)return;let t=e.prototype.copyExternalImageToTexture;e.prototype.copyExternalImageToTexture=function(n,r,o){if(Le(n?.source)){let i=Kb(n.source);if(i)return t.call(this,{...n,source:i},r,o)}return t.call(this,n,r,o)}}function Xb(){let e=[globalThis.WebGL2RenderingContext,globalThis.WebGLRenderingContext],t=["texImage2D","texSubImage2D"];for(let n of e){let r=n?.prototype;if(r)for(let o of t){let i=r[o];if(typeof i!="function"||i.__hfVideoPatched)continue;let a=function(...l){let s=l.length-1,c=l[s];if(Le(c)){let d=Kb(c);d&&(l[s]=d)}return i.apply(this,l)};a.__hfVideoPatched=!0,r[o]=a}}}var R1=e=>typeof CSSAnimation<"u"&&e instanceof CSSAnimation||typeof CSSTransition<"u"&&e instanceof CSSTransition;function Jb(){let e=!1,t=0,n=!1,r,o,i,a=new Set,l=new WeakMap,s=(x=()=>document.getAnimations())=>{if(!document.getAnimations)return[];try{return x()}catch{return[]}},c=x=>{let E=Number(x.currentTime);return Number.isFinite(E)&&E>0?E:0},d=(x,E)=>E<=0?x:x>=E?Math.max(0,x-E):x,f=(x,E)=>{let v=l.get(x);if(v)return v;let _={compositionTimeMs:E,animationTimeMs:e?d(c(x),E):c(x)};return l.set(x,_),_},m=(x,E)=>{if(!a.has(x)){a.add(x);let v=()=>{a.delete(x)};try{x.addEventListener("finish",v,{once:!0}),x.addEventListener("cancel",v,{once:!0})}catch(_){V("runtime.adapters.waapi.site4",_)}}f(x,E)},p=(x,E)=>{for(let v of x)m(v,E)},b=()=>{if(n||typeof Element>"u")return;let x=Element.prototype;if(typeof x.animate!="function"||x.__hfOriginalAnimate)return;let E=x.animate;try{Object.defineProperty(x,"__hfOriginalAnimate",{value:E,configurable:!0});let v=function(..._){let U=E.apply(this,_);return m(U,t),U};x.animate=v,r=x,o=E,i=v,n=!0}catch{}},y=x=>{let E=null;try{E=x.effect?.getComputedTiming?.()??null}catch(U){V("runtime.adapters.waapi.site4",U)}if(!E)return{};let v=Number(E.endTime);return Number.isFinite(v)?{endSeconds:(l.get(x)?.compositionTimeMs??0)/1e3+v/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,b(),p(s(),t)},seek:x=>{let E=Math.max(0,(Number(x.time)||0)*1e3);t=E,(!e||a.size>0)&&p(s(x.pageAnimations),e?E:0);for(let v of a){if(v.playState==="idle"&&R1(v)){a.delete(v);continue}let _=e?f(v,E):f(v,0),U=_.animationTimeMs+Math.max(0,E-_.compositionTimeMs);Ws(v,U,"runtime.adapters.waapi.site1","runtime.adapters.waapi.site2")}},pause:x=>{e||p(s(x?.pageAnimations),t);for(let E of a)try{E.pause()}catch(v){V("runtime.adapters.waapi.site3",v)}},revert:()=>{if(a.clear(),l=new WeakMap,e=!1,t=0,r&&o&&i&&r.animate===i)try{r.animate=o,r.__hfOriginalAnimate===o&&delete r.__hfOriginalAnimate}catch(x){V("runtime.adapters.waapi.site5",x)}r=void 0,o=void 0,i=void 0,n=!1},getInferredDurationSeconds:()=>{let x=0;for(let E of s()){let v=y(E);v.endSeconds!=null&&(x=Math.max(x,v.endSeconds))}return x>0?x:null}}}var Rt=new WeakMap;function xi(e){return Rt.has(e)?Rt.get(e)??null:e.getAttribute("src")}var Zb="hf-proxy-box",ey="hf-proxy-light",js="hf-proxy-retry",ty="X-HF-Proxy-Progress",M1=[256,304,362,430,512,608,724,862,1024,1218,1448,1722,2048,2436,2896,3444,4096,4870,5792,6888,8192];function Qb(e){return e>0?M1.find(t=>t>=e)??null:null}function Ed(e,t){let n=Qb(e),r=Qb(t);return n&&r?{width:n,height:r}:null}function ny(e){return`${e.width}x${e.height}`}var vd=[1,.5,.25,.125];function ry(e){return vd.some(t=>t===e)}var k1=.5,L1=4e7;function Ks(e,t){return Ed(e.width*t,e.height*t)??e}function Ys(e,t){return t.width*t.height<=k1*e.width*e.height||e.bitDepth>8||e.bitrate>=L1}var N1=3;function F1(e){let t=new URL(e,document.baseURI);return t.searchParams.delete(js),t.href}async function Ad(e,t,n){let r=0,o=e;for(;t();){let i=await fetch(o,{headers:{Range:"bytes=0-0"},cache:"no-store"}).catch(()=>null);o=F1(e),i?.body?.cancel().catch(()=>{});let a=i?.status===202||i?.status===503,l=i?.status===202?i.headers.get(ty):null;if(l!==null&&Number.isFinite(Number(l))&&n?.(Math.min(1,Math.max(0,Number(l)))),!a&&i?.ok)return!0;if(!a&&++r>N1)return!1;let s=Math.min(Number(i?.headers.get("Retry-After"))||2,30);await new Promise(c=>setTimeout(c,s*1e3))}return!1}var P1="hf-proxy",oy="runtime_media_proxy_fallback",iy="runtime_media_proxy_unavailable",ay=new WeakSet,Ut=new WeakMap;function Xs(e){return e.currentSrc||e.src}var an=1,wd=new WeakSet,_d=new WeakSet,Et=window.parent===window?1:null,sy=()=>{},I1=new Promise(e=>sy=e),D1=1e3,Pn=new Map,hr=new WeakMap;function O1(){return Et!==null?Promise.resolve(Et):Promise.race([I1.then(()=>Et),new Promise(e=>setTimeout(()=>e(null),D1))])}function Cd(e,t){if(getComputedStyle(e).objectFit==="none")return null;let n=e.getBoundingClientRect(),r=document.documentElement,o=t*(window.devicePixelRatio||1);return Ed(Math.max(n.width,r.clientWidth)*o,Math.max(n.height,r.clientHeight)*o)}function ly(e){if(!(!(e>0)||!Number.isFinite(e))){Et=e,sy();for(let t of Pn.keys())Qs(t,e)}}function uy(e){let t=window.__HF_MEDIA_CODEC_MAP__,n=no(e);return t&&n!==null?ro(n,t):null}function Js(e){let t=window.__HF_MEDIA_SOURCE_FACTS__,n=no(e);return t&&n!==null?ro(n,t):null}function Qs(e,t){let n=Pn.get(e);if(!n)return;if(!e.isConnected||e.getAttribute("src")!==n.href){Pn.delete(e);return}let r=Cd(e,t),o=an<1,i=r&&o?Ks(r,an):r;if(!(o&&!i)){if(i&&o&&n.light&&H1(e,i))return cy(e);G1(n.box,i,o)||U1(e,n,o||!i?i:B1(i,n.box))}}function H1(e,t){let n=Js(e);return n!==null&&!Ys(n,t)}function G1(e,t,n){return n?t?.width===e.width&&t.height===e.height:t!==null&&t.width<=e.width&&t.height<=e.height}function B1(e,t){return{width:Math.max(e.width,t.width),height:Math.max(e.height,t.height)}}function U1(e,t,n){let r=fy(t.originalSrc,t.variant,n,t.light,_d.delete(e));if(hr.get(e)===r)return;hr.set(e,r);let o=()=>hr.get(e)===r&&e.isConnected&&e.getAttribute("src")===t.href;Nn(e,"making"),Ad(r,o,i=>Nn(e,"making",i)).then(i=>{o()&&Nn(e,i?"ready":"failed"),i&&o()&&dy(e,r,t.originalSrc,t.variant,n,t.light),hr.get(e)===r&&hr.delete(e)})}function cy(e){let t=Rt.get(e)??null;for(let n of[Pn,hr,Ut,Rt])n.delete(e);wd.delete(e),Rs(e),Hs(),t===null?e.removeAttribute("src"):e.setAttribute("src",t),e.load()}function dy(e,t,n,r,o,i=!1){o?Pn.set(e,{originalSrc:n,variant:r,href:t,box:o,light:i}):Pn.delete(e),Rs(e),Hs(),e.src=t,e.load()}function to(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:Le(e)&&!!Tt(e)}function no(e){let t=Xs(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 W1(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 V1(e,t){let n=e.normalize("NFC").toLowerCase(),r=-1,o=null,i=!1;for(let[a,l]of Object.entries(t)){let s=a.normalize("NFC").toLowerCase();n.endsWith(s)&&(s.length>r?(r=s.length,o=l,i=!1):s.length===r&&(i=!0))}return i?null:o}function ro(e,t){return t[e]??W1(e,t)??V1(e,t)}function fy(e,t,n,r=!1,o=!1){let i=new URL(e,document.baseURI);return i.searchParams.set(P1,t),n&&i.searchParams.set(Zb,ny(n)),r&&n&&i.searchParams.set(ey,"1"),o&&i.searchParams.set(js,"1"),i.href}var $1={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 Fn(e,t,n){if(ay.has(e))return;ay.add(e);let r=$1[t];Ce({source:"hf-preview",type:"diagnostic",code:iy,details:{asset:n,codecName:null,reason:t,note:r}}),globalThis.console.info(`[hyperframes] ${iy}: "${n}" (${t}): ${r}`)}async function q1(e,t,n){let{originalSrc:r,originalAttr:o,variant:i,lightFacts:a,level:l,live:s}=t,c=n===null?null:Cd(e,n),d=c&&l<1?Ks(c,l):c;if(a&&!(d&&Ys(a,d))){Ut.get(e)===o&&Ut.delete(e);return}let f=fy(r,i,d,a!==void 0,_d.delete(e));Nn(e,"making");let m=await Ad(f,s,p=>Nn(e,"making",p));if(!s()){Ut.get(e)===o&&Ut.delete(e),a&&e.isConnected&&e.getAttribute("src")===o&&py(e);return}if(!m){Nn(e,"failed"),Fn(e,"proxy_playback_failed",r);return}return Nn(e,"ready"),Rt.set(e,o),a&&wd.add(e),dy(e,f,r,i,d,a!==void 0),Et!==null&&Qs(e,Et),new Promise(p=>{e.addEventListener("loadeddata",p,{once:!0}),e.addEventListener("error",p,{once:!0})})}function Si(e,t=null,n="reactive",r){if(Rt.has(e)||Ut.has(e)&&Ut.get(e)===e.getAttribute("src"))return;let o=Xs(e),i=t?t.hasAlpha?"vp8":"h264":"auto";try{new URL(o,document.baseURI)}catch(p){V("runtime.mediaProxy.swap",p),Fn(e,"invalid_source_url",o);return}let a=e.getAttribute("src");Ut.set(e,a);let l=an,c={originalSrc:o,originalAttr:a,variant:i,lightFacts:r,level:l,live:()=>e.isConnected&&e.getAttribute("src")===a&&(!r||an===l)},d=O1().then(p=>q1(e,c,p));if(r)return;Qe(Promise.race([d,new Promise(p=>setTimeout(p,Vc))]),"video-frame");let f=t?.codecName??null;Ce({source:"hf-preview",type:"diagnostic",code:oy,details:{asset:o,codecName:f,trigger:n,note:"render output is unaffected; only this preview element was swapped to an authoring proxy"}}),globalThis.console.info(`[hyperframes] ${oy}: "${o}" uses a codec (${f??"unknown"}) this browser can't decode; auto-swapped to an authoring proxy for this preview only. Render output is unaffected.`)}function my(e){if(to(e)||!Le(e)||Rt.has(e))return;let t=uy(e),n=t?.representativeMime?e.canPlayType(t.representativeMime):"",r=n==="probably"||n==="maybe";t?.browserHostile&&!r?Si(e,t,"proactive"):an<1&&Td(e,t)}function Td(e,t){if(Rt.has(e)||Ut.has(e))return;let n=Js(e);n&&Si(e,t,"light",n)}function py(e){if(!(to(e)||!Le(e))){if(an===1&&wd.has(e))return cy(e);if(Pn.has(e)&&Et!==null)return Qs(e,Et);an<1&&Td(e,uy(e))}}function hy(e){if(!(!ry(e)||e===an)){an=e,db(e),Hs();for(let t of document.querySelectorAll("video"))py(t)}}function gy(){if(Et===null)return[];let e=[...document.querySelectorAll("video")].flatMap(t=>{let n=Js(t),r=n&&Cd(t,Et??1);return n&&r?[{facts:n,shown:r}]:[]});return vd.filter(t=>t<1&&e.some(({facts:n,shown:r})=>Ys(n,Ks(r,t))))}function by(){let e=new Map;for(let t of document.querySelectorAll("video")){let n=no(t),r=window.__HF_MEDIA_CODEC_MAP__,{width:o=0,height:i=0,bitDepth:a=0,codec:l}=Js(t)??{},s=r&&n!==null?ro(n,r)?.codecName:void 0,c=l??s??"unknown",d=`${c}|${o}|${i}|${a}`,f=e.get(d)??{codec:c,width:o,height:i,bitDepth:a,count:0};f.count+=1,e.set(d,f)}return[...e.values()]}function yy(){for(let e of fb()){_d.add(e),Ut.delete(e),hr.delete(e);let t=window.__HF_MEDIA_CODEC_MAP__,n=no(e),r=t&&n!==null?ro(n,t):null;Pn.has(e)&&Et!==null?Qs(e,Et):r?.browserHostile?Si(e,r,"reactive"):Td(e,r)}}function xy(e){if(to(e)||!Le(e)||e.videoWidth!==0)return;let t=Xs(e);if(Rt.has(e)){Fn(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=no(e);if(r===null){Fn(e,"cross_origin",t);return}let o=ro(r,n);if(o&&!o.browserHostile){Fn(e,"browser_safe_codec",t);return}Si(e,o,"reactive")}function Sy(e){if(to(e)||!Le(e))return;let t=Xs(e);if(Rt.has(e)){Fn(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=no(e);if(r===null){Fn(e,"cross_origin",t);return}let o=ro(r,n);if(o&&!o.browserHostile){Fn(e,"browser_safe_codec",t);return}Si(e,o,"tertiary")}var $e=class extends Error{constructor(n,r=null){super(r==null?n:`${n} at line ${r}`);Se(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=r}},z1=[0,0,0],j1=[1,1,1],Zs=64;function K1(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 In(e,t){let n=Number(e);if(!Number.isFinite(n))throw new $e(`Invalid number "${e}"`,t);return n}function Ey(e,t,n){if(e.length!==3)throw new $e(`${t} expects three numbers`,n);return[In(e[0],n),In(e[1],n),In(e[2],n)]}function vy(e,t,n){if(!e)throw new $e(`${t} expects a size`,n);let r=Number(e);if(!Number.isInteger(r)||r<2)throw new $e(`${t} must be an integer greater than 1`,n);return r}function Y1(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new $e("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function X1(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 J1(e){return/^[+-]?(?:\d|\.\d)/.test(e)}function Ay(e,t={}){let n=t.maxSize??Zs,r=null,o=z1,i=j1,a=null,l=null,s=[],c=e.replace(/^\uFEFF/,"").split(/\r?\n/);for(let f=0;f<c.length;f++){let m=f+1,p=K1(c[f]??"").trim();if(!p)continue;let b=p.split(/\s+/),y=(b[0]??"").toUpperCase(),x=b.slice(1);if(y==="TITLE"){r=X1(p);continue}if(y==="DOMAIN_MIN"){o=Ey(x,y,m);continue}if(y==="DOMAIN_MAX"){i=Ey(x,y,m);continue}if(y==="LUT_3D_INPUT_RANGE"){if(x.length!==2)throw new $e(`${y} expects two numbers`,m);let E=In(x[0],m),v=In(x[1],m);if(v<=E)throw new $e("LUT_3D_INPUT_RANGE max must exceed min",m);o=[E,E,E],i=[v,v,v];continue}if(y==="LUT_1D_SIZE"){a=vy(x[0],y,m);continue}if(y==="LUT_3D_SIZE"){if(l=vy(x[0],y,m),l>n)throw new $e(`LUT_3D_SIZE ${l} exceeds max ${n}`,m);continue}if(!J1(y)){if(y.startsWith("LUT_"))throw new $e(`Unsupported cube keyword ${y}`,m);continue}if(!l)throw a?new $e("1D cube LUTs are not supported yet",m):new $e("LUT data appears before LUT_3D_SIZE",m);if(b.length!==3)throw new $e("LUT data rows must contain three numbers",m);s.push(In(b[0],m),In(b[1],m),In(b[2],m))}if(a&&l)throw new $e("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw a?new $e("1D cube LUTs are not supported yet"):new $e("Missing LUT_3D_SIZE");Y1(o,i);let d=l*l*l;if(s.length!==d*3)throw new $e(`Expected ${d} LUT rows for size ${l}, found ${s.length/3}`);return{title:r,size:l,domainMin:o,domainMax:i,data:new Float32Array(s)}}function Q1(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function Ei(e){return Math.round(Q1(e)*255)}function Rd(e){let t=e.size,n=t*t,r=t,o=new Uint8Array(n*r*4);for(let i=0;i<t;i++)for(let a=0;a<t;a++)for(let l=0;l<t;l++){let s=((i*t+a)*t+l)*3,c=(a*n+i*t+l)*4;o[c]=Ei(e.data[s]??0),o[c+1]=Ei(e.data[s+1]??0),o[c+2]=Ei(e.data[s+2]??0),o[c+3]=255}return{width:n,height:r,data:o}}var wy="rec709";var _y=["video","img","canvas"],Pe={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 Cy=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"];var Ty=["shadows","midtones","highlights"],Ry=["master","red","green","blue"],My=["hueVsHue","hueVsSaturation","hueVsLuma"];var ky=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],Ly=["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 fW=Pe.unit,mW=Pe.signedUnit,pW=Pe.effects;var Wt=1024,vi=16;function Ny(e,t,n,r){let o=((2*e+t)*n-e*r)/(e+t);return Math.sign(o)!==Math.sign(n)?0:Math.sign(n)!==Math.sign(r)&&Math.abs(o)>3*Math.abs(n)?3*n:o}function qe(e,t){let n=e[t];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function Z1(e){let t=[],n=[],r=qe(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 o=qe(n,0);if(e.length===2)return[o,o];let i=new Array(e.length);i[0]=Ny(qe(t,0),qe(t,1),o,qe(n,1)),i[i.length-1]=Ny(qe(t,t.length-1),qe(t,t.length-2),qe(n,n.length-1),qe(n,n.length-2));for(let a=1;a<e.length-1;a+=1){let l=qe(n,a-1),s=qe(n,a);if(l===0||s===0||Math.sign(l)!==Math.sign(s)){i[a]=0;continue}let c=qe(t,a-1),d=qe(t,a),f=2*d+c,m=d+2*c;i[a]=(f+m)/(f/l+m/s)}return i}function Fy(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,o]of e){if(!Number.isFinite(r)||!Number.isFinite(o))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 eM(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 tM(e,t,n,r,o){let i=n[0]-t[0],a=Math.min(1,Math.max(0,(e-t[0])/i)),l=a*a,s=l*a;return(2*s-3*l+1)*t[1]+(s-2*l+a)*i*r+(-2*s+3*l)*n[1]+(s-l)*i*o}function Py(e,t,n,r,o){eM(e,r,o);let i=Z1(e),a=new Float32Array(t),l=0;for(let s=0;s<t;s+=1){let c=n(s);for(;l<e.length-2&&c>qe(e,l+1)[0];)l+=1;let d=qe(e,l),f=qe(e,l+1),m=tM(c,d,f,qe(i,l),qe(i,l+1));a[s]=Math.min(o,Math.max(r,m))}return a}function oo(e,t=Wt){if(Fy(e,t),e.length>vi)throw new RangeError(`A color curve supports at most ${vi} 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 Py(e,t,n=>n/(t-1),0,1)}function kd(e,t,n,r=Wt){if(e.length<3)throw new RangeError("A hue curve requires at least three points");if(e.length>vi)throw new RangeError(`A hue curve supports at most ${vi} points`);let o=[...e].sort((s,c)=>s[0]-c[0]);for(let s=0;s<o.length;s+=1){let c=o[s];if(!c||c[0]<0||c[0]>=360)throw new RangeError("Hue curve inputs must be from 0 up to 360 degrees");if(s>0&&c[0]===o[s-1]?.[0])throw new RangeError("Hue curve inputs must be unique")}let i=o.slice(-2).map(([s,c])=>[s-360,c]),a=o.slice(0,2).map(([s,c])=>[s+360,c]),l=[...i,...o,...a];return Fy(l,r),Py(l,r,s=>s/r*360,t,n)}var nl="data-color-grading",gr="data-hf-color-grading-source-hidden",br="data-hf-authored-opacity",Gy="__hf_color_grading_",rM=wy,Od=_y,Fd={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},Pd={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},Id={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 rl=Cy,By=Ty,Uy=Ry,Wy=My,Hd=ky,Gd=Ly,Iy={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},Dy={vignette:.18};function ze(e,t,n={},r={},o={},i=1){return{id:e,label:t,intensity:i,adjust:{...Fd,...n},details:{...Pd,...r},effects:{...Id,...o}}}var Bd=[ze("neutral","Neutral"),ze("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),ze("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),ze("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),ze("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),ze("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),ze("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),ze("vintage-wash","Vintage Wash",Iy,Dy),ze("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),ze("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),ze("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),ze("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),ze("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),ze("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),ze("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}),ze("home-movie-8mm","8mm Home Movie",Iy,{...Dy,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),ze("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),ze("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],oM=new Map(Bd.map(e=>[e.id,e])),iM=/^\$(?:\{([A-Za-z0-9_.:-]+)\}|([A-Za-z0-9_.:-]+))$/,aM={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}},io={hue:0,amount:0,level:0},Oy={amount:Pe.unit,level:Pe.signedUnit},Dn=[[0,0],[1,1]],ao=[],sM={hueVsHue:Pe.secondaryHueShift,hueVsSaturation:Pe.signedUnit,hueVsLuma:Pe.signedUnit},Ld={center:0,range:180,softness:0},Nd={min:0,max:1,softness:.05},lM={vignette:Pe.unit,vignetteMidpoint:Pe.unit,vignetteRoundness:Pe.signedUnit,vignetteFeather:Pe.unit,grain:Pe.unit,grainSize:Pe.unit,grainRoughness:Pe.unit},Dd=Pe.unit,uM=Pe.effects,Vy=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"];var cM=Bd.filter(e=>Vy.some(t=>e.effects[t]>1e-4)),AW=Bd.filter(e=>!cM.includes(e)),wW={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}},$y=[{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 dM=/^#[0-9a-f]{6}$/i;function fM(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&dM.test(t))?null:e.map(t=>t.toLowerCase())}function Ze(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function tl(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function qy(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function lt(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?tl(n,t.min,t.max):0}function Ud(e,t=0){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?(n%360+360)%360:t}function mM(e){let t=Ze(e)?e:{};return By.reduce((n,r)=>{let o=Ze(t[r])?t[r]:{};return n[r]={hue:Ud(o.hue,io.hue),amount:lt(o.amount??io.amount,Oy.amount),level:lt(o.level??io.level,Oy.level)},n},{shadows:{...io},midtones:{...io},highlights:{...io}})}function pM(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)?[tl(t,0,1),tl(n,0,1)]:null}function zy(e){return e.some((t,n)=>n>0&&t[0]===e[n-1]?.[0])}function hM(e){(e[0]?.[0]??0)>0&&e.unshift([0,0]),(e.at(-1)?.[0]??1)<1&&e.push([1,1])}function gM(e){if(!Array.isArray(e)||e.length<2)return Dn;let t=[];for(let n of e){let r=pM(n);if(!r)return Dn;t.push(r)}return t.sort((n,r)=>n[0]-r[0]),zy(t)||(hM(t),t.length>16)?Dn:t}function bM(e){let t=Ze(e)?e:{};return Uy.reduce((n,r)=>(n[r]=gM(t[r]),n),{master:Dn,red:Dn,green:Dn,blue:Dn})}function yM(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)?[Ud(n),tl(r,t.min,t.max)]:null}function xM(e,t){if(!Array.isArray(e)||e.length<3||e.length>16)return ao;let n=[];for(let r of e){let o=yM(r,t);if(!o)return ao;n.push(o)}return n.sort((r,o)=>r[0]-o[0]),zy(n)?ao:n}function SM(e){let t=Ze(e)?e:{};return Wy.reduce((n,r)=>(n[r]=xM(t[r],sM[r]),n),{hueVsHue:ao,hueVsSaturation:ao,hueVsLuma:ao})}function Hy(e){let t=Ze(e)?e:{},n=lt(t.min??Nd.min,Dd),r=lt(t.max??Nd.max,Dd);return{min:Math.min(n,r),max:Math.max(n,r),softness:lt(t.softness??Nd.softness,Pe.secondarySoftRangeSoftness)}}function EM(e){let t=Ze(e)?e:{},n=lt(t.range??Ld.range,Pe.secondaryHueRange);return{center:Ud(t.center,Ld.center),range:n,softness:lt(t.softness??Ld.softness,{min:Pe.secondaryHueSoftness.min,max:Pe.secondaryHueCombinedMax-n})}}function vM(e){return{hueShift:lt(e.hueShift??0,Pe.secondaryHueShift),saturation:lt(e.saturation??0,Pe.signedUnit),luma:lt(e.luma??0,Pe.signedUnit),temperature:lt(e.temperature??0,Pe.signedUnit),tint:lt(e.tint??0,Pe.signedUnit)}}function AM(e){return!Ze(e)||!Ze(e.key)||!Ze(e.correction)?null:{enabled:e.enabled!==!1,key:{hue:EM(e.key.hue),saturation:Hy(e.key.saturation),luma:Hy(e.key.luma)},correction:vM(e.correction)}}function wM(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,4)){let r=AM(n);r&&t.push(r)}return t}function _M(e){if(e==null)return null;let t=String(e).trim();return t||null}function CM(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!Ze(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:qy(e.intensity,1)}}function TM(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return Ze(n)?n:null}catch{return null}return{preset:t}}return Ze(e)?e:null}function RM(e,t){let n=e.trim().match(iM);if(!n)return e;let r=n[1]??n[2]??"";return r&&Object.hasOwn(t,r)?t[r]:e}function el(e,t){if(typeof e=="string"){let r=RM(e,t);if(r!==e)return r;let o=e.trim();if(!o.startsWith("{"))return e;try{return el(JSON.parse(o),t)}catch{return e}}if(Array.isArray(e))return e.map(r=>el(r,t));if(!Ze(e))return e;let n={};for(let[r,o]of Object.entries(e))n[r]=el(o,t);return n}function MM(e){return e?oM.get(e)??null:null}function ol(e){let t=TM(e);if(!t||t.enabled===!1)return null;let n=_M(t.preset),r=MM(n),o=r?.adjust??Fd,i=r?.details??Pd,a=r?.effects??Id,l=Ze(t.adjust)?t.adjust:{},s=Ze(t.details)?t.details:{},c=Ze(t.effects)?t.effects:{},d=rl.reduce((p,b)=>(p[b]=lt(l[b]??o[b],aM[b]),p),{...Fd}),f=Hd.reduce((p,b)=>(p[b]=lt(s[b]??i[b],lM[b]),p),{...Pd}),m=Gd.reduce((p,b)=>(p[b]=lt(c[b]??a[b],uM[b]??Dd),p),{...Id});return{enabled:!0,preset:n,intensity:qy(t.intensity,r?.intensity??1),adjust:d,wheels:mM(t.wheels),curves:bM(t.curves),hueCurves:SM(t.hueCurves),secondaries:wM(t.secondaries),details:f,effects:m,palette:fM(t.palette),lut:CM(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():rM}}function jy(e,t){return ol(el(e,t))}function kM(e){return By.some(t=>Math.abs(e[t].amount)>1e-4||Math.abs(e[t].level)>1e-4)}function Wd(e){return Uy.some(t=>e[t].some(([n,r])=>Math.abs(n-r)>1e-4))}function Vd(e){return Wy.some(t=>e[t].some(([,n])=>Math.abs(n)>1e-4))}function $d(e){return e.some(t=>t.enabled&&Object.values(t.correction).some(n=>Math.abs(n)>1e-4))}function Ky(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||Vy.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:rl.some(n=>Math.abs(e.adjust[n])>1e-4)||(e.wheels?kM(e.wheels):!1)||(e.curves?Wd(e.curves):!1)||(e.hueCurves?Vd(e.hueCurves):!1)||(e.secondaries?$d(e.secondaries):!1):!1}var il=/^(|transparent|rgba\(.*,\s*0\)|.*\/\s*0%?\s*\))$/,LM=new Set(["IMG","VIDEO","IFRAME","EMBED","OBJECT","CANVAS"]),Yy="http://www.w3.org/2000/svg",NM=new Set(["svg","g","foreignObject"]),FM=["Top","Right","Bottom","Left"],PM={left:-1/0,right:1/0,top:-1/0,bottom:1/0},Xy=e=>!!e.backgroundImage&&e.backgroundImage!=="none"||!il.test(e.backgroundColor),IM=e=>{let t=e.getPropertyValue("-webkit-text-fill-color")||e.color,n=Number.parseFloat(e.getPropertyValue("-webkit-text-stroke-width"))||0,r=e.getPropertyValue("-webkit-text-stroke-color")||e.color;return!il.test(t)||n>0&&!il.test(r)},Jy=e=>FM.map(t=>e[`border${t}Style`]!=="none"&&!il.test(e[`border${t}Color`])&&Number.parseFloat(e[`border${t}Width`])||0),al=e=>e.bottom-e.top,qd=(e,t,n)=>t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom,Qy=(e,t)=>({left:Math.min(e.left,t.left),right:Math.max(e.right,t.right),top:Math.min(e.top,t.top),bottom:Math.max(e.bottom,t.bottom)}),DM=(e,t)=>t.display==="none"||t.position==="absolute"||t.position==="fixed"||Number.parseFloat(t.opacity)<=.01&&!e.hasAttribute(gr);function OM(e,t,n){if(e.width<=0&&e.height<=0)return!1;let r=3*(Number.parseFloat(t.fontSize)||16),o=Math.max(r,Math.min(2*e.height,20*r/3));return n<e.top-o||n>e.bottom+o}function HM(e,t,n,r){let[o,i,a,l]=Jy(t);if(!(o||i||a||l))return!1;let s=e.getBoundingClientRect(),{offsetWidth:c,offsetHeight:d}=e,f=c>0?s.width/c:1,m=d>0?s.height/d:1,p={left:s.left+l*f,right:s.right-i*f,top:s.top+o*m,bottom:s.bottom-a*m};return!qd(p,n,r)}function GM(e){let t=[];for(let n of[...e].sort((r,o)=>r.left-o.left)){let r=t.findIndex(o=>n.top<o.bottom&&n.bottom>o.top&&n.left-o.right<=2*Math.max(al(o),al(n)));r<0?t.push(n):t[r]=Qy(t[r],n)}return t}function BM(e){let t=[...e].sort((n,r)=>n.top-r.top);return t.flatMap((n,r)=>t.slice(r+1).flatMap(o=>{let i=o.left<n.right&&o.right>n.left,a=o.top-n.bottom<=2*Math.min(al(n),al(o));return i&&a&&o.top>n.bottom?[Qy(n,o)]:[]}))}function Zy(e,t,n){let r=e.defaultView,o=typeof e.createRange().getClientRects=="function",i=e.createRange(),a=new Map,l=new Map,s=new Map,c=x=>{let E=l.get(x);if(E===void 0){let v=r.getComputedStyle(x);E=DM(x,v)||o&&OM(x.getBoundingClientRect(),v,n),l.set(x,E)}return E},d=x=>{let E=s.get(x);if(E===void 0){let v=x.parentElement,_=v&&x.nodeValue?.trim()?r.getComputedStyle(v):null;E=!!_&&_.visibility!=="hidden"&&IM(_),s.set(x,E)}return E},f=x=>{if(!o)return[PM];let E=[];i.selectNodeContents(x);for(let v of i.getClientRects()){let _=v.bottom-v.top;v.width>0&&_>0&&n>=v.top-2*_&&n<=v.bottom+2*_&&E.push(v)}return E},m=x=>{let E=a.get(x);if(E)return E;E=[];for(let v of x.childNodes)v.nodeType===3?d(v)&&E.push(...f(v)):v.nodeType===1&&v.hasChildNodes()&&!c(v)&&E.push(...m(v));return a.set(x,E),E};function p(x){let E=GM(m(x));return E.some(v=>qd(v,t,n))||BM(E).some(v=>qd(v,t,n))}function b(x,E){let v=r.getComputedStyle(x,E);return!v.content||v.content==="none"||v.content==="normal"||v.display==="none"?!1:v.content!=='""'||Xy(v)||Jy(v).some(_=>_>0)}let y=(x,E)=>/inset/.test(E.boxShadow)||HM(x,E,t,n)||b(x,"::before")||b(x,"::after");return x=>{if(LM.has(x.tagName)||!(x.namespaceURI!==Yy||NM.has(x.localName))||!r)return!0;let v=r.getComputedStyle(x);return Xy(v)||y(x,v)||x.namespaceURI!==Yy&&p(x)}}var UM=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),WM=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(","),ex="[data-hf-inner-root],[data-composition-id]:not([data-composition-id] *)",tx=`${ex}{pointer-events:auto!important}`,VM=`@layer hf-picker{${tx}}`;function nx(e){let t=!1,n=null,r=null,o=null,i=null,a,l=new Set;function s(w,k){try{window.dispatchEvent(new CustomEvent(w,{detail:k}))}catch(K){V("runtime.picker.site1",K)}}function c(w){o=w,s("hyperframe:picker:hovered",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function d(w){i=w,s("hyperframe:picker:selected",{elementInfo:i,isPickMode:t,timestamp:Date.now()})}function f(w){if(l=new Set(Array.from(document.querySelectorAll(ex)).filter(oe=>getComputedStyle(oe).pointerEvents==="none")),l.size===0)return w();let k=m(),K=k?p(k):b();try{return w()}finally{K(),l=new Set}}function m(){if(a!==void 0)return a;if(a=null,!Array.isArray(document.adoptedStyleSheets)||typeof CSSStyleSheet>"u")return null;try{let w=new CSSStyleSheet;w.replaceSync(VM),a=w}catch(w){V("runtime.picker.site2",w)}return a}function p(w){return document.adoptedStyleSheets=[...document.adoptedStyleSheets,w],()=>{document.adoptedStyleSheets=document.adoptedStyleSheets.filter(k=>k!==w)}}function b(){let w=document.createElement("style");return w.textContent=tx,(document.head??document.documentElement).appendChild(w),()=>w.remove()}function y(w,k){let K=k.getComputedStyle(w),oe=Number.parseFloat(K.opacity||"1");if(Number.isFinite(oe)&&oe<.2&&!(w.textContent??"").trim()){let Ee=K.backgroundImage;if(Ee&&Ee!=="none")return!0}return U(w,k)}function x(w){if(w.namespaceURI!=="http://www.w3.org/2000/svg")return!1;let k=w.tagName.toLowerCase();return k==="filter"||k==="defs"||k.startsWith("fe")}function E(w){if(w.namespaceURI!=="http://www.w3.org/2000/svg"||w.tagName.toLowerCase()!=="rect")return!1;let k=(w.getAttribute("filter")??"").trim();return k&&k!=="none"?!0:(w.ownerDocument.defaultView?.getComputedStyle(w).filter??"none").startsWith("url(")}function v(w){if((w.textContent??"").trim())return!1;if(x(w)||E(w))return!0;let k=[...w.children];return k.length>0&&k.every(K=>v(K))}function _(w,k){let K=Number.parseFloat(k.getComputedStyle(w).opacity||"1");return Number.isFinite(K)&&K<.2}function U(w,k){if(!v(w))return!1;for(let K=w;K&&K!==document.body&&K!==document.documentElement;K=K.parentElement)if(_(K,k)&&v(K))return!0;return!1}function G(w){let k=w.ownerDocument.defaultView;if(!k)return!1;let K=w;if(k.getComputedStyle(w).visibility==="hidden"||y(w,k))return!0;for(;K&&K!==document.body&&K!==document.documentElement;){let oe=k.getComputedStyle(K);if(oe.display==="none"||oe.pointerEvents==="none")return!0;let ge=Number.parseFloat(oe.opacity);if(Number.isFinite(ge)&&ge<=.01&&!K.hasAttribute(gr))return!0;K=K.parentElement}return!1}function R(w){if(!w||w===document.body||w===document.documentElement)return!1;let k=w.tagName.toLowerCase();return!(k==="script"||k==="style"||k==="link"||k==="meta"||l.has(w)||w.closest(UM)||G(w))}function D(w){return!!w?.closest(WM)}function T(w){let k=w.parentElement?.getAttribute("data-composition-id");return!w.hasAttribute("data-hf-inner-root")||!k?null:`[data-composition-id="${CSS.escape(k)}"] > [data-hf-inner-root]`}function H(w){let k=T(w);if(k)return k;let K=w;if(K.id)return`#${CSS.escape(K.id)}`;let oe=w.getAttribute("data-composition-id");if(oe)return`[data-composition-id="${CSS.escape(oe)}"]`;let ge=w.getAttribute("data-composition-src");if(ge)return`[data-composition-src="${CSS.escape(ge)}"]`;let Ee=w.getAttribute("data-track-index");if(Ee)return`[data-track-index="${CSS.escape(Ee)}"]`;let $=w.tagName.toLowerCase(),Q=w.parentElement;if(!Q)return $;let Z=Q.querySelectorAll(`:scope > ${$}`);if(Z.length===1)return $;for(let me=0;me<Z.length;me+=1)if(Z[me]===w)return`${$}:nth-of-type(${me+1})`;return $}function I(w){let k=w.tagName.toLowerCase(),K=(w.textContent??"").trim().replace(/\s+/g," "),oe=(Ee,$)=>{let Q=Array.from(Ee);return Q.length>$?`${Q.slice(0,$-1).join("")}\u2026`:Ee},ge=/^h[1-6]$/.test(k);return ge||k==="p"||k==="span"||k==="div"?K.length>0?oe(K,56):ge?"Heading":"Text":k==="img"?"Image":k==="video"?"Video":k==="audio"?"Audio":k==="svg"?"Shape":w.getAttribute("data-composition-src")?"Composition":k==="section"?"Section":`${k.charAt(0).toUpperCase()}${k.slice(1)}`}function Y(w,k,K){let oe=typeof K=="number"&&K>0?K:8,ge=[];if(document.elementsFromPoint)ge=document.elementsFromPoint(w,k);else if(document.elementFromPoint){let me=document.elementFromPoint(w,k);ge=me?[me]:[]}if(D(ge[0]??null))return[];let Ee={},$=[],Q=[],Z=Zy(document,w,k);for(let[me,he]of ge.entries()){if(!R(he))continue;let le=`${he.tagName}::${he.id||""}::${me}`;if(!Ee[le]&&(Ee[le]=!0,$.push(he),(Q.some(ne=>he.contains(ne))||Z(he))&&(Q.push(he),Q.length>=oe)))break}return Q.length>0?Q:$.slice(0,oe)}function W(w){let k=w.getBoundingClientRect(),K={};for(let ge of Array.from(w.attributes))ge.name.startsWith("data-")&&(K[ge.name]=ge.value);return{id:w.id||null,tagName:w.tagName.toLowerCase(),selector:H(w),label:I(w),boundingBox:{x:k.left,y:k.top,width:k.width,height:k.height},textContent:w.textContent?w.textContent.trim().slice(0,200):null,src:w.getAttribute("src")||w.getAttribute("data-composition-src")||null,dataAttributes:K}}function X(w,k,K){return f(()=>Y(w,k,K)).map(W)}function ie(w){if(!t)return;let k=f(()=>{let oe=Y(w.clientX,w.clientY,1)[0]??(Oe(w.target)?w.target:null);return R(oe)?oe:null});if(!k||n===k)return;n&&n.classList.remove("__hf-pick-highlight"),n=k,k.classList.add("__hf-pick-highlight");let K=W(k);c(K),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:K})}function F(w){if(!t)return;w.preventDefault(),w.stopPropagation(),w.stopImmediatePropagation();let k=X(w.clientX,w.clientY,8);k.length!==0&&(c(k[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:k,selectedIndex:0,point:{x:w.clientX,y:w.clientY}}))}function z(w){w.key==="Escape"&&(N(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function O(){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(`
|
|
44
|
-
`),document.head.appendChild(r),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",ie,!0),document.addEventListener("click",F,!0),document.addEventListener("keydown",z,!0),s("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function N(){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",ie,!0),document.removeEventListener("click",F,!0),document.removeEventListener("keydown",z,!0),s("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function L(){window.__HF_PICKER_API={enable:O,disable:N,isActive:()=>t,getHovered:()=>o,getSelected:()=>i,getCandidatesAtPoint:(w,k,K)=>Number.isFinite(w)&&Number.isFinite(k)?X(w,k,K):[],pickAtPoint:(w,k,K)=>{if(!Number.isFinite(w)||!Number.isFinite(k))return null;let oe=X(w,k,8);if(!oe.length)return null;let ge=Math.max(0,Math.min(oe.length-1,Number(K??0))),Ee=oe[ge]??null;return Ee?(d(Ee),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:Ee}),N(),Ee):null},describe:w=>Oe(w)?W(w):null,pickManyAtPoint:(w,k,K)=>{if(!Number.isFinite(w)||!Number.isFinite(k))return[];let oe=X(w,k,8);if(!oe.length)return[];let ge=[],Ee=Array.isArray(K)?K:[0];for(let $ of Ee){let Q=Math.max(0,Math.min(oe.length-1,Math.floor(Number($)))),Z=oe[Q];if(!Z)continue;ge.some(he=>he.selector===Z.selector&&he.tagName===Z.tagName)||ge.push(Z)}return ge.length?(d(ge[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:ge}),N(),ge):[]}},s("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:O,disablePickMode:N,installPickerApi:L}}function Ai(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&&V("runtime.player.nonConformantNum",{prop:t,actual:typeof r}),n)}function Mt(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&V("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function wi(e,t,n){if(e){for(let r of Object.values(e))if(!(!r||r===t))try{n(r)}catch(o){V("runtime.player.site1",o)}}}function sl(e,t,n){return n?.exact===!0?Number.isFinite(e)&&e>0?e:0:I0(e,t,n?.subFrameDivisions)}function rx(e,t,n,r){let o=sl(t,n,r),i=r?.suppressEvents===!0;return Mt(e,"pause"),typeof e.totalTime=="function"?e.totalTime(o,i):typeof e.seek=="function"&&e.seek(o,i),o}function $M(e,t,n,r,o){let i=[];wi(e,t,a=>{Mt(a,"play"),i.push(a)});try{return rx(t,n,r,o)}finally{for(let a of i)try{Mt(a,"pause")}catch(l){V("runtime.player.site2",l)}}}function qM(e,t){wi(e,t,n=>{Mt(n,"play")})}function ox(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?.()??Ai(n,"duration",0))||0);r>0&&Math.max(0,Ai(n,"time",0))>=r&&(Mt(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()),Mt(n,"play"),wi(e.getTimelineRegistry?.(),n,o=>{typeof o.timeScale=="function"&&o.timeScale(e.getPlaybackRate()),Mt(o,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;Mt(n,"pause"),wi(e.getTimelineRegistry?.(),n,o=>{Mt(o,"pause")});let r=Math.max(0,Ai(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 o=e.getTimeline();if(!o)return;let i=Math.max(0,Number(n)||0),a=e.getIsPlaying(),l=$M(e.getTimelineRegistry?.(),o,i,e.getCanonicalFps());e.onDeterministicSeek(l),r?.keepPlaying&&a?(typeof o.timeScale=="function"&&o.timeScale(e.getPlaybackRate()),Mt(o,"play"),wi(e.getTimelineRegistry?.(),o,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),Mt(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 o=e.getTimeline(),i=e.getCanonicalFps(),a=o?(qM(e.getTimelineRegistry?.(),o),rx(o,n,i,r)):sl(Math.max(0,Number(n)||0),i,r);e.onDeterministicSeek(a,r),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>Ai(e.getTimeline(),"time",0),getDuration:()=>Ai(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}var jd="data-composition-id",zM="data-composition-src",jM=`[${jd}]`,OW=`[${zM}]`,Kd="style",ix="script",Yd='link[rel="stylesheet"], link[rel="preconnect"]',KM=new Set(["","application/ecmascript","application/javascript","application/x-ecmascript","application/x-javascript","text/ecmascript","text/javascript","text/javascript1.0","text/javascript1.1","text/javascript1.2","text/javascript1.3","text/javascript1.4","text/javascript1.5","text/jscript","text/livescript","text/x-ecmascript","text/x-javascript"]),YM=e=>(e.getAttribute("type")||"").trim().toLowerCase();function ax(e){let t=YM(e);return t==="module"||t==="importmap"?!0:KM.has(t)&&e.getAttribute("nomodule")===null}function zd(e){return On(e?.querySelectorAll(ix)).filter(t=>!ax(t))}function Xd(e){return On(e?.querySelectorAll(ix)).filter(ax)}function sx(e){return[...On(e.querySelectorAll(`${Kd}, ${Yd}`)),...Xd(e)]}function On(e){return e?Array.from(e):[]}function lx(e){let{contentNode:t,head:n,documentElement:r,hasTemplate:o,compositionId:i}=e,a=On(t.querySelectorAll(jM)),l=i?a.find(f=>f.getAttribute(jd)===i)??null:a[0]??null,s=(l??a[0])?.getAttribute(jd)?.trim()||"",c=o?null:n??null,d=l?zd(l):[];return{innerRoot:l,authoredCompositionId:i||s||null,scriptCompositionId:s||i||null,authoredRootId:l?.getAttribute("id")?.trim()||null,styleSources:[...On(c?.querySelectorAll(Kd)),...On(t.querySelectorAll(Kd))],scriptSources:[...Xd(c),...Xd(t)],linkSources:[...On(n?.querySelectorAll(Yd)),...On(t.querySelectorAll(Yd))],inertScriptsOutsideRoot:[...zd(c),...l?zd(t).filter(f=>!d.includes(f)):[]],variableDefaultCarriers:[r,l].filter(f=>f!=null)}}function ux(e,t){let n=t[0]?.ownerDocument.querySelector("[data-composition-id]"),r=n&&!t.includes(n)?n.getAttribute("data-composition-id"):null,o=r?e.get(r):void 0;r&&o&&e.set(r,o+1)}var XM='"use strict";(()=>{function I(e){return e?/[\\w-]/.test(e)||e.charCodeAt(0)>=128:!1}function _(e){return e===" "||e===" "||e===`\n`||e==="\\r"||e==="\\f"}var j=/^[0-9a-fA-F]{1,6}/;function G(e){let n=e>=55296&&e<=57343;return e===0||e>1114111||n?65533:e}function $(e,n){return e[n]==="\\r"&&e[n+1]===`\n`?n+2:_(e[n])?n+1:n}function R(e,n){let t=e[n+1];if(t===void 0||/[\\n\\r\\f]/.test(t))return null;let i=j.exec(e.slice(n+1,n+7));if(!i)return{value:t,end:n+2};let o=G(Number.parseInt(i[0],16));return{value:String.fromCodePoint(o),end:$(e,n+1+i[0].length)}}function H(e,n){let t=o=>I(o)&&!/[0-9-]/.test(o),i=o=>e[o]==="\\\\"&&R(e,o)!==null;return e[n]==="-"?e[n+1]==="-"||t(e[n+1])||i(n+1):t(e[n])||i(n)}function y(e,n){let t=n;for(;e.startsWith("/*",t);){let i=e.indexOf("*/",t+2);t=i<0?e.length:i+2}return t}function A(e,n){let t=y(e,n);for(;_(e[t]);)t=y(e,t+1);return t}function h(e,n){if(!H(e,n))return null;let t=n,i="";for(;t<e.length;){let o=e[t];if(o==="\\\\"){let a=R(e,t);if(!a)break;i+=a.value,t=a.end;continue}if(!I(o))break;i+=o,t+=1}return t===n?null:{value:i,end:t}}var C=45;function T(e){return e>=48&&e<=57}function z(e){return e>=128||e===C||e===95||T(e)||e>=65&&e<=90||e>=97&&e<=122}function J(e,n){let t=e.charCodeAt(n);return t>=1&&t<=31||t===127?!0:T(t)?n===0||n===1&&e.charCodeAt(0)===C:!1}function k(e){let n="";for(let t=0;t<e.length;t+=1){let i=e.charCodeAt(t),o=e[t];i===0?n+="\\uFFFD":J(e,t)?n+=`\\\\${i.toString(16)} `:t===0&&e.length===1&&i===C?n+=`\\\\${o}`:z(i)?n+=o:n+=`\\\\${o}`}return n}var W=/\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|\\\\(?:[0-9a-fA-F]{1,6}(?:\\r\\n|[ \\t\\r\\n\\f])?|[\\s\\S])|"(?:[^"\\\\]|\\\\[\\s\\S])*"|\'(?:[^\'\\\\]|\\\\[\\s\\S])*\'|\\[(?:\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|\\\\[\\s\\S]|"(?:[^"\\\\]|\\\\[\\s\\S])*"|\'(?:[^\'\\\\]|\\\\[\\s\\S])*\'|[^\\]"\'\\\\/]|\\/(?!\\*))*\\]/g;function Q(e){let n=new Array(e.length).fill(!0);for(let t of e.matchAll(W)){let i=t.index;n.fill(!1,i,i+t[0].length)}return n}function q(e,n,t){if(n.length===0||!e.includes("#"))return e;let i=new Set(n),o=Q(e),a="",u=0;for(;u<e.length;){let d=o[u]&&e[u]==="#"?h(e,u+1):null;d&&i.has(d.value)?(a+=t(d.value),u=d.end):(a+=e[u],u+=1)}return a}function X(e){let n="";for(let t=0;t<e.length;t+=1){if(e[t]==="\\\\"){let i=e[t+1];if(i!==void 0&&/[\\n\\r\\f]/.test(i)){t=$(e,t+1)-1;continue}let o=R(e,t);if(o){n+=o.value,t=o.end-1;continue}}n+=e[t]}return n}function N(e){return Array.from(e,n=>{let t=n.charCodeAt(0);return t===0?"\\uFFFD":t<32||t===127?`\\\\${t.toString(16)} `:n===\'"\'||n==="\\\\"?`\\\\${n}`:n}).join("")}function Y(e,n){return e?{kind:"any"}:n===void 0?{kind:"none"}:{kind:"named",prefix:n}}function Z(e,n){return e[n]==="|"&&e[n+1]!=="="}function B(e,n){let t=e[n]==="*",i=t?{value:"*",end:n+1}:h(e,n),o=y(e,i?.end??n);if(!Z(e,o))return t?null:i?{token:i,namespace:{kind:"none"}}:null;let a=h(e,y(e,o+1));return a?{token:a,namespace:Y(t,i?.value)}:null}function K(e){if(e[0]!=="[")return null;let n=A(e,1),t=B(e,n);if(!t)return null;let{token:i,namespace:o}=t;return{name:i.value,rawName:e.slice(n,i.end),namespace:o,end:i.end}}function ee(e,n){let t=/^(?:"((?:\\\\[\\s\\S]|[^"\\\\])*)"|\'((?:\\\\[\\s\\S]|[^\'\\\\])*)\')/.exec(e.slice(n));return t?{value:X(t[1]??t[2]),end:n+t[0].length}:h(e,n)}function ne(e,n){let t=A(e,n),i=h(e,t);if(i){if(!/^[is]$/i.test(i.value))return null;t=A(e,i.end)}return e[t]!=="]"||t!==e.length-1?null:{flag:i?.value}}function F(e){let n=K(e);if(!n)return null;let t=A(e,n.end),o=["=","~=","|=","^=","$=","*="].find(d=>e.startsWith(d,t));if(!o)return null;let a=ee(e,A(e,t+o.length));if(!a)return null;let u=ne(e,a.end);return u?{name:n.name,rawName:n.rawName,namespace:n.namespace,operator:o,value:a.value,flag:u.flag}:null}function E(e,n){return e.replace(W,t=>t.startsWith("[")?n(t):t)}var re="data-hf-svg-reference-aliases";function O(e,n,t,i){let o={"=":(s,r)=>s===r,"~=":(s,r)=>s.split(/[ \\t\\r\\n\\f]+/).includes(r),"|=":(s,r)=>s===r||s.startsWith(r+"-"),"^=":(s,r)=>s.startsWith(r),"$=":(s,r)=>s.endsWith(r),"*=":(s,r)=>s.includes(r)},a=(s,r,l)=>!r&&l!=="="&&l!=="|="?!1:o[l](s,r),u=s=>s.replace(/[A-Z]/g,r=>r.toLowerCase()),d=s=>{let r=F(s);if(!r)return s;let{name:l,rawName:g,namespace:m,operator:b,value:D,flag:w}=r;if(m.kind==="named"!=(i!==void 0))return s;let x=w?.toLowerCase()==="i"?u:S=>S,L=u(l),P=t.filter(S=>{let V=m.kind==="none"?S.name:S.localName,U=m.kind==="named"?i.get(m.prefix):null;return(m.kind==="any"||S.namespaceURI===U)&&u(V)===L}),v=new Set([s]);for(let S of P)a(x(S.before),x(D),b)&&v.add(`[${g}="${N(S.after)}"${w?` ${w}`:""}]`);return v.size===1?s:`:is(${[...v].join(", ")})`};if(i)return E(e,d);let p=new Map(n.map(({id:s,replacement:r})=>[s,r])),f=new Map;for(let s of t){if(s.name!=="id"||s.before===s.after||p.has(s.before))continue;let r=f.get(s.before);r||(r=new Set([`#${k(s.before)}`]),f.set(s.before,r)),r.add(`#${k(s.after)}`)}for(let[s,r]of f)p.set(s,`:is(${[...r].join(", ")})`);let c=q(e,[...p.keys()],s=>p.get(s));return E(c,d)}function se(e,n,t=!0){let i=[],a=(t?[...e.querySelectorAll(`[${n}]`)]:[]).map(d=>d.getAttribute(n)),u=e.getAttribute?.(n);u&&a.unshift(u);for(let d of a){let p;try{p=JSON.parse(d)}catch{continue}if(!Array.isArray(p))continue;let f=p;for(let c of f){if(!ie(c))continue;let{name:s,localName:r,namespaceURI:l,before:g,after:m}=c;i.push({name:s,localName:r,namespaceURI:l,before:g,after:m})}}return i}function ie(e){if(!e||typeof e!="object")return!1;let{name:n,localName:t,namespaceURI:i,before:o,after:a}=e;return typeof n=="string"&&typeof t=="string"&&(i===null||typeof i=="string")&&typeof o=="string"&&typeof a=="string"}function oe(e){let n=[],t=[],i=!1,o,a=new WeakMap,u=(f,c)=>{for(let s of f){if("selectorText"in s){let r=s,l=a.get(r),g=r.selectorText,m=l?.applied===g?l.authored:g,b=O(m,[],t,c);b!==g&&(r.selectorText=b),b===m?a.delete(r):a.set(r,{authored:m,applied:r.selectorText})}"cssRules"in s&&u(s.cssRules,c)}},d=()=>{if(t.length)for(let f of e.document.styleSheets){let c;try{c=f.cssRules}catch{continue}let s=new Map;for(let r of c){if(!("namespaceURI"in r))continue;let{prefix:l,namespaceURI:g}=r;l&&s.set(l,g||null)}s.size&&u(c,s)}},p={rewrite:(f,c=[])=>{if(typeof f!="string"||!f.includes("#")&&!f.includes("["))return f;let s=O(f,c.length?[...c,...n]:n,t);if(s!==f){if(!o){let r=e.document.createElement("div");o=r.matches.bind(r)}o(f)}return s},refresh(){t=se(e.document,re).filter(r=>r.before!==r.after);let f=new Set(t.filter(r=>r.name==="id").map(r=>r.before)),c=new Set;n=[];for(let r of e.document.querySelectorAll("[data-hf-authored-id][id]")){let l=r.getAttribute("data-hf-authored-id");if(!l||l===r.id||c.has(l)||f.has(l))continue;c.add(l);let g=N(l);n.push({id:l,replacement:`:is(#${k(l)}, [data-hf-authored-id="${g}"])`})}if(d(),i||!n.length&&!t.length)return;let s=e.Element.prototype;s.querySelector=new Proxy(s.querySelector,{apply(r,l,g){return Reflect.apply(r,l,[p.rewrite(g[0])])}}),s.querySelectorAll=new Proxy(s.querySelectorAll,{apply(r,l,g){return Reflect.apply(r,l,[p.rewrite(g[0])])}}),i=!0}};e.__hfSvgSelectorAliases=p,p.refresh()}function M(){let e=window;e.__hfSvgSelectorAliases||oe(e)}M();})();\n';function cx(){return XM}var De=UC(GS(),1),wl=De.default,TV=De.default.stringify,RV=De.default.fromJSON,MV=De.default.plugin,kV=De.default.parse,LV=De.default.list,NV=De.default.document,FV=De.default.comment,PV=De.default.atRule,IV=De.default.rule,DV=De.default.decl,OV=De.default.root,HV=De.default.CssSyntaxError,GV=De.default.Declaration,BV=De.default.Container,UV=De.default.Processor,WV=De.default.Document,VV=De.default.Comment,$V=De.default.Warning,qV=De.default.AtRule,zV=De.default.Result,jV=De.default.Input,KV=De.default.Rule,YV=De.default.Root,XV=De.default.Node;var vf="data-hf-authored-id",BS="data-hf-inner-root";function Af(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wf(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function ML(e){let t=e.trim();return t?Array.from(new Set([t,Xt(t)])).filter(Boolean):[]}function kL(e,t,n){let r=ML(t);return $a(e,r,()=>n)}function LL(e,t){let n=t?.trim();return n?kL(e,n,`[${vf}="${wf(n)}"]`):e}function US(e){return`${e}:not(:has([${BS}])), ${e} > [${BS}]`}function NL(e,t,n,r,o,i){let a=LL(e,r),l=FL(a,t,n),s=l.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return i?US(t):e;let c=new RegExp(`\\[\\s*data-composition-id\\s*[\\^\\*\\$]?=\\s*(["'])${Af(n)}\\1\\s*\\]`,"g");if(c.test(s))return s.replace(c,"").trim()===""?US(t):l.replace(c,t);let d=l.match(/^\s*/)?.[0]??"",f=l.match(/\s*$/)?.[0]??"";if(o){let m=r?`[${vf}="${wf(r)}"]`:null;if(m&&s.startsWith(m)){let p=s.slice(m.length);return`${d}${t}${m}${p}${f}`}}return`${d}${t} ${s}${f}`}function FL(e,t,n){let r=Af(n),o=String.raw`\[\s*data-composition-id\s*=\s*(?:"${r}"|'${r}')\s*\]`,i=String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`;return e.replace(new RegExp(`${o}(?:${i})+`,"g"),t).replace(new RegExp(`(?:${i})+${o}`,"g"),t)}var PL=new Set(["keyframes","-webkit-keyframes","font-face"]);function IL(e){return e?.type==="atrule"}function DL(e){let t=e.parent;for(;t;){if(IL(t)&&PL.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function OL(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function WS(e,t,n,r,o){let i=t.trim();if(!e||!i)return e;let a=n||`[data-composition-id="${wf(i)}"]`,l=HL(e);return l?BL(l,a,i,r,o):""}function HL(e){try{return wl.parse(e)}catch{return null}}function GL(e,t){e.walkRules(n=>{DL(n)||OL(n)||t(n)})}function BL(e,t,n,r,o){return GL(e,i=>{i.selectors=i.selectors.map(a=>NL(a,t,n,r,o?.compoundAuthoredRoot,o?.scopeRootSelectors))}),e.toResult({map:!1}).css}var UL="hf-scope-placeholder",n5=`[data-composition-id="${UL}"]`;function vt(e){return JSON.stringify(e).replace(/</g,"\\u003c")}var VS=`!__hfBaseHyperframes
|
|
43
|
+
`,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(o=>{o.classList.add("__hf-flash"),setTimeout(()=>o.classList.remove("__hf-flash"),t)})}catch(r){V("bridge.flashElements.querySelector",r)}}var pi={windowSeconds:3,choppyShare:.25,warmupSeconds:1,reportEveryMs:1e3},l1=.5,on=[],Os=null,ud=0,ib="",cd=!1,dd=0;function sb(e){Ce({source:"hf-preview",type:"preview-health",health:e})}function hi(){on=[],Os=null,cd&&sb(null),cd=!1,dd=0}var ab=null;function lb(e){e!==ab&&(ab=e,hi())}function Hs(){hi()}function u1(e,t,n){let r=pi.windowSeconds*1e3;for(;on[0]&&on[0].atMs<e-r;)on.shift();let o=on[0];if(!o)return;let i=e-(o.atMs-o.gapMs);if(i<r||e-dd<pi.reportEveryMs)return;let a=on.filter(f=>f.drawn).length,l=i/1e3*t*n,s=l>0?1-Math.min(a,l)/l:0,c=on.reduce((f,m)=>f+(m.waiting?m.gapMs:0),0),d=Math.max(s,c/i);cd=!0,dd=e,sb({droppedShare:Math.round(d*1e3)/1e3,seconds:Math.round(i/100)/10,choppy:d>=pi.choppyShare,fps:Math.round(a/(i/1e3)*10)/10,worstFrameMs:Math.round(Math.max(...on.map(f=>f.gapMs))),mode:"play"})}function ub(e){let{nowMs:t,filmTime:n,fps:r,rate:o}=e,i=`${r}|${o}|${e.layoutKey}`;if(!e.playing||e.hidden){hi();return}i!==ib&&(ib=i,hi());let a=Math.floor(n*r+1e-6),l=Os;if(Os={ms:t,film:n,frame:a},!l){ud=t+pi.warmupSeconds*1e3;return}let s=t-l.ms,c=l.film+s/1e3*o;if(n<l.film||n>c+l1){hi(),Os={ms:t,film:n,frame:a},ud=t+pi.warmupSeconds*1e3;return}t<ud||(on.push({atMs:t,gapMs:s,drawn:a!==l.frame,waiting:e.waiting}),u1(t,r,o))}var c1=1e3,pr=new Map,fd=!1,cb=!1,gi,Gs=!1;function d1(){for(let r of pr.keys())r.isConnected||pr.delete(r);let e=[...pr.values()],t=fd&&e.length>0;if(!t&&!cb)return!1;cb=t;let n=e.reduce((r,o)=>r+(o.state==="ready"?1:o.progress??0),0);return Ce({source:"hf-preview",type:"preview-copies",copies:t?{total:e.length,ready:e.filter(r=>r.state==="ready").length,failed:e.filter(r=>r.state==="failed").length,progress:n/e.length,error:e.some(r=>r.state==="failed")?"failed":null}:null}),!0}function md(){if(gi!==void 0){Gs=!0;return}d1()&&(gi=setTimeout(()=>{gi=void 0,Gs&&(Gs=!1,md())},c1))}function db(e){pr.clear(),fd=e<1,clearTimeout(gi),gi=void 0,Gs=!1,md()}function Nn(e,t,n=null){fd&&(pr.set(e,{state:t,progress:n}),md())}function fb(){return[...pr].filter(([,e])=>e.state==="failed").map(([e])=>e)}function mb(){return[...pr.values()].every(e=>e.state==="ready")}var pd=null;function pb(e){pd=e}function St(e,t){if(pd)try{pd({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){V("runtime.analytics.site1",n)}}function f1(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 o=t.slice(n,r);return o.length>0?o:"node"}function Zr(e){return`--${f1(e)}`}function hb(e){let t=new Map;for(let n of e){let r=Zr(n),o=t.get(r);o?o.includes(n)||o.push(n):t.set(r,[n])}return[...t.values()].filter(n=>n.length>1)}function bb(){if(typeof document>"u")return{};let e=new Set;document.documentElement?.hasAttribute("data-composition-variables")&&e.add(document.documentElement);for(let o of Array.from(document.querySelectorAll("[data-composition-variables]")))e.add(o);let t={};for(let o of e)Object.assign(t,bi(o));let n=Us(),r={...t,...n};for(let o of e)gd(o,r);return r}var gb=new Set;function yb(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 m1(e,t){return t?.trim()||e.getAttribute("data-composition-id")?.trim()||e.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()||"composition"}function p1(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 h1(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=p1(e);return r.length===0||r.some(o=>String(o)===String(n))?null:{id:e.id,value:n,allowed:r}}function gd(e,t,n){if(!e)return;let r=yb(e);if(r.length===0)return;let o=m1(e,n);for(let i of r){let a=h1(i,t);if(!a)continue;let l=`${o}|${a.id}|${String(a.value)}`;if(gb.has(l))continue;gb.add(l);let s="default"in i?JSON.stringify(i.default):"the composition default";globalThis.console.warn(`[hyperframes] runtime_unknown_enum_value: ${o} variable "${a.id}" got ${JSON.stringify(a.value)}, which is not a declared option (${a.allowed.join(", ")}). Rendering ${s} instead.`)}}function bi(e){let t={};for(let n of yb(e))typeof n.id!="string"||!("default"in n)||(t[n.id]=n.default);return t}var hd="data-hf-css-vars";function Bs(e){return"style"in e&&typeof e.style?.setProperty=="function"}function bd(e,t){if(!Bs(e))return;let n=[];for(let[r,o]of Object.entries(t))if(typeof o=="string"&&o!==""||typeof o=="number"){let i=Zr(r);e.style.setProperty(i,String(o)),n.push(i)}n.length>0&&e.setAttribute(hd,n.join(" "))}function xb(e,t,n){let r={};for(let[o,i]of Object.entries(t)){let a=Zr(o);((Bs(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(r[o]=i)}return r}function Sb(e){if(!Bs(e))return;let t=e.getAttribute(hd);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(hd)}}function Eb(e){let t=new Set;e.documentElement?.hasAttribute("data-composition-variables")&&t.add(e.documentElement);for(let o of Array.from(e.querySelectorAll("[data-composition-variables]")))t.add(o);let n=Us(),r=[];for(let o of t)r.push(...g1(o,n,e.defaultView));for(let o of hb(r))globalThis.console.warn(`composition variables ${o.join(", ")} collapse to the same CSS property ${Zr(o[0]??"")}. Rename one to avoid cross-talk`)}function g1(e,t,n){if(!Bs(e))return[];let r=bi(e),o={};for(let[i,a]of Object.entries(r)){if(i in t)continue;let l=Zr(i);(e.style.getPropertyValue(l)||(n?n.getComputedStyle(e).getPropertyValue(l):"")).trim()===""&&(o[i]=a)}for(let[i,a]of Object.entries(t))i in r&&(o[i]=a);return bd(e,o),Object.keys(r)}function vb(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 Us(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}function Ws(e,t,n,r){let o=!1;try{e.pause()}catch(i){o=!0,V(r,i)}try{e.currentTime=t}catch(i){V(n,i)}if(o)try{e.pause()}catch(i){V(r,i)}}function Ab(e){let t=[],n=(m,p=()=>m.getAnimations())=>{if(typeof m.getAnimations!="function")return[];try{return p()}catch{return[]}},r=m=>{let p=new Map;if(t.length===0)return p;let b=typeof CSSAnimation<"u";for(let y of n(document,m)){if(b&&!(y instanceof CSSAnimation))continue;let x=y.effect;if(!x?.target||x.pseudoElement)continue;let E=p.get(x.target);E?E.push(y):p.set(x.target,[y])}return p},o=(m=[],p=[])=>[...p,...m.filter(b=>!p.includes(b)&&b.playState!=="idle")],i=m=>{let p=m.closest("[data-start]")??m;return e?.resolveStartSeconds?e.resolveStartSeconds(p):Number.parseFloat(p.getAttribute("data-start")??"0")||0},a=m=>{let p=v=>(v||"").split(",").map(_=>Number.parseFloat(_)/(_.trim().endsWith("ms")?1e3:1)),b=p(m.animationDuration),y=p(m.animationDelay),x=m.animationName.split(","),E=0;return x.forEach((v,_)=>{if(v.trim()==="none")return;let U=y[_%y.length]+b[_%b.length];U>E&&(E=U)}),{cycleSeconds:E,delays:x.map((v,_)=>y[_%y.length]||0)}},l=(m,p)=>{let b=null;try{b=m.effect?.getComputedTiming?.()??null}catch(x){V("runtime.adapters.css.site5",x)}if(!b)return{};let y=Number(b.endTime);return Number.isFinite(y)?{endSeconds:p+y/1e3}:{unbounded:!0}},s=(m,p)=>{for(let b of m)Ws(b,p,"runtime.adapters.css.site1","runtime.adapters.css.site2")},c=m=>{for(let p of m)try{p.play()}catch(b){V("runtime.adapters.css.site3",b)}},d=m=>{for(let p of m)try{p.pause()}catch(b){V("runtime.adapters.css.site4",b)}},f=m=>{m.baseDelay?m.el.style.animationDelay=m.baseDelay:m.el.style.removeProperty("animation-delay"),m.basePlayState?m.el.style.animationPlayState=m.basePlayState:m.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{for(let b of t)f(b);let m=new Map(t.map(b=>[b.el,b.handles]));t=[];let p=document.querySelectorAll("*");for(let b of p){if(!we(b))continue;let y=window.getComputedStyle(b);!y.animationName||y.animationName==="none"||t.push({el:b,baseDelay:b.style.animationDelay||"",basePlayState:b.style.animationPlayState||"",...a(y),handles:m.get(b)})}},getAnimationCycleEndSeconds:()=>{let m=0;for(let p of t)!p.el.isConnected||p.cycleSeconds<=0||(m=Math.max(m,i(p.el)+p.cycleSeconds));return m>0?m:null},getInferredDurationSeconds:()=>{let m=0;for(let p of t){if(!p.el.isConnected)continue;let b=i(p.el);for(let y of n(p.el)){let x=l(y,b);x.endSeconds!=null&&(m=Math.max(m,x.endSeconds))}}return m>0?m:null},seek:m=>{let p=Number(m.time)||0,b=r(m.pageAnimations);for(let y of t)y.handles=o(y.handles,b.get(y.el));for(let y of t){if(!y.el.isConnected)continue;let x=i(y.el),E=Math.max(0,p-x)*1e3;if(y.handles?.length){y.el.style.animationDelay!==y.baseDelay&&f(y),s(y.handles,E);continue}y.el.style.animationPlayState="paused",y.el.style.animationDelay=y.delays.map(v=>`${Number((v-E/1e3).toFixed(3))}s`).join(", ")}},pause:m=>{let p=r(m?.pageAnimations);for(let b of t){if(!b.el.isConnected)continue;let y=p.get(b.el);y&&(d(y),f(b))}},play:()=>{let m=r();for(let p of t)p.el.isConnected&&(f(p),c(m.get(p.el)??[]))},revert:()=>{t=[]}}}function qs(e,t,n){e.totalDuration?.();let r=e.getChildren?.(!1,!0,!0)??[],o=v1(e,n,t).map(s=>[s,s.ratio,s._zTime,s._act]),i=Tb(r,t).map(s=>[s,s._ts]),a=new Set;for(let[s]of i)for(let c=s.parent;c&&!a.has(c);c=c.parent)a.add(c);let l=[...a].map(s=>[s,s._dur,s._tDur,s._end,s._dirty]);for(let[s]of i)s._ts=0;try{b1(e,r,t,n)}finally{for(let[s,c]of i)s._ts=c;for(let[s,c,d,f,m]of l)Object.assign(s,{_dur:c,_tDur:d,_end:f,_dirty:m})}for(let[s,c,d,f]of o)s.ratio=c,s._zTime=d,s._act=f}function b1(e,t,n,r){let o=n>=Vs;e.totalTime(o?n-Vs:n+Vs,!0),Lb(t,n,o?Vs:0),e.totalTime(n,!0),!o&&r&&Cb(e,r,n)}function Cb(e,t,n){for(let r of E1(e,t,n)){let{ratio:o,_zTime:i,_act:a}=r;r.render(0,!0,!0),Object.assign(r,{ratio:o,_zTime:i,_act:a})}}function y1(e){let t=e,[n]="_first"in t?t._first?[t._first]:[]:e.getChildren?.(!1,!0,!0)??[],r=n?.parent;return r!==void 0&&!r._initted}function yi(e,t,n,r){if(typeof e.totalTime!="function")return typeof e.seek=="function"&&e.seek(t,n),!1;let o=Number(e.totalTime());return e.totalTime(t,n),t<o&&r&&Cb(e,r,t),o!==t||!y1(e)?!1:(qs({totalTime:e.totalTime.bind(e),totalDuration:e.totalDuration?.bind(e),getChildren:e.getChildren?.bind(e)},t,r),!0)}var yd=1e-6;function Tb(e,t,n=[]){for(let r of e)r.startTime()>t+yd?n.push(r):r.getChildren&&r.endTime()>=t&&Tb(r.getChildren(!1,!0,!0),r.time(),n);return n}function Rb(e){return(e.getChildren?.(!0,!0,!0)??[]).filter(t=>{let n=t;return typeof n.getChildren=="function"||n.totalDuration?.()===0})}var wb=new WeakMap,_b=.05;function x1(e,t){let n=Number(e._start);for(let r=e.parent;r&&r!==t;r=r.parent){if(r._repeat||!r._ts)return null;n=Number(r._start)+n/r._ts}return Number.isFinite(n)?n:null}function S1(e,t){let n={version:t.version,always:[],points:[]};for(let r of Rb(e)){let o=r,i=typeof o.getChildren=="function"?null:x1(o,t.owner);i===null?n.always.push(r):n.points.push({at:i,mark:r})}return n.points.sort((r,o)=>r.at-o.at),n}function Mb(e,t){let n=0,r=e.length;for(;n<r;){let o=n+r>>1;e[o].at<t?n=o+1:r=o}return n}function kb(e,t){let n=wb.get(t.owner);return n?.version!==t.version&&(n=S1(e,t),wb.set(t.owner,n)),n}function E1(e,t,n){let{points:r}=kb(e,t),o=[];for(let i=Mb(r,n-yd);i<r.length&&!(r[i].at>n+yd);i++)o.push(r[i].mark);return o}function v1(e,t,n){if(!t)return Rb(e);let r=kb(e,t),{points:o}=r,i=[...r.always],a=n+_b;for(let l=Mb(o,n-_b);l<o.length&&!(o[l].at>a);l++)i.push(o[l].mark);return i}var $s=2e-8,Vs=.001,A1=e=>{let t=e;return typeof t?.render=="function"&&typeof t.startTime=="function"&&typeof t.paused=="function"&&typeof t.timeScale=="function"&&t.timeScale()>0&&!t.paused()};function w1(e){return e.vars?.keyframes&&(e.render($s,!0),e.render(-$s,!0)),e._startAt&&e._startAt.render($s,!0,!0),!!(e.vars?.keyframes||e._startAt)}function Lb(e,t,n){for(let r of e.filter(A1)){let o=(t-r.startTime())*r.timeScale();Math.abs(o)<1e-9&&w1(r)||o>0&&_1(r,o,n*r.timeScale())}}function _1(e,t,n){t<n&&e._startAt&&e._startAt.render($s,!0,!0);let r=e.getChildren?e:e.timeline;r?.getChildren&&t<=e.totalDuration()&&Lb(r.getChildren(!1,!0,!0),t,n)}function Nb(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),o=t.suppressEvents===!0;typeof n.totalTime=="function"?(n.totalTime(r,o),qs({totalTime:n.totalTime.bind(n),totalDuration:n.totalDuration?.bind(n),getChildren:n.getChildren?.bind(n)},r)):n.seek(r,o)},pause:()=>{let t=e.getTimeline();t&&t.pause()}}}function Fb(){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 o of t)r.has(o)||n.push(o);window.__hfAnime=n}catch(e){V("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(o){V("runtime.adapters.animejs.site2",o)}},pause:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.pause=="function"&&t.pause()}catch(n){V("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){V("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function Ob(e){let t=r=>{let o=Ib(r),i=o&&typeof o.closest=="function"?o.closest("[data-composition-id]"):null;return i&&e?.resolveStartSeconds?e.resolveStartSeconds(i):0},n=(r,o)=>Math.max(0,o-t(r));return{name:"lottie",discover:()=>{try{let r=window.lottie;if(r&&typeof r.getRegisteredAnimations=="function"){let o=r.getRegisteredAnimations();if(Array.isArray(o)&&o.length>0){let i=window.__hfLottie??[],a=new Set(i);for(let l of o)a.has(l)||i.push(l);window.__hfLottie=i}}}catch(r){V("runtime.adapters.lottie.site1",r)}},seek:r=>{let o=Math.max(0,Number(r.time)||0),i=window.__hfLottie;if(!(!i||i.length===0))for(let a of i)try{let l=n(a,o),s=a.loop===!0;if(zs(a)){let c=l*a.frameRate;a.totalFrames>0&&s?a.goToAndStop(xd(c,a.totalFrames),!0):a.totalFrames>0&&c>=a.totalFrames?a.goToAndStop(a.totalFrames-1,!0):a.goToAndStop(l*1e3,!1)}else if(Sd(a)){if(typeof a.setFrame=="function"){let c=a.totalFrames??0,d=a.duration??0;if(!Number.isFinite(c)||c<=0||!Number.isFinite(d)||d<=0)continue;let f=l*c/d;a.setFrame(Math.min(s?xd(f,c):f,c-1))}else if(typeof a.setCurrentRawFrameValue=="function"){let c=a.totalFrames??0,d=a.frameRate??30,f=s&&c>0?xd(l*d,c):l*d;c>0&&a.setCurrentRawFrameValue(Math.min(f,c-1))}else if(typeof a.seek=="function"){let c=a.duration??0;if(Number.isFinite(c)&&c>0){let d=Math.min(100,(s?l%c:l)/c*100);a.seek(d)}}}}catch(l){V("runtime.adapters.lottie.site2",l)}},pause:()=>{let r=window.__hfLottie;if(!(!r||r.length===0))for(let o of r)try{(zs(o)||Sd(o))&&o.pause()}catch(i){V("runtime.adapters.lottie.site3",i)}},revert:()=>{},getInferredDurationSeconds:()=>Pb((r,o)=>o),getAnimationCycleEndSeconds:()=>Pb((r,o)=>Ib(r)?.isConnected===!1?null:t(r)+o)}}function Pb(e){let t=window.__hfLottie;if(!t||t.length===0)return null;let n=0,r=!1;for(let o of t){let i=null;try{let a=C1(o);i=a==null?null:e(o,a)}catch(a){V("runtime.adapters.lottie.site4",a)}i!=null&&(r=!0,n=Math.max(n,i))}return r?n:null}function Ib(e){return zs(e)?e.wrapper:e.canvas}function xd(e,t){let n=e%t;return t-n<1e-6?0:n}function Db(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function C1(e){return zs(e)?Db(e.totalFrames,e.frameRate):Sd(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:Db(e.totalFrames,e.frameRate):null}function zs(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function Sd(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}function Hb(){let e=null,t=0,n=null,r=null,o=null,i=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=c=>{i||c.itemsTotal<=c.itemsLoaded||(i=new Promise(d=>{c.onLoad=function(){try{o?.call(this)}finally{i=null,c.onLoad=o??null,d()}}}))},s=c=>{n!==c&&(n=c,r=c.onStart??null,o=c.onLoad??null,c.onStart=function(d,f,m){try{r?.call(this,d,f,m)}finally{l(c)}})};return{name:"three",discover:()=>{let c=a();c&&(s(c),l(c))},seek:c=>{e=Math.max(0,Number(c.time)||0),t=e,window.__hfThreeTime=e,ws(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0},getReadyPromise:()=>{let c=a();return!c||c.itemsTotal<=c.itemsLoaded?null:(i||l(c),i)}}}function Bt(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 o=r.filter(i=>!n.has(i));return o.length===0?null:t||(t=Promise.allSettled(o.map(i=>e.waitFor(i).then(()=>{n.add(i)}))).then(()=>{t=null}),t)}}}function Gb(){return Bt({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 Bb(){return Bt({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 Ub(){return Bt({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 Wb(){return Bt({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 Vb(){return Bt({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}var T1=250;function $b(){let e=null,t=0,n=null,r=()=>{n!==null&&(window.clearInterval(n),n=null)},o=()=>{n===null&&document.querySelector("[data-composition-id][data-requires-webgpu]")&&(n=window.setInterval(()=>{e!==null&&(A0()||(window.__hfTypegpuTime=e,_s(e)))},T1))};return{name:"typegpu",discover:()=>{},seek:i=>{e=Math.max(0,Number(i.time)||0),t=e,window.__hfTypegpuTime=e,ws(e)},pause:()=>{e==null&&(e=Math.max(0,t)),o()},play:()=>{r(),e=null},revert:()=>{r(),e=null,t=0}}}var eo=new Map,qb=()=>eo.size>0;function zb(e){if(eo.has(e.element))throw new Error("This element already has a frame source");let t=e.sourceRange;if(t&&(!Number.isFinite(t.start)||t.start<0||!Number.isFinite(t.duration)||t.duration<=0||!Number.isFinite(t.fps)||t.fps<=0))throw new Error("Frame source ranges require a nonnegative start, positive duration and FPS");let n=new AbortController,r=new Promise(c=>{n.signal.addEventListener("abort",()=>c(),{once:!0})}),o=Promise.race([Promise.resolve(e.ready),r]);o.catch(()=>{});let i=null,a=null,l=async()=>{let c;try{for(await o;!n.signal.aborted&&i!==null;){let d=i;i=null;try{await Promise.race([e.render(d,n.signal),r])}catch(f){c??(c={reason:f})}}if(c)throw c.reason}finally{i=null,a=null}},s={element:e.element,ready:o,seek(c){return i=t?t.start+Math.min(Math.max(0,c),Math.max(0,t.duration-1/t.fps)):c,a??(a=l()),a},dispose(){n.signal.aborted||(n.abort(),i=null,eo.delete(e.element),e.dispose?.())}};return eo.set(e.element,s),s.dispose}function jb(e){let t=new Set,n=[],r=null,o=()=>{for(let l of t)eo.get(l.element)!==l&&t.delete(l);let a=[];for(let[l,s]of eo){if(!l.isConnected){s.dispose();continue}t.has(s)||(t.add(s),Qe(s.ready)),a.push([l,s])}return a},i=new MutationObserver(()=>{o()});return i.observe(document,{childList:!0,subtree:!0}),{name:"frame-source",discover:()=>{o()},pause:()=>{},seek:({time:a})=>{for(let[l,s]of o()){let c=e.start(l),d=e.duration(l),f=c+(d??1/0),m=e.exportRenderSeek()?Ls(c,f,e.canonicalFps()):{start:c,end:f};if(!zr(a,m.start,m.end,e.compositionDuration()))continue;let p=Math.max(0,a-c),b=Rn(l)+Hr(Ht(l),p);Qe(s.seek(b))}},getReadyPromise:()=>{let a=o().map(([,l])=>l);return a.length===0?null:((a.length!==n.length||a.some((l,s)=>l!==n[s]))&&(n=a,r=Promise.all(a.map(l=>l.ready))),r)},revert:()=>{i.disconnect();for(let a of t)a.dispose();t.clear()}}}function Kb(e){let t=e.nextElementSibling;if(Je(t)&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;let n=Tt(e);return n&&n.complete&&n.naturalWidth>0?n:null}function Yb(){let e=globalThis.GPUQueue;if(!e?.prototype?.copyExternalImageToTexture)return;let t=e.prototype.copyExternalImageToTexture;e.prototype.copyExternalImageToTexture=function(n,r,o){if(Le(n?.source)){let i=Kb(n.source);if(i)return t.call(this,{...n,source:i},r,o)}return t.call(this,n,r,o)}}function Xb(){let e=[globalThis.WebGL2RenderingContext,globalThis.WebGLRenderingContext],t=["texImage2D","texSubImage2D"];for(let n of e){let r=n?.prototype;if(r)for(let o of t){let i=r[o];if(typeof i!="function"||i.__hfVideoPatched)continue;let a=function(...l){let s=l.length-1,c=l[s];if(Le(c)){let d=Kb(c);d&&(l[s]=d)}return i.apply(this,l)};a.__hfVideoPatched=!0,r[o]=a}}}var R1=e=>typeof CSSAnimation<"u"&&e instanceof CSSAnimation||typeof CSSTransition<"u"&&e instanceof CSSTransition;function Jb(){let e=!1,t=0,n=!1,r,o,i,a=new Set,l=new WeakMap,s=(x=()=>document.getAnimations())=>{if(!document.getAnimations)return[];try{return x()}catch{return[]}},c=x=>{let E=Number(x.currentTime);return Number.isFinite(E)&&E>0?E:0},d=(x,E)=>E<=0?x:x>=E?Math.max(0,x-E):x,f=(x,E)=>{let v=l.get(x);if(v)return v;let _={compositionTimeMs:E,animationTimeMs:e?d(c(x),E):c(x)};return l.set(x,_),_},m=(x,E)=>{if(!a.has(x)){a.add(x);let v=()=>{a.delete(x)};try{x.addEventListener("finish",v,{once:!0}),x.addEventListener("cancel",v,{once:!0})}catch(_){V("runtime.adapters.waapi.site4",_)}}f(x,E)},p=(x,E)=>{for(let v of x)m(v,E)},b=()=>{if(n||typeof Element>"u")return;let x=Element.prototype;if(typeof x.animate!="function"||x.__hfOriginalAnimate)return;let E=x.animate;try{Object.defineProperty(x,"__hfOriginalAnimate",{value:E,configurable:!0});let v=function(..._){let U=E.apply(this,_);return m(U,t),U};x.animate=v,r=x,o=E,i=v,n=!0}catch{}},y=x=>{let E=null;try{E=x.effect?.getComputedTiming?.()??null}catch(U){V("runtime.adapters.waapi.site4",U)}if(!E)return{};let v=Number(E.endTime);return Number.isFinite(v)?{endSeconds:(l.get(x)?.compositionTimeMs??0)/1e3+v/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,b(),p(s(),t)},seek:x=>{let E=Math.max(0,(Number(x.time)||0)*1e3);t=E,(!e||a.size>0)&&p(s(x.pageAnimations),e?E:0);for(let v of a){if(v.playState==="idle"&&R1(v)){a.delete(v);continue}let _=e?f(v,E):f(v,0),U=_.animationTimeMs+Math.max(0,E-_.compositionTimeMs);Ws(v,U,"runtime.adapters.waapi.site1","runtime.adapters.waapi.site2")}},pause:x=>{e||p(s(x?.pageAnimations),t);for(let E of a)try{E.pause()}catch(v){V("runtime.adapters.waapi.site3",v)}},revert:()=>{if(a.clear(),l=new WeakMap,e=!1,t=0,r&&o&&i&&r.animate===i)try{r.animate=o,r.__hfOriginalAnimate===o&&delete r.__hfOriginalAnimate}catch(x){V("runtime.adapters.waapi.site5",x)}r=void 0,o=void 0,i=void 0,n=!1},getInferredDurationSeconds:()=>{let x=0;for(let E of s()){let v=y(E);v.endSeconds!=null&&(x=Math.max(x,v.endSeconds))}return x>0?x:null}}}var Rt=new WeakMap;function xi(e){return Rt.has(e)?Rt.get(e)??null:e.getAttribute("src")}var Zb="hf-proxy-box",ey="hf-proxy-light",js="hf-proxy-retry",ty="X-HF-Proxy-Progress",M1=[256,304,362,430,512,608,724,862,1024,1218,1448,1722,2048,2436,2896,3444,4096,4870,5792,6888,8192];function Qb(e){return e>0?M1.find(t=>t>=e)??null:null}function Ed(e,t){let n=Qb(e),r=Qb(t);return n&&r?{width:n,height:r}:null}function ny(e){return`${e.width}x${e.height}`}var vd=[1,.5,.25,.125];function ry(e){return vd.some(t=>t===e)}var k1=.5,L1=4e7;function Ks(e,t){return Ed(e.width*t,e.height*t)??e}function Ys(e,t){return t.width*t.height<=k1*e.width*e.height||e.bitDepth>8||e.bitrate>=L1}var N1=3;function F1(e){let t=new URL(e,document.baseURI);return t.searchParams.delete(js),t.href}async function Ad(e,t,n){let r=0,o=e;for(;t();){let i=await fetch(o,{headers:{Range:"bytes=0-0"},cache:"no-store"}).catch(()=>null);o=F1(e),i?.body?.cancel().catch(()=>{});let a=i?.status===202||i?.status===503,l=i?.status===202?i.headers.get(ty):null;if(l!==null&&Number.isFinite(Number(l))&&n?.(Math.min(1,Math.max(0,Number(l)))),!a&&i?.ok)return!0;if(!a&&++r>N1)return!1;let s=Math.min(Number(i?.headers.get("Retry-After"))||2,30);await new Promise(c=>setTimeout(c,s*1e3))}return!1}var P1="hf-proxy",oy="runtime_media_proxy_fallback",iy="runtime_media_proxy_unavailable",ay=new WeakSet,Ut=new WeakMap;function Xs(e){return e.currentSrc||e.src}var an=1,wd=new WeakSet,_d=new WeakSet,Et=window.parent===window?1:null,sy=()=>{},I1=new Promise(e=>sy=e),D1=1e3,Pn=new Map,hr=new WeakMap;function O1(){return Et!==null?Promise.resolve(Et):Promise.race([I1.then(()=>Et),new Promise(e=>setTimeout(()=>e(null),D1))])}function Cd(e,t){if(getComputedStyle(e).objectFit==="none")return null;let n=e.getBoundingClientRect(),r=document.documentElement,o=t*(window.devicePixelRatio||1);return Ed(Math.max(n.width,r.clientWidth)*o,Math.max(n.height,r.clientHeight)*o)}function ly(e){if(!(!(e>0)||!Number.isFinite(e))){Et=e,sy();for(let t of Pn.keys())Qs(t,e)}}function uy(e){let t=window.__HF_MEDIA_CODEC_MAP__,n=no(e);return t&&n!==null?ro(n,t):null}function Js(e){let t=window.__HF_MEDIA_SOURCE_FACTS__,n=no(e);return t&&n!==null?ro(n,t):null}function Qs(e,t){let n=Pn.get(e);if(!n)return;if(!e.isConnected||e.getAttribute("src")!==n.href){Pn.delete(e);return}let r=Cd(e,t),o=an<1,i=r&&o?Ks(r,an):r;if(!(o&&!i)){if(i&&o&&n.light&&H1(e,i))return cy(e);G1(n.box,i,o)||U1(e,n,o||!i?i:B1(i,n.box))}}function H1(e,t){let n=Js(e);return n!==null&&!Ys(n,t)}function G1(e,t,n){return n?t?.width===e.width&&t.height===e.height:t!==null&&t.width<=e.width&&t.height<=e.height}function B1(e,t){return{width:Math.max(e.width,t.width),height:Math.max(e.height,t.height)}}function U1(e,t,n){let r=fy(t.originalSrc,t.variant,n,t.light,_d.delete(e));if(hr.get(e)===r)return;hr.set(e,r);let o=()=>hr.get(e)===r&&e.isConnected&&e.getAttribute("src")===t.href;Nn(e,"making"),Ad(r,o,i=>Nn(e,"making",i)).then(i=>{o()&&Nn(e,i?"ready":"failed"),i&&o()&&dy(e,r,t.originalSrc,t.variant,n,t.light),hr.get(e)===r&&hr.delete(e)})}function cy(e){let t=Rt.get(e)??null;for(let n of[Pn,hr,Ut,Rt])n.delete(e);wd.delete(e),Rs(e),Hs(),t===null?e.removeAttribute("src"):e.setAttribute("src",t),e.load()}function dy(e,t,n,r,o,i=!1){o?Pn.set(e,{originalSrc:n,variant:r,href:t,box:o,light:i}):Pn.delete(e),Rs(e),Hs(),e.src=t,e.load()}function to(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:Le(e)&&!!Tt(e)}function no(e){let t=Xs(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 W1(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 V1(e,t){let n=e.normalize("NFC").toLowerCase(),r=-1,o=null,i=!1;for(let[a,l]of Object.entries(t)){let s=a.normalize("NFC").toLowerCase();n.endsWith(s)&&(s.length>r?(r=s.length,o=l,i=!1):s.length===r&&(i=!0))}return i?null:o}function ro(e,t){return t[e]??W1(e,t)??V1(e,t)}function fy(e,t,n,r=!1,o=!1){let i=new URL(e,document.baseURI);return i.searchParams.set(P1,t),n&&i.searchParams.set(Zb,ny(n)),r&&n&&i.searchParams.set(ey,"1"),o&&i.searchParams.set(js,"1"),i.href}var $1={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 Fn(e,t,n){if(ay.has(e))return;ay.add(e);let r=$1[t];Ce({source:"hf-preview",type:"diagnostic",code:iy,details:{asset:n,codecName:null,reason:t,note:r}}),globalThis.console.info(`[hyperframes] ${iy}: "${n}" (${t}): ${r}`)}async function q1(e,t,n){let{originalSrc:r,originalAttr:o,variant:i,lightFacts:a,level:l,live:s}=t,c=n===null?null:Cd(e,n),d=c&&l<1?Ks(c,l):c;if(a&&!(d&&Ys(a,d))){Ut.get(e)===o&&Ut.delete(e);return}let f=fy(r,i,d,a!==void 0,_d.delete(e));Nn(e,"making");let m=await Ad(f,s,p=>Nn(e,"making",p));if(!s()){Ut.get(e)===o&&Ut.delete(e),a&&e.isConnected&&e.getAttribute("src")===o&&py(e);return}if(!m){Nn(e,"failed"),Fn(e,"proxy_playback_failed",r);return}return Nn(e,"ready"),Rt.set(e,o),a&&wd.add(e),dy(e,f,r,i,d,a!==void 0),Et!==null&&Qs(e,Et),new Promise(p=>{e.addEventListener("loadeddata",p,{once:!0}),e.addEventListener("error",p,{once:!0})})}function Si(e,t=null,n="reactive",r){if(Rt.has(e)||Ut.has(e)&&Ut.get(e)===e.getAttribute("src"))return;let o=Xs(e),i=t?t.hasAlpha?"vp8":"h264":"auto";try{new URL(o,document.baseURI)}catch(p){V("runtime.mediaProxy.swap",p),Fn(e,"invalid_source_url",o);return}let a=e.getAttribute("src");Ut.set(e,a);let l=an,c={originalSrc:o,originalAttr:a,variant:i,lightFacts:r,level:l,live:()=>e.isConnected&&e.getAttribute("src")===a&&(!r||an===l)},d=O1().then(p=>q1(e,c,p));if(r)return;Qe(Promise.race([d,new Promise(p=>setTimeout(p,Vc))]),"video-frame");let f=t?.codecName??null;Ce({source:"hf-preview",type:"diagnostic",code:oy,details:{asset:o,codecName:f,trigger:n,note:"render output is unaffected; only this preview element was swapped to an authoring proxy"}}),globalThis.console.info(`[hyperframes] ${oy}: "${o}" uses a codec (${f??"unknown"}) this browser can't decode; auto-swapped to an authoring proxy for this preview only. Render output is unaffected.`)}function my(e){if(to(e)||!Le(e)||Rt.has(e))return;let t=uy(e),n=t?.representativeMime?e.canPlayType(t.representativeMime):"",r=n==="probably"||n==="maybe";t?.browserHostile&&!r?Si(e,t,"proactive"):an<1&&Td(e,t)}function Td(e,t){if(Rt.has(e)||Ut.has(e))return;let n=Js(e);n&&Si(e,t,"light",n)}function py(e){if(!(to(e)||!Le(e))){if(an===1&&wd.has(e))return cy(e);if(Pn.has(e)&&Et!==null)return Qs(e,Et);an<1&&Td(e,uy(e))}}function hy(e){if(!(!ry(e)||e===an)){an=e,db(e),Hs();for(let t of document.querySelectorAll("video"))py(t)}}function gy(){if(Et===null)return[];let e=[...document.querySelectorAll("video")].flatMap(t=>{let n=Js(t),r=n&&Cd(t,Et??1);return n&&r?[{facts:n,shown:r}]:[]});return vd.filter(t=>t<1&&e.some(({facts:n,shown:r})=>Ys(n,Ks(r,t))))}function by(){let e=new Map;for(let t of document.querySelectorAll("video")){let n=no(t),r=window.__HF_MEDIA_CODEC_MAP__,{width:o=0,height:i=0,bitDepth:a=0,codec:l}=Js(t)??{},s=r&&n!==null?ro(n,r)?.codecName:void 0,c=l??s??"unknown",d=`${c}|${o}|${i}|${a}`,f=e.get(d)??{codec:c,width:o,height:i,bitDepth:a,count:0};f.count+=1,e.set(d,f)}return[...e.values()]}function yy(){for(let e of fb()){_d.add(e),Ut.delete(e),hr.delete(e);let t=window.__HF_MEDIA_CODEC_MAP__,n=no(e),r=t&&n!==null?ro(n,t):null;Pn.has(e)&&Et!==null?Qs(e,Et):r?.browserHostile?Si(e,r,"reactive"):Td(e,r)}}function xy(e){if(to(e)||!Le(e)||e.videoWidth!==0)return;let t=Xs(e);if(Rt.has(e)){Fn(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=no(e);if(r===null){Fn(e,"cross_origin",t);return}let o=ro(r,n);if(o&&!o.browserHostile){Fn(e,"browser_safe_codec",t);return}Si(e,o,"reactive")}function Sy(e){if(to(e)||!Le(e))return;let t=Xs(e);if(Rt.has(e)){Fn(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=no(e);if(r===null){Fn(e,"cross_origin",t);return}let o=ro(r,n);if(o&&!o.browserHostile){Fn(e,"browser_safe_codec",t);return}Si(e,o,"tertiary")}var $e=class extends Error{constructor(n,r=null){super(r==null?n:`${n} at line ${r}`);Se(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=r}},z1=[0,0,0],j1=[1,1,1],Zs=64;function K1(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 In(e,t){let n=Number(e);if(!Number.isFinite(n))throw new $e(`Invalid number "${e}"`,t);return n}function Ey(e,t,n){if(e.length!==3)throw new $e(`${t} expects three numbers`,n);return[In(e[0],n),In(e[1],n),In(e[2],n)]}function vy(e,t,n){if(!e)throw new $e(`${t} expects a size`,n);let r=Number(e);if(!Number.isInteger(r)||r<2)throw new $e(`${t} must be an integer greater than 1`,n);return r}function Y1(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new $e("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function X1(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 J1(e){return/^[+-]?(?:\d|\.\d)/.test(e)}function Ay(e,t={}){let n=t.maxSize??Zs,r=null,o=z1,i=j1,a=null,l=null,s=[],c=e.replace(/^\uFEFF/,"").split(/\r?\n/);for(let f=0;f<c.length;f++){let m=f+1,p=K1(c[f]??"").trim();if(!p)continue;let b=p.split(/\s+/),y=(b[0]??"").toUpperCase(),x=b.slice(1);if(y==="TITLE"){r=X1(p);continue}if(y==="DOMAIN_MIN"){o=Ey(x,y,m);continue}if(y==="DOMAIN_MAX"){i=Ey(x,y,m);continue}if(y==="LUT_3D_INPUT_RANGE"){if(x.length!==2)throw new $e(`${y} expects two numbers`,m);let E=In(x[0],m),v=In(x[1],m);if(v<=E)throw new $e("LUT_3D_INPUT_RANGE max must exceed min",m);o=[E,E,E],i=[v,v,v];continue}if(y==="LUT_1D_SIZE"){a=vy(x[0],y,m);continue}if(y==="LUT_3D_SIZE"){if(l=vy(x[0],y,m),l>n)throw new $e(`LUT_3D_SIZE ${l} exceeds max ${n}`,m);continue}if(!J1(y)){if(y.startsWith("LUT_"))throw new $e(`Unsupported cube keyword ${y}`,m);continue}if(!l)throw a?new $e("1D cube LUTs are not supported yet",m):new $e("LUT data appears before LUT_3D_SIZE",m);if(b.length!==3)throw new $e("LUT data rows must contain three numbers",m);s.push(In(b[0],m),In(b[1],m),In(b[2],m))}if(a&&l)throw new $e("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw a?new $e("1D cube LUTs are not supported yet"):new $e("Missing LUT_3D_SIZE");Y1(o,i);let d=l*l*l;if(s.length!==d*3)throw new $e(`Expected ${d} LUT rows for size ${l}, found ${s.length/3}`);return{title:r,size:l,domainMin:o,domainMax:i,data:new Float32Array(s)}}function Q1(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function Ei(e){return Math.round(Q1(e)*255)}function Rd(e){let t=e.size,n=t*t,r=t,o=new Uint8Array(n*r*4);for(let i=0;i<t;i++)for(let a=0;a<t;a++)for(let l=0;l<t;l++){let s=((i*t+a)*t+l)*3,c=(a*n+i*t+l)*4;o[c]=Ei(e.data[s]??0),o[c+1]=Ei(e.data[s+1]??0),o[c+2]=Ei(e.data[s+2]??0),o[c+3]=255}return{width:n,height:r,data:o}}var wy="rec709";var _y=["video","img","canvas"],Pe={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 Cy=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"];var Ty=["shadows","midtones","highlights"],Ry=["master","red","green","blue"],My=["hueVsHue","hueVsSaturation","hueVsLuma"];var ky=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],Ly=["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 mW=Pe.unit,pW=Pe.signedUnit,hW=Pe.effects;var Wt=1024,vi=16;function Ny(e,t,n,r){let o=((2*e+t)*n-e*r)/(e+t);return Math.sign(o)!==Math.sign(n)?0:Math.sign(n)!==Math.sign(r)&&Math.abs(o)>3*Math.abs(n)?3*n:o}function qe(e,t){let n=e[t];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function Z1(e){let t=[],n=[],r=qe(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 o=qe(n,0);if(e.length===2)return[o,o];let i=new Array(e.length);i[0]=Ny(qe(t,0),qe(t,1),o,qe(n,1)),i[i.length-1]=Ny(qe(t,t.length-1),qe(t,t.length-2),qe(n,n.length-1),qe(n,n.length-2));for(let a=1;a<e.length-1;a+=1){let l=qe(n,a-1),s=qe(n,a);if(l===0||s===0||Math.sign(l)!==Math.sign(s)){i[a]=0;continue}let c=qe(t,a-1),d=qe(t,a),f=2*d+c,m=d+2*c;i[a]=(f+m)/(f/l+m/s)}return i}function Fy(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,o]of e){if(!Number.isFinite(r)||!Number.isFinite(o))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 eM(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 tM(e,t,n,r,o){let i=n[0]-t[0],a=Math.min(1,Math.max(0,(e-t[0])/i)),l=a*a,s=l*a;return(2*s-3*l+1)*t[1]+(s-2*l+a)*i*r+(-2*s+3*l)*n[1]+(s-l)*i*o}function Py(e,t,n,r,o){eM(e,r,o);let i=Z1(e),a=new Float32Array(t),l=0;for(let s=0;s<t;s+=1){let c=n(s);for(;l<e.length-2&&c>qe(e,l+1)[0];)l+=1;let d=qe(e,l),f=qe(e,l+1),m=tM(c,d,f,qe(i,l),qe(i,l+1));a[s]=Math.min(o,Math.max(r,m))}return a}function oo(e,t=Wt){if(Fy(e,t),e.length>vi)throw new RangeError(`A color curve supports at most ${vi} 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 Py(e,t,n=>n/(t-1),0,1)}function kd(e,t,n,r=Wt){if(e.length<3)throw new RangeError("A hue curve requires at least three points");if(e.length>vi)throw new RangeError(`A hue curve supports at most ${vi} points`);let o=[...e].sort((s,c)=>s[0]-c[0]);for(let s=0;s<o.length;s+=1){let c=o[s];if(!c||c[0]<0||c[0]>=360)throw new RangeError("Hue curve inputs must be from 0 up to 360 degrees");if(s>0&&c[0]===o[s-1]?.[0])throw new RangeError("Hue curve inputs must be unique")}let i=o.slice(-2).map(([s,c])=>[s-360,c]),a=o.slice(0,2).map(([s,c])=>[s+360,c]),l=[...i,...o,...a];return Fy(l,r),Py(l,r,s=>s/r*360,t,n)}var nl="data-color-grading",gr="data-hf-color-grading-source-hidden",br="data-hf-authored-opacity",Gy="__hf_color_grading_",rM=wy,Od=_y,Fd={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},Pd={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},Id={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 rl=Cy,By=Ty,Uy=Ry,Wy=My,Hd=ky,Gd=Ly,Iy={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},Dy={vignette:.18};function ze(e,t,n={},r={},o={},i=1){return{id:e,label:t,intensity:i,adjust:{...Fd,...n},details:{...Pd,...r},effects:{...Id,...o}}}var Bd=[ze("neutral","Neutral"),ze("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),ze("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),ze("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),ze("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),ze("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),ze("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),ze("vintage-wash","Vintage Wash",Iy,Dy),ze("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),ze("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),ze("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),ze("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),ze("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),ze("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),ze("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}),ze("home-movie-8mm","8mm Home Movie",Iy,{...Dy,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),ze("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),ze("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],oM=new Map(Bd.map(e=>[e.id,e])),iM=/^\$(?:\{([A-Za-z0-9_.:-]+)\}|([A-Za-z0-9_.:-]+))$/,aM={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}},io={hue:0,amount:0,level:0},Oy={amount:Pe.unit,level:Pe.signedUnit},Dn=[[0,0],[1,1]],ao=[],sM={hueVsHue:Pe.secondaryHueShift,hueVsSaturation:Pe.signedUnit,hueVsLuma:Pe.signedUnit},Ld={center:0,range:180,softness:0},Nd={min:0,max:1,softness:.05},lM={vignette:Pe.unit,vignetteMidpoint:Pe.unit,vignetteRoundness:Pe.signedUnit,vignetteFeather:Pe.unit,grain:Pe.unit,grainSize:Pe.unit,grainRoughness:Pe.unit},Dd=Pe.unit,uM=Pe.effects,Vy=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"];var cM=Bd.filter(e=>Vy.some(t=>e.effects[t]>1e-4)),wW=Bd.filter(e=>!cM.includes(e)),_W={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}},$y=[{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 dM=/^#[0-9a-f]{6}$/i;function fM(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&dM.test(t))?null:e.map(t=>t.toLowerCase())}function Ze(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function tl(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function qy(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function lt(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?tl(n,t.min,t.max):0}function Ud(e,t=0){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?(n%360+360)%360:t}function mM(e){let t=Ze(e)?e:{};return By.reduce((n,r)=>{let o=Ze(t[r])?t[r]:{};return n[r]={hue:Ud(o.hue,io.hue),amount:lt(o.amount??io.amount,Oy.amount),level:lt(o.level??io.level,Oy.level)},n},{shadows:{...io},midtones:{...io},highlights:{...io}})}function pM(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)?[tl(t,0,1),tl(n,0,1)]:null}function zy(e){return e.some((t,n)=>n>0&&t[0]===e[n-1]?.[0])}function hM(e){(e[0]?.[0]??0)>0&&e.unshift([0,0]),(e.at(-1)?.[0]??1)<1&&e.push([1,1])}function gM(e){if(!Array.isArray(e)||e.length<2)return Dn;let t=[];for(let n of e){let r=pM(n);if(!r)return Dn;t.push(r)}return t.sort((n,r)=>n[0]-r[0]),zy(t)||(hM(t),t.length>16)?Dn:t}function bM(e){let t=Ze(e)?e:{};return Uy.reduce((n,r)=>(n[r]=gM(t[r]),n),{master:Dn,red:Dn,green:Dn,blue:Dn})}function yM(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)?[Ud(n),tl(r,t.min,t.max)]:null}function xM(e,t){if(!Array.isArray(e)||e.length<3||e.length>16)return ao;let n=[];for(let r of e){let o=yM(r,t);if(!o)return ao;n.push(o)}return n.sort((r,o)=>r[0]-o[0]),zy(n)?ao:n}function SM(e){let t=Ze(e)?e:{};return Wy.reduce((n,r)=>(n[r]=xM(t[r],sM[r]),n),{hueVsHue:ao,hueVsSaturation:ao,hueVsLuma:ao})}function Hy(e){let t=Ze(e)?e:{},n=lt(t.min??Nd.min,Dd),r=lt(t.max??Nd.max,Dd);return{min:Math.min(n,r),max:Math.max(n,r),softness:lt(t.softness??Nd.softness,Pe.secondarySoftRangeSoftness)}}function EM(e){let t=Ze(e)?e:{},n=lt(t.range??Ld.range,Pe.secondaryHueRange);return{center:Ud(t.center,Ld.center),range:n,softness:lt(t.softness??Ld.softness,{min:Pe.secondaryHueSoftness.min,max:Pe.secondaryHueCombinedMax-n})}}function vM(e){return{hueShift:lt(e.hueShift??0,Pe.secondaryHueShift),saturation:lt(e.saturation??0,Pe.signedUnit),luma:lt(e.luma??0,Pe.signedUnit),temperature:lt(e.temperature??0,Pe.signedUnit),tint:lt(e.tint??0,Pe.signedUnit)}}function AM(e){return!Ze(e)||!Ze(e.key)||!Ze(e.correction)?null:{enabled:e.enabled!==!1,key:{hue:EM(e.key.hue),saturation:Hy(e.key.saturation),luma:Hy(e.key.luma)},correction:vM(e.correction)}}function wM(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,4)){let r=AM(n);r&&t.push(r)}return t}function _M(e){if(e==null)return null;let t=String(e).trim();return t||null}function CM(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!Ze(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:qy(e.intensity,1)}}function TM(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return Ze(n)?n:null}catch{return null}return{preset:t}}return Ze(e)?e:null}function RM(e,t){let n=e.trim().match(iM);if(!n)return e;let r=n[1]??n[2]??"";return r&&Object.hasOwn(t,r)?t[r]:e}function el(e,t){if(typeof e=="string"){let r=RM(e,t);if(r!==e)return r;let o=e.trim();if(!o.startsWith("{"))return e;try{return el(JSON.parse(o),t)}catch{return e}}if(Array.isArray(e))return e.map(r=>el(r,t));if(!Ze(e))return e;let n={};for(let[r,o]of Object.entries(e))n[r]=el(o,t);return n}function MM(e){return e?oM.get(e)??null:null}function ol(e){let t=TM(e);if(!t||t.enabled===!1)return null;let n=_M(t.preset),r=MM(n),o=r?.adjust??Fd,i=r?.details??Pd,a=r?.effects??Id,l=Ze(t.adjust)?t.adjust:{},s=Ze(t.details)?t.details:{},c=Ze(t.effects)?t.effects:{},d=rl.reduce((p,b)=>(p[b]=lt(l[b]??o[b],aM[b]),p),{...Fd}),f=Hd.reduce((p,b)=>(p[b]=lt(s[b]??i[b],lM[b]),p),{...Pd}),m=Gd.reduce((p,b)=>(p[b]=lt(c[b]??a[b],uM[b]??Dd),p),{...Id});return{enabled:!0,preset:n,intensity:qy(t.intensity,r?.intensity??1),adjust:d,wheels:mM(t.wheels),curves:bM(t.curves),hueCurves:SM(t.hueCurves),secondaries:wM(t.secondaries),details:f,effects:m,palette:fM(t.palette),lut:CM(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():rM}}function jy(e,t){return ol(el(e,t))}function kM(e){return By.some(t=>Math.abs(e[t].amount)>1e-4||Math.abs(e[t].level)>1e-4)}function Wd(e){return Uy.some(t=>e[t].some(([n,r])=>Math.abs(n-r)>1e-4))}function Vd(e){return Wy.some(t=>e[t].some(([,n])=>Math.abs(n)>1e-4))}function $d(e){return e.some(t=>t.enabled&&Object.values(t.correction).some(n=>Math.abs(n)>1e-4))}function Ky(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||Vy.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:rl.some(n=>Math.abs(e.adjust[n])>1e-4)||(e.wheels?kM(e.wheels):!1)||(e.curves?Wd(e.curves):!1)||(e.hueCurves?Vd(e.hueCurves):!1)||(e.secondaries?$d(e.secondaries):!1):!1}var il=/^(|transparent|rgba\(.*,\s*0\)|.*\/\s*0%?\s*\))$/,LM=new Set(["IMG","VIDEO","IFRAME","EMBED","OBJECT","CANVAS"]),Yy="http://www.w3.org/2000/svg",NM=new Set(["svg","g","foreignObject"]),FM=["Top","Right","Bottom","Left"],PM={left:-1/0,right:1/0,top:-1/0,bottom:1/0},Xy=e=>!!e.backgroundImage&&e.backgroundImage!=="none"||!il.test(e.backgroundColor),IM=e=>{let t=e.getPropertyValue("-webkit-text-fill-color")||e.color,n=Number.parseFloat(e.getPropertyValue("-webkit-text-stroke-width"))||0,r=e.getPropertyValue("-webkit-text-stroke-color")||e.color;return!il.test(t)||n>0&&!il.test(r)},Jy=e=>FM.map(t=>e[`border${t}Style`]!=="none"&&!il.test(e[`border${t}Color`])&&Number.parseFloat(e[`border${t}Width`])||0),al=e=>e.bottom-e.top,qd=(e,t,n)=>t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom,Qy=(e,t)=>({left:Math.min(e.left,t.left),right:Math.max(e.right,t.right),top:Math.min(e.top,t.top),bottom:Math.max(e.bottom,t.bottom)}),DM=(e,t)=>t.display==="none"||t.position==="absolute"||t.position==="fixed"||Number.parseFloat(t.opacity)<=.01&&!e.hasAttribute(gr);function OM(e,t,n){if(e.width<=0&&e.height<=0)return!1;let r=3*(Number.parseFloat(t.fontSize)||16),o=Math.max(r,Math.min(2*e.height,20*r/3));return n<e.top-o||n>e.bottom+o}function HM(e,t,n,r){let[o,i,a,l]=Jy(t);if(!(o||i||a||l))return!1;let s=e.getBoundingClientRect(),{offsetWidth:c,offsetHeight:d}=e,f=c>0?s.width/c:1,m=d>0?s.height/d:1,p={left:s.left+l*f,right:s.right-i*f,top:s.top+o*m,bottom:s.bottom-a*m};return!qd(p,n,r)}function GM(e){let t=[];for(let n of[...e].sort((r,o)=>r.left-o.left)){let r=t.findIndex(o=>n.top<o.bottom&&n.bottom>o.top&&n.left-o.right<=2*Math.max(al(o),al(n)));r<0?t.push(n):t[r]=Qy(t[r],n)}return t}function BM(e){let t=[...e].sort((n,r)=>n.top-r.top);return t.flatMap((n,r)=>t.slice(r+1).flatMap(o=>{let i=o.left<n.right&&o.right>n.left,a=o.top-n.bottom<=2*Math.min(al(n),al(o));return i&&a&&o.top>n.bottom?[Qy(n,o)]:[]}))}function Zy(e,t,n){let r=e.defaultView,o=typeof e.createRange().getClientRects=="function",i=e.createRange(),a=new Map,l=new Map,s=new Map,c=x=>{let E=l.get(x);if(E===void 0){let v=r.getComputedStyle(x);E=DM(x,v)||o&&OM(x.getBoundingClientRect(),v,n),l.set(x,E)}return E},d=x=>{let E=s.get(x);if(E===void 0){let v=x.parentElement,_=v&&x.nodeValue?.trim()?r.getComputedStyle(v):null;E=!!_&&_.visibility!=="hidden"&&IM(_),s.set(x,E)}return E},f=x=>{if(!o)return[PM];let E=[];i.selectNodeContents(x);for(let v of i.getClientRects()){let _=v.bottom-v.top;v.width>0&&_>0&&n>=v.top-2*_&&n<=v.bottom+2*_&&E.push(v)}return E},m=x=>{let E=a.get(x);if(E)return E;E=[];for(let v of x.childNodes)v.nodeType===3?d(v)&&E.push(...f(v)):v.nodeType===1&&v.hasChildNodes()&&!c(v)&&E.push(...m(v));return a.set(x,E),E};function p(x){let E=GM(m(x));return E.some(v=>qd(v,t,n))||BM(E).some(v=>qd(v,t,n))}function b(x,E){let v=r.getComputedStyle(x,E);return!v.content||v.content==="none"||v.content==="normal"||v.display==="none"?!1:v.content!=='""'||Xy(v)||Jy(v).some(_=>_>0)}let y=(x,E)=>/inset/.test(E.boxShadow)||HM(x,E,t,n)||b(x,"::before")||b(x,"::after");return x=>{if(LM.has(x.tagName)||!(x.namespaceURI!==Yy||NM.has(x.localName))||!r)return!0;let v=r.getComputedStyle(x);return Xy(v)||y(x,v)||x.namespaceURI!==Yy&&p(x)}}var UM=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),WM=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(","),ex="[data-hf-inner-root],[data-composition-id]:not([data-composition-id] *)",tx=`${ex}{pointer-events:auto!important}`,VM=`@layer hf-picker{${tx}}`;function nx(e){let t=!1,n=null,r=null,o=null,i=null,a,l=new Set;function s(w,k){try{window.dispatchEvent(new CustomEvent(w,{detail:k}))}catch(K){V("runtime.picker.site1",K)}}function c(w){o=w,s("hyperframe:picker:hovered",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function d(w){i=w,s("hyperframe:picker:selected",{elementInfo:i,isPickMode:t,timestamp:Date.now()})}function f(w){if(l=new Set(Array.from(document.querySelectorAll(ex)).filter(oe=>getComputedStyle(oe).pointerEvents==="none")),l.size===0)return w();let k=m(),K=k?p(k):b();try{return w()}finally{K(),l=new Set}}function m(){if(a!==void 0)return a;if(a=null,!Array.isArray(document.adoptedStyleSheets)||typeof CSSStyleSheet>"u")return null;try{let w=new CSSStyleSheet;w.replaceSync(VM),a=w}catch(w){V("runtime.picker.site2",w)}return a}function p(w){return document.adoptedStyleSheets=[...document.adoptedStyleSheets,w],()=>{document.adoptedStyleSheets=document.adoptedStyleSheets.filter(k=>k!==w)}}function b(){let w=document.createElement("style");return w.textContent=tx,(document.head??document.documentElement).appendChild(w),()=>w.remove()}function y(w,k){let K=k.getComputedStyle(w),oe=Number.parseFloat(K.opacity||"1");if(Number.isFinite(oe)&&oe<.2&&!(w.textContent??"").trim()){let Ee=K.backgroundImage;if(Ee&&Ee!=="none")return!0}return U(w,k)}function x(w){if(w.namespaceURI!=="http://www.w3.org/2000/svg")return!1;let k=w.tagName.toLowerCase();return k==="filter"||k==="defs"||k.startsWith("fe")}function E(w){if(w.namespaceURI!=="http://www.w3.org/2000/svg"||w.tagName.toLowerCase()!=="rect")return!1;let k=(w.getAttribute("filter")??"").trim();return k&&k!=="none"?!0:(w.ownerDocument.defaultView?.getComputedStyle(w).filter??"none").startsWith("url(")}function v(w){if((w.textContent??"").trim())return!1;if(x(w)||E(w))return!0;let k=[...w.children];return k.length>0&&k.every(K=>v(K))}function _(w,k){let K=Number.parseFloat(k.getComputedStyle(w).opacity||"1");return Number.isFinite(K)&&K<.2}function U(w,k){if(!v(w))return!1;for(let K=w;K&&K!==document.body&&K!==document.documentElement;K=K.parentElement)if(_(K,k)&&v(K))return!0;return!1}function G(w){let k=w.ownerDocument.defaultView;if(!k)return!1;let K=w;if(k.getComputedStyle(w).visibility==="hidden"||y(w,k))return!0;for(;K&&K!==document.body&&K!==document.documentElement;){let oe=k.getComputedStyle(K);if(oe.display==="none"||oe.pointerEvents==="none")return!0;let ge=Number.parseFloat(oe.opacity);if(Number.isFinite(ge)&&ge<=.01&&!K.hasAttribute(gr))return!0;K=K.parentElement}return!1}function R(w){if(!w||w===document.body||w===document.documentElement)return!1;let k=w.tagName.toLowerCase();return!(k==="script"||k==="style"||k==="link"||k==="meta"||l.has(w)||w.closest(UM)||G(w))}function D(w){return!!w?.closest(WM)}function T(w){let k=w.parentElement?.getAttribute("data-composition-id");return!w.hasAttribute("data-hf-inner-root")||!k?null:`[data-composition-id="${CSS.escape(k)}"] > [data-hf-inner-root]`}function H(w){let k=T(w);if(k)return k;let K=w;if(K.id)return`#${CSS.escape(K.id)}`;let oe=w.getAttribute("data-composition-id");if(oe)return`[data-composition-id="${CSS.escape(oe)}"]`;let ge=w.getAttribute("data-composition-src");if(ge)return`[data-composition-src="${CSS.escape(ge)}"]`;let Ee=w.getAttribute("data-track-index");if(Ee)return`[data-track-index="${CSS.escape(Ee)}"]`;let $=w.tagName.toLowerCase(),Q=w.parentElement;if(!Q)return $;let Z=Q.querySelectorAll(`:scope > ${$}`);if(Z.length===1)return $;for(let me=0;me<Z.length;me+=1)if(Z[me]===w)return`${$}:nth-of-type(${me+1})`;return $}function I(w){let k=w.tagName.toLowerCase(),K=(w.textContent??"").trim().replace(/\s+/g," "),oe=(Ee,$)=>{let Q=Array.from(Ee);return Q.length>$?`${Q.slice(0,$-1).join("")}\u2026`:Ee},ge=/^h[1-6]$/.test(k);return ge||k==="p"||k==="span"||k==="div"?K.length>0?oe(K,56):ge?"Heading":"Text":k==="img"?"Image":k==="video"?"Video":k==="audio"?"Audio":k==="svg"?"Shape":w.getAttribute("data-composition-src")?"Composition":k==="section"?"Section":`${k.charAt(0).toUpperCase()}${k.slice(1)}`}function Y(w,k,K){let oe=typeof K=="number"&&K>0?K:8,ge=[];if(document.elementsFromPoint)ge=document.elementsFromPoint(w,k);else if(document.elementFromPoint){let me=document.elementFromPoint(w,k);ge=me?[me]:[]}if(D(ge[0]??null))return[];let Ee={},$=[],Q=[],Z=Zy(document,w,k);for(let[me,he]of ge.entries()){if(!R(he))continue;let le=`${he.tagName}::${he.id||""}::${me}`;if(!Ee[le]&&(Ee[le]=!0,$.push(he),(Q.some(ne=>he.contains(ne))||Z(he))&&(Q.push(he),Q.length>=oe)))break}return Q.length>0?Q:$.slice(0,oe)}function W(w){let k=w.getBoundingClientRect(),K={};for(let ge of Array.from(w.attributes))ge.name.startsWith("data-")&&(K[ge.name]=ge.value);return{id:w.id||null,tagName:w.tagName.toLowerCase(),selector:H(w),label:I(w),boundingBox:{x:k.left,y:k.top,width:k.width,height:k.height},textContent:w.textContent?w.textContent.trim().slice(0,200):null,src:w.getAttribute("src")||w.getAttribute("data-composition-src")||null,dataAttributes:K}}function X(w,k,K){return f(()=>Y(w,k,K)).map(W)}function ie(w){if(!t)return;let k=f(()=>{let oe=Y(w.clientX,w.clientY,1)[0]??(Oe(w.target)?w.target:null);return R(oe)?oe:null});if(!k||n===k)return;n&&n.classList.remove("__hf-pick-highlight"),n=k,k.classList.add("__hf-pick-highlight");let K=W(k);c(K),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:K})}function F(w){if(!t)return;w.preventDefault(),w.stopPropagation(),w.stopImmediatePropagation();let k=X(w.clientX,w.clientY,8);k.length!==0&&(c(k[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:k,selectedIndex:0,point:{x:w.clientX,y:w.clientY}}))}function z(w){w.key==="Escape"&&(N(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function O(){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(`
|
|
44
|
+
`),document.head.appendChild(r),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",ie,!0),document.addEventListener("click",F,!0),document.addEventListener("keydown",z,!0),s("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function N(){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",ie,!0),document.removeEventListener("click",F,!0),document.removeEventListener("keydown",z,!0),s("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function L(){window.__HF_PICKER_API={enable:O,disable:N,isActive:()=>t,getHovered:()=>o,getSelected:()=>i,getCandidatesAtPoint:(w,k,K)=>Number.isFinite(w)&&Number.isFinite(k)?X(w,k,K):[],pickAtPoint:(w,k,K)=>{if(!Number.isFinite(w)||!Number.isFinite(k))return null;let oe=X(w,k,8);if(!oe.length)return null;let ge=Math.max(0,Math.min(oe.length-1,Number(K??0))),Ee=oe[ge]??null;return Ee?(d(Ee),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:Ee}),N(),Ee):null},describe:w=>Oe(w)?W(w):null,pickManyAtPoint:(w,k,K)=>{if(!Number.isFinite(w)||!Number.isFinite(k))return[];let oe=X(w,k,8);if(!oe.length)return[];let ge=[],Ee=Array.isArray(K)?K:[0];for(let $ of Ee){let Q=Math.max(0,Math.min(oe.length-1,Math.floor(Number($)))),Z=oe[Q];if(!Z)continue;ge.some(he=>he.selector===Z.selector&&he.tagName===Z.tagName)||ge.push(Z)}return ge.length?(d(ge[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:ge}),N(),ge):[]}},s("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:O,disablePickMode:N,installPickerApi:L}}function Ai(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&&V("runtime.player.nonConformantNum",{prop:t,actual:typeof r}),n)}function Mt(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&V("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function wi(e,t,n){if(e){for(let r of Object.values(e))if(!(!r||r===t))try{n(r)}catch(o){V("runtime.player.site1",o)}}}function sl(e,t,n){return n?.exact===!0?Number.isFinite(e)&&e>0?e:0:I0(e,t,n?.subFrameDivisions)}function rx(e,t,n,r){let o=sl(t,n,r),i=r?.suppressEvents===!0;return Mt(e,"pause"),typeof e.totalTime=="function"?e.totalTime(o,i):typeof e.seek=="function"&&e.seek(o,i),o}function $M(e,t,n,r,o){let i=[];wi(e,t,a=>{Mt(a,"play"),i.push(a)});try{return rx(t,n,r,o)}finally{for(let a of i)try{Mt(a,"pause")}catch(l){V("runtime.player.site2",l)}}}function qM(e,t){wi(e,t,n=>{Mt(n,"play")})}function ox(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?.()??Ai(n,"duration",0))||0);r>0&&Math.max(0,Ai(n,"time",0))>=r&&(Mt(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()),Mt(n,"play"),wi(e.getTimelineRegistry?.(),n,o=>{typeof o.timeScale=="function"&&o.timeScale(e.getPlaybackRate()),Mt(o,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;Mt(n,"pause"),wi(e.getTimelineRegistry?.(),n,o=>{Mt(o,"pause")});let r=Math.max(0,Ai(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 o=e.getTimeline();if(!o)return;let i=Math.max(0,Number(n)||0),a=e.getIsPlaying(),l=$M(e.getTimelineRegistry?.(),o,i,e.getCanonicalFps());e.onDeterministicSeek(l),r?.keepPlaying&&a?(typeof o.timeScale=="function"&&o.timeScale(e.getPlaybackRate()),Mt(o,"play"),wi(e.getTimelineRegistry?.(),o,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),Mt(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 o=e.getTimeline(),i=e.getCanonicalFps(),a=o?(qM(e.getTimelineRegistry?.(),o),rx(o,n,i,r)):sl(Math.max(0,Number(n)||0),i,r);e.onDeterministicSeek(a,r),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>Ai(e.getTimeline(),"time",0),getDuration:()=>Ai(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}var jd="data-composition-id",zM="data-composition-src",jM=`[${jd}]`,HW=`[${zM}]`,Kd="style",ix="script",Yd='link[rel="stylesheet"], link[rel="preconnect"]',KM=new Set(["","application/ecmascript","application/javascript","application/x-ecmascript","application/x-javascript","text/ecmascript","text/javascript","text/javascript1.0","text/javascript1.1","text/javascript1.2","text/javascript1.3","text/javascript1.4","text/javascript1.5","text/jscript","text/livescript","text/x-ecmascript","text/x-javascript"]),YM=e=>(e.getAttribute("type")||"").trim().toLowerCase();function ax(e){let t=YM(e);return t==="module"||t==="importmap"?!0:KM.has(t)&&e.getAttribute("nomodule")===null}function zd(e){return On(e?.querySelectorAll(ix)).filter(t=>!ax(t))}function Xd(e){return On(e?.querySelectorAll(ix)).filter(ax)}function sx(e){return[...On(e.querySelectorAll(`${Kd}, ${Yd}`)),...Xd(e)]}function On(e){return e?Array.from(e):[]}function lx(e){let{contentNode:t,head:n,documentElement:r,hasTemplate:o,compositionId:i}=e,a=On(t.querySelectorAll(jM)),l=i?a.find(f=>f.getAttribute(jd)===i)??null:a[0]??null,s=(l??a[0])?.getAttribute(jd)?.trim()||"",c=o?null:n??null,d=l?zd(l):[];return{innerRoot:l,authoredCompositionId:i||s||null,scriptCompositionId:s||i||null,authoredRootId:l?.getAttribute("id")?.trim()||null,styleSources:[...On(c?.querySelectorAll(Kd)),...On(t.querySelectorAll(Kd))],scriptSources:[...Xd(c),...Xd(t)],linkSources:[...On(n?.querySelectorAll(Yd)),...On(t.querySelectorAll(Yd))],inertScriptsOutsideRoot:[...zd(c),...l?zd(t).filter(f=>!d.includes(f)):[]],variableDefaultCarriers:[r,l].filter(f=>f!=null)}}function ux(e,t){let n=t[0]?.ownerDocument.querySelector("[data-composition-id]"),r=n&&!t.includes(n)?n.getAttribute("data-composition-id"):null,o=r?e.get(r):void 0;r&&o&&e.set(r,o+1)}var XM='"use strict";(()=>{function I(e){return e?/[\\w-]/.test(e)||e.charCodeAt(0)>=128:!1}function _(e){return e===" "||e===" "||e===`\n`||e==="\\r"||e==="\\f"}var j=/^[0-9a-fA-F]{1,6}/;function G(e){let n=e>=55296&&e<=57343;return e===0||e>1114111||n?65533:e}function $(e,n){return e[n]==="\\r"&&e[n+1]===`\n`?n+2:_(e[n])?n+1:n}function R(e,n){let t=e[n+1];if(t===void 0||/[\\n\\r\\f]/.test(t))return null;let i=j.exec(e.slice(n+1,n+7));if(!i)return{value:t,end:n+2};let o=G(Number.parseInt(i[0],16));return{value:String.fromCodePoint(o),end:$(e,n+1+i[0].length)}}function H(e,n){let t=o=>I(o)&&!/[0-9-]/.test(o),i=o=>e[o]==="\\\\"&&R(e,o)!==null;return e[n]==="-"?e[n+1]==="-"||t(e[n+1])||i(n+1):t(e[n])||i(n)}function y(e,n){let t=n;for(;e.startsWith("/*",t);){let i=e.indexOf("*/",t+2);t=i<0?e.length:i+2}return t}function A(e,n){let t=y(e,n);for(;_(e[t]);)t=y(e,t+1);return t}function h(e,n){if(!H(e,n))return null;let t=n,i="";for(;t<e.length;){let o=e[t];if(o==="\\\\"){let a=R(e,t);if(!a)break;i+=a.value,t=a.end;continue}if(!I(o))break;i+=o,t+=1}return t===n?null:{value:i,end:t}}var C=45;function T(e){return e>=48&&e<=57}function z(e){return e>=128||e===C||e===95||T(e)||e>=65&&e<=90||e>=97&&e<=122}function J(e,n){let t=e.charCodeAt(n);return t>=1&&t<=31||t===127?!0:T(t)?n===0||n===1&&e.charCodeAt(0)===C:!1}function k(e){let n="";for(let t=0;t<e.length;t+=1){let i=e.charCodeAt(t),o=e[t];i===0?n+="\\uFFFD":J(e,t)?n+=`\\\\${i.toString(16)} `:t===0&&e.length===1&&i===C?n+=`\\\\${o}`:z(i)?n+=o:n+=`\\\\${o}`}return n}var W=/\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|\\\\(?:[0-9a-fA-F]{1,6}(?:\\r\\n|[ \\t\\r\\n\\f])?|[\\s\\S])|"(?:[^"\\\\]|\\\\[\\s\\S])*"|\'(?:[^\'\\\\]|\\\\[\\s\\S])*\'|\\[(?:\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|\\\\[\\s\\S]|"(?:[^"\\\\]|\\\\[\\s\\S])*"|\'(?:[^\'\\\\]|\\\\[\\s\\S])*\'|[^\\]"\'\\\\/]|\\/(?!\\*))*\\]/g;function Q(e){let n=new Array(e.length).fill(!0);for(let t of e.matchAll(W)){let i=t.index;n.fill(!1,i,i+t[0].length)}return n}function q(e,n,t){if(n.length===0||!e.includes("#"))return e;let i=new Set(n),o=Q(e),a="",u=0;for(;u<e.length;){let d=o[u]&&e[u]==="#"?h(e,u+1):null;d&&i.has(d.value)?(a+=t(d.value),u=d.end):(a+=e[u],u+=1)}return a}function X(e){let n="";for(let t=0;t<e.length;t+=1){if(e[t]==="\\\\"){let i=e[t+1];if(i!==void 0&&/[\\n\\r\\f]/.test(i)){t=$(e,t+1)-1;continue}let o=R(e,t);if(o){n+=o.value,t=o.end-1;continue}}n+=e[t]}return n}function N(e){return Array.from(e,n=>{let t=n.charCodeAt(0);return t===0?"\\uFFFD":t<32||t===127?`\\\\${t.toString(16)} `:n===\'"\'||n==="\\\\"?`\\\\${n}`:n}).join("")}function Y(e,n){return e?{kind:"any"}:n===void 0?{kind:"none"}:{kind:"named",prefix:n}}function Z(e,n){return e[n]==="|"&&e[n+1]!=="="}function B(e,n){let t=e[n]==="*",i=t?{value:"*",end:n+1}:h(e,n),o=y(e,i?.end??n);if(!Z(e,o))return t?null:i?{token:i,namespace:{kind:"none"}}:null;let a=h(e,y(e,o+1));return a?{token:a,namespace:Y(t,i?.value)}:null}function K(e){if(e[0]!=="[")return null;let n=A(e,1),t=B(e,n);if(!t)return null;let{token:i,namespace:o}=t;return{name:i.value,rawName:e.slice(n,i.end),namespace:o,end:i.end}}function ee(e,n){let t=/^(?:"((?:\\\\[\\s\\S]|[^"\\\\])*)"|\'((?:\\\\[\\s\\S]|[^\'\\\\])*)\')/.exec(e.slice(n));return t?{value:X(t[1]??t[2]),end:n+t[0].length}:h(e,n)}function ne(e,n){let t=A(e,n),i=h(e,t);if(i){if(!/^[is]$/i.test(i.value))return null;t=A(e,i.end)}return e[t]!=="]"||t!==e.length-1?null:{flag:i?.value}}function F(e){let n=K(e);if(!n)return null;let t=A(e,n.end),o=["=","~=","|=","^=","$=","*="].find(d=>e.startsWith(d,t));if(!o)return null;let a=ee(e,A(e,t+o.length));if(!a)return null;let u=ne(e,a.end);return u?{name:n.name,rawName:n.rawName,namespace:n.namespace,operator:o,value:a.value,flag:u.flag}:null}function E(e,n){return e.replace(W,t=>t.startsWith("[")?n(t):t)}var re="data-hf-svg-reference-aliases";function O(e,n,t,i){let o={"=":(s,r)=>s===r,"~=":(s,r)=>s.split(/[ \\t\\r\\n\\f]+/).includes(r),"|=":(s,r)=>s===r||s.startsWith(r+"-"),"^=":(s,r)=>s.startsWith(r),"$=":(s,r)=>s.endsWith(r),"*=":(s,r)=>s.includes(r)},a=(s,r,l)=>!r&&l!=="="&&l!=="|="?!1:o[l](s,r),u=s=>s.replace(/[A-Z]/g,r=>r.toLowerCase()),d=s=>{let r=F(s);if(!r)return s;let{name:l,rawName:g,namespace:m,operator:b,value:D,flag:w}=r;if(m.kind==="named"!=(i!==void 0))return s;let x=w?.toLowerCase()==="i"?u:S=>S,L=u(l),P=t.filter(S=>{let V=m.kind==="none"?S.name:S.localName,U=m.kind==="named"?i.get(m.prefix):null;return(m.kind==="any"||S.namespaceURI===U)&&u(V)===L}),v=new Set([s]);for(let S of P)a(x(S.before),x(D),b)&&v.add(`[${g}="${N(S.after)}"${w?` ${w}`:""}]`);return v.size===1?s:`:is(${[...v].join(", ")})`};if(i)return E(e,d);let p=new Map(n.map(({id:s,replacement:r})=>[s,r])),f=new Map;for(let s of t){if(s.name!=="id"||s.before===s.after||p.has(s.before))continue;let r=f.get(s.before);r||(r=new Set([`#${k(s.before)}`]),f.set(s.before,r)),r.add(`#${k(s.after)}`)}for(let[s,r]of f)p.set(s,`:is(${[...r].join(", ")})`);let c=q(e,[...p.keys()],s=>p.get(s));return E(c,d)}function se(e,n,t=!0){let i=[],a=(t?[...e.querySelectorAll(`[${n}]`)]:[]).map(d=>d.getAttribute(n)),u=e.getAttribute?.(n);u&&a.unshift(u);for(let d of a){let p;try{p=JSON.parse(d)}catch{continue}if(!Array.isArray(p))continue;let f=p;for(let c of f){if(!ie(c))continue;let{name:s,localName:r,namespaceURI:l,before:g,after:m}=c;i.push({name:s,localName:r,namespaceURI:l,before:g,after:m})}}return i}function ie(e){if(!e||typeof e!="object")return!1;let{name:n,localName:t,namespaceURI:i,before:o,after:a}=e;return typeof n=="string"&&typeof t=="string"&&(i===null||typeof i=="string")&&typeof o=="string"&&typeof a=="string"}function oe(e){let n=[],t=[],i=!1,o,a=new WeakMap,u=(f,c)=>{for(let s of f){if("selectorText"in s){let r=s,l=a.get(r),g=r.selectorText,m=l?.applied===g?l.authored:g,b=O(m,[],t,c);b!==g&&(r.selectorText=b),b===m?a.delete(r):a.set(r,{authored:m,applied:r.selectorText})}"cssRules"in s&&u(s.cssRules,c)}},d=()=>{if(t.length)for(let f of e.document.styleSheets){let c;try{c=f.cssRules}catch{continue}let s=new Map;for(let r of c){if(!("namespaceURI"in r))continue;let{prefix:l,namespaceURI:g}=r;l&&s.set(l,g||null)}s.size&&u(c,s)}},p={rewrite:(f,c=[])=>{if(typeof f!="string"||!f.includes("#")&&!f.includes("["))return f;let s=O(f,c.length?[...c,...n]:n,t);if(s!==f){if(!o){let r=e.document.createElement("div");o=r.matches.bind(r)}o(f)}return s},refresh(){t=se(e.document,re).filter(r=>r.before!==r.after);let f=new Set(t.filter(r=>r.name==="id").map(r=>r.before)),c=new Set;n=[];for(let r of e.document.querySelectorAll("[data-hf-authored-id][id]")){let l=r.getAttribute("data-hf-authored-id");if(!l||l===r.id||c.has(l)||f.has(l))continue;c.add(l);let g=N(l);n.push({id:l,replacement:`:is(#${k(l)}, [data-hf-authored-id="${g}"])`})}if(d(),i||!n.length&&!t.length)return;let s=e.Element.prototype;s.querySelector=new Proxy(s.querySelector,{apply(r,l,g){return Reflect.apply(r,l,[p.rewrite(g[0])])}}),s.querySelectorAll=new Proxy(s.querySelectorAll,{apply(r,l,g){return Reflect.apply(r,l,[p.rewrite(g[0])])}}),i=!0}};e.__hfSvgSelectorAliases=p,p.refresh()}function M(){let e=window;e.__hfSvgSelectorAliases||oe(e)}M();})();\n';function cx(){return XM}var De=UC(GS(),1),wl=De.default,RV=De.default.stringify,MV=De.default.fromJSON,kV=De.default.plugin,LV=De.default.parse,NV=De.default.list,FV=De.default.document,PV=De.default.comment,IV=De.default.atRule,DV=De.default.rule,OV=De.default.decl,HV=De.default.root,GV=De.default.CssSyntaxError,BV=De.default.Declaration,UV=De.default.Container,WV=De.default.Processor,VV=De.default.Document,$V=De.default.Comment,qV=De.default.Warning,zV=De.default.AtRule,jV=De.default.Result,KV=De.default.Input,YV=De.default.Rule,XV=De.default.Root,JV=De.default.Node;var vf="data-hf-authored-id",BS="data-hf-inner-root";function Af(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wf(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function ML(e){let t=e.trim();return t?Array.from(new Set([t,Xt(t)])).filter(Boolean):[]}function kL(e,t,n){let r=ML(t);return $a(e,r,()=>n)}function LL(e,t){let n=t?.trim();return n?kL(e,n,`[${vf}="${wf(n)}"]`):e}function US(e){return`${e}:not(:has([${BS}])), ${e} > [${BS}]`}function NL(e,t,n,r,o,i){let a=LL(e,r),l=FL(a,t,n),s=l.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return i?US(t):e;let c=new RegExp(`\\[\\s*data-composition-id\\s*[\\^\\*\\$]?=\\s*(["'])${Af(n)}\\1\\s*\\]`,"g");if(c.test(s))return s.replace(c,"").trim()===""?US(t):l.replace(c,t);let d=l.match(/^\s*/)?.[0]??"",f=l.match(/\s*$/)?.[0]??"";if(o){let m=r?`[${vf}="${wf(r)}"]`:null;if(m&&s.startsWith(m)){let p=s.slice(m.length);return`${d}${t}${m}${p}${f}`}}return`${d}${t} ${s}${f}`}function FL(e,t,n){let r=Af(n),o=String.raw`\[\s*data-composition-id\s*=\s*(?:"${r}"|'${r}')\s*\]`,i=String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`;return e.replace(new RegExp(`${o}(?:${i})+`,"g"),t).replace(new RegExp(`(?:${i})+${o}`,"g"),t)}var PL=new Set(["keyframes","-webkit-keyframes","font-face"]);function IL(e){return e?.type==="atrule"}function DL(e){let t=e.parent;for(;t;){if(IL(t)&&PL.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function OL(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function WS(e,t,n,r,o){let i=t.trim();if(!e||!i)return e;let a=n||`[data-composition-id="${wf(i)}"]`,l=HL(e);return l?BL(l,a,i,r,o):""}function HL(e){try{return wl.parse(e)}catch{return null}}function GL(e,t){e.walkRules(n=>{DL(n)||OL(n)||t(n)})}function BL(e,t,n,r,o){return GL(e,i=>{i.selectors=i.selectors.map(a=>NL(a,t,n,r,o?.compoundAuthoredRoot,o?.scopeRootSelectors))}),e.toResult({map:!1}).css}var UL="hf-scope-placeholder",r5=`[data-composition-id="${UL}"]`;function vt(e){return JSON.stringify(e).replace(/</g,"\\u003c")}var VS=`!__hfBaseHyperframes
|
|
45
45
|
? __hfBaseHyperframes
|
|
46
46
|
: Object.assign({}, __hfBaseHyperframes, {
|
|
47
47
|
assetUrl: function(path) {
|
|
@@ -361,7 +361,7 @@ ${e.replace(/<\/(script)/gi,"<\\/$1")}
|
|
|
361
361
|
};
|
|
362
362
|
__hfFindRoot();
|
|
363
363
|
__hfRecordAnimations(__hfRun);
|
|
364
|
-
})();`}function _l(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function WL(e){return _l(e)&&Object.values(e).every(_l)}var qS=(e,t)=>e&&Object.fromEntries(Object.entries(e).map(([n,r])=>[n,typeof r=="string"?t(r):null]));function zS(e,t){let n;try{n=JSON.parse(e)}catch{return null}if(!_l(n))return null;let{imports:r,scopes:o}=n;return r!==void 0&&!_l(r)||o!==void 0&&!WL(o)?null:{imports:qS(r,t),scopes:o&&Object.fromEntries(Object.entries(o).map(([i,a])=>[t(i),qS(a,t)??{}]))}}var Cf="text/hf-after-fonts",KS=`${Cf}+module`,YS=`script[type="${Cf}"], script[type="${KS}"]`,XS="__hfAfterFontsClaimed",VL="data-hf-inlined-src";var JS=`[defer][src], [defer][${VL}]`;function Cl(e){let t=e.getAttribute("type");return t===Cf?null:t===KS?"module":t}function $L(e){let t=e.getAttribute("type")??"",n=e.tagName.toLowerCase()==="link"?t.split(";")[0].trim():t;if(n!==""&&n.toLowerCase()!=="text/css")return;let r=(e.getAttribute("media")??"").trim().toLowerCase();return JSON.stringify([r==="all"?"":r,e.getAttribute("title")??""])}var s5=JSON.stringify(["",""]);function jS(e){return JSON.stringify([e.getAttribute("href"),(e.getAttribute("rel")??"").trim().toLowerCase(),$L(e)??e.getAttribute("type"),e.hasAttribute("disabled")])}function QS(e,t){let n=jS(t);return[...e.querySelectorAll("link[href]")].some(r=>!r.closest("noscript")&&jS(r)===n)}var et="id",Tf="data-hf-authored-id",mo=/(url\(\s*)(["']?)#([^"')\s]+)\2(\s*\))/gi;function eE(e){return e==="href"||e.endsWith(":href")}function qL(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function Rf(e,t){return!e||!e.toLowerCase().includes("url(")?e:e.replace(mo,(n,r,o,i,a)=>{let l=t.get(i);return l?`${r}${o}#${l}${o}${a}`:n})}function zL(e,t,n){if(eE(e)&&t.startsWith("#")){let o=n.get(t.slice(1));return o?`#${o}`:t}mo.lastIndex=0;let r=mo.test(t);return mo.lastIndex=0,r?Rf(t,n):null}function jL(e,t,n){if(e.name===_t||e.name===et)return{kind:"skip"};let r=t&&e.value===t.after?t.before:e.value,o=zL(e.name,r,n);return o!==null?{kind:"managed",before:r,after:o}:t?{kind:"retain",alias:t}:{kind:"skip"}}function KL(e,t,n,r){let o=e.namespaceURI===void 0&&e.name==="xlink:href"&&r;return{name:e.name,localName:o?"href":e.localName,namespaceURI:o?"http://www.w3.org/1999/xlink":e.namespaceURI??null,before:t,after:n}}function YL(e,t){let n=new Map(nr(e,_t,!1).map(i=>[i.name,i])),r=[...n.values()].filter(i=>i.name===et),o=!!e.closest("svg");for(let i of e.attributes?Array.from(e.attributes):[]){let a=jL(i,n.get(i.name),t);if(a.kind!=="skip"){if(a.kind==="retain"){r.push(a.alias);continue}a.after!==i.value&&(i.namespaceURI?e.setAttributeNS(i.namespaceURI,i.name,a.after):e.setAttribute(i.name,a.after)),r.push(KL(i,a.before,a.after,o))}}r.length&&e.setAttribute(_t,JSON.stringify(r))}function ZS(e,t,n){let r;for(mo.lastIndex=0;r=mo.exec(e);){let o=r[3];t.has(o)&&n.add(o)}}function XL(e,t,n){if(eE(e.name)&&e.value.startsWith("#")){let r=e.value.slice(1);t.has(r)&&n.add(r)}}function JL(e,t,n){let r=new Set;for(let o of e)for(let i of o.attributes?Array.from(o.attributes):[])!i.value||i.name===_t||(XL(i,n,r),i.value.toLowerCase().includes("url(")&&ZS(i.value,n,r));for(let o of t)o.toLowerCase().includes("url(")&&ZS(o,n,r);return r}function tE(e,t){return t.some(n=>n===e||n.contains(e))}function QL(e){let t=e.exclude??[],n=[...e.root.querySelectorAll("*")],r=t.length?n.filter(o=>!tE(o,t)):n;return[e.root,...r]}function ZL(e){let t=e.exclude??[],n=[...e.root.querySelectorAll("svg [id], svg[id]")];return t.length?n.filter(r=>!tE(r,t)):n}function eN(e){let t=QL(e),n=new Set;if(!e.namespace)return{elements:t,renamable:n};let r=ZL(e),o=new Set;for(let a of r){let l=a.getAttribute(et);l&&o.add(l)}if(o.size===0)return{elements:t,renamable:n};let i=JL(t,e.cssTexts??[],o);for(let a of r){let l=a.getAttribute(et);l&&i.has(l)&&n.add(a)}return{elements:t,renamable:n}}function nE(e){if(!e.closest("svg"))return null;let t=nr(e,_t,!1).find(n=>n.name===et);return t?e.getAttribute(et)===t.after?t.before:null:e.getAttribute(Tf)}function tN(e){let t=new Map,n=new Set;for(let r of e.querySelectorAll("[id]")){let o=r.getAttribute(et);if(!o)continue;n.add(o);let i=t.get(o);i?i.push(r):t.set(o,[r]);let a=nE(r);if(a&&a!==o){let l=t.get(a);l?l.push(r):t.set(a,[r])}}return{elementsById:t,usedIds:n}}function nN(e,t,n){let r=`${qL(e)}--${t}`,o=r;for(let i=2;n.has(o);i+=1)o=`${r}-${i}`;return n.add(o),o}function rN(e,t,n){let r=t.find(a=>!n.has(a))??t[0],i=t.filter(a=>a!==r&&a.getAttribute(et)===e).map(a=>n.get(a));return new Set(i.filter(a=>a!==void 0))}function oN(e,t,n){let r=t.map(()=>new Map);for(let[o,i]of e.elementsById)if(!(i.length<2))for(let a of rN(o,i,n))r[a].set(o,nN(t[a].namespace,o,e.usedIds));return r}function iN(e,t,n){let r=new Map;for(let[o,i]of e.elementsById){let a=i[0],l=a.getAttribute(et);if(l!==o){r.set(o,l);continue}let s=n.get(a),c=s===void 0?void 0:t[s].get(o);c&&r.set(o,c)}return r}function aN(e){let t=new Set(e.map(r=>r.getAttribute(et))),n=new Map;for(let r of e){let o=nE(r),i=r.getAttribute(et);!o||!i||(t.add(o),n.set(o,i))}return{ids:t,renamed:n}}function sN(e,t){for(let n of e.elements){let r=n.getAttribute(et);if(r&&e.renamable.has(n)&&t.has(r)){n.hasAttribute(Tf)||n.setAttribute(Tf,r);let o=t.get(r),i=nr(n,_t,!1);i.push({name:et,localName:et,namespaceURI:null,before:r,after:o}),n.setAttribute(_t,JSON.stringify(i)),n.setAttribute(et,o)}YL(n,t)}}function rE(e,t,n){if(t.length===0)return[];let r=tN(e),o=t.map(eN),i=o.flatMap(({renamable:d})=>[...d]);if(n)for(let d of o)for(let f of d.renamable)n.has(f)&&d.renamable.delete(f);let a=new Map;o.forEach(({renamable:d},f)=>{for(let m of d)a.set(m,f)});let l=oN(r,t,a),s=iN(r,l,a),c=o.map((d,f)=>{let m=aN(t[f].referenceTarget==="document"?[]:d.elements),p=[...s].filter(([b])=>!m.ids.has(b));return new Map([...p,...m.renamed,...l[f]])});c.forEach((d,f)=>{sN(o[f],d)});for(let d of i)n?.add(d);return c}function oE(e,t,n=[]){if(!e||t.size===0&&n.length===0||!e.includes("#")&&!e.includes("[")&&!e.toLowerCase().includes("url("))return e;let r;try{r=wl.parse(e)}catch{return e}let o=!1,i=new Set(n.filter(l=>l.name===et).map(l=>l.before)),a=[...t].filter(([l])=>!i.has(l)).map(([l,s])=>({id:l,replacement:`:is(#${Xt(l)}, #${Xt(s)})`}));return r.walkRules(l=>{let s=l.selectors.map(c=>qa(c,a,n));s.some((c,d)=>c!==l.selectors[d])&&(l.selectors=s,o=!0)}),r.walkDecls(l=>{let s=Rf(l.value,t);s!==l.value&&(l.value=s,o=!0)}),r.walkAtRules(l=>{if(!l.params)return;let s=Rf(l.params,t);s!==l.params&&(l.params=s,o=!0)}),o?r.toResult({map:!1}).css:e}var Mf=5e3;window[XS]=!0;async function Vi(){let e=document.fonts;if(!e)return;document.body?.offsetHeight;let t,n=await Promise.race([e.ready.then(()=>!1),new Promise(o=>t=setTimeout(o,Mf,!0))]);if(clearTimeout(t),!n)return;let r=[...new Set(Array.from(e).filter(o=>o.status==="loading").map(o=>o.family))];globalThis.console.warn(`[hyperframes] fonts still loading after ${Mf} ms, composition scripts run without them: ${r.join(", ")}`),Ce({source:"hf-preview",type:"diagnostic",code:"runtime_font_wait_timeout",details:{loadingFamilies:r,timeoutMs:Mf}})}function lN(e,t){let n=Object.getOwnPropertyDescriptor(e,"addEventListener"),r=e.addEventListener,o=(i,a,l)=>{if(!a)return;i==="DOMContentLoaded"||i==="load"&&e===window&&document.readyState==="complete"?t.push({target:e,type:i,listener:a}):r.call(e,i,a,l)};return e.addEventListener=o,()=>{e.addEventListener===o&&(n?Object.defineProperty(e,"addEventListener",n):delete e.addEventListener)}}function uN(e){if(!e.isConnected)return;let t=document.createElement("script");for(let{name:r,value:o}of Array.from(e.attributes))t.setAttribute(r,o);let n=Cl(e);return n===null?t.removeAttribute("type"):t.setAttribute("type",n),t.async=e.hasAttribute("async"),t.text=e.textContent??"",e.replaceWith(t),t}var cN=50,dN=()=>!window.__HF_VIRTUAL_TIME__;function fN(){let e=globalThis.scheduler;return typeof e?.yield=="function"?e.yield():new Promise(t=>{let n=new MessageChannel;n.port1.onmessage=()=>{n.port1.close(),t()},n.port2.postMessage(null)})}var mN=e=>new Promise(t=>{e.addEventListener("load",t),e.addEventListener("error",t)});function pN(){let e=document.createElement("script");e.type="module",e.async=!1,e.text='document.dispatchEvent(new Event("hf-after-fonts-modules"))';let t=new Promise(n=>document.addEventListener("hf-after-fonts-modules",n,{once:!0}));return document.body.appendChild(e),t.then(()=>e.remove())}async function Tl(e,t){await Vi();let n=l=>Cl(l)==="module"||l.matches(JS),r=[],o=[document,window].map(l=>lN(l,r)),i=dN(),a=performance.now();for(let l of[...e.filter(s=>!n(s)),...e.filter(n)]){i&&performance.now()-a>cN&&(await fN(),a=performance.now());let s=uN(l);s?.hasAttribute("src")&&!s.async&&!s.noModule?await mN(s):Cl(l)==="module"&&await pN()}for(let l of o)l();t?.();for(let{target:l,type:s,listener:c}of r){let d=new Event(s);try{typeof c=="function"?c.call(l,d):c.handleEvent(d)}catch(f){reportError(f)}}}var hN=["data-composition-id","data-composition-file","data-start","data-duration","data-end","data-track-index","data-track","data-composition-src","data-hf-authored-duration","data-hf-authored-end"];function iE(e){let t=e.getAttribute("id")?.trim();for(let n of hN)e.removeAttribute(n);t&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",t)),e.setAttribute("data-hf-inner-root","true")}var gN=8e3,bN=/^(?![a-zA-Z][a-zA-Z\d+\-.]*:)(?!\/\/)(?!\/)(?!\.\.?\/).+/,yN=/\burl\(\s*(["']?)([^)"']+)\1\s*\)/g,xN=["src","href"];function SN(e){return!e||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/")}function dE(e,t){if(!t)return e;let n=e.trim();if(SN(n)||!n.startsWith("../")&&n!=="..")return e;try{return new URL(n,t).href}catch{return e}}function fE(e,t){return!t||!e?e:e.replace(yN,(n,r,o)=>{let i=dE(o||"",t);return i===o?n:`url(${r||""}${i}${r||""})`})}function EN(e,t){for(let n of Array.from(e.querySelectorAll("[src], [href]")))for(let r of xN){let o=n.getAttribute(r);if(o==null)continue;let i=dE(o,t);i!==o&&n.setAttribute(r,i)}}function vN(e,t){for(let n of Array.from(e.querySelectorAll("[style]"))){let r=n.getAttribute("style");if(r==null)continue;let o=fE(r,t);o!==r&&n.setAttribute("style",o)}}function AN(e,t){for(let n of Array.from(e.querySelectorAll("style"))){let r=n.textContent||"",o=fE(r,t);o!==r&&(n.textContent=o)}}function mE(e,t){if(t){EN(e,t),vN(e,t),AN(e,t);for(let n of Array.from(e.querySelectorAll("template")))mE(n.content,t)}}function aE(e,t){return`${e}__hf${t}`}var wN=e=>new Promise(t=>{let n=!1,r=Date.now(),o=null,i=a=>{n||(n=!0,o!=null&&window.clearTimeout(o),t({status:a,elapsedMs:Math.max(0,Date.now()-r)}))};e.addEventListener("load",()=>i("load"),{once:!0}),e.addEventListener("error",()=>i("error"),{once:!0}),o=window.setTimeout(()=>i("timeout"),gN)});function Nf(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function kf(e){for(let t of sx(e))t.remove()}function _N(e){let t=document.importNode(e,!0);iE(t);let n=dr(t.getAttribute("data-width")),r=dr(t.getAttribute("data-height"));return t.style.width=n===null?"100%":`${n}px`,t.style.height=r===null?"100%":`${r}px`,t}function sE(e,t){let n=e.trim();if(!n)return e;try{return bN.test(n)&&!n.startsWith("#")&&!n.startsWith("?")?new URL(n,document.baseURI).toString():t?new URL(n,t).toString():new URL(n,document.baseURI).toString()}catch{return e}}function lE(e,t){try{let n=new URL(e),r=new URL(t);return n.search="",n.hash="",r.search="",r.hash="",n.href===r.href}catch{return!1}}function $i(e){let t=(e.getAttribute("data-composition-id")||"").trim()||null;return{authoredCompositionId:(e.getAttribute("data-hf-original-composition-id")||t||"").trim()||null,runtimeCompositionId:t}}function CN(e){let t=new Map;for(let n of e){let r=$i(n).authoredCompositionId||"";r&&t.set(r,(t.get(r)||0)+1)}return ux(t,e),t}function pE(e){let t=$i(e).authoredCompositionId;return t?!!document.querySelector(`template#${CSS.escape(t)}-template`):!1}function TN(e){return!!e.querySelector('[data-hf-inner-root="true"]')}function uE(e){return e.hasAttribute("data-composition-src")?!0:pE(e)?e.children.length===0||e.hasAttribute("data-hf-original-composition-id")?!0:TN(e):!1}function Rl(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(t=>t.hasAttribute("data-composition-src")?!0:pE(t))}function Ff(){let e=window.__hfVariablesByComp;if(!e)return;let t=new Set(Rl().map(n=>$i(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(e))t.has(n)||delete e[n]}function hE(e,t){let n=CN(e),r=new Set(e.flatMap(a=>{let l=$i(a),s=l.authoredCompositionId?[l.authoredCompositionId]:[];return(t.has(a)||!uE(a))&&l.runtimeCompositionId&&s.push(l.runtimeCompositionId),s})),o=new Map,i=new Map;for(let a of e){let{authoredCompositionId:l,runtimeCompositionId:s}=$i(a),c=!t.has(a)&&uE(a);if(!l){i.set(a,{authoredCompositionId:null,runtimeCompositionId:s});continue}let d=(n.get(l)||0)>1,f=s||l;if(c){let m=d?(o.get(l)||0)+1:0;if(d){for(;r.has(aE(l,m));)m+=1;o.set(l,m)}f=d?aE(l,m):l,r.add(f),d?a.setAttribute("data-hf-original-composition-id",l):a.removeAttribute("data-hf-original-composition-id"),a.setAttribute("data-composition-id",f)}i.set(a,{authoredCompositionId:l,runtimeCompositionId:f})}return Ff(),i}async function gE(e){let t=lx({contentNode:e.sourceNode,head:e.head,hasTemplate:e.hasTemplate,compositionId:e.authoredCompositionId}),n=we(t.innerRoot)?t.innerRoot:null,r=n??e.sourceNode,o=t.authoredCompositionId,i=t.scriptCompositionId,a=e.runtimeCompositionId||null,l=t.authoredRootId,s=a?`[data-composition-id="${CSS.escape(a)}"]`:void 0;for(let y of t.linkSources){let x=(y.getAttribute("href")||"").trim();if(!x)continue;let E=e.compositionUrl?new URL(x,e.compositionUrl).href:x;if(e.compositionUrl&&lE(E,e.compositionUrl))continue;let v=y.cloneNode(!0);Zh(v)&&(v.href=E,!QS(document.head,v)&&(document.head.appendChild(v),e.injectedLinks.push(v)))}let c=[];(y=>{for(let x of y){let E=x.cloneNode(!0);if(!Qh(E))continue;o&&(E.textContent=WS(E.textContent||"",o,s,l,{scopeRootSelectors:!0})),document.head.appendChild(E),e.injectedStyles.push(E);let v=E.textContent||"";c.push({element:E,authored:v,applied:v})}})(t.styleSources);let f=y=>{let x=y.getAttribute("type")?.trim()??"",E=y.getAttribute("src")?.trim()??"";if(E){let _=sE(E,e.compositionUrl);return e.compositionUrl&&lE(_,e.compositionUrl)?null:{kind:"external",src:_,type:x}}let v=y.textContent?.trim()??"";return v?{kind:"inline",content:v,type:x,scopeCompositionId:i}:null},m=t.scriptSources.map(f).filter(y=>y!==null);if(n){let y=n.getAttribute("data-width"),x=n.getAttribute("data-height"),E=e.parseDimensionPx(y),v=e.parseDimensionPx(x);y&&e.host.setAttribute("data-width",y),x&&e.host.setAttribute("data-height",x),E&&we(e.host)&&(e.host.style.width=E),v&&we(e.host)&&(e.host.style.height=v),n.hasAttribute("data-timeline-locked")&&e.host.setAttribute("data-timeline-locked","");let _=_N(n);!e.authoredCompositionId&&o&&_.setAttribute("data-composition-id",o),kf(_),e.host.appendChild(_)}else if(e.hasTemplate){let y=document.importNode(r,!0);kf(y),e.host.appendChild(y)}else e.host.innerHTML=e.fallbackBodyInnerHtml,kf(e.host);for(let y of t.inertScriptsOutsideRoot)e.host.appendChild(document.importNode(y,!0));a&&MN(e,r,a);let p=Array.from(e.host.childNodes),b=()=>e.host.isConnected&&(p.length>0||e.host.childNodes.length===0)&&p.every(y=>y.parentNode===e.host);return{host:e.host,namespace:a||o||"",styles:c,isCurrent:b,runScripts:async()=>{if(m.length>0&&await Vi(),!!b())for(let y of m){let x=document.createElement("script");if(y.type&&(x.type=y.type),x.async=!1,y.kind==="external")x.src=y.src;else if(y.type.toLowerCase()==="importmap"){let E=zS(y.content,v=>sE(v,e.compositionUrl));x.textContent=E?JSON.stringify(E):y.content}else if(y.type.toLowerCase()==="module"){let E=y.scopeCompositionId?$S(a||y.scopeCompositionId,e.compositionUrl?.href):"";x.textContent=E+y.content}else y.scopeCompositionId?x.textContent=_f(y.content,y.scopeCompositionId,"[HyperFrames] composition script error:",s,a||y.scopeCompositionId,l,e.compositionUrl?.href):x.textContent=`(function(){${y.content}})();`;if(document.body.appendChild(x),e.injectedScripts.push(x),y.kind==="external"){let E=await wN(x);E.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.authoredCompositionId,runtimeCompositionId:e.runtimeCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:y.src,loadStatus:E.status,elapsedMs:E.elapsedMs}})}}}}}async function cE(e,t){let n=Rl();if(Ff(),n.length===0)return[];let r=hE(n,t),o=n.filter(a=>{if(t.has(a)||a.hasAttribute("data-composition-src")||a.children.length>0)return!1;let l=r.get(a)?.authoredCompositionId;return l?!!document.querySelector(`template#${CSS.escape(l)}-template`):!1}),i=[];for(let a of o){let l=r.get(a),s=l?.authoredCompositionId;if(!s)continue;let c=document.querySelector(`template#${CSS.escape(s)}-template`);Nf(a);let d=await gE({host:a,authoredCompositionId:s,runtimeCompositionId:l?.runtimeCompositionId||s,hostCompositionSrc:`template#${s}-template`,sourceNode:c.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});i.push(d)}return i}async function RN(e){let t=Rl();if(Ff(),t.length===0)return[];let n=hE(t,new Set),r=t.filter(i=>i.hasAttribute("data-composition-src"));return(await Promise.all(r.map(async i=>{let a=i.getAttribute("data-composition-src");if(!a)return null;let l=n.get(i),s=l?.authoredCompositionId||null,c=l?.runtimeCompositionId||s||null,d=null;try{d=new URL(a,document.baseURI)}catch{d=null}Nf(i);let f=p=>{e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:s,runtimeCompositionId:c,hostCompositionSrc:a,errorMessage:p instanceof Error?p.message:"unknown_error"}}),Nf(i)},m=async p=>{let b=await gE(p),y=b.runScripts;return b.runScripts=async()=>{try{await y()}catch(x){f(x)}},b};try{let p=s!=null?document.querySelector(`template#${CSS.escape(s)}-template`):null;if(p)return await m({host:i,authoredCompositionId:s,runtimeCompositionId:c,hostCompositionSrc:a,sourceNode:p.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:d,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});let b=await fetch(a);if(!b.ok)throw new Error(`HTTP ${b.status}`);let y=await b.text(),E=new DOMParser().parseFromString(y,"text/html");mE(E,d);let v=(s?E.querySelector(`template#${CSS.escape(s)}-template`):null)??E.querySelector("template"),_=v?v.content:E.body;return await m({host:i,authoredCompositionId:s,runtimeCompositionId:c,hostCompositionSrc:a,sourceNode:_,hasTemplate:!!v,fallbackBodyInnerHtml:E.body.innerHTML,compositionUrl:d,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,head:E.head,declaredVariableDefaults:bi(E.documentElement),variableDeclarer:E.documentElement,onDiagnostic:e.onDiagnostic})}catch(p){return f(p),null}}))).filter(i=>i!==null)}async function bE(e){let t=new Set,n={host:document.documentElement,namespace:"",referenceTarget:"document",styles:[...document.querySelectorAll("style")].map(f=>({element:f,authored:f.textContent??"",applied:f.textContent??""}))},r=await RN(e),o=await cE(e,new Set(r.map(({host:f})=>f))),i=[...r,...o];Lf([...i,n],t),await Promise.all(r.map(f=>f.runScripts()));let a=o.filter(f=>{if(f.isCurrent())return!0;for(let m of f.styles)m.element.remove();return window.__hfVariablesByComp&&delete window.__hfVariablesByComp[f.namespace],!1}),l=[...r.filter(f=>f.host.isConnected),...a],s=await cE(e,new Set(l.map(({host:f})=>f)));s.length&&Lf([...l,...s,n],t);let c=new Map([...a,...s].map(f=>[f.host,f]));for(let f of Rl()){let m=c.get(f);m&&await m.runScripts()}let d=[...l,...s].filter(f=>f.host.isConnected);Lf([...d,n],t)}function Lf(e,t){for(let{styles:r}of e)for(let o of r){let i=o.element.textContent??"";i!==o.applied&&(o.authored=i,o.applied=i)}rE(document,e.map(({host:r,namespace:o,styles:i,referenceTarget:a})=>({root:r,namespace:o,referenceTarget:a,exclude:e.filter(l=>l.host!==r&&r.contains(l.host)).map(l=>l.host),cssTexts:i.map(l=>l.authored)})),t).forEach((r,o)=>{let i=nr(e[o].host,_t);if(!(r.size===0&&i.length===0))for(let a of e[o].styles){let l=oE(a.authored,r,i);l!==a.applied&&(a.element.textContent=l),a.applied=l}}),rr()}function MN(e,t,n){let o={...e.declaredVariableDefaults??(Oe(t)?bi(t):{}),...vb(e.host)};gd(e.variableDeclarer??(Oe(t)?t:null),o,n),Sb(e.host),Object.keys(o).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[n]=o,bd(e.host,{...xb(e.host,o,window),...Us()})):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[n]}function kN(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function LN(e){if(!Array.isArray(e))throw new Error("expected a JSON array");if(!e.every(kN))throw new Error("every array entry must be an object");return e}function NN(e){let n=e.vars.data?.captionState;return n==="dim"||n==="active"?n:void 0}function FN(e){return we(e)?e.dataset.captionWrapper!=="true"?e:e.querySelector(":scope > span")??null:null}function PN(){let e=[],t=document.querySelectorAll(".caption-group");for(let n of t)for(let r of n.children){if(!we(r))continue;let o=r.dataset.captionWrapper==="true"?r.querySelector(":scope > span"):r.tagName==="SPAN"?r:null;o&&e.push(o)}return e}function IN(e){let t=e.parentElement;if(t?.dataset.captionWrapper==="true")return t;let n=document.createElement("span");return n.style.display="inline-block",n.dataset.captionWrapper="true",e.parentNode?.insertBefore(n,e),n.appendChild(e),n}var If=()=>window.gsap,xE=()=>fetch("caption-overrides.json").then(e=>e.ok?e.json():null),SE=e=>e===null?[]:LN(e);function EE(e){let t=e instanceof Error?e.message:String(e);globalThis.console.error(`[HyperFrames] Invalid caption-overrides.json: ${t}`)}function Df(){return If()?xE().then(SE).catch(e=>(EE(e),[])):Promise.resolve([])}function Of(e,t){return!If()||document.querySelectorAll(".caption-group").length===0?Promise.resolve():xE().then(n=>Hf(SE(n),e,t)).catch(EE)}function DN(e,t){return(e.wordId?FN(document.getElementById(e.wordId)):null)??(e.wordIndex!==void 0?t[e.wordIndex]??null:null)}function yE(e,t){return Object.fromEntries(t.filter(n=>e[n]!==void 0).map(n=>[n,e[n]]))}function Pf(e,t){let n=e.style.color;e.style.color=t;let r=getComputedStyle(e).color;return e.style.color=n,r}function ON(e,t){let n=t[0]?.vars.startAt;return Pf(e,n?.color===void 0?"":String(n.color))}function HN(e,t,n,r){let o=NN(e);if(o)return o;let i=String(e.vars.color);return/var\(|currentcolor/i.test(i)?Pf(t,i)===n?"dim":"active":(r.has(i)||r.set(i,Pf(t,i)),r.get(i)===n?"dim":"active")}function GN(e,t,n){if(e.dimColor)return e.dimColor;if(!(t.length===0||t.some(r=>r.vars.runBackwards)))return n}function BN(e,t,n,r){let o=e.getTweensOf(t).filter(l=>l.vars.color!==void 0).sort((l,s)=>l.startTime()-s.startTime()),i=ON(t,o);for(let l of o){let c=HN(l,t,i,r)==="dim"?n.dimColor:n.activeColor;c&&(l.vars.color=c),l.vars.runBackwards||l.invalidate?.()}let a=GN(n,o,i);a&&e.set(t,{color:a})}function UN(e,t,n,r){let o=yE(n,["x","y","scale","rotation"]),i=yE(n,["opacity","fontWeight","fontFamily"]);if(n.fontSize!==void 0&&(i.fontSize=`${n.fontSize}px`),(n.activeColor||n.dimColor)&&BN(e,t,n,r),Object.keys(i).length>0&&e.set(t,i),Object.keys(o).length>0){let a=IN(t);e.set(a,o)}}function Hf(e,t,n=()=>{}){let r=If();if(!r||e.length===0)return;n();let o=PN(),i=new Map;for(let a of e){let l=DN(a,o);!l||t&&!t.some(s=>s.contains(l))||UN(r,l,a,i)}}var Bf="data-hf-edit-base-x",Uf="data-hf-edit-base-y",Bn="data-hf-edit-original-translate",Ml=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},WN=e=>{let t=[],n=0,r="";for(let o of e.trim())o==="("&&(n+=1),o===")"&&(n=Math.max(0,n-1)),/\s/.test(o)&&n===0?(r&&t.push(r),r=""):r+=o;return r&&t.push(r),t},vE=/^-?(?:\d+(?:\.\d+)?|\.\d+)px$/,Gf=(e,t)=>vE.test(e)&&vE.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,VN=(e,t,n)=>{if(!e||e==="none")return`${t} ${n}`;let[r,o,i]=WN(e);if(r===void 0)return`${t} ${n}`;if(o===void 0)return`${Gf(r,t)} ${n}`;let a=i===void 0?"":` ${i}`;return`${Gf(r,t)} ${Gf(o,n)}${a}`},$N=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},qN=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let n=e.ownerDocument.defaultView,r=n?n.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},kl=new WeakMap;function TE(e){kl.delete(e)}function zN(e,t){let n=kl.get(e);if(!t?.force&&n!==void 0&&e.style.getPropertyValue("translate")!==n){St("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=Ml(e.getAttribute("data-x"))-Ml(e.getAttribute(Bf)),o=Ml(e.getAttribute("data-y"))-Ml(e.getAttribute(Uf));e.hasAttribute(Bn)||e.setAttribute(Bn,qN(e)),n===void 0&&$N(e);let i=e.getAttribute(Bn)??"",a=VN(i,`${r}px`,`${o}px`);e.style.setProperty("translate",a),kl.set(e,e.style.getPropertyValue("translate"))}function qi(e,t){let n=e.querySelectorAll(`[${Bn}]:not([${Bf}]):not([${Uf}])`);for(let i=0;i<n.length;i++){let a=n[i];if(a===void 0||!ar(a))continue;let l=a.getAttribute(Bn)??"";l===""?a.style.removeProperty("translate"):a.style.setProperty("translate",l),a.removeAttribute(Bn),kl.delete(a)}let r=e.querySelectorAll(`[${Bf}], [${Uf}]`),o=0;for(let i=0;i<r.length;i++){let a=r[i];a===void 0||!ar(a)||(zN(a,t),o+=1)}return o}var AE="__hfPositionEditsSeekReapplyWrapped",wE=new WeakSet,_E=new WeakMap,CE=new WeakMap;function RE(e){let t=e,n=()=>{try{qi(t.document)}catch{}},r=f=>typeof f=="function"&&(wE.has(f)||!!f[AE]),o=f=>{wE.add(f);try{Object.defineProperty(f,AE,{value:!0})}catch{}},i=f=>{if(typeof f!="function"||r(f))return f;let m=function(...p){let b=f.apply(this,p);return n(),b};return o(m),m},a=(f,m)=>{let p=_E.get(f);if(p?.has(m))return!0;let b=Object.getOwnPropertyDescriptor(f,m);if(b?.configurable===!1){let E=f[m];return typeof E=="function"&&(f[m]=i(E),n()),!1}let y=f[m],x=b?.set;return Object.defineProperty(f,m,{configurable:!0,enumerable:b?.enumerable??!0,get:()=>y,set:E=>{y=i(E),x?.call(f,E)}}),y=i(y),p??(p=new Set),p.add(m),_E.set(f,p),n(),!0},l=(f,m)=>{let p=CE.get(t),b=Object.getOwnPropertyDescriptor(t,f);if(!p?.has(f)){if(b?.configurable===!1){let E=t[f];return E?a(E,m):!1}let x=t[f];Object.defineProperty(t,f,{configurable:!0,enumerable:b?.enumerable??!0,get:()=>x,set:E=>{x=E,x&&a(x,m)}}),p??(p=new Set),p.add(f),CE.set(t,p)}let y=t[f];return y?a(y,m):!1},s=()=>{let f=l("__hf","seek"),m=l("__player","renderSeek");return f&&m};if(s())return;let c=120,d=t.setInterval(()=>{if(s()){t.clearInterval(d);return}c-=1,c<=0&&t.clearInterval(d)},50)}function Ll(e){let t=window,r=e.closest("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()??"",o=r?t.__hfVariablesByComp?.[r]:void 0;if(o)return o;let i=t.__hyperframes?.getVariables?.();return i&&typeof i=="object"?i:t.__hfVariables??{}}function Nl(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Wf(e){let t=e.replace(/[\u0000-\u0020]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(t);if(!n)return!0;let r=n[1]?.toLowerCase();return r?r==="https"||r==="http"||r==="blob"?!0:r==="data"?/^data:image\//i.test(t):!1:!1}var ME=new Set(["img","video","audio","source"]);function jN(e){if(typeof e=="string"&&e.length>0)return e;if(e!==null&&typeof e=="object"){let t=e.url;if(typeof t=="string"&&t.length>0)return t}return null}function KN(e){return e.replace(/[;{}<>\r\n]/g,"")}function YN(e){if(Nl(e))return String(e);if(e!==null&&typeof e=="object"){let t=e.name;if(typeof t=="string"&&t.length>0)return t}return null}function Vf(e,t){let n=e.closest("[data-composition-id]"),r=t.get(n);if(r)return r;let o=Ll(e);return t.set(n,o),o}function XN(e,t){if(e.childElementCount===0){e.textContent=t;return}let n=!1;for(let r of Array.from(e.childNodes))r.nodeType===Node.TEXT_NODE&&(r.nodeValue=n?"":t,n=!0);n||e.insertBefore(e.ownerDocument.createTextNode(t),e.firstChild)}function JN(e){return e.querySelector("[data-hf-root]")??e.getElementById("stage")??e.body?.firstElementChild??e.body}function QN(e,t){for(let n of new Set(e)){let r=Vf(n,t);for(let[o,i]of Object.entries(r)){let a=YN(i);a!==null&&we(n)&&n.style.setProperty(`--${o}`,KN(a))}}}function kE(e,t,n=!0){let r=e.getAttribute("data-var-src")?.trim();if(!r)return null;if(!ME.has(e.tagName.toLowerCase()))return n&&globalThis.console.warn(`[hyperframes] Ignoring data-var-src on <${e.tagName.toLowerCase()}>: variable-bound src is only allowed on ${Array.from(ME).join("/")}.`),null;let o=jN(Vf(e,t)[r]);return o===null?null:Wf(o)?o:(n&&globalThis.console.warn(`[hyperframes] Ignoring data-var-src="${r}": unsafe URL protocol.`),null)}function LE(e){return kE(e,new Map,!1)??xi(e)}function Fl(e,t){let n=new Map,r=i=>t?[...t.matches(i)?[t]:[],...t.querySelectorAll(i)]:Array.from(e.querySelectorAll(i)),o=t?null:JN(e);QN([...o?[o]:[],...r("[data-composition-id]")],n);for(let i of r("[data-var-src]")){let a=kE(i,n);a!==null&&xi(i)!==a&&i.setAttribute("src",a)}for(let i of r("[data-var-text]")){let a=i.getAttribute("data-var-text")?.trim();if(!a)continue;let l=Vf(i,n)[a];Nl(l)&&XN(i,String(l))}}var ZN=["video","audio","source","script",tn];function $f(e,t=()=>!1){let n=r=>r.nodeType===Node.ELEMENT_NODE&&(r.matches(e)||r.querySelector(e)!==null||t(r));return r=>r.some(o=>o.type==="attributes"||Array.from(o.addedNodes).some(n)||Array.from(o.removedNodes).some(n))}var NE=e=>$f([...ZN,...e.map(t=>`[${t}]`)].join(","));var eF=3e3,ln=new Map,tF="data-hf-color-grading-canvas",nF="__hf_color_grading_canvas__";function qE(){if(typeof MutationObserver>"u"||typeof document>"u")return;let e=document.documentElement;if(!e)return;let t=r=>{we(r)&&(r.hasAttribute(br)||r.setAttribute(br,r.style.opacity))},n=r=>{if(Oe(r)){r.matches("video, img")&&t(r);for(let o of r.querySelectorAll("video, img"))t(o)}};n(e),new MutationObserver(r=>{for(let o of r)for(let i of o.addedNodes)n(i)}).observe(e,{childList:!0,subtree:!0})}var rF=16,oF=4,Ar={enabled:!1,position:.5,softness:0,lineWidth:2},qf=["#000000","#ffffff"],iF=["#1a1a1a","#f5f5dc"],Qi=3,aF=Qi-1,sF=5,Sr=`${Wt}.0`,FE=`${Wt-1}.0`,PE=`${Qi}.0`,lF=`${(aF+.5)/Qi}`;function zi(e){let t=e.getAttribute(nl);return t==null?null:jy(t,Ll(e))}var uF=["attribute vec2 a_pos;","varying vec2 v_uv;","void main(){"," v_uv = a_pos * 0.5 + 0.5;"," gl_Position = vec4(a_pos, 0.0, 1.0);","}"].join(`
|
|
364
|
+
})();`}function _l(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function WL(e){return _l(e)&&Object.values(e).every(_l)}var qS=(e,t)=>e&&Object.fromEntries(Object.entries(e).map(([n,r])=>[n,typeof r=="string"?t(r):null]));function zS(e,t){let n;try{n=JSON.parse(e)}catch{return null}if(!_l(n))return null;let{imports:r,scopes:o}=n;return r!==void 0&&!_l(r)||o!==void 0&&!WL(o)?null:{imports:qS(r,t),scopes:o&&Object.fromEntries(Object.entries(o).map(([i,a])=>[t(i),qS(a,t)??{}]))}}var Cf="text/hf-after-fonts",KS=`${Cf}+module`,YS=`script[type="${Cf}"], script[type="${KS}"]`,XS="__hfAfterFontsClaimed",VL="data-hf-inlined-src";var JS=`[defer][src], [defer][${VL}]`;function Cl(e){let t=e.getAttribute("type");return t===Cf?null:t===KS?"module":t}function $L(e){let t=e.getAttribute("type")??"",n=e.tagName.toLowerCase()==="link"?t.split(";")[0].trim():t;if(n!==""&&n.toLowerCase()!=="text/css")return;let r=(e.getAttribute("media")??"").trim().toLowerCase();return JSON.stringify([r==="all"?"":r,e.getAttribute("title")??""])}var l5=JSON.stringify(["",""]);function jS(e){return JSON.stringify([e.getAttribute("href"),(e.getAttribute("rel")??"").trim().toLowerCase(),$L(e)??e.getAttribute("type"),e.hasAttribute("disabled")])}function QS(e,t){let n=jS(t);return[...e.querySelectorAll("link[href]")].some(r=>!r.closest("noscript")&&jS(r)===n)}var et="id",Tf="data-hf-authored-id",mo=/(url\(\s*)(["']?)#([^"')\s]+)\2(\s*\))/gi;function eE(e){return e==="href"||e.endsWith(":href")}function qL(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function Rf(e,t){return!e||!e.toLowerCase().includes("url(")?e:e.replace(mo,(n,r,o,i,a)=>{let l=t.get(i);return l?`${r}${o}#${l}${o}${a}`:n})}function zL(e,t,n){if(eE(e)&&t.startsWith("#")){let o=n.get(t.slice(1));return o?`#${o}`:t}mo.lastIndex=0;let r=mo.test(t);return mo.lastIndex=0,r?Rf(t,n):null}function jL(e,t,n){if(e.name===_t||e.name===et)return{kind:"skip"};let r=t&&e.value===t.after?t.before:e.value,o=zL(e.name,r,n);return o!==null?{kind:"managed",before:r,after:o}:t?{kind:"retain",alias:t}:{kind:"skip"}}function KL(e,t,n,r){let o=e.namespaceURI===void 0&&e.name==="xlink:href"&&r;return{name:e.name,localName:o?"href":e.localName,namespaceURI:o?"http://www.w3.org/1999/xlink":e.namespaceURI??null,before:t,after:n}}function YL(e,t){let n=new Map(nr(e,_t,!1).map(i=>[i.name,i])),r=[...n.values()].filter(i=>i.name===et),o=!!e.closest("svg");for(let i of e.attributes?Array.from(e.attributes):[]){let a=jL(i,n.get(i.name),t);if(a.kind!=="skip"){if(a.kind==="retain"){r.push(a.alias);continue}a.after!==i.value&&(i.namespaceURI?e.setAttributeNS(i.namespaceURI,i.name,a.after):e.setAttribute(i.name,a.after)),r.push(KL(i,a.before,a.after,o))}}r.length&&e.setAttribute(_t,JSON.stringify(r))}function ZS(e,t,n){let r;for(mo.lastIndex=0;r=mo.exec(e);){let o=r[3];t.has(o)&&n.add(o)}}function XL(e,t,n){if(eE(e.name)&&e.value.startsWith("#")){let r=e.value.slice(1);t.has(r)&&n.add(r)}}function JL(e,t,n){let r=new Set;for(let o of e)for(let i of o.attributes?Array.from(o.attributes):[])!i.value||i.name===_t||(XL(i,n,r),i.value.toLowerCase().includes("url(")&&ZS(i.value,n,r));for(let o of t)o.toLowerCase().includes("url(")&&ZS(o,n,r);return r}function tE(e,t){return t.some(n=>n===e||n.contains(e))}function QL(e){let t=e.exclude??[],n=[...e.root.querySelectorAll("*")],r=t.length?n.filter(o=>!tE(o,t)):n;return[e.root,...r]}function ZL(e){let t=e.exclude??[],n=[...e.root.querySelectorAll("svg [id], svg[id]")];return t.length?n.filter(r=>!tE(r,t)):n}function eN(e){let t=QL(e),n=new Set;if(!e.namespace)return{elements:t,renamable:n};let r=ZL(e),o=new Set;for(let a of r){let l=a.getAttribute(et);l&&o.add(l)}if(o.size===0)return{elements:t,renamable:n};let i=JL(t,e.cssTexts??[],o);for(let a of r){let l=a.getAttribute(et);l&&i.has(l)&&n.add(a)}return{elements:t,renamable:n}}function nE(e){if(!e.closest("svg"))return null;let t=nr(e,_t,!1).find(n=>n.name===et);return t?e.getAttribute(et)===t.after?t.before:null:e.getAttribute(Tf)}function tN(e){let t=new Map,n=new Set;for(let r of e.querySelectorAll("[id]")){let o=r.getAttribute(et);if(!o)continue;n.add(o);let i=t.get(o);i?i.push(r):t.set(o,[r]);let a=nE(r);if(a&&a!==o){let l=t.get(a);l?l.push(r):t.set(a,[r])}}return{elementsById:t,usedIds:n}}function nN(e,t,n){let r=`${qL(e)}--${t}`,o=r;for(let i=2;n.has(o);i+=1)o=`${r}-${i}`;return n.add(o),o}function rN(e,t,n){let r=t.find(a=>!n.has(a))??t[0],i=t.filter(a=>a!==r&&a.getAttribute(et)===e).map(a=>n.get(a));return new Set(i.filter(a=>a!==void 0))}function oN(e,t,n){let r=t.map(()=>new Map);for(let[o,i]of e.elementsById)if(!(i.length<2))for(let a of rN(o,i,n))r[a].set(o,nN(t[a].namespace,o,e.usedIds));return r}function iN(e,t,n){let r=new Map;for(let[o,i]of e.elementsById){let a=i[0],l=a.getAttribute(et);if(l!==o){r.set(o,l);continue}let s=n.get(a),c=s===void 0?void 0:t[s].get(o);c&&r.set(o,c)}return r}function aN(e){let t=new Set(e.map(r=>r.getAttribute(et))),n=new Map;for(let r of e){let o=nE(r),i=r.getAttribute(et);!o||!i||(t.add(o),n.set(o,i))}return{ids:t,renamed:n}}function sN(e,t){for(let n of e.elements){let r=n.getAttribute(et);if(r&&e.renamable.has(n)&&t.has(r)){n.hasAttribute(Tf)||n.setAttribute(Tf,r);let o=t.get(r),i=nr(n,_t,!1);i.push({name:et,localName:et,namespaceURI:null,before:r,after:o}),n.setAttribute(_t,JSON.stringify(i)),n.setAttribute(et,o)}YL(n,t)}}function rE(e,t,n){if(t.length===0)return[];let r=tN(e),o=t.map(eN),i=o.flatMap(({renamable:d})=>[...d]);if(n)for(let d of o)for(let f of d.renamable)n.has(f)&&d.renamable.delete(f);let a=new Map;o.forEach(({renamable:d},f)=>{for(let m of d)a.set(m,f)});let l=oN(r,t,a),s=iN(r,l,a),c=o.map((d,f)=>{let m=aN(t[f].referenceTarget==="document"?[]:d.elements),p=[...s].filter(([b])=>!m.ids.has(b));return new Map([...p,...m.renamed,...l[f]])});c.forEach((d,f)=>{sN(o[f],d)});for(let d of i)n?.add(d);return c}function oE(e,t,n=[]){if(!e||t.size===0&&n.length===0||!e.includes("#")&&!e.includes("[")&&!e.toLowerCase().includes("url("))return e;let r;try{r=wl.parse(e)}catch{return e}let o=!1,i=new Set(n.filter(l=>l.name===et).map(l=>l.before)),a=[...t].filter(([l])=>!i.has(l)).map(([l,s])=>({id:l,replacement:`:is(#${Xt(l)}, #${Xt(s)})`}));return r.walkRules(l=>{let s=l.selectors.map(c=>qa(c,a,n));s.some((c,d)=>c!==l.selectors[d])&&(l.selectors=s,o=!0)}),r.walkDecls(l=>{let s=Rf(l.value,t);s!==l.value&&(l.value=s,o=!0)}),r.walkAtRules(l=>{if(!l.params)return;let s=Rf(l.params,t);s!==l.params&&(l.params=s,o=!0)}),o?r.toResult({map:!1}).css:e}var Mf=5e3;window[XS]=!0;async function Vi(){let e=document.fonts;if(!e)return;document.body?.offsetHeight;let t,n=await Promise.race([e.ready.then(()=>!1),new Promise(o=>t=setTimeout(o,Mf,!0))]);if(clearTimeout(t),!n)return;let r=[...new Set(Array.from(e).filter(o=>o.status==="loading").map(o=>o.family))];globalThis.console.warn(`[hyperframes] fonts still loading after ${Mf} ms, composition scripts run without them: ${r.join(", ")}`),Ce({source:"hf-preview",type:"diagnostic",code:"runtime_font_wait_timeout",details:{loadingFamilies:r,timeoutMs:Mf}})}function lN(e,t){let n=Object.getOwnPropertyDescriptor(e,"addEventListener"),r=e.addEventListener,o=(i,a,l)=>{if(!a)return;i==="DOMContentLoaded"||i==="load"&&e===window&&document.readyState==="complete"?t.push({target:e,type:i,listener:a}):r.call(e,i,a,l)};return e.addEventListener=o,()=>{e.addEventListener===o&&(n?Object.defineProperty(e,"addEventListener",n):delete e.addEventListener)}}function uN(e){if(!e.isConnected)return;let t=document.createElement("script");for(let{name:r,value:o}of Array.from(e.attributes))t.setAttribute(r,o);let n=Cl(e);return n===null?t.removeAttribute("type"):t.setAttribute("type",n),t.async=e.hasAttribute("async"),t.text=e.textContent??"",e.replaceWith(t),t}var cN=50,dN=()=>!window.__HF_VIRTUAL_TIME__;function fN(){let e=globalThis.scheduler;return typeof e?.yield=="function"?e.yield():new Promise(t=>{let n=new MessageChannel;n.port1.onmessage=()=>{n.port1.close(),t()},n.port2.postMessage(null)})}var mN=e=>new Promise(t=>{e.addEventListener("load",t),e.addEventListener("error",t)});function pN(){let e=document.createElement("script");e.type="module",e.async=!1,e.text='document.dispatchEvent(new Event("hf-after-fonts-modules"))';let t=new Promise(n=>document.addEventListener("hf-after-fonts-modules",n,{once:!0}));return document.body.appendChild(e),t.then(()=>e.remove())}async function Tl(e,t){await Vi();let n=l=>Cl(l)==="module"||l.matches(JS),r=[],o=[document,window].map(l=>lN(l,r)),i=dN(),a=performance.now();for(let l of[...e.filter(s=>!n(s)),...e.filter(n)]){i&&performance.now()-a>cN&&(await fN(),a=performance.now());let s=uN(l);s?.hasAttribute("src")&&!s.async&&!s.noModule?await mN(s):Cl(l)==="module"&&await pN()}for(let l of o)l();t?.();for(let{target:l,type:s,listener:c}of r){let d=new Event(s);try{typeof c=="function"?c.call(l,d):c.handleEvent(d)}catch(f){reportError(f)}}}var hN=["data-composition-id","data-composition-file","data-start","data-duration","data-end","data-track-index","data-track","data-composition-src","data-hf-authored-duration","data-hf-authored-end"];function iE(e){let t=e.getAttribute("id")?.trim();for(let n of hN)e.removeAttribute(n);t&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",t)),e.setAttribute("data-hf-inner-root","true")}var gN=8e3,bN=/^(?![a-zA-Z][a-zA-Z\d+\-.]*:)(?!\/\/)(?!\/)(?!\.\.?\/).+/,yN=/\burl\(\s*(["']?)([^)"']+)\1\s*\)/g,xN=["src","href"];function SN(e){return!e||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/")}function dE(e,t){if(!t)return e;let n=e.trim();if(SN(n)||!n.startsWith("../")&&n!=="..")return e;try{return new URL(n,t).href}catch{return e}}function fE(e,t){return!t||!e?e:e.replace(yN,(n,r,o)=>{let i=dE(o||"",t);return i===o?n:`url(${r||""}${i}${r||""})`})}function EN(e,t){for(let n of Array.from(e.querySelectorAll("[src], [href]")))for(let r of xN){let o=n.getAttribute(r);if(o==null)continue;let i=dE(o,t);i!==o&&n.setAttribute(r,i)}}function vN(e,t){for(let n of Array.from(e.querySelectorAll("[style]"))){let r=n.getAttribute("style");if(r==null)continue;let o=fE(r,t);o!==r&&n.setAttribute("style",o)}}function AN(e,t){for(let n of Array.from(e.querySelectorAll("style"))){let r=n.textContent||"",o=fE(r,t);o!==r&&(n.textContent=o)}}function mE(e,t){if(t){EN(e,t),vN(e,t),AN(e,t);for(let n of Array.from(e.querySelectorAll("template")))mE(n.content,t)}}function aE(e,t){return`${e}__hf${t}`}var wN=e=>new Promise(t=>{let n=!1,r=Date.now(),o=null,i=a=>{n||(n=!0,o!=null&&window.clearTimeout(o),t({status:a,elapsedMs:Math.max(0,Date.now()-r)}))};e.addEventListener("load",()=>i("load"),{once:!0}),e.addEventListener("error",()=>i("error"),{once:!0}),o=window.setTimeout(()=>i("timeout"),gN)});function Nf(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function kf(e){for(let t of sx(e))t.remove()}function _N(e){let t=document.importNode(e,!0);iE(t);let n=dr(t.getAttribute("data-width")),r=dr(t.getAttribute("data-height"));return t.style.width=n===null?"100%":`${n}px`,t.style.height=r===null?"100%":`${r}px`,t}function sE(e,t){let n=e.trim();if(!n)return e;try{return bN.test(n)&&!n.startsWith("#")&&!n.startsWith("?")?new URL(n,document.baseURI).toString():t?new URL(n,t).toString():new URL(n,document.baseURI).toString()}catch{return e}}function lE(e,t){try{let n=new URL(e),r=new URL(t);return n.search="",n.hash="",r.search="",r.hash="",n.href===r.href}catch{return!1}}function $i(e){let t=(e.getAttribute("data-composition-id")||"").trim()||null;return{authoredCompositionId:(e.getAttribute("data-hf-original-composition-id")||t||"").trim()||null,runtimeCompositionId:t}}function CN(e){let t=new Map;for(let n of e){let r=$i(n).authoredCompositionId||"";r&&t.set(r,(t.get(r)||0)+1)}return ux(t,e),t}function pE(e){let t=$i(e).authoredCompositionId;return t?!!document.querySelector(`template#${CSS.escape(t)}-template`):!1}function TN(e){return!!e.querySelector('[data-hf-inner-root="true"]')}function uE(e){return e.hasAttribute("data-composition-src")?!0:pE(e)?e.children.length===0||e.hasAttribute("data-hf-original-composition-id")?!0:TN(e):!1}function Rl(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(t=>t.hasAttribute("data-composition-src")?!0:pE(t))}function Ff(){let e=window.__hfVariablesByComp;if(!e)return;let t=new Set(Rl().map(n=>$i(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(e))t.has(n)||delete e[n]}function hE(e,t){let n=CN(e),r=new Set(e.flatMap(a=>{let l=$i(a),s=l.authoredCompositionId?[l.authoredCompositionId]:[];return(t.has(a)||!uE(a))&&l.runtimeCompositionId&&s.push(l.runtimeCompositionId),s})),o=new Map,i=new Map;for(let a of e){let{authoredCompositionId:l,runtimeCompositionId:s}=$i(a),c=!t.has(a)&&uE(a);if(!l){i.set(a,{authoredCompositionId:null,runtimeCompositionId:s});continue}let d=(n.get(l)||0)>1,f=s||l;if(c){let m=d?(o.get(l)||0)+1:0;if(d){for(;r.has(aE(l,m));)m+=1;o.set(l,m)}f=d?aE(l,m):l,r.add(f),d?a.setAttribute("data-hf-original-composition-id",l):a.removeAttribute("data-hf-original-composition-id"),a.setAttribute("data-composition-id",f)}i.set(a,{authoredCompositionId:l,runtimeCompositionId:f})}return Ff(),i}async function gE(e){let t=lx({contentNode:e.sourceNode,head:e.head,hasTemplate:e.hasTemplate,compositionId:e.authoredCompositionId}),n=we(t.innerRoot)?t.innerRoot:null,r=n??e.sourceNode,o=t.authoredCompositionId,i=t.scriptCompositionId,a=e.runtimeCompositionId||null,l=t.authoredRootId,s=a?`[data-composition-id="${CSS.escape(a)}"]`:void 0;for(let y of t.linkSources){let x=(y.getAttribute("href")||"").trim();if(!x)continue;let E=e.compositionUrl?new URL(x,e.compositionUrl).href:x;if(e.compositionUrl&&lE(E,e.compositionUrl))continue;let v=y.cloneNode(!0);Zh(v)&&(v.href=E,!QS(document.head,v)&&(document.head.appendChild(v),e.injectedLinks.push(v)))}let c=[];(y=>{for(let x of y){let E=x.cloneNode(!0);if(!Qh(E))continue;o&&(E.textContent=WS(E.textContent||"",o,s,l,{scopeRootSelectors:!0})),document.head.appendChild(E),e.injectedStyles.push(E);let v=E.textContent||"";c.push({element:E,authored:v,applied:v})}})(t.styleSources);let f=y=>{let x=y.getAttribute("type")?.trim()??"",E=y.getAttribute("src")?.trim()??"";if(E){let _=sE(E,e.compositionUrl);return e.compositionUrl&&lE(_,e.compositionUrl)?null:{kind:"external",src:_,type:x}}let v=y.textContent?.trim()??"";return v?{kind:"inline",content:v,type:x,scopeCompositionId:i}:null},m=t.scriptSources.map(f).filter(y=>y!==null);if(n){let y=n.getAttribute("data-width"),x=n.getAttribute("data-height"),E=e.parseDimensionPx(y),v=e.parseDimensionPx(x);y&&e.host.setAttribute("data-width",y),x&&e.host.setAttribute("data-height",x),E&&we(e.host)&&(e.host.style.width=E),v&&we(e.host)&&(e.host.style.height=v),n.hasAttribute("data-timeline-locked")&&e.host.setAttribute("data-timeline-locked","");let _=_N(n);!e.authoredCompositionId&&o&&_.setAttribute("data-composition-id",o),kf(_),e.host.appendChild(_)}else if(e.hasTemplate){let y=document.importNode(r,!0);kf(y),e.host.appendChild(y)}else e.host.innerHTML=e.fallbackBodyInnerHtml,kf(e.host);for(let y of t.inertScriptsOutsideRoot)e.host.appendChild(document.importNode(y,!0));a&&MN(e,r,a);let p=Array.from(e.host.childNodes),b=()=>e.host.isConnected&&(p.length>0||e.host.childNodes.length===0)&&p.every(y=>y.parentNode===e.host);return{host:e.host,namespace:a||o||"",styles:c,isCurrent:b,runScripts:async()=>{if(m.length>0&&await Vi(),!!b())for(let y of m){let x=document.createElement("script");if(y.type&&(x.type=y.type),x.async=!1,y.kind==="external")x.src=y.src;else if(y.type.toLowerCase()==="importmap"){let E=zS(y.content,v=>sE(v,e.compositionUrl));x.textContent=E?JSON.stringify(E):y.content}else if(y.type.toLowerCase()==="module"){let E=y.scopeCompositionId?$S(a||y.scopeCompositionId,e.compositionUrl?.href):"";x.textContent=E+y.content}else y.scopeCompositionId?x.textContent=_f(y.content,y.scopeCompositionId,"[HyperFrames] composition script error:",s,a||y.scopeCompositionId,l,e.compositionUrl?.href):x.textContent=`(function(){${y.content}})();`;if(document.body.appendChild(x),e.injectedScripts.push(x),y.kind==="external"){let E=await wN(x);E.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.authoredCompositionId,runtimeCompositionId:e.runtimeCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:y.src,loadStatus:E.status,elapsedMs:E.elapsedMs}})}}}}}async function cE(e,t){let n=Rl();if(Ff(),n.length===0)return[];let r=hE(n,t),o=n.filter(a=>{if(t.has(a)||a.hasAttribute("data-composition-src")||a.children.length>0)return!1;let l=r.get(a)?.authoredCompositionId;return l?!!document.querySelector(`template#${CSS.escape(l)}-template`):!1}),i=[];for(let a of o){let l=r.get(a),s=l?.authoredCompositionId;if(!s)continue;let c=document.querySelector(`template#${CSS.escape(s)}-template`);Nf(a);let d=await gE({host:a,authoredCompositionId:s,runtimeCompositionId:l?.runtimeCompositionId||s,hostCompositionSrc:`template#${s}-template`,sourceNode:c.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});i.push(d)}return i}async function RN(e){let t=Rl();if(Ff(),t.length===0)return[];let n=hE(t,new Set),r=t.filter(i=>i.hasAttribute("data-composition-src"));return(await Promise.all(r.map(async i=>{let a=i.getAttribute("data-composition-src");if(!a)return null;let l=n.get(i),s=l?.authoredCompositionId||null,c=l?.runtimeCompositionId||s||null,d=null;try{d=new URL(a,document.baseURI)}catch{d=null}Nf(i);let f=p=>{e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:s,runtimeCompositionId:c,hostCompositionSrc:a,errorMessage:p instanceof Error?p.message:"unknown_error"}}),Nf(i)},m=async p=>{let b=await gE(p),y=b.runScripts;return b.runScripts=async()=>{try{await y()}catch(x){f(x)}},b};try{let p=s!=null?document.querySelector(`template#${CSS.escape(s)}-template`):null;if(p)return await m({host:i,authoredCompositionId:s,runtimeCompositionId:c,hostCompositionSrc:a,sourceNode:p.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:d,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});let b=await fetch(a);if(!b.ok)throw new Error(`HTTP ${b.status}`);let y=await b.text(),E=new DOMParser().parseFromString(y,"text/html");mE(E,d);let v=(s?E.querySelector(`template#${CSS.escape(s)}-template`):null)??E.querySelector("template"),_=v?v.content:E.body;return await m({host:i,authoredCompositionId:s,runtimeCompositionId:c,hostCompositionSrc:a,sourceNode:_,hasTemplate:!!v,fallbackBodyInnerHtml:E.body.innerHTML,compositionUrl:d,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,head:E.head,declaredVariableDefaults:bi(E.documentElement),variableDeclarer:E.documentElement,onDiagnostic:e.onDiagnostic})}catch(p){return f(p),null}}))).filter(i=>i!==null)}async function bE(e){let t=new Set,n={host:document.documentElement,namespace:"",referenceTarget:"document",styles:[...document.querySelectorAll("style")].map(f=>({element:f,authored:f.textContent??"",applied:f.textContent??""}))},r=await RN(e),o=await cE(e,new Set(r.map(({host:f})=>f))),i=[...r,...o];Lf([...i,n],t),await Promise.all(r.map(f=>f.runScripts()));let a=o.filter(f=>{if(f.isCurrent())return!0;for(let m of f.styles)m.element.remove();return window.__hfVariablesByComp&&delete window.__hfVariablesByComp[f.namespace],!1}),l=[...r.filter(f=>f.host.isConnected),...a],s=await cE(e,new Set(l.map(({host:f})=>f)));s.length&&Lf([...l,...s,n],t);let c=new Map([...a,...s].map(f=>[f.host,f]));for(let f of Rl()){let m=c.get(f);m&&await m.runScripts()}let d=[...l,...s].filter(f=>f.host.isConnected);Lf([...d,n],t)}function Lf(e,t){for(let{styles:r}of e)for(let o of r){let i=o.element.textContent??"";i!==o.applied&&(o.authored=i,o.applied=i)}rE(document,e.map(({host:r,namespace:o,styles:i,referenceTarget:a})=>({root:r,namespace:o,referenceTarget:a,exclude:e.filter(l=>l.host!==r&&r.contains(l.host)).map(l=>l.host),cssTexts:i.map(l=>l.authored)})),t).forEach((r,o)=>{let i=nr(e[o].host,_t);if(!(r.size===0&&i.length===0))for(let a of e[o].styles){let l=oE(a.authored,r,i);l!==a.applied&&(a.element.textContent=l),a.applied=l}}),rr()}function MN(e,t,n){let o={...e.declaredVariableDefaults??(Oe(t)?bi(t):{}),...vb(e.host)};gd(e.variableDeclarer??(Oe(t)?t:null),o,n),Sb(e.host),Object.keys(o).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[n]=o,bd(e.host,{...xb(e.host,o,window),...Us()})):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[n]}function kN(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function LN(e){if(!Array.isArray(e))throw new Error("expected a JSON array");if(!e.every(kN))throw new Error("every array entry must be an object");return e}function NN(e){let n=e.vars.data?.captionState;return n==="dim"||n==="active"?n:void 0}function FN(e){return we(e)?e.dataset.captionWrapper!=="true"?e:e.querySelector(":scope > span")??null:null}function PN(){let e=[],t=document.querySelectorAll(".caption-group");for(let n of t)for(let r of n.children){if(!we(r))continue;let o=r.dataset.captionWrapper==="true"?r.querySelector(":scope > span"):r.tagName==="SPAN"?r:null;o&&e.push(o)}return e}function IN(e){let t=e.parentElement;if(t?.dataset.captionWrapper==="true")return t;let n=document.createElement("span");return n.style.display="inline-block",n.dataset.captionWrapper="true",e.parentNode?.insertBefore(n,e),n.appendChild(e),n}var If=()=>window.gsap,xE=()=>fetch("caption-overrides.json").then(e=>e.ok?e.json():null),SE=e=>e===null?[]:LN(e);function EE(e){let t=e instanceof Error?e.message:String(e);globalThis.console.error(`[HyperFrames] Invalid caption-overrides.json: ${t}`)}function Df(){return If()?xE().then(SE).catch(e=>(EE(e),[])):Promise.resolve([])}function Of(e,t){return!If()||document.querySelectorAll(".caption-group").length===0?Promise.resolve():xE().then(n=>Hf(SE(n),e,t)).catch(EE)}function DN(e,t){return(e.wordId?FN(document.getElementById(e.wordId)):null)??(e.wordIndex!==void 0?t[e.wordIndex]??null:null)}function yE(e,t){return Object.fromEntries(t.filter(n=>e[n]!==void 0).map(n=>[n,e[n]]))}function Pf(e,t){let n=e.style.color;e.style.color=t;let r=getComputedStyle(e).color;return e.style.color=n,r}function ON(e,t){let n=t[0]?.vars.startAt;return Pf(e,n?.color===void 0?"":String(n.color))}function HN(e,t,n,r){let o=NN(e);if(o)return o;let i=String(e.vars.color);return/var\(|currentcolor/i.test(i)?Pf(t,i)===n?"dim":"active":(r.has(i)||r.set(i,Pf(t,i)),r.get(i)===n?"dim":"active")}function GN(e,t,n){if(e.dimColor)return e.dimColor;if(!(t.length===0||t.some(r=>r.vars.runBackwards)))return n}function BN(e,t,n,r){let o=e.getTweensOf(t).filter(l=>l.vars.color!==void 0).sort((l,s)=>l.startTime()-s.startTime()),i=ON(t,o);for(let l of o){let c=HN(l,t,i,r)==="dim"?n.dimColor:n.activeColor;c&&(l.vars.color=c),l.vars.runBackwards||l.invalidate?.()}let a=GN(n,o,i);a&&e.set(t,{color:a})}function UN(e,t,n,r){let o=yE(n,["x","y","scale","rotation"]),i=yE(n,["opacity","fontWeight","fontFamily"]);if(n.fontSize!==void 0&&(i.fontSize=`${n.fontSize}px`),(n.activeColor||n.dimColor)&&BN(e,t,n,r),Object.keys(i).length>0&&e.set(t,i),Object.keys(o).length>0){let a=IN(t);e.set(a,o)}}function Hf(e,t,n=()=>{}){let r=If();if(!r||e.length===0)return;n();let o=PN(),i=new Map;for(let a of e){let l=DN(a,o);!l||t&&!t.some(s=>s.contains(l))||UN(r,l,a,i)}}var Bf="data-hf-edit-base-x",Uf="data-hf-edit-base-y",Bn="data-hf-edit-original-translate",Ml=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},WN=e=>{let t=[],n=0,r="";for(let o of e.trim())o==="("&&(n+=1),o===")"&&(n=Math.max(0,n-1)),/\s/.test(o)&&n===0?(r&&t.push(r),r=""):r+=o;return r&&t.push(r),t},vE=/^-?(?:\d+(?:\.\d+)?|\.\d+)px$/,Gf=(e,t)=>vE.test(e)&&vE.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,VN=(e,t,n)=>{if(!e||e==="none")return`${t} ${n}`;let[r,o,i]=WN(e);if(r===void 0)return`${t} ${n}`;if(o===void 0)return`${Gf(r,t)} ${n}`;let a=i===void 0?"":` ${i}`;return`${Gf(r,t)} ${Gf(o,n)}${a}`},$N=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},qN=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let n=e.ownerDocument.defaultView,r=n?n.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},kl=new WeakMap;function TE(e){kl.delete(e)}function zN(e,t){let n=kl.get(e);if(!t?.force&&n!==void 0&&e.style.getPropertyValue("translate")!==n){St("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=Ml(e.getAttribute("data-x"))-Ml(e.getAttribute(Bf)),o=Ml(e.getAttribute("data-y"))-Ml(e.getAttribute(Uf));e.hasAttribute(Bn)||e.setAttribute(Bn,qN(e)),n===void 0&&$N(e);let i=e.getAttribute(Bn)??"",a=VN(i,`${r}px`,`${o}px`);e.style.setProperty("translate",a),kl.set(e,e.style.getPropertyValue("translate"))}function qi(e,t){let n=e.querySelectorAll(`[${Bn}]:not([${Bf}]):not([${Uf}])`);for(let i=0;i<n.length;i++){let a=n[i];if(a===void 0||!ar(a))continue;let l=a.getAttribute(Bn)??"";l===""?a.style.removeProperty("translate"):a.style.setProperty("translate",l),a.removeAttribute(Bn),kl.delete(a)}let r=e.querySelectorAll(`[${Bf}], [${Uf}]`),o=0;for(let i=0;i<r.length;i++){let a=r[i];a===void 0||!ar(a)||(zN(a,t),o+=1)}return o}var AE="__hfPositionEditsSeekReapplyWrapped",wE=new WeakSet,_E=new WeakMap,CE=new WeakMap;function RE(e){let t=e,n=()=>{try{qi(t.document)}catch{}},r=f=>typeof f=="function"&&(wE.has(f)||!!f[AE]),o=f=>{wE.add(f);try{Object.defineProperty(f,AE,{value:!0})}catch{}},i=f=>{if(typeof f!="function"||r(f))return f;let m=function(...p){let b=f.apply(this,p);return n(),b};return o(m),m},a=(f,m)=>{let p=_E.get(f);if(p?.has(m))return!0;let b=Object.getOwnPropertyDescriptor(f,m);if(b?.configurable===!1){let E=f[m];return typeof E=="function"&&(f[m]=i(E),n()),!1}let y=f[m],x=b?.set;return Object.defineProperty(f,m,{configurable:!0,enumerable:b?.enumerable??!0,get:()=>y,set:E=>{y=i(E),x?.call(f,E)}}),y=i(y),p??(p=new Set),p.add(m),_E.set(f,p),n(),!0},l=(f,m)=>{let p=CE.get(t),b=Object.getOwnPropertyDescriptor(t,f);if(!p?.has(f)){if(b?.configurable===!1){let E=t[f];return E?a(E,m):!1}let x=t[f];Object.defineProperty(t,f,{configurable:!0,enumerable:b?.enumerable??!0,get:()=>x,set:E=>{x=E,x&&a(x,m)}}),p??(p=new Set),p.add(f),CE.set(t,p)}let y=t[f];return y?a(y,m):!1},s=()=>{let f=l("__hf","seek"),m=l("__player","renderSeek");return f&&m};if(s())return;let c=120,d=t.setInterval(()=>{if(s()){t.clearInterval(d);return}c-=1,c<=0&&t.clearInterval(d)},50)}function Ll(e){let t=window,r=e.closest("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()??"",o=r?t.__hfVariablesByComp?.[r]:void 0;if(o)return o;let i=t.__hyperframes?.getVariables?.();return i&&typeof i=="object"?i:t.__hfVariables??{}}function Nl(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Wf(e){let t=e.replace(/[\u0000-\u0020]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(t);if(!n)return!0;let r=n[1]?.toLowerCase();return r?r==="https"||r==="http"||r==="blob"?!0:r==="data"?/^data:image\//i.test(t):!1:!1}var ME=new Set(["img","video","audio","source"]);function jN(e){if(typeof e=="string"&&e.length>0)return e;if(e!==null&&typeof e=="object"){let t=e.url;if(typeof t=="string"&&t.length>0)return t}return null}function KN(e){return e.replace(/[;{}<>\r\n]/g,"")}function YN(e){if(Nl(e))return String(e);if(e!==null&&typeof e=="object"){let t=e.name;if(typeof t=="string"&&t.length>0)return t}return null}function Vf(e,t){let n=e.closest("[data-composition-id]"),r=t.get(n);if(r)return r;let o=Ll(e);return t.set(n,o),o}function XN(e,t){if(e.childElementCount===0){e.textContent=t;return}let n=!1;for(let r of Array.from(e.childNodes))r.nodeType===Node.TEXT_NODE&&(r.nodeValue=n?"":t,n=!0);n||e.insertBefore(e.ownerDocument.createTextNode(t),e.firstChild)}function JN(e){return e.querySelector("[data-hf-root]")??e.getElementById("stage")??e.body?.firstElementChild??e.body}function QN(e,t){for(let n of new Set(e)){let r=Vf(n,t);for(let[o,i]of Object.entries(r)){let a=YN(i);a!==null&&we(n)&&n.style.setProperty(`--${o}`,KN(a))}}}function kE(e,t,n=!0){let r=e.getAttribute("data-var-src")?.trim();if(!r)return null;if(!ME.has(e.tagName.toLowerCase()))return n&&globalThis.console.warn(`[hyperframes] Ignoring data-var-src on <${e.tagName.toLowerCase()}>: variable-bound src is only allowed on ${Array.from(ME).join("/")}.`),null;let o=jN(Vf(e,t)[r]);return o===null?null:Wf(o)?o:(n&&globalThis.console.warn(`[hyperframes] Ignoring data-var-src="${r}": unsafe URL protocol.`),null)}function LE(e){return kE(e,new Map,!1)??xi(e)}function Fl(e,t){let n=new Map,r=i=>t?[...t.matches(i)?[t]:[],...t.querySelectorAll(i)]:Array.from(e.querySelectorAll(i)),o=t?null:JN(e);QN([...o?[o]:[],...r("[data-composition-id]")],n);for(let i of r("[data-var-src]")){let a=kE(i,n);a!==null&&xi(i)!==a&&i.setAttribute("src",a)}for(let i of r("[data-var-text]")){let a=i.getAttribute("data-var-text")?.trim();if(!a)continue;let l=Vf(i,n)[a];Nl(l)&&XN(i,String(l))}}var ZN=["video","audio","source","script",tn];function $f(e,t=()=>!1){let n=r=>r.nodeType===Node.ELEMENT_NODE&&(r.matches(e)||r.querySelector(e)!==null||t(r));return r=>r.some(o=>o.type==="attributes"||Array.from(o.addedNodes).some(n)||Array.from(o.removedNodes).some(n))}var NE=e=>$f([...ZN,...e.map(t=>`[${t}]`)].join(","));var eF=3e3,ln=new Map,tF="data-hf-color-grading-canvas",nF="__hf_color_grading_canvas__";function qE(){if(typeof MutationObserver>"u"||typeof document>"u")return;let e=document.documentElement;if(!e)return;let t=r=>{we(r)&&(r.hasAttribute(br)||r.setAttribute(br,r.style.opacity))},n=r=>{if(Oe(r)){r.matches("video, img")&&t(r);for(let o of r.querySelectorAll("video, img"))t(o)}};n(e),new MutationObserver(r=>{for(let o of r)for(let i of o.addedNodes)n(i)}).observe(e,{childList:!0,subtree:!0})}var rF=16,oF=4,Ar={enabled:!1,position:.5,softness:0,lineWidth:2},qf=["#000000","#ffffff"],iF=["#1a1a1a","#f5f5dc"],Qi=3,aF=Qi-1,sF=5,Sr=`${Wt}.0`,FE=`${Wt-1}.0`,PE=`${Qi}.0`,lF=`${(aF+.5)/Qi}`;function zi(e){let t=e.getAttribute(nl);return t==null?null:jy(t,Ll(e))}var uF=["attribute vec2 a_pos;","varying vec2 v_uv;","void main(){"," v_uv = a_pos * 0.5 + 0.5;"," gl_Position = vec4(a_pos, 0.0, 1.0);","}"].join(`
|
|
365
365
|
`),zE=["#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 sampler2D u_bloomSource;","uniform sampler2D u_kuwaharaSource;","uniform sampler2D u_lut;","uniform sampler2D u_advanced;","uniform vec2 u_resolution;","uniform vec2 u_uvScale;","uniform vec2 u_uvOffset;","uniform float u_blurReady;","uniform float u_bloomReady;","uniform float u_kuwaharaReady;","uniform float u_lutEnabled;","uniform float u_lutSize;","uniform vec2 u_lutTextureSize;","uniform vec3 u_lutDomainMin;","uniform vec3 u_lutDomainMax;","uniform float u_lutIntensity;","uniform vec3 u_shadowWheel;","uniform vec3 u_midtoneWheel;","uniform vec3 u_highlightWheel;","uniform float u_rgbCurvesEnabled;","uniform float u_hueCurvesEnabled;","uniform float u_secondaryCount;","uniform float u_exposure;","uniform float u_contrast;","uniform float u_highlights;","uniform float u_shadows;","uniform float u_whites;","uniform float u_blacks;","uniform float u_temperature;","uniform float u_tint;","uniform float u_vibrance;","uniform float u_saturation;","uniform float u_vignette;","uniform float u_vignetteMidpoint;","uniform float u_vignetteRoundness;","uniform float u_vignetteFeather;","uniform float u_grain;","uniform float u_grainSize;","uniform float u_grainRoughness;","uniform float u_grainSeed;","uniform float u_effectTime;","uniform float u_blur;","uniform float u_bloom;","uniform float u_kuwahara;","uniform float u_pixelate;","uniform float u_chromaBleed;","uniform float u_tapeDamage;","uniform float u_tapeTracking;","uniform float u_tapeNoise;","uniform float u_tapeSpeed;","uniform float u_filmArtifacts;","uniform float u_halftone;","uniform float u_halftoneSize;","uniform float u_twoInkPrint;","uniform float u_twoInkPrintSize;","uniform float u_ascii;","uniform float u_asciiSize;","uniform float u_asciiInvert;","uniform float u_asciiStyle;","uniform float u_asciiColor;","uniform float u_asciiRotation;","uniform float u_dither;","uniform float u_ditherSize;","uniform float u_monoScreen;","uniform float u_monoScreenSize;","uniform float u_monoScreenAngle;","uniform float u_monoScreenSpread;","uniform float u_monoScreenShape;","uniform float u_monoScreenInvert;","uniform float u_scanlines;","uniform float u_scanlineCount;","uniform float u_scanlineSoftness;","uniform float u_chromaticAberration;","uniform float u_chromaticAngle;","uniform float u_crtCurvature;","uniform float u_digitalGlitch;","uniform float u_digitalGlitchColorSplit;","uniform float u_digitalGlitchLineTear;","uniform float u_digitalGlitchPixelate;","uniform float u_digitalGlitchBlockAmount;","uniform float u_digitalGlitchBlockDisplacement;","uniform float u_digitalGlitchBlockOpacity;","uniform float u_digitalGlitchSpeed;","uniform float u_engraving;","uniform float u_engravingSpacing;","uniform float u_engravingMinThickness;","uniform float u_engravingMaxThickness;","uniform float u_engravingAngle;","uniform float u_engravingContrast;","uniform float u_engravingSharpness;","uniform float u_engravingWave;","uniform float u_engravingWaveFrequency;","uniform float u_crosshatch;","uniform float u_crosshatchSpacing;","uniform float u_crosshatchThickness;","uniform float u_crosshatchAngle;","uniform float u_crosshatchContrast;","uniform float u_crosshatchEdges;","uniform float u_crosshatchLineWeight;","uniform float u_crosshatchWave;","uniform float u_crosshatchWaveFrequency;","uniform float u_paletteSize;","uniform vec3 u_palette0;","uniform vec3 u_palette1;","uniform vec3 u_palette2;","uniform vec3 u_palette3;","uniform vec3 u_palette4;","uniform vec3 u_palette5;","uniform float u_intensity;","uniform float u_compareEnabled;","uniform float u_comparePosition;","uniform float u_compareSoftness;","uniform float u_compareLineWidth;","const float PI = 3.14159265359;","float lumaOf(vec3 c){ return dot(c, vec3(0.2126, 0.7152, 0.0722)); }","float bt601Luma(vec3 c){ return dot(c, vec3(0.299, 0.587, 0.114)); }","float grainHash(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123); }","float digitalHash(vec2 p){"," vec2 q = mod(floor(p), 251.0);"," float x = mod(q.x * q.x * 157.0 + q.x * 89.0, 251.0);"," float y = mod(q.y * q.y * 113.0 + q.y * 47.0, 251.0);"," float xy = mod(q.x * q.y * 71.0, 251.0);"," return mod(x + y + xy + 19.0, 251.0) / 251.0;","}","float colorSaturation(vec3 c){ return max(max(c.r, c.g), c.b) - min(min(c.r, c.g), c.b); }","vec2 clampUv(vec2 uv){ return clamp(uv, vec2(0.0), vec2(1.0)); }","vec2 applyCrtWarp(vec2 uv){"," vec2 centered = uv * 2.0 - 1.0;"," float curvature = clamp(u_crtCurvature, 0.0, 1.0) * 0.5;"," float dist = dot(centered, centered);"," centered *= 1.0 + curvature * dist;"," return centered * 0.5 + 0.5;","}","vec4 sampleSource(vec2 uv){ return texture2D(u_source, clampUv(uv)); }","vec4 sampleBlur(vec2 uv){ return texture2D(u_blurSource, clampUv(uv)); }","vec3 sampleBloom(vec2 uv){ return texture2D(u_bloomSource, clampUv(uv)).rgb; }","vec3 sampleKuwahara(vec2 uv){"," vec2 displayUv = uv * u_uvScale + u_uvOffset;"," return texture2D(u_kuwaharaSource, clampUv(displayUv)).rgb;","}","vec4 samplePrepared(vec2 uv){"," vec4 base = sampleSource(uv);","#ifdef HF_STAGE_BLUR"," float blur = clamp(u_blur, 0.0, 1.0);"," if (blur > 0.0 && u_blurReady > 0.5) base = mix(base, sampleBlur(uv), blur);","#endif","#ifdef HF_STAGE_KUWAHARA"," float kuwahara = clamp(u_kuwahara, 0.0, 1.0);"," if (kuwahara > 0.0 && u_kuwaharaReady > 0.5) {"," base.rgb = mix(base.rgb, sampleKuwahara(uv), kuwahara);"," }","#endif"," return base;","}","float tapeTrackingBand(float y, float center, float width){"," float offset = fract(y - center + 0.5) - 0.5;"," float triangle = max(0.0, 1.0 - abs(offset) / max(width, 0.0001));"," return triangle * triangle * (3.0 - 2.0 * triangle);","}","vec4 sampleMedia(vec2 uv){"," float pixel = clamp(u_pixelate, 0.0, 1.0);"," vec2 sampleUv = uv;","#ifdef HF_STAGE_PIXELATE"," if (pixel > 0.0) {"," float blockSize = mix(1.0, 48.0, pixel);"," vec2 cells = max(u_resolution / blockSize, vec2(1.0));"," sampleUv = (floor(clamp(uv, vec2(0.0), vec2(0.999999)) * cells) + 0.5) / cells;"," }","#endif","#ifdef HF_STAGE_TAPE"," float tapeDamage = clamp(u_tapeDamage, 0.0, 1.0);"," float tapeTracking = clamp(u_tapeTracking, 0.0, 1.0);"," float tapeNoise = clamp(u_tapeNoise, 0.0, 1.0);"," float tapeTime = u_effectTime * mix(0.0, 2.0, clamp(u_tapeSpeed, 0.0, 1.0));"," float tapeFrame = floor(tapeTime * 60.0);"," float tapeLine = floor(sampleUv.y * u_resolution.y * 0.5);"," float lineJitter = (digitalHash(vec2(tapeLine, floor(tapeFrame * 0.5))) - 0.5) * 1.8 * tapeNoise;"," float slowWobble = sin(sampleUv.y * 32.0 + tapeTime * 2.6) * 0.55;"," float headSwitch = smoothstep(0.88, 1.0, sampleUv.y) * sin(sampleUv.y * 240.0 + tapeTime * 8.0) * 4.0;"," float trackingShift = tapeTrackingBand(sampleUv.y, fract(0.08 + tapeTime * 0.083), 0.035);"," trackingShift -= tapeTrackingBand(sampleUv.y, fract(0.28 + tapeTime * 0.061), 0.03) * 0.8;"," trackingShift += tapeTrackingBand(sampleUv.y, fract(0.5 + tapeTime * 0.047), 0.04) * 0.75;"," trackingShift -= tapeTrackingBand(sampleUv.y, fract(0.72 + tapeTime * 0.037), 0.028) * 0.65;"," trackingShift += tapeTrackingBand(sampleUv.y, fract(0.89 + tapeTime * 0.029), 0.032) * 0.55;"," trackingShift *= tapeTracking * 48.0;"," float tapeShift = (lineJitter + slowWobble + headSwitch + trackingShift) * tapeDamage;","#endif"," float texelX = 1.0 / max(u_resolution.x * max(u_uvScale.x, 0.00001), 1.0);","#ifdef HF_STAGE_TAPE"," vec2 tapeUv = sampleUv + vec2(tapeShift * texelX, 0.0);","#else"," vec2 tapeUv = sampleUv;","#endif"," vec4 base = samplePrepared(tapeUv);","#ifdef HF_STAGE_TAPE"," if (tapeDamage > 0.0) {"," vec2 lumaStep = vec2(texelX * mix(1.0, 3.5, tapeDamage), 0.0);"," vec3 leftTape = samplePrepared(tapeUv - lumaStep).rgb;"," vec3 rightTape = samplePrepared(tapeUv + lumaStep).rgb;"," float tapeLuma = (bt601Luma(leftTape) + bt601Luma(base.rgb) * 2.0 + bt601Luma(rightTape)) * 0.25;"," vec3 centerChroma = base.rgb - vec3(bt601Luma(base.rgb));"," vec3 tapeColor = vec3(tapeLuma) + centerChroma;"," vec3 ghost = samplePrepared(tapeUv - vec2(texelX * 12.0, 0.0)).rgb;"," tapeColor = mix(tapeColor, ghost, 0.045 * tapeDamage);"," float fineNoise = digitalHash(floor(gl_FragCoord.xy) + vec2(tapeFrame * 17.0, tapeFrame * 3.0)) - 0.5;"," float band = digitalHash(vec2(floor(sampleUv.y * 92.0), floor(tapeFrame / 3.0)));"," float dropout = smoothstep(0.985, 1.0, band) * (digitalHash(vec2(floor(sampleUv.x * 18.0), tapeLine)) - 0.5);"," tapeColor += (fineNoise * 0.035 + dropout * 0.12) * tapeDamage * tapeNoise;"," base.rgb = mix(base.rgb, clamp(tapeColor, 0.0, 1.0), tapeDamage);"," }","#endif","#ifdef HF_STAGE_CHROMA_BLEED"," float chromaBleed = clamp(u_chromaBleed, 0.0, 1.0);"," if (chromaBleed > 0.0) {"," float radius = mix(1.0, 4.0, chromaBleed);"," vec2 stepUv = vec2(texelX * radius, 0.0);"," vec3 c0 = base.rgb;"," vec3 c1 = samplePrepared(tapeUv - stepUv).rgb;"," vec3 c2 = samplePrepared(tapeUv + stepUv).rgb;"," vec3 c3 = samplePrepared(tapeUv - stepUv * 2.0).rgb;"," vec3 c4 = samplePrepared(tapeUv + stepUv * 2.0).rgb;"," float centerLuma = lumaOf(base.rgb);"," vec3 blurredChroma = ((c0 - vec3(lumaOf(c0))) * 6.0 + (c1 - vec3(lumaOf(c1))) * 4.0 + (c2 - vec3(lumaOf(c2))) * 4.0 + (c3 - vec3(lumaOf(c3))) + (c4 - vec3(lumaOf(c4)))) / 16.0;"," base.rgb = mix(base.rgb, clamp(vec3(centerLuma) + blurredChroma, 0.0, 1.0), chromaBleed);"," }","#endif"," return base;","}","#ifdef HF_STAGE_CHROMATIC","vec4 sampleChromaticMedia(vec2 uv, vec4 center){"," float amount = clamp(u_chromaticAberration, 0.0, 1.0);"," if (amount <= 0.0) return center;"," float angle = clamp(u_chromaticAngle, 0.0, 1.0) * PI * 2.0;"," vec2 offset = vec2(cos(angle), sin(angle)) * amount * 0.02;"," vec4 positive = sampleMedia(uv + offset);"," vec4 negative = sampleMedia(uv - offset);"," vec3 split = vec3(positive.r, center.g, negative.b);"," return vec4(split, center.a);","}","#else","vec4 sampleChromaticMedia(vec2 uv, vec4 center){ return center; }","#endif","vec3 sampleDigitalSplit(vec2 uv, vec2 block, float time, float amount){"," float split = amount * 0.06;"," float direction = digitalHash(block * 0.4 + vec2(floor(time * 3.7), floor(time * 5.3)));"," vec2 axis = direction > 0.66 ? vec2(1.0, 0.0) : direction > 0.33 ? vec2(0.0, 1.0) : vec2(0.7071);"," vec4 center = sampleMedia(uv);"," return vec3(sampleMedia(uv + axis * split).r, center.g, sampleMedia(uv - axis * split).b);","}","#ifdef HF_STAGE_GLITCH","vec3 applyDigitalGlitch(vec2 uv, vec3 source){"," float amount = clamp(u_digitalGlitch, 0.0, 1.0);"," if (amount <= 0.0) return source;"," float colorSplit = clamp(u_digitalGlitchColorSplit, 0.0, 1.0) * 2.0;"," float lineTear = clamp(u_digitalGlitchLineTear, 0.0, 1.0) * 2.0;"," float pixelate = clamp(u_digitalGlitchPixelate, 0.0, 1.0) * 2.0;"," float blockAmount = clamp(u_digitalGlitchBlockAmount, 0.0, 1.0);"," float blockDisplacement = clamp(u_digitalGlitchBlockDisplacement, 0.0, 1.0) * 2.0;"," float blockOpacity = clamp(u_digitalGlitchBlockOpacity, 0.0, 1.0);"," float speed = clamp(u_digitalGlitchSpeed, 0.0, 1.0) * 2.0;"," float time = u_effectTime * speed;"," float blockCount = 8.0 + blockAmount * 60.0;"," vec2 block = floor(uv * blockCount);"," float randomA = digitalHash(block + vec2(floor(time * 7.3), floor(time * 11.1)));"," float randomB = digitalHash(block * 0.7 + vec2(17.3 + floor(time * 6.6), 29.1));"," float randomC = digitalHash(block + vec2(floor(time * 5.7) * 13.0, 41.0));"," float randomD = digitalHash(block * 1.3 + vec2(7.0, floor(time * 3.2) * 7.0));"," vec2 displaced = uv;"," if (blockDisplacement > 0.0 && blockOpacity > 0.0) {"," float threshold = 1.0 - blockDisplacement * 0.4;"," if (randomA > threshold) {"," displaced += vec2((randomB - 0.5) * blockDisplacement * 0.5, (randomC - 0.5) * blockDisplacement * 0.3);"," }"," if (randomD > 0.92 && blockDisplacement > 0.5) {"," displaced.x += (digitalHash(vec2(block.y, floor(time * 8.0))) - 0.5) * blockDisplacement;"," }"," displaced = mix(uv, displaced, blockOpacity);"," }"," if (lineTear > 0.0) {"," float row = floor(uv.y * (50.0 + lineTear * 150.0));"," float tearA = digitalHash(vec2(row * 7.3 + floor(time * 12.0 + row * 0.1) * 3.7, 13.0));"," float tearB = digitalHash(vec2(row * 13.7 + floor(time * 8.3) * 5.1, 31.0));"," if (tearA > 1.0 - lineTear * 0.5) displaced.x += (tearB - 0.5) * lineTear * 0.4;"," if (tearB > 0.95 && lineTear > 0.3) displaced.x += (tearA - 0.5) * lineTear * 0.8;"," }"," if (pixelate > 0.0) {"," float pixelRandom = digitalHash(block * 0.5 + vec2(floor(time * 4.9), 53.0));"," if (pixelRandom > 1.0 - pixelate * 0.35) {"," float cells = 4.0 + (1.0 - pixelRandom) * pixelate * 40.0;"," displaced = (floor(clampUv(displaced) * cells) + 0.5) / cells;"," }"," }"," displaced = clampUv(displaced);"," vec3 glitch = sampleDigitalSplit(displaced, block, time, colorSplit);"," if (blockDisplacement > 0.2 && blockOpacity > 0.0) {"," float corruption = digitalHash(block * 1.1 + vec2(floor(time * 11.9), 67.0));"," vec3 changed = glitch;"," if (corruption > 0.9) changed = 1.0 - glitch;"," else if (corruption > 0.85) changed = corruption > 0.875 ? glitch.gbr : glitch.brg;"," else if (corruption > 0.8) {"," float channel = digitalHash(block + vec2(73.0));"," if (channel > 0.66) changed.r = min(changed.r * 2.0, 1.0);"," else if (channel > 0.33) changed.g = min(changed.g * 2.0, 1.0);"," else changed.b = min(changed.b * 2.0, 1.0);"," }"," glitch = mix(glitch, changed, blockOpacity);"," }"," if (blockOpacity > 0.0) {"," float flash = digitalHash(block * 0.8 + vec2(floor(time * 14.7), 83.0));"," vec3 flashed = flash > 0.97 ? min(glitch * 1.8, vec3(1.0)) : flash > 0.94 ? glitch * 0.3 : glitch;"," glitch = mix(glitch, flashed, blockOpacity * 0.6);"," }"," if (lineTear > 0.1) {"," float interference = pow(sin(uv.y * (300.0 + randomA * 200.0) + time * 30.0) * 0.5 + 0.5, 6.0);"," glitch -= interference * 0.08 * lineTear;"," }"," return mix(source, clamp(glitch, 0.0, 1.0), amount);","}","#else","vec3 applyDigitalGlitch(vec2 uv, vec3 source){ return source; }","#endif","float dustMask(vec2 uv, float frameBucket){"," vec2 grid = vec2(128.0, 72.0);"," vec2 cell = floor(uv * grid);"," vec2 local = fract(uv * grid) - 0.5;"," float chance = grainHash(cell + frameBucket * 19.13);"," float radius = mix(0.05, 0.34, grainHash(cell + 7.1));"," return step(0.9975, chance) * (1.0 - smoothstep(radius, radius + 0.08, length(local)));","}","float screenDot(vec2 p, float ink, float angle, float sharpness){"," float c = cos(angle);"," float s = sin(angle);"," vec2 q = mat2(c, -s, s, c) * p;"," vec2 d = fract(q) - 0.5;"," float radius = sqrt(clamp(ink, 0.0, 1.0)) * 0.68;"," float edge = mix(0.16, 0.025, sharpness);"," return 1.0 - smoothstep(radius - edge, radius + edge, length(d));","}","vec3 paletteColor(float index);","float monoScreenMask(vec2 local, float radius, float shape, float softness){"," vec2 centered = local - 0.5;"," float distanceToInk = length(centered);"," if (shape > 0.5 && shape < 1.5) distanceToInk = max(abs(centered.x), abs(centered.y));"," if (shape > 1.5 && shape < 2.5) distanceToInk = abs(centered.x) + abs(centered.y);"," if (shape > 2.5 && shape < 3.5) distanceToInk = max(abs(centered.x) * 0.86 + centered.y * 0.5, -centered.y);"," if (shape > 3.5) distanceToInk = abs(centered.y);"," float shapeRadius = shape > 3.5 ? radius * 0.45 : radius;"," return 1.0 - smoothstep(shapeRadius, shapeRadius + softness, distanceToInk);","}","#ifdef HF_STAGE_MONO_SCREEN","vec3 applyMonoScreen(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float invert = step(0.5, u_monoScreenInvert);"," float coverage = mix(1.0 - lumaOf(source), lumaOf(source), invert);"," coverage = pow(clamp(coverage, 0.0, 1.0), mix(1.7, 0.58, clamp(u_monoScreenSpread, 0.0, 1.0)));"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float cellPx = mix(4.0, 18.0, clamp(u_monoScreenSize, 0.0, 1.0)) * scale;"," float angle = clamp(u_monoScreenAngle, 0.0, 1.0) * PI * 0.5;"," float cosine = cos(angle);"," float sine = sin(angle);"," vec2 point = mat2(cosine, -sine, sine, cosine) * gl_FragCoord.xy / max(cellPx, 1.0);"," float radius = sqrt(coverage) * 0.68;"," float inkMask = monoScreenMask(fract(point), radius, floor(u_monoScreenShape + 0.5), 0.035);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," return mix(source, mix(paper, ink, inkMask), amount);","}","#else","vec3 applyMonoScreen(vec3 source, float amount){ return source; }","#endif","#ifdef HF_STAGE_ENGRAVING","vec3 applyEngraving(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float spacing = mix(3.0, 20.0, clamp(u_engravingSpacing, 0.0, 1.0));"," float minThickness = mix(0.0, 2.0, clamp(u_engravingMinThickness, 0.0, 1.0));"," float maxThickness = mix(1.0, 8.0, clamp(u_engravingMaxThickness, 0.0, 1.0));"," float angle = clamp(u_engravingAngle, 0.0, 1.0) * PI;"," vec2 alongAxis = vec2(cos(angle), sin(angle));"," vec2 acrossAxis = vec2(-alongAxis.y, alongAxis.x);"," float along = dot(gl_FragCoord.xy, alongAxis);"," float across = dot(gl_FragCoord.xy, acrossAxis);"," float frequency = mix(1.0, 10.0, clamp(u_engravingWaveFrequency, 0.0, 1.0));"," float wave = sin(along * frequency * 0.01);"," across += wave * clamp(u_engravingWave, 0.0, 1.0) * 3.0;"," float lineIndex = floor(across / max(spacing, 1.0));"," float lineDistance = abs(fract(across / max(spacing, 1.0)) - 0.5) * spacing;"," float contrast = mix(0.5, 2.0, clamp(u_engravingContrast, 0.0, 1.0));"," float darkness = 1.0 - pow(clamp(lumaOf(source), 0.0, 1.0), contrast);"," float variation = mix(0.88, 1.12, digitalHash(vec2(lineIndex, 73.0)));"," float thickness = mix(minThickness, maxThickness, darkness) * variation;"," float edge = mix(1.0, 0.3, clamp(u_engravingSharpness, 0.0, 1.0));"," float inkMask = 1.0 - smoothstep(max(thickness * 0.5 - edge, 0.0), thickness * 0.5 + edge, lineDistance);"," inkMask *= smoothstep(0.015, 0.12, darkness);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," return mix(source, mix(paper, ink, inkMask), amount);","}","#else","vec3 applyEngraving(vec3 source, float amount){ return source; }","#endif","float crosshatchLine(vec2 pixel, float angle, float spacing, float thickness, float seed){"," vec2 alongAxis = vec2(cos(angle), sin(angle));"," vec2 acrossAxis = vec2(-alongAxis.y, alongAxis.x);"," float along = dot(pixel, alongAxis);"," float across = dot(pixel, acrossAxis);"," float frequency = mix(1.0, 10.0, clamp(u_crosshatchWaveFrequency, 0.0, 1.0));"," across += sin(along * frequency * 0.02 + u_effectTime + seed) * clamp(u_crosshatchWave, 0.0, 1.0) * 5.0;"," float lineIndex = floor(across / max(spacing, 1.0));"," float distanceToLine = abs(fract(across / max(spacing, 1.0)) - 0.5) * spacing;"," float variation = mix(1.0, 0.5 + digitalHash(vec2(lineIndex, seed)), clamp(u_crosshatchLineWeight, 0.0, 1.0));"," float halfWidth = thickness * variation * 0.5;"," return 1.0 - smoothstep(max(halfWidth - 0.5, 0.0), halfWidth + 0.5, distanceToLine);","}","float crosshatchEdge(vec2 uv){"," vec2 texel = 1.0 / max(u_resolution * u_uvScale, vec2(1.0));"," float tl = lumaOf(sampleMedia(uv + texel * vec2(-1.0, -1.0)).rgb);"," float tc = lumaOf(sampleMedia(uv + texel * vec2( 0.0, -1.0)).rgb);"," float tr = lumaOf(sampleMedia(uv + texel * vec2( 1.0, -1.0)).rgb);"," float ml = lumaOf(sampleMedia(uv + texel * vec2(-1.0, 0.0)).rgb);"," float mr = lumaOf(sampleMedia(uv + texel * vec2( 1.0, 0.0)).rgb);"," float bl = lumaOf(sampleMedia(uv + texel * vec2(-1.0, 1.0)).rgb);"," float bc = lumaOf(sampleMedia(uv + texel * vec2( 0.0, 1.0)).rgb);"," float br = lumaOf(sampleMedia(uv + texel * vec2( 1.0, 1.0)).rgb);"," float gx = -tl - 2.0 * ml - bl + tr + 2.0 * mr + br;"," float gy = -tl - 2.0 * tc - tr + bl + 2.0 * bc + br;"," return length(vec2(gx, gy));","}","#ifdef HF_STAGE_CROSSHATCH","vec3 applyCrosshatch(vec2 uv, vec3 source, float amount){"," if (amount <= 0.0) return source;"," float spacing = mix(5.0, 30.0, clamp(u_crosshatchSpacing, 0.0, 1.0));"," float thickness = mix(1.0, 5.0, clamp(u_crosshatchThickness, 0.0, 1.0));"," float baseAngle = -clamp(u_crosshatchAngle, 0.0, 1.0) * PI;"," float contrast = mix(0.5, 2.0, clamp(u_crosshatchContrast, 0.0, 1.0));"," float darkness = 1.0 - pow(clamp(lumaOf(source), 0.0, 1.0), contrast);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," vec3 result = paper;"," float layer = crosshatchLine(gl_FragCoord.xy, baseAngle, spacing, thickness, 1.0) * smoothstep(0.2, 0.4, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle + PI * 0.5, spacing * 0.95, thickness * 0.9, 2.0) * smoothstep(0.4, 0.6, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle + PI * 0.25, spacing * 0.9, thickness * 0.8, 3.0) * smoothstep(0.6, 0.8, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle - PI * 0.25, spacing * 0.85, thickness * 0.7, 4.0) * smoothstep(0.75, 0.9, darkness);"," result = mix(result, ink, layer);"," result = mix(result, ink, smoothstep(0.9, 1.0, darkness) * 0.8);"," float edgeStrength = mix(0.0, 2.0, clamp(u_crosshatchEdges, 0.0, 1.0));"," float edge = smoothstep(0.1, 0.3, crosshatchEdge(uv)) * edgeStrength;"," result = mix(result, ink, clamp(edge, 0.0, 1.0));"," return mix(source, result, amount);","}","#else","vec3 applyCrosshatch(vec2 uv, vec3 source, float amount){ return source; }","#endif","#ifdef HF_STAGE_HALFTONE","vec3 applyHalftone(vec3 source, float amount){"," if (amount <= 0.0) return source;"," vec3 cmy = 1.0 - source;"," float k = min(cmy.r, min(cmy.g, cmy.b));"," vec3 inks = max(cmy - vec3(k * 0.72), 0.0);"," float scale = min(u_resolution.x, u_resolution.y) / 540.0;"," float cellPx = mix(5.0, 14.0, clamp(u_halftoneSize, 0.0, 1.0)) * max(scale, 0.25);"," vec2 p = gl_FragCoord.xy / max(cellPx, 1.0);"," float cyan = screenDot(p, inks.r, 0.261799, 0.78);"," float magenta = screenDot(p, inks.g, 1.308997, 0.78);"," float yellow = screenDot(p, inks.b, 0.0, 0.78);"," float blackInk = screenDot(p, k, 0.785398, 0.82);"," vec3 printColor = vec3(0.975, 0.962, 0.925);"," printColor *= mix(vec3(1.0), vec3(0.05, 0.79, 0.86), cyan);"," printColor *= mix(vec3(1.0), vec3(0.91, 0.08, 0.48), magenta);"," printColor *= mix(vec3(1.0), vec3(0.98, 0.83, 0.08), yellow);"," printColor *= mix(vec3(1.0), vec3(0.035), blackInk * 0.92);"," return mix(source, printColor, amount);","}","#else","vec3 applyHalftone(vec3 source, float amount){ return source; }","#endif","#ifdef HF_STAGE_TWO_INK_PRINT","vec3 applyTwoInkPrint(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float sourceLuma = lumaOf(source);"," float darkness = 1.0 - sourceLuma;"," float warmBias = clamp(source.r - (source.g + source.b) * 0.5, -0.35, 0.35);"," float coolBias = clamp((source.g + source.b) * 0.5 - source.r, -0.35, 0.35);"," float redTone = smoothstep(0.08, 0.72, darkness) * (1.0 - 0.68 * smoothstep(0.66, 1.0, darkness));"," float tealTone = smoothstep(0.30, 0.92, darkness);"," float redCoverage = clamp(redTone + warmBias * 1.35 - coolBias * 0.35, 0.0, 1.0);"," float tealCoverage = clamp(tealTone + coolBias * 1.1 - warmBias * 0.45, 0.0, 1.0);"," float scale = min(u_resolution.x, u_resolution.y) / 540.0;"," float cellPx = mix(4.5, 12.0, clamp(u_twoInkPrintSize, 0.0, 1.0)) * max(scale, 0.25);"," vec2 p = gl_FragCoord.xy / max(cellPx, 1.0);"," float redDot = screenDot(p, redCoverage, 0.261799, 0.84);"," float tealDot = screenDot(p + vec2(0.12, -0.08), tealCoverage, 1.308997, 0.84);"," float paperNoise = grainHash(floor(gl_FragCoord.xy * 0.5)) - 0.5;"," vec3 paper = vec3(0.955, 0.910, 0.795) + paperNoise * 0.018;"," vec3 vermilion = vec3(0.88, 0.13, 0.075);"," vec3 teal = vec3(0.035, 0.285, 0.355);"," vec3 overprint = vec3(0.045, 0.055, 0.052);"," vec3 printColor = paper * (1.0 - redDot) * (1.0 - tealDot);"," printColor += vermilion * redDot * (1.0 - tealDot);"," printColor += teal * (1.0 - redDot) * tealDot;"," printColor += overprint * redDot * tealDot;"," return mix(source, clamp(printColor, 0.0, 1.0), amount);","}","#else","vec3 applyTwoInkPrint(vec3 source, float amount){ return source; }","#endif","vec3 paletteColor(float index){"," if (index < 0.5) return u_palette0;"," if (index < 1.5) return u_palette1;"," if (index < 2.5) return u_palette2;"," if (index < 3.5) return u_palette3;"," if (index < 4.5) return u_palette4;"," return u_palette5;","}","float bayer4(vec2 point){"," vec2 cell = mod(floor(point), 4.0);"," if (cell.y < 0.5) {"," if (cell.x < 0.5) return 0.5 / 16.0;"," if (cell.x < 1.5) return 8.5 / 16.0;"," if (cell.x < 2.5) return 2.5 / 16.0;"," return 10.5 / 16.0;"," }"," if (cell.y < 1.5) {"," if (cell.x < 0.5) return 12.5 / 16.0;"," if (cell.x < 1.5) return 4.5 / 16.0;"," if (cell.x < 2.5) return 14.5 / 16.0;"," return 6.5 / 16.0;"," }"," if (cell.y < 2.5) {"," if (cell.x < 0.5) return 3.5 / 16.0;"," if (cell.x < 1.5) return 11.5 / 16.0;"," if (cell.x < 2.5) return 1.5 / 16.0;"," return 9.5 / 16.0;"," }"," if (cell.x < 0.5) return 15.5 / 16.0;"," if (cell.x < 1.5) return 7.5 / 16.0;"," if (cell.x < 2.5) return 13.5 / 16.0;"," return 5.5 / 16.0;","}","float standardAsciiSample(float brightness, vec2 grid){"," if (brightness < 0.1) return 0.0;"," if (brightness < 0.2) return grid.x == 2.0 && grid.y == 5.0 ? 1.0 : 0.0;"," if (brightness < 0.3) return grid.x == 2.0 && (grid.y == 2.0 || grid.y == 4.0) ? 1.0 : 0.0;"," if (brightness < 0.4) return (grid.y == 2.0 || grid.y == 4.0) && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.5) {"," bool cross = (grid.x == 2.0 && grid.y >= 2.0 && grid.y <= 4.0) || (grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0);"," bool diagonals = (grid.x == 1.0 || grid.x == 3.0) && (grid.y == 2.0 || grid.y == 4.0);"," return cross || diagonals ? 1.0 : 0.0;"," }"," if (brightness < 0.6) {"," bool ring = ((grid.y == 2.0 || grid.y == 4.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 1.0 || grid.x == 3.0) && grid.y == 3.0);"," return ring ? 1.0 : 0.0;"," }"," bool outline = ((grid.y == 1.0 || grid.y == 5.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 0.0 || grid.x == 4.0) && grid.y >= 2.0 && grid.y <= 4.0) || ((grid.x == 1.0 || grid.x == 3.0) && grid.y >= 1.0 && grid.y <= 5.0);"," if (brightness < 0.7) return outline ? 1.0 : 0.0;"," if (brightness < 0.8) {"," bool slash = abs(grid.x - 2.0) == abs(grid.y - 3.0) && grid.x >= 1.0 && grid.x <= 3.0;"," return outline || slash ? 1.0 : 0.0;"," }"," if (brightness < 0.9) {"," bool loops = ((grid.y == 1.0 || grid.y == 3.0 || grid.y == 5.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 1.0 || grid.x == 3.0) && (grid.y == 2.0 || grid.y == 4.0));"," return loops ? 1.0 : 0.0;"," }"," return 1.0;","}","float asciiStyleSample(float style, float brightness, vec2 uv){"," vec2 grid = floor(uv * vec2(5.0, 7.0));"," if (style < 0.5) return standardAsciiSample(brightness, grid);"," if (style < 1.5) {"," float checker = mod(grid.x + grid.y, 2.0);"," float ruled = mod(grid.x, 2.0) == 0.0 || mod(grid.y, 2.0) == 0.0 ? 1.0 : 0.0;"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return checker == 0.0 ? 0.5 : 0.0;"," if (brightness < 0.375) return ruled * 0.6;"," if (brightness < 0.5) return checker == 0.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return ruled > 0.5 ? 1.0 : 0.3;"," if (brightness < 0.75) return checker == 0.0 ? 1.0 : 0.7;"," if (brightness < 0.875) return ruled > 0.5 ? 1.0 : 0.85;"," return 1.0;"," }"," if (style < 2.5) {"," if (brightness < 0.14) return 0.0;"," if (brightness < 0.28) return grid.x == 2.0 && grid.y == 1.0 ? 1.0 : 0.0;"," if (brightness < 0.42) return grid.x == 2.0 && grid.y == 5.0 ? 1.0 : 0.0;"," if (brightness < 0.56) return grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.7) return (grid.x == 2.0 && grid.y >= 2.0 && grid.y <= 4.0) || (grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0) ? 1.0 : 0.0;"," if (brightness < 0.84) return abs(grid.x - 2.0) == abs(grid.y - 3.0) && grid.y >= 2.0 && grid.y <= 4.0 ? 1.0 : 0.0;"," return grid.x == 1.0 || grid.x == 3.0 || grid.y == 2.0 || grid.y == 4.0 ? 1.0 : 0.0;"," }"," if (style < 3.5) return grid.y >= 6.0 - brightness * 7.0 ? 1.0 : 0.0;"," if (style < 4.5) {"," vec2 dots = floor(uv * vec2(2.0, 4.0));"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return dots.y == 3.0 ? 1.0 : 0.0;"," if (brightness < 0.375) return dots.y >= 2.0 ? 1.0 : 0.0;"," if (brightness < 0.5) return dots.y >= 1.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return dots.y >= 1.0 || dots.x == 1.0 ? 1.0 : 0.0;"," if (brightness < 0.75) return 1.0;"," if (brightness < 0.875) return mod(grid.x + grid.y, 2.0) < 1.5 ? 1.0 : 0.7;"," return 1.0;"," }"," if (style < 5.5) {"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return grid.x == 2.0 && grid.y == 3.0 ? 1.0 : 0.0;"," if (brightness < 0.375) return grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.5) return grid.x + grid.y == 5.0 || grid.x + grid.y == 6.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return grid.x == 2.0 ? 1.0 : 0.0;"," if (brightness < 0.75) return abs(grid.x - grid.y / 1.4) < 0.7 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.875) return grid.x == 2.0 || grid.y == 3.0 ? 1.0 : 0.0;"," return grid.x == 1.0 || grid.x == 3.0 || grid.y == 2.0 || grid.y == 4.0 ? 1.0 : 0.0;"," }"," if (style < 6.5) {"," bool top = grid.y == 0.0 && grid.x >= 1.0 && grid.x <= 3.0;"," bool topLeft = grid.x == 1.0 && grid.y <= 3.0;"," bool topRight = grid.x == 3.0 && grid.y <= 3.0;"," bool middle = grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0;"," bool bottomLeft = grid.x == 1.0 && grid.y >= 3.0;"," bool bottomRight = grid.x == 3.0 && grid.y >= 3.0;"," bool bottom = grid.y == 6.0 && grid.x >= 1.0 && grid.x <= 3.0;"," if (brightness < 0.1) return 0.0;"," if (brightness < 0.2) return topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.3) return top || topRight || middle || bottomLeft || bottom ? 1.0 : 0.0;"," if (brightness < 0.4) return top || topRight || middle || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.5) return topLeft || middle || topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.6) return top || topLeft || middle || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.7) return top || topLeft || middle || bottomLeft || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.8) return top || topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.9) return top || topLeft || topRight || middle || bottomLeft || bottomRight || bottom ? 1.0 : 0.0;"," return top || topLeft || topRight || middle || bottomRight || bottom ? 1.0 : 0.0;"," }"," float slash = grid.x - grid.y;"," float backslash = grid.x + grid.y;"," if (brightness < 0.16) return 0.0;"," if (brightness < 0.33) return mod(slash, 3.0) < 0.5 ? 1.0 : 0.0;"," if (brightness < 0.5) return mod(slash, 2.0) < 0.5 ? 1.0 : 0.0;"," bool diagonalA = mod(slash, 2.0) < 0.5;"," bool diagonalB = mod(backslash, 2.0) < 0.5;"," if (brightness < 0.66) return diagonalA || diagonalB ? 1.0 : 0.0;"," if (brightness < 0.83) return mod(slash, 1.5) < 0.5 || mod(backslash, 1.5) < 0.5 ? 1.0 : 0.2;"," return mod(slash, 1.0) < 0.6 || mod(backslash, 1.0) < 0.6 ? 1.0 : 0.5;","}","vec3 rgbToHsv(vec3 color){"," float maximum = max(max(color.r, color.g), color.b);"," float minimum = min(min(color.r, color.g), color.b);"," float delta = maximum - minimum;"," float hue = 0.0;"," if (delta > 0.00001) {"," if (maximum == color.r) hue = mod((color.g - color.b) / delta, 6.0);"," else if (maximum == color.g) hue = (color.b - color.r) / delta + 2.0;"," else hue = (color.r - color.g) / delta + 4.0;"," hue = fract(hue / 6.0);"," }"," return vec3(hue, maximum > 0.00001 ? delta / maximum : 0.0, maximum);","}","vec3 hsvToRgb(vec3 color){"," vec3 bands = abs(fract(color.xxx + vec3(0.0, 0.6666667, 0.3333333)) * 6.0 - 3.0);"," return color.z * mix(vec3(1.0), clamp(bands - 1.0, 0.0, 1.0), color.y);","}","vec4 sampleAdvancedCurve(float coordinate, float row){",` float position = clamp(coordinate, 0.0, 1.0) * ${FE};`," float lower = floor(position);",` float upper = min(lower + 1.0, ${FE});`,` float y = (row + 0.5) / ${PE};`,` vec4 before = texture2D(u_advanced, vec2((lower + 0.5) / ${Sr}, y));`,` vec4 after = texture2D(u_advanced, vec2((upper + 0.5) / ${Sr}, y));`," return mix(before, after, position - lower);","}","vec4 sampleHueCurve(float coordinate){",` float position = fract(coordinate) * ${Sr};`," float lower = floor(position);",` float upper = mod(lower + 1.0, ${Sr});`,` float y = 1.5 / ${PE};`,` vec4 before = texture2D(u_advanced, vec2((lower + 0.5) / ${Sr}, y));`,` vec4 after = texture2D(u_advanced, vec2((upper + 0.5) / ${Sr}, y));`," return mix(before, after, position - lower);","}","vec4 advancedConfig(float index){",` return texture2D(u_advanced, vec2((index + 0.5) / ${Sr}, ${lF}));`,"}","vec3 wheelDirection(float hue){"," vec3 direction = hsvToRgb(vec3(fract(hue), 1.0, 1.0));"," direction -= vec3(lumaOf(direction));"," return direction / max(max(max(abs(direction.r), abs(direction.g)), abs(direction.b)), 0.0001);","}","vec3 applyTonalWheels(vec3 color){"," float luma = lumaOf(color);"," float shadows = 1.0 - smoothstep(0.0, 0.6, luma);"," float highlights = smoothstep(0.4, 1.0, luma);"," float midtones = max(0.0, 1.0 - shadows - highlights);"," float total = max(shadows + midtones + highlights, 0.0001);"," vec3 weights = vec3(shadows, midtones, highlights) / total;"," color += wheelDirection(u_shadowWheel.x) * u_shadowWheel.y * weights.x * 0.18;"," color += wheelDirection(u_midtoneWheel.x) * u_midtoneWheel.y * weights.y * 0.18;"," color += wheelDirection(u_highlightWheel.x) * u_highlightWheel.y * weights.z * 0.18;"," color += u_shadowWheel.z * weights.x * 0.25;"," color += u_midtoneWheel.z * weights.y * 0.25;"," color += u_highlightWheel.z * weights.z * 0.25;"," return color;","}","#ifdef HF_STAGE_RGB_CURVES","vec3 applyRgbCurves(vec3 color){"," if (u_rgbCurvesEnabled < 0.5) return color;"," vec3 master = vec3("," sampleAdvancedCurve(color.r, 0.0).a,"," sampleAdvancedCurve(color.g, 0.0).a,"," sampleAdvancedCurve(color.b, 0.0).a"," );"," return vec3("," sampleAdvancedCurve(master.r, 0.0).r,"," sampleAdvancedCurve(master.g, 0.0).g,"," sampleAdvancedCurve(master.b, 0.0).b"," );","}","#else","vec3 applyRgbCurves(vec3 color){ return color; }","#endif","float decodeSigned(float value){ return (value * 255.0 - 128.0) / 127.0; }","#ifdef HF_STAGE_HUE_CURVES","vec3 applyHueCurves(vec3 color){"," if (u_hueCurvesEnabled < 0.5) return color;"," vec3 hsv = rgbToHsv(clamp(color, 0.0, 1.0));"," vec3 curves = sampleHueCurve(hsv.x).rgb;"," float originalLuma = lumaOf(color);"," hsv.x = fract(hsv.x + decodeSigned(curves.r) * 0.5);"," hsv.y = clamp(hsv.y * max(0.0, 1.0 + decodeSigned(curves.g)), 0.0, 1.0);"," vec3 shifted = hsvToRgb(hsv);"," shifted += vec3(originalLuma - lumaOf(shifted) + decodeSigned(curves.b));"," return shifted;","}","#else","vec3 applyHueCurves(vec3 color){ return color; }","#endif","float softRangeMask(float value, float minimum, float maximum, float softness){"," if (value < minimum) {"," if (softness <= 0.0) return 0.0;"," return smoothstep(minimum - softness, minimum, value);"," }"," if (value > maximum) {"," if (softness <= 0.0) return 0.0;"," return 1.0 - smoothstep(maximum, maximum + softness, value);"," }"," return 1.0;","}","float hueRangeMask(float hue, float saturation, vec3 key){"," float distance = abs(fract(hue - key.x + 0.5) - 0.5) * 360.0;"," float range = key.y * 180.0;"," float softness = key.z * 180.0;"," if (range < 179.999 && saturation < 0.001) return 0.0;"," if (distance <= range) return 1.0;"," if (softness <= 0.0) return 0.0;"," return 1.0 - smoothstep(range, range + softness, distance);","}","vec3 applySecondary(vec3 color, float index){"," float base = index * 5.0;"," vec4 hueKey = advancedConfig(base);"," vec4 saturationKey = advancedConfig(base + 1.0);"," vec4 lumaKey = advancedConfig(base + 2.0);"," vec4 correction = advancedConfig(base + 3.0);"," vec4 tintCorrection = advancedConfig(base + 4.0);"," vec3 hsv = rgbToHsv(clamp(color, 0.0, 1.0));"," float luma = lumaOf(color);"," float mask = hueRangeMask(hsv.x, hsv.y, hueKey.rgb);"," mask *= softRangeMask(hsv.y, saturationKey.x, saturationKey.y, saturationKey.z * 0.5);"," mask *= softRangeMask(luma, lumaKey.x, lumaKey.y, lumaKey.z * 0.5);"," if (mask <= 0.0) return color;"," hsv.x = fract(hsv.x + decodeSigned(correction.x) * 0.5);"," vec3 corrected = hsvToRgb(hsv);"," float correctedLuma = lumaOf(corrected);"," corrected = mix(vec3(correctedLuma), corrected, max(0.0, 1.0 + decodeSigned(correction.y)));"," corrected += vec3(decodeSigned(correction.z));"," float temperature = decodeSigned(correction.w);"," float tint = decodeSigned(tintCorrection.x);"," corrected.r += temperature * 0.08 + tint * 0.04;"," corrected.b -= temperature * 0.08 - tint * 0.04;"," corrected.g -= tint * 0.08;"," return mix(color, corrected, mask);","}","vec3 applyAdvancedGrade(vec3 color){"," color = applyTonalWheels(color);"," color = applyRgbCurves(color);"," color = applyHueCurves(color);","#ifdef HF_STAGE_SECONDARIES"," if (u_secondaryCount > 0.5) color = applySecondary(color, 0.0);"," if (u_secondaryCount > 1.5) color = applySecondary(color, 1.0);"," if (u_secondaryCount > 2.5) color = applySecondary(color, 2.0);"," if (u_secondaryCount > 3.5) color = applySecondary(color, 3.0);","#endif"," return color;","}","vec3 sampleLut(float r, float g, float b){"," float size = max(u_lutSize, 2.0);"," float x = (r + b * size + 0.5) / max(u_lutTextureSize.x, 1.0);"," float y = (g + 0.5) / max(u_lutTextureSize.y, 1.0);"," return texture2D(u_lut, vec2(x, y)).rgb;","}","#ifdef HF_STAGE_LUT","vec3 applyLut(vec3 color){"," if (u_lutEnabled < 0.5) return color;"," float size = max(u_lutSize, 2.0);"," vec3 span = max(u_lutDomainMax - u_lutDomainMin, vec3(0.00001));"," vec3 scaled = clamp((color - u_lutDomainMin) / span, 0.0, 1.0) * (size - 1.0);"," vec3 lo = floor(scaled);"," vec3 hi = min(lo + 1.0, vec3(size - 1.0));"," vec3 f = scaled - lo;"," vec3 c000 = sampleLut(lo.r, lo.g, lo.b);"," vec3 c100 = sampleLut(hi.r, lo.g, lo.b);"," vec3 c010 = sampleLut(lo.r, hi.g, lo.b);"," vec3 c110 = sampleLut(hi.r, hi.g, lo.b);"," vec3 c001 = sampleLut(lo.r, lo.g, hi.b);"," vec3 c101 = sampleLut(hi.r, lo.g, hi.b);"," vec3 c011 = sampleLut(lo.r, hi.g, hi.b);"," vec3 c111 = sampleLut(hi.r, hi.g, hi.b);"," vec3 c00 = mix(c000, c100, f.r);"," vec3 c10 = mix(c010, c110, f.r);"," vec3 c01 = mix(c001, c101, f.r);"," vec3 c11 = mix(c011, c111, f.r);"," vec3 c0 = mix(c00, c10, f.g);"," vec3 c1 = mix(c01, c11, f.g);"," vec3 lutColor = mix(c0, c1, f.b);"," return mix(color, lutColor, clamp(u_lutIntensity, 0.0, 1.0));","}","#else","vec3 applyLut(vec3 color){ return color; }","#endif","vec3 applyPrimaryGrade(vec3 color){"," color *= pow(2.0, u_exposure);"," float y = lumaOf(color);"," float shadowMask = 1.0 - smoothstep(0.0, 0.65, y);"," float highlightMask = smoothstep(0.35, 1.0, y);"," color += u_shadows * 0.35 * shadowMask;"," color += u_highlights * 0.35 * highlightMask;"," float blackPoint = clamp(u_blacks * 0.18, -0.18, 0.18);"," float whitePoint = clamp(1.0 - u_whites * 0.18, 0.82, 1.18);"," color = (color - blackPoint) / max(whitePoint - blackPoint, 0.2);"," color.r += u_temperature * 0.08 + u_tint * 0.04;"," color.b -= u_temperature * 0.08 - u_tint * 0.04;"," color.g -= u_tint * 0.08;"," color = (color - 0.5) * max(0.0, 1.0 + u_contrast) + 0.5;"," float satLuma = lumaOf(color);"," float currentSat = clamp(colorSaturation(color), 0.0, 1.0);"," float skinLike = smoothstep(0.02, 0.18, color.r - color.g) * smoothstep(0.0, 0.16, color.g - color.b) * smoothstep(0.18, 0.82, satLuma);"," float vibranceWeight = (1.0 - currentSat * 0.72) * mix(1.0, 0.55, skinLike);"," color = mix(vec3(satLuma), color, max(0.0, 1.0 + u_vibrance * vibranceWeight));"," color = mix(vec3(satLuma), color, max(0.0, 1.0 + u_saturation));"," return color;","}","vec3 applyColorGrade(vec3 color){"," color = applyPrimaryGrade(color);"," color = applyAdvancedGrade(color);"," return clamp(applyLut(clamp(color, 0.0, 1.0)), 0.0, 1.0);","}","#ifdef HF_STAGE_DITHER","vec3 applyDither(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float pixelSize = mix(1.0, 5.0, clamp(u_ditherSize, 0.0, 1.0)) * scale;"," vec2 block = floor(gl_FragCoord.xy / max(pixelSize, 1.0));"," float levels = clamp(u_paletteSize, 2.0, 6.0);"," float index = floor(clamp(lumaOf(source) * (levels - 1.0) + bayer4(block), 0.0, levels - 1.0));"," return mix(source, paletteColor(index), amount);","}","#else","vec3 applyDither(vec3 source, float amount){ return source; }","#endif","vec2 asciiEdgeDirection(vec2 uv, vec2 stepUv){"," float topLeft = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, -stepUv.y)).rgb);"," float top = bt601Luma(sampleMedia(uv + vec2(0.0, -stepUv.y)).rgb);"," float topRight = bt601Luma(sampleMedia(uv + vec2(stepUv.x, -stepUv.y)).rgb);"," float left = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, 0.0)).rgb);"," float right = bt601Luma(sampleMedia(uv + vec2(stepUv.x, 0.0)).rgb);"," float bottomLeft = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, stepUv.y)).rgb);"," float bottom = bt601Luma(sampleMedia(uv + vec2(0.0, stepUv.y)).rgb);"," float bottomRight = bt601Luma(sampleMedia(uv + stepUv).rgb);"," float x = -topLeft - 2.0 * left - bottomLeft + topRight + 2.0 * right + bottomRight;"," float y = -topLeft - 2.0 * top - topRight + bottomLeft + 2.0 * bottom + bottomRight;"," return vec2(x, y);","}","vec2 rotateAsciiUv(vec2 uv, float angle){"," float cosine = cos(angle);"," float sine = sin(angle);"," vec2 centered = uv - 0.5;"," return vec2(centered.x * cosine - centered.y * sine, centered.x * sine + centered.y * cosine) + 0.5;","}","#ifdef HF_STAGE_ASCII","vec3 applyAscii(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float cellHeight = mix(4.0, 80.0, clamp(u_asciiSize, 0.0, 1.0)) * scale;"," vec2 cellSize = vec2(cellHeight);"," vec2 cell = floor(gl_FragCoord.xy / cellSize);"," vec2 cellVuv = (cell + 0.5) * cellSize / max(u_resolution, vec2(1.0));"," vec2 cellUv = (cellVuv - u_uvOffset) / u_uvScale;"," cellUv = applyCrtWarp(cellUv);"," vec3 cellColor = applyColorGrade(sampleMedia(cellUv).rgb);"," float brightness = bt601Luma(cellColor);"," float invert = step(0.5, u_asciiInvert);"," brightness = mix(brightness, 1.0 - brightness, invert);"," vec2 glyphUv = fract(gl_FragCoord.xy / cellSize);"," float rotation = clamp(u_asciiRotation, 0.0, 1.0);"," if (rotation > 0.0) {"," vec2 cellStepUv = cellSize / max(u_resolution * u_uvScale, vec2(1.0));"," vec2 edge = asciiEdgeDirection(cellUv, cellStepUv);"," if (length(edge) > 0.1) glyphUv = mix(glyphUv, rotateAsciiUv(glyphUv, atan(edge.y, edge.x)), rotation);"," }"," float ink = asciiStyleSample(floor(u_asciiStyle + 0.5), brightness, glyphUv);"," vec3 background = paletteColor(0.0);"," vec3 inkColor = mix(paletteColor(max(u_paletteSize - 1.0, 1.0)), cellColor, clamp(u_asciiColor, 0.0, 1.0));"," vec3 asciiColor = mix(background, inkColor, ink);"," return mix(source, asciiColor, amount);","}","#else","vec3 applyAscii(vec3 source, float amount){ return source; }","#endif","#ifdef HF_STAGE_SCANLINES","vec3 applyScanlines(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float count = mix(50.0, 500.0, clamp(u_scanlineCount, 0.0, 1.0));"," float softness = clamp(u_scanlineSoftness, 0.0, 1.0);"," float wave = 0.5 + 0.5 * sin(v_uv.y * count * PI);"," float line = mix(1.0 - wave, pow(1.0 - wave, 2.2), softness);"," return source * (1.0 - line * amount);","}","#else","vec3 applyScanlines(vec3 source, float amount){ return source; }","#endif","void main(){"," vec2 uv = (v_uv - u_uvOffset) / u_uvScale;"," if (uv.x < 0.0 || uv.y < 0.0 || uv.x > 1.0 || uv.y > 1.0) {"," gl_FragColor = vec4(0.0);"," return;"," }"," vec4 originalSample = sampleSource(uv);"," uv = applyCrtWarp(uv);","#ifdef HF_STAGE_CRT"," vec2 displayEdge = smoothstep(vec2(0.0), vec2(0.006), uv) * (1.0 - smoothstep(vec2(0.994), vec2(1.0), uv));"," float displayMask = displayEdge.x * displayEdge.y;","#endif"," vec4 sampleColor = sampleMedia(uv);"," sampleColor = sampleChromaticMedia(uv, sampleColor);"," sampleColor.rgb = applyDigitalGlitch(uv, sampleColor.rgb);"," vec3 original = originalSample.rgb;"," vec3 color = mix(sampleColor.rgb, applyColorGrade(sampleColor.rgb), u_intensity);","#ifdef HF_STAGE_GRAIN"," float grainAmount = clamp(u_grain, 0.0, 1.0);"," if (grainAmount > 0.0) {"," float grainPixelSize = mix(1.0, 6.0, clamp(u_grainSize, 0.0, 1.0));"," vec2 grainCoord = floor(gl_FragCoord.xy / grainPixelSize) + vec2(u_grainSeed, u_grainSeed * 1.37);"," float grainBase = grainHash(grainCoord) - grainHash(grainCoord + vec2(19.19, 73.31));"," float grainFine = grainHash(gl_FragCoord.xy + vec2(u_grainSeed * 2.11, u_grainSeed * 0.71)) - 0.5;"," float grain = mix(grainBase * 0.7, grainBase + grainFine * 0.35, clamp(u_grainRoughness, 0.0, 1.0));"," float grainLuma = lumaOf(color);"," float grainMask = smoothstep(0.02, 0.55, grainLuma) * (1.0 - smoothstep(0.88, 1.0, grainLuma));"," color += grain * grainAmount * mix(0.025, 0.08, grainMask);"," }","#endif","#ifdef HF_STAGE_FILM_ARTIFACTS"," float filmArtifacts = clamp(u_filmArtifacts, 0.0, 1.0);"," if (filmArtifacts > 0.0) {"," float filmFrame = floor(u_grainSeed);"," float dust = dustMask(v_uv, floor(filmFrame / 3.0));"," float dustTone = grainHash(vec2(floor(filmFrame / 3.0), 8.0));"," color = mix(color, vec3(dustTone > 0.5 ? 0.95 : 0.02), dust * 0.72 * filmArtifacts);"," float scratchBucket = floor(filmFrame / 12.0);"," float scratchX = grainHash(vec2(scratchBucket, 4.2));"," float scratchLife = step(0.78, grainHash(vec2(scratchBucket, 8.4)));"," float scratch = (1.0 - smoothstep(0.0, 1.4 / max(u_resolution.x, 1.0), abs(v_uv.x - scratchX))) * scratchLife;"," color = mix(color, vec3(0.94, 0.88, 0.76), scratch * 0.28 * filmArtifacts);"," }","#endif"," color = applyMonoScreen(clamp(color, 0.0, 1.0), clamp(u_monoScreen, 0.0, 1.0));"," color = applyEngraving(clamp(color, 0.0, 1.0), clamp(u_engraving, 0.0, 1.0));"," color = applyCrosshatch(uv, clamp(color, 0.0, 1.0), clamp(u_crosshatch, 0.0, 1.0));"," color = applyHalftone(clamp(color, 0.0, 1.0), clamp(u_halftone, 0.0, 1.0));"," color = applyTwoInkPrint(clamp(color, 0.0, 1.0), clamp(u_twoInkPrint, 0.0, 1.0));"," color = applyDither(clamp(color, 0.0, 1.0), clamp(u_dither, 0.0, 1.0));"," color = applyAscii(clamp(color, 0.0, 1.0), clamp(u_ascii, 0.0, 1.0));","#ifdef HF_STAGE_BLOOM"," if (u_bloomReady > 0.5 && u_bloom > 0.0) color += sampleBloom(uv) * u_bloom;","#endif"," color = applyScanlines(clamp(color, 0.0, 1.0), clamp(u_scanlines, 0.0, 1.0));","#ifdef HF_STAGE_VIGNETTE"," vec2 vignetteAspect = u_resolution.x > u_resolution.y"," ? vec2(u_resolution.x / max(u_resolution.y, 1.0), 1.0)"," : vec2(1.0, u_resolution.y / max(u_resolution.x, 1.0));"," vec2 vignetteUv = abs((v_uv - vec2(0.5)) * 2.0) * vignetteAspect;"," float vignettePower = mix(8.0, 1.8, clamp(u_vignetteRoundness * 0.5 + 0.5, 0.0, 1.0));"," float vignetteDistance = pow(pow(vignetteUv.x, vignettePower) + pow(vignetteUv.y, vignettePower), 1.0 / vignettePower);"," float vignetteMidpoint = mix(0.22, 1.08, clamp(u_vignetteMidpoint, 0.0, 1.0));"," float vignetteFeather = mix(0.08, 0.72, clamp(u_vignetteFeather, 0.0, 1.0));"," float vignetteMask = smoothstep(vignetteMidpoint, vignetteMidpoint + vignetteFeather, vignetteDistance);"," color *= 1.0 - vignetteMask * clamp(u_vignette, 0.0, 1.0) * 0.75;","#endif","#ifdef HF_STAGE_CRT"," float warpActive = step(0.0001, u_crtCurvature);"," color *= mix(1.0, displayMask, warpActive);","#endif"," vec3 graded = clamp(color, 0.0, 1.0);","#ifdef HF_STAGE_COMPARE"," if (u_compareEnabled > 0.5) {"," float pos = clamp(u_comparePosition, 0.0, 1.0);"," float softness = max(u_compareSoftness, 0.00001);"," float afterMask = smoothstep(pos - softness, pos + softness, v_uv.x);"," vec3 splitColor = mix(original, graded, afterMask);"," float lineMask = 0.0;"," if (u_compareLineWidth > 0.0) {"," float lineWidth = max(u_compareLineWidth / max(u_resolution.x, 1.0), 0.00001);"," lineMask = 1.0 - smoothstep(lineWidth, lineWidth * 1.8, abs(v_uv.x - pos));"," }"," gl_FragColor = vec4(mix(splitColor, vec3(1.0), lineMask * 0.82), sampleColor.a);"," return;"," }","#endif"," gl_FragColor = vec4(graded, sampleColor.a);","}"].join(`
|
|
366
366
|
`),jE=[["HF_STAGE_BLUR",e=>e.effects.blur>0],["HF_STAGE_KUWAHARA",e=>e.effects.kuwahara>0],["HF_STAGE_PIXELATE",e=>e.effects.pixelate>0],["HF_STAGE_TAPE",e=>e.effects.tapeDamage>0],["HF_STAGE_CHROMA_BLEED",e=>e.effects.chromaBleed>0],["HF_STAGE_CHROMATIC",e=>e.effects.chromaticAberration>0],["HF_STAGE_CRT",e=>e.effects.crtCurvature>0],["HF_STAGE_GLITCH",e=>e.effects.digitalGlitch>0],["HF_STAGE_GRAIN",e=>e.details.grain>0],["HF_STAGE_FILM_ARTIFACTS",e=>e.effects.filmArtifacts>0],["HF_STAGE_MONO_SCREEN",e=>e.effects.monoScreen>0],["HF_STAGE_ENGRAVING",e=>e.effects.engraving>0],["HF_STAGE_CROSSHATCH",e=>e.effects.crosshatch>0],["HF_STAGE_HALFTONE",e=>e.effects.halftone>0],["HF_STAGE_TWO_INK_PRINT",e=>e.effects.twoInkPrint>0],["HF_STAGE_DITHER",e=>e.effects.dither>0],["HF_STAGE_ASCII",e=>e.effects.ascii>0],["HF_STAGE_BLOOM",e=>e.effects.bloom>0],["HF_STAGE_SCANLINES",e=>e.effects.scanlines>0],["HF_STAGE_VIGNETTE",e=>e.details.vignette>0],["HF_STAGE_RGB_CURVES",e=>Il(e).rgbCurvesEnabled],["HF_STAGE_HUE_CURVES",e=>Il(e).hueCurvesEnabled],["HF_STAGE_SECONDARIES",e=>Il(e).secondaryCount>0],["HF_STAGE_LUT",e=>e.lut!==null],["HF_STAGE_COMPARE",(e,t)=>t.enabled]];function cF(e,t){let n="";for(let[r,o]of jE)o(e,t)&&(n+=`#define ${r}
|
|
367
367
|
`);return n}var IE=jE.map(([e])=>`#define ${e}
|
|
@@ -636,7 +636,7 @@ void main() {
|
|
|
636
636
|
gl_Position = vec4(p * 2.0 - 1.0, 0.0, 1.0);
|
|
637
637
|
}
|
|
638
638
|
`,cn=[],Vv=30,$v=0,am=0,qv=-1,rm=null,om=null;function gt(e){globalThis.console.error(Wv,`vfx: ${e}`)}function zv(e){globalThis.console.error(Wv,`vfx-frame: ${e}`)}function Ov(e,t,n){let r=e.createShader(t);return r?(e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(gt(`shader failed to compile: ${e.getShaderInfoLog(r)??"(no log)"}`),e.deleteShader(r),null)):null}function iI(e,t){let n=Ov(e,e.VERTEX_SHADER,oI),r=n?Ov(e,e.FRAGMENT_SHADER,t):null;if(!n||!r)return null;let o=e.createProgram();return o?(e.attachShader(o,n),e.attachShader(o,r),e.linkProgram(o),e.deleteShader(n),e.deleteShader(r),e.getProgramParameter(o,e.LINK_STATUS)?o:(gt(`program failed to link: ${e.getProgramInfoLog(o)??"(no log)"}`),e.deleteProgram(o),null)):null}var Hv="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;";function aI(e){let t=e.querySelector(":scope > canvas.hf-vfx-out");if(Jt(t))return t.style.cssText=Hv+t.style.cssText,t;let n=document.createElement("canvas");return n.className="hf-vfx-out",n.style.cssText=Hv,e.appendChild(n),n}function sI(e,t,n){let r={};for(let o of n.params)o.kind!=="ref"&&(r[o.key]=e.getUniformLocation(t,`u_${o.key}`));return{size:e.getUniformLocation(t,"u_size"),t:e.getUniformLocation(t,"u_t"),fps:e.getUniformLocation(t,"u_fps"),src:e.getUniformLocation(t,"u_src"),src2:e.getUniformLocation(t,"u_src2"),hasSrc2:e.getUniformLocation(t,"u_hasSrc2"),params:r}}function lI(e,t,n,r){return r.optional?{kind:"none"}:(gt(`${zt(e)}: node "${t.id}" (${n.id}) needs a "${r.key}" param naming the id of the element to read as its second source.`),{kind:"error"})}function uI(e,t,n,r,o,i){let a=n.params.find(f=>f.kind==="ref");if(!a)return{kind:"none"};let l=r[a.key];if(typeof l!="string"||l==="")return lI(e,t,n,a);let s=e.ownerDocument.getElementById(l);if(!we(s))return gt(`${zt(e)}: node "${t.id}" (${n.id}) names "${a.key}" element #${l}, which is not in the composition.`),{kind:"error"};if(s===e)return a.optional?{kind:"none"}:{kind:"self"};let c=i.get(s);if(c)return{kind:"source",source:c};let d=jv(s,o,`${zt(e)}: "${a.key}" source`);return d?(i.set(s,d),{kind:"source",source:d}):{kind:"error"}}function cI(e,t,n){let r=[],o=new Map;for(let i of nm(t)){let a=kv(i.type);if(!a)return gt(`node "${i.id}" has unknown effect type "${i.type}"`),null;let l=iI(e,a.frag);if(!l)return gt(`node "${i.id}" (${a.id}) has no usable program`),null;let s=Lv(a.id,i.params),c=uI(n,i,a,s,e,o);if(c.kind==="error")return null;r.push({node:i,def:a,program:l,params:s,locations:sI(e,l,a),...c.kind==="source"?{ref:c.source}:{},selfRef:c.kind==="self"})}return r}function dI(e){let t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),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),t}function fI(e){let t=e.parentElement;if(!t||e.id==="")return null;let n=t.children;for(let r=0;r<n.length;r++){let o=n.item(r);if(Jt(o)&&o.classList.contains("hf-vfx-src")&&o.getAttribute("data-vfx-for")===e.id)return o}return null}function mI(e,t){go()==="drawable"&&(Vl(e,"drawable"),$l(t,"drawable"))}function jv(e,t,n){let r=fI(e),o=r??e.querySelector(":scope > canvas.hf-vfx-src"),i=Jt(o)?o.querySelector(":scope > .hf-vfx-in"):null;if(!Jt(o)||!we(i)){gt(`${n}: a capturing chain needs <canvas layoutsubtree class="hf-vfx-src"><div class="hf-vfx-in">\u2026</div></canvas> in source: inside the element for its own pixels, or beside it with data-vfx-for="${e.id}" for the layers below it.`);return}if(o.querySelector("canvas.hf-vfx-src")||o.parentElement?.closest("canvas.hf-vfx-src")){gt(`${n}: a capture canvas nested inside another capture canvas blocks the renderer's main thread in drawElementImage, so this chain is not registered. Keep each .hf-vfx-src out of every other .hf-vfx-src subtree.`);return}let a=o.getContext("2d");if(!a||typeof a.drawElementImage!="function"){gt(`${n}: drawElementImage is unavailable, so the layer cannot be captured. In Studio, enable chrome://flags/#canvas-draw-element.`);return}return mI(o,i),{canvas:o,inner:i,ctx:a,texture:dI(t),backdrop:r!==null,visible:o.hasAttribute(nI),emptyBoxReported:!1,laidOutEmpty:$n(i)===null}}function pI(e){e.out.addEventListener("webglcontextlost",t=>{t.preventDefault(),!(!cn.includes(e)||e.contextLost)&&(e.contextLost=!0,gt(`${zt(e.host)}: WebGL context lost.`))})}function hI(e){try{return Pv(e.getAttribute(tm)??"")}catch(t){let n=t instanceof Nt?t.message:String(t);return gt(`${zt(e)}: ${n}`),null}}function gI(e){let t=hI(e);if(!t)return null;let n=aI(e),r=n.getContext("webgl2",rI);if(!r)return gt(`${zt(e)}: WebGL2 is unavailable, so the chain cannot paint.`),n.remove(),null;let o=cI(r,t,e);if(!o)return n.remove(),null;let i=Fv(t),a=i==="none"?void 0:jv(e,r,zt(e));if(i!=="none"&&!a)return n.remove(),null;let l=a?.backdrop?"backdrop":i,s={host:e,chain:t,capture:l,out:n,gl:r,passes:o,src:a,contextLost:!1};return pI(s),s}function sm(e){let t=getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function Kv(e){if(getComputedStyle(e.inner).visibility==="hidden")return!1;for(let t=e.inner;t;t=t.parentElement)if(getComputedStyle(t).display==="none")return!1;return!0}function zt(e){return e.id?`#${e.id}`:`<${e.tagName.toLowerCase()}>`}function bo(e){let t=e.src?[e.src]:[];for(let n of e.passes)n.ref&&!t.includes(n.ref)&&t.push(n.ref);return t}function lm(e){return e.src?.backdrop===!0}function Zi(e){let t=[];for(let n of e.passes)n.ref?.visible&&!t.includes(n.ref)&&t.push(n.ref);return t}function bI(){for(let e of cn){let{gl:t}=e;for(let n of e.passes)t.deleteProgram(n.program);for(let n of bo(e))t.deleteTexture(n.texture);if(e.ping){for(let n of e.ping.textures)t.deleteTexture(n);for(let n of e.ping.framebuffers)t.deleteFramebuffer(n)}}}function ql(e,t){bI(),cn=[],Vv=Number.isFinite(t)&&t>0?t:30;let n=e.querySelectorAll(`[${tm}]`);for(let r of n){if(!we(r))continue;let o=gI(r);o&&cn.push(o)}return cn}function $n(e){let t=typeof window>"u"?1:window.devicePixelRatio||1,n=Math.round(e.offsetWidth*t),r=Math.round(e.offsetHeight*t);return n>0&&r>0?{width:n,height:r}:null}function Gv(e,t,n){let r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,n,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),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);let o=e.createFramebuffer();return e.bindFramebuffer(e.FRAMEBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0),[r,o]}function yI(e,t,n){let r=e.ping;if(r&&r.width===t&&r.height===n)return r;let{gl:o}=e;if(r){for(let s of r.textures)o.deleteTexture(s);for(let s of r.framebuffers)o.deleteFramebuffer(s)}let i=Gv(o,t,n),a=Gv(o,t,n),l={textures:[i[0],a[0]],framebuffers:[i[1],a[1]],width:t,height:n};return e.ping=l,l}function xI(e,t,n){if(e.kind==="ref")return null;if(e.kind==="number"&&e.animatable){let o=n.getPropertyValue(`--vfx-${t.node.id}-${e.key}`).trim(),i=o===""?Number.NaN:Number.parseFloat(o);if(Number.isFinite(i))return Math.min(e.max,Math.max(e.min,i))}let r=t.params[e.key];return typeof r=="boolean"?r?1:0:typeof r=="number"?r:0}function SI(e,t,n,r,o,i){let{gl:a}=e,{locations:l}=t;a.uniform2f(l.size,o,i),a.uniform1f(l.t,r),a.uniform1f(l.fps,Vv),a.uniform1f(l.hasSrc2,t.ref||t.selfRef?1:0);for(let s of t.def.params){let c=xI(s,t,n);c!==null&&a.uniform1f(l.params[s.key]??null,c)}}function EI(e,t,n){return e===t||!n?null:n.framebuffers[e%2]??null}function vI(e,t,n){return t===0?e.src?.texture??null:n?.textures[(t-1)%2]??null}function AI(e,t,n,r){let{gl:o}=e,i=e.passes[t];o.bindFramebuffer(o.FRAMEBUFFER,EI(t,n,r));let a=vI(e,t,r);a&&Bv(o,i.locations.src,a,0),i.ref?(Bv(o,i.locations.src2,i.ref.texture,1),o.activeTexture(o.TEXTURE0)):i.selfRef&&a&&o.uniform1i(i.locations.src2,0)}function Bv(e,t,n,r){e.activeTexture(r===0?e.TEXTURE0:e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(t,r)}function um(e,t){let n=$n(e.host);if(!n)return;let{gl:r,out:o,passes:i}=e;o.width!==n.width&&(o.width=n.width),o.height!==n.height&&(o.height=n.height);let a=i.length>1?yI(e,n.width,n.height):null,l=getComputedStyle(e.host),s=i.length-1;for(let c=0;c<=s;c++){let d=i[c];r.useProgram(d.program),AI(e,c,s,a),r.viewport(0,0,n.width,n.height),SI(e,d,l,t,n.width,n.height),r.drawArrays(r.TRIANGLES,0,3)}}function Yv(e,t){e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.canvas),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0)}var wI={upload:!0,keepBitmap:!1},_I={upload:!1,keepBitmap:!0},CI={upload:!0,keepBitmap:!0},TI={upload:!1,keepBitmap:!0};function Xv(e,t){e.canvas.width!==t.width&&(e.canvas.width=t.width),e.canvas.height!==t.height&&(e.canvas.height=t.height)}function Uv(e,t,n,r){return Xv(t,n),t.ctx.clearRect(0,0,n.width,n.height),r.upload&&Yv(e.gl,t),!0}function cm(e,t,n,r,o){if(!Kv(t))return Uv(e,t,n,o);if($n(t.inner)===null)return t.emptyBoxReported||(t.emptyBoxReported=!0,zv(`${zt(e.host)}: the .hf-vfx-in wrapper measures 0\xD70, so its capture would be empty. Inside a layoutsubtree canvas an inset or percentage box has no size, so the wrapper must state an explicit width and height in px.`)),Uv(e,t,n,o);Xv(t,n),t.ctx.clearRect(0,0,n.width,n.height);try{t.ctx.drawElementImage(t.inner,0,0,n.width,n.height)}catch(i){return r||gt(`${zt(e.host)}: drawElementImage failed: ${i.message} In Studio, enable chrome://flags/#canvas-draw-element.`),!1}return o.upload&&Yv(e.gl,t),o.keepBitmap||t.ctx.clearRect(0,0,n.width,n.height),!0}function Jv(e,t){return e.visible?$n(e.inner)??t:t}function Qv(e,t=!1){let n=$n(e.host),r=bo(e);if(!n||r.length===0)return!1;let o=!0;for(let i of r){let a=i.visible?CI:wI;cm(e,i,Jv(i,n),t,a)||(o=!1)}return o}function Zv(e,t=!1){let n=e.src;if(!n)return!1;let r=$n(e.host)??$n(n.inner);return r?cm(e,n,r,t,_I):!1}function im(e,t=!1){let n=!0;for(let r of Zi(e)){let o=Jv(r,{width:0,height:0});cm(e,r,o,t,TI)||(n=!1)}return n}function RI(e){let t=!1;return lm(e)&&Zv(e)&&(t=!0),Zi(e).length>0&&im(e)&&(t=!0),t}function MI(){let e=!1;for(let t of cn)if(!t.contextLost&&bo(t).length!==0){if(!sm(t.host)){RI(t)&&(e=!0);continue}Qv(t)&&(um(t,$v),e=!0)}return qv=am,window.__hf_page_composite_pending=!1,e}function kI(){let e=window,t=e.__hf_page_composite_resolve;t!==rm&&(om=typeof t=="function"?t:null,rm=()=>{let n=om?om():!1;return MI()||n},e.__hf_page_composite_resolve=rm),e.__hf_page_composite_pending=!0}var eA=2e3;function LI(e){return new Promise(t=>{let n=!1,r=a=>{n||(n=!0,clearTimeout(i),e.removeEventListener("paint",o),t(a))},o=()=>r("painted"),i=setTimeout(()=>r("timeout"),eA);e.addEventListener("paint",o,{once:!0});try{e.requestPaint?.()}catch{}if(typeof requestAnimationFrame!="function"){r("painted");return}requestAnimationFrame(()=>requestAnimationFrame(()=>r("painted")))})}async function NI(e,t){return(await Promise.all(t.map(r=>LI(r.canvas)))).includes("timeout")?(zv(`${zt(e.host)}: no paint arrived within ${eA}ms, so this frame's capture was skipped (a BeginFrame-controlled compositor without a tick for this frame is a known cause).`),!1):!0}function FI(e){return sm(e.host)?"paint":lm(e)?"passThrough":"refOnly"}function PI(e,t){return(t==="passThrough"?[...e.src?[e.src]:[],...Zi(e)]:t==="refOnly"?Zi(e):bo(e)).filter(Kv)}function II(e,t){return t!==am||qv===t?!1:cn.includes(e)&&!e.contextLost}async function DI(e,t,n,r){let o=FI(e);if(await NI(e,PI(e,o))&&II(e,n)){if(o==="passThrough"){Zv(e,r),im(e,r);return}if(o==="refOnly"){im(e,r);return}Qv(e,r)&&um(e,t)}}async function OI(e,t,n,r){await Promise.all(e.map(o=>DI(o,t,n,r)))}function HI(){for(let e of cn.flatMap(bo)){let t=$n(e.inner)===null;e.laidOutEmpty&&!t&&e.canvas.insertBefore(e.inner,e.inner.nextSibling),e.laidOutEmpty=t}}function dm(e,t){$v=e;let n=++am;HI();let r=[];for(let o of cn)if(!o.contextLost){if(!sm(o.host)){(lm(o)||Zi(o).length>0)&&r.push(o);continue}bo(o).length>0?r.push(o):um(o,e)}r.length!==0&&(t?.engineMode&&kI(),Qe(OI(r,e,n,t?.engineMode===!0)))}function pm(e=window){let t=/Chrome\/(\d+)/.exec(e.navigator.userAgent);return t?.[1]?Number(t[1]):null}var GI=(e,t)=>t.backface,BI=(e,t)=>Array.from(e.ownerDocument.querySelectorAll("canvas")).some(t.isAccelerated),UI=/^matrix\(\s*1,\s*0,\s*0,\s*1,\s*0,\s*0\s*\)$|^matrix3d\(\s*1,\s*0,\s*0,\s*0,\s*0,\s*1,\s*0,\s*0,\s*0,\s*0,\s*1,\s*0,\s*0,\s*0,\s*0,\s*1\s*\)$/,fm=(e,t)=>!!e&&e!=="none"&&!e.split(/\s+/).every(n=>parseFloat(n)===t),WI=e=>{let t=getComputedStyle(e),n=t.transform.trim();return fm(t.scale,1)||fm(t.rotate,0)||fm(t.translate,0)?!0:n!=="none"&&n!==""&&!UI.test(n)},VI=e=>{let t=getComputedStyle(e).mixBlendMode;return!!t&&t!=="normal"},$I=e=>Number.parseFloat(getComputedStyle(e).opacity)<1,qI=e=>e.querySelector("iframe, object, embed")!==null||Array.from(e.querySelectorAll("*")).some(t=>t.localName.includes("-")&&customElements.get(t.localName)!==void 0),zI=[{code:"nested-capture-canvas",reason:"the composition already uses html-in-canvas",detect:e=>e.querySelector(Iv)!==null},{code:"accelerated-canvas",reason:"the composition draws a WebGL/WebGPU canvas, which html-in-canvas captures frozen",detect:BI},{code:"backface-visibility",reason:"backface-visibility: hidden inside a 3D transform is drawn mirrored by html-in-canvas",detect:GI},{code:"iframe-in-root",reason:"the composition contains an <iframe>, <object>, <embed> or custom element, which is re-initialised when blur wraps the root",detect:qI},{code:"root-transform",reason:"html-in-canvas can ignore a transform on the composition root",detect:WI},{code:"root-opacity",reason:"html-in-canvas can ignore the composition root's own opacity",detect:$I},{code:"root-blend-mode",reason:"html-in-canvas can ignore the composition root's own mix-blend-mode",detect:VI}];function zl(e,t){let n=zI.find(r=>r.detect(e,t));return n?{code:n.code,reason:n.reason}:null}var tA=/perspective\(|rotate3d\(|rotate[XY]\(|matrix3d\(/;function nA(e){return e.getPropertyValue("backface-visibility")==="hidden"||e.getPropertyValue("-webkit-backface-visibility")==="hidden"}var jI=e=>!/^(none|-?[\d.]+[a-z]+)?$/.test(e.rotate??"")||(e.translate??"").trim().split(/\s+/).length>2;function KI(e,t){return tA.test(t.transform)||tA.test(e.style.transform)||jI(t)}function YI(e,t){for(let n=e;n;n=n.parentElement){let r=getComputedStyle(n);if(r.transformStyle==="preserve-3d"||KI(n,r)||n!==e&&r.perspective!=="none"&&r.perspective!=="")return!0;if(n===t)break}return!1}var XI=16,hm="@keyframes ";function JI(e){let t=[],n=0,r=0;for(let o=0;o<e.length;o++){let i=e.charAt(o);i==="("||i==="["?n++:i===")"||i==="]"?n--:i===","&&n===0&&(t.push(e.slice(r,o).trim()),r=o+1)}return t.push(e.slice(r).trim()),t}function QI(e,t){if(t===null)return e;let n=`:is(${t})`;return JI(e).map(r=>r.includes("&")?r.replaceAll("&",n):`${n} ${r}`).join(", ")}function*mm(e,t,n,r){if(!(r>XI))for(let o of Array.from(e))yield*eD(o,t,n,r)}function ZI(e,t){let n="style"in e?e.style:null;return t!==null&&n instanceof CSSStyleDeclaration?{selector:t,style:n}:null}function*eD(e,t,n,r){if(e instanceof CSSStyleRule){let i=QI(e.selectorText,t);yield{selector:i,style:e.style},yield*mm(e.cssRules,i,n,r+1);return}if(e instanceof CSSImportRule){e.styleSheet&&(yield*rA(e.styleSheet,n,r+1));return}let o=ZI(e,t);if(o)yield o;else if("cssRules"in e&&e.cssRules instanceof CSSRuleList){let i=e instanceof CSSKeyframesRule?hm+e.name:t;yield*mm(e.cssRules,i,n,r+1)}}function tD(e){try{return e.cssRules}catch{return null}}function*rA(e,t,n){let r=t.has(e)?null:tD(e);t.add(e),r&&(yield*mm(r,null,t,n))}function nD(e,t){try{let n=Array.from(e.querySelectorAll(t));return e.matches(t)?[e,...n]:n}catch{return[]}}function rD(e){return(document.getAnimations?.()??[]).flatMap(({effect:t})=>{if(!(t instanceof KeyframeEffect))return[];let n=t.target;return t.getKeyframes().some(o=>o.backfaceVisibility==="hidden")&&n instanceof HTMLElement&&e.contains(n)?[n]:[]})}function oD(e,t){return t.length===0?[]:[e,...e.querySelectorAll("*")].filter(n=>getComputedStyle(n).animationName.split(", ").some(r=>t.includes(hm+r)))}function iD(){let e=new Set,t=[...Array.from(document.styleSheets),...document.adoptedStyleSheets??[]],n=[];for(let r of t)for(let o of rA(r,e,0))nA(o.style)&&n.push(o.selector);return n}function aD(e,t){let n=t.filter(o=>o.startsWith(hm)),r=new Set([...e.querySelectorAll('[style*="backface"]'),...rD(e),...oD(e,n)]);for(let o of t)for(let i of nD(e,o))r.add(i);return r}function oA(e){let t=iD(),n=new Set,r=()=>{for(let o of n)if(nA(getComputedStyle(o))&&YI(o,e))return!0;return!1};return{scan:()=>(n=new Set([...n,...aD(e,t)]),r()),recheck:r}}function iA(e){return oA(e).scan()}var sD=10;function aA(e,t){let n=oA(e),r=null;return{sample:(o,i,a)=>{if(r)return;let l=o%sD===0||o===i,s=zl(e,{isAccelerated:t,backface:l&&n.scan()});s&&(r={...s,reason:`${s.reason} (first seen at t=${a.toFixed(1)}s)`})},result:()=>r,facesNow:n.recheck}}var sA="__HF_PAGE_MOTION_BLUR_OFF__",lA="__HF_DEVICE_SCALE_FACTOR__";function uA(e=window){return go(e)!==null}var lD="__hfAcceleratedCanvases";function cA(){let e="__hfAcceleratedCanvases",t=Reflect.get(window,e),n=t instanceof WeakSet?t:new WeakSet;n!==t&&Object.defineProperty(window,e,{value:n});let r=["webgl","webgl2","experimental-webgl","webgpu"],o=(i,a)=>{let l=HTMLCanvasElement.prototype,s=Reflect.get(l,i);if(typeof s!="function"||"__hfAccelTracked"in s)return;let c=function(...d){let f=Reflect.apply(s,this,d);return a(this,d,f),f};Object.defineProperty(c,"__hfAccelTracked",{value:!0}),Object.defineProperty(l,i,{value:c,writable:!0,configurable:!0})};o("getContext",(i,a,l)=>{l&&r.includes(String(a[0]))&&n.add(i)}),o("transferControlToOffscreen",i=>{n.add(i)})}function dA(e){let t=Reflect.get(window,lD);return t instanceof WeakSet&&t.has(e)}var yo={a:1,b:0,c:0,d:1,e:0,f:0};function jl(e,t){return{a:e.a*t.a+e.c*t.b,b:e.b*t.a+e.d*t.b,c:e.a*t.c+e.c*t.d,d:e.b*t.c+e.d*t.d,e:e.a*t.e+e.c*t.f+e.e,f:e.b*t.e+e.d*t.f+e.f}}function ea(e,t,n){return jl(e,{a:1,b:0,c:0,d:1,e:t,f:n})}function bm(e){let t=e.a*e.d-e.b*e.c;return!Number.isFinite(t)||Math.abs(t)<1e-12?null:{a:e.d/t,b:-e.b/t,c:-e.c/t,d:e.a/t,e:(e.c*e.f-e.d*e.e)/t,f:(e.b*e.e-e.a*e.f)/t}}function uD(e,t,n){return[[e.e,e.f],[e.a*t+e.e,e.b*t+e.f],[e.c*n+e.e,e.d*n+e.f],[e.a*t+e.c*n+e.e,e.b*t+e.d*n+e.f]]}function cD(e,t,n){let r=fA(e),o=fA(t),i=o.angle-r.angle;i>Math.PI?i-=2*Math.PI:i<-Math.PI&&(i+=2*Math.PI);let a=(l,s)=>l+(s-l)*n;return dD({angle:r.angle+i*n,sx:a(r.sx,o.sx),sy:a(r.sy,o.sy),shear:a(r.shear,o.shear),e:a(e.e,t.e),f:a(e.f,t.f)})}function fA(e){let t=Math.hypot(e.a,e.b);return t<1e-12?{angle:0,sx:0,sy:e.d,shear:e.c,e:e.e,f:e.f}:{angle:Math.atan2(e.b,e.a),sx:t,sy:(e.a*e.d-e.b*e.c)/t,shear:(e.a*e.c+e.b*e.d)/t,e:e.e,f:e.f}}function dD(e){let t=Math.cos(e.angle),n=Math.sin(e.angle);return{a:e.sx*t,b:e.sx*n,c:e.shear*t-e.sy*n,d:e.shear*n+e.sy*t,e:e.e,f:e.f}}function Kl(e,t){if(e.length===0)return[];if(e.length===1)return Array.from({length:t},()=>e[0]);let n=e.length-1;return Array.from({length:t},(r,o)=>{let i=(o+.5)/t*n,a=Math.min(n-1,Math.floor(i));return cD(e[a],e[a+1],i-a)})}function Yl(e,t,n,r,o){let i=1/0,a=1/0,l=-1/0,s=-1/0,c=0,d=null;for(let x of e){let E=uD(x,t,n);for(let[v,_]of E)i=Math.min(i,v),a=Math.min(a,_),l=Math.max(l,v),s=Math.max(s,_);if(d){let v=0;for(let _=0;_<4;_++){let[U,G]=d[_],[R,D]=E[_];v=Math.max(v,Math.hypot(R-U,D-G))}c+=v}d=E}let f=Math.max(0,Math.floor(i)-2),m=Math.max(0,Math.floor(a)-2),p=Math.min(r,Math.ceil(l)+2),b=Math.min(o,Math.ceil(s)+2),y=p>f&&b>m?{x:f,y:m,w:p-f,h:b-m}:null;return{travel:c,rect:y}}function hA(e){let t=Math.floor(255/e),n=255-t*e;return Array.from({length:e},(r,o)=>(t+Math.floor((o+1)*n/e)-Math.floor(o*n/e))/255)}var fD=16;function gA(e,t,n,r,o,i=2,a=128,l=32){let{travel:s}=Yl(Kl(e,fD),t,n,r,o);return Kl(e,Math.min(a,Math.max(l,Math.ceil(s/i))))}function bA(e,t,n=1.5){let r=Math.min(e.length,Math.max(2,Math.ceil(t/n)));return r>=e.length?e:Array.from({length:r},(o,i)=>{let a=Math.round((i+.5)/r*e.length-.5);return e[a]})}function Xl(e,t){let n=new Map,r=new Map,o=new Map,i=s=>{if(!t.has(s)&&n.has(s))return n.get(s)??null;let d=getComputedStyle(s),f=yA([hD(d,s.offsetWidth,s.offsetHeight),ym(d.transform)]),m=null;if(f){let[p=0,b=0]=d.transformOrigin.split(" ").map(y=>parseFloat(y)||0);m=ea(jl(ea(yo,p,b),f),-p,-b)}return t.has(s)||n.set(s,m),m},a=s=>{if(!s||s===e||!pA(s))return[0,0];let c=r.get(s);if(!c){let d=s.offsetParent,[f,m]=a(d);c=[f+s.offsetLeft+(d?.clientLeft??0),m+s.offsetTop+(d?.clientTop??0)],r.set(s,c)}return c},l=s=>{if(!s||s===e||!pA(s))return yo;let c=o.get(s);if(!c){let d=s.parentElement,[f,m]=a(s),[p,b]=a(d),[y,x]=mD(d);c=ea(l(d),f-p-y,m-b-x);let E=i(s);E&&(c=jl(c,E)),o.set(s,c)}return c};return{pose:l,reset(){r=new Map,o=new Map}}}function mD(e){return e?[e.scrollLeft,e.scrollTop]:[0,0]}function yA(e){let t=null;for(let n of e)n&&(t=t?jl(t,n):n);return t}var gm=e=>e.trim().split(/\s+(?![^(]*\))/);function mA(e,t){let n=0;for(let r of e.matchAll(/([+-]?\s*[\d.]+(?:e[+-]?\d+)?)(px|%)?/g)){let o=Number(r[1]?.replace(/\s/g,""));n+=r[2]==="%"?o/100*t:o}return n}var pD={deg:Math.PI/180,rad:1,grad:Math.PI/200,turn:2*Math.PI};function hD(e,t,n){let r=e.translate??"none",o=e.rotate??"none",i=e.scale??"none",a=[];if(r!=="none"){let[s="0",c="0"]=gm(r);a.push({...yo,e:mA(s,t),f:mA(c,n)})}let l=/^(-?[\d.]+)(deg|rad|grad|turn)$/.exec(o);if(l){let s=Number(l[1])*(pD[l[2]??"deg"]??0);a.push({a:Math.cos(s),b:Math.sin(s),c:-Math.sin(s),d:Math.cos(s),e:0,f:0})}if(i!=="none"){let[s=1,c=s]=gm(i).map(Number);a.push({...yo,a:s,d:c})}return yA(a)}function xA(e){let t=e.translate??"none",n=e.rotate??"none";return t!=="none"&&gm(t).length>2||!/^(none|-?[\d.]+[a-z]+)$/.test(n)}function ym(e){let t=/^matrix(3d)?\(([^)]*)\)$/.exec(e.trim());if(!t)return null;let n=(t[2]??"").split(",").map(Number);if(n.some(d=>!Number.isFinite(d)))return null;let r=t[1]?[0,1,4,5,12,13]:[0,1,2,3,4,5];if(n.length!==(t[1]?16:6))return null;let[o=1,i=0,a=0,l=1,s=0,c=0]=r.map(d=>n[d]??0);return{a:o,b:i,c:a,d:l,e:s,f:c}}function pA(e){return typeof e.offsetLeft=="number"}function SA(e,t){let n=new OffscreenCanvas(e,t),r=null;try{r=n.getContext("2d",{colorType:"float16"})}catch{r=null}if(r=r??n.getContext("2d"),!r)throw new Error("capture motion blur: no 2D context for the accumulation buffer");return{canvas:n,ctx:r}}function gD(e,t,n){let{travel:r,rect:o}=Yl(e.taps,e.w,e.h,t,n);return o!==null&&r>=1}function xm(e,t,n=1){let r=Math.max(1,Math.round(e*n)),o=Math.max(1,Math.round(t*n)),i=SA(r,o),a=[],l=e*t*4,s=(p,b,y)=>{let x=Math.ceil(b*n),E=Math.ceil(y*n),v=a[p];return(!v||v.canvas.width<x||v.canvas.height<E)&&(v=SA(Math.max(x,v?.canvas.width??1),Math.max(E,v?.canvas.height??1)),a[p]=v),v};function c(p){return p.map(b=>bm(b.now)!==null&&b.w*b.h<=l&&gD(b,e,t))}function d(p,b,y){b.forEach((x,E)=>{let v=bm(x.now);if(!y[E]||!v)return;let{w:_,h:U}=x,G=s(E,_,U).ctx;G.setTransform(1,0,0,1,0,0),G.globalCompositeOperation="source-over",G.globalAlpha=1,G.clearRect(0,0,Math.ceil(_*n),Math.ceil(U*n)),G.setTransform(n*v.a,n*v.b,n*v.c,n*v.d,n*v.e,n*v.f),G.drawImage(p,0,0,e,t)})}function f(p,b,y){let{w:x,h:E}=b,{travel:v,rect:_}=Yl(b.taps,x,E,e,t);if(!_)return 0;let U=bA(b.taps,v),G=Math.max(0,Math.floor(_.x*n)),R=Math.max(0,Math.floor(_.y*n)),D=Math.min(r,Math.ceil((_.x+_.w)*n))-G,T=Math.min(o,Math.ceil((_.y+_.h)*n))-R;if(D<=0||T<=0)return 0;let H=i.ctx;H.setTransform(1,0,0,1,0,0),H.globalCompositeOperation="source-over",H.globalAlpha=1,H.clearRect(G,R,D,T),H.globalCompositeOperation="lighter";let I=hA(U.length);return U.forEach((Y,W)=>{H.globalAlpha=I[W]??0,H.setTransform(n*Y.a,n*Y.b,n*Y.c,n*Y.d,n*Y.e,n*Y.f),H.drawImage(y.canvas,0,0,x*n,E*n,0,0,x,E)}),p.drawImage(i.canvas,G,R,D,T,G,R,D,T),U.length}function m(p,b,y,x){b.setTransform(1,0,0,1,0,0),b.globalAlpha=1,b.globalCompositeOperation="copy",b.drawImage(p,0,0),b.globalCompositeOperation="source-over";let E={blurred:0,taps:0};return y.forEach((v,_)=>{let U=a[_];if(!x[_]||!U)return;let G=f(b,v,U);G>0&&(E.blurred++,E.taps+=G)}),E}return{plan:c,crop:d,draw:m}}var ta={enable:"data-motion-blur",shutter:"data-motion-blur-shutter",samples:"data-motion-blur-samples",events:"data-motion-blur-events",tier:"data-motion-blur-tier"},bD={shutterDeg:{min:0,max:720,default:240},samples:{min:2,max:64}},EA=(e,t,n)=>Math.min(n,Math.max(t,e));function vA(e){if(e===null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}function AA(e){let t=vA(e(ta.shutter)),n=vA(e(ta.samples)),r=e(ta.tier),{shutterDeg:o,samples:i}=bD;return{enabled:e(ta.enable)==="on",shutterDeg:EA(t??o.default,o.min,o.max),samples:n===null?null:Math.round(EA(n,i.min,i.max)),events:e(ta.events)==="on",tier:r==="capture"||r==="filter"?r:"auto"}}var yD=256,xD=64,SD=/(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color)\([^)]*\)/g;function CA(e){return[...e.replace(SD," ").matchAll(/-?\d*\.?\d+(?=px|\s|$)/g)].map(t=>Number(t[0]))}function ED(e){let t=[],n=0,r=0;for(let o=0;o<e.length;o++){let i=e[o];i==="("?n++:i===")"?n--:i===","&&n===0&&(t.push(e.slice(r,o)),r=o+1)}return t.push(e.slice(r)),t}function wA(e){return!e||e==="none"?0:Math.max(0,...ED(e).filter(t=>!/\binset\b/.test(t)).map(t=>{let[n=0,r=0,o=0,i=0]=CA(t);return Math.max(Math.abs(n),Math.abs(r))+o+Math.max(0,i)}))}function vD(e){if(!e||e==="none")return 0;let t=0;for(let n of e.matchAll(/drop-shadow\(((?:[^()]|\([^)]*\))*)\)/g)){let[r=0,o=0,i=0]=CA(n[1]??"");t=Math.max(t,Math.max(Math.abs(r),Math.abs(o))+i*1.5)}for(let n of e.matchAll(/(?<!-)blur\(\s*([\d.]+)px\s*\)/g))t=Math.max(t,Number(n[1])*3);return t}function _A(e){let t=getComputedStyle(e),n=t.outlineStyle!=="none"?parseFloat(t.outlineWidth)+parseFloat(t.outlineOffset):0;return Math.max(wA(t.boxShadow),wA(t.textShadow),vD(t.filter),Number.isFinite(n)?Math.max(0,n):0)}function TA(e){let t=_A(e),n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let r=0;r<xD&&n.nextNode();r++){let o=n.currentNode;we(o)&&(t=Math.max(t,_A(o)))}return Math.min(yD,Math.ceil(t))}var RA=2,AD=.5,wD=240,_D=new Set(["transform","translate","rotate","scale","left","top","right","bottom"]),Sm=e=>e.getAttribute("style")??"";function CD(e,t){for(let n=e;n&&n!==t;n=n.parentElement)if(n.getAttribute("data-motion-blur")==="off")return!0;return!1}function TD(e,t){for(let n=e;n&&n!==t;n=n.parentElement){let r=getComputedStyle(n);if(r.transform.startsWith("matrix3d")||r.transformStyle==="preserve-3d"||r.perspective!=="none"||(r.offsetPath??"none")!=="none"||xA(r))return!0}return!1}function RD(e,t){let n=[];for(let r=e;r&&r!==t;r=r.parentElement){let o=getComputedStyle(r),i=ym(o.transform);n.push(i?[i.a,i.b,i.c,i.d].map(a=>a.toFixed(3)).join(","):"1,0,0,1"),n.push(o.rotate??"none",o.scale??"none")}return n.join("|")}function MD(e){let t=getComputedStyle(e);return t.transform!=="none"||(t.translate??"none")!=="none"}function kD(e){let t=new Set;if(typeof document.getAnimations!="function")return t;for(let n of document.getAnimations()){let r=n.effect,o=r?.target;if(!we(o)||!e.contains(o))continue;(typeof r?.getKeyframes=="function"?r.getKeyframes():[]).some(a=>Object.keys(a).some(l=>_D.has(l)))&&t.add(o)}return t}function LD(e){let t=/^rgba\(.*,\s*([\d.]+)\)$/.exec(e)??/\/\s*([\d.]+)(%?)\s*\)$/.exec(e);return t?t[2]?Number(t[1])/100:Number(t[1]):1}var ND=e=>e.tagName==="IMG"||e.tagName==="CANVAS",na=32;function FD(e){if("naturalWidth"in e&&!(e.complete&&e.naturalWidth>0))return!0;try{let t=e.ownerDocument.createElement("canvas");t.width=t.height=na;let n=t.getContext("2d",{willReadFrequently:!0});if(!n)return!0;n.imageSmoothingQuality="high",n.drawImage(e,0,0,na,na);let{data:r}=n.getImageData(0,0,na,na);for(let o=3;o<r.length;o+=4)if((r[o]??0)<255)return!0;return!1}catch{return!0}}function PD(e,t,n){let r=1;for(let o=e;o&&o!==t;o=o.parentElement)r*=parseFloat(getComputedStyle(o).opacity);return r<.05?!1:r<.99?!0:ND(e)?(n.has(e)||n.set(e,FD(e)),n.get(e)===!0):!/^(VIDEO|PICTURE)$/.test(e.tagName)&&ID(e)}function ID(e){let t=getComputedStyle(e);return LD(t.backgroundColor)>=.99?!1:t.backgroundImage==="none"?!0:[...t.backgroundImage.matchAll(/rgba\([^)]*,\s*([\d.]+)\)/g)].some(n=>Number(n[1])<.99)}function MA(e,t){return!e||!t||!e.width||!t.width?0:Math.max(Math.abs(e.left-t.left),Math.abs(e.top-t.top),Math.abs(e.right-t.right),Math.abs(e.bottom-t.bottom))}function DD(e,t){let n=e.map(Sm);e.forEach((o,i)=>o.setAttribute("style",t[i]??""));let r=e.map(o=>o.getBoundingClientRect());return e.forEach((o,i)=>o.setAttribute("style",n[i]??"")),r}function Jl({scene:e,durationSeconds:t,fps:n,seek:r,onStep:o}){r(0);let i=[...e.querySelectorAll("*")].filter(we),a=new Set(kD(e)),l=i.map(Sm),s=i.map(I=>I.getBoundingClientRect()),c=Math.max(1,Math.round(t*n)),d=Math.min(c,wD),f=c/d,m=new Set,p=new Set,b=new Map,y=new Map,x=new Set,E=I=>{b.set(I,Math.max(b.get(I)??0,TA(I)));let Y=RD(I,e),W=y.get(I);W===void 0?y.set(I,Y):W!==Y&&x.add(I),MD(I)||x.add(I)},v=new Set,_=new Map,U=e.getBoundingClientRect(),G=U.width*U.height*AD,R=[];for(let I=0;I<=d;I++){I>0&&r(I/d*t),o?.(I,d);let Y=[],W=[];i.forEach((F,z)=>{!a.has(F)&&Sm(F)===l[z]||(a.has(F)||W.push(z),a.add(F),Y[z]=F.getBoundingClientRect())});let X=W.filter(F=>MA(s[F],Y[F])/f>=RA),ie=DD(X.map(F=>i[F]),X.map(F=>l[F]??""));if(X.forEach((F,z)=>{R[F]=ie[z]}),Y.forEach((F,z)=>{let O=i[z];!O||MA(R[z],F)/f<RA||(m.has(O)||E(O),m.add(O),F&&G>0&&F.width*F.height>=G&&PD(O,e,_)&&v.add(O))}),I%10===0||I===d)for(let F of m)TD(F,e)&&p.add(F),E(F);R=Y}let D=i.filter(I=>m.has(I)&&!p.has(I)&&!v.has(I)&&!CD(I,e)),T=D.filter(I=>!D.some(Y=>Y!==I&&Y.contains(I))),H=T.length>0&&T.every(I=>!x.has(I));return{movers:T,dynamic:a,pads:b,translationOnly:H}}var OD=e=>Math.atan2(Math.sin(e),Math.cos(e)),kA=(e,t,n)=>[e.a*(t/2)+e.c*(n/2)+e.e,e.b*(t/2)+e.d*(n/2)+e.f];function LA(e,t,n){let{w:r,h:o,now:i,taps:a}=e,l=i.a*i.d-i.b*i.c,s=Math.sqrt(Math.abs(l));if(a.length<2||!(s>1e-4))return null;let c=kA(i,r,o),d=a.map(W=>kA(W,r,o)),f=d.map(([W,X])=>{let ie=W-c[0],F=X-c[1];return[(i.d*ie-i.c*F)/l,(-i.b*ie+i.a*F)/l]}),m=0;for(let W=1;W<d.length;W++)m+=Math.hypot((d[W]?.[0]??0)-(d[W-1]?.[0]??0),(d[W]?.[1]??0)-(d[W-1]?.[1]??0));let p=m/(d.length-1),b=Math.max(...a.map(W=>Math.abs(OD(Math.atan2(W.b,W.a)-Math.atan2(i.b,i.a))))),y=Math.max(...a.map(W=>Math.abs(Math.log(Math.sqrt(Math.abs(W.a*W.d-W.b*W.c))/s)))),x=Math.sqrt(r*o)*s,E=Math.min(24*(n/1920),.29*Math.min(n/4,x/2)*(b+y)),v=f[0]??[0,0],_=f[f.length-1]??[0,0],U=Math.hypot(_[0]-v[0],_[1]-v[1])||1,G=.35*p/s,R=[Math.hypot(E/s,G*Math.abs(_[0]-v[0])/U),Math.hypot(E/s,G*Math.abs(_[1]-v[1])/U)];if(m<.5&&Math.max(...R)*s<.35)return null;let D=f.map(W=>W[0]),T=f.map(W=>W[1]),H=t+3*Math.max(...R)+2,I=Math.min(0,...D)-H,Y=Math.min(0,...T)-H;return{offsets:f,sigma:R,region:{x:I,y:Y,w:r+Math.max(0,...D)+H-I,h:o+Math.max(0,...T)+H-Y}}}function Ql(e){let{reader:t,shutterSeconds:n,t:r,reads:o,seek:i}=e,a=e.movers.filter(d=>typeof d.checkVisibility!="function"||d.checkVisibility({visibilityProperty:!0}));if(a.length===0||n<=0)return{els:[],frames:[]};let l=r-n/2,s=a.map(()=>[]);for(let d=0;d<o;d++)i(Math.max(0,l+d/(o-1)*n)),t.reset(),a.forEach((f,m)=>s[m]?.push(t.pose(f)));i(r),t.reset();let c=a.map((d,f)=>{let m=e.pads?.get(d)??0,p=d.offsetWidth+2*m,b=d.offsetHeight+2*m,y=E=>ea(E,-m,-m),x=(s[f]??[yo]).map(y);return{w:p,h:b,now:y(t.pose(d)),taps:e.taps===null?gA(x,p,b,e.frameW,e.frameH):Kl(x,e.taps)}});return t.reset(),{els:a,frames:c}}var FA="http://www.w3.org/2000/svg",PA=32,HD=4,GD=8,IA="hf-mb",BD=new RegExp(`\\s*url\\("?#${IA}-\\d+"?\\)`,"g");function ra(e,t,n){let r=document.createElementNS(FA,t);for(let[o,i]of Object.entries(n))r.setAttribute(o,i);return e.append(r),r}function UD(e,t,n){let r=`${IA}-${t}`,o=ra(e,"filter",{id:r,"color-interpolation-filters":"sRGB",filterUnits:"userSpaceOnUse"}),i=Array.from({length:PA},(d,f)=>ra(o,"feOffset",{in:"SourceGraphic",result:`s${f}`})),a=i.map((d,f)=>`s${f}`);for(let d=0;a.length>1;d++){let f=[];for(let m=0;m<a.length;m+=2){let p=`l${d}-${m/2}`;ra(o,"feComposite",{operator:"arithmetic",in:a[m]??"",in2:a[m+1]??"",k1:"0",k2:"0.5",k3:"0.5",k4:"0",result:p}),f.push(p)}a=f}let l=ra(o,"feGaussianBlur",{in:a[0]??"",stdDeviation:"0"}),s=n.style.filter;n.style.filter="";let c=getComputedStyle(n).filter;return n.style.filter=s,{filter:o,offsets:i,soften:l,url:`url(#${r})`,css:c&&c!=="none"?c:""}}function WD(e,t){t.offsets.forEach(([a,l],s)=>{e.offsets[s]?.setAttribute("dx",a.toFixed(2)),e.offsets[s]?.setAttribute("dy",l.toFixed(2))}),e.soften.setAttribute("stdDeviation",`${t.sigma[0].toFixed(3)} ${t.sigma[1].toFixed(3)}`);let{x:n,y:r,w:o,h:i}=t.region;e.filter.setAttribute("x",n.toFixed(1)),e.filter.setAttribute("y",r.toFixed(1)),e.filter.setAttribute("width",o.toFixed(1)),e.filter.setAttribute("height",i.toFixed(1))}var NA=e=>e.style.filter.replace(BD,"").trim();function Em(e,t,n){let{root:r}=e,o=Number(r.getAttribute("data-width"))||r.offsetWidth,i=Number(r.getAttribute("data-height"))||r.offsetHeight,a=W=>e.seek(W,!t.events),l=null,s=[],c=new Map,d=null,f,m=0,p=0,b=0,y=!1,x=!1,E=new Map,v=new Set;function _(W){f=e.timeline();let X=performance.now(),ie=Jl({scene:r,durationSeconds:e.durationSeconds(),fps:e.fps,seek:a});a(W),s=ie.movers,c=ie.pads,d=Xl(r,ie.dynamic),m=Math.round(performance.now()-X)}function U(W){let X=NA(W);X?W.style.filter=X:W.style.removeProperty("filter"),v.delete(W)}function G(){for(let W of[...v])U(W)}function R(W){let X=E.get(W);return X||(l||(l=document.createElementNS(FA,"svg"),l.setAttribute("width","0"),l.setAttribute("height","0"),l.setAttribute("aria-hidden","true"),l.setAttribute("data-hf-ignore",""),l.style.cssText="position:absolute;left:0;top:0;pointer-events:none",ra(l,"defs",{}),r.append(l)),X=UD(l.querySelector("defs")??l,E.size,W),E.set(W,X),X)}function D(W,X){let ie=R(W);WD(ie,X);let F=NA(W)||ie.css;W.style.filter=F?`${F} ${ie.url}`:ie.url,v.add(W)}function T(W,X){if((!d||e.timeline()!==f)&&_(W),!d)return[];let ie=Ql({movers:s,reader:d,seek:a,t:W,reads:X?GD:HD,shutterSeconds:t.shutterDeg/360/e.fps,taps:PA,frameW:o,frameH:i}),F=[];return ie.els.forEach((z,O)=>{let N=ie.frames[O],L=N&&LA(N,c.get(z)??0,o);L&&F.push([z,L])}),F}function H(W,X){if(X&&(y=!0),x)return Promise.resolve();let ie=performance.now();try{let F=T(W,X),z=new Set(F.map(([O])=>O));for(let[O,N]of F)D(O,N);for(let O of[...v])z.has(O)||U(O);p++,b+=performance.now()-ie}catch(F){V("runtime.captureMotionBlur.filter",F),G()}return Promise.resolve()}function I(){return{state:"on",tier:"filter",reason:n?.reason??null,reasonCode:n?.code??null,movers:s.length,moverNames:s.map(W=>`${W.tagName.toLowerCase()}${W.id?`#${W.id}`:""}`),scanMs:m,shutterDeg:t.shutterDeg,frames:p,meanMs:p?Math.round(b/p*10)/10:0,failures:0,failedFrames:0}}function Y(){G(),l?.remove(),l=null,E.clear()}return{root:r,paint:H,probe:()=>((!d||e.timeline()!==f)&&_(e.now()),I()),rest:()=>y?!1:(G(),!0),arm:()=>{},finish:()=>{},teardown:Y,suspend:()=>{x=!0,Y()},report:I,busy:()=>!1,rediscover:()=>{d=null}}}function DA(e){if(e.defect?.code==="renderer-off")return"off";let t=e.form&&!e.defect;return e.fallback&&(e.tier==="filter"||!t)?"filter":t?"capture":"off"}var vm="data-hf-motion-blur-hide",qn="data-hf-motion-blur-only",xo="data-hf-motion-blur-mover",VD=4,$D=8,OA=2e3,qD=3,zD=25;function jD(e){let t=AA(a=>e.getAttribute(a));if(!t.enabled)return null;let{shutterDeg:n,samples:r,events:o,tier:i}=t;return{shutterDeg:n,samples:r,events:o,tier:i}}var GA=cA,_m=dA;function KD(e){let t=window[sA];return t?{code:"renderer-off",reason:`the renderer turned it off (${String(t)})`}:uA()?zl(e,{isAccelerated:_m,backface:iA(e)}):{code:"unsupported-browser",reason:"html-in-canvas (drawElementImage) is unavailable in this browser"}}function YD(e){let t=typeof e.className=="string"&&e.className?`.${e.className.trim().split(/\s+/).join(".")}`:"";return`${e.tagName.toLowerCase()}${e.id?`#${e.id}`:""}${t}`}function XD(e){let t=Number(e.getAttribute("data-width"))||e.offsetWidth,n=Number(e.getAttribute("data-height"))||e.offsetHeight;return{width:Math.max(1,Math.round(t)),height:Math.max(1,Math.round(n))}}function Zl(){let e=Number(window[lA]),t=e>0?e:window.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function HA(e,t,n){let r=document.createElement("canvas");return r.width=Math.max(1,Math.round(e*Zl())),r.height=Math.max(1,Math.round(t*Zl())),r.setAttribute("data-hf-ignore",""),r.setAttribute("data-hf-motion-blur",n),r.style.cssText=`position:absolute;left:0;top:0;width:${e}px;height:${t}px;`,r}function JD(e,t,n){let{root:r}=e,{width:o,height:i}=XD(r),a=HA(o,i,"capture"),l=HA(o,i,"output");l.style.pointerEvents="none",Vl(a,n);let s=a.getContext("2d"),c=l.getContext("2d");if(!s||!c)throw new Error("capture motion blur: no 2D context");let d=s,f=c,m=Zl(),p=xm(o,i,m),b=document.createElement("style");b.setAttribute("data-hf-ignore",""),b.textContent=[`[${vm}] { opacity: 0 !important; }`,`[${qn}] { background: none !important; border-color: transparent !important; box-shadow: none !important; outline-color: transparent !important; }`,`[${qn}]::before, [${qn}]::after, [${qn}] *:not([${xo}], [${xo}] *) { visibility: hidden !important; }`,`[${qn}] [${xo}] { visibility: visible !important; }`].join(`
|
|
639
|
-
`);let y=[],x=new Map,E=null,v=null,_=null,U=0,G=0,R=0,D=null,T=null,H=!1,I=[],Y=0,W=0,X,ie=null,F=()=>!1,z=!1,O=new Set,N=!1,L=!1;function w(re){(e.ignoreMutations??(de=>de()))(re),e.seek(e.now(),!0)}function k(){N||(w(()=>{r.before(a),a.append(r),$l(r,n),a.after(l),document.head.append(b)}),f.setTransform(1,0,0,1,0,0),f.clearRect(0,0,l.width,l.height),N=!0)}function K(){_?.release(),_=null,v&&(Q(v),v.settle(),v=null),N&&(N=!1,w(()=>{b.remove(),Dv(r,n),a.before(r),a.remove(),l.remove()}))}let oe=re=>e.seek(re,!t.events);function ge(re){X=e.timeline();let de=e.durationSeconds(),Re=aA(r,_m),wt=performance.now(),nt=Jl({scene:r,durationSeconds:de,fps:e.fps,seek:oe,onStep:(mn,pn)=>Re.sample(mn,pn,mn/pn*de)});oe(re),ie=Re.result(),F=Re.facesNow,y=nt.movers,x=nt.pads,z=nt.translationOnly,E=Xl(r,nt.dynamic),W=Math.round(performance.now()-wt)}function Ee(re,de){return E?Ql({movers:y,reader:E,seek:oe,t:re,reads:de,shutterSeconds:t.shutterDeg/360/e.fps,taps:t.samples,pads:x,frameW:o,frameH:i}):{els:[],frames:[]}}let $=()=>{d.reset(),d.drawElementImage(r,0,0)},Q=re=>{r.removeAttribute(qn);for(let de of re.els)de.removeAttribute(vm),de.removeAttribute(xo)},Z=re=>{r.setAttribute(qn,""),re.els.forEach((de,Re)=>re.kept[Re]&&de.setAttribute(xo,""))},me=re=>{r.removeAttribute(qn),re.els.forEach((de,Re)=>{de.removeAttribute(xo),re.kept[Re]&&de.setAttribute(vm,"")})};function he(re=!1){let de=v;if(!de||D||!de.armed)return;let Re=performance.now(),wt=!0;try{wt=ne(de,re),G=0}catch(nt){le(nt)}if(de.ms+=performance.now()-Re,!wt&&!D){a.requestPaint();return}I.push(Y+de.ms),I.length>600&&I.shift(),te(de)}function le(re){G++,V("runtime.captureMotionBlur.compose",re),ke(re instanceof Error?re.message:String(re)),L?K():G>=qD&&ut(`capture failed ${G} times in a row`,"capture-failures",!0)}function ne(re,de){$();try{if(re.phase==="sharp")return p.draw(a,f,re.frames,re.kept),!0;if(de)throw new Error(`the ${re.phase} capture did not arrive`);return re.phase==="movers"?(p.crop(a,re.frames,re.kept),me(re),re.phase="background",!1):(p.draw(a,f,re.frames,re.kept),!0)}finally{d.reset()}}function te(re){Q(re),v===re&&(v=null),re.settle();let de=_;_=null,de&&!D?Cr(de.t,de.engineMode).then(de.release):de?.release()}let Ue=()=>he();function ke(re){R++,R%zD===1&&globalThis.console.info(`[motion-blur] capture failed (${R} so far): ${re}`)}function Te(re){ke(`no paint within ${OA} ms`),K(),te(re)}a.addEventListener("paint",Ue);function ut(re,de,Re=!1){D||(D=re,T=de,H=Re,globalThis.console.warn(`[motion-blur] off: ${re}`),_r())}function _r(){a.removeEventListener("paint",Ue),K()}function ma(){!D||H||(D=null,T=null,E=null,a.addEventListener("paint",Ue))}function ko(){D&&e.timeline()!==X&&ma()}function Lo(re,de){if(ko(),D)return Promise.resolve();if(de&&(L=!0),!L&&document.visibilityState==="hidden")return K(),Promise.resolve();if(v&&!de){let Re=_;return new Promise(wt=>{_={t:re,engineMode:de,release:()=>{Re?.release(),wt()}}})}return Cr(re,de)}function bu(){let re=Zl();if(re!==m){m=re;for(let de of[a,l])de.width=Math.max(1,Math.round(o*m)),de.height=Math.max(1,Math.round(i*m));p=xm(o,i,m)}}function pa(){return D?{code:T??"capture-failures",reason:D}:t.tier==="auto"&&E&&z&&QD()?{code:"translation-only",reason:"every mover only translates, which the filter tier draws as well and far cheaper"}:null}function ha(re){return(!E||e.timeline()!==X)&&ge(re),ie&&ut(ie.reason,ie.code),D!==null}function yu(re){return K(),R++,O.has(re.code)||(O.add(re.code),globalThis.console.info(`[motion-blur] sharp frame: ${re.code} appeared after a clean scan`)),Promise.resolve()}function Cr(re,de){try{if(bu(),ha(re)||pa())return Promise.resolve();if(y.length===0)return K(),Promise.resolve();let Re=zl(r,{isAccelerated:_m,backface:F()});if(Re)return yu(Re);k();let wt=performance.now(),nt=Ee(re,de?$D:VD),mn=p.plan(nt.frames);return Y=performance.now()-wt,v&&te(v),new Promise(pn=>{let No=++U,je,bt=()=>{je=setTimeout(()=>{v?.seq===No?Te(v):pn()},OA)};v={seq:No,els:nt.els,frames:nt.frames,kept:mn,phase:mn.some(Boolean)?"movers":"sharp",armed:!de,startTimer:bt,ms:0,settle:()=>{clearTimeout(je),pn()}},v.phase==="movers"&&!de&&Z(v),!de&&(bt(),a.requestPaint())})}catch(Re){return V("runtime.captureMotionBlur.paint",Re),ut(Re instanceof Error?Re.message:String(Re),"capture-failures",!0),Promise.resolve()}}function tt(){let re=I.length?I.reduce((de,Re)=>de+Re,0)/I.length:0;return{state:D?"off":"on",tier:D?null:"capture",reason:D,reasonCode:T,movers:y.length,moverNames:y.map(YD),scanMs:W,shutterDeg:t.shutterDeg,frames:I.length,meanMs:Math.round(re*10)/10,failures:G,failedFrames:R}}function ga(){return ko(),D||ha(e.now()),tt()}return{root:r,paint:Lo,probe:ga,rest:()=>L?!1:(K(),!0),arm:()=>{!v||v.armed||(v.armed=!0,v.phase==="movers"&&Z(v),v.startTimer(),a.requestPaint())},finish:()=>{v&&(v.armed=!0),he(!0)},teardown:_r,suspend:K,handOff:pa,report:tt,busy:()=>v!==null,rediscover:()=>{E=null,ma()}}}var Me=null,Cm=null,Tm=null,eu=!1,Mm=!0,QD=()=>Mm,BA=!1,Am=null,wm=null;function UA(e){let t=jD(e.root),n=window;if(Me&&(Me.root!==e.root||!t)&&(Me.teardown(),Me=null,delete n.__hfMotionBlur),!!t){if(Me&&eu&&(Me.teardown(),Me=null,eu=!1),Me){Me.rediscover();return}Cm=e,Tm=t,eO(e,t,n),rO(n,t)}}var ZD={code:"tier-attribute",reason:'data-motion-blur-tier="filter"'};function eO(e,t,n){let r=go(),o=KD(e.root),i=DA({tier:t.tier,form:r!==null,defect:o,fallback:Mm});i==="filter"?tO(e,t,t.tier==="filter"?ZD:o):i==="capture"&&r?Me=JD(e,t,r):nO(n,t,o)}function tO(e,t,n){let r=n??{code:"unsupported-browser",reason:"html-in-canvas (drawElementImage) is unavailable in this browser"};Me=Em(e,t,r),eu=!0,globalThis.console.info(`[motion-blur] filter fallback: ${r.reason} (Chrome ${pm()??"unknown"})`)}function nO(e,t,n){globalThis.console.info(`[motion-blur] off: ${n?.reason??null} (Chrome ${pm()??"unknown"})`);let r=()=>Rm(t,n);e.__hfMotionBlur={report:r,probe:r,suspend:qA}}function Rm(e,t){return{state:"off",tier:null,reason:t?.reason??null,reasonCode:t?.code??null,movers:0,moverNames:[],scanMs:0,shutterDeg:e.shutterDeg,frames:0,meanMs:0,failures:0,failedFrames:0}}function rO(e,t){Me&&(e.__hfMotionBlur={report:()=>Me?.report()??Rm(t,null),probe:()=>(Me?.probe(),WA(),Me?.probe()??Rm(t,null)),suspend:qA})}function WA(){let e=Me?.handOff?.();!Mm||!Me||!e||!Cm||!Tm||(Me.teardown(),Me=Em(Cm,Tm,e),eu=!0,globalThis.console.info(`[motion-blur] filter fallback: ${e.reason}`))}function So(e,t){if(!Me||BA)return null;let n=t?.engineMode===!0;if(!n&&!t?.playing&&Me.rest())return null;let r=Me.paint(e,n);if(Me.handOff?.()){if(WA(),!n&&!t?.playing&&Me.rest())return null;r=Me.paint(e,n)}return n&&Me.busy()&&oO(),r}function VA(){return Me?.busy()??!1}function $A(){Me?.arm()}function oO(){let e=window,t=e.__hf_page_composite_resolve;t!==wm&&(Am=typeof t=="function"?t:null,wm=()=>(Am&&Am(),Me?.finish(),e.__hf_page_composite_pending=!1,!0),e.__hf_page_composite_resolve=wm),e.__hf_page_composite_pending=!0}function qA(){BA=!0,Me?.suspend()}var iO=500,aO=33,sO=3,tu=class{constructor(t){Se(this,"_baseTime",0);Se(this,"_playStartMs",null);Se(this,"_rate",1);Se(this,"_duration",1/0);Se(this,"_playStart",0);Se(this,"_playEnd",1/0);Se(this,"_playHold",1/0);Se(this,"_nowMs");Se(this,"_audioSource",null);Se(this,"_lastReadMs",null);Se(this,"_lastNow",0);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:r=this._elementTimeNeverBehind(this._audioSource),r!==null){let o=Math.min(r,this.getEnd());return this._baseTime=Math.max(0,o),this._playStartMs=this._nowMs(),this._lastReadMs=null,this._lastNow=this._baseTime,this._baseTime}}this._applyStallCorrection();let t=(this._nowMs()-this._playStartMs)/1e3,n=this._baseTime+t*this._rate;return this._lastNow=Math.max(0,Math.min(n,this.getEnd())),this._lastNow}_elementTimeNeverBehind(t){let{el:n,compositionStart:r,mediaStart:o,rate:i}=t;if(n.paused||!Number.isFinite(n.currentTime))return null;if(n.seeking)return this._lastNow;let a=i??1,l=cr(a,n.currentTime-o)+r;return l>=this._lastNow?l:this._heldTimeWhenBehind(n,this._lastNow-l,a)}_heldTimeWhenBehind(t,n,r){return t.loop&&n>cr(r,t.duration)/2?null:t.readyState<sO||n<=qc?this._lastNow:null}_applyStallCorrection(){if(this._playStartMs===null)return;let t=this._nowMs();if(this._lastReadMs!==null){let n=t-this._lastReadMs;n>iO&&(this._playStartMs+=n-aO)}this._lastReadMs=t}play(){return this._playStartMs!==null||this._baseTime>=this.getEnd()?!1:(this._playStartMs=this._nowMs(),this._lastNow=this._baseTime,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._lastNow=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}setPlayRange(t,n,r){this._playStart=Number.isFinite(t)&&t>0?t:0,this._playEnd=n!==null&&Number.isFinite(n)&&n>this._playStart?n:1/0,this._playHold=O0(this._playStart,this._playEnd,r)}getPlayStart(){return this._playStart}getEnd(){return Math.min(this._duration,this._playEnd)}getStopTime(){return this._playEnd<this._duration?this._playHold:this.getEnd()}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}audioElement(){return this._audioSource&&"el"in this._audioSource?this._audioSource.el: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(){let t=this.now();return t>=this.getEnd()||this._playStartMs===null&&t>=this.getStopTime()}};var lO=100,uO=8,cO=4096,km=e=>e;function dO(e,t,n){return!Ec(e)&&t==="linear"&&!n}function fO(e){let t=Math.ceil(e*lO);return Math.min(cO,Math.max(uO,t))}function mO(e,t,n,r,o){let{scheduledAt:i,elapsed:a,rate:l}=r,s=o??km,c=v=>i+(v-a)/l,d=e.points[t],f=e.points[t+1],m=c(f.t);if(m<=i)return null;let p=Math.max(i,c(d.t)),b=m-p;if(b<=0)return null;if(dO(d,n,o))return{kind:"ramp",time:m,value:s(f.v)};let y=fO(b),x=qg(e,Math.max(d.t,a),f.t,y,n),E=new Float32Array(y);for(let v=0;v<y;v+=1)E[v]=s(x[v]??0);return{kind:"curve",time:p,duration:b,values:E}}function pO(e,t,n,r){let o=[];for(let a=0;a+1<e.points.length;a+=1){let l=mO(e,a,t,n,r);l&&o.push(l)}let i=o[0];return i?.kind==="curve"&&i.time<=n.scheduledAt||o.unshift({kind:"set",time:n.scheduledAt,value:(r??km)(Ot(e,n.elapsed,t))}),o}function hO(e,t){e.cancelScheduledValues(0);for(let n of t)n.kind==="set"?e.setValueAtTime(n.value,n.time):n.kind==="ramp"?e.linearRampToValueAtTime(n.value,n.time):(e.setValueAtTime(n.values[0]??0,n.time),e.linearRampToValueAtTime(n.values[n.values.length-1]??0,n.time+n.duration))}function gO(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{hO(e,t);return}}function Eo(e){for(let t of e)t.param.cancelScheduledValues(0)}function vo(e,t){for(let n of e)typeof n.param.cancelAndHoldAtTime=="function"?n.param.cancelAndHoldAtTime(t):n.param.cancelScheduledValues(t)}function Lm(e,t,n,r){if(t.points.length!==0)for(let o of e){if(Eo([o]),$g(t)){let i=(o.map??km)(t.points[0].v);o.param.setValueAtTime(i,r.scheduledAt);continue}gO(o.param,pO(t,n,r,o.map))}}function zA(e,t,n,r,o){let i=new Map(n.filter(l=>l.id).map(l=>[l.id,l.handle])),a=[];for(let l of e.lanes){let s=ei(l.target);if(!s)continue;let c=s.kind==="preset"?o?.[s.presetId]:s.kind==="fx"?i.get(s.nodeId)?.automation?.[s.param]:void 0;if(!c||c.length===0)continue;let d=vc(l.target,t);d&&(Lm(c,l,d.scale,r),a.push(...c))}return a}function jA(e){return e.lanes.find(t=>t.target===Or)??null}var KA=`
|
|
639
|
+
`);let y=[],x=new Map,E=null,v=null,_=null,U=0,G=0,R=0,D=null,T=null,H=!1,I=[],Y=0,W=0,X,ie=null,F=()=>!1,z=!1,O=new Set,N=!1,L=!1;function w(re){(e.ignoreMutations??(de=>de()))(re),e.seek(e.now(),!0)}function k(){N||(w(()=>{r.before(a),a.append(r),$l(r,n),a.after(l),document.head.append(b)}),f.setTransform(1,0,0,1,0,0),f.clearRect(0,0,l.width,l.height),N=!0)}function K(){_?.release(),_=null,v&&(Q(v),v.settle(),v=null),N&&(N=!1,w(()=>{b.remove(),Dv(r,n),a.before(r),a.remove(),l.remove()}))}let oe=re=>e.seek(re,!t.events);function ge(re){X=e.timeline();let de=e.durationSeconds(),Re=aA(r,_m),wt=performance.now(),nt=Jl({scene:r,durationSeconds:de,fps:e.fps,seek:oe,onStep:(mn,pn)=>Re.sample(mn,pn,mn/pn*de)});oe(re),ie=Re.result(),F=Re.facesNow,y=nt.movers,x=nt.pads,z=nt.translationOnly,E=Xl(r,nt.dynamic),W=Math.round(performance.now()-wt)}function Ee(re,de){return E?Ql({movers:y,reader:E,seek:oe,t:re,reads:de,shutterSeconds:t.shutterDeg/360/e.fps,taps:t.samples,pads:x,frameW:o,frameH:i}):{els:[],frames:[]}}let $=()=>{d.reset(),d.drawElementImage(r,0,0)},Q=re=>{r.removeAttribute(qn);for(let de of re.els)de.removeAttribute(vm),de.removeAttribute(xo)},Z=re=>{r.setAttribute(qn,""),re.els.forEach((de,Re)=>re.kept[Re]&&de.setAttribute(xo,""))},me=re=>{r.removeAttribute(qn),re.els.forEach((de,Re)=>{de.removeAttribute(xo),re.kept[Re]&&de.setAttribute(vm,"")})};function he(re=!1){let de=v;if(!de||D||!de.armed)return;let Re=performance.now(),wt=!0;try{wt=ne(de,re),G=0}catch(nt){le(nt)}if(de.ms+=performance.now()-Re,!wt&&!D){a.requestPaint();return}I.push(Y+de.ms),I.length>600&&I.shift(),te(de)}function le(re){G++,V("runtime.captureMotionBlur.compose",re),ke(re instanceof Error?re.message:String(re)),L?K():G>=qD&&ut(`capture failed ${G} times in a row`,"capture-failures",!0)}function ne(re,de){$();try{if(re.phase==="sharp")return p.draw(a,f,re.frames,re.kept),!0;if(de)throw new Error(`the ${re.phase} capture did not arrive`);return re.phase==="movers"?(p.crop(a,re.frames,re.kept),me(re),re.phase="background",!1):(p.draw(a,f,re.frames,re.kept),!0)}finally{d.reset()}}function te(re){Q(re),v===re&&(v=null),re.settle();let de=_;_=null,de&&!D?Cr(de.t,de.engineMode).then(de.release):de?.release()}let We=()=>he();function ke(re){R++,R%zD===1&&globalThis.console.info(`[motion-blur] capture failed (${R} so far): ${re}`)}function Te(re){ke(`no paint within ${OA} ms`),K(),te(re)}a.addEventListener("paint",We);function ut(re,de,Re=!1){D||(D=re,T=de,H=Re,globalThis.console.warn(`[motion-blur] off: ${re}`),_r())}function _r(){a.removeEventListener("paint",We),K()}function ma(){!D||H||(D=null,T=null,E=null,a.addEventListener("paint",We))}function ko(){D&&e.timeline()!==X&&ma()}function Lo(re,de){if(ko(),D)return Promise.resolve();if(de&&(L=!0),!L&&document.visibilityState==="hidden")return K(),Promise.resolve();if(v&&!de){let Re=_;return new Promise(wt=>{_={t:re,engineMode:de,release:()=>{Re?.release(),wt()}}})}return Cr(re,de)}function bu(){let re=Zl();if(re!==m){m=re;for(let de of[a,l])de.width=Math.max(1,Math.round(o*m)),de.height=Math.max(1,Math.round(i*m));p=xm(o,i,m)}}function pa(){return D?{code:T??"capture-failures",reason:D}:t.tier==="auto"&&E&&z&&QD()?{code:"translation-only",reason:"every mover only translates, which the filter tier draws as well and far cheaper"}:null}function ha(re){return(!E||e.timeline()!==X)&&ge(re),ie&&ut(ie.reason,ie.code),D!==null}function yu(re){return K(),R++,O.has(re.code)||(O.add(re.code),globalThis.console.info(`[motion-blur] sharp frame: ${re.code} appeared after a clean scan`)),Promise.resolve()}function Cr(re,de){try{if(bu(),ha(re)||pa())return Promise.resolve();if(y.length===0)return K(),Promise.resolve();let Re=zl(r,{isAccelerated:_m,backface:F()});if(Re)return yu(Re);k();let wt=performance.now(),nt=Ee(re,de?$D:VD),mn=p.plan(nt.frames);return Y=performance.now()-wt,v&&te(v),new Promise(pn=>{let No=++U,je,bt=()=>{je=setTimeout(()=>{v?.seq===No?Te(v):pn()},OA)};v={seq:No,els:nt.els,frames:nt.frames,kept:mn,phase:mn.some(Boolean)?"movers":"sharp",armed:!de,startTimer:bt,ms:0,settle:()=>{clearTimeout(je),pn()}},v.phase==="movers"&&!de&&Z(v),!de&&(bt(),a.requestPaint())})}catch(Re){return V("runtime.captureMotionBlur.paint",Re),ut(Re instanceof Error?Re.message:String(Re),"capture-failures",!0),Promise.resolve()}}function tt(){let re=I.length?I.reduce((de,Re)=>de+Re,0)/I.length:0;return{state:D?"off":"on",tier:D?null:"capture",reason:D,reasonCode:T,movers:y.length,moverNames:y.map(YD),scanMs:W,shutterDeg:t.shutterDeg,frames:I.length,meanMs:Math.round(re*10)/10,failures:G,failedFrames:R}}function ga(){return ko(),D||ha(e.now()),tt()}return{root:r,paint:Lo,probe:ga,rest:()=>L?!1:(K(),!0),arm:()=>{!v||v.armed||(v.armed=!0,v.phase==="movers"&&Z(v),v.startTimer(),a.requestPaint())},finish:()=>{v&&(v.armed=!0),he(!0)},teardown:_r,suspend:K,handOff:pa,report:tt,busy:()=>v!==null,rediscover:()=>{E=null,ma()}}}var Me=null,Cm=null,Tm=null,eu=!1,Mm=!0,QD=()=>Mm,BA=!1,Am=null,wm=null;function UA(e){let t=jD(e.root),n=window;if(Me&&(Me.root!==e.root||!t)&&(Me.teardown(),Me=null,delete n.__hfMotionBlur),!!t){if(Me&&eu&&(Me.teardown(),Me=null,eu=!1),Me){Me.rediscover();return}Cm=e,Tm=t,eO(e,t,n),rO(n,t)}}var ZD={code:"tier-attribute",reason:'data-motion-blur-tier="filter"'};function eO(e,t,n){let r=go(),o=KD(e.root),i=DA({tier:t.tier,form:r!==null,defect:o,fallback:Mm});i==="filter"?tO(e,t,t.tier==="filter"?ZD:o):i==="capture"&&r?Me=JD(e,t,r):nO(n,t,o)}function tO(e,t,n){let r=n??{code:"unsupported-browser",reason:"html-in-canvas (drawElementImage) is unavailable in this browser"};Me=Em(e,t,r),eu=!0,globalThis.console.info(`[motion-blur] filter fallback: ${r.reason} (Chrome ${pm()??"unknown"})`)}function nO(e,t,n){globalThis.console.info(`[motion-blur] off: ${n?.reason??null} (Chrome ${pm()??"unknown"})`);let r=()=>Rm(t,n);e.__hfMotionBlur={report:r,probe:r,suspend:qA}}function Rm(e,t){return{state:"off",tier:null,reason:t?.reason??null,reasonCode:t?.code??null,movers:0,moverNames:[],scanMs:0,shutterDeg:e.shutterDeg,frames:0,meanMs:0,failures:0,failedFrames:0}}function rO(e,t){Me&&(e.__hfMotionBlur={report:()=>Me?.report()??Rm(t,null),probe:()=>(Me?.probe(),WA(),Me?.probe()??Rm(t,null)),suspend:qA})}function WA(){let e=Me?.handOff?.();!Mm||!Me||!e||!Cm||!Tm||(Me.teardown(),Me=Em(Cm,Tm,e),eu=!0,globalThis.console.info(`[motion-blur] filter fallback: ${e.reason}`))}function So(e,t){if(!Me||BA)return null;let n=t?.engineMode===!0;if(!n&&!t?.playing&&Me.rest())return null;let r=Me.paint(e,n);if(Me.handOff?.()){if(WA(),!n&&!t?.playing&&Me.rest())return null;r=Me.paint(e,n)}return n&&Me.busy()&&oO(),r}function VA(){return Me?.busy()??!1}function $A(){Me?.arm()}function oO(){let e=window,t=e.__hf_page_composite_resolve;t!==wm&&(Am=typeof t=="function"?t:null,wm=()=>(Am&&Am(),Me?.finish(),e.__hf_page_composite_pending=!1,!0),e.__hf_page_composite_resolve=wm),e.__hf_page_composite_pending=!0}function qA(){BA=!0,Me?.suspend()}var iO=500,aO=33,sO=3,tu=class{constructor(t){Se(this,"_baseTime",0);Se(this,"_playStartMs",null);Se(this,"_rate",1);Se(this,"_duration",1/0);Se(this,"_playStart",0);Se(this,"_playEnd",1/0);Se(this,"_playHold",1/0);Se(this,"_nowMs");Se(this,"_audioSource",null);Se(this,"_lastReadMs",null);Se(this,"_lastNow",0);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:r=this._elementTimeNeverBehind(this._audioSource),r!==null){let o=Math.min(r,this.getEnd());return this._baseTime=Math.max(0,o),this._playStartMs=this._nowMs(),this._lastReadMs=null,this._lastNow=this._baseTime,this._baseTime}}this._applyStallCorrection();let t=(this._nowMs()-this._playStartMs)/1e3,n=this._baseTime+t*this._rate;return this._lastNow=Math.max(0,Math.min(n,this.getEnd())),this._lastNow}_elementTimeNeverBehind(t){let{el:n,compositionStart:r,mediaStart:o,rate:i}=t;if(n.paused||!Number.isFinite(n.currentTime))return null;if(n.seeking)return this._lastNow;let a=i??1,l=cr(a,n.currentTime-o)+r;return l>=this._lastNow?l:this._heldTimeWhenBehind(n,this._lastNow-l,a)}_heldTimeWhenBehind(t,n,r){return t.loop&&n>cr(r,t.duration)/2?null:t.readyState<sO||n<=qc?this._lastNow:null}_applyStallCorrection(){if(this._playStartMs===null)return;let t=this._nowMs();if(this._lastReadMs!==null){let n=t-this._lastReadMs;n>iO&&(this._playStartMs+=n-aO)}this._lastReadMs=t}play(){return this._playStartMs!==null||this._baseTime>=this.getEnd()?!1:(this._playStartMs=this._nowMs(),this._lastNow=this._baseTime,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._lastNow=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}setPlayRange(t,n,r){this._playStart=Number.isFinite(t)&&t>0?t:0,this._playEnd=n!==null&&Number.isFinite(n)&&n>this._playStart?n:1/0,this._playHold=O0(this._playStart,this._playEnd,r)}getPlayStart(){return this._playStart}getEnd(){return Math.min(this._duration,this._playEnd)}getStopTime(){return this._playEnd<this._duration?this._playHold:this.getEnd()}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}audioElement(){return this._audioSource&&"el"in this._audioSource?this._audioSource.el: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(){let t=this.now();return t>=this.getEnd()||this._playStartMs===null&&t>=this.getStopTime()}};var lO=100,uO=8,cO=4096,km=e=>e;function dO(e,t,n){return!Ec(e)&&t==="linear"&&!n}function fO(e){let t=Math.ceil(e*lO);return Math.min(cO,Math.max(uO,t))}function mO(e,t,n,r,o){let{scheduledAt:i,elapsed:a,rate:l}=r,s=o??km,c=v=>i+(v-a)/l,d=e.points[t],f=e.points[t+1],m=c(f.t);if(m<=i)return null;let p=Math.max(i,c(d.t)),b=m-p;if(b<=0)return null;if(dO(d,n,o))return{kind:"ramp",time:m,value:s(f.v)};let y=fO(b),x=qg(e,Math.max(d.t,a),f.t,y,n),E=new Float32Array(y);for(let v=0;v<y;v+=1)E[v]=s(x[v]??0);return{kind:"curve",time:p,duration:b,values:E}}function pO(e,t,n,r){let o=[];for(let a=0;a+1<e.points.length;a+=1){let l=mO(e,a,t,n,r);l&&o.push(l)}let i=o[0];return i?.kind==="curve"&&i.time<=n.scheduledAt||o.unshift({kind:"set",time:n.scheduledAt,value:(r??km)(Ot(e,n.elapsed,t))}),o}function hO(e,t){e.cancelScheduledValues(0);for(let n of t)n.kind==="set"?e.setValueAtTime(n.value,n.time):n.kind==="ramp"?e.linearRampToValueAtTime(n.value,n.time):(e.setValueAtTime(n.values[0]??0,n.time),e.linearRampToValueAtTime(n.values[n.values.length-1]??0,n.time+n.duration))}function gO(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{hO(e,t);return}}function Eo(e){for(let t of e)t.param.cancelScheduledValues(0)}function vo(e,t){for(let n of e)typeof n.param.cancelAndHoldAtTime=="function"?n.param.cancelAndHoldAtTime(t):n.param.cancelScheduledValues(t)}function Lm(e,t,n,r){if(t.points.length!==0)for(let o of e){if(Eo([o]),$g(t)){let i=(o.map??km)(t.points[0].v);o.param.setValueAtTime(i,r.scheduledAt);continue}gO(o.param,pO(t,n,r,o.map))}}function zA(e,t,n,r,o){let i=new Map(n.filter(l=>l.id).map(l=>[l.id,l.handle])),a=[];for(let l of e.lanes){let s=ei(l.target);if(!s)continue;let c=s.kind==="preset"?o?.[s.presetId]:s.kind==="fx"?i.get(s.nodeId)?.automation?.[s.param]:void 0;if(!c||c.length===0)continue;let d=vc(l.target,t);d&&(Lm(c,l,d.scale,r),a.push(...c))}return a}function jA(e){return e.lanes.find(t=>t.target===Or)??null}var KA=`
|
|
640
640
|
const TP_OS = 4;
|
|
641
641
|
const TP_HALF = 64;
|
|
642
642
|
const TP_BRANCH = 33;
|
|
@@ -1125,10 +1125,10 @@ class HfPitchshift extends AudioWorkletProcessor {
|
|
|
1125
1125
|
}
|
|
1126
1126
|
}
|
|
1127
1127
|
registerProcessor("hf-pitchshift", HfPitchshift);
|
|
1128
|
-
`+KA,Nm=new WeakMap;function Fm(e){return YA.has(e)}var YA=new WeakSet;function Pm(e){let t=Nm.get(e);return t||(t=(async()=>{if(!e.audioWorklet)throw new Error("AudioWorklet is unavailable: the page needs a secure context (https, localhost or file://)");let n=`data:text/javascript;base64,${btoa(String.fromCharCode(...new TextEncoder().encode(bO)))}`;await e.audioWorklet.addModule(n),YA.add(e)})().catch(n=>{throw Nm.delete(e),n}),Nm.set(e,t)),t}function yO(e,t,n){let r=.6+Math.max(0,Math.min(1,t))*2.6,o=Math.max(1,Math.floor(e*r)),i=new Float32Array(o),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))),c=0,d=0;for(let m=0;m<o;m++){c+=s*(l()-c);let p=c*Math.pow(1-m/o,2.5);i[m]=p,d+=p*p}let f=Math.sqrt(d);if(f>0)for(let m=0;m<o;m++)i[m]=(i[m]??0)/f;return i}var Fe=e=>typeof e=="number"?e:Number(e??0),Im=e=>e/1e3;function ZA(e,t,n,r){let o=Math.max(1,Math.round(e.sampleRate)),i=e.createBuffer(1,o,e.sampleRate),a=i.getChannelData(0);for(let c=0;c<o;c++){let d=c/o;a[c]=t==="sine"?Math.sin(2*Math.PI*d):4*Math.abs((d+.75)%1-.5)-1}let l=e.createBufferSource();l.buffer=i,l.loop=!0,l.playbackRate.value=n;let s=(r*n%1+1)%1*(o/e.sampleRate);return l.start(typeof e.currentTime=="number"?e.currentTime:0,s),l}function ew(e){try{e.stop()}catch{}e.disconnect()}function Dm(e,t){return[{param:e},{param:t,map:n=>1-n}]}function tw(e,t,n){e.gain.value=n,t.gain.value=1-n}function Om(e,t,n){return{input:e,output:e,update:t,automation:n,dispose:()=>e.disconnect()}}var xO=new Set(["peaking","highpass","lowpass"]),XA=e=>Math.pow(10,e/20),SO=(e,t)=>{let n=e.createGain(),r=o=>{n.gain.value=XA(Fe(o.gain))};return r(t),Om(n,r,{gain:[{param:n.gain,map:XA}]})};function oa(e,t){return(n,r)=>{let o=n.createBiquadFilter();o.type=e;let i=a=>{o.frequency.value=Fe(a.frequency),a.q!==void 0&&(o.Q.value=Fe(a.q)),t&&(o.gain.value=Fe(a.gain))};return i(r),Om(o,i,{frequency:[{param:o.frequency}],...xO.has(e)?{q:[{param:o.Q}]}:{},...t?{gain:[{param:o.gain}]}:{}})}}function EO(e){return(t,n)=>{let r=Math.tan(Math.PI*Fe(n.frequency)/t.sampleRate),o=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 Om(o,()=>{})}}function Ao(e,t=!1){return(n,r,o)=>{let i=new AudioWorkletNode(n,e,{processorOptions:{...r,__hfElapsed:o}});return{input:i,output:i,update:a=>i.port.postMessage({...a}),...t?{reset:()=>i.port.postMessage({__hfReset:!0})}:{},dispose:()=>{i.port.postMessage({__hfDispose:!0}),i.disconnect()}}}}var vO={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))},AO=(e,t)=>{let n=e.createWaveShaper(),r=e.createGain(),o=e.createGain();r.connect(n).connect(o);let i=a=>{let l=vO[String(a.type)]??Math.tanh,s=Math.pow(10,Fe(a.threshold)/20),c=8192,d=new Float32Array(c);for(let f=0;f<c;f++){let m=f/(c-1)*2-1;d[f]=l(m/Math.max(1e-6,s))*s}n.curve=d,n.oversample=Fe(a.oversample)>=4?"4x":Fe(a.oversample)>=2?"2x":"none",o.gain.value=Math.pow(10,Fe(a.output)/20)};return i(t),{input:r,output:o,update:i,automation:{output:[{param:o.gain,map:a=>Math.pow(10,a/20)}]},dispose:()=>{r.disconnect(),n.disconnect(),o.disconnect()}}},wO=(e,t)=>{let n=e.createGain(),r=e.createGain(),o=e.createDelay(5),i=e.createGain(),a=e.createGain(),l=e.createGain();n.connect(o),o.connect(i),i.connect(o),o.connect(a).connect(r),n.connect(l).connect(r);let s=c=>{o.delayTime.value=Math.min(5,Fe(c.time)/1e3),i.gain.value=Fe(c.feedback),tw(a,l,Fe(c.mix))};return s(t),{input:n,output:r,update:s,automation:{time:[{param:o.delayTime,map:c=>Math.min(5,Im(c))}],feedback:[{param:i.gain}],mix:Dm(a.gain,l.gain)},dispose:()=>[n,r,o,i,a,l].forEach(c=>c.disconnect())}},_O=(e,t,n)=>{let r=e.createGain(),o=e.createGain(),i=e.createDelay(.5),a=ZA(e,"sine",Fe(t.speed),n),l=e.createGain(),s=e.createGain(),c=e.createGain();a.connect(l).connect(i.delayTime),r.connect(i).connect(s).connect(o),r.connect(c).connect(o);let d=f=>{i.delayTime.value=Fe(f.delay)/1e3,l.gain.value=Fe(f.depth)/1e3,a.playbackRate.value=Fe(f.speed),tw(s,c,Fe(f.mix))};return d(t),{input:r,output:o,update:d,automation:{delay:[{param:i.delayTime,map:Im}],depth:[{param:l.gain,map:Im}],speed:[{param:a.playbackRate}],mix:Dm(s.gain,c.gain)},dispose:()=>{ew(a),[r,o,i,l,s,c].forEach(f=>f.disconnect())}}},CO=6,TO=(e,t,n)=>{let r=e.createGain(),o=e.createGain(),i=e.createGain(),a=e.createGain(),l=ZA(e,String(t.type)==="1"?"sine":"triangle",Fe(t.speed),n),s=e.createGain(),c=e.createGain(),d=e.createGain(),f=[];r.connect(i);let m=i;for(let b=0;b<CO;b++){let y=e.createBiquadFilter();y.type="allpass",y.Q.value=.7071,s.connect(y.frequency),m.connect(y),m=y,f.push(y)}l.connect(s),m.connect(c).connect(a),i.connect(d).connect(a),a.connect(o);let p=b=>{let y=1e3/Math.max(.1,Fe(b.delay));for(let x of f)x.frequency.value=y;s.gain.value=y*Fe(b.decay),l.playbackRate.value=Fe(b.speed),i.gain.value=Fe(b.in_gain),a.gain.value=Fe(b.out_gain),c.gain.value=1,d.gain.value=1};return p(t),{input:r,output:o,update:p,automation:{speed:[{param:l.playbackRate}],in_gain:[{param:i.gain}],out_gain:[{param:a.gain}]},dispose:()=>{ew(l),[r,o,i,a,s,c,d,...f].forEach(b=>b.disconnect())}}},RO=(e,t)=>{let n=e.createGain(),r=e.createGain(),o=e.createConvolver(),i=e.createGain(),a=e.createGain();o.normalize=!1,n.connect(o).connect(i).connect(r),n.connect(a).connect(r);let l="",s=c=>{let d=`${Fe(c.size)}:${Fe(c.damping)}`;if(d!==l){let f=yO(e.sampleRate,Fe(c.size),Fe(c.damping)),m=e.createBuffer(1,f.length,e.sampleRate);m.getChannelData(0).set(f),o.buffer=m,l=d}i.gain.value=Fe(c.wet),a.gain.value=Fe(c.dry)};return s(t),{input:n,output:r,update:s,automation:{wet:[{param:i.gain}],dry:[{param:a.gain}]},dispose:()=>[n,r,o,i,a].forEach(c=>c.disconnect())}},MO={"gain-node":SO,"biquad-peaking":oa("peaking",!0),"biquad-lowshelf":oa("lowshelf",!0),"biquad-highshelf":oa("highshelf",!0),"biquad-highpass":oa("highpass",!1),"biquad-lowpass":oa("lowpass",!1),"worklet-compressor":Ao("hf-compressor"),"worklet-limiter":Ao("hf-limiter"),"worklet-truepeak":Ao("hf-truepeak",!0),"worklet-gate":Ao("hf-gate"),"worklet-bitcrush":Ao("hf-bitcrush"),"worklet-pitchshift":Ao("hf-pitchshift"),waveshaper:AO,"delay-feedback":wO,"chorus-lfo":_O,"allpass-phaser":TO,convolver:RO};function nw(e){return e.nodes.some(t=>Xo(t.type)?.web.startsWith("worklet-")??!1)}function kO(e,t,n,r=0){let o=Xo(t);if(!o)throw new Error(`Unknown effect type: ${t}`);let i=Jo(t,n);if((t==="highpass"||t==="lowpass")&&String(i.poles)==="1")return EO(t)(e,i,r);let a=MO[o.web];if(!a)throw new Error(`No Web Audio builder for ${o.web}`);return a(e,i,r)}function JA(e){let t=[];for(let n of e){let r=n.fromPreset,o=t.at(-1);if(o&&o.preset===r)o.nodes.push(n);else{let i=typeof n.presetAmount=="number"?n.presetAmount:1;t.push({...r?{preset:r}:{},amount:Math.min(1,Math.max(0,i)),nodes:[n]})}}return t}function QA(e){return Qo(e).map(t=>{let n=Jo(t.type,t.params),r=n.poles!==void 0?`:${n.poles}`:"",o=String(n.poles)==="1"?`@${n.frequency}`:"",i=t.type==="phaser"?`~${n.type}`:"",a=t.fromPreset?`%${t.fromPreset}`:"",l=t.type==="truepeak"?`^${n.lookahead}`:"";return`${t.type}${r}${o}${i}${l}${a}`}).join("|")}function rw(e,t,n=0){var f;let r=e.createGain(),o=e.createGain(),i=[],a=[],l=JA(Qo(t)),s=r;for(let m of l){let p=null;if(m.preset){let b=e.createGain(),y=e.createGain(),x=e.createGain(),E=e.createGain();x.gain.value=m.amount,y.gain.value=1-m.amount,s.connect(b),b.connect(y).connect(E),p={entry:b,wet:x,dry:y,join:E},s=b}for(let b of m.nodes){let y=kO(e,b.type,b.params??{},n);s.connect(y.input),s=y.output,i.push({...b.id?{id:b.id}:{},type:b.type,handle:y})}p&&m.preset&&(s.connect(p.wet).connect(p.join),a.push({id:m.preset,...p}),s=p.join)}s.connect(o);let c=QA(t),d={};for(let m of a)(d[f=m.id]??(d[f]=[])).push(...Dm(m.wet.gain,m.dry.gain));return{input:r,output:o,presets:d,nodes:i,update(m){if(QA(m)!==c)return!1;Qo(m).forEach((b,y)=>{let x=i[y];x&&(x.handle.update(Jo(b.type,b.params)),b.id===void 0?delete x.id:x.id=b.id)});let p=0;for(let b of JA(Qo(m))){if(!b.preset)continue;let y=a[p++];!y||y.id!==b.preset||(y.wet.gain.value=b.amount,y.dry.gain.value=1-b.amount)}return!0},reset(){for(let{handle:m}of i)m.reset?.()},dispose(){for(let{handle:m}of i)m.dispose();for(let{entry:m,wet:p,dry:b,join:y}of a)m.disconnect(),p.disconnect(),b.disconnect(),y.disconnect();r.disconnect(),o.disconnect()}}}var ow={version:1,nodes:[]},iw={version:1,lanes:[]};function aw(e,t,n=Zt){let r=(n&&typeof e.getAttribute=="function"?e.getAttribute(n):null)??"";if(!r)return iw;try{return Vg(ds(r),t)}catch{return iw}}function wo(e){let t=(typeof e.getAttribute=="function"?e.getAttribute(Tn):null)??"";if(!t)return{chain:ow,raw:""};try{return{chain:Dg(t),raw:t}}catch{return{chain:ow,raw:""}}}function sw(e){return aw(e,wo(e).chain)}function Hm(e,t,n){let r=jA(t);if(!r)return[];let o=Gg(r,e.gain?.()??1,e.gainAhead);return Lm([{param:e.param}],{...r,points:o},cs.scale,n),[{param:e.param}]}function LO(e,t){Eo([e]),e.param.setValueAtTime(e.gainAhead?1:Be(e.gain?.()??1),t.scheduledAt)}function nu(e,t,n,r,o,i={automation:Zt},a){let{chain:l}=wo(t),s=null,c=[],d=!1,f=0,m=()=>{try{s?(n.disconnect(s.input),s.output.disconnect(r),s.dispose()):n.disconnect(r)}catch{}s=null},p=(G,R)=>{if(G.nodes.length===0){n.connect(r);return}if(nw(G)&&!Fm(e)){n.connect(r);let D=++f;Pm(e).then(()=>{d||D!==f||v(wo(t).chain)}).catch(()=>{});return}try{let D=rw(e,G,R);n.connect(D.input),D.output.connect(r),s=D}catch{n.connect(r)}},b=(G,R)=>{if(!R){c=[];return}let D=aw(t,G,i.automation),T=s?zA(D,G,s.nodes,R,s.presets):[],H=a?Hm(a,D,R):[];a&&H.length===0&&c.some(I=>I.param===a.param)&&LO(a,R),c=[...T,...H]},y=o?{...o}:null;p(l,y?.elapsed??0),b(l,y);let x=()=>{if(!y)return null;let G=typeof e.currentTime=="number"?e.currentTime:y.scheduledAt;return{scheduledAt:G,elapsed:y.elapsed+(G-y.scheduledAt)*y.rate,rate:y.rate}},E=G=>{let R=x();R&&(vo(c,R.scheduledAt),b(G,R))},v=G=>{let R=x();vo(c,R?.scheduledAt??0),m(),p(G,R?.elapsed??0),b(G,R)},_=null,U=t;return typeof MutationObserver<"u"&&typeof U?.nodeType=="number"&&(_=new MutationObserver(()=>{let G=wo(t);c.length>0&&Eo(c),!s||!s.update(G.chain)?v(G.chain):E(G.chain)}),_.observe(U,{attributes:!0,attributeFilter:[Tn,...i.automation?[i.automation]:[],...a?.gain?["data-volume"]:[]]})),{reanchor:G=>{if(d)return;let R=x();R&&vo(c,R.scheduledAt),y={...G},s?.reset(),b(wo(t).chain,y)},setRate:G=>{let R=x();d||!R||!Number.isFinite(G)||G<=0||G===R.rate||(y={...R,rate:G},vo(c,R.scheduledAt),b(wo(t).chain,y))},dispose:()=>{d=!0,_?.disconnect(),c.length>0&&vo(c,typeof e.currentTime=="number"?e.currentTime:0),s?.dispose()}}}function lw(e,t){e.getFloatTimeDomainData(t);let n=0;for(let r=0;r<t.length;r++)n=Math.max(n,Math.abs(t[r]??0));return n}function Gm(e,t){let n=e.createGain();n.channelCount=2,n.channelCountMode="explicit";let r=e.createChannelSplitter(2),o=e.createAnalyser(),i=e.createAnalyser();o.fftSize=i.fftSize=2048,t.connect(n),n.connect(r),r.connect(o,0),r.connect(i,1);let a=new Float32Array(new ArrayBuffer(2048*4)),l=new Float32Array(new ArrayBuffer(2048*4));return{read:()=>({l:lw(o,a),r:lw(i,l)}),dispose:()=>{try{t.disconnect(n),n.disconnect(),r.disconnect()}catch{}}}}var uw="runtime_web_audio_bypass";function Bm(e,t){return typeof e.getAttribute=="function"?e.getAttribute(t):null}function ia(e,t){return Bm(e,t)!==null}function NO(e){return ia(e,"crossorigin")?!0:e.crossOrigin!=null}function FO(e){return typeof e.baseURI=="string"&&e.baseURI?e.baseURI:typeof document<"u"?document.baseURI:""}function PO(e){let t=typeof e.currentSrc=="string"?e.currentSrc:"";if(t)return[t];let n=Bm(e,"src");if(n)return[n];if(typeof e.querySelectorAll!="function")return[];let r=[];for(let o of Array.from(e.querySelectorAll("source"))){let i=o.getAttribute("src");i&&r.push(i)}return r}function IO(e,t){let n;try{n=new URL(e,FO(t))}catch{return null}return n.protocol!=="http:"&&n.protocol!=="https:"?null:n}function DO(){return typeof window.origin=="string"?window.origin:window.location.origin}function OO(e,t){if(typeof window>"u")return null;let n=IO(e,t);if(!n)return null;let r=DO(),o=r==="null";return!o&&n.origin===r||NO(t)?null:o?"opaque_document_origin":"cross_origin_no_cors"}function dw(e){return(typeof e.currentSrc=="string"?e.currentSrc:"")?!0:ia(e,"src")}function _o(e){for(let t of PO(e)){let n=OO(t,e);if(n)return{kind:"decode-only",reason:n,asset:t}}return{kind:"web-audio"}}function HO(e){let t=[];ia(e,Tn)&&t.push("fx-chain"),ia(e,Zt)&&t.push("automation"),ia(e,ys)&&t.push("audio-group");let n=Number.parseFloat(Bm(e,"data-volume")??"");return Number.isFinite(n)&&n>1&&t.push("above-unity-gain"),t}function GO(){return typeof window<"u"&&!!window.__HF_EXPORT_RENDER_SEEK_CONFIG}var cw=new WeakSet,BO={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"},UO={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 Co(e,t){if(t.kind==="web-audio"||GO()||cw.has(e))return;let n=HO(e);cw.add(e);let r={asset:t.asset,reason:t.reason,lostProcessing:n,note:BO[t.reason]};Ce({source:"hf-preview",type:"diagnostic",code:uw,details:r});let o=n.length>0?` Native playback cannot reproduce: ${n.join(", ")}. Fix: ${UO[t.reason]}`:"";globalThis.console.info(`[hyperframes] ${uw}: "${t.asset}" (${t.reason}): Web Audio capture withheld; the track plays through native HTMLMediaElement output.${o}`)}function ru(e){return new URL(e,document.baseURI).href}var WO={automation:null};function Um(e){return!Number.isFinite(e)||e<=0?1:e}function fw(e){return Be(e)}function VO(e,t){t||e.paused||!za().__hfDebug||globalThis.console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function $O(e,t){let{elapsed:n,mediaStart:r,scheduledAt:o,globalRate:i,mediaRate:a,clipDuration:l,headCut:s}=t,c=Number.isFinite(l)&&l>0,d=Math.max(n,s,0),f=(l-d)*a;if(c&&f<=0)return!1;let m=d>n?o+(d-n)/i:0;return c?e.start(m,d*a+r,f):e.start(m,d*a+r),!0}function qO(e,t,n,r,o){let i=kc(hs(t),o);if(i.fadeIn<=0&&i.fadeOut<=0||i.fadeOut>0&&!Number.isFinite(o))return null;let a=e.createGain(),l=a.gain,s=d=>gs(d,o,i),c=d=>{let f=Math.max(r,d.elapsed),m=p=>d.scheduledAt+Math.max(0,p-d.elapsed)/d.rate;if(l.value=s(f),l.setValueAtTime(s(f),m(f)),i.fadeIn>f&&l.linearRampToValueAtTime(s(i.fadeIn),m(i.fadeIn)),i.fadeOut>0){let p=o-i.fadeOut;p>f&&p>i.fadeIn&&l.setValueAtTime(s(p),m(p)),l.linearRampToValueAtTime(0,m(o))}};return c(n),{node:a,rebook:d=>{l.cancelScheduledValues(0),c(d)}}}function mw(e,t,n,r,o,i){let a=e.createGain();a.connect(r);let l=e.createGain(),s=qO(e,t,o,i.from,i.clipDuration);return s&&n.connect(s.node),(s?.node??n).connect(l),{fx:nu(e,t,l,a,o,void 0,{param:a.gain,gain:()=>oi(t),gainAhead:!0}),laneNode:a,clipGainNode:l,fades:s}}function To(e){return e.sourceKind==="buffer"}var pw=e=>{let t=e.currentSrc||e.getAttribute("src");if(!t)return null;try{return ru(t)}catch{return t}},zO=1e4,ou=class{constructor(){Se(this,"_ctx",null);Se(this,"_bufferCache",new Map);Se(this,"_decoding",new Map);Se(this,"_failedSrcs",new Set);Se(this,"_mediaElementSources",new WeakMap);Se(this,"_activeSources",[]);Se(this,"_masterGain",null);Se(this,"_busOut",null);Se(this,"_master",null);Se(this,"_monitorGain",null);Se(this,"_masterVolume",1);Se(this,"_masterMuted",!1);Se(this,"_groups",new Map);Se(this,"_metering",!1);Se(this,"_masterTap",null);Se(this,"_groupTaps",new Map);Se(this,"_rateAnchorCtx",0);Se(this,"_rateAnchorComp",0);Se(this,"_rate",1);Se(this,"_paused",!0);Se(this,"_playGeneration",0);Se(this,"_playingCaptured",new Set);Se(this,"_suspendPending",!1);Se(this,"_restTimer",null)}async init(){try{return this._ctx=new AudioContext,this._ctx.onstatechange=()=>this.rest(),this._masterGain=this._ctx.createGain(),this._busOut=this._ctx.createGain(),this._monitorGain=this._ctx.createGain(),this._masterGain.connect(this._busOut),this._busOut.connect(this._monitorGain),this._monitorGain.connect(this._ctx.destination),this.applyMasterGain(),this._metering&&this.attachMasterTap(),!0}catch{return!1}}async wake(){!this._ctx||this._ctx.state==="running"&&!this._suspendPending||(this._suspendPending=!1,await this._ctx.resume())}rest(){this._restTimer!==null&&clearTimeout(this._restTimer),this._restTimer=null,!(!this._ctx||this._ctx.state!=="running"||this._suspendPending)&&(this._restTimer=setTimeout(()=>{this._restTimer=null,this.suspendIfIdle()},zO))}suspendIfIdle(){for(let t of this._playingCaptured)t.paused&&this._playingCaptured.delete(t);!this._ctx||!this._paused||this._suspendPending||this._playingCaptured.size>0||(this._suspendPending=!0,this._ctx.suspend().catch(t=>{this._suspendPending=!1,V("webAudioTransport.suspend",t)}))}get context(){return this._ctx}getTime(){return!this._ctx||this._paused?-1:this._rateAnchorComp+(this._ctx.currentTime-this._rateAnchorCtx)*this._rate}releaseDecodedExcept(t){let n=new Set(t.map(pw));for(let r of[...this._bufferCache.keys()])n.has(r)||this._bufferCache.delete(r)}decodeAudioElement(t){let n=pw(t);if(!n)return Promise.resolve(null);let r=this._decoding.get(n);if(r)return r;let o=this.fetchAndDecode(n).finally(()=>this._decoding.delete(n));return this._decoding.set(n,o),o}async fetchAndDecode(t){if(this._bufferCache.has(t))return this._bufferCache.get(t);if(this._failedSrcs.has(t)||!this._ctx)return null;let n;try{let r=await fetch(t,{cache:"no-store"});if(!r.ok)return V("webAudioTransport.fetch",new Error(`${r.status} ${t}`)),null;n=await r.arrayBuffer()}catch(r){return V("webAudioTransport.fetch",r),null}try{let r=await this._ctx.decodeAudioData(n);return this._bufferCache.set(t,r),r}catch(r){return this._failedSrcs.add(t),V("webAudioTransport.decode",r),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}acquireMediaElementSource(t){let n=this._mediaElementSources.get(t);if(n){let a=_o(t);if(a.kind!=="web-audio"){try{n.disconnect()}catch{}return this._mediaElementSources.delete(t),Co(t,a),null}return n}if(!this._ctx)return null;let r=_o(t);if(r.kind!=="web-audio")return Co(t,r),null;let o=this._ctx.createMediaElementSource(t);this._mediaElementSources.set(t,o),t.paused||this._playingCaptured.add(t),t.addEventListener("play",()=>{this._playingCaptured.add(t),this.wake()});let i=()=>{this._playingCaptured.delete(t),this.rest()};return t.addEventListener("pause",i),t.addEventListener("emptied",i),o}async scheduleMediaElementPlayback(t,n,r,o,i,a,l=1,s=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||a!==this._playGeneration)return null;try{if(await this.wake(),a!==this._playGeneration)return null;let c=this.acquireMediaElementSource(t);if(!c)return null;c.disconnect();let d=Um(l),f=this._ctx.createGain();f.gain.value=i;let m=this._ctx.currentTime,p=o-n,b={scheduledAt:m,elapsed:p,rate:d};f.connect(this.resolveDestination(t,m,o,d)??this._masterGain);let{fx:y,laneNode:x,clipGainNode:E,fades:v}=mw(this._ctx,t,c,f,b,{from:Math.max(p,0),clipDuration:s});this._rate=d,this._rateAnchorCtx=m,this._rateAnchorComp=o;let _={fx:y,fades:v,el:t,sourceNode:c,sourceKind:"media-element",gainNode:f,laneNode:x,clipGainNode:E,compositionStart:n,mediaStart:r,scheduledAt:m,priorMuted:t.muted,priorVolume:t.volume,mediaPlaybackRate:mt(t),bounded:!1};return t.volume=1,this._activeSources.push(_),this._paused=!1,_}catch(c){return V("webAudioTransport.mediaElementSource",c),null}}groupInput(t,n,r){let o=this._groups.get(t);if(o){if(o.generation!==this._playGeneration)try{o.reanchor(r),o.generation=this._playGeneration}catch(p){V("webAudioTransport.groupReanchor",p)}return o.input}if(!this._ctx||!this._masterGain)return null;let i=this._ctx.createGain(),a=this._ctx.createGain();a.connect(this._masterGain);let l=()=>Lc(n,t),s=l(),c=this._ctx.createGain();c.gain.value=s?.hasAttribute("data-hidden")?0:1,c.connect(a);let d=this._ctx.createGain();d.gain.value=fw(oi(s)),d.connect(c);let f={param:d.gain,gain:()=>oi(l())},m=nu(this._ctx,s??{getAttribute:()=>null},i,d,r,void 0,s?f:void 0);return this._groups.set(t,{input:i,output:a,isPresent:()=>l()!==null,fader:d,muteGain:c,fx:m,generation:this._playGeneration,reanchor:p=>{Eo([{param:d.gain}]);let b=l();d.gain.value=fw(oi(b)),c.gain.value=b?.hasAttribute("data-hidden")?0:1,m?.reanchor(p),b&&b!==s&&Hm(f,sw(b),p)},dispose:()=>{try{m?.dispose(),i.disconnect(),d.disconnect(),c.disconnect(),a.disconnect()}catch{}}}),this.attachGroupTap(t,a),i}startMetering(){this._metering=!0,this.attachMasterTap();for(let[t,n]of this._groups)this.attachGroupTap(t,n.output)}stopMetering(){this._metering=!1,this._masterTap?.dispose(),this._masterTap=null;for(let t of this._groupTaps.values())t.dispose();this._groupTaps.clear()}readLevels(){let t={};for(let[n,r]of this._groupTaps)this._groups.get(n)?.isPresent()&&(t[n]=r.read());return{master:this._masterTap?.read()??{l:0,r:0},groups:t}}attachMasterTap(){this._ctx&&this._masterGain&&!this._masterTap&&(this._masterTap=Gm(this._ctx,this._busOut??this._masterGain))}attachGroupTap(t,n){this._metering&&this._ctx&&!this._groupTaps.has(t)&&this._groupTaps.set(t,Gm(this._ctx,n))}setGroupMuted(t,n){let r=this._groups.get(t);if(r)try{r.muteGain.gain.value=n?0:1}catch(o){V("webAudioTransport.setGroupMuted",o)}}ensureMasterBus(t,n){if(!this._ctx||!this._masterGain||!this._busOut)return;if(this._master){if(this._master.generation===this._playGeneration)return;try{this._master.fx?.reanchor(n),this._master.generation=this._playGeneration}catch(i){V("webAudioTransport.masterReanchor",i)}return}let r=Nc(t);if(!r)return;this._masterGain.disconnect(this._busOut);let o=nu(this._ctx,r,this._masterGain,this._busOut,n,WO);this._master={fx:o,generation:this._playGeneration}}resolveDestination(t,n,r,o){if(!this._masterGain)return null;let i={scheduledAt:n,elapsed:r,rate:o};this.ensureMasterBus(t.ownerDocument,i);let a=Ss(t);return a?this.groupInput(a,t.ownerDocument,i)??this._masterGain:this._masterGain}handleSourceEnded(t,n,r,o){let i=this._activeSources.indexOf(n);if(i!==-1){this._activeSources.splice(i,1),r.muted=o;try{t.disconnect(),n.fx?.dispose(),n.fades?.node.disconnect(),n.clipGainNode.disconnect(),n.laneNode.disconnect(),n.gainNode.disconnect()}catch{}this._activeSources.length===0&&(this._paused=!0)}}async schedulePlayback(t,n,r,o,i,a,l,s=1,c=Number.POSITIVE_INFINITY,d=r){if(!this._ctx||!this._masterGain||l!==this._playGeneration)return null;try{if(await this.wake(),l!==this._playGeneration)return null;let f=i(),m=Um(s),p=mt(t),b=m*p,y=this._ctx.createBufferSource();y.buffer=n,y.playbackRate.value=b;let x=this._ctx.createGain();x.gain.value=a;let E=f-r,v=this._ctx.currentTime,_={scheduledAt:v,elapsed:E,rate:m};x.connect(this.resolveDestination(t,v,f,m)??this._masterGain);let U=d-r,{fx:G,laneNode:R,clipGainNode:D,fades:T}=mw(this._ctx,t,y,x,_,{from:Math.max(E,U,0),clipDuration:c});if(this._rate=m,this._rateAnchorCtx=v,this._rateAnchorComp=f,!$O(y,{elapsed:E,mediaStart:o,scheduledAt:v,globalRate:m,mediaRate:p,clipDuration:c,headCut:U}))return y.disconnect(),G?.dispose(),T?.node.disconnect(),D.disconnect(),R.disconnect(),x.disconnect(),null;let H=t.muted;t.muted=!0,VO(t,H);let I={fx:G,fades:T,el:t,sourceNode:y,sourceKind:"buffer",gainNode:x,laneNode:R,clipGainNode:D,compositionStart:r,mediaStart:o,scheduledAt:v,priorMuted:H,priorVolume:t.volume,mediaPlaybackRate:p,bounded:Number.isFinite(c)&&c>0};return this._activeSources.push(I),this._paused=!1,y.addEventListener("ended",()=>this.handleSourceEnded(y,I,t,H)),I}catch(f){return V("webAudioTransport.schedule",f),null}}setRate(t){let n=Um(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{To(r)&&(r.sourceNode.playbackRate.value=n*r.mediaPlaybackRate),r.fx?.setRate(n),this._ctx&&!this._paused&&r.fades?.rebook({scheduledAt:this._ctx.currentTime,elapsed:this.getTime()-r.compositionStart,rate:n})}catch(o){V("webAudioTransport.setRate",o)}return this.setBusRate(n),!0}setBusRate(t){let n=[...this._groups.values(),...this._master?[this._master]:[]];for(let r of n)try{r.fx?.setRate(t)}catch(o){V("webAudioTransport.setRate.bus",o)}}hasBoundedActiveSources(){return this._activeSources.some(t=>To(t)&&t.bounded)}stopAll(){for(let t of this._activeSources)this.dispose(t);this._activeSources=[],this._paused=!0,this._playGeneration+=1,this.rest()}releaseDetached(){this._activeSources=this._activeSources.filter(t=>t.el.isConnected?!0:(this.dispose(t,!1),!1))}dispose(t,n=!0){try{To(t)&&t.sourceNode.stop(),t.sourceNode.disconnect(),t.fx?.dispose(),t.fades?.node.disconnect(),t.clipGainNode.disconnect(),t.laneNode.disconnect(),t.gainNode.disconnect()}catch{}To(t)?t.el.muted=t.priorMuted:(t.el.volume=t.priorVolume,this._ctx&&n&&t.sourceNode.connect(this._ctx.destination))}setVolume(t){this._masterVolume=Math.max(0,Math.min(1,t)),this.applyMasterGain()}setElementVolume(t,n,r=1,o=n){for(let i of this._activeSources)if(i.el===t)try{i.sourceKind==="media-element"&&(i.el.volume=1),i.gainNode.gain.value=Be(i.fades?o:n),i.clipGainNode.gain.value=Be(r)}catch(a){V("webAudioTransport.setElementVolume",a)}}setMuted(t){this._masterMuted=t,this.applyMasterGain()}applyMasterGain(){this._monitorGain&&(this._monitorGain.gain.value=this._masterMuted?0:this._masterVolume)}ownsClock(){return!this._paused&&this._activeSources.some(To)}ownsElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t&&To(n))}routesElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t)}destroy(){this.stopAll(),this.stopMetering();for(let t of this._groups.values())t.dispose();if(this._groups.clear(),this._master?.fx?.dispose(),this._master=null,this._bufferCache.clear(),this._failedSrcs.clear(),this._mediaElementSources=new WeakMap,this._playingCaptured.clear(),this._suspendPending=!1,this._restTimer!==null&&clearTimeout(this._restTimer),this._restTimer=null,this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null,this._busOut=null,this._monitorGain=null,this._masterVolume=1,this._masterMuted=!1}};var aa="data-hf-studio-manual-edit-gesture";var hw=`[${aa}]`;function gw(e,t){let n=e.defaultView?.MutationObserver??globalThis.MutationObserver;if(!n||!e.documentElement)return{isActive:()=>e.querySelector(hw)!=null,observing:!1,disconnect:()=>{}};let r=new Set(e.querySelectorAll(hw)),o=l=>{for(let s of l){let c=s.target;Oe(c)&&(c.hasAttribute(aa)?r.add(c):r.delete(c))}},i=l=>{l.length!==0&&(o(l),t())},a=new n(i);return a.observe(e.documentElement,{subtree:!0,attributes:!0,attributeFilter:[aa]}),{observing:!0,isActive:()=>{i(a.takeRecords());for(let l of r){if(l.isConnected&&l.hasAttribute(aa))return!0;r.delete(l)}return!1},disconnect:()=>{a.disconnect(),r.clear()}}}var bw=333.3333333333333,Wm=1e3*60/60;function yw(e){return e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2?!1:e.compositionChanged===!0?!0:e.isPlaying?e.playingPollDue===!0:Number.isInteger(e.tick)&&e.tick>0&&e.tick%60===0}var jO=/^\s*spring\(\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*\)\s*$/;function xw(e){return Math.max(0,Math.min(1,e))}function Sw(e){let t=jO.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?xw(n):null}function Ew(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=xw(t),r=12-n*6,o=Math.PI*2*(1+n*1.5),i=1-Math.exp(-r)*Math.cos(o);return(1-Math.exp(-r*e)*Math.cos(o*e))/i}var KO=/^\s*wiggle\(\s*(\d+)\s*,\s*(easeOut|easeInOut|anticipate|uniform)\s*(?:,\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?)\s*)?\)\s*$/,YO=Math.PI*2;function XO(e){let t=KO.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 o=Number(t[3]);return!Number.isFinite(o)||o<0||o>1?null:{wiggles:n,type:r,amplitude:o}}function JO(e,t,n,r){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let o=r??(n==="easeInOut"?.08:n==="uniform"?.14:n==="anticipate"?.12:.16),i=n==="easeInOut"?o*Math.sin(Math.PI*e):n==="uniform"?o:o*(1-e);return e+(n==="anticipate"?-1:1)*i*Math.sin(YO*t*e)}function vw(e,t){let n=XO(e);if(!n)return null;let r=`${n.wiggles}:${n.type}:${n.amplitude??"default"}`,o=t?.get(r);if(o)return o;let i=a=>JO(a,n.wiggles,n.type,n.amplitude);return t?.set(r,i),i}var QO=24,Aw=e=>e>=1?1:0,ZO=e=>e,iu=String.raw`([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)`,eH=new RegExp(String.raw`^\s*M\s*0\s*,\s*0\s+C\s*${iu}\s*,\s*${iu}\s+${iu}\s*,\s*${iu}\s+1\s*,\s*1\s*$`,"i");function ww(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function tH(e,t,n,r,o){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let i=0,a=1;for(let l=0;l<QO;l+=1){let s=(i+a)/2;ww(s,t,r)<e?i=s:a=s}return ww((i+a)/2,n,o)}function nH(e){let t=eH.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),o=Number(t[3]),i=Number(t[4]);return Math.min(n,o)<0||Math.max(n,o)>1?null:a=>tH(a,n,r,o,i)}function rH(e,t){if(!e.startsWith("spring("))return null;let n=Sw(e);if(n===null)return null;let r=t.get(n);if(r)return r;let o=i=>Ew(i,n);return t.set(n,o),o}function oH(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 o=nH(n);return o&&t.set(n,o),o}function _w(e){if(e.__hfCustomEaseInstalled)return!0;let t=e.parseEase;if(!t)return!1;let n=new Map,r=new Map,o=new Map,i=s=>typeof s!="string"?null:s==="hold"?Aw:vw(s,o)??rH(s,r)??oH(s,n),a=(s,c,d=[])=>{let f=i(s);return f||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\(|$)/.test(s.trim())&&St("custom_ease_parse_failed",{ease:s}),t.call(c,s,...d)??ZO)};e.parseEase=function(c,...d){return a(c,this,d)};let l=e.registerEase;if(typeof l=="function"){l("hold",Aw);let s=c=>{let d=f=>f;d.config=(...f)=>a(`${c}(${f.join(",")})`,e),l(c,d)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}var $m="first-frame",iH=3;function aH(e){let t=e.ownerDocument?.defaultView;return t&&e instanceof t.Element?!0:e instanceof Element}function sH(e){if(!aH(e)||e.tagName!=="AUDIO"&&e.tagName!=="VIDEO")return!1;let t=e.ownerDocument?.defaultView;return t&&e instanceof t.HTMLMediaElement?!0:e instanceof HTMLMediaElement}function lH(e){return e.hasAttribute("data-start")||e.hasAttribute("data-track-index")}function uH(e,t,n){let r=e;for(;r;){if(lH(r)&&!Ps(r,{currentTime:0,compositionDuration:Number.POSITIVE_INFINITY,canonicalFps:30,exportRenderSeek:!1,timelineRegistry:n,resolver:t}))return!1;r=r.parentElement}return!0}function Cw(e,t,n,r){return t==="all"?!0:uH(e,n,r)}function cH(e,{scope:t="all"}={}){let n=e.defaultView,r=st({documentRef:e,timelineRegistry:n?.__timelines,includeAuthoredTimingAttrs:!0}),o=e.querySelector(`meta[name="${ja}"]`)!==null,i=Array.from(e.querySelectorAll("video, audio")).filter(sH).filter(s=>Cw(s,o&&s.preload!=="auto"?$m:t,r,n?.__timelines??{})).filter(s=>s.readyState<iH),a=Array.from(e.querySelectorAll("img")).filter(s=>Cw(s,s.getAttribute("loading")?.toLowerCase()==="lazy"?$m:t,r,n?.__timelines??{})).filter(s=>!s.complete),l=e.fonts?.status==="loading";return{pendingMedia:i,pendingImages:a,fontsLoading:l}}function dH(e,{pendingMedia:t,pendingImages:n,fontsLoading:r},o){let i=t.map(s=>new Promise(c=>{if(s.error){c();return}let d=()=>{s.removeEventListener("canplay",d),s.removeEventListener("error",d),o.removeEventListener("abort",d),c()};s.addEventListener("canplay",d),s.addEventListener("error",d),o.addEventListener("abort",d,{once:!0})})),a=n.map(s=>s.decode?s.decode().catch(()=>{}):Promise.resolve()),l=r&&e.fonts?e.fonts.ready.then(()=>{}):Promise.resolve();return Promise.all([...i,...a,l]).then(()=>{})}function fH(e,t,{scope:n="all"}={}){let r=cH(e,{scope:n});return r.pendingMedia.length===0&&r.pendingImages.length===0&&!r.fontsLoading?null:dH(e,r,t)}var mH=50;function pH(e,t){let n=e.defaultView;return!n||n.__renderReady||!n.__hf?null:new Promise(r=>{let o,i=()=>{o!==void 0&&clearTimeout(o),t.removeEventListener("abort",i),r()};if(t.aborted){i();return}t.addEventListener("abort",i,{once:!0});let a=()=>{if(n.__renderReady){i();return}o=setTimeout(a,mH)};a()})}var hH=50,gH=1.5,bH=2,yH=1500;function Vm(e,t){return new Promise(n=>{if(t.aborted){n(-1);return}let r=0,o=()=>{e.cancelAnimationFrame?.(r),n(-1)};t.addEventListener("abort",o,{once:!0}),r=e.requestAnimationFrame(i=>{t.removeEventListener("abort",o),n(i)})})}function xH(e,t){let n=e.defaultView;return n?(async()=>{let r=await Vm(n,t);if(t.aborted)return;let o=await Vm(n,t),i=o-r,a=0;for(;!t.aborted&&a<bH;){if(o-r>=yH)return;let l=await Vm(n,t);if(t.aborted)return;let s=l-o;i=Math.min(i,s),a=s<hH||s<=i*gH?a+1:0,o=l}})():null}var SH=8e3;function EH(e,t,n={}){let r=n.inputs??[(c,d)=>fH(c,d,{scope:n.scope}),pH,xH],o=new AbortController,i=r.map(c=>c(e,o.signal)).filter(c=>c!==null);if(i.length===0){t({timedOut:!1});return}let a=n.timeoutMs??SH,l,s=new Promise(c=>{l=setTimeout(()=>c("timed-out"),a)});Promise.race([Promise.all(i).then(()=>"done"),s]).then(c=>{clearTimeout(l),o.abort(),t({timedOut:c==="timed-out"})})}function Tw(e,t,n={}){EH(e,t,{...n,scope:$m})}var jm=new Map,sa=new Map,qm=new Map,zm=()=>{},Mw=()=>{},Rw=0;function Km(e){return/^[a-z][a-z0-9-]{0,63}$/.test(e)}function kw(e){let t=(qm.get(e)??0)+1;return qm.set(e,t),t}function Lw(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:(Rw-=1,Rw)}function Ym(e,t){let n=sa.get(e);if(!n)return;let r=()=>qm.get(e)===t.generation&&sa.get(e)===n;try{Promise.resolve(n(t.payload)).then(()=>{r()&&Mw(e,t.requestId)},o=>{r()&&zm(e,t.requestId,o)})}catch(o){r()&&zm(e,t.requestId,o)}}function Nw(e){zm=e}function Fw(e){Mw=e}function au(e,t,n){if(!Km(e))return;let r={payload:t,requestId:Lw(n),generation:kw(e)};jm.set(e,r),Ym(e,r)}function su(e,t){Km(e)&&(jm.delete(e),Ym(e,{payload:void 0,requestId:Lw(t),generation:kw(e)}))}function Pw(e,t){if(!Km(e))throw new Error(`Invalid HyperFrames runtime-data channel: ${e}`);sa.set(e,t);let n=jm.get(e);return n&&Ym(e,n),()=>{sa.get(e)===t&&sa.delete(e)}}var Iw=!1;function dn(e){if(e){if(typeof e.pause!="function"){Iw||(Iw=!0,St("timeline_missing_pause",{}));return}try{e.pause()}catch(t){V("runtime.timeline.pause",t)}}}function wH(e){let t=e;if(typeof t.remove=="function")for(let n of e.getChildren?.(!1,!0,!1)??[])n.data===si&&t.remove(n)}function _H(){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 CH(e,t){return t!==null&&e.length===t.length&&e.every((n,r)=>n===t[r])}function Dw(e,t,n){let r=null,o=!0;return()=>{let i=e();if(i.length===0)return r=null,o=!0,!0;if(CH(i,r))return o;r=i,o=!1;let a=i.length===1?i[0]:Promise.all(i);return Promise.resolve(a).then(()=>{r===i&&(o=!0,t())},l=>{r===i&&(o=!0,n(l),t())}),o}}function ua(e){let t=e.querySelector(`meta[name="${An}"]`)?.getAttribute("content");if(!t)return null;try{return JSON.parse(t)}catch{return null}}var Jm=e=>JSON.stringify([Array.from(e.attributes,t=>[t.name,t.value]).filter(([t])=>t!==br),e.innerHTML]),TH=new Set(["style","preload","src",br,Bn,Ve,...Ya]),RH=e=>e.split(/\s+/).filter(t=>t&&!t.startsWith("__hf-")).join(" "),Ow=e=>JSON.stringify([Array.from(e.attributes,({name:t,value:n})=>[t,t==="class"?RH(n):n]).filter(([t,n])=>!TH.has(t)&&!(t==="class"&&!n)).sort(([t],[n])=>t<n?-1:1),e.hasAttribute("data-var-src")?null:xi(e),e.innerHTML]),ca=new WeakMap,Gw=e=>e.localName==="video"||e.localName==="audio",lu=e=>{if(!Oe(e))return;let t=Gw(e)?[e]:e.firstElementChild?e.querySelectorAll("video, audio"):[];for(let n of t)ca.has(n)||ca.set(n,Jm(n))},uu=null;function Bw(){typeof MutationObserver>"u"||!ua(document)||(lu(document.documentElement),uu=new MutationObserver(e=>{for(let t of e){t.addedNodes.forEach(lu);let{target:n}=t;Oe(n)&&Gw(n)&&ca.set(n,Jm(n))}}),uu.observe(document.documentElement,{childList:!0,subtree:!0}))}function Uw(){let e=o=>o?.config?.({force3D:!1}),t=Object.getOwnPropertyDescriptor(window,"gsap"),n=window.gsap;if(e(n),t?.configurable===!1||t?.get?.hfFlat)return;let r=Object.assign(()=>t?.get?t.get.call(window):n,{hfFlat:!0});Object.defineProperty(window,"gsap",{configurable:!0,enumerable:!0,get:r,set:o=>{t?.set?t.set.call(window,o):n=o,e(o)}})}var MH=new Map([["image",["href","xlink:href"]],["object",["data"]]]),kH=1e3,LH=16;function NH(){let e;return()=>e??(e=document.getAnimations())}var Xm=e=>Xa(e)||Le(e)&&bs(e)&&m0({volume:Number.parseFloat(e.dataset.volume??""),fxChain:e.getAttribute("data-fx-chain"),automation:e.getAttribute("data-automation"),audioGroup:e.getAttribute("data-audio-group"),masterChain:h0(e.ownerDocument)}),Ww="audio[data-start], video[data-start]",la=e=>Array.from(e.querySelectorAll(Ww)).filter(Xm);function Hw(e){let t=e.matches(`[${Ka}]`)?[e]:Array.from(e.querySelectorAll(`img[${Ka}]`)).filter(n=>n.closest("[data-start]")===e);for(let n of t)n.setAttribute("loading","eager")}function Vw(){let e=Zc(),t=window.parent!==window,n=u=>t&&u.hasAttribute(Dt);uu?.disconnect(),uu=null,ua(document)&&lu(document.documentElement);let r=()=>{};pb(Ce),Nw((u,h,g)=>{Ce({source:"hf-preview",type:"runtime-data-error",channel:u,requestId:h,message:g instanceof Error?g.message:String(g)})}),Fw((u,h)=>{try{r()}catch(g){Ce({source:"hf-preview",type:"runtime-data-error",channel:u,requestId:h,message:g instanceof Error?g.message:String(g)});return}Ce({source:"hf-preview",type:"runtime-data-applied",channel:u,requestId:h})}),qi(document),Fl(document),g0(document);let o=_H();if(e.canonicalFps=o.fps??e.canonicalFps,rb(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG){let u=JSON.stringify({canonicalFps:e.canonicalFps,source:o.source,rawFpsSource:o.rawFpsSource,rawFps:o.rawFps,fallbackReason:o.fallbackReason});globalThis.console.info(`[hyperframes] render runtime fps ${u}`)}let i=null,a=null,l=null,s=[],c=new Set,d=null,f=new Set,m=(u,h,g)=>{f.has(u)||(f.add(u),St(h,g))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(u){V("runtime.init.site1",u)}let p=new tu;e.transportClock=p;let b=new ou,y=!1;b.init().then(u=>{y=u}),window.__hf=window.__hf||{};let x=u=>u.closest("[data-hidden]")!==null||xs(u.ownerDocument,u),E=()=>{let u=window.gsap,h=window;if(!(!u?.registerPlugin||h.__hfAutoNoopRegistered))try{u.registerPlugin({name:"_auto",init:()=>!1}),h.__hfAutoNoopRegistered=!0}catch(g){m("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),V("runtime.autoMarker.install",g)}},v=()=>{let u=window.gsap;if(!u){m("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{_w(u)||m("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(h){m("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),V("runtime.customEase.install",h)}};E(),v(),document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden");try{Eb(document)}catch(u){V("runtime.init.cssVariables",u)}if(window.__timelines=window.__timelines||{},Array.isArray(window.__timelines)){let u=window.__timelines,h=xt()?.getAttribute("data-composition-id")??"root",g={};if(u.length===1)g[h]=u[0];else for(let S=0;S<u.length;S++)g[`tl-${S}`]=u[S];window.__timelines=g}let _=xt();_&&!_.hasAttribute("data-start")&&_.setAttribute("data-start","0");let U=u=>{s.push(u)},G=(u,h,g)=>{let S=g??`${u}:${JSON.stringify(h)}`;c.has(S)||(c.add(S),Ce({source:"hf-preview",type:"diagnostic",code:u,details:h}))},R=u=>{let h={scale:1,focusX:960,focusY:540},g=[],S=[],A={time:u.getTime(),duration:u.getDuration(),isPlaying:u.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:u.play,pause:u.pause,seek:u.seek,getTime:u.getTime,getDuration:u.getDuration,isPlaying:u.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>h,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>g,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:u.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>S,getRenderState:()=>({...A,time:u.getTime(),duration:u.getDuration(),isPlaying:u.isPlaying()})}},D=.75,T=.05,H=100,I=240,Y=u=>{if(u instanceof Error)return u.message||String(u);if(typeof u=="string")return u;try{return JSON.stringify(u)}catch{return String(u??"")}},W=u=>{let h=u.toLowerCase();return h.includes("cannot read properties of null")||h.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:h.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:h.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},X=u=>{let h=dr(u);return h===null?null:`${h}px`},ie=null,F=!1,z=()=>{if(!F)return xt();if(cp(),je&&!tt&&ie?.revision===bt&&(ie.el===null||ie.el.isConnected))return ie.el;let u=xt();return ie={revision:bt,el:u},u},O=()=>{let u=z();if(!u)return;let h=X(u.getAttribute("data-width")),g=X(u.getAttribute("data-height"));h&&(u.style.width=h),g&&(u.style.height=g),h&&u.style.setProperty("--comp-width",h),g&&u.style.setProperty("--comp-height",g),h&&(document.documentElement.style.width=h),g&&(document.documentElement.style.height=g),h&&(document.body.style.width=h),g&&(document.body.style.height=g)},N=()=>{let u=z(),h=Array.from(document.querySelectorAll("[data-composition-id]")).filter(g=>g.hasAttribute("data-duration")||g.hasAttribute("data-end"));for(let g of h){if(u&&g===u)continue;let S=g.getAttribute("data-duration"),A=g.getAttribute("data-end");S!=null&&!g.hasAttribute(Wr)&&g.setAttribute(Wr,S),A!=null&&!g.hasAttribute(Vr)&&g.setAttribute(Vr,A),g.removeAttribute("data-duration"),g.removeAttribute("data-end")}},L=new WeakMap,w=u=>[u.className,u.style.position,u.style.top,u.style.left,u.style.width,u.style.height,u.style.transform,u.getAttribute("data-width"),u.getAttribute("data-height")].join("|"),k=()=>{let u=z();if(!u)return;u.style.position||(u.style.position="relative"),u.style.overflow="hidden";let h=X(u.getAttribute("data-width")),g=X(u.getAttribute("data-height"));h&&(u.style.width=h),g&&(u.style.height=g);let S=Array.from(u.children).filter(C=>{let P=C.tagName.toLowerCase();return P==="script"||P==="style"||P==="link"||P==="meta"||!C.hasAttribute("data-start")||C.hasAttribute(Dt)?!1:L.get(C)!==w(C)}),A=S.filter(C=>C.style.getPropertyValue("display")==="none").map(C=>({el:C,priority:C.style.getPropertyPriority("display")}));for(let{el:C}of A)C.style.removeProperty("display");for(let C of S){let P=C.tagName.toLowerCase(),q=(C.style.top==="0px"||C.style.top==="0")&&(C.style.left==="0px"||C.style.left==="0")&&C.style.width==="100%"&&C.style.height==="100%",B=/translate\(\s*-50%\s*,\s*-50%\s*\)/.test(C.style.transform);if(q&&B&&!C.hasAttribute("data-width")&&!C.hasAttribute("data-height")){let be=C.style.top,se=C.style.left,pe=C.style.width,Ye=C.style.height;C.style.top="",C.style.left="",C.style.width="",C.style.height="";let Ke=window.getComputedStyle(C);Ke.top!=="auto"||Ke.bottom!=="auto"||Ke.left!=="auto"||Ke.right!=="auto"||Ke.width!=="0px"||Ke.height!=="0px"||(C.style.top=be,C.style.left=se,C.style.width=pe,C.style.height=Ye)}let M=window.getComputedStyle(C),J=M.position;if(J!=="absolute"&&J!=="fixed"&&(C.style.position="absolute"),P!=="audio"){let be=X(C.getAttribute("data-width")),se=X(C.getAttribute("data-height")),pe=M.width!=="0px"&&M.width!=="auto",Ye=M.height!=="0px"&&M.height!=="auto";be?!C.style.width&&!pe&&(C.style.width=be):!C.style.width&&M.width==="0px"&&(C.style.width="100%"),se?!C.style.height&&!Ye&&(C.style.height=se):!C.style.height&&M.height==="0px"&&(C.style.height="100%")}}for(let{el:C,priority:P}of A)C.style.setProperty("display","none",P);if(document.readyState==="complete")for(let C of S)L.set(C,w(C))},K=u=>st({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:u}),oe=null,ge=u=>{let h=oe;oe=K(!0);try{return u()}finally{oe=h}},Ee=u=>u&&oe?oe:K(u),$=(u,h=0,g)=>Ee(g?.includeAuthoredTimingAttrs??!0).resolveStartForElement(u,h),Q=(u,h)=>Ee(h?.includeAuthoredTimingAttrs??!0).resolveDurationForElement(u),Z=u=>{let h=u.closest("[data-composition-id]"),g=h?$(h,0):null,S=h?Q(h,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:h,inheritedStart:g,inheritedDuration:S}},me=u=>Ee(!0).resolveHostSlotsForElement(u),he=(u,h)=>{let g=Ge(u.dataset.duration),S=g!=null&&g>0?h+g:1/0;return fr({start:h,end:S},me(u))},le=u=>Ee(!0).resolveMediaStartForElement(u);window.__hfResolveMediaStartSeconds=le,s.push(()=>{window.__hfResolveMediaStartSeconds===le&&delete window.__hfResolveMediaStartSeconds});let ne=!!document.querySelector("[data-composition-src]"),te=!1;{let u=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let h of u){let g=h.getAttribute("data-composition-id");if(g&&h.children.length===0&&document.querySelector(`template#${CSS.escape(g)}-template`)){te=!0;break}}}let Ue=!ne&&!te,ke=u=>{let h=en(u);return h==null?null:Math.max(0,h)},Te=u=>typeof u=="number"&&Number.isFinite(u)&&u>rn,ut=()=>Array.from(document.querySelectorAll("video[data-start], audio[data-start]")).length===0?null:ge(()=>U0(document,{mediaStart:le,mediaDuration:Gr})),_r=()=>{let u=z();if(!u)return null;let h=window.__timelines??{},g=st({timelineRegistry:h,includeAuthoredTimingAttrs:!0});return W0(u,g)},ma=()=>{let u=window;return!!(u.lottie||u.DotLottie)},ko=()=>{let u=z();if(!u)return Xr({authoredDurationSeconds:null,clipEndsSeconds:[]});let h=st({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:!0});return V0(u,h,{unregisteredLottie:ma()})},Lo=null,bu=()=>{if(tt)return ko();let u=Tr();return Lo?.revision!==u&&(Lo={revision:u,result:ko()}),Lo.result},pa=u=>{window.__hf=window.__hf||{},window.__hf.durationSource={source:u.source,seconds:u.seconds,pendingClips:u.pendingClips},u.source==="derived"&&G("composition_duration_derived",{source:u.source,seconds:u.seconds,pendingClips:u.pendingClips},`composition_duration_derived:${u.seconds}`)},ha=()=>{let u=ut();return typeof u!="number"||!Number.isFinite(u)||u<=rn?null:u},yu=u=>Te(u)?Math.max(rn,u*D):rn,Cr=(u=!1)=>{let h=0;for(let g of e.deterministicAdapters){let S=u?g.getAnimationCycleEndSeconds:g.getInferredDurationSeconds;if(typeof S!="function")continue;let A=null;try{A=S()}catch(C){V("runtime.init.adapterDuration",C)}typeof A=="number"&&Number.isFinite(A)&&A>0&&(h=Math.max(h,A))}return h>rn?h:null},tt=!1,ga=()=>tt&&window.__HF_EXPORT_RENDER_SEEK_CONFIG!=null,de=[...["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",ms,"data-playback-rate","data-automation","data-playback-start","data-media-start","id","src"],"data-width","data-height"],Re=NE(de),wt=["loadedmetadata","durationchange","emptied"],nt=null,mn=-1,pn=null,No=Number.NEGATIVE_INFINITY,je=null,bt=0,sp=new Map,ba=u=>{if(!je||tt)return Array.from(document.querySelectorAll(u));Re(je.takeRecords())&&gn();let h=sp.get(u);if(h?.revision===bt)return h.nodes;let g=Array.from(document.querySelectorAll(u));return sp.set(u,{revision:bt,nodes:g}),g},hn=()=>{},gn=()=>{bt+=1,hn()},lp=()=>({media:ha(),authoredComposition:_r()}),C_=()=>{let u=window.__timelines??{},h="";for(let g of Object.keys(u)){let S=u[g];S&&(h+=`${g}=${ke(S)??"?"};`)}return h},up=u=>{let h=u.target;_e(h)&&As(h)||gn()},T_=(u,h)=>{let g=je?.takeRecords()??[];h();let S=je?.takeRecords()??[];(Re(g)||Re(S.filter(A=>A.target!==u)))&&gn()},R_=u=>{let h=je?.takeRecords()??[];u(),je?.takeRecords(),Re(h)&&gn()},cp=()=>{if(!(je||typeof MutationObserver>"u")){je=new MutationObserver(u=>{Re(u)&&gn()}),je.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:de});for(let u of wt)document.addEventListener(u,up,!0);s.push(()=>{je?.disconnect(),je=null,gn();for(let u of wt)document.removeEventListener(u,up,!0)})}};F=!0;let Tr=()=>{cp(),je&&Re(je.takeRecords())&&gn();let u=Date.now();if(!p.isPlaying()||u-No>=Wm){No=u;let h=C_();h!==pn&&(pn=h,gn())}return bt},dp=u=>tt?lp():(u??(u=Tr()),nt&&mn===u||(mn=u,nt=lp()),nt),rt=(u,h=0,g)=>{let S=null,A=$0({declared:Ge(z()?.getAttribute("data-duration")),timeline:()=>ke(u),floors:()=>{let{media:C,authoredComposition:P}=dp(g);return[C,P,Cr()]},fallback:h,derived:()=>(S=bu(),S.seconds??0)});return S?pa(S):window.__hf?.durationSource&&delete window.__hf.durationSource,A},xu=new WeakMap,Fo=u=>u.__hfReal??u,Su=null,Po=new Set,fp=()=>{for(let u of Po)u===e.capturedTimeline||u===Su?.timeline||(Po.delete(u),u.kill?.())},Eu=()=>{let u=window.__timelines??{},h=ye=>{let fe=Object.entries(u).filter(ae=>!!ae[1]&&typeof ae[1].play=="function"&&typeof ae[1].pause=="function");if(fe.length!==1)return{timeline:null};let j=fe[0];if(!j)return{timeline:null};let[ee,ce]=j;return{timeline:ce,selectedTimelineIds:[ee],selectedDurationSeconds:ke(ce),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:ye,soleTimelineId:ee}}}},g=st({timelineRegistry:u,includeAuthoredTimingAttrs:!0}),{media:S,authoredComposition:A}=dp(),C=Math.max(S??0,A??0)||null,P=yu(C),q=ye=>{let fe=document.querySelector(`[data-composition-id="${CSS.escape(ye)}"]`);return fe?g.resolveStartForElement(fe,0):0},B=(ye,fe)=>{let j=q(fe.compositionId);ye.add(fe.timeline,j),xu.set(Fo(fe.timeline),{hostId:fe.compositionId,parent:ye,at:j})},M=(ye,fe)=>{let j=Fo(fe.timeline),ee=xu.get(j);return ee&&ee.parent===ye&&j.parent===Fo(ye)?ee:null},J=(ye,fe)=>Math.abs(ye.at-q(fe.compositionId))<1e-6,ue=(ye,fe)=>{let j=M(ye,fe);!j||J(j,fe)||B(ye,fe)},be=ye=>{let fe=window.gsap;if(!fe||typeof fe.timeline!="function")return null;let j=fe.timeline({paused:!0});Po.add(j);for(let ee of ye)B(j,ee);return Kt(pe(j,ye)),j},se=(ye,fe)=>{if(!Te(ye))return null;let j=window.gsap;if(!j||typeof j.timeline!="function")return null;let ee=j.timeline({paused:!0});if(Po.add(ee),fe){try{ee.add(fe,0)}catch(ae){V("runtime.init.site2",ae)}Kt(pe(ee,[{timeline:fe}]))}let ce=ee;if(typeof ce.to=="function")try{ce.to({},{duration:ye,data:si})}catch(ae){V("runtime.init.site3",ae)}return ee},pe=(ye,fe)=>{if(!ye||typeof ye.getChildren!="function")return[];try{let j=ye.getChildren(!0,!0,!0);return Array.isArray(j)?fe.filter(ee=>j.includes(Fo(ee.timeline))):[]}catch{return[]}},Ye=(ye,fe)=>{let j=ye,ee={addedIds:[],nested:[]};if(typeof j.getChildren!="function")return ee;try{let ce=j.getChildren(!0,!0,!0)??[];if(!Array.isArray(ce))return ee;let ae=[];for(let ve of fe){if(ce.includes(Fo(ve.timeline))){ue(ye,ve);continue}try{B(ye,ve),ae.push(ve.compositionId)}catch(Ie){V("runtime.init.site4",Ie)}}return{addedIds:ae,nested:pe(ye,fe)}}catch{return ee}},Ke=z(),He=Ke?.getAttribute("data-composition-id")??null;if(!He)return h("root_missing_composition_id");let Xe=u[He]??null,We=(()=>{if(!Ke)return[];let ye=new Set,fe=Array.from(Ke.querySelectorAll("[data-composition-id]")),j=[];for(let ee of fe){let ce=ee.getAttribute("data-composition-id");if(!ce||ce===He||ye.has(ce))continue;ye.add(ce);let ae=u[ce]??null;if(!ae||typeof ae.play!="function"||typeof ae.pause!="function")continue;let ve=ke(ae);j.push({compositionId:ce,timeline:ae,durationSeconds:ve??0})}return j})(),Kt=ye=>{for(let fe of ye){let j=fe.timeline;if(typeof j.paused=="function")try{j.paused(!1)}catch(ee){V("runtime.init.site5",ee)}}};if(Xe){let ye=We.length>0?Ye(Xe,We):{addedIds:[],nested:[]},fe=ye.addedIds;if(Kt(ye.nested),(We.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id='"+He+"'])"))&&(Xn=!0),fe.length>0)try{yi(Xe,Xe.time(),!1)}catch{}wH(Xe);let j=ke(Xe);if(!Te(j)&&We.length>0){let ae=We.map(Yt=>Yt.compositionId),ve=be(We),Ie=ke(ve);if(ve&&Te(Ie))return{timeline:ve,selectedTimelineIds:ae,selectedDurationSeconds:Ie,mediaDurationFloorSeconds:S,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:He,rootDurationSeconds:j,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:P,selectedDurationSeconds:Ie,mediaDurationFloorSeconds:S,authoredCompositionDurationFloorSeconds:A,selectedTimelineIds:ae,autoNestedChildren:fe}}};let at=se(C??0,Xe),dt=ke(at);if(at&&Te(dt))return{timeline:at,selectedTimelineIds:[He],selectedDurationSeconds:dt,mediaDurationFloorSeconds:S,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:He,rootDurationSeconds:j,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:S,authoredCompositionDurationFloorSeconds:A,selectedDurationSeconds:dt,selectedTimelineIds:[He],autoNestedChildren:fe}}}}if(!Te(j)&&We.length===0){let ae=se(C??0,Xe),ve=ke(ae);if(ae&&Te(ve))return{timeline:ae,selectedTimelineIds:[He],selectedDurationSeconds:ve,mediaDurationFloorSeconds:S,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:He,rootDurationSeconds:j,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:S,authoredCompositionDurationFloorSeconds:A,selectedDurationSeconds:ve,selectedTimelineIds:[He]}}}}let ee=Ge(Ke?.getAttribute("data-duration")),ce=Math.max(Te(ee)?ee:0,A??0);if(ce>0&&Te(ce)&&Te(j)&&ce>=j+.5){let ae=Xe;if(typeof ae.to=="function")try{ae.to({},{duration:0,data:si},ce)}catch(Ie){V("runtime.init.site6",Ie)}let ve=ke(Xe);if(Te(ve))return{timeline:Xe,selectedTimelineIds:[He],selectedDurationSeconds:ve,mediaDurationFloorSeconds:S,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:He,rootDurationSeconds:j,rootDeclaredDur:ee,authoredCompositionDurationFloorSeconds:A,newDur:ve}}}}return{timeline:Xe,selectedTimelineIds:[He],selectedDurationSeconds:j,mediaDurationFloorSeconds:S,diagnostics:fe.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:He,selectedDurationSeconds:j,autoNestedChildren:fe}}:void 0}}if(We.length>0){let ye=We.map(ae=>ae.compositionId),fe=Su,j=fe?.size===We.length&&Te(ke(fe.timeline))&&We.every(ae=>{let ve=M(fe.timeline,ae);return ve!==null&&J(ve,ae)})?fe.timeline:null,ee=j??be(We),ce=ke(ee);if(ee)return j||(Su={timeline:ee,size:We.length}),{timeline:ee,selectedTimelineIds:ye,selectedDurationSeconds:ce,mediaDurationFloorSeconds:S,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:He,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:P,selectedDurationSeconds:ce,mediaDurationFloorSeconds:S,selectedTimelineIds:ye}}}}return h("root_composition_id_unmatched_in_registry")},Xn=!1,M_=u=>{let h=window.gsap,g=u;if(!(!g||typeof g.getChildren!="function"||!h||typeof h.parseEase!="function"))for(let S of g.getChildren(!0,!0,!0)){let A=S,C=A.timeline;if(!C||!("_ease"in C)||typeof C._ease=="function")continue;let P=A.vars?.keyframes,B=(P&&!Array.isArray(P)?P.ease:void 0)??A.vars?.ease??"none";try{let M=h.parseEase(B);typeof M=="function"&&(C._ease=M)}catch(M){St("keyframe_ease_repair_failed",{ease:typeof B=="string"?B:String(B)}),V("runtime.keyframeEase.repair",M)}}},Jn=()=>{if(v(),!Ue)return!1;let u=e.capturedTimeline,h=ke(u),g=Te(h);if(u&&g&&Xn)return!1;let S=Eu();if(!S.timeline)return!1;if(u&&u===S.timeline)return typeof u.timeScale=="function"&&u.timeScale(e.playbackRate),!1;e.capturedTimeline=S.timeline,fp(),typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),M_(e.capturedTimeline);let A=rt(e.capturedTimeline,0);if(A<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),dn(e.capturedTimeline)),A>0){try{p.setDuration(A)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let q=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(q,!1),dn(e.capturedTimeline)}let P=window.__hfStudioManualEditsApply;typeof P=="function"&&P(),qi(document)}if(S.diagnostics&&Ce({source:"hf-preview",type:"diagnostic",code:S.diagnostics.code,details:S.diagnostics.details}),Ce({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:S.selectedTimelineIds??[],selectedDurationSeconds:S.selectedDurationSeconds??null,mediaDurationFloorSeconds:S.mediaDurationFloorSeconds??null}}),t){let P=z(),q=A>0?A:0,B=String(q>0?q:1),M=new Set,J=se=>se.tagName.toLowerCase()===tn,ue=new Set(document.querySelectorAll("[data-start]")),be=se=>{let pe=se.parentElement;for(;pe&&pe!==P;){if(ue.has(pe))return!0;pe=pe.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let se of e.capturedTimeline.getChildren(!0))if(typeof se.targets=="function")for(let pe of se.targets())we(pe)&&pe!==P&&(J(pe)||pe.hasAttribute("data-start")||be(pe)||M.has(pe)||(M.add(pe),pe.setAttribute("data-start","0"),pe.setAttribute("data-duration",B),pe.setAttribute(Dt,"1")))}catch{}if(we(P))for(let se of P.querySelectorAll("[id]"))we(se)&&se!==P&&(se.hasAttribute("data-start")||be(se)||M.has(se)||se.tagName==="SCRIPT"||se.tagName==="STYLE"||se.tagName==="LINK"||J(se)||(M.add(se),se.setAttribute("data-start","0"),se.setAttribute("data-duration",B),se.setAttribute(Dt,"1")))}let C=vu();for(let P of bn)Io.delete(P),Au(P,C);return!0},mp=()=>{if(e.tornDown)return;let u=Eu();if(!u.timeline){e.capturedTimeline=null,Xn=!1,p.setDuration(0),jt(e.currentTime);return}if(e.capturedTimeline!==u.timeline)Xn=!1,Jn();else{let h=rt(e.capturedTimeline,0);h>0&&h!==p.getDuration()&&(p.setDuration(h),it())}jt(e.currentTime)};r=()=>{mp(),it()},window.__hfForceTimelineRebind=mp;let k_=()=>{let u=z();if(!we(u))return;let h=u.getBoundingClientRect(),g=dr(u.getAttribute("data-width")),S=dr(u.getAttribute("data-height")),A=window.getComputedStyle(u),C=g!==null&&S!==null,P=h.width<=0||h.height<=0||u.clientWidth<=0||u.clientHeight<=0;!C||!P||G("root_stage_layout_zero",{compositionId:u.getAttribute("data-composition-id")??null,declaredWidth:g,declaredHeight:S,rectWidth:Math.round(h.width),rectHeight:Math.round(h.height),clientWidth:u.clientWidth,clientHeight:u.clientHeight,display:A.display,visibility:A.visibility,overflow:A.overflow},`root-stage-layout-zero:${u.getAttribute("data-composition-id")??"unknown"}`)},L_=()=>{e.tornDown||(d!=null&&window.cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{d=null,k_()}))},N_=()=>{a=u=>{let h=Y(u.error??u.message).slice(0,I);if(!h)return;let g=W(h);Ce({source:"hf-preview",type:"diagnostic",code:g.code,details:{category:g.category,message:h,filename:u.filename||null,line:Number.isFinite(u.lineno)?u.lineno:null,column:Number.isFinite(u.colno)?u.colno:null}})},l=u=>{let h=Y(u.reason).slice(0,I);if(!h)return;let g=W(h);Ce({source:"hf-preview",type:"diagnostic",code:`${g.code}_unhandled_rejection`,details:{category:`${g.category}-unhandled-rejection`,message:h}})},window.addEventListener("error",a),window.addEventListener("unhandledrejection",l)},pp=new WeakSet,F_=()=>{let u=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let g of u){if(pp.has(g))continue;pp.add(g);let S=()=>{if(!Oe(g))return;let A=g.tagName.toLowerCase(),C=g.getAttribute("src")??g.getAttribute("href")??g.getAttribute("poster")??null,P=A==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";G(P,{tagName:A,assetUrl:C,currentSrc:(Je(g)||_e(g))&&g.currentSrc||null,readyState:_e(g)?g.readyState:null,networkState:_e(g)?g.networkState:null},`${P}:${A}:${C??"unknown"}`)};g.addEventListener("error",S),U(()=>{g.removeEventListener("error",S)})}let h=document.fonts;h&&h.ready.then(()=>{if(e.tornDown)return;let g=Array.from(h).filter(S=>S.status==="error").map(S=>S.family).filter(S=>!!S).slice(0,10);g.length!==0&&G("runtime_font_load_issue",{failedFamilies:g,totalFaces:Array.from(h).length},`runtime-font-load-issue:${g.join("|")}`)}).catch(()=>{})},P_=(u,h)=>{if(!u.timeline)return!1;let g=e.capturedTimeline;if(g&&g===u.timeline)return!1;let S=Math.max(0,e.currentTime||0);e.capturedTimeline=u.timeline,fp(),typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{dn(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&yi(e.capturedTimeline,S,!1)}catch(A){V("runtime.init.site7",A)}return Ce({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:h,previousTime:S,selectedTimelineIds:u.selectedTimelineIds??[],selectedDurationSeconds:u.selectedDurationSeconds??null,mediaDurationFloorSeconds:u.mediaDurationFloorSeconds??null}}),!0},Qn=null,hp=!1,bn=new Set,Io=new WeakMap,vu=()=>{let u;return()=>u??(u=Rc(e.capturedTimeline??{}))},ya=()=>{e.tornDown||(Qn!=null&&window.clearTimeout(Qn),Qn=window.setTimeout(()=>{if(e.tornDown||(Qn=null,ga()))return;let u=Eu();if(!u.timeline||!Te(u.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){Jn()&&(it(),ot(!0));return}if(hp)return;let g=ke(e.capturedTimeline),S=u.selectedDurationSeconds??ke(u.timeline);Te(S)&&(!Te(g)||S>=g+T)&&P_(u,"manual")&&(hp=!0,Ce({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:g??null,selectedDurationSeconds:S??null,selectedTimelineIds:u.selectedTimelineIds??[],mediaDurationFloorSeconds:u.mediaDurationFloorSeconds??null}}),it(),ot(!0))},H))},gp=u=>{_e(u.currentTarget)&&xy(u.currentTarget)},bp=u=>{let h=u.currentTarget;e.tornDown||p.isPlaying()||!_e(h)||to(h)||(yn=null,e.mediaForceSyncNextTick=!0,ht())},yp=u=>{_e(u.currentTarget)&&Sy(u.currentTarget)},xp=u=>{Xm(u)&&dw(u)&&Co(u,_o(u))},Sp=u=>{let h=u.currentTarget;_e(h)&&xp(h)},Ep=u=>{u.removeEventListener("loadedmetadata",ya),u.removeEventListener("durationchange",ya),u.removeEventListener("loadedmetadata",gp),u.removeEventListener("loadedmetadata",bp),u.removeEventListener("loadedmetadata",Sp),u.removeEventListener("error",yp),bn.delete(u)},I_=()=>{for(let u of bn)Ep(u)},vp=()=>{for(let u of bn)u.isConnected||(Ep(u),u.pause(),Ic(u),u.remove());b.releaseDetached()},Ap=u=>{let h=Number.parseFloat(u.dataset.volume??"");return Number.isFinite(h)?Math.max(0,Math.min(1,h)):null},xa=()=>{if(e.tornDown)return;let u=Array.from(document.querySelectorAll("video, audio")),h=[],g=vu();for(let S of u){if(bn.has(S))continue;bn.add(S);let A=Ap(S);A!==null&&(S.volume=A),S.addEventListener("loadedmetadata",ya),S.addEventListener("durationchange",ya),S.addEventListener("loadedmetadata",Sp),xp(S),S.addEventListener("loadedmetadata",gp),S.addEventListener("loadedmetadata",bp),S.addEventListener("error",yp),my(S),Tu(S)?h.push(S):vs(S),Au(S,g)}h.length>0&&jt(e.currentTime,h)},Au=(u,h)=>{Io.has(u)||a0(u,e.capturedTimeline,rt(e.capturedTimeline,0),Io,{allowLiveTimelineSeek:!window.__HF_RENDER_CAPTURE_MODE,...h&&{movers:h}})},wu=new WeakMap,D_=u=>{let h=wu.get(u);if(h!==void 0)return h;let g=window.getComputedStyle(u).position,S=g==="static"||g==="relative"||g==="sticky";return wu.set(u,S),S},_u=new WeakMap,O_=u=>{let h=_u.get(u);if(h!==void 0)return h;let g=u.querySelector("[data-start]")===null;return _u.set(u,g),g},H_=()=>{wu=new WeakMap,_u=new WeakMap},Rr=new WeakMap,wp=(u,h)=>{if(!Rr.has(u)){let g=u.style.getPropertyValue("display"),S=u.style.getPropertyPriority("display"),A=h&&g==="none"&&!S;Rr.set(u,A?{value:"",priority:""}:{value:g,priority:S})}u.style.display="none"},_p=u=>{let h=Rr.get(u);h&&(Rr.delete(u),h.value?u.style.setProperty("display",h.value,h.priority):u.style.removeProperty("display"))},Sa=new WeakSet,Ea=!1,Cp=u=>_e(u)&&u.hasAttribute("data-start")&&(Xm(u)||b.routesElement(u)),Tp=u=>Cp(u)||Array.from(u.querySelectorAll(Ww)).some(Cp),Rp=new WeakMap,G_=(u,h)=>{for(let g of la(document)){if(Ss(g)!==u||b.routesElement(g)||x(g))continue;let S=le(g),A=Ge(g.dataset.duration),C=A!=null&&A>0?S+A:1/0;if(Number.isFinite(S)&&h<C)return!0}return!1},B_=u=>{let h=!1;for(let g of ba(tn)){let S=g.hasAttribute("data-hidden"),A=Rp.get(g);A!==S&&(Rp.set(g,S),g.id&&(b.setGroupMuted(g.id,S),A&&!S&&G_(g.id,u)&&(h=!0)))}return h},Mp=u=>{let h=rt(e.capturedTimeline,0,u);return(g,S)=>Ps(g,{currentTime:S,compositionDuration:h,canonicalFps:e.canonicalFps,exportRenderSeek:!!window.__HF_EXPORT_RENDER_SEEK_CONFIG,timelineRegistry:window.__timelines??{},resolver:Ee(!0)})},kp=(u,h,g,S)=>{for(let A=u;A&&A!==S;A=A.parentElement)if(ar(A)&&A.hasAttribute("data-start")&&!n(A)&&!g(A,h))return!1;return!0},Lp=()=>({canonicalFps:e.canonicalFps,parked:Z0(),parkedClips:Ds}),Np=sc(),Fp=Qa(),U_=_g(u=>Fs(u,{timelineRegistry:window.__timelines??{},resolver:Ee(!0)})),va=new Set,Pp=new WeakSet,W_=u=>{if(va.size===0||!p.isPlaying())return;let h=[];for(let A of va){let C=$(A,Number.NaN);A.isConnected&&A.hasAttribute(Ve)&&!(C<=u+wa)||(va.delete(A),A.isConnected&&A.hasAttribute(Ve)&&C>u&&h.push(A))}if(h.length===0)return;let g=new Set(h.flatMap(A=>A.closest(`[${Ct}]`)??[]));for(let A of g)A.removeAttribute(Ct);let S=ac(h);getComputedStyle(h[0]).visibility,S();for(let A of g)A.setAttribute(Ct,"");for(let A of h)Pp.add(A)},Aa=u=>!1,wa=2,_a=4,Cu=(u,h,g,S=wa)=>{let A=_e(u)?le(u):$(u,Number.NaN),C=A+(Q(u)??Number.NaN);return A>g&&A<=g+S||C<=g&&C>=g-S||h(u,g+S)},Mr=null,Tu=u=>Fp&&u.hasAttribute("data-start")&&As(u),kr=new WeakMap,Ru=new WeakMap,Do=new WeakSet,Mu=new WeakSet,Ip=u=>y0(u,()=>!e.tornDown&&kr.get(u)===!0&&le(u)>p.now()),Dp=u=>u.parentElement?.closest("[data-composition-id]"),Op=3,Oo=new Set,Ho=new Set,Hp=["canplay","suspend","error"],Gp=u=>{for(let h of Hp)u.removeEventListener(h,Bp);return Oo.delete(u)},Bp=u=>{let h=u.currentTarget;u.type!=="error"&&h.readyState<3||(Gp(h),Up())},Up=()=>{let u=Array.from(Ho).filter(h=>h.isConnected).sort((h,g)=>le(h)-le(g));for(let h of u){if(Oo.size>=Op)break;Ho.delete(h),jt(e.currentTime,[h])}},Wp=u=>{if(vs(u),Ip(u),!(Oo.has(u)||u.readyState>=3)){Oo.add(u);for(let h of Hp)u.addEventListener(h,Bp)}},V_=u=>{let h=Qr(u,Number.NaN),g=Uo(Array.from(bn).filter(C=>C.isConnected&&Qr(C,Number.NaN)===h&&Dp(C)===Dp(u))).mediaClips,S=g.find(C=>C.el===u)?.end??Number.NaN,A;for(let C of g)C.el!==u&&C.start>=S-ni(S)&&!(A&&A.start<=C.start)&&(A=C);!A||!Tu(A.el)||(Ru.set(A.el,u),kr.get(A.el)!==!0&&(kr.set(A.el,!0),Ho.delete(A.el),Wp(A.el)))},$_=(u,h,g,S,A)=>{let C=p.isPlaying();h&&C?Do.has(u)||(Do.add(u),V_(u)):Do.delete(u);let P=Ru.get(u),q=P!==void 0&&Do.has(P),B=kr.get(u),M=!h&&!q&&B!==!0&&Oo.size>=Op;M&&g?Ho.add(u):Ho.delete(u);let ue=!h&&!A&&C&&le(u)+(Q(u)??Number.NaN)<=S&&(B!==!0||u.networkState===2&&u.readyState<4),be=h||q||g&&!M&&!ue;(h||!be)&&Gp(u)&&queueMicrotask(Up);let se=be&&!h&&le(u)>p.now(),pe=Mu.has(u);if(se?Mu.add(u):Mu.delete(u),B===be){se&&!pe&&Ip(u);return}kr.set(u,be),be?(!h||B===void 0)&&(h?vs(u):Wp(u)):u.preload!=="none"&&(u.preload="none",B&&T_(u,()=>x0(u)))},Vp=(u,h)=>Mr!==null&&p.isPlaying()&&(h(u,Mr)||Cu(u,h,Mr,_a)),q_=(u,h,g)=>kr.get(u)===!0&&Cu(u,h,g,_a)||Vp(u,h),ku=new WeakMap,$p=new WeakSet,Lu=new WeakSet,qp=new WeakMap,zp=u=>u.style.visibility==="hidden"&&u.style.getPropertyPriority("visibility")!=="important"&&!Lu.has(u),Nu=new WeakMap,Fu=(u,h)=>{for(let g=u.parentElement;g&&g!==h;g=g.parentElement)if(g.hasAttribute("data-start")&&ar(g)&&zp(g))return!0;return!1},Pu=new Map,jp=-1,z_=_a+wa+1,j_=1,K_=(u,h,g)=>{let S=g(u);if(!S||!Number.isFinite(S.start))return null;let A=[];for(let C of[0,wa,_a])A.push(S.start-C,S.end-C,S.end+C);for(let C=u.parentElement;C&&C!==h;C=C.parentElement){if(!C.hasAttribute("data-start"))continue;let P=g(C);if(!P||!Number.isFinite(P.start))return null;A.push(P.start,P.end)}return A.filter(C=>Number.isFinite(C))},Y_=(u,h,g,S)=>{if(!g||!(Math.abs(h-u)<=j_))return null;if(jp!==S)return Pu.clear(),jp=S,null;let A={timelineRegistry:window.__timelines??{},resolver:Ee(!0)},C=B=>Fs(B,A),P=Math.min(u,h),q=Math.max(u,h);return B=>{let M=ku.get(B);if(M===void 0||_e(B)&&(Ru.has(B)||Do.has(B))||!B.hasAttribute(Dt)&&B.style.visibility!==(M?"visible":"hidden")||Fu(B,g)!==(Nu.get(B)??!1))return!1;let J=Pu.get(B);if(J===void 0&&(J=K_(B,g,C),Pu.set(B,J)),!J)return!1;for(let ue of J)if(ue>=P&&ue<=q||Mr!==null&&Math.abs(ue-Mr)<=z_)return!1;return!0}},X_=(u,h,g,S)=>{if(Aa(u))return;let A=z(),C=!1,P=Mp(g),q=S===void 0||g===void 0?null:Y_(S,u,A,g);for(let M of h){if(!ar(M))continue;if(M.hasAttribute("data-hidden")){Sa.has(M)||(Sa.add(M),Tp(M)&&(Ea=!0)),wp(M,!1),(Le(M)||Je(M))&&i?.setSourceVisibility(M,!1);continue}if(Sa.has(M)&&(_p(M),Sa.delete(M),Tp(M)&&(Ea=!0)),!M.hasAttribute("data-start")||q?.(M))continue;let ue=Fu(M,A);Nu.set(M,ue);let be=P(M,u)&&kp(M.parentElement,u,P,A)&&!ue;ku.set(M,be);let se=n(M);if($p.has(M)||($p.add(M),M.style.visibility==="hidden"&&Lu.add(M)),!se&&!(be&&zp(M))){let Ye=M.style,Ke=Ye.getPropertyPriority("visibility")==="important";!be&&!Ke&&!Lu.has(M)&&qp.set(M,Ye.getPropertyValue("visibility"));let He=be?Ke&&qp.get(M)||"visible":"hidden";Ye.setProperty("visibility",He,be?"":"important")}M.toggleAttribute(Ve,!se&&!be),!se&&!be&&!Pp.has(M)&&va.add(M);let pe=(Np||Fp)&&!be&&Cu(M,P,u);pe&&!M.hasAttribute(or)&&Hw(M),M.toggleAttribute(or,pe),_e(M)&&bn.has(M)&&Tu(M)&&$_(M,be,pe||q_(M,P,u),u,Vp(M,P)),!_e(M)&&!Je(M)&&(C=!0),(Le(M)||Je(M))&&i?.setSourceVisibility(M,be),be?_p(M):D_(M)&&O_(M)&&wp(M,!0)}C&&fg()&&i?.refresh(),U_(u);let B=B_(u);if((Ea||B)&&p.isPlaying()){b.stopAll();for(let M of la(document))x(M)&&(M.volume=0);Yu()}Ea=!1},J_=u=>{let h=z(),g=ba("[data-start]").filter(S=>ku.has(S)&&Fu(S,h)!==(Nu.get(S)??!1));g.length>0&&jt(u,g)},jt=(u,h=ba("[data-start], [data-hidden]"),g,S)=>ge(()=>X_(u,h,g,S)),Q_=u=>ge(()=>{if(!Np)return[];let h=z(),g=Mp();return Array.from(document.images).filter(S=>S.closest(`[data-start]:not([${Dt}])[style*="visibility: hidden"]`)!==null&&(S.closest(Ja)!==null||!S.complete)&&kp(S,u,g,h))}),Go=null,yn=null,Bo=[],Kp=u=>u.hasAttribute("data-start")||!!Z(u).compositionRoot,Uo=u=>L0({elements:u,shouldIncludeElement:Kp,resolveStartSeconds:h=>le(h),resolveDurationSeconds:h=>{let g=Z(h),S=le(h),A=g.inheritedStart!=null&&g.inheritedDuration!=null&&g.inheritedDuration>0?Math.max(0,g.inheritedStart+g.inheritedDuration-S):null,C=Number.isFinite(h.duration)?Gt(h,h.duration):null,P=Ge(h.dataset.duration),q=P!=null&&P>0?P:null;return k0({isVideo:h.tagName==="VIDEO",sourceDuration:C,hostRemaining:A,explicitDuration:q})},resolveHostSlots:me}),Z_=(u=Tr())=>{if(Go&&Go.revision===u)return Go;let h=Uo().mediaClips;return Go={revision:u,clips:h,byStart:[...h].sort((g,S)=>g.start-S.start),byEnd:[...h].sort((g,S)=>g.end-S.end)},yn=null,Bo=[],Go},Iu=(u,h,g,S)=>{let A=0,C=u.length;for(;A<C;){let q=A+C>>1;h(u[q])<g?A=q+1:C=q}let P=[];for(let q=A;q<u.length&&h(u[q])<=S;q+=1)P.push(u[q]);return P},eC=(u,h,g)=>{let S=yn;if(S===null)return u.clips.map(B=>B.el);let A=2*ni(Math.max(Math.abs(S),Math.abs(h))),C=Math.min(S,h)-A,P=Math.max(S,h)+A,q=new Set;for(let B of Bo)q.add(B.el);for(let B of Iu(u.byStart,M=>M.start,C,P+g))q.add(B.el);for(let B of Iu(u.byEnd,M=>M.end,C,P))q.add(B.el);if(e.isPlaying&&!window.__HF_EXPORT_RENDER_SEEK_CONFIG)for(let B of Iu(u.byStart,M=>M.start,h,h+zc*e.playbackRate))B.el.tagName==="VIDEO"&&q.add(B.el);return[...q]},Ca=new WeakSet,Yp=u=>{Ca.add(u)},Xp=u=>{Ca.delete(u),hn()};window.__hf.leasePausedMedia=Yp,window.__hf.releasePausedMedia=Xp;let Jp=u=>e.nativeMediaSyncDisabled?null:e.isPlaying?u:u.filter(h=>!Ca.has(h.el));window.__hf.setLoopStart=u=>{Mr=u!=null&&Number.isFinite(u)&&u>=0?u:null};let tC=u=>{let h=xu.get(u)?.hostId,g=h?document.querySelector(`[data-composition-id="${CSS.escape(h)}"]`):null,S=g?Q(g):null;return g&&S?$(g,0)+S:1/0},Qp=u=>{let h=0;for(let g of u){if(g.data===si)continue;let S=g.getChildren?g:g.timeline,A=Number(g.duration?.())/Number(S?.duration?.()),C=S?.getChildren?Qp(S.getChildren(!1,!0,!0))*(Number.isFinite(A)&&A>0?A:1):Number(g.duration?.())||0,P=Math.abs(Number(g.timeScale?.())||1),q=(Number(g.startTime?.())||0)+C/P;q>=Jr||(h=Math.max(h,Math.min(q,tC(g))))}return h};window.__hf.animationEnd=()=>{let u=e.capturedTimeline,h=u?.getChildren?Qp(u.getChildren(!1,!0,!0)):ke(u)??0,g=Math.max(h,Cr(!0)??0);return g>0&&g<Jr?g:null},window.__hf.audioMeter={start:()=>b.startMetering(),stop:()=>b.stopMetering(),read:()=>b.readLevels()};let nC=()=>{for(let u of document.querySelectorAll("video, audio"))if(_e(u)&&!u.paused&&Kp(u)&&!Ca.has(u))return!0;return!1},Zp=()=>hn();document.addEventListener("play",Zp,!0),s.push(()=>{document.removeEventListener("play",Zp,!0)});let Du=null,ht=u=>{let h=!tt,g=e.isPlaying&&!e.mediaForceSyncNextTick&&yn!==null?Math.min(Math.max(0,e.currentTime-yn),kn*Math.min(1,e.playbackRate)):0,S=ge(()=>{if(!h)return Uo().mediaClips;let q=Z_(u);return Uo(eC(q,e.currentTime,g)).mediaClips});for(let q of S){let B=Io.get(q.el);B&&(q.volumeKeyframes=B)}let A=Jp(S),C=e.mediaForceSyncNextTick;C&&(e.mediaForceSyncNextTick=!1),A&&(N0({clips:A,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted,userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:C,cueAheadSeconds:g,getCompositionDuration:()=>rt(e.capturedTimeline,0,u),onElementVolume:(q,B,M,J,ue)=>b.setElementVolume(q,M,J,ue),isWebAudioOwned:q=>b.ownsElement(q),isWebAudioRouted:q=>b.routesElement(q),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,Ce({source:"hf-preview",type:"media-autoplay-blocked"}))}}),h?(yn=e.currentTime,Bo=S.filter(q=>Mn(e.currentTime,q.start-kn,q.end))):(yn=null,Bo=[]));let P=h&&e.isPlaying&&!C&&Du!==null?Du:void 0;jt(e.currentTime,void 0,u,P),Du=e.currentTime},ot=u=>{u&&hn(),u&&Hu&&!p.isPlaying()&&it();let h=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),g=Date.now();(u||h!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||g-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=h,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=g,Ce({source:"hf-preview",type:"state",frame:h,currentTime:e.currentTime||0,ended:p.reachedEnd(),isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},Ou="",eh=!1,th=!1,nh=0,rh="",rC=()=>{let u="";for(let h of document.querySelectorAll("[data-start]"))u+=`${h.id}:${h.tagName}|`;return u},Hu=!1,Ta=!1,Gu=!1,oC=()=>{Gu||(Gu=!0,w0().then(()=>window.requestAnimationFrame(()=>setTimeout(()=>{Gu=!1,Ta=!1,e.tornDown||it()}))))},it=()=>{N(),O(),k();let u=z();if(u){let{width:S,height:A}=B0(u);S!==null&&A!==null&&Ce({source:"hf-preview",type:"stage-size",width:S,height:A})}if(Jn(),Hu=p.isPlaying(),Hu){delete window.__clipTree;return}if(Ta&&!tt&&_0())return oC();Ta=!1;let h=nd(Lp());window.__clipManifest=h,rh=JSON.stringify(h);let g=rC();if(Ou!==g&&H_(),!window.__clipTree||Ou!==g){let S=window;window.__clipTree=Qg({startResolver:st({timelineRegistry:S.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:S.__timelines??{},rootDuration:h.durationInFrames/e.canonicalFps}),Ou=g}Ce({...h,assetsReady:th}),eh||(eh=!0,Tw(document,({timedOut:S})=>{e.tornDown||(th=!0,Ce({source:"hf-preview",type:"assets-ready",timedOut:S}))})),L_()},iC=()=>{JSON.stringify(nd(Lp()))!==rh&&it()},Bu=u=>typeof u=="number"&&Number.isFinite(u)&&u>0?u:0,aC=u=>{let h=Bu(Number(u));if(h<=0)return;let g=z(),S=Bu(Ge(g?.getAttribute("data-duration"))),A=Math.max(nh,Bu(p.getDuration()),S);h<=A||(nh=h,g?.setAttribute("data-duration",String(h)),p.setDuration(h),it(),ot(!0))},ct=(u,h=0,g)=>{for(let S of e.deterministicAdapters){try{u==="discover"&&S.discover(),u==="pause"&&S.pause({pageAnimations:g}),u==="play"&&S.play&&S.play()}catch(A){V("runtime.init.site8",A)}if(u==="discover")try{S.seek({time:h,suppressEvents:!0})}catch(A){V("runtime.init.site9",A)}}},Zn=()=>{window.__renderReady=!1},sC=Dw(()=>{let u=[];for(let h of e.deterministicAdapters){let g=h.getReadyPromise;if(typeof g=="function")try{let S=g();S&&u.push(S)}catch(S){V("runtime.init.adapterReady",S)}}return u},()=>Zn(),u=>V("runtime.init.adapterReady",u)),lC=Dw(()=>{let u=window.__hf?.buildReady;return u?Object.values(u).filter(h=>h!=null&&typeof h.then=="function"):[]},()=>Zn(),u=>V("runtime.init.buildReady",u));function Uu(){let u=z();u&&UA({root:u,fps:e.canonicalFps,durationSeconds:()=>rt(e.capturedTimeline,0)||Number(u.getAttribute("data-duration"))||0,timeline:()=>e.capturedTimeline,now:()=>Math.max(0,e.currentTime||0),seek:(h,g)=>{Nh(e.capturedTimeline,h,{suppressEvents:g})},ignoreMutations:R_})}let uC=()=>{xa(),F_();let u=Of();return Fl(document),ql(document.body,e.canonicalFps),Uu(),u};if(Ue)Of();else{let u={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:X,onDiagnostic:({code:h,details:g})=>{Ce({source:"hf-preview",type:"diagnostic",code:h,details:g})}};bE(u).finally(()=>{Ue=!0,uC(),Zn()})}let oh=u=>{let h=new Set,g=S=>{for(let A of(S??"").matchAll(/url\(\s*(['"]?)(.*?)\1\s*\)|@import\s+(['"])(.*?)\3/gi))h.add(A[2]??A[4]);for(let A of(S??"").matchAll(/image-set\((?:[^()]|\([^()]*\))*\)/gi))for(let C of A[0].matchAll(/(['"])(.*?)\1/g))h.add(C[2])};for(let S of u)if(S.tagName==="STYLE"&&g(S.textContent),!(S.tagName==="STYLE"||S.tagName==="SCRIPT"))for(let A of[S,...S.querySelectorAll("*")]){let C=MH.get(A.localName)??[],P=[LE(A),...[...C,"poster","srcset"].map(q=>A.getAttribute(q))];for(let q of P)q&&h.add(q);g(A.getAttribute("style"))}return h},Wu=0,cC=(u,h,g)=>{let S=new Map;for(let A of g?u.querySelectorAll("video, audio"):[]){let C=ca.get(A);if(!C||i?.isGraded(A))continue;let{srcObject:P,sinkId:q,mediaKeys:B}=A;P||q||B||S.set(C,[...S.get(C)??[],A])}for(let A of h.querySelectorAll("video, audio")){let C=Jm(A),P=S.get(C)?.shift();if(!P||Ow(P)!==Ow(A)){ca.set(A,C);continue}A.replaceWith(P),window.gsap?.set?.(P,{clearProps:"all"});let q=A.getAttribute("style");q===null?P.removeAttribute("style"):P.setAttribute("style",q),TE(P);let B=P;B.volume=Ap(B)??1,B.muted=e.bridgeMuted||e.mediaOutputMuted||B.defaultMuted,B.defaultPlaybackRate=1,B.playbackRate=e.playbackRate,B.preservesPitch=!0}},Ra=u=>[u,...u.querySelectorAll("[data-composition-id]")].flatMap(h=>h.getAttribute("data-composition-id")||[]),ih=u=>{let h=new Set([e.capturedTimeline,window.gsap?.globalTimeline,...Po]);for(let[g,S]of Object.entries(window.__timelines??{}))u.includes(g)||h.add(S);return h},Vu=(u,h)=>{let g=ih(h);return(u.getChildren?u.getChildren(!0,!0,!1):[u]).flatMap(A=>(A.targets?.()??[]).filter(C=>typeof C?.totalTime=="function"&&typeof C.kill=="function"&&!g.has(C)))},dC=(u,h,g,S)=>{let A=Ra(h),C=new Set(A.flatMap(B=>[g[B],...S[B]??[]]));for(let B of C)if(B)for(let M of Vu(B,A))C.add(M);let P=new Set([h,...h.querySelectorAll("*")]);for(let B of window.gsap?.globalTimeline?.getChildren?.(!0,!0,!1)??[]){if(!B.targets?.().some(J=>P.has(J)))continue;let M=B;for(;M&&!C.has(M);)M=M.parent;if(!M)throw new Error(`scene ${u} cannot be swapped: an animation outside it moves its elements`)}let q=B=>typeof B?.nodeType=="number"&&!P.has(B);for(let B of C)for(let M of B?[B,...B.getChildren?.(!0,!0,!1)??[]]:[])if(M.targets?.().some(q))throw new Error(`scene ${u} cannot be swapped: its animations write outside the scene`)},ah=async(u,h)=>{let g=window.gsap?.globalTimeline,S=new Set(g?.getChildren?.(!1,!0,!0));await Tl(h);let A=window.__hfSceneAnimations,C=u.length===1?Ra(u[0])[0]:void 0;if(!A||!C||!g?.getChildren)return;await Vi(),await new Promise(B=>window.setTimeout(B,0));let P=new Set([...Object.values(A).flat(),...ih([C])]),q=g.getChildren(!1,!0,!0).filter(B=>!S.has(B)&&!P.has(B));(A[C]??(A[C]=[])).push(...q)},sh=(u,h=()=>{})=>{let g=()=>window.__timelines??(window.__timelines={}),S=()=>window.__hfSceneAnimations??(window.__hfSceneAnimations={}),A=e.capturedTimeline,C=u.flatMap(J=>Ra(J)),P=new Set,q=J=>{if(!J||P.has(J))return;P.add(J);let ue=J;ue.revert?ue.revert():ue.totalTime?.(0,!0),A?.remove?.(J),ue.revert||ue.kill?.()},B=()=>{let J=P.size,ue=C.flatMap(se=>[...(S()[se]??[]).slice().reverse(),g()[se]]),be=new Set;for(let se of ue)se&&Vu(se,C).forEach(pe=>be.add(pe));for(let se of be)Vu(se,C).forEach(pe=>be.add(pe));for(let se of[...ue.filter(pe=>!be.has(pe)),...be])q(se);return P.size>J},M=0;for(;B();)if(++M>8)throw new Error("the old scene keeps starting animations as they stop");h();for(let J of C)delete g()[J],delete S()[J]},fC=u=>{let h=En(e.currentTime);ct("pause",0,h),ct("play"),y&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&Xu(u.flatMap(la),b.currentGeneration())},lh=(u,h,g,S=!1)=>{for(let B of u)Fl(document,B);xa();let A=()=>{for(let B of h)for(let M of[B,...B.querySelectorAll("[data-composition-id]")]){let J=M.getAttribute("data-composition-id");J&&window.__timelines?.[J]?.totalTime?.(0,!0)}};ql(document.body,e.canonicalFps),Uu(),Hf(g,h,A),vp(),Xn=!1,Jn();let C=vu();for(let B of u)for(let M of B.querySelectorAll("video, audio"))Io.delete(M),Au(M,C);let P=rt(e.capturedTimeline,0);P>0&&p.setDuration(P),ct("discover",e.currentTime),qi(document);let q=p.isPlaying()&&P>0&&e.currentTime>=P;S&&p.isPlaying()&&!q?fC(u):Fa.seek(q?P:e.currentTime,{keepPlaying:!q}),jt(e.currentTime),it()},uh=u=>{let h=P=>Array.from(P.querySelectorAll(`style[${mc}]`)),g=h(document),S=new Set(g.flatMap(P=>pc(P.textContent??""))),A=new Set(h(u).flatMap(P=>pc(P.textContent??"")).filter(P=>!S.has(P)));if(A.size===0)return;let C=document.createElement("style");C.setAttribute(mc,""),C.textContent=[...A].join(`
|
|
1129
|
-
`),g.length>0?g.at(-1).after(C):document.head.prepend(C)},mC=async(u,h)=>{let g=Wu,S=new DOMParser().parseFromString(u,"text/html"),A=ua(document),C=ua(S);if(!A||!C)throw new Error("no scene manifest");if(A.shared!==C.shared)throw new Error("the film changed outside its scenes");let P=Object.keys(C.scenes);if(P.length!==Object.keys(A.scenes).length||P.some(j=>!(j in A.scenes)))throw new Error("scenes were added or removed");let q=P.filter(j=>C.scenes[j]!==A.scenes[j]);if(q.length===0)throw new Error("no scene changed");let B=(j,ee)=>Array.from(j.querySelectorAll(`[${ft}="${CSS.escape(ee)}"]`)),M=j=>{let ee=mi(j);return ee!==null&&mr(ee)},J=j=>j.filter(ee=>ee.tagName==="STYLE"),ue=q.filter(M).map(j=>{let ee=B(S,j),ce=ee.find(Ie=>Ie.tagName!=="STYLE"&&Ie.tagName!=="SCRIPT");if(!ce)throw new Error(`scene ${j} cannot be swapped: it has no single host`);let ae=ce.getAttribute(wn);if(ae!==null)throw new Error(`scene ${j} cannot be swapped: ${ae}`);if(!od(ce))throw new Error(`scene ${j} cannot be swapped: a clip's length is not written`);let ve=J(B(document,j));if(ve.length!==J(ee).length)throw new Error(`scene ${j} cannot be swapped: its styles moved`);return{name:j,parts:ee,host:ce,oldStyles:ve}});ue.length>0&&uh(S);for(let{name:j,parts:ee,host:ce,oldStyles:ae}of ue){let ve=J(ee);ae.forEach((Ie,at)=>Ie.replaceWith(document.importNode(ve[at],!0))),sd(j,ce,ee.filter(Ie=>Ie.tagName==="SCRIPT"))}let be=q.filter(j=>!M(j));if(be.length===0){document.querySelector(`meta[name="${An}"]`)?.setAttribute("content",JSON.stringify(C)),it();return}let se=be.map(j=>{let ee=Pr=>Pr.tagName!=="STYLE"&&Pr.tagName!=="SCRIPT",ce=B(document,j),ae=B(S,j),ve=ce.filter(ee),Ie=ae.filter(ee),at=ve[0],dt=Ie[0];if(!at||!dt||ve.length>1||Ie.length>1)throw new Error(`scene ${j} cannot be swapped: it has no single host`);if(at.hasAttribute("data-hf-original-composition-id"))throw new Error(`scene ${j} cannot be swapped: it is a duplicated instance`);let Yt=at.getAttribute(wn)??dt.getAttribute(wn);if(Yt!==null)throw new Error(`scene ${j} cannot be swapped: ${Yt}`);let FC=oh(ce);if([...oh(ae)].some(Pr=>!FC.has(Pr)))throw new Error(`scene ${j} cannot be swapped: it loads media this scene has not loaded`);if(J(ce).length!==J(ae).length)throw new Error(`scene ${j} cannot be swapped: its styles moved`);return{name:j,oldParts:ce,homes:ce.map(Pr=>Pr.parentNode),newParts:ae,oldHost:at,newHost:dt}}),pe=()=>{let j=z(),ee=new Set;for(let ce of document.querySelectorAll(`[${ft}]`)){if(ce.tagName==="STYLE"||ce.tagName==="SCRIPT")continue;let ae=ce.parentElement;for(;ae;ae=ae===j?null:ae.parentElement)ee.add(ae)}return[...ee].flatMap(ce=>[ce,...Array.from(ce.children).filter(ae=>!ae.hasAttribute("data-hf-ignore")),null])},Ye=pe(),Ke=se.some(({newHost:j})=>j.querySelector(".caption-group"))?await Df():[];if(e.tornDown)throw new Error("the preview was torn down during the swap");if(h?.aborted)throw new Error("the swap was cancelled");if(g!==Wu)throw new Error("the preview changed while this swap waited");let He=()=>{let j=({oldParts:ae,homes:ve})=>ae.some((Ie,at)=>!Ie.isConnected||Ie.parentNode!==ve[at]),ee=pe();if(ee.length!==Ye.length||ee.some((ae,ve)=>ae!==Ye[ve])||se.some(j))throw new Error("a scene changed while this swap waited")};He();let Xe=()=>window.__timelines??(window.__timelines={}),Wa=()=>window.__hfSceneAnimations??(window.__hfSceneAnimations={}),
|
|
1130
|
-
`);if(A===ka)return g!==void 0;let C=Pt.filter(({name:M})=>S.has(M)&&h(M)).sort((M,J)=>Math.abs(M.start-u)-Math.abs(J.start-u))[0],P=g??C,q=P?[]:Pt.filter(({name:M})=>!S.has(M)&&!h(M));if(!P&&q.length===0)return ka=A,!1;let B=M=>La.has(M)||Is(Pt,e.currentTime,p.isPlaying()).has(M);return er=(async()=>{if(g)await dh(g.name);else if(P)await $u(),B(P.name)&&await dh(P.name);else for(let{name:M}of q)hC(M)})().finally(()=>{er=null,ka="",Aa(e.currentTime)}),g&&Qe(er),g!==void 0};let gC=async u=>{La=new Set(u.filter(h=>Pt.some(g=>g.name===h))),ka="";for(let h=0;h<=Pt.length&&!e.tornDown;h++){if(Aa(e.currentTime),![...La].some(g=>Ma.has(g)))return;await(er??Promise.resolve())}};ua(document)&&(window.__hfSwapScenes=mC,window.__hfHoldScenes=gC,window.__hfParkedSceneMarkup=ld,U(()=>{delete window.__hfSwapScenes,delete window.__hfHoldScenes,delete window.__hfParkedSceneMarkup}));let Na=nx({postMessage:u=>Ce(u)});Na.installPickerApi(),jt(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let It=yv({lease:Yp,release:Xp});i=It,U(()=>{It.destroy(),i=null}),ql(document.body,e.canonicalFps),Uu();let qu=u=>{let h=Number(u);!Number.isFinite(h)||h<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,h)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate)},bC=1e3,xn=null,fh=()=>{let u=xn;xn=null,u?.apply()},mh=(u,h)=>{b.stopAll(),p.detachAudioSource();let g=p.isPlaying();g&&p.pause(),p.seek(u),e.currentTime=p.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let S=h?.keepPlaying&&g;Ta=!S,S||ht();let A=e.capturedTimeline;dn(A);let C=En(e.currentTime);if(S||J_(e.currentTime),ct("pause",0,C),S){Fa.play();return}It.redraw(),dm(e.currentTime);let P=So(e.currentTime);P&&Qe(P),ot(!0)},Fa={play:()=>{fh();let u=e.capturedTimeline;if(p.isPlaying())return;let h=rt(u,0);if(h>0){if(p.setDuration(h),p.reachedEnd()){let g=p.getPlayStart();p.seek(g),e.currentTime=g,En(g)}}else{let g=z(),S=Number(g?.getAttribute("data-duration")??0);S>0&&p.setDuration(S)}dn(u),p.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,Bh(p.now()),y&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&Yu(),ct("play"),ht(),It.redraw(),ot(!0))},pause:()=>{if(!p.isPlaying())return;b.stopAll(),p.detachAudioSource(),p.pause(),e.isPlaying=!1,e.currentTime=p.now(),e.mediaForceSyncNextTick=!0,Bh(e.currentTime);let u=e.capturedTimeline;dn(u),ct("pause"),ht(),It.redraw(),So(e.currentTime),ot(!0)},seek:(u,h)=>{let g=Xc(Math.max(0,Number(u)||0),e.canonicalFps);xn=null;let S=p.isPlaying()?[]:Q_(g);if(S.length===0){mh(g,h);return}let A={time:g,apply:()=>mh(g,h)};xn=A;for(let M of S){Hw(M);for(let J=M.closest(Ja);J;J=M.closest(Ja))J.setAttribute(or,"")}let C=0,P=new Promise(M=>{C=window.setTimeout(()=>{xn===A&&V("runtime.init.seekHoldCap",S),M()},bC)}),q=Promise.all(S.map(M=>M.decode?M.decode().catch(()=>{}):void 0)),B=Promise.race([q,P]).then(()=>{window.clearTimeout(C),xn===A&&fh()});return Qe(B),B},renderSeek:(u,h)=>{xn=null,tt=!0;let g=sl(Math.max(0,Number(u)||0),e.canonicalFps,h);b.stopAll(),p.detachAudioSource(),p.isPlaying()&&p.pause(),p.seek(g),e.currentTime=p.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let S=En(e.currentTime,{suppressEvents:h?.suppressEvents});ct("pause",0,S),ht(),It.redraw(),dm(e.currentTime,{engineMode:!0});let A=So(e.currentTime,{engineMode:!0});A&&Qe(A),ot(!0)},getTime:()=>xn?.time??p.now(),getDuration:()=>{let u=p.getDuration();return Number.isFinite(u)?u:0},isPlaying:()=>p.isPlaying(),setPlaybackRate:u=>{qu(u),p.setRate(e.playbackRate),Wh()},getPlaybackRate:()=>e.playbackRate},ph=rt(e.capturedTimeline,0);ph>0&&p.setDuration(ph);let tr=ox({getTimeline:()=>e.capturedTimeline,setTimeline:u=>{e.capturedTimeline=u},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:u=>{e.isPlaying!==u&&(e.mediaForceSyncNextTick=!0),e.isPlaying=u},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:qu,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(u,h)=>{e.currentTime=Math.max(0,Number(u)||0),e.isPlaying!==h&&(e.mediaForceSyncNextTick=!0),e.isPlaying=h,ht()},onStatePost:ot,onDeterministicSeek:(u,h)=>{for(let g of e.deterministicAdapters)if(!(g.name==="gsap"&&e.capturedTimeline))try{g.seek({time:Number(u)||0,suppressEvents:h?.suppressEvents})}catch(S){V("runtime.init.site11",S)}},onDeterministicPause:()=>ct("pause"),onDeterministicPlay:()=>ct("play"),onRenderFrameSeek:()=>{It.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>rt(e.capturedTimeline,0),transport:Fa});window.__player=R(tr),window.__playerReady=!0,St("composition_loaded",{duration:tr.getDuration(),compositionId:xt()?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[jb({start:u=>$(u,0),duration:u=>Q(u),compositionDuration:()=>rt(e.capturedTimeline,0),canonicalFps:()=>e.canonicalFps,exportRenderSeek:()=>!!window.__HF_EXPORT_RENDER_SEEK_CONFIG}),Jb(),Ab({resolveStartSeconds:u=>$(u,0)}),Fb(),Ob({resolveStartSeconds:u=>$(u,0)}),Hb(),Gb(),Bb(),Ub(),Wb(),Vb(),$b(),Nb({getTimeline:()=>e.capturedTimeline})],Yb(),Xb(),window.__hfReseekGpu=u=>{let h=Math.max(0,Number(u)||0);window.__hfThreeTime=h,window.__hfTypegpuTime=h,_s(h)};let hh=u=>($A(),C0(u));window.__hfWaitForSeekCompletion=hh,s.push(()=>{window.__hfWaitForSeekCompletion===hh&&delete window.__hfWaitForSeekCompletion}),N_(),xa(),ct("discover");let yC=()=>{Jn();let u=rt(e.capturedTimeline,0);if(u>0&&p.setDuration(u),ct("discover",e.currentTime),!e.capturedTimeline){let h=window.__timelines??{},g=Object.keys(h).filter(S=>h[S]);if(g.length>0){let A=z()?.getAttribute("data-composition-id")??null;G("root_timeline_unbound_registry_present",{reason:A?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:A,registeredTimelineKeys:g},"root_timeline_unbound_registry_present"),globalThis.console.warn("[hyperframes] Root timeline not bound, so render will freeze at t=0. "+(A?`Root data-composition-id is "${A}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${g.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${A??"<root-id>"}"] = tl).`)}}jt(e.currentTime,Array.from(document.querySelectorAll("[data-start]:not(video, audio, img)"))),window.__renderReady=!0;try{it()}catch(h){throw window.__renderReady=!1,qo(h),h}ot(!0)},Lr=null,xC=()=>{if(Lr)return;let u=()=>{window.removeEventListener("hf-timelines-built",u),Lr=null,Zn()};Lr=u,window.addEventListener("hf-timelines-built",u)};U(()=>{Lr&&(window.removeEventListener("hf-timelines-built",Lr),Lr=null)}),Zn=()=>{if(!e.tornDown){if(!
|
|
1131
|
-
${C}`;if(wh.has(P))return;wh.add(P),globalThis.console.warn(`${Yh} "${u}" ${C}`)}},_h=new Map,EC=u=>{let h=_h.get(u);if(!tt&&h){if(h instanceof WeakRef){let S=h.deref();if(S?.isConnected&&S.getAttribute("data-composition-id")===u)return S}else if(h.missingAt===bt)return null}let g=document.querySelector(`[data-composition-id="${CSS.escape(u)}"]`);return _h.set(u,g?new WeakRef(g):{missingAt:bt}),g},Ga=new WeakMap,Ch=-1,vC=(u,h)=>{if(Ga.has(h))return Ga.get(h);let g=EC(u),S=g?$(g,0):Number.NaN,A=g&&Number.isFinite(S)?{start:S,hiddenFrom:g.hasAttribute("data-start")&&!n(g)?S+(Q(g)??1/0):1/0,playbackStart:nn(g),rate:Ht(g),timelineDuration:ke(h)}:null;return Ga.set(h,A),A},Th=new WeakMap,AC=(u,h)=>{if(Th.get(u)!==h)return!1;try{return u.paused()===!0&&Number(u.totalTime?.())===h}catch{return!1}},wC=(u,h,g)=>{(Ch!==h||tt)&&(Ga=new WeakMap,Ch=h);let S=window.__timelines??{},A=z()?.getAttribute("data-composition-id")??null;for(let[C,P]of Object.entries(S)){if(!P||typeof P!="object"||C===A)continue;let q=vC(C,P);if(!q)continue;let B=q.playbackStart+Hr(q.rate,Math.max(0,Math.min(u,q.hiddenFrom)-q.start)),M=Math.max(0,q.timelineDuration!=null&&q.timelineDuration>0?Math.min(q.timelineDuration,B):B);!tt&&AC(P,M)||(SC(C,P,M,g),Th.set(P,M))}},Rh=u=>typeof u=="object"&&u!==null,_C=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],Mh=(u,h)=>{let g=u[h];if(typeof g!="function")return null;try{let S=Number(g.call(u));return Number.isFinite(S)?S:null}catch(S){return V("runtime.init.gsapCallbackDuration",S),null}},kh=new WeakMap,CC=(u,h)=>{if(!h)return Lh(u);let g=kh.get(h.owner);if(g?.version===h.version)return g.value;let S=Lh(u);return kh.set(h.owner,{version:h.version,value:S}),S},Lh=u=>{if(!("getChildren"in u)||typeof u.getChildren!="function")return!1;let h;try{h=u.getChildren(!0,!0,!0)}catch(g){return V("runtime.init.gsapCallbackChildren",g),!1}if(!Array.isArray(h))return!1;for(let g of h){if(!Rh(g))continue;let S=g.vars;if(!Rh(S)||!_C.some(q=>typeof S[q]=="function"))continue;let P=Mh(g,"totalDuration")??Mh(g,"duration");if(P!=null&&P<=1e-6)return!0}return!1};function En(u,h){let g=e.capturedTimeline,S=Nh(g,u,h);return Ia=u,Da=g,S}function Nh(u,h,g){let S=g?.suppressEvents===!0,A=g?.revision??Tr();A!==Nr.revision&&(Nr={revision:A,time:Number.NEGATIVE_INFINITY}),W_(h);let C=h>Nr.time,P=C&&u?tb(u,Nr.time,h):null,q=C&&P?.size!==0?cg(P?M=>P.has(M):void 0):null;if(wC(h,A,g),u){let M=h;if(typeof u.totalDuration=="function")try{let J=Number(u.totalDuration());Number.isFinite(J)&&J>0&&h>J&&(M=J)}catch(J){V("runtime.init.transport.clampDuration",J)}try{if(typeof u.totalTime=="function"){let J=Ah(u);!yi(u,M,S,J)&&!S&&!CC(u,J)&&qs({totalTime:u.totalTime.bind(u),totalDuration:u.totalDuration?.bind(u),getChildren:u.getChildren?.bind(u)},M,J)}else u.seek(M,S)}catch(J){V("runtime.init.transport.seek",J)}}q?.(),Nr.time=Math.max(Nr.time,h);let B=NH();for(let M of e.deterministicAdapters)if(!(M.name==="gsap"&&u))try{M.seek({time:h,suppressEvents:S,pageAnimations:B})}catch(J){V("runtime.init.transport.adapter",J)}return B}let ju=gw(document,()=>{hn()});s.push(()=>ju.disconnect());let Fh=()=>{try{return ju.isActive()}catch{return!1}},TC=()=>!p.isPlaying()&&!ga()&&ju.observing&&(!Oa||Fh())&&!Wo&&e.currentTime===Ia&&e.capturedTimeline===Da,Ku=()=>`${Tr()}|${Cr()??""}`,Ph=()=>{Sn=window.setTimeout(RC,gh&&e.capturedTimeline&&Xn?kH:e.bridgeMaxPostIntervalMs)},RC=()=>{if(Sn=null,!e.tornDown&&!(typeof window>"u"||typeof document>"u")){if(Ku()!==bh){hn();return}ot(!1),Ph()}},Fr=null,Ih=()=>e.transportRafId!=null||Fr!=null,Ba=()=>{if(document.visibilityState==="hidden"){Fr=window.setTimeout(()=>{Fr=null,Gh()},LH);return}e.transportRafId=window.requestAnimationFrame(Gh)},Dh=()=>{e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),Fr!=null&&(window.clearTimeout(Fr),Fr=null)},Oh=()=>{e.tornDown||!Ih()||(Dh(),Ba())};document.addEventListener("visibilitychange",Oh);let MC=()=>{if(e.transportRafId=null,e.tornDown)return;let u=Ha;if(Ha=!1,u||!TC()){Ba();return}bh=Ku(),Ph()};hn=()=>{e.tornDown||(Ha=!0,!(Pa||Ih())&&(Sn!=null&&(window.clearTimeout(Sn),Sn=null),Ha=!1,Ba()))};let kC=u=>{let h=ba("audio[data-start]"),g=null;for(let S of u?[u,...h]:h){if(!_e(S)||!S.isConnected||x(S)||$c(S)||S.ended&&!S.loop||!S.hasAttribute("src")&&!S.querySelector("source[src]"))continue;let A=le(S),C=he(S,A);if(!Number.isFinite(A)||!Mn(e.currentTime,C.start,C.end))continue;if(S===u)return{el:S,start:A};let P=A+(Gr(S)??1/0);(!g||P>g.runsUntil)&&(g={el:S,start:A,runsUntil:P})}return g};function Hh(){if(p.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&b.ownsClock()&&b.context){let u=b.getTime();u>=0&&p.attachAudioSource({currentTimeSeconds:u})}else{let u=kC(p.audioElement());u&&!u.el.paused?p.attachAudioSource({el:u.el,compositionStart:u.start,mediaStart:nn(u.el),rate:Ht(u.el)}):u&&u.el.readyState<HTMLMediaElement.HAVE_FUTURE_DATA?p.attachAudioSource({currentTimeSeconds:e.currentTime}):p.hasAudioSource()&&p.detachAudioSource()}else p.hasAudioSource()&&p.detachAudioSource()}let Gh=()=>{if(!(e.tornDown||Pa)){Pa=!0;try{zu+=1;let u=Tr();u!==yh&&(yh=u,Wo=!0);let h=Date.now(),g=p.isPlaying(),S=g&&h-Sh>=Wm,A=vh&&!g;if(vh=g,S){Sh=h;let ue=Ku();ue!==Eh&&(Eh=ue,Wo=!0)}let C=Wo&&h-xh>=bw;C&&(xh=h);let P=ue=>!g&&zu%ue===0;if(yw({tick:zu,isPlaying:g,hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:p.now(),compositionChanged:C,playingPollDue:S})){let ue=e.capturedTimeline;if(Jn()){e.capturedTimeline&&e.capturedTimeline!==ue&&dn(e.capturedTimeline);let be=rt(e.capturedTimeline,0,u);be>0&&p.setDuration(be),it()}}if(C||P(20)?(it(),Wo=!1):A&&iC(),(C||P(30))&&xa(),e.capturedTimeline){let ue=rt(e.capturedTimeline,0,u);ue>0&&(!p.isPlaying()||ue>=p.getDuration())&&p.setDuration(ue)}Hh();let q=p.now();e.currentTime=q,window.__HF_EXPORT_RENDER_SEEK_CONFIG||ub({nowMs:performance.now(),filmTime:q,fps:e.canonicalFps,rate:e.playbackRate,playing:g,hidden:document.visibilityState==="hidden",waiting:Bo.some(({el:ue})=>ue.tagName==="VIDEO"&&!ue.paused&&ue.readyState<3),layoutKey:`${window.innerWidth}x${window.innerHeight}@${window.devicePixelRatio}`});let B=p.isPlaying(),M=!B&&Fh(),J=B&&VA();if(M?Oa=!0:!J&&(B||Oa||q!==Ia||e.capturedTimeline!==Da)&&(En(q,{revision:u}),So(q,{playing:B}),B||(Oa=!1)),B&&It.redrawAnimated(),p.isPlaying()&&p.reachedEnd()){b.stopAll(),p.detachAudioSource(),p.pause(),e.isPlaying=!1;let ue=p.getStopTime();Number.isFinite(ue)&&(p.seek(ue),e.currentTime=ue,En(ue)),ct("pause"),ht(u),So(e.currentTime),ot(!0);return}p.isPlaying()?(NC(),ht(u)):nC()&&(yn=null,ht(u)),ot(!1)}finally{Pa=!1,MC()}}},Bh=u=>{let h=ge(()=>Uo().mediaClips);for(let g of Jp(h)??[]){if(!g.el.isConnected||!Mn(u,g.start,g.end))continue;let S=Ms(g,u);if(!(Math.abs(g.el.currentTime-S)<=.001))try{g.el.currentTime=S}catch{}}},Yu=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let u=b.startGeneration(),h=la(document);b.releaseDecodedExcept(h),Xu(h,u)},LC=10,Ua={gen:-1,clips:[]},Uh=()=>p.now()+LC*Math.max(1,e.playbackRate),NC=()=>{let u=Ua;if(u.gen!==b.currentGeneration()||u.clips.length===0||e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let h=Uh(),g=u.clips.filter(S=>S.start<=h);g.length!==0&&(u.clips=u.clips.filter(S=>S.start>h),Xu(g.flatMap(({el:S})=>S.isConnected?[S]:[]),u.gen))},Xu=(u,h)=>{Ua.gen!==h&&(Ua={gen:h,clips:[]});let g=p.now(),S=Uh();for(let A of u){if(x(A))continue;let C=le(A);if(!Number.isFinite(C))continue;let P=nn(A),q=Number.parseFloat(A.dataset.volume??""),B=Number.isFinite(q)?q:1,M=Ge(A.dataset.duration),J=M!=null&&M>0?M:Number.POSITIVE_INFINITY,{inheritedStart:ue,inheritedDuration:be}=Z(A);ue!=null&&be!=null&&be>0&&(J=Math.min(J,Math.max(0,ue+be-C)));let se=me(A),pe=fr({start:C,end:C+J},se);if(se.length>0){if(pe.end<=pe.start)continue;J=pe.end-C}if(pe.end<=g)continue;if(pe.start>S){Ua.clips.push({el:A,start:pe.start});continue}let Ye=_o(A);Co(A,Ye),(Ye.kind==="web-audio"?b.scheduleMediaElementPlayback(A,C,P,p.now(),B,h,e.playbackRate,J):Promise.resolve(null)).then(He=>{let Xe=h!==b.currentGeneration();if(He||!Xa(A)||!p.isPlaying()||Xe||typeof Ht(A)!="number")return;let Wa=e.playbackRate*mt(A),We=A.hasAttribute("data-fx-chain")||A.hasAttribute("data-automation");if(Math.abs(Wa-1)>1e-9){Ye.kind==="web-audio"&&We&&(A.muted=!0);return}b.decodeAudioElement(A).then(Kt=>{!Kt||!p.isPlaying()||b.schedulePlayback(A,Kt,C,P,()=>p.now(),B,h,e.playbackRate,J,pe.start)})})}};function Wh(){b.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&y&&p.isPlaying()&&b.hasBoundedActiveSources()&&(b.stopAll(),Yu())}if(e.capturedTimeline){let u=rt(e.capturedTimeline,0);u>0&&p.setDuration(u),dn(e.capturedTimeline)}RE(window),Ba(),it(),ot(!0),e.controlBridgeHandler=ob({onPlay:()=>{tr.play(),St("composition_played",{time:tr.getTime()})},onPause:()=>{tr.pause(),St("composition_paused",{time:tr.getTime()})},onStopMedia:()=>{b.stopAll();let u=document.querySelectorAll("video, audio");for(let h of u)_e(h)&&!h.paused&&h.pause()},onSeek:(u,h)=>{tr.seek(u),St("composition_seeked",{time:u})},onSetMuted:u=>{e.bridgeMuted=u;let h=u||e.mediaOutputMuted;b.setMuted(h);let g=document.querySelectorAll("video, audio");for(let S of g)_e(S)&&(S.muted=h||S.defaultMuted)},onSetVolume:u=>{e.bridgeVolume=u,b.setVolume(u);let h=document.querySelectorAll("video, audio");for(let g of h){if(!_e(g))continue;let S=parseFloat(g.dataset.volume??""),A=Number.isFinite(S)?S:1;g.volume=is(A*u)}},onSetMediaOutputMuted:u=>{e.mediaOutputMuted=u;let h=u||e.bridgeMuted;b.setMuted(h);let g=document.querySelectorAll("video, audio");for(let S of g)_e(S)&&(S.muted=h||S.defaultMuted)},onSetNativeMediaSyncDisabled:u=>{e.nativeMediaSyncDisabled!==u&&(e.nativeMediaSyncDisabled=u,e.mediaForceSyncNextTick=!0,u?(b.stopAll(),p.detachAudioSource()):ht())},onSetWebAudioMediaDisabled:u=>{e.webAudioMediaDisabled!==u&&(e.webAudioMediaDisabled=u,e.mediaForceSyncNextTick=!0,u&&(b.stopAll(),p.detachAudioSource()),ht())},onSetPlaybackRate:u=>{qu(u),e.transportClock&&e.transportClock.setRate(e.playbackRate),Wh()},onSetDisplayScale:u=>{ly(u),Ag(u),lb(u)},onRequestPreviewFacts:()=>Ce({source:"hf-preview",type:"preview-facts",facts:{sceneCount:Pt.length,mountedElementCount:document.body.querySelectorAll("*").length,durationSeconds:p.getDuration(),videos:by(),lighterAt:gy(),copiesReady:mb()}}),onSetPreviewQuality:hy,onRetryPreviewCopies:yy,onSetIdleHeartbeat:u=>{gh=u,hn()},onSetRootDuration:aC,onSetPlayRange:(u,h)=>{p.setPlayRange(u,h,e.canonicalFps);let g=p.getPlayStart();if(p.isPlaying()&&(p.now()<g||p.reachedEnd())){Fa.seek(g,{keepPlaying:!0});return}ot(!0)},onSetColorGrading:(u,h)=>{It.setGrading(u,h)},onSetColorGradingCompare:(u,h)=>{It.setCompare(u,h)},onTick:()=>{if(e.tornDown||!p.isPlaying())return;Hh();let u=p.now();if(e.currentTime=u,(u!==Ia||e.capturedTimeline!==Da)&&En(u),p.reachedEnd()){b.stopAll(),p.detachAudioSource(),p.pause(),e.isPlaying=!1;let h=p.getStopTime();Number.isFinite(h)&&(p.seek(h),e.currentTime=h,En(h)),ct("pause"),ht(),ot(!0)}},onEnablePickMode:()=>Na.enablePickMode(),onDisablePickMode:()=>Na.disablePickMode(),onSetRuntimeData:au,onClearRuntimeData:su,getCanonicalFps:()=>e.canonicalFps});let Ju=()=>{if(!e.tornDown){e.tornDown=!0,Dh(),document.removeEventListener("visibilitychange",Oh),Sn!=null&&(window.clearTimeout(Sn),Sn=null),e.transportClock=null,b.destroy(),Qn!=null&&(window.clearTimeout(Qn),Qn=null),d!=null&&(window.cancelAnimationFrame(d),d=null),I_(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),a&&(window.removeEventListener("error",a),a=null),l&&(window.removeEventListener("unhandledrejection",l),l=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),Na.disablePickMode();for(let u of e.deterministicAdapters)if(!(!u||typeof u.revert!="function"))try{u.revert()}catch(h){V("runtime.init.site12",h)}e.deterministicAdapters=[],window.__hf?.buildReady&&(window.__hf.buildReady={});for(let u of s.splice(0))try{u()}catch(h){V("runtime.init.site13",h)}for(let u of e.injectedCompStyles)try{u.remove()}catch(h){V("runtime.init.site14",h)}e.injectedCompStyles=[];for(let u of e.injectedCompLinks)try{u.remove()}catch(h){V("runtime.init.site15",h)}e.injectedCompLinks=[];for(let u of e.injectedCompScripts)try{u.remove()}catch(h){V("runtime.init.site16",h)}e.injectedCompScripts=[],e.capturedTimeline=null,r=()=>{},window.__hfRuntimeTeardown===Ju&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=Ju,e.beforeUnloadHandler=Ju,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var $w=["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"],Qm=[[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 FH(e){if(e<=255)return $w[e];let t=0,n=Qm.length-1;for(;t<=n;){let r=t+n>>1,o=Qm[r];if(e<o[0]){n=r-1;continue}if(e>o[1]){t=r+1;continue}return o[2]}return"L"}function PH(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let c=0;c<t;){let d=e.charCodeAt(c),f=d,m=1;if(d>=55296&&d<=56319&&c+1<t){let b=e.charCodeAt(c+1);b>=56320&&b<=57343&&(f=(d-55296<<10)+(b-56320)+65536,m=2)}let p=FH(f);(p==="R"||p==="AL"||p==="AN")&&(r=!0);for(let b=0;b<m;b++)n[c+b]=p;c+=m}if(!r)return null;let o=0;for(let c=0;c<t;c++){let d=n[c];if(d==="L"){o=0;break}if(d==="R"||d==="AL"){o=1;break}}let i=new Int8Array(t);for(let c=0;c<t;c++)i[c]=o;let a=o&1?"R":"L",l=a,s=l;for(let c=0;c<t;c++)n[c]==="NSM"?n[c]=s:s=n[c];s=l;for(let c=0;c<t;c++){let d=n[c];d==="EN"?n[c]=s==="AL"?"AN":"EN":(d==="R"||d==="L"||d==="AL")&&(s=d)}for(let c=0;c<t;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<t-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<t;c++){if(n[c]!=="EN")continue;let d;for(d=c-1;d>=0&&n[d]==="ET";d--)n[d]="EN";for(d=c+1;d<t&&n[d]==="ET";d++)n[d]="EN"}for(let c=0;c<t;c++){let d=n[c];(d==="WS"||d==="ES"||d==="ET"||d==="CS")&&(n[c]="ON")}s=l;for(let c=0;c<t;c++){let d=n[c];d==="EN"?n[c]=s==="L"?"L":"EN":(d==="R"||d==="L")&&(s=d)}for(let c=0;c<t;c++){if(n[c]!=="ON")continue;let d=c+1;for(;d<t&&n[d]==="ON";)d++;let f=c>0?n[c-1]:l,m=d<t?n[d]:l,p=f!=="L"?"R":"L";if(p===(m!=="L"?"R":"L"))for(let y=c;y<d;y++)n[y]=p;c=d-1}for(let c=0;c<t;c++)n[c]==="ON"&&(n[c]=a);for(let c=0;c<t;c++){let d=n[c];(i[c]&1)===0?d==="R"?i[c]++:(d==="AN"||d==="EN")&&(i[c]+=2):(d==="L"||d==="AN"||d==="EN")&&i[c]++}return i}function qw(e,t){let n=PH(e);if(n===null)return null;let r=new Int8Array(t.length);for(let o=0;o<t.length;o++)r[o]=n[t[o]];return r}var IH=/[ \t\n\r\f]+/g,DH=/[\t\n\r\f]| {2,}|^ | $/;function OH(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function HH(e){if(!DH.test(e))return e;let t=e.replace(IH," ");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 GH(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
|
|
1128
|
+
`+KA,Nm=new WeakMap;function Fm(e){return YA.has(e)}var YA=new WeakSet;function Pm(e){let t=Nm.get(e);return t||(t=(async()=>{if(!e.audioWorklet)throw new Error("AudioWorklet is unavailable: the page needs a secure context (https, localhost or file://)");let n=`data:text/javascript;base64,${btoa(String.fromCharCode(...new TextEncoder().encode(bO)))}`;await e.audioWorklet.addModule(n),YA.add(e)})().catch(n=>{throw Nm.delete(e),n}),Nm.set(e,t)),t}function yO(e,t,n){let r=.6+Math.max(0,Math.min(1,t))*2.6,o=Math.max(1,Math.floor(e*r)),i=new Float32Array(o),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))),c=0,d=0;for(let m=0;m<o;m++){c+=s*(l()-c);let p=c*Math.pow(1-m/o,2.5);i[m]=p,d+=p*p}let f=Math.sqrt(d);if(f>0)for(let m=0;m<o;m++)i[m]=(i[m]??0)/f;return i}var Fe=e=>typeof e=="number"?e:Number(e??0),Im=e=>e/1e3;function ZA(e,t,n,r){let o=Math.max(1,Math.round(e.sampleRate)),i=e.createBuffer(1,o,e.sampleRate),a=i.getChannelData(0);for(let c=0;c<o;c++){let d=c/o;a[c]=t==="sine"?Math.sin(2*Math.PI*d):4*Math.abs((d+.75)%1-.5)-1}let l=e.createBufferSource();l.buffer=i,l.loop=!0,l.playbackRate.value=n;let s=(r*n%1+1)%1*(o/e.sampleRate);return l.start(typeof e.currentTime=="number"?e.currentTime:0,s),l}function ew(e){try{e.stop()}catch{}e.disconnect()}function Dm(e,t){return[{param:e},{param:t,map:n=>1-n}]}function tw(e,t,n){e.gain.value=n,t.gain.value=1-n}function Om(e,t,n){return{input:e,output:e,update:t,automation:n,dispose:()=>e.disconnect()}}var xO=new Set(["peaking","highpass","lowpass"]),XA=e=>Math.pow(10,e/20),SO=(e,t)=>{let n=e.createGain(),r=o=>{n.gain.value=XA(Fe(o.gain))};return r(t),Om(n,r,{gain:[{param:n.gain,map:XA}]})};function oa(e,t){return(n,r)=>{let o=n.createBiquadFilter();o.type=e;let i=a=>{o.frequency.value=Fe(a.frequency),a.q!==void 0&&(o.Q.value=Fe(a.q)),t&&(o.gain.value=Fe(a.gain))};return i(r),Om(o,i,{frequency:[{param:o.frequency}],...xO.has(e)?{q:[{param:o.Q}]}:{},...t?{gain:[{param:o.gain}]}:{}})}}function EO(e){return(t,n)=>{let r=Math.tan(Math.PI*Fe(n.frequency)/t.sampleRate),o=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 Om(o,()=>{})}}function Ao(e,t=!1){return(n,r,o)=>{let i=new AudioWorkletNode(n,e,{processorOptions:{...r,__hfElapsed:o}});return{input:i,output:i,update:a=>i.port.postMessage({...a}),...t?{reset:()=>i.port.postMessage({__hfReset:!0})}:{},dispose:()=>{i.port.postMessage({__hfDispose:!0}),i.disconnect()}}}}var vO={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))},AO=(e,t)=>{let n=e.createWaveShaper(),r=e.createGain(),o=e.createGain();r.connect(n).connect(o);let i=a=>{let l=vO[String(a.type)]??Math.tanh,s=Math.pow(10,Fe(a.threshold)/20),c=8192,d=new Float32Array(c);for(let f=0;f<c;f++){let m=f/(c-1)*2-1;d[f]=l(m/Math.max(1e-6,s))*s}n.curve=d,n.oversample=Fe(a.oversample)>=4?"4x":Fe(a.oversample)>=2?"2x":"none",o.gain.value=Math.pow(10,Fe(a.output)/20)};return i(t),{input:r,output:o,update:i,automation:{output:[{param:o.gain,map:a=>Math.pow(10,a/20)}]},dispose:()=>{r.disconnect(),n.disconnect(),o.disconnect()}}},wO=(e,t)=>{let n=e.createGain(),r=e.createGain(),o=e.createDelay(5),i=e.createGain(),a=e.createGain(),l=e.createGain();n.connect(o),o.connect(i),i.connect(o),o.connect(a).connect(r),n.connect(l).connect(r);let s=c=>{o.delayTime.value=Math.min(5,Fe(c.time)/1e3),i.gain.value=Fe(c.feedback),tw(a,l,Fe(c.mix))};return s(t),{input:n,output:r,update:s,automation:{time:[{param:o.delayTime,map:c=>Math.min(5,Im(c))}],feedback:[{param:i.gain}],mix:Dm(a.gain,l.gain)},dispose:()=>[n,r,o,i,a,l].forEach(c=>c.disconnect())}},_O=(e,t,n)=>{let r=e.createGain(),o=e.createGain(),i=e.createDelay(.5),a=ZA(e,"sine",Fe(t.speed),n),l=e.createGain(),s=e.createGain(),c=e.createGain();a.connect(l).connect(i.delayTime),r.connect(i).connect(s).connect(o),r.connect(c).connect(o);let d=f=>{i.delayTime.value=Fe(f.delay)/1e3,l.gain.value=Fe(f.depth)/1e3,a.playbackRate.value=Fe(f.speed),tw(s,c,Fe(f.mix))};return d(t),{input:r,output:o,update:d,automation:{delay:[{param:i.delayTime,map:Im}],depth:[{param:l.gain,map:Im}],speed:[{param:a.playbackRate}],mix:Dm(s.gain,c.gain)},dispose:()=>{ew(a),[r,o,i,l,s,c].forEach(f=>f.disconnect())}}},CO=6,TO=(e,t,n)=>{let r=e.createGain(),o=e.createGain(),i=e.createGain(),a=e.createGain(),l=ZA(e,String(t.type)==="1"?"sine":"triangle",Fe(t.speed),n),s=e.createGain(),c=e.createGain(),d=e.createGain(),f=[];r.connect(i);let m=i;for(let b=0;b<CO;b++){let y=e.createBiquadFilter();y.type="allpass",y.Q.value=.7071,s.connect(y.frequency),m.connect(y),m=y,f.push(y)}l.connect(s),m.connect(c).connect(a),i.connect(d).connect(a),a.connect(o);let p=b=>{let y=1e3/Math.max(.1,Fe(b.delay));for(let x of f)x.frequency.value=y;s.gain.value=y*Fe(b.decay),l.playbackRate.value=Fe(b.speed),i.gain.value=Fe(b.in_gain),a.gain.value=Fe(b.out_gain),c.gain.value=1,d.gain.value=1};return p(t),{input:r,output:o,update:p,automation:{speed:[{param:l.playbackRate}],in_gain:[{param:i.gain}],out_gain:[{param:a.gain}]},dispose:()=>{ew(l),[r,o,i,a,s,c,d,...f].forEach(b=>b.disconnect())}}},RO=(e,t)=>{let n=e.createGain(),r=e.createGain(),o=e.createConvolver(),i=e.createGain(),a=e.createGain();o.normalize=!1,n.connect(o).connect(i).connect(r),n.connect(a).connect(r);let l="",s=c=>{let d=`${Fe(c.size)}:${Fe(c.damping)}`;if(d!==l){let f=yO(e.sampleRate,Fe(c.size),Fe(c.damping)),m=e.createBuffer(1,f.length,e.sampleRate);m.getChannelData(0).set(f),o.buffer=m,l=d}i.gain.value=Fe(c.wet),a.gain.value=Fe(c.dry)};return s(t),{input:n,output:r,update:s,automation:{wet:[{param:i.gain}],dry:[{param:a.gain}]},dispose:()=>[n,r,o,i,a].forEach(c=>c.disconnect())}},MO={"gain-node":SO,"biquad-peaking":oa("peaking",!0),"biquad-lowshelf":oa("lowshelf",!0),"biquad-highshelf":oa("highshelf",!0),"biquad-highpass":oa("highpass",!1),"biquad-lowpass":oa("lowpass",!1),"worklet-compressor":Ao("hf-compressor"),"worklet-limiter":Ao("hf-limiter"),"worklet-truepeak":Ao("hf-truepeak",!0),"worklet-gate":Ao("hf-gate"),"worklet-bitcrush":Ao("hf-bitcrush"),"worklet-pitchshift":Ao("hf-pitchshift"),waveshaper:AO,"delay-feedback":wO,"chorus-lfo":_O,"allpass-phaser":TO,convolver:RO};function nw(e){return e.nodes.some(t=>Xo(t.type)?.web.startsWith("worklet-")??!1)}function kO(e,t,n,r=0){let o=Xo(t);if(!o)throw new Error(`Unknown effect type: ${t}`);let i=Jo(t,n);if((t==="highpass"||t==="lowpass")&&String(i.poles)==="1")return EO(t)(e,i,r);let a=MO[o.web];if(!a)throw new Error(`No Web Audio builder for ${o.web}`);return a(e,i,r)}function JA(e){let t=[];for(let n of e){let r=n.fromPreset,o=t.at(-1);if(o&&o.preset===r)o.nodes.push(n);else{let i=typeof n.presetAmount=="number"?n.presetAmount:1;t.push({...r?{preset:r}:{},amount:Math.min(1,Math.max(0,i)),nodes:[n]})}}return t}function QA(e){return Qo(e).map(t=>{let n=Jo(t.type,t.params),r=n.poles!==void 0?`:${n.poles}`:"",o=String(n.poles)==="1"?`@${n.frequency}`:"",i=t.type==="phaser"?`~${n.type}`:"",a=t.fromPreset?`%${t.fromPreset}`:"",l=t.type==="truepeak"?`^${n.lookahead}`:"";return`${t.type}${r}${o}${i}${l}${a}`}).join("|")}function rw(e,t,n=0){var f;let r=e.createGain(),o=e.createGain(),i=[],a=[],l=JA(Qo(t)),s=r;for(let m of l){let p=null;if(m.preset){let b=e.createGain(),y=e.createGain(),x=e.createGain(),E=e.createGain();x.gain.value=m.amount,y.gain.value=1-m.amount,s.connect(b),b.connect(y).connect(E),p={entry:b,wet:x,dry:y,join:E},s=b}for(let b of m.nodes){let y=kO(e,b.type,b.params??{},n);s.connect(y.input),s=y.output,i.push({...b.id?{id:b.id}:{},type:b.type,handle:y})}p&&m.preset&&(s.connect(p.wet).connect(p.join),a.push({id:m.preset,...p}),s=p.join)}s.connect(o);let c=QA(t),d={};for(let m of a)(d[f=m.id]??(d[f]=[])).push(...Dm(m.wet.gain,m.dry.gain));return{input:r,output:o,presets:d,nodes:i,update(m){if(QA(m)!==c)return!1;Qo(m).forEach((b,y)=>{let x=i[y];x&&(x.handle.update(Jo(b.type,b.params)),b.id===void 0?delete x.id:x.id=b.id)});let p=0;for(let b of JA(Qo(m))){if(!b.preset)continue;let y=a[p++];!y||y.id!==b.preset||(y.wet.gain.value=b.amount,y.dry.gain.value=1-b.amount)}return!0},reset(){for(let{handle:m}of i)m.reset?.()},dispose(){for(let{handle:m}of i)m.dispose();for(let{entry:m,wet:p,dry:b,join:y}of a)m.disconnect(),p.disconnect(),b.disconnect(),y.disconnect();r.disconnect(),o.disconnect()}}}var ow={version:1,nodes:[]},iw={version:1,lanes:[]};function aw(e,t,n=Zt){let r=(n&&typeof e.getAttribute=="function"?e.getAttribute(n):null)??"";if(!r)return iw;try{return Vg(ds(r),t)}catch{return iw}}function wo(e){let t=(typeof e.getAttribute=="function"?e.getAttribute(Tn):null)??"";if(!t)return{chain:ow,raw:""};try{return{chain:Dg(t),raw:t}}catch{return{chain:ow,raw:""}}}function sw(e){return aw(e,wo(e).chain)}function Hm(e,t,n){let r=jA(t);if(!r)return[];let o=Gg(r,e.gain?.()??1,e.gainAhead);return Lm([{param:e.param}],{...r,points:o},cs.scale,n),[{param:e.param}]}function LO(e,t){Eo([e]),e.param.setValueAtTime(e.gainAhead?1:Ue(e.gain?.()??1),t.scheduledAt)}function nu(e,t,n,r,o,i={automation:Zt},a){let{chain:l}=wo(t),s=null,c=[],d=!1,f=0,m=()=>{try{s?(n.disconnect(s.input),s.output.disconnect(r),s.dispose()):n.disconnect(r)}catch{}s=null},p=(G,R)=>{if(G.nodes.length===0){n.connect(r);return}if(nw(G)&&!Fm(e)){n.connect(r);let D=++f;Pm(e).then(()=>{d||D!==f||v(wo(t).chain)}).catch(()=>{});return}try{let D=rw(e,G,R);n.connect(D.input),D.output.connect(r),s=D}catch{n.connect(r)}},b=(G,R)=>{if(!R){c=[];return}let D=aw(t,G,i.automation),T=s?zA(D,G,s.nodes,R,s.presets):[],H=a?Hm(a,D,R):[];a&&H.length===0&&c.some(I=>I.param===a.param)&&LO(a,R),c=[...T,...H]},y=o?{...o}:null;p(l,y?.elapsed??0),b(l,y);let x=()=>{if(!y)return null;let G=typeof e.currentTime=="number"?e.currentTime:y.scheduledAt;return{scheduledAt:G,elapsed:y.elapsed+(G-y.scheduledAt)*y.rate,rate:y.rate}},E=G=>{let R=x();R&&(vo(c,R.scheduledAt),b(G,R))},v=G=>{let R=x();vo(c,R?.scheduledAt??0),m(),p(G,R?.elapsed??0),b(G,R)},_=null,U=t;return typeof MutationObserver<"u"&&typeof U?.nodeType=="number"&&(_=new MutationObserver(()=>{let G=wo(t);c.length>0&&Eo(c),!s||!s.update(G.chain)?v(G.chain):E(G.chain)}),_.observe(U,{attributes:!0,attributeFilter:[Tn,...i.automation?[i.automation]:[],...a?.gain?["data-volume"]:[]]})),{reanchor:G=>{if(d)return;let R=x();R&&vo(c,R.scheduledAt),y={...G},s?.reset(),b(wo(t).chain,y)},setRate:G=>{let R=x();d||!R||!Number.isFinite(G)||G<=0||G===R.rate||(y={...R,rate:G},vo(c,R.scheduledAt),b(wo(t).chain,y))},dispose:()=>{d=!0,_?.disconnect(),c.length>0&&vo(c,typeof e.currentTime=="number"?e.currentTime:0),s?.dispose()}}}function lw(e,t){e.getFloatTimeDomainData(t);let n=0;for(let r=0;r<t.length;r++)n=Math.max(n,Math.abs(t[r]??0));return n}function Gm(e,t){let n=e.createGain();n.channelCount=2,n.channelCountMode="explicit";let r=e.createChannelSplitter(2),o=e.createAnalyser(),i=e.createAnalyser();o.fftSize=i.fftSize=2048,t.connect(n),n.connect(r),r.connect(o,0),r.connect(i,1);let a=new Float32Array(new ArrayBuffer(2048*4)),l=new Float32Array(new ArrayBuffer(2048*4));return{read:()=>({l:lw(o,a),r:lw(i,l)}),dispose:()=>{try{t.disconnect(n),n.disconnect(),r.disconnect()}catch{}}}}var uw="runtime_web_audio_bypass";function Bm(e,t){return typeof e.getAttribute=="function"?e.getAttribute(t):null}function ia(e,t){return Bm(e,t)!==null}function NO(e){return ia(e,"crossorigin")?!0:e.crossOrigin!=null}function FO(e){return typeof e.baseURI=="string"&&e.baseURI?e.baseURI:typeof document<"u"?document.baseURI:""}function PO(e){let t=typeof e.currentSrc=="string"?e.currentSrc:"";if(t)return[t];let n=Bm(e,"src");if(n)return[n];if(typeof e.querySelectorAll!="function")return[];let r=[];for(let o of Array.from(e.querySelectorAll("source"))){let i=o.getAttribute("src");i&&r.push(i)}return r}function IO(e,t){let n;try{n=new URL(e,FO(t))}catch{return null}return n.protocol!=="http:"&&n.protocol!=="https:"?null:n}function DO(){return typeof window.origin=="string"?window.origin:window.location.origin}function OO(e,t){if(typeof window>"u")return null;let n=IO(e,t);if(!n)return null;let r=DO(),o=r==="null";return!o&&n.origin===r||NO(t)?null:o?"opaque_document_origin":"cross_origin_no_cors"}function dw(e){return(typeof e.currentSrc=="string"?e.currentSrc:"")?!0:ia(e,"src")}function _o(e){for(let t of PO(e)){let n=OO(t,e);if(n)return{kind:"decode-only",reason:n,asset:t}}return{kind:"web-audio"}}function HO(e){let t=[];ia(e,Tn)&&t.push("fx-chain"),ia(e,Zt)&&t.push("automation"),ia(e,ys)&&t.push("audio-group");let n=Number.parseFloat(Bm(e,"data-volume")??"");return Number.isFinite(n)&&n>1&&t.push("above-unity-gain"),t}function GO(){return typeof window<"u"&&!!window.__HF_EXPORT_RENDER_SEEK_CONFIG}var cw=new WeakSet,BO={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"},UO={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 Co(e,t){if(t.kind==="web-audio"||GO()||cw.has(e))return;let n=HO(e);cw.add(e);let r={asset:t.asset,reason:t.reason,lostProcessing:n,note:BO[t.reason]};Ce({source:"hf-preview",type:"diagnostic",code:uw,details:r});let o=n.length>0?` Native playback cannot reproduce: ${n.join(", ")}. Fix: ${UO[t.reason]}`:"";globalThis.console.info(`[hyperframes] ${uw}: "${t.asset}" (${t.reason}): Web Audio capture withheld; the track plays through native HTMLMediaElement output.${o}`)}function ru(e){return new URL(e,document.baseURI).href}var WO={automation:null};function Um(e){return!Number.isFinite(e)||e<=0?1:e}function fw(e){return Ue(e)}function VO(e,t){t||e.paused||!za().__hfDebug||globalThis.console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function $O(e,t){let{elapsed:n,mediaStart:r,scheduledAt:o,globalRate:i,mediaRate:a,clipDuration:l,headCut:s}=t,c=Number.isFinite(l)&&l>0,d=Math.max(n,s,0),f=(l-d)*a;if(c&&f<=0)return!1;let m=d>n?o+(d-n)/i:0;return c?e.start(m,d*a+r,f):e.start(m,d*a+r),!0}function qO(e,t,n,r,o){let i=kc(hs(t),o);if(i.fadeIn<=0&&i.fadeOut<=0||i.fadeOut>0&&!Number.isFinite(o))return null;let a=e.createGain(),l=a.gain,s=d=>gs(d,o,i),c=d=>{let f=Math.max(r,d.elapsed),m=p=>d.scheduledAt+Math.max(0,p-d.elapsed)/d.rate;if(l.value=s(f),l.setValueAtTime(s(f),m(f)),i.fadeIn>f&&l.linearRampToValueAtTime(s(i.fadeIn),m(i.fadeIn)),i.fadeOut>0){let p=o-i.fadeOut;p>f&&p>i.fadeIn&&l.setValueAtTime(s(p),m(p)),l.linearRampToValueAtTime(0,m(o))}};return c(n),{node:a,rebook:d=>{l.cancelScheduledValues(0),c(d)}}}function mw(e,t,n,r,o,i){let a=e.createGain();a.connect(r);let l=e.createGain(),s=qO(e,t,o,i.from,i.clipDuration);return s&&n.connect(s.node),(s?.node??n).connect(l),{fx:nu(e,t,l,a,o,void 0,{param:a.gain,gain:()=>oi(t),gainAhead:!0}),laneNode:a,clipGainNode:l,fades:s}}function To(e){return e.sourceKind==="buffer"}var pw=e=>{let t=e.currentSrc||e.getAttribute("src");if(!t)return null;try{return ru(t)}catch{return t}},zO=1e4,ou=class{constructor(){Se(this,"_ctx",null);Se(this,"_bufferCache",new Map);Se(this,"_decoding",new Map);Se(this,"_failedSrcs",new Set);Se(this,"_mediaElementSources",new WeakMap);Se(this,"_activeSources",[]);Se(this,"_masterGain",null);Se(this,"_busOut",null);Se(this,"_master",null);Se(this,"_monitorGain",null);Se(this,"_masterVolume",1);Se(this,"_masterMuted",!1);Se(this,"_groups",new Map);Se(this,"_metering",!1);Se(this,"_masterTap",null);Se(this,"_groupTaps",new Map);Se(this,"_rateAnchorCtx",0);Se(this,"_rateAnchorComp",0);Se(this,"_rate",1);Se(this,"_paused",!0);Se(this,"_playGeneration",0);Se(this,"_playingCaptured",new Set);Se(this,"_suspendPending",!1);Se(this,"_restTimer",null)}async init(){try{return this._ctx=new AudioContext,this._ctx.onstatechange=()=>this.rest(),this._masterGain=this._ctx.createGain(),this._busOut=this._ctx.createGain(),this._monitorGain=this._ctx.createGain(),this._masterGain.connect(this._busOut),this._busOut.connect(this._monitorGain),this._monitorGain.connect(this._ctx.destination),this.applyMasterGain(),this._metering&&this.attachMasterTap(),!0}catch{return!1}}async wake(){!this._ctx||this._ctx.state==="running"&&!this._suspendPending||(this._suspendPending=!1,await this._ctx.resume())}rest(){this._restTimer!==null&&clearTimeout(this._restTimer),this._restTimer=null,!(!this._ctx||this._ctx.state!=="running"||this._suspendPending)&&(this._restTimer=setTimeout(()=>{this._restTimer=null,this.suspendIfIdle()},zO))}suspendIfIdle(){for(let t of this._playingCaptured)t.paused&&this._playingCaptured.delete(t);!this._ctx||!this._paused||this._suspendPending||this._playingCaptured.size>0||(this._suspendPending=!0,this._ctx.suspend().catch(t=>{this._suspendPending=!1,V("webAudioTransport.suspend",t)}))}get context(){return this._ctx}getTime(){return!this._ctx||this._paused?-1:this._rateAnchorComp+(this._ctx.currentTime-this._rateAnchorCtx)*this._rate}releaseDecodedExcept(t){let n=new Set(t.map(pw));for(let r of[...this._bufferCache.keys()])n.has(r)||this._bufferCache.delete(r)}decodeAudioElement(t){let n=pw(t);if(!n)return Promise.resolve(null);let r=this._decoding.get(n);if(r)return r;let o=this.fetchAndDecode(n).finally(()=>this._decoding.delete(n));return this._decoding.set(n,o),o}async fetchAndDecode(t){if(this._bufferCache.has(t))return this._bufferCache.get(t);if(this._failedSrcs.has(t)||!this._ctx)return null;let n;try{let r=await fetch(t,{cache:"no-store"});if(!r.ok)return V("webAudioTransport.fetch",new Error(`${r.status} ${t}`)),null;n=await r.arrayBuffer()}catch(r){return V("webAudioTransport.fetch",r),null}try{let r=await this._ctx.decodeAudioData(n);return this._bufferCache.set(t,r),r}catch(r){return this._failedSrcs.add(t),V("webAudioTransport.decode",r),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}acquireMediaElementSource(t){let n=this._mediaElementSources.get(t);if(n){let a=_o(t);if(a.kind!=="web-audio"){try{n.disconnect()}catch{}return this._mediaElementSources.delete(t),Co(t,a),null}return n}if(!this._ctx)return null;let r=_o(t);if(r.kind!=="web-audio")return Co(t,r),null;let o=this._ctx.createMediaElementSource(t);this._mediaElementSources.set(t,o),t.paused||this._playingCaptured.add(t),t.addEventListener("play",()=>{this._playingCaptured.add(t),this.wake()});let i=()=>{this._playingCaptured.delete(t),this.rest()};return t.addEventListener("pause",i),t.addEventListener("emptied",i),o}async scheduleMediaElementPlayback(t,n,r,o,i,a,l=1,s=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||a!==this._playGeneration)return null;try{if(await this.wake(),a!==this._playGeneration)return null;let c=this.acquireMediaElementSource(t);if(!c)return null;c.disconnect();let d=Um(l),f=this._ctx.createGain();f.gain.value=i;let m=this._ctx.currentTime,p=o-n,b={scheduledAt:m,elapsed:p,rate:d};f.connect(this.resolveDestination(t,m,o,d)??this._masterGain);let{fx:y,laneNode:x,clipGainNode:E,fades:v}=mw(this._ctx,t,c,f,b,{from:Math.max(p,0),clipDuration:s});this._rate=d,this._rateAnchorCtx=m,this._rateAnchorComp=o;let _={fx:y,fades:v,el:t,sourceNode:c,sourceKind:"media-element",gainNode:f,laneNode:x,clipGainNode:E,compositionStart:n,mediaStart:r,scheduledAt:m,priorMuted:t.muted,priorVolume:t.volume,mediaPlaybackRate:mt(t),bounded:!1};return t.volume=1,this._activeSources.push(_),this._paused=!1,_}catch(c){return V("webAudioTransport.mediaElementSource",c),null}}groupInput(t,n,r){let o=this._groups.get(t);if(o){if(o.generation!==this._playGeneration)try{o.reanchor(r),o.generation=this._playGeneration}catch(p){V("webAudioTransport.groupReanchor",p)}return o.input}if(!this._ctx||!this._masterGain)return null;let i=this._ctx.createGain(),a=this._ctx.createGain();a.connect(this._masterGain);let l=()=>Lc(n,t),s=l(),c=this._ctx.createGain();c.gain.value=s?.hasAttribute("data-hidden")?0:1,c.connect(a);let d=this._ctx.createGain();d.gain.value=fw(oi(s)),d.connect(c);let f={param:d.gain,gain:()=>oi(l())},m=nu(this._ctx,s??{getAttribute:()=>null},i,d,r,void 0,s?f:void 0);return this._groups.set(t,{input:i,output:a,isPresent:()=>l()!==null,fader:d,muteGain:c,fx:m,generation:this._playGeneration,reanchor:p=>{Eo([{param:d.gain}]);let b=l();d.gain.value=fw(oi(b)),c.gain.value=b?.hasAttribute("data-hidden")?0:1,m?.reanchor(p),b&&b!==s&&Hm(f,sw(b),p)},dispose:()=>{try{m?.dispose(),i.disconnect(),d.disconnect(),c.disconnect(),a.disconnect()}catch{}}}),this.attachGroupTap(t,a),i}startMetering(){this._metering=!0,this.attachMasterTap();for(let[t,n]of this._groups)this.attachGroupTap(t,n.output)}stopMetering(){this._metering=!1,this._masterTap?.dispose(),this._masterTap=null;for(let t of this._groupTaps.values())t.dispose();this._groupTaps.clear()}readLevels(){let t={};for(let[n,r]of this._groupTaps)this._groups.get(n)?.isPresent()&&(t[n]=r.read());return{master:this._masterTap?.read()??{l:0,r:0},groups:t}}attachMasterTap(){this._ctx&&this._masterGain&&!this._masterTap&&(this._masterTap=Gm(this._ctx,this._busOut??this._masterGain))}attachGroupTap(t,n){this._metering&&this._ctx&&!this._groupTaps.has(t)&&this._groupTaps.set(t,Gm(this._ctx,n))}setGroupMuted(t,n){let r=this._groups.get(t);if(r)try{r.muteGain.gain.value=n?0:1}catch(o){V("webAudioTransport.setGroupMuted",o)}}ensureMasterBus(t,n){if(!this._ctx||!this._masterGain||!this._busOut)return;if(this._master){if(this._master.generation===this._playGeneration)return;try{this._master.fx?.reanchor(n),this._master.generation=this._playGeneration}catch(i){V("webAudioTransport.masterReanchor",i)}return}let r=Nc(t);if(!r)return;this._masterGain.disconnect(this._busOut);let o=nu(this._ctx,r,this._masterGain,this._busOut,n,WO);this._master={fx:o,generation:this._playGeneration}}resolveDestination(t,n,r,o){if(!this._masterGain)return null;let i={scheduledAt:n,elapsed:r,rate:o};this.ensureMasterBus(t.ownerDocument,i);let a=Ss(t);return a?this.groupInput(a,t.ownerDocument,i)??this._masterGain:this._masterGain}handleSourceEnded(t,n,r,o){let i=this._activeSources.indexOf(n);if(i!==-1){this._activeSources.splice(i,1),r.muted=o;try{t.disconnect(),n.fx?.dispose(),n.fades?.node.disconnect(),n.clipGainNode.disconnect(),n.laneNode.disconnect(),n.gainNode.disconnect()}catch{}this._activeSources.length===0&&(this._paused=!0)}}async schedulePlayback(t,n,r,o,i,a,l,s=1,c=Number.POSITIVE_INFINITY,d=r){if(!this._ctx||!this._masterGain||l!==this._playGeneration)return null;try{if(await this.wake(),l!==this._playGeneration)return null;let f=i(),m=Um(s),p=mt(t),b=m*p,y=this._ctx.createBufferSource();y.buffer=n,y.playbackRate.value=b;let x=this._ctx.createGain();x.gain.value=a;let E=f-r,v=this._ctx.currentTime,_={scheduledAt:v,elapsed:E,rate:m};x.connect(this.resolveDestination(t,v,f,m)??this._masterGain);let U=d-r,{fx:G,laneNode:R,clipGainNode:D,fades:T}=mw(this._ctx,t,y,x,_,{from:Math.max(E,U,0),clipDuration:c});if(this._rate=m,this._rateAnchorCtx=v,this._rateAnchorComp=f,!$O(y,{elapsed:E,mediaStart:o,scheduledAt:v,globalRate:m,mediaRate:p,clipDuration:c,headCut:U}))return y.disconnect(),G?.dispose(),T?.node.disconnect(),D.disconnect(),R.disconnect(),x.disconnect(),null;let H=t.muted;t.muted=!0,VO(t,H);let I={fx:G,fades:T,el:t,sourceNode:y,sourceKind:"buffer",gainNode:x,laneNode:R,clipGainNode:D,compositionStart:r,mediaStart:o,scheduledAt:v,priorMuted:H,priorVolume:t.volume,mediaPlaybackRate:p,bounded:Number.isFinite(c)&&c>0};return this._activeSources.push(I),this._paused=!1,y.addEventListener("ended",()=>this.handleSourceEnded(y,I,t,H)),I}catch(f){return V("webAudioTransport.schedule",f),null}}setRate(t){let n=Um(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{To(r)&&(r.sourceNode.playbackRate.value=n*r.mediaPlaybackRate),r.fx?.setRate(n),this._ctx&&!this._paused&&r.fades?.rebook({scheduledAt:this._ctx.currentTime,elapsed:this.getTime()-r.compositionStart,rate:n})}catch(o){V("webAudioTransport.setRate",o)}return this.setBusRate(n),!0}setBusRate(t){let n=[...this._groups.values(),...this._master?[this._master]:[]];for(let r of n)try{r.fx?.setRate(t)}catch(o){V("webAudioTransport.setRate.bus",o)}}hasBoundedActiveSources(){return this._activeSources.some(t=>To(t)&&t.bounded)}stopAll(){for(let t of this._activeSources)this.dispose(t);this._activeSources=[],this._paused=!0,this._playGeneration+=1,this.rest()}releaseDetached(){this._activeSources=this._activeSources.filter(t=>t.el.isConnected?!0:(this.dispose(t,!1),!1))}dispose(t,n=!0){try{To(t)&&t.sourceNode.stop(),t.sourceNode.disconnect(),t.fx?.dispose(),t.fades?.node.disconnect(),t.clipGainNode.disconnect(),t.laneNode.disconnect(),t.gainNode.disconnect()}catch{}To(t)?t.el.muted=t.priorMuted:(t.el.volume=t.priorVolume,this._ctx&&n&&t.sourceNode.connect(this._ctx.destination))}setVolume(t){this._masterVolume=Math.max(0,Math.min(1,t)),this.applyMasterGain()}setElementVolume(t,n,r=1,o=n){for(let i of this._activeSources)if(i.el===t)try{i.sourceKind==="media-element"&&(i.el.volume=1),i.gainNode.gain.value=Ue(i.fades?o:n),i.clipGainNode.gain.value=Ue(r)}catch(a){V("webAudioTransport.setElementVolume",a)}}setMuted(t){this._masterMuted=t,this.applyMasterGain()}applyMasterGain(){this._monitorGain&&(this._monitorGain.gain.value=this._masterMuted?0:this._masterVolume)}ownsClock(){return!this._paused&&this._activeSources.some(To)}ownsElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t&&To(n))}routesElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t)}destroy(){this.stopAll(),this.stopMetering();for(let t of this._groups.values())t.dispose();if(this._groups.clear(),this._master?.fx?.dispose(),this._master=null,this._bufferCache.clear(),this._failedSrcs.clear(),this._mediaElementSources=new WeakMap,this._playingCaptured.clear(),this._suspendPending=!1,this._restTimer!==null&&clearTimeout(this._restTimer),this._restTimer=null,this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null,this._busOut=null,this._monitorGain=null,this._masterVolume=1,this._masterMuted=!1}};var aa="data-hf-studio-manual-edit-gesture";var hw=`[${aa}]`;function gw(e,t){let n=e.defaultView?.MutationObserver??globalThis.MutationObserver;if(!n||!e.documentElement)return{isActive:()=>e.querySelector(hw)!=null,observing:!1,disconnect:()=>{}};let r=new Set(e.querySelectorAll(hw)),o=l=>{for(let s of l){let c=s.target;Oe(c)&&(c.hasAttribute(aa)?r.add(c):r.delete(c))}},i=l=>{l.length!==0&&(o(l),t())},a=new n(i);return a.observe(e.documentElement,{subtree:!0,attributes:!0,attributeFilter:[aa]}),{observing:!0,isActive:()=>{i(a.takeRecords());for(let l of r){if(l.isConnected&&l.hasAttribute(aa))return!0;r.delete(l)}return!1},disconnect:()=>{a.disconnect(),r.clear()}}}var bw=333.3333333333333,Wm=1e3*60/60;function yw(e){return e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2?!1:e.compositionChanged===!0?!0:e.isPlaying?e.playingPollDue===!0:Number.isInteger(e.tick)&&e.tick>0&&e.tick%60===0}var jO=/^\s*spring\(\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*\)\s*$/;function xw(e){return Math.max(0,Math.min(1,e))}function Sw(e){let t=jO.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?xw(n):null}function Ew(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=xw(t),r=12-n*6,o=Math.PI*2*(1+n*1.5),i=1-Math.exp(-r)*Math.cos(o);return(1-Math.exp(-r*e)*Math.cos(o*e))/i}var KO=/^\s*wiggle\(\s*(\d+)\s*,\s*(easeOut|easeInOut|anticipate|uniform)\s*(?:,\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?)\s*)?\)\s*$/,YO=Math.PI*2;function XO(e){let t=KO.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 o=Number(t[3]);return!Number.isFinite(o)||o<0||o>1?null:{wiggles:n,type:r,amplitude:o}}function JO(e,t,n,r){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let o=r??(n==="easeInOut"?.08:n==="uniform"?.14:n==="anticipate"?.12:.16),i=n==="easeInOut"?o*Math.sin(Math.PI*e):n==="uniform"?o:o*(1-e);return e+(n==="anticipate"?-1:1)*i*Math.sin(YO*t*e)}function vw(e,t){let n=XO(e);if(!n)return null;let r=`${n.wiggles}:${n.type}:${n.amplitude??"default"}`,o=t?.get(r);if(o)return o;let i=a=>JO(a,n.wiggles,n.type,n.amplitude);return t?.set(r,i),i}var QO=24,Aw=e=>e>=1?1:0,ZO=e=>e,iu=String.raw`([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)`,eH=new RegExp(String.raw`^\s*M\s*0\s*,\s*0\s+C\s*${iu}\s*,\s*${iu}\s+${iu}\s*,\s*${iu}\s+1\s*,\s*1\s*$`,"i");function ww(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function tH(e,t,n,r,o){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let i=0,a=1;for(let l=0;l<QO;l+=1){let s=(i+a)/2;ww(s,t,r)<e?i=s:a=s}return ww((i+a)/2,n,o)}function nH(e){let t=eH.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),o=Number(t[3]),i=Number(t[4]);return Math.min(n,o)<0||Math.max(n,o)>1?null:a=>tH(a,n,r,o,i)}function rH(e,t){if(!e.startsWith("spring("))return null;let n=Sw(e);if(n===null)return null;let r=t.get(n);if(r)return r;let o=i=>Ew(i,n);return t.set(n,o),o}function oH(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 o=nH(n);return o&&t.set(n,o),o}function _w(e){if(e.__hfCustomEaseInstalled)return!0;let t=e.parseEase;if(!t)return!1;let n=new Map,r=new Map,o=new Map,i=s=>typeof s!="string"?null:s==="hold"?Aw:vw(s,o)??rH(s,r)??oH(s,n),a=(s,c,d=[])=>{let f=i(s);return f||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\(|$)/.test(s.trim())&&St("custom_ease_parse_failed",{ease:s}),t.call(c,s,...d)??ZO)};e.parseEase=function(c,...d){return a(c,this,d)};let l=e.registerEase;if(typeof l=="function"){l("hold",Aw);let s=c=>{let d=f=>f;d.config=(...f)=>a(`${c}(${f.join(",")})`,e),l(c,d)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}var $m="first-frame",iH=3;function aH(e){let t=e.ownerDocument?.defaultView;return t&&e instanceof t.Element?!0:e instanceof Element}function sH(e){if(!aH(e)||e.tagName!=="AUDIO"&&e.tagName!=="VIDEO")return!1;let t=e.ownerDocument?.defaultView;return t&&e instanceof t.HTMLMediaElement?!0:e instanceof HTMLMediaElement}function lH(e){return e.hasAttribute("data-start")||e.hasAttribute("data-track-index")}function uH(e,t,n){let r=e;for(;r;){if(lH(r)&&!Ps(r,{currentTime:0,compositionDuration:Number.POSITIVE_INFINITY,canonicalFps:30,exportRenderSeek:!1,timelineRegistry:n,resolver:t}))return!1;r=r.parentElement}return!0}function Cw(e,t,n,r){return t==="all"?!0:uH(e,n,r)}function cH(e,{scope:t="all"}={}){let n=e.defaultView,r=st({documentRef:e,timelineRegistry:n?.__timelines,includeAuthoredTimingAttrs:!0}),o=e.querySelector(`meta[name="${ja}"]`)!==null,i=Array.from(e.querySelectorAll("video, audio")).filter(sH).filter(s=>Cw(s,o&&s.preload!=="auto"?$m:t,r,n?.__timelines??{})).filter(s=>s.readyState<iH),a=Array.from(e.querySelectorAll("img")).filter(s=>Cw(s,s.getAttribute("loading")?.toLowerCase()==="lazy"?$m:t,r,n?.__timelines??{})).filter(s=>!s.complete),l=e.fonts?.status==="loading";return{pendingMedia:i,pendingImages:a,fontsLoading:l}}function dH(e,{pendingMedia:t,pendingImages:n,fontsLoading:r},o){let i=t.map(s=>new Promise(c=>{if(s.error){c();return}let d=()=>{s.removeEventListener("canplay",d),s.removeEventListener("error",d),o.removeEventListener("abort",d),c()};s.addEventListener("canplay",d),s.addEventListener("error",d),o.addEventListener("abort",d,{once:!0})})),a=n.map(s=>s.decode?s.decode().catch(()=>{}):Promise.resolve()),l=r&&e.fonts?e.fonts.ready.then(()=>{}):Promise.resolve();return Promise.all([...i,...a,l]).then(()=>{})}function fH(e,t,{scope:n="all"}={}){let r=cH(e,{scope:n});return r.pendingMedia.length===0&&r.pendingImages.length===0&&!r.fontsLoading?null:dH(e,r,t)}var mH=50;function pH(e,t){let n=e.defaultView;return!n||n.__renderReady||!n.__hf?null:new Promise(r=>{let o,i=()=>{o!==void 0&&clearTimeout(o),t.removeEventListener("abort",i),r()};if(t.aborted){i();return}t.addEventListener("abort",i,{once:!0});let a=()=>{if(n.__renderReady){i();return}o=setTimeout(a,mH)};a()})}var hH=50,gH=1.5,bH=2,yH=1500;function Vm(e,t){return new Promise(n=>{if(t.aborted){n(-1);return}let r=0,o=()=>{e.cancelAnimationFrame?.(r),n(-1)};t.addEventListener("abort",o,{once:!0}),r=e.requestAnimationFrame(i=>{t.removeEventListener("abort",o),n(i)})})}function xH(e,t){let n=e.defaultView;return n?(async()=>{let r=await Vm(n,t);if(t.aborted)return;let o=await Vm(n,t),i=o-r,a=0;for(;!t.aborted&&a<bH;){if(o-r>=yH)return;let l=await Vm(n,t);if(t.aborted)return;let s=l-o;i=Math.min(i,s),a=s<hH||s<=i*gH?a+1:0,o=l}})():null}var SH=8e3;function EH(e,t,n={}){let r=n.inputs??[(c,d)=>fH(c,d,{scope:n.scope}),pH,xH],o=new AbortController,i=r.map(c=>c(e,o.signal)).filter(c=>c!==null);if(i.length===0){t({timedOut:!1});return}let a=n.timeoutMs??SH,l,s=new Promise(c=>{l=setTimeout(()=>c("timed-out"),a)});Promise.race([Promise.all(i).then(()=>"done"),s]).then(c=>{clearTimeout(l),o.abort(),t({timedOut:c==="timed-out"})})}function Tw(e,t,n={}){EH(e,t,{...n,scope:$m})}var jm=new Map,sa=new Map,qm=new Map,zm=()=>{},Mw=()=>{},Rw=0;function Km(e){return/^[a-z][a-z0-9-]{0,63}$/.test(e)}function kw(e){let t=(qm.get(e)??0)+1;return qm.set(e,t),t}function Lw(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:(Rw-=1,Rw)}function Ym(e,t){let n=sa.get(e);if(!n)return;let r=()=>qm.get(e)===t.generation&&sa.get(e)===n;try{Promise.resolve(n(t.payload)).then(()=>{r()&&Mw(e,t.requestId)},o=>{r()&&zm(e,t.requestId,o)})}catch(o){r()&&zm(e,t.requestId,o)}}function Nw(e){zm=e}function Fw(e){Mw=e}function au(e,t,n){if(!Km(e))return;let r={payload:t,requestId:Lw(n),generation:kw(e)};jm.set(e,r),Ym(e,r)}function su(e,t){Km(e)&&(jm.delete(e),Ym(e,{payload:void 0,requestId:Lw(t),generation:kw(e)}))}function Pw(e,t){if(!Km(e))throw new Error(`Invalid HyperFrames runtime-data channel: ${e}`);sa.set(e,t);let n=jm.get(e);return n&&Ym(e,n),()=>{sa.get(e)===t&&sa.delete(e)}}var Iw=!1;function dn(e){if(e){if(typeof e.pause!="function"){Iw||(Iw=!0,St("timeline_missing_pause",{}));return}try{e.pause()}catch(t){V("runtime.timeline.pause",t)}}}function wH(e){let t=e;if(typeof t.remove=="function")for(let n of e.getChildren?.(!1,!0,!1)??[])n.data===si&&t.remove(n)}function _H(){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 CH(e,t){return t!==null&&e.length===t.length&&e.every((n,r)=>n===t[r])}function Dw(e,t,n){let r=null,o=!0;return()=>{let i=e();if(i.length===0)return r=null,o=!0,!0;if(CH(i,r))return o;r=i,o=!1;let a=i.length===1?i[0]:Promise.all(i);return Promise.resolve(a).then(()=>{r===i&&(o=!0,t())},l=>{r===i&&(o=!0,n(l),t())}),o}}function ua(e){let t=e.querySelector(`meta[name="${An}"]`)?.getAttribute("content");if(!t)return null;try{return JSON.parse(t)}catch{return null}}var Jm=e=>JSON.stringify([Array.from(e.attributes,t=>[t.name,t.value]).filter(([t])=>t!==br),e.innerHTML]),TH=new Set(["style","preload","src",br,Bn,Be,...Ya]),RH=e=>e.split(/\s+/).filter(t=>t&&!t.startsWith("__hf-")).join(" "),Ow=e=>JSON.stringify([Array.from(e.attributes,({name:t,value:n})=>[t,t==="class"?RH(n):n]).filter(([t,n])=>!TH.has(t)&&!(t==="class"&&!n)).sort(([t],[n])=>t<n?-1:1),e.hasAttribute("data-var-src")?null:xi(e),e.innerHTML]),ca=new WeakMap,Gw=e=>e.localName==="video"||e.localName==="audio",lu=e=>{if(!Oe(e))return;let t=Gw(e)?[e]:e.firstElementChild?e.querySelectorAll("video, audio"):[];for(let n of t)ca.has(n)||ca.set(n,Jm(n))},uu=null;function Bw(){typeof MutationObserver>"u"||!ua(document)||(lu(document.documentElement),uu=new MutationObserver(e=>{for(let t of e){t.addedNodes.forEach(lu);let{target:n}=t;Oe(n)&&Gw(n)&&ca.set(n,Jm(n))}}),uu.observe(document.documentElement,{childList:!0,subtree:!0}))}function Uw(){let e=o=>o?.config?.({force3D:!1}),t=Object.getOwnPropertyDescriptor(window,"gsap"),n=window.gsap;if(e(n),t?.configurable===!1||t?.get?.hfFlat)return;let r=Object.assign(()=>t?.get?t.get.call(window):n,{hfFlat:!0});Object.defineProperty(window,"gsap",{configurable:!0,enumerable:!0,get:r,set:o=>{t?.set?t.set.call(window,o):n=o,e(o)}})}var MH=new Map([["image",["href","xlink:href"]],["object",["data"]]]),kH=1e3,LH=16;function NH(){let e;return()=>e??(e=document.getAnimations())}var Xm=e=>Xa(e)||Le(e)&&bs(e)&&m0({volume:Number.parseFloat(e.dataset.volume??""),fxChain:e.getAttribute("data-fx-chain"),automation:e.getAttribute("data-automation"),audioGroup:e.getAttribute("data-audio-group"),masterChain:h0(e.ownerDocument)}),Ww="audio[data-start], video[data-start]",la=e=>Array.from(e.querySelectorAll(Ww)).filter(Xm);function Hw(e){let t=e.matches(`[${Ka}]`)?[e]:Array.from(e.querySelectorAll(`img[${Ka}]`)).filter(n=>n.closest("[data-start]")===e);for(let n of t)n.setAttribute("loading","eager")}function Vw(){let e=Zc(),t=window.parent!==window,n=u=>t&&u.hasAttribute(Dt);uu?.disconnect(),uu=null,ua(document)&&lu(document.documentElement);let r=()=>{};pb(Ce),Nw((u,h,g)=>{Ce({source:"hf-preview",type:"runtime-data-error",channel:u,requestId:h,message:g instanceof Error?g.message:String(g)})}),Fw((u,h)=>{try{r()}catch(g){Ce({source:"hf-preview",type:"runtime-data-error",channel:u,requestId:h,message:g instanceof Error?g.message:String(g)});return}Ce({source:"hf-preview",type:"runtime-data-applied",channel:u,requestId:h})}),qi(document),Fl(document),g0(document);let o=_H();if(e.canonicalFps=o.fps??e.canonicalFps,rb(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG){let u=JSON.stringify({canonicalFps:e.canonicalFps,source:o.source,rawFpsSource:o.rawFpsSource,rawFps:o.rawFps,fallbackReason:o.fallbackReason});globalThis.console.info(`[hyperframes] render runtime fps ${u}`)}let i=null,a=null,l=null,s=[],c=new Set,d=null,f=new Set,m=(u,h,g)=>{f.has(u)||(f.add(u),St(h,g))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(u){V("runtime.init.site1",u)}let p=new tu;e.transportClock=p;let b=new ou,y=!1;b.init().then(u=>{y=u}),window.__hf=window.__hf||{};let x=u=>u.closest("[data-hidden]")!==null||xs(u.ownerDocument,u),E=()=>{let u=window.gsap,h=window;if(!(!u?.registerPlugin||h.__hfAutoNoopRegistered))try{u.registerPlugin({name:"_auto",init:()=>!1}),h.__hfAutoNoopRegistered=!0}catch(g){m("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),V("runtime.autoMarker.install",g)}},v=()=>{let u=window.gsap;if(!u){m("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{_w(u)||m("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(h){m("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),V("runtime.customEase.install",h)}};E(),v(),document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden");try{Eb(document)}catch(u){V("runtime.init.cssVariables",u)}if(window.__timelines=window.__timelines||{},Array.isArray(window.__timelines)){let u=window.__timelines,h=xt()?.getAttribute("data-composition-id")??"root",g={};if(u.length===1)g[h]=u[0];else for(let S=0;S<u.length;S++)g[`tl-${S}`]=u[S];window.__timelines=g}let _=xt();_&&!_.hasAttribute("data-start")&&_.setAttribute("data-start","0");let U=u=>{s.push(u)},G=(u,h,g)=>{let S=g??`${u}:${JSON.stringify(h)}`;c.has(S)||(c.add(S),Ce({source:"hf-preview",type:"diagnostic",code:u,details:h}))},R=u=>{let h={scale:1,focusX:960,focusY:540},g=[],S=[],A={time:u.getTime(),duration:u.getDuration(),isPlaying:u.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:u.play,pause:u.pause,seek:u.seek,getTime:u.getTime,getDuration:u.getDuration,isPlaying:u.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>h,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>g,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:u.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>S,getRenderState:()=>({...A,time:u.getTime(),duration:u.getDuration(),isPlaying:u.isPlaying()})}},D=.75,T=.05,H=100,I=240,Y=u=>{if(u instanceof Error)return u.message||String(u);if(typeof u=="string")return u;try{return JSON.stringify(u)}catch{return String(u??"")}},W=u=>{let h=u.toLowerCase();return h.includes("cannot read properties of null")||h.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:h.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:h.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},X=u=>{let h=dr(u);return h===null?null:`${h}px`},ie=null,F=!1,z=()=>{if(!F)return xt();if(cp(),je&&!tt&&ie?.revision===bt&&(ie.el===null||ie.el.isConnected))return ie.el;let u=xt();return ie={revision:bt,el:u},u},O=()=>{let u=z();if(!u)return;let h=X(u.getAttribute("data-width")),g=X(u.getAttribute("data-height"));h&&(u.style.width=h),g&&(u.style.height=g),h&&u.style.setProperty("--comp-width",h),g&&u.style.setProperty("--comp-height",g),h&&(document.documentElement.style.width=h),g&&(document.documentElement.style.height=g),h&&(document.body.style.width=h),g&&(document.body.style.height=g)},N=()=>{let u=z(),h=Array.from(document.querySelectorAll("[data-composition-id]")).filter(g=>g.hasAttribute("data-duration")||g.hasAttribute("data-end"));for(let g of h){if(u&&g===u)continue;let S=g.getAttribute("data-duration"),A=g.getAttribute("data-end");S!=null&&!g.hasAttribute(Wr)&&g.setAttribute(Wr,S),A!=null&&!g.hasAttribute(Vr)&&g.setAttribute(Vr,A),g.removeAttribute("data-duration"),g.removeAttribute("data-end")}},L=new WeakMap,w=u=>[u.className,u.style.position,u.style.top,u.style.left,u.style.width,u.style.height,u.style.transform,u.getAttribute("data-width"),u.getAttribute("data-height")].join("|"),k=()=>{let u=z();if(!u)return;u.style.position||(u.style.position="relative"),u.style.overflow="hidden";let h=X(u.getAttribute("data-width")),g=X(u.getAttribute("data-height"));h&&(u.style.width=h),g&&(u.style.height=g);let S=Array.from(u.children).filter(C=>{let P=C.tagName.toLowerCase();return P==="script"||P==="style"||P==="link"||P==="meta"||!C.hasAttribute("data-start")||C.hasAttribute(Dt)?!1:L.get(C)!==w(C)}),A=S.filter(C=>C.style.getPropertyValue("display")==="none").map(C=>({el:C,priority:C.style.getPropertyPriority("display")}));for(let{el:C}of A)C.style.removeProperty("display");for(let C of S){let P=C.tagName.toLowerCase(),q=(C.style.top==="0px"||C.style.top==="0")&&(C.style.left==="0px"||C.style.left==="0")&&C.style.width==="100%"&&C.style.height==="100%",B=/translate\(\s*-50%\s*,\s*-50%\s*\)/.test(C.style.transform);if(q&&B&&!C.hasAttribute("data-width")&&!C.hasAttribute("data-height")){let be=C.style.top,se=C.style.left,pe=C.style.width,Ye=C.style.height;C.style.top="",C.style.left="",C.style.width="",C.style.height="";let Ke=window.getComputedStyle(C);Ke.top!=="auto"||Ke.bottom!=="auto"||Ke.left!=="auto"||Ke.right!=="auto"||Ke.width!=="0px"||Ke.height!=="0px"||(C.style.top=be,C.style.left=se,C.style.width=pe,C.style.height=Ye)}let M=window.getComputedStyle(C),J=M.position;if(J!=="absolute"&&J!=="fixed"&&(C.style.position="absolute"),P!=="audio"){let be=X(C.getAttribute("data-width")),se=X(C.getAttribute("data-height")),pe=M.width!=="0px"&&M.width!=="auto",Ye=M.height!=="0px"&&M.height!=="auto";be?!C.style.width&&!pe&&(C.style.width=be):!C.style.width&&M.width==="0px"&&(C.style.width="100%"),se?!C.style.height&&!Ye&&(C.style.height=se):!C.style.height&&M.height==="0px"&&(C.style.height="100%")}}for(let{el:C,priority:P}of A)C.style.setProperty("display","none",P);if(document.readyState==="complete")for(let C of S)L.set(C,w(C))},K=u=>st({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:u}),oe=null,ge=u=>{let h=oe;oe=K(!0);try{return u()}finally{oe=h}},Ee=u=>u&&oe?oe:K(u),$=(u,h=0,g)=>Ee(g?.includeAuthoredTimingAttrs??!0).resolveStartForElement(u,h),Q=(u,h)=>Ee(h?.includeAuthoredTimingAttrs??!0).resolveDurationForElement(u),Z=u=>{let h=u.closest("[data-composition-id]"),g=h?$(h,0):null,S=h?Q(h,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:h,inheritedStart:g,inheritedDuration:S}},me=u=>Ee(!0).resolveHostSlotsForElement(u),he=(u,h)=>{let g=Ge(u.dataset.duration),S=g!=null&&g>0?h+g:1/0;return fr({start:h,end:S},me(u))},le=u=>Ee(!0).resolveMediaStartForElement(u);window.__hfResolveMediaStartSeconds=le,s.push(()=>{window.__hfResolveMediaStartSeconds===le&&delete window.__hfResolveMediaStartSeconds});let ne=!!document.querySelector("[data-composition-src]"),te=!1;{let u=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let h of u){let g=h.getAttribute("data-composition-id");if(g&&h.children.length===0&&document.querySelector(`template#${CSS.escape(g)}-template`)){te=!0;break}}}let We=!ne&&!te,ke=u=>{let h=en(u);return h==null?null:Math.max(0,h)},Te=u=>typeof u=="number"&&Number.isFinite(u)&&u>rn,ut=()=>Array.from(document.querySelectorAll("video[data-start], audio[data-start]")).length===0?null:ge(()=>U0(document,{mediaStart:le,mediaDuration:Gr})),_r=()=>{let u=z();if(!u)return null;let h=window.__timelines??{},g=st({timelineRegistry:h,includeAuthoredTimingAttrs:!0});return W0(u,g)},ma=()=>{let u=window;return!!(u.lottie||u.DotLottie)},ko=()=>{let u=z();if(!u)return Xr({authoredDurationSeconds:null,clipEndsSeconds:[]});let h=st({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:!0});return V0(u,h,{unregisteredLottie:ma()})},Lo=null,bu=()=>{if(tt)return ko();let u=Tr();return Lo?.revision!==u&&(Lo={revision:u,result:ko()}),Lo.result},pa=u=>{window.__hf=window.__hf||{},window.__hf.durationSource={source:u.source,seconds:u.seconds,pendingClips:u.pendingClips},u.source==="derived"&&G("composition_duration_derived",{source:u.source,seconds:u.seconds,pendingClips:u.pendingClips},`composition_duration_derived:${u.seconds}`)},ha=()=>{let u=ut();return typeof u!="number"||!Number.isFinite(u)||u<=rn?null:u},yu=u=>Te(u)?Math.max(rn,u*D):rn,Cr=(u=!1)=>{let h=0;for(let g of e.deterministicAdapters){let S=u?g.getAnimationCycleEndSeconds:g.getInferredDurationSeconds;if(typeof S!="function")continue;let A=null;try{A=S()}catch(C){V("runtime.init.adapterDuration",C)}typeof A=="number"&&Number.isFinite(A)&&A>0&&(h=Math.max(h,A))}return h>rn?h:null},tt=!1,ga=()=>tt&&window.__HF_EXPORT_RENDER_SEEK_CONFIG!=null,de=[...["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",ms,"data-playback-rate","data-automation","data-playback-start","data-media-start","id","src"],"data-width","data-height"],Re=NE(de),wt=["loadedmetadata","durationchange","emptied"],nt=null,mn=-1,pn=null,No=Number.NEGATIVE_INFINITY,je=null,bt=0,sp=new Map,ba=u=>{if(!je||tt)return Array.from(document.querySelectorAll(u));Re(je.takeRecords())&&gn();let h=sp.get(u);if(h?.revision===bt)return h.nodes;let g=Array.from(document.querySelectorAll(u));return sp.set(u,{revision:bt,nodes:g}),g},hn=()=>{},gn=()=>{bt+=1,hn()},lp=()=>({media:ha(),authoredComposition:_r()}),C_=()=>{let u=window.__timelines??{},h="";for(let g of Object.keys(u)){let S=u[g];S&&(h+=`${g}=${ke(S)??"?"};`)}return h},up=u=>{let h=u.target;_e(h)&&As(h)||gn()},T_=(u,h)=>{let g=je?.takeRecords()??[];h();let S=je?.takeRecords()??[];(Re(g)||Re(S.filter(A=>A.target!==u)))&&gn()},R_=u=>{let h=je?.takeRecords()??[];u(),je?.takeRecords(),Re(h)&&gn()},cp=()=>{if(!(je||typeof MutationObserver>"u")){je=new MutationObserver(u=>{Re(u)&&gn()}),je.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:de});for(let u of wt)document.addEventListener(u,up,!0);s.push(()=>{je?.disconnect(),je=null,gn();for(let u of wt)document.removeEventListener(u,up,!0)})}};F=!0;let Tr=()=>{cp(),je&&Re(je.takeRecords())&&gn();let u=Date.now();if(!p.isPlaying()||u-No>=Wm){No=u;let h=C_();h!==pn&&(pn=h,gn())}return bt},dp=u=>tt?lp():(u??(u=Tr()),nt&&mn===u||(mn=u,nt=lp()),nt),rt=(u,h=0,g)=>{let S=null,A=$0({declared:Ge(z()?.getAttribute("data-duration")),timeline:()=>ke(u),floors:()=>{let{media:C,authoredComposition:P}=dp(g);return[C,P,Cr()]},fallback:h,derived:()=>(S=bu(),S.seconds??0)});return S?pa(S):window.__hf?.durationSource&&delete window.__hf.durationSource,A},xu=new WeakMap,Fo=u=>u.__hfReal??u,Su=null,Po=new Set,fp=()=>{for(let u of Po)u===e.capturedTimeline||u===Su?.timeline||(Po.delete(u),u.kill?.())},Eu=()=>{let u=window.__timelines??{},h=ye=>{let fe=Object.entries(u).filter(ae=>!!ae[1]&&typeof ae[1].play=="function"&&typeof ae[1].pause=="function");if(fe.length!==1)return{timeline:null};let j=fe[0];if(!j)return{timeline:null};let[ee,ce]=j;return{timeline:ce,selectedTimelineIds:[ee],selectedDurationSeconds:ke(ce),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:ye,soleTimelineId:ee}}}},g=st({timelineRegistry:u,includeAuthoredTimingAttrs:!0}),{media:S,authoredComposition:A}=dp(),C=Math.max(S??0,A??0)||null,P=yu(C),q=ye=>{let fe=document.querySelector(`[data-composition-id="${CSS.escape(ye)}"]`);return fe?g.resolveStartForElement(fe,0):0},B=(ye,fe)=>{let j=q(fe.compositionId);ye.add(fe.timeline,j),xu.set(Fo(fe.timeline),{hostId:fe.compositionId,parent:ye,at:j})},M=(ye,fe)=>{let j=Fo(fe.timeline),ee=xu.get(j);return ee&&ee.parent===ye&&j.parent===Fo(ye)?ee:null},J=(ye,fe)=>Math.abs(ye.at-q(fe.compositionId))<1e-6,ue=(ye,fe)=>{let j=M(ye,fe);!j||J(j,fe)||B(ye,fe)},be=ye=>{let fe=window.gsap;if(!fe||typeof fe.timeline!="function")return null;let j=fe.timeline({paused:!0});Po.add(j);for(let ee of ye)B(j,ee);return Kt(pe(j,ye)),j},se=(ye,fe)=>{if(!Te(ye))return null;let j=window.gsap;if(!j||typeof j.timeline!="function")return null;let ee=j.timeline({paused:!0});if(Po.add(ee),fe){try{ee.add(fe,0)}catch(ae){V("runtime.init.site2",ae)}Kt(pe(ee,[{timeline:fe}]))}let ce=ee;if(typeof ce.to=="function")try{ce.to({},{duration:ye,data:si})}catch(ae){V("runtime.init.site3",ae)}return ee},pe=(ye,fe)=>{if(!ye||typeof ye.getChildren!="function")return[];try{let j=ye.getChildren(!0,!0,!0);return Array.isArray(j)?fe.filter(ee=>j.includes(Fo(ee.timeline))):[]}catch{return[]}},Ye=(ye,fe)=>{let j=ye,ee={addedIds:[],nested:[]};if(typeof j.getChildren!="function")return ee;try{let ce=j.getChildren(!0,!0,!0)??[];if(!Array.isArray(ce))return ee;let ae=[];for(let ve of fe){if(ce.includes(Fo(ve.timeline))){ue(ye,ve);continue}try{B(ye,ve),ae.push(ve.compositionId)}catch(Ie){V("runtime.init.site4",Ie)}}return{addedIds:ae,nested:pe(ye,fe)}}catch{return ee}},Ke=z(),He=Ke?.getAttribute("data-composition-id")??null;if(!He)return h("root_missing_composition_id");let Xe=u[He]??null,Ve=(()=>{if(!Ke)return[];let ye=new Set,fe=Array.from(Ke.querySelectorAll("[data-composition-id]")),j=[];for(let ee of fe){let ce=ee.getAttribute("data-composition-id");if(!ce||ce===He||ye.has(ce))continue;ye.add(ce);let ae=u[ce]??null;if(!ae||typeof ae.play!="function"||typeof ae.pause!="function")continue;let ve=ke(ae);j.push({compositionId:ce,timeline:ae,durationSeconds:ve??0})}return j})(),Kt=ye=>{for(let fe of ye){let j=fe.timeline;if(typeof j.paused=="function")try{j.paused(!1)}catch(ee){V("runtime.init.site5",ee)}}};if(Xe){let ye=Ve.length>0?Ye(Xe,Ve):{addedIds:[],nested:[]},fe=ye.addedIds;if(Kt(ye.nested),(Ve.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id='"+He+"'])"))&&(Xn=!0),fe.length>0)try{yi(Xe,Xe.time(),!1)}catch{}wH(Xe);let j=ke(Xe);if(!Te(j)&&Ve.length>0){let ae=Ve.map(Yt=>Yt.compositionId),ve=be(Ve),Ie=ke(ve);if(ve&&Te(Ie))return{timeline:ve,selectedTimelineIds:ae,selectedDurationSeconds:Ie,mediaDurationFloorSeconds:S,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:He,rootDurationSeconds:j,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:P,selectedDurationSeconds:Ie,mediaDurationFloorSeconds:S,authoredCompositionDurationFloorSeconds:A,selectedTimelineIds:ae,autoNestedChildren:fe}}};let at=se(C??0,Xe),dt=ke(at);if(at&&Te(dt))return{timeline:at,selectedTimelineIds:[He],selectedDurationSeconds:dt,mediaDurationFloorSeconds:S,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:He,rootDurationSeconds:j,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:S,authoredCompositionDurationFloorSeconds:A,selectedDurationSeconds:dt,selectedTimelineIds:[He],autoNestedChildren:fe}}}}if(!Te(j)&&Ve.length===0){let ae=se(C??0,Xe),ve=ke(ae);if(ae&&Te(ve))return{timeline:ae,selectedTimelineIds:[He],selectedDurationSeconds:ve,mediaDurationFloorSeconds:S,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:He,rootDurationSeconds:j,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:S,authoredCompositionDurationFloorSeconds:A,selectedDurationSeconds:ve,selectedTimelineIds:[He]}}}}let ee=Ge(Ke?.getAttribute("data-duration")),ce=Math.max(Te(ee)?ee:0,A??0);if(ce>0&&Te(ce)&&Te(j)&&ce>=j+.5){let ae=Xe;if(typeof ae.to=="function")try{ae.to({},{duration:0,data:si},ce)}catch(Ie){V("runtime.init.site6",Ie)}let ve=ke(Xe);if(Te(ve))return{timeline:Xe,selectedTimelineIds:[He],selectedDurationSeconds:ve,mediaDurationFloorSeconds:S,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:He,rootDurationSeconds:j,rootDeclaredDur:ee,authoredCompositionDurationFloorSeconds:A,newDur:ve}}}}return{timeline:Xe,selectedTimelineIds:[He],selectedDurationSeconds:j,mediaDurationFloorSeconds:S,diagnostics:fe.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:He,selectedDurationSeconds:j,autoNestedChildren:fe}}:void 0}}if(Ve.length>0){let ye=Ve.map(ae=>ae.compositionId),fe=Su,j=fe?.size===Ve.length&&Te(ke(fe.timeline))&&Ve.every(ae=>{let ve=M(fe.timeline,ae);return ve!==null&&J(ve,ae)})?fe.timeline:null,ee=j??be(Ve),ce=ke(ee);if(ee)return j||(Su={timeline:ee,size:Ve.length}),{timeline:ee,selectedTimelineIds:ye,selectedDurationSeconds:ce,mediaDurationFloorSeconds:S,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:He,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:P,selectedDurationSeconds:ce,mediaDurationFloorSeconds:S,selectedTimelineIds:ye}}}}return h("root_composition_id_unmatched_in_registry")},Xn=!1,M_=u=>{let h=window.gsap,g=u;if(!(!g||typeof g.getChildren!="function"||!h||typeof h.parseEase!="function"))for(let S of g.getChildren(!0,!0,!0)){let A=S,C=A.timeline;if(!C||!("_ease"in C)||typeof C._ease=="function")continue;let P=A.vars?.keyframes,B=(P&&!Array.isArray(P)?P.ease:void 0)??A.vars?.ease??"none";try{let M=h.parseEase(B);typeof M=="function"&&(C._ease=M)}catch(M){St("keyframe_ease_repair_failed",{ease:typeof B=="string"?B:String(B)}),V("runtime.keyframeEase.repair",M)}}},Jn=()=>{if(v(),!We)return!1;let u=e.capturedTimeline,h=ke(u),g=Te(h);if(u&&g&&Xn)return!1;let S=Eu();if(!S.timeline)return!1;if(u&&u===S.timeline)return typeof u.timeScale=="function"&&u.timeScale(e.playbackRate),!1;e.capturedTimeline=S.timeline,fp(),typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),M_(e.capturedTimeline);let A=rt(e.capturedTimeline,0);if(A<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),dn(e.capturedTimeline)),A>0){try{p.setDuration(A)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let q=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(q,!1),dn(e.capturedTimeline)}let P=window.__hfStudioManualEditsApply;typeof P=="function"&&P(),qi(document)}if(S.diagnostics&&Ce({source:"hf-preview",type:"diagnostic",code:S.diagnostics.code,details:S.diagnostics.details}),Ce({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:S.selectedTimelineIds??[],selectedDurationSeconds:S.selectedDurationSeconds??null,mediaDurationFloorSeconds:S.mediaDurationFloorSeconds??null}}),t){let P=z(),q=A>0?A:0,B=String(q>0?q:1),M=new Set,J=se=>se.tagName.toLowerCase()===tn,ue=new Set(document.querySelectorAll("[data-start]")),be=se=>{let pe=se.parentElement;for(;pe&&pe!==P;){if(ue.has(pe))return!0;pe=pe.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let se of e.capturedTimeline.getChildren(!0))if(typeof se.targets=="function")for(let pe of se.targets())we(pe)&&pe!==P&&(J(pe)||pe.hasAttribute("data-start")||be(pe)||M.has(pe)||(M.add(pe),pe.setAttribute("data-start","0"),pe.setAttribute("data-duration",B),pe.setAttribute(Dt,"1")))}catch{}if(we(P))for(let se of P.querySelectorAll("[id]"))we(se)&&se!==P&&(se.hasAttribute("data-start")||be(se)||M.has(se)||se.tagName==="SCRIPT"||se.tagName==="STYLE"||se.tagName==="LINK"||J(se)||(M.add(se),se.setAttribute("data-start","0"),se.setAttribute("data-duration",B),se.setAttribute(Dt,"1")))}let C=vu();for(let P of bn)Io.delete(P),Au(P,C);return!0},mp=()=>{if(e.tornDown)return;let u=Eu();if(!u.timeline){e.capturedTimeline=null,Xn=!1,p.setDuration(0),jt(e.currentTime);return}if(e.capturedTimeline!==u.timeline)Xn=!1,Jn();else{let h=rt(e.capturedTimeline,0);h>0&&h!==p.getDuration()&&(p.setDuration(h),it())}jt(e.currentTime)};r=()=>{mp(),it()},window.__hfForceTimelineRebind=mp;let k_=()=>{let u=z();if(!we(u))return;let h=u.getBoundingClientRect(),g=dr(u.getAttribute("data-width")),S=dr(u.getAttribute("data-height")),A=window.getComputedStyle(u),C=g!==null&&S!==null,P=h.width<=0||h.height<=0||u.clientWidth<=0||u.clientHeight<=0;!C||!P||G("root_stage_layout_zero",{compositionId:u.getAttribute("data-composition-id")??null,declaredWidth:g,declaredHeight:S,rectWidth:Math.round(h.width),rectHeight:Math.round(h.height),clientWidth:u.clientWidth,clientHeight:u.clientHeight,display:A.display,visibility:A.visibility,overflow:A.overflow},`root-stage-layout-zero:${u.getAttribute("data-composition-id")??"unknown"}`)},L_=()=>{e.tornDown||(d!=null&&window.cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{d=null,k_()}))},N_=()=>{a=u=>{let h=Y(u.error??u.message).slice(0,I);if(!h)return;let g=W(h);Ce({source:"hf-preview",type:"diagnostic",code:g.code,details:{category:g.category,message:h,filename:u.filename||null,line:Number.isFinite(u.lineno)?u.lineno:null,column:Number.isFinite(u.colno)?u.colno:null}})},l=u=>{let h=Y(u.reason).slice(0,I);if(!h)return;let g=W(h);Ce({source:"hf-preview",type:"diagnostic",code:`${g.code}_unhandled_rejection`,details:{category:`${g.category}-unhandled-rejection`,message:h}})},window.addEventListener("error",a),window.addEventListener("unhandledrejection",l)},pp=new WeakSet,F_=()=>{let u=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let g of u){if(pp.has(g))continue;pp.add(g);let S=()=>{if(!Oe(g))return;let A=g.tagName.toLowerCase(),C=g.getAttribute("src")??g.getAttribute("href")??g.getAttribute("poster")??null,P=A==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";G(P,{tagName:A,assetUrl:C,currentSrc:(Je(g)||_e(g))&&g.currentSrc||null,readyState:_e(g)?g.readyState:null,networkState:_e(g)?g.networkState:null},`${P}:${A}:${C??"unknown"}`)};g.addEventListener("error",S),U(()=>{g.removeEventListener("error",S)})}let h=document.fonts;h&&h.ready.then(()=>{if(e.tornDown)return;let g=Array.from(h).filter(S=>S.status==="error").map(S=>S.family).filter(S=>!!S).slice(0,10);g.length!==0&&G("runtime_font_load_issue",{failedFamilies:g,totalFaces:Array.from(h).length},`runtime-font-load-issue:${g.join("|")}`)}).catch(()=>{})},P_=(u,h)=>{if(!u.timeline)return!1;let g=e.capturedTimeline;if(g&&g===u.timeline)return!1;let S=Math.max(0,e.currentTime||0);e.capturedTimeline=u.timeline,fp(),typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{dn(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&yi(e.capturedTimeline,S,!1)}catch(A){V("runtime.init.site7",A)}return Ce({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:h,previousTime:S,selectedTimelineIds:u.selectedTimelineIds??[],selectedDurationSeconds:u.selectedDurationSeconds??null,mediaDurationFloorSeconds:u.mediaDurationFloorSeconds??null}}),!0},Qn=null,hp=!1,bn=new Set,Io=new WeakMap,vu=()=>{let u;return()=>u??(u=Rc(e.capturedTimeline??{}))},ya=()=>{e.tornDown||(Qn!=null&&window.clearTimeout(Qn),Qn=window.setTimeout(()=>{if(e.tornDown||(Qn=null,ga()))return;let u=Eu();if(!u.timeline||!Te(u.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){Jn()&&(it(),ot(!0));return}if(hp)return;let g=ke(e.capturedTimeline),S=u.selectedDurationSeconds??ke(u.timeline);Te(S)&&(!Te(g)||S>=g+T)&&P_(u,"manual")&&(hp=!0,Ce({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:g??null,selectedDurationSeconds:S??null,selectedTimelineIds:u.selectedTimelineIds??[],mediaDurationFloorSeconds:u.mediaDurationFloorSeconds??null}}),it(),ot(!0))},H))},gp=u=>{_e(u.currentTarget)&&xy(u.currentTarget)},bp=u=>{let h=u.currentTarget;e.tornDown||p.isPlaying()||!_e(h)||to(h)||(yn=null,e.mediaForceSyncNextTick=!0,ht())},yp=u=>{_e(u.currentTarget)&&Sy(u.currentTarget)},xp=u=>{Xm(u)&&dw(u)&&Co(u,_o(u))},Sp=u=>{let h=u.currentTarget;_e(h)&&xp(h)},Ep=u=>{u.removeEventListener("loadedmetadata",ya),u.removeEventListener("durationchange",ya),u.removeEventListener("loadedmetadata",gp),u.removeEventListener("loadedmetadata",bp),u.removeEventListener("loadedmetadata",Sp),u.removeEventListener("error",yp),bn.delete(u)},I_=()=>{for(let u of bn)Ep(u)},vp=()=>{for(let u of bn)u.isConnected||(Ep(u),u.pause(),Ic(u),u.remove());b.releaseDetached()},Ap=u=>{let h=Number.parseFloat(u.dataset.volume??"");return Number.isFinite(h)?Math.max(0,Math.min(1,h)):null},xa=()=>{if(e.tornDown)return;let u=Array.from(document.querySelectorAll("video, audio")),h=[],g=vu();for(let S of u){if(bn.has(S))continue;bn.add(S);let A=Ap(S);A!==null&&(S.volume=A),S.addEventListener("loadedmetadata",ya),S.addEventListener("durationchange",ya),S.addEventListener("loadedmetadata",Sp),xp(S),S.addEventListener("loadedmetadata",gp),S.addEventListener("loadedmetadata",bp),S.addEventListener("error",yp),my(S),Tu(S)?h.push(S):vs(S),Au(S,g)}h.length>0&&jt(e.currentTime,h)},Au=(u,h)=>{Io.has(u)||a0(u,e.capturedTimeline,rt(e.capturedTimeline,0),Io,{allowLiveTimelineSeek:!window.__HF_RENDER_CAPTURE_MODE,...h&&{movers:h}})},wu=new WeakMap,D_=u=>{let h=wu.get(u);if(h!==void 0)return h;let g=window.getComputedStyle(u).position,S=g==="static"||g==="relative"||g==="sticky";return wu.set(u,S),S},_u=new WeakMap,O_=u=>{let h=_u.get(u);if(h!==void 0)return h;let g=u.querySelector("[data-start]")===null;return _u.set(u,g),g},H_=()=>{wu=new WeakMap,_u=new WeakMap},Rr=new WeakMap,wp=(u,h)=>{if(!Rr.has(u)){let g=u.style.getPropertyValue("display"),S=u.style.getPropertyPriority("display"),A=h&&g==="none"&&!S;Rr.set(u,A?{value:"",priority:""}:{value:g,priority:S})}u.style.display="none"},_p=u=>{let h=Rr.get(u);h&&(Rr.delete(u),h.value?u.style.setProperty("display",h.value,h.priority):u.style.removeProperty("display"))},Sa=new WeakSet,Ea=!1,Cp=u=>_e(u)&&u.hasAttribute("data-start")&&(Xm(u)||b.routesElement(u)),Tp=u=>Cp(u)||Array.from(u.querySelectorAll(Ww)).some(Cp),Rp=new WeakMap,G_=(u,h)=>{for(let g of la(document)){if(Ss(g)!==u||b.routesElement(g)||x(g))continue;let S=le(g),A=Ge(g.dataset.duration),C=A!=null&&A>0?S+A:1/0;if(Number.isFinite(S)&&h<C)return!0}return!1},B_=u=>{let h=!1;for(let g of ba(tn)){let S=g.hasAttribute("data-hidden"),A=Rp.get(g);A!==S&&(Rp.set(g,S),g.id&&(b.setGroupMuted(g.id,S),A&&!S&&G_(g.id,u)&&(h=!0)))}return h},Mp=u=>{let h=rt(e.capturedTimeline,0,u);return(g,S)=>Ps(g,{currentTime:S,compositionDuration:h,canonicalFps:e.canonicalFps,exportRenderSeek:!!window.__HF_EXPORT_RENDER_SEEK_CONFIG,timelineRegistry:window.__timelines??{},resolver:Ee(!0)})},kp=(u,h,g,S)=>{for(let A=u;A&&A!==S;A=A.parentElement)if(ar(A)&&A.hasAttribute("data-start")&&!n(A)&&!g(A,h))return!1;return!0},Lp=()=>({canonicalFps:e.canonicalFps,parked:Z0(),parkedClips:Ds}),Np=sc(),Fp=Qa(),U_=_g(u=>Fs(u,{timelineRegistry:window.__timelines??{},resolver:Ee(!0)})),va=new Set,Pp=new WeakSet,W_=u=>{if(va.size===0||!p.isPlaying())return;let h=[];for(let A of va){let C=$(A,Number.NaN);A.isConnected&&A.hasAttribute(Be)&&!(C<=u+wa)||(va.delete(A),A.isConnected&&A.hasAttribute(Be)&&C>u&&h.push(A))}if(h.length===0)return;let g=new Set(h.flatMap(A=>A.closest(`[${Ct}]`)??[]));for(let A of g)A.removeAttribute(Ct);let S=ac(h);getComputedStyle(h[0]).visibility,S();for(let A of g)A.setAttribute(Ct,"");for(let A of h)Pp.add(A)},Aa=u=>!1,wa=2,_a=4,Cu=(u,h,g,S=wa)=>{let A=_e(u)?le(u):$(u,Number.NaN),C=A+(Q(u)??Number.NaN);return A>g&&A<=g+S||C<=g&&C>=g-S||h(u,g+S)},Mr=null,Tu=u=>Fp&&u.hasAttribute("data-start")&&As(u),kr=new WeakMap,Ru=new WeakMap,Do=new WeakSet,Mu=new WeakSet,Ip=u=>y0(u,()=>!e.tornDown&&kr.get(u)===!0&&le(u)>p.now()),Dp=u=>u.parentElement?.closest("[data-composition-id]"),Op=3,Oo=new Set,Ho=new Set,Hp=["canplay","suspend","error"],Gp=u=>{for(let h of Hp)u.removeEventListener(h,Bp);return Oo.delete(u)},Bp=u=>{let h=u.currentTarget;u.type!=="error"&&h.readyState<3||(Gp(h),Up())},Up=()=>{let u=Array.from(Ho).filter(h=>h.isConnected).sort((h,g)=>le(h)-le(g));for(let h of u){if(Oo.size>=Op)break;Ho.delete(h),jt(e.currentTime,[h])}},Wp=u=>{if(vs(u),Ip(u),!(Oo.has(u)||u.readyState>=3)){Oo.add(u);for(let h of Hp)u.addEventListener(h,Bp)}},V_=u=>{let h=Qr(u,Number.NaN),g=Uo(Array.from(bn).filter(C=>C.isConnected&&Qr(C,Number.NaN)===h&&Dp(C)===Dp(u))).mediaClips,S=g.find(C=>C.el===u)?.end??Number.NaN,A;for(let C of g)C.el!==u&&C.start>=S-ni(S)&&!(A&&A.start<=C.start)&&(A=C);!A||!Tu(A.el)||(Ru.set(A.el,u),kr.get(A.el)!==!0&&(kr.set(A.el,!0),Ho.delete(A.el),Wp(A.el)))},$_=(u,h,g,S,A)=>{let C=p.isPlaying();h&&C?Do.has(u)||(Do.add(u),V_(u)):Do.delete(u);let P=Ru.get(u),q=P!==void 0&&Do.has(P),B=kr.get(u),M=!h&&!q&&B!==!0&&Oo.size>=Op;M&&g?Ho.add(u):Ho.delete(u);let ue=!h&&!A&&C&&le(u)+(Q(u)??Number.NaN)<=S&&(B!==!0||u.networkState===2&&u.readyState<4),be=h||q||g&&!M&&!ue;(h||!be)&&Gp(u)&&queueMicrotask(Up);let se=be&&!h&&le(u)>p.now(),pe=Mu.has(u);if(se?Mu.add(u):Mu.delete(u),B===be){se&&!pe&&Ip(u);return}kr.set(u,be),be?(!h||B===void 0)&&(h?vs(u):Wp(u)):u.preload!=="none"&&(u.preload="none",B&&T_(u,()=>x0(u)))},Vp=(u,h)=>Mr!==null&&p.isPlaying()&&(h(u,Mr)||Cu(u,h,Mr,_a)),q_=(u,h,g)=>kr.get(u)===!0&&Cu(u,h,g,_a)||Vp(u,h),ku=new WeakMap,$p=new WeakSet,Lu=new WeakSet,qp=new WeakMap,zp=u=>u.style.visibility==="hidden"&&u.style.getPropertyPriority("visibility")!=="important"&&!Lu.has(u),Nu=new WeakMap,Fu=(u,h)=>{for(let g=u.parentElement;g&&g!==h;g=g.parentElement)if(g.hasAttribute("data-start")&&ar(g)&&zp(g))return!0;return!1},Pu=new Map,jp=-1,z_=_a+wa+1,j_=1,K_=(u,h,g)=>{let S=g(u);if(!S||!Number.isFinite(S.start))return null;let A=[];for(let C of[0,wa,_a])A.push(S.start-C,S.end-C,S.end+C);for(let C=u.parentElement;C&&C!==h;C=C.parentElement){if(!C.hasAttribute("data-start"))continue;let P=g(C);if(!P||!Number.isFinite(P.start))return null;A.push(P.start,P.end)}return A.filter(C=>Number.isFinite(C))},Y_=(u,h,g,S)=>{if(!g||!(Math.abs(h-u)<=j_))return null;if(jp!==S)return Pu.clear(),jp=S,null;let A={timelineRegistry:window.__timelines??{},resolver:Ee(!0)},C=B=>Fs(B,A),P=Math.min(u,h),q=Math.max(u,h);return B=>{let M=ku.get(B);if(M===void 0||_e(B)&&(Ru.has(B)||Do.has(B))||!B.hasAttribute(Dt)&&B.style.visibility!==(M?"visible":"hidden")||Fu(B,g)!==(Nu.get(B)??!1))return!1;let J=Pu.get(B);if(J===void 0&&(J=K_(B,g,C),Pu.set(B,J)),!J)return!1;for(let ue of J)if(ue>=P&&ue<=q||Mr!==null&&Math.abs(ue-Mr)<=z_)return!1;return!0}},X_=(u,h,g,S)=>{if(Aa(u))return;let A=z(),C=!1,P=Mp(g),q=S===void 0||g===void 0?null:Y_(S,u,A,g);for(let M of h){if(!ar(M))continue;if(M.hasAttribute("data-hidden")){Sa.has(M)||(Sa.add(M),Tp(M)&&(Ea=!0)),wp(M,!1),(Le(M)||Je(M))&&i?.setSourceVisibility(M,!1);continue}if(Sa.has(M)&&(_p(M),Sa.delete(M),Tp(M)&&(Ea=!0)),!M.hasAttribute("data-start")||q?.(M))continue;let ue=Fu(M,A);Nu.set(M,ue);let be=P(M,u)&&kp(M.parentElement,u,P,A)&&!ue;ku.set(M,be);let se=n(M);if($p.has(M)||($p.add(M),M.style.visibility==="hidden"&&Lu.add(M)),!se&&!(be&&zp(M))){let Ye=M.style,Ke=Ye.getPropertyPriority("visibility")==="important";!be&&!Ke&&!Lu.has(M)&&qp.set(M,Ye.getPropertyValue("visibility"));let He=be?Ke&&qp.get(M)||"visible":"hidden";Ye.setProperty("visibility",He,be?"":"important")}M.toggleAttribute(Be,!se&&!be),!se&&!be&&!Pp.has(M)&&va.add(M);let pe=(Np||Fp)&&!be&&Cu(M,P,u);pe&&!M.hasAttribute(or)&&Hw(M),M.toggleAttribute(or,pe),_e(M)&&bn.has(M)&&Tu(M)&&$_(M,be,pe||q_(M,P,u),u,Vp(M,P)),!_e(M)&&!Je(M)&&(C=!0),(Le(M)||Je(M))&&i?.setSourceVisibility(M,be),be?_p(M):D_(M)&&O_(M)&&wp(M,!0)}C&&fg()&&i?.refresh(),U_(u);let B=B_(u);if((Ea||B)&&p.isPlaying()){b.stopAll();for(let M of la(document))x(M)&&(M.volume=0);Yu()}Ea=!1},J_=u=>{let h=z(),g=ba("[data-start]").filter(S=>ku.has(S)&&Fu(S,h)!==(Nu.get(S)??!1));g.length>0&&jt(u,g)},jt=(u,h=ba("[data-start], [data-hidden]"),g,S)=>ge(()=>X_(u,h,g,S)),Q_=u=>ge(()=>{if(!Np)return[];let h=z(),g=Mp();return Array.from(document.images).filter(S=>S.closest(`[data-start]:not([${Dt}])[style*="visibility: hidden"]`)!==null&&(S.closest(Ja)!==null||!S.complete)&&kp(S,u,g,h))}),Go=null,yn=null,Bo=[],Kp=u=>u.hasAttribute("data-start")||!!Z(u).compositionRoot,Uo=u=>L0({elements:u,shouldIncludeElement:Kp,resolveStartSeconds:h=>le(h),resolveDurationSeconds:h=>{let g=Z(h),S=le(h),A=g.inheritedStart!=null&&g.inheritedDuration!=null&&g.inheritedDuration>0?Math.max(0,g.inheritedStart+g.inheritedDuration-S):null,C=Number.isFinite(h.duration)?Gt(h,h.duration):null,P=Ge(h.dataset.duration),q=P!=null&&P>0?P:null;return k0({isVideo:h.tagName==="VIDEO",sourceDuration:C,hostRemaining:A,explicitDuration:q})},resolveHostSlots:me}),Z_=(u=Tr())=>{if(Go&&Go.revision===u)return Go;let h=Uo().mediaClips;return Go={revision:u,clips:h,byStart:[...h].sort((g,S)=>g.start-S.start),byEnd:[...h].sort((g,S)=>g.end-S.end)},yn=null,Bo=[],Go},Iu=(u,h,g,S)=>{let A=0,C=u.length;for(;A<C;){let q=A+C>>1;h(u[q])<g?A=q+1:C=q}let P=[];for(let q=A;q<u.length&&h(u[q])<=S;q+=1)P.push(u[q]);return P},eC=(u,h,g)=>{let S=yn;if(S===null)return u.clips.map(B=>B.el);let A=2*ni(Math.max(Math.abs(S),Math.abs(h))),C=Math.min(S,h)-A,P=Math.max(S,h)+A,q=new Set;for(let B of Bo)q.add(B.el);for(let B of Iu(u.byStart,M=>M.start,C,P+g))q.add(B.el);for(let B of Iu(u.byEnd,M=>M.end,C,P))q.add(B.el);if(e.isPlaying&&!window.__HF_EXPORT_RENDER_SEEK_CONFIG)for(let B of Iu(u.byStart,M=>M.start,h,h+zc*e.playbackRate))B.el.tagName==="VIDEO"&&q.add(B.el);return[...q]},Ca=new WeakSet,Yp=u=>{Ca.add(u)},Xp=u=>{Ca.delete(u),hn()};window.__hf.leasePausedMedia=Yp,window.__hf.releasePausedMedia=Xp;let Jp=u=>e.nativeMediaSyncDisabled?null:e.isPlaying?u:u.filter(h=>!Ca.has(h.el));window.__hf.setLoopStart=u=>{Mr=u!=null&&Number.isFinite(u)&&u>=0?u:null};let tC=u=>{let h=xu.get(u)?.hostId,g=h?document.querySelector(`[data-composition-id="${CSS.escape(h)}"]`):null,S=g?Q(g):null;return g&&S?$(g,0)+S:1/0},Qp=u=>{let h=0;for(let g of u){if(g.data===si)continue;let S=g.getChildren?g:g.timeline,A=Number(g.duration?.())/Number(S?.duration?.()),C=S?.getChildren?Qp(S.getChildren(!1,!0,!0))*(Number.isFinite(A)&&A>0?A:1):Number(g.duration?.())||0,P=Math.abs(Number(g.timeScale?.())||1),q=(Number(g.startTime?.())||0)+C/P;q>=Jr||(h=Math.max(h,Math.min(q,tC(g))))}return h};window.__hf.animationEnd=()=>{let u=e.capturedTimeline,h=u?.getChildren?Qp(u.getChildren(!1,!0,!0)):ke(u)??0,g=Math.max(h,Cr(!0)??0);return g>0&&g<Jr?g:null},window.__hf.audioMeter={start:()=>b.startMetering(),stop:()=>b.stopMetering(),read:()=>b.readLevels()};let nC=()=>{for(let u of document.querySelectorAll("video, audio"))if(_e(u)&&!u.paused&&Kp(u)&&!Ca.has(u))return!0;return!1},Zp=()=>hn();document.addEventListener("play",Zp,!0),s.push(()=>{document.removeEventListener("play",Zp,!0)});let Du=null,ht=u=>{let h=!tt,g=e.isPlaying&&!e.mediaForceSyncNextTick&&yn!==null?Math.min(Math.max(0,e.currentTime-yn),kn*Math.min(1,e.playbackRate)):0,S=ge(()=>{if(!h)return Uo().mediaClips;let q=Z_(u);return Uo(eC(q,e.currentTime,g)).mediaClips});for(let q of S){let B=Io.get(q.el);B&&(q.volumeKeyframes=B)}let A=Jp(S),C=e.mediaForceSyncNextTick;C&&(e.mediaForceSyncNextTick=!1),A&&(N0({clips:A,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted,userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:C,cueAheadSeconds:g,getCompositionDuration:()=>rt(e.capturedTimeline,0,u),onElementVolume:(q,B,M,J,ue)=>b.setElementVolume(q,M,J,ue),isWebAudioOwned:q=>b.ownsElement(q),isWebAudioRouted:q=>b.routesElement(q),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,Ce({source:"hf-preview",type:"media-autoplay-blocked"}))}}),h?(yn=e.currentTime,Bo=S.filter(q=>Mn(e.currentTime,q.start-kn,q.end))):(yn=null,Bo=[]));let P=h&&e.isPlaying&&!C&&Du!==null?Du:void 0;jt(e.currentTime,void 0,u,P),Du=e.currentTime},ot=u=>{u&&hn(),u&&Hu&&!p.isPlaying()&&it();let h=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),g=Date.now();(u||h!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||g-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=h,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=g,Ce({source:"hf-preview",type:"state",frame:h,currentTime:e.currentTime||0,ended:p.reachedEnd(),isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},Ou="",eh=!1,th=!1,nh=0,rh="",rC=()=>{let u="";for(let h of document.querySelectorAll("[data-start]"))u+=`${h.id}:${h.tagName}|`;return u},Hu=!1,Ta=!1,Gu=!1,oC=()=>{Gu||(Gu=!0,w0().then(()=>window.requestAnimationFrame(()=>setTimeout(()=>{Gu=!1,Ta=!1,e.tornDown||it()}))))},it=()=>{N(),O(),k();let u=z();if(u){let{width:S,height:A}=B0(u);S!==null&&A!==null&&Ce({source:"hf-preview",type:"stage-size",width:S,height:A})}if(Jn(),Hu=p.isPlaying(),Hu){delete window.__clipTree;return}if(Ta&&!tt&&_0())return oC();Ta=!1;let h=nd(Lp());window.__clipManifest=h,rh=JSON.stringify(h);let g=rC();if(Ou!==g&&H_(),!window.__clipTree||Ou!==g){let S=window;window.__clipTree=Qg({startResolver:st({timelineRegistry:S.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:S.__timelines??{},rootDuration:h.durationInFrames/e.canonicalFps}),Ou=g}Ce({...h,assetsReady:th}),eh||(eh=!0,Tw(document,({timedOut:S})=>{e.tornDown||(th=!0,Ce({source:"hf-preview",type:"assets-ready",timedOut:S}))})),L_()},iC=()=>{JSON.stringify(nd(Lp()))!==rh&&it()},Bu=u=>typeof u=="number"&&Number.isFinite(u)&&u>0?u:0,aC=u=>{let h=Bu(Number(u));if(h<=0)return;let g=z(),S=Bu(Ge(g?.getAttribute("data-duration"))),A=Math.max(nh,Bu(p.getDuration()),S);h<=A||(nh=h,g?.setAttribute("data-duration",String(h)),p.setDuration(h),it(),ot(!0))},ct=(u,h=0,g)=>{for(let S of e.deterministicAdapters){try{u==="discover"&&S.discover(),u==="pause"&&S.pause({pageAnimations:g}),u==="play"&&S.play&&S.play()}catch(A){V("runtime.init.site8",A)}if(u==="discover")try{S.seek({time:h,suppressEvents:!0})}catch(A){V("runtime.init.site9",A)}}},Zn=()=>{window.__renderReady=!1},sC=Dw(()=>{let u=[];for(let h of e.deterministicAdapters){let g=h.getReadyPromise;if(typeof g=="function")try{let S=g();S&&u.push(S)}catch(S){V("runtime.init.adapterReady",S)}}return u},()=>Zn(),u=>V("runtime.init.adapterReady",u)),lC=Dw(()=>{let u=window.__hf?.buildReady;return u?Object.values(u).filter(h=>h!=null&&typeof h.then=="function"):[]},()=>Zn(),u=>V("runtime.init.buildReady",u));function Uu(){let u=z();u&&UA({root:u,fps:e.canonicalFps,durationSeconds:()=>rt(e.capturedTimeline,0)||Number(u.getAttribute("data-duration"))||0,timeline:()=>e.capturedTimeline,now:()=>Math.max(0,e.currentTime||0),seek:(h,g)=>{Nh(e.capturedTimeline,h,{suppressEvents:g})},ignoreMutations:R_})}let uC=()=>{xa(),F_();let u=Of();return Fl(document),ql(document.body,e.canonicalFps),Uu(),u};if(We)Of();else{let u={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:X,onDiagnostic:({code:h,details:g})=>{Ce({source:"hf-preview",type:"diagnostic",code:h,details:g})}};bE(u).finally(()=>{We=!0,uC(),Zn()})}let oh=u=>{let h=new Set,g=S=>{for(let A of(S??"").matchAll(/url\(\s*(['"]?)(.*?)\1\s*\)|@import\s+(['"])(.*?)\3/gi))h.add(A[2]??A[4]);for(let A of(S??"").matchAll(/image-set\((?:[^()]|\([^()]*\))*\)/gi))for(let C of A[0].matchAll(/(['"])(.*?)\1/g))h.add(C[2])};for(let S of u)if(S.tagName==="STYLE"&&g(S.textContent),!(S.tagName==="STYLE"||S.tagName==="SCRIPT"))for(let A of[S,...S.querySelectorAll("*")]){let C=MH.get(A.localName)??[],P=[LE(A),...[...C,"poster","srcset"].map(q=>A.getAttribute(q))];for(let q of P)q&&h.add(q);g(A.getAttribute("style"))}return h},Wu=0,cC=(u,h,g)=>{let S=new Map;for(let A of g?u.querySelectorAll("video, audio"):[]){let C=ca.get(A);if(!C||i?.isGraded(A))continue;let{srcObject:P,sinkId:q,mediaKeys:B}=A;P||q||B||S.set(C,[...S.get(C)??[],A])}for(let A of h.querySelectorAll("video, audio")){let C=Jm(A),P=S.get(C)?.shift();if(!P||Ow(P)!==Ow(A)){ca.set(A,C);continue}A.replaceWith(P),window.gsap?.set?.(P,{clearProps:"all"});let q=A.getAttribute("style");q===null?P.removeAttribute("style"):P.setAttribute("style",q),TE(P);let B=P;B.volume=Ap(B)??1,B.muted=e.bridgeMuted||e.mediaOutputMuted||B.defaultMuted,B.defaultPlaybackRate=1,B.playbackRate=e.playbackRate,B.preservesPitch=!0}},Ra=u=>[u,...u.querySelectorAll("[data-composition-id]")].flatMap(h=>h.getAttribute("data-composition-id")||[]),ih=u=>{let h=new Set([e.capturedTimeline,window.gsap?.globalTimeline,...Po]);for(let[g,S]of Object.entries(window.__timelines??{}))u.includes(g)||h.add(S);return h},Vu=(u,h)=>{let g=ih(h);return(u.getChildren?u.getChildren(!0,!0,!1):[u]).flatMap(A=>(A.targets?.()??[]).filter(C=>typeof C?.totalTime=="function"&&typeof C.kill=="function"&&!g.has(C)))},dC=(u,h,g,S)=>{let A=Ra(h),C=new Set(A.flatMap(B=>[g[B],...S[B]??[]]));for(let B of C)if(B)for(let M of Vu(B,A))C.add(M);let P=new Set([h,...h.querySelectorAll("*")]);for(let B of window.gsap?.globalTimeline?.getChildren?.(!0,!0,!1)??[]){if(!B.targets?.().some(J=>P.has(J)))continue;let M=B;for(;M&&!C.has(M);)M=M.parent;if(!M)throw new Error(`scene ${u} cannot be swapped: an animation outside it moves its elements`)}let q=B=>typeof B?.nodeType=="number"&&!P.has(B);for(let B of C)for(let M of B?[B,...B.getChildren?.(!0,!0,!1)??[]]:[])if(M.targets?.().some(q))throw new Error(`scene ${u} cannot be swapped: its animations write outside the scene`)},ah=async(u,h)=>{let g=window.gsap?.globalTimeline,S=new Set(g?.getChildren?.(!1,!0,!0));await Tl(h);let A=window.__hfSceneAnimations,C=u.length===1?Ra(u[0])[0]:void 0;if(!A||!C||!g?.getChildren)return;await Vi(),await new Promise(B=>window.setTimeout(B,0));let P=new Set([...Object.values(A).flat(),...ih([C])]),q=g.getChildren(!1,!0,!0).filter(B=>!S.has(B)&&!P.has(B));(A[C]??(A[C]=[])).push(...q)},sh=(u,h=()=>{})=>{let g=()=>window.__timelines??(window.__timelines={}),S=()=>window.__hfSceneAnimations??(window.__hfSceneAnimations={}),A=e.capturedTimeline,C=u.flatMap(J=>Ra(J)),P=new Set,q=J=>{if(!J||P.has(J))return;P.add(J);let ue=J;ue.revert?ue.revert():ue.totalTime?.(0,!0),A?.remove?.(J),ue.revert||ue.kill?.()},B=()=>{let J=P.size,ue=C.flatMap(se=>[...(S()[se]??[]).slice().reverse(),g()[se]]),be=new Set;for(let se of ue)se&&Vu(se,C).forEach(pe=>be.add(pe));for(let se of be)Vu(se,C).forEach(pe=>be.add(pe));for(let se of[...ue.filter(pe=>!be.has(pe)),...be])q(se);return P.size>J},M=0;for(;B();)if(++M>8)throw new Error("the old scene keeps starting animations as they stop");h();for(let J of C)delete g()[J],delete S()[J]},fC=u=>{let h=En(e.currentTime);ct("pause",0,h),ct("play"),y&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&Xu(u.flatMap(la),b.currentGeneration())},lh=(u,h,g,S=!1)=>{for(let B of u)Fl(document,B);xa();let A=()=>{for(let B of h)for(let M of[B,...B.querySelectorAll("[data-composition-id]")]){let J=M.getAttribute("data-composition-id");J&&window.__timelines?.[J]?.totalTime?.(0,!0)}};ql(document.body,e.canonicalFps),Uu(),Hf(g,h,A),vp(),Xn=!1,Jn();let C=vu();for(let B of u)for(let M of B.querySelectorAll("video, audio"))Io.delete(M),Au(M,C);let P=rt(e.capturedTimeline,0);P>0&&p.setDuration(P),ct("discover",e.currentTime),qi(document);let q=p.isPlaying()&&P>0&&e.currentTime>=P;S&&p.isPlaying()&&!q?fC(u):Fa.seek(q?P:e.currentTime,{keepPlaying:!q}),jt(e.currentTime),it()},uh=u=>{let h=P=>Array.from(P.querySelectorAll(`style[${mc}]`)),g=h(document),S=new Set(g.flatMap(P=>pc(P.textContent??""))),A=new Set(h(u).flatMap(P=>pc(P.textContent??"")).filter(P=>!S.has(P)));if(A.size===0)return;let C=document.createElement("style");C.setAttribute(mc,""),C.textContent=[...A].join(`
|
|
1129
|
+
`),g.length>0?g.at(-1).after(C):document.head.prepend(C)},mC=async(u,h)=>{let g=Wu,S=new DOMParser().parseFromString(u,"text/html"),A=ua(document),C=ua(S);if(!A||!C)throw new Error("no scene manifest");if(A.shared!==C.shared)throw new Error("the film changed outside its scenes");let P=Object.keys(C.scenes);if(P.length!==Object.keys(A.scenes).length||P.some(j=>!(j in A.scenes)))throw new Error("scenes were added or removed");let q=P.filter(j=>C.scenes[j]!==A.scenes[j]);if(q.length===0)throw new Error("no scene changed");let B=(j,ee)=>Array.from(j.querySelectorAll(`[${ft}="${CSS.escape(ee)}"]`)),M=j=>{let ee=mi(j);return ee!==null&&mr(ee)},J=j=>j.filter(ee=>ee.tagName==="STYLE"),ue=q.filter(M).map(j=>{let ee=B(S,j),ce=ee.find(Ie=>Ie.tagName!=="STYLE"&&Ie.tagName!=="SCRIPT");if(!ce)throw new Error(`scene ${j} cannot be swapped: it has no single host`);let ae=ce.getAttribute(wn);if(ae!==null)throw new Error(`scene ${j} cannot be swapped: ${ae}`);if(!od(ce))throw new Error(`scene ${j} cannot be swapped: a clip's length is not written`);let ve=J(B(document,j));if(ve.length!==J(ee).length)throw new Error(`scene ${j} cannot be swapped: its styles moved`);return{name:j,parts:ee,host:ce,oldStyles:ve}});ue.length>0&&uh(S);for(let{name:j,parts:ee,host:ce,oldStyles:ae}of ue){let ve=J(ee);ae.forEach((Ie,at)=>Ie.replaceWith(document.importNode(ve[at],!0))),sd(j,ce,ee.filter(Ie=>Ie.tagName==="SCRIPT"))}let be=q.filter(j=>!M(j));if(be.length===0){document.querySelector(`meta[name="${An}"]`)?.setAttribute("content",JSON.stringify(C)),it();return}let se=be.map(j=>{let ee=Pr=>Pr.tagName!=="STYLE"&&Pr.tagName!=="SCRIPT",ce=B(document,j),ae=B(S,j),ve=ce.filter(ee),Ie=ae.filter(ee),at=ve[0],dt=Ie[0];if(!at||!dt||ve.length>1||Ie.length>1)throw new Error(`scene ${j} cannot be swapped: it has no single host`);if(at.hasAttribute("data-hf-original-composition-id"))throw new Error(`scene ${j} cannot be swapped: it is a duplicated instance`);let Yt=at.getAttribute(wn)??dt.getAttribute(wn);if(Yt!==null)throw new Error(`scene ${j} cannot be swapped: ${Yt}`);let FC=oh(ce);if([...oh(ae)].some(Pr=>!FC.has(Pr)))throw new Error(`scene ${j} cannot be swapped: it loads media this scene has not loaded`);if(J(ce).length!==J(ae).length)throw new Error(`scene ${j} cannot be swapped: its styles moved`);return{name:j,oldParts:ce,homes:ce.map(Pr=>Pr.parentNode),newParts:ae,oldHost:at,newHost:dt}}),pe=()=>{let j=z(),ee=new Set;for(let ce of document.querySelectorAll(`[${ft}]`)){if(ce.tagName==="STYLE"||ce.tagName==="SCRIPT")continue;let ae=ce.parentElement;for(;ae;ae=ae===j?null:ae.parentElement)ee.add(ae)}return[...ee].flatMap(ce=>[ce,...Array.from(ce.children).filter(ae=>!ae.hasAttribute("data-hf-ignore")),null])},Ye=pe(),Ke=se.some(({newHost:j})=>j.querySelector(".caption-group"))?await Df():[];if(e.tornDown)throw new Error("the preview was torn down during the swap");if(h?.aborted)throw new Error("the swap was cancelled");if(g!==Wu)throw new Error("the preview changed while this swap waited");let He=()=>{let j=({oldParts:ae,homes:ve})=>ae.some((Ie,at)=>!Ie.isConnected||Ie.parentNode!==ve[at]),ee=pe();if(ee.length!==Ye.length||ee.some((ae,ve)=>ae!==Ye[ve])||se.some(j))throw new Error("a scene changed while this swap waited")};He();let Xe=()=>window.__timelines??(window.__timelines={}),Wa=()=>window.__hfSceneAnimations??(window.__hfSceneAnimations={}),Ve=()=>{for(let{name:j,oldHost:ee}of se)dC(j,ee,Xe(),Wa())};Ve(),Wu+=1;let Kt=[],ye=[];sh(se.map(({oldHost:j})=>j),()=>{He(),Ve()}),b.stopAll(),p.detachAudioSource();for(let{oldParts:j,newParts:ee,oldHost:ce,newHost:ae}of se){let ve=J(ee);J(j).forEach((dt,Yt)=>dt.replaceWith(document.importNode(ve[Yt],!0)));for(let dt of j)dt!==ce&&dt.remove();let Ie=document.importNode(ae,!0),at=dt=>JSON.stringify(dt.flatMap(Yt=>Yt.tagName==="SCRIPT"?Yt.textContent:[]));cC(ce,Ie,at(j)===at(ee)),ce.replaceWith(Ie),ye.push(Ie),Ie.querySelector(".caption-group")&&Kt.push(Ie)}uh(S),rr();let fe=se.flatMap(({newParts:j})=>j.filter(ee=>ee.tagName==="SCRIPT").map(ee=>document.body.appendChild(document.importNode(ee,!0))));if(await ah(ye,fe),e.tornDown)throw new Error("the preview was torn down during the swap");document.querySelector(`meta[name="${An}"]`)?.setAttribute("content",JSON.stringify(C));for(let{name:j,newParts:ee,newHost:ce}of se)sd(j,ce,ee.filter(ae=>ae.tagName==="SCRIPT"));lh(ye,Kt,Ke),Pt=id()},Pt=id(),Ma=new Set(Array.from(document.querySelectorAll(`[${vn}]`),u=>u.getAttribute(ft))),er=null,ka="",$u=()=>new Promise(u=>window.setTimeout(u,0)),ch=(u,h)=>{let g=Rr.get(u);g&&Rr.set(h,g)},dh=async u=>{let h=X0(u);if(!h)return;let{host:g,placeholder:S,scripts:A}=h;ch(S,g),lu(g),rr();let C=g.querySelector(".caption-group")?[g]:[],P=C.length>0?await Df():[];await $u(),await ah([g],A.map(q=>document.body.appendChild(q))),await $u(),Ma.delete(u),e.tornDown||lh([g],C,P,!0)},pC=u=>{let h=Ra(u),g=new Set(h.flatMap(S=>window.__hfSceneAnimations?.[S]??[]));return Object.entries(window.__timelines??{}).find(([S,A])=>g.has(A)&&!h.includes(S))?.[0]},hC=u=>{let h=mi(u);if(!h||mr(h)||h.hasAttribute(wn))return;let g=pC(h);if(g!==void 0){h.setAttribute(wn,`its script registers a timeline as ${g}`);return}sh([h]);let S=ad(u);S&&ch(h,S),Ma.add(u),vp(),b.releaseDecodedExcept(la(document)),Xn=!1,Jn(),it()},La=new Set;Aa=u=>{if(Pt.length===0||e.tornDown)return!1;let h=M=>Ma.has(M),g=Pt.find(({name:M,start:J,end:ue})=>J<=u&&u<=ue&&h(M));if(er)return g&&Qe(er.then(()=>er)),g!==void 0;let S=Is(Pt,u,p.isPlaying());for(let M of La)S.add(M);let A=[...S].join(`
|
|
1130
|
+
`);if(A===ka)return g!==void 0;let C=Pt.filter(({name:M})=>S.has(M)&&h(M)).sort((M,J)=>Math.abs(M.start-u)-Math.abs(J.start-u))[0],P=g??C,q=P?[]:Pt.filter(({name:M})=>!S.has(M)&&!h(M));if(!P&&q.length===0)return ka=A,!1;let B=M=>La.has(M)||Is(Pt,e.currentTime,p.isPlaying()).has(M);return er=(async()=>{if(g)await dh(g.name);else if(P)await $u(),B(P.name)&&await dh(P.name);else for(let{name:M}of q)hC(M)})().finally(()=>{er=null,ka="",Aa(e.currentTime)}),g&&Qe(er),g!==void 0};let gC=async u=>{La=new Set(u.filter(h=>Pt.some(g=>g.name===h))),ka="";for(let h=0;h<=Pt.length&&!e.tornDown;h++){if(Aa(e.currentTime),![...La].some(g=>Ma.has(g)))return;await(er??Promise.resolve())}};ua(document)&&(window.__hfSwapScenes=mC,window.__hfHoldScenes=gC,window.__hfParkedSceneMarkup=ld,U(()=>{delete window.__hfSwapScenes,delete window.__hfHoldScenes,delete window.__hfParkedSceneMarkup}));let Na=nx({postMessage:u=>Ce(u)});Na.installPickerApi(),jt(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let It=yv({lease:Yp,release:Xp});i=It,U(()=>{It.destroy(),i=null}),ql(document.body,e.canonicalFps),Uu();let qu=u=>{let h=Number(u);!Number.isFinite(h)||h<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,h)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate)},bC=1e3,xn=null,fh=()=>{let u=xn;xn=null,u?.apply()},mh=(u,h)=>{b.stopAll(),p.detachAudioSource();let g=p.isPlaying();g&&p.pause(),p.seek(u),e.currentTime=p.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let S=h?.keepPlaying&&g;Ta=!S,S||ht();let A=e.capturedTimeline;dn(A);let C=En(e.currentTime);if(S||J_(e.currentTime),ct("pause",0,C),S){Fa.play();return}It.redraw(),dm(e.currentTime);let P=So(e.currentTime);P&&Qe(P),ot(!0)},Fa={play:()=>{fh();let u=e.capturedTimeline;if(p.isPlaying())return;let h=rt(u,0);if(h>0){if(p.setDuration(h),p.reachedEnd()){let g=p.getPlayStart();p.seek(g),e.currentTime=g,En(g)}}else{let g=z(),S=Number(g?.getAttribute("data-duration")??0);S>0&&p.setDuration(S)}dn(u),p.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,Bh(p.now()),y&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&Yu(),ct("play"),ht(),It.redraw(),ot(!0))},pause:()=>{if(!p.isPlaying())return;b.stopAll(),p.detachAudioSource(),p.pause(),e.isPlaying=!1,e.currentTime=p.now(),e.mediaForceSyncNextTick=!0,Bh(e.currentTime);let u=e.capturedTimeline;dn(u),ct("pause"),ht(),It.redraw(),So(e.currentTime),ot(!0)},seek:(u,h)=>{let g=Xc(Math.max(0,Number(u)||0),e.canonicalFps);xn=null;let S=p.isPlaying()?[]:Q_(g);if(S.length===0){mh(g,h);return}let A={time:g,apply:()=>mh(g,h)};xn=A;for(let M of S){Hw(M);for(let J=M.closest(Ja);J;J=M.closest(Ja))J.setAttribute(or,"")}let C=0,P=new Promise(M=>{C=window.setTimeout(()=>{xn===A&&V("runtime.init.seekHoldCap",S),M()},bC)}),q=Promise.all(S.map(M=>M.decode?M.decode().catch(()=>{}):void 0)),B=Promise.race([q,P]).then(()=>{window.clearTimeout(C),xn===A&&fh()});return Qe(B),B},renderSeek:(u,h)=>{xn=null,tt=!0;let g=sl(Math.max(0,Number(u)||0),e.canonicalFps,h);b.stopAll(),p.detachAudioSource(),p.isPlaying()&&p.pause(),p.seek(g),e.currentTime=p.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let S=En(e.currentTime,{suppressEvents:h?.suppressEvents});ct("pause",0,S),ht(),It.redraw(),dm(e.currentTime,{engineMode:!0});let A=So(e.currentTime,{engineMode:!0});A&&Qe(A),ot(!0)},getTime:()=>xn?.time??p.now(),getDuration:()=>{let u=p.getDuration();return Number.isFinite(u)?u:0},isPlaying:()=>p.isPlaying(),setPlaybackRate:u=>{qu(u),p.setRate(e.playbackRate),Wh()},getPlaybackRate:()=>e.playbackRate},ph=rt(e.capturedTimeline,0);ph>0&&p.setDuration(ph);let tr=ox({getTimeline:()=>e.capturedTimeline,setTimeline:u=>{e.capturedTimeline=u},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:u=>{e.isPlaying!==u&&(e.mediaForceSyncNextTick=!0),e.isPlaying=u},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:qu,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(u,h)=>{e.currentTime=Math.max(0,Number(u)||0),e.isPlaying!==h&&(e.mediaForceSyncNextTick=!0),e.isPlaying=h,ht()},onStatePost:ot,onDeterministicSeek:(u,h)=>{for(let g of e.deterministicAdapters)if(!(g.name==="gsap"&&e.capturedTimeline))try{g.seek({time:Number(u)||0,suppressEvents:h?.suppressEvents})}catch(S){V("runtime.init.site11",S)}},onDeterministicPause:()=>ct("pause"),onDeterministicPlay:()=>ct("play"),onRenderFrameSeek:()=>{It.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>rt(e.capturedTimeline,0),transport:Fa});window.__player=R(tr),window.__playerReady=!0,St("composition_loaded",{duration:tr.getDuration(),compositionId:xt()?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[jb({start:u=>$(u,0),duration:u=>Q(u),compositionDuration:()=>rt(e.capturedTimeline,0),canonicalFps:()=>e.canonicalFps,exportRenderSeek:()=>!!window.__HF_EXPORT_RENDER_SEEK_CONFIG}),Jb(),Ab({resolveStartSeconds:u=>$(u,0)}),Fb(),Ob({resolveStartSeconds:u=>$(u,0)}),Hb(),Gb(),Bb(),Ub(),Wb(),Vb(),$b(),Nb({getTimeline:()=>e.capturedTimeline})],Yb(),Xb(),window.__hfReseekGpu=u=>{let h=Math.max(0,Number(u)||0);window.__hfThreeTime=h,window.__hfTypegpuTime=h,_s(h)};let hh=u=>($A(),C0(u));window.__hfWaitForSeekCompletion=hh,s.push(()=>{window.__hfWaitForSeekCompletion===hh&&delete window.__hfWaitForSeekCompletion}),N_(),xa(),ct("discover");let yC=()=>{Jn();let u=rt(e.capturedTimeline,0);if(u>0&&p.setDuration(u),ct("discover",e.currentTime),!e.capturedTimeline){let h=window.__timelines??{},g=Object.keys(h).filter(S=>h[S]);if(g.length>0){let A=z()?.getAttribute("data-composition-id")??null;G("root_timeline_unbound_registry_present",{reason:A?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:A,registeredTimelineKeys:g},"root_timeline_unbound_registry_present"),globalThis.console.warn("[hyperframes] Root timeline not bound, so render will freeze at t=0. "+(A?`Root data-composition-id is "${A}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${g.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${A??"<root-id>"}"] = tl).`)}}jt(e.currentTime,Array.from(document.querySelectorAll("[data-start]:not(video, audio, img)"))),window.__renderReady=!0;try{it()}catch(h){throw window.__renderReady=!1,qo(h),h}ot(!0)},Lr=null,xC=()=>{if(Lr)return;let u=()=>{window.removeEventListener("hf-timelines-built",u),Lr=null,Zn()};Lr=u,window.addEventListener("hf-timelines-built",u)};U(()=>{Lr&&(window.removeEventListener("hf-timelines-built",Lr),Lr=null)}),Zn=()=>{if(!e.tornDown){if(!We){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,xC();return}if(ct("discover",e.currentTime),!sC()){window.__renderReady=!1;return}if(!lC()){window.__renderReady=!1;return}yC()}},Zn(),We&&setTimeout(()=>{Zn()},0);let zu=0,Pa=!1,Ia=Number.NaN,Nr={revision:Number.NaN,time:Number.NEGATIVE_INFINITY},Da=null,Oa=!1,Sn=null,gh=!1,Ha=!1,bh="",yh=-1,Wo=!1,xh=Number.NEGATIVE_INFINITY,Sh=Number.NEGATIVE_INFINITY,Eh="",vh=!1,Ah=u=>tt?void 0:{owner:u,version:`${bt}:${u.getChildren?.(!1,!0,!0).length??0}`},wh=new Set,SC=(u,h,g,S)=>{try{let A=S?.suppressEvents===!0;dn(h),yi(h,g,A,Ah(h))}catch(A){let C=A instanceof Error?`${A.name}: ${A.message}`:String(A),P=`${u}
|
|
1131
|
+
${C}`;if(wh.has(P))return;wh.add(P),globalThis.console.warn(`${Yh} "${u}" ${C}`)}},_h=new Map,EC=u=>{let h=_h.get(u);if(!tt&&h){if(h instanceof WeakRef){let S=h.deref();if(S?.isConnected&&S.getAttribute("data-composition-id")===u)return S}else if(h.missingAt===bt)return null}let g=document.querySelector(`[data-composition-id="${CSS.escape(u)}"]`);return _h.set(u,g?new WeakRef(g):{missingAt:bt}),g},Ga=new WeakMap,Ch=-1,vC=(u,h)=>{if(Ga.has(h))return Ga.get(h);let g=EC(u),S=g?$(g,0):Number.NaN,A=g&&Number.isFinite(S)?{start:S,hiddenFrom:g.hasAttribute("data-start")&&!n(g)?S+(Q(g)??1/0):1/0,playbackStart:nn(g),rate:Ht(g),timelineDuration:ke(h)}:null;return Ga.set(h,A),A},Th=new WeakMap,AC=(u,h)=>{if(Th.get(u)!==h)return!1;try{return u.paused()===!0&&Number(u.totalTime?.())===h}catch{return!1}},wC=(u,h,g)=>{(Ch!==h||tt)&&(Ga=new WeakMap,Ch=h);let S=window.__timelines??{},A=z()?.getAttribute("data-composition-id")??null;for(let[C,P]of Object.entries(S)){if(!P||typeof P!="object"||C===A)continue;let q=vC(C,P);if(!q)continue;let B=q.playbackStart+Hr(q.rate,Math.max(0,Math.min(u,q.hiddenFrom)-q.start)),M=Math.max(0,q.timelineDuration!=null&&q.timelineDuration>0?Math.min(q.timelineDuration,B):B);!tt&&AC(P,M)||(SC(C,P,M,g),Th.set(P,M))}},Rh=u=>typeof u=="object"&&u!==null,_C=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],Mh=(u,h)=>{let g=u[h];if(typeof g!="function")return null;try{let S=Number(g.call(u));return Number.isFinite(S)?S:null}catch(S){return V("runtime.init.gsapCallbackDuration",S),null}},kh=new WeakMap,CC=(u,h)=>{if(!h)return Lh(u);let g=kh.get(h.owner);if(g?.version===h.version)return g.value;let S=Lh(u);return kh.set(h.owner,{version:h.version,value:S}),S},Lh=u=>{if(!("getChildren"in u)||typeof u.getChildren!="function")return!1;let h;try{h=u.getChildren(!0,!0,!0)}catch(g){return V("runtime.init.gsapCallbackChildren",g),!1}if(!Array.isArray(h))return!1;for(let g of h){if(!Rh(g))continue;let S=g.vars;if(!Rh(S)||!_C.some(q=>typeof S[q]=="function"))continue;let P=Mh(g,"totalDuration")??Mh(g,"duration");if(P!=null&&P<=1e-6)return!0}return!1};function En(u,h){let g=e.capturedTimeline,S=Nh(g,u,h);return Ia=u,Da=g,S}function Nh(u,h,g){let S=g?.suppressEvents===!0,A=g?.revision??Tr();A!==Nr.revision&&(Nr={revision:A,time:Number.NEGATIVE_INFINITY}),W_(h);let C=h>Nr.time,P=C&&u?tb(u,Nr.time,h):null,q=C&&P?.size!==0?cg(P?M=>P.has(M):void 0):null;if(wC(h,A,g),u){let M=h;if(typeof u.totalDuration=="function")try{let J=Number(u.totalDuration());Number.isFinite(J)&&J>0&&h>J&&(M=J)}catch(J){V("runtime.init.transport.clampDuration",J)}try{if(typeof u.totalTime=="function"){let J=Ah(u);!yi(u,M,S,J)&&!S&&!CC(u,J)&&qs({totalTime:u.totalTime.bind(u),totalDuration:u.totalDuration?.bind(u),getChildren:u.getChildren?.bind(u)},M,J)}else u.seek(M,S)}catch(J){V("runtime.init.transport.seek",J)}}q?.(),Nr.time=Math.max(Nr.time,h);let B=NH();for(let M of e.deterministicAdapters)if(!(M.name==="gsap"&&u))try{M.seek({time:h,suppressEvents:S,pageAnimations:B})}catch(J){V("runtime.init.transport.adapter",J)}return B}let ju=gw(document,()=>{hn()});s.push(()=>ju.disconnect());let Fh=()=>{try{return ju.isActive()}catch{return!1}},TC=()=>!p.isPlaying()&&!ga()&&ju.observing&&(!Oa||Fh())&&!Wo&&e.currentTime===Ia&&e.capturedTimeline===Da,Ku=()=>`${Tr()}|${Cr()??""}`,Ph=()=>{Sn=window.setTimeout(RC,gh&&e.capturedTimeline&&Xn?kH:e.bridgeMaxPostIntervalMs)},RC=()=>{if(Sn=null,!e.tornDown&&!(typeof window>"u"||typeof document>"u")){if(Ku()!==bh){hn();return}ot(!1),Ph()}},Fr=null,Ih=()=>e.transportRafId!=null||Fr!=null,Ba=()=>{if(document.visibilityState==="hidden"){Fr=window.setTimeout(()=>{Fr=null,Gh()},LH);return}e.transportRafId=window.requestAnimationFrame(Gh)},Dh=()=>{e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),Fr!=null&&(window.clearTimeout(Fr),Fr=null)},Oh=()=>{e.tornDown||!Ih()||(Dh(),Ba())};document.addEventListener("visibilitychange",Oh);let MC=()=>{if(e.transportRafId=null,e.tornDown)return;let u=Ha;if(Ha=!1,u||!TC()){Ba();return}bh=Ku(),Ph()};hn=()=>{e.tornDown||(Ha=!0,!(Pa||Ih())&&(Sn!=null&&(window.clearTimeout(Sn),Sn=null),Ha=!1,Ba()))};let kC=u=>{let h=ba("audio[data-start]"),g=null;for(let S of u?[u,...h]:h){if(!_e(S)||!S.isConnected||x(S)||$c(S)||S.ended&&!S.loop||!S.hasAttribute("src")&&!S.querySelector("source[src]"))continue;let A=le(S),C=he(S,A);if(!Number.isFinite(A)||!Mn(e.currentTime,C.start,C.end))continue;if(S===u)return{el:S,start:A};let P=A+(Gr(S)??1/0);(!g||P>g.runsUntil)&&(g={el:S,start:A,runsUntil:P})}return g};function Hh(){if(p.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&b.ownsClock()&&b.context){let u=b.getTime();u>=0&&p.attachAudioSource({currentTimeSeconds:u})}else{let u=kC(p.audioElement());u&&!u.el.paused?p.attachAudioSource({el:u.el,compositionStart:u.start,mediaStart:nn(u.el),rate:Ht(u.el)}):u&&u.el.readyState<HTMLMediaElement.HAVE_FUTURE_DATA?p.attachAudioSource({currentTimeSeconds:e.currentTime}):p.hasAudioSource()&&p.detachAudioSource()}else p.hasAudioSource()&&p.detachAudioSource()}let Gh=()=>{if(!(e.tornDown||Pa)){Pa=!0;try{zu+=1;let u=Tr();u!==yh&&(yh=u,Wo=!0);let h=Date.now(),g=p.isPlaying(),S=g&&h-Sh>=Wm,A=vh&&!g;if(vh=g,S){Sh=h;let ue=Ku();ue!==Eh&&(Eh=ue,Wo=!0)}let C=Wo&&h-xh>=bw;C&&(xh=h);let P=ue=>!g&&zu%ue===0;if(yw({tick:zu,isPlaying:g,hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:p.now(),compositionChanged:C,playingPollDue:S})){let ue=e.capturedTimeline;if(Jn()){e.capturedTimeline&&e.capturedTimeline!==ue&&dn(e.capturedTimeline);let be=rt(e.capturedTimeline,0,u);be>0&&p.setDuration(be),it()}}if(C||P(20)?(it(),Wo=!1):A&&iC(),(C||P(30))&&xa(),e.capturedTimeline){let ue=rt(e.capturedTimeline,0,u);ue>0&&(!p.isPlaying()||ue>=p.getDuration())&&p.setDuration(ue)}Hh();let q=p.now();e.currentTime=q,window.__HF_EXPORT_RENDER_SEEK_CONFIG||ub({nowMs:performance.now(),filmTime:q,fps:e.canonicalFps,rate:e.playbackRate,playing:g,hidden:document.visibilityState==="hidden",waiting:Bo.some(({el:ue})=>ue.tagName==="VIDEO"&&!ue.paused&&ue.readyState<3),layoutKey:`${window.innerWidth}x${window.innerHeight}@${window.devicePixelRatio}`});let B=p.isPlaying(),M=!B&&Fh(),J=B&&VA();if(M?Oa=!0:!J&&(B||Oa||q!==Ia||e.capturedTimeline!==Da)&&(En(q,{revision:u}),So(q,{playing:B}),B||(Oa=!1)),B&&It.redrawAnimated(),p.isPlaying()&&p.reachedEnd()){b.stopAll(),p.detachAudioSource(),p.pause(),e.isPlaying=!1;let ue=p.getStopTime();Number.isFinite(ue)&&(p.seek(ue),e.currentTime=ue,En(ue)),ct("pause"),ht(u),So(e.currentTime),ot(!0);return}p.isPlaying()?(NC(),ht(u)):nC()&&(yn=null,ht(u)),ot(!1)}finally{Pa=!1,MC()}}},Bh=u=>{let h=ge(()=>Uo().mediaClips);for(let g of Jp(h)??[]){if(!g.el.isConnected||!Mn(u,g.start,g.end))continue;let S=Ms(g,u);if(!(Math.abs(g.el.currentTime-S)<=.001))try{g.el.currentTime=S}catch{}}},Yu=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let u=b.startGeneration(),h=la(document);b.releaseDecodedExcept(h),Xu(h,u)},LC=10,Ua={gen:-1,clips:[]},Uh=()=>p.now()+LC*Math.max(1,e.playbackRate),NC=()=>{let u=Ua;if(u.gen!==b.currentGeneration()||u.clips.length===0||e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let h=Uh(),g=u.clips.filter(S=>S.start<=h);g.length!==0&&(u.clips=u.clips.filter(S=>S.start>h),Xu(g.flatMap(({el:S})=>S.isConnected?[S]:[]),u.gen))},Xu=(u,h)=>{Ua.gen!==h&&(Ua={gen:h,clips:[]});let g=p.now(),S=Uh();for(let A of u){if(x(A))continue;let C=le(A);if(!Number.isFinite(C))continue;let P=nn(A),q=Number.parseFloat(A.dataset.volume??""),B=Number.isFinite(q)?q:1,M=Ge(A.dataset.duration),J=M!=null&&M>0?M:Number.POSITIVE_INFINITY,{inheritedStart:ue,inheritedDuration:be}=Z(A);ue!=null&&be!=null&&be>0&&(J=Math.min(J,Math.max(0,ue+be-C)));let se=me(A),pe=fr({start:C,end:C+J},se);if(se.length>0){if(pe.end<=pe.start)continue;J=pe.end-C}if(pe.end<=g)continue;if(pe.start>S){Ua.clips.push({el:A,start:pe.start});continue}let Ye=_o(A);Co(A,Ye),(Ye.kind==="web-audio"?b.scheduleMediaElementPlayback(A,C,P,p.now(),B,h,e.playbackRate,J):Promise.resolve(null)).then(He=>{let Xe=h!==b.currentGeneration();if(He||!Xa(A)||!p.isPlaying()||Xe||typeof Ht(A)!="number")return;let Wa=e.playbackRate*mt(A),Ve=A.hasAttribute("data-fx-chain")||A.hasAttribute("data-automation");if(Math.abs(Wa-1)>1e-9){Ye.kind==="web-audio"&&Ve&&(A.muted=!0);return}b.decodeAudioElement(A).then(Kt=>{!Kt||!p.isPlaying()||b.schedulePlayback(A,Kt,C,P,()=>p.now(),B,h,e.playbackRate,J,pe.start)})})}};function Wh(){b.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&y&&p.isPlaying()&&b.hasBoundedActiveSources()&&(b.stopAll(),Yu())}if(e.capturedTimeline){let u=rt(e.capturedTimeline,0);u>0&&p.setDuration(u),dn(e.capturedTimeline)}RE(window),Ba(),it(),ot(!0),e.controlBridgeHandler=ob({onPlay:()=>{tr.play(),St("composition_played",{time:tr.getTime()})},onPause:()=>{tr.pause(),St("composition_paused",{time:tr.getTime()})},onStopMedia:()=>{b.stopAll();let u=document.querySelectorAll("video, audio");for(let h of u)_e(h)&&!h.paused&&h.pause()},onSeek:(u,h)=>{tr.seek(u),St("composition_seeked",{time:u})},onSetMuted:u=>{e.bridgeMuted=u;let h=u||e.mediaOutputMuted;b.setMuted(h);let g=document.querySelectorAll("video, audio");for(let S of g)_e(S)&&(S.muted=h||S.defaultMuted)},onSetVolume:u=>{e.bridgeVolume=u,b.setVolume(u);let h=document.querySelectorAll("video, audio");for(let g of h){if(!_e(g))continue;let S=parseFloat(g.dataset.volume??""),A=Number.isFinite(S)?S:1;g.volume=is(A*u)}},onSetMediaOutputMuted:u=>{e.mediaOutputMuted=u;let h=u||e.bridgeMuted;b.setMuted(h);let g=document.querySelectorAll("video, audio");for(let S of g)_e(S)&&(S.muted=h||S.defaultMuted)},onSetNativeMediaSyncDisabled:u=>{e.nativeMediaSyncDisabled!==u&&(e.nativeMediaSyncDisabled=u,e.mediaForceSyncNextTick=!0,u?(b.stopAll(),p.detachAudioSource()):ht())},onSetWebAudioMediaDisabled:u=>{e.webAudioMediaDisabled!==u&&(e.webAudioMediaDisabled=u,e.mediaForceSyncNextTick=!0,u&&(b.stopAll(),p.detachAudioSource()),ht())},onSetPlaybackRate:u=>{qu(u),e.transportClock&&e.transportClock.setRate(e.playbackRate),Wh()},onSetDisplayScale:u=>{ly(u),Ag(u),lb(u)},onRequestPreviewFacts:()=>Ce({source:"hf-preview",type:"preview-facts",facts:{sceneCount:Pt.length,mountedElementCount:document.body.querySelectorAll("*").length,durationSeconds:p.getDuration(),videos:by(),lighterAt:gy(),copiesReady:mb()}}),onSetPreviewQuality:hy,onRetryPreviewCopies:yy,onSetIdleHeartbeat:u=>{gh=u,hn()},onSetRootDuration:aC,onSetPlayRange:(u,h)=>{p.setPlayRange(u,h,e.canonicalFps);let g=p.getPlayStart();if(p.isPlaying()&&(p.now()<g||p.reachedEnd())){Fa.seek(g,{keepPlaying:!0});return}ot(!0)},onSetColorGrading:(u,h)=>{It.setGrading(u,h)},onSetColorGradingCompare:(u,h)=>{It.setCompare(u,h)},onTick:()=>{if(e.tornDown||!p.isPlaying())return;Hh();let u=p.now();if(e.currentTime=u,(u!==Ia||e.capturedTimeline!==Da)&&En(u),p.reachedEnd()){b.stopAll(),p.detachAudioSource(),p.pause(),e.isPlaying=!1;let h=p.getStopTime();Number.isFinite(h)&&(p.seek(h),e.currentTime=h,En(h)),ct("pause"),ht(),ot(!0)}},onEnablePickMode:()=>Na.enablePickMode(),onDisablePickMode:()=>Na.disablePickMode(),onSetRuntimeData:au,onClearRuntimeData:su,getCanonicalFps:()=>e.canonicalFps});let Ju=()=>{if(!e.tornDown){e.tornDown=!0,Dh(),document.removeEventListener("visibilitychange",Oh),Sn!=null&&(window.clearTimeout(Sn),Sn=null),e.transportClock=null,b.destroy(),Qn!=null&&(window.clearTimeout(Qn),Qn=null),d!=null&&(window.cancelAnimationFrame(d),d=null),I_(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),a&&(window.removeEventListener("error",a),a=null),l&&(window.removeEventListener("unhandledrejection",l),l=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),Na.disablePickMode();for(let u of e.deterministicAdapters)if(!(!u||typeof u.revert!="function"))try{u.revert()}catch(h){V("runtime.init.site12",h)}e.deterministicAdapters=[],window.__hf?.buildReady&&(window.__hf.buildReady={});for(let u of s.splice(0))try{u()}catch(h){V("runtime.init.site13",h)}for(let u of e.injectedCompStyles)try{u.remove()}catch(h){V("runtime.init.site14",h)}e.injectedCompStyles=[];for(let u of e.injectedCompLinks)try{u.remove()}catch(h){V("runtime.init.site15",h)}e.injectedCompLinks=[];for(let u of e.injectedCompScripts)try{u.remove()}catch(h){V("runtime.init.site16",h)}e.injectedCompScripts=[],e.capturedTimeline=null,r=()=>{},window.__hfRuntimeTeardown===Ju&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=Ju,e.beforeUnloadHandler=Ju,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var $w=["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"],Qm=[[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 FH(e){if(e<=255)return $w[e];let t=0,n=Qm.length-1;for(;t<=n;){let r=t+n>>1,o=Qm[r];if(e<o[0]){n=r-1;continue}if(e>o[1]){t=r+1;continue}return o[2]}return"L"}function PH(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let c=0;c<t;){let d=e.charCodeAt(c),f=d,m=1;if(d>=55296&&d<=56319&&c+1<t){let b=e.charCodeAt(c+1);b>=56320&&b<=57343&&(f=(d-55296<<10)+(b-56320)+65536,m=2)}let p=FH(f);(p==="R"||p==="AL"||p==="AN")&&(r=!0);for(let b=0;b<m;b++)n[c+b]=p;c+=m}if(!r)return null;let o=0;for(let c=0;c<t;c++){let d=n[c];if(d==="L"){o=0;break}if(d==="R"||d==="AL"){o=1;break}}let i=new Int8Array(t);for(let c=0;c<t;c++)i[c]=o;let a=o&1?"R":"L",l=a,s=l;for(let c=0;c<t;c++)n[c]==="NSM"?n[c]=s:s=n[c];s=l;for(let c=0;c<t;c++){let d=n[c];d==="EN"?n[c]=s==="AL"?"AN":"EN":(d==="R"||d==="L"||d==="AL")&&(s=d)}for(let c=0;c<t;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<t-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<t;c++){if(n[c]!=="EN")continue;let d;for(d=c-1;d>=0&&n[d]==="ET";d--)n[d]="EN";for(d=c+1;d<t&&n[d]==="ET";d++)n[d]="EN"}for(let c=0;c<t;c++){let d=n[c];(d==="WS"||d==="ES"||d==="ET"||d==="CS")&&(n[c]="ON")}s=l;for(let c=0;c<t;c++){let d=n[c];d==="EN"?n[c]=s==="L"?"L":"EN":(d==="R"||d==="L")&&(s=d)}for(let c=0;c<t;c++){if(n[c]!=="ON")continue;let d=c+1;for(;d<t&&n[d]==="ON";)d++;let f=c>0?n[c-1]:l,m=d<t?n[d]:l,p=f!=="L"?"R":"L";if(p===(m!=="L"?"R":"L"))for(let y=c;y<d;y++)n[y]=p;c=d-1}for(let c=0;c<t;c++)n[c]==="ON"&&(n[c]=a);for(let c=0;c<t;c++){let d=n[c];(i[c]&1)===0?d==="R"?i[c]++:(d==="AN"||d==="EN")&&(i[c]+=2):(d==="L"||d==="AN"||d==="EN")&&i[c]++}return i}function qw(e,t){let n=PH(e);if(n===null)return null;let r=new Int8Array(t.length);for(let o=0;o<t.length;o++)r[o]=n[t[o]];return r}var IH=/[ \t\n\r\f]+/g,DH=/[\t\n\r\f]| {2,}|^ | $/;function OH(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function HH(e){if(!DH.test(e))return e;let t=e.replace(IH," ");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 GH(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
|
|
1132
1132
|
`).replace(/[\r\f]/g,`
|
|
1133
1133
|
`):e.replace(/\r\n/g,`
|
|
1134
1134
|
`)}var Zm=null,BH;function UH(){return Zm===null&&(Zm=new Intl.Segmenter(BH,{granularity:"word"})),Zm}var WH=/\p{Script=Arabic}/u,cu=/\p{M}/u,Zw=/\p{Nd}/u;function zw(e){return WH.test(e)}function jw(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 Ft(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 o=(n-55296<<10)+(r-56320)+65536;if(jw(o))return!0;t++;continue}}if(jw(n))return!0}}return!1}function VH(e){let t=mu(e);return t!==null&&(fu.has(t)||zn.has(t))}var $H=new Set(["\xA0","\u202F","\u2060","\uFEFF"]);function qH(e){return Ft(e)}function zH(e){let t=mu(e);return t!==null&&$H.has(t)}function du(e){return!VH(e)&&!zH(e)}var fu=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"]),fa=new Set(['"',"(","[","{","\u201C","\u2018","\xAB","\u2039","\uFF08","\u3014","\u3008","\u300A","\u300C","\u300E","\u3010","\u3016","\u3018","\u301A"]),tp=new Set(["'","\u2019"]),zn=new Set([".",",","!","?",":",";","\u060C","\u061B","\u061F","\u0964","\u0965","\u104A","\u104B","\u104C","\u104D","\u104F",")","]","}","%",'"',"\u201D","\u2019","\xBB","\u203A","\u2026"]),jH=new Set([":",".","\u060C","\u061B"]),KH=new Set(["\u104F"]),YH=new Set(["\u201D","\u2019","\xBB","\u203A","\u300D","\u300F","\u3011","\u300B","\u3009","\u3015","\uFF09"]);function XH(e){if(np(e))return!0;let t=!1;for(let n of e){if(zn.has(n)){t=!0;continue}if(!(t&&cu.test(n)))return!1}return t}function JH(e){for(let t of e)if(!fu.has(t)&&!zn.has(t))return!1;return e.length>0}function QH(e){if(np(e))return!0;for(let t of e)if(!fa.has(t)&&!tp.has(t)&&!cu.test(t))return!1;return e.length>0}function np(e){let t=!1;for(let n of e)if(!(n==="\\"||cu.test(n))){if(fa.has(n)||zn.has(n)||tp.has(n)){t=!0;continue}return!1}return t}function e_(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 o=n-1;if(o<0)return n;let i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function mu(e){if(e.length===0)return null;let t=e_(e,e.length);return e.slice(t)}function ZH(e){let t=Array.from(e),n=t.length;for(;n>0;){let r=t[n-1];if(cu.test(r)){n--;continue}if(fa.has(r)||tp.has(r)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function e2(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="\u2014"?e:null}function Kw(e,t,n,r){let o=t[r],i=e[r];if(o==null)return i;let a=n[r];if(i.length===a)return i;let l=o.repeat(a);return e[r]=l,l}function Yw(e,t){return e&&t!==null&&jH.has(t)}function t2(e){let t=mu(e);return t!==null&&KH.has(t)}function n2(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 pu(e){let t=e.length;for(;t>0;){let n=e_(e,t),r=e.slice(n,t);if(YH.has(r))return!0;if(!zn.has(r))return!1;t=n}return!1}function r2(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|