hyperframes 0.7.71 → 0.7.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +6813 -2520
- package/dist/commands/layout-audit.browser.js +203 -0
- package/dist/hyperframe-runtime.js +35 -33
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +35 -33
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/skills/hyperframes/SKILL.md +10 -0
- package/dist/skills/hyperframes/references/capability-menu.md +17 -17
- package/dist/skills/hyperframes-cli/references/compare-and-batch.md +1 -1
- package/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +1 -7
- package/dist/studio/assets/{hyperframes-player-C1X90psg.js → hyperframes-player-DGlzhf_s.js} +1 -1
- package/dist/studio/assets/index-B37rWXo4.css +1 -0
- package/dist/studio/assets/{index-DzxDHPR1.js → index-CbVTOJ-E.js} +1 -1
- package/dist/studio/assets/{index-nY4lLBqM.js → index-CcA5WVJv.js} +1 -1
- package/dist/studio/assets/index-DXcLI2wu.js +428 -0
- package/dist/studio/index.d.ts +8 -0
- package/dist/studio/index.html +2 -2
- package/dist/studio/index.js +7762 -4261
- package/dist/studio/index.js.map +1 -1
- package/dist/templates/_shared/AGENTS.md +2 -0
- package/dist/templates/_shared/CLAUDE.md +2 -0
- package/package.json +1 -1
- package/dist/studio/assets/index-CSCh2Vrp.js +0 -428
- package/dist/studio/assets/index-Ceyz8Qt2.css +0 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
2
|
-
`+
|
|
3
|
-
`+
|
|
1
|
+
"use strict";(()=>{var id=Object.create;var jr=Object.defineProperty;var od=Object.getOwnPropertyDescriptor;var ad=Object.getOwnPropertyNames;var sd=Object.getPrototypeOf,ld=Object.prototype.hasOwnProperty;var ud=(e,t,n)=>t in e?jr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ee=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var cd=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ad(t))!ld.call(e,i)&&i!==n&&jr(e,i,{get:()=>t[i],enumerable:!(r=od(t,i))||r.enumerable});return e};var dd=(e,t,n)=>(n=e!=null?id(sd(e)):{},cd(t||!e||!e.__esModule?jr(n,"default",{value:e,enumerable:!0}):n,e));var pe=(e,t,n)=>ud(e,typeof t!="symbol"?t+"":t,n);var Ls=ee((Ib,Di)=>{var K=String,Rs=function(){return{isColorSupported:!1,reset:K,bold:K,dim:K,italic:K,underline:K,inverse:K,hidden:K,strikethrough:K,black:K,red:K,green:K,yellow:K,blue:K,magenta:K,cyan:K,white:K,gray:K,bgBlack:K,bgRed:K,bgGreen:K,bgYellow:K,bgBlue:K,bgMagenta:K,bgCyan:K,bgWhite:K,blackBright:K,redBright:K,greenBright:K,yellowBright:K,blueBright:K,magentaBright:K,cyanBright:K,whiteBright:K,bgBlackBright:K,bgRedBright:K,bgGreenBright:K,bgYellowBright:K,bgBlueBright:K,bgMagentaBright:K,bgCyanBright:K,bgWhiteBright:K}};Di.exports=Rs();Di.exports.createColors=Rs});var Ii=ee(()=>{});var er=ee((Gb,Ms)=>{"use strict";var Fs=Ls(),Ns=Ii(),cn=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=Fs.isColorSupported);let r=c=>c,i=c=>c,o=c=>c;if(t){let{bold:c,gray:m,red:f}=Fs.createColors(!0);i=x=>c(f(x)),r=x=>m(x),Ns&&(o=x=>Ns(x))}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,m)=>{let f=l+1+m,x=" "+(" "+f).slice(-u)+" | ";if(f===this.line){if(c.length>160){let C=20,y=Math.max(0,this.column-C),w=Math.max(this.column+C,this.endColumn+C),T=c.slice(y,w),N=r(x.replace(/\d/g," "))+c.slice(0,Math.min(this.column-1,C-1)).replace(/[^\t]/g," ");return i(">")+r(x)+o(T)+`
|
|
2
|
+
`+N+i("^")}let v=r(x.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+r(x)+o(c)+`
|
|
3
|
+
`+v+i("^")}return" "+r(x)+o(c)}).join(`
|
|
4
4
|
`)}toString(){let t=this.showSourceCode();return t&&(t=`
|
|
5
5
|
|
|
6
6
|
`+t+`
|
|
7
|
-
`),this.name+": "+this.message+t}};
|
|
7
|
+
`),this.name+": "+this.message+t}};Ms.exports=cn;cn.default=cn});var Pi=ee((Hb,Ds)=>{"use strict";var rm=/(<)(\/?style\b)/gi,im=/(<)(!--)/g;function ot(e){return typeof e!="string"||!e.includes("<")?e:e.replace(rm,"\\3c $2").replace(im,"\\3c $2")}var ks={after:`
|
|
8
8
|
`,beforeClose:`
|
|
9
9
|
`,beforeComment:`
|
|
10
10
|
`,beforeDecl:`
|
|
11
11
|
`,beforeOpen:" ",beforeRule:`
|
|
12
|
-
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function
|
|
13
|
-
`)){let a=this.raw(t,null,"indent");if(a.length)for(let
|
|
14
|
-
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawBeforeComment(t,n){let
|
|
15
|
-
`)&&(
|
|
16
|
-
`)&&(
|
|
17
|
-
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawColon(t){let n;return t.walkDecls(
|
|
18
|
-
`);return n=o[o.length-1],n=n.replace(/\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(
|
|
19
|
-
`?(n=1,
|
|
20
|
-
`?(n=1,i+=1):n+=1;return{column:n,line:i,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,i={column:this.source.start.column,line:this.source.start.line,offset:je(n,this.source.start)},r=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:je(n,this.source.end)+1}:{column:i.column+1,line:i.line,offset:i.offset+1};if(t.word){let a=n.slice(je(n,this.source.start),je(n,this.source.end)).indexOf(t.word);a!==-1&&(i=this.positionInside(a),r=this.positionInside(a+t.word.length))}else t.start?i={column:t.start.column,line:t.start.line,offset:je(n,t.start)}:t.index&&(i=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line,offset:je(n,t.end)}:typeof t.endIndex=="number"?r=this.positionInside(t.endIndex):t.index&&(r=this.positionInside(t.index+1));return(r.line<i.line||r.line===i.line&&r.column<=i.column)&&(r={column:i.column+1,line:i.line,offset:i.offset+1}),{end:r,start:i}}raw(t,n){return new hd().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,i=!1;for(let r of t)r===this?i=!0:i?(this.parent.insertAfter(n,r),n=r):this.parent.insertBefore(n,r);i||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let i={},r=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 c=this[a];if(Array.isArray(c))i[a]=c.map(s=>typeof s=="object"&&s.toJSON?s.toJSON(null,n):s);else if(typeof c=="object"&&c.toJSON)i[a]=c.toJSON(null,n);else if(a==="source"){if(c==null)continue;let s=n.get(c.input);s==null&&(s=o,n.set(c.input,o),o++),i[a]={end:c.end,inputId:s,start:c.start}}else i[a]=c}return r&&(i.inputs=[...n.keys()].map(a=>a.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=gd){t.stringify&&(t=t.stringify);let n="";return t(this,i=>{n+=i}),n}warn(t,n,i={}){let r={node:this};for(let o in i)r[o]=i[o];return t.warn(n,r)}};Ls.exports=Yt;Yt.default=Yt});var Qt=Z((sg,ks)=>{"use strict";var bd=Jt(),Xt=class extends bd{constructor(t){super(t),this.type="comment"}};ks.exports=Xt;Xt.default=Xt});var en=Z((ag,Ds)=>{"use strict";var yd=Jt(),Zt=class extends yd{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"}};Ds.exports=Zt;Zt.default=Zt});var Ze=Z((lg,Vs)=>{"use strict";var Is=Qt(),Ps=en(),Sd=Jt(),{isClean:Os,my:Bs}=Mn(),Qi,Gs,Hs,Zi;function Us(e){return e.map(t=>(t.nodes&&(t.nodes=Us(t.nodes)),delete t.source,t))}function Ws(e){if(e[Os]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Ws(t)}var ke=class e extends Sd{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 i=this.normalize(n,this.last);for(let r of i)this.proxyOf.nodes.push(r)}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(),i,r;for(;this.indexes[n]<this.proxyOf.nodes.length&&(i=this.indexes[n],r=t(this.proxyOf.nodes[i],i),r!==!1);)this.indexes[n]+=1;return delete this.indexes[n],r}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")?(...i)=>t[n](...i.map(r=>typeof r=="function"?(o,a)=>r(o.toProxy(),a):r)):n==="every"||n==="some"?i=>t[n]((r,...o)=>i(r.toProxy(),...o)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(i=>i.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,i){return t[n]===i||(t[n]=i,(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 i=this.index(t),r=this.normalize(n,this.proxyOf.nodes[i]).reverse();i=this.index(t);for(let a of r)this.proxyOf.nodes.splice(i+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],i<o&&(this.indexes[a]=o+r.length);return this.markDirty(),this}insertBefore(t,n){let i=this.index(t),r=i===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[i],r).reverse();i=this.index(t);for(let c of o)this.proxyOf.nodes.splice(i,0,c);let a;for(let c in this.indexes)a=this.indexes[c],i<=a&&(this.indexes[c]=a+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=Us(Gs(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let r of t)r.parent&&r.parent.removeChild(r,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let r of t)r.parent&&r.parent.removeChild(r,"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 Ps(t)]}else if(t.selector||t.selectors)t=[new Zi(t)];else if(t.name)t=[new Qi(t)];else if(t.text)t=[new Is(t)];else throw new Error("Unknown node type in node creation");return t.map(r=>(r[Bs]||e.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[Os]&&Ws(r),r.raws||(r.raws={}),typeof r.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(r.raws.before=n.raws.before.replace(/\S/g,"")),r.parent=this.proxyOf,r))}prepend(...t){t=t.reverse();for(let n of t){let i=this.normalize(n,this.first,"prepend").reverse();for(let r of i)this.proxyOf.nodes.unshift(r);for(let r in this.indexes)this.indexes[r]=this.indexes[r]+i.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 i in this.indexes)n=this.indexes[i],n>=t&&(this.indexes[i]=n-1);return this.markDirty(),this}replaceValues(t,n,i){return i||(i=n,n={}),this.walkDecls(r=>{n.props&&!n.props.includes(r.prop)||n.fast&&!r.value.includes(n.fast)||(r.value=r.value.replace(t,i))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((n,i)=>{let r;try{r=t(n,i)}catch(o){throw n.addToError(o)}return r!==!1&&n.walk&&(r=n.walk(t)),r})}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((i,r)=>{if(i.type==="atrule"&&t.test(i.name))return n(i,r)}):this.walk((i,r)=>{if(i.type==="atrule"&&i.name===t)return n(i,r)}):(n=t,this.walk((i,r)=>{if(i.type==="atrule")return n(i,r)}))}walkComments(t){return this.walk((n,i)=>{if(n.type==="comment")return t(n,i)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((i,r)=>{if(i.type==="decl"&&t.test(i.prop))return n(i,r)}):this.walk((i,r)=>{if(i.type==="decl"&&i.prop===t)return n(i,r)}):(n=t,this.walk((i,r)=>{if(i.type==="decl")return n(i,r)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((i,r)=>{if(i.type==="rule"&&t.test(i.selector))return n(i,r)}):this.walk((i,r)=>{if(i.type==="rule"&&i.selector===t)return n(i,r)}):(n=t,this.walk((i,r)=>{if(i.type==="rule")return n(i,r)}))}};ke.registerParse=e=>{Gs=e};ke.registerRule=e=>{Zi=e};ke.registerAtRule=e=>{Qi=e};ke.registerRoot=e=>{Hs=e};Vs.exports=ke;ke.default=ke;ke.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Qi.prototype):e.type==="rule"?Object.setPrototypeOf(e,Zi.prototype):e.type==="decl"?Object.setPrototypeOf(e,Ps.prototype):e.type==="comment"?Object.setPrototypeOf(e,Is.prototype):e.type==="root"&&Object.setPrototypeOf(e,Hs.prototype),e[Bs]=!0,e.nodes&&e.nodes.forEach(t=>{ke.rebuild(t)})}});var Nn=Z((ug,js)=>{"use strict";var zs=Ze(),yt=class extends zs{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)}};js.exports=yt;yt.default=yt;zs.registerAtRule(yt)});var Rn=Z((cg,Ks)=>{"use strict";var Ed=Ze(),$s,qs,ct=class extends Ed{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new $s(new qs,this,t).stringify()}};ct.registerLazyResult=e=>{$s=e};ct.registerProcessor=e=>{qs=e};Ks.exports=ct;ct.default=ct});var Js=Z((dg,Ys)=>{var Ad="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",wd=(e,t=21)=>(n=t)=>{let i="",r=n|0;for(;r--;)i+=e[Math.random()*e.length|0];return i},Cd=(e=21)=>{let t="",n=e|0;for(;n--;)t+=Ad[Math.random()*64|0];return t};Ys.exports={nanoid:Cd,customAlphabet:wd}});var Ln=Z(()=>{});var kn=Z(()=>{});var er=Z(()=>{});var Xs=Z(()=>{});var nr=Z((Sg,ea)=>{"use strict";var{existsSync:_d,readFileSync:Td}=Xs(),{dirname:tr,join:vd}=Ln(),{SourceMapConsumer:Qs,SourceMapGenerator:Zs}=kn();function Fd(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var tn=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 i=n.map?n.map.prev:void 0,r=this.loadMap(n.from,i);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=tr(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Qs(this.json||this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\/json;charset=utf-?8;base64,/,i=/^data:application\/json;base64,/,r=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/,a=t.match(r)||t.match(o);if(a)return decodeURIComponent(t.substr(a[0].length));let c=t.match(n)||t.match(i);if(c)return Fd(t.substr(c[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 i=t.lastIndexOf(n.pop()),r=t.indexOf("*/",i);i>-1&&r>-1&&(this.annotation=this.getAnnotationURL(t.substring(i,r)))}loadFile(t,n,i){if(!(!i&&!this.unsafeMap&&!/\.map$/i.test(t))&&(this.root=tr(t),_d(t)))return this.mapFile=t,Td(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 i=n(t);if(i){let r=this.loadFile(i,t,!0);if(!r)throw new Error("Unable to load previous source map: "+i.toString());return r}}else{if(n instanceof Qs)return Zs.fromSourceMap(n).toString();if(n instanceof Zs)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 i=this.annotation;t&&(i=vd(tr(t),i));let r=this.loadFile(i,t,!1);if(r)try{this.json=JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return r}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};ea.exports=tn;tn.default=tn});var nn=Z((Eg,oa)=>{"use strict";var{nanoid:Md}=Js(),{isAbsolute:or,resolve:sr}=Ln(),{SourceMapConsumer:Nd,SourceMapGenerator:Rd}=kn(),{fileURLToPath:ta,pathToFileURL:Dn}=er(),na=Fn(),Ld=nr(),ir=qi(),rr=Symbol("lineToIndexCache"),kd=!!(Nd&&Rd),ia=!!(sr&&or);function ra(e){if(e[rr])return e[rr];let t=e.css.split(`
|
|
21
|
-
`),n=new Array(t.length),
|
|
22
|
-
`," "];return
|
|
12
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function om(e){return e[0].toUpperCase()+e.slice(1)}var dn=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(ot(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(`
|
|
13
|
+
`)){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(ot(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(ot(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:ot(s)),this.stringify(l,r!==a||i)}}comment(t){let n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder(ot("/*"+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(ot(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 ks[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"+om(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=ks[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(`
|
|
14
|
+
`)&&(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(`
|
|
15
|
+
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(t,n){let r;return t.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
|
|
16
|
+
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(t){let n;return t.walk(r=>{if(r.type!=="decl"&&(n=r.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(t){let n;return t.walk(r=>{if(r.nodes&&(r.parent!==t||t.first!==r)&&typeof r.raws.before<"u")return n=r.raws.before,n.includes(`
|
|
17
|
+
`)&&(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(`
|
|
18
|
+
`);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:ot(n))}}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(ot(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)}};Ds.exports=dn;dn.default=dn});var fn=ee((Bb,Is)=>{"use strict";var am=Pi();function Oi(e,t){new am(t).stringify(e)}Is.exports=Oi;Oi.default=Oi});var tr=ee((Ub,Gi)=>{"use strict";Gi.exports.isClean=Symbol("isClean");Gi.exports.my=Symbol("my")});var hn=ee((Wb,Ps)=>{"use strict";var sm=er(),lm=Pi(),um=fn(),{isClean:mn,my:cm}=tr();function Hi(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=>Hi(a,n)):(o==="object"&&i!==null&&(i=Hi(i)),n[r]=i)}return n}function Je(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]===`
|
|
19
|
+
`?(n=1,r+=1):n+=1}return i}var pn=class{get proxyOf(){return this}constructor(t={}){this.raws={},this[mn]=!1,this[cm]=!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=Hi(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 sm(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[mn]=!0}markDirty(){if(this[mn]){this[mn]=!1;let t=this;for(;t=t.parent;)t[mn]=!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(Je(r,this.source.start),Je(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=Je(i,this.source.start),a=o+t;for(let l=o;l<a;l++)i[l]===`
|
|
20
|
+
`?(n=1,r+=1):n+=1;return{column:n,line:r,offset:a}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:Je(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:Je(n,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(t.word){let a=n.slice(Je(n,this.source.start),Je(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:Je(n,t.start)}:t.index&&(r=this.positionInside(t.index)),t.end?i={column:t.end.column,line:t.end.line,offset:Je(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 lm().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=um){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)}};Ps.exports=pn;pn.default=pn});var xn=ee((Vb,Os)=>{"use strict";var dm=hn(),gn=class extends dm{constructor(t){super(t),this.type="comment"}};Os.exports=gn;gn.default=gn});var yn=ee((zb,Gs)=>{"use strict";var fm=hn(),bn=class extends fm{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"}};Gs.exports=bn;bn.default=bn});var at=ee(($b,js)=>{"use strict";var Hs=xn(),Bs=yn(),mm=hn(),{isClean:Us,my:Ws}=tr(),Bi,Vs,zs,Ui;function $s(e){return e.map(t=>(t.nodes&&(t.nodes=$s(t.nodes)),delete t.source,t))}function qs(e){if(e[Us]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)qs(t)}var He=class e extends mm{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=$s(Vs(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 Bs(t)]}else if(t.selector||t.selectors)t=[new Ui(t)];else if(t.name)t=[new Bi(t)];else if(t.text)t=[new Hs(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Ws]||e.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Us]&&qs(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)}))}};He.registerParse=e=>{Vs=e};He.registerRule=e=>{Ui=e};He.registerAtRule=e=>{Bi=e};He.registerRoot=e=>{zs=e};js.exports=He;He.default=He;He.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Bi.prototype):e.type==="rule"?Object.setPrototypeOf(e,Ui.prototype):e.type==="decl"?Object.setPrototypeOf(e,Bs.prototype):e.type==="comment"?Object.setPrototypeOf(e,Hs.prototype):e.type==="root"&&Object.setPrototypeOf(e,zs.prototype),e[Ws]=!0,e.nodes&&e.nodes.forEach(t=>{He.rebuild(t)})}});var nr=ee((qb,Ys)=>{"use strict";var Ks=at(),kt=class extends Ks{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)}};Ys.exports=kt;kt.default=kt;Ks.registerAtRule(kt)});var rr=ee((jb,Qs)=>{"use strict";var pm=at(),Xs,Js,bt=class extends pm{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Xs(new Js,this,t).stringify()}};bt.registerLazyResult=e=>{Xs=e};bt.registerProcessor=e=>{Js=e};Qs.exports=bt;bt.default=bt});var el=ee((Kb,Zs)=>{var hm="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",gm=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i--;)r+=e[Math.random()*e.length|0];return r},xm=(e=21)=>{let t="",n=e|0;for(;n--;)t+=hm[Math.random()*64|0];return t};Zs.exports={nanoid:xm,customAlphabet:gm}});var ir=ee(()=>{});var or=ee(()=>{});var Wi=ee(()=>{});var tl=ee(()=>{});var zi=ee((ry,il)=>{"use strict";var{existsSync:bm,readFileSync:ym}=tl(),{dirname:Vi,join:Sm}=ir(),{SourceMapConsumer:nl,SourceMapGenerator:rl}=or();function vm(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var Sn=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=Vi(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new nl(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 vm(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=Vi(t),bm(t)))return this.mapFile=t,ym(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 nl)return rl.fromSourceMap(n).toString();if(n instanceof rl)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=Sm(Vi(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)}};il.exports=Sn;Sn.default=Sn});var vn=ee((iy,ul)=>{"use strict";var{nanoid:Em}=el(),{isAbsolute:ji,resolve:Ki}=ir(),{SourceMapConsumer:Cm,SourceMapGenerator:_m}=or(),{fileURLToPath:ol,pathToFileURL:ar}=Wi(),al=er(),Am=zi(),$i=Ii(),qi=Symbol("lineToIndexCache"),wm=!!(Cm&&_m),sl=!!(Ki&&ji);function ll(e){if(e[qi])return e[qi];let t=e.css.split(`
|
|
21
|
+
`),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[qi]=n,n}var Dt=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&&(!sl||/^\w+:\/\//.test(n.from)||ji(n.from)?this.file=n.from:this.file=Ki(n.from)),sl&&wm){let r=new Am(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 "+Em(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 m=n,f=r;if(typeof m.offset=="number"){s=m.offset;let x=this.fromOffset(s);n=x.line,r=x.col}else n=m.line,r=m.column,s=this.fromLineAndColumn(n,r);if(typeof f.offset=="number"){l=f.offset;let x=this.fromOffset(l);a=x.line,o=x.col}else a=f.line,o=f.column,l=this.fromLineAndColumn(f.line,f.column)}else if(r)s=this.fromLineAndColumn(n,r);else{s=n;let m=this.fromOffset(s);n=m.line,r=m.col}let c=this.origin(n,r,a,o);return c?u=new al(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 al(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&&(ar&&(u.input.url=ar(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(t,n){return ll(this)[t-1]+n-1}fromOffset(t){let n=ll(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:Ki(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;ji(a.source)?s=ar(a.source):s=new URL(a.source,this.map.consumer().sourceRoot||ar(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(ol)u.file=ol(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}};ul.exports=Dt;Dt.default=Dt;$i&&$i.registerInput&&$i.registerInput(Dt)});var It=ee((oy,ml)=>{"use strict";var cl=at(),dl,fl,st=class extends cl{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 dl(new fl,this,t).stringify()}};st.registerLazyResult=e=>{dl=e};st.registerProcessor=e=>{fl=e};ml.exports=st;st.default=st;cl.registerRoot(st)});var Yi=ee((ay,pl)=>{"use strict";var En={comma(e){return En.split(e,[","],!0)},space(e){let t=[" ",`
|
|
22
|
+
`," "];return En.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}};pl.exports=En;En.default=En});var sr=ee((sy,gl)=>{"use strict";var hl=at(),Tm=Yi(),Pt=class extends hl{get selectors(){return Tm.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=[])}};gl.exports=Pt;Pt.default=Pt;hl.registerRule(Pt)});var bl=ee((ly,xl)=>{"use strict";var Rm=nr(),Lm=xn(),Fm=yn(),Nm=vn(),Mm=zi(),km=It(),Dm=sr();function Cn(e,t){if(Array.isArray(e))return e.map(i=>Cn(i));let{inputs:n,...r}=e;if(n){t=[];for(let i of n){let o={...i,__proto__:Nm.prototype};o.map&&(o.map={...o.map,__proto__:Mm.prototype}),t.push(o)}}if(r.nodes&&(r.nodes=e.nodes.map(i=>Cn(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 km(r);if(r.type==="decl")return new Fm(r);if(r.type==="rule")return new Dm(r);if(r.type==="comment")return new Lm(r);if(r.type==="atrule")return new Rm(r);throw new Error("Unknown node type: "+e.type)}xl.exports=Cn;Cn.default=Cn});var Ji=ee((uy,_l)=>{"use strict";var{dirname:lr,relative:Sl,resolve:vl,sep:El}=ir(),{SourceMapConsumer:Cl,SourceMapGenerator:ur}=or(),{pathToFileURL:yl}=Wi(),Im=vn(),Pm=!!(Cl&&ur),Om=!!(lr&&vl&&Sl&&El),Xi=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=`
|
|
23
23
|
`;this.css.includes(`\r
|
|
24
24
|
`)&&(n=`\r
|
|
25
|
-
`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),
|
|
26
|
-
`;)t--;this.css=this.css.slice(0,t)+this.css.slice(n+2)}}}}generate(){if(this.clearAnnotation(),
|
|
27
|
-
`),n=c.length-o):n+=c.length,s&&l!=="start"){let f=s.parent||{raws:{}};(!(s.type==="decl"||s.type==="atrule"&&!s.nodes)||s!==f.last||f.raws.semicolon)&&(s.source&&s.source.end?(r.source=this.sourcePath(s),r.original.line=s.source.end.line,r.original.column=s.source.end.column-1,r.generated.line=t,r.generated.column=n-2,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,r.generated.line=t,r.generated.column=n-1,this.map.addMapping(r)))}})}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 i=this.opts.to?Pn(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(i=Pn(xa(i,this.mapOpts.annotation)));let r=ga(i,t);return this.memoizedPaths.set(t,r),r}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 Wd(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 i=n.source.input.from;if(i&&!t[i]){t[i]=!0;let r=this.usesFileUrls?this.toFileUrl(i):this.toUrl(this.path(i));this.map.setSourceContent(r,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(ha){let i=ha(t).toString();return this.memoizedFileURLs.set(t,i),i}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;ba==="\\"&&(t=t.replace(/\\/g,"/"));let i=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,i),i}};Sa.exports=lr});var wa=Z((vg,Aa)=>{"use strict";var Bn=/[\t\n\f\r "#'()/;[\\\]{}]/g,Gn=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,jd=/.[\r\n"'(/\\]/,Ea=/[\da-f]/i;Aa.exports=function(t,n={}){let i=t.css.valueOf(),r=n.ignoreErrors,o,a,c,s,l,f,p,d,x,S,y=i.length,b=0,A=[],_=[],M=-1;function H(){return b}function D(T){throw t.error("Unclosed "+T,b)}function F(){return _.length===0&&b>=y}function w(T){if(_.length)return _.pop();if(b>=y)return;let R=T?T.ignoreUnclosed:!1;switch(o=i.charCodeAt(b),o){case 10:case 32:case 9:case 13:case 12:{s=b;do s+=1,o=i.charCodeAt(s);while(o===32||o===10||o===9||o===13||o===12);f=["space",i.slice(b,s)],b=s-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let L=String.fromCharCode(o);f=[L,L,b];break}case 40:{if(S=A.length?A.pop()[1]:"",x=i.charCodeAt(b+1),S==="url"&&x!==39&&x!==34&&x!==32&&x!==10&&x!==9&&x!==12&&x!==13){s=b;do{if(p=!1,s=i.indexOf(")",s+1),s===-1)if(r||R){s=b;break}else D("bracket");for(d=s;i.charCodeAt(d-1)===92;)d-=1,p=!p}while(p);f=["brackets",i.slice(b,s+1),b,s],b=s}else b<=M?f=["(","(",b]:(s=i.indexOf(")",b+1),a=i.slice(b,s+1),s===-1||jd.test(a)?(M=s===-1?y:s,f=["(","(",b]):(f=["brackets",a,b,s],b=s));break}case 39:case 34:{l=o===39?"'":'"',s=b;do{if(p=!1,s=i.indexOf(l,s+1),s===-1)if(r||R){s=b+1;break}else D("string");for(d=s;i.charCodeAt(d-1)===92;)d-=1,p=!p}while(p);f=["string",i.slice(b,s+1),b,s],b=s;break}case 64:{Bn.lastIndex=b+1,Bn.test(i),Bn.lastIndex===0?s=i.length-1:s=Bn.lastIndex-2,f=["at-word",i.slice(b,s+1),b,s],b=s;break}case 92:{for(s=b,c=!0;i.charCodeAt(s+1)===92;)s+=1,c=!c;if(o=i.charCodeAt(s+1),c&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(s+=1,Ea.test(i.charAt(s)))){for(;Ea.test(i.charAt(s+1));)s+=1;i.charCodeAt(s+1)===32&&(s+=1)}f=["word",i.slice(b,s+1),b,s],b=s;break}default:{o===47&&i.charCodeAt(b+1)===42?(s=i.indexOf("*/",b+2)+1,s===0&&(r||R?s=i.length:D("comment")),f=["comment",i.slice(b,s+1),b,s],b=s):(Gn.lastIndex=b+1,Gn.test(i),Gn.lastIndex===0?s=i.length-1:s=Gn.lastIndex-2,f=["word",i.slice(b,s+1),b,s],A.push(f),b=s);break}}return b++,f}function C(T){_.push(T)}return{back:C,endOfFile:F,nextToken:w,position:H}}});var va=Z((Fg,Ta)=>{"use strict";var $d=Nn(),qd=Qt(),Kd=en(),Yd=Et(),Ca=In(),Jd=wa(),_a={empty:!0,space:!0};function Xd(e){for(let t=e.length-1;t>=0;t--){let n=e[t],i=n[3]||n[2];if(i)return i}}var cr=class{constructor(t){this.input=t,this.root=new Yd,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 $d;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let i,r,o,a=!1,c=!1,s=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),i=t[0],i==="("||i==="["?l.push(i==="("?")":"]"):i==="{"&&l.length>0?l.push("}"):i===l[l.length-1]&&l.pop(),l.length===0)if(i===";"){n.source.end=this.getPosition(t[2]),n.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){c=!0;break}else if(i==="}"){if(s.length>0){for(o=s.length-1,r=s[o];r&&r[0]==="space";)r=s[--o];r&&(n.source.end=this.getPosition(r[3]||r[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=""),c&&(n.nodes=[],this.current=n)}checkMissedSemicolon(t){let n=this.colon(t);if(n===!1)return;let i=0,r;for(let o=n-1;o>=0&&(r=t[o],!(r[0]!=="space"&&(i+=1,i===2)));o--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(t){let n=0,i,r,o;for(let[a,c]of t.entries()){if(r=c,o=r[0],o==="("&&(n+=1),o===")"&&(n-=1),n===0&&o===":")if(!i)this.doubleColon(r);else{if(i[0]==="word"&&i[1]==="progid")continue;return a}i=r}return!1}comment(t){let n=new qd;this.init(n,t[2]),n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++;let i=t[1].slice(2,-2);if(!i.trim())n.text="",n.raws.left=i,n.raws.right="";else{let r=i.match(/^(\s*)([^]*\S)(\s*)$/);n.text=r[2],n.raws.left=r[1],n.raws.right=r[3]}}createTokenizer(){this.tokenizer=Jd(this.input)}decl(t,n){let i=new Kd;this.init(i,t[0][2]);let r=t[t.length-1];for(r[0]===";"&&(this.semicolon=!0,t.pop()),i.source.end=this.getPosition(r[3]||r[2]||Xd(t)),i.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),i.raws.before+=t.shift()[1];for(i.source.start=this.getPosition(t[0][2]),i.prop="";t.length;){let l=t[0][0];if(l===":"||l==="space"||l==="comment")break;i.prop+=t.shift()[1]}i.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){i.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),i.raws.between+=o[1];(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));let a=[],c;for(;t.length&&(c=t[0][0],!(c!=="space"&&c!=="comment"));)a.push(t.shift());this.precheckMissedSemicolon(t);for(let l=t.length-1;l>=0;l--){if(o=t[l],o[1].toLowerCase()==="!important"){i.important=!0;let f=this.stringFrom(t,l);f=this.spacesFromEnd(t)+f,f!==" !important"&&(i.raws.important=f);break}else if(o[1].toLowerCase()==="important"){let f=t.slice(0),p="";for(let d=l;d>0;d--){let x=f[d][0];if(p.trim().startsWith("!")&&x!=="space")break;p=f.pop()[1]+p}p.trim().startsWith("!")&&(i.important=!0,i.raws.important=p,t=f)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(l=>l[0]!=="space"&&l[0]!=="comment")&&(i.raws.between+=a.map(l=>l[1]).join(""),a=[]),this.raw(i,"value",a.concat(t),n),i.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 Ca;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,i=null,r=!1,o=null,a=[],c=t[1].startsWith("--"),s=[],l=t;for(;l;){if(i=l[0],s.push(l),i==="("||i==="[")o||(o=l),a.push(i==="("?")":"]");else if(c&&r&&i==="{")o||(o=l),a.push("}");else if(a.length===0)if(i===";")if(r){this.decl(s,c);return}else break;else if(i==="{"){this.rule(s);return}else if(i==="}"){this.tokenizer.back(s.pop()),n=!0;break}else i===":"&&(r=!0);else i===a[a.length-1]&&(a.pop(),a.length===0&&(o=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),a.length>0&&this.unclosedBracket(o),n&&r){if(!c)for(;s.length&&(l=s[s.length-1][0],!(l!=="space"&&l!=="comment"));)this.tokenizer.back(s.pop());this.decl(s,c)}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,i,r){let o,a,c=i.length,s="",l=!0,f,p;for(let d=0;d<c;d+=1)o=i[d],a=o[0],a==="space"&&d===c-1&&!r?l=!1:a==="comment"?(p=i[d-1]?i[d-1][0]:"empty",f=i[d+1]?i[d+1][0]:"empty",!_a[p]&&!_a[f]?s.slice(-1)===","?l=!1:s+=o[1]:l=!1):s+=o[1];if(!l){let d=i.reduce((x,S)=>x+S[1],"");t.raws[n]={raw:d,value:s}}t[n]=s}rule(t){t.pop();let n=new Ca;this.init(n,t[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(n,"selector",t),this.current=n}spacesAndCommentsFromEnd(t){let n,i="";for(;t.length&&(n=t[t.length-1][0],!(n!=="space"&&n!=="comment"));)i=t.pop()[1]+i;return i}spacesAndCommentsFromStart(t){let n,i="";for(;t.length&&(n=t[0][0],!(n!=="space"&&n!=="comment"));)i+=t.shift()[1];return i}spacesFromEnd(t){let n,i="";for(;t.length&&(n=t[t.length-1][0],n==="space");)i=t.pop()[1]+i;return i}stringFrom(t,n){let i="";for(let r=n;r<t.length;r++)i+=t[r][1];return t.splice(n,t.length-n),i}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})}};Ta.exports=cr});var Un=Z((Mg,Fa)=>{"use strict";var Qd=Ze(),Zd=nn(),ef=va();function Hn(e,t){let n=new Zd(e,t),i=new ef(n);try{i.parse()}catch(r){throw r}return i.root}Fa.exports=Hn;Hn.default=Hn;Qd.registerParse(Hn)});var dr=Z((Ng,Ma)=>{"use strict";var sn=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){let i=n.node.rangeBy(n);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(let i in n)this[i]=n[i]}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}};Ma.exports=sn;sn.default=sn});var Wn=Z((Rg,Na)=>{"use strict";var tf=dr(),an=class{get content(){return this.css}constructor(t,n,i){this.processor=t,this.messages=[],this.root=n,this.opts=i,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 i=new tf(t,n);return this.messages.push(i),i}warnings(){return this.messages.filter(t=>t.type==="warning")}};Na.exports=an;an.default=an});var fr=Z((Lg,La)=>{"use strict";var Ra={};La.exports=function(t){Ra[t]||(Ra[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))}});var hr=Z((Dg,Pa)=>{"use strict";var nf=Ze(),rf=Rn(),of=ur(),sf=Un(),ka=Wn(),af=Et(),lf=qt(),{isClean:Ge,my:uf}=Mn(),kg=fr(),cf={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},df={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},ff={Once:!0,postcssPlugin:!0,prepare:!0},wt=0;function ln(e){return typeof e=="object"&&typeof e.then=="function"}function Ia(e){let t=!1,n=cf[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,wt,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,wt,n+"Exit"]:[n,n+"Exit"]}function Da(e){let t;return e.type==="document"?t=["Document",wt,"DocumentExit"]:e.type==="root"?t=["Root",wt,"RootExit"]:t=Ia(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function mr(e){return e[Ge]=!1,e.nodes&&e.nodes.forEach(t=>mr(t)),e}var pr={},tt=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,i){this.stringified=!1,this.processed=!1;let r;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))r=mr(n);else if(n instanceof e||n instanceof ka)r=mr(n.root),n.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=n.map);else{let o=sf;i.syntax&&(o=i.syntax.parse),i.parser&&(o=i.parser),o.parse&&(o=o.parse);try{r=o(n,i)}catch(a){this.processed=!0,this.error=a}r&&!r[uf]&&nf.rebuild(r)}this.result=new ka(t,r,i),this.helpers={...pr,postcss:pr,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 i=this.result.lastPlugin;try{n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin?(t.plugin=i.postcssPlugin,t.setMessage()):i.postcssVersion}catch(r){console&&console.error&&console.error(r)}return t}prepareVisitors(){this.listeners={};let t=(n,i,r)=>{this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push([n,r])};for(let n of this.plugins)if(typeof n=="object")for(let i in n){if(!df[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ff[i])if(typeof n[i]=="object")for(let r in n[i])r==="*"?t(n,i,n[i][r]):t(n,i+"-"+r.toLowerCase(),n[i][r]);else typeof n[i]=="function"&&t(n,i,n[i])}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],i=this.runOnRoot(n);if(ln(i))try{await i}catch(r){throw this.handleError(r)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ge];){t[Ge]=!0;let n=[Da(t)];for(;n.length>0;){let i=this.visitTick(n);if(ln(i))try{await i}catch(r){let o=n[n.length-1].node;throw this.handleError(r,o)}}}if(this.listeners.OnceExit)for(let[n,i]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let r=t.nodes.map(o=>i(o,this.helpers));await Promise.all(r)}else await i(t,this.helpers)}catch(r){throw this.handleError(r)}}}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(i=>t.Once(i,this.helpers));return ln(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=lf;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let i=this.result.root.source;if(t.map===void 0&&!(i&&i.input&&i.input.map)){let a="";return n(this.result.root,c=>{a+=c}),this.result.css=a,this.result}let o=new of(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(ln(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ge];)t[Ge]=!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[i,r]of t){this.result.lastPlugin=i;let o;try{o=r(n,this.helpers)}catch(a){throw this.handleError(a,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(ln(o))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:i,visitors:r}=n;if(i.type!=="root"&&i.type!=="document"&&!i.parent){t.pop();return}if(r.length>0&&n.visitorIndex<r.length){let[a,c]=r[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===r.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=a;try{return c(i.toProxy(),this.helpers)}catch(s){throw this.handleError(s,i)}}if(n.iterator!==0){let a=n.iterator,c;for(;c=i.nodes[i.indexes[a]];)if(i.indexes[a]+=1,!c[Ge]){c[Ge]=!0,t.push(Da(c));return}n.iterator=0,delete i.indexes[a]}let o=n.events;for(;n.eventIndex<o.length;){let a=o[n.eventIndex];if(n.eventIndex+=1,a===wt){i.nodes&&i.nodes.length&&(i[Ge]=!0,n.iterator=i.getIterator());return}else if(this.listeners[a]){n.visitors=this.listeners[a];return}}t.pop()}walkSync(t){t[Ge]=!0;let n=Ia(t);for(let i of n)if(i===wt)t.nodes&&t.each(r=>{r[Ge]||this.walkSync(r)});else{let r=this.listeners[i];if(r&&this.visitSync(r,t.toProxy()))return}}warnings(){return this.sync().warnings()}};tt.registerPostcss=e=>{pr=e};Pa.exports=tt;tt.default=tt;af.registerLazyResult(tt);rf.registerLazyResult(tt)});var Ba=Z((Pg,Oa)=>{"use strict";var mf=ur(),pf=Un(),hf=Wn(),gf=qt(),Ig=fr(),un=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=pf;try{t=n(this._css,this._opts)}catch(i){this.error=i}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,n,i){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=i,this._map=void 0;let r=gf;this.result=new hf(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 mf(r,void 0,this._opts,n);if(a.isMap()){let[c,s]=a.generate();c&&(this.result.css=c),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[]}};Oa.exports=un;un.default=un});var Ha=Z((Og,Ga)=>{"use strict";var xf=Rn(),bf=hr(),yf=Ba(),Sf=Et(),dt=class{constructor(t=[]){this.version="8.5.14",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let i of t)if(i.postcss===!0?i=i():i.postcss&&(i=i.postcss),typeof i=="object"&&Array.isArray(i.plugins))n=n.concat(i.plugins);else if(typeof i=="object"&&i.postcssPlugin)n.push(i);else if(typeof i=="function")n.push(i);else if(!(typeof i=="object"&&(i.parse||i.stringify)))throw new Error(i+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new yf(this,t,n):new bf(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};Ga.exports=dt;dt.default=dt;Sf.registerProcessor(dt);xf.registerProcessor(dt)});var Ka=Z((Bg,qa)=>{"use strict";var Ua=Nn(),Wa=Qt(),Ef=Ze(),Af=Fn(),Va=en(),za=Rn(),wf=pa(),Cf=nn(),_f=hr(),Tf=ar(),vf=Jt(),Ff=Un(),gr=Ha(),Mf=Wn(),ja=Et(),$a=In(),Nf=qt(),Rf=dr();function se(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new gr(e)}se.plugin=function(t,n){let i=!1;function r(...a){console&&console.warn&&!i&&(i=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
25
|
+
`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||lr(t.file),i;this.mapOpts.sourcesContent===!1?(i=new Cl(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]===`
|
|
26
|
+
`;)t--;this.css=this.css.slice(0,t)+this.css.slice(n+2)}}}}generate(){if(this.clearAnnotation(),Om&&Pm&&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=ur.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new ur({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 ur({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(`
|
|
27
|
+
`),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?lr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=lr(vl(r,this.mapOpts.annotation)));let i=Sl(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 Im(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(yl){let r=yl(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;El==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}};_l.exports=Xi});var Tl=ee((cy,wl)=>{"use strict";var cr=/[\t\n\f\r "#'()/;[\\\]{}]/g,dr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Gm=/.[\r\n"'(/\\]/,Al=/[\da-f]/i;wl.exports=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,a,l,s,u,c,m,f,x,v,C=r.length,y=0,w=[],T=[],N=-1;function D(){return y}function I(A){throw t.error("Unclosed "+A,y)}function _(){return T.length===0&&y>=C}function b(A){if(T.length)return T.pop();if(y>=C)return;let R=A?A.ignoreUnclosed:!1;switch(o=r.charCodeAt(y),o){case 10:case 32:case 9:case 13:case 12:{s=y;do s+=1,o=r.charCodeAt(s);while(o===32||o===10||o===9||o===13||o===12);c=["space",r.slice(y,s)],y=s-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let F=String.fromCharCode(o);c=[F,F,y];break}case 40:{if(v=w.length?w.pop()[1]:"",x=r.charCodeAt(y+1),v==="url"&&x!==39&&x!==34&&x!==32&&x!==10&&x!==9&&x!==12&&x!==13){s=y;do{if(m=!1,s=r.indexOf(")",s+1),s===-1)if(i||R){s=y;break}else I("bracket");for(f=s;r.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);c=["brackets",r.slice(y,s+1),y,s],y=s}else y<=N?c=["(","(",y]:(s=r.indexOf(")",y+1),a=r.slice(y,s+1),s===-1||Gm.test(a)?(N=s===-1?C:s,c=["(","(",y]):(c=["brackets",a,y,s],y=s));break}case 39:case 34:{u=o===39?"'":'"',s=y;do{if(m=!1,s=r.indexOf(u,s+1),s===-1)if(i||R){s=y+1;break}else I("string");for(f=s;r.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);c=["string",r.slice(y,s+1),y,s],y=s;break}case 64:{cr.lastIndex=y+1,cr.test(r),cr.lastIndex===0?s=r.length-1:s=cr.lastIndex-2,c=["at-word",r.slice(y,s+1),y,s],y=s;break}case 92:{for(s=y,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,Al.test(r.charAt(s)))){for(;Al.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===32&&(s+=1)}c=["word",r.slice(y,s+1),y,s],y=s;break}default:{o===47&&r.charCodeAt(y+1)===42?(s=r.indexOf("*/",y+2)+1,s===0&&(i||R?s=r.length:I("comment")),c=["comment",r.slice(y,s+1),y,s],y=s):(dr.lastIndex=y+1,dr.test(r),dr.lastIndex===0?s=r.length-1:s=dr.lastIndex-2,c=["word",r.slice(y,s+1),y,s],w.push(c),y=s);break}}return y++,c}function S(A){T.push(A)}return{back:S,endOfFile:_,nextToken:b,position:D}}});var Nl=ee((dy,Fl)=>{"use strict";var Hm=nr(),Bm=xn(),Um=yn(),Wm=It(),Rl=sr(),Vm=Tl(),Ll={empty:!0,space:!0};function zm(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}var Qi=class{constructor(t){this.input=t,this.root=new Wm,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 Hm;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 Bm;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=Vm(this.input)}decl(t,n){let r=new Um;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]||zm(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),m="";for(let f=u;f>0;f--){let x=c[f][0];if(m.trim().startsWith("!")&&x!=="space")break;m=c.pop()[1]+m}m.trim().startsWith("!")&&(r.important=!0,r.raws.important=m,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 Rl;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,m;for(let f=0;f<l;f+=1)o=r[f],a=o[0],a==="space"&&f===l-1&&!i?u=!1:a==="comment"?(m=r[f-1]?r[f-1][0]:"empty",c=r[f+1]?r[f+1][0]:"empty",!Ll[m]&&!Ll[c]?s.slice(-1)===","?u=!1:s+=o[1]:u=!1):s+=o[1];if(!u){let f=r.reduce((x,v)=>x+v[1],"");t.raws[n]={raw:f,value:s}}t[n]=s}rule(t){t.pop();let n=new Rl;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})}};Fl.exports=Qi});var mr=ee((fy,Ml)=>{"use strict";var $m=at(),qm=vn(),jm=Nl();function fr(e,t){let n=new qm(e,t),r=new jm(n);try{r.parse()}catch(i){throw i}return r.root}Ml.exports=fr;fr.default=fr;$m.registerParse(fr)});var Zi=ee((my,kl)=>{"use strict";var _n=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}};kl.exports=_n;_n.default=_n});var pr=ee((py,Dl)=>{"use strict";var Km=Zi(),An=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 Km(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}};Dl.exports=An;An.default=An});var eo=ee((hy,Pl)=>{"use strict";var Il={};Pl.exports=function(t){Il[t]||(Il[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))}});var ro=ee((xy,Bl)=>{"use strict";var Ym=at(),Xm=rr(),Jm=Ji(),Qm=mr(),Ol=pr(),Zm=It(),ep=fn(),{isClean:qe,my:tp}=tr(),gy=eo(),np={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},rp={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},ip={Once:!0,postcssPlugin:!0,prepare:!0},Ot=0;function wn(e){return typeof e=="object"&&typeof e.then=="function"}function Hl(e){let t=!1,n=np[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,Ot,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,Ot,n+"Exit"]:[n,n+"Exit"]}function Gl(e){let t;return e.type==="document"?t=["Document",Ot,"DocumentExit"]:e.type==="root"?t=["Root",Ot,"RootExit"]:t=Hl(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function to(e){return e[qe]=!1,e.nodes&&e.nodes.forEach(t=>to(t)),e}var no={},lt=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=to(n);else if(n instanceof e||n instanceof Ol)i=to(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=Qm;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[tp]&&Ym.rebuild(i)}this.result=new Ol(t,i,r),this.helpers={...no,postcss:no,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(!rp[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ip[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(wn(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[qe];){t[qe]=!0;let n=[Gl(t)];for(;n.length>0;){let r=this.visitTick(n);if(wn(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 wn(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=ep;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 Jm(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(wn(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[qe];)t[qe]=!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(wn(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[qe]){l[qe]=!0,t.push(Gl(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===Ot){r.nodes&&r.nodes.length&&(r[qe]=!0,n.iterator=r.getIterator());return}else if(this.listeners[a]){n.visitors=this.listeners[a];return}}t.pop()}walkSync(t){t[qe]=!0;let n=Hl(t);for(let r of n)if(r===Ot)t.nodes&&t.each(i=>{i[qe]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,t.toProxy()))return}}warnings(){return this.sync().warnings()}};lt.registerPostcss=e=>{no=e};Bl.exports=lt;lt.default=lt;Zm.registerLazyResult(lt);Xm.registerLazyResult(lt)});var Wl=ee((yy,Ul)=>{"use strict";var op=Ji(),ap=mr(),sp=pr(),lp=fn(),by=eo(),Tn=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=ap;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=lp;this.result=new sp(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 op(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[]}};Ul.exports=Tn;Tn.default=Tn});var zl=ee((Sy,Vl)=>{"use strict";var up=rr(),cp=ro(),dp=Wl(),fp=It(),yt=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 dp(this,t,n):new cp(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};Vl.exports=yt;yt.default=yt;fp.registerProcessor(yt);up.registerProcessor(yt)});var Ql=ee((vy,Jl)=>{"use strict";var $l=nr(),ql=xn(),mp=at(),pp=er(),jl=yn(),Kl=rr(),hp=bl(),gp=vn(),xp=ro(),bp=Yi(),yp=hn(),Sp=mr(),io=zl(),vp=pr(),Yl=It(),Xl=sr(),Ep=fn(),Cp=Zi();function ae(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new io(e)}ae.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:
|
|
28
28
|
https://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:
|
|
29
|
-
https://www.w3ctech.com/topic/2226`));let
|
|
29
|
+
https://www.w3ctech.com/topic/2226`));let l=n(...a);return l.postcssPlugin=t,l.postcssVersion=new io().version,l}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(a,l,s){return ae([i(s)]).process(a,l)},i};ae.stringify=Ep;ae.parse=Sp;ae.fromJSON=hp;ae.list=bp;ae.comment=e=>new ql(e);ae.atRule=e=>new $l(e);ae.decl=e=>new jl(e);ae.rule=e=>new Xl(e);ae.root=e=>new Yl(e);ae.document=e=>new Kl(e);ae.CssSyntaxError=pp;ae.Declaration=jl;ae.Container=mp;ae.Processor=io;ae.Document=Kl;ae.Comment=ql;ae.Warning=Cp;ae.AtRule=$l;ae.Result=vp;ae.Input=gp;ae.Rule=Xl;ae.Root=Yl;ae.Node=yp;xp.registerPostcss(ae);Jl.exports=ae;ae.default=ae});function Un(){return globalThis}function L(e,t){if(typeof window>"u")return;let n=Un(),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 fd=["seconds-time","rational-fps","seek-keep-playing","composition-manifest-v1"];function md(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 pd(e){let t=Number.isFinite(e)&&e>0?e:30,n=Number.isInteger(t)?1:1e6,r=Math.round(t*n),i=md(r,n);return{numerator:r/i,denominator:n/i}}function Kr(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 Wn(e){return{protocolVersion:1,capabilities:fd,fps:pd(e)}}function hd(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function na(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=Kr(n.fps);return r===null||!hd(n.capabilities)?{status:"unsupported",code:"invalid_protocol_metadata",receivedVersion:n.protocolVersion}:{status:"supported",fps:r,metadata:n}}var ra=30;function ia(e){ra=Number.isFinite(e)&&e>0?e:30}function ge(e){try{window.parent.postMessage({...e,...Wn(ra)},"*")}catch(t){L("bridge.postMessage",t)}}var gd={play:(e,t)=>t.onPlay(),pause:(e,t)=>t.onPause(),"stop-media":(e,t)=>t.onStopMedia(),seek:(e,t)=>t.onSeek(xd(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=>yd(e)};function xd(e,t){let n=Number(e.timeSeconds);if(Number.isFinite(n))return Math.max(0,n);let i=Kr(e.fps)??t.getCanonicalFps();return Math.max(0,Number(e.frame??0))/i}function bd(e){let t=na(e);return t.status!=="unsupported"?!1:(ge({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 yd(e){let t=e.selectors,n=e.duration||800;t&&Sd(t,n)}function oa(e){let t=n=>{let r=n.data;if(!r||r.source!=="hf-parent"||r.type!=="control"||bd(r))return;let i=r.action;if(typeof i!="string")return;let o=gd[i];o&&o(r,e)};return window.addEventListener("message",t),ge({source:"hf-preview",type:"ready"}),t}function Sd(e,t){if(!document.getElementById("__hf-flash-styles")){let n=document.createElement("style");n.id="__hf-flash-styles",n.textContent=`
|
|
30
30
|
.__hf-flash {
|
|
31
31
|
outline: 2px solid rgba(59, 130, 246, 0.6) !important;
|
|
32
32
|
outline-offset: 2px !important;
|
|
@@ -36,23 +36,23 @@ https://www.w3ctech.com/topic/2226`));let c=n(...a);return c.postcssPlugin=t,c.p
|
|
|
36
36
|
0% { outline-color: rgba(59, 130, 246, 0.8); }
|
|
37
37
|
100% { outline-color: transparent; }
|
|
38
38
|
}
|
|
39
|
-
`,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(r=>{r.classList.add("__hf-flash"),setTimeout(()=>r.classList.remove("__hf-flash"),t)})}catch(i){v("bridge.flashElements.querySelector",i)}}var hi=null;function po(e){hi=e}function Ye(e,t){if(hi)try{hi({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){v("runtime.analytics.site1",n)}}function Vu(e){let t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-"),n=0,i=t.length;for(;n<i&&t[n]==="-";)n++;for(;i>n&&t[i-1]==="-";)i--;let r=t.slice(n,i);return r.length>0?r:"node"}function pt(e){return`--${Vu(e)}`}function ho(e){let t=new Map;for(let n of e){let i=pt(n),r=t.get(i);r?r.includes(n)||r.push(n):t.set(i,[n])}return[...t.values()].filter(n=>n.length>1)}function go(){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,It(i));let n=An();return{...t,...n}}function It(e){if(!e)return{};let t=e.getAttribute("data-composition-variables");if(!t)return{};let n;try{n=JSON.parse(t)}catch{return{}}if(!Array.isArray(n))return{};let i={};for(let r of n){if(!r||typeof r!="object")continue;let o=r;typeof o.id!="string"||!("default"in o)||(i[o.id]=o.default)}return i}var gi="data-hf-css-vars";function En(e){return"style"in e&&typeof e.style?.setProperty=="function"}function xi(e,t){if(!En(e))return;let n=[];for(let[i,r]of Object.entries(t))if(typeof r=="string"&&r!==""||typeof r=="number"){let o=pt(i);e.style.setProperty(o,String(r)),n.push(o)}n.length>0&&e.setAttribute(gi,n.join(" "))}function xo(e,t,n){let i={};for(let[r,o]of Object.entries(t)){let a=pt(r);((En(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(i[r]=o)}return i}function bo(e){if(!En(e))return;let t=e.getAttribute(gi);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(gi)}}function yo(e){let t=new Set;e.documentElement?.hasAttribute("data-composition-variables")&&t.add(e.documentElement);for(let r of Array.from(e.querySelectorAll("[data-composition-variables]")))t.add(r);let n=An(),i=[];for(let r of t)i.push(...zu(r,n,e.defaultView));for(let r of ho(i))console.warn(`composition variables ${r.join(", ")} collapse to the same CSS property ${pt(r[0]??"")} \u2014 rename one to avoid cross-talk`)}function zu(e,t,n){if(!En(e))return[];let i=It(e),r={};for(let[o,a]of Object.entries(i)){if(o in t)continue;let c=pt(o);(e.style.getPropertyValue(c)||(n?n.getComputedStyle(e).getPropertyValue(c):"")).trim()===""&&(r[o]=a)}for(let[o,a]of Object.entries(t))o in i&&(r[o]=a);return xi(e,r),Object.keys(i)}function So(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 An(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}function Eo(e){let t=[],n=l=>{if(typeof l.getAnimations!="function")return[];try{return l.getAnimations()}catch{return[]}},i=l=>e?.resolveStartSeconds?e.resolveStartSeconds(l):Number.parseFloat(l.getAttribute("data-start")??"0")||0,r=(l,f)=>{let p=null;try{p=l.effect?.getComputedTiming?.()??null}catch(x){v("runtime.adapters.css.site5",x)}if(!p)return{};let d=Number(p.endTime);return Number.isFinite(d)?{endSeconds:f+d/1e3}:{unbounded:!0}},o=(l,f)=>{for(let p of l){try{p.currentTime=f}catch(d){v("runtime.adapters.css.site1",d)}try{p.pause()}catch(d){v("runtime.adapters.css.site2",d)}}},a=l=>{for(let f of l)try{f.play()}catch(p){v("runtime.adapters.css.site3",p)}},c=l=>{for(let f of l)try{f.pause()}catch(p){v("runtime.adapters.css.site4",p)}},s=l=>{l.baseDelay?l.el.style.animationDelay=l.baseDelay:l.el.style.removeProperty("animation-delay"),l.basePlayState?l.el.style.animationPlayState=l.basePlayState:l.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{t=[];let l=document.querySelectorAll("*");for(let f of l){if(!(f instanceof HTMLElement))continue;let p=window.getComputedStyle(f);!p.animationName||p.animationName==="none"||t.push({el:f,baseDelay:f.style.animationDelay||"",basePlayState:f.style.animationPlayState||"",animations:n(f)})}},getInferredDurationSeconds:()=>{let l=0;for(let f of t){if(!f.el.isConnected)continue;let p=i(f.el);for(let d of n(f.el)){let x=r(d,p);x.endSeconds!=null&&(l=Math.max(l,x.endSeconds))}}return l>0?l:null},seek:l=>{let f=Number(l.time)||0;for(let p of t){if(!p.el.isConnected)continue;let d=i(p.el),x=Math.max(0,f-d)*1e3,S=p.animations;if(S.length>0){o(S,x);continue}p.el.style.animationPlayState="paused",p.el.style.animationDelay=`-${(x/1e3).toFixed(3)}s`}},pause:()=>{for(let l of t){if(!l.el.isConnected)continue;let f=l.animations;f.length>0&&c(f),s(l)}},play:()=>{for(let l of t)l.el.isConnected&&(s(l),a(l.animations))},revert:()=>{t=[]}}}function Ao(e){return{name:"gsap",discover:()=>{},seek:t=>{let n=e.getTimeline();if(!n)return;n.pause();let i=Math.max(0,Number(t.time)||0),r=t.suppressEvents===!0;typeof n.totalTime=="function"?(n.totalTime(i+.001,!0),n.totalTime(i,r)):n.seek(i,r)},pause:()=>{let t=e.getTimeline();t&&t.pause()}}}function wo(){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??[],i=new Set(n);for(let r of t)i.has(r)||n.push(r);window.__hfAnime=n}catch(e){v("runtime.adapters.animejs.site1",e)}},seek:e=>{let t=Math.max(0,(Number(e.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let i of n)try{typeof i.seek=="function"&&i.seek(t)}catch(r){v("runtime.adapters.animejs.site2",r)}},pause:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.pause=="function"&&t.pause()}catch(n){v("runtime.adapters.animejs.site3",n)}},play:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.play=="function"&&t.play()}catch(n){v("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function _o(){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??[],i=new Set(n);for(let r of t)i.has(r)||n.push(r);window.__hfLottie=n}}}catch(e){v("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 i of n)try{if(bi(i))i.goToAndStop(t*1e3,!1);else if(yi(i)){if(typeof i.setCurrentRawFrameValue=="function"){let r=i.totalFrames??0,o=i.frameRate??30,a=t*o;r>0&&i.setCurrentRawFrameValue(Math.min(a,r-1))}else if(typeof i.seek=="function"){let r=i.duration??1,o=Math.min(100,t/r*100);i.seek(o)}}}catch(r){v("runtime.adapters.lottie.site2",r)}},pause:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let t of e)try{(bi(t)||yi(t))&&t.pause()}catch(n){v("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 i of e){let r=null;try{r=ju(i)}catch(o){v("runtime.adapters.lottie.site4",o)}r!=null&&(n=!0,t=Math.max(t,r))}return n?t:null}}}function Co(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function ju(e){return bi(e)?Co(e.totalFrames,e.frameRate):yi(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:Co(e.totalFrames,e.frameRate):null}function bi(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function yi(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}var Si=-1;function wn(e){if(e!==Si){Si=e;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:e}}))}catch(t){v("runtime.adapters.seek-dispatch.site1",t)}}}function To(e){Si=e;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:e}}))}catch(t){v("runtime.adapters.seek-dispatch.force",t)}}function vo(){let e=null,t=0,n=null,i=null,r=null,o=null,a=()=>{if(typeof window>"u")return null;let f=window.THREE?.DefaultLoadingManager;return!f||typeof f!="object"||typeof f.itemsLoaded!="number"||typeof f.itemsTotal!="number"?null:f},c=l=>{o||l.itemsTotal<=l.itemsLoaded||(o=new Promise(f=>{l.onLoad=function(){try{r?.call(this)}finally{o=null,l.onLoad=r??null,f()}}}))},s=l=>{n!==l&&(n=l,i=l.onStart??null,r=l.onLoad??null,l.onStart=function(f,p,d){try{i?.call(this,f,p,d)}finally{c(l)}})};return{name:"three",discover:()=>{let l=a();l&&(s(l),c(l))},seek:l=>{e=Math.max(0,Number(l.time)||0),t=e,window.__hfThreeTime=e,wn(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0},getReadyPromise:()=>{let l=a();return!l||l.itemsTotal<=l.itemsLoaded?null:(o||c(l),o)}}}function Oe(e){let t=null,n=new WeakSet;return{name:e.name,discover:()=>{},seek:()=>{},pause:()=>{},play:()=>{},revert:()=>{},getReadyPromise:()=>{let i=e.getInstances();if(i.length===0)return null;let r=i.filter(o=>!n.has(o));return r.length===0?null:t||(t=Promise.allSettled(r.map(o=>e.waitFor(o).then(()=>{n.add(o)}))).then(()=>{t=null}),t)}}}function Fo(){return Oe({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 Mo(){return Oe({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 No(){return Oe({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 Ro(){return Oe({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 Lo(){return Oe({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}function ko(){let e=null,t=0;return{name:"typegpu",discover:()=>{},seek:n=>{e=Math.max(0,Number(n.time)||0),t=e,window.__hfTypegpuTime=e,wn(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0}}}function Do(e){let t=e.nextElementSibling;if(t instanceof HTMLImageElement&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;if(e.id){let n=document.getElementById(`__render_frame_${e.id}__`);if(n instanceof HTMLImageElement&&n.complete&&n.naturalWidth>0)return n}return null}function Io(){let e=globalThis.GPUQueue;if(!e?.prototype?.copyExternalImageToTexture)return;let t=e.prototype.copyExternalImageToTexture;e.prototype.copyExternalImageToTexture=function(n,i,r){if(n?.source instanceof HTMLVideoElement){let o=Do(n.source);if(o)return t.call(this,{...n,source:o},i,r)}return t.call(this,n,i,r)}}function Po(){let e=[globalThis.WebGL2RenderingContext,globalThis.WebGLRenderingContext],t=["texImage2D","texSubImage2D"];for(let n of e){let i=n?.prototype;if(i)for(let r of t){let o=i[r];if(typeof o!="function"||o.__hfVideoPatched)continue;let a=function(...c){let s=c.length-1,l=c[s];if(l instanceof HTMLVideoElement){let f=Do(l);f&&(c[s]=f)}return o.apply(this,c)};a.__hfVideoPatched=!0,i[r]=a}}}function Oo(){let e=!1,t=0,n=!1,i,r,o,a=new Set,c=new WeakMap,s=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},l=b=>{let A=Number(b.currentTime);return Number.isFinite(A)&&A>0?A:0},f=(b,A)=>A<=0?b:b>=A?Math.max(0,b-A):b,p=(b,A)=>{let _=c.get(b);if(_)return _;let M={compositionTimeMs:A,animationTimeMs:e?f(l(b),A):l(b)};return c.set(b,M),M},d=(b,A)=>{if(!a.has(b)){a.add(b);let _=()=>{a.delete(b)};try{b.addEventListener("finish",_,{once:!0}),b.addEventListener("cancel",_,{once:!0})}catch(M){v("runtime.adapters.waapi.site4",M)}}p(b,A)},x=(b,A)=>{for(let _ of b)d(_,A)},S=()=>{if(n||typeof Element>"u")return;let b=Element.prototype;if(typeof b.animate!="function"||b.__hfOriginalAnimate)return;let A=b.animate;try{Object.defineProperty(b,"__hfOriginalAnimate",{value:A,configurable:!0});let _=function(...M){let H=A.apply(this,M);return d(H,t),H};b.animate=_,i=b,r=A,o=_,n=!0}catch{}},y=b=>{let A=null;try{A=b.effect?.getComputedTiming?.()??null}catch(H){v("runtime.adapters.waapi.site4",H)}if(!A)return{};let _=Number(A.endTime);return Number.isFinite(_)?{endSeconds:(c.get(b)?.compositionTimeMs??0)/1e3+_/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,S(),x(s(),t)},seek:b=>{let A=Math.max(0,(Number(b.time)||0)*1e3);t=A,(!e||a.size>0)&&x(s(),e?A:0);for(let _ of a){let M=e?p(_,A):p(_,0),H=M.animationTimeMs+Math.max(0,A-M.compositionTimeMs);try{_.currentTime=H}catch(D){v("runtime.adapters.waapi.site1",D)}try{_.pause()}catch(D){v("runtime.adapters.waapi.site2",D)}}},pause:()=>{e||x(s(),t);for(let b of a)try{b.pause()}catch(A){v("runtime.adapters.waapi.site3",A)}},revert:()=>{if(a.clear(),c=new WeakMap,e=!1,t=0,i&&r&&o&&i.animate===o)try{i.animate=r,i.__hfOriginalAnimate===r&&delete i.__hfOriginalAnimate}catch(b){v("runtime.adapters.waapi.site5",b)}i=void 0,r=void 0,o=void 0,n=!1},getInferredDurationSeconds:()=>{let b=0;for(let A of s()){let _=y(A);_.endSeconds!=null&&(b=Math.max(b,_.endSeconds))}return b>0?b:null}}}function Bo(e,t){if(e.length===0)return 1;let n=0;for(;n<e.length-2&&t>=e[n+1].time;)n+=1;let i=e[n],r=e[n+1]??i,o=r.time-i.time,a=o<=0?0:Math.min(1,Math.max(0,(t-i.time)/o));return i.volume+(r.volume-i.volume)*a}function $u(e,t,n,i){let r=Number.parseFloat(e.dataset.start??"0")||0,o=Number.parseFloat(e.dataset.end??""),a=Number.parseFloat(e.dataset.duration??""),c=Number.isFinite(o)&&o>r?o:Number.isFinite(a)&&a>0?r+a:n,s=Number.parseFloat(e.dataset.volume??""),l=Number.isFinite(s)?Math.max(0,Math.min(1,s)):1;e.volume=l;let f=1/Math.min(60,Math.max(1,i)),p=Math.max(0,r),d=Math.min(n,c),x=[];for(let y=p;y<=d+1e-6;y+=f){let b=Math.min(d,y);t(b);let A=Number(e.volume);if(!Number.isFinite(A))continue;let _=Math.max(0,Math.min(1,A)),M=x.at(-1);if((!M||Math.abs(M.volume-_)>1e-4||b===d)&&x.push({time:Number(b.toFixed(6)),volume:Number(_.toFixed(6))}),b===d)break}return x.some(y=>Math.abs(y.volume-l)>1e-4)?x:null}function Go(e,t,n,i){if(!t||!(e instanceof HTMLAudioElement)&&!(e instanceof HTMLVideoElement)||n<=0)return;let r=c=>{try{typeof t.totalTime=="function"?t.totalTime(c,!0):typeof t.seek=="function"&&t.seek(c,!0)}catch{}},o=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,a=$u(e,r,n,60);Number.isFinite(o)&&r(o),a&&i.set(e,a)}function Ho(e){return Number.isFinite(e)&&e>0?Math.max(.1,Math.min(5,e)):1}function Be(e){let t=Number.parseFloat(e.getAttribute("data-playback-rate")??""),n=Number.isFinite(t)&&t>0?t:e instanceof HTMLMediaElement?e.defaultPlaybackRate:1;return Ho(n)}function gt(e){let t=Number.parseFloat(e.getAttribute("data-playback-start")??e.getAttribute("data-media-start")??"");return Number.isFinite(t)&&t>=0?t:0}function Uo(e){let t=e.isVideo?e.explicitDuration??e.sourceDuration:e.sourceDuration,n=(e.isVideo?[t,e.hostRemaining]:[t,e.hostRemaining,e.explicitDuration]).filter(i=>i!=null&&Number.isFinite(i)&&i>0);return n.length>0?Math.min(...n):null}function Wo(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")),i=[],r=[],o=0;for(let a of n){let c=e?.resolveStartSeconds?e.resolveStartSeconds(a):Number.parseFloat(a.dataset.start??"0");if(!Number.isFinite(c))continue;let s=Number.parseFloat(a.dataset.playbackStart??a.dataset.mediaStart??"0")||0,l=Be(a),f=a.loop,p=Number.isFinite(a.duration)&&a.duration>0?a.duration:null,d=e?.resolveDurationSeconds?.(a)??Number.parseFloat(a.dataset.duration??"");(!Number.isFinite(d)||d<=0)&&p!=null&&(d=Math.max(0,(p-s)/l));let x=Number.isFinite(d)&&d>0?c+d:Number.POSITIVE_INFINITY,S=Number.parseFloat(a.dataset.volume??""),y={el:a,start:c,mediaStart:s,duration:Number.isFinite(d)&&d>0?d:Number.POSITIVE_INFINITY,end:x,volume:Number.isFinite(S)?S:null,playbackRate:l,loop:f,sourceDuration:p};i.push(y),a.tagName==="VIDEO"&&r.push(y),Number.isFinite(x)&&(o=Math.max(o,x))}return{timedMediaEls:n,mediaClips:i,videoClips:r,maxMediaEnd:o}}var Ei=new WeakMap,Ot=new WeakMap,Ai=new WeakSet,ht=new WeakSet;function qu(e){if(ht.has(e))return;ht.add(e);let t=()=>ht.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}var Ku=3;function Yu(e){return e.error!=null||e.networkState===Ku}var wi=new WeakMap;function Pt(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function Ci(e){Ei.delete(e),Ot.delete(e),Ai.delete(e),wi.delete(e)}function Vo(e){let t=!!(e.outputMuted||e.userMuted);for(let n of e.clips){let{el:i}=n;if(!i.isConnected)continue;let r=(e.timeSeconds-n.start)*n.playbackRate+n.mediaStart,o=i.tagName==="VIDEO"&&!n.loop,a=o&&n.sourceDuration!=null&&r>=n.sourceDuration&&e.timeSeconds>=n.start&&e.timeSeconds<n.end;a&&n.sourceDuration!=null&&(r=n.sourceDuration);let c=o&&n.sourceDuration!=null&&r>=n.mediaStart&&r<n.sourceDuration;if(e.timeSeconds>=n.start&&e.timeSeconds<n.end&&r>=0&&(!i.ended||n.loop||a||c)){if(n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let P=n.sourceDuration-n.mediaStart;P>0&&r>=n.sourceDuration&&(r=n.mediaStart+(r-n.mediaStart)%P)}let l=Pt(e.userVolume??1),f=Pt(n.volume??1),p=wi.get(i),d=Pt(i.volume),x;n.volumeKeyframes&&n.volumeKeyframes.length>0?x=Pt(Bo(n.volumeKeyframes,r)):p===void 0||Math.abs(d-p)>1e-4?x=d:x=f;let S=Pt(x*l);i.volume=S,wi.set(i,S),e.onElementVolume?.(i,S),(t||e.isWebAudioOwned?.(i))&&(i.muted=!0),i.preload!=="auto"&&(i.preload="auto");try{i.playbackRate=n.playbackRate*e.playbackRate}catch(P){v("runtime.media.site1",P)}let y=.04,b=2,A=i.currentTime||0,_=Math.abs(A-r),M=r-A,H=Ei.get(i);Ei.set(i,M);let D=H===void 0,F=!D&&Math.abs(M-H)>.5,w=_>3,C=a&&_>.001||i.ended&&c&&_>.001||_>.5&&(D||F||w),T=i.tagName==="VIDEO"&&!i.paused,R=H!==void 0&&Math.abs(M-H)<.004,L=!1;if(!T&&!C&&!D&&R&&_>y){let P=(Ot.get(i)??0)+1;Ot.set(i,P),P>=b&&(L=!0,Ot.set(i,0))}else _<=y&&Ot.set(i,0);let z=!T&&e.forceSync&&_>.02;if(C||L||z){if(!(i.tagName==="VIDEO"&&i.id&&!!document.getElementById(`__render_frame_${i.id}__`))){try{i.currentTime=r}catch(X){v("runtime.media.site2",X)}if(Math.abs(i.currentTime-r)>.5&&!Ai.has(i)){Ai.add(i),i.load();try{i.currentTime=r}catch(X){v("runtime.media.site3",X)}}}ht.delete(i)}a?i.paused||i.pause():e.playing&&i.paused&&!ht.has(i)&&!Yu(i)?(qu(i),i.play().catch(P=>{ht.delete(i),(P&&typeof P=="object"&&"name"in P?String(P.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!e.playing&&!i.paused&&i.pause();continue}Ci(i),i.paused||i.pause()}}var Ju="hf-proxy",zo="runtime_media_proxy_fallback",jo="runtime_media_proxy_unavailable",Bt=new WeakSet,$o=new WeakSet;function Cn(e){return e.currentSrc||e.src}function _i(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:e instanceof HTMLVideoElement&&!!e.id&&!!document.getElementById(`__render_frame_${e.id}__`)}function Ti(e){let t=Cn(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 Xu(e,t){let n=null;for(let i of Object.keys(t))e.endsWith(i)&&(n===null||i.length>n.length)&&(n=i);return n?t[n]??null:null}function Qu(e,t){let n=e.normalize("NFC").toLowerCase(),i=-1,r=null,o=!1;for(let[a,c]of Object.entries(t)){let s=a.normalize("NFC").toLowerCase();n.endsWith(s)&&(s.length>i?(i=s.length,r=c,o=!1):s.length===i&&(o=!0))}return o?null:r}function vi(e,t){return t[e]??Xu(e,t)??Qu(e,t)}function Zu(e,t){let n=new URL(e,document.baseURI);return n.searchParams.set(Ju,t?t.hasAlpha?"vp8":"h264":"auto"),n.href}var ec={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 lt(e,t,n){if($o.has(e))return;$o.add(e);let i=ec[t];he({source:"hf-preview",type:"diagnostic",code:jo,details:{asset:n,codecName:null,reason:t,note:i}}),console.info(`[hyperframes] ${jo}: "${n}" (${t}): ${i}`)}function Fi(e,t=null,n="reactive"){if(Bt.has(e))return;let i=Cn(e),r;try{r=Zu(i,t)}catch(c){v("runtime.mediaProxy.swap",c),lt(e,"invalid_source_url",i);return}Bt.add(e),Ci(e),e.src=r,e.load();let o=t?.codecName??null;he({source:"hf-preview",type:"diagnostic",code:zo,details:{asset:i,codecName:o,trigger:n,note:"render output is unaffected; only this preview element was swapped to an authoring proxy"}}),console.info(`[hyperframes] ${zo}: "${i}" 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 qo(e){if(_i(e)||!(e instanceof HTMLVideoElement)||Bt.has(e))return;let t=window.__HF_MEDIA_CODEC_MAP__;if(!t)return;let n=Ti(e);if(n===null)return;let i=vi(n,t);if(!i||!i.browserHostile)return;let r=i.representativeMime?e.canPlayType(i.representativeMime):"";r==="probably"||r==="maybe"||Fi(e,i,"proactive")}function Ko(e){if(_i(e)||!(e instanceof HTMLVideoElement)||e.videoWidth!==0)return;let t=Cn(e);if(Bt.has(e)){lt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let i=Ti(e);if(i===null){lt(e,"cross_origin",t);return}let r=vi(i,n);if(r&&!r.browserHostile){lt(e,"browser_safe_codec",t);return}Fi(e,r,"reactive")}function Yo(e){if(_i(e)||!(e instanceof HTMLVideoElement))return;let t=Cn(e);if(Bt.has(e)){lt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let i=Ti(e);if(i===null){lt(e,"cross_origin",t);return}let r=vi(i,n);if(r&&!r.browserHostile){lt(e,"browser_safe_codec",t);return}Fi(e,r,"tertiary")}var xe=class extends Error{constructor(n,i=null){super(i==null?n:`${n} at line ${i}`);me(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=i}},tc=[0,0,0],nc=[1,1,1],_n=64;function ic(e){let t=!1;for(let n=0;n<e.length;n++){let i=e[n];if(i==='"'&&(t=!t),i==="#"&&!t)return e.slice(0,n)}return e}function Je(e,t){let n=Number(e);if(!Number.isFinite(n))throw new xe(`Invalid number "${e}"`,t);return n}function Jo(e,t,n){if(e.length!==3)throw new xe(`${t} expects three numbers`,n);return[Je(e[0],n),Je(e[1],n),Je(e[2],n)]}function Xo(e,t,n){if(!e)throw new xe(`${t} expects a size`,n);let i=Number(e);if(!Number.isInteger(i)||i<2)throw new xe(`${t} must be an integer greater than 1`,n);return i}function rc(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new xe("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function oc(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 sc(e){return/^[+-]?(?:\d|\.\d)/.test(e)}function Qo(e,t={}){let n=t.maxSize??_n,i=null,r=tc,o=nc,a=null,c=null,s=[],l=e.replace(/^\uFEFF/,"").split(/\r?\n/);for(let p=0;p<l.length;p++){let d=p+1,x=ic(l[p]??"").trim();if(!x)continue;let S=x.split(/\s+/),y=(S[0]??"").toUpperCase(),b=S.slice(1);if(y==="TITLE"){i=oc(x);continue}if(y==="DOMAIN_MIN"){r=Jo(b,y,d);continue}if(y==="DOMAIN_MAX"){o=Jo(b,y,d);continue}if(y==="LUT_3D_INPUT_RANGE"){if(b.length!==2)throw new xe(`${y} expects two numbers`,d);let A=Je(b[0],d),_=Je(b[1],d);if(_<=A)throw new xe("LUT_3D_INPUT_RANGE max must exceed min",d);r=[A,A,A],o=[_,_,_];continue}if(y==="LUT_1D_SIZE"){a=Xo(b[0],y,d);continue}if(y==="LUT_3D_SIZE"){if(c=Xo(b[0],y,d),c>n)throw new xe(`LUT_3D_SIZE ${c} exceeds max ${n}`,d);continue}if(!sc(y)){if(y.startsWith("LUT_"))throw new xe(`Unsupported cube keyword ${y}`,d);continue}if(!c)throw a?new xe("1D cube LUTs are not supported yet",d):new xe("LUT data appears before LUT_3D_SIZE",d);if(S.length!==3)throw new xe("LUT data rows must contain three numbers",d);s.push(Je(S[0],d),Je(S[1],d),Je(S[2],d))}if(a&&c)throw new xe("Mixed 1D and 3D cube LUTs are not supported yet");if(!c)throw a?new xe("1D cube LUTs are not supported yet"):new xe("Missing LUT_3D_SIZE");rc(r,o);let f=c*c*c;if(s.length!==f*3)throw new xe(`Expected ${f} LUT rows for size ${c}, found ${s.length/3}`);return{title:i,size:c,domainMin:r,domainMax:o,data:new Float32Array(s)}}function ac(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function Mi(e){return Math.round(ac(e)*255)}function Zo(e){let t=e.size,n=t*t,i=t,r=new Uint8Array(n*i*4);for(let o=0;o<t;o++)for(let a=0;a<t;a++)for(let c=0;c<t;c++){let s=((o*t+a)*t+c)*3,l=(a*n+o*t+c)*4;r[l]=Mi(e.data[s]??0),r[l+1]=Mi(e.data[s+1]??0),r[l+2]=Mi(e.data[s+2]??0),r[l+3]=255}return{width:n,height:i,data:r}}var es="rec709";var ts=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"],ns=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],is=["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 Ve="data-color-grading",Gt="data-hf-color-grading-source-hidden",Tn="data-hf-authored-opacity",ss="__hf_color_grading_",lc=es,Ri={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},Li={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},ki={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 as=ts,uc=ns,cc=is,rs={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},os={vignette:.18};function be(e,t,n={},i={},r={},o=1){return{id:e,label:t,intensity:o,adjust:{...Ri,...n},details:{...Li,...i},effects:{...ki,...r}}}var Ii=[be("neutral","Neutral"),be("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),be("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),be("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),be("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),be("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),be("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),be("vintage-wash","Vintage Wash",rs,os),be("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),be("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),be("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),be("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),be("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),be("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),be("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}),be("home-movie-8mm","8mm Home Movie",rs,{...os,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),be("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),be("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],dc=new Map(Ii.map(e=>[e.id,e])),fc=/^\$(?:\{([A-Za-z0-9_.:-]+)\}|([A-Za-z0-9_.:-]+))$/,mc={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}},pc={vignette:{min:0,max:1},vignetteMidpoint:{min:0,max:1},vignetteRoundness:{min:-1,max:1},vignetteFeather:{min:0,max:1},grain:{min:0,max:1},grainSize:{min:0,max:1},grainRoughness:{min:0,max:1}},hc={min:0,max:1},gc={asciiStyle:{min:0,max:7},bloom:{min:0,max:3},bloomRadius:{min:1,max:100},monoScreenShape:{min:0,max:4}},ls=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"],xc=Ii.filter(e=>ls.some(t=>e.effects[t]>1e-4)),c0=Ii.filter(e=>!xc.includes(e)),d0={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}};var bc=/^#[0-9a-f]{6}$/i;function yc(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&bc.test(t))?null:e.map(t=>t.toLowerCase())}function ut(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Sc(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function us(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function Ni(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Sc(n,t.min,t.max):0}function Ec(e){if(e==null)return null;let t=String(e).trim();return t||null}function Ac(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!ut(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:us(e.intensity,1)}}function wc(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return ut(n)?n:null}catch{return null}return{preset:t}}return ut(e)?e:null}function Cc(e,t){let n=e.trim().match(fc);if(!n)return e;let i=n[1]??n[2]??"";return i&&Object.hasOwn(t,i)?t[i]:e}function Di(e,t){if(typeof e=="string"){let i=Cc(e,t);if(i!==e)return i;let r=e.trim();if(!r.startsWith("{"))return e;try{return Di(JSON.parse(r),t)}catch{return e}}if(!ut(e))return e;let n={};for(let[i,r]of Object.entries(e))n[i]=Di(r,t);return n}function _c(e){return e?dc.get(e)??null:null}function Pi(e){let t=wc(e);if(!t||t.enabled===!1)return null;let n=Ec(t.preset),i=_c(n),r=i?.adjust??Ri,o=i?.details??Li,a=i?.effects??ki,c=ut(t.adjust)?t.adjust:{},s=ut(t.details)?t.details:{},l=ut(t.effects)?t.effects:{},f=as.reduce((x,S)=>(x[S]=Ni(c[S]??r[S],mc[S]),x),{...Ri}),p=uc.reduce((x,S)=>(x[S]=Ni(s[S]??o[S],pc[S]),x),{...Li}),d=cc.reduce((x,S)=>(x[S]=Ni(l[S]??a[S],gc[S]??hc),x),{...ki});return{enabled:!0,preset:n,intensity:us(t.intensity,i?.intensity??1),adjust:f,details:p,effects:d,palette:yc(t.palette),lut:Ac(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():lc}}function cs(e,t){return Pi(Di(e,t))}function Ht(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||ls.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:as.some(n=>Math.abs(e.adjust[n])>1e-4):!1}var Tc=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),vc=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function ds(e){let t=!1,n=null,i=null,r=null,o=null;function a(w,C){try{window.dispatchEvent(new CustomEvent(w,{detail:C}))}catch(T){v("runtime.picker.site1",T)}}function c(w){r=w,a("hyperframe:picker:hovered",{elementInfo:r,isPickMode:t,timestamp:Date.now()})}function s(w){o=w,a("hyperframe:picker:selected",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function l(w){let C=w.ownerDocument.defaultView;if(!C)return!1;let T=w;for(;T&&T!==document.body&&T!==document.documentElement;){let R=C.getComputedStyle(T);if(R.display==="none"||R.visibility==="hidden"||R.pointerEvents==="none")return!0;let L=Number.parseFloat(R.opacity);if(Number.isFinite(L)&&L<=.01&&!T.hasAttribute(Gt))return!0;T=T.parentElement}return!1}function f(w){if(!w||w===document.body||w===document.documentElement)return!1;let C=w.tagName.toLowerCase();return!(C==="script"||C==="style"||C==="link"||C==="meta"||w.classList.contains("__hf-pick-highlight")||w.closest(Tc)||l(w))}function p(w){return!!w?.closest(vc)}function d(w){let C=w;if(C.id)return`#${CSS.escape(C.id)}`;let T=w.getAttribute("data-composition-id");if(T)return`[data-composition-id="${CSS.escape(T)}"]`;let R=w.getAttribute("data-composition-src");if(R)return`[data-composition-src="${CSS.escape(R)}"]`;let L=w.getAttribute("data-track-index");if(L)return`[data-track-index="${CSS.escape(L)}"]`;let z=w.tagName.toLowerCase(),P=w.parentElement;if(!P)return z;let X=P.querySelectorAll(`:scope > ${z}`);if(X.length===1)return z;for(let I=0;I<X.length;I+=1)if(X[I]===w)return`${z}:nth-of-type(${I+1})`;return z}function x(w){let C=w.tagName.toLowerCase(),T=(w.textContent??"").trim().replace(/\s+/g," "),R=(L,z)=>L.length>z?`${L.slice(0,z-1)}\u2026`:L;return C==="h1"||C==="h2"||C==="h3"?"Heading":C==="p"||C==="span"||C==="div"?T.length>0?R(T,56):"Text":C==="img"?"Image":C==="video"?"Video":C==="audio"?"Audio":C==="svg"?"Shape":w.getAttribute("data-composition-src")?"Composition":C==="section"?"Section":`${C.charAt(0).toUpperCase()}${C.slice(1)}`}function S(w,C,T){let R=typeof T=="number"&&T>0?T:8,L=[];if(document.elementsFromPoint)L=document.elementsFromPoint(w,C);else if(document.elementFromPoint){let X=document.elementFromPoint(w,C);L=X?[X]:[]}if(p(L[0]??null))return[];let z={},P=[];for(let[X,I]of L.entries()){if(!f(I))continue;let ie=`${I.tagName}::${I.id||""}::${X}`;if(!z[ie]&&(z[ie]=!0,P.push(I),P.length>=R))break}return P}function y(w){let C=w.getBoundingClientRect(),T={};for(let L of Array.from(w.attributes))L.name.startsWith("data-")&&(T[L.name]=L.value);return{id:w.id||null,tagName:w.tagName.toLowerCase(),selector:d(w),label:x(w),boundingBox:{x:C.left,y:C.top,width:C.width,height:C.height},textContent:w.textContent?w.textContent.trim().slice(0,200):null,src:w.getAttribute("src")||w.getAttribute("data-composition-src")||null,dataAttributes:T}}function b(w,C,T){return S(w,C,T).map(y)}function A(w){if(!t)return;let T=S(w.clientX,w.clientY,1)[0]??(w.target instanceof Element?w.target:null);if(!f(T)||n===T)return;n&&n.classList.remove("__hf-pick-highlight"),n=T,T.classList.add("__hf-pick-highlight");let R=y(T);c(R),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:R})}function _(w){if(!t)return;w.preventDefault(),w.stopPropagation(),w.stopImmediatePropagation();let C=b(w.clientX,w.clientY,8);C.length!==0&&(c(C[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:C,selectedIndex:0,point:{x:w.clientX,y:w.clientY}}))}function M(w){w.key==="Escape"&&(D(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function H(){t||(t=!0,i=document.createElement("style"),i.textContent=[".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",".__hf-pick-active * { cursor: crosshair !important; }"].join(`
|
|
40
|
-
`),document.head.appendChild(i),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",A,!0),document.addEventListener("click",_,!0),document.addEventListener("keydown",M,!0),a("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function D(){t&&(t=!1,n&&(n.classList.remove("__hf-pick-highlight"),n=null),i&&(i.remove(),i=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",A,!0),document.removeEventListener("click",_,!0),document.removeEventListener("keydown",M,!0),a("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function F(){window.__HF_PICKER_API={enable:H,disable:D,isActive:()=>t,getHovered:()=>r,getSelected:()=>o,getCandidatesAtPoint:(w,C,T)=>Number.isFinite(w)&&Number.isFinite(C)?b(w,C,T):[],pickAtPoint:(w,C,T)=>{if(!Number.isFinite(w)||!Number.isFinite(C))return null;let R=b(w,C,8);if(!R.length)return null;let L=Math.max(0,Math.min(R.length-1,Number(T??0))),z=R[L]??null;return z?(s(z),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:z}),D(),z):null},pickManyAtPoint:(w,C,T)=>{if(!Number.isFinite(w)||!Number.isFinite(C))return[];let R=b(w,C,8);if(!R.length)return[];let L=[],z=Array.isArray(T)?T:[0];for(let P of z){let X=Math.max(0,Math.min(R.length-1,Math.floor(Number(P)))),I=R[X];if(!I)continue;L.some(Te=>Te.selector===I.selector&&Te.tagName===I.tagName)||L.push(I)}return L.length?(s(L[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:L}),D(),L):[]}},a("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:H,disablePickMode:D,installPickerApi:F}}var Fc=["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 xt(e,t){let n=Number.isFinite(t)&&t>0?t:30,i=Number.isFinite(e)&&e>0?e:0;return Math.floor(i*n+1e-9)/n}function fs(e,t,n=Fc){for(let i of n){let r=t.getPropertyValue(i);r&&e.setProperty(i,r)}}function Ut(e,t,n){let i=e?.[t];return typeof i=="function"?Number(i.call(e))||n:typeof i=="number"&&Number.isFinite(i)?i:(i!=null&&v("runtime.player.nonConformantNum",{prop:t,actual:typeof i}),n)}function Le(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&v("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function Wt(e,t,n){if(e){for(let i of Object.values(e))if(!(!i||i===t))try{n(i)}catch(r){v("runtime.player.site1",r)}}}function ms(e,t,n,i){let r=xt(t,n),o=i?.suppressEvents===!0;return Le(e,"pause"),typeof e.totalTime=="function"?e.totalTime(r,o):typeof e.seek=="function"&&e.seek(r,o),r}function Mc(e,t,n,i,r){let o=[];Wt(e,t,a=>{Le(a,"play"),o.push(a)});try{return ms(t,n,i,r)}finally{for(let a of o)try{Le(a,"pause")}catch(c){v("runtime.player.site2",c)}}}function Nc(e,t){Wt(e,t,n=>{Le(n,"play")})}function ps(e){let t=e.transport;return t?{_timeline:null,play:()=>t.play(),pause:()=>t.pause(),seek:(n,i)=>t.seek(n,i),renderSeek:(n,i)=>t.renderSeek(n,i),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 i=Math.max(0,Number(e.getSafeDuration?.()??Ut(n,"duration",0))||0);i>0&&Math.max(0,Ut(n,"time",0))>=i&&(Le(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()),Le(n,"play"),Wt(e.getTimelineRegistry?.(),n,r=>{typeof r.timeScale=="function"&&r.timeScale(e.getPlaybackRate()),Le(r,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;Le(n,"pause"),Wt(e.getTimelineRegistry?.(),n,r=>{Le(r,"pause")});let i=Math.max(0,Ut(n,"time",0));e.onDeterministicSeek(i),e.onDeterministicPause(),e.setIsPlaying(!1),e.onSyncMedia(i,!1),e.onRenderFrameSeek(i),e.onStatePost(!0)},seek:(n,i)=>{let r=e.getTimeline();if(!r)return;let o=Math.max(0,Number(n)||0),a=e.getIsPlaying(),c=Mc(e.getTimelineRegistry?.(),r,o,e.getCanonicalFps());e.onDeterministicSeek(c),i?.keepPlaying&&a?(typeof r.timeScale=="function"&&r.timeScale(e.getPlaybackRate()),Le(r,"play"),Wt(e.getTimelineRegistry?.(),r,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),Le(s,"play")}),e.onDeterministicPlay(),e.onShowNativeVideos(),e.onSyncMedia(c,!0)):(e.setIsPlaying(!1),e.onSyncMedia(c,!1)),e.onRenderFrameSeek(c),e.onStatePost(!0)},renderSeek:(n,i)=>{let r=e.getTimeline(),o=e.getCanonicalFps(),a=r?(Nc(e.getTimelineRegistry?.(),r),ms(r,n,o,i)):xt(Math.max(0,Number(n)||0),o);e.onDeterministicSeek(a,i),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>Ut(e.getTimeline(),"time",0),getDuration:()=>Ut(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function hs(){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 Rc=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function Bi(e){return e.id||e.getAttribute("data-hf-id")||null}function Oi(e){if(e==null)return null;let t=Number(e);return Number.isFinite(t)?t:null}function Lc(e,t){let n=e.getAttribute("data-composition-id");if(!n)return null;let i=Number(t[n]?.duration?.());return Number.isFinite(i)&&i>0?i:null}function kc(e){if(!(e instanceof HTMLMediaElement)||!Number.isFinite(e.duration))return null;let t=Oi(e.getAttribute("data-playback-start"))??Oi(e.getAttribute("data-media-start"))??0;return e.duration>t?e.duration-t:null}function Dc(e,t,n,i){let r=Oi(e.getAttribute("data-duration"));return r!=null&&r>0?r:Lc(e,t)??kc(e)??Math.max(0,n-i)}function Ic(e){for(let[t,n]of e){let i=t.parentElement;for(;i;){let r=e.get(i);if(r){n.parentId=r.id,r.children.push(n);break}i=i.parentElement}}}function gs(e){let{startResolver:t,timelineRegistry:n,rootDuration:i}=e,r=new Map,o=document.querySelector("[data-composition-id]"),a=0;for(let c of document.querySelectorAll("[data-start]")){if(c===o||Rc.has(c.tagName))continue;let s=t.resolveStartForElement(c,0);if(Dc(c,n,i,s)<=0)continue;let l={id:Bi(c)??`__clip-${a++}`,element:c,parentId:null,children:[]};r.set(c,l)}return Ic(r),{roots:Array.from(r.values()).filter(c=>c.parentId===null)}}var Gi="css:root",xs=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],Pc=new Set([...xs,"contain","isolation","mask-border","mix-blend-mode","opacity"]),Oc=new Set(["absolute","relative"]),Bc=new Set(["flex","inline-flex","grid","inline-grid"]),Gc=new Set(["layout","paint","strict","content"]),Hc=new Set(["size","inline-size"]);function Uc(e){return e.position==="fixed"||e.position==="sticky"}function Wc(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(Oc.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&Bc.has(n)}function Vc(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:xs.some(i=>{let r=e.getPropertyValue(i);return r!==""&&r!=="none"})}function zc(e){return e.getPropertyValue("contain").split(/\s+/).some(n=>Gc.has(n))?!0:Hc.has(e.getPropertyValue("container-type"))}function jc(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>Pc.has(t))}function $c(e,t){return Uc(t)||Wc(e,t)||Vc(t)||zc(t)?!0:jc(t)}function qc(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 vn(e){let t=e.ownerDocument.defaultView;if(!t)return Gi;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if($c(n,t.getComputedStyle(n)))return qc(n)}catch{return Gi}n=n.parentElement}return Gi}var bt=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),w0=Object.freeze([bt.start,bt.duration,bt.trackIndex]),C0=Object.freeze([bt.derivedEnd]),_0=Object.freeze([bt.derivedEnd,bt.legacyTrack]);function ze(e){if(e==null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}var ys=/^[A-Za-z0-9_.:-]+$/;function Ss(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function bs(e,t){let n=t;for(;n>=0&&Ss(e,n);)n--;return n}function Kc(e,t){let n=t;for(;n>=0&&(e[n]??"").trim()==="";)n--;return n}function Yc(e){let t=e.length-1;if(!Ss(e,t))return null;let n=bs(e,t);return e[n]==="."&&(n=bs(e,n-1)),n+1}function Jc(e){let t=Yc(e);if(t==null)return null;let n=Kc(e,t-1),i=e[n];if(i!=="+"&&i!=="-")return null;let r=e.slice(0,n).trim();if(!ys.test(r))return null;let o=Number(e.slice(t));return Number.isFinite(o)?{refId:r,operator:i,magnitude:o}:null}function Hi(e){let t=(e??"").trim();if(!t)return null;let n=ze(t);if(n!=null)return{kind:"absolute",value:n};if(ys.test(t))return{kind:"reference",refId:t,offset:0};let i=Jc(t);return i?{kind:"reference",refId:i.refId,offset:i.operator==="-"?-i.magnitude:i.magnitude}:null}var Xc="data-hf-authored-duration",Qc="data-hf-authored-end";function Zc(e){return ze(e.getAttribute("data-duration"))}function ed(e){return ze(e.getAttribute("data-end"))}function td(e){return ze(e.getAttribute(Xc))}function nd(e){return ze(e.getAttribute(Qc))}function Xe(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,i=e.documentRef??document,r=new WeakMap,o=new WeakMap,a=new Set,c=d=>{let x=i.getElementById(d);return x||(i.querySelector(`[data-composition-id="${CSS.escape(d)}"]`)??null)},s=d=>{let x=d.ownerDocument.defaultView?.HTMLMediaElement;return x?d instanceof x:typeof HTMLMediaElement<"u"&&d instanceof HTMLMediaElement},l=d=>{let x=o.get(d);if(x!==void 0)return x;let S=null,y=Zc(d)??(n?td(d):null);if(y!=null&&y>0&&(S=y),S==null||S<=0){let b=ed(d)??(n?nd(d):null);if(b!=null){let A=p(d,0),_=b-A;Number.isFinite(_)&&_>0&&(S=_)}}if((S==null||S<=0)&&s(d)){let b=ze(d.getAttribute("data-playback-start"))??ze(d.getAttribute("data-media-start"))??0;Number.isFinite(d.duration)&&d.duration>b&&(S=(d.duration-b)/Be(d))}if(S==null||S<=0){let b=d.getAttribute("data-composition-id");if(b){let A=t[b]??null;if(A&&typeof A.duration=="function")try{let _=Number(A.duration());Number.isFinite(_)&&_>0&&(S=_)}catch(_){v("runtime.startResolver.site1",_)}}}return S!=null&&Number.isFinite(S)&&S>0?(o.set(d,S),S):(o.set(d,null),null)},f=(d,x)=>{if(d.hasAttribute("data-composition-id")){let y=d.parentElement?.closest("[data-composition-id]");return y?p(y,x):0}let S=d.closest("[data-composition-id]");return S?p(S,x):0},p=(d,x)=>{let S=r.get(d);if(S!==void 0)return S??x;if(a.has(d))return x;a.add(d);try{let y=Hi(d.getAttribute("data-start"));if(!y){if(d.hasAttribute("data-composition-id")){let H=d.parentElement;if(H&&(H.hasAttribute("data-composition-src")||H.hasAttribute("data-composition-id")||H.hasAttribute("data-composition-file"))){let D=p(H,x);return r.set(d,D),D}}return r.set(d,x),x}if(y.kind==="absolute"){let H=Math.max(0,y.value),D=Math.max(0,f(d,x)+H);return r.set(d,D),D}let b=c(y.refId);if(!b)return r.set(d,x),x;let A=p(b,0),_=l(b);if(_==null||_<=0){let H=Math.max(0,A+y.offset);return r.set(d,H),H}let M=Math.max(0,A+_+y.offset);return r.set(d,M),M}finally{a.delete(d)}};return{resolveStartForElement:(d,x=0)=>p(d,Math.max(0,x)),resolveDurationForElement:d=>l(d)}}function Ui(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}var rd="data-hf-authored-duration",od="data-hf-authored-end";function Ee(e){if(e==null||e==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}function Wi(e){return Ee(e.getAttribute("data-duration"))??Ee(e.getAttribute(rd))}function Es(e){return Ee(e.getAttribute("data-end"))??Ee(e.getAttribute(od))}function Vi(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 zi(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function ji(e,t){let n=e.getAttribute("data-track-index")??e.getAttribute("data-track");if(n==null)return t;let i=Number.parseInt(n,10);return Number.isFinite(i)?i:t}function zt(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 As(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return zt(t);let n=e.getAttribute("data-composition-src");if(n)return zt(n);let i=e.querySelector("img[src], video[src], audio[src], source[src]");return i?zt(i.getAttribute("src")):null}function sd(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 ad(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 ld(e){let t=e.textContent?.replace(/\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function Vt(e){let t=e.replace(/\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return t?t.replace(/\b\w/g,n=>n.toUpperCase()):e}function ud(e,t,n){let i=e.getAttribute("data-timeline-label")??e.getAttribute("data-label")??e.getAttribute("aria-label")??null;if(i?.trim())return i.trim();let r=e.getAttribute("data-composition-id");if(r)return Vt(r);let o=e.id;if(o)return Vt(o);let a=sd(e);if(a)return Vt(a);let c=ad(As(e));if(c)return Vt(c);let s=ld(e);return s||`${Vt(t)} ${n+1}`}function ws(e){let n=window.__timelines??{},i=Xe({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),r=U=>{if(!U)return null;let k=n[U]??null;if(!k||typeof k.duration!="function")return null;try{let G=Number(k.duration());return Number.isFinite(G)&&G>0?G:null}catch{return null}},o=U=>{let k=Ee(U.getAttribute("data-duration"));if(k!=null&&k>0)return k;let G=Ee(U.getAttribute("data-playback-start"))??Ee(U.getAttribute("data-media-start"))??0;return Number.isFinite(U.duration)&&U.duration>G?Math.max(0,(U.duration-G)/Be(U)):null},a=()=>{let U=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(U.length===0)return null;let k=0;for(let G of U){let ae=G.hasAttribute("data-hf-auto-start")?i.resolveStartForElement(G,0):Math.max(0,Number(G.getAttribute("data-start")??0)||0);if(!Number.isFinite(ae))continue;let oe=o(G);oe==null||oe<=0||(k=Math.max(k,Math.max(0,ae)+oe))}return k>0?k:null},c=(U,k)=>{let G=[],ae=null,oe=null,W=null,q=U.parentElement;for(;q;){let $=q.getAttribute("data-composition-id");$&&(G.push($),!W&&q!==k&&(W=$),ae==null&&(ae=i.resolveStartForElement(q,0)),oe==null&&(oe=Ee(q.getAttribute("data-duration"))??r($)??null)),q=q.parentElement}return{parentCompositionId:W,compositionAncestors:G.reverse(),inheritedStart:ae,inheritedDuration:oe}},s=document.querySelector("[data-composition-id]"),l=Array.from(document.querySelectorAll("[data-composition-id]")),f=s?.getAttribute("data-composition-id")??null,p=s?i.resolveStartForElement(s,0):0,d=a(),x=d!=null?Math.max(0,d-Math.max(0,p)):null,S=r(f),y=Wi(s??document.body),b=zi(...l.filter(U=>U!==s).map(U=>{let k=i.resolveStartForElement(U,0),G=i.resolveDurationForElement(U)??r(U.getAttribute("data-composition-id"))??null;return!Number.isFinite(k)||G==null||G<=0?null:Math.max(0,k)+G})),A=b!=null?Math.max(0,b-Math.max(0,p)):null,_=typeof S=="number"&&Number.isFinite(S)&&S>0?S:null,M=typeof y=="number"&&Number.isFinite(y)&&y>0?y:null,H=typeof x=="number"&&Number.isFinite(x)&&x>0?x:null,D=typeof A=="number"&&Number.isFinite(A)&&A>0?A:null,F=zi(H,D),w=_!=null&&F!=null&&_>F+1,T=M??(w?F:zi(_,H,D))??null,L=(T!=null?p+T:null)??(typeof d=="number"&&Number.isFinite(d)&&d>0?d:null),z=(U,k)=>!Number.isFinite(k)||k<=0?0:L==null||!Number.isFinite(L)?k:!Number.isFinite(U)||U>=L?0:Math.max(0,Math.min(k,L-U)),P=[],X=[],I=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),ie=0;for(let[U,k]of I.entries()){if(k===s||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(k.tagName))continue;let G=c(k,s),ae=i.resolveStartForElement(k,G.inheritedStart??0),oe=k.getAttribute("data-composition-id"),W=Wi(k);if((W==null||W<=0)&&oe&&oe!==f&&(W=r(oe)),(W==null||W<=0)&&k instanceof HTMLMediaElement){let Ce=Ee(k.getAttribute("data-playback-start"))??Ee(k.getAttribute("data-media-start"))??0;Number.isFinite(k.duration)&&k.duration>0&&(W=Math.max(0,k.duration-Ce))}if(W==null||W<=0){let Ce=G.inheritedDuration;if(Ce!=null&&Ce>0){let Ue=(G.inheritedStart??0)+Ce;W=Math.max(0,Ue-ae)}}if(W==null||W<=0||(W=z(ae,W),W<=0))continue;let q=ae+W;ie=Math.max(ie,q);let $=k.tagName.toLowerCase(),we=oe&&oe!==f?"composition":$==="video"?"video":$==="audio"?"audio":$==="img"?"image":"element";P.push({id:Bi(k)??oe??null,label:ud(k,we,P.length),start:ae,duration:W,track:ji(k,U),zIndex:Vi(k),stackingContextId:vn(k),kind:we,tagName:$,compositionId:k.getAttribute("data-composition-id"),compositionAncestors:G.compositionAncestors,parentCompositionId:G.parentCompositionId,nodePath:null,compositionSrc:zt(k.getAttribute("data-composition-src")),playbackStart:gt(k),playbackRate:Be(k),assetUrl:As(k),timelineRole:k.getAttribute("data-timeline-role"),timelineLabel:k.getAttribute("data-timeline-label"),timelineGroup:k.getAttribute("data-timeline-group"),timelinePriority:Ee(k.getAttribute("data-timeline-priority"))})}let Te=new Set(P.map(U=>U.id)),j=s?.getAttribute("data-composition-id")??null,J=j?n[j]??null:null;if(J&&s){let U=J;if(typeof U.getChildren=="function")try{let k=U.getChildren(!0,!0,!1)??[],G=new Map;for(let W of s.children){let q=W;if(!q.id)continue;let $=q.tagName.toLowerCase();$==="script"||$==="style"||$==="link"||G.set(q,{id:q.id,start:1/0,end:-1/0})}let ae=W=>{let q=W;for(;q;){if(G.has(q))return q;if(q===s)return null;q=q.parentElement}return null};for(let W of k){if(typeof W.targets!="function"||typeof W.startTime!="function"||typeof W.duration!="function")continue;let q=W.startTime(),$=W.parent;for(;$&&$!==J&&typeof $.startTime=="function";)q+=$.startTime(),$=$.parent;let we=q+W.duration();if(!(!Number.isFinite(q)||!Number.isFinite(we)))for(let Ce of W.targets()){if(!(Ce instanceof Element))continue;let Ft=ae(Ce);if(!Ft)continue;let Ue=G.get(Ft);Ue&&(Ue.start=Math.min(Ue.start,q),Ue.end=Math.max(Ue.end,we))}}let oe=P.length>0?Math.max(...P.map(W=>W.track))+1:0;for(let[W,q]of G){if(q.start===1/0||q.end===-1/0)continue;let $=W;if(Te.has($.id))continue;let we=Math.max(0,q.end-q.start);if(we<=0)continue;let Ce=z(q.start,we);Ce<=0||(ie=Math.max(ie,q.start+Ce),P.push({id:$.id,label:$.getAttribute("data-timeline-label")??$.getAttribute("data-label")??$.getAttribute("aria-label")??$.id,start:q.start,duration:Ce,track:ji($,oe),zIndex:Vi($),stackingContextId:vn($),kind:"element",tagName:$.tagName.toLowerCase(),compositionId:$.getAttribute("data-composition-id"),compositionAncestors:j?[j]:[],parentCompositionId:j,nodePath:null,compositionSrc:null,playbackStart:gt($),playbackRate:Be($),assetUrl:null,timelineRole:$.getAttribute("data-timeline-role"),timelineLabel:$.getAttribute("data-timeline-label"),timelineGroup:$.getAttribute("data-timeline-group"),timelinePriority:Ee($.getAttribute("data-timeline-priority"))}),Te.add($.id))}}catch(k){v("runtime.timeline.site1",k)}}if(s&&T!=null&&T>0){let U=P.length>0?Math.max(...P.map(k=>k.track))+1:0;for(let k of s.children){let G=k;if(!G.id||Te.has(G.id))continue;let ae=G.getAttribute("data-timeline-role");if(ae!=="overlay"&&ae!=="persistent-overlay")continue;let oe=G.tagName.toLowerCase();if(oe==="script"||oe==="style"||oe==="link"||oe==="meta"||window.getComputedStyle(G).display==="none")continue;let q=z(0,T);q<=0||(ie=Math.max(ie,q),P.push({id:G.id,label:G.getAttribute("data-timeline-label")??G.getAttribute("data-label")??G.getAttribute("aria-label")??G.id,start:0,duration:q,track:ji(G,U),zIndex:Vi(G),stackingContextId:vn(G),kind:"element",tagName:oe,compositionId:G.getAttribute("data-composition-id"),compositionAncestors:j?[j]:[],parentCompositionId:j,nodePath:null,compositionSrc:null,playbackStart:gt(G),playbackRate:Be(G),assetUrl:null,timelineRole:ae,timelineLabel:G.getAttribute("data-timeline-label"),timelineGroup:G.getAttribute("data-timeline-group"),timelinePriority:Ee(G.getAttribute("data-timeline-priority"))}),Te.add(G.id))}}for(let U of l){if(U===s)continue;let k=U.getAttribute("data-composition-id");if(!k||!Ui(k))continue;let G=i.resolveStartForElement(U,0),ae=Wi(U);if((ae==null||ae<=0)&&Es(U)!=null){let $=Es(U);ae=Math.max(0,$-G)}let oe=r(k),W=ae&&ae>0?ae:oe;if(W==null||W<=0)continue;let q=z(G,W);q<=0||X.push({id:k,label:U.getAttribute("data-label")??k,start:G,duration:q,thumbnailUrl:zt(U.getAttribute("data-thumbnail-url")),avatarName:null})}let B=Math.max(1,ie||1,T??0),V=w&&M==null,Ae=V?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(B*Math.max(1,e.canonicalFps)));return{...Sn(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:V?Number.POSITIVE_INFINITY:B,durationInFrames:Ae,clips:P,scenes:X,compositionWidth:Ee(s?.getAttribute("data-width"))??1920,compositionHeight:Ee(s?.getAttribute("data-height"))??1080}}var ue=ku(Ka(),1),Ya=ue.default,Gg=ue.default.stringify,Hg=ue.default.fromJSON,Ug=ue.default.plugin,Wg=ue.default.parse,Vg=ue.default.list,zg=ue.default.document,jg=ue.default.comment,$g=ue.default.atRule,qg=ue.default.rule,Kg=ue.default.decl,Yg=ue.default.root,Jg=ue.default.CssSyntaxError,Xg=ue.default.Declaration,Qg=ue.default.Container,Zg=ue.default.Processor,ex=ue.default.Document,tx=ue.default.Comment,nx=ue.default.Warning,ix=ue.default.AtRule,rx=ue.default.Result,ox=ue.default.Input,sx=ue.default.Rule,ax=ue.default.Root,lx=ue.default.Node;var xr="data-hf-authored-id",Ja="data-hf-inner-root";function br(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yr(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Lf(e){return e&&e.replace(/[^a-zA-Z0-9_-]/g,n=>`\\${n}`).replace(/^-?\d/,n=>`\\${n}`)}function Qa(e){let t=e.trim();return t?Array.from(new Set([t,Lf(t)])).filter(Boolean):[]}function kf(e){return!!e&&/[\w-]/.test(e)}function Df(e,t,n){let i=Qa(t).sort((c,s)=>s.length-c.length);if(i.length===0)return e;let r="",o=0,a=null;for(let c=0;c<e.length;c+=1){let s=e[c],l=c>0?e[c-1]:"";if(a){r+=s,s===a&&l!=="\\"&&(a=null);continue}if(s==='"'||s==="'"){a=s,r+=s;continue}if(s==="["){o+=1,r+=s;continue}if(s==="]"){o=Math.max(0,o-1),r+=s;continue}if(s==="#"&&o===0){let f=i.find(p=>e.startsWith(p,c+1));if(f){let p=e[c+1+f.length];if(!kf(p)){r+=n,c+=f.length;continue}}}r+=s}return r}function If(e,t){let n=t?.trim();return n?Df(e,n,`[${xr}="${yr(n)}"]`):e}function Xa(e){return`${e}:not(:has([${Ja}])), ${e} > [${Ja}]`}function Pf(e,t,n,i,r,o){let a=If(e,i),c=Of(a,t,n),s=c.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return o?Xa(t):e;let l=new RegExp(`\\[\\s*data-composition-id\\s*=\\s*(["'])${br(n)}\\1\\s*\\]`,"g");if(l.test(s))return s.replace(l,"").trim()===""?Xa(t):c.replace(l,t);let f=c.match(/^\s*/)?.[0]??"",p=c.match(/\s*$/)?.[0]??"";if(r){let d=i?`[${xr}="${yr(i)}"]`:null;if(d&&s.startsWith(d)){let x=s.slice(d.length);return`${f}${t}${d}${x}${p}`}}return`${f}${t} ${s}${p}`}function Of(e,t,n){let i=br(n),r=String.raw`\[\s*data-composition-id\s*=\s*(?:"${i}"|'${i}')\s*\]`,o=String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`;return e.replace(new RegExp(`${r}(?:${o})+`,"g"),t).replace(new RegExp(`(?:${o})+${r}`,"g"),t)}var Bf=new Set(["keyframes","-webkit-keyframes","font-face"]);function Gf(e){return e?.type==="atrule"}function Hf(e){let t=e.parent;for(;t;){if(Gf(t)&&Bf.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function Uf(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function Za(e,t,n,i,r){let o=t.trim();if(!e||!o)return e;let a=n||`[data-composition-id="${yr(o)}"]`,c=Ya.parse(e);return c.walkRules(s=>{Hf(s)||Uf(s)||(s.selectors=s.selectors.map(l=>Pf(l,a,o,i,r?.compoundAuthoredRoot,r?.scopeRootSelectors)))}),c.toResult({map:!1}).css}function el(e,t,n="[HyperFrames] composition script error:",i,r=t,o){let a=JSON.stringify(t),c=JSON.stringify(r),s=JSON.stringify(n),l=br(t),f=JSON.stringify(o?.trim()||null),p=JSON.stringify(i??null),d=JSON.stringify(String.raw`\[\s*data-composition-id\s*=\s*(?:"${l}"|'${l}')\s*\]`),x=JSON.stringify(String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`),S=JSON.stringify(Qa(o?.trim()||""));return`(function(){
|
|
39
|
+
`,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(i=>{i.classList.add("__hf-flash"),setTimeout(()=>i.classList.remove("__hf-flash"),t)})}catch(r){L("bridge.flashElements.querySelector",r)}}var Yr=null;function aa(e){Yr=e}function Me(e,t){if(Yr)try{Yr({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){L("runtime.analytics.site1",n)}}function vd(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 At(e){return`--${vd(e)}`}function sa(e){let t=new Map;for(let n of e){let r=At(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 la(){if(typeof document>"u")return{};let e=new Set;document.documentElement?.hasAttribute("data-composition-variables")&&e.add(document.documentElement);for(let r of Array.from(document.querySelectorAll("[data-composition-variables]")))e.add(r);let t={};for(let r of e)Object.assign(t,Jt(r));let n=zn();return{...t,...n}}function Jt(e){if(!e)return{};let t=e.getAttribute("data-composition-variables");if(!t)return{};let n;try{n=JSON.parse(t)}catch{return{}}if(!Array.isArray(n))return{};let r={};for(let i of n){if(!i||typeof i!="object")continue;let o=i;typeof o.id!="string"||!("default"in o)||(r[o.id]=o.default)}return r}var Xr="data-hf-css-vars";function Vn(e){return"style"in e&&typeof e.style?.setProperty=="function"}function Jr(e,t){if(!Vn(e))return;let n=[];for(let[r,i]of Object.entries(t))if(typeof i=="string"&&i!==""||typeof i=="number"){let o=At(r);e.style.setProperty(o,String(i)),n.push(o)}n.length>0&&e.setAttribute(Xr,n.join(" "))}function ua(e,t,n){let r={};for(let[i,o]of Object.entries(t)){let a=At(i);((Vn(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(r[i]=o)}return r}function ca(e){if(!Vn(e))return;let t=e.getAttribute(Xr);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(Xr)}}function da(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=zn(),r=[];for(let i of t)r.push(...Ed(i,n,e.defaultView));for(let i of sa(r))console.warn(`composition variables ${i.join(", ")} collapse to the same CSS property ${At(i[0]??"")} \u2014 rename one to avoid cross-talk`)}function Ed(e,t,n){if(!Vn(e))return[];let r=Jt(e),i={};for(let[o,a]of Object.entries(r)){if(o in t)continue;let l=At(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 Jr(e,i),Object.keys(r)}function fa(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 zn(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}function ma(e){let t=[],n=u=>{if(typeof u.getAnimations!="function")return[];try{return u.getAnimations()}catch{return[]}},r=u=>e?.resolveStartSeconds?e.resolveStartSeconds(u):Number.parseFloat(u.getAttribute("data-start")??"0")||0,i=(u,c)=>{let m=null;try{m=u.effect?.getComputedTiming?.()??null}catch(x){L("runtime.adapters.css.site5",x)}if(!m)return{};let f=Number(m.endTime);return Number.isFinite(f)?{endSeconds:c+f/1e3}:{unbounded:!0}},o=(u,c)=>{for(let m of u){try{m.currentTime=c}catch(f){L("runtime.adapters.css.site1",f)}try{m.pause()}catch(f){L("runtime.adapters.css.site2",f)}}},a=u=>{for(let c of u)try{c.play()}catch(m){L("runtime.adapters.css.site3",m)}},l=u=>{for(let c of u)try{c.pause()}catch(m){L("runtime.adapters.css.site4",m)}},s=u=>{u.baseDelay?u.el.style.animationDelay=u.baseDelay:u.el.style.removeProperty("animation-delay"),u.basePlayState?u.el.style.animationPlayState=u.basePlayState:u.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{t=[];let u=document.querySelectorAll("*");for(let c of u){if(!(c instanceof HTMLElement))continue;let m=window.getComputedStyle(c);!m.animationName||m.animationName==="none"||t.push({el:c,baseDelay:c.style.animationDelay||"",basePlayState:c.style.animationPlayState||"",animations:n(c)})}},getInferredDurationSeconds:()=>{let u=0;for(let c of t){if(!c.el.isConnected)continue;let m=r(c.el);for(let f of n(c.el)){let x=i(f,m);x.endSeconds!=null&&(u=Math.max(u,x.endSeconds))}}return u>0?u:null},seek:u=>{let c=Number(u.time)||0;for(let m of t){if(!m.el.isConnected)continue;let f=r(m.el),x=Math.max(0,c-f)*1e3,v=m.animations;if(v.length>0){o(v,x);continue}m.el.style.animationPlayState="paused",m.el.style.animationDelay=`-${(x/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 pa(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 ha(){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 xa(){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(Qr(r))r.goToAndStop(t*1e3,!1);else if(Zr(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{(Qr(t)||Zr(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=Cd(r)}catch(o){L("runtime.adapters.lottie.site4",o)}i!=null&&(n=!0,t=Math.max(t,i))}return n?t:null}}}function ga(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function Cd(e){return Qr(e)?ga(e.totalFrames,e.frameRate):Zr(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:ga(e.totalFrames,e.frameRate):null}function Qr(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function Zr(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}var ei=-1;function $n(e){if(e!==ei){ei=e;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:e}}))}catch(t){L("runtime.adapters.seek-dispatch.site1",t)}}}function ba(e){ei=e;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:e}}))}catch(t){L("runtime.adapters.seek-dispatch.force",t)}}function ya(){let e=null,t=0,n=null,r=null,i=null,o=null,a=()=>{if(typeof window>"u")return null;let c=window.THREE?.DefaultLoadingManager;return!c||typeof c!="object"||typeof c.itemsLoaded!="number"||typeof c.itemsTotal!="number"?null:c},l=u=>{o||u.itemsTotal<=u.itemsLoaded||(o=new Promise(c=>{u.onLoad=function(){try{i?.call(this)}finally{o=null,u.onLoad=i??null,c()}}}))},s=u=>{n!==u&&(n=u,r=u.onStart??null,i=u.onLoad??null,u.onStart=function(c,m,f){try{r?.call(this,c,m,f)}finally{l(u)}})};return{name:"three",discover:()=>{let u=a();u&&(s(u),l(u))},seek:u=>{e=Math.max(0,Number(u.time)||0),t=e,window.__hfThreeTime=e,$n(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 Ve(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 Sa(){return Ve({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 va(){return Ve({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 Ea(){return Ve({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 Ca(){return Ve({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 _a(){return Ve({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}function Aa(){let e=null,t=0;return{name:"typegpu",discover:()=>{},seek:n=>{e=Math.max(0,Number(n.time)||0),t=e,window.__hfTypegpuTime=e,$n(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0}}}function wa(e){let t=e.nextElementSibling;if(t instanceof HTMLImageElement&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;if(e.id){let n=document.getElementById(`__render_frame_${e.id}__`);if(n instanceof HTMLImageElement&&n.complete&&n.naturalWidth>0)return n}return null}function Ta(){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=wa(n.source);if(o)return t.call(this,{...n,source:o},r,i)}return t.call(this,n,r,i)}}function Ra(){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=wa(u);c&&(l[s]=c)}return o.apply(this,l)};a.__hfVideoPatched=!0,r[i]=a}}}function La(){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=y=>{let w=Number(y.currentTime);return Number.isFinite(w)&&w>0?w:0},c=(y,w)=>w<=0?y:y>=w?Math.max(0,y-w):y,m=(y,w)=>{let T=l.get(y);if(T)return T;let N={compositionTimeMs:w,animationTimeMs:e?c(u(y),w):u(y)};return l.set(y,N),N},f=(y,w)=>{if(!a.has(y)){a.add(y);let T=()=>{a.delete(y)};try{y.addEventListener("finish",T,{once:!0}),y.addEventListener("cancel",T,{once:!0})}catch(N){L("runtime.adapters.waapi.site4",N)}}m(y,w)},x=(y,w)=>{for(let T of y)f(T,w)},v=()=>{if(n||typeof Element>"u")return;let y=Element.prototype;if(typeof y.animate!="function"||y.__hfOriginalAnimate)return;let w=y.animate;try{Object.defineProperty(y,"__hfOriginalAnimate",{value:w,configurable:!0});let T=function(...N){let D=w.apply(this,N);return f(D,t),D};y.animate=T,r=y,i=w,o=T,n=!0}catch{}},C=y=>{let w=null;try{w=y.effect?.getComputedTiming?.()??null}catch(D){L("runtime.adapters.waapi.site4",D)}if(!w)return{};let T=Number(w.endTime);return Number.isFinite(T)?{endSeconds:(l.get(y)?.compositionTimeMs??0)/1e3+T/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,v(),x(s(),t)},seek:y=>{let w=Math.max(0,(Number(y.time)||0)*1e3);t=w,(!e||a.size>0)&&x(s(),e?w:0);for(let T of a){let N=e?m(T,w):m(T,0),D=N.animationTimeMs+Math.max(0,w-N.compositionTimeMs);try{T.currentTime=D}catch(I){L("runtime.adapters.waapi.site1",I)}try{T.pause()}catch(I){L("runtime.adapters.waapi.site2",I)}}},pause:()=>{e||x(s(),t);for(let y of a)try{y.pause()}catch(w){L("runtime.adapters.waapi.site3",w)}},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(y){L("runtime.adapters.waapi.site5",y)}r=void 0,i=void 0,o=void 0,n=!1},getInferredDurationSeconds:()=>{let y=0;for(let w of s()){let T=C(w);T.endSeconds!=null&&(y=Math.max(y,T.endSeconds))}return y>0?y:null}}}function Fa(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 _d(e,t,n,r){let i=Number.parseFloat(e.dataset.start??"0")||0,o=Number.parseFloat(e.dataset.end??""),a=Number.parseFloat(e.dataset.duration??""),l=Number.isFinite(o)&&o>i?o:Number.isFinite(a)&&a>0?i+a:n,s=Number.parseFloat(e.dataset.volume??""),u=Number.isFinite(s)?Math.max(0,Math.min(1,s)):1;e.volume=u;let c=1/Math.min(60,Math.max(1,r)),m=Math.max(0,i),f=Math.min(n,l),x=[];for(let C=m;C<=f+1e-6;C+=c){let y=Math.min(f,C);t(y);let w=Number(e.volume);if(!Number.isFinite(w))continue;let T=Math.max(0,Math.min(1,w)),N=x.at(-1);if((!N||Math.abs(N.volume-T)>1e-4||y===f)&&x.push({time:Number(y.toFixed(6)),volume:Number(T.toFixed(6))}),y===f)break}return x.some(C=>Math.abs(C.volume-u)>1e-4)?x:null}function Na(e,t,n,r){if(!t||!(e instanceof HTMLAudioElement)&&!(e instanceof HTMLVideoElement)||n<=0)return;let i=l=>{try{typeof t.totalTime=="function"?t.totalTime(l,!0):typeof t.seek=="function"&&t.seek(l,!0)}catch{}},o=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,a=_d(e,i,n,60);Number.isFinite(o)&&i(o),a&&r.set(e,a)}function Ma(e){return Number.isFinite(e)&&e>0?Math.max(.1,Math.min(5,e)):1}function ze(e){let t=Number.parseFloat(e.getAttribute("data-playback-rate")??""),n=Number.isFinite(t)&&t>0?t:e instanceof HTMLMediaElement?e.defaultPlaybackRate:1;return Ma(n)}function Tt(e){let t=Number.parseFloat(e.getAttribute("data-playback-start")??e.getAttribute("data-media-start")??"");return Number.isFinite(t)&&t>=0?t:0}function ka(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 Da(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=Number.parseFloat(a.dataset.playbackStart??a.dataset.mediaStart??"0")||0,u=ze(a),c=a.loop,m=Number.isFinite(a.duration)&&a.duration>0?a.duration:null,f=e?.resolveDurationSeconds?.(a)??Number.parseFloat(a.dataset.duration??"");(!Number.isFinite(f)||f<=0)&&m!=null&&(f=Math.max(0,(m-s)/u));let x=Number.isFinite(f)&&f>0?l+f:Number.POSITIVE_INFINITY,v=Number.parseFloat(a.dataset.volume??""),C={el:a,start:l,mediaStart:s,duration:Number.isFinite(f)&&f>0?f:Number.POSITIVE_INFINITY,end:x,volume:Number.isFinite(v)?v:null,playbackRate:u,loop:c,sourceDuration:m};r.push(C),a.tagName==="VIDEO"&&i.push(C),Number.isFinite(x)&&(o=Math.max(o,x))}return{timedMediaEls:n,mediaClips:r,videoClips:i,maxMediaEnd:o}}var ti=new WeakMap,Zt=new WeakMap,ni=new WeakSet,wt=new WeakSet;function Ad(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 wd=3;function Td(e){return e.error!=null||e.networkState===wd}var ri=new WeakMap;function Qt(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function ii(e){ti.delete(e),Zt.delete(e),ni.delete(e),ri.delete(e)}function Ia(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=o&&n.sourceDuration!=null&&i>=n.mediaStart&&i<n.sourceDuration;if(e.timeSeconds>=n.start&&e.timeSeconds<n.end&&i>=0&&(!r.ended||n.loop||a||l)){if(n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let B=n.sourceDuration-n.mediaStart;B>0&&i>=n.sourceDuration&&(i=n.mediaStart+(i-n.mediaStart)%B)}let u=Qt(e.userVolume??1),c=Qt(n.volume??1),m=ri.get(r),f=Qt(r.volume),x;n.volumeKeyframes&&n.volumeKeyframes.length>0?x=Qt(Fa(n.volumeKeyframes,i)):m===void 0||Math.abs(f-m)>1e-4?x=f:x=c;let v=Qt(x*u);r.volume=v,ri.set(r,v),e.onElementVolume?.(r,v),(t||e.isWebAudioOwned?.(r))&&(r.muted=!0),r.preload!=="auto"&&(r.preload="auto");try{r.playbackRate=n.playbackRate*e.playbackRate}catch(B){L("runtime.media.site1",B)}let C=.04,y=2,w=r.currentTime||0,T=Math.abs(w-i),N=i-w,D=ti.get(r);ti.set(r,N);let I=D===void 0,_=!I&&Math.abs(N-D)>.5,b=T>3,S=a&&T>.001||r.ended&&l&&T>.001||T>.5&&(I||_||b),A=r.tagName==="VIDEO"&&!r.paused,R=D!==void 0&&Math.abs(N-D)<.004,F=!1;if(!A&&!S&&!I&&R&&T>C){let B=(Zt.get(r)??0)+1;Zt.set(r,B),B>=y&&(F=!0,Zt.set(r,0))}else T<=C&&Zt.set(r,0);let G=!A&&e.forceSync&&T>.02;if(S||F||G){if(!(r.tagName==="VIDEO"&&r.id&&!!document.getElementById(`__render_frame_${r.id}__`))){try{r.currentTime=i}catch(ne){L("runtime.media.site2",ne)}if(Math.abs(r.currentTime-i)>.5&&!ni.has(r)){ni.add(r),r.load();try{r.currentTime=i}catch(ne){L("runtime.media.site3",ne)}}}wt.delete(r)}a?r.paused||r.pause():e.playing&&r.paused&&!wt.has(r)&&!Td(r)?(Ad(r),r.play().catch(B=>{wt.delete(r),(B&&typeof B=="object"&&"name"in B?String(B.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!e.playing&&!r.paused&&r.pause();continue}ii(r),r.paused||r.pause()}}var Rd="hf-proxy",Pa="runtime_media_proxy_fallback",Oa="runtime_media_proxy_unavailable",en=new WeakSet,Ga=new WeakSet;function qn(e){return e.currentSrc||e.src}function oi(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:e instanceof HTMLVideoElement&&!!e.id&&!!document.getElementById(`__render_frame_${e.id}__`)}function ai(e){let t=qn(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 Ld(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 Fd(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 si(e,t){return t[e]??Ld(e,t)??Fd(e,t)}function Nd(e,t){let n=new URL(e,document.baseURI);return n.searchParams.set(Rd,t?t.hasAlpha?"vp8":"h264":"auto"),n.href}var Md={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 xt(e,t,n){if(Ga.has(e))return;Ga.add(e);let r=Md[t];ge({source:"hf-preview",type:"diagnostic",code:Oa,details:{asset:n,codecName:null,reason:t,note:r}}),console.info(`[hyperframes] ${Oa}: "${n}" (${t}): ${r}`)}function li(e,t=null,n="reactive"){if(en.has(e))return;let r=qn(e),i;try{i=Nd(r,t)}catch(l){L("runtime.mediaProxy.swap",l),xt(e,"invalid_source_url",r);return}en.add(e),ii(e),e.src=i,e.load();let o=t?.codecName??null;ge({source:"hf-preview",type:"diagnostic",code:Pa,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] ${Pa}: "${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 Ha(e){if(oi(e)||!(e instanceof HTMLVideoElement)||en.has(e))return;let t=window.__HF_MEDIA_CODEC_MAP__;if(!t)return;let n=ai(e);if(n===null)return;let r=si(n,t);if(!r||!r.browserHostile)return;let i=r.representativeMime?e.canPlayType(r.representativeMime):"";i==="probably"||i==="maybe"||li(e,r,"proactive")}function Ba(e){if(oi(e)||!(e instanceof HTMLVideoElement)||e.videoWidth!==0)return;let t=qn(e);if(en.has(e)){xt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=ai(e);if(r===null){xt(e,"cross_origin",t);return}let i=si(r,n);if(i&&!i.browserHostile){xt(e,"browser_safe_codec",t);return}li(e,i,"reactive")}function Ua(e){if(oi(e)||!(e instanceof HTMLVideoElement))return;let t=qn(e);if(en.has(e)){xt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=ai(e);if(r===null){xt(e,"cross_origin",t);return}let i=si(r,n);if(i&&!i.browserHostile){xt(e,"browser_safe_codec",t);return}li(e,i,"tertiary")}var Se=class extends Error{constructor(n,r=null){super(r==null?n:`${n} at line ${r}`);pe(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=r}},kd=[0,0,0],Dd=[1,1,1],jn=64;function Id(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 nt(e,t){let n=Number(e);if(!Number.isFinite(n))throw new Se(`Invalid number "${e}"`,t);return n}function Wa(e,t,n){if(e.length!==3)throw new Se(`${t} expects three numbers`,n);return[nt(e[0],n),nt(e[1],n),nt(e[2],n)]}function Va(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 Pd(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 Od(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 Gd(e){return/^[+-]?(?:\d|\.\d)/.test(e)}function za(e,t={}){let n=t.maxSize??jn,r=null,i=kd,o=Dd,a=null,l=null,s=[],u=e.replace(/^\uFEFF/,"").split(/\r?\n/);for(let m=0;m<u.length;m++){let f=m+1,x=Id(u[m]??"").trim();if(!x)continue;let v=x.split(/\s+/),C=(v[0]??"").toUpperCase(),y=v.slice(1);if(C==="TITLE"){r=Od(x);continue}if(C==="DOMAIN_MIN"){i=Wa(y,C,f);continue}if(C==="DOMAIN_MAX"){o=Wa(y,C,f);continue}if(C==="LUT_3D_INPUT_RANGE"){if(y.length!==2)throw new Se(`${C} expects two numbers`,f);let w=nt(y[0],f),T=nt(y[1],f);if(T<=w)throw new Se("LUT_3D_INPUT_RANGE max must exceed min",f);i=[w,w,w],o=[T,T,T];continue}if(C==="LUT_1D_SIZE"){a=Va(y[0],C,f);continue}if(C==="LUT_3D_SIZE"){if(l=Va(y[0],C,f),l>n)throw new Se(`LUT_3D_SIZE ${l} exceeds max ${n}`,f);continue}if(!Gd(C)){if(C.startsWith("LUT_"))throw new Se(`Unsupported cube keyword ${C}`,f);continue}if(!l)throw a?new Se("1D cube LUTs are not supported yet",f):new Se("LUT data appears before LUT_3D_SIZE",f);if(v.length!==3)throw new Se("LUT data rows must contain three numbers",f);s.push(nt(v[0],f),nt(v[1],f),nt(v[2],f))}if(a&&l)throw new Se("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw a?new Se("1D cube LUTs are not supported yet"):new Se("Missing LUT_3D_SIZE");Pd(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 Hd(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function tn(e){return Math.round(Hd(e)*255)}function ui(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]=tn(e.data[s]??0),i[u+1]=tn(e.data[s+1]??0),i[u+2]=tn(e.data[s+2]??0),i[u+3]=255}return{width:n,height:r,data:i}}var $a="rec709";var ce={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 qa=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"],ja=["shadows","midtones","highlights"],Ka=["master","red","green","blue"],Ya=["hueVsHue","hueVsSaturation","hueVsLuma"];var Xa=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],Ja=["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 Px=ce.unit,Ox=ce.signedUnit,Gx=ce.effects;var $e=1024,nn=16;function Qa(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 ve(e,t){let n=e[t];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function Bd(e){let t=[],n=[],r=ve(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=ve(n,0);if(e.length===2)return[i,i];let o=new Array(e.length);o[0]=Qa(ve(t,0),ve(t,1),i,ve(n,1)),o[o.length-1]=Qa(ve(t,t.length-1),ve(t,t.length-2),ve(n,n.length-1),ve(n,n.length-2));for(let a=1;a<e.length-1;a+=1){let l=ve(n,a-1),s=ve(n,a);if(l===0||s===0||Math.sign(l)!==Math.sign(s)){o[a]=0;continue}let u=ve(t,a-1),c=ve(t,a),m=2*c+u,f=c+2*u;o[a]=(m+f)/(m/l+f/s)}return o}function Za(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 Ud(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 Wd(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 es(e,t,n,r,i){Ud(e,r,i);let o=Bd(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>ve(e,l+1)[0];)l+=1;let c=ve(e,l),m=ve(e,l+1),f=Wd(u,c,m,ve(o,l),ve(o,l+1));a[s]=Math.min(i,Math.max(r,f))}return a}function Rt(e,t=$e){if(Za(e,t),e.length>nn)throw new RangeError(`A color curve supports at most ${nn} 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 es(e,t,n=>n/(t-1),0,1)}function di(e,t,n,r=$e){if(e.length<3)throw new RangeError("A hue curve requires at least three points");if(e.length>nn)throw new RangeError(`A hue curve supports at most ${nn} 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 Za(l,r),es(l,r,s=>s/r*360,t,n)}var rn="data-color-grading",on="data-hf-color-grading-source-hidden",Xn="data-hf-authored-opacity",os="__hf_color_grading_",zd=$a,pi={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},hi={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},gi={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 Jn=qa,as=ja,ss=Ka,ls=Ya,bi=Xa,yi=Ja,ts={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},ns={vignette:.18};function Ee(e,t,n={},r={},i={},o=1){return{id:e,label:t,intensity:o,adjust:{...pi,...n},details:{...hi,...r},effects:{...gi,...i}}}var Si=[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",ts,ns),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",ts,{...ns,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})],$d=new Map(Si.map(e=>[e.id,e])),qd=/^\$(?:\{([A-Za-z0-9_.:-]+)\}|([A-Za-z0-9_.:-]+))$/,jd={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}},Lt={hue:0,amount:0,level:0},rs={amount:ce.unit,level:ce.signedUnit},rt=[[0,0],[1,1]],Ft=[],Kd={hueVsHue:ce.secondaryHueShift,hueVsSaturation:ce.signedUnit,hueVsLuma:ce.signedUnit},fi={center:0,range:180,softness:0},mi={min:0,max:1,softness:.05},Yd={vignette:ce.unit,vignetteMidpoint:ce.unit,vignetteRoundness:ce.signedUnit,vignetteFeather:ce.unit,grain:ce.unit,grainSize:ce.unit,grainRoughness:ce.unit},xi=ce.unit,Xd=ce.effects,us=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"];var Jd=Si.filter(e=>us.some(t=>e.effects[t]>1e-4)),qx=Si.filter(e=>!Jd.includes(e)),jx={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}},cs=[{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 Qd=/^#[0-9a-f]{6}$/i;function Zd(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&Qd.test(t))?null:e.map(t=>t.toLowerCase())}function Ae(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Yn(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function ds(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)?Yn(n,t.min,t.max):0}function vi(e,t=0){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?(n%360+360)%360:t}function ef(e){let t=Ae(e)?e:{};return as.reduce((n,r)=>{let i=Ae(t[r])?t[r]:{};return n[r]={hue:vi(i.hue,Lt.hue),amount:Re(i.amount??Lt.amount,rs.amount),level:Re(i.level??Lt.level,rs.level)},n},{shadows:{...Lt},midtones:{...Lt},highlights:{...Lt}})}function tf(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)?[Yn(t,0,1),Yn(n,0,1)]:null}function fs(e){return e.some((t,n)=>n>0&&t[0]===e[n-1]?.[0])}function nf(e){(e[0]?.[0]??0)>0&&e.unshift([0,0]),(e.at(-1)?.[0]??1)<1&&e.push([1,1])}function rf(e){if(!Array.isArray(e)||e.length<2)return rt;let t=[];for(let n of e){let r=tf(n);if(!r)return rt;t.push(r)}return t.sort((n,r)=>n[0]-r[0]),fs(t)||(nf(t),t.length>16)?rt:t}function of(e){let t=Ae(e)?e:{};return ss.reduce((n,r)=>(n[r]=rf(t[r]),n),{master:rt,red:rt,green:rt,blue:rt})}function af(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)?[vi(n),Yn(r,t.min,t.max)]:null}function sf(e,t){if(!Array.isArray(e)||e.length<3||e.length>16)return Ft;let n=[];for(let r of e){let i=af(r,t);if(!i)return Ft;n.push(i)}return n.sort((r,i)=>r[0]-i[0]),fs(n)?Ft:n}function lf(e){let t=Ae(e)?e:{};return ls.reduce((n,r)=>(n[r]=sf(t[r],Kd[r]),n),{hueVsHue:Ft,hueVsSaturation:Ft,hueVsLuma:Ft})}function is(e){let t=Ae(e)?e:{},n=Re(t.min??mi.min,xi),r=Re(t.max??mi.max,xi);return{min:Math.min(n,r),max:Math.max(n,r),softness:Re(t.softness??mi.softness,ce.secondarySoftRangeSoftness)}}function uf(e){let t=Ae(e)?e:{},n=Re(t.range??fi.range,ce.secondaryHueRange);return{center:vi(t.center,fi.center),range:n,softness:Re(t.softness??fi.softness,{min:ce.secondaryHueSoftness.min,max:ce.secondaryHueCombinedMax-n})}}function cf(e){return{hueShift:Re(e.hueShift??0,ce.secondaryHueShift),saturation:Re(e.saturation??0,ce.signedUnit),luma:Re(e.luma??0,ce.signedUnit),temperature:Re(e.temperature??0,ce.signedUnit),tint:Re(e.tint??0,ce.signedUnit)}}function df(e){return!Ae(e)||!Ae(e.key)||!Ae(e.correction)?null:{enabled:e.enabled!==!1,key:{hue:uf(e.key.hue),saturation:is(e.key.saturation),luma:is(e.key.luma)},correction:cf(e.correction)}}function ff(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,4)){let r=df(n);r&&t.push(r)}return t}function mf(e){if(e==null)return null;let t=String(e).trim();return t||null}function pf(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!Ae(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:ds(e.intensity,1)}}function hf(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return Ae(n)?n:null}catch{return null}return{preset:t}}return Ae(e)?e:null}function gf(e,t){let n=e.trim().match(qd);if(!n)return e;let r=n[1]??n[2]??"";return r&&Object.hasOwn(t,r)?t[r]:e}function Kn(e,t){if(typeof e=="string"){let r=gf(e,t);if(r!==e)return r;let i=e.trim();if(!i.startsWith("{"))return e;try{return Kn(JSON.parse(i),t)}catch{return e}}if(Array.isArray(e))return e.map(r=>Kn(r,t));if(!Ae(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=Kn(i,t);return n}function xf(e){return e?$d.get(e)??null:null}function Qn(e){let t=hf(e);if(!t||t.enabled===!1)return null;let n=mf(t.preset),r=xf(n),i=r?.adjust??pi,o=r?.details??hi,a=r?.effects??gi,l=Ae(t.adjust)?t.adjust:{},s=Ae(t.details)?t.details:{},u=Ae(t.effects)?t.effects:{},c=Jn.reduce((x,v)=>(x[v]=Re(l[v]??i[v],jd[v]),x),{...pi}),m=bi.reduce((x,v)=>(x[v]=Re(s[v]??o[v],Yd[v]),x),{...hi}),f=yi.reduce((x,v)=>(x[v]=Re(u[v]??a[v],Xd[v]??xi),x),{...gi});return{enabled:!0,preset:n,intensity:ds(t.intensity,r?.intensity??1),adjust:c,wheels:ef(t.wheels),curves:of(t.curves),hueCurves:lf(t.hueCurves),secondaries:ff(t.secondaries),details:m,effects:f,palette:Zd(t.palette),lut:pf(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():zd}}function ms(e,t){return Qn(Kn(e,t))}function bf(e){return as.some(t=>Math.abs(e[t].amount)>1e-4||Math.abs(e[t].level)>1e-4)}function Ei(e){return ss.some(t=>e[t].some(([n,r])=>Math.abs(n-r)>1e-4))}function Ci(e){return ls.some(t=>e[t].some(([,n])=>Math.abs(n)>1e-4))}function _i(e){return e.some(t=>t.enabled&&Object.values(t.correction).some(n=>Math.abs(n)>1e-4))}function ps(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||us.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:Jn.some(n=>Math.abs(e.adjust[n])>1e-4)||(e.wheels?bf(e.wheels):!1)||(e.curves?Ei(e.curves):!1)||(e.hueCurves?Ci(e.hueCurves):!1)||(e.secondaries?_i(e.secondaries):!1):!1}var yf=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),Sf=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function hs(e){let t=!1,n=null,r=null,i=null,o=null;function a(b,S){try{window.dispatchEvent(new CustomEvent(b,{detail:S}))}catch(A){L("runtime.picker.site1",A)}}function l(b){i=b,a("hyperframe:picker:hovered",{elementInfo:i,isPickMode:t,timestamp:Date.now()})}function s(b){o=b,a("hyperframe:picker:selected",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function u(b){let S=b.ownerDocument.defaultView;if(!S)return!1;let A=b;for(;A&&A!==document.body&&A!==document.documentElement;){let R=S.getComputedStyle(A);if(R.display==="none"||R.visibility==="hidden"||R.pointerEvents==="none")return!0;let F=Number.parseFloat(R.opacity);if(Number.isFinite(F)&&F<=.01&&!A.hasAttribute(on))return!0;A=A.parentElement}return!1}function c(b){if(!b||b===document.body||b===document.documentElement)return!1;let S=b.tagName.toLowerCase();return!(S==="script"||S==="style"||S==="link"||S==="meta"||b.classList.contains("__hf-pick-highlight")||b.closest(yf)||u(b))}function m(b){return!!b?.closest(Sf)}function f(b){let S=b;if(S.id)return`#${CSS.escape(S.id)}`;let A=b.getAttribute("data-composition-id");if(A)return`[data-composition-id="${CSS.escape(A)}"]`;let R=b.getAttribute("data-composition-src");if(R)return`[data-composition-src="${CSS.escape(R)}"]`;let F=b.getAttribute("data-track-index");if(F)return`[data-track-index="${CSS.escape(F)}"]`;let G=b.tagName.toLowerCase(),B=b.parentElement;if(!B)return G;let ne=B.querySelectorAll(`:scope > ${G}`);if(ne.length===1)return G;for(let H=0;H<ne.length;H+=1)if(ne[H]===b)return`${G}:nth-of-type(${H+1})`;return G}function x(b){let S=b.tagName.toLowerCase(),A=(b.textContent??"").trim().replace(/\s+/g," "),R=(F,G)=>F.length>G?`${F.slice(0,G-1)}\u2026`:F;return S==="h1"||S==="h2"||S==="h3"?"Heading":S==="p"||S==="span"||S==="div"?A.length>0?R(A,56):"Text":S==="img"?"Image":S==="video"?"Video":S==="audio"?"Audio":S==="svg"?"Shape":b.getAttribute("data-composition-src")?"Composition":S==="section"?"Section":`${S.charAt(0).toUpperCase()}${S.slice(1)}`}function v(b,S,A){let R=typeof A=="number"&&A>0?A:8,F=[];if(document.elementsFromPoint)F=document.elementsFromPoint(b,S);else if(document.elementFromPoint){let ne=document.elementFromPoint(b,S);F=ne?[ne]:[]}if(m(F[0]??null))return[];let G={},B=[];for(let[ne,H]of F.entries()){if(!c(H))continue;let Y=`${H.tagName}::${H.id||""}::${ne}`;if(!G[Y]&&(G[Y]=!0,B.push(H),B.length>=R))break}return B}function C(b){let S=b.getBoundingClientRect(),A={};for(let F of Array.from(b.attributes))F.name.startsWith("data-")&&(A[F.name]=F.value);return{id:b.id||null,tagName:b.tagName.toLowerCase(),selector:f(b),label:x(b),boundingBox:{x:S.left,y:S.top,width:S.width,height:S.height},textContent:b.textContent?b.textContent.trim().slice(0,200):null,src:b.getAttribute("src")||b.getAttribute("data-composition-src")||null,dataAttributes:A}}function y(b,S,A){return v(b,S,A).map(C)}function w(b){if(!t)return;let A=v(b.clientX,b.clientY,1)[0]??(b.target instanceof Element?b.target:null);if(!c(A)||n===A)return;n&&n.classList.remove("__hf-pick-highlight"),n=A,A.classList.add("__hf-pick-highlight");let R=C(A);l(R),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:R})}function T(b){if(!t)return;b.preventDefault(),b.stopPropagation(),b.stopImmediatePropagation();let S=y(b.clientX,b.clientY,8);S.length!==0&&(l(S[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:S,selectedIndex:0,point:{x:b.clientX,y:b.clientY}}))}function N(b){b.key==="Escape"&&(I(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function D(){t||(t=!0,r=document.createElement("style"),r.textContent=[".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",".__hf-pick-active * { cursor: crosshair !important; }"].join(`
|
|
40
|
+
`),document.head.appendChild(r),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",w,!0),document.addEventListener("click",T,!0),document.addEventListener("keydown",N,!0),a("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function I(){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",w,!0),document.removeEventListener("click",T,!0),document.removeEventListener("keydown",N,!0),a("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function _(){window.__HF_PICKER_API={enable:D,disable:I,isActive:()=>t,getHovered:()=>i,getSelected:()=>o,getCandidatesAtPoint:(b,S,A)=>Number.isFinite(b)&&Number.isFinite(S)?y(b,S,A):[],pickAtPoint:(b,S,A)=>{if(!Number.isFinite(b)||!Number.isFinite(S))return null;let R=y(b,S,8);if(!R.length)return null;let F=Math.max(0,Math.min(R.length-1,Number(A??0))),G=R[F]??null;return G?(s(G),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:G}),I(),G):null},pickManyAtPoint:(b,S,A)=>{if(!Number.isFinite(b)||!Number.isFinite(S))return[];let R=y(b,S,8);if(!R.length)return[];let F=[],G=Array.isArray(A)?A:[0];for(let B of G){let ne=Math.max(0,Math.min(R.length-1,Math.floor(Number(B)))),H=R[ne];if(!H)continue;F.some(we=>we.selector===H.selector&&we.tagName===H.tagName)||F.push(H)}return F.length?(s(F[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:F}),I(),F):[]}},a("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:D,disablePickMode:I,installPickerApi:_}}var vf=["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 Nt(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 gs(e,t,n=vf){for(let r of n){let i=t.getPropertyValue(r);i&&e.setProperty(r,i)}}function an(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 Ge(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 sn(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 xs(e,t,n,r){let i=Nt(t,n),o=r?.suppressEvents===!0;return Ge(e,"pause"),typeof e.totalTime=="function"?e.totalTime(i,o):typeof e.seek=="function"&&e.seek(i,o),i}function Ef(e,t,n,r,i){let o=[];sn(e,t,a=>{Ge(a,"play"),o.push(a)});try{return xs(t,n,r,i)}finally{for(let a of o)try{Ge(a,"pause")}catch(l){L("runtime.player.site2",l)}}}function Cf(e,t){sn(e,t,n=>{Ge(n,"play")})}function bs(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?.()??an(n,"duration",0))||0);r>0&&Math.max(0,an(n,"time",0))>=r&&(Ge(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()),Ge(n,"play"),sn(e.getTimelineRegistry?.(),n,i=>{typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),Ge(i,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;Ge(n,"pause"),sn(e.getTimelineRegistry?.(),n,i=>{Ge(i,"pause")});let r=Math.max(0,an(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=Ef(e.getTimelineRegistry?.(),i,o,e.getCanonicalFps());e.onDeterministicSeek(l),r?.keepPlaying&&a?(typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),Ge(i,"play"),sn(e.getTimelineRegistry?.(),i,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),Ge(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?(Cf(e.getTimelineRegistry?.(),i),xs(i,n,o,r)):Nt(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:()=>an(e.getTimeline(),"time",0),getDuration:()=>an(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function ys(){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 _f=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function wi(e){return e.id||e.getAttribute("data-hf-id")||null}function Ai(e){if(e==null)return null;let t=Number(e);return Number.isFinite(t)?t:null}function Af(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 wf(e){if(!(e instanceof HTMLMediaElement)||!Number.isFinite(e.duration))return null;let t=Ai(e.getAttribute("data-playback-start"))??Ai(e.getAttribute("data-media-start"))??0;return e.duration>t?e.duration-t:null}function Tf(e,t,n,r){let i=Ai(e.getAttribute("data-duration"));return i!=null&&i>0?i:Af(e,t)??wf(e)??Math.max(0,n-r)}function Rf(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 Ss(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||_f.has(l.tagName))continue;let s=t.resolveStartForElement(l,0);if(Tf(l,n,r,s)<=0)continue;let u={id:wi(l)??`__clip-${a++}`,element:l,parentId:null,children:[]};i.set(l,u)}return Rf(i),{roots:Array.from(i.values()).filter(l=>l.parentId===null)}}var Ti="css:root",vs=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],Lf=new Set([...vs,"contain","isolation","mask-border","mix-blend-mode","opacity"]),Ff=new Set(["absolute","relative"]),Nf=new Set(["flex","inline-flex","grid","inline-grid"]),Mf=new Set(["layout","paint","strict","content"]),kf=new Set(["size","inline-size"]);function Df(e){return e.position==="fixed"||e.position==="sticky"}function If(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(Ff.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&Nf.has(n)}function Pf(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:vs.some(r=>{let i=e.getPropertyValue(r);return i!==""&&i!=="none"})}function Of(e){return e.getPropertyValue("contain").split(/\s+/).some(n=>Mf.has(n))?!0:kf.has(e.getPropertyValue("container-type"))}function Gf(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>Lf.has(t))}function Hf(e,t){return Df(t)||If(e,t)||Pf(t)||Of(t)?!0:Gf(t)}function Bf(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 Zn(e){let t=e.ownerDocument.defaultView;if(!t)return Ti;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(Hf(n,t.getComputedStyle(n)))return Bf(n)}catch{return Ti}n=n.parentElement}return Ti}var Mt=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),ab=Object.freeze([Mt.start,Mt.duration,Mt.trackIndex]),sb=Object.freeze([Mt.derivedEnd]),lb=Object.freeze([Mt.derivedEnd,Mt.legacyTrack]);function Xe(e){if(e==null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}var Cs=/^[A-Za-z0-9_.:-]+$/;function _s(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function Es(e,t){let n=t;for(;n>=0&&_s(e,n);)n--;return n}function Uf(e,t){let n=t;for(;n>=0&&(e[n]??"").trim()==="";)n--;return n}function Wf(e){let t=e.length-1;if(!_s(e,t))return null;let n=Es(e,t);return e[n]==="."&&(n=Es(e,n-1)),n+1}function Vf(e){let t=Wf(e);if(t==null)return null;let n=Uf(e,t-1),r=e[n];if(r!=="+"&&r!=="-")return null;let i=e.slice(0,n).trim();if(!Cs.test(i))return null;let o=Number(e.slice(t));return Number.isFinite(o)?{refId:i,operator:r,magnitude:o}:null}function Ri(e){let t=(e??"").trim();if(!t)return null;let n=Xe(t);if(n!=null)return{kind:"absolute",value:n};if(Cs.test(t))return{kind:"reference",refId:t,offset:0};let r=Vf(t);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}var zf="data-hf-authored-duration",$f="data-hf-authored-end";function qf(e){return Xe(e.getAttribute("data-duration"))}function jf(e){return Xe(e.getAttribute("data-end"))}function Kf(e){return Xe(e.getAttribute(zf))}function Yf(e){return Xe(e.getAttribute($f))}function it(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,i=new WeakMap,o=new WeakMap,a=new Set,l=f=>{let x=r.getElementById(f);return x||(r.querySelector(`[data-composition-id="${CSS.escape(f)}"]`)??null)},s=f=>{let x=f.ownerDocument.defaultView?.HTMLMediaElement;return x?f instanceof x:typeof HTMLMediaElement<"u"&&f instanceof HTMLMediaElement},u=f=>{let x=o.get(f);if(x!==void 0)return x;let v=null,C=qf(f)??(n?Kf(f):null);if(C!=null&&C>0&&(v=C),v==null||v<=0){let y=jf(f)??(n?Yf(f):null);if(y!=null){let w=m(f,0),T=y-w;Number.isFinite(T)&&T>0&&(v=T)}}if((v==null||v<=0)&&s(f)){let y=Xe(f.getAttribute("data-playback-start"))??Xe(f.getAttribute("data-media-start"))??0;Number.isFinite(f.duration)&&f.duration>y&&(v=(f.duration-y)/ze(f))}if(v==null||v<=0){let y=f.getAttribute("data-composition-id");if(y){let w=t[y]??null;if(w&&typeof w.duration=="function")try{let T=Number(w.duration());Number.isFinite(T)&&T>0&&(v=T)}catch(T){L("runtime.startResolver.site1",T)}}}return v!=null&&Number.isFinite(v)&&v>0?(o.set(f,v),v):(o.set(f,null),null)},c=(f,x)=>{if(f.hasAttribute("data-composition-id")){let C=f.parentElement?.closest("[data-composition-id]");return C?m(C,x):0}let v=f.closest("[data-composition-id]");return v?m(v,x):0},m=(f,x)=>{let v=i.get(f);if(v!==void 0)return v??x;if(a.has(f))return x;a.add(f);try{let C=Ri(f.getAttribute("data-start"));if(!C){if(f.hasAttribute("data-composition-id")){let D=f.parentElement;if(D&&(D.hasAttribute("data-composition-src")||D.hasAttribute("data-composition-id")||D.hasAttribute("data-composition-file"))){let I=m(D,x);return i.set(f,I),I}}return i.set(f,x),x}if(C.kind==="absolute"){let D=Math.max(0,C.value),I=Math.max(0,c(f,x)+D);return i.set(f,I),I}let y=l(C.refId);if(!y)return i.set(f,x),x;let w=m(y,0),T=u(y);if(T==null||T<=0){let D=Math.max(0,w+C.offset);return i.set(f,D),D}let N=Math.max(0,w+T+C.offset);return i.set(f,N),N}finally{a.delete(f)}};return{resolveStartForElement:(f,x=0)=>m(f,Math.max(0,x)),resolveDurationForElement:f=>u(f)}}function Li(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}var Jf="data-hf-authored-duration",Qf="data-hf-authored-end";function Le(e){if(e==null||e==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}function Fi(e){return Le(e.getAttribute("data-duration"))??Le(e.getAttribute(Jf))}function As(e){return Le(e.getAttribute("data-end"))??Le(e.getAttribute(Qf))}function Ni(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 Mi(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function ki(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 un(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 ws(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return un(t);let n=e.getAttribute("data-composition-src");if(n)return un(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?un(r.getAttribute("src")):null}function Zf(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 em(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 tm(e){let t=e.textContent?.replace(/\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function ln(e){let t=e.replace(/\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return t?t.replace(/\b\w/g,n=>n.toUpperCase()):e}function nm(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 ln(i);let o=e.id;if(o)return ln(o);let a=Zf(e);if(a)return ln(a);let l=em(ws(e));if(l)return ln(l);let s=tm(e);return s||`${ln(t)} ${n+1}`}function Ts(e){let n=window.__timelines??{},r=it({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),i=P=>{if(!P)return null;let M=n[P]??null;if(!M||typeof M.duration!="function")return null;try{let U=Number(M.duration());return Number.isFinite(U)&&U>0?U:null}catch{return null}},o=P=>{let M=Le(P.getAttribute("data-duration"));if(M!=null&&M>0)return M;let U=Le(P.getAttribute("data-playback-start"))??Le(P.getAttribute("data-media-start"))??0;return Number.isFinite(P.duration)&&P.duration>U?Math.max(0,(P.duration-U)/ze(P)):null},a=()=>{let P=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(P.length===0)return null;let M=0;for(let U of P){let se=U.hasAttribute("data-hf-auto-start")?r.resolveStartForElement(U,0):Math.max(0,Number(U.getAttribute("data-start")??0)||0);if(!Number.isFinite(se))continue;let ie=o(U);ie==null||ie<=0||(M=Math.max(M,Math.max(0,se)+ie))}return M>0?M:null},l=(P,M)=>{let U=[],se=null,ie=null,$=null,q=P.parentElement;for(;q;){let j=q.getAttribute("data-composition-id");j&&(U.push(j),!$&&q!==M&&($=j),se==null&&(se=r.resolveStartForElement(q,0)),ie==null&&(ie=Le(q.getAttribute("data-duration"))??i(j)??null)),q=q.parentElement}return{parentCompositionId:$,compositionAncestors:U.reverse(),inheritedStart:se,inheritedDuration:ie}},s=document.querySelector("[data-composition-id]"),u=Array.from(document.querySelectorAll("[data-composition-id]")),c=s?.getAttribute("data-composition-id")??null,m=s?r.resolveStartForElement(s,0):0,f=a(),x=f!=null?Math.max(0,f-Math.max(0,m)):null,v=i(c),C=Fi(s??document.body),y=Mi(...u.filter(P=>P!==s).map(P=>{let M=r.resolveStartForElement(P,0),U=r.resolveDurationForElement(P)??i(P.getAttribute("data-composition-id"))??null;return!Number.isFinite(M)||U==null||U<=0?null:Math.max(0,M)+U})),w=y!=null?Math.max(0,y-Math.max(0,m)):null,T=typeof v=="number"&&Number.isFinite(v)&&v>0?v:null,N=typeof C=="number"&&Number.isFinite(C)&&C>0?C:null,D=typeof x=="number"&&Number.isFinite(x)&&x>0?x:null,I=typeof w=="number"&&Number.isFinite(w)&&w>0?w:null,_=Mi(D,I),b=T!=null&&_!=null&&T>_+1,A=N??(b?_:Mi(T,D,I))??null,F=(A!=null?m+A:null)??(typeof f=="number"&&Number.isFinite(f)&&f>0?f:null),G=(P,M)=>!Number.isFinite(M)||M<=0?0:F==null||!Number.isFinite(F)?M:!Number.isFinite(P)||P>=F?0:Math.max(0,Math.min(M,F-P)),B=[],ne=[],H=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),Y=0;for(let[P,M]of H.entries()){if(M===s||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(M.tagName))continue;let U=l(M,s),se=r.resolveStartForElement(M,U.inheritedStart??0),ie=M.getAttribute("data-composition-id"),$=Fi(M);if(($==null||$<=0)&&ie&&ie!==c&&($=i(ie)),($==null||$<=0)&&M instanceof HTMLMediaElement){let Te=Le(M.getAttribute("data-playback-start"))??Le(M.getAttribute("data-media-start"))??0;Number.isFinite(M.duration)&&M.duration>0&&($=Math.max(0,M.duration-Te))}if($==null||$<=0){let Te=U.inheritedDuration;if(Te!=null&&Te>0){let Ye=(U.inheritedStart??0)+Te;$=Math.max(0,Ye-se)}}if($==null||$<=0||($=G(se,$),$<=0))continue;let q=se+$;Y=Math.max(Y,q);let j=M.tagName.toLowerCase(),be=ie&&ie!==c?"composition":j==="video"?"video":j==="audio"?"audio":j==="img"?"image":"element";B.push({id:wi(M)??ie??null,label:nm(M,be,B.length),start:se,duration:$,track:ki(M,P),zIndex:Ni(M),stackingContextId:Zn(M),kind:be,tagName:j,compositionId:M.getAttribute("data-composition-id"),compositionAncestors:U.compositionAncestors,parentCompositionId:U.parentCompositionId,nodePath:null,compositionSrc:un(M.getAttribute("data-composition-src")),playbackStart:Tt(M),playbackRate:ze(M),assetUrl:ws(M),timelineRole:M.getAttribute("data-timeline-role"),timelineLabel:M.getAttribute("data-timeline-label"),timelineGroup:M.getAttribute("data-timeline-group"),timelinePriority:Le(M.getAttribute("data-timeline-priority"))})}let we=new Set(B.map(P=>P.id)),V=s?.getAttribute("data-composition-id")??null,X=V?n[V]??null:null;if(X&&s){let P=X;if(typeof P.getChildren=="function")try{let M=P.getChildren(!0,!0,!1)??[],U=new Map;for(let $ of s.children){let q=$;if(!q.id)continue;let j=q.tagName.toLowerCase();j==="script"||j==="style"||j==="link"||U.set(q,{id:q.id,start:1/0,end:-1/0})}let se=$=>{let q=$;for(;q;){if(U.has(q))return q;if(q===s)return null;q=q.parentElement}return null};for(let $ of M){if(typeof $.targets!="function"||typeof $.startTime!="function"||typeof $.duration!="function")continue;let q=$.startTime(),j=$.parent;for(;j&&j!==X&&typeof j.startTime=="function";)q+=j.startTime(),j=j.parent;let be=q+$.duration();if(!(!Number.isFinite(q)||!Number.isFinite(be)))for(let Te of $.targets()){if(!(Te instanceof Element))continue;let ft=se(Te);if(!ft)continue;let Ye=U.get(ft);Ye&&(Ye.start=Math.min(Ye.start,q),Ye.end=Math.max(Ye.end,be))}}let ie=B.length>0?Math.max(...B.map($=>$.track))+1:0;for(let[$,q]of U){if(q.start===1/0||q.end===-1/0)continue;let j=$;if(we.has(j.id))continue;let be=Math.max(0,q.end-q.start);if(be<=0)continue;let Te=G(q.start,be);Te<=0||(Y=Math.max(Y,q.start+Te),B.push({id:j.id,label:j.getAttribute("data-timeline-label")??j.getAttribute("data-label")??j.getAttribute("aria-label")??j.id,start:q.start,duration:Te,track:ki(j,ie),zIndex:Ni(j),stackingContextId:Zn(j),kind:"element",tagName:j.tagName.toLowerCase(),compositionId:j.getAttribute("data-composition-id"),compositionAncestors:V?[V]:[],parentCompositionId:V,nodePath:null,compositionSrc:null,playbackStart:Tt(j),playbackRate:ze(j),assetUrl:null,timelineRole:j.getAttribute("data-timeline-role"),timelineLabel:j.getAttribute("data-timeline-label"),timelineGroup:j.getAttribute("data-timeline-group"),timelinePriority:Le(j.getAttribute("data-timeline-priority"))}),we.add(j.id))}}catch(M){L("runtime.timeline.site1",M)}}if(s&&A!=null&&A>0){let P=B.length>0?Math.max(...B.map(M=>M.track))+1:0;for(let M of s.children){let U=M;if(!U.id||we.has(U.id))continue;let se=U.getAttribute("data-timeline-role");if(se!=="overlay"&&se!=="persistent-overlay")continue;let ie=U.tagName.toLowerCase();if(ie==="script"||ie==="style"||ie==="link"||ie==="meta"||window.getComputedStyle(U).display==="none")continue;let q=G(0,A);q<=0||(Y=Math.max(Y,q),B.push({id:U.id,label:U.getAttribute("data-timeline-label")??U.getAttribute("data-label")??U.getAttribute("aria-label")??U.id,start:0,duration:q,track:ki(U,P),zIndex:Ni(U),stackingContextId:Zn(U),kind:"element",tagName:ie,compositionId:U.getAttribute("data-composition-id"),compositionAncestors:V?[V]:[],parentCompositionId:V,nodePath:null,compositionSrc:null,playbackStart:Tt(U),playbackRate:ze(U),assetUrl:null,timelineRole:se,timelineLabel:U.getAttribute("data-timeline-label"),timelineGroup:U.getAttribute("data-timeline-group"),timelinePriority:Le(U.getAttribute("data-timeline-priority"))}),we.add(U.id))}}for(let P of u){if(P===s)continue;let M=P.getAttribute("data-composition-id");if(!M||!Li(M))continue;let U=r.resolveStartForElement(P,0),se=Fi(P);if((se==null||se<=0)&&As(P)!=null){let j=As(P);se=Math.max(0,j-U)}let ie=i(M),$=se&&se>0?se:ie;if($==null||$<=0)continue;let q=G(U,$);q<=0||ne.push({id:M,label:P.getAttribute("data-label")??M,start:U,duration:q,thumbnailUrl:un(P.getAttribute("data-thumbnail-url")),avatarName:null})}let z=Math.max(1,Y||1,A??0),J=b&&N==null,xe=J?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(z*Math.max(1,e.canonicalFps)));return{...Wn(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:J?Number.POSITIVE_INFINITY:z,durationInFrames:xe,clips:B,scenes:ne,compositionWidth:Le(s?.getAttribute("data-width"))??1920,compositionHeight:Le(s?.getAttribute("data-height"))??1080}}var de=dd(Ql(),1),Zl=de.default,Ey=de.default.stringify,Cy=de.default.fromJSON,_y=de.default.plugin,Ay=de.default.parse,wy=de.default.list,Ty=de.default.document,Ry=de.default.comment,Ly=de.default.atRule,Fy=de.default.rule,Ny=de.default.decl,My=de.default.root,ky=de.default.CssSyntaxError,Dy=de.default.Declaration,Iy=de.default.Container,Py=de.default.Processor,Oy=de.default.Document,Gy=de.default.Comment,Hy=de.default.Warning,By=de.default.AtRule,Uy=de.default.Result,Wy=de.default.Input,Vy=de.default.Rule,zy=de.default.Root,$y=de.default.Node;var oo="data-hf-authored-id",eu="data-hf-inner-root";function ao(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function so(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function _p(e){return e&&e.replace(/[^a-zA-Z0-9_-]/g,n=>`\\${n}`).replace(/^-?\d/,n=>`\\${n}`)}function nu(e){let t=e.trim();return t?Array.from(new Set([t,_p(t)])).filter(Boolean):[]}function Ap(e){return!!e&&/[\w-]/.test(e)}function wp(e,t,n){let r=nu(t).sort((l,s)=>s.length-l.length);if(r.length===0)return e;let i="",o=0,a=null;for(let l=0;l<e.length;l+=1){let s=e[l],u=l>0?e[l-1]:"";if(a){i+=s,s===a&&u!=="\\"&&(a=null);continue}if(s==='"'||s==="'"){a=s,i+=s;continue}if(s==="["){o+=1,i+=s;continue}if(s==="]"){o=Math.max(0,o-1),i+=s;continue}if(s==="#"&&o===0){let c=r.find(m=>e.startsWith(m,l+1));if(c){let m=e[l+1+c.length];if(!Ap(m)){i+=n,l+=c.length;continue}}}i+=s}return i}function Tp(e,t){let n=t?.trim();return n?wp(e,n,`[${oo}="${so(n)}"]`):e}function tu(e){return`${e}:not(:has([${eu}])), ${e} > [${eu}]`}function Rp(e,t,n,r,i,o){let a=Tp(e,r),l=Lp(a,t,n),s=l.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return o?tu(t):e;let u=new RegExp(`\\[\\s*data-composition-id\\s*=\\s*(["'])${ao(n)}\\1\\s*\\]`,"g");if(u.test(s))return s.replace(u,"").trim()===""?tu(t):l.replace(u,t);let c=l.match(/^\s*/)?.[0]??"",m=l.match(/\s*$/)?.[0]??"";if(i){let f=r?`[${oo}="${so(r)}"]`:null;if(f&&s.startsWith(f)){let x=s.slice(f.length);return`${c}${t}${f}${x}${m}`}}return`${c}${t} ${s}${m}`}function Lp(e,t,n){let r=ao(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 Fp=new Set(["keyframes","-webkit-keyframes","font-face"]);function Np(e){return e?.type==="atrule"}function Mp(e){let t=e.parent;for(;t;){if(Np(t)&&Fp.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function kp(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function ru(e,t,n,r,i){let o=t.trim();if(!e||!o)return e;let a=n||`[data-composition-id="${so(o)}"]`,l=Zl.parse(e);return l.walkRules(s=>{Mp(s)||kp(s)||(s.selectors=s.selectors.map(u=>Rp(u,a,o,r,i?.compoundAuthoredRoot,i?.scopeRootSelectors)))}),l.toResult({map:!1}).css}function iu(e,t,n="[HyperFrames] composition script error:",r,i=t,o){let a=JSON.stringify(t),l=JSON.stringify(i),s=JSON.stringify(n),u=ao(t),c=JSON.stringify(o?.trim()||null),m=JSON.stringify(r??null),f=JSON.stringify(String.raw`\[\s*data-composition-id\s*=\s*(?:"${u}"|'${u}')\s*\]`),x=JSON.stringify(String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`),v=JSON.stringify(nu(o?.trim()||""));return`(function(){
|
|
41
41
|
var __hfCompId = ${a};
|
|
42
|
-
var __hfTimelineCompId = ${
|
|
42
|
+
var __hfTimelineCompId = ${l};
|
|
43
43
|
var __hfErrorLabel = ${s};
|
|
44
|
-
var __hfAuthoredRootId = ${
|
|
45
|
-
var __hfAuthoredRootAttr = ${JSON.stringify(
|
|
44
|
+
var __hfAuthoredRootId = ${c};
|
|
45
|
+
var __hfAuthoredRootAttr = ${JSON.stringify(oo)};
|
|
46
46
|
var __hfEscapeAttr = function(value) {
|
|
47
47
|
return (value + "").replace(/\\\\/g, "\\\\\\\\").replace(/"/g, "\\\\\\"");
|
|
48
48
|
};
|
|
49
|
-
var __hfRootSelector = ${
|
|
49
|
+
var __hfRootSelector = ${m} || (__hfCompId
|
|
50
50
|
? '[data-composition-id="' + __hfEscapeAttr(__hfCompId) + '"]'
|
|
51
51
|
: "");
|
|
52
52
|
var __hfRoot = null;
|
|
53
|
-
var __hfRootSelectorPattern = ${
|
|
53
|
+
var __hfRootSelectorPattern = ${f};
|
|
54
54
|
var __hfTimingSelectorPattern = ${x};
|
|
55
|
-
var __hfAuthoredRootIdForms = ${
|
|
55
|
+
var __hfAuthoredRootIdForms = ${v};
|
|
56
56
|
var __hfAuthoredRootSelector = __hfAuthoredRootId
|
|
57
57
|
? "[" + __hfAuthoredRootAttr + '="' + __hfEscapeAttr(__hfAuthoredRootId) + '"]'
|
|
58
58
|
: "";
|
|
@@ -345,12 +345,14 @@ ${e.replace(/<\/(script)/gi,"<\\/$1")}
|
|
|
345
345
|
};
|
|
346
346
|
__hfFindRoot();
|
|
347
347
|
__hfRun();
|
|
348
|
-
})();`}var Wf=["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 tl(e){let t=e.getAttribute("id")?.trim();for(let n of Wf)e.removeAttribute(n);t&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",t)),e.setAttribute("data-hf-inner-root","true")}var Vf=8e3,zf=/^(?![a-zA-Z][a-zA-Z\d+\-.]*:)(?!\/\/)(?!\/)(?!\.\.?\/).+/,jf=/\burl\(\s*(["']?)([^)"']+)\1\s*\)/g,$f=["src","href"];function qf(e){return!e||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/")}function il(e,t){if(!t)return e;let n=e.trim();if(qf(n)||!n.startsWith("../")&&n!=="..")return e;try{return new URL(n,t).href}catch{return e}}function rl(e,t){return!t||!e?e:e.replace(jf,(n,i,r)=>{let o=il(r||"",t);return o===r?n:`url(${i||""}${o}${i||""})`})}function Kf(e,t){for(let n of Array.from(e.querySelectorAll("[src], [href]")))for(let i of $f){let r=n.getAttribute(i);if(r==null)continue;let o=il(r,t);o!==r&&n.setAttribute(i,o)}}function Yf(e,t){for(let n of Array.from(e.querySelectorAll("[style]"))){let i=n.getAttribute("style");if(i==null)continue;let r=rl(i,t);r!==i&&n.setAttribute("style",r)}}function Jf(e,t){for(let n of Array.from(e.querySelectorAll("style"))){let i=n.textContent||"",r=rl(i,t);r!==i&&(n.textContent=r)}}function ol(e,t){if(t){Kf(e,t),Yf(e,t),Jf(e,t);for(let n of Array.from(e.querySelectorAll("template")))ol(n.content,t)}}function Xf(e,t){return`${e}__hf${t}`}var Qf=e=>new Promise(t=>{let n=!1,i=Date.now(),r=null,o=a=>{n||(n=!0,r!=null&&window.clearTimeout(r),t({status:a,elapsedMs:Math.max(0,Date.now()-i)}))};e.addEventListener("load",()=>o("load"),{once:!0}),e.addEventListener("error",()=>o("error"),{once:!0}),r=window.setTimeout(()=>o("timeout"),Vf)});function Er(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function Zf(e){let t=document.importNode(e,!0);tl(t);let n=t.getAttribute("data-width"),i=t.getAttribute("data-height");return t.style.width=n?`${n}px`:"100%",t.style.height=i?`${i}px`:"100%",t}function nl(e,t){let n=e.trim();if(!n)return e;try{return zf.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 Sr(e,t){try{let n=new URL(e),i=new URL(t);return n.search="",n.hash="",i.search="",i.hash="",n.href===i.href}catch{return!1}}function Vn(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 em(e){let t=new Map;for(let n of e){let i=Vn(n).authoredCompositionId||"";i&&t.set(i,(t.get(i)||0)+1)}return t}function sl(e){let t=Vn(e).authoredCompositionId;return t?!!document.querySelector(`template#${CSS.escape(t)}-template`):!1}function tm(e){return!!e.querySelector('[data-hf-inner-root="true"]')}function nm(e){return e.hasAttribute("data-composition-src")?!0:sl(e)?e.children.length===0||e.hasAttribute("data-hf-original-composition-id")?!0:tm(e):!1}function wr(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(t=>t.hasAttribute("data-composition-src")?!0:sl(t))}function al(){let e=window.__hfVariablesByComp;if(!e)return;let t=new Set(wr().map(n=>Vn(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(e))t.has(n)||delete e[n]}function ll(e,t=em(e)){let n=new Map,i=new Map;for(let r of e){let{authoredCompositionId:o,runtimeCompositionId:a}=Vn(r),c=nm(r);if(!o){i.set(r,{authoredCompositionId:null,runtimeCompositionId:a});continue}let s=(t.get(o)||0)>1,l=a||o;if(c){let f=s?(n.get(o)||0)+1:0;s&&n.set(o,f),l=s?Xf(o,f):o,s?r.setAttribute("data-hf-original-composition-id",o):r.removeAttribute("data-hf-original-composition-id"),r.setAttribute("data-composition-id",l),a&&a!==l&&window.__hfVariablesByComp&&delete window.__hfVariablesByComp[a]}i.set(r,{authoredCompositionId:o,runtimeCompositionId:l})}return i}async function Ar(e){let t=null;e.authoredCompositionId&&(t=Array.from(e.sourceNode.querySelectorAll("[data-composition-id]")).find(x=>x instanceof HTMLElement&&x.getAttribute("data-composition-id")===e.authoredCompositionId)??null);let n=t??e.sourceNode,i=t?.getAttribute("data-composition-id")?.trim()||e.authoredCompositionId||null,r=e.runtimeCompositionId||i||null,o=t?.getAttribute("id")?.trim()||null,a=r?`[data-composition-id="${CSS.escape(r)}"]`:void 0;if(e.headLinks)for(let d of e.headLinks){let x=(d.getAttribute("href")||"").trim();if(!x)continue;let S=e.compositionUrl?new URL(x,e.compositionUrl).href:x;if(e.compositionUrl&&Sr(S,e.compositionUrl)||document.head.querySelector(`link[href="${CSS.escape(S)}"]`))continue;let y=d.cloneNode(!0);y.href=S,document.head.appendChild(y),e.injectedLinks.push(y)}let c=d=>{for(let x of d){let S=x.cloneNode(!0);S instanceof HTMLStyleElement&&(i&&(S.textContent=Za(S.textContent||"",i,a,o,{scopeRootSelectors:!0})),document.head.appendChild(S),e.injectedStyles.push(S))}};e.headStyles&&c(e.headStyles),c(Array.from(n.querySelectorAll("style")));let s=[];if(e.headScripts)for(let d of e.headScripts){let x=d.getAttribute("type")?.trim()??"",S=d.getAttribute("src")?.trim()??"";if(S){let y=nl(S,e.compositionUrl);if(e.compositionUrl&&Sr(y,e.compositionUrl))continue;s.push({kind:"external",src:y,type:x})}else{let y=d.textContent?.trim()??"";y&&s.push({kind:"inline",content:y,type:x,scopeCompositionId:i})}}let l=Array.from(n.querySelectorAll("script")),f=[...s];for(let d of l){let x=d.getAttribute("type")?.trim()??"",S=d.getAttribute("src")?.trim()??"";if(S){let y=nl(S,e.compositionUrl);if(e.compositionUrl&&Sr(y,e.compositionUrl)){d.parentNode?.removeChild(d);continue}f.push({kind:"external",src:y,type:x})}else{let y=d.textContent?.trim()??"";y&&f.push({kind:"inline",content:y,type:x,scopeCompositionId:i})}d.parentNode?.removeChild(d)}let p=Array.from(n.querySelectorAll("style"));for(let d of p)d.parentNode?.removeChild(d);if(t){let d=t.getAttribute("data-width"),x=t.getAttribute("data-height"),S=e.parseDimensionPx(d),y=e.parseDimensionPx(x);d&&e.host.setAttribute("data-width",d),x&&e.host.setAttribute("data-height",x),S&&e.host instanceof HTMLElement&&(e.host.style.width=S),y&&e.host instanceof HTMLElement&&(e.host.style.height=y),t.hasAttribute("data-timeline-locked")&&e.host.setAttribute("data-timeline-locked",""),e.host.appendChild(Zf(t))}else e.hasTemplate?e.host.appendChild(document.importNode(n,!0)):e.host.innerHTML=e.fallbackBodyInnerHtml;r&&im(e,n,r);for(let d of f){let x=document.createElement("script");if(d.type&&(x.type=d.type),x.async=!1,d.kind==="external"?x.src=d.src:d.type.toLowerCase()==="module"?x.textContent=d.content:d.scopeCompositionId?x.textContent=el(d.content,d.scopeCompositionId,"[HyperFrames] composition script error:",a,r||d.scopeCompositionId,o):x.textContent=`(function(){${d.content}})();`,document.body.appendChild(x),e.injectedScripts.push(x),d.kind==="external"){let S=await Qf(x);S.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.authoredCompositionId,runtimeCompositionId:e.runtimeCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:d.src,loadStatus:S.status,elapsedMs:S.elapsedMs}})}}}async function ul(e){let t=wr();if(al(),t.length===0)return;let n=ll(t),i=t.filter(r=>{if(r.hasAttribute("data-composition-src")||r.children.length>0)return!1;let o=n.get(r)?.authoredCompositionId;return o?!!document.querySelector(`template#${CSS.escape(o)}-template`):!1});if(i.length!==0)for(let r of i){let o=n.get(r),a=o?.authoredCompositionId;if(!a)continue;let c=document.querySelector(`template#${CSS.escape(a)}-template`);Er(r),await Ar({host:r,authoredCompositionId:a,runtimeCompositionId:o?.runtimeCompositionId||a,hostCompositionSrc:`template#${a}-template`,sourceNode:c.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic})}}async function cl(e){let t=wr();if(al(),t.length===0)return;let n=ll(t),i=t.filter(r=>r.hasAttribute("data-composition-src"));i.length!==0&&await Promise.all(i.map(async r=>{let o=r.getAttribute("data-composition-src");if(!o)return;let a=n.get(r),c=a?.authoredCompositionId||null,s=a?.runtimeCompositionId||c||null,l=null;try{l=new URL(o,document.baseURI)}catch{l=null}Er(r);try{let f=c!=null?document.querySelector(`template#${CSS.escape(c)}-template`):null;if(f){await Ar({host:r,authoredCompositionId:c,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:f.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:l,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});return}let p=await fetch(o);if(!p.ok)throw new Error(`HTTP ${p.status}`);let d=await p.text(),S=new DOMParser().parseFromString(d,"text/html");ol(S,l);let y=(c?S.querySelector(`template#${CSS.escape(c)}-template`):null)??S.querySelector("template"),b=y?y.content:S.body,A=y?void 0:Array.from(S.head.querySelectorAll("style")),_=y?void 0:Array.from(S.head.querySelectorAll("script")),M=Array.from(S.head.querySelectorAll('link[rel="stylesheet"], link[rel="preconnect"]'));await Ar({host:r,authoredCompositionId:c,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:b,hasTemplate:!!y,fallbackBodyInnerHtml:S.body.innerHTML,compositionUrl:l,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,headStyles:A,headScripts:_,headLinks:M,declaredVariableDefaults:It(S.documentElement),onDiagnostic:e.onDiagnostic})}catch(f){e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:c,runtimeCompositionId:s,hostCompositionSrc:o,errorMessage:f instanceof Error?f.message:"unknown_error"}}),Er(r)}}))}function im(e,t,n){let r={...e.declaredVariableDefaults??(t instanceof Element?It(t):{}),...So(e.host)};bo(e.host),Object.keys(r).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[n]=r,xi(e.host,{...xo(e.host,r,window),...An()})):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[n]}function rm(e){return e instanceof HTMLElement?e.dataset.captionWrapper!=="true"?e:e.querySelector(":scope > span")??null:null}function om(){let e=[],t=document.querySelectorAll(".caption-group");for(let n of t)for(let i of n.children){if(!(i instanceof HTMLElement))continue;let r=i.dataset.captionWrapper==="true"?i.querySelector(":scope > span"):i.tagName==="SPAN"?i:null;r&&e.push(r)}return e}function sm(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 Cr(){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=om();for(let i of t){let r=null;if(i.wordId&&(r=rm(document.getElementById(i.wordId))),!r&&i.wordIndex!==void 0&&(r=n[i.wordIndex]??null),!r)continue;let o={},a={};if(i.x!==void 0&&(o.x=i.x),i.y!==void 0&&(o.y=i.y),i.scale!==void 0&&(o.scale=i.scale),i.rotation!==void 0&&(o.rotation=i.rotation),i.opacity!==void 0&&(a.opacity=i.opacity),i.fontSize!==void 0&&(a.fontSize=`${i.fontSize}px`),i.fontWeight!==void 0&&(a.fontWeight=i.fontWeight),i.fontFamily!==void 0&&(a.fontFamily=i.fontFamily),i.activeColor||i.dimColor){let s=e.getTweensOf(r).filter(f=>f.vars.color!==void 0).sort((f,p)=>f.startTime()-p.startTime()),l=s[0]?String(s[0].vars.color):"";for(let f of s)String(f.vars.color)===l?i.dimColor&&(f.vars.color=i.dimColor):i.activeColor&&(f.vars.color=i.activeColor);i.dimColor&&e.set(r,{color:i.dimColor})}if(Object.keys(a).length>0&&e.set(r,a),Object.keys(o).length>0){let c=sm(r);e.set(c,o)}}}).catch(()=>{})}var Tr="data-hf-edit-base-x",vr="data-hf-edit-base-y",Ct="data-hf-edit-original-translate",zn=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},am=e=>{let t=[],n=0,i="";for(let r of e.trim())r==="("&&(n+=1),r===")"&&(n=Math.max(0,n-1)),/\s/.test(r)&&n===0?(i&&t.push(i),i=""):i+=r;return i&&t.push(i),t},dl=/^-?(?:\d+(?:\.\d+)?|\.\d+)px$/,_r=(e,t)=>dl.test(e)&&dl.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,lm=(e,t,n)=>{if(!e||e==="none")return`${t} ${n}`;let[i,r,o]=am(e);if(i===void 0)return`${t} ${n}`;if(r===void 0)return`${_r(i,t)} ${n}`;let a=o===void 0?"":` ${o}`;return`${_r(i,t)} ${_r(r,n)}${a}`},um=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},cm=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let n=e.ownerDocument.defaultView,i=n?n.getComputedStyle(e).getPropertyValue("translate").trim():"";return i==="none"?"":i}catch{return""}},Fr=new WeakMap;function dm(e,t){let n=Fr.get(e);if(!t?.force&&n!==void 0&&e.style.getPropertyValue("translate")!==n){Ye("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let i=zn(e.getAttribute("data-x"))-zn(e.getAttribute(Tr)),r=zn(e.getAttribute("data-y"))-zn(e.getAttribute(vr));e.hasAttribute(Ct)||e.setAttribute(Ct,cm(e)),n===void 0&&um(e);let o=e.getAttribute(Ct)??"",a=lm(o,`${i}px`,`${r}px`);e.style.setProperty("translate",a),Fr.set(e,e.style.getPropertyValue("translate"))}function jn(e,t){let n=e.defaultView?.HTMLElement,i=e.defaultView?.SVGElement,r=s=>n||i?n!==void 0&&s instanceof n||i!==void 0&&s instanceof i:typeof s.style?.setProperty=="function",o=e.querySelectorAll(`[${Ct}]:not([${Tr}]):not([${vr}])`);for(let s=0;s<o.length;s++){let l=o[s];if(l===void 0||!r(l))continue;let f=l.getAttribute(Ct)??"";f===""?l.style.removeProperty("translate"):l.style.setProperty("translate",f),l.removeAttribute(Ct),Fr.delete(l)}let a=e.querySelectorAll(`[${Tr}], [${vr}]`),c=0;for(let s=0;s<a.length;s++){let l=a[s];l===void 0||!r(l)||(dm(l,t),c+=1)}return c}var fl="__hfPositionEditsSeekReapplyWrapped",ml=new WeakSet,pl=new WeakMap,hl=new WeakMap;function gl(e){let t=e,n=()=>{try{jn(t.document)}catch{}},i=p=>typeof p=="function"&&(ml.has(p)||!!p[fl]),r=p=>{ml.add(p);try{Object.defineProperty(p,fl,{value:!0})}catch{}},o=p=>{if(typeof p!="function"||i(p))return p;let d=function(...x){let S=p.apply(this,x);return n(),S};return r(d),d},a=(p,d)=>{let x=pl.get(p);if(x?.has(d))return!0;let S=Object.getOwnPropertyDescriptor(p,d);if(S?.configurable===!1){let A=p[d];return typeof A=="function"&&(p[d]=o(A),n()),!1}let y=p[d],b=S?.set;return Object.defineProperty(p,d,{configurable:!0,enumerable:S?.enumerable??!0,get:()=>y,set:A=>{y=o(A),b?.call(p,A)}}),y=o(y),x??(x=new Set),x.add(d),pl.set(p,x),n(),!0},c=(p,d)=>{let x=hl.get(t),S=Object.getOwnPropertyDescriptor(t,p);if(!x?.has(p)){if(S?.configurable===!1){let A=t[p];return A?a(A,d):!1}let b=t[p];Object.defineProperty(t,p,{configurable:!0,enumerable:S?.enumerable??!0,get:()=>b,set:A=>{b=A,b&&a(b,d)}}),x??(x=new Set),x.add(p),hl.set(t,x)}let y=t[p];return y?a(y,d):!1},s=()=>{let p=c("__hf","seek"),d=c("__player","renderSeek");return p&&d};if(s())return;let l=120,f=t.setInterval(()=>{if(s()){t.clearInterval(f);return}l-=1,l<=0&&t.clearInterval(f)},50)}function $n(e){let t=window,i=e.closest("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()??"",r=i?t.__hfVariablesByComp?.[i]:void 0;if(r)return r;let o=t.__hyperframes?.getVariables?.();return o&&typeof o=="object"?o:t.__hfVariables??{}}function qn(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var xl=new Set(["img","video","audio","source"]);function fm(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 mm(e){let t=e.replace(/[\u0000-\u0020]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(t);if(!n)return!0;let i=n[1]?.toLowerCase();return i?i==="https"||i==="http"||i==="blob"?!0:i==="data"?/^data:image\//i.test(t):!1:!1}function pm(e){return e.replace(/[;{}<>\r\n]/g,"")}function hm(e){if(qn(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 Mr(e,t){let n=e.closest("[data-composition-id]"),i=t.get(n);if(i)return i;let r=$n(e);return t.set(n,r),r}function gm(e,t){if(e.childElementCount===0){e.textContent=t;return}let n=!1;for(let i of Array.from(e.childNodes))i.nodeType===Node.TEXT_NODE&&(i.nodeValue=n?"":t,n=!0);n||e.insertBefore(e.ownerDocument.createTextNode(t),e.firstChild)}function xm(e){return e.querySelector("[data-hf-root]")??e.getElementById("stage")??e.body?.firstElementChild??e.body}function bm(e,t){let n=new Set,i=xm(e);i&&n.add(i);for(let r of Array.from(e.querySelectorAll("[data-composition-id]")))n.add(r);for(let r of n){let o=Mr(r,t);for(let[a,c]of Object.entries(o)){let s=hm(c);s!==null&&r instanceof HTMLElement&&r.style.setProperty(`--${a}`,pm(s))}}}function Nr(e){let t=new Map;bm(e,t);for(let n of Array.from(e.querySelectorAll("[data-var-src]"))){let i=n.getAttribute("data-var-src")?.trim();if(!i)continue;if(!xl.has(n.tagName.toLowerCase())){console.warn(`[hyperframes] Ignoring data-var-src on <${n.tagName.toLowerCase()}>: variable-bound src is only allowed on ${Array.from(xl).join("/")}.`);continue}let r=fm(Mr(n,t)[i]);if(r!==null){if(!mm(r)){console.warn(`[hyperframes] Ignoring data-var-src="${i}": unsafe URL protocol.`);continue}n.setAttribute("src",r)}}for(let n of Array.from(e.querySelectorAll("[data-var-text]"))){let i=n.getAttribute("data-var-text")?.trim();if(!i)continue;let r=Mr(n,t)[i];qn(r)&&gm(n,String(r))}}var $e=new Map,ym="data-hf-color-grading-canvas",Sm="__hf_color_grading_canvas__";function Cl(){if(typeof MutationObserver>"u"||typeof document>"u")return;let e=document.documentElement;if(!e)return;let t=i=>{i instanceof HTMLElement&&(i.hasAttribute(Tn)||i.setAttribute(Tn,i.style.opacity))},n=i=>{if(i instanceof Element){i.hasAttribute(Ve)&&t(i);for(let r of i.querySelectorAll(`[${Ve}]`))t(r)}};n(e),new MutationObserver(i=>{for(let r of i){for(let o of r.addedNodes)n(o);r.type==="attributes"&&r.target instanceof Element&&r.target.hasAttribute(Ve)&&t(r.target)}}).observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[Ve]})}var Em=16,cn={enabled:!1,position:.5,softness:0,lineWidth:2};function Rr(e){let t=e.getAttribute(Ve);return t==null?null:cs(t,$n(e))}var Am=["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(`
|
|
349
|
-
`),wm=["#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_lut;","uniform vec2 u_resolution;","uniform vec2 u_uvScale;","uniform vec2 u_uvOffset;","uniform float u_blurReady;","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 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_blur;","uniform float u_pixelate;","uniform float u_intensity;","uniform float u_compareEnabled;","uniform float u_comparePosition;","uniform float u_compareSoftness;","uniform float u_compareLineWidth;","float lumaOf(vec3 c){ return dot(c, vec3(0.2126, 0.7152, 0.0722)); }","float grainHash(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123); }","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)); }","vec4 sampleSource(vec2 uv){ return texture2D(u_source, clampUv(uv)); }","vec4 sampleBlur(vec2 uv){ return texture2D(u_blurSource, clampUv(uv)); }","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;"," }"," vec4 base = sampleSource(sampleUv);"," float blur = clamp(u_blur, 0.0, 1.0);"," if (blur > 0.0 && u_blurReady > 0.5) {"," base = mix(base, sampleBlur(sampleUv), blur);"," }"," return base;","}","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));","}","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);"," vec4 sampleColor = sampleMedia(uv);"," vec3 original = originalSample.rgb;"," vec3 color = sampleColor.rgb * 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));"," color = clamp(color, 0.0, 1.0);"," color = clamp(applyLut(color), 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 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);"," }"," color = clamp(color, 0.0, 1.0);"," vec3 graded = mix(original, color, u_intensity);"," 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(`
|
|
350
|
-
`),
|
|
351
|
-
`);function ft(e){return e instanceof HTMLVideoElement||e instanceof HTMLImageElement}function bl(e,t,n){let i=e.createShader(n);return i?(e.shaderSource(i,t),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS)?i:(v("runtime.colorGrading.compileShader",e.getShaderInfoLog(i)),e.deleteShader(i),null)):null}function _l(e,t=wm){let n=bl(e,Am,e.VERTEX_SHADER),i=bl(e,t,e.FRAGMENT_SHADER);if(!n||!i)return n&&e.deleteShader(n),i&&e.deleteShader(i),null;let r=e.createProgram();return r?(e.attachShader(r,n),e.attachShader(r,i),e.linkProgram(r),e.deleteShader(n),e.deleteShader(i),e.getProgramParameter(r,e.LINK_STATUS)?r:(v("runtime.colorGrading.linkProgram",e.getProgramInfoLog(r)),e.deleteProgram(r),null)):null}function kr(e,t=e.LINEAR){let n=e.createTexture();return n?(e.bindTexture(e.TEXTURE_2D,n),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,e.UNSIGNED_BYTE,null),n):null}function _m(e,t){let n=_l(e,Cm);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")}:null}function yl(e){let t=kr(e),n=e.createFramebuffer();if(!t||!n)return t&&e.deleteTexture(t),n&&e.deleteFramebuffer(n),null;e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0);let i=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),i!==e.FRAMEBUFFER_COMPLETE?(e.deleteTexture(t),e.deleteFramebuffer(n),null):{texture:t,framebuffer:n,width:1,height:1}}function Sl(e,t,n,i){t.width===n&&t.height===i||(t.width=n,t.height=i,e.bindTexture(e.TEXTURE_2D,t.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,i,0,e.RGBA,e.UNSIGNED_BYTE,null))}function Tl(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!0});if(!t)return null;let n=_l(t),i=kr(t),r=kr(t,t.NEAREST);if(!n||!i||!r)return n&&t.deleteProgram(n),i&&t.deleteTexture(i),r&&t.deleteTexture(r),null;let o=t.createBuffer();return o?(t.bindBuffer(t.ARRAY_BUFFER,o),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW),{gl:t,program:{program:n,texture:i,lutTexture:r,quad:o,position:t.getAttribLocation(n,"a_pos"),source:t.getUniformLocation(n,"u_source"),blurSource:t.getUniformLocation(n,"u_blurSource"),lut:t.getUniformLocation(n,"u_lut"),resolution:t.getUniformLocation(n,"u_resolution"),uvScale:t.getUniformLocation(n,"u_uvScale"),uvOffset:t.getUniformLocation(n,"u_uvOffset"),blurReady:t.getUniformLocation(n,"u_blurReady"),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"),exposure:t.getUniformLocation(n,"u_exposure"),contrast:t.getUniformLocation(n,"u_contrast"),highlights:t.getUniformLocation(n,"u_highlights"),shadows:t.getUniformLocation(n,"u_shadows"),whites:t.getUniformLocation(n,"u_whites"),blacks:t.getUniformLocation(n,"u_blacks"),temperature:t.getUniformLocation(n,"u_temperature"),tint:t.getUniformLocation(n,"u_tint"),vibrance:t.getUniformLocation(n,"u_vibrance"),saturation:t.getUniformLocation(n,"u_saturation"),vignette:t.getUniformLocation(n,"u_vignette"),vignetteMidpoint:t.getUniformLocation(n,"u_vignetteMidpoint"),vignetteRoundness:t.getUniformLocation(n,"u_vignetteRoundness"),vignetteFeather:t.getUniformLocation(n,"u_vignetteFeather"),grain:t.getUniformLocation(n,"u_grain"),grainSize:t.getUniformLocation(n,"u_grainSize"),grainRoughness:t.getUniformLocation(n,"u_grainRoughness"),grainSeed:t.getUniformLocation(n,"u_grainSeed"),blur:t.getUniformLocation(n,"u_blur"),pixelate:t.getUniformLocation(n,"u_pixelate"),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")}}):(t.deleteProgram(n),t.deleteTexture(i),t.deleteTexture(r),null)}function Tm(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vm(e){if(!Tm(e))return{...cn};let t=(n,i,r,o)=>{let a=typeof n=="number"?n:Number(n);return Math.min(o,Math.max(r,Number.isFinite(a)?a:i))};return{enabled:e.enabled===!0,position:t(e.position,cn.position,0,1),softness:t(e.softness,cn.softness,0,.25),lineWidth:t(e.lineWidth,cn.lineWidth,0,12)}}function vl(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 Ir(e){return e instanceof Error?e.message:"LUT failed to load"}function Fm(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 Mm(e){let t=e.id||e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return Fm(t)}function Nm(e){let t=vl(e);if("error"in t)return{state:"error",message:t.error};let n=$e.get(t.href);if(n)return n;let i=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=>Qo(o,{maxSize:_n})),r={state:"pending",promise:i};for(;$e.size>=Em;){let o=$e.keys().next().value;if(!o)break;$e.delete(o)}return $e.set(t.href,r),i.then(o=>{$e.get(t.href)===r&&$e.set(t.href,{state:"ready",lut:o})},o=>{$e.get(t.href)===r&&$e.set(t.href,{state:"error",message:Ir(o)})}),r}function El(e,t,n){if(e.lut?.src===t)return e.lut;let i=Zo(n),{gl:r,program:o}=e;try{return r.activeTexture(r.TEXTURE2),r.bindTexture(r.TEXTURE_2D,o.lutTexture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,i.width,i.height,0,r.RGBA,r.UNSIGNED_BYTE,i.data),e.lut={src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:i.width,textureHeight:i.height},e.lutError=null,e.lutLoadingSrc=null,e.lut}catch(a){return e.lut=null,e.lutError=Ir(a),e.lutLoadingSrc=null,v("runtime.colorGrading.uploadLut",a),null}}function Kn(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function Fl(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),Kn(e.gl,t.scratch),Kn(e.gl,t.blur),e.effectTargets=null)}function Ml(e){Fl(e),e.gl.deleteTexture(e.program.texture),e.gl.deleteTexture(e.program.lutTexture),e.gl.deleteBuffer(e.program.quad),e.gl.deleteProgram(e.program.program)}function Rm(e){let t=Tl(e.canvas);return t?(Ml(e),e.gl=t.gl,e.program=t.program,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function Dr(e){if(!e.sourceHidden)return;e.element.removeAttribute(Gt);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 Lm(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=_m(t,e.program.quad),i=yl(t),r=yl(t);return!n||!i||!r?(n&&t.deleteProgram(n.program),i&&Kn(t,i),r&&Kn(t,r),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:i,blur:r},e.effectTargets)}function km(e,t,n,i,r){let o=Math.max(1,Math.ceil(i)),a=Math.max(1,Math.ceil(r));return Sl(e,t,o,a),Sl(e,n,o,a),{width:o,height:a}}function Al(e,t,n,i,r,o,a){e.bindFramebuffer(e.FRAMEBUFFER,i.framebuffer),e.viewport(0,0,r.width,r.height),e.useProgram(t.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(t.source,0),e.uniform2f(t.resolution,r.width,r.height),e.uniform2f(t.direction,o.x,o.y),e.uniform1f(t.radius,a),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 Dm(e,t,n,i,r,o,a){let c=n;for(let s=0;s<Math.max(1,Math.floor(a));s++)Al(e,t.blurProgram,c,t.scratch,r,{x:1,y:0},o),Al(e,t.blurProgram,t.scratch.texture,i,r,{x:0,y:1},o),c=i.texture}function Im(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 i=vl(t);if("error"in i)return e.lut=null,e.lutLoadingSrc=null,e.lutError=i.error,null;if(e.lut?.src===i.href)return e.lut;e.lut=null;let r=Nm(t);return r.state==="ready"?El(e,i.href,r.lut):r.state==="error"?(e.lutError=r.message,e.lutLoadingSrc=null,null):(e.lutLoadingSrc!==i.href&&(e.lutLoadingSrc=i.href,e.lutError=null,r.promise.then(o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(El(e,i.href,o),De(e))},o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=Ir(o),e.lutLoadingSrc=null,De(e))})),null)}function Lr(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&&ft(n))return n;try{let i=document.querySelector(t);return i&&ft(i)?i:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&ft(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&ft(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)),i=t[n]??null;return i&&ft(i)?i:null}catch{return null}}function Pm(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 Nl(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 Om(e){if(!e.id)return null;let t=document.getElementById(`__render_frame_${e.id}__`);return t instanceof HTMLImageElement&&Nl(t)?t:null}function Bm(e){return e instanceof HTMLImageElement&&e.classList.contains("__render_frame__")}function Gm(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}function Hm(e){if(e instanceof HTMLVideoElement){let t=Om(e);if(t)return t}return Nl(e)?e:null}function wl(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 i=Number.parseFloat(n);return Number.isFinite(i)?i/100:null}return null}function Um(e){let t=e.trim().split(/\s+/).filter(Boolean),n=.5,i=.5;for(let r=0;r<t.length;r++){let o=t[r]??"",a=wl(o,"x"),c=wl(o,"y");if(a!==null&&(o==="left"||o==="right"||o.endsWith("%")&&r===0)){n=a;continue}if(c!==null&&(o==="top"||o==="bottom"||o.endsWith("%")&&r>0)){i=c;continue}}return{x:n,y:i}}function Wm(e,t,n,i,r,o){if(e<=0||t<=0||n<=0||i<=0)return{scaleX:1,scaleY:1,offsetX:0,offsetY:0};let a=r||"fill",c=e,s=t;if(a==="contain"||a==="cover"||a==="scale-down"){let d=a==="cover"?Math.max(e/n,t/i):Math.min(e/n,t/i);c=n*d,s=i*d,a==="scale-down"&&c>n&&s>i&&(c=n,s=i)}else a==="none"&&(c=n,s=i);let l=Um(o||"center"),f=(e-c)*l.x/e,p=(t-s)*l.y/t;return{scaleX:c/e,scaleY:s/t,offsetX:f,offsetY:p}}function Vm(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function zm(e,t){let{element:n,canvas:i}=e,r=n.parentElement;r&&Vm(e,r);let o=window.getComputedStyle(t);fs(i.style,o),i.style.pointerEvents="none",i.style.position="absolute",i.style.inset="auto",i.style.left=`${n.offsetLeft}px`,i.style.top=`${n.offsetTop}px`,i.style.right="auto",i.style.bottom="auto",i.style.width=`${n.offsetWidth}px`,i.style.height=`${n.offsetHeight}px`,i.style.display="block",i.style.opacity=e.sourceOpacityForCanvas,i.style.visibility=e.sourceVisibleForCanvas?"visible":"hidden";let a=n.getBoundingClientRect(),c=Math.max(0,Math.round(n.offsetWidth||a.width)),s=Math.max(0,Math.round(n.offsetHeight||a.height));return c<=0||s<=0?(i.style.display="none",null):(i.width!==c&&(i.width=c),i.height!==s&&(i.height=s),{width:c,height:s})}function jm(e,t,n,i,r,o,a,c,s){e.uniform1i(t.source,0),e.uniform1i(t.blurSource,1),e.uniform1i(t.lut,2),e.uniform2f(t.resolution,a.width,a.height),e.uniform2f(t.uvScale,c.scaleX,c.scaleY),e.uniform2f(t.uvOffset,c.offsetX,c.offsetY),e.uniform1f(t.blurReady,r?1:0),e.uniform1f(t.lutEnabled,i?1:0),e.uniform1f(t.lutSize,i?.size??2),e.uniform2f(t.lutTextureSize,i?.textureWidth??1,i?.textureHeight??1),e.uniform3f(t.lutDomainMin,i?.domainMin[0]??0,i?.domainMin[1]??0,i?.domainMin[2]??0),e.uniform3f(t.lutDomainMax,i?.domainMax[0]??1,i?.domainMax[1]??1,i?.domainMax[2]??1),e.uniform1f(t.lutIntensity,n.lut?.intensity??0),e.uniform1f(t.exposure,n.adjust.exposure),e.uniform1f(t.contrast,n.adjust.contrast),e.uniform1f(t.highlights,n.adjust.highlights),e.uniform1f(t.shadows,n.adjust.shadows),e.uniform1f(t.whites,n.adjust.whites),e.uniform1f(t.blacks,n.adjust.blacks),e.uniform1f(t.temperature,n.adjust.temperature),e.uniform1f(t.tint,n.adjust.tint),e.uniform1f(t.vibrance,n.adjust.vibrance),e.uniform1f(t.saturation,n.adjust.saturation),e.uniform1f(t.vignette,n.details.vignette),e.uniform1f(t.vignetteMidpoint,n.details.vignetteMidpoint),e.uniform1f(t.vignetteRoundness,n.details.vignetteRoundness),e.uniform1f(t.vignetteFeather,n.details.vignetteFeather),e.uniform1f(t.grain,n.details.grain),e.uniform1f(t.grainSize,n.details.grainSize),e.uniform1f(t.grainRoughness,n.details.grainRoughness),e.uniform1f(t.grainSeed,s),e.uniform1f(t.blur,n.effects.blur),e.uniform1f(t.pixelate,n.effects.pixelate),e.uniform1f(t.intensity,n.intensity),e.uniform1f(t.compareEnabled,o.enabled?1:0),e.uniform1f(t.comparePosition,o.position),e.uniform1f(t.compareSoftness,o.softness),e.uniform1f(t.compareLineWidth,o.lineWidth)}function $m(e){if(!e.sourceHidden){let t=e.element.getAttribute(Tn);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(Gt,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function De(e){if(e.destroyed||e.contextLost)return!1;let t=Hm(e.element);if(!t)return e.hasDrawn||(e.canvas.style.display="none"),!1;let n=Pm(t);if(!n)return!1;let i=t instanceof HTMLElement?t:e.element,r=e.element.style.getPropertyValue("opacity"),o=e.element.style.getPropertyPriority("opacity"),a=e.sourceHidden&&r==="0"&&o==="important",c=e.element.style.getPropertyValue("visibility"),s=Bm(t);if(s&&Gm(e,t),s||!a){let S=window.getComputedStyle(s?t:e.element);e.sourceOpacityForCanvas=S.opacity||"1",e.sourceVisibleForCanvas=(s||c!=="hidden")&&S.visibility!=="hidden"}let l=zm(e,i);if(!l)return!1;let f=window.getComputedStyle(i),p=Wm(l.width,l.height,n.width,n.height,f.objectFit,f.objectPosition),{gl:d,program:x}=e;try{let S=Im(e);d.activeTexture(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,x.texture),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!0),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,t);let y=!1,b=Math.min(1,Math.max(0,e.grading.effects.blur));if(b>0){let _=Lm(e);if(_){let M=km(d,_.scratch,_.blur,l.width,l.height);Dm(d,_,x.texture,_.blur,M,.75+Math.pow(b,1.35)*32,b>.55?3:2),y=!0}}else e.effectError=null,e.effectTargets&&Fl(e);d.bindFramebuffer(d.FRAMEBUFFER,null),d.viewport(0,0,l.width,l.height),d.useProgram(x.program),d.activeTexture(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,x.texture),d.activeTexture(d.TEXTURE1),d.bindTexture(d.TEXTURE_2D,e.effectTargets?.blur.texture??x.texture),d.activeTexture(d.TEXTURE2),d.bindTexture(d.TEXTURE_2D,x.lutTexture);let A=e.grainSeed+(e.element instanceof HTMLVideoElement?Math.floor(e.element.currentTime*60):0);return jm(d,x,e.grading,S,y,e.compare,l,p,A),d.bindBuffer(d.ARRAY_BUFFER,x.quad),d.enableVertexAttribArray(x.position),d.vertexAttribPointer(x.position,2,d.FLOAT,!1,0,0),d.drawArrays(d.TRIANGLE_STRIP,0,4),$m(e),e.hasDrawn=!0,e.drawError=null,!0}catch(S){return e.drawError=S instanceof Error?S.message:"Shader draw failed",v("runtime.colorGrading.drawEntry",S),!1}}function He(e,t,n,i){t.addEventListener(n,i),e.cleanup.push(()=>t.removeEventListener(n,i))}function qm(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 dn(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&&dn(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,De(e),!e.destroyed&&!t.paused&&!t.ended&&dn(e)})}function Km(e){let t=()=>{De(e)};if(He(e,e.element,"load",t),He(e,e.element,"loadedmetadata",t),He(e,e.element,"loadeddata",t),He(e,e.element,"seeked",t),He(e,e.element,"timeupdate",t),He(e,window,"resize",t),e.element instanceof HTMLVideoElement&&(He(e,e.element,"play",()=>dn(e)),He(e,e.element,"pause",t)),He(e,e.canvas,"webglcontextlost",n=>{n.preventDefault(),e.contextLost=!0,e.drawError="WebGL context lost",e.canvas.style.display="none",Dr(e)}),He(e,e.canvas,"webglcontextrestored",()=>{if(e.contextLost=!1,!Rm(e)){e.contextLost=!0,e.drawError="WebGL context restore failed",Dr(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}`},i=n(),r=!1,o=new MutationObserver(()=>{r||n()!==i&&(r=!0,requestAnimationFrame(()=>{r=!1,i=n(),De(e)}))});o.observe(e.element,{attributes:!0,attributeFilter:["style"]}),e.cleanup.push(()=>o.disconnect())}}function Ym(e){if(!e.destroyed){e.destroyed=!0,qm(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();e.cleanup.length=0,e.canvas.remove(),Ml(e),Dr(e),e.touchedParent&&(e.parentInlinePosition===null?e.touchedParent.style.removeProperty("position"):e.touchedParent.style.position=e.parentInlinePosition)}}function Jm(e){let t=document.createElement("canvas");return e.id&&(t.id=`${ss}${e.id}`),t.className=Sm,t.setAttribute(ym,"true"),t.setAttribute("data-hyperframes-ignore",""),t.setAttribute("data-hyperframes-picker-ignore",""),t.setAttribute("data-hf-ignore",""),t.setAttribute("aria-hidden","true"),t.style.pointerEvents="none",t.style.display="none",e.parentNode?.insertBefore(t,e.nextSibling),t}function Rl(){let e=new WeakMap,t=new Set,n=null,i=!1,r=(y,b,A)=>{let _=e.get(y);if(_)return _.grading=b,_.source=A,De(_),y instanceof HTMLVideoElement&&!y.paused&&dn(_),!0;let M=Jm(y),H=Tl(M);if(!H)return M.remove(),!1;let D={element:y,canvas:M,gl:H.gl,program:H.program,grading:b,compare:{...cn},lut:null,lutLoadingSrc:null,lutError:null,drawError:null,effectTargets:null,effectError:null,source:A,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(y).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(y).visibility!=="hidden",hasDrawn:!1,contextLost:!1,grainSeed:Mm(y),destroyed:!1};return e.set(y,D),t.add(y),Km(D),De(D),y instanceof HTMLVideoElement&&!y.paused&&dn(D),!0},o=(y,b)=>{if(i)return!1;let A=Lr(y);if(!A)return!1;let _=e.get(A);if(!_){let M=Rr(A);if(!Ht(M)||!r(A,M,"attribute"))return!1;_=e.get(A)}return _?(_.compare=vm(b),De(_),!0):!1},a=y=>{let b=e.get(y);b&&(Ym(b),e.delete(y),t.delete(y))},c=()=>{if(i)return 0;let y=new Set;document.querySelectorAll(`video[${Ve}], img[${Ve}]`).forEach(A=>{if(!ft(A))return;y.add(A);let _=Rr(A);Ht(_)?r(A,_,"attribute"):a(A)});for(let A of Array.from(t)){let _=e.get(A);_&&(!A.isConnected||_.source==="attribute"&&!y.has(A))&&a(A)}return t.size},s=()=>{if(i)return 0;let y=0;for(let b of Array.from(t,A=>e.get(A)))b&&De(b)&&(y+=1);return y},l=(y,b)=>{if(i)return!1;let A=Lr(y);if(!A)return!1;let _=Pi(b);return Ht(_)?r(A,_,"live"):(a(A),!0)},f=(y,b)=>{if(!ft(y))return!1;let A=e.get(y);return A?(A.sourceVisibleForCanvas=b,!0):!1},p=y=>{let b=Lr(y);if(!b)return{state:"missing",message:"Media not found"};let A=e.get(b);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 _=Rr(b);return Ht(_)?{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},d=()=>{if(!i){i=!0,n?.disconnect(),n=null;for(let y of Array.from(t))a(y)}};document.body&&(n=new MutationObserver(()=>c()),n.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[Ve]}));let x={refresh:c,redraw:s,setGrading:l,setCompare:o,setSourceVisibility:f,getStatus:p,destroy:d},S=window;return S.__hf=S.__hf||{},S.__hf.colorGrading=x,c(),x}var Yn=class{constructor(t){me(this,"_baseTime",0);me(this,"_playStartMs",null);me(this,"_rate",1);me(this,"_duration",1/0);me(this,"_nowMs");me(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 i=null;if("currentTimeSeconds"in this._audioSource)i=this._audioSource.currentTimeSeconds;else{let{el:r,compositionStart:o,mediaStart:a}=this._audioSource;!r.paused&&Number.isFinite(r.currentTime)&&(i=(r.currentTime-a)/(r.playbackRate>0?r.playbackRate:1)*this._rate+o)}if(i!==null)return Number.isFinite(this._duration)&&i>=this._duration?this._duration:Math.max(0,i)}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}};function Ll(e){return!Number.isFinite(e)||e<=0?1:e}function Xm(e,t){t||e.paused||!yn().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function Qm(e,t){let{elapsed:n,mediaStart:i,scheduledAt:r,safeRate:o,clipDuration:a}=t,c=Number.isFinite(a)&&a>0,s=a*o;if(n>=0){let f=s-n;return c&&f<=0?!1:(c?e.start(0,n+i,f):e.start(0,n+i),!0)}let l=-n/o;return c?e.start(r+l,i,s):e.start(r+l,i),!0}var Jn=class{constructor(){me(this,"_ctx",null);me(this,"_bufferCache",new Map);me(this,"_failedSrcs",new Set);me(this,"_activeSources",[]);me(this,"_masterGain",null);me(this,"_rateAnchorCtx",0);me(this,"_rateAnchorComp",0);me(this,"_rate",1);me(this,"_paused",!0);me(this,"_playGeneration",0)}async init(){try{return this._ctx=new AudioContext,this._masterGain=this._ctx.createGain(),this._masterGain.connect(this._ctx.destination),!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 i;try{let r=await fetch(n,{cache:"no-store"});if(!r.ok)return v("webAudioTransport.fetch",new Error(`${r.status} ${n}`)),null;i=await r.arrayBuffer()}catch(r){return v("webAudioTransport.fetch",r),null}try{let r=await this._ctx.decodeAudioData(i);return this._bufferCache.set(n,r),r}catch(r){return this._failedSrcs.add(n),v("webAudioTransport.decode",r),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}async schedulePlayback(t,n,i,r,o,a,c,s=1,l=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||c!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),c!==this._playGeneration)return null;let f=Ll(s),p=this._ctx.createBufferSource();p.buffer=n,p.playbackRate.value=f;let d=this._ctx.createGain();d.gain.value=a,p.connect(d),d.connect(this._masterGain);let x=o-i,S=this._ctx.currentTime;if(this._rate=f,this._rateAnchorCtx=S,this._rateAnchorComp=o,!Qm(p,{elapsed:x,mediaStart:r,scheduledAt:S,safeRate:f,clipDuration:l}))return p.disconnect(),d.disconnect(),null;let y=t.muted;t.muted=!0,Xm(t,y);let b={el:t,sourceNode:p,gainNode:d,compositionStart:i,mediaStart:r,scheduledAt:S,priorMuted:y,bounded:Number.isFinite(l)&&l>0};return this._activeSources.push(b),this._paused=!1,p.addEventListener("ended",()=>{let A=this._activeSources.indexOf(b);A!==-1&&(this._activeSources.splice(A,1),t.muted=y,this._activeSources.length===0&&(this._paused=!0))}),b}catch(f){return v("webAudioTransport.schedule",f),null}}setRate(t){let n=Ll(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 i of this._activeSources)try{i.sourceNode.playbackRate.value=n}catch(r){v("webAudioTransport.setRate",r)}return!0}hasBoundedActiveSources(){return this._activeSources.some(t=>t.bounded)}stopAll(){for(let t of this._activeSources){try{t.sourceNode.stop(),t.sourceNode.disconnect(),t.gainNode.disconnect()}catch{}t.el.muted=t.priorMuted}this._activeSources=[],this._paused=!0}setVolume(t){this._masterGain&&(this._masterGain.gain.value=Math.max(0,Math.min(1,t)))}setElementVolume(t,n){let i=Math.max(0,Math.min(1,n));for(let r of this._activeSources)if(r.el===t)try{r.gainNode.gain.value=i}catch(o){v("webAudioTransport.setElementVolume",o)}}setMuted(t){this._masterGain&&(this._masterGain.gain.value=t?0:1)}isActive(){return this._activeSources.length>0&&!this._paused}ownsElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t)}destroy(){if(this.stopAll(),this._bufferCache.clear(),this._failedSrcs.clear(),this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null}};var kl="data-hf-studio-manual-edit-gesture";function Dl(e){return!Number.isInteger(e.tick)||e.tick<=0||e.tick%60!==0?!1:!(e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2)}var Pr="data-hf-authored-duration",Or="data-hf-authored-end",Il=!1;function qe(e){if(e){if(typeof e.pause!="function"){Il||(Il=!0,Ye("timeline_missing_pause",{}));return}try{e.pause()}catch(t){v("runtime.timeline.pause",t)}}}function Zm(){let e=window.__HF_EXPORT_RENDER_SEEK_CONFIG,t=e?.fps,n=e?.fpsSource,i=Number(t);return!e||t==null?{fps:null,source:"default",rawFpsSource:n,rawFps:t,fallbackReason:"missing"}:!Number.isFinite(i)||i<=0?{fps:null,source:"default",rawFpsSource:n,rawFps:t,fallbackReason:"invalid"}:{fps:i,source:n==="render-options"||n==="default"?n:"unknown",rawFpsSource:n,rawFps:t,fallbackReason:e.fpsFallbackReason}}function Pl(){let e=hs();jn(document),Nr(document);let t=Zm();e.canonicalFps=t.fps??e.canonicalFps,fo(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG&&console.info("[hyperframes] render runtime fps",{canonicalFps:e.canonicalFps,source:t.source,rawFpsSource:t.rawFpsSource,rawFps:t.rawFps,fallbackReason:t.fallbackReason});let n=null,i=null,r=null,o=[],a=new Set,c=null;if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(u){v("runtime.init.site1",u)}let s=new Yn;e.transportClock=s;let l=new Jn,f=!1;l.init().then(u=>{f=u}),(()=>{let u=window.gsap,m=window;if(!(!u?.registerPlugin||m.__hfAutoNoopRegistered))try{u.registerPlugin({name:"_auto",init:()=>!1}),m.__hfAutoNoopRegistered=!0}catch{}})(),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{yo(document)}catch(u){v("runtime.init.cssVariables",u)}window.__timelines=window.__timelines||{};let d=()=>{let u=document.querySelector('[data-composition-id][data-root="true"]');if(u instanceof HTMLElement)return u;let m=Array.from(document.querySelectorAll("[data-composition-id]"));return m.find(g=>!g.parentElement?.closest("[data-composition-id]"))??m[0]??null};if(Array.isArray(window.__timelines)){let u=window.__timelines,m=d()?.getAttribute("data-composition-id")??"root",g={};if(u.length===1)g[m]=u[0];else for(let h=0;h<u.length;h++)g[`tl-${h}`]=u[h];window.__timelines=g}let x=d();x&&!x.hasAttribute("data-start")&&x.setAttribute("data-start","0");let S=u=>{o.push(u)},y=(u,m,g)=>{let h=g??`${u}:${JSON.stringify(m)}`;a.has(h)||(a.add(h),he({source:"hf-preview",type:"diagnostic",code:u,details:m}))},b=u=>{let m={scale:1,focusX:960,focusY:540},g=[],h=[],E={time:u.getTime(),duration:u.getDuration(),isPlaying:u.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:u.play,pause:u.pause,seek:u.seek,getTime:u.getTime,getDuration:u.getDuration,isPlaying:u.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>m,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>g,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:u.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>h,getRenderState:()=>({...E,time:u.getTime(),duration:u.getDuration(),isPlaying:u.isPlaying()})}},A=1/60,_=.75,M=.05,H=100,D=240,F=u=>{if(u instanceof Error)return u.message||String(u);if(typeof u=="string")return u;try{return JSON.stringify(u)}catch{return String(u??"")}},w=u=>{let m=u.toLowerCase();return m.includes("cannot read properties of null")||m.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:m.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:m.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},C=u=>{if(u==null||u.trim()==="")return null;let m=Number.parseFloat(u);return!Number.isFinite(m)||m<=0?null:`${m}px`},T=()=>d(),R=()=>{let u=T();if(!u)return;let m=C(u.getAttribute("data-width")),g=C(u.getAttribute("data-height"));m&&(u.style.width=m),g&&(u.style.height=g),m&&u.style.setProperty("--comp-width",m),g&&u.style.setProperty("--comp-height",g)},L=()=>{let u=T(),m=Array.from(document.querySelectorAll("[data-composition-id]")).filter(g=>g.hasAttribute("data-duration")||g.hasAttribute("data-end"));for(let g of m){if(u&&g===u)continue;let h=g.getAttribute("data-duration"),E=g.getAttribute("data-end");h!=null&&!g.hasAttribute(Pr)&&g.setAttribute(Pr,h),E!=null&&!g.hasAttribute(Or)&&g.setAttribute(Or,E),g.removeAttribute("data-duration"),g.removeAttribute("data-end")}},z=()=>{let u=T();if(!u)return;u.style.position||(u.style.position="relative"),u.style.overflow="hidden";let m=C(u.getAttribute("data-width")),g=C(u.getAttribute("data-height"));m&&(u.style.width=m),g&&(u.style.height=g);let h=Array.from(u.children);for(let E of h){let N=E.tagName.toLowerCase();if(N==="script"||N==="style"||N==="link"||N==="meta"||!E.hasAttribute("data-start")||E.hasAttribute("data-hf-autostamped"))continue;let O=(E.style.top==="0px"||E.style.top==="0")&&(E.style.left==="0px"||E.style.left==="0")&&E.style.width==="100%"&&E.style.height==="100%",ee=/translate\(\s*-50%\s*,\s*-50%\s*\)/.test(E.style.transform);if(O&&ee&&!E.hasAttribute("data-width")&&!E.hasAttribute("data-height")){let ye=E.style.top,kt=E.style.left,Se=E.style.width,Dt=E.style.height;E.style.top="",E.style.left="",E.style.width="",E.style.height="";let ne=window.getComputedStyle(E);ne.top!=="auto"||ne.bottom!=="auto"||ne.left!=="auto"||ne.right!=="auto"||ne.width!=="0px"||ne.height!=="0px"||(E.style.top=ye,E.style.left=kt,E.style.width=Se,E.style.height=Dt)}let K=window.getComputedStyle(E),de=K.position;if(de!=="absolute"&&de!=="fixed"&&(E.style.position="absolute"),!!E.style.top||!!E.style.bottom||K.top!=="auto"||K.bottom!=="auto"||(E.style.top="0"),!!E.style.left||!!E.style.right||K.left!=="auto"||K.right!=="auto"||(E.style.left="0"),N!=="audio"){let ye=C(E.getAttribute("data-width")),kt=C(E.getAttribute("data-height")),Se=K.width!=="0px"&&K.width!=="auto",Dt=K.height!=="0px"&&K.height!=="auto";ye?!E.style.width&&!Se&&(E.style.width=ye):!E.style.width&&K.width==="0px"&&(E.style.width="100%"),kt?!E.style.height&&!Dt&&(E.style.height=kt):!E.style.height&&K.height==="0px"&&(E.style.height="100%")}}},P=(u,m=0,g)=>Xe({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:g?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(u,m),X=(u,m)=>Xe({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:m?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(u),I=(u,m=0)=>!u.hasAttribute("data-hf-auto-start")&&u.hasAttribute("data-start")?Math.max(0,Number(u.getAttribute("data-start")??0)||0)+m:P(u,m),ie=(u,m)=>{let g=u.tagName.toLowerCase();if(g==="script"||g==="style"||g==="link"||g==="meta")return!1;let h=g==="video"||g==="audio"?I(u,0):P(u,0),E=X(u),N=u.getAttribute("data-composition-id");if(N){let ee=(window.__timelines??{})[N],K=null;if(ee&&typeof ee.duration=="function"){let ge=Number(ee.duration());Number.isFinite(ge)&&ge>0&&(K=ge)}!(u.hasAttribute("data-duration")||u.hasAttribute("data-end")||u.hasAttribute(Pr)||u.hasAttribute(Or))&&(E==null||E<=0)&&K!=null&&(E=K)}let O=E!=null&&E>0?h+E:Number.POSITIVE_INFINITY;return m>=h&&(Number.isFinite(O)?m<O:!0)},Te=!!document.querySelector("[data-composition-src]"),j=!1;{let u=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let m of u){let g=m.getAttribute("data-composition-id");if(g&&m.children.length===0&&document.querySelector(`template#${CSS.escape(g)}-template`)){j=!0;break}}}let J=!Te&&!j,B=u=>{if(!u||typeof u.duration!="function")return null;try{let m=Number(u.duration());return Number.isFinite(m)?Math.max(0,m):null}catch{return null}},V=u=>typeof u=="number"&&Number.isFinite(u)&&u>A,Ae=u=>{let m=Number(u.getAttribute("data-duration"));if(Number.isFinite(m)&&m>0)return m;let g=Number(u.getAttribute("data-playback-start")??u.getAttribute("data-media-start")??"0"),h=Number.isFinite(g)?Math.max(0,g):0;return Number.isFinite(u.duration)&&u.duration>h?Math.max(0,u.duration-h):null},U=()=>{let u=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(u.length===0)return null;let m=0;for(let g of u){let h=I(g,0);if(!Number.isFinite(h))continue;let E=Ae(g);E==null||E<=A||(m=Math.max(m,Math.max(0,h)+E))}return m>A?m:null},k=()=>{let u=T();if(!u)return null;let m=window.__timelines??{},g=Xe({timelineRegistry:m,includeAuthoredTimingAttrs:!0}),h=0,E=Number.parseFloat(u.getAttribute("data-duration")??"");Number.isFinite(E)&&E>0&&(h=E);let N=Array.from(u.querySelectorAll("[data-composition-id][data-start]"));for(let O of N){if(!(O instanceof Element)||O.parentElement?.closest("[data-composition-id]")!==u)continue;let K=g.resolveStartForElement(O,0),de=g.resolveDurationForElement(O);!Number.isFinite(K)||de==null||de<=0||(h=Math.max(h,Math.max(0,K)+de))}return h>A?h:null},G=()=>{let u=U();return typeof u!="number"||!Number.isFinite(u)||u<=A?null:u},ae=u=>V(u)?Math.max(A,u*_):A,oe=()=>{let u=0;for(let m of e.deterministicAdapters){let g=m.getInferredDurationSeconds;if(typeof g!="function")continue;let h=null;try{h=g()}catch(E){v("runtime.init.adapterDuration",E)}typeof h=="number"&&Number.isFinite(h)&&h>0&&(u=Math.max(u,h))}return u>A?u:null},W=(u,m=0)=>{let g=B(u),h=G(),E=k(),N=oe(),O=Math.max(h??0,E??0,N??0),ee=Number.isFinite(m)&&m>A?m:0,K=0;return V(g)?K=Math.max(g,O,ee):V(O)?K=Math.max(O,ee):K=ee,K>0?Math.max(0,K):0},q=()=>{let u=window.__timelines??{},m=ne=>{let Q=Object.entries(u).filter(re=>!!re[1]&&typeof re[1].play=="function"&&typeof re[1].pause=="function");if(Q.length!==1)return{timeline:null};let ce=Q[0];if(!ce)return{timeline:null};let[fe,pe]=ce;return{timeline:pe,selectedTimelineIds:[fe],selectedDurationSeconds:B(pe),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:ne,soleTimelineId:fe}}}},g=Xe({timelineRegistry:u,includeAuthoredTimingAttrs:!0}),h=G(),E=k(),N=Math.max(h??0,E??0)||null,O=ae(N),ee=ne=>{let Q=document.querySelector(`[data-composition-id="${CSS.escape(ne)}"]`);return Q?g.resolveStartForElement(Q,0):0},K=ne=>{let Q=window.gsap;if(!Q||typeof Q.timeline!="function")return null;let ce=Q.timeline({paused:!0});for(let fe of ne)ce.add(fe.timeline,ee(fe.compositionId));return ce},de=(ne,Q)=>{if(!V(ne))return null;let ce=window.gsap;if(!ce||typeof ce.timeline!="function")return null;let fe=ce.timeline({paused:!0});if(Q)try{fe.add(Q,0)}catch(re){v("runtime.init.site2",re)}let pe=fe;if(typeof pe.to=="function")try{pe.to({},{duration:ne})}catch(re){v("runtime.init.site3",re)}return fe},ge=(ne,Q)=>{let ce=ne;if(typeof ce.getChildren!="function")return[];try{let fe=ce.getChildren(!0,!0,!0)??[];if(!Array.isArray(fe))return[];let pe=[];for(let re of Q)if(!fe.some(Re=>Re===re.timeline))try{let Re=ee(re.compositionId);ne.add(re.timeline,Re),pe.push(re.compositionId)}catch(Re){v("runtime.init.site4",Re)}return pe}catch{return[]}},le=T(),te=le?.getAttribute("data-composition-id")??null;if(!te)return m("root_missing_composition_id");let ye=u[te]??null,Se=(()=>{if(!le)return[];let ne=new Set,Q=Array.from(le.querySelectorAll("[data-composition-id]")),ce=[];for(let fe of Q){let pe=fe.getAttribute("data-composition-id");if(!pe||pe===te||ne.has(pe))continue;ne.add(pe);let re=u[pe]??null;if(!re||typeof re.play!="function"||typeof re.pause!="function")continue;let _e=B(re);ce.push({compositionId:pe,timeline:re,durationSeconds:_e??0})}return ce})(),Dt=ne=>{for(let Q of ne){let ce=Q.timeline;if(typeof ce.paused=="function")try{ce.paused(!1)}catch(fe){v("runtime.init.site5",fe)}}};if(Se.length>0&&Dt(Se),ye){let ne=Se.length>0?ge(ye,Se):[];if((Se.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id='"+te+"'])"))&&($=!0),ne.length>0)try{let re=ye.time();ye.seek(re,!1)}catch{}let Q=B(ye);if(!V(Q)&&Se.length>0){let re=Se.map(_u=>_u.compositionId),_e=K(Se),Re=B(_e);if(_e&&V(Re))return{timeline:_e,selectedTimelineIds:re,selectedDurationSeconds:Re,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:te,rootDurationSeconds:Q,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:O,selectedDurationSeconds:Re,mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:E,selectedTimelineIds:re,autoNestedChildren:ne}}};let di=de(N??0,ye),fi=B(di);if(di&&V(fi))return{timeline:di,selectedTimelineIds:[te],selectedDurationSeconds:fi,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:te,rootDurationSeconds:Q,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:E,selectedDurationSeconds:fi,selectedTimelineIds:[te],autoNestedChildren:ne}}}}if(!V(Q)&&Se.length===0){let re=de(N??0,ye),_e=B(re);if(re&&V(_e))return{timeline:re,selectedTimelineIds:[te],selectedDurationSeconds:_e,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:te,rootDurationSeconds:Q,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:E,selectedDurationSeconds:_e,selectedTimelineIds:[te]}}}}let ce=le?.getAttribute("data-duration"),fe=ce?parseFloat(ce):null,pe=Math.max(V(fe)?fe:0,E??0);if(pe>0&&V(pe)&&V(Q)&&pe>=Q+.5){let re=ye;if(typeof re.to=="function")try{re.to({},{duration:0},pe)}catch(Re){v("runtime.init.site6",Re)}let _e=B(ye);if(V(_e))return{timeline:ye,selectedTimelineIds:[te],selectedDurationSeconds:_e,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:te,rootDurationSeconds:Q,rootDeclaredDur:fe,authoredCompositionDurationFloorSeconds:E,newDur:_e}}}}return{timeline:ye,selectedTimelineIds:[te],selectedDurationSeconds:Q,mediaDurationFloorSeconds:h,diagnostics:ne.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:te,selectedDurationSeconds:Q,autoNestedChildren:ne}}:void 0}}if(Se.length>0){let ne=Se.map(fe=>fe.compositionId),Q=K(Se),ce=B(Q);if(Q)return{timeline:Q,selectedTimelineIds:ne,selectedDurationSeconds:ce,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:te,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:O,selectedDurationSeconds:ce,mediaDurationFloorSeconds:h,selectedTimelineIds:ne}}}}return m("root_composition_id_unmatched_in_registry")},$=!1,we=()=>{if(!J)return!1;let u=e.capturedTimeline,m=B(u),g=V(m);if(u&&g&&$)return!1;let h=q();if(!h.timeline)return!1;if(u&&u===h.timeline)return typeof u.timeScale=="function"&&u.timeScale(e.playbackRate),!1;e.capturedTimeline=h.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let E=W(e.capturedTimeline,0);if(E<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),qe(e.capturedTimeline)),E>0){try{s.setDuration(E)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let O=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(O,!1),qe(e.capturedTimeline)}let N=window.__hfStudioManualEditsApply;typeof N=="function"&&N(),jn(document)}if(h.diagnostics&&he({source:"hf-preview",type:"diagnostic",code:h.diagnostics.code,details:h.diagnostics.details}),he({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:h.selectedTimelineIds??[],selectedDurationSeconds:h.selectedDurationSeconds??null,mediaDurationFloorSeconds:h.mediaDurationFloorSeconds??null}}),window.parent!==window){let N=T(),O=E>0?E:0,ee=String(O>0?O:1),K=new Set,de=new Set(document.querySelectorAll("[data-start]")),ge=le=>{let te=le.parentElement;for(;te&&te!==N;){if(de.has(te))return!0;te=te.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let le of e.capturedTimeline.getChildren(!0))if(typeof le.targets=="function")for(let te of le.targets())te instanceof HTMLElement&&te!==N&&(te.hasAttribute("data-start")||ge(te)||K.has(te)||(K.add(te),te.setAttribute("data-start","0"),te.setAttribute("data-duration",ee),te.setAttribute("data-hf-autostamped","1")))}catch{}if(N instanceof HTMLElement)for(let le of N.querySelectorAll("[id]"))le instanceof HTMLElement&&le!==N&&(le.hasAttribute("data-start")||ge(le)||K.has(le)||le.tagName==="SCRIPT"||le.tagName==="STYLE"||le.tagName==="LINK"||(K.add(le),le.setAttribute("data-start","0"),le.setAttribute("data-duration",ee),le.setAttribute("data-hf-autostamped","1")))}for(let N of Mt)pn.delete(N),Jr(N);return!0};window.__hfForceTimelineRebind=()=>{$=!1,we(),Qr(e.currentTime)};let Ce=()=>{let u=T();if(!(u instanceof HTMLElement))return;let m=u.getBoundingClientRect(),g=Number(u.getAttribute("data-width")),h=Number(u.getAttribute("data-height")),E=window.getComputedStyle(u),N=Number.isFinite(g)&&g>0&&Number.isFinite(h)&&h>0,O=m.width<=0||m.height<=0||u.clientWidth<=0||u.clientHeight<=0;!N||!O||y("root_stage_layout_zero",{compositionId:u.getAttribute("data-composition-id")??null,declaredWidth:g,declaredHeight:h,rectWidth:Math.round(m.width),rectHeight:Math.round(m.height),clientWidth:u.clientWidth,clientHeight:u.clientHeight,display:E.display,visibility:E.visibility,overflow:E.overflow},`root-stage-layout-zero:${u.getAttribute("data-composition-id")??"unknown"}`)},Ft=()=>{e.tornDown||(c!=null&&window.cancelAnimationFrame(c),c=window.requestAnimationFrame(()=>{c=null,Ce()}))},Ue=()=>{i=u=>{let m=F(u.error??u.message).slice(0,D);if(!m)return;let g=w(m);he({source:"hf-preview",type:"diagnostic",code:g.code,details:{category:g.category,message:m,filename:u.filename||null,line:Number.isFinite(u.lineno)?u.lineno:null,column:Number.isFinite(u.colno)?u.colno:null}})},r=u=>{let m=F(u.reason).slice(0,D);if(!m)return;let g=w(m);he({source:"hf-preview",type:"diagnostic",code:`${g.code}_unhandled_rejection`,details:{category:`${g.category}-unhandled-rejection`,message:m}})},window.addEventListener("error",i),window.addEventListener("unhandledrejection",r)},uu=()=>{let u=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let g of u){let h=()=>{if(!(g instanceof Element))return;let E=g.tagName.toLowerCase(),N=g.getAttribute("src")??g.getAttribute("href")??g.getAttribute("poster")??null,O=E==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";y(O,{tagName:E,assetUrl:N,currentSrc:(g instanceof HTMLImageElement||g instanceof HTMLMediaElement)&&g.currentSrc||null,readyState:g instanceof HTMLMediaElement?g.readyState:null,networkState:g instanceof HTMLMediaElement?g.networkState:null},`${O}:${E}:${N??"unknown"}`)};g.addEventListener("error",h),S(()=>{g.removeEventListener("error",h)})}let m=document.fonts;m&&m.ready.then(()=>{if(e.tornDown)return;let g=Array.from(m).filter(h=>h.status==="error").map(h=>h.family).filter(h=>!!h).slice(0,10);g.length!==0&&y("runtime_font_load_issue",{failedFamilies:g,totalFaces:Array.from(m).length},`runtime-font-load-issue:${g.join("|")}`)}).catch(()=>{})},cu=(u,m)=>{if(!u.timeline)return!1;let g=e.capturedTimeline;if(g&&g===u.timeline)return!1;let h=Math.max(0,e.currentTime||0),E=e.isPlaying;e.capturedTimeline=u.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{qe(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&e.capturedTimeline.seek(h,!1),E&&typeof e.capturedTimeline.play=="function"&&e.capturedTimeline.play()}catch(N){v("runtime.init.site7",N)}return he({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:m,previousTime:h,selectedTimelineIds:u.selectedTimelineIds??[],selectedDurationSeconds:u.selectedDurationSeconds??null,mediaDurationFloorSeconds:u.mediaDurationFloorSeconds??null}}),!0},rt=null,$r=!1,qr=!1,Mt=new Set,pn=new WeakMap,hn=()=>{e.tornDown||(rt!=null&&window.clearTimeout(rt),rt=window.setTimeout(()=>{if(e.tornDown||(rt=null,qr&&window.__HF_EXPORT_RENDER_SEEK_CONFIG))return;let u=q();if(!u.timeline||!V(u.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){we()&&(ot(),ve(!0));return}if($r)return;let g=B(e.capturedTimeline),h=u.selectedDurationSeconds??B(u.timeline);V(h)&&(!V(g)||h>=g+M)&&cu(u,"manual")&&($r=!0,he({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:g??null,selectedDurationSeconds:h??null,selectedTimelineIds:u.selectedTimelineIds??[],mediaDurationFloorSeconds:u.mediaDurationFloorSeconds??null}}),ot(),ve(!0))},H))},Kr=u=>{u.currentTarget instanceof HTMLMediaElement&&Ko(u.currentTarget)},Yr=u=>{u.currentTarget instanceof HTMLMediaElement&&Yo(u.currentTarget)},du=()=>{for(let u of Mt)u.removeEventListener("loadedmetadata",hn),u.removeEventListener("durationchange",hn),u.removeEventListener("loadedmetadata",Kr),u.removeEventListener("error",Yr);Mt.clear()},ni=()=>{if(e.tornDown)return;let u=Array.from(document.querySelectorAll("video, audio"));for(let m of u){if(Mt.has(m))continue;Mt.add(m);let g=Number.parseFloat(m.dataset.volume??"");Number.isFinite(g)&&(m.volume=Math.max(0,Math.min(1,g))),m.addEventListener("loadedmetadata",hn),m.addEventListener("durationchange",hn),m.addEventListener("loadedmetadata",Kr),m.addEventListener("error",Yr),qo(m),m.preload!=="auto"&&(m.preload="auto"),m.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&m.load(),Jr(m)}},Jr=u=>{pn.has(u)||Go(u,e.capturedTimeline,W(e.capturedTimeline,0),pn)},ii=new WeakMap,Xr=u=>{let m=ii.get(u);if(m!==void 0)return m;let g=window.getComputedStyle(u).position,h=g==="static"||g==="relative"||g==="sticky";return ii.set(u,h),h},ri=new WeakMap,fu=u=>{let m=ri.get(u);if(m!==void 0)return m;let g=u.querySelector("[data-start]")===null;return ri.set(u,g),g},mu=()=>{ii=new WeakMap,ri=new WeakMap},oi=new WeakMap,gn=new WeakSet,Qr=u=>{let m=Array.from(document.querySelectorAll("[data-start]")),g=T();for(let h of m){if(!(h instanceof HTMLElement))continue;if(h.hasAttribute("data-hidden")){gn.has(h)||(oi.set(h,h.style.getPropertyValue("display")),gn.add(h)),h.style.display="none",(h instanceof HTMLVideoElement||h instanceof HTMLImageElement)&&n?.setSourceVisibility(h,!1);continue}if(gn.has(h)){let N=oi.get(h);N?h.style.display=N:h.style.removeProperty("display"),oi.delete(h),gn.delete(h)}let E=ie(h,u);if(E){let N=h.parentElement;for(;N&&N!==g;){if(N instanceof HTMLElement&&N.hasAttribute("data-start")&&!ie(N,u)){E=!1;break}N=N.parentElement}}h.style.visibility=E?"visible":"hidden",(h instanceof HTMLVideoElement||h instanceof HTMLImageElement)&&n?.setSourceVisibility(h,E),E?Xr(h)&&h.style.removeProperty("display"):Xr(h)&&fu(h)&&(h.style.display="none")}},Me=()=>{let u=h=>{let E=h.closest("[data-composition-id]"),N=E?P(E,0):null,O=E?X(E,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:E,inheritedStart:N,inheritedDuration:O}},m=Wo({shouldIncludeElement:h=>h.hasAttribute("data-start")||!!u(h).compositionRoot,resolveStartSeconds:h=>{let E=u(h);return I(h,E.inheritedStart??0)},resolveDurationSeconds:h=>{let E=u(h),N=I(h,E.inheritedStart??0),O=Number.parseFloat(h.dataset.playbackStart??h.dataset.mediaStart??"0")||0,ee=E.inheritedStart!=null&&E.inheritedDuration!=null&&E.inheritedDuration>0?Math.max(0,E.inheritedStart+E.inheritedDuration-N):null,K=Number.isFinite(h.duration)&&h.duration>O?Math.max(0,h.duration-O):null,de=Number.parseFloat(h.dataset.duration??""),ge=Number.isFinite(de)&&de>0?de:null;return Uo({isVideo:h.tagName==="VIDEO",sourceDuration:K,hostRemaining:ee,explicitDuration:ge})}});for(let h of m.mediaClips){let E=pn.get(h.el);E&&(h.volumeKeyframes=E)}let g=e.mediaForceSyncNextTick;g&&(e.mediaForceSyncNextTick=!1),e.nativeMediaSyncDisabled||Vo({clips:m.mediaClips,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted||!e.webAudioMediaDisabled&&!e.nativeMediaSyncDisabled&&l.isActive(),userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:g,onElementVolume:(h,E)=>l.setElementVolume(h,E),isWebAudioOwned:h=>l.ownsElement(h),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,he({source:"hf-preview",type:"media-autoplay-blocked"}))}}),Qr(e.currentTime)},ve=u=>{let m=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),g=Date.now();(u||m!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||g-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=m,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=g,he({source:"hf-preview",type:"state",frame:m,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},si="",Zr=0,pu=()=>{let u="";for(let m of document.querySelectorAll("[data-start]"))u+=`${m.id}:${m.tagName}|`;return u},ot=()=>{L(),R(),z();let u=T();if(u){let h=C(u.getAttribute("data-width")),E=C(u.getAttribute("data-height")),N=h?parseInt(h,10):0,O=E?parseInt(E,10):0;N>0&&O>0&&he({source:"hf-preview",type:"stage-size",width:N,height:O})}we();let m=ws({canonicalFps:e.canonicalFps});window.__clipManifest=m;let g=pu();if(si!==g&&mu(),!window.__clipTree||si!==g){let h=window;window.__clipTree=gs({startResolver:Xe({timelineRegistry:h.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:h.__timelines??{},rootDuration:m.durationInFrames/e.canonicalFps}),si=g}he(m),Ft()},ai=u=>Number.isFinite(u)&&u>0?u:0,hu=u=>{let m=ai(Number(u));if(m<=0)return;let g=T(),h=ai(Number.parseFloat(g?.getAttribute("data-duration")??"")),E=Math.max(Zr,ai(s.getDuration()),h);m<=E||(Zr=m,g?.setAttribute("data-duration",String(m)),s.setDuration(m),ot(),ve(!0))},Pe=(u,m=0)=>{for(let g of e.deterministicAdapters){try{u==="discover"&&g.discover(),u==="pause"&&g.pause(),u==="play"&&g.play&&g.play()}catch(h){v("runtime.init.site8",h)}if(u==="discover")try{g.seek({time:m,suppressEvents:!0})}catch(h){v("runtime.init.site9",h)}}},st=()=>{window.__renderReady=!1},Nt=null,Rt=!0,gu=()=>{let u=[];for(let m of e.deterministicAdapters){let g=m.getReadyPromise;if(typeof g=="function")try{let h=g();h&&u.push(h)}catch(h){v("runtime.init.adapterReady",h)}}return u},xu=()=>{let u=gu();if(u.length===0)return Nt=null,Rt=!0,!0;let m=u[0];if(!m)return!0;let g=u.length===1?m:Promise.all(u);return g!==Nt&&(Nt=g,Rt=!1,Promise.resolve(g).then(()=>{Nt===g&&(Rt=!0,st())},h=>{Nt===g&&(Rt=!0,v("runtime.init.adapterReady",h),st())})),Rt};if(J)Cr();else{let u={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:C,onDiagnostic:({code:m,details:g})=>{he({source:"hf-preview",type:"diagnostic",code:m,details:g})}};cl(u).then(()=>ul(u)).finally(()=>{J=!0,ni(),uu(),Cr(),Nr(document),st()})}let xn=ds({postMessage:u=>he(u)});xn.installPickerApi();let We=Rl();n=We,S(()=>{We.destroy(),n=null});let li=u=>{let m=Number(u);!Number.isFinite(m)||m<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,m)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let g=document.querySelectorAll("video, audio");for(let h of g)if(h instanceof HTMLMediaElement)try{h.playbackRate=e.playbackRate}catch(E){v("runtime.init.site10",E)}},eo={play:()=>{let u=e.capturedTimeline;if(s.isPlaying())return;let m=W(u,0);if(m>0)s.setDuration(m),s.reachedEnd()&&(s.seek(0),e.currentTime=0,at(0));else{let g=T(),h=Number(g?.getAttribute("data-duration")??0);h>0&&s.setDuration(h)}qe(u),s.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,so(s.now()),f&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&ao(),Pe("play"),Me(),We.redraw(),ve(!0))},pause:()=>{if(!s.isPlaying())return;l.stopAll(),s.detachAudioSource(),s.pause(),e.isPlaying=!1,e.currentTime=s.now(),e.mediaForceSyncNextTick=!0,so(e.currentTime);let u=e.capturedTimeline;qe(u),Pe("pause"),Me(),We.redraw(),ve(!0)},seek:(u,m)=>{let g=xt(Math.max(0,Number(u)||0),e.canonicalFps);l.stopAll(),s.detachAudioSource();let h=s.isPlaying();h&&s.pause(),s.seek(g),e.currentTime=s.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let E=e.capturedTimeline;if(qe(E),at(e.currentTime),Pe("pause"),m?.keepPlaying&&h){eo.play();return}Me(),We.redraw(),ve(!0)},renderSeek:(u,m)=>{qr=!0;let g=xt(Math.max(0,Number(u)||0),e.canonicalFps);l.stopAll(),s.detachAudioSource(),s.isPlaying()&&s.pause(),s.seek(g),e.currentTime=s.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0,at(e.currentTime,{activateChildren:!0,suppressEvents:m?.suppressEvents}),Me(),We.redraw(),ve(!0)},getTime:()=>s.now(),getDuration:()=>{let u=s.getDuration();return Number.isFinite(u)?u:0},isPlaying:()=>s.isPlaying(),setPlaybackRate:u=>{li(u),s.setRate(e.playbackRate),lo()},getPlaybackRate:()=>e.playbackRate},to=W(e.capturedTimeline,0);to>0&&s.setDuration(to);let Ne=ps({getTimeline:()=>e.capturedTimeline,setTimeline:u=>{e.capturedTimeline=u},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:u=>{e.isPlaying!==u&&(e.mediaForceSyncNextTick=!0),e.isPlaying=u},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:li,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(u,m)=>{e.currentTime=Math.max(0,Number(u)||0),e.isPlaying!==m&&(e.mediaForceSyncNextTick=!0),e.isPlaying=m,Me()},onStatePost:ve,onDeterministicSeek:(u,m)=>{for(let g of e.deterministicAdapters)if(!(g.name==="gsap"&&e.capturedTimeline))try{g.seek({time:Number(u)||0,suppressEvents:m?.suppressEvents})}catch(h){v("runtime.init.site11",h)}},onDeterministicPause:()=>Pe("pause"),onDeterministicPlay:()=>Pe("play"),onRenderFrameSeek:()=>{We.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>W(e.capturedTimeline,0),transport:eo});window.__player=b(Ne),window.__playerReady=!0,po(he),Ye("composition_loaded",{duration:Ne.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[Oo(),Eo({resolveStartSeconds:u=>P(u,0)}),wo(),_o(),vo(),Fo(),Mo(),No(),Ro(),Lo(),ko(),Ao({getTimeline:()=>e.capturedTimeline})],Io(),Po(),window.__hfReseekGpu=u=>{let m=Math.max(0,Number(u)||0);window.__hfThreeTime=m,window.__hfTypegpuTime=m,To(m)},Ue(),ni(),Pe("discover");let bu=()=>{let u=e.capturedTimeline,m=we();e.capturedTimeline&&(m||e.capturedTimeline!==u||!Ne._timeline)&&(Ne._timeline=e.capturedTimeline);let g=W(e.capturedTimeline,0);if(g>0&&s.setDuration(g),Pe("discover",e.currentTime),!e.capturedTimeline){let h=window.__timelines??{},E=Object.keys(h).filter(N=>h[N]);if(E.length>0){let O=T()?.getAttribute("data-composition-id")??null;y("root_timeline_unbound_registry_present",{reason:O?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:O,registeredTimelineKeys:E},"root_timeline_unbound_registry_present"),console.warn("[hyperframes] Root timeline not bound \u2014 render will freeze at t=0. "+(O?`Root data-composition-id is "${O}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${E.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${O??"<root-id>"}"] = tl).`)}}window.__renderReady=!0,ot(),ve(!0)},mt=null,yu=()=>{if(mt)return;let u=()=>{window.removeEventListener("hf-timelines-built",u),mt=null,st()};mt=u,window.addEventListener("hf-timelines-built",u)};S(()=>{mt&&(window.removeEventListener("hf-timelines-built",mt),mt=null)}),st=()=>{if(!J){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,yu();return}if(Pe("discover",e.currentTime),!xu()){window.__renderReady=!1;return}bu()},st(),J&&setTimeout(()=>{st()},0);let bn=0,ui=!1,Su=(u,m,g,h)=>{try{let E=h?.suppressEvents===!0;qe(u),typeof u.totalTime=="function"?u.totalTime(m,E):u.seek(m,E)}catch(E){v(g,E)}},Eu=(u,m)=>{let g=window.__timelines??{},h=T()?.getAttribute("data-composition-id")??null;for(let[E,N]of Object.entries(g)){if(!N||E===h)continue;let O=document.querySelector(`[data-composition-id="${CSS.escape(E)}"]`);if(!O)continue;let ee=P(O,0);if(!Number.isFinite(ee))continue;let K=B(N),de=gt(O)+Math.max(0,u-ee)*Be(O),ge=Math.max(0,K!=null&&K>0?Math.min(K,de):de);Su(N,ge,"runtime.init.transport.childTimeline",m)}},no=u=>{let m=window.__timelines??{};for(let g of Object.values(m))if(!(!g||g===u))try{g.play()}catch(h){v("runtime.init.activateSiblings",h)}},io=u=>typeof u=="object"&&u!==null,Lt=new WeakMap,Au=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],ro=(u,m)=>{let g=u[m];if(typeof g!="function")return null;try{let h=Number(g.call(u));return Number.isFinite(h)?h:null}catch(h){return v("runtime.init.gsapCallbackDuration",h),null}},wu=u=>{let m=Lt.get(u);if(m!=null)return m;if(!("getChildren"in u)||typeof u.getChildren!="function")return!1;let g;try{g=u.getChildren(!0,!0,!0)}catch(h){return v("runtime.init.gsapCallbackChildren",h),Lt.set(u,!1),!1}if(!Array.isArray(g))return Lt.set(u,!1),!1;for(let h of g){if(!io(h))continue;let E=h.vars;if(!io(E)||!Au.some(K=>typeof E[K]=="function"))continue;let ee=ro(h,"totalDuration")??ro(h,"duration");if(ee!=null&&ee<=1e-6)return Lt.set(u,!0),!0}return Lt.set(u,!1),!1};function at(u,m){let g=e.capturedTimeline,h=m?.suppressEvents===!0;if(g){m?.activateChildren&&no(g);let E=g,N=u;if(typeof E.totalDuration=="function")try{let O=Number(E.totalDuration());Number.isFinite(O)&&O>0&&u>O&&(N=O)}catch(O){v("runtime.init.transport.clampDuration",O)}try{typeof g.totalTime=="function"?(g.totalTime(N,h),!h&&!wu(g)&&(g.totalTime(N+.001,!0),g.totalTime(N,!0))):g.seek(N,h)}catch(O){v("runtime.init.transport.seek",O)}}Eu(u,m),g&&m?.activateChildren&&no(g);for(let E of e.deterministicAdapters)if(!(E.name==="gsap"&&g))try{E.seek({time:u,suppressEvents:h})}catch(N){v("runtime.init.transport.adapter",N)}}let Cu=()=>{try{return document.querySelector(`[${kl}]`)!=null}catch{return!1}},oo=()=>{if(!(e.tornDown||ui)){ui=!0;try{if(e.transportRafId=window.requestAnimationFrame(oo),bn+=1,Dl({tick:bn,isPlaying:s.isPlaying(),hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:s.now()})){let m=e.capturedTimeline;if(we()){e.capturedTimeline&&!Ne._timeline&&(Ne._timeline=e.capturedTimeline),e.capturedTimeline&&e.capturedTimeline!==m&&qe(e.capturedTimeline);let g=W(e.capturedTimeline,0);g>0&&s.setDuration(g),ot()}}if(bn%20===0&&ot(),bn%30===0&&ni(),e.capturedTimeline){let m=W(e.capturedTimeline,0);m>0&&(!s.isPlaying()||m>=s.getDuration())&&s.setDuration(m)}if(s.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&l.isActive()&&l.context){let m=l.getTime();m>=0&&s.attachAudioSource({currentTimeSeconds:m})}else{let m=document.querySelectorAll("audio[data-start]"),g=!1;for(let h of m){if(!(h instanceof HTMLMediaElement)||!h.isConnected)continue;let E=Number.parseFloat(h.dataset.start??""),N=Number.parseFloat(h.dataset.duration??""),O=Number.isFinite(N)&&N>0?E+N:1/0,ee=Number.parseFloat(h.dataset.playbackStart??h.dataset.mediaStart??"0")||0;if(Number.isFinite(E)&&e.currentTime>=E&&e.currentTime<O){h.paused?!h.error&&h.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(s.attachAudioSource({currentTimeSeconds:e.currentTime}),g=!0):(s.attachAudioSource({el:h,compositionStart:E,mediaStart:ee}),g=!0);break}}!g&&s.hasAudioSource()&&s.detachAudioSource()}else s.hasAudioSource()&&s.detachAudioSource();let u=s.now();if(e.currentTime=u,(s.isPlaying()||!Cu())&&at(u),s.isPlaying()&&s.reachedEnd()){l.stopAll(),s.detachAudioSource(),s.pause(),e.isPlaying=!1;let m=s.getDuration();Number.isFinite(m)&&(s.seek(m),e.currentTime=m,at(m)),Pe("pause"),Me(),ve(!0);return}s.isPlaying()&&Me(),ve(!1)}finally{ui=!1}}},so=u=>{let m=document.querySelectorAll("video, audio");for(let g of m){if(!(g instanceof HTMLMediaElement)||!g.isConnected)continue;let h=Number.parseFloat(g.dataset.start??"");if(!Number.isFinite(h))continue;let E=Number.parseFloat(g.dataset.duration??""),N=Number.isFinite(E)&&E>0?h+E:1/0;if(u<h||u>=N)continue;let O=Number.parseFloat(g.dataset.playbackStart??g.dataset.mediaStart??"0")||0,ee=u-h+O;if(ee>=0)try{g.currentTime=ee}catch{}}},ao=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let u=l.startGeneration(),m=document.querySelectorAll("audio[data-start]");for(let g of m){if(!(g instanceof HTMLMediaElement)||!g.isConnected)continue;let h=Number.parseFloat(g.dataset.start??"");if(!Number.isFinite(h))continue;let E=Number.parseFloat(g.dataset.playbackStart??g.dataset.mediaStart??"0")||0,N=Number.parseFloat(g.dataset.volume??""),O=Number.isFinite(N)?N:1,ee=Number.parseFloat(g.dataset.duration??""),K=Number.isFinite(ee)&&ee>0?ee:Number.POSITIVE_INFINITY,de=g.closest("[data-composition-id]");if(de){let ge=P(de,0),le=X(de,{includeAuthoredTimingAttrs:!0});le!=null&&le>0&&(K=Math.min(K,Math.max(0,ge+le-h)))}l.decodeAudioElement(g).then(ge=>{!ge||!s.isPlaying()||l.schedulePlayback(g,ge,h,E,s.now(),O*e.bridgeVolume,u,e.playbackRate,K)})}};function lo(){l.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&f&&s.isPlaying()&&l.hasBoundedActiveSources()&&(l.stopAll(),ao())}if(e.capturedTimeline){let u=W(e.capturedTimeline,0);u>0&&s.setDuration(u),qe(e.capturedTimeline)}gl(window),e.transportRafId=window.requestAnimationFrame(oo),ot(),ve(!0),e.controlBridgeHandler=mo({onPlay:()=>{Ne.play(),Ye("composition_played",{time:Ne.getTime()})},onPause:()=>{Ne.pause(),Ye("composition_paused",{time:Ne.getTime()})},onStopMedia:()=>{l.stopAll();let u=document.querySelectorAll("video, audio");for(let m of u)m instanceof HTMLMediaElement&&!m.paused&&m.pause()},onSeek:(u,m)=>{Ne.seek(u),Ye("composition_seeked",{time:u})},onSetMuted:u=>{e.bridgeMuted=u;let m=u||e.mediaOutputMuted;l.setMuted(m);let g=document.querySelectorAll("video, audio");for(let h of g)h instanceof HTMLMediaElement&&(h.muted=m||h.defaultMuted)},onSetVolume:u=>{e.bridgeVolume=u,l.setVolume(u);let m=document.querySelectorAll("video, audio");for(let g of m){if(!(g instanceof HTMLMediaElement))continue;let h=parseFloat(g.dataset.volume??""),E=Number.isFinite(h)?h:1;g.volume=E*u}},onSetMediaOutputMuted:u=>{e.mediaOutputMuted=u;let m=u||e.bridgeMuted;l.setMuted(m);let g=document.querySelectorAll("video, audio");for(let h of g)h instanceof HTMLMediaElement&&(h.muted=m||h.defaultMuted)},onSetNativeMediaSyncDisabled:u=>{e.nativeMediaSyncDisabled!==u&&(e.nativeMediaSyncDisabled=u,e.mediaForceSyncNextTick=!0,u?(l.stopAll(),s.detachAudioSource()):Me())},onSetWebAudioMediaDisabled:u=>{e.webAudioMediaDisabled!==u&&(e.webAudioMediaDisabled=u,e.mediaForceSyncNextTick=!0,u&&(l.stopAll(),s.detachAudioSource()),Me())},onSetPlaybackRate:u=>{li(u),e.transportClock&&e.transportClock.setRate(e.playbackRate),lo()},onSetRootDuration:hu,onSetColorGrading:(u,m)=>{We.setGrading(u,m)},onSetColorGradingCompare:(u,m)=>{We.setCompare(u,m)},onTick:()=>{if(e.tornDown||!s.isPlaying())return;let u=s.now();if(e.currentTime=u,at(u),s.reachedEnd()){l.stopAll(),s.detachAudioSource(),s.pause(),e.isPlaying=!1;let m=s.getDuration();Number.isFinite(m)&&(s.seek(m),e.currentTime=m,at(m)),Pe("pause"),Me(),ve(!0)}},onEnablePickMode:()=>xn.enablePickMode(),onDisablePickMode:()=>xn.disablePickMode(),getCanonicalFps:()=>e.canonicalFps});let ci=()=>{if(!e.tornDown){e.tornDown=!0,e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),e.transportClock=null,l.destroy(),rt!=null&&(window.clearTimeout(rt),rt=null),c!=null&&(window.cancelAnimationFrame(c),c=null),du(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),i&&(window.removeEventListener("error",i),i=null),r&&(window.removeEventListener("unhandledrejection",r),r=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),xn.disablePickMode();for(let u of e.deterministicAdapters)if(!(!u||typeof u.revert!="function"))try{u.revert()}catch(m){v("runtime.init.site12",m)}e.deterministicAdapters=[];for(let u of o.splice(0))try{u()}catch(m){v("runtime.init.site13",m)}for(let u of e.injectedCompStyles)try{u.remove()}catch(m){v("runtime.init.site14",m)}e.injectedCompStyles=[];for(let u of e.injectedCompLinks)try{u.remove()}catch(m){v("runtime.init.site15",m)}e.injectedCompLinks=[];for(let u of e.injectedCompScripts)try{u.remove()}catch(m){v("runtime.init.site16",m)}e.injectedCompScripts=[],e.capturedTimeline=null,window.__hfRuntimeTeardown===ci&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=ci,e.beforeUnloadHandler=ci,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var Ol=["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"],Br=[[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 ep(e){if(e<=255)return Ol[e];let t=0,n=Br.length-1;for(;t<=n;){let i=t+n>>1,r=Br[i];if(e<r[0]){n=i-1;continue}if(e>r[1]){t=i+1;continue}return r[2]}return"L"}function tp(e){let t=e.length;if(t===0)return null;let n=new Array(t),i=!1;for(let l=0;l<t;){let f=e.charCodeAt(l),p=f,d=1;if(f>=55296&&f<=56319&&l+1<t){let S=e.charCodeAt(l+1);S>=56320&&S<=57343&&(p=(f-55296<<10)+(S-56320)+65536,d=2)}let x=ep(p);(x==="R"||x==="AL"||x==="AN")&&(i=!0);for(let S=0;S<d;S++)n[l+S]=x;l+=d}if(!i)return null;let r=0;for(let l=0;l<t;l++){let f=n[l];if(f==="L"){r=0;break}if(f==="R"||f==="AL"){r=1;break}}let o=new Int8Array(t);for(let l=0;l<t;l++)o[l]=r;let a=r&1?"R":"L",c=a,s=c;for(let l=0;l<t;l++)n[l]==="NSM"?n[l]=s:s=n[l];s=c;for(let l=0;l<t;l++){let f=n[l];f==="EN"?n[l]=s==="AL"?"AN":"EN":(f==="R"||f==="L"||f==="AL")&&(s=f)}for(let l=0;l<t;l++)n[l]==="AL"&&(n[l]="R");for(let l=1;l<t-1;l++)n[l]==="ES"&&n[l-1]==="EN"&&n[l+1]==="EN"&&(n[l]="EN"),n[l]==="CS"&&(n[l-1]==="EN"||n[l-1]==="AN")&&n[l+1]===n[l-1]&&(n[l]=n[l-1]);for(let l=0;l<t;l++){if(n[l]!=="EN")continue;let f;for(f=l-1;f>=0&&n[f]==="ET";f--)n[f]="EN";for(f=l+1;f<t&&n[f]==="ET";f++)n[f]="EN"}for(let l=0;l<t;l++){let f=n[l];(f==="WS"||f==="ES"||f==="ET"||f==="CS")&&(n[l]="ON")}s=c;for(let l=0;l<t;l++){let f=n[l];f==="EN"?n[l]=s==="L"?"L":"EN":(f==="R"||f==="L")&&(s=f)}for(let l=0;l<t;l++){if(n[l]!=="ON")continue;let f=l+1;for(;f<t&&n[f]==="ON";)f++;let p=l>0?n[l-1]:c,d=f<t?n[f]:c,x=p!=="L"?"R":"L";if(x===(d!=="L"?"R":"L"))for(let y=l;y<f;y++)n[y]=x;l=f-1}for(let l=0;l<t;l++)n[l]==="ON"&&(n[l]=a);for(let l=0;l<t;l++){let f=n[l];(o[l]&1)===0?f==="R"?o[l]++:(f==="AN"||f==="EN")&&(o[l]+=2):(f==="L"||f==="AN"||f==="EN")&&o[l]++}return o}function Bl(e,t){let n=tp(e);if(n===null)return null;let i=new Int8Array(t.length);for(let r=0;r<t.length;r++)i[r]=n[t[r]];return i}var np=/[ \t\n\r\f]+/g,ip=/[\t\n\r\f]| {2,}|^ | $/;function rp(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function op(e){if(!ip.test(e))return e;let t=e.replace(np," ");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 sp(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
|
|
348
|
+
})();`}var Dp=["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 ou(e){let t=e.getAttribute("id")?.trim();for(let n of Dp)e.removeAttribute(n);t&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",t)),e.setAttribute("data-hf-inner-root","true")}var Ip=8e3,Pp=/^(?![a-zA-Z][a-zA-Z\d+\-.]*:)(?!\/\/)(?!\/)(?!\.\.?\/).+/,Op=/\burl\(\s*(["']?)([^)"']+)\1\s*\)/g,Gp=["src","href"];function Hp(e){return!e||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/")}function su(e,t){if(!t)return e;let n=e.trim();if(Hp(n)||!n.startsWith("../")&&n!=="..")return e;try{return new URL(n,t).href}catch{return e}}function lu(e,t){return!t||!e?e:e.replace(Op,(n,r,i)=>{let o=su(i||"",t);return o===i?n:`url(${r||""}${o}${r||""})`})}function Bp(e,t){for(let n of Array.from(e.querySelectorAll("[src], [href]")))for(let r of Gp){let i=n.getAttribute(r);if(i==null)continue;let o=su(i,t);o!==i&&n.setAttribute(r,o)}}function Up(e,t){for(let n of Array.from(e.querySelectorAll("[style]"))){let r=n.getAttribute("style");if(r==null)continue;let i=lu(r,t);i!==r&&n.setAttribute("style",i)}}function Wp(e,t){for(let n of Array.from(e.querySelectorAll("style"))){let r=n.textContent||"",i=lu(r,t);i!==r&&(n.textContent=i)}}function uu(e,t){if(t){Bp(e,t),Up(e,t),Wp(e,t);for(let n of Array.from(e.querySelectorAll("template")))uu(n.content,t)}}function Vp(e,t){return`${e}__hf${t}`}var zp=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"),Ip)});function uo(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function $p(e){let t=document.importNode(e,!0);ou(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 au(e,t){let n=e.trim();if(!n)return e;try{return Pp.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 lo(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 hr(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 qp(e){let t=new Map;for(let n of e){let r=hr(n).authoredCompositionId||"";r&&t.set(r,(t.get(r)||0)+1)}return t}function cu(e){let t=hr(e).authoredCompositionId;return t?!!document.querySelector(`template#${CSS.escape(t)}-template`):!1}function jp(e){return!!e.querySelector('[data-hf-inner-root="true"]')}function Kp(e){return e.hasAttribute("data-composition-src")?!0:cu(e)?e.children.length===0||e.hasAttribute("data-hf-original-composition-id")?!0:jp(e):!1}function fo(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(t=>t.hasAttribute("data-composition-src")?!0:cu(t))}function du(){let e=window.__hfVariablesByComp;if(!e)return;let t=new Set(fo().map(n=>hr(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(e))t.has(n)||delete e[n]}function fu(e,t=qp(e)){let n=new Map,r=new Map;for(let i of e){let{authoredCompositionId:o,runtimeCompositionId:a}=hr(i),l=Kp(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?Vp(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 co(e){let t=null;e.authoredCompositionId&&(t=Array.from(e.sourceNode.querySelectorAll("[data-composition-id]")).find(x=>x instanceof HTMLElement&&x.getAttribute("data-composition-id")===e.authoredCompositionId)??null);let n=t??e.sourceNode,r=t?.getAttribute("data-composition-id")?.trim()||e.authoredCompositionId||null,i=e.runtimeCompositionId||r||null,o=t?.getAttribute("id")?.trim()||null,a=i?`[data-composition-id="${CSS.escape(i)}"]`:void 0;if(e.headLinks)for(let f of e.headLinks){let x=(f.getAttribute("href")||"").trim();if(!x)continue;let v=e.compositionUrl?new URL(x,e.compositionUrl).href:x;if(e.compositionUrl&&lo(v,e.compositionUrl)||document.head.querySelector(`link[href="${CSS.escape(v)}"]`))continue;let C=f.cloneNode(!0);C.href=v,document.head.appendChild(C),e.injectedLinks.push(C)}let l=f=>{for(let x of f){let v=x.cloneNode(!0);v instanceof HTMLStyleElement&&(r&&(v.textContent=ru(v.textContent||"",r,a,o,{scopeRootSelectors:!0})),document.head.appendChild(v),e.injectedStyles.push(v))}};e.headStyles&&l(e.headStyles),l(Array.from(n.querySelectorAll("style")));let s=[];if(e.headScripts)for(let f of e.headScripts){let x=f.getAttribute("type")?.trim()??"",v=f.getAttribute("src")?.trim()??"";if(v){let C=au(v,e.compositionUrl);if(e.compositionUrl&&lo(C,e.compositionUrl))continue;s.push({kind:"external",src:C,type:x})}else{let C=f.textContent?.trim()??"";C&&s.push({kind:"inline",content:C,type:x,scopeCompositionId:r})}}let u=Array.from(n.querySelectorAll("script")),c=[...s];for(let f of u){let x=f.getAttribute("type")?.trim()??"",v=f.getAttribute("src")?.trim()??"";if(v){let C=au(v,e.compositionUrl);if(e.compositionUrl&&lo(C,e.compositionUrl)){f.parentNode?.removeChild(f);continue}c.push({kind:"external",src:C,type:x})}else{let C=f.textContent?.trim()??"";C&&c.push({kind:"inline",content:C,type:x,scopeCompositionId:r})}f.parentNode?.removeChild(f)}let m=Array.from(n.querySelectorAll("style"));for(let f of m)f.parentNode?.removeChild(f);if(t){let f=t.getAttribute("data-width"),x=t.getAttribute("data-height"),v=e.parseDimensionPx(f),C=e.parseDimensionPx(x);f&&e.host.setAttribute("data-width",f),x&&e.host.setAttribute("data-height",x),v&&e.host instanceof HTMLElement&&(e.host.style.width=v),C&&e.host instanceof HTMLElement&&(e.host.style.height=C),t.hasAttribute("data-timeline-locked")&&e.host.setAttribute("data-timeline-locked",""),e.host.appendChild($p(t))}else e.hasTemplate?e.host.appendChild(document.importNode(n,!0)):e.host.innerHTML=e.fallbackBodyInnerHtml;i&&Yp(e,n,i);for(let f of c){let x=document.createElement("script");if(f.type&&(x.type=f.type),x.async=!1,f.kind==="external"?x.src=f.src:f.type.toLowerCase()==="module"?x.textContent=f.content:f.scopeCompositionId?x.textContent=iu(f.content,f.scopeCompositionId,"[HyperFrames] composition script error:",a,i||f.scopeCompositionId,o):x.textContent=`(function(){${f.content}})();`,document.body.appendChild(x),e.injectedScripts.push(x),f.kind==="external"){let v=await zp(x);v.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.authoredCompositionId,runtimeCompositionId:e.runtimeCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:f.src,loadStatus:v.status,elapsedMs:v.elapsedMs}})}}}async function mu(e){let t=fo();if(du(),t.length===0)return;let n=fu(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`);uo(i),await co({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 pu(e){let t=fo();if(du(),t.length===0)return;let n=fu(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}uo(i);try{let c=l!=null?document.querySelector(`template#${CSS.escape(l)}-template`):null;if(c){await co({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 m=await fetch(o);if(!m.ok)throw new Error(`HTTP ${m.status}`);let f=await m.text(),v=new DOMParser().parseFromString(f,"text/html");uu(v,u);let C=(l?v.querySelector(`template#${CSS.escape(l)}-template`):null)??v.querySelector("template"),y=C?C.content:v.body,w=C?void 0:Array.from(v.head.querySelectorAll("style")),T=C?void 0:Array.from(v.head.querySelectorAll("script")),N=Array.from(v.head.querySelectorAll('link[rel="stylesheet"], link[rel="preconnect"]'));await co({host:i,authoredCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:y,hasTemplate:!!C,fallbackBodyInnerHtml:v.body.innerHTML,compositionUrl:u,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,headStyles:w,headScripts:T,headLinks:N,declaredVariableDefaults:Jt(v.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"}}),uo(i)}}))}function Yp(e,t,n){let i={...e.declaredVariableDefaults??(t instanceof Element?Jt(t):{}),...fa(e.host)};ca(e.host),Object.keys(i).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[n]=i,Jr(e.host,{...ua(e.host,i,window),...zn()})):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[n]}function Xp(e){return e instanceof HTMLElement?e.dataset.captionWrapper!=="true"?e:e.querySelector(":scope > span")??null:null}function Jp(){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 Qp(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 mo(){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=Jp();for(let r of t){let i=null;if(r.wordId&&(i=Xp(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(c=>c.vars.color!==void 0).sort((c,m)=>c.startTime()-m.startTime()),u=s[0]?String(s[0].vars.color):"";for(let c of s)String(c.vars.color)===u?r.dimColor&&(c.vars.color=r.dimColor):r.activeColor&&(c.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=Qp(i);e.set(l,o)}}}).catch(()=>{})}var ho="data-hf-edit-base-x",go="data-hf-edit-base-y",Gt="data-hf-edit-original-translate",gr=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},Zp=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},hu=/^-?(?:\d+(?:\.\d+)?|\.\d+)px$/,po=(e,t)=>hu.test(e)&&hu.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,e0=(e,t,n)=>{if(!e||e==="none")return`${t} ${n}`;let[r,i,o]=Zp(e);if(r===void 0)return`${t} ${n}`;if(i===void 0)return`${po(r,t)} ${n}`;let a=o===void 0?"":` ${o}`;return`${po(r,t)} ${po(i,n)}${a}`},t0=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},n0=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""}},xo=new WeakMap;function r0(e,t){let n=xo.get(e);if(!t?.force&&n!==void 0&&e.style.getPropertyValue("translate")!==n){Me("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=gr(e.getAttribute("data-x"))-gr(e.getAttribute(ho)),i=gr(e.getAttribute("data-y"))-gr(e.getAttribute(go));e.hasAttribute(Gt)||e.setAttribute(Gt,n0(e)),n===void 0&&t0(e);let o=e.getAttribute(Gt)??"",a=e0(o,`${r}px`,`${i}px`);e.style.setProperty("translate",a),xo.set(e,e.style.getPropertyValue("translate"))}function xr(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(`[${Gt}]:not([${ho}]):not([${go}])`);for(let s=0;s<o.length;s++){let u=o[s];if(u===void 0||!i(u))continue;let c=u.getAttribute(Gt)??"";c===""?u.style.removeProperty("translate"):u.style.setProperty("translate",c),u.removeAttribute(Gt),xo.delete(u)}let a=e.querySelectorAll(`[${ho}], [${go}]`),l=0;for(let s=0;s<a.length;s++){let u=a[s];u===void 0||!i(u)||(r0(u,t),l+=1)}return l}var gu="__hfPositionEditsSeekReapplyWrapped",xu=new WeakSet,bu=new WeakMap,yu=new WeakMap;function Su(e){let t=e,n=()=>{try{xr(t.document)}catch{}},r=m=>typeof m=="function"&&(xu.has(m)||!!m[gu]),i=m=>{xu.add(m);try{Object.defineProperty(m,gu,{value:!0})}catch{}},o=m=>{if(typeof m!="function"||r(m))return m;let f=function(...x){let v=m.apply(this,x);return n(),v};return i(f),f},a=(m,f)=>{let x=bu.get(m);if(x?.has(f))return!0;let v=Object.getOwnPropertyDescriptor(m,f);if(v?.configurable===!1){let w=m[f];return typeof w=="function"&&(m[f]=o(w),n()),!1}let C=m[f],y=v?.set;return Object.defineProperty(m,f,{configurable:!0,enumerable:v?.enumerable??!0,get:()=>C,set:w=>{C=o(w),y?.call(m,w)}}),C=o(C),x??(x=new Set),x.add(f),bu.set(m,x),n(),!0},l=(m,f)=>{let x=yu.get(t),v=Object.getOwnPropertyDescriptor(t,m);if(!x?.has(m)){if(v?.configurable===!1){let w=t[m];return w?a(w,f):!1}let y=t[m];Object.defineProperty(t,m,{configurable:!0,enumerable:v?.enumerable??!0,get:()=>y,set:w=>{y=w,y&&a(y,f)}}),x??(x=new Set),x.add(m),yu.set(t,x)}let C=t[m];return C?a(C,f):!1},s=()=>{let m=l("__hf","seek"),f=l("__player","renderSeek");return m&&f};if(s())return;let u=120,c=t.setInterval(()=>{if(s()){t.clearInterval(c);return}u-=1,u<=0&&t.clearInterval(c)},50)}function br(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 yr(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var vu=new Set(["img","video","audio","source"]);function i0(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 o0(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}function a0(e){return e.replace(/[;{}<>\r\n]/g,"")}function s0(e){if(yr(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 bo(e,t){let n=e.closest("[data-composition-id]"),r=t.get(n);if(r)return r;let i=br(e);return t.set(n,i),i}function l0(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 u0(e){return e.querySelector("[data-hf-root]")??e.getElementById("stage")??e.body?.firstElementChild??e.body}function c0(e,t){let n=new Set,r=u0(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=bo(i,t);for(let[a,l]of Object.entries(o)){let s=s0(l);s!==null&&i instanceof HTMLElement&&i.style.setProperty(`--${a}`,a0(s))}}}function yo(e){let t=new Map;c0(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(!vu.has(n.tagName.toLowerCase())){console.warn(`[hyperframes] Ignoring data-var-src on <${n.tagName.toLowerCase()}>: variable-bound src is only allowed on ${Array.from(vu).join("/")}.`);continue}let i=i0(bo(n,t)[r]);if(i!==null){if(!o0(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=bo(n,t)[r];yr(i)&&l0(n,String(i))}}var Qe=new Map,d0="data-hf-color-grading-canvas",f0="__hf_color_grading_canvas__";function Mu(){if(typeof MutationObserver>"u"||typeof document>"u")return;let e=document.documentElement;if(!e)return;let t=r=>{r instanceof HTMLElement&&(r.hasAttribute(Xn)||r.setAttribute(Xn,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 m0=16,p0=4,Bt={enabled:!1,position:.5,softness:0,lineWidth:2},So=["#000000","#ffffff"],h0=["#1a1a1a","#f5f5dc"],kn=3,g0=kn-1,x0=5,vo=`${$e}.0`,Eu=`${$e-1}.0`,b0=`${kn}.0`,y0=`${(g0+.5)/kn}`;function Sr(e){let t=e.getAttribute(rn);return t==null?null:ms(t,br(e))}var S0=["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(`
|
|
349
|
+
`),v0=["#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) * ${Eu};`," float lower = floor(position);",` float upper = min(lower + 1.0, ${Eu});`,` float y = (row + 0.5) / ${b0};`,` vec4 before = texture2D(u_advanced, vec2((lower + 0.5) / ${vo}, y));`,` vec4 after = texture2D(u_advanced, vec2((upper + 0.5) / ${vo}, y));`," return mix(before, after, position - lower);","}","vec4 advancedConfig(float index){",` return texture2D(u_advanced, vec2((index + 0.5) / ${vo}, ${y0}));`,"}","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(`
|
|
350
|
+
`),E0=["#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(`
|
|
351
|
+
`),C0=["#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(`
|
|
352
|
+
`),_0=["#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(`
|
|
353
|
+
`);function vt(e){return e instanceof HTMLVideoElement||e instanceof HTMLImageElement}function Cu(e){let t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function _u(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 Ar(e,t=v0){let n=_u(e,S0,e.VERTEX_SHADER),r=_u(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 vr(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 A0(e,t){let n=Ar(e,E0);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 w0(e,t){let n=Ar(e,C0);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 T0(e,t){let n=Ar(e,_0);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 Fn(e,t=e.UNSIGNED_BYTE,n=e.LINEAR){let r=vr(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 Cr(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 Eo(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 Au(e,t,n){t&&e.deleteProgram(t);for(let r of n)r&&e.deleteTexture(r)}function wo(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});if(!t)return null;let n=Ar(t),r=vr(t),i=vr(t,t.NEAREST),o=vr(t,t.NEAREST);if(!n||!r||!i||!o)return Au(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:Eo(t,n,Jn),detailUniforms:Eo(t,n,bi),effectUniforms:Eo(t,n,yi),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")}}):(Au(t,n,[r,i,o]),null)}function R0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function L0(e){if(!R0(e))return{...Bt};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,Bt.position,0,1),softness:t(e.softness,Bt.softness,0,.25),lineWidth:t(e.lineWidth,Bt.lineWidth,0,12)}}function ku(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 wr(e){return e instanceof Error?e.message:"LUT failed to load"}function F0(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 Du(e){let t=e.id||e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return F0(t)}function To(e){let t=ku(e);if("error"in t)return{state:"error",message:t.error};let n=Qe.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=>za(o,{maxSize:jn})),i={state:"pending",promise:r};for(;Qe.size>=m0;){let o=Qe.keys().next().value;if(!o)break;Qe.delete(o)}return Qe.set(t.href,i),r.then(o=>{Qe.get(t.href)===i&&Qe.set(t.href,{state:"ready",lut:o})},o=>{Qe.get(t.href)===i&&Qe.set(t.href,{state:"error",message:wr(o)})}),i}function wu(e,t,n){if(e.lut?.src===t)return e.lut;let r=ui(n),{gl:i,program:o}=e;try{return Iu(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=wr(a),e.lutLoadingSrc=null,L("runtime.colorGrading.uploadLut",a),null}}async function N0(e){let t=To(e);if(t.state==="ready")return t.lut;if(t.state==="pending")return t.promise;throw new Error(t.message)}function Iu(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 M0(e,t,n){let r=ui(n),{gl:i,program:o}=e;return Iu(i,o.lutTexture,r),{src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height}}function Ke(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function Ro(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),Ke(e.gl,t.scratch),Ke(e.gl,t.blur),t.bloom&&Ke(e.gl,t.bloom),e.effectTargets=null)}function Lo(e){let t=e.kuwaharaTargets;t&&(e.gl.deleteProgram(t.horizontalProgram.program),e.gl.deleteProgram(t.resolveProgram.program),Ke(e.gl,t.moments),Ke(e.gl,t.output),e.kuwaharaTargets=null)}function Er(e,t=!1){Ro(e),Lo(e),k0(e.gl,e.program),t&&e.gl.getExtension("WEBGL_lose_context")?.loseContext()}function k0(e,t){e.deleteTexture(t.texture),e.deleteTexture(t.lutTexture),e.deleteTexture(t.advancedTexture),e.deleteBuffer(t.quad),e.deleteProgram(t.program)}function D0(e){let t=wo(e.canvas);return t?(Er(e),e.gl=t.gl,e.program=t.program,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function Ao(e){if(!e.sourceHidden)return;e.element.removeAttribute(on);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 I0(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=A0(t,e.program.quad),r=Fn(t),i=Fn(t);return!n||!r||!i?(n&&t.deleteProgram(n.program),r&&Ke(t,r),i&&Ke(t,i),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:r,blur:i,bloom:null},e.effectTargets)}function P0(e,t){return t.bloom||(t.bloom=Fn(e.gl),e.effectError=t.bloom?null:"Framebuffer effects unavailable"),t.bloom}function Tu(e){let t=e.effectTargets;t?.bloom&&(Ke(e.gl,t.bloom),t.bloom=null)}function O0(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=w0(t,e.program.quad),o=T0(t,e.program.quad),a=Fn(t,n.HALF_FLOAT_OES,t.NEAREST),l=Fn(t);return!i||!o||!a||!l?(G0(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 G0(e,t,n,r,i){t&&e.deleteProgram(t.program),n&&e.deleteProgram(n.program),r&&Ke(e,r),i&&Ke(e,i)}function Pu(e,t,n,r,i){let o=Math.max(1,Math.ceil(r)),a=Math.max(1,Math.ceil(i));return Cr(e,t,o,a),Cr(e,n,o,a),{width:o,height:a}}function _r(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),Nn(e,t)}function H0(e,t,n,r,i,o,a){let l=Pu(e,t.scratch,r,i/2,o/2),s=a/2;_r(e,t.blurProgram,n,t.scratch,l,{x:1,y:0},s,!0,.5),_r(e,t.blurProgram,t.scratch.texture,r,l,{x:0,y:1},s,!0)}function B0(e,t,n,r,i,o,a){let l=n;for(let s=0;s<Math.max(1,Math.floor(a));s++)_r(e,t.blurProgram,l,t.scratch,i,{x:1,y:0},o),_r(e,t.blurProgram,t.scratch.texture,r,i,{x:0,y:1},o),l=r.texture}function Nn(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 U0(e,t,n,r,i,o,a,l){Cr(e,t.moments,i.width,i.height),Cr(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),Nn(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),Nn(e,u)}function W0(e,t,n,r){if(n<=0)return!1;let i=Pu(e.gl,t.scratch,t.blur,r.width,r.height);return B0(e.gl,t,e.program.texture,t.blur,i,.75+Math.pow(n,1.35)*32,n>.55?3:2),!0}function V0(e,t,n,r,i,o){if(n<=0)return Tu(e),null;o||Tu(e);let a=o?P0(e,t):t.blur;return a?(H0(e.gl,t,e.program.texture,a,i.width,i.height,r),a.texture):null}function z0(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&&Ro(e),{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let l=I0(e);if(!l)return{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let s=W0(e,l,o,n),u=V0(e,l,a,t.effects.bloomRadius,n,s);return{blurReady:s,bloomReady:u!==null,blurTexture:l.blur.texture,bloomTexture:u??i.texture}}function $0(e,t,n,r,i,o,a){let l=t.effects.kuwahara;if(l<=0&&!o)return e.kuwaharaTargets&&a&&Lo(e),{kuwaharaReady:!1,kuwaharaTexture:e.program.texture};let s=O0(e);return!s||l<=0?{kuwaharaReady:!1,kuwaharaTexture:s?.output.texture??e.program.texture}:(U0(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 Ou(e,t,n,r,i={}){let o=i.releaseIdleTargets??!0;e.effectError=null;let a=z0(e,t,n,o),l=$0(e,t,n,r,a.blurReady,i.preserveKuwahara??!1,o);return{...a,...l}}function q0(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=ku(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=To(t);return i.state==="ready"?wu(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||(wu(e,r.href,o),ke(e))},o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=wr(o),e.lutLoadingSrc=null,ke(e))})),null)}function Rn(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&&vt(n))return n;try{let r=document.querySelector(t);return r&&vt(r)?r:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&vt(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&vt(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&&vt(r)?r:null}catch{return null}}function Gu(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 Hu(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 Bu(e){if(!e.id)return null;let t=document.getElementById(`__render_frame_${e.id}__`);return t instanceof HTMLImageElement&&Hu(t)?t:null}function Ru(e){if(!(e instanceof HTMLVideoElement))return!1;let t=Bu(e);if(!t)return!1;let n=window.getComputedStyle(t);return n.display!=="none"&&n.visibility!=="hidden"}function j0(e){return e instanceof HTMLImageElement&&e.classList.contains("__render_frame__")}function K0(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}function Uu(e){if(e instanceof HTMLVideoElement){let t=Bu(e);if(t)return t}return Hu(e)?e:null}function Lu(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 Y0(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=Lu(o,"x"),l=Lu(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 Wu(e,t,n,r,i,o){if(e<=0||t<=0||n<=0||r<=0)return{scaleX:1,scaleY:1,offsetX:0,offsetY:0};let a=i||"fill",l=e,s=t;if(a==="contain"||a==="cover"||a==="scale-down"){let f=a==="cover"?Math.max(e/n,t/r):Math.min(e/n,t/r);l=n*f,s=r*f,a==="scale-down"&&l>n&&s>r&&(l=n,s=r)}else a==="none"&&(l=n,s=r);let u=Y0(o||"center"),c=(e-l)*u.x/e,m=(t-s)*u.y/t;return{scaleX:l/e,scaleY:s/t,offsetX:c,offsetY:m}}function X0(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function Fu(e,t){return Math.max(0,Math.round(e>0?e:t))}function J0(e,t){let{element:n,canvas:r}=e,i=n.parentElement;i&&X0(e,i);let o=window.getComputedStyle(t);gs(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=Fu(n.offsetWidth,a.width),s=Fu(n.offsetHeight,a.height);if(l<=0||s<=0)return r.style.display="none",null;let u=Math.max(1,window.devicePixelRatio||1),c=Math.round(l*u),m=Math.round(s*u);return r.width!==c&&(r.width=c),r.height!==m&&(r.height=m),{width:c,height:m}}function Ht(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 Et(e,t,n,r){e.set(r,(t*$e+n)*4)}function ut(e,t){return Math.min(1,Math.max(1/255,(e*(127/t)+128)/255))}function Co(e,t,n){return e.length>=3?di(e,t,n):new Float32Array($e)}function St(e,t){return e[t]??0}function Q0(e,t,n){let r=Rt(t.red),i=Rt(t.green),o=Rt(t.blue),a=Rt(t.master),l=Co(n.hueVsHue,-180,180),s=Co(n.hueVsSaturation,-1,1),u=Co(n.hueVsLuma,-1,1);for(let c=0;c<$e;c+=1)Et(e,0,c,[St(r,c),St(i,c),St(o,c),St(a,c)]),Et(e,1,c,[ut(St(l,c),180),ut(St(s,c),1),ut(St(u,c),1),1])}function Z0(e,t,n){let r=n*x0;Et(e,2,r,[t.key.hue.center/360,t.key.hue.range/180,t.key.hue.softness/180,1]),Et(e,2,r+1,[t.key.saturation.min,t.key.saturation.max,t.key.saturation.softness/.5,0]),Et(e,2,r+2,[t.key.luma.min,t.key.luma.max,t.key.luma.softness/.5,0]),Et(e,2,r+3,[ut(t.correction.hueShift,180),ut(t.correction.saturation,1),ut(t.correction.luma,1),ut(t.correction.temperature,1)]),Et(e,2,r+4,[ut(t.correction.tint,1),.5,.5,1])}function eh(e,t,n){let r=new Float32Array($e*kn*4);Q0(r,e,t);let i=0;for(let o of n)o.enabled&&(Z0(r,o,i),i+=1);return r}var Nu=new WeakMap;function th(e,t,n){let r=Nu.get(e);if(r?.hueCurves===t&&r.secondaries===n)return r.signature;let i=JSON.stringify([e,t,n]);return Nu.set(e,{hueCurves:t,secondaries:n,signature:i}),i}function nh(e,t,n,r){let{curves:i,hueCurves:o}=n,a=th(i,o,r);if(t.advancedSignature===a)return;let l=Uint8Array.from(eh(i,o,r),tn);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,$e,kn,0,e.RGBA,e.UNSIGNED_BYTE,l),t.advancedSignature=a}function _o(e,t,n){e.uniform3f(t,n.hue/360,n.amount,n.level)}function Vu(e,t,n,r,i,o,a,l,s,u,c,m){e.uniform1i(t.source,0),e.uniform1i(t.blurSource,1),e.uniform1i(t.lut,2),e.uniform1i(t.kuwaharaSource,3),e.uniform1i(t.bloomSource,4),e.uniform1i(t.advanced,5),e.uniform2f(t.resolution,s.width,s.height),e.uniform2f(t.uvScale,u.scaleX,u.scaleY),e.uniform2f(t.uvOffset,u.offsetX,u.offsetY),e.uniform1f(t.blurReady,i?1:0),e.uniform1f(t.bloomReady,o?1:0),e.uniform1f(t.kuwaharaReady,a?1:0),e.uniform1f(t.lutEnabled,r?1:0),e.uniform1f(t.lutSize,r?.size??2),e.uniform2f(t.lutTextureSize,r?.textureWidth??1,r?.textureHeight??1),e.uniform3f(t.lutDomainMin,r?.domainMin[0]??0,r?.domainMin[1]??0,r?.domainMin[2]??0),e.uniform3f(t.lutDomainMax,r?.domainMax[0]??1,r?.domainMax[1]??1,r?.domainMax[2]??1),e.uniform1f(t.lutIntensity,n.lut?.intensity??0);let{curves:f,hueCurves:x,secondaries:v}=n,C=Ei(f),y=Ci(x),w=_i(v)?v.reduce((D,I)=>D+Number(I.enabled),0):0;(C||y||w>0)&&nh(e,t,n,v),_o(e,t.shadowWheel,n.wheels.shadows),_o(e,t.midtoneWheel,n.wheels.midtones),_o(e,t.highlightWheel,n.wheels.highlights),e.uniform1f(t.rgbCurvesEnabled,C?1:0),e.uniform1f(t.hueCurvesEnabled,y?1:0),e.uniform1f(t.secondaryCount,w);for(let[D,I]of t.adjustUniforms)e.uniform1f(I,n.adjust[D]);for(let[D,I]of t.detailUniforms)e.uniform1f(I,n.details[D]);e.uniform1f(t.grainSeed,c),e.uniform1f(t.effectTime,m);for(let[D,I]of t.effectUniforms)e.uniform1f(I,n.effects[D]);let T=n.palette??(n.effects.engraving>0||n.effects.crosshatch>0?h0:So),N=T[T.length-1]??So[1];e.uniform1f(t.paletteSize,T.length),Ht(e,t.palette0,T[0]??So[0]),Ht(e,t.palette1,T[1]??N),Ht(e,t.palette2,T[2]??N),Ht(e,t.palette3,T[3]??N),Ht(e,t.palette4,T[4]??N),Ht(e,t.palette5,T[5]??N),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 rh(e){if(!e.sourceHidden){let t=e.element.getAttribute(Xn);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(on,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function Ze(e){let t=cs.find(n=>n.path===e);if(!t)throw new Error(`Missing color-grading animation property: ${e}`);return t}var zu=Ze("intensity"),$u=Ze("lut.intensity"),qu=Ze("adjust.exposure"),ju=Ze("effects.kuwahara"),Ku=[["blur",Ze("effects.blur")],["bloom",Ze("effects.bloom")],["kuwahara",ju],["pixelate",Ze("effects.pixelate")],["ascii",Ze("effects.ascii")],["dither",Ze("effects.dither")]],Yu=[zu,$u,qu,...Ku.map(([,e])=>e)];function Ct(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 Ln(e,t){return t!==null&&(ps(t)||Yu.some(n=>Ct(e,n)!==null))}function ih(e,t){let n=null;for(let[r,i]of Ku){let o=Ct(e,i);o!==null&&(n??(n={...t.effects}),n[r]=o)}return n}function oh(e){let{element:t,grading:n}=e,r=Ct(t,zu),i=Ct(t,$u),o=Ct(t,qu),a=ih(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 Xu(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 Ju(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 ke(e){if(e.destroyed||e.contextLost)return!1;let t=Uu(e.element);if(!t)return e.hasDrawn||(e.canvas.style.display="none"),!1;let n=Gu(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=j0(t);if(s&&K0(e,t),s||!a){let v=window.getComputedStyle(s?t:e.element);e.sourceOpacityForCanvas=v.opacity||"1",e.sourceVisibleForCanvas=(s||l!=="hidden")&&v.visibility!=="hidden"}let u=J0(e,r);if(!u)return!1;let c=window.getComputedStyle(r),m=Wu(u.width,u.height,n.width,n.height,c.objectFit,c.objectPosition),{gl:f,program:x}=e;try{let v=oh(e),C=q0(e);Xu(f,x.texture,t);let y=Ct(e.element,ju)!==null,w=Ou(e,v,u,m,{preserveKuwahara:y});f.bindFramebuffer(f.FRAMEBUFFER,null),f.viewport(0,0,u.width,u.height),f.useProgram(x.program),Ju(f,x,w);let T=window.__player?.getTime?.(),N=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(N*60);return Vu(f,x,v,C,w.blurReady,w.bloomReady,w.kuwaharaReady,e.compare,u,m,D,N),Nn(f,x),rh(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 ah(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 sh(){let e=document.createElement("canvas"),t=wo(e);return t?{canvas:e,...t,lut:null,effectTargets:null,kuwaharaTargets:null,effectError:null}:null}function lh(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 uh(e,t,n,r){let i=Uu(t);if(!i)return null;let o=Gu(i);if(!o)return null;let a=ah(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=Wu(a.width,a.height,o.width,o.height,s.objectFit,s.objectPosition);return Xu(e.gl,e.program.texture,i),{dimensions:a,uv:u,effectTime:lh(t,r),grainSeed:Du(t)+(t instanceof HTMLVideoElement?Math.floor(t.currentTime*60):0)}}async function ch(e,t,n,r,i=!1){let o=uh(e,t,r,i);if(!o)return null;let{dimensions:a,uv:l,grainSeed:s,effectTime:u}=o,c=[];for(let m of n.slice(0,32)){let f=Qn(m.grading);if(!f){c.push({id:m.id,dataUrl:null,error:"Invalid grading"});continue}let x=null;try{f.lut&&(e.lut?.src!==f.lut.src&&(e.lut=M0(e,f.lut.src,await N0(f.lut.src))),x=e.lut),c.push({id:m.id,dataUrl:dh(e,f,x,a,l,s,u)})}catch(v){c.push({id:m.id,dataUrl:null,error:wr(v)})}}return{...a,images:c}}function dh(e,t,n,r,i,o,a){let{canvas:l,gl:s,program:u}=e,c=Ou(e,t,r,i,{releaseIdleTargets:!1});return s.bindFramebuffer(s.FRAMEBUFFER,null),s.viewport(0,0,r.width,r.height),s.useProgram(u.program),Ju(s,u,c),n||(e.lut=null),Vu(s,u,t,n,c.blurReady,c.bloomReady,c.kuwaharaReady,Bt,r,i,o,a),Nn(s,u),l.toDataURL("image/png")}function je(e,t,n,r){t.addEventListener(n,r),e.cleanup.push(()=>t.removeEventListener(n,r))}function fh(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 Mn(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,ke(e),!e.destroyed&&!t.paused&&!t.ended&&Mn(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,ke(e),!e.destroyed&&!t.paused&&!t.ended&&Mn(e)})}function mh(e){let t=()=>{ke(e)};if(je(e,e.element,"load",t),je(e,e.element,"loadedmetadata",t),je(e,e.element,"loadeddata",t),je(e,e.element,"seeked",t),je(e,e.element,"timeupdate",t),je(e,window,"resize",t),e.element instanceof HTMLVideoElement&&(je(e,e.element,"play",()=>Mn(e)),je(e,e.element,"pause",t)),je(e,e.canvas,"webglcontextlost",n=>{n.preventDefault(),e.contextLost=!0,e.drawError="WebGL context lost",e.canvas.style.display="none",Ao(e)}),je(e,e.canvas,"webglcontextrestored",()=>{if(e.contextLost=!1,!D0(e)){e.contextLost=!0,e.drawError="WebGL context restore failed",Ao(e);return}e.drawError=null,ke(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(),ke(e)}))});o.observe(e.element,{attributes:!0,attributeFilter:["style"]}),e.cleanup.push(()=>o.disconnect())}}function ph(e){if(e.destroyed)return null;e.destroyed=!0,fh(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();return e.cleanup.length=0,e.canvas.remove(),Ro(e),Lo(e),Ao(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 Qu(e,t){return e.removeAttribute("style"),t.id?e.id=`${os}${t.id}`:e.removeAttribute("id"),e.className=f0,e.setAttribute(d0,"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 hh(e){return Qu(document.createElement("canvas"),e)}function Zu(){let e=new WeakMap,t=new Set,n=[],r=null,i=null,o=Promise.resolve(),a=!1,l=(_,b,S)=>{let A=e.get(_);if(A)return A.grading=b,A.source=S,ke(A),_ instanceof HTMLVideoElement&&!_.paused&&Mn(A),!0;let R=n.pop();if(R)Qu(R.canvas,_);else{let G=hh(_),B=wo(G);if(!B)return G.remove(),!1;R={canvas:G,gl:B.gl,program:B.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}let F={element:_,...R,grading:b,compare:{...Bt},lut:null,lutLoadingSrc:null,lutError:null,drawError:null,effectTargets:null,kuwaharaTargets:null,effectError:null,source:S,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(_).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(_).visibility!=="hidden",hasDrawn:!1,contextLost:!1,grainSeed:Du(_),destroyed:!1};return e.set(_,F),t.add(_),mh(F),ke(F),_ instanceof HTMLVideoElement&&!_.paused&&Mn(F),!0},s=(_,b)=>{if(a)return!1;let S=Rn(_);if(!S)return!1;let A=e.get(S);if(!A){let R=Sr(S);if(!Ln(S,R)||!l(S,R,"attribute"))return!1;A=e.get(S)}return A?(A.compare=L0(b),ke(A),!0):!1},u=_=>{let b=e.get(_);if(!b)return;let S=ph(b);S&&(b.contextLost||n.length>=p0?Er(S,!0):n.push(S)),e.delete(_),t.delete(_)},c=()=>{if(a)return 0;let _=new Set;document.querySelectorAll(`video[${rn}], img[${rn}]`).forEach(S=>{if(!vt(S))return;_.add(S);let A=Sr(S);Ln(S,A)&&(Cu(S)||Ru(S))?l(S,A,"attribute"):u(S)});for(let S of t){let A=e.get(S);A&&(!S.isConnected||A.source==="attribute"&&!_.has(S))&&u(S)}return t.size},m=()=>{if(a)return 0;let _=0;for(let b of t){let S=e.get(b);S&&ke(S)&&(_+=1)}return _},f=async()=>{let _=new Set;for(let b of t){let S=e.get(b)?.grading.lut;if(!S?.src.trim()||(S.intensity??1)<=0)continue;let A=To(S.src);A.state==="pending"&&_.add(A.promise)}return _.size>0&&await Promise.allSettled(_),m(),_.size},x=()=>{if(a)return 0;let _=0;for(let b of t){let S=e.get(b);!S||!Yu.some(R=>Ct(b,R)!==null)||b instanceof HTMLVideoElement&&!b.paused&&!b.ended||ke(S)&&(_+=1)}return _},v=(_,b)=>{if(a)return!1;let S=Rn(_);if(!S)return!1;let A=Qn(b);return Ln(S,A)?l(S,A,"live"):(u(S),!0)},C=(_,b)=>{if(!vt(_))return!1;let S=e.get(_);if(!S){if(!b)return!1;let A=Sr(_);return Ln(_,A)&&l(_,A,"attribute")}return S.sourceVisibleForCanvas=b,!b&&S.source==="attribute"&&u(_),!0},y=_=>{let b=Rn(_);if(!b)return{state:"missing",message:"Media not found"};let S=e.get(b);if(S)return S.effectError?{state:"unavailable",message:S.effectError}:S.drawError?{state:"unavailable",message:S.drawError}:S.lutError?{state:"unavailable",message:`LUT error: ${S.lutError}`}:S.grading.lut&&S.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:S.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:S.lut?"Shader + LUT active":"Shader active"};let A=Sr(b);return Ln(b,A)?!Cu(b)&&!Ru(b)?{state:"pending",message:"Waiting for visible media"}:{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},w=async(_,b,S)=>{let A=async()=>{if(a||b.length===0)return null;let F=Rn(_);return!F||(i??(i=sh()),!i)?null:ch(i,F,b,S?.maxDimension,S?.useMediaTime)},R=o.then(A,A);return o=R.then(()=>{},()=>{}),R},T=_=>{let b=Rn(_);if(!(b instanceof HTMLVideoElement))return null;if(!b.paused)return()=>{};let S=b.currentTime,A=b.loop,R=b.muted;return b.loop=!0,b.muted=!0,(b.ended||Number.isFinite(b.duration)&&S>=b.duration)&&(b.currentTime=0),b.play().catch(()=>{}),()=>{b.pause(),b.loop=A,b.muted=R,b.currentTime=S}},N=()=>{if(!a){a=!0,r?.disconnect(),r=null;for(let _ of t)u(_);for(let _ of n)Er(_,!0);n.length=0,i&&(Er(i,!0),i=null)}};document.body&&(r=new MutationObserver(()=>c()),r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[rn]}));let D={refresh:c,redraw:m,redrawAnimated:x,waitForActiveLuts:f,setGrading:v,setCompare:s,setSourceVisibility:C,getStatus:y,renderPreviews:w,startPreviewPlayback:T,destroy:N},I=window;return I.__hf=I.__hf||{},I.__hf.colorGrading=D,c(),D}var Tr=class{constructor(t){pe(this,"_baseTime",0);pe(this,"_playStartMs",null);pe(this,"_rate",1);pe(this,"_duration",1/0);pe(this,"_nowMs");pe(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}};function ec(e){return!Number.isFinite(e)||e<=0?1:e}function gh(e,t){t||e.paused||!Un().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function xh(e,t){let{elapsed:n,mediaStart:r,scheduledAt:i,safeRate:o,clipDuration:a}=t,l=Number.isFinite(a)&&a>0,s=a*o;if(n>=0){let c=s-n;return l&&c<=0?!1:(l?e.start(0,n+r,c):e.start(0,n+r),!0)}let u=-n/o;return l?e.start(i+u,r,s):e.start(i+u,r),!0}var Rr=class{constructor(){pe(this,"_ctx",null);pe(this,"_bufferCache",new Map);pe(this,"_failedSrcs",new Set);pe(this,"_activeSources",[]);pe(this,"_masterGain",null);pe(this,"_rateAnchorCtx",0);pe(this,"_rateAnchorComp",0);pe(this,"_rate",1);pe(this,"_paused",!0);pe(this,"_playGeneration",0)}async init(){try{return this._ctx=new AudioContext,this._masterGain=this._ctx.createGain(),this._masterGain.connect(this._ctx.destination),!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}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=ec(s),m=this._ctx.createBufferSource();m.buffer=n,m.playbackRate.value=c;let f=this._ctx.createGain();f.gain.value=a,m.connect(f),f.connect(this._masterGain);let x=o-r,v=this._ctx.currentTime;if(this._rate=c,this._rateAnchorCtx=v,this._rateAnchorComp=o,!xh(m,{elapsed:x,mediaStart:i,scheduledAt:v,safeRate:c,clipDuration:u}))return m.disconnect(),f.disconnect(),null;let C=t.muted;t.muted=!0,gh(t,C);let y={el:t,sourceNode:m,gainNode:f,compositionStart:r,mediaStart:i,scheduledAt:v,priorMuted:C,bounded:Number.isFinite(u)&&u>0};return this._activeSources.push(y),this._paused=!1,m.addEventListener("ended",()=>{let w=this._activeSources.indexOf(y);w!==-1&&(this._activeSources.splice(w,1),t.muted=C,this._activeSources.length===0&&(this._paused=!0))}),y}catch(c){return L("webAudioTransport.schedule",c),null}}setRate(t){let n=ec(t);if(n===this._rate)return!1;this._ctx&&!this._paused&&(this._rateAnchorComp=this.getTime(),this._rateAnchorCtx=this._ctx.currentTime),this._rate=n;for(let r of this._activeSources)try{r.sourceNode.playbackRate.value=n}catch(i){L("webAudioTransport.setRate",i)}return!0}hasBoundedActiveSources(){return this._activeSources.some(t=>t.bounded)}stopAll(){for(let t of this._activeSources){try{t.sourceNode.stop(),t.sourceNode.disconnect(),t.gainNode.disconnect()}catch{}t.el.muted=t.priorMuted}this._activeSources=[],this._paused=!0}setVolume(t){this._masterGain&&(this._masterGain.gain.value=Math.max(0,Math.min(1,t)))}setElementVolume(t,n){let r=Math.max(0,Math.min(1,n));for(let i of this._activeSources)if(i.el===t)try{i.gainNode.gain.value=r}catch(o){L("webAudioTransport.setElementVolume",o)}}setMuted(t){this._masterGain&&(this._masterGain.gain.value=t?0:1)}isActive(){return this._activeSources.length>0&&!this._paused}ownsElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t)}destroy(){if(this.stopAll(),this._bufferCache.clear(),this._failedSrcs.clear(),this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null}};var tc="data-hf-studio-manual-edit-gesture";function nc(e){return!Number.isInteger(e.tick)||e.tick<=0||e.tick%60!==0?!1:!(e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2)}var bh=/^\s*spring\(\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*\)\s*$/;function rc(e){return Math.max(0,Math.min(1,e))}function ic(e){let t=bh.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?rc(n):null}function oc(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=rc(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 yh=/^\s*wiggle\(\s*(\d+)\s*,\s*(easeOut|easeInOut|anticipate|uniform)\s*(?:,\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?)\s*)?\)\s*$/,Sh=Math.PI*2;function vh(e){let t=yh.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 Eh(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(Sh*t*e)}function ac(e,t){let n=vh(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=>Eh(a,n.wiggles,n.type,n.amplitude);return t?.set(r,o),o}var Ch=24,sc=e=>e>=1?1:0,_h=e=>e,Lr=String.raw`([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)`,Ah=new RegExp(String.raw`^\s*M\s*0\s*,\s*0\s+C\s*${Lr}\s*,\s*${Lr}\s+${Lr}\s*,\s*${Lr}\s+1\s*,\s*1\s*$`,"i");function lc(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function wh(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<Ch;l+=1){let s=(o+a)/2;lc(s,t,r)<e?o=s:a=s}return lc((o+a)/2,n,i)}function Th(e){let t=Ah.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=>wh(a,n,r,i,o)}function Rh(e,t){if(!e.startsWith("spring("))return null;let n=ic(e);if(n===null)return null;let r=t.get(n);if(r)return r;let i=o=>oc(o,n);return t.set(n,i),i}function Lh(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=Th(n);return i&&t.set(n,i),i}function uc(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"?sc:ac(s,i)??Rh(s,r)??Lh(s,n),a=(s,u,c=[])=>{let m=o(s);return m||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\(|$)/.test(s.trim())&&Me("custom_ease_parse_failed",{ease:s}),t.call(u,s,...c)??_h)};e.parseEase=function(u,...c){return a(u,this,c)};let l=e.registerEase;if(typeof l=="function"){l("hold",sc);let s=u=>{let c=m=>m;c.config=(...m)=>a(`${u}(${m.join(",")})`,e),l(u,c)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}var Fo="data-hf-authored-duration",No="data-hf-authored-end",cc=!1;function et(e){if(e){if(typeof e.pause!="function"){cc||(cc=!0,Me("timeline_missing_pause",{}));return}try{e.pause()}catch(t){L("runtime.timeline.pause",t)}}}function Fh(){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 dc(){let e=ys();aa(ge),xr(document),yo(document);let t=Fh();e.canonicalFps=t.fps??e.canonicalFps,ia(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG&&console.info("[hyperframes] render runtime fps",{canonicalFps:e.canonicalFps,source:t.source,rawFpsSource:t.rawFpsSource,rawFps:t.rawFps,fallbackReason:t.fallbackReason});let n=null,r=null,i=null,o=[],a=new Set,l=null,s=new Set,u=(d,p,g)=>{s.has(d)||(s.add(d),Me(p,g))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(d){L("runtime.init.site1",d)}let c=new Tr;e.transportClock=c;let m=new Rr,f=!1;m.init().then(d=>{f=d});let x=()=>{let d=window.gsap,p=window;if(!(!d?.registerPlugin||p.__hfAutoNoopRegistered))try{d.registerPlugin({name:"_auto",init:()=>!1}),p.__hfAutoNoopRegistered=!0}catch(g){u("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),L("runtime.autoMarker.install",g)}},v=()=>{let d=window.gsap;if(!d){u("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{uc(d)||u("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(p){u("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),L("runtime.customEase.install",p)}};x(),v(),document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden");try{da(document)}catch(d){L("runtime.init.cssVariables",d)}window.__timelines=window.__timelines||{};let C=()=>{let d=document.querySelector('[data-composition-id][data-root="true"]');if(d instanceof HTMLElement)return d;let p=Array.from(document.querySelectorAll("[data-composition-id]"));return p.find(g=>!g.parentElement?.closest("[data-composition-id]"))??p[0]??null};if(Array.isArray(window.__timelines)){let d=window.__timelines,p=C()?.getAttribute("data-composition-id")??"root",g={};if(d.length===1)g[p]=d[0];else for(let h=0;h<d.length;h++)g[`tl-${h}`]=d[h];window.__timelines=g}let y=C();y&&!y.hasAttribute("data-start")&&y.setAttribute("data-start","0");let w=d=>{o.push(d)},T=(d,p,g)=>{let h=g??`${d}:${JSON.stringify(p)}`;a.has(h)||(a.add(h),ge({source:"hf-preview",type:"diagnostic",code:d,details:p}))},N=d=>{let p={scale:1,focusX:960,focusY:540},g=[],h=[],E={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:()=>p,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>g,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:d.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>h,getRenderState:()=>({...E,time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying()})}},D=1/60,I=.75,_=.05,b=100,S=240,A=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??"")}},R=d=>{let p=d.toLowerCase();return p.includes("cannot read properties of null")||p.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:p.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:p.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},F=d=>{if(d==null||d.trim()==="")return null;let p=Number.parseFloat(d);return!Number.isFinite(p)||p<=0?null:`${p}px`},G=()=>C(),B=()=>{let d=G();if(!d)return;let p=F(d.getAttribute("data-width")),g=F(d.getAttribute("data-height"));p&&(d.style.width=p),g&&(d.style.height=g),p&&d.style.setProperty("--comp-width",p),g&&d.style.setProperty("--comp-height",g)},ne=()=>{let d=G(),p=Array.from(document.querySelectorAll("[data-composition-id]")).filter(g=>g.hasAttribute("data-duration")||g.hasAttribute("data-end"));for(let g of p){if(d&&g===d)continue;let h=g.getAttribute("data-duration"),E=g.getAttribute("data-end");h!=null&&!g.hasAttribute(Fo)&&g.setAttribute(Fo,h),E!=null&&!g.hasAttribute(No)&&g.setAttribute(No,E),g.removeAttribute("data-duration"),g.removeAttribute("data-end")}},H=()=>{let d=G();if(!d)return;d.style.position||(d.style.position="relative"),d.style.overflow="hidden";let p=F(d.getAttribute("data-width")),g=F(d.getAttribute("data-height"));p&&(d.style.width=p),g&&(d.style.height=g);let h=Array.from(d.children);for(let E of h){let k=E.tagName.toLowerCase();if(k==="script"||k==="style"||k==="link"||k==="meta"||!E.hasAttribute("data-start")||E.hasAttribute("data-hf-autostamped"))continue;let O=(E.style.top==="0px"||E.style.top==="0")&&(E.style.left==="0px"||E.style.left==="0")&&E.style.width==="100%"&&E.style.height==="100%",Q=/translate\(\s*-50%\s*,\s*-50%\s*\)/.test(E.style.transform);if(O&&Q&&!E.hasAttribute("data-width")&&!E.hasAttribute("data-height")){let Ce=E.style.top,Yt=E.style.left,_e=E.style.width,Xt=E.style.height;E.style.top="",E.style.left="",E.style.width="",E.style.height="";let re=window.getComputedStyle(E);re.top!=="auto"||re.bottom!=="auto"||re.left!=="auto"||re.right!=="auto"||re.width!=="0px"||re.height!=="0px"||(E.style.top=Ce,E.style.left=Yt,E.style.width=_e,E.style.height=Xt)}let W=window.getComputedStyle(E),le=W.position;if(le!=="absolute"&&le!=="fixed"&&(E.style.position="absolute"),!!E.style.top||!!E.style.bottom||W.top!=="auto"||W.bottom!=="auto"||(E.style.top="0"),!!E.style.left||!!E.style.right||W.left!=="auto"||W.right!=="auto"||(E.style.left="0"),k!=="audio"){let Ce=F(E.getAttribute("data-width")),Yt=F(E.getAttribute("data-height")),_e=W.width!=="0px"&&W.width!=="auto",Xt=W.height!=="0px"&&W.height!=="auto";Ce?!E.style.width&&!_e&&(E.style.width=Ce):!E.style.width&&W.width==="0px"&&(E.style.width="100%"),Yt?!E.style.height&&!Xt&&(E.style.height=Yt):!E.style.height&&W.height==="0px"&&(E.style.height="100%")}}},Y=(d,p=0,g)=>it({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:g?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(d,p),we=(d,p)=>it({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:p?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(d),V=(d,p=0)=>!d.hasAttribute("data-hf-auto-start")&&d.hasAttribute("data-start")?Math.max(0,Number(d.getAttribute("data-start")??0)||0)+p:Y(d,p),X=(d,p)=>{let g=d.tagName.toLowerCase();if(g==="script"||g==="style"||g==="link"||g==="meta")return!1;let h=g==="video"||g==="audio"?V(d,0):Y(d,0),E=we(d),k=d.getAttribute("data-composition-id");if(k){let Q=(window.__timelines??{})[k],W=null;if(Q&&typeof Q.duration=="function"){let ye=Number(Q.duration());Number.isFinite(ye)&&ye>0&&(W=ye)}!(d.hasAttribute("data-duration")||d.hasAttribute("data-end")||d.hasAttribute(Fo)||d.hasAttribute(No))&&(E==null||E<=0)&&W!=null&&(E=W)}let O=E!=null&&E>0?h+E:Number.POSITIVE_INFINITY;return p>=h&&(Number.isFinite(O)?p<O:!0)},z=!!document.querySelector("[data-composition-src]"),J=!1;{let d=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let p of d){let g=p.getAttribute("data-composition-id");if(g&&p.children.length===0&&document.querySelector(`template#${CSS.escape(g)}-template`)){J=!0;break}}}let xe=!z&&!J,P=d=>{if(!d||typeof d.duration!="function")return null;try{let p=Number(d.duration());return Number.isFinite(p)?Math.max(0,p):null}catch{return null}},M=d=>typeof d=="number"&&Number.isFinite(d)&&d>D,U=d=>{let p=Number(d.getAttribute("data-duration"));if(Number.isFinite(p)&&p>0)return p;let g=Number(d.getAttribute("data-playback-start")??d.getAttribute("data-media-start")??"0"),h=Number.isFinite(g)?Math.max(0,g):0;return Number.isFinite(d.duration)&&d.duration>h?Math.max(0,d.duration-h):null},se=()=>{let d=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(d.length===0)return null;let p=0;for(let g of d){let h=V(g,0);if(!Number.isFinite(h))continue;let E=U(g);E==null||E<=D||(p=Math.max(p,Math.max(0,h)+E))}return p>D?p:null},ie=()=>{let d=G();if(!d)return null;let p=window.__timelines??{},g=it({timelineRegistry:p,includeAuthoredTimingAttrs:!0}),h=0,E=Number.parseFloat(d.getAttribute("data-duration")??"");Number.isFinite(E)&&E>0&&(h=E);let k=Array.from(d.querySelectorAll("[data-composition-id][data-start]"));for(let O of k){if(!(O instanceof Element)||O.parentElement?.closest("[data-composition-id]")!==d)continue;let W=g.resolveStartForElement(O,0),le=g.resolveDurationForElement(O);!Number.isFinite(W)||le==null||le<=0||(h=Math.max(h,Math.max(0,W)+le))}return h>D?h:null},$=()=>{let d=se();return typeof d!="number"||!Number.isFinite(d)||d<=D?null:d},q=d=>M(d)?Math.max(D,d*I):D,j=()=>{let d=0;for(let p of e.deterministicAdapters){let g=p.getInferredDurationSeconds;if(typeof g!="function")continue;let h=null;try{h=g()}catch(E){L("runtime.init.adapterDuration",E)}typeof h=="number"&&Number.isFinite(h)&&h>0&&(d=Math.max(d,h))}return d>D?d:null},be=(d,p=0)=>{let g=P(d),h=$(),E=ie(),k=j(),O=Math.max(h??0,E??0,k??0),Q=Number.isFinite(p)&&p>D?p:0,W=0;return M(g)?W=Math.max(g,O,Q):M(O)?W=Math.max(O,Q):W=Q,W>0?Math.max(0,W):0},Te=()=>{let d=window.__timelines??{},p=re=>{let Z=Object.entries(d).filter(oe=>!!oe[1]&&typeof oe[1].play=="function"&&typeof oe[1].pause=="function");if(Z.length!==1)return{timeline:null};let fe=Z[0];if(!fe)return{timeline:null};let[me,he]=fe;return{timeline:he,selectedTimelineIds:[me],selectedDurationSeconds:P(he),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:re,soleTimelineId:me}}}},g=it({timelineRegistry:d,includeAuthoredTimingAttrs:!0}),h=$(),E=ie(),k=Math.max(h??0,E??0)||null,O=q(k),Q=re=>{let Z=document.querySelector(`[data-composition-id="${CSS.escape(re)}"]`);return Z?g.resolveStartForElement(Z,0):0},W=re=>{let Z=window.gsap;if(!Z||typeof Z.timeline!="function")return null;let fe=Z.timeline({paused:!0});for(let me of re)fe.add(me.timeline,Q(me.compositionId));return fe},le=(re,Z)=>{if(!M(re))return null;let fe=window.gsap;if(!fe||typeof fe.timeline!="function")return null;let me=fe.timeline({paused:!0});if(Z)try{me.add(Z,0)}catch(oe){L("runtime.init.site2",oe)}let he=me;if(typeof he.to=="function")try{he.to({},{duration:re})}catch(oe){L("runtime.init.site3",oe)}return me},ye=(re,Z)=>{let fe=re;if(typeof fe.getChildren!="function")return[];try{let me=fe.getChildren(!0,!0,!0)??[];if(!Array.isArray(me))return[];let he=[];for(let oe of Z)if(!me.some(Oe=>Oe===oe.timeline))try{let Oe=Q(oe.compositionId);re.add(oe.timeline,Oe),he.push(oe.compositionId)}catch(Oe){L("runtime.init.site4",Oe)}return he}catch{return[]}},ue=G(),te=ue?.getAttribute("data-composition-id")??null;if(!te)return p("root_missing_composition_id");let Ce=d[te]??null,_e=(()=>{if(!ue)return[];let re=new Set,Z=Array.from(ue.querySelectorAll("[data-composition-id]")),fe=[];for(let me of Z){let he=me.getAttribute("data-composition-id");if(!he||he===te||re.has(he))continue;re.add(he);let oe=d[he]??null;if(!oe||typeof oe.play!="function"||typeof oe.pause!="function")continue;let Fe=P(oe);fe.push({compositionId:he,timeline:oe,durationSeconds:Fe??0})}return fe})(),Xt=re=>{for(let Z of re){let fe=Z.timeline;if(typeof fe.paused=="function")try{fe.paused(!1)}catch(me){L("runtime.init.site5",me)}}};if(_e.length>0&&Xt(_e),Ce){let re=_e.length>0?ye(Ce,_e):[];if((_e.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id='"+te+"'])"))&&(ft=!0),re.length>0)try{let oe=Ce.time();Ce.seek(oe,!1)}catch{}let Z=P(Ce);if(!M(Z)&&_e.length>0){let oe=_e.map(rd=>rd.compositionId),Fe=W(_e),Oe=P(Fe);if(Fe&&M(Oe))return{timeline:Fe,selectedTimelineIds:oe,selectedDurationSeconds:Oe,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:te,rootDurationSeconds:Z,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:O,selectedDurationSeconds:Oe,mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:E,selectedTimelineIds:oe,autoNestedChildren:re}}};let $r=le(k??0,Ce),qr=P($r);if($r&&M(qr))return{timeline:$r,selectedTimelineIds:[te],selectedDurationSeconds:qr,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:te,rootDurationSeconds:Z,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:E,selectedDurationSeconds:qr,selectedTimelineIds:[te],autoNestedChildren:re}}}}if(!M(Z)&&_e.length===0){let oe=le(k??0,Ce),Fe=P(oe);if(oe&&M(Fe))return{timeline:oe,selectedTimelineIds:[te],selectedDurationSeconds:Fe,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:te,rootDurationSeconds:Z,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:E,selectedDurationSeconds:Fe,selectedTimelineIds:[te]}}}}let fe=ue?.getAttribute("data-duration"),me=fe?parseFloat(fe):null,he=Math.max(M(me)?me:0,E??0);if(he>0&&M(he)&&M(Z)&&he>=Z+.5){let oe=Ce;if(typeof oe.to=="function")try{oe.to({},{duration:0},he)}catch(Oe){L("runtime.init.site6",Oe)}let Fe=P(Ce);if(M(Fe))return{timeline:Ce,selectedTimelineIds:[te],selectedDurationSeconds:Fe,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:te,rootDurationSeconds:Z,rootDeclaredDur:me,authoredCompositionDurationFloorSeconds:E,newDur:Fe}}}}return{timeline:Ce,selectedTimelineIds:[te],selectedDurationSeconds:Z,mediaDurationFloorSeconds:h,diagnostics:re.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:te,selectedDurationSeconds:Z,autoNestedChildren:re}}:void 0}}if(_e.length>0){let re=_e.map(me=>me.compositionId),Z=W(_e),fe=P(Z);if(Z)return{timeline:Z,selectedTimelineIds:re,selectedDurationSeconds:fe,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:te,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:O,selectedDurationSeconds:fe,mediaDurationFloorSeconds:h,selectedTimelineIds:re}}}}return p("root_composition_id_unmatched_in_registry")},ft=!1,Ye=d=>{let p=window.gsap,g=d;if(!(!g||typeof g.getChildren!="function"||!p||typeof p.parseEase!="function"))for(let h of g.getChildren(!0,!0,!0)){let E=h,k=E.timeline;if(!k||!("_ease"in k)||typeof k._ease=="function")continue;let O=E.vars?.keyframes,W=(O&&!Array.isArray(O)?O.ease:void 0)??E.vars?.ease??"none";try{let le=p.parseEase(W);typeof le=="function"&&(k._ease=le)}catch(le){Me("keyframe_ease_repair_failed",{ease:typeof W=="string"?W:String(W)}),L("runtime.keyframeEase.repair",le)}}},zt=()=>{if(v(),!xe)return!1;let d=e.capturedTimeline,p=P(d),g=M(p);if(d&&g&&ft)return!1;let h=Te();if(!h.timeline)return!1;if(d&&d===h.timeline)return typeof d.timeScale=="function"&&d.timeScale(e.playbackRate),!1;e.capturedTimeline=h.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),Ye(e.capturedTimeline);let E=be(e.capturedTimeline,0);if(E<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),et(e.capturedTimeline)),E>0){try{c.setDuration(E)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let O=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(O,!1),et(e.capturedTimeline)}let k=window.__hfStudioManualEditsApply;typeof k=="function"&&k(),xr(document)}if(h.diagnostics&&ge({source:"hf-preview",type:"diagnostic",code:h.diagnostics.code,details:h.diagnostics.details}),ge({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:h.selectedTimelineIds??[],selectedDurationSeconds:h.selectedDurationSeconds??null,mediaDurationFloorSeconds:h.mediaDurationFloorSeconds??null}}),window.parent!==window){let k=G(),O=E>0?E:0,Q=String(O>0?O:1),W=new Set,le=new Set(document.querySelectorAll("[data-start]")),ye=ue=>{let te=ue.parentElement;for(;te&&te!==k;){if(le.has(te))return!0;te=te.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let ue of e.capturedTimeline.getChildren(!0))if(typeof ue.targets=="function")for(let te of ue.targets())te instanceof HTMLElement&&te!==k&&(te.hasAttribute("data-start")||ye(te)||W.has(te)||(W.add(te),te.setAttribute("data-start","0"),te.setAttribute("data-duration",Q),te.setAttribute("data-hf-autostamped","1")))}catch{}if(k instanceof HTMLElement)for(let ue of k.querySelectorAll("[id]"))ue instanceof HTMLElement&&ue!==k&&(ue.hasAttribute("data-start")||ye(ue)||W.has(ue)||ue.tagName==="SCRIPT"||ue.tagName==="STYLE"||ue.tagName==="LINK"||(W.add(ue),ue.setAttribute("data-start","0"),ue.setAttribute("data-duration",Q),ue.setAttribute("data-hf-autostamped","1")))}for(let k of $t)Pn.delete(k),zo(k);return!0};window.__hfForceTimelineRebind=()=>{ft=!1,zt(),Hr(e.currentTime)};let Gc=()=>{let d=G();if(!(d instanceof HTMLElement))return;let p=d.getBoundingClientRect(),g=Number(d.getAttribute("data-width")),h=Number(d.getAttribute("data-height")),E=window.getComputedStyle(d),k=Number.isFinite(g)&&g>0&&Number.isFinite(h)&&h>0,O=p.width<=0||p.height<=0||d.clientWidth<=0||d.clientHeight<=0;!k||!O||T("root_stage_layout_zero",{compositionId:d.getAttribute("data-composition-id")??null,declaredWidth:g,declaredHeight:h,rectWidth:Math.round(p.width),rectHeight:Math.round(p.height),clientWidth:d.clientWidth,clientHeight:d.clientHeight,display:E.display,visibility:E.visibility,overflow:E.overflow},`root-stage-layout-zero:${d.getAttribute("data-composition-id")??"unknown"}`)},Hc=()=>{e.tornDown||(l!=null&&window.cancelAnimationFrame(l),l=window.requestAnimationFrame(()=>{l=null,Gc()}))},Bc=()=>{r=d=>{let p=A(d.error??d.message).slice(0,S);if(!p)return;let g=R(p);ge({source:"hf-preview",type:"diagnostic",code:g.code,details:{category:g.category,message:p,filename:d.filename||null,line:Number.isFinite(d.lineno)?d.lineno:null,column:Number.isFinite(d.colno)?d.colno:null}})},i=d=>{let p=A(d.reason).slice(0,S);if(!p)return;let g=R(p);ge({source:"hf-preview",type:"diagnostic",code:`${g.code}_unhandled_rejection`,details:{category:`${g.category}-unhandled-rejection`,message:p}})},window.addEventListener("error",r),window.addEventListener("unhandledrejection",i)},Uc=()=>{let d=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let g of d){let h=()=>{if(!(g instanceof Element))return;let E=g.tagName.toLowerCase(),k=g.getAttribute("src")??g.getAttribute("href")??g.getAttribute("poster")??null,O=E==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";T(O,{tagName:E,assetUrl:k,currentSrc:(g instanceof HTMLImageElement||g instanceof HTMLMediaElement)&&g.currentSrc||null,readyState:g instanceof HTMLMediaElement?g.readyState:null,networkState:g instanceof HTMLMediaElement?g.networkState:null},`${O}:${E}:${k??"unknown"}`)};g.addEventListener("error",h),w(()=>{g.removeEventListener("error",h)})}let p=document.fonts;p&&p.ready.then(()=>{if(e.tornDown)return;let g=Array.from(p).filter(h=>h.status==="error").map(h=>h.family).filter(h=>!!h).slice(0,10);g.length!==0&&T("runtime_font_load_issue",{failedFamilies:g,totalFaces:Array.from(p).length},`runtime-font-load-issue:${g.join("|")}`)}).catch(()=>{})},Wc=(d,p)=>{if(!d.timeline)return!1;let g=e.capturedTimeline;if(g&&g===d.timeline)return!1;let h=Math.max(0,e.currentTime||0),E=e.isPlaying;e.capturedTimeline=d.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{et(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&e.capturedTimeline.seek(h,!1),E&&typeof e.capturedTimeline.play=="function"&&e.capturedTimeline.play()}catch(k){L("runtime.init.site7",k)}return ge({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:p,previousTime:h,selectedTimelineIds:d.selectedTimelineIds??[],selectedDurationSeconds:d.selectedDurationSeconds??null,mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),!0},mt=null,Bo=!1,Uo=!1,$t=new Set,Pn=new WeakMap,On=()=>{e.tornDown||(mt!=null&&window.clearTimeout(mt),mt=window.setTimeout(()=>{if(e.tornDown||(mt=null,Uo&&window.__HF_EXPORT_RENDER_SEEK_CONFIG))return;let d=Te();if(!d.timeline||!M(d.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){zt()&&(pt(),Ne(!0));return}if(Bo)return;let g=P(e.capturedTimeline),h=d.selectedDurationSeconds??P(d.timeline);M(h)&&(!M(g)||h>=g+_)&&Wc(d,"manual")&&(Bo=!0,ge({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:g??null,selectedDurationSeconds:h??null,selectedTimelineIds:d.selectedTimelineIds??[],mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),pt(),Ne(!0))},b))},Wo=d=>{d.currentTarget instanceof HTMLMediaElement&&Ba(d.currentTarget)},Vo=d=>{d.currentTarget instanceof HTMLMediaElement&&Ua(d.currentTarget)},Vc=()=>{for(let d of $t)d.removeEventListener("loadedmetadata",On),d.removeEventListener("durationchange",On),d.removeEventListener("loadedmetadata",Wo),d.removeEventListener("error",Vo);$t.clear()},Ir=()=>{if(e.tornDown)return;let d=Array.from(document.querySelectorAll("video, audio"));for(let p of d){if($t.has(p))continue;$t.add(p);let g=Number.parseFloat(p.dataset.volume??"");Number.isFinite(g)&&(p.volume=Math.max(0,Math.min(1,g))),p.addEventListener("loadedmetadata",On),p.addEventListener("durationchange",On),p.addEventListener("loadedmetadata",Wo),p.addEventListener("error",Vo),Ha(p),p.preload!=="auto"&&(p.preload="auto"),p.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&p.load(),zo(p)}},zo=d=>{Pn.has(d)||Na(d,e.capturedTimeline,be(e.capturedTimeline,0),Pn)},Pr=new WeakMap,$o=d=>{let p=Pr.get(d);if(p!==void 0)return p;let g=window.getComputedStyle(d).position,h=g==="static"||g==="relative"||g==="sticky";return Pr.set(d,h),h},Or=new WeakMap,zc=d=>{let p=Or.get(d);if(p!==void 0)return p;let g=d.querySelector("[data-start]")===null;return Or.set(d,g),g},$c=()=>{Pr=new WeakMap,Or=new WeakMap},Gr=new WeakMap,Gn=new WeakSet,Hr=(d,p=Array.from(document.querySelectorAll("[data-start]")))=>{let g=G();for(let h of p){if(!(h instanceof HTMLElement))continue;if(h.hasAttribute("data-hidden")){Gn.has(h)||(Gr.set(h,h.style.getPropertyValue("display")),Gn.add(h)),h.style.display="none",(h instanceof HTMLVideoElement||h instanceof HTMLImageElement)&&n?.setSourceVisibility(h,!1);continue}if(Gn.has(h)){let k=Gr.get(h);k?h.style.display=k:h.style.removeProperty("display"),Gr.delete(h),Gn.delete(h)}let E=X(h,d);if(E){let k=h.parentElement;for(;k&&k!==g;){if(k instanceof HTMLElement&&k.hasAttribute("data-start")&&!X(k,d)){E=!1;break}k=k.parentElement}}h.style.visibility=E?"visible":"hidden",(h instanceof HTMLVideoElement||h instanceof HTMLImageElement)&&n?.setSourceVisibility(h,E),E?$o(h)&&h.style.removeProperty("display"):$o(h)&&zc(h)&&(h.style.display="none")}},Ie=()=>{let d=h=>{let E=h.closest("[data-composition-id]"),k=E?Y(E,0):null,O=E?we(E,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:E,inheritedStart:k,inheritedDuration:O}},p=Da({shouldIncludeElement:h=>h.hasAttribute("data-start")||!!d(h).compositionRoot,resolveStartSeconds:h=>{let E=d(h);return V(h,E.inheritedStart??0)},resolveDurationSeconds:h=>{let E=d(h),k=V(h,E.inheritedStart??0),O=Number.parseFloat(h.dataset.playbackStart??h.dataset.mediaStart??"0")||0,Q=E.inheritedStart!=null&&E.inheritedDuration!=null&&E.inheritedDuration>0?Math.max(0,E.inheritedStart+E.inheritedDuration-k):null,W=Number.isFinite(h.duration)&&h.duration>O?Math.max(0,h.duration-O):null,le=Number.parseFloat(h.dataset.duration??""),ye=Number.isFinite(le)&&le>0?le:null;return ka({isVideo:h.tagName==="VIDEO",sourceDuration:W,hostRemaining:Q,explicitDuration:ye})}});for(let h of p.mediaClips){let E=Pn.get(h.el);E&&(h.volumeKeyframes=E)}let g=e.mediaForceSyncNextTick;g&&(e.mediaForceSyncNextTick=!1),e.nativeMediaSyncDisabled||Ia({clips:p.mediaClips,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted||!e.webAudioMediaDisabled&&!e.nativeMediaSyncDisabled&&m.isActive(),userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:g,onElementVolume:(h,E)=>m.setElementVolume(h,E),isWebAudioOwned:h=>m.ownsElement(h),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,ge({source:"hf-preview",type:"media-autoplay-blocked"}))}}),Hr(e.currentTime)},Ne=d=>{let p=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),g=Date.now();(d||p!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||g-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=p,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=g,ge({source:"hf-preview",type:"state",frame:p,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},Br="",qo=0,qc=()=>{let d="";for(let p of document.querySelectorAll("[data-start]"))d+=`${p.id}:${p.tagName}|`;return d},pt=()=>{ne(),B(),H();let d=G();if(d){let h=F(d.getAttribute("data-width")),E=F(d.getAttribute("data-height")),k=h?parseInt(h,10):0,O=E?parseInt(E,10):0;k>0&&O>0&&ge({source:"hf-preview",type:"stage-size",width:k,height:O})}zt();let p=Ts({canonicalFps:e.canonicalFps});window.__clipManifest=p;let g=qc();if(Br!==g&&$c(),!window.__clipTree||Br!==g){let h=window;window.__clipTree=Ss({startResolver:it({timelineRegistry:h.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:h.__timelines??{},rootDuration:p.durationInFrames/e.canonicalFps}),Br=g}ge(p),Hc()},Ur=d=>Number.isFinite(d)&&d>0?d:0,jc=d=>{let p=Ur(Number(d));if(p<=0)return;let g=G(),h=Ur(Number.parseFloat(g?.getAttribute("data-duration")??"")),E=Math.max(qo,Ur(c.getDuration()),h);p<=E||(qo=p,g?.setAttribute("data-duration",String(p)),c.setDuration(p),pt(),Ne(!0))},Ue=(d,p=0)=>{for(let g of e.deterministicAdapters){try{d==="discover"&&g.discover(),d==="pause"&&g.pause(),d==="play"&&g.play&&g.play()}catch(h){L("runtime.init.site8",h)}if(d==="discover")try{g.seek({time:p,suppressEvents:!0})}catch(h){L("runtime.init.site9",h)}}},ht=()=>{window.__renderReady=!1},qt=null,jt=!0,Kc=()=>{let d=[];for(let p of e.deterministicAdapters){let g=p.getReadyPromise;if(typeof g=="function")try{let h=g();h&&d.push(h)}catch(h){L("runtime.init.adapterReady",h)}}return d},Yc=()=>{let d=Kc();if(d.length===0)return qt=null,jt=!0,!0;let p=d[0];if(!p)return!0;let g=d.length===1?p:Promise.all(d);return g!==qt&&(qt=g,jt=!1,Promise.resolve(g).then(()=>{qt===g&&(jt=!0,ht())},h=>{qt===g&&(jt=!0,L("runtime.init.adapterReady",h),ht())})),jt};if(xe)mo();else{let d={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:F,onDiagnostic:({code:p,details:g})=>{ge({source:"hf-preview",type:"diagnostic",code:p,details:g})}};pu(d).then(()=>mu(d)).finally(()=>{xe=!0,Ir(),Uc(),mo(),yo(document),ht()})}let Hn=hs({postMessage:d=>ge(d)});Hn.installPickerApi(),Hr(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let We=Zu();n=We,w(()=>{We.destroy(),n=null});let Wr=d=>{let p=Number(d);!Number.isFinite(p)||p<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,p)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let g=document.querySelectorAll("video, audio");for(let h of g)if(h instanceof HTMLMediaElement)try{h.playbackRate=e.playbackRate}catch(E){L("runtime.init.site10",E)}},jo={play:()=>{let d=e.capturedTimeline;if(c.isPlaying())return;let p=be(d,0);if(p>0)c.setDuration(p),c.reachedEnd()&&(c.seek(0),e.currentTime=0,gt(0));else{let g=G(),h=Number(g?.getAttribute("data-duration")??0);h>0&&c.setDuration(h)}et(d),c.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,Zo(c.now()),f&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&ea(),Ue("play"),Ie(),We.redraw(),Ne(!0))},pause:()=>{if(!c.isPlaying())return;m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1,e.currentTime=c.now(),e.mediaForceSyncNextTick=!0,Zo(e.currentTime);let d=e.capturedTimeline;et(d),Ue("pause"),Ie(),We.redraw(),Ne(!0)},seek:(d,p)=>{let g=Nt(Math.max(0,Number(d)||0),e.canonicalFps);m.stopAll(),c.detachAudioSource();let h=c.isPlaying();h&&c.pause(),c.seek(g),e.currentTime=c.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let E=e.capturedTimeline;if(et(E),gt(e.currentTime),Ue("pause"),p?.keepPlaying&&h){jo.play();return}Ie(),We.redraw(),Ne(!0)},renderSeek:(d,p)=>{Uo=!0;let g=Nt(Math.max(0,Number(d)||0),e.canonicalFps);m.stopAll(),c.detachAudioSource(),c.isPlaying()&&c.pause(),c.seek(g),e.currentTime=c.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0,gt(e.currentTime,{activateChildren:!0,suppressEvents:p?.suppressEvents}),Ie(),We.redraw(),Ne(!0)},getTime:()=>c.now(),getDuration:()=>{let d=c.getDuration();return Number.isFinite(d)?d:0},isPlaying:()=>c.isPlaying(),setPlaybackRate:d=>{Wr(d),c.setRate(e.playbackRate),ta()},getPlaybackRate:()=>e.playbackRate},Ko=be(e.capturedTimeline,0);Ko>0&&c.setDuration(Ko);let Pe=bs({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:Wr,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(d,p)=>{e.currentTime=Math.max(0,Number(d)||0),e.isPlaying!==p&&(e.mediaForceSyncNextTick=!0),e.isPlaying=p,Ie()},onStatePost:Ne,onDeterministicSeek:(d,p)=>{for(let g of e.deterministicAdapters)if(!(g.name==="gsap"&&e.capturedTimeline))try{g.seek({time:Number(d)||0,suppressEvents:p?.suppressEvents})}catch(h){L("runtime.init.site11",h)}},onDeterministicPause:()=>Ue("pause"),onDeterministicPlay:()=>Ue("play"),onRenderFrameSeek:()=>{We.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>be(e.capturedTimeline,0),transport:jo});window.__player=N(Pe),window.__playerReady=!0,Me("composition_loaded",{duration:Pe.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[La(),ma({resolveStartSeconds:d=>Y(d,0)}),ha(),xa(),ya(),Sa(),va(),Ea(),Ca(),_a(),Aa(),pa({getTimeline:()=>e.capturedTimeline})],Ta(),Ra(),window.__hfReseekGpu=d=>{let p=Math.max(0,Number(d)||0);window.__hfThreeTime=p,window.__hfTypegpuTime=p,ba(p)},Bc(),Ir(),Ue("discover");let Xc=()=>{let d=e.capturedTimeline,p=zt();e.capturedTimeline&&(p||e.capturedTimeline!==d||!Pe._timeline)&&(Pe._timeline=e.capturedTimeline);let g=be(e.capturedTimeline,0);if(g>0&&c.setDuration(g),Ue("discover",e.currentTime),!e.capturedTimeline){let h=window.__timelines??{},E=Object.keys(h).filter(k=>h[k]);if(E.length>0){let O=G()?.getAttribute("data-composition-id")??null;T("root_timeline_unbound_registry_present",{reason:O?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:O,registeredTimelineKeys:E},"root_timeline_unbound_registry_present"),console.warn("[hyperframes] Root timeline not bound \u2014 render will freeze at t=0. "+(O?`Root data-composition-id is "${O}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${E.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${O??"<root-id>"}"] = tl).`)}}window.__renderReady=!0,pt(),Ne(!0)},_t=null,Jc=()=>{if(_t)return;let d=()=>{window.removeEventListener("hf-timelines-built",d),_t=null,ht()};_t=d,window.addEventListener("hf-timelines-built",d)};w(()=>{_t&&(window.removeEventListener("hf-timelines-built",_t),_t=null)}),ht=()=>{if(!xe){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,Jc();return}if(Ue("discover",e.currentTime),!Yc()){window.__renderReady=!1;return}Xc()},ht(),xe&&setTimeout(()=>{ht()},0);let Bn=0,Vr=!1,Qc=(d,p,g,h)=>{try{let E=h?.suppressEvents===!0;et(d),typeof d.totalTime=="function"?d.totalTime(p,E):d.seek(p,E)}catch(E){L(g,E)}},Zc=(d,p)=>{let g=window.__timelines??{},h=G()?.getAttribute("data-composition-id")??null;for(let[E,k]of Object.entries(g)){if(!k||E===h)continue;let O=document.querySelector(`[data-composition-id="${CSS.escape(E)}"]`);if(!O)continue;let Q=Y(O,0);if(!Number.isFinite(Q))continue;let W=P(k),le=Tt(O)+Math.max(0,d-Q)*ze(O),ye=Math.max(0,W!=null&&W>0?Math.min(W,le):le);Qc(k,ye,"runtime.init.transport.childTimeline",p)}},Yo=d=>{let p=window.__timelines??{};for(let g of Object.values(p))if(!(!g||g===d))try{g.play()}catch(h){L("runtime.init.activateSiblings",h)}},Xo=d=>typeof d=="object"&&d!==null,Kt=new WeakMap,ed=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],Jo=(d,p)=>{let g=d[p];if(typeof g!="function")return null;try{let h=Number(g.call(d));return Number.isFinite(h)?h:null}catch(h){return L("runtime.init.gsapCallbackDuration",h),null}},td=d=>{let p=Kt.get(d);if(p!=null)return p;if(!("getChildren"in d)||typeof d.getChildren!="function")return!1;let g;try{g=d.getChildren(!0,!0,!0)}catch(h){return L("runtime.init.gsapCallbackChildren",h),Kt.set(d,!1),!1}if(!Array.isArray(g))return Kt.set(d,!1),!1;for(let h of g){if(!Xo(h))continue;let E=h.vars;if(!Xo(E)||!ed.some(W=>typeof E[W]=="function"))continue;let Q=Jo(h,"totalDuration")??Jo(h,"duration");if(Q!=null&&Q<=1e-6)return Kt.set(d,!0),!0}return Kt.set(d,!1),!1};function gt(d,p){let g=e.capturedTimeline,h=p?.suppressEvents===!0;if(g){p?.activateChildren&&Yo(g);let E=g,k=d;if(typeof E.totalDuration=="function")try{let O=Number(E.totalDuration());Number.isFinite(O)&&O>0&&d>O&&(k=O)}catch(O){L("runtime.init.transport.clampDuration",O)}try{typeof g.totalTime=="function"?(g.totalTime(k,h),!h&&!td(g)&&(g.totalTime(k+.001,!0),g.totalTime(k,!0))):g.seek(k,h)}catch(O){L("runtime.init.transport.seek",O)}}Zc(d,p),g&&p?.activateChildren&&Yo(g);for(let E of e.deterministicAdapters)if(!(E.name==="gsap"&&g))try{E.seek({time:d,suppressEvents:h})}catch(k){L("runtime.init.transport.adapter",k)}}let nd=()=>{try{return document.querySelector(`[${tc}]`)!=null}catch{return!1}},Qo=()=>{if(!(e.tornDown||Vr)){Vr=!0;try{if(e.transportRafId=window.requestAnimationFrame(Qo),Bn+=1,nc({tick:Bn,isPlaying:c.isPlaying(),hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:c.now()})){let p=e.capturedTimeline;if(zt()){e.capturedTimeline&&!Pe._timeline&&(Pe._timeline=e.capturedTimeline),e.capturedTimeline&&e.capturedTimeline!==p&&et(e.capturedTimeline);let g=be(e.capturedTimeline,0);g>0&&c.setDuration(g),pt()}}if(Bn%20===0&&pt(),Bn%30===0&&Ir(),e.capturedTimeline){let p=be(e.capturedTimeline,0);p>0&&(!c.isPlaying()||p>=c.getDuration())&&c.setDuration(p)}if(c.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&m.isActive()&&m.context){let p=m.getTime();p>=0&&c.attachAudioSource({currentTimeSeconds:p})}else{let p=document.querySelectorAll("audio[data-start]"),g=!1;for(let h of p){if(!(h instanceof HTMLMediaElement)||!h.isConnected)continue;let E=Number.parseFloat(h.dataset.start??""),k=Number.parseFloat(h.dataset.duration??""),O=Number.isFinite(k)&&k>0?E+k:1/0,Q=Number.parseFloat(h.dataset.playbackStart??h.dataset.mediaStart??"0")||0;if(Number.isFinite(E)&&e.currentTime>=E&&e.currentTime<O){h.paused?!h.error&&h.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(c.attachAudioSource({currentTimeSeconds:e.currentTime}),g=!0):(c.attachAudioSource({el:h,compositionStart:E,mediaStart:Q}),g=!0);break}}!g&&c.hasAudioSource()&&c.detachAudioSource()}else c.hasAudioSource()&&c.detachAudioSource();let d=c.now();if(e.currentTime=d,(c.isPlaying()||!nd())&>(d),c.isPlaying()&&We.redrawAnimated(),c.isPlaying()&&c.reachedEnd()){m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1;let p=c.getDuration();Number.isFinite(p)&&(c.seek(p),e.currentTime=p,gt(p)),Ue("pause"),Ie(),Ne(!0);return}c.isPlaying()&&Ie(),Ne(!1)}finally{Vr=!1}}},Zo=d=>{let p=document.querySelectorAll("video, audio");for(let g of p){if(!(g instanceof HTMLMediaElement)||!g.isConnected)continue;let h=Number.parseFloat(g.dataset.start??"");if(!Number.isFinite(h))continue;let E=Number.parseFloat(g.dataset.duration??""),k=Number.isFinite(E)&&E>0?h+E:1/0;if(d<h||d>=k)continue;let O=Number.parseFloat(g.dataset.playbackStart??g.dataset.mediaStart??"0")||0,Q=d-h+O;if(Q>=0)try{g.currentTime=Q}catch{}}},ea=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let d=m.startGeneration(),p=document.querySelectorAll("audio[data-start]");for(let g of p){if(!(g instanceof HTMLMediaElement)||!g.isConnected)continue;let h=Number.parseFloat(g.dataset.start??"");if(!Number.isFinite(h))continue;let E=Number.parseFloat(g.dataset.playbackStart??g.dataset.mediaStart??"0")||0,k=Number.parseFloat(g.dataset.volume??""),O=Number.isFinite(k)?k:1,Q=Number.parseFloat(g.dataset.duration??""),W=Number.isFinite(Q)&&Q>0?Q:Number.POSITIVE_INFINITY,le=g.closest("[data-composition-id]");if(le){let ye=Y(le,0),ue=we(le,{includeAuthoredTimingAttrs:!0});ue!=null&&ue>0&&(W=Math.min(W,Math.max(0,ye+ue-h)))}m.decodeAudioElement(g).then(ye=>{!ye||!c.isPlaying()||m.schedulePlayback(g,ye,h,E,c.now(),O*e.bridgeVolume,d,e.playbackRate,W)})}};function ta(){m.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&f&&c.isPlaying()&&m.hasBoundedActiveSources()&&(m.stopAll(),ea())}if(e.capturedTimeline){let d=be(e.capturedTimeline,0);d>0&&c.setDuration(d),et(e.capturedTimeline)}Su(window),e.transportRafId=window.requestAnimationFrame(Qo),pt(),Ne(!0),e.controlBridgeHandler=oa({onPlay:()=>{Pe.play(),Me("composition_played",{time:Pe.getTime()})},onPause:()=>{Pe.pause(),Me("composition_paused",{time:Pe.getTime()})},onStopMedia:()=>{m.stopAll();let d=document.querySelectorAll("video, audio");for(let p of d)p instanceof HTMLMediaElement&&!p.paused&&p.pause()},onSeek:(d,p)=>{Pe.seek(d),Me("composition_seeked",{time:d})},onSetMuted:d=>{e.bridgeMuted=d;let p=d||e.mediaOutputMuted;m.setMuted(p);let g=document.querySelectorAll("video, audio");for(let h of g)h instanceof HTMLMediaElement&&(h.muted=p||h.defaultMuted)},onSetVolume:d=>{e.bridgeVolume=d,m.setVolume(d);let p=document.querySelectorAll("video, audio");for(let g of p){if(!(g instanceof HTMLMediaElement))continue;let h=parseFloat(g.dataset.volume??""),E=Number.isFinite(h)?h:1;g.volume=E*d}},onSetMediaOutputMuted:d=>{e.mediaOutputMuted=d;let p=d||e.bridgeMuted;m.setMuted(p);let g=document.querySelectorAll("video, audio");for(let h of g)h instanceof HTMLMediaElement&&(h.muted=p||h.defaultMuted)},onSetNativeMediaSyncDisabled:d=>{e.nativeMediaSyncDisabled!==d&&(e.nativeMediaSyncDisabled=d,e.mediaForceSyncNextTick=!0,d?(m.stopAll(),c.detachAudioSource()):Ie())},onSetWebAudioMediaDisabled:d=>{e.webAudioMediaDisabled!==d&&(e.webAudioMediaDisabled=d,e.mediaForceSyncNextTick=!0,d&&(m.stopAll(),c.detachAudioSource()),Ie())},onSetPlaybackRate:d=>{Wr(d),e.transportClock&&e.transportClock.setRate(e.playbackRate),ta()},onSetRootDuration:jc,onSetColorGrading:(d,p)=>{We.setGrading(d,p)},onSetColorGradingCompare:(d,p)=>{We.setCompare(d,p)},onTick:()=>{if(e.tornDown||!c.isPlaying())return;let d=c.now();if(e.currentTime=d,gt(d),c.reachedEnd()){m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1;let p=c.getDuration();Number.isFinite(p)&&(c.seek(p),e.currentTime=p,gt(p)),Ue("pause"),Ie(),Ne(!0)}},onEnablePickMode:()=>Hn.enablePickMode(),onDisablePickMode:()=>Hn.disablePickMode(),getCanonicalFps:()=>e.canonicalFps});let zr=()=>{if(!e.tornDown){e.tornDown=!0,e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),e.transportClock=null,m.destroy(),mt!=null&&(window.clearTimeout(mt),mt=null),l!=null&&(window.cancelAnimationFrame(l),l=null),Vc(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),r&&(window.removeEventListener("error",r),r=null),i&&(window.removeEventListener("unhandledrejection",i),i=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),Hn.disablePickMode();for(let d of e.deterministicAdapters)if(!(!d||typeof d.revert!="function"))try{d.revert()}catch(p){L("runtime.init.site12",p)}e.deterministicAdapters=[];for(let d of o.splice(0))try{d()}catch(p){L("runtime.init.site13",p)}for(let d of e.injectedCompStyles)try{d.remove()}catch(p){L("runtime.init.site14",p)}e.injectedCompStyles=[];for(let d of e.injectedCompLinks)try{d.remove()}catch(p){L("runtime.init.site15",p)}e.injectedCompLinks=[];for(let d of e.injectedCompScripts)try{d.remove()}catch(p){L("runtime.init.site16",p)}e.injectedCompScripts=[],e.capturedTimeline=null,window.__hfRuntimeTeardown===zr&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=zr,e.beforeUnloadHandler=zr,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var fc=["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"],Mo=[[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 Nh(e){if(e<=255)return fc[e];let t=0,n=Mo.length-1;for(;t<=n;){let r=t+n>>1,i=Mo[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return"L"}function Mh(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let u=0;u<t;){let c=e.charCodeAt(u),m=c,f=1;if(c>=55296&&c<=56319&&u+1<t){let v=e.charCodeAt(u+1);v>=56320&&v<=57343&&(m=(c-55296<<10)+(v-56320)+65536,f=2)}let x=Nh(m);(x==="R"||x==="AL"||x==="AN")&&(r=!0);for(let v=0;v<f;v++)n[u+v]=x;u+=f}if(!r)return null;let i=0;for(let u=0;u<t;u++){let c=n[u];if(c==="L"){i=0;break}if(c==="R"||c==="AL"){i=1;break}}let o=new Int8Array(t);for(let u=0;u<t;u++)o[u]=i;let a=i&1?"R":"L",l=a,s=l;for(let u=0;u<t;u++)n[u]==="NSM"?n[u]=s:s=n[u];s=l;for(let u=0;u<t;u++){let c=n[u];c==="EN"?n[u]=s==="AL"?"AN":"EN":(c==="R"||c==="L"||c==="AL")&&(s=c)}for(let u=0;u<t;u++)n[u]==="AL"&&(n[u]="R");for(let u=1;u<t-1;u++)n[u]==="ES"&&n[u-1]==="EN"&&n[u+1]==="EN"&&(n[u]="EN"),n[u]==="CS"&&(n[u-1]==="EN"||n[u-1]==="AN")&&n[u+1]===n[u-1]&&(n[u]=n[u-1]);for(let u=0;u<t;u++){if(n[u]!=="EN")continue;let c;for(c=u-1;c>=0&&n[c]==="ET";c--)n[c]="EN";for(c=u+1;c<t&&n[c]==="ET";c++)n[c]="EN"}for(let u=0;u<t;u++){let c=n[u];(c==="WS"||c==="ES"||c==="ET"||c==="CS")&&(n[u]="ON")}s=l;for(let u=0;u<t;u++){let c=n[u];c==="EN"?n[u]=s==="L"?"L":"EN":(c==="R"||c==="L")&&(s=c)}for(let u=0;u<t;u++){if(n[u]!=="ON")continue;let c=u+1;for(;c<t&&n[c]==="ON";)c++;let m=u>0?n[u-1]:l,f=c<t?n[c]:l,x=m!=="L"?"R":"L";if(x===(f!=="L"?"R":"L"))for(let C=u;C<c;C++)n[C]=x;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 mc(e,t){let n=Mh(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 kh=/[ \t\n\r\f]+/g,Dh=/[\t\n\r\f]| {2,}|^ | $/;function Ih(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Ph(e){if(!Dh.test(e))return e;let t=e.replace(kh," ");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 Oh(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
|
|
352
354
|
`).replace(/[\r\f]/g,`
|
|
353
355
|
`):e.replace(/\r\n/g,`
|
|
354
|
-
`)}var
|
|
355
|
-
`)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 _p=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Fe(e){return e.length===1?e[0]:e.join("")}function Tp(e,t){let n=[];for(let i=e.length-1;i>=0;i--)n.push(e[i]);return n.push(t),Fe(n)}function vp(e,t,n,i){if(!_p.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];let r=[],o=null,a=[],c=n,s=!1,l=0;for(let f of e){let p=Cp(f,i),d=p==="text"&&t;if(o!==null&&p===o&&d===s){a.push(f),l+=f.length;continue}o!==null&&r.push({text:Fe(a),isWordLike:s,kind:o,start:c}),o=p,a=[f],c=n+l,s=d,l+=f.length}return o!==null&&r.push({text:Fe(a),isWordLike:s,kind:o,start:c}),r}function Hr(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var Fp=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Mp(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:Fp.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Np(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Rp(e){let t=e.texts.slice(),n=e.isWordLike.slice(),i=e.kinds.slice(),r=e.starts.slice();for(let a=0;a<e.len;a++){if(i[a]!=="text"||!Mp(e,a))continue;let c=[t[a]],s=a+1;for(;s<e.len&&!Hr(i[s]);){c.push(t[s]),n[a]=!0;let l=t[s].includes("?");if(i[s]="text",t[s]="",s++,l)break}t[a]=Fe(c)}let o=0;for(let a=0;a<t.length;a++){let c=t[a];c.length!==0&&(o!==a&&(t[o]=c,n[o]=n[a],i[o]=i[a],r[o]=r[a]),o++)}return t.length=o,n.length=o,i.length=o,r.length=o,{len:o,texts:t,isWordLike:n,kinds:i,starts:r}}function Lp(e){let t=[],n=[],i=[],r=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(t.push(a),n.push(e.isWordLike[o]),i.push(e.kinds[o]),r.push(e.starts[o]),!Np(a))continue;let c=o+1;if(c>=e.len||Hr(e.kinds[c]))continue;let s=[],l=e.starts[c],f=c;for(;f<e.len&&!Hr(e.kinds[f]);)s.push(e.texts[f]),f++;s.length>0&&(t.push(Fe(s)),n.push(!0),i.push("text"),r.push(l),o=f-1)}return{len:t.length,texts:t,isWordLike:n,kinds:i,starts:r}}var kp=new Set([":","-","/","\xD7",",",".","+","\u2013","\u2014"]),Vl=/^[A-Za-z0-9_]+[,:;]*$/,zl=/[,:;]+$/;function Kl(e){for(let t of e)if($l.test(t))return!0;return!1}function fn(e){if(e.length===0)return!1;for(let t of e)if(!($l.test(t)||kp.has(t)))return!1;return!0}function Dp(e){let t=[],n=[],i=[],r=[];for(let o=0;o<e.len;o++){let a=e.texts[o],c=e.kinds[o];if(c==="text"&&fn(a)&&Kl(a)){let s=[a],l=o+1;for(;l<e.len&&e.kinds[l]==="text"&&fn(e.texts[l]);)s.push(e.texts[l]),l++;t.push(Fe(s)),n.push(!0),i.push("text"),r.push(e.starts[o]),o=l-1;continue}t.push(a),n.push(e.isWordLike[o]),i.push(c),r.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:i,starts:r}}function Ip(e){let t=[],n=[],i=[],r=[];for(let o=0;o<e.len;o++){let a=e.texts[o],c=e.kinds[o],s=e.isWordLike[o];if(c==="text"&&s&&Vl.test(a)){let l=[a],f=zl.test(a),p=o+1;for(;f&&p<e.len&&e.kinds[p]==="text"&&e.isWordLike[p]&&Vl.test(e.texts[p]);){let d=e.texts[p];l.push(d),f=zl.test(d),p++}t.push(Fe(l)),n.push(!0),i.push("text"),r.push(e.starts[o]),o=p-1;continue}t.push(a),n.push(s),i.push(c),r.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:i,starts:r}}function Pp(e){let t=[],n=[],i=[],r=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(e.kinds[o]==="text"&&a.includes("-")){let c=a.split("-"),s=c.length>1;for(let l=0;l<c.length;l++){let f=c[l];if(!s)break;(f.length===0||!Kl(f)||!fn(f))&&(s=!1)}if(s){let l=0;for(let f=0;f<c.length;f++){let p=c[f],d=f<c.length-1?`${p}-`:p;t.push(d),n.push(!0),i.push("text"),r.push(e.starts[o]+l),l+=d.length}continue}}t.push(a),n.push(e.isWordLike[o]),i.push(e.kinds[o]),r.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:i,starts:r}}function Op(e){let t=[],n=[],i=[],r=[],o=0;for(;o<e.len;){let a=[e.texts[o]],c=e.isWordLike[o],s=e.kinds[o],l=e.starts[o];if(s==="glue"){let f=[a[0]],p=l;for(o++;o<e.len&&e.kinds[o]==="glue";)f.push(e.texts[o]),o++;let d=Fe(f);if(o<e.len&&e.kinds[o]==="text")a[0]=d,a.push(e.texts[o]),c=e.isWordLike[o],s="text",l=p,o++;else{t.push(d),n.push(!1),i.push("glue"),r.push(p);continue}}else o++;if(s==="text")for(;o<e.len&&e.kinds[o]==="glue";){let f=[];for(;o<e.len&&e.kinds[o]==="glue";)f.push(e.texts[o]),o++;let p=Fe(f);if(o<e.len&&e.kinds[o]==="text"){a.push(p,e.texts[o]),c=c||e.isWordLike[o],o++;continue}a.push(p)}t.push(Fe(a)),n.push(c),i.push(s),r.push(l)}return{len:t.length,texts:t,isWordLike:n,kinds:i,starts:r}}function Bp(e){let t=e.texts.slice(),n=e.isWordLike.slice(),i=e.kinds.slice(),r=e.starts.slice();for(let o=0;o<t.length-1;o++){if(i[o]!=="text"||i[o+1]!=="text"||!Ie(t[o])||!Ie(t[o+1]))continue;let a=Sp(t[o]);a!==null&&(t[o]=a.head,t[o+1]=a.tail+t[o+1],r[o+1]=r[o]+a.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:i,starts:r}}function jl(e,t,n){let i=lp(),r=0,o=[],a=[],c=[],s=[],l=[],f=[],p=[],d=[],x=[],S=[],y=[],b=[];for(let F of i.segment(e))for(let w of vp(F.segment,F.isWordLike??!1,F.index,n)){let ie=function(){f[I]!==null&&(a[I]=[Ul(o,f,p,I)],f[I]=null),a[I].push(w.text),c[I]=c[I]||w.isWordLike,d[I]=d[I]||R,x[I]=x[I]||L,S[I]=P,y[I]=X,b[I]=Wl(x[I],z)},C=w.kind==="text",T=Ep(w.text,w.isWordLike,w.kind),R=Ie(w.text),L=Gl(w.text),z=ei(w.text),P=ti(w.text),X=Ap(w.text),I=r-1;t.carryCJKAfterClosingQuote&&C&&r>0&&s[I]==="text"&&R&&d[I]&&S[I]||C&&r>0&&s[I]==="text"&&bp(w.text)&&d[I]||C&&r>0&&s[I]==="text"&&y[I]?ie():C&&r>0&&s[I]==="text"&&w.isWordLike&&L&&b[I]?(ie(),c[I]=!0):T!==null&&r>0&&s[I]==="text"&&f[I]===T?p[I]=(p[I]??1)+1:C&&!w.isWordLike&&r>0&&s[I]==="text"&&(xp(w.text)||w.text==="-"&&c[I])?ie():(o[r]=w.text,a[r]=[w.text],c[r]=w.isWordLike,s[r]=w.kind,l[r]=w.start,f[r]=T,p[r]=T===null?0:1,d[r]=R,x[r]=L,S[r]=P,y[r]=X,b[r]=Wl(L,z),r++)}for(let F=0;F<r;F++){if(f[F]!==null){o[F]=Ul(o,f,p,F);continue}o[F]=Fe(a[F])}for(let F=1;F<r;F++)s[F]==="text"&&!c[F]&&Wr(o[F])&&s[F-1]==="text"&&(o[F-1]+=o[F],c[F-1]=c[F-1]||c[F],o[F]="");let A=Array.from({length:r},()=>null),_=-1;for(let F=r-1;F>=0;F--){let w=o[F];if(w.length!==0){if(s[F]==="text"&&!c[F]&&yp(w)&&_>=0&&s[_]==="text"){let C=A[_]??[];C.push(w),A[_]=C,l[_]=l[F],o[F]="";continue}_=F}}for(let F=0;F<r;F++){let w=A[F];w!=null&&(o[F]=Tp(w,o[F]))}let M=0;for(let F=0;F<r;F++){let w=o[F];w.length!==0&&(M!==F&&(o[M]=w,c[M]=c[F],s[M]=s[F],l[M]=l[F]),M++)}o.length=M,c.length=M,s.length=M,l.length=M;let H=Op({len:M,texts:o,isWordLike:c,kinds:s,starts:l}),D=Bp(Ip(Pp(Dp(Lp(Rp(H))))));for(let F=0;F<D.len-1;F++){let w=wp(D.texts[F]);w!==null&&(D.kinds[F]!=="space"&&D.kinds[F]!=="preserved-space"||D.kinds[F+1]!=="text"||!Gl(D.texts[F+1])||(D.texts[F]=w.space,D.isWordLike[F]=!1,D.kinds[F]=D.kinds[F]==="preserved-space"?"preserved-space":"space",D.texts[F+1]=w.marks+D.texts[F+1],D.starts[F+1]=D.starts[F]+w.space.length))}return D}function Gp(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];let n=[],i=0;for(let r=0;r<e.len;r++)e.kinds[r]==="hard-break"&&(n.push({startSegmentIndex:i,endSegmentIndex:r,consumedEndSegmentIndex:r+1}),i=r+1);return i<e.len&&n.push({startSegmentIndex:i,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function Hp(e){if(e.len<=1)return e;let t=[],n=[],i=[],r=[],o=null,a=!1,c=0,s=!1,l=!1;function f(){o!==null&&(t.push(Fe(o)),n.push(a),i.push("text"),r.push(c),o=null)}for(let p=0;p<e.len;p++){let d=e.texts[p],x=e.kinds[p],S=e.isWordLike[p],y=e.starts[p];if(x==="text"){let b=fp(d),A=Qn(d);if(o!==null&&s&&l){o.push(d),a=a||S,s=s||b,l=A;continue}f(),o=[d],a=S,c=y,s=b,l=A;continue}f(),t.push(d),n.push(S),i.push(x),r.push(y)}return f(),{len:t.length,texts:t,isWordLike:n,kinds:i,starts:r}}function Yl(e,t,n="normal",i="normal"){let r=rp(n),o=r.mode==="pre-wrap"?sp(e):op(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let a=i==="keep-all"?Hp(jl(o,t,r)):jl(o,t,r);return{normalized:o,chunks:Gp(a,r),...a}}var _t=null,Jl=new Map,Tt=null,Up=96,Wp=/\p{Emoji_Presentation}/u,Vp=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u,Vr=null,Xl=new Map;function zr(){if(_t!==null)return _t;if(typeof OffscreenCanvas<"u")return _t=new OffscreenCanvas(1,1).getContext("2d"),_t;if(typeof document<"u")return _t=document.createElement("canvas").getContext("2d"),_t;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function zp(e){let t=Jl.get(e);return t||(t=new Map,Jl.set(e,t)),t}function Ke(e,t){let n=t.get(e);return n===void 0&&(n={width:zr().measureText(e).width,containsCJK:Ie(e)},t.set(e,n)),n}function vt(){if(Tt!==null)return Tt;if(typeof navigator>"u")return Tt={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Tt;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/"),i=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Tt={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:i,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},Tt}function jp(e){let t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function Ql(){return Vr===null&&(Vr=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Vr}function $p(e){return Wp.test(e)||e.includes("\uFE0F")}function Zl(e){return Vp.test(e)}function qp(e,t){let n=Xl.get(e);if(n!==void 0)return n;let i=zr();i.font=e;let r=i.measureText("\u{1F600}").width;if(n=0,r>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),r-a>.5&&(n=r-a)}return Xl.set(e,n),n}function Kp(e){let t=0,n=Ql();for(let i of n.segment(e))$p(i.segment)&&t++;return t}function Yp(e,t){return t.emojiCount===void 0&&(t.emojiCount=Kp(e)),t.emojiCount}function it(e,t,n){return n===0?t.width:t.width-Yp(e,t)*n}function eu(e,t,n,i,r){if(t.breakableFitAdvances!==void 0)return t.breakableFitAdvances;let o=Ql(),a=[];for(let f of o.segment(e))a.push(f.segment);if(a.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(r==="sum-graphemes"){let f=[];for(let p of a){let d=Ke(p,n);f.push(it(p,d,i))}return t.breakableFitAdvances=f,t.breakableFitAdvances}if(r==="pair-context"||a.length>Up){let f=[],p=null,d=0;for(let x of a){let S=Ke(x,n),y=it(x,S,i);if(p===null)f.push(y);else{let b=p+x,A=Ke(b,n);f.push(it(b,A,i)-d)}p=x,d=y}return t.breakableFitAdvances=f,t.breakableFitAdvances}let c=[],s="",l=0;for(let f of a){s+=f;let p=Ke(s,n),d=it(s,p,i);c.push(d-l),l=d}return t.breakableFitAdvances=c,t.breakableFitAdvances}function tu(e,t){let n=zr();n.font=e;let i=zp(e),r=jp(e),o=t?qp(e,r):0;return{cache:i,fontSize:r,emojiCorrection:o}}function Jp(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 Xp(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Qp(e,t,n,i,r){let o=0,a=t;for(;o<e.length;){let c=a+e[o];if((o+1<e.length?c+r:c)>n+i)break;a=c,o++}return{fitCount:o,fittedWidth:a}}function nu(e,t){return e.simpleLineWalkFastPath?iu(e,t):ru(e,t)}function iu(e,t,n){let{widths:i,kinds:r,breakableFitAdvances:o}=e;if(i.length===0)return 0;let c=vt().lineFitEpsilon,s=t+c,l=0,f=0,p=!1,d=0,x=0,S=0,y=0,b=-1,A=0;function _(){b=-1,A=0}function M(T=S,R=y,L=f){l++,n?.({startSegmentIndex:d,startGraphemeIndex:x,endSegmentIndex:T,endGraphemeIndex:R,width:L}),f=0,p=!1,_()}function H(T,R){p=!0,d=T,x=0,S=T+1,y=0,f=R}function D(T,R,L){p=!0,d=T,x=R,S=T,y=R+1,f=L}function F(T,R){if(!p){H(T,R);return}f+=R,S=T+1,y=0}function w(T,R){let L=o[T];for(let z=R;z<L.length;z++){let P=L[z];p?f+P>s?(M(),D(T,z,P)):(f+=P,S=T,y=z+1):D(T,z,P)}p&&S===T&&y===L.length&&(S=T+1,y=0)}let C=0;for(;C<i.length&&!(!p&&(C=Jp(e,C),C>=i.length));){let T=i[C],R=r[C],L=R==="space"||R==="preserved-space"||R==="tab"||R==="zero-width-break"||R==="soft-hyphen";if(!p){T>t&&o[C]!==null?w(C,0):H(C,T),L&&(b=C+1,A=f-T),C++;continue}if(f+T>s){if(L){F(C,T),M(C+1,0,f-T),C++;continue}if(b>=0){if(S>b||S===b&&y>0){M();continue}M(b,0,A);continue}if(T>t&&o[C]!==null){M(),w(C,0),C++;continue}M();continue}F(C,T),L&&(b=C+1,A=f-T),C++}return p&&M(),l}function ru(e,t,n){if(e.simpleLineWalkFastPath)return iu(e,t,n);let{widths:i,lineEndFitAdvances:r,lineEndPaintAdvances:o,kinds:a,breakableFitAdvances:c,discretionaryHyphenWidth:s,tabStopAdvance:l,chunks:f}=e;if(i.length===0||f.length===0)return 0;let p=vt(),d=p.lineFitEpsilon,x=t+d,S=0,y=0,b=!1,A=0,_=0,M=0,H=0,D=-1,F=0,w=0,C=null;function T(){D=-1,F=0,w=0,C=null}function R(j=M,J=H,B=y){S++,n?.({startSegmentIndex:A,startGraphemeIndex:_,endSegmentIndex:j,endGraphemeIndex:J,width:B}),y=0,b=!1,T()}function L(j,J){b=!0,A=j,_=0,M=j+1,H=0,y=J}function z(j,J,B){b=!0,A=j,_=J,M=j,H=J+1,y=B}function P(j,J){if(!b){L(j,J);return}y+=J,M=j+1,H=0}function X(j,J,B,V){if(!J)return;let Ae=j==="tab"?0:r[B],U=j==="tab"?V:o[B];D=B+1,F=y-V+Ae,w=y-V+U,C=j}function I(j,J){let B=c[j];for(let V=J;V<B.length;V++){let Ae=B[V];b?y+Ae>x?(R(),z(j,V,Ae)):(y+=Ae,M=j,H=V+1):z(j,V,Ae)}b&&M===j&&H===B.length&&(M=j+1,H=0)}function ie(j){if(C!=="soft-hyphen")return!1;let J=c[j];if(J==null)return!1;let{fitCount:B,fittedWidth:V}=Qp(J,y,t,d,s);return B===0?!1:(y=V,M=j,H=B,T(),B===J.length?(M=j+1,H=0,!0):(R(j,B,V+s),I(j,B),!0))}function Te(j){S++,n?.({startSegmentIndex:j.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:j.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),T()}for(let j=0;j<f.length;j++){let J=f[j];if(J.startSegmentIndex===J.endSegmentIndex){Te(J);continue}b=!1,y=0,A=J.startSegmentIndex,_=0,M=J.startSegmentIndex,H=0,T();let B=J.startSegmentIndex;for(;B<J.endSegmentIndex;){let V=a[B],Ae=V==="space"||V==="preserved-space"||V==="tab"||V==="zero-width-break"||V==="soft-hyphen",U=V==="tab"?Xp(y,l):i[B];if(V==="soft-hyphen"){b&&(M=B+1,H=0,D=B+1,F=y+s,w=y+s,C=V),B++;continue}if(!b){U>t&&c[B]!==null?I(B,0):L(B,U),X(V,Ae,B,U),B++;continue}if(y+U>x){let G=y+(V==="tab"?0:r[B]),ae=y+(V==="tab"?U:o[B]);if(C==="soft-hyphen"&&p.preferEarlySoftHyphenBreak&&F<=x){R(D,0,w);continue}if(C==="soft-hyphen"&&ie(B)){B++;continue}if(Ae&&G<=x){P(B,U),R(B+1,0,ae),B++;continue}if(D>=0&&F<=x){if(M>D||M===D&&H>0){R();continue}let oe=D;R(oe,0,w),B=oe;continue}if(U>t&&c[B]!==null){R(),I(B,0),B++;continue}R();continue}P(B,U),X(V,Ae,B,U),B++}if(b){let V=D===J.consumedEndSegmentIndex?w:y;R(J.consumedEndSegmentIndex,0,V)}}return S}var jr=null;function Zp(){return jr===null&&(jr=new Intl.Segmenter(void 0,{granularity:"grapheme"})),jr}function eh(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 th(e,t){let n=[],i=[],r=0,o=!1,a=!1,c=!1;function s(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:r}),i=[],o=!1,a=!1,c=!1)}function l(p,d,x){i=[p],r=d,o=x,a=ti(p),c=mn.has(p)}function f(p,d){i.push(p),o=o||d;let x=ti(p);p.length===1&&nt.has(p)?a=a||x:a=x,c=!1}for(let p of Zp().segment(e)){let d=p.segment,x=Ie(d);if(i.length===0){l(d,p.index,x);continue}if(c||Zn.has(d)||nt.has(d)||t.carryCJKAfterClosingQuote&&x&&a){f(d,x);continue}if(!o&&!x){f(d,x);continue}s(),l(d,p.index,x)}return s(),n}function nh(e){if(e.length<=1)return e;let t=[],n=[e[0].text],i=e[0].start,r=Ie(e[0].text),o=Qn(e[0].text);function a(){t.push({text:n.length===1?n[0]:n.join(""),start:i})}for(let c=1;c<e.length;c++){let s=e[c],l=Ie(s.text),f=Qn(s.text);if(r&&o){n.push(s.text),r=r||l,o=f;continue}a(),n=[s.text],i=s.start,r=l,o=f}return a(),t}function ih(e,t,n,i){let r=vt(),{cache:o,emojiCorrection:a}=tu(t,Zl(e.normalized)),c=it("-",Ke("-",o),a),l=it(" ",Ke(" ",o),a)*8;if(e.len===0)return eh(n);let f=[],p=[],d=[],x=[],S=e.chunks.length<=1,y=n?[]:null,b=[],A=n?[]:null,_=Array.from({length:e.len});function M(w,C,T,R,L,z,P){L!=="text"&&L!=="space"&&L!=="zero-width-break"&&(S=!1),f.push(C),p.push(T),d.push(R),x.push(L),y?.push(z),b.push(P),A!==null&&A.push(w)}function H(w,C,T,R,L){let z=Ke(w,o),P=it(w,z,a),X=C==="space"||C==="preserved-space"||C==="zero-width-break"?0:P,I=C==="space"||C==="zero-width-break"?0:P;if(L&&R&&w.length>1){let ie="sum-graphemes";fn(w)?ie="pair-context":r.preferPrefixWidthsForBreakableRuns&&(ie="segment-prefixes");let Te=eu(w,z,o,a,ie);M(w,P,X,I,C,T,Te);return}M(w,P,X,I,C,T,null)}for(let w=0;w<e.len;w++){_[w]=f.length;let C=e.texts[w],T=e.isWordLike[w],R=e.kinds[w],L=e.starts[w];if(R==="soft-hyphen"){M(C,0,c,c,R,L,null);continue}if(R==="hard-break"){M(C,0,0,0,R,L,null);continue}if(R==="tab"){M(C,0,0,0,R,L,null);continue}let z=Ke(C,o);if(R==="text"&&z.containsCJK){let P=th(C,r),X=i==="keep-all"?nh(P):P;for(let I=0;I<X.length;I++){let ie=X[I];H(ie.text,"text",L+ie.start,T,i==="keep-all"||!Ie(ie.text))}continue}H(C,R,L,T,!0)}let D=rh(e.chunks,_,f.length),F=y===null?null:Bl(e.normalized,y);return A!==null?{widths:f,lineEndFitAdvances:p,lineEndPaintAdvances:d,kinds:x,simpleLineWalkFastPath:S,segLevels:F,breakableFitAdvances:b,discretionaryHyphenWidth:c,tabStopAdvance:l,chunks:D,segments:A}:{widths:f,lineEndFitAdvances:p,lineEndPaintAdvances:d,kinds:x,simpleLineWalkFastPath:S,segLevels:F,breakableFitAdvances:b,discretionaryHyphenWidth:c,tabStopAdvance:l,chunks:D}}function rh(e,t,n){let i=[];for(let r=0;r<e.length;r++){let o=e[r],a=o.startSegmentIndex<t.length?t[o.startSegmentIndex]:n,c=o.endSegmentIndex<t.length?t[o.endSegmentIndex]:n,s=o.consumedEndSegmentIndex<t.length?t[o.consumedEndSegmentIndex]:n;i.push({startSegmentIndex:a,endSegmentIndex:c,consumedEndSegmentIndex:s})}return i}function oh(e,t,n,i){let r=i?.wordBreak??"normal",o=Yl(e,vt(),i?.whiteSpace,r);return ih(o,t,n,r)}function ou(e,t,n){return oh(e,t,!1,n)}function su(e,t,n){let i=nu(e,t);return{lineCount:i,height:i*n}}var sh={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function au(e,t){let n={...sh,...t},i=1.2;for(let r=n.baseFontSize;r>=n.minFontSize;r-=n.step){let o=`${n.fontWeight} ${r}px ${n.fontFamily}`,a=ou(e,o),{lineCount:c}=su(a,n.maxWidth,r*i);if(c<=1)return{fontSize:r,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}window.__timelines=window.__timelines||{};Cl();window.__hyperframes={fitTextFontSize:au,getVariables:go};function lu(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,Pl())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",lu,{once:!0}):lu();})();
|
|
356
|
+
`)}var ko=null,Gh;function Hh(){return ko===null&&(ko=new Intl.Segmenter(Gh,{granularity:"word"})),ko}var Bh=/\p{Script=Arabic}/u,Fr=/\p{M}/u,vc=/\p{Nd}/u;function pc(e){return Bh.test(e)}function hc(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 Be(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(hc(i))return!0;t++;continue}}if(hc(n))return!0}}return!1}function Uh(e){let t=kr(e);return t!==null&&(Mr.has(t)||ct.has(t))}var Wh=new Set(["\xA0","\u202F","\u2060","\uFEFF"]);function Vh(e){return Be(e)}function zh(e){let t=kr(e);return t!==null&&Wh.has(t)}function Nr(e){return!Uh(e)&&!zh(e)}var Mr=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"]),In=new Set(['"',"(","[","{","\u201C","\u2018","\xAB","\u2039","\uFF08","\u3014","\u3008","\u300A","\u300C","\u300E","\u3010","\u3016","\u3018","\u301A"]),Io=new Set(["'","\u2019"]),ct=new Set([".",",","!","?",":",";","\u060C","\u061B","\u061F","\u0964","\u0965","\u104A","\u104B","\u104C","\u104D","\u104F",")","]","}","%",'"',"\u201D","\u2019","\xBB","\u203A","\u2026"]),$h=new Set([":",".","\u060C","\u061B"]),qh=new Set(["\u104F"]),jh=new Set(["\u201D","\u2019","\xBB","\u203A","\u300D","\u300F","\u3011","\u300B","\u3009","\u3015","\uFF09"]);function Kh(e){if(Po(e))return!0;let t=!1;for(let n of e){if(ct.has(n)){t=!0;continue}if(!(t&&Fr.test(n)))return!1}return t}function Yh(e){for(let t of e)if(!Mr.has(t)&&!ct.has(t))return!1;return e.length>0}function Xh(e){if(Po(e))return!0;for(let t of e)if(!In.has(t)&&!Io.has(t)&&!Fr.test(t))return!1;return e.length>0}function Po(e){let t=!1;for(let n of e)if(!(n==="\\"||Fr.test(n))){if(In.has(n)||ct.has(n)||Io.has(n)){t=!0;continue}return!1}return t}function Ec(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 kr(e){if(e.length===0)return null;let t=Ec(e,e.length);return e.slice(t)}function Jh(e){let t=Array.from(e),n=t.length;for(;n>0;){let r=t[n-1];if(Fr.test(r)){n--;continue}if(In.has(r)||Io.has(r)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Qh(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="\u2014"?e:null}function gc(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 xc(e,t){return e&&t!==null&&$h.has(t)}function Zh(e){let t=kr(e);return t!==null&&qh.has(t)}function eg(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 Dr(e){let t=e.length;for(;t>0;){let n=Ec(e,t),r=e.slice(n,t);if(jh.has(r))return!0;if(!ct.has(r))return!1;t=n}return!1}function tg(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
357
|
+
`)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 ng=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function De(e){return e.length===1?e[0]:e.join("")}function rg(e,t){let n=[];for(let r=e.length-1;r>=0;r--)n.push(e[r]);return n.push(t),De(n)}function ig(e,t,n,r){if(!ng.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];let i=[],o=null,a=[],l=n,s=!1,u=0;for(let c of e){let m=tg(c,r),f=m==="text"&&t;if(o!==null&&m===o&&f===s){a.push(c),u+=c.length;continue}o!==null&&i.push({text:De(a),isWordLike:s,kind:o,start:l}),o=m,a=[c],l=n+u,s=f,u+=c.length}return o!==null&&i.push({text:De(a),isWordLike:s,kind:o,start:l}),i}function Do(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var og=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function ag(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:og.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function sg(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function lg(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"||!ag(e,a))continue;let l=[t[a]],s=a+1;for(;s<e.len&&!Do(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]=De(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 ug(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]),!sg(a))continue;let l=o+1;if(l>=e.len||Do(e.kinds[l]))continue;let s=[],u=e.starts[l],c=l;for(;c<e.len&&!Do(e.kinds[c]);)s.push(e.texts[c]),c++;s.length>0&&(t.push(De(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 cg=new Set([":","-","/","\xD7",",",".","+","\u2013","\u2014"]),bc=/^[A-Za-z0-9_]+[,:;]*$/,yc=/[,:;]+$/;function Cc(e){for(let t of e)if(vc.test(t))return!0;return!1}function Dn(e){if(e.length===0)return!1;for(let t of e)if(!(vc.test(t)||cg.has(t)))return!1;return!0}function dg(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"&&Dn(a)&&Cc(a)){let s=[a],u=o+1;for(;u<e.len&&e.kinds[u]==="text"&&Dn(e.texts[u]);)s.push(e.texts[u]),u++;t.push(De(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 fg(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&&bc.test(a)){let u=[a],c=yc.test(a),m=o+1;for(;c&&m<e.len&&e.kinds[m]==="text"&&e.isWordLike[m]&&bc.test(e.texts[m]);){let f=e.texts[m];u.push(f),c=yc.test(f),m++}t.push(De(u)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=m-1;continue}t.push(a),n.push(s),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function mg(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||!Cc(c)||!Dn(c))&&(s=!1)}if(s){let u=0;for(let c=0;c<l.length;c++){let m=l[c],f=c<l.length-1?`${m}-`:m;t.push(f),n.push(!0),r.push("text"),i.push(e.starts[o]+u),u+=f.length}continue}}t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function pg(e){let t=[],n=[],r=[],i=[],o=0;for(;o<e.len;){let a=[e.texts[o]],l=e.isWordLike[o],s=e.kinds[o],u=e.starts[o];if(s==="glue"){let c=[a[0]],m=u;for(o++;o<e.len&&e.kinds[o]==="glue";)c.push(e.texts[o]),o++;let f=De(c);if(o<e.len&&e.kinds[o]==="text")a[0]=f,a.push(e.texts[o]),l=e.isWordLike[o],s="text",u=m,o++;else{t.push(f),n.push(!1),r.push("glue"),i.push(m);continue}}else o++;if(s==="text")for(;o<e.len&&e.kinds[o]==="glue";){let c=[];for(;o<e.len&&e.kinds[o]==="glue";)c.push(e.texts[o]),o++;let m=De(c);if(o<e.len&&e.kinds[o]==="text"){a.push(m,e.texts[o]),l=l||e.isWordLike[o],o++;continue}a.push(m)}t.push(De(a)),n.push(l),r.push(s),i.push(u)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function hg(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"||!Be(t[o])||!Be(t[o+1]))continue;let a=Jh(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 Sc(e,t,n){let r=Hh(),i=0,o=[],a=[],l=[],s=[],u=[],c=[],m=[],f=[],x=[],v=[],C=[],y=[];for(let _ of r.segment(e))for(let b of ig(_.segment,_.isWordLike??!1,_.index,n)){let Y=function(){c[H]!==null&&(a[H]=[gc(o,c,m,H)],c[H]=null),a[H].push(b.text),l[H]=l[H]||b.isWordLike,f[H]=f[H]||R,x[H]=x[H]||F,v[H]=B,C[H]=ne,y[H]=xc(x[H],G)},S=b.kind==="text",A=Qh(b.text,b.isWordLike,b.kind),R=Be(b.text),F=pc(b.text),G=kr(b.text),B=Dr(b.text),ne=Zh(b.text),H=i-1;t.carryCJKAfterClosingQuote&&S&&i>0&&s[H]==="text"&&R&&f[H]&&v[H]||S&&i>0&&s[H]==="text"&&Yh(b.text)&&f[H]||S&&i>0&&s[H]==="text"&&C[H]?Y():S&&i>0&&s[H]==="text"&&b.isWordLike&&F&&y[H]?(Y(),l[H]=!0):A!==null&&i>0&&s[H]==="text"&&c[H]===A?m[H]=(m[H]??1)+1:S&&!b.isWordLike&&i>0&&s[H]==="text"&&(Kh(b.text)||b.text==="-"&&l[H])?Y():(o[i]=b.text,a[i]=[b.text],l[i]=b.isWordLike,s[i]=b.kind,u[i]=b.start,c[i]=A,m[i]=A===null?0:1,f[i]=R,x[i]=F,v[i]=B,C[i]=ne,y[i]=xc(F,G),i++)}for(let _=0;_<i;_++){if(c[_]!==null){o[_]=gc(o,c,m,_);continue}o[_]=De(a[_])}for(let _=1;_<i;_++)s[_]==="text"&&!l[_]&&Po(o[_])&&s[_-1]==="text"&&(o[_-1]+=o[_],l[_-1]=l[_-1]||l[_],o[_]="");let w=Array.from({length:i},()=>null),T=-1;for(let _=i-1;_>=0;_--){let b=o[_];if(b.length!==0){if(s[_]==="text"&&!l[_]&&Xh(b)&&T>=0&&s[T]==="text"){let S=w[T]??[];S.push(b),w[T]=S,u[T]=u[_],o[_]="";continue}T=_}}for(let _=0;_<i;_++){let b=w[_];b!=null&&(o[_]=rg(b,o[_]))}let N=0;for(let _=0;_<i;_++){let b=o[_];b.length!==0&&(N!==_&&(o[N]=b,l[N]=l[_],s[N]=s[_],u[N]=u[_]),N++)}o.length=N,l.length=N,s.length=N,u.length=N;let D=pg({len:N,texts:o,isWordLike:l,kinds:s,starts:u}),I=hg(fg(mg(dg(ug(lg(D))))));for(let _=0;_<I.len-1;_++){let b=eg(I.texts[_]);b!==null&&(I.kinds[_]!=="space"&&I.kinds[_]!=="preserved-space"||I.kinds[_+1]!=="text"||!pc(I.texts[_+1])||(I.texts[_]=b.space,I.isWordLike[_]=!1,I.kinds[_]=I.kinds[_]==="preserved-space"?"preserved-space":"space",I.texts[_+1]=b.marks+I.texts[_+1],I.starts[_+1]=I.starts[_]+b.space.length))}return I}function gg(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 xg(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(De(o)),n.push(a),r.push("text"),i.push(l),o=null)}for(let m=0;m<e.len;m++){let f=e.texts[m],x=e.kinds[m],v=e.isWordLike[m],C=e.starts[m];if(x==="text"){let y=Vh(f),w=Nr(f);if(o!==null&&s&&u){o.push(f),a=a||v,s=s||y,u=w;continue}c(),o=[f],a=v,l=C,s=y,u=w;continue}c(),t.push(f),n.push(v),r.push(x),i.push(C)}return c(),{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function _c(e,t,n="normal",r="normal"){let i=Ih(n),o=i.mode==="pre-wrap"?Oh(e):Ph(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let a=r==="keep-all"?xg(Sc(o,t,i)):Sc(o,t,i);return{normalized:o,chunks:gg(a,i),...a}}var Ut=null,Ac=new Map,Wt=null,bg=96,yg=/\p{Emoji_Presentation}/u,Sg=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u,Oo=null,wc=new Map;function Go(){if(Ut!==null)return Ut;if(typeof OffscreenCanvas<"u")return Ut=new OffscreenCanvas(1,1).getContext("2d"),Ut;if(typeof document<"u")return Ut=document.createElement("canvas").getContext("2d"),Ut;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function vg(e){let t=Ac.get(e);return t||(t=new Map,Ac.set(e,t)),t}function tt(e,t){let n=t.get(e);return n===void 0&&(n={width:Go().measureText(e).width,containsCJK:Be(e)},t.set(e,n)),n}function Vt(){if(Wt!==null)return Wt;if(typeof navigator>"u")return Wt={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Wt;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 Wt={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:r,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},Wt}function Eg(e){let t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function Tc(){return Oo===null&&(Oo=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Oo}function Cg(e){return yg.test(e)||e.includes("\uFE0F")}function Rc(e){return Sg.test(e)}function _g(e,t){let n=wc.get(e);if(n!==void 0)return n;let r=Go();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 wc.set(e,n),n}function Ag(e){let t=0,n=Tc();for(let r of n.segment(e))Cg(r.segment)&&t++;return t}function wg(e,t){return t.emojiCount===void 0&&(t.emojiCount=Ag(e)),t.emojiCount}function dt(e,t,n){return n===0?t.width:t.width-wg(e,t)*n}function Lc(e,t,n,r,i){if(t.breakableFitAdvances!==void 0)return t.breakableFitAdvances;let o=Tc(),a=[];for(let c of o.segment(e))a.push(c.segment);if(a.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(i==="sum-graphemes"){let c=[];for(let m of a){let f=tt(m,n);c.push(dt(m,f,r))}return t.breakableFitAdvances=c,t.breakableFitAdvances}if(i==="pair-context"||a.length>bg){let c=[],m=null,f=0;for(let x of a){let v=tt(x,n),C=dt(x,v,r);if(m===null)c.push(C);else{let y=m+x,w=tt(y,n);c.push(dt(y,w,r)-f)}m=x,f=C}return t.breakableFitAdvances=c,t.breakableFitAdvances}let l=[],s="",u=0;for(let c of a){s+=c;let m=tt(s,n),f=dt(s,m,r);l.push(f-u),u=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function Fc(e,t){let n=Go();n.font=e;let r=vg(e),i=Eg(e),o=t?_g(e,i):0;return{cache:r,fontSize:i,emojiCorrection:o}}function Tg(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 Rg(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Lg(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 Nc(e,t){return e.simpleLineWalkFastPath?Mc(e,t):kc(e,t)}function Mc(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:o}=e;if(r.length===0)return 0;let l=Vt().lineFitEpsilon,s=t+l,u=0,c=0,m=!1,f=0,x=0,v=0,C=0,y=-1,w=0;function T(){y=-1,w=0}function N(A=v,R=C,F=c){u++,n?.({startSegmentIndex:f,startGraphemeIndex:x,endSegmentIndex:A,endGraphemeIndex:R,width:F}),c=0,m=!1,T()}function D(A,R){m=!0,f=A,x=0,v=A+1,C=0,c=R}function I(A,R,F){m=!0,f=A,x=R,v=A,C=R+1,c=F}function _(A,R){if(!m){D(A,R);return}c+=R,v=A+1,C=0}function b(A,R){let F=o[A];for(let G=R;G<F.length;G++){let B=F[G];m?c+B>s?(N(),I(A,G,B)):(c+=B,v=A,C=G+1):I(A,G,B)}m&&v===A&&C===F.length&&(v=A+1,C=0)}let S=0;for(;S<r.length&&!(!m&&(S=Tg(e,S),S>=r.length));){let A=r[S],R=i[S],F=R==="space"||R==="preserved-space"||R==="tab"||R==="zero-width-break"||R==="soft-hyphen";if(!m){A>t&&o[S]!==null?b(S,0):D(S,A),F&&(y=S+1,w=c-A),S++;continue}if(c+A>s){if(F){_(S,A),N(S+1,0,c-A),S++;continue}if(y>=0){if(v>y||v===y&&C>0){N();continue}N(y,0,w);continue}if(A>t&&o[S]!==null){N(),b(S,0),S++;continue}N();continue}_(S,A),F&&(y=S+1,w=c-A),S++}return m&&N(),u}function kc(e,t,n){if(e.simpleLineWalkFastPath)return Mc(e,t,n);let{widths:r,lineEndFitAdvances:i,lineEndPaintAdvances:o,kinds:a,breakableFitAdvances:l,discretionaryHyphenWidth:s,tabStopAdvance:u,chunks:c}=e;if(r.length===0||c.length===0)return 0;let m=Vt(),f=m.lineFitEpsilon,x=t+f,v=0,C=0,y=!1,w=0,T=0,N=0,D=0,I=-1,_=0,b=0,S=null;function A(){I=-1,_=0,b=0,S=null}function R(V=N,X=D,z=C){v++,n?.({startSegmentIndex:w,startGraphemeIndex:T,endSegmentIndex:V,endGraphemeIndex:X,width:z}),C=0,y=!1,A()}function F(V,X){y=!0,w=V,T=0,N=V+1,D=0,C=X}function G(V,X,z){y=!0,w=V,T=X,N=V,D=X+1,C=z}function B(V,X){if(!y){F(V,X);return}C+=X,N=V+1,D=0}function ne(V,X,z,J){if(!X)return;let xe=V==="tab"?0:i[z],P=V==="tab"?J:o[z];I=z+1,_=C-J+xe,b=C-J+P,S=V}function H(V,X){let z=l[V];for(let J=X;J<z.length;J++){let xe=z[J];y?C+xe>x?(R(),G(V,J,xe)):(C+=xe,N=V,D=J+1):G(V,J,xe)}y&&N===V&&D===z.length&&(N=V+1,D=0)}function Y(V){if(S!=="soft-hyphen")return!1;let X=l[V];if(X==null)return!1;let{fitCount:z,fittedWidth:J}=Lg(X,C,t,f,s);return z===0?!1:(C=J,N=V,D=z,A(),z===X.length?(N=V+1,D=0,!0):(R(V,z,J+s),H(V,z),!0))}function we(V){v++,n?.({startSegmentIndex:V.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:V.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),A()}for(let V=0;V<c.length;V++){let X=c[V];if(X.startSegmentIndex===X.endSegmentIndex){we(X);continue}y=!1,C=0,w=X.startSegmentIndex,T=0,N=X.startSegmentIndex,D=0,A();let z=X.startSegmentIndex;for(;z<X.endSegmentIndex;){let J=a[z],xe=J==="space"||J==="preserved-space"||J==="tab"||J==="zero-width-break"||J==="soft-hyphen",P=J==="tab"?Rg(C,u):r[z];if(J==="soft-hyphen"){y&&(N=z+1,D=0,I=z+1,_=C+s,b=C+s,S=J),z++;continue}if(!y){P>t&&l[z]!==null?H(z,0):F(z,P),ne(J,xe,z,P),z++;continue}if(C+P>x){let U=C+(J==="tab"?0:i[z]),se=C+(J==="tab"?P:o[z]);if(S==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&_<=x){R(I,0,b);continue}if(S==="soft-hyphen"&&Y(z)){z++;continue}if(xe&&U<=x){B(z,P),R(z+1,0,se),z++;continue}if(I>=0&&_<=x){if(N>I||N===I&&D>0){R();continue}let ie=I;R(ie,0,b),z=ie;continue}if(P>t&&l[z]!==null){R(),H(z,0),z++;continue}R();continue}B(z,P),ne(J,xe,z,P),z++}if(y){let J=I===X.consumedEndSegmentIndex?b:C;R(X.consumedEndSegmentIndex,0,J)}}return v}var Ho=null;function Fg(){return Ho===null&&(Ho=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Ho}function Ng(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 Mg(e,t){let n=[],r=[],i=0,o=!1,a=!1,l=!1;function s(){r.length!==0&&(n.push({text:r.length===1?r[0]:r.join(""),start:i}),r=[],o=!1,a=!1,l=!1)}function u(m,f,x){r=[m],i=f,o=x,a=Dr(m),l=In.has(m)}function c(m,f){r.push(m),o=o||f;let x=Dr(m);m.length===1&&ct.has(m)?a=a||x:a=x,l=!1}for(let m of Fg().segment(e)){let f=m.segment,x=Be(f);if(r.length===0){u(f,m.index,x);continue}if(l||Mr.has(f)||ct.has(f)||t.carryCJKAfterClosingQuote&&x&&a){c(f,x);continue}if(!o&&!x){c(f,x);continue}s(),u(f,m.index,x)}return s(),n}function kg(e){if(e.length<=1)return e;let t=[],n=[e[0].text],r=e[0].start,i=Be(e[0].text),o=Nr(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=Be(s.text),c=Nr(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 Dg(e,t,n,r){let i=Vt(),{cache:o,emojiCorrection:a}=Fc(t,Rc(e.normalized)),l=dt("-",tt("-",o),a),u=dt(" ",tt(" ",o),a)*8;if(e.len===0)return Ng(n);let c=[],m=[],f=[],x=[],v=e.chunks.length<=1,C=n?[]:null,y=[],w=n?[]:null,T=Array.from({length:e.len});function N(b,S,A,R,F,G,B){F!=="text"&&F!=="space"&&F!=="zero-width-break"&&(v=!1),c.push(S),m.push(A),f.push(R),x.push(F),C?.push(G),y.push(B),w!==null&&w.push(b)}function D(b,S,A,R,F){let G=tt(b,o),B=dt(b,G,a),ne=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:B,H=S==="space"||S==="zero-width-break"?0:B;if(F&&R&&b.length>1){let Y="sum-graphemes";Dn(b)?Y="pair-context":i.preferPrefixWidthsForBreakableRuns&&(Y="segment-prefixes");let we=Lc(b,G,o,a,Y);N(b,B,ne,H,S,A,we);return}N(b,B,ne,H,S,A,null)}for(let b=0;b<e.len;b++){T[b]=c.length;let S=e.texts[b],A=e.isWordLike[b],R=e.kinds[b],F=e.starts[b];if(R==="soft-hyphen"){N(S,0,l,l,R,F,null);continue}if(R==="hard-break"){N(S,0,0,0,R,F,null);continue}if(R==="tab"){N(S,0,0,0,R,F,null);continue}let G=tt(S,o);if(R==="text"&&G.containsCJK){let B=Mg(S,i),ne=r==="keep-all"?kg(B):B;for(let H=0;H<ne.length;H++){let Y=ne[H];D(Y.text,"text",F+Y.start,A,r==="keep-all"||!Be(Y.text))}continue}D(S,R,F,A,!0)}let I=Ig(e.chunks,T,c.length),_=C===null?null:mc(e.normalized,C);return w!==null?{widths:c,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:v,segLevels:_,breakableFitAdvances:y,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:I,segments:w}:{widths:c,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:v,segLevels:_,breakableFitAdvances:y,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:I}}function Ig(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 Pg(e,t,n,r){let i=r?.wordBreak??"normal",o=_c(e,Vt(),r?.whiteSpace,i);return Dg(o,t,n,i)}function Dc(e,t,n){return Pg(e,t,!1,n)}function Ic(e,t,n){let r=Nc(e,t);return{lineCount:r,height:r*n}}var Og={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function Pc(e,t){let n={...Og,...t},r=1.2;for(let i=n.baseFontSize;i>=n.minFontSize;i-=n.step){let o=`${n.fontWeight} ${i}px ${n.fontFamily}`,a=Dc(e,o),{lineCount:l}=Ic(a,n.maxWidth,i*r);if(l<=1)return{fontSize:i,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}window.__timelines=window.__timelines||{};Mu();window.__hyperframes={fitTextFontSize:Pc,getVariables:la};function Oc(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,dc())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Oc,{once:!0}):Oc();})();
|
|
356
358
|
|