hyperframes 0.7.59 → 0.7.60

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 CHANGED
@@ -50,7 +50,7 @@ var VERSION;
50
50
  var init_version = __esm({
51
51
  "src/version.ts"() {
52
52
  "use strict";
53
- VERSION = true ? "0.7.59" : "0.0.0-dev";
53
+ VERSION = true ? "0.7.60" : "0.0.0-dev";
54
54
  }
55
55
  });
56
56
 
@@ -55314,6 +55314,9 @@ var init_timingResolver = __esm({
55314
55314
  function shouldClampMediaDuration(declaredDuration, maxDuration) {
55315
55315
  return declaredDuration > maxDuration + MEDIA_DURATION_CLAMP_EPSILON_SECONDS;
55316
55316
  }
55317
+ function shouldClampResolvedMediaDuration(tagName19, declaredDuration, maxDuration) {
55318
+ return tagName19 === "audio" && shouldClampMediaDuration(declaredDuration, maxDuration);
55319
+ }
55317
55320
  function getAttr(tag, attr2) {
55318
55321
  const match = tag.match(new RegExp(`(?<![\\w-])${attr2}=["']([^"']+)["']`));
55319
55322
  return match ? match[1] ?? null : null;
@@ -56642,7 +56645,7 @@ var RUNTIME_IIFE;
56642
56645
  var init_runtime_inline = __esm({
56643
56646
  "../core/dist/generated/runtime-inline.js"() {
56644
56647
  "use strict";
56645
- RUNTIME_IIFE = '"use strict";(()=>{var zl=Object.create;var oi=Object.defineProperty;var jl=Object.getOwnPropertyDescriptor;var ql=Object.getOwnPropertyNames;var $l=Object.getPrototypeOf,Kl=Object.prototype.hasOwnProperty;var Jl=(e,t,n)=>t in e?oi(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 Xl=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ql(t))!Kl.call(e,r)&&r!==n&&oi(e,r,{get:()=>t[r],enumerable:!(i=jl(t,r))||i.enumerable});return e};var Yl=(e,t,n)=>(n=e!=null?zl($l(e)):{},Xl(t||!e||!e.__esModule?oi(n,"default",{value:e,enumerable:!0}):n,e));var he=(e,t,n)=>Jl(e,typeof t!="symbol"?t+"":t,n);var Oo=ee((Lh,vi)=>{var J=String,Po=function(){return{isColorSupported:!1,reset:J,bold:J,dim:J,italic:J,underline:J,inverse:J,hidden:J,strikethrough:J,black:J,red:J,green:J,yellow:J,blue:J,magenta:J,cyan:J,white:J,gray:J,bgBlack:J,bgRed:J,bgGreen:J,bgYellow:J,bgBlue:J,bgMagenta:J,bgCyan:J,bgWhite:J,blackBright:J,redBright:J,greenBright:J,yellowBright:J,blueBright:J,magentaBright:J,cyanBright:J,whiteBright:J,bgBlackBright:J,bgRedBright:J,bgGreenBright:J,bgYellowBright:J,bgBlueBright:J,bgMagentaBright:J,bgCyanBright:J,bgWhiteBright:J}};vi.exports=Po();vi.exports.createColors=Po});var Mi=ee(()=>{});var Sn=ee((Dh,Go)=>{"use strict";var Bo=Oo(),Ho=Mi(),Bt=class e extends Error{constructor(t,n,i,r,o,a){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),r&&(this.source=r),a&&(this.plugin=a),typeof n<"u"&&typeof i<"u"&&(typeof n=="number"?(this.line=n,this.column=i):(this.line=n.line,this.column=n.column,this.endLine=i.line,this.endColumn=i.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=Bo.isColorSupported);let i=d=>d,r=d=>d,o=d=>d;if(t){let{bold:d,gray:m,red:f}=Bo.createColors(!0);r=x=>d(f(x)),i=x=>m(x),Ho&&(o=x=>Ho(x))}let a=n.split(/\\r?\\n/),u=Math.max(this.line-3,0),s=Math.min(this.line+2,a.length),l=String(s).length;return a.slice(u,s).map((d,m)=>{let f=u+1+m,x=" "+(" "+f).slice(-l)+" | ";if(f===this.line){if(d.length>160){let y=20,b=Math.max(0,this.column-y),A=Math.max(this.column+y,this.endColumn+y),_=d.slice(b,A),N=i(x.replace(/\\d/g," "))+d.slice(0,Math.min(this.column-1,y-1)).replace(/[^\\t]/g," ");return r(">")+i(x)+o(_)+`\n `+N+r("^")}let S=i(x.replace(/\\d/g," "))+d.slice(0,this.column-1).replace(/[^\\t]/g," ");return r(">")+i(x)+o(d)+`\n `+S+r("^")}return" "+i(x)+o(d)}).join(`\n`)}toString(){let t=this.showSourceCode();return t&&(t=`\n\n`+t+`\n`),this.name+": "+this.message+t}};Go.exports=Bt;Bt.default=Bt});var Ni=ee((Ih,Uo)=>{"use strict";var lc=/(<)(\\/?style\\b)/gi,uc=/(<)(!--)/g;function Ke(e){return typeof e!="string"||!e.includes("<")?e:e.replace(lc,"\\\\3c $2").replace(uc,"\\\\3c $2")}var Wo={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function cc(e){return e[0].toUpperCase()+e.slice(1)}var Ht=class{constructor(t){this.builder=t}atrule(t,n){let i=t.raws,r="@"+t.name,o=t.params?this.rawValue(t,"params"):"";if(typeof i.afterName<"u"?r+=i.afterName:o&&(r+=" "),t.nodes)this.block(t,r+o);else{let a=(i.between||"")+(n?";":"");this.builder(Ke(r+o+a),t)}}beforeAfter(t,n){let i;t.type==="decl"?i=this.raw(t,null,"beforeDecl"):t.type==="comment"?i=this.raw(t,null,"beforeComment"):n==="before"?i=this.raw(t,null,"beforeRule"):i=this.raw(t,null,"beforeClose");let r=t.parent,o=0;for(;r&&r.type!=="root";)o+=1,r=r.parent;if(i.includes(`\n`)){let a=this.raw(t,null,"indent");if(a.length)for(let u=0;u<o;u++)i+=a}return i}block(t,n){let i=this.raw(t,"between","beforeOpen");this.builder(Ke(n+i)+"{",t,"start");let r;t.nodes&&t.nodes.length?(this.body(t),r=this.raw(t,"after")):r=this.raw(t,"after","emptyBody"),r&&this.builder(Ke(r)),this.builder("}",t,"end")}body(t){let n=t.nodes,i=n.length-1;for(;i>0&&n[i].type==="comment";)i-=1;let r=this.raw(t,"semicolon"),o=t.type==="document";for(let a=0;a<n.length;a++){let u=n[a],s=this.raw(u,"before");s&&this.builder(o?s:Ke(s)),this.stringify(u,i!==a||r)}}comment(t){let n=this.raw(t,"left","commentLeft"),i=this.raw(t,"right","commentRight");this.builder(Ke("/*"+n+t.text+i+"*/"),t)}decl(t,n){let i=t.raws,r=this.raw(t,"between","colon"),o=t.prop+r+this.rawValue(t,"value");t.important&&(o+=i.important||" !important"),n&&(o+=";"),this.builder(Ke(o),t)}document(t){this.body(t)}raw(t,n,i){let r;if(i||(i=n),n&&(r=t.raws[n],typeof r<"u"))return r;let o=t.parent;if(i==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return Wo[i];let a=t.root(),u=a.rawCache||(a.rawCache={});if(typeof u[i]<"u")return u[i];if(i==="before"||i==="after")return this.beforeAfter(t,i);{let s="raw"+cc(i);this[s]?r=this[s](a,t):a.walk(l=>{if(r=l.raws[n],typeof r<"u")return!1})}return typeof r>"u"&&(r=Wo[i]),u[i]=r,r}rawBeforeClose(t){let n;return t.walk(i=>{if(i.nodes&&i.nodes.length>0&&typeof i.raws.after<"u")return n=i.raws.after,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawBeforeComment(t,n){let i;return t.walkComments(r=>{if(typeof r.raws.before<"u")return i=r.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(n,null,"beforeDecl"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeDecl(t,n){let i;return t.walkDecls(r=>{if(typeof r.raws.before<"u")return i=r.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(n,null,"beforeRule"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeOpen(t){let n;return t.walk(i=>{if(i.type!=="decl"&&(n=i.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(t){let n;return t.walk(i=>{if(i.nodes&&(i.parent!==t||t.first!==i)&&typeof i.raws.before<"u")return n=i.raws.before,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawColon(t){let n;return t.walkDecls(i=>{if(typeof i.raws.between<"u")return n=i.raws.between.replace(/[^\\s:]/g,""),!1}),n}rawEmptyBody(t){let n;return t.walk(i=>{if(i.nodes&&i.nodes.length===0&&(n=i.raws.after,typeof n<"u"))return!1}),n}rawIndent(t){if(t.raws.indent)return t.raws.indent;let n;return t.walk(i=>{let r=i.parent;if(r&&r!==t&&r.parent&&r.parent===t&&typeof i.raws.before<"u"){let o=i.raws.before.split(`\n`);return n=o[o.length-1],n=n.replace(/\\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(n=i.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let i=t[n],r=t.raws[n];return r&&r.value===i?r.raw:i}root(t){if(this.body(t),t.raws.after){let n=t.raws.after,i=t.parent&&t.parent.type==="document";this.builder(i?n:Ke(n))}}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(Ke(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)}};Uo.exports=Ht;Ht.default=Ht});var Gt=ee((Ph,Vo)=>{"use strict";var dc=Ni();function Li(e,t){new dc(t).stringify(e)}Vo.exports=Li;Li.default=Li});var En=ee((Oh,Ri)=>{"use strict";Ri.exports.isClean=Symbol("isClean");Ri.exports.my=Symbol("my")});var Vt=ee((Bh,zo)=>{"use strict";var fc=Sn(),mc=Ni(),pc=Gt(),{isClean:Wt,my:hc}=En();function ki(e,t){let n=new e.constructor;for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i)||i==="proxyCache")continue;let r=e[i],o=typeof r;i==="parent"&&o==="object"?t&&(n[i]=t):i==="source"?n[i]=r:Array.isArray(r)?n[i]=r.map(a=>ki(a,n)):(o==="object"&&r!==null&&(r=ki(r)),n[i]=r)}return n}function Ve(e,t){if(t&&typeof t.offset<"u")return t.offset;let n=1,i=1,r=0;for(let o=0;o<e.length;o++){if(i===t.line&&n===t.column){r=o;break}e[o]===`\n`?(n=1,i+=1):n+=1}return r}var Ut=class{get proxyOf(){return this}constructor(t={}){this.raws={},this[Wt]=!1,this[hc]=!0;for(let n in t)if(n==="nodes"){this.nodes=[];for(let i of t[n])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}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=ki(this);for(let i in t)n[i]=t[i];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:i,start:r}=this.rangeBy(n);return this.source.input.error(t,{column:r.column,line:r.line},{column:i.column,line:i.line},n)}return new fc(t)}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:n==="root"?()=>t.root().toProxy():t[n]},set(t,n,i){return t[n]===i||(t[n]=i,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&t.markDirty()),!0}}}markClean(){this[Wt]=!0}markDirty(){if(this[Wt]){this[Wt]=!1;let t=this;for(;t=t.parent;)t[Wt]=!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 i="document"in this.source.input?this.source.input.document:this.source.input.css,o=i.slice(Ve(i,this.source.start),Ve(i,this.source.end)).indexOf(t.word);o!==-1&&(n=this.positionInside(o))}return n}positionInside(t){let n=this.source.start.column,i=this.source.start.line,r="document"in this.source.input?this.source.input.document:this.source.input.css,o=Ve(r,this.source.start),a=o+t;for(let u=o;u<a;u++)r[u]===`\n`?(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:Ve(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:Ve(n,this.source.end)+1}:{column:i.column+1,line:i.line,offset:i.offset+1};if(t.word){let a=n.slice(Ve(n,this.source.start),Ve(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:Ve(n,t.start)}:t.index&&(i=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line,offset:Ve(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 mc().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 u=this[a];if(Array.isArray(u))i[a]=u.map(s=>typeof s=="object"&&s.toJSON?s.toJSON(null,n):s);else if(typeof u=="object"&&u.toJSON)i[a]=u.toJSON(null,n);else if(a==="source"){if(u==null)continue;let s=n.get(u.input);s==null&&(s=o,n.set(u.input,o),o++),i[a]={end:u.end,inputId:s,start:u.start}}else i[a]=u}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=pc){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)}};zo.exports=Ut;Ut.default=Ut});var jt=ee((Hh,jo)=>{"use strict";var gc=Vt(),zt=class extends gc{constructor(t){super(t),this.type="comment"}};jo.exports=zt;zt.default=zt});var $t=ee((Gh,qo)=>{"use strict";var xc=Vt(),qt=class extends xc{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"}};qo.exports=qt;qt.default=qt});var Je=ee((Wh,ts)=>{"use strict";var $o=jt(),Ko=$t(),bc=Vt(),{isClean:Jo,my:Xo}=En(),Di,Yo,Qo,Ii;function Zo(e){return e.map(t=>(t.nodes&&(t.nodes=Zo(t.nodes)),delete t.source,t))}function es(e){if(e[Jo]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)es(t)}var ke=class e extends bc{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 u of o)this.proxyOf.nodes.splice(i,0,u);let a;for(let u in this.indexes)a=this.indexes[u],i<=a&&(this.indexes[u]=a+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=Zo(Yo(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 Ko(t)]}else if(t.selector||t.selectors)t=[new Ii(t)];else if(t.name)t=[new Di(t)];else if(t.text)t=[new $o(t)];else throw new Error("Unknown node type in node creation");return t.map(r=>(r[Xo]||e.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[Jo]&&es(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=>{Yo=e};ke.registerRule=e=>{Ii=e};ke.registerAtRule=e=>{Di=e};ke.registerRoot=e=>{Qo=e};ts.exports=ke;ke.default=ke;ke.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Di.prototype):e.type==="rule"?Object.setPrototypeOf(e,Ii.prototype):e.type==="decl"?Object.setPrototypeOf(e,Ko.prototype):e.type==="comment"?Object.setPrototypeOf(e,$o.prototype):e.type==="root"&&Object.setPrototypeOf(e,Qo.prototype),e[Xo]=!0,e.nodes&&e.nodes.forEach(t=>{ke.rebuild(t)})}});var An=ee((Uh,is)=>{"use strict";var ns=Je(),ft=class extends ns{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)}};is.exports=ft;ft.default=ft;ns.registerAtRule(ft)});var wn=ee((Vh,ss)=>{"use strict";var yc=Je(),rs,os,at=class extends yc{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new rs(new os,this,t).stringify()}};at.registerLazyResult=e=>{rs=e};at.registerProcessor=e=>{os=e};ss.exports=at;at.default=at});var ls=ee((zh,as)=>{var Sc="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Ec=(e,t=21)=>(n=t)=>{let i="",r=n|0;for(;r--;)i+=e[Math.random()*e.length|0];return i},Ac=(e=21)=>{let t="",n=e|0;for(;n--;)t+=Sc[Math.random()*64|0];return t};as.exports={nanoid:Ac,customAlphabet:Ec}});var Cn=ee(()=>{});var Fn=ee(()=>{});var Pi=ee(()=>{});var us=ee(()=>{});var Bi=ee((Zh,fs)=>{"use strict";var{existsSync:wc,readFileSync:Cc}=us(),{dirname:Oi,join:Fc}=Cn(),{SourceMapConsumer:cs,SourceMapGenerator:ds}=Fn();function _c(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var Kt=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=Oi(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new cs(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 u=t.match(n)||t.match(i);if(u)return _c(t.substr(u[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=Oi(t),wc(t)))return this.mapFile=t,Cc(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 cs)return ds.fromSourceMap(n).toString();if(n instanceof ds)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=Fc(Oi(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)}};fs.exports=Kt;Kt.default=Kt});var Jt=ee((e0,xs)=>{"use strict";var{nanoid:Tc}=ls(),{isAbsolute:Wi,resolve:Ui}=Cn(),{SourceMapConsumer:vc,SourceMapGenerator:Mc}=Fn(),{fileURLToPath:ms,pathToFileURL:_n}=Pi(),ps=Sn(),Nc=Bi(),Hi=Mi(),Gi=Symbol("lineToIndexCache"),Lc=!!(vc&&Mc),hs=!!(Ui&&Wi);function gs(e){if(e[Gi])return e[Gi];let t=e.css.split(`\n`),n=new Array(t.length),i=0;for(let r=0,o=t.length;r<o;r++)n[r]=i,i+=t[r].length+1;return e[Gi]=n,n}var mt=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&&(!hs||/^\\w+:\\/\\//.test(n.from)||Wi(n.from)?this.file=n.from:this.file=Ui(n.from)),hs&&Lc){let i=new Nc(this.css,n);if(i.text){this.map=i;let r=i.consumer().file;!this.file&&r&&(this.file=this.mapResolve(r))}}this.file||(this.id="<input css "+Tc(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,i,r={}){let o,a,u,s,l;if(n&&typeof n=="object"){let m=n,f=i;if(typeof m.offset=="number"){s=m.offset;let x=this.fromOffset(s);n=x.line,i=x.col}else n=m.line,i=m.column,s=this.fromLineAndColumn(n,i);if(typeof f.offset=="number"){u=f.offset;let x=this.fromOffset(u);a=x.line,o=x.col}else a=f.line,o=f.column,u=this.fromLineAndColumn(f.line,f.column)}else if(i)s=this.fromLineAndColumn(n,i);else{s=n;let m=this.fromOffset(s);n=m.line,i=m.col}let d=this.origin(n,i,a,o);return d?l=new ps(t,d.endLine===void 0?d.line:{column:d.column,line:d.line},d.endLine===void 0?d.column:{column:d.endColumn,line:d.endLine},d.source,d.file,r.plugin):l=new ps(t,a===void 0?n:{column:i,line:n},a===void 0?i:{column:o,line:a},this.css,this.file,r.plugin),l.input={column:i,endColumn:o,endLine:a,endOffset:u,line:n,offset:s,source:this.css},this.file&&(_n&&(l.input.url=_n(this.file).toString()),l.input.file=this.file),l}fromLineAndColumn(t,n){return gs(this)[t-1]+n-1}fromOffset(t){let n=gs(this),i=n[n.length-1],r=0;if(t>=i)r=n.length-1;else{let o=n.length-2,a;for(;r<o;)if(a=r+(o-r>>1),t<n[a])o=a-1;else if(t>=n[a+1])r=a+1;else{r=a;break}}return{col:t-n[r]+1,line:r+1}}mapResolve(t){return/^\\w+:\\/\\//.test(t)?t:Ui(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,i,r){if(!this.map)return!1;let o=this.map.consumer(),a=o.originalPositionFor({column:n,line:t});if(!a.source)return!1;let u;typeof i=="number"&&(u=o.originalPositionFor({column:r,line:i}));let s;Wi(a.source)?s=_n(a.source):s=new URL(a.source,this.map.consumer().sourceRoot||_n(this.map.mapFile));let l={column:a.column,endColumn:u&&u.column,endLine:u&&u.line,line:a.line,url:s.toString()};if(s.protocol==="file:")if(ms)l.file=ms(s);else throw new Error("file: protocol is not available in this PostCSS build");let d=o.sourceContentFor(a.source);return d&&(l.source=d),l}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}};xs.exports=mt;mt.default=mt;Hi&&Hi.registerInput&&Hi.registerInput(mt)});var pt=ee((t0,Es)=>{"use strict";var bs=Je(),ys,Ss,Xe=class extends bs{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,i){let r=super.normalize(t);if(n){if(i==="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 r)o.raws.before=n.raws.before}return r}removeChild(t,n){let i=this.index(t);return!n&&i===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),super.removeChild(t)}toResult(t={}){return new ys(new Ss,this,t).stringify()}};Xe.registerLazyResult=e=>{ys=e};Xe.registerProcessor=e=>{Ss=e};Es.exports=Xe;Xe.default=Xe;bs.registerRoot(Xe)});var Vi=ee((n0,As)=>{"use strict";var Xt={comma(e){return Xt.split(e,[","],!0)},space(e){let t=[" ",`\n`," "];return Xt.split(e,t)},split(e,t,n){let i=[],r="",o=!1,a=0,u=!1,s="",l=!1;for(let d of e)l?l=!1:d==="\\\\"?l=!0:u?d===s&&(u=!1):d===\'"\'||d==="\'"?(u=!0,s=d):d==="("?a+=1:d===")"?a>0&&(a-=1):a===0&&t.includes(d)&&(o=!0),o?(r!==""&&i.push(r.trim()),r="",o=!1):r+=d;return(n||r!=="")&&i.push(r.trim()),i}};As.exports=Xt;Xt.default=Xt});var Tn=ee((i0,Cs)=>{"use strict";var ws=Je(),Rc=Vi(),ht=class extends ws{get selectors(){return Rc.comma(this.selector)}set selectors(t){let n=this.selector?this.selector.match(/,\\s*/):null,i=n?n[0]:","+this.raw("between","beforeOpen");this.selector=t.join(i)}constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}};Cs.exports=ht;ht.default=ht;ws.registerRule(ht)});var _s=ee((r0,Fs)=>{"use strict";var kc=An(),Dc=jt(),Ic=$t(),Pc=Jt(),Oc=Bi(),Bc=pt(),Hc=Tn();function Yt(e,t){if(Array.isArray(e))return e.map(r=>Yt(r));let{inputs:n,...i}=e;if(n){t=[];for(let r of n){let o={...r,__proto__:Pc.prototype};o.map&&(o.map={...o.map,__proto__:Oc.prototype}),t.push(o)}}if(i.nodes&&(i.nodes=e.nodes.map(r=>Yt(r,t))),i.source){let{inputId:r,...o}=i.source;i.source=o,r!=null&&(i.source.input=t[r])}if(i.type==="root")return new Bc(i);if(i.type==="decl")return new Ic(i);if(i.type==="rule")return new Hc(i);if(i.type==="comment")return new Dc(i);if(i.type==="atrule")return new kc(i);throw new Error("Unknown node type: "+e.type)}Fs.exports=Yt;Yt.default=Yt});var ji=ee((o0,Rs)=>{"use strict";var{dirname:vn,relative:vs,resolve:Ms,sep:Ns}=Cn(),{SourceMapConsumer:Ls,SourceMapGenerator:Mn}=Fn(),{pathToFileURL:Ts}=Pi(),Gc=Jt(),Wc=!!(Ls&&Mn),Uc=!!(vn&&Ms&&vs&&Ns),zi=class{constructor(t,n,i,r){this.stringify=t,this.mapOpts=i.map||{},this.root=n,this.opts=i,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let n=`\n`;this.css.includes(`\\r\n`)&&(n=`\\r\n`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),i=t.root||vn(t.file),r;this.mapOpts.sourcesContent===!1?(r=new Ls(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,n,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let t;for(let n=this.root.nodes.length-1;n>=0;n--)t=this.root.nodes[n],t.type==="comment"&&t.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(n)}else if(this.css){let t;for(;(t=this.css.lastIndexOf("/*#"))!==-1;){let n=this.css.indexOf("*/",t+3);if(n===-1)break;for(;t>0&&this.css[t-1]===`\n`;)t--;this.css=this.css.slice(0,t)+this.css.slice(n+2)}}}}generate(){if(this.clearAnnotation(),Uc&&Wc&&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=Mn.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Mn({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 Mn({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,i="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,a;this.stringify(this.root,(u,s,l)=>{if(this.css+=u,s&&l!=="end"&&(r.generated.line=t,r.generated.column=n-1,s.source&&s.source.start?(r.source=this.sourcePath(s),r.original.line=s.source.start.line,r.original.column=s.source.start.column-1,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,this.map.addMapping(r))),a=u.match(/\\n/g),a?(t+=a.length,o=u.lastIndexOf(`\n`),n=u.length-o):n+=u.length,s&&l!=="start"){let d=s.parent||{raws:{}};(!(s.type==="decl"||s.type==="atrule"&&!s.nodes)||s!==d.last||d.raws.semicolon)&&(s.source&&s.source.end?(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?vn(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(i=vn(Ms(i,this.mapOpts.annotation)));let r=vs(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 Gc(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(Ts){let i=Ts(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;Ns==="\\\\"&&(t=t.replace(/\\\\/g,"/"));let i=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,i),i}};Rs.exports=zi});var Is=ee((s0,Ds)=>{"use strict";var Nn=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,Ln=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,Vc=/.[\\r\\n"\'(/\\\\]/,ks=/[\\da-f]/i;Ds.exports=function(t,n={}){let i=t.css.valueOf(),r=n.ignoreErrors,o,a,u,s,l,d,m,f,x,S,y=i.length,b=0,A=[],_=[],N=-1;function $(){return b}function P(F){throw t.error("Unclosed "+F,b)}function T(){return _.length===0&&b>=y}function w(F){if(_.length)return _.pop();if(b>=y)return;let v=F?F.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);d=["space",i.slice(b,s)],b=s-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let R=String.fromCharCode(o);d=[R,R,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(m=!1,s=i.indexOf(")",s+1),s===-1)if(r||v){s=b;break}else P("bracket");for(f=s;i.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);d=["brackets",i.slice(b,s+1),b,s],b=s}else b<=N?d=["(","(",b]:(s=i.indexOf(")",b+1),a=i.slice(b,s+1),s===-1||Vc.test(a)?(N=s===-1?y:s,d=["(","(",b]):(d=["brackets",a,b,s],b=s));break}case 39:case 34:{l=o===39?"\'":\'"\',s=b;do{if(m=!1,s=i.indexOf(l,s+1),s===-1)if(r||v){s=b+1;break}else P("string");for(f=s;i.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);d=["string",i.slice(b,s+1),b,s],b=s;break}case 64:{Nn.lastIndex=b+1,Nn.test(i),Nn.lastIndex===0?s=i.length-1:s=Nn.lastIndex-2,d=["at-word",i.slice(b,s+1),b,s],b=s;break}case 92:{for(s=b,u=!0;i.charCodeAt(s+1)===92;)s+=1,u=!u;if(o=i.charCodeAt(s+1),u&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(s+=1,ks.test(i.charAt(s)))){for(;ks.test(i.charAt(s+1));)s+=1;i.charCodeAt(s+1)===32&&(s+=1)}d=["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||v?s=i.length:P("comment")),d=["comment",i.slice(b,s+1),b,s],b=s):(Ln.lastIndex=b+1,Ln.test(i),Ln.lastIndex===0?s=i.length-1:s=Ln.lastIndex-2,d=["word",i.slice(b,s+1),b,s],A.push(d),b=s);break}}return b++,d}function C(F){_.push(F)}return{back:C,endOfFile:T,nextToken:w,position:$}}});var Hs=ee((a0,Bs)=>{"use strict";var zc=An(),jc=jt(),qc=$t(),$c=pt(),Ps=Tn(),Kc=Is(),Os={empty:!0,space:!0};function Jc(e){for(let t=e.length-1;t>=0;t--){let n=e[t],i=n[3]||n[2];if(i)return i}}var qi=class{constructor(t){this.input=t,this.root=new $c,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 zc;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let i,r,o,a=!1,u=!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==="{"){u=!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=""),u&&(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,u]of t.entries()){if(r=u,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 jc;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=Kc(this.input)}decl(t,n){let i=new qc;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]||Jc(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=[],u;for(;t.length&&(u=t[0][0],!(u!=="space"&&u!=="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 d=this.stringFrom(t,l);d=this.spacesFromEnd(t)+d,d!==" !important"&&(i.raws.important=d);break}else if(o[1].toLowerCase()==="important"){let d=t.slice(0),m="";for(let f=l;f>0;f--){let x=d[f][0];if(m.trim().startsWith("!")&&x!=="space")break;m=d.pop()[1]+m}m.trim().startsWith("!")&&(i.important=!0,i.raws.important=m,t=d)}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 Ps;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=[],u=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(u&&r&&i==="{")o||(o=l),a.push("}");else if(a.length===0)if(i===";")if(r){this.decl(s,u);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(!u)for(;s.length&&(l=s[s.length-1][0],!(l!=="space"&&l!=="comment"));)this.tokenizer.back(s.pop());this.decl(s,u)}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,u=i.length,s="",l=!0,d,m;for(let f=0;f<u;f+=1)o=i[f],a=o[0],a==="space"&&f===u-1&&!r?l=!1:a==="comment"?(m=i[f-1]?i[f-1][0]:"empty",d=i[f+1]?i[f+1][0]:"empty",!Os[m]&&!Os[d]?s.slice(-1)===","?l=!1:s+=o[1]:l=!1):s+=o[1];if(!l){let f=i.reduce((x,S)=>x+S[1],"");t.raws[n]={raw:f,value:s}}t[n]=s}rule(t){t.pop();let n=new Ps;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})}};Bs.exports=qi});var kn=ee((l0,Gs)=>{"use strict";var Xc=Je(),Yc=Jt(),Qc=Hs();function Rn(e,t){let n=new Yc(e,t),i=new Qc(n);try{i.parse()}catch(r){throw r}return i.root}Gs.exports=Rn;Rn.default=Rn;Xc.registerParse(Rn)});var $i=ee((u0,Ws)=>{"use strict";var Qt=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}};Ws.exports=Qt;Qt.default=Qt});var Dn=ee((c0,Us)=>{"use strict";var Zc=$i(),Zt=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 Zc(t,n);return this.messages.push(i),i}warnings(){return this.messages.filter(t=>t.type==="warning")}};Us.exports=Zt;Zt.default=Zt});var Ki=ee((d0,zs)=>{"use strict";var Vs={};zs.exports=function(t){Vs[t]||(Vs[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))}});var Yi=ee((m0,Ks)=>{"use strict";var ed=Je(),td=wn(),nd=ji(),id=kn(),js=Dn(),rd=pt(),od=Gt(),{isClean:Be,my:sd}=En(),f0=Ki(),ad={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ld={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},ud={Once:!0,postcssPlugin:!0,prepare:!0},gt=0;function en(e){return typeof e=="object"&&typeof e.then=="function"}function $s(e){let t=!1,n=ad[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,gt,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,gt,n+"Exit"]:[n,n+"Exit"]}function qs(e){let t;return e.type==="document"?t=["Document",gt,"DocumentExit"]:e.type==="root"?t=["Root",gt,"RootExit"]:t=$s(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Ji(e){return e[Be]=!1,e.nodes&&e.nodes.forEach(t=>Ji(t)),e}var Xi={},Ye=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=Ji(n);else if(n instanceof e||n instanceof js)r=Ji(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=id;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[sd]&&ed.rebuild(r)}this.result=new js(t,r,i),this.helpers={...Xi,postcss:Xi,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(!ld[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ud[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(en(i))try{await i}catch(r){throw this.handleError(r)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Be];){t[Be]=!0;let n=[qs(t)];for(;n.length>0;){let i=this.visitTick(n);if(en(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 en(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=od;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,u=>{a+=u}),this.result.css=a,this.result}let o=new nd(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(en(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Be];)t[Be]=!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(en(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,u]=r[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===r.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=a;try{return u(i.toProxy(),this.helpers)}catch(s){throw this.handleError(s,i)}}if(n.iterator!==0){let a=n.iterator,u;for(;u=i.nodes[i.indexes[a]];)if(i.indexes[a]+=1,!u[Be]){u[Be]=!0,t.push(qs(u));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===gt){i.nodes&&i.nodes.length&&(i[Be]=!0,n.iterator=i.getIterator());return}else if(this.listeners[a]){n.visitors=this.listeners[a];return}}t.pop()}walkSync(t){t[Be]=!0;let n=$s(t);for(let i of n)if(i===gt)t.nodes&&t.each(r=>{r[Be]||this.walkSync(r)});else{let r=this.listeners[i];if(r&&this.visitSync(r,t.toProxy()))return}}warnings(){return this.sync().warnings()}};Ye.registerPostcss=e=>{Xi=e};Ks.exports=Ye;Ye.default=Ye;rd.registerLazyResult(Ye);td.registerLazyResult(Ye)});var Xs=ee((h0,Js)=>{"use strict";var cd=ji(),dd=kn(),fd=Dn(),md=Gt(),p0=Ki(),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=dd;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=md;this.result=new fd(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 cd(r,void 0,this._opts,n);if(a.isMap()){let[u,s]=a.generate();u&&(this.result.css=u),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[]}};Js.exports=tn;tn.default=tn});var Qs=ee((g0,Ys)=>{"use strict";var pd=wn(),hd=Yi(),gd=Xs(),xd=pt(),lt=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 gd(this,t,n):new hd(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};Ys.exports=lt;lt.default=lt;xd.registerProcessor(lt);pd.registerProcessor(lt)});var sa=ee((x0,oa)=>{"use strict";var Zs=An(),ea=jt(),bd=Je(),yd=Sn(),ta=$t(),na=wn(),Sd=_s(),Ed=Jt(),Ad=Yi(),wd=Vi(),Cd=Vt(),Fd=kn(),Qi=Qs(),_d=Dn(),ia=pt(),ra=Tn(),Td=Gt(),vd=$i();function ae(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Qi(e)}ae.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:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let u=n(...a);return u.postcssPlugin=t,u.postcssVersion=new Qi().version,u}let o;return Object.defineProperty(r,"postcss",{get(){return o||(o=r()),o}}),r.process=function(a,u,s){return ae([r(s)]).process(a,u)},r};ae.stringify=Td;ae.parse=Fd;ae.fromJSON=Sd;ae.list=wd;ae.comment=e=>new ea(e);ae.atRule=e=>new Zs(e);ae.decl=e=>new ta(e);ae.rule=e=>new ra(e);ae.root=e=>new ia(e);ae.document=e=>new na(e);ae.CssSyntaxError=yd;ae.Declaration=ta;ae.Container=bd;ae.Processor=Qi;ae.Document=na;ae.Comment=ea;ae.Warning=vd;ae.AtRule=Zs;ae.Result=_d;ae.Input=Ed;ae.Rule=ra;ae.Root=ia;ae.Node=Cd;Ad.registerPostcss(ae);oa.exports=ae;ae.default=ae});function fn(){return globalThis}function M(e,t){if(typeof window>"u")return;let n=fn(),i=n.__hf?.onSwallowed;if(i)try{i({label:e,error:t})}catch(r){}(n.__hfDebug||n.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var Ql=["seconds-time","rational-fps","seek-keep-playing"];function Zl(e,t){let n=Math.abs(e),i=Math.abs(t);for(;i!==0;){let r=n%i;n=i,i=r}return n||1}function eu(e){let t=Number.isFinite(e)&&e>0?e:30,n=Number.isInteger(t)?1:1e6,i=Math.round(t*n),r=Zl(i,n);return{numerator:i/r,denominator:n/r}}function si(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 Wr(e){return{protocolVersion:1,capabilities:Ql,fps:eu(e)}}function tu(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function Ur(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 i=si(n.fps);return i===null||!tu(n.capabilities)?{status:"unsupported",code:"invalid_protocol_metadata",receivedVersion:n.protocolVersion}:{status:"supported",fps:i,metadata:n}}var Vr=30;function zr(e){Vr=Number.isFinite(e)&&e>0?e:30}function xe(e){try{window.parent.postMessage({...e,...Wr(Vr)},"*")}catch(t){M("bridge.postMessage",t)}}var nu={play:(e,t)=>t.onPlay(),pause:(e,t)=>t.onPause(),"stop-media":(e,t)=>t.onStopMedia(),seek:(e,t)=>t.onSeek(iu(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=>ou(e)};function iu(e,t){let n=Number(e.timeSeconds);if(Number.isFinite(n))return Math.max(0,n);let r=si(e.fps)??t.getCanonicalFps();return Math.max(0,Number(e.frame??0))/r}function ru(e){let t=Ur(e);return t.status!=="unsupported"?!1:(xe({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 ou(e){let t=e.selectors,n=e.duration||800;t&&su(t,n)}function jr(e){let t=n=>{let i=n.data;if(!i||i.source!=="hf-parent"||i.type!=="control"||ru(i))return;let r=i.action;if(typeof r!="string")return;let o=nu[r];o&&o(i,e)};return window.addEventListener("message",t),xe({source:"hf-preview",type:"ready"}),t}function su(e,t){if(!document.getElementById("__hf-flash-styles")){let n=document.createElement("style");n.id="__hf-flash-styles",n.textContent=`\n .__hf-flash {\n outline: 2px solid rgba(59, 130, 246, 0.6) !important;\n outline-offset: 2px !important;\n animation: __hf-flash-pulse ${t}ms ease-out forwards !important;\n }\n @keyframes __hf-flash-pulse {\n 0% { outline-color: rgba(59, 130, 246, 0.8); }\n 100% { outline-color: transparent; }\n }\n `,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(r=>{r.classList.add("__hf-flash"),setTimeout(()=>r.classList.remove("__hf-flash"),t)})}catch(i){M("bridge.flashElements.querySelector",i)}}var ai=null;function qr(e){ai=e}function ot(e,t){if(ai)try{ai({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){M("runtime.analytics.site1",n)}}function au(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 Tt(e){return`--${au(e)}`}function $r(e){let t=new Map;for(let n of e){let i=Tt(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 Kr(){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,vt(i));let n=mn();return{...t,...n}}function vt(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 li="data-hf-css-vars";function ui(e){return"style"in e&&typeof e.style?.setProperty=="function"}function ci(e,t){if(!ui(e))return;let n=[];for(let[i,r]of Object.entries(t))if(typeof r=="string"&&r!==""||typeof r=="number"){let o=Tt(i);e.style.setProperty(o,String(r)),n.push(o)}n.length>0&&e.setAttribute(li,n.join(" "))}function Jr(e){if(!ui(e))return;let t=e.getAttribute(li);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(li)}}function Xr(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=mn(),i=[];for(let r of t)i.push(...lu(r,n,e.defaultView));for(let r of $r(i))console.warn(`composition variables ${r.join(", ")} collapse to the same CSS property ${Tt(r[0]??"")} \\u2014 rename one to avoid cross-talk`)}function lu(e,t,n){if(!ui(e))return[];let i=vt(e),r={};for(let[o,a]of Object.entries(i)){if(o in t)continue;let u=Tt(o);(e.style.getPropertyValue(u)||(n?n.getComputedStyle(e).getPropertyValue(u):"")).trim()===""&&(r[o]=a)}for(let[o,a]of Object.entries(t))o in i&&(r[o]=a);return ci(e,r),Object.keys(i)}function Yr(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 mn(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}function Qr(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,d)=>{let m=null;try{m=l.effect?.getComputedTiming?.()??null}catch(x){M("runtime.adapters.css.site5",x)}if(!m)return{};let f=Number(m.endTime);return Number.isFinite(f)?{endSeconds:d+f/1e3}:{unbounded:!0}},o=(l,d)=>{for(let m of l){try{m.currentTime=d}catch(f){M("runtime.adapters.css.site1",f)}try{m.pause()}catch(f){M("runtime.adapters.css.site2",f)}}},a=l=>{for(let d of l)try{d.play()}catch(m){M("runtime.adapters.css.site3",m)}},u=l=>{for(let d of l)try{d.pause()}catch(m){M("runtime.adapters.css.site4",m)}},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 d of l){if(!(d instanceof HTMLElement))continue;let m=window.getComputedStyle(d);!m.animationName||m.animationName==="none"||t.push({el:d,baseDelay:d.style.animationDelay||"",basePlayState:d.style.animationPlayState||"",animations:n(d)})}},getInferredDurationSeconds:()=>{let l=0;for(let d of t){if(!d.el.isConnected)continue;let m=i(d.el);for(let f of n(d.el)){let x=r(f,m);x.endSeconds!=null&&(l=Math.max(l,x.endSeconds))}}return l>0?l:null},seek:l=>{let d=Number(l.time)||0;for(let m of t){if(!m.el.isConnected)continue;let f=i(m.el),x=Math.max(0,d-f)*1e3,S=m.animations;if(S.length>0){o(S,x);continue}m.el.style.animationPlayState="paused",m.el.style.animationDelay=`-${(x/1e3).toFixed(3)}s`}},pause:()=>{for(let l of t){if(!l.el.isConnected)continue;let d=l.animations;d.length>0&&u(d),s(l)}},play:()=>{for(let l of t)l.el.isConnected&&(s(l),a(l.animations))},revert:()=>{t=[]}}}function Zr(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 eo(){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){M("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){M("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){M("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){M("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function no(){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){M("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(di(i))i.goToAndStop(t*1e3,!1);else if(fi(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){M("runtime.adapters.lottie.site2",r)}},pause:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let t of e)try{(di(t)||fi(t))&&t.pause()}catch(n){M("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=uu(i)}catch(o){M("runtime.adapters.lottie.site4",o)}r!=null&&(n=!0,t=Math.max(t,r))}return n?t:null}}}function to(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function uu(e){return di(e)?to(e.totalFrames,e.frameRate):fi(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:to(e.totalFrames,e.frameRate):null}function di(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function fi(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}var mi=-1;function pn(e){if(e!==mi){mi=e;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:e}}))}catch(t){M("runtime.adapters.seek-dispatch.site1",t)}}}function io(e){mi=e;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:e}}))}catch(t){M("runtime.adapters.seek-dispatch.force",t)}}function ro(){let e=null,t=0,n=null,i=null,r=null,o=null,a=()=>{if(typeof window>"u")return null;let d=window.THREE?.DefaultLoadingManager;return!d||typeof d!="object"||typeof d.itemsLoaded!="number"||typeof d.itemsTotal!="number"?null:d},u=l=>{o||l.itemsTotal<=l.itemsLoaded||(o=new Promise(d=>{l.onLoad=function(){try{r?.call(this)}finally{o=null,l.onLoad=r??null,d()}}}))},s=l=>{n!==l&&(n=l,i=l.onStart??null,r=l.onLoad??null,l.onStart=function(d,m,f){try{i?.call(this,d,m,f)}finally{u(l)}})};return{name:"three",discover:()=>{let l=a();l&&(s(l),u(l))},seek:l=>{e=Math.max(0,Number(l.time)||0),t=e,window.__hfThreeTime=e,pn(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||u(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 oo(){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 so(){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 ao(){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 lo(){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 uo(){return Oe({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}function co(){let e=null,t=0;return{name:"typegpu",discover:()=>{},seek:n=>{e=Math.max(0,Number(n.time)||0),t=e,window.__hfTypegpuTime=e,pn(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0}}}function fo(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 mo(){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=fo(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(...u){let s=u.length-1,l=u[s];if(l instanceof HTMLVideoElement){let d=fo(l);d&&(u[s]=d)}return o.apply(this,u)};a.__hfVideoPatched=!0,i[r]=a}}}function ho(){let e=!1,t=0,n=!1,i,r,o,a=new Set,u=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},d=(b,A)=>A<=0?b:b>=A?Math.max(0,b-A):b,m=(b,A)=>{let _=u.get(b);if(_)return _;let N={compositionTimeMs:A,animationTimeMs:e?d(l(b),A):l(b)};return u.set(b,N),N},f=(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(N){M("runtime.adapters.waapi.site4",N)}}m(b,A)},x=(b,A)=>{for(let _ of b)f(_,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(...N){let $=A.apply(this,N);return f($,t),$};b.animate=_,i=b,r=A,o=_,n=!0}catch{}},y=b=>{let A=null;try{A=b.effect?.getComputedTiming?.()??null}catch($){M("runtime.adapters.waapi.site4",$)}if(!A)return{};let _=Number(A.endTime);return Number.isFinite(_)?{endSeconds:(u.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 N=e?m(_,A):m(_,0),$=N.animationTimeMs+Math.max(0,A-N.compositionTimeMs);try{_.currentTime=$}catch(P){M("runtime.adapters.waapi.site1",P)}try{_.pause()}catch(P){M("runtime.adapters.waapi.site2",P)}}},pause:()=>{e||x(s(),t);for(let b of a)try{b.pause()}catch(A){M("runtime.adapters.waapi.site3",A)}},revert:()=>{if(a.clear(),u=new WeakMap,e=!1,t=0,i&&r&&o&&i.animate===o)try{i.animate=r,i.__hfOriginalAnimate===r&&delete i.__hfOriginalAnimate}catch(b){M("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 go(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 cu(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??""),u=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 d=1/Math.min(60,Math.max(1,i)),m=Math.max(0,r),f=Math.min(n,u),x=[];for(let y=m;y<=f+1e-6;y+=d){let b=Math.min(f,y);t(b);let A=Number(e.volume);if(!Number.isFinite(A))continue;let _=Math.max(0,Math.min(1,A)),N=x.at(-1);if((!N||Math.abs(N.volume-_)>1e-4||b===f)&&x.push({time:Number(b.toFixed(6)),volume:Number(_.toFixed(6))}),b===f)break}return x.some(y=>Math.abs(y.volume-l)>1e-4)?x:null}function xo(e,t,n,i){if(!t||!(e instanceof HTMLAudioElement)&&!(e instanceof HTMLVideoElement)||n<=0)return;let r=u=>{try{typeof t.totalTime=="function"?t.totalTime(u,!0):typeof t.seek=="function"&&t.seek(u,!0)}catch{}},o=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,a=cu(e,r,n,60);Number.isFinite(o)&&r(o),a&&i.set(e,a)}function Lt(e){let t=e.defaultPlaybackRate;return Number.isFinite(t)&&t>0?Math.max(.1,Math.min(5,t)):1}function bo(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 u=e?.resolveStartSeconds?e.resolveStartSeconds(a):Number.parseFloat(a.dataset.start??"0");if(!Number.isFinite(u))continue;let s=Number.parseFloat(a.dataset.playbackStart??a.dataset.mediaStart??"0")||0,l=Lt(a),d=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)/l));let x=Number.isFinite(f)&&f>0?u+f:Number.POSITIVE_INFINITY,S=Number.parseFloat(a.dataset.volume??""),y={el:a,start:u,mediaStart:s,duration:Number.isFinite(f)&&f>0?f:Number.POSITIVE_INFINITY,end:x,volume:Number.isFinite(S)?S:null,playbackRate:l,loop:d,sourceDuration:m};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 pi=new WeakMap,Mt=new WeakMap,hi=new WeakSet,ct=new WeakSet;function du(e){if(ct.has(e))return;ct.add(e);let t=()=>ct.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}var fu=3;function mu(e){return e.error!=null||e.networkState===fu}var gi=new WeakMap;function Nt(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function yo(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;if(e.timeSeconds>=n.start&&e.timeSeconds<=n.end&&r>=0&&(!i.ended||n.loop)){if(n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let v=n.sourceDuration-n.mediaStart;v>0&&r>=n.sourceDuration&&(r=n.mediaStart+(r-n.mediaStart)%v)}let a=Nt(e.userVolume??1),u=Nt(n.volume??1),s=gi.get(i),l=Nt(i.volume),d;n.volumeKeyframes&&n.volumeKeyframes.length>0?d=Nt(go(n.volumeKeyframes,r)):s===void 0||Math.abs(l-s)>1e-4?d=l:d=u;let m=Nt(d*a);i.volume=m,gi.set(i,m),e.onElementVolume?.(i,m),(t||e.isWebAudioOwned?.(i))&&(i.muted=!0),i.preload!=="auto"&&(i.preload="auto");try{i.playbackRate=n.playbackRate*e.playbackRate}catch(v){M("runtime.media.site1",v)}let f=.04,x=2,S=i.currentTime||0,y=Math.abs(S-r),b=r-S,A=pi.get(i);pi.set(i,b);let _=A===void 0,N=!_&&Math.abs(b-A)>.5,$=y>3,P=y>.5&&(_||N||$),T=i.tagName==="VIDEO"&&!i.paused,w=A!==void 0&&Math.abs(b-A)<.004,C=!1;if(!T&&!P&&!_&&w&&y>f){let v=(Mt.get(i)??0)+1;Mt.set(i,v),v>=x&&(C=!0,Mt.set(i,0))}else y<=f&&Mt.set(i,0);let F=!T&&e.forceSync&&y>.02;if(P||C||F){if(!(i.tagName==="VIDEO"&&i.id&&!!document.getElementById(`__render_frame_${i.id}__`))){try{i.currentTime=r}catch(R){M("runtime.media.site2",R)}if(Math.abs(i.currentTime-r)>.5&&!hi.has(i)){hi.add(i),i.load();try{i.currentTime=r}catch(R){M("runtime.media.site3",R)}}}ct.delete(i)}e.playing&&i.paused&&!ct.has(i)&&!mu(i)?(du(i),i.play().catch(v=>{ct.delete(i),(v&&typeof v=="object"&&"name"in v?String(v.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!e.playing&&!i.paused&&i.pause();continue}pi.delete(i),Mt.delete(i),hi.delete(i),gi.delete(i),i.paused||i.pause()}}var Ue="data-color-grading",Rt="data-hf-color-grading-source-hidden",bn="data-hf-authored-opacity",So="__hf_color_grading_",pu="rec709",hn={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},gn={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},xn={blur:0,pixelate:0},Eo=Object.keys(hn),hu=Object.keys(gn),Ao=Object.keys(xn);function be(e,t,n={},i={}){return{id:e,label:t,adjust:{...hn,...n},details:{...gn,...i},effects:{...xn}}}var gu=[be("neutral","Neutral"),be("natural-lift","Natural Lift",{exposure:.04,contrast:.06,highlights:-.06,shadows:.08,saturation:.05}),be("fresh-pop","Fresh Pop",{exposure:.08,contrast:.12,whites:.06,shadows:.04,temperature:-.02,vibrance:.08,saturation:.16}),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",{exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},{vignette:.18}),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("warm-clean","Warm Clean",{exposure:.05,contrast:.08,highlights:-.08,shadows:.08,temperature:.16,vibrance:.04,saturation:.06}),be("cool-clean","Cool Clean",{contrast:.06,highlights:-.06,shadows:.06,temperature:-.12,tint:.04,saturation:.04}),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})],xu=new Map(gu.map(e=>[e.id,e])),bu=/^\\$(?:\\{([A-Za-z0-9_.:-]+)\\}|([A-Za-z0-9_.:-]+))$/,yu={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}},Su={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}},Eu={blur:{min:0,max:1},pixelate:{min:0,max:1}};function st(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Au(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function wo(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function xi(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Au(n,t.min,t.max):0}function wu(e){if(e==null)return null;let t=String(e).trim();return t||null}function Cu(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!st(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:wo(e.intensity,1)}}function Fu(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return st(n)?n:null}catch{return null}return{preset:t,intensity:1}}return st(e)?e:null}function _u(e,t){let n=e.trim().match(bu);if(!n)return e;let i=n[1]??n[2]??"";return i&&Object.hasOwn(t,i)?t[i]:e}function bi(e,t){if(typeof e=="string"){let i=_u(e,t);if(i!==e)return i;let r=e.trim();if(!r.startsWith("{"))return e;try{return bi(JSON.parse(r),t)}catch{return e}}if(!st(e))return e;let n={};for(let[i,r]of Object.entries(e))n[i]=bi(r,t);return n}function Tu(e){return e?xu.get(e)??null:null}function yi(e){let t=Fu(e);if(!t||t.enabled===!1)return null;let n=wu(t.preset),i=Tu(n),r=i?.adjust??hn,o=i?.details??gn,a=i?.effects??xn,u=st(t.adjust)?t.adjust:{},s=st(t.details)?t.details:{},l=st(t.effects)?t.effects:{},d=Eo.reduce((x,S)=>(x[S]=xi(u[S]??r[S],yu[S]),x),{...hn}),m=hu.reduce((x,S)=>(x[S]=xi(s[S]??o[S],Su[S]),x),{...gn}),f=Ao.reduce((x,S)=>(x[S]=xi(l[S]??a[S],Eu[S]),x),{...xn});return{enabled:!0,preset:n,intensity:wo(t.intensity,1),adjust:d,details:m,effects:f,lut:Cu(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():pu}}function Co(e,t){return yi(bi(e,t))}function kt(e){return!e?.enabled||e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:Eo.some(t=>Math.abs(e.adjust[t])>1e-4)||Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||Ao.some(t=>Math.abs(e.effects[t])>1e-4)}var vu=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),Mu=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function Fo(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(F){M("runtime.picker.site1",F)}}function u(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 F=w;for(;F&&F!==document.body&&F!==document.documentElement;){let v=C.getComputedStyle(F);if(v.display==="none"||v.visibility==="hidden"||v.pointerEvents==="none")return!0;let R=Number.parseFloat(v.opacity);if(Number.isFinite(R)&&R<=.01&&!F.hasAttribute(Rt))return!0;F=F.parentElement}return!1}function d(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(vu)||l(w))}function m(w){return!!w?.closest(Mu)}function f(w){let C=w;if(C.id)return`#${C.id}`;let F=w.getAttribute("data-composition-id");if(F)return`[data-composition-id="${CSS.escape(F)}"]`;let v=w.getAttribute("data-composition-src");if(v)return`[data-composition-src="${CSS.escape(v)}"]`;let R=w.getAttribute("data-track-index");if(R)return`[data-track-index="${CSS.escape(R)}"]`;let V=w.tagName.toLowerCase(),W=w.parentElement;if(!W)return V;let ie=W.querySelectorAll(`:scope > ${V}`);if(ie.length===1)return V;for(let D=0;D<ie.length;D+=1)if(ie[D]===w)return`${V}:nth-of-type(${D+1})`;return V}function x(w){let C=w.tagName.toLowerCase(),F=(w.textContent??"").trim().replace(/\\s+/g," "),v=(R,V)=>R.length>V?`${R.slice(0,V-1)}\\u2026`:R;return C==="h1"||C==="h2"||C==="h3"?"Heading":C==="p"||C==="span"||C==="div"?F.length>0?v(F,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,F){let v=typeof F=="number"&&F>0?F:8,R=[];if(document.elementsFromPoint)R=document.elementsFromPoint(w,C);else if(document.elementFromPoint){let ie=document.elementFromPoint(w,C);R=ie?[ie]:[]}if(m(R[0]??null))return[];let V={},W=[];for(let[ie,D]of R.entries()){if(!d(D))continue;let re=`${D.tagName}::${D.id||""}::${ie}`;if(!V[re]&&(V[re]=!0,W.push(D),W.length>=v))break}return W}function y(w){let C=w.getBoundingClientRect(),F={};for(let R of Array.from(w.attributes))R.name.startsWith("data-")&&(F[R.name]=R.value);return{id:w.id||null,tagName:w.tagName.toLowerCase(),selector:f(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:F}}function b(w,C,F){return S(w,C,F).map(y)}function A(w){if(!t)return;let F=S(w.clientX,w.clientY,1)[0]??(w.target instanceof Element?w.target:null);if(!d(F)||n===F)return;n&&n.classList.remove("__hf-pick-highlight"),n=F,F.classList.add("__hf-pick-highlight");let v=y(F);u(v),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:v})}function _(w){if(!t)return;w.preventDefault(),w.stopPropagation(),w.stopImmediatePropagation();let C=b(w.clientX,w.clientY,8);C.length!==0&&(u(C[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:C,selectedIndex:0,point:{x:w.clientX,y:w.clientY}}))}function N(w){w.key==="Escape"&&(P(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function $(){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(`\n`),document.head.appendChild(i),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",A,!0),document.addEventListener("click",_,!0),document.addEventListener("keydown",N,!0),a("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function P(){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",N,!0),a("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function T(){window.__HF_PICKER_API={enable:$,disable:P,isActive:()=>t,getHovered:()=>r,getSelected:()=>o,getCandidatesAtPoint:(w,C,F)=>Number.isFinite(w)&&Number.isFinite(C)?b(w,C,F):[],pickAtPoint:(w,C,F)=>{if(!Number.isFinite(w)||!Number.isFinite(C))return null;let v=b(w,C,8);if(!v.length)return null;let R=Math.max(0,Math.min(v.length-1,Number(F??0))),V=v[R]??null;return V?(s(V),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:V}),P(),V):null},pickManyAtPoint:(w,C,F)=>{if(!Number.isFinite(w)||!Number.isFinite(C))return[];let v=b(w,C,8);if(!v.length)return[];let R=[],V=Array.isArray(F)?F:[0];for(let W of V){let ie=Math.max(0,Math.min(v.length-1,Math.floor(Number(W)))),D=v[ie];if(!D)continue;R.some(Fe=>Fe.selector===D.selector&&Fe.tagName===D.tagName)||R.push(D)}return R.length?(s(R[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:R}),P(),R):[]}},a("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:$,disablePickMode:P,installPickerApi:T}}var Nu=["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 dt(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 _o(e,t,n=Nu){for(let i of n){let r=t.getPropertyValue(i);r&&e.setProperty(i,r)}}function Dt(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&&M("runtime.player.nonConformantNum",{prop:t,actual:typeof i}),n)}function Re(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&M("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function It(e,t,n){if(e){for(let i of Object.values(e))if(!(!i||i===t))try{n(i)}catch(r){M("runtime.player.site1",r)}}}function To(e,t,n,i){let r=dt(t,n),o=i?.suppressEvents===!0;return Re(e,"pause"),typeof e.totalTime=="function"?e.totalTime(r,o):typeof e.seek=="function"&&e.seek(r,o),r}function Lu(e,t,n,i,r){let o=[];It(e,t,a=>{Re(a,"play"),o.push(a)});try{return To(t,n,i,r)}finally{for(let a of o)try{Re(a,"pause")}catch(u){M("runtime.player.site2",u)}}}function Ru(e,t){It(e,t,n=>{Re(n,"play")})}function vo(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?.()??Dt(n,"duration",0))||0);i>0&&Math.max(0,Dt(n,"time",0))>=i&&(Re(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()),Re(n,"play"),It(e.getTimelineRegistry?.(),n,r=>{typeof r.timeScale=="function"&&r.timeScale(e.getPlaybackRate()),Re(r,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;Re(n,"pause"),It(e.getTimelineRegistry?.(),n,r=>{Re(r,"pause")});let i=Math.max(0,Dt(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(),u=Lu(e.getTimelineRegistry?.(),r,o,e.getCanonicalFps());e.onDeterministicSeek(u),i?.keepPlaying&&a?(typeof r.timeScale=="function"&&r.timeScale(e.getPlaybackRate()),Re(r,"play"),It(e.getTimelineRegistry?.(),r,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),Re(s,"play")}),e.onDeterministicPlay(),e.onShowNativeVideos(),e.onSyncMedia(u,!0)):(e.setIsPlaying(!1),e.onSyncMedia(u,!1)),e.onRenderFrameSeek(u),e.onStatePost(!0)},renderSeek:(n,i)=>{let r=e.getTimeline(),o=e.getCanonicalFps(),a=r?(Ru(e.getTimelineRegistry?.(),r),To(r,n,o,i)):dt(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:()=>Dt(e.getTimeline(),"time",0),getDuration:()=>Dt(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function Mo(){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 ku=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function Ei(e){return e.id||e.getAttribute("data-hf-id")||null}function Si(e){if(e==null)return null;let t=Number(e);return Number.isFinite(t)?t:null}function Du(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 Iu(e){if(!(e instanceof HTMLMediaElement)||!Number.isFinite(e.duration))return null;let t=Si(e.getAttribute("data-playback-start"))??Si(e.getAttribute("data-media-start"))??0;return e.duration>t?e.duration-t:null}function Pu(e,t,n,i){let r=Si(e.getAttribute("data-duration"));return r!=null&&r>0?r:Du(e,t)??Iu(e)??Math.max(0,n-i)}function Ou(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 No(e){let{startResolver:t,timelineRegistry:n,rootDuration:i}=e,r=new Map,o=document.querySelector("[data-composition-id]"),a=0;for(let u of document.querySelectorAll("[data-start]")){if(u===o||ku.has(u.tagName))continue;let s=t.resolveStartForElement(u,0);if(Pu(u,n,i,s)<=0)continue;let l={id:Ei(u)??`__clip-${a++}`,element:u,parentId:null,children:[]};r.set(u,l)}return Ou(r),{roots:Array.from(r.values()).filter(u=>u.parentId===null)}}var Ai="css:root",Lo=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],Bu=new Set([...Lo,"contain","isolation","mask-border","mix-blend-mode","opacity"]),Hu=new Set(["absolute","relative"]),Gu=new Set(["flex","inline-flex","grid","inline-grid"]),Wu=new Set(["layout","paint","strict","content"]),Uu=new Set(["size","inline-size"]);function Vu(e){return e.position==="fixed"||e.position==="sticky"}function zu(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(Hu.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&Gu.has(n)}function ju(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:Lo.some(i=>{let r=e.getPropertyValue(i);return r!==""&&r!=="none"})}function qu(e){return e.getPropertyValue("contain").split(/\\s+/).some(n=>Wu.has(n))?!0:Uu.has(e.getPropertyValue("container-type"))}function $u(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>Bu.has(t))}function Ku(e,t){return Vu(t)||zu(e,t)||ju(t)||qu(t)?!0:$u(t)}function Ju(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 yn(e){let t=e.ownerDocument.defaultView;if(!t)return Ai;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(Ku(n,t.getComputedStyle(n)))return Ju(n)}catch{return Ai}n=n.parentElement}return Ai}function qe(e){if(e==null||e==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}function Ro(e){let t=(e??"").trim();if(!t)return null;let n=qe(t);if(n!=null)return{kind:"absolute",value:n};let i=t.match(/^([A-Za-z0-9_.:-]+)(?:\\s*([+-])\\s*([0-9]*\\.?[0-9]+))?$/);if(!i)return null;let r=(i[1]??"").trim();if(!r)return null;let o=i[2]??"+",a=i[3]??"0",u=Number.parseFloat(a),s=Number.isFinite(u)?Math.max(0,u):0,l=o==="-"?-s:s;return{kind:"reference",refId:r,offset:l}}var Xu="data-hf-authored-duration",Yu="data-hf-authored-end";function Qu(e){return qe(e.getAttribute("data-duration"))}function Zu(e){return qe(e.getAttribute("data-end"))}function ec(e){return qe(e.getAttribute(Xu))}function tc(e){return qe(e.getAttribute(Yu))}function $e(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,i=new WeakMap,r=new WeakMap,o=new Set,a=d=>{let m=document.getElementById(d);return m||(document.querySelector(`[data-composition-id="${CSS.escape(d)}"]`)??null)},u=d=>{let m=r.get(d);if(m!==void 0)return m;let f=null,x=Qu(d)??(n?ec(d):null);if(x!=null&&x>0&&(f=x),f==null||f<=0){let S=Zu(d)??(n?tc(d):null);if(S!=null){let y=l(d,0),b=S-y;Number.isFinite(b)&&b>0&&(f=b)}}if((f==null||f<=0)&&d instanceof HTMLMediaElement){let S=qe(d.getAttribute("data-playback-start"))??qe(d.getAttribute("data-media-start"))??0;Number.isFinite(d.duration)&&d.duration>S&&(f=(d.duration-S)/Lt(d))}if(f==null||f<=0){let S=d.getAttribute("data-composition-id");if(S){let y=t[S]??null;if(y&&typeof y.duration=="function")try{let b=Number(y.duration());Number.isFinite(b)&&b>0&&(f=b)}catch(b){M("runtime.startResolver.site1",b)}}}return f!=null&&Number.isFinite(f)&&f>0?(r.set(d,f),f):(r.set(d,null),null)},s=(d,m)=>{if(d.hasAttribute("data-composition-id")){let x=d.parentElement?.closest("[data-composition-id]");return x?l(x,m):0}let f=d.closest("[data-composition-id]");return f?l(f,m):0},l=(d,m)=>{let f=i.get(d);if(f!==void 0)return f??m;if(o.has(d))return m;o.add(d);try{let x=Ro(d.getAttribute("data-start"));if(!x){if(d.hasAttribute("data-composition-id")){let _=d.parentElement;if(_&&(_.hasAttribute("data-composition-src")||_.hasAttribute("data-composition-id")||_.hasAttribute("data-composition-file"))){let N=l(_,m);return i.set(d,N),N}}return i.set(d,m),m}if(x.kind==="absolute"){let _=Math.max(0,x.value),N=Math.max(0,s(d,m)+_);return i.set(d,N),N}let S=a(x.refId);if(!S)return i.set(d,m),m;let y=l(S,0),b=u(S);if(b==null||b<=0){let _=Math.max(0,y+x.offset);return i.set(d,_),_}let A=Math.max(0,y+b+x.offset);return i.set(d,A),A}finally{o.delete(d)}};return{resolveStartForElement:(d,m=0)=>l(d,Math.max(0,m)),resolveDurationForElement:d=>u(d)}}function wi(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}var nc="data-hf-authored-duration",ic="data-hf-authored-end";function Ee(e){if(e==null||e==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}function Ci(e){return Ee(e.getAttribute("data-duration"))??Ee(e.getAttribute(nc))}function ko(e){return Ee(e.getAttribute("data-end"))??Ee(e.getAttribute(ic))}function Fi(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 _i(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function Ti(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 Ot(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 Do(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return Ot(t);let n=e.getAttribute("data-composition-src");if(n)return Ot(n);let i=e.querySelector("img[src], video[src], audio[src], source[src]");return i?Ot(i.getAttribute("src")):null}function rc(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 oc(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 sc(e){let t=e.textContent?.replace(/\\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function Pt(e){let t=e.replace(/\\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\\s+/g," ").trim();return t?t.replace(/\\b\\w/g,n=>n.toUpperCase()):e}function ac(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 Pt(r);let o=e.id;if(o)return Pt(o);let a=rc(e);if(a)return Pt(a);let u=oc(Do(e));if(u)return Pt(u);let s=sc(e);return s||`${Pt(t)} ${n+1}`}function Io(e){let n=window.__timelines??{},i=$e({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),r=B=>{if(!B)return null;let k=n[B]??null;if(!k||typeof k.duration!="function")return null;try{let H=Number(k.duration());return Number.isFinite(H)&&H>0?H:null}catch{return null}},o=B=>{let k=Ee(B.getAttribute("data-duration"));if(k!=null&&k>0)return k;let H=Ee(B.getAttribute("data-playback-start"))??Ee(B.getAttribute("data-media-start"))??0;return Number.isFinite(B.duration)&&B.duration>H?Math.max(0,(B.duration-H)/Lt(B)):null},a=()=>{let B=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(B.length===0)return null;let k=0;for(let H of B){let le=H.hasAttribute("data-hf-auto-start")?i.resolveStartForElement(H,0):Math.max(0,Number(H.getAttribute("data-start")??0)||0);if(!Number.isFinite(le))continue;let se=o(H);se==null||se<=0||(k=Math.max(k,Math.max(0,le)+se))}return k>0?k:null},u=(B,k)=>{let H=[],le=null,se=null,G=null,j=B.parentElement;for(;j;){let K=j.getAttribute("data-composition-id");K&&(H.push(K),!G&&j!==k&&(G=K),le==null&&(le=i.resolveStartForElement(j,0)),se==null&&(se=Ee(j.getAttribute("data-duration"))??r(K)??null)),j=j.parentElement}return{parentCompositionId:G,compositionAncestors:H.reverse(),inheritedStart:le,inheritedDuration:se}},s=document.querySelector("[data-composition-id]"),l=Array.from(document.querySelectorAll("[data-composition-id]")),d=s?.getAttribute("data-composition-id")??null,m=s?i.resolveStartForElement(s,0):0,f=a(),x=f!=null?Math.max(0,f-Math.max(0,m)):null,S=r(d),y=Ci(s??document.body),b=_i(...l.filter(B=>B!==s).map(B=>{let k=i.resolveStartForElement(B,0),H=i.resolveDurationForElement(B)??r(B.getAttribute("data-composition-id"))??null;return!Number.isFinite(k)||H==null||H<=0?null:Math.max(0,k)+H})),A=b!=null?Math.max(0,b-Math.max(0,m)):null,_=typeof S=="number"&&Number.isFinite(S)&&S>0?S:null,N=typeof y=="number"&&Number.isFinite(y)&&y>0?y:null,$=typeof x=="number"&&Number.isFinite(x)&&x>0?x:null,P=typeof A=="number"&&Number.isFinite(A)&&A>0?A:null,T=_i($,P),w=_!=null&&T!=null&&_>T+1,F=N??(w?T:_i(_,$,P))??null,R=(F!=null?m+F:null)??(typeof f=="number"&&Number.isFinite(f)&&f>0?f:null),V=(B,k)=>!Number.isFinite(k)||k<=0?0:R==null||!Number.isFinite(R)?k:!Number.isFinite(B)||B>=R?0:Math.max(0,Math.min(k,R-B)),W=[],ie=[],D=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),re=0;for(let[B,k]of D.entries()){if(k===s||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(k.tagName))continue;let H=u(k,s),le=i.resolveStartForElement(k,H.inheritedStart??0),se=k.getAttribute("data-composition-id"),G=Ci(k);if((G==null||G<=0)&&se&&se!==d&&(G=r(se)),(G==null||G<=0)&&k instanceof HTMLMediaElement){let we=Ee(k.getAttribute("data-playback-start"))??Ee(k.getAttribute("data-media-start"))??0;Number.isFinite(k.duration)&&k.duration>0&&(G=Math.max(0,k.duration-we))}if(G==null||G<=0){let we=H.inheritedDuration;if(we!=null&&we>0){let Ge=(H.inheritedStart??0)+we;G=Math.max(0,Ge-le)}}if(G==null||G<=0||(G=V(le,G),G<=0))continue;let j=le+G;re=Math.max(re,j);let K=k.tagName.toLowerCase(),Ae=se&&se!==d?"composition":K==="video"?"video":K==="audio"?"audio":K==="img"?"image":"element";W.push({id:Ei(k)??se??null,label:ac(k,Ae,W.length),start:le,duration:G,track:Ti(k,B),zIndex:Fi(k),stackingContextId:yn(k),kind:Ae,tagName:K,compositionId:k.getAttribute("data-composition-id"),compositionAncestors:H.compositionAncestors,parentCompositionId:H.parentCompositionId,nodePath:null,compositionSrc:Ot(k.getAttribute("data-composition-src")),assetUrl:Do(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 Fe=new Set(W.map(B=>B.id)),z=s?.getAttribute("data-composition-id")??null,X=z?n[z]??null:null;if(X&&s){let B=X;if(typeof B.getChildren=="function")try{let k=B.getChildren(!0,!0,!1)??[],H=new Map;for(let G of s.children){let j=G;if(!j.id)continue;let K=j.tagName.toLowerCase();K==="script"||K==="style"||K==="link"||H.set(j,{id:j.id,start:1/0,end:-1/0})}let le=G=>{let j=G;for(;j;){if(H.has(j))return j;if(j===s)return null;j=j.parentElement}return null};for(let G of k){if(typeof G.targets!="function"||typeof G.startTime!="function"||typeof G.duration!="function")continue;let j=G.startTime(),K=G.parent;for(;K&&K!==X&&typeof K.startTime=="function";)j+=K.startTime(),K=K.parent;let Ae=j+G.duration();if(!(!Number.isFinite(j)||!Number.isFinite(Ae)))for(let we of G.targets()){if(!(we instanceof Element))continue;let St=le(we);if(!St)continue;let Ge=H.get(St);Ge&&(Ge.start=Math.min(Ge.start,j),Ge.end=Math.max(Ge.end,Ae))}}let se=W.length>0?Math.max(...W.map(G=>G.track))+1:0;for(let[G,j]of H){if(j.start===1/0||j.end===-1/0)continue;let K=G;if(Fe.has(K.id))continue;let Ae=Math.max(0,j.end-j.start);if(Ae<=0)continue;let we=V(j.start,Ae);we<=0||(re=Math.max(re,j.start+we),W.push({id:K.id,label:K.getAttribute("data-timeline-label")??K.getAttribute("data-label")??K.getAttribute("aria-label")??K.id,start:j.start,duration:we,track:Ti(K,se),zIndex:Fi(K),stackingContextId:yn(K),kind:"element",tagName:K.tagName.toLowerCase(),compositionId:K.getAttribute("data-composition-id"),compositionAncestors:z?[z]:[],parentCompositionId:z,nodePath:null,compositionSrc:null,assetUrl:null,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"))}),Fe.add(K.id))}}catch(k){M("runtime.timeline.site1",k)}}if(s&&F!=null&&F>0){let B=W.length>0?Math.max(...W.map(k=>k.track))+1:0;for(let k of s.children){let H=k;if(!H.id||Fe.has(H.id))continue;let le=H.getAttribute("data-timeline-role");if(le!=="overlay"&&le!=="persistent-overlay")continue;let se=H.tagName.toLowerCase();if(se==="script"||se==="style"||se==="link"||se==="meta"||window.getComputedStyle(H).display==="none")continue;let j=V(0,F);j<=0||(re=Math.max(re,j),W.push({id:H.id,label:H.getAttribute("data-timeline-label")??H.getAttribute("data-label")??H.getAttribute("aria-label")??H.id,start:0,duration:j,track:Ti(H,B),zIndex:Fi(H),stackingContextId:yn(H),kind:"element",tagName:se,compositionId:H.getAttribute("data-composition-id"),compositionAncestors:z?[z]:[],parentCompositionId:z,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:le,timelineLabel:H.getAttribute("data-timeline-label"),timelineGroup:H.getAttribute("data-timeline-group"),timelinePriority:Ee(H.getAttribute("data-timeline-priority"))}),Fe.add(H.id))}}for(let B of l){if(B===s)continue;let k=B.getAttribute("data-composition-id");if(!k||!wi(k))continue;let H=i.resolveStartForElement(B,0),le=Ci(B);if((le==null||le<=0)&&ko(B)!=null){let K=ko(B);le=Math.max(0,K-H)}let se=r(k),G=le&&le>0?le:se;if(G==null||G<=0)continue;let j=V(H,G);j<=0||ie.push({id:k,label:B.getAttribute("data-label")??k,start:H,duration:j,thumbnailUrl:Ot(B.getAttribute("data-thumbnail-url")),avatarName:null})}let O=Math.max(1,re||1,F??0);return{source:"hf-preview",type:"timeline",durationInFrames:w&&N==null?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(O*Math.max(1,e.canonicalFps))),clips:W,scenes:ie,compositionWidth:Ee(s?.getAttribute("data-width"))??1920,compositionHeight:Ee(s?.getAttribute("data-height"))??1080}}var ue=Yl(sa(),1),aa=ue.default,b0=ue.default.stringify,y0=ue.default.fromJSON,S0=ue.default.plugin,E0=ue.default.parse,A0=ue.default.list,w0=ue.default.document,C0=ue.default.comment,F0=ue.default.atRule,_0=ue.default.rule,T0=ue.default.decl,v0=ue.default.root,M0=ue.default.CssSyntaxError,N0=ue.default.Declaration,L0=ue.default.Container,R0=ue.default.Processor,k0=ue.default.Document,D0=ue.default.Comment,I0=ue.default.Warning,P0=ue.default.AtRule,O0=ue.default.Result,B0=ue.default.Input,H0=ue.default.Rule,G0=ue.default.Root,W0=ue.default.Node;var Zi="data-hf-authored-id",la="data-hf-inner-root";function er(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function tr(e){return e.replace(/\\\\/g,"\\\\\\\\").replace(/"/g,\'\\\\"\')}function Md(e){return e&&e.replace(/[^a-zA-Z0-9_-]/g,n=>`\\\\${n}`).replace(/^-?\\d/,n=>`\\\\${n}`)}function ca(e){let t=e.trim();return t?Array.from(new Set([t,Md(t)])).filter(Boolean):[]}function Nd(e){return!!e&&/[\\w-]/.test(e)}function Ld(e,t,n){let i=ca(t).sort((u,s)=>s.length-u.length);if(i.length===0)return e;let r="",o=0,a=null;for(let u=0;u<e.length;u+=1){let s=e[u],l=u>0?e[u-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 d=i.find(m=>e.startsWith(m,u+1));if(d){let m=e[u+1+d.length];if(!Nd(m)){r+=n,u+=d.length;continue}}}r+=s}return r}function Rd(e,t){let n=t?.trim();return n?Ld(e,n,`[${Zi}="${tr(n)}"]`):e}function ua(e){return`${e}:not(:has([${la}])), ${e} > [${la}]`}function kd(e,t,n,i,r,o){let a=Rd(e,i),u=Dd(a,t,n),s=u.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return o?ua(t):e;let l=new RegExp(`\\\\[\\\\s*data-composition-id\\\\s*=\\\\s*(["\'])${er(n)}\\\\1\\\\s*\\\\]`,"g");if(l.test(s))return s.replace(l,"").trim()===""?ua(t):u.replace(l,t);let d=u.match(/^\\s*/)?.[0]??"",m=u.match(/\\s*$/)?.[0]??"";if(r){let f=i?`[${Zi}="${tr(i)}"]`:null;if(f&&s.startsWith(f)){let x=s.slice(f.length);return`${d}${t}${f}${x}${m}`}}return`${d}${t} ${s}${m}`}function Dd(e,t,n){let i=er(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 Id=new Set(["keyframes","-webkit-keyframes","font-face"]);function Pd(e){return e?.type==="atrule"}function Od(e){let t=e.parent;for(;t;){if(Pd(t)&&Id.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function da(e,t,n,i,r){let o=t.trim();if(!e||!o)return e;let a=n||`[data-composition-id="${tr(o)}"]`,u=aa.parse(e);return u.walkRules(s=>{Od(s)||(s.selectors=s.selectors.map(l=>kd(l,a,o,i,r?.compoundAuthoredRoot,r?.scopeRootSelectors)))}),u.toResult({map:!1}).css}function fa(e,t,n="[HyperFrames] composition script error:",i,r=t,o){let a=JSON.stringify(t),u=JSON.stringify(r),s=JSON.stringify(n),l=er(t),d=JSON.stringify(o?.trim()||null),m=JSON.stringify(i??null),f=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(ca(o?.trim()||""));return`(function(){\n var __hfCompId = ${a};\n var __hfTimelineCompId = ${u};\n var __hfErrorLabel = ${s};\n var __hfAuthoredRootId = ${d};\n var __hfAuthoredRootAttr = ${JSON.stringify(Zi)};\n var __hfEscapeAttr = function(value) {\n return (value + "").replace(/\\\\\\\\/g, "\\\\\\\\\\\\\\\\").replace(/"/g, "\\\\\\\\\\\\"");\n };\n var __hfRootSelector = ${m} || (__hfCompId\n ? \'[data-composition-id="\' + __hfEscapeAttr(__hfCompId) + \'"]\'\n : "");\n var __hfRoot = null;\n var __hfRootSelectorPattern = ${f};\n var __hfTimingSelectorPattern = ${x};\n var __hfAuthoredRootIdForms = ${S};\n var __hfAuthoredRootSelector = __hfAuthoredRootId\n ? "[" + __hfAuthoredRootAttr + \'="\' + __hfEscapeAttr(__hfAuthoredRootId) + \'"]\'\n : "";\n var __hfIsSelectorNameChar = function(char) {\n return !!char && /[\\\\w-]/.test(char);\n };\n var __hfReplaceAuthoredRootIdSelectors = function(selector) {\n if (!__hfAuthoredRootSelector || !__hfAuthoredRootIdForms.length || typeof selector !== "string") {\n return selector;\n }\n var result = "";\n var bracketDepth = 0;\n var quote = null;\n for (var index = 0; index < selector.length; index += 1) {\n var char = selector[index];\n var previousChar = index > 0 ? selector[index - 1] : "";\n if (quote) {\n result += char;\n if (char === quote && previousChar !== "\\\\\\\\") {\n quote = null;\n }\n continue;\n }\n if (char === \'"\' || char === "\'") {\n quote = char;\n result += char;\n continue;\n }\n if (char === "[") {\n bracketDepth += 1;\n result += char;\n continue;\n }\n if (char === "]") {\n bracketDepth = Math.max(0, bracketDepth - 1);\n result += char;\n continue;\n }\n if (char === "#" && bracketDepth === 0) {\n var matchedForm = null;\n for (var formIndex = 0; formIndex < __hfAuthoredRootIdForms.length; formIndex += 1) {\n var form = __hfAuthoredRootIdForms[formIndex];\n if (selector.slice(index + 1, index + 1 + form.length) === form) {\n matchedForm = form;\n break;\n }\n }\n if (matchedForm) {\n var nextChar = selector[index + 1 + matchedForm.length];\n if (!__hfIsSelectorNameChar(nextChar)) {\n result += __hfAuthoredRootSelector;\n index += matchedForm.length;\n continue;\n }\n }\n }\n result += char;\n }\n return result;\n };\n var __hfNormalizeSelector = function(selector) {\n if (!__hfCompId || typeof selector !== "string") return selector;\n var normalized = selector\n .replace(new RegExp(__hfRootSelectorPattern + \'(?:\' + __hfTimingSelectorPattern + \')+\', \'g\'), __hfRootSelector)\n .replace(new RegExp(\'(?:\' + __hfTimingSelectorPattern + \')+\' + __hfRootSelectorPattern, \'g\'), __hfRootSelector);\n if (__hfAuthoredRootSelector) {\n normalized = __hfReplaceAuthoredRootIdSelectors(normalized);\n }\n return normalized;\n };\n var __hfFindRoot = function() {\n if (!__hfRoot && __hfRootSelector) {\n __hfRoot = window.document.querySelector(__hfRootSelector);\n }\n return __hfRoot;\n };\n var __hfContains = function(node) {\n var root = __hfFindRoot();\n return !root || node === root || root.contains(node);\n };\n var __hfQueryAll = function(selector) {\n var root = __hfFindRoot();\n if (!root || typeof selector !== "string") {\n return window.document.querySelectorAll(selector);\n }\n return Array.prototype.filter.call(window.document.querySelectorAll(__hfNormalizeSelector(selector)), function(node) {\n return __hfContains(node);\n });\n };\n var __hfQueryOne = function(selector) {\n var matches = __hfQueryAll(selector);\n return matches[0] || null;\n };\n var __hfGetElementById = function(id) {\n var found = window.document.getElementById(id);\n if (found && __hfContains(found)) return found;\n var root = __hfFindRoot();\n if (!root) return found || null;\n var idValue = id + "";\n if (__hfAuthoredRootId && __hfAuthoredRootId === idValue && root.getAttribute && root.getAttribute(__hfAuthoredRootAttr) === idValue) {\n return root;\n }\n if (root.id === idValue) return root;\n if (typeof root.querySelector !== "function") return null;\n try {\n var authoredRootMatch = root.querySelector(\'[\' + __hfAuthoredRootAttr + \'="\' + __hfEscapeAttr(idValue) + \'"]\');\n if (authoredRootMatch) return authoredRootMatch;\n } catch {}\n if (typeof CSS !== "undefined" && CSS && typeof CSS.escape === "function") {\n try {\n return root.querySelector("#" + CSS.escape(idValue)) || null;\n } catch {}\n }\n try {\n return root.querySelector(\'[id="\' + __hfEscapeAttr(idValue) + \'"]\') || null;\n } catch {}\n return null;\n };\n var __hfScopedDocument = typeof Proxy === "function"\n ? new Proxy(window.document, {\n get: function(target, prop, receiver) {\n if (prop === "querySelector") return __hfQueryOne;\n if (prop === "querySelectorAll") return __hfQueryAll;\n if (prop === "getElementById") return __hfGetElementById;\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n })\n : window.document;\n var __hfTimelineRegistryProxy = null;\n var __hfGetTimelineRegistry = function() {\n window.__timelines = window.__timelines || {};\n if (!__hfCompId || __hfCompId === __hfTimelineCompId || typeof Proxy !== "function") {\n return window.__timelines;\n }\n if (!__hfTimelineRegistryProxy) {\n __hfTimelineRegistryProxy = new Proxy(window.__timelines, {\n get: function(target, prop, receiver) {\n if (prop !== __hfCompId) {\n return Reflect.get(target, prop, target);\n }\n var authoredValue = Reflect.get(target, prop, target);\n return authoredValue === undefined\n ? Reflect.get(target, __hfTimelineCompId, target)\n : authoredValue;\n },\n set: function(target, prop, value, receiver) {\n if (prop !== __hfCompId) {\n return Reflect.set(target, prop, value, target);\n }\n // The authored node remains in the compiled DOM when its local id\n // differs from the runtime mount id, so readiness legitimately sees\n // both compositions. Publish the same timeline under both identities\n // instead of replacing one with the other.\n var authoredSet = Reflect.set(target, __hfCompId, value, target);\n var runtimeSet = Reflect.set(target, __hfTimelineCompId, value, target);\n return authoredSet && runtimeSet;\n },\n });\n }\n return __hfTimelineRegistryProxy;\n };\n var __hfScopedWindow = typeof Proxy === "function"\n ? new Proxy(window, {\n get: function(target, prop, receiver) {\n if (prop === "__timelines") return __hfGetTimelineRegistry();\n // Inside a sub-composition, __hyperframes is passed as a bare script\n // param bound to the SCOPED variant (per-comp getVariables). But\n // authors routinely write the documented window.__hyperframes.\n // getVariables() form, which would otherwise fall through to the host\n // page\'s base __hyperframes and return the WRONG (or empty) variables\n // for this instance. Route it to the scoped variant too so both\n // spellings resolve to this composition\'s own variables.\n // (__hfScopedHyperframes is a hoisted var assigned below, before any\n // sub-comp script -- the only code that reads this -- runs.)\n if (prop === "__hyperframes") return __hfScopedHyperframes;\n return Reflect.get(target, prop, target);\n },\n set: function(target, prop, value, receiver) {\n if (prop === "__timelines") {\n // Common authoring boilerplate assigns the registry back to\n // itself (window.__timelines = window.__timelines || {}). The\n // getter above returns our proxy; do not replace the canonical\n // registry with that proxy or later wrappers will stack proxies.\n if (value === __hfTimelineRegistryProxy) return true;\n target.__timelines = value || {};\n __hfTimelineRegistryProxy = null;\n return true;\n }\n return Reflect.set(target, prop, value, target);\n },\n })\n : window;\n var __hfResolveGsapTarget = function(target) {\n if (typeof target !== "string") return target;\n return __hfQueryAll(target);\n };\n var __hfScopeTimeline = function(timeline) {\n if (!timeline || timeline.__hfScopedCompositionRoot === __hfFindRoot()) return timeline;\n ["to", "from", "fromTo", "set"].forEach(function(method) {\n var original = timeline[method];\n if (typeof original !== "function") return;\n timeline[method] = function(target) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(target);\n return original.apply(timeline, args);\n };\n });\n try {\n Object.defineProperty(timeline, "__hfScopedCompositionRoot", {\n value: __hfFindRoot(),\n configurable: true,\n });\n } catch {\n // Best-effort: timelines coming from user code may have a frozen target\n // or a non-extensible defineProperty path. Swallow \\u2014 the scoped root\n // is an enrichment, not a correctness invariant for playback.\n }\n return timeline;\n };\n var __hfBaseGsap = typeof gsap === "undefined" ? window.gsap : gsap;\n var __hfScopedGsap = !__hfBaseGsap || typeof Proxy !== "function"\n ? __hfBaseGsap\n : new Proxy(__hfBaseGsap, {\n get: function(target, prop, receiver) {\n if (prop === "timeline") {\n return function() {\n return __hfScopeTimeline(target.timeline.apply(target, arguments));\n };\n }\n if (prop === "to" || prop === "from" || prop === "fromTo" || prop === "set") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return target[prop].apply(target, args);\n };\n }\n if (prop === "utils" && target.utils && typeof Proxy === "function") {\n return new Proxy(target.utils, {\n get: function(utilsTarget, utilsProp, utilsReceiver) {\n if (utilsProp === "toArray") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return utilsTarget.toArray.apply(utilsTarget, args);\n };\n }\n if (utilsProp === "selector") {\n return function(base) {\n var baseEl = typeof base === "string" ? __hfQueryOne(base) : base;\n var root = baseEl || __hfFindRoot();\n return function(selector) {\n if (!root || typeof selector !== "string") return [];\n return Array.prototype.filter.call(\n window.document.querySelectorAll(__hfNormalizeSelector(selector)),\n function(node) {\n return node === root || (typeof root.contains === "function" && root.contains(node));\n },\n );\n };\n };\n }\n var value = Reflect.get(utilsTarget, utilsProp, utilsTarget);\n return typeof value === "function" ? value.bind(utilsTarget) : value;\n },\n });\n }\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n });\n var __hfBaseHyperframes = window.__hyperframes;\n var __hfScopedHyperframes = !__hfBaseHyperframes\n ? __hfBaseHyperframes\n : Object.assign({}, __hfBaseHyperframes, {\n getVariables: function() {\n var byComp = window.__hfVariablesByComp;\n var scoped = byComp && __hfTimelineCompId ? byComp[__hfTimelineCompId] : null;\n return scoped ? Object.assign({}, scoped) : {};\n },\n });\n var __hfRun = function() {\n try {\n (function(document, gsap, window, __hyperframes) {\n${e.replace(/<\\/(script)/gi,"<\\\\/$1")}\n }).call(window, __hfScopedDocument, __hfScopedGsap, __hfScopedWindow, __hfScopedHyperframes);\n } catch (_err) {\n console.error(__hfErrorLabel, __hfCompId, _err);\n }\n };\n __hfFindRoot();\n __hfRun();\n})();`}var Bd=["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 ma(e){let t=e.getAttribute("id")?.trim();for(let n of Bd)e.removeAttribute(n);t&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",t)),e.setAttribute("data-hf-inner-root","true")}var Hd=8e3,Gd=/^(?![a-zA-Z][a-zA-Z\\d+\\-.]*:)(?!\\/\\/)(?!\\/)(?!\\.\\.?\\/).+/,Wd=/\\burl\\(\\s*(["\']?)([^)"\']+)\\1\\s*\\)/g,Ud=["src","href"];function Vd(e){return!e||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/")}function ha(e,t){if(!t)return e;let n=e.trim();if(Vd(n)||!n.startsWith("../")&&n!=="..")return e;try{return new URL(n,t).href}catch{return e}}function ga(e,t){return!t||!e?e:e.replace(Wd,(n,i,r)=>{let o=ha(r||"",t);return o===r?n:`url(${i||""}${o}${i||""})`})}function zd(e,t){for(let n of Array.from(e.querySelectorAll("[src], [href]")))for(let i of Ud){let r=n.getAttribute(i);if(r==null)continue;let o=ha(r,t);o!==r&&n.setAttribute(i,o)}}function jd(e,t){for(let n of Array.from(e.querySelectorAll("[style]"))){let i=n.getAttribute("style");if(i==null)continue;let r=ga(i,t);r!==i&&n.setAttribute("style",r)}}function qd(e,t){for(let n of Array.from(e.querySelectorAll("style"))){let i=n.textContent||"",r=ga(i,t);r!==i&&(n.textContent=r)}}function xa(e,t){if(t){zd(e,t),jd(e,t),qd(e,t);for(let n of Array.from(e.querySelectorAll("template")))xa(n.content,t)}}function $d(e,t){return`${e}__hf${t}`}var Kd=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"),Hd)});function ir(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function Jd(e){let t=document.importNode(e,!0);ma(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 pa(e,t){let n=e.trim();if(!n)return e;try{return Gd.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 nr(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 In(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 Xd(e){let t=new Map;for(let n of e){let i=In(n).authoredCompositionId||"";i&&t.set(i,(t.get(i)||0)+1)}return t}function ba(e){let t=In(e).authoredCompositionId;return t?!!document.querySelector(`template#${CSS.escape(t)}-template`):!1}function Yd(e){return!!e.querySelector(\'[data-hf-inner-root="true"]\')}function Qd(e){return e.hasAttribute("data-composition-src")?!0:ba(e)?e.children.length===0||e.hasAttribute("data-hf-original-composition-id")?!0:Yd(e):!1}function or(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(t=>t.hasAttribute("data-composition-src")?!0:ba(t))}function ya(){let e=window.__hfVariablesByComp;if(!e)return;let t=new Set(or().map(n=>In(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(e))t.has(n)||delete e[n]}function Sa(e,t=Xd(e)){let n=new Map,i=new Map;for(let r of e){let{authoredCompositionId:o,runtimeCompositionId:a}=In(r),u=Qd(r);if(!o){i.set(r,{authoredCompositionId:null,runtimeCompositionId:a});continue}let s=(t.get(o)||0)>1,l=a||o;if(u){let d=s?(n.get(o)||0)+1:0;s&&n.set(o,d),l=s?$d(o,d):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 rr(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 f of e.headLinks){let x=(f.getAttribute("href")||"").trim();if(!x)continue;let S=e.compositionUrl?new URL(x,e.compositionUrl).href:x;if(e.compositionUrl&&nr(S,e.compositionUrl)||document.head.querySelector(`link[href="${CSS.escape(S)}"]`))continue;let y=f.cloneNode(!0);y.href=S,document.head.appendChild(y),e.injectedLinks.push(y)}let u=f=>{for(let x of f){let S=x.cloneNode(!0);S instanceof HTMLStyleElement&&(i&&(S.textContent=da(S.textContent||"",i,a,o,{scopeRootSelectors:!0})),document.head.appendChild(S),e.injectedStyles.push(S))}};e.headStyles&&u(e.headStyles),u(Array.from(n.querySelectorAll("style")));let s=[];if(e.headScripts)for(let f of e.headScripts){let x=f.getAttribute("type")?.trim()??"",S=f.getAttribute("src")?.trim()??"";if(S){let y=pa(S,e.compositionUrl);if(e.compositionUrl&&nr(y,e.compositionUrl))continue;s.push({kind:"external",src:y,type:x})}else{let y=f.textContent?.trim()??"";y&&s.push({kind:"inline",content:y,type:x,scopeCompositionId:i})}}let l=Array.from(n.querySelectorAll("script")),d=[...s];for(let f of l){let x=f.getAttribute("type")?.trim()??"",S=f.getAttribute("src")?.trim()??"";if(S){let y=pa(S,e.compositionUrl);if(e.compositionUrl&&nr(y,e.compositionUrl)){f.parentNode?.removeChild(f);continue}d.push({kind:"external",src:y,type:x})}else{let y=f.textContent?.trim()??"";y&&d.push({kind:"inline",content:y,type:x,scopeCompositionId:i})}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"),S=e.parseDimensionPx(f),y=e.parseDimensionPx(x);f&&e.host.setAttribute("data-width",f),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(Jd(t))}else e.hasTemplate?e.host.appendChild(document.importNode(n,!0)):e.host.innerHTML=e.fallbackBodyInnerHtml;r&&Zd(e,n,r);for(let f of d){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=fa(f.content,f.scopeCompositionId,"[HyperFrames] composition script error:",a,r||f.scopeCompositionId,o):x.textContent=`(function(){${f.content}})();`,document.body.appendChild(x),e.injectedScripts.push(x),f.kind==="external"){let S=await Kd(x);S.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.authoredCompositionId,runtimeCompositionId:e.runtimeCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:f.src,loadStatus:S.status,elapsedMs:S.elapsedMs}})}}}async function Ea(e){let t=or();if(ya(),t.length===0)return;let n=Sa(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 u=document.querySelector(`template#${CSS.escape(a)}-template`);ir(r),await rr({host:r,authoredCompositionId:a,runtimeCompositionId:o?.runtimeCompositionId||a,hostCompositionSrc:`template#${a}-template`,sourceNode:u.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic})}}async function Aa(e){let t=or();if(ya(),t.length===0)return;let n=Sa(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),u=a?.authoredCompositionId||null,s=a?.runtimeCompositionId||u||null,l=null;try{l=new URL(o,document.baseURI)}catch{l=null}ir(r);try{let d=u!=null?document.querySelector(`template#${CSS.escape(u)}-template`):null;if(d){await rr({host:r,authoredCompositionId:u,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:d.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:l,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(),S=new DOMParser().parseFromString(f,"text/html");xa(S,l);let y=(u?S.querySelector(`template#${CSS.escape(u)}-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")),N=Array.from(S.head.querySelectorAll(\'link[rel="stylesheet"], link[rel="preconnect"]\'));await rr({host:r,authoredCompositionId:u,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:N,declaredVariableDefaults:vt(S.documentElement),onDiagnostic:e.onDiagnostic})}catch(d){e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:u,runtimeCompositionId:s,hostCompositionSrc:o,errorMessage:d instanceof Error?d.message:"unknown_error"}}),ir(r)}}))}function Zd(e,t,n){let r={...e.declaredVariableDefaults??(t instanceof Element?vt(t):{}),...Yr(e.host)};Jr(e.host),Object.keys(r).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[n]=r,ci(e.host,{...r,...mn()})):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[n]}function ef(e){return e instanceof HTMLElement?e.dataset.captionWrapper!=="true"?e:e.querySelector(":scope > span")??null:null}function tf(){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 nf(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 sr(){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=tf();for(let i of t){let r=null;if(i.wordId&&(r=ef(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(d=>d.vars.color!==void 0).sort((d,m)=>d.startTime()-m.startTime()),l=s[0]?String(s[0].vars.color):"";for(let d of s)String(d.vars.color)===l?i.dimColor&&(d.vars.color=i.dimColor):i.activeColor&&(d.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 u=nf(r);e.set(u,o)}}}).catch(()=>{})}var Ma="data-hf-edit-base-x",Na="data-hf-edit-base-y",ar="data-hf-edit-original-translate",Pn=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},rf=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},wa=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,lr=(e,t)=>wa.test(e)&&wa.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,of=(e,t,n)=>{if(!e||e==="none")return`${t} ${n}`;let[i,r,o]=rf(e);if(i===void 0)return`${t} ${n}`;if(r===void 0)return`${lr(i,t)} ${n}`;let a=o===void 0?"":` ${o}`;return`${lr(i,t)} ${lr(r,n)}${a}`},sf=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},af=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""}},Ca=new WeakMap;function lf(e,t){let n=Ca.get(e);if(!t?.force&&n!==void 0&&e.style.getPropertyValue("translate")!==n){ot("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let i=Pn(e.getAttribute("data-x"))-Pn(e.getAttribute(Ma)),r=Pn(e.getAttribute("data-y"))-Pn(e.getAttribute(Na));e.hasAttribute(ar)||e.setAttribute(ar,af(e)),n===void 0&&sf(e);let o=e.getAttribute(ar)??"",a=of(o,`${i}px`,`${r}px`);e.style.setProperty("translate",a),Ca.set(e,e.style.getPropertyValue("translate"))}function On(e){let t=e.querySelectorAll(`[${Ma}], [${Na}]`),n=e.defaultView?.HTMLElement,i=0;for(let r=0;r<t.length;r++){let o=t[r];(n?o instanceof n:typeof o.style?.setProperty=="function")&&(lf(o),i+=1)}return i}var Fa="__hfPositionEditsSeekReapplyWrapped",_a=new WeakSet,Ta=new WeakMap,va=new WeakMap;function La(e){let t=e,n=()=>{try{On(t.document)}catch{}},i=m=>typeof m=="function"&&(_a.has(m)||!!m[Fa]),r=m=>{_a.add(m);try{Object.defineProperty(m,Fa,{value:!0})}catch{}},o=m=>{if(typeof m!="function"||i(m))return m;let f=function(...x){let S=m.apply(this,x);return n(),S};return r(f),f},a=(m,f)=>{let x=Ta.get(m);if(x?.has(f))return!0;let S=Object.getOwnPropertyDescriptor(m,f);if(S?.configurable===!1){let A=m[f];return typeof A=="function"&&(m[f]=o(A),n()),!1}let y=m[f],b=S?.set;return Object.defineProperty(m,f,{configurable:!0,enumerable:S?.enumerable??!0,get:()=>y,set:A=>{y=o(A),b?.call(m,A)}}),y=o(y),x??(x=new Set),x.add(f),Ta.set(m,x),n(),!0},u=(m,f)=>{let x=va.get(t),S=Object.getOwnPropertyDescriptor(t,m);if(!x?.has(m)){if(S?.configurable===!1){let A=t[m];return A?a(A,f):!1}let b=t[m];Object.defineProperty(t,m,{configurable:!0,enumerable:S?.enumerable??!0,get:()=>b,set:A=>{b=A,b&&a(b,f)}}),x??(x=new Set),x.add(m),va.set(t,x)}let y=t[m];return y?a(y,f):!1},s=()=>{let m=u("__hf","seek"),f=u("__player","renderSeek");return m&&f};if(s())return;let l=120,d=t.setInterval(()=>{if(s()){t.clearInterval(d);return}l-=1,l<=0&&t.clearInterval(d)},50)}function Bn(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 Hn(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var Ra=new Set(["img","video","audio","source"]);function uf(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 cf(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 df(e){return e.replace(/[;{}<>\\r\\n]/g,"")}function ff(e){if(Hn(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 ur(e,t){let n=e.closest("[data-composition-id]"),i=t.get(n);if(i)return i;let r=Bn(e);return t.set(n,r),r}function mf(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 pf(e){return e.querySelector("[data-hf-root]")??e.getElementById("stage")??e.body?.firstElementChild??e.body}function hf(e,t){let n=new Set,i=pf(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=ur(r,t);for(let[a,u]of Object.entries(o)){let s=ff(u);s!==null&&r instanceof HTMLElement&&r.style.setProperty(`--${a}`,df(s))}}}function cr(e){let t=new Map;hf(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(!Ra.has(n.tagName.toLowerCase())){console.warn(`[hyperframes] Ignoring data-var-src on <${n.tagName.toLowerCase()}>: variable-bound src is only allowed on ${Array.from(Ra).join("/")}.`);continue}let r=uf(ur(n,t)[i]);if(r!==null){if(!cf(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=ur(n,t)[i];Hn(r)&&mf(n,String(r))}}var ge=class extends Error{constructor(n,i=null){super(i==null?n:`${n} at line ${i}`);he(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=i}},gf=[0,0,0],xf=[1,1,1],fr=64;function bf(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 Qe(e,t){let n=Number(e);if(!Number.isFinite(n))throw new ge(`Invalid number "${e}"`,t);return n}function ka(e,t,n){if(e.length!==3)throw new ge(`${t} expects three numbers`,n);return[Qe(e[0],n),Qe(e[1],n),Qe(e[2],n)]}function Da(e,t,n){if(!e)throw new ge(`${t} expects a size`,n);let i=Number(e);if(!Number.isInteger(i)||i<2)throw new ge(`${t} must be an integer greater than 1`,n);return i}function yf(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new ge("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function Sf(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 Ef(e){return/^[+-]?(?:\\d|\\.\\d)/.test(e)}function Ia(e,t={}){let n=t.maxSize??fr,i=null,r=gf,o=xf,a=null,u=null,s=[],l=e.replace(/^\\uFEFF/,"").split(/\\r?\\n/);for(let m=0;m<l.length;m++){let f=m+1,x=bf(l[m]??"").trim();if(!x)continue;let S=x.split(/\\s+/),y=(S[0]??"").toUpperCase(),b=S.slice(1);if(y==="TITLE"){i=Sf(x);continue}if(y==="DOMAIN_MIN"){r=ka(b,y,f);continue}if(y==="DOMAIN_MAX"){o=ka(b,y,f);continue}if(y==="LUT_3D_INPUT_RANGE"){if(b.length!==2)throw new ge(`${y} expects two numbers`,f);let A=Qe(b[0],f),_=Qe(b[1],f);if(_<=A)throw new ge("LUT_3D_INPUT_RANGE max must exceed min",f);r=[A,A,A],o=[_,_,_];continue}if(y==="LUT_1D_SIZE"){a=Da(b[0],y,f);continue}if(y==="LUT_3D_SIZE"){if(u=Da(b[0],y,f),u>n)throw new ge(`LUT_3D_SIZE ${u} exceeds max ${n}`,f);continue}if(!Ef(y)){if(y.startsWith("LUT_"))throw new ge(`Unsupported cube keyword ${y}`,f);continue}if(!u)throw a?new ge("1D cube LUTs are not supported yet",f):new ge("LUT data appears before LUT_3D_SIZE",f);if(S.length!==3)throw new ge("LUT data rows must contain three numbers",f);s.push(Qe(S[0],f),Qe(S[1],f),Qe(S[2],f))}if(a&&u)throw new ge("Mixed 1D and 3D cube LUTs are not supported yet");if(!u)throw a?new ge("1D cube LUTs are not supported yet"):new ge("Missing LUT_3D_SIZE");yf(r,o);let d=u*u*u;if(s.length!==d*3)throw new ge(`Expected ${d} LUT rows for size ${u}, found ${s.length/3}`);return{title:i,size:u,domainMin:r,domainMax:o,data:new Float32Array(s)}}function Af(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function dr(e){return Math.round(Af(e)*255)}function Pa(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 u=0;u<t;u++){let s=((o*t+a)*t+u)*3,l=(a*n+o*t+u)*4;r[l]=dr(e.data[s]??0),r[l+1]=dr(e.data[s+1]??0),r[l+2]=dr(e.data[s+2]??0),r[l+3]=255}return{width:n,height:i,data:r}}var ze=new Map,wf="data-hf-color-grading-canvas",Cf="__hf_color_grading_canvas__";function Va(){if(typeof MutationObserver>"u"||typeof document>"u")return;let e=document.documentElement;if(!e)return;let t=i=>{i instanceof HTMLElement&&(i.hasAttribute(bn)||i.setAttribute(bn,i.style.opacity))},n=i=>{if(i instanceof Element){i.hasAttribute(Ue)&&t(i);for(let r of i.querySelectorAll(`[${Ue}]`))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(Ue)&&t(r.target)}}).observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[Ue]})}var Ff=16,nn={enabled:!1,position:.5,softness:0,lineWidth:2};function mr(e){let t=e.getAttribute(Ue);return t==null?null:Co(t,Bn(e))}var _f=["attribute vec2 a_pos;","varying vec2 v_uv;","void main(){"," v_uv = a_pos * 0.5 + 0.5;"," gl_Position = vec4(a_pos, 0.0, 1.0);","}"].join(`\n`),Tf=["#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(`\n`),vf=["#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;","vec4 readSource(vec2 uv){"," vec4 color = texture2D(u_source, clamp(uv, vec2(0.0), vec2(1.0)));"," color.rgb *= color.a;"," return color;","}","void main(){"," vec2 stepUv = u_direction * max(u_radius, 0.0) / max(u_resolution, vec2(1.0)) / 12.0;"," vec4 color = readSource(v_uv) * 0.08077993;"," color += readSource(v_uv + stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv - stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv + stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv - stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv + stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv - stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv + stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv - stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv + stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv - stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv + stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv - stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv + stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv - stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv + stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv - stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv + stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv - stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv + stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv - stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv + stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv - stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv + stepUv * 12.0) * 0.00453456;"," color += readSource(v_uv - stepUv * 12.0) * 0.00453456;"," if (color.a > 0.0001) color.rgb /= color.a;"," gl_FragColor = color;","}"].join(`\n`);function ut(e){return e instanceof HTMLVideoElement||e instanceof HTMLImageElement}function Oa(e,t,n){let i=e.createShader(n);return i?(e.shaderSource(i,t),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS)?i:(M("runtime.colorGrading.compileShader",e.getShaderInfoLog(i)),e.deleteShader(i),null)):null}function za(e,t=Tf){let n=Oa(e,_f,e.VERTEX_SHADER),i=Oa(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:(M("runtime.colorGrading.linkProgram",e.getProgramInfoLog(r)),e.deleteProgram(r),null)):null}function hr(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 Mf(e,t){let n=za(e,vf);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 Ba(e){let t=hr(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 Ha(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 ja(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!0});if(!t)return null;let n=za(t),i=hr(t),r=hr(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 Nf(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Lf(e){if(!Nf(e))return{...nn};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,nn.position,0,1),softness:t(e.softness,nn.softness,0,.25),lineWidth:t(e.lineWidth,nn.lineWidth,0,12)}}function qa(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 xr(e){return e instanceof Error?e.message:"LUT failed to load"}function Rf(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 kf(e){let t=e.id||e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return Rf(t)}function Df(e){let t=qa(e);if("error"in t)return{state:"error",message:t.error};let n=ze.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=>Ia(o,{maxSize:fr})),r={state:"pending",promise:i};for(;ze.size>=Ff;){let o=ze.keys().next().value;if(!o)break;ze.delete(o)}return ze.set(t.href,r),i.then(o=>{ze.get(t.href)===r&&ze.set(t.href,{state:"ready",lut:o})},o=>{ze.get(t.href)===r&&ze.set(t.href,{state:"error",message:xr(o)})}),r}function Ga(e,t,n){if(e.lut?.src===t)return e.lut;let i=Pa(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=xr(a),e.lutLoadingSrc=null,M("runtime.colorGrading.uploadLut",a),null}}function Gn(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function $a(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),Gn(e.gl,t.scratch),Gn(e.gl,t.blur),e.effectTargets=null)}function Ka(e){$a(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 If(e){let t=ja(e.canvas);return t?(Ka(e),e.gl=t.gl,e.program=t.program,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function gr(e){if(!e.sourceHidden)return;e.element.removeAttribute(Rt);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 Pf(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=Mf(t,e.program.quad),i=Ba(t),r=Ba(t);return!n||!i||!r?(n&&t.deleteProgram(n.program),i&&Gn(t,i),r&&Gn(t,r),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:i,blur:r},e.effectTargets)}function Of(e,t,n,i,r){let o=Math.max(1,Math.ceil(i)),a=Math.max(1,Math.ceil(r));return Ha(e,t,o,a),Ha(e,n,o,a),{width:o,height:a}}function Wa(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 Bf(e,t,n,i,r,o,a){let u=n;for(let s=0;s<Math.max(1,Math.floor(a));s++)Wa(e,t.blurProgram,u,t.scratch,r,{x:1,y:0},o),Wa(e,t.blurProgram,t.scratch.texture,i,r,{x:0,y:1},o),u=i.texture}function Hf(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=qa(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=Df(t);return r.state==="ready"?Ga(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||(Ga(e,i.href,o),De(e))},o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=xr(o),e.lutLoadingSrc=null,De(e))})),null)}function pr(e){if(!e)return null;if(typeof e=="string"){let t=e.trim();if(!t)return null;let n=document.getElementById(t.replace(/^#/,""));if(n&&ut(n))return n;try{let i=document.querySelector(t);return i&&ut(i)?i:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&ut(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&ut(t))return t}if(!e.selector)return null;try{let t=Array.from(document.querySelectorAll(e.selector)),n=Math.max(0,Math.floor(Number(e.selectorIndex??0)||0)),i=t[n]??null;return i&&ut(i)?i:null}catch{return null}}function Gf(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 Ja(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 Wf(e){if(!e.id)return null;let t=document.getElementById(`__render_frame_${e.id}__`);return t instanceof HTMLImageElement&&Ja(t)?t:null}function Uf(e){return e instanceof HTMLImageElement&&e.classList.contains("__render_frame__")}function Vf(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}function zf(e){if(e instanceof HTMLVideoElement){let t=Wf(e);if(t)return t}return Ja(e)?e:null}function Ua(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 jf(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=Ua(o,"x"),u=Ua(o,"y");if(a!==null&&(o==="left"||o==="right"||o.endsWith("%")&&r===0)){n=a;continue}if(u!==null&&(o==="top"||o==="bottom"||o.endsWith("%")&&r>0)){i=u;continue}}return{x:n,y:i}}function qf(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",u=e,s=t;if(a==="contain"||a==="cover"||a==="scale-down"){let f=a==="cover"?Math.max(e/n,t/i):Math.min(e/n,t/i);u=n*f,s=i*f,a==="scale-down"&&u>n&&s>i&&(u=n,s=i)}else a==="none"&&(u=n,s=i);let l=jf(o||"center"),d=(e-u)*l.x/e,m=(t-s)*l.y/t;return{scaleX:u/e,scaleY:s/t,offsetX:d,offsetY:m}}function $f(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function Kf(e,t){let{element:n,canvas:i}=e,r=n.parentElement;r&&$f(e,r);let o=window.getComputedStyle(t);_o(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(),u=Math.max(0,Math.round(n.offsetWidth||a.width)),s=Math.max(0,Math.round(n.offsetHeight||a.height));return u<=0||s<=0?(i.style.display="none",null):(i.width!==u&&(i.width=u),i.height!==s&&(i.height=s),{width:u,height:s})}function Jf(e,t,n,i,r,o,a,u,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,u.scaleX,u.scaleY),e.uniform2f(t.uvOffset,u.offsetX,u.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 Xf(e){if(!e.sourceHidden){let t=e.element.getAttribute(bn);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(Rt,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function De(e){if(e.destroyed||e.contextLost)return!1;let t=zf(e.element);if(!t)return e.hasDrawn||(e.canvas.style.display="none"),!1;let n=Gf(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",u=e.element.style.getPropertyValue("visibility"),s=Uf(t);if(s&&Vf(e,t),s||!a){let S=window.getComputedStyle(s?t:e.element);e.sourceOpacityForCanvas=S.opacity||"1",e.sourceVisibleForCanvas=(s||u!=="hidden")&&S.visibility!=="hidden"}let l=Kf(e,i);if(!l)return!1;let d=window.getComputedStyle(i),m=qf(l.width,l.height,n.width,n.height,d.objectFit,d.objectPosition),{gl:f,program:x}=e;try{let S=Hf(e);f.activeTexture(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,x.texture),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,!0),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,t);let y=!1,b=Math.min(1,Math.max(0,e.grading.effects.blur));if(b>0){let _=Pf(e);if(_){let N=Of(f,_.scratch,_.blur,l.width,l.height);Bf(f,_,x.texture,_.blur,N,.75+Math.pow(b,1.35)*32,b>.55?3:2),y=!0}}else e.effectError=null,e.effectTargets&&$a(e);f.bindFramebuffer(f.FRAMEBUFFER,null),f.viewport(0,0,l.width,l.height),f.useProgram(x.program),f.activeTexture(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,x.texture),f.activeTexture(f.TEXTURE1),f.bindTexture(f.TEXTURE_2D,e.effectTargets?.blur.texture??x.texture),f.activeTexture(f.TEXTURE2),f.bindTexture(f.TEXTURE_2D,x.lutTexture);let A=e.grainSeed+(e.element instanceof HTMLVideoElement?Math.floor(e.element.currentTime*60):0);return Jf(f,x,e.grading,S,y,e.compare,l,m,A),f.bindBuffer(f.ARRAY_BUFFER,x.quad),f.enableVertexAttribArray(x.position),f.vertexAttribPointer(x.position,2,f.FLOAT,!1,0,0),f.drawArrays(f.TRIANGLE_STRIP,0,4),Xf(e),e.hasDrawn=!0,e.drawError=null,!0}catch(S){return e.drawError=S instanceof Error?S.message:"Shader draw failed",M("runtime.colorGrading.drawEntry",S),!1}}function He(e,t,n,i){t.addEventListener(n,i),e.cleanup.push(()=>t.removeEventListener(n,i))}function Yf(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 rn(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&&rn(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,De(e),!e.destroyed&&!t.paused&&!t.ended&&rn(e)})}function Qf(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",()=>rn(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",gr(e)}),He(e,e.canvas,"webglcontextrestored",()=>{if(e.contextLost=!1,!If(e)){e.contextLost=!0,e.drawError="WebGL context restore failed",gr(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 Zf(e){if(!e.destroyed){e.destroyed=!0,Yf(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();e.cleanup.length=0,e.canvas.remove(),Ka(e),gr(e),e.touchedParent&&(e.parentInlinePosition===null?e.touchedParent.style.removeProperty("position"):e.touchedParent.style.position=e.parentInlinePosition)}}function em(e){let t=document.createElement("canvas");return e.id&&(t.id=`${So}${e.id}`),t.className=Cf,t.setAttribute(wf,"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 Xa(){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&&rn(_),!0;let N=em(y),$=ja(N);if(!$)return N.remove(),!1;let P={element:y,canvas:N,gl:$.gl,program:$.program,grading:b,compare:{...nn},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:kf(y),destroyed:!1};return e.set(y,P),t.add(y),Qf(P),De(P),y instanceof HTMLVideoElement&&!y.paused&&rn(P),!0},o=(y,b)=>{if(i)return!1;let A=pr(y);if(!A)return!1;let _=e.get(A);if(!_){let N=mr(A);if(!kt(N)||!r(A,N,"attribute"))return!1;_=e.get(A)}return _?(_.compare=Lf(b),De(_),!0):!1},a=y=>{let b=e.get(y);b&&(Zf(b),e.delete(y),t.delete(y))},u=()=>{if(i)return 0;let y=new Set;document.querySelectorAll(`video[${Ue}], img[${Ue}]`).forEach(A=>{if(!ut(A))return;y.add(A);let _=mr(A);kt(_)?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=pr(y);if(!A)return!1;let _=yi(b);return kt(_)?r(A,_,"live"):(a(A),!0)},d=(y,b)=>{if(!ut(y))return!1;let A=e.get(y);return A?(A.sourceVisibleForCanvas=b,!0):!1},m=y=>{let b=pr(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 _=mr(b);return kt(_)?{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},f=()=>{if(!i){i=!0,n?.disconnect(),n=null;for(let y of Array.from(t))a(y)}};document.body&&(n=new MutationObserver(()=>u()),n.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[Ue]}));let x={refresh:u,redraw:s,setGrading:l,setCompare:o,setSourceVisibility:d,getStatus:m,destroy:f},S=window;return S.__hf=S.__hf||{},S.__hf.colorGrading=x,u(),x}var Wn=class{constructor(t){he(this,"_baseTime",0);he(this,"_playStartMs",null);he(this,"_rate",1);he(this,"_duration",1/0);he(this,"_nowMs");he(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 Ya(e){return!Number.isFinite(e)||e<=0?1:e}function tm(e,t){t||e.paused||!fn().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function nm(e,t){let{elapsed:n,mediaStart:i,scheduledAt:r,safeRate:o,clipDuration:a}=t,u=Number.isFinite(a)&&a>0,s=a*o;if(n>=0){let d=s-n;return u&&d<=0?!1:(u?e.start(0,n+i,d):e.start(0,n+i),!0)}let l=-n/o;return u?e.start(r+l,i,s):e.start(r+l,i),!0}var Un=class{constructor(){he(this,"_ctx",null);he(this,"_bufferCache",new Map);he(this,"_failedSrcs",new Set);he(this,"_activeSources",[]);he(this,"_masterGain",null);he(this,"_rateAnchorCtx",0);he(this,"_rateAnchorComp",0);he(this,"_rate",1);he(this,"_paused",!0);he(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 M("webAudioTransport.fetch",new Error(`${r.status} ${n}`)),null;i=await r.arrayBuffer()}catch(r){return M("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),M("webAudioTransport.decode",r),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}async schedulePlayback(t,n,i,r,o,a,u,s=1,l=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||u!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),u!==this._playGeneration)return null;let d=Ya(s),m=this._ctx.createBufferSource();m.buffer=n,m.playbackRate.value=d;let f=this._ctx.createGain();f.gain.value=a,m.connect(f),f.connect(this._masterGain);let x=o-i,S=this._ctx.currentTime;if(this._rate=d,this._rateAnchorCtx=S,this._rateAnchorComp=o,!nm(m,{elapsed:x,mediaStart:r,scheduledAt:S,safeRate:d,clipDuration:l}))return m.disconnect(),f.disconnect(),null;let y=t.muted;t.muted=!0,tm(t,y);let b={el:t,sourceNode:m,gainNode:f,compositionStart:i,mediaStart:r,scheduledAt:S,priorMuted:y,bounded:Number.isFinite(l)&&l>0};return this._activeSources.push(b),this._paused=!1,m.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(d){return M("webAudioTransport.schedule",d),null}}setRate(t){let n=Ya(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){M("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){M("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 Qa="data-hf-studio-manual-edit-gesture";function Za(e){return!Number.isInteger(e.tick)||e.tick<=0||e.tick%60!==0?!1:!(e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2)}var br="data-hf-authored-duration",yr="data-hf-authored-end";function im(){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 el(){let e=Mo();On(document),cr(document);let t=im();e.canonicalFps=t.fps??e.canonicalFps,zr(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,u=null;if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(c){M("runtime.init.site1",c)}let s=new Wn;e.transportClock=s;let l=new Un,d=!1;l.init().then(c=>{d=c}),(()=>{let c=window.gsap,p=window;if(!(!c?.registerPlugin||p.__hfAutoNoopRegistered))try{c.registerPlugin({name:"_auto",init:()=>!1}),p.__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{Xr(document)}catch(c){M("runtime.init.cssVariables",c)}window.__timelines=window.__timelines||{};let f=()=>{let c=document.querySelector(\'[data-composition-id][data-root="true"]\');if(c instanceof HTMLElement)return c;let p=Array.from(document.querySelectorAll("[data-composition-id]"));return p.find(g=>!g.parentElement?.closest("[data-composition-id]"))??p[0]??null};if(Array.isArray(window.__timelines)){let c=window.__timelines,p=f()?.getAttribute("data-composition-id")??"root",g={};if(c.length===1)g[p]=c[0];else for(let h=0;h<c.length;h++)g[`tl-${h}`]=c[h];window.__timelines=g}let x=f();x&&!x.hasAttribute("data-start")&&x.setAttribute("data-start","0");let S=c=>{o.push(c)},y=(c,p,g)=>{let h=g??`${c}:${JSON.stringify(p)}`;a.has(h)||(a.add(h),xe({source:"hf-preview",type:"diagnostic",code:c,details:p}))},b=c=>{let p={scale:1,focusX:960,focusY:540},g=[],h=[],E={time:c.getTime(),duration:c.getDuration(),isPlaying:c.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:c.play,pause:c.pause,seek:c.seek,getTime:c.getTime,getDuration:c.getDuration,isPlaying:c.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>p,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>g,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:c.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>h,getRenderState:()=>({...E,time:c.getTime(),duration:c.getDuration(),isPlaying:c.isPlaying()})}},A=1/60,_=.75,N=.05,$=100,P=240,T=c=>{if(c instanceof Error)return c.message||String(c);if(typeof c=="string")return c;try{return JSON.stringify(c)}catch{return String(c??"")}},w=c=>{let p=c.toLowerCase();return p.includes("cannot read properties of null")||p.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:p.includes("failed to execute \'queryselector\'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:p.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},C=c=>{if(c==null||c.trim()==="")return null;let p=Number.parseFloat(c);return!Number.isFinite(p)||p<=0?null:`${p}px`},F=()=>f(),v=()=>{let c=F();if(!c)return;let p=C(c.getAttribute("data-width")),g=C(c.getAttribute("data-height"));p&&(c.style.width=p),g&&(c.style.height=g),p&&c.style.setProperty("--comp-width",p),g&&c.style.setProperty("--comp-height",g)},R=()=>{let c=F(),p=Array.from(document.querySelectorAll("[data-composition-id]")).filter(g=>g.hasAttribute("data-duration")||g.hasAttribute("data-end"));for(let g of p){if(c&&g===c)continue;let h=g.getAttribute("data-duration"),E=g.getAttribute("data-end");h!=null&&!g.hasAttribute(br)&&g.setAttribute(br,h),E!=null&&!g.hasAttribute(yr)&&g.setAttribute(yr,E),g.removeAttribute("data-duration"),g.removeAttribute("data-end")}},V=()=>{let c=F();if(!c)return;c.style.position||(c.style.position="relative"),c.style.overflow="hidden";let p=C(c.getAttribute("data-width")),g=C(c.getAttribute("data-height"));p&&(c.style.width=p),g&&(c.style.height=g);let h=Array.from(c.children);for(let E of h){let L=E.tagName.toLowerCase();if(L==="script"||L==="style"||L==="link"||L==="meta"||!E.hasAttribute("data-start")||E.hasAttribute("data-hf-autostamped"))continue;let I=(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(I&&Q&&!E.hasAttribute("data-width")&&!E.hasAttribute("data-height")){let ye=E.style.top,Ft=E.style.left,Se=E.style.width,_t=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=Ft,E.style.width=Se,E.style.height=_t)}let q=window.getComputedStyle(E),de=q.position;if(de!=="absolute"&&de!=="fixed"&&(E.style.position="absolute"),!!E.style.top||!!E.style.bottom||q.top!=="auto"||q.bottom!=="auto"||(E.style.top="0"),!!E.style.left||!!E.style.right||q.left!=="auto"||q.right!=="auto"||(E.style.left="0"),L!=="audio"){let ye=C(E.getAttribute("data-width")),Ft=C(E.getAttribute("data-height")),Se=q.width!=="0px"&&q.width!=="auto",_t=q.height!=="0px"&&q.height!=="auto";ye?!E.style.width&&!Se&&(E.style.width=ye):!E.style.width&&q.width==="0px"&&(E.style.width="100%"),Ft?!E.style.height&&!_t&&(E.style.height=Ft):!E.style.height&&q.height==="0px"&&(E.style.height="100%")}}},W=(c,p=0,g)=>$e({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:g?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(c,p),ie=(c,p)=>$e({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:p?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(c),D=(c,p=0)=>!c.hasAttribute("data-hf-auto-start")&&c.hasAttribute("data-start")?Math.max(0,Number(c.getAttribute("data-start")??0)||0)+p:W(c,p),re=(c,p)=>{let g=c.tagName.toLowerCase();if(g==="script"||g==="style"||g==="link"||g==="meta")return!1;let h=g==="video"||g==="audio"?D(c,0):W(c,0),E=ie(c),L=c.getAttribute("data-composition-id");if(L){let Q=(window.__timelines??{})[L],q=null;if(Q&&typeof Q.duration=="function"){let me=Number(Q.duration());Number.isFinite(me)&&me>0&&(q=me)}!(c.hasAttribute("data-duration")||c.hasAttribute("data-end")||c.hasAttribute(br)||c.hasAttribute(yr))&&(E==null||E<=0)&&q!=null&&(E=q)}let I=E!=null&&E>0?h+E:Number.POSITIVE_INFINITY;return p>=h&&(Number.isFinite(I)?p<=I:!0)},Fe=!!document.querySelector("[data-composition-src]"),z=!1;{let c=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let p of c){let g=p.getAttribute("data-composition-id");if(g&&p.children.length===0&&document.querySelector(`template#${CSS.escape(g)}-template`)){z=!0;break}}}let X=!Fe&&!z,O=c=>{if(!c||typeof c.duration!="function")return null;try{let p=Number(c.duration());return Number.isFinite(p)?Math.max(0,p):null}catch{return null}},U=c=>typeof c=="number"&&Number.isFinite(c)&&c>A,_e=c=>{let p=Number(c.getAttribute("data-duration"));if(Number.isFinite(p)&&p>0)return p;let g=Number(c.getAttribute("data-playback-start")??c.getAttribute("data-media-start")??"0"),h=Number.isFinite(g)?Math.max(0,g):0;return Number.isFinite(c.duration)&&c.duration>h?Math.max(0,c.duration-h):null},B=()=>{let c=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(c.length===0)return null;let p=0;for(let g of c){let h=D(g,0);if(!Number.isFinite(h))continue;let E=_e(g);E==null||E<=A||(p=Math.max(p,Math.max(0,h)+E))}return p>A?p:null},k=()=>{let c=F();if(!c)return null;let p=window.__timelines??{},g=$e({timelineRegistry:p,includeAuthoredTimingAttrs:!0}),h=0,E=Number.parseFloat(c.getAttribute("data-duration")??"");Number.isFinite(E)&&E>0&&(h=E);let L=Array.from(c.querySelectorAll("[data-composition-id][data-start]"));for(let I of L){if(!(I instanceof Element)||I.parentElement?.closest("[data-composition-id]")!==c)continue;let q=g.resolveStartForElement(I,0),de=g.resolveDurationForElement(I);!Number.isFinite(q)||de==null||de<=0||(h=Math.max(h,Math.max(0,q)+de))}return h>A?h:null},H=()=>{let c=B();return typeof c!="number"||!Number.isFinite(c)||c<=A?null:c},le=c=>U(c)?Math.max(A,c*_):A,se=()=>{let c=0;for(let p of e.deterministicAdapters){let g=p.getInferredDurationSeconds;if(typeof g!="function")continue;let h=null;try{h=g()}catch(E){M("runtime.init.adapterDuration",E)}typeof h=="number"&&Number.isFinite(h)&&h>0&&(c=Math.max(c,h))}return c>A?c:null},G=(c,p=0)=>{let g=O(c),h=H(),E=k(),L=se(),I=Math.max(h??0,E??0,L??0),Q=Number.isFinite(p)&&p>A?p:0,q=0;return U(g)?q=Math.max(g,I,Q):U(I)?q=Math.max(I,Q):q=Q,q>0?Math.max(0,q):0},j=()=>{let c=window.__timelines??{},p=ne=>{let Z=Object.entries(c).filter(oe=>!!oe[1]&&typeof oe[1].play=="function"&&typeof oe[1].pause=="function");if(Z.length!==1)return{timeline:null};let ce=Z[0];if(!ce)return{timeline:null};let[fe,pe]=ce;return{timeline:pe,selectedTimelineIds:[fe],selectedDurationSeconds:O(pe),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:ne,soleTimelineId:fe}}}},g=$e({timelineRegistry:c,includeAuthoredTimingAttrs:!0}),h=H(),E=k(),L=Math.max(h??0,E??0)||null,I=le(L),Q=ne=>{let Z=document.querySelector(`[data-composition-id="${CSS.escape(ne)}"]`);return Z?g.resolveStartForElement(Z,0):0},q=ne=>{let Z=window.gsap;if(!Z||typeof Z.timeline!="function")return null;let ce=Z.timeline({paused:!0});for(let fe of ne)ce.add(fe.timeline,Q(fe.compositionId));return ce},de=(ne,Z)=>{if(!U(ne))return null;let ce=window.gsap;if(!ce||typeof ce.timeline!="function")return null;let fe=ce.timeline({paused:!0});if(Z)try{fe.add(Z,0)}catch(oe){M("runtime.init.site2",oe)}let pe=fe;if(typeof pe.to=="function")try{pe.to({},{duration:ne})}catch(oe){M("runtime.init.site3",oe)}return fe},me=(ne,Z)=>{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 oe of Z)if(!fe.some(Le=>Le===oe.timeline))try{let Le=Q(oe.compositionId);ne.add(oe.timeline,Le),pe.push(oe.compositionId)}catch(Le){M("runtime.init.site4",Le)}return pe}catch{return[]}},te=F(),Y=te?.getAttribute("data-composition-id")??null;if(!Y)return p("root_missing_composition_id");let ye=c[Y]??null,Se=(()=>{if(!te)return[];let ne=new Set,Z=Array.from(te.querySelectorAll("[data-composition-id]")),ce=[];for(let fe of Z){let pe=fe.getAttribute("data-composition-id");if(!pe||pe===Y||ne.has(pe))continue;ne.add(pe);let oe=c[pe]??null;if(!oe||typeof oe.play!="function"||typeof oe.pause!="function")continue;let Ce=O(oe);ce.push({compositionId:pe,timeline:oe,durationSeconds:Ce??0})}return ce})(),_t=ne=>{for(let Z of ne){let ce=Z.timeline;if(typeof ce.paused=="function")try{ce.paused(!1)}catch(fe){M("runtime.init.site5",fe)}}};if(Se.length>0&&_t(Se),ye){let ne=Se.length>0?me(ye,Se):[];if((Se.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id=\'"+Y+"\'])"))&&(K=!0),ne.length>0)try{let oe=ye.time();ye.seek(oe,!1)}catch{}let Z=O(ye);if(!U(Z)&&Se.length>0){let oe=Se.map(Vl=>Vl.compositionId),Ce=q(Se),Le=O(Ce);if(Ce&&U(Le))return{timeline:Ce,selectedTimelineIds:oe,selectedDurationSeconds:Le,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:Y,rootDurationSeconds:Z,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:I,selectedDurationSeconds:Le,mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:E,selectedTimelineIds:oe,autoNestedChildren:ne}}};let ii=de(L??0,ye),ri=O(ii);if(ii&&U(ri))return{timeline:ii,selectedTimelineIds:[Y],selectedDurationSeconds:ri,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:Y,rootDurationSeconds:Z,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:E,selectedDurationSeconds:ri,selectedTimelineIds:[Y],autoNestedChildren:ne}}}}if(!U(Z)&&Se.length===0){let oe=de(L??0,ye),Ce=O(oe);if(oe&&U(Ce))return{timeline:oe,selectedTimelineIds:[Y],selectedDurationSeconds:Ce,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:Y,rootDurationSeconds:Z,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:E,selectedDurationSeconds:Ce,selectedTimelineIds:[Y]}}}}let ce=te?.getAttribute("data-duration"),fe=ce?parseFloat(ce):null,pe=Math.max(U(fe)?fe:0,E??0);if(pe>0&&U(pe)&&U(Z)&&pe>=Z+.5){let oe=ye;if(typeof oe.to=="function")try{oe.to({},{duration:0},pe)}catch(Le){M("runtime.init.site6",Le)}let Ce=O(ye);if(U(Ce))return{timeline:ye,selectedTimelineIds:[Y],selectedDurationSeconds:Ce,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:Y,rootDurationSeconds:Z,rootDeclaredDur:fe,authoredCompositionDurationFloorSeconds:E,newDur:Ce}}}}return{timeline:ye,selectedTimelineIds:[Y],selectedDurationSeconds:Z,mediaDurationFloorSeconds:h,diagnostics:ne.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:Y,selectedDurationSeconds:Z,autoNestedChildren:ne}}:void 0}}if(Se.length>0){let ne=Se.map(fe=>fe.compositionId),Z=q(Se),ce=O(Z);if(Z)return{timeline:Z,selectedTimelineIds:ne,selectedDurationSeconds:ce,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:Y,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:I,selectedDurationSeconds:ce,mediaDurationFloorSeconds:h,selectedTimelineIds:ne}}}}return p("root_composition_id_unmatched_in_registry")},K=!1,Ae=()=>{if(!X)return!1;let c=e.capturedTimeline,p=O(c),g=U(p);if(c&&g&&K)return!1;let h=j();if(!h.timeline)return!1;if(c&&c===h.timeline)return typeof c.timeScale=="function"&&c.timeScale(e.playbackRate),!1;e.capturedTimeline=h.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let E=G(e.capturedTimeline,0);if(E<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),e.capturedTimeline.pause()),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 I=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(I,!1),e.capturedTimeline.pause()}let L=window.__hfStudioManualEditsApply;typeof L=="function"&&L(),On(document)}if(h.diagnostics&&xe({source:"hf-preview",type:"diagnostic",code:h.diagnostics.code,details:h.diagnostics.details}),xe({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:h.selectedTimelineIds??[],selectedDurationSeconds:h.selectedDurationSeconds??null,mediaDurationFloorSeconds:h.mediaDurationFloorSeconds??null}}),window.parent!==window){let L=F(),I=E>0?E:0,Q=String(I>0?I:1),q=new Set,de=new Set(document.querySelectorAll("[data-start]")),me=te=>{let Y=te.parentElement;for(;Y&&Y!==L;){if(de.has(Y))return!0;Y=Y.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let te of e.capturedTimeline.getChildren(!0))if(typeof te.targets=="function")for(let Y of te.targets())Y instanceof HTMLElement&&Y!==L&&(Y.hasAttribute("data-start")||me(Y)||q.has(Y)||(q.add(Y),Y.setAttribute("data-start","0"),Y.setAttribute("data-duration",Q),Y.setAttribute("data-hf-autostamped","1")))}catch{}if(L instanceof HTMLElement)for(let te of L.querySelectorAll("[id]"))te instanceof HTMLElement&&te!==L&&(te.hasAttribute("data-start")||me(te)||q.has(te)||te.tagName==="SCRIPT"||te.tagName==="STYLE"||te.tagName==="LINK"||(q.add(te),te.setAttribute("data-start","0"),te.setAttribute("data-duration",Q),te.setAttribute("data-hf-autostamped","1")))}for(let L of Et)an.delete(L),Mr(L);return!0};window.__hfForceTimelineRebind=()=>{K=!1,Ae(),Lr(e.currentTime)};let we=()=>{let c=F();if(!(c instanceof HTMLElement))return;let p=c.getBoundingClientRect(),g=Number(c.getAttribute("data-width")),h=Number(c.getAttribute("data-height")),E=window.getComputedStyle(c),L=Number.isFinite(g)&&g>0&&Number.isFinite(h)&&h>0,I=p.width<=0||p.height<=0||c.clientWidth<=0||c.clientHeight<=0;!L||!I||y("root_stage_layout_zero",{compositionId:c.getAttribute("data-composition-id")??null,declaredWidth:g,declaredHeight:h,rectWidth:Math.round(p.width),rectHeight:Math.round(p.height),clientWidth:c.clientWidth,clientHeight:c.clientHeight,display:E.display,visibility:E.visibility,overflow:E.overflow},`root-stage-layout-zero:${c.getAttribute("data-composition-id")??"unknown"}`)},St=()=>{e.tornDown||(u!=null&&window.cancelAnimationFrame(u),u=window.requestAnimationFrame(()=>{u=null,we()}))},Ge=()=>{i=c=>{let p=T(c.error??c.message).slice(0,P);if(!p)return;let g=w(p);xe({source:"hf-preview",type:"diagnostic",code:g.code,details:{category:g.category,message:p,filename:c.filename||null,line:Number.isFinite(c.lineno)?c.lineno:null,column:Number.isFinite(c.colno)?c.colno:null}})},r=c=>{let p=T(c.reason).slice(0,P);if(!p)return;let g=w(p);xe({source:"hf-preview",type:"diagnostic",code:`${g.code}_unhandled_rejection`,details:{category:`${g.category}-unhandled-rejection`,message:p}})},window.addEventListener("error",i),window.addEventListener("unhandledrejection",r)},Tl=()=>{let c=Array.from(document.querySelectorAll("img, video, audio, source, link[rel=\'stylesheet\']"));for(let g of c){let h=()=>{if(!(g instanceof Element))return;let E=g.tagName.toLowerCase(),L=g.getAttribute("src")??g.getAttribute("href")??g.getAttribute("poster")??null,I=E==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";y(I,{tagName:E,assetUrl:L,currentSrc:(g instanceof HTMLImageElement||g instanceof HTMLMediaElement)&&g.currentSrc||null,readyState:g instanceof HTMLMediaElement?g.readyState:null,networkState:g instanceof HTMLMediaElement?g.networkState:null},`${I}:${E}:${L??"unknown"}`)};g.addEventListener("error",h),S(()=>{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&&y("runtime_font_load_issue",{failedFamilies:g,totalFaces:Array.from(p).length},`runtime-font-load-issue:${g.join("|")}`)}).catch(()=>{})},vl=(c,p)=>{if(!c.timeline)return!1;let g=e.capturedTimeline;if(g&&g===c.timeline)return!1;let h=Math.max(0,e.currentTime||0),E=e.isPlaying;e.capturedTimeline=c.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{e.capturedTimeline.pause(),e.capturedTimeline.seek(h,!1),E&&e.capturedTimeline.play()}catch(L){M("runtime.init.site7",L)}return xe({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:p,previousTime:h,selectedTimelineIds:c.selectedTimelineIds??[],selectedDurationSeconds:c.selectedDurationSeconds??null,mediaDurationFloorSeconds:c.mediaDurationFloorSeconds??null}}),!0},tt=null,vr=!1,Et=new Set,an=new WeakMap,ln=()=>{e.tornDown||(tt!=null&&window.clearTimeout(tt),tt=window.setTimeout(()=>{if(e.tornDown)return;tt=null;let c=j();if(!c.timeline||!U(c.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){Ae()&&(nt(),Te(!0));return}if(vr)return;let g=O(e.capturedTimeline),h=c.selectedDurationSeconds??O(c.timeline);U(h)&&(!U(g)||h>=g+N)&&vl(c,"manual")&&(vr=!0,xe({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:g??null,selectedDurationSeconds:h??null,selectedTimelineIds:c.selectedTimelineIds??[],mediaDurationFloorSeconds:c.mediaDurationFloorSeconds??null}}),nt(),Te(!0))},$))},Ml=()=>{for(let c of Et)c.removeEventListener("loadedmetadata",ln),c.removeEventListener("durationchange",ln);Et.clear()},Kn=()=>{if(e.tornDown)return;let c=Array.from(document.querySelectorAll("video, audio"));for(let p of c){if(Et.has(p))continue;Et.add(p);let g=Number.parseFloat(p.dataset.volume??"");Number.isFinite(g)&&(p.volume=Math.max(0,Math.min(1,g))),p.addEventListener("loadedmetadata",ln),p.addEventListener("durationchange",ln),p.preload!=="auto"&&(p.preload="auto"),p.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&p.load(),Mr(p)}},Mr=c=>{an.has(c)||xo(c,e.capturedTimeline,G(e.capturedTimeline,0),an)},Jn=new WeakMap,Nr=c=>{let p=Jn.get(c);if(p!==void 0)return p;let g=window.getComputedStyle(c).position,h=g==="static"||g==="relative"||g==="sticky";return Jn.set(c,h),h},Xn=new WeakMap,Nl=c=>{let p=Xn.get(c);if(p!==void 0)return p;let g=c.querySelector("[data-start]")===null;return Xn.set(c,g),g},Ll=()=>{Jn=new WeakMap,Xn=new WeakMap},Yn=new WeakMap,un=new WeakSet,Lr=c=>{let p=Array.from(document.querySelectorAll("[data-start]")),g=F();for(let h of p){if(!(h instanceof HTMLElement))continue;if(h.hasAttribute("data-hidden")){un.has(h)||(Yn.set(h,h.style.getPropertyValue("display")),un.add(h)),h.style.display="none",(h instanceof HTMLVideoElement||h instanceof HTMLImageElement)&&n?.setSourceVisibility(h,!1);continue}if(un.has(h)){let L=Yn.get(h);L?h.style.display=L:h.style.removeProperty("display"),Yn.delete(h),un.delete(h)}let E=re(h,c);if(E){let L=h.parentElement;for(;L&&L!==g;){if(L instanceof HTMLElement&&L.hasAttribute("data-start")&&!re(L,c)){E=!1;break}L=L.parentElement}}h.style.visibility=E?"visible":"hidden",(h instanceof HTMLVideoElement||h instanceof HTMLImageElement)&&n?.setSourceVisibility(h,E),E?Nr(h)&&h.style.removeProperty("display"):Nr(h)&&Nl(h)&&(h.style.display="none")}},Me=()=>{let c=h=>{let E=h.closest("[data-composition-id]"),L=E?W(E,0):null,I=E?ie(E,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:E,inheritedStart:L,inheritedDuration:I}},p=bo({shouldIncludeElement:h=>h.hasAttribute("data-start")||!!c(h).compositionRoot,resolveStartSeconds:h=>{let E=c(h);return D(h,E.inheritedStart??0)},resolveDurationSeconds:h=>{let E=c(h),L=D(h,E.inheritedStart??0),I=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-L):null,q=Number.isFinite(h.duration)&&h.duration>I?Math.max(0,h.duration-I):null,de=Number.parseFloat(h.dataset.duration??""),me=Number.isFinite(de)&&de>0?de:null,te=[q,Q,me].filter(Y=>Y!=null);return te.length>0?Math.min(...te):null}});for(let h of p.mediaClips){let E=an.get(h.el);E&&(h.volumeKeyframes=E)}let g=e.mediaForceSyncNextTick;g&&(e.mediaForceSyncNextTick=!1),e.nativeMediaSyncDisabled||yo({clips:p.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,xe({source:"hf-preview",type:"media-autoplay-blocked"}))}}),Lr(e.currentTime)},Te=c=>{let p=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),g=Date.now();(c||p!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||g-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=p,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=g,xe({source:"hf-preview",type:"state",frame:p,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},Qn="",Rr=0,Rl=()=>{let c="";for(let p of document.querySelectorAll("[data-start]"))c+=`${p.id}:${p.tagName}|`;return c},nt=()=>{R(),v(),V();let c=F();if(c){let h=C(c.getAttribute("data-width")),E=C(c.getAttribute("data-height")),L=h?parseInt(h,10):0,I=E?parseInt(E,10):0;L>0&&I>0&&xe({source:"hf-preview",type:"stage-size",width:L,height:I})}Ae();let p=Io({canonicalFps:e.canonicalFps});window.__clipManifest=p;let g=Rl();if(Qn!==g&&Ll(),!window.__clipTree||Qn!==g){let h=window;window.__clipTree=No({startResolver:$e({timelineRegistry:h.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:h.__timelines??{},rootDuration:p.durationInFrames/e.canonicalFps}),Qn=g}xe(p),St()},Zn=c=>Number.isFinite(c)&&c>0?c:0,kl=c=>{let p=Zn(Number(c));if(p<=0)return;let g=F(),h=Zn(Number.parseFloat(g?.getAttribute("data-duration")??"")),E=Math.max(Rr,Zn(s.getDuration()),h);p<=E||(Rr=p,g?.setAttribute("data-duration",String(p)),s.setDuration(p),nt(),Te(!0))},Pe=(c,p=0)=>{for(let g of e.deterministicAdapters){try{c==="discover"&&g.discover(),c==="pause"&&g.pause(),c==="play"&&g.play&&g.play()}catch(h){M("runtime.init.site8",h)}if(c==="discover")try{g.seek({time:p,suppressEvents:!0})}catch(h){M("runtime.init.site9",h)}}},it=()=>{window.__renderReady=!1},At=null,wt=!0,Dl=()=>{let c=[];for(let p of e.deterministicAdapters){let g=p.getReadyPromise;if(typeof g=="function")try{let h=g();h&&c.push(h)}catch(h){M("runtime.init.adapterReady",h)}}return c},Il=()=>{let c=Dl();if(c.length===0)return At=null,wt=!0,!0;let p=c[0];if(!p)return!0;let g=c.length===1?p:Promise.all(c);return g!==At&&(At=g,wt=!1,Promise.resolve(g).then(()=>{At===g&&(wt=!0,it())},h=>{At===g&&(wt=!0,M("runtime.init.adapterReady",h),it())})),wt};if(X)sr();else{let c={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:C,onDiagnostic:({code:p,details:g})=>{xe({source:"hf-preview",type:"diagnostic",code:p,details:g})}};Aa(c).then(()=>Ea(c)).finally(()=>{X=!0,Kn(),Tl(),sr(),cr(document),it()})}let cn=Fo({postMessage:c=>xe(c)});cn.installPickerApi();let We=Xa();n=We,S(()=>{We.destroy(),n=null});let ei=c=>{let p=Number(c);!Number.isFinite(p)||p<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,p)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let g=document.querySelectorAll("video, audio");for(let h of g)if(h instanceof HTMLMediaElement)try{h.playbackRate=e.playbackRate}catch(E){M("runtime.init.site10",E)}},kr={play:()=>{let c=e.capturedTimeline;if(s.isPlaying())return;let p=G(c,0);if(p>0)s.setDuration(p),s.reachedEnd()&&(s.seek(0),e.currentTime=0,rt(0));else{let g=F(),h=Number(g?.getAttribute("data-duration")??0);h>0&&s.setDuration(h)}c&&c.pause(),s.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,Br(s.now()),d&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&Hr(),Pe("play"),Me(),We.redraw(),Te(!0))},pause:()=>{if(!s.isPlaying())return;l.stopAll(),s.detachAudioSource(),s.pause(),e.isPlaying=!1,e.currentTime=s.now(),e.mediaForceSyncNextTick=!0,Br(e.currentTime);let c=e.capturedTimeline;c&&c.pause(),Pe("pause"),Me(),We.redraw(),Te(!0)},seek:(c,p)=>{let g=dt(Math.max(0,Number(c)||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(E&&E.pause(),rt(e.currentTime),Pe("pause"),p?.keepPlaying&&h){kr.play();return}Me(),We.redraw(),Te(!0)},renderSeek:(c,p)=>{let g=dt(Math.max(0,Number(c)||0),e.canonicalFps);l.stopAll(),s.detachAudioSource(),s.isPlaying()&&s.pause(),s.seek(g),e.currentTime=s.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0,rt(e.currentTime,{activateChildren:!0,suppressEvents:p?.suppressEvents}),Me(),We.redraw(),Te(!0)},getTime:()=>s.now(),getDuration:()=>{let c=s.getDuration();return Number.isFinite(c)?c:0},isPlaying:()=>s.isPlaying(),setPlaybackRate:c=>{ei(c),s.setRate(e.playbackRate),Gr()},getPlaybackRate:()=>e.playbackRate},Dr=G(e.capturedTimeline,0);Dr>0&&s.setDuration(Dr);let Ne=vo({getTimeline:()=>e.capturedTimeline,setTimeline:c=>{e.capturedTimeline=c},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:c=>{e.isPlaying!==c&&(e.mediaForceSyncNextTick=!0),e.isPlaying=c},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:ei,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(c,p)=>{e.currentTime=Math.max(0,Number(c)||0),e.isPlaying!==p&&(e.mediaForceSyncNextTick=!0),e.isPlaying=p,Me()},onStatePost:Te,onDeterministicSeek:(c,p)=>{for(let g of e.deterministicAdapters)if(!(g.name==="gsap"&&e.capturedTimeline))try{g.seek({time:Number(c)||0,suppressEvents:p?.suppressEvents})}catch(h){M("runtime.init.site11",h)}},onDeterministicPause:()=>Pe("pause"),onDeterministicPlay:()=>Pe("play"),onRenderFrameSeek:()=>{We.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>G(e.capturedTimeline,0),transport:kr});window.__player=b(Ne),window.__playerReady=!0,qr(xe),ot("composition_loaded",{duration:Ne.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.controlBridgeHandler=jr({onPlay:()=>{Ne.play(),ot("composition_played",{time:Ne.getTime()})},onPause:()=>{Ne.pause(),ot("composition_paused",{time:Ne.getTime()})},onStopMedia:()=>{l.stopAll();let c=document.querySelectorAll("video, audio");for(let p of c)p instanceof HTMLMediaElement&&!p.paused&&p.pause()},onSeek:(c,p)=>{Ne.seek(c),ot("composition_seeked",{time:c})},onSetMuted:c=>{e.bridgeMuted=c;let p=c||e.mediaOutputMuted;l.setMuted(p);let g=document.querySelectorAll("video, audio");for(let h of g)h instanceof HTMLMediaElement&&(h.muted=p||h.defaultMuted)},onSetVolume:c=>{e.bridgeVolume=c,l.setVolume(c);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*c}},onSetMediaOutputMuted:c=>{e.mediaOutputMuted=c;let p=c||e.bridgeMuted;l.setMuted(p);let g=document.querySelectorAll("video, audio");for(let h of g)h instanceof HTMLMediaElement&&(h.muted=p||h.defaultMuted)},onSetNativeMediaSyncDisabled:c=>{e.nativeMediaSyncDisabled!==c&&(e.nativeMediaSyncDisabled=c,e.mediaForceSyncNextTick=!0,c?(l.stopAll(),s.detachAudioSource()):Me())},onSetWebAudioMediaDisabled:c=>{e.webAudioMediaDisabled!==c&&(e.webAudioMediaDisabled=c,e.mediaForceSyncNextTick=!0,c&&(l.stopAll(),s.detachAudioSource()),Me())},onSetPlaybackRate:c=>{ei(c),e.transportClock&&e.transportClock.setRate(e.playbackRate),Gr()},onSetRootDuration:kl,onSetColorGrading:(c,p)=>{We.setGrading(c,p)},onSetColorGradingCompare:(c,p)=>{We.setCompare(c,p)},onTick:()=>{if(e.tornDown||!s.isPlaying())return;let c=s.now();if(e.currentTime=c,rt(c),s.reachedEnd()){l.stopAll(),s.detachAudioSource(),s.pause(),e.isPlaying=!1;let p=s.getDuration();Number.isFinite(p)&&(s.seek(p),e.currentTime=p,rt(p)),Pe("pause"),Me(),Te(!0)}},onEnablePickMode:()=>cn.enablePickMode(),onDisablePickMode:()=>cn.disablePickMode(),getCanonicalFps:()=>e.canonicalFps}),e.deterministicAdapters=[ho(),Qr({resolveStartSeconds:c=>W(c,0)}),eo(),no(),ro(),oo(),so(),ao(),lo(),uo(),co(),Zr({getTimeline:()=>e.capturedTimeline})],mo(),po(),window.__hfReseekGpu=c=>{let p=Math.max(0,Number(c)||0);window.__hfThreeTime=p,window.__hfTypegpuTime=p,io(p)},Ge(),Kn(),Pe("discover");let Pl=()=>{let c=e.capturedTimeline,p=Ae();e.capturedTimeline&&(p||e.capturedTimeline!==c||!Ne._timeline)&&(Ne._timeline=e.capturedTimeline);let g=G(e.capturedTimeline,0);if(g>0&&s.setDuration(g),Pe("discover",e.currentTime),!e.capturedTimeline){let h=window.__timelines??{},E=Object.keys(h).filter(L=>h[L]);if(E.length>0){let I=F()?.getAttribute("data-composition-id")??null;y("root_timeline_unbound_registry_present",{reason:I?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:I,registeredTimelineKeys:E},"root_timeline_unbound_registry_present"),console.warn("[hyperframes] Root timeline not bound \\u2014 render will freeze at t=0. "+(I?`Root data-composition-id is "${I}" 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["${I??"<root-id>"}"] = tl).`)}}window.__renderReady=!0,nt(),Te(!0)};if(it=()=>{if(!X||window.__hfTimelinesBuilding){window.__renderReady=!1;return}if(Pe("discover",e.currentTime),!Il()){window.__renderReady=!1;return}Pl()},window.__hfTimelinesBuilding){window.__renderReady=!1;let c=()=>{window.removeEventListener("hf-timelines-built",c),it()};window.addEventListener("hf-timelines-built",c)}it(),X&&setTimeout(()=>{it()},0);let dn=0,ti=!1,Ol=(c,p,g,h)=>{try{let E=h?.suppressEvents===!0;c.pause(),typeof c.totalTime=="function"?c.totalTime(p,E):c.seek(p,E)}catch(E){M(g,E)}},Bl=(c,p)=>{let g=window.__timelines??{},h=F()?.getAttribute("data-composition-id")??null;for(let[E,L]of Object.entries(g)){if(!L||E===h)continue;let I=document.querySelector(`[data-composition-id="${CSS.escape(E)}"]`);if(!I)continue;let Q=W(I,0);if(!Number.isFinite(Q))continue;let q=ie(I,{includeAuthoredTimingAttrs:!0}),de=O(L),me=q!=null&&q>0?q:de,te=Math.max(0,me!=null&&me>0?Math.min(me,c-Q):c-Q);Ol(L,te,"runtime.init.transport.childTimeline",p)}},Hl=c=>{let p=window.__timelines??{};for(let g of Object.values(p))if(!(!g||g===c))try{g.play()}catch(h){M("runtime.init.activateSiblings",h)}},Ir=c=>typeof c=="object"&&c!==null,Ct=new WeakMap,Gl=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],Pr=(c,p)=>{let g=c[p];if(typeof g!="function")return null;try{let h=Number(g.call(c));return Number.isFinite(h)?h:null}catch(h){return M("runtime.init.gsapCallbackDuration",h),null}},Wl=c=>{let p=Ct.get(c);if(p!=null)return p;if(!("getChildren"in c)||typeof c.getChildren!="function")return!1;let g;try{g=c.getChildren(!0,!0,!0)}catch(h){return M("runtime.init.gsapCallbackChildren",h),Ct.set(c,!1),!1}if(!Array.isArray(g))return Ct.set(c,!1),!1;for(let h of g){if(!Ir(h))continue;let E=h.vars;if(!Ir(E)||!Gl.some(q=>typeof E[q]=="function"))continue;let Q=Pr(h,"totalDuration")??Pr(h,"duration");if(Q!=null&&Q<=1e-6)return Ct.set(c,!0),!0}return Ct.set(c,!1),!1},rt=(c,p)=>{let g=e.capturedTimeline,h=p?.suppressEvents===!0;if(g){p?.activateChildren&&Hl(g);let E=g,L=c;if(typeof E.totalDuration=="function")try{let I=Number(E.totalDuration());Number.isFinite(I)&&I>0&&c>I&&(L=I)}catch(I){M("runtime.init.transport.clampDuration",I)}try{typeof g.totalTime=="function"?(g.totalTime(L,h),!h&&!Wl(g)&&(g.totalTime(L+.001,!0),g.totalTime(L,!0))):g.seek(L,h)}catch(I){M("runtime.init.transport.seek",I)}}else Bl(c,p);for(let E of e.deterministicAdapters)if(!(E.name==="gsap"&&g))try{E.seek({time:c,suppressEvents:h})}catch(L){M("runtime.init.transport.adapter",L)}},Ul=()=>{try{return document.querySelector(`[${Qa}]`)!=null}catch{return!1}},Or=()=>{if(!(e.tornDown||ti)){ti=!0;try{if(e.transportRafId=window.requestAnimationFrame(Or),dn+=1,Za({tick:dn,isPlaying:s.isPlaying(),hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:s.now()})){let p=e.capturedTimeline;if(Ae()){e.capturedTimeline&&!Ne._timeline&&(Ne._timeline=e.capturedTimeline),e.capturedTimeline&&e.capturedTimeline!==p&&e.capturedTimeline.pause();let g=G(e.capturedTimeline,0);g>0&&s.setDuration(g),nt()}}if(dn%20===0&&nt(),dn%30===0&&Kn(),e.capturedTimeline){let p=G(e.capturedTimeline,0);p>0&&(!s.isPlaying()||p>=s.getDuration())&&s.setDuration(p)}if(s.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&l.isActive()&&l.context){let p=l.getTime();p>=0&&s.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??""),L=Number.parseFloat(h.dataset.duration??""),I=Number.isFinite(L)&&L>0?E+L:1/0,Q=Number.parseFloat(h.dataset.playbackStart??h.dataset.mediaStart??"0")||0;if(Number.isFinite(E)&&e.currentTime>=E&&e.currentTime<=I){h.paused?!h.error&&h.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(s.attachAudioSource({currentTimeSeconds:e.currentTime}),g=!0):(s.attachAudioSource({el:h,compositionStart:E,mediaStart:Q}),g=!0);break}}!g&&s.hasAudioSource()&&s.detachAudioSource()}else s.hasAudioSource()&&s.detachAudioSource();let c=s.now();if(e.currentTime=c,(s.isPlaying()||!Ul())&&rt(c),s.isPlaying()&&s.reachedEnd()){l.stopAll(),s.detachAudioSource(),s.pause(),e.isPlaying=!1;let p=s.getDuration();Number.isFinite(p)&&(s.seek(p),e.currentTime=p,rt(p)),Pe("pause"),Me(),Te(!0);return}s.isPlaying()&&Me(),Te(!1)}finally{ti=!1}}},Br=c=>{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??""),L=Number.isFinite(E)&&E>0?h+E:1/0;if(c<h||c>=L)continue;let I=Number.parseFloat(g.dataset.playbackStart??g.dataset.mediaStart??"0")||0,Q=c-h+I;if(Q>=0)try{g.currentTime=Q}catch{}}},Hr=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let c=l.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,L=Number.parseFloat(g.dataset.volume??""),I=Number.isFinite(L)?L:1,Q=Number.parseFloat(g.dataset.duration??""),q=Number.isFinite(Q)&&Q>0?Q:Number.POSITIVE_INFINITY,de=g.closest("[data-composition-id]");if(de){let me=W(de,0),te=ie(de,{includeAuthoredTimingAttrs:!0});te!=null&&te>0&&(q=Math.min(q,Math.max(0,me+te-h)))}l.decodeAudioElement(g).then(me=>{!me||!s.isPlaying()||l.schedulePlayback(g,me,h,E,s.now(),I*e.bridgeVolume,c,e.playbackRate,q)})}},Gr=()=>{l.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&d&&s.isPlaying()&&l.hasBoundedActiveSources()&&(l.stopAll(),Hr())};if(e.capturedTimeline){let c=G(e.capturedTimeline,0);c>0&&s.setDuration(c),e.capturedTimeline.pause()}La(window),e.transportRafId=window.requestAnimationFrame(Or),nt(),Te(!0);let ni=()=>{if(!e.tornDown){e.tornDown=!0,e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),e.transportClock=null,l.destroy(),tt!=null&&(window.clearTimeout(tt),tt=null),u!=null&&(window.cancelAnimationFrame(u),u=null),Ml(),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),cn.disablePickMode();for(let c of e.deterministicAdapters)if(!(!c||typeof c.revert!="function"))try{c.revert()}catch(p){M("runtime.init.site12",p)}e.deterministicAdapters=[];for(let c of o.splice(0))try{c()}catch(p){M("runtime.init.site13",p)}for(let c of e.injectedCompStyles)try{c.remove()}catch(p){M("runtime.init.site14",p)}e.injectedCompStyles=[];for(let c of e.injectedCompLinks)try{c.remove()}catch(p){M("runtime.init.site15",p)}e.injectedCompLinks=[];for(let c of e.injectedCompScripts)try{c.remove()}catch(p){M("runtime.init.site16",p)}e.injectedCompScripts=[],e.capturedTimeline=null,window.__hfRuntimeTeardown===ni&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=ni,e.beforeUnloadHandler=ni,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var tl=["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"],Sr=[[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 rm(e){if(e<=255)return tl[e];let t=0,n=Sr.length-1;for(;t<=n;){let i=t+n>>1,r=Sr[i];if(e<r[0]){n=i-1;continue}if(e>r[1]){t=i+1;continue}return r[2]}return"L"}function om(e){let t=e.length;if(t===0)return null;let n=new Array(t),i=!1;for(let l=0;l<t;){let d=e.charCodeAt(l),m=d,f=1;if(d>=55296&&d<=56319&&l+1<t){let S=e.charCodeAt(l+1);S>=56320&&S<=57343&&(m=(d-55296<<10)+(S-56320)+65536,f=2)}let x=rm(m);(x==="R"||x==="AL"||x==="AN")&&(i=!0);for(let S=0;S<f;S++)n[l+S]=x;l+=f}if(!i)return null;let r=0;for(let l=0;l<t;l++){let d=n[l];if(d==="L"){r=0;break}if(d==="R"||d==="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",u=a,s=u;for(let l=0;l<t;l++)n[l]==="NSM"?n[l]=s:s=n[l];s=u;for(let l=0;l<t;l++){let d=n[l];d==="EN"?n[l]=s==="AL"?"AN":"EN":(d==="R"||d==="L"||d==="AL")&&(s=d)}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 d;for(d=l-1;d>=0&&n[d]==="ET";d--)n[d]="EN";for(d=l+1;d<t&&n[d]==="ET";d++)n[d]="EN"}for(let l=0;l<t;l++){let d=n[l];(d==="WS"||d==="ES"||d==="ET"||d==="CS")&&(n[l]="ON")}s=u;for(let l=0;l<t;l++){let d=n[l];d==="EN"?n[l]=s==="L"?"L":"EN":(d==="R"||d==="L")&&(s=d)}for(let l=0;l<t;l++){if(n[l]!=="ON")continue;let d=l+1;for(;d<t&&n[d]==="ON";)d++;let m=l>0?n[l-1]:u,f=d<t?n[d]:u,x=m!=="L"?"R":"L";if(x===(f!=="L"?"R":"L"))for(let y=l;y<d;y++)n[y]=x;l=d-1}for(let l=0;l<t;l++)n[l]==="ON"&&(n[l]=a);for(let l=0;l<t;l++){let d=n[l];(o[l]&1)===0?d==="R"?o[l]++:(d==="AN"||d==="EN")&&(o[l]+=2):(d==="L"||d==="AN"||d==="EN")&&o[l]++}return o}function nl(e,t){let n=om(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 sm=/[ \\t\\n\\r\\f]+/g,am=/[\\t\\n\\r\\f]| {2,}|^ | $/;function lm(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function um(e){if(!am.test(e))return e;let t=e.replace(sm," ");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 cm(e){return/[\\r\\f]/.test(e)?e.replace(/\\r\\n/g,`\n`).replace(/[\\r\\f]/g,`\n`):e.replace(/\\r\\n/g,`\n`)}var Er=null,dm;function fm(){return Er===null&&(Er=new Intl.Segmenter(dm,{granularity:"word"})),Er}var mm=/\\p{Script=Arabic}/u,Vn=/\\p{M}/u,cl=/\\p{Nd}/u;function il(e){return mm.test(e)}function rl(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 Ie(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 i=e.charCodeAt(t+1);if(i>=56320&&i<=57343){let r=(n-55296<<10)+(i-56320)+65536;if(rl(r))return!0;t++;continue}}if(rl(n))return!0}}return!1}function pm(e){let t=qn(e);return t!==null&&(jn.has(t)||Ze.has(t))}var hm=new Set(["\\xA0","\\u202F","\\u2060","\\uFEFF"]);function gm(e){return Ie(e)}function xm(e){let t=qn(e);return t!==null&&hm.has(t)}function zn(e){return!pm(e)&&!xm(e)}var jn=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"]),sn=new Set([\'"\',"(","[","{","\\u201C","\\u2018","\\xAB","\\u2039","\\uFF08","\\u3014","\\u3008","\\u300A","\\u300C","\\u300E","\\u3010","\\u3016","\\u3018","\\u301A"]),wr=new Set(["\'","\\u2019"]),Ze=new Set([".",",","!","?",":",";","\\u060C","\\u061B","\\u061F","\\u0964","\\u0965","\\u104A","\\u104B","\\u104C","\\u104D","\\u104F",")","]","}","%",\'"\',"\\u201D","\\u2019","\\xBB","\\u203A","\\u2026"]),bm=new Set([":",".","\\u060C","\\u061B"]),ym=new Set(["\\u104F"]),Sm=new Set(["\\u201D","\\u2019","\\xBB","\\u203A","\\u300D","\\u300F","\\u3011","\\u300B","\\u3009","\\u3015","\\uFF09"]);function Em(e){if(Cr(e))return!0;let t=!1;for(let n of e){if(Ze.has(n)){t=!0;continue}if(!(t&&Vn.test(n)))return!1}return t}function Am(e){for(let t of e)if(!jn.has(t)&&!Ze.has(t))return!1;return e.length>0}function wm(e){if(Cr(e))return!0;for(let t of e)if(!sn.has(t)&&!wr.has(t)&&!Vn.test(t))return!1;return e.length>0}function Cr(e){let t=!1;for(let n of e)if(!(n==="\\\\"||Vn.test(n))){if(sn.has(n)||Ze.has(n)||wr.has(n)){t=!0;continue}return!1}return t}function dl(e,t){let n=t-1;if(n<=0)return Math.max(n,0);let i=e.charCodeAt(n);if(i<56320||i>57343)return n;let r=n-1;if(r<0)return n;let o=e.charCodeAt(r);return o>=55296&&o<=56319?r:n}function qn(e){if(e.length===0)return null;let t=dl(e,e.length);return e.slice(t)}function Cm(e){let t=Array.from(e),n=t.length;for(;n>0;){let i=t[n-1];if(Vn.test(i)){n--;continue}if(sn.has(i)||wr.has(i)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Fm(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="\\u2014"?e:null}function ol(e,t,n,i){let r=t[i],o=e[i];if(r==null)return o;let a=n[i];if(o.length===a)return o;let u=r.repeat(a);return e[i]=u,u}function sl(e,t){return e&&t!==null&&bm.has(t)}function _m(e){let t=qn(e);return t!==null&&ym.has(t)}function Tm(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 $n(e){let t=e.length;for(;t>0;){let n=dl(e,t),i=e.slice(n,t);if(Sm.has(i))return!0;if(!Ze.has(i))return!1;t=n}return!1}function vm(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`\n`)return"hard-break"}return e===" "?"space":e==="\\xA0"||e==="\\u202F"||e==="\\u2060"||e==="\\uFEFF"?"glue":e==="\\u200B"?"zero-width-break":e==="\\xAD"?"soft-hyphen":"text"}var Mm=/[\\x20\\t\\n\\xA0\\xAD\\u200B\\u202F\\u2060\\uFEFF]/;function ve(e){return e.length===1?e[0]:e.join("")}function Nm(e,t){let n=[];for(let i=e.length-1;i>=0;i--)n.push(e[i]);return n.push(t),ve(n)}function Lm(e,t,n,i){if(!Mm.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];let r=[],o=null,a=[],u=n,s=!1,l=0;for(let d of e){let m=vm(d,i),f=m==="text"&&t;if(o!==null&&m===o&&f===s){a.push(d),l+=d.length;continue}o!==null&&r.push({text:ve(a),isWordLike:s,kind:o,start:u}),o=m,a=[d],u=n+l,s=f,l+=d.length}return o!==null&&r.push({text:ve(a),isWordLike:s,kind:o,start:u}),r}function Ar(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var Rm=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function km(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:Rm.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Dm(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Im(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"||!km(e,a))continue;let u=[t[a]],s=a+1;for(;s<e.len&&!Ar(i[s]);){u.push(t[s]),n[a]=!0;let l=t[s].includes("?");if(i[s]="text",t[s]="",s++,l)break}t[a]=ve(u)}let o=0;for(let a=0;a<t.length;a++){let u=t[a];u.length!==0&&(o!==a&&(t[o]=u,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 Pm(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]),!Dm(a))continue;let u=o+1;if(u>=e.len||Ar(e.kinds[u]))continue;let s=[],l=e.starts[u],d=u;for(;d<e.len&&!Ar(e.kinds[d]);)s.push(e.texts[d]),d++;s.length>0&&(t.push(ve(s)),n.push(!0),i.push("text"),r.push(l),o=d-1)}return{len:t.length,texts:t,isWordLike:n,kinds:i,starts:r}}var Om=new Set([":","-","/","\\xD7",",",".","+","\\u2013","\\u2014"]),al=/^[A-Za-z0-9_]+[,:;]*$/,ll=/[,:;]+$/;function fl(e){for(let t of e)if(cl.test(t))return!0;return!1}function on(e){if(e.length===0)return!1;for(let t of e)if(!(cl.test(t)||Om.has(t)))return!1;return!0}function Bm(e){let t=[],n=[],i=[],r=[];for(let o=0;o<e.len;o++){let a=e.texts[o],u=e.kinds[o];if(u==="text"&&on(a)&&fl(a)){let s=[a],l=o+1;for(;l<e.len&&e.kinds[l]==="text"&&on(e.texts[l]);)s.push(e.texts[l]),l++;t.push(ve(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(u),r.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:i,starts:r}}function Hm(e){let t=[],n=[],i=[],r=[];for(let o=0;o<e.len;o++){let a=e.texts[o],u=e.kinds[o],s=e.isWordLike[o];if(u==="text"&&s&&al.test(a)){let l=[a],d=ll.test(a),m=o+1;for(;d&&m<e.len&&e.kinds[m]==="text"&&e.isWordLike[m]&&al.test(e.texts[m]);){let f=e.texts[m];l.push(f),d=ll.test(f),m++}t.push(ve(l)),n.push(!0),i.push("text"),r.push(e.starts[o]),o=m-1;continue}t.push(a),n.push(s),i.push(u),r.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:i,starts:r}}function Gm(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 u=a.split("-"),s=u.length>1;for(let l=0;l<u.length;l++){let d=u[l];if(!s)break;(d.length===0||!fl(d)||!on(d))&&(s=!1)}if(s){let l=0;for(let d=0;d<u.length;d++){let m=u[d],f=d<u.length-1?`${m}-`:m;t.push(f),n.push(!0),i.push("text"),r.push(e.starts[o]+l),l+=f.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 Wm(e){let t=[],n=[],i=[],r=[],o=0;for(;o<e.len;){let a=[e.texts[o]],u=e.isWordLike[o],s=e.kinds[o],l=e.starts[o];if(s==="glue"){let d=[a[0]],m=l;for(o++;o<e.len&&e.kinds[o]==="glue";)d.push(e.texts[o]),o++;let f=ve(d);if(o<e.len&&e.kinds[o]==="text")a[0]=f,a.push(e.texts[o]),u=e.isWordLike[o],s="text",l=m,o++;else{t.push(f),n.push(!1),i.push("glue"),r.push(m);continue}}else o++;if(s==="text")for(;o<e.len&&e.kinds[o]==="glue";){let d=[];for(;o<e.len&&e.kinds[o]==="glue";)d.push(e.texts[o]),o++;let m=ve(d);if(o<e.len&&e.kinds[o]==="text"){a.push(m,e.texts[o]),u=u||e.isWordLike[o],o++;continue}a.push(m)}t.push(ve(a)),n.push(u),i.push(s),r.push(l)}return{len:t.length,texts:t,isWordLike:n,kinds:i,starts:r}}function Um(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=Cm(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 ul(e,t,n){let i=fm(),r=0,o=[],a=[],u=[],s=[],l=[],d=[],m=[],f=[],x=[],S=[],y=[],b=[];for(let T of i.segment(e))for(let w of Lm(T.segment,T.isWordLike??!1,T.index,n)){let re=function(){d[D]!==null&&(a[D]=[ol(o,d,m,D)],d[D]=null),a[D].push(w.text),u[D]=u[D]||w.isWordLike,f[D]=f[D]||v,x[D]=x[D]||R,S[D]=W,y[D]=ie,b[D]=sl(x[D],V)},C=w.kind==="text",F=Fm(w.text,w.isWordLike,w.kind),v=Ie(w.text),R=il(w.text),V=qn(w.text),W=$n(w.text),ie=_m(w.text),D=r-1;t.carryCJKAfterClosingQuote&&C&&r>0&&s[D]==="text"&&v&&f[D]&&S[D]||C&&r>0&&s[D]==="text"&&Am(w.text)&&f[D]||C&&r>0&&s[D]==="text"&&y[D]?re():C&&r>0&&s[D]==="text"&&w.isWordLike&&R&&b[D]?(re(),u[D]=!0):F!==null&&r>0&&s[D]==="text"&&d[D]===F?m[D]=(m[D]??1)+1:C&&!w.isWordLike&&r>0&&s[D]==="text"&&(Em(w.text)||w.text==="-"&&u[D])?re():(o[r]=w.text,a[r]=[w.text],u[r]=w.isWordLike,s[r]=w.kind,l[r]=w.start,d[r]=F,m[r]=F===null?0:1,f[r]=v,x[r]=R,S[r]=W,y[r]=ie,b[r]=sl(R,V),r++)}for(let T=0;T<r;T++){if(d[T]!==null){o[T]=ol(o,d,m,T);continue}o[T]=ve(a[T])}for(let T=1;T<r;T++)s[T]==="text"&&!u[T]&&Cr(o[T])&&s[T-1]==="text"&&(o[T-1]+=o[T],u[T-1]=u[T-1]||u[T],o[T]="");let A=Array.from({length:r},()=>null),_=-1;for(let T=r-1;T>=0;T--){let w=o[T];if(w.length!==0){if(s[T]==="text"&&!u[T]&&wm(w)&&_>=0&&s[_]==="text"){let C=A[_]??[];C.push(w),A[_]=C,l[_]=l[T],o[T]="";continue}_=T}}for(let T=0;T<r;T++){let w=A[T];w!=null&&(o[T]=Nm(w,o[T]))}let N=0;for(let T=0;T<r;T++){let w=o[T];w.length!==0&&(N!==T&&(o[N]=w,u[N]=u[T],s[N]=s[T],l[N]=l[T]),N++)}o.length=N,u.length=N,s.length=N,l.length=N;let $=Wm({len:N,texts:o,isWordLike:u,kinds:s,starts:l}),P=Um(Hm(Gm(Bm(Pm(Im($))))));for(let T=0;T<P.len-1;T++){let w=Tm(P.texts[T]);w!==null&&(P.kinds[T]!=="space"&&P.kinds[T]!=="preserved-space"||P.kinds[T+1]!=="text"||!il(P.texts[T+1])||(P.texts[T]=w.space,P.isWordLike[T]=!1,P.kinds[T]=P.kinds[T]==="preserved-space"?"preserved-space":"space",P.texts[T+1]=w.marks+P.texts[T+1],P.starts[T+1]=P.starts[T]+w.space.length))}return P}function Vm(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 zm(e){if(e.len<=1)return e;let t=[],n=[],i=[],r=[],o=null,a=!1,u=0,s=!1,l=!1;function d(){o!==null&&(t.push(ve(o)),n.push(a),i.push("text"),r.push(u),o=null)}for(let m=0;m<e.len;m++){let f=e.texts[m],x=e.kinds[m],S=e.isWordLike[m],y=e.starts[m];if(x==="text"){let b=gm(f),A=zn(f);if(o!==null&&s&&l){o.push(f),a=a||S,s=s||b,l=A;continue}d(),o=[f],a=S,u=y,s=b,l=A;continue}d(),t.push(f),n.push(S),i.push(x),r.push(y)}return d(),{len:t.length,texts:t,isWordLike:n,kinds:i,starts:r}}function ml(e,t,n="normal",i="normal"){let r=lm(n),o=r.mode==="pre-wrap"?cm(e):um(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let a=i==="keep-all"?zm(ul(o,t,r)):ul(o,t,r);return{normalized:o,chunks:Vm(a,r),...a}}var xt=null,pl=new Map,bt=null,jm=96,qm=/\\p{Emoji_Presentation}/u,$m=/[\\p{Emoji_Presentation}\\p{Extended_Pictographic}\\p{Regional_Indicator}\\uFE0F\\u20E3]/u,Fr=null,hl=new Map;function _r(){if(xt!==null)return xt;if(typeof OffscreenCanvas<"u")return xt=new OffscreenCanvas(1,1).getContext("2d"),xt;if(typeof document<"u")return xt=document.createElement("canvas").getContext("2d"),xt;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Km(e){let t=pl.get(e);return t||(t=new Map,pl.set(e,t)),t}function je(e,t){let n=t.get(e);return n===void 0&&(n={width:_r().measureText(e).width,containsCJK:Ie(e)},t.set(e,n)),n}function yt(){if(bt!==null)return bt;if(typeof navigator>"u")return bt={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},bt;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 bt={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:i,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},bt}function Jm(e){let t=e.match(/(\\d+(?:\\.\\d+)?)\\s*px/);return t?parseFloat(t[1]):16}function gl(){return Fr===null&&(Fr=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Fr}function Xm(e){return qm.test(e)||e.includes("\\uFE0F")}function xl(e){return $m.test(e)}function Ym(e,t){let n=hl.get(e);if(n!==void 0)return n;let i=_r();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 hl.set(e,n),n}function Qm(e){let t=0,n=gl();for(let i of n.segment(e))Xm(i.segment)&&t++;return t}function Zm(e,t){return t.emojiCount===void 0&&(t.emojiCount=Qm(e)),t.emojiCount}function et(e,t,n){return n===0?t.width:t.width-Zm(e,t)*n}function bl(e,t,n,i,r){if(t.breakableFitAdvances!==void 0)return t.breakableFitAdvances;let o=gl(),a=[];for(let d of o.segment(e))a.push(d.segment);if(a.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(r==="sum-graphemes"){let d=[];for(let m of a){let f=je(m,n);d.push(et(m,f,i))}return t.breakableFitAdvances=d,t.breakableFitAdvances}if(r==="pair-context"||a.length>jm){let d=[],m=null,f=0;for(let x of a){let S=je(x,n),y=et(x,S,i);if(m===null)d.push(y);else{let b=m+x,A=je(b,n);d.push(et(b,A,i)-f)}m=x,f=y}return t.breakableFitAdvances=d,t.breakableFitAdvances}let u=[],s="",l=0;for(let d of a){s+=d;let m=je(s,n),f=et(s,m,i);u.push(f-l),l=f}return t.breakableFitAdvances=u,t.breakableFitAdvances}function yl(e,t){let n=_r();n.font=e;let i=Km(e),r=Jm(e),o=t?Ym(e,r):0;return{cache:i,fontSize:r,emojiCorrection:o}}function ep(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 tp(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function np(e,t,n,i,r){let o=0,a=t;for(;o<e.length;){let u=a+e[o];if((o+1<e.length?u+r:u)>n+i)break;a=u,o++}return{fitCount:o,fittedWidth:a}}function Sl(e,t){return e.simpleLineWalkFastPath?El(e,t):Al(e,t)}function El(e,t,n){let{widths:i,kinds:r,breakableFitAdvances:o}=e;if(i.length===0)return 0;let u=yt().lineFitEpsilon,s=t+u,l=0,d=0,m=!1,f=0,x=0,S=0,y=0,b=-1,A=0;function _(){b=-1,A=0}function N(F=S,v=y,R=d){l++,n?.({startSegmentIndex:f,startGraphemeIndex:x,endSegmentIndex:F,endGraphemeIndex:v,width:R}),d=0,m=!1,_()}function $(F,v){m=!0,f=F,x=0,S=F+1,y=0,d=v}function P(F,v,R){m=!0,f=F,x=v,S=F,y=v+1,d=R}function T(F,v){if(!m){$(F,v);return}d+=v,S=F+1,y=0}function w(F,v){let R=o[F];for(let V=v;V<R.length;V++){let W=R[V];m?d+W>s?(N(),P(F,V,W)):(d+=W,S=F,y=V+1):P(F,V,W)}m&&S===F&&y===R.length&&(S=F+1,y=0)}let C=0;for(;C<i.length&&!(!m&&(C=ep(e,C),C>=i.length));){let F=i[C],v=r[C],R=v==="space"||v==="preserved-space"||v==="tab"||v==="zero-width-break"||v==="soft-hyphen";if(!m){F>t&&o[C]!==null?w(C,0):$(C,F),R&&(b=C+1,A=d-F),C++;continue}if(d+F>s){if(R){T(C,F),N(C+1,0,d-F),C++;continue}if(b>=0){if(S>b||S===b&&y>0){N();continue}N(b,0,A);continue}if(F>t&&o[C]!==null){N(),w(C,0),C++;continue}N();continue}T(C,F),R&&(b=C+1,A=d-F),C++}return m&&N(),l}function Al(e,t,n){if(e.simpleLineWalkFastPath)return El(e,t,n);let{widths:i,lineEndFitAdvances:r,lineEndPaintAdvances:o,kinds:a,breakableFitAdvances:u,discretionaryHyphenWidth:s,tabStopAdvance:l,chunks:d}=e;if(i.length===0||d.length===0)return 0;let m=yt(),f=m.lineFitEpsilon,x=t+f,S=0,y=0,b=!1,A=0,_=0,N=0,$=0,P=-1,T=0,w=0,C=null;function F(){P=-1,T=0,w=0,C=null}function v(z=N,X=$,O=y){S++,n?.({startSegmentIndex:A,startGraphemeIndex:_,endSegmentIndex:z,endGraphemeIndex:X,width:O}),y=0,b=!1,F()}function R(z,X){b=!0,A=z,_=0,N=z+1,$=0,y=X}function V(z,X,O){b=!0,A=z,_=X,N=z,$=X+1,y=O}function W(z,X){if(!b){R(z,X);return}y+=X,N=z+1,$=0}function ie(z,X,O,U){if(!X)return;let _e=z==="tab"?0:r[O],B=z==="tab"?U:o[O];P=O+1,T=y-U+_e,w=y-U+B,C=z}function D(z,X){let O=u[z];for(let U=X;U<O.length;U++){let _e=O[U];b?y+_e>x?(v(),V(z,U,_e)):(y+=_e,N=z,$=U+1):V(z,U,_e)}b&&N===z&&$===O.length&&(N=z+1,$=0)}function re(z){if(C!=="soft-hyphen")return!1;let X=u[z];if(X==null)return!1;let{fitCount:O,fittedWidth:U}=np(X,y,t,f,s);return O===0?!1:(y=U,N=z,$=O,F(),O===X.length?(N=z+1,$=0,!0):(v(z,O,U+s),D(z,O),!0))}function Fe(z){S++,n?.({startSegmentIndex:z.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:z.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),F()}for(let z=0;z<d.length;z++){let X=d[z];if(X.startSegmentIndex===X.endSegmentIndex){Fe(X);continue}b=!1,y=0,A=X.startSegmentIndex,_=0,N=X.startSegmentIndex,$=0,F();let O=X.startSegmentIndex;for(;O<X.endSegmentIndex;){let U=a[O],_e=U==="space"||U==="preserved-space"||U==="tab"||U==="zero-width-break"||U==="soft-hyphen",B=U==="tab"?tp(y,l):i[O];if(U==="soft-hyphen"){b&&(N=O+1,$=0,P=O+1,T=y+s,w=y+s,C=U),O++;continue}if(!b){B>t&&u[O]!==null?D(O,0):R(O,B),ie(U,_e,O,B),O++;continue}if(y+B>x){let H=y+(U==="tab"?0:r[O]),le=y+(U==="tab"?B:o[O]);if(C==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&T<=x){v(P,0,w);continue}if(C==="soft-hyphen"&&re(O)){O++;continue}if(_e&&H<=x){W(O,B),v(O+1,0,le),O++;continue}if(P>=0&&T<=x){if(N>P||N===P&&$>0){v();continue}let se=P;v(se,0,w),O=se;continue}if(B>t&&u[O]!==null){v(),D(O,0),O++;continue}v();continue}W(O,B),ie(U,_e,O,B),O++}if(b){let U=P===X.consumedEndSegmentIndex?w:y;v(X.consumedEndSegmentIndex,0,U)}}return S}var Tr=null;function ip(){return Tr===null&&(Tr=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Tr}function rp(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 op(e,t){let n=[],i=[],r=0,o=!1,a=!1,u=!1;function s(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:r}),i=[],o=!1,a=!1,u=!1)}function l(m,f,x){i=[m],r=f,o=x,a=$n(m),u=sn.has(m)}function d(m,f){i.push(m),o=o||f;let x=$n(m);m.length===1&&Ze.has(m)?a=a||x:a=x,u=!1}for(let m of ip().segment(e)){let f=m.segment,x=Ie(f);if(i.length===0){l(f,m.index,x);continue}if(u||jn.has(f)||Ze.has(f)||t.carryCJKAfterClosingQuote&&x&&a){d(f,x);continue}if(!o&&!x){d(f,x);continue}s(),l(f,m.index,x)}return s(),n}function sp(e){if(e.length<=1)return e;let t=[],n=[e[0].text],i=e[0].start,r=Ie(e[0].text),o=zn(e[0].text);function a(){t.push({text:n.length===1?n[0]:n.join(""),start:i})}for(let u=1;u<e.length;u++){let s=e[u],l=Ie(s.text),d=zn(s.text);if(r&&o){n.push(s.text),r=r||l,o=d;continue}a(),n=[s.text],i=s.start,r=l,o=d}return a(),t}function ap(e,t,n,i){let r=yt(),{cache:o,emojiCorrection:a}=yl(t,xl(e.normalized)),u=et("-",je("-",o),a),l=et(" ",je(" ",o),a)*8;if(e.len===0)return rp(n);let d=[],m=[],f=[],x=[],S=e.chunks.length<=1,y=n?[]:null,b=[],A=n?[]:null,_=Array.from({length:e.len});function N(w,C,F,v,R,V,W){R!=="text"&&R!=="space"&&R!=="zero-width-break"&&(S=!1),d.push(C),m.push(F),f.push(v),x.push(R),y?.push(V),b.push(W),A!==null&&A.push(w)}function $(w,C,F,v,R){let V=je(w,o),W=et(w,V,a),ie=C==="space"||C==="preserved-space"||C==="zero-width-break"?0:W,D=C==="space"||C==="zero-width-break"?0:W;if(R&&v&&w.length>1){let re="sum-graphemes";on(w)?re="pair-context":r.preferPrefixWidthsForBreakableRuns&&(re="segment-prefixes");let Fe=bl(w,V,o,a,re);N(w,W,ie,D,C,F,Fe);return}N(w,W,ie,D,C,F,null)}for(let w=0;w<e.len;w++){_[w]=d.length;let C=e.texts[w],F=e.isWordLike[w],v=e.kinds[w],R=e.starts[w];if(v==="soft-hyphen"){N(C,0,u,u,v,R,null);continue}if(v==="hard-break"){N(C,0,0,0,v,R,null);continue}if(v==="tab"){N(C,0,0,0,v,R,null);continue}let V=je(C,o);if(v==="text"&&V.containsCJK){let W=op(C,r),ie=i==="keep-all"?sp(W):W;for(let D=0;D<ie.length;D++){let re=ie[D];$(re.text,"text",R+re.start,F,i==="keep-all"||!Ie(re.text))}continue}$(C,v,R,F,!0)}let P=lp(e.chunks,_,d.length),T=y===null?null:nl(e.normalized,y);return A!==null?{widths:d,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:S,segLevels:T,breakableFitAdvances:b,discretionaryHyphenWidth:u,tabStopAdvance:l,chunks:P,segments:A}:{widths:d,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:S,segLevels:T,breakableFitAdvances:b,discretionaryHyphenWidth:u,tabStopAdvance:l,chunks:P}}function lp(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,u=o.endSegmentIndex<t.length?t[o.endSegmentIndex]:n,s=o.consumedEndSegmentIndex<t.length?t[o.consumedEndSegmentIndex]:n;i.push({startSegmentIndex:a,endSegmentIndex:u,consumedEndSegmentIndex:s})}return i}function up(e,t,n,i){let r=i?.wordBreak??"normal",o=ml(e,yt(),i?.whiteSpace,r);return ap(o,t,n,r)}function wl(e,t,n){return up(e,t,!1,n)}function Cl(e,t,n){let i=Sl(e,t);return{lineCount:i,height:i*n}}var cp={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function Fl(e,t){let n={...cp,...t},i=1.2;for(let r=n.baseFontSize;r>=n.minFontSize;r-=n.step){let o=`${n.fontWeight} ${r}px ${n.fontFamily}`,a=wl(e,o),{lineCount:u}=Cl(a,n.maxWidth,r*i);if(u<=1)return{fontSize:r,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}window.__timelines=window.__timelines||{};Va();window.__hyperframes={fitTextFontSize:Fl,getVariables:Kr};function _l(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,el())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",_l,{once:!0}):_l();})();\n';
56648
+ RUNTIME_IIFE = '"use strict";(()=>{var $l=Object.create;var ai=Object.defineProperty;var Kl=Object.getOwnPropertyDescriptor;var Jl=Object.getOwnPropertyNames;var Xl=Object.getPrototypeOf,Yl=Object.prototype.hasOwnProperty;var Ql=(e,t,n)=>t in e?ai(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 Zl=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Jl(t))!Yl.call(e,r)&&r!==n&&ai(e,r,{get:()=>t[r],enumerable:!(i=Kl(t,r))||i.enumerable});return e};var eu=(e,t,n)=>(n=e!=null?$l(Xl(e)):{},Zl(t||!e||!e.__esModule?ai(n,"default",{value:e,enumerable:!0}):n,e));var he=(e,t,n)=>Ql(e,typeof t!="symbol"?t+"":t,n);var Uo=ee((Dh,Ni)=>{var J=String,Wo=function(){return{isColorSupported:!1,reset:J,bold:J,dim:J,italic:J,underline:J,inverse:J,hidden:J,strikethrough:J,black:J,red:J,green:J,yellow:J,blue:J,magenta:J,cyan:J,white:J,gray:J,bgBlack:J,bgRed:J,bgGreen:J,bgYellow:J,bgBlue:J,bgMagenta:J,bgCyan:J,bgWhite:J,blackBright:J,redBright:J,greenBright:J,yellowBright:J,blueBright:J,magentaBright:J,cyanBright:J,whiteBright:J,bgBlackBright:J,bgRedBright:J,bgGreenBright:J,bgYellowBright:J,bgBlueBright:J,bgMagentaBright:J,bgCyanBright:J,bgWhiteBright:J}};Ni.exports=Wo();Ni.exports.createColors=Wo});var Li=ee(()=>{});var An=ee((Oh,jo)=>{"use strict";var Vo=Uo(),zo=Li(),Gt=class e extends Error{constructor(t,n,i,r,o,a){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),r&&(this.source=r),a&&(this.plugin=a),typeof n<"u"&&typeof i<"u"&&(typeof n=="number"?(this.line=n,this.column=i):(this.line=n.line,this.column=n.column,this.endLine=i.line,this.endColumn=i.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=Vo.isColorSupported);let i=d=>d,r=d=>d,o=d=>d;if(t){let{bold:d,gray:m,red:f}=Vo.createColors(!0);r=x=>d(f(x)),i=x=>m(x),zo&&(o=x=>zo(x))}let a=n.split(/\\r?\\n/),u=Math.max(this.line-3,0),s=Math.min(this.line+2,a.length),l=String(s).length;return a.slice(u,s).map((d,m)=>{let f=u+1+m,x=" "+(" "+f).slice(-l)+" | ";if(f===this.line){if(d.length>160){let y=20,b=Math.max(0,this.column-y),A=Math.max(this.column+y,this.endColumn+y),_=d.slice(b,A),T=i(x.replace(/\\d/g," "))+d.slice(0,Math.min(this.column-1,y-1)).replace(/[^\\t]/g," ");return r(">")+i(x)+o(_)+`\n `+T+r("^")}let S=i(x.replace(/\\d/g," "))+d.slice(0,this.column-1).replace(/[^\\t]/g," ");return r(">")+i(x)+o(d)+`\n `+S+r("^")}return" "+i(x)+o(d)}).join(`\n`)}toString(){let t=this.showSourceCode();return t&&(t=`\n\n`+t+`\n`),this.name+": "+this.message+t}};jo.exports=Gt;Gt.default=Gt});var Ri=ee((Bh,$o)=>{"use strict";var dc=/(<)(\\/?style\\b)/gi,fc=/(<)(!--)/g;function Ke(e){return typeof e!="string"||!e.includes("<")?e:e.replace(dc,"\\\\3c $2").replace(fc,"\\\\3c $2")}var qo={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function mc(e){return e[0].toUpperCase()+e.slice(1)}var Wt=class{constructor(t){this.builder=t}atrule(t,n){let i=t.raws,r="@"+t.name,o=t.params?this.rawValue(t,"params"):"";if(typeof i.afterName<"u"?r+=i.afterName:o&&(r+=" "),t.nodes)this.block(t,r+o);else{let a=(i.between||"")+(n?";":"");this.builder(Ke(r+o+a),t)}}beforeAfter(t,n){let i;t.type==="decl"?i=this.raw(t,null,"beforeDecl"):t.type==="comment"?i=this.raw(t,null,"beforeComment"):n==="before"?i=this.raw(t,null,"beforeRule"):i=this.raw(t,null,"beforeClose");let r=t.parent,o=0;for(;r&&r.type!=="root";)o+=1,r=r.parent;if(i.includes(`\n`)){let a=this.raw(t,null,"indent");if(a.length)for(let u=0;u<o;u++)i+=a}return i}block(t,n){let i=this.raw(t,"between","beforeOpen");this.builder(Ke(n+i)+"{",t,"start");let r;t.nodes&&t.nodes.length?(this.body(t),r=this.raw(t,"after")):r=this.raw(t,"after","emptyBody"),r&&this.builder(Ke(r)),this.builder("}",t,"end")}body(t){let n=t.nodes,i=n.length-1;for(;i>0&&n[i].type==="comment";)i-=1;let r=this.raw(t,"semicolon"),o=t.type==="document";for(let a=0;a<n.length;a++){let u=n[a],s=this.raw(u,"before");s&&this.builder(o?s:Ke(s)),this.stringify(u,i!==a||r)}}comment(t){let n=this.raw(t,"left","commentLeft"),i=this.raw(t,"right","commentRight");this.builder(Ke("/*"+n+t.text+i+"*/"),t)}decl(t,n){let i=t.raws,r=this.raw(t,"between","colon"),o=t.prop+r+this.rawValue(t,"value");t.important&&(o+=i.important||" !important"),n&&(o+=";"),this.builder(Ke(o),t)}document(t){this.body(t)}raw(t,n,i){let r;if(i||(i=n),n&&(r=t.raws[n],typeof r<"u"))return r;let o=t.parent;if(i==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return qo[i];let a=t.root(),u=a.rawCache||(a.rawCache={});if(typeof u[i]<"u")return u[i];if(i==="before"||i==="after")return this.beforeAfter(t,i);{let s="raw"+mc(i);this[s]?r=this[s](a,t):a.walk(l=>{if(r=l.raws[n],typeof r<"u")return!1})}return typeof r>"u"&&(r=qo[i]),u[i]=r,r}rawBeforeClose(t){let n;return t.walk(i=>{if(i.nodes&&i.nodes.length>0&&typeof i.raws.after<"u")return n=i.raws.after,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawBeforeComment(t,n){let i;return t.walkComments(r=>{if(typeof r.raws.before<"u")return i=r.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(n,null,"beforeDecl"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeDecl(t,n){let i;return t.walkDecls(r=>{if(typeof r.raws.before<"u")return i=r.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(n,null,"beforeRule"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeOpen(t){let n;return t.walk(i=>{if(i.type!=="decl"&&(n=i.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(t){let n;return t.walk(i=>{if(i.nodes&&(i.parent!==t||t.first!==i)&&typeof i.raws.before<"u")return n=i.raws.before,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawColon(t){let n;return t.walkDecls(i=>{if(typeof i.raws.between<"u")return n=i.raws.between.replace(/[^\\s:]/g,""),!1}),n}rawEmptyBody(t){let n;return t.walk(i=>{if(i.nodes&&i.nodes.length===0&&(n=i.raws.after,typeof n<"u"))return!1}),n}rawIndent(t){if(t.raws.indent)return t.raws.indent;let n;return t.walk(i=>{let r=i.parent;if(r&&r!==t&&r.parent&&r.parent===t&&typeof i.raws.before<"u"){let o=i.raws.before.split(`\n`);return n=o[o.length-1],n=n.replace(/\\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(n=i.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let i=t[n],r=t.raws[n];return r&&r.value===i?r.raw:i}root(t){if(this.body(t),t.raws.after){let n=t.raws.after,i=t.parent&&t.parent.type==="document";this.builder(i?n:Ke(n))}}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(Ke(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)}};$o.exports=Wt;Wt.default=Wt});var Ut=ee((Hh,Ko)=>{"use strict";var pc=Ri();function ki(e,t){new pc(t).stringify(e)}Ko.exports=ki;ki.default=ki});var wn=ee((Gh,Di)=>{"use strict";Di.exports.isClean=Symbol("isClean");Di.exports.my=Symbol("my")});var jt=ee((Wh,Jo)=>{"use strict";var hc=An(),gc=Ri(),xc=Ut(),{isClean:Vt,my:bc}=wn();function Ii(e,t){let n=new e.constructor;for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i)||i==="proxyCache")continue;let r=e[i],o=typeof r;i==="parent"&&o==="object"?t&&(n[i]=t):i==="source"?n[i]=r:Array.isArray(r)?n[i]=r.map(a=>Ii(a,n)):(o==="object"&&r!==null&&(r=Ii(r)),n[i]=r)}return n}function Ve(e,t){if(t&&typeof t.offset<"u")return t.offset;let n=1,i=1,r=0;for(let o=0;o<e.length;o++){if(i===t.line&&n===t.column){r=o;break}e[o]===`\n`?(n=1,i+=1):n+=1}return r}var zt=class{get proxyOf(){return this}constructor(t={}){this.raws={},this[Vt]=!1,this[bc]=!0;for(let n in t)if(n==="nodes"){this.nodes=[];for(let i of t[n])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}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=Ii(this);for(let i in t)n[i]=t[i];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:i,start:r}=this.rangeBy(n);return this.source.input.error(t,{column:r.column,line:r.line},{column:i.column,line:i.line},n)}return new hc(t)}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:n==="root"?()=>t.root().toProxy():t[n]},set(t,n,i){return t[n]===i||(t[n]=i,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&t.markDirty()),!0}}}markClean(){this[Vt]=!0}markDirty(){if(this[Vt]){this[Vt]=!1;let t=this;for(;t=t.parent;)t[Vt]=!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 i="document"in this.source.input?this.source.input.document:this.source.input.css,o=i.slice(Ve(i,this.source.start),Ve(i,this.source.end)).indexOf(t.word);o!==-1&&(n=this.positionInside(o))}return n}positionInside(t){let n=this.source.start.column,i=this.source.start.line,r="document"in this.source.input?this.source.input.document:this.source.input.css,o=Ve(r,this.source.start),a=o+t;for(let u=o;u<a;u++)r[u]===`\n`?(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:Ve(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:Ve(n,this.source.end)+1}:{column:i.column+1,line:i.line,offset:i.offset+1};if(t.word){let a=n.slice(Ve(n,this.source.start),Ve(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:Ve(n,t.start)}:t.index&&(i=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line,offset:Ve(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 gc().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 u=this[a];if(Array.isArray(u))i[a]=u.map(s=>typeof s=="object"&&s.toJSON?s.toJSON(null,n):s);else if(typeof u=="object"&&u.toJSON)i[a]=u.toJSON(null,n);else if(a==="source"){if(u==null)continue;let s=n.get(u.input);s==null&&(s=o,n.set(u.input,o),o++),i[a]={end:u.end,inputId:s,start:u.start}}else i[a]=u}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=xc){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)}};Jo.exports=zt;zt.default=zt});var $t=ee((Uh,Xo)=>{"use strict";var yc=jt(),qt=class extends yc{constructor(t){super(t),this.type="comment"}};Xo.exports=qt;qt.default=qt});var Jt=ee((Vh,Yo)=>{"use strict";var Sc=jt(),Kt=class extends Sc{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"}};Yo.exports=Kt;Kt.default=Kt});var Je=ee((zh,ss)=>{"use strict";var Qo=$t(),Zo=Jt(),Ec=jt(),{isClean:es,my:ts}=wn(),Pi,ns,is,Oi;function rs(e){return e.map(t=>(t.nodes&&(t.nodes=rs(t.nodes)),delete t.source,t))}function os(e){if(e[es]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)os(t)}var ke=class e extends Ec{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 u of o)this.proxyOf.nodes.splice(i,0,u);let a;for(let u in this.indexes)a=this.indexes[u],i<=a&&(this.indexes[u]=a+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=rs(ns(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 Zo(t)]}else if(t.selector||t.selectors)t=[new Oi(t)];else if(t.name)t=[new Pi(t)];else if(t.text)t=[new Qo(t)];else throw new Error("Unknown node type in node creation");return t.map(r=>(r[ts]||e.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[es]&&os(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=>{ns=e};ke.registerRule=e=>{Oi=e};ke.registerAtRule=e=>{Pi=e};ke.registerRoot=e=>{is=e};ss.exports=ke;ke.default=ke;ke.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Pi.prototype):e.type==="rule"?Object.setPrototypeOf(e,Oi.prototype):e.type==="decl"?Object.setPrototypeOf(e,Zo.prototype):e.type==="comment"?Object.setPrototypeOf(e,Qo.prototype):e.type==="root"&&Object.setPrototypeOf(e,is.prototype),e[ts]=!0,e.nodes&&e.nodes.forEach(t=>{ke.rebuild(t)})}});var Cn=ee((jh,ls)=>{"use strict";var as=Je(),mt=class extends as{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)}};ls.exports=mt;mt.default=mt;as.registerAtRule(mt)});var Fn=ee((qh,ds)=>{"use strict";var Ac=Je(),us,cs,at=class extends Ac{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new us(new cs,this,t).stringify()}};at.registerLazyResult=e=>{us=e};at.registerProcessor=e=>{cs=e};ds.exports=at;at.default=at});var ms=ee(($h,fs)=>{var wc="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Cc=(e,t=21)=>(n=t)=>{let i="",r=n|0;for(;r--;)i+=e[Math.random()*e.length|0];return i},Fc=(e=21)=>{let t="",n=e|0;for(;n--;)t+=wc[Math.random()*64|0];return t};fs.exports={nanoid:Fc,customAlphabet:Cc}});var _n=ee(()=>{});var vn=ee(()=>{});var Bi=ee(()=>{});var ps=ee(()=>{});var Gi=ee((n0,xs)=>{"use strict";var{existsSync:_c,readFileSync:vc}=ps(),{dirname:Hi,join:Tc}=_n(),{SourceMapConsumer:hs,SourceMapGenerator:gs}=vn();function Mc(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var Xt=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=Hi(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new hs(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 u=t.match(n)||t.match(i);if(u)return Mc(t.substr(u[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=Hi(t),_c(t)))return this.mapFile=t,vc(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 hs)return gs.fromSourceMap(n).toString();if(n instanceof gs)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=Tc(Hi(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)}};xs.exports=Xt;Xt.default=Xt});var Yt=ee((i0,As)=>{"use strict";var{nanoid:Nc}=ms(),{isAbsolute:Vi,resolve:zi}=_n(),{SourceMapConsumer:Lc,SourceMapGenerator:Rc}=vn(),{fileURLToPath:bs,pathToFileURL:Tn}=Bi(),ys=An(),kc=Gi(),Wi=Li(),Ui=Symbol("lineToIndexCache"),Dc=!!(Lc&&Rc),Ss=!!(zi&&Vi);function Es(e){if(e[Ui])return e[Ui];let t=e.css.split(`\n`),n=new Array(t.length),i=0;for(let r=0,o=t.length;r<o;r++)n[r]=i,i+=t[r].length+1;return e[Ui]=n,n}var pt=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&&(!Ss||/^\\w+:\\/\\//.test(n.from)||Vi(n.from)?this.file=n.from:this.file=zi(n.from)),Ss&&Dc){let i=new kc(this.css,n);if(i.text){this.map=i;let r=i.consumer().file;!this.file&&r&&(this.file=this.mapResolve(r))}}this.file||(this.id="<input css "+Nc(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,i,r={}){let o,a,u,s,l;if(n&&typeof n=="object"){let m=n,f=i;if(typeof m.offset=="number"){s=m.offset;let x=this.fromOffset(s);n=x.line,i=x.col}else n=m.line,i=m.column,s=this.fromLineAndColumn(n,i);if(typeof f.offset=="number"){u=f.offset;let x=this.fromOffset(u);a=x.line,o=x.col}else a=f.line,o=f.column,u=this.fromLineAndColumn(f.line,f.column)}else if(i)s=this.fromLineAndColumn(n,i);else{s=n;let m=this.fromOffset(s);n=m.line,i=m.col}let d=this.origin(n,i,a,o);return d?l=new ys(t,d.endLine===void 0?d.line:{column:d.column,line:d.line},d.endLine===void 0?d.column:{column:d.endColumn,line:d.endLine},d.source,d.file,r.plugin):l=new ys(t,a===void 0?n:{column:i,line:n},a===void 0?i:{column:o,line:a},this.css,this.file,r.plugin),l.input={column:i,endColumn:o,endLine:a,endOffset:u,line:n,offset:s,source:this.css},this.file&&(Tn&&(l.input.url=Tn(this.file).toString()),l.input.file=this.file),l}fromLineAndColumn(t,n){return Es(this)[t-1]+n-1}fromOffset(t){let n=Es(this),i=n[n.length-1],r=0;if(t>=i)r=n.length-1;else{let o=n.length-2,a;for(;r<o;)if(a=r+(o-r>>1),t<n[a])o=a-1;else if(t>=n[a+1])r=a+1;else{r=a;break}}return{col:t-n[r]+1,line:r+1}}mapResolve(t){return/^\\w+:\\/\\//.test(t)?t:zi(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,i,r){if(!this.map)return!1;let o=this.map.consumer(),a=o.originalPositionFor({column:n,line:t});if(!a.source)return!1;let u;typeof i=="number"&&(u=o.originalPositionFor({column:r,line:i}));let s;Vi(a.source)?s=Tn(a.source):s=new URL(a.source,this.map.consumer().sourceRoot||Tn(this.map.mapFile));let l={column:a.column,endColumn:u&&u.column,endLine:u&&u.line,line:a.line,url:s.toString()};if(s.protocol==="file:")if(bs)l.file=bs(s);else throw new Error("file: protocol is not available in this PostCSS build");let d=o.sourceContentFor(a.source);return d&&(l.source=d),l}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}};As.exports=pt;pt.default=pt;Wi&&Wi.registerInput&&Wi.registerInput(pt)});var ht=ee((r0,_s)=>{"use strict";var ws=Je(),Cs,Fs,Xe=class extends ws{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,i){let r=super.normalize(t);if(n){if(i==="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 r)o.raws.before=n.raws.before}return r}removeChild(t,n){let i=this.index(t);return!n&&i===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),super.removeChild(t)}toResult(t={}){return new Cs(new Fs,this,t).stringify()}};Xe.registerLazyResult=e=>{Cs=e};Xe.registerProcessor=e=>{Fs=e};_s.exports=Xe;Xe.default=Xe;ws.registerRoot(Xe)});var ji=ee((o0,vs)=>{"use strict";var Qt={comma(e){return Qt.split(e,[","],!0)},space(e){let t=[" ",`\n`," "];return Qt.split(e,t)},split(e,t,n){let i=[],r="",o=!1,a=0,u=!1,s="",l=!1;for(let d of e)l?l=!1:d==="\\\\"?l=!0:u?d===s&&(u=!1):d===\'"\'||d==="\'"?(u=!0,s=d):d==="("?a+=1:d===")"?a>0&&(a-=1):a===0&&t.includes(d)&&(o=!0),o?(r!==""&&i.push(r.trim()),r="",o=!1):r+=d;return(n||r!=="")&&i.push(r.trim()),i}};vs.exports=Qt;Qt.default=Qt});var Mn=ee((s0,Ms)=>{"use strict";var Ts=Je(),Ic=ji(),gt=class extends Ts{get selectors(){return Ic.comma(this.selector)}set selectors(t){let n=this.selector?this.selector.match(/,\\s*/):null,i=n?n[0]:","+this.raw("between","beforeOpen");this.selector=t.join(i)}constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}};Ms.exports=gt;gt.default=gt;Ts.registerRule(gt)});var Ls=ee((a0,Ns)=>{"use strict";var Pc=Cn(),Oc=$t(),Bc=Jt(),Hc=Yt(),Gc=Gi(),Wc=ht(),Uc=Mn();function Zt(e,t){if(Array.isArray(e))return e.map(r=>Zt(r));let{inputs:n,...i}=e;if(n){t=[];for(let r of n){let o={...r,__proto__:Hc.prototype};o.map&&(o.map={...o.map,__proto__:Gc.prototype}),t.push(o)}}if(i.nodes&&(i.nodes=e.nodes.map(r=>Zt(r,t))),i.source){let{inputId:r,...o}=i.source;i.source=o,r!=null&&(i.source.input=t[r])}if(i.type==="root")return new Wc(i);if(i.type==="decl")return new Bc(i);if(i.type==="rule")return new Uc(i);if(i.type==="comment")return new Oc(i);if(i.type==="atrule")return new Pc(i);throw new Error("Unknown node type: "+e.type)}Ns.exports=Zt;Zt.default=Zt});var $i=ee((l0,Os)=>{"use strict";var{dirname:Nn,relative:ks,resolve:Ds,sep:Is}=_n(),{SourceMapConsumer:Ps,SourceMapGenerator:Ln}=vn(),{pathToFileURL:Rs}=Bi(),Vc=Yt(),zc=!!(Ps&&Ln),jc=!!(Nn&&Ds&&ks&&Is),qi=class{constructor(t,n,i,r){this.stringify=t,this.mapOpts=i.map||{},this.root=n,this.opts=i,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let n=`\n`;this.css.includes(`\\r\n`)&&(n=`\\r\n`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),i=t.root||Nn(t.file),r;this.mapOpts.sourcesContent===!1?(r=new Ps(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,n,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let t;for(let n=this.root.nodes.length-1;n>=0;n--)t=this.root.nodes[n],t.type==="comment"&&t.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(n)}else if(this.css){let t;for(;(t=this.css.lastIndexOf("/*#"))!==-1;){let n=this.css.indexOf("*/",t+3);if(n===-1)break;for(;t>0&&this.css[t-1]===`\n`;)t--;this.css=this.css.slice(0,t)+this.css.slice(n+2)}}}}generate(){if(this.clearAnnotation(),jc&&zc&&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=Ln.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Ln({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 Ln({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,i="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,a;this.stringify(this.root,(u,s,l)=>{if(this.css+=u,s&&l!=="end"&&(r.generated.line=t,r.generated.column=n-1,s.source&&s.source.start?(r.source=this.sourcePath(s),r.original.line=s.source.start.line,r.original.column=s.source.start.column-1,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,this.map.addMapping(r))),a=u.match(/\\n/g),a?(t+=a.length,o=u.lastIndexOf(`\n`),n=u.length-o):n+=u.length,s&&l!=="start"){let d=s.parent||{raws:{}};(!(s.type==="decl"||s.type==="atrule"&&!s.nodes)||s!==d.last||d.raws.semicolon)&&(s.source&&s.source.end?(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?Nn(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(i=Nn(Ds(i,this.mapOpts.annotation)));let r=ks(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 Vc(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(Rs){let i=Rs(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;Is==="\\\\"&&(t=t.replace(/\\\\/g,"/"));let i=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,i),i}};Os.exports=qi});var Gs=ee((u0,Hs)=>{"use strict";var Rn=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,kn=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,qc=/.[\\r\\n"\'(/\\\\]/,Bs=/[\\da-f]/i;Hs.exports=function(t,n={}){let i=t.css.valueOf(),r=n.ignoreErrors,o,a,u,s,l,d,m,f,x,S,y=i.length,b=0,A=[],_=[],T=-1;function z(){return b}function P(F){throw t.error("Unclosed "+F,b)}function v(){return _.length===0&&b>=y}function w(F){if(_.length)return _.pop();if(b>=y)return;let L=F?F.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);d=["space",i.slice(b,s)],b=s-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let R=String.fromCharCode(o);d=[R,R,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(m=!1,s=i.indexOf(")",s+1),s===-1)if(r||L){s=b;break}else P("bracket");for(f=s;i.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);d=["brackets",i.slice(b,s+1),b,s],b=s}else b<=T?d=["(","(",b]:(s=i.indexOf(")",b+1),a=i.slice(b,s+1),s===-1||qc.test(a)?(T=s===-1?y:s,d=["(","(",b]):(d=["brackets",a,b,s],b=s));break}case 39:case 34:{l=o===39?"\'":\'"\',s=b;do{if(m=!1,s=i.indexOf(l,s+1),s===-1)if(r||L){s=b+1;break}else P("string");for(f=s;i.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);d=["string",i.slice(b,s+1),b,s],b=s;break}case 64:{Rn.lastIndex=b+1,Rn.test(i),Rn.lastIndex===0?s=i.length-1:s=Rn.lastIndex-2,d=["at-word",i.slice(b,s+1),b,s],b=s;break}case 92:{for(s=b,u=!0;i.charCodeAt(s+1)===92;)s+=1,u=!u;if(o=i.charCodeAt(s+1),u&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(s+=1,Bs.test(i.charAt(s)))){for(;Bs.test(i.charAt(s+1));)s+=1;i.charCodeAt(s+1)===32&&(s+=1)}d=["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||L?s=i.length:P("comment")),d=["comment",i.slice(b,s+1),b,s],b=s):(kn.lastIndex=b+1,kn.test(i),kn.lastIndex===0?s=i.length-1:s=kn.lastIndex-2,d=["word",i.slice(b,s+1),b,s],A.push(d),b=s);break}}return b++,d}function C(F){_.push(F)}return{back:C,endOfFile:v,nextToken:w,position:z}}});var zs=ee((c0,Vs)=>{"use strict";var $c=Cn(),Kc=$t(),Jc=Jt(),Xc=ht(),Ws=Mn(),Yc=Gs(),Us={empty:!0,space:!0};function Qc(e){for(let t=e.length-1;t>=0;t--){let n=e[t],i=n[3]||n[2];if(i)return i}}var Ki=class{constructor(t){this.input=t,this.root=new Xc,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 $c;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let i,r,o,a=!1,u=!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==="{"){u=!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=""),u&&(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,u]of t.entries()){if(r=u,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 Kc;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=Yc(this.input)}decl(t,n){let i=new Jc;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]||Qc(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=[],u;for(;t.length&&(u=t[0][0],!(u!=="space"&&u!=="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 d=this.stringFrom(t,l);d=this.spacesFromEnd(t)+d,d!==" !important"&&(i.raws.important=d);break}else if(o[1].toLowerCase()==="important"){let d=t.slice(0),m="";for(let f=l;f>0;f--){let x=d[f][0];if(m.trim().startsWith("!")&&x!=="space")break;m=d.pop()[1]+m}m.trim().startsWith("!")&&(i.important=!0,i.raws.important=m,t=d)}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 Ws;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=[],u=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(u&&r&&i==="{")o||(o=l),a.push("}");else if(a.length===0)if(i===";")if(r){this.decl(s,u);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(!u)for(;s.length&&(l=s[s.length-1][0],!(l!=="space"&&l!=="comment"));)this.tokenizer.back(s.pop());this.decl(s,u)}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,u=i.length,s="",l=!0,d,m;for(let f=0;f<u;f+=1)o=i[f],a=o[0],a==="space"&&f===u-1&&!r?l=!1:a==="comment"?(m=i[f-1]?i[f-1][0]:"empty",d=i[f+1]?i[f+1][0]:"empty",!Us[m]&&!Us[d]?s.slice(-1)===","?l=!1:s+=o[1]:l=!1):s+=o[1];if(!l){let f=i.reduce((x,S)=>x+S[1],"");t.raws[n]={raw:f,value:s}}t[n]=s}rule(t){t.pop();let n=new Ws;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})}};Vs.exports=Ki});var In=ee((d0,js)=>{"use strict";var Zc=Je(),ed=Yt(),td=zs();function Dn(e,t){let n=new ed(e,t),i=new td(n);try{i.parse()}catch(r){throw r}return i.root}js.exports=Dn;Dn.default=Dn;Zc.registerParse(Dn)});var Ji=ee((f0,qs)=>{"use strict";var en=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}};qs.exports=en;en.default=en});var Pn=ee((m0,$s)=>{"use strict";var nd=Ji(),tn=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 nd(t,n);return this.messages.push(i),i}warnings(){return this.messages.filter(t=>t.type==="warning")}};$s.exports=tn;tn.default=tn});var Xi=ee((p0,Js)=>{"use strict";var Ks={};Js.exports=function(t){Ks[t]||(Ks[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))}});var Zi=ee((g0,Zs)=>{"use strict";var id=Je(),rd=Fn(),od=$i(),sd=In(),Xs=Pn(),ad=ht(),ld=Ut(),{isClean:Be,my:ud}=wn(),h0=Xi(),cd={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},dd={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},fd={Once:!0,postcssPlugin:!0,prepare:!0},xt=0;function nn(e){return typeof e=="object"&&typeof e.then=="function"}function Qs(e){let t=!1,n=cd[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,xt,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,xt,n+"Exit"]:[n,n+"Exit"]}function Ys(e){let t;return e.type==="document"?t=["Document",xt,"DocumentExit"]:e.type==="root"?t=["Root",xt,"RootExit"]:t=Qs(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Yi(e){return e[Be]=!1,e.nodes&&e.nodes.forEach(t=>Yi(t)),e}var Qi={},Ye=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=Yi(n);else if(n instanceof e||n instanceof Xs)r=Yi(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=sd;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[ud]&&id.rebuild(r)}this.result=new Xs(t,r,i),this.helpers={...Qi,postcss:Qi,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(!dd[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!fd[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(nn(i))try{await i}catch(r){throw this.handleError(r)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Be];){t[Be]=!0;let n=[Ys(t)];for(;n.length>0;){let i=this.visitTick(n);if(nn(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 nn(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=ld;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,u=>{a+=u}),this.result.css=a,this.result}let o=new od(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(nn(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Be];)t[Be]=!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(nn(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,u]=r[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===r.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=a;try{return u(i.toProxy(),this.helpers)}catch(s){throw this.handleError(s,i)}}if(n.iterator!==0){let a=n.iterator,u;for(;u=i.nodes[i.indexes[a]];)if(i.indexes[a]+=1,!u[Be]){u[Be]=!0,t.push(Ys(u));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===xt){i.nodes&&i.nodes.length&&(i[Be]=!0,n.iterator=i.getIterator());return}else if(this.listeners[a]){n.visitors=this.listeners[a];return}}t.pop()}walkSync(t){t[Be]=!0;let n=Qs(t);for(let i of n)if(i===xt)t.nodes&&t.each(r=>{r[Be]||this.walkSync(r)});else{let r=this.listeners[i];if(r&&this.visitSync(r,t.toProxy()))return}}warnings(){return this.sync().warnings()}};Ye.registerPostcss=e=>{Qi=e};Zs.exports=Ye;Ye.default=Ye;ad.registerLazyResult(Ye);rd.registerLazyResult(Ye)});var ta=ee((b0,ea)=>{"use strict";var md=$i(),pd=In(),hd=Pn(),gd=Ut(),x0=Xi(),rn=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=pd;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=gd;this.result=new hd(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 md(r,void 0,this._opts,n);if(a.isMap()){let[u,s]=a.generate();u&&(this.result.css=u),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[]}};ea.exports=rn;rn.default=rn});var ia=ee((y0,na)=>{"use strict";var xd=Fn(),bd=Zi(),yd=ta(),Sd=ht(),lt=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 yd(this,t,n):new bd(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};na.exports=lt;lt.default=lt;Sd.registerProcessor(lt);xd.registerProcessor(lt)});var da=ee((S0,ca)=>{"use strict";var ra=Cn(),oa=$t(),Ed=Je(),Ad=An(),sa=Jt(),aa=Fn(),wd=Ls(),Cd=Yt(),Fd=Zi(),_d=ji(),vd=jt(),Td=In(),er=ia(),Md=Pn(),la=ht(),ua=Mn(),Nd=Ut(),Ld=Ji();function ae(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new er(e)}ae.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:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let u=n(...a);return u.postcssPlugin=t,u.postcssVersion=new er().version,u}let o;return Object.defineProperty(r,"postcss",{get(){return o||(o=r()),o}}),r.process=function(a,u,s){return ae([r(s)]).process(a,u)},r};ae.stringify=Nd;ae.parse=Td;ae.fromJSON=wd;ae.list=_d;ae.comment=e=>new oa(e);ae.atRule=e=>new ra(e);ae.decl=e=>new sa(e);ae.rule=e=>new ua(e);ae.root=e=>new la(e);ae.document=e=>new aa(e);ae.CssSyntaxError=Ad;ae.Declaration=sa;ae.Container=Ed;ae.Processor=er;ae.Document=aa;ae.Comment=oa;ae.Warning=Ld;ae.AtRule=ra;ae.Result=Md;ae.Input=Cd;ae.Rule=ua;ae.Root=la;ae.Node=vd;Fd.registerPostcss(ae);ca.exports=ae;ae.default=ae});function pn(){return globalThis}function M(e,t){if(typeof window>"u")return;let n=pn(),i=n.__hf?.onSwallowed;if(i)try{i({label:e,error:t})}catch(r){}(n.__hfDebug||n.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var tu=["seconds-time","rational-fps","seek-keep-playing"];function nu(e,t){let n=Math.abs(e),i=Math.abs(t);for(;i!==0;){let r=n%i;n=i,i=r}return n||1}function iu(e){let t=Number.isFinite(e)&&e>0?e:30,n=Number.isInteger(t)?1:1e6,i=Math.round(t*n),r=nu(i,n);return{numerator:i/r,denominator:n/r}}function li(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 jr(e){return{protocolVersion:1,capabilities:tu,fps:iu(e)}}function ru(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function qr(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 i=li(n.fps);return i===null||!ru(n.capabilities)?{status:"unsupported",code:"invalid_protocol_metadata",receivedVersion:n.protocolVersion}:{status:"supported",fps:i,metadata:n}}var $r=30;function Kr(e){$r=Number.isFinite(e)&&e>0?e:30}function xe(e){try{window.parent.postMessage({...e,...jr($r)},"*")}catch(t){M("bridge.postMessage",t)}}var ou={play:(e,t)=>t.onPlay(),pause:(e,t)=>t.onPause(),"stop-media":(e,t)=>t.onStopMedia(),seek:(e,t)=>t.onSeek(su(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=>lu(e)};function su(e,t){let n=Number(e.timeSeconds);if(Number.isFinite(n))return Math.max(0,n);let r=li(e.fps)??t.getCanonicalFps();return Math.max(0,Number(e.frame??0))/r}function au(e){let t=qr(e);return t.status!=="unsupported"?!1:(xe({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 lu(e){let t=e.selectors,n=e.duration||800;t&&uu(t,n)}function Jr(e){let t=n=>{let i=n.data;if(!i||i.source!=="hf-parent"||i.type!=="control"||au(i))return;let r=i.action;if(typeof r!="string")return;let o=ou[r];o&&o(i,e)};return window.addEventListener("message",t),xe({source:"hf-preview",type:"ready"}),t}function uu(e,t){if(!document.getElementById("__hf-flash-styles")){let n=document.createElement("style");n.id="__hf-flash-styles",n.textContent=`\n .__hf-flash {\n outline: 2px solid rgba(59, 130, 246, 0.6) !important;\n outline-offset: 2px !important;\n animation: __hf-flash-pulse ${t}ms ease-out forwards !important;\n }\n @keyframes __hf-flash-pulse {\n 0% { outline-color: rgba(59, 130, 246, 0.8); }\n 100% { outline-color: transparent; }\n }\n `,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(r=>{r.classList.add("__hf-flash"),setTimeout(()=>r.classList.remove("__hf-flash"),t)})}catch(i){M("bridge.flashElements.querySelector",i)}}var ui=null;function Xr(e){ui=e}function ot(e,t){if(ui)try{ui({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){M("runtime.analytics.site1",n)}}function cu(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 Mt(e){return`--${cu(e)}`}function Yr(e){let t=new Map;for(let n of e){let i=Mt(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 Qr(){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,Nt(i));let n=hn();return{...t,...n}}function Nt(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 ci="data-hf-css-vars";function di(e){return"style"in e&&typeof e.style?.setProperty=="function"}function fi(e,t){if(!di(e))return;let n=[];for(let[i,r]of Object.entries(t))if(typeof r=="string"&&r!==""||typeof r=="number"){let o=Mt(i);e.style.setProperty(o,String(r)),n.push(o)}n.length>0&&e.setAttribute(ci,n.join(" "))}function Zr(e){if(!di(e))return;let t=e.getAttribute(ci);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(ci)}}function eo(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=hn(),i=[];for(let r of t)i.push(...du(r,n,e.defaultView));for(let r of Yr(i))console.warn(`composition variables ${r.join(", ")} collapse to the same CSS property ${Mt(r[0]??"")} \\u2014 rename one to avoid cross-talk`)}function du(e,t,n){if(!di(e))return[];let i=Nt(e),r={};for(let[o,a]of Object.entries(i)){if(o in t)continue;let u=Mt(o);(e.style.getPropertyValue(u)||(n?n.getComputedStyle(e).getPropertyValue(u):"")).trim()===""&&(r[o]=a)}for(let[o,a]of Object.entries(t))o in i&&(r[o]=a);return fi(e,r),Object.keys(i)}function to(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 hn(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}function no(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,d)=>{let m=null;try{m=l.effect?.getComputedTiming?.()??null}catch(x){M("runtime.adapters.css.site5",x)}if(!m)return{};let f=Number(m.endTime);return Number.isFinite(f)?{endSeconds:d+f/1e3}:{unbounded:!0}},o=(l,d)=>{for(let m of l){try{m.currentTime=d}catch(f){M("runtime.adapters.css.site1",f)}try{m.pause()}catch(f){M("runtime.adapters.css.site2",f)}}},a=l=>{for(let d of l)try{d.play()}catch(m){M("runtime.adapters.css.site3",m)}},u=l=>{for(let d of l)try{d.pause()}catch(m){M("runtime.adapters.css.site4",m)}},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 d of l){if(!(d instanceof HTMLElement))continue;let m=window.getComputedStyle(d);!m.animationName||m.animationName==="none"||t.push({el:d,baseDelay:d.style.animationDelay||"",basePlayState:d.style.animationPlayState||"",animations:n(d)})}},getInferredDurationSeconds:()=>{let l=0;for(let d of t){if(!d.el.isConnected)continue;let m=i(d.el);for(let f of n(d.el)){let x=r(f,m);x.endSeconds!=null&&(l=Math.max(l,x.endSeconds))}}return l>0?l:null},seek:l=>{let d=Number(l.time)||0;for(let m of t){if(!m.el.isConnected)continue;let f=i(m.el),x=Math.max(0,d-f)*1e3,S=m.animations;if(S.length>0){o(S,x);continue}m.el.style.animationPlayState="paused",m.el.style.animationDelay=`-${(x/1e3).toFixed(3)}s`}},pause:()=>{for(let l of t){if(!l.el.isConnected)continue;let d=l.animations;d.length>0&&u(d),s(l)}},play:()=>{for(let l of t)l.el.isConnected&&(s(l),a(l.animations))},revert:()=>{t=[]}}}function io(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 ro(){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){M("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){M("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){M("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){M("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function so(){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){M("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(mi(i))i.goToAndStop(t*1e3,!1);else if(pi(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){M("runtime.adapters.lottie.site2",r)}},pause:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let t of e)try{(mi(t)||pi(t))&&t.pause()}catch(n){M("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=fu(i)}catch(o){M("runtime.adapters.lottie.site4",o)}r!=null&&(n=!0,t=Math.max(t,r))}return n?t:null}}}function oo(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function fu(e){return mi(e)?oo(e.totalFrames,e.frameRate):pi(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:oo(e.totalFrames,e.frameRate):null}function mi(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function pi(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}var hi=-1;function gn(e){if(e!==hi){hi=e;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:e}}))}catch(t){M("runtime.adapters.seek-dispatch.site1",t)}}}function ao(e){hi=e;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:e}}))}catch(t){M("runtime.adapters.seek-dispatch.force",t)}}function lo(){let e=null,t=0,n=null,i=null,r=null,o=null,a=()=>{if(typeof window>"u")return null;let d=window.THREE?.DefaultLoadingManager;return!d||typeof d!="object"||typeof d.itemsLoaded!="number"||typeof d.itemsTotal!="number"?null:d},u=l=>{o||l.itemsTotal<=l.itemsLoaded||(o=new Promise(d=>{l.onLoad=function(){try{r?.call(this)}finally{o=null,l.onLoad=r??null,d()}}}))},s=l=>{n!==l&&(n=l,i=l.onStart??null,r=l.onLoad??null,l.onStart=function(d,m,f){try{i?.call(this,d,m,f)}finally{u(l)}})};return{name:"three",discover:()=>{let l=a();l&&(s(l),u(l))},seek:l=>{e=Math.max(0,Number(l.time)||0),t=e,window.__hfThreeTime=e,gn(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||u(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 uo(){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 co(){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 fo(){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 mo(){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 po(){return Oe({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}function ho(){let e=null,t=0;return{name:"typegpu",discover:()=>{},seek:n=>{e=Math.max(0,Number(n.time)||0),t=e,window.__hfTypegpuTime=e,gn(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0}}}function go(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 xo(){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=go(n.source);if(o)return t.call(this,{...n,source:o},i,r)}return t.call(this,n,i,r)}}function bo(){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(...u){let s=u.length-1,l=u[s];if(l instanceof HTMLVideoElement){let d=go(l);d&&(u[s]=d)}return o.apply(this,u)};a.__hfVideoPatched=!0,i[r]=a}}}function yo(){let e=!1,t=0,n=!1,i,r,o,a=new Set,u=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},d=(b,A)=>A<=0?b:b>=A?Math.max(0,b-A):b,m=(b,A)=>{let _=u.get(b);if(_)return _;let T={compositionTimeMs:A,animationTimeMs:e?d(l(b),A):l(b)};return u.set(b,T),T},f=(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(T){M("runtime.adapters.waapi.site4",T)}}m(b,A)},x=(b,A)=>{for(let _ of b)f(_,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(...T){let z=A.apply(this,T);return f(z,t),z};b.animate=_,i=b,r=A,o=_,n=!0}catch{}},y=b=>{let A=null;try{A=b.effect?.getComputedTiming?.()??null}catch(z){M("runtime.adapters.waapi.site4",z)}if(!A)return{};let _=Number(A.endTime);return Number.isFinite(_)?{endSeconds:(u.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 T=e?m(_,A):m(_,0),z=T.animationTimeMs+Math.max(0,A-T.compositionTimeMs);try{_.currentTime=z}catch(P){M("runtime.adapters.waapi.site1",P)}try{_.pause()}catch(P){M("runtime.adapters.waapi.site2",P)}}},pause:()=>{e||x(s(),t);for(let b of a)try{b.pause()}catch(A){M("runtime.adapters.waapi.site3",A)}},revert:()=>{if(a.clear(),u=new WeakMap,e=!1,t=0,i&&r&&o&&i.animate===o)try{i.animate=r,i.__hfOriginalAnimate===r&&delete i.__hfOriginalAnimate}catch(b){M("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 So(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 mu(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??""),u=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 d=1/Math.min(60,Math.max(1,i)),m=Math.max(0,r),f=Math.min(n,u),x=[];for(let y=m;y<=f+1e-6;y+=d){let b=Math.min(f,y);t(b);let A=Number(e.volume);if(!Number.isFinite(A))continue;let _=Math.max(0,Math.min(1,A)),T=x.at(-1);if((!T||Math.abs(T.volume-_)>1e-4||b===f)&&x.push({time:Number(b.toFixed(6)),volume:Number(_.toFixed(6))}),b===f)break}return x.some(y=>Math.abs(y.volume-l)>1e-4)?x:null}function Eo(e,t,n,i){if(!t||!(e instanceof HTMLAudioElement)&&!(e instanceof HTMLVideoElement)||n<=0)return;let r=u=>{try{typeof t.totalTime=="function"?t.totalTime(u,!0):typeof t.seek=="function"&&t.seek(u,!0)}catch{}},o=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,a=mu(e,r,n,60);Number.isFinite(o)&&r(o),a&&i.set(e,a)}function kt(e){let t=e.defaultPlaybackRate;return Number.isFinite(t)&&t>0?Math.max(.1,Math.min(5,t)):1}function Ao(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 u=e?.resolveStartSeconds?e.resolveStartSeconds(a):Number.parseFloat(a.dataset.start??"0");if(!Number.isFinite(u))continue;let s=Number.parseFloat(a.dataset.playbackStart??a.dataset.mediaStart??"0")||0,l=kt(a),d=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)/l));let x=Number.isFinite(f)&&f>0?u+f:Number.POSITIVE_INFINITY,S=Number.parseFloat(a.dataset.volume??""),y={el:a,start:u,mediaStart:s,duration:Number.isFinite(f)&&f>0?f:Number.POSITIVE_INFINITY,end:x,volume:Number.isFinite(S)?S:null,playbackRate:l,loop:d,sourceDuration:m};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 gi=new WeakMap,Lt=new WeakMap,xi=new WeakSet,dt=new WeakSet;function pu(e){if(dt.has(e))return;dt.add(e);let t=()=>dt.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}var hu=3;function gu(e){return e.error!=null||e.networkState===hu}var bi=new WeakMap;function Rt(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function Co(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 u=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||u)){if(n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let I=n.sourceDuration-n.mediaStart;I>0&&r>=n.sourceDuration&&(r=n.mediaStart+(r-n.mediaStart)%I)}let l=Rt(e.userVolume??1),d=Rt(n.volume??1),m=bi.get(i),f=Rt(i.volume),x;n.volumeKeyframes&&n.volumeKeyframes.length>0?x=Rt(So(n.volumeKeyframes,r)):m===void 0||Math.abs(f-m)>1e-4?x=f:x=d;let S=Rt(x*l);i.volume=S,bi.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(I){M("runtime.media.site1",I)}let y=.04,b=2,A=i.currentTime||0,_=Math.abs(A-r),T=r-A,z=gi.get(i);gi.set(i,T);let P=z===void 0,v=!P&&Math.abs(T-z)>.5,w=_>3,C=a&&_>.001||i.ended&&u&&_>.001||_>.5&&(P||v||w),F=i.tagName==="VIDEO"&&!i.paused,L=z!==void 0&&Math.abs(T-z)<.004,R=!1;if(!F&&!C&&!P&&L&&_>y){let I=(Lt.get(i)??0)+1;Lt.set(i,I),I>=b&&(R=!0,Lt.set(i,0))}else _<=y&&Lt.set(i,0);let U=!F&&e.forceSync&&_>.02;if(C||R||U){if(!(i.tagName==="VIDEO"&&i.id&&!!document.getElementById(`__render_frame_${i.id}__`))){try{i.currentTime=r}catch(Y){M("runtime.media.site2",Y)}if(Math.abs(i.currentTime-r)>.5&&!xi.has(i)){xi.add(i),i.load();try{i.currentTime=r}catch(Y){M("runtime.media.site3",Y)}}}dt.delete(i)}a?i.paused||i.pause():e.playing&&i.paused&&!dt.has(i)&&!gu(i)?(pu(i),i.play().catch(I=>{dt.delete(i),(I&&typeof I=="object"&&"name"in I?String(I.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!e.playing&&!i.paused&&i.pause();continue}gi.delete(i),Lt.delete(i),xi.delete(i),bi.delete(i),i.paused||i.pause()}}var Ue="data-color-grading",Dt="data-hf-color-grading-source-hidden",Sn="data-hf-authored-opacity",Fo="__hf_color_grading_",xu="rec709",xn={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},bn={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},yn={blur:0,pixelate:0},_o=Object.keys(xn),bu=Object.keys(bn),vo=Object.keys(yn);function be(e,t,n={},i={}){return{id:e,label:t,adjust:{...xn,...n},details:{...bn,...i},effects:{...yn}}}var yu=[be("neutral","Neutral"),be("natural-lift","Natural Lift",{exposure:.04,contrast:.06,highlights:-.06,shadows:.08,saturation:.05}),be("fresh-pop","Fresh Pop",{exposure:.08,contrast:.12,whites:.06,shadows:.04,temperature:-.02,vibrance:.08,saturation:.16}),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",{exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},{vignette:.18}),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("warm-clean","Warm Clean",{exposure:.05,contrast:.08,highlights:-.08,shadows:.08,temperature:.16,vibrance:.04,saturation:.06}),be("cool-clean","Cool Clean",{contrast:.06,highlights:-.06,shadows:.06,temperature:-.12,tint:.04,saturation:.04}),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})],Su=new Map(yu.map(e=>[e.id,e])),Eu=/^\\$(?:\\{([A-Za-z0-9_.:-]+)\\}|([A-Za-z0-9_.:-]+))$/,Au={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}},wu={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}},Cu={blur:{min:0,max:1},pixelate:{min:0,max:1}};function st(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Fu(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function To(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function yi(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Fu(n,t.min,t.max):0}function _u(e){if(e==null)return null;let t=String(e).trim();return t||null}function vu(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!st(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:To(e.intensity,1)}}function Tu(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return st(n)?n:null}catch{return null}return{preset:t,intensity:1}}return st(e)?e:null}function Mu(e,t){let n=e.trim().match(Eu);if(!n)return e;let i=n[1]??n[2]??"";return i&&Object.hasOwn(t,i)?t[i]:e}function Si(e,t){if(typeof e=="string"){let i=Mu(e,t);if(i!==e)return i;let r=e.trim();if(!r.startsWith("{"))return e;try{return Si(JSON.parse(r),t)}catch{return e}}if(!st(e))return e;let n={};for(let[i,r]of Object.entries(e))n[i]=Si(r,t);return n}function Nu(e){return e?Su.get(e)??null:null}function Ei(e){let t=Tu(e);if(!t||t.enabled===!1)return null;let n=_u(t.preset),i=Nu(n),r=i?.adjust??xn,o=i?.details??bn,a=i?.effects??yn,u=st(t.adjust)?t.adjust:{},s=st(t.details)?t.details:{},l=st(t.effects)?t.effects:{},d=_o.reduce((x,S)=>(x[S]=yi(u[S]??r[S],Au[S]),x),{...xn}),m=bu.reduce((x,S)=>(x[S]=yi(s[S]??o[S],wu[S]),x),{...bn}),f=vo.reduce((x,S)=>(x[S]=yi(l[S]??a[S],Cu[S]),x),{...yn});return{enabled:!0,preset:n,intensity:To(t.intensity,1),adjust:d,details:m,effects:f,lut:vu(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():xu}}function Mo(e,t){return Ei(Si(e,t))}function It(e){return!e?.enabled||e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:_o.some(t=>Math.abs(e.adjust[t])>1e-4)||Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||vo.some(t=>Math.abs(e.effects[t])>1e-4)}var Lu=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),Ru=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function No(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(F){M("runtime.picker.site1",F)}}function u(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 F=w;for(;F&&F!==document.body&&F!==document.documentElement;){let L=C.getComputedStyle(F);if(L.display==="none"||L.visibility==="hidden"||L.pointerEvents==="none")return!0;let R=Number.parseFloat(L.opacity);if(Number.isFinite(R)&&R<=.01&&!F.hasAttribute(Dt))return!0;F=F.parentElement}return!1}function d(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(Lu)||l(w))}function m(w){return!!w?.closest(Ru)}function f(w){let C=w;if(C.id)return`#${C.id}`;let F=w.getAttribute("data-composition-id");if(F)return`[data-composition-id="${CSS.escape(F)}"]`;let L=w.getAttribute("data-composition-src");if(L)return`[data-composition-src="${CSS.escape(L)}"]`;let R=w.getAttribute("data-track-index");if(R)return`[data-track-index="${CSS.escape(R)}"]`;let U=w.tagName.toLowerCase(),I=w.parentElement;if(!I)return U;let Y=I.querySelectorAll(`:scope > ${U}`);if(Y.length===1)return U;for(let D=0;D<Y.length;D+=1)if(Y[D]===w)return`${U}:nth-of-type(${D+1})`;return U}function x(w){let C=w.tagName.toLowerCase(),F=(w.textContent??"").trim().replace(/\\s+/g," "),L=(R,U)=>R.length>U?`${R.slice(0,U-1)}\\u2026`:R;return C==="h1"||C==="h2"||C==="h3"?"Heading":C==="p"||C==="span"||C==="div"?F.length>0?L(F,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,F){let L=typeof F=="number"&&F>0?F:8,R=[];if(document.elementsFromPoint)R=document.elementsFromPoint(w,C);else if(document.elementFromPoint){let Y=document.elementFromPoint(w,C);R=Y?[Y]:[]}if(m(R[0]??null))return[];let U={},I=[];for(let[Y,D]of R.entries()){if(!d(D))continue;let ie=`${D.tagName}::${D.id||""}::${Y}`;if(!U[ie]&&(U[ie]=!0,I.push(D),I.length>=L))break}return I}function y(w){let C=w.getBoundingClientRect(),F={};for(let R of Array.from(w.attributes))R.name.startsWith("data-")&&(F[R.name]=R.value);return{id:w.id||null,tagName:w.tagName.toLowerCase(),selector:f(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:F}}function b(w,C,F){return S(w,C,F).map(y)}function A(w){if(!t)return;let F=S(w.clientX,w.clientY,1)[0]??(w.target instanceof Element?w.target:null);if(!d(F)||n===F)return;n&&n.classList.remove("__hf-pick-highlight"),n=F,F.classList.add("__hf-pick-highlight");let L=y(F);u(L),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:L})}function _(w){if(!t)return;w.preventDefault(),w.stopPropagation(),w.stopImmediatePropagation();let C=b(w.clientX,w.clientY,8);C.length!==0&&(u(C[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:C,selectedIndex:0,point:{x:w.clientX,y:w.clientY}}))}function T(w){w.key==="Escape"&&(P(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function z(){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(`\n`),document.head.appendChild(i),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",A,!0),document.addEventListener("click",_,!0),document.addEventListener("keydown",T,!0),a("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function P(){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",T,!0),a("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function v(){window.__HF_PICKER_API={enable:z,disable:P,isActive:()=>t,getHovered:()=>r,getSelected:()=>o,getCandidatesAtPoint:(w,C,F)=>Number.isFinite(w)&&Number.isFinite(C)?b(w,C,F):[],pickAtPoint:(w,C,F)=>{if(!Number.isFinite(w)||!Number.isFinite(C))return null;let L=b(w,C,8);if(!L.length)return null;let R=Math.max(0,Math.min(L.length-1,Number(F??0))),U=L[R]??null;return U?(s(U),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:U}),P(),U):null},pickManyAtPoint:(w,C,F)=>{if(!Number.isFinite(w)||!Number.isFinite(C))return[];let L=b(w,C,8);if(!L.length)return[];let R=[],U=Array.isArray(F)?F:[0];for(let I of U){let Y=Math.max(0,Math.min(L.length-1,Math.floor(Number(I)))),D=L[Y];if(!D)continue;R.some(Fe=>Fe.selector===D.selector&&Fe.tagName===D.tagName)||R.push(D)}return R.length?(s(R[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:R}),P(),R):[]}},a("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:z,disablePickMode:P,installPickerApi:v}}var ku=["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 ft(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 Lo(e,t,n=ku){for(let i of n){let r=t.getPropertyValue(i);r&&e.setProperty(i,r)}}function Pt(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&&M("runtime.player.nonConformantNum",{prop:t,actual:typeof i}),n)}function Re(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&M("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function Ot(e,t,n){if(e){for(let i of Object.values(e))if(!(!i||i===t))try{n(i)}catch(r){M("runtime.player.site1",r)}}}function Ro(e,t,n,i){let r=ft(t,n),o=i?.suppressEvents===!0;return Re(e,"pause"),typeof e.totalTime=="function"?e.totalTime(r,o):typeof e.seek=="function"&&e.seek(r,o),r}function Du(e,t,n,i,r){let o=[];Ot(e,t,a=>{Re(a,"play"),o.push(a)});try{return Ro(t,n,i,r)}finally{for(let a of o)try{Re(a,"pause")}catch(u){M("runtime.player.site2",u)}}}function Iu(e,t){Ot(e,t,n=>{Re(n,"play")})}function ko(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?.()??Pt(n,"duration",0))||0);i>0&&Math.max(0,Pt(n,"time",0))>=i&&(Re(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()),Re(n,"play"),Ot(e.getTimelineRegistry?.(),n,r=>{typeof r.timeScale=="function"&&r.timeScale(e.getPlaybackRate()),Re(r,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;Re(n,"pause"),Ot(e.getTimelineRegistry?.(),n,r=>{Re(r,"pause")});let i=Math.max(0,Pt(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(),u=Du(e.getTimelineRegistry?.(),r,o,e.getCanonicalFps());e.onDeterministicSeek(u),i?.keepPlaying&&a?(typeof r.timeScale=="function"&&r.timeScale(e.getPlaybackRate()),Re(r,"play"),Ot(e.getTimelineRegistry?.(),r,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),Re(s,"play")}),e.onDeterministicPlay(),e.onShowNativeVideos(),e.onSyncMedia(u,!0)):(e.setIsPlaying(!1),e.onSyncMedia(u,!1)),e.onRenderFrameSeek(u),e.onStatePost(!0)},renderSeek:(n,i)=>{let r=e.getTimeline(),o=e.getCanonicalFps(),a=r?(Iu(e.getTimelineRegistry?.(),r),Ro(r,n,o,i)):ft(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:()=>Pt(e.getTimeline(),"time",0),getDuration:()=>Pt(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function Do(){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 Pu=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 Ou(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 Bu(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 Hu(e,t,n,i){let r=Ai(e.getAttribute("data-duration"));return r!=null&&r>0?r:Ou(e,t)??Bu(e)??Math.max(0,n-i)}function Gu(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 Io(e){let{startResolver:t,timelineRegistry:n,rootDuration:i}=e,r=new Map,o=document.querySelector("[data-composition-id]"),a=0;for(let u of document.querySelectorAll("[data-start]")){if(u===o||Pu.has(u.tagName))continue;let s=t.resolveStartForElement(u,0);if(Hu(u,n,i,s)<=0)continue;let l={id:wi(u)??`__clip-${a++}`,element:u,parentId:null,children:[]};r.set(u,l)}return Gu(r),{roots:Array.from(r.values()).filter(u=>u.parentId===null)}}var Ci="css:root",Po=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],Wu=new Set([...Po,"contain","isolation","mask-border","mix-blend-mode","opacity"]),Uu=new Set(["absolute","relative"]),Vu=new Set(["flex","inline-flex","grid","inline-grid"]),zu=new Set(["layout","paint","strict","content"]),ju=new Set(["size","inline-size"]);function qu(e){return e.position==="fixed"||e.position==="sticky"}function $u(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(Uu.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&Vu.has(n)}function Ku(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:Po.some(i=>{let r=e.getPropertyValue(i);return r!==""&&r!=="none"})}function Ju(e){return e.getPropertyValue("contain").split(/\\s+/).some(n=>zu.has(n))?!0:ju.has(e.getPropertyValue("container-type"))}function Xu(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>Wu.has(t))}function Yu(e,t){return qu(t)||$u(e,t)||Ku(t)||Ju(t)?!0:Xu(t)}function Qu(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 En(e){let t=e.ownerDocument.defaultView;if(!t)return Ci;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(Yu(n,t.getComputedStyle(n)))return Qu(n)}catch{return Ci}n=n.parentElement}return Ci}function qe(e){if(e==null||e==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}function Oo(e){let t=(e??"").trim();if(!t)return null;let n=qe(t);if(n!=null)return{kind:"absolute",value:n};let i=t.match(/^([A-Za-z0-9_.:-]+)(?:\\s*([+-])\\s*([0-9]*\\.?[0-9]+))?$/);if(!i)return null;let r=(i[1]??"").trim();if(!r)return null;let o=i[2]??"+",a=i[3]??"0",u=Number.parseFloat(a),s=Number.isFinite(u)?Math.max(0,u):0,l=o==="-"?-s:s;return{kind:"reference",refId:r,offset:l}}var Zu="data-hf-authored-duration",ec="data-hf-authored-end";function tc(e){return qe(e.getAttribute("data-duration"))}function nc(e){return qe(e.getAttribute("data-end"))}function ic(e){return qe(e.getAttribute(Zu))}function rc(e){return qe(e.getAttribute(ec))}function $e(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,i=new WeakMap,r=new WeakMap,o=new Set,a=d=>{let m=document.getElementById(d);return m||(document.querySelector(`[data-composition-id="${CSS.escape(d)}"]`)??null)},u=d=>{let m=r.get(d);if(m!==void 0)return m;let f=null,x=tc(d)??(n?ic(d):null);if(x!=null&&x>0&&(f=x),f==null||f<=0){let S=nc(d)??(n?rc(d):null);if(S!=null){let y=l(d,0),b=S-y;Number.isFinite(b)&&b>0&&(f=b)}}if((f==null||f<=0)&&d instanceof HTMLMediaElement){let S=qe(d.getAttribute("data-playback-start"))??qe(d.getAttribute("data-media-start"))??0;Number.isFinite(d.duration)&&d.duration>S&&(f=(d.duration-S)/kt(d))}if(f==null||f<=0){let S=d.getAttribute("data-composition-id");if(S){let y=t[S]??null;if(y&&typeof y.duration=="function")try{let b=Number(y.duration());Number.isFinite(b)&&b>0&&(f=b)}catch(b){M("runtime.startResolver.site1",b)}}}return f!=null&&Number.isFinite(f)&&f>0?(r.set(d,f),f):(r.set(d,null),null)},s=(d,m)=>{if(d.hasAttribute("data-composition-id")){let x=d.parentElement?.closest("[data-composition-id]");return x?l(x,m):0}let f=d.closest("[data-composition-id]");return f?l(f,m):0},l=(d,m)=>{let f=i.get(d);if(f!==void 0)return f??m;if(o.has(d))return m;o.add(d);try{let x=Oo(d.getAttribute("data-start"));if(!x){if(d.hasAttribute("data-composition-id")){let _=d.parentElement;if(_&&(_.hasAttribute("data-composition-src")||_.hasAttribute("data-composition-id")||_.hasAttribute("data-composition-file"))){let T=l(_,m);return i.set(d,T),T}}return i.set(d,m),m}if(x.kind==="absolute"){let _=Math.max(0,x.value),T=Math.max(0,s(d,m)+_);return i.set(d,T),T}let S=a(x.refId);if(!S)return i.set(d,m),m;let y=l(S,0),b=u(S);if(b==null||b<=0){let _=Math.max(0,y+x.offset);return i.set(d,_),_}let A=Math.max(0,y+b+x.offset);return i.set(d,A),A}finally{o.delete(d)}};return{resolveStartForElement:(d,m=0)=>l(d,Math.max(0,m)),resolveDurationForElement:d=>u(d)}}function Fi(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}var oc="data-hf-authored-duration",sc="data-hf-authored-end";function Ee(e){if(e==null||e==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}function _i(e){return Ee(e.getAttribute("data-duration"))??Ee(e.getAttribute(oc))}function Bo(e){return Ee(e.getAttribute("data-end"))??Ee(e.getAttribute(sc))}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 Ti(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function Mi(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 Ht(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 Ho(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return Ht(t);let n=e.getAttribute("data-composition-src");if(n)return Ht(n);let i=e.querySelector("img[src], video[src], audio[src], source[src]");return i?Ht(i.getAttribute("src")):null}function ac(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 lc(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 uc(e){let t=e.textContent?.replace(/\\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function Bt(e){let t=e.replace(/\\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\\s+/g," ").trim();return t?t.replace(/\\b\\w/g,n=>n.toUpperCase()):e}function cc(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 Bt(r);let o=e.id;if(o)return Bt(o);let a=ac(e);if(a)return Bt(a);let u=lc(Ho(e));if(u)return Bt(u);let s=uc(e);return s||`${Bt(t)} ${n+1}`}function Go(e){let n=window.__timelines??{},i=$e({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),r=H=>{if(!H)return null;let k=n[H]??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=H=>{let k=Ee(H.getAttribute("data-duration"));if(k!=null&&k>0)return k;let G=Ee(H.getAttribute("data-playback-start"))??Ee(H.getAttribute("data-media-start"))??0;return Number.isFinite(H.duration)&&H.duration>G?Math.max(0,(H.duration-G)/kt(H)):null},a=()=>{let H=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(H.length===0)return null;let k=0;for(let G of H){let le=G.hasAttribute("data-hf-auto-start")?i.resolveStartForElement(G,0):Math.max(0,Number(G.getAttribute("data-start")??0)||0);if(!Number.isFinite(le))continue;let oe=o(G);oe==null||oe<=0||(k=Math.max(k,Math.max(0,le)+oe))}return k>0?k:null},u=(H,k)=>{let G=[],le=null,oe=null,W=null,q=H.parentElement;for(;q;){let K=q.getAttribute("data-composition-id");K&&(G.push(K),!W&&q!==k&&(W=K),le==null&&(le=i.resolveStartForElement(q,0)),oe==null&&(oe=Ee(q.getAttribute("data-duration"))??r(K)??null)),q=q.parentElement}return{parentCompositionId:W,compositionAncestors:G.reverse(),inheritedStart:le,inheritedDuration:oe}},s=document.querySelector("[data-composition-id]"),l=Array.from(document.querySelectorAll("[data-composition-id]")),d=s?.getAttribute("data-composition-id")??null,m=s?i.resolveStartForElement(s,0):0,f=a(),x=f!=null?Math.max(0,f-Math.max(0,m)):null,S=r(d),y=_i(s??document.body),b=Ti(...l.filter(H=>H!==s).map(H=>{let k=i.resolveStartForElement(H,0),G=i.resolveDurationForElement(H)??r(H.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,m)):null,_=typeof S=="number"&&Number.isFinite(S)&&S>0?S:null,T=typeof y=="number"&&Number.isFinite(y)&&y>0?y:null,z=typeof x=="number"&&Number.isFinite(x)&&x>0?x:null,P=typeof A=="number"&&Number.isFinite(A)&&A>0?A:null,v=Ti(z,P),w=_!=null&&v!=null&&_>v+1,F=T??(w?v:Ti(_,z,P))??null,R=(F!=null?m+F:null)??(typeof f=="number"&&Number.isFinite(f)&&f>0?f:null),U=(H,k)=>!Number.isFinite(k)||k<=0?0:R==null||!Number.isFinite(R)?k:!Number.isFinite(H)||H>=R?0:Math.max(0,Math.min(k,R-H)),I=[],Y=[],D=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),ie=0;for(let[H,k]of D.entries()){if(k===s||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(k.tagName))continue;let G=u(k,s),le=i.resolveStartForElement(k,G.inheritedStart??0),oe=k.getAttribute("data-composition-id"),W=_i(k);if((W==null||W<=0)&&oe&&oe!==d&&(W=r(oe)),(W==null||W<=0)&&k instanceof HTMLMediaElement){let we=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-we))}if(W==null||W<=0){let we=G.inheritedDuration;if(we!=null&&we>0){let Ge=(G.inheritedStart??0)+we;W=Math.max(0,Ge-le)}}if(W==null||W<=0||(W=U(le,W),W<=0))continue;let q=le+W;ie=Math.max(ie,q);let K=k.tagName.toLowerCase(),Ae=oe&&oe!==d?"composition":K==="video"?"video":K==="audio"?"audio":K==="img"?"image":"element";I.push({id:wi(k)??oe??null,label:cc(k,Ae,I.length),start:le,duration:W,track:Mi(k,H),zIndex:vi(k),stackingContextId:En(k),kind:Ae,tagName:K,compositionId:k.getAttribute("data-composition-id"),compositionAncestors:G.compositionAncestors,parentCompositionId:G.parentCompositionId,nodePath:null,compositionSrc:Ht(k.getAttribute("data-composition-src")),assetUrl:Ho(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 Fe=new Set(I.map(H=>H.id)),j=s?.getAttribute("data-composition-id")??null,X=j?n[j]??null:null;if(X&&s){let H=X;if(typeof H.getChildren=="function")try{let k=H.getChildren(!0,!0,!1)??[],G=new Map;for(let W of s.children){let q=W;if(!q.id)continue;let K=q.tagName.toLowerCase();K==="script"||K==="style"||K==="link"||G.set(q,{id:q.id,start:1/0,end:-1/0})}let le=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(),K=W.parent;for(;K&&K!==X&&typeof K.startTime=="function";)q+=K.startTime(),K=K.parent;let Ae=q+W.duration();if(!(!Number.isFinite(q)||!Number.isFinite(Ae)))for(let we of W.targets()){if(!(we instanceof Element))continue;let At=le(we);if(!At)continue;let Ge=G.get(At);Ge&&(Ge.start=Math.min(Ge.start,q),Ge.end=Math.max(Ge.end,Ae))}}let oe=I.length>0?Math.max(...I.map(W=>W.track))+1:0;for(let[W,q]of G){if(q.start===1/0||q.end===-1/0)continue;let K=W;if(Fe.has(K.id))continue;let Ae=Math.max(0,q.end-q.start);if(Ae<=0)continue;let we=U(q.start,Ae);we<=0||(ie=Math.max(ie,q.start+we),I.push({id:K.id,label:K.getAttribute("data-timeline-label")??K.getAttribute("data-label")??K.getAttribute("aria-label")??K.id,start:q.start,duration:we,track:Mi(K,oe),zIndex:vi(K),stackingContextId:En(K),kind:"element",tagName:K.tagName.toLowerCase(),compositionId:K.getAttribute("data-composition-id"),compositionAncestors:j?[j]:[],parentCompositionId:j,nodePath:null,compositionSrc:null,assetUrl:null,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"))}),Fe.add(K.id))}}catch(k){M("runtime.timeline.site1",k)}}if(s&&F!=null&&F>0){let H=I.length>0?Math.max(...I.map(k=>k.track))+1:0;for(let k of s.children){let G=k;if(!G.id||Fe.has(G.id))continue;let le=G.getAttribute("data-timeline-role");if(le!=="overlay"&&le!=="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=U(0,F);q<=0||(ie=Math.max(ie,q),I.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:Mi(G,H),zIndex:vi(G),stackingContextId:En(G),kind:"element",tagName:oe,compositionId:G.getAttribute("data-composition-id"),compositionAncestors:j?[j]:[],parentCompositionId:j,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:le,timelineLabel:G.getAttribute("data-timeline-label"),timelineGroup:G.getAttribute("data-timeline-group"),timelinePriority:Ee(G.getAttribute("data-timeline-priority"))}),Fe.add(G.id))}}for(let H of l){if(H===s)continue;let k=H.getAttribute("data-composition-id");if(!k||!Fi(k))continue;let G=i.resolveStartForElement(H,0),le=_i(H);if((le==null||le<=0)&&Bo(H)!=null){let K=Bo(H);le=Math.max(0,K-G)}let oe=r(k),W=le&&le>0?le:oe;if(W==null||W<=0)continue;let q=U(G,W);q<=0||Y.push({id:k,label:H.getAttribute("data-label")??k,start:G,duration:q,thumbnailUrl:Ht(H.getAttribute("data-thumbnail-url")),avatarName:null})}let B=Math.max(1,ie||1,F??0);return{source:"hf-preview",type:"timeline",durationInFrames:w&&T==null?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(B*Math.max(1,e.canonicalFps))),clips:I,scenes:Y,compositionWidth:Ee(s?.getAttribute("data-width"))??1920,compositionHeight:Ee(s?.getAttribute("data-height"))??1080}}var ue=eu(da(),1),fa=ue.default,E0=ue.default.stringify,A0=ue.default.fromJSON,w0=ue.default.plugin,C0=ue.default.parse,F0=ue.default.list,_0=ue.default.document,v0=ue.default.comment,T0=ue.default.atRule,M0=ue.default.rule,N0=ue.default.decl,L0=ue.default.root,R0=ue.default.CssSyntaxError,k0=ue.default.Declaration,D0=ue.default.Container,I0=ue.default.Processor,P0=ue.default.Document,O0=ue.default.Comment,B0=ue.default.Warning,H0=ue.default.AtRule,G0=ue.default.Result,W0=ue.default.Input,U0=ue.default.Rule,V0=ue.default.Root,z0=ue.default.Node;var tr="data-hf-authored-id",ma="data-hf-inner-root";function nr(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function ir(e){return e.replace(/\\\\/g,"\\\\\\\\").replace(/"/g,\'\\\\"\')}function Rd(e){return e&&e.replace(/[^a-zA-Z0-9_-]/g,n=>`\\\\${n}`).replace(/^-?\\d/,n=>`\\\\${n}`)}function ha(e){let t=e.trim();return t?Array.from(new Set([t,Rd(t)])).filter(Boolean):[]}function kd(e){return!!e&&/[\\w-]/.test(e)}function Dd(e,t,n){let i=ha(t).sort((u,s)=>s.length-u.length);if(i.length===0)return e;let r="",o=0,a=null;for(let u=0;u<e.length;u+=1){let s=e[u],l=u>0?e[u-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 d=i.find(m=>e.startsWith(m,u+1));if(d){let m=e[u+1+d.length];if(!kd(m)){r+=n,u+=d.length;continue}}}r+=s}return r}function Id(e,t){let n=t?.trim();return n?Dd(e,n,`[${tr}="${ir(n)}"]`):e}function pa(e){return`${e}:not(:has([${ma}])), ${e} > [${ma}]`}function Pd(e,t,n,i,r,o){let a=Id(e,i),u=Od(a,t,n),s=u.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return o?pa(t):e;let l=new RegExp(`\\\\[\\\\s*data-composition-id\\\\s*=\\\\s*(["\'])${nr(n)}\\\\1\\\\s*\\\\]`,"g");if(l.test(s))return s.replace(l,"").trim()===""?pa(t):u.replace(l,t);let d=u.match(/^\\s*/)?.[0]??"",m=u.match(/\\s*$/)?.[0]??"";if(r){let f=i?`[${tr}="${ir(i)}"]`:null;if(f&&s.startsWith(f)){let x=s.slice(f.length);return`${d}${t}${f}${x}${m}`}}return`${d}${t} ${s}${m}`}function Od(e,t,n){let i=nr(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 Bd=new Set(["keyframes","-webkit-keyframes","font-face"]);function Hd(e){return e?.type==="atrule"}function Gd(e){let t=e.parent;for(;t;){if(Hd(t)&&Bd.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function ga(e,t,n,i,r){let o=t.trim();if(!e||!o)return e;let a=n||`[data-composition-id="${ir(o)}"]`,u=fa.parse(e);return u.walkRules(s=>{Gd(s)||(s.selectors=s.selectors.map(l=>Pd(l,a,o,i,r?.compoundAuthoredRoot,r?.scopeRootSelectors)))}),u.toResult({map:!1}).css}function xa(e,t,n="[HyperFrames] composition script error:",i,r=t,o){let a=JSON.stringify(t),u=JSON.stringify(r),s=JSON.stringify(n),l=nr(t),d=JSON.stringify(o?.trim()||null),m=JSON.stringify(i??null),f=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(ha(o?.trim()||""));return`(function(){\n var __hfCompId = ${a};\n var __hfTimelineCompId = ${u};\n var __hfErrorLabel = ${s};\n var __hfAuthoredRootId = ${d};\n var __hfAuthoredRootAttr = ${JSON.stringify(tr)};\n var __hfEscapeAttr = function(value) {\n return (value + "").replace(/\\\\\\\\/g, "\\\\\\\\\\\\\\\\").replace(/"/g, "\\\\\\\\\\\\"");\n };\n var __hfRootSelector = ${m} || (__hfCompId\n ? \'[data-composition-id="\' + __hfEscapeAttr(__hfCompId) + \'"]\'\n : "");\n var __hfRoot = null;\n var __hfRootSelectorPattern = ${f};\n var __hfTimingSelectorPattern = ${x};\n var __hfAuthoredRootIdForms = ${S};\n var __hfAuthoredRootSelector = __hfAuthoredRootId\n ? "[" + __hfAuthoredRootAttr + \'="\' + __hfEscapeAttr(__hfAuthoredRootId) + \'"]\'\n : "";\n var __hfIsSelectorNameChar = function(char) {\n return !!char && /[\\\\w-]/.test(char);\n };\n var __hfReplaceAuthoredRootIdSelectors = function(selector) {\n if (!__hfAuthoredRootSelector || !__hfAuthoredRootIdForms.length || typeof selector !== "string") {\n return selector;\n }\n var result = "";\n var bracketDepth = 0;\n var quote = null;\n for (var index = 0; index < selector.length; index += 1) {\n var char = selector[index];\n var previousChar = index > 0 ? selector[index - 1] : "";\n if (quote) {\n result += char;\n if (char === quote && previousChar !== "\\\\\\\\") {\n quote = null;\n }\n continue;\n }\n if (char === \'"\' || char === "\'") {\n quote = char;\n result += char;\n continue;\n }\n if (char === "[") {\n bracketDepth += 1;\n result += char;\n continue;\n }\n if (char === "]") {\n bracketDepth = Math.max(0, bracketDepth - 1);\n result += char;\n continue;\n }\n if (char === "#" && bracketDepth === 0) {\n var matchedForm = null;\n for (var formIndex = 0; formIndex < __hfAuthoredRootIdForms.length; formIndex += 1) {\n var form = __hfAuthoredRootIdForms[formIndex];\n if (selector.slice(index + 1, index + 1 + form.length) === form) {\n matchedForm = form;\n break;\n }\n }\n if (matchedForm) {\n var nextChar = selector[index + 1 + matchedForm.length];\n if (!__hfIsSelectorNameChar(nextChar)) {\n result += __hfAuthoredRootSelector;\n index += matchedForm.length;\n continue;\n }\n }\n }\n result += char;\n }\n return result;\n };\n var __hfNormalizeSelector = function(selector) {\n if (!__hfCompId || typeof selector !== "string") return selector;\n var normalized = selector\n .replace(new RegExp(__hfRootSelectorPattern + \'(?:\' + __hfTimingSelectorPattern + \')+\', \'g\'), __hfRootSelector)\n .replace(new RegExp(\'(?:\' + __hfTimingSelectorPattern + \')+\' + __hfRootSelectorPattern, \'g\'), __hfRootSelector);\n if (__hfAuthoredRootSelector) {\n normalized = __hfReplaceAuthoredRootIdSelectors(normalized);\n }\n return normalized;\n };\n var __hfFindRoot = function() {\n if (!__hfRoot && __hfRootSelector) {\n __hfRoot = window.document.querySelector(__hfRootSelector);\n }\n return __hfRoot;\n };\n var __hfContains = function(node) {\n var root = __hfFindRoot();\n return !root || node === root || root.contains(node);\n };\n var __hfQueryAll = function(selector) {\n var root = __hfFindRoot();\n if (!root || typeof selector !== "string") {\n return window.document.querySelectorAll(selector);\n }\n return Array.prototype.filter.call(window.document.querySelectorAll(__hfNormalizeSelector(selector)), function(node) {\n return __hfContains(node);\n });\n };\n var __hfQueryOne = function(selector) {\n var matches = __hfQueryAll(selector);\n return matches[0] || null;\n };\n var __hfGetElementById = function(id) {\n var found = window.document.getElementById(id);\n if (found && __hfContains(found)) return found;\n var root = __hfFindRoot();\n if (!root) return found || null;\n var idValue = id + "";\n if (__hfAuthoredRootId && __hfAuthoredRootId === idValue && root.getAttribute && root.getAttribute(__hfAuthoredRootAttr) === idValue) {\n return root;\n }\n if (root.id === idValue) return root;\n if (typeof root.querySelector !== "function") return null;\n try {\n var authoredRootMatch = root.querySelector(\'[\' + __hfAuthoredRootAttr + \'="\' + __hfEscapeAttr(idValue) + \'"]\');\n if (authoredRootMatch) return authoredRootMatch;\n } catch {}\n if (typeof CSS !== "undefined" && CSS && typeof CSS.escape === "function") {\n try {\n return root.querySelector("#" + CSS.escape(idValue)) || null;\n } catch {}\n }\n try {\n return root.querySelector(\'[id="\' + __hfEscapeAttr(idValue) + \'"]\') || null;\n } catch {}\n return null;\n };\n var __hfScopedDocument = typeof Proxy === "function"\n ? new Proxy(window.document, {\n get: function(target, prop, receiver) {\n if (prop === "querySelector") return __hfQueryOne;\n if (prop === "querySelectorAll") return __hfQueryAll;\n if (prop === "getElementById") return __hfGetElementById;\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n })\n : window.document;\n var __hfTimelineRegistryProxy = null;\n var __hfGetTimelineRegistry = function() {\n window.__timelines = window.__timelines || {};\n if (!__hfCompId || __hfCompId === __hfTimelineCompId || typeof Proxy !== "function") {\n return window.__timelines;\n }\n if (!__hfTimelineRegistryProxy) {\n __hfTimelineRegistryProxy = new Proxy(window.__timelines, {\n get: function(target, prop, receiver) {\n if (prop !== __hfCompId) {\n return Reflect.get(target, prop, target);\n }\n var authoredValue = Reflect.get(target, prop, target);\n return authoredValue === undefined\n ? Reflect.get(target, __hfTimelineCompId, target)\n : authoredValue;\n },\n set: function(target, prop, value, receiver) {\n if (prop !== __hfCompId) {\n return Reflect.set(target, prop, value, target);\n }\n // The authored node remains in the compiled DOM when its local id\n // differs from the runtime mount id, so readiness legitimately sees\n // both compositions. Publish the same timeline under both identities\n // instead of replacing one with the other.\n var authoredSet = Reflect.set(target, __hfCompId, value, target);\n var runtimeSet = Reflect.set(target, __hfTimelineCompId, value, target);\n return authoredSet && runtimeSet;\n },\n });\n }\n return __hfTimelineRegistryProxy;\n };\n var __hfScopedWindow = typeof Proxy === "function"\n ? new Proxy(window, {\n get: function(target, prop, receiver) {\n if (prop === "__timelines") return __hfGetTimelineRegistry();\n // Inside a sub-composition, __hyperframes is passed as a bare script\n // param bound to the SCOPED variant (per-comp getVariables). But\n // authors routinely write the documented window.__hyperframes.\n // getVariables() form, which would otherwise fall through to the host\n // page\'s base __hyperframes and return the WRONG (or empty) variables\n // for this instance. Route it to the scoped variant too so both\n // spellings resolve to this composition\'s own variables.\n // (__hfScopedHyperframes is a hoisted var assigned below, before any\n // sub-comp script -- the only code that reads this -- runs.)\n if (prop === "__hyperframes") return __hfScopedHyperframes;\n return Reflect.get(target, prop, target);\n },\n set: function(target, prop, value, receiver) {\n if (prop === "__timelines") {\n // Common authoring boilerplate assigns the registry back to\n // itself (window.__timelines = window.__timelines || {}). The\n // getter above returns our proxy; do not replace the canonical\n // registry with that proxy or later wrappers will stack proxies.\n if (value === __hfTimelineRegistryProxy) return true;\n target.__timelines = value || {};\n __hfTimelineRegistryProxy = null;\n return true;\n }\n return Reflect.set(target, prop, value, target);\n },\n })\n : window;\n var __hfResolveGsapTarget = function(target) {\n if (typeof target !== "string") return target;\n return __hfQueryAll(target);\n };\n var __hfScopeTimeline = function(timeline) {\n if (!timeline || timeline.__hfScopedCompositionRoot === __hfFindRoot()) return timeline;\n ["to", "from", "fromTo", "set"].forEach(function(method) {\n var original = timeline[method];\n if (typeof original !== "function") return;\n timeline[method] = function(target) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(target);\n return original.apply(timeline, args);\n };\n });\n try {\n Object.defineProperty(timeline, "__hfScopedCompositionRoot", {\n value: __hfFindRoot(),\n configurable: true,\n });\n } catch {\n // Best-effort: timelines coming from user code may have a frozen target\n // or a non-extensible defineProperty path. Swallow \\u2014 the scoped root\n // is an enrichment, not a correctness invariant for playback.\n }\n return timeline;\n };\n var __hfBaseGsap = typeof gsap === "undefined" ? window.gsap : gsap;\n var __hfScopedGsap = !__hfBaseGsap || typeof Proxy !== "function"\n ? __hfBaseGsap\n : new Proxy(__hfBaseGsap, {\n get: function(target, prop, receiver) {\n if (prop === "timeline") {\n return function() {\n return __hfScopeTimeline(target.timeline.apply(target, arguments));\n };\n }\n if (prop === "to" || prop === "from" || prop === "fromTo" || prop === "set") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return target[prop].apply(target, args);\n };\n }\n if (prop === "utils" && target.utils && typeof Proxy === "function") {\n return new Proxy(target.utils, {\n get: function(utilsTarget, utilsProp, utilsReceiver) {\n if (utilsProp === "toArray") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return utilsTarget.toArray.apply(utilsTarget, args);\n };\n }\n if (utilsProp === "selector") {\n return function(base) {\n var baseEl = typeof base === "string" ? __hfQueryOne(base) : base;\n var root = baseEl || __hfFindRoot();\n return function(selector) {\n if (!root || typeof selector !== "string") return [];\n return Array.prototype.filter.call(\n window.document.querySelectorAll(__hfNormalizeSelector(selector)),\n function(node) {\n return node === root || (typeof root.contains === "function" && root.contains(node));\n },\n );\n };\n };\n }\n var value = Reflect.get(utilsTarget, utilsProp, utilsTarget);\n return typeof value === "function" ? value.bind(utilsTarget) : value;\n },\n });\n }\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n });\n var __hfBaseHyperframes = window.__hyperframes;\n var __hfScopedHyperframes = !__hfBaseHyperframes\n ? __hfBaseHyperframes\n : Object.assign({}, __hfBaseHyperframes, {\n getVariables: function() {\n var byComp = window.__hfVariablesByComp;\n var scoped = byComp && __hfTimelineCompId ? byComp[__hfTimelineCompId] : null;\n return scoped ? Object.assign({}, scoped) : {};\n },\n });\n var __hfRun = function() {\n try {\n (function(document, gsap, window, __hyperframes) {\n${e.replace(/<\\/(script)/gi,"<\\\\/$1")}\n }).call(window, __hfScopedDocument, __hfScopedGsap, __hfScopedWindow, __hfScopedHyperframes);\n } catch (_err) {\n console.error(__hfErrorLabel, __hfCompId, _err);\n }\n };\n __hfFindRoot();\n __hfRun();\n})();`}var Wd=["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 ba(e){let t=e.getAttribute("id")?.trim();for(let n of Wd)e.removeAttribute(n);t&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",t)),e.setAttribute("data-hf-inner-root","true")}var Ud=8e3,Vd=/^(?![a-zA-Z][a-zA-Z\\d+\\-.]*:)(?!\\/\\/)(?!\\/)(?!\\.\\.?\\/).+/,zd=/\\burl\\(\\s*(["\']?)([^)"\']+)\\1\\s*\\)/g,jd=["src","href"];function qd(e){return!e||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/")}function Sa(e,t){if(!t)return e;let n=e.trim();if(qd(n)||!n.startsWith("../")&&n!=="..")return e;try{return new URL(n,t).href}catch{return e}}function Ea(e,t){return!t||!e?e:e.replace(zd,(n,i,r)=>{let o=Sa(r||"",t);return o===r?n:`url(${i||""}${o}${i||""})`})}function $d(e,t){for(let n of Array.from(e.querySelectorAll("[src], [href]")))for(let i of jd){let r=n.getAttribute(i);if(r==null)continue;let o=Sa(r,t);o!==r&&n.setAttribute(i,o)}}function Kd(e,t){for(let n of Array.from(e.querySelectorAll("[style]"))){let i=n.getAttribute("style");if(i==null)continue;let r=Ea(i,t);r!==i&&n.setAttribute("style",r)}}function Jd(e,t){for(let n of Array.from(e.querySelectorAll("style"))){let i=n.textContent||"",r=Ea(i,t);r!==i&&(n.textContent=r)}}function Aa(e,t){if(t){$d(e,t),Kd(e,t),Jd(e,t);for(let n of Array.from(e.querySelectorAll("template")))Aa(n.content,t)}}function Xd(e,t){return`${e}__hf${t}`}var Yd=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"),Ud)});function or(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function Qd(e){let t=document.importNode(e,!0);ba(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 ya(e,t){let n=e.trim();if(!n)return e;try{return Vd.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 rr(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 On(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 Zd(e){let t=new Map;for(let n of e){let i=On(n).authoredCompositionId||"";i&&t.set(i,(t.get(i)||0)+1)}return t}function wa(e){let t=On(e).authoredCompositionId;return t?!!document.querySelector(`template#${CSS.escape(t)}-template`):!1}function ef(e){return!!e.querySelector(\'[data-hf-inner-root="true"]\')}function tf(e){return e.hasAttribute("data-composition-src")?!0:wa(e)?e.children.length===0||e.hasAttribute("data-hf-original-composition-id")?!0:ef(e):!1}function ar(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(t=>t.hasAttribute("data-composition-src")?!0:wa(t))}function Ca(){let e=window.__hfVariablesByComp;if(!e)return;let t=new Set(ar().map(n=>On(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(e))t.has(n)||delete e[n]}function Fa(e,t=Zd(e)){let n=new Map,i=new Map;for(let r of e){let{authoredCompositionId:o,runtimeCompositionId:a}=On(r),u=tf(r);if(!o){i.set(r,{authoredCompositionId:null,runtimeCompositionId:a});continue}let s=(t.get(o)||0)>1,l=a||o;if(u){let d=s?(n.get(o)||0)+1:0;s&&n.set(o,d),l=s?Xd(o,d):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 sr(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 f of e.headLinks){let x=(f.getAttribute("href")||"").trim();if(!x)continue;let S=e.compositionUrl?new URL(x,e.compositionUrl).href:x;if(e.compositionUrl&&rr(S,e.compositionUrl)||document.head.querySelector(`link[href="${CSS.escape(S)}"]`))continue;let y=f.cloneNode(!0);y.href=S,document.head.appendChild(y),e.injectedLinks.push(y)}let u=f=>{for(let x of f){let S=x.cloneNode(!0);S instanceof HTMLStyleElement&&(i&&(S.textContent=ga(S.textContent||"",i,a,o,{scopeRootSelectors:!0})),document.head.appendChild(S),e.injectedStyles.push(S))}};e.headStyles&&u(e.headStyles),u(Array.from(n.querySelectorAll("style")));let s=[];if(e.headScripts)for(let f of e.headScripts){let x=f.getAttribute("type")?.trim()??"",S=f.getAttribute("src")?.trim()??"";if(S){let y=ya(S,e.compositionUrl);if(e.compositionUrl&&rr(y,e.compositionUrl))continue;s.push({kind:"external",src:y,type:x})}else{let y=f.textContent?.trim()??"";y&&s.push({kind:"inline",content:y,type:x,scopeCompositionId:i})}}let l=Array.from(n.querySelectorAll("script")),d=[...s];for(let f of l){let x=f.getAttribute("type")?.trim()??"",S=f.getAttribute("src")?.trim()??"";if(S){let y=ya(S,e.compositionUrl);if(e.compositionUrl&&rr(y,e.compositionUrl)){f.parentNode?.removeChild(f);continue}d.push({kind:"external",src:y,type:x})}else{let y=f.textContent?.trim()??"";y&&d.push({kind:"inline",content:y,type:x,scopeCompositionId:i})}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"),S=e.parseDimensionPx(f),y=e.parseDimensionPx(x);f&&e.host.setAttribute("data-width",f),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(Qd(t))}else e.hasTemplate?e.host.appendChild(document.importNode(n,!0)):e.host.innerHTML=e.fallbackBodyInnerHtml;r&&nf(e,n,r);for(let f of d){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=xa(f.content,f.scopeCompositionId,"[HyperFrames] composition script error:",a,r||f.scopeCompositionId,o):x.textContent=`(function(){${f.content}})();`,document.body.appendChild(x),e.injectedScripts.push(x),f.kind==="external"){let S=await Yd(x);S.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.authoredCompositionId,runtimeCompositionId:e.runtimeCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:f.src,loadStatus:S.status,elapsedMs:S.elapsedMs}})}}}async function _a(e){let t=ar();if(Ca(),t.length===0)return;let n=Fa(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 u=document.querySelector(`template#${CSS.escape(a)}-template`);or(r),await sr({host:r,authoredCompositionId:a,runtimeCompositionId:o?.runtimeCompositionId||a,hostCompositionSrc:`template#${a}-template`,sourceNode:u.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic})}}async function va(e){let t=ar();if(Ca(),t.length===0)return;let n=Fa(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),u=a?.authoredCompositionId||null,s=a?.runtimeCompositionId||u||null,l=null;try{l=new URL(o,document.baseURI)}catch{l=null}or(r);try{let d=u!=null?document.querySelector(`template#${CSS.escape(u)}-template`):null;if(d){await sr({host:r,authoredCompositionId:u,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:d.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:l,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(),S=new DOMParser().parseFromString(f,"text/html");Aa(S,l);let y=(u?S.querySelector(`template#${CSS.escape(u)}-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")),T=Array.from(S.head.querySelectorAll(\'link[rel="stylesheet"], link[rel="preconnect"]\'));await sr({host:r,authoredCompositionId:u,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:T,declaredVariableDefaults:Nt(S.documentElement),onDiagnostic:e.onDiagnostic})}catch(d){e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:u,runtimeCompositionId:s,hostCompositionSrc:o,errorMessage:d instanceof Error?d.message:"unknown_error"}}),or(r)}}))}function nf(e,t,n){let r={...e.declaredVariableDefaults??(t instanceof Element?Nt(t):{}),...to(e.host)};Zr(e.host),Object.keys(r).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[n]=r,fi(e.host,{...r,...hn()})):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[n]}function rf(e){return e instanceof HTMLElement?e.dataset.captionWrapper!=="true"?e:e.querySelector(":scope > span")??null:null}function of(){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 sf(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 lr(){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=of();for(let i of t){let r=null;if(i.wordId&&(r=rf(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(d=>d.vars.color!==void 0).sort((d,m)=>d.startTime()-m.startTime()),l=s[0]?String(s[0].vars.color):"";for(let d of s)String(d.vars.color)===l?i.dimColor&&(d.vars.color=i.dimColor):i.activeColor&&(d.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 u=sf(r);e.set(u,o)}}}).catch(()=>{})}var cr="data-hf-edit-base-x",dr="data-hf-edit-base-y",bt="data-hf-edit-original-translate",Bn=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},af=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},Ta=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,ur=(e,t)=>Ta.test(e)&&Ta.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,lf=(e,t,n)=>{if(!e||e==="none")return`${t} ${n}`;let[i,r,o]=af(e);if(i===void 0)return`${t} ${n}`;if(r===void 0)return`${ur(i,t)} ${n}`;let a=o===void 0?"":` ${o}`;return`${ur(i,t)} ${ur(r,n)}${a}`},uf=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},cf=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 df(e,t){let n=fr.get(e);if(!t?.force&&n!==void 0&&e.style.getPropertyValue("translate")!==n){ot("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let i=Bn(e.getAttribute("data-x"))-Bn(e.getAttribute(cr)),r=Bn(e.getAttribute("data-y"))-Bn(e.getAttribute(dr));e.hasAttribute(bt)||e.setAttribute(bt,cf(e)),n===void 0&&uf(e);let o=e.getAttribute(bt)??"",a=lf(o,`${i}px`,`${r}px`);e.style.setProperty("translate",a),fr.set(e,e.style.getPropertyValue("translate"))}function Hn(e,t){let n=e.defaultView?.HTMLElement,i=u=>n?u instanceof n:typeof u.style?.setProperty=="function",r=e.querySelectorAll(`[${bt}]:not([${cr}]):not([${dr}])`);for(let u=0;u<r.length;u++){let s=r[u];if(s===void 0||!i(s))continue;let l=s.getAttribute(bt)??"";l===""?s.style.removeProperty("translate"):s.style.setProperty("translate",l),s.removeAttribute(bt),fr.delete(s)}let o=e.querySelectorAll(`[${cr}], [${dr}]`),a=0;for(let u=0;u<o.length;u++){let s=o[u];s===void 0||!i(s)||(df(s,t),a+=1)}return a}var Ma="__hfPositionEditsSeekReapplyWrapped",Na=new WeakSet,La=new WeakMap,Ra=new WeakMap;function ka(e){let t=e,n=()=>{try{Hn(t.document)}catch{}},i=m=>typeof m=="function"&&(Na.has(m)||!!m[Ma]),r=m=>{Na.add(m);try{Object.defineProperty(m,Ma,{value:!0})}catch{}},o=m=>{if(typeof m!="function"||i(m))return m;let f=function(...x){let S=m.apply(this,x);return n(),S};return r(f),f},a=(m,f)=>{let x=La.get(m);if(x?.has(f))return!0;let S=Object.getOwnPropertyDescriptor(m,f);if(S?.configurable===!1){let A=m[f];return typeof A=="function"&&(m[f]=o(A),n()),!1}let y=m[f],b=S?.set;return Object.defineProperty(m,f,{configurable:!0,enumerable:S?.enumerable??!0,get:()=>y,set:A=>{y=o(A),b?.call(m,A)}}),y=o(y),x??(x=new Set),x.add(f),La.set(m,x),n(),!0},u=(m,f)=>{let x=Ra.get(t),S=Object.getOwnPropertyDescriptor(t,m);if(!x?.has(m)){if(S?.configurable===!1){let A=t[m];return A?a(A,f):!1}let b=t[m];Object.defineProperty(t,m,{configurable:!0,enumerable:S?.enumerable??!0,get:()=>b,set:A=>{b=A,b&&a(b,f)}}),x??(x=new Set),x.add(m),Ra.set(t,x)}let y=t[m];return y?a(y,f):!1},s=()=>{let m=u("__hf","seek"),f=u("__player","renderSeek");return m&&f};if(s())return;let l=120,d=t.setInterval(()=>{if(s()){t.clearInterval(d);return}l-=1,l<=0&&t.clearInterval(d)},50)}function Gn(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 Wn(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var Da=new Set(["img","video","audio","source"]);function ff(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 mf(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 pf(e){return e.replace(/[;{}<>\\r\\n]/g,"")}function hf(e){if(Wn(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=Gn(e);return t.set(n,r),r}function gf(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 xf(e){return e.querySelector("[data-hf-root]")??e.getElementById("stage")??e.body?.firstElementChild??e.body}function bf(e,t){let n=new Set,i=xf(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,u]of Object.entries(o)){let s=hf(u);s!==null&&r instanceof HTMLElement&&r.style.setProperty(`--${a}`,pf(s))}}}function pr(e){let t=new Map;bf(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(!Da.has(n.tagName.toLowerCase())){console.warn(`[hyperframes] Ignoring data-var-src on <${n.tagName.toLowerCase()}>: variable-bound src is only allowed on ${Array.from(Da).join("/")}.`);continue}let r=ff(mr(n,t)[i]);if(r!==null){if(!mf(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];Wn(r)&&gf(n,String(r))}}var ge=class extends Error{constructor(n,i=null){super(i==null?n:`${n} at line ${i}`);he(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=i}},yf=[0,0,0],Sf=[1,1,1],gr=64;function Ef(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 Qe(e,t){let n=Number(e);if(!Number.isFinite(n))throw new ge(`Invalid number "${e}"`,t);return n}function Ia(e,t,n){if(e.length!==3)throw new ge(`${t} expects three numbers`,n);return[Qe(e[0],n),Qe(e[1],n),Qe(e[2],n)]}function Pa(e,t,n){if(!e)throw new ge(`${t} expects a size`,n);let i=Number(e);if(!Number.isInteger(i)||i<2)throw new ge(`${t} must be an integer greater than 1`,n);return i}function Af(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new ge("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function wf(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 Cf(e){return/^[+-]?(?:\\d|\\.\\d)/.test(e)}function Oa(e,t={}){let n=t.maxSize??gr,i=null,r=yf,o=Sf,a=null,u=null,s=[],l=e.replace(/^\\uFEFF/,"").split(/\\r?\\n/);for(let m=0;m<l.length;m++){let f=m+1,x=Ef(l[m]??"").trim();if(!x)continue;let S=x.split(/\\s+/),y=(S[0]??"").toUpperCase(),b=S.slice(1);if(y==="TITLE"){i=wf(x);continue}if(y==="DOMAIN_MIN"){r=Ia(b,y,f);continue}if(y==="DOMAIN_MAX"){o=Ia(b,y,f);continue}if(y==="LUT_3D_INPUT_RANGE"){if(b.length!==2)throw new ge(`${y} expects two numbers`,f);let A=Qe(b[0],f),_=Qe(b[1],f);if(_<=A)throw new ge("LUT_3D_INPUT_RANGE max must exceed min",f);r=[A,A,A],o=[_,_,_];continue}if(y==="LUT_1D_SIZE"){a=Pa(b[0],y,f);continue}if(y==="LUT_3D_SIZE"){if(u=Pa(b[0],y,f),u>n)throw new ge(`LUT_3D_SIZE ${u} exceeds max ${n}`,f);continue}if(!Cf(y)){if(y.startsWith("LUT_"))throw new ge(`Unsupported cube keyword ${y}`,f);continue}if(!u)throw a?new ge("1D cube LUTs are not supported yet",f):new ge("LUT data appears before LUT_3D_SIZE",f);if(S.length!==3)throw new ge("LUT data rows must contain three numbers",f);s.push(Qe(S[0],f),Qe(S[1],f),Qe(S[2],f))}if(a&&u)throw new ge("Mixed 1D and 3D cube LUTs are not supported yet");if(!u)throw a?new ge("1D cube LUTs are not supported yet"):new ge("Missing LUT_3D_SIZE");Af(r,o);let d=u*u*u;if(s.length!==d*3)throw new ge(`Expected ${d} LUT rows for size ${u}, found ${s.length/3}`);return{title:i,size:u,domainMin:r,domainMax:o,data:new Float32Array(s)}}function Ff(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function hr(e){return Math.round(Ff(e)*255)}function Ba(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 u=0;u<t;u++){let s=((o*t+a)*t+u)*3,l=(a*n+o*t+u)*4;r[l]=hr(e.data[s]??0),r[l+1]=hr(e.data[s+1]??0),r[l+2]=hr(e.data[s+2]??0),r[l+3]=255}return{width:n,height:i,data:r}}var ze=new Map,_f="data-hf-color-grading-canvas",vf="__hf_color_grading_canvas__";function ja(){if(typeof MutationObserver>"u"||typeof document>"u")return;let e=document.documentElement;if(!e)return;let t=i=>{i instanceof HTMLElement&&(i.hasAttribute(Sn)||i.setAttribute(Sn,i.style.opacity))},n=i=>{if(i instanceof Element){i.hasAttribute(Ue)&&t(i);for(let r of i.querySelectorAll(`[${Ue}]`))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(Ue)&&t(r.target)}}).observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[Ue]})}var Tf=16,on={enabled:!1,position:.5,softness:0,lineWidth:2};function xr(e){let t=e.getAttribute(Ue);return t==null?null:Mo(t,Gn(e))}var Mf=["attribute vec2 a_pos;","varying vec2 v_uv;","void main(){"," v_uv = a_pos * 0.5 + 0.5;"," gl_Position = vec4(a_pos, 0.0, 1.0);","}"].join(`\n`),Nf=["#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(`\n`),Lf=["#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;","vec4 readSource(vec2 uv){"," vec4 color = texture2D(u_source, clamp(uv, vec2(0.0), vec2(1.0)));"," color.rgb *= color.a;"," return color;","}","void main(){"," vec2 stepUv = u_direction * max(u_radius, 0.0) / max(u_resolution, vec2(1.0)) / 12.0;"," vec4 color = readSource(v_uv) * 0.08077993;"," color += readSource(v_uv + stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv - stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv + stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv - stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv + stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv - stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv + stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv - stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv + stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv - stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv + stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv - stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv + stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv - stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv + stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv - stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv + stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv - stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv + stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv - stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv + stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv - stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv + stepUv * 12.0) * 0.00453456;"," color += readSource(v_uv - stepUv * 12.0) * 0.00453456;"," if (color.a > 0.0001) color.rgb /= color.a;"," gl_FragColor = color;","}"].join(`\n`);function ut(e){return e instanceof HTMLVideoElement||e instanceof HTMLImageElement}function Ha(e,t,n){let i=e.createShader(n);return i?(e.shaderSource(i,t),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS)?i:(M("runtime.colorGrading.compileShader",e.getShaderInfoLog(i)),e.deleteShader(i),null)):null}function qa(e,t=Nf){let n=Ha(e,Mf,e.VERTEX_SHADER),i=Ha(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:(M("runtime.colorGrading.linkProgram",e.getProgramInfoLog(r)),e.deleteProgram(r),null)):null}function yr(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 Rf(e,t){let n=qa(e,Lf);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 Ga(e){let t=yr(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 Wa(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 $a(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!0});if(!t)return null;let n=qa(t),i=yr(t),r=yr(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 kf(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Df(e){if(!kf(e))return{...on};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,on.position,0,1),softness:t(e.softness,on.softness,0,.25),lineWidth:t(e.lineWidth,on.lineWidth,0,12)}}function Ka(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 Er(e){return e instanceof Error?e.message:"LUT failed to load"}function If(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 Pf(e){let t=e.id||e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return If(t)}function Of(e){let t=Ka(e);if("error"in t)return{state:"error",message:t.error};let n=ze.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=>Oa(o,{maxSize:gr})),r={state:"pending",promise:i};for(;ze.size>=Tf;){let o=ze.keys().next().value;if(!o)break;ze.delete(o)}return ze.set(t.href,r),i.then(o=>{ze.get(t.href)===r&&ze.set(t.href,{state:"ready",lut:o})},o=>{ze.get(t.href)===r&&ze.set(t.href,{state:"error",message:Er(o)})}),r}function Ua(e,t,n){if(e.lut?.src===t)return e.lut;let i=Ba(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=Er(a),e.lutLoadingSrc=null,M("runtime.colorGrading.uploadLut",a),null}}function Un(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function Ja(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),Un(e.gl,t.scratch),Un(e.gl,t.blur),e.effectTargets=null)}function Xa(e){Ja(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 Bf(e){let t=$a(e.canvas);return t?(Xa(e),e.gl=t.gl,e.program=t.program,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function Sr(e){if(!e.sourceHidden)return;e.element.removeAttribute(Dt);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 Hf(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=Rf(t,e.program.quad),i=Ga(t),r=Ga(t);return!n||!i||!r?(n&&t.deleteProgram(n.program),i&&Un(t,i),r&&Un(t,r),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:i,blur:r},e.effectTargets)}function Gf(e,t,n,i,r){let o=Math.max(1,Math.ceil(i)),a=Math.max(1,Math.ceil(r));return Wa(e,t,o,a),Wa(e,n,o,a),{width:o,height:a}}function Va(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 Wf(e,t,n,i,r,o,a){let u=n;for(let s=0;s<Math.max(1,Math.floor(a));s++)Va(e,t.blurProgram,u,t.scratch,r,{x:1,y:0},o),Va(e,t.blurProgram,t.scratch.texture,i,r,{x:0,y:1},o),u=i.texture}function Uf(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=Ka(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=Of(t);return r.state==="ready"?Ua(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||(Ua(e,i.href,o),De(e))},o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=Er(o),e.lutLoadingSrc=null,De(e))})),null)}function br(e){if(!e)return null;if(typeof e=="string"){let t=e.trim();if(!t)return null;let n=document.getElementById(t.replace(/^#/,""));if(n&&ut(n))return n;try{let i=document.querySelector(t);return i&&ut(i)?i:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&ut(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&ut(t))return t}if(!e.selector)return null;try{let t=Array.from(document.querySelectorAll(e.selector)),n=Math.max(0,Math.floor(Number(e.selectorIndex??0)||0)),i=t[n]??null;return i&&ut(i)?i:null}catch{return null}}function Vf(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 Ya(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 zf(e){if(!e.id)return null;let t=document.getElementById(`__render_frame_${e.id}__`);return t instanceof HTMLImageElement&&Ya(t)?t:null}function jf(e){return e instanceof HTMLImageElement&&e.classList.contains("__render_frame__")}function qf(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}function $f(e){if(e instanceof HTMLVideoElement){let t=zf(e);if(t)return t}return Ya(e)?e:null}function za(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 Kf(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=za(o,"x"),u=za(o,"y");if(a!==null&&(o==="left"||o==="right"||o.endsWith("%")&&r===0)){n=a;continue}if(u!==null&&(o==="top"||o==="bottom"||o.endsWith("%")&&r>0)){i=u;continue}}return{x:n,y:i}}function Jf(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",u=e,s=t;if(a==="contain"||a==="cover"||a==="scale-down"){let f=a==="cover"?Math.max(e/n,t/i):Math.min(e/n,t/i);u=n*f,s=i*f,a==="scale-down"&&u>n&&s>i&&(u=n,s=i)}else a==="none"&&(u=n,s=i);let l=Kf(o||"center"),d=(e-u)*l.x/e,m=(t-s)*l.y/t;return{scaleX:u/e,scaleY:s/t,offsetX:d,offsetY:m}}function Xf(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function Yf(e,t){let{element:n,canvas:i}=e,r=n.parentElement;r&&Xf(e,r);let o=window.getComputedStyle(t);Lo(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(),u=Math.max(0,Math.round(n.offsetWidth||a.width)),s=Math.max(0,Math.round(n.offsetHeight||a.height));return u<=0||s<=0?(i.style.display="none",null):(i.width!==u&&(i.width=u),i.height!==s&&(i.height=s),{width:u,height:s})}function Qf(e,t,n,i,r,o,a,u,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,u.scaleX,u.scaleY),e.uniform2f(t.uvOffset,u.offsetX,u.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 Zf(e){if(!e.sourceHidden){let t=e.element.getAttribute(Sn);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(Dt,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function De(e){if(e.destroyed||e.contextLost)return!1;let t=$f(e.element);if(!t)return e.hasDrawn||(e.canvas.style.display="none"),!1;let n=Vf(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",u=e.element.style.getPropertyValue("visibility"),s=jf(t);if(s&&qf(e,t),s||!a){let S=window.getComputedStyle(s?t:e.element);e.sourceOpacityForCanvas=S.opacity||"1",e.sourceVisibleForCanvas=(s||u!=="hidden")&&S.visibility!=="hidden"}let l=Yf(e,i);if(!l)return!1;let d=window.getComputedStyle(i),m=Jf(l.width,l.height,n.width,n.height,d.objectFit,d.objectPosition),{gl:f,program:x}=e;try{let S=Uf(e);f.activeTexture(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,x.texture),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,!0),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,t);let y=!1,b=Math.min(1,Math.max(0,e.grading.effects.blur));if(b>0){let _=Hf(e);if(_){let T=Gf(f,_.scratch,_.blur,l.width,l.height);Wf(f,_,x.texture,_.blur,T,.75+Math.pow(b,1.35)*32,b>.55?3:2),y=!0}}else e.effectError=null,e.effectTargets&&Ja(e);f.bindFramebuffer(f.FRAMEBUFFER,null),f.viewport(0,0,l.width,l.height),f.useProgram(x.program),f.activeTexture(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,x.texture),f.activeTexture(f.TEXTURE1),f.bindTexture(f.TEXTURE_2D,e.effectTargets?.blur.texture??x.texture),f.activeTexture(f.TEXTURE2),f.bindTexture(f.TEXTURE_2D,x.lutTexture);let A=e.grainSeed+(e.element instanceof HTMLVideoElement?Math.floor(e.element.currentTime*60):0);return Qf(f,x,e.grading,S,y,e.compare,l,m,A),f.bindBuffer(f.ARRAY_BUFFER,x.quad),f.enableVertexAttribArray(x.position),f.vertexAttribPointer(x.position,2,f.FLOAT,!1,0,0),f.drawArrays(f.TRIANGLE_STRIP,0,4),Zf(e),e.hasDrawn=!0,e.drawError=null,!0}catch(S){return e.drawError=S instanceof Error?S.message:"Shader draw failed",M("runtime.colorGrading.drawEntry",S),!1}}function He(e,t,n,i){t.addEventListener(n,i),e.cleanup.push(()=>t.removeEventListener(n,i))}function em(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 sn(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&&sn(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,De(e),!e.destroyed&&!t.paused&&!t.ended&&sn(e)})}function tm(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",()=>sn(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",Sr(e)}),He(e,e.canvas,"webglcontextrestored",()=>{if(e.contextLost=!1,!Bf(e)){e.contextLost=!0,e.drawError="WebGL context restore failed",Sr(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 nm(e){if(!e.destroyed){e.destroyed=!0,em(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();e.cleanup.length=0,e.canvas.remove(),Xa(e),Sr(e),e.touchedParent&&(e.parentInlinePosition===null?e.touchedParent.style.removeProperty("position"):e.touchedParent.style.position=e.parentInlinePosition)}}function im(e){let t=document.createElement("canvas");return e.id&&(t.id=`${Fo}${e.id}`),t.className=vf,t.setAttribute(_f,"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 Qa(){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&&sn(_),!0;let T=im(y),z=$a(T);if(!z)return T.remove(),!1;let P={element:y,canvas:T,gl:z.gl,program:z.program,grading:b,compare:{...on},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:Pf(y),destroyed:!1};return e.set(y,P),t.add(y),tm(P),De(P),y instanceof HTMLVideoElement&&!y.paused&&sn(P),!0},o=(y,b)=>{if(i)return!1;let A=br(y);if(!A)return!1;let _=e.get(A);if(!_){let T=xr(A);if(!It(T)||!r(A,T,"attribute"))return!1;_=e.get(A)}return _?(_.compare=Df(b),De(_),!0):!1},a=y=>{let b=e.get(y);b&&(nm(b),e.delete(y),t.delete(y))},u=()=>{if(i)return 0;let y=new Set;document.querySelectorAll(`video[${Ue}], img[${Ue}]`).forEach(A=>{if(!ut(A))return;y.add(A);let _=xr(A);It(_)?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=br(y);if(!A)return!1;let _=Ei(b);return It(_)?r(A,_,"live"):(a(A),!0)},d=(y,b)=>{if(!ut(y))return!1;let A=e.get(y);return A?(A.sourceVisibleForCanvas=b,!0):!1},m=y=>{let b=br(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 _=xr(b);return It(_)?{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},f=()=>{if(!i){i=!0,n?.disconnect(),n=null;for(let y of Array.from(t))a(y)}};document.body&&(n=new MutationObserver(()=>u()),n.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[Ue]}));let x={refresh:u,redraw:s,setGrading:l,setCompare:o,setSourceVisibility:d,getStatus:m,destroy:f},S=window;return S.__hf=S.__hf||{},S.__hf.colorGrading=x,u(),x}var Vn=class{constructor(t){he(this,"_baseTime",0);he(this,"_playStartMs",null);he(this,"_rate",1);he(this,"_duration",1/0);he(this,"_nowMs");he(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 Za(e){return!Number.isFinite(e)||e<=0?1:e}function rm(e,t){t||e.paused||!pn().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function om(e,t){let{elapsed:n,mediaStart:i,scheduledAt:r,safeRate:o,clipDuration:a}=t,u=Number.isFinite(a)&&a>0,s=a*o;if(n>=0){let d=s-n;return u&&d<=0?!1:(u?e.start(0,n+i,d):e.start(0,n+i),!0)}let l=-n/o;return u?e.start(r+l,i,s):e.start(r+l,i),!0}var zn=class{constructor(){he(this,"_ctx",null);he(this,"_bufferCache",new Map);he(this,"_failedSrcs",new Set);he(this,"_activeSources",[]);he(this,"_masterGain",null);he(this,"_rateAnchorCtx",0);he(this,"_rateAnchorComp",0);he(this,"_rate",1);he(this,"_paused",!0);he(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 M("webAudioTransport.fetch",new Error(`${r.status} ${n}`)),null;i=await r.arrayBuffer()}catch(r){return M("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),M("webAudioTransport.decode",r),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}async schedulePlayback(t,n,i,r,o,a,u,s=1,l=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||u!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),u!==this._playGeneration)return null;let d=Za(s),m=this._ctx.createBufferSource();m.buffer=n,m.playbackRate.value=d;let f=this._ctx.createGain();f.gain.value=a,m.connect(f),f.connect(this._masterGain);let x=o-i,S=this._ctx.currentTime;if(this._rate=d,this._rateAnchorCtx=S,this._rateAnchorComp=o,!om(m,{elapsed:x,mediaStart:r,scheduledAt:S,safeRate:d,clipDuration:l}))return m.disconnect(),f.disconnect(),null;let y=t.muted;t.muted=!0,rm(t,y);let b={el:t,sourceNode:m,gainNode:f,compositionStart:i,mediaStart:r,scheduledAt:S,priorMuted:y,bounded:Number.isFinite(l)&&l>0};return this._activeSources.push(b),this._paused=!1,m.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(d){return M("webAudioTransport.schedule",d),null}}setRate(t){let n=Za(t);if(n===this._rate)return!1;this._ctx&&!this._paused&&(this._rateAnchorComp=this.getTime(),this._rateAnchorCtx=this._ctx.currentTime),this._rate=n;for(let i of this._activeSources)try{i.sourceNode.playbackRate.value=n}catch(r){M("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){M("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 el="data-hf-studio-manual-edit-gesture";function tl(e){return!Number.isInteger(e.tick)||e.tick<=0||e.tick%60!==0?!1:!(e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2)}var Ar="data-hf-authored-duration",wr="data-hf-authored-end";function sm(){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 nl(){let e=Do();Hn(document),pr(document);let t=sm();e.canonicalFps=t.fps??e.canonicalFps,Kr(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,u=null;if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(c){M("runtime.init.site1",c)}let s=new Vn;e.transportClock=s;let l=new zn,d=!1;l.init().then(c=>{d=c}),(()=>{let c=window.gsap,p=window;if(!(!c?.registerPlugin||p.__hfAutoNoopRegistered))try{c.registerPlugin({name:"_auto",init:()=>!1}),p.__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{eo(document)}catch(c){M("runtime.init.cssVariables",c)}window.__timelines=window.__timelines||{};let f=()=>{let c=document.querySelector(\'[data-composition-id][data-root="true"]\');if(c instanceof HTMLElement)return c;let p=Array.from(document.querySelectorAll("[data-composition-id]"));return p.find(g=>!g.parentElement?.closest("[data-composition-id]"))??p[0]??null};if(Array.isArray(window.__timelines)){let c=window.__timelines,p=f()?.getAttribute("data-composition-id")??"root",g={};if(c.length===1)g[p]=c[0];else for(let h=0;h<c.length;h++)g[`tl-${h}`]=c[h];window.__timelines=g}let x=f();x&&!x.hasAttribute("data-start")&&x.setAttribute("data-start","0");let S=c=>{o.push(c)},y=(c,p,g)=>{let h=g??`${c}:${JSON.stringify(p)}`;a.has(h)||(a.add(h),xe({source:"hf-preview",type:"diagnostic",code:c,details:p}))},b=c=>{let p={scale:1,focusX:960,focusY:540},g=[],h=[],E={time:c.getTime(),duration:c.getDuration(),isPlaying:c.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:c.play,pause:c.pause,seek:c.seek,getTime:c.getTime,getDuration:c.getDuration,isPlaying:c.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>p,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>g,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:c.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>h,getRenderState:()=>({...E,time:c.getTime(),duration:c.getDuration(),isPlaying:c.isPlaying()})}},A=1/60,_=.75,T=.05,z=100,P=240,v=c=>{if(c instanceof Error)return c.message||String(c);if(typeof c=="string")return c;try{return JSON.stringify(c)}catch{return String(c??"")}},w=c=>{let p=c.toLowerCase();return p.includes("cannot read properties of null")||p.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:p.includes("failed to execute \'queryselector\'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:p.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},C=c=>{if(c==null||c.trim()==="")return null;let p=Number.parseFloat(c);return!Number.isFinite(p)||p<=0?null:`${p}px`},F=()=>f(),L=()=>{let c=F();if(!c)return;let p=C(c.getAttribute("data-width")),g=C(c.getAttribute("data-height"));p&&(c.style.width=p),g&&(c.style.height=g),p&&c.style.setProperty("--comp-width",p),g&&c.style.setProperty("--comp-height",g)},R=()=>{let c=F(),p=Array.from(document.querySelectorAll("[data-composition-id]")).filter(g=>g.hasAttribute("data-duration")||g.hasAttribute("data-end"));for(let g of p){if(c&&g===c)continue;let h=g.getAttribute("data-duration"),E=g.getAttribute("data-end");h!=null&&!g.hasAttribute(Ar)&&g.setAttribute(Ar,h),E!=null&&!g.hasAttribute(wr)&&g.setAttribute(wr,E),g.removeAttribute("data-duration"),g.removeAttribute("data-end")}},U=()=>{let c=F();if(!c)return;c.style.position||(c.style.position="relative"),c.style.overflow="hidden";let p=C(c.getAttribute("data-width")),g=C(c.getAttribute("data-height"));p&&(c.style.width=p),g&&(c.style.height=g);let h=Array.from(c.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%",Q=/translate\\(\\s*-50%\\s*,\\s*-50%\\s*\\)/.test(E.style.transform);if(O&&Q&&!E.hasAttribute("data-width")&&!E.hasAttribute("data-height")){let ye=E.style.top,vt=E.style.left,Se=E.style.width,Tt=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=vt,E.style.width=Se,E.style.height=Tt)}let $=window.getComputedStyle(E),de=$.position;if(de!=="absolute"&&de!=="fixed"&&(E.style.position="absolute"),!!E.style.top||!!E.style.bottom||$.top!=="auto"||$.bottom!=="auto"||(E.style.top="0"),!!E.style.left||!!E.style.right||$.left!=="auto"||$.right!=="auto"||(E.style.left="0"),N!=="audio"){let ye=C(E.getAttribute("data-width")),vt=C(E.getAttribute("data-height")),Se=$.width!=="0px"&&$.width!=="auto",Tt=$.height!=="0px"&&$.height!=="auto";ye?!E.style.width&&!Se&&(E.style.width=ye):!E.style.width&&$.width==="0px"&&(E.style.width="100%"),vt?!E.style.height&&!Tt&&(E.style.height=vt):!E.style.height&&$.height==="0px"&&(E.style.height="100%")}}},I=(c,p=0,g)=>$e({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:g?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(c,p),Y=(c,p)=>$e({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:p?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(c),D=(c,p=0)=>!c.hasAttribute("data-hf-auto-start")&&c.hasAttribute("data-start")?Math.max(0,Number(c.getAttribute("data-start")??0)||0)+p:I(c,p),ie=(c,p)=>{let g=c.tagName.toLowerCase();if(g==="script"||g==="style"||g==="link"||g==="meta")return!1;let h=g==="video"||g==="audio"?D(c,0):I(c,0),E=Y(c),N=c.getAttribute("data-composition-id");if(N){let Q=(window.__timelines??{})[N],$=null;if(Q&&typeof Q.duration=="function"){let me=Number(Q.duration());Number.isFinite(me)&&me>0&&($=me)}!(c.hasAttribute("data-duration")||c.hasAttribute("data-end")||c.hasAttribute(Ar)||c.hasAttribute(wr))&&(E==null||E<=0)&&$!=null&&(E=$)}let O=E!=null&&E>0?h+E:Number.POSITIVE_INFINITY;return p>=h&&(Number.isFinite(O)?p<O:!0)},Fe=!!document.querySelector("[data-composition-src]"),j=!1;{let c=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let p of c){let g=p.getAttribute("data-composition-id");if(g&&p.children.length===0&&document.querySelector(`template#${CSS.escape(g)}-template`)){j=!0;break}}}let X=!Fe&&!j,B=c=>{if(!c||typeof c.duration!="function")return null;try{let p=Number(c.duration());return Number.isFinite(p)?Math.max(0,p):null}catch{return null}},V=c=>typeof c=="number"&&Number.isFinite(c)&&c>A,_e=c=>{let p=Number(c.getAttribute("data-duration"));if(Number.isFinite(p)&&p>0)return p;let g=Number(c.getAttribute("data-playback-start")??c.getAttribute("data-media-start")??"0"),h=Number.isFinite(g)?Math.max(0,g):0;return Number.isFinite(c.duration)&&c.duration>h?Math.max(0,c.duration-h):null},H=()=>{let c=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(c.length===0)return null;let p=0;for(let g of c){let h=D(g,0);if(!Number.isFinite(h))continue;let E=_e(g);E==null||E<=A||(p=Math.max(p,Math.max(0,h)+E))}return p>A?p:null},k=()=>{let c=F();if(!c)return null;let p=window.__timelines??{},g=$e({timelineRegistry:p,includeAuthoredTimingAttrs:!0}),h=0,E=Number.parseFloat(c.getAttribute("data-duration")??"");Number.isFinite(E)&&E>0&&(h=E);let N=Array.from(c.querySelectorAll("[data-composition-id][data-start]"));for(let O of N){if(!(O instanceof Element)||O.parentElement?.closest("[data-composition-id]")!==c)continue;let $=g.resolveStartForElement(O,0),de=g.resolveDurationForElement(O);!Number.isFinite($)||de==null||de<=0||(h=Math.max(h,Math.max(0,$)+de))}return h>A?h:null},G=()=>{let c=H();return typeof c!="number"||!Number.isFinite(c)||c<=A?null:c},le=c=>V(c)?Math.max(A,c*_):A,oe=()=>{let c=0;for(let p of e.deterministicAdapters){let g=p.getInferredDurationSeconds;if(typeof g!="function")continue;let h=null;try{h=g()}catch(E){M("runtime.init.adapterDuration",E)}typeof h=="number"&&Number.isFinite(h)&&h>0&&(c=Math.max(c,h))}return c>A?c:null},W=(c,p=0)=>{let g=B(c),h=G(),E=k(),N=oe(),O=Math.max(h??0,E??0,N??0),Q=Number.isFinite(p)&&p>A?p:0,$=0;return V(g)?$=Math.max(g,O,Q):V(O)?$=Math.max(O,Q):$=Q,$>0?Math.max(0,$):0},q=()=>{let c=window.__timelines??{},p=ne=>{let Z=Object.entries(c).filter(re=>!!re[1]&&typeof re[1].play=="function"&&typeof re[1].pause=="function");if(Z.length!==1)return{timeline:null};let ce=Z[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=$e({timelineRegistry:c,includeAuthoredTimingAttrs:!0}),h=G(),E=k(),N=Math.max(h??0,E??0)||null,O=le(N),Q=ne=>{let Z=document.querySelector(`[data-composition-id="${CSS.escape(ne)}"]`);return Z?g.resolveStartForElement(Z,0):0},$=ne=>{let Z=window.gsap;if(!Z||typeof Z.timeline!="function")return null;let ce=Z.timeline({paused:!0});for(let fe of ne)ce.add(fe.timeline,Q(fe.compositionId));return ce},de=(ne,Z)=>{if(!V(ne))return null;let ce=window.gsap;if(!ce||typeof ce.timeline!="function")return null;let fe=ce.timeline({paused:!0});if(Z)try{fe.add(Z,0)}catch(re){M("runtime.init.site2",re)}let pe=fe;if(typeof pe.to=="function")try{pe.to({},{duration:ne})}catch(re){M("runtime.init.site3",re)}return fe},me=(ne,Z)=>{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 Z)if(!fe.some(Le=>Le===re.timeline))try{let Le=Q(re.compositionId);ne.add(re.timeline,Le),pe.push(re.compositionId)}catch(Le){M("runtime.init.site4",Le)}return pe}catch{return[]}},se=F(),te=se?.getAttribute("data-composition-id")??null;if(!te)return p("root_missing_composition_id");let ye=c[te]??null,Se=(()=>{if(!se)return[];let ne=new Set,Z=Array.from(se.querySelectorAll("[data-composition-id]")),ce=[];for(let fe of Z){let pe=fe.getAttribute("data-composition-id");if(!pe||pe===te||ne.has(pe))continue;ne.add(pe);let re=c[pe]??null;if(!re||typeof re.play!="function"||typeof re.pause!="function")continue;let Ce=B(re);ce.push({compositionId:pe,timeline:re,durationSeconds:Ce??0})}return ce})(),Tt=ne=>{for(let Z of ne){let ce=Z.timeline;if(typeof ce.paused=="function")try{ce.paused(!1)}catch(fe){M("runtime.init.site5",fe)}}};if(Se.length>0&&Tt(Se),ye){let ne=Se.length>0?me(ye,Se):[];if((Se.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id=\'"+te+"\'])"))&&(K=!0),ne.length>0)try{let re=ye.time();ye.seek(re,!1)}catch{}let Z=B(ye);if(!V(Z)&&Se.length>0){let re=Se.map(ql=>ql.compositionId),Ce=$(Se),Le=B(Ce);if(Ce&&V(Le))return{timeline:Ce,selectedTimelineIds:re,selectedDurationSeconds:Le,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:te,rootDurationSeconds:Z,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:O,selectedDurationSeconds:Le,mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:E,selectedTimelineIds:re,autoNestedChildren:ne}}};let oi=de(N??0,ye),si=B(oi);if(oi&&V(si))return{timeline:oi,selectedTimelineIds:[te],selectedDurationSeconds:si,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:te,rootDurationSeconds:Z,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:E,selectedDurationSeconds:si,selectedTimelineIds:[te],autoNestedChildren:ne}}}}if(!V(Z)&&Se.length===0){let re=de(N??0,ye),Ce=B(re);if(re&&V(Ce))return{timeline:re,selectedTimelineIds:[te],selectedDurationSeconds:Ce,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:te,rootDurationSeconds:Z,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:E,selectedDurationSeconds:Ce,selectedTimelineIds:[te]}}}}let ce=se?.getAttribute("data-duration"),fe=ce?parseFloat(ce):null,pe=Math.max(V(fe)?fe:0,E??0);if(pe>0&&V(pe)&&V(Z)&&pe>=Z+.5){let re=ye;if(typeof re.to=="function")try{re.to({},{duration:0},pe)}catch(Le){M("runtime.init.site6",Le)}let Ce=B(ye);if(V(Ce))return{timeline:ye,selectedTimelineIds:[te],selectedDurationSeconds:Ce,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:te,rootDurationSeconds:Z,rootDeclaredDur:fe,authoredCompositionDurationFloorSeconds:E,newDur:Ce}}}}return{timeline:ye,selectedTimelineIds:[te],selectedDurationSeconds:Z,mediaDurationFloorSeconds:h,diagnostics:ne.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:te,selectedDurationSeconds:Z,autoNestedChildren:ne}}:void 0}}if(Se.length>0){let ne=Se.map(fe=>fe.compositionId),Z=$(Se),ce=B(Z);if(Z)return{timeline:Z,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 p("root_composition_id_unmatched_in_registry")},K=!1,Ae=()=>{if(!X)return!1;let c=e.capturedTimeline,p=B(c),g=V(p);if(c&&g&&K)return!1;let h=q();if(!h.timeline)return!1;if(c&&c===h.timeline)return typeof c.timeScale=="function"&&c.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),e.capturedTimeline.pause()),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),e.capturedTimeline.pause()}let N=window.__hfStudioManualEditsApply;typeof N=="function"&&N(),Hn(document)}if(h.diagnostics&&xe({source:"hf-preview",type:"diagnostic",code:h.diagnostics.code,details:h.diagnostics.details}),xe({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=F(),O=E>0?E:0,Q=String(O>0?O:1),$=new Set,de=new Set(document.querySelectorAll("[data-start]")),me=se=>{let te=se.parentElement;for(;te&&te!==N;){if(de.has(te))return!0;te=te.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let se of e.capturedTimeline.getChildren(!0))if(typeof se.targets=="function")for(let te of se.targets())te instanceof HTMLElement&&te!==N&&(te.hasAttribute("data-start")||me(te)||$.has(te)||($.add(te),te.setAttribute("data-start","0"),te.setAttribute("data-duration",Q),te.setAttribute("data-hf-autostamped","1")))}catch{}if(N instanceof HTMLElement)for(let se of N.querySelectorAll("[id]"))se instanceof HTMLElement&&se!==N&&(se.hasAttribute("data-start")||me(se)||$.has(se)||se.tagName==="SCRIPT"||se.tagName==="STYLE"||se.tagName==="LINK"||($.add(se),se.setAttribute("data-start","0"),se.setAttribute("data-duration",Q),se.setAttribute("data-hf-autostamped","1")))}for(let N of wt)un.delete(N),kr(N);return!0};window.__hfForceTimelineRebind=()=>{K=!1,Ae(),Ir(e.currentTime)};let we=()=>{let c=F();if(!(c instanceof HTMLElement))return;let p=c.getBoundingClientRect(),g=Number(c.getAttribute("data-width")),h=Number(c.getAttribute("data-height")),E=window.getComputedStyle(c),N=Number.isFinite(g)&&g>0&&Number.isFinite(h)&&h>0,O=p.width<=0||p.height<=0||c.clientWidth<=0||c.clientHeight<=0;!N||!O||y("root_stage_layout_zero",{compositionId:c.getAttribute("data-composition-id")??null,declaredWidth:g,declaredHeight:h,rectWidth:Math.round(p.width),rectHeight:Math.round(p.height),clientWidth:c.clientWidth,clientHeight:c.clientHeight,display:E.display,visibility:E.visibility,overflow:E.overflow},`root-stage-layout-zero:${c.getAttribute("data-composition-id")??"unknown"}`)},At=()=>{e.tornDown||(u!=null&&window.cancelAnimationFrame(u),u=window.requestAnimationFrame(()=>{u=null,we()}))},Ge=()=>{i=c=>{let p=v(c.error??c.message).slice(0,P);if(!p)return;let g=w(p);xe({source:"hf-preview",type:"diagnostic",code:g.code,details:{category:g.category,message:p,filename:c.filename||null,line:Number.isFinite(c.lineno)?c.lineno:null,column:Number.isFinite(c.colno)?c.colno:null}})},r=c=>{let p=v(c.reason).slice(0,P);if(!p)return;let g=w(p);xe({source:"hf-preview",type:"diagnostic",code:`${g.code}_unhandled_rejection`,details:{category:`${g.category}-unhandled-rejection`,message:p}})},window.addEventListener("error",i),window.addEventListener("unhandledrejection",r)},Ml=()=>{let c=Array.from(document.querySelectorAll("img, video, audio, source, link[rel=\'stylesheet\']"));for(let g of c){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 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&&y("runtime_font_load_issue",{failedFamilies:g,totalFaces:Array.from(p).length},`runtime-font-load-issue:${g.join("|")}`)}).catch(()=>{})},Nl=(c,p)=>{if(!c.timeline)return!1;let g=e.capturedTimeline;if(g&&g===c.timeline)return!1;let h=Math.max(0,e.currentTime||0),E=e.isPlaying;e.capturedTimeline=c.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{e.capturedTimeline.pause(),e.capturedTimeline.seek(h,!1),E&&e.capturedTimeline.play()}catch(N){M("runtime.init.site7",N)}return xe({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:p,previousTime:h,selectedTimelineIds:c.selectedTimelineIds??[],selectedDurationSeconds:c.selectedDurationSeconds??null,mediaDurationFloorSeconds:c.mediaDurationFloorSeconds??null}}),!0},tt=null,Rr=!1,wt=new Set,un=new WeakMap,cn=()=>{e.tornDown||(tt!=null&&window.clearTimeout(tt),tt=window.setTimeout(()=>{if(e.tornDown)return;tt=null;let c=q();if(!c.timeline||!V(c.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){Ae()&&(nt(),ve(!0));return}if(Rr)return;let g=B(e.capturedTimeline),h=c.selectedDurationSeconds??B(c.timeline);V(h)&&(!V(g)||h>=g+T)&&Nl(c,"manual")&&(Rr=!0,xe({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:g??null,selectedDurationSeconds:h??null,selectedTimelineIds:c.selectedTimelineIds??[],mediaDurationFloorSeconds:c.mediaDurationFloorSeconds??null}}),nt(),ve(!0))},z))},Ll=()=>{for(let c of wt)c.removeEventListener("loadedmetadata",cn),c.removeEventListener("durationchange",cn);wt.clear()},Xn=()=>{if(e.tornDown)return;let c=Array.from(document.querySelectorAll("video, audio"));for(let p of c){if(wt.has(p))continue;wt.add(p);let g=Number.parseFloat(p.dataset.volume??"");Number.isFinite(g)&&(p.volume=Math.max(0,Math.min(1,g))),p.addEventListener("loadedmetadata",cn),p.addEventListener("durationchange",cn),p.preload!=="auto"&&(p.preload="auto"),p.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&p.load(),kr(p)}},kr=c=>{un.has(c)||Eo(c,e.capturedTimeline,W(e.capturedTimeline,0),un)},Yn=new WeakMap,Dr=c=>{let p=Yn.get(c);if(p!==void 0)return p;let g=window.getComputedStyle(c).position,h=g==="static"||g==="relative"||g==="sticky";return Yn.set(c,h),h},Qn=new WeakMap,Rl=c=>{let p=Qn.get(c);if(p!==void 0)return p;let g=c.querySelector("[data-start]")===null;return Qn.set(c,g),g},kl=()=>{Yn=new WeakMap,Qn=new WeakMap},Zn=new WeakMap,dn=new WeakSet,Ir=c=>{let p=Array.from(document.querySelectorAll("[data-start]")),g=F();for(let h of p){if(!(h instanceof HTMLElement))continue;if(h.hasAttribute("data-hidden")){dn.has(h)||(Zn.set(h,h.style.getPropertyValue("display")),dn.add(h)),h.style.display="none",(h instanceof HTMLVideoElement||h instanceof HTMLImageElement)&&n?.setSourceVisibility(h,!1);continue}if(dn.has(h)){let N=Zn.get(h);N?h.style.display=N:h.style.removeProperty("display"),Zn.delete(h),dn.delete(h)}let E=ie(h,c);if(E){let N=h.parentElement;for(;N&&N!==g;){if(N instanceof HTMLElement&&N.hasAttribute("data-start")&&!ie(N,c)){E=!1;break}N=N.parentElement}}h.style.visibility=E?"visible":"hidden",(h instanceof HTMLVideoElement||h instanceof HTMLImageElement)&&n?.setSourceVisibility(h,E),E?Dr(h)&&h.style.removeProperty("display"):Dr(h)&&Rl(h)&&(h.style.display="none")}},Me=()=>{let c=h=>{let E=h.closest("[data-composition-id]"),N=E?I(E,0):null,O=E?Y(E,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:E,inheritedStart:N,inheritedDuration:O}},p=wo({shouldIncludeElement:h=>h.hasAttribute("data-start")||!!c(h).compositionRoot,resolveStartSeconds:h=>{let E=c(h);return D(h,E.inheritedStart??0)},resolveDurationSeconds:h=>{let E=c(h),N=D(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-N):null,$=Number.isFinite(h.duration)&&h.duration>O?Math.max(0,h.duration-O):null,de=Number.parseFloat(h.dataset.duration??""),me=Number.isFinite(de)&&de>0?de:null;return Ao({isVideo:h.tagName==="VIDEO",sourceDuration:$,hostRemaining:Q,explicitDuration:me})}});for(let h of p.mediaClips){let E=un.get(h.el);E&&(h.volumeKeyframes=E)}let g=e.mediaForceSyncNextTick;g&&(e.mediaForceSyncNextTick=!1),e.nativeMediaSyncDisabled||Co({clips:p.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,xe({source:"hf-preview",type:"media-autoplay-blocked"}))}}),Ir(e.currentTime)},ve=c=>{let p=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),g=Date.now();(c||p!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||g-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=p,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=g,xe({source:"hf-preview",type:"state",frame:p,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},ei="",Pr=0,Dl=()=>{let c="";for(let p of document.querySelectorAll("[data-start]"))c+=`${p.id}:${p.tagName}|`;return c},nt=()=>{R(),L(),U();let c=F();if(c){let h=C(c.getAttribute("data-width")),E=C(c.getAttribute("data-height")),N=h?parseInt(h,10):0,O=E?parseInt(E,10):0;N>0&&O>0&&xe({source:"hf-preview",type:"stage-size",width:N,height:O})}Ae();let p=Go({canonicalFps:e.canonicalFps});window.__clipManifest=p;let g=Dl();if(ei!==g&&kl(),!window.__clipTree||ei!==g){let h=window;window.__clipTree=Io({startResolver:$e({timelineRegistry:h.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:h.__timelines??{},rootDuration:p.durationInFrames/e.canonicalFps}),ei=g}xe(p),At()},ti=c=>Number.isFinite(c)&&c>0?c:0,Il=c=>{let p=ti(Number(c));if(p<=0)return;let g=F(),h=ti(Number.parseFloat(g?.getAttribute("data-duration")??"")),E=Math.max(Pr,ti(s.getDuration()),h);p<=E||(Pr=p,g?.setAttribute("data-duration",String(p)),s.setDuration(p),nt(),ve(!0))},Pe=(c,p=0)=>{for(let g of e.deterministicAdapters){try{c==="discover"&&g.discover(),c==="pause"&&g.pause(),c==="play"&&g.play&&g.play()}catch(h){M("runtime.init.site8",h)}if(c==="discover")try{g.seek({time:p,suppressEvents:!0})}catch(h){M("runtime.init.site9",h)}}},it=()=>{window.__renderReady=!1},Ct=null,Ft=!0,Pl=()=>{let c=[];for(let p of e.deterministicAdapters){let g=p.getReadyPromise;if(typeof g=="function")try{let h=g();h&&c.push(h)}catch(h){M("runtime.init.adapterReady",h)}}return c},Ol=()=>{let c=Pl();if(c.length===0)return Ct=null,Ft=!0,!0;let p=c[0];if(!p)return!0;let g=c.length===1?p:Promise.all(c);return g!==Ct&&(Ct=g,Ft=!1,Promise.resolve(g).then(()=>{Ct===g&&(Ft=!0,it())},h=>{Ct===g&&(Ft=!0,M("runtime.init.adapterReady",h),it())})),Ft};if(X)lr();else{let c={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:C,onDiagnostic:({code:p,details:g})=>{xe({source:"hf-preview",type:"diagnostic",code:p,details:g})}};va(c).then(()=>_a(c)).finally(()=>{X=!0,Xn(),Ml(),lr(),pr(document),it()})}let fn=No({postMessage:c=>xe(c)});fn.installPickerApi();let We=Qa();n=We,S(()=>{We.destroy(),n=null});let ni=c=>{let p=Number(c);!Number.isFinite(p)||p<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,p)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let g=document.querySelectorAll("video, audio");for(let h of g)if(h instanceof HTMLMediaElement)try{h.playbackRate=e.playbackRate}catch(E){M("runtime.init.site10",E)}},Or={play:()=>{let c=e.capturedTimeline;if(s.isPlaying())return;let p=W(c,0);if(p>0)s.setDuration(p),s.reachedEnd()&&(s.seek(0),e.currentTime=0,rt(0));else{let g=F(),h=Number(g?.getAttribute("data-duration")??0);h>0&&s.setDuration(h)}c&&c.pause(),s.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,Ur(s.now()),d&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&Vr(),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,Ur(e.currentTime);let c=e.capturedTimeline;c&&c.pause(),Pe("pause"),Me(),We.redraw(),ve(!0)},seek:(c,p)=>{let g=ft(Math.max(0,Number(c)||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(E&&E.pause(),rt(e.currentTime),Pe("pause"),p?.keepPlaying&&h){Or.play();return}Me(),We.redraw(),ve(!0)},renderSeek:(c,p)=>{let g=ft(Math.max(0,Number(c)||0),e.canonicalFps);l.stopAll(),s.detachAudioSource(),s.isPlaying()&&s.pause(),s.seek(g),e.currentTime=s.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0,rt(e.currentTime,{activateChildren:!0,suppressEvents:p?.suppressEvents}),Me(),We.redraw(),ve(!0)},getTime:()=>s.now(),getDuration:()=>{let c=s.getDuration();return Number.isFinite(c)?c:0},isPlaying:()=>s.isPlaying(),setPlaybackRate:c=>{ni(c),s.setRate(e.playbackRate),zr()},getPlaybackRate:()=>e.playbackRate},Br=W(e.capturedTimeline,0);Br>0&&s.setDuration(Br);let Ne=ko({getTimeline:()=>e.capturedTimeline,setTimeline:c=>{e.capturedTimeline=c},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:c=>{e.isPlaying!==c&&(e.mediaForceSyncNextTick=!0),e.isPlaying=c},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:ni,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(c,p)=>{e.currentTime=Math.max(0,Number(c)||0),e.isPlaying!==p&&(e.mediaForceSyncNextTick=!0),e.isPlaying=p,Me()},onStatePost:ve,onDeterministicSeek:(c,p)=>{for(let g of e.deterministicAdapters)if(!(g.name==="gsap"&&e.capturedTimeline))try{g.seek({time:Number(c)||0,suppressEvents:p?.suppressEvents})}catch(h){M("runtime.init.site11",h)}},onDeterministicPause:()=>Pe("pause"),onDeterministicPlay:()=>Pe("play"),onRenderFrameSeek:()=>{We.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>W(e.capturedTimeline,0),transport:Or});window.__player=b(Ne),window.__playerReady=!0,Xr(xe),ot("composition_loaded",{duration:Ne.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.controlBridgeHandler=Jr({onPlay:()=>{Ne.play(),ot("composition_played",{time:Ne.getTime()})},onPause:()=>{Ne.pause(),ot("composition_paused",{time:Ne.getTime()})},onStopMedia:()=>{l.stopAll();let c=document.querySelectorAll("video, audio");for(let p of c)p instanceof HTMLMediaElement&&!p.paused&&p.pause()},onSeek:(c,p)=>{Ne.seek(c),ot("composition_seeked",{time:c})},onSetMuted:c=>{e.bridgeMuted=c;let p=c||e.mediaOutputMuted;l.setMuted(p);let g=document.querySelectorAll("video, audio");for(let h of g)h instanceof HTMLMediaElement&&(h.muted=p||h.defaultMuted)},onSetVolume:c=>{e.bridgeVolume=c,l.setVolume(c);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*c}},onSetMediaOutputMuted:c=>{e.mediaOutputMuted=c;let p=c||e.bridgeMuted;l.setMuted(p);let g=document.querySelectorAll("video, audio");for(let h of g)h instanceof HTMLMediaElement&&(h.muted=p||h.defaultMuted)},onSetNativeMediaSyncDisabled:c=>{e.nativeMediaSyncDisabled!==c&&(e.nativeMediaSyncDisabled=c,e.mediaForceSyncNextTick=!0,c?(l.stopAll(),s.detachAudioSource()):Me())},onSetWebAudioMediaDisabled:c=>{e.webAudioMediaDisabled!==c&&(e.webAudioMediaDisabled=c,e.mediaForceSyncNextTick=!0,c&&(l.stopAll(),s.detachAudioSource()),Me())},onSetPlaybackRate:c=>{ni(c),e.transportClock&&e.transportClock.setRate(e.playbackRate),zr()},onSetRootDuration:Il,onSetColorGrading:(c,p)=>{We.setGrading(c,p)},onSetColorGradingCompare:(c,p)=>{We.setCompare(c,p)},onTick:()=>{if(e.tornDown||!s.isPlaying())return;let c=s.now();if(e.currentTime=c,rt(c),s.reachedEnd()){l.stopAll(),s.detachAudioSource(),s.pause(),e.isPlaying=!1;let p=s.getDuration();Number.isFinite(p)&&(s.seek(p),e.currentTime=p,rt(p)),Pe("pause"),Me(),ve(!0)}},onEnablePickMode:()=>fn.enablePickMode(),onDisablePickMode:()=>fn.disablePickMode(),getCanonicalFps:()=>e.canonicalFps}),e.deterministicAdapters=[yo(),no({resolveStartSeconds:c=>I(c,0)}),ro(),so(),lo(),uo(),co(),fo(),mo(),po(),ho(),io({getTimeline:()=>e.capturedTimeline})],xo(),bo(),window.__hfReseekGpu=c=>{let p=Math.max(0,Number(c)||0);window.__hfThreeTime=p,window.__hfTypegpuTime=p,ao(p)},Ge(),Xn(),Pe("discover");let Bl=()=>{let c=e.capturedTimeline,p=Ae();e.capturedTimeline&&(p||e.capturedTimeline!==c||!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=F()?.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,nt(),ve(!0)},ct=null,Hl=()=>{if(ct)return;let c=()=>{window.removeEventListener("hf-timelines-built",c),ct=null,it()};ct=c,window.addEventListener("hf-timelines-built",c)};S(()=>{ct&&(window.removeEventListener("hf-timelines-built",ct),ct=null)}),it=()=>{if(!X){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,Hl();return}if(Pe("discover",e.currentTime),!Ol()){window.__renderReady=!1;return}Bl()},it(),X&&setTimeout(()=>{it()},0);let mn=0,ii=!1,Gl=(c,p,g,h)=>{try{let E=h?.suppressEvents===!0;c.pause(),typeof c.totalTime=="function"?c.totalTime(p,E):c.seek(p,E)}catch(E){M(g,E)}},Wl=(c,p)=>{let g=window.__timelines??{},h=F()?.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 Q=I(O,0);if(!Number.isFinite(Q))continue;let $=Y(O,{includeAuthoredTimingAttrs:!0}),de=B(N),me=$!=null&&$>0?$:de,se=Math.max(0,me!=null&&me>0?Math.min(me,c-Q):c-Q);Gl(N,se,"runtime.init.transport.childTimeline",p)}},Ul=c=>{let p=window.__timelines??{};for(let g of Object.values(p))if(!(!g||g===c))try{g.play()}catch(h){M("runtime.init.activateSiblings",h)}},Hr=c=>typeof c=="object"&&c!==null,_t=new WeakMap,Vl=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],Gr=(c,p)=>{let g=c[p];if(typeof g!="function")return null;try{let h=Number(g.call(c));return Number.isFinite(h)?h:null}catch(h){return M("runtime.init.gsapCallbackDuration",h),null}},zl=c=>{let p=_t.get(c);if(p!=null)return p;if(!("getChildren"in c)||typeof c.getChildren!="function")return!1;let g;try{g=c.getChildren(!0,!0,!0)}catch(h){return M("runtime.init.gsapCallbackChildren",h),_t.set(c,!1),!1}if(!Array.isArray(g))return _t.set(c,!1),!1;for(let h of g){if(!Hr(h))continue;let E=h.vars;if(!Hr(E)||!Vl.some($=>typeof E[$]=="function"))continue;let Q=Gr(h,"totalDuration")??Gr(h,"duration");if(Q!=null&&Q<=1e-6)return _t.set(c,!0),!0}return _t.set(c,!1),!1},rt=(c,p)=>{let g=e.capturedTimeline,h=p?.suppressEvents===!0;if(g){p?.activateChildren&&Ul(g);let E=g,N=c;if(typeof E.totalDuration=="function")try{let O=Number(E.totalDuration());Number.isFinite(O)&&O>0&&c>O&&(N=O)}catch(O){M("runtime.init.transport.clampDuration",O)}try{typeof g.totalTime=="function"?(g.totalTime(N,h),!h&&!zl(g)&&(g.totalTime(N+.001,!0),g.totalTime(N,!0))):g.seek(N,h)}catch(O){M("runtime.init.transport.seek",O)}}else Wl(c,p);for(let E of e.deterministicAdapters)if(!(E.name==="gsap"&&g))try{E.seek({time:c,suppressEvents:h})}catch(N){M("runtime.init.transport.adapter",N)}},jl=()=>{try{return document.querySelector(`[${el}]`)!=null}catch{return!1}},Wr=()=>{if(!(e.tornDown||ii)){ii=!0;try{if(e.transportRafId=window.requestAnimationFrame(Wr),mn+=1,tl({tick:mn,isPlaying:s.isPlaying(),hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:s.now()})){let p=e.capturedTimeline;if(Ae()){e.capturedTimeline&&!Ne._timeline&&(Ne._timeline=e.capturedTimeline),e.capturedTimeline&&e.capturedTimeline!==p&&e.capturedTimeline.pause();let g=W(e.capturedTimeline,0);g>0&&s.setDuration(g),nt()}}if(mn%20===0&&nt(),mn%30===0&&Xn(),e.capturedTimeline){let p=W(e.capturedTimeline,0);p>0&&(!s.isPlaying()||p>=s.getDuration())&&s.setDuration(p)}if(s.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&l.isActive()&&l.context){let p=l.getTime();p>=0&&s.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??""),N=Number.parseFloat(h.dataset.duration??""),O=Number.isFinite(N)&&N>0?E+N: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&&(s.attachAudioSource({currentTimeSeconds:e.currentTime}),g=!0):(s.attachAudioSource({el:h,compositionStart:E,mediaStart:Q}),g=!0);break}}!g&&s.hasAudioSource()&&s.detachAudioSource()}else s.hasAudioSource()&&s.detachAudioSource();let c=s.now();if(e.currentTime=c,(s.isPlaying()||!jl())&&rt(c),s.isPlaying()&&s.reachedEnd()){l.stopAll(),s.detachAudioSource(),s.pause(),e.isPlaying=!1;let p=s.getDuration();Number.isFinite(p)&&(s.seek(p),e.currentTime=p,rt(p)),Pe("pause"),Me(),ve(!0);return}s.isPlaying()&&Me(),ve(!1)}finally{ii=!1}}},Ur=c=>{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??""),N=Number.isFinite(E)&&E>0?h+E:1/0;if(c<h||c>=N)continue;let O=Number.parseFloat(g.dataset.playbackStart??g.dataset.mediaStart??"0")||0,Q=c-h+O;if(Q>=0)try{g.currentTime=Q}catch{}}},Vr=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let c=l.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,N=Number.parseFloat(g.dataset.volume??""),O=Number.isFinite(N)?N:1,Q=Number.parseFloat(g.dataset.duration??""),$=Number.isFinite(Q)&&Q>0?Q:Number.POSITIVE_INFINITY,de=g.closest("[data-composition-id]");if(de){let me=I(de,0),se=Y(de,{includeAuthoredTimingAttrs:!0});se!=null&&se>0&&($=Math.min($,Math.max(0,me+se-h)))}l.decodeAudioElement(g).then(me=>{!me||!s.isPlaying()||l.schedulePlayback(g,me,h,E,s.now(),O*e.bridgeVolume,c,e.playbackRate,$)})}},zr=()=>{l.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&d&&s.isPlaying()&&l.hasBoundedActiveSources()&&(l.stopAll(),Vr())};if(e.capturedTimeline){let c=W(e.capturedTimeline,0);c>0&&s.setDuration(c),e.capturedTimeline.pause()}ka(window),e.transportRafId=window.requestAnimationFrame(Wr),nt(),ve(!0);let ri=()=>{if(!e.tornDown){e.tornDown=!0,e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),e.transportClock=null,l.destroy(),tt!=null&&(window.clearTimeout(tt),tt=null),u!=null&&(window.cancelAnimationFrame(u),u=null),Ll(),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),fn.disablePickMode();for(let c of e.deterministicAdapters)if(!(!c||typeof c.revert!="function"))try{c.revert()}catch(p){M("runtime.init.site12",p)}e.deterministicAdapters=[];for(let c of o.splice(0))try{c()}catch(p){M("runtime.init.site13",p)}for(let c of e.injectedCompStyles)try{c.remove()}catch(p){M("runtime.init.site14",p)}e.injectedCompStyles=[];for(let c of e.injectedCompLinks)try{c.remove()}catch(p){M("runtime.init.site15",p)}e.injectedCompLinks=[];for(let c of e.injectedCompScripts)try{c.remove()}catch(p){M("runtime.init.site16",p)}e.injectedCompScripts=[],e.capturedTimeline=null,window.__hfRuntimeTeardown===ri&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=ri,e.beforeUnloadHandler=ri,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var il=["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"],Cr=[[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 am(e){if(e<=255)return il[e];let t=0,n=Cr.length-1;for(;t<=n;){let i=t+n>>1,r=Cr[i];if(e<r[0]){n=i-1;continue}if(e>r[1]){t=i+1;continue}return r[2]}return"L"}function lm(e){let t=e.length;if(t===0)return null;let n=new Array(t),i=!1;for(let l=0;l<t;){let d=e.charCodeAt(l),m=d,f=1;if(d>=55296&&d<=56319&&l+1<t){let S=e.charCodeAt(l+1);S>=56320&&S<=57343&&(m=(d-55296<<10)+(S-56320)+65536,f=2)}let x=am(m);(x==="R"||x==="AL"||x==="AN")&&(i=!0);for(let S=0;S<f;S++)n[l+S]=x;l+=f}if(!i)return null;let r=0;for(let l=0;l<t;l++){let d=n[l];if(d==="L"){r=0;break}if(d==="R"||d==="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",u=a,s=u;for(let l=0;l<t;l++)n[l]==="NSM"?n[l]=s:s=n[l];s=u;for(let l=0;l<t;l++){let d=n[l];d==="EN"?n[l]=s==="AL"?"AN":"EN":(d==="R"||d==="L"||d==="AL")&&(s=d)}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 d;for(d=l-1;d>=0&&n[d]==="ET";d--)n[d]="EN";for(d=l+1;d<t&&n[d]==="ET";d++)n[d]="EN"}for(let l=0;l<t;l++){let d=n[l];(d==="WS"||d==="ES"||d==="ET"||d==="CS")&&(n[l]="ON")}s=u;for(let l=0;l<t;l++){let d=n[l];d==="EN"?n[l]=s==="L"?"L":"EN":(d==="R"||d==="L")&&(s=d)}for(let l=0;l<t;l++){if(n[l]!=="ON")continue;let d=l+1;for(;d<t&&n[d]==="ON";)d++;let m=l>0?n[l-1]:u,f=d<t?n[d]:u,x=m!=="L"?"R":"L";if(x===(f!=="L"?"R":"L"))for(let y=l;y<d;y++)n[y]=x;l=d-1}for(let l=0;l<t;l++)n[l]==="ON"&&(n[l]=a);for(let l=0;l<t;l++){let d=n[l];(o[l]&1)===0?d==="R"?o[l]++:(d==="AN"||d==="EN")&&(o[l]+=2):(d==="L"||d==="AN"||d==="EN")&&o[l]++}return o}function rl(e,t){let n=lm(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 um=/[ \\t\\n\\r\\f]+/g,cm=/[\\t\\n\\r\\f]| {2,}|^ | $/;function dm(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function fm(e){if(!cm.test(e))return e;let t=e.replace(um," ");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 mm(e){return/[\\r\\f]/.test(e)?e.replace(/\\r\\n/g,`\n`).replace(/[\\r\\f]/g,`\n`):e.replace(/\\r\\n/g,`\n`)}var Fr=null,pm;function hm(){return Fr===null&&(Fr=new Intl.Segmenter(pm,{granularity:"word"})),Fr}var gm=/\\p{Script=Arabic}/u,jn=/\\p{M}/u,fl=/\\p{Nd}/u;function ol(e){return gm.test(e)}function sl(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 Ie(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 i=e.charCodeAt(t+1);if(i>=56320&&i<=57343){let r=(n-55296<<10)+(i-56320)+65536;if(sl(r))return!0;t++;continue}}if(sl(n))return!0}}return!1}function xm(e){let t=Kn(e);return t!==null&&($n.has(t)||Ze.has(t))}var bm=new Set(["\\xA0","\\u202F","\\u2060","\\uFEFF"]);function ym(e){return Ie(e)}function Sm(e){let t=Kn(e);return t!==null&&bm.has(t)}function qn(e){return!xm(e)&&!Sm(e)}var $n=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"]),ln=new Set([\'"\',"(","[","{","\\u201C","\\u2018","\\xAB","\\u2039","\\uFF08","\\u3014","\\u3008","\\u300A","\\u300C","\\u300E","\\u3010","\\u3016","\\u3018","\\u301A"]),vr=new Set(["\'","\\u2019"]),Ze=new Set([".",",","!","?",":",";","\\u060C","\\u061B","\\u061F","\\u0964","\\u0965","\\u104A","\\u104B","\\u104C","\\u104D","\\u104F",")","]","}","%",\'"\',"\\u201D","\\u2019","\\xBB","\\u203A","\\u2026"]),Em=new Set([":",".","\\u060C","\\u061B"]),Am=new Set(["\\u104F"]),wm=new Set(["\\u201D","\\u2019","\\xBB","\\u203A","\\u300D","\\u300F","\\u3011","\\u300B","\\u3009","\\u3015","\\uFF09"]);function Cm(e){if(Tr(e))return!0;let t=!1;for(let n of e){if(Ze.has(n)){t=!0;continue}if(!(t&&jn.test(n)))return!1}return t}function Fm(e){for(let t of e)if(!$n.has(t)&&!Ze.has(t))return!1;return e.length>0}function _m(e){if(Tr(e))return!0;for(let t of e)if(!ln.has(t)&&!vr.has(t)&&!jn.test(t))return!1;return e.length>0}function Tr(e){let t=!1;for(let n of e)if(!(n==="\\\\"||jn.test(n))){if(ln.has(n)||Ze.has(n)||vr.has(n)){t=!0;continue}return!1}return t}function ml(e,t){let n=t-1;if(n<=0)return Math.max(n,0);let i=e.charCodeAt(n);if(i<56320||i>57343)return n;let r=n-1;if(r<0)return n;let o=e.charCodeAt(r);return o>=55296&&o<=56319?r:n}function Kn(e){if(e.length===0)return null;let t=ml(e,e.length);return e.slice(t)}function vm(e){let t=Array.from(e),n=t.length;for(;n>0;){let i=t[n-1];if(jn.test(i)){n--;continue}if(ln.has(i)||vr.has(i)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Tm(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="\\u2014"?e:null}function al(e,t,n,i){let r=t[i],o=e[i];if(r==null)return o;let a=n[i];if(o.length===a)return o;let u=r.repeat(a);return e[i]=u,u}function ll(e,t){return e&&t!==null&&Em.has(t)}function Mm(e){let t=Kn(e);return t!==null&&Am.has(t)}function Nm(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 Jn(e){let t=e.length;for(;t>0;){let n=ml(e,t),i=e.slice(n,t);if(wm.has(i))return!0;if(!Ze.has(i))return!1;t=n}return!1}function Lm(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`\n`)return"hard-break"}return e===" "?"space":e==="\\xA0"||e==="\\u202F"||e==="\\u2060"||e==="\\uFEFF"?"glue":e==="\\u200B"?"zero-width-break":e==="\\xAD"?"soft-hyphen":"text"}var Rm=/[\\x20\\t\\n\\xA0\\xAD\\u200B\\u202F\\u2060\\uFEFF]/;function Te(e){return e.length===1?e[0]:e.join("")}function km(e,t){let n=[];for(let i=e.length-1;i>=0;i--)n.push(e[i]);return n.push(t),Te(n)}function Dm(e,t,n,i){if(!Rm.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];let r=[],o=null,a=[],u=n,s=!1,l=0;for(let d of e){let m=Lm(d,i),f=m==="text"&&t;if(o!==null&&m===o&&f===s){a.push(d),l+=d.length;continue}o!==null&&r.push({text:Te(a),isWordLike:s,kind:o,start:u}),o=m,a=[d],u=n+l,s=f,l+=d.length}return o!==null&&r.push({text:Te(a),isWordLike:s,kind:o,start:u}),r}function _r(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var Im=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Pm(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:Im.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Om(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Bm(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"||!Pm(e,a))continue;let u=[t[a]],s=a+1;for(;s<e.len&&!_r(i[s]);){u.push(t[s]),n[a]=!0;let l=t[s].includes("?");if(i[s]="text",t[s]="",s++,l)break}t[a]=Te(u)}let o=0;for(let a=0;a<t.length;a++){let u=t[a];u.length!==0&&(o!==a&&(t[o]=u,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 Hm(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]),!Om(a))continue;let u=o+1;if(u>=e.len||_r(e.kinds[u]))continue;let s=[],l=e.starts[u],d=u;for(;d<e.len&&!_r(e.kinds[d]);)s.push(e.texts[d]),d++;s.length>0&&(t.push(Te(s)),n.push(!0),i.push("text"),r.push(l),o=d-1)}return{len:t.length,texts:t,isWordLike:n,kinds:i,starts:r}}var Gm=new Set([":","-","/","\\xD7",",",".","+","\\u2013","\\u2014"]),ul=/^[A-Za-z0-9_]+[,:;]*$/,cl=/[,:;]+$/;function pl(e){for(let t of e)if(fl.test(t))return!0;return!1}function an(e){if(e.length===0)return!1;for(let t of e)if(!(fl.test(t)||Gm.has(t)))return!1;return!0}function Wm(e){let t=[],n=[],i=[],r=[];for(let o=0;o<e.len;o++){let a=e.texts[o],u=e.kinds[o];if(u==="text"&&an(a)&&pl(a)){let s=[a],l=o+1;for(;l<e.len&&e.kinds[l]==="text"&&an(e.texts[l]);)s.push(e.texts[l]),l++;t.push(Te(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(u),r.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:i,starts:r}}function Um(e){let t=[],n=[],i=[],r=[];for(let o=0;o<e.len;o++){let a=e.texts[o],u=e.kinds[o],s=e.isWordLike[o];if(u==="text"&&s&&ul.test(a)){let l=[a],d=cl.test(a),m=o+1;for(;d&&m<e.len&&e.kinds[m]==="text"&&e.isWordLike[m]&&ul.test(e.texts[m]);){let f=e.texts[m];l.push(f),d=cl.test(f),m++}t.push(Te(l)),n.push(!0),i.push("text"),r.push(e.starts[o]),o=m-1;continue}t.push(a),n.push(s),i.push(u),r.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:i,starts:r}}function Vm(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 u=a.split("-"),s=u.length>1;for(let l=0;l<u.length;l++){let d=u[l];if(!s)break;(d.length===0||!pl(d)||!an(d))&&(s=!1)}if(s){let l=0;for(let d=0;d<u.length;d++){let m=u[d],f=d<u.length-1?`${m}-`:m;t.push(f),n.push(!0),i.push("text"),r.push(e.starts[o]+l),l+=f.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 zm(e){let t=[],n=[],i=[],r=[],o=0;for(;o<e.len;){let a=[e.texts[o]],u=e.isWordLike[o],s=e.kinds[o],l=e.starts[o];if(s==="glue"){let d=[a[0]],m=l;for(o++;o<e.len&&e.kinds[o]==="glue";)d.push(e.texts[o]),o++;let f=Te(d);if(o<e.len&&e.kinds[o]==="text")a[0]=f,a.push(e.texts[o]),u=e.isWordLike[o],s="text",l=m,o++;else{t.push(f),n.push(!1),i.push("glue"),r.push(m);continue}}else o++;if(s==="text")for(;o<e.len&&e.kinds[o]==="glue";){let d=[];for(;o<e.len&&e.kinds[o]==="glue";)d.push(e.texts[o]),o++;let m=Te(d);if(o<e.len&&e.kinds[o]==="text"){a.push(m,e.texts[o]),u=u||e.isWordLike[o],o++;continue}a.push(m)}t.push(Te(a)),n.push(u),i.push(s),r.push(l)}return{len:t.length,texts:t,isWordLike:n,kinds:i,starts:r}}function jm(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=vm(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 dl(e,t,n){let i=hm(),r=0,o=[],a=[],u=[],s=[],l=[],d=[],m=[],f=[],x=[],S=[],y=[],b=[];for(let v of i.segment(e))for(let w of Dm(v.segment,v.isWordLike??!1,v.index,n)){let ie=function(){d[D]!==null&&(a[D]=[al(o,d,m,D)],d[D]=null),a[D].push(w.text),u[D]=u[D]||w.isWordLike,f[D]=f[D]||L,x[D]=x[D]||R,S[D]=I,y[D]=Y,b[D]=ll(x[D],U)},C=w.kind==="text",F=Tm(w.text,w.isWordLike,w.kind),L=Ie(w.text),R=ol(w.text),U=Kn(w.text),I=Jn(w.text),Y=Mm(w.text),D=r-1;t.carryCJKAfterClosingQuote&&C&&r>0&&s[D]==="text"&&L&&f[D]&&S[D]||C&&r>0&&s[D]==="text"&&Fm(w.text)&&f[D]||C&&r>0&&s[D]==="text"&&y[D]?ie():C&&r>0&&s[D]==="text"&&w.isWordLike&&R&&b[D]?(ie(),u[D]=!0):F!==null&&r>0&&s[D]==="text"&&d[D]===F?m[D]=(m[D]??1)+1:C&&!w.isWordLike&&r>0&&s[D]==="text"&&(Cm(w.text)||w.text==="-"&&u[D])?ie():(o[r]=w.text,a[r]=[w.text],u[r]=w.isWordLike,s[r]=w.kind,l[r]=w.start,d[r]=F,m[r]=F===null?0:1,f[r]=L,x[r]=R,S[r]=I,y[r]=Y,b[r]=ll(R,U),r++)}for(let v=0;v<r;v++){if(d[v]!==null){o[v]=al(o,d,m,v);continue}o[v]=Te(a[v])}for(let v=1;v<r;v++)s[v]==="text"&&!u[v]&&Tr(o[v])&&s[v-1]==="text"&&(o[v-1]+=o[v],u[v-1]=u[v-1]||u[v],o[v]="");let A=Array.from({length:r},()=>null),_=-1;for(let v=r-1;v>=0;v--){let w=o[v];if(w.length!==0){if(s[v]==="text"&&!u[v]&&_m(w)&&_>=0&&s[_]==="text"){let C=A[_]??[];C.push(w),A[_]=C,l[_]=l[v],o[v]="";continue}_=v}}for(let v=0;v<r;v++){let w=A[v];w!=null&&(o[v]=km(w,o[v]))}let T=0;for(let v=0;v<r;v++){let w=o[v];w.length!==0&&(T!==v&&(o[T]=w,u[T]=u[v],s[T]=s[v],l[T]=l[v]),T++)}o.length=T,u.length=T,s.length=T,l.length=T;let z=zm({len:T,texts:o,isWordLike:u,kinds:s,starts:l}),P=jm(Um(Vm(Wm(Hm(Bm(z))))));for(let v=0;v<P.len-1;v++){let w=Nm(P.texts[v]);w!==null&&(P.kinds[v]!=="space"&&P.kinds[v]!=="preserved-space"||P.kinds[v+1]!=="text"||!ol(P.texts[v+1])||(P.texts[v]=w.space,P.isWordLike[v]=!1,P.kinds[v]=P.kinds[v]==="preserved-space"?"preserved-space":"space",P.texts[v+1]=w.marks+P.texts[v+1],P.starts[v+1]=P.starts[v]+w.space.length))}return P}function qm(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 $m(e){if(e.len<=1)return e;let t=[],n=[],i=[],r=[],o=null,a=!1,u=0,s=!1,l=!1;function d(){o!==null&&(t.push(Te(o)),n.push(a),i.push("text"),r.push(u),o=null)}for(let m=0;m<e.len;m++){let f=e.texts[m],x=e.kinds[m],S=e.isWordLike[m],y=e.starts[m];if(x==="text"){let b=ym(f),A=qn(f);if(o!==null&&s&&l){o.push(f),a=a||S,s=s||b,l=A;continue}d(),o=[f],a=S,u=y,s=b,l=A;continue}d(),t.push(f),n.push(S),i.push(x),r.push(y)}return d(),{len:t.length,texts:t,isWordLike:n,kinds:i,starts:r}}function hl(e,t,n="normal",i="normal"){let r=dm(n),o=r.mode==="pre-wrap"?mm(e):fm(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let a=i==="keep-all"?$m(dl(o,t,r)):dl(o,t,r);return{normalized:o,chunks:qm(a,r),...a}}var yt=null,gl=new Map,St=null,Km=96,Jm=/\\p{Emoji_Presentation}/u,Xm=/[\\p{Emoji_Presentation}\\p{Extended_Pictographic}\\p{Regional_Indicator}\\uFE0F\\u20E3]/u,Mr=null,xl=new Map;function Nr(){if(yt!==null)return yt;if(typeof OffscreenCanvas<"u")return yt=new OffscreenCanvas(1,1).getContext("2d"),yt;if(typeof document<"u")return yt=document.createElement("canvas").getContext("2d"),yt;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Ym(e){let t=gl.get(e);return t||(t=new Map,gl.set(e,t)),t}function je(e,t){let n=t.get(e);return n===void 0&&(n={width:Nr().measureText(e).width,containsCJK:Ie(e)},t.set(e,n)),n}function Et(){if(St!==null)return St;if(typeof navigator>"u")return St={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},St;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 St={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:i,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},St}function Qm(e){let t=e.match(/(\\d+(?:\\.\\d+)?)\\s*px/);return t?parseFloat(t[1]):16}function bl(){return Mr===null&&(Mr=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Mr}function Zm(e){return Jm.test(e)||e.includes("\\uFE0F")}function yl(e){return Xm.test(e)}function ep(e,t){let n=xl.get(e);if(n!==void 0)return n;let i=Nr();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 tp(e){let t=0,n=bl();for(let i of n.segment(e))Zm(i.segment)&&t++;return t}function np(e,t){return t.emojiCount===void 0&&(t.emojiCount=tp(e)),t.emojiCount}function et(e,t,n){return n===0?t.width:t.width-np(e,t)*n}function Sl(e,t,n,i,r){if(t.breakableFitAdvances!==void 0)return t.breakableFitAdvances;let o=bl(),a=[];for(let d of o.segment(e))a.push(d.segment);if(a.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(r==="sum-graphemes"){let d=[];for(let m of a){let f=je(m,n);d.push(et(m,f,i))}return t.breakableFitAdvances=d,t.breakableFitAdvances}if(r==="pair-context"||a.length>Km){let d=[],m=null,f=0;for(let x of a){let S=je(x,n),y=et(x,S,i);if(m===null)d.push(y);else{let b=m+x,A=je(b,n);d.push(et(b,A,i)-f)}m=x,f=y}return t.breakableFitAdvances=d,t.breakableFitAdvances}let u=[],s="",l=0;for(let d of a){s+=d;let m=je(s,n),f=et(s,m,i);u.push(f-l),l=f}return t.breakableFitAdvances=u,t.breakableFitAdvances}function El(e,t){let n=Nr();n.font=e;let i=Ym(e),r=Qm(e),o=t?ep(e,r):0;return{cache:i,fontSize:r,emojiCorrection:o}}function ip(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 rp(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function op(e,t,n,i,r){let o=0,a=t;for(;o<e.length;){let u=a+e[o];if((o+1<e.length?u+r:u)>n+i)break;a=u,o++}return{fitCount:o,fittedWidth:a}}function Al(e,t){return e.simpleLineWalkFastPath?wl(e,t):Cl(e,t)}function wl(e,t,n){let{widths:i,kinds:r,breakableFitAdvances:o}=e;if(i.length===0)return 0;let u=Et().lineFitEpsilon,s=t+u,l=0,d=0,m=!1,f=0,x=0,S=0,y=0,b=-1,A=0;function _(){b=-1,A=0}function T(F=S,L=y,R=d){l++,n?.({startSegmentIndex:f,startGraphemeIndex:x,endSegmentIndex:F,endGraphemeIndex:L,width:R}),d=0,m=!1,_()}function z(F,L){m=!0,f=F,x=0,S=F+1,y=0,d=L}function P(F,L,R){m=!0,f=F,x=L,S=F,y=L+1,d=R}function v(F,L){if(!m){z(F,L);return}d+=L,S=F+1,y=0}function w(F,L){let R=o[F];for(let U=L;U<R.length;U++){let I=R[U];m?d+I>s?(T(),P(F,U,I)):(d+=I,S=F,y=U+1):P(F,U,I)}m&&S===F&&y===R.length&&(S=F+1,y=0)}let C=0;for(;C<i.length&&!(!m&&(C=ip(e,C),C>=i.length));){let F=i[C],L=r[C],R=L==="space"||L==="preserved-space"||L==="tab"||L==="zero-width-break"||L==="soft-hyphen";if(!m){F>t&&o[C]!==null?w(C,0):z(C,F),R&&(b=C+1,A=d-F),C++;continue}if(d+F>s){if(R){v(C,F),T(C+1,0,d-F),C++;continue}if(b>=0){if(S>b||S===b&&y>0){T();continue}T(b,0,A);continue}if(F>t&&o[C]!==null){T(),w(C,0),C++;continue}T();continue}v(C,F),R&&(b=C+1,A=d-F),C++}return m&&T(),l}function Cl(e,t,n){if(e.simpleLineWalkFastPath)return wl(e,t,n);let{widths:i,lineEndFitAdvances:r,lineEndPaintAdvances:o,kinds:a,breakableFitAdvances:u,discretionaryHyphenWidth:s,tabStopAdvance:l,chunks:d}=e;if(i.length===0||d.length===0)return 0;let m=Et(),f=m.lineFitEpsilon,x=t+f,S=0,y=0,b=!1,A=0,_=0,T=0,z=0,P=-1,v=0,w=0,C=null;function F(){P=-1,v=0,w=0,C=null}function L(j=T,X=z,B=y){S++,n?.({startSegmentIndex:A,startGraphemeIndex:_,endSegmentIndex:j,endGraphemeIndex:X,width:B}),y=0,b=!1,F()}function R(j,X){b=!0,A=j,_=0,T=j+1,z=0,y=X}function U(j,X,B){b=!0,A=j,_=X,T=j,z=X+1,y=B}function I(j,X){if(!b){R(j,X);return}y+=X,T=j+1,z=0}function Y(j,X,B,V){if(!X)return;let _e=j==="tab"?0:r[B],H=j==="tab"?V:o[B];P=B+1,v=y-V+_e,w=y-V+H,C=j}function D(j,X){let B=u[j];for(let V=X;V<B.length;V++){let _e=B[V];b?y+_e>x?(L(),U(j,V,_e)):(y+=_e,T=j,z=V+1):U(j,V,_e)}b&&T===j&&z===B.length&&(T=j+1,z=0)}function ie(j){if(C!=="soft-hyphen")return!1;let X=u[j];if(X==null)return!1;let{fitCount:B,fittedWidth:V}=op(X,y,t,f,s);return B===0?!1:(y=V,T=j,z=B,F(),B===X.length?(T=j+1,z=0,!0):(L(j,B,V+s),D(j,B),!0))}function Fe(j){S++,n?.({startSegmentIndex:j.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:j.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),F()}for(let j=0;j<d.length;j++){let X=d[j];if(X.startSegmentIndex===X.endSegmentIndex){Fe(X);continue}b=!1,y=0,A=X.startSegmentIndex,_=0,T=X.startSegmentIndex,z=0,F();let B=X.startSegmentIndex;for(;B<X.endSegmentIndex;){let V=a[B],_e=V==="space"||V==="preserved-space"||V==="tab"||V==="zero-width-break"||V==="soft-hyphen",H=V==="tab"?rp(y,l):i[B];if(V==="soft-hyphen"){b&&(T=B+1,z=0,P=B+1,v=y+s,w=y+s,C=V),B++;continue}if(!b){H>t&&u[B]!==null?D(B,0):R(B,H),Y(V,_e,B,H),B++;continue}if(y+H>x){let G=y+(V==="tab"?0:r[B]),le=y+(V==="tab"?H:o[B]);if(C==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&v<=x){L(P,0,w);continue}if(C==="soft-hyphen"&&ie(B)){B++;continue}if(_e&&G<=x){I(B,H),L(B+1,0,le),B++;continue}if(P>=0&&v<=x){if(T>P||T===P&&z>0){L();continue}let oe=P;L(oe,0,w),B=oe;continue}if(H>t&&u[B]!==null){L(),D(B,0),B++;continue}L();continue}I(B,H),Y(V,_e,B,H),B++}if(b){let V=P===X.consumedEndSegmentIndex?w:y;L(X.consumedEndSegmentIndex,0,V)}}return S}var Lr=null;function sp(){return Lr===null&&(Lr=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Lr}function ap(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 lp(e,t){let n=[],i=[],r=0,o=!1,a=!1,u=!1;function s(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:r}),i=[],o=!1,a=!1,u=!1)}function l(m,f,x){i=[m],r=f,o=x,a=Jn(m),u=ln.has(m)}function d(m,f){i.push(m),o=o||f;let x=Jn(m);m.length===1&&Ze.has(m)?a=a||x:a=x,u=!1}for(let m of sp().segment(e)){let f=m.segment,x=Ie(f);if(i.length===0){l(f,m.index,x);continue}if(u||$n.has(f)||Ze.has(f)||t.carryCJKAfterClosingQuote&&x&&a){d(f,x);continue}if(!o&&!x){d(f,x);continue}s(),l(f,m.index,x)}return s(),n}function up(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 u=1;u<e.length;u++){let s=e[u],l=Ie(s.text),d=qn(s.text);if(r&&o){n.push(s.text),r=r||l,o=d;continue}a(),n=[s.text],i=s.start,r=l,o=d}return a(),t}function cp(e,t,n,i){let r=Et(),{cache:o,emojiCorrection:a}=El(t,yl(e.normalized)),u=et("-",je("-",o),a),l=et(" ",je(" ",o),a)*8;if(e.len===0)return ap(n);let d=[],m=[],f=[],x=[],S=e.chunks.length<=1,y=n?[]:null,b=[],A=n?[]:null,_=Array.from({length:e.len});function T(w,C,F,L,R,U,I){R!=="text"&&R!=="space"&&R!=="zero-width-break"&&(S=!1),d.push(C),m.push(F),f.push(L),x.push(R),y?.push(U),b.push(I),A!==null&&A.push(w)}function z(w,C,F,L,R){let U=je(w,o),I=et(w,U,a),Y=C==="space"||C==="preserved-space"||C==="zero-width-break"?0:I,D=C==="space"||C==="zero-width-break"?0:I;if(R&&L&&w.length>1){let ie="sum-graphemes";an(w)?ie="pair-context":r.preferPrefixWidthsForBreakableRuns&&(ie="segment-prefixes");let Fe=Sl(w,U,o,a,ie);T(w,I,Y,D,C,F,Fe);return}T(w,I,Y,D,C,F,null)}for(let w=0;w<e.len;w++){_[w]=d.length;let C=e.texts[w],F=e.isWordLike[w],L=e.kinds[w],R=e.starts[w];if(L==="soft-hyphen"){T(C,0,u,u,L,R,null);continue}if(L==="hard-break"){T(C,0,0,0,L,R,null);continue}if(L==="tab"){T(C,0,0,0,L,R,null);continue}let U=je(C,o);if(L==="text"&&U.containsCJK){let I=lp(C,r),Y=i==="keep-all"?up(I):I;for(let D=0;D<Y.length;D++){let ie=Y[D];z(ie.text,"text",R+ie.start,F,i==="keep-all"||!Ie(ie.text))}continue}z(C,L,R,F,!0)}let P=dp(e.chunks,_,d.length),v=y===null?null:rl(e.normalized,y);return A!==null?{widths:d,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:S,segLevels:v,breakableFitAdvances:b,discretionaryHyphenWidth:u,tabStopAdvance:l,chunks:P,segments:A}:{widths:d,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:S,segLevels:v,breakableFitAdvances:b,discretionaryHyphenWidth:u,tabStopAdvance:l,chunks:P}}function dp(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,u=o.endSegmentIndex<t.length?t[o.endSegmentIndex]:n,s=o.consumedEndSegmentIndex<t.length?t[o.consumedEndSegmentIndex]:n;i.push({startSegmentIndex:a,endSegmentIndex:u,consumedEndSegmentIndex:s})}return i}function fp(e,t,n,i){let r=i?.wordBreak??"normal",o=hl(e,Et(),i?.whiteSpace,r);return cp(o,t,n,r)}function Fl(e,t,n){return fp(e,t,!1,n)}function _l(e,t,n){let i=Al(e,t);return{lineCount:i,height:i*n}}var mp={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function vl(e,t){let n={...mp,...t},i=1.2;for(let r=n.baseFontSize;r>=n.minFontSize;r-=n.step){let o=`${n.fontWeight} ${r}px ${n.fontFamily}`,a=Fl(e,o),{lineCount:u}=_l(a,n.maxWidth,r*i);if(u<=1)return{fontSize:r,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}window.__timelines=window.__timelines||{};ja();window.__hyperframes={fitTextFontSize:vl,getVariables:Qr};function Tl(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,nl())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Tl,{once:!0}):Tl();})();\n';
56646
56649
  }
56647
56650
  });
56648
56651
 
@@ -60255,6 +60258,7 @@ __export(dist_exports, {
60255
60258
  serializeGsapAnimations: () => serializeGsapAnimations,
60256
60259
  serializeHfColorGrading: () => serializeHfColorGrading,
60257
60260
  shouldClampMediaDuration: () => shouldClampMediaDuration,
60261
+ shouldClampResolvedMediaDuration: () => shouldClampResolvedMediaDuration,
60258
60262
  stripEmbeddedRuntimeScripts: () => stripEmbeddedRuntimeScripts,
60259
60263
  toFps: () => toFps,
60260
60264
  updateElementInHtml: () => updateElementInHtml,
@@ -60568,7 +60572,7 @@ function getCgroupLimitMb() {
60568
60572
  const v1Content = v2Content === null ? readCgroupFile(CGROUP_V1_MEMORY_LIMIT_PATH) : null;
60569
60573
  _cachedCgroupLimitMb = parseCgroupLimitMb(v2Content, v1Content);
60570
60574
  if (_cachedCgroupLimitMb !== null) {
60571
- console.info(
60575
+ console.warn(
60572
60576
  `[SystemMemory] cgroup memory limit detected: ${_cachedCgroupLimitMb} MiB \u2014 it governs memory-adaptive render behaviour instead of host RAM.`
60573
60577
  );
60574
60578
  }
@@ -60658,6 +60662,16 @@ function scaleProtocolTimeoutForComposition(baseTimeoutMs, dims) {
60658
60662
  const ceiling = Math.max(baseTimeoutMs, MAX_SCALED_PROTOCOL_TIMEOUT_MS);
60659
60663
  return Math.min(ceiling, Math.max(baseTimeoutMs, scaled));
60660
60664
  }
60665
+ function shouldAutoDisableStreamingEncodeOnWin32Compound(opts) {
60666
+ if (opts.userExplicitlySet) return false;
60667
+ if (opts.platform !== "win32") return false;
60668
+ if (!opts.softwareGpuForced) return false;
60669
+ if (opts.workers !== 1) return false;
60670
+ if (opts.compositionDurationSec !== void 0 && opts.compositionDurationSec <= 120) {
60671
+ return false;
60672
+ }
60673
+ return true;
60674
+ }
60661
60675
  function memoryAdaptiveCacheLimit() {
60662
60676
  const total = getSystemTotalMb();
60663
60677
  if (total < 4096) return 32;
@@ -60823,6 +60837,22 @@ function resolveConfig(overrides) {
60823
60837
  if (merged.browserGpuMode === "software" && !merged.forceScreenshot && !explicitForceScreenshotOptOut) {
60824
60838
  merged.forceScreenshot = true;
60825
60839
  }
60840
+ const streamingEncodeUserExplicitlySet = env("PRODUCER_ENABLE_STREAMING_ENCODE") !== void 0 || overrides?.enableStreamingEncode !== void 0;
60841
+ const softwareGpuForced = merged.browserGpuMode === "software" || merged.disableGpu || merged.lowMemoryMode;
60842
+ const resolvedWorkers = typeof merged.concurrency === "number" ? merged.concurrency : NaN;
60843
+ if (merged.enableStreamingEncode && shouldAutoDisableStreamingEncodeOnWin32Compound({
60844
+ platform: process.platform,
60845
+ softwareGpuForced,
60846
+ workers: resolvedWorkers,
60847
+ compositionDurationSec: void 0,
60848
+ userExplicitlySet: streamingEncodeUserExplicitlySet
60849
+ })) {
60850
+ merged.enableStreamingEncode = false;
60851
+ merged.streamingEncodeAutoDisabledOnWin32Compound = true;
60852
+ console.error(
60853
+ "[hyperframes] Windows compound-workaround auto-detected \u2014 disabling streaming-encode (platform=win32, software-GPU forced, workers=1). Field signal ts=1784131903. Override: PRODUCER_ENABLE_STREAMING_ENCODE=true."
60854
+ );
60855
+ }
60826
60856
  if (merged.useDrawElement && merged.enablePageSideCompositing) {
60827
60857
  merged.enablePageSideCompositing = false;
60828
60858
  merged.pageSideCompositingAutoDisabled = true;
@@ -61314,6 +61344,9 @@ function buildChromeArgs(options, config) {
61314
61344
  chromeArgs.push(WEBGPU_FLAG);
61315
61345
  }
61316
61346
  if (options.captureMode !== "screenshot") {
61347
+ if (browserGpuMode === "software") {
61348
+ chromeArgs.push("--disable-gpu-compositing");
61349
+ }
61317
61350
  chromeArgs.push(
61318
61351
  "--deterministic-mode",
61319
61352
  "--enable-begin-frame-control",
@@ -61383,6 +61416,88 @@ var init_browserManager = __esm({
61383
61416
  }
61384
61417
  });
61385
61418
 
61419
+ // ../engine/src/services/protocolTimeoutErrorHint.ts
61420
+ function augmentProtocolTimeoutError(err, effectiveTimeoutMs) {
61421
+ if (!(err instanceof Error)) return new Error(String(err));
61422
+ if (!PROTOCOL_TIMEOUT_MATCHER.test(err.message)) return err;
61423
+ const augmented = new Error(
61424
+ `${err.message}
61425
+
61426
+ HyperFrames effective protocolTimeout: ${effectiveTimeoutMs} ms.
61427
+
61428
+ To raise the timeout:
61429
+ Env: PRODUCER_PUPPETEER_PROTOCOL_TIMEOUT_MS=<higher-ms>
61430
+ CLI: --protocol-timeout <higher-ms>
61431
+
61432
+ Field signal ts=1784047847: this class of failure appears on RAM-pressured hosts with heavy-asset compositions (9+ videos + 20+ images). If raising the timeout doesn't help, consider FFmpeg-only encoding.`
61433
+ );
61434
+ augmented.cause = err;
61435
+ return augmented;
61436
+ }
61437
+ function isProtocolTimeoutError(err) {
61438
+ const message = err instanceof Error ? err.message : typeof err === "string" ? err : "";
61439
+ return PROTOCOL_TIMEOUT_MATCHER.test(message);
61440
+ }
61441
+ var PROTOCOL_TIMEOUT_MATCHER;
61442
+ var init_protocolTimeoutErrorHint = __esm({
61443
+ "../engine/src/services/protocolTimeoutErrorHint.ts"() {
61444
+ "use strict";
61445
+ PROTOCOL_TIMEOUT_MATCHER = /Runtime\.callFunctionOn timed out|Target closed|protocolTimeout/i;
61446
+ }
61447
+ });
61448
+
61449
+ // ../engine/src/services/pageNavigationTimeoutErrorHint.ts
61450
+ function augmentPageNavigationTimeoutError(err, effectiveTimeoutMs, context = {}) {
61451
+ if (!(err instanceof Error)) return new Error(String(err));
61452
+ if (!NAVIGATION_TIMEOUT_MATCHER.test(err.message)) return err;
61453
+ const platform10 = context.platform ?? process.platform;
61454
+ const arch2 = context.arch ?? process.arch;
61455
+ const dockerHint = shouldSurfaceDockerHint({
61456
+ platform: platform10,
61457
+ arch: arch2,
61458
+ hasCss3D: context.hasCss3D,
61459
+ hasAudio: context.hasAudio
61460
+ }) ? buildDockerHintBlock() : "";
61461
+ const augmented = new Error(
61462
+ `${err.message}
61463
+
61464
+ HyperFrames effective page.goto navigation timeout: ${effectiveTimeoutMs} ms.
61465
+
61466
+ To raise the timeout:
61467
+ Env: PRODUCER_PAGE_NAVIGATION_TIMEOUT_MS=<higher-ms> (milliseconds)
61468
+ CLI: --browser-timeout <seconds> (seconds)
61469
+
61470
+ To use a different browser binary (e.g. system Chrome instead of the pinned chrome-headless-shell):
61471
+ Env: HYPERFRAMES_BROWSER_PATH=<path-to-Chrome-or-chrome-headless-shell>
61472
+ ` + dockerHint
61473
+ );
61474
+ augmented.cause = err;
61475
+ return augmented;
61476
+ }
61477
+ function isPageNavigationTimeoutError(err) {
61478
+ const message = err instanceof Error ? err.message : typeof err === "string" ? err : "";
61479
+ return NAVIGATION_TIMEOUT_MATCHER.test(message);
61480
+ }
61481
+ function shouldSurfaceDockerHint(gate) {
61482
+ return gate.platform === "darwin" && gate.arch === "arm64" && gate.hasCss3D === true && gate.hasAudio === true;
61483
+ }
61484
+ function buildDockerHintBlock() {
61485
+ return `
61486
+ Field signal ts=1784146416 (darwin/arm64 host mode, CLI 0.7.58): the compound of
61487
+ a CSS 3D rendering context + audio track on macOS arm64 has been reported to hit
61488
+ Navigation timeout twice at page.goto while the same composition renders
61489
+ identically under Docker. Consider:
61490
+ hyperframes render ... --docker
61491
+ `;
61492
+ }
61493
+ var NAVIGATION_TIMEOUT_MATCHER;
61494
+ var init_pageNavigationTimeoutErrorHint = __esm({
61495
+ "../engine/src/services/pageNavigationTimeoutErrorHint.ts"() {
61496
+ "use strict";
61497
+ NAVIGATION_TIMEOUT_MATCHER = /Navigation timeout|net::ERR_TIMED_OUT/i;
61498
+ }
61499
+ });
61500
+
61386
61501
  // ../engine/src/services/screenshotService.ts
61387
61502
  async function getCdpSession(page) {
61388
61503
  let client = cdpSessionCache.get(page);
@@ -63423,12 +63538,14 @@ async function initDrawElementOrTransparentBackground(session, page, logInitPhas
63423
63538
  const useDrawElement = ((session.config?.useDrawElement ?? false) || forceDE) && !supersampling && (!forceScreenshot || forceDE);
63424
63539
  if ((session.config?.useDrawElement ?? false) && supersampling) {
63425
63540
  session.deGateReason = "supersampling";
63541
+ session.deFallbackTrigger = "supersampling";
63426
63542
  console.log(
63427
63543
  "[engine] --experimental-fast-capture disabled for this render: drawElementImage ignores deviceScaleFactor, so supersampled (DPR > 1) output uses screenshot capture."
63428
63544
  );
63429
63545
  }
63430
63546
  if ((session.config?.useDrawElement ?? false) && !supersampling && forceScreenshot) {
63431
63547
  session.deGateReason = "render_mode_hint";
63548
+ session.deFallbackTrigger = "render_mode_hint";
63432
63549
  console.log(
63433
63550
  "[engine] fast capture: falling back to screenshot \u2014 render-mode compatibility hint forced screenshot capture (e.g. raw requestAnimationFrame composition)."
63434
63551
  );
@@ -63452,6 +63569,7 @@ async function initDrawElementOrTransparentBackground(session, page, logInitPhas
63452
63569
  });
63453
63570
  if (!supportsDrawElement) {
63454
63571
  session.deGateReason = "unsupported_chrome";
63572
+ session.deFallbackTrigger = "unsupported_chrome";
63455
63573
  console.log(
63456
63574
  `[engine] fast capture: falling back to ${session.launchCaptureMode} capture \u2014 this Chrome build does not implement canvas.drawElementImage (Dev/Canary-only feature, ~151+); run \`hyperframes browser ensure --force\` to fetch a supported build, or set HYPERFRAMES_BROWSER_PATH to one.`
63457
63575
  );
@@ -63461,6 +63579,7 @@ async function initDrawElementOrTransparentBackground(session, page, logInitPhas
63461
63579
  const mode = resolveDrawElementCaptureMode(session.isSwiftShader, transparent);
63462
63580
  if (mode === "screenshot") {
63463
63581
  session.deGateReason = "swiftshader";
63582
+ session.deFallbackTrigger = "swiftshader";
63464
63583
  console.log(
63465
63584
  `[engine] fast capture: falling back to ${session.launchCaptureMode} capture \u2014 SwiftShader (software rasterizer \u2014 no GPU egress to skip, drawElement is parity-or-slower; see fast-capture-limitations.md)`
63466
63585
  );
@@ -63470,6 +63589,7 @@ async function initDrawElementOrTransparentBackground(session, page, logInitPhas
63470
63589
  const cssFx = await detectCssEffectRisk(page);
63471
63590
  if (cssFx) {
63472
63591
  session.deGateReason = `css_effect:${(cssFx.split(":")[0] ?? "").replace(/[^a-z-]/gi, "")}`;
63592
+ session.deFallbackTrigger = cssFx;
63473
63593
  console.log(
63474
63594
  `[engine] fast capture: falling back to ${session.launchCaptureMode} capture \u2014 ${cssFx} detected (drawElementImage cannot reproduce it; see fast-capture-limitations.md)`
63475
63595
  );
@@ -63487,6 +63607,7 @@ async function initDrawElementOrTransparentBackground(session, page, logInitPhas
63487
63607
  );
63488
63608
  if (atRisk.size > 0 && atRiskFraction > fractionFloor) {
63489
63609
  session.deGateReason = "at_risk_timeline";
63610
+ session.deFallbackTrigger = "at_risk_timeline";
63490
63611
  console.log(
63491
63612
  `[engine] fast capture: falling back to ${session.launchCaptureMode} capture \u2014 ${atRisk.size}/${totalFrames} frames animate a compositor-incompatible prop (blend/3D/clip/mask); drawElementImage drops these mid-animation (deterministic timeline gate; see fast-capture-limitations.md Lim 7)`
63492
63613
  );
@@ -63497,6 +63618,7 @@ async function initDrawElementOrTransparentBackground(session, page, logInitPhas
63497
63618
  const threeD = await initThreeDProjection(page);
63498
63619
  if (!forceDE && !threeD.ok) {
63499
63620
  session.deGateReason = "3d_init_failed";
63621
+ session.deFallbackTrigger = "3d_init_failed";
63500
63622
  console.log(
63501
63623
  `[engine] fast capture: falling back to ${session.launchCaptureMode} capture \u2014 3D projection init failed (${threeD.reason ?? "unknown"})`
63502
63624
  );
@@ -65000,6 +65122,12 @@ function medianOf(samples) {
65000
65122
  const sorted = [...samples].sort((a, b2) => a - b2);
65001
65123
  return Math.round(sorted[Math.floor(sorted.length / 2)] ?? 0);
65002
65124
  }
65125
+ function percentileOf(samples, p2) {
65126
+ if (samples.length === 0) return 0;
65127
+ const sorted = [...samples].sort((a, b2) => a - b2);
65128
+ const idx = Math.min(sorted.length - 1, Math.max(0, Math.floor(p2 * sorted.length)));
65129
+ return Math.round(sorted[idx] ?? 0);
65130
+ }
65003
65131
  function getCapturePerfSummary(session) {
65004
65132
  const frames = Math.max(1, session.capturePerf.frames);
65005
65133
  return {
@@ -65009,6 +65137,8 @@ function getCapturePerfSummary(session) {
65009
65137
  avgBeforeCaptureMs: Math.round(session.capturePerf.beforeCaptureMs / frames),
65010
65138
  avgScreenshotMs: Math.round(session.capturePerf.screenshotMs / frames),
65011
65139
  p50TotalMs: medianOf(session.capturePerf.frameMs),
65140
+ p95TotalMs: percentileOf(session.capturePerf.frameMs, 0.95),
65141
+ p99TotalMs: percentileOf(session.capturePerf.frameMs, 0.99),
65012
65142
  subTimelineWaitOutcome: session.subTimelineWaitOutcome,
65013
65143
  warnings: session.warnings.map((warning) => ({
65014
65144
  ...warning,
@@ -65027,6 +65157,7 @@ function getCapturePerfSummary(session) {
65027
65157
  beginFrameHasDamage: session.beginFrameHasDamageCount,
65028
65158
  captureMode: session.captureMode,
65029
65159
  deGateReason: session.deGateReason,
65160
+ deFallbackTrigger: session.deFallbackTrigger,
65030
65161
  deWorkerEncode: session.workerEncodeEnabled ?? false,
65031
65162
  deVerifyArmed: session.deVerifyFrames?.size ?? 0,
65032
65163
  deVerifyInitMs: session.deVerifyInitMs ?? 0,
@@ -67125,10 +67256,8 @@ async function compileHtml(rawHtml, projectDir, probeMediaDuration) {
67125
67256
  if (fileDuration <= 0)
67126
67257
  continue;
67127
67258
  const effectiveDuration = fileDuration - el.mediaStart;
67128
- resolutions.push({
67129
- id: el.id,
67130
- duration: effectiveDuration > 0 ? effectiveDuration : fileDuration
67131
- });
67259
+ const sourceDuration = effectiveDuration > 0 ? effectiveDuration : fileDuration;
67260
+ resolutions.push({ id: el.id, duration: sourceDuration });
67132
67261
  }
67133
67262
  if (resolutions.length > 0) {
67134
67263
  html = injectDurations(html, resolutions);
@@ -67146,7 +67275,7 @@ async function compileHtml(rawHtml, projectDir, probeMediaDuration) {
67146
67275
  if (fileDuration <= 0)
67147
67276
  continue;
67148
67277
  const maxDuration = fileDuration - el.mediaStart;
67149
- if (maxDuration > 0 && shouldClampMediaDuration(el.duration, maxDuration)) {
67278
+ if (maxDuration > 0 && shouldClampResolvedMediaDuration(el.tagName, el.duration, maxDuration)) {
67150
67279
  clampList.push({ id: el.id, duration: maxDuration });
67151
67280
  }
67152
67281
  }
@@ -70523,6 +70652,33 @@ function leftmostCompoundClasses(selector) {
70523
70652
  const leftmost = selector.trim().split(/[\s>+~]+/)[0] ?? "";
70524
70653
  return (leftmost.match(/\.([\w-]+)/g) ?? []).map((c3) => c3.slice(1));
70525
70654
  }
70655
+ function leftmostCompoundId(selector) {
70656
+ const leftmost = selector.trim().split(/[\s>+~]+/)[0] ?? "";
70657
+ return leftmost.match(/#([\w-]+)/)?.[1] ?? null;
70658
+ }
70659
+ function collectHeavyOverlayHooks(styles) {
70660
+ const classes = /* @__PURE__ */ new Set();
70661
+ const ids = /* @__PURE__ */ new Set();
70662
+ for (const style of styles) {
70663
+ const noComments = style.content.replace(/\/\*[\s\S]*?\*\//g, "");
70664
+ const ruleWithBody = /([^{}]+)\{([^{}]*)\}/g;
70665
+ let m2;
70666
+ while ((m2 = ruleWithBody.exec(noComments)) !== null) {
70667
+ const header = (m2[1] ?? "").trim();
70668
+ const body = m2[2] ?? "";
70669
+ if (!header || header.startsWith("@")) continue;
70670
+ if (!HEAVY_OVERLAY_CSS_PATTERN.test(body)) continue;
70671
+ for (const sel of header.split(",")) {
70672
+ const trimmed = sel.trim();
70673
+ if (!trimmed) continue;
70674
+ for (const cls of leftmostCompoundClasses(trimmed)) classes.add(cls);
70675
+ const idToken = leftmostCompoundId(trimmed);
70676
+ if (idToken) ids.add(idToken);
70677
+ }
70678
+ }
70679
+ }
70680
+ return { classes, ids };
70681
+ }
70526
70682
  function rootClassStyledSelectors(styles, rootClasses) {
70527
70683
  const offenders = [];
70528
70684
  for (const style of styles) {
@@ -71332,7 +71488,7 @@ function isSnippetFragment(html) {
71332
71488
  if (!firstTag) return false;
71333
71489
  return /\bdata-hf-snippet\b/.test(firstTag[0]);
71334
71490
  }
71335
- var COMPOSITION_ID_IN_CSS_PATTERN, TIMELINE_REGISTRY_INIT_PATTERN, TIMELINE_REGISTRY_OBJECT_LITERAL_PATTERN, TIMELINE_REGISTRY_ASSIGN_PATTERN, WINDOW_TIMELINE_ASSIGN_PATTERN, INVALID_SCRIPT_CLOSE_PATTERN, TIMELINE_REGISTRY_KEY_PATTERN, TIMELINE_REGISTRY_OBJECT_BODY_PATTERN, TIMELINE_REGISTRY_OBJECT_ENTRY_PATTERN, HEAD_BLOCKS_TO_IGNORE_PATTERN, HTML_TAG_PATTERN, HEAD_CONTENT_PATTERN, AFTER_HEAD_BEFORE_BODY_PATTERN, STRAY_HEAD_CLOSE_PATTERN, MARKDOWN_CODE_FENCE_PATTERN, ORPHAN_CSS_AT_RULE_PATTERN, ORPHAN_CSS_RULE_PATTERN, VISIBLE_MARKUP_COMMENT_PATTERN, VISIBLE_MARKUP_COMMENT_PROTECTED_BLOCK_PATTERN, coreRules, mediaRules, SCENE_BOUNDARY_EPSILON_SECONDS, UNRESOLVED_TARGET, gsapWindowsCache, CONFLICTING_TRANSLATE_PROPS, CONFLICTING_SCALE_PROPS, gsapRules, captionRules, MAX_COMPOSITION_LINES, MAX_TIMED_ELEMENTS_PER_TRACK, TRACK_DENSITY_EXEMPT_TAGS, CAPTION_CUE_TOKEN, OVERLAP_EPSILON_SECONDS, compositionRules, adapterRules, TEXTURE_BASE_CLASS, TEXTURE_CLASS_PREFIX, textureRules, GENERIC_FAMILIES, fontRules, slideshowRules, ALL_RULES, AUDIO_EXTENSIONS, MASK_IMAGE_URL_RE;
71491
+ var COMPOSITION_ID_IN_CSS_PATTERN, TIMELINE_REGISTRY_INIT_PATTERN, TIMELINE_REGISTRY_OBJECT_LITERAL_PATTERN, TIMELINE_REGISTRY_ASSIGN_PATTERN, WINDOW_TIMELINE_ASSIGN_PATTERN, INVALID_SCRIPT_CLOSE_PATTERN, TIMELINE_REGISTRY_KEY_PATTERN, TIMELINE_REGISTRY_OBJECT_BODY_PATTERN, TIMELINE_REGISTRY_OBJECT_ENTRY_PATTERN, HEAD_BLOCKS_TO_IGNORE_PATTERN, HTML_TAG_PATTERN, HEAD_CONTENT_PATTERN, AFTER_HEAD_BEFORE_BODY_PATTERN, STRAY_HEAD_CLOSE_PATTERN, MARKDOWN_CODE_FENCE_PATTERN, ORPHAN_CSS_AT_RULE_PATTERN, ORPHAN_CSS_RULE_PATTERN, VISIBLE_MARKUP_COMMENT_PATTERN, VISIBLE_MARKUP_COMMENT_PROTECTED_BLOCK_PATTERN, coreRules, mediaRules, SCENE_BOUNDARY_EPSILON_SECONDS, UNRESOLVED_TARGET, gsapWindowsCache, CONFLICTING_TRANSLATE_PROPS, CONFLICTING_SCALE_PROPS, gsapRules, captionRules, MAX_COMPOSITION_LINES, MAX_TIMED_ELEMENTS_PER_TRACK, TRACK_DENSITY_EXEMPT_TAGS, CAPTION_CUE_TOKEN, HEAVY_OVERLAY_ELEMENT_COUNT_WARN, HEAVY_OVERLAY_EXEMPT_TAGS, HEAVY_OVERLAY_CSS_PATTERN, INLINE_STYLE_DISPLAY_NONE_PATTERN, OVERLAP_EPSILON_SECONDS, compositionRules, adapterRules, TEXTURE_BASE_CLASS, TEXTURE_CLASS_PREFIX, textureRules, GENERIC_FAMILIES, fontRules, slideshowRules, ALL_RULES, AUDIO_EXTENSIONS, MASK_IMAGE_URL_RE;
71336
71492
  var init_dist4 = __esm({
71337
71493
  "../lint/dist/index.js"() {
71338
71494
  "use strict";
@@ -72821,6 +72977,27 @@ ${right.raw}`)
72821
72977
  MAX_TIMED_ELEMENTS_PER_TRACK = 3;
72822
72978
  TRACK_DENSITY_EXEMPT_TAGS = /* @__PURE__ */ new Set(["audio", "script", "style", "video"]);
72823
72979
  CAPTION_CUE_TOKEN = /^(?:caption(?:[-_](?:group|word|line|block|cue|text))?|subtitle(?:[-_](?:group|line|cue|text))?|cg-.+)$/i;
72980
+ HEAVY_OVERLAY_ELEMENT_COUNT_WARN = 25;
72981
+ HEAVY_OVERLAY_EXEMPT_TAGS = /* @__PURE__ */ new Set([
72982
+ "audio",
72983
+ "body",
72984
+ "br",
72985
+ "defs",
72986
+ "head",
72987
+ "hr",
72988
+ "html",
72989
+ "link",
72990
+ "meta",
72991
+ "script",
72992
+ "source",
72993
+ "style",
72994
+ "template",
72995
+ "title",
72996
+ "use",
72997
+ "video"
72998
+ ]);
72999
+ HEAVY_OVERLAY_CSS_PATTERN = /(?:filter\s*:[^;}]*\bblur\s*\()|(?:clip-path\s*:(?!\s*(?:none|inherit|initial|unset)\b)\s*[^;}]+)|(?:radial-gradient\s*\()/i;
73000
+ INLINE_STYLE_DISPLAY_NONE_PATTERN = /(?:^|;)\s*display\s*:\s*none\b/i;
72824
73001
  OVERLAP_EPSILON_SECONDS = 1e-6;
72825
73002
  compositionRules = [
72826
73003
  // duplicate_composition_id catches meta-tag/root collisions that create duplicate composition entries.
@@ -73524,6 +73701,55 @@ ${allInlineStyles}`.replace(/\/\*[\s\S]*?\*\//g, "");
73524
73701
  ];
73525
73702
  }
73526
73703
  return [];
73704
+ },
73705
+ // composition_heavy_overlay_count_high
73706
+ // Field signal ts=1784040753 (#hyperframes-cli-feedback): a composition
73707
+ // with ~40 heavy overlay DOM elements — `filter:blur`, oversized
73708
+ // `radial-gradient`, and `clip-path` animations — captures solid-black for
73709
+ // the first ~half of the render, recovering near the end. Reproduces
73710
+ // identically via drawElement AND forced --no-browser-gpu screenshot
73711
+ // capture AND `snapshot`, so the offender is the capture layer itself, not
73712
+ // encoder/mux. Independent of duration (padding the timeline grows the bad
73713
+ // zone proportionally, doesn't shift it). Reporter's workaround was to
73714
+ // split into per-transition mini compositions + FFmpeg concat.
73715
+ //
73716
+ // Presence alone matters: opacity:0 and visibility:hidden overlays still
73717
+ // contribute to the capture-layer regression, so they're counted-in. The
73718
+ // only escape hatch is `display: none` — an element removed from the render
73719
+ // tree can't feed the compositor. Warn at 25, well below the observed
73720
+ // 40-element repro, to give authors lead time before hitting the bug.
73721
+ // fallow-ignore-next-line complexity
73722
+ ({ tags, styles, rawSource, options }) => {
73723
+ if (isRegistrySourceFile(options.filePath) || isRegistryInstalledFile(rawSource)) return [];
73724
+ const { classes: heavyClassTokens, ids: heavyIds } = collectHeavyOverlayHooks(styles);
73725
+ let heavyCount = 0;
73726
+ for (const tag of tags) {
73727
+ if (HEAVY_OVERLAY_EXEMPT_TAGS.has(tag.name)) continue;
73728
+ if (isCompositionRootOrMount(tag.raw)) continue;
73729
+ const styleAttr = readJsonAttr(tag.raw, "style") ?? "";
73730
+ if (styleAttr && INLINE_STYLE_DISPLAY_NONE_PATTERN.test(styleAttr)) continue;
73731
+ let heavy = false;
73732
+ if (styleAttr && HEAVY_OVERLAY_CSS_PATTERN.test(styleAttr)) heavy = true;
73733
+ if (!heavy && (heavyClassTokens.size > 0 || heavyIds.size > 0)) {
73734
+ const classList = (readAttr(tag.raw, "class") || "").split(/\s+/).filter(Boolean);
73735
+ if (classList.some((cls) => heavyClassTokens.has(cls))) heavy = true;
73736
+ if (!heavy) {
73737
+ const idValue = readAttr(tag.raw, "id");
73738
+ if (idValue && heavyIds.has(idValue)) heavy = true;
73739
+ }
73740
+ }
73741
+ if (heavy) heavyCount += 1;
73742
+ }
73743
+ if (heavyCount < HEAVY_OVERLAY_ELEMENT_COUNT_WARN) return [];
73744
+ const splitTarget = options.isSubComposition ? "Split this sub-composition further into per-transition mini-compositions" : "Split coherent scenes / transitions into separate .html files under compositions/";
73745
+ return [
73746
+ {
73747
+ code: "composition_heavy_overlay_count_high",
73748
+ severity: "warning",
73749
+ message: `This composition has ${heavyCount} elements carrying "heavy overlay" CSS (filter:blur, radial-gradient, or clip-path). Field signal: a composition with ~40 such elements \u2014 including opacity:0 / visibility:hidden ones \u2014 captures solid-black for the first ~half of the render, recovering near the end. Reproduces identically via drawElement, forced screenshot capture, and snapshot, so the capture layer itself is the offender (not encoder/mux). Independent of duration. Presence alone matters; only display:none elements are excluded here.`,
73750
+ fixHint: `${splitTarget} and concat the pieces (FFmpeg or the runtime's slideshow) so each capture only sees a small subset of heavy overlays at once. Even hidden overlays (opacity:0 / visibility:hidden) contribute \u2014 either remove truly unused ones from the source or scope them into their own per-transition sub-composition. If an overlay is genuinely inert for the whole clip, use display:none so it never enters the render tree. Field ref ts=1784040753 (#hyperframes-cli-feedback).`
73751
+ }
73752
+ ];
73527
73753
  }
73528
73754
  ];
73529
73755
  adapterRules = [
@@ -75008,6 +75234,7 @@ __export(compiler_exports, {
75008
75234
  resolveTimings: () => resolveTimings,
75009
75235
  scopeCssToComposition: () => scopeCssToComposition,
75010
75236
  shouldClampMediaDuration: () => shouldClampMediaDuration,
75237
+ shouldClampResolvedMediaDuration: () => shouldClampResolvedMediaDuration,
75011
75238
  stripEmbeddedRuntimeScripts: () => stripEmbeddedRuntimeScripts,
75012
75239
  validateHyperframeHtmlContract: () => validateHyperframeHtmlContract,
75013
75240
  wrapScopedCompositionScript: () => wrapScopedCompositionScript
@@ -76014,7 +76241,7 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
76014
76241
  phaseBreakdown: breakdown
76015
76242
  };
76016
76243
  }
76017
- function getFrameAtTime(extracted, globalTime, videoStart, loop = false, mediaStart = 0) {
76244
+ function getFrameIndexAtTime(extracted, globalTime, videoStart, loop = false, mediaStart = 0, holdLastFrame = false) {
76018
76245
  let localTime = globalTime - videoStart;
76019
76246
  if (localTime < 0) return null;
76020
76247
  const loopDuration = Math.max(0, extracted.metadata.durationSeconds - mediaStart);
@@ -76022,11 +76249,15 @@ function getFrameAtTime(extracted, globalTime, videoStart, loop = false, mediaSt
76022
76249
  localTime %= loopDuration;
76023
76250
  }
76024
76251
  const frameIndex = Math.floor(localTime * extracted.fps + 1e-9);
76025
- if (loop && frameIndex >= extracted.totalFrames && extracted.totalFrames > 0) {
76026
- return extracted.framePaths.get(extracted.totalFrames - 1) || null;
76252
+ if (frameIndex < 0 || extracted.totalFrames <= 0) return null;
76253
+ if (frameIndex >= extracted.totalFrames) {
76254
+ return loop || holdLastFrame ? extracted.totalFrames - 1 : null;
76027
76255
  }
76028
- if (frameIndex < 0 || frameIndex >= extracted.totalFrames) return null;
76029
- return extracted.framePaths.get(frameIndex) || null;
76256
+ return frameIndex;
76257
+ }
76258
+ function getFrameAtTime(extracted, globalTime, videoStart, loop = false, mediaStart = 0) {
76259
+ const frameIndex = getFrameIndexAtTime(extracted, globalTime, videoStart, loop, mediaStart);
76260
+ return frameIndex == null ? null : extracted.framePaths.get(frameIndex) || null;
76030
76261
  }
76031
76262
  function analyzeClipMediaFit(params) {
76032
76263
  const { slotSeconds, mediaSeconds, loop } = params;
@@ -76047,7 +76278,7 @@ function createFrameLookupTable(videos, extracted) {
76047
76278
  }
76048
76279
  return table;
76049
76280
  }
76050
- var VIDEO_FRAME_FORMATS, EXTRACT_CACHE_MIN_AGE_MS, GC_STALENESS_MS, SDR_TO_HDR_COLORSPACE_FILTER, ALPHA_CAPABLE_CODECS, HOLD_LAST_FRAME_TOLERANCE_FRAMES, FrameLookupTable;
76281
+ var VIDEO_FRAME_FORMATS, EXTRACT_CACHE_MIN_AGE_MS, GC_STALENESS_MS, SDR_TO_HDR_COLORSPACE_FILTER, ALPHA_CAPABLE_CODECS, FrameLookupTable;
76051
76282
  var init_videoFrameExtractor = __esm({
76052
76283
  "../engine/src/services/videoFrameExtractor.ts"() {
76053
76284
  "use strict";
@@ -76067,7 +76298,6 @@ var init_videoFrameExtractor = __esm({
76067
76298
  GC_STALENESS_MS = 24 * 60 * 60 * 1e3;
76068
76299
  SDR_TO_HDR_COLORSPACE_FILTER = "colorspace=all=bt2020:iall=bt709:range=tv";
76069
76300
  ALPHA_CAPABLE_CODECS = /* @__PURE__ */ new Set(["vp9", "vp8", "prores"]);
76070
- HOLD_LAST_FRAME_TOLERANCE_FRAMES = 2;
76071
76301
  FrameLookupTable = class {
76072
76302
  videos = /* @__PURE__ */ new Map();
76073
76303
  orderedVideos = [];
@@ -76083,7 +76313,15 @@ var init_videoFrameExtractor = __esm({
76083
76313
  const video = this.videos.get(videoId);
76084
76314
  if (!video) return null;
76085
76315
  if (globalTime < video.start || globalTime > video.end) return null;
76086
- return getFrameAtTime(video.extracted, globalTime, video.start, video.loop, video.mediaStart);
76316
+ const frameIndex = getFrameIndexAtTime(
76317
+ video.extracted,
76318
+ globalTime,
76319
+ video.start,
76320
+ video.loop,
76321
+ video.mediaStart,
76322
+ true
76323
+ );
76324
+ return frameIndex == null ? null : video.extracted.framePaths.get(frameIndex) || null;
76087
76325
  }
76088
76326
  resetActiveState() {
76089
76327
  this.activeVideoIds.clear();
@@ -76132,32 +76370,15 @@ var init_videoFrameExtractor = __esm({
76132
76370
  for (const videoId of this.activeVideoIds) {
76133
76371
  const video = this.videos.get(videoId);
76134
76372
  if (!video) continue;
76135
- let localTime = globalTime - video.start;
76136
- const loopDuration = Math.max(0, video.extracted.metadata.durationSeconds - video.mediaStart);
76137
- if (video.loop && loopDuration > 0 && localTime >= loopDuration) {
76138
- localTime %= loopDuration;
76139
- }
76140
- const frameIndex = Math.floor(localTime * video.extracted.fps + 1e-9);
76141
- if (video.loop && frameIndex >= video.extracted.totalFrames) {
76142
- const framePath2 = video.extracted.framePaths.get(video.extracted.totalFrames - 1);
76143
- if (framePath2) {
76144
- frames.set(videoId, { framePath: framePath2, frameIndex: video.extracted.totalFrames - 1 });
76145
- }
76146
- continue;
76147
- }
76148
- if (frameIndex < 0 || frameIndex >= video.extracted.totalFrames) {
76149
- const fps = video.extracted.fps;
76150
- const holdTolerance = Math.max(
76151
- fps > 0 ? HOLD_LAST_FRAME_TOLERANCE_FRAMES / fps : 0,
76152
- MEDIA_DURATION_CLAMP_EPSILON_SECONDS
76153
- );
76154
- if (globalTime >= video.end - holdTolerance && video.extracted.totalFrames > 0) {
76155
- const lastIndex = video.extracted.totalFrames - 1;
76156
- const lastPath = video.extracted.framePaths.get(lastIndex);
76157
- if (lastPath) frames.set(videoId, { framePath: lastPath, frameIndex: lastIndex });
76158
- }
76159
- continue;
76160
- }
76373
+ const frameIndex = getFrameIndexAtTime(
76374
+ video.extracted,
76375
+ globalTime,
76376
+ video.start,
76377
+ video.loop,
76378
+ video.mediaStart,
76379
+ true
76380
+ );
76381
+ if (frameIndex == null) continue;
76161
76382
  const framePath = video.extracted.framePaths.get(frameIndex);
76162
76383
  if (!framePath) continue;
76163
76384
  frames.set(videoId, { framePath, frameIndex });
@@ -77142,6 +77363,19 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
77142
77363
  }
77143
77364
  })
77144
77365
  );
77366
+ if (errors.length > 0) {
77367
+ try {
77368
+ rmSync3(workDir, { recursive: true, force: true });
77369
+ } catch {
77370
+ }
77371
+ return {
77372
+ success: false,
77373
+ outputPath,
77374
+ durationMs: Date.now() - startMs,
77375
+ tracksProcessed: tracks.length,
77376
+ error: `Audio processing failed: ${errors.join(", ")}`
77377
+ };
77378
+ }
77145
77379
  const mixResult = await mixAudioTracks(tracks, outputPath, totalDuration, signal, config);
77146
77380
  try {
77147
77381
  rmSync3(workDir, { recursive: true, force: true });
@@ -77280,8 +77514,16 @@ function selectWorkerDiagnostics(lines, maxLines = MAX_WORKER_DIAGNOSTIC_LINES)
77280
77514
  function compactDiagnosticLine(line2) {
77281
77515
  return line2.replace(/\s+/g, " ").trim();
77282
77516
  }
77517
+ function expectedFramesForTask(task) {
77518
+ const stride = task.frameStride ?? 1;
77519
+ return Math.max(0, Math.ceil((task.endFrame - task.startFrame) / stride));
77520
+ }
77521
+ function synthesizeSilentWorkerExitError(result, expectedFrames) {
77522
+ return `worker ${result.workerId} exited without terminal error string (framesCaptured=${result.framesCaptured}, expected=${expectedFrames}, range=[${result.startFrame}, ${result.endFrame})). Field signal ts=1784042064 \u2014 this class of failure has been reported; consider re-run with --workers=1 to isolate.`;
77523
+ }
77283
77524
  function formatWorkerFailure(result) {
77284
- const base2 = `Worker ${result.workerId}: ${result.error ?? "unknown error"}`;
77525
+ const errorText = result.error && result.error.length > 0 ? result.error : synthesizeSilentWorkerExitError(result, expectedFramesForTask(result));
77526
+ const base2 = `Worker ${result.workerId}: ${errorText}`;
77285
77527
  if (!result.diagnostics || result.diagnostics.length === 0) return base2;
77286
77528
  const diagnostics = result.diagnostics.map(compactDiagnosticLine).join(" | ");
77287
77529
  return `${base2}; diagnostics: ${diagnostics}`;
@@ -77537,6 +77779,11 @@ async function executeParallelCapture(serverUrl, workDir, tasks, captureOptions,
77537
77779
  )
77538
77780
  )
77539
77781
  );
77782
+ for (const r2 of results) {
77783
+ if (!r2.error && r2.framesCaptured < expectedFramesForTask(r2)) {
77784
+ r2.error = synthesizeSilentWorkerExitError(r2, expectedFramesForTask(r2));
77785
+ }
77786
+ }
77540
77787
  const errors = results.filter((r2) => r2.error);
77541
77788
  if (errors.length > 0) {
77542
77789
  const errorMessages = errors.map(formatWorkerFailure).join("; ");
@@ -78252,6 +78499,143 @@ var init_layerCompositor = __esm({
78252
78499
  }
78253
78500
  });
78254
78501
 
78502
+ // ../engine/src/utils/gpuParityDiff.ts
78503
+ function diffGpuParityFrames(a, b2, options = {}) {
78504
+ if (a.width !== b2.width || a.height !== b2.height) {
78505
+ throw new Error(
78506
+ `diffGpuParityFrames: frame size mismatch \u2014 A is ${a.width}x${a.height}, B is ${b2.width}x${b2.height}`
78507
+ );
78508
+ }
78509
+ const expectedLen = a.width * a.height * 4;
78510
+ if (a.data.length !== expectedLen) {
78511
+ throw new Error(
78512
+ `diffGpuParityFrames: frame A data length ${a.data.length} does not match expected ${expectedLen} (${a.width}x${a.height} * 4)`
78513
+ );
78514
+ }
78515
+ if (b2.data.length !== expectedLen) {
78516
+ throw new Error(
78517
+ `diffGpuParityFrames: frame B data length ${b2.data.length} does not match expected ${expectedLen} (${b2.width}x${b2.height} * 4)`
78518
+ );
78519
+ }
78520
+ const tol = options.pixelChannelTolerance ?? DEFAULT_PIXEL_CHANNEL_TOLERANCE;
78521
+ const blackSum = options.blackSumThreshold ?? DEFAULT_BLACK_SUM_THRESHOLD;
78522
+ const contentSum = options.contentSumThreshold ?? DEFAULT_CONTENT_SUM_THRESHOLD;
78523
+ if (contentSum <= blackSum) {
78524
+ throw new Error(
78525
+ `diffGpuParityFrames: contentSumThreshold (${contentSum}) must be strictly greater than blackSumThreshold (${blackSum}) \u2014 overlapping thresholds would double-classify borderline pixels`
78526
+ );
78527
+ }
78528
+ const total = a.width * a.height;
78529
+ const aData = a.data;
78530
+ const bData = b2.data;
78531
+ let diffPixels = 0;
78532
+ let blackOnlyAPixels = 0;
78533
+ let blackOnlyBPixels = 0;
78534
+ let aMinX = a.width;
78535
+ let aMinY = a.height;
78536
+ let aMaxX = -1;
78537
+ let aMaxY = -1;
78538
+ let bMinX = a.width;
78539
+ let bMinY = a.height;
78540
+ let bMaxX = -1;
78541
+ let bMaxY = -1;
78542
+ for (let y = 0; y < a.height; y++) {
78543
+ for (let x3 = 0; x3 < a.width; x3++) {
78544
+ const i2 = (y * a.width + x3) * 4;
78545
+ const ar = aData[i2] ?? 0;
78546
+ const ag = aData[i2 + 1] ?? 0;
78547
+ const ab = aData[i2 + 2] ?? 0;
78548
+ const br = bData[i2] ?? 0;
78549
+ const bg = bData[i2 + 1] ?? 0;
78550
+ const bb = bData[i2 + 2] ?? 0;
78551
+ if (Math.abs(ar - br) > tol || Math.abs(ag - bg) > tol || Math.abs(ab - bb) > tol) {
78552
+ diffPixels++;
78553
+ }
78554
+ const aSum = ar + ag + ab;
78555
+ const bSum = br + bg + bb;
78556
+ if (aSum <= blackSum && bSum >= contentSum) {
78557
+ blackOnlyAPixels++;
78558
+ if (x3 < aMinX) aMinX = x3;
78559
+ if (y < aMinY) aMinY = y;
78560
+ if (x3 > aMaxX) aMaxX = x3;
78561
+ if (y > aMaxY) aMaxY = y;
78562
+ } else if (bSum <= blackSum && aSum >= contentSum) {
78563
+ blackOnlyBPixels++;
78564
+ if (x3 < bMinX) bMinX = x3;
78565
+ if (y < bMinY) bMinY = y;
78566
+ if (x3 > bMaxX) bMaxX = x3;
78567
+ if (y > bMaxY) bMaxY = y;
78568
+ }
78569
+ }
78570
+ }
78571
+ return {
78572
+ width: a.width,
78573
+ height: a.height,
78574
+ totalPixels: total,
78575
+ diffPixels,
78576
+ diffFraction: diffPixels / total,
78577
+ blackOnlyInA: {
78578
+ pixels: blackOnlyAPixels,
78579
+ fraction: blackOnlyAPixels / total,
78580
+ boundingBox: blackOnlyAPixels === 0 ? null : { x: aMinX, y: aMinY, width: aMaxX - aMinX + 1, height: aMaxY - aMinY + 1 }
78581
+ },
78582
+ blackOnlyInB: {
78583
+ pixels: blackOnlyBPixels,
78584
+ fraction: blackOnlyBPixels / total,
78585
+ boundingBox: blackOnlyBPixels === 0 ? null : { x: bMinX, y: bMinY, width: bMaxX - bMinX + 1, height: bMaxY - bMinY + 1 }
78586
+ }
78587
+ };
78588
+ }
78589
+ function diffGpuParityPngs(pngA, pngB, options = {}) {
78590
+ let a;
78591
+ let b2;
78592
+ try {
78593
+ a = decodePng(pngA);
78594
+ } catch (err) {
78595
+ throw new Error(`diffGpuParityPngs: failed to decode frame A`, { cause: err });
78596
+ }
78597
+ try {
78598
+ b2 = decodePng(pngB);
78599
+ } catch (err) {
78600
+ throw new Error(`diffGpuParityPngs: failed to decode frame B`, { cause: err });
78601
+ }
78602
+ return diffGpuParityFrames(a, b2, options);
78603
+ }
78604
+ function verifyGpuParity(a, b2, options = {}) {
78605
+ const diff = diffGpuParityFrames(a, b2, options);
78606
+ const threshold = options.blackOnlyFractionThreshold ?? DEFAULT_BLACK_ONLY_FRACTION_THRESHOLD;
78607
+ if (diff.blackOnlyInA.fraction > threshold) {
78608
+ const bb = diff.blackOnlyInA.boundingBox;
78609
+ const region = bb ? ` (bbox ${bb.x},${bb.y} ${bb.width}x${bb.height})` : "";
78610
+ return {
78611
+ ok: false,
78612
+ reason: `hardware-GPU frame has ${diff.blackOnlyInA.pixels} pixel(s) (${(diff.blackOnlyInA.fraction * 100).toFixed(3)}%) that are solid-black while software-GPU frame has content there${region} \u2014 likely shape-dependent hardware-GPU capture bug`,
78613
+ diff
78614
+ };
78615
+ }
78616
+ if (diff.blackOnlyInB.fraction > threshold) {
78617
+ const bb = diff.blackOnlyInB.boundingBox;
78618
+ const region = bb ? ` (bbox ${bb.x},${bb.y} ${bb.width}x${bb.height})` : "";
78619
+ return {
78620
+ ok: false,
78621
+ reason: `software-GPU frame has ${diff.blackOnlyInB.pixels} pixel(s) (${(diff.blackOnlyInB.fraction * 100).toFixed(3)}%) that are solid-black while hardware-GPU frame has content there${region} \u2014 unexpected inverse pattern, worth investigating`,
78622
+ diff
78623
+ };
78624
+ }
78625
+ return { ok: true, reason: "", diff };
78626
+ }
78627
+ var DEFAULT_PIXEL_CHANNEL_TOLERANCE, DEFAULT_BLACK_SUM_THRESHOLD, DEFAULT_CONTENT_SUM_THRESHOLD, DEFAULT_BLACK_ONLY_FRACTION_THRESHOLD;
78628
+ var init_gpuParityDiff = __esm({
78629
+ "../engine/src/utils/gpuParityDiff.ts"() {
78630
+ "use strict";
78631
+ init_alphaBlit();
78632
+ DEFAULT_PIXEL_CHANNEL_TOLERANCE = 8;
78633
+ DEFAULT_BLACK_SUM_THRESHOLD = 12;
78634
+ DEFAULT_CONTENT_SUM_THRESHOLD = 32;
78635
+ DEFAULT_BLACK_ONLY_FRACTION_THRESHOLD = 1e-3;
78636
+ }
78637
+ });
78638
+
78255
78639
  // ../engine/src/utils/shaderTransitions.ts
78256
78640
  function pqEotf(signal) {
78257
78641
  const sp = Math.pow(Math.max(0, signal), 1 / PQ_M2);
@@ -79169,6 +79553,8 @@ __export(src_exports, {
79169
79553
  assertConfiguredFfmpegBinariesExist: () => assertConfiguredFfmpegBinariesExist,
79170
79554
  assertPublicHttpsUrl: () => assertPublicHttpsUrl,
79171
79555
  assertSwiftShader: () => assertSwiftShader,
79556
+ augmentPageNavigationTimeoutError: () => augmentPageNavigationTimeoutError,
79557
+ augmentProtocolTimeoutError: () => augmentProtocolTimeoutError,
79172
79558
  beginFrameCapture: () => beginFrameCapture,
79173
79559
  blitRgb48leAffine: () => blitRgb48leAffine,
79174
79560
  blitRgb48leRegion: () => blitRgb48leRegion,
@@ -79197,6 +79583,8 @@ __export(src_exports, {
79197
79583
  decodePngToRgb48le: () => decodePngToRgb48le,
79198
79584
  detectGpuEncoder: () => detectGpuEncoder,
79199
79585
  detectTransfer: () => detectTransfer,
79586
+ diffGpuParityFrames: () => diffGpuParityFrames,
79587
+ diffGpuParityPngs: () => diffGpuParityPngs,
79200
79588
  discardWarmupCapture: () => discardWarmupCapture,
79201
79589
  distributeFrames: () => distributeFrames,
79202
79590
  distributeFramesInterleaved: () => distributeFramesInterleaved,
@@ -79235,6 +79623,8 @@ __export(src_exports, {
79235
79623
  isHttpUrl: () => isHttpUrl,
79236
79624
  isLowMemorySystem: () => isLowMemorySystem,
79237
79625
  isMemoryExhaustionError: () => isMemoryExhaustionError,
79626
+ isPageNavigationTimeoutError: () => isPageNavigationTimeoutError,
79627
+ isProtocolTimeoutError: () => isProtocolTimeoutError,
79238
79628
  isTransientBrowserError: () => isTransientBrowserError,
79239
79629
  isVideoFrameFormat: () => isVideoFrameFormat,
79240
79630
  killTrackedProcesses: () => killTrackedProcesses,
@@ -79249,6 +79639,7 @@ __export(src_exports, {
79249
79639
  parseImageElements: () => parseImageElements,
79250
79640
  parseTransformMatrix: () => parseTransformMatrix,
79251
79641
  parseVideoElements: () => parseVideoElements,
79642
+ percentileOf: () => percentileOf,
79252
79643
  prepareCaptureSessionForReuse: () => prepareCaptureSessionForReuse,
79253
79644
  probeBeginFrameLiveness: () => probeBeginFrameLiveness,
79254
79645
  processCompositionAudio: () => processCompositionAudio,
@@ -79275,6 +79666,7 @@ __export(src_exports, {
79275
79666
  syncVideoFrameVisibility: () => syncVideoFrameVisibility,
79276
79667
  trackChildProcess: () => trackChildProcess,
79277
79668
  uploadAndReadbackHdrFrame: () => uploadAndReadbackHdrFrame,
79669
+ verifyGpuParity: () => verifyGpuParity,
79278
79670
  writeCapturedFrame: () => writeCapturedFrame
79279
79671
  });
79280
79672
  var init_src = __esm({
@@ -79284,6 +79676,8 @@ var init_src = __esm({
79284
79676
  init_vp9Options();
79285
79677
  init_systemMemory();
79286
79678
  init_browserManager();
79679
+ init_protocolTimeoutErrorHint();
79680
+ init_pageNavigationTimeoutErrorHint();
79287
79681
  init_frameCapture();
79288
79682
  init_screenshotService();
79289
79683
  init_chunkEncoder();
@@ -79303,6 +79697,7 @@ var init_src = __esm({
79303
79697
  init_processTracker();
79304
79698
  init_alphaBlit();
79305
79699
  init_layerCompositor();
79700
+ init_gpuParityDiff();
79306
79701
  init_shaderTransitions();
79307
79702
  init_hdrCapture();
79308
79703
  init_screenshotService();
@@ -96281,9 +96676,13 @@ import { extname as extname8, isAbsolute as isAbsolute8, relative as relative7,
96281
96676
  import { existsSync as existsSync32, readFileSync as readFileSync22 } from "fs";
96282
96677
  import { bodyLimit } from "hono/body-limit";
96283
96678
  import {
96679
+ closeSync as closeSync3,
96284
96680
  existsSync as existsSync33,
96681
+ ftruncateSync,
96682
+ openSync as openSync3,
96285
96683
  readFileSync as readFileSync42,
96286
96684
  writeFileSync as writeFileSync42,
96685
+ writeSync,
96287
96686
  mkdirSync as mkdirSync32,
96288
96687
  unlinkSync as unlinkSync22,
96289
96688
  rmSync as rmSync22,
@@ -96302,21 +96701,22 @@ import { basename as basename3, join as join42 } from "path";
96302
96701
  import { mkdirSync as mkdirSync22, readdirSync as readdirSync32, readFileSync as readFileSync32, unlinkSync as unlinkSync3, writeFileSync as writeFileSync32 } from "fs";
96303
96702
  import { Buffer as Buffer2 } from "buffer";
96304
96703
  import { join as join52, relative as relative22 } from "path";
96704
+ import { createHash as createHash22, randomUUID as randomUUID5 } from "crypto";
96305
96705
  import postcss3 from "postcss";
96306
96706
  import { existsSync as existsSync52, readFileSync as readFileSync72, statSync as statSync22 } from "fs";
96307
96707
  import { join as join82 } from "path";
96308
- import { createHash as createHash22 } from "crypto";
96708
+ import { createHash as createHash32 } from "crypto";
96309
96709
  import { existsSync as existsSync42, readFileSync as readFileSync52 } from "fs";
96310
96710
  import { join as join72 } from "path";
96311
96711
  import {
96312
- closeSync as closeSync3,
96712
+ closeSync as closeSync22,
96313
96713
  constants as constants2,
96314
96714
  fstatSync,
96315
- ftruncateSync,
96316
- openSync as openSync3,
96715
+ ftruncateSync as ftruncateSync2,
96716
+ openSync as openSync22,
96317
96717
  readFileSync as readFileSync62,
96318
96718
  writeFileSync as writeFileSync52,
96319
- writeSync
96719
+ writeSync as writeSync2
96320
96720
  } from "fs";
96321
96721
  import { readFileSync as readFileSync82 } from "fs";
96322
96722
  import { join as join92 } from "path";
@@ -96325,10 +96725,10 @@ import { existsSync as existsSync62, readFileSync as readFileSync92, mkdirSync a
96325
96725
  import { join as join102 } from "path";
96326
96726
  import { existsSync as existsSync72, readFileSync as readFileSync102, writeFileSync as writeFileSync62, mkdirSync as mkdirSync52, statSync as statSync42 } from "fs";
96327
96727
  import { join as join112 } from "path";
96328
- import { createHash as createHash32 } from "crypto";
96728
+ import { createHash as createHash42 } from "crypto";
96329
96729
  import { existsSync as existsSync82, readFileSync as readFileSync112, writeFileSync as writeFileSync72, mkdirSync as mkdirSync62 } from "fs";
96330
96730
  import { join as join122 } from "path";
96331
- import { closeSync as closeSync22, constants as constants22, fstatSync as fstatSync2, openSync as openSync22, readSync } from "fs";
96731
+ import { closeSync as closeSync32, constants as constants22, fstatSync as fstatSync2, openSync as openSync32, readSync } from "fs";
96332
96732
  import { streamSSE as streamSSE2 } from "hono/streaming";
96333
96733
  import { existsSync as existsSync92, mkdirSync as mkdirSync72 } from "fs";
96334
96734
  import { basename as basename22, dirname as dirname22, extname as extname32, join as join132 } from "path";
@@ -96753,6 +97153,33 @@ function pruneBackups(backupDir, backupKey, keepPerFile) {
96753
97153
  }
96754
97154
  }
96755
97155
  }
97156
+ function fileContentVersion(content) {
97157
+ return `"sha256:${createHash22("sha256").update(content, "utf8").digest("hex")}"`;
97158
+ }
97159
+ function createWriteToken(requestToken) {
97160
+ const token = requestToken?.trim();
97161
+ return token && token.length <= 200 ? token : randomUUID5();
97162
+ }
97163
+ function recordFileWriteReceipt(absPath, receipt) {
97164
+ const now = Date.now();
97165
+ const current2 = (receipts.get(absPath) ?? []).filter(
97166
+ (entry) => now - entry.recordedAt < RECEIPT_TTL_MS
97167
+ );
97168
+ current2.push({ ...receipt, recordedAt: now });
97169
+ receipts.set(absPath, current2);
97170
+ }
97171
+ function consumeFileWriteReceipt(absPath) {
97172
+ const now = Date.now();
97173
+ const current2 = (receipts.get(absPath) ?? []).filter(
97174
+ (entry) => now - entry.recordedAt < RECEIPT_TTL_MS
97175
+ );
97176
+ const receipt = current2.shift() ?? null;
97177
+ if (current2.length > 0) receipts.set(absPath, current2);
97178
+ else receipts.delete(absPath);
97179
+ if (!receipt) return null;
97180
+ const { path: path2, version: version2, writeToken } = receipt;
97181
+ return { path: path2, version: version2, writeToken };
97182
+ }
96756
97183
  function findUnsafeMutationValues(value, path2 = "body", options = {}) {
96757
97184
  if (value === null) {
96758
97185
  return options.allowNullPath?.(path2) ? [] : [{ path: path2, reason: "null" }];
@@ -97704,9 +98131,11 @@ async function applyGsapMutations(c3, res, mutations) {
97704
98131
  after: newHtml,
97705
98132
  scriptText: block.scriptText,
97706
98133
  path: res.filePath,
98134
+ version: fileContentVersion(newHtml),
97707
98135
  backupPath
97708
98136
  };
97709
98137
  if (skippedSelectors.size > 0) responsePayload.skippedSelectors = [...skippedSelectors];
98138
+ c3.header("ETag", responsePayload.version);
97710
98139
  return c3.json(responsePayload);
97711
98140
  }
97712
98141
  function executeGsapMutationAcorn(body, block, respond2) {
@@ -98367,19 +98796,111 @@ function registerFileRoutes(api, adapter2) {
98367
98796
  return c3.json({ error: "not found" }, 404);
98368
98797
  }
98369
98798
  const content = readFileSync42(res.absPath, "utf-8");
98370
- return c3.json({ filename: res.filePath, content });
98799
+ const version2 = fileContentVersion(content);
98800
+ c3.header("ETag", version2);
98801
+ return c3.json({ filename: res.filePath, content, version: version2 });
98371
98802
  });
98372
98803
  api.put("/projects/:id/files/*", async (c3) => {
98373
98804
  const res = await resolveProjectFile(c3, adapter2);
98374
98805
  if ("error" in res) return res.error;
98375
- ensureDir(res.absPath);
98376
98806
  const body = await c3.req.text();
98377
- const backup = snapshotBeforeWrite(res.project.dir, res.absPath);
98378
- if (backup.error) console.warn(`Failed to create backup for ${res.filePath}: ${backup.error}`);
98379
- writeFileSync42(res.absPath, body, "utf-8");
98807
+ const expectedVersion = c3.req.header("If-Match")?.trim() ?? null;
98808
+ const createOnly = c3.req.header("If-None-Match")?.trim() === "*";
98809
+ if (expectedVersion === null && !createOnly) {
98810
+ let currentContent = null;
98811
+ try {
98812
+ currentContent = readFileSync42(res.absPath, "utf-8");
98813
+ } catch (error) {
98814
+ if (!error || typeof error !== "object" || !("code" in error) || error.code !== "ENOENT") {
98815
+ throw error;
98816
+ }
98817
+ }
98818
+ return c3.json(
98819
+ {
98820
+ error: "precondition required",
98821
+ path: res.filePath,
98822
+ currentVersion: currentContent === null ? null : fileContentVersion(currentContent),
98823
+ currentContent
98824
+ },
98825
+ 428
98826
+ );
98827
+ }
98828
+ let backup = { backupPath: null };
98829
+ if (createOnly) {
98830
+ ensureDir(res.absPath);
98831
+ let fd;
98832
+ try {
98833
+ fd = openSync3(res.absPath, "wx");
98834
+ } catch (error) {
98835
+ if (!error || typeof error !== "object" || !("code" in error) || error.code !== "EEXIST") {
98836
+ throw error;
98837
+ }
98838
+ const currentContent = readFileSync42(res.absPath, "utf-8");
98839
+ return c3.json(
98840
+ {
98841
+ error: "file conflict",
98842
+ path: res.filePath,
98843
+ currentVersion: fileContentVersion(currentContent),
98844
+ currentContent
98845
+ },
98846
+ 409
98847
+ );
98848
+ }
98849
+ try {
98850
+ writeSync(fd, body, 0, "utf-8");
98851
+ } finally {
98852
+ closeSync3(fd);
98853
+ }
98854
+ } else {
98855
+ let fd;
98856
+ try {
98857
+ fd = openSync3(res.absPath, "r+");
98858
+ } catch (error) {
98859
+ if (!error || typeof error !== "object" || !("code" in error) || error.code !== "ENOENT") {
98860
+ throw error;
98861
+ }
98862
+ return c3.json(
98863
+ {
98864
+ error: "file conflict",
98865
+ path: res.filePath,
98866
+ currentVersion: null,
98867
+ currentContent: null
98868
+ },
98869
+ 409
98870
+ );
98871
+ }
98872
+ try {
98873
+ const currentContent = readFileSync42(fd, "utf-8");
98874
+ const currentVersion = fileContentVersion(currentContent);
98875
+ if (expectedVersion !== currentVersion) {
98876
+ return c3.json(
98877
+ {
98878
+ error: "file conflict",
98879
+ path: res.filePath,
98880
+ currentVersion,
98881
+ currentContent
98882
+ },
98883
+ 409
98884
+ );
98885
+ }
98886
+ backup = snapshotBeforeWrite(res.project.dir, res.absPath);
98887
+ if (backup.error)
98888
+ console.warn(`Failed to create backup for ${res.filePath}: ${backup.error}`);
98889
+ ftruncateSync(fd, 0);
98890
+ writeSync(fd, body, 0, "utf-8");
98891
+ } finally {
98892
+ closeSync3(fd);
98893
+ }
98894
+ }
98895
+ const version2 = fileContentVersion(body);
98896
+ const writeToken = createWriteToken(c3.req.header("X-Hyperframes-Write-Token"));
98897
+ recordFileWriteReceipt(res.absPath, { path: res.filePath, version: version2, writeToken });
98898
+ c3.header("ETag", version2);
98380
98899
  return c3.json({
98381
98900
  ok: true,
98382
98901
  path: res.filePath,
98902
+ version: version2,
98903
+ writeToken,
98383
98904
  backupPath: backupPathForResponse(res.project.dir, backup.backupPath)
98384
98905
  });
98385
98906
  });
@@ -98451,17 +98972,28 @@ function registerFileRoutes(api, adapter2) {
98451
98972
  fallbackTiming
98452
98973
  );
98453
98974
  if (!result.matched) {
98454
- return c3.json({ ok: false, changed: false, content: originalContent, path: ctx.filePath });
98975
+ const version22 = fileContentVersion(originalContent);
98976
+ c3.header("ETag", version22);
98977
+ return c3.json({
98978
+ ok: false,
98979
+ changed: false,
98980
+ content: originalContent,
98981
+ path: ctx.filePath,
98982
+ version: version22
98983
+ });
98455
98984
  }
98456
98985
  const backup = snapshotBeforeWrite(ctx.project.dir, ctx.absPath);
98457
98986
  if (backup.error) console.warn(`Failed to create backup for ${ctx.filePath}: ${backup.error}`);
98458
98987
  writeFileSync42(ctx.absPath, result.html, "utf-8");
98988
+ const version2 = fileContentVersion(result.html);
98989
+ c3.header("ETag", version2);
98459
98990
  return c3.json({
98460
98991
  ok: true,
98461
98992
  changed: true,
98462
98993
  content: result.html,
98463
98994
  newId: result.newId,
98464
98995
  path: ctx.filePath,
98996
+ version: version2,
98465
98997
  backupPath: backupPathForResponse(ctx.project.dir, backup.backupPath)
98466
98998
  });
98467
98999
  });
@@ -99146,7 +99678,7 @@ function persistHfIdsIfNeeded(filePath, html) {
99146
99678
  function openNoFollow(filePath, flags) {
99147
99679
  const noFollow = constants2.O_NOFOLLOW ?? 0;
99148
99680
  try {
99149
- return openSync3(filePath, flags | noFollow);
99681
+ return openSync22(filePath, flags | noFollow);
99150
99682
  } catch {
99151
99683
  return null;
99152
99684
  }
@@ -99166,15 +99698,15 @@ function stampFileHfIds(filePath) {
99166
99698
  const idsBefore = (html.match(/\bdata-hf-id=/g) ?? []).length;
99167
99699
  const idsAfter = (normalized2.match(/\bdata-hf-id=/g) ?? []).length;
99168
99700
  if (writable && idsAfter > idsBefore) {
99169
- ftruncateSync(fd, 0);
99170
- writeSync(fd, normalized2, 0, "utf-8");
99701
+ ftruncateSync2(fd, 0);
99702
+ writeSync2(fd, normalized2, 0, "utf-8");
99171
99703
  }
99172
99704
  return normalized2;
99173
99705
  } catch (err) {
99174
99706
  console.warn("[hyperframes] stampFileHfIds: failed to stamp ids:", err);
99175
99707
  return null;
99176
99708
  } finally {
99177
- closeSync3(fd);
99709
+ closeSync22(fd);
99178
99710
  }
99179
99711
  }
99180
99712
  function isVariablesPayload(value) {
@@ -99300,7 +99832,7 @@ function parsePreviewVariablesParam(raw) {
99300
99832
  }
99301
99833
  function variablesEtagSalt(raw) {
99302
99834
  if (!raw) return "";
99303
- return `:vars:${createHash22("sha1").update(raw).digest("hex").slice(0, 12)}`;
99835
+ return `:vars:${createHash32("sha1").update(raw).digest("hex").slice(0, 12)}`;
99304
99836
  }
99305
99837
  function previewVariablesFromRequest(rawVariables) {
99306
99838
  const parse9 = parsePreviewVariablesParam(rawVariables);
@@ -100361,7 +100893,7 @@ function registerThumbnailRoutes(api, adapter2) {
100361
100893
  const htmlFile = join112(project.dir, compPath);
100362
100894
  if (existsSync72(htmlFile)) {
100363
100895
  const html = readFileSync102(htmlFile, "utf-8");
100364
- sourceKey = `_${createHash32("sha1").update(html).digest("hex").slice(0, 16)}`;
100896
+ sourceKey = `_${createHash42("sha1").update(html).digest("hex").slice(0, 16)}`;
100365
100897
  sourceMtime = Math.round(statSync42(htmlFile).mtimeMs);
100366
100898
  if (!vpWidth) {
100367
100899
  const wMatch = html.match(/data-width=["'](\d+)["']/);
@@ -100374,14 +100906,14 @@ function registerThumbnailRoutes(api, adapter2) {
100374
100906
  let manualEditsKey = "";
100375
100907
  if (existsSync72(manualEditsFile)) {
100376
100908
  const manualEditsContent = readFileSync102(manualEditsFile, "utf-8");
100377
- manualEditsKey = `_${createHash32("sha1").update(manualEditsContent).digest("hex").slice(0, 16)}`;
100909
+ manualEditsKey = `_${createHash42("sha1").update(manualEditsContent).digest("hex").slice(0, 16)}`;
100378
100910
  sourceMtime = Math.max(sourceMtime, Math.round(statSync42(manualEditsFile).mtimeMs));
100379
100911
  }
100380
100912
  const motionFile = join112(project.dir, STUDIO_MOTION_PATH);
100381
100913
  let motionKey = "";
100382
100914
  if (existsSync72(motionFile)) {
100383
100915
  const motionContent = readFileSync102(motionFile, "utf-8");
100384
- motionKey = `_${createHash32("sha1").update(motionContent).digest("hex").slice(0, 16)}`;
100916
+ motionKey = `_${createHash42("sha1").update(motionContent).digest("hex").slice(0, 16)}`;
100385
100917
  sourceMtime = Math.max(sourceMtime, Math.round(statSync42(motionFile).mtimeMs));
100386
100918
  }
100387
100919
  const previewUrl = compPath === "index.html" ? `http://${c3.req.header("host")}/api/projects/${project.id}/preview` : `http://${c3.req.header("host")}/api/projects/${project.id}/preview/comp/${compPath}`;
@@ -100528,7 +101060,7 @@ function registerFontRoutes(api) {
100528
101060
  if (!located) return c3.json({ error: "font not found" }, 404);
100529
101061
  let fd;
100530
101062
  try {
100531
- fd = openSync22(located.path, constants22.O_RDONLY | constants22.O_NOFOLLOW);
101063
+ fd = openSync32(located.path, constants22.O_RDONLY | constants22.O_NOFOLLOW);
100532
101064
  } catch {
100533
101065
  return c3.json({ error: "font file not accessible" }, 404);
100534
101066
  }
@@ -100550,7 +101082,7 @@ function registerFontRoutes(api) {
100550
101082
  } catch {
100551
101083
  return c3.json({ error: "failed to read font file" }, 500);
100552
101084
  } finally {
100553
- closeSync22(fd);
101085
+ closeSync32(fd);
100554
101086
  }
100555
101087
  });
100556
101088
  }
@@ -101045,7 +101577,7 @@ function updateBackgroundRemovalProgress(state, event) {
101045
101577
  state.framesProcessed = event.index;
101046
101578
  state.avgMsPerFrame = event.avgMsPerFrame;
101047
101579
  }
101048
- var import_postcss_selector_parser, IGNORE_DIRS, SIGNATURE_TEXT_EXTENSIONS, SIGNATURE_EXCLUDED_DIRS, MAX_SIGNATURE_TEXT_BYTES, STUDIO_SIGNATURE_MANIFEST_PATHS, projectSignatureCache, COMPOSITION_ID_RE, MIME_TYPES2, SAMPLE_RATE, PEAK_COUNT, WAVEFORM_CACHE_VERSION, VIDEO_EXT, AUDIO_EXT, DEFAULT_KEEP_PER_FILE, DOM_PATCH_NULL_VALUE_PATH, HOLD_SYNC_MUTATION_TYPES, REGEXP_SPECIALS, NON_RENDERED_TAGS, STUDIO_MOTION_PATH, VARIABLES_PAYLOAD_ERROR, PROJECT_SIGNATURE_META, GSAP_CDN_VERSION, GSAP_CDN_SCRIPT, GSAP_CUSTOM_EASE_CDN_SCRIPT, GSAP_MOTION_PATH_CDN_SCRIPT, GSAP_CDN_FALLBACK_SCRIPT, VALID_RESOLUTIONS, STUDIO_MANUAL_EDITS_PATH, THUMBNAIL_CACHE_VERSION, MAX_FONT_RESULTS, GOOGLE_FONTS_METADATA_URL, GOOGLE_FONTS_FETCH_TIMEOUT_MS, cachedFonts, cachedGoogleFonts, GOOGLE_FONT_FALLBACKS, VIDEO_EXT2, IMAGE_EXT, AUDIO_EXT2, VIDEO_EXTENSIONS2, IMAGE_EXTENSIONS, VIDEO_OUTPUT_EXTENSIONS, QUALITIES, DEVICES;
101580
+ var import_postcss_selector_parser, IGNORE_DIRS, SIGNATURE_TEXT_EXTENSIONS, SIGNATURE_EXCLUDED_DIRS, MAX_SIGNATURE_TEXT_BYTES, STUDIO_SIGNATURE_MANIFEST_PATHS, projectSignatureCache, COMPOSITION_ID_RE, MIME_TYPES2, SAMPLE_RATE, PEAK_COUNT, WAVEFORM_CACHE_VERSION, VIDEO_EXT, AUDIO_EXT, DEFAULT_KEEP_PER_FILE, RECEIPT_TTL_MS, receipts, DOM_PATCH_NULL_VALUE_PATH, HOLD_SYNC_MUTATION_TYPES, REGEXP_SPECIALS, NON_RENDERED_TAGS, STUDIO_MOTION_PATH, VARIABLES_PAYLOAD_ERROR, PROJECT_SIGNATURE_META, GSAP_CDN_VERSION, GSAP_CDN_SCRIPT, GSAP_CUSTOM_EASE_CDN_SCRIPT, GSAP_MOTION_PATH_CDN_SCRIPT, GSAP_CDN_FALLBACK_SCRIPT, VALID_RESOLUTIONS, STUDIO_MANUAL_EDITS_PATH, THUMBNAIL_CACHE_VERSION, MAX_FONT_RESULTS, GOOGLE_FONTS_METADATA_URL, GOOGLE_FONTS_FETCH_TIMEOUT_MS, cachedFonts, cachedGoogleFonts, GOOGLE_FONT_FALLBACKS, VIDEO_EXT2, IMAGE_EXT, AUDIO_EXT2, VIDEO_EXTENSIONS2, IMAGE_EXTENSIONS, VIDEO_OUTPUT_EXTENSIONS, QUALITIES, DEVICES;
101049
101581
  var init_dist9 = __esm({
101050
101582
  "../studio-server/dist/index.js"() {
101051
101583
  "use strict";
@@ -101139,6 +101671,8 @@ var init_dist9 = __esm({
101139
101671
  VIDEO_EXT = /\.(mp4|webm|mov)$/i;
101140
101672
  AUDIO_EXT = /\.(mp3|wav|ogg|m4a|aac)$/i;
101141
101673
  DEFAULT_KEEP_PER_FILE = 10;
101674
+ RECEIPT_TTL_MS = 1e4;
101675
+ receipts = /* @__PURE__ */ new Map();
101142
101676
  DOM_PATCH_NULL_VALUE_PATH = /^body\.operations\[\d+\]\.value$/;
101143
101677
  HOLD_SYNC_MUTATION_TYPES = /* @__PURE__ */ new Set([
101144
101678
  "add-keyframe",
@@ -103274,7 +103808,8 @@ function heartbeatTargetMs(index) {
103274
103808
  const overflow = index - HEARTBEAT_RAMP_MS.length + 1;
103275
103809
  return HEARTBEAT_RAMP_END_MS + overflow * HEARTBEAT_REPEAT_MS;
103276
103810
  }
103277
- async function observeRenderStage(recorder, phase, data2, fn) {
103811
+ async function observeRenderStage(recorder, phase, data2, fn, options = {}) {
103812
+ const heartbeatMessage = options.heartbeatMessage ?? "stage still running";
103278
103813
  const startedAt = recorder.stageStart(phase, data2);
103279
103814
  let heartbeatCount = 0;
103280
103815
  let lastFiredAtMs = 0;
@@ -103284,7 +103819,7 @@ async function observeRenderStage(recorder, phase, data2, fn) {
103284
103819
  heartbeatTimer = setTimeout(() => {
103285
103820
  lastFiredAtMs = targetMs;
103286
103821
  heartbeatCount += 1;
103287
- recorder.checkpoint(phase, "stage still running", {
103822
+ recorder.checkpoint(phase, heartbeatMessage, {
103288
103823
  ...data2,
103289
103824
  heartbeatIndex: heartbeatCount,
103290
103825
  stageElapsedMs: Date.now() - startedAt
@@ -103325,7 +103860,25 @@ var init_observability = __esm({
103325
103860
  "quality",
103326
103861
  "renderJobId",
103327
103862
  "requestedHdrMode",
103328
- "requestedWorkers"
103863
+ "requestedWorkers",
103864
+ // "calibrating" during pre-capture browser warm-up / calibration stages;
103865
+ // "capturing" during capture_disk / capture_streaming / capture_hdr_*
103866
+ // stages. Distinguishes healthy 0-frame heartbeats (browser starting up)
103867
+ // from actual zero-frame stalls once capture is meant to be underway.
103868
+ // Field signal ts=1784019503.
103869
+ "stagePhase",
103870
+ // Full-fidelity fast-capture fallback trigger — the specific reason
103871
+ // drawElement gated off ("filter:blur", "filter:drop-shadow",
103872
+ // "backdrop-filter", "clip-path", "at_risk_timeline", "swiftshader", …).
103873
+ // Populated on the `capture_fallback_profile` checkpoint emitted by
103874
+ // `fallbackCaptureProfile.ts` when the operator opts into
103875
+ // `HF_PROFILE_FALLBACK_CAPTURE=true` so downstream metric consumers can
103876
+ // characterize per-frame perf by the exact trigger. Complementary to
103877
+ // `deGateReason`, which is the low-cardinality bucket for aggregation —
103878
+ // this string preserves the fine-grained "which CSS property" for
103879
+ // diagnostic reads. Sanitized like any observation message; low-cardinality
103880
+ // by construction (bounded by the fallback-trigger enumeration).
103881
+ "triggerReason"
103329
103882
  ]);
103330
103883
  RESERVED_LOG_KEYS = /* @__PURE__ */ new Set([
103331
103884
  "data",
@@ -103431,6 +103984,114 @@ var init_observability = __esm({
103431
103984
  }
103432
103985
  });
103433
103986
 
103987
+ // ../producer/src/services/render/fallbackCaptureProfile.ts
103988
+ function fallbackEngaged(perf) {
103989
+ return Boolean(perf.deFallbackTrigger) || Boolean(perf.deGateReason);
103990
+ }
103991
+ function resolveTrigger(perf) {
103992
+ return perf.deFallbackTrigger ?? perf.deGateReason ?? "unknown";
103993
+ }
103994
+ function emitFallbackCaptureProfile(recorder, perfSummaries, env = process.env) {
103995
+ if (env[FALLBACK_PROFILE_ENV_VAR] !== "true") return 0;
103996
+ let emitted = 0;
103997
+ for (const perf of perfSummaries) {
103998
+ if (!fallbackEngaged(perf)) continue;
103999
+ const trigger = resolveTrigger(perf);
104000
+ recorder.checkpoint("capture_fallback_profile", `fast-capture fallback profile (${trigger})`, {
104001
+ stagePhase: "fallback-capture",
104002
+ triggerReason: trigger,
104003
+ frameCount: perf.frames,
104004
+ captureTimeP50Ms: perf.p50TotalMs,
104005
+ captureTimeP95Ms: perf.p95TotalMs,
104006
+ captureTimeP99Ms: perf.p99TotalMs,
104007
+ captureTimeAvgTotalMs: perf.avgTotalMs
104008
+ });
104009
+ emitted++;
104010
+ }
104011
+ return emitted;
104012
+ }
104013
+ var FALLBACK_PROFILE_ENV_VAR;
104014
+ var init_fallbackCaptureProfile = __esm({
104015
+ "../producer/src/services/render/fallbackCaptureProfile.ts"() {
104016
+ "use strict";
104017
+ FALLBACK_PROFILE_ENV_VAR = "HF_PROFILE_FALLBACK_CAPTURE";
104018
+ }
104019
+ });
104020
+
104021
+ // ../producer/src/services/render/videoFrameCoverage.ts
104022
+ function resolveVideoCoverageThreshold(envValue = process.env.HF_VIDEO_COVERAGE_THRESHOLD) {
104023
+ if (envValue === void 0) return 0.95;
104024
+ const parsed = Number(envValue);
104025
+ if (!Number.isFinite(parsed)) return 0.95;
104026
+ if (parsed <= 0) return null;
104027
+ if (parsed > 1) return 1;
104028
+ return parsed;
104029
+ }
104030
+ function expectedFramesForClip(start, end, fps) {
104031
+ if (!Number.isFinite(start) || !Number.isFinite(end) || !Number.isFinite(fps)) return 0;
104032
+ if (fps <= 0) return 0;
104033
+ const duration = Math.max(0, end - start);
104034
+ return Math.ceil(duration * fps);
104035
+ }
104036
+ function computeVideoFrameCoverage(videos, extracted, fps) {
104037
+ const byId = /* @__PURE__ */ new Map();
104038
+ for (const entry of extracted) byId.set(entry.videoId, entry);
104039
+ const reports = [];
104040
+ for (const video of videos) {
104041
+ const entry = byId.get(video.id);
104042
+ const expectedFrames = expectedFramesForClip(video.start, video.end, fps);
104043
+ const capturedFrames = entry ? entry.framePaths.size : 0;
104044
+ const ratio = expectedFrames === 0 ? 1 : capturedFrames / expectedFrames;
104045
+ reports.push({
104046
+ videoId: video.id,
104047
+ clipStart: video.start,
104048
+ clipEnd: video.end,
104049
+ expectedFrames,
104050
+ capturedFrames,
104051
+ ratio
104052
+ });
104053
+ }
104054
+ return reports;
104055
+ }
104056
+ function assertVideoFrameCoverage(reports, threshold) {
104057
+ if (threshold === null) return;
104058
+ const failed = reports.filter((report2) => report2.expectedFrames > 0 && report2.ratio < threshold);
104059
+ if (failed.length === 0) return;
104060
+ const sorted = [...failed].sort((a, b2) => a.ratio - b2.ratio);
104061
+ const worst = sorted[0];
104062
+ const pct = (worst.ratio * 100).toFixed(1);
104063
+ const thresholdPct = (threshold * 100).toFixed(1);
104064
+ const suffix = sorted.length > 1 ? ` (+${sorted.length - 1} more clip(s) below threshold)` : "";
104065
+ throw new VideoFrameCoverageError(
104066
+ `Video "${worst.videoId}" captured ${worst.capturedFrames} of expected ${worst.expectedFrames} frames (coverage ${pct}%, threshold ${thresholdPct}%). check/snapshot may pass while the encoded MP4 renders this clip blank \u2014 aborting render to prevent shipping a wrong MP4.${suffix} Set HF_VIDEO_COVERAGE_THRESHOLD=0 to disable this gate.`,
104067
+ { threshold, worst, failedReports: sorted }
104068
+ );
104069
+ }
104070
+ function countAuthoredTimedClips(html) {
104071
+ const { document: document2 } = parseHTML(html);
104072
+ return document2.querySelectorAll("[data-start]").length;
104073
+ }
104074
+ var VideoFrameCoverageError;
104075
+ var init_videoFrameCoverage = __esm({
104076
+ "../producer/src/services/render/videoFrameCoverage.ts"() {
104077
+ "use strict";
104078
+ init_esm10();
104079
+ VideoFrameCoverageError = class extends Error {
104080
+ hyperframesVideoFrameCoverageError = true;
104081
+ threshold;
104082
+ worst;
104083
+ failedReports;
104084
+ constructor(message, details) {
104085
+ super(message);
104086
+ this.name = "VideoFrameCoverageError";
104087
+ this.threshold = details.threshold;
104088
+ this.worst = details.worst;
104089
+ this.failedReports = details.failedReports;
104090
+ }
104091
+ };
104092
+ }
104093
+ });
104094
+
103434
104095
  // ../producer/src/utils/ffprobe.ts
103435
104096
  var init_ffprobe2 = __esm({
103436
104097
  "../producer/src/utils/ffprobe.ts"() {
@@ -107968,7 +108629,7 @@ var POSITION_EDITS_RENDER_IIFE;
107968
108629
  var init_position_edits_render_inline = __esm({
107969
108630
  "../core/dist/generated/position-edits-render-inline.js"() {
107970
108631
  "use strict";
107971
- POSITION_EDITS_RENDER_IIFE = '"use strict";(()=>{function v(){return globalThis}function A(e,t){if(typeof window>"u")return;let o=v(),r=o.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(i){}(o.__hfDebug||o.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var P=null;function T(e,t){if(P)try{P({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(o){A("runtime.analytics.site1",o)}}var w="data-hf-edit-base-x",y="data-hf-edit-base-y",_="data-hf-edit-original-translate",g=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},H=e=>{let t=[],o=0,r="";for(let i of e.trim())i==="("&&(o+=1),i===")"&&(o=Math.max(0,o-1)),/\\s/.test(i)&&o===0?(r&&t.push(r),r=""):r+=i;return r&&t.push(r),t},R=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,b=(e,t)=>R.test(e)&&R.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,I=(e,t,o)=>{if(!e||e==="none")return`${t} ${o}`;let[r,i,a]=H(e);if(r===void 0)return`${t} ${o}`;if(i===void 0)return`${b(r,t)} ${o}`;let c=a===void 0?"":` ${a}`;return`${b(r,t)} ${b(i,o)}${c}`},O=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},j=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let o=e.ownerDocument.defaultView,r=o?o.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},x=new WeakMap;function V(e,t){let o=x.get(e);if(!t?.force&&o!==void 0&&e.style.getPropertyValue("translate")!==o){T("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=g(e.getAttribute("data-x"))-g(e.getAttribute(w)),i=g(e.getAttribute("data-y"))-g(e.getAttribute(y));e.hasAttribute(_)||e.setAttribute(_,j(e)),o===void 0&&O(e);let a=e.getAttribute(_)??"",c=I(a,`${r}px`,`${i}px`);e.style.setProperty("translate",c),x.set(e,e.style.getPropertyValue("translate"))}function m(e){let t=e.querySelectorAll(`[${w}], [${y}]`),o=e.defaultView?.HTMLElement,r=0;for(let i=0;i<t.length;i++){let a=t[i];(o?a instanceof o:typeof a.style?.setProperty=="function")&&(V(a),r+=1)}return r}var D="__hfPositionEditsSeekReapplyWrapped",$=new WeakSet,F=new WeakMap,L=new WeakMap;function M(e){let t=e,o=()=>{try{m(t.document)}catch{}},r=n=>typeof n=="function"&&($.has(n)||!!n[D]),i=n=>{$.add(n);try{Object.defineProperty(n,D,{value:!0})}catch{}},a=n=>{if(typeof n!="function"||r(n))return n;let s=function(...u){let d=n.apply(this,u);return o(),d};return i(s),s},c=(n,s)=>{let u=F.get(n);if(u?.has(s))return!0;let d=Object.getOwnPropertyDescriptor(n,s);if(d?.configurable===!1){let l=n[s];return typeof l=="function"&&(n[s]=a(l),o()),!1}let p=n[s],f=d?.set;return Object.defineProperty(n,s,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>p,set:l=>{p=a(l),f?.call(n,l)}}),p=a(p),u??(u=new Set),u.add(s),F.set(n,u),o(),!0},k=(n,s)=>{let u=L.get(t),d=Object.getOwnPropertyDescriptor(t,n);if(!u?.has(n)){if(d?.configurable===!1){let l=t[n];return l?c(l,s):!1}let f=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>f,set:l=>{f=l,f&&c(f,s)}}),u??(u=new Set),u.add(n),L.set(t,u)}let p=t[n];return p?c(p,s):!1},E=()=>{let n=k("__hf","seek"),s=k("__player","renderSeek");return n&&s};if(E())return;let S=120,h=t.setInterval(()=>{if(E()){t.clearInterval(h);return}S-=1,S<=0&&t.clearInterval(h)},50)}function W(){document.querySelector(`[${w}], [${y}]`)&&(m(document),M(window))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",W,{once:!0}):W();})();\n';
108632
+ POSITION_EDITS_RENDER_IIFE = '"use strict";(()=>{function A(){return globalThis}function P(e,t){if(typeof window>"u")return;let o=A(),r=o.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(i){}(o.__hfDebug||o.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var T=null;function R(e,t){if(T)try{T({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(o){P("runtime.analytics.site1",o)}}var _="data-hf-edit-base-x",m="data-hf-edit-base-y",w="data-hf-edit-original-translate",k=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},H=e=>{let t=[],o=0,r="";for(let i of e.trim())i==="("&&(o+=1),i===")"&&(o=Math.max(0,o-1)),/\\s/.test(i)&&o===0?(r&&t.push(r),r=""):r+=i;return r&&t.push(r),t},$=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,E=(e,t)=>$.test(e)&&$.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,I=(e,t,o)=>{if(!e||e==="none")return`${t} ${o}`;let[r,i,l]=H(e);if(r===void 0)return`${t} ${o}`;if(i===void 0)return`${E(r,t)} ${o}`;let d=l===void 0?"":` ${l}`;return`${E(r,t)} ${E(i,o)}${d}`},O=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},j=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let o=e.ownerDocument.defaultView,r=o?o.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},S=new WeakMap;function V(e,t){let o=S.get(e);if(!t?.force&&o!==void 0&&e.style.getPropertyValue("translate")!==o){R("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=k(e.getAttribute("data-x"))-k(e.getAttribute(_)),i=k(e.getAttribute("data-y"))-k(e.getAttribute(m));e.hasAttribute(w)||e.setAttribute(w,j(e)),o===void 0&&O(e);let l=e.getAttribute(w)??"",d=I(l,`${r}px`,`${i}px`);e.style.setProperty("translate",d),S.set(e,e.style.getPropertyValue("translate"))}function h(e,t){let o=e.defaultView?.HTMLElement,r=u=>o?u instanceof o:typeof u.style?.setProperty=="function",i=e.querySelectorAll(`[${w}]:not([${_}]):not([${m}])`);for(let u=0;u<i.length;u++){let a=i[u];if(a===void 0||!r(a))continue;let b=a.getAttribute(w)??"";b===""?a.style.removeProperty("translate"):a.style.setProperty("translate",b),a.removeAttribute(w),S.delete(a)}let l=e.querySelectorAll(`[${_}], [${m}]`),d=0;for(let u=0;u<l.length;u++){let a=l[u];a===void 0||!r(a)||(V(a,t),d+=1)}return d}var x="__hfPositionEditsSeekReapplyWrapped",D=new WeakSet,F=new WeakMap,L=new WeakMap;function M(e){let t=e,o=()=>{try{h(t.document)}catch{}},r=n=>typeof n=="function"&&(D.has(n)||!!n[x]),i=n=>{D.add(n);try{Object.defineProperty(n,x,{value:!0})}catch{}},l=n=>{if(typeof n!="function"||r(n))return n;let s=function(...c){let f=n.apply(this,c);return o(),f};return i(s),s},d=(n,s)=>{let c=F.get(n);if(c?.has(s))return!0;let f=Object.getOwnPropertyDescriptor(n,s);if(f?.configurable===!1){let p=n[s];return typeof p=="function"&&(n[s]=l(p),o()),!1}let g=n[s],y=f?.set;return Object.defineProperty(n,s,{configurable:!0,enumerable:f?.enumerable??!0,get:()=>g,set:p=>{g=l(p),y?.call(n,p)}}),g=l(g),c??(c=new Set),c.add(s),F.set(n,c),o(),!0},u=(n,s)=>{let c=L.get(t),f=Object.getOwnPropertyDescriptor(t,n);if(!c?.has(n)){if(f?.configurable===!1){let p=t[n];return p?d(p,s):!1}let y=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:f?.enumerable??!0,get:()=>y,set:p=>{y=p,y&&d(y,s)}}),c??(c=new Set),c.add(n),L.set(t,c)}let g=t[n];return g?d(g,s):!1},a=()=>{let n=u("__hf","seek"),s=u("__player","renderSeek");return n&&s};if(a())return;let b=120,v=t.setInterval(()=>{if(a()){t.clearInterval(v);return}b-=1,b<=0&&t.clearInterval(v)},50)}function W(){document.querySelector(`[${_}], [${m}]`)&&(h(document),M(window))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",W,{once:!0}):W();})();\n';
107972
108633
  }
107973
108634
  });
107974
108635
 
@@ -108189,11 +108850,10 @@ async function compileHtmlFile(html, baseDir, downloadDir, log2) {
108189
108850
  );
108190
108851
  const clampList = [];
108191
108852
  for (const r2 of clampResults) {
108192
- if (r2.maxDuration > 0 && shouldClampMediaDuration(r2.duration, r2.maxDuration)) {
108853
+ if (r2.maxDuration > 0 && shouldClampResolvedMediaDuration(r2.tagName, r2.duration, r2.maxDuration)) {
108193
108854
  clampList.push({ id: r2.id, duration: r2.maxDuration });
108194
- const kind = r2.tagName === "audio" ? "Audio" : "Video";
108195
108855
  log2?.warn(
108196
- `[compile] ${kind} "${r2.id}" (${r2.src}) is ${r2.maxDuration.toFixed(2)}s but its data-duration is ${r2.duration.toFixed(2)}s \u2014 the slot is shortened to the media length. Set data-duration to ~${r2.maxDuration.toFixed(2)}s, trim data-media-start, or use a longer/looping source if that isn't intended.`
108856
+ `[compile] Audio "${r2.id}" (${r2.src}) is ${r2.maxDuration.toFixed(2)}s but its data-duration is ${r2.duration.toFixed(2)}s \u2014 the slot is shortened to the media length. Set data-duration to ~${r2.maxDuration.toFixed(2)}s, trim data-media-start, or use a longer/looping source if that isn't intended.`
108197
108857
  );
108198
108858
  }
108199
108859
  }
@@ -109473,6 +110133,19 @@ var init_compileStage = __esm({
109473
110133
  }
109474
110134
  });
109475
110135
 
110136
+ // ../producer/src/services/render/stages/probeFailures.ts
110137
+ function isActionableProbeFailure(line2) {
110138
+ return NETWORK_FAILURE_PATTERN.test(line2) && !FAVICON_PATTERN.test(line2);
110139
+ }
110140
+ var NETWORK_FAILURE_PATTERN, FAVICON_PATTERN;
110141
+ var init_probeFailures = __esm({
110142
+ "../producer/src/services/render/stages/probeFailures.ts"() {
110143
+ "use strict";
110144
+ NETWORK_FAILURE_PATTERN = /404|ERR_NAME_NOT_RESOLVED|ERR_CONNECTION_REFUSED|net::ERR_/i;
110145
+ FAVICON_PATTERN = /(?:^|[/?])favicon(?:\.[a-z0-9]+)?(?:[?#\s]|$)/i;
110146
+ }
110147
+ });
110148
+
109476
110149
  // ../producer/src/services/render/stages/probeStage.ts
109477
110150
  import { join as join41 } from "path";
109478
110151
  function durationToFrameCount(duration, fps) {
@@ -109877,9 +110550,7 @@ async function runProbeStage(input2) {
109877
110550
  throw new Error("Composition duration is 0 \u2014 this would produce a black video." + hint2);
109878
110551
  }
109879
110552
  if (probeSession) {
109880
- const failedRequests = probeSession.browserConsoleBuffer.filter(
109881
- (line2) => /404|ERR_NAME_NOT_RESOLVED|ERR_CONNECTION_REFUSED|net::ERR_/i.test(line2)
109882
- );
110553
+ const failedRequests = probeSession.browserConsoleBuffer.filter(isActionableProbeFailure);
109883
110554
  if (failedRequests.length > 0) {
109884
110555
  log2.warn("Browser encountered network failures during page load:", {
109885
110556
  failures: failedRequests.slice(0, 10)
@@ -109923,6 +110594,7 @@ var init_probeStage = __esm({
109923
110594
  init_htmlCompiler2();
109924
110595
  init_fileServer2();
109925
110596
  init_shared();
110597
+ init_probeFailures();
109926
110598
  FRAME_BOUNDARY_EPSILON = 1e-3;
109927
110599
  }
109928
110600
  });
@@ -110969,10 +111641,34 @@ import { mkdtemp, rm, writeFile } from "fs/promises";
110969
111641
  import { tmpdir as tmpdir6 } from "os";
110970
111642
  import { join as join46 } from "path";
110971
111643
  import { promisify as promisify3 } from "util";
110972
- function resolveParallelStallTimeoutMs() {
110973
- const raw = process.env.HF_DE_PARALLEL_STALL_MS;
111644
+ function resolveDeStallTimeoutMs() {
111645
+ const raw = process.env.HF_DE_STALL_MS ?? process.env.HF_DE_PARALLEL_STALL_MS;
110974
111646
  const parsed = raw ? Number(raw) : Number.NaN;
110975
- return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_DE_PARALLEL_STALL_MS;
111647
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_DE_STALL_MS;
111648
+ }
111649
+ function raceAgainstStall(promise, deadlineMs, message, signal) {
111650
+ return new Promise((resolve68, reject) => {
111651
+ const timer = setTimeout(
111652
+ () => {
111653
+ reject(
111654
+ new Error(
111655
+ signal?.aborted ? "[Render] Sequential drawElement capture aborted while a capture call was in flight." : message
111656
+ )
111657
+ );
111658
+ },
111659
+ Math.max(0, deadlineMs)
111660
+ );
111661
+ promise.then(
111662
+ (value) => {
111663
+ clearTimeout(timer);
111664
+ resolve68(value);
111665
+ },
111666
+ (error) => {
111667
+ clearTimeout(timer);
111668
+ reject(error);
111669
+ }
111670
+ );
111671
+ });
110976
111672
  }
110977
111673
  async function psnrDb(a, b2) {
110978
111674
  const dir = await mkdtemp(join46(tmpdir6(), "hf-de-verify-"));
@@ -111090,11 +111786,19 @@ function createDrainFrameGuard(args) {
111090
111786
  return buf;
111091
111787
  };
111092
111788
  }
111093
- async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEncoder, reorderBuffer, assertNotAborted, onProgress, log2, stats) {
111789
+ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEncoder, reorderBuffer, assertNotAborted, onProgress, log2, stats, abortSignal) {
111094
111790
  let prev = null;
111095
111791
  const frameTime = (i2) => i2 * job.config.fps.den / job.config.fps.num;
111096
111792
  const guard = createDrainFrameGuard({ log: log2, stats, frameTime });
111097
111793
  const guardFrame = (idx, buf) => guard(session, idx, buf);
111794
+ const stallTimeoutMs = resolveDeStallTimeoutMs();
111795
+ let lastProgressAt = Date.now();
111796
+ const captureWithStallGuard = (idx, promise) => raceAgainstStall(
111797
+ promise,
111798
+ stallTimeoutMs - (Date.now() - lastProgressAt),
111799
+ `[Render] Sequential drawElement capture stalled: no frame progress for ${stallTimeoutMs}ms (stuck at frame ${idx}/${totalFrames}).`,
111800
+ abortSignal
111801
+ );
111098
111802
  const drainPrev = async () => {
111099
111803
  if (!prev) return;
111100
111804
  assertNotAborted();
@@ -111103,6 +111807,7 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
111103
111807
  ensureFrameWritten(await currentEncoder.writeFrame(buf), prev.idx, currentEncoder);
111104
111808
  reorderBuffer.advanceTo(prev.idx + 1);
111105
111809
  job.framesRendered = prev.idx + 1;
111810
+ lastProgressAt = Date.now();
111106
111811
  updateJobStatus(
111107
111812
  job,
111108
111813
  "rendering",
@@ -111121,6 +111826,7 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
111121
111826
  ensureFrameWritten(await currentEncoder.writeFrame(buf), item.idx, currentEncoder);
111122
111827
  reorderBuffer.advanceTo(item.idx + 1);
111123
111828
  job.framesRendered = item.idx + 1;
111829
+ lastProgressAt = Date.now();
111124
111830
  updateJobStatus(
111125
111831
  job,
111126
111832
  "rendering",
@@ -111143,11 +111849,17 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
111143
111849
  idxs.push(i2);
111144
111850
  i2++;
111145
111851
  }
111146
- const results = await captureFramesBatchPipelined(session, idxs, idxs.map(frameTime));
111852
+ const results = await captureWithStallGuard(
111853
+ idxs[0] ?? i2,
111854
+ captureFramesBatchPipelined(session, idxs, idxs.map(frameTime))
111855
+ );
111147
111856
  await drainBatch(prevBatch);
111148
111857
  prevBatch = results.map((r2) => ({ idx: r2.frameIndex, encodeResult: r2.encodeResult }));
111149
111858
  } else {
111150
- const { encodeResult } = await captureFrameToBufferPipelined(session, i2, frameTime(i2));
111859
+ const { encodeResult } = await captureWithStallGuard(
111860
+ i2,
111861
+ captureFrameToBufferPipelined(session, i2, frameTime(i2))
111862
+ );
111151
111863
  await drainBatch(prevBatch);
111152
111864
  prevBatch = [{ idx: i2, encodeResult }];
111153
111865
  i2++;
@@ -111159,7 +111871,10 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
111159
111871
  for (let i2 = 0; i2 < totalFrames; i2++) {
111160
111872
  assertNotAborted();
111161
111873
  const time = frameTime(i2);
111162
- const { encodeResult } = await captureFrameToBufferPipelined(session, i2, time);
111874
+ const { encodeResult } = await captureWithStallGuard(
111875
+ i2,
111876
+ captureFrameToBufferPipelined(session, i2, time)
111877
+ );
111163
111878
  await drainPrev();
111164
111879
  prev = { idx: i2, encodeResult };
111165
111880
  }
@@ -111261,7 +111976,7 @@ async function runCaptureStreamingStage(input2) {
111261
111976
  if (abortSignal.aborted) stallController.abort();
111262
111977
  else abortSignal.addEventListener("abort", forwardParentAbort, { once: true });
111263
111978
  }
111264
- const stallTimeoutMs = resolveParallelStallTimeoutMs();
111979
+ const stallTimeoutMs = resolveDeStallTimeoutMs();
111265
111980
  let lastCapturedFrames = 0;
111266
111981
  let lastProgressAt = Date.now();
111267
111982
  let stalled = false;
@@ -111275,7 +111990,7 @@ async function runCaptureStreamingStage(input2) {
111275
111990
  reorderBuffer.abort(stallErr);
111276
111991
  stallController.abort();
111277
111992
  },
111278
- Math.min(stallTimeoutMs, DE_PARALLEL_STALL_POLL_MS)
111993
+ Math.min(stallTimeoutMs, DE_STALL_POLL_MS)
111279
111994
  );
111280
111995
  let workerResults;
111281
111996
  try {
@@ -111374,17 +112089,26 @@ async function runCaptureStreamingStage(input2) {
111374
112089
  assertNotAborted,
111375
112090
  onProgress,
111376
112091
  log2,
111377
- deDrainStats
112092
+ deDrainStats,
112093
+ abortSignal
111378
112094
  );
111379
112095
  } else {
112096
+ const stallTimeoutMs = resolveDeStallTimeoutMs();
112097
+ let lastProgressAt = Date.now();
111380
112098
  for (let i2 = 0; i2 < totalFrames; i2++) {
111381
112099
  assertNotAborted();
111382
112100
  const time = i2 * job.config.fps.den / job.config.fps.num;
111383
- const { buffer } = await captureFrameToBuffer(session, i2, time);
112101
+ const { buffer } = await raceAgainstStall(
112102
+ captureFrameToBuffer(session, i2, time),
112103
+ stallTimeoutMs - (Date.now() - lastProgressAt),
112104
+ `[Render] Sequential drawElement capture stalled: no frame progress for ${stallTimeoutMs}ms (stuck at frame ${i2}/${totalFrames}).`,
112105
+ abortSignal
112106
+ );
111384
112107
  await reorderBuffer.waitForFrame(i2);
111385
112108
  ensureFrameWritten(await currentEncoder.writeFrame(buffer), i2, currentEncoder);
111386
112109
  reorderBuffer.advanceTo(i2 + 1);
111387
112110
  job.framesRendered = i2 + 1;
112111
+ lastProgressAt = Date.now();
111388
112112
  const frameProgress = (i2 + 1) / totalFrames;
111389
112113
  const progress = 25 + frameProgress * 55;
111390
112114
  updateJobStatus(
@@ -111432,7 +112156,7 @@ async function runCaptureStreamingStage(input2) {
111432
112156
  }
111433
112157
  }
111434
112158
  }
111435
- var DEFAULT_DE_PARALLEL_STALL_MS, DE_PARALLEL_STALL_POLL_MS, execFileP;
112159
+ var DEFAULT_DE_STALL_MS, DE_STALL_POLL_MS, execFileP;
111436
112160
  var init_captureStreamingStage = __esm({
111437
112161
  "../producer/src/services/render/stages/captureStreamingStage.ts"() {
111438
112162
  "use strict";
@@ -111441,8 +112165,8 @@ var init_captureStreamingStage = __esm({
111441
112165
  init_perfSummary();
111442
112166
  init_captureHdrFrameShared();
111443
112167
  init_shared();
111444
- DEFAULT_DE_PARALLEL_STALL_MS = 6e4;
111445
- DE_PARALLEL_STALL_POLL_MS = 5e3;
112168
+ DEFAULT_DE_STALL_MS = 6e4;
112169
+ DE_STALL_POLL_MS = 5e3;
111446
112170
  execFileP = promisify3(execFile3);
111447
112171
  }
111448
112172
  });
@@ -113320,7 +114044,7 @@ import {
113320
114044
  import { tmpdir as tmpdir7 } from "os";
113321
114045
  import { join as join55, dirname as dirname23, resolve as resolve28 } from "path";
113322
114046
  import { totalmem as totalmem2 } from "os";
113323
- import { randomUUID as randomUUID5 } from "crypto";
114047
+ import { randomUUID as randomUUID6 } from "crypto";
113324
114048
  import { fileURLToPath as fileURLToPath5 } from "url";
113325
114049
  function sampleDirectoryBytes(dir) {
113326
114050
  let total = 0;
@@ -113349,11 +114073,17 @@ function sampleDirectoryBytes(dir) {
113349
114073
  }
113350
114074
  return total;
113351
114075
  }
113352
- function summarizeExtractionObservability(extractionResult, videoCount) {
114076
+ function summarizeExtractionObservability(extractionResult, videoCount, coverageReports, authoredTimedClipCount) {
113353
114077
  const extracted = extractionResult?.extracted ?? [];
113354
114078
  const totalFramesExtracted = extractionResult?.totalFramesExtracted ?? 0;
113355
114079
  const maxFramesPerVideo = extracted.reduce((max, item) => Math.max(max, item.totalFrames), 0);
113356
114080
  const phaseBreakdown = extractionResult?.phaseBreakdown;
114081
+ const coverageGauges = coverageReports && coverageReports.length > 0 ? {
114082
+ minVideoFrameCoverageRatio: coverageReports.reduce(
114083
+ (min, r2) => Math.min(min, r2.ratio),
114084
+ Number.POSITIVE_INFINITY
114085
+ )
114086
+ } : {};
113357
114087
  return {
113358
114088
  videoCount,
113359
114089
  extractedVideoCount: extracted.length,
@@ -113364,7 +114094,9 @@ function summarizeExtractionObservability(extractionResult, videoCount) {
113364
114094
  vfrPreflightMs: phaseBreakdown?.vfrPreflightMs,
113365
114095
  vfrPreflightCount: phaseBreakdown?.vfrPreflightCount,
113366
114096
  cacheHits: phaseBreakdown?.cacheHits,
113367
- cacheMisses: phaseBreakdown?.cacheMisses
114097
+ cacheMisses: phaseBreakdown?.cacheMisses,
114098
+ ...coverageGauges,
114099
+ authoredTimedClipCount
113368
114100
  };
113369
114101
  }
113370
114102
  function applyRenderWarningPolicy(job, captureWarnings, log2 = defaultLogger) {
@@ -113661,7 +114393,7 @@ async function executeDiskCaptureWithAdaptiveRetry(options) {
113661
114393
  }
113662
114394
  function createRenderJob(config) {
113663
114395
  return {
113664
- id: randomUUID5(),
114396
+ id: randomUUID6(),
113665
114397
  config: {
113666
114398
  ...config,
113667
114399
  fps: toFps(config.fps),
@@ -113999,7 +114731,7 @@ async function executeRenderJob(job, projectDir, outputPath, progressSink, abort
113999
114731
  const probeResult = await observeRenderStage(
114000
114732
  observability,
114001
114733
  "browser_probe",
114002
- { forceScreenshot: captureForceScreenshot },
114734
+ { forceScreenshot: captureForceScreenshot, stagePhase: "calibrating" },
114003
114735
  () => runProbeStage({
114004
114736
  projectDir,
114005
114737
  workDir,
@@ -114014,7 +114746,11 @@ async function executeRenderJob(job, projectDir, outputPath, progressSink, abort
114014
114746
  height,
114015
114747
  needsAlpha,
114016
114748
  deviceScaleFactor
114017
- })
114749
+ }),
114750
+ // Browser probe is pre-capture; report `browser calibrating` so a
114751
+ // slow probe (~64s SwiftShader warm-up on Windows was the reported
114752
+ // shape) doesn't read as a zero-frame stall. Field signal ts=1784019503.
114753
+ { heartbeatMessage: "browser calibrating (frames not started)" }
114018
114754
  );
114019
114755
  compiled = probeResult.compiled;
114020
114756
  compositionHash = computeCompositionObservabilityHash(compiled.html);
@@ -114074,9 +114810,18 @@ async function executeRenderJob(job, projectDir, outputPath, progressSink, abort
114074
114810
  imageColorSpaces
114075
114811
  } = extractResult;
114076
114812
  perfStages.videoExtractMs = extractResult.videoExtractMs;
114813
+ const coverageReports = extractionResult ? computeVideoFrameCoverage(
114814
+ composition.videos,
114815
+ extractionResult.extracted,
114816
+ fpsToNumber(job.config.fps)
114817
+ ) : [];
114818
+ const coverageThreshold = resolveVideoCoverageThreshold();
114819
+ const authoredTimedClipCount = countAuthoredTimedClips(compiled.html);
114077
114820
  extractionObservability = summarizeExtractionObservability(
114078
114821
  extractionResult,
114079
- composition.videos.length
114822
+ composition.videos.length,
114823
+ coverageReports,
114824
+ authoredTimedClipCount
114080
114825
  );
114081
114826
  observability.checkpoint("video_extract", "frames resolved", {
114082
114827
  videoCount: extractionObservability.videoCount,
@@ -114087,8 +114832,11 @@ async function executeRenderJob(job, projectDir, outputPath, progressSink, abort
114087
114832
  vfrPreflightCount: extractionObservability.vfrPreflightCount ?? null,
114088
114833
  vfrPreflightMs: extractionObservability.vfrPreflightMs ?? null,
114089
114834
  cacheHits: extractionObservability.cacheHits ?? null,
114090
- cacheMisses: extractionObservability.cacheMisses ?? null
114835
+ cacheMisses: extractionObservability.cacheMisses ?? null,
114836
+ minVideoFrameCoverageRatio: extractionObservability.minVideoFrameCoverageRatio ?? null,
114837
+ authoredTimedClipCount: extractionObservability.authoredTimedClipCount ?? null
114091
114838
  });
114839
+ assertVideoFrameCoverage(coverageReports, coverageThreshold);
114092
114840
  const effectiveHdr = resolveEffectiveHdrMode({
114093
114841
  hdrMode: job.config.hdrMode,
114094
114842
  outputFormat,
@@ -114251,6 +114999,7 @@ async function executeRenderJob(job, projectDir, outputPath, progressSink, abort
114251
114999
  });
114252
115000
  let workerCount;
114253
115001
  const captureStageObservationData = (extra = {}) => ({
115002
+ stagePhase: "capturing",
114254
115003
  ...extra,
114255
115004
  get workerCount() {
114256
115005
  return workerCount;
@@ -114279,7 +115028,14 @@ async function executeRenderJob(job, projectDir, outputPath, progressSink, abort
114279
115028
  const outcome = await observeRenderStage(
114280
115029
  observability,
114281
115030
  "capture_calibration",
114282
- captureStageObservationData({ forceScreenshot: captureForceScreenshot }),
115031
+ captureStageObservationData({
115032
+ forceScreenshot: captureForceScreenshot,
115033
+ // Override the default `capturing` — calibration writes probe
115034
+ // frames only, not `job.framesRendered`, so heartbeats reporting
115035
+ // `framesCompleted: 0` misread as broken. Field signal
115036
+ // ts=1784019503.
115037
+ stagePhase: "calibrating"
115038
+ }),
114283
115039
  () => runCaptureCalibration({
114284
115040
  cfg,
114285
115041
  fileServer: activeFileServer,
@@ -114292,7 +115048,8 @@ async function executeRenderJob(job, projectDir, outputPath, progressSink, abort
114292
115048
  buildCaptureOptions,
114293
115049
  createRenderVideoFrameInjector,
114294
115050
  assertNotAborted
114295
- })
115051
+ }),
115052
+ { heartbeatMessage: "browser calibrating (frames not started)" }
114296
115053
  );
114297
115054
  captureCalibration = outcome.calibration;
114298
115055
  captureForceScreenshot = outcome.forceScreenshot;
@@ -114776,6 +115533,7 @@ async function executeRenderJob(job, projectDir, outputPath, progressSink, abort
114776
115533
  perfStages.encodeMs = encodeRes.encodeMs;
114777
115534
  }
114778
115535
  }
115536
+ emitFallbackCaptureProfile(observability, dedupPerfs);
114779
115537
  applyRenderWarningPolicy(
114780
115538
  job,
114781
115539
  [...layeredCaptureWarnings, ...dedupPerfs.flatMap((perf) => perf.warnings ?? [])],
@@ -114915,7 +115673,12 @@ async function executeRenderJob(job, projectDir, outputPath, progressSink, abort
114915
115673
  updateCaptureObservability({ memoryExhaustionDetected: true });
114916
115674
  }
114917
115675
  recordTransientRetryObservability();
114918
- const errorMessage = memoryGuidance ?? normalizeErrorMessage2(error);
115676
+ const protocolTimeoutError = augmentProtocolTimeoutError(error, cfg.protocolTimeout);
115677
+ const navigationTimeoutError = augmentPageNavigationTimeoutError(
115678
+ protocolTimeoutError,
115679
+ cfg.pageNavigationTimeout
115680
+ );
115681
+ const errorMessage = memoryGuidance ?? normalizeErrorMessage2(navigationTimeoutError);
114919
115682
  const carriedBrowserConsole = getCaptureStageBrowserConsole(error);
114920
115683
  if (carriedBrowserConsole.length > 0) {
114921
115684
  lastBrowserConsole = [...lastBrowserConsole, ...carriedBrowserConsole].slice(-200);
@@ -115008,6 +115771,8 @@ var init_renderOrchestrator = __esm({
115008
115771
  init_captureBeyondViewport();
115009
115772
  init_captureCost();
115010
115773
  init_observability();
115774
+ init_fallbackCaptureProfile();
115775
+ init_videoFrameCoverage();
115011
115776
  init_compileStage();
115012
115777
  init_probeStage();
115013
115778
  init_extractVideosStage();
@@ -119008,7 +119773,8 @@ function createStudioServer(options) {
119008
119773
  app.get("/api/events", (c3) => {
119009
119774
  return streamSSE4(c3, async (stream) => {
119010
119775
  const listener = (path2) => {
119011
- stream.writeSSE({ event: "file-change", data: JSON.stringify({ path: path2 }) }).catch(() => {
119776
+ const receipt = consumeFileWriteReceipt(resolve33(projectDir, path2));
119777
+ stream.writeSSE({ event: "file-change", data: JSON.stringify(receipt ?? { path: path2 }) }).catch(() => {
119012
119778
  });
119013
119779
  };
119014
119780
  watcher.addListener(listener);
@@ -120037,7 +120803,8 @@ __export(init_exports, {
120037
120803
  applyResolutionPreset: () => applyResolutionPreset,
120038
120804
  default: () => init_default,
120039
120805
  examples: () => examples3,
120040
- injectTailwindBrowserScript: () => injectTailwindBrowserScript
120806
+ injectTailwindBrowserScript: () => injectTailwindBrowserScript,
120807
+ resolveVideoDurationSeconds: () => resolveVideoDurationSeconds
120041
120808
  });
120042
120809
  import {
120043
120810
  existsSync as existsSync61,
@@ -120051,6 +120818,15 @@ import {
120051
120818
  import { resolve as resolve35, basename as basename11, join as join70, dirname as dirname29 } from "path";
120052
120819
  import { fileURLToPath as fileURLToPath9 } from "url";
120053
120820
  import { execFileSync as execFileSync8, spawn as spawn15 } from "child_process";
120821
+ function resolveVideoDurationSeconds({
120822
+ streamDuration,
120823
+ frameDuration,
120824
+ formatDuration: formatDuration2
120825
+ }) {
120826
+ return [streamDuration, frameDuration, formatDuration2].find(
120827
+ (duration) => Number.isFinite(duration) && duration > 0
120828
+ ) ?? DEFAULT_META.durationSeconds;
120829
+ }
120054
120830
  function probeVideo(filePath) {
120055
120831
  try {
120056
120832
  const ffprobePath = findFFprobe();
@@ -120075,10 +120851,17 @@ function probeVideo(filePath) {
120075
120851
  fps = Math.round(num2 / den * 100) / 100;
120076
120852
  }
120077
120853
  }
120078
- const durationStr = parsed.format?.duration;
120079
- const durationSeconds = durationStr !== void 0 ? parseFloat(durationStr) : 5;
120854
+ const streamDuration = parseFloat(videoStream.duration ?? "");
120855
+ const frameCount = parseInt(videoStream.nb_frames ?? "", 10);
120856
+ const frameDuration = Number.isFinite(frameCount) && fps > 0 ? frameCount / fps : NaN;
120857
+ const formatDuration2 = parseFloat(parsed.format?.duration ?? "");
120858
+ const durationSeconds = resolveVideoDurationSeconds({
120859
+ streamDuration,
120860
+ frameDuration,
120861
+ formatDuration: formatDuration2
120862
+ });
120080
120863
  return {
120081
- durationSeconds: Number.isNaN(durationSeconds) ? 5 : durationSeconds,
120864
+ durationSeconds,
120082
120865
  width: videoStream.width ?? 1920,
120083
120866
  height: videoStream.height ?? 1080,
120084
120867
  fps,
@@ -121447,12 +122230,14 @@ __export(studio_api_exports, {
121447
122230
  STUDIO_MANUAL_EDITS_PATH: () => STUDIO_MANUAL_EDITS_PATH,
121448
122231
  STUDIO_MOTION_PATH: () => STUDIO_MOTION_PATH,
121449
122232
  buildSubCompositionHtml: () => buildSubCompositionHtml,
122233
+ consumeFileWriteReceipt: () => consumeFileWriteReceipt,
121450
122234
  createBackgroundRemovalJob: () => createBackgroundRemovalJob,
121451
122235
  createProjectSignature: () => createProjectSignature,
121452
122236
  createStudioApi: () => createStudioApi,
121453
122237
  createStudioManualEditsRenderBodyScript: () => createStudioManualEditsRenderBodyScript,
121454
122238
  createStudioMotionRenderBodyScript: () => createStudioMotionRenderBodyScript,
121455
122239
  createStudioPositionSeekReapplyScript: () => createStudioPositionSeekReapplyScript,
122240
+ fileContentVersion: () => fileContentVersion,
121456
122241
  getElementScreenshotClip: () => getElementScreenshotClip,
121457
122242
  getMimeType: () => getMimeType,
121458
122243
  isSafePath: () => isSafePath,
@@ -122955,7 +123740,7 @@ var init_auth = __esm({
122955
123740
  });
122956
123741
 
122957
123742
  // src/utils/projectLink.ts
122958
- import { randomUUID as randomUUID6 } from "crypto";
123743
+ import { randomUUID as randomUUID7 } from "crypto";
122959
123744
  import { existsSync as existsSync67, mkdirSync as mkdirSync36, readFileSync as readFileSync43, writeFileSync as writeFileSync26 } from "fs";
122960
123745
  import { homedir as homedir16 } from "os";
122961
123746
  import { join as join73, resolve as resolve41 } from "path";
@@ -123006,7 +123791,7 @@ function ensureProjectId(absDir) {
123006
123791
  const path2 = resolve41(absDir);
123007
123792
  const existing = links[path2];
123008
123793
  if (existing) return existing.projectId;
123009
- const projectId = randomUUID6();
123794
+ const projectId = randomUUID7();
123010
123795
  links[path2] = { projectId, url: "" };
123011
123796
  writeProjectLinks(links);
123012
123797
  return projectId;
@@ -127946,7 +128731,7 @@ function raceMediaReady(el, deadlineMs) {
127946
128731
  async function auditClipDurations(page, analyzeClipMediaFit2, extraWaitMs) {
127947
128732
  const clips = await page.evaluate(async (maxWaitMs) => {
127948
128733
  const nodes = Array.from(
127949
- document.querySelectorAll("video[data-duration], audio[data-duration]")
128734
+ document.querySelectorAll("audio[data-duration]")
127950
128735
  );
127951
128736
  const deadline = Date.now() + maxWaitMs;
127952
128737
  await Promise.all(
@@ -144318,7 +145103,7 @@ var require_gaxios = __commonJS({
144318
145103
  var retry_js_1 = require_retry3();
144319
145104
  var stream_1 = __require("stream");
144320
145105
  var interceptor_js_1 = require_interceptor();
144321
- var randomUUID7 = async () => globalThis.crypto?.randomUUID() || (await import("crypto")).randomUUID();
145106
+ var randomUUID8 = async () => globalThis.crypto?.randomUUID() || (await import("crypto")).randomUUID();
144322
145107
  var HTTP_STATUS_NO_CONTENT = 204;
144323
145108
  var Gaxios = class {
144324
145109
  agentCache = /* @__PURE__ */ new Map();
@@ -144591,7 +145376,7 @@ var require_gaxios = __commonJS({
144591
145376
  */
144592
145377
  ["Blob", "File", "FormData"].includes(opts.data?.constructor?.name || "");
144593
145378
  if (opts.multipart?.length) {
144594
- const boundary = await randomUUID7();
145379
+ const boundary = await randomUUID8();
144595
145380
  preparedHeaders.set("content-type", `multipart/related; boundary=${boundary}`);
144596
145381
  opts.body = stream_1.Readable.from(this.getMultipartRequest(opts.multipart, boundary));
144597
145382
  } else if (shouldDirectlyPassData) {
@@ -176176,6 +176961,7 @@ __export(snapshot_exports, {
176176
176961
  computeSnapshotTimes: () => computeSnapshotTimes,
176177
176962
  default: () => snapshot_default,
176178
176963
  examples: () => examples28,
176964
+ formatSnapshotTimestamp: () => formatSnapshotTimestamp,
176179
176965
  parseZoomScale: () => parseZoomScale,
176180
176966
  requireSnapshotFfmpeg: () => requireSnapshotFfmpeg,
176181
176967
  resolveSnapshotVideoFrameTime: () => resolveSnapshotVideoFrameTime,
@@ -176205,6 +176991,9 @@ function orbitStageSource() {
176205
176991
  lens.style.perspectiveOrigin = "50% 50%";
176206
176992
  }`;
176207
176993
  }
176994
+ function formatSnapshotTimestamp(time) {
176995
+ return `${Number(time.toFixed(3))}s`;
176996
+ }
176208
176997
  function resolveSnapshotVideoFrameTime(input2) {
176209
176998
  const { globalTime, clipStart, clipDuration, relativeTime, sourceDuration } = input2;
176210
176999
  const clipEnd = clipStart + clipDuration;
@@ -176463,7 +177252,7 @@ async function captureSnapshots(projectDir, opts) {
176463
177252
  );
176464
177253
  }
176465
177254
  }
176466
- const timeLabel = `${time.toFixed(1)}s`;
177255
+ const timeLabel = formatSnapshotTimestamp(time);
176467
177256
  const filename = `frame-${String(i2).padStart(2, "0")}-at-${timeLabel}.png`;
176468
177257
  const framePath = join97(snapshotDir, filename);
176469
177258
  if (opts.zoom) {
@@ -176583,7 +177372,7 @@ var init_snapshot = __esm({
176583
177372
  const camera = args.angle ? parseAngle(String(args.angle)) : void 0;
176584
177373
  const zoomTarget = args.zoom ? parseZoomTarget(String(args.zoom)) : void 0;
176585
177374
  const zoomScale = parseZoomScale(args["zoom-scale"]);
176586
- const label2 = atTimestamps ? `${atTimestamps.length} frames at [${atTimestamps.map((t2) => t2.toFixed(1) + "s").join(", ")}]` : `${frames} frames`;
177375
+ const label2 = atTimestamps ? `${atTimestamps.length} frames at [${atTimestamps.map(formatSnapshotTimestamp).join(", ")}]` : `${frames} frames`;
176587
177376
  const angleLabel = camera && (camera.yaw !== 0 || camera.pitch !== 0) ? ` ${c.dim(`(angle yaw ${camera.yaw}\xB0 pitch ${camera.pitch}\xB0)`)}` : "";
176588
177377
  console.log(`${c.accent("\u25C6")} Capturing ${label2} from ${c.accent(project.name)}${angleLabel}`);
176589
177378
  try {