hyperframes 0.8.25 → 0.8.27
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.
- package/dist/cli.js +212 -59
- package/dist/fontLocalizeCli.js +29 -5
- package/dist/hyperframe-runtime.js +1 -1
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +1 -1
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/studio/assets/{hyperframes-player-CTP_00ix.js → hyperframes-player-DBxVmzQ-.js} +1 -1
- package/dist/studio/assets/{index-DSk_ALFr.js → index-B177PW6o.js} +144 -144
- package/dist/studio/assets/{index-Bjb4YqS_.js → index-BSANnCNW.js} +1 -1
- package/dist/studio/assets/{index-Di-8Jxqc.js → index-DmsMkmOI.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/studio/index.js +27 -11
- package/dist/studio/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -50,7 +50,7 @@ var VERSION;
|
|
|
50
50
|
var init_version = __esm({
|
|
51
51
|
"src/version.ts"() {
|
|
52
52
|
"use strict";
|
|
53
|
-
VERSION = true ? "0.8.
|
|
53
|
+
VERSION = true ? "0.8.27" : "0.0.0-dev";
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
|
|
@@ -58784,7 +58784,7 @@ var RUNTIME_IIFE;
|
|
|
58784
58784
|
var init_runtime_inline = __esm({
|
|
58785
58785
|
"../core/dist/generated/runtime-inline.js"() {
|
|
58786
58786
|
"use strict";
|
|
58787
|
-
RUNTIME_IIFE = '"use strict";(()=>{var qm=Object.create;var Xi=Object.defineProperty;var $m=Object.getOwnPropertyDescriptor;var jm=Object.getOwnPropertyNames;var Km=Object.getPrototypeOf,Ym=Object.prototype.hasOwnProperty;var Xm=(e,t,n)=>t in e?Xi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ae=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Jm=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of jm(t))!Ym.call(e,i)&&i!==n&&Xi(e,i,{get:()=>t[i],enumerable:!(r=$m(t,i))||r.enumerable});return e};var Qm=(e,t,n)=>(n=e!=null?qm(Km(e)):{},Jm(t||!e||!e.__esModule?Xi(n,"default",{value:e,enumerable:!0}):n,e));var ge=(e,t,n)=>Xm(e,typeof t!="symbol"?t+"":t,n);var Lu=ae((aA,Ko)=>{var Z=String,Nu=function(){return{isColorSupported:!1,reset:Z,bold:Z,dim:Z,italic:Z,underline:Z,inverse:Z,hidden:Z,strikethrough:Z,black:Z,red:Z,green:Z,yellow:Z,blue:Z,magenta:Z,cyan:Z,white:Z,gray:Z,bgBlack:Z,bgRed:Z,bgGreen:Z,bgYellow:Z,bgBlue:Z,bgMagenta:Z,bgCyan:Z,bgWhite:Z,blackBright:Z,redBright:Z,greenBright:Z,yellowBright:Z,blueBright:Z,magentaBright:Z,cyanBright:Z,whiteBright:Z,bgBlackBright:Z,bgRedBright:Z,bgGreenBright:Z,bgYellowBright:Z,bgBlueBright:Z,bgMagentaBright:Z,bgCyanBright:Z,bgWhiteBright:Z}};Ko.exports=Nu();Ko.exports.createColors=Nu});var Yo=ae(()=>{});var Xr=ae((uA,Pu)=>{"use strict";var Du=Lu(),Iu=Yo(),Hn=class e extends Error{constructor(t,n,r,i,o,a){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),a&&(this.plugin=a),typeof n<"u"&&typeof r<"u"&&(typeof n=="number"?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let n=this.source;t==null&&(t=Du.isColorSupported);let r=c=>c,i=c=>c,o=c=>c;if(t){let{bold:c,gray:f,red:m}=Du.createColors(!0);i=p=>c(m(p)),r=p=>f(p),Iu&&(o=p=>Iu(p))}let a=n.split(/\\r?\\n/),l=Math.max(this.line-3,0),s=Math.min(this.line+2,a.length),u=String(s).length;return a.slice(l,s).map((c,f)=>{let m=l+1+f,p=" "+(" "+m).slice(-u)+" | ";if(m===this.line){if(c.length>160){let v=20,x=Math.max(0,this.column-v),_=Math.max(this.column+v,this.endColumn+v),R=c.slice(x,_),T=r(p.replace(/\\d/g," "))+c.slice(0,Math.min(this.column-1,v-1)).replace(/[^\\t]/g," ");return i(">")+r(p)+o(R)+`\n `+T+i("^")}let b=r(p.replace(/\\d/g," "))+c.slice(0,this.column-1).replace(/[^\\t]/g," ");return i(">")+r(p)+o(c)+`\n `+b+i("^")}return" "+r(p)+o(c)}).join(`\n`)}toString(){let t=this.showSourceCode();return t&&(t=`\n\n`+t+`\n`),this.name+": "+this.message+t}};Pu.exports=Hn;Hn.default=Hn});var Xo=ae((cA,Hu)=>{"use strict";var g0=/(<)(\\/?style\\b)/gi,b0=/(<)(!--)/g;function ht(e){return typeof e!="string"||!e.includes("<")?e:e.replace(g0,"\\\\3c $2").replace(b0,"\\\\3c $2")}var Ou={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function x0(e){return e[0].toUpperCase()+e.slice(1)}var Gn=class{constructor(t){this.builder=t}atrule(t,n){let r=t.raws,i="@"+t.name,o=t.params?this.rawValue(t,"params"):"";if(typeof r.afterName<"u"?i+=r.afterName:o&&(i+=" "),t.nodes)this.block(t,i+o);else{let a=(r.between||"")+(n?";":"");this.builder(ht(i+o+a),t)}}beforeAfter(t,n){let r;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):n==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(`\n`)){let a=this.raw(t,null,"indent");if(a.length)for(let l=0;l<o;l++)r+=a}return r}block(t,n){let r=this.raw(t,"between","beforeOpen");this.builder(ht(n+r)+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(ht(i)),this.builder("}",t,"end")}body(t){let n=t.nodes,r=n.length-1;for(;r>0&&n[r].type==="comment";)r-=1;let i=this.raw(t,"semicolon"),o=t.type==="document";for(let a=0;a<n.length;a++){let l=n[a],s=this.raw(l,"before");s&&this.builder(o?s:ht(s)),this.stringify(l,r!==a||i)}}comment(t){let n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder(ht("/*"+n+t.text+r+"*/"),t)}decl(t,n){let r=t.raws,i=this.raw(t,"between","colon"),o=t.prop+i+this.rawValue(t,"value");t.important&&(o+=r.important||" !important"),n&&(o+=";"),this.builder(ht(o),t)}document(t){this.body(t)}raw(t,n,r){let i;if(r||(r=n),n&&(i=t.raws[n],typeof i<"u"))return i;let o=t.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return Ou[r];let a=t.root(),l=a.rawCache||(a.rawCache={});if(typeof l[r]<"u")return l[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);{let s="raw"+x0(r);this[s]?i=this[s](a,t):a.walk(u=>{if(i=u.raws[n],typeof i<"u")return!1})}return typeof i>"u"&&(i=Ou[r]),l[r]=i,i}rawBeforeClose(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return n=r.raws.after,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawBeforeComment(t,n){let r;return t.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`\n`)&&(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(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`\n`)&&(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(`\n`)&&(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 i=r.parent;if(i&&i!==t&&i.parent&&i.parent===t&&typeof r.raws.before<"u"){let o=r.raws.before.split(`\n`);return n=o[o.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],i=t.raws[n];return i&&i.value===r?i.raw:r}root(t){if(this.body(t),t.raws.after){let n=t.raws.after,r=t.parent&&t.parent.type==="document";this.builder(r?n:ht(n))}}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(ht(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)}};Hu.exports=Gn;Gn.default=Gn});var Bn=ae((dA,Gu)=>{"use strict";var y0=Xo();function Jo(e,t){new y0(t).stringify(e)}Gu.exports=Jo;Jo.default=Jo});var Jr=ae((fA,Qo)=>{"use strict";Qo.exports.isClean=Symbol("isClean");Qo.exports.my=Symbol("my")});var Vn=ae((mA,Bu)=>{"use strict";var v0=Xr(),S0=Xo(),A0=Bn(),{isClean:Un,my:E0}=Jr();function Zo(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r==="proxyCache")continue;let i=e[r],o=typeof i;r==="parent"&&o==="object"?t&&(n[r]=t):r==="source"?n[r]=i:Array.isArray(i)?n[r]=i.map(a=>Zo(a,n)):(o==="object"&&i!==null&&(i=Zo(i)),n[r]=i)}return n}function tt(e,t){if(t&&typeof t.offset<"u")return t.offset;let n=1,r=1,i=0;for(let o=0;o<e.length;o++){if(r===t.line&&n===t.column){i=o;break}e[o]===`\n`?(n=1,r+=1):n+=1}return i}var Wn=class{get proxyOf(){return this}constructor(t={}){this.raws={},this[Un]=!1,this[E0]=!0;for(let n in t)if(n==="nodes"){this.nodes=[];for(let r of t[n])typeof r.clone=="function"?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=Zo(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:i}=this.rangeBy(n);return this.source.input.error(t,{column:i.column,line:i.line},{column:r.column,line:r.line},n)}return new v0(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[Un]=!0}markDirty(){if(this[Un]){this[Un]=!1;let t=this;for(;t=t.parent;)t[Un]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t={}){let n=this.source.start;if(t.index)n=this.positionInside(t.index);else if(t.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,o=r.slice(tt(r,this.source.start),tt(r,this.source.end)).indexOf(t.word);o!==-1&&(n=this.positionInside(o))}return n}positionInside(t){let n=this.source.start.column,r=this.source.start.line,i="document"in this.source.input?this.source.input.document:this.source.input.css,o=tt(i,this.source.start),a=o+t;for(let l=o;l<a;l++)i[l]===`\n`?(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:tt(n,this.source.start)},i=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:tt(n,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(t.word){let a=n.slice(tt(n,this.source.start),tt(n,this.source.end)).indexOf(t.word);a!==-1&&(r=this.positionInside(a),i=this.positionInside(a+t.word.length))}else t.start?r={column:t.start.column,line:t.start.line,offset:tt(n,t.start)}:t.index&&(r=this.positionInside(t.index)),t.end?i={column:t.end.column,line:t.end.line,offset:tt(n,t.end)}:typeof t.endIndex=="number"?i=this.positionInside(t.endIndex):t.index&&(i=this.positionInside(t.index+1));return(i.line<r.line||i.line===r.line&&i.column<=r.column)&&(i={column:r.column+1,line:r.line,offset:r.offset+1}),{end:i,start:r}}raw(t,n){return new S0().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 i of t)i===this?r=!0:r?(this.parent.insertAfter(n,i),n=i):this.parent.insertBefore(n,i);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={},i=n==null;n=n||new Map;let o=0;for(let a in this){if(!Object.prototype.hasOwnProperty.call(this,a)||a==="parent"||a==="proxyCache")continue;let l=this[a];if(Array.isArray(l))r[a]=l.map(s=>typeof s=="object"&&s.toJSON?s.toJSON(null,n):s);else if(typeof l=="object"&&l.toJSON)r[a]=l.toJSON(null,n);else if(a==="source"){if(l==null)continue;let s=n.get(l.input);s==null&&(s=o,n.set(l.input,o),o++),r[a]={end:l.end,inputId:s,start:l.start}}else r[a]=l}return i&&(r.inputs=[...n.keys()].map(a=>a.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=A0){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r={}){let i={node:this};for(let o in r)i[o]=r[o];return t.warn(n,i)}};Bu.exports=Wn;Wn.default=Wn});var qn=ae((pA,Uu)=>{"use strict";var w0=Vn(),zn=class extends w0{constructor(t){super(t),this.type="comment"}};Uu.exports=zn;zn.default=zn});var jn=ae((hA,Wu)=>{"use strict";var C0=Vn(),$n=class extends C0{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"}};Wu.exports=$n;$n.default=$n});var gt=ae((gA,Ju)=>{"use strict";var Vu=qn(),zu=jn(),_0=Vn(),{isClean:qu,my:$u}=Jr(),ea,ju,Ku,ta;function Yu(e){return e.map(t=>(t.nodes&&(t.nodes=Yu(t.nodes)),delete t.source,t))}function Xu(e){if(e[qu]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Xu(t)}var We=class e extends _0{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 i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let n of this.nodes)n.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,i;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],i=t(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[n]+=1;return delete this.indexes[n],i}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(i=>typeof i=="function"?(o,a)=>i(o.toProxy(),a):i)):n==="every"||n==="some"?r=>t[n]((i,...o)=>r(i.toProxy(),...o)):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),i=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let a of i)this.proxyOf.nodes.splice(r+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<o&&(this.indexes[a]=o+i.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),i=r===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[r],i).reverse();r=this.index(t);for(let l of o)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+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=Yu(ju(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"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 zu(t)]}else if(t.selector||t.selectors)t=[new ta(t)];else if(t.name)t=[new ea(t)];else if(t.text)t=[new Vu(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[$u]||e.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[qu]&&Xu(i),i.raws||(i.raws={}),typeof i.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(i.raws.before=n.raws.before.replace(/\\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+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(i=>{n.props&&!n.props.includes(i.prop)||n.fast&&!i.value.includes(n.fast)||(i.value=i.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((n,r)=>{let i;try{i=t(n,r)}catch(o){throw n.addToError(o)}return i!==!1&&n.walk&&(i=n.walk(t)),i})}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="atrule")return n(r,i)}))}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,i)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="decl")return n(r,i)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="rule")return n(r,i)}))}};We.registerParse=e=>{ju=e};We.registerRule=e=>{ta=e};We.registerAtRule=e=>{ea=e};We.registerRoot=e=>{Ku=e};Ju.exports=We;We.default=We;We.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,ea.prototype):e.type==="rule"?Object.setPrototypeOf(e,ta.prototype):e.type==="decl"?Object.setPrototypeOf(e,zu.prototype):e.type==="comment"?Object.setPrototypeOf(e,Vu.prototype):e.type==="root"&&Object.setPrototypeOf(e,Ku.prototype),e[$u]=!0,e.nodes&&e.nodes.forEach(t=>{We.rebuild(t)})}});var Qr=ae((bA,Zu)=>{"use strict";var Qu=gt(),Yt=class extends Qu{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)}};Zu.exports=Yt;Yt.default=Yt;Qu.registerAtRule(Yt)});var Zr=ae((xA,nc)=>{"use strict";var T0=gt(),ec,tc,kt=class extends T0{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new ec(new tc,this,t).stringify()}};kt.registerLazyResult=e=>{ec=e};kt.registerProcessor=e=>{tc=e};nc.exports=kt;kt.default=kt});var ic=ae((yA,rc)=>{var R0="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",k0=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i--;)r+=e[Math.random()*e.length|0];return r},M0=(e=21)=>{let t="",n=e|0;for(;n--;)t+=R0[Math.random()*64|0];return t};rc.exports={nanoid:M0,customAlphabet:k0}});var ei=ae(()=>{});var ti=ae(()=>{});var na=ae(()=>{});var oc=ae(()=>{});var ia=ae((RA,lc)=>{"use strict";var{existsSync:F0,readFileSync:N0}=oc(),{dirname:ra,join:L0}=ei(),{SourceMapConsumer:ac,SourceMapGenerator:sc}=ti();function D0(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var Kn=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,i=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=ra(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new ac(this.json||this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\\/json;charset=utf-?8;base64,/,r=/^data:application\\/json;base64,/,i=/^data:application\\/json;charset=utf-?8,/,o=/^data:application\\/json,/,a=t.match(i)||t.match(o);if(a)return decodeURIComponent(t.substr(a[0].length));let l=t.match(n)||t.match(r);if(l)return D0(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()),i=t.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,i)))}loadFile(t,n,r){if(!(!r&&!this.unsafeMap&&!/\\.map$/i.test(t))&&(this.root=ra(t),F0(t)))return this.mapFile=t,N0(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 i=this.loadFile(r,t,!0);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(n instanceof ac)return sc.fromSourceMap(n).toString();if(n instanceof sc)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=L0(ra(t),r));let i=this.loadFile(r,t,!1);if(i)try{this.json=JSON.parse(i.replace(/^\\)]}\'[^\\n]*\\n/,""))}catch{return}return i}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};lc.exports=Kn;Kn.default=Kn});var Yn=ae((kA,mc)=>{"use strict";var{nanoid:I0}=ic(),{isAbsolute:sa,resolve:la}=ei(),{SourceMapConsumer:P0,SourceMapGenerator:O0}=ti(),{fileURLToPath:uc,pathToFileURL:ni}=na(),cc=Xr(),H0=ia(),oa=Yo(),aa=Symbol("lineToIndexCache"),G0=!!(P0&&O0),dc=!!(la&&sa);function fc(e){if(e[aa])return e[aa];let t=e.css.split(`\n`),n=new Array(t.length),r=0;for(let i=0,o=t.length;i<o;i++)n[i]=r,r+=t[i].length+1;return e[aa]=n,n}var Xt=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&&(!dc||/^\\w+:\\/\\//.test(n.from)||sa(n.from)?this.file=n.from:this.file=la(n.from)),dc&&G0){let r=new H0(this.css,n);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+I0(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,i={}){let o,a,l,s,u;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,o=p.col}else a=m.line,o=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 c=this.origin(n,r,a,o);return c?u=new cc(t,c.endLine===void 0?c.line:{column:c.column,line:c.line},c.endLine===void 0?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,i.plugin):u=new cc(t,a===void 0?n:{column:r,line:n},a===void 0?r:{column:o,line:a},this.css,this.file,i.plugin),u.input={column:r,endColumn:o,endLine:a,endOffset:l,line:n,offset:s,source:this.css},this.file&&(ni&&(u.input.url=ni(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(t,n){return fc(this)[t-1]+n-1}fromOffset(t){let n=fc(this),r=n[n.length-1],i=0;if(t>=r)i=n.length-1;else{let o=n.length-2,a;for(;i<o;)if(a=i+(o-i>>1),t<n[a])o=a-1;else if(t>=n[a+1])i=a+1;else{i=a;break}}return{col:t-n[i]+1,line:i+1}}mapResolve(t){return/^\\w+:\\/\\//.test(t)?t:la(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,i){if(!this.map)return!1;let o=this.map.consumer(),a=o.originalPositionFor({column:n,line:t});if(!a.source)return!1;let l;typeof r=="number"&&(l=o.originalPositionFor({column:i,line:r}));let s;sa(a.source)?s=ni(a.source):s=new URL(a.source,this.map.consumer().sourceRoot||ni(this.map.mapFile));let u={column:a.column,endColumn:l&&l.column,endLine:l&&l.line,line:a.line,url:s.toString()};if(s.protocol==="file:")if(uc)u.file=uc(s);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(a.source);return c&&(u.source=c),u}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}};mc.exports=Xt;Xt.default=Xt;oa&&oa.registerInput&&oa.registerInput(Xt)});var Jt=ae((MA,bc)=>{"use strict";var pc=gt(),hc,gc,bt=class extends pc{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,r){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 o of i)o.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 hc(new gc,this,t).stringify()}};bt.registerLazyResult=e=>{hc=e};bt.registerProcessor=e=>{gc=e};bc.exports=bt;bt.default=bt;pc.registerRoot(bt)});var ua=ae((FA,xc)=>{"use strict";var Xn={comma(e){return Xn.split(e,[","],!0)},space(e){let t=[" ",`\n`," "];return Xn.split(e,t)},split(e,t,n){let r=[],i="",o=!1,a=0,l=!1,s="",u=!1;for(let c of e)u?u=!1:c==="\\\\"?u=!0:l?c===s&&(l=!1):c===\'"\'||c==="\'"?(l=!0,s=c):c==="("?a+=1:c===")"?a>0&&(a-=1):a===0&&t.includes(c)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=c;return(n||i!=="")&&r.push(i.trim()),r}};xc.exports=Xn;Xn.default=Xn});var ri=ae((NA,vc)=>{"use strict";var yc=gt(),B0=ua(),Qt=class extends yc{get selectors(){return B0.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=[])}};vc.exports=Qt;Qt.default=Qt;yc.registerRule(Qt)});var Ac=ae((LA,Sc)=>{"use strict";var U0=Qr(),W0=qn(),V0=jn(),z0=Yn(),q0=ia(),$0=Jt(),j0=ri();function Jn(e,t){if(Array.isArray(e))return e.map(i=>Jn(i));let{inputs:n,...r}=e;if(n){t=[];for(let i of n){let o={...i,__proto__:z0.prototype};o.map&&(o.map={...o.map,__proto__:q0.prototype}),t.push(o)}}if(r.nodes&&(r.nodes=e.nodes.map(i=>Jn(i,t))),r.source){let{inputId:i,...o}=r.source;r.source=o,i!=null&&(r.source.input=t[i])}if(r.type==="root")return new $0(r);if(r.type==="decl")return new V0(r);if(r.type==="rule")return new j0(r);if(r.type==="comment")return new W0(r);if(r.type==="atrule")return new U0(r);throw new Error("Unknown node type: "+e.type)}Sc.exports=Jn;Jn.default=Jn});var da=ae((DA,Rc)=>{"use strict";var{dirname:ii,relative:wc,resolve:Cc,sep:_c}=ei(),{SourceMapConsumer:Tc,SourceMapGenerator:oi}=ti(),{pathToFileURL:Ec}=na(),K0=Yn(),Y0=!!(Tc&&oi),X0=!!(ii&&Cc&&wc&&_c),ca=class{constructor(t,n,r,i){this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,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=`\n`;this.css.includes(`\\r\n`)&&(n=`\\r\n`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||ii(t.file),i;this.mapOpts.sourcesContent===!1?(i=new Tc(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,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;for(;(t=this.css.lastIndexOf("/*#"))!==-1;){let n=this.css.indexOf("*/",t+3);if(n===-1)break;for(;t>0&&this.css[t-1]===`\n`;)t--;this.css=this.css.slice(0,t)+this.css.slice(n+2)}}}}generate(){if(this.clearAnnotation(),X0&&Y0&&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=oi.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new oi({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 oi({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,a;this.stringify(this.root,(l,s,u)=>{if(this.css+=l,s&&u!=="end"&&(i.generated.line=t,i.generated.column=n-1,s.source&&s.source.start?(i.source=this.sourcePath(s),i.original.line=s.source.start.line,i.original.column=s.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),a=l.match(/\\n/g),a?(t+=a.length,o=l.lastIndexOf(`\n`),n=l.length-o):n+=l.length,s&&u!=="start"){let c=s.parent||{raws:{}};(!(s.type==="decl"||s.type==="atrule"&&!s.nodes)||s!==c.last||c.raws.semicolon)&&(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=t,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=n-1,this.map.addMapping(i)))}})}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?ii(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=ii(Cc(r,this.mapOpts.annotation)));let i=wc(r,t);return this.memoizedPaths.set(t,i),i}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 K0(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 i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,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(Ec){let r=Ec(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;_c==="\\\\"&&(t=t.replace(/\\\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}};Rc.exports=ca});var Fc=ae((IA,Mc)=>{"use strict";var ai=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,si=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,J0=/.[\\r\\n"\'(/\\\\]/,kc=/[\\da-f]/i;Mc.exports=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,a,l,s,u,c,f,m,p,b,v=r.length,x=0,_=[],R=[],T=-1;function M(){return x}function D(C){throw t.error("Unclosed "+C,x)}function E(){return R.length===0&&x>=v}function S(C){if(R.length)return R.pop();if(x>=v)return;let F=C?C.ignoreUnclosed:!1;switch(o=r.charCodeAt(x),o){case 10:case 32:case 9:case 13:case 12:{s=x;do s+=1,o=r.charCodeAt(s);while(o===32||o===10||o===9||o===13||o===12);c=["space",r.slice(x,s)],x=s-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let I=String.fromCharCode(o);c=[I,I,x];break}case 40:{if(b=_.length?_.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(i||F){s=x;break}else D("bracket");for(m=s;r.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);c=["brackets",r.slice(x,s+1),x,s],x=s}else x<=T?c=["(","(",x]:(s=r.indexOf(")",x+1),a=r.slice(x,s+1),s===-1||J0.test(a)?(T=s===-1?v:s,c=["(","(",x]):(c=["brackets",a,x,s],x=s));break}case 39:case 34:{u=o===39?"\'":\'"\',s=x;do{if(f=!1,s=r.indexOf(u,s+1),s===-1)if(i||F){s=x+1;break}else D("string");for(m=s;r.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);c=["string",r.slice(x,s+1),x,s],x=s;break}case 64:{ai.lastIndex=x+1,ai.test(r),ai.lastIndex===0?s=r.length-1:s=ai.lastIndex-2,c=["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(o=r.charCodeAt(s+1),l&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(s+=1,kc.test(r.charAt(s)))){for(;kc.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===32&&(s+=1)}c=["word",r.slice(x,s+1),x,s],x=s;break}default:{o===47&&r.charCodeAt(x+1)===42?(s=r.indexOf("*/",x+2)+1,s===0&&(i||F?s=r.length:D("comment")),c=["comment",r.slice(x,s+1),x,s],x=s):(si.lastIndex=x+1,si.test(r),si.lastIndex===0?s=r.length-1:s=si.lastIndex-2,c=["word",r.slice(x,s+1),x,s],_.push(c),x=s);break}}return x++,c}function A(C){R.push(C)}return{back:A,endOfFile:E,nextToken:S,position:M}}});var Ic=ae((PA,Dc)=>{"use strict";var Q0=Qr(),Z0=qn(),eg=jn(),tg=Jt(),Nc=ri(),ng=Fc(),Lc={empty:!0,space:!0};function rg(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}var fa=class{constructor(t){this.input=t,this.root=new tg,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 Q0;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,i,o,a=!1,l=!1,s=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.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(o=s.length-1,i=s[o];i&&i[0]==="space";)i=s[--o];i&&(n.source.end=this.getPosition(i[3]||i[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,i;for(let o=n-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let n=0,r,i,o;for(let[a,l]of t.entries()){if(i=l,o=i[0],o==="("&&(n+=1),o===")"&&(n-=1),n===0&&o===":")if(!r)this.doubleColon(i);else{if(r[0]==="word"&&r[1]==="progid")continue;return a}r=i}return!1}comment(t){let n=new Z0;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 i=r.match(/^(\\s*)([^]*\\S)(\\s*)$/);n.text=i[2],n.raws.left=i[1],n.raws.right=i[3]}}createTokenizer(){this.tokenizer=ng(this.input)}decl(t,n){let r=new eg;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||rg(t)),r.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=t.shift()[1]}r.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let a=[],l;for(;t.length&&(l=t[0][0],!(l!=="space"&&l!=="comment"));)a.push(t.shift());this.precheckMissedSemicolon(t);for(let u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),f="";for(let m=u;m>0;m--){let p=c[m][0];if(f.trim().startsWith("!")&&p!=="space")break;f=c.pop()[1]+f}f.trim().startsWith("!")&&(r.important=!0,r.raws.important=f,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=a.map(u=>u[1]).join(""),a=[]),this.raw(r,"value",a.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 Nc;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+=n.raws.ownSemicolon.length)}}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,i=!1,o=null,a=[],l=t[1].startsWith("--"),s=[],u=t;for(;u;){if(r=u[0],s.push(u),r==="("||r==="[")o||(o=u),a.push(r==="("?")":"]");else if(l&&i&&r==="{")o||(o=u),a.push("}");else if(a.length===0)if(r===";")if(i){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===":"&&(i=!0);else r===a[a.length-1]&&(a.pop(),a.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),a.length>0&&this.unclosedBracket(o),n&&i){if(!l)for(;s.length&&(u=s[s.length-1][0],!(u!=="space"&&u!=="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,i){let o,a,l=r.length,s="",u=!0,c,f;for(let m=0;m<l;m+=1)o=r[m],a=o[0],a==="space"&&m===l-1&&!i?u=!1:a==="comment"?(f=r[m-1]?r[m-1][0]:"empty",c=r[m+1]?r[m+1][0]:"empty",!Lc[f]&&!Lc[c]?s.slice(-1)===","?u=!1:s+=o[1]:u=!1):s+=o[1];if(!u){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 Nc;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 i=n;i<t.length;i++)r+=t[i][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})}};Dc.exports=fa});var ui=ae((OA,Pc)=>{"use strict";var ig=gt(),og=Yn(),ag=Ic();function li(e,t){let n=new og(e,t),r=new ag(n);try{r.parse()}catch(i){throw i}return r.root}Pc.exports=li;li.default=li;ig.registerParse(li)});var ma=ae((HA,Oc)=>{"use strict";var Qn=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){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}};Oc.exports=Qn;Qn.default=Qn});var ci=ae((GA,Hc)=>{"use strict";var sg=ma(),Zn=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 sg(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}};Hc.exports=Zn;Zn.default=Zn});var pa=ae((BA,Bc)=>{"use strict";var Gc={};Bc.exports=function(t){Gc[t]||(Gc[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))}});var ba=ae((WA,zc)=>{"use strict";var lg=gt(),ug=Zr(),cg=da(),dg=ui(),Uc=ci(),fg=Jt(),mg=Bn(),{isClean:Ke,my:pg}=Jr(),UA=pa(),hg={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},gg={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},bg={Once:!0,postcssPlugin:!0,prepare:!0},Zt=0;function er(e){return typeof e=="object"&&typeof e.then=="function"}function Vc(e){let t=!1,n=hg[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,Zt,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,Zt,n+"Exit"]:[n,n+"Exit"]}function Wc(e){let t;return e.type==="document"?t=["Document",Zt,"DocumentExit"]:e.type==="root"?t=["Root",Zt,"RootExit"]:t=Vc(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ha(e){return e[Ke]=!1,e.nodes&&e.nodes.forEach(t=>ha(t)),e}var ga={},xt=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 i;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))i=ha(n);else if(n instanceof e||n instanceof Uc)i=ha(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let o=dg;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(n,r)}catch(a){this.processed=!0,this.error=a}i&&!i[pg]&&lg.rebuild(i)}this.result=new Uc(t,i,r),this.helpers={...ga,postcss:ga,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}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(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(n,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,i])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!gg[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!bg[r])if(typeof n[r]=="object")for(let i in n[r])i==="*"?t(n,r,n[r][i]):t(n,r+"-"+i.toLowerCase(),n[r][i]);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(er(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ke];){t[Ke]=!0;let n=[Wc(t)];for(;n.length>0;){let r=this.visitTick(n);if(er(r))try{await r}catch(i){let o=n[n.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let i=t.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(t,this.helpers)}catch(i){throw this.handleError(i)}}}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 er(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=mg;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 o=new cg(n,this.result.root,this.result.opts).generate();return this.result.css=o[0],this.result.map=o[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(er(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ke];)t[Ke]=!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,i]of t){this.result.lastPlugin=r;let o;try{o=i(n,this.helpers)}catch(a){throw this.handleError(a,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(er(o))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[a,l]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.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,l;for(;l=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!l[Ke]){l[Ke]=!0,t.push(Wc(l));return}n.iterator=0,delete r.indexes[a]}let o=n.events;for(;n.eventIndex<o.length;){let a=o[n.eventIndex];if(n.eventIndex+=1,a===Zt){r.nodes&&r.nodes.length&&(r[Ke]=!0,n.iterator=r.getIterator());return}else if(this.listeners[a]){n.visitors=this.listeners[a];return}}t.pop()}walkSync(t){t[Ke]=!0;let n=Vc(t);for(let r of n)if(r===Zt)t.nodes&&t.each(i=>{i[Ke]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,t.toProxy()))return}}warnings(){return this.sync().warnings()}};xt.registerPostcss=e=>{ga=e};zc.exports=xt;xt.default=xt;fg.registerLazyResult(xt);ug.registerLazyResult(xt)});var $c=ae((zA,qc)=>{"use strict";var xg=da(),yg=ui(),vg=ci(),Sg=Bn(),VA=pa(),tr=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=yg;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 i=Sg;this.result=new vg(this._processor,void 0,this._opts),this.result.css=n;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new xg(i,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[]}};qc.exports=tr;tr.default=tr});var Kc=ae((qA,jc)=>{"use strict";var Ag=Zr(),Eg=ba(),wg=$c(),Cg=Jt(),Mt=class{constructor(t=[]){this.version="8.5.14",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 wg(this,t,n):new Eg(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};jc.exports=Mt;Mt.default=Mt;Cg.registerProcessor(Mt);Ag.registerProcessor(Mt)});var nd=ae(($A,td)=>{"use strict";var Yc=Qr(),Xc=qn(),_g=gt(),Tg=Xr(),Jc=jn(),Qc=Zr(),Rg=Ac(),kg=Yn(),Mg=ba(),Fg=ua(),Ng=Vn(),Lg=ui(),xa=Kc(),Dg=ci(),Zc=Jt(),ed=ri(),Ig=Bn(),Pg=ma();function ce(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new xa(e)}ce.plugin=function(t,n){let r=!1;function i(...a){console&&console.warn&&!r&&(r=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let l=n(...a);return l.postcssPlugin=t,l.postcssVersion=new xa().version,l}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(a,l,s){return ce([i(s)]).process(a,l)},i};ce.stringify=Ig;ce.parse=Lg;ce.fromJSON=Rg;ce.list=Fg;ce.comment=e=>new Xc(e);ce.atRule=e=>new Yc(e);ce.decl=e=>new Jc(e);ce.rule=e=>new ed(e);ce.root=e=>new Zc(e);ce.document=e=>new Qc(e);ce.CssSyntaxError=Tg;ce.Declaration=Jc;ce.Container=_g;ce.Processor=xa;ce.Document=Qc;ce.Comment=Xc;ce.Warning=Pg;ce.AtRule=Yc;ce.Result=Dg;ce.Input=kg;ce.Rule=ed;ce.Root=Zc;ce.Node=Ng;Mg.registerPostcss(ce);td.exports=ce;ce.default=ce});function Cr(){return globalThis}function L(e,t){if(typeof window>"u")return;let n=Cr(),r=n.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(i){}(n.__hfDebug||n.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var Zm=["seconds-time","rational-fps","seek-keep-playing","composition-manifest-v1","runtime-data"];function ep(e,t){let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let i=n%r;n=r,r=i}return n||1}function tp(e){let t=Number.isFinite(e)&&e>0?e:30,n=Number.isInteger(t)?1:1e6,r=Math.round(t*n),i=ep(r,n);return{numerator:r/i,denominator:n/i}}function Ji(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 _r(e){return{protocolVersion:1,capabilities:Zm,fps:tp(e)}}function np(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function Hs(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=Ji(n.fps);return r===null||!np(n.capabilities)?{status:"unsupported",code:"invalid_protocol_metadata",receivedVersion:n.protocolVersion}:{status:"supported",fps:r,metadata:n}}var Gs=30;function Bs(e){Gs=Number.isFinite(e)&&e>0?e:30}function be(e){try{window.parent.postMessage({...e,..._r(Gs)},"*")}catch(t){L("bridge.postMessage",t)}}var rp={play:(e,t)=>t.onPlay(),pause:(e,t)=>t.onPause(),"stop-media":(e,t)=>t.onStopMedia(),seek:(e,t)=>t.onSeek(ip(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-root-duration":(e,t)=>t.onSetRootDuration(Number(e.durationSeconds??0)),"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=>ap(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 ip(e,t){let n=Number(e.timeSeconds);if(Number.isFinite(n))return Math.max(0,n);let i=Ji(e.fps)??t.getCanonicalFps();return Math.max(0,Number(e.frame??0))/i}function op(e){let t=Hs(e);return t.status!=="unsupported"?!1:(be({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 ap(e){let t=e.selectors,n=e.duration||800;t&&sp(t,n)}function Us(e){let t=n=>{let r=n.data;if(!r||r.source!=="hf-parent"||r.type!=="control"||op(r))return;let i=r.action;if(typeof i!="string")return;let o=rp[i];o&&o(r,e)};return window.addEventListener("message",t),be({source:"hf-preview",type:"ready"}),t}function sp(e,t){if(!document.getElementById("__hf-flash-styles")){let n=document.createElement("style");n.id="__hf-flash-styles",n.textContent=`\n .__hf-flash {\n outline: 2px solid rgba(59, 130, 246, 0.6) !important;\n outline-offset: 2px !important;\n animation: __hf-flash-pulse ${t}ms ease-out forwards !important;\n }\n @keyframes __hf-flash-pulse {\n 0% { outline-color: rgba(59, 130, 246, 0.8); }\n 100% { outline-color: transparent; }\n }\n `,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(i=>{i.classList.add("__hf-flash"),setTimeout(()=>i.classList.remove("__hf-flash"),t)})}catch(r){L("bridge.flashElements.querySelector",r)}}var Qi=null;function Ws(e){Qi=e}function Ne(e,t){if(Qi)try{Qi({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){L("runtime.analytics.site1",n)}}function lp(e){let t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-"),n=0,r=t.length;for(;n<r&&t[n]==="-";)n++;for(;r>n&&t[r-1]==="-";)r--;let i=t.slice(n,r);return i.length>0?i:"node"}function Pt(e){return`--${lp(e)}`}function Vs(e){let t=new Map;for(let n of e){let r=Pt(n),i=t.get(r);i?i.includes(n)||i.push(n):t.set(r,[n])}return[...t.values()].filter(n=>n.length>1)}function qs(){if(typeof document>"u")return{};let e=new Set;document.documentElement?.hasAttribute("data-composition-variables")&&e.add(document.documentElement);for(let i of Array.from(document.querySelectorAll("[data-composition-variables]")))e.add(i);let t={};for(let i of e)Object.assign(t,bn(i));let n=Rr(),r={...t,...n};for(let i of e)eo(i,r);return r}var zs=new Set;function $s(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 up(e,t){return t?.trim()||e.getAttribute("data-composition-id")?.trim()||e.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()||"composition"}function cp(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 dp(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=cp(e);return r.length===0||r.some(i=>String(i)===String(n))?null:{id:e.id,value:n,allowed:r}}function eo(e,t,n){if(!e)return;let r=$s(e);if(r.length===0)return;let i=up(e,n);for(let o of r){let a=dp(o,t);if(!a)continue;let l=`${i}|${a.id}|${String(a.value)}`;if(zs.has(l))continue;zs.add(l);let s="default"in o?JSON.stringify(o.default):"the composition default";console.warn(`[hyperframes] runtime_unknown_enum_value: ${i} variable "${a.id}" got ${JSON.stringify(a.value)}, which is not a declared option (${a.allowed.join(", ")}). Rendering ${s} instead.`)}}function bn(e){let t={};for(let n of $s(e))typeof n.id!="string"||!("default"in n)||(t[n.id]=n.default);return t}var Zi="data-hf-css-vars";function Tr(e){return"style"in e&&typeof e.style?.setProperty=="function"}function to(e,t){if(!Tr(e))return;let n=[];for(let[r,i]of Object.entries(t))if(typeof i=="string"&&i!==""||typeof i=="number"){let o=Pt(r);e.style.setProperty(o,String(i)),n.push(o)}n.length>0&&e.setAttribute(Zi,n.join(" "))}function js(e,t,n){let r={};for(let[i,o]of Object.entries(t)){let a=Pt(i);((Tr(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(r[i]=o)}return r}function Ks(e){if(!Tr(e))return;let t=e.getAttribute(Zi);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(Zi)}}function Ys(e){let t=new Set;e.documentElement?.hasAttribute("data-composition-variables")&&t.add(e.documentElement);for(let i of Array.from(e.querySelectorAll("[data-composition-variables]")))t.add(i);let n=Rr(),r=[];for(let i of t)r.push(...fp(i,n,e.defaultView));for(let i of Vs(r))console.warn(`composition variables ${i.join(", ")} collapse to the same CSS property ${Pt(i[0]??"")} \\u2014 rename one to avoid cross-talk`)}function fp(e,t,n){if(!Tr(e))return[];let r=bn(e),i={};for(let[o,a]of Object.entries(r)){if(o in t)continue;let l=Pt(o);(e.style.getPropertyValue(l)||(n?n.getComputedStyle(e).getPropertyValue(l):"")).trim()===""&&(i[o]=a)}for(let[o,a]of Object.entries(t))o in r&&(i[o]=a);return to(e,i),Object.keys(r)}function Xs(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 Rr(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}function Js(e){let t=[],n=u=>{if(typeof u.getAnimations!="function")return[];try{return u.getAnimations()}catch{return[]}},r=u=>e?.resolveStartSeconds?e.resolveStartSeconds(u):Number.parseFloat(u.getAttribute("data-start")??"0")||0,i=(u,c)=>{let f=null;try{f=u.effect?.getComputedTiming?.()??null}catch(p){L("runtime.adapters.css.site5",p)}if(!f)return{};let m=Number(f.endTime);return Number.isFinite(m)?{endSeconds:c+m/1e3}:{unbounded:!0}},o=(u,c)=>{for(let f of u){try{f.currentTime=c}catch(m){L("runtime.adapters.css.site1",m)}try{f.pause()}catch(m){L("runtime.adapters.css.site2",m)}}},a=u=>{for(let c of u)try{c.play()}catch(f){L("runtime.adapters.css.site3",f)}},l=u=>{for(let c of u)try{c.pause()}catch(f){L("runtime.adapters.css.site4",f)}},s=u=>{u.baseDelay?u.el.style.animationDelay=u.baseDelay:u.el.style.removeProperty("animation-delay"),u.basePlayState?u.el.style.animationPlayState=u.basePlayState:u.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{t=[];let u=document.querySelectorAll("*");for(let c of u){if(!(c instanceof HTMLElement))continue;let f=window.getComputedStyle(c);!f.animationName||f.animationName==="none"||t.push({el:c,baseDelay:c.style.animationDelay||"",basePlayState:c.style.animationPlayState||"",animations:n(c)})}},getInferredDurationSeconds:()=>{let u=0;for(let c of t){if(!c.el.isConnected)continue;let f=r(c.el);for(let m of n(c.el)){let p=i(m,f);p.endSeconds!=null&&(u=Math.max(u,p.endSeconds))}}return u>0?u:null},seek:u=>{let c=Number(u.time)||0;for(let f of t){if(!f.el.isConnected)continue;let m=r(f.el),p=Math.max(0,c-m)*1e3,b=f.animations;if(b.length>0){o(b,p);continue}f.el.style.animationPlayState="paused",f.el.style.animationDelay=`-${(p/1e3).toFixed(3)}s`}},pause:()=>{for(let u of t){if(!u.el.isConnected)continue;let c=u.animations;c.length>0&&l(c),s(u)}},play:()=>{for(let u of t)u.el.isConnected&&(s(u),a(u.animations))},revert:()=>{t=[]}}}function Qs(e){return{name:"gsap",discover:()=>{},seek:t=>{let n=e.getTimeline();if(!n)return;n.pause();let r=Math.max(0,Number(t.time)||0),i=t.suppressEvents===!0;typeof n.totalTime=="function"?(n.totalTime(r+.001,!0),n.totalTime(r,i)):n.seek(r,i)},pause:()=>{let t=e.getTimeline();t&&t.pause()}}}function Zs(){return{name:"animejs",discover:()=>{try{let e=window.anime;if(!e||typeof e.running>"u")return;let t=e.running;if(!Array.isArray(t)||t.length===0)return;let n=window.__hfAnime??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfAnime=n}catch(e){L("runtime.adapters.animejs.site1",e)}},seek:e=>{let t=Math.max(0,(Number(e.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let r of n)try{typeof r.seek=="function"&&r.seek(t)}catch(i){L("runtime.adapters.animejs.site2",i)}},pause:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.pause=="function"&&t.pause()}catch(n){L("runtime.adapters.animejs.site3",n)}},play:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.play=="function"&&t.play()}catch(n){L("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function tl(){return{name:"lottie",discover:()=>{try{let e=window.lottie;if(e&&typeof e.getRegisteredAnimations=="function"){let t=e.getRegisteredAnimations();if(Array.isArray(t)&&t.length>0){let n=window.__hfLottie??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfLottie=n}}}catch(e){L("runtime.adapters.lottie.site1",e)}},seek:e=>{let t=Math.max(0,Number(e.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let r of n)try{if(no(r))r.goToAndStop(t*1e3,!1);else if(ro(r)){if(typeof r.setCurrentRawFrameValue=="function"){let i=r.totalFrames??0,o=r.frameRate??30,a=t*o;i>0&&r.setCurrentRawFrameValue(Math.min(a,i-1))}else if(typeof r.seek=="function"){let i=r.duration??1,o=Math.min(100,t/i*100);r.seek(o)}}}catch(i){L("runtime.adapters.lottie.site2",i)}},pause:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let t of e)try{(no(t)||ro(t))&&t.pause()}catch(n){L("runtime.adapters.lottie.site3",n)}},revert:()=>{},getInferredDurationSeconds:()=>{let e=window.__hfLottie;if(!e||e.length===0)return null;let t=0,n=!1;for(let r of e){let i=null;try{i=mp(r)}catch(o){L("runtime.adapters.lottie.site4",o)}i!=null&&(n=!0,t=Math.max(t,i))}return n?t:null}}}function el(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function mp(e){return no(e)?el(e.totalFrames,e.frameRate):ro(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:el(e.totalFrames,e.frameRate):null}function no(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function ro(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}var io=-1,kr=new Set,Ot,oo=0;function nl(e){let t=[],n=!0,r={time:e,waitUntil:o=>{if(!n)throw new Error("hf-seek waitUntil() must be called synchronously from the event listener");t.push(o)}};try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:r}))}catch(o){L("runtime.adapters.seek-dispatch.site1",o)}finally{n=!1}if(t.length===0)return;let i=Promise.all(t).then(()=>({status:"fulfilled"})).catch(o=>({status:"rejected",reason:o}));kr.add(i),i.then(o=>{kr.delete(i)&&o.status==="rejected"&&Ot===void 0&&(Ot={reason:o.reason})})}function Mr(e){e!==io&&(io=e,nl(e))}function Fr(e){io=e,nl(e)}function rl(){return oo>0}async function ao(){oo+=1;let e=Ot;try{for(await Promise.resolve();kr.size>0;){let r=(await Promise.all([...kr])).find(i=>i.status==="rejected");e===void 0&&r?.status==="rejected"&&(e={reason:r.reason})}let t=Ot;if(e===void 0&&(e=t),Ot===t&&(Ot=void 0),e)throw e.reason}finally{oo-=1}}function il(){let e=null,t=0,n=null,r=null,i=null,o=null,a=()=>{if(typeof window>"u")return null;let c=window.THREE?.DefaultLoadingManager;return!c||typeof c!="object"||typeof c.itemsLoaded!="number"||typeof c.itemsTotal!="number"?null:c},l=u=>{o||u.itemsTotal<=u.itemsLoaded||(o=new Promise(c=>{u.onLoad=function(){try{i?.call(this)}finally{o=null,u.onLoad=i??null,c()}}}))},s=u=>{n!==u&&(n=u,r=u.onStart??null,i=u.onLoad??null,u.onStart=function(c,f,m){try{r?.call(this,c,f,m)}finally{l(u)}})};return{name:"three",discover:()=>{let u=a();u&&(s(u),l(u))},seek:u=>{e=Math.max(0,Number(u.time)||0),t=e,window.__hfThreeTime=e,Mr(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0},getReadyPromise:()=>{let u=a();return!u||u.itemsTotal<=u.itemsLoaded?null:(o||l(u),o)}}}function qe(e){let t=null,n=new WeakSet;return{name:e.name,discover:()=>{},seek:()=>{},pause:()=>{},play:()=>{},revert:()=>{},getReadyPromise:()=>{let r=e.getInstances();if(r.length===0)return null;let i=r.filter(o=>!n.has(o));return i.length===0?null:t||(t=Promise.allSettled(i.map(o=>e.waitFor(o).then(()=>{n.add(o)}))).then(()=>{t=null}),t)}}}function ol(){return qe({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 al(){return qe({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 sl(){return qe({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 ll(){return qe({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 ul(){return qe({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}var pp=250;function cl(){let e=null,t=0,n=null,r=()=>{n!==null&&(window.clearInterval(n),n=null)},i=()=>{n===null&&document.querySelector("[data-composition-id][data-requires-webgpu]")&&(n=window.setInterval(()=>{e!==null&&(rl()||(window.__hfTypegpuTime=e,Fr(e)))},pp))};return{name:"typegpu",discover:()=>{},seek:o=>{e=Math.max(0,Number(o.time)||0),t=e,window.__hfTypegpuTime=e,Mr(e)},pause:()=>{e==null&&(e=Math.max(0,t)),i()},play:()=>{r(),e=null},revert:()=>{r(),e=null,t=0}}}var xn="data-hf-render-id",dl="data-hf-group-render-id";function hp(e){return e.getAttribute(xn)||e.id||null}var gp="__render_frame_",bp="__";function xp(e){return`${gp}${e}${bp}`}function yp(e){let t=hp(e);return t?xp(t):null}function ut(e){let t=yp(e);if(!t)return null;let n=document.getElementById(t);return n instanceof HTMLImageElement?n:null}function fl(e){let t=e.nextElementSibling;if(t instanceof HTMLImageElement&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;let n=ut(e);return n&&n.complete&&n.naturalWidth>0?n:null}function ml(){let e=globalThis.GPUQueue;if(!e?.prototype?.copyExternalImageToTexture)return;let t=e.prototype.copyExternalImageToTexture;e.prototype.copyExternalImageToTexture=function(n,r,i){if(n?.source instanceof HTMLVideoElement){let o=fl(n.source);if(o)return t.call(this,{...n,source:o},r,i)}return t.call(this,n,r,i)}}function pl(){let e=[globalThis.WebGL2RenderingContext,globalThis.WebGLRenderingContext],t=["texImage2D","texSubImage2D"];for(let n of e){let r=n?.prototype;if(r)for(let i of t){let o=r[i];if(typeof o!="function"||o.__hfVideoPatched)continue;let a=function(...l){let s=l.length-1,u=l[s];if(u instanceof HTMLVideoElement){let c=fl(u);c&&(l[s]=c)}return o.apply(this,l)};a.__hfVideoPatched=!0,r[i]=a}}}function hl(){let e=!1,t=0,n=!1,r,i,o,a=new Set,l=new WeakMap,s=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},u=x=>{let _=Number(x.currentTime);return Number.isFinite(_)&&_>0?_:0},c=(x,_)=>_<=0?x:x>=_?Math.max(0,x-_):x,f=(x,_)=>{let R=l.get(x);if(R)return R;let T={compositionTimeMs:_,animationTimeMs:e?c(u(x),_):u(x)};return l.set(x,T),T},m=(x,_)=>{if(!a.has(x)){a.add(x);let R=()=>{a.delete(x)};try{x.addEventListener("finish",R,{once:!0}),x.addEventListener("cancel",R,{once:!0})}catch(T){L("runtime.adapters.waapi.site4",T)}}f(x,_)},p=(x,_)=>{for(let R of x)m(R,_)},b=()=>{if(n||typeof Element>"u")return;let x=Element.prototype;if(typeof x.animate!="function"||x.__hfOriginalAnimate)return;let _=x.animate;try{Object.defineProperty(x,"__hfOriginalAnimate",{value:_,configurable:!0});let R=function(...T){let M=_.apply(this,T);return m(M,t),M};x.animate=R,r=x,i=_,o=R,n=!0}catch{}},v=x=>{let _=null;try{_=x.effect?.getComputedTiming?.()??null}catch(M){L("runtime.adapters.waapi.site4",M)}if(!_)return{};let R=Number(_.endTime);return Number.isFinite(R)?{endSeconds:(l.get(x)?.compositionTimeMs??0)/1e3+R/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,b(),p(s(),t)},seek:x=>{let _=Math.max(0,(Number(x.time)||0)*1e3);t=_,(!e||a.size>0)&&p(s(),e?_:0);for(let R of a){let T=e?f(R,_):f(R,0),M=T.animationTimeMs+Math.max(0,_-T.compositionTimeMs);try{R.currentTime=M}catch(D){L("runtime.adapters.waapi.site1",D)}try{R.pause()}catch(D){L("runtime.adapters.waapi.site2",D)}}},pause:()=>{e||p(s(),t);for(let x of a)try{x.pause()}catch(_){L("runtime.adapters.waapi.site3",_)}},revert:()=>{if(a.clear(),l=new WeakMap,e=!1,t=0,r&&i&&o&&r.animate===o)try{r.animate=i,r.__hfOriginalAnimate===i&&delete r.__hfOriginalAnimate}catch(x){L("runtime.adapters.waapi.site5",x)}r=void 0,i=void 0,o=void 0,n=!1},getInferredDurationSeconds:()=>{let x=0;for(let _ of s()){let R=v(_);R.endSeconds!=null&&(x=Math.max(x,R.endSeconds))}return x>0?x:null}}}var so=3.981071705534972;function Le(e){return Number.isFinite(e)?Math.max(0,Math.min(so,e)):1}function Nr(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function gl(e,t){let n=typeof HTMLMediaElement>"u"?void 0:Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"volume"),r=n?.get,i=n?.set;if(!r||!i)return t();let o=Number(r.call(e));Object.defineProperty(e,"volume",{configurable:!0,get:()=>o,set:a=>{o=Number(a),i.call(e,Nr(o))}});try{return t()}finally{delete e.volume,i.call(e,Nr(o))}}var Ht=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),yv=Object.freeze([Ht.start,Ht.duration,Ht.trackIndex]),vv=Object.freeze([Ht.derivedEnd]),Sv=Object.freeze([Ht.derivedEnd,Ht.legacyTrack]);function Gt(e){if(e==null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}var xl=/^[A-Za-z0-9_.:-]+$/;function yl(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function bl(e,t){let n=t;for(;n>=0&&yl(e,n);)n--;return n}function vp(e,t){let n=t;for(;n>=0&&(e[n]??"").trim()==="";)n--;return n}function Sp(e){let t=e.length-1;if(!yl(e,t))return null;let n=bl(e,t);return e[n]==="."&&(n=bl(e,n-1)),n+1}function Ap(e){let t=Sp(e);if(t==null)return null;let n=vp(e,t-1),r=e[n];if(r!=="+"&&r!=="-")return null;let i=e.slice(0,n).trim();if(!xl.test(i))return null;let o=Number(e.slice(t));return Number.isFinite(o)?{refId:i,operator:r,magnitude:o}:null}function lo(e){let t=(e??"").trim();if(!t)return null;let n=Gt(t);if(n!=null)return{kind:"absolute",value:n};if(xl.test(t))return{kind:"reference",refId:t,offset:0};let r=Ap(t);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}function vl(e){return Number.isFinite(e)&&e>0?Math.max(.1,Math.min(5,e)):1}function ve(e){return Gt(e)}function _e(e){let t=Number.parseFloat(e.getAttribute("data-playback-rate")??""),n=Number.isFinite(t)&&t>0?t:typeof HTMLMediaElement<"u"&&e instanceof HTMLMediaElement?e.defaultPlaybackRate:1;return vl(n)}function yn(e){let t=n=>{let r=ve(n);return r==null?null:Number.isFinite(r)&&r>=0?r:null};return t(e.getAttribute("data-playback-start"))??t(e.getAttribute("data-media-start"))??0}function Qe(e,t){return Ep(t,yn(e),_e(e))}function Ep(e,t,n){return Number.isFinite(e)?Math.max(0,e-t)/vl(n):null}function wp(e,t,n){let r=e.filter(o=>Number.isFinite(o.time)&&Number.isFinite(o.volume)).map(o=>({time:Math.max(0,o.time-t),volume:Le(o.volume)})).sort((o,a)=>o.time-a.time),i=[];for(let o of r){let a=i.at(-1);a&&Math.abs(a.time-o.time)<1e-9?a.volume=o.volume:i.push(o)}return i.length===0||i[0].time>0&&i.unshift({time:0,volume:Le(n)}),i}function Sl(e,t){if(e.length===0)return 1;let n=0;for(;n<e.length-2&&t>=e[n+1].time;)n+=1;let r=e[n],i=e[n+1]??r,o=i.time-r.time,a=o<=0?0:Math.min(1,Math.max(0,(t-r.time)/o));return r.volume+(i.volume-r.volume)*a}function Cp(e,t,n,r){let i=e.at(-1);!i||Math.abs(i.volume-n.volume)>1e-4?(i&&t&&t.time>i.time&&e.push(t),e.push(n)):r&&n.time>i.time&&e.push(n)}function _p(e){let t=Number.parseFloat(e??"");return Number.isFinite(t)?t:void 0}function Al(e,t){let n=ve(e.dataset.start)??0,r=ve(e.dataset.end)??void 0,i=ve(e.dataset.duration)??void 0,o=t;i!==void 0&&i>0?o=n+i:r!==void 0&&r>n&&(o=r);let a=_p(e.dataset.volume)??1;return{start:n,end:o,staticVolume:Le(a)}}function Tp(e,t,n,r){let{start:i,end:o,staticVolume:a}=Al(e,n),l=1/Math.min(60,Math.max(1,r)),s=Math.max(0,i),u=Math.min(n,o),c=gl(e,()=>{e.volume=a;let m=[],p;for(let b=s;b<=u+1e-6;b=Math.min(u,b+l)){t(b);let v=Number(e.volume);if(Number.isFinite(v)){let x={time:Number(b.toFixed(6)),volume:Number(Le(v).toFixed(6))};Cp(m,p,x,b===u),p=x}if(b===u)break}return m});return c.some(m=>Math.abs(m.volume-a)>1e-4)?c:null}function El(e,t,n,r,i={}){if(i.allowLiveTimelineSeek===!1||!t||!(e instanceof HTMLAudioElement)&&!(e instanceof HTMLVideoElement)||n<=0)return;let o=s=>{try{typeof t.totalTime=="function"?t.totalTime(s,!0):typeof t.seek=="function"&&t.seek(s,!0)}catch{}},a=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,l=Tp(e,o,n,60);if(Number.isFinite(a)&&o(a),l){let{start:s,staticVolume:u}=Al(e,n),c=wp(l,s,u);c.length>0&&r.set(e,c)}}var Tt="data-fx-chain",Fv=Tt.slice(5),wl=1,vn=(e="frequency",t="Frequency",n=1e3,r=20,i=2e4)=>({kind:"number",key:e,label:t,unit:"Hz",min:r,max:i,step:1,default:n,scale:"log",automatable:!0}),uo=(e=.707,t="Bandwidth \\u2014 higher is narrower.")=>({kind:"number",key:"q",label:"Q",unit:"",min:.1,max:20,step:.01,default:e,scale:"log",automatable:!0,hint:t}),Lr=(e=-40,t=40,n=0)=>({kind:"number",key:"gain",label:"Gain",unit:"dB",min:e,max:t,step:.1,default:n,automatable:!0}),Cl={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."},Tl=[{id:"gain",label:"Gain",group:"dynamics",description:"Raise or lower the whole signal. Automate it to duck under something else.",params:[Lr(-60,12,0)],web:"gain-node"},{id:"peaking",label:"Peaking EQ",group:"filter",description:"Boost or cut a band, leaving everything either side alone.",params:[vn("frequency","Frequency",1e3),Lr(-40,40,0),uo(1)],web:"biquad-peaking"},{id:"lowshelf",label:"Low Shelf",group:"filter",description:"Lift or drop everything below the corner frequency.",params:[vn("frequency","Frequency",200,20,2e3),Lr(-40,40,0)],web:"biquad-lowshelf"},{id:"highshelf",label:"High Shelf",group:"filter",description:"Lift or drop everything above the corner frequency.",params:[vn("frequency","Frequency",4e3,500,2e4),Lr(-40,40,0)],web:"biquad-highshelf"},{id:"highpass",label:"High-pass",group:"filter",description:"Remove low frequencies \\u2014 the usual fix for rumble on a voice.",params:[vn("frequency","Cutoff",300,20,2e4),uo(.707),Cl],web:"biquad-highpass"},{id:"lowpass",label:"Low-pass",group:"filter",description:"Remove high frequencies \\u2014 darkens or muffles a track.",params:[vn("frequency","Cutoff",8e3,100,2e4),uo(.707),Cl],web:"biquad-lowpass"},{id:"compressor",label:"Compressor",group:"dynamics",description:"Pull loud parts down so the quiet ones can come up.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-60,max:0,step:.5,default:-24,hint:"Level above which the compressor starts working."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:4},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:2e3,step:.1,default:20,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:250,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83,hint:"1 is a hard corner; higher eases into it."},{kind:"number",key:"makeup",label:"Makeup",unit:"dB",min:0,max:36,step:.1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1,hint:"Below 1 blends the dry signal back in."}],web:"worklet-compressor"},{id:"limiter",label:"Limiter",group:"dynamics",description:"Hard ceiling \\u2014 nothing gets past the limit.",params:[{kind:"number",key:"limit",label:"Ceiling",unit:"dB",min:-24,max:0,step:.1,default:-1},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.1,max:80,step:.1,default:5},{kind:"number",key:"release",label:"Release",unit:"ms",min:1,max:8e3,step:1,default:50,scale:"log"},{kind:"number",key:"level_out",label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0}],web:"worklet-limiter"},{id:"gate",label:"Noise Gate",group:"dynamics",description:"Silence the track when it drops below the threshold.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-80,max:0,step:.5,default:-35},{kind:"number",key:"range",label:"Range",unit:"dB",min:-80,max:0,step:.5,default:-24,hint:"How far down the gate pulls when closed."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:10},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:9e3,step:.1,default:1,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:100,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83}],web:"worklet-gate"},{id:"saturate",label:"Saturation",group:"nonlinear",description:"Soft-clip the waveform for warmth or outright distortion.",params:[{kind:"enum",key:"type",label:"Curve",options:[{value:"tanh",label:"Tanh"},{value:"atan",label:"Arctan"},{value:"cubic",label:"Cubic"},{value:"exp",label:"Exponential"},{value:"alg",label:"Algebraic"},{value:"quintic",label:"Quintic"},{value:"sin",label:"Sine"},{value:"erf",label:"Error function"},{value:"hard",label:"Hard clip"}],default:"tanh"},{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-40,max:0,step:.1,default:-6},{kind:"number",key:"output",automatable:!0,label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0},{kind:"number",key:"oversample",label:"Oversample",unit:"x",min:1,max:8,step:1,default:4,hint:"Higher costs more but keeps aliasing down."}],web:"waveshaper"},{id:"bitcrush",label:"Bitcrush",group:"nonlinear",description:"Drop bit depth and sample rate for a lo-fi, digital sound.",params:[{kind:"number",key:"bits",label:"Bit depth",unit:"bit",min:1,max:32,step:.1,default:8},{kind:"number",key:"samples",label:"Sample hold",unit:"x",min:1,max:250,step:1,default:1,hint:"Repeats each sample N times \\u2014 a crude downsample."},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-bitcrush"},{id:"pitchshift",label:"Pitch shift",group:"time",description:"Shifts pitch up or down without changing playback speed. Adds ~50 ms of latency.",params:[{kind:"number",key:"semitones",label:"Semitones",unit:"st",min:-12,max:12,step:1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-pitchshift"},{id:"delay",label:"Delay",group:"time",description:"Repeating echoes behind the dry signal.",params:[{kind:"number",key:"time",automatable:!0,label:"Time",unit:"ms",min:1,max:5e3,step:1,default:250,scale:"log"},{kind:"number",key:"feedback",automatable:!0,label:"Feedback",unit:"",min:.01,max:.95,step:.01,default:.35},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.4}],web:"delay-feedback"},{id:"chorus",label:"Chorus",group:"time",description:"Detuned copies of the signal for width and thickness.",params:[{kind:"number",key:"delay",automatable:!0,label:"Delay",unit:"ms",min:1,max:100,step:.1,default:7},{kind:"number",key:"depth",automatable:!0,label:"Depth",unit:"ms",min:0,max:10,step:.01,default:2},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.01,max:10,step:.01,default:1},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.5}],web:"chorus-lfo"},{id:"phaser",label:"Phaser",group:"time",description:"Sweeping notches moving through the spectrum.",params:[{kind:"number",key:"in_gain",automatable:!0,label:"Input",unit:"",min:0,max:1,step:.01,default:.4},{kind:"number",key:"out_gain",automatable:!0,label:"Output",unit:"",min:0,max:2,step:.01,default:.74},{kind:"number",key:"delay",label:"Delay",unit:"ms",min:.1,max:5,step:.1,default:3},{kind:"number",key:"decay",label:"Decay",unit:"",min:0,max:.99,step:.01,default:.4},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.1,max:2,step:.01,default:.5},{kind:"enum",key:"type",label:"Waveform",options:[{value:"0",label:"Triangular"},{value:"1",label:"Sinusoidal"}],default:"0"}],web:"allpass-phaser"},{id:"reverb",label:"Reverb",group:"time",description:"Room tail. Both ends convolve the same generated impulse, so preview matches render.",params:[{kind:"number",key:"size",label:"Room size",unit:"",min:.05,max:1,step:.01,default:.7},{kind:"number",key:"damping",label:"Damping",unit:"",min:0,max:1,step:.01,default:.5,hint:"Higher rolls the top off the tail faster."},{kind:"number",key:"wet",automatable:!0,label:"Wet",unit:"",min:0,max:1,step:.01,default:.35},{kind:"number",key:"dry",automatable:!0,label:"Dry",unit:"",min:0,max:1,step:.01,default:.7}],web:"convolver"}],co=new Map(Tl.map(e=>[e.id,e]));function Sn(e){return co.get(e)}var Nv=Tl.map(e=>e.id);function An(e,t){let n=co.get(e);if(!n)return{};let r={};for(let i of n.params){let o=t?.[i.key];if(i.kind==="enum"){let l=i.options.some(s=>s.value===o);r[i.key]=l?o:i.default;continue}let a=typeof o=="number"?o:typeof o=="string"&&o.trim()!==""?Number(o):Number.NaN;r[i.key]=Number.isFinite(a)?Math.min(i.max,Math.max(i.min,a)):i.default}return r}var ct=class extends Error{constructor(t){super(t),this.name="AudioFxChainError"}};function Rl(e){let t;try{t=JSON.parse(e)}catch(i){throw new ct(`Chain file is not valid JSON: ${i.message}`)}if(typeof t!="object"||t===null)throw new ct("Chain file must be a JSON object.");let n=t;if(n.version!==wl)throw new ct(`Unsupported chain version: ${String(n.version)}`);if(!Array.isArray(n.nodes))throw new ct("Chain file is missing a `nodes` array.");let r=n.nodes.map(Rp);return{version:wl,nodes:r}}function En(e){return e.nodes.filter(t=>t.enabled!==!1)}function Rp(e,t){if(typeof e!="object"||e===null)throw new ct(`Node ${t} is not an object.`);let n=e;if(typeof n.type!="string"||!co.has(n.type))throw new ct(`Node ${t} has unknown effect type: ${String(n.type)}`);return Mp({type:n.type,id:Dr(n.id),fromCarve:_l(n.fromCarve),fromPreset:Dr(n.fromPreset),label:Dr(n.label),fromEq:Dr(n.fromEq),fromLeveller:_l(n.fromLeveller),presetAmount:kp(n.presetAmount),enabled:n.enabled!==!1,params:An(n.type,n.params??void 0)})}function Dr(e){return typeof e=="string"&&e?e:void 0}function _l(e){return e===!0?!0:void 0}function kp(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(1,Math.max(0,e))}function Mp(e){for(let t of Object.keys(e))e[t]===void 0&&delete e[t];return e}var et="data-automation",Pv=et.slice(5),Ir=1,Fp=512,Ze=class extends Error{constructor(t){super(t),this.name="AudioAutomationError"}},Bt="volume";function Cn(e){if(e===Bt)return{kind:"volume"};let t=e.split(".");if(t.length===3&&t[0]==="fx"&&t[1]===Np){let i=t[2];return i?{kind:"preset",presetId:i}:null}if(t.length!==3||t[0]!=="fx")return null;let[,n,r]=t;return!n||!r?null:{kind:"fx",nodeId:n,param:r}}var Np="preset";var Lp={min:0,max:1,step:.01,unit:"",label:"Amount",scale:"linear",default:1},Pr={min:0,max:so,step:.01,unit:"",label:"Volume",scale:"linear",default:1};function fo(e,t){let n=Cn(e);if(!n)return null;if(n.kind==="volume")return Pr;if(n.kind==="preset")return t?.nodes.some(l=>l.fromPreset===n.presetId)?{...Lp,label:`${n.presetId} \\xB7 Amount`}:null;let r=t?.nodes.find(a=>a.id===n.nodeId);if(!r)return null;let i=Sn(r.type),o=i?.params.find(a=>a.key===n.param);return!o||o.kind!=="number"?null:{min:o.min,max:o.max,step:o.step,unit:o.unit,label:`${i?.label??r.type} \\xB7 ${o.label}`,scale:o.scale==="log"&&o.min>0?"log":"linear",default:o.default}}function wn(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null}function Dp(e){let t=wn(e);return t===null||t===0?0:Math.min(1,Math.max(-1,t))}function kl(e,t){let n=wn(e),r=wn(t);if(n===null||r===null)return null;let i=l=>Math.min(.999,Math.max(.001,l)),o=i(n),a=i(r);return Math.abs(o-a)<1e-6?null:{x:o,y:a}}function Ip(e){let t=Dp(e?.curve),n=kl(e?.viaX,e?.viaY);return{...t?{curve:t}:{},...n?{viaX:n.x,viaY:n.y}:{}}}function Pp(e,t){let n=wn(e?.t),r=wn(e?.v);if(n===null||r===null)return null;let i=t?Math.min(t.max,Math.max(t.min,r)):r;return{t:Math.max(0,n),v:i,...Ip(e)}}function Ml(e,t){let n=e.map(i=>Pp(i,t)).filter(i=>i!==null).sort((i,o)=>i.t-o.t),r=[];for(let i of n)r.length>0&&r[r.length-1].t===i.t?r[r.length-1]=i:r.push(i);return r.slice(0,Fp)}function Op(e){let t=[];for(let n of e.lanes){if(!Cn(n.target))continue;let r=n.target===Bt?Pr:null,i=Ml(n.points??[],r);i.length>0&&t.push({target:n.target,points:i})}return{version:Ir,lanes:t}}function Fl(e,t){let n=[];for(let r of e.lanes){let i=fo(r.target,t);if(!i)continue;let o=Ml(r.points,i);o.length>0&&n.push({target:r.target,points:o})}return{version:Ir,lanes:n}}function Or(e){let t;try{t=JSON.parse(e)}catch(i){throw new Ze(`Automation is not valid JSON: ${i.message}`)}if(typeof t!="object"||t===null)throw new Ze("Automation must be a JSON object.");let n=t;if(n.version!==Ir)throw new Ze(`Unsupported automation version: ${String(n.version)}`);if(!Array.isArray(n.lanes))throw new Ze("Automation is missing a `lanes` array.");let r=n.lanes.map((i,o)=>{if(typeof i!="object"||i===null)throw new Ze(`Lane ${o} is not an object.`);let a=i;if(typeof a.target!="string"||!Cn(a.target))throw new Ze(`Lane ${o} has an unreadable target: ${String(a.target)}`);if(!Array.isArray(a.points))throw new Ze(`Lane ${o} is missing a \\`points\\` array.`);return{target:a.target,points:a.points}});return Op({version:Ir,lanes:r})}function Hp(e,t){return t?Math.pow(e,Math.pow(2,2*t)):e}function Gp(e,t){let n=e-.5,r=t-.5,i=.999,o=1e6,a=n>0?n/(i-e):n<0?-n/(e-(1-i)):0,l=r>0?r/(i-t):r<0?-r/(t-(1-i)):0,s=Math.min(o,Math.max(1,a,l));return{cx:e+n/s,cy:t+r/s,w:s}}function Bp(e,t,n){let{cx:r,cy:i,w:o}=Gp(t,n),a=2-2*o,l=e*a-1+2*o*r,s=-e*a-2*o*r,u=Up(l,s,e),c=1-u,f=c*c+2*o*u*c+u*u;return f>0?(2*o*i*u*c+u*u)/f:e}function Up(e,t,n){if(Math.abs(e)<1e-12)return Math.abs(t)<1e-12?n:-n/t;let r=Math.sqrt(Math.max(0,t*t-4*e*n)),i=(-t+r)/(2*e),o=(-t-r)/(2*e),a=l=>l>=-1e-9&&l<=1+1e-9;return a(i)?Math.min(1,Math.max(0,i)):a(o)?Math.min(1,Math.max(0,o)):n}function Wp(e,t){let n=kl(t.viaX,t.viaY);return n?Bp(Math.min(1,Math.max(0,e)),n.x,n.y):Hp(e,t.curve)}function Vp(e,t,n,r){return r==="log"&&e>0&&t>0?Math.exp(Math.log(e)+(Math.log(t)-Math.log(e))*n):e+(t-e)*n}function _n(e,t,n="linear"){let r=e.points;if(r.length===0)return 0;let i=r[0];if(t<=i.t)return i.v;let o=r[r.length-1];if(t>=o.t)return o.v;let a=0,l=r.length-1;for(;l-a>1;){let f=a+l>>1;r[f].t<=t?a=f:l=f}let s=r[a],u=r[l],c=u.t-s.t;return c<=0?u.v:Vp(s.v,u.v,Wp((t-s.t)/c,s),n)}function Nl(e){return e.points.length<=1||e.points.every(t=>t.v===e.points[0].v)}function Ll(e,t,n,r,i="linear"){let o=Math.max(2,Math.floor(r)),a=new Float32Array(o),l=n-t;for(let s=0;s<o;s+=1)a[s]=_n(e,t+l*s/(o-1),i);return a}var Hr=new Map,zp=64;function qp(e){let t=Hr.get(e);if(t!==void 0)return t;let n=null;try{n=Or(e).lanes.find(r=>r.target===Bt)??null}catch{n=null}return Hr.size>zp&&Hr.clear(),Hr.set(e,n),n}function Dl(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(et):null)??"";if(!n)return null;let r=qp(n);return!r||r.points.length===0?null:_n(r,t)}var Ut="hf-audio-group",Gr="data-audio-group";function mo(e){let t=e?.getAttribute("data-volume"),n=t?parseFloat(t):1;return Number.isFinite(n)?n:1}function po(e,t){let n=Array.from(e?.querySelectorAll?.(`${Ut}[${xn}]`)??[]).find(i=>i.getAttribute(xn)===t);if(n)return n;let r=e?.getElementById(t)??null;return r&&r.tagName?.toLowerCase()===Ut?r:null}function Br(e,t){let n=t?.getAttribute?.(dl)??t?.getAttribute?.(Gr);return n?po(e,n)?.hasAttribute("data-hidden")??!1:!1}function Il(e){return typeof e.tagName!="string"||e.tagName.toLowerCase()!=="audio"||typeof e.getAttribute!="function"?null:e.getAttribute(Gr)||null}function Pl(e){let t="__hf-audio-group-inert";if(!e?.head||e.getElementById(t))return;let n=e.createElement("style");n.id=t,n.textContent=`${Ut}{display:none!important}`,e.head.appendChild(n)}function $e(e){return yn(e)}function Ol(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 Hl(e){let t=Array.from(document.querySelectorAll("video, audio")),n=e?.shouldIncludeElement?t.filter(a=>e.shouldIncludeElement?.(a)):t.filter(a=>a.hasAttribute("data-start")),r=[],i=[],o=0;for(let a of n){let l=e?.resolveStartSeconds?e.resolveStartSeconds(a):Number.parseFloat(a.dataset.start??"0");if(!Number.isFinite(l))continue;let s=$e(a),u=_e(a),c=a.loop,f=Number.isFinite(a.duration)&&a.duration>0?a.duration:null,m=e?.resolveDurationSeconds?.(a)??Number.parseFloat(a.dataset.duration??"");(!Number.isFinite(m)||m<0)&&f!=null&&(m=Math.max(0,(f-s)/u));let p=Number.isFinite(m)&&m>=0,b=p?l+m:Number.POSITIVE_INFINITY,v=Number.parseFloat(a.dataset.volume??""),x={el:a,start:l,mediaStart:s,duration:p?m:Number.POSITIVE_INFINITY,end:b,volume:Number.isFinite(v)?v:null,playbackRate:u,loop:c,sourceDuration:f};r.push(x),a.tagName==="VIDEO"&&i.push(x),Number.isFinite(b)&&(o=Math.max(o,b))}return{timedMediaEls:n,mediaClips:r,videoClips:i,maxMediaEnd:o}}var go=new WeakMap,Ur=new WeakMap,Tn=new WeakMap,bo=new WeakSet,Wt=new WeakSet;function $p(e){if(Wt.has(e))return;Wt.add(e);let t=()=>Wt.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}var jp=3;function Kp(e){return e.error!=null||e.networkState===jp}var xo=new WeakMap;function ho(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function yo(e){go.delete(e),Ur.delete(e),Tn.delete(e),bo.delete(e),xo.delete(e)}function Gl(e){let t=!!(e.outputMuted||e.userMuted);for(let n of e.clips){let{el:r}=n;if(!r.isConnected)continue;let i=(e.timeSeconds-n.start)*n.playbackRate+n.mediaStart,o=r.tagName==="VIDEO"&&!n.loop,a=o&&n.sourceDuration!=null&&i>=n.sourceDuration&&e.timeSeconds>=n.start&&e.timeSeconds<n.end;a&&n.sourceDuration!=null&&(i=n.sourceDuration);let l=Ur.get(r),s=r.tagName==="AUDIO"&&(l===void 0||i<l-.04),u=!n.loop&&n.sourceDuration!=null&&i>=n.mediaStart&&i<n.sourceDuration&&(o||s);if(e.timeSeconds>=n.start&&e.timeSeconds<n.end&&i>=0&&(!r.ended||n.loop||a||u)){if(Ur.set(r,i),n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let H=n.sourceDuration-n.mediaStart;H>0&&i>=n.sourceDuration&&(i=n.mediaStart+(i-n.mediaStart)%H)}let m=ho(e.userVolume??1),p=Le(n.volume??1),b=xo.get(r),v=ho(r.volume),x,_=Dl(r,e.timeSeconds-n.start);if(_!==null)x=Le(_);else if(n.volumeKeyframes&&n.volumeKeyframes.length>0){let H=e.timeSeconds-n.start;x=Le(Sl(n.volumeKeyframes,H))}else e.isWebAudioRouted?.(r)?x=p:b===void 0?x=p>1?p:v:Math.abs(v-b)>1e-4?x=v:x=p;let T=r.closest("[data-hidden]")!==null||Br(r.ownerDocument,r)?0:ho(x*m);r.volume=T,xo.set(r,T),e.onElementVolume?.(r,T,x),(t||e.isWebAudioOwned?.(r))&&(r.muted=!0),r.preload!=="auto"&&(r.preload="auto");try{r.playbackRate=n.playbackRate*e.playbackRate}catch(H){L("runtime.media.site1",H)}let M=.04,D=2,E=r.currentTime||0,S=Math.abs(E-i),A=i-E,C=go.get(r);go.set(r,A);let F=C===void 0,I=!F&&Math.abs(A-C)>.5,q=S>3,W=r.tagName==="AUDIO"&&F&&E-i>M,Y=a&&S>.001||r.ended&&u&&S>.001||W||S>.5&&(F||I||q),k=r.tagName==="VIDEO"&&!r.paused,U=C!==void 0&&Math.abs(A-C)<.004,ie=!1;if(!k&&!Y&&!F&&U&&S>M){let H=(Tn.get(r)??0)+1;Tn.set(r,H),H>=D&&(ie=!0,Tn.set(r,0))}else S<=M&&Tn.set(r,0);let P=!k&&e.forceSync&&S>.02;if(Y||ie||P){if(!(r.tagName==="VIDEO"&&!!ut(r))){try{r.currentTime=i}catch(V){L("runtime.media.site2",V)}if(Math.abs(r.currentTime-i)>.5&&!bo.has(r)){bo.add(r),r.load();try{r.currentTime=i}catch(V){L("runtime.media.site3",V)}}}Wt.delete(r)}a?r.paused||r.pause():e.playing&&r.paused&&!Wt.has(r)&&!Kp(r)?($p(r),r.play().catch(H=>{Wt.delete(r),(H&&typeof H=="object"&&"name"in H?String(H.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!e.playing&&!r.paused&&r.pause();continue}let f=e.timeSeconds>=n.start&&e.timeSeconds<n.end;yo(r),f&&Ur.set(r,i),r.paused||r.pause()}}var Yp="hf-proxy",Bl="runtime_media_proxy_fallback",Ul="runtime_media_proxy_unavailable",Rn=new WeakSet,Wl=new WeakSet;function Wr(e){return e.currentSrc||e.src}function vo(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:e instanceof HTMLVideoElement&&!!ut(e)}function So(e){let t=Wr(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 Xp(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 Jp(e,t){let n=e.normalize("NFC").toLowerCase(),r=-1,i=null,o=!1;for(let[a,l]of Object.entries(t)){let s=a.normalize("NFC").toLowerCase();n.endsWith(s)&&(s.length>r?(r=s.length,i=l,o=!1):s.length===r&&(o=!0))}return o?null:i}function Ao(e,t){return t[e]??Xp(e,t)??Jp(e,t)}function Qp(e,t){let n=new URL(e,document.baseURI);return n.searchParams.set(Yp,t?t.hasAlpha?"vp8":"h264":"auto"),n.href}var Zp={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 Rt(e,t,n){if(Wl.has(e))return;Wl.add(e);let r=Zp[t];be({source:"hf-preview",type:"diagnostic",code:Ul,details:{asset:n,codecName:null,reason:t,note:r}}),console.info(`[hyperframes] ${Ul}: "${n}" (${t}): ${r}`)}function Eo(e,t=null,n="reactive"){if(Rn.has(e))return;let r=Wr(e),i;try{i=Qp(r,t)}catch(l){L("runtime.mediaProxy.swap",l),Rt(e,"invalid_source_url",r);return}Rn.add(e),yo(e),e.src=i,e.load();let o=t?.codecName??null;be({source:"hf-preview",type:"diagnostic",code:Bl,details:{asset:r,codecName:o,trigger:n,note:"render output is unaffected; only this preview element was swapped to an authoring proxy"}}),console.info(`[hyperframes] ${Bl}: "${r}" uses a codec (${o??"unknown"}) this browser can\'t decode; auto-swapped to an authoring proxy for this preview only. Render output is unaffected.`)}function Vl(e){if(vo(e)||!(e instanceof HTMLVideoElement)||Rn.has(e))return;let t=window.__HF_MEDIA_CODEC_MAP__;if(!t)return;let n=So(e);if(n===null)return;let r=Ao(n,t);if(!r||!r.browserHostile)return;let i=r.representativeMime?e.canPlayType(r.representativeMime):"";i==="probably"||i==="maybe"||Eo(e,r,"proactive")}function zl(e){if(vo(e)||!(e instanceof HTMLVideoElement)||e.videoWidth!==0)return;let t=Wr(e);if(Rn.has(e)){Rt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=So(e);if(r===null){Rt(e,"cross_origin",t);return}let i=Ao(r,n);if(i&&!i.browserHostile){Rt(e,"browser_safe_codec",t);return}Eo(e,i,"reactive")}function ql(e){if(vo(e)||!(e instanceof HTMLVideoElement))return;let t=Wr(e);if(Rn.has(e)){Rt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=So(e);if(r===null){Rt(e,"cross_origin",t);return}let i=Ao(r,n);if(i&&!i.browserHostile){Rt(e,"browser_safe_codec",t);return}Eo(e,i,"tertiary")}var Se=class extends Error{constructor(n,r=null){super(r==null?n:`${n} at line ${r}`);ge(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=r}},eh=[0,0,0],th=[1,1,1],Vr=64;function nh(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r===\'"\'&&(t=!t),r==="#"&&!t)return e.slice(0,n)}return e}function dt(e,t){let n=Number(e);if(!Number.isFinite(n))throw new Se(`Invalid number "${e}"`,t);return n}function $l(e,t,n){if(e.length!==3)throw new Se(`${t} expects three numbers`,n);return[dt(e[0],n),dt(e[1],n),dt(e[2],n)]}function jl(e,t,n){if(!e)throw new Se(`${t} expects a size`,n);let r=Number(e);if(!Number.isInteger(r)||r<2)throw new Se(`${t} must be an integer greater than 1`,n);return r}function rh(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new Se("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function ih(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 oh(e){return/^[+-]?(?:\\d|\\.\\d)/.test(e)}function Kl(e,t={}){let n=t.maxSize??Vr,r=null,i=eh,o=th,a=null,l=null,s=[],u=e.replace(/^\\uFEFF/,"").split(/\\r?\\n/);for(let f=0;f<u.length;f++){let m=f+1,p=nh(u[f]??"").trim();if(!p)continue;let b=p.split(/\\s+/),v=(b[0]??"").toUpperCase(),x=b.slice(1);if(v==="TITLE"){r=ih(p);continue}if(v==="DOMAIN_MIN"){i=$l(x,v,m);continue}if(v==="DOMAIN_MAX"){o=$l(x,v,m);continue}if(v==="LUT_3D_INPUT_RANGE"){if(x.length!==2)throw new Se(`${v} expects two numbers`,m);let _=dt(x[0],m),R=dt(x[1],m);if(R<=_)throw new Se("LUT_3D_INPUT_RANGE max must exceed min",m);i=[_,_,_],o=[R,R,R];continue}if(v==="LUT_1D_SIZE"){a=jl(x[0],v,m);continue}if(v==="LUT_3D_SIZE"){if(l=jl(x[0],v,m),l>n)throw new Se(`LUT_3D_SIZE ${l} exceeds max ${n}`,m);continue}if(!oh(v)){if(v.startsWith("LUT_"))throw new Se(`Unsupported cube keyword ${v}`,m);continue}if(!l)throw a?new Se("1D cube LUTs are not supported yet",m):new Se("LUT data appears before LUT_3D_SIZE",m);if(b.length!==3)throw new Se("LUT data rows must contain three numbers",m);s.push(dt(b[0],m),dt(b[1],m),dt(b[2],m))}if(a&&l)throw new Se("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw a?new Se("1D cube LUTs are not supported yet"):new Se("Missing LUT_3D_SIZE");rh(i,o);let c=l*l*l;if(s.length!==c*3)throw new Se(`Expected ${c} LUT rows for size ${l}, found ${s.length/3}`);return{title:r,size:l,domainMin:i,domainMax:o,data:new Float32Array(s)}}function ah(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function kn(e){return Math.round(ah(e)*255)}function wo(e){let t=e.size,n=t*t,r=t,i=new Uint8Array(n*r*4);for(let o=0;o<t;o++)for(let a=0;a<t;a++)for(let l=0;l<t;l++){let s=((o*t+a)*t+l)*3,u=(a*n+o*t+l)*4;i[u]=kn(e.data[s]??0),i[u+1]=kn(e.data[s+1]??0),i[u+2]=kn(e.data[s+2]??0),i[u+3]=255}return{width:n,height:r,data:i}}var Yl="rec709";var me={hueDegrees:{min:0,max:360,inclusiveMax:!1},unit:{min:0,max:1},signedUnit:{min:-1,max:1},secondaryHueRange:{min:0,max:180},secondaryHueSoftness:{min:0,max:180},secondaryHueCombinedMax:180,secondarySoftRangeSoftness:{min:0,max:.5},secondaryHueShift:{min:-180,max:180},effects:{asciiStyle:{min:0,max:7},bloom:{min:0,max:3},bloomRadius:{min:1,max:100},monoScreenShape:{min:0,max:4}}};var Xl=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"],Jl=["shadows","midtones","highlights"],Ql=["master","red","green","blue"],Zl=["hueVsHue","hueVsSaturation","hueVsLuma"];var eu=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],tu=["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 aS=me.unit,sS=me.signedUnit,lS=me.effects;var je=1024,Mn=16;function nu(e,t,n,r){let i=((2*e+t)*n-e*r)/(e+t);return Math.sign(i)!==Math.sign(n)?0:Math.sign(n)!==Math.sign(r)&&Math.abs(i)>3*Math.abs(n)?3*n:i}function Ae(e,t){let n=e[t];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function sh(e){let t=[],n=[],r=Ae(e,0);for(let a of e.slice(1)){let l=a[0]-r[0];t.push(l),n.push((a[1]-r[1])/l),r=a}let i=Ae(n,0);if(e.length===2)return[i,i];let o=new Array(e.length);o[0]=nu(Ae(t,0),Ae(t,1),i,Ae(n,1)),o[o.length-1]=nu(Ae(t,t.length-1),Ae(t,t.length-2),Ae(n,n.length-1),Ae(n,n.length-2));for(let a=1;a<e.length-1;a+=1){let l=Ae(n,a-1),s=Ae(n,a);if(l===0||s===0||Math.sign(l)!==Math.sign(s)){o[a]=0;continue}let u=Ae(t,a-1),c=Ae(t,a),f=2*c+u,m=c+2*u;o[a]=(f+m)/(f/l+m/s)}return o}function ru(e,t){if(e.length<2)throw new RangeError("A color curve requires at least two points");if(!Number.isInteger(t)||t<2)throw new RangeError("Curve LUT size must be at least 2");let n=Number.NEGATIVE_INFINITY;for(let[r,i]of e){if(!Number.isFinite(r)||!Number.isFinite(i))throw new TypeError("Color curve points must be finite");if(r<=n)throw new RangeError("Color curve inputs must be strictly increasing");n=r}}function lh(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 uh(e,t,n,r,i){let o=n[0]-t[0],a=Math.min(1,Math.max(0,(e-t[0])/o)),l=a*a,s=l*a;return(2*s-3*l+1)*t[1]+(s-2*l+a)*o*r+(-2*s+3*l)*n[1]+(s-l)*o*i}function iu(e,t,n,r,i){lh(e,r,i);let o=sh(e),a=new Float32Array(t),l=0;for(let s=0;s<t;s+=1){let u=n(s);for(;l<e.length-2&&u>Ae(e,l+1)[0];)l+=1;let c=Ae(e,l),f=Ae(e,l+1),m=uh(u,c,f,Ae(o,l),Ae(o,l+1));a[s]=Math.min(i,Math.max(r,m))}return a}function Vt(e,t=je){if(ru(e,t),e.length>Mn)throw new RangeError(`A color curve supports at most ${Mn} points`);if(e.some(([n])=>n<0||n>1))throw new RangeError("Color curve inputs must be between 0 and 1");if(e[0]?.[0]!==0||e[e.length-1]?.[0]!==1)throw new RangeError("Color curves must include input endpoints 0 and 1");return iu(e,t,n=>n/(t-1),0,1)}function _o(e,t,n,r=je){if(e.length<3)throw new RangeError("A hue curve requires at least three points");if(e.length>Mn)throw new RangeError(`A hue curve supports at most ${Mn} points`);let i=[...e].sort((s,u)=>s[0]-u[0]);for(let s=0;s<i.length;s+=1){let u=i[s];if(!u||u[0]<0||u[0]>=360)throw new RangeError("Hue curve inputs must be from 0 up to 360 degrees");if(s>0&&u[0]===i[s-1]?.[0])throw new RangeError("Hue curve inputs must be unique")}let o=i.slice(-2).map(([s,u])=>[s-360,u]),a=i.slice(0,2).map(([s,u])=>[s+360,u]),l=[...o,...i,...a];return ru(l,r),iu(l,r,s=>s/r*360,t,n)}var Fn="data-color-grading",Nn="data-hf-color-grading-source-hidden",$r="data-hf-authored-opacity",uu="__hf_color_grading_",dh=Yl,ko={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},Mo={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},Fo={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 jr=Xl,cu=Jl,du=Ql,fu=Zl,Lo=eu,Do=tu,ou={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},au={vignette:.18};function Ee(e,t,n={},r={},i={},o=1){return{id:e,label:t,intensity:o,adjust:{...ko,...n},details:{...Mo,...r},effects:{...Fo,...i}}}var Io=[Ee("neutral","Neutral"),Ee("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),Ee("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),Ee("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),Ee("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),Ee("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),Ee("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),Ee("vintage-wash","Vintage Wash",ou,au),Ee("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),Ee("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),Ee("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),Ee("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),Ee("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),Ee("creator-camcorder","Creator Camcorder",{contrast:.08,highlights:-.05,shadows:.02,whites:.03,blacks:-.04,temperature:-.03,tint:-.015,vibrance:-.03,saturation:-.06},{vignette:.06,grain:.08,grainSize:.18,grainRoughness:.58},{chromaBleed:.55},.72),Ee("vhs-playback","VHS Playback",{contrast:-.04,saturation:-.08},{grain:.16,grainSize:.12,grainRoughness:.72},{tapeDamage:.82,tapeTracking:.85,tapeNoise:.3,tapeSpeed:.5,chromaBleed:.5,chromaticAberration:.18,scanlines:.35,scanlineCount:.17,scanlineSoftness:1,digitalGlitch:.32,digitalGlitchLineTear:.08,digitalGlitchSpeed:.5}),Ee("home-movie-8mm","8mm Home Movie",ou,{...au,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),Ee("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),Ee("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],fh=new Map(Io.map(e=>[e.id,e])),mh=/^\\$(?:\\{([A-Za-z0-9_.:-]+)\\}|([A-Za-z0-9_.:-]+))$/,ph={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}},zt={hue:0,amount:0,level:0},su={amount:me.unit,level:me.signedUnit},ft=[[0,0],[1,1]],qt=[],hh={hueVsHue:me.secondaryHueShift,hueVsSaturation:me.signedUnit,hueVsLuma:me.signedUnit},To={center:0,range:180,softness:0},Ro={min:0,max:1,softness:.05},gh={vignette:me.unit,vignetteMidpoint:me.unit,vignetteRoundness:me.signedUnit,vignetteFeather:me.unit,grain:me.unit,grainSize:me.unit,grainRoughness:me.unit},No=me.unit,bh=me.effects,mu=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"];var xh=Io.filter(e=>mu.some(t=>e.effects[t]>1e-4)),gS=Io.filter(e=>!xh.includes(e)),bS={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}},pu=[{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 yh=/^#[0-9a-f]{6}$/i;function vh(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&yh.test(t))?null:e.map(t=>t.toLowerCase())}function Te(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function qr(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function hu(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function Re(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?qr(n,t.min,t.max):0}function Po(e,t=0){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?(n%360+360)%360:t}function Sh(e){let t=Te(e)?e:{};return cu.reduce((n,r)=>{let i=Te(t[r])?t[r]:{};return n[r]={hue:Po(i.hue,zt.hue),amount:Re(i.amount??zt.amount,su.amount),level:Re(i.level??zt.level,su.level)},n},{shadows:{...zt},midtones:{...zt},highlights:{...zt}})}function Ah(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)?[qr(t,0,1),qr(n,0,1)]:null}function gu(e){return e.some((t,n)=>n>0&&t[0]===e[n-1]?.[0])}function Eh(e){(e[0]?.[0]??0)>0&&e.unshift([0,0]),(e.at(-1)?.[0]??1)<1&&e.push([1,1])}function wh(e){if(!Array.isArray(e)||e.length<2)return ft;let t=[];for(let n of e){let r=Ah(n);if(!r)return ft;t.push(r)}return t.sort((n,r)=>n[0]-r[0]),gu(t)||(Eh(t),t.length>16)?ft:t}function Ch(e){let t=Te(e)?e:{};return du.reduce((n,r)=>(n[r]=wh(t[r]),n),{master:ft,red:ft,green:ft,blue:ft})}function _h(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)?[Po(n),qr(r,t.min,t.max)]:null}function Th(e,t){if(!Array.isArray(e)||e.length<3||e.length>16)return qt;let n=[];for(let r of e){let i=_h(r,t);if(!i)return qt;n.push(i)}return n.sort((r,i)=>r[0]-i[0]),gu(n)?qt:n}function Rh(e){let t=Te(e)?e:{};return fu.reduce((n,r)=>(n[r]=Th(t[r],hh[r]),n),{hueVsHue:qt,hueVsSaturation:qt,hueVsLuma:qt})}function lu(e){let t=Te(e)?e:{},n=Re(t.min??Ro.min,No),r=Re(t.max??Ro.max,No);return{min:Math.min(n,r),max:Math.max(n,r),softness:Re(t.softness??Ro.softness,me.secondarySoftRangeSoftness)}}function kh(e){let t=Te(e)?e:{},n=Re(t.range??To.range,me.secondaryHueRange);return{center:Po(t.center,To.center),range:n,softness:Re(t.softness??To.softness,{min:me.secondaryHueSoftness.min,max:me.secondaryHueCombinedMax-n})}}function Mh(e){return{hueShift:Re(e.hueShift??0,me.secondaryHueShift),saturation:Re(e.saturation??0,me.signedUnit),luma:Re(e.luma??0,me.signedUnit),temperature:Re(e.temperature??0,me.signedUnit),tint:Re(e.tint??0,me.signedUnit)}}function Fh(e){return!Te(e)||!Te(e.key)||!Te(e.correction)?null:{enabled:e.enabled!==!1,key:{hue:kh(e.key.hue),saturation:lu(e.key.saturation),luma:lu(e.key.luma)},correction:Mh(e.correction)}}function Nh(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,4)){let r=Fh(n);r&&t.push(r)}return t}function Lh(e){if(e==null)return null;let t=String(e).trim();return t||null}function Dh(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!Te(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:hu(e.intensity,1)}}function Ih(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return Te(n)?n:null}catch{return null}return{preset:t}}return Te(e)?e:null}function Ph(e,t){let n=e.trim().match(mh);if(!n)return e;let r=n[1]??n[2]??"";return r&&Object.hasOwn(t,r)?t[r]:e}function zr(e,t){if(typeof e=="string"){let r=Ph(e,t);if(r!==e)return r;let i=e.trim();if(!i.startsWith("{"))return e;try{return zr(JSON.parse(i),t)}catch{return e}}if(Array.isArray(e))return e.map(r=>zr(r,t));if(!Te(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=zr(i,t);return n}function Oh(e){return e?fh.get(e)??null:null}function Kr(e){let t=Ih(e);if(!t||t.enabled===!1)return null;let n=Lh(t.preset),r=Oh(n),i=r?.adjust??ko,o=r?.details??Mo,a=r?.effects??Fo,l=Te(t.adjust)?t.adjust:{},s=Te(t.details)?t.details:{},u=Te(t.effects)?t.effects:{},c=jr.reduce((p,b)=>(p[b]=Re(l[b]??i[b],ph[b]),p),{...ko}),f=Lo.reduce((p,b)=>(p[b]=Re(s[b]??o[b],gh[b]),p),{...Mo}),m=Do.reduce((p,b)=>(p[b]=Re(u[b]??a[b],bh[b]??No),p),{...Fo});return{enabled:!0,preset:n,intensity:hu(t.intensity,r?.intensity??1),adjust:c,wheels:Sh(t.wheels),curves:Ch(t.curves),hueCurves:Rh(t.hueCurves),secondaries:Nh(t.secondaries),details:f,effects:m,palette:vh(t.palette),lut:Dh(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():dh}}function bu(e,t){return Kr(zr(e,t))}function Hh(e){return cu.some(t=>Math.abs(e[t].amount)>1e-4||Math.abs(e[t].level)>1e-4)}function Oo(e){return du.some(t=>e[t].some(([n,r])=>Math.abs(n-r)>1e-4))}function Ho(e){return fu.some(t=>e[t].some(([,n])=>Math.abs(n)>1e-4))}function Go(e){return e.some(t=>t.enabled&&Object.values(t.correction).some(n=>Math.abs(n)>1e-4))}function xu(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||mu.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:jr.some(n=>Math.abs(e.adjust[n])>1e-4)||(e.wheels?Hh(e.wheels):!1)||(e.curves?Oo(e.curves):!1)||(e.hueCurves?Ho(e.hueCurves):!1)||(e.secondaries?Go(e.secondaries):!1):!1}var Gh=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),Bh=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function yu(e){let t=!1,n=null,r=null,i=null,o=null;function a(S,A){try{window.dispatchEvent(new CustomEvent(S,{detail:A}))}catch(C){L("runtime.picker.site1",C)}}function l(S){i=S,a("hyperframe:picker:hovered",{elementInfo:i,isPickMode:t,timestamp:Date.now()})}function s(S){o=S,a("hyperframe:picker:selected",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function u(S){let A=S.ownerDocument.defaultView;if(!A)return!1;let C=S;for(;C&&C!==document.body&&C!==document.documentElement;){let F=A.getComputedStyle(C);if(F.display==="none"||F.visibility==="hidden"||F.pointerEvents==="none")return!0;let I=Number.parseFloat(F.opacity);if(Number.isFinite(I)&&I<=.01&&!C.hasAttribute(Nn))return!0;C=C.parentElement}return!1}function c(S){if(!S||S===document.body||S===document.documentElement)return!1;let A=S.tagName.toLowerCase();return!(A==="script"||A==="style"||A==="link"||A==="meta"||S.classList.contains("__hf-pick-highlight")||S.closest(Gh)||u(S))}function f(S){return!!S?.closest(Bh)}function m(S){let A=S;if(A.id)return`#${CSS.escape(A.id)}`;let C=S.getAttribute("data-composition-id");if(C)return`[data-composition-id="${CSS.escape(C)}"]`;let F=S.getAttribute("data-composition-src");if(F)return`[data-composition-src="${CSS.escape(F)}"]`;let I=S.getAttribute("data-track-index");if(I)return`[data-track-index="${CSS.escape(I)}"]`;let q=S.tagName.toLowerCase(),W=S.parentElement;if(!W)return q;let Y=W.querySelectorAll(`:scope > ${q}`);if(Y.length===1)return q;for(let k=0;k<Y.length;k+=1)if(Y[k]===S)return`${q}:nth-of-type(${k+1})`;return q}function p(S){let A=S.tagName.toLowerCase(),C=(S.textContent??"").trim().replace(/\\s+/g," "),F=(I,q)=>I.length>q?`${I.slice(0,q-1)}\\u2026`:I;return A==="h1"||A==="h2"||A==="h3"?"Heading":A==="p"||A==="span"||A==="div"?C.length>0?F(C,56):"Text":A==="img"?"Image":A==="video"?"Video":A==="audio"?"Audio":A==="svg"?"Shape":S.getAttribute("data-composition-src")?"Composition":A==="section"?"Section":`${A.charAt(0).toUpperCase()}${A.slice(1)}`}function b(S,A,C){let F=typeof C=="number"&&C>0?C:8,I=[];if(document.elementsFromPoint)I=document.elementsFromPoint(S,A);else if(document.elementFromPoint){let Y=document.elementFromPoint(S,A);I=Y?[Y]:[]}if(f(I[0]??null))return[];let q={},W=[];for(let[Y,k]of I.entries()){if(!c(k))continue;let U=`${k.tagName}::${k.id||""}::${Y}`;if(!q[U]&&(q[U]=!0,W.push(k),W.length>=F))break}return W}function v(S){let A=S.getBoundingClientRect(),C={};for(let I of Array.from(S.attributes))I.name.startsWith("data-")&&(C[I.name]=I.value);return{id:S.id||null,tagName:S.tagName.toLowerCase(),selector:m(S),label:p(S),boundingBox:{x:A.left,y:A.top,width:A.width,height:A.height},textContent:S.textContent?S.textContent.trim().slice(0,200):null,src:S.getAttribute("src")||S.getAttribute("data-composition-src")||null,dataAttributes:C}}function x(S,A,C){return b(S,A,C).map(v)}function _(S){if(!t)return;let C=b(S.clientX,S.clientY,1)[0]??(S.target instanceof Element?S.target:null);if(!c(C)||n===C)return;n&&n.classList.remove("__hf-pick-highlight"),n=C,C.classList.add("__hf-pick-highlight");let F=v(C);l(F),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:F})}function R(S){if(!t)return;S.preventDefault(),S.stopPropagation(),S.stopImmediatePropagation();let A=x(S.clientX,S.clientY,8);A.length!==0&&(l(A[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:A,selectedIndex:0,point:{x:S.clientX,y:S.clientY}}))}function T(S){S.key==="Escape"&&(D(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function M(){t||(t=!0,r=document.createElement("style"),r.textContent=[".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",".__hf-pick-active * { cursor: crosshair !important; }"].join(`\n`),document.head.appendChild(r),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",_,!0),document.addEventListener("click",R,!0),document.addEventListener("keydown",T,!0),a("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function D(){t&&(t=!1,n&&(n.classList.remove("__hf-pick-highlight"),n=null),r&&(r.remove(),r=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",_,!0),document.removeEventListener("click",R,!0),document.removeEventListener("keydown",T,!0),a("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function E(){window.__HF_PICKER_API={enable:M,disable:D,isActive:()=>t,getHovered:()=>i,getSelected:()=>o,getCandidatesAtPoint:(S,A,C)=>Number.isFinite(S)&&Number.isFinite(A)?x(S,A,C):[],pickAtPoint:(S,A,C)=>{if(!Number.isFinite(S)||!Number.isFinite(A))return null;let F=x(S,A,8);if(!F.length)return null;let I=Math.max(0,Math.min(F.length-1,Number(C??0))),q=F[I]??null;return q?(s(q),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:q}),D(),q):null},pickManyAtPoint:(S,A,C)=>{if(!Number.isFinite(S)||!Number.isFinite(A))return[];let F=x(S,A,8);if(!F.length)return[];let I=[],q=Array.isArray(C)?C:[0];for(let W of q){let Y=Math.max(0,Math.min(F.length-1,Math.floor(Number(W)))),k=F[Y];if(!k)continue;I.some(ie=>ie.selector===k.selector&&ie.tagName===k.tagName)||I.push(k)}return I.length?(s(I[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:I}),D(),I):[]}},a("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:M,disablePickMode:D,installPickerApi:E}}var Uh=["width","height","top","left","right","bottom","inset","object-fit","object-position","z-index","opacity","visibility","filter","mix-blend-mode","backdrop-filter","border-radius","overflow","clip-path","mask","mask-image","mask-size","mask-position","mask-repeat","transform","transform-origin","translate","rotate","scale","box-sizing"];function $t(e,t){let n=Number.isFinite(t)&&t>0?t:30,r=Number.isFinite(e)&&e>0?e:0;return Math.floor(r*n+1e-9)/n}function vu(e,t,n=Uh){for(let r of n){let i=t.getPropertyValue(r);i&&e.setProperty(r,i)}}function Ln(e,t,n){let r=e?.[t];return typeof r=="function"?Number(r.call(e))||n:typeof r=="number"&&Number.isFinite(r)?r:(r!=null&&L("runtime.player.nonConformantNum",{prop:t,actual:typeof r}),n)}function Ue(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&L("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function Dn(e,t,n){if(e){for(let r of Object.values(e))if(!(!r||r===t))try{n(r)}catch(i){L("runtime.player.site1",i)}}}function Su(e,t,n,r){let i=$t(t,n),o=r?.suppressEvents===!0;return Ue(e,"pause"),typeof e.totalTime=="function"?e.totalTime(i,o):typeof e.seek=="function"&&e.seek(i,o),i}function Wh(e,t,n,r,i){let o=[];Dn(e,t,a=>{Ue(a,"play"),o.push(a)});try{return Su(t,n,r,i)}finally{for(let a of o)try{Ue(a,"pause")}catch(l){L("runtime.player.site2",l)}}}function Vh(e,t){Dn(e,t,n=>{Ue(n,"play")})}function Au(e){let t=e.transport;return t?{_timeline:null,play:()=>t.play(),pause:()=>t.pause(),seek:(n,r)=>t.seek(n,r),renderSeek:(n,r)=>t.renderSeek(n,r),getTime:()=>t.getTime(),getDuration:()=>t.getDuration(),isPlaying:()=>t.isPlaying(),setPlaybackRate:n=>t.setPlaybackRate(n),getPlaybackRate:()=>t.getPlaybackRate()}:{_timeline:null,play:()=>{let n=e.getTimeline();if(!n||e.getIsPlaying())return;let r=Math.max(0,Number(e.getSafeDuration?.()??Ln(n,"duration",0))||0);r>0&&Math.max(0,Ln(n,"time",0))>=r&&(Ue(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()),Ue(n,"play"),Dn(e.getTimelineRegistry?.(),n,i=>{typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),Ue(i,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;Ue(n,"pause"),Dn(e.getTimelineRegistry?.(),n,i=>{Ue(i,"pause")});let r=Math.max(0,Ln(n,"time",0));e.onDeterministicSeek(r),e.onDeterministicPause(),e.setIsPlaying(!1),e.onSyncMedia(r,!1),e.onRenderFrameSeek(r),e.onStatePost(!0)},seek:(n,r)=>{let i=e.getTimeline();if(!i)return;let o=Math.max(0,Number(n)||0),a=e.getIsPlaying(),l=Wh(e.getTimelineRegistry?.(),i,o,e.getCanonicalFps());e.onDeterministicSeek(l),r?.keepPlaying&&a?(typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),Ue(i,"play"),Dn(e.getTimelineRegistry?.(),i,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),Ue(s,"play")}),e.onDeterministicPlay(),e.onShowNativeVideos(),e.onSyncMedia(l,!0)):(e.setIsPlaying(!1),e.onSyncMedia(l,!1)),e.onRenderFrameSeek(l),e.onStatePost(!0)},renderSeek:(n,r)=>{let i=e.getTimeline(),o=e.getCanonicalFps(),a=i?(Vh(e.getTimelineRegistry?.(),i),Su(i,n,o,r)):$t(Math.max(0,Number(n)||0),o);e.onDeterministicSeek(a,r),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>Ln(e.getTimeline(),"time",0),getDuration:()=>Ln(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function Eu(){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 zh=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function Bo(e){return e.id||e.getAttribute("data-hf-id")||null}function qh(e){return ve(e)}function $h(e,t){let n=e.getAttribute("data-composition-id");if(!n)return null;let r=Number(t[n]?.duration?.());return Number.isFinite(r)&&r>0?r:null}function jh(e){return!(e instanceof HTMLMediaElement)||!Number.isFinite(e.duration)?null:Qe(e,e.duration)}function Kh(e,t,n,r){let i=qh(e.getAttribute("data-duration"));return i!=null&&i>0?i:$h(e,t)??jh(e)??Math.max(0,n-r)}function Yh(e){for(let[t,n]of e){let r=t.parentElement;for(;r;){let i=e.get(r);if(i){n.parentId=i.id,i.children.push(n);break}r=r.parentElement}}}function wu(e){let{startResolver:t,timelineRegistry:n,rootDuration:r}=e,i=new Map,o=document.querySelector("[data-composition-id]"),a=0;for(let l of document.querySelectorAll("[data-start]")){if(l===o||zh.has(l.tagName))continue;let s=t.resolveStartForElement(l,0);if(Kh(l,n,r,s)<=0)continue;let u={id:Bo(l)??`__clip-${a++}`,element:l,parentId:null,children:[]};i.set(l,u)}return Yh(i),{roots:Array.from(i.values()).filter(l=>l.parentId===null)}}function In(e){if(e==null||typeof e=="string"&&e.trim()==="")return null;let t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null}function jt(e){let t=In(e.start);if(t==null)return null;let n=Math.max(0,t),r=In(e.duration),i=In(e.authoredDuration),o=r!=null&&r>0?r:i!=null&&i>0?i:null;if(o!=null)return{start:n,duration:o,end:n+o};let a=In(e.end),l=In(e.authoredEnd),s=a!=null&&a>n?a:l!=null&&l>n?l:null;return{start:n,duration:s==null?null:s-n,end:s}}var Uo="css:root",Cu=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],Xh=new Set([...Cu,"contain","isolation","mask-border","mix-blend-mode","opacity"]),Jh=new Set(["absolute","relative"]),Qh=new Set(["flex","inline-flex","grid","inline-grid"]),Zh=new Set(["layout","paint","strict","content"]),e0=new Set(["size","inline-size"]);function t0(e){return e.position==="fixed"||e.position==="sticky"}function n0(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(Jh.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&Qh.has(n)}function r0(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:Cu.some(r=>{let i=e.getPropertyValue(r);return i!==""&&i!=="none"})}function i0(e){return e.getPropertyValue("contain").split(/\\s+/).some(n=>Zh.has(n))?!0:e0.has(e.getPropertyValue("container-type"))}function o0(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>Xh.has(t))}function a0(e,t){return t0(t)||n0(e,t)||r0(t)||i0(t)?!0:o0(t)}function s0(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 Yr(e){let t=e.ownerDocument.defaultView;if(!t)return Uo;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(a0(n,t.getComputedStyle(n)))return s0(n)}catch{return Uo}n=n.parentElement}return Uo}function mt(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,i=new WeakMap,o=new WeakMap,a=new Set,l=m=>{let p=r.getElementById(m);return p||(r.querySelector(`[data-composition-id="${CSS.escape(m)}"]`)??null)},s=m=>{let p=m.ownerDocument.defaultView?.HTMLMediaElement;return p?m instanceof p:typeof HTMLMediaElement<"u"&&m instanceof HTMLMediaElement},u=m=>{let p=o.get(m);if(p!==void 0)return p;let b=null,v=jt({start:0,duration:m.getAttribute("data-duration"),authoredDuration:n?m.getAttribute("data-hf-authored-duration"):null});if(v?.duration!=null&&v.duration>0&&(b=v.duration),b==null||b<=0){let x=f(m,0),_=jt({start:x,end:m.getAttribute("data-end"),authoredEnd:n?m.getAttribute("data-hf-authored-end"):null});_?.duration!=null&&_.duration>0&&(b=_.duration)}if((b==null||b<=0)&&s(m)){let x=yn(m);Number.isFinite(m.duration)&&m.duration>x&&(b=(m.duration-x)/_e(m))}if(b==null||b<=0){let x=m.getAttribute("data-composition-id");if(x){let _=t[x]??null;if(_&&typeof _.duration=="function")try{let R=Number(_.duration());Number.isFinite(R)&&R>0&&(b=R)}catch(R){L("runtime.startResolver.site1",R)}}}return b!=null&&Number.isFinite(b)&&b>0?(o.set(m,b),b):(o.set(m,null),null)},c=(m,p)=>{if(m.hasAttribute("data-composition-id")){let v=m.parentElement?.closest("[data-composition-id]");return v?f(v,p):0}let b=m.closest("[data-composition-id]");return b?f(b,p):0},f=(m,p)=>{let b=i.get(m);if(b!==void 0)return b??p;if(a.has(m))return p;a.add(m);try{let v=lo(m.getAttribute("data-start"));if(!v){if(m.hasAttribute("data-composition-id")){let M=m.parentElement;if(M&&(M.hasAttribute("data-composition-src")||M.hasAttribute("data-composition-id")||M.hasAttribute("data-composition-file"))){let D=f(M,p);return i.set(m,D),D}}return i.set(m,p),p}if(v.kind==="absolute"){let M=Math.max(0,v.value),D=Math.max(0,c(m,p)+M);return i.set(m,D),D}let x=l(v.refId);if(!x)return i.set(m,p),p;let _=f(x,0),R=u(x);if(R==null||R<=0){let M=Math.max(0,_+v.offset);return i.set(m,M),M}let T=Math.max(0,_+R+v.offset);return i.set(m,T),T}finally{a.delete(m)}};return{resolveStartForElement:(m,p=0)=>f(m,Math.max(0,p)),resolveDurationForElement:m=>u(m)}}function Wo(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}function pt(e){return ve(e)}function Vo(e){let t=e.getAttribute("data-duration"),n=e.getAttribute("data-hf-authored-duration"),r=jt({start:0,duration:t,authoredDuration:n})?.duration;return r??([t,n].map(pt).some(o=>o!=null&&o<=0)?0:null)}function _u(e){return jt({start:0,end:e.getAttribute("data-end"),authoredEnd:e.getAttribute("data-hf-authored-end")})?.end??null}function zo(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 qo(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function $o(e,t){let n=e.getAttribute("data-track-index")??e.getAttribute("data-track");if(n==null)return t;let r=Number.parseInt(n,10);return Number.isFinite(r)?r:t}function On(e){let t=String(e??"").trim();if(!t)return null;let n=t.toLowerCase();if(n.startsWith("data:")||n.startsWith("javascript:"))return null;try{return new URL(t,document.baseURI).toString()}catch{return t}}function Tu(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return On(t);let n=e.getAttribute("data-composition-src");if(n)return On(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?On(r.getAttribute("src")):null}function u0(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 c0(e){if(!e)return null;try{return new URL(e,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return e.split(/[\\\\/]/).filter(Boolean).at(-1)??null}}function d0(e){let t=e.textContent?.replace(/\\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function Pn(e){let t=e.replace(/\\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\\s+/g," ").trim();return t?t.replace(/\\b\\w/g,n=>n.toUpperCase()):e}function f0(e,t,n){let r=e.getAttribute("data-timeline-label")??e.getAttribute("data-label")??e.getAttribute("aria-label")??null;if(r?.trim())return r.trim();let i=e.getAttribute("data-composition-id");if(i)return Pn(i);let o=e.id;if(o)return Pn(o);let a=u0(e);if(a)return Pn(a);let l=c0(Tu(e));if(l)return Pn(l);let s=d0(e);return s||`${Pn(t)} ${n+1}`}function Ru(e){let n=window.__timelines??{},r=mt({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),i=z=>{if(!z)return null;let O=n[z]??null;if(!O||typeof O.duration!="function")return null;try{let B=Number(O.duration());return Number.isFinite(B)&&B>0?B:null}catch{return null}},o=z=>{let O=pt(z.getAttribute("data-duration"));return O!=null&&O>0?O:Number.isFinite(z.duration)?Qe(z,z.duration):null},a=()=>{let z=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(z.length===0)return null;let O=0;for(let B of z){let ee=B.hasAttribute("data-hf-auto-start")?r.resolveStartForElement(B,0):Math.max(0,Number(B.getAttribute("data-start")??0)||0);if(!Number.isFinite(ee))continue;let K=o(B);K==null||K<=0||(O=Math.max(O,Math.max(0,ee)+K))}return O>0?O:null},l=(z,O)=>{let B=[],ee=null,K=null,te=null,J=z.parentElement;for(;J;){let X=J.getAttribute("data-composition-id");X&&(B.push(X),!te&&J!==O&&(te=X),ee==null&&(ee=r.resolveStartForElement(J,0)),K==null&&(K=pt(J.getAttribute("data-duration"))??i(X)??null)),J=J.parentElement}return{parentCompositionId:te,compositionAncestors:B.reverse(),inheritedStart:ee,inheritedDuration:K}},s=document.querySelector("[data-composition-id]"),u=Array.from(document.querySelectorAll("[data-composition-id]")),c=s?.getAttribute("data-composition-id")??null,f=s?r.resolveStartForElement(s,0):0,m=a(),p=m!=null?Math.max(0,m-Math.max(0,f)):null,b=i(c),v=Vo(s??document.body),x=qo(...u.filter(z=>z!==s).map(z=>{let O=r.resolveStartForElement(z,0),B=r.resolveDurationForElement(z)??i(z.getAttribute("data-composition-id"))??null;return!Number.isFinite(O)||B==null||B<=0?null:Math.max(0,O)+B})),_=x!=null?Math.max(0,x-Math.max(0,f)):null,R=typeof b=="number"&&Number.isFinite(b)&&b>0?b:null,T=typeof v=="number"&&Number.isFinite(v)&&v>0?v:null,M=typeof p=="number"&&Number.isFinite(p)&&p>0?p:null,D=typeof _=="number"&&Number.isFinite(_)&&_>0?_:null,E=qo(M,D),S=R!=null&&E!=null&&R>E+1,C=T??(S?E:qo(R,M,D))??null,I=(C!=null?f+C:null)??(typeof m=="number"&&Number.isFinite(m)&&m>0?m:null),q=(z,O)=>!Number.isFinite(O)||O<=0?0:I==null||!Number.isFinite(I)?O:!Number.isFinite(z)||z>=I?0:Math.max(0,Math.min(O,I-z)),W=[],Y=[],k=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),U=0;for(let[z,O]of k.entries()){if(O===s||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(O.tagName))continue;let B=l(O,s),ee=r.resolveStartForElement(O,B.inheritedStart??0),K=O.getAttribute("data-composition-id"),te=Vo(O);if(te==null&&K&&K!==c&&(te=i(K)),te==null&&O instanceof HTMLMediaElement&&Number.isFinite(O.duration)&&(te=Qe(O,O.duration)),te==null){let Fe=B.inheritedDuration;if(Fe!=null&&Fe>0){let Ce=(B.inheritedStart??0)+Fe;te=Math.max(0,Ce-ee)}}if(te==null||te<=0||(te=q(ee,te),te<=0))continue;let J=ee+te;U=Math.max(U,J);let X=O.tagName.toLowerCase(),Pe=K&&K!==c?"composition":X==="video"?"video":X==="audio"?"audio":X==="img"?"image":"element";W.push({id:Bo(O)??K??null,label:f0(O,Pe,W.length),start:ee,duration:te,track:$o(O,z),zIndex:zo(O),stackingContextId:Yr(O),kind:Pe,tagName:X,compositionId:O.getAttribute("data-composition-id"),compositionAncestors:B.compositionAncestors,parentCompositionId:B.parentCompositionId,nodePath:null,compositionSrc:On(O.getAttribute("data-composition-src")),playbackStart:$e(O),playbackRate:_e(O),assetUrl:Tu(O),timelineRole:O.getAttribute("data-timeline-role"),timelineLabel:O.getAttribute("data-timeline-label"),timelineGroup:O.getAttribute("data-timeline-group"),timelinePriority:pt(O.getAttribute("data-timeline-priority"))})}let ie=new Set(W.map(z=>z.id)),P=s?.getAttribute("data-composition-id")??null,H=P?n[P]??null:null;if(H&&s){let z=H;if(typeof z.getChildren=="function")try{let O=z.getChildren(!0,!0,!1)??[],B=new Map;for(let te of s.children){let J=te;if(!J.id)continue;let X=J.tagName.toLowerCase();X==="script"||X==="style"||X==="link"||B.set(J,{id:J.id,start:1/0,end:-1/0})}let ee=te=>{let J=te;for(;J;){if(B.has(J))return J;if(J===s)return null;J=J.parentElement}return null};for(let te of O){if(typeof te.targets!="function"||typeof te.startTime!="function"||typeof te.duration!="function")continue;let J=te.startTime(),X=te.parent;for(;X&&X!==H&&typeof X.startTime=="function";)J+=X.startTime(),X=X.parent;let Pe=J+te.duration();if(!(!Number.isFinite(J)||!Number.isFinite(Pe)))for(let Fe of te.targets()){if(!(Fe instanceof Element))continue;let cn=ee(Fe);if(!cn)continue;let Ce=B.get(cn);Ce&&(Ce.start=Math.min(Ce.start,J),Ce.end=Math.max(Ce.end,Pe))}}let K=W.length>0?Math.max(...W.map(te=>te.track))+1:0;for(let[te,J]of B){if(J.start===1/0||J.end===-1/0)continue;let X=te;if(ie.has(X.id))continue;let Pe=Math.max(0,J.end-J.start);if(Pe<=0)continue;let Fe=q(J.start,Pe);Fe<=0||(U=Math.max(U,J.start+Fe),W.push({id:X.id,label:X.getAttribute("data-timeline-label")??X.getAttribute("data-label")??X.getAttribute("aria-label")??X.id,start:J.start,duration:Fe,track:$o(X,K),zIndex:zo(X),stackingContextId:Yr(X),kind:"element",tagName:X.tagName.toLowerCase(),compositionId:X.getAttribute("data-composition-id"),compositionAncestors:P?[P]:[],parentCompositionId:P,nodePath:null,compositionSrc:null,playbackStart:$e(X),playbackRate:_e(X),assetUrl:null,timelineRole:X.getAttribute("data-timeline-role"),timelineLabel:X.getAttribute("data-timeline-label"),timelineGroup:X.getAttribute("data-timeline-group"),timelinePriority:pt(X.getAttribute("data-timeline-priority"))}),ie.add(X.id))}}catch(O){L("runtime.timeline.site1",O)}}if(s&&C!=null&&C>0){let z=W.length>0?Math.max(...W.map(O=>O.track))+1:0;for(let O of s.children){let B=O;if(!B.id||ie.has(B.id))continue;let ee=B.getAttribute("data-timeline-role");if(ee!=="overlay"&&ee!=="persistent-overlay")continue;let K=B.tagName.toLowerCase();if(K==="script"||K==="style"||K==="link"||K==="meta"||window.getComputedStyle(B).display==="none")continue;let J=q(0,C);J<=0||(U=Math.max(U,J),W.push({id:B.id,label:B.getAttribute("data-timeline-label")??B.getAttribute("data-label")??B.getAttribute("aria-label")??B.id,start:0,duration:J,track:$o(B,z),zIndex:zo(B),stackingContextId:Yr(B),kind:"element",tagName:K,compositionId:B.getAttribute("data-composition-id"),compositionAncestors:P?[P]:[],parentCompositionId:P,nodePath:null,compositionSrc:null,playbackStart:$e(B),playbackRate:_e(B),assetUrl:null,timelineRole:ee,timelineLabel:B.getAttribute("data-timeline-label"),timelineGroup:B.getAttribute("data-timeline-group"),timelinePriority:pt(B.getAttribute("data-timeline-priority"))}),ie.add(B.id))}}for(let z of u){if(z===s)continue;let O=z.getAttribute("data-composition-id");if(!O||!Wo(O))continue;let B=r.resolveStartForElement(z,0),ee=Vo(z);if((ee==null||ee<=0)&&_u(z)!=null){let X=_u(z);ee=Math.max(0,X-B)}let K=i(O),te=ee&&ee>0?ee:K;if(te==null||te<=0)continue;let J=q(B,te);J<=0||Y.push({id:O,label:z.getAttribute("data-label")??O,start:B,duration:J,thumbnailUrl:On(z.getAttribute("data-thumbnail-url")),avatarName:null})}let V=Math.max(1,U||1,C??0),j=S&&T==null,we=j?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(V*Math.max(1,e.canonicalFps)));return{..._r(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:j?Number.POSITIVE_INFINITY:V,durationInFrames:we,clips:W,scenes:Y,compositionWidth:pt(s?.getAttribute("data-width"))??1920,compositionHeight:pt(s?.getAttribute("data-height"))??1080}}var jo="data-composition-id",m0="data-composition-src",p0=`[${jo}]`,iA=`[${m0}]`,ku="style",Mu="script",h0=\'link[rel="stylesheet"], link[rel="preconnect"]\';function Kt(e){return e?Array.from(e):[]}function Fu(e){let{contentNode:t,head:n,documentElement:r,hasTemplate:i,compositionId:o}=e,a=Kt(t.querySelectorAll(p0)),l=o?a.find(c=>c.getAttribute(jo)===o)??null:a[0]??null,s=(l??a[0])?.getAttribute(jo)?.trim()||"",u=i?null:n??null;return{innerRoot:l,authoredCompositionId:o||s||null,scriptCompositionId:s||o||null,authoredRootId:l?.getAttribute("id")?.trim()||null,styleSources:[...Kt(u?.querySelectorAll(ku)),...Kt(t.querySelectorAll(ku))],scriptSources:[...Kt(u?.querySelectorAll(Mu)),...Kt(t.querySelectorAll(Mu))],linkSources:Kt(n?.querySelectorAll(h0)),variableDefaultCarriers:[r,l].filter(c=>c!=null)}}var pe=Qm(nd(),1),rd=pe.default,jA=pe.default.stringify,KA=pe.default.fromJSON,YA=pe.default.plugin,XA=pe.default.parse,JA=pe.default.list,QA=pe.default.document,ZA=pe.default.comment,eE=pe.default.atRule,tE=pe.default.rule,nE=pe.default.decl,rE=pe.default.root,iE=pe.default.CssSyntaxError,oE=pe.default.Declaration,aE=pe.default.Container,sE=pe.default.Processor,lE=pe.default.Document,uE=pe.default.Comment,cE=pe.default.Warning,dE=pe.default.AtRule,fE=pe.default.Result,mE=pe.default.Input,pE=pe.default.Rule,hE=pe.default.Root,gE=pe.default.Node;var ya="data-hf-authored-id",id="data-hf-inner-root";function va(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function Sa(e){return e.replace(/\\\\/g,"\\\\\\\\").replace(/"/g,\'\\\\"\')}function Og(e){return e&&e.replace(/[^a-zA-Z0-9_-]/g,n=>`\\\\${n}`).replace(/^-?\\d/,n=>`\\\\${n}`)}function ad(e){let t=e.trim();return t?Array.from(new Set([t,Og(t)])).filter(Boolean):[]}function Hg(e){return!!e&&/[\\w-]/.test(e)}function Gg(e,t,n){let r=ad(t).sort((l,s)=>s.length-l.length);if(r.length===0)return e;let i="",o=0,a=null;for(let l=0;l<e.length;l+=1){let s=e[l],u=l>0?e[l-1]:"";if(a){i+=s,s===a&&u!=="\\\\"&&(a=null);continue}if(s===\'"\'||s==="\'"){a=s,i+=s;continue}if(s==="["){o+=1,i+=s;continue}if(s==="]"){o=Math.max(0,o-1),i+=s;continue}if(s==="#"&&o===0){let c=r.find(f=>e.startsWith(f,l+1));if(c){let f=e[l+1+c.length];if(!Hg(f)){i+=n,l+=c.length;continue}}}i+=s}return i}function Bg(e,t){let n=t?.trim();return n?Gg(e,n,`[${ya}="${Sa(n)}"]`):e}function od(e){return`${e}:not(:has([${id}])), ${e} > [${id}]`}function Ug(e,t,n,r,i,o){let a=Bg(e,r),l=Wg(a,t,n),s=l.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return o?od(t):e;let u=new RegExp(`\\\\[\\\\s*data-composition-id\\\\s*=\\\\s*(["\'])${va(n)}\\\\1\\\\s*\\\\]`,"g");if(u.test(s))return s.replace(u,"").trim()===""?od(t):l.replace(u,t);let c=l.match(/^\\s*/)?.[0]??"",f=l.match(/\\s*$/)?.[0]??"";if(i){let m=r?`[${ya}="${Sa(r)}"]`:null;if(m&&s.startsWith(m)){let p=s.slice(m.length);return`${c}${t}${m}${p}${f}`}}return`${c}${t} ${s}${f}`}function Wg(e,t,n){let r=va(n),i=String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${r}"|\'${r}\')\\s*\\]`,o=String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`;return e.replace(new RegExp(`${i}(?:${o})+`,"g"),t).replace(new RegExp(`(?:${o})+${i}`,"g"),t)}var Vg=new Set(["keyframes","-webkit-keyframes","font-face"]);function zg(e){return e?.type==="atrule"}function qg(e){let t=e.parent;for(;t;){if(zg(t)&&Vg.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function $g(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function sd(e,t,n,r,i){let o=t.trim();if(!e||!o)return e;let a=n||`[data-composition-id="${Sa(o)}"]`,l=rd.parse(e);return l.walkRules(s=>{qg(s)||$g(s)||(s.selectors=s.selectors.map(u=>Ug(u,a,o,r,i?.compoundAuthoredRoot,i?.scopeRootSelectors)))}),l.toResult({map:!1}).css}function nt(e){return JSON.stringify(e).replace(/</g,"\\\\u003c")}function ld(e,t,n="[HyperFrames] composition script error:",r,i=t,o){let a=nt(t),l=nt(i),s=nt(n),u=va(t),c=nt(o?.trim()||null),f=nt(r??null),m=nt(String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${u}"|\'${u}\')\\s*\\]`),p=nt(String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`),b=nt(ad(o?.trim()||""));return`(function(){\n var __hfCompId = ${a};\n var __hfTimelineCompId = ${l};\n var __hfErrorLabel = ${s};\n var __hfAuthoredRootId = ${c};\n var __hfAuthoredRootAttr = ${nt(ya)};\n var __hfEscapeAttr = function(value) {\n return (value + "").replace(/\\\\\\\\/g, "\\\\\\\\\\\\\\\\").replace(/"/g, "\\\\\\\\\\\\"");\n };\n var __hfRootSelector = ${f} || (__hfCompId\n ? \'[data-composition-id="\' + __hfEscapeAttr(__hfCompId) + \'"]\'\n : "");\n var __hfRoot = null;\n var __hfRootSelectorPattern = ${m};\n var __hfTimingSelectorPattern = ${p};\n var __hfAuthoredRootIdForms = ${b};\n var __hfAuthoredRootSelector = __hfAuthoredRootId\n ? "[" + __hfAuthoredRootAttr + \'="\' + __hfEscapeAttr(__hfAuthoredRootId) + \'"]\'\n : "";\n var __hfIsSelectorNameChar = function(char) {\n return !!char && /[\\\\w-]/.test(char);\n };\n var __hfReplaceAuthoredRootIdSelectors = function(selector) {\n if (!__hfAuthoredRootSelector || !__hfAuthoredRootIdForms.length || typeof selector !== "string") {\n return selector;\n }\n var result = "";\n var bracketDepth = 0;\n var quote = null;\n for (var index = 0; index < selector.length; index += 1) {\n var char = selector[index];\n var previousChar = index > 0 ? selector[index - 1] : "";\n if (quote) {\n result += char;\n if (char === quote && previousChar !== "\\\\\\\\") {\n quote = null;\n }\n continue;\n }\n if (char === \'"\' || char === "\'") {\n quote = char;\n result += char;\n continue;\n }\n if (char === "[") {\n bracketDepth += 1;\n result += char;\n continue;\n }\n if (char === "]") {\n bracketDepth = Math.max(0, bracketDepth - 1);\n result += char;\n continue;\n }\n if (char === "#" && bracketDepth === 0) {\n var matchedForm = null;\n for (var formIndex = 0; formIndex < __hfAuthoredRootIdForms.length; formIndex += 1) {\n var form = __hfAuthoredRootIdForms[formIndex];\n if (selector.slice(index + 1, index + 1 + form.length) === form) {\n matchedForm = form;\n break;\n }\n }\n if (matchedForm) {\n var nextChar = selector[index + 1 + matchedForm.length];\n if (!__hfIsSelectorNameChar(nextChar)) {\n result += __hfAuthoredRootSelector;\n index += matchedForm.length;\n continue;\n }\n }\n }\n result += char;\n }\n return result;\n };\n var __hfNormalizeSelector = function(selector) {\n if (!__hfCompId || typeof selector !== "string") return selector;\n var normalized = selector\n .replace(new RegExp(__hfRootSelectorPattern + \'(?:\' + __hfTimingSelectorPattern + \')+\', \'g\'), __hfRootSelector)\n .replace(new RegExp(\'(?:\' + __hfTimingSelectorPattern + \')+\' + __hfRootSelectorPattern, \'g\'), __hfRootSelector);\n if (__hfAuthoredRootSelector) {\n normalized = __hfReplaceAuthoredRootIdSelectors(normalized);\n }\n return normalized;\n };\n var __hfFindRoot = function() {\n if (!__hfRoot && __hfRootSelector) {\n __hfRoot = window.document.querySelector(__hfRootSelector);\n }\n return __hfRoot;\n };\n var __hfContains = function(node) {\n var root = __hfFindRoot();\n return !root || node === root || root.contains(node);\n };\n var __hfQueryAll = function(selector) {\n var root = __hfFindRoot();\n if (!root || typeof selector !== "string") {\n return window.document.querySelectorAll(selector);\n }\n return Array.prototype.filter.call(window.document.querySelectorAll(__hfNormalizeSelector(selector)), function(node) {\n return __hfContains(node);\n });\n };\n var __hfQueryOne = function(selector) {\n var matches = __hfQueryAll(selector);\n return matches[0] || null;\n };\n var __hfGetElementById = function(id) {\n var found = window.document.getElementById(id);\n if (found && __hfContains(found)) return found;\n var root = __hfFindRoot();\n if (!root) return found || null;\n var idValue = id + "";\n if (__hfAuthoredRootId && __hfAuthoredRootId === idValue && root.getAttribute && root.getAttribute(__hfAuthoredRootAttr) === idValue) {\n return root;\n }\n if (root.id === idValue) return root;\n if (typeof root.querySelector !== "function") return null;\n try {\n var authoredRootMatch = root.querySelector(\'[\' + __hfAuthoredRootAttr + \'="\' + __hfEscapeAttr(idValue) + \'"]\');\n if (authoredRootMatch) return authoredRootMatch;\n } catch {}\n if (typeof CSS !== "undefined" && CSS && typeof CSS.escape === "function") {\n try {\n return root.querySelector("#" + CSS.escape(idValue)) || null;\n } catch {}\n }\n try {\n return root.querySelector(\'[id="\' + __hfEscapeAttr(idValue) + \'"]\') || null;\n } catch {}\n return null;\n };\n var __hfScopedDocument = typeof Proxy === "function"\n ? new Proxy(window.document, {\n get: function(target, prop, receiver) {\n if (prop === "querySelector") return __hfQueryOne;\n if (prop === "querySelectorAll") return __hfQueryAll;\n if (prop === "getElementById") return __hfGetElementById;\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n })\n : window.document;\n var __hfTimelineRegistryProxy = null;\n var __hfGetTimelineRegistry = function() {\n window.__timelines = window.__timelines || {};\n if (!__hfCompId || __hfCompId === __hfTimelineCompId || typeof Proxy !== "function") {\n return window.__timelines;\n }\n if (!__hfTimelineRegistryProxy) {\n __hfTimelineRegistryProxy = new Proxy(window.__timelines, {\n get: function(target, prop, receiver) {\n if (prop !== __hfCompId) {\n return Reflect.get(target, prop, target);\n }\n var authoredValue = Reflect.get(target, prop, target);\n return authoredValue === undefined\n ? Reflect.get(target, __hfTimelineCompId, target)\n : authoredValue;\n },\n set: function(target, prop, value, receiver) {\n if (prop !== __hfCompId) {\n return Reflect.set(target, prop, value, target);\n }\n // The authored node remains in the compiled DOM when its local id\n // differs from the runtime mount id, so readiness legitimately sees\n // both compositions. Publish the same timeline under both identities\n // instead of replacing one with the other.\n var authoredSet = Reflect.set(target, __hfCompId, value, target);\n var runtimeSet = Reflect.set(target, __hfTimelineCompId, value, target);\n return authoredSet && runtimeSet;\n },\n });\n }\n return __hfTimelineRegistryProxy;\n };\n var __hfScopedWindow = typeof Proxy === "function"\n ? new Proxy(window, {\n get: function(target, prop, receiver) {\n if (prop === "__timelines") return __hfGetTimelineRegistry();\n // Inside a sub-composition, __hyperframes is passed as a bare script\n // param bound to the SCOPED variant (per-comp getVariables). But\n // authors routinely write the documented window.__hyperframes.\n // getVariables() form, which would otherwise fall through to the host\n // page\'s base __hyperframes and return the WRONG (or empty) variables\n // for this instance. Route it to the scoped variant too so both\n // spellings resolve to this composition\'s own variables.\n // (__hfScopedHyperframes is a hoisted var assigned below, before any\n // sub-comp script -- the only code that reads this -- runs.)\n if (prop === "__hyperframes") return __hfScopedHyperframes;\n // Native window methods must stay bound to the real window. Handed\n // back unbound, "this" at call time is this Proxy and Chrome rejects\n // it with "Illegal invocation", which broke window.addEventListener,\n // setTimeout, matchMedia and getComputedStyle inside every\n // sub-composition -- including the window.addEventListener("hf-seek",\n // ...) form the Three.js and TypeGPU adapters document. The sibling\n // document and gsap proxies here already bind.\n //\n // Only bind non-constructors. Function.prototype.bind drops static\n // members, so binding a class exposed on window (window.Texts and\n // friends) would silently strip its statics. Built-in methods have\n // no .prototype; classes and constructor functions do.\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" && value.prototype === undefined\n ? value.bind(target)\n : value;\n },\n set: function(target, prop, value, receiver) {\n if (prop === "__timelines") {\n // Common authoring boilerplate assigns the registry back to\n // itself (window.__timelines = window.__timelines || {}). The\n // getter above returns our proxy; do not replace the canonical\n // registry with that proxy or later wrappers will stack proxies.\n if (value === __hfTimelineRegistryProxy) return true;\n target.__timelines = value || {};\n __hfTimelineRegistryProxy = null;\n return true;\n }\n return Reflect.set(target, prop, value, target);\n },\n })\n : window;\n var __hfResolveGsapTarget = function(target) {\n if (typeof target !== "string") return target;\n return __hfQueryAll(target);\n };\n var __hfScopeTimeline = function(timeline) {\n if (!timeline || timeline.__hfScopedCompositionRoot === __hfFindRoot()) return timeline;\n ["to", "from", "fromTo", "set"].forEach(function(method) {\n var original = timeline[method];\n if (typeof original !== "function") return;\n timeline[method] = function(target) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(target);\n return original.apply(timeline, args);\n };\n });\n try {\n Object.defineProperty(timeline, "__hfScopedCompositionRoot", {\n value: __hfFindRoot(),\n configurable: true,\n });\n } catch {\n // Best-effort: timelines coming from user code may have a frozen target\n // or a non-extensible defineProperty path. Swallow \\u2014 the scoped root\n // is an enrichment, not a correctness invariant for playback.\n }\n return timeline;\n };\n var __hfBaseGsap = typeof gsap === "undefined" ? window.gsap : gsap;\n var __hfScopedGsap = !__hfBaseGsap || typeof Proxy !== "function"\n ? __hfBaseGsap\n : new Proxy(__hfBaseGsap, {\n get: function(target, prop, receiver) {\n if (prop === "timeline") {\n return function() {\n return __hfScopeTimeline(target.timeline.apply(target, arguments));\n };\n }\n if (prop === "to" || prop === "from" || prop === "fromTo" || prop === "set") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return target[prop].apply(target, args);\n };\n }\n if (prop === "utils" && target.utils && typeof Proxy === "function") {\n return new Proxy(target.utils, {\n get: function(utilsTarget, utilsProp, utilsReceiver) {\n if (utilsProp === "toArray") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return utilsTarget.toArray.apply(utilsTarget, args);\n };\n }\n if (utilsProp === "selector") {\n return function(base) {\n var baseEl = typeof base === "string" ? __hfQueryOne(base) : base;\n var root = baseEl || __hfFindRoot();\n return function(selector) {\n if (!root || typeof selector !== "string") return [];\n return Array.prototype.filter.call(\n window.document.querySelectorAll(__hfNormalizeSelector(selector)),\n function(node) {\n return node === root || (typeof root.contains === "function" && root.contains(node));\n },\n );\n };\n };\n }\n var value = Reflect.get(utilsTarget, utilsProp, utilsTarget);\n return typeof value === "function" ? value.bind(utilsTarget) : value;\n },\n });\n }\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n });\n var __hfBaseHyperframes = window.__hyperframes;\n var __hfScopedHyperframes = !__hfBaseHyperframes\n ? __hfBaseHyperframes\n : Object.assign({}, __hfBaseHyperframes, {\n getVariables: function() {\n var byComp = window.__hfVariablesByComp;\n var scoped = byComp && __hfTimelineCompId ? byComp[__hfTimelineCompId] : null;\n return scoped ? Object.assign({}, scoped) : {};\n },\n });\n var __hfRun = function() {\n try {\n (function(document, gsap, window, __hyperframes) {\n${e.replace(/<\\/(script)/gi,"<\\\\/$1")}\n }).call(window, __hfScopedDocument, __hfScopedGsap, __hfScopedWindow, __hfScopedHyperframes);\n } catch (_err) {\n console.error(__hfErrorLabel, __hfCompId, _err);\n }\n };\n __hfFindRoot();\n __hfRun();\n})();`}var jg=["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 ud(e){let t=e.getAttribute("id")?.trim();for(let n of jg)e.removeAttribute(n);t&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",t)),e.setAttribute("data-hf-inner-root","true")}var Kg=8e3,Yg=/^(?![a-zA-Z][a-zA-Z\\d+\\-.]*:)(?!\\/\\/)(?!\\/)(?!\\.\\.?\\/).+/,Xg=/\\burl\\(\\s*(["\']?)([^)"\']+)\\1\\s*\\)/g,Jg=["src","href"];function Qg(e){return!e||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/")}function fd(e,t){if(!t)return e;let n=e.trim();if(Qg(n)||!n.startsWith("../")&&n!=="..")return e;try{return new URL(n,t).href}catch{return e}}function md(e,t){return!t||!e?e:e.replace(Xg,(n,r,i)=>{let o=fd(i||"",t);return o===i?n:`url(${r||""}${o}${r||""})`})}function Zg(e,t){for(let n of Array.from(e.querySelectorAll("[src], [href]")))for(let r of Jg){let i=n.getAttribute(r);if(i==null)continue;let o=fd(i,t);o!==i&&n.setAttribute(r,o)}}function eb(e,t){for(let n of Array.from(e.querySelectorAll("[style]"))){let r=n.getAttribute("style");if(r==null)continue;let i=md(r,t);i!==r&&n.setAttribute("style",i)}}function tb(e,t){for(let n of Array.from(e.querySelectorAll("style"))){let r=n.textContent||"",i=md(r,t);i!==r&&(n.textContent=i)}}function pd(e,t){if(t){Zg(e,t),eb(e,t),tb(e,t);for(let n of Array.from(e.querySelectorAll("template")))pd(n.content,t)}}function nb(e,t){return`${e}__hf${t}`}var rb=e=>new Promise(t=>{let n=!1,r=Date.now(),i=null,o=a=>{n||(n=!0,i!=null&&window.clearTimeout(i),t({status:a,elapsedMs:Math.max(0,Date.now()-r)}))};e.addEventListener("load",()=>o("load"),{once:!0}),e.addEventListener("error",()=>o("error"),{once:!0}),i=window.setTimeout(()=>o("timeout"),Kg)});function Aa(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function cd(e){for(let t of Array.from(e.querySelectorAll("style, script")))t.remove()}function ib(e){let t=document.importNode(e,!0);ud(t);let n=t.getAttribute("data-width"),r=t.getAttribute("data-height");return t.style.width=n?`${n}px`:"100%",t.style.height=r?`${r}px`:"100%",t}function ob(e,t){let n=e.trim();if(!n)return e;try{return Yg.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 dd(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 di(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 ab(e){let t=new Map;for(let n of e){let r=di(n).authoredCompositionId||"";r&&t.set(r,(t.get(r)||0)+1)}return t}function hd(e){let t=di(e).authoredCompositionId;return t?!!document.querySelector(`template#${CSS.escape(t)}-template`):!1}function sb(e){return!!e.querySelector(\'[data-hf-inner-root="true"]\')}function lb(e){return e.hasAttribute("data-composition-src")?!0:hd(e)?e.children.length===0||e.hasAttribute("data-hf-original-composition-id")?!0:sb(e):!1}function wa(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(t=>t.hasAttribute("data-composition-src")?!0:hd(t))}function gd(){let e=window.__hfVariablesByComp;if(!e)return;let t=new Set(wa().map(n=>di(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(e))t.has(n)||delete e[n]}function bd(e,t=ab(e)){let n=new Map,r=new Map;for(let i of e){let{authoredCompositionId:o,runtimeCompositionId:a}=di(i),l=lb(i);if(!o){r.set(i,{authoredCompositionId:null,runtimeCompositionId:a});continue}let s=(t.get(o)||0)>1,u=a||o;if(l){let c=s?(n.get(o)||0)+1:0;s&&n.set(o,c),u=s?nb(o,c):o,s?i.setAttribute("data-hf-original-composition-id",o):i.removeAttribute("data-hf-original-composition-id"),i.setAttribute("data-composition-id",u),a&&a!==u&&window.__hfVariablesByComp&&delete window.__hfVariablesByComp[a]}r.set(i,{authoredCompositionId:o,runtimeCompositionId:u})}return r}async function Ea(e){let t=Fu({contentNode:e.sourceNode,head:e.head,hasTemplate:e.hasTemplate,compositionId:e.authoredCompositionId}),n=t.innerRoot instanceof HTMLElement?t.innerRoot:null,r=n??e.sourceNode,i=t.authoredCompositionId,o=t.scriptCompositionId,a=e.runtimeCompositionId||null,l=t.authoredRootId,s=a?`[data-composition-id="${CSS.escape(a)}"]`:void 0;for(let m of t.linkSources){let p=(m.getAttribute("href")||"").trim();if(!p)continue;let b=e.compositionUrl?new URL(p,e.compositionUrl).href:p;if(e.compositionUrl&&dd(b,e.compositionUrl)||document.head.querySelector(`link[href="${CSS.escape(b)}"]`))continue;let v=m.cloneNode(!0);v instanceof HTMLLinkElement&&(v.href=b,document.head.appendChild(v),e.injectedLinks.push(v))}(m=>{for(let p of m){let b=p.cloneNode(!0);b instanceof HTMLStyleElement&&(i&&(b.textContent=sd(b.textContent||"",i,s,l,{scopeRootSelectors:!0})),document.head.appendChild(b),e.injectedStyles.push(b))}})(t.styleSources);let c=m=>{let p=m.getAttribute("type")?.trim()??"",b=m.getAttribute("src")?.trim()??"";if(b){let x=ob(b,e.compositionUrl);return e.compositionUrl&&dd(x,e.compositionUrl)?null:{kind:"external",src:x,type:p}}let v=m.textContent?.trim()??"";return v?{kind:"inline",content:v,type:p,scopeCompositionId:o}:null},f=t.scriptSources.map(c).filter(m=>m!==null);if(n){let m=n.getAttribute("data-width"),p=n.getAttribute("data-height"),b=e.parseDimensionPx(m),v=e.parseDimensionPx(p);m&&e.host.setAttribute("data-width",m),p&&e.host.setAttribute("data-height",p),b&&e.host instanceof HTMLElement&&(e.host.style.width=b),v&&e.host instanceof HTMLElement&&(e.host.style.height=v),n.hasAttribute("data-timeline-locked")&&e.host.setAttribute("data-timeline-locked","");let x=ib(n);!e.authoredCompositionId&&i&&x.setAttribute("data-composition-id",i),cd(x),e.host.appendChild(x)}else if(e.hasTemplate){let m=document.importNode(r,!0);cd(m),e.host.appendChild(m)}else e.host.innerHTML=e.fallbackBodyInnerHtml;a&&ub(e,r,a);for(let m of f){let p=document.createElement("script");if(m.type&&(p.type=m.type),p.async=!1,m.kind==="external"?p.src=m.src:m.type.toLowerCase()==="module"?p.textContent=m.content:m.scopeCompositionId?p.textContent=ld(m.content,m.scopeCompositionId,"[HyperFrames] composition script error:",s,a||m.scopeCompositionId,l):p.textContent=`(function(){${m.content}})();`,document.body.appendChild(p),e.injectedScripts.push(p),m.kind==="external"){let b=await rb(p);b.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.authoredCompositionId,runtimeCompositionId:e.runtimeCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:m.src,loadStatus:b.status,elapsedMs:b.elapsedMs}})}}}async function xd(e){let t=wa();if(gd(),t.length===0)return;let n=bd(t),r=t.filter(i=>{if(i.hasAttribute("data-composition-src")||i.children.length>0)return!1;let o=n.get(i)?.authoredCompositionId;return o?!!document.querySelector(`template#${CSS.escape(o)}-template`):!1});if(r.length!==0)for(let i of r){let o=n.get(i),a=o?.authoredCompositionId;if(!a)continue;let l=document.querySelector(`template#${CSS.escape(a)}-template`);Aa(i),await Ea({host:i,authoredCompositionId:a,runtimeCompositionId:o?.runtimeCompositionId||a,hostCompositionSrc:`template#${a}-template`,sourceNode:l.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic})}}async function yd(e){let t=wa();if(gd(),t.length===0)return;let n=bd(t),r=t.filter(i=>i.hasAttribute("data-composition-src"));r.length!==0&&await Promise.all(r.map(async i=>{let o=i.getAttribute("data-composition-src");if(!o)return;let a=n.get(i),l=a?.authoredCompositionId||null,s=a?.runtimeCompositionId||l||null,u=null;try{u=new URL(o,document.baseURI)}catch{u=null}Aa(i);try{let c=l!=null?document.querySelector(`template#${CSS.escape(l)}-template`):null;if(c){await Ea({host:i,authoredCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:c.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:u,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});return}let f=await fetch(o);if(!f.ok)throw new Error(`HTTP ${f.status}`);let m=await f.text(),b=new DOMParser().parseFromString(m,"text/html");pd(b,u);let v=(l?b.querySelector(`template#${CSS.escape(l)}-template`):null)??b.querySelector("template"),x=v?v.content:b.body;await Ea({host:i,authoredCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:x,hasTemplate:!!v,fallbackBodyInnerHtml:b.body.innerHTML,compositionUrl:u,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,head:b.head,declaredVariableDefaults:bn(b.documentElement),variableDeclarer:b.documentElement,onDiagnostic:e.onDiagnostic})}catch(c){e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,errorMessage:c instanceof Error?c.message:"unknown_error"}}),Aa(i)}}))}function ub(e,t,n){let i={...e.declaredVariableDefaults??(t instanceof Element?bn(t):{}),...Xs(e.host)};eo(e.variableDeclarer??(t instanceof Element?t:null),i,n),Ks(e.host),Object.keys(i).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[n]=i,to(e.host,{...js(e.host,i,window),...Rr()})):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[n]}function Ca(e){let n=e.vars.data?.captionState;return n==="dim"||n==="active"?n:void 0}function cb(e){return e instanceof HTMLElement?e.dataset.captionWrapper!=="true"?e:e.querySelector(":scope > span")??null:null}function db(){let e=[],t=document.querySelectorAll(".caption-group");for(let n of t)for(let r of n.children){if(!(r instanceof HTMLElement))continue;let i=r.dataset.captionWrapper==="true"?r.querySelector(":scope > span"):r.tagName==="SPAN"?r:null;i&&e.push(i)}return e}function fb(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}function _a(){let e=window.gsap;e&&document.querySelectorAll(".caption-group").length!==0&&fetch("caption-overrides.json").then(t=>t.ok?t.json():null).then(t=>{if(!t||!Array.isArray(t)||t.length===0)return;let n=db();for(let r of t){let i=null;if(r.wordId&&(i=cb(document.getElementById(r.wordId))),!i&&r.wordIndex!==void 0&&(i=n[r.wordIndex]??null),!i)continue;let o={},a={};if(r.x!==void 0&&(o.x=r.x),r.y!==void 0&&(o.y=r.y),r.scale!==void 0&&(o.scale=r.scale),r.rotation!==void 0&&(o.rotation=r.rotation),r.opacity!==void 0&&(a.opacity=r.opacity),r.fontSize!==void 0&&(a.fontSize=`${r.fontSize}px`),r.fontWeight!==void 0&&(a.fontWeight=r.fontWeight),r.fontFamily!==void 0&&(a.fontFamily=r.fontFamily),r.activeColor||r.dimColor){let s=e.getTweensOf(i).filter(f=>f.vars.color!==void 0).sort((f,m)=>f.startTime()-m.startTime()),u=s.find(f=>Ca(f)==="dim")??s.find(f=>Ca(f)===void 0),c=u?String(u.vars.color):"";for(let f of s)(Ca(f)??(String(f.vars.color)===c?"dim":"active"))==="dim"?r.dimColor&&(f.vars.color=r.dimColor):r.activeColor&&(f.vars.color=r.activeColor);r.dimColor&&e.set(i,{color:r.dimColor})}if(Object.keys(a).length>0&&e.set(i,a),Object.keys(o).length>0){let l=fb(i);e.set(l,o)}}}).catch(()=>{})}var Ra="data-hf-edit-base-x",ka="data-hf-edit-base-y",en="data-hf-edit-original-translate",fi=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},mb=e=>{let t=[],n=0,r="";for(let i of e.trim())i==="("&&(n+=1),i===")"&&(n=Math.max(0,n-1)),/\\s/.test(i)&&n===0?(r&&t.push(r),r=""):r+=i;return r&&t.push(r),t},vd=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,Ta=(e,t)=>vd.test(e)&&vd.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,pb=(e,t,n)=>{if(!e||e==="none")return`${t} ${n}`;let[r,i,o]=mb(e);if(r===void 0)return`${t} ${n}`;if(i===void 0)return`${Ta(r,t)} ${n}`;let a=o===void 0?"":` ${o}`;return`${Ta(r,t)} ${Ta(i,n)}${a}`},hb=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},gb=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""}},Ma=new WeakMap;function bb(e,t){let n=Ma.get(e);if(!t?.force&&n!==void 0&&e.style.getPropertyValue("translate")!==n){Ne("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=fi(e.getAttribute("data-x"))-fi(e.getAttribute(Ra)),i=fi(e.getAttribute("data-y"))-fi(e.getAttribute(ka));e.hasAttribute(en)||e.setAttribute(en,gb(e)),n===void 0&&hb(e);let o=e.getAttribute(en)??"",a=pb(o,`${r}px`,`${i}px`);e.style.setProperty("translate",a),Ma.set(e,e.style.getPropertyValue("translate"))}function mi(e,t){let n=e.defaultView?.HTMLElement,r=e.defaultView?.SVGElement,i=s=>n||r?n!==void 0&&s instanceof n||r!==void 0&&s instanceof r:typeof s.style?.setProperty=="function",o=e.querySelectorAll(`[${en}]:not([${Ra}]):not([${ka}])`);for(let s=0;s<o.length;s++){let u=o[s];if(u===void 0||!i(u))continue;let c=u.getAttribute(en)??"";c===""?u.style.removeProperty("translate"):u.style.setProperty("translate",c),u.removeAttribute(en),Ma.delete(u)}let a=e.querySelectorAll(`[${Ra}], [${ka}]`),l=0;for(let s=0;s<a.length;s++){let u=a[s];u===void 0||!i(u)||(bb(u,t),l+=1)}return l}var Sd="__hfPositionEditsSeekReapplyWrapped",Ad=new WeakSet,Ed=new WeakMap,wd=new WeakMap;function Cd(e){let t=e,n=()=>{try{mi(t.document)}catch{}},r=f=>typeof f=="function"&&(Ad.has(f)||!!f[Sd]),i=f=>{Ad.add(f);try{Object.defineProperty(f,Sd,{value:!0})}catch{}},o=f=>{if(typeof f!="function"||r(f))return f;let m=function(...p){let b=f.apply(this,p);return n(),b};return i(m),m},a=(f,m)=>{let p=Ed.get(f);if(p?.has(m))return!0;let b=Object.getOwnPropertyDescriptor(f,m);if(b?.configurable===!1){let _=f[m];return typeof _=="function"&&(f[m]=o(_),n()),!1}let v=f[m],x=b?.set;return Object.defineProperty(f,m,{configurable:!0,enumerable:b?.enumerable??!0,get:()=>v,set:_=>{v=o(_),x?.call(f,_)}}),v=o(v),p??(p=new Set),p.add(m),Ed.set(f,p),n(),!0},l=(f,m)=>{let p=wd.get(t),b=Object.getOwnPropertyDescriptor(t,f);if(!p?.has(f)){if(b?.configurable===!1){let _=t[f];return _?a(_,m):!1}let x=t[f];Object.defineProperty(t,f,{configurable:!0,enumerable:b?.enumerable??!0,get:()=>x,set:_=>{x=_,x&&a(x,m)}}),p??(p=new Set),p.add(f),wd.set(t,p)}let v=t[f];return v?a(v,m):!1},s=()=>{let f=l("__hf","seek"),m=l("__player","renderSeek");return f&&m};if(s())return;let u=120,c=t.setInterval(()=>{if(s()){t.clearInterval(c);return}u-=1,u<=0&&t.clearInterval(c)},50)}function pi(e){let t=window,r=e.closest("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()??"",i=r?t.__hfVariablesByComp?.[r]:void 0;if(i)return i;let o=t.__hyperframes?.getVariables?.();return o&&typeof o=="object"?o:t.__hfVariables??{}}function hi(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Fa(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 _d=new Set(["img","video","audio","source"]);function xb(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 yb(e){return e.replace(/[;{}<>\\r\\n]/g,"")}function vb(e){if(hi(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 Na(e,t){let n=e.closest("[data-composition-id]"),r=t.get(n);if(r)return r;let i=pi(e);return t.set(n,i),i}function Sb(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 Ab(e){return e.querySelector("[data-hf-root]")??e.getElementById("stage")??e.body?.firstElementChild??e.body}function Eb(e,t){let n=new Set,r=Ab(e);r&&n.add(r);for(let i of Array.from(e.querySelectorAll("[data-composition-id]")))n.add(i);for(let i of n){let o=Na(i,t);for(let[a,l]of Object.entries(o)){let s=vb(l);s!==null&&i instanceof HTMLElement&&i.style.setProperty(`--${a}`,yb(s))}}}function La(e){let t=new Map;Eb(e,t);for(let n of Array.from(e.querySelectorAll("[data-var-src]"))){let r=n.getAttribute("data-var-src")?.trim();if(!r)continue;if(!_d.has(n.tagName.toLowerCase())){console.warn(`[hyperframes] Ignoring data-var-src on <${n.tagName.toLowerCase()}>: variable-bound src is only allowed on ${Array.from(_d).join("/")}.`);continue}let i=xb(Na(n,t)[r]);if(i!==null){if(!Fa(i)){console.warn(`[hyperframes] Ignoring data-var-src="${r}": unsafe URL protocol.`);continue}n.setAttribute("src",i)}}for(let n of Array.from(e.querySelectorAll("[data-var-text]"))){let r=n.getAttribute("data-var-text")?.trim();if(!r)continue;let i=Na(n,t)[r];hi(i)&&Sb(n,String(i))}}var rt=new Map,wb="data-hf-color-grading-canvas",Cb="__hf_color_grading_canvas__";function Od(){if(typeof MutationObserver>"u"||typeof document>"u")return;let e=document.documentElement;if(!e)return;let t=r=>{r instanceof HTMLElement&&(r.hasAttribute($r)||r.setAttribute($r,r.style.opacity))},n=r=>{if(r instanceof Element){r.matches("video, img")&&t(r);for(let i of r.querySelectorAll("video, img"))t(i)}};n(e),new MutationObserver(r=>{for(let i of r)for(let o of i.addedNodes)n(o)}).observe(e,{childList:!0,subtree:!0})}var _b=16,Tb=4,nn={enabled:!1,position:.5,softness:0,lineWidth:2},Da=["#000000","#ffffff"],Rb=["#1a1a1a","#f5f5dc"],sr=3,kb=sr-1,Mb=5,Ia=`${je}.0`,Td=`${je-1}.0`,Fb=`${sr}.0`,Nb=`${(kb+.5)/sr}`;function gi(e){let t=e.getAttribute(Fn);return t==null?null:bu(t,pi(e))}var Lb=["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(`\n`),Db=["#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);"," float blur = clamp(u_blur, 0.0, 1.0);"," if (blur > 0.0 && u_blurReady > 0.5) base = mix(base, sampleBlur(uv), blur);"," 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);"," }"," 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;"," 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;"," }"," 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;"," float texelX = 1.0 / max(u_resolution.x * max(u_uvScale.x, 0.00001), 1.0);"," vec2 tapeUv = sampleUv + vec2(tapeShift * texelX, 0.0);"," vec4 base = samplePrepared(tapeUv);"," 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);"," }"," 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);"," }"," return base;","}","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);","}","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);","}","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);","}","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);","}","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);","}","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);","}","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));","}","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);","}","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);","}","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);","}","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) * ${Td};`," float lower = floor(position);",` float upper = min(lower + 1.0, ${Td});`,` float y = (row + 0.5) / ${Fb};`,` vec4 before = texture2D(u_advanced, vec2((lower + 0.5) / ${Ia}, y));`,` vec4 after = texture2D(u_advanced, vec2((upper + 0.5) / ${Ia}, y));`," return mix(before, after, position - lower);","}","vec4 advancedConfig(float index){",` return texture2D(u_advanced, vec2((index + 0.5) / ${Ia}, ${Nb}));`,"}","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;","}","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"," );","}","float decodeSigned(float value){ return (value * 255.0 - 128.0) / 127.0; }","vec3 applyHueCurves(vec3 color){"," if (u_hueCurvesEnabled < 0.5) return color;"," vec3 hsv = rgbToHsv(clamp(color, 0.0, 1.0));"," vec3 curves = sampleAdvancedCurve(hsv.x, 1.0).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;","}","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);"," 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);"," 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;","}","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));","}","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);","}","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);","}","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;","}","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);","}","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);","}","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);"," 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;"," 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);"," 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);"," }"," 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);"," }"," 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));"," if (u_bloomReady > 0.5 && u_bloom > 0.0) color += sampleBloom(uv) * u_bloom;"," color = applyScanlines(clamp(color, 0.0, 1.0), clamp(u_scanlines, 0.0, 1.0));"," 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;"," float warpActive = step(0.0001, u_crtCurvature);"," color *= mix(1.0, displayMask, warpActive);"," vec3 graded = clamp(color, 0.0, 1.0);"," 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;"," }"," gl_FragColor = vec4(graded, sampleColor.a);","}"].join(`\n`),Ib=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform vec2 u_resolution;","uniform vec2 u_direction;","uniform float u_radius;","uniform float u_bloomPass;","uniform float u_threshold;","vec4 readSource(vec2 uv){"," vec4 color = texture2D(u_source, clamp(uv, vec2(0.0), vec2(1.0)));"," if (u_bloomPass > 0.5) {"," float luminance = dot(color.rgb, vec3(0.299, 0.587, 0.114));"," if (u_threshold >= 0.0 && luminance <= u_threshold) color.rgb = vec3(0.0);"," return vec4(color.rgb, 1.0);"," }"," color.rgb *= color.a;"," return color;","}","void main(){"," if (u_bloomPass > 0.5) {"," vec2 stepUv = u_direction * max(u_radius, 0.0) / max(u_resolution, vec2(1.0)) * 0.5;"," vec4 bloom = readSource(v_uv) * 0.227027;"," bloom += readSource(v_uv + stepUv) * 0.1945946;"," bloom += readSource(v_uv - stepUv) * 0.1945946;"," bloom += readSource(v_uv + stepUv * 2.0) * 0.1216216;"," bloom += readSource(v_uv - stepUv * 2.0) * 0.1216216;"," bloom += readSource(v_uv + stepUv * 3.0) * 0.054054;"," bloom += readSource(v_uv - stepUv * 3.0) * 0.054054;"," bloom += readSource(v_uv + stepUv * 4.0) * 0.016216;"," bloom += readSource(v_uv - stepUv * 4.0) * 0.016216;"," gl_FragColor = bloom;"," return;"," }"," vec2 stepUv = u_direction * max(u_radius, 0.0) / max(u_resolution, vec2(1.0)) / 12.0;"," vec4 color = readSource(v_uv) * 0.08077993;"," color += readSource(v_uv + stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv - stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv + stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv - stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv + stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv - stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv + stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv - stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv + stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv - stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv + stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv - stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv + stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv - stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv + stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv - stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv + stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv - stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv + stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv - stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv + stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv - stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv + stepUv * 12.0) * 0.00453456;"," color += readSource(v_uv - stepUv * 12.0) * 0.00453456;"," if (color.a > 0.0001) color.rgb /= color.a;"," gl_FragColor = color;","}"].join(`\n`),Pb=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform sampler2D u_blurSource;","uniform vec2 u_texel;","uniform vec2 u_uvScale;","uniform vec2 u_uvOffset;","uniform float u_blurReady;","uniform float u_blur;","uniform float u_kuwaharaRadius;","vec3 readPrepared(vec2 displayUv){"," vec2 uv = (displayUv - u_uvOffset) / u_uvScale;"," vec3 color = texture2D(u_source, clamp(uv, vec2(0.0), vec2(1.0))).rgb;"," if (u_blurReady > 0.5 && u_blur > 0.0) {"," vec3 blurred = texture2D(u_blurSource, clamp(uv, vec2(0.0), vec2(1.0))).rgb;"," color = mix(color, blurred, clamp(u_blur, 0.0, 1.0));"," }"," return color;","}","void main(){"," float radius = floor(mix(2.0, 16.0, clamp(u_kuwaharaRadius, 0.0, 1.0)) + 0.5);"," vec3 sum = vec3(0.0);"," float sumSquares = 0.0;"," float count = 0.0;"," for (int offset = 0; offset <= 16; offset++) {"," if (float(offset) > radius) continue;"," vec3 color = readPrepared(v_uv + vec2(float(offset), 0.0) * u_texel);"," sum += color;"," sumSquares += dot(color, color) / 3.0;"," count += 1.0;"," }"," gl_FragColor = vec4(sum / count, sumSquares / count);","}"].join(`\n`),Ob=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_kuwaharaMoments;","uniform vec2 u_texel;","uniform float u_kuwaharaRadius;","uniform float u_kuwaharaSharpness;","uniform float u_kuwaharaSaturation;","void main(){"," float radius = floor(mix(2.0, 16.0, clamp(u_kuwaharaRadius, 0.0, 1.0)) + 0.5);"," vec2 origins[4];"," origins[0] = vec2(-radius, -radius);"," origins[1] = vec2(0.0, -radius);"," origins[2] = vec2(-radius, 0.0);"," origins[3] = vec2(0.0, 0.0);"," vec3 means[4];"," float variances[4];"," float minVariance = 1.0;"," for (int quadrant = 0; quadrant < 4; quadrant++) {"," vec4 moment = vec4(0.0);"," float count = 0.0;"," for (int offset = 0; offset <= 16; offset++) {"," if (float(offset) > radius) continue;"," vec2 sampleOffset = origins[quadrant] + vec2(0.0, float(offset));"," moment += texture2D(u_kuwaharaMoments, clamp(v_uv + sampleOffset * u_texel, vec2(0.0), vec2(1.0)));"," count += 1.0;"," }"," moment /= count;"," vec3 mean = moment.rgb;"," float meanSquare = moment.a * 3.0;"," float variance = max(meanSquare - dot(mean, mean), 0.0);"," means[quadrant] = mean;"," variances[quadrant] = variance;"," minVariance = min(minVariance, variance);"," }"," float exponent = 1.0 + clamp(u_kuwaharaSharpness, 0.0, 1.0) * 8.0;"," vec3 result = vec3(0.0);"," float totalWeight = 0.0;"," for (int quadrant = 0; quadrant < 4; quadrant++) {"," float weight = pow((minVariance + 0.0001) / (variances[quadrant] + 0.0001), exponent);"," result += means[quadrant] * weight;"," totalWeight += weight;"," }"," result /= max(totalWeight, 0.0001);"," float luma = dot(result, vec3(0.2126, 0.7152, 0.0722));"," float saturation = clamp(u_kuwaharaSaturation, 0.0, 1.0) * 2.0;"," gl_FragColor = vec4(clamp(mix(vec3(luma), result, saturation), 0.0, 1.0), 1.0);","}"].join(`\n`);function Nt(e){return e instanceof HTMLVideoElement||e instanceof HTMLImageElement}function Rd(e){let t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function kd(e,t,n){let r=e.createShader(n);return r?(e.shaderSource(r,t),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(L("runtime.colorGrading.compileShader",e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function Si(e,t=Db){let n=kd(e,Lb,e.VERTEX_SHADER),r=kd(e,t,e.FRAGMENT_SHADER);if(!n||!r)return n&&e.deleteShader(n),r&&e.deleteShader(r),null;let i=e.createProgram();return i?(e.attachShader(i,n),e.attachShader(i,r),e.linkProgram(i),e.deleteShader(n),e.deleteShader(r),e.getProgramParameter(i,e.LINK_STATUS)?i:(L("runtime.colorGrading.linkProgram",e.getProgramInfoLog(i)),e.deleteProgram(i),null)):null}function bi(e,t=e.LINEAR,n=e.UNSIGNED_BYTE){let r=e.createTexture();return r?(e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,n,null),r):null}function Hb(e,t){let n=Si(e,Ib);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),resolution:e.getUniformLocation(n,"u_resolution"),direction:e.getUniformLocation(n,"u_direction"),radius:e.getUniformLocation(n,"u_radius"),bloomPass:e.getUniformLocation(n,"u_bloomPass"),threshold:e.getUniformLocation(n,"u_threshold")}:null}function Gb(e,t){let n=Si(e,Pb);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),blurSource:e.getUniformLocation(n,"u_blurSource"),texel:e.getUniformLocation(n,"u_texel"),uvScale:e.getUniformLocation(n,"u_uvScale"),uvOffset:e.getUniformLocation(n,"u_uvOffset"),blurReady:e.getUniformLocation(n,"u_blurReady"),blur:e.getUniformLocation(n,"u_blur"),radius:e.getUniformLocation(n,"u_kuwaharaRadius")}:null}function Bb(e,t){let n=Si(e,Ob);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),moments:e.getUniformLocation(n,"u_kuwaharaMoments"),texel:e.getUniformLocation(n,"u_texel"),radius:e.getUniformLocation(n,"u_kuwaharaRadius"),sharpness:e.getUniformLocation(n,"u_kuwaharaSharpness"),saturation:e.getUniformLocation(n,"u_kuwaharaSaturation")}:null}function ir(e,t=e.UNSIGNED_BYTE,n=e.LINEAR){let r=bi(e,n,t),i=e.createFramebuffer();if(!r||!i)return r&&e.deleteTexture(r),i&&e.deleteFramebuffer(i),null;e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),o!==e.FRAMEBUFFER_COMPLETE?(e.deleteTexture(r),e.deleteFramebuffer(i),null):{texture:r,framebuffer:i,type:t,width:1,height:1}}function yi(e,t,n,r){t.width===n&&t.height===r||(t.width=n,t.height=r,e.bindTexture(e.TEXTURE_2D,t.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,r,0,e.RGBA,t.type,null))}function Pa(e,t,n){let r=[];for(let i of n){let o=e.getUniformLocation(t,`u_${i}`);o!==null&&r.push([i,o])}return r}function Md(e,t,n){t&&e.deleteProgram(t);for(let r of n)r&&e.deleteTexture(r)}function Ba(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});if(!t)return null;let n=Si(t),r=bi(t),i=bi(t,t.NEAREST),o=bi(t,t.NEAREST);if(!n||!r||!i||!o)return Md(t,n,[r,i,o]),null;let a=t.createBuffer();return a?(t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW),{gl:t,program:{program:n,texture:r,lutTexture:i,advancedTexture:o,advancedSignature:null,quad:a,position:t.getAttribLocation(n,"a_pos"),source:t.getUniformLocation(n,"u_source"),blurSource:t.getUniformLocation(n,"u_blurSource"),bloomSource:t.getUniformLocation(n,"u_bloomSource"),kuwaharaSource:t.getUniformLocation(n,"u_kuwaharaSource"),lut:t.getUniformLocation(n,"u_lut"),advanced:t.getUniformLocation(n,"u_advanced"),resolution:t.getUniformLocation(n,"u_resolution"),uvScale:t.getUniformLocation(n,"u_uvScale"),uvOffset:t.getUniformLocation(n,"u_uvOffset"),blurReady:t.getUniformLocation(n,"u_blurReady"),bloomReady:t.getUniformLocation(n,"u_bloomReady"),kuwaharaReady:t.getUniformLocation(n,"u_kuwaharaReady"),lutEnabled:t.getUniformLocation(n,"u_lutEnabled"),lutSize:t.getUniformLocation(n,"u_lutSize"),lutTextureSize:t.getUniformLocation(n,"u_lutTextureSize"),lutDomainMin:t.getUniformLocation(n,"u_lutDomainMin"),lutDomainMax:t.getUniformLocation(n,"u_lutDomainMax"),lutIntensity:t.getUniformLocation(n,"u_lutIntensity"),shadowWheel:t.getUniformLocation(n,"u_shadowWheel"),midtoneWheel:t.getUniformLocation(n,"u_midtoneWheel"),highlightWheel:t.getUniformLocation(n,"u_highlightWheel"),rgbCurvesEnabled:t.getUniformLocation(n,"u_rgbCurvesEnabled"),hueCurvesEnabled:t.getUniformLocation(n,"u_hueCurvesEnabled"),secondaryCount:t.getUniformLocation(n,"u_secondaryCount"),adjustUniforms:Pa(t,n,jr),detailUniforms:Pa(t,n,Lo),effectUniforms:Pa(t,n,Do),grainSeed:t.getUniformLocation(n,"u_grainSeed"),effectTime:t.getUniformLocation(n,"u_effectTime"),paletteSize:t.getUniformLocation(n,"u_paletteSize"),palette0:t.getUniformLocation(n,"u_palette0"),palette1:t.getUniformLocation(n,"u_palette1"),palette2:t.getUniformLocation(n,"u_palette2"),palette3:t.getUniformLocation(n,"u_palette3"),palette4:t.getUniformLocation(n,"u_palette4"),palette5:t.getUniformLocation(n,"u_palette5"),intensity:t.getUniformLocation(n,"u_intensity"),compareEnabled:t.getUniformLocation(n,"u_compareEnabled"),comparePosition:t.getUniformLocation(n,"u_comparePosition"),compareSoftness:t.getUniformLocation(n,"u_compareSoftness"),compareLineWidth:t.getUniformLocation(n,"u_compareLineWidth")}}):(Md(t,n,[r,i,o]),null)}function Ub(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Wb(e){if(!Ub(e))return{...nn};let t=(n,r,i,o)=>{let a=typeof n=="number"?n:Number(n);return Math.min(o,Math.max(i,Number.isFinite(a)?a:r))};return{enabled:e.enabled===!0,position:t(e.position,nn.position,0,1),softness:t(e.softness,nn.softness,0,.25),lineWidth:t(e.lineWidth,nn.lineWidth,0,12)}}function Hd(e){try{let t=new URL(e,document.baseURI);return t.protocol==="data:"?{href:t.href}:t.protocol!=="http:"&&t.protocol!=="https:"?{error:"LUT must be project-local or a data URL"}:t.origin!==window.location.origin?{error:"Remote LUT URLs are not supported"}:{href:t.href}}catch{return{error:"Invalid LUT URL"}}}function Ai(e){return e instanceof Error?e.message:"LUT failed to load"}function Vb(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0)%1e4}function Gd(e){let t=e.id||e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return Vb(t)}function Ua(e){let t=Hd(e);if("error"in t)return{state:"error",message:t.error};let n=rt.get(t.href);if(n)return n;let r=fetch(t.href,{credentials:"same-origin"}).then(o=>{if(!o.ok)throw new Error(`Failed to load LUT (${o.status})`);return o.text()}).then(o=>Kl(o,{maxSize:Vr})),i={state:"pending",promise:r};for(;rt.size>=_b;){let o=rt.keys().next().value;if(!o)break;rt.delete(o)}return rt.set(t.href,i),r.then(o=>{rt.get(t.href)===i&&rt.set(t.href,{state:"ready",lut:o})},o=>{rt.get(t.href)===i&&rt.set(t.href,{state:"error",message:Ai(o)})}),i}function Fd(e,t,n){if(e.lut?.src===t)return e.lut;let r=wo(n),{gl:i,program:o}=e;try{return Bd(i,o.lutTexture,r),e.lut={src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height},e.lutError=null,e.lutLoadingSrc=null,e.lut}catch(a){return e.lut=null,e.lutError=Ai(a),e.lutLoadingSrc=null,L("runtime.colorGrading.uploadLut",a),null}}async function zb(e){let t=Ua(e);if(t.state==="ready")return t.lut;if(t.state==="pending")return t.promise;throw new Error(t.message)}function Bd(e,t,n){e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)}function qb(e,t,n){let r=wo(n),{gl:i,program:o}=e;return Bd(i,o.lutTexture,r),{src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height}}function Xe(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function Wa(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),Xe(e.gl,t.scratch),Xe(e.gl,t.blur),t.bloom&&Xe(e.gl,t.bloom),e.effectTargets=null)}function Va(e){let t=e.kuwaharaTargets;t&&(e.gl.deleteProgram(t.horizontalProgram.program),e.gl.deleteProgram(t.resolveProgram.program),Xe(e.gl,t.moments),Xe(e.gl,t.output),e.kuwaharaTargets=null)}function xi(e,t=!1){Wa(e),Va(e),$b(e.gl,e.program),t&&e.gl.getExtension("WEBGL_lose_context")?.loseContext()}function $b(e,t){e.deleteTexture(t.texture),e.deleteTexture(t.lutTexture),e.deleteTexture(t.advancedTexture),e.deleteBuffer(t.quad),e.deleteProgram(t.program)}function jb(e){let t=Ba(e.canvas);return t?(xi(e),e.gl=t.gl,e.program=t.program,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function Ga(e){if(!e.sourceHidden)return;e.element.removeAttribute(Nn);let t=e.element.style.getPropertyValue("opacity"),n=e.element.style.getPropertyPriority("opacity");t==="0"&&n==="important"&&(e.sourceInlineOpacity===null?e.element.style.removeProperty("opacity"):e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority)),e.sourceHidden=!1}function Kb(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=Hb(t,e.program.quad),r=ir(t),i=ir(t);return!n||!r||!i?(n&&t.deleteProgram(n.program),r&&Xe(t,r),i&&Xe(t,i),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:r,blur:i,bloom:null},e.effectTargets)}function Yb(e,t){return t.bloom||(t.bloom=ir(e.gl),e.effectError=t.bloom?null:"Framebuffer effects unavailable"),t.bloom}function Nd(e){let t=e.effectTargets;t?.bloom&&(Xe(e.gl,t.bloom),t.bloom=null)}function Xb(e){if(e.kuwaharaTargets)return e.kuwaharaTargets;let{gl:t}=e,n=t.getExtension("OES_texture_half_float"),r=t.getExtension("EXT_color_buffer_half_float");if(!n||!r)return e.effectError="Kuwahara requires half-float framebuffer support",null;let i=Gb(t,e.program.quad),o=Bb(t,e.program.quad),a=ir(t,n.HALF_FLOAT_OES,t.NEAREST),l=ir(t);return!i||!o||!a||!l?(Jb(t,i,o,a,l),e.effectError="Kuwahara framebuffer effects unavailable",null):(e.kuwaharaTargets={horizontalProgram:i,resolveProgram:o,moments:a,output:l},e.kuwaharaTargets)}function Jb(e,t,n,r,i){t&&e.deleteProgram(t.program),n&&e.deleteProgram(n.program),r&&Xe(e,r),i&&Xe(e,i)}function Ud(e,t,n,r,i){let o=Math.max(1,Math.ceil(r)),a=Math.max(1,Math.ceil(i));return yi(e,t,o,a),yi(e,n,o,a),{width:o,height:a}}function vi(e,t,n,r,i,o,a,l=!1,s=-1){e.bindFramebuffer(e.FRAMEBUFFER,r.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(t.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(t.source,0),e.uniform2f(t.resolution,i.width,i.height),e.uniform2f(t.direction,o.x,o.y),e.uniform1f(t.radius,a),e.uniform1f(t.bloomPass,l?1:0),e.uniform1f(t.threshold,s),or(e,t)}function Qb(e,t,n,r,i,o,a){let l=Ud(e,t.scratch,r,i/2,o/2),s=a/2;vi(e,t.blurProgram,n,t.scratch,l,{x:1,y:0},s,!0,.5),vi(e,t.blurProgram,t.scratch.texture,r,l,{x:0,y:1},s,!0)}function Zb(e,t,n,r,i,o,a){let l=n;for(let s=0;s<Math.max(1,Math.floor(a));s++)vi(e,t.blurProgram,l,t.scratch,i,{x:1,y:0},o),vi(e,t.blurProgram,t.scratch.texture,r,i,{x:0,y:1},o),l=r.texture}function or(e,t){e.bindBuffer(e.ARRAY_BUFFER,t.quad),e.enableVertexAttribArray(t.position),e.vertexAttribPointer(t.position,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLE_STRIP,0,4)}function ex(e,t,n,r,i,o,a,l){yi(e,t.moments,i.width,i.height),yi(e,t.output,i.width,i.height);let s=t.horizontalProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.moments.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(s.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,r),e.uniform1i(s.source,0),e.uniform1i(s.blurSource,1),e.uniform2f(s.texel,1/i.width,1/i.height),e.uniform2f(s.uvScale,o.scaleX,o.scaleY),e.uniform2f(s.uvOffset,o.offsetX,o.offsetY),e.uniform1f(s.blurReady,a?1:0),e.uniform1f(s.blur,l.blur),e.uniform1f(s.radius,l.kuwaharaRadius),or(e,s);let u=t.resolveProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.output.framebuffer),e.useProgram(u.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.moments.texture),e.uniform1i(u.moments,0),e.uniform2f(u.texel,1/i.width,1/i.height),e.uniform1f(u.radius,l.kuwaharaRadius),e.uniform1f(u.sharpness,l.kuwaharaSharpness),e.uniform1f(u.saturation,l.kuwaharaSaturation),or(e,u)}function tx(e,t,n,r){if(n<=0)return!1;let i=Ud(e.gl,t.scratch,t.blur,r.width,r.height);return Zb(e.gl,t,e.program.texture,t.blur,i,.75+Math.pow(n,1.35)*32,n>.55?3:2),!0}function nx(e,t,n,r,i,o){if(n<=0)return Nd(e),null;o||Nd(e);let a=o?Yb(e,t):t.blur;return a?(Qb(e.gl,t,e.program.texture,a,i.width,i.height,r),a.texture):null}function rx(e,t,n,r){let{program:i}=e,o=t.effects.blur,a=t.effects.bloom;if(o<=0&&a<=0)return e.effectTargets&&r&&Wa(e),{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let l=Kb(e);if(!l)return{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let s=tx(e,l,o,n),u=nx(e,l,a,t.effects.bloomRadius,n,s);return{blurReady:s,bloomReady:u!==null,blurTexture:l.blur.texture,bloomTexture:u??i.texture}}function ix(e,t,n,r,i,o,a){let l=t.effects.kuwahara;if(l<=0&&!o)return e.kuwaharaTargets&&a&&Va(e),{kuwaharaReady:!1,kuwaharaTexture:e.program.texture};let s=Xb(e);return!s||l<=0?{kuwaharaReady:!1,kuwaharaTexture:s?.output.texture??e.program.texture}:(ex(e.gl,s,e.program.texture,e.effectTargets?.blur.texture??e.program.texture,n,r,i,t.effects),{kuwaharaReady:!0,kuwaharaTexture:s.output.texture})}function Wd(e,t,n,r,i={}){let o=i.releaseIdleTargets??!0;e.effectError=null;let a=rx(e,t,n,o),l=ix(e,t,n,r,a.blurReady,i.preserveKuwahara??!1,o);return{...a,...l}}function ox(e){let t=e.grading.lut?.src.trim()??"",n=e.grading.lut?.intensity??1;if(!t||n<=0)return e.lut=null,e.lutLoadingSrc=null,e.lutError=null,null;let r=Hd(t);if("error"in r)return e.lut=null,e.lutLoadingSrc=null,e.lutError=r.error,null;if(e.lut?.src===r.href)return e.lut;e.lut=null;let i=Ua(t);return i.state==="ready"?Fd(e,r.href,i.lut):i.state==="error"?(e.lutError=i.message,e.lutLoadingSrc=null,null):(e.lutLoadingSrc!==r.href&&(e.lutLoadingSrc=r.href,e.lutError=null,i.promise.then(o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(Fd(e,r.href,o),De(e))},o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=Ai(o),e.lutLoadingSrc=null,De(e))})),null)}function nr(e){if(!e)return null;if(typeof e=="string"){let t=e.trim();if(!t)return null;let n=document.getElementById(t.replace(/^#/,""));if(n&&Nt(n))return n;try{let r=document.querySelector(t);return r&&Nt(r)?r:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&Nt(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&Nt(t))return t}if(!e.selector)return null;try{let t=Array.from(document.querySelectorAll(e.selector)),n=Math.max(0,Math.floor(Number(e.selectorIndex??0)||0)),r=t[n]??null;return r&&Nt(r)?r:null}catch{return null}}function Vd(e){return e instanceof HTMLVideoElement?e.videoWidth>0&&e.videoHeight>0?{width:e.videoWidth,height:e.videoHeight}:null:e instanceof HTMLImageElement&&e.naturalWidth>0&&e.naturalHeight>0?{width:e.naturalWidth,height:e.naturalHeight}:null}function zd(e){return e instanceof HTMLVideoElement?e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&e.videoWidth>0&&e.videoHeight>0:e instanceof HTMLImageElement?e.complete&&e.naturalWidth>0&&e.naturalHeight>0:!1}function qd(e){let t=ut(e);return t&&zd(t)?t:null}function Ld(e){if(!(e instanceof HTMLVideoElement))return!1;let t=qd(e);if(!t)return!1;let n=window.getComputedStyle(t);return n.display!=="none"&&n.visibility!=="hidden"}function ax(e){return e instanceof HTMLImageElement&&e.classList.contains("__render_frame__")}function sx(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}function $d(e){if(e instanceof HTMLVideoElement){let t=qd(e);if(t)return t}return zd(e)?e:null}function Dd(e,t){let n=e.toLowerCase();if(n==="center")return .5;if(t==="x"){if(n==="left")return 0;if(n==="right")return 1}else{if(n==="top")return 0;if(n==="bottom")return 1}if(n.endsWith("%")){let r=Number.parseFloat(n);return Number.isFinite(r)?r/100:null}return null}function lx(e){let t=e.trim().split(/\\s+/).filter(Boolean),n=.5,r=.5;for(let i=0;i<t.length;i++){let o=t[i]??"",a=Dd(o,"x"),l=Dd(o,"y");if(a!==null&&(o==="left"||o==="right"||o.endsWith("%")&&i===0)){n=a;continue}if(l!==null&&(o==="top"||o==="bottom"||o.endsWith("%")&&i>0)){r=l;continue}}return{x:n,y:r}}function jd(e,t,n,r,i,o){if(e<=0||t<=0||n<=0||r<=0)return{scaleX:1,scaleY:1,offsetX:0,offsetY:0};let a=i||"fill",l=e,s=t;if(a==="contain"||a==="cover"||a==="scale-down"){let m=a==="cover"?Math.max(e/n,t/r):Math.min(e/n,t/r);l=n*m,s=r*m,a==="scale-down"&&l>n&&s>r&&(l=n,s=r)}else a==="none"&&(l=n,s=r);let u=lx(o||"center"),c=(e-l)*u.x/e,f=(t-s)*u.y/t;return{scaleX:l/e,scaleY:s/t,offsetX:c,offsetY:f}}function ux(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function Id(e,t){return Math.max(0,Math.round(e>0?e:t))}function cx(e,t){let{element:n,canvas:r}=e,i=n.parentElement;i&&ux(e,i);let o=window.getComputedStyle(t);vu(r.style,o),r.style.pointerEvents="none",r.style.position="absolute",r.style.inset="auto",r.style.left=`${n.offsetLeft}px`,r.style.top=`${n.offsetTop}px`,r.style.right="auto",r.style.bottom="auto",r.style.width=`${n.offsetWidth}px`,r.style.height=`${n.offsetHeight}px`,r.style.display="block",r.style.opacity=e.sourceOpacityForCanvas,r.style.visibility=e.sourceVisibleForCanvas?"visible":"hidden";let a=n.getBoundingClientRect(),l=Id(n.offsetWidth,a.width),s=Id(n.offsetHeight,a.height);if(l<=0||s<=0)return r.style.display="none",null;let u=Math.max(1,window.devicePixelRatio||1),c=Math.round(l*u),f=Math.round(s*u);return r.width!==c&&(r.width=c),r.height!==f&&(r.height=f),{width:c,height:f}}function tn(e,t,n){e.uniform3f(t,Number.parseInt(n.slice(1,3),16)/255,Number.parseInt(n.slice(3,5),16)/255,Number.parseInt(n.slice(5,7),16)/255)}function Lt(e,t,n,r){e.set(r,(t*je+n)*4)}function yt(e,t){return Math.min(1,Math.max(1/255,(e*(127/t)+128)/255))}function Oa(e,t,n){return e.length>=3?_o(e,t,n):new Float32Array(je)}function Ft(e,t){return e[t]??0}function dx(e,t,n){let r=Vt(t.red),i=Vt(t.green),o=Vt(t.blue),a=Vt(t.master),l=Oa(n.hueVsHue,-180,180),s=Oa(n.hueVsSaturation,-1,1),u=Oa(n.hueVsLuma,-1,1);for(let c=0;c<je;c+=1)Lt(e,0,c,[Ft(r,c),Ft(i,c),Ft(o,c),Ft(a,c)]),Lt(e,1,c,[yt(Ft(l,c),180),yt(Ft(s,c),1),yt(Ft(u,c),1),1])}function fx(e,t,n){let r=n*Mb;Lt(e,2,r,[t.key.hue.center/360,t.key.hue.range/180,t.key.hue.softness/180,1]),Lt(e,2,r+1,[t.key.saturation.min,t.key.saturation.max,t.key.saturation.softness/.5,0]),Lt(e,2,r+2,[t.key.luma.min,t.key.luma.max,t.key.luma.softness/.5,0]),Lt(e,2,r+3,[yt(t.correction.hueShift,180),yt(t.correction.saturation,1),yt(t.correction.luma,1),yt(t.correction.temperature,1)]),Lt(e,2,r+4,[yt(t.correction.tint,1),.5,.5,1])}function mx(e,t,n){let r=new Float32Array(je*sr*4);dx(r,e,t);let i=0;for(let o of n)o.enabled&&(fx(r,o,i),i+=1);return r}var Pd=new WeakMap;function px(e,t,n){let r=Pd.get(e);if(r?.hueCurves===t&&r.secondaries===n)return r.signature;let i=JSON.stringify([e,t,n]);return Pd.set(e,{hueCurves:t,secondaries:n,signature:i}),i}function hx(e,t,n,r){let{curves:i,hueCurves:o}=n,a=px(i,o,r);if(t.advancedSignature===a)return;let l=Uint8Array.from(mx(i,o,r),kn);e.activeTexture(e.TEXTURE5),e.bindTexture(e.TEXTURE_2D,t.advancedTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,je,sr,0,e.RGBA,e.UNSIGNED_BYTE,l),t.advancedSignature=a}function Ha(e,t,n){e.uniform3f(t,n.hue/360,n.amount,n.level)}function Kd(e,t,n,r,i,o,a,l,s,u,c,f){e.uniform1i(t.source,0),e.uniform1i(t.blurSource,1),e.uniform1i(t.lut,2),e.uniform1i(t.kuwaharaSource,3),e.uniform1i(t.bloomSource,4),e.uniform1i(t.advanced,5),e.uniform2f(t.resolution,s.width,s.height),e.uniform2f(t.uvScale,u.scaleX,u.scaleY),e.uniform2f(t.uvOffset,u.offsetX,u.offsetY),e.uniform1f(t.blurReady,i?1:0),e.uniform1f(t.bloomReady,o?1:0),e.uniform1f(t.kuwaharaReady,a?1:0),e.uniform1f(t.lutEnabled,r?1:0),e.uniform1f(t.lutSize,r?.size??2),e.uniform2f(t.lutTextureSize,r?.textureWidth??1,r?.textureHeight??1),e.uniform3f(t.lutDomainMin,r?.domainMin[0]??0,r?.domainMin[1]??0,r?.domainMin[2]??0),e.uniform3f(t.lutDomainMax,r?.domainMax[0]??1,r?.domainMax[1]??1,r?.domainMax[2]??1),e.uniform1f(t.lutIntensity,n.lut?.intensity??0);let{curves:m,hueCurves:p,secondaries:b}=n,v=Oo(m),x=Ho(p),_=Go(b)?b.reduce((M,D)=>M+Number(D.enabled),0):0;(v||x||_>0)&&hx(e,t,n,b),Ha(e,t.shadowWheel,n.wheels.shadows),Ha(e,t.midtoneWheel,n.wheels.midtones),Ha(e,t.highlightWheel,n.wheels.highlights),e.uniform1f(t.rgbCurvesEnabled,v?1:0),e.uniform1f(t.hueCurvesEnabled,x?1:0),e.uniform1f(t.secondaryCount,_);for(let[M,D]of t.adjustUniforms)e.uniform1f(D,n.adjust[M]);for(let[M,D]of t.detailUniforms)e.uniform1f(D,n.details[M]);e.uniform1f(t.grainSeed,c),e.uniform1f(t.effectTime,f);for(let[M,D]of t.effectUniforms)e.uniform1f(D,n.effects[M]);let R=n.palette??(n.effects.engraving>0||n.effects.crosshatch>0?Rb:Da),T=R[R.length-1]??Da[1];e.uniform1f(t.paletteSize,R.length),tn(e,t.palette0,R[0]??Da[0]),tn(e,t.palette1,R[1]??T),tn(e,t.palette2,R[2]??T),tn(e,t.palette3,R[3]??T),tn(e,t.palette4,R[4]??T),tn(e,t.palette5,R[5]??T),e.uniform1f(t.intensity,n.intensity),e.uniform1f(t.compareEnabled,l.enabled?1:0),e.uniform1f(t.comparePosition,l.position),e.uniform1f(t.compareSoftness,l.softness),e.uniform1f(t.compareLineWidth,l.lineWidth)}function gx(e){if(!e.sourceHidden){let t=e.element.getAttribute($r);t!==null?(e.sourceInlineOpacity=t===""?null:t,e.sourceInlineOpacityPriority=""):(e.sourceInlineOpacity=e.element.style.getPropertyValue("opacity")||null,e.sourceInlineOpacityPriority=e.element.style.getPropertyPriority("opacity"))}e.element.setAttribute(Nn,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function it(e){let t=pu.find(n=>n.path===e);if(!t)throw new Error(`Missing color-grading animation property: ${e}`);return t}var Yd=it("intensity"),Xd=it("lut.intensity"),Jd=it("adjust.exposure"),Qd=it("effects.kuwahara"),Zd=[["blur",it("effects.blur")],["bloom",it("effects.bloom")],["kuwahara",Qd],["pixelate",it("effects.pixelate")],["ascii",it("effects.ascii")],["dither",it("effects.dither")]],ef=[Yd,Xd,Jd,...Zd.map(([,e])=>e)];function Dt(e,t){let n=e.style.getPropertyValue(t.name);if(!n)return null;let r=Number(n);return Number.isFinite(r)?Math.min(t.max,Math.max(t.min,r)):null}function rr(e,t){return t!==null&&(xu(t)||ef.some(n=>Dt(e,n)!==null))}function bx(e,t){let n=null;for(let[r,i]of Zd){let o=Dt(e,i);o!==null&&(n??(n={...t.effects}),n[r]=o)}return n}function xx(e){let{element:t,grading:n}=e,r=Dt(t,Yd),i=Dt(t,Xd),o=Dt(t,Jd),a=bx(t,n);if(![r,i,o].some(u=>u!==null)&&a===null)return n;let s={...n,adjust:o===null?n.adjust:{...n.adjust,exposure:o},effects:a??n.effects};return r!==null&&(s.intensity=r),n.lut&&i!==null&&(s.lut={...n.lut,intensity:i}),s}function tf(e,t,n){e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)}function nf(e,t,n){let r=[t.texture,n.blurTexture,t.lutTexture,n.kuwaharaTexture,n.bloomTexture,t.advancedTexture];for(let[i,o]of r.entries())e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,o)}function De(e){if(e.destroyed||e.contextLost)return!1;let t=$d(e.element);if(!t)return e.hasDrawn||(e.canvas.style.display="none"),!1;let n=Vd(t);if(!n)return!1;let r=t instanceof HTMLElement?t:e.element,i=e.element.style.getPropertyValue("opacity"),o=e.element.style.getPropertyPriority("opacity"),a=e.sourceHidden&&i==="0"&&o==="important",l=e.element.style.getPropertyValue("visibility"),s=ax(t);s&&sx(e,t),a&&!s&&(e.sourceInlineOpacity!==null?e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority||""):e.element.style.removeProperty("opacity"));let u=window.getComputedStyle(s?t:e.element);e.sourceOpacityForCanvas=u.opacity||"1",a&&!s&&e.element.style.setProperty("opacity","0","important"),e.sourceVisibleForCanvas=(s||l!=="hidden")&&u.visibility!=="hidden";let c=cx(e,r);if(!c)return!1;let f=window.getComputedStyle(r),m=jd(c.width,c.height,n.width,n.height,f.objectFit,f.objectPosition),{gl:p,program:b}=e;try{let v=xx(e),x=ox(e);tf(p,b.texture,t);let _=Dt(e.element,Qd)!==null,R=Wd(e,v,c,m,{preserveKuwahara:_});p.bindFramebuffer(p.FRAMEBUFFER,null),p.viewport(0,0,c.width,c.height),p.useProgram(b.program),nf(p,b,R);let T=window.__player?.getTime?.(),M=typeof T=="number"&&Number.isFinite(T)?Math.max(0,T):e.element instanceof HTMLVideoElement?Math.max(0,e.element.currentTime):0,D=e.grainSeed+Math.floor(M*60);return Kd(p,b,v,x,R.blurReady,R.bloomReady,R.kuwaharaReady,e.compare,c,m,D,M),or(p,b),gx(e),e.hasDrawn=!0,e.drawError=null,!0}catch(v){return e.drawError=v instanceof Error?v.message:"Shader draw failed",L("runtime.colorGrading.drawEntry",v),!1}}function yx(e,t,n){let r=e.getBoundingClientRect(),i=e.offsetWidth||r.width||t.width,o=e.offsetHeight||r.height||t.height,a=Math.min(320,Math.max(64,Math.round(n??160))),l=i>0&&o>0?i/o:t.width/t.height;return l>=1?{width:a,height:Math.max(1,Math.round(a/l))}:{width:Math.max(1,Math.round(a*l)),height:a}}function vx(){let e=document.createElement("canvas"),t=Ba(e);return t?{canvas:e,...t,lut:null,effectTargets:null,kuwaharaTargets:null,effectError:null}:null}function Sx(e,t){let n=t?void 0:window.__player?.getTime?.();return typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):e instanceof HTMLVideoElement?Math.max(0,e.currentTime):0}function Ax(e,t,n,r){let i=$d(t);if(!i)return null;let o=Vd(i);if(!o)return null;let a=yx(t,o,n);e.canvas.width=a.width,e.canvas.height=a.height;let l=i instanceof HTMLElement?i:t,s=window.getComputedStyle(l),u=jd(a.width,a.height,o.width,o.height,s.objectFit,s.objectPosition);return tf(e.gl,e.program.texture,i),{dimensions:a,uv:u,effectTime:Sx(t,r),grainSeed:Gd(t)+(t instanceof HTMLVideoElement?Math.floor(t.currentTime*60):0)}}async function Ex(e,t,n,r,i=!1){let o=Ax(e,t,r,i);if(!o)return null;let{dimensions:a,uv:l,grainSeed:s,effectTime:u}=o,c=[];for(let f of n.slice(0,32)){let m=Kr(f.grading);if(!m){c.push({id:f.id,dataUrl:null,error:"Invalid grading"});continue}let p=null;try{m.lut&&(e.lut?.src!==m.lut.src&&(e.lut=qb(e,m.lut.src,await zb(m.lut.src))),p=e.lut),c.push({id:f.id,dataUrl:wx(e,m,p,a,l,s,u)})}catch(b){c.push({id:f.id,dataUrl:null,error:Ai(b)})}}return{...a,images:c}}function wx(e,t,n,r,i,o,a){let{canvas:l,gl:s,program:u}=e,c=Wd(e,t,r,i,{releaseIdleTargets:!1});return s.bindFramebuffer(s.FRAMEBUFFER,null),s.viewport(0,0,r.width,r.height),s.useProgram(u.program),nf(s,u,c),n||(e.lut=null),Kd(s,u,t,n,c.blurReady,c.bloomReady,c.kuwaharaReady,nn,r,i,o,a),or(s,u),l.toDataURL("image/png")}function Ye(e,t,n,r){t.addEventListener(n,r),e.cleanup.push(()=>t.removeEventListener(n,r))}function Cx(e){e.animationFrame!==null&&(window.cancelAnimationFrame(e.animationFrame),e.animationFrame=null),e.videoFrameHandle!==null&&e.element instanceof HTMLVideoElement&&(e.element.cancelVideoFrameCallback?.(e.videoFrameHandle),e.videoFrameHandle=null)}function ar(e){if(e.destroyed||!(e.element instanceof HTMLVideoElement)||e.videoFrameHandle!==null||e.animationFrame!==null)return;let t=e.element,n=t;if(typeof n.requestVideoFrameCallback=="function"){e.videoFrameHandle=n.requestVideoFrameCallback(()=>{e.videoFrameHandle=null,De(e),!e.destroyed&&!t.paused&&!t.ended&&ar(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,De(e),!e.destroyed&&!t.paused&&!t.ended&&ar(e)})}function _x(e){let t=()=>{De(e)};if(Ye(e,e.element,"load",t),Ye(e,e.element,"loadedmetadata",t),Ye(e,e.element,"loadeddata",t),Ye(e,e.element,"seeked",t),Ye(e,e.element,"timeupdate",t),Ye(e,window,"resize",t),e.element instanceof HTMLVideoElement&&(Ye(e,e.element,"play",()=>ar(e)),Ye(e,e.element,"pause",t)),Ye(e,e.canvas,"webglcontextlost",n=>{n.preventDefault(),e.contextLost=!0,e.drawError="WebGL context lost",e.canvas.style.display="none",Ga(e)}),Ye(e,e.canvas,"webglcontextrestored",()=>{if(e.contextLost=!1,!jb(e)){e.contextLost=!0,e.drawError="WebGL context restore failed",Ga(e);return}e.drawError=null,De(e)}),typeof ResizeObserver<"u"&&(e.resizeObserver=new ResizeObserver(t),e.resizeObserver.observe(e.element)),typeof MutationObserver<"u"){let n=()=>{let a=e.element.style;return`${a.transform}|${a.translate}|${a.rotate}|${a.scale}|${a.left}|${a.top}|${a.width}|${a.height}`},r=n(),i=!1,o=new MutationObserver(()=>{i||n()!==r&&(i=!0,requestAnimationFrame(()=>{i=!1,r=n(),De(e)}))});o.observe(e.element,{attributes:!0,attributeFilter:["style"]}),e.cleanup.push(()=>o.disconnect())}}function Tx(e){if(e.destroyed)return null;e.destroyed=!0,Cx(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();return e.cleanup.length=0,e.canvas.remove(),Wa(e),Va(e),Ga(e),e.touchedParent&&(e.parentInlinePosition===null?e.touchedParent.style.removeProperty("position"):e.touchedParent.style.position=e.parentInlinePosition),{canvas:e.canvas,gl:e.gl,program:e.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}function rf(e,t){return e.removeAttribute("style"),t.id?e.id=`${uu}${t.id}`:e.removeAttribute("id"),e.className=Cb,e.setAttribute(wb,"true"),e.setAttribute("data-hyperframes-ignore",""),e.setAttribute("data-hyperframes-picker-ignore",""),e.setAttribute("data-hf-ignore",""),e.setAttribute("aria-hidden","true"),e.style.pointerEvents="none",e.style.display="none",t.parentNode?.insertBefore(e,t.nextSibling),e}function Rx(e){return rf(document.createElement("canvas"),e)}function of(){let e=new WeakMap,t=new Set,n=[],r=null,i=null,o=Promise.resolve(),a=!1,l=(E,S,A)=>{let C=e.get(E);if(C)return C.grading=S,C.source=A,De(C),E instanceof HTMLVideoElement&&!E.paused&&ar(C),!0;let F=n.pop();if(F)rf(F.canvas,E);else{let q=Rx(E),W=Ba(q);if(!W)return q.remove(),!1;F={canvas:q,gl:W.gl,program:W.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}let I={element:E,...F,grading:S,compare:{...nn},lut:null,lutLoadingSrc:null,lutError:null,drawError:null,effectTargets:null,kuwaharaTargets:null,effectError:null,source:A,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(E).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(E).visibility!=="hidden",hasDrawn:!1,contextLost:!1,grainSeed:Gd(E),destroyed:!1};return e.set(E,I),t.add(E),_x(I),De(I),E instanceof HTMLVideoElement&&!E.paused&&ar(I),!0},s=(E,S)=>{if(a)return!1;let A=nr(E);if(!A)return!1;let C=e.get(A);if(!C){let F=gi(A);if(!rr(A,F)||!l(A,F,"attribute"))return!1;C=e.get(A)}return C?(C.compare=Wb(S),De(C),!0):!1},u=E=>{let S=e.get(E);if(!S)return;let A=Tx(S);A&&(S.contextLost||n.length>=Tb?xi(A,!0):n.push(A)),e.delete(E),t.delete(E)},c=()=>{if(a)return 0;let E=new Set;document.querySelectorAll(`video[${Fn}], img[${Fn}]`).forEach(A=>{if(!Nt(A))return;E.add(A);let C=gi(A);rr(A,C)&&(Rd(A)||Ld(A))?l(A,C,"attribute"):u(A)});for(let A of t){let C=e.get(A);C&&(!A.isConnected||C.source==="attribute"&&!E.has(A))&&u(A)}return t.size},f=()=>{if(a)return 0;let E=0;for(let S of t){let A=e.get(S);A&&De(A)&&(E+=1)}return E},m=async()=>{let E=new Set;for(let S of t){let A=e.get(S)?.grading.lut;if(!A?.src.trim()||(A.intensity??1)<=0)continue;let C=Ua(A.src);C.state==="pending"&&E.add(C.promise)}return E.size>0&&await Promise.allSettled(E),f(),E.size},p=()=>{if(a)return 0;let E=0;for(let S of t){let A=e.get(S);!A||!ef.some(F=>Dt(S,F)!==null)||S instanceof HTMLVideoElement&&!S.paused&&!S.ended||De(A)&&(E+=1)}return E},b=(E,S)=>{if(a)return!1;let A=nr(E);if(!A)return!1;let C=Kr(S);return rr(A,C)?l(A,C,"live"):(u(A),!0)},v=(E,S)=>{if(!Nt(E))return!1;let A=e.get(E);if(!A){if(!S)return!1;let C=gi(E);return rr(E,C)&&l(E,C,"attribute")}return A.sourceVisibleForCanvas=S,!S&&A.source==="attribute"&&u(E),!0},x=E=>{let S=nr(E);if(!S)return{state:"missing",message:"Media not found"};let A=e.get(S);if(A)return A.effectError?{state:"unavailable",message:A.effectError}:A.drawError?{state:"unavailable",message:A.drawError}:A.lutError?{state:"unavailable",message:`LUT error: ${A.lutError}`}:A.grading.lut&&A.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:A.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:A.lut?"Shader + LUT active":"Shader active"};let C=gi(S);return rr(S,C)?!Rd(S)&&!Ld(S)?{state:"pending",message:"Waiting for visible media"}:{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},_=async(E,S,A)=>{let C=async()=>{if(a||S.length===0)return null;let I=nr(E);return!I||(i??(i=vx()),!i)?null:Ex(i,I,S,A?.maxDimension,A?.useMediaTime)},F=o.then(C,C);return o=F.then(()=>{},()=>{}),F},R=E=>{let S=nr(E);if(!(S instanceof HTMLVideoElement))return null;if(!S.paused)return()=>{};let A=S.currentTime,C=S.loop,F=S.muted;return S.loop=!0,S.muted=!0,(S.ended||Number.isFinite(S.duration)&&A>=S.duration)&&(S.currentTime=0),S.play().catch(()=>{}),()=>{S.pause(),S.loop=C,S.muted=F,S.currentTime=A}},T=()=>{if(!a){a=!0,r?.disconnect(),r=null;for(let E of t)u(E);for(let E of n)xi(E,!0);n.length=0,i&&(xi(i,!0),i=null)}};document.body&&(r=new MutationObserver(()=>c()),r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[Fn]}));let M={refresh:c,redraw:f,redrawAnimated:p,waitForActiveLuts:m,setGrading:b,setCompare:s,setSourceVisibility:v,getStatus:x,renderPreviews:_,startPreviewPlayback:R,destroy:T},D=window;return D.__hf=D.__hf||{},D.__hf.colorGrading=M,c(),M}var Ei=class{constructor(t){ge(this,"_baseTime",0);ge(this,"_playStartMs",null);ge(this,"_rate",1);ge(this,"_duration",1/0);ge(this,"_nowMs");ge(this,"_audioSource",null);this._baseTime=t?.initialTime??0,this._rate=t?.rate??1,this._duration=t?.duration??1/0,this._nowMs=t?.nowMs??(()=>performance.now())}now(){if(this._playStartMs===null)return this._baseTime;if(this._audioSource){let r=null;if("currentTimeSeconds"in this._audioSource)r=this._audioSource.currentTimeSeconds;else{let{el:i,compositionStart:o,mediaStart:a}=this._audioSource;!i.paused&&Number.isFinite(i.currentTime)&&(r=(i.currentTime-a)/(i.playbackRate>0?i.playbackRate:1)*this._rate+o)}if(r!==null)return Number.isFinite(this._duration)&&r>=this._duration?this._duration:Math.max(0,r)}let t=(this._nowMs()-this._playStartMs)/1e3,n=this._baseTime+t*this._rate;return Number.isFinite(this._duration)&&n>=this._duration?this._duration:Math.max(0,n)}play(){return this._playStartMs!==null||Number.isFinite(this._duration)&&this._baseTime>=this._duration?!1:(this._playStartMs=this._nowMs(),!0)}pause(){return this._playStartMs===null?!1:(this._baseTime=this.now(),this._playStartMs=null,!0)}seek(t){let n=Number.isFinite(this._duration)?Math.max(0,Math.min(t,this._duration)):Math.max(0,t);this._baseTime=n,this._playStartMs!==null&&(this._playStartMs=this._nowMs())}isPlaying(){return this._playStartMs!==null}setRate(t){let n=Number.isFinite(t)&&t>0?Math.max(.1,Math.min(5,t)):1;this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs()),this._rate=n}getRate(){return this._rate}setDuration(t){this._duration=Number.isFinite(t)&&t>0?t:1/0,this._baseTime>this._duration&&(this._baseTime=this._duration)}getDuration(){return this._duration}attachAudioSource(t){this._audioSource=t}detachAudioSource(){this._audioSource&&this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs()),this._audioSource=null}hasAudioSource(){return this._audioSource!==null}getSource(){if(this._audioSource&&this._playStartMs!==null){if("currentTimeSeconds"in this._audioSource)return"audio";let{el:t}=this._audioSource;if(!t.paused&&Number.isFinite(t.currentTime))return"audio"}return"monotonic"}snapshot(){return{time:this.now(),playing:this.isPlaying(),rate:this._rate,duration:this._duration,source:this.getSource()}}reachedEnd(){return Number.isFinite(this._duration)&&this.now()>=this._duration}};var kx=100,Mx=8,Fx=4096,za=e=>e;function Nx(e,t,n){return!(!!e.curve||e.viaX!==void 0&&e.viaY!==void 0)&&t==="linear"&&!n}function Lx(e){let t=Math.ceil(e*kx);return Math.min(Fx,Math.max(Mx,t))}function Dx(e,t,n,r,i){let{scheduledAt:o,elapsed:a,rate:l}=r,s=i??za,u=R=>o+(R-a)/l,c=e.points[t],f=e.points[t+1],m=u(f.t);if(m<=o)return null;let p=Math.max(o,u(c.t)),b=m-p;if(b<=0)return null;if(Nx(c,n,i))return{kind:"ramp",time:m,value:s(f.v)};let v=Lx(b),x=Ll(e,Math.max(c.t,a),f.t,v,n),_=new Float32Array(v);for(let R=0;R<v;R+=1)_[R]=s(x[R]??0);return{kind:"curve",time:p,duration:b,values:_}}function Ix(e,t,n,r){let i=[];for(let a=0;a+1<e.points.length;a+=1){let l=Dx(e,a,t,n,r);l&&i.push(l)}let o=i[0];return o?.kind==="curve"&&o.time<=n.scheduledAt||i.unshift({kind:"set",time:n.scheduledAt,value:(r??za)(_n(e,n.elapsed,t))}),i}function Px(e,t){for(let n of t)if(n.kind==="set")e.setValueAtTime(n.value,n.time);else if(n.kind==="ramp")e.linearRampToValueAtTime(n.value,n.time);else try{e.setValueCurveAtTime(n.values,n.time,n.duration)}catch{let r=n.values[n.values.length-1]??0;e.linearRampToValueAtTime(r,n.time+n.duration)}}function lr(e){for(let t of e)t.param.cancelScheduledValues(0)}function rn(e,t){for(let n of e)typeof n.param.cancelAndHoldAtTime=="function"?n.param.cancelAndHoldAtTime(t):n.param.cancelScheduledValues(t)}function qa(e,t,n,r){if(t.points.length!==0)for(let i of e){if(lr([i]),Nl(t)){let o=(i.map??za)(t.points[0].v);i.param.setValueAtTime(o,r.scheduledAt);continue}Px(i.param,Ix(t,n,r,i.map))}}function af(e,t,n,r,i){let o=new Map(n.filter(l=>l.id).map(l=>[l.id,l.handle])),a=[];for(let l of e.lanes){let s=Cn(l.target);if(!s)continue;let u=s.kind==="preset"?i?.[s.presetId]:s.kind==="fx"?o.get(s.nodeId)?.automation?.[s.param]:void 0;if(!u||u.length===0)continue;let c=fo(l.target,t);c&&(qa(u,l,c.scale,r),a.push(...u))}return a}function sf(e){return e.lanes.find(t=>t.target===Bt)??null}var Ox=`\nconst dbToLin = (db) => Math.pow(10, db / 20);\n\n/**\n * One-pole envelope followers, one per channel.\n *\n * Per channel matters: the followers advance once per sample, so a single shared\n * follower stepped once per channel per sample. On stereo that ran a 20 ms attack\n * as 10 ms, and gave the right channel a gain computed from an envelope that had\n * already traversed the left \\u2014 so the two channels ducked by different amounts\n * from the same input and the image pumped.\n */\nclass EnvBank {\n constructor(attackMs, releaseMs) { this.set(attackMs, releaseMs); this.values = []; }\n set(attackMs, releaseMs) {\n this.a = Math.exp(-1 / (sampleRate * Math.max(1e-5, attackMs / 1000)));\n this.r = Math.exp(-1 / (sampleRate * Math.max(1e-5, releaseMs / 1000)));\n }\n push(ch, x) {\n const prev = this.values[ch] ?? 0;\n const m = Math.abs(x);\n const c = m > prev ? this.a : this.r;\n const next = m + c * (prev - m);\n this.values[ch] = next;\n return next;\n }\n}\n\n/** Soft-knee gain computer in dB, matching acompressor\'s shape. */\nfunction kneeGain(envDb, thresholdDb, ratio, kneeDb) {\n const over = envDb - thresholdDb;\n if (kneeDb > 0 && over > -kneeDb && over < kneeDb) {\n const t = (over + kneeDb) / (2 * kneeDb);\n return -((1 - 1 / ratio) * kneeDb * t * t);\n }\n return over > 0 ? -(over * (1 - 1 / ratio)) : 0;\n}\n\n// log10/exp per sample is the single most expensive thing a dynamics processor\n// can do on the audio thread, and every sample below the knee needs neither:\n// its gain is exactly unity. Comparing envelopes in the linear domain lets the\n// quiet majority of samples skip the transcendentals entirely.\nconst LN10_OVER_20 = Math.LN10 / 20;\nconst dbToLinFast = (db) => Math.exp(db * LN10_OVER_20);\n\nclass HfCompressor extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.env = new EnvBank(this.p.attack ?? 20, this.p.release ?? 250);\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n this.env.set(this.p.attack ?? 20, this.p.release ?? 250);\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const p = this.p;\n const makeup = dbToLin(p.makeup ?? 0);\n const mix = p.mix ?? 1;\n // Knee is expressed as a ratio in FFmpeg; convert to dB width.\n const kneeDb = 20 * Math.log10(Math.max(1.0001, p.knee ?? 2.83));\n const thresholdDb = p.threshold ?? -24;\n const ratio = p.ratio ?? 4;\n // Below this the gain computer returns unity, so the sample needs no\n // logarithm at all.\n const kneeStartLin = dbToLin(thresholdDb - kneeDb);\n const dry = 1 - mix;\n for (let ch = 0; ch < i.length; ch++) {\n const inp = i[ch], out = o[ch];\n for (let n = 0; n < inp.length; n++) {\n const x = inp[n];\n // Per-channel follower, and the sub-knee shortcut: below the knee the\n // gain is exactly unity, so the sample needs no logarithm at all.\n const env = this.env.push(ch, x);\n if (env <= kneeStartLin) {\n out[n] = x * makeup * mix + x * dry;\n continue;\n }\n const envDb = 20 * Math.log10(env);\n const g = dbToLinFast(kneeGain(envDb, thresholdDb, ratio, kneeDb));\n out[n] = x * g * makeup * mix + x * dry;\n }\n }\n return true;\n }\n}\nregisterProcessor("hf-compressor", HfCompressor);\n\nclass HfLimiter extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.env = new EnvBank(this.p.attack ?? 5, this.p.release ?? 50);\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n this.env.set(this.p.attack ?? 5, this.p.release ?? 50);\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const ceiling = dbToLin(this.p.limit ?? -1);\n const outGain = dbToLin(this.p.level_out ?? 0);\n for (let ch = 0; ch < i.length; ch++) {\n const inp = i[ch], out = o[ch];\n for (let n = 0; n < inp.length; n++) {\n const x = inp[n];\n const env = this.env.push(ch, x);\n // Only ever attenuate: a limiter that can raise level is a compressor.\n const g = env > ceiling ? ceiling / env : 1;\n out[n] = x * g * outGain;\n }\n }\n return true;\n }\n}\nregisterProcessor("hf-limiter", HfLimiter);\n\nclass HfGate extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.env = new EnvBank(this.p.attack ?? 1, this.p.release ?? 100);\n this.gains = [];\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n this.env.set(this.p.attack ?? 1, this.p.release ?? 100);\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const p = this.p;\n const threshold = dbToLin(p.threshold ?? -35);\n const floor = dbToLin(p.range ?? -24);\n const ratio = p.ratio ?? 10;\n // Knee is declared in the registry as a ratio, like the compressor\'s; a\n // hard threshold ignored it and chattered on material sitting right at the\n // gate point.\n const kneeDb = 20 * Math.log10(Math.max(1.0001, p.knee ?? 2.83));\n const kneeLin = dbToLin((p.threshold ?? -35) + kneeDb);\n for (let ch = 0; ch < i.length; ch++) {\n const inp = i[ch], out = o[ch];\n for (let n = 0; n < inp.length; n++) {\n const x = inp[n];\n const env = this.env.push(ch, x);\n let target = 1;\n // Above the threshold the gate is fully open; skip the pow entirely.\n if (env < threshold) {\n const under = env > 1e-9 ? threshold / env : 1e9;\n target = Math.max(floor, 1 / Math.pow(under, ratio - 1));\n if (!isFinite(target)) target = floor;\n }\n // Smooth toward the target so the gate does not click on every sample.\n const held = this.gains[ch] ?? 1;\n const c = target < held ? this.env.r : this.env.a;\n const smoothed = target + c * (held - target);\n this.gains[ch] = smoothed;\n out[n] = x * smoothed;\n }\n }\n return true;\n }\n}\nregisterProcessor("hf-gate", HfGate);\n\nclass HfBitcrush extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.holds = [];\n this.held = [];\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const p = this.p;\n const levels = Math.pow(2, (p.bits ?? 8) - 1);\n const step = Math.max(1, Math.round(p.samples ?? 1));\n const mix = p.mix ?? 1;\n for (let ch = 0; ch < i.length; ch++) {\n const inp = i[ch], out = o[ch];\n if (this.held[ch] === undefined) this.held[ch] = 0;\n if (this.holds[ch] === undefined) this.holds[ch] = 0;\n for (let n = 0; n < inp.length; n++) {\n // Per channel: advancing one shared counter only on the last channel\n // left every earlier channel either unheld or frozen for a whole\n // 128-sample quantum, clicking once a block.\n if (this.holds[ch] === 0) this.held[ch] = Math.round(inp[n] * levels) / levels;\n out[n] = this.held[ch] * mix + inp[n] * (1 - mix);\n this.holds[ch] = (this.holds[ch] + 1) % step;\n }\n }\n return true;\n }\n}\nregisterProcessor("hf-bitcrush", HfBitcrush);\n\n/** Linear-interpolated read, \\`delaySamples\\` behind the write head. */\nfunction readTap(ring, write, delaySamples) {\n const len = ring.length;\n const pos = (write - 1 - delaySamples + len) % len;\n const i0 = Math.floor(pos);\n const frac = pos - i0;\n const i1 = (i0 + 1) % len;\n return ring[i0] * (1 - frac) + ring[i1] * frac;\n}\n\n/** Equal-power-ish crossfade, zero at a tap\'s reset point \\u2014 hides the splice. */\nfunction xfade(phase) {\n return Math.sin(Math.PI * phase);\n}\n\n/**\n * Dual-tap granular delay line: two read taps 180\\xB0 apart in a 100 ms grain,\n * each sweeping at a speed relative to the write head that shifts pitch\n * without changing duration. One tap is always fading in as the other fades\n * out, which hides the splice each tap makes when it wraps.\n *\n * write/phase are block-level state, advanced once per SAMPLE across all\n * channels together (not once per channel) \\u2014 advancing them inside the\n * per-channel loop would move the tap 2x/4x too fast on a stereo/quad input.\n */\nclass HfPitchshift extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.grain = Math.round(sampleRate * 0.1);\n this.buf = [];\n this.write = 0;\n this.phase = 0;\n // Samples written so far, capped at one grain. The taps read up to a grain\n // behind the write head, so until this fills they would read the ring\'s\n // zeros \\u2014 the head of every clip came out attenuated or silent.\n this.filled = 0;\n // How much of the wet (pitch-shifted) path is currently in the output, and\n // where it is heading. Crossing between dry and wet is a ~50 ms jump in the\n // signal, so it is RAMPED rather than switched: a hard swap either way is a\n // click. Ramping in both directions is also what lets a node return to true\n // bypass at semitones 0 \\u2014 a one-way latch left preview stuck with the delay\n // that the render, building a fresh node from the attribute, does not have.\n this.wet = 0;\n this.wetTarget = 0;\n // ~15 ms one-pole, short enough to feel immediate on a slider drag and long\n // enough that the splice is inaudible.\n this.wetCoef = Math.exp(-1 / (sampleRate * 0.015));\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const p = this.p;\n const semitones = Math.max(-12, Math.min(12, p.semitones ?? 0));\n const mix = Math.max(0, Math.min(1, p.mix ?? 1));\n const grain = this.grain;\n const ringLen = grain * 2;\n const n = i[0] ? i[0].length : 0;\n for (let ch = 0; ch < i.length; ch++) {\n if (!this.buf[ch]) this.buf[ch] = new Float32Array(ringLen);\n }\n\n // Nothing to shift, or mixed fully out. The grain delay is ~grain/2\n // whatever the ratio, so at semitones=0 this degenerated into a pure 50 ms\n // delay of the signal \\u2014 while the copy for that exact setting reads\n // "Unchanged pitch".\n this.wetTarget = semitones === 0 ? 0 : mix;\n\n // Fully dry AND settled: take the cheap transparent path. The ring keeps\n // filling, so a later shift does not start cold.\n if (this.wetTarget === 0 && this.wet < 1e-4) {\n this.wet = 0;\n let w = this.write;\n for (let s = 0; s < n; s++) {\n for (let ch = 0; ch < i.length; ch++) {\n const x = i[ch][s];\n this.buf[ch][w] = x;\n o[ch][s] = x;\n }\n w = (w + 1) % ringLen;\n }\n this.write = w;\n this.filled = Math.min(grain, this.filled + n);\n return true;\n }\n\n const ratio = Math.pow(2, semitones / 12);\n const inc = (1 - ratio) / grain;\n let write = this.write, phase = this.phase, filled = this.filled, wetNow = this.wet;\n const target = this.wetTarget, coef = this.wetCoef;\n for (let s = 0; s < n; s++) {\n phase += inc;\n phase -= Math.floor(phase);\n const phaseB = (phase + 0.5) % 1;\n const gA = xfade(phase), gB = xfade(phaseB);\n // Ramp the wet path in as the ring fills rather than reading zeros:\n // 100 ms of unshifted audio at the head of a clip beats 50 ms of silence.\n const warm = filled >= grain ? 1 : filled / grain;\n wetNow = target + coef * (wetNow - target);\n const wetMix = wetNow * warm;\n for (let ch = 0; ch < i.length; ch++) {\n const ring = this.buf[ch];\n const inp = i[ch], out = o[ch];\n const x = inp[s];\n ring[write] = x;\n const wet =\n readTap(ring, write, phase * grain) * gA + readTap(ring, write, phaseB * grain) * gB;\n out[s] = x * (1 - wetMix) + wet * wetMix;\n }\n write = (write + 1) % ringLen;\n if (filled < grain) filled++;\n }\n this.write = write;\n this.phase = phase;\n this.filled = filled;\n this.wet = wetNow;\n return true;\n }\n}\nregisterProcessor("hf-pitchshift", HfPitchshift);\n`,$a=new WeakMap;function ja(e){return lf.has(e)}var lf=new WeakSet;function Ka(e){let t=$a.get(e);return t||(t=(async()=>{if(!e.audioWorklet)throw new Error("AudioWorklet is unavailable \\u2014 the page needs a secure context (https, localhost or file://)");let n=`data:text/javascript;base64,${btoa(String.fromCharCode(...new TextEncoder().encode(Ox)))}`;await e.audioWorklet.addModule(n),lf.add(e)})().catch(n=>{throw $a.delete(e),n}),$a.set(e,t)),t}function Hx(e,t,n){let r=.6+Math.max(0,Math.min(1,t))*2.6,i=Math.max(1,Math.floor(e*r)),o=new Float32Array(i),a=Math.round(t*1e3)*2654435761+Math.round(n*1e3)*40503>>>0,l=()=>(a=a*1664525+1013904223>>>0,a/4294967295*2-1),s=Math.max(.001,1-Math.max(0,Math.min(1,n))),u=0,c=0;for(let m=0;m<i;m++){u+=s*(l()-u);let p=u*Math.pow(1-m/i,2.5);o[m]=p,c+=p*p}let f=Math.sqrt(c);if(f>0)for(let m=0;m<i;m++)o[m]=(o[m]??0)/f;return o}var de=e=>typeof e=="number"?e:Number(e??0),Ya=e=>e/1e3;function ff(e,t,n,r){let i=Math.max(1,Math.round(e.sampleRate)),o=e.createBuffer(1,i,e.sampleRate),a=o.getChannelData(0);for(let u=0;u<i;u++){let c=u/i;a[u]=t==="sine"?Math.sin(2*Math.PI*c):4*Math.abs((c+.75)%1-.5)-1}let l=e.createBufferSource();l.buffer=o,l.loop=!0,l.playbackRate.value=n;let s=(r*n%1+1)%1*(i/e.sampleRate);return l.start(typeof e.currentTime=="number"?e.currentTime:0,s),l}function mf(e){try{e.stop()}catch{}e.disconnect()}function Xa(e,t){return[{param:e},{param:t,map:n=>1-n}]}function pf(e,t,n){e.gain.value=n,t.gain.value=1-n}function Ja(e,t,n){return{input:e,output:e,update:t,automation:n,dispose:()=>e.disconnect()}}var Gx=new Set(["peaking","highpass","lowpass"]),uf=e=>Math.pow(10,e/20),Bx=(e,t)=>{let n=e.createGain(),r=i=>{n.gain.value=uf(de(i.gain))};return r(t),Ja(n,r,{gain:[{param:n.gain,map:uf}]})};function ur(e,t){return(n,r)=>{let i=n.createBiquadFilter();i.type=e;let o=a=>{i.frequency.value=de(a.frequency),a.q!==void 0&&(i.Q.value=de(a.q)),t&&(i.gain.value=de(a.gain))};return o(r),Ja(i,o,{frequency:[{param:i.frequency}],...Gx.has(e)?{q:[{param:i.Q}]}:{},...t?{gain:[{param:i.gain}]}:{}})}}function Ux(e){return(t,n)=>{let r=Math.tan(Math.PI*de(n.frequency)/t.sampleRate),i=e==="highpass"?t.createIIRFilter([1/(1+r),-1/(1+r)],[1,(r-1)/(r+1)]):t.createIIRFilter([r/(1+r),r/(1+r)],[1,(r-1)/(r+1)]);return Ja(i,()=>{})}}function cr(e){return(t,n)=>{let r=new AudioWorkletNode(t,e,{processorOptions:{...n}});return{input:r,output:r,update:i=>r.port.postMessage({...i}),dispose:()=>{r.port.postMessage({__hfDispose:!0}),r.disconnect()}}}}var Wx={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))},Vx=(e,t)=>{let n=e.createWaveShaper(),r=e.createGain(),i=e.createGain();r.connect(n).connect(i);let o=a=>{let l=Wx[String(a.type)]??Math.tanh,s=Math.pow(10,de(a.threshold)/20),u=8192,c=new Float32Array(u);for(let f=0;f<u;f++){let m=f/(u-1)*2-1;c[f]=l(m/Math.max(1e-6,s))*s}n.curve=c,n.oversample=de(a.oversample)>=4?"4x":de(a.oversample)>=2?"2x":"none",i.gain.value=Math.pow(10,de(a.output)/20)};return o(t),{input:r,output:i,update:o,automation:{output:[{param:i.gain,map:a=>Math.pow(10,a/20)}]},dispose:()=>{r.disconnect(),n.disconnect(),i.disconnect()}}},zx=(e,t)=>{let n=e.createGain(),r=e.createGain(),i=e.createDelay(5),o=e.createGain(),a=e.createGain(),l=e.createGain();n.connect(i),i.connect(o),o.connect(i),i.connect(a).connect(r),n.connect(l).connect(r);let s=u=>{i.delayTime.value=Math.min(5,de(u.time)/1e3),o.gain.value=de(u.feedback),pf(a,l,de(u.mix))};return s(t),{input:n,output:r,update:s,automation:{time:[{param:i.delayTime,map:u=>Math.min(5,Ya(u))}],feedback:[{param:o.gain}],mix:Xa(a.gain,l.gain)},dispose:()=>[n,r,i,o,a,l].forEach(u=>u.disconnect())}},qx=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createDelay(.5),a=ff(e,"sine",de(t.speed),n),l=e.createGain(),s=e.createGain(),u=e.createGain();a.connect(l).connect(o.delayTime),r.connect(o).connect(s).connect(i),r.connect(u).connect(i);let c=f=>{o.delayTime.value=de(f.delay)/1e3,l.gain.value=de(f.depth)/1e3,a.playbackRate.value=de(f.speed),pf(s,u,de(f.mix))};return c(t),{input:r,output:i,update:c,automation:{delay:[{param:o.delayTime,map:Ya}],depth:[{param:l.gain,map:Ya}],speed:[{param:a.playbackRate}],mix:Xa(s.gain,u.gain)},dispose:()=>{mf(a),[r,i,o,l,s,u].forEach(f=>f.disconnect())}}},$x=6,jx=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createGain(),a=e.createGain(),l=ff(e,String(t.type)==="1"?"sine":"triangle",de(t.speed),n),s=e.createGain(),u=e.createGain(),c=e.createGain(),f=[];r.connect(o);let m=o;for(let b=0;b<$x;b++){let v=e.createBiquadFilter();v.type="allpass",v.Q.value=.7071,s.connect(v.frequency),m.connect(v),m=v,f.push(v)}l.connect(s),m.connect(u).connect(a),o.connect(c).connect(a),a.connect(i);let p=b=>{let v=1e3/Math.max(.1,de(b.delay));for(let x of f)x.frequency.value=v;s.gain.value=v*de(b.decay),l.playbackRate.value=de(b.speed),o.gain.value=de(b.in_gain),a.gain.value=de(b.out_gain),u.gain.value=1,c.gain.value=1};return p(t),{input:r,output:i,update:p,automation:{speed:[{param:l.playbackRate}],in_gain:[{param:o.gain}],out_gain:[{param:a.gain}]},dispose:()=>{mf(l),[r,i,o,a,s,u,c,...f].forEach(b=>b.disconnect())}}},Kx=(e,t)=>{let n=e.createGain(),r=e.createGain(),i=e.createConvolver(),o=e.createGain(),a=e.createGain();i.normalize=!1,n.connect(i).connect(o).connect(r),n.connect(a).connect(r);let l="",s=u=>{let c=`${de(u.size)}:${de(u.damping)}`;if(c!==l){let f=Hx(e.sampleRate,de(u.size),de(u.damping)),m=e.createBuffer(1,f.length,e.sampleRate);m.getChannelData(0).set(f),i.buffer=m,l=c}o.gain.value=de(u.wet),a.gain.value=de(u.dry)};return s(t),{input:n,output:r,update:s,automation:{wet:[{param:o.gain}],dry:[{param:a.gain}]},dispose:()=>[n,r,i,o,a].forEach(u=>u.disconnect())}},Yx={"gain-node":Bx,"biquad-peaking":ur("peaking",!0),"biquad-lowshelf":ur("lowshelf",!0),"biquad-highshelf":ur("highshelf",!0),"biquad-highpass":ur("highpass",!1),"biquad-lowpass":ur("lowpass",!1),"worklet-compressor":cr("hf-compressor"),"worklet-limiter":cr("hf-limiter"),"worklet-gate":cr("hf-gate"),"worklet-bitcrush":cr("hf-bitcrush"),"worklet-pitchshift":cr("hf-pitchshift"),waveshaper:Vx,"delay-feedback":zx,"chorus-lfo":qx,"allpass-phaser":jx,convolver:Kx};function hf(e){return e.nodes.some(t=>Sn(t.type)?.web.startsWith("worklet-")??!1)}function Xx(e,t,n,r=0){let i=Sn(t);if(!i)throw new Error(`Unknown effect type: ${t}`);let o=An(t,n);if((t==="highpass"||t==="lowpass")&&String(o.poles)==="1")return Ux(t)(e,o,r);let a=Yx[i.web];if(!a)throw new Error(`No Web Audio builder for ${i.web}`);return a(e,o,r)}function cf(e){let t=[];for(let n of e){let r=n.fromPreset,i=t.at(-1);if(i&&i.preset===r)i.nodes.push(n);else{let o=typeof n.presetAmount=="number"?n.presetAmount:1;t.push({...r?{preset:r}:{},amount:Math.min(1,Math.max(0,o)),nodes:[n]})}}return t}function df(e){return En(e).map(t=>{let n=An(t.type,t.params),r=n.poles!==void 0?`:${n.poles}`:"",i=String(n.poles)==="1"?`@${n.frequency}`:"",o=t.type==="phaser"?`~${n.type}`:"",a=t.fromPreset?`%${t.fromPreset}`:"";return`${t.type}${r}${i}${o}${a}`}).join("|")}function gf(e,t,n=0){var f;let r=e.createGain(),i=e.createGain(),o=[],a=[],l=cf(En(t)),s=r;for(let m of l){let p=null;if(m.preset){let b=e.createGain(),v=e.createGain(),x=e.createGain(),_=e.createGain();x.gain.value=m.amount,v.gain.value=1-m.amount,s.connect(b),b.connect(v).connect(_),p={entry:b,wet:x,dry:v,join:_},s=b}for(let b of m.nodes){let v=Xx(e,b.type,b.params??{},n);s.connect(v.input),s=v.output,o.push({...b.id?{id:b.id}:{},type:b.type,handle:v})}p&&m.preset&&(s.connect(p.wet).connect(p.join),a.push({id:m.preset,...p}),s=p.join)}s.connect(i);let u=df(t),c={};for(let m of a)(c[f=m.id]??(c[f]=[])).push(...Xa(m.wet.gain,m.dry.gain));return{input:r,output:i,presets:c,nodes:o,update(m){if(df(m)!==u)return!1;En(m).forEach((b,v)=>{let x=o[v];x&&(x.handle.update(An(b.type,b.params)),b.id===void 0?delete x.id:x.id=b.id)});let p=0;for(let b of cf(En(m))){if(!b.preset)continue;let v=a[p++];!v||v.id!==b.preset||(v.wet.gain.value=b.amount,v.dry.gain.value=1-b.amount)}return!0},dispose(){for(let{handle:m}of o)m.dispose();for(let{entry:m,wet:p,dry:b,join:v}of a)m.disconnect(),p.disconnect(),b.disconnect(),v.disconnect();r.disconnect(),i.disconnect()}}}var bf={version:1,nodes:[]},xf={version:1,lanes:[]};function yf(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(et):null)??"";if(!n)return xf;try{return Fl(Or(n),t)}catch{return xf}}function on(e){let t=(typeof e.getAttribute=="function"?e.getAttribute(Tt):null)??"";if(!t)return{chain:bf,raw:""};try{return{chain:Rl(t),raw:t}}catch{return{chain:bf,raw:""}}}function vf(e){return yf(e,on(e).chain)}function wi(e,t,n,r,i){let{chain:o}=on(t),a=null,l=[],s=!1,u=0,c=()=>{try{a?(n.disconnect(a.input),a.output.disconnect(r),a.dispose()):n.disconnect(r)}catch{}a=null},f=(T,M)=>{if(T.nodes.length===0){n.connect(r);return}if(hf(T)&&!ja(e)){n.connect(r);let D=++u;Ka(e).then(()=>{s||D!==u||x(on(t).chain)}).catch(()=>{});return}try{let D=gf(e,T,M);n.connect(D.input),D.output.connect(r),a=D}catch{n.connect(r)}},m=(T,M)=>{l=M&&a?af(yf(t,T),T,a.nodes,M,a.presets):[]},p=i?{...i}:null;f(o,p?.elapsed??0),m(o,p);let b=()=>{if(!p)return null;let T=typeof e.currentTime=="number"?e.currentTime:p.scheduledAt;return{scheduledAt:T,elapsed:p.elapsed+(T-p.scheduledAt)*p.rate,rate:p.rate}},v=T=>{let M=b();M&&(rn(l,M.scheduledAt),m(T,M))},x=T=>{let M=b();rn(l,M?.scheduledAt??0),c(),f(T,M?.elapsed??0),m(T,M)},_=null,R=t;return typeof MutationObserver<"u"&&typeof R?.nodeType=="number"&&(_=new MutationObserver(()=>{let T=on(t);l.length>0&&lr(l),!a||!a.update(T.chain)?x(T.chain):v(T.chain)}),_.observe(R,{attributes:!0,attributeFilter:[Tt,et]})),{reanchor:T=>{if(s)return;let M=b();M&&rn(l,M.scheduledAt),p={...T},m(on(t).chain,p)},setRate:T=>{let M=b();s||!M||!Number.isFinite(T)||T<=0||T===M.rate||(p={...M,rate:T},rn(l,M.scheduledAt),m(on(t).chain,p))},dispose:()=>{s=!0,_?.disconnect(),l.length>0&&rn(l,typeof e.currentTime=="number"?e.currentTime:0),a?.dispose()}}}var Sf="runtime_web_audio_bypass";function Qa(e,t){return typeof e.getAttribute=="function"?e.getAttribute(t):null}function dr(e,t){return Qa(e,t)!==null}function Jx(e){return dr(e,"crossorigin")?!0:e.crossOrigin!=null}function Qx(e){return typeof e.baseURI=="string"&&e.baseURI?e.baseURI:typeof document<"u"?document.baseURI:""}function Zx(e){let t=typeof e.currentSrc=="string"?e.currentSrc:"";if(t)return[t];let n=Qa(e,"src");if(n)return[n];if(typeof e.querySelectorAll!="function")return[];let r=[];for(let i of Array.from(e.querySelectorAll("source"))){let o=i.getAttribute("src");o&&r.push(o)}return r}function ey(e,t){if(typeof window>"u")return!1;let n;try{n=new URL(e,Qx(t))}catch{return!1}return n.protocol!=="http:"&&n.protocol!=="https:"||n.origin===window.location.origin?!1:!Jx(t)}function Ef(e){return(typeof e.currentSrc=="string"?e.currentSrc:"")?!0:dr(e,"src")}function an(e){for(let t of Zx(e))if(ey(t,e))return{kind:"decode-only",reason:"cross_origin_no_cors",asset:t};return{kind:"web-audio"}}function ty(e){let t=[];dr(e,Tt)&&t.push("fx-chain"),dr(e,et)&&t.push("automation"),dr(e,Gr)&&t.push("audio-group");let n=Number.parseFloat(Qa(e,"data-volume")??"");return Number.isFinite(n)&&n>1&&t.push("above-unity-gain"),t}function ny(){return typeof window<"u"&&!!window.__HF_EXPORT_RENDER_SEEK_CONFIG}var Af=new WeakSet;function sn(e,t){if(t.kind==="web-audio"||ny()||Af.has(e))return;let n=ty(e);Af.add(e);let r={asset:t.asset,reason:t.reason,lostProcessing:n,note:"cross-origin media without a `crossorigin` opt-in is silent through createMediaElementSource (Web Audio spec); using native playback instead"};be({source:"hf-preview",type:"diagnostic",code:Sf,details:r});let i=n.length>0?` Native playback cannot reproduce: ${n.join(", ")} \\u2014 proxy or download the asset to a same-origin URL to keep it.`:"";console.info(`[hyperframes] ${Sf}: "${t.asset}" (${t.reason}): Web Audio capture withheld; the track plays through native HTMLMediaElement output.${i}`)}function Za(e){return!Number.isFinite(e)||e<=0?1:e}function wf(e){return Le(e)}function ry(e,t){t||e.paused||!Cr().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function iy(e,t){let{elapsed:n,mediaStart:r,scheduledAt:i,globalRate:o,mediaRate:a,clipDuration:l}=t,s=Number.isFinite(l)&&l>0,u=l*a;if(n>=0){let f=n*a,m=u-f;return s&&m<=0?!1:(s?e.start(0,f+r,m):e.start(0,f+r),!0)}let c=-n/o;return s?e.start(i+c,r,u):e.start(i+c,r),!0}function Ci(e,t,n){let r=sf(vf(e));r&&qa([{param:t.gain}],r,Pr.scale,n)}function fr(e){return e.sourceKind==="buffer"}var _i=class{constructor(){ge(this,"_ctx",null);ge(this,"_bufferCache",new Map);ge(this,"_failedSrcs",new Set);ge(this,"_mediaElementSources",new WeakMap);ge(this,"_activeSources",[]);ge(this,"_masterGain",null);ge(this,"_masterVolume",1);ge(this,"_masterMuted",!1);ge(this,"_groups",new Map);ge(this,"_rateAnchorCtx",0);ge(this,"_rateAnchorComp",0);ge(this,"_rate",1);ge(this,"_paused",!0);ge(this,"_playGeneration",0)}async init(){try{return this._ctx=new AudioContext,this._masterGain=this._ctx.createGain(),this._masterGain.connect(this._ctx.destination),this.applyMasterGain(),!0}catch{return!1}}get context(){return this._ctx}getTime(){return!this._ctx||this._paused?-1:this._rateAnchorComp+(this._ctx.currentTime-this._rateAnchorCtx)*this._rate}async decodeAudioElement(t){let n=t.currentSrc||t.getAttribute("src");if(!n)return null;if(this._bufferCache.has(n))return this._bufferCache.get(n);if(this._failedSrcs.has(n)||!this._ctx)return null;let r;try{let i=await fetch(n,{cache:"no-store"});if(!i.ok)return L("webAudioTransport.fetch",new Error(`${i.status} ${n}`)),null;r=await i.arrayBuffer()}catch(i){return L("webAudioTransport.fetch",i),null}try{let i=await this._ctx.decodeAudioData(r);return this._bufferCache.set(n,i),i}catch(i){return this._failedSrcs.add(n),L("webAudioTransport.decode",i),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}acquireMediaElementSource(t){let n=this._mediaElementSources.get(t);if(n){let o=an(t);if(o.kind!=="web-audio"){try{n.disconnect()}catch{}return this._mediaElementSources.delete(t),sn(t,o),null}return n}if(!this._ctx)return null;let r=an(t);if(r.kind!=="web-audio")return sn(t,r),null;let i=this._ctx.createMediaElementSource(t);return this._mediaElementSources.set(t,i),i}async scheduleMediaElementPlayback(t,n,r,i,o,a,l=1){if(!this._ctx||!this._masterGain||a!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),a!==this._playGeneration)return null;let s=this.acquireMediaElementSource(t);if(!s)return null;let u=Za(l),c=this._ctx.createGain();c.gain.value=o;let f=this._ctx.currentTime,m=i-n,p={scheduledAt:f,elapsed:m,rate:u},b=wi(this._ctx,t,s,c,p);c.connect(this.resolveDestination(t,f,i,u)??this._masterGain),Ci(t,c,p),this._rate=u,this._rateAnchorCtx=f,this._rateAnchorComp=i;let v={fx:b,el:t,sourceNode:s,sourceKind:"media-element",gainNode:c,compositionStart:n,mediaStart:r,scheduledAt:f,priorMuted:t.muted,priorVolume:t.volume,mediaPlaybackRate:_e(t),bounded:!1};return t.volume=1,this._activeSources.push(v),this._paused=!1,v}catch(s){return L("webAudioTransport.mediaElementSource",s),null}}groupInput(t,n,r){let i=this._groups.get(t);if(i){if(i.generation!==this._playGeneration)try{i.reanchor(r),i.generation=this._playGeneration}catch(m){L("webAudioTransport.groupReanchor",m)}return i.input}if(!this._ctx||!this._masterGain)return null;let o=this._ctx.createGain(),a=this._ctx.createGain();a.connect(this._masterGain);let l=()=>po(n,t),s=l(),u=this._ctx.createGain();u.gain.value=s?.hasAttribute("data-hidden")?0:1,u.connect(a);let c=this._ctx.createGain();c.gain.value=wf(mo(s)),c.connect(u);let f=wi(this._ctx,s??{getAttribute:()=>null},o,c,r);return s&&Ci(s,c,r),this._groups.set(t,{input:o,fader:c,muteGain:u,fx:f,generation:this._playGeneration,reanchor:m=>{lr([{param:c.gain}]);let p=l();c.gain.value=wf(mo(p)),u.gain.value=p?.hasAttribute("data-hidden")?0:1,f?.reanchor(m),p&&Ci(p,c,m)},dispose:()=>{try{f?.dispose(),o.disconnect(),c.disconnect(),u.disconnect(),a.disconnect()}catch{}}}),o}setGroupMuted(t,n){let r=this._groups.get(t);if(r)try{r.muteGain.gain.value=n?0:1}catch(i){L("webAudioTransport.setGroupMuted",i)}}resolveDestination(t,n,r,i){if(!this._masterGain)return null;let o=Il(t);if(!o)return this._masterGain;let a={scheduledAt:n,elapsed:r,rate:i};return this.groupInput(o,t.ownerDocument,a)??this._masterGain}handleSourceEnded(t,n,r,i){let o=this._activeSources.indexOf(n);if(o!==-1){this._activeSources.splice(o,1),r.muted=i;try{t.disconnect(),n.fx?.dispose(),n.gainNode.disconnect()}catch{}this._activeSources.length===0&&(this._paused=!0)}}async schedulePlayback(t,n,r,i,o,a,l,s=1,u=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||l!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),l!==this._playGeneration)return null;let c=Za(s),f=_e(t),m=c*f,p=this._ctx.createBufferSource();p.buffer=n,p.playbackRate.value=m;let b=this._ctx.createGain();b.gain.value=a;let v=o-r,x=this._ctx.currentTime,_={scheduledAt:x,elapsed:v,rate:c},R=wi(this._ctx,t,p,b,_);if(b.connect(this.resolveDestination(t,x,o,c)??this._masterGain),Ci(t,b,_),this._rate=c,this._rateAnchorCtx=x,this._rateAnchorComp=o,!iy(p,{elapsed:v,mediaStart:i,scheduledAt:x,globalRate:c,mediaRate:f,clipDuration:u}))return p.disconnect(),R?.dispose(),b.disconnect(),null;let T=t.muted;t.muted=!0,ry(t,T);let M={fx:R,el:t,sourceNode:p,sourceKind:"buffer",gainNode:b,compositionStart:r,mediaStart:i,scheduledAt:x,priorMuted:T,priorVolume:t.volume,mediaPlaybackRate:f,bounded:Number.isFinite(u)&&u>0};return this._activeSources.push(M),this._paused=!1,p.addEventListener("ended",()=>this.handleSourceEnded(p,M,t,T)),M}catch(c){return L("webAudioTransport.schedule",c),null}}setRate(t){let n=Za(t);if(n===this._rate)return!1;this._ctx&&!this._paused&&(this._rateAnchorComp=this.getTime(),this._rateAnchorCtx=this._ctx.currentTime),this._rate=n;for(let r of this._activeSources)try{fr(r)&&(r.sourceNode.playbackRate.value=n*r.mediaPlaybackRate),r.fx?.setRate(n)}catch(i){L("webAudioTransport.setRate",i)}for(let r of this._groups.values())try{r.fx?.setRate(n)}catch(i){L("webAudioTransport.setRate.group",i)}return!0}hasBoundedActiveSources(){return this._activeSources.some(t=>fr(t)&&t.bounded)}stopAll(){for(let t of this._activeSources){try{fr(t)&&t.sourceNode.stop(),t.sourceNode.disconnect(),t.fx?.dispose(),t.gainNode.disconnect()}catch{}fr(t)?t.el.muted=t.priorMuted:t.el.volume=t.priorVolume}this._activeSources=[],this._paused=!0}setVolume(t){this._masterVolume=Math.max(0,Math.min(1,t)),this.applyMasterGain()}setElementVolume(t,n){let r=Le(n);for(let i of this._activeSources)if(i.el===t)try{i.sourceKind==="media-element"&&(i.el.volume=1),i.gainNode.gain.value=r}catch(o){L("webAudioTransport.setElementVolume",o)}}setMuted(t){this._masterMuted=t,this.applyMasterGain()}applyMasterGain(){this._masterGain&&(this._masterGain.gain.value=this._masterMuted?0:this._masterVolume)}isActive(){return this._activeSources.length>0&&!this._paused}ownsElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t&&fr(n))}routesElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t)}destroy(){this.stopAll();for(let t of this._groups.values())t.dispose();if(this._groups.clear(),this._bufferCache.clear(),this._failedSrcs.clear(),this._mediaElementSources=new WeakMap,this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null,this._masterVolume=1,this._masterMuted=!1}};var Cf="data-hf-studio-manual-edit-gesture";function _f(e){return!Number.isInteger(e.tick)||e.tick<=0||e.tick%60!==0?!1:!(e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2)}var oy=/^\\s*spring\\(\\s*([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+))\\s*\\)\\s*$/;function Tf(e){return Math.max(0,Math.min(1,e))}function Rf(e){let t=oy.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?Tf(n):null}function kf(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=Tf(t),r=12-n*6,i=Math.PI*2*(1+n*1.5),o=1-Math.exp(-r)*Math.cos(i);return(1-Math.exp(-r*e)*Math.cos(i*e))/o}var ay=/^\\s*wiggle\\(\\s*(\\d+)\\s*,\\s*(easeOut|easeInOut|anticipate|uniform)\\s*(?:,\\s*([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?)\\s*)?\\)\\s*$/,sy=Math.PI*2;function ly(e){let t=ay.exec(e);if(!t)return null;let n=Number(t[1]);if(!Number.isSafeInteger(n)||n<1)return null;let r=t[2];if(r!=="easeOut"&&r!=="easeInOut"&&r!=="anticipate"&&r!=="uniform")return null;if(t[3]===void 0)return{wiggles:n,type:r};let i=Number(t[3]);return!Number.isFinite(i)||i<0||i>1?null:{wiggles:n,type:r,amplitude:i}}function uy(e,t,n,r){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let i=r??(n==="easeInOut"?.08:n==="uniform"?.14:n==="anticipate"?.12:.16),o=n==="easeInOut"?i*Math.sin(Math.PI*e):n==="uniform"?i:i*(1-e);return e+(n==="anticipate"?-1:1)*o*Math.sin(sy*t*e)}function Mf(e,t){let n=ly(e);if(!n)return null;let r=`${n.wiggles}:${n.type}:${n.amplitude??"default"}`,i=t?.get(r);if(i)return i;let o=a=>uy(a,n.wiggles,n.type,n.amplitude);return t?.set(r,o),o}var cy=24,Ff=e=>e>=1?1:0,dy=e=>e,Ti=String.raw`([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?)`,fy=new RegExp(String.raw`^\\s*M\\s*0\\s*,\\s*0\\s+C\\s*${Ti}\\s*,\\s*${Ti}\\s+${Ti}\\s*,\\s*${Ti}\\s+1\\s*,\\s*1\\s*$`,"i");function Nf(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function my(e,t,n,r,i){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let o=0,a=1;for(let l=0;l<cy;l+=1){let s=(o+a)/2;Nf(s,t,r)<e?o=s:a=s}return Nf((o+a)/2,n,i)}function py(e){let t=fy.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),o=Number(t[4]);return Math.min(n,i)<0||Math.max(n,i)>1?null:a=>my(a,n,r,i,o)}function hy(e,t){if(!e.startsWith("spring("))return null;let n=Rf(e);if(n===null)return null;let r=t.get(n);if(r)return r;let i=o=>kf(o,n);return t.set(n,i),i}function gy(e,t){if(!e.startsWith("custom(")||!e.endsWith(")"))return null;let n=e.slice(7,-1),r=t.get(n);if(r)return r;let i=py(n);return i&&t.set(n,i),i}function Lf(e){if(e.__hfCustomEaseInstalled)return!0;let t=e.parseEase;if(!t)return!1;let n=new Map,r=new Map,i=new Map,o=s=>typeof s!="string"?null:s==="hold"?Ff:Mf(s,i)??hy(s,r)??gy(s,n),a=(s,u,c=[])=>{let f=o(s);return f||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\\(|$)/.test(s.trim())&&Ne("custom_ease_parse_failed",{ease:s}),t.call(u,s,...c)??dy)};e.parseEase=function(u,...c){return a(u,this,c)};let l=e.registerEase;if(typeof l=="function"){l("hold",Ff);let s=u=>{let c=f=>f;c.config=(...f)=>a(`${u}(${f.join(",")})`,e),l(u,c)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}var ns=new Map,mr=new Map,es=new Map,ts=()=>{},If=()=>{},Df=0;function rs(e){return/^[a-z][a-z0-9-]{0,63}$/.test(e)}function Pf(e){let t=(es.get(e)??0)+1;return es.set(e,t),t}function Of(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:(Df-=1,Df)}function is(e,t){let n=mr.get(e);if(!n)return;let r=()=>es.get(e)===t.generation&&mr.get(e)===n;try{Promise.resolve(n(t.payload)).then(()=>{r()&&If(e,t.requestId)},i=>{r()&&ts(e,t.requestId,i)})}catch(i){r()&&ts(e,t.requestId,i)}}function Hf(e){ts=e}function Gf(e){If=e}function Ri(e,t,n){if(!rs(e))return;let r={payload:t,requestId:Of(n),generation:Pf(e)};ns.set(e,r),is(e,r)}function ki(e,t){rs(e)&&(ns.delete(e),is(e,{payload:void 0,requestId:Of(t),generation:Pf(e)}))}function Bf(e,t){if(!rs(e))throw new Error(`Invalid HyperFrames runtime-data channel: ${e}`);mr.set(e,t);let n=ns.get(e);return n&&is(e,n),()=>{mr.get(e)===t&&mr.delete(e)}}var os="data-hf-authored-duration",as="data-hf-authored-end",Uf=!1;function ot(e){if(e){if(typeof e.pause!="function"){Uf||(Uf=!0,Ne("timeline_missing_pause",{}));return}try{e.pause()}catch(t){L("runtime.timeline.pause",t)}}}function by(){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 Wf(){let e=Eu(),t=()=>{};Ws(be),Hf((d,g,h)=>{be({source:"hf-preview",type:"runtime-data-error",channel:d,requestId:g,message:h instanceof Error?h.message:String(h)})}),Gf((d,g)=>{try{t()}catch(h){be({source:"hf-preview",type:"runtime-data-error",channel:d,requestId:g,message:h instanceof Error?h.message:String(h)});return}be({source:"hf-preview",type:"runtime-data-applied",channel:d,requestId:g})}),mi(document),La(document),Pl(document);let n=by();e.canonicalFps=n.fps??e.canonicalFps,Bs(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG&&console.info("[hyperframes] render runtime fps",{canonicalFps:e.canonicalFps,source:n.source,rawFpsSource:n.rawFpsSource,rawFps:n.rawFps,fallbackReason:n.fallbackReason});let r=null,i=null,o=null,a=[],l=new Set,s=null,u=new Set,c=(d,g,h)=>{u.has(d)||(u.add(d),Ne(g,h))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(d){L("runtime.init.site1",d)}let f=new Ei;e.transportClock=f;let m=new _i,p=!1;m.init().then(d=>{p=d}),window.__hf=window.__hf||{};let b=d=>d.closest("[data-hidden]")!==null||Br(d.ownerDocument,d),v=()=>{let d=window.gsap,g=window;if(!(!d?.registerPlugin||g.__hfAutoNoopRegistered))try{d.registerPlugin({name:"_auto",init:()=>!1}),g.__hfAutoNoopRegistered=!0}catch(h){c("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),L("runtime.autoMarker.install",h)}},x=()=>{let d=window.gsap;if(!d){c("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{Lf(d)||c("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(g){c("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),L("runtime.customEase.install",g)}};v(),x(),document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden");try{Ys(document)}catch(d){L("runtime.init.cssVariables",d)}window.__timelines=window.__timelines||{};let _=()=>{let d=document.querySelector(\'[data-composition-id][data-root="true"]\');if(d instanceof HTMLElement)return d;let g=Array.from(document.querySelectorAll("[data-composition-id]"));return g.find(h=>!h.parentElement?.closest("[data-composition-id]"))??g[0]??null};if(Array.isArray(window.__timelines)){let d=window.__timelines,g=_()?.getAttribute("data-composition-id")??"root",h={};if(d.length===1)h[g]=d[0];else for(let y=0;y<d.length;y++)h[`tl-${y}`]=d[y];window.__timelines=h}let R=_();R&&!R.hasAttribute("data-start")&&R.setAttribute("data-start","0");let T=d=>{a.push(d)},M=(d,g,h)=>{let y=h??`${d}:${JSON.stringify(g)}`;l.has(y)||(l.add(y),be({source:"hf-preview",type:"diagnostic",code:d,details:g}))},D=d=>{let g={scale:1,focusX:960,focusY:540},h=[],y=[],w={time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:d.play,pause:d.pause,seek:d.seek,getTime:d.getTime,getDuration:d.getDuration,isPlaying:d.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>g,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>h,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:d.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>y,getRenderState:()=>({...w,time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying()})}},E=1/60,S=.75,A=.05,C=100,F=240,I=d=>{if(d instanceof Error)return d.message||String(d);if(typeof d=="string")return d;try{return JSON.stringify(d)}catch{return String(d??"")}},q=d=>{let g=d.toLowerCase();return g.includes("cannot read properties of null")||g.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:g.includes("failed to execute \'queryselector\'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:g.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},W=d=>{if(d==null||d.trim()==="")return null;let g=Number.parseFloat(d);return!Number.isFinite(g)||g<=0?null:`${g}px`},Y=()=>_(),k=()=>{let d=Y();if(!d)return;let g=W(d.getAttribute("data-width")),h=W(d.getAttribute("data-height"));g&&(d.style.width=g),h&&(d.style.height=h),g&&d.style.setProperty("--comp-width",g),h&&d.style.setProperty("--comp-height",h)},U=()=>{let d=Y(),g=Array.from(document.querySelectorAll("[data-composition-id]")).filter(h=>h.hasAttribute("data-duration")||h.hasAttribute("data-end"));for(let h of g){if(d&&h===d)continue;let y=h.getAttribute("data-duration"),w=h.getAttribute("data-end");y!=null&&!h.hasAttribute(os)&&h.setAttribute(os,y),w!=null&&!h.hasAttribute(as)&&h.setAttribute(as,w),h.removeAttribute("data-duration"),h.removeAttribute("data-end")}},ie=()=>{let d=Y();if(!d)return;d.style.position||(d.style.position="relative"),d.style.overflow="hidden";let g=W(d.getAttribute("data-width")),h=W(d.getAttribute("data-height"));g&&(d.style.width=g),h&&(d.style.height=h);let y=Array.from(d.children);for(let w of y){let N=w.tagName.toLowerCase();if(N==="script"||N==="style"||N==="link"||N==="meta"||!w.hasAttribute("data-start")||w.hasAttribute("data-hf-autostamped"))continue;let G=(w.style.top==="0px"||w.style.top==="0")&&(w.style.left==="0px"||w.style.left==="0")&&w.style.width==="100%"&&w.style.height==="100%",re=/translate\\(\\s*-50%\\s*,\\s*-50%\\s*\\)/.test(w.style.transform);if(G&&re&&!w.hasAttribute("data-width")&&!w.hasAttribute("data-height")){let ne=w.style.top,_t=w.style.left,ye=w.style.width,gn=w.style.height;w.style.top="",w.style.left="",w.style.width="",w.style.height="";let se=window.getComputedStyle(w);se.top!=="auto"||se.bottom!=="auto"||se.left!=="auto"||se.right!=="auto"||se.width!=="0px"||se.height!=="0px"||(w.style.top=ne,w.style.left=_t,w.style.width=ye,w.style.height=gn)}let $=window.getComputedStyle(w),le=$.position;if(le!=="absolute"&&le!=="fixed"&&(w.style.position="absolute"),!!w.style.top||!!w.style.bottom||$.top!=="auto"||$.bottom!=="auto"||(w.style.top="0"),!!w.style.left||!!w.style.right||$.left!=="auto"||$.right!=="auto"||(w.style.left="0"),N!=="audio"){let ne=W(w.getAttribute("data-width")),_t=W(w.getAttribute("data-height")),ye=$.width!=="0px"&&$.width!=="auto",gn=$.height!=="0px"&&$.height!=="auto";ne?!w.style.width&&!ye&&(w.style.width=ne):!w.style.width&&$.width==="0px"&&(w.style.width="100%"),_t?!w.style.height&&!gn&&(w.style.height=_t):!w.style.height&&$.height==="0px"&&(w.style.height="100%")}}},P=(d,g=0,h)=>mt({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:h?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(d,g),H=(d,g)=>mt({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:g?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(d),V=d=>{let g=d.closest("[data-composition-id]"),h=g?P(g,0):null,y=g?H(g,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:g,inheritedStart:h,inheritedDuration:y}},j=d=>{let g=V(d),h=g.inheritedStart??0,y=Gt(d.getAttribute("data-start"));if(d.hasAttribute("data-hf-auto-start")||y==null||h<=0)return P(d,h);let w=g.inheritedDuration,N=w!=null&&w>0?h+w:null;return y>=h&&(N==null||y<N)?y:h+y};window.__hfResolveMediaStartSeconds=j,a.push(()=>{window.__hfResolveMediaStartSeconds===j&&delete window.__hfResolveMediaStartSeconds});let we=(d,g)=>{let h=d.tagName.toLowerCase();if(h==="script"||h==="style"||h==="link"||h==="meta")return!1;let w=h==="video"||h==="audio"?j(d):P(d,0),N=H(d),G=d.getAttribute("data-composition-id");if(G){let $=(window.__timelines??{})[G],le=null;if($&&typeof $.duration=="function"){let Me=Number($.duration());Number.isFinite(Me)&&Me>0&&(le=Me)}!(d.hasAttribute("data-duration")||d.hasAttribute("data-end")||d.hasAttribute(os)||d.hasAttribute(as))&&(N==null||N<=0)&&le!=null&&(N=le)}let re=N!=null&&N>0?w+N:Number.POSITIVE_INFINITY;return g>=w&&(Number.isFinite(re)?g<re:!0)},z=!!document.querySelector("[data-composition-src]"),O=!1;{let d=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let g of d){let h=g.getAttribute("data-composition-id");if(h&&g.children.length===0&&document.querySelector(`template#${CSS.escape(h)}-template`)){O=!0;break}}}let B=!z&&!O,ee=d=>{if(!d||typeof d.duration!="function")return null;try{let g=Number(d.duration());return Number.isFinite(g)?Math.max(0,g):null}catch{return null}},K=d=>typeof d=="number"&&Number.isFinite(d)&&d>E,te=d=>{let g=ve(d.getAttribute("data-duration"));return g!=null&&g>0?g:Number.isFinite(d.duration)?Qe(d,d.duration):null},J=()=>{let d=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(d.length===0)return null;let g=0;for(let h of d){let y=j(h);if(!Number.isFinite(y))continue;let w=te(h);w==null||w<=E||(g=Math.max(g,Math.max(0,y)+w))}return g>E?g:null},X=()=>{let d=Y();if(!d)return null;let g=window.__timelines??{},h=mt({timelineRegistry:g,includeAuthoredTimingAttrs:!0}),y=0,w=ve(d.getAttribute("data-duration"));w!=null&&w>0&&(y=w);let N=Array.from(d.querySelectorAll("[data-composition-id][data-start]"));for(let G of N){if(!(G instanceof Element)||G.parentElement?.closest("[data-composition-id]")!==d)continue;let $=h.resolveStartForElement(G,0),le=h.resolveDurationForElement(G);!Number.isFinite($)||le==null||le<=0||(y=Math.max(y,Math.max(0,$)+le))}return y>E?y:null},Pe=()=>{let d=J();return typeof d!="number"||!Number.isFinite(d)||d<=E?null:d},Fe=d=>K(d)?Math.max(E,d*S):E,cn=()=>{let d=0;for(let g of e.deterministicAdapters){let h=g.getInferredDurationSeconds;if(typeof h!="function")continue;let y=null;try{y=h()}catch(w){L("runtime.init.adapterDuration",w)}typeof y=="number"&&Number.isFinite(y)&&y>0&&(d=Math.max(d,y))}return d>E?d:null},Ce=(d,g=0)=>{let h=ee(d),y=Pe(),w=X(),N=cn(),G=Math.max(y??0,w??0,N??0),re=Number.isFinite(g)&&g>E?g:0,$=0;return K(h)?$=Math.max(h,G,re):K(G)?$=Math.max(G,re):$=re,$>0?Math.max(0,$):0},Oi=()=>{let d=window.__timelines??{},g=se=>{let oe=Object.entries(d).filter(ue=>!!ue[1]&&typeof ue[1].play=="function"&&typeof ue[1].pause=="function");if(oe.length!==1)return{timeline:null};let he=oe[0];if(!he)return{timeline:null};let[xe,fe]=he;return{timeline:fe,selectedTimelineIds:[xe],selectedDurationSeconds:ee(fe),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:se,soleTimelineId:xe}}}},h=mt({timelineRegistry:d,includeAuthoredTimingAttrs:!0}),y=Pe(),w=X(),N=Math.max(y??0,w??0)||null,G=Fe(N),re=se=>{let oe=document.querySelector(`[data-composition-id="${CSS.escape(se)}"]`);return oe?h.resolveStartForElement(oe,0):0},$=se=>{let oe=window.gsap;if(!oe||typeof oe.timeline!="function")return null;let he=oe.timeline({paused:!0});for(let xe of se)he.add(xe.timeline,re(xe.compositionId));return he},le=(se,oe)=>{if(!K(se))return null;let he=window.gsap;if(!he||typeof he.timeline!="function")return null;let xe=he.timeline({paused:!0});if(oe)try{xe.add(oe,0)}catch(ue){L("runtime.init.site2",ue)}let fe=xe;if(typeof fe.to=="function")try{fe.to({},{duration:se})}catch(ue){L("runtime.init.site3",ue)}return xe},Be=(se,oe)=>{let he=se;if(typeof he.getChildren!="function")return[];try{let xe=he.getChildren(!0,!0,!0)??[];if(!Array.isArray(xe))return[];let fe=[];for(let ue of oe)if(!xe.some(Je=>Je===ue.timeline))try{let Je=re(ue.compositionId);se.add(ue.timeline,Je),fe.push(ue.compositionId)}catch(Je){L("runtime.init.site4",Je)}return fe}catch{return[]}},Me=Y(),Q=Me?.getAttribute("data-composition-id")??null;if(!Q)return g("root_missing_composition_id");let ne=d[Q]??null,ye=(()=>{if(!Me)return[];let se=new Set,oe=Array.from(Me.querySelectorAll("[data-composition-id]")),he=[];for(let xe of oe){let fe=xe.getAttribute("data-composition-id");if(!fe||fe===Q||se.has(fe))continue;se.add(fe);let ue=d[fe]??null;if(!ue||typeof ue.play!="function"||typeof ue.pause!="function")continue;let lt=ee(ue);he.push({compositionId:fe,timeline:ue,durationSeconds:lt??0})}return he})(),gn=se=>{for(let oe of se){let he=oe.timeline;if(typeof he.paused=="function")try{he.paused(!1)}catch(xe){L("runtime.init.site5",xe)}}};if(ye.length>0&&gn(ye),ne){let se=ye.length>0?Be(ne,ye):[];if((ye.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id=\'"+Q+"\'])"))&&(gr=!0),se.length>0)try{let fe=ne.time();ne.seek(fe,!1)}catch{}let oe=ee(ne);if(!K(oe)&&ye.length>0){let fe=ye.map(zm=>zm.compositionId),ue=$(ye),lt=ee(ue);if(ue&&K(lt))return{timeline:ue,selectedTimelineIds:fe,selectedDurationSeconds:lt,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:Q,rootDurationSeconds:oe,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:G,selectedDurationSeconds:lt,mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:w,selectedTimelineIds:fe,autoNestedChildren:se}}};let Je=le(N??0,ne),Yi=ee(Je);if(Je&&K(Yi))return{timeline:Je,selectedTimelineIds:[Q],selectedDurationSeconds:Yi,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:Q,rootDurationSeconds:oe,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:w,selectedDurationSeconds:Yi,selectedTimelineIds:[Q],autoNestedChildren:se}}}}if(!K(oe)&&ye.length===0){let fe=le(N??0,ne),ue=ee(fe);if(fe&&K(ue))return{timeline:fe,selectedTimelineIds:[Q],selectedDurationSeconds:ue,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:Q,rootDurationSeconds:oe,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:w,selectedDurationSeconds:ue,selectedTimelineIds:[Q]}}}}let he=ve(Me?.getAttribute("data-duration")),xe=Math.max(K(he)?he:0,w??0);if(xe>0&&K(xe)&&K(oe)&&xe>=oe+.5){let fe=ne;if(typeof fe.to=="function")try{fe.to({},{duration:0},xe)}catch(lt){L("runtime.init.site6",lt)}let ue=ee(ne);if(K(ue))return{timeline:ne,selectedTimelineIds:[Q],selectedDurationSeconds:ue,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:Q,rootDurationSeconds:oe,rootDeclaredDur:he,authoredCompositionDurationFloorSeconds:w,newDur:ue}}}}return{timeline:ne,selectedTimelineIds:[Q],selectedDurationSeconds:oe,mediaDurationFloorSeconds:y,diagnostics:se.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:Q,selectedDurationSeconds:oe,autoNestedChildren:se}}:void 0}}if(ye.length>0){let se=ye.map(xe=>xe.compositionId),oe=$(ye),he=ee(oe);if(oe)return{timeline:oe,selectedTimelineIds:se,selectedDurationSeconds:he,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:Q,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:G,selectedDurationSeconds:he,mediaDurationFloorSeconds:y,selectedTimelineIds:se}}}}return g("root_composition_id_unmatched_in_registry")},gr=!1,Em=d=>{let g=window.gsap,h=d;if(!(!h||typeof h.getChildren!="function"||!g||typeof g.parseEase!="function"))for(let y of h.getChildren(!0,!0,!0)){let w=y,N=w.timeline;if(!N||!("_ease"in N)||typeof N._ease=="function")continue;let G=w.vars?.keyframes,$=(G&&!Array.isArray(G)?G.ease:void 0)??w.vars?.ease??"none";try{let le=g.parseEase($);typeof le=="function"&&(N._ease=le)}catch(le){Ne("keyframe_ease_repair_failed",{ease:typeof $=="string"?$:String($)}),L("runtime.keyframeEase.repair",le)}}},dn=()=>{if(x(),!B)return!1;let d=e.capturedTimeline,g=ee(d),h=K(g);if(d&&h&&gr)return!1;let y=Oi();if(!y.timeline)return!1;if(d&&d===y.timeline)return typeof d.timeScale=="function"&&d.timeScale(e.playbackRate),!1;e.capturedTimeline=y.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),Em(e.capturedTimeline);let w=Ce(e.capturedTimeline,0);if(w<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),ot(e.capturedTimeline)),w>0){try{f.setDuration(w)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let G=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(G,!1),ot(e.capturedTimeline)}let N=window.__hfStudioManualEditsApply;typeof N=="function"&&N(),mi(document)}if(y.diagnostics&&be({source:"hf-preview",type:"diagnostic",code:y.diagnostics.code,details:y.diagnostics.details}),be({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:y.selectedTimelineIds??[],selectedDurationSeconds:y.selectedDurationSeconds??null,mediaDurationFloorSeconds:y.mediaDurationFloorSeconds??null}}),window.parent!==window){let N=Y(),G=w>0?w:0,re=String(G>0?G:1),$=new Set,le=Q=>Q.tagName.toLowerCase()===Ut,Be=new Set(document.querySelectorAll("[data-start]")),Me=Q=>{let ne=Q.parentElement;for(;ne&&ne!==N;){if(Be.has(ne))return!0;ne=ne.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let Q of e.capturedTimeline.getChildren(!0))if(typeof Q.targets=="function")for(let ne of Q.targets())ne instanceof HTMLElement&&ne!==N&&(le(ne)||ne.hasAttribute("data-start")||Me(ne)||$.has(ne)||($.add(ne),ne.setAttribute("data-start","0"),ne.setAttribute("data-duration",re),ne.setAttribute("data-hf-autostamped","1")))}catch{}if(N instanceof HTMLElement)for(let Q of N.querySelectorAll("[id]"))Q instanceof HTMLElement&&Q!==N&&(Q.hasAttribute("data-start")||Me(Q)||$.has(Q)||Q.tagName==="SCRIPT"||Q.tagName==="STYLE"||Q.tagName==="LINK"||le(Q)||($.add(Q),Q.setAttribute("data-start","0"),Q.setAttribute("data-duration",re),Q.setAttribute("data-hf-autostamped","1")))}for(let N of fn)br.delete(N),Es(N);return!0},gs=()=>{if(e.tornDown)return;let d=Oi();if(!d.timeline){e.capturedTimeline=null,gr=!1,f.setDuration(0),Ar(e.currentTime);return}e.capturedTimeline!==d.timeline&&(gr=!1,dn()),Ar(e.currentTime)};t=()=>{gs(),st()},window.__hfForceTimelineRebind=gs;let wm=()=>{let d=Y();if(!(d instanceof HTMLElement))return;let g=d.getBoundingClientRect(),h=Number(d.getAttribute("data-width")),y=Number(d.getAttribute("data-height")),w=window.getComputedStyle(d),N=Number.isFinite(h)&&h>0&&Number.isFinite(y)&&y>0,G=g.width<=0||g.height<=0||d.clientWidth<=0||d.clientHeight<=0;!N||!G||M("root_stage_layout_zero",{compositionId:d.getAttribute("data-composition-id")??null,declaredWidth:h,declaredHeight:y,rectWidth:Math.round(g.width),rectHeight:Math.round(g.height),clientWidth:d.clientWidth,clientHeight:d.clientHeight,display:w.display,visibility:w.visibility,overflow:w.overflow},`root-stage-layout-zero:${d.getAttribute("data-composition-id")??"unknown"}`)},Cm=()=>{e.tornDown||(s!=null&&window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{s=null,wm()}))},_m=()=>{i=d=>{let g=I(d.error??d.message).slice(0,F);if(!g)return;let h=q(g);be({source:"hf-preview",type:"diagnostic",code:h.code,details:{category:h.category,message:g,filename:d.filename||null,line:Number.isFinite(d.lineno)?d.lineno:null,column:Number.isFinite(d.colno)?d.colno:null}})},o=d=>{let g=I(d.reason).slice(0,F);if(!g)return;let h=q(g);be({source:"hf-preview",type:"diagnostic",code:`${h.code}_unhandled_rejection`,details:{category:`${h.category}-unhandled-rejection`,message:g}})},window.addEventListener("error",i),window.addEventListener("unhandledrejection",o)},Tm=()=>{let d=Array.from(document.querySelectorAll("img, video, audio, source, link[rel=\'stylesheet\']"));for(let h of d){let y=()=>{if(!(h instanceof Element))return;let w=h.tagName.toLowerCase(),N=h.getAttribute("src")??h.getAttribute("href")??h.getAttribute("poster")??null,G=w==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";M(G,{tagName:w,assetUrl:N,currentSrc:(h instanceof HTMLImageElement||h instanceof HTMLMediaElement)&&h.currentSrc||null,readyState:h instanceof HTMLMediaElement?h.readyState:null,networkState:h instanceof HTMLMediaElement?h.networkState:null},`${G}:${w}:${N??"unknown"}`)};h.addEventListener("error",y),T(()=>{h.removeEventListener("error",y)})}let g=document.fonts;g&&g.ready.then(()=>{if(e.tornDown)return;let h=Array.from(g).filter(y=>y.status==="error").map(y=>y.family).filter(y=>!!y).slice(0,10);h.length!==0&&M("runtime_font_load_issue",{failedFamilies:h,totalFaces:Array.from(g).length},`runtime-font-load-issue:${h.join("|")}`)}).catch(()=>{})},Rm=(d,g)=>{if(!d.timeline)return!1;let h=e.capturedTimeline;if(h&&h===d.timeline)return!1;let y=Math.max(0,e.currentTime||0),w=e.isPlaying;e.capturedTimeline=d.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{ot(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&e.capturedTimeline.seek(y,!1),w&&typeof e.capturedTimeline.play=="function"&&e.capturedTimeline.play()}catch(N){L("runtime.init.site7",N)}return be({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:g,previousTime:y,selectedTimelineIds:d.selectedTimelineIds??[],selectedDurationSeconds:d.selectedDurationSeconds??null,mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),!0},Et=null,bs=!1,xs=!1,fn=new Set,br=new WeakMap,xr=()=>{e.tornDown||(Et!=null&&window.clearTimeout(Et),Et=window.setTimeout(()=>{if(e.tornDown||(Et=null,xs&&window.__HF_EXPORT_RENDER_SEEK_CONFIG))return;let d=Oi();if(!d.timeline||!K(d.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){dn()&&(st(),ke(!0));return}if(bs)return;let h=ee(e.capturedTimeline),y=d.selectedDurationSeconds??ee(d.timeline);K(y)&&(!K(h)||y>=h+A)&&Rm(d,"manual")&&(bs=!0,be({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:h??null,selectedDurationSeconds:y??null,selectedTimelineIds:d.selectedTimelineIds??[],mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),st(),ke(!0))},C))},ys=d=>{d.currentTarget instanceof HTMLMediaElement&&zl(d.currentTarget)},vs=d=>{d.currentTarget instanceof HTMLMediaElement&&ql(d.currentTarget)},Ss=d=>{d instanceof HTMLAudioElement&&Ef(d)&&sn(d,an(d))},As=d=>{let g=d.currentTarget;g instanceof HTMLMediaElement&&Ss(g)},km=()=>{for(let d of fn)d.removeEventListener("loadedmetadata",xr),d.removeEventListener("durationchange",xr),d.removeEventListener("loadedmetadata",ys),d.removeEventListener("loadedmetadata",As),d.removeEventListener("error",vs);fn.clear()},Hi=()=>{if(e.tornDown)return;let d=Array.from(document.querySelectorAll("video, audio"));for(let g of d){if(fn.has(g))continue;fn.add(g);let h=Number.parseFloat(g.dataset.volume??"");Number.isFinite(h)&&(g.volume=Math.max(0,Math.min(1,h))),g.addEventListener("loadedmetadata",xr),g.addEventListener("durationchange",xr),g.addEventListener("loadedmetadata",As),Ss(g),g.addEventListener("loadedmetadata",ys),g.addEventListener("error",vs),Vl(g),g.preload!=="auto"&&(g.preload="auto"),g.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&g.load(),Es(g)}},Es=d=>{br.has(d)||El(d,e.capturedTimeline,Ce(e.capturedTimeline,0),br,{allowLiveTimelineSeek:!window.__HF_RENDER_CAPTURE_MODE})},Gi=new WeakMap,ws=d=>{let g=Gi.get(d);if(g!==void 0)return g;let h=window.getComputedStyle(d).position,y=h==="static"||h==="relative"||h==="sticky";return Gi.set(d,y),y},Bi=new WeakMap,Mm=d=>{let g=Bi.get(d);if(g!==void 0)return g;let h=d.querySelector("[data-start]")===null;return Bi.set(d,h),h},Fm=()=>{Gi=new WeakMap,Bi=new WeakMap},Ui=new WeakMap,yr=new WeakSet,vr=!1,Cs=d=>d.matches("audio[data-start]")||d.querySelector("audio[data-start]")!==null,_s=new WeakMap,Sr=!0,Nm=()=>{if(Sr){Sr=!1;for(let d of document.querySelectorAll(Ut)){let g=d.hasAttribute("data-hidden");_s.get(d)!==g&&(_s.set(d,g),d.id&&m.setGroupMuted(d.id,g))}}},Ar=(d,g=Array.from(document.querySelectorAll("[data-start]")))=>{let h=Y();for(let y of g){if(!(y instanceof HTMLElement))continue;if(y.hasAttribute("data-hidden")){yr.has(y)||(Ui.set(y,y.style.getPropertyValue("display")),yr.add(y),Cs(y)&&(vr=!0),Sr=!0),y.style.display="none",(y instanceof HTMLVideoElement||y instanceof HTMLImageElement)&&r?.setSourceVisibility(y,!1);continue}if(yr.has(y)){let N=Ui.get(y);N?y.style.display=N:y.style.removeProperty("display"),Ui.delete(y),yr.delete(y),Cs(y)&&(vr=!0),Sr=!0}let w=we(y,d);if(w){let N=y.parentElement;for(;N&&N!==h;){if(N instanceof HTMLElement&&N.hasAttribute("data-start")&&!we(N,d)){w=!1;break}N=N.parentElement}}y.style.visibility=w?"visible":"hidden",(y instanceof HTMLVideoElement||y instanceof HTMLImageElement)&&r?.setSourceVisibility(y,w),w?ws(y)&&y.style.removeProperty("display"):ws(y)&&Mm(y)&&(y.style.display="none")}vr&&f.isPlaying()&&(m.stopAll(),ji()),vr=!1,Nm()},Oe=()=>{let d=Hl({shouldIncludeElement:h=>h.hasAttribute("data-start")||!!V(h).compositionRoot,resolveStartSeconds:h=>j(h),resolveDurationSeconds:h=>{let y=V(h),w=j(h),N=y.inheritedStart!=null&&y.inheritedDuration!=null&&y.inheritedDuration>0?Math.max(0,y.inheritedStart+y.inheritedDuration-w):null,G=Number.isFinite(h.duration)?Qe(h,h.duration):null,re=ve(h.dataset.duration),$=re!=null&&re>0?re:null;return Ol({isVideo:h.tagName==="VIDEO",sourceDuration:G,hostRemaining:N,explicitDuration:$})}});for(let h of d.mediaClips){let y=br.get(h.el);y&&(h.volumeKeyframes=y)}let g=e.mediaForceSyncNextTick;g&&(e.mediaForceSyncNextTick=!1),e.nativeMediaSyncDisabled||Gl({clips:d.mediaClips,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted,userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:g,onElementVolume:(h,y,w)=>m.setElementVolume(h,w),isWebAudioOwned:h=>m.ownsElement(h),isWebAudioRouted:h=>m.routesElement(h),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,be({source:"hf-preview",type:"media-autoplay-blocked"}))}}),Ar(e.currentTime)},ke=d=>{let g=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),h=Date.now();(d||g!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||h-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=g,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=h,be({source:"hf-preview",type:"state",frame:g,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},Wi="",Ts=0,Lm=()=>{let d="";for(let g of document.querySelectorAll("[data-start]"))d+=`${g.id}:${g.tagName}|`;return d},st=()=>{U(),k(),ie();let d=Y();if(d){let y=W(d.getAttribute("data-width")),w=W(d.getAttribute("data-height")),N=y?parseInt(y,10):0,G=w?parseInt(w,10):0;N>0&&G>0&&be({source:"hf-preview",type:"stage-size",width:N,height:G})}dn();let g=Ru({canonicalFps:e.canonicalFps});window.__clipManifest=g;let h=Lm();if(Wi!==h&&Fm(),!window.__clipTree||Wi!==h){let y=window;window.__clipTree=wu({startResolver:mt({timelineRegistry:y.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:y.__timelines??{},rootDuration:g.durationInFrames/e.canonicalFps}),Wi=h}be(g),Cm()},Vi=d=>typeof d=="number"&&Number.isFinite(d)&&d>0?d:0,Dm=d=>{let g=Vi(Number(d));if(g<=0)return;let h=Y(),y=Vi(ve(h?.getAttribute("data-duration"))),w=Math.max(Ts,Vi(f.getDuration()),y);g<=w||(Ts=g,h?.setAttribute("data-duration",String(g)),f.setDuration(g),st(),ke(!0))},He=(d,g=0)=>{for(let h of e.deterministicAdapters){try{d==="discover"&&h.discover(),d==="pause"&&h.pause(),d==="play"&&h.play&&h.play()}catch(y){L("runtime.init.site8",y)}if(d==="discover")try{h.seek({time:g,suppressEvents:!0})}catch(y){L("runtime.init.site9",y)}}},wt=()=>{window.__renderReady=!1},mn=null,pn=!0,Im=()=>{let d=[];for(let g of e.deterministicAdapters){let h=g.getReadyPromise;if(typeof h=="function")try{let y=h();y&&d.push(y)}catch(y){L("runtime.init.adapterReady",y)}}return d},Pm=()=>{let d=Im();if(d.length===0)return mn=null,pn=!0,!0;let g=d[0];if(!g)return!0;let h=d.length===1?g:Promise.all(d);return h!==mn&&(mn=h,pn=!1,Promise.resolve(h).then(()=>{mn===h&&(pn=!0,wt())},y=>{mn===h&&(pn=!0,L("runtime.init.adapterReady",y),wt())})),pn};if(B)_a();else{let d={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:W,onDiagnostic:({code:g,details:h})=>{be({source:"hf-preview",type:"diagnostic",code:g,details:h})}};yd(d).then(()=>xd(d)).finally(()=>{B=!0,Hi(),Tm(),_a(),La(document),wt()})}let Er=yu({postMessage:d=>be(d)});Er.installPickerApi(),Ar(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let ze=of();r=ze,T(()=>{ze.destroy(),r=null});let zi=d=>{let g=Number(d);!Number.isFinite(g)||g<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,g)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let h=document.querySelectorAll("video, audio");for(let y of h)if(y instanceof HTMLMediaElement)try{y.playbackRate=e.playbackRate}catch(w){L("runtime.init.site10",w)}},Rs={play:()=>{let d=e.capturedTimeline;if(f.isPlaying())return;let g=Ce(d,0);if(g>0)f.setDuration(g),f.reachedEnd()&&(f.seek(0),e.currentTime=0,Ct(0));else{let h=Y(),y=Number(h?.getAttribute("data-duration")??0);y>0&&f.setDuration(y)}ot(d),f.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,Ps(f.now()),p&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&ji(),He("play"),Oe(),ze.redraw(),ke(!0))},pause:()=>{if(!f.isPlaying())return;m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1,e.currentTime=f.now(),e.mediaForceSyncNextTick=!0,Ps(e.currentTime);let d=e.capturedTimeline;ot(d),He("pause"),Oe(),ze.redraw(),ke(!0)},seek:(d,g)=>{let h=$t(Math.max(0,Number(d)||0),e.canonicalFps);m.stopAll(),f.detachAudioSource();let y=f.isPlaying();y&&f.pause(),f.seek(h),e.currentTime=f.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let w=e.capturedTimeline;if(ot(w),Ct(e.currentTime),He("pause"),g?.keepPlaying&&y){Rs.play();return}Oe(),ze.redraw(),ke(!0)},renderSeek:(d,g)=>{xs=!0;let h=$t(Math.max(0,Number(d)||0),e.canonicalFps);m.stopAll(),f.detachAudioSource(),f.isPlaying()&&f.pause(),f.seek(h),e.currentTime=f.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0,Ct(e.currentTime,{activateChildren:!0,suppressEvents:g?.suppressEvents}),He("pause"),Oe(),ze.redraw(),ke(!0)},getTime:()=>f.now(),getDuration:()=>{let d=f.getDuration();return Number.isFinite(d)?d:0},isPlaying:()=>f.isPlaying(),setPlaybackRate:d=>{zi(d),f.setRate(e.playbackRate),Os()},getPlaybackRate:()=>e.playbackRate},ks=Ce(e.capturedTimeline,0);ks>0&&f.setDuration(ks);let Ge=Au({getTimeline:()=>e.capturedTimeline,setTimeline:d=>{e.capturedTimeline=d},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:d=>{e.isPlaying!==d&&(e.mediaForceSyncNextTick=!0),e.isPlaying=d},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:zi,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(d,g)=>{e.currentTime=Math.max(0,Number(d)||0),e.isPlaying!==g&&(e.mediaForceSyncNextTick=!0),e.isPlaying=g,Oe()},onStatePost:ke,onDeterministicSeek:(d,g)=>{for(let h of e.deterministicAdapters)if(!(h.name==="gsap"&&e.capturedTimeline))try{h.seek({time:Number(d)||0,suppressEvents:g?.suppressEvents})}catch(y){L("runtime.init.site11",y)}},onDeterministicPause:()=>He("pause"),onDeterministicPlay:()=>He("play"),onRenderFrameSeek:()=>{ze.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>Ce(e.capturedTimeline,0),transport:Rs});window.__player=D(Ge),window.__playerReady=!0,Ne("composition_loaded",{duration:Ge.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[hl(),Js({resolveStartSeconds:d=>P(d,0)}),Zs(),tl(),il(),ol(),al(),sl(),ll(),ul(),cl(),Qs({getTimeline:()=>e.capturedTimeline})],ml(),pl(),window.__hfReseekGpu=d=>{let g=Math.max(0,Number(d)||0);window.__hfThreeTime=g,window.__hfTypegpuTime=g,Fr(g)},window.__hfWaitForSeekCompletion=ao,a.push(()=>{window.__hfWaitForSeekCompletion===ao&&delete window.__hfWaitForSeekCompletion}),_m(),Hi(),He("discover");let Om=()=>{let d=e.capturedTimeline,g=dn();e.capturedTimeline&&(g||e.capturedTimeline!==d||!Ge._timeline)&&(Ge._timeline=e.capturedTimeline);let h=Ce(e.capturedTimeline,0);if(h>0&&f.setDuration(h),He("discover",e.currentTime),!e.capturedTimeline){let y=window.__timelines??{},w=Object.keys(y).filter(N=>y[N]);if(w.length>0){let G=Y()?.getAttribute("data-composition-id")??null;M("root_timeline_unbound_registry_present",{reason:G?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:G,registeredTimelineKeys:w},"root_timeline_unbound_registry_present"),console.warn("[hyperframes] Root timeline not bound \\u2014 render will freeze at t=0. "+(G?`Root data-composition-id is "${G}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${w.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${G??"<root-id>"}"] = tl).`)}}window.__renderReady=!0,st(),ke(!0)},It=null,Hm=()=>{if(It)return;let d=()=>{window.removeEventListener("hf-timelines-built",d),It=null,wt()};It=d,window.addEventListener("hf-timelines-built",d)};T(()=>{It&&(window.removeEventListener("hf-timelines-built",It),It=null)}),wt=()=>{if(!B){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,Hm();return}if(He("discover",e.currentTime),!Pm()){window.__renderReady=!1;return}Om()},wt(),B&&setTimeout(()=>{wt()},0);let wr=0,qi=!1,Ms=Number.NaN,Fs=null,$i=!1,Gm=(d,g,h,y)=>{try{let w=y?.suppressEvents===!0;ot(d),typeof d.totalTime=="function"?d.totalTime(g,w):d.seek(g,w)}catch(w){L(h,w)}},Bm=(d,g)=>{let h=window.__timelines??{},y=Y()?.getAttribute("data-composition-id")??null;for(let[w,N]of Object.entries(h)){if(!N||w===y)continue;let G=document.querySelector(`[data-composition-id="${CSS.escape(w)}"]`);if(!G)continue;let re=P(G,0);if(!Number.isFinite(re))continue;let $=ee(N),le=$e(G)+Math.max(0,d-re)*_e(G),Be=Math.max(0,$!=null&&$>0?Math.min($,le):le);Gm(N,Be,"runtime.init.transport.childTimeline",g)}},Ns=d=>{let g=window.__timelines??{};for(let h of Object.values(g))if(!(!h||h===d))try{h.play()}catch(y){L("runtime.init.activateSiblings",y)}},Ls=d=>typeof d=="object"&&d!==null,hn=new WeakMap,Um=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],Ds=(d,g)=>{let h=d[g];if(typeof h!="function")return null;try{let y=Number(h.call(d));return Number.isFinite(y)?y:null}catch(y){return L("runtime.init.gsapCallbackDuration",y),null}},Wm=d=>{let g=hn.get(d);if(g!=null)return g;if(!("getChildren"in d)||typeof d.getChildren!="function")return!1;let h;try{h=d.getChildren(!0,!0,!0)}catch(y){return L("runtime.init.gsapCallbackChildren",y),hn.set(d,!1),!1}if(!Array.isArray(h))return hn.set(d,!1),!1;for(let y of h){if(!Ls(y))continue;let w=y.vars;if(!Ls(w)||!Um.some($=>typeof w[$]=="function"))continue;let re=Ds(y,"totalDuration")??Ds(y,"duration");if(re!=null&&re<=1e-6)return hn.set(d,!0),!0}return hn.set(d,!1),!1};function Ct(d,g){let h=e.capturedTimeline,y=g?.suppressEvents===!0;if(h){g?.activateChildren&&Ns(h);let w=h,N=d;if(typeof w.totalDuration=="function")try{let G=Number(w.totalDuration());Number.isFinite(G)&&G>0&&d>G&&(N=G)}catch(G){L("runtime.init.transport.clampDuration",G)}try{typeof h.totalTime=="function"?(h.totalTime(N,y),!y&&!Wm(h)&&(h.totalTime(N+.001,!0),h.totalTime(N,!0))):h.seek(N,y)}catch(G){L("runtime.init.transport.seek",G)}}Bm(d,g),h&&g?.activateChildren&&Ns(h);for(let w of e.deterministicAdapters)if(!(w.name==="gsap"&&h))try{w.seek({time:d,suppressEvents:y})}catch(N){L("runtime.init.transport.adapter",N)}}let Vm=()=>{try{return document.querySelector(`[${Cf}]`)!=null}catch{return!1}},Is=()=>{if(!(e.tornDown||qi)){qi=!0;try{if(e.transportRafId=window.requestAnimationFrame(Is),wr+=1,_f({tick:wr,isPlaying:f.isPlaying(),hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:f.now()})){let y=e.capturedTimeline;if(dn()){e.capturedTimeline&&!Ge._timeline&&(Ge._timeline=e.capturedTimeline),e.capturedTimeline&&e.capturedTimeline!==y&&ot(e.capturedTimeline);let w=Ce(e.capturedTimeline,0);w>0&&f.setDuration(w),st()}}if(wr%20===0&&st(),wr%30===0&&Hi(),e.capturedTimeline){let y=Ce(e.capturedTimeline,0);y>0&&(!f.isPlaying()||y>=f.getDuration())&&f.setDuration(y)}if(f.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&m.isActive()&&m.context){let y=m.getTime();y>=0&&f.attachAudioSource({currentTimeSeconds:y})}else{let y=document.querySelectorAll("audio[data-start]"),w=!1;for(let N of y){if(!(N instanceof HTMLMediaElement)||!N.isConnected||b(N))continue;let G=Number.parseFloat(N.dataset.start??""),re=ve(N.dataset.duration),$=re!=null&&re>0?G+re:1/0,le=$e(N);if(Number.isFinite(G)&&e.currentTime>=G&&e.currentTime<$){N.paused?!N.error&&N.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(f.attachAudioSource({currentTimeSeconds:e.currentTime}),w=!0):(f.attachAudioSource({el:N,compositionStart:G,mediaStart:le}),w=!0);break}}!w&&f.hasAudioSource()&&f.detachAudioSource()}else f.hasAudioSource()&&f.detachAudioSource();let d=f.now();e.currentTime=d;let g=f.isPlaying();if(!g&&Vm()?$i=!0:(g||$i||d!==Ms||e.capturedTimeline!==Fs)&&(Ct(d),Ms=d,Fs=e.capturedTimeline,g||($i=!1)),g&&ze.redrawAnimated(),f.isPlaying()&&f.reachedEnd()){m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1;let y=f.getDuration();Number.isFinite(y)&&(f.seek(y),e.currentTime=y,Ct(y)),He("pause"),Oe(),ke(!0);return}f.isPlaying()&&Oe(),ke(!1)}finally{qi=!1}}},Ps=d=>{let g=document.querySelectorAll("video, audio");for(let h of g){if(!(h instanceof HTMLMediaElement)||!h.isConnected)continue;let y=Number.parseFloat(h.dataset.start??"");if(!Number.isFinite(y))continue;let w=ve(h.dataset.duration),N=w!=null&&w>0?y+w:1/0;if(d<y||d>=N)continue;let G=$e(h),re=d-y+G;if(re>=0)try{h.currentTime=re}catch{}}},ji=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let d=m.startGeneration(),g=document.querySelectorAll("audio[data-start]");for(let h of g){if(!(h instanceof HTMLMediaElement)||!h.isConnected||b(h))continue;let y=Number.parseFloat(h.dataset.start??"");if(!Number.isFinite(y))continue;let w=$e(h),N=Number.parseFloat(h.dataset.volume??""),G=Number.isFinite(N)?N:1,re=ve(h.dataset.duration),$=re!=null&&re>0?re:Number.POSITIVE_INFINITY,le=h.closest("[data-composition-id]");if(le){let Q=P(le,0),ne=H(le,{includeAuthoredTimingAttrs:!0});ne!=null&&ne>0&&($=Math.min($,Math.max(0,Q+ne-y)))}let Be=an(h);sn(h,Be),(Be.kind==="web-audio"?m.scheduleMediaElementPlayback(h,y,w,f.now(),G,d,e.playbackRate):Promise.resolve(null)).then(Q=>{if(Q||!f.isPlaying())return;let ne=e.playbackRate*_e(h),_t=h.hasAttribute("data-fx-chain")||h.hasAttribute("data-automation");if(Math.abs(ne-1)>1e-9){Be.kind==="web-audio"&&_t&&(h.muted=!0);return}m.decodeAudioElement(h).then(ye=>{!ye||!f.isPlaying()||m.schedulePlayback(h,ye,y,w,f.now(),G,d,e.playbackRate,$)})})}};function Os(){m.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&p&&f.isPlaying()&&m.hasBoundedActiveSources()&&(m.stopAll(),ji())}if(e.capturedTimeline){let d=Ce(e.capturedTimeline,0);d>0&&f.setDuration(d),ot(e.capturedTimeline)}Cd(window),e.transportRafId=window.requestAnimationFrame(Is),st(),ke(!0),e.controlBridgeHandler=Us({onPlay:()=>{Ge.play(),Ne("composition_played",{time:Ge.getTime()})},onPause:()=>{Ge.pause(),Ne("composition_paused",{time:Ge.getTime()})},onStopMedia:()=>{m.stopAll();let d=document.querySelectorAll("video, audio");for(let g of d)g instanceof HTMLMediaElement&&!g.paused&&g.pause()},onSeek:(d,g)=>{Ge.seek(d),Ne("composition_seeked",{time:d})},onSetMuted:d=>{e.bridgeMuted=d;let g=d||e.mediaOutputMuted;m.setMuted(g);let h=document.querySelectorAll("video, audio");for(let y of h)y instanceof HTMLMediaElement&&(y.muted=g||y.defaultMuted)},onSetVolume:d=>{e.bridgeVolume=d,m.setVolume(d);let g=document.querySelectorAll("video, audio");for(let h of g){if(!(h instanceof HTMLMediaElement))continue;let y=parseFloat(h.dataset.volume??""),w=Number.isFinite(y)?y:1;h.volume=Nr(w*d)}},onSetMediaOutputMuted:d=>{e.mediaOutputMuted=d;let g=d||e.bridgeMuted;m.setMuted(g);let h=document.querySelectorAll("video, audio");for(let y of h)y instanceof HTMLMediaElement&&(y.muted=g||y.defaultMuted)},onSetNativeMediaSyncDisabled:d=>{e.nativeMediaSyncDisabled!==d&&(e.nativeMediaSyncDisabled=d,e.mediaForceSyncNextTick=!0,d?(m.stopAll(),f.detachAudioSource()):Oe())},onSetWebAudioMediaDisabled:d=>{e.webAudioMediaDisabled!==d&&(e.webAudioMediaDisabled=d,e.mediaForceSyncNextTick=!0,d&&(m.stopAll(),f.detachAudioSource()),Oe())},onSetPlaybackRate:d=>{zi(d),e.transportClock&&e.transportClock.setRate(e.playbackRate),Os()},onSetRootDuration:Dm,onSetColorGrading:(d,g)=>{ze.setGrading(d,g)},onSetColorGradingCompare:(d,g)=>{ze.setCompare(d,g)},onTick:()=>{if(e.tornDown||!f.isPlaying())return;let d=f.now();if(e.currentTime=d,Ct(d),f.reachedEnd()){m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1;let g=f.getDuration();Number.isFinite(g)&&(f.seek(g),e.currentTime=g,Ct(g)),He("pause"),Oe(),ke(!0)}},onEnablePickMode:()=>Er.enablePickMode(),onDisablePickMode:()=>Er.disablePickMode(),onSetRuntimeData:Ri,onClearRuntimeData:ki,getCanonicalFps:()=>e.canonicalFps});let Ki=()=>{if(!e.tornDown){e.tornDown=!0,e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),e.transportClock=null,m.destroy(),Et!=null&&(window.clearTimeout(Et),Et=null),s!=null&&(window.cancelAnimationFrame(s),s=null),km(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),i&&(window.removeEventListener("error",i),i=null),o&&(window.removeEventListener("unhandledrejection",o),o=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),Er.disablePickMode();for(let d of e.deterministicAdapters)if(!(!d||typeof d.revert!="function"))try{d.revert()}catch(g){L("runtime.init.site12",g)}e.deterministicAdapters=[];for(let d of a.splice(0))try{d()}catch(g){L("runtime.init.site13",g)}for(let d of e.injectedCompStyles)try{d.remove()}catch(g){L("runtime.init.site14",g)}e.injectedCompStyles=[];for(let d of e.injectedCompLinks)try{d.remove()}catch(g){L("runtime.init.site15",g)}e.injectedCompLinks=[];for(let d of e.injectedCompScripts)try{d.remove()}catch(g){L("runtime.init.site16",g)}e.injectedCompScripts=[],e.capturedTimeline=null,t=()=>{},window.__hfRuntimeTeardown===Ki&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=Ki,e.beforeUnloadHandler=Ki,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var Vf=["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"],ss=[[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 xy(e){if(e<=255)return Vf[e];let t=0,n=ss.length-1;for(;t<=n;){let r=t+n>>1,i=ss[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return"L"}function yy(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let u=0;u<t;){let c=e.charCodeAt(u),f=c,m=1;if(c>=55296&&c<=56319&&u+1<t){let b=e.charCodeAt(u+1);b>=56320&&b<=57343&&(f=(c-55296<<10)+(b-56320)+65536,m=2)}let p=xy(f);(p==="R"||p==="AL"||p==="AN")&&(r=!0);for(let b=0;b<m;b++)n[u+b]=p;u+=m}if(!r)return null;let i=0;for(let u=0;u<t;u++){let c=n[u];if(c==="L"){i=0;break}if(c==="R"||c==="AL"){i=1;break}}let o=new Int8Array(t);for(let u=0;u<t;u++)o[u]=i;let a=i&1?"R":"L",l=a,s=l;for(let u=0;u<t;u++)n[u]==="NSM"?n[u]=s:s=n[u];s=l;for(let u=0;u<t;u++){let c=n[u];c==="EN"?n[u]=s==="AL"?"AN":"EN":(c==="R"||c==="L"||c==="AL")&&(s=c)}for(let u=0;u<t;u++)n[u]==="AL"&&(n[u]="R");for(let u=1;u<t-1;u++)n[u]==="ES"&&n[u-1]==="EN"&&n[u+1]==="EN"&&(n[u]="EN"),n[u]==="CS"&&(n[u-1]==="EN"||n[u-1]==="AN")&&n[u+1]===n[u-1]&&(n[u]=n[u-1]);for(let u=0;u<t;u++){if(n[u]!=="EN")continue;let c;for(c=u-1;c>=0&&n[c]==="ET";c--)n[c]="EN";for(c=u+1;c<t&&n[c]==="ET";c++)n[c]="EN"}for(let u=0;u<t;u++){let c=n[u];(c==="WS"||c==="ES"||c==="ET"||c==="CS")&&(n[u]="ON")}s=l;for(let u=0;u<t;u++){let c=n[u];c==="EN"?n[u]=s==="L"?"L":"EN":(c==="R"||c==="L")&&(s=c)}for(let u=0;u<t;u++){if(n[u]!=="ON")continue;let c=u+1;for(;c<t&&n[c]==="ON";)c++;let f=u>0?n[u-1]:l,m=c<t?n[c]:l,p=f!=="L"?"R":"L";if(p===(m!=="L"?"R":"L"))for(let v=u;v<c;v++)n[v]=p;u=c-1}for(let u=0;u<t;u++)n[u]==="ON"&&(n[u]=a);for(let u=0;u<t;u++){let c=n[u];(o[u]&1)===0?c==="R"?o[u]++:(c==="AN"||c==="EN")&&(o[u]+=2):(c==="L"||c==="AN"||c==="EN")&&o[u]++}return o}function zf(e,t){let n=yy(e);if(n===null)return null;let r=new Int8Array(t.length);for(let i=0;i<t.length;i++)r[i]=n[t[i]];return r}var vy=/[ \\t\\n\\r\\f]+/g,Sy=/[\\t\\n\\r\\f]| {2,}|^ | $/;function Ay(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Ey(e){if(!Sy.test(e))return e;let t=e.replace(vy," ");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 wy(e){return/[\\r\\f]/.test(e)?e.replace(/\\r\\n/g,`\n`).replace(/[\\r\\f]/g,`\n`):e.replace(/\\r\\n/g,`\n`)}var ls=null,Cy;function _y(){return ls===null&&(ls=new Intl.Segmenter(Cy,{granularity:"word"})),ls}var Ty=/\\p{Script=Arabic}/u,Mi=/\\p{M}/u,Qf=/\\p{Nd}/u;function qf(e){return Ty.test(e)}function $f(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 Ve(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){let r=e.charCodeAt(t+1);if(r>=56320&&r<=57343){let i=(n-55296<<10)+(r-56320)+65536;if($f(i))return!0;t++;continue}}if($f(n))return!0}}return!1}function Ry(e){let t=Li(e);return t!==null&&(Ni.has(t)||vt.has(t))}var ky=new Set(["\\xA0","\\u202F","\\u2060","\\uFEFF"]);function My(e){return Ve(e)}function Fy(e){let t=Li(e);return t!==null&&ky.has(t)}function Fi(e){return!Ry(e)&&!Fy(e)}var Ni=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"]),hr=new Set([\'"\',"(","[","{","\\u201C","\\u2018","\\xAB","\\u2039","\\uFF08","\\u3014","\\u3008","\\u300A","\\u300C","\\u300E","\\u3010","\\u3016","\\u3018","\\u301A"]),cs=new Set(["\'","\\u2019"]),vt=new Set([".",",","!","?",":",";","\\u060C","\\u061B","\\u061F","\\u0964","\\u0965","\\u104A","\\u104B","\\u104C","\\u104D","\\u104F",")","]","}","%",\'"\',"\\u201D","\\u2019","\\xBB","\\u203A","\\u2026"]),Ny=new Set([":",".","\\u060C","\\u061B"]),Ly=new Set(["\\u104F"]),Dy=new Set(["\\u201D","\\u2019","\\xBB","\\u203A","\\u300D","\\u300F","\\u3011","\\u300B","\\u3009","\\u3015","\\uFF09"]);function Iy(e){if(ds(e))return!0;let t=!1;for(let n of e){if(vt.has(n)){t=!0;continue}if(!(t&&Mi.test(n)))return!1}return t}function Py(e){for(let t of e)if(!Ni.has(t)&&!vt.has(t))return!1;return e.length>0}function Oy(e){if(ds(e))return!0;for(let t of e)if(!hr.has(t)&&!cs.has(t)&&!Mi.test(t))return!1;return e.length>0}function ds(e){let t=!1;for(let n of e)if(!(n==="\\\\"||Mi.test(n))){if(hr.has(n)||vt.has(n)||cs.has(n)){t=!0;continue}return!1}return t}function Zf(e,t){let n=t-1;if(n<=0)return Math.max(n,0);let r=e.charCodeAt(n);if(r<56320||r>57343)return n;let i=n-1;if(i<0)return n;let o=e.charCodeAt(i);return o>=55296&&o<=56319?i:n}function Li(e){if(e.length===0)return null;let t=Zf(e,e.length);return e.slice(t)}function Hy(e){let t=Array.from(e),n=t.length;for(;n>0;){let r=t[n-1];if(Mi.test(r)){n--;continue}if(hr.has(r)||cs.has(r)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Gy(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="\\u2014"?e:null}function jf(e,t,n,r){let i=t[r],o=e[r];if(i==null)return o;let a=n[r];if(o.length===a)return o;let l=i.repeat(a);return e[r]=l,l}function Kf(e,t){return e&&t!==null&&Ny.has(t)}function By(e){let t=Li(e);return t!==null&&Ly.has(t)}function Uy(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 Di(e){let t=e.length;for(;t>0;){let n=Zf(e,t),r=e.slice(n,t);if(Dy.has(r))return!0;if(!vt.has(r))return!1;t=n}return!1}function Wy(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`\n`)return"hard-break"}return e===" "?"space":e==="\\xA0"||e==="\\u202F"||e==="\\u2060"||e==="\\uFEFF"?"glue":e==="\\u200B"?"zero-width-break":e==="\\xAD"?"soft-hyphen":"text"}var Vy=/[\\x20\\t\\n\\xA0\\xAD\\u200B\\u202F\\u2060\\uFEFF]/;function Ie(e){return e.length===1?e[0]:e.join("")}function zy(e,t){let n=[];for(let r=e.length-1;r>=0;r--)n.push(e[r]);return n.push(t),Ie(n)}function qy(e,t,n,r){if(!Vy.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];let i=[],o=null,a=[],l=n,s=!1,u=0;for(let c of e){let f=Wy(c,r),m=f==="text"&&t;if(o!==null&&f===o&&m===s){a.push(c),u+=c.length;continue}o!==null&&i.push({text:Ie(a),isWordLike:s,kind:o,start:l}),o=f,a=[c],l=n+u,s=m,u+=c.length}return o!==null&&i.push({text:Ie(a),isWordLike:s,kind:o,start:l}),i}function us(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var $y=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function jy(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:$y.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Ky(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Yy(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let a=0;a<e.len;a++){if(r[a]!=="text"||!jy(e,a))continue;let l=[t[a]],s=a+1;for(;s<e.len&&!us(r[s]);){l.push(t[s]),n[a]=!0;let u=t[s].includes("?");if(r[s]="text",t[s]="",s++,u)break}t[a]=Ie(l)}let o=0;for(let a=0;a<t.length;a++){let l=t[a];l.length!==0&&(o!==a&&(t[o]=l,n[o]=n[a],r[o]=r[a],i[o]=i[a]),o++)}return t.length=o,n.length=o,r.length=o,i.length=o,{len:o,texts:t,isWordLike:n,kinds:r,starts:i}}function Xy(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o]),!Ky(a))continue;let l=o+1;if(l>=e.len||us(e.kinds[l]))continue;let s=[],u=e.starts[l],c=l;for(;c<e.len&&!us(e.kinds[c]);)s.push(e.texts[c]),c++;s.length>0&&(t.push(Ie(s)),n.push(!0),r.push("text"),i.push(u),o=c-1)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}var Jy=new Set([":","-","/","\\xD7",",",".","+","\\u2013","\\u2014"]),Yf=/^[A-Za-z0-9_]+[,:;]*$/,Xf=/[,:;]+$/;function em(e){for(let t of e)if(Qf.test(t))return!0;return!1}function pr(e){if(e.length===0)return!1;for(let t of e)if(!(Qf.test(t)||Jy.has(t)))return!1;return!0}function Qy(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o];if(l==="text"&&pr(a)&&em(a)){let s=[a],u=o+1;for(;u<e.len&&e.kinds[u]==="text"&&pr(e.texts[u]);)s.push(e.texts[u]),u++;t.push(Ie(s)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=u-1;continue}t.push(a),n.push(e.isWordLike[o]),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Zy(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o],s=e.isWordLike[o];if(l==="text"&&s&&Yf.test(a)){let u=[a],c=Xf.test(a),f=o+1;for(;c&&f<e.len&&e.kinds[f]==="text"&&e.isWordLike[f]&&Yf.test(e.texts[f]);){let m=e.texts[f];u.push(m),c=Xf.test(m),f++}t.push(Ie(u)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=f-1;continue}t.push(a),n.push(s),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function e1(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(e.kinds[o]==="text"&&a.includes("-")){let l=a.split("-"),s=l.length>1;for(let u=0;u<l.length;u++){let c=l[u];if(!s)break;(c.length===0||!em(c)||!pr(c))&&(s=!1)}if(s){let u=0;for(let c=0;c<l.length;c++){let f=l[c],m=c<l.length-1?`${f}-`:f;t.push(m),n.push(!0),r.push("text"),i.push(e.starts[o]+u),u+=m.length}continue}}t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function t1(e){let t=[],n=[],r=[],i=[],o=0;for(;o<e.len;){let a=[e.texts[o]],l=e.isWordLike[o],s=e.kinds[o],u=e.starts[o];if(s==="glue"){let c=[a[0]],f=u;for(o++;o<e.len&&e.kinds[o]==="glue";)c.push(e.texts[o]),o++;let m=Ie(c);if(o<e.len&&e.kinds[o]==="text")a[0]=m,a.push(e.texts[o]),l=e.isWordLike[o],s="text",u=f,o++;else{t.push(m),n.push(!1),r.push("glue"),i.push(f);continue}}else o++;if(s==="text")for(;o<e.len&&e.kinds[o]==="glue";){let c=[];for(;o<e.len&&e.kinds[o]==="glue";)c.push(e.texts[o]),o++;let f=Ie(c);if(o<e.len&&e.kinds[o]==="text"){a.push(f,e.texts[o]),l=l||e.isWordLike[o],o++;continue}a.push(f)}t.push(Ie(a)),n.push(l),r.push(s),i.push(u)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function n1(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let o=0;o<t.length-1;o++){if(r[o]!=="text"||r[o+1]!=="text"||!Ve(t[o])||!Ve(t[o+1]))continue;let a=Hy(t[o]);a!==null&&(t[o]=a.head,t[o+1]=a.tail+t[o+1],i[o+1]=i[o]+a.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Jf(e,t,n){let r=_y(),i=0,o=[],a=[],l=[],s=[],u=[],c=[],f=[],m=[],p=[],b=[],v=[],x=[];for(let E of r.segment(e))for(let S of qy(E.segment,E.isWordLike??!1,E.index,n)){let U=function(){c[k]!==null&&(a[k]=[jf(o,c,f,k)],c[k]=null),a[k].push(S.text),l[k]=l[k]||S.isWordLike,m[k]=m[k]||F,p[k]=p[k]||I,b[k]=W,v[k]=Y,x[k]=Kf(p[k],q)},A=S.kind==="text",C=Gy(S.text,S.isWordLike,S.kind),F=Ve(S.text),I=qf(S.text),q=Li(S.text),W=Di(S.text),Y=By(S.text),k=i-1;t.carryCJKAfterClosingQuote&&A&&i>0&&s[k]==="text"&&F&&m[k]&&b[k]||A&&i>0&&s[k]==="text"&&Py(S.text)&&m[k]||A&&i>0&&s[k]==="text"&&v[k]?U():A&&i>0&&s[k]==="text"&&S.isWordLike&&I&&x[k]?(U(),l[k]=!0):C!==null&&i>0&&s[k]==="text"&&c[k]===C?f[k]=(f[k]??1)+1:A&&!S.isWordLike&&i>0&&s[k]==="text"&&(Iy(S.text)||S.text==="-"&&l[k])?U():(o[i]=S.text,a[i]=[S.text],l[i]=S.isWordLike,s[i]=S.kind,u[i]=S.start,c[i]=C,f[i]=C===null?0:1,m[i]=F,p[i]=I,b[i]=W,v[i]=Y,x[i]=Kf(I,q),i++)}for(let E=0;E<i;E++){if(c[E]!==null){o[E]=jf(o,c,f,E);continue}o[E]=Ie(a[E])}for(let E=1;E<i;E++)s[E]==="text"&&!l[E]&&ds(o[E])&&s[E-1]==="text"&&(o[E-1]+=o[E],l[E-1]=l[E-1]||l[E],o[E]="");let _=Array.from({length:i},()=>null),R=-1;for(let E=i-1;E>=0;E--){let S=o[E];if(S.length!==0){if(s[E]==="text"&&!l[E]&&Oy(S)&&R>=0&&s[R]==="text"){let A=_[R]??[];A.push(S),_[R]=A,u[R]=u[E],o[E]="";continue}R=E}}for(let E=0;E<i;E++){let S=_[E];S!=null&&(o[E]=zy(S,o[E]))}let T=0;for(let E=0;E<i;E++){let S=o[E];S.length!==0&&(T!==E&&(o[T]=S,l[T]=l[E],s[T]=s[E],u[T]=u[E]),T++)}o.length=T,l.length=T,s.length=T,u.length=T;let M=t1({len:T,texts:o,isWordLike:l,kinds:s,starts:u}),D=n1(Zy(e1(Qy(Xy(Yy(M))))));for(let E=0;E<D.len-1;E++){let S=Uy(D.texts[E]);S!==null&&(D.kinds[E]!=="space"&&D.kinds[E]!=="preserved-space"||D.kinds[E+1]!=="text"||!qf(D.texts[E+1])||(D.texts[E]=S.space,D.isWordLike[E]=!1,D.kinds[E]=D.kinds[E]==="preserved-space"?"preserved-space":"space",D.texts[E+1]=S.marks+D.texts[E+1],D.starts[E+1]=D.starts[E]+S.space.length))}return D}function r1(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];let n=[],r=0;for(let i=0;i<e.len;i++)e.kinds[i]==="hard-break"&&(n.push({startSegmentIndex:r,endSegmentIndex:i,consumedEndSegmentIndex:i+1}),r=i+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function i1(e){if(e.len<=1)return e;let t=[],n=[],r=[],i=[],o=null,a=!1,l=0,s=!1,u=!1;function c(){o!==null&&(t.push(Ie(o)),n.push(a),r.push("text"),i.push(l),o=null)}for(let f=0;f<e.len;f++){let m=e.texts[f],p=e.kinds[f],b=e.isWordLike[f],v=e.starts[f];if(p==="text"){let x=My(m),_=Fi(m);if(o!==null&&s&&u){o.push(m),a=a||b,s=s||x,u=_;continue}c(),o=[m],a=b,l=v,s=x,u=_;continue}c(),t.push(m),n.push(b),r.push(p),i.push(v)}return c(),{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function tm(e,t,n="normal",r="normal"){let i=Ay(n),o=i.mode==="pre-wrap"?wy(e):Ey(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let a=r==="keep-all"?i1(Jf(o,t,i)):Jf(o,t,i);return{normalized:o,chunks:r1(a,i),...a}}var ln=null,nm=new Map,un=null,o1=96,a1=/\\p{Emoji_Presentation}/u,s1=/[\\p{Emoji_Presentation}\\p{Extended_Pictographic}\\p{Regional_Indicator}\\uFE0F\\u20E3]/u,fs=null,rm=new Map;function ms(){if(ln!==null)return ln;if(typeof OffscreenCanvas<"u")return ln=new OffscreenCanvas(1,1).getContext("2d"),ln;if(typeof document<"u")return ln=document.createElement("canvas").getContext("2d"),ln;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function l1(e){let t=nm.get(e);return t||(t=new Map,nm.set(e,t)),t}function at(e,t){let n=t.get(e);return n===void 0&&(n={width:ms().measureText(e).width,containsCJK:Ve(e)},t.set(e,n)),n}function At(){if(un!==null)return un;if(typeof navigator>"u")return un={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},un;let e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),r=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return un={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:r,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},un}function u1(e){let t=e.match(/(\\d+(?:\\.\\d+)?)\\s*px/);return t?parseFloat(t[1]):16}function im(){return fs===null&&(fs=new Intl.Segmenter(void 0,{granularity:"grapheme"})),fs}function c1(e){return a1.test(e)||e.includes("\\uFE0F")}function om(e){return s1.test(e)}function d1(e,t){let n=rm.get(e);if(n!==void 0)return n;let r=ms();r.font=e;let i=r.measureText("\\u{1F600}").width;if(n=0,i>t+.5&&typeof document<"u"&&document.body!==null){let o=document.createElement("span");o.style.font=e,o.style.display="inline-block",o.style.visibility="hidden",o.style.position="absolute",o.textContent="\\u{1F600}",document.body.appendChild(o);let a=o.getBoundingClientRect().width;document.body.removeChild(o),i-a>.5&&(n=i-a)}return rm.set(e,n),n}function f1(e){let t=0,n=im();for(let r of n.segment(e))c1(r.segment)&&t++;return t}function m1(e,t){return t.emojiCount===void 0&&(t.emojiCount=f1(e)),t.emojiCount}function St(e,t,n){return n===0?t.width:t.width-m1(e,t)*n}function am(e,t,n,r,i){if(t.breakableFitAdvances!==void 0)return t.breakableFitAdvances;let o=im(),a=[];for(let c of o.segment(e))a.push(c.segment);if(a.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(i==="sum-graphemes"){let c=[];for(let f of a){let m=at(f,n);c.push(St(f,m,r))}return t.breakableFitAdvances=c,t.breakableFitAdvances}if(i==="pair-context"||a.length>o1){let c=[],f=null,m=0;for(let p of a){let b=at(p,n),v=St(p,b,r);if(f===null)c.push(v);else{let x=f+p,_=at(x,n);c.push(St(x,_,r)-m)}f=p,m=v}return t.breakableFitAdvances=c,t.breakableFitAdvances}let l=[],s="",u=0;for(let c of a){s+=c;let f=at(s,n),m=St(s,f,r);l.push(m-u),u=m}return t.breakableFitAdvances=l,t.breakableFitAdvances}function sm(e,t){let n=ms();n.font=e;let r=l1(e),i=u1(e),o=t?d1(e,i):0;return{cache:r,fontSize:i,emojiCorrection:o}}function p1(e,t){for(;t<e.widths.length;){let n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function lm(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function um(e,t,n,r,i){let o=0,a=t;for(;o<e.length;){let l=a+e[o];if((o+1<e.length?l+i:l)>n+r)break;a=l,o++}return{fitCount:o,fittedWidth:a}}function h1(e,t){let n=0,r=e.chunks.length;for(;n<r;){let i=Math.floor((n+r)/2);t<e.chunks[i].consumedEndSegmentIndex?r=i:n=i+1}return n<e.chunks.length?n:-1}function cm(e,t,n){let r=n.segmentIndex;if(n.graphemeIndex>0)return t;let i=e.chunks[t];if(i.startSegmentIndex===i.endSegmentIndex&&r===i.startSegmentIndex)return n.segmentIndex=r,n.graphemeIndex=0,t;for(r<i.startSegmentIndex&&(r=i.startSegmentIndex);r<i.endSegmentIndex;){let o=e.kinds[r];if(o!=="space"&&o!=="zero-width-break"&&o!=="soft-hyphen")return n.segmentIndex=r,n.graphemeIndex=0,t;r++}return i.consumedEndSegmentIndex>=e.widths.length?-1:(n.segmentIndex=i.consumedEndSegmentIndex,n.graphemeIndex=0,t+1)}function dm(e,t){if(t.segmentIndex>=e.widths.length)return-1;let n=h1(e,t.segmentIndex);return n<0?-1:cm(e,n,t)}function g1(e,t,n){if(n.segmentIndex>=e.widths.length)return-1;let r=t;for(;r<e.chunks.length&&n.segmentIndex>=e.chunks[r].consumedEndSegmentIndex;)r++;return r>=e.chunks.length?-1:cm(e,r,n)}function fm(e,t){return e.simpleLineWalkFastPath?mm(e,t):ps(e,t)}function mm(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:o}=e;if(r.length===0)return 0;let l=At().lineFitEpsilon,s=t+l,u=0,c=0,f=!1,m=0,p=0,b=0,v=0,x=-1,_=0;function R(){x=-1,_=0}function T(C=b,F=v,I=c){u++,n?.({startSegmentIndex:m,startGraphemeIndex:p,endSegmentIndex:C,endGraphemeIndex:F,width:I}),c=0,f=!1,R()}function M(C,F){f=!0,m=C,p=0,b=C+1,v=0,c=F}function D(C,F,I){f=!0,m=C,p=F,b=C,v=F+1,c=I}function E(C,F){if(!f){M(C,F);return}c+=F,b=C+1,v=0}function S(C,F){let I=o[C];for(let q=F;q<I.length;q++){let W=I[q];f?c+W>s?(T(),D(C,q,W)):(c+=W,b=C,v=q+1):D(C,q,W)}f&&b===C&&v===I.length&&(b=C+1,v=0)}let A=0;for(;A<r.length&&!(!f&&(A=p1(e,A),A>=r.length));){let C=r[A],F=i[A],I=F==="space"||F==="preserved-space"||F==="tab"||F==="zero-width-break"||F==="soft-hyphen";if(!f){C>t&&o[A]!==null?S(A,0):M(A,C),I&&(x=A+1,_=c-C),A++;continue}if(c+C>s){if(I){E(A,C),T(A+1,0,c-C),A++;continue}if(x>=0){if(b>x||b===x&&v>0){T();continue}T(x,0,_);continue}if(C>t&&o[A]!==null){T(),S(A,0),A++;continue}T();continue}E(A,C),I&&(x=A+1,_=c-C),A++}return f&&T(),u}function ps(e,t,n){if(e.simpleLineWalkFastPath)return mm(e,t,n);let{widths:r,lineEndFitAdvances:i,lineEndPaintAdvances:o,kinds:a,breakableFitAdvances:l,discretionaryHyphenWidth:s,tabStopAdvance:u,chunks:c}=e;if(r.length===0||c.length===0)return 0;let f=At(),m=f.lineFitEpsilon,p=t+m,b=0,v=0,x=!1,_=0,R=0,T=0,M=0,D=-1,E=0,S=0,A=null;function C(){D=-1,E=0,S=0,A=null}function F(P=T,H=M,V=v){b++,n?.({startSegmentIndex:_,startGraphemeIndex:R,endSegmentIndex:P,endGraphemeIndex:H,width:V}),v=0,x=!1,C()}function I(P,H){x=!0,_=P,R=0,T=P+1,M=0,v=H}function q(P,H,V){x=!0,_=P,R=H,T=P,M=H+1,v=V}function W(P,H){if(!x){I(P,H);return}v+=H,T=P+1,M=0}function Y(P,H,V,j){if(!H)return;let we=P==="tab"?0:i[V],z=P==="tab"?j:o[V];D=V+1,E=v-j+we,S=v-j+z,A=P}function k(P,H){let V=l[P];for(let j=H;j<V.length;j++){let we=V[j];x?v+we>p?(F(),q(P,j,we)):(v+=we,T=P,M=j+1):q(P,j,we)}x&&T===P&&M===V.length&&(T=P+1,M=0)}function U(P){if(A!=="soft-hyphen")return!1;let H=l[P];if(H==null)return!1;let{fitCount:V,fittedWidth:j}=um(H,v,t,m,s);return V===0?!1:(v=j,T=P,M=V,C(),V===H.length?(T=P+1,M=0,!0):(F(P,V,j+s),k(P,V),!0))}function ie(P){b++,n?.({startSegmentIndex:P.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:P.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),C()}for(let P=0;P<c.length;P++){let H=c[P];if(H.startSegmentIndex===H.endSegmentIndex){ie(H);continue}x=!1,v=0,_=H.startSegmentIndex,R=0,T=H.startSegmentIndex,M=0,C();let V=H.startSegmentIndex;for(;V<H.endSegmentIndex;){let j=a[V],we=j==="space"||j==="preserved-space"||j==="tab"||j==="zero-width-break"||j==="soft-hyphen",z=j==="tab"?lm(v,u):r[V];if(j==="soft-hyphen"){x&&(T=V+1,M=0,D=V+1,E=v+s,S=v+s,A=j),V++;continue}if(!x){z>t&&l[V]!==null?k(V,0):I(V,z),Y(j,we,V,z),V++;continue}if(v+z>p){let B=v+(j==="tab"?0:i[V]),ee=v+(j==="tab"?z:o[V]);if(A==="soft-hyphen"&&f.preferEarlySoftHyphenBreak&&E<=p){F(D,0,S);continue}if(A==="soft-hyphen"&&U(V)){V++;continue}if(we&&B<=p){W(V,z),F(V+1,0,ee),V++;continue}if(D>=0&&E<=p){if(T>D||T===D&&M>0){F();continue}let K=D;F(K,0,S),V=K;continue}if(z>t&&l[V]!==null){F(),k(V,0),V++;continue}F();continue}W(V,z),Y(j,we,V,z),V++}if(x){let j=D===H.consumedEndSegmentIndex?S:v;F(H.consumedEndSegmentIndex,0,j)}}return b}function pm(e,t,n,r){let i=e.chunks[n];if(i.startSegmentIndex===i.endSegmentIndex)return t.segmentIndex=i.consumedEndSegmentIndex,t.graphemeIndex=0,0;let{widths:o,lineEndFitAdvances:a,lineEndPaintAdvances:l,kinds:s,breakableFitAdvances:u,discretionaryHyphenWidth:c,tabStopAdvance:f}=e,m=At(),p=m.lineFitEpsilon,b=r+p,v=0,x=!1,_=t.segmentIndex,R=t.graphemeIndex,T=-1,M=0,D=0,E=null;function S(){T=-1,M=0,D=0,E=null}function A(k=_,U=R,ie=v){return x?(t.segmentIndex=k,t.graphemeIndex=U,ie):null}function C(k,U){x=!0,_=k+1,R=0,v=U}function F(k,U,ie){x=!0,_=k,R=U+1,v=ie}function I(k,U){if(!x){C(k,U);return}v+=U,_=k+1,R=0}function q(k,U,ie,P){if(!U)return;let H=k==="tab"?0:a[ie],V=k==="tab"?P:l[ie];T=ie+1,M=v-P+H,D=v-P+V,E=k}function W(k,U){let ie=u[k];for(let P=U;P<ie.length;P++){let H=ie[P];if(!x)F(k,P,H);else{if(v+H>b)return A();v+=H,_=k,R=P+1}}return x&&_===k&&R===ie.length&&(_=k+1,R=0),null}function Y(k){if(E!=="soft-hyphen"||T<0)return null;let U=u[k]??null;if(U!==null){let{fitCount:ie,fittedWidth:P}=um(U,v,r,p,c);if(ie===U.length)return v=P,_=k+1,R=0,S(),null;if(ie>0)return A(k,ie,P+c)}return M<=b?A(T,0,D):null}for(let k=t.segmentIndex;k<i.endSegmentIndex;k++){let U=s[k],ie=U==="space"||U==="preserved-space"||U==="tab"||U==="zero-width-break"||U==="soft-hyphen",P=k===t.segmentIndex?t.graphemeIndex:0,H=U==="tab"?lm(v,f):o[k];if(U==="soft-hyphen"&&P===0){x&&(_=k+1,R=0,T=k+1,M=v+c,D=v+c,E=U);continue}if(!x){if(P>0){let j=W(k,P);if(j!==null)return j}else if(H>r&&u[k]!==null){let j=W(k,0);if(j!==null)return j}else C(k,H);q(U,ie,k,H);continue}if(v+H>b){let j=v+(U==="tab"?0:a[k]),we=v+(U==="tab"?H:l[k]);if(E==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&M<=b)return A(T,0,D);let z=Y(k);if(z!==null)return z;if(ie&&j<=b)return I(k,H),A(k+1,0,we);if(T>=0&&M<=b)return _>T||_===T&&R>0?A():A(T,0,D);if(H>r&&u[k]!==null){let O=A();if(O!==null)return O;let B=W(k,0);if(B!==null)return B}return A()}I(k,H),q(U,ie,k,H)}return T===i.consumedEndSegmentIndex&&R===0?A(i.consumedEndSegmentIndex,0,D):A(i.consumedEndSegmentIndex,0,v)}function b1(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:o}=e,l=At().lineFitEpsilon,s=n+l,u=0,c=!1,f=t.segmentIndex,m=t.graphemeIndex,p=-1,b=0;for(let v=t.segmentIndex;v<r.length;v++){let x=r[v],_=i[v],R=_==="space"||_==="preserved-space"||_==="tab"||_==="zero-width-break"||_==="soft-hyphen",T=v===t.segmentIndex?t.graphemeIndex:0,M=o[v];if(!c){if(T>0||x>n&&M!==null){let D=M,E=D[T];c=!0,u=E,f=v,m=T+1;for(let S=T+1;S<D.length;S++){let A=D[S];if(u+A>s)return t.segmentIndex=f,t.graphemeIndex=m,u;u+=A,f=v,m=S+1}f===v&&m===D.length&&(f=v+1,m=0)}else c=!0,u=x,f=v+1,m=0;R&&(p=v+1,b=u-x);continue}if(u+x>s)return R?(t.segmentIndex=v+1,t.graphemeIndex=0,u):p>=0?f>p||f===p&&m>0?(t.segmentIndex=f,t.graphemeIndex=m,u):(t.segmentIndex=p,t.graphemeIndex=0,b):(t.segmentIndex=f,t.graphemeIndex=m,u);u+=x,f=v+1,m=0,R&&(p=v+1,b=u-x)}return c?(t.segmentIndex=f,t.graphemeIndex=m,u):null}function x1(e,t,n){let r=dm(e,t);return r<0?null:e.simpleLineWalkFastPath?b1(e,t,n):pm(e,t,r,n)}function hm(e,t){if(e.widths.length===0)return{lineCount:0,maxLineWidth:0};let n={segmentIndex:0,graphemeIndex:0},r=0,i=0;if(!e.simpleLineWalkFastPath){let o=dm(e,n);for(;o>=0;){let a=pm(e,n,o,t);if(a===null)return{lineCount:r,maxLineWidth:i};r++,a>i&&(i=a),o=g1(e,o,n)}return{lineCount:r,maxLineWidth:i}}for(;;){let o=x1(e,n,t);if(o===null)return{lineCount:r,maxLineWidth:i};r++,o>i&&(i=o)}}var hs=null;function y1(){return hs===null&&(hs=new Intl.Segmenter(void 0,{granularity:"grapheme"})),hs}function v1(e){return e?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function S1(e,t){let n=[],r=[],i=0,o=!1,a=!1,l=!1;function s(){r.length!==0&&(n.push({text:r.length===1?r[0]:r.join(""),start:i}),r=[],o=!1,a=!1,l=!1)}function u(f,m,p){r=[f],i=m,o=p,a=Di(f),l=hr.has(f)}function c(f,m){r.push(f),o=o||m;let p=Di(f);f.length===1&&vt.has(f)?a=a||p:a=p,l=!1}for(let f of y1().segment(e)){let m=f.segment,p=Ve(m);if(r.length===0){u(m,f.index,p);continue}if(l||Ni.has(m)||vt.has(m)||t.carryCJKAfterClosingQuote&&p&&a){c(m,p);continue}if(!o&&!p){c(m,p);continue}s(),u(m,f.index,p)}return s(),n}function A1(e){if(e.length<=1)return e;let t=[],n=[e[0].text],r=e[0].start,i=Ve(e[0].text),o=Fi(e[0].text);function a(){t.push({text:n.length===1?n[0]:n.join(""),start:r})}for(let l=1;l<e.length;l++){let s=e[l],u=Ve(s.text),c=Fi(s.text);if(i&&o){n.push(s.text),i=i||u,o=c;continue}a(),n=[s.text],r=s.start,i=u,o=c}return a(),t}function E1(e,t,n,r){let i=At(),{cache:o,emojiCorrection:a}=sm(t,om(e.normalized)),l=St("-",at("-",o),a),u=St(" ",at(" ",o),a)*8;if(e.len===0)return v1(n);let c=[],f=[],m=[],p=[],b=e.chunks.length<=1,v=n?[]:null,x=[],_=n?[]:null,R=Array.from({length:e.len});function T(S,A,C,F,I,q,W){I!=="text"&&I!=="space"&&I!=="zero-width-break"&&(b=!1),c.push(A),f.push(C),m.push(F),p.push(I),v?.push(q),x.push(W),_!==null&&_.push(S)}function M(S,A,C,F,I){let q=at(S,o),W=St(S,q,a),Y=A==="space"||A==="preserved-space"||A==="zero-width-break"?0:W,k=A==="space"||A==="zero-width-break"?0:W;if(I&&F&&S.length>1){let U="sum-graphemes";pr(S)?U="pair-context":i.preferPrefixWidthsForBreakableRuns&&(U="segment-prefixes");let ie=am(S,q,o,a,U);T(S,W,Y,k,A,C,ie);return}T(S,W,Y,k,A,C,null)}for(let S=0;S<e.len;S++){R[S]=c.length;let A=e.texts[S],C=e.isWordLike[S],F=e.kinds[S],I=e.starts[S];if(F==="soft-hyphen"){T(A,0,l,l,F,I,null);continue}if(F==="hard-break"){T(A,0,0,0,F,I,null);continue}if(F==="tab"){T(A,0,0,0,F,I,null);continue}let q=at(A,o);if(F==="text"&&q.containsCJK){let W=S1(A,i),Y=r==="keep-all"?A1(W):W;for(let k=0;k<Y.length;k++){let U=Y[k];M(U.text,"text",I+U.start,C,r==="keep-all"||!Ve(U.text))}continue}M(A,F,I,C,!0)}let D=w1(e.chunks,R,c.length),E=v===null?null:zf(e.normalized,v);return _!==null?{widths:c,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:p,simpleLineWalkFastPath:b,segLevels:E,breakableFitAdvances:x,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:D,segments:_}:{widths:c,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:p,simpleLineWalkFastPath:b,segLevels:E,breakableFitAdvances:x,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:D}}function w1(e,t,n){let r=[];for(let i=0;i<e.length;i++){let o=e[i],a=o.startSegmentIndex<t.length?t[o.startSegmentIndex]:n,l=o.endSegmentIndex<t.length?t[o.endSegmentIndex]:n,s=o.consumedEndSegmentIndex<t.length?t[o.consumedEndSegmentIndex]:n;r.push({startSegmentIndex:a,endSegmentIndex:l,consumedEndSegmentIndex:s})}return r}function gm(e,t,n,r){let i=r?.wordBreak??"normal",o=tm(e,At(),r?.whiteSpace,i);return E1(o,t,n,i)}function Ii(e,t,n){return gm(e,t,!1,n)}function bm(e,t,n){return gm(e,t,!0,n)}function Pi(e,t,n){let r=fm(e,t);return{lineCount:r,height:r*n}}function C1(e){return{width:e.width,start:{segmentIndex:e.startSegmentIndex,graphemeIndex:e.startGraphemeIndex},end:{segmentIndex:e.endSegmentIndex,graphemeIndex:e.endGraphemeIndex}}}function _1(e,t,n){return e.widths.length===0?0:ps(e,t,r=>{n(C1(r))})}function xm(e,t){return hm(e,t)}function ym(e){let t=0;return _1(e,Number.POSITIVE_INFINITY,n=>{n.width>t&&(t=n.width)}),t}var T1={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function vm(e,t){let n={...T1,...t},r=1.2;for(let i=n.baseFontSize;i>=n.minFontSize;i-=n.step){let o=`${n.fontWeight} ${i}px ${n.fontFamily}`,a=Ii(e,o),{lineCount:l}=Pi(a,n.maxWidth,i*r);if(l<=1)return{fontSize:i,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}var Sm={prepare:Ii,layout:Pi,prepareWithSegments:bm,measureLineStats:xm,measureNaturalWidth:ym};window.__timelines=window.__timelines||{};Od();window.__hyperframes={fitTextFontSize:vm,getVariables:qs,pretext:Sm,registerRuntimeDataHandler:Bf,setRuntimeData:Ri,clearRuntimeData:ki};function Am(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,Wf())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Am,{once:!0}):Am();})();\n';
|
|
58787
|
+
RUNTIME_IIFE = '"use strict";(()=>{var qm=Object.create;var Xi=Object.defineProperty;var $m=Object.getOwnPropertyDescriptor;var jm=Object.getOwnPropertyNames;var Km=Object.getPrototypeOf,Ym=Object.prototype.hasOwnProperty;var Xm=(e,t,n)=>t in e?Xi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ae=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Jm=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of jm(t))!Ym.call(e,i)&&i!==n&&Xi(e,i,{get:()=>t[i],enumerable:!(r=$m(t,i))||r.enumerable});return e};var Qm=(e,t,n)=>(n=e!=null?qm(Km(e)):{},Jm(t||!e||!e.__esModule?Xi(n,"default",{value:e,enumerable:!0}):n,e));var ge=(e,t,n)=>Xm(e,typeof t!="symbol"?t+"":t,n);var Lu=ae((aA,Ko)=>{var Z=String,Nu=function(){return{isColorSupported:!1,reset:Z,bold:Z,dim:Z,italic:Z,underline:Z,inverse:Z,hidden:Z,strikethrough:Z,black:Z,red:Z,green:Z,yellow:Z,blue:Z,magenta:Z,cyan:Z,white:Z,gray:Z,bgBlack:Z,bgRed:Z,bgGreen:Z,bgYellow:Z,bgBlue:Z,bgMagenta:Z,bgCyan:Z,bgWhite:Z,blackBright:Z,redBright:Z,greenBright:Z,yellowBright:Z,blueBright:Z,magentaBright:Z,cyanBright:Z,whiteBright:Z,bgBlackBright:Z,bgRedBright:Z,bgGreenBright:Z,bgYellowBright:Z,bgBlueBright:Z,bgMagentaBright:Z,bgCyanBright:Z,bgWhiteBright:Z}};Ko.exports=Nu();Ko.exports.createColors=Nu});var Yo=ae(()=>{});var Xr=ae((uA,Pu)=>{"use strict";var Du=Lu(),Iu=Yo(),Hn=class e extends Error{constructor(t,n,r,i,o,a){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),a&&(this.plugin=a),typeof n<"u"&&typeof r<"u"&&(typeof n=="number"?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let n=this.source;t==null&&(t=Du.isColorSupported);let r=c=>c,i=c=>c,o=c=>c;if(t){let{bold:c,gray:f,red:m}=Du.createColors(!0);i=p=>c(m(p)),r=p=>f(p),Iu&&(o=p=>Iu(p))}let a=n.split(/\\r?\\n/),l=Math.max(this.line-3,0),s=Math.min(this.line+2,a.length),u=String(s).length;return a.slice(l,s).map((c,f)=>{let m=l+1+f,p=" "+(" "+m).slice(-u)+" | ";if(m===this.line){if(c.length>160){let v=20,x=Math.max(0,this.column-v),_=Math.max(this.column+v,this.endColumn+v),R=c.slice(x,_),T=r(p.replace(/\\d/g," "))+c.slice(0,Math.min(this.column-1,v-1)).replace(/[^\\t]/g," ");return i(">")+r(p)+o(R)+`\n `+T+i("^")}let b=r(p.replace(/\\d/g," "))+c.slice(0,this.column-1).replace(/[^\\t]/g," ");return i(">")+r(p)+o(c)+`\n `+b+i("^")}return" "+r(p)+o(c)}).join(`\n`)}toString(){let t=this.showSourceCode();return t&&(t=`\n\n`+t+`\n`),this.name+": "+this.message+t}};Pu.exports=Hn;Hn.default=Hn});var Xo=ae((cA,Hu)=>{"use strict";var g0=/(<)(\\/?style\\b)/gi,b0=/(<)(!--)/g;function ht(e){return typeof e!="string"||!e.includes("<")?e:e.replace(g0,"\\\\3c $2").replace(b0,"\\\\3c $2")}var Ou={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function x0(e){return e[0].toUpperCase()+e.slice(1)}var Gn=class{constructor(t){this.builder=t}atrule(t,n){let r=t.raws,i="@"+t.name,o=t.params?this.rawValue(t,"params"):"";if(typeof r.afterName<"u"?i+=r.afterName:o&&(i+=" "),t.nodes)this.block(t,i+o);else{let a=(r.between||"")+(n?";":"");this.builder(ht(i+o+a),t)}}beforeAfter(t,n){let r;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):n==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");let i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(`\n`)){let a=this.raw(t,null,"indent");if(a.length)for(let l=0;l<o;l++)r+=a}return r}block(t,n){let r=this.raw(t,"between","beforeOpen");this.builder(ht(n+r)+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(ht(i)),this.builder("}",t,"end")}body(t){let n=t.nodes,r=n.length-1;for(;r>0&&n[r].type==="comment";)r-=1;let i=this.raw(t,"semicolon"),o=t.type==="document";for(let a=0;a<n.length;a++){let l=n[a],s=this.raw(l,"before");s&&this.builder(o?s:ht(s)),this.stringify(l,r!==a||i)}}comment(t){let n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder(ht("/*"+n+t.text+r+"*/"),t)}decl(t,n){let r=t.raws,i=this.raw(t,"between","colon"),o=t.prop+i+this.rawValue(t,"value");t.important&&(o+=r.important||" !important"),n&&(o+=";"),this.builder(ht(o),t)}document(t){this.body(t)}raw(t,n,r){let i;if(r||(r=n),n&&(i=t.raws[n],typeof i<"u"))return i;let o=t.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return Ou[r];let a=t.root(),l=a.rawCache||(a.rawCache={});if(typeof l[r]<"u")return l[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);{let s="raw"+x0(r);this[s]?i=this[s](a,t):a.walk(u=>{if(i=u.raws[n],typeof i<"u")return!1})}return typeof i>"u"&&(i=Ou[r]),l[r]=i,i}rawBeforeClose(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return n=r.raws.after,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawBeforeComment(t,n){let r;return t.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`\n`)&&(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(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`\n`)&&(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(`\n`)&&(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 i=r.parent;if(i&&i!==t&&i.parent&&i.parent===t&&typeof r.raws.before<"u"){let o=r.raws.before.split(`\n`);return n=o[o.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],i=t.raws[n];return i&&i.value===r?i.raw:r}root(t){if(this.body(t),t.raws.after){let n=t.raws.after,r=t.parent&&t.parent.type==="document";this.builder(r?n:ht(n))}}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(ht(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)}};Hu.exports=Gn;Gn.default=Gn});var Bn=ae((dA,Gu)=>{"use strict";var y0=Xo();function Jo(e,t){new y0(t).stringify(e)}Gu.exports=Jo;Jo.default=Jo});var Jr=ae((fA,Qo)=>{"use strict";Qo.exports.isClean=Symbol("isClean");Qo.exports.my=Symbol("my")});var Vn=ae((mA,Bu)=>{"use strict";var v0=Xr(),S0=Xo(),A0=Bn(),{isClean:Un,my:E0}=Jr();function Zo(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r==="proxyCache")continue;let i=e[r],o=typeof i;r==="parent"&&o==="object"?t&&(n[r]=t):r==="source"?n[r]=i:Array.isArray(i)?n[r]=i.map(a=>Zo(a,n)):(o==="object"&&i!==null&&(i=Zo(i)),n[r]=i)}return n}function tt(e,t){if(t&&typeof t.offset<"u")return t.offset;let n=1,r=1,i=0;for(let o=0;o<e.length;o++){if(r===t.line&&n===t.column){i=o;break}e[o]===`\n`?(n=1,r+=1):n+=1}return i}var Wn=class{get proxyOf(){return this}constructor(t={}){this.raws={},this[Un]=!1,this[E0]=!0;for(let n in t)if(n==="nodes"){this.nodes=[];for(let r of t[n])typeof r.clone=="function"?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=Zo(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:i}=this.rangeBy(n);return this.source.input.error(t,{column:i.column,line:i.line},{column:r.column,line:r.line},n)}return new v0(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[Un]=!0}markDirty(){if(this[Un]){this[Un]=!1;let t=this;for(;t=t.parent;)t[Un]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t={}){let n=this.source.start;if(t.index)n=this.positionInside(t.index);else if(t.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,o=r.slice(tt(r,this.source.start),tt(r,this.source.end)).indexOf(t.word);o!==-1&&(n=this.positionInside(o))}return n}positionInside(t){let n=this.source.start.column,r=this.source.start.line,i="document"in this.source.input?this.source.input.document:this.source.input.css,o=tt(i,this.source.start),a=o+t;for(let l=o;l<a;l++)i[l]===`\n`?(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:tt(n,this.source.start)},i=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:tt(n,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(t.word){let a=n.slice(tt(n,this.source.start),tt(n,this.source.end)).indexOf(t.word);a!==-1&&(r=this.positionInside(a),i=this.positionInside(a+t.word.length))}else t.start?r={column:t.start.column,line:t.start.line,offset:tt(n,t.start)}:t.index&&(r=this.positionInside(t.index)),t.end?i={column:t.end.column,line:t.end.line,offset:tt(n,t.end)}:typeof t.endIndex=="number"?i=this.positionInside(t.endIndex):t.index&&(i=this.positionInside(t.index+1));return(i.line<r.line||i.line===r.line&&i.column<=r.column)&&(i={column:r.column+1,line:r.line,offset:r.offset+1}),{end:i,start:r}}raw(t,n){return new S0().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 i of t)i===this?r=!0:r?(this.parent.insertAfter(n,i),n=i):this.parent.insertBefore(n,i);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={},i=n==null;n=n||new Map;let o=0;for(let a in this){if(!Object.prototype.hasOwnProperty.call(this,a)||a==="parent"||a==="proxyCache")continue;let l=this[a];if(Array.isArray(l))r[a]=l.map(s=>typeof s=="object"&&s.toJSON?s.toJSON(null,n):s);else if(typeof l=="object"&&l.toJSON)r[a]=l.toJSON(null,n);else if(a==="source"){if(l==null)continue;let s=n.get(l.input);s==null&&(s=o,n.set(l.input,o),o++),r[a]={end:l.end,inputId:s,start:l.start}}else r[a]=l}return i&&(r.inputs=[...n.keys()].map(a=>a.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=A0){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r={}){let i={node:this};for(let o in r)i[o]=r[o];return t.warn(n,i)}};Bu.exports=Wn;Wn.default=Wn});var qn=ae((pA,Uu)=>{"use strict";var w0=Vn(),zn=class extends w0{constructor(t){super(t),this.type="comment"}};Uu.exports=zn;zn.default=zn});var jn=ae((hA,Wu)=>{"use strict";var C0=Vn(),$n=class extends C0{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"}};Wu.exports=$n;$n.default=$n});var gt=ae((gA,Ju)=>{"use strict";var Vu=qn(),zu=jn(),_0=Vn(),{isClean:qu,my:$u}=Jr(),ea,ju,Ku,ta;function Yu(e){return e.map(t=>(t.nodes&&(t.nodes=Yu(t.nodes)),delete t.source,t))}function Xu(e){if(e[qu]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Xu(t)}var We=class e extends _0{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 i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let n of this.nodes)n.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,i;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],i=t(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[n]+=1;return delete this.indexes[n],i}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(i=>typeof i=="function"?(o,a)=>i(o.toProxy(),a):i)):n==="every"||n==="some"?r=>t[n]((i,...o)=>r(i.toProxy(),...o)):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),i=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let a of i)this.proxyOf.nodes.splice(r+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<o&&(this.indexes[a]=o+i.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),i=r===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[r],i).reverse();r=this.index(t);for(let l of o)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+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=Yu(ju(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"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 zu(t)]}else if(t.selector||t.selectors)t=[new ta(t)];else if(t.name)t=[new ea(t)];else if(t.text)t=[new Vu(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[$u]||e.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[qu]&&Xu(i),i.raws||(i.raws={}),typeof i.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(i.raws.before=n.raws.before.replace(/\\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+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(i=>{n.props&&!n.props.includes(i.prop)||n.fast&&!i.value.includes(n.fast)||(i.value=i.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((n,r)=>{let i;try{i=t(n,r)}catch(o){throw n.addToError(o)}return i!==!1&&n.walk&&(i=n.walk(t)),i})}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="atrule")return n(r,i)}))}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,i)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="decl")return n(r,i)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="rule")return n(r,i)}))}};We.registerParse=e=>{ju=e};We.registerRule=e=>{ta=e};We.registerAtRule=e=>{ea=e};We.registerRoot=e=>{Ku=e};Ju.exports=We;We.default=We;We.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,ea.prototype):e.type==="rule"?Object.setPrototypeOf(e,ta.prototype):e.type==="decl"?Object.setPrototypeOf(e,zu.prototype):e.type==="comment"?Object.setPrototypeOf(e,Vu.prototype):e.type==="root"&&Object.setPrototypeOf(e,Ku.prototype),e[$u]=!0,e.nodes&&e.nodes.forEach(t=>{We.rebuild(t)})}});var Qr=ae((bA,Zu)=>{"use strict";var Qu=gt(),Yt=class extends Qu{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)}};Zu.exports=Yt;Yt.default=Yt;Qu.registerAtRule(Yt)});var Zr=ae((xA,nc)=>{"use strict";var T0=gt(),ec,tc,kt=class extends T0{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new ec(new tc,this,t).stringify()}};kt.registerLazyResult=e=>{ec=e};kt.registerProcessor=e=>{tc=e};nc.exports=kt;kt.default=kt});var ic=ae((yA,rc)=>{var R0="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",k0=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i--;)r+=e[Math.random()*e.length|0];return r},M0=(e=21)=>{let t="",n=e|0;for(;n--;)t+=R0[Math.random()*64|0];return t};rc.exports={nanoid:M0,customAlphabet:k0}});var ei=ae(()=>{});var ti=ae(()=>{});var na=ae(()=>{});var oc=ae(()=>{});var ia=ae((RA,lc)=>{"use strict";var{existsSync:F0,readFileSync:N0}=oc(),{dirname:ra,join:L0}=ei(),{SourceMapConsumer:ac,SourceMapGenerator:sc}=ti();function D0(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var Kn=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,i=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=ra(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new ac(this.json||this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\\/json;charset=utf-?8;base64,/,r=/^data:application\\/json;base64,/,i=/^data:application\\/json;charset=utf-?8,/,o=/^data:application\\/json,/,a=t.match(i)||t.match(o);if(a)return decodeURIComponent(t.substr(a[0].length));let l=t.match(n)||t.match(r);if(l)return D0(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()),i=t.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,i)))}loadFile(t,n,r){if(!(!r&&!this.unsafeMap&&!/\\.map$/i.test(t))&&(this.root=ra(t),F0(t)))return this.mapFile=t,N0(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 i=this.loadFile(r,t,!0);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(n instanceof ac)return sc.fromSourceMap(n).toString();if(n instanceof sc)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=L0(ra(t),r));let i=this.loadFile(r,t,!1);if(i)try{this.json=JSON.parse(i.replace(/^\\)]}\'[^\\n]*\\n/,""))}catch{return}return i}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};lc.exports=Kn;Kn.default=Kn});var Yn=ae((kA,mc)=>{"use strict";var{nanoid:I0}=ic(),{isAbsolute:sa,resolve:la}=ei(),{SourceMapConsumer:P0,SourceMapGenerator:O0}=ti(),{fileURLToPath:uc,pathToFileURL:ni}=na(),cc=Xr(),H0=ia(),oa=Yo(),aa=Symbol("lineToIndexCache"),G0=!!(P0&&O0),dc=!!(la&&sa);function fc(e){if(e[aa])return e[aa];let t=e.css.split(`\n`),n=new Array(t.length),r=0;for(let i=0,o=t.length;i<o;i++)n[i]=r,r+=t[i].length+1;return e[aa]=n,n}var Xt=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&&(!dc||/^\\w+:\\/\\//.test(n.from)||sa(n.from)?this.file=n.from:this.file=la(n.from)),dc&&G0){let r=new H0(this.css,n);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+I0(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,i={}){let o,a,l,s,u;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,o=p.col}else a=m.line,o=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 c=this.origin(n,r,a,o);return c?u=new cc(t,c.endLine===void 0?c.line:{column:c.column,line:c.line},c.endLine===void 0?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,i.plugin):u=new cc(t,a===void 0?n:{column:r,line:n},a===void 0?r:{column:o,line:a},this.css,this.file,i.plugin),u.input={column:r,endColumn:o,endLine:a,endOffset:l,line:n,offset:s,source:this.css},this.file&&(ni&&(u.input.url=ni(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(t,n){return fc(this)[t-1]+n-1}fromOffset(t){let n=fc(this),r=n[n.length-1],i=0;if(t>=r)i=n.length-1;else{let o=n.length-2,a;for(;i<o;)if(a=i+(o-i>>1),t<n[a])o=a-1;else if(t>=n[a+1])i=a+1;else{i=a;break}}return{col:t-n[i]+1,line:i+1}}mapResolve(t){return/^\\w+:\\/\\//.test(t)?t:la(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,i){if(!this.map)return!1;let o=this.map.consumer(),a=o.originalPositionFor({column:n,line:t});if(!a.source)return!1;let l;typeof r=="number"&&(l=o.originalPositionFor({column:i,line:r}));let s;sa(a.source)?s=ni(a.source):s=new URL(a.source,this.map.consumer().sourceRoot||ni(this.map.mapFile));let u={column:a.column,endColumn:l&&l.column,endLine:l&&l.line,line:a.line,url:s.toString()};if(s.protocol==="file:")if(uc)u.file=uc(s);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(a.source);return c&&(u.source=c),u}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}};mc.exports=Xt;Xt.default=Xt;oa&&oa.registerInput&&oa.registerInput(Xt)});var Jt=ae((MA,bc)=>{"use strict";var pc=gt(),hc,gc,bt=class extends pc{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,r){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 o of i)o.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 hc(new gc,this,t).stringify()}};bt.registerLazyResult=e=>{hc=e};bt.registerProcessor=e=>{gc=e};bc.exports=bt;bt.default=bt;pc.registerRoot(bt)});var ua=ae((FA,xc)=>{"use strict";var Xn={comma(e){return Xn.split(e,[","],!0)},space(e){let t=[" ",`\n`," "];return Xn.split(e,t)},split(e,t,n){let r=[],i="",o=!1,a=0,l=!1,s="",u=!1;for(let c of e)u?u=!1:c==="\\\\"?u=!0:l?c===s&&(l=!1):c===\'"\'||c==="\'"?(l=!0,s=c):c==="("?a+=1:c===")"?a>0&&(a-=1):a===0&&t.includes(c)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=c;return(n||i!=="")&&r.push(i.trim()),r}};xc.exports=Xn;Xn.default=Xn});var ri=ae((NA,vc)=>{"use strict";var yc=gt(),B0=ua(),Qt=class extends yc{get selectors(){return B0.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=[])}};vc.exports=Qt;Qt.default=Qt;yc.registerRule(Qt)});var Ac=ae((LA,Sc)=>{"use strict";var U0=Qr(),W0=qn(),V0=jn(),z0=Yn(),q0=ia(),$0=Jt(),j0=ri();function Jn(e,t){if(Array.isArray(e))return e.map(i=>Jn(i));let{inputs:n,...r}=e;if(n){t=[];for(let i of n){let o={...i,__proto__:z0.prototype};o.map&&(o.map={...o.map,__proto__:q0.prototype}),t.push(o)}}if(r.nodes&&(r.nodes=e.nodes.map(i=>Jn(i,t))),r.source){let{inputId:i,...o}=r.source;r.source=o,i!=null&&(r.source.input=t[i])}if(r.type==="root")return new $0(r);if(r.type==="decl")return new V0(r);if(r.type==="rule")return new j0(r);if(r.type==="comment")return new W0(r);if(r.type==="atrule")return new U0(r);throw new Error("Unknown node type: "+e.type)}Sc.exports=Jn;Jn.default=Jn});var da=ae((DA,Rc)=>{"use strict";var{dirname:ii,relative:wc,resolve:Cc,sep:_c}=ei(),{SourceMapConsumer:Tc,SourceMapGenerator:oi}=ti(),{pathToFileURL:Ec}=na(),K0=Yn(),Y0=!!(Tc&&oi),X0=!!(ii&&Cc&&wc&&_c),ca=class{constructor(t,n,r,i){this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,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=`\n`;this.css.includes(`\\r\n`)&&(n=`\\r\n`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||ii(t.file),i;this.mapOpts.sourcesContent===!1?(i=new Tc(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,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;for(;(t=this.css.lastIndexOf("/*#"))!==-1;){let n=this.css.indexOf("*/",t+3);if(n===-1)break;for(;t>0&&this.css[t-1]===`\n`;)t--;this.css=this.css.slice(0,t)+this.css.slice(n+2)}}}}generate(){if(this.clearAnnotation(),X0&&Y0&&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=oi.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new oi({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 oi({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,a;this.stringify(this.root,(l,s,u)=>{if(this.css+=l,s&&u!=="end"&&(i.generated.line=t,i.generated.column=n-1,s.source&&s.source.start?(i.source=this.sourcePath(s),i.original.line=s.source.start.line,i.original.column=s.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),a=l.match(/\\n/g),a?(t+=a.length,o=l.lastIndexOf(`\n`),n=l.length-o):n+=l.length,s&&u!=="start"){let c=s.parent||{raws:{}};(!(s.type==="decl"||s.type==="atrule"&&!s.nodes)||s!==c.last||c.raws.semicolon)&&(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=t,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=n-1,this.map.addMapping(i)))}})}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?ii(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=ii(Cc(r,this.mapOpts.annotation)));let i=wc(r,t);return this.memoizedPaths.set(t,i),i}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 K0(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 i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,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(Ec){let r=Ec(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;_c==="\\\\"&&(t=t.replace(/\\\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}};Rc.exports=ca});var Fc=ae((IA,Mc)=>{"use strict";var ai=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,si=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,J0=/.[\\r\\n"\'(/\\\\]/,kc=/[\\da-f]/i;Mc.exports=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,a,l,s,u,c,f,m,p,b,v=r.length,x=0,_=[],R=[],T=-1;function M(){return x}function D(C){throw t.error("Unclosed "+C,x)}function E(){return R.length===0&&x>=v}function S(C){if(R.length)return R.pop();if(x>=v)return;let F=C?C.ignoreUnclosed:!1;switch(o=r.charCodeAt(x),o){case 10:case 32:case 9:case 13:case 12:{s=x;do s+=1,o=r.charCodeAt(s);while(o===32||o===10||o===9||o===13||o===12);c=["space",r.slice(x,s)],x=s-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let I=String.fromCharCode(o);c=[I,I,x];break}case 40:{if(b=_.length?_.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(i||F){s=x;break}else D("bracket");for(m=s;r.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);c=["brackets",r.slice(x,s+1),x,s],x=s}else x<=T?c=["(","(",x]:(s=r.indexOf(")",x+1),a=r.slice(x,s+1),s===-1||J0.test(a)?(T=s===-1?v:s,c=["(","(",x]):(c=["brackets",a,x,s],x=s));break}case 39:case 34:{u=o===39?"\'":\'"\',s=x;do{if(f=!1,s=r.indexOf(u,s+1),s===-1)if(i||F){s=x+1;break}else D("string");for(m=s;r.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);c=["string",r.slice(x,s+1),x,s],x=s;break}case 64:{ai.lastIndex=x+1,ai.test(r),ai.lastIndex===0?s=r.length-1:s=ai.lastIndex-2,c=["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(o=r.charCodeAt(s+1),l&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(s+=1,kc.test(r.charAt(s)))){for(;kc.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===32&&(s+=1)}c=["word",r.slice(x,s+1),x,s],x=s;break}default:{o===47&&r.charCodeAt(x+1)===42?(s=r.indexOf("*/",x+2)+1,s===0&&(i||F?s=r.length:D("comment")),c=["comment",r.slice(x,s+1),x,s],x=s):(si.lastIndex=x+1,si.test(r),si.lastIndex===0?s=r.length-1:s=si.lastIndex-2,c=["word",r.slice(x,s+1),x,s],_.push(c),x=s);break}}return x++,c}function A(C){R.push(C)}return{back:A,endOfFile:E,nextToken:S,position:M}}});var Ic=ae((PA,Dc)=>{"use strict";var Q0=Qr(),Z0=qn(),eg=jn(),tg=Jt(),Nc=ri(),ng=Fc(),Lc={empty:!0,space:!0};function rg(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}var fa=class{constructor(t){this.input=t,this.root=new tg,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 Q0;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,i,o,a=!1,l=!1,s=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.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(o=s.length-1,i=s[o];i&&i[0]==="space";)i=s[--o];i&&(n.source.end=this.getPosition(i[3]||i[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,i;for(let o=n-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let n=0,r,i,o;for(let[a,l]of t.entries()){if(i=l,o=i[0],o==="("&&(n+=1),o===")"&&(n-=1),n===0&&o===":")if(!r)this.doubleColon(i);else{if(r[0]==="word"&&r[1]==="progid")continue;return a}r=i}return!1}comment(t){let n=new Z0;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 i=r.match(/^(\\s*)([^]*\\S)(\\s*)$/);n.text=i[2],n.raws.left=i[1],n.raws.right=i[3]}}createTokenizer(){this.tokenizer=ng(this.input)}decl(t,n){let r=new eg;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||rg(t)),r.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=t.shift()[1]}r.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let a=[],l;for(;t.length&&(l=t[0][0],!(l!=="space"&&l!=="comment"));)a.push(t.shift());this.precheckMissedSemicolon(t);for(let u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),f="";for(let m=u;m>0;m--){let p=c[m][0];if(f.trim().startsWith("!")&&p!=="space")break;f=c.pop()[1]+f}f.trim().startsWith("!")&&(r.important=!0,r.raws.important=f,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=a.map(u=>u[1]).join(""),a=[]),this.raw(r,"value",a.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 Nc;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+=n.raws.ownSemicolon.length)}}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,i=!1,o=null,a=[],l=t[1].startsWith("--"),s=[],u=t;for(;u;){if(r=u[0],s.push(u),r==="("||r==="[")o||(o=u),a.push(r==="("?")":"]");else if(l&&i&&r==="{")o||(o=u),a.push("}");else if(a.length===0)if(r===";")if(i){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===":"&&(i=!0);else r===a[a.length-1]&&(a.pop(),a.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),a.length>0&&this.unclosedBracket(o),n&&i){if(!l)for(;s.length&&(u=s[s.length-1][0],!(u!=="space"&&u!=="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,i){let o,a,l=r.length,s="",u=!0,c,f;for(let m=0;m<l;m+=1)o=r[m],a=o[0],a==="space"&&m===l-1&&!i?u=!1:a==="comment"?(f=r[m-1]?r[m-1][0]:"empty",c=r[m+1]?r[m+1][0]:"empty",!Lc[f]&&!Lc[c]?s.slice(-1)===","?u=!1:s+=o[1]:u=!1):s+=o[1];if(!u){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 Nc;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 i=n;i<t.length;i++)r+=t[i][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})}};Dc.exports=fa});var ui=ae((OA,Pc)=>{"use strict";var ig=gt(),og=Yn(),ag=Ic();function li(e,t){let n=new og(e,t),r=new ag(n);try{r.parse()}catch(i){throw i}return r.root}Pc.exports=li;li.default=li;ig.registerParse(li)});var ma=ae((HA,Oc)=>{"use strict";var Qn=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){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}};Oc.exports=Qn;Qn.default=Qn});var ci=ae((GA,Hc)=>{"use strict";var sg=ma(),Zn=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 sg(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}};Hc.exports=Zn;Zn.default=Zn});var pa=ae((BA,Bc)=>{"use strict";var Gc={};Bc.exports=function(t){Gc[t]||(Gc[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))}});var ba=ae((WA,zc)=>{"use strict";var lg=gt(),ug=Zr(),cg=da(),dg=ui(),Uc=ci(),fg=Jt(),mg=Bn(),{isClean:Ke,my:pg}=Jr(),UA=pa(),hg={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},gg={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},bg={Once:!0,postcssPlugin:!0,prepare:!0},Zt=0;function er(e){return typeof e=="object"&&typeof e.then=="function"}function Vc(e){let t=!1,n=hg[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,Zt,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,Zt,n+"Exit"]:[n,n+"Exit"]}function Wc(e){let t;return e.type==="document"?t=["Document",Zt,"DocumentExit"]:e.type==="root"?t=["Root",Zt,"RootExit"]:t=Vc(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ha(e){return e[Ke]=!1,e.nodes&&e.nodes.forEach(t=>ha(t)),e}var ga={},xt=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 i;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))i=ha(n);else if(n instanceof e||n instanceof Uc)i=ha(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let o=dg;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(n,r)}catch(a){this.processed=!0,this.error=a}i&&!i[pg]&&lg.rebuild(i)}this.result=new Uc(t,i,r),this.helpers={...ga,postcss:ga,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}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(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(n,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,i])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!gg[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!bg[r])if(typeof n[r]=="object")for(let i in n[r])i==="*"?t(n,r,n[r][i]):t(n,r+"-"+i.toLowerCase(),n[r][i]);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(er(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ke];){t[Ke]=!0;let n=[Wc(t)];for(;n.length>0;){let r=this.visitTick(n);if(er(r))try{await r}catch(i){let o=n[n.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let i=t.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(t,this.helpers)}catch(i){throw this.handleError(i)}}}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 er(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=mg;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 o=new cg(n,this.result.root,this.result.opts).generate();return this.result.css=o[0],this.result.map=o[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(er(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ke];)t[Ke]=!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,i]of t){this.result.lastPlugin=r;let o;try{o=i(n,this.helpers)}catch(a){throw this.handleError(a,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(er(o))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[a,l]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.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,l;for(;l=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!l[Ke]){l[Ke]=!0,t.push(Wc(l));return}n.iterator=0,delete r.indexes[a]}let o=n.events;for(;n.eventIndex<o.length;){let a=o[n.eventIndex];if(n.eventIndex+=1,a===Zt){r.nodes&&r.nodes.length&&(r[Ke]=!0,n.iterator=r.getIterator());return}else if(this.listeners[a]){n.visitors=this.listeners[a];return}}t.pop()}walkSync(t){t[Ke]=!0;let n=Vc(t);for(let r of n)if(r===Zt)t.nodes&&t.each(i=>{i[Ke]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,t.toProxy()))return}}warnings(){return this.sync().warnings()}};xt.registerPostcss=e=>{ga=e};zc.exports=xt;xt.default=xt;fg.registerLazyResult(xt);ug.registerLazyResult(xt)});var $c=ae((zA,qc)=>{"use strict";var xg=da(),yg=ui(),vg=ci(),Sg=Bn(),VA=pa(),tr=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=yg;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 i=Sg;this.result=new vg(this._processor,void 0,this._opts),this.result.css=n;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new xg(i,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[]}};qc.exports=tr;tr.default=tr});var Kc=ae((qA,jc)=>{"use strict";var Ag=Zr(),Eg=ba(),wg=$c(),Cg=Jt(),Mt=class{constructor(t=[]){this.version="8.5.14",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 wg(this,t,n):new Eg(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};jc.exports=Mt;Mt.default=Mt;Cg.registerProcessor(Mt);Ag.registerProcessor(Mt)});var nd=ae(($A,td)=>{"use strict";var Yc=Qr(),Xc=qn(),_g=gt(),Tg=Xr(),Jc=jn(),Qc=Zr(),Rg=Ac(),kg=Yn(),Mg=ba(),Fg=ua(),Ng=Vn(),Lg=ui(),xa=Kc(),Dg=ci(),Zc=Jt(),ed=ri(),Ig=Bn(),Pg=ma();function ce(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new xa(e)}ce.plugin=function(t,n){let r=!1;function i(...a){console&&console.warn&&!r&&(r=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let l=n(...a);return l.postcssPlugin=t,l.postcssVersion=new xa().version,l}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(a,l,s){return ce([i(s)]).process(a,l)},i};ce.stringify=Ig;ce.parse=Lg;ce.fromJSON=Rg;ce.list=Fg;ce.comment=e=>new Xc(e);ce.atRule=e=>new Yc(e);ce.decl=e=>new Jc(e);ce.rule=e=>new ed(e);ce.root=e=>new Zc(e);ce.document=e=>new Qc(e);ce.CssSyntaxError=Tg;ce.Declaration=Jc;ce.Container=_g;ce.Processor=xa;ce.Document=Qc;ce.Comment=Xc;ce.Warning=Pg;ce.AtRule=Yc;ce.Result=Dg;ce.Input=kg;ce.Rule=ed;ce.Root=Zc;ce.Node=Ng;Mg.registerPostcss(ce);td.exports=ce;ce.default=ce});function Cr(){return globalThis}function L(e,t){if(typeof window>"u")return;let n=Cr(),r=n.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(i){}(n.__hfDebug||n.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var Zm=["seconds-time","rational-fps","seek-keep-playing","composition-manifest-v1","runtime-data"];function ep(e,t){let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let i=n%r;n=r,r=i}return n||1}function tp(e){let t=Number.isFinite(e)&&e>0?e:30,n=Number.isInteger(t)?1:1e6,r=Math.round(t*n),i=ep(r,n);return{numerator:r/i,denominator:n/i}}function Ji(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 _r(e){return{protocolVersion:1,capabilities:Zm,fps:tp(e)}}function np(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function Hs(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=Ji(n.fps);return r===null||!np(n.capabilities)?{status:"unsupported",code:"invalid_protocol_metadata",receivedVersion:n.protocolVersion}:{status:"supported",fps:r,metadata:n}}var Gs=30;function Bs(e){Gs=Number.isFinite(e)&&e>0?e:30}function be(e){try{window.parent.postMessage({...e,..._r(Gs)},"*")}catch(t){L("bridge.postMessage",t)}}var rp={play:(e,t)=>t.onPlay(),pause:(e,t)=>t.onPause(),"stop-media":(e,t)=>t.onStopMedia(),seek:(e,t)=>t.onSeek(ip(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-root-duration":(e,t)=>t.onSetRootDuration(Number(e.durationSeconds??0)),"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=>ap(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 ip(e,t){let n=Number(e.timeSeconds);if(Number.isFinite(n))return Math.max(0,n);let i=Ji(e.fps)??t.getCanonicalFps();return Math.max(0,Number(e.frame??0))/i}function op(e){let t=Hs(e);return t.status!=="unsupported"?!1:(be({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 ap(e){let t=e.selectors,n=e.duration||800;t&&sp(t,n)}function Us(e){let t=n=>{let r=n.data;if(!r||r.source!=="hf-parent"||r.type!=="control"||op(r))return;let i=r.action;if(typeof i!="string")return;let o=rp[i];o&&o(r,e)};return window.addEventListener("message",t),be({source:"hf-preview",type:"ready"}),t}function sp(e,t){if(!document.getElementById("__hf-flash-styles")){let n=document.createElement("style");n.id="__hf-flash-styles",n.textContent=`\n .__hf-flash {\n outline: 2px solid rgba(59, 130, 246, 0.6) !important;\n outline-offset: 2px !important;\n animation: __hf-flash-pulse ${t}ms ease-out forwards !important;\n }\n @keyframes __hf-flash-pulse {\n 0% { outline-color: rgba(59, 130, 246, 0.8); }\n 100% { outline-color: transparent; }\n }\n `,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(i=>{i.classList.add("__hf-flash"),setTimeout(()=>i.classList.remove("__hf-flash"),t)})}catch(r){L("bridge.flashElements.querySelector",r)}}var Qi=null;function Ws(e){Qi=e}function Ne(e,t){if(Qi)try{Qi({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){L("runtime.analytics.site1",n)}}function lp(e){let t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-"),n=0,r=t.length;for(;n<r&&t[n]==="-";)n++;for(;r>n&&t[r-1]==="-";)r--;let i=t.slice(n,r);return i.length>0?i:"node"}function Pt(e){return`--${lp(e)}`}function Vs(e){let t=new Map;for(let n of e){let r=Pt(n),i=t.get(r);i?i.includes(n)||i.push(n):t.set(r,[n])}return[...t.values()].filter(n=>n.length>1)}function qs(){if(typeof document>"u")return{};let e=new Set;document.documentElement?.hasAttribute("data-composition-variables")&&e.add(document.documentElement);for(let i of Array.from(document.querySelectorAll("[data-composition-variables]")))e.add(i);let t={};for(let i of e)Object.assign(t,bn(i));let n=Rr(),r={...t,...n};for(let i of e)eo(i,r);return r}var zs=new Set;function $s(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 up(e,t){return t?.trim()||e.getAttribute("data-composition-id")?.trim()||e.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()||"composition"}function cp(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 dp(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=cp(e);return r.length===0||r.some(i=>String(i)===String(n))?null:{id:e.id,value:n,allowed:r}}function eo(e,t,n){if(!e)return;let r=$s(e);if(r.length===0)return;let i=up(e,n);for(let o of r){let a=dp(o,t);if(!a)continue;let l=`${i}|${a.id}|${String(a.value)}`;if(zs.has(l))continue;zs.add(l);let s="default"in o?JSON.stringify(o.default):"the composition default";console.warn(`[hyperframes] runtime_unknown_enum_value: ${i} variable "${a.id}" got ${JSON.stringify(a.value)}, which is not a declared option (${a.allowed.join(", ")}). Rendering ${s} instead.`)}}function bn(e){let t={};for(let n of $s(e))typeof n.id!="string"||!("default"in n)||(t[n.id]=n.default);return t}var Zi="data-hf-css-vars";function Tr(e){return"style"in e&&typeof e.style?.setProperty=="function"}function to(e,t){if(!Tr(e))return;let n=[];for(let[r,i]of Object.entries(t))if(typeof i=="string"&&i!==""||typeof i=="number"){let o=Pt(r);e.style.setProperty(o,String(i)),n.push(o)}n.length>0&&e.setAttribute(Zi,n.join(" "))}function js(e,t,n){let r={};for(let[i,o]of Object.entries(t)){let a=Pt(i);((Tr(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(r[i]=o)}return r}function Ks(e){if(!Tr(e))return;let t=e.getAttribute(Zi);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(Zi)}}function Ys(e){let t=new Set;e.documentElement?.hasAttribute("data-composition-variables")&&t.add(e.documentElement);for(let i of Array.from(e.querySelectorAll("[data-composition-variables]")))t.add(i);let n=Rr(),r=[];for(let i of t)r.push(...fp(i,n,e.defaultView));for(let i of Vs(r))console.warn(`composition variables ${i.join(", ")} collapse to the same CSS property ${Pt(i[0]??"")} \\u2014 rename one to avoid cross-talk`)}function fp(e,t,n){if(!Tr(e))return[];let r=bn(e),i={};for(let[o,a]of Object.entries(r)){if(o in t)continue;let l=Pt(o);(e.style.getPropertyValue(l)||(n?n.getComputedStyle(e).getPropertyValue(l):"")).trim()===""&&(i[o]=a)}for(let[o,a]of Object.entries(t))o in r&&(i[o]=a);return to(e,i),Object.keys(r)}function Xs(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 Rr(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}function Js(e){let t=[],n=u=>{if(typeof u.getAnimations!="function")return[];try{return u.getAnimations()}catch{return[]}},r=u=>e?.resolveStartSeconds?e.resolveStartSeconds(u):Number.parseFloat(u.getAttribute("data-start")??"0")||0,i=(u,c)=>{let f=null;try{f=u.effect?.getComputedTiming?.()??null}catch(p){L("runtime.adapters.css.site5",p)}if(!f)return{};let m=Number(f.endTime);return Number.isFinite(m)?{endSeconds:c+m/1e3}:{unbounded:!0}},o=(u,c)=>{for(let f of u){try{f.currentTime=c}catch(m){L("runtime.adapters.css.site1",m)}try{f.pause()}catch(m){L("runtime.adapters.css.site2",m)}}},a=u=>{for(let c of u)try{c.play()}catch(f){L("runtime.adapters.css.site3",f)}},l=u=>{for(let c of u)try{c.pause()}catch(f){L("runtime.adapters.css.site4",f)}},s=u=>{u.baseDelay?u.el.style.animationDelay=u.baseDelay:u.el.style.removeProperty("animation-delay"),u.basePlayState?u.el.style.animationPlayState=u.basePlayState:u.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{t=[];let u=document.querySelectorAll("*");for(let c of u){if(!(c instanceof HTMLElement))continue;let f=window.getComputedStyle(c);!f.animationName||f.animationName==="none"||t.push({el:c,baseDelay:c.style.animationDelay||"",basePlayState:c.style.animationPlayState||"",animations:n(c)})}},getInferredDurationSeconds:()=>{let u=0;for(let c of t){if(!c.el.isConnected)continue;let f=r(c.el);for(let m of n(c.el)){let p=i(m,f);p.endSeconds!=null&&(u=Math.max(u,p.endSeconds))}}return u>0?u:null},seek:u=>{let c=Number(u.time)||0;for(let f of t){if(!f.el.isConnected)continue;let m=r(f.el),p=Math.max(0,c-m)*1e3,b=f.animations;if(b.length>0){o(b,p);continue}f.el.style.animationPlayState="paused",f.el.style.animationDelay=`-${(p/1e3).toFixed(3)}s`}},pause:()=>{for(let u of t){if(!u.el.isConnected)continue;let c=u.animations;c.length>0&&l(c),s(u)}},play:()=>{for(let u of t)u.el.isConnected&&(s(u),a(u.animations))},revert:()=>{t=[]}}}function Qs(e){return{name:"gsap",discover:()=>{},seek:t=>{let n=e.getTimeline();if(!n)return;n.pause();let r=Math.max(0,Number(t.time)||0),i=t.suppressEvents===!0;typeof n.totalTime=="function"?(n.totalTime(r+.001,!0),n.totalTime(r,i)):n.seek(r,i)},pause:()=>{let t=e.getTimeline();t&&t.pause()}}}function Zs(){return{name:"animejs",discover:()=>{try{let e=window.anime;if(!e||typeof e.running>"u")return;let t=e.running;if(!Array.isArray(t)||t.length===0)return;let n=window.__hfAnime??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfAnime=n}catch(e){L("runtime.adapters.animejs.site1",e)}},seek:e=>{let t=Math.max(0,(Number(e.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let r of n)try{typeof r.seek=="function"&&r.seek(t)}catch(i){L("runtime.adapters.animejs.site2",i)}},pause:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.pause=="function"&&t.pause()}catch(n){L("runtime.adapters.animejs.site3",n)}},play:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.play=="function"&&t.play()}catch(n){L("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function tl(){return{name:"lottie",discover:()=>{try{let e=window.lottie;if(e&&typeof e.getRegisteredAnimations=="function"){let t=e.getRegisteredAnimations();if(Array.isArray(t)&&t.length>0){let n=window.__hfLottie??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfLottie=n}}}catch(e){L("runtime.adapters.lottie.site1",e)}},seek:e=>{let t=Math.max(0,Number(e.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let r of n)try{if(no(r))r.goToAndStop(t*1e3,!1);else if(ro(r)){if(typeof r.setCurrentRawFrameValue=="function"){let i=r.totalFrames??0,o=r.frameRate??30,a=t*o;i>0&&r.setCurrentRawFrameValue(Math.min(a,i-1))}else if(typeof r.seek=="function"){let i=r.duration??1,o=Math.min(100,t/i*100);r.seek(o)}}}catch(i){L("runtime.adapters.lottie.site2",i)}},pause:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let t of e)try{(no(t)||ro(t))&&t.pause()}catch(n){L("runtime.adapters.lottie.site3",n)}},revert:()=>{},getInferredDurationSeconds:()=>{let e=window.__hfLottie;if(!e||e.length===0)return null;let t=0,n=!1;for(let r of e){let i=null;try{i=mp(r)}catch(o){L("runtime.adapters.lottie.site4",o)}i!=null&&(n=!0,t=Math.max(t,i))}return n?t:null}}}function el(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function mp(e){return no(e)?el(e.totalFrames,e.frameRate):ro(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:el(e.totalFrames,e.frameRate):null}function no(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function ro(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}var io=-1,kr=new Set,Ot,oo=0;function nl(e){let t=[],n=!0,r={time:e,waitUntil:o=>{if(!n)throw new Error("hf-seek waitUntil() must be called synchronously from the event listener");t.push(o)}};try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:r}))}catch(o){L("runtime.adapters.seek-dispatch.site1",o)}finally{n=!1}if(t.length===0)return;let i=Promise.all(t).then(()=>({status:"fulfilled"})).catch(o=>({status:"rejected",reason:o}));kr.add(i),i.then(o=>{kr.delete(i)&&o.status==="rejected"&&Ot===void 0&&(Ot={reason:o.reason})})}function Mr(e){e!==io&&(io=e,nl(e))}function Fr(e){io=e,nl(e)}function rl(){return oo>0}async function ao(){oo+=1;let e=Ot;try{for(await Promise.resolve();kr.size>0;){let r=(await Promise.all([...kr])).find(i=>i.status==="rejected");e===void 0&&r?.status==="rejected"&&(e={reason:r.reason})}let t=Ot;if(e===void 0&&(e=t),Ot===t&&(Ot=void 0),e)throw e.reason}finally{oo-=1}}function il(){let e=null,t=0,n=null,r=null,i=null,o=null,a=()=>{if(typeof window>"u")return null;let c=window.THREE?.DefaultLoadingManager;return!c||typeof c!="object"||typeof c.itemsLoaded!="number"||typeof c.itemsTotal!="number"?null:c},l=u=>{o||u.itemsTotal<=u.itemsLoaded||(o=new Promise(c=>{u.onLoad=function(){try{i?.call(this)}finally{o=null,u.onLoad=i??null,c()}}}))},s=u=>{n!==u&&(n=u,r=u.onStart??null,i=u.onLoad??null,u.onStart=function(c,f,m){try{r?.call(this,c,f,m)}finally{l(u)}})};return{name:"three",discover:()=>{let u=a();u&&(s(u),l(u))},seek:u=>{e=Math.max(0,Number(u.time)||0),t=e,window.__hfThreeTime=e,Mr(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0},getReadyPromise:()=>{let u=a();return!u||u.itemsTotal<=u.itemsLoaded?null:(o||l(u),o)}}}function qe(e){let t=null,n=new WeakSet;return{name:e.name,discover:()=>{},seek:()=>{},pause:()=>{},play:()=>{},revert:()=>{},getReadyPromise:()=>{let r=e.getInstances();if(r.length===0)return null;let i=r.filter(o=>!n.has(o));return i.length===0?null:t||(t=Promise.allSettled(i.map(o=>e.waitFor(o).then(()=>{n.add(o)}))).then(()=>{t=null}),t)}}}function ol(){return qe({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 al(){return qe({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 sl(){return qe({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 ll(){return qe({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 ul(){return qe({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}var pp=250;function cl(){let e=null,t=0,n=null,r=()=>{n!==null&&(window.clearInterval(n),n=null)},i=()=>{n===null&&document.querySelector("[data-composition-id][data-requires-webgpu]")&&(n=window.setInterval(()=>{e!==null&&(rl()||(window.__hfTypegpuTime=e,Fr(e)))},pp))};return{name:"typegpu",discover:()=>{},seek:o=>{e=Math.max(0,Number(o.time)||0),t=e,window.__hfTypegpuTime=e,Mr(e)},pause:()=>{e==null&&(e=Math.max(0,t)),i()},play:()=>{r(),e=null},revert:()=>{r(),e=null,t=0}}}var xn="data-hf-render-id",dl="data-hf-group-render-id";function hp(e){return e.getAttribute(xn)||e.id||null}var gp="__render_frame_",bp="__";function xp(e){return`${gp}${e}${bp}`}function yp(e){let t=hp(e);return t?xp(t):null}function ut(e){let t=yp(e);if(!t)return null;let n=document.getElementById(t);return n instanceof HTMLImageElement?n:null}function fl(e){let t=e.nextElementSibling;if(t instanceof HTMLImageElement&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;let n=ut(e);return n&&n.complete&&n.naturalWidth>0?n:null}function ml(){let e=globalThis.GPUQueue;if(!e?.prototype?.copyExternalImageToTexture)return;let t=e.prototype.copyExternalImageToTexture;e.prototype.copyExternalImageToTexture=function(n,r,i){if(n?.source instanceof HTMLVideoElement){let o=fl(n.source);if(o)return t.call(this,{...n,source:o},r,i)}return t.call(this,n,r,i)}}function pl(){let e=[globalThis.WebGL2RenderingContext,globalThis.WebGLRenderingContext],t=["texImage2D","texSubImage2D"];for(let n of e){let r=n?.prototype;if(r)for(let i of t){let o=r[i];if(typeof o!="function"||o.__hfVideoPatched)continue;let a=function(...l){let s=l.length-1,u=l[s];if(u instanceof HTMLVideoElement){let c=fl(u);c&&(l[s]=c)}return o.apply(this,l)};a.__hfVideoPatched=!0,r[i]=a}}}function hl(){let e=!1,t=0,n=!1,r,i,o,a=new Set,l=new WeakMap,s=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},u=x=>{let _=Number(x.currentTime);return Number.isFinite(_)&&_>0?_:0},c=(x,_)=>_<=0?x:x>=_?Math.max(0,x-_):x,f=(x,_)=>{let R=l.get(x);if(R)return R;let T={compositionTimeMs:_,animationTimeMs:e?c(u(x),_):u(x)};return l.set(x,T),T},m=(x,_)=>{if(!a.has(x)){a.add(x);let R=()=>{a.delete(x)};try{x.addEventListener("finish",R,{once:!0}),x.addEventListener("cancel",R,{once:!0})}catch(T){L("runtime.adapters.waapi.site4",T)}}f(x,_)},p=(x,_)=>{for(let R of x)m(R,_)},b=()=>{if(n||typeof Element>"u")return;let x=Element.prototype;if(typeof x.animate!="function"||x.__hfOriginalAnimate)return;let _=x.animate;try{Object.defineProperty(x,"__hfOriginalAnimate",{value:_,configurable:!0});let R=function(...T){let M=_.apply(this,T);return m(M,t),M};x.animate=R,r=x,i=_,o=R,n=!0}catch{}},v=x=>{let _=null;try{_=x.effect?.getComputedTiming?.()??null}catch(M){L("runtime.adapters.waapi.site4",M)}if(!_)return{};let R=Number(_.endTime);return Number.isFinite(R)?{endSeconds:(l.get(x)?.compositionTimeMs??0)/1e3+R/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,b(),p(s(),t)},seek:x=>{let _=Math.max(0,(Number(x.time)||0)*1e3);t=_,(!e||a.size>0)&&p(s(),e?_:0);for(let R of a){let T=e?f(R,_):f(R,0),M=T.animationTimeMs+Math.max(0,_-T.compositionTimeMs);try{R.currentTime=M}catch(D){L("runtime.adapters.waapi.site1",D)}try{R.pause()}catch(D){L("runtime.adapters.waapi.site2",D)}}},pause:()=>{e||p(s(),t);for(let x of a)try{x.pause()}catch(_){L("runtime.adapters.waapi.site3",_)}},revert:()=>{if(a.clear(),l=new WeakMap,e=!1,t=0,r&&i&&o&&r.animate===o)try{r.animate=i,r.__hfOriginalAnimate===i&&delete r.__hfOriginalAnimate}catch(x){L("runtime.adapters.waapi.site5",x)}r=void 0,i=void 0,o=void 0,n=!1},getInferredDurationSeconds:()=>{let x=0;for(let _ of s()){let R=v(_);R.endSeconds!=null&&(x=Math.max(x,R.endSeconds))}return x>0?x:null}}}var so=3.981071705534972;function Le(e){return Number.isFinite(e)?Math.max(0,Math.min(so,e)):1}function Nr(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function gl(e,t){let n=typeof HTMLMediaElement>"u"?void 0:Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"volume"),r=n?.get,i=n?.set;if(!r||!i)return t();let o=Number(r.call(e));Object.defineProperty(e,"volume",{configurable:!0,get:()=>o,set:a=>{o=Number(a),i.call(e,Nr(o))}});try{return t()}finally{delete e.volume,i.call(e,Nr(o))}}var Ht=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),yv=Object.freeze([Ht.start,Ht.duration,Ht.trackIndex]),vv=Object.freeze([Ht.derivedEnd]),Sv=Object.freeze([Ht.derivedEnd,Ht.legacyTrack]);function Gt(e){if(e==null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}var xl=/^[A-Za-z0-9_.:-]+$/;function yl(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function bl(e,t){let n=t;for(;n>=0&&yl(e,n);)n--;return n}function vp(e,t){let n=t;for(;n>=0&&(e[n]??"").trim()==="";)n--;return n}function Sp(e){let t=e.length-1;if(!yl(e,t))return null;let n=bl(e,t);return e[n]==="."&&(n=bl(e,n-1)),n+1}function Ap(e){let t=Sp(e);if(t==null)return null;let n=vp(e,t-1),r=e[n];if(r!=="+"&&r!=="-")return null;let i=e.slice(0,n).trim();if(!xl.test(i))return null;let o=Number(e.slice(t));return Number.isFinite(o)?{refId:i,operator:r,magnitude:o}:null}function lo(e){let t=(e??"").trim();if(!t)return null;let n=Gt(t);if(n!=null)return{kind:"absolute",value:n};if(xl.test(t))return{kind:"reference",refId:t,offset:0};let r=Ap(t);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}function vl(e){return Number.isFinite(e)&&e>0?Math.max(.1,Math.min(5,e)):1}function ve(e){return Gt(e)}function _e(e){let t=Number.parseFloat(e.getAttribute("data-playback-rate")??""),n=Number.isFinite(t)&&t>0?t:typeof HTMLMediaElement<"u"&&e instanceof HTMLMediaElement?e.defaultPlaybackRate:1;return vl(n)}function yn(e){let t=n=>{let r=ve(n);return r==null?null:Number.isFinite(r)&&r>=0?r:null};return t(e.getAttribute("data-playback-start"))??t(e.getAttribute("data-media-start"))??0}function Qe(e,t){return Ep(t,yn(e),_e(e))}function Ep(e,t,n){return Number.isFinite(e)?Math.max(0,e-t)/vl(n):null}function wp(e,t,n){let r=e.filter(o=>Number.isFinite(o.time)&&Number.isFinite(o.volume)).map(o=>({time:Math.max(0,o.time-t),volume:Le(o.volume)})).sort((o,a)=>o.time-a.time),i=[];for(let o of r){let a=i.at(-1);a&&Math.abs(a.time-o.time)<1e-9?a.volume=o.volume:i.push(o)}return i.length===0||i[0].time>0&&i.unshift({time:0,volume:Le(n)}),i}function Sl(e,t){if(e.length===0)return 1;let n=0;for(;n<e.length-2&&t>=e[n+1].time;)n+=1;let r=e[n],i=e[n+1]??r,o=i.time-r.time,a=o<=0?0:Math.min(1,Math.max(0,(t-r.time)/o));return r.volume+(i.volume-r.volume)*a}function Cp(e,t,n,r){let i=e.at(-1);!i||Math.abs(i.volume-n.volume)>1e-4?(i&&t&&t.time>i.time&&e.push(t),e.push(n)):r&&n.time>i.time&&e.push(n)}function _p(e){let t=Number.parseFloat(e??"");return Number.isFinite(t)?t:void 0}function Al(e,t){let n=ve(e.dataset.start)??0,r=ve(e.dataset.end)??void 0,i=ve(e.dataset.duration)??void 0,o=t;i!==void 0&&i>0?o=n+i:r!==void 0&&r>n&&(o=r);let a=_p(e.dataset.volume)??1;return{start:n,end:o,staticVolume:Le(a)}}function Tp(e,t,n,r){let{start:i,end:o,staticVolume:a}=Al(e,n),l=1/Math.min(60,Math.max(1,r)),s=Math.max(0,i),u=Math.min(n,o),c=gl(e,()=>{e.volume=a;let m=[],p;for(let b=s;b<=u+1e-6;b=Math.min(u,b+l)){t(b);let v=Number(e.volume);if(Number.isFinite(v)){let x={time:Number(b.toFixed(6)),volume:Number(Le(v).toFixed(6))};Cp(m,p,x,b===u),p=x}if(b===u)break}return m});return c.some(m=>Math.abs(m.volume-a)>1e-4)?c:null}function El(e,t,n,r,i={}){if(i.allowLiveTimelineSeek===!1||!t||!(e instanceof HTMLAudioElement)&&!(e instanceof HTMLVideoElement)||n<=0)return;let o=s=>{try{typeof t.totalTime=="function"?t.totalTime(s,!0):typeof t.seek=="function"&&t.seek(s,!0)}catch{}},a=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,l=Tp(e,o,n,60);if(Number.isFinite(a)&&o(a),l){let{start:s,staticVolume:u}=Al(e,n),c=wp(l,s,u);c.length>0&&r.set(e,c)}}var Tt="data-fx-chain",Fv=Tt.slice(5),wl=1,vn=(e="frequency",t="Frequency",n=1e3,r=20,i=2e4)=>({kind:"number",key:e,label:t,unit:"Hz",min:r,max:i,step:1,default:n,scale:"log",automatable:!0}),uo=(e=.707,t="Bandwidth \\u2014 higher is narrower.")=>({kind:"number",key:"q",label:"Q",unit:"",min:.1,max:20,step:.01,default:e,scale:"log",automatable:!0,hint:t}),Lr=(e=-40,t=40,n=0)=>({kind:"number",key:"gain",label:"Gain",unit:"dB",min:e,max:t,step:.1,default:n,automatable:!0}),Cl={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."},Tl=[{id:"gain",label:"Gain",group:"dynamics",description:"Raise or lower the whole signal. Automate it to duck under something else.",params:[Lr(-60,12,0)],web:"gain-node"},{id:"peaking",label:"Peaking EQ",group:"filter",description:"Boost or cut a band, leaving everything either side alone.",params:[vn("frequency","Frequency",1e3),Lr(-40,40,0),uo(1)],web:"biquad-peaking"},{id:"lowshelf",label:"Low Shelf",group:"filter",description:"Lift or drop everything below the corner frequency.",params:[vn("frequency","Frequency",200,20,2e3),Lr(-40,40,0)],web:"biquad-lowshelf"},{id:"highshelf",label:"High Shelf",group:"filter",description:"Lift or drop everything above the corner frequency.",params:[vn("frequency","Frequency",4e3,500,2e4),Lr(-40,40,0)],web:"biquad-highshelf"},{id:"highpass",label:"High-pass",group:"filter",description:"Remove low frequencies \\u2014 the usual fix for rumble on a voice.",params:[vn("frequency","Cutoff",300,20,2e4),uo(.707),Cl],web:"biquad-highpass"},{id:"lowpass",label:"Low-pass",group:"filter",description:"Remove high frequencies \\u2014 darkens or muffles a track.",params:[vn("frequency","Cutoff",8e3,100,2e4),uo(.707),Cl],web:"biquad-lowpass"},{id:"compressor",label:"Compressor",group:"dynamics",description:"Pull loud parts down so the quiet ones can come up.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-60,max:0,step:.5,default:-24,hint:"Level above which the compressor starts working."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:4},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:2e3,step:.1,default:20,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:250,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83,hint:"1 is a hard corner; higher eases into it."},{kind:"number",key:"makeup",label:"Makeup",unit:"dB",min:0,max:36,step:.1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1,hint:"Below 1 blends the dry signal back in."}],web:"worklet-compressor"},{id:"limiter",label:"Limiter",group:"dynamics",description:"Hard ceiling \\u2014 nothing gets past the limit.",params:[{kind:"number",key:"limit",label:"Ceiling",unit:"dB",min:-24,max:0,step:.1,default:-1},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.1,max:80,step:.1,default:5},{kind:"number",key:"release",label:"Release",unit:"ms",min:1,max:8e3,step:1,default:50,scale:"log"},{kind:"number",key:"level_out",label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0}],web:"worklet-limiter"},{id:"gate",label:"Noise Gate",group:"dynamics",description:"Silence the track when it drops below the threshold.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-80,max:0,step:.5,default:-35},{kind:"number",key:"range",label:"Range",unit:"dB",min:-80,max:0,step:.5,default:-24,hint:"How far down the gate pulls when closed."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:10},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:9e3,step:.1,default:1,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:100,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83}],web:"worklet-gate"},{id:"saturate",label:"Saturation",group:"nonlinear",description:"Soft-clip the waveform for warmth or outright distortion.",params:[{kind:"enum",key:"type",label:"Curve",options:[{value:"tanh",label:"Tanh"},{value:"atan",label:"Arctan"},{value:"cubic",label:"Cubic"},{value:"exp",label:"Exponential"},{value:"alg",label:"Algebraic"},{value:"quintic",label:"Quintic"},{value:"sin",label:"Sine"},{value:"erf",label:"Error function"},{value:"hard",label:"Hard clip"}],default:"tanh"},{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-40,max:0,step:.1,default:-6},{kind:"number",key:"output",automatable:!0,label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0},{kind:"number",key:"oversample",label:"Oversample",unit:"x",min:1,max:8,step:1,default:4,hint:"Higher costs more but keeps aliasing down."}],web:"waveshaper"},{id:"bitcrush",label:"Bitcrush",group:"nonlinear",description:"Drop bit depth and sample rate for a lo-fi, digital sound.",params:[{kind:"number",key:"bits",label:"Bit depth",unit:"bit",min:1,max:32,step:.1,default:8},{kind:"number",key:"samples",label:"Sample hold",unit:"x",min:1,max:250,step:1,default:1,hint:"Repeats each sample N times \\u2014 a crude downsample."},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-bitcrush"},{id:"pitchshift",label:"Pitch shift",group:"time",description:"Shifts pitch up or down without changing playback speed. Adds ~50 ms of latency.",params:[{kind:"number",key:"semitones",label:"Semitones",unit:"st",min:-12,max:12,step:1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-pitchshift"},{id:"delay",label:"Delay",group:"time",description:"Repeating echoes behind the dry signal.",params:[{kind:"number",key:"time",automatable:!0,label:"Time",unit:"ms",min:1,max:5e3,step:1,default:250,scale:"log"},{kind:"number",key:"feedback",automatable:!0,label:"Feedback",unit:"",min:.01,max:.95,step:.01,default:.35},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.4}],web:"delay-feedback"},{id:"chorus",label:"Chorus",group:"time",description:"Detuned copies of the signal for width and thickness.",params:[{kind:"number",key:"delay",automatable:!0,label:"Delay",unit:"ms",min:1,max:100,step:.1,default:7},{kind:"number",key:"depth",automatable:!0,label:"Depth",unit:"ms",min:0,max:10,step:.01,default:2},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.01,max:10,step:.01,default:1},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.5}],web:"chorus-lfo"},{id:"phaser",label:"Phaser",group:"time",description:"Sweeping notches moving through the spectrum.",params:[{kind:"number",key:"in_gain",automatable:!0,label:"Input",unit:"",min:0,max:1,step:.01,default:.4},{kind:"number",key:"out_gain",automatable:!0,label:"Output",unit:"",min:0,max:2,step:.01,default:.74},{kind:"number",key:"delay",label:"Delay",unit:"ms",min:.1,max:5,step:.1,default:3},{kind:"number",key:"decay",label:"Decay",unit:"",min:0,max:.99,step:.01,default:.4},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.1,max:2,step:.01,default:.5},{kind:"enum",key:"type",label:"Waveform",options:[{value:"0",label:"Triangular"},{value:"1",label:"Sinusoidal"}],default:"0"}],web:"allpass-phaser"},{id:"reverb",label:"Reverb",group:"time",description:"Room tail. Both ends convolve the same generated impulse, so preview matches render.",params:[{kind:"number",key:"size",label:"Room size",unit:"",min:.05,max:1,step:.01,default:.7},{kind:"number",key:"damping",label:"Damping",unit:"",min:0,max:1,step:.01,default:.5,hint:"Higher rolls the top off the tail faster."},{kind:"number",key:"wet",automatable:!0,label:"Wet",unit:"",min:0,max:1,step:.01,default:.35},{kind:"number",key:"dry",automatable:!0,label:"Dry",unit:"",min:0,max:1,step:.01,default:.7}],web:"convolver"}],co=new Map(Tl.map(e=>[e.id,e]));function Sn(e){return co.get(e)}var Nv=Tl.map(e=>e.id);function An(e,t){let n=co.get(e);if(!n)return{};let r={};for(let i of n.params){let o=t?.[i.key];if(i.kind==="enum"){let l=i.options.some(s=>s.value===o);r[i.key]=l?o:i.default;continue}let a=typeof o=="number"?o:typeof o=="string"&&o.trim()!==""?Number(o):Number.NaN;r[i.key]=Number.isFinite(a)?Math.min(i.max,Math.max(i.min,a)):i.default}return r}var ct=class extends Error{constructor(t){super(t),this.name="AudioFxChainError"}};function Rl(e){let t;try{t=JSON.parse(e)}catch(i){throw new ct(`Chain file is not valid JSON: ${i.message}`)}if(typeof t!="object"||t===null)throw new ct("Chain file must be a JSON object.");let n=t;if(n.version!==wl)throw new ct(`Unsupported chain version: ${String(n.version)}`);if(!Array.isArray(n.nodes))throw new ct("Chain file is missing a `nodes` array.");let r=n.nodes.map(Rp);return{version:wl,nodes:r}}function En(e){return e.nodes.filter(t=>t.enabled!==!1)}function Rp(e,t){if(typeof e!="object"||e===null)throw new ct(`Node ${t} is not an object.`);let n=e;if(typeof n.type!="string"||!co.has(n.type))throw new ct(`Node ${t} has unknown effect type: ${String(n.type)}`);return Mp({type:n.type,id:Dr(n.id),fromCarve:_l(n.fromCarve),fromPreset:Dr(n.fromPreset),label:Dr(n.label),fromEq:Dr(n.fromEq),fromLeveller:_l(n.fromLeveller),presetAmount:kp(n.presetAmount),enabled:n.enabled!==!1,params:An(n.type,n.params??void 0)})}function Dr(e){return typeof e=="string"&&e?e:void 0}function _l(e){return e===!0?!0:void 0}function kp(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(1,Math.max(0,e))}function Mp(e){for(let t of Object.keys(e))e[t]===void 0&&delete e[t];return e}var et="data-automation",Pv=et.slice(5),Ir=1,Fp=512,Ze=class extends Error{constructor(t){super(t),this.name="AudioAutomationError"}},Bt="volume";function Cn(e){if(e===Bt)return{kind:"volume"};let t=e.split(".");if(t.length===3&&t[0]==="fx"&&t[1]===Np){let i=t[2];return i?{kind:"preset",presetId:i}:null}if(t.length!==3||t[0]!=="fx")return null;let[,n,r]=t;return!n||!r?null:{kind:"fx",nodeId:n,param:r}}var Np="preset";var Lp={min:0,max:1,step:.01,unit:"",label:"Amount",scale:"linear",default:1},Pr={min:0,max:so,step:.01,unit:"",label:"Volume",scale:"linear",default:1};function fo(e,t){let n=Cn(e);if(!n)return null;if(n.kind==="volume")return Pr;if(n.kind==="preset")return t?.nodes.some(l=>l.fromPreset===n.presetId)?{...Lp,label:`${n.presetId} \\xB7 Amount`}:null;let r=t?.nodes.find(a=>a.id===n.nodeId);if(!r)return null;let i=Sn(r.type),o=i?.params.find(a=>a.key===n.param);return!o||o.kind!=="number"?null:{min:o.min,max:o.max,step:o.step,unit:o.unit,label:`${i?.label??r.type} \\xB7 ${o.label}`,scale:o.scale==="log"&&o.min>0?"log":"linear",default:o.default}}function wn(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null}function Dp(e){let t=wn(e);return t===null||t===0?0:Math.min(1,Math.max(-1,t))}function kl(e,t){let n=wn(e),r=wn(t);if(n===null||r===null)return null;let i=l=>Math.min(.999,Math.max(.001,l)),o=i(n),a=i(r);return Math.abs(o-a)<1e-6?null:{x:o,y:a}}function Ip(e){let t=Dp(e?.curve),n=kl(e?.viaX,e?.viaY);return{...t?{curve:t}:{},...n?{viaX:n.x,viaY:n.y}:{}}}function Pp(e,t){let n=wn(e?.t),r=wn(e?.v);if(n===null||r===null)return null;let i=t?Math.min(t.max,Math.max(t.min,r)):r;return{t:Math.max(0,n),v:i,...Ip(e)}}function Ml(e,t){let n=e.map(i=>Pp(i,t)).filter(i=>i!==null).sort((i,o)=>i.t-o.t),r=[];for(let i of n)r.length>0&&r[r.length-1].t===i.t?r[r.length-1]=i:r.push(i);return r.slice(0,Fp)}function Op(e){let t=[];for(let n of e.lanes){if(!Cn(n.target))continue;let r=n.target===Bt?Pr:null,i=Ml(n.points??[],r);i.length>0&&t.push({target:n.target,points:i})}return{version:Ir,lanes:t}}function Fl(e,t){let n=[];for(let r of e.lanes){let i=fo(r.target,t);if(!i)continue;let o=Ml(r.points,i);o.length>0&&n.push({target:r.target,points:o})}return{version:Ir,lanes:n}}function Or(e){let t;try{t=JSON.parse(e)}catch(i){throw new Ze(`Automation is not valid JSON: ${i.message}`)}if(typeof t!="object"||t===null)throw new Ze("Automation must be a JSON object.");let n=t;if(n.version!==Ir)throw new Ze(`Unsupported automation version: ${String(n.version)}`);if(!Array.isArray(n.lanes))throw new Ze("Automation is missing a `lanes` array.");let r=n.lanes.map((i,o)=>{if(typeof i!="object"||i===null)throw new Ze(`Lane ${o} is not an object.`);let a=i;if(typeof a.target!="string"||!Cn(a.target))throw new Ze(`Lane ${o} has an unreadable target: ${String(a.target)}`);if(!Array.isArray(a.points))throw new Ze(`Lane ${o} is missing a \\`points\\` array.`);return{target:a.target,points:a.points}});return Op({version:Ir,lanes:r})}function Hp(e,t){return t?Math.pow(e,Math.pow(2,2*t)):e}function Gp(e,t){let n=e-.5,r=t-.5,i=.999,o=1e6,a=n>0?n/(i-e):n<0?-n/(e-(1-i)):0,l=r>0?r/(i-t):r<0?-r/(t-(1-i)):0,s=Math.min(o,Math.max(1,a,l));return{cx:e+n/s,cy:t+r/s,w:s}}function Bp(e,t,n){let{cx:r,cy:i,w:o}=Gp(t,n),a=2-2*o,l=e*a-1+2*o*r,s=-e*a-2*o*r,u=Up(l,s,e),c=1-u,f=c*c+2*o*u*c+u*u;return f>0?(2*o*i*u*c+u*u)/f:e}function Up(e,t,n){if(Math.abs(e)<1e-12)return Math.abs(t)<1e-12?n:-n/t;let r=Math.sqrt(Math.max(0,t*t-4*e*n)),i=(-t+r)/(2*e),o=(-t-r)/(2*e),a=l=>l>=-1e-9&&l<=1+1e-9;return a(i)?Math.min(1,Math.max(0,i)):a(o)?Math.min(1,Math.max(0,o)):n}function Wp(e,t){let n=kl(t.viaX,t.viaY);return n?Bp(Math.min(1,Math.max(0,e)),n.x,n.y):Hp(e,t.curve)}function Vp(e,t,n,r){return r==="log"&&e>0&&t>0?Math.exp(Math.log(e)+(Math.log(t)-Math.log(e))*n):e+(t-e)*n}function _n(e,t,n="linear"){let r=e.points;if(r.length===0)return 0;let i=r[0];if(t<=i.t)return i.v;let o=r[r.length-1];if(t>=o.t)return o.v;let a=0,l=r.length-1;for(;l-a>1;){let f=a+l>>1;r[f].t<=t?a=f:l=f}let s=r[a],u=r[l],c=u.t-s.t;return c<=0?u.v:Vp(s.v,u.v,Wp((t-s.t)/c,s),n)}function Nl(e){return e.points.length<=1||e.points.every(t=>t.v===e.points[0].v)}function Ll(e,t,n,r,i="linear"){let o=Math.max(2,Math.floor(r)),a=new Float32Array(o),l=n-t;for(let s=0;s<o;s+=1)a[s]=_n(e,t+l*s/(o-1),i);return a}var Hr=new Map,zp=64;function qp(e){let t=Hr.get(e);if(t!==void 0)return t;let n=null;try{n=Or(e).lanes.find(r=>r.target===Bt)??null}catch{n=null}return Hr.size>zp&&Hr.clear(),Hr.set(e,n),n}function Dl(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(et):null)??"";if(!n)return null;let r=qp(n);return!r||r.points.length===0?null:_n(r,t)}var Ut="hf-audio-group",Gr="data-audio-group";function mo(e){let t=e?.getAttribute("data-volume"),n=t?parseFloat(t):1;return Number.isFinite(n)?n:1}function po(e,t){let n=Array.from(e?.querySelectorAll?.(`${Ut}[${xn}]`)??[]).find(i=>i.getAttribute(xn)===t);if(n)return n;let r=e?.getElementById(t)??null;return r&&r.tagName?.toLowerCase()===Ut?r:null}function Br(e,t){let n=t?.getAttribute?.(dl)??t?.getAttribute?.(Gr);return n?po(e,n)?.hasAttribute("data-hidden")??!1:!1}function Il(e){return typeof e.tagName!="string"||e.tagName.toLowerCase()!=="audio"||typeof e.getAttribute!="function"?null:e.getAttribute(Gr)||null}function Pl(e){let t="__hf-audio-group-inert";if(!e?.head||e.getElementById(t))return;let n=e.createElement("style");n.id=t,n.textContent=`${Ut}{display:none!important}`,e.head.appendChild(n)}function $e(e){return yn(e)}function Ol(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 Hl(e){let t=Array.from(document.querySelectorAll("video, audio")),n=e?.shouldIncludeElement?t.filter(a=>e.shouldIncludeElement?.(a)):t.filter(a=>a.hasAttribute("data-start")),r=[],i=[],o=0;for(let a of n){let l=e?.resolveStartSeconds?e.resolveStartSeconds(a):Number.parseFloat(a.dataset.start??"0");if(!Number.isFinite(l))continue;let s=$e(a),u=_e(a),c=a.loop,f=Number.isFinite(a.duration)&&a.duration>0?a.duration:null,m=e?.resolveDurationSeconds?.(a)??Number.parseFloat(a.dataset.duration??"");(!Number.isFinite(m)||m<0)&&f!=null&&(m=Math.max(0,(f-s)/u));let p=Number.isFinite(m)&&m>=0,b=p?l+m:Number.POSITIVE_INFINITY,v=Number.parseFloat(a.dataset.volume??""),x={el:a,start:l,mediaStart:s,duration:p?m:Number.POSITIVE_INFINITY,end:b,volume:Number.isFinite(v)?v:null,playbackRate:u,loop:c,sourceDuration:f};r.push(x),a.tagName==="VIDEO"&&i.push(x),Number.isFinite(b)&&(o=Math.max(o,b))}return{timedMediaEls:n,mediaClips:r,videoClips:i,maxMediaEnd:o}}var go=new WeakMap,Ur=new WeakMap,Tn=new WeakMap,bo=new WeakSet,Wt=new WeakSet;function $p(e){if(Wt.has(e))return;Wt.add(e);let t=()=>Wt.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}var jp=3;function Kp(e){return e.error!=null||e.networkState===jp}var xo=new WeakMap;function ho(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function yo(e){go.delete(e),Ur.delete(e),Tn.delete(e),bo.delete(e),xo.delete(e)}function Gl(e){let t=!!(e.outputMuted||e.userMuted);for(let n of e.clips){let{el:r}=n;if(!r.isConnected)continue;let i=(e.timeSeconds-n.start)*n.playbackRate+n.mediaStart,o=r.tagName==="VIDEO"&&!n.loop,a=o&&n.sourceDuration!=null&&i>=n.sourceDuration&&e.timeSeconds>=n.start&&e.timeSeconds<n.end;a&&n.sourceDuration!=null&&(i=n.sourceDuration);let l=Ur.get(r),s=r.tagName==="AUDIO"&&(l===void 0||i<l-.04),u=!n.loop&&n.sourceDuration!=null&&i>=n.mediaStart&&i<n.sourceDuration&&(o||s);if(e.timeSeconds>=n.start&&e.timeSeconds<n.end&&i>=0&&(!r.ended||n.loop||a||u)){if(Ur.set(r,i),n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let H=n.sourceDuration-n.mediaStart;H>0&&i>=n.sourceDuration&&(i=n.mediaStart+(i-n.mediaStart)%H)}let m=ho(e.userVolume??1),p=Le(n.volume??1),b=xo.get(r),v=ho(r.volume),x,_=Dl(r,e.timeSeconds-n.start);if(_!==null)x=Le(_);else if(n.volumeKeyframes&&n.volumeKeyframes.length>0){let H=e.timeSeconds-n.start;x=Le(Sl(n.volumeKeyframes,H))}else e.isWebAudioRouted?.(r)?x=p:b===void 0?x=p>1?p:v:Math.abs(v-b)>1e-4?x=v:x=p;let T=r.closest("[data-hidden]")!==null||Br(r.ownerDocument,r)?0:ho(x*m);r.volume=T,xo.set(r,T),e.onElementVolume?.(r,T,x),(t||e.isWebAudioOwned?.(r))&&(r.muted=!0),r.preload!=="auto"&&(r.preload="auto");try{r.playbackRate=n.playbackRate*e.playbackRate}catch(H){L("runtime.media.site1",H)}let M=.04,D=2,E=r.currentTime||0,S=Math.abs(E-i),A=i-E,C=go.get(r);go.set(r,A);let F=C===void 0,I=!F&&Math.abs(A-C)>.5,q=S>3,W=r.tagName==="AUDIO"&&F&&E-i>M,Y=a&&S>.001||r.ended&&u&&S>.001||W||S>.5&&(F||I||q),k=r.tagName==="VIDEO"&&!r.paused,U=C!==void 0&&Math.abs(A-C)<.004,ie=!1;if(!k&&!Y&&!F&&U&&S>M){let H=(Tn.get(r)??0)+1;Tn.set(r,H),H>=D&&(ie=!0,Tn.set(r,0))}else S<=M&&Tn.set(r,0);let P=!k&&e.forceSync&&S>.02;if(Y||ie||P){if(!(r.tagName==="VIDEO"&&!!ut(r))){try{r.currentTime=i}catch(V){L("runtime.media.site2",V)}if(Math.abs(r.currentTime-i)>.5&&!bo.has(r)){bo.add(r),r.load();try{r.currentTime=i}catch(V){L("runtime.media.site3",V)}}}Wt.delete(r)}a?r.paused||r.pause():e.playing&&r.paused&&!Wt.has(r)&&!Kp(r)?($p(r),r.play().catch(H=>{Wt.delete(r),(H&&typeof H=="object"&&"name"in H?String(H.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!e.playing&&!r.paused&&r.pause();continue}let f=e.timeSeconds>=n.start&&e.timeSeconds<n.end;yo(r),f&&Ur.set(r,i),r.paused||r.pause()}}var Yp="hf-proxy",Bl="runtime_media_proxy_fallback",Ul="runtime_media_proxy_unavailable",Rn=new WeakSet,Wl=new WeakSet;function Wr(e){return e.currentSrc||e.src}function vo(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:e instanceof HTMLVideoElement&&!!ut(e)}function So(e){let t=Wr(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 Xp(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 Jp(e,t){let n=e.normalize("NFC").toLowerCase(),r=-1,i=null,o=!1;for(let[a,l]of Object.entries(t)){let s=a.normalize("NFC").toLowerCase();n.endsWith(s)&&(s.length>r?(r=s.length,i=l,o=!1):s.length===r&&(o=!0))}return o?null:i}function Ao(e,t){return t[e]??Xp(e,t)??Jp(e,t)}function Qp(e,t){let n=new URL(e,document.baseURI);return n.searchParams.set(Yp,t?t.hasAlpha?"vp8":"h264":"auto"),n.href}var Zp={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 Rt(e,t,n){if(Wl.has(e))return;Wl.add(e);let r=Zp[t];be({source:"hf-preview",type:"diagnostic",code:Ul,details:{asset:n,codecName:null,reason:t,note:r}}),console.info(`[hyperframes] ${Ul}: "${n}" (${t}): ${r}`)}function Eo(e,t=null,n="reactive"){if(Rn.has(e))return;let r=Wr(e),i;try{i=Qp(r,t)}catch(l){L("runtime.mediaProxy.swap",l),Rt(e,"invalid_source_url",r);return}Rn.add(e),yo(e),e.src=i,e.load();let o=t?.codecName??null;be({source:"hf-preview",type:"diagnostic",code:Bl,details:{asset:r,codecName:o,trigger:n,note:"render output is unaffected; only this preview element was swapped to an authoring proxy"}}),console.info(`[hyperframes] ${Bl}: "${r}" uses a codec (${o??"unknown"}) this browser can\'t decode; auto-swapped to an authoring proxy for this preview only. Render output is unaffected.`)}function Vl(e){if(vo(e)||!(e instanceof HTMLVideoElement)||Rn.has(e))return;let t=window.__HF_MEDIA_CODEC_MAP__;if(!t)return;let n=So(e);if(n===null)return;let r=Ao(n,t);if(!r||!r.browserHostile)return;let i=r.representativeMime?e.canPlayType(r.representativeMime):"";i==="probably"||i==="maybe"||Eo(e,r,"proactive")}function zl(e){if(vo(e)||!(e instanceof HTMLVideoElement)||e.videoWidth!==0)return;let t=Wr(e);if(Rn.has(e)){Rt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=So(e);if(r===null){Rt(e,"cross_origin",t);return}let i=Ao(r,n);if(i&&!i.browserHostile){Rt(e,"browser_safe_codec",t);return}Eo(e,i,"reactive")}function ql(e){if(vo(e)||!(e instanceof HTMLVideoElement))return;let t=Wr(e);if(Rn.has(e)){Rt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=So(e);if(r===null){Rt(e,"cross_origin",t);return}let i=Ao(r,n);if(i&&!i.browserHostile){Rt(e,"browser_safe_codec",t);return}Eo(e,i,"tertiary")}var Se=class extends Error{constructor(n,r=null){super(r==null?n:`${n} at line ${r}`);ge(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=r}},eh=[0,0,0],th=[1,1,1],Vr=64;function nh(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r===\'"\'&&(t=!t),r==="#"&&!t)return e.slice(0,n)}return e}function dt(e,t){let n=Number(e);if(!Number.isFinite(n))throw new Se(`Invalid number "${e}"`,t);return n}function $l(e,t,n){if(e.length!==3)throw new Se(`${t} expects three numbers`,n);return[dt(e[0],n),dt(e[1],n),dt(e[2],n)]}function jl(e,t,n){if(!e)throw new Se(`${t} expects a size`,n);let r=Number(e);if(!Number.isInteger(r)||r<2)throw new Se(`${t} must be an integer greater than 1`,n);return r}function rh(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new Se("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function ih(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 oh(e){return/^[+-]?(?:\\d|\\.\\d)/.test(e)}function Kl(e,t={}){let n=t.maxSize??Vr,r=null,i=eh,o=th,a=null,l=null,s=[],u=e.replace(/^\\uFEFF/,"").split(/\\r?\\n/);for(let f=0;f<u.length;f++){let m=f+1,p=nh(u[f]??"").trim();if(!p)continue;let b=p.split(/\\s+/),v=(b[0]??"").toUpperCase(),x=b.slice(1);if(v==="TITLE"){r=ih(p);continue}if(v==="DOMAIN_MIN"){i=$l(x,v,m);continue}if(v==="DOMAIN_MAX"){o=$l(x,v,m);continue}if(v==="LUT_3D_INPUT_RANGE"){if(x.length!==2)throw new Se(`${v} expects two numbers`,m);let _=dt(x[0],m),R=dt(x[1],m);if(R<=_)throw new Se("LUT_3D_INPUT_RANGE max must exceed min",m);i=[_,_,_],o=[R,R,R];continue}if(v==="LUT_1D_SIZE"){a=jl(x[0],v,m);continue}if(v==="LUT_3D_SIZE"){if(l=jl(x[0],v,m),l>n)throw new Se(`LUT_3D_SIZE ${l} exceeds max ${n}`,m);continue}if(!oh(v)){if(v.startsWith("LUT_"))throw new Se(`Unsupported cube keyword ${v}`,m);continue}if(!l)throw a?new Se("1D cube LUTs are not supported yet",m):new Se("LUT data appears before LUT_3D_SIZE",m);if(b.length!==3)throw new Se("LUT data rows must contain three numbers",m);s.push(dt(b[0],m),dt(b[1],m),dt(b[2],m))}if(a&&l)throw new Se("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw a?new Se("1D cube LUTs are not supported yet"):new Se("Missing LUT_3D_SIZE");rh(i,o);let c=l*l*l;if(s.length!==c*3)throw new Se(`Expected ${c} LUT rows for size ${l}, found ${s.length/3}`);return{title:r,size:l,domainMin:i,domainMax:o,data:new Float32Array(s)}}function ah(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function kn(e){return Math.round(ah(e)*255)}function wo(e){let t=e.size,n=t*t,r=t,i=new Uint8Array(n*r*4);for(let o=0;o<t;o++)for(let a=0;a<t;a++)for(let l=0;l<t;l++){let s=((o*t+a)*t+l)*3,u=(a*n+o*t+l)*4;i[u]=kn(e.data[s]??0),i[u+1]=kn(e.data[s+1]??0),i[u+2]=kn(e.data[s+2]??0),i[u+3]=255}return{width:n,height:r,data:i}}var Yl="rec709";var me={hueDegrees:{min:0,max:360,inclusiveMax:!1},unit:{min:0,max:1},signedUnit:{min:-1,max:1},secondaryHueRange:{min:0,max:180},secondaryHueSoftness:{min:0,max:180},secondaryHueCombinedMax:180,secondarySoftRangeSoftness:{min:0,max:.5},secondaryHueShift:{min:-180,max:180},effects:{asciiStyle:{min:0,max:7},bloom:{min:0,max:3},bloomRadius:{min:1,max:100},monoScreenShape:{min:0,max:4}}};var Xl=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"],Jl=["shadows","midtones","highlights"],Ql=["master","red","green","blue"],Zl=["hueVsHue","hueVsSaturation","hueVsLuma"];var eu=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],tu=["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 aS=me.unit,sS=me.signedUnit,lS=me.effects;var je=1024,Mn=16;function nu(e,t,n,r){let i=((2*e+t)*n-e*r)/(e+t);return Math.sign(i)!==Math.sign(n)?0:Math.sign(n)!==Math.sign(r)&&Math.abs(i)>3*Math.abs(n)?3*n:i}function Ae(e,t){let n=e[t];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function sh(e){let t=[],n=[],r=Ae(e,0);for(let a of e.slice(1)){let l=a[0]-r[0];t.push(l),n.push((a[1]-r[1])/l),r=a}let i=Ae(n,0);if(e.length===2)return[i,i];let o=new Array(e.length);o[0]=nu(Ae(t,0),Ae(t,1),i,Ae(n,1)),o[o.length-1]=nu(Ae(t,t.length-1),Ae(t,t.length-2),Ae(n,n.length-1),Ae(n,n.length-2));for(let a=1;a<e.length-1;a+=1){let l=Ae(n,a-1),s=Ae(n,a);if(l===0||s===0||Math.sign(l)!==Math.sign(s)){o[a]=0;continue}let u=Ae(t,a-1),c=Ae(t,a),f=2*c+u,m=c+2*u;o[a]=(f+m)/(f/l+m/s)}return o}function ru(e,t){if(e.length<2)throw new RangeError("A color curve requires at least two points");if(!Number.isInteger(t)||t<2)throw new RangeError("Curve LUT size must be at least 2");let n=Number.NEGATIVE_INFINITY;for(let[r,i]of e){if(!Number.isFinite(r)||!Number.isFinite(i))throw new TypeError("Color curve points must be finite");if(r<=n)throw new RangeError("Color curve inputs must be strictly increasing");n=r}}function lh(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 uh(e,t,n,r,i){let o=n[0]-t[0],a=Math.min(1,Math.max(0,(e-t[0])/o)),l=a*a,s=l*a;return(2*s-3*l+1)*t[1]+(s-2*l+a)*o*r+(-2*s+3*l)*n[1]+(s-l)*o*i}function iu(e,t,n,r,i){lh(e,r,i);let o=sh(e),a=new Float32Array(t),l=0;for(let s=0;s<t;s+=1){let u=n(s);for(;l<e.length-2&&u>Ae(e,l+1)[0];)l+=1;let c=Ae(e,l),f=Ae(e,l+1),m=uh(u,c,f,Ae(o,l),Ae(o,l+1));a[s]=Math.min(i,Math.max(r,m))}return a}function Vt(e,t=je){if(ru(e,t),e.length>Mn)throw new RangeError(`A color curve supports at most ${Mn} points`);if(e.some(([n])=>n<0||n>1))throw new RangeError("Color curve inputs must be between 0 and 1");if(e[0]?.[0]!==0||e[e.length-1]?.[0]!==1)throw new RangeError("Color curves must include input endpoints 0 and 1");return iu(e,t,n=>n/(t-1),0,1)}function _o(e,t,n,r=je){if(e.length<3)throw new RangeError("A hue curve requires at least three points");if(e.length>Mn)throw new RangeError(`A hue curve supports at most ${Mn} points`);let i=[...e].sort((s,u)=>s[0]-u[0]);for(let s=0;s<i.length;s+=1){let u=i[s];if(!u||u[0]<0||u[0]>=360)throw new RangeError("Hue curve inputs must be from 0 up to 360 degrees");if(s>0&&u[0]===i[s-1]?.[0])throw new RangeError("Hue curve inputs must be unique")}let o=i.slice(-2).map(([s,u])=>[s-360,u]),a=i.slice(0,2).map(([s,u])=>[s+360,u]),l=[...o,...i,...a];return ru(l,r),iu(l,r,s=>s/r*360,t,n)}var Fn="data-color-grading",Nn="data-hf-color-grading-source-hidden",$r="data-hf-authored-opacity",uu="__hf_color_grading_",dh=Yl,ko={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},Mo={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},Fo={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 jr=Xl,cu=Jl,du=Ql,fu=Zl,Lo=eu,Do=tu,ou={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},au={vignette:.18};function Ee(e,t,n={},r={},i={},o=1){return{id:e,label:t,intensity:o,adjust:{...ko,...n},details:{...Mo,...r},effects:{...Fo,...i}}}var Io=[Ee("neutral","Neutral"),Ee("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),Ee("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),Ee("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),Ee("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),Ee("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),Ee("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),Ee("vintage-wash","Vintage Wash",ou,au),Ee("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),Ee("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),Ee("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),Ee("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),Ee("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),Ee("creator-camcorder","Creator Camcorder",{contrast:.08,highlights:-.05,shadows:.02,whites:.03,blacks:-.04,temperature:-.03,tint:-.015,vibrance:-.03,saturation:-.06},{vignette:.06,grain:.08,grainSize:.18,grainRoughness:.58},{chromaBleed:.55},.72),Ee("vhs-playback","VHS Playback",{contrast:-.04,saturation:-.08},{grain:.16,grainSize:.12,grainRoughness:.72},{tapeDamage:.82,tapeTracking:.85,tapeNoise:.3,tapeSpeed:.5,chromaBleed:.5,chromaticAberration:.18,scanlines:.35,scanlineCount:.17,scanlineSoftness:1,digitalGlitch:.32,digitalGlitchLineTear:.08,digitalGlitchSpeed:.5}),Ee("home-movie-8mm","8mm Home Movie",ou,{...au,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),Ee("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),Ee("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],fh=new Map(Io.map(e=>[e.id,e])),mh=/^\\$(?:\\{([A-Za-z0-9_.:-]+)\\}|([A-Za-z0-9_.:-]+))$/,ph={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}},zt={hue:0,amount:0,level:0},su={amount:me.unit,level:me.signedUnit},ft=[[0,0],[1,1]],qt=[],hh={hueVsHue:me.secondaryHueShift,hueVsSaturation:me.signedUnit,hueVsLuma:me.signedUnit},To={center:0,range:180,softness:0},Ro={min:0,max:1,softness:.05},gh={vignette:me.unit,vignetteMidpoint:me.unit,vignetteRoundness:me.signedUnit,vignetteFeather:me.unit,grain:me.unit,grainSize:me.unit,grainRoughness:me.unit},No=me.unit,bh=me.effects,mu=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"];var xh=Io.filter(e=>mu.some(t=>e.effects[t]>1e-4)),gS=Io.filter(e=>!xh.includes(e)),bS={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}},pu=[{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 yh=/^#[0-9a-f]{6}$/i;function vh(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&yh.test(t))?null:e.map(t=>t.toLowerCase())}function Te(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function qr(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function hu(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function Re(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?qr(n,t.min,t.max):0}function Po(e,t=0){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?(n%360+360)%360:t}function Sh(e){let t=Te(e)?e:{};return cu.reduce((n,r)=>{let i=Te(t[r])?t[r]:{};return n[r]={hue:Po(i.hue,zt.hue),amount:Re(i.amount??zt.amount,su.amount),level:Re(i.level??zt.level,su.level)},n},{shadows:{...zt},midtones:{...zt},highlights:{...zt}})}function Ah(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)?[qr(t,0,1),qr(n,0,1)]:null}function gu(e){return e.some((t,n)=>n>0&&t[0]===e[n-1]?.[0])}function Eh(e){(e[0]?.[0]??0)>0&&e.unshift([0,0]),(e.at(-1)?.[0]??1)<1&&e.push([1,1])}function wh(e){if(!Array.isArray(e)||e.length<2)return ft;let t=[];for(let n of e){let r=Ah(n);if(!r)return ft;t.push(r)}return t.sort((n,r)=>n[0]-r[0]),gu(t)||(Eh(t),t.length>16)?ft:t}function Ch(e){let t=Te(e)?e:{};return du.reduce((n,r)=>(n[r]=wh(t[r]),n),{master:ft,red:ft,green:ft,blue:ft})}function _h(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)?[Po(n),qr(r,t.min,t.max)]:null}function Th(e,t){if(!Array.isArray(e)||e.length<3||e.length>16)return qt;let n=[];for(let r of e){let i=_h(r,t);if(!i)return qt;n.push(i)}return n.sort((r,i)=>r[0]-i[0]),gu(n)?qt:n}function Rh(e){let t=Te(e)?e:{};return fu.reduce((n,r)=>(n[r]=Th(t[r],hh[r]),n),{hueVsHue:qt,hueVsSaturation:qt,hueVsLuma:qt})}function lu(e){let t=Te(e)?e:{},n=Re(t.min??Ro.min,No),r=Re(t.max??Ro.max,No);return{min:Math.min(n,r),max:Math.max(n,r),softness:Re(t.softness??Ro.softness,me.secondarySoftRangeSoftness)}}function kh(e){let t=Te(e)?e:{},n=Re(t.range??To.range,me.secondaryHueRange);return{center:Po(t.center,To.center),range:n,softness:Re(t.softness??To.softness,{min:me.secondaryHueSoftness.min,max:me.secondaryHueCombinedMax-n})}}function Mh(e){return{hueShift:Re(e.hueShift??0,me.secondaryHueShift),saturation:Re(e.saturation??0,me.signedUnit),luma:Re(e.luma??0,me.signedUnit),temperature:Re(e.temperature??0,me.signedUnit),tint:Re(e.tint??0,me.signedUnit)}}function Fh(e){return!Te(e)||!Te(e.key)||!Te(e.correction)?null:{enabled:e.enabled!==!1,key:{hue:kh(e.key.hue),saturation:lu(e.key.saturation),luma:lu(e.key.luma)},correction:Mh(e.correction)}}function Nh(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,4)){let r=Fh(n);r&&t.push(r)}return t}function Lh(e){if(e==null)return null;let t=String(e).trim();return t||null}function Dh(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!Te(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:hu(e.intensity,1)}}function Ih(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return Te(n)?n:null}catch{return null}return{preset:t}}return Te(e)?e:null}function Ph(e,t){let n=e.trim().match(mh);if(!n)return e;let r=n[1]??n[2]??"";return r&&Object.hasOwn(t,r)?t[r]:e}function zr(e,t){if(typeof e=="string"){let r=Ph(e,t);if(r!==e)return r;let i=e.trim();if(!i.startsWith("{"))return e;try{return zr(JSON.parse(i),t)}catch{return e}}if(Array.isArray(e))return e.map(r=>zr(r,t));if(!Te(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=zr(i,t);return n}function Oh(e){return e?fh.get(e)??null:null}function Kr(e){let t=Ih(e);if(!t||t.enabled===!1)return null;let n=Lh(t.preset),r=Oh(n),i=r?.adjust??ko,o=r?.details??Mo,a=r?.effects??Fo,l=Te(t.adjust)?t.adjust:{},s=Te(t.details)?t.details:{},u=Te(t.effects)?t.effects:{},c=jr.reduce((p,b)=>(p[b]=Re(l[b]??i[b],ph[b]),p),{...ko}),f=Lo.reduce((p,b)=>(p[b]=Re(s[b]??o[b],gh[b]),p),{...Mo}),m=Do.reduce((p,b)=>(p[b]=Re(u[b]??a[b],bh[b]??No),p),{...Fo});return{enabled:!0,preset:n,intensity:hu(t.intensity,r?.intensity??1),adjust:c,wheels:Sh(t.wheels),curves:Ch(t.curves),hueCurves:Rh(t.hueCurves),secondaries:Nh(t.secondaries),details:f,effects:m,palette:vh(t.palette),lut:Dh(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():dh}}function bu(e,t){return Kr(zr(e,t))}function Hh(e){return cu.some(t=>Math.abs(e[t].amount)>1e-4||Math.abs(e[t].level)>1e-4)}function Oo(e){return du.some(t=>e[t].some(([n,r])=>Math.abs(n-r)>1e-4))}function Ho(e){return fu.some(t=>e[t].some(([,n])=>Math.abs(n)>1e-4))}function Go(e){return e.some(t=>t.enabled&&Object.values(t.correction).some(n=>Math.abs(n)>1e-4))}function xu(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||mu.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:jr.some(n=>Math.abs(e.adjust[n])>1e-4)||(e.wheels?Hh(e.wheels):!1)||(e.curves?Oo(e.curves):!1)||(e.hueCurves?Ho(e.hueCurves):!1)||(e.secondaries?Go(e.secondaries):!1):!1}var Gh=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),Bh=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function yu(e){let t=!1,n=null,r=null,i=null,o=null;function a(S,A){try{window.dispatchEvent(new CustomEvent(S,{detail:A}))}catch(C){L("runtime.picker.site1",C)}}function l(S){i=S,a("hyperframe:picker:hovered",{elementInfo:i,isPickMode:t,timestamp:Date.now()})}function s(S){o=S,a("hyperframe:picker:selected",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function u(S){let A=S.ownerDocument.defaultView;if(!A)return!1;let C=S;for(;C&&C!==document.body&&C!==document.documentElement;){let F=A.getComputedStyle(C);if(F.display==="none"||F.visibility==="hidden"||F.pointerEvents==="none")return!0;let I=Number.parseFloat(F.opacity);if(Number.isFinite(I)&&I<=.01&&!C.hasAttribute(Nn))return!0;C=C.parentElement}return!1}function c(S){if(!S||S===document.body||S===document.documentElement)return!1;let A=S.tagName.toLowerCase();return!(A==="script"||A==="style"||A==="link"||A==="meta"||S.classList.contains("__hf-pick-highlight")||S.closest(Gh)||u(S))}function f(S){return!!S?.closest(Bh)}function m(S){let A=S;if(A.id)return`#${CSS.escape(A.id)}`;let C=S.getAttribute("data-composition-id");if(C)return`[data-composition-id="${CSS.escape(C)}"]`;let F=S.getAttribute("data-composition-src");if(F)return`[data-composition-src="${CSS.escape(F)}"]`;let I=S.getAttribute("data-track-index");if(I)return`[data-track-index="${CSS.escape(I)}"]`;let q=S.tagName.toLowerCase(),W=S.parentElement;if(!W)return q;let Y=W.querySelectorAll(`:scope > ${q}`);if(Y.length===1)return q;for(let k=0;k<Y.length;k+=1)if(Y[k]===S)return`${q}:nth-of-type(${k+1})`;return q}function p(S){let A=S.tagName.toLowerCase(),C=(S.textContent??"").trim().replace(/\\s+/g," "),F=(I,q)=>I.length>q?`${I.slice(0,q-1)}\\u2026`:I;return A==="h1"||A==="h2"||A==="h3"?"Heading":A==="p"||A==="span"||A==="div"?C.length>0?F(C,56):"Text":A==="img"?"Image":A==="video"?"Video":A==="audio"?"Audio":A==="svg"?"Shape":S.getAttribute("data-composition-src")?"Composition":A==="section"?"Section":`${A.charAt(0).toUpperCase()}${A.slice(1)}`}function b(S,A,C){let F=typeof C=="number"&&C>0?C:8,I=[];if(document.elementsFromPoint)I=document.elementsFromPoint(S,A);else if(document.elementFromPoint){let Y=document.elementFromPoint(S,A);I=Y?[Y]:[]}if(f(I[0]??null))return[];let q={},W=[];for(let[Y,k]of I.entries()){if(!c(k))continue;let U=`${k.tagName}::${k.id||""}::${Y}`;if(!q[U]&&(q[U]=!0,W.push(k),W.length>=F))break}return W}function v(S){let A=S.getBoundingClientRect(),C={};for(let I of Array.from(S.attributes))I.name.startsWith("data-")&&(C[I.name]=I.value);return{id:S.id||null,tagName:S.tagName.toLowerCase(),selector:m(S),label:p(S),boundingBox:{x:A.left,y:A.top,width:A.width,height:A.height},textContent:S.textContent?S.textContent.trim().slice(0,200):null,src:S.getAttribute("src")||S.getAttribute("data-composition-src")||null,dataAttributes:C}}function x(S,A,C){return b(S,A,C).map(v)}function _(S){if(!t)return;let C=b(S.clientX,S.clientY,1)[0]??(S.target instanceof Element?S.target:null);if(!c(C)||n===C)return;n&&n.classList.remove("__hf-pick-highlight"),n=C,C.classList.add("__hf-pick-highlight");let F=v(C);l(F),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:F})}function R(S){if(!t)return;S.preventDefault(),S.stopPropagation(),S.stopImmediatePropagation();let A=x(S.clientX,S.clientY,8);A.length!==0&&(l(A[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:A,selectedIndex:0,point:{x:S.clientX,y:S.clientY}}))}function T(S){S.key==="Escape"&&(D(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function M(){t||(t=!0,r=document.createElement("style"),r.textContent=[".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",".__hf-pick-active * { cursor: crosshair !important; }"].join(`\n`),document.head.appendChild(r),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",_,!0),document.addEventListener("click",R,!0),document.addEventListener("keydown",T,!0),a("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function D(){t&&(t=!1,n&&(n.classList.remove("__hf-pick-highlight"),n=null),r&&(r.remove(),r=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",_,!0),document.removeEventListener("click",R,!0),document.removeEventListener("keydown",T,!0),a("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function E(){window.__HF_PICKER_API={enable:M,disable:D,isActive:()=>t,getHovered:()=>i,getSelected:()=>o,getCandidatesAtPoint:(S,A,C)=>Number.isFinite(S)&&Number.isFinite(A)?x(S,A,C):[],pickAtPoint:(S,A,C)=>{if(!Number.isFinite(S)||!Number.isFinite(A))return null;let F=x(S,A,8);if(!F.length)return null;let I=Math.max(0,Math.min(F.length-1,Number(C??0))),q=F[I]??null;return q?(s(q),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:q}),D(),q):null},pickManyAtPoint:(S,A,C)=>{if(!Number.isFinite(S)||!Number.isFinite(A))return[];let F=x(S,A,8);if(!F.length)return[];let I=[],q=Array.isArray(C)?C:[0];for(let W of q){let Y=Math.max(0,Math.min(F.length-1,Math.floor(Number(W)))),k=F[Y];if(!k)continue;I.some(ie=>ie.selector===k.selector&&ie.tagName===k.tagName)||I.push(k)}return I.length?(s(I[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:I}),D(),I):[]}},a("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:M,disablePickMode:D,installPickerApi:E}}var Uh=["width","height","top","left","right","bottom","inset","object-fit","object-position","z-index","opacity","visibility","filter","mix-blend-mode","backdrop-filter","border-radius","overflow","clip-path","mask","mask-image","mask-size","mask-position","mask-repeat","transform","transform-origin","translate","rotate","scale","box-sizing"];function $t(e,t){let n=Number.isFinite(t)&&t>0?t:30,r=Number.isFinite(e)&&e>0?e:0;return Math.floor(r*n+1e-9)/n}function vu(e,t,n=Uh){for(let r of n){let i=t.getPropertyValue(r);i&&e.setProperty(r,i)}}function Ln(e,t,n){let r=e?.[t];return typeof r=="function"?Number(r.call(e))||n:typeof r=="number"&&Number.isFinite(r)?r:(r!=null&&L("runtime.player.nonConformantNum",{prop:t,actual:typeof r}),n)}function Ue(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&L("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function Dn(e,t,n){if(e){for(let r of Object.values(e))if(!(!r||r===t))try{n(r)}catch(i){L("runtime.player.site1",i)}}}function Su(e,t,n,r){let i=$t(t,n),o=r?.suppressEvents===!0;return Ue(e,"pause"),typeof e.totalTime=="function"?e.totalTime(i,o):typeof e.seek=="function"&&e.seek(i,o),i}function Wh(e,t,n,r,i){let o=[];Dn(e,t,a=>{Ue(a,"play"),o.push(a)});try{return Su(t,n,r,i)}finally{for(let a of o)try{Ue(a,"pause")}catch(l){L("runtime.player.site2",l)}}}function Vh(e,t){Dn(e,t,n=>{Ue(n,"play")})}function Au(e){let t=e.transport;return t?{_timeline:null,play:()=>t.play(),pause:()=>t.pause(),seek:(n,r)=>t.seek(n,r),renderSeek:(n,r)=>t.renderSeek(n,r),getTime:()=>t.getTime(),getDuration:()=>t.getDuration(),isPlaying:()=>t.isPlaying(),setPlaybackRate:n=>t.setPlaybackRate(n),getPlaybackRate:()=>t.getPlaybackRate()}:{_timeline:null,play:()=>{let n=e.getTimeline();if(!n||e.getIsPlaying())return;let r=Math.max(0,Number(e.getSafeDuration?.()??Ln(n,"duration",0))||0);r>0&&Math.max(0,Ln(n,"time",0))>=r&&(Ue(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()),Ue(n,"play"),Dn(e.getTimelineRegistry?.(),n,i=>{typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),Ue(i,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;Ue(n,"pause"),Dn(e.getTimelineRegistry?.(),n,i=>{Ue(i,"pause")});let r=Math.max(0,Ln(n,"time",0));e.onDeterministicSeek(r),e.onDeterministicPause(),e.setIsPlaying(!1),e.onSyncMedia(r,!1),e.onRenderFrameSeek(r),e.onStatePost(!0)},seek:(n,r)=>{let i=e.getTimeline();if(!i)return;let o=Math.max(0,Number(n)||0),a=e.getIsPlaying(),l=Wh(e.getTimelineRegistry?.(),i,o,e.getCanonicalFps());e.onDeterministicSeek(l),r?.keepPlaying&&a?(typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),Ue(i,"play"),Dn(e.getTimelineRegistry?.(),i,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),Ue(s,"play")}),e.onDeterministicPlay(),e.onShowNativeVideos(),e.onSyncMedia(l,!0)):(e.setIsPlaying(!1),e.onSyncMedia(l,!1)),e.onRenderFrameSeek(l),e.onStatePost(!0)},renderSeek:(n,r)=>{let i=e.getTimeline(),o=e.getCanonicalFps(),a=i?(Vh(e.getTimelineRegistry?.(),i),Su(i,n,o,r)):$t(Math.max(0,Number(n)||0),o);e.onDeterministicSeek(a,r),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>Ln(e.getTimeline(),"time",0),getDuration:()=>Ln(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function Eu(){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 zh=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function Bo(e){return e.id||e.getAttribute("data-hf-id")||null}function qh(e){return ve(e)}function $h(e,t){let n=e.getAttribute("data-composition-id");if(!n)return null;let r=Number(t[n]?.duration?.());return Number.isFinite(r)&&r>0?r:null}function jh(e){return!(e instanceof HTMLMediaElement)||!Number.isFinite(e.duration)?null:Qe(e,e.duration)}function Kh(e,t,n,r){let i=qh(e.getAttribute("data-duration"));return i!=null&&i>0?i:$h(e,t)??jh(e)??Math.max(0,n-r)}function Yh(e){for(let[t,n]of e){let r=t.parentElement;for(;r;){let i=e.get(r);if(i){n.parentId=i.id,i.children.push(n);break}r=r.parentElement}}}function wu(e){let{startResolver:t,timelineRegistry:n,rootDuration:r}=e,i=new Map,o=document.querySelector("[data-composition-id]"),a=0;for(let l of document.querySelectorAll("[data-start]")){if(l===o||zh.has(l.tagName))continue;let s=t.resolveStartForElement(l,0);if(Kh(l,n,r,s)<=0)continue;let u={id:Bo(l)??`__clip-${a++}`,element:l,parentId:null,children:[]};i.set(l,u)}return Yh(i),{roots:Array.from(i.values()).filter(l=>l.parentId===null)}}function In(e){if(e==null||typeof e=="string"&&e.trim()==="")return null;let t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null}function jt(e){let t=In(e.start);if(t==null)return null;let n=Math.max(0,t),r=In(e.duration),i=In(e.authoredDuration),o=r!=null&&r>0?r:i!=null&&i>0?i:null;if(o!=null)return{start:n,duration:o,end:n+o};let a=In(e.end),l=In(e.authoredEnd),s=a!=null&&a>n?a:l!=null&&l>n?l:null;return{start:n,duration:s==null?null:s-n,end:s}}var Uo="css:root",Cu=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],Xh=new Set([...Cu,"contain","isolation","mask-border","mix-blend-mode","opacity"]),Jh=new Set(["absolute","relative"]),Qh=new Set(["flex","inline-flex","grid","inline-grid"]),Zh=new Set(["layout","paint","strict","content"]),e0=new Set(["size","inline-size"]);function t0(e){return e.position==="fixed"||e.position==="sticky"}function n0(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(Jh.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&Qh.has(n)}function r0(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:Cu.some(r=>{let i=e.getPropertyValue(r);return i!==""&&i!=="none"})}function i0(e){return e.getPropertyValue("contain").split(/\\s+/).some(n=>Zh.has(n))?!0:e0.has(e.getPropertyValue("container-type"))}function o0(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>Xh.has(t))}function a0(e,t){return t0(t)||n0(e,t)||r0(t)||i0(t)?!0:o0(t)}function s0(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 Yr(e){let t=e.ownerDocument.defaultView;if(!t)return Uo;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(a0(n,t.getComputedStyle(n)))return s0(n)}catch{return Uo}n=n.parentElement}return Uo}function mt(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,i=new WeakMap,o=new WeakMap,a=new Set,l=m=>{let p=r.getElementById(m);return p||(r.querySelector(`[data-composition-id="${CSS.escape(m)}"]`)??null)},s=m=>{let p=m.ownerDocument.defaultView?.HTMLMediaElement;return p?m instanceof p:typeof HTMLMediaElement<"u"&&m instanceof HTMLMediaElement},u=m=>{let p=o.get(m);if(p!==void 0)return p;let b=null,v=jt({start:0,duration:m.getAttribute("data-duration"),authoredDuration:n?m.getAttribute("data-hf-authored-duration"):null});if(v?.duration!=null&&v.duration>0&&(b=v.duration),b==null||b<=0){let x=f(m,0),_=jt({start:x,end:m.getAttribute("data-end"),authoredEnd:n?m.getAttribute("data-hf-authored-end"):null});_?.duration!=null&&_.duration>0&&(b=_.duration)}if((b==null||b<=0)&&s(m)){let x=yn(m);Number.isFinite(m.duration)&&m.duration>x&&(b=(m.duration-x)/_e(m))}if(b==null||b<=0){let x=m.getAttribute("data-composition-id");if(x){let _=t[x]??null;if(_&&typeof _.duration=="function")try{let R=Number(_.duration());Number.isFinite(R)&&R>0&&(b=R)}catch(R){L("runtime.startResolver.site1",R)}}}return b!=null&&Number.isFinite(b)&&b>0?(o.set(m,b),b):(o.set(m,null),null)},c=(m,p)=>{if(m.hasAttribute("data-composition-id")){let v=m.parentElement?.closest("[data-composition-id]");return v?f(v,p):0}let b=m.closest("[data-composition-id]");return b?f(b,p):0},f=(m,p)=>{let b=i.get(m);if(b!==void 0)return b??p;if(a.has(m))return p;a.add(m);try{let v=lo(m.getAttribute("data-start"));if(!v){if(m.hasAttribute("data-composition-id")){let M=m.parentElement;if(M&&(M.hasAttribute("data-composition-src")||M.hasAttribute("data-composition-id")||M.hasAttribute("data-composition-file"))){let D=f(M,p);return i.set(m,D),D}}return i.set(m,p),p}if(v.kind==="absolute"){let M=Math.max(0,v.value),D=Math.max(0,c(m,p)+M);return i.set(m,D),D}let x=l(v.refId);if(!x)return i.set(m,p),p;let _=f(x,0),R=u(x);if(R==null||R<=0){let M=Math.max(0,_+v.offset);return i.set(m,M),M}let T=Math.max(0,_+R+v.offset);return i.set(m,T),T}finally{a.delete(m)}};return{resolveStartForElement:(m,p=0)=>f(m,Math.max(0,p)),resolveDurationForElement:m=>u(m)}}function Wo(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}function pt(e){return ve(e)}function Vo(e){let t=e.getAttribute("data-duration"),n=e.getAttribute("data-hf-authored-duration"),r=jt({start:0,duration:t,authoredDuration:n})?.duration;return r??([t,n].map(pt).some(o=>o!=null&&o<=0)?0:null)}function _u(e){return jt({start:0,end:e.getAttribute("data-end"),authoredEnd:e.getAttribute("data-hf-authored-end")})?.end??null}function zo(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 qo(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function $o(e,t){let n=e.getAttribute("data-track-index")??e.getAttribute("data-track");if(n==null)return t;let r=Number.parseInt(n,10);return Number.isFinite(r)?r:t}function On(e){let t=String(e??"").trim();if(!t)return null;let n=t.toLowerCase();if(n.startsWith("data:")||n.startsWith("javascript:"))return null;try{return new URL(t,document.baseURI).toString()}catch{return t}}function Tu(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return On(t);let n=e.getAttribute("data-composition-src");if(n)return On(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?On(r.getAttribute("src")):null}function u0(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 c0(e){if(!e)return null;try{return new URL(e,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return e.split(/[\\\\/]/).filter(Boolean).at(-1)??null}}function d0(e){let t=e.textContent?.replace(/\\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function Pn(e){let t=e.replace(/\\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\\s+/g," ").trim();return t?t.replace(/\\b\\w/g,n=>n.toUpperCase()):e}function f0(e,t,n){let r=e.getAttribute("data-timeline-label")??e.getAttribute("data-label")??e.getAttribute("aria-label")??null;if(r?.trim())return r.trim();let i=e.getAttribute("data-composition-id");if(i)return Pn(i);let o=e.id;if(o)return Pn(o);let a=u0(e);if(a)return Pn(a);let l=c0(Tu(e));if(l)return Pn(l);let s=d0(e);return s||`${Pn(t)} ${n+1}`}function Ru(e){let n=window.__timelines??{},r=mt({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),i=z=>{if(!z)return null;let O=n[z]??null;if(!O||typeof O.duration!="function")return null;try{let B=Number(O.duration());return Number.isFinite(B)&&B>0?B:null}catch{return null}},o=z=>{let O=pt(z.getAttribute("data-duration"));return O!=null&&O>0?O:Number.isFinite(z.duration)?Qe(z,z.duration):null},a=()=>{let z=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(z.length===0)return null;let O=0;for(let B of z){let ee=B.hasAttribute("data-hf-auto-start")?r.resolveStartForElement(B,0):Math.max(0,Number(B.getAttribute("data-start")??0)||0);if(!Number.isFinite(ee))continue;let K=o(B);K==null||K<=0||(O=Math.max(O,Math.max(0,ee)+K))}return O>0?O:null},l=(z,O)=>{let B=[],ee=null,K=null,te=null,J=z.parentElement;for(;J;){let X=J.getAttribute("data-composition-id");X&&(B.push(X),!te&&J!==O&&(te=X),ee==null&&(ee=r.resolveStartForElement(J,0)),K==null&&(K=pt(J.getAttribute("data-duration"))??i(X)??null)),J=J.parentElement}return{parentCompositionId:te,compositionAncestors:B.reverse(),inheritedStart:ee,inheritedDuration:K}},s=document.querySelector("[data-composition-id]"),u=Array.from(document.querySelectorAll("[data-composition-id]")),c=s?.getAttribute("data-composition-id")??null,f=s?r.resolveStartForElement(s,0):0,m=a(),p=m!=null?Math.max(0,m-Math.max(0,f)):null,b=i(c),v=Vo(s??document.body),x=qo(...u.filter(z=>z!==s).map(z=>{let O=r.resolveStartForElement(z,0),B=r.resolveDurationForElement(z)??i(z.getAttribute("data-composition-id"))??null;return!Number.isFinite(O)||B==null||B<=0?null:Math.max(0,O)+B})),_=x!=null?Math.max(0,x-Math.max(0,f)):null,R=typeof b=="number"&&Number.isFinite(b)&&b>0?b:null,T=typeof v=="number"&&Number.isFinite(v)&&v>0?v:null,M=typeof p=="number"&&Number.isFinite(p)&&p>0?p:null,D=typeof _=="number"&&Number.isFinite(_)&&_>0?_:null,E=qo(M,D),S=R!=null&&E!=null&&R>E+1,C=T??(S?E:qo(R,M,D))??null,I=(C!=null?f+C:null)??(typeof m=="number"&&Number.isFinite(m)&&m>0?m:null),q=(z,O)=>!Number.isFinite(O)||O<=0?0:I==null||!Number.isFinite(I)?O:!Number.isFinite(z)||z>=I?0:Math.max(0,Math.min(O,I-z)),W=[],Y=[],k=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),U=0;for(let[z,O]of k.entries()){if(O===s||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(O.tagName))continue;let B=l(O,s),ee=r.resolveStartForElement(O,B.inheritedStart??0),K=O.getAttribute("data-composition-id"),te=Vo(O);if(te==null&&K&&K!==c&&(te=i(K)),te==null&&O instanceof HTMLMediaElement&&Number.isFinite(O.duration)&&(te=Qe(O,O.duration)),te==null){let Fe=B.inheritedDuration;if(Fe!=null&&Fe>0){let Ce=(B.inheritedStart??0)+Fe;te=Math.max(0,Ce-ee)}}if(te==null||te<=0||(te=q(ee,te),te<=0))continue;let J=ee+te;U=Math.max(U,J);let X=O.tagName.toLowerCase(),Pe=K&&K!==c?"composition":X==="video"?"video":X==="audio"?"audio":X==="img"?"image":"element";W.push({id:Bo(O)??K??null,label:f0(O,Pe,W.length),start:ee,duration:te,track:$o(O,z),zIndex:zo(O),stackingContextId:Yr(O),kind:Pe,tagName:X,compositionId:O.getAttribute("data-composition-id"),compositionAncestors:B.compositionAncestors,parentCompositionId:B.parentCompositionId,nodePath:null,compositionSrc:On(O.getAttribute("data-composition-src")),playbackStart:$e(O),playbackRate:_e(O),assetUrl:Tu(O),timelineRole:O.getAttribute("data-timeline-role"),timelineLabel:O.getAttribute("data-timeline-label"),timelineGroup:O.getAttribute("data-timeline-group"),timelinePriority:pt(O.getAttribute("data-timeline-priority"))})}let ie=new Set(W.map(z=>z.id)),P=s?.getAttribute("data-composition-id")??null,H=P?n[P]??null:null;if(H&&s){let z=H;if(typeof z.getChildren=="function")try{let O=z.getChildren(!0,!0,!1)??[],B=new Map;for(let te of s.children){let J=te;if(!J.id)continue;let X=J.tagName.toLowerCase();X==="script"||X==="style"||X==="link"||B.set(J,{id:J.id,start:1/0,end:-1/0})}let ee=te=>{let J=te;for(;J;){if(B.has(J))return J;if(J===s)return null;J=J.parentElement}return null};for(let te of O){if(typeof te.targets!="function"||typeof te.startTime!="function"||typeof te.duration!="function")continue;let J=te.startTime(),X=te.parent;for(;X&&X!==H&&typeof X.startTime=="function";)J+=X.startTime(),X=X.parent;let Pe=J+te.duration();if(!(!Number.isFinite(J)||!Number.isFinite(Pe)))for(let Fe of te.targets()){if(!(Fe instanceof Element))continue;let cn=ee(Fe);if(!cn)continue;let Ce=B.get(cn);Ce&&(Ce.start=Math.min(Ce.start,J),Ce.end=Math.max(Ce.end,Pe))}}let K=W.length>0?Math.max(...W.map(te=>te.track))+1:0;for(let[te,J]of B){if(J.start===1/0||J.end===-1/0)continue;let X=te;if(ie.has(X.id))continue;let Pe=Math.max(0,J.end-J.start);if(Pe<=0)continue;let Fe=q(J.start,Pe);Fe<=0||(U=Math.max(U,J.start+Fe),W.push({id:X.id,label:X.getAttribute("data-timeline-label")??X.getAttribute("data-label")??X.getAttribute("aria-label")??X.id,start:J.start,duration:Fe,track:$o(X,K),zIndex:zo(X),stackingContextId:Yr(X),kind:"element",tagName:X.tagName.toLowerCase(),compositionId:X.getAttribute("data-composition-id"),compositionAncestors:P?[P]:[],parentCompositionId:P,nodePath:null,compositionSrc:null,playbackStart:$e(X),playbackRate:_e(X),assetUrl:null,timelineRole:X.getAttribute("data-timeline-role"),timelineLabel:X.getAttribute("data-timeline-label"),timelineGroup:X.getAttribute("data-timeline-group"),timelinePriority:pt(X.getAttribute("data-timeline-priority"))}),ie.add(X.id))}}catch(O){L("runtime.timeline.site1",O)}}if(s&&C!=null&&C>0){let z=W.length>0?Math.max(...W.map(O=>O.track))+1:0;for(let O of s.children){let B=O;if(!B.id||ie.has(B.id))continue;let ee=B.getAttribute("data-timeline-role");if(ee!=="overlay"&&ee!=="persistent-overlay")continue;let K=B.tagName.toLowerCase();if(K==="script"||K==="style"||K==="link"||K==="meta"||window.getComputedStyle(B).display==="none")continue;let J=q(0,C);J<=0||(U=Math.max(U,J),W.push({id:B.id,label:B.getAttribute("data-timeline-label")??B.getAttribute("data-label")??B.getAttribute("aria-label")??B.id,start:0,duration:J,track:$o(B,z),zIndex:zo(B),stackingContextId:Yr(B),kind:"element",tagName:K,compositionId:B.getAttribute("data-composition-id"),compositionAncestors:P?[P]:[],parentCompositionId:P,nodePath:null,compositionSrc:null,playbackStart:$e(B),playbackRate:_e(B),assetUrl:null,timelineRole:ee,timelineLabel:B.getAttribute("data-timeline-label"),timelineGroup:B.getAttribute("data-timeline-group"),timelinePriority:pt(B.getAttribute("data-timeline-priority"))}),ie.add(B.id))}}for(let z of u){if(z===s)continue;let O=z.getAttribute("data-composition-id");if(!O||!Wo(O))continue;let B=r.resolveStartForElement(z,0),ee=Vo(z);if((ee==null||ee<=0)&&_u(z)!=null){let X=_u(z);ee=Math.max(0,X-B)}let K=i(O),te=ee&&ee>0?ee:K;if(te==null||te<=0)continue;let J=q(B,te);J<=0||Y.push({id:O,label:z.getAttribute("data-label")??O,start:B,duration:J,thumbnailUrl:On(z.getAttribute("data-thumbnail-url")),avatarName:null})}let V=Math.max(1,U||1,C??0),j=S&&T==null,we=j?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(V*Math.max(1,e.canonicalFps)));return{..._r(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:j?Number.POSITIVE_INFINITY:V,durationInFrames:we,clips:W,scenes:Y,compositionWidth:pt(s?.getAttribute("data-width"))??1920,compositionHeight:pt(s?.getAttribute("data-height"))??1080}}var jo="data-composition-id",m0="data-composition-src",p0=`[${jo}]`,iA=`[${m0}]`,ku="style",Mu="script",h0=\'link[rel="stylesheet"], link[rel="preconnect"]\';function Kt(e){return e?Array.from(e):[]}function Fu(e){let{contentNode:t,head:n,documentElement:r,hasTemplate:i,compositionId:o}=e,a=Kt(t.querySelectorAll(p0)),l=o?a.find(c=>c.getAttribute(jo)===o)??null:a[0]??null,s=(l??a[0])?.getAttribute(jo)?.trim()||"",u=i?null:n??null;return{innerRoot:l,authoredCompositionId:o||s||null,scriptCompositionId:s||o||null,authoredRootId:l?.getAttribute("id")?.trim()||null,styleSources:[...Kt(u?.querySelectorAll(ku)),...Kt(t.querySelectorAll(ku))],scriptSources:[...Kt(u?.querySelectorAll(Mu)),...Kt(t.querySelectorAll(Mu))],linkSources:Kt(n?.querySelectorAll(h0)),variableDefaultCarriers:[r,l].filter(c=>c!=null)}}var pe=Qm(nd(),1),rd=pe.default,jA=pe.default.stringify,KA=pe.default.fromJSON,YA=pe.default.plugin,XA=pe.default.parse,JA=pe.default.list,QA=pe.default.document,ZA=pe.default.comment,eE=pe.default.atRule,tE=pe.default.rule,nE=pe.default.decl,rE=pe.default.root,iE=pe.default.CssSyntaxError,oE=pe.default.Declaration,aE=pe.default.Container,sE=pe.default.Processor,lE=pe.default.Document,uE=pe.default.Comment,cE=pe.default.Warning,dE=pe.default.AtRule,fE=pe.default.Result,mE=pe.default.Input,pE=pe.default.Rule,hE=pe.default.Root,gE=pe.default.Node;var ya="data-hf-authored-id",id="data-hf-inner-root";function va(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function Sa(e){return e.replace(/\\\\/g,"\\\\\\\\").replace(/"/g,\'\\\\"\')}function Og(e){return e&&e.replace(/[^a-zA-Z0-9_-]/g,n=>`\\\\${n}`).replace(/^-?\\d/,n=>`\\\\${n}`)}function ad(e){let t=e.trim();return t?Array.from(new Set([t,Og(t)])).filter(Boolean):[]}function Hg(e){return!!e&&/[\\w-]/.test(e)}function Gg(e,t,n){let r=ad(t).sort((l,s)=>s.length-l.length);if(r.length===0)return e;let i="",o=0,a=null;for(let l=0;l<e.length;l+=1){let s=e[l],u=l>0?e[l-1]:"";if(a){i+=s,s===a&&u!=="\\\\"&&(a=null);continue}if(s===\'"\'||s==="\'"){a=s,i+=s;continue}if(s==="["){o+=1,i+=s;continue}if(s==="]"){o=Math.max(0,o-1),i+=s;continue}if(s==="#"&&o===0){let c=r.find(f=>e.startsWith(f,l+1));if(c){let f=e[l+1+c.length];if(!Hg(f)){i+=n,l+=c.length;continue}}}i+=s}return i}function Bg(e,t){let n=t?.trim();return n?Gg(e,n,`[${ya}="${Sa(n)}"]`):e}function od(e){return`${e}:not(:has([${id}])), ${e} > [${id}]`}function Ug(e,t,n,r,i,o){let a=Bg(e,r),l=Wg(a,t,n),s=l.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return o?od(t):e;let u=new RegExp(`\\\\[\\\\s*data-composition-id\\\\s*=\\\\s*(["\'])${va(n)}\\\\1\\\\s*\\\\]`,"g");if(u.test(s))return s.replace(u,"").trim()===""?od(t):l.replace(u,t);let c=l.match(/^\\s*/)?.[0]??"",f=l.match(/\\s*$/)?.[0]??"";if(i){let m=r?`[${ya}="${Sa(r)}"]`:null;if(m&&s.startsWith(m)){let p=s.slice(m.length);return`${c}${t}${m}${p}${f}`}}return`${c}${t} ${s}${f}`}function Wg(e,t,n){let r=va(n),i=String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${r}"|\'${r}\')\\s*\\]`,o=String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`;return e.replace(new RegExp(`${i}(?:${o})+`,"g"),t).replace(new RegExp(`(?:${o})+${i}`,"g"),t)}var Vg=new Set(["keyframes","-webkit-keyframes","font-face"]);function zg(e){return e?.type==="atrule"}function qg(e){let t=e.parent;for(;t;){if(zg(t)&&Vg.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function $g(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function sd(e,t,n,r,i){let o=t.trim();if(!e||!o)return e;let a=n||`[data-composition-id="${Sa(o)}"]`,l;try{l=rd.parse(e)}catch{return""}return l.walkRules(s=>{qg(s)||$g(s)||(s.selectors=s.selectors.map(u=>Ug(u,a,o,r,i?.compoundAuthoredRoot,i?.scopeRootSelectors)))}),l.toResult({map:!1}).css}function nt(e){return JSON.stringify(e).replace(/</g,"\\\\u003c")}function ld(e,t,n="[HyperFrames] composition script error:",r,i=t,o){let a=nt(t),l=nt(i),s=nt(n),u=va(t),c=nt(o?.trim()||null),f=nt(r??null),m=nt(String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${u}"|\'${u}\')\\s*\\]`),p=nt(String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`),b=nt(ad(o?.trim()||""));return`(function(){\n var __hfCompId = ${a};\n var __hfTimelineCompId = ${l};\n var __hfErrorLabel = ${s};\n var __hfAuthoredRootId = ${c};\n var __hfAuthoredRootAttr = ${nt(ya)};\n var __hfEscapeAttr = function(value) {\n return (value + "").replace(/\\\\\\\\/g, "\\\\\\\\\\\\\\\\").replace(/"/g, "\\\\\\\\\\\\"");\n };\n var __hfRootSelector = ${f} || (__hfCompId\n ? \'[data-composition-id="\' + __hfEscapeAttr(__hfCompId) + \'"]\'\n : "");\n var __hfRoot = null;\n var __hfRootSelectorPattern = ${m};\n var __hfTimingSelectorPattern = ${p};\n var __hfAuthoredRootIdForms = ${b};\n var __hfAuthoredRootSelector = __hfAuthoredRootId\n ? "[" + __hfAuthoredRootAttr + \'="\' + __hfEscapeAttr(__hfAuthoredRootId) + \'"]\'\n : "";\n var __hfIsSelectorNameChar = function(char) {\n return !!char && /[\\\\w-]/.test(char);\n };\n var __hfReplaceAuthoredRootIdSelectors = function(selector) {\n if (!__hfAuthoredRootSelector || !__hfAuthoredRootIdForms.length || typeof selector !== "string") {\n return selector;\n }\n var result = "";\n var bracketDepth = 0;\n var quote = null;\n for (var index = 0; index < selector.length; index += 1) {\n var char = selector[index];\n var previousChar = index > 0 ? selector[index - 1] : "";\n if (quote) {\n result += char;\n if (char === quote && previousChar !== "\\\\\\\\") {\n quote = null;\n }\n continue;\n }\n if (char === \'"\' || char === "\'") {\n quote = char;\n result += char;\n continue;\n }\n if (char === "[") {\n bracketDepth += 1;\n result += char;\n continue;\n }\n if (char === "]") {\n bracketDepth = Math.max(0, bracketDepth - 1);\n result += char;\n continue;\n }\n if (char === "#" && bracketDepth === 0) {\n var matchedForm = null;\n for (var formIndex = 0; formIndex < __hfAuthoredRootIdForms.length; formIndex += 1) {\n var form = __hfAuthoredRootIdForms[formIndex];\n if (selector.slice(index + 1, index + 1 + form.length) === form) {\n matchedForm = form;\n break;\n }\n }\n if (matchedForm) {\n var nextChar = selector[index + 1 + matchedForm.length];\n if (!__hfIsSelectorNameChar(nextChar)) {\n result += __hfAuthoredRootSelector;\n index += matchedForm.length;\n continue;\n }\n }\n }\n result += char;\n }\n return result;\n };\n var __hfNormalizeSelector = function(selector) {\n if (!__hfCompId || typeof selector !== "string") return selector;\n var normalized = selector\n .replace(new RegExp(__hfRootSelectorPattern + \'(?:\' + __hfTimingSelectorPattern + \')+\', \'g\'), __hfRootSelector)\n .replace(new RegExp(\'(?:\' + __hfTimingSelectorPattern + \')+\' + __hfRootSelectorPattern, \'g\'), __hfRootSelector);\n if (__hfAuthoredRootSelector) {\n normalized = __hfReplaceAuthoredRootIdSelectors(normalized);\n }\n return normalized;\n };\n var __hfFindRoot = function() {\n if (!__hfRoot && __hfRootSelector) {\n __hfRoot = window.document.querySelector(__hfRootSelector);\n }\n return __hfRoot;\n };\n var __hfContains = function(node) {\n var root = __hfFindRoot();\n return !root || node === root || root.contains(node);\n };\n var __hfQueryAll = function(selector) {\n var root = __hfFindRoot();\n if (!root || typeof selector !== "string") {\n return window.document.querySelectorAll(selector);\n }\n return Array.prototype.filter.call(window.document.querySelectorAll(__hfNormalizeSelector(selector)), function(node) {\n return __hfContains(node);\n });\n };\n var __hfQueryOne = function(selector) {\n var matches = __hfQueryAll(selector);\n return matches[0] || null;\n };\n var __hfGetElementById = function(id) {\n var found = window.document.getElementById(id);\n if (found && __hfContains(found)) return found;\n var root = __hfFindRoot();\n if (!root) return found || null;\n var idValue = id + "";\n if (__hfAuthoredRootId && __hfAuthoredRootId === idValue && root.getAttribute && root.getAttribute(__hfAuthoredRootAttr) === idValue) {\n return root;\n }\n if (root.id === idValue) return root;\n if (typeof root.querySelector !== "function") return null;\n try {\n var authoredRootMatch = root.querySelector(\'[\' + __hfAuthoredRootAttr + \'="\' + __hfEscapeAttr(idValue) + \'"]\');\n if (authoredRootMatch) return authoredRootMatch;\n } catch {}\n if (typeof CSS !== "undefined" && CSS && typeof CSS.escape === "function") {\n try {\n return root.querySelector("#" + CSS.escape(idValue)) || null;\n } catch {}\n }\n try {\n return root.querySelector(\'[id="\' + __hfEscapeAttr(idValue) + \'"]\') || null;\n } catch {}\n return null;\n };\n var __hfScopedDocument = typeof Proxy === "function"\n ? new Proxy(window.document, {\n get: function(target, prop, receiver) {\n if (prop === "querySelector") return __hfQueryOne;\n if (prop === "querySelectorAll") return __hfQueryAll;\n if (prop === "getElementById") return __hfGetElementById;\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n })\n : window.document;\n var __hfTimelineRegistryProxy = null;\n var __hfGetTimelineRegistry = function() {\n window.__timelines = window.__timelines || {};\n if (!__hfCompId || __hfCompId === __hfTimelineCompId || typeof Proxy !== "function") {\n return window.__timelines;\n }\n if (!__hfTimelineRegistryProxy) {\n __hfTimelineRegistryProxy = new Proxy(window.__timelines, {\n get: function(target, prop, receiver) {\n if (prop !== __hfCompId) {\n return Reflect.get(target, prop, target);\n }\n var authoredValue = Reflect.get(target, prop, target);\n return authoredValue === undefined\n ? Reflect.get(target, __hfTimelineCompId, target)\n : authoredValue;\n },\n set: function(target, prop, value, receiver) {\n if (prop !== __hfCompId) {\n return Reflect.set(target, prop, value, target);\n }\n // The authored node remains in the compiled DOM when its local id\n // differs from the runtime mount id, so readiness legitimately sees\n // both compositions. Publish the same timeline under both identities\n // instead of replacing one with the other.\n var authoredSet = Reflect.set(target, __hfCompId, value, target);\n var runtimeSet = Reflect.set(target, __hfTimelineCompId, value, target);\n return authoredSet && runtimeSet;\n },\n });\n }\n return __hfTimelineRegistryProxy;\n };\n var __hfScopedWindow = typeof Proxy === "function"\n ? new Proxy(window, {\n get: function(target, prop, receiver) {\n if (prop === "__timelines") return __hfGetTimelineRegistry();\n // Inside a sub-composition, __hyperframes is passed as a bare script\n // param bound to the SCOPED variant (per-comp getVariables). But\n // authors routinely write the documented window.__hyperframes.\n // getVariables() form, which would otherwise fall through to the host\n // page\'s base __hyperframes and return the WRONG (or empty) variables\n // for this instance. Route it to the scoped variant too so both\n // spellings resolve to this composition\'s own variables.\n // (__hfScopedHyperframes is a hoisted var assigned below, before any\n // sub-comp script -- the only code that reads this -- runs.)\n if (prop === "__hyperframes") return __hfScopedHyperframes;\n // Native window methods must stay bound to the real window. Handed\n // back unbound, "this" at call time is this Proxy and Chrome rejects\n // it with "Illegal invocation", which broke window.addEventListener,\n // setTimeout, matchMedia and getComputedStyle inside every\n // sub-composition -- including the window.addEventListener("hf-seek",\n // ...) form the Three.js and TypeGPU adapters document. The sibling\n // document and gsap proxies here already bind.\n //\n // Only bind non-constructors. Function.prototype.bind drops static\n // members, so binding a class exposed on window (window.Texts and\n // friends) would silently strip its statics. Built-in methods have\n // no .prototype; classes and constructor functions do.\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" && value.prototype === undefined\n ? value.bind(target)\n : value;\n },\n set: function(target, prop, value, receiver) {\n if (prop === "__timelines") {\n // Common authoring boilerplate assigns the registry back to\n // itself (window.__timelines = window.__timelines || {}). The\n // getter above returns our proxy; do not replace the canonical\n // registry with that proxy or later wrappers will stack proxies.\n if (value === __hfTimelineRegistryProxy) return true;\n target.__timelines = value || {};\n __hfTimelineRegistryProxy = null;\n return true;\n }\n return Reflect.set(target, prop, value, target);\n },\n })\n : window;\n var __hfResolveGsapTarget = function(target) {\n if (typeof target !== "string") return target;\n return __hfQueryAll(target);\n };\n var __hfScopeTimeline = function(timeline) {\n if (!timeline || timeline.__hfScopedCompositionRoot === __hfFindRoot()) return timeline;\n ["to", "from", "fromTo", "set"].forEach(function(method) {\n var original = timeline[method];\n if (typeof original !== "function") return;\n timeline[method] = function(target) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(target);\n return original.apply(timeline, args);\n };\n });\n try {\n Object.defineProperty(timeline, "__hfScopedCompositionRoot", {\n value: __hfFindRoot(),\n configurable: true,\n });\n } catch {\n // Best-effort: timelines coming from user code may have a frozen target\n // or a non-extensible defineProperty path. Swallow \\u2014 the scoped root\n // is an enrichment, not a correctness invariant for playback.\n }\n return timeline;\n };\n var __hfBaseGsap = typeof gsap === "undefined" ? window.gsap : gsap;\n var __hfScopedGsap = !__hfBaseGsap || typeof Proxy !== "function"\n ? __hfBaseGsap\n : new Proxy(__hfBaseGsap, {\n get: function(target, prop, receiver) {\n if (prop === "timeline") {\n return function() {\n return __hfScopeTimeline(target.timeline.apply(target, arguments));\n };\n }\n if (prop === "to" || prop === "from" || prop === "fromTo" || prop === "set") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return target[prop].apply(target, args);\n };\n }\n if (prop === "utils" && target.utils && typeof Proxy === "function") {\n return new Proxy(target.utils, {\n get: function(utilsTarget, utilsProp, utilsReceiver) {\n if (utilsProp === "toArray") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return utilsTarget.toArray.apply(utilsTarget, args);\n };\n }\n if (utilsProp === "selector") {\n return function(base) {\n var baseEl = typeof base === "string" ? __hfQueryOne(base) : base;\n var root = baseEl || __hfFindRoot();\n return function(selector) {\n if (!root || typeof selector !== "string") return [];\n return Array.prototype.filter.call(\n window.document.querySelectorAll(__hfNormalizeSelector(selector)),\n function(node) {\n return node === root || (typeof root.contains === "function" && root.contains(node));\n },\n );\n };\n };\n }\n var value = Reflect.get(utilsTarget, utilsProp, utilsTarget);\n return typeof value === "function" ? value.bind(utilsTarget) : value;\n },\n });\n }\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n });\n var __hfBaseHyperframes = window.__hyperframes;\n var __hfScopedHyperframes = !__hfBaseHyperframes\n ? __hfBaseHyperframes\n : Object.assign({}, __hfBaseHyperframes, {\n getVariables: function() {\n var byComp = window.__hfVariablesByComp;\n var scoped = byComp && __hfTimelineCompId ? byComp[__hfTimelineCompId] : null;\n return scoped ? Object.assign({}, scoped) : {};\n },\n });\n var __hfRun = function() {\n try {\n (function(document, gsap, window, __hyperframes) {\n${e.replace(/<\\/(script)/gi,"<\\\\/$1")}\n }).call(window, __hfScopedDocument, __hfScopedGsap, __hfScopedWindow, __hfScopedHyperframes);\n } catch (_err) {\n console.error(__hfErrorLabel, __hfCompId, _err);\n }\n };\n __hfFindRoot();\n __hfRun();\n})();`}var jg=["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 ud(e){let t=e.getAttribute("id")?.trim();for(let n of jg)e.removeAttribute(n);t&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",t)),e.setAttribute("data-hf-inner-root","true")}var Kg=8e3,Yg=/^(?![a-zA-Z][a-zA-Z\\d+\\-.]*:)(?!\\/\\/)(?!\\/)(?!\\.\\.?\\/).+/,Xg=/\\burl\\(\\s*(["\']?)([^)"\']+)\\1\\s*\\)/g,Jg=["src","href"];function Qg(e){return!e||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/")}function fd(e,t){if(!t)return e;let n=e.trim();if(Qg(n)||!n.startsWith("../")&&n!=="..")return e;try{return new URL(n,t).href}catch{return e}}function md(e,t){return!t||!e?e:e.replace(Xg,(n,r,i)=>{let o=fd(i||"",t);return o===i?n:`url(${r||""}${o}${r||""})`})}function Zg(e,t){for(let n of Array.from(e.querySelectorAll("[src], [href]")))for(let r of Jg){let i=n.getAttribute(r);if(i==null)continue;let o=fd(i,t);o!==i&&n.setAttribute(r,o)}}function eb(e,t){for(let n of Array.from(e.querySelectorAll("[style]"))){let r=n.getAttribute("style");if(r==null)continue;let i=md(r,t);i!==r&&n.setAttribute("style",i)}}function tb(e,t){for(let n of Array.from(e.querySelectorAll("style"))){let r=n.textContent||"",i=md(r,t);i!==r&&(n.textContent=i)}}function pd(e,t){if(t){Zg(e,t),eb(e,t),tb(e,t);for(let n of Array.from(e.querySelectorAll("template")))pd(n.content,t)}}function nb(e,t){return`${e}__hf${t}`}var rb=e=>new Promise(t=>{let n=!1,r=Date.now(),i=null,o=a=>{n||(n=!0,i!=null&&window.clearTimeout(i),t({status:a,elapsedMs:Math.max(0,Date.now()-r)}))};e.addEventListener("load",()=>o("load"),{once:!0}),e.addEventListener("error",()=>o("error"),{once:!0}),i=window.setTimeout(()=>o("timeout"),Kg)});function Aa(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function cd(e){for(let t of Array.from(e.querySelectorAll("style, script")))t.remove()}function ib(e){let t=document.importNode(e,!0);ud(t);let n=t.getAttribute("data-width"),r=t.getAttribute("data-height");return t.style.width=n?`${n}px`:"100%",t.style.height=r?`${r}px`:"100%",t}function ob(e,t){let n=e.trim();if(!n)return e;try{return Yg.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 dd(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 di(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 ab(e){let t=new Map;for(let n of e){let r=di(n).authoredCompositionId||"";r&&t.set(r,(t.get(r)||0)+1)}return t}function hd(e){let t=di(e).authoredCompositionId;return t?!!document.querySelector(`template#${CSS.escape(t)}-template`):!1}function sb(e){return!!e.querySelector(\'[data-hf-inner-root="true"]\')}function lb(e){return e.hasAttribute("data-composition-src")?!0:hd(e)?e.children.length===0||e.hasAttribute("data-hf-original-composition-id")?!0:sb(e):!1}function wa(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(t=>t.hasAttribute("data-composition-src")?!0:hd(t))}function gd(){let e=window.__hfVariablesByComp;if(!e)return;let t=new Set(wa().map(n=>di(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(e))t.has(n)||delete e[n]}function bd(e,t=ab(e)){let n=new Map,r=new Map;for(let i of e){let{authoredCompositionId:o,runtimeCompositionId:a}=di(i),l=lb(i);if(!o){r.set(i,{authoredCompositionId:null,runtimeCompositionId:a});continue}let s=(t.get(o)||0)>1,u=a||o;if(l){let c=s?(n.get(o)||0)+1:0;s&&n.set(o,c),u=s?nb(o,c):o,s?i.setAttribute("data-hf-original-composition-id",o):i.removeAttribute("data-hf-original-composition-id"),i.setAttribute("data-composition-id",u),a&&a!==u&&window.__hfVariablesByComp&&delete window.__hfVariablesByComp[a]}r.set(i,{authoredCompositionId:o,runtimeCompositionId:u})}return r}async function Ea(e){let t=Fu({contentNode:e.sourceNode,head:e.head,hasTemplate:e.hasTemplate,compositionId:e.authoredCompositionId}),n=t.innerRoot instanceof HTMLElement?t.innerRoot:null,r=n??e.sourceNode,i=t.authoredCompositionId,o=t.scriptCompositionId,a=e.runtimeCompositionId||null,l=t.authoredRootId,s=a?`[data-composition-id="${CSS.escape(a)}"]`:void 0;for(let m of t.linkSources){let p=(m.getAttribute("href")||"").trim();if(!p)continue;let b=e.compositionUrl?new URL(p,e.compositionUrl).href:p;if(e.compositionUrl&&dd(b,e.compositionUrl)||document.head.querySelector(`link[href="${CSS.escape(b)}"]`))continue;let v=m.cloneNode(!0);v instanceof HTMLLinkElement&&(v.href=b,document.head.appendChild(v),e.injectedLinks.push(v))}(m=>{for(let p of m){let b=p.cloneNode(!0);b instanceof HTMLStyleElement&&(i&&(b.textContent=sd(b.textContent||"",i,s,l,{scopeRootSelectors:!0})),document.head.appendChild(b),e.injectedStyles.push(b))}})(t.styleSources);let c=m=>{let p=m.getAttribute("type")?.trim()??"",b=m.getAttribute("src")?.trim()??"";if(b){let x=ob(b,e.compositionUrl);return e.compositionUrl&&dd(x,e.compositionUrl)?null:{kind:"external",src:x,type:p}}let v=m.textContent?.trim()??"";return v?{kind:"inline",content:v,type:p,scopeCompositionId:o}:null},f=t.scriptSources.map(c).filter(m=>m!==null);if(n){let m=n.getAttribute("data-width"),p=n.getAttribute("data-height"),b=e.parseDimensionPx(m),v=e.parseDimensionPx(p);m&&e.host.setAttribute("data-width",m),p&&e.host.setAttribute("data-height",p),b&&e.host instanceof HTMLElement&&(e.host.style.width=b),v&&e.host instanceof HTMLElement&&(e.host.style.height=v),n.hasAttribute("data-timeline-locked")&&e.host.setAttribute("data-timeline-locked","");let x=ib(n);!e.authoredCompositionId&&i&&x.setAttribute("data-composition-id",i),cd(x),e.host.appendChild(x)}else if(e.hasTemplate){let m=document.importNode(r,!0);cd(m),e.host.appendChild(m)}else e.host.innerHTML=e.fallbackBodyInnerHtml;a&&ub(e,r,a);for(let m of f){let p=document.createElement("script");if(m.type&&(p.type=m.type),p.async=!1,m.kind==="external"?p.src=m.src:m.type.toLowerCase()==="module"?p.textContent=m.content:m.scopeCompositionId?p.textContent=ld(m.content,m.scopeCompositionId,"[HyperFrames] composition script error:",s,a||m.scopeCompositionId,l):p.textContent=`(function(){${m.content}})();`,document.body.appendChild(p),e.injectedScripts.push(p),m.kind==="external"){let b=await rb(p);b.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.authoredCompositionId,runtimeCompositionId:e.runtimeCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:m.src,loadStatus:b.status,elapsedMs:b.elapsedMs}})}}}async function xd(e){let t=wa();if(gd(),t.length===0)return;let n=bd(t),r=t.filter(i=>{if(i.hasAttribute("data-composition-src")||i.children.length>0)return!1;let o=n.get(i)?.authoredCompositionId;return o?!!document.querySelector(`template#${CSS.escape(o)}-template`):!1});if(r.length!==0)for(let i of r){let o=n.get(i),a=o?.authoredCompositionId;if(!a)continue;let l=document.querySelector(`template#${CSS.escape(a)}-template`);Aa(i),await Ea({host:i,authoredCompositionId:a,runtimeCompositionId:o?.runtimeCompositionId||a,hostCompositionSrc:`template#${a}-template`,sourceNode:l.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic})}}async function yd(e){let t=wa();if(gd(),t.length===0)return;let n=bd(t),r=t.filter(i=>i.hasAttribute("data-composition-src"));r.length!==0&&await Promise.all(r.map(async i=>{let o=i.getAttribute("data-composition-src");if(!o)return;let a=n.get(i),l=a?.authoredCompositionId||null,s=a?.runtimeCompositionId||l||null,u=null;try{u=new URL(o,document.baseURI)}catch{u=null}Aa(i);try{let c=l!=null?document.querySelector(`template#${CSS.escape(l)}-template`):null;if(c){await Ea({host:i,authoredCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:c.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:u,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});return}let f=await fetch(o);if(!f.ok)throw new Error(`HTTP ${f.status}`);let m=await f.text(),b=new DOMParser().parseFromString(m,"text/html");pd(b,u);let v=(l?b.querySelector(`template#${CSS.escape(l)}-template`):null)??b.querySelector("template"),x=v?v.content:b.body;await Ea({host:i,authoredCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:x,hasTemplate:!!v,fallbackBodyInnerHtml:b.body.innerHTML,compositionUrl:u,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,head:b.head,declaredVariableDefaults:bn(b.documentElement),variableDeclarer:b.documentElement,onDiagnostic:e.onDiagnostic})}catch(c){e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,errorMessage:c instanceof Error?c.message:"unknown_error"}}),Aa(i)}}))}function ub(e,t,n){let i={...e.declaredVariableDefaults??(t instanceof Element?bn(t):{}),...Xs(e.host)};eo(e.variableDeclarer??(t instanceof Element?t:null),i,n),Ks(e.host),Object.keys(i).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[n]=i,to(e.host,{...js(e.host,i,window),...Rr()})):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[n]}function Ca(e){let n=e.vars.data?.captionState;return n==="dim"||n==="active"?n:void 0}function cb(e){return e instanceof HTMLElement?e.dataset.captionWrapper!=="true"?e:e.querySelector(":scope > span")??null:null}function db(){let e=[],t=document.querySelectorAll(".caption-group");for(let n of t)for(let r of n.children){if(!(r instanceof HTMLElement))continue;let i=r.dataset.captionWrapper==="true"?r.querySelector(":scope > span"):r.tagName==="SPAN"?r:null;i&&e.push(i)}return e}function fb(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}function _a(){let e=window.gsap;e&&document.querySelectorAll(".caption-group").length!==0&&fetch("caption-overrides.json").then(t=>t.ok?t.json():null).then(t=>{if(!t||!Array.isArray(t)||t.length===0)return;let n=db();for(let r of t){let i=null;if(r.wordId&&(i=cb(document.getElementById(r.wordId))),!i&&r.wordIndex!==void 0&&(i=n[r.wordIndex]??null),!i)continue;let o={},a={};if(r.x!==void 0&&(o.x=r.x),r.y!==void 0&&(o.y=r.y),r.scale!==void 0&&(o.scale=r.scale),r.rotation!==void 0&&(o.rotation=r.rotation),r.opacity!==void 0&&(a.opacity=r.opacity),r.fontSize!==void 0&&(a.fontSize=`${r.fontSize}px`),r.fontWeight!==void 0&&(a.fontWeight=r.fontWeight),r.fontFamily!==void 0&&(a.fontFamily=r.fontFamily),r.activeColor||r.dimColor){let s=e.getTweensOf(i).filter(f=>f.vars.color!==void 0).sort((f,m)=>f.startTime()-m.startTime()),u=s.find(f=>Ca(f)==="dim")??s.find(f=>Ca(f)===void 0),c=u?String(u.vars.color):"";for(let f of s)(Ca(f)??(String(f.vars.color)===c?"dim":"active"))==="dim"?r.dimColor&&(f.vars.color=r.dimColor):r.activeColor&&(f.vars.color=r.activeColor);r.dimColor&&e.set(i,{color:r.dimColor})}if(Object.keys(a).length>0&&e.set(i,a),Object.keys(o).length>0){let l=fb(i);e.set(l,o)}}}).catch(()=>{})}var Ra="data-hf-edit-base-x",ka="data-hf-edit-base-y",en="data-hf-edit-original-translate",fi=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},mb=e=>{let t=[],n=0,r="";for(let i of e.trim())i==="("&&(n+=1),i===")"&&(n=Math.max(0,n-1)),/\\s/.test(i)&&n===0?(r&&t.push(r),r=""):r+=i;return r&&t.push(r),t},vd=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,Ta=(e,t)=>vd.test(e)&&vd.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,pb=(e,t,n)=>{if(!e||e==="none")return`${t} ${n}`;let[r,i,o]=mb(e);if(r===void 0)return`${t} ${n}`;if(i===void 0)return`${Ta(r,t)} ${n}`;let a=o===void 0?"":` ${o}`;return`${Ta(r,t)} ${Ta(i,n)}${a}`},hb=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},gb=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""}},Ma=new WeakMap;function bb(e,t){let n=Ma.get(e);if(!t?.force&&n!==void 0&&e.style.getPropertyValue("translate")!==n){Ne("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=fi(e.getAttribute("data-x"))-fi(e.getAttribute(Ra)),i=fi(e.getAttribute("data-y"))-fi(e.getAttribute(ka));e.hasAttribute(en)||e.setAttribute(en,gb(e)),n===void 0&&hb(e);let o=e.getAttribute(en)??"",a=pb(o,`${r}px`,`${i}px`);e.style.setProperty("translate",a),Ma.set(e,e.style.getPropertyValue("translate"))}function mi(e,t){let n=e.defaultView?.HTMLElement,r=e.defaultView?.SVGElement,i=s=>n||r?n!==void 0&&s instanceof n||r!==void 0&&s instanceof r:typeof s.style?.setProperty=="function",o=e.querySelectorAll(`[${en}]:not([${Ra}]):not([${ka}])`);for(let s=0;s<o.length;s++){let u=o[s];if(u===void 0||!i(u))continue;let c=u.getAttribute(en)??"";c===""?u.style.removeProperty("translate"):u.style.setProperty("translate",c),u.removeAttribute(en),Ma.delete(u)}let a=e.querySelectorAll(`[${Ra}], [${ka}]`),l=0;for(let s=0;s<a.length;s++){let u=a[s];u===void 0||!i(u)||(bb(u,t),l+=1)}return l}var Sd="__hfPositionEditsSeekReapplyWrapped",Ad=new WeakSet,Ed=new WeakMap,wd=new WeakMap;function Cd(e){let t=e,n=()=>{try{mi(t.document)}catch{}},r=f=>typeof f=="function"&&(Ad.has(f)||!!f[Sd]),i=f=>{Ad.add(f);try{Object.defineProperty(f,Sd,{value:!0})}catch{}},o=f=>{if(typeof f!="function"||r(f))return f;let m=function(...p){let b=f.apply(this,p);return n(),b};return i(m),m},a=(f,m)=>{let p=Ed.get(f);if(p?.has(m))return!0;let b=Object.getOwnPropertyDescriptor(f,m);if(b?.configurable===!1){let _=f[m];return typeof _=="function"&&(f[m]=o(_),n()),!1}let v=f[m],x=b?.set;return Object.defineProperty(f,m,{configurable:!0,enumerable:b?.enumerable??!0,get:()=>v,set:_=>{v=o(_),x?.call(f,_)}}),v=o(v),p??(p=new Set),p.add(m),Ed.set(f,p),n(),!0},l=(f,m)=>{let p=wd.get(t),b=Object.getOwnPropertyDescriptor(t,f);if(!p?.has(f)){if(b?.configurable===!1){let _=t[f];return _?a(_,m):!1}let x=t[f];Object.defineProperty(t,f,{configurable:!0,enumerable:b?.enumerable??!0,get:()=>x,set:_=>{x=_,x&&a(x,m)}}),p??(p=new Set),p.add(f),wd.set(t,p)}let v=t[f];return v?a(v,m):!1},s=()=>{let f=l("__hf","seek"),m=l("__player","renderSeek");return f&&m};if(s())return;let u=120,c=t.setInterval(()=>{if(s()){t.clearInterval(c);return}u-=1,u<=0&&t.clearInterval(c)},50)}function pi(e){let t=window,r=e.closest("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()??"",i=r?t.__hfVariablesByComp?.[r]:void 0;if(i)return i;let o=t.__hyperframes?.getVariables?.();return o&&typeof o=="object"?o:t.__hfVariables??{}}function hi(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Fa(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 _d=new Set(["img","video","audio","source"]);function xb(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 yb(e){return e.replace(/[;{}<>\\r\\n]/g,"")}function vb(e){if(hi(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 Na(e,t){let n=e.closest("[data-composition-id]"),r=t.get(n);if(r)return r;let i=pi(e);return t.set(n,i),i}function Sb(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 Ab(e){return e.querySelector("[data-hf-root]")??e.getElementById("stage")??e.body?.firstElementChild??e.body}function Eb(e,t){let n=new Set,r=Ab(e);r&&n.add(r);for(let i of Array.from(e.querySelectorAll("[data-composition-id]")))n.add(i);for(let i of n){let o=Na(i,t);for(let[a,l]of Object.entries(o)){let s=vb(l);s!==null&&i instanceof HTMLElement&&i.style.setProperty(`--${a}`,yb(s))}}}function La(e){let t=new Map;Eb(e,t);for(let n of Array.from(e.querySelectorAll("[data-var-src]"))){let r=n.getAttribute("data-var-src")?.trim();if(!r)continue;if(!_d.has(n.tagName.toLowerCase())){console.warn(`[hyperframes] Ignoring data-var-src on <${n.tagName.toLowerCase()}>: variable-bound src is only allowed on ${Array.from(_d).join("/")}.`);continue}let i=xb(Na(n,t)[r]);if(i!==null){if(!Fa(i)){console.warn(`[hyperframes] Ignoring data-var-src="${r}": unsafe URL protocol.`);continue}n.setAttribute("src",i)}}for(let n of Array.from(e.querySelectorAll("[data-var-text]"))){let r=n.getAttribute("data-var-text")?.trim();if(!r)continue;let i=Na(n,t)[r];hi(i)&&Sb(n,String(i))}}var rt=new Map,wb="data-hf-color-grading-canvas",Cb="__hf_color_grading_canvas__";function Od(){if(typeof MutationObserver>"u"||typeof document>"u")return;let e=document.documentElement;if(!e)return;let t=r=>{r instanceof HTMLElement&&(r.hasAttribute($r)||r.setAttribute($r,r.style.opacity))},n=r=>{if(r instanceof Element){r.matches("video, img")&&t(r);for(let i of r.querySelectorAll("video, img"))t(i)}};n(e),new MutationObserver(r=>{for(let i of r)for(let o of i.addedNodes)n(o)}).observe(e,{childList:!0,subtree:!0})}var _b=16,Tb=4,nn={enabled:!1,position:.5,softness:0,lineWidth:2},Da=["#000000","#ffffff"],Rb=["#1a1a1a","#f5f5dc"],sr=3,kb=sr-1,Mb=5,Ia=`${je}.0`,Td=`${je-1}.0`,Fb=`${sr}.0`,Nb=`${(kb+.5)/sr}`;function gi(e){let t=e.getAttribute(Fn);return t==null?null:bu(t,pi(e))}var Lb=["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(`\n`),Db=["#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);"," float blur = clamp(u_blur, 0.0, 1.0);"," if (blur > 0.0 && u_blurReady > 0.5) base = mix(base, sampleBlur(uv), blur);"," 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);"," }"," 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;"," 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;"," }"," 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;"," float texelX = 1.0 / max(u_resolution.x * max(u_uvScale.x, 0.00001), 1.0);"," vec2 tapeUv = sampleUv + vec2(tapeShift * texelX, 0.0);"," vec4 base = samplePrepared(tapeUv);"," 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);"," }"," 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);"," }"," return base;","}","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);","}","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);","}","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);","}","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);","}","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);","}","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);","}","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));","}","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);","}","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);","}","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);","}","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) * ${Td};`," float lower = floor(position);",` float upper = min(lower + 1.0, ${Td});`,` float y = (row + 0.5) / ${Fb};`,` vec4 before = texture2D(u_advanced, vec2((lower + 0.5) / ${Ia}, y));`,` vec4 after = texture2D(u_advanced, vec2((upper + 0.5) / ${Ia}, y));`," return mix(before, after, position - lower);","}","vec4 advancedConfig(float index){",` return texture2D(u_advanced, vec2((index + 0.5) / ${Ia}, ${Nb}));`,"}","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;","}","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"," );","}","float decodeSigned(float value){ return (value * 255.0 - 128.0) / 127.0; }","vec3 applyHueCurves(vec3 color){"," if (u_hueCurvesEnabled < 0.5) return color;"," vec3 hsv = rgbToHsv(clamp(color, 0.0, 1.0));"," vec3 curves = sampleAdvancedCurve(hsv.x, 1.0).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;","}","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);"," 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);"," 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;","}","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));","}","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);","}","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);","}","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;","}","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);","}","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);","}","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);"," 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;"," 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);"," 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);"," }"," 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);"," }"," 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));"," if (u_bloomReady > 0.5 && u_bloom > 0.0) color += sampleBloom(uv) * u_bloom;"," color = applyScanlines(clamp(color, 0.0, 1.0), clamp(u_scanlines, 0.0, 1.0));"," 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;"," float warpActive = step(0.0001, u_crtCurvature);"," color *= mix(1.0, displayMask, warpActive);"," vec3 graded = clamp(color, 0.0, 1.0);"," 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;"," }"," gl_FragColor = vec4(graded, sampleColor.a);","}"].join(`\n`),Ib=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform vec2 u_resolution;","uniform vec2 u_direction;","uniform float u_radius;","uniform float u_bloomPass;","uniform float u_threshold;","vec4 readSource(vec2 uv){"," vec4 color = texture2D(u_source, clamp(uv, vec2(0.0), vec2(1.0)));"," if (u_bloomPass > 0.5) {"," float luminance = dot(color.rgb, vec3(0.299, 0.587, 0.114));"," if (u_threshold >= 0.0 && luminance <= u_threshold) color.rgb = vec3(0.0);"," return vec4(color.rgb, 1.0);"," }"," color.rgb *= color.a;"," return color;","}","void main(){"," if (u_bloomPass > 0.5) {"," vec2 stepUv = u_direction * max(u_radius, 0.0) / max(u_resolution, vec2(1.0)) * 0.5;"," vec4 bloom = readSource(v_uv) * 0.227027;"," bloom += readSource(v_uv + stepUv) * 0.1945946;"," bloom += readSource(v_uv - stepUv) * 0.1945946;"," bloom += readSource(v_uv + stepUv * 2.0) * 0.1216216;"," bloom += readSource(v_uv - stepUv * 2.0) * 0.1216216;"," bloom += readSource(v_uv + stepUv * 3.0) * 0.054054;"," bloom += readSource(v_uv - stepUv * 3.0) * 0.054054;"," bloom += readSource(v_uv + stepUv * 4.0) * 0.016216;"," bloom += readSource(v_uv - stepUv * 4.0) * 0.016216;"," gl_FragColor = bloom;"," return;"," }"," vec2 stepUv = u_direction * max(u_radius, 0.0) / max(u_resolution, vec2(1.0)) / 12.0;"," vec4 color = readSource(v_uv) * 0.08077993;"," color += readSource(v_uv + stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv - stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv + stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv - stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv + stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv - stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv + stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv - stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv + stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv - stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv + stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv - stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv + stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv - stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv + stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv - stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv + stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv - stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv + stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv - stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv + stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv - stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv + stepUv * 12.0) * 0.00453456;"," color += readSource(v_uv - stepUv * 12.0) * 0.00453456;"," if (color.a > 0.0001) color.rgb /= color.a;"," gl_FragColor = color;","}"].join(`\n`),Pb=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform sampler2D u_blurSource;","uniform vec2 u_texel;","uniform vec2 u_uvScale;","uniform vec2 u_uvOffset;","uniform float u_blurReady;","uniform float u_blur;","uniform float u_kuwaharaRadius;","vec3 readPrepared(vec2 displayUv){"," vec2 uv = (displayUv - u_uvOffset) / u_uvScale;"," vec3 color = texture2D(u_source, clamp(uv, vec2(0.0), vec2(1.0))).rgb;"," if (u_blurReady > 0.5 && u_blur > 0.0) {"," vec3 blurred = texture2D(u_blurSource, clamp(uv, vec2(0.0), vec2(1.0))).rgb;"," color = mix(color, blurred, clamp(u_blur, 0.0, 1.0));"," }"," return color;","}","void main(){"," float radius = floor(mix(2.0, 16.0, clamp(u_kuwaharaRadius, 0.0, 1.0)) + 0.5);"," vec3 sum = vec3(0.0);"," float sumSquares = 0.0;"," float count = 0.0;"," for (int offset = 0; offset <= 16; offset++) {"," if (float(offset) > radius) continue;"," vec3 color = readPrepared(v_uv + vec2(float(offset), 0.0) * u_texel);"," sum += color;"," sumSquares += dot(color, color) / 3.0;"," count += 1.0;"," }"," gl_FragColor = vec4(sum / count, sumSquares / count);","}"].join(`\n`),Ob=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_kuwaharaMoments;","uniform vec2 u_texel;","uniform float u_kuwaharaRadius;","uniform float u_kuwaharaSharpness;","uniform float u_kuwaharaSaturation;","void main(){"," float radius = floor(mix(2.0, 16.0, clamp(u_kuwaharaRadius, 0.0, 1.0)) + 0.5);"," vec2 origins[4];"," origins[0] = vec2(-radius, -radius);"," origins[1] = vec2(0.0, -radius);"," origins[2] = vec2(-radius, 0.0);"," origins[3] = vec2(0.0, 0.0);"," vec3 means[4];"," float variances[4];"," float minVariance = 1.0;"," for (int quadrant = 0; quadrant < 4; quadrant++) {"," vec4 moment = vec4(0.0);"," float count = 0.0;"," for (int offset = 0; offset <= 16; offset++) {"," if (float(offset) > radius) continue;"," vec2 sampleOffset = origins[quadrant] + vec2(0.0, float(offset));"," moment += texture2D(u_kuwaharaMoments, clamp(v_uv + sampleOffset * u_texel, vec2(0.0), vec2(1.0)));"," count += 1.0;"," }"," moment /= count;"," vec3 mean = moment.rgb;"," float meanSquare = moment.a * 3.0;"," float variance = max(meanSquare - dot(mean, mean), 0.0);"," means[quadrant] = mean;"," variances[quadrant] = variance;"," minVariance = min(minVariance, variance);"," }"," float exponent = 1.0 + clamp(u_kuwaharaSharpness, 0.0, 1.0) * 8.0;"," vec3 result = vec3(0.0);"," float totalWeight = 0.0;"," for (int quadrant = 0; quadrant < 4; quadrant++) {"," float weight = pow((minVariance + 0.0001) / (variances[quadrant] + 0.0001), exponent);"," result += means[quadrant] * weight;"," totalWeight += weight;"," }"," result /= max(totalWeight, 0.0001);"," float luma = dot(result, vec3(0.2126, 0.7152, 0.0722));"," float saturation = clamp(u_kuwaharaSaturation, 0.0, 1.0) * 2.0;"," gl_FragColor = vec4(clamp(mix(vec3(luma), result, saturation), 0.0, 1.0), 1.0);","}"].join(`\n`);function Nt(e){return e instanceof HTMLVideoElement||e instanceof HTMLImageElement}function Rd(e){let t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function kd(e,t,n){let r=e.createShader(n);return r?(e.shaderSource(r,t),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(L("runtime.colorGrading.compileShader",e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function Si(e,t=Db){let n=kd(e,Lb,e.VERTEX_SHADER),r=kd(e,t,e.FRAGMENT_SHADER);if(!n||!r)return n&&e.deleteShader(n),r&&e.deleteShader(r),null;let i=e.createProgram();return i?(e.attachShader(i,n),e.attachShader(i,r),e.linkProgram(i),e.deleteShader(n),e.deleteShader(r),e.getProgramParameter(i,e.LINK_STATUS)?i:(L("runtime.colorGrading.linkProgram",e.getProgramInfoLog(i)),e.deleteProgram(i),null)):null}function bi(e,t=e.LINEAR,n=e.UNSIGNED_BYTE){let r=e.createTexture();return r?(e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,n,null),r):null}function Hb(e,t){let n=Si(e,Ib);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),resolution:e.getUniformLocation(n,"u_resolution"),direction:e.getUniformLocation(n,"u_direction"),radius:e.getUniformLocation(n,"u_radius"),bloomPass:e.getUniformLocation(n,"u_bloomPass"),threshold:e.getUniformLocation(n,"u_threshold")}:null}function Gb(e,t){let n=Si(e,Pb);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),blurSource:e.getUniformLocation(n,"u_blurSource"),texel:e.getUniformLocation(n,"u_texel"),uvScale:e.getUniformLocation(n,"u_uvScale"),uvOffset:e.getUniformLocation(n,"u_uvOffset"),blurReady:e.getUniformLocation(n,"u_blurReady"),blur:e.getUniformLocation(n,"u_blur"),radius:e.getUniformLocation(n,"u_kuwaharaRadius")}:null}function Bb(e,t){let n=Si(e,Ob);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),moments:e.getUniformLocation(n,"u_kuwaharaMoments"),texel:e.getUniformLocation(n,"u_texel"),radius:e.getUniformLocation(n,"u_kuwaharaRadius"),sharpness:e.getUniformLocation(n,"u_kuwaharaSharpness"),saturation:e.getUniformLocation(n,"u_kuwaharaSaturation")}:null}function ir(e,t=e.UNSIGNED_BYTE,n=e.LINEAR){let r=bi(e,n,t),i=e.createFramebuffer();if(!r||!i)return r&&e.deleteTexture(r),i&&e.deleteFramebuffer(i),null;e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),o!==e.FRAMEBUFFER_COMPLETE?(e.deleteTexture(r),e.deleteFramebuffer(i),null):{texture:r,framebuffer:i,type:t,width:1,height:1}}function yi(e,t,n,r){t.width===n&&t.height===r||(t.width=n,t.height=r,e.bindTexture(e.TEXTURE_2D,t.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,r,0,e.RGBA,t.type,null))}function Pa(e,t,n){let r=[];for(let i of n){let o=e.getUniformLocation(t,`u_${i}`);o!==null&&r.push([i,o])}return r}function Md(e,t,n){t&&e.deleteProgram(t);for(let r of n)r&&e.deleteTexture(r)}function Ba(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});if(!t)return null;let n=Si(t),r=bi(t),i=bi(t,t.NEAREST),o=bi(t,t.NEAREST);if(!n||!r||!i||!o)return Md(t,n,[r,i,o]),null;let a=t.createBuffer();return a?(t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW),{gl:t,program:{program:n,texture:r,lutTexture:i,advancedTexture:o,advancedSignature:null,quad:a,position:t.getAttribLocation(n,"a_pos"),source:t.getUniformLocation(n,"u_source"),blurSource:t.getUniformLocation(n,"u_blurSource"),bloomSource:t.getUniformLocation(n,"u_bloomSource"),kuwaharaSource:t.getUniformLocation(n,"u_kuwaharaSource"),lut:t.getUniformLocation(n,"u_lut"),advanced:t.getUniformLocation(n,"u_advanced"),resolution:t.getUniformLocation(n,"u_resolution"),uvScale:t.getUniformLocation(n,"u_uvScale"),uvOffset:t.getUniformLocation(n,"u_uvOffset"),blurReady:t.getUniformLocation(n,"u_blurReady"),bloomReady:t.getUniformLocation(n,"u_bloomReady"),kuwaharaReady:t.getUniformLocation(n,"u_kuwaharaReady"),lutEnabled:t.getUniformLocation(n,"u_lutEnabled"),lutSize:t.getUniformLocation(n,"u_lutSize"),lutTextureSize:t.getUniformLocation(n,"u_lutTextureSize"),lutDomainMin:t.getUniformLocation(n,"u_lutDomainMin"),lutDomainMax:t.getUniformLocation(n,"u_lutDomainMax"),lutIntensity:t.getUniformLocation(n,"u_lutIntensity"),shadowWheel:t.getUniformLocation(n,"u_shadowWheel"),midtoneWheel:t.getUniformLocation(n,"u_midtoneWheel"),highlightWheel:t.getUniformLocation(n,"u_highlightWheel"),rgbCurvesEnabled:t.getUniformLocation(n,"u_rgbCurvesEnabled"),hueCurvesEnabled:t.getUniformLocation(n,"u_hueCurvesEnabled"),secondaryCount:t.getUniformLocation(n,"u_secondaryCount"),adjustUniforms:Pa(t,n,jr),detailUniforms:Pa(t,n,Lo),effectUniforms:Pa(t,n,Do),grainSeed:t.getUniformLocation(n,"u_grainSeed"),effectTime:t.getUniformLocation(n,"u_effectTime"),paletteSize:t.getUniformLocation(n,"u_paletteSize"),palette0:t.getUniformLocation(n,"u_palette0"),palette1:t.getUniformLocation(n,"u_palette1"),palette2:t.getUniformLocation(n,"u_palette2"),palette3:t.getUniformLocation(n,"u_palette3"),palette4:t.getUniformLocation(n,"u_palette4"),palette5:t.getUniformLocation(n,"u_palette5"),intensity:t.getUniformLocation(n,"u_intensity"),compareEnabled:t.getUniformLocation(n,"u_compareEnabled"),comparePosition:t.getUniformLocation(n,"u_comparePosition"),compareSoftness:t.getUniformLocation(n,"u_compareSoftness"),compareLineWidth:t.getUniformLocation(n,"u_compareLineWidth")}}):(Md(t,n,[r,i,o]),null)}function Ub(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Wb(e){if(!Ub(e))return{...nn};let t=(n,r,i,o)=>{let a=typeof n=="number"?n:Number(n);return Math.min(o,Math.max(i,Number.isFinite(a)?a:r))};return{enabled:e.enabled===!0,position:t(e.position,nn.position,0,1),softness:t(e.softness,nn.softness,0,.25),lineWidth:t(e.lineWidth,nn.lineWidth,0,12)}}function Hd(e){try{let t=new URL(e,document.baseURI);return t.protocol==="data:"?{href:t.href}:t.protocol!=="http:"&&t.protocol!=="https:"?{error:"LUT must be project-local or a data URL"}:t.origin!==window.location.origin?{error:"Remote LUT URLs are not supported"}:{href:t.href}}catch{return{error:"Invalid LUT URL"}}}function Ai(e){return e instanceof Error?e.message:"LUT failed to load"}function Vb(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0)%1e4}function Gd(e){let t=e.id||e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return Vb(t)}function Ua(e){let t=Hd(e);if("error"in t)return{state:"error",message:t.error};let n=rt.get(t.href);if(n)return n;let r=fetch(t.href,{credentials:"same-origin"}).then(o=>{if(!o.ok)throw new Error(`Failed to load LUT (${o.status})`);return o.text()}).then(o=>Kl(o,{maxSize:Vr})),i={state:"pending",promise:r};for(;rt.size>=_b;){let o=rt.keys().next().value;if(!o)break;rt.delete(o)}return rt.set(t.href,i),r.then(o=>{rt.get(t.href)===i&&rt.set(t.href,{state:"ready",lut:o})},o=>{rt.get(t.href)===i&&rt.set(t.href,{state:"error",message:Ai(o)})}),i}function Fd(e,t,n){if(e.lut?.src===t)return e.lut;let r=wo(n),{gl:i,program:o}=e;try{return Bd(i,o.lutTexture,r),e.lut={src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height},e.lutError=null,e.lutLoadingSrc=null,e.lut}catch(a){return e.lut=null,e.lutError=Ai(a),e.lutLoadingSrc=null,L("runtime.colorGrading.uploadLut",a),null}}async function zb(e){let t=Ua(e);if(t.state==="ready")return t.lut;if(t.state==="pending")return t.promise;throw new Error(t.message)}function Bd(e,t,n){e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)}function qb(e,t,n){let r=wo(n),{gl:i,program:o}=e;return Bd(i,o.lutTexture,r),{src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height}}function Xe(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function Wa(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),Xe(e.gl,t.scratch),Xe(e.gl,t.blur),t.bloom&&Xe(e.gl,t.bloom),e.effectTargets=null)}function Va(e){let t=e.kuwaharaTargets;t&&(e.gl.deleteProgram(t.horizontalProgram.program),e.gl.deleteProgram(t.resolveProgram.program),Xe(e.gl,t.moments),Xe(e.gl,t.output),e.kuwaharaTargets=null)}function xi(e,t=!1){Wa(e),Va(e),$b(e.gl,e.program),t&&e.gl.getExtension("WEBGL_lose_context")?.loseContext()}function $b(e,t){e.deleteTexture(t.texture),e.deleteTexture(t.lutTexture),e.deleteTexture(t.advancedTexture),e.deleteBuffer(t.quad),e.deleteProgram(t.program)}function jb(e){let t=Ba(e.canvas);return t?(xi(e),e.gl=t.gl,e.program=t.program,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function Ga(e){if(!e.sourceHidden)return;e.element.removeAttribute(Nn);let t=e.element.style.getPropertyValue("opacity"),n=e.element.style.getPropertyPriority("opacity");t==="0"&&n==="important"&&(e.sourceInlineOpacity===null?e.element.style.removeProperty("opacity"):e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority)),e.sourceHidden=!1}function Kb(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=Hb(t,e.program.quad),r=ir(t),i=ir(t);return!n||!r||!i?(n&&t.deleteProgram(n.program),r&&Xe(t,r),i&&Xe(t,i),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:r,blur:i,bloom:null},e.effectTargets)}function Yb(e,t){return t.bloom||(t.bloom=ir(e.gl),e.effectError=t.bloom?null:"Framebuffer effects unavailable"),t.bloom}function Nd(e){let t=e.effectTargets;t?.bloom&&(Xe(e.gl,t.bloom),t.bloom=null)}function Xb(e){if(e.kuwaharaTargets)return e.kuwaharaTargets;let{gl:t}=e,n=t.getExtension("OES_texture_half_float"),r=t.getExtension("EXT_color_buffer_half_float");if(!n||!r)return e.effectError="Kuwahara requires half-float framebuffer support",null;let i=Gb(t,e.program.quad),o=Bb(t,e.program.quad),a=ir(t,n.HALF_FLOAT_OES,t.NEAREST),l=ir(t);return!i||!o||!a||!l?(Jb(t,i,o,a,l),e.effectError="Kuwahara framebuffer effects unavailable",null):(e.kuwaharaTargets={horizontalProgram:i,resolveProgram:o,moments:a,output:l},e.kuwaharaTargets)}function Jb(e,t,n,r,i){t&&e.deleteProgram(t.program),n&&e.deleteProgram(n.program),r&&Xe(e,r),i&&Xe(e,i)}function Ud(e,t,n,r,i){let o=Math.max(1,Math.ceil(r)),a=Math.max(1,Math.ceil(i));return yi(e,t,o,a),yi(e,n,o,a),{width:o,height:a}}function vi(e,t,n,r,i,o,a,l=!1,s=-1){e.bindFramebuffer(e.FRAMEBUFFER,r.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(t.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(t.source,0),e.uniform2f(t.resolution,i.width,i.height),e.uniform2f(t.direction,o.x,o.y),e.uniform1f(t.radius,a),e.uniform1f(t.bloomPass,l?1:0),e.uniform1f(t.threshold,s),or(e,t)}function Qb(e,t,n,r,i,o,a){let l=Ud(e,t.scratch,r,i/2,o/2),s=a/2;vi(e,t.blurProgram,n,t.scratch,l,{x:1,y:0},s,!0,.5),vi(e,t.blurProgram,t.scratch.texture,r,l,{x:0,y:1},s,!0)}function Zb(e,t,n,r,i,o,a){let l=n;for(let s=0;s<Math.max(1,Math.floor(a));s++)vi(e,t.blurProgram,l,t.scratch,i,{x:1,y:0},o),vi(e,t.blurProgram,t.scratch.texture,r,i,{x:0,y:1},o),l=r.texture}function or(e,t){e.bindBuffer(e.ARRAY_BUFFER,t.quad),e.enableVertexAttribArray(t.position),e.vertexAttribPointer(t.position,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLE_STRIP,0,4)}function ex(e,t,n,r,i,o,a,l){yi(e,t.moments,i.width,i.height),yi(e,t.output,i.width,i.height);let s=t.horizontalProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.moments.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(s.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,r),e.uniform1i(s.source,0),e.uniform1i(s.blurSource,1),e.uniform2f(s.texel,1/i.width,1/i.height),e.uniform2f(s.uvScale,o.scaleX,o.scaleY),e.uniform2f(s.uvOffset,o.offsetX,o.offsetY),e.uniform1f(s.blurReady,a?1:0),e.uniform1f(s.blur,l.blur),e.uniform1f(s.radius,l.kuwaharaRadius),or(e,s);let u=t.resolveProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.output.framebuffer),e.useProgram(u.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.moments.texture),e.uniform1i(u.moments,0),e.uniform2f(u.texel,1/i.width,1/i.height),e.uniform1f(u.radius,l.kuwaharaRadius),e.uniform1f(u.sharpness,l.kuwaharaSharpness),e.uniform1f(u.saturation,l.kuwaharaSaturation),or(e,u)}function tx(e,t,n,r){if(n<=0)return!1;let i=Ud(e.gl,t.scratch,t.blur,r.width,r.height);return Zb(e.gl,t,e.program.texture,t.blur,i,.75+Math.pow(n,1.35)*32,n>.55?3:2),!0}function nx(e,t,n,r,i,o){if(n<=0)return Nd(e),null;o||Nd(e);let a=o?Yb(e,t):t.blur;return a?(Qb(e.gl,t,e.program.texture,a,i.width,i.height,r),a.texture):null}function rx(e,t,n,r){let{program:i}=e,o=t.effects.blur,a=t.effects.bloom;if(o<=0&&a<=0)return e.effectTargets&&r&&Wa(e),{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let l=Kb(e);if(!l)return{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let s=tx(e,l,o,n),u=nx(e,l,a,t.effects.bloomRadius,n,s);return{blurReady:s,bloomReady:u!==null,blurTexture:l.blur.texture,bloomTexture:u??i.texture}}function ix(e,t,n,r,i,o,a){let l=t.effects.kuwahara;if(l<=0&&!o)return e.kuwaharaTargets&&a&&Va(e),{kuwaharaReady:!1,kuwaharaTexture:e.program.texture};let s=Xb(e);return!s||l<=0?{kuwaharaReady:!1,kuwaharaTexture:s?.output.texture??e.program.texture}:(ex(e.gl,s,e.program.texture,e.effectTargets?.blur.texture??e.program.texture,n,r,i,t.effects),{kuwaharaReady:!0,kuwaharaTexture:s.output.texture})}function Wd(e,t,n,r,i={}){let o=i.releaseIdleTargets??!0;e.effectError=null;let a=rx(e,t,n,o),l=ix(e,t,n,r,a.blurReady,i.preserveKuwahara??!1,o);return{...a,...l}}function ox(e){let t=e.grading.lut?.src.trim()??"",n=e.grading.lut?.intensity??1;if(!t||n<=0)return e.lut=null,e.lutLoadingSrc=null,e.lutError=null,null;let r=Hd(t);if("error"in r)return e.lut=null,e.lutLoadingSrc=null,e.lutError=r.error,null;if(e.lut?.src===r.href)return e.lut;e.lut=null;let i=Ua(t);return i.state==="ready"?Fd(e,r.href,i.lut):i.state==="error"?(e.lutError=i.message,e.lutLoadingSrc=null,null):(e.lutLoadingSrc!==r.href&&(e.lutLoadingSrc=r.href,e.lutError=null,i.promise.then(o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(Fd(e,r.href,o),De(e))},o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=Ai(o),e.lutLoadingSrc=null,De(e))})),null)}function nr(e){if(!e)return null;if(typeof e=="string"){let t=e.trim();if(!t)return null;let n=document.getElementById(t.replace(/^#/,""));if(n&&Nt(n))return n;try{let r=document.querySelector(t);return r&&Nt(r)?r:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&Nt(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&Nt(t))return t}if(!e.selector)return null;try{let t=Array.from(document.querySelectorAll(e.selector)),n=Math.max(0,Math.floor(Number(e.selectorIndex??0)||0)),r=t[n]??null;return r&&Nt(r)?r:null}catch{return null}}function Vd(e){return e instanceof HTMLVideoElement?e.videoWidth>0&&e.videoHeight>0?{width:e.videoWidth,height:e.videoHeight}:null:e instanceof HTMLImageElement&&e.naturalWidth>0&&e.naturalHeight>0?{width:e.naturalWidth,height:e.naturalHeight}:null}function zd(e){return e instanceof HTMLVideoElement?e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&e.videoWidth>0&&e.videoHeight>0:e instanceof HTMLImageElement?e.complete&&e.naturalWidth>0&&e.naturalHeight>0:!1}function qd(e){let t=ut(e);return t&&zd(t)?t:null}function Ld(e){if(!(e instanceof HTMLVideoElement))return!1;let t=qd(e);if(!t)return!1;let n=window.getComputedStyle(t);return n.display!=="none"&&n.visibility!=="hidden"}function ax(e){return e instanceof HTMLImageElement&&e.classList.contains("__render_frame__")}function sx(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}function $d(e){if(e instanceof HTMLVideoElement){let t=qd(e);if(t)return t}return zd(e)?e:null}function Dd(e,t){let n=e.toLowerCase();if(n==="center")return .5;if(t==="x"){if(n==="left")return 0;if(n==="right")return 1}else{if(n==="top")return 0;if(n==="bottom")return 1}if(n.endsWith("%")){let r=Number.parseFloat(n);return Number.isFinite(r)?r/100:null}return null}function lx(e){let t=e.trim().split(/\\s+/).filter(Boolean),n=.5,r=.5;for(let i=0;i<t.length;i++){let o=t[i]??"",a=Dd(o,"x"),l=Dd(o,"y");if(a!==null&&(o==="left"||o==="right"||o.endsWith("%")&&i===0)){n=a;continue}if(l!==null&&(o==="top"||o==="bottom"||o.endsWith("%")&&i>0)){r=l;continue}}return{x:n,y:r}}function jd(e,t,n,r,i,o){if(e<=0||t<=0||n<=0||r<=0)return{scaleX:1,scaleY:1,offsetX:0,offsetY:0};let a=i||"fill",l=e,s=t;if(a==="contain"||a==="cover"||a==="scale-down"){let m=a==="cover"?Math.max(e/n,t/r):Math.min(e/n,t/r);l=n*m,s=r*m,a==="scale-down"&&l>n&&s>r&&(l=n,s=r)}else a==="none"&&(l=n,s=r);let u=lx(o||"center"),c=(e-l)*u.x/e,f=(t-s)*u.y/t;return{scaleX:l/e,scaleY:s/t,offsetX:c,offsetY:f}}function ux(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function Id(e,t){return Math.max(0,Math.round(e>0?e:t))}function cx(e,t){let{element:n,canvas:r}=e,i=n.parentElement;i&&ux(e,i);let o=window.getComputedStyle(t);vu(r.style,o),r.style.pointerEvents="none",r.style.position="absolute",r.style.inset="auto",r.style.left=`${n.offsetLeft}px`,r.style.top=`${n.offsetTop}px`,r.style.right="auto",r.style.bottom="auto",r.style.width=`${n.offsetWidth}px`,r.style.height=`${n.offsetHeight}px`,r.style.display="block",r.style.opacity=e.sourceOpacityForCanvas,r.style.visibility=e.sourceVisibleForCanvas?"visible":"hidden";let a=n.getBoundingClientRect(),l=Id(n.offsetWidth,a.width),s=Id(n.offsetHeight,a.height);if(l<=0||s<=0)return r.style.display="none",null;let u=Math.max(1,window.devicePixelRatio||1),c=Math.round(l*u),f=Math.round(s*u);return r.width!==c&&(r.width=c),r.height!==f&&(r.height=f),{width:c,height:f}}function tn(e,t,n){e.uniform3f(t,Number.parseInt(n.slice(1,3),16)/255,Number.parseInt(n.slice(3,5),16)/255,Number.parseInt(n.slice(5,7),16)/255)}function Lt(e,t,n,r){e.set(r,(t*je+n)*4)}function yt(e,t){return Math.min(1,Math.max(1/255,(e*(127/t)+128)/255))}function Oa(e,t,n){return e.length>=3?_o(e,t,n):new Float32Array(je)}function Ft(e,t){return e[t]??0}function dx(e,t,n){let r=Vt(t.red),i=Vt(t.green),o=Vt(t.blue),a=Vt(t.master),l=Oa(n.hueVsHue,-180,180),s=Oa(n.hueVsSaturation,-1,1),u=Oa(n.hueVsLuma,-1,1);for(let c=0;c<je;c+=1)Lt(e,0,c,[Ft(r,c),Ft(i,c),Ft(o,c),Ft(a,c)]),Lt(e,1,c,[yt(Ft(l,c),180),yt(Ft(s,c),1),yt(Ft(u,c),1),1])}function fx(e,t,n){let r=n*Mb;Lt(e,2,r,[t.key.hue.center/360,t.key.hue.range/180,t.key.hue.softness/180,1]),Lt(e,2,r+1,[t.key.saturation.min,t.key.saturation.max,t.key.saturation.softness/.5,0]),Lt(e,2,r+2,[t.key.luma.min,t.key.luma.max,t.key.luma.softness/.5,0]),Lt(e,2,r+3,[yt(t.correction.hueShift,180),yt(t.correction.saturation,1),yt(t.correction.luma,1),yt(t.correction.temperature,1)]),Lt(e,2,r+4,[yt(t.correction.tint,1),.5,.5,1])}function mx(e,t,n){let r=new Float32Array(je*sr*4);dx(r,e,t);let i=0;for(let o of n)o.enabled&&(fx(r,o,i),i+=1);return r}var Pd=new WeakMap;function px(e,t,n){let r=Pd.get(e);if(r?.hueCurves===t&&r.secondaries===n)return r.signature;let i=JSON.stringify([e,t,n]);return Pd.set(e,{hueCurves:t,secondaries:n,signature:i}),i}function hx(e,t,n,r){let{curves:i,hueCurves:o}=n,a=px(i,o,r);if(t.advancedSignature===a)return;let l=Uint8Array.from(mx(i,o,r),kn);e.activeTexture(e.TEXTURE5),e.bindTexture(e.TEXTURE_2D,t.advancedTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,je,sr,0,e.RGBA,e.UNSIGNED_BYTE,l),t.advancedSignature=a}function Ha(e,t,n){e.uniform3f(t,n.hue/360,n.amount,n.level)}function Kd(e,t,n,r,i,o,a,l,s,u,c,f){e.uniform1i(t.source,0),e.uniform1i(t.blurSource,1),e.uniform1i(t.lut,2),e.uniform1i(t.kuwaharaSource,3),e.uniform1i(t.bloomSource,4),e.uniform1i(t.advanced,5),e.uniform2f(t.resolution,s.width,s.height),e.uniform2f(t.uvScale,u.scaleX,u.scaleY),e.uniform2f(t.uvOffset,u.offsetX,u.offsetY),e.uniform1f(t.blurReady,i?1:0),e.uniform1f(t.bloomReady,o?1:0),e.uniform1f(t.kuwaharaReady,a?1:0),e.uniform1f(t.lutEnabled,r?1:0),e.uniform1f(t.lutSize,r?.size??2),e.uniform2f(t.lutTextureSize,r?.textureWidth??1,r?.textureHeight??1),e.uniform3f(t.lutDomainMin,r?.domainMin[0]??0,r?.domainMin[1]??0,r?.domainMin[2]??0),e.uniform3f(t.lutDomainMax,r?.domainMax[0]??1,r?.domainMax[1]??1,r?.domainMax[2]??1),e.uniform1f(t.lutIntensity,n.lut?.intensity??0);let{curves:m,hueCurves:p,secondaries:b}=n,v=Oo(m),x=Ho(p),_=Go(b)?b.reduce((M,D)=>M+Number(D.enabled),0):0;(v||x||_>0)&&hx(e,t,n,b),Ha(e,t.shadowWheel,n.wheels.shadows),Ha(e,t.midtoneWheel,n.wheels.midtones),Ha(e,t.highlightWheel,n.wheels.highlights),e.uniform1f(t.rgbCurvesEnabled,v?1:0),e.uniform1f(t.hueCurvesEnabled,x?1:0),e.uniform1f(t.secondaryCount,_);for(let[M,D]of t.adjustUniforms)e.uniform1f(D,n.adjust[M]);for(let[M,D]of t.detailUniforms)e.uniform1f(D,n.details[M]);e.uniform1f(t.grainSeed,c),e.uniform1f(t.effectTime,f);for(let[M,D]of t.effectUniforms)e.uniform1f(D,n.effects[M]);let R=n.palette??(n.effects.engraving>0||n.effects.crosshatch>0?Rb:Da),T=R[R.length-1]??Da[1];e.uniform1f(t.paletteSize,R.length),tn(e,t.palette0,R[0]??Da[0]),tn(e,t.palette1,R[1]??T),tn(e,t.palette2,R[2]??T),tn(e,t.palette3,R[3]??T),tn(e,t.palette4,R[4]??T),tn(e,t.palette5,R[5]??T),e.uniform1f(t.intensity,n.intensity),e.uniform1f(t.compareEnabled,l.enabled?1:0),e.uniform1f(t.comparePosition,l.position),e.uniform1f(t.compareSoftness,l.softness),e.uniform1f(t.compareLineWidth,l.lineWidth)}function gx(e){if(!e.sourceHidden){let t=e.element.getAttribute($r);t!==null?(e.sourceInlineOpacity=t===""?null:t,e.sourceInlineOpacityPriority=""):(e.sourceInlineOpacity=e.element.style.getPropertyValue("opacity")||null,e.sourceInlineOpacityPriority=e.element.style.getPropertyPriority("opacity"))}e.element.setAttribute(Nn,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function it(e){let t=pu.find(n=>n.path===e);if(!t)throw new Error(`Missing color-grading animation property: ${e}`);return t}var Yd=it("intensity"),Xd=it("lut.intensity"),Jd=it("adjust.exposure"),Qd=it("effects.kuwahara"),Zd=[["blur",it("effects.blur")],["bloom",it("effects.bloom")],["kuwahara",Qd],["pixelate",it("effects.pixelate")],["ascii",it("effects.ascii")],["dither",it("effects.dither")]],ef=[Yd,Xd,Jd,...Zd.map(([,e])=>e)];function Dt(e,t){let n=e.style.getPropertyValue(t.name);if(!n)return null;let r=Number(n);return Number.isFinite(r)?Math.min(t.max,Math.max(t.min,r)):null}function rr(e,t){return t!==null&&(xu(t)||ef.some(n=>Dt(e,n)!==null))}function bx(e,t){let n=null;for(let[r,i]of Zd){let o=Dt(e,i);o!==null&&(n??(n={...t.effects}),n[r]=o)}return n}function xx(e){let{element:t,grading:n}=e,r=Dt(t,Yd),i=Dt(t,Xd),o=Dt(t,Jd),a=bx(t,n);if(![r,i,o].some(u=>u!==null)&&a===null)return n;let s={...n,adjust:o===null?n.adjust:{...n.adjust,exposure:o},effects:a??n.effects};return r!==null&&(s.intensity=r),n.lut&&i!==null&&(s.lut={...n.lut,intensity:i}),s}function tf(e,t,n){e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)}function nf(e,t,n){let r=[t.texture,n.blurTexture,t.lutTexture,n.kuwaharaTexture,n.bloomTexture,t.advancedTexture];for(let[i,o]of r.entries())e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,o)}function De(e){if(e.destroyed||e.contextLost)return!1;let t=$d(e.element);if(!t)return e.hasDrawn||(e.canvas.style.display="none"),!1;let n=Vd(t);if(!n)return!1;let r=t instanceof HTMLElement?t:e.element,i=e.element.style.getPropertyValue("opacity"),o=e.element.style.getPropertyPriority("opacity"),a=e.sourceHidden&&i==="0"&&o==="important",l=e.element.style.getPropertyValue("visibility"),s=ax(t);s&&sx(e,t),a&&!s&&(e.sourceInlineOpacity!==null?e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority||""):e.element.style.removeProperty("opacity"));let u=window.getComputedStyle(s?t:e.element);e.sourceOpacityForCanvas=u.opacity||"1",a&&!s&&e.element.style.setProperty("opacity","0","important"),e.sourceVisibleForCanvas=(s||l!=="hidden")&&u.visibility!=="hidden";let c=cx(e,r);if(!c)return!1;let f=window.getComputedStyle(r),m=jd(c.width,c.height,n.width,n.height,f.objectFit,f.objectPosition),{gl:p,program:b}=e;try{let v=xx(e),x=ox(e);tf(p,b.texture,t);let _=Dt(e.element,Qd)!==null,R=Wd(e,v,c,m,{preserveKuwahara:_});p.bindFramebuffer(p.FRAMEBUFFER,null),p.viewport(0,0,c.width,c.height),p.useProgram(b.program),nf(p,b,R);let T=window.__player?.getTime?.(),M=typeof T=="number"&&Number.isFinite(T)?Math.max(0,T):e.element instanceof HTMLVideoElement?Math.max(0,e.element.currentTime):0,D=e.grainSeed+Math.floor(M*60);return Kd(p,b,v,x,R.blurReady,R.bloomReady,R.kuwaharaReady,e.compare,c,m,D,M),or(p,b),gx(e),e.hasDrawn=!0,e.drawError=null,!0}catch(v){return e.drawError=v instanceof Error?v.message:"Shader draw failed",L("runtime.colorGrading.drawEntry",v),!1}}function yx(e,t,n){let r=e.getBoundingClientRect(),i=e.offsetWidth||r.width||t.width,o=e.offsetHeight||r.height||t.height,a=Math.min(320,Math.max(64,Math.round(n??160))),l=i>0&&o>0?i/o:t.width/t.height;return l>=1?{width:a,height:Math.max(1,Math.round(a/l))}:{width:Math.max(1,Math.round(a*l)),height:a}}function vx(){let e=document.createElement("canvas"),t=Ba(e);return t?{canvas:e,...t,lut:null,effectTargets:null,kuwaharaTargets:null,effectError:null}:null}function Sx(e,t){let n=t?void 0:window.__player?.getTime?.();return typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):e instanceof HTMLVideoElement?Math.max(0,e.currentTime):0}function Ax(e,t,n,r){let i=$d(t);if(!i)return null;let o=Vd(i);if(!o)return null;let a=yx(t,o,n);e.canvas.width=a.width,e.canvas.height=a.height;let l=i instanceof HTMLElement?i:t,s=window.getComputedStyle(l),u=jd(a.width,a.height,o.width,o.height,s.objectFit,s.objectPosition);return tf(e.gl,e.program.texture,i),{dimensions:a,uv:u,effectTime:Sx(t,r),grainSeed:Gd(t)+(t instanceof HTMLVideoElement?Math.floor(t.currentTime*60):0)}}async function Ex(e,t,n,r,i=!1){let o=Ax(e,t,r,i);if(!o)return null;let{dimensions:a,uv:l,grainSeed:s,effectTime:u}=o,c=[];for(let f of n.slice(0,32)){let m=Kr(f.grading);if(!m){c.push({id:f.id,dataUrl:null,error:"Invalid grading"});continue}let p=null;try{m.lut&&(e.lut?.src!==m.lut.src&&(e.lut=qb(e,m.lut.src,await zb(m.lut.src))),p=e.lut),c.push({id:f.id,dataUrl:wx(e,m,p,a,l,s,u)})}catch(b){c.push({id:f.id,dataUrl:null,error:Ai(b)})}}return{...a,images:c}}function wx(e,t,n,r,i,o,a){let{canvas:l,gl:s,program:u}=e,c=Wd(e,t,r,i,{releaseIdleTargets:!1});return s.bindFramebuffer(s.FRAMEBUFFER,null),s.viewport(0,0,r.width,r.height),s.useProgram(u.program),nf(s,u,c),n||(e.lut=null),Kd(s,u,t,n,c.blurReady,c.bloomReady,c.kuwaharaReady,nn,r,i,o,a),or(s,u),l.toDataURL("image/png")}function Ye(e,t,n,r){t.addEventListener(n,r),e.cleanup.push(()=>t.removeEventListener(n,r))}function Cx(e){e.animationFrame!==null&&(window.cancelAnimationFrame(e.animationFrame),e.animationFrame=null),e.videoFrameHandle!==null&&e.element instanceof HTMLVideoElement&&(e.element.cancelVideoFrameCallback?.(e.videoFrameHandle),e.videoFrameHandle=null)}function ar(e){if(e.destroyed||!(e.element instanceof HTMLVideoElement)||e.videoFrameHandle!==null||e.animationFrame!==null)return;let t=e.element,n=t;if(typeof n.requestVideoFrameCallback=="function"){e.videoFrameHandle=n.requestVideoFrameCallback(()=>{e.videoFrameHandle=null,De(e),!e.destroyed&&!t.paused&&!t.ended&&ar(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,De(e),!e.destroyed&&!t.paused&&!t.ended&&ar(e)})}function _x(e){let t=()=>{De(e)};if(Ye(e,e.element,"load",t),Ye(e,e.element,"loadedmetadata",t),Ye(e,e.element,"loadeddata",t),Ye(e,e.element,"seeked",t),Ye(e,e.element,"timeupdate",t),Ye(e,window,"resize",t),e.element instanceof HTMLVideoElement&&(Ye(e,e.element,"play",()=>ar(e)),Ye(e,e.element,"pause",t)),Ye(e,e.canvas,"webglcontextlost",n=>{n.preventDefault(),e.contextLost=!0,e.drawError="WebGL context lost",e.canvas.style.display="none",Ga(e)}),Ye(e,e.canvas,"webglcontextrestored",()=>{if(e.contextLost=!1,!jb(e)){e.contextLost=!0,e.drawError="WebGL context restore failed",Ga(e);return}e.drawError=null,De(e)}),typeof ResizeObserver<"u"&&(e.resizeObserver=new ResizeObserver(t),e.resizeObserver.observe(e.element)),typeof MutationObserver<"u"){let n=()=>{let a=e.element.style;return`${a.transform}|${a.translate}|${a.rotate}|${a.scale}|${a.left}|${a.top}|${a.width}|${a.height}`},r=n(),i=!1,o=new MutationObserver(()=>{i||n()!==r&&(i=!0,requestAnimationFrame(()=>{i=!1,r=n(),De(e)}))});o.observe(e.element,{attributes:!0,attributeFilter:["style"]}),e.cleanup.push(()=>o.disconnect())}}function Tx(e){if(e.destroyed)return null;e.destroyed=!0,Cx(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();return e.cleanup.length=0,e.canvas.remove(),Wa(e),Va(e),Ga(e),e.touchedParent&&(e.parentInlinePosition===null?e.touchedParent.style.removeProperty("position"):e.touchedParent.style.position=e.parentInlinePosition),{canvas:e.canvas,gl:e.gl,program:e.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}function rf(e,t){return e.removeAttribute("style"),t.id?e.id=`${uu}${t.id}`:e.removeAttribute("id"),e.className=Cb,e.setAttribute(wb,"true"),e.setAttribute("data-hyperframes-ignore",""),e.setAttribute("data-hyperframes-picker-ignore",""),e.setAttribute("data-hf-ignore",""),e.setAttribute("aria-hidden","true"),e.style.pointerEvents="none",e.style.display="none",t.parentNode?.insertBefore(e,t.nextSibling),e}function Rx(e){return rf(document.createElement("canvas"),e)}function of(){let e=new WeakMap,t=new Set,n=[],r=null,i=null,o=Promise.resolve(),a=!1,l=(E,S,A)=>{let C=e.get(E);if(C)return C.grading=S,C.source=A,De(C),E instanceof HTMLVideoElement&&!E.paused&&ar(C),!0;let F=n.pop();if(F)rf(F.canvas,E);else{let q=Rx(E),W=Ba(q);if(!W)return q.remove(),!1;F={canvas:q,gl:W.gl,program:W.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}let I={element:E,...F,grading:S,compare:{...nn},lut:null,lutLoadingSrc:null,lutError:null,drawError:null,effectTargets:null,kuwaharaTargets:null,effectError:null,source:A,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(E).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(E).visibility!=="hidden",hasDrawn:!1,contextLost:!1,grainSeed:Gd(E),destroyed:!1};return e.set(E,I),t.add(E),_x(I),De(I),E instanceof HTMLVideoElement&&!E.paused&&ar(I),!0},s=(E,S)=>{if(a)return!1;let A=nr(E);if(!A)return!1;let C=e.get(A);if(!C){let F=gi(A);if(!rr(A,F)||!l(A,F,"attribute"))return!1;C=e.get(A)}return C?(C.compare=Wb(S),De(C),!0):!1},u=E=>{let S=e.get(E);if(!S)return;let A=Tx(S);A&&(S.contextLost||n.length>=Tb?xi(A,!0):n.push(A)),e.delete(E),t.delete(E)},c=()=>{if(a)return 0;let E=new Set;document.querySelectorAll(`video[${Fn}], img[${Fn}]`).forEach(A=>{if(!Nt(A))return;E.add(A);let C=gi(A);rr(A,C)&&(Rd(A)||Ld(A))?l(A,C,"attribute"):u(A)});for(let A of t){let C=e.get(A);C&&(!A.isConnected||C.source==="attribute"&&!E.has(A))&&u(A)}return t.size},f=()=>{if(a)return 0;let E=0;for(let S of t){let A=e.get(S);A&&De(A)&&(E+=1)}return E},m=async()=>{let E=new Set;for(let S of t){let A=e.get(S)?.grading.lut;if(!A?.src.trim()||(A.intensity??1)<=0)continue;let C=Ua(A.src);C.state==="pending"&&E.add(C.promise)}return E.size>0&&await Promise.allSettled(E),f(),E.size},p=()=>{if(a)return 0;let E=0;for(let S of t){let A=e.get(S);!A||!ef.some(F=>Dt(S,F)!==null)||S instanceof HTMLVideoElement&&!S.paused&&!S.ended||De(A)&&(E+=1)}return E},b=(E,S)=>{if(a)return!1;let A=nr(E);if(!A)return!1;let C=Kr(S);return rr(A,C)?l(A,C,"live"):(u(A),!0)},v=(E,S)=>{if(!Nt(E))return!1;let A=e.get(E);if(!A){if(!S)return!1;let C=gi(E);return rr(E,C)&&l(E,C,"attribute")}return A.sourceVisibleForCanvas=S,!S&&A.source==="attribute"&&u(E),!0},x=E=>{let S=nr(E);if(!S)return{state:"missing",message:"Media not found"};let A=e.get(S);if(A)return A.effectError?{state:"unavailable",message:A.effectError}:A.drawError?{state:"unavailable",message:A.drawError}:A.lutError?{state:"unavailable",message:`LUT error: ${A.lutError}`}:A.grading.lut&&A.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:A.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:A.lut?"Shader + LUT active":"Shader active"};let C=gi(S);return rr(S,C)?!Rd(S)&&!Ld(S)?{state:"pending",message:"Waiting for visible media"}:{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},_=async(E,S,A)=>{let C=async()=>{if(a||S.length===0)return null;let I=nr(E);return!I||(i??(i=vx()),!i)?null:Ex(i,I,S,A?.maxDimension,A?.useMediaTime)},F=o.then(C,C);return o=F.then(()=>{},()=>{}),F},R=E=>{let S=nr(E);if(!(S instanceof HTMLVideoElement))return null;if(!S.paused)return()=>{};let A=S.currentTime,C=S.loop,F=S.muted;return S.loop=!0,S.muted=!0,(S.ended||Number.isFinite(S.duration)&&A>=S.duration)&&(S.currentTime=0),S.play().catch(()=>{}),()=>{S.pause(),S.loop=C,S.muted=F,S.currentTime=A}},T=()=>{if(!a){a=!0,r?.disconnect(),r=null;for(let E of t)u(E);for(let E of n)xi(E,!0);n.length=0,i&&(xi(i,!0),i=null)}};document.body&&(r=new MutationObserver(()=>c()),r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[Fn]}));let M={refresh:c,redraw:f,redrawAnimated:p,waitForActiveLuts:m,setGrading:b,setCompare:s,setSourceVisibility:v,getStatus:x,renderPreviews:_,startPreviewPlayback:R,destroy:T},D=window;return D.__hf=D.__hf||{},D.__hf.colorGrading=M,c(),M}var Ei=class{constructor(t){ge(this,"_baseTime",0);ge(this,"_playStartMs",null);ge(this,"_rate",1);ge(this,"_duration",1/0);ge(this,"_nowMs");ge(this,"_audioSource",null);this._baseTime=t?.initialTime??0,this._rate=t?.rate??1,this._duration=t?.duration??1/0,this._nowMs=t?.nowMs??(()=>performance.now())}now(){if(this._playStartMs===null)return this._baseTime;if(this._audioSource){let r=null;if("currentTimeSeconds"in this._audioSource)r=this._audioSource.currentTimeSeconds;else{let{el:i,compositionStart:o,mediaStart:a}=this._audioSource;!i.paused&&Number.isFinite(i.currentTime)&&(r=(i.currentTime-a)/(i.playbackRate>0?i.playbackRate:1)*this._rate+o)}if(r!==null)return Number.isFinite(this._duration)&&r>=this._duration?this._duration:Math.max(0,r)}let t=(this._nowMs()-this._playStartMs)/1e3,n=this._baseTime+t*this._rate;return Number.isFinite(this._duration)&&n>=this._duration?this._duration:Math.max(0,n)}play(){return this._playStartMs!==null||Number.isFinite(this._duration)&&this._baseTime>=this._duration?!1:(this._playStartMs=this._nowMs(),!0)}pause(){return this._playStartMs===null?!1:(this._baseTime=this.now(),this._playStartMs=null,!0)}seek(t){let n=Number.isFinite(this._duration)?Math.max(0,Math.min(t,this._duration)):Math.max(0,t);this._baseTime=n,this._playStartMs!==null&&(this._playStartMs=this._nowMs())}isPlaying(){return this._playStartMs!==null}setRate(t){let n=Number.isFinite(t)&&t>0?Math.max(.1,Math.min(5,t)):1;this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs()),this._rate=n}getRate(){return this._rate}setDuration(t){this._duration=Number.isFinite(t)&&t>0?t:1/0,this._baseTime>this._duration&&(this._baseTime=this._duration)}getDuration(){return this._duration}attachAudioSource(t){this._audioSource=t}detachAudioSource(){this._audioSource&&this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs()),this._audioSource=null}hasAudioSource(){return this._audioSource!==null}getSource(){if(this._audioSource&&this._playStartMs!==null){if("currentTimeSeconds"in this._audioSource)return"audio";let{el:t}=this._audioSource;if(!t.paused&&Number.isFinite(t.currentTime))return"audio"}return"monotonic"}snapshot(){return{time:this.now(),playing:this.isPlaying(),rate:this._rate,duration:this._duration,source:this.getSource()}}reachedEnd(){return Number.isFinite(this._duration)&&this.now()>=this._duration}};var kx=100,Mx=8,Fx=4096,za=e=>e;function Nx(e,t,n){return!(!!e.curve||e.viaX!==void 0&&e.viaY!==void 0)&&t==="linear"&&!n}function Lx(e){let t=Math.ceil(e*kx);return Math.min(Fx,Math.max(Mx,t))}function Dx(e,t,n,r,i){let{scheduledAt:o,elapsed:a,rate:l}=r,s=i??za,u=R=>o+(R-a)/l,c=e.points[t],f=e.points[t+1],m=u(f.t);if(m<=o)return null;let p=Math.max(o,u(c.t)),b=m-p;if(b<=0)return null;if(Nx(c,n,i))return{kind:"ramp",time:m,value:s(f.v)};let v=Lx(b),x=Ll(e,Math.max(c.t,a),f.t,v,n),_=new Float32Array(v);for(let R=0;R<v;R+=1)_[R]=s(x[R]??0);return{kind:"curve",time:p,duration:b,values:_}}function Ix(e,t,n,r){let i=[];for(let a=0;a+1<e.points.length;a+=1){let l=Dx(e,a,t,n,r);l&&i.push(l)}let o=i[0];return o?.kind==="curve"&&o.time<=n.scheduledAt||i.unshift({kind:"set",time:n.scheduledAt,value:(r??za)(_n(e,n.elapsed,t))}),i}function Px(e,t){for(let n of t)if(n.kind==="set")e.setValueAtTime(n.value,n.time);else if(n.kind==="ramp")e.linearRampToValueAtTime(n.value,n.time);else try{e.setValueCurveAtTime(n.values,n.time,n.duration)}catch{let r=n.values[n.values.length-1]??0;e.linearRampToValueAtTime(r,n.time+n.duration)}}function lr(e){for(let t of e)t.param.cancelScheduledValues(0)}function rn(e,t){for(let n of e)typeof n.param.cancelAndHoldAtTime=="function"?n.param.cancelAndHoldAtTime(t):n.param.cancelScheduledValues(t)}function qa(e,t,n,r){if(t.points.length!==0)for(let i of e){if(lr([i]),Nl(t)){let o=(i.map??za)(t.points[0].v);i.param.setValueAtTime(o,r.scheduledAt);continue}Px(i.param,Ix(t,n,r,i.map))}}function af(e,t,n,r,i){let o=new Map(n.filter(l=>l.id).map(l=>[l.id,l.handle])),a=[];for(let l of e.lanes){let s=Cn(l.target);if(!s)continue;let u=s.kind==="preset"?i?.[s.presetId]:s.kind==="fx"?o.get(s.nodeId)?.automation?.[s.param]:void 0;if(!u||u.length===0)continue;let c=fo(l.target,t);c&&(qa(u,l,c.scale,r),a.push(...u))}return a}function sf(e){return e.lanes.find(t=>t.target===Bt)??null}var Ox=`\nconst dbToLin = (db) => Math.pow(10, db / 20);\n\n/**\n * One-pole envelope followers, one per channel.\n *\n * Per channel matters: the followers advance once per sample, so a single shared\n * follower stepped once per channel per sample. On stereo that ran a 20 ms attack\n * as 10 ms, and gave the right channel a gain computed from an envelope that had\n * already traversed the left \\u2014 so the two channels ducked by different amounts\n * from the same input and the image pumped.\n */\nclass EnvBank {\n constructor(attackMs, releaseMs) { this.set(attackMs, releaseMs); this.values = []; }\n set(attackMs, releaseMs) {\n this.a = Math.exp(-1 / (sampleRate * Math.max(1e-5, attackMs / 1000)));\n this.r = Math.exp(-1 / (sampleRate * Math.max(1e-5, releaseMs / 1000)));\n }\n push(ch, x) {\n const prev = this.values[ch] ?? 0;\n const m = Math.abs(x);\n const c = m > prev ? this.a : this.r;\n const next = m + c * (prev - m);\n this.values[ch] = next;\n return next;\n }\n}\n\n/** Soft-knee gain computer in dB, matching acompressor\'s shape. */\nfunction kneeGain(envDb, thresholdDb, ratio, kneeDb) {\n const over = envDb - thresholdDb;\n if (kneeDb > 0 && over > -kneeDb && over < kneeDb) {\n const t = (over + kneeDb) / (2 * kneeDb);\n return -((1 - 1 / ratio) * kneeDb * t * t);\n }\n return over > 0 ? -(over * (1 - 1 / ratio)) : 0;\n}\n\n// log10/exp per sample is the single most expensive thing a dynamics processor\n// can do on the audio thread, and every sample below the knee needs neither:\n// its gain is exactly unity. Comparing envelopes in the linear domain lets the\n// quiet majority of samples skip the transcendentals entirely.\nconst LN10_OVER_20 = Math.LN10 / 20;\nconst dbToLinFast = (db) => Math.exp(db * LN10_OVER_20);\n\nclass HfCompressor extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.env = new EnvBank(this.p.attack ?? 20, this.p.release ?? 250);\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n this.env.set(this.p.attack ?? 20, this.p.release ?? 250);\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const p = this.p;\n const makeup = dbToLin(p.makeup ?? 0);\n const mix = p.mix ?? 1;\n // Knee is expressed as a ratio in FFmpeg; convert to dB width.\n const kneeDb = 20 * Math.log10(Math.max(1.0001, p.knee ?? 2.83));\n const thresholdDb = p.threshold ?? -24;\n const ratio = p.ratio ?? 4;\n // Below this the gain computer returns unity, so the sample needs no\n // logarithm at all.\n const kneeStartLin = dbToLin(thresholdDb - kneeDb);\n const dry = 1 - mix;\n for (let ch = 0; ch < i.length; ch++) {\n const inp = i[ch], out = o[ch];\n for (let n = 0; n < inp.length; n++) {\n const x = inp[n];\n // Per-channel follower, and the sub-knee shortcut: below the knee the\n // gain is exactly unity, so the sample needs no logarithm at all.\n const env = this.env.push(ch, x);\n if (env <= kneeStartLin) {\n out[n] = x * makeup * mix + x * dry;\n continue;\n }\n const envDb = 20 * Math.log10(env);\n const g = dbToLinFast(kneeGain(envDb, thresholdDb, ratio, kneeDb));\n out[n] = x * g * makeup * mix + x * dry;\n }\n }\n return true;\n }\n}\nregisterProcessor("hf-compressor", HfCompressor);\n\nclass HfLimiter extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.env = new EnvBank(this.p.attack ?? 5, this.p.release ?? 50);\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n this.env.set(this.p.attack ?? 5, this.p.release ?? 50);\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const ceiling = dbToLin(this.p.limit ?? -1);\n const outGain = dbToLin(this.p.level_out ?? 0);\n for (let ch = 0; ch < i.length; ch++) {\n const inp = i[ch], out = o[ch];\n for (let n = 0; n < inp.length; n++) {\n const x = inp[n];\n const env = this.env.push(ch, x);\n // Only ever attenuate: a limiter that can raise level is a compressor.\n const g = env > ceiling ? ceiling / env : 1;\n out[n] = x * g * outGain;\n }\n }\n return true;\n }\n}\nregisterProcessor("hf-limiter", HfLimiter);\n\nclass HfGate extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.env = new EnvBank(this.p.attack ?? 1, this.p.release ?? 100);\n this.gains = [];\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n this.env.set(this.p.attack ?? 1, this.p.release ?? 100);\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const p = this.p;\n const threshold = dbToLin(p.threshold ?? -35);\n const floor = dbToLin(p.range ?? -24);\n const ratio = p.ratio ?? 10;\n // Knee is declared in the registry as a ratio, like the compressor\'s; a\n // hard threshold ignored it and chattered on material sitting right at the\n // gate point.\n const kneeDb = 20 * Math.log10(Math.max(1.0001, p.knee ?? 2.83));\n const kneeLin = dbToLin((p.threshold ?? -35) + kneeDb);\n for (let ch = 0; ch < i.length; ch++) {\n const inp = i[ch], out = o[ch];\n for (let n = 0; n < inp.length; n++) {\n const x = inp[n];\n const env = this.env.push(ch, x);\n let target = 1;\n // Above the threshold the gate is fully open; skip the pow entirely.\n if (env < threshold) {\n const under = env > 1e-9 ? threshold / env : 1e9;\n target = Math.max(floor, 1 / Math.pow(under, ratio - 1));\n if (!isFinite(target)) target = floor;\n }\n // Smooth toward the target so the gate does not click on every sample.\n const held = this.gains[ch] ?? 1;\n const c = target < held ? this.env.r : this.env.a;\n const smoothed = target + c * (held - target);\n this.gains[ch] = smoothed;\n out[n] = x * smoothed;\n }\n }\n return true;\n }\n}\nregisterProcessor("hf-gate", HfGate);\n\nclass HfBitcrush extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.holds = [];\n this.held = [];\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const p = this.p;\n const levels = Math.pow(2, (p.bits ?? 8) - 1);\n const step = Math.max(1, Math.round(p.samples ?? 1));\n const mix = p.mix ?? 1;\n for (let ch = 0; ch < i.length; ch++) {\n const inp = i[ch], out = o[ch];\n if (this.held[ch] === undefined) this.held[ch] = 0;\n if (this.holds[ch] === undefined) this.holds[ch] = 0;\n for (let n = 0; n < inp.length; n++) {\n // Per channel: advancing one shared counter only on the last channel\n // left every earlier channel either unheld or frozen for a whole\n // 128-sample quantum, clicking once a block.\n if (this.holds[ch] === 0) this.held[ch] = Math.round(inp[n] * levels) / levels;\n out[n] = this.held[ch] * mix + inp[n] * (1 - mix);\n this.holds[ch] = (this.holds[ch] + 1) % step;\n }\n }\n return true;\n }\n}\nregisterProcessor("hf-bitcrush", HfBitcrush);\n\n/** Linear-interpolated read, \\`delaySamples\\` behind the write head. */\nfunction readTap(ring, write, delaySamples) {\n const len = ring.length;\n const pos = (write - 1 - delaySamples + len) % len;\n const i0 = Math.floor(pos);\n const frac = pos - i0;\n const i1 = (i0 + 1) % len;\n return ring[i0] * (1 - frac) + ring[i1] * frac;\n}\n\n/** Equal-power-ish crossfade, zero at a tap\'s reset point \\u2014 hides the splice. */\nfunction xfade(phase) {\n return Math.sin(Math.PI * phase);\n}\n\n/**\n * Dual-tap granular delay line: two read taps 180\\xB0 apart in a 100 ms grain,\n * each sweeping at a speed relative to the write head that shifts pitch\n * without changing duration. One tap is always fading in as the other fades\n * out, which hides the splice each tap makes when it wraps.\n *\n * write/phase are block-level state, advanced once per SAMPLE across all\n * channels together (not once per channel) \\u2014 advancing them inside the\n * per-channel loop would move the tap 2x/4x too fast on a stereo/quad input.\n */\nclass HfPitchshift extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.grain = Math.round(sampleRate * 0.1);\n this.buf = [];\n this.write = 0;\n this.phase = 0;\n // Samples written so far, capped at one grain. The taps read up to a grain\n // behind the write head, so until this fills they would read the ring\'s\n // zeros \\u2014 the head of every clip came out attenuated or silent.\n this.filled = 0;\n // How much of the wet (pitch-shifted) path is currently in the output, and\n // where it is heading. Crossing between dry and wet is a ~50 ms jump in the\n // signal, so it is RAMPED rather than switched: a hard swap either way is a\n // click. Ramping in both directions is also what lets a node return to true\n // bypass at semitones 0 \\u2014 a one-way latch left preview stuck with the delay\n // that the render, building a fresh node from the attribute, does not have.\n this.wet = 0;\n this.wetTarget = 0;\n // ~15 ms one-pole, short enough to feel immediate on a slider drag and long\n // enough that the splice is inaudible.\n this.wetCoef = Math.exp(-1 / (sampleRate * 0.015));\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const p = this.p;\n const semitones = Math.max(-12, Math.min(12, p.semitones ?? 0));\n const mix = Math.max(0, Math.min(1, p.mix ?? 1));\n const grain = this.grain;\n const ringLen = grain * 2;\n const n = i[0] ? i[0].length : 0;\n for (let ch = 0; ch < i.length; ch++) {\n if (!this.buf[ch]) this.buf[ch] = new Float32Array(ringLen);\n }\n\n // Nothing to shift, or mixed fully out. The grain delay is ~grain/2\n // whatever the ratio, so at semitones=0 this degenerated into a pure 50 ms\n // delay of the signal \\u2014 while the copy for that exact setting reads\n // "Unchanged pitch".\n this.wetTarget = semitones === 0 ? 0 : mix;\n\n // Fully dry AND settled: take the cheap transparent path. The ring keeps\n // filling, so a later shift does not start cold.\n if (this.wetTarget === 0 && this.wet < 1e-4) {\n this.wet = 0;\n let w = this.write;\n for (let s = 0; s < n; s++) {\n for (let ch = 0; ch < i.length; ch++) {\n const x = i[ch][s];\n this.buf[ch][w] = x;\n o[ch][s] = x;\n }\n w = (w + 1) % ringLen;\n }\n this.write = w;\n this.filled = Math.min(grain, this.filled + n);\n return true;\n }\n\n const ratio = Math.pow(2, semitones / 12);\n const inc = (1 - ratio) / grain;\n let write = this.write, phase = this.phase, filled = this.filled, wetNow = this.wet;\n const target = this.wetTarget, coef = this.wetCoef;\n for (let s = 0; s < n; s++) {\n phase += inc;\n phase -= Math.floor(phase);\n const phaseB = (phase + 0.5) % 1;\n const gA = xfade(phase), gB = xfade(phaseB);\n // Ramp the wet path in as the ring fills rather than reading zeros:\n // 100 ms of unshifted audio at the head of a clip beats 50 ms of silence.\n const warm = filled >= grain ? 1 : filled / grain;\n wetNow = target + coef * (wetNow - target);\n const wetMix = wetNow * warm;\n for (let ch = 0; ch < i.length; ch++) {\n const ring = this.buf[ch];\n const inp = i[ch], out = o[ch];\n const x = inp[s];\n ring[write] = x;\n const wet =\n readTap(ring, write, phase * grain) * gA + readTap(ring, write, phaseB * grain) * gB;\n out[s] = x * (1 - wetMix) + wet * wetMix;\n }\n write = (write + 1) % ringLen;\n if (filled < grain) filled++;\n }\n this.write = write;\n this.phase = phase;\n this.filled = filled;\n this.wet = wetNow;\n return true;\n }\n}\nregisterProcessor("hf-pitchshift", HfPitchshift);\n`,$a=new WeakMap;function ja(e){return lf.has(e)}var lf=new WeakSet;function Ka(e){let t=$a.get(e);return t||(t=(async()=>{if(!e.audioWorklet)throw new Error("AudioWorklet is unavailable \\u2014 the page needs a secure context (https, localhost or file://)");let n=`data:text/javascript;base64,${btoa(String.fromCharCode(...new TextEncoder().encode(Ox)))}`;await e.audioWorklet.addModule(n),lf.add(e)})().catch(n=>{throw $a.delete(e),n}),$a.set(e,t)),t}function Hx(e,t,n){let r=.6+Math.max(0,Math.min(1,t))*2.6,i=Math.max(1,Math.floor(e*r)),o=new Float32Array(i),a=Math.round(t*1e3)*2654435761+Math.round(n*1e3)*40503>>>0,l=()=>(a=a*1664525+1013904223>>>0,a/4294967295*2-1),s=Math.max(.001,1-Math.max(0,Math.min(1,n))),u=0,c=0;for(let m=0;m<i;m++){u+=s*(l()-u);let p=u*Math.pow(1-m/i,2.5);o[m]=p,c+=p*p}let f=Math.sqrt(c);if(f>0)for(let m=0;m<i;m++)o[m]=(o[m]??0)/f;return o}var de=e=>typeof e=="number"?e:Number(e??0),Ya=e=>e/1e3;function ff(e,t,n,r){let i=Math.max(1,Math.round(e.sampleRate)),o=e.createBuffer(1,i,e.sampleRate),a=o.getChannelData(0);for(let u=0;u<i;u++){let c=u/i;a[u]=t==="sine"?Math.sin(2*Math.PI*c):4*Math.abs((c+.75)%1-.5)-1}let l=e.createBufferSource();l.buffer=o,l.loop=!0,l.playbackRate.value=n;let s=(r*n%1+1)%1*(i/e.sampleRate);return l.start(typeof e.currentTime=="number"?e.currentTime:0,s),l}function mf(e){try{e.stop()}catch{}e.disconnect()}function Xa(e,t){return[{param:e},{param:t,map:n=>1-n}]}function pf(e,t,n){e.gain.value=n,t.gain.value=1-n}function Ja(e,t,n){return{input:e,output:e,update:t,automation:n,dispose:()=>e.disconnect()}}var Gx=new Set(["peaking","highpass","lowpass"]),uf=e=>Math.pow(10,e/20),Bx=(e,t)=>{let n=e.createGain(),r=i=>{n.gain.value=uf(de(i.gain))};return r(t),Ja(n,r,{gain:[{param:n.gain,map:uf}]})};function ur(e,t){return(n,r)=>{let i=n.createBiquadFilter();i.type=e;let o=a=>{i.frequency.value=de(a.frequency),a.q!==void 0&&(i.Q.value=de(a.q)),t&&(i.gain.value=de(a.gain))};return o(r),Ja(i,o,{frequency:[{param:i.frequency}],...Gx.has(e)?{q:[{param:i.Q}]}:{},...t?{gain:[{param:i.gain}]}:{}})}}function Ux(e){return(t,n)=>{let r=Math.tan(Math.PI*de(n.frequency)/t.sampleRate),i=e==="highpass"?t.createIIRFilter([1/(1+r),-1/(1+r)],[1,(r-1)/(r+1)]):t.createIIRFilter([r/(1+r),r/(1+r)],[1,(r-1)/(r+1)]);return Ja(i,()=>{})}}function cr(e){return(t,n)=>{let r=new AudioWorkletNode(t,e,{processorOptions:{...n}});return{input:r,output:r,update:i=>r.port.postMessage({...i}),dispose:()=>{r.port.postMessage({__hfDispose:!0}),r.disconnect()}}}}var Wx={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))},Vx=(e,t)=>{let n=e.createWaveShaper(),r=e.createGain(),i=e.createGain();r.connect(n).connect(i);let o=a=>{let l=Wx[String(a.type)]??Math.tanh,s=Math.pow(10,de(a.threshold)/20),u=8192,c=new Float32Array(u);for(let f=0;f<u;f++){let m=f/(u-1)*2-1;c[f]=l(m/Math.max(1e-6,s))*s}n.curve=c,n.oversample=de(a.oversample)>=4?"4x":de(a.oversample)>=2?"2x":"none",i.gain.value=Math.pow(10,de(a.output)/20)};return o(t),{input:r,output:i,update:o,automation:{output:[{param:i.gain,map:a=>Math.pow(10,a/20)}]},dispose:()=>{r.disconnect(),n.disconnect(),i.disconnect()}}},zx=(e,t)=>{let n=e.createGain(),r=e.createGain(),i=e.createDelay(5),o=e.createGain(),a=e.createGain(),l=e.createGain();n.connect(i),i.connect(o),o.connect(i),i.connect(a).connect(r),n.connect(l).connect(r);let s=u=>{i.delayTime.value=Math.min(5,de(u.time)/1e3),o.gain.value=de(u.feedback),pf(a,l,de(u.mix))};return s(t),{input:n,output:r,update:s,automation:{time:[{param:i.delayTime,map:u=>Math.min(5,Ya(u))}],feedback:[{param:o.gain}],mix:Xa(a.gain,l.gain)},dispose:()=>[n,r,i,o,a,l].forEach(u=>u.disconnect())}},qx=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createDelay(.5),a=ff(e,"sine",de(t.speed),n),l=e.createGain(),s=e.createGain(),u=e.createGain();a.connect(l).connect(o.delayTime),r.connect(o).connect(s).connect(i),r.connect(u).connect(i);let c=f=>{o.delayTime.value=de(f.delay)/1e3,l.gain.value=de(f.depth)/1e3,a.playbackRate.value=de(f.speed),pf(s,u,de(f.mix))};return c(t),{input:r,output:i,update:c,automation:{delay:[{param:o.delayTime,map:Ya}],depth:[{param:l.gain,map:Ya}],speed:[{param:a.playbackRate}],mix:Xa(s.gain,u.gain)},dispose:()=>{mf(a),[r,i,o,l,s,u].forEach(f=>f.disconnect())}}},$x=6,jx=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createGain(),a=e.createGain(),l=ff(e,String(t.type)==="1"?"sine":"triangle",de(t.speed),n),s=e.createGain(),u=e.createGain(),c=e.createGain(),f=[];r.connect(o);let m=o;for(let b=0;b<$x;b++){let v=e.createBiquadFilter();v.type="allpass",v.Q.value=.7071,s.connect(v.frequency),m.connect(v),m=v,f.push(v)}l.connect(s),m.connect(u).connect(a),o.connect(c).connect(a),a.connect(i);let p=b=>{let v=1e3/Math.max(.1,de(b.delay));for(let x of f)x.frequency.value=v;s.gain.value=v*de(b.decay),l.playbackRate.value=de(b.speed),o.gain.value=de(b.in_gain),a.gain.value=de(b.out_gain),u.gain.value=1,c.gain.value=1};return p(t),{input:r,output:i,update:p,automation:{speed:[{param:l.playbackRate}],in_gain:[{param:o.gain}],out_gain:[{param:a.gain}]},dispose:()=>{mf(l),[r,i,o,a,s,u,c,...f].forEach(b=>b.disconnect())}}},Kx=(e,t)=>{let n=e.createGain(),r=e.createGain(),i=e.createConvolver(),o=e.createGain(),a=e.createGain();i.normalize=!1,n.connect(i).connect(o).connect(r),n.connect(a).connect(r);let l="",s=u=>{let c=`${de(u.size)}:${de(u.damping)}`;if(c!==l){let f=Hx(e.sampleRate,de(u.size),de(u.damping)),m=e.createBuffer(1,f.length,e.sampleRate);m.getChannelData(0).set(f),i.buffer=m,l=c}o.gain.value=de(u.wet),a.gain.value=de(u.dry)};return s(t),{input:n,output:r,update:s,automation:{wet:[{param:o.gain}],dry:[{param:a.gain}]},dispose:()=>[n,r,i,o,a].forEach(u=>u.disconnect())}},Yx={"gain-node":Bx,"biquad-peaking":ur("peaking",!0),"biquad-lowshelf":ur("lowshelf",!0),"biquad-highshelf":ur("highshelf",!0),"biquad-highpass":ur("highpass",!1),"biquad-lowpass":ur("lowpass",!1),"worklet-compressor":cr("hf-compressor"),"worklet-limiter":cr("hf-limiter"),"worklet-gate":cr("hf-gate"),"worklet-bitcrush":cr("hf-bitcrush"),"worklet-pitchshift":cr("hf-pitchshift"),waveshaper:Vx,"delay-feedback":zx,"chorus-lfo":qx,"allpass-phaser":jx,convolver:Kx};function hf(e){return e.nodes.some(t=>Sn(t.type)?.web.startsWith("worklet-")??!1)}function Xx(e,t,n,r=0){let i=Sn(t);if(!i)throw new Error(`Unknown effect type: ${t}`);let o=An(t,n);if((t==="highpass"||t==="lowpass")&&String(o.poles)==="1")return Ux(t)(e,o,r);let a=Yx[i.web];if(!a)throw new Error(`No Web Audio builder for ${i.web}`);return a(e,o,r)}function cf(e){let t=[];for(let n of e){let r=n.fromPreset,i=t.at(-1);if(i&&i.preset===r)i.nodes.push(n);else{let o=typeof n.presetAmount=="number"?n.presetAmount:1;t.push({...r?{preset:r}:{},amount:Math.min(1,Math.max(0,o)),nodes:[n]})}}return t}function df(e){return En(e).map(t=>{let n=An(t.type,t.params),r=n.poles!==void 0?`:${n.poles}`:"",i=String(n.poles)==="1"?`@${n.frequency}`:"",o=t.type==="phaser"?`~${n.type}`:"",a=t.fromPreset?`%${t.fromPreset}`:"";return`${t.type}${r}${i}${o}${a}`}).join("|")}function gf(e,t,n=0){var f;let r=e.createGain(),i=e.createGain(),o=[],a=[],l=cf(En(t)),s=r;for(let m of l){let p=null;if(m.preset){let b=e.createGain(),v=e.createGain(),x=e.createGain(),_=e.createGain();x.gain.value=m.amount,v.gain.value=1-m.amount,s.connect(b),b.connect(v).connect(_),p={entry:b,wet:x,dry:v,join:_},s=b}for(let b of m.nodes){let v=Xx(e,b.type,b.params??{},n);s.connect(v.input),s=v.output,o.push({...b.id?{id:b.id}:{},type:b.type,handle:v})}p&&m.preset&&(s.connect(p.wet).connect(p.join),a.push({id:m.preset,...p}),s=p.join)}s.connect(i);let u=df(t),c={};for(let m of a)(c[f=m.id]??(c[f]=[])).push(...Xa(m.wet.gain,m.dry.gain));return{input:r,output:i,presets:c,nodes:o,update(m){if(df(m)!==u)return!1;En(m).forEach((b,v)=>{let x=o[v];x&&(x.handle.update(An(b.type,b.params)),b.id===void 0?delete x.id:x.id=b.id)});let p=0;for(let b of cf(En(m))){if(!b.preset)continue;let v=a[p++];!v||v.id!==b.preset||(v.wet.gain.value=b.amount,v.dry.gain.value=1-b.amount)}return!0},dispose(){for(let{handle:m}of o)m.dispose();for(let{entry:m,wet:p,dry:b,join:v}of a)m.disconnect(),p.disconnect(),b.disconnect(),v.disconnect();r.disconnect(),i.disconnect()}}}var bf={version:1,nodes:[]},xf={version:1,lanes:[]};function yf(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(et):null)??"";if(!n)return xf;try{return Fl(Or(n),t)}catch{return xf}}function on(e){let t=(typeof e.getAttribute=="function"?e.getAttribute(Tt):null)??"";if(!t)return{chain:bf,raw:""};try{return{chain:Rl(t),raw:t}}catch{return{chain:bf,raw:""}}}function vf(e){return yf(e,on(e).chain)}function wi(e,t,n,r,i){let{chain:o}=on(t),a=null,l=[],s=!1,u=0,c=()=>{try{a?(n.disconnect(a.input),a.output.disconnect(r),a.dispose()):n.disconnect(r)}catch{}a=null},f=(T,M)=>{if(T.nodes.length===0){n.connect(r);return}if(hf(T)&&!ja(e)){n.connect(r);let D=++u;Ka(e).then(()=>{s||D!==u||x(on(t).chain)}).catch(()=>{});return}try{let D=gf(e,T,M);n.connect(D.input),D.output.connect(r),a=D}catch{n.connect(r)}},m=(T,M)=>{l=M&&a?af(yf(t,T),T,a.nodes,M,a.presets):[]},p=i?{...i}:null;f(o,p?.elapsed??0),m(o,p);let b=()=>{if(!p)return null;let T=typeof e.currentTime=="number"?e.currentTime:p.scheduledAt;return{scheduledAt:T,elapsed:p.elapsed+(T-p.scheduledAt)*p.rate,rate:p.rate}},v=T=>{let M=b();M&&(rn(l,M.scheduledAt),m(T,M))},x=T=>{let M=b();rn(l,M?.scheduledAt??0),c(),f(T,M?.elapsed??0),m(T,M)},_=null,R=t;return typeof MutationObserver<"u"&&typeof R?.nodeType=="number"&&(_=new MutationObserver(()=>{let T=on(t);l.length>0&&lr(l),!a||!a.update(T.chain)?x(T.chain):v(T.chain)}),_.observe(R,{attributes:!0,attributeFilter:[Tt,et]})),{reanchor:T=>{if(s)return;let M=b();M&&rn(l,M.scheduledAt),p={...T},m(on(t).chain,p)},setRate:T=>{let M=b();s||!M||!Number.isFinite(T)||T<=0||T===M.rate||(p={...M,rate:T},rn(l,M.scheduledAt),m(on(t).chain,p))},dispose:()=>{s=!0,_?.disconnect(),l.length>0&&rn(l,typeof e.currentTime=="number"?e.currentTime:0),a?.dispose()}}}var Sf="runtime_web_audio_bypass";function Qa(e,t){return typeof e.getAttribute=="function"?e.getAttribute(t):null}function dr(e,t){return Qa(e,t)!==null}function Jx(e){return dr(e,"crossorigin")?!0:e.crossOrigin!=null}function Qx(e){return typeof e.baseURI=="string"&&e.baseURI?e.baseURI:typeof document<"u"?document.baseURI:""}function Zx(e){let t=typeof e.currentSrc=="string"?e.currentSrc:"";if(t)return[t];let n=Qa(e,"src");if(n)return[n];if(typeof e.querySelectorAll!="function")return[];let r=[];for(let i of Array.from(e.querySelectorAll("source"))){let o=i.getAttribute("src");o&&r.push(o)}return r}function ey(e,t){if(typeof window>"u")return!1;let n;try{n=new URL(e,Qx(t))}catch{return!1}return n.protocol!=="http:"&&n.protocol!=="https:"||n.origin===window.location.origin?!1:!Jx(t)}function Ef(e){return(typeof e.currentSrc=="string"?e.currentSrc:"")?!0:dr(e,"src")}function an(e){for(let t of Zx(e))if(ey(t,e))return{kind:"decode-only",reason:"cross_origin_no_cors",asset:t};return{kind:"web-audio"}}function ty(e){let t=[];dr(e,Tt)&&t.push("fx-chain"),dr(e,et)&&t.push("automation"),dr(e,Gr)&&t.push("audio-group");let n=Number.parseFloat(Qa(e,"data-volume")??"");return Number.isFinite(n)&&n>1&&t.push("above-unity-gain"),t}function ny(){return typeof window<"u"&&!!window.__HF_EXPORT_RENDER_SEEK_CONFIG}var Af=new WeakSet;function sn(e,t){if(t.kind==="web-audio"||ny()||Af.has(e))return;let n=ty(e);Af.add(e);let r={asset:t.asset,reason:t.reason,lostProcessing:n,note:"cross-origin media without a `crossorigin` opt-in is silent through createMediaElementSource (Web Audio spec); using native playback instead"};be({source:"hf-preview",type:"diagnostic",code:Sf,details:r});let i=n.length>0?` Native playback cannot reproduce: ${n.join(", ")} \\u2014 proxy or download the asset to a same-origin URL to keep it.`:"";console.info(`[hyperframes] ${Sf}: "${t.asset}" (${t.reason}): Web Audio capture withheld; the track plays through native HTMLMediaElement output.${i}`)}function Za(e){return!Number.isFinite(e)||e<=0?1:e}function wf(e){return Le(e)}function ry(e,t){t||e.paused||!Cr().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function iy(e,t){let{elapsed:n,mediaStart:r,scheduledAt:i,globalRate:o,mediaRate:a,clipDuration:l}=t,s=Number.isFinite(l)&&l>0,u=l*a;if(n>=0){let f=n*a,m=u-f;return s&&m<=0?!1:(s?e.start(0,f+r,m):e.start(0,f+r),!0)}let c=-n/o;return s?e.start(i+c,r,u):e.start(i+c,r),!0}function Ci(e,t,n){let r=sf(vf(e));r&&qa([{param:t.gain}],r,Pr.scale,n)}function fr(e){return e.sourceKind==="buffer"}var _i=class{constructor(){ge(this,"_ctx",null);ge(this,"_bufferCache",new Map);ge(this,"_failedSrcs",new Set);ge(this,"_mediaElementSources",new WeakMap);ge(this,"_activeSources",[]);ge(this,"_masterGain",null);ge(this,"_masterVolume",1);ge(this,"_masterMuted",!1);ge(this,"_groups",new Map);ge(this,"_rateAnchorCtx",0);ge(this,"_rateAnchorComp",0);ge(this,"_rate",1);ge(this,"_paused",!0);ge(this,"_playGeneration",0)}async init(){try{return this._ctx=new AudioContext,this._masterGain=this._ctx.createGain(),this._masterGain.connect(this._ctx.destination),this.applyMasterGain(),!0}catch{return!1}}get context(){return this._ctx}getTime(){return!this._ctx||this._paused?-1:this._rateAnchorComp+(this._ctx.currentTime-this._rateAnchorCtx)*this._rate}async decodeAudioElement(t){let n=t.currentSrc||t.getAttribute("src");if(!n)return null;if(this._bufferCache.has(n))return this._bufferCache.get(n);if(this._failedSrcs.has(n)||!this._ctx)return null;let r;try{let i=await fetch(n,{cache:"no-store"});if(!i.ok)return L("webAudioTransport.fetch",new Error(`${i.status} ${n}`)),null;r=await i.arrayBuffer()}catch(i){return L("webAudioTransport.fetch",i),null}try{let i=await this._ctx.decodeAudioData(r);return this._bufferCache.set(n,i),i}catch(i){return this._failedSrcs.add(n),L("webAudioTransport.decode",i),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}acquireMediaElementSource(t){let n=this._mediaElementSources.get(t);if(n){let o=an(t);if(o.kind!=="web-audio"){try{n.disconnect()}catch{}return this._mediaElementSources.delete(t),sn(t,o),null}return n}if(!this._ctx)return null;let r=an(t);if(r.kind!=="web-audio")return sn(t,r),null;let i=this._ctx.createMediaElementSource(t);return this._mediaElementSources.set(t,i),i}async scheduleMediaElementPlayback(t,n,r,i,o,a,l=1){if(!this._ctx||!this._masterGain||a!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),a!==this._playGeneration)return null;let s=this.acquireMediaElementSource(t);if(!s)return null;let u=Za(l),c=this._ctx.createGain();c.gain.value=o;let f=this._ctx.currentTime,m=i-n,p={scheduledAt:f,elapsed:m,rate:u},b=wi(this._ctx,t,s,c,p);c.connect(this.resolveDestination(t,f,i,u)??this._masterGain),Ci(t,c,p),this._rate=u,this._rateAnchorCtx=f,this._rateAnchorComp=i;let v={fx:b,el:t,sourceNode:s,sourceKind:"media-element",gainNode:c,compositionStart:n,mediaStart:r,scheduledAt:f,priorMuted:t.muted,priorVolume:t.volume,mediaPlaybackRate:_e(t),bounded:!1};return t.volume=1,this._activeSources.push(v),this._paused=!1,v}catch(s){return L("webAudioTransport.mediaElementSource",s),null}}groupInput(t,n,r){let i=this._groups.get(t);if(i){if(i.generation!==this._playGeneration)try{i.reanchor(r),i.generation=this._playGeneration}catch(m){L("webAudioTransport.groupReanchor",m)}return i.input}if(!this._ctx||!this._masterGain)return null;let o=this._ctx.createGain(),a=this._ctx.createGain();a.connect(this._masterGain);let l=()=>po(n,t),s=l(),u=this._ctx.createGain();u.gain.value=s?.hasAttribute("data-hidden")?0:1,u.connect(a);let c=this._ctx.createGain();c.gain.value=wf(mo(s)),c.connect(u);let f=wi(this._ctx,s??{getAttribute:()=>null},o,c,r);return s&&Ci(s,c,r),this._groups.set(t,{input:o,fader:c,muteGain:u,fx:f,generation:this._playGeneration,reanchor:m=>{lr([{param:c.gain}]);let p=l();c.gain.value=wf(mo(p)),u.gain.value=p?.hasAttribute("data-hidden")?0:1,f?.reanchor(m),p&&Ci(p,c,m)},dispose:()=>{try{f?.dispose(),o.disconnect(),c.disconnect(),u.disconnect(),a.disconnect()}catch{}}}),o}setGroupMuted(t,n){let r=this._groups.get(t);if(r)try{r.muteGain.gain.value=n?0:1}catch(i){L("webAudioTransport.setGroupMuted",i)}}resolveDestination(t,n,r,i){if(!this._masterGain)return null;let o=Il(t);if(!o)return this._masterGain;let a={scheduledAt:n,elapsed:r,rate:i};return this.groupInput(o,t.ownerDocument,a)??this._masterGain}handleSourceEnded(t,n,r,i){let o=this._activeSources.indexOf(n);if(o!==-1){this._activeSources.splice(o,1),r.muted=i;try{t.disconnect(),n.fx?.dispose(),n.gainNode.disconnect()}catch{}this._activeSources.length===0&&(this._paused=!0)}}async schedulePlayback(t,n,r,i,o,a,l,s=1,u=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||l!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),l!==this._playGeneration)return null;let c=Za(s),f=_e(t),m=c*f,p=this._ctx.createBufferSource();p.buffer=n,p.playbackRate.value=m;let b=this._ctx.createGain();b.gain.value=a;let v=o-r,x=this._ctx.currentTime,_={scheduledAt:x,elapsed:v,rate:c},R=wi(this._ctx,t,p,b,_);if(b.connect(this.resolveDestination(t,x,o,c)??this._masterGain),Ci(t,b,_),this._rate=c,this._rateAnchorCtx=x,this._rateAnchorComp=o,!iy(p,{elapsed:v,mediaStart:i,scheduledAt:x,globalRate:c,mediaRate:f,clipDuration:u}))return p.disconnect(),R?.dispose(),b.disconnect(),null;let T=t.muted;t.muted=!0,ry(t,T);let M={fx:R,el:t,sourceNode:p,sourceKind:"buffer",gainNode:b,compositionStart:r,mediaStart:i,scheduledAt:x,priorMuted:T,priorVolume:t.volume,mediaPlaybackRate:f,bounded:Number.isFinite(u)&&u>0};return this._activeSources.push(M),this._paused=!1,p.addEventListener("ended",()=>this.handleSourceEnded(p,M,t,T)),M}catch(c){return L("webAudioTransport.schedule",c),null}}setRate(t){let n=Za(t);if(n===this._rate)return!1;this._ctx&&!this._paused&&(this._rateAnchorComp=this.getTime(),this._rateAnchorCtx=this._ctx.currentTime),this._rate=n;for(let r of this._activeSources)try{fr(r)&&(r.sourceNode.playbackRate.value=n*r.mediaPlaybackRate),r.fx?.setRate(n)}catch(i){L("webAudioTransport.setRate",i)}for(let r of this._groups.values())try{r.fx?.setRate(n)}catch(i){L("webAudioTransport.setRate.group",i)}return!0}hasBoundedActiveSources(){return this._activeSources.some(t=>fr(t)&&t.bounded)}stopAll(){for(let t of this._activeSources){try{fr(t)&&t.sourceNode.stop(),t.sourceNode.disconnect(),t.fx?.dispose(),t.gainNode.disconnect()}catch{}fr(t)?t.el.muted=t.priorMuted:t.el.volume=t.priorVolume}this._activeSources=[],this._paused=!0}setVolume(t){this._masterVolume=Math.max(0,Math.min(1,t)),this.applyMasterGain()}setElementVolume(t,n){let r=Le(n);for(let i of this._activeSources)if(i.el===t)try{i.sourceKind==="media-element"&&(i.el.volume=1),i.gainNode.gain.value=r}catch(o){L("webAudioTransport.setElementVolume",o)}}setMuted(t){this._masterMuted=t,this.applyMasterGain()}applyMasterGain(){this._masterGain&&(this._masterGain.gain.value=this._masterMuted?0:this._masterVolume)}isActive(){return this._activeSources.length>0&&!this._paused}ownsElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t&&fr(n))}routesElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t)}destroy(){this.stopAll();for(let t of this._groups.values())t.dispose();if(this._groups.clear(),this._bufferCache.clear(),this._failedSrcs.clear(),this._mediaElementSources=new WeakMap,this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null,this._masterVolume=1,this._masterMuted=!1}};var Cf="data-hf-studio-manual-edit-gesture";function _f(e){return!Number.isInteger(e.tick)||e.tick<=0||e.tick%60!==0?!1:!(e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2)}var oy=/^\\s*spring\\(\\s*([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+))\\s*\\)\\s*$/;function Tf(e){return Math.max(0,Math.min(1,e))}function Rf(e){let t=oy.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?Tf(n):null}function kf(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=Tf(t),r=12-n*6,i=Math.PI*2*(1+n*1.5),o=1-Math.exp(-r)*Math.cos(i);return(1-Math.exp(-r*e)*Math.cos(i*e))/o}var ay=/^\\s*wiggle\\(\\s*(\\d+)\\s*,\\s*(easeOut|easeInOut|anticipate|uniform)\\s*(?:,\\s*([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?)\\s*)?\\)\\s*$/,sy=Math.PI*2;function ly(e){let t=ay.exec(e);if(!t)return null;let n=Number(t[1]);if(!Number.isSafeInteger(n)||n<1)return null;let r=t[2];if(r!=="easeOut"&&r!=="easeInOut"&&r!=="anticipate"&&r!=="uniform")return null;if(t[3]===void 0)return{wiggles:n,type:r};let i=Number(t[3]);return!Number.isFinite(i)||i<0||i>1?null:{wiggles:n,type:r,amplitude:i}}function uy(e,t,n,r){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let i=r??(n==="easeInOut"?.08:n==="uniform"?.14:n==="anticipate"?.12:.16),o=n==="easeInOut"?i*Math.sin(Math.PI*e):n==="uniform"?i:i*(1-e);return e+(n==="anticipate"?-1:1)*o*Math.sin(sy*t*e)}function Mf(e,t){let n=ly(e);if(!n)return null;let r=`${n.wiggles}:${n.type}:${n.amplitude??"default"}`,i=t?.get(r);if(i)return i;let o=a=>uy(a,n.wiggles,n.type,n.amplitude);return t?.set(r,o),o}var cy=24,Ff=e=>e>=1?1:0,dy=e=>e,Ti=String.raw`([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?)`,fy=new RegExp(String.raw`^\\s*M\\s*0\\s*,\\s*0\\s+C\\s*${Ti}\\s*,\\s*${Ti}\\s+${Ti}\\s*,\\s*${Ti}\\s+1\\s*,\\s*1\\s*$`,"i");function Nf(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function my(e,t,n,r,i){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let o=0,a=1;for(let l=0;l<cy;l+=1){let s=(o+a)/2;Nf(s,t,r)<e?o=s:a=s}return Nf((o+a)/2,n,i)}function py(e){let t=fy.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),o=Number(t[4]);return Math.min(n,i)<0||Math.max(n,i)>1?null:a=>my(a,n,r,i,o)}function hy(e,t){if(!e.startsWith("spring("))return null;let n=Rf(e);if(n===null)return null;let r=t.get(n);if(r)return r;let i=o=>kf(o,n);return t.set(n,i),i}function gy(e,t){if(!e.startsWith("custom(")||!e.endsWith(")"))return null;let n=e.slice(7,-1),r=t.get(n);if(r)return r;let i=py(n);return i&&t.set(n,i),i}function Lf(e){if(e.__hfCustomEaseInstalled)return!0;let t=e.parseEase;if(!t)return!1;let n=new Map,r=new Map,i=new Map,o=s=>typeof s!="string"?null:s==="hold"?Ff:Mf(s,i)??hy(s,r)??gy(s,n),a=(s,u,c=[])=>{let f=o(s);return f||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\\(|$)/.test(s.trim())&&Ne("custom_ease_parse_failed",{ease:s}),t.call(u,s,...c)??dy)};e.parseEase=function(u,...c){return a(u,this,c)};let l=e.registerEase;if(typeof l=="function"){l("hold",Ff);let s=u=>{let c=f=>f;c.config=(...f)=>a(`${u}(${f.join(",")})`,e),l(u,c)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}var ns=new Map,mr=new Map,es=new Map,ts=()=>{},If=()=>{},Df=0;function rs(e){return/^[a-z][a-z0-9-]{0,63}$/.test(e)}function Pf(e){let t=(es.get(e)??0)+1;return es.set(e,t),t}function Of(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:(Df-=1,Df)}function is(e,t){let n=mr.get(e);if(!n)return;let r=()=>es.get(e)===t.generation&&mr.get(e)===n;try{Promise.resolve(n(t.payload)).then(()=>{r()&&If(e,t.requestId)},i=>{r()&&ts(e,t.requestId,i)})}catch(i){r()&&ts(e,t.requestId,i)}}function Hf(e){ts=e}function Gf(e){If=e}function Ri(e,t,n){if(!rs(e))return;let r={payload:t,requestId:Of(n),generation:Pf(e)};ns.set(e,r),is(e,r)}function ki(e,t){rs(e)&&(ns.delete(e),is(e,{payload:void 0,requestId:Of(t),generation:Pf(e)}))}function Bf(e,t){if(!rs(e))throw new Error(`Invalid HyperFrames runtime-data channel: ${e}`);mr.set(e,t);let n=ns.get(e);return n&&is(e,n),()=>{mr.get(e)===t&&mr.delete(e)}}var os="data-hf-authored-duration",as="data-hf-authored-end",Uf=!1;function ot(e){if(e){if(typeof e.pause!="function"){Uf||(Uf=!0,Ne("timeline_missing_pause",{}));return}try{e.pause()}catch(t){L("runtime.timeline.pause",t)}}}function by(){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 Wf(){let e=Eu(),t=()=>{};Ws(be),Hf((d,g,h)=>{be({source:"hf-preview",type:"runtime-data-error",channel:d,requestId:g,message:h instanceof Error?h.message:String(h)})}),Gf((d,g)=>{try{t()}catch(h){be({source:"hf-preview",type:"runtime-data-error",channel:d,requestId:g,message:h instanceof Error?h.message:String(h)});return}be({source:"hf-preview",type:"runtime-data-applied",channel:d,requestId:g})}),mi(document),La(document),Pl(document);let n=by();e.canonicalFps=n.fps??e.canonicalFps,Bs(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG&&console.info("[hyperframes] render runtime fps",{canonicalFps:e.canonicalFps,source:n.source,rawFpsSource:n.rawFpsSource,rawFps:n.rawFps,fallbackReason:n.fallbackReason});let r=null,i=null,o=null,a=[],l=new Set,s=null,u=new Set,c=(d,g,h)=>{u.has(d)||(u.add(d),Ne(g,h))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(d){L("runtime.init.site1",d)}let f=new Ei;e.transportClock=f;let m=new _i,p=!1;m.init().then(d=>{p=d}),window.__hf=window.__hf||{};let b=d=>d.closest("[data-hidden]")!==null||Br(d.ownerDocument,d),v=()=>{let d=window.gsap,g=window;if(!(!d?.registerPlugin||g.__hfAutoNoopRegistered))try{d.registerPlugin({name:"_auto",init:()=>!1}),g.__hfAutoNoopRegistered=!0}catch(h){c("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),L("runtime.autoMarker.install",h)}},x=()=>{let d=window.gsap;if(!d){c("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{Lf(d)||c("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(g){c("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),L("runtime.customEase.install",g)}};v(),x(),document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden");try{Ys(document)}catch(d){L("runtime.init.cssVariables",d)}window.__timelines=window.__timelines||{};let _=()=>{let d=document.querySelector(\'[data-composition-id][data-root="true"]\');if(d instanceof HTMLElement)return d;let g=Array.from(document.querySelectorAll("[data-composition-id]"));return g.find(h=>!h.parentElement?.closest("[data-composition-id]"))??g[0]??null};if(Array.isArray(window.__timelines)){let d=window.__timelines,g=_()?.getAttribute("data-composition-id")??"root",h={};if(d.length===1)h[g]=d[0];else for(let y=0;y<d.length;y++)h[`tl-${y}`]=d[y];window.__timelines=h}let R=_();R&&!R.hasAttribute("data-start")&&R.setAttribute("data-start","0");let T=d=>{a.push(d)},M=(d,g,h)=>{let y=h??`${d}:${JSON.stringify(g)}`;l.has(y)||(l.add(y),be({source:"hf-preview",type:"diagnostic",code:d,details:g}))},D=d=>{let g={scale:1,focusX:960,focusY:540},h=[],y=[],w={time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:d.play,pause:d.pause,seek:d.seek,getTime:d.getTime,getDuration:d.getDuration,isPlaying:d.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>g,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>h,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:d.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>y,getRenderState:()=>({...w,time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying()})}},E=1/60,S=.75,A=.05,C=100,F=240,I=d=>{if(d instanceof Error)return d.message||String(d);if(typeof d=="string")return d;try{return JSON.stringify(d)}catch{return String(d??"")}},q=d=>{let g=d.toLowerCase();return g.includes("cannot read properties of null")||g.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:g.includes("failed to execute \'queryselector\'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:g.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},W=d=>{if(d==null||d.trim()==="")return null;let g=Number.parseFloat(d);return!Number.isFinite(g)||g<=0?null:`${g}px`},Y=()=>_(),k=()=>{let d=Y();if(!d)return;let g=W(d.getAttribute("data-width")),h=W(d.getAttribute("data-height"));g&&(d.style.width=g),h&&(d.style.height=h),g&&d.style.setProperty("--comp-width",g),h&&d.style.setProperty("--comp-height",h)},U=()=>{let d=Y(),g=Array.from(document.querySelectorAll("[data-composition-id]")).filter(h=>h.hasAttribute("data-duration")||h.hasAttribute("data-end"));for(let h of g){if(d&&h===d)continue;let y=h.getAttribute("data-duration"),w=h.getAttribute("data-end");y!=null&&!h.hasAttribute(os)&&h.setAttribute(os,y),w!=null&&!h.hasAttribute(as)&&h.setAttribute(as,w),h.removeAttribute("data-duration"),h.removeAttribute("data-end")}},ie=()=>{let d=Y();if(!d)return;d.style.position||(d.style.position="relative"),d.style.overflow="hidden";let g=W(d.getAttribute("data-width")),h=W(d.getAttribute("data-height"));g&&(d.style.width=g),h&&(d.style.height=h);let y=Array.from(d.children);for(let w of y){let N=w.tagName.toLowerCase();if(N==="script"||N==="style"||N==="link"||N==="meta"||!w.hasAttribute("data-start")||w.hasAttribute("data-hf-autostamped"))continue;let G=(w.style.top==="0px"||w.style.top==="0")&&(w.style.left==="0px"||w.style.left==="0")&&w.style.width==="100%"&&w.style.height==="100%",re=/translate\\(\\s*-50%\\s*,\\s*-50%\\s*\\)/.test(w.style.transform);if(G&&re&&!w.hasAttribute("data-width")&&!w.hasAttribute("data-height")){let ne=w.style.top,_t=w.style.left,ye=w.style.width,gn=w.style.height;w.style.top="",w.style.left="",w.style.width="",w.style.height="";let se=window.getComputedStyle(w);se.top!=="auto"||se.bottom!=="auto"||se.left!=="auto"||se.right!=="auto"||se.width!=="0px"||se.height!=="0px"||(w.style.top=ne,w.style.left=_t,w.style.width=ye,w.style.height=gn)}let $=window.getComputedStyle(w),le=$.position;if(le!=="absolute"&&le!=="fixed"&&(w.style.position="absolute"),!!w.style.top||!!w.style.bottom||$.top!=="auto"||$.bottom!=="auto"||(w.style.top="0"),!!w.style.left||!!w.style.right||$.left!=="auto"||$.right!=="auto"||(w.style.left="0"),N!=="audio"){let ne=W(w.getAttribute("data-width")),_t=W(w.getAttribute("data-height")),ye=$.width!=="0px"&&$.width!=="auto",gn=$.height!=="0px"&&$.height!=="auto";ne?!w.style.width&&!ye&&(w.style.width=ne):!w.style.width&&$.width==="0px"&&(w.style.width="100%"),_t?!w.style.height&&!gn&&(w.style.height=_t):!w.style.height&&$.height==="0px"&&(w.style.height="100%")}}},P=(d,g=0,h)=>mt({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:h?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(d,g),H=(d,g)=>mt({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:g?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(d),V=d=>{let g=d.closest("[data-composition-id]"),h=g?P(g,0):null,y=g?H(g,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:g,inheritedStart:h,inheritedDuration:y}},j=d=>{let g=V(d),h=g.inheritedStart??0,y=Gt(d.getAttribute("data-start"));if(d.hasAttribute("data-hf-auto-start")||y==null||h<=0)return P(d,h);let w=g.inheritedDuration,N=w!=null&&w>0?h+w:null;return y>=h&&(N==null||y<N)?y:h+y};window.__hfResolveMediaStartSeconds=j,a.push(()=>{window.__hfResolveMediaStartSeconds===j&&delete window.__hfResolveMediaStartSeconds});let we=(d,g)=>{let h=d.tagName.toLowerCase();if(h==="script"||h==="style"||h==="link"||h==="meta")return!1;let w=h==="video"||h==="audio"?j(d):P(d,0),N=H(d),G=d.getAttribute("data-composition-id");if(G){let $=(window.__timelines??{})[G],le=null;if($&&typeof $.duration=="function"){let Me=Number($.duration());Number.isFinite(Me)&&Me>0&&(le=Me)}!(d.hasAttribute("data-duration")||d.hasAttribute("data-end")||d.hasAttribute(os)||d.hasAttribute(as))&&(N==null||N<=0)&&le!=null&&(N=le)}let re=N!=null&&N>0?w+N:Number.POSITIVE_INFINITY;return g>=w&&(Number.isFinite(re)?g<re:!0)},z=!!document.querySelector("[data-composition-src]"),O=!1;{let d=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let g of d){let h=g.getAttribute("data-composition-id");if(h&&g.children.length===0&&document.querySelector(`template#${CSS.escape(h)}-template`)){O=!0;break}}}let B=!z&&!O,ee=d=>{if(!d||typeof d.duration!="function")return null;try{let g=Number(d.duration());return Number.isFinite(g)?Math.max(0,g):null}catch{return null}},K=d=>typeof d=="number"&&Number.isFinite(d)&&d>E,te=d=>{let g=ve(d.getAttribute("data-duration"));return g!=null&&g>0?g:Number.isFinite(d.duration)?Qe(d,d.duration):null},J=()=>{let d=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(d.length===0)return null;let g=0;for(let h of d){let y=j(h);if(!Number.isFinite(y))continue;let w=te(h);w==null||w<=E||(g=Math.max(g,Math.max(0,y)+w))}return g>E?g:null},X=()=>{let d=Y();if(!d)return null;let g=window.__timelines??{},h=mt({timelineRegistry:g,includeAuthoredTimingAttrs:!0}),y=0,w=ve(d.getAttribute("data-duration"));w!=null&&w>0&&(y=w);let N=Array.from(d.querySelectorAll("[data-composition-id][data-start]"));for(let G of N){if(!(G instanceof Element)||G.parentElement?.closest("[data-composition-id]")!==d)continue;let $=h.resolveStartForElement(G,0),le=h.resolveDurationForElement(G);!Number.isFinite($)||le==null||le<=0||(y=Math.max(y,Math.max(0,$)+le))}return y>E?y:null},Pe=()=>{let d=J();return typeof d!="number"||!Number.isFinite(d)||d<=E?null:d},Fe=d=>K(d)?Math.max(E,d*S):E,cn=()=>{let d=0;for(let g of e.deterministicAdapters){let h=g.getInferredDurationSeconds;if(typeof h!="function")continue;let y=null;try{y=h()}catch(w){L("runtime.init.adapterDuration",w)}typeof y=="number"&&Number.isFinite(y)&&y>0&&(d=Math.max(d,y))}return d>E?d:null},Ce=(d,g=0)=>{let h=ee(d),y=Pe(),w=X(),N=cn(),G=Math.max(y??0,w??0,N??0),re=Number.isFinite(g)&&g>E?g:0,$=0;return K(h)?$=Math.max(h,G,re):K(G)?$=Math.max(G,re):$=re,$>0?Math.max(0,$):0},Oi=()=>{let d=window.__timelines??{},g=se=>{let oe=Object.entries(d).filter(ue=>!!ue[1]&&typeof ue[1].play=="function"&&typeof ue[1].pause=="function");if(oe.length!==1)return{timeline:null};let he=oe[0];if(!he)return{timeline:null};let[xe,fe]=he;return{timeline:fe,selectedTimelineIds:[xe],selectedDurationSeconds:ee(fe),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:se,soleTimelineId:xe}}}},h=mt({timelineRegistry:d,includeAuthoredTimingAttrs:!0}),y=Pe(),w=X(),N=Math.max(y??0,w??0)||null,G=Fe(N),re=se=>{let oe=document.querySelector(`[data-composition-id="${CSS.escape(se)}"]`);return oe?h.resolveStartForElement(oe,0):0},$=se=>{let oe=window.gsap;if(!oe||typeof oe.timeline!="function")return null;let he=oe.timeline({paused:!0});for(let xe of se)he.add(xe.timeline,re(xe.compositionId));return he},le=(se,oe)=>{if(!K(se))return null;let he=window.gsap;if(!he||typeof he.timeline!="function")return null;let xe=he.timeline({paused:!0});if(oe)try{xe.add(oe,0)}catch(ue){L("runtime.init.site2",ue)}let fe=xe;if(typeof fe.to=="function")try{fe.to({},{duration:se})}catch(ue){L("runtime.init.site3",ue)}return xe},Be=(se,oe)=>{let he=se;if(typeof he.getChildren!="function")return[];try{let xe=he.getChildren(!0,!0,!0)??[];if(!Array.isArray(xe))return[];let fe=[];for(let ue of oe)if(!xe.some(Je=>Je===ue.timeline))try{let Je=re(ue.compositionId);se.add(ue.timeline,Je),fe.push(ue.compositionId)}catch(Je){L("runtime.init.site4",Je)}return fe}catch{return[]}},Me=Y(),Q=Me?.getAttribute("data-composition-id")??null;if(!Q)return g("root_missing_composition_id");let ne=d[Q]??null,ye=(()=>{if(!Me)return[];let se=new Set,oe=Array.from(Me.querySelectorAll("[data-composition-id]")),he=[];for(let xe of oe){let fe=xe.getAttribute("data-composition-id");if(!fe||fe===Q||se.has(fe))continue;se.add(fe);let ue=d[fe]??null;if(!ue||typeof ue.play!="function"||typeof ue.pause!="function")continue;let lt=ee(ue);he.push({compositionId:fe,timeline:ue,durationSeconds:lt??0})}return he})(),gn=se=>{for(let oe of se){let he=oe.timeline;if(typeof he.paused=="function")try{he.paused(!1)}catch(xe){L("runtime.init.site5",xe)}}};if(ye.length>0&&gn(ye),ne){let se=ye.length>0?Be(ne,ye):[];if((ye.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id=\'"+Q+"\'])"))&&(gr=!0),se.length>0)try{let fe=ne.time();ne.seek(fe,!1)}catch{}let oe=ee(ne);if(!K(oe)&&ye.length>0){let fe=ye.map(zm=>zm.compositionId),ue=$(ye),lt=ee(ue);if(ue&&K(lt))return{timeline:ue,selectedTimelineIds:fe,selectedDurationSeconds:lt,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:Q,rootDurationSeconds:oe,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:G,selectedDurationSeconds:lt,mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:w,selectedTimelineIds:fe,autoNestedChildren:se}}};let Je=le(N??0,ne),Yi=ee(Je);if(Je&&K(Yi))return{timeline:Je,selectedTimelineIds:[Q],selectedDurationSeconds:Yi,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:Q,rootDurationSeconds:oe,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:w,selectedDurationSeconds:Yi,selectedTimelineIds:[Q],autoNestedChildren:se}}}}if(!K(oe)&&ye.length===0){let fe=le(N??0,ne),ue=ee(fe);if(fe&&K(ue))return{timeline:fe,selectedTimelineIds:[Q],selectedDurationSeconds:ue,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:Q,rootDurationSeconds:oe,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:y,authoredCompositionDurationFloorSeconds:w,selectedDurationSeconds:ue,selectedTimelineIds:[Q]}}}}let he=ve(Me?.getAttribute("data-duration")),xe=Math.max(K(he)?he:0,w??0);if(xe>0&&K(xe)&&K(oe)&&xe>=oe+.5){let fe=ne;if(typeof fe.to=="function")try{fe.to({},{duration:0},xe)}catch(lt){L("runtime.init.site6",lt)}let ue=ee(ne);if(K(ue))return{timeline:ne,selectedTimelineIds:[Q],selectedDurationSeconds:ue,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:Q,rootDurationSeconds:oe,rootDeclaredDur:he,authoredCompositionDurationFloorSeconds:w,newDur:ue}}}}return{timeline:ne,selectedTimelineIds:[Q],selectedDurationSeconds:oe,mediaDurationFloorSeconds:y,diagnostics:se.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:Q,selectedDurationSeconds:oe,autoNestedChildren:se}}:void 0}}if(ye.length>0){let se=ye.map(xe=>xe.compositionId),oe=$(ye),he=ee(oe);if(oe)return{timeline:oe,selectedTimelineIds:se,selectedDurationSeconds:he,mediaDurationFloorSeconds:y,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:Q,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:G,selectedDurationSeconds:he,mediaDurationFloorSeconds:y,selectedTimelineIds:se}}}}return g("root_composition_id_unmatched_in_registry")},gr=!1,Em=d=>{let g=window.gsap,h=d;if(!(!h||typeof h.getChildren!="function"||!g||typeof g.parseEase!="function"))for(let y of h.getChildren(!0,!0,!0)){let w=y,N=w.timeline;if(!N||!("_ease"in N)||typeof N._ease=="function")continue;let G=w.vars?.keyframes,$=(G&&!Array.isArray(G)?G.ease:void 0)??w.vars?.ease??"none";try{let le=g.parseEase($);typeof le=="function"&&(N._ease=le)}catch(le){Ne("keyframe_ease_repair_failed",{ease:typeof $=="string"?$:String($)}),L("runtime.keyframeEase.repair",le)}}},dn=()=>{if(x(),!B)return!1;let d=e.capturedTimeline,g=ee(d),h=K(g);if(d&&h&&gr)return!1;let y=Oi();if(!y.timeline)return!1;if(d&&d===y.timeline)return typeof d.timeScale=="function"&&d.timeScale(e.playbackRate),!1;e.capturedTimeline=y.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),Em(e.capturedTimeline);let w=Ce(e.capturedTimeline,0);if(w<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),ot(e.capturedTimeline)),w>0){try{f.setDuration(w)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let G=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(G,!1),ot(e.capturedTimeline)}let N=window.__hfStudioManualEditsApply;typeof N=="function"&&N(),mi(document)}if(y.diagnostics&&be({source:"hf-preview",type:"diagnostic",code:y.diagnostics.code,details:y.diagnostics.details}),be({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:y.selectedTimelineIds??[],selectedDurationSeconds:y.selectedDurationSeconds??null,mediaDurationFloorSeconds:y.mediaDurationFloorSeconds??null}}),window.parent!==window){let N=Y(),G=w>0?w:0,re=String(G>0?G:1),$=new Set,le=Q=>Q.tagName.toLowerCase()===Ut,Be=new Set(document.querySelectorAll("[data-start]")),Me=Q=>{let ne=Q.parentElement;for(;ne&&ne!==N;){if(Be.has(ne))return!0;ne=ne.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let Q of e.capturedTimeline.getChildren(!0))if(typeof Q.targets=="function")for(let ne of Q.targets())ne instanceof HTMLElement&&ne!==N&&(le(ne)||ne.hasAttribute("data-start")||Me(ne)||$.has(ne)||($.add(ne),ne.setAttribute("data-start","0"),ne.setAttribute("data-duration",re),ne.setAttribute("data-hf-autostamped","1")))}catch{}if(N instanceof HTMLElement)for(let Q of N.querySelectorAll("[id]"))Q instanceof HTMLElement&&Q!==N&&(Q.hasAttribute("data-start")||Me(Q)||$.has(Q)||Q.tagName==="SCRIPT"||Q.tagName==="STYLE"||Q.tagName==="LINK"||le(Q)||($.add(Q),Q.setAttribute("data-start","0"),Q.setAttribute("data-duration",re),Q.setAttribute("data-hf-autostamped","1")))}for(let N of fn)br.delete(N),Es(N);return!0},gs=()=>{if(e.tornDown)return;let d=Oi();if(!d.timeline){e.capturedTimeline=null,gr=!1,f.setDuration(0),Ar(e.currentTime);return}e.capturedTimeline!==d.timeline&&(gr=!1,dn()),Ar(e.currentTime)};t=()=>{gs(),st()},window.__hfForceTimelineRebind=gs;let wm=()=>{let d=Y();if(!(d instanceof HTMLElement))return;let g=d.getBoundingClientRect(),h=Number(d.getAttribute("data-width")),y=Number(d.getAttribute("data-height")),w=window.getComputedStyle(d),N=Number.isFinite(h)&&h>0&&Number.isFinite(y)&&y>0,G=g.width<=0||g.height<=0||d.clientWidth<=0||d.clientHeight<=0;!N||!G||M("root_stage_layout_zero",{compositionId:d.getAttribute("data-composition-id")??null,declaredWidth:h,declaredHeight:y,rectWidth:Math.round(g.width),rectHeight:Math.round(g.height),clientWidth:d.clientWidth,clientHeight:d.clientHeight,display:w.display,visibility:w.visibility,overflow:w.overflow},`root-stage-layout-zero:${d.getAttribute("data-composition-id")??"unknown"}`)},Cm=()=>{e.tornDown||(s!=null&&window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{s=null,wm()}))},_m=()=>{i=d=>{let g=I(d.error??d.message).slice(0,F);if(!g)return;let h=q(g);be({source:"hf-preview",type:"diagnostic",code:h.code,details:{category:h.category,message:g,filename:d.filename||null,line:Number.isFinite(d.lineno)?d.lineno:null,column:Number.isFinite(d.colno)?d.colno:null}})},o=d=>{let g=I(d.reason).slice(0,F);if(!g)return;let h=q(g);be({source:"hf-preview",type:"diagnostic",code:`${h.code}_unhandled_rejection`,details:{category:`${h.category}-unhandled-rejection`,message:g}})},window.addEventListener("error",i),window.addEventListener("unhandledrejection",o)},Tm=()=>{let d=Array.from(document.querySelectorAll("img, video, audio, source, link[rel=\'stylesheet\']"));for(let h of d){let y=()=>{if(!(h instanceof Element))return;let w=h.tagName.toLowerCase(),N=h.getAttribute("src")??h.getAttribute("href")??h.getAttribute("poster")??null,G=w==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";M(G,{tagName:w,assetUrl:N,currentSrc:(h instanceof HTMLImageElement||h instanceof HTMLMediaElement)&&h.currentSrc||null,readyState:h instanceof HTMLMediaElement?h.readyState:null,networkState:h instanceof HTMLMediaElement?h.networkState:null},`${G}:${w}:${N??"unknown"}`)};h.addEventListener("error",y),T(()=>{h.removeEventListener("error",y)})}let g=document.fonts;g&&g.ready.then(()=>{if(e.tornDown)return;let h=Array.from(g).filter(y=>y.status==="error").map(y=>y.family).filter(y=>!!y).slice(0,10);h.length!==0&&M("runtime_font_load_issue",{failedFamilies:h,totalFaces:Array.from(g).length},`runtime-font-load-issue:${h.join("|")}`)}).catch(()=>{})},Rm=(d,g)=>{if(!d.timeline)return!1;let h=e.capturedTimeline;if(h&&h===d.timeline)return!1;let y=Math.max(0,e.currentTime||0),w=e.isPlaying;e.capturedTimeline=d.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{ot(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&e.capturedTimeline.seek(y,!1),w&&typeof e.capturedTimeline.play=="function"&&e.capturedTimeline.play()}catch(N){L("runtime.init.site7",N)}return be({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:g,previousTime:y,selectedTimelineIds:d.selectedTimelineIds??[],selectedDurationSeconds:d.selectedDurationSeconds??null,mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),!0},Et=null,bs=!1,xs=!1,fn=new Set,br=new WeakMap,xr=()=>{e.tornDown||(Et!=null&&window.clearTimeout(Et),Et=window.setTimeout(()=>{if(e.tornDown||(Et=null,xs&&window.__HF_EXPORT_RENDER_SEEK_CONFIG))return;let d=Oi();if(!d.timeline||!K(d.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){dn()&&(st(),ke(!0));return}if(bs)return;let h=ee(e.capturedTimeline),y=d.selectedDurationSeconds??ee(d.timeline);K(y)&&(!K(h)||y>=h+A)&&Rm(d,"manual")&&(bs=!0,be({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:h??null,selectedDurationSeconds:y??null,selectedTimelineIds:d.selectedTimelineIds??[],mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),st(),ke(!0))},C))},ys=d=>{d.currentTarget instanceof HTMLMediaElement&&zl(d.currentTarget)},vs=d=>{d.currentTarget instanceof HTMLMediaElement&&ql(d.currentTarget)},Ss=d=>{d instanceof HTMLAudioElement&&Ef(d)&&sn(d,an(d))},As=d=>{let g=d.currentTarget;g instanceof HTMLMediaElement&&Ss(g)},km=()=>{for(let d of fn)d.removeEventListener("loadedmetadata",xr),d.removeEventListener("durationchange",xr),d.removeEventListener("loadedmetadata",ys),d.removeEventListener("loadedmetadata",As),d.removeEventListener("error",vs);fn.clear()},Hi=()=>{if(e.tornDown)return;let d=Array.from(document.querySelectorAll("video, audio"));for(let g of d){if(fn.has(g))continue;fn.add(g);let h=Number.parseFloat(g.dataset.volume??"");Number.isFinite(h)&&(g.volume=Math.max(0,Math.min(1,h))),g.addEventListener("loadedmetadata",xr),g.addEventListener("durationchange",xr),g.addEventListener("loadedmetadata",As),Ss(g),g.addEventListener("loadedmetadata",ys),g.addEventListener("error",vs),Vl(g),g.preload!=="auto"&&(g.preload="auto"),g.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&g.load(),Es(g)}},Es=d=>{br.has(d)||El(d,e.capturedTimeline,Ce(e.capturedTimeline,0),br,{allowLiveTimelineSeek:!window.__HF_RENDER_CAPTURE_MODE})},Gi=new WeakMap,ws=d=>{let g=Gi.get(d);if(g!==void 0)return g;let h=window.getComputedStyle(d).position,y=h==="static"||h==="relative"||h==="sticky";return Gi.set(d,y),y},Bi=new WeakMap,Mm=d=>{let g=Bi.get(d);if(g!==void 0)return g;let h=d.querySelector("[data-start]")===null;return Bi.set(d,h),h},Fm=()=>{Gi=new WeakMap,Bi=new WeakMap},Ui=new WeakMap,yr=new WeakSet,vr=!1,Cs=d=>d.matches("audio[data-start]")||d.querySelector("audio[data-start]")!==null,_s=new WeakMap,Sr=!0,Nm=()=>{if(Sr){Sr=!1;for(let d of document.querySelectorAll(Ut)){let g=d.hasAttribute("data-hidden");_s.get(d)!==g&&(_s.set(d,g),d.id&&m.setGroupMuted(d.id,g))}}},Ar=(d,g=Array.from(document.querySelectorAll("[data-start]")))=>{let h=Y();for(let y of g){if(!(y instanceof HTMLElement))continue;if(y.hasAttribute("data-hidden")){yr.has(y)||(Ui.set(y,y.style.getPropertyValue("display")),yr.add(y),Cs(y)&&(vr=!0),Sr=!0),y.style.display="none",(y instanceof HTMLVideoElement||y instanceof HTMLImageElement)&&r?.setSourceVisibility(y,!1);continue}if(yr.has(y)){let N=Ui.get(y);N?y.style.display=N:y.style.removeProperty("display"),Ui.delete(y),yr.delete(y),Cs(y)&&(vr=!0),Sr=!0}let w=we(y,d);if(w){let N=y.parentElement;for(;N&&N!==h;){if(N instanceof HTMLElement&&N.hasAttribute("data-start")&&!we(N,d)){w=!1;break}N=N.parentElement}}y.style.visibility=w?"visible":"hidden",(y instanceof HTMLVideoElement||y instanceof HTMLImageElement)&&r?.setSourceVisibility(y,w),w?ws(y)&&y.style.removeProperty("display"):ws(y)&&Mm(y)&&(y.style.display="none")}vr&&f.isPlaying()&&(m.stopAll(),ji()),vr=!1,Nm()},Oe=()=>{let d=Hl({shouldIncludeElement:h=>h.hasAttribute("data-start")||!!V(h).compositionRoot,resolveStartSeconds:h=>j(h),resolveDurationSeconds:h=>{let y=V(h),w=j(h),N=y.inheritedStart!=null&&y.inheritedDuration!=null&&y.inheritedDuration>0?Math.max(0,y.inheritedStart+y.inheritedDuration-w):null,G=Number.isFinite(h.duration)?Qe(h,h.duration):null,re=ve(h.dataset.duration),$=re!=null&&re>0?re:null;return Ol({isVideo:h.tagName==="VIDEO",sourceDuration:G,hostRemaining:N,explicitDuration:$})}});for(let h of d.mediaClips){let y=br.get(h.el);y&&(h.volumeKeyframes=y)}let g=e.mediaForceSyncNextTick;g&&(e.mediaForceSyncNextTick=!1),e.nativeMediaSyncDisabled||Gl({clips:d.mediaClips,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted,userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:g,onElementVolume:(h,y,w)=>m.setElementVolume(h,w),isWebAudioOwned:h=>m.ownsElement(h),isWebAudioRouted:h=>m.routesElement(h),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,be({source:"hf-preview",type:"media-autoplay-blocked"}))}}),Ar(e.currentTime)},ke=d=>{let g=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),h=Date.now();(d||g!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||h-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=g,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=h,be({source:"hf-preview",type:"state",frame:g,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},Wi="",Ts=0,Lm=()=>{let d="";for(let g of document.querySelectorAll("[data-start]"))d+=`${g.id}:${g.tagName}|`;return d},st=()=>{U(),k(),ie();let d=Y();if(d){let y=W(d.getAttribute("data-width")),w=W(d.getAttribute("data-height")),N=y?parseInt(y,10):0,G=w?parseInt(w,10):0;N>0&&G>0&&be({source:"hf-preview",type:"stage-size",width:N,height:G})}dn();let g=Ru({canonicalFps:e.canonicalFps});window.__clipManifest=g;let h=Lm();if(Wi!==h&&Fm(),!window.__clipTree||Wi!==h){let y=window;window.__clipTree=wu({startResolver:mt({timelineRegistry:y.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:y.__timelines??{},rootDuration:g.durationInFrames/e.canonicalFps}),Wi=h}be(g),Cm()},Vi=d=>typeof d=="number"&&Number.isFinite(d)&&d>0?d:0,Dm=d=>{let g=Vi(Number(d));if(g<=0)return;let h=Y(),y=Vi(ve(h?.getAttribute("data-duration"))),w=Math.max(Ts,Vi(f.getDuration()),y);g<=w||(Ts=g,h?.setAttribute("data-duration",String(g)),f.setDuration(g),st(),ke(!0))},He=(d,g=0)=>{for(let h of e.deterministicAdapters){try{d==="discover"&&h.discover(),d==="pause"&&h.pause(),d==="play"&&h.play&&h.play()}catch(y){L("runtime.init.site8",y)}if(d==="discover")try{h.seek({time:g,suppressEvents:!0})}catch(y){L("runtime.init.site9",y)}}},wt=()=>{window.__renderReady=!1},mn=null,pn=!0,Im=()=>{let d=[];for(let g of e.deterministicAdapters){let h=g.getReadyPromise;if(typeof h=="function")try{let y=h();y&&d.push(y)}catch(y){L("runtime.init.adapterReady",y)}}return d},Pm=()=>{let d=Im();if(d.length===0)return mn=null,pn=!0,!0;let g=d[0];if(!g)return!0;let h=d.length===1?g:Promise.all(d);return h!==mn&&(mn=h,pn=!1,Promise.resolve(h).then(()=>{mn===h&&(pn=!0,wt())},y=>{mn===h&&(pn=!0,L("runtime.init.adapterReady",y),wt())})),pn};if(B)_a();else{let d={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:W,onDiagnostic:({code:g,details:h})=>{be({source:"hf-preview",type:"diagnostic",code:g,details:h})}};yd(d).then(()=>xd(d)).finally(()=>{B=!0,Hi(),Tm(),_a(),La(document),wt()})}let Er=yu({postMessage:d=>be(d)});Er.installPickerApi(),Ar(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let ze=of();r=ze,T(()=>{ze.destroy(),r=null});let zi=d=>{let g=Number(d);!Number.isFinite(g)||g<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,g)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let h=document.querySelectorAll("video, audio");for(let y of h)if(y instanceof HTMLMediaElement)try{y.playbackRate=e.playbackRate}catch(w){L("runtime.init.site10",w)}},Rs={play:()=>{let d=e.capturedTimeline;if(f.isPlaying())return;let g=Ce(d,0);if(g>0)f.setDuration(g),f.reachedEnd()&&(f.seek(0),e.currentTime=0,Ct(0));else{let h=Y(),y=Number(h?.getAttribute("data-duration")??0);y>0&&f.setDuration(y)}ot(d),f.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,Ps(f.now()),p&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&ji(),He("play"),Oe(),ze.redraw(),ke(!0))},pause:()=>{if(!f.isPlaying())return;m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1,e.currentTime=f.now(),e.mediaForceSyncNextTick=!0,Ps(e.currentTime);let d=e.capturedTimeline;ot(d),He("pause"),Oe(),ze.redraw(),ke(!0)},seek:(d,g)=>{let h=$t(Math.max(0,Number(d)||0),e.canonicalFps);m.stopAll(),f.detachAudioSource();let y=f.isPlaying();y&&f.pause(),f.seek(h),e.currentTime=f.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let w=e.capturedTimeline;if(ot(w),Ct(e.currentTime),He("pause"),g?.keepPlaying&&y){Rs.play();return}Oe(),ze.redraw(),ke(!0)},renderSeek:(d,g)=>{xs=!0;let h=$t(Math.max(0,Number(d)||0),e.canonicalFps);m.stopAll(),f.detachAudioSource(),f.isPlaying()&&f.pause(),f.seek(h),e.currentTime=f.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0,Ct(e.currentTime,{activateChildren:!0,suppressEvents:g?.suppressEvents}),He("pause"),Oe(),ze.redraw(),ke(!0)},getTime:()=>f.now(),getDuration:()=>{let d=f.getDuration();return Number.isFinite(d)?d:0},isPlaying:()=>f.isPlaying(),setPlaybackRate:d=>{zi(d),f.setRate(e.playbackRate),Os()},getPlaybackRate:()=>e.playbackRate},ks=Ce(e.capturedTimeline,0);ks>0&&f.setDuration(ks);let Ge=Au({getTimeline:()=>e.capturedTimeline,setTimeline:d=>{e.capturedTimeline=d},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:d=>{e.isPlaying!==d&&(e.mediaForceSyncNextTick=!0),e.isPlaying=d},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:zi,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(d,g)=>{e.currentTime=Math.max(0,Number(d)||0),e.isPlaying!==g&&(e.mediaForceSyncNextTick=!0),e.isPlaying=g,Oe()},onStatePost:ke,onDeterministicSeek:(d,g)=>{for(let h of e.deterministicAdapters)if(!(h.name==="gsap"&&e.capturedTimeline))try{h.seek({time:Number(d)||0,suppressEvents:g?.suppressEvents})}catch(y){L("runtime.init.site11",y)}},onDeterministicPause:()=>He("pause"),onDeterministicPlay:()=>He("play"),onRenderFrameSeek:()=>{ze.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>Ce(e.capturedTimeline,0),transport:Rs});window.__player=D(Ge),window.__playerReady=!0,Ne("composition_loaded",{duration:Ge.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[hl(),Js({resolveStartSeconds:d=>P(d,0)}),Zs(),tl(),il(),ol(),al(),sl(),ll(),ul(),cl(),Qs({getTimeline:()=>e.capturedTimeline})],ml(),pl(),window.__hfReseekGpu=d=>{let g=Math.max(0,Number(d)||0);window.__hfThreeTime=g,window.__hfTypegpuTime=g,Fr(g)},window.__hfWaitForSeekCompletion=ao,a.push(()=>{window.__hfWaitForSeekCompletion===ao&&delete window.__hfWaitForSeekCompletion}),_m(),Hi(),He("discover");let Om=()=>{let d=e.capturedTimeline,g=dn();e.capturedTimeline&&(g||e.capturedTimeline!==d||!Ge._timeline)&&(Ge._timeline=e.capturedTimeline);let h=Ce(e.capturedTimeline,0);if(h>0&&f.setDuration(h),He("discover",e.currentTime),!e.capturedTimeline){let y=window.__timelines??{},w=Object.keys(y).filter(N=>y[N]);if(w.length>0){let G=Y()?.getAttribute("data-composition-id")??null;M("root_timeline_unbound_registry_present",{reason:G?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:G,registeredTimelineKeys:w},"root_timeline_unbound_registry_present"),console.warn("[hyperframes] Root timeline not bound \\u2014 render will freeze at t=0. "+(G?`Root data-composition-id is "${G}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${w.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${G??"<root-id>"}"] = tl).`)}}window.__renderReady=!0,st(),ke(!0)},It=null,Hm=()=>{if(It)return;let d=()=>{window.removeEventListener("hf-timelines-built",d),It=null,wt()};It=d,window.addEventListener("hf-timelines-built",d)};T(()=>{It&&(window.removeEventListener("hf-timelines-built",It),It=null)}),wt=()=>{if(!B){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,Hm();return}if(He("discover",e.currentTime),!Pm()){window.__renderReady=!1;return}Om()},wt(),B&&setTimeout(()=>{wt()},0);let wr=0,qi=!1,Ms=Number.NaN,Fs=null,$i=!1,Gm=(d,g,h,y)=>{try{let w=y?.suppressEvents===!0;ot(d),typeof d.totalTime=="function"?d.totalTime(g,w):d.seek(g,w)}catch(w){L(h,w)}},Bm=(d,g)=>{let h=window.__timelines??{},y=Y()?.getAttribute("data-composition-id")??null;for(let[w,N]of Object.entries(h)){if(!N||w===y)continue;let G=document.querySelector(`[data-composition-id="${CSS.escape(w)}"]`);if(!G)continue;let re=P(G,0);if(!Number.isFinite(re))continue;let $=ee(N),le=$e(G)+Math.max(0,d-re)*_e(G),Be=Math.max(0,$!=null&&$>0?Math.min($,le):le);Gm(N,Be,"runtime.init.transport.childTimeline",g)}},Ns=d=>{let g=window.__timelines??{};for(let h of Object.values(g))if(!(!h||h===d))try{h.play()}catch(y){L("runtime.init.activateSiblings",y)}},Ls=d=>typeof d=="object"&&d!==null,hn=new WeakMap,Um=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],Ds=(d,g)=>{let h=d[g];if(typeof h!="function")return null;try{let y=Number(h.call(d));return Number.isFinite(y)?y:null}catch(y){return L("runtime.init.gsapCallbackDuration",y),null}},Wm=d=>{let g=hn.get(d);if(g!=null)return g;if(!("getChildren"in d)||typeof d.getChildren!="function")return!1;let h;try{h=d.getChildren(!0,!0,!0)}catch(y){return L("runtime.init.gsapCallbackChildren",y),hn.set(d,!1),!1}if(!Array.isArray(h))return hn.set(d,!1),!1;for(let y of h){if(!Ls(y))continue;let w=y.vars;if(!Ls(w)||!Um.some($=>typeof w[$]=="function"))continue;let re=Ds(y,"totalDuration")??Ds(y,"duration");if(re!=null&&re<=1e-6)return hn.set(d,!0),!0}return hn.set(d,!1),!1};function Ct(d,g){let h=e.capturedTimeline,y=g?.suppressEvents===!0;if(h){g?.activateChildren&&Ns(h);let w=h,N=d;if(typeof w.totalDuration=="function")try{let G=Number(w.totalDuration());Number.isFinite(G)&&G>0&&d>G&&(N=G)}catch(G){L("runtime.init.transport.clampDuration",G)}try{typeof h.totalTime=="function"?(h.totalTime(N,y),!y&&!Wm(h)&&(h.totalTime(N+.001,!0),h.totalTime(N,!0))):h.seek(N,y)}catch(G){L("runtime.init.transport.seek",G)}}Bm(d,g),h&&g?.activateChildren&&Ns(h);for(let w of e.deterministicAdapters)if(!(w.name==="gsap"&&h))try{w.seek({time:d,suppressEvents:y})}catch(N){L("runtime.init.transport.adapter",N)}}let Vm=()=>{try{return document.querySelector(`[${Cf}]`)!=null}catch{return!1}},Is=()=>{if(!(e.tornDown||qi)){qi=!0;try{if(e.transportRafId=window.requestAnimationFrame(Is),wr+=1,_f({tick:wr,isPlaying:f.isPlaying(),hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:f.now()})){let y=e.capturedTimeline;if(dn()){e.capturedTimeline&&!Ge._timeline&&(Ge._timeline=e.capturedTimeline),e.capturedTimeline&&e.capturedTimeline!==y&&ot(e.capturedTimeline);let w=Ce(e.capturedTimeline,0);w>0&&f.setDuration(w),st()}}if(wr%20===0&&st(),wr%30===0&&Hi(),e.capturedTimeline){let y=Ce(e.capturedTimeline,0);y>0&&(!f.isPlaying()||y>=f.getDuration())&&f.setDuration(y)}if(f.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&m.isActive()&&m.context){let y=m.getTime();y>=0&&f.attachAudioSource({currentTimeSeconds:y})}else{let y=document.querySelectorAll("audio[data-start]"),w=!1;for(let N of y){if(!(N instanceof HTMLMediaElement)||!N.isConnected||b(N))continue;let G=Number.parseFloat(N.dataset.start??""),re=ve(N.dataset.duration),$=re!=null&&re>0?G+re:1/0,le=$e(N);if(Number.isFinite(G)&&e.currentTime>=G&&e.currentTime<$){N.paused?!N.error&&N.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(f.attachAudioSource({currentTimeSeconds:e.currentTime}),w=!0):(f.attachAudioSource({el:N,compositionStart:G,mediaStart:le}),w=!0);break}}!w&&f.hasAudioSource()&&f.detachAudioSource()}else f.hasAudioSource()&&f.detachAudioSource();let d=f.now();e.currentTime=d;let g=f.isPlaying();if(!g&&Vm()?$i=!0:(g||$i||d!==Ms||e.capturedTimeline!==Fs)&&(Ct(d),Ms=d,Fs=e.capturedTimeline,g||($i=!1)),g&&ze.redrawAnimated(),f.isPlaying()&&f.reachedEnd()){m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1;let y=f.getDuration();Number.isFinite(y)&&(f.seek(y),e.currentTime=y,Ct(y)),He("pause"),Oe(),ke(!0);return}f.isPlaying()&&Oe(),ke(!1)}finally{qi=!1}}},Ps=d=>{let g=document.querySelectorAll("video, audio");for(let h of g){if(!(h instanceof HTMLMediaElement)||!h.isConnected)continue;let y=Number.parseFloat(h.dataset.start??"");if(!Number.isFinite(y))continue;let w=ve(h.dataset.duration),N=w!=null&&w>0?y+w:1/0;if(d<y||d>=N)continue;let G=$e(h),re=d-y+G;if(re>=0)try{h.currentTime=re}catch{}}},ji=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let d=m.startGeneration(),g=document.querySelectorAll("audio[data-start]");for(let h of g){if(!(h instanceof HTMLMediaElement)||!h.isConnected||b(h))continue;let y=Number.parseFloat(h.dataset.start??"");if(!Number.isFinite(y))continue;let w=$e(h),N=Number.parseFloat(h.dataset.volume??""),G=Number.isFinite(N)?N:1,re=ve(h.dataset.duration),$=re!=null&&re>0?re:Number.POSITIVE_INFINITY,le=h.closest("[data-composition-id]");if(le){let Q=P(le,0),ne=H(le,{includeAuthoredTimingAttrs:!0});ne!=null&&ne>0&&($=Math.min($,Math.max(0,Q+ne-y)))}let Be=an(h);sn(h,Be),(Be.kind==="web-audio"?m.scheduleMediaElementPlayback(h,y,w,f.now(),G,d,e.playbackRate):Promise.resolve(null)).then(Q=>{if(Q||!f.isPlaying())return;let ne=e.playbackRate*_e(h),_t=h.hasAttribute("data-fx-chain")||h.hasAttribute("data-automation");if(Math.abs(ne-1)>1e-9){Be.kind==="web-audio"&&_t&&(h.muted=!0);return}m.decodeAudioElement(h).then(ye=>{!ye||!f.isPlaying()||m.schedulePlayback(h,ye,y,w,f.now(),G,d,e.playbackRate,$)})})}};function Os(){m.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&p&&f.isPlaying()&&m.hasBoundedActiveSources()&&(m.stopAll(),ji())}if(e.capturedTimeline){let d=Ce(e.capturedTimeline,0);d>0&&f.setDuration(d),ot(e.capturedTimeline)}Cd(window),e.transportRafId=window.requestAnimationFrame(Is),st(),ke(!0),e.controlBridgeHandler=Us({onPlay:()=>{Ge.play(),Ne("composition_played",{time:Ge.getTime()})},onPause:()=>{Ge.pause(),Ne("composition_paused",{time:Ge.getTime()})},onStopMedia:()=>{m.stopAll();let d=document.querySelectorAll("video, audio");for(let g of d)g instanceof HTMLMediaElement&&!g.paused&&g.pause()},onSeek:(d,g)=>{Ge.seek(d),Ne("composition_seeked",{time:d})},onSetMuted:d=>{e.bridgeMuted=d;let g=d||e.mediaOutputMuted;m.setMuted(g);let h=document.querySelectorAll("video, audio");for(let y of h)y instanceof HTMLMediaElement&&(y.muted=g||y.defaultMuted)},onSetVolume:d=>{e.bridgeVolume=d,m.setVolume(d);let g=document.querySelectorAll("video, audio");for(let h of g){if(!(h instanceof HTMLMediaElement))continue;let y=parseFloat(h.dataset.volume??""),w=Number.isFinite(y)?y:1;h.volume=Nr(w*d)}},onSetMediaOutputMuted:d=>{e.mediaOutputMuted=d;let g=d||e.bridgeMuted;m.setMuted(g);let h=document.querySelectorAll("video, audio");for(let y of h)y instanceof HTMLMediaElement&&(y.muted=g||y.defaultMuted)},onSetNativeMediaSyncDisabled:d=>{e.nativeMediaSyncDisabled!==d&&(e.nativeMediaSyncDisabled=d,e.mediaForceSyncNextTick=!0,d?(m.stopAll(),f.detachAudioSource()):Oe())},onSetWebAudioMediaDisabled:d=>{e.webAudioMediaDisabled!==d&&(e.webAudioMediaDisabled=d,e.mediaForceSyncNextTick=!0,d&&(m.stopAll(),f.detachAudioSource()),Oe())},onSetPlaybackRate:d=>{zi(d),e.transportClock&&e.transportClock.setRate(e.playbackRate),Os()},onSetRootDuration:Dm,onSetColorGrading:(d,g)=>{ze.setGrading(d,g)},onSetColorGradingCompare:(d,g)=>{ze.setCompare(d,g)},onTick:()=>{if(e.tornDown||!f.isPlaying())return;let d=f.now();if(e.currentTime=d,Ct(d),f.reachedEnd()){m.stopAll(),f.detachAudioSource(),f.pause(),e.isPlaying=!1;let g=f.getDuration();Number.isFinite(g)&&(f.seek(g),e.currentTime=g,Ct(g)),He("pause"),Oe(),ke(!0)}},onEnablePickMode:()=>Er.enablePickMode(),onDisablePickMode:()=>Er.disablePickMode(),onSetRuntimeData:Ri,onClearRuntimeData:ki,getCanonicalFps:()=>e.canonicalFps});let Ki=()=>{if(!e.tornDown){e.tornDown=!0,e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),e.transportClock=null,m.destroy(),Et!=null&&(window.clearTimeout(Et),Et=null),s!=null&&(window.cancelAnimationFrame(s),s=null),km(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),i&&(window.removeEventListener("error",i),i=null),o&&(window.removeEventListener("unhandledrejection",o),o=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),Er.disablePickMode();for(let d of e.deterministicAdapters)if(!(!d||typeof d.revert!="function"))try{d.revert()}catch(g){L("runtime.init.site12",g)}e.deterministicAdapters=[];for(let d of a.splice(0))try{d()}catch(g){L("runtime.init.site13",g)}for(let d of e.injectedCompStyles)try{d.remove()}catch(g){L("runtime.init.site14",g)}e.injectedCompStyles=[];for(let d of e.injectedCompLinks)try{d.remove()}catch(g){L("runtime.init.site15",g)}e.injectedCompLinks=[];for(let d of e.injectedCompScripts)try{d.remove()}catch(g){L("runtime.init.site16",g)}e.injectedCompScripts=[],e.capturedTimeline=null,t=()=>{},window.__hfRuntimeTeardown===Ki&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=Ki,e.beforeUnloadHandler=Ki,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var Vf=["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"],ss=[[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 xy(e){if(e<=255)return Vf[e];let t=0,n=ss.length-1;for(;t<=n;){let r=t+n>>1,i=ss[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return"L"}function yy(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let u=0;u<t;){let c=e.charCodeAt(u),f=c,m=1;if(c>=55296&&c<=56319&&u+1<t){let b=e.charCodeAt(u+1);b>=56320&&b<=57343&&(f=(c-55296<<10)+(b-56320)+65536,m=2)}let p=xy(f);(p==="R"||p==="AL"||p==="AN")&&(r=!0);for(let b=0;b<m;b++)n[u+b]=p;u+=m}if(!r)return null;let i=0;for(let u=0;u<t;u++){let c=n[u];if(c==="L"){i=0;break}if(c==="R"||c==="AL"){i=1;break}}let o=new Int8Array(t);for(let u=0;u<t;u++)o[u]=i;let a=i&1?"R":"L",l=a,s=l;for(let u=0;u<t;u++)n[u]==="NSM"?n[u]=s:s=n[u];s=l;for(let u=0;u<t;u++){let c=n[u];c==="EN"?n[u]=s==="AL"?"AN":"EN":(c==="R"||c==="L"||c==="AL")&&(s=c)}for(let u=0;u<t;u++)n[u]==="AL"&&(n[u]="R");for(let u=1;u<t-1;u++)n[u]==="ES"&&n[u-1]==="EN"&&n[u+1]==="EN"&&(n[u]="EN"),n[u]==="CS"&&(n[u-1]==="EN"||n[u-1]==="AN")&&n[u+1]===n[u-1]&&(n[u]=n[u-1]);for(let u=0;u<t;u++){if(n[u]!=="EN")continue;let c;for(c=u-1;c>=0&&n[c]==="ET";c--)n[c]="EN";for(c=u+1;c<t&&n[c]==="ET";c++)n[c]="EN"}for(let u=0;u<t;u++){let c=n[u];(c==="WS"||c==="ES"||c==="ET"||c==="CS")&&(n[u]="ON")}s=l;for(let u=0;u<t;u++){let c=n[u];c==="EN"?n[u]=s==="L"?"L":"EN":(c==="R"||c==="L")&&(s=c)}for(let u=0;u<t;u++){if(n[u]!=="ON")continue;let c=u+1;for(;c<t&&n[c]==="ON";)c++;let f=u>0?n[u-1]:l,m=c<t?n[c]:l,p=f!=="L"?"R":"L";if(p===(m!=="L"?"R":"L"))for(let v=u;v<c;v++)n[v]=p;u=c-1}for(let u=0;u<t;u++)n[u]==="ON"&&(n[u]=a);for(let u=0;u<t;u++){let c=n[u];(o[u]&1)===0?c==="R"?o[u]++:(c==="AN"||c==="EN")&&(o[u]+=2):(c==="L"||c==="AN"||c==="EN")&&o[u]++}return o}function zf(e,t){let n=yy(e);if(n===null)return null;let r=new Int8Array(t.length);for(let i=0;i<t.length;i++)r[i]=n[t[i]];return r}var vy=/[ \\t\\n\\r\\f]+/g,Sy=/[\\t\\n\\r\\f]| {2,}|^ | $/;function Ay(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Ey(e){if(!Sy.test(e))return e;let t=e.replace(vy," ");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 wy(e){return/[\\r\\f]/.test(e)?e.replace(/\\r\\n/g,`\n`).replace(/[\\r\\f]/g,`\n`):e.replace(/\\r\\n/g,`\n`)}var ls=null,Cy;function _y(){return ls===null&&(ls=new Intl.Segmenter(Cy,{granularity:"word"})),ls}var Ty=/\\p{Script=Arabic}/u,Mi=/\\p{M}/u,Qf=/\\p{Nd}/u;function qf(e){return Ty.test(e)}function $f(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 Ve(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){let r=e.charCodeAt(t+1);if(r>=56320&&r<=57343){let i=(n-55296<<10)+(r-56320)+65536;if($f(i))return!0;t++;continue}}if($f(n))return!0}}return!1}function Ry(e){let t=Li(e);return t!==null&&(Ni.has(t)||vt.has(t))}var ky=new Set(["\\xA0","\\u202F","\\u2060","\\uFEFF"]);function My(e){return Ve(e)}function Fy(e){let t=Li(e);return t!==null&&ky.has(t)}function Fi(e){return!Ry(e)&&!Fy(e)}var Ni=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"]),hr=new Set([\'"\',"(","[","{","\\u201C","\\u2018","\\xAB","\\u2039","\\uFF08","\\u3014","\\u3008","\\u300A","\\u300C","\\u300E","\\u3010","\\u3016","\\u3018","\\u301A"]),cs=new Set(["\'","\\u2019"]),vt=new Set([".",",","!","?",":",";","\\u060C","\\u061B","\\u061F","\\u0964","\\u0965","\\u104A","\\u104B","\\u104C","\\u104D","\\u104F",")","]","}","%",\'"\',"\\u201D","\\u2019","\\xBB","\\u203A","\\u2026"]),Ny=new Set([":",".","\\u060C","\\u061B"]),Ly=new Set(["\\u104F"]),Dy=new Set(["\\u201D","\\u2019","\\xBB","\\u203A","\\u300D","\\u300F","\\u3011","\\u300B","\\u3009","\\u3015","\\uFF09"]);function Iy(e){if(ds(e))return!0;let t=!1;for(let n of e){if(vt.has(n)){t=!0;continue}if(!(t&&Mi.test(n)))return!1}return t}function Py(e){for(let t of e)if(!Ni.has(t)&&!vt.has(t))return!1;return e.length>0}function Oy(e){if(ds(e))return!0;for(let t of e)if(!hr.has(t)&&!cs.has(t)&&!Mi.test(t))return!1;return e.length>0}function ds(e){let t=!1;for(let n of e)if(!(n==="\\\\"||Mi.test(n))){if(hr.has(n)||vt.has(n)||cs.has(n)){t=!0;continue}return!1}return t}function Zf(e,t){let n=t-1;if(n<=0)return Math.max(n,0);let r=e.charCodeAt(n);if(r<56320||r>57343)return n;let i=n-1;if(i<0)return n;let o=e.charCodeAt(i);return o>=55296&&o<=56319?i:n}function Li(e){if(e.length===0)return null;let t=Zf(e,e.length);return e.slice(t)}function Hy(e){let t=Array.from(e),n=t.length;for(;n>0;){let r=t[n-1];if(Mi.test(r)){n--;continue}if(hr.has(r)||cs.has(r)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Gy(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="\\u2014"?e:null}function jf(e,t,n,r){let i=t[r],o=e[r];if(i==null)return o;let a=n[r];if(o.length===a)return o;let l=i.repeat(a);return e[r]=l,l}function Kf(e,t){return e&&t!==null&&Ny.has(t)}function By(e){let t=Li(e);return t!==null&&Ly.has(t)}function Uy(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 Di(e){let t=e.length;for(;t>0;){let n=Zf(e,t),r=e.slice(n,t);if(Dy.has(r))return!0;if(!vt.has(r))return!1;t=n}return!1}function Wy(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`\n`)return"hard-break"}return e===" "?"space":e==="\\xA0"||e==="\\u202F"||e==="\\u2060"||e==="\\uFEFF"?"glue":e==="\\u200B"?"zero-width-break":e==="\\xAD"?"soft-hyphen":"text"}var Vy=/[\\x20\\t\\n\\xA0\\xAD\\u200B\\u202F\\u2060\\uFEFF]/;function Ie(e){return e.length===1?e[0]:e.join("")}function zy(e,t){let n=[];for(let r=e.length-1;r>=0;r--)n.push(e[r]);return n.push(t),Ie(n)}function qy(e,t,n,r){if(!Vy.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];let i=[],o=null,a=[],l=n,s=!1,u=0;for(let c of e){let f=Wy(c,r),m=f==="text"&&t;if(o!==null&&f===o&&m===s){a.push(c),u+=c.length;continue}o!==null&&i.push({text:Ie(a),isWordLike:s,kind:o,start:l}),o=f,a=[c],l=n+u,s=m,u+=c.length}return o!==null&&i.push({text:Ie(a),isWordLike:s,kind:o,start:l}),i}function us(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var $y=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function jy(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:$y.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Ky(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Yy(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let a=0;a<e.len;a++){if(r[a]!=="text"||!jy(e,a))continue;let l=[t[a]],s=a+1;for(;s<e.len&&!us(r[s]);){l.push(t[s]),n[a]=!0;let u=t[s].includes("?");if(r[s]="text",t[s]="",s++,u)break}t[a]=Ie(l)}let o=0;for(let a=0;a<t.length;a++){let l=t[a];l.length!==0&&(o!==a&&(t[o]=l,n[o]=n[a],r[o]=r[a],i[o]=i[a]),o++)}return t.length=o,n.length=o,r.length=o,i.length=o,{len:o,texts:t,isWordLike:n,kinds:r,starts:i}}function Xy(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o]),!Ky(a))continue;let l=o+1;if(l>=e.len||us(e.kinds[l]))continue;let s=[],u=e.starts[l],c=l;for(;c<e.len&&!us(e.kinds[c]);)s.push(e.texts[c]),c++;s.length>0&&(t.push(Ie(s)),n.push(!0),r.push("text"),i.push(u),o=c-1)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}var Jy=new Set([":","-","/","\\xD7",",",".","+","\\u2013","\\u2014"]),Yf=/^[A-Za-z0-9_]+[,:;]*$/,Xf=/[,:;]+$/;function em(e){for(let t of e)if(Qf.test(t))return!0;return!1}function pr(e){if(e.length===0)return!1;for(let t of e)if(!(Qf.test(t)||Jy.has(t)))return!1;return!0}function Qy(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o];if(l==="text"&&pr(a)&&em(a)){let s=[a],u=o+1;for(;u<e.len&&e.kinds[u]==="text"&&pr(e.texts[u]);)s.push(e.texts[u]),u++;t.push(Ie(s)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=u-1;continue}t.push(a),n.push(e.isWordLike[o]),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Zy(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o],s=e.isWordLike[o];if(l==="text"&&s&&Yf.test(a)){let u=[a],c=Xf.test(a),f=o+1;for(;c&&f<e.len&&e.kinds[f]==="text"&&e.isWordLike[f]&&Yf.test(e.texts[f]);){let m=e.texts[f];u.push(m),c=Xf.test(m),f++}t.push(Ie(u)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=f-1;continue}t.push(a),n.push(s),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function e1(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(e.kinds[o]==="text"&&a.includes("-")){let l=a.split("-"),s=l.length>1;for(let u=0;u<l.length;u++){let c=l[u];if(!s)break;(c.length===0||!em(c)||!pr(c))&&(s=!1)}if(s){let u=0;for(let c=0;c<l.length;c++){let f=l[c],m=c<l.length-1?`${f}-`:f;t.push(m),n.push(!0),r.push("text"),i.push(e.starts[o]+u),u+=m.length}continue}}t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function t1(e){let t=[],n=[],r=[],i=[],o=0;for(;o<e.len;){let a=[e.texts[o]],l=e.isWordLike[o],s=e.kinds[o],u=e.starts[o];if(s==="glue"){let c=[a[0]],f=u;for(o++;o<e.len&&e.kinds[o]==="glue";)c.push(e.texts[o]),o++;let m=Ie(c);if(o<e.len&&e.kinds[o]==="text")a[0]=m,a.push(e.texts[o]),l=e.isWordLike[o],s="text",u=f,o++;else{t.push(m),n.push(!1),r.push("glue"),i.push(f);continue}}else o++;if(s==="text")for(;o<e.len&&e.kinds[o]==="glue";){let c=[];for(;o<e.len&&e.kinds[o]==="glue";)c.push(e.texts[o]),o++;let f=Ie(c);if(o<e.len&&e.kinds[o]==="text"){a.push(f,e.texts[o]),l=l||e.isWordLike[o],o++;continue}a.push(f)}t.push(Ie(a)),n.push(l),r.push(s),i.push(u)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function n1(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let o=0;o<t.length-1;o++){if(r[o]!=="text"||r[o+1]!=="text"||!Ve(t[o])||!Ve(t[o+1]))continue;let a=Hy(t[o]);a!==null&&(t[o]=a.head,t[o+1]=a.tail+t[o+1],i[o+1]=i[o]+a.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Jf(e,t,n){let r=_y(),i=0,o=[],a=[],l=[],s=[],u=[],c=[],f=[],m=[],p=[],b=[],v=[],x=[];for(let E of r.segment(e))for(let S of qy(E.segment,E.isWordLike??!1,E.index,n)){let U=function(){c[k]!==null&&(a[k]=[jf(o,c,f,k)],c[k]=null),a[k].push(S.text),l[k]=l[k]||S.isWordLike,m[k]=m[k]||F,p[k]=p[k]||I,b[k]=W,v[k]=Y,x[k]=Kf(p[k],q)},A=S.kind==="text",C=Gy(S.text,S.isWordLike,S.kind),F=Ve(S.text),I=qf(S.text),q=Li(S.text),W=Di(S.text),Y=By(S.text),k=i-1;t.carryCJKAfterClosingQuote&&A&&i>0&&s[k]==="text"&&F&&m[k]&&b[k]||A&&i>0&&s[k]==="text"&&Py(S.text)&&m[k]||A&&i>0&&s[k]==="text"&&v[k]?U():A&&i>0&&s[k]==="text"&&S.isWordLike&&I&&x[k]?(U(),l[k]=!0):C!==null&&i>0&&s[k]==="text"&&c[k]===C?f[k]=(f[k]??1)+1:A&&!S.isWordLike&&i>0&&s[k]==="text"&&(Iy(S.text)||S.text==="-"&&l[k])?U():(o[i]=S.text,a[i]=[S.text],l[i]=S.isWordLike,s[i]=S.kind,u[i]=S.start,c[i]=C,f[i]=C===null?0:1,m[i]=F,p[i]=I,b[i]=W,v[i]=Y,x[i]=Kf(I,q),i++)}for(let E=0;E<i;E++){if(c[E]!==null){o[E]=jf(o,c,f,E);continue}o[E]=Ie(a[E])}for(let E=1;E<i;E++)s[E]==="text"&&!l[E]&&ds(o[E])&&s[E-1]==="text"&&(o[E-1]+=o[E],l[E-1]=l[E-1]||l[E],o[E]="");let _=Array.from({length:i},()=>null),R=-1;for(let E=i-1;E>=0;E--){let S=o[E];if(S.length!==0){if(s[E]==="text"&&!l[E]&&Oy(S)&&R>=0&&s[R]==="text"){let A=_[R]??[];A.push(S),_[R]=A,u[R]=u[E],o[E]="";continue}R=E}}for(let E=0;E<i;E++){let S=_[E];S!=null&&(o[E]=zy(S,o[E]))}let T=0;for(let E=0;E<i;E++){let S=o[E];S.length!==0&&(T!==E&&(o[T]=S,l[T]=l[E],s[T]=s[E],u[T]=u[E]),T++)}o.length=T,l.length=T,s.length=T,u.length=T;let M=t1({len:T,texts:o,isWordLike:l,kinds:s,starts:u}),D=n1(Zy(e1(Qy(Xy(Yy(M))))));for(let E=0;E<D.len-1;E++){let S=Uy(D.texts[E]);S!==null&&(D.kinds[E]!=="space"&&D.kinds[E]!=="preserved-space"||D.kinds[E+1]!=="text"||!qf(D.texts[E+1])||(D.texts[E]=S.space,D.isWordLike[E]=!1,D.kinds[E]=D.kinds[E]==="preserved-space"?"preserved-space":"space",D.texts[E+1]=S.marks+D.texts[E+1],D.starts[E+1]=D.starts[E]+S.space.length))}return D}function r1(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];let n=[],r=0;for(let i=0;i<e.len;i++)e.kinds[i]==="hard-break"&&(n.push({startSegmentIndex:r,endSegmentIndex:i,consumedEndSegmentIndex:i+1}),r=i+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function i1(e){if(e.len<=1)return e;let t=[],n=[],r=[],i=[],o=null,a=!1,l=0,s=!1,u=!1;function c(){o!==null&&(t.push(Ie(o)),n.push(a),r.push("text"),i.push(l),o=null)}for(let f=0;f<e.len;f++){let m=e.texts[f],p=e.kinds[f],b=e.isWordLike[f],v=e.starts[f];if(p==="text"){let x=My(m),_=Fi(m);if(o!==null&&s&&u){o.push(m),a=a||b,s=s||x,u=_;continue}c(),o=[m],a=b,l=v,s=x,u=_;continue}c(),t.push(m),n.push(b),r.push(p),i.push(v)}return c(),{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function tm(e,t,n="normal",r="normal"){let i=Ay(n),o=i.mode==="pre-wrap"?wy(e):Ey(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let a=r==="keep-all"?i1(Jf(o,t,i)):Jf(o,t,i);return{normalized:o,chunks:r1(a,i),...a}}var ln=null,nm=new Map,un=null,o1=96,a1=/\\p{Emoji_Presentation}/u,s1=/[\\p{Emoji_Presentation}\\p{Extended_Pictographic}\\p{Regional_Indicator}\\uFE0F\\u20E3]/u,fs=null,rm=new Map;function ms(){if(ln!==null)return ln;if(typeof OffscreenCanvas<"u")return ln=new OffscreenCanvas(1,1).getContext("2d"),ln;if(typeof document<"u")return ln=document.createElement("canvas").getContext("2d"),ln;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function l1(e){let t=nm.get(e);return t||(t=new Map,nm.set(e,t)),t}function at(e,t){let n=t.get(e);return n===void 0&&(n={width:ms().measureText(e).width,containsCJK:Ve(e)},t.set(e,n)),n}function At(){if(un!==null)return un;if(typeof navigator>"u")return un={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},un;let e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),r=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return un={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:r,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},un}function u1(e){let t=e.match(/(\\d+(?:\\.\\d+)?)\\s*px/);return t?parseFloat(t[1]):16}function im(){return fs===null&&(fs=new Intl.Segmenter(void 0,{granularity:"grapheme"})),fs}function c1(e){return a1.test(e)||e.includes("\\uFE0F")}function om(e){return s1.test(e)}function d1(e,t){let n=rm.get(e);if(n!==void 0)return n;let r=ms();r.font=e;let i=r.measureText("\\u{1F600}").width;if(n=0,i>t+.5&&typeof document<"u"&&document.body!==null){let o=document.createElement("span");o.style.font=e,o.style.display="inline-block",o.style.visibility="hidden",o.style.position="absolute",o.textContent="\\u{1F600}",document.body.appendChild(o);let a=o.getBoundingClientRect().width;document.body.removeChild(o),i-a>.5&&(n=i-a)}return rm.set(e,n),n}function f1(e){let t=0,n=im();for(let r of n.segment(e))c1(r.segment)&&t++;return t}function m1(e,t){return t.emojiCount===void 0&&(t.emojiCount=f1(e)),t.emojiCount}function St(e,t,n){return n===0?t.width:t.width-m1(e,t)*n}function am(e,t,n,r,i){if(t.breakableFitAdvances!==void 0)return t.breakableFitAdvances;let o=im(),a=[];for(let c of o.segment(e))a.push(c.segment);if(a.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(i==="sum-graphemes"){let c=[];for(let f of a){let m=at(f,n);c.push(St(f,m,r))}return t.breakableFitAdvances=c,t.breakableFitAdvances}if(i==="pair-context"||a.length>o1){let c=[],f=null,m=0;for(let p of a){let b=at(p,n),v=St(p,b,r);if(f===null)c.push(v);else{let x=f+p,_=at(x,n);c.push(St(x,_,r)-m)}f=p,m=v}return t.breakableFitAdvances=c,t.breakableFitAdvances}let l=[],s="",u=0;for(let c of a){s+=c;let f=at(s,n),m=St(s,f,r);l.push(m-u),u=m}return t.breakableFitAdvances=l,t.breakableFitAdvances}function sm(e,t){let n=ms();n.font=e;let r=l1(e),i=u1(e),o=t?d1(e,i):0;return{cache:r,fontSize:i,emojiCorrection:o}}function p1(e,t){for(;t<e.widths.length;){let n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function lm(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function um(e,t,n,r,i){let o=0,a=t;for(;o<e.length;){let l=a+e[o];if((o+1<e.length?l+i:l)>n+r)break;a=l,o++}return{fitCount:o,fittedWidth:a}}function h1(e,t){let n=0,r=e.chunks.length;for(;n<r;){let i=Math.floor((n+r)/2);t<e.chunks[i].consumedEndSegmentIndex?r=i:n=i+1}return n<e.chunks.length?n:-1}function cm(e,t,n){let r=n.segmentIndex;if(n.graphemeIndex>0)return t;let i=e.chunks[t];if(i.startSegmentIndex===i.endSegmentIndex&&r===i.startSegmentIndex)return n.segmentIndex=r,n.graphemeIndex=0,t;for(r<i.startSegmentIndex&&(r=i.startSegmentIndex);r<i.endSegmentIndex;){let o=e.kinds[r];if(o!=="space"&&o!=="zero-width-break"&&o!=="soft-hyphen")return n.segmentIndex=r,n.graphemeIndex=0,t;r++}return i.consumedEndSegmentIndex>=e.widths.length?-1:(n.segmentIndex=i.consumedEndSegmentIndex,n.graphemeIndex=0,t+1)}function dm(e,t){if(t.segmentIndex>=e.widths.length)return-1;let n=h1(e,t.segmentIndex);return n<0?-1:cm(e,n,t)}function g1(e,t,n){if(n.segmentIndex>=e.widths.length)return-1;let r=t;for(;r<e.chunks.length&&n.segmentIndex>=e.chunks[r].consumedEndSegmentIndex;)r++;return r>=e.chunks.length?-1:cm(e,r,n)}function fm(e,t){return e.simpleLineWalkFastPath?mm(e,t):ps(e,t)}function mm(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:o}=e;if(r.length===0)return 0;let l=At().lineFitEpsilon,s=t+l,u=0,c=0,f=!1,m=0,p=0,b=0,v=0,x=-1,_=0;function R(){x=-1,_=0}function T(C=b,F=v,I=c){u++,n?.({startSegmentIndex:m,startGraphemeIndex:p,endSegmentIndex:C,endGraphemeIndex:F,width:I}),c=0,f=!1,R()}function M(C,F){f=!0,m=C,p=0,b=C+1,v=0,c=F}function D(C,F,I){f=!0,m=C,p=F,b=C,v=F+1,c=I}function E(C,F){if(!f){M(C,F);return}c+=F,b=C+1,v=0}function S(C,F){let I=o[C];for(let q=F;q<I.length;q++){let W=I[q];f?c+W>s?(T(),D(C,q,W)):(c+=W,b=C,v=q+1):D(C,q,W)}f&&b===C&&v===I.length&&(b=C+1,v=0)}let A=0;for(;A<r.length&&!(!f&&(A=p1(e,A),A>=r.length));){let C=r[A],F=i[A],I=F==="space"||F==="preserved-space"||F==="tab"||F==="zero-width-break"||F==="soft-hyphen";if(!f){C>t&&o[A]!==null?S(A,0):M(A,C),I&&(x=A+1,_=c-C),A++;continue}if(c+C>s){if(I){E(A,C),T(A+1,0,c-C),A++;continue}if(x>=0){if(b>x||b===x&&v>0){T();continue}T(x,0,_);continue}if(C>t&&o[A]!==null){T(),S(A,0),A++;continue}T();continue}E(A,C),I&&(x=A+1,_=c-C),A++}return f&&T(),u}function ps(e,t,n){if(e.simpleLineWalkFastPath)return mm(e,t,n);let{widths:r,lineEndFitAdvances:i,lineEndPaintAdvances:o,kinds:a,breakableFitAdvances:l,discretionaryHyphenWidth:s,tabStopAdvance:u,chunks:c}=e;if(r.length===0||c.length===0)return 0;let f=At(),m=f.lineFitEpsilon,p=t+m,b=0,v=0,x=!1,_=0,R=0,T=0,M=0,D=-1,E=0,S=0,A=null;function C(){D=-1,E=0,S=0,A=null}function F(P=T,H=M,V=v){b++,n?.({startSegmentIndex:_,startGraphemeIndex:R,endSegmentIndex:P,endGraphemeIndex:H,width:V}),v=0,x=!1,C()}function I(P,H){x=!0,_=P,R=0,T=P+1,M=0,v=H}function q(P,H,V){x=!0,_=P,R=H,T=P,M=H+1,v=V}function W(P,H){if(!x){I(P,H);return}v+=H,T=P+1,M=0}function Y(P,H,V,j){if(!H)return;let we=P==="tab"?0:i[V],z=P==="tab"?j:o[V];D=V+1,E=v-j+we,S=v-j+z,A=P}function k(P,H){let V=l[P];for(let j=H;j<V.length;j++){let we=V[j];x?v+we>p?(F(),q(P,j,we)):(v+=we,T=P,M=j+1):q(P,j,we)}x&&T===P&&M===V.length&&(T=P+1,M=0)}function U(P){if(A!=="soft-hyphen")return!1;let H=l[P];if(H==null)return!1;let{fitCount:V,fittedWidth:j}=um(H,v,t,m,s);return V===0?!1:(v=j,T=P,M=V,C(),V===H.length?(T=P+1,M=0,!0):(F(P,V,j+s),k(P,V),!0))}function ie(P){b++,n?.({startSegmentIndex:P.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:P.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),C()}for(let P=0;P<c.length;P++){let H=c[P];if(H.startSegmentIndex===H.endSegmentIndex){ie(H);continue}x=!1,v=0,_=H.startSegmentIndex,R=0,T=H.startSegmentIndex,M=0,C();let V=H.startSegmentIndex;for(;V<H.endSegmentIndex;){let j=a[V],we=j==="space"||j==="preserved-space"||j==="tab"||j==="zero-width-break"||j==="soft-hyphen",z=j==="tab"?lm(v,u):r[V];if(j==="soft-hyphen"){x&&(T=V+1,M=0,D=V+1,E=v+s,S=v+s,A=j),V++;continue}if(!x){z>t&&l[V]!==null?k(V,0):I(V,z),Y(j,we,V,z),V++;continue}if(v+z>p){let B=v+(j==="tab"?0:i[V]),ee=v+(j==="tab"?z:o[V]);if(A==="soft-hyphen"&&f.preferEarlySoftHyphenBreak&&E<=p){F(D,0,S);continue}if(A==="soft-hyphen"&&U(V)){V++;continue}if(we&&B<=p){W(V,z),F(V+1,0,ee),V++;continue}if(D>=0&&E<=p){if(T>D||T===D&&M>0){F();continue}let K=D;F(K,0,S),V=K;continue}if(z>t&&l[V]!==null){F(),k(V,0),V++;continue}F();continue}W(V,z),Y(j,we,V,z),V++}if(x){let j=D===H.consumedEndSegmentIndex?S:v;F(H.consumedEndSegmentIndex,0,j)}}return b}function pm(e,t,n,r){let i=e.chunks[n];if(i.startSegmentIndex===i.endSegmentIndex)return t.segmentIndex=i.consumedEndSegmentIndex,t.graphemeIndex=0,0;let{widths:o,lineEndFitAdvances:a,lineEndPaintAdvances:l,kinds:s,breakableFitAdvances:u,discretionaryHyphenWidth:c,tabStopAdvance:f}=e,m=At(),p=m.lineFitEpsilon,b=r+p,v=0,x=!1,_=t.segmentIndex,R=t.graphemeIndex,T=-1,M=0,D=0,E=null;function S(){T=-1,M=0,D=0,E=null}function A(k=_,U=R,ie=v){return x?(t.segmentIndex=k,t.graphemeIndex=U,ie):null}function C(k,U){x=!0,_=k+1,R=0,v=U}function F(k,U,ie){x=!0,_=k,R=U+1,v=ie}function I(k,U){if(!x){C(k,U);return}v+=U,_=k+1,R=0}function q(k,U,ie,P){if(!U)return;let H=k==="tab"?0:a[ie],V=k==="tab"?P:l[ie];T=ie+1,M=v-P+H,D=v-P+V,E=k}function W(k,U){let ie=u[k];for(let P=U;P<ie.length;P++){let H=ie[P];if(!x)F(k,P,H);else{if(v+H>b)return A();v+=H,_=k,R=P+1}}return x&&_===k&&R===ie.length&&(_=k+1,R=0),null}function Y(k){if(E!=="soft-hyphen"||T<0)return null;let U=u[k]??null;if(U!==null){let{fitCount:ie,fittedWidth:P}=um(U,v,r,p,c);if(ie===U.length)return v=P,_=k+1,R=0,S(),null;if(ie>0)return A(k,ie,P+c)}return M<=b?A(T,0,D):null}for(let k=t.segmentIndex;k<i.endSegmentIndex;k++){let U=s[k],ie=U==="space"||U==="preserved-space"||U==="tab"||U==="zero-width-break"||U==="soft-hyphen",P=k===t.segmentIndex?t.graphemeIndex:0,H=U==="tab"?lm(v,f):o[k];if(U==="soft-hyphen"&&P===0){x&&(_=k+1,R=0,T=k+1,M=v+c,D=v+c,E=U);continue}if(!x){if(P>0){let j=W(k,P);if(j!==null)return j}else if(H>r&&u[k]!==null){let j=W(k,0);if(j!==null)return j}else C(k,H);q(U,ie,k,H);continue}if(v+H>b){let j=v+(U==="tab"?0:a[k]),we=v+(U==="tab"?H:l[k]);if(E==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&M<=b)return A(T,0,D);let z=Y(k);if(z!==null)return z;if(ie&&j<=b)return I(k,H),A(k+1,0,we);if(T>=0&&M<=b)return _>T||_===T&&R>0?A():A(T,0,D);if(H>r&&u[k]!==null){let O=A();if(O!==null)return O;let B=W(k,0);if(B!==null)return B}return A()}I(k,H),q(U,ie,k,H)}return T===i.consumedEndSegmentIndex&&R===0?A(i.consumedEndSegmentIndex,0,D):A(i.consumedEndSegmentIndex,0,v)}function b1(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:o}=e,l=At().lineFitEpsilon,s=n+l,u=0,c=!1,f=t.segmentIndex,m=t.graphemeIndex,p=-1,b=0;for(let v=t.segmentIndex;v<r.length;v++){let x=r[v],_=i[v],R=_==="space"||_==="preserved-space"||_==="tab"||_==="zero-width-break"||_==="soft-hyphen",T=v===t.segmentIndex?t.graphemeIndex:0,M=o[v];if(!c){if(T>0||x>n&&M!==null){let D=M,E=D[T];c=!0,u=E,f=v,m=T+1;for(let S=T+1;S<D.length;S++){let A=D[S];if(u+A>s)return t.segmentIndex=f,t.graphemeIndex=m,u;u+=A,f=v,m=S+1}f===v&&m===D.length&&(f=v+1,m=0)}else c=!0,u=x,f=v+1,m=0;R&&(p=v+1,b=u-x);continue}if(u+x>s)return R?(t.segmentIndex=v+1,t.graphemeIndex=0,u):p>=0?f>p||f===p&&m>0?(t.segmentIndex=f,t.graphemeIndex=m,u):(t.segmentIndex=p,t.graphemeIndex=0,b):(t.segmentIndex=f,t.graphemeIndex=m,u);u+=x,f=v+1,m=0,R&&(p=v+1,b=u-x)}return c?(t.segmentIndex=f,t.graphemeIndex=m,u):null}function x1(e,t,n){let r=dm(e,t);return r<0?null:e.simpleLineWalkFastPath?b1(e,t,n):pm(e,t,r,n)}function hm(e,t){if(e.widths.length===0)return{lineCount:0,maxLineWidth:0};let n={segmentIndex:0,graphemeIndex:0},r=0,i=0;if(!e.simpleLineWalkFastPath){let o=dm(e,n);for(;o>=0;){let a=pm(e,n,o,t);if(a===null)return{lineCount:r,maxLineWidth:i};r++,a>i&&(i=a),o=g1(e,o,n)}return{lineCount:r,maxLineWidth:i}}for(;;){let o=x1(e,n,t);if(o===null)return{lineCount:r,maxLineWidth:i};r++,o>i&&(i=o)}}var hs=null;function y1(){return hs===null&&(hs=new Intl.Segmenter(void 0,{granularity:"grapheme"})),hs}function v1(e){return e?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function S1(e,t){let n=[],r=[],i=0,o=!1,a=!1,l=!1;function s(){r.length!==0&&(n.push({text:r.length===1?r[0]:r.join(""),start:i}),r=[],o=!1,a=!1,l=!1)}function u(f,m,p){r=[f],i=m,o=p,a=Di(f),l=hr.has(f)}function c(f,m){r.push(f),o=o||m;let p=Di(f);f.length===1&&vt.has(f)?a=a||p:a=p,l=!1}for(let f of y1().segment(e)){let m=f.segment,p=Ve(m);if(r.length===0){u(m,f.index,p);continue}if(l||Ni.has(m)||vt.has(m)||t.carryCJKAfterClosingQuote&&p&&a){c(m,p);continue}if(!o&&!p){c(m,p);continue}s(),u(m,f.index,p)}return s(),n}function A1(e){if(e.length<=1)return e;let t=[],n=[e[0].text],r=e[0].start,i=Ve(e[0].text),o=Fi(e[0].text);function a(){t.push({text:n.length===1?n[0]:n.join(""),start:r})}for(let l=1;l<e.length;l++){let s=e[l],u=Ve(s.text),c=Fi(s.text);if(i&&o){n.push(s.text),i=i||u,o=c;continue}a(),n=[s.text],r=s.start,i=u,o=c}return a(),t}function E1(e,t,n,r){let i=At(),{cache:o,emojiCorrection:a}=sm(t,om(e.normalized)),l=St("-",at("-",o),a),u=St(" ",at(" ",o),a)*8;if(e.len===0)return v1(n);let c=[],f=[],m=[],p=[],b=e.chunks.length<=1,v=n?[]:null,x=[],_=n?[]:null,R=Array.from({length:e.len});function T(S,A,C,F,I,q,W){I!=="text"&&I!=="space"&&I!=="zero-width-break"&&(b=!1),c.push(A),f.push(C),m.push(F),p.push(I),v?.push(q),x.push(W),_!==null&&_.push(S)}function M(S,A,C,F,I){let q=at(S,o),W=St(S,q,a),Y=A==="space"||A==="preserved-space"||A==="zero-width-break"?0:W,k=A==="space"||A==="zero-width-break"?0:W;if(I&&F&&S.length>1){let U="sum-graphemes";pr(S)?U="pair-context":i.preferPrefixWidthsForBreakableRuns&&(U="segment-prefixes");let ie=am(S,q,o,a,U);T(S,W,Y,k,A,C,ie);return}T(S,W,Y,k,A,C,null)}for(let S=0;S<e.len;S++){R[S]=c.length;let A=e.texts[S],C=e.isWordLike[S],F=e.kinds[S],I=e.starts[S];if(F==="soft-hyphen"){T(A,0,l,l,F,I,null);continue}if(F==="hard-break"){T(A,0,0,0,F,I,null);continue}if(F==="tab"){T(A,0,0,0,F,I,null);continue}let q=at(A,o);if(F==="text"&&q.containsCJK){let W=S1(A,i),Y=r==="keep-all"?A1(W):W;for(let k=0;k<Y.length;k++){let U=Y[k];M(U.text,"text",I+U.start,C,r==="keep-all"||!Ve(U.text))}continue}M(A,F,I,C,!0)}let D=w1(e.chunks,R,c.length),E=v===null?null:zf(e.normalized,v);return _!==null?{widths:c,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:p,simpleLineWalkFastPath:b,segLevels:E,breakableFitAdvances:x,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:D,segments:_}:{widths:c,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:p,simpleLineWalkFastPath:b,segLevels:E,breakableFitAdvances:x,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:D}}function w1(e,t,n){let r=[];for(let i=0;i<e.length;i++){let o=e[i],a=o.startSegmentIndex<t.length?t[o.startSegmentIndex]:n,l=o.endSegmentIndex<t.length?t[o.endSegmentIndex]:n,s=o.consumedEndSegmentIndex<t.length?t[o.consumedEndSegmentIndex]:n;r.push({startSegmentIndex:a,endSegmentIndex:l,consumedEndSegmentIndex:s})}return r}function gm(e,t,n,r){let i=r?.wordBreak??"normal",o=tm(e,At(),r?.whiteSpace,i);return E1(o,t,n,i)}function Ii(e,t,n){return gm(e,t,!1,n)}function bm(e,t,n){return gm(e,t,!0,n)}function Pi(e,t,n){let r=fm(e,t);return{lineCount:r,height:r*n}}function C1(e){return{width:e.width,start:{segmentIndex:e.startSegmentIndex,graphemeIndex:e.startGraphemeIndex},end:{segmentIndex:e.endSegmentIndex,graphemeIndex:e.endGraphemeIndex}}}function _1(e,t,n){return e.widths.length===0?0:ps(e,t,r=>{n(C1(r))})}function xm(e,t){return hm(e,t)}function ym(e){let t=0;return _1(e,Number.POSITIVE_INFINITY,n=>{n.width>t&&(t=n.width)}),t}var T1={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function vm(e,t){let n={...T1,...t},r=1.2;for(let i=n.baseFontSize;i>=n.minFontSize;i-=n.step){let o=`${n.fontWeight} ${i}px ${n.fontFamily}`,a=Ii(e,o),{lineCount:l}=Pi(a,n.maxWidth,i*r);if(l<=1)return{fontSize:i,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}var Sm={prepare:Ii,layout:Pi,prepareWithSegments:bm,measureLineStats:xm,measureNaturalWidth:ym};window.__timelines=window.__timelines||{};Od();window.__hyperframes={fitTextFontSize:vm,getVariables:qs,pretext:Sm,registerRuntimeDataHandler:Bf,setRuntimeData:Ri,clearRuntimeData:ki};function Am(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,Wf())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Am,{once:!0}):Am();})();\n';
|
|
58788
58788
|
}
|
|
58789
58789
|
});
|
|
58790
58790
|
|
|
@@ -74071,7 +74071,12 @@ function scopeCssToComposition(css, compositionId, scopeSelectorOverride, author
|
|
|
74071
74071
|
if (!css || !trimmedCompositionId)
|
|
74072
74072
|
return css;
|
|
74073
74073
|
const scope = scopeSelectorOverride || `[data-composition-id="${escapeCssAttributeValue(trimmedCompositionId)}"]`;
|
|
74074
|
-
|
|
74074
|
+
let root;
|
|
74075
|
+
try {
|
|
74076
|
+
root = postcss.parse(css);
|
|
74077
|
+
} catch {
|
|
74078
|
+
return "";
|
|
74079
|
+
}
|
|
74075
74080
|
root.walkRules((rule) => {
|
|
74076
74081
|
if (isInsideGlobalAtRule(rule))
|
|
74077
74082
|
return;
|
|
@@ -82680,7 +82685,12 @@ var init_dist4 = __esm({
|
|
|
82680
82685
|
let root;
|
|
82681
82686
|
try {
|
|
82682
82687
|
root = postcss2.parse(style.content);
|
|
82683
|
-
} catch {
|
|
82688
|
+
} catch (error) {
|
|
82689
|
+
findings.push({
|
|
82690
|
+
code: "css_parse_error",
|
|
82691
|
+
severity: "error",
|
|
82692
|
+
message: `CSS parse error: ${error instanceof Error ? error.message : "unknown"}`
|
|
82693
|
+
});
|
|
82684
82694
|
continue;
|
|
82685
82695
|
}
|
|
82686
82696
|
root.walkRules((rule) => {
|
|
@@ -122624,7 +122634,20 @@ function fontSlug(familyName) {
|
|
|
122624
122634
|
function fontCacheDir(slug) {
|
|
122625
122635
|
const dir = join45(resolveFontCacheRoot(), slug);
|
|
122626
122636
|
if (!existsSync47(dir)) {
|
|
122627
|
-
|
|
122637
|
+
try {
|
|
122638
|
+
mkdirSync20(dir, { recursive: true });
|
|
122639
|
+
} catch {
|
|
122640
|
+
const firstFallback = ephemeralFontCacheRoot === void 0;
|
|
122641
|
+
ephemeralFontCacheRoot ??= mkdtempSync6(join45(tmpdir7(), "hyperframes-fonts-"));
|
|
122642
|
+
const fallback = join45(ephemeralFontCacheRoot, slug);
|
|
122643
|
+
mkdirSync20(fallback, { recursive: true });
|
|
122644
|
+
if (firstFallback) {
|
|
122645
|
+
defaultLogger.warn(
|
|
122646
|
+
`Font cache directory is unwritable (${dir}). Using temporary fallback \u2014 fonts will re-download each run. Fix with: chmod 755 ${resolveFontCacheRoot()}`
|
|
122647
|
+
);
|
|
122648
|
+
}
|
|
122649
|
+
return fallback;
|
|
122650
|
+
}
|
|
122628
122651
|
}
|
|
122629
122652
|
return dir;
|
|
122630
122653
|
}
|
|
@@ -122905,7 +122928,7 @@ async function injectDeterministicFontFaces(html, options = {}) {
|
|
|
122905
122928
|
}
|
|
122906
122929
|
return document2.toString();
|
|
122907
122930
|
}
|
|
122908
|
-
var GENERIC_FAMILIES2, CANONICAL_FONTS, FONT_ALIASES, lambdaFontCacheRoot, WOFF2_USER_AGENT, FONT_FETCH_FAILED, FONT_FETCH_UNAVAILABLE, FontFetchError, FontFetchUnavailableError, DEFAULT_FONT_FETCH_RETRY_POLICY, GOOGLE_FONTS_TEXT_MAX_ENCODED_LENGTH;
|
|
122931
|
+
var GENERIC_FAMILIES2, CANONICAL_FONTS, FONT_ALIASES, lambdaFontCacheRoot, WOFF2_USER_AGENT, ephemeralFontCacheRoot, FONT_FETCH_FAILED, FONT_FETCH_UNAVAILABLE, FontFetchError, FontFetchUnavailableError, DEFAULT_FONT_FETCH_RETRY_POLICY, GOOGLE_FONTS_TEXT_MAX_ENCODED_LENGTH;
|
|
122909
122932
|
var init_deterministicFonts = __esm({
|
|
122910
122933
|
"../producer/src/services/deterministicFonts.ts"() {
|
|
122911
122934
|
"use strict";
|
|
@@ -200522,10 +200545,72 @@ ${c.error("\u2717")} Compare failed: ${message}`);
|
|
|
200522
200545
|
}
|
|
200523
200546
|
});
|
|
200524
200547
|
|
|
200548
|
+
// src/capture/faviconRanker.ts
|
|
200549
|
+
function parseSizes(sizes) {
|
|
200550
|
+
if (!sizes) return 0;
|
|
200551
|
+
let max = 0;
|
|
200552
|
+
for (const token of sizes.trim().split(/\s+/)) {
|
|
200553
|
+
const m2 = /^(\d+)x(\d+)$/i.exec(token);
|
|
200554
|
+
if (!m2) continue;
|
|
200555
|
+
max = Math.max(max, Number(m2[1]), Number(m2[2]));
|
|
200556
|
+
}
|
|
200557
|
+
return max;
|
|
200558
|
+
}
|
|
200559
|
+
function pathnameOf(href) {
|
|
200560
|
+
try {
|
|
200561
|
+
return new URL(href).pathname.toLowerCase();
|
|
200562
|
+
} catch {
|
|
200563
|
+
return href.split(/[#?]/)[0].toLowerCase();
|
|
200564
|
+
}
|
|
200565
|
+
}
|
|
200566
|
+
function isSvg(c3) {
|
|
200567
|
+
return c3.type?.toLowerCase() === "image/svg+xml" || pathnameOf(c3.href).endsWith(".svg");
|
|
200568
|
+
}
|
|
200569
|
+
function isMaskIcon(c3) {
|
|
200570
|
+
return c3.rel.toLowerCase().split(/\s+/).includes("mask-icon");
|
|
200571
|
+
}
|
|
200572
|
+
function isIco(c3) {
|
|
200573
|
+
const t2 = c3.type?.toLowerCase();
|
|
200574
|
+
return t2 === "image/x-icon" || t2 === "image/vnd.microsoft.icon" || pathnameOf(c3.href).endsWith(".ico");
|
|
200575
|
+
}
|
|
200576
|
+
function declaredSize(c3) {
|
|
200577
|
+
const parsed = parseSizes(c3.sizes);
|
|
200578
|
+
if (parsed > 0) return parsed;
|
|
200579
|
+
return c3.rel.toLowerCase().split(/\s+/).some((t2) => t2.startsWith("apple-touch-icon")) ? APPLE_TOUCH_DEFAULT_PX : 0;
|
|
200580
|
+
}
|
|
200581
|
+
function tierOf(c3) {
|
|
200582
|
+
if (isMaskIcon(c3)) return 3;
|
|
200583
|
+
if (isSvg(c3)) return 0;
|
|
200584
|
+
return isIco(c3) ? 2 : 1;
|
|
200585
|
+
}
|
|
200586
|
+
function rankIconCandidates(candidates) {
|
|
200587
|
+
return candidates.filter((c3) => !!c3.href).map((c3, i2) => ({ c: c3, i: i2, tier: tierOf(c3), size: declaredSize(c3) })).sort((a, b2) => a.tier - b2.tier || b2.size - a.size || a.i - b2.i).map((e3) => e3.c);
|
|
200588
|
+
}
|
|
200589
|
+
var APPLE_TOUCH_DEFAULT_PX;
|
|
200590
|
+
var init_faviconRanker = __esm({
|
|
200591
|
+
"src/capture/faviconRanker.ts"() {
|
|
200592
|
+
"use strict";
|
|
200593
|
+
APPLE_TOUCH_DEFAULT_PX = 180;
|
|
200594
|
+
}
|
|
200595
|
+
});
|
|
200596
|
+
|
|
200525
200597
|
// src/capture/assetDownloader.ts
|
|
200526
200598
|
import { writeFileSync as writeFileSync49, mkdirSync as mkdirSync56 } from "fs";
|
|
200527
200599
|
import { join as join117, extname as extname24 } from "path";
|
|
200528
200600
|
import { createHash as createHash24 } from "crypto";
|
|
200601
|
+
function noDrops() {
|
|
200602
|
+
return { "size-floor": 0, "budget-exhausted": 0, "cap-reached": 0, unavailable: 0 };
|
|
200603
|
+
}
|
|
200604
|
+
function mergeDrops(a, b2) {
|
|
200605
|
+
const total = noDrops();
|
|
200606
|
+
for (const reason of Object.keys(total)) {
|
|
200607
|
+
total[reason] = a[reason] + b2[reason];
|
|
200608
|
+
}
|
|
200609
|
+
return total;
|
|
200610
|
+
}
|
|
200611
|
+
function totalDrops(drops) {
|
|
200612
|
+
return Object.values(drops).reduce((sum, n2) => sum + n2, 0);
|
|
200613
|
+
}
|
|
200529
200614
|
function svgContentHashSlug(svgSource, isLogo) {
|
|
200530
200615
|
const hash2 = createHash24("sha1").update(svgSource).digest("hex").slice(0, 8);
|
|
200531
200616
|
return isLogo ? `logo-${hash2}` : `svg-${hash2}`;
|
|
@@ -200548,12 +200633,18 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks,
|
|
|
200548
200633
|
const assetsDir = join117(outputDir, "assets");
|
|
200549
200634
|
mkdirSync56(assetsDir, { recursive: true });
|
|
200550
200635
|
const assets = [];
|
|
200636
|
+
const drops = noDrops();
|
|
200551
200637
|
const downloadedUrls = /* @__PURE__ */ new Set();
|
|
200552
200638
|
mkdirSync56(join117(outputDir, "assets", "svgs"), { recursive: true });
|
|
200553
200639
|
const usedSvgNames = /* @__PURE__ */ new Set();
|
|
200554
|
-
|
|
200640
|
+
const MAX_INLINE_SVGS = 30;
|
|
200641
|
+
drops["cap-reached"] += Math.max(0, tokens.svgs.length - MAX_INLINE_SVGS);
|
|
200642
|
+
for (let i2 = 0; i2 < tokens.svgs.length && i2 < MAX_INLINE_SVGS; i2++) {
|
|
200555
200643
|
const svg = tokens.svgs[i2];
|
|
200556
|
-
if (!svg.outerHTML || svg.outerHTML.length < 50)
|
|
200644
|
+
if (!svg.outerHTML || svg.outerHTML.length < 50) {
|
|
200645
|
+
drops["size-floor"]++;
|
|
200646
|
+
continue;
|
|
200647
|
+
}
|
|
200557
200648
|
const svgFile = toStandaloneSvg(svg.outerHTML);
|
|
200558
200649
|
const slug = svgContentHashSlug(svgFile, !!svg.isLogo);
|
|
200559
200650
|
let finalSlug = slug;
|
|
@@ -200569,11 +200660,16 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks,
|
|
|
200569
200660
|
writeFileSync49(join117(outputDir, localPath), svgFile, "utf-8");
|
|
200570
200661
|
assets.push({ url: "", localPath, type: "svg" });
|
|
200571
200662
|
} catch {
|
|
200663
|
+
drops.unavailable++;
|
|
200572
200664
|
}
|
|
200573
200665
|
}
|
|
200574
|
-
|
|
200666
|
+
const icons = rankIconCandidates(faviconLinks || []);
|
|
200667
|
+
for (const [index, icon] of icons.entries()) {
|
|
200575
200668
|
const remainingMs = options.remainingMs?.() ?? 1e4;
|
|
200576
|
-
if (remainingMs <= 0)
|
|
200669
|
+
if (remainingMs <= 0) {
|
|
200670
|
+
drops["budget-exhausted"] += icons.length - index;
|
|
200671
|
+
break;
|
|
200672
|
+
}
|
|
200577
200673
|
if (!icon.href) continue;
|
|
200578
200674
|
try {
|
|
200579
200675
|
const ext = extname24(new URL(icon.href).pathname) || ".ico";
|
|
@@ -200585,7 +200681,9 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks,
|
|
|
200585
200681
|
assets.push({ url: icon.href, localPath, type: "favicon" });
|
|
200586
200682
|
break;
|
|
200587
200683
|
}
|
|
200684
|
+
drops.unavailable++;
|
|
200588
200685
|
} catch {
|
|
200686
|
+
drops.unavailable++;
|
|
200589
200687
|
}
|
|
200590
200688
|
}
|
|
200591
200689
|
const imageUrls = [];
|
|
@@ -200617,7 +200715,10 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks,
|
|
|
200617
200715
|
const usedNames = /* @__PURE__ */ new Set();
|
|
200618
200716
|
for (let i2 = 0; i2 < toDownload.length; i2 += BATCH_SIZE) {
|
|
200619
200717
|
const remainingMs = options.remainingMs?.() ?? 1e4;
|
|
200620
|
-
if (remainingMs <= 0)
|
|
200718
|
+
if (remainingMs <= 0) {
|
|
200719
|
+
drops["budget-exhausted"] += toDownload.length - i2;
|
|
200720
|
+
break;
|
|
200721
|
+
}
|
|
200621
200722
|
const batch = toDownload.slice(i2, i2 + BATCH_SIZE);
|
|
200622
200723
|
const results = await Promise.allSettled(
|
|
200623
200724
|
batch.map(async ({ url, isPoster, catalog }) => {
|
|
@@ -200625,15 +200726,25 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks,
|
|
|
200625
200726
|
const pathExt = extname24(parsedUrl.pathname);
|
|
200626
200727
|
const ext = pathExt && pathExt.length <= 5 ? pathExt : ".jpg";
|
|
200627
200728
|
const buffer = await fetchBuffer(url, Math.min(1e4, remainingMs));
|
|
200628
|
-
if (!buffer)
|
|
200629
|
-
|
|
200630
|
-
|
|
200631
|
-
|
|
200729
|
+
if (!buffer) {
|
|
200730
|
+
drops.unavailable++;
|
|
200731
|
+
return null;
|
|
200732
|
+
}
|
|
200733
|
+
const isSvg2 = ext === ".svg" || url.includes(".svg");
|
|
200734
|
+
const minSize = isSvg2 ? 200 : 1e4;
|
|
200735
|
+
if (buffer.length < minSize) {
|
|
200736
|
+
drops["size-floor"]++;
|
|
200737
|
+
return null;
|
|
200738
|
+
}
|
|
200632
200739
|
return { url, isPoster, parsedUrl, ext, buffer, catalog };
|
|
200633
200740
|
})
|
|
200634
200741
|
);
|
|
200635
200742
|
for (const result of results) {
|
|
200636
|
-
if (result.status
|
|
200743
|
+
if (result.status === "rejected") {
|
|
200744
|
+
drops.unavailable++;
|
|
200745
|
+
continue;
|
|
200746
|
+
}
|
|
200747
|
+
if (!result.value) continue;
|
|
200637
200748
|
const { url, isPoster, parsedUrl, ext, buffer, catalog } = result.value;
|
|
200638
200749
|
try {
|
|
200639
200750
|
let slug;
|
|
@@ -200652,6 +200763,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks,
|
|
|
200652
200763
|
assets.push({ url, localPath, type: "image" });
|
|
200653
200764
|
imgIdx++;
|
|
200654
200765
|
} catch {
|
|
200766
|
+
drops.unavailable++;
|
|
200655
200767
|
}
|
|
200656
200768
|
}
|
|
200657
200769
|
}
|
|
@@ -200660,15 +200772,24 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks,
|
|
|
200660
200772
|
try {
|
|
200661
200773
|
const ext = extname24(new URL(tokens.ogImage).pathname) || ".jpg";
|
|
200662
200774
|
const localPath = `assets/og-image${ext}`;
|
|
200663
|
-
|
|
200664
|
-
|
|
200665
|
-
|
|
200666
|
-
|
|
200775
|
+
if (remainingMs <= 0) {
|
|
200776
|
+
drops["budget-exhausted"]++;
|
|
200777
|
+
} else {
|
|
200778
|
+
const buffer = await fetchBuffer(tokens.ogImage, Math.min(1e4, remainingMs));
|
|
200779
|
+
if (!buffer) {
|
|
200780
|
+
drops.unavailable++;
|
|
200781
|
+
} else if (buffer.length <= 5e3) {
|
|
200782
|
+
drops["size-floor"]++;
|
|
200783
|
+
} else {
|
|
200784
|
+
writeFileSync49(join117(outputDir, localPath), buffer);
|
|
200785
|
+
assets.push({ url: tokens.ogImage, localPath, type: "image" });
|
|
200786
|
+
}
|
|
200667
200787
|
}
|
|
200668
200788
|
} catch {
|
|
200789
|
+
drops.unavailable++;
|
|
200669
200790
|
}
|
|
200670
200791
|
}
|
|
200671
|
-
return assets;
|
|
200792
|
+
return { assets, drops };
|
|
200672
200793
|
}
|
|
200673
200794
|
function normalizeUrl(u) {
|
|
200674
200795
|
try {
|
|
@@ -200687,13 +200808,14 @@ function normalizeUrl(u) {
|
|
|
200687
200808
|
async function downloadAndRewriteFonts(css, outputDir, options = {}) {
|
|
200688
200809
|
const assetsDir = join117(outputDir, "assets", "fonts");
|
|
200689
200810
|
mkdirSync56(assetsDir, { recursive: true });
|
|
200811
|
+
const drops = noDrops();
|
|
200690
200812
|
const fontUrlRegex = /url\(['"]?(https?:\/\/[^'")\s]+\.(?:woff2?|ttf|otf)[^'")\s]*?)['"]?\)/g;
|
|
200691
200813
|
const fontUrls = /* @__PURE__ */ new Set();
|
|
200692
200814
|
let match;
|
|
200693
200815
|
while ((match = fontUrlRegex.exec(css)) !== null) {
|
|
200694
200816
|
if (match[1]) fontUrls.add(match[1]);
|
|
200695
200817
|
}
|
|
200696
|
-
if (fontUrls.size === 0) return css;
|
|
200818
|
+
if (fontUrls.size === 0) return { css, drops };
|
|
200697
200819
|
const MAX_FONTS_PER_FAMILY = 6;
|
|
200698
200820
|
const MAX_TOTAL_FONTS = 30;
|
|
200699
200821
|
const familyCounts = /* @__PURE__ */ new Map();
|
|
@@ -200713,13 +200835,22 @@ async function downloadAndRewriteFonts(css, outputDir, options = {}) {
|
|
|
200713
200835
|
});
|
|
200714
200836
|
let rewritten = css;
|
|
200715
200837
|
let count = 0;
|
|
200716
|
-
for (const fontUrl of sortedUrls) {
|
|
200838
|
+
for (const [index, fontUrl] of sortedUrls.entries()) {
|
|
200717
200839
|
const remainingMs = options.remainingMs?.() ?? 1e4;
|
|
200718
|
-
if (remainingMs <= 0)
|
|
200719
|
-
|
|
200840
|
+
if (remainingMs <= 0) {
|
|
200841
|
+
drops["budget-exhausted"] += sortedUrls.length - index;
|
|
200842
|
+
break;
|
|
200843
|
+
}
|
|
200844
|
+
if (count >= MAX_TOTAL_FONTS) {
|
|
200845
|
+
drops["cap-reached"] += sortedUrls.length - index;
|
|
200846
|
+
break;
|
|
200847
|
+
}
|
|
200720
200848
|
const family = getFamilyForUrl(fontUrl);
|
|
200721
200849
|
const familyCount = familyCounts.get(family) || 0;
|
|
200722
|
-
if (familyCount >= MAX_FONTS_PER_FAMILY)
|
|
200850
|
+
if (familyCount >= MAX_FONTS_PER_FAMILY) {
|
|
200851
|
+
drops["cap-reached"]++;
|
|
200852
|
+
continue;
|
|
200853
|
+
}
|
|
200723
200854
|
familyCounts.set(family, familyCount + 1);
|
|
200724
200855
|
count++;
|
|
200725
200856
|
try {
|
|
@@ -200731,11 +200862,14 @@ async function downloadAndRewriteFonts(css, outputDir, options = {}) {
|
|
|
200731
200862
|
if (buffer) {
|
|
200732
200863
|
writeFileSync49(localPath, buffer);
|
|
200733
200864
|
rewritten = rewritten.split(fontUrl).join(relativePath);
|
|
200865
|
+
} else {
|
|
200866
|
+
drops.unavailable++;
|
|
200734
200867
|
}
|
|
200735
200868
|
} catch {
|
|
200869
|
+
drops.unavailable++;
|
|
200736
200870
|
}
|
|
200737
200871
|
}
|
|
200738
|
-
return rewritten;
|
|
200872
|
+
return { css: rewritten, drops };
|
|
200739
200873
|
}
|
|
200740
200874
|
function isPrivateIpv4(host) {
|
|
200741
200875
|
const octets = host.split(".").map(Number);
|
|
@@ -200853,6 +200987,7 @@ var PRIVATE_V4_BLOCKS, MAX_FETCH_REDIRECTS;
|
|
|
200853
200987
|
var init_assetDownloader = __esm({
|
|
200854
200988
|
"src/capture/assetDownloader.ts"() {
|
|
200855
200989
|
"use strict";
|
|
200990
|
+
init_faviconRanker();
|
|
200856
200991
|
PRIVATE_V4_BLOCKS = [
|
|
200857
200992
|
[0, 0, 255],
|
|
200858
200993
|
// 0.0.0.0/8 (incl. 0.0.0.0, which routes to localhost)
|
|
@@ -204927,26 +205062,27 @@ ${err.stack}` : normalizeErrorMessage(err);
|
|
|
204927
205062
|
const visibleTextContent = await extractVisibleText(page1);
|
|
204928
205063
|
const faviconLinks = await page1.evaluate(`(() => {
|
|
204929
205064
|
var iconEls = Array.from(document.querySelectorAll('link[rel*="icon"], link[rel="apple-touch-icon"]'));
|
|
204930
|
-
return iconEls.map(function(l) {
|
|
205065
|
+
return iconEls.map(function(l) {
|
|
205066
|
+
return {
|
|
205067
|
+
rel: l.rel,
|
|
205068
|
+
href: l.href,
|
|
205069
|
+
sizes: l.getAttribute('sizes'),
|
|
205070
|
+
type: l.getAttribute('type'),
|
|
205071
|
+
};
|
|
205072
|
+
});
|
|
204931
205073
|
})()`);
|
|
204932
205074
|
await page1.close();
|
|
204933
205075
|
phase("core-extraction", "completed");
|
|
204934
|
-
|
|
204935
|
-
|
|
204936
|
-
|
|
204937
|
-
|
|
204938
|
-
|
|
204939
|
-
|
|
204940
|
-
|
|
204941
|
-
|
|
204942
|
-
|
|
204943
|
-
|
|
204944
|
-
} else {
|
|
204945
|
-
warnings.push(
|
|
204946
|
-
"Capture budget exhausted before font downloads; extracted font tokens were preserved."
|
|
204947
|
-
);
|
|
204948
|
-
phase("fonts", "degraded", "budget-exhausted");
|
|
204949
|
-
}
|
|
205076
|
+
phase("fonts", "started");
|
|
205077
|
+
const fontPass = await downloadAndRewriteFonts(extracted.headHtml, outputDir, {
|
|
205078
|
+
remainingMs
|
|
205079
|
+
});
|
|
205080
|
+
extracted.headHtml = fontPass.css;
|
|
205081
|
+
phase(
|
|
205082
|
+
"fonts",
|
|
205083
|
+
remainingMs() > 0 ? "completed" : "degraded",
|
|
205084
|
+
remainingMs() > 0 ? void 0 : "budget-exhausted"
|
|
205085
|
+
);
|
|
204950
205086
|
try {
|
|
204951
205087
|
const fontsManifest = extractFontMetadata(
|
|
204952
205088
|
join126(outputDir, "assets", "fonts"),
|
|
@@ -204983,25 +205119,31 @@ ${err.stack}` : normalizeErrorMessage(err);
|
|
|
204983
205119
|
);
|
|
204984
205120
|
}
|
|
204985
205121
|
let assets = [];
|
|
205122
|
+
let assetDrops = noDrops();
|
|
204986
205123
|
if (!skipAssets) {
|
|
204987
|
-
|
|
204988
|
-
|
|
204989
|
-
|
|
204990
|
-
|
|
204991
|
-
|
|
204992
|
-
|
|
204993
|
-
|
|
204994
|
-
|
|
204995
|
-
|
|
204996
|
-
|
|
204997
|
-
)
|
|
204998
|
-
|
|
204999
|
-
warnings.push("Capture budget exhausted before asset downloads; extraction continued.");
|
|
205000
|
-
phase("assets", "degraded", "budget-exhausted");
|
|
205001
|
-
}
|
|
205124
|
+
phase("assets", "started");
|
|
205125
|
+
progress("assets", "Downloading assets...");
|
|
205126
|
+
const assetPass = await downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks, {
|
|
205127
|
+
remainingMs
|
|
205128
|
+
});
|
|
205129
|
+
assets = assetPass.assets;
|
|
205130
|
+
assetDrops = assetPass.drops;
|
|
205131
|
+
phase(
|
|
205132
|
+
"assets",
|
|
205133
|
+
remainingMs() > 0 ? "completed" : "degraded",
|
|
205134
|
+
remainingMs() > 0 ? void 0 : "budget-exhausted"
|
|
205135
|
+
);
|
|
205002
205136
|
} else {
|
|
205003
205137
|
phase("assets", "degraded", "disabled");
|
|
205004
205138
|
}
|
|
205139
|
+
const dropped = mergeDrops(fontPass.drops, assetDrops);
|
|
205140
|
+
const droppedTotal = totalDrops(dropped);
|
|
205141
|
+
if (droppedTotal > 0) {
|
|
205142
|
+
const breakdown = Object.entries(dropped).filter(([, n2]) => n2 > 0).map(([reason, n2]) => `${n2} ${reason}`).join(", ");
|
|
205143
|
+
warnings.push(
|
|
205144
|
+
`${droppedTotal} referenced asset(s) are not in this capture (${breakdown}). A thin capture with no drops is a thin page; this one was truncated.`
|
|
205145
|
+
);
|
|
205146
|
+
}
|
|
205005
205147
|
if (assets.length && Array.isArray(tokens.sections)) {
|
|
205006
205148
|
const base2 = (u) => u.split(/[#?]/)[0] ?? u;
|
|
205007
205149
|
const localByUrl = /* @__PURE__ */ new Map();
|
|
@@ -205174,6 +205316,7 @@ ${extracted.bodyHtml}
|
|
|
205174
205316
|
screenshots,
|
|
205175
205317
|
tokens,
|
|
205176
205318
|
assets,
|
|
205319
|
+
dropped,
|
|
205177
205320
|
animationCatalog,
|
|
205178
205321
|
warnings,
|
|
205179
205322
|
lastPhase
|
|
@@ -205398,6 +205541,7 @@ var init_capture2 = __esm({
|
|
|
205398
205541
|
title: result.title,
|
|
205399
205542
|
screenshots: result.screenshots.length,
|
|
205400
205543
|
assets: result.assets.length,
|
|
205544
|
+
dropped: result.dropped,
|
|
205401
205545
|
detectedSections: result.tokens.sections.length,
|
|
205402
205546
|
fonts: result.tokens.fonts.map((f3) => f3.family),
|
|
205403
205547
|
fontsDetailed: result.tokens.fonts,
|
|
@@ -205416,6 +205560,15 @@ var init_capture2 = __esm({
|
|
|
205416
205560
|
console.log();
|
|
205417
205561
|
console.log(` ${c3.dim("Screenshots:")} ${result.screenshots.length}`);
|
|
205418
205562
|
console.log(` ${c3.dim("Assets:")} ${result.assets.length}`);
|
|
205563
|
+
const droppedTotal = Object.values(result.dropped).reduce((sum, n2) => sum + n2, 0);
|
|
205564
|
+
if (droppedTotal > 0) {
|
|
205565
|
+
const breakdown = Object.entries(result.dropped).filter(function(entry) {
|
|
205566
|
+
return entry[1] > 0;
|
|
205567
|
+
}).map(function(entry) {
|
|
205568
|
+
return entry[1] + " " + entry[0];
|
|
205569
|
+
}).join(", ");
|
|
205570
|
+
console.log(` ${c3.dim("Dropped:")} ${droppedTotal} (${breakdown})`);
|
|
205571
|
+
}
|
|
205419
205572
|
console.log(` ${c3.dim("Sections:")} ${result.tokens.sections.length}`);
|
|
205420
205573
|
console.log(
|
|
205421
205574
|
` ${c3.dim("Fonts:")} ${result.tokens.fonts.map(function(f3) {
|