hyperframes 0.6.114 → 0.6.116
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 +794 -540
- package/dist/docs/rendering.md +1 -0
- package/dist/hyperframe-runtime.js +22 -22
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +22 -22
- package/dist/studio/assets/hyperframes-player-CNgCuEoe.js +425 -0
- package/dist/studio/assets/{index-BR5v5xu2.js → index-9da2YwzA.js} +1 -1
- package/dist/studio/assets/index-BvEhf7SS.css +1 -0
- package/dist/studio/assets/{index-DApfviyW.js → index-iuaaor_Q.js} +90 -90
- package/dist/studio/index.html +2 -2
- package/package.json +1 -1
- package/dist/studio/assets/hyperframes-player-C1qkW56w.js +0 -418
- package/dist/studio/assets/index-DS7Kfzvb.css +0 -1
package/dist/cli.js
CHANGED
|
@@ -50,7 +50,7 @@ var VERSION;
|
|
|
50
50
|
var init_version = __esm({
|
|
51
51
|
"src/version.ts"() {
|
|
52
52
|
"use strict";
|
|
53
|
-
VERSION = true ? "0.6.
|
|
53
|
+
VERSION = true ? "0.6.116" : "0.0.0-dev";
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
|
|
@@ -21248,6 +21248,20 @@ var init_gsapParserAcorn = __esm({
|
|
|
21248
21248
|
}
|
|
21249
21249
|
});
|
|
21250
21250
|
|
|
21251
|
+
// ../core/src/utils/cssSelector.ts
|
|
21252
|
+
function queryByAttr(root, attr2, value, tag) {
|
|
21253
|
+
const selector = tag ? `${tag}[${attr2}]` : `[${attr2}]`;
|
|
21254
|
+
for (const el of root.querySelectorAll(selector)) {
|
|
21255
|
+
if (el.getAttribute(attr2) === value) return el;
|
|
21256
|
+
}
|
|
21257
|
+
return null;
|
|
21258
|
+
}
|
|
21259
|
+
var init_cssSelector = __esm({
|
|
21260
|
+
"../core/src/utils/cssSelector.ts"() {
|
|
21261
|
+
"use strict";
|
|
21262
|
+
}
|
|
21263
|
+
});
|
|
21264
|
+
|
|
21251
21265
|
// ../../node_modules/.bun/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
21252
21266
|
function encodeInteger(builder, num, relative15) {
|
|
21253
21267
|
let delta = num - relative15;
|
|
@@ -23950,7 +23964,7 @@ function normalizeKeyframes(keyframes, baseX, baseY, baseScale) {
|
|
|
23950
23964
|
function updateElementInHtml(html, elementId, updates) {
|
|
23951
23965
|
const parser = new DOMParser();
|
|
23952
23966
|
const doc = parser.parseFromString(html, "text/html");
|
|
23953
|
-
const el = doc.getElementById(elementId) || doc
|
|
23967
|
+
const el = doc.getElementById(elementId) || queryByAttr(doc, "data-name", elementId);
|
|
23954
23968
|
if (!el) return html;
|
|
23955
23969
|
if (updates.startTime !== void 0) {
|
|
23956
23970
|
el.setAttribute("data-start", String(updates.startTime));
|
|
@@ -24217,6 +24231,7 @@ var init_htmlParser = __esm({
|
|
|
24217
24231
|
init_gsapSerialize();
|
|
24218
24232
|
init_hfIds();
|
|
24219
24233
|
init_gsapParserAcorn();
|
|
24234
|
+
init_cssSelector();
|
|
24220
24235
|
init_gsapWriterAcorn();
|
|
24221
24236
|
MEDIA_TYPES = /* @__PURE__ */ new Set(["video", "image", "audio"]);
|
|
24222
24237
|
UHD_SQUARE_MIN = 2160;
|
|
@@ -28546,7 +28561,7 @@ var RUNTIME_IIFE;
|
|
|
28546
28561
|
var init_runtime_inline = __esm({
|
|
28547
28562
|
"../core/src/generated/runtime-inline.ts"() {
|
|
28548
28563
|
"use strict";
|
|
28549
|
-
RUNTIME_IIFE = '"use strict";(()=>{var fa=Object.create;var Pn=Object.defineProperty;var ma=Object.getOwnPropertyDescriptor;var pa=Object.getOwnPropertyNames;var ha=Object.getPrototypeOf,xa=Object.prototype.hasOwnProperty;var ga=(t,e,n)=>e in t?Pn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ne=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ya=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of pa(e))!xa.call(t,r)&&r!==n&&Pn(t,r,{get:()=>e[r],enumerable:!(i=ma(e,r))||i.enumerable});return t};var ba=(t,e,n)=>(n=t!=null?fa(ha(t)):{},ya(e||!t||!t.__esModule?Pn(n,"default",{value:t,enumerable:!0}):n,t));var xe=(t,e,n)=>ga(t,typeof e!="symbol"?e+"":e,n);var _r=ne((Gf,jn)=>{var K=String,Tr=function(){return{isColorSupported:!1,reset:K,bold:K,dim:K,italic:K,underline:K,inverse:K,hidden:K,strikethrough:K,black:K,red:K,green:K,yellow:K,blue:K,magenta:K,cyan:K,white:K,gray:K,bgBlack:K,bgRed:K,bgGreen:K,bgYellow:K,bgBlue:K,bgMagenta:K,bgCyan:K,bgWhite:K,blackBright:K,redBright:K,greenBright:K,yellowBright:K,blueBright:K,magentaBright:K,cyanBright:K,whiteBright:K,bgBlackBright:K,bgRedBright:K,bgGreenBright:K,bgYellowBright:K,bgBlueBright:K,bgMagentaBright:K,bgCyanBright:K,bgWhiteBright:K}};jn.exports=Tr();jn.exports.createColors=Tr});var qn=ne(()=>{});var on=ne((Vf,kr)=>{"use strict";var Lr=_r(),vr=qn(),_t=class t extends Error{constructor(e,n,i,r,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),r&&(this.source=r),s&&(this.plugin=s),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,t)}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(e){if(!this.source)return"";let n=this.source;e==null&&(e=Lr.isColorSupported);let i=u=>u,r=u=>u,o=u=>u;if(e){let{bold:u,gray:m,red:f}=Lr.createColors(!0);r=x=>u(f(x)),i=x=>m(x),vr&&(o=x=>vr(x))}let s=n.split(/\\r?\\n/),l=Math.max(this.line-3,0),a=Math.min(this.line+2,s.length),c=String(a).length;return s.slice(l,a).map((u,m)=>{let f=l+1+m,x=" "+(" "+f).slice(-c)+" | ";if(f===this.line){if(u.length>160){let g=20,b=Math.max(0,this.column-g),F=Math.max(this.column+g,this.endColumn+g),T=u.slice(b,F),_=i(x.replace(/\\d/g," "))+u.slice(0,Math.min(this.column-1,g-1)).replace(/[^\\t]/g," ");return r(">")+i(x)+o(T)+`\n `+_+r("^")}let w=i(x.replace(/\\d/g," "))+u.slice(0,this.column-1).replace(/[^\\t]/g," ");return r(">")+i(x)+o(u)+`\n `+w+r("^")}return" "+i(x)+o(u)}).join(`\n`)}toString(){let e=this.showSourceCode();return e&&(e=`\n\n`+e+`\n`),this.name+": "+this.message+e}};kr.exports=_t;_t.default=_t});var $n=ne((zf,Dr)=>{"use strict";var Ka=/(<)(\\/?style\\b)/gi,Ja=/(<)(!--)/g;function qe(t){return typeof t!="string"||!t.includes("<")?t:t.replace(Ka,"\\\\3c $2").replace(Ja,"\\\\3c $2")}var Rr={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Ya(t){return t[0].toUpperCase()+t.slice(1)}var Lt=class{constructor(e){this.builder=e}atrule(e,n){let i=e.raws,r="@"+e.name,o=e.params?this.rawValue(e,"params"):"";if(typeof i.afterName<"u"?r+=i.afterName:o&&(r+=" "),e.nodes)this.block(e,r+o);else{let s=(i.between||"")+(n?";":"");this.builder(qe(r+o+s),e)}}beforeAfter(e,n){let i;e.type==="decl"?i=this.raw(e,null,"beforeDecl"):e.type==="comment"?i=this.raw(e,null,"beforeComment"):n==="before"?i=this.raw(e,null,"beforeRule"):i=this.raw(e,null,"beforeClose");let r=e.parent,o=0;for(;r&&r.type!=="root";)o+=1,r=r.parent;if(i.includes(`\n`)){let s=this.raw(e,null,"indent");if(s.length)for(let l=0;l<o;l++)i+=s}return i}block(e,n){let i=this.raw(e,"between","beforeOpen");this.builder(qe(n+i)+"{",e,"start");let r;e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(qe(r)),this.builder("}",e,"end")}body(e){let n=e.nodes,i=n.length-1;for(;i>0&&n[i].type==="comment";)i-=1;let r=this.raw(e,"semicolon"),o=e.type==="document";for(let s=0;s<n.length;s++){let l=n[s],a=this.raw(l,"before");a&&this.builder(o?a:qe(a)),this.stringify(l,i!==s||r)}}comment(e){let n=this.raw(e,"left","commentLeft"),i=this.raw(e,"right","commentRight");this.builder(qe("/*"+n+e.text+i+"*/"),e)}decl(e,n){let i=e.raws,r=this.raw(e,"between","colon"),o=e.prop+r+this.rawValue(e,"value");e.important&&(o+=i.important||" !important"),n&&(o+=";"),this.builder(qe(o),e)}document(e){this.body(e)}raw(e,n,i){let r;if(i||(i=n),n&&(r=e.raws[n],typeof r<"u"))return r;let o=e.parent;if(i==="before"&&(!o||o.type==="root"&&o.first===e||o&&o.type==="document"))return"";if(!o)return Rr[i];let s=e.root(),l=s.rawCache||(s.rawCache={});if(typeof l[i]<"u")return l[i];if(i==="before"||i==="after")return this.beforeAfter(e,i);{let a="raw"+Ya(i);this[a]?r=this[a](s,e):s.walk(c=>{if(r=c.raws[n],typeof r<"u")return!1})}return typeof r>"u"&&(r=Rr[i]),l[i]=r,r}rawBeforeClose(e){let n;return e.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(e,n){let i;return e.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(e,n){let i;return e.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(e){let n;return e.walk(i=>{if(i.type!=="decl"&&(n=i.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(e){let n;return e.walk(i=>{if(i.nodes&&(i.parent!==e||e.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(e){let n;return e.walkDecls(i=>{if(typeof i.raws.between<"u")return n=i.raws.between.replace(/[^\\s:]/g,""),!1}),n}rawEmptyBody(e){let n;return e.walk(i=>{if(i.nodes&&i.nodes.length===0&&(n=i.raws.after,typeof n<"u"))return!1}),n}rawIndent(e){if(e.raws.indent)return e.raws.indent;let n;return e.walk(i=>{let r=i.parent;if(r&&r!==e&&r.parent&&r.parent===e&&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(e){let n;return e.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(n=i.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(e,n){let i=e[n],r=e.raws[n];return r&&r.value===i?r.raw:i}root(e){if(this.body(e),e.raws.after){let n=e.raws.after,i=e.parent&&e.parent.type==="document";this.builder(i?n:qe(n))}}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(qe(e.raws.ownSemicolon),e,"end")}stringify(e,n){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,n)}};Dr.exports=Lt;Lt.default=Lt});var vt=ne((jf,Ir)=>{"use strict";var Xa=$n();function Kn(t,e){new Xa(e).stringify(t)}Ir.exports=Kn;Kn.default=Kn});var sn=ne((qf,Jn)=>{"use strict";Jn.exports.isClean=Symbol("isClean");Jn.exports.my=Symbol("my")});var Dt=ne(($f,Pr)=>{"use strict";var Qa=on(),Za=$n(),el=vt(),{isClean:kt,my:tl}=sn();function Yn(t,e){let n=new t.constructor;for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||i==="proxyCache")continue;let r=t[i],o=typeof r;i==="parent"&&o==="object"?e&&(n[i]=e):i==="source"?n[i]=r:Array.isArray(r)?n[i]=r.map(s=>Yn(s,n)):(o==="object"&&r!==null&&(r=Yn(r)),n[i]=r)}return n}function Ge(t,e){if(e&&typeof e.offset<"u")return e.offset;let n=1,i=1,r=0;for(let o=0;o<t.length;o++){if(i===e.line&&n===e.column){r=o;break}t[o]===`\n`?(n=1,i+=1):n+=1}return r}var Rt=class{get proxyOf(){return this}constructor(e={}){this.raws={},this[kt]=!1,this[tl]=!0;for(let n in e)if(n==="nodes"){this.nodes=[];for(let i of e[n])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}else this[n]=e[n]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\\n\\s{4}at /.test(e.stack)){let n=this.source;e.stack=e.stack.replace(/\\n\\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let n in e)this[n]=e[n];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let n=Yn(this);for(let i in e)n[i]=e[i];return n}cloneAfter(e={}){let n=this.clone(e);return this.parent.insertAfter(this,n),n}cloneBefore(e={}){let n=this.clone(e);return this.parent.insertBefore(this,n),n}error(e,n={}){if(this.source){let{end:i,start:r}=this.rangeBy(n);return this.source.input.error(e,{column:r.column,line:r.line},{column:i.column,line:i.line},n)}return new Qa(e)}getProxyProcessor(){return{get(e,n){return n==="proxyOf"?e:n==="root"?()=>e.root().toProxy():e[n]},set(e,n,i){return e[n]===i||(e[n]=i,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&e.markDirty()),!0}}}markClean(){this[kt]=!0}markDirty(){if(this[kt]){this[kt]=!1;let e=this;for(;e=e.parent;)e[kt]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let n=this.source.start;if(e.index)n=this.positionInside(e.index);else if(e.word){let i="document"in this.source.input?this.source.input.document:this.source.input.css,o=i.slice(Ge(i,this.source.start),Ge(i,this.source.end)).indexOf(e.word);o!==-1&&(n=this.positionInside(o))}return n}positionInside(e){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=Ge(r,this.source.start),s=o+e;for(let l=o;l<s;l++)r[l]===`\n`?(n=1,i+=1):n+=1;return{column:n,line:i,offset:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){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:Ge(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:Ge(n,this.source.end)+1}:{column:i.column+1,line:i.line,offset:i.offset+1};if(e.word){let s=n.slice(Ge(n,this.source.start),Ge(n,this.source.end)).indexOf(e.word);s!==-1&&(i=this.positionInside(s),r=this.positionInside(s+e.word.length))}else e.start?i={column:e.start.column,line:e.start.line,offset:Ge(n,e.start)}:e.index&&(i=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line,offset:Ge(n,e.end)}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.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(e,n){return new Za().raw(this,e,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let n=this,i=!1;for(let r of e)r===this?i=!0:i?(this.parent.insertAfter(n,r),n=r):this.parent.insertBefore(n,r);i||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,n){let i={},r=n==null;n=n||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let l=this[s];if(Array.isArray(l))i[s]=l.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,n):a);else if(typeof l=="object"&&l.toJSON)i[s]=l.toJSON(null,n);else if(s==="source"){if(l==null)continue;let a=n.get(l.input);a==null&&(a=o,n.set(l.input,o),o++),i[s]={end:l.end,inputId:a,start:l.start}}else i[s]=l}return r&&(i.inputs=[...n.keys()].map(s=>s.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=el){e.stringify&&(e=e.stringify);let n="";return e(this,i=>{n+=i}),n}warn(e,n,i={}){let r={node:this};for(let o in i)r[o]=i[o];return e.warn(n,r)}};Pr.exports=Rt;Rt.default=Rt});var Pt=ne((Kf,Or)=>{"use strict";var nl=Dt(),It=class extends nl{constructor(e){super(e),this.type="comment"}};Or.exports=It;It.default=It});var Bt=ne((Jf,Br)=>{"use strict";var il=Dt(),Ot=class extends il{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}};Br.exports=Ot;Ot.default=Ot});var $e=ne((Yf,$r)=>{"use strict";var Hr=Pt(),Gr=Bt(),rl=Dt(),{isClean:Wr,my:Ur}=sn(),Xn,Vr,zr,Qn;function jr(t){return t.map(e=>(e.nodes&&(e.nodes=jr(e.nodes)),delete e.source,e))}function qr(t){if(t[Wr]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)qr(e)}var Re=class t extends rl{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(...e){for(let n of e){let i=this.normalize(n,this.last);for(let r of i)this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let n of this.nodes)n.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let n=this.getIterator(),i,r;for(;this.indexes[n]<this.proxyOf.nodes.length&&(i=this.indexes[n],r=e(this.proxyOf.nodes[i],i),r!==!1);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,n){return n==="proxyOf"?e:e[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...i)=>e[n](...i.map(r=>typeof r=="function"?(o,s)=>r(o.toProxy(),s):r)):n==="every"||n==="some"?i=>e[n]((r,...o)=>i(r.toProxy(),...o)):n==="root"?()=>e.root().toProxy():n==="nodes"?e.nodes.map(i=>i.toProxy()):n==="first"||n==="last"?e[n].toProxy():e[n]:e[n]},set(e,n,i){return e[n]===i||(e[n]=i,(n==="name"||n==="params"||n==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,n){let i=this.index(e),r=this.normalize(n,this.proxyOf.nodes[i]).reverse();i=this.index(e);for(let s of r)this.proxyOf.nodes.splice(i+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],i<o&&(this.indexes[s]=o+r.length);return this.markDirty(),this}insertBefore(e,n){let i=this.index(e),r=i===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[i],r).reverse();i=this.index(e);for(let l of o)this.proxyOf.nodes.splice(i,0,l);let s;for(let l in this.indexes)s=this.indexes[l],i<=s&&(this.indexes[l]=s+o.length);return this.markDirty(),this}normalize(e,n){if(typeof e=="string")e=jr(Vr(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Gr(e)]}else if(e.selector||e.selectors)e=[new Qn(e)];else if(e.name)e=[new Xn(e)];else if(e.text)e=[new Hr(e)];else throw new Error("Unknown node type in node creation");return e.map(r=>(r[Ur]||t.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[Wr]&&qr(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(...e){e=e.reverse();for(let n of e){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(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let n;for(let i in this.indexes)n=this.indexes[i],n>=e&&(this.indexes[i]=n-1);return this.markDirty(),this}replaceValues(e,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(e,i))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((n,i)=>{let r;try{r=e(n,i)}catch(o){throw n.addToError(o)}return r!==!1&&n.walk&&(r=n.walk(e)),r})}walkAtRules(e,n){return n?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="atrule"&&e.test(i.name))return n(i,r)}):this.walk((i,r)=>{if(i.type==="atrule"&&i.name===e)return n(i,r)}):(n=e,this.walk((i,r)=>{if(i.type==="atrule")return n(i,r)}))}walkComments(e){return this.walk((n,i)=>{if(n.type==="comment")return e(n,i)})}walkDecls(e,n){return n?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="decl"&&e.test(i.prop))return n(i,r)}):this.walk((i,r)=>{if(i.type==="decl"&&i.prop===e)return n(i,r)}):(n=e,this.walk((i,r)=>{if(i.type==="decl")return n(i,r)}))}walkRules(e,n){return n?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="rule"&&e.test(i.selector))return n(i,r)}):this.walk((i,r)=>{if(i.type==="rule"&&i.selector===e)return n(i,r)}):(n=e,this.walk((i,r)=>{if(i.type==="rule")return n(i,r)}))}};Re.registerParse=t=>{Vr=t};Re.registerRule=t=>{Qn=t};Re.registerAtRule=t=>{Xn=t};Re.registerRoot=t=>{zr=t};$r.exports=Re;Re.default=Re;Re.rebuild=t=>{t.type==="atrule"?Object.setPrototypeOf(t,Xn.prototype):t.type==="rule"?Object.setPrototypeOf(t,Qn.prototype):t.type==="decl"?Object.setPrototypeOf(t,Gr.prototype):t.type==="comment"?Object.setPrototypeOf(t,Hr.prototype):t.type==="root"&&Object.setPrototypeOf(t,zr.prototype),t[Ur]=!0,t.nodes&&t.nodes.forEach(e=>{Re.rebuild(e)})}});var an=ne((Xf,Jr)=>{"use strict";var Kr=$e(),ut=class extends Kr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};Jr.exports=ut;ut.default=ut;Kr.registerAtRule(ut)});var ln=ne((Qf,Qr)=>{"use strict";var ol=$e(),Yr,Xr,it=class extends ol{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Yr(new Xr,this,e).stringify()}};it.registerLazyResult=t=>{Yr=t};it.registerProcessor=t=>{Xr=t};Qr.exports=it;it.default=it});var eo=ne((Zf,Zr)=>{var sl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",al=(t,e=21)=>(n=e)=>{let i="",r=n|0;for(;r--;)i+=t[Math.random()*t.length|0];return i},ll=(t=21)=>{let e="",n=t|0;for(;n--;)e+=sl[Math.random()*64|0];return e};Zr.exports={nanoid:ll,customAlphabet:al}});var un=ne(()=>{});var cn=ne(()=>{});var Zn=ne(()=>{});var to=ne(()=>{});var ti=ne((lm,ro)=>{"use strict";var{existsSync:ul,readFileSync:cl}=to(),{dirname:ei,join:dl}=un(),{SourceMapConsumer:no,SourceMapGenerator:io}=cn();function fl(t){return Buffer?Buffer.from(t,"base64").toString():window.atob(t)}var Ht=class{constructor(e,n){if(n.map===!1)return;n.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(e),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=ei(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new no(this.json||this.text)),this.consumerCache}decodeInline(e){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,/,s=e.match(r)||e.match(o);if(s)return decodeURIComponent(e.substr(s[0].length));let l=e.match(n)||e.match(i);if(l)return fl(e.substr(l[0].length));let a=e.slice(22);throw a=a.slice(0,a.indexOf(",")),new Error("Unsupported source map encoding "+a)}getAnnotationURL(e){return e.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let n=e.match(/\\/\\*\\s*# sourceMappingURL=/g);if(!n)return;let i=e.lastIndexOf(n.pop()),r=e.indexOf("*/",i);i>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(i,r)))}loadFile(e,n,i){if(!(!i&&!this.unsafeMap&&!/\\.map$/i.test(e))&&(this.root=ei(e),ul(e)))return this.mapFile=e,cl(e,"utf-8").toString().trim()}loadMap(e,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let i=n(e);if(i){let r=this.loadFile(i,e,!0);if(!r)throw new Error("Unable to load previous source map: "+i.toString());return r}}else{if(n instanceof no)return io.fromSourceMap(n).toString();if(n instanceof io)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;e&&(i=dl(ei(e),i));let r=this.loadFile(i,e,!1);if(r)try{this.json=JSON.parse(r.replace(/^\\)]}\'[^\\n]*\\n/,""))}catch{return}return r}}}startWith(e,n){return e?e.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};ro.exports=Ht;Ht.default=Ht});var Gt=ne((um,uo)=>{"use strict";var{nanoid:ml}=eo(),{isAbsolute:ri,resolve:oi}=un(),{SourceMapConsumer:pl,SourceMapGenerator:hl}=cn(),{fileURLToPath:oo,pathToFileURL:dn}=Zn(),so=on(),xl=ti(),ni=qn(),ii=Symbol("lineToIndexCache"),gl=!!(pl&&hl),ao=!!(oi&&ri);function lo(t){if(t[ii])return t[ii];let e=t.css.split(`\n`),n=new Array(e.length),i=0;for(let r=0,o=e.length;r<o;r++)n[r]=i,i+=e[r].length+1;return t[ii]=n,n}var ct=class{get from(){return this.file||this.id}constructor(e,n={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.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&&(!ao||/^\\w+:\\/\\//.test(n.from)||ri(n.from)?this.file=n.from:this.file=oi(n.from)),ao&&gl){let i=new xl(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 "+ml(6)+">"),this.map&&(this.map.file=this.from)}error(e,n,i,r={}){let o,s,l,a,c;if(n&&typeof n=="object"){let m=n,f=i;if(typeof m.offset=="number"){a=m.offset;let x=this.fromOffset(a);n=x.line,i=x.col}else n=m.line,i=m.column,a=this.fromLineAndColumn(n,i);if(typeof f.offset=="number"){l=f.offset;let x=this.fromOffset(l);s=x.line,o=x.col}else s=f.line,o=f.column,l=this.fromLineAndColumn(f.line,f.column)}else if(i)a=this.fromLineAndColumn(n,i);else{a=n;let m=this.fromOffset(a);n=m.line,i=m.col}let u=this.origin(n,i,s,o);return u?c=new so(e,u.endLine===void 0?u.line:{column:u.column,line:u.line},u.endLine===void 0?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,r.plugin):c=new so(e,s===void 0?n:{column:i,line:n},s===void 0?i:{column:o,line:s},this.css,this.file,r.plugin),c.input={column:i,endColumn:o,endLine:s,endOffset:l,line:n,offset:a,source:this.css},this.file&&(dn&&(c.input.url=dn(this.file).toString()),c.input.file=this.file),c}fromLineAndColumn(e,n){return lo(this)[e-1]+n-1}fromOffset(e){let n=lo(this),i=n[n.length-1],r=0;if(e>=i)r=n.length-1;else{let o=n.length-2,s;for(;r<o;)if(s=r+(o-r>>1),e<n[s])o=s-1;else if(e>=n[s+1])r=s+1;else{r=s;break}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\\w+:\\/\\//.test(e)?e:oi(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,n,i,r){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:n,line:e});if(!s.source)return!1;let l;typeof i=="number"&&(l=o.originalPositionFor({column:r,line:i}));let a;ri(s.source)?a=dn(s.source):a=new URL(s.source,this.map.consumer().sourceRoot||dn(this.map.mapFile));let c={column:s.column,endColumn:l&&l.column,endLine:l&&l.line,line:s.line,url:a.toString()};if(a.protocol==="file:")if(oo)c.file=oo(a);else throw new Error("file: protocol is not available in this PostCSS build");let u=o.sourceContentFor(s.source);return u&&(c.source=u),c}toJSON(){let e={};for(let n of["hasBOM","css","file","id"])this[n]!=null&&(e[n]=this[n]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};uo.exports=ct;ct.default=ct;ni&&ni.registerInput&&ni.registerInput(ct)});var dt=ne((cm,po)=>{"use strict";var co=$e(),fo,mo,Ke=class extends co{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,n,i){let r=super.normalize(e);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(e,n){let i=this.index(e);return!n&&i===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),super.removeChild(e)}toResult(e={}){return new fo(new mo,this,e).stringify()}};Ke.registerLazyResult=t=>{fo=t};Ke.registerProcessor=t=>{mo=t};po.exports=Ke;Ke.default=Ke;co.registerRoot(Ke)});var si=ne((dm,ho)=>{"use strict";var Wt={comma(t){return Wt.split(t,[","],!0)},space(t){let e=[" ",`\n`," "];return Wt.split(t,e)},split(t,e,n){let i=[],r="",o=!1,s=0,l=!1,a="",c=!1;for(let u of t)c?c=!1:u==="\\\\"?c=!0:l?u===a&&(l=!1):u===\'"\'||u==="\'"?(l=!0,a=u):u==="("?s+=1:u===")"?s>0&&(s-=1):s===0&&e.includes(u)&&(o=!0),o?(r!==""&&i.push(r.trim()),r="",o=!1):r+=u;return(n||r!=="")&&i.push(r.trim()),i}};ho.exports=Wt;Wt.default=Wt});var fn=ne((fm,go)=>{"use strict";var xo=$e(),yl=si(),ft=class extends xo{get selectors(){return yl.comma(this.selector)}set selectors(e){let n=this.selector?this.selector.match(/,\\s*/):null,i=n?n[0]:","+this.raw("between","beforeOpen");this.selector=e.join(i)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}};go.exports=ft;ft.default=ft;xo.registerRule(ft)});var bo=ne((mm,yo)=>{"use strict";var bl=an(),Sl=Pt(),Al=Bt(),El=Gt(),wl=ti(),Cl=dt(),Fl=fn();function Ut(t,e){if(Array.isArray(t))return t.map(r=>Ut(r));let{inputs:n,...i}=t;if(n){e=[];for(let r of n){let o={...r,__proto__:El.prototype};o.map&&(o.map={...o.map,__proto__:wl.prototype}),e.push(o)}}if(i.nodes&&(i.nodes=t.nodes.map(r=>Ut(r,e))),i.source){let{inputId:r,...o}=i.source;i.source=o,r!=null&&(i.source.input=e[r])}if(i.type==="root")return new Cl(i);if(i.type==="decl")return new Al(i);if(i.type==="rule")return new Fl(i);if(i.type==="comment")return new Sl(i);if(i.type==="atrule")return new bl(i);throw new Error("Unknown node type: "+t.type)}yo.exports=Ut;Ut.default=Ut});var li=ne((pm,Fo)=>{"use strict";var{dirname:mn,relative:Ao,resolve:Eo,sep:wo}=un(),{SourceMapConsumer:Co,SourceMapGenerator:pn}=cn(),{pathToFileURL:So}=Zn(),Nl=Gt(),Ml=!!(Co&&pn),Tl=!!(mn&&Eo&&Ao&&wo),ai=class{constructor(e,n,i,r){this.stringify=e,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 e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let n=`\n`;this.css.includes(`\\r\n`)&&(n=`\\r\n`),this.css+=n+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let n=this.toUrl(this.path(e.file)),i=e.root||mn(e.file),r;this.mapOpts.sourcesContent===!1?(r=new Co(e.text),r.sourcesContent&&(r.sourcesContent=null)):r=e.consumer(),this.map.applySourceMap(r,n,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let e;for(let n=this.root.nodes.length-1;n>=0;n--)e=this.root.nodes[n],e.type==="comment"&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(n)}else if(this.css){let e;for(;(e=this.css.lastIndexOf("/*#"))!==-1;){let n=this.css.indexOf("*/",e+3);if(n===-1)break;for(;e>0&&this.css[e-1]===`\n`;)e--;this.css=this.css.slice(0,e)+this.css.slice(n+2)}}}}generate(){if(this.clearAnnotation(),Tl&&Ml&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,n=>{e+=n}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=pn.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new pn({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 pn({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,n=1,i="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(l,a,c)=>{if(this.css+=l,a&&c!=="end"&&(r.generated.line=e,r.generated.column=n-1,a.source&&a.source.start?(r.source=this.sourcePath(a),r.original.line=a.source.start.line,r.original.column=a.source.start.column-1,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,this.map.addMapping(r))),s=l.match(/\\n/g),s?(e+=s.length,o=l.lastIndexOf(`\n`),n=l.length-o):n+=l.length,a&&c!=="start"){let u=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==u.last||u.raws.semicolon)&&(a.source&&a.source.end?(r.source=this.sourcePath(a),r.original.line=a.source.end.line,r.original.column=a.source.end.column-1,r.generated.line=e,r.generated.column=n-2,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,r.generated.line=e,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(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!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(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\\w+:\\/\\//.test(e))return e;let n=this.memoizedPaths.get(e);if(n)return n;let i=this.opts.to?mn(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(i=mn(Eo(i,this.mapOpts.annotation)));let r=Ao(i,e);return this.memoizedPaths.set(e,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let n=e.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let e=new Nl(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(n=>{if(n.source){let i=n.source.input.from;if(i&&!e[i]){e[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(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let n=this.memoizedFileURLs.get(e);if(n)return n;if(So){let i=So(e).toString();return this.memoizedFileURLs.set(e,i),i}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let n=this.memoizedURLs.get(e);if(n)return n;wo==="\\\\"&&(e=e.replace(/\\\\/g,"/"));let i=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,i),i}};Fo.exports=ai});var To=ne((hm,Mo)=>{"use strict";var hn=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,xn=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,_l=/.[\\r\\n"\'(/\\\\]/,No=/[\\da-f]/i;Mo.exports=function(e,n={}){let i=e.css.valueOf(),r=n.ignoreErrors,o,s,l,a,c,u,m,f,x,w,g=i.length,b=0,F=[],T=[],_=-1;function Q(){return b}function H(C){throw e.error("Unclosed "+C,b)}function M(){return T.length===0&&b>=g}function y(C){if(T.length)return T.pop();if(b>=g)return;let N=C?C.ignoreUnclosed:!1;switch(o=i.charCodeAt(b),o){case 10:case 32:case 9:case 13:case 12:{a=b;do a+=1,o=i.charCodeAt(a);while(o===32||o===10||o===9||o===13||o===12);u=["space",i.slice(b,a)],b=a-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let k=String.fromCharCode(o);u=[k,k,b];break}case 40:{if(w=F.length?F.pop()[1]:"",x=i.charCodeAt(b+1),w==="url"&&x!==39&&x!==34&&x!==32&&x!==10&&x!==9&&x!==12&&x!==13){a=b;do{if(m=!1,a=i.indexOf(")",a+1),a===-1)if(r||N){a=b;break}else H("bracket");for(f=a;i.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);u=["brackets",i.slice(b,a+1),b,a],b=a}else b<=_?u=["(","(",b]:(a=i.indexOf(")",b+1),s=i.slice(b,a+1),a===-1||_l.test(s)?(_=a===-1?g:a,u=["(","(",b]):(u=["brackets",s,b,a],b=a));break}case 39:case 34:{c=o===39?"\'":\'"\',a=b;do{if(m=!1,a=i.indexOf(c,a+1),a===-1)if(r||N){a=b+1;break}else H("string");for(f=a;i.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);u=["string",i.slice(b,a+1),b,a],b=a;break}case 64:{hn.lastIndex=b+1,hn.test(i),hn.lastIndex===0?a=i.length-1:a=hn.lastIndex-2,u=["at-word",i.slice(b,a+1),b,a],b=a;break}case 92:{for(a=b,l=!0;i.charCodeAt(a+1)===92;)a+=1,l=!l;if(o=i.charCodeAt(a+1),l&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(a+=1,No.test(i.charAt(a)))){for(;No.test(i.charAt(a+1));)a+=1;i.charCodeAt(a+1)===32&&(a+=1)}u=["word",i.slice(b,a+1),b,a],b=a;break}default:{o===47&&i.charCodeAt(b+1)===42?(a=i.indexOf("*/",b+2)+1,a===0&&(r||N?a=i.length:H("comment")),u=["comment",i.slice(b,a+1),b,a],b=a):(xn.lastIndex=b+1,xn.test(i),xn.lastIndex===0?a=i.length-1:a=xn.lastIndex-2,u=["word",i.slice(b,a+1),b,a],F.push(u),b=a);break}}return b++,u}function A(C){T.push(C)}return{back:A,endOfFile:M,nextToken:y,position:Q}}});var ko=ne((xm,vo)=>{"use strict";var Ll=an(),vl=Pt(),kl=Bt(),Rl=dt(),_o=fn(),Dl=To(),Lo={empty:!0,space:!0};function Il(t){for(let e=t.length-1;e>=0;e--){let n=t[e],i=n[3]||n[2];if(i)return i}}var ui=class{constructor(e){this.input=e,this.root=new Rl,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let n=new Ll;n.name=e[1].slice(1),n.name===""&&this.unnamedAtrule(n,e),this.init(n,e[2]);let i,r,o,s=!1,l=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),i=e[0],i==="("||i==="["?c.push(i==="("?")":"]"):i==="{"&&c.length>0?c.push("}"):i===c[c.length-1]&&c.pop(),c.length===0)if(i===";"){n.source.end=this.getPosition(e[2]),n.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){l=!0;break}else if(i==="}"){if(a.length>0){for(o=a.length-1,r=a[o];r&&r[0]==="space";)r=a[--o];r&&(n.source.end=this.getPosition(r[3]||r[2]),n.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),s&&(e=a[a.length-1],n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),l&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let n=this.colon(e);if(n===!1)return;let i=0,r;for(let o=n-1;o>=0&&(r=e[o],!(r[0]!=="space"&&(i+=1,i===2)));o--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(e){let n=0,i,r,o;for(let[s,l]of e.entries()){if(r=l,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 s}i=r}return!1}comment(e){let n=new vl;this.init(n,e[2]),n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++;let i=e[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=Dl(this.input)}decl(e,n){let i=new kl;this.init(i,e[0][2]);let r=e[e.length-1];for(r[0]===";"&&(this.semicolon=!0,e.pop()),i.source.end=this.getPosition(r[3]||r[2]||Il(e)),i.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),i.raws.before+=e.shift()[1];for(i.source.start=this.getPosition(e[0][2]),i.prop="";e.length;){let c=e[0][0];if(c===":"||c==="space"||c==="comment")break;i.prop+=e.shift()[1]}i.raws.between="";let o;for(;e.length;)if(o=e.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 s=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)s.push(e.shift());this.precheckMissedSemicolon(e);for(let c=e.length-1;c>=0;c--){if(o=e[c],o[1].toLowerCase()==="!important"){i.important=!0;let u=this.stringFrom(e,c);u=this.spacesFromEnd(e)+u,u!==" !important"&&(i.raws.important=u);break}else if(o[1].toLowerCase()==="important"){let u=e.slice(0),m="";for(let f=c;f>0;f--){let x=u[f][0];if(m.trim().startsWith("!")&&x!=="space")break;m=u.pop()[1]+m}m.trim().startsWith("!")&&(i.important=!0,i.raws.important=m,e=u)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(c=>c[0]!=="space"&&c[0]!=="comment")&&(i.raws.between+=s.map(c=>c[1]).join(""),s=[]),this.raw(i,"value",s.concat(e),n),i.value.includes(":")&&!n&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let n=new _o;this.init(n,e[2]),n.selector="",n.raws.between="",this.current=n}end(e){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(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}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(e){if(this.spaces+=e[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(e[2]),n.source.end.offset+=n.raws.ownSemicolon.length)}}getPosition(e){let n=this.input.fromOffset(e);return{column:n.col,line:n.line,offset:e}}init(e,n){this.current.push(e),e.source={input:this.input,start:this.getPosition(n)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let n=!1,i=null,r=!1,o=null,s=[],l=e[1].startsWith("--"),a=[],c=e;for(;c;){if(i=c[0],a.push(c),i==="("||i==="[")o||(o=c),s.push(i==="("?")":"]");else if(l&&r&&i==="{")o||(o=c),s.push("}");else if(s.length===0)if(i===";")if(r){this.decl(a,l);return}else break;else if(i==="{"){this.rule(a);return}else if(i==="}"){this.tokenizer.back(a.pop()),n=!0;break}else i===":"&&(r=!0);else i===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),s.length>0&&this.unclosedBracket(o),n&&r){if(!l)for(;a.length&&(c=a[a.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,n,i,r){let o,s,l=i.length,a="",c=!0,u,m;for(let f=0;f<l;f+=1)o=i[f],s=o[0],s==="space"&&f===l-1&&!r?c=!1:s==="comment"?(m=i[f-1]?i[f-1][0]:"empty",u=i[f+1]?i[f+1][0]:"empty",!Lo[m]&&!Lo[u]?a.slice(-1)===","?c=!1:a+=o[1]:c=!1):a+=o[1];if(!c){let f=i.reduce((x,w)=>x+w[1],"");e.raws[n]={raw:f,value:a}}e[n]=a}rule(e){e.pop();let n=new _o;this.init(n,e[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(n,"selector",e),this.current=n}spacesAndCommentsFromEnd(e){let n,i="";for(;e.length&&(n=e[e.length-1][0],!(n!=="space"&&n!=="comment"));)i=e.pop()[1]+i;return i}spacesAndCommentsFromStart(e){let n,i="";for(;e.length&&(n=e[0][0],!(n!=="space"&&n!=="comment"));)i+=e.shift()[1];return i}spacesFromEnd(e){let n,i="";for(;e.length&&(n=e[e.length-1][0],n==="space");)i=e.pop()[1]+i;return i}stringFrom(e,n){let i="";for(let r=n;r<e.length;r++)i+=e[r][1];return e.splice(n,e.length-n),i}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}};vo.exports=ui});var yn=ne((gm,Ro)=>{"use strict";var Pl=$e(),Ol=Gt(),Bl=ko();function gn(t,e){let n=new Ol(t,e),i=new Bl(n);try{i.parse()}catch(r){throw r}return i.root}Ro.exports=gn;gn.default=gn;Pl.registerParse(gn)});var ci=ne((ym,Do)=>{"use strict";var Vt=class{constructor(e,n={}){if(this.type="warning",this.text=e,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}};Do.exports=Vt;Vt.default=Vt});var bn=ne((bm,Io)=>{"use strict";var Hl=ci(),zt=class{get content(){return this.css}constructor(e,n,i){this.processor=e,this.messages=[],this.root=n,this.opts=i,this.css="",this.map=void 0}toString(){return this.css}warn(e,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let i=new Hl(e,n);return this.messages.push(i),i}warnings(){return this.messages.filter(e=>e.type==="warning")}};Io.exports=zt;zt.default=zt});var di=ne((Sm,Oo)=>{"use strict";var Po={};Oo.exports=function(e){Po[e]||(Po[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))}});var pi=ne((Em,Wo)=>{"use strict";var Gl=$e(),Wl=ln(),Ul=li(),Vl=yn(),Bo=bn(),zl=dt(),jl=vt(),{isClean:Oe,my:ql}=sn(),Am=di(),$l={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Kl={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},Jl={Once:!0,postcssPlugin:!0,prepare:!0},mt=0;function jt(t){return typeof t=="object"&&typeof t.then=="function"}function Go(t){let e=!1,n=$l[t.type];return t.type==="decl"?e=t.prop.toLowerCase():t.type==="atrule"&&(e=t.name.toLowerCase()),e&&t.append?[n,n+"-"+e,mt,n+"Exit",n+"Exit-"+e]:e?[n,n+"-"+e,n+"Exit",n+"Exit-"+e]:t.append?[n,mt,n+"Exit"]:[n,n+"Exit"]}function Ho(t){let e;return t.type==="document"?e=["Document",mt,"DocumentExit"]:t.type==="root"?e=["Root",mt,"RootExit"]:e=Go(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function fi(t){return t[Oe]=!1,t.nodes&&t.nodes.forEach(e=>fi(e)),t}var mi={},Je=class t{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(e,n,i){this.stringified=!1,this.processed=!1;let r;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))r=fi(n);else if(n instanceof t||n instanceof Bo)r=fi(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=Vl;i.syntax&&(o=i.syntax.parse),i.parser&&(o=i.parser),o.parse&&(o=o.parse);try{r=o(n,i)}catch(s){this.processed=!0,this.error=s}r&&!r[ql]&&Gl.rebuild(r)}this.result=new Bo(e,r,i),this.helpers={...mi,postcss:mi,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(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,n){let i=this.result.lastPlugin;try{n&&n.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=i.postcssPlugin,e.setMessage()):i.postcssVersion}catch(r){console&&console.error&&console.error(r)}return e}prepareVisitors(){this.listeners={};let e=(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(!Kl[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Jl[i])if(typeof n[i]=="object")for(let r in n[i])r==="*"?e(n,i,n[i][r]):e(n,i+"-"+r.toLowerCase(),n[i][r]);else typeof n[i]=="function"&&e(n,i,n[i])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let n=this.plugins[e],i=this.runOnRoot(n);if(jt(i))try{await i}catch(r){throw this.handleError(r)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Oe];){e[Oe]=!0;let n=[Ho(e)];for(;n.length>0;){let i=this.visitTick(n);if(jt(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(e.type==="document"){let r=e.nodes.map(o=>i(o,this.helpers));await Promise.all(r)}else await i(e,this.helpers)}catch(r){throw this.handleError(r)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let n=this.result.root.nodes.map(i=>e.Once(i,this.helpers));return jt(n[0])?Promise.all(n):n}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(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 e=this.result.opts,n=jl;e.syntax&&(n=e.syntax.stringify),e.stringifier&&(n=e.stringifier),n.stringify&&(n=n.stringify);let i=this.result.root.source;if(e.map===void 0&&!(i&&i.input&&i.input.map)){let s="";return n(this.result.root,l=>{s+=l}),this.result.css=s,this.result}let o=new Ul(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 e of this.plugins){let n=this.runOnRoot(e);if(jt(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Oe];)e[Oe]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let n of e.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,n){return this.async().then(e,n)}toString(){return this.css}visitSync(e,n){for(let[i,r]of e){this.result.lastPlugin=i;let o;try{o=r(n,this.helpers)}catch(s){throw this.handleError(s,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(jt(o))throw this.getAsyncError()}}visitTick(e){let n=e[e.length-1],{node:i,visitors:r}=n;if(i.type!=="root"&&i.type!=="document"&&!i.parent){e.pop();return}if(r.length>0&&n.visitorIndex<r.length){let[s,l]=r[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===r.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=s;try{return l(i.toProxy(),this.helpers)}catch(a){throw this.handleError(a,i)}}if(n.iterator!==0){let s=n.iterator,l;for(;l=i.nodes[i.indexes[s]];)if(i.indexes[s]+=1,!l[Oe]){l[Oe]=!0,e.push(Ho(l));return}n.iterator=0,delete i.indexes[s]}let o=n.events;for(;n.eventIndex<o.length;){let s=o[n.eventIndex];if(n.eventIndex+=1,s===mt){i.nodes&&i.nodes.length&&(i[Oe]=!0,n.iterator=i.getIterator());return}else if(this.listeners[s]){n.visitors=this.listeners[s];return}}e.pop()}walkSync(e){e[Oe]=!0;let n=Go(e);for(let i of n)if(i===mt)e.nodes&&e.each(r=>{r[Oe]||this.walkSync(r)});else{let r=this.listeners[i];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}};Je.registerPostcss=t=>{mi=t};Wo.exports=Je;Je.default=Je;zl.registerLazyResult(Je);Wl.registerLazyResult(Je)});var Vo=ne((Cm,Uo)=>{"use strict";var Yl=li(),Xl=yn(),Ql=bn(),Zl=vt(),wm=di(),qt=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 e,n=Xl;try{e=n(this._css,this._opts)}catch(i){this.error=i}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,n,i){n=n.toString(),this.stringified=!1,this._processor=e,this._css=n,this._opts=i,this._map=void 0;let r=Zl;this.result=new Ql(this._processor,void 0,this._opts),this.result.css=n;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let s=new Yl(r,void 0,this._opts,n);if(s.isMap()){let[l,a]=s.generate();l&&(this.result.css=l),a&&(this.result.map=a)}else s.clearAnnotation(),this.result.css=s.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,n){return this.async().then(e,n)}toString(){return this._css}warnings(){return[]}};Uo.exports=qt;qt.default=qt});var jo=ne((Fm,zo)=>{"use strict";var eu=ln(),tu=pi(),nu=Vo(),iu=dt(),rt=class{constructor(e=[]){this.version="8.5.14",this.plugins=this.normalize(e)}normalize(e){let n=[];for(let i of e)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(e,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new nu(this,e,n):new tu(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};zo.exports=rt;rt.default=rt;iu.registerProcessor(rt);eu.registerProcessor(rt)});var Zo=ne((Nm,Qo)=>{"use strict";var qo=an(),$o=Pt(),ru=$e(),ou=on(),Ko=Bt(),Jo=ln(),su=bo(),au=Gt(),lu=pi(),uu=si(),cu=Dt(),du=yn(),hi=jo(),fu=bn(),Yo=dt(),Xo=fn(),mu=vt(),pu=ci();function oe(...t){return t.length===1&&Array.isArray(t[0])&&(t=t[0]),new hi(t)}oe.plugin=function(e,n){let i=!1;function r(...s){console&&console.warn&&!i&&(i=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let l=n(...s);return l.postcssPlugin=e,l.postcssVersion=new hi().version,l}let o;return Object.defineProperty(r,"postcss",{get(){return o||(o=r()),o}}),r.process=function(s,l,a){return oe([r(a)]).process(s,l)},r};oe.stringify=mu;oe.parse=du;oe.fromJSON=su;oe.list=uu;oe.comment=t=>new $o(t);oe.atRule=t=>new qo(t);oe.decl=t=>new Ko(t);oe.rule=t=>new Xo(t);oe.root=t=>new Yo(t);oe.document=t=>new Jo(t);oe.CssSyntaxError=ou;oe.Declaration=Ko;oe.Container=ru;oe.Processor=hi;oe.Document=Jo;oe.Comment=$o;oe.Warning=pu;oe.AtRule=qo;oe.Result=fu;oe.Input=au;oe.Rule=Xo;oe.Root=Yo;oe.Node=cu;lu.registerPostcss(oe);Qo.exports=oe;oe.default=oe});function qi(){return globalThis}function v(t,e){if(typeof window>"u")return;let n=qi(),i=n.__hf?.onSwallowed;if(i)try{i({label:t,error:e})}catch(r){}(n.__hfDebug||n.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${t} swallowed:`,e)}function Ae(t){try{window.parent.postMessage(t,"*")}catch(e){v("bridge.postMessage",e)}}function $i(t){let e=n=>{let i=n.data;if(!i||i.source!=="hf-parent"||i.type!=="control")return;let r=i.action;if(r==="play"){t.onPlay();return}if(r==="pause"){t.onPause();return}if(r==="seek"){t.onSeek(Number(i.frame??0),i.seekMode??"commit");return}if(r==="tick"){t.onTick();return}if(r==="set-muted"){t.onSetMuted(!!i.muted);return}if(r==="set-volume"){t.onSetVolume(Math.max(0,Math.min(1,Number(i.volume??1))));return}if(r==="set-media-output-muted"){t.onSetMediaOutputMuted(!!i.muted);return}if(r==="set-playback-rate"){t.onSetPlaybackRate(Number(i.playbackRate??1));return}if(r==="set-color-grading"){t.onSetColorGrading(i.target??null,i.grading??null);return}if(r==="set-color-grading-compare"){t.onSetColorGradingCompare(i.target??null,i.compare??null);return}if(r==="enable-pick-mode"){t.onEnablePickMode();return}if(r==="disable-pick-mode"){t.onDisablePickMode();return}if(r==="flash-elements"){let o=i.selectors,s=i.duration||800;o&&Sa(o,s)}};return window.addEventListener("message",e),Ae({source:"hf-preview",type:"ready"}),e}function Sa(t,e){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 ${e}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 t)try{document.querySelectorAll(n).forEach(r=>{r.classList.add("__hf-flash"),setTimeout(()=>r.classList.remove("__hf-flash"),e)})}catch(i){v("bridge.flashElements.querySelector",i)}}var On=null;function Ki(t){On=t}function At(t,e){if(On)try{On({source:"hf-preview",type:"analytics",event:t,properties:e??{}})}catch(n){v("runtime.analytics.site1",n)}}function Ji(t){let e=[],n=l=>{if(typeof l.getAnimations!="function")return[];try{return l.getAnimations()}catch{return[]}},i=(l,a)=>{for(let c of l){try{c.currentTime=a}catch(u){v("runtime.adapters.css.site1",u)}try{c.pause()}catch(u){v("runtime.adapters.css.site2",u)}}},r=l=>{for(let a of l)try{a.play()}catch(c){v("runtime.adapters.css.site3",c)}},o=l=>{for(let a of l)try{a.pause()}catch(c){v("runtime.adapters.css.site4",c)}},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:()=>{e=[];let l=document.querySelectorAll("*");for(let a of l){if(!(a instanceof HTMLElement))continue;let c=window.getComputedStyle(a);!c.animationName||c.animationName==="none"||e.push({el:a,baseDelay:a.style.animationDelay||"",basePlayState:a.style.animationPlayState||""})}},seek:l=>{let a=Number(l.time)||0;for(let c of e){if(!c.el.isConnected)continue;let u=t?.resolveStartSeconds?t.resolveStartSeconds(c.el):Number.parseFloat(c.el.getAttribute("data-start")??"0")||0,m=Math.max(0,a-u)*1e3,f=n(c.el);if(f.length>0){i(f,m);continue}c.el.style.animationPlayState="paused",c.el.style.animationDelay=`-${(m/1e3).toFixed(3)}s`}},pause:()=>{for(let l of e){if(!l.el.isConnected)continue;let a=n(l.el);a.length>0&&o(a),s(l)}},play:()=>{for(let l of e)l.el.isConnected&&(s(l),r(n(l.el)))},revert:()=>{e=[]}}}function Yi(t){return{name:"gsap",discover:()=>{},seek:e=>{let n=t.getTimeline();if(!n)return;n.pause();let i=Math.max(0,Number(e.time)||0);typeof n.totalTime=="function"?(n.totalTime(i+.001,!0),n.totalTime(i,!1)):n.seek(i,!1)},pause:()=>{let e=t.getTimeline();e&&e.pause()}}}function Xi(){return{name:"animejs",discover:()=>{try{let t=window.anime;if(!t||typeof t.running>"u")return;let e=t.running;if(!Array.isArray(e)||e.length===0)return;let n=window.__hfAnime??[],i=new Set(n);for(let r of e)i.has(r)||n.push(r);window.__hfAnime=n}catch(t){v("runtime.adapters.animejs.site1",t)}},seek:t=>{let e=Math.max(0,(Number(t.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let i of n)try{typeof i.seek=="function"&&i.seek(e)}catch(r){v("runtime.adapters.animejs.site2",r)}},pause:()=>{let t=window.__hfAnime;if(!(!t||t.length===0))for(let e of t)try{typeof e.pause=="function"&&e.pause()}catch(n){v("runtime.adapters.animejs.site3",n)}},play:()=>{let t=window.__hfAnime;if(!(!t||t.length===0))for(let e of t)try{typeof e.play=="function"&&e.play()}catch(n){v("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function er(){return{name:"lottie",discover:()=>{try{let t=window.lottie;if(t&&typeof t.getRegisteredAnimations=="function"){let e=t.getRegisteredAnimations();if(Array.isArray(e)&&e.length>0){let n=window.__hfLottie??[],i=new Set(n);for(let r of e)i.has(r)||n.push(r);window.__hfLottie=n}}}catch(t){v("runtime.adapters.lottie.site1",t)}},seek:t=>{let e=Math.max(0,Number(t.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let i of n)try{if(Qi(i))i.goToAndStop(e*1e3,!1);else if(Zi(i)){if(typeof i.setCurrentRawFrameValue=="function"){let r=i.totalFrames??0,o=i.frameRate??30,s=e*o;r>0&&i.setCurrentRawFrameValue(Math.min(s,r-1))}else if(typeof i.seek=="function"){let r=i.duration??1,o=Math.min(100,e/r*100);i.seek(o)}}}catch(r){v("runtime.adapters.lottie.site2",r)}},pause:()=>{let t=window.__hfLottie;if(!(!t||t.length===0))for(let e of t)try{(Qi(e)||Zi(e))&&e.pause()}catch(n){v("runtime.adapters.lottie.site3",n)}},revert:()=>{}}}function Qi(t){return typeof t=="object"&&t!==null&&typeof t.goToAndStop=="function"}function Zi(t){return typeof t=="object"&&t!==null&&typeof t.pause=="function"&&("totalFrames"in t||"duration"in t)}var Bn=-1;function rn(t){if(t!==Bn){Bn=t;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:t}}))}catch(e){v("runtime.adapters.seek-dispatch.site1",e)}}}function tr(t){Bn=t;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:t}}))}catch(e){v("runtime.adapters.seek-dispatch.force",e)}}function nr(){let t=null,e=0,n=null,i=null,r=null,o=null,s=()=>{if(typeof window>"u")return null;let u=window.THREE?.DefaultLoadingManager;return!u||typeof u!="object"||typeof u.itemsLoaded!="number"||typeof u.itemsTotal!="number"?null:u},l=c=>{o||c.itemsTotal<=c.itemsLoaded||(o=new Promise(u=>{c.onLoad=function(){try{r?.call(this)}finally{o=null,c.onLoad=r??null,u()}}}))},a=c=>{n!==c&&(n=c,i=c.onStart??null,r=c.onLoad??null,c.onStart=function(u,m,f){try{i?.call(this,u,m,f)}finally{l(c)}})};return{name:"three",discover:()=>{let c=s();c&&(a(c),l(c))},seek:c=>{t=Math.max(0,Number(c.time)||0),e=t,window.__hfThreeTime=t,rn(t)},pause:()=>{t==null&&(t=Math.max(0,e))},play:()=>{t=null},revert:()=>{t=null,e=0},getReadyPromise:()=>{let c=s();return!c||c.itemsTotal<=c.itemsLoaded?null:(o||l(c),o)}}}function Pe(t){let e=null,n=new WeakSet;return{name:t.name,discover:()=>{},seek:()=>{},pause:()=>{},play:()=>{},revert:()=>{},getReadyPromise:()=>{let i=t.getInstances();if(i.length===0)return null;let r=i.filter(o=>!n.has(o));return r.length===0?null:e||(e=Promise.allSettled(r.map(o=>t.waitFor(o).then(()=>{n.add(o)}))).then(()=>{e=null}),e)}}}function ir(){return Pe({name:"mapbox",getInstances:()=>{if(typeof window>"u")return[];let t=window.__hfMapbox;return Array.isArray(t)?t:[]},waitFor:t=>new Promise(e=>{if(t.loaded()){e();return}t.on("load",e)})})}function rr(){return Pe({name:"leaflet",getInstances:()=>{if(typeof window>"u")return[];let t=window.__hfLeaflet;return Array.isArray(t)?t:[]},waitFor:t=>new Promise(e=>t.whenReady(e))})}function or(){return Pe({name:"google-maps",getInstances:()=>{if(typeof window>"u")return[];let t=window.__hfGoogleMaps;return Array.isArray(t)?t:[]},waitFor:t=>new Promise(e=>{let n=t.addListener("tilesloaded",()=>{n.remove(),e()})})})}function sr(){return Pe({name:"maplibre",getInstances:()=>{if(typeof window>"u")return[];let t=window.__hfMaplibre;return Array.isArray(t)?t:[]},waitFor:t=>new Promise(e=>{if(t.loaded()){e();return}t.on("load",e)})})}function ar(){return Pe({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let t=window.__hfD3;return Array.isArray(t)?t:[]},waitFor:t=>t.end()})}function lr(){let t=null,e=0;return{name:"typegpu",discover:()=>{},seek:n=>{t=Math.max(0,Number(n.time)||0),e=t,window.__hfTypegpuTime=t,rn(t)},pause:()=>{t==null&&(t=Math.max(0,e))},play:()=>{t=null},revert:()=>{t=null,e=0}}}function ur(t){let e=t.nextElementSibling;if(e instanceof HTMLImageElement&&e.classList.contains("__render_frame__")&&e.complete&&e.naturalWidth>0)return e;if(t.id){let n=document.getElementById(`__render_frame_${t.id}__`);if(n instanceof HTMLImageElement&&n.complete&&n.naturalWidth>0)return n}return null}function cr(){let t=globalThis.GPUQueue;if(!t?.prototype?.copyExternalImageToTexture)return;let e=t.prototype.copyExternalImageToTexture;t.prototype.copyExternalImageToTexture=function(n,i,r){if(n?.source instanceof HTMLVideoElement){let o=ur(n.source);if(o)return e.call(this,{...n,source:o},i,r)}return e.call(this,n,i,r)}}function dr(){let t=[globalThis.WebGL2RenderingContext,globalThis.WebGLRenderingContext],e=["texImage2D","texSubImage2D"];for(let n of t){let i=n?.prototype;if(i)for(let r of e){let o=i[r];if(typeof o!="function"||o.__hfVideoPatched)continue;let s=function(...l){let a=l.length-1,c=l[a];if(c instanceof HTMLVideoElement){let u=ur(c);u&&(l[a]=u)}return o.apply(this,l)};s.__hfVideoPatched=!0,i[r]=s}}}function fr(){let t=!1,e=0,n=new WeakMap,i=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},r=l=>{let a=Number(l.currentTime);return Number.isFinite(a)&&a>0?a:0},o=(l,a)=>a<=0?l:l>=a?Math.max(0,l-a):l,s=(l,a)=>{let c=n.get(l);if(c)return c;let u={compositionTimeMs:a,animationTimeMs:t?o(r(l),a):r(l)};return n.set(l,u),u};return{name:"waapi",discover:()=>{t=!0;for(let l of i())s(l,e)},seek:l=>{let a=Math.max(0,(Number(l.time)||0)*1e3);e=a;for(let c of i()){let u=t?s(c,a):s(c,0),m=u.animationTimeMs+Math.max(0,a-u.compositionTimeMs);try{c.currentTime=m}catch(f){v("runtime.adapters.waapi.site1",f)}try{c.pause()}catch(f){v("runtime.adapters.waapi.site2",f)}}},pause:()=>{if(document.getAnimations)for(let l of document.getAnimations())try{l.pause()}catch(a){v("runtime.adapters.waapi.site3",a)}}}}function mr(t,e){if(t.length===0)return 1;let n=0;for(;n<t.length-2&&e>=t[n+1].time;)n+=1;let i=t[n],r=t[n+1]??i,o=r.time-i.time,s=o<=0?0:Math.min(1,Math.max(0,(e-i.time)/o));return i.volume+(r.volume-i.volume)*s}function Aa(t,e,n,i){let r=Number.parseFloat(t.dataset.start??"0")||0,o=Number.parseFloat(t.dataset.end??""),s=Number.parseFloat(t.dataset.duration??""),l=Number.isFinite(o)&&o>r?o:Number.isFinite(s)&&s>0?r+s:n,a=Number.parseFloat(t.dataset.volume??""),c=Number.isFinite(a)?Math.max(0,Math.min(1,a)):1;t.volume=c;let u=1/Math.min(60,Math.max(1,i)),m=Math.max(0,r),f=Math.min(n,l),x=[];for(let g=m;g<=f+1e-6;g+=u){let b=Math.min(f,g);e(b);let F=Number(t.volume);if(!Number.isFinite(F))continue;let T=Math.max(0,Math.min(1,F)),_=x.at(-1);if((!_||Math.abs(_.volume-T)>1e-4||b===f)&&x.push({time:Number(b.toFixed(6)),volume:Number(T.toFixed(6))}),b===f)break}return x.some(g=>Math.abs(g.volume-c)>1e-4)?x:null}function pr(t,e,n,i){if(!e||!(t instanceof HTMLAudioElement)&&!(t instanceof HTMLVideoElement)||n<=0)return;let o=Aa(t,s=>{try{typeof e.totalTime=="function"?e.totalTime(s,!0):typeof e.seek=="function"&&e.seek(s,!0)}catch{}},n,60);o&&i.set(t,o)}function Ct(t){let e=t.defaultPlaybackRate;return Number.isFinite(e)&&e>0?Math.max(.1,Math.min(5,e)):1}function hr(t){let e=Array.from(document.querySelectorAll("video, audio")),n=t?.shouldIncludeElement?e.filter(s=>t.shouldIncludeElement?.(s)):e.filter(s=>s.hasAttribute("data-start")),i=[],r=[],o=0;for(let s of n){let l=t?.resolveStartSeconds?t.resolveStartSeconds(s):Number.parseFloat(s.dataset.start??"0");if(!Number.isFinite(l))continue;let a=Number.parseFloat(s.dataset.playbackStart??s.dataset.mediaStart??"0")||0,c=Ct(s),u=s.loop,m=Number.isFinite(s.duration)&&s.duration>0?s.duration:null,f=t?.resolveDurationSeconds?.(s)??Number.parseFloat(s.dataset.duration??"");(!Number.isFinite(f)||f<=0)&&m!=null&&(f=Math.max(0,(m-a)/c));let x=Number.isFinite(f)&&f>0?l+f:Number.POSITIVE_INFINITY,w=Number.parseFloat(s.dataset.volume??""),g={el:s,start:l,mediaStart:a,duration:Number.isFinite(f)&&f>0?f:Number.POSITIVE_INFINITY,end:x,volume:Number.isFinite(w)?w:null,playbackRate:c,loop:u,sourceDuration:m};i.push(g),s.tagName==="VIDEO"&&r.push(g),Number.isFinite(x)&&(o=Math.max(o,x))}return{timedMediaEls:n,mediaClips:i,videoClips:r,maxMediaEnd:o}}var Hn=new WeakMap,Et=new WeakMap,Gn=new WeakSet,at=new WeakSet;function Ea(t){if(at.has(t))return;at.add(t);let e=()=>at.delete(t);t.addEventListener("playing",e,{once:!0}),t.addEventListener("pause",e,{once:!0}),t.addEventListener("error",e,{once:!0})}var Wn=new WeakMap;function wt(t){return Number.isFinite(t)?Math.max(0,Math.min(1,t)):1}function xr(t){let e=!!(t.outputMuted||t.userMuted);for(let n of t.clips){let{el:i}=n;if(!i.isConnected)continue;let r=(t.timeSeconds-n.start)*n.playbackRate+n.mediaStart;if(t.timeSeconds>=n.start&&t.timeSeconds<=n.end&&r>=0&&(!i.ended||n.loop)){if(n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let N=n.sourceDuration-n.mediaStart;N>0&&r>=n.sourceDuration&&(r=n.mediaStart+(r-n.mediaStart)%N)}let s=wt(t.userVolume??1),l=wt(n.volume??1),a=Wn.get(i),c=wt(i.volume),u;n.volumeKeyframes&&n.volumeKeyframes.length>0?u=wt(mr(n.volumeKeyframes,r)):a===void 0||Math.abs(c-a)>1e-4?u=c:u=l;let m=wt(u*s);i.volume=m,Wn.set(i,m),t.onElementVolume?.(i,m),e&&(i.muted=!0),i.preload!=="auto"&&(i.preload="auto");try{i.playbackRate=n.playbackRate*t.playbackRate}catch(N){v("runtime.media.site1",N)}let f=.04,x=2,w=i.currentTime||0,g=Math.abs(w-r),b=r-w,F=Hn.get(i);Hn.set(i,b);let T=F===void 0,_=!T&&Math.abs(b-F)>.5,Q=g>3,H=g>.5&&(T||_||Q),M=i.tagName==="VIDEO"&&!i.paused,y=F!==void 0&&Math.abs(b-F)<.004,A=!1;if(!M&&!H&&!T&&y&&g>f){let N=(Et.get(i)??0)+1;Et.set(i,N),N>=x&&(A=!0,Et.set(i,0))}else g<=f&&Et.set(i,0);let C=!M&&t.forceSync&&g>.02;if(H||A||C){try{i.currentTime=r}catch(N){v("runtime.media.site2",N)}if(Math.abs(i.currentTime-r)>.5&&!Gn.has(i)){Gn.add(i),i.load();try{i.currentTime=r}catch(N){v("runtime.media.site3",N)}}at.delete(i)}t.playing&&i.paused&&!at.has(i)?(Ea(i),i.play().catch(N=>{at.delete(i),(N&&typeof N=="object"&&"name"in N?String(N.name??""):"")==="NotAllowedError"&&t.onAutoplayBlocked?.()})):!t.playing&&!i.paused&&i.pause();continue}Hn.delete(i),Et.delete(i),Gn.delete(i),Wn.delete(i),i.paused||i.pause()}}var wa=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),Ca=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(","),Fa="data-hf-color-grading-source-hidden";function gr(t){let e=!1,n=null,i=null,r=null,o=null;function s(y,A){try{window.dispatchEvent(new CustomEvent(y,{detail:A}))}catch(C){v("runtime.picker.site1",C)}}function l(y){r=y,s("hyperframe:picker:hovered",{elementInfo:r,isPickMode:e,timestamp:Date.now()})}function a(y){o=y,s("hyperframe:picker:selected",{elementInfo:o,isPickMode:e,timestamp:Date.now()})}function c(y){let A=y.ownerDocument.defaultView;if(!A)return!1;let C=y;for(;C&&C!==document.body&&C!==document.documentElement;){let N=A.getComputedStyle(C);if(N.display==="none"||N.visibility==="hidden"||N.pointerEvents==="none")return!0;let k=Number.parseFloat(N.opacity);if(Number.isFinite(k)&&k<=.01&&!C.hasAttribute(Fa))return!0;C=C.parentElement}return!1}function u(y){if(!y||y===document.body||y===document.documentElement)return!1;let A=y.tagName.toLowerCase();return!(A==="script"||A==="style"||A==="link"||A==="meta"||y.classList.contains("__hf-pick-highlight")||y.closest(wa)||c(y))}function m(y){return!!y?.closest(Ca)}function f(y){let A=y;if(A.id)return`#${A.id}`;let C=y.getAttribute("data-composition-id");if(C)return`[data-composition-id="${C}"]`;let N=y.getAttribute("data-composition-src");if(N)return`[data-composition-src="${N}"]`;let k=y.getAttribute("data-track-index");if(k)return`[data-track-index="${k}"]`;let G=y.tagName.toLowerCase(),z=y.parentElement;if(!z)return G;let ee=z.querySelectorAll(`:scope > ${G}`);if(ee.length===1)return G;for(let R=0;R<ee.length;R+=1)if(ee[R]===y)return`${G}:nth-of-type(${R+1})`;return G}function x(y){let A=y.tagName.toLowerCase(),C=(y.textContent??"").trim().replace(/\\s+/g," "),N=(k,G)=>k.length>G?`${k.slice(0,G-1)}\\u2026`:k;return A==="h1"||A==="h2"||A==="h3"?"Heading":A==="p"||A==="span"||A==="div"?C.length>0?N(C,56):"Text":A==="img"?"Image":A==="video"?"Video":A==="audio"?"Audio":A==="svg"?"Shape":y.getAttribute("data-composition-src")?"Composition":A==="section"?"Section":`${A.charAt(0).toUpperCase()}${A.slice(1)}`}function w(y,A,C){let N=typeof C=="number"&&C>0?C:8,k=[];if(document.elementsFromPoint)k=document.elementsFromPoint(y,A);else if(document.elementFromPoint){let ee=document.elementFromPoint(y,A);k=ee?[ee]:[]}if(m(k[0]??null))return[];let G={},z=[];for(let ee=0;ee<k.length;ee+=1){let R=k[ee];if(!u(R))continue;let U=`${R.tagName}::${R.id||""}::${ee}`;if(!G[U]&&(G[U]=!0,z.push(R),z.length>=N))break}return z}function g(y){let A=y.getBoundingClientRect(),C={};for(let k=0;k<y.attributes.length;k+=1){let G=y.attributes[k];G.name.startsWith("data-")&&(C[G.name]=G.value)}return{id:y.id||null,tagName:y.tagName.toLowerCase(),selector:f(y),label:x(y),boundingBox:{x:A.left,y:A.top,width:A.width,height:A.height},textContent:y.textContent?y.textContent.trim().slice(0,200):null,src:y.getAttribute("src")||y.getAttribute("data-composition-src")||null,dataAttributes:C}}function b(y,A,C){return w(y,A,C).map(g)}function F(y){if(!e)return;let C=w(y.clientX,y.clientY,1)[0]??(y.target instanceof Element?y.target:null);if(!u(C)||n===C)return;n&&n.classList.remove("__hf-pick-highlight"),n=C,C.classList.add("__hf-pick-highlight");let N=g(C);l(N),t.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:N})}function T(y){if(!e)return;y.preventDefault(),y.stopPropagation(),y.stopImmediatePropagation();let A=b(y.clientX,y.clientY,8);A.length!==0&&(l(A[0]??null),t.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:A,selectedIndex:0,point:{x:y.clientX,y:y.clientY}}))}function _(y){y.key==="Escape"&&(H(),t.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function Q(){e||(e=!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",F,!0),document.addEventListener("click",T,!0),document.addEventListener("keydown",_,!0),s("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function H(){e&&(e=!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",F,!0),document.removeEventListener("click",T,!0),document.removeEventListener("keydown",_,!0),s("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function M(){window.__HF_PICKER_API={enable:Q,disable:H,isActive:()=>e,getHovered:()=>r,getSelected:()=>o,getCandidatesAtPoint:(y,A,C)=>Number.isFinite(y)&&Number.isFinite(A)?b(y,A,C):[],pickAtPoint:(y,A,C)=>{if(!Number.isFinite(y)||!Number.isFinite(A))return null;let N=b(y,A,8);if(!N.length)return null;let k=Math.max(0,Math.min(N.length-1,Number(C??0))),G=N[k]??null;return G?(a(G),t.postMessage({source:"hf-preview",type:"element-picked",elementInfo:G}),H(),G):null},pickManyAtPoint:(y,A,C)=>{if(!Number.isFinite(y)||!Number.isFinite(A))return[];let N=b(y,A,8);if(!N.length)return[];let k=[],G=Array.isArray(C)?C:[0];for(let z of G){let ee=Math.max(0,Math.min(N.length-1,Math.floor(Number(z)))),R=N[ee];if(!R)continue;k.some(Me=>Me.selector===R.selector&&Me.tagName===R.tagName)||k.push(R)}return k.length?(a(k[0]??null),t.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:k}),H(),k):[]}},s("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:Q,disablePickMode:H,installPickerApi:M}}var Na=["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 lt(t,e){let n=Number.isFinite(e)&&e>0?e:30,i=Number.isFinite(t)&&t>0?t:0;return Math.floor(i*n+1e-9)/n}function yr(t,e,n=Na){for(let i of n){let r=e.getPropertyValue(i);r&&t.setProperty(i,r)}}function Ft(t,e,n){let i=t?.[e];return typeof i=="function"?Number(i.call(t))||n:typeof i=="number"&&Number.isFinite(i)?i:(i!=null&&v("runtime.player.nonConformantNum",{prop:e,actual:typeof i}),n)}function ke(t,e){let n=t?.[e];if(typeof n=="function"){n.call(t);return}n!==void 0&&v("runtime.player.nonConformantVoid",{method:e,actual:typeof n})}function Nt(t,e,n){if(t){for(let i of Object.values(t))if(!(!i||i===e))try{n(i)}catch(r){v("runtime.player.site1",r)}}}function br(t,e,n){let i=lt(e,n);return ke(t,"pause"),typeof t.totalTime=="function"?t.totalTime(i,!1):typeof t.seek=="function"&&t.seek(i,!1),i}function Ma(t,e,n,i){let r=[];Nt(t,e,o=>{ke(o,"play"),r.push(o)});try{return br(e,n,i)}finally{for(let o of r)try{ke(o,"pause")}catch(s){v("runtime.player.site2",s)}}}function Ta(t,e){Nt(t,e,n=>{ke(n,"play")})}function Sr(t){return{_timeline:null,play:()=>{let e=t.getTimeline();if(!e||t.getIsPlaying())return;let n=Math.max(0,Number(t.getSafeDuration?.()??Ft(e,"duration",0))||0);n>0&&Math.max(0,Ft(e,"time",0))>=n&&(ke(e,"pause"),typeof e.seek=="function"&&e.seek(0,!1),t.onDeterministicSeek(0),t.setIsPlaying(!1),t.onSyncMedia(0,!1),t.onRenderFrameSeek(0)),typeof e.timeScale=="function"&&e.timeScale(t.getPlaybackRate()),ke(e,"play"),Nt(t.getTimelineRegistry?.(),e,i=>{typeof i.timeScale=="function"&&i.timeScale(t.getPlaybackRate()),ke(i,"play")}),t.onDeterministicPlay(),t.setIsPlaying(!0),t.onShowNativeVideos(),t.onStatePost(!0)},pause:()=>{let e=t.getTimeline();if(!e)return;ke(e,"pause"),Nt(t.getTimelineRegistry?.(),e,i=>{ke(i,"pause")});let n=Math.max(0,Ft(e,"time",0));t.onDeterministicSeek(n),t.onDeterministicPause(),t.setIsPlaying(!1),t.onSyncMedia(n,!1),t.onRenderFrameSeek(n),t.onStatePost(!0)},seek:(e,n)=>{let i=t.getTimeline();if(!i)return;let r=Math.max(0,Number(e)||0),o=t.getIsPlaying(),s=Ma(t.getTimelineRegistry?.(),i,r,t.getCanonicalFps());t.onDeterministicSeek(s),n?.keepPlaying&&o?(typeof i.timeScale=="function"&&i.timeScale(t.getPlaybackRate()),ke(i,"play"),Nt(t.getTimelineRegistry?.(),i,l=>{typeof l.timeScale=="function"&&l.timeScale(t.getPlaybackRate()),ke(l,"play")}),t.onDeterministicPlay(),t.onShowNativeVideos(),t.onSyncMedia(s,!0)):(t.setIsPlaying(!1),t.onSyncMedia(s,!1)),t.onRenderFrameSeek(s),t.onStatePost(!0)},renderSeek:e=>{let n=t.getTimeline(),i=t.getCanonicalFps(),r=n?(Ta(t.getTimelineRegistry?.(),n),br(n,e,i)):lt(Math.max(0,Number(e)||0),i);t.onDeterministicSeek(r),t.setIsPlaying(!1),t.onSyncMedia(r,!1),t.onRenderFrameSeek(r),t.onStatePost(!0)},getTime:()=>Ft(t.getTimeline(),"time",0),getDuration:()=>Ft(t.getTimeline(),"duration",0),isPlaying:()=>t.getIsPlaying(),setPlaybackRate:e=>t.setPlaybackRate(e),getPlaybackRate:()=>t.getPlaybackRate()}}function Ar(){return{capturedTimeline:null,isPlaying:!1,currentTime:0,deterministicAdapters:[],canonicalFps:30,bridgeMuted:!1,bridgeVolume:1,mediaOutputMuted:!1,mediaAutoplayBlockedPosted:!1,mediaForceSyncNextTick:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,controlBridgeHandler:null,beforeUnloadHandler:null,injectedCompStyles:[],injectedCompScripts:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,transportClock:null,transportRafId:null}}var _a="data-hf-authored-duration",La="data-hf-authored-end";function nt(t){if(t==null||t==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}function va(t){return nt(t.getAttribute("data-duration"))}function ka(t){return nt(t.getAttribute("data-end"))}function Ra(t){return nt(t.getAttribute(_a))}function Da(t){return nt(t.getAttribute(La))}function Ia(t){let e=(t??"").trim();if(!e)return null;let n=nt(e);if(n!=null)return{kind:"absolute",value:n};let i=e.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]??"+",s=i[3]??"0",l=Number.parseFloat(s),a=Number.isFinite(l)?Math.max(0,l):0,c=o==="-"?-a:a;return{kind:"reference",refId:r,offset:c}}function je(t){let e=t.timelineRegistry??{},n=t.includeAuthoredTimingAttrs??!1,i=new WeakMap,r=new WeakMap,o=new Set,s=u=>{let m=document.getElementById(u);return m||(document.querySelector(`[data-composition-id="${CSS.escape(u)}"]`)??null)},l=u=>{let m=r.get(u);if(m!==void 0)return m;let f=null,x=va(u)??(n?Ra(u):null);if(x!=null&&x>0&&(f=x),f==null||f<=0){let w=ka(u)??(n?Da(u):null);if(w!=null){let g=c(u,0),b=w-g;Number.isFinite(b)&&b>0&&(f=b)}}if((f==null||f<=0)&&u instanceof HTMLMediaElement){let w=nt(u.getAttribute("data-playback-start"))??nt(u.getAttribute("data-media-start"))??0;Number.isFinite(u.duration)&&u.duration>w&&(f=(u.duration-w)/Ct(u))}if(f==null||f<=0){let w=u.getAttribute("data-composition-id");if(w){let g=e[w]??null;if(g&&typeof g.duration=="function")try{let b=Number(g.duration());Number.isFinite(b)&&b>0&&(f=b)}catch(b){v("runtime.startResolver.site1",b)}}}return f!=null&&Number.isFinite(f)&&f>0?(r.set(u,f),f):(r.set(u,null),null)},a=(u,m)=>{if(u.hasAttribute("data-composition-id")){let x=u.parentElement?.closest("[data-composition-id]");return x?c(x,m):0}let f=u.closest("[data-composition-id]");return f?c(f,m):0},c=(u,m)=>{let f=i.get(u);if(f!==void 0)return f??m;if(o.has(u))return m;o.add(u);try{let x=Ia(u.getAttribute("data-start"));if(!x){if(u.hasAttribute("data-composition-id")){let T=u.parentElement;if(T&&(T.hasAttribute("data-composition-src")||T.hasAttribute("data-composition-id"))){let _=c(T,m);return i.set(u,_),_}}return i.set(u,m),m}if(x.kind==="absolute"){let T=Math.max(0,x.value),_=Math.max(0,a(u,m)+T);return i.set(u,_),_}let w=s(x.refId);if(!w)return i.set(u,m),m;let g=c(w,0),b=l(w);if(b==null||b<=0){let T=Math.max(0,g+x.offset);return i.set(u,T),T}let F=Math.max(0,g+b+x.offset);return i.set(u,F),F}finally{o.delete(u)}};return{resolveStartForElement:(u,m=0)=>c(u,Math.max(0,m)),resolveDurationForElement:u=>l(u)}}function Er(t){let e=t.trim().toLowerCase();return!(!e||e==="main"||e.includes("caption")||e.includes("ambient"))}var Pa="data-hf-authored-duration",Oa="data-hf-authored-end";function Ce(t){if(t==null||t==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}function Un(t){return Ce(t.getAttribute("data-duration"))??Ce(t.getAttribute(Pa))}function wr(t){return Ce(t.getAttribute("data-end"))??Ce(t.getAttribute(Oa))}function Vn(...t){let e=t.filter(n=>Number.isFinite(n??null));return e.length===0?null:Math.max(...e)}var Cr={composition:0,video:1,image:2,element:3,audio:4};function Ba(t){if(t.length===0)return;let e=new Map;for(let s of t){let l=e.get(s.track)??new Set;l.add(s.kind),e.set(s.track,l)}if(!Array.from(e.values()).some(s=>s.size>1))return;let i=0,r=new Map,o=[...e.keys()].sort((s,l)=>s-l);for(let s of o){let l=e.get(s);if(l.size===1)r.set(`${s}:${[...l][0]}`,i++);else{let a=[...l].sort((c,u)=>(Cr[c]??99)-(Cr[u]??99));for(let c of a)r.set(`${s}:${c}`,i++)}}for(let s of t){let l=`${s.track}:${s.kind}`,a=r.get(l);a!=null&&(s.track=a)}}function Tt(t){let e=String(t??"").trim();if(!e)return null;let n=e.toLowerCase();if(n.startsWith("data:")||n.startsWith("javascript:"))return null;try{return new URL(e,document.baseURI).toString()}catch{return e}}function Fr(t){let e=t.getAttribute("src")??t.getAttribute("data-src");if(e)return Tt(e);let n=t.getAttribute("data-composition-src");if(n)return Tt(n);let i=t.querySelector("img[src], video[src], audio[src], source[src]");return i?Tt(i.getAttribute("src")):null}function Ha(t){let e=t.className;return typeof e!="string"?null:e.split(/\\s+/).map(n=>n.trim()).find(n=>n&&n!=="clip"&&!n.startsWith("__hf-"))??null}function Ga(t){if(!t)return null;try{return new URL(t,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return t.split(/[\\\\/]/).filter(Boolean).at(-1)??null}}function Wa(t){let e=t.textContent?.replace(/\\s+/g," ").trim();return e?e.length>32?`${e.slice(0,31)}...`:e:null}function Mt(t){let e=t.replace(/\\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\\s+/g," ").trim();return e?e.replace(/\\b\\w/g,n=>n.toUpperCase()):t}function Ua(t,e,n){let i=t.getAttribute("data-timeline-label")??t.getAttribute("data-label")??t.getAttribute("aria-label")??null;if(i?.trim())return i.trim();let r=t.getAttribute("data-composition-id");if(r)return Mt(r);let o=t.id;if(o)return Mt(o);let s=Ha(t);if(s)return Mt(s);let l=Ga(Fr(t));if(l)return Mt(l);let a=Wa(t);return a||`${Mt(e)} ${n+1}`}function Nr(t){let n=window.__timelines??{},i=je({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),r=P=>{if(!P)return null;let D=n[P]??null;if(!D||typeof D.duration!="function")return null;try{let O=Number(D.duration());return Number.isFinite(O)&&O>0?O:null}catch{return null}},o=P=>{let D=Ce(P.getAttribute("data-duration"));if(D!=null&&D>0)return D;let O=Ce(P.getAttribute("data-playback-start"))??Ce(P.getAttribute("data-media-start"))??0;return Number.isFinite(P.duration)&&P.duration>O?Math.max(0,(P.duration-O)/Ct(P)):null},s=()=>{let P=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(P.length===0)return null;let D=0;for(let O of P){let se=O.hasAttribute("data-hf-auto-start")?i.resolveStartForElement(O,0):Math.max(0,Number(O.getAttribute("data-start")??0)||0);if(!Number.isFinite(se))continue;let re=o(O);re==null||re<=0||(D=Math.max(D,Math.max(0,se)+re))}return D>0?D:null},l=(P,D)=>{let O=[],se=null,re=null,j=null,q=P.parentElement;for(;q;){let J=q.getAttribute("data-composition-id");J&&(O.push(J),!j&&q!==D&&(j=J),se==null&&(se=i.resolveStartForElement(q,0)),re==null&&(re=Ce(q.getAttribute("data-duration"))??r(J)??null)),q=q.parentElement}return{parentCompositionId:j,compositionAncestors:O.reverse(),inheritedStart:se,inheritedDuration:re}},a=document.querySelector("[data-composition-id]"),c=Array.from(document.querySelectorAll("[data-composition-id]")),u=a?.getAttribute("data-composition-id")??null,m=a?i.resolveStartForElement(a,0):0,f=s(),x=f!=null?Math.max(0,f-Math.max(0,m)):null,w=r(u),g=Un(a??document.body),b=Vn(...c.filter(P=>P!==a).map(P=>{let D=i.resolveStartForElement(P,0),O=i.resolveDurationForElement(P)??r(P.getAttribute("data-composition-id"))??null;return!Number.isFinite(D)||O==null||O<=0?null:Math.max(0,D)+O})),F=b!=null?Math.max(0,b-Math.max(0,m)):null,T=typeof w=="number"&&Number.isFinite(w)&&w>0?w:null,_=typeof g=="number"&&Number.isFinite(g)&&g>0?g:null,Q=typeof x=="number"&&Number.isFinite(x)&&x>0?x:null,H=typeof F=="number"&&Number.isFinite(F)&&F>0?F:null,M=Vn(Q,H),y=T!=null&&M!=null&&T>M+1,C=_??(y?M:Vn(T,Q,H))??null,k=(C!=null?m+C:null)??(typeof f=="number"&&Number.isFinite(f)&&f>0?f:null),G=(P,D)=>!Number.isFinite(D)||D<=0?0:k==null||!Number.isFinite(k)?D:!Number.isFinite(P)||P>=k?0:Math.max(0,Math.min(D,k-P)),z=[],ee=[],R=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),U=0;for(let P=0;P<R.length;P+=1){let D=R[P];if(D===a||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(D.tagName))continue;let O=l(D,a),se=i.resolveStartForElement(D,O.inheritedStart??0),re=D.getAttribute("data-composition-id"),j=Un(D);if((j==null||j<=0)&&re&&re!==u&&(j=r(re)),(j==null||j<=0)&&D instanceof HTMLMediaElement){let we=Ce(D.getAttribute("data-playback-start"))??Ce(D.getAttribute("data-media-start"))??0;Number.isFinite(D.duration)&&D.duration>0&&(j=Math.max(0,D.duration-we))}if(j==null||j<=0){let we=O.inheritedDuration;if(we!=null&&we>0){let Te=(O.inheritedStart??0)+we;j=Math.max(0,Te-se)}}if(j==null||j<=0||(j=G(se,j),j<=0))continue;let q=se+j;U=Math.max(U,q);let J=D.tagName.toLowerCase(),Se=re&&re!==u?"composition":J==="video"?"video":J==="audio"?"audio":J==="img"?"image":"element";z.push({id:D.id||re||null,label:Ua(D,Se,z.length),start:se,duration:j,track:Number.parseInt(D.getAttribute("data-track-index")??D.getAttribute("data-track")??String(P),10)||0,kind:Se,tagName:J,compositionId:D.getAttribute("data-composition-id"),compositionAncestors:O.compositionAncestors,parentCompositionId:O.parentCompositionId,nodePath:null,compositionSrc:Tt(D.getAttribute("data-composition-src")),assetUrl:Fr(D),timelineRole:D.getAttribute("data-timeline-role"),timelineLabel:D.getAttribute("data-timeline-label"),timelineGroup:D.getAttribute("data-timeline-group"),timelinePriority:Ce(D.getAttribute("data-timeline-priority"))})}let Me=new Set(z.map(P=>P.id)),V=a?.getAttribute("data-composition-id")??null,te=V?n[V]??null:null;if(te&&a){let P=te;if(typeof P.getChildren=="function")try{let D=P.getChildren(!0,!0,!1)??[],O=new Map;for(let j of a.children){let q=j;if(!q.id)continue;let J=q.tagName.toLowerCase();J==="script"||J==="style"||J==="link"||O.set(q,{id:q.id,start:1/0,end:-1/0})}let se=j=>{let q=j;for(;q;){if(O.has(q))return q;if(q===a)return null;q=q.parentElement}return null};for(let j of D){if(typeof j.targets!="function"||typeof j.startTime!="function"||typeof j.duration!="function")continue;let q=j.startTime(),J=j.parent;for(;J&&J!==te&&typeof J.startTime=="function";)q+=J.startTime(),J=J.parent;let Se=q+j.duration();if(!(!Number.isFinite(q)||!Number.isFinite(Se)))for(let we of j.targets()){if(!(we instanceof Element))continue;let Be=se(we);if(!Be)continue;let Te=O.get(Be);Te&&(Te.start=Math.min(Te.start,q),Te.end=Math.max(Te.end,Se))}}let re=z.length>0?Math.max(...z.map(j=>j.track))+1:0;for(let[j,q]of O){if(q.start===1/0||q.end===-1/0)continue;let J=j;if(Me.has(J.id))continue;let Se=Math.max(0,q.end-q.start);if(Se<=0)continue;let we=G(q.start,Se);we<=0||(U=Math.max(U,q.start+we),z.push({id:J.id,label:J.getAttribute("data-timeline-label")??J.getAttribute("data-label")??J.getAttribute("aria-label")??J.id,start:q.start,duration:we,track:Number.parseInt(J.getAttribute("data-track-index")??J.getAttribute("data-track")??"",10)||re,kind:"element",tagName:J.tagName.toLowerCase(),compositionId:J.getAttribute("data-composition-id"),compositionAncestors:V?[V]:[],parentCompositionId:V,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:J.getAttribute("data-timeline-role"),timelineLabel:J.getAttribute("data-timeline-label"),timelineGroup:J.getAttribute("data-timeline-group"),timelinePriority:Ce(J.getAttribute("data-timeline-priority"))}),Me.add(J.id))}}catch(D){v("runtime.timeline.site1",D)}}if(a&&C!=null&&C>0){let P=z.length>0?Math.max(...z.map(D=>D.track))+1:0;for(let D of a.children){let O=D;if(!O.id||Me.has(O.id))continue;let se=O.getAttribute("data-timeline-role");if(se!=="overlay"&&se!=="persistent-overlay")continue;let re=O.tagName.toLowerCase();if(re==="script"||re==="style"||re==="link"||re==="meta"||window.getComputedStyle(O).display==="none")continue;let q=G(0,C);q<=0||(U=Math.max(U,q),z.push({id:O.id,label:O.getAttribute("data-timeline-label")??O.getAttribute("data-label")??O.getAttribute("aria-label")??O.id,start:0,duration:q,track:Number.parseInt(O.getAttribute("data-track-index")??O.getAttribute("data-track")??"",10)||P,kind:"element",tagName:re,compositionId:O.getAttribute("data-composition-id"),compositionAncestors:V?[V]:[],parentCompositionId:V,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:se,timelineLabel:O.getAttribute("data-timeline-label"),timelineGroup:O.getAttribute("data-timeline-group"),timelinePriority:Ce(O.getAttribute("data-timeline-priority"))}),Me.add(O.id))}}Ba(z);for(let P of c){if(P===a)continue;let D=P.getAttribute("data-composition-id");if(!D||!Er(D))continue;let O=i.resolveStartForElement(P,0),se=Un(P);if((se==null||se<=0)&&wr(P)!=null){let J=wr(P);se=Math.max(0,J-O)}let re=r(D),j=se&&se>0?se:re;if(j==null||j<=0)continue;let q=G(O,j);q<=0||ee.push({id:D,label:P.getAttribute("data-label")??D,start:O,duration:q,thumbnailUrl:Tt(P.getAttribute("data-thumbnail-url")),avatarName:null})}let W=Math.max(1,U||1,C??0);return{source:"hf-preview",type:"timeline",durationInFrames:y&&_==null?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(W*Math.max(1,t.canonicalFps))),clips:z,scenes:ee,compositionWidth:Ce(a?.getAttribute("data-width"))??1920,compositionHeight:Ce(a?.getAttribute("data-height"))??1080}}var Va=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function zn(t){if(t==null)return null;let e=Number(t);return Number.isFinite(e)?e:null}function za(t,e){let n=t.getAttribute("data-composition-id");if(!n)return null;let i=Number(e[n]?.duration?.());return Number.isFinite(i)&&i>0?i:null}function ja(t){if(!(t instanceof HTMLMediaElement)||!Number.isFinite(t.duration))return null;let e=zn(t.getAttribute("data-playback-start"))??zn(t.getAttribute("data-media-start"))??0;return t.duration>e?t.duration-e:null}function qa(t,e,n,i){let r=zn(t.getAttribute("data-duration"));return r!=null&&r>0?r:za(t,e)??ja(t)??Math.max(0,n-i)}function $a(t){for(let[e,n]of t){let i=e.parentElement;for(;i;){let r=t.get(i);if(r){n.parentId=r.id,r.children.push(n);break}i=i.parentElement}}}function Mr(t){let{startResolver:e,timelineRegistry:n,rootDuration:i}=t,r=new Map,o=document.querySelector("[data-composition-id]"),s=0;for(let l of document.querySelectorAll("[data-start]")){if(l===o||Va.has(l.tagName))continue;let a=e.resolveStartForElement(l,0);if(qa(l,n,i,a)<=0)continue;let c={id:l.id||`__clip-${s++}`,element:l,parentId:null,children:[]};r.set(l,c)}return $a(r),{roots:Array.from(r.values()).filter(l=>l.parentId===null)}}var ce=ba(Zo(),1),es=ce.default,Mm=ce.default.stringify,Tm=ce.default.fromJSON,_m=ce.default.plugin,Lm=ce.default.parse,vm=ce.default.list,km=ce.default.document,Rm=ce.default.comment,Dm=ce.default.atRule,Im=ce.default.rule,Pm=ce.default.decl,Om=ce.default.root,Bm=ce.default.CssSyntaxError,Hm=ce.default.Declaration,Gm=ce.default.Container,Wm=ce.default.Processor,Um=ce.default.Document,Vm=ce.default.Comment,zm=ce.default.Warning,jm=ce.default.AtRule,qm=ce.default.Result,$m=ce.default.Input,Km=ce.default.Rule,Jm=ce.default.Root,Ym=ce.default.Node;var xi="data-hf-authored-id";function gi(t){return t.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function yi(t){return t.replace(/\\\\/g,"\\\\\\\\").replace(/"/g,\'\\\\"\')}function hu(t){return t&&t.replace(/[^a-zA-Z0-9_-]/g,n=>`\\\\${n}`).replace(/^-?\\d/,n=>`\\\\${n}`)}function ts(t){let e=t.trim();return e?Array.from(new Set([e,hu(e)])).filter(Boolean):[]}function xu(t){return!!t&&/[\\w-]/.test(t)}function gu(t,e,n){let i=ts(e).sort((l,a)=>a.length-l.length);if(i.length===0)return t;let r="",o=0,s=null;for(let l=0;l<t.length;l+=1){let a=t[l],c=l>0?t[l-1]:"";if(s){r+=a,a===s&&c!=="\\\\"&&(s=null);continue}if(a===\'"\'||a==="\'"){s=a,r+=a;continue}if(a==="["){o+=1,r+=a;continue}if(a==="]"){o=Math.max(0,o-1),r+=a;continue}if(a==="#"&&o===0){let u=i.find(m=>t.startsWith(m,l+1));if(u){let m=t[l+1+u.length];if(!xu(m)){r+=n,l+=u.length;continue}}}r+=a}return r}function yu(t,e){let n=e?.trim();return n?gu(t,n,`[${xi}="${yi(n)}"]`):t}function bu(t,e,n,i,r){let o=yu(t,i),s=Su(o,e,n),l=s.trim();if(!l||/^(html|body|:root|\\*)$/i.test(l))return t;let a=new RegExp(`\\\\[\\\\s*data-composition-id\\\\s*=\\\\s*(["\'])${gi(n)}\\\\1\\\\s*\\\\]`,"g");if(a.test(l))return s.replace(a,e);let c=s.match(/^\\s*/)?.[0]??"",u=s.match(/\\s*$/)?.[0]??"";if(r){let m=i?`[${xi}="${yi(i)}"]`:null;if(m&&l.startsWith(m)){let f=l.slice(m.length);return`${c}${e}${m}${f}${u}`}}return`${c}${e} ${l}${u}`}function Su(t,e,n){let i=gi(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 t.replace(new RegExp(`${r}(?:${o})+`,"g"),e).replace(new RegExp(`(?:${o})+${r}`,"g"),e)}var Au=new Set(["keyframes","-webkit-keyframes","font-face"]);function Eu(t){return t?.type==="atrule"}function wu(t){let e=t.parent;for(;e;){if(Eu(e)&&Au.has(e.name.toLowerCase()))return!0;e=e.parent}return!1}function bi(t,e,n,i,r){let o=e.trim();if(!t||!o)return t;let s=n||`[data-composition-id="${yi(o)}"]`,l=es.parse(t);return l.walkRules(a=>{wu(a)||(a.selectors=a.selectors.map(c=>bu(c,s,o,i,r?.compoundAuthoredRoot)))}),l.toResult({map:!1}).css}function ns(t,e,n="[HyperFrames] composition script error:",i,r=e,o){let s=JSON.stringify(e),l=JSON.stringify(r),a=JSON.stringify(n),c=gi(e),u=JSON.stringify(o?.trim()||null),m=JSON.stringify(i??null),f=JSON.stringify(String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${c}"|\'${c}\')\\s*\\]`),x=JSON.stringify(String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`),w=JSON.stringify(ts(o?.trim()||""));return`(function(){\n var __hfCompId = ${s};\n var __hfTimelineCompId = ${l};\n var __hfErrorLabel = ${a};\n var __hfAuthoredRootId = ${u};\n var __hfAuthoredRootAttr = ${JSON.stringify(xi)};\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 = ${w};\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 return Reflect.get(target, prop === __hfCompId ? __hfTimelineCompId : prop, target);\n },\n set: function(target, prop, value, receiver) {\n return Reflect.set(target, prop === __hfCompId ? __hfTimelineCompId : prop, value, target);\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 return Reflect.get(target, prop, target);\n },\n set: function(target, prop, value, receiver) {\n if (prop === "__timelines") {\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${t.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})();`}function is(){if(typeof document>"u")return{};let t=Si(document.documentElement),e=Cu();return{...t,...e}}function Si(t){if(!t)return{};let e=t.getAttribute("data-composition-variables");if(!e)return{};let n;try{n=JSON.parse(e)}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}function Cu(){if(typeof window>"u")return{};let t=window.__hfVariables;return!t||typeof t!="object"||Array.isArray(t)?{}:t}var Fu=8e3,Nu=/^(?![a-zA-Z][a-zA-Z\\d+\\-.]*:)(?!\\/\\/)(?!\\/)(?!\\.\\.?\\/).+/;function Mu(t,e){return`${t}__hf${e}`}var Tu=t=>new Promise(e=>{let n=!1,i=Date.now(),r=null,o=s=>{n||(n=!0,r!=null&&window.clearTimeout(r),e({status:s,elapsedMs:Math.max(0,Date.now()-i)}))};t.addEventListener("load",()=>o("load"),{once:!0}),t.addEventListener("error",()=>o("error"),{once:!0}),r=window.setTimeout(()=>o("timeout"),Fu)});function Ai(t){for(;t.firstChild;)t.removeChild(t.firstChild);t.textContent=""}var _u=["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 Lu(t){let e=document.importNode(t,!0),n=e.getAttribute("id")?.trim();for(let o of _u)e.removeAttribute(o);n&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",n)),e.setAttribute("data-hf-inner-root","true");let i=e.getAttribute("data-width"),r=e.getAttribute("data-height");return e.style.width=i?`${i}px`:"100%",e.style.height=r?`${r}px`:"100%",e}function rs(t,e){let n=t.trim();if(!n)return t;try{return Nu.test(n)?new URL(n,document.baseURI).toString():e?new URL(n,e).toString():new URL(n,document.baseURI).toString()}catch{return t}}function vu(t){let e=t.getAttribute("data-variable-values");if(!e)return{};let n;try{n=JSON.parse(e)}catch{return{}}return!n||typeof n!="object"||Array.isArray(n)?{}:n}function Sn(t){let e=(t.getAttribute("data-composition-id")||"").trim()||null;return{authoredCompositionId:(t.getAttribute("data-hf-original-composition-id")||e||"").trim()||null,runtimeCompositionId:e}}function ku(t){let e=new Map;for(let n of t){let i=Sn(n).authoredCompositionId||"";i&&e.set(i,(e.get(i)||0)+1)}return e}function os(t){let e=Sn(t).authoredCompositionId;return e?!!document.querySelector(`template#${CSS.escape(e)}-template`):!1}function Ru(t){return!!t.querySelector(\'[data-hf-inner-root="true"]\')}function Du(t){return t.hasAttribute("data-composition-src")?!0:os(t)?t.children.length===0||t.hasAttribute("data-hf-original-composition-id")?!0:Ru(t):!1}function wi(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(e=>e.hasAttribute("data-composition-src")?!0:os(e))}function ss(){let t=window.__hfVariablesByComp;if(!t)return;let e=new Set(wi().map(n=>Sn(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(t))e.has(n)||delete t[n]}function as(t,e=ku(t)){let n=new Map,i=new Map;for(let r of t){let{authoredCompositionId:o,runtimeCompositionId:s}=Sn(r),l=Du(r);if(!o){i.set(r,{authoredCompositionId:null,runtimeCompositionId:s});continue}let a=(e.get(o)||0)>1,c=s||o;if(l){let u=a?(n.get(o)||0)+1:0;a&&n.set(o,u),c=a?Mu(o,u):o,a?r.setAttribute("data-hf-original-composition-id",o):r.removeAttribute("data-hf-original-composition-id"),r.setAttribute("data-composition-id",c),s&&s!==c&&window.__hfVariablesByComp&&delete window.__hfVariablesByComp[s]}i.set(r,{authoredCompositionId:o,runtimeCompositionId:c})}return i}async function Ei(t){let e=null;t.authoredCompositionId&&(e=Array.from(t.sourceNode.querySelectorAll("[data-composition-id]")).find(x=>x.getAttribute("data-composition-id")===t.authoredCompositionId)??null);let n=e??t.sourceNode,i=e?.getAttribute("data-composition-id")?.trim()||t.authoredCompositionId||null,r=t.runtimeCompositionId||i||null,o=e?.getAttribute("id")?.trim()||null,s=r?`[data-composition-id="${CSS.escape(r)}"]`:void 0;if(t.headLinks)for(let f of t.headLinks){let x=f.getAttribute("href")||"";x&&(document.head.querySelector(`link[href="${CSS.escape(x)}"]`)||document.head.appendChild(f.cloneNode(!0)))}if(t.headStyles)for(let f of t.headStyles){let x=f.cloneNode(!0);x instanceof HTMLStyleElement&&(i&&(x.textContent=bi(x.textContent||"",i,s,o)),document.head.appendChild(x),t.injectedStyles.push(x))}let l=Array.from(n.querySelectorAll("style"));for(let f of l){let x=f.cloneNode(!0);x instanceof HTMLStyleElement&&(i&&(x.textContent=bi(x.textContent||"",i,s,o)),document.head.appendChild(x),t.injectedStyles.push(x))}let a=[];if(t.headScripts)for(let f of t.headScripts){let x=f.getAttribute("type")?.trim()??"",w=f.getAttribute("src")?.trim()??"";if(w){let g=rs(w,t.compositionUrl);a.push({kind:"external",src:g,type:x})}else{let g=f.textContent?.trim()??"";g&&a.push({kind:"inline",content:g,type:x,scopeCompositionId:i})}}let c=Array.from(n.querySelectorAll("script")),u=[...a];for(let f of c){let x=f.getAttribute("type")?.trim()??"",w=f.getAttribute("src")?.trim()??"";if(w){let g=rs(w,t.compositionUrl);u.push({kind:"external",src:g,type:x})}else{let g=f.textContent?.trim()??"";g&&u.push({kind:"inline",content:g,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(e){let f=e.getAttribute("data-width"),x=e.getAttribute("data-height"),w=t.parseDimensionPx(f),g=t.parseDimensionPx(x);f&&t.host.setAttribute("data-width",f),x&&t.host.setAttribute("data-height",x),w&&t.host instanceof HTMLElement&&(t.host.style.width=w),g&&t.host instanceof HTMLElement&&(t.host.style.height=g),e.hasAttribute("data-timeline-locked")&&t.host.setAttribute("data-timeline-locked",""),t.host.appendChild(Lu(e))}else t.hasTemplate?t.host.appendChild(document.importNode(n,!0)):t.host.innerHTML=t.fallbackBodyInnerHtml;if(r){let f={...t.declaredVariableDefaults??{},...vu(t.host)};Object.keys(f).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[r]=f):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[r]}for(let f of u){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=ns(f.content,f.scopeCompositionId,"[HyperFrames] composition script error:",s,r||f.scopeCompositionId,o):x.textContent=`(function(){${f.content}})();`,document.body.appendChild(x),t.injectedScripts.push(x),f.kind==="external"){let w=await Tu(x);w.status!=="load"&&t.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:t.authoredCompositionId,runtimeCompositionId:t.runtimeCompositionId,hostCompositionSrc:t.hostCompositionSrc,resolvedScriptSrc:f.src,loadStatus:w.status,elapsedMs:w.elapsedMs}})}}}async function ls(t){let e=wi();if(ss(),e.length===0)return;let n=as(e),i=e.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),s=o?.authoredCompositionId;if(!s)continue;let l=document.querySelector(`template#${CSS.escape(s)}-template`);Ai(r),await Ei({host:r,authoredCompositionId:s,runtimeCompositionId:o?.runtimeCompositionId||s,hostCompositionSrc:`template#${s}-template`,sourceNode:l.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:t.injectedStyles,injectedScripts:t.injectedScripts,parseDimensionPx:t.parseDimensionPx,onDiagnostic:t.onDiagnostic})}}async function us(t){let e=wi();if(ss(),e.length===0)return;let n=as(e),i=e.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 s=n.get(r),l=s?.authoredCompositionId||null,a=s?.runtimeCompositionId||l||null,c=null;try{c=new URL(o,document.baseURI)}catch{c=null}Ai(r);try{let u=l!=null?document.querySelector(`template#${CSS.escape(l)}-template`):null;if(u){await Ei({host:r,authoredCompositionId:l,runtimeCompositionId:a,hostCompositionSrc:o,sourceNode:u.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:c,injectedStyles:t.injectedStyles,injectedScripts:t.injectedScripts,parseDimensionPx:t.parseDimensionPx,onDiagnostic:t.onDiagnostic});return}let m=await fetch(o);if(!m.ok)throw new Error(`HTTP ${m.status}`);let f=await m.text(),w=new DOMParser().parseFromString(f,"text/html"),g=(l?w.querySelector(`template#${CSS.escape(l)}-template`):null)??w.querySelector("template"),b=g?g.content:w.body,F=g?void 0:Array.from(w.head.querySelectorAll("style")),T=g?void 0:Array.from(w.head.querySelectorAll("script")),_=g?void 0:Array.from(w.head.querySelectorAll(\'link[rel="stylesheet"], link[rel="preconnect"]\'));await Ei({host:r,authoredCompositionId:l,runtimeCompositionId:a,hostCompositionSrc:o,sourceNode:b,hasTemplate:!!g,fallbackBodyInnerHtml:w.body.innerHTML,compositionUrl:c,injectedStyles:t.injectedStyles,injectedScripts:t.injectedScripts,parseDimensionPx:t.parseDimensionPx,headStyles:F,headScripts:T,headLinks:_,declaredVariableDefaults:Si(w.documentElement),onDiagnostic:t.onDiagnostic})}catch(u){t.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:l,runtimeCompositionId:a,hostCompositionSrc:o,errorMessage:u instanceof Error?u.message:"unknown_error"}}),Ai(r)}}))}function Iu(t){return t instanceof HTMLElement?t.dataset.captionWrapper!=="true"?t:t.querySelector(":scope > span")??null:null}function Pu(){let t=[],e=document.querySelectorAll(".caption-group");for(let n of e)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&&t.push(r)}return t}function Ou(t){let e=t.parentElement;if(e?.dataset.captionWrapper==="true")return e;let n=document.createElement("span");return n.style.display="inline-block",n.dataset.captionWrapper="true",t.parentNode?.insertBefore(n,t),n.appendChild(t),n}function Ci(){let t=window.gsap;t&&document.querySelectorAll(".caption-group").length!==0&&fetch("caption-overrides.json").then(e=>e.ok?e.json():null).then(e=>{if(!e||!Array.isArray(e)||e.length===0)return;let n=Pu();for(let i of e){let r=null;if(i.wordId&&(r=Iu(document.getElementById(i.wordId))),!r&&i.wordIndex!==void 0&&(r=n[i.wordIndex]??null),!r)continue;let o={},s={};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&&(s.opacity=i.opacity),i.fontSize!==void 0&&(s.fontSize=`${i.fontSize}px`),i.fontWeight!==void 0&&(s.fontWeight=i.fontWeight),i.fontFamily!==void 0&&(s.fontFamily=i.fontFamily),i.activeColor||i.dimColor){let a=t.getTweensOf(r).filter(u=>u.vars.color!==void 0).sort((u,m)=>u.startTime()-m.startTime()),c=a.length>0?String(a[0].vars.color):"";for(let u of a)String(u.vars.color)===c?i.dimColor&&(u.vars.color=i.dimColor):i.activeColor&&(u.vars.color=i.activeColor);i.dimColor&&t.set(r,{color:i.dimColor})}if(Object.keys(s).length>0&&t.set(r,s),Object.keys(o).length>0){let l=Ou(r);t.set(l,o)}}}).catch(()=>{})}var Kt="data-color-grading",Bu="rec709",Ye={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,saturation:0},cs=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","saturation"],Hu=[{id:"neutral",label:"Neutral",adjust:{...Ye}},{id:"warm-clean",label:"Warm Clean",adjust:{...Ye,exposure:.05,contrast:.08,highlights:-.08,shadows:.08,temperature:.16,saturation:.06}},{id:"cool-clean",label:"Cool Clean",adjust:{...Ye,contrast:.06,highlights:-.06,shadows:.06,temperature:-.12,tint:.04,saturation:.04}},{id:"soft-boost",label:"Soft Boost",adjust:{...Ye,exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,saturation:.1}},{id:"bright-pop",label:"Bright Pop",adjust:{...Ye,exposure:.12,contrast:.12,whites:.08,blacks:-.04,saturation:.14}},{id:"deep-contrast",label:"Deep Contrast",adjust:{...Ye,exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}}],Gu=new Map(Hu.map(t=>[t.id,t])),Wu=/^\\$(?:\\{([A-Za-z0-9_.:-]+)\\}|([A-Za-z0-9_.:-]+))$/,Uu={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},saturation:{min:-1,max:1}};function $t(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Vu(t,e,n){return Number.isFinite(t)?Math.min(n,Math.max(e,t)):0}function ds(t,e){let n=typeof t=="number"?t:Number(t);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):e}function zu(t,e){let n=typeof t=="number"?t:Number(t);if(!Number.isFinite(n))return 0;let i=Uu[e];return Vu(n,i.min,i.max)}function ju(t){if(t==null)return null;let e=String(t).trim();return e||null}function qu(t){if(t==null)return null;if(typeof t=="string"){let n=t.trim();return n?{src:n,intensity:1}:null}if(!$t(t))return null;let e=t.src;return typeof e!="string"||e.trim()===""?null:{src:e.trim(),intensity:ds(t.intensity,1)}}function $u(t){if(typeof t=="string"){let e=t.trim();if(!e)return null;if(e.startsWith("{"))try{let n=JSON.parse(e);return $t(n)?n:null}catch{return null}return{preset:e,intensity:1}}return $t(t)?t:null}function Ku(t,e){let n=t.trim().match(Wu);if(!n)return t;let i=n[1]??n[2]??"";return i&&Object.hasOwn(e,i)?e[i]:t}function Fi(t,e){if(typeof t=="string"){let i=Ku(t,e);if(i!==t)return i;let r=t.trim();if(!r.startsWith("{"))return t;try{return Fi(JSON.parse(r),e)}catch{return t}}if(!$t(t))return t;let n={};for(let[i,r]of Object.entries(t))n[i]=Fi(r,e);return n}function Ju(t){return t?Gu.get(t)??null:null}function Ni(t){let e=$u(t);if(!e||e.enabled===!1)return null;let n=ju(e.preset),r=Ju(n)?.adjust??Ye,o=$t(e.adjust)?e.adjust:{},s=cs.reduce((l,a)=>(l[a]=zu(o[a]??r[a],a),l),{...Ye});return{enabled:!0,preset:n,intensity:ds(e.intensity,1),adjust:s,lut:qu(e.lut),colorSpace:typeof e.colorSpace=="string"&&e.colorSpace.trim()?e.colorSpace.trim():Bu}}function fs(t,e){return Ni(Fi(t,e))}function Jt(t){return!t?.enabled||t.intensity===0?!1:t.lut&&t.lut.intensity!==0?!0:cs.some(e=>Math.abs(t.adjust[e])>1e-4)}var Ee=class extends Error{constructor(n,i=null){super(i==null?n:`${n} at line ${i}`);xe(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=i}},Yu=[0,0,0],Xu=[1,1,1],Qu=64;function Zu(t){let e=!1;for(let n=0;n<t.length;n++){let i=t[n];if(i===\'"\'&&(e=!e),i==="#"&&!e)return t.slice(0,n)}return t}function pt(t,e){let n=Number(t);if(!Number.isFinite(n))throw new Ee(`Invalid number "${t}"`,e);return n}function ms(t,e,n){if(t.length!==3)throw new Ee(`${e} expects three numbers`,n);return[pt(t[0],n),pt(t[1],n),pt(t[2],n)]}function ps(t,e,n){if(!t)throw new Ee(`${e} expects a size`,n);let i=Number(t);if(!Number.isInteger(i)||i<2)throw new Ee(`${e} must be an integer greater than 1`,n);return i}function ec(t,e){if(e[0]<=t[0]||e[1]<=t[1]||e[2]<=t[2])throw new Ee("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function tc(t){let e=/^TITLE\\s+"([^"]*)"\\s*$/i.exec(t);if(e)return e[1]??null;let n=/^TITLE\\s+(.+)\\s*$/i.exec(t);return n&&(n[1]??"").trim()||null}function nc(t){return/^[+-]?(?:\\d|\\.\\d)/.test(t)}function hs(t,e={}){let n=e.maxSize??Qu,i=null,r=Yu,o=Xu,s=null,l=null,a=[],c=t.replace(/^\\uFEFF/,"").split(/\\r?\\n/);for(let m=0;m<c.length;m++){let f=m+1,x=Zu(c[m]??"").trim();if(!x)continue;let w=x.split(/\\s+/),g=(w[0]??"").toUpperCase(),b=w.slice(1);if(g==="TITLE"){i=tc(x);continue}if(g==="DOMAIN_MIN"){r=ms(b,g,f);continue}if(g==="DOMAIN_MAX"){o=ms(b,g,f);continue}if(g==="LUT_1D_SIZE"){s=ps(b[0],g,f);continue}if(g==="LUT_3D_SIZE"){if(l=ps(b[0],g,f),l>n)throw new Ee(`LUT_3D_SIZE ${l} exceeds max ${n}`,f);continue}if(!nc(g)){if(g.startsWith("LUT_"))throw new Ee(`Unsupported cube keyword ${g}`,f);continue}if(!l)throw s?new Ee("1D cube LUTs are not supported yet",f):new Ee("LUT data appears before LUT_3D_SIZE",f);if(w.length!==3)throw new Ee("LUT data rows must contain three numbers",f);a.push(pt(w[0],f),pt(w[1],f),pt(w[2],f))}if(s&&l)throw new Ee("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw s?new Ee("1D cube LUTs are not supported yet"):new Ee("Missing LUT_3D_SIZE");ec(r,o);let u=l*l*l;if(a.length!==u*3)throw new Ee(`Expected ${u} LUT rows for size ${l}, found ${a.length/3}`);return{title:i,size:l,domainMin:r,domainMax:o,data:new Float32Array(a)}}function ic(t){return Number.isFinite(t)?Math.min(1,Math.max(0,t)):0}function Mi(t){return Math.round(ic(t)*255)}function xs(t){let e=t.size,n=e*e,i=e,r=new Uint8Array(n*i*4);for(let o=0;o<e;o++)for(let s=0;s<e;s++)for(let l=0;l<e;l++){let a=((o*e+s)*e+l)*3,c=(s*n+o*e+l)*4;r[c]=Mi(t.data[a]??0),r[c+1]=Mi(t.data[a+1]??0),r[c+2]=Mi(t.data[a+2]??0),r[c+3]=255}return{width:n,height:i,data:r}}var An=new Map,rc="data-hf-color-grading-canvas",As="data-hf-color-grading-source-hidden",oc="__hf_color_grading_canvas__",sc=64,Yt={enabled:!1,position:.5,softness:0,lineWidth:2};function ac(t){let e=window,i=t.closest("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()??"",r=i?e.__hfVariablesByComp?.[i]:void 0;if(r)return r;let o=e.__hyperframes?.getVariables?.();return o&&typeof o=="object"?o:e.__hfVariables??{}}function Ti(t){let e=t.getAttribute(Kt);return e==null?null:fs(e,ac(t))}var lc=["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`),uc=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform sampler2D u_lut;","uniform vec2 u_resolution;","uniform vec2 u_uvScale;","uniform vec2 u_uvOffset;","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_saturation;","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)); }","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 sampleColor = texture2D(u_source, uv);"," vec3 original = sampleColor.rgb;"," vec3 color = original * 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;"," color += u_blacks * 0.25 * (1.0 - smoothstep(0.0, 0.35, y));"," color += u_whites * 0.25 * smoothstep(0.65, 1.0, y);"," 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);"," 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);"," 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`);function ot(t){return t instanceof HTMLVideoElement||t instanceof HTMLImageElement}function gs(t,e,n){let i=t.createShader(n);return i?(t.shaderSource(i,e),t.compileShader(i),t.getShaderParameter(i,t.COMPILE_STATUS)?i:(v("runtime.colorGrading.compileShader",t.getShaderInfoLog(i)),t.deleteShader(i),null)):null}function cc(t){let e=gs(t,lc,t.VERTEX_SHADER),n=gs(t,uc,t.FRAGMENT_SHADER);if(!e||!n)return e&&t.deleteShader(e),n&&t.deleteShader(n),null;let i=t.createProgram();return i?(t.attachShader(i,e),t.attachShader(i,n),t.linkProgram(i),t.deleteShader(e),t.deleteShader(n),t.getProgramParameter(i,t.LINK_STATUS)?i:(v("runtime.colorGrading.linkProgram",t.getProgramInfoLog(i)),t.deleteProgram(i),null)):null}function ys(t,e=t.LINEAR){let n=t.createTexture();return n?(t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null),n):null}function dc(t){let e=t.getContext("webgl",{alpha:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!0});if(!e)return null;let n=cc(e),i=ys(e),r=ys(e,e.NEAREST);if(!n||!i||!r)return n&&e.deleteProgram(n),i&&e.deleteTexture(i),r&&e.deleteTexture(r),null;let o=e.createBuffer();return o?(e.bindBuffer(e.ARRAY_BUFFER,o),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),e.STATIC_DRAW),{gl:e,program:{program:n,texture:i,lutTexture:r,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),lut:e.getUniformLocation(n,"u_lut"),resolution:e.getUniformLocation(n,"u_resolution"),uvScale:e.getUniformLocation(n,"u_uvScale"),uvOffset:e.getUniformLocation(n,"u_uvOffset"),lutEnabled:e.getUniformLocation(n,"u_lutEnabled"),lutSize:e.getUniformLocation(n,"u_lutSize"),lutTextureSize:e.getUniformLocation(n,"u_lutTextureSize"),lutDomainMin:e.getUniformLocation(n,"u_lutDomainMin"),lutDomainMax:e.getUniformLocation(n,"u_lutDomainMax"),lutIntensity:e.getUniformLocation(n,"u_lutIntensity"),exposure:e.getUniformLocation(n,"u_exposure"),contrast:e.getUniformLocation(n,"u_contrast"),highlights:e.getUniformLocation(n,"u_highlights"),shadows:e.getUniformLocation(n,"u_shadows"),whites:e.getUniformLocation(n,"u_whites"),blacks:e.getUniformLocation(n,"u_blacks"),temperature:e.getUniformLocation(n,"u_temperature"),tint:e.getUniformLocation(n,"u_tint"),saturation:e.getUniformLocation(n,"u_saturation"),intensity:e.getUniformLocation(n,"u_intensity"),compareEnabled:e.getUniformLocation(n,"u_compareEnabled"),comparePosition:e.getUniformLocation(n,"u_comparePosition"),compareSoftness:e.getUniformLocation(n,"u_compareSoftness"),compareLineWidth:e.getUniformLocation(n,"u_compareLineWidth")}}):(e.deleteProgram(n),e.deleteTexture(i),e.deleteTexture(r),null)}function fc(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function mc(t){if(!fc(t))return{...Yt};let e=(n,i,r,o)=>{let s=typeof n=="number"?n:Number(n);return Math.min(o,Math.max(r,Number.isFinite(s)?s:i))};return{enabled:t.enabled===!0,position:e(t.position,Yt.position,0,1),softness:e(t.softness,Yt.softness,0,.25),lineWidth:e(t.lineWidth,Yt.lineWidth,0,12)}}function Es(t){try{let e=new URL(t,document.baseURI);return e.protocol==="data:"?{href:e.href}:e.protocol!=="http:"&&e.protocol!=="https:"?{error:"LUT must be project-local or a data URL"}:e.origin!==window.location.origin?{error:"Remote LUT URLs are not supported"}:{href:e.href}}catch{return{error:"Invalid LUT URL"}}}function Li(t){return t instanceof Error?t.message:"LUT failed to load"}function pc(t){let e=Es(t);if("error"in e)return{state:"error",message:e.error};let n=An.get(e.href);if(n)return n;let i=fetch(e.href,{credentials:"same-origin"}).then(o=>{if(!o.ok)throw new Error(`Failed to load LUT (${o.status})`);return o.text()}).then(o=>hs(o,{maxSize:sc})),r={state:"pending",promise:i};return An.set(e.href,r),i.then(o=>An.set(e.href,{state:"ready",lut:o}),o=>An.set(e.href,{state:"error",message:Li(o)})),r}function bs(t,e,n){if(t.lut?.src===e)return t.lut;let i=xs(n),{gl:r,program:o}=t;try{return r.activeTexture(r.TEXTURE1),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),t.lut={src:e,title:n.title,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:i.width,textureHeight:i.height},t.lutError=null,t.lutLoadingSrc=null,t.lut}catch(s){return t.lut=null,t.lutError=Li(s),t.lutLoadingSrc=null,v("runtime.colorGrading.uploadLut",s),null}}function hc(t){let e=t.grading.lut?.src.trim()??"",n=t.grading.lut?.intensity??1;if(!e||n<=0)return t.lut=null,t.lutLoadingSrc=null,t.lutError=null,null;let i=Es(e);if("error"in i)return t.lut=null,t.lutLoadingSrc=null,t.lutError=i.error,null;if(t.lut?.src===i.href)return t.lut;t.lut=null;let r=pc(e);return r.state==="ready"?bs(t,i.href,r.lut):r.state==="error"?(t.lutError=r.message,t.lutLoadingSrc=null,null):(t.lutLoadingSrc!==i.href&&(t.lutLoadingSrc=i.href,t.lutError=null,r.promise.then(o=>{t.destroyed||t.grading.lut?.src.trim()!==e||(bs(t,i.href,o),We(t))},o=>{t.destroyed||t.grading.lut?.src.trim()!==e||(t.lut=null,t.lutError=Li(o),t.lutLoadingSrc=null,We(t))})),null)}function _i(t){if(!t)return null;if(typeof t=="string"){let e=t.trim();if(!e)return null;let n=document.getElementById(e.replace(/^#/,""));if(n&&ot(n))return n;try{let i=document.querySelector(e);return i&&ot(i)?i:null}catch{return null}}if(t.hfId){let e=document.querySelector(`[data-hf-id="${CSS.escape(t.hfId)}"]`);if(e&&ot(e))return e}if(t.id){let e=document.getElementById(t.id);if(e&&ot(e))return e}if(!t.selector)return null;try{let e=Array.from(document.querySelectorAll(t.selector)),n=Math.max(0,Math.floor(Number(t.selectorIndex??0)||0)),i=e[n]??null;return i&&ot(i)?i:null}catch{return null}}function xc(t){return t instanceof HTMLVideoElement?t.videoWidth>0&&t.videoHeight>0?{width:t.videoWidth,height:t.videoHeight}:null:t instanceof HTMLImageElement&&t.naturalWidth>0&&t.naturalHeight>0?{width:t.naturalWidth,height:t.naturalHeight}:null}function ws(t){return t instanceof HTMLVideoElement?t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&t.videoWidth>0&&t.videoHeight>0:t instanceof HTMLImageElement?t.complete&&t.naturalWidth>0&&t.naturalHeight>0:!1}function gc(t){if(!t.id)return null;let e=document.getElementById(`__render_frame_${t.id}__`);return e instanceof HTMLImageElement&&ws(e)?e:null}function yc(t){if(t instanceof HTMLVideoElement){let e=gc(t);if(e)return e}return ws(t)?t:null}function Ss(t,e){let n=t.toLowerCase();if(n==="center")return .5;if(e==="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 bc(t){let e=t.trim().split(/\\s+/).filter(Boolean),n=.5,i=.5;for(let r=0;r<e.length;r++){let o=e[r]??"",s=Ss(o,"x"),l=Ss(o,"y");if(s!==null&&(o==="left"||o==="right"||o.endsWith("%")&&r===0)){n=s;continue}if(l!==null&&(o==="top"||o==="bottom"||o.endsWith("%")&&r>0)){i=l;continue}}return{x:n,y:i}}function Sc(t,e,n,i,r,o){if(t<=0||e<=0||n<=0||i<=0)return{scaleX:1,scaleY:1,offsetX:0,offsetY:0};let s=r||"fill",l=t,a=e;if(s==="contain"||s==="cover"||s==="scale-down"){let f=s==="cover"?Math.max(t/n,e/i):Math.min(t/n,e/i);l=n*f,a=i*f,s==="scale-down"&&l>n&&a>i&&(l=n,a=i)}else s==="none"&&(l=n,a=i);let c=bc(o||"center"),u=(t-l)*c.x/t,m=(e-a)*c.y/e;return{scaleX:l/t,scaleY:a/e,offsetX:u,offsetY:m}}function Ac(t,e){window.getComputedStyle(e).position==="static"&&(t.touchedParent||(t.touchedParent=e,t.parentInlinePosition=e.style.position||null),e.style.position="relative")}function Ec(t,e){let{element:n,canvas:i}=t,r=n.parentElement;r&&Ac(t,r);let o=window.getComputedStyle(e);yr(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=t.sourceOpacityForCanvas,i.style.visibility=t.sourceVisibleForCanvas?"visible":"hidden";let s=n.getBoundingClientRect(),l=Math.max(0,Math.round(n.offsetWidth||s.width)),a=Math.max(0,Math.round(n.offsetHeight||s.height));return l<=0||a<=0?(i.style.display="none",null):(i.width!==l&&(i.width=l),i.height!==a&&(i.height=a),{width:l,height:a})}function wc(t,e,n,i,r,o,s){t.uniform1i(e.source,0),t.uniform1i(e.lut,1),t.uniform2f(e.resolution,o.width,o.height),t.uniform2f(e.uvScale,s.scaleX,s.scaleY),t.uniform2f(e.uvOffset,s.offsetX,s.offsetY),t.uniform1f(e.lutEnabled,i?1:0),t.uniform1f(e.lutSize,i?.size??2),t.uniform2f(e.lutTextureSize,i?.textureWidth??1,i?.textureHeight??1),t.uniform3f(e.lutDomainMin,i?.domainMin[0]??0,i?.domainMin[1]??0,i?.domainMin[2]??0),t.uniform3f(e.lutDomainMax,i?.domainMax[0]??1,i?.domainMax[1]??1,i?.domainMax[2]??1),t.uniform1f(e.lutIntensity,n.lut?.intensity??0),t.uniform1f(e.exposure,n.adjust.exposure),t.uniform1f(e.contrast,n.adjust.contrast),t.uniform1f(e.highlights,n.adjust.highlights),t.uniform1f(e.shadows,n.adjust.shadows),t.uniform1f(e.whites,n.adjust.whites),t.uniform1f(e.blacks,n.adjust.blacks),t.uniform1f(e.temperature,n.adjust.temperature),t.uniform1f(e.tint,n.adjust.tint),t.uniform1f(e.saturation,n.adjust.saturation),t.uniform1f(e.intensity,n.intensity),t.uniform1f(e.compareEnabled,r.enabled?1:0),t.uniform1f(e.comparePosition,r.position),t.uniform1f(e.compareSoftness,r.softness),t.uniform1f(e.compareLineWidth,r.lineWidth)}function Cc(t){t.sourceHidden||(t.sourceInlineOpacity=t.element.style.getPropertyValue("opacity")||null,t.sourceInlineOpacityPriority=t.element.style.getPropertyPriority("opacity")),t.element.setAttribute(As,"true"),t.element.style.setProperty("opacity","0","important"),t.sourceHidden=!0}function We(t){if(t.destroyed)return!1;let e=yc(t.element);if(!e)return t.hasDrawn||(t.canvas.style.display="none"),!1;let n=xc(e);if(!n)return!1;let i=e instanceof HTMLElement?e:t.element,r=t.element.style.getPropertyValue("opacity"),o=t.element.style.getPropertyPriority("opacity"),s=t.sourceHidden&&r==="0"&&o==="important",l=t.element.style.getPropertyValue("visibility");if(!s){let x=window.getComputedStyle(t.element);t.sourceOpacityForCanvas=x.opacity||"1",t.sourceVisibleForCanvas=l!=="hidden"&&x.visibility!=="hidden"}let a=Ec(t,i);if(!a)return!1;let c=window.getComputedStyle(i),u=Sc(a.width,a.height,n.width,n.height,c.objectFit,c.objectPosition),{gl:m,program:f}=t;try{let x=hc(t);return m.viewport(0,0,a.width,a.height),m.useProgram(f.program),m.activeTexture(m.TEXTURE0),m.bindTexture(m.TEXTURE_2D,f.texture),m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,!0),m.texImage2D(m.TEXTURE_2D,0,m.RGBA,m.RGBA,m.UNSIGNED_BYTE,e),m.activeTexture(m.TEXTURE1),m.bindTexture(m.TEXTURE_2D,f.lutTexture),wc(m,f,t.grading,x,t.compare,a,u),m.enableVertexAttribArray(f.position),m.vertexAttribPointer(f.position,2,m.FLOAT,!1,0,0),m.drawArrays(m.TRIANGLE_STRIP,0,4),Cc(t),t.hasDrawn=!0,!0}catch(x){return v("runtime.colorGrading.drawEntry",x),!1}}function Xe(t,e,n,i){e.addEventListener(n,i),t.cleanup.push(()=>e.removeEventListener(n,i))}function Fc(t){t.animationFrame!==null&&(window.cancelAnimationFrame(t.animationFrame),t.animationFrame=null),t.videoFrameHandle!==null&&t.element instanceof HTMLVideoElement&&(t.element.cancelVideoFrameCallback?.(t.videoFrameHandle),t.videoFrameHandle=null)}function Xt(t){if(t.destroyed||!(t.element instanceof HTMLVideoElement)||t.videoFrameHandle!==null||t.animationFrame!==null)return;let e=t.element,n=e;if(typeof n.requestVideoFrameCallback=="function"){t.videoFrameHandle=n.requestVideoFrameCallback(()=>{t.videoFrameHandle=null,We(t),!t.destroyed&&!e.paused&&!e.ended&&Xt(t)});return}t.animationFrame=window.requestAnimationFrame(()=>{t.animationFrame=null,We(t),!t.destroyed&&!e.paused&&!e.ended&&Xt(t)})}function Nc(t){let e=()=>{We(t)};Xe(t,t.element,"load",e),Xe(t,t.element,"loadedmetadata",e),Xe(t,t.element,"loadeddata",e),Xe(t,t.element,"seeked",e),Xe(t,t.element,"timeupdate",e),Xe(t,window,"resize",e),t.element instanceof HTMLVideoElement&&(Xe(t,t.element,"play",()=>Xt(t)),Xe(t,t.element,"pause",e)),typeof ResizeObserver<"u"&&(t.resizeObserver=new ResizeObserver(e),t.resizeObserver.observe(t.element))}function Mc(t){if(!t.destroyed){t.destroyed=!0,Fc(t),t.resizeObserver?.disconnect();for(let e of t.cleanup)e();if(t.cleanup.length=0,t.canvas.remove(),t.gl.deleteTexture(t.program.texture),t.gl.deleteTexture(t.program.lutTexture),t.gl.deleteProgram(t.program.program),t.sourceHidden){t.element.removeAttribute(As);let e=t.element.style.getPropertyValue("opacity"),n=t.element.style.getPropertyPriority("opacity");e==="0"&&n==="important"&&(t.sourceInlineOpacity===null?t.element.style.removeProperty("opacity"):t.element.style.setProperty("opacity",t.sourceInlineOpacity,t.sourceInlineOpacityPriority))}t.touchedParent&&(t.parentInlinePosition===null?t.touchedParent.style.removeProperty("position"):t.touchedParent.style.position=t.parentInlinePosition)}}function Tc(t){let e=document.createElement("canvas");return e.className=oc,e.setAttribute(rc,"true"),e.setAttribute("data-hyperframes-ignore",""),e.setAttribute("data-hyperframes-picker-ignore",""),e.setAttribute("data-hf-ignore",""),e.setAttribute("aria-hidden","true"),e.style.pointerEvents="none",e.style.display="none",t.parentNode?.insertBefore(e,t.nextSibling),e}function Cs(){let t=new WeakMap,e=new Set,n=null,i=!1,r=(g,b,F)=>{let T=t.get(g);if(T)return T.grading=b,T.source=F,We(T),g instanceof HTMLVideoElement&&!g.paused&&Xt(T),!0;let _=Tc(g),Q=dc(_);if(!Q)return _.remove(),!1;let H={element:g,canvas:_,gl:Q.gl,program:Q.program,grading:b,compare:{...Yt},lut:null,lutLoadingSrc:null,lutError:null,source:F,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(g).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(g).visibility!=="hidden",hasDrawn:!1,destroyed:!1};return t.set(g,H),e.add(g),Nc(H),We(H),g instanceof HTMLVideoElement&&!g.paused&&Xt(H),!0},o=(g,b)=>{if(i)return!1;let F=_i(g);if(!F)return!1;let T=t.get(F);if(!T){let _=Ti(F);if(!Jt(_)||!r(F,_,"attribute"))return!1;T=t.get(F)}return T?(T.compare=mc(b),We(T),!0):!1},s=g=>{let b=t.get(g);b&&(Mc(b),t.delete(g),e.delete(g))},l=()=>{if(i)return 0;let g=new Set;document.querySelectorAll(`video[${Kt}], img[${Kt}]`).forEach(F=>{if(!ot(F))return;g.add(F);let T=Ti(F);Jt(T)?r(F,T,"attribute"):s(F)});for(let F of Array.from(e)){let T=t.get(F);T&&(!F.isConnected||T.source==="attribute"&&!g.has(F))&&s(F)}return e.size},a=()=>{if(i)return 0;let g=0;for(let b of Array.from(e,F=>t.get(F)))b&&We(b)&&(g+=1);return g},c=(g,b)=>{if(i)return!1;let F=_i(g);if(!F)return!1;let T=Ni(b);return Jt(T)?r(F,T,"live"):(s(F),!0)},u=(g,b)=>{if(!ot(g))return!1;let F=t.get(g);return F?(F.sourceVisibleForCanvas=b,!0):!1},m=g=>{let b=_i(g);if(!b)return{state:"missing",message:"Media not found"};let F=t.get(b);if(F)return F.lutError?{state:"unavailable",message:F.lutError}:F.grading.lut&&F.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:F.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:F.lut?"Shader + LUT active":"Shader active"};let T=Ti(b);return Jt(T)?{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},f=()=>{if(!i){i=!0,n?.disconnect(),n=null;for(let g of Array.from(e))s(g)}};document.body&&(n=new MutationObserver(()=>l()),n.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[Kt]}));let x={refresh:l,redraw:a,setGrading:c,setCompare:o,setSourceVisibility:u,getStatus:m,destroy:f},w=window;return w.__hf=w.__hf||{},w.__hf.colorGrading=x,l(),x}var En=class{constructor(e){xe(this,"_baseTime",0);xe(this,"_playStartMs",null);xe(this,"_rate",1);xe(this,"_duration",1/0);xe(this,"_nowMs");xe(this,"_audioSource",null);this._baseTime=e?.initialTime??0,this._rate=e?.rate??1,this._duration=e?.duration??1/0,this._nowMs=e?.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:s}=this._audioSource;!r.paused&&Number.isFinite(r.currentTime)&&(i=(r.currentTime-s)/(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 e=(this._nowMs()-this._playStartMs)/1e3,n=this._baseTime+e*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(e){let n=Number.isFinite(this._duration)?Math.max(0,Math.min(e,this._duration)):Math.max(0,e);this._baseTime=n,this._playStartMs!==null&&(this._playStartMs=this._nowMs())}isPlaying(){return this._playStartMs!==null}setRate(e){let n=Number.isFinite(e)&&e>0?Math.max(.1,Math.min(5,e)):1;this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs()),this._rate=n}getRate(){return this._rate}setDuration(e){this._duration=Number.isFinite(e)&&e>0?e:1/0,this._baseTime>this._duration&&(this._baseTime=this._duration)}getDuration(){return this._duration}attachAudioSource(e){this._audioSource=e}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:e}=this._audioSource;if(!e.paused&&Number.isFinite(e.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 Fs(t){return!Number.isFinite(t)||t<=0?1:t}function _c(t,e){let{elapsed:n,mediaStart:i,scheduledAt:r,safeRate:o,clipDuration:s}=e,l=Number.isFinite(s)&&s>0,a=s*o;if(n>=0){let u=a-n;return l&&u<=0?!1:(l?t.start(0,n+i,u):t.start(0,n+i),!0)}let c=-n/o;return l?t.start(r+c,i,a):t.start(r+c,i),!0}var wn=class{constructor(){xe(this,"_ctx",null);xe(this,"_bufferCache",new Map);xe(this,"_failedSrcs",new Set);xe(this,"_activeSources",[]);xe(this,"_masterGain",null);xe(this,"_rateAnchorCtx",0);xe(this,"_rateAnchorComp",0);xe(this,"_rate",1);xe(this,"_paused",!0);xe(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(e){let n=e.currentSrc||e.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;try{let i=await fetch(n);if(!i.ok)return this._failedSrcs.add(n),v("webAudioTransport.fetch",new Error(`${i.status} ${n}`)),null;let r=await i.arrayBuffer(),o=await this._ctx.decodeAudioData(r);return this._bufferCache.set(n,o),o}catch(i){return this._failedSrcs.add(n),v("webAudioTransport.decode",i),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}async schedulePlayback(e,n,i,r,o,s,l,a=1,c=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||l!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),l!==this._playGeneration)return null;let u=Fs(a),m=this._ctx.createBufferSource();m.buffer=n,m.playbackRate.value=u;let f=this._ctx.createGain();f.gain.value=s,m.connect(f),f.connect(this._masterGain);let x=o-i,w=this._ctx.currentTime;if(this._rate=u,this._rateAnchorCtx=w,this._rateAnchorComp=o,!_c(m,{elapsed:x,mediaStart:r,scheduledAt:w,safeRate:u,clipDuration:c}))return m.disconnect(),f.disconnect(),null;let g=e.muted;e.muted=!0;let b={el:e,sourceNode:m,gainNode:f,compositionStart:i,mediaStart:r,scheduledAt:w,priorMuted:g,bounded:Number.isFinite(c)&&c>0};return this._activeSources.push(b),this._paused=!1,m.addEventListener("ended",()=>{let F=this._activeSources.indexOf(b);F!==-1&&(this._activeSources.splice(F,1),e.muted=g,this._activeSources.length===0&&(this._paused=!0))}),b}catch(u){return v("webAudioTransport.schedule",u),null}}setRate(e){let n=Fs(e);if(n===this._rate)return!1;this._ctx&&!this._paused&&(this._rateAnchorComp=this.getTime(),this._rateAnchorCtx=this._ctx.currentTime),this._rate=n;for(let i of this._activeSources)try{i.sourceNode.playbackRate.value=n}catch(r){v("webAudioTransport.setRate",r)}return!0}hasBoundedActiveSources(){return this._activeSources.some(e=>e.bounded)}stopAll(){for(let e of this._activeSources){try{e.sourceNode.stop(),e.sourceNode.disconnect(),e.gainNode.disconnect()}catch{}e.el.muted=e.priorMuted}this._activeSources=[],this._paused=!0}setVolume(e){this._masterGain&&(this._masterGain.gain.value=Math.max(0,Math.min(1,e)))}setElementVolume(e,n){let i=Math.max(0,Math.min(1,n));for(let r of this._activeSources)if(r.el===e)try{r.gainNode.gain.value=i}catch(o){v("webAudioTransport.setElementVolume",o)}}setMuted(e){this._masterGain&&(this._masterGain.gain.value=e?0:1)}isActive(){return this._activeSources.length>0&&!this._paused}destroy(){if(this.stopAll(),this._bufferCache.clear(),this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null}};var Ns="data-hf-studio-manual-edit-gesture";var Ms="data-hf-authored-duration",Ts="data-hf-authored-end";function _s(){let t=Ar(),e=null,n=null,i=null,r=[],o=new Set,s=null;if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(d){v("runtime.init.site1",d)}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"),window.__timelines=window.__timelines||{};let l=d=>{r.push(d)},a=(d,p,h)=>{let S=h??`${d}:${JSON.stringify(p)}`;o.has(S)||(o.add(S),Ae({source:"hf-preview",type:"diagnostic",code:d,details:p}))},c=d=>{let p={scale:1,focusX:960,focusY:540},h=[],S=[],E={time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:d.play,pause:d.pause,seek:d.seek,getTime:d.getTime,getDuration:d.getDuration,isPlaying:d.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>p,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>h,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:d.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>S,getRenderState:()=>({...E,time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying()})}},u=1/60,m=.75,f=2,x=.05,w=100,g=240,b=d=>{if(d instanceof Error)return d.message||String(d);if(typeof d=="string")return d;try{return JSON.stringify(d)}catch{return String(d??"")}},F=d=>{let p=d.toLowerCase();return p.includes("cannot read properties of null")||p.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:p.includes("failed to execute \'queryselector\'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:p.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},T=d=>{if(d==null||d.trim()==="")return null;let p=Number.parseFloat(d);return!Number.isFinite(p)||p<=0?null:`${p}px`},_=()=>{let d=document.querySelector(\'[data-composition-id][data-root="true"]\');if(d instanceof HTMLElement)return d;let p=Array.from(document.querySelectorAll("[data-composition-id]"));return p.length===0?null:p.find(h=>!h.parentElement?.closest("[data-composition-id]"))??p[0]??null},Q=()=>{let d=_();if(!d)return;let p=T(d.getAttribute("data-width")),h=T(d.getAttribute("data-height"));p&&(d.style.width=p),h&&(d.style.height=h),p&&d.style.setProperty("--comp-width",p),h&&d.style.setProperty("--comp-height",h)},H=()=>{let d=_(),p=Array.from(document.querySelectorAll("[data-composition-id]")).filter(h=>h.hasAttribute("data-duration")||h.hasAttribute("data-end"));for(let h of p){if(d&&h===d)continue;let S=h.getAttribute("data-duration"),E=h.getAttribute("data-end");S!=null&&!h.hasAttribute(Ms)&&h.setAttribute(Ms,S),E!=null&&!h.hasAttribute(Ts)&&h.setAttribute(Ts,E),h.removeAttribute("data-duration"),h.removeAttribute("data-end")}},M=()=>{let d=_();if(!d)return;d.style.position||(d.style.position="relative"),d.style.overflow="hidden";let p=T(d.getAttribute("data-width")),h=T(d.getAttribute("data-height"));p&&(d.style.width=p),h&&(d.style.height=h);let S=Array.from(d.children);for(let E of S){let L=E.tagName.toLowerCase();if(L==="script"||L==="style"||L==="link"||L==="meta"||!E.hasAttribute("data-start"))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%",$=/translate\\(\\s*-50%\\s*,\\s*-50%\\s*\\)/.test(E.style.transform);if(I&&$&&!E.hasAttribute("data-width")&&!E.hasAttribute("data-height")){let ze=E.style.top,ge=E.style.left,St=E.style.width,le=E.style.height;E.style.top="",E.style.left="",E.style.width="",E.style.height="";let X=window.getComputedStyle(E);X.top!=="auto"||X.bottom!=="auto"||X.left!=="auto"||X.right!=="auto"||X.width!=="0px"||X.height!=="0px"||(E.style.top=ze,E.style.left=ge,E.style.width=St,E.style.height=le)}let Y=window.getComputedStyle(E),Z=Y.position;if(Z!=="absolute"&&Z!=="fixed"&&(E.style.position="absolute"),!!E.style.top||!!E.style.bottom||Y.top!=="auto"||Y.bottom!=="auto"||(E.style.top="0"),!!E.style.left||!!E.style.right||Y.left!=="auto"||Y.right!=="auto"||(E.style.left="0"),L!=="audio"){let ze=T(E.getAttribute("data-width")),ge=T(E.getAttribute("data-height")),St=Y.width!=="0px"&&Y.width!=="auto",le=Y.height!=="0px"&&Y.height!=="auto";ze?!E.style.width&&!St&&(E.style.width=ze):!E.style.width&&Y.width==="0px"&&(E.style.width="100%"),ge?!E.style.height&&!le&&(E.style.height=ge):!E.style.height&&Y.height==="0px"&&(E.style.height="100%")}}},y=(d,p=0,h)=>je({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:h?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(d,p),A=(d,p)=>je({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:p?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(d),C=(d,p=0)=>!d.hasAttribute("data-hf-auto-start")&&d.hasAttribute("data-start")?Math.max(0,Number(d.getAttribute("data-start")??0)||0):y(d,p),N=(d,p)=>{let h=d.parentElement;for(;h&&h!==p;){if(h.hasAttribute("data-start"))return h;h=h.parentElement}return null},k=(d,p)=>{let h=d.tagName.toLowerCase();if(h==="script"||h==="style"||h==="link"||h==="meta")return!1;let S=h==="video"||h==="audio"?C(d,0):y(d,0),E=A(d),L=d.getAttribute("data-composition-id");if(L){let $=(window.__timelines??{})[L],Y=null;if($&&typeof $.duration=="function"){let ae=Number($.duration());Number.isFinite(ae)&&ae>0&&(Y=ae)}let Z=d.hasAttribute("data-composition-src")||d.hasAttribute("data-composition-file");E!=null&&E>0&&Y!=null&&!Z?E=Math.min(E,Y):(E==null||E<=0)&&Y!=null&&(E=Y)}let I=E!=null&&E>0?S+E:Number.POSITIVE_INFINITY;return p>=S&&(Number.isFinite(I)?p<=I:!0)},G=!!document.querySelector("[data-composition-src]"),z=!1;{let d=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let p of d){let h=p.getAttribute("data-composition-id");if(h&&p.children.length===0&&document.querySelector(`template#${CSS.escape(h)}-template`)){z=!0;break}}}let ee=!G&&!z,R=d=>{if(!d||typeof d.duration!="function")return null;try{let p=Number(d.duration());return Number.isFinite(p)?Math.max(0,p):null}catch{return null}},U=d=>typeof d=="number"&&Number.isFinite(d)&&d>u,Me=d=>{let p=Number(d.getAttribute("data-duration"));if(Number.isFinite(p)&&p>0)return p;let h=Number(d.getAttribute("data-playback-start")??d.getAttribute("data-media-start")??"0"),S=Number.isFinite(h)?Math.max(0,h):0;return Number.isFinite(d.duration)&&d.duration>S?Math.max(0,d.duration-S):null},V=()=>{let d=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(d.length===0)return null;let p=0;for(let h of d){let S=C(h,0);if(!Number.isFinite(S))continue;let E=Me(h);E==null||E<=u||(p=Math.max(p,Math.max(0,S)+E))}return p>u?p:null},te=()=>{let d=_();if(!d)return null;let p=window.__timelines??{},h=je({timelineRegistry:p,includeAuthoredTimingAttrs:!0}),S=0,E=Number.parseFloat(d.getAttribute("data-duration")??"");Number.isFinite(E)&&E>0&&(S=E);let L=Array.from(d.querySelectorAll("[data-composition-id][data-start]"));for(let I of L){if(!(I instanceof Element)||I.parentElement?.closest("[data-composition-id]")!==d)continue;let Y=h.resolveStartForElement(I,0),Z=h.resolveDurationForElement(I);!Number.isFinite(Y)||Z==null||Z<=0||(S=Math.max(S,Math.max(0,Y)+Z))}return S>u?S:null},W=()=>{let d=V();return typeof d!="number"||!Number.isFinite(d)||d<=u?null:d},ie=d=>U(d)?Math.max(u,d*m):u,pe=(d,p=0)=>{let h=R(d),S=W(),E=te(),L=Math.max(S??0,E??0),I=Number.isFinite(p)&&p>u?p:0,$=0;return U(h)?$=Math.max(h,L,I):U(L)?$=Math.max(L,I):$=I,$>0?Math.max(0,$):0},P=()=>{let d=window.__timelines??{},p=je({timelineRegistry:d,includeAuthoredTimingAttrs:!0}),h=W(),S=te(),E=Math.max(h??0,S??0)||null,L=ie(E),I=le=>{let X=document.querySelector(`[data-composition-id="${CSS.escape(le)}"]`);return X?p.resolveStartForElement(X,0):0},$=le=>{let X=window.gsap;if(!X||typeof X.timeline!="function")return null;let fe=X.timeline({paused:!0});for(let ye of le)fe.add(ye.timeline,I(ye.compositionId));return fe},Y=(le,X)=>{if(!U(le))return null;let fe=window.gsap;if(!fe||typeof fe.timeline!="function")return null;let ye=fe.timeline({paused:!0});if(X)try{ye.add(X,0)}catch(ue){v("runtime.init.site2",ue)}let be=ye;if(typeof be.to=="function")try{be.to({},{duration:le})}catch(ue){v("runtime.init.site3",ue)}return ye},Z=(le,X)=>{let fe=le;if(typeof fe.getChildren!="function")return[];try{let ye=fe.getChildren(!0,!0,!0)??[];if(!Array.isArray(ye))return[];let be=[];for(let ue of X)if(!ye.some(ve=>ve===ue.timeline))try{let ve=I(ue.compositionId);le.add(ue.timeline,ve),be.push(ue.compositionId)}catch(ve){v("runtime.init.site4",ve)}return be}catch{return[]}},ae=_(),de=ae?.getAttribute("data-composition-id")??null;if(!de)return{timeline:null};let Fe=d[de]??null,ge=(()=>{if(!ae)return[];let le=new Set,X=Array.from(ae.querySelectorAll("[data-composition-id]")),fe=[];for(let ye of X){let be=ye.getAttribute("data-composition-id");if(!be||be===de||le.has(be))continue;le.add(be);let ue=d[be]??null;if(!ue||typeof ue.play!="function"||typeof ue.pause!="function")continue;let Ne=R(ue);fe.push({compositionId:be,timeline:ue,durationSeconds:Ne??0})}return fe})(),St=le=>{for(let X of le){let fe=X.timeline;if(typeof fe.paused=="function")try{fe.paused(!1)}catch(ye){v("runtime.init.site5",ye)}}};if(ge.length>0&&St(ge),Fe){let le=ge.length>0?Z(Fe,ge):[];if((ge.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id=\'"+de+"\'])"))&&(D=!0),le.length>0)try{let ue=Fe.time();Fe.seek(ue,!1)}catch{}let X=R(Fe);if(!U(X)&&ge.length>0){let ue=ge.map(da=>da.compositionId),Ne=$(ge),ve=R(Ne);if(Ne&&U(ve))return{timeline:Ne,selectedTimelineIds:ue,selectedDurationSeconds:ve,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:de,rootDurationSeconds:X,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:L,selectedDurationSeconds:ve,mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:S,selectedTimelineIds:ue,autoNestedChildren:le}}};let Dn=Y(E??0,Fe),In=R(Dn);if(Dn&&U(In))return{timeline:Dn,selectedTimelineIds:[de],selectedDurationSeconds:In,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:de,rootDurationSeconds:X,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:S,selectedDurationSeconds:In,selectedTimelineIds:[de],autoNestedChildren:le}}}}if(!U(X)&&ge.length===0){let ue=Y(E??0,Fe),Ne=R(ue);if(ue&&U(Ne))return{timeline:ue,selectedTimelineIds:[de],selectedDurationSeconds:Ne,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:de,rootDurationSeconds:X,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:S,selectedDurationSeconds:Ne,selectedTimelineIds:[de]}}}}let fe=ae?.getAttribute("data-duration"),ye=fe?parseFloat(fe):null,be=Math.max(U(ye)?ye:0,S??0);if(be>0&&U(be)&&U(X)&&be>=X+.5){let ue=Fe;if(typeof ue.to=="function")try{ue.to({},{duration:0},be)}catch(ve){v("runtime.init.site6",ve)}let Ne=R(Fe);if(U(Ne))return{timeline:Fe,selectedTimelineIds:[de],selectedDurationSeconds:Ne,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:de,rootDurationSeconds:X,rootDeclaredDur:ye,authoredCompositionDurationFloorSeconds:S,newDur:Ne}}}}return{timeline:Fe,selectedTimelineIds:[de],selectedDurationSeconds:X,mediaDurationFloorSeconds:h,diagnostics:le.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:de,selectedDurationSeconds:X,autoNestedChildren:le}}:void 0}}if(ge.length>0){let le=ge.map(ye=>ye.compositionId),X=$(ge),fe=R(X);if(X)return{timeline:X,selectedTimelineIds:le,selectedDurationSeconds:fe,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:de,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:L,selectedDurationSeconds:fe,mediaDurationFloorSeconds:h,selectedTimelineIds:le}}}}return{timeline:null}},D=!1,O=()=>{if(!ee)return!1;let d=t.capturedTimeline,p=R(d),h=U(p);if(d&&h&&D)return!1;let S=P();if(!S.timeline)return!1;if(d&&d===S.timeline)return typeof d.timeScale=="function"&&d.timeScale(t.playbackRate),!1;t.capturedTimeline=S.timeline,typeof t.capturedTimeline.timeScale=="function"&&t.capturedTimeline.timeScale(t.playbackRate);let E=pe(t.capturedTimeline,0);if(E>0){try{B.setDuration(E)}catch{}t.capturedTimeline.pause();let L=Math.max(0,t.currentTime||0);typeof t.capturedTimeline.totalTime=="function"&&t.capturedTimeline.totalTime(L,!1);let I=window.__hfStudioManualEditsApply;typeof I=="function"&&I()}if(S.diagnostics&&Ae({source:"hf-preview",type:"diagnostic",code:S.diagnostics.code,details:S.diagnostics.details}),Ae({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:S.selectedTimelineIds??[],selectedDurationSeconds:S.selectedDurationSeconds??null,mediaDurationFloorSeconds:S.mediaDurationFloorSeconds??null}}),window.parent!==window){let L=_(),I=E>0?E:0,$=String(I>0?I:1),Y=new Set;if(t.capturedTimeline.getChildren)try{for(let Z of t.capturedTimeline.getChildren(!0))if(typeof Z.targets=="function")for(let ae of Z.targets())ae instanceof HTMLElement&&ae!==L&&(ae.hasAttribute("data-start")||N(ae,L)||Y.has(ae)||(Y.add(ae),ae.setAttribute("data-start","0"),ae.setAttribute("data-duration",$)))}catch{}if(L instanceof HTMLElement)for(let Z of L.querySelectorAll("[id]"))Z instanceof HTMLElement&&Z!==L&&(Z.hasAttribute("data-start")||N(Z,L)||Y.has(Z)||Z.tagName==="SCRIPT"||Z.tagName==="STYLE"||Z.tagName==="LINK"||(Y.add(Z),Z.setAttribute("data-start","0"),Z.setAttribute("data-duration",$)))}for(let L of Be)Te.delete(L),Hi(L);return!0};window.__hfForceTimelineRebind=()=>{D=!1,O()};let se=()=>{let d=_();if(!(d instanceof HTMLElement))return;let p=d.getBoundingClientRect(),h=Number(d.getAttribute("data-width")),S=Number(d.getAttribute("data-height")),E=window.getComputedStyle(d),L=Number.isFinite(h)&&h>0&&Number.isFinite(S)&&S>0,I=p.width<=0||p.height<=0||d.clientWidth<=0||d.clientHeight<=0;!L||!I||a("root_stage_layout_zero",{compositionId:d.getAttribute("data-composition-id")??null,declaredWidth:h,declaredHeight:S,rectWidth:Math.round(p.width),rectHeight:Math.round(p.height),clientWidth:d.clientWidth,clientHeight:d.clientHeight,display:E.display,visibility:E.visibility,overflow:E.overflow},`root-stage-layout-zero:${d.getAttribute("data-composition-id")??"unknown"}`)},re=()=>{t.tornDown||(s!=null&&window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{s=null,se()}))},j=()=>{n=d=>{let p=b(d.error??d.message).slice(0,g);if(!p)return;let h=F(p);Ae({source:"hf-preview",type:"diagnostic",code:h.code,details:{category:h.category,message:p,filename:d.filename||null,line:Number.isFinite(d.lineno)?d.lineno:null,column:Number.isFinite(d.colno)?d.colno:null}})},i=d=>{let p=b(d.reason).slice(0,g);if(!p)return;let h=F(p);Ae({source:"hf-preview",type:"diagnostic",code:`${h.code}_unhandled_rejection`,details:{category:`${h.category}-unhandled-rejection`,message:p}})},window.addEventListener("error",n),window.addEventListener("unhandledrejection",i)},q=()=>{let d=Array.from(document.querySelectorAll("img, video, audio, source, link[rel=\'stylesheet\']"));for(let h of d){let S=()=>{if(!(h instanceof Element))return;let E=h.tagName.toLowerCase(),L=h.getAttribute("src")??h.getAttribute("href")??h.getAttribute("poster")??null,I=E==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";a(I,{tagName:E,assetUrl:L,currentSrc:(h instanceof HTMLImageElement||h instanceof HTMLMediaElement)&&h.currentSrc||null,readyState:h instanceof HTMLMediaElement?h.readyState:null,networkState:h instanceof HTMLMediaElement?h.networkState:null},`${I}:${E}:${L??"unknown"}`)};h.addEventListener("error",S),l(()=>{h.removeEventListener("error",S)})}let p=document.fonts;p&&p.ready.then(()=>{if(t.tornDown)return;let h=Array.from(p).filter(S=>S.status==="error").map(S=>S.family).filter(S=>!!S).slice(0,10);h.length!==0&&a("runtime_font_load_issue",{failedFamilies:h,totalFaces:Array.from(p).length},`runtime-font-load-issue:${h.join("|")}`)}).catch(()=>{})},J=(d,p)=>{if(!d.timeline)return!1;let h=t.capturedTimeline;if(h&&h===d.timeline)return!1;let S=Math.max(0,t.currentTime||0),E=t.isPlaying;t.capturedTimeline=d.timeline,typeof t.capturedTimeline.timeScale=="function"&&t.capturedTimeline.timeScale(t.playbackRate);try{t.capturedTimeline.pause(),t.capturedTimeline.seek(S,!1),E&&t.capturedTimeline.play()}catch(L){v("runtime.init.site7",L)}return Ae({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:p,previousTime:S,selectedTimelineIds:d.selectedTimelineIds??[],selectedDurationSeconds:d.selectedDurationSeconds??null,mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),!0},Se=null,we=!1,Be=new Set,Te=new WeakMap,en=()=>{t.tornDown||(Se!=null&&window.clearTimeout(Se),Se=window.setTimeout(()=>{if(t.tornDown)return;Se=null;let d=P();if(!d.timeline||!U(d.mediaDurationFloorSeconds??null))return;if(!t.capturedTimeline){O()&&(st(),_e(!0));return}if(we)return;let h=R(t.capturedTimeline),S=d.selectedDurationSeconds??R(d.timeline);U(S)&&(!U(h)||S>=h+x)&&J(d,"manual")&&(we=!0,Ae({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:h??null,selectedDurationSeconds:S??null,selectedTimelineIds:d.selectedTimelineIds??[],mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),st(),_e(!0))},w))},na=()=>{for(let d of Be)d.removeEventListener("loadedmetadata",en),d.removeEventListener("durationchange",en);Be.clear()},_n=()=>{if(t.tornDown)return;let d=Array.from(document.querySelectorAll("video, audio"));for(let p of d){if(Be.has(p))continue;Be.add(p);let h=Number.parseFloat(p.dataset.volume??"");Number.isFinite(h)&&(p.volume=Math.max(0,Math.min(1,h))),p.addEventListener("loadedmetadata",en),p.addEventListener("durationchange",en),p.preload!=="auto"&&(p.preload="auto"),p.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&p.load(),Hi(p)}},Hi=d=>{Te.has(d)||pr(d,t.capturedTimeline,pe(t.capturedTimeline,0),Te)},Ve=()=>{let d=L=>{let I=L.closest("[data-composition-id]"),$=I?y(I,0):null,Y=I?A(I,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:I,inheritedStart:$,inheritedDuration:Y}},p=hr({shouldIncludeElement:L=>L.hasAttribute("data-start")||!!d(L).compositionRoot,resolveStartSeconds:L=>{let I=d(L);return C(L,I.inheritedStart??0)},resolveDurationSeconds:L=>{let I=d(L),$=C(L,I.inheritedStart??0),Y=Number.parseFloat(L.dataset.playbackStart??L.dataset.mediaStart??"0")||0,Z=I.inheritedStart!=null&&I.inheritedDuration!=null&&I.inheritedDuration>0?Math.max(0,I.inheritedStart+I.inheritedDuration-$):null,ae=Number.isFinite(L.duration)&&L.duration>Y?Math.max(0,L.duration-Y):null,de=Number.parseFloat(L.dataset.duration??""),Fe=Number.isFinite(de)&&de>0?de:null,ze=[ae,Z,Fe].filter(ge=>ge!=null);return ze.length>0?Math.min(...ze):null}});for(let L of p.mediaClips){let I=Te.get(L.el);I&&(L.volumeKeyframes=I)}let h=t.mediaForceSyncNextTick;h&&(t.mediaForceSyncNextTick=!1),xr({clips:p.mediaClips,timeSeconds:t.currentTime,playing:t.isPlaying,playbackRate:t.playbackRate,outputMuted:t.mediaOutputMuted||he.isActive(),userMuted:t.bridgeMuted,userVolume:t.bridgeVolume,forceSync:h,onElementVolume:(L,I)=>he.setElementVolume(L,I),onAutoplayBlocked:()=>{t.mediaAutoplayBlockedPosted||(t.mediaAutoplayBlockedPosted=!0,Ae({source:"hf-preview",type:"media-autoplay-blocked"}))}});let S=Array.from(document.querySelectorAll("[data-start]")),E=_();for(let L of S){if(!(L instanceof HTMLElement))continue;let I=k(L,t.currentTime);if(I&&window.parent!==window){let $=L.parentElement;for(;$&&$!==E;){if($ instanceof HTMLElement&&$.hasAttribute("data-start")&&!k($,t.currentTime)){I=!1;break}$=$.parentElement}}L.style.visibility=I?"visible":"hidden",(L instanceof HTMLVideoElement||L instanceof HTMLImageElement)&&e?.setSourceVisibility(L,I)}},_e=d=>{let p=Math.max(0,Math.round((t.currentTime||0)*t.canonicalFps)),h=Date.now();(d||p!==t.bridgeLastPostedFrame||t.isPlaying!==t.bridgeLastPostedPlaying||t.bridgeMuted!==t.bridgeLastPostedMuted||h-t.bridgeLastPostedAt>=t.bridgeMaxPostIntervalMs)&&(t.bridgeLastPostedFrame=p,t.bridgeLastPostedPlaying=t.isPlaying,t.bridgeLastPostedMuted=t.bridgeMuted,t.bridgeLastPostedAt=h,Ae({source:"hf-preview",type:"state",frame:p,isPlaying:t.isPlaying,muted:t.bridgeMuted,playbackRate:t.playbackRate}))},Gi="",ia=()=>{let d="";for(let p of document.querySelectorAll("[data-start]"))d+=`${p.id}:${p.tagName}|`;return d},st=()=>{H(),Q(),M();let d=_();if(d){let S=T(d.getAttribute("data-width")),E=T(d.getAttribute("data-height")),L=S?parseInt(S,10):0,I=E?parseInt(E,10):0;L>0&&I>0&&Ae({source:"hf-preview",type:"stage-size",width:L,height:I})}O();let p=Nr({canonicalFps:t.canonicalFps});window.__clipManifest=p;let h=ia();if(!window.__clipTree||Gi!==h){let S=window;window.__clipTree=Mr({startResolver:je({timelineRegistry:S.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:S.__timelines??{},rootDuration:p.durationInFrames/t.canonicalFps}),Gi=h}Ae(p),re()},Ie=(d,p=0)=>{for(let h of t.deterministicAdapters){try{d==="discover"&&h.discover(),d==="pause"&&h.pause(),d==="play"&&h.play&&h.play()}catch(S){v("runtime.init.site8",S)}if(d==="discover")try{h.seek({time:p})}catch(S){v("runtime.init.site9",S)}}},et=()=>{window.__renderReady=!1},yt=null,bt=!0,ra=()=>{let d=[];for(let p of t.deterministicAdapters){let h=p.getReadyPromise;if(typeof h=="function")try{let S=h();S&&d.push(S)}catch(S){v("runtime.init.adapterReady",S)}}return d},oa=()=>{let d=ra();if(d.length===0)return yt=null,bt=!0,!0;let p=d.length===1?d[0]:Promise.all(d);return p!==yt&&(yt=p,bt=!1,Promise.resolve(p).then(()=>{yt===p&&(bt=!0,et())},h=>{yt===p&&(bt=!0,v("runtime.init.adapterReady",h),et())})),bt};if(ee)Ci();else{let d={injectedStyles:t.injectedCompStyles,injectedScripts:t.injectedCompScripts,parseDimensionPx:T,onDiagnostic:({code:p,details:h})=>{Ae({source:"hf-preview",type:"diagnostic",code:p,details:h})}};us(d).then(()=>ls(d)).finally(()=>{ee=!0,_n(),q(),Ci(),et()})}let tn=gr({postMessage:d=>Ae(d)});tn.installPickerApi();let He=Cs();e=He,l(()=>{He.destroy(),e=null});let Ln=d=>{let p=Number(d);!Number.isFinite(p)||p<=0?t.playbackRate=1:t.playbackRate=Math.max(.1,Math.min(5,p)),t.mediaForceSyncNextTick=!0,t.capturedTimeline&&typeof t.capturedTimeline.timeScale=="function"&&t.capturedTimeline.timeScale(t.playbackRate);let h=document.querySelectorAll("video, audio");for(let S of h)if(S instanceof HTMLMediaElement)try{S.playbackRate=t.playbackRate}catch(E){v("runtime.init.site10",E)}},me=Sr({getTimeline:()=>t.capturedTimeline,setTimeline:d=>{t.capturedTimeline=d},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>t.isPlaying,setIsPlaying:d=>{t.isPlaying!==d&&(t.mediaForceSyncNextTick=!0),t.isPlaying=d},getPlaybackRate:()=>t.playbackRate,setPlaybackRate:Ln,getCanonicalFps:()=>t.canonicalFps,onSyncMedia:(d,p)=>{t.currentTime=Math.max(0,Number(d)||0),t.isPlaying!==p&&(t.mediaForceSyncNextTick=!0),t.isPlaying=p,Ve()},onStatePost:_e,onDeterministicSeek:d=>{for(let p of t.deterministicAdapters)try{p.seek({time:Number(d)||0})}catch(h){v("runtime.init.site11",h)}},onDeterministicPause:()=>Ie("pause"),onDeterministicPlay:()=>Ie("play"),onRenderFrameSeek:()=>{He.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>pe(t.capturedTimeline,0)});window.__player=c(me),window.__playerReady=!0,Ki(Ae),At("composition_loaded",{duration:me.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),t.controlBridgeHandler=$i({onPlay:()=>{me.play(),At("composition_played",{time:me.getTime()})},onPause:()=>{me.pause(),At("composition_paused",{time:me.getTime()})},onSeek:(d,p)=>{let h=Math.max(0,d)/t.canonicalFps;me.seek(h),At("composition_seeked",{time:h})},onSetMuted:d=>{t.bridgeMuted=d;let p=d||t.mediaOutputMuted;he.setMuted(p);let h=document.querySelectorAll("video, audio");for(let S of h)S instanceof HTMLMediaElement&&(S.muted=p||S.defaultMuted)},onSetVolume:d=>{t.bridgeVolume=d,he.setVolume(d);let p=document.querySelectorAll("video, audio");for(let h of p){if(!(h instanceof HTMLMediaElement))continue;let S=parseFloat(h.dataset.volume??""),E=Number.isFinite(S)?S:1;h.volume=E*d}},onSetMediaOutputMuted:d=>{t.mediaOutputMuted=d;let p=d||t.bridgeMuted;he.setMuted(p);let h=document.querySelectorAll("video, audio");for(let S of h)S instanceof HTMLMediaElement&&(S.muted=p||S.defaultMuted)},onSetPlaybackRate:d=>{Ln(d),t.transportClock&&t.transportClock.setRate(t.playbackRate),zi()},onSetColorGrading:(d,p)=>{He.setGrading(d,p)},onSetColorGradingCompare:(d,p)=>{He.setCompare(d,p)},onTick:()=>{if(t.tornDown||!B.isPlaying())return;let d=B.now();if(t.currentTime=d,tt(d),B.reachedEnd()){he.stopAll(),B.detachAudioSource(),B.pause(),t.isPlaying=!1;let p=B.getDuration();Number.isFinite(p)&&(B.seek(p),t.currentTime=p,tt(p)),Ie("pause"),Ve(),_e(!0)}},onEnablePickMode:()=>tn.enablePickMode(),onDisablePickMode:()=>tn.disablePickMode()}),t.deterministicAdapters=[fr(),Ji({resolveStartSeconds:d=>y(d,0)}),Xi(),er(),nr(),ir(),rr(),or(),sr(),ar(),lr(),Yi({getTimeline:()=>t.capturedTimeline})],cr(),dr(),window.__hfReseekGpu=d=>{let p=Math.max(0,Number(d)||0);window.__hfThreeTime=p,window.__hfTypegpuTime=p,tr(p)},j(),_n(),Ie("discover");let B=new En;t.transportClock=B;let he=new wn,vn=!1;he.init().then(d=>{vn=d});let sa=()=>{let d=t.capturedTimeline,p=O();t.capturedTimeline&&(p||t.capturedTimeline!==d||!me._timeline)&&(me._timeline=t.capturedTimeline);let h=pe(t.capturedTimeline,0);h>0&&B.setDuration(h),Ie("discover",t.currentTime),window.__renderReady=!0,st(),_e(!0)};if(et=()=>{if(!ee||window.__hfTimelinesBuilding){window.__renderReady=!1;return}if(Ie("discover",t.currentTime),!oa()){window.__renderReady=!1;return}sa()},window.__hfTimelinesBuilding){window.__renderReady=!1;let d=()=>{window.removeEventListener("hf-timelines-built",d),et()};window.addEventListener("hf-timelines-built",d)}et(),ee&&setTimeout(()=>{et()},0);let nn=0,kn=!1,aa=(d,p,h)=>{try{d.pause(),typeof d.totalTime=="function"?d.totalTime(p,!1):d.seek(p,!1)}catch(S){v(h,S)}},la=d=>{let p=window.__timelines??{},h=_()?.getAttribute("data-composition-id")??null;for(let[S,E]of Object.entries(p)){if(!E||S===h)continue;let L=document.querySelector(`[data-composition-id="${CSS.escape(S)}"]`);if(!L)continue;let I=y(L,0);if(!Number.isFinite(I))continue;let $=A(L,{includeAuthoredTimingAttrs:!0}),Y=R(E),Z=$!=null&&$>0?$:Y,ae=Math.max(0,Z!=null&&Z>0?Math.min(Z,d-I):d-I);aa(E,ae,"runtime.init.transport.childTimeline")}},ua=d=>{let p=window.__timelines??{};for(let h of Object.values(p))if(!(!h||h===d))try{h.play()}catch(S){v("runtime.init.activateSiblings",S)}},tt=(d,p)=>{let h=t.capturedTimeline;if(h){p?.activateChildren&&ua(h);try{typeof h.totalTime=="function"?h.totalTime(d,!1):h.seek(d,!1)}catch(S){v("runtime.init.transport.seek",S)}}else la(d);for(let S of t.deterministicAdapters)try{S.seek({time:d})}catch(E){v("runtime.init.transport.adapter",E)}},ca=()=>{try{return document.querySelector(`[${Ns}]`)!=null}catch{return!1}},Wi=()=>{if(!(t.tornDown||kn)){kn=!0;try{if(t.transportRafId=window.requestAnimationFrame(Wi),nn+=1,nn%60===0&&!(B.isPlaying()&&t.capturedTimeline!=null&&B.now()<f)){let h=t.capturedTimeline;if(O()){t.capturedTimeline&&!me._timeline&&(me._timeline=t.capturedTimeline),t.capturedTimeline&&t.capturedTimeline!==h&&t.capturedTimeline.pause();let S=pe(t.capturedTimeline,0);S>0&&B.setDuration(S),st()}}if(nn%20===0&&st(),nn%30===0&&_n(),t.capturedTimeline){let p=pe(t.capturedTimeline,0);p>0&&B.setDuration(p)}if(B.isPlaying()&&!t.mediaOutputMuted)if(he.isActive()&&he.context){let p=he.getTime();p>=0&&B.attachAudioSource({currentTimeSeconds:p})}else{let p=document.querySelectorAll("audio[data-start]"),h=!1;for(let S of p){if(!(S instanceof HTMLMediaElement)||!S.isConnected)continue;let E=Number.parseFloat(S.dataset.start??""),L=Number.parseFloat(S.dataset.duration??""),I=Number.isFinite(L)&&L>0?E+L:1/0,$=Number.parseFloat(S.dataset.playbackStart??S.dataset.mediaStart??"0")||0;if(Number.isFinite(E)&&t.currentTime>=E&&t.currentTime<=I){S.paused?!S.error&&S.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(B.attachAudioSource({currentTimeSeconds:t.currentTime}),h=!0):(B.attachAudioSource({el:S,compositionStart:E,mediaStart:$}),h=!0);break}}!h&&B.hasAudioSource()&&B.detachAudioSource()}else B.hasAudioSource()&&B.detachAudioSource();let d=B.now();if(t.currentTime=d,(B.isPlaying()||!ca())&&tt(d),B.isPlaying()&&B.reachedEnd()){he.stopAll(),B.detachAudioSource(),B.pause(),t.isPlaying=!1;let p=B.getDuration();Number.isFinite(p)&&(B.seek(p),t.currentTime=p,tt(p)),Ie("pause"),Ve(),_e(!0);return}B.isPlaying()&&Ve(),_e(!1)}finally{kn=!1}}},Ui=d=>{let p=document.querySelectorAll("video, audio");for(let h of p){if(!(h instanceof HTMLMediaElement)||!h.isConnected)continue;let S=Number.parseFloat(h.dataset.start??"");if(!Number.isFinite(S))continue;let E=Number.parseFloat(h.dataset.duration??""),L=Number.isFinite(E)&&E>0?S+E:1/0;if(d<S||d>=L)continue;let I=Number.parseFloat(h.dataset.playbackStart??h.dataset.mediaStart??"0")||0,$=d-S+I;if($>=0)try{h.currentTime=$}catch{}}},Vi=()=>{let d=he.startGeneration(),p=document.querySelectorAll("audio[data-start]");for(let h of p){if(!(h instanceof HTMLMediaElement)||!h.isConnected)continue;let S=Number.parseFloat(h.dataset.start??"");if(!Number.isFinite(S))continue;let E=Number.parseFloat(h.dataset.playbackStart??h.dataset.mediaStart??"0")||0,L=Number.parseFloat(h.dataset.volume??""),I=Number.isFinite(L)?L:1,$=Number.parseFloat(h.dataset.duration??""),Y=Number.isFinite($)&&$>0?$:Number.POSITIVE_INFINITY,Z=h.closest("[data-composition-id]");if(Z){let ae=y(Z,0),de=A(Z,{includeAuthoredTimingAttrs:!0});de!=null&&de>0&&(Y=Math.min(Y,Math.max(0,ae+de-S)))}he.decodeAudioElement(h).then(ae=>{!ae||!B.isPlaying()||he.schedulePlayback(h,ae,S,E,B.now(),I*t.bridgeVolume,d,t.playbackRate,Y)})}},zi=()=>{he.setRate(t.playbackRate)&&vn&&B.isPlaying()&&he.hasBoundedActiveSources()&&(he.stopAll(),Vi())};if(me.play=()=>{let d=t.capturedTimeline;if(B.isPlaying())return;let p=pe(d,0);if(p>0)B.setDuration(p),B.reachedEnd()&&(B.seek(0),t.currentTime=0,tt(0));else{let h=_(),S=Number(h?.getAttribute("data-duration")??0);S>0&&B.setDuration(S)}d&&d.pause(),B.play()&&(t.isPlaying=!0,t.mediaForceSyncNextTick=!0,Ui(B.now()),vn&&Vi(),Ie("play"),Ve(),He.redraw(),_e(!0))},me.pause=()=>{if(!B.isPlaying())return;he.stopAll(),B.detachAudioSource(),B.pause(),t.isPlaying=!1,t.currentTime=B.now(),t.mediaForceSyncNextTick=!0,Ui(t.currentTime);let d=t.capturedTimeline;d&&d.pause(),Ie("pause"),Ve(),He.redraw(),_e(!0)},me.seek=d=>{let p=lt(Math.max(0,Number(d)||0),t.canonicalFps);he.stopAll(),B.detachAudioSource(),B.isPlaying()&&B.pause(),B.seek(p),t.currentTime=B.now(),t.isPlaying=!1,t.mediaForceSyncNextTick=!0;let S=t.capturedTimeline;S&&S.pause(),tt(t.currentTime),Ie("pause"),Ve(),He.redraw(),_e(!0)},me.renderSeek=d=>{let p=lt(Math.max(0,Number(d)||0),t.canonicalFps);B.isPlaying()&&B.pause(),B.seek(p),t.currentTime=B.now(),t.isPlaying=!1,t.mediaForceSyncNextTick=!0,tt(t.currentTime,{activateChildren:!0}),Ve(),He.redraw(),_e(!0)},me.getTime=()=>B.now(),me.getDuration=()=>{let d=B.getDuration();return Number.isFinite(d)?d:0},me.isPlaying=()=>B.isPlaying(),me.setPlaybackRate=d=>{Ln(d),B.setRate(t.playbackRate),zi()},t.capturedTimeline){let d=pe(t.capturedTimeline,0);d>0&&B.setDuration(d),t.capturedTimeline.pause()}let ji=window.__player;if(ji){let d=["play","pause","seek","renderSeek","getTime","getDuration","isPlaying"];for(let p of d)Object.defineProperty(ji,p,{get:()=>me[p],set:h=>{me[p]=h},configurable:!0})}t.transportRafId=window.requestAnimationFrame(Wi),st(),_e(!0);let Rn=()=>{if(!t.tornDown){t.tornDown=!0,t.transportRafId!=null&&(window.cancelAnimationFrame(t.transportRafId),t.transportRafId=null),t.transportClock=null,he.destroy(),Se!=null&&(window.clearTimeout(Se),Se=null),s!=null&&(window.cancelAnimationFrame(s),s=null),na(),t.controlBridgeHandler&&(window.removeEventListener("message",t.controlBridgeHandler),t.controlBridgeHandler=null),n&&(window.removeEventListener("error",n),n=null),i&&(window.removeEventListener("unhandledrejection",i),i=null),t.beforeUnloadHandler&&(window.removeEventListener("beforeunload",t.beforeUnloadHandler),t.beforeUnloadHandler=null),tn.disablePickMode();for(let d of t.deterministicAdapters)if(!(!d||typeof d.revert!="function"))try{d.revert()}catch(p){v("runtime.init.site12",p)}t.deterministicAdapters=[];for(let d of r.splice(0))try{d()}catch(p){v("runtime.init.site13",p)}for(let d of t.injectedCompStyles)try{d.remove()}catch(p){v("runtime.init.site14",p)}t.injectedCompStyles=[];for(let d of t.injectedCompScripts)try{d.remove()}catch(p){v("runtime.init.site15",p)}t.injectedCompScripts=[],t.capturedTimeline=null,window.__hfRuntimeTeardown===Rn&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=Rn,t.beforeUnloadHandler=Rn,window.addEventListener("beforeunload",t.beforeUnloadHandler)}var Ls=["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"],vi=[[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 Lc(t){if(t<=255)return Ls[t];let e=0,n=vi.length-1;for(;e<=n;){let i=e+n>>1,r=vi[i];if(t<r[0]){n=i-1;continue}if(t>r[1]){e=i+1;continue}return r[2]}return"L"}function vc(t){let e=t.length;if(e===0)return null;let n=new Array(e),i=!1;for(let c=0;c<e;){let u=t.charCodeAt(c),m=u,f=1;if(u>=55296&&u<=56319&&c+1<e){let w=t.charCodeAt(c+1);w>=56320&&w<=57343&&(m=(u-55296<<10)+(w-56320)+65536,f=2)}let x=Lc(m);(x==="R"||x==="AL"||x==="AN")&&(i=!0);for(let w=0;w<f;w++)n[c+w]=x;c+=f}if(!i)return null;let r=0;for(let c=0;c<e;c++){let u=n[c];if(u==="L"){r=0;break}if(u==="R"||u==="AL"){r=1;break}}let o=new Int8Array(e);for(let c=0;c<e;c++)o[c]=r;let s=r&1?"R":"L",l=s,a=l;for(let c=0;c<e;c++)n[c]==="NSM"?n[c]=a:a=n[c];a=l;for(let c=0;c<e;c++){let u=n[c];u==="EN"?n[c]=a==="AL"?"AN":"EN":(u==="R"||u==="L"||u==="AL")&&(a=u)}for(let c=0;c<e;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<e-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<e;c++){if(n[c]!=="EN")continue;let u;for(u=c-1;u>=0&&n[u]==="ET";u--)n[u]="EN";for(u=c+1;u<e&&n[u]==="ET";u++)n[u]="EN"}for(let c=0;c<e;c++){let u=n[c];(u==="WS"||u==="ES"||u==="ET"||u==="CS")&&(n[c]="ON")}a=l;for(let c=0;c<e;c++){let u=n[c];u==="EN"?n[c]=a==="L"?"L":"EN":(u==="R"||u==="L")&&(a=u)}for(let c=0;c<e;c++){if(n[c]!=="ON")continue;let u=c+1;for(;u<e&&n[u]==="ON";)u++;let m=c>0?n[c-1]:l,f=u<e?n[u]:l,x=m!=="L"?"R":"L";if(x===(f!=="L"?"R":"L"))for(let g=c;g<u;g++)n[g]=x;c=u-1}for(let c=0;c<e;c++)n[c]==="ON"&&(n[c]=s);for(let c=0;c<e;c++){let u=n[c];(o[c]&1)===0?u==="R"?o[c]++:(u==="AN"||u==="EN")&&(o[c]+=2):(u==="L"||u==="AN"||u==="EN")&&o[c]++}return o}function vs(t,e){let n=vc(t);if(n===null)return null;let i=new Int8Array(e.length);for(let r=0;r<e.length;r++)i[r]=n[e[r]];return i}var kc=/[ \\t\\n\\r\\f]+/g,Rc=/[\\t\\n\\r\\f]| {2,}|^ | $/;function Dc(t){let e=t??"normal";return e==="pre-wrap"?{mode:e,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:e,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Ic(t){if(!Rc.test(t))return t;let e=t.replace(kc," ");return e.charCodeAt(0)===32&&(e=e.slice(1)),e.length>0&&e.charCodeAt(e.length-1)===32&&(e=e.slice(0,-1)),e}function Pc(t){return/[\\r\\f]/.test(t)?t.replace(/\\r\\n/g,`\n`).replace(/[\\r\\f]/g,`\n`):t.replace(/\\r\\n/g,`\n`)}var ki=null,Oc;function Bc(){return ki===null&&(ki=new Intl.Segmenter(Oc,{granularity:"word"})),ki}var Hc=/\\p{Script=Arabic}/u,Cn=/\\p{M}/u,Hs=/\\p{Nd}/u;function ks(t){return Hc.test(t)}function Rs(t){return t>=19968&&t<=40959||t>=13312&&t<=19903||t>=131072&&t<=173791||t>=173824&&t<=177983||t>=177984&&t<=178207||t>=178208&&t<=183983||t>=183984&&t<=191471||t>=191472&&t<=192093||t>=194560&&t<=195103||t>=196608&&t<=201551||t>=201552&&t<=205743||t>=205744&&t<=210041||t>=63744&&t<=64255||t>=12288&&t<=12351||t>=12352&&t<=12447||t>=12448&&t<=12543||t>=44032&&t<=55215||t>=65280&&t<=65519}function De(t){for(let e=0;e<t.length;e++){let n=t.charCodeAt(e);if(!(n<12288)){if(n>=55296&&n<=56319&&e+1<t.length){let i=t.charCodeAt(e+1);if(i>=56320&&i<=57343){let r=(n-55296<<10)+(i-56320)+65536;if(Rs(r))return!0;e++;continue}}if(Rs(n))return!0}}return!1}function Gc(t){let e=Mn(t);return e!==null&&(Nn.has(e)||Qe.has(e))}var Wc=new Set(["\\xA0","\\u202F","\\u2060","\\uFEFF"]);function Uc(t){return De(t)}function Vc(t){let e=Mn(t);return e!==null&&Wc.has(e)}function Fn(t){return!Gc(t)&&!Vc(t)}var Nn=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"]),Zt=new Set([\'"\',"(","[","{","\\u201C","\\u2018","\\xAB","\\u2039","\\uFF08","\\u3014","\\u3008","\\u300A","\\u300C","\\u300E","\\u3010","\\u3016","\\u3018","\\u301A"]),Di=new Set(["\'","\\u2019"]),Qe=new Set([".",",","!","?",":",";","\\u060C","\\u061B","\\u061F","\\u0964","\\u0965","\\u104A","\\u104B","\\u104C","\\u104D","\\u104F",")","]","}","%",\'"\',"\\u201D","\\u2019","\\xBB","\\u203A","\\u2026"]),zc=new Set([":",".","\\u060C","\\u061B"]),jc=new Set(["\\u104F"]),qc=new Set(["\\u201D","\\u2019","\\xBB","\\u203A","\\u300D","\\u300F","\\u3011","\\u300B","\\u3009","\\u3015","\\uFF09"]);function $c(t){if(Ii(t))return!0;let e=!1;for(let n of t){if(Qe.has(n)){e=!0;continue}if(!(e&&Cn.test(n)))return!1}return e}function Kc(t){for(let e of t)if(!Nn.has(e)&&!Qe.has(e))return!1;return t.length>0}function Jc(t){if(Ii(t))return!0;for(let e of t)if(!Zt.has(e)&&!Di.has(e)&&!Cn.test(e))return!1;return t.length>0}function Ii(t){let e=!1;for(let n of t)if(!(n==="\\\\"||Cn.test(n))){if(Zt.has(n)||Qe.has(n)||Di.has(n)){e=!0;continue}return!1}return e}function Gs(t,e){let n=e-1;if(n<=0)return Math.max(n,0);let i=t.charCodeAt(n);if(i<56320||i>57343)return n;let r=n-1;if(r<0)return n;let o=t.charCodeAt(r);return o>=55296&&o<=56319?r:n}function Mn(t){if(t.length===0)return null;let e=Gs(t,t.length);return t.slice(e)}function Yc(t){let e=Array.from(t),n=e.length;for(;n>0;){let i=e[n-1];if(Cn.test(i)){n--;continue}if(Zt.has(i)||Di.has(i)){n--;continue}break}return n<=0||n===e.length?null:{head:e.slice(0,n).join(""),tail:e.slice(n).join("")}}function Xc(t,e,n){return n==="text"&&!e&&t.length===1&&t!=="-"&&t!=="\\u2014"?t:null}function Ds(t,e,n,i){let r=e[i],o=t[i];if(r==null)return o;let s=n[i];if(o.length===s)return o;let l=r.repeat(s);return t[i]=l,l}function Is(t,e){return t&&e!==null&&zc.has(e)}function Qc(t){let e=Mn(t);return e!==null&&jc.has(e)}function Zc(t){if(t.length<2||t[0]!==" ")return null;let e=t.slice(1);return/^\\p{M}+$/u.test(e)?{space:" ",marks:e}:null}function Tn(t){let e=t.length;for(;e>0;){let n=Gs(t,e),i=t.slice(n,e);if(qc.has(i))return!0;if(!Qe.has(i))return!1;e=n}return!1}function ed(t,e){if(e.preserveOrdinarySpaces||e.preserveHardBreaks){if(t===" ")return"preserved-space";if(t===" ")return"tab";if(e.preserveHardBreaks&&t===`\n`)return"hard-break"}return t===" "?"space":t==="\\xA0"||t==="\\u202F"||t==="\\u2060"||t==="\\uFEFF"?"glue":t==="\\u200B"?"zero-width-break":t==="\\xAD"?"soft-hyphen":"text"}var td=/[\\x20\\t\\n\\xA0\\xAD\\u200B\\u202F\\u2060\\uFEFF]/;function Le(t){return t.length===1?t[0]:t.join("")}function nd(t,e){let n=[];for(let i=t.length-1;i>=0;i--)n.push(t[i]);return n.push(e),Le(n)}function id(t,e,n,i){if(!td.test(t))return[{text:t,isWordLike:e,kind:"text",start:n}];let r=[],o=null,s=[],l=n,a=!1,c=0;for(let u of t){let m=ed(u,i),f=m==="text"&&e;if(o!==null&&m===o&&f===a){s.push(u),c+=u.length;continue}o!==null&&r.push({text:Le(s),isWordLike:a,kind:o,start:l}),o=m,s=[u],l=n+c,a=f,c+=u.length}return o!==null&&r.push({text:Le(s),isWordLike:a,kind:o,start:l}),r}function Ri(t){return t==="space"||t==="preserved-space"||t==="zero-width-break"||t==="hard-break"}var rd=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function od(t,e){let n=t.texts[e];return n.startsWith("www.")?!0:rd.test(n)&&e+1<t.len&&t.kinds[e+1]==="text"&&t.texts[e+1]==="//"}function sd(t){return t.includes("?")&&(t.includes("://")||t.startsWith("www."))}function ad(t){let e=t.texts.slice(),n=t.isWordLike.slice(),i=t.kinds.slice(),r=t.starts.slice();for(let s=0;s<t.len;s++){if(i[s]!=="text"||!od(t,s))continue;let l=[e[s]],a=s+1;for(;a<t.len&&!Ri(i[a]);){l.push(e[a]),n[s]=!0;let c=e[a].includes("?");if(i[a]="text",e[a]="",a++,c)break}e[s]=Le(l)}let o=0;for(let s=0;s<e.length;s++){let l=e[s];l.length!==0&&(o!==s&&(e[o]=l,n[o]=n[s],i[o]=i[s],r[o]=r[s]),o++)}return e.length=o,n.length=o,i.length=o,r.length=o,{len:o,texts:e,isWordLike:n,kinds:i,starts:r}}function ld(t){let e=[],n=[],i=[],r=[];for(let o=0;o<t.len;o++){let s=t.texts[o];if(e.push(s),n.push(t.isWordLike[o]),i.push(t.kinds[o]),r.push(t.starts[o]),!sd(s))continue;let l=o+1;if(l>=t.len||Ri(t.kinds[l]))continue;let a=[],c=t.starts[l],u=l;for(;u<t.len&&!Ri(t.kinds[u]);)a.push(t.texts[u]),u++;a.length>0&&(e.push(Le(a)),n.push(!0),i.push("text"),r.push(c),o=u-1)}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}var ud=new Set([":","-","/","\\xD7",",",".","+","\\u2013","\\u2014"]),Ps=/^[A-Za-z0-9_]+[,:;]*$/,Os=/[,:;]+$/;function Ws(t){for(let e of t)if(Hs.test(e))return!0;return!1}function Qt(t){if(t.length===0)return!1;for(let e of t)if(!(Hs.test(e)||ud.has(e)))return!1;return!0}function cd(t){let e=[],n=[],i=[],r=[];for(let o=0;o<t.len;o++){let s=t.texts[o],l=t.kinds[o];if(l==="text"&&Qt(s)&&Ws(s)){let a=[s],c=o+1;for(;c<t.len&&t.kinds[c]==="text"&&Qt(t.texts[c]);)a.push(t.texts[c]),c++;e.push(Le(a)),n.push(!0),i.push("text"),r.push(t.starts[o]),o=c-1;continue}e.push(s),n.push(t.isWordLike[o]),i.push(l),r.push(t.starts[o])}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function dd(t){let e=[],n=[],i=[],r=[];for(let o=0;o<t.len;o++){let s=t.texts[o],l=t.kinds[o],a=t.isWordLike[o];if(l==="text"&&a&&Ps.test(s)){let c=[s],u=Os.test(s),m=o+1;for(;u&&m<t.len&&t.kinds[m]==="text"&&t.isWordLike[m]&&Ps.test(t.texts[m]);){let f=t.texts[m];c.push(f),u=Os.test(f),m++}e.push(Le(c)),n.push(!0),i.push("text"),r.push(t.starts[o]),o=m-1;continue}e.push(s),n.push(a),i.push(l),r.push(t.starts[o])}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function fd(t){let e=[],n=[],i=[],r=[];for(let o=0;o<t.len;o++){let s=t.texts[o];if(t.kinds[o]==="text"&&s.includes("-")){let l=s.split("-"),a=l.length>1;for(let c=0;c<l.length;c++){let u=l[c];if(!a)break;(u.length===0||!Ws(u)||!Qt(u))&&(a=!1)}if(a){let c=0;for(let u=0;u<l.length;u++){let m=l[u],f=u<l.length-1?`${m}-`:m;e.push(f),n.push(!0),i.push("text"),r.push(t.starts[o]+c),c+=f.length}continue}}e.push(s),n.push(t.isWordLike[o]),i.push(t.kinds[o]),r.push(t.starts[o])}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function md(t){let e=[],n=[],i=[],r=[],o=0;for(;o<t.len;){let s=[t.texts[o]],l=t.isWordLike[o],a=t.kinds[o],c=t.starts[o];if(a==="glue"){let u=[s[0]],m=c;for(o++;o<t.len&&t.kinds[o]==="glue";)u.push(t.texts[o]),o++;let f=Le(u);if(o<t.len&&t.kinds[o]==="text")s[0]=f,s.push(t.texts[o]),l=t.isWordLike[o],a="text",c=m,o++;else{e.push(f),n.push(!1),i.push("glue"),r.push(m);continue}}else o++;if(a==="text")for(;o<t.len&&t.kinds[o]==="glue";){let u=[];for(;o<t.len&&t.kinds[o]==="glue";)u.push(t.texts[o]),o++;let m=Le(u);if(o<t.len&&t.kinds[o]==="text"){s.push(m,t.texts[o]),l=l||t.isWordLike[o],o++;continue}s.push(m)}e.push(Le(s)),n.push(l),i.push(a),r.push(c)}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function pd(t){let e=t.texts.slice(),n=t.isWordLike.slice(),i=t.kinds.slice(),r=t.starts.slice();for(let o=0;o<e.length-1;o++){if(i[o]!=="text"||i[o+1]!=="text"||!De(e[o])||!De(e[o+1]))continue;let s=Yc(e[o]);s!==null&&(e[o]=s.head,e[o+1]=s.tail+e[o+1],r[o+1]=r[o]+s.head.length)}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function Bs(t,e,n){let i=Bc(),r=0,o=[],s=[],l=[],a=[],c=[],u=[],m=[],f=[],x=[],w=[],g=[],b=[];for(let M of i.segment(t))for(let y of id(M.segment,M.isWordLike??!1,M.index,n)){let U=function(){u[R]!==null&&(s[R]=[Ds(o,u,m,R)],u[R]=null),s[R].push(y.text),l[R]=l[R]||y.isWordLike,f[R]=f[R]||N,x[R]=x[R]||k,w[R]=z,g[R]=ee,b[R]=Is(x[R],G)},A=y.kind==="text",C=Xc(y.text,y.isWordLike,y.kind),N=De(y.text),k=ks(y.text),G=Mn(y.text),z=Tn(y.text),ee=Qc(y.text),R=r-1;e.carryCJKAfterClosingQuote&&A&&r>0&&a[R]==="text"&&N&&f[R]&&w[R]||A&&r>0&&a[R]==="text"&&Kc(y.text)&&f[R]||A&&r>0&&a[R]==="text"&&g[R]?U():A&&r>0&&a[R]==="text"&&y.isWordLike&&k&&b[R]?(U(),l[R]=!0):C!==null&&r>0&&a[R]==="text"&&u[R]===C?m[R]=(m[R]??1)+1:A&&!y.isWordLike&&r>0&&a[R]==="text"&&($c(y.text)||y.text==="-"&&l[R])?U():(o[r]=y.text,s[r]=[y.text],l[r]=y.isWordLike,a[r]=y.kind,c[r]=y.start,u[r]=C,m[r]=C===null?0:1,f[r]=N,x[r]=k,w[r]=z,g[r]=ee,b[r]=Is(k,G),r++)}for(let M=0;M<r;M++){if(u[M]!==null){o[M]=Ds(o,u,m,M);continue}o[M]=Le(s[M])}for(let M=1;M<r;M++)a[M]==="text"&&!l[M]&&Ii(o[M])&&a[M-1]==="text"&&(o[M-1]+=o[M],l[M-1]=l[M-1]||l[M],o[M]="");let F=Array.from({length:r},()=>null),T=-1;for(let M=r-1;M>=0;M--){let y=o[M];if(y.length!==0){if(a[M]==="text"&&!l[M]&&Jc(y)&&T>=0&&a[T]==="text"){let A=F[T]??[];A.push(y),F[T]=A,c[T]=c[M],o[M]="";continue}T=M}}for(let M=0;M<r;M++){let y=F[M];y!=null&&(o[M]=nd(y,o[M]))}let _=0;for(let M=0;M<r;M++){let y=o[M];y.length!==0&&(_!==M&&(o[_]=y,l[_]=l[M],a[_]=a[M],c[_]=c[M]),_++)}o.length=_,l.length=_,a.length=_,c.length=_;let Q=md({len:_,texts:o,isWordLike:l,kinds:a,starts:c}),H=pd(dd(fd(cd(ld(ad(Q))))));for(let M=0;M<H.len-1;M++){let y=Zc(H.texts[M]);y!==null&&(H.kinds[M]!=="space"&&H.kinds[M]!=="preserved-space"||H.kinds[M+1]!=="text"||!ks(H.texts[M+1])||(H.texts[M]=y.space,H.isWordLike[M]=!1,H.kinds[M]=H.kinds[M]==="preserved-space"?"preserved-space":"space",H.texts[M+1]=y.marks+H.texts[M+1],H.starts[M+1]=H.starts[M]+y.space.length))}return H}function hd(t,e){if(t.len===0)return[];if(!e.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:t.len,consumedEndSegmentIndex:t.len}];let n=[],i=0;for(let r=0;r<t.len;r++)t.kinds[r]==="hard-break"&&(n.push({startSegmentIndex:i,endSegmentIndex:r,consumedEndSegmentIndex:r+1}),i=r+1);return i<t.len&&n.push({startSegmentIndex:i,endSegmentIndex:t.len,consumedEndSegmentIndex:t.len}),n}function xd(t){if(t.len<=1)return t;let e=[],n=[],i=[],r=[],o=null,s=!1,l=0,a=!1,c=!1;function u(){o!==null&&(e.push(Le(o)),n.push(s),i.push("text"),r.push(l),o=null)}for(let m=0;m<t.len;m++){let f=t.texts[m],x=t.kinds[m],w=t.isWordLike[m],g=t.starts[m];if(x==="text"){let b=Uc(f),F=Fn(f);if(o!==null&&a&&c){o.push(f),s=s||w,a=a||b,c=F;continue}u(),o=[f],s=w,l=g,a=b,c=F;continue}u(),e.push(f),n.push(w),i.push(x),r.push(g)}return u(),{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function Us(t,e,n="normal",i="normal"){let r=Dc(n),o=r.mode==="pre-wrap"?Pc(t):Ic(t);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let s=i==="keep-all"?xd(Bs(o,e,r)):Bs(o,e,r);return{normalized:o,chunks:hd(s,r),...s}}var ht=null,Vs=new Map,xt=null,gd=96,yd=/\\p{Emoji_Presentation}/u,bd=/[\\p{Emoji_Presentation}\\p{Extended_Pictographic}\\p{Regional_Indicator}\\uFE0F\\u20E3]/u,Pi=null,zs=new Map;function Oi(){if(ht!==null)return ht;if(typeof OffscreenCanvas<"u")return ht=new OffscreenCanvas(1,1).getContext("2d"),ht;if(typeof document<"u")return ht=document.createElement("canvas").getContext("2d"),ht;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Sd(t){let e=Vs.get(t);return e||(e=new Map,Vs.set(t,e)),e}function Ue(t,e){let n=e.get(t);return n===void 0&&(n={width:Oi().measureText(t).width,containsCJK:De(t)},e.set(t,n)),n}function gt(){if(xt!==null)return xt;if(typeof navigator>"u")return xt={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},xt;let t=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&t.includes("Safari/")&&!t.includes("Chrome/")&&!t.includes("Chromium/")&&!t.includes("CriOS/")&&!t.includes("FxiOS/")&&!t.includes("EdgiOS/"),i=t.includes("Chrome/")||t.includes("Chromium/")||t.includes("CriOS/")||t.includes("Edg/");return xt={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:i,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},xt}function Ad(t){let e=t.match(/(\\d+(?:\\.\\d+)?)\\s*px/);return e?parseFloat(e[1]):16}function js(){return Pi===null&&(Pi=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Pi}function Ed(t){return yd.test(t)||t.includes("\\uFE0F")}function qs(t){return bd.test(t)}function wd(t,e){let n=zs.get(t);if(n!==void 0)return n;let i=Oi();i.font=t;let r=i.measureText("\\u{1F600}").width;if(n=0,r>e+.5&&typeof document<"u"&&document.body!==null){let o=document.createElement("span");o.style.font=t,o.style.display="inline-block",o.style.visibility="hidden",o.style.position="absolute",o.textContent="\\u{1F600}",document.body.appendChild(o);let s=o.getBoundingClientRect().width;document.body.removeChild(o),r-s>.5&&(n=r-s)}return zs.set(t,n),n}function Cd(t){let e=0,n=js();for(let i of n.segment(t))Ed(i.segment)&&e++;return e}function Fd(t,e){return e.emojiCount===void 0&&(e.emojiCount=Cd(t)),e.emojiCount}function Ze(t,e,n){return n===0?e.width:e.width-Fd(t,e)*n}function $s(t,e,n,i,r){if(e.breakableFitAdvances!==void 0)return e.breakableFitAdvances;let o=js(),s=[];for(let u of o.segment(t))s.push(u.segment);if(s.length<=1)return e.breakableFitAdvances=null,e.breakableFitAdvances;if(r==="sum-graphemes"){let u=[];for(let m of s){let f=Ue(m,n);u.push(Ze(m,f,i))}return e.breakableFitAdvances=u,e.breakableFitAdvances}if(r==="pair-context"||s.length>gd){let u=[],m=null,f=0;for(let x of s){let w=Ue(x,n),g=Ze(x,w,i);if(m===null)u.push(g);else{let b=m+x,F=Ue(b,n);u.push(Ze(b,F,i)-f)}m=x,f=g}return e.breakableFitAdvances=u,e.breakableFitAdvances}let l=[],a="",c=0;for(let u of s){a+=u;let m=Ue(a,n),f=Ze(a,m,i);l.push(f-c),c=f}return e.breakableFitAdvances=l,e.breakableFitAdvances}function Ks(t,e){let n=Oi();n.font=t;let i=Sd(t),r=Ad(t),o=e?wd(t,r):0;return{cache:i,fontSize:r,emojiCorrection:o}}function Nd(t,e){for(;e<t.widths.length;){let n=t.kinds[e];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;e++}return e}function Md(t,e){if(e<=0)return 0;let n=t%e;return Math.abs(n)<=1e-6?e:e-n}function Td(t,e,n,i,r){let o=0,s=e;for(;o<t.length;){let l=s+t[o];if((o+1<t.length?l+r:l)>n+i)break;s=l,o++}return{fitCount:o,fittedWidth:s}}function Js(t,e){return t.simpleLineWalkFastPath?Ys(t,e):Xs(t,e)}function Ys(t,e,n){let{widths:i,kinds:r,breakableFitAdvances:o}=t;if(i.length===0)return 0;let l=gt().lineFitEpsilon,a=e+l,c=0,u=0,m=!1,f=0,x=0,w=0,g=0,b=-1,F=0;function T(){b=-1,F=0}function _(C=w,N=g,k=u){c++,n?.({startSegmentIndex:f,startGraphemeIndex:x,endSegmentIndex:C,endGraphemeIndex:N,width:k}),u=0,m=!1,T()}function Q(C,N){m=!0,f=C,x=0,w=C+1,g=0,u=N}function H(C,N,k){m=!0,f=C,x=N,w=C,g=N+1,u=k}function M(C,N){if(!m){Q(C,N);return}u+=N,w=C+1,g=0}function y(C,N){let k=o[C];for(let G=N;G<k.length;G++){let z=k[G];m?u+z>a?(_(),H(C,G,z)):(u+=z,w=C,g=G+1):H(C,G,z)}m&&w===C&&g===k.length&&(w=C+1,g=0)}let A=0;for(;A<i.length&&!(!m&&(A=Nd(t,A),A>=i.length));){let C=i[A],N=r[A],k=N==="space"||N==="preserved-space"||N==="tab"||N==="zero-width-break"||N==="soft-hyphen";if(!m){C>e&&o[A]!==null?y(A,0):Q(A,C),k&&(b=A+1,F=u-C),A++;continue}if(u+C>a){if(k){M(A,C),_(A+1,0,u-C),A++;continue}if(b>=0){if(w>b||w===b&&g>0){_();continue}_(b,0,F);continue}if(C>e&&o[A]!==null){_(),y(A,0),A++;continue}_();continue}M(A,C),k&&(b=A+1,F=u-C),A++}return m&&_(),c}function Xs(t,e,n){if(t.simpleLineWalkFastPath)return Ys(t,e,n);let{widths:i,lineEndFitAdvances:r,lineEndPaintAdvances:o,kinds:s,breakableFitAdvances:l,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:u}=t;if(i.length===0||u.length===0)return 0;let m=gt(),f=m.lineFitEpsilon,x=e+f,w=0,g=0,b=!1,F=0,T=0,_=0,Q=0,H=-1,M=0,y=0,A=null;function C(){H=-1,M=0,y=0,A=null}function N(V=_,te=Q,W=g){w++,n?.({startSegmentIndex:F,startGraphemeIndex:T,endSegmentIndex:V,endGraphemeIndex:te,width:W}),g=0,b=!1,C()}function k(V,te){b=!0,F=V,T=0,_=V+1,Q=0,g=te}function G(V,te,W){b=!0,F=V,T=te,_=V,Q=te+1,g=W}function z(V,te){if(!b){k(V,te);return}g+=te,_=V+1,Q=0}function ee(V,te,W,ie){if(!te)return;let pe=V==="tab"?0:r[W],P=V==="tab"?ie:o[W];H=W+1,M=g-ie+pe,y=g-ie+P,A=V}function R(V,te){let W=l[V];for(let ie=te;ie<W.length;ie++){let pe=W[ie];b?g+pe>x?(N(),G(V,ie,pe)):(g+=pe,_=V,Q=ie+1):G(V,ie,pe)}b&&_===V&&Q===W.length&&(_=V+1,Q=0)}function U(V){if(A!=="soft-hyphen")return!1;let te=l[V];if(te==null)return!1;let{fitCount:W,fittedWidth:ie}=Td(te,g,e,f,a);return W===0?!1:(g=ie,_=V,Q=W,C(),W===te.length?(_=V+1,Q=0,!0):(N(V,W,ie+a),R(V,W),!0))}function Me(V){w++,n?.({startSegmentIndex:V.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:V.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),C()}for(let V=0;V<u.length;V++){let te=u[V];if(te.startSegmentIndex===te.endSegmentIndex){Me(te);continue}b=!1,g=0,F=te.startSegmentIndex,T=0,_=te.startSegmentIndex,Q=0,C();let W=te.startSegmentIndex;for(;W<te.endSegmentIndex;){let ie=s[W],pe=ie==="space"||ie==="preserved-space"||ie==="tab"||ie==="zero-width-break"||ie==="soft-hyphen",P=ie==="tab"?Md(g,c):i[W];if(ie==="soft-hyphen"){b&&(_=W+1,Q=0,H=W+1,M=g+a,y=g+a,A=ie),W++;continue}if(!b){P>e&&l[W]!==null?R(W,0):k(W,P),ee(ie,pe,W,P),W++;continue}if(g+P>x){let O=g+(ie==="tab"?0:r[W]),se=g+(ie==="tab"?P:o[W]);if(A==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&M<=x){N(H,0,y);continue}if(A==="soft-hyphen"&&U(W)){W++;continue}if(pe&&O<=x){z(W,P),N(W+1,0,se),W++;continue}if(H>=0&&M<=x){if(_>H||_===H&&Q>0){N();continue}let re=H;N(re,0,y),W=re;continue}if(P>e&&l[W]!==null){N(),R(W,0),W++;continue}N();continue}z(W,P),ee(ie,pe,W,P),W++}if(b){let ie=H===te.consumedEndSegmentIndex?y:g;N(te.consumedEndSegmentIndex,0,ie)}}return w}var Bi=null;function _d(){return Bi===null&&(Bi=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Bi}function Ld(t){return t?{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 vd(t,e){let n=[],i=[],r=0,o=!1,s=!1,l=!1;function a(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:r}),i=[],o=!1,s=!1,l=!1)}function c(m,f,x){i=[m],r=f,o=x,s=Tn(m),l=Zt.has(m)}function u(m,f){i.push(m),o=o||f;let x=Tn(m);m.length===1&&Qe.has(m)?s=s||x:s=x,l=!1}for(let m of _d().segment(t)){let f=m.segment,x=De(f);if(i.length===0){c(f,m.index,x);continue}if(l||Nn.has(f)||Qe.has(f)||e.carryCJKAfterClosingQuote&&x&&s){u(f,x);continue}if(!o&&!x){u(f,x);continue}a(),c(f,m.index,x)}return a(),n}function kd(t){if(t.length<=1)return t;let e=[],n=[t[0].text],i=t[0].start,r=De(t[0].text),o=Fn(t[0].text);function s(){e.push({text:n.length===1?n[0]:n.join(""),start:i})}for(let l=1;l<t.length;l++){let a=t[l],c=De(a.text),u=Fn(a.text);if(r&&o){n.push(a.text),r=r||c,o=u;continue}s(),n=[a.text],i=a.start,r=c,o=u}return s(),e}function Rd(t,e,n,i){let r=gt(),{cache:o,emojiCorrection:s}=Ks(e,qs(t.normalized)),l=Ze("-",Ue("-",o),s),c=Ze(" ",Ue(" ",o),s)*8;if(t.len===0)return Ld(n);let u=[],m=[],f=[],x=[],w=t.chunks.length<=1,g=n?[]:null,b=[],F=n?[]:null,T=Array.from({length:t.len});function _(y,A,C,N,k,G,z){k!=="text"&&k!=="space"&&k!=="zero-width-break"&&(w=!1),u.push(A),m.push(C),f.push(N),x.push(k),g?.push(G),b.push(z),F!==null&&F.push(y)}function Q(y,A,C,N,k){let G=Ue(y,o),z=Ze(y,G,s),ee=A==="space"||A==="preserved-space"||A==="zero-width-break"?0:z,R=A==="space"||A==="zero-width-break"?0:z;if(k&&N&&y.length>1){let U="sum-graphemes";Qt(y)?U="pair-context":r.preferPrefixWidthsForBreakableRuns&&(U="segment-prefixes");let Me=$s(y,G,o,s,U);_(y,z,ee,R,A,C,Me);return}_(y,z,ee,R,A,C,null)}for(let y=0;y<t.len;y++){T[y]=u.length;let A=t.texts[y],C=t.isWordLike[y],N=t.kinds[y],k=t.starts[y];if(N==="soft-hyphen"){_(A,0,l,l,N,k,null);continue}if(N==="hard-break"){_(A,0,0,0,N,k,null);continue}if(N==="tab"){_(A,0,0,0,N,k,null);continue}let G=Ue(A,o);if(N==="text"&&G.containsCJK){let z=vd(A,r),ee=i==="keep-all"?kd(z):z;for(let R=0;R<ee.length;R++){let U=ee[R];Q(U.text,"text",k+U.start,C,i==="keep-all"||!De(U.text))}continue}Q(A,N,k,C,!0)}let H=Dd(t.chunks,T,u.length),M=g===null?null:vs(t.normalized,g);return F!==null?{widths:u,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:w,segLevels:M,breakableFitAdvances:b,discretionaryHyphenWidth:l,tabStopAdvance:c,chunks:H,segments:F}:{widths:u,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:w,segLevels:M,breakableFitAdvances:b,discretionaryHyphenWidth:l,tabStopAdvance:c,chunks:H}}function Dd(t,e,n){let i=[];for(let r=0;r<t.length;r++){let o=t[r],s=o.startSegmentIndex<e.length?e[o.startSegmentIndex]:n,l=o.endSegmentIndex<e.length?e[o.endSegmentIndex]:n,a=o.consumedEndSegmentIndex<e.length?e[o.consumedEndSegmentIndex]:n;i.push({startSegmentIndex:s,endSegmentIndex:l,consumedEndSegmentIndex:a})}return i}function Id(t,e,n,i){let r=i?.wordBreak??"normal",o=Us(t,gt(),i?.whiteSpace,r);return Rd(o,e,n,r)}function Qs(t,e,n){return Id(t,e,!1,n)}function Zs(t,e,n){let i=Js(t,e);return{lineCount:i,height:i*n}}var Pd={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function ea(t,e){let n={...Pd,...e},i=1.2;for(let r=n.baseFontSize;r>=n.minFontSize;r-=n.step){let o=`${n.fontWeight} ${r}px ${n.fontFamily}`,s=Qs(t,o),{lineCount:l}=Zs(s,n.maxWidth,r*i);if(l<=1)return{fontSize:r,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}window.__timelines=window.__timelines||{};window.__hyperframes={fitTextFontSize:ea,getVariables:is};function ta(){let t=window;t.__hyperframeRuntimeBootstrapped||(t.__hyperframeRuntimeBootstrapped=!0,_s())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ta,{once:!0}):ta();})();\n';
|
|
28564
|
+
RUNTIME_IIFE = '"use strict";(()=>{var fa=Object.create;var On=Object.defineProperty;var ma=Object.getOwnPropertyDescriptor;var pa=Object.getOwnPropertyNames;var ha=Object.getPrototypeOf,xa=Object.prototype.hasOwnProperty;var ga=(t,e,n)=>e in t?On(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ne=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ya=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of pa(e))!xa.call(t,r)&&r!==n&&On(t,r,{get:()=>e[r],enumerable:!(i=ma(e,r))||i.enumerable});return t};var ba=(t,e,n)=>(n=t!=null?fa(ha(t)):{},ya(e||!t||!t.__esModule?On(n,"default",{value:t,enumerable:!0}):n,t));var xe=(t,e,n)=>ga(t,typeof e!="symbol"?e+"":e,n);var _r=ne((jf,qn)=>{var K=String,Tr=function(){return{isColorSupported:!1,reset:K,bold:K,dim:K,italic:K,underline:K,inverse:K,hidden:K,strikethrough:K,black:K,red:K,green:K,yellow:K,blue:K,magenta:K,cyan:K,white:K,gray:K,bgBlack:K,bgRed:K,bgGreen:K,bgYellow:K,bgBlue:K,bgMagenta:K,bgCyan:K,bgWhite:K,blackBright:K,redBright:K,greenBright:K,yellowBright:K,blueBright:K,magentaBright:K,cyanBright:K,whiteBright:K,bgBlackBright:K,bgRedBright:K,bgGreenBright:K,bgYellowBright:K,bgBlueBright:K,bgMagentaBright:K,bgCyanBright:K,bgWhiteBright:K}};qn.exports=Tr();qn.exports.createColors=Tr});var $n=ne(()=>{});var sn=ne((Kf,kr)=>{"use strict";var Lr=_r(),vr=$n(),_t=class t extends Error{constructor(e,n,i,r,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),r&&(this.source=r),s&&(this.plugin=s),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,t)}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(e){if(!this.source)return"";let n=this.source;e==null&&(e=Lr.isColorSupported);let i=u=>u,r=u=>u,o=u=>u;if(e){let{bold:u,gray:m,red:f}=Lr.createColors(!0);r=x=>u(f(x)),i=x=>m(x),vr&&(o=x=>vr(x))}let s=n.split(/\\r?\\n/),l=Math.max(this.line-3,0),a=Math.min(this.line+2,s.length),c=String(a).length;return s.slice(l,a).map((u,m)=>{let f=l+1+m,x=" "+(" "+f).slice(-c)+" | ";if(f===this.line){if(u.length>160){let g=20,b=Math.max(0,this.column-g),F=Math.max(this.column+g,this.endColumn+g),_=u.slice(b,F),L=i(x.replace(/\\d/g," "))+u.slice(0,Math.min(this.column-1,g-1)).replace(/[^\\t]/g," ");return r(">")+i(x)+o(_)+`\n `+L+r("^")}let w=i(x.replace(/\\d/g," "))+u.slice(0,this.column-1).replace(/[^\\t]/g," ");return r(">")+i(x)+o(u)+`\n `+w+r("^")}return" "+i(x)+o(u)}).join(`\n`)}toString(){let e=this.showSourceCode();return e&&(e=`\n\n`+e+`\n`),this.name+": "+this.message+e}};kr.exports=_t;_t.default=_t});var Kn=ne((Jf,Dr)=>{"use strict";var Qa=/(<)(\\/?style\\b)/gi,Za=/(<)(!--)/g;function qe(t){return typeof t!="string"||!t.includes("<")?t:t.replace(Qa,"\\\\3c $2").replace(Za,"\\\\3c $2")}var Rr={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function el(t){return t[0].toUpperCase()+t.slice(1)}var Lt=class{constructor(e){this.builder=e}atrule(e,n){let i=e.raws,r="@"+e.name,o=e.params?this.rawValue(e,"params"):"";if(typeof i.afterName<"u"?r+=i.afterName:o&&(r+=" "),e.nodes)this.block(e,r+o);else{let s=(i.between||"")+(n?";":"");this.builder(qe(r+o+s),e)}}beforeAfter(e,n){let i;e.type==="decl"?i=this.raw(e,null,"beforeDecl"):e.type==="comment"?i=this.raw(e,null,"beforeComment"):n==="before"?i=this.raw(e,null,"beforeRule"):i=this.raw(e,null,"beforeClose");let r=e.parent,o=0;for(;r&&r.type!=="root";)o+=1,r=r.parent;if(i.includes(`\n`)){let s=this.raw(e,null,"indent");if(s.length)for(let l=0;l<o;l++)i+=s}return i}block(e,n){let i=this.raw(e,"between","beforeOpen");this.builder(qe(n+i)+"{",e,"start");let r;e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(qe(r)),this.builder("}",e,"end")}body(e){let n=e.nodes,i=n.length-1;for(;i>0&&n[i].type==="comment";)i-=1;let r=this.raw(e,"semicolon"),o=e.type==="document";for(let s=0;s<n.length;s++){let l=n[s],a=this.raw(l,"before");a&&this.builder(o?a:qe(a)),this.stringify(l,i!==s||r)}}comment(e){let n=this.raw(e,"left","commentLeft"),i=this.raw(e,"right","commentRight");this.builder(qe("/*"+n+e.text+i+"*/"),e)}decl(e,n){let i=e.raws,r=this.raw(e,"between","colon"),o=e.prop+r+this.rawValue(e,"value");e.important&&(o+=i.important||" !important"),n&&(o+=";"),this.builder(qe(o),e)}document(e){this.body(e)}raw(e,n,i){let r;if(i||(i=n),n&&(r=e.raws[n],typeof r<"u"))return r;let o=e.parent;if(i==="before"&&(!o||o.type==="root"&&o.first===e||o&&o.type==="document"))return"";if(!o)return Rr[i];let s=e.root(),l=s.rawCache||(s.rawCache={});if(typeof l[i]<"u")return l[i];if(i==="before"||i==="after")return this.beforeAfter(e,i);{let a="raw"+el(i);this[a]?r=this[a](s,e):s.walk(c=>{if(r=c.raws[n],typeof r<"u")return!1})}return typeof r>"u"&&(r=Rr[i]),l[i]=r,r}rawBeforeClose(e){let n;return e.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(e,n){let i;return e.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(e,n){let i;return e.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(e){let n;return e.walk(i=>{if(i.type!=="decl"&&(n=i.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(e){let n;return e.walk(i=>{if(i.nodes&&(i.parent!==e||e.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(e){let n;return e.walkDecls(i=>{if(typeof i.raws.between<"u")return n=i.raws.between.replace(/[^\\s:]/g,""),!1}),n}rawEmptyBody(e){let n;return e.walk(i=>{if(i.nodes&&i.nodes.length===0&&(n=i.raws.after,typeof n<"u"))return!1}),n}rawIndent(e){if(e.raws.indent)return e.raws.indent;let n;return e.walk(i=>{let r=i.parent;if(r&&r!==e&&r.parent&&r.parent===e&&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(e){let n;return e.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(n=i.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(e,n){let i=e[n],r=e.raws[n];return r&&r.value===i?r.raw:i}root(e){if(this.body(e),e.raws.after){let n=e.raws.after,i=e.parent&&e.parent.type==="document";this.builder(i?n:qe(n))}}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(qe(e.raws.ownSemicolon),e,"end")}stringify(e,n){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,n)}};Dr.exports=Lt;Lt.default=Lt});var vt=ne((Yf,Ir)=>{"use strict";var tl=Kn();function Jn(t,e){new tl(e).stringify(t)}Ir.exports=Jn;Jn.default=Jn});var an=ne((Xf,Yn)=>{"use strict";Yn.exports.isClean=Symbol("isClean");Yn.exports.my=Symbol("my")});var Dt=ne((Qf,Pr)=>{"use strict";var nl=sn(),il=Kn(),rl=vt(),{isClean:kt,my:ol}=an();function Xn(t,e){let n=new t.constructor;for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||i==="proxyCache")continue;let r=t[i],o=typeof r;i==="parent"&&o==="object"?e&&(n[i]=e):i==="source"?n[i]=r:Array.isArray(r)?n[i]=r.map(s=>Xn(s,n)):(o==="object"&&r!==null&&(r=Xn(r)),n[i]=r)}return n}function Ge(t,e){if(e&&typeof e.offset<"u")return e.offset;let n=1,i=1,r=0;for(let o=0;o<t.length;o++){if(i===e.line&&n===e.column){r=o;break}t[o]===`\n`?(n=1,i+=1):n+=1}return r}var Rt=class{get proxyOf(){return this}constructor(e={}){this.raws={},this[kt]=!1,this[ol]=!0;for(let n in e)if(n==="nodes"){this.nodes=[];for(let i of e[n])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}else this[n]=e[n]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\\n\\s{4}at /.test(e.stack)){let n=this.source;e.stack=e.stack.replace(/\\n\\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let n in e)this[n]=e[n];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let n=Xn(this);for(let i in e)n[i]=e[i];return n}cloneAfter(e={}){let n=this.clone(e);return this.parent.insertAfter(this,n),n}cloneBefore(e={}){let n=this.clone(e);return this.parent.insertBefore(this,n),n}error(e,n={}){if(this.source){let{end:i,start:r}=this.rangeBy(n);return this.source.input.error(e,{column:r.column,line:r.line},{column:i.column,line:i.line},n)}return new nl(e)}getProxyProcessor(){return{get(e,n){return n==="proxyOf"?e:n==="root"?()=>e.root().toProxy():e[n]},set(e,n,i){return e[n]===i||(e[n]=i,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&e.markDirty()),!0}}}markClean(){this[kt]=!0}markDirty(){if(this[kt]){this[kt]=!1;let e=this;for(;e=e.parent;)e[kt]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let n=this.source.start;if(e.index)n=this.positionInside(e.index);else if(e.word){let i="document"in this.source.input?this.source.input.document:this.source.input.css,o=i.slice(Ge(i,this.source.start),Ge(i,this.source.end)).indexOf(e.word);o!==-1&&(n=this.positionInside(o))}return n}positionInside(e){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=Ge(r,this.source.start),s=o+e;for(let l=o;l<s;l++)r[l]===`\n`?(n=1,i+=1):n+=1;return{column:n,line:i,offset:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){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:Ge(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:Ge(n,this.source.end)+1}:{column:i.column+1,line:i.line,offset:i.offset+1};if(e.word){let s=n.slice(Ge(n,this.source.start),Ge(n,this.source.end)).indexOf(e.word);s!==-1&&(i=this.positionInside(s),r=this.positionInside(s+e.word.length))}else e.start?i={column:e.start.column,line:e.start.line,offset:Ge(n,e.start)}:e.index&&(i=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line,offset:Ge(n,e.end)}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.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(e,n){return new il().raw(this,e,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let n=this,i=!1;for(let r of e)r===this?i=!0:i?(this.parent.insertAfter(n,r),n=r):this.parent.insertBefore(n,r);i||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,n){let i={},r=n==null;n=n||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let l=this[s];if(Array.isArray(l))i[s]=l.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,n):a);else if(typeof l=="object"&&l.toJSON)i[s]=l.toJSON(null,n);else if(s==="source"){if(l==null)continue;let a=n.get(l.input);a==null&&(a=o,n.set(l.input,o),o++),i[s]={end:l.end,inputId:a,start:l.start}}else i[s]=l}return r&&(i.inputs=[...n.keys()].map(s=>s.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=rl){e.stringify&&(e=e.stringify);let n="";return e(this,i=>{n+=i}),n}warn(e,n,i={}){let r={node:this};for(let o in i)r[o]=i[o];return e.warn(n,r)}};Pr.exports=Rt;Rt.default=Rt});var Pt=ne((Zf,Or)=>{"use strict";var sl=Dt(),It=class extends sl{constructor(e){super(e),this.type="comment"}};Or.exports=It;It.default=It});var Bt=ne((em,Br)=>{"use strict";var al=Dt(),Ot=class extends al{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}};Br.exports=Ot;Ot.default=Ot});var $e=ne((tm,$r)=>{"use strict";var Hr=Pt(),Gr=Bt(),ll=Dt(),{isClean:Wr,my:Ur}=an(),Qn,Vr,zr,Zn;function jr(t){return t.map(e=>(e.nodes&&(e.nodes=jr(e.nodes)),delete e.source,e))}function qr(t){if(t[Wr]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)qr(e)}var Re=class t extends ll{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(...e){for(let n of e){let i=this.normalize(n,this.last);for(let r of i)this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let n of this.nodes)n.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let n=this.getIterator(),i,r;for(;this.indexes[n]<this.proxyOf.nodes.length&&(i=this.indexes[n],r=e(this.proxyOf.nodes[i],i),r!==!1);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,n){return n==="proxyOf"?e:e[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...i)=>e[n](...i.map(r=>typeof r=="function"?(o,s)=>r(o.toProxy(),s):r)):n==="every"||n==="some"?i=>e[n]((r,...o)=>i(r.toProxy(),...o)):n==="root"?()=>e.root().toProxy():n==="nodes"?e.nodes.map(i=>i.toProxy()):n==="first"||n==="last"?e[n].toProxy():e[n]:e[n]},set(e,n,i){return e[n]===i||(e[n]=i,(n==="name"||n==="params"||n==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,n){let i=this.index(e),r=this.normalize(n,this.proxyOf.nodes[i]).reverse();i=this.index(e);for(let s of r)this.proxyOf.nodes.splice(i+1,0,s);let o;for(let s in this.indexes)o=this.indexes[s],i<o&&(this.indexes[s]=o+r.length);return this.markDirty(),this}insertBefore(e,n){let i=this.index(e),r=i===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[i],r).reverse();i=this.index(e);for(let l of o)this.proxyOf.nodes.splice(i,0,l);let s;for(let l in this.indexes)s=this.indexes[l],i<=s&&(this.indexes[l]=s+o.length);return this.markDirty(),this}normalize(e,n){if(typeof e=="string")e=jr(Vr(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Gr(e)]}else if(e.selector||e.selectors)e=[new Zn(e)];else if(e.name)e=[new Qn(e)];else if(e.text)e=[new Hr(e)];else throw new Error("Unknown node type in node creation");return e.map(r=>(r[Ur]||t.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[Wr]&&qr(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(...e){e=e.reverse();for(let n of e){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(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let n;for(let i in this.indexes)n=this.indexes[i],n>=e&&(this.indexes[i]=n-1);return this.markDirty(),this}replaceValues(e,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(e,i))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((n,i)=>{let r;try{r=e(n,i)}catch(o){throw n.addToError(o)}return r!==!1&&n.walk&&(r=n.walk(e)),r})}walkAtRules(e,n){return n?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="atrule"&&e.test(i.name))return n(i,r)}):this.walk((i,r)=>{if(i.type==="atrule"&&i.name===e)return n(i,r)}):(n=e,this.walk((i,r)=>{if(i.type==="atrule")return n(i,r)}))}walkComments(e){return this.walk((n,i)=>{if(n.type==="comment")return e(n,i)})}walkDecls(e,n){return n?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="decl"&&e.test(i.prop))return n(i,r)}):this.walk((i,r)=>{if(i.type==="decl"&&i.prop===e)return n(i,r)}):(n=e,this.walk((i,r)=>{if(i.type==="decl")return n(i,r)}))}walkRules(e,n){return n?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="rule"&&e.test(i.selector))return n(i,r)}):this.walk((i,r)=>{if(i.type==="rule"&&i.selector===e)return n(i,r)}):(n=e,this.walk((i,r)=>{if(i.type==="rule")return n(i,r)}))}};Re.registerParse=t=>{Vr=t};Re.registerRule=t=>{Zn=t};Re.registerAtRule=t=>{Qn=t};Re.registerRoot=t=>{zr=t};$r.exports=Re;Re.default=Re;Re.rebuild=t=>{t.type==="atrule"?Object.setPrototypeOf(t,Qn.prototype):t.type==="rule"?Object.setPrototypeOf(t,Zn.prototype):t.type==="decl"?Object.setPrototypeOf(t,Gr.prototype):t.type==="comment"?Object.setPrototypeOf(t,Hr.prototype):t.type==="root"&&Object.setPrototypeOf(t,zr.prototype),t[Ur]=!0,t.nodes&&t.nodes.forEach(e=>{Re.rebuild(e)})}});var ln=ne((nm,Jr)=>{"use strict";var Kr=$e(),ut=class extends Kr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};Jr.exports=ut;ut.default=ut;Kr.registerAtRule(ut)});var un=ne((im,Qr)=>{"use strict";var ul=$e(),Yr,Xr,it=class extends ul{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Yr(new Xr,this,e).stringify()}};it.registerLazyResult=t=>{Yr=t};it.registerProcessor=t=>{Xr=t};Qr.exports=it;it.default=it});var eo=ne((rm,Zr)=>{var cl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",dl=(t,e=21)=>(n=e)=>{let i="",r=n|0;for(;r--;)i+=t[Math.random()*t.length|0];return i},fl=(t=21)=>{let e="",n=t|0;for(;n--;)e+=cl[Math.random()*64|0];return e};Zr.exports={nanoid:fl,customAlphabet:dl}});var cn=ne(()=>{});var dn=ne(()=>{});var ei=ne(()=>{});var to=ne(()=>{});var ni=ne((mm,ro)=>{"use strict";var{existsSync:ml,readFileSync:pl}=to(),{dirname:ti,join:hl}=cn(),{SourceMapConsumer:no,SourceMapGenerator:io}=dn();function xl(t){return Buffer?Buffer.from(t,"base64").toString():window.atob(t)}var Ht=class{constructor(e,n){if(n.map===!1)return;n.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(e),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=ti(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new no(this.json||this.text)),this.consumerCache}decodeInline(e){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,/,s=e.match(r)||e.match(o);if(s)return decodeURIComponent(e.substr(s[0].length));let l=e.match(n)||e.match(i);if(l)return xl(e.substr(l[0].length));let a=e.slice(22);throw a=a.slice(0,a.indexOf(",")),new Error("Unsupported source map encoding "+a)}getAnnotationURL(e){return e.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let n=e.match(/\\/\\*\\s*# sourceMappingURL=/g);if(!n)return;let i=e.lastIndexOf(n.pop()),r=e.indexOf("*/",i);i>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(i,r)))}loadFile(e,n,i){if(!(!i&&!this.unsafeMap&&!/\\.map$/i.test(e))&&(this.root=ti(e),ml(e)))return this.mapFile=e,pl(e,"utf-8").toString().trim()}loadMap(e,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let i=n(e);if(i){let r=this.loadFile(i,e,!0);if(!r)throw new Error("Unable to load previous source map: "+i.toString());return r}}else{if(n instanceof no)return io.fromSourceMap(n).toString();if(n instanceof io)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;e&&(i=hl(ti(e),i));let r=this.loadFile(i,e,!1);if(r)try{this.json=JSON.parse(r.replace(/^\\)]}\'[^\\n]*\\n/,""))}catch{return}return r}}}startWith(e,n){return e?e.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};ro.exports=Ht;Ht.default=Ht});var Gt=ne((pm,uo)=>{"use strict";var{nanoid:gl}=eo(),{isAbsolute:oi,resolve:si}=cn(),{SourceMapConsumer:yl,SourceMapGenerator:bl}=dn(),{fileURLToPath:oo,pathToFileURL:fn}=ei(),so=sn(),Sl=ni(),ii=$n(),ri=Symbol("lineToIndexCache"),Al=!!(yl&&bl),ao=!!(si&&oi);function lo(t){if(t[ri])return t[ri];let e=t.css.split(`\n`),n=new Array(e.length),i=0;for(let r=0,o=e.length;r<o;r++)n[r]=i,i+=e[r].length+1;return t[ri]=n,n}var ct=class{get from(){return this.file||this.id}constructor(e,n={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.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&&(!ao||/^\\w+:\\/\\//.test(n.from)||oi(n.from)?this.file=n.from:this.file=si(n.from)),ao&&Al){let i=new Sl(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 "+gl(6)+">"),this.map&&(this.map.file=this.from)}error(e,n,i,r={}){let o,s,l,a,c;if(n&&typeof n=="object"){let m=n,f=i;if(typeof m.offset=="number"){a=m.offset;let x=this.fromOffset(a);n=x.line,i=x.col}else n=m.line,i=m.column,a=this.fromLineAndColumn(n,i);if(typeof f.offset=="number"){l=f.offset;let x=this.fromOffset(l);s=x.line,o=x.col}else s=f.line,o=f.column,l=this.fromLineAndColumn(f.line,f.column)}else if(i)a=this.fromLineAndColumn(n,i);else{a=n;let m=this.fromOffset(a);n=m.line,i=m.col}let u=this.origin(n,i,s,o);return u?c=new so(e,u.endLine===void 0?u.line:{column:u.column,line:u.line},u.endLine===void 0?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,r.plugin):c=new so(e,s===void 0?n:{column:i,line:n},s===void 0?i:{column:o,line:s},this.css,this.file,r.plugin),c.input={column:i,endColumn:o,endLine:s,endOffset:l,line:n,offset:a,source:this.css},this.file&&(fn&&(c.input.url=fn(this.file).toString()),c.input.file=this.file),c}fromLineAndColumn(e,n){return lo(this)[e-1]+n-1}fromOffset(e){let n=lo(this),i=n[n.length-1],r=0;if(e>=i)r=n.length-1;else{let o=n.length-2,s;for(;r<o;)if(s=r+(o-r>>1),e<n[s])o=s-1;else if(e>=n[s+1])r=s+1;else{r=s;break}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\\w+:\\/\\//.test(e)?e:si(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,n,i,r){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:n,line:e});if(!s.source)return!1;let l;typeof i=="number"&&(l=o.originalPositionFor({column:r,line:i}));let a;oi(s.source)?a=fn(s.source):a=new URL(s.source,this.map.consumer().sourceRoot||fn(this.map.mapFile));let c={column:s.column,endColumn:l&&l.column,endLine:l&&l.line,line:s.line,url:a.toString()};if(a.protocol==="file:")if(oo)c.file=oo(a);else throw new Error("file: protocol is not available in this PostCSS build");let u=o.sourceContentFor(s.source);return u&&(c.source=u),c}toJSON(){let e={};for(let n of["hasBOM","css","file","id"])this[n]!=null&&(e[n]=this[n]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};uo.exports=ct;ct.default=ct;ii&&ii.registerInput&&ii.registerInput(ct)});var dt=ne((hm,po)=>{"use strict";var co=$e(),fo,mo,Ke=class extends co{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,n,i){let r=super.normalize(e);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(e,n){let i=this.index(e);return!n&&i===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),super.removeChild(e)}toResult(e={}){return new fo(new mo,this,e).stringify()}};Ke.registerLazyResult=t=>{fo=t};Ke.registerProcessor=t=>{mo=t};po.exports=Ke;Ke.default=Ke;co.registerRoot(Ke)});var ai=ne((xm,ho)=>{"use strict";var Wt={comma(t){return Wt.split(t,[","],!0)},space(t){let e=[" ",`\n`," "];return Wt.split(t,e)},split(t,e,n){let i=[],r="",o=!1,s=0,l=!1,a="",c=!1;for(let u of t)c?c=!1:u==="\\\\"?c=!0:l?u===a&&(l=!1):u===\'"\'||u==="\'"?(l=!0,a=u):u==="("?s+=1:u===")"?s>0&&(s-=1):s===0&&e.includes(u)&&(o=!0),o?(r!==""&&i.push(r.trim()),r="",o=!1):r+=u;return(n||r!=="")&&i.push(r.trim()),i}};ho.exports=Wt;Wt.default=Wt});var mn=ne((gm,go)=>{"use strict";var xo=$e(),El=ai(),ft=class extends xo{get selectors(){return El.comma(this.selector)}set selectors(e){let n=this.selector?this.selector.match(/,\\s*/):null,i=n?n[0]:","+this.raw("between","beforeOpen");this.selector=e.join(i)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}};go.exports=ft;ft.default=ft;xo.registerRule(ft)});var bo=ne((ym,yo)=>{"use strict";var wl=ln(),Cl=Pt(),Fl=Bt(),Ml=Gt(),Nl=ni(),Tl=dt(),_l=mn();function Ut(t,e){if(Array.isArray(t))return t.map(r=>Ut(r));let{inputs:n,...i}=t;if(n){e=[];for(let r of n){let o={...r,__proto__:Ml.prototype};o.map&&(o.map={...o.map,__proto__:Nl.prototype}),e.push(o)}}if(i.nodes&&(i.nodes=t.nodes.map(r=>Ut(r,e))),i.source){let{inputId:r,...o}=i.source;i.source=o,r!=null&&(i.source.input=e[r])}if(i.type==="root")return new Tl(i);if(i.type==="decl")return new Fl(i);if(i.type==="rule")return new _l(i);if(i.type==="comment")return new Cl(i);if(i.type==="atrule")return new wl(i);throw new Error("Unknown node type: "+t.type)}yo.exports=Ut;Ut.default=Ut});var ui=ne((bm,Fo)=>{"use strict";var{dirname:pn,relative:Ao,resolve:Eo,sep:wo}=cn(),{SourceMapConsumer:Co,SourceMapGenerator:hn}=dn(),{pathToFileURL:So}=ei(),Ll=Gt(),vl=!!(Co&&hn),kl=!!(pn&&Eo&&Ao&&wo),li=class{constructor(e,n,i,r){this.stringify=e,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 e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let n=`\n`;this.css.includes(`\\r\n`)&&(n=`\\r\n`),this.css+=n+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let n=this.toUrl(this.path(e.file)),i=e.root||pn(e.file),r;this.mapOpts.sourcesContent===!1?(r=new Co(e.text),r.sourcesContent&&(r.sourcesContent=null)):r=e.consumer(),this.map.applySourceMap(r,n,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let e;for(let n=this.root.nodes.length-1;n>=0;n--)e=this.root.nodes[n],e.type==="comment"&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(n)}else if(this.css){let e;for(;(e=this.css.lastIndexOf("/*#"))!==-1;){let n=this.css.indexOf("*/",e+3);if(n===-1)break;for(;e>0&&this.css[e-1]===`\n`;)e--;this.css=this.css.slice(0,e)+this.css.slice(n+2)}}}}generate(){if(this.clearAnnotation(),kl&&vl&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,n=>{e+=n}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=hn.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new hn({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 hn({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,n=1,i="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(l,a,c)=>{if(this.css+=l,a&&c!=="end"&&(r.generated.line=e,r.generated.column=n-1,a.source&&a.source.start?(r.source=this.sourcePath(a),r.original.line=a.source.start.line,r.original.column=a.source.start.column-1,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,this.map.addMapping(r))),s=l.match(/\\n/g),s?(e+=s.length,o=l.lastIndexOf(`\n`),n=l.length-o):n+=l.length,a&&c!=="start"){let u=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==u.last||u.raws.semicolon)&&(a.source&&a.source.end?(r.source=this.sourcePath(a),r.original.line=a.source.end.line,r.original.column=a.source.end.column-1,r.generated.line=e,r.generated.column=n-2,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,r.generated.line=e,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(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!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(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\\w+:\\/\\//.test(e))return e;let n=this.memoizedPaths.get(e);if(n)return n;let i=this.opts.to?pn(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(i=pn(Eo(i,this.mapOpts.annotation)));let r=Ao(i,e);return this.memoizedPaths.set(e,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let n=e.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let e=new Ll(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(n=>{if(n.source){let i=n.source.input.from;if(i&&!e[i]){e[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(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let n=this.memoizedFileURLs.get(e);if(n)return n;if(So){let i=So(e).toString();return this.memoizedFileURLs.set(e,i),i}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let n=this.memoizedURLs.get(e);if(n)return n;wo==="\\\\"&&(e=e.replace(/\\\\/g,"/"));let i=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,i),i}};Fo.exports=li});var To=ne((Sm,No)=>{"use strict";var xn=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,gn=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,Rl=/.[\\r\\n"\'(/\\\\]/,Mo=/[\\da-f]/i;No.exports=function(e,n={}){let i=e.css.valueOf(),r=n.ignoreErrors,o,s,l,a,c,u,m,f,x,w,g=i.length,b=0,F=[],_=[],L=-1;function Q(){return b}function H(C){throw e.error("Unclosed "+C,b)}function N(){return _.length===0&&b>=g}function y(C){if(_.length)return _.pop();if(b>=g)return;let M=C?C.ignoreUnclosed:!1;switch(o=i.charCodeAt(b),o){case 10:case 32:case 9:case 13:case 12:{a=b;do a+=1,o=i.charCodeAt(a);while(o===32||o===10||o===9||o===13||o===12);u=["space",i.slice(b,a)],b=a-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let k=String.fromCharCode(o);u=[k,k,b];break}case 40:{if(w=F.length?F.pop()[1]:"",x=i.charCodeAt(b+1),w==="url"&&x!==39&&x!==34&&x!==32&&x!==10&&x!==9&&x!==12&&x!==13){a=b;do{if(m=!1,a=i.indexOf(")",a+1),a===-1)if(r||M){a=b;break}else H("bracket");for(f=a;i.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);u=["brackets",i.slice(b,a+1),b,a],b=a}else b<=L?u=["(","(",b]:(a=i.indexOf(")",b+1),s=i.slice(b,a+1),a===-1||Rl.test(s)?(L=a===-1?g:a,u=["(","(",b]):(u=["brackets",s,b,a],b=a));break}case 39:case 34:{c=o===39?"\'":\'"\',a=b;do{if(m=!1,a=i.indexOf(c,a+1),a===-1)if(r||M){a=b+1;break}else H("string");for(f=a;i.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);u=["string",i.slice(b,a+1),b,a],b=a;break}case 64:{xn.lastIndex=b+1,xn.test(i),xn.lastIndex===0?a=i.length-1:a=xn.lastIndex-2,u=["at-word",i.slice(b,a+1),b,a],b=a;break}case 92:{for(a=b,l=!0;i.charCodeAt(a+1)===92;)a+=1,l=!l;if(o=i.charCodeAt(a+1),l&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(a+=1,Mo.test(i.charAt(a)))){for(;Mo.test(i.charAt(a+1));)a+=1;i.charCodeAt(a+1)===32&&(a+=1)}u=["word",i.slice(b,a+1),b,a],b=a;break}default:{o===47&&i.charCodeAt(b+1)===42?(a=i.indexOf("*/",b+2)+1,a===0&&(r||M?a=i.length:H("comment")),u=["comment",i.slice(b,a+1),b,a],b=a):(gn.lastIndex=b+1,gn.test(i),gn.lastIndex===0?a=i.length-1:a=gn.lastIndex-2,u=["word",i.slice(b,a+1),b,a],F.push(u),b=a);break}}return b++,u}function A(C){_.push(C)}return{back:A,endOfFile:N,nextToken:y,position:Q}}});var ko=ne((Am,vo)=>{"use strict";var Dl=ln(),Il=Pt(),Pl=Bt(),Ol=dt(),_o=mn(),Bl=To(),Lo={empty:!0,space:!0};function Hl(t){for(let e=t.length-1;e>=0;e--){let n=t[e],i=n[3]||n[2];if(i)return i}}var ci=class{constructor(e){this.input=e,this.root=new Ol,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let n=new Dl;n.name=e[1].slice(1),n.name===""&&this.unnamedAtrule(n,e),this.init(n,e[2]);let i,r,o,s=!1,l=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),i=e[0],i==="("||i==="["?c.push(i==="("?")":"]"):i==="{"&&c.length>0?c.push("}"):i===c[c.length-1]&&c.pop(),c.length===0)if(i===";"){n.source.end=this.getPosition(e[2]),n.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){l=!0;break}else if(i==="}"){if(a.length>0){for(o=a.length-1,r=a[o];r&&r[0]==="space";)r=a[--o];r&&(n.source.end=this.getPosition(r[3]||r[2]),n.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),s&&(e=a[a.length-1],n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),l&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let n=this.colon(e);if(n===!1)return;let i=0,r;for(let o=n-1;o>=0&&(r=e[o],!(r[0]!=="space"&&(i+=1,i===2)));o--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(e){let n=0,i,r,o;for(let[s,l]of e.entries()){if(r=l,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 s}i=r}return!1}comment(e){let n=new Il;this.init(n,e[2]),n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++;let i=e[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=Bl(this.input)}decl(e,n){let i=new Pl;this.init(i,e[0][2]);let r=e[e.length-1];for(r[0]===";"&&(this.semicolon=!0,e.pop()),i.source.end=this.getPosition(r[3]||r[2]||Hl(e)),i.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),i.raws.before+=e.shift()[1];for(i.source.start=this.getPosition(e[0][2]),i.prop="";e.length;){let c=e[0][0];if(c===":"||c==="space"||c==="comment")break;i.prop+=e.shift()[1]}i.raws.between="";let o;for(;e.length;)if(o=e.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 s=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)s.push(e.shift());this.precheckMissedSemicolon(e);for(let c=e.length-1;c>=0;c--){if(o=e[c],o[1].toLowerCase()==="!important"){i.important=!0;let u=this.stringFrom(e,c);u=this.spacesFromEnd(e)+u,u!==" !important"&&(i.raws.important=u);break}else if(o[1].toLowerCase()==="important"){let u=e.slice(0),m="";for(let f=c;f>0;f--){let x=u[f][0];if(m.trim().startsWith("!")&&x!=="space")break;m=u.pop()[1]+m}m.trim().startsWith("!")&&(i.important=!0,i.raws.important=m,e=u)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(c=>c[0]!=="space"&&c[0]!=="comment")&&(i.raws.between+=s.map(c=>c[1]).join(""),s=[]),this.raw(i,"value",s.concat(e),n),i.value.includes(":")&&!n&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let n=new _o;this.init(n,e[2]),n.selector="",n.raws.between="",this.current=n}end(e){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(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}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(e){if(this.spaces+=e[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(e[2]),n.source.end.offset+=n.raws.ownSemicolon.length)}}getPosition(e){let n=this.input.fromOffset(e);return{column:n.col,line:n.line,offset:e}}init(e,n){this.current.push(e),e.source={input:this.input,start:this.getPosition(n)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let n=!1,i=null,r=!1,o=null,s=[],l=e[1].startsWith("--"),a=[],c=e;for(;c;){if(i=c[0],a.push(c),i==="("||i==="[")o||(o=c),s.push(i==="("?")":"]");else if(l&&r&&i==="{")o||(o=c),s.push("}");else if(s.length===0)if(i===";")if(r){this.decl(a,l);return}else break;else if(i==="{"){this.rule(a);return}else if(i==="}"){this.tokenizer.back(a.pop()),n=!0;break}else i===":"&&(r=!0);else i===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),s.length>0&&this.unclosedBracket(o),n&&r){if(!l)for(;a.length&&(c=a[a.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,n,i,r){let o,s,l=i.length,a="",c=!0,u,m;for(let f=0;f<l;f+=1)o=i[f],s=o[0],s==="space"&&f===l-1&&!r?c=!1:s==="comment"?(m=i[f-1]?i[f-1][0]:"empty",u=i[f+1]?i[f+1][0]:"empty",!Lo[m]&&!Lo[u]?a.slice(-1)===","?c=!1:a+=o[1]:c=!1):a+=o[1];if(!c){let f=i.reduce((x,w)=>x+w[1],"");e.raws[n]={raw:f,value:a}}e[n]=a}rule(e){e.pop();let n=new _o;this.init(n,e[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(n,"selector",e),this.current=n}spacesAndCommentsFromEnd(e){let n,i="";for(;e.length&&(n=e[e.length-1][0],!(n!=="space"&&n!=="comment"));)i=e.pop()[1]+i;return i}spacesAndCommentsFromStart(e){let n,i="";for(;e.length&&(n=e[0][0],!(n!=="space"&&n!=="comment"));)i+=e.shift()[1];return i}spacesFromEnd(e){let n,i="";for(;e.length&&(n=e[e.length-1][0],n==="space");)i=e.pop()[1]+i;return i}stringFrom(e,n){let i="";for(let r=n;r<e.length;r++)i+=e[r][1];return e.splice(n,e.length-n),i}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}};vo.exports=ci});var bn=ne((Em,Ro)=>{"use strict";var Gl=$e(),Wl=Gt(),Ul=ko();function yn(t,e){let n=new Wl(t,e),i=new Ul(n);try{i.parse()}catch(r){throw r}return i.root}Ro.exports=yn;yn.default=yn;Gl.registerParse(yn)});var di=ne((wm,Do)=>{"use strict";var Vt=class{constructor(e,n={}){if(this.type="warning",this.text=e,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}};Do.exports=Vt;Vt.default=Vt});var Sn=ne((Cm,Io)=>{"use strict";var Vl=di(),zt=class{get content(){return this.css}constructor(e,n,i){this.processor=e,this.messages=[],this.root=n,this.opts=i,this.css="",this.map=void 0}toString(){return this.css}warn(e,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let i=new Vl(e,n);return this.messages.push(i),i}warnings(){return this.messages.filter(e=>e.type==="warning")}};Io.exports=zt;zt.default=zt});var fi=ne((Fm,Oo)=>{"use strict";var Po={};Oo.exports=function(e){Po[e]||(Po[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))}});var hi=ne((Nm,Wo)=>{"use strict";var zl=$e(),jl=un(),ql=ui(),$l=bn(),Bo=Sn(),Kl=dt(),Jl=vt(),{isClean:Oe,my:Yl}=an(),Mm=fi(),Xl={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Ql={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},Zl={Once:!0,postcssPlugin:!0,prepare:!0},mt=0;function jt(t){return typeof t=="object"&&typeof t.then=="function"}function Go(t){let e=!1,n=Xl[t.type];return t.type==="decl"?e=t.prop.toLowerCase():t.type==="atrule"&&(e=t.name.toLowerCase()),e&&t.append?[n,n+"-"+e,mt,n+"Exit",n+"Exit-"+e]:e?[n,n+"-"+e,n+"Exit",n+"Exit-"+e]:t.append?[n,mt,n+"Exit"]:[n,n+"Exit"]}function Ho(t){let e;return t.type==="document"?e=["Document",mt,"DocumentExit"]:t.type==="root"?e=["Root",mt,"RootExit"]:e=Go(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function mi(t){return t[Oe]=!1,t.nodes&&t.nodes.forEach(e=>mi(e)),t}var pi={},Je=class t{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(e,n,i){this.stringified=!1,this.processed=!1;let r;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))r=mi(n);else if(n instanceof t||n instanceof Bo)r=mi(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=$l;i.syntax&&(o=i.syntax.parse),i.parser&&(o=i.parser),o.parse&&(o=o.parse);try{r=o(n,i)}catch(s){this.processed=!0,this.error=s}r&&!r[Yl]&&zl.rebuild(r)}this.result=new Bo(e,r,i),this.helpers={...pi,postcss:pi,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(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,n){let i=this.result.lastPlugin;try{n&&n.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=i.postcssPlugin,e.setMessage()):i.postcssVersion}catch(r){console&&console.error&&console.error(r)}return e}prepareVisitors(){this.listeners={};let e=(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(!Ql[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Zl[i])if(typeof n[i]=="object")for(let r in n[i])r==="*"?e(n,i,n[i][r]):e(n,i+"-"+r.toLowerCase(),n[i][r]);else typeof n[i]=="function"&&e(n,i,n[i])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let n=this.plugins[e],i=this.runOnRoot(n);if(jt(i))try{await i}catch(r){throw this.handleError(r)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Oe];){e[Oe]=!0;let n=[Ho(e)];for(;n.length>0;){let i=this.visitTick(n);if(jt(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(e.type==="document"){let r=e.nodes.map(o=>i(o,this.helpers));await Promise.all(r)}else await i(e,this.helpers)}catch(r){throw this.handleError(r)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let n=this.result.root.nodes.map(i=>e.Once(i,this.helpers));return jt(n[0])?Promise.all(n):n}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(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 e=this.result.opts,n=Jl;e.syntax&&(n=e.syntax.stringify),e.stringifier&&(n=e.stringifier),n.stringify&&(n=n.stringify);let i=this.result.root.source;if(e.map===void 0&&!(i&&i.input&&i.input.map)){let s="";return n(this.result.root,l=>{s+=l}),this.result.css=s,this.result}let o=new ql(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 e of this.plugins){let n=this.runOnRoot(e);if(jt(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Oe];)e[Oe]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let n of e.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,n){return this.async().then(e,n)}toString(){return this.css}visitSync(e,n){for(let[i,r]of e){this.result.lastPlugin=i;let o;try{o=r(n,this.helpers)}catch(s){throw this.handleError(s,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(jt(o))throw this.getAsyncError()}}visitTick(e){let n=e[e.length-1],{node:i,visitors:r}=n;if(i.type!=="root"&&i.type!=="document"&&!i.parent){e.pop();return}if(r.length>0&&n.visitorIndex<r.length){let[s,l]=r[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===r.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=s;try{return l(i.toProxy(),this.helpers)}catch(a){throw this.handleError(a,i)}}if(n.iterator!==0){let s=n.iterator,l;for(;l=i.nodes[i.indexes[s]];)if(i.indexes[s]+=1,!l[Oe]){l[Oe]=!0,e.push(Ho(l));return}n.iterator=0,delete i.indexes[s]}let o=n.events;for(;n.eventIndex<o.length;){let s=o[n.eventIndex];if(n.eventIndex+=1,s===mt){i.nodes&&i.nodes.length&&(i[Oe]=!0,n.iterator=i.getIterator());return}else if(this.listeners[s]){n.visitors=this.listeners[s];return}}e.pop()}walkSync(e){e[Oe]=!0;let n=Go(e);for(let i of n)if(i===mt)e.nodes&&e.each(r=>{r[Oe]||this.walkSync(r)});else{let r=this.listeners[i];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}};Je.registerPostcss=t=>{pi=t};Wo.exports=Je;Je.default=Je;Kl.registerLazyResult(Je);jl.registerLazyResult(Je)});var Vo=ne((_m,Uo)=>{"use strict";var eu=ui(),tu=bn(),nu=Sn(),iu=vt(),Tm=fi(),qt=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 e,n=tu;try{e=n(this._css,this._opts)}catch(i){this.error=i}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,n,i){n=n.toString(),this.stringified=!1,this._processor=e,this._css=n,this._opts=i,this._map=void 0;let r=iu;this.result=new nu(this._processor,void 0,this._opts),this.result.css=n;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let s=new eu(r,void 0,this._opts,n);if(s.isMap()){let[l,a]=s.generate();l&&(this.result.css=l),a&&(this.result.map=a)}else s.clearAnnotation(),this.result.css=s.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,n){return this.async().then(e,n)}toString(){return this._css}warnings(){return[]}};Uo.exports=qt;qt.default=qt});var jo=ne((Lm,zo)=>{"use strict";var ru=un(),ou=hi(),su=Vo(),au=dt(),rt=class{constructor(e=[]){this.version="8.5.14",this.plugins=this.normalize(e)}normalize(e){let n=[];for(let i of e)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(e,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new su(this,e,n):new ou(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};zo.exports=rt;rt.default=rt;au.registerProcessor(rt);ru.registerProcessor(rt)});var Zo=ne((vm,Qo)=>{"use strict";var qo=ln(),$o=Pt(),lu=$e(),uu=sn(),Ko=Bt(),Jo=un(),cu=bo(),du=Gt(),fu=hi(),mu=ai(),pu=Dt(),hu=bn(),xi=jo(),xu=Sn(),Yo=dt(),Xo=mn(),gu=vt(),yu=di();function oe(...t){return t.length===1&&Array.isArray(t[0])&&(t=t[0]),new xi(t)}oe.plugin=function(e,n){let i=!1;function r(...s){console&&console.warn&&!i&&(i=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let l=n(...s);return l.postcssPlugin=e,l.postcssVersion=new xi().version,l}let o;return Object.defineProperty(r,"postcss",{get(){return o||(o=r()),o}}),r.process=function(s,l,a){return oe([r(a)]).process(s,l)},r};oe.stringify=gu;oe.parse=hu;oe.fromJSON=cu;oe.list=mu;oe.comment=t=>new $o(t);oe.atRule=t=>new qo(t);oe.decl=t=>new Ko(t);oe.rule=t=>new Xo(t);oe.root=t=>new Yo(t);oe.document=t=>new Jo(t);oe.CssSyntaxError=uu;oe.Declaration=Ko;oe.Container=lu;oe.Processor=xi;oe.Document=Jo;oe.Comment=$o;oe.Warning=yu;oe.AtRule=qo;oe.Result=xu;oe.Input=du;oe.Rule=Xo;oe.Root=Yo;oe.Node=pu;fu.registerPostcss(oe);Qo.exports=oe;oe.default=oe});function rn(){return globalThis}function v(t,e){if(typeof window>"u")return;let n=rn(),i=n.__hf?.onSwallowed;if(i)try{i({label:t,error:e})}catch(r){}(n.__hfDebug||n.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${t} swallowed:`,e)}function Ae(t){try{window.parent.postMessage(t,"*")}catch(e){v("bridge.postMessage",e)}}var Sa={play:(t,e)=>e.onPlay(),pause:(t,e)=>e.onPause(),"stop-media":(t,e)=>e.onStopMedia(),seek:(t,e)=>e.onSeek(Number(t.frame??0),t.seekMode??"commit"),tick:(t,e)=>e.onTick(),"set-muted":(t,e)=>e.onSetMuted(!!t.muted),"set-volume":(t,e)=>e.onSetVolume(Math.max(0,Math.min(1,Number(t.volume??1)))),"set-media-output-muted":(t,e)=>e.onSetMediaOutputMuted(!!t.muted),"set-playback-rate":(t,e)=>e.onSetPlaybackRate(Number(t.playbackRate??1)),"set-color-grading":(t,e)=>e.onSetColorGrading(t.target??null,t.grading??null),"set-color-grading-compare":(t,e)=>e.onSetColorGradingCompare(t.target??null,t.compare??null),"enable-pick-mode":(t,e)=>e.onEnablePickMode(),"disable-pick-mode":(t,e)=>e.onDisablePickMode(),"flash-elements":t=>Aa(t)};function Aa(t){let e=t.selectors,n=t.duration||800;e&&Ea(e,n)}function $i(t){let e=n=>{let i=n.data;if(!i||i.source!=="hf-parent"||i.type!=="control")return;let r=i.action;if(typeof r!="string")return;let o=Sa[r];o&&o(i,t)};return window.addEventListener("message",e),Ae({source:"hf-preview",type:"ready"}),e}function Ea(t,e){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 ${e}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 t)try{document.querySelectorAll(n).forEach(r=>{r.classList.add("__hf-flash"),setTimeout(()=>r.classList.remove("__hf-flash"),e)})}catch(i){v("bridge.flashElements.querySelector",i)}}var Bn=null;function Ki(t){Bn=t}function At(t,e){if(Bn)try{Bn({source:"hf-preview",type:"analytics",event:t,properties:e??{}})}catch(n){v("runtime.analytics.site1",n)}}function Ji(t){let e=[],n=l=>{if(typeof l.getAnimations!="function")return[];try{return l.getAnimations()}catch{return[]}},i=(l,a)=>{for(let c of l){try{c.currentTime=a}catch(u){v("runtime.adapters.css.site1",u)}try{c.pause()}catch(u){v("runtime.adapters.css.site2",u)}}},r=l=>{for(let a of l)try{a.play()}catch(c){v("runtime.adapters.css.site3",c)}},o=l=>{for(let a of l)try{a.pause()}catch(c){v("runtime.adapters.css.site4",c)}},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:()=>{e=[];let l=document.querySelectorAll("*");for(let a of l){if(!(a instanceof HTMLElement))continue;let c=window.getComputedStyle(a);!c.animationName||c.animationName==="none"||e.push({el:a,baseDelay:a.style.animationDelay||"",basePlayState:a.style.animationPlayState||""})}},seek:l=>{let a=Number(l.time)||0;for(let c of e){if(!c.el.isConnected)continue;let u=t?.resolveStartSeconds?t.resolveStartSeconds(c.el):Number.parseFloat(c.el.getAttribute("data-start")??"0")||0,m=Math.max(0,a-u)*1e3,f=n(c.el);if(f.length>0){i(f,m);continue}c.el.style.animationPlayState="paused",c.el.style.animationDelay=`-${(m/1e3).toFixed(3)}s`}},pause:()=>{for(let l of e){if(!l.el.isConnected)continue;let a=n(l.el);a.length>0&&o(a),s(l)}},play:()=>{for(let l of e)l.el.isConnected&&(s(l),r(n(l.el)))},revert:()=>{e=[]}}}function Yi(t){return{name:"gsap",discover:()=>{},seek:e=>{let n=t.getTimeline();if(!n)return;n.pause();let i=Math.max(0,Number(e.time)||0);typeof n.totalTime=="function"?(n.totalTime(i+.001,!0),n.totalTime(i,!1)):n.seek(i,!1)},pause:()=>{let e=t.getTimeline();e&&e.pause()}}}function Xi(){return{name:"animejs",discover:()=>{try{let t=window.anime;if(!t||typeof t.running>"u")return;let e=t.running;if(!Array.isArray(e)||e.length===0)return;let n=window.__hfAnime??[],i=new Set(n);for(let r of e)i.has(r)||n.push(r);window.__hfAnime=n}catch(t){v("runtime.adapters.animejs.site1",t)}},seek:t=>{let e=Math.max(0,(Number(t.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let i of n)try{typeof i.seek=="function"&&i.seek(e)}catch(r){v("runtime.adapters.animejs.site2",r)}},pause:()=>{let t=window.__hfAnime;if(!(!t||t.length===0))for(let e of t)try{typeof e.pause=="function"&&e.pause()}catch(n){v("runtime.adapters.animejs.site3",n)}},play:()=>{let t=window.__hfAnime;if(!(!t||t.length===0))for(let e of t)try{typeof e.play=="function"&&e.play()}catch(n){v("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function er(){return{name:"lottie",discover:()=>{try{let t=window.lottie;if(t&&typeof t.getRegisteredAnimations=="function"){let e=t.getRegisteredAnimations();if(Array.isArray(e)&&e.length>0){let n=window.__hfLottie??[],i=new Set(n);for(let r of e)i.has(r)||n.push(r);window.__hfLottie=n}}}catch(t){v("runtime.adapters.lottie.site1",t)}},seek:t=>{let e=Math.max(0,Number(t.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let i of n)try{if(Qi(i))i.goToAndStop(e*1e3,!1);else if(Zi(i)){if(typeof i.setCurrentRawFrameValue=="function"){let r=i.totalFrames??0,o=i.frameRate??30,s=e*o;r>0&&i.setCurrentRawFrameValue(Math.min(s,r-1))}else if(typeof i.seek=="function"){let r=i.duration??1,o=Math.min(100,e/r*100);i.seek(o)}}}catch(r){v("runtime.adapters.lottie.site2",r)}},pause:()=>{let t=window.__hfLottie;if(!(!t||t.length===0))for(let e of t)try{(Qi(e)||Zi(e))&&e.pause()}catch(n){v("runtime.adapters.lottie.site3",n)}},revert:()=>{}}}function Qi(t){return typeof t=="object"&&t!==null&&typeof t.goToAndStop=="function"}function Zi(t){return typeof t=="object"&&t!==null&&typeof t.pause=="function"&&("totalFrames"in t||"duration"in t)}var Hn=-1;function on(t){if(t!==Hn){Hn=t;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:t}}))}catch(e){v("runtime.adapters.seek-dispatch.site1",e)}}}function tr(t){Hn=t;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:t}}))}catch(e){v("runtime.adapters.seek-dispatch.force",e)}}function nr(){let t=null,e=0,n=null,i=null,r=null,o=null,s=()=>{if(typeof window>"u")return null;let u=window.THREE?.DefaultLoadingManager;return!u||typeof u!="object"||typeof u.itemsLoaded!="number"||typeof u.itemsTotal!="number"?null:u},l=c=>{o||c.itemsTotal<=c.itemsLoaded||(o=new Promise(u=>{c.onLoad=function(){try{r?.call(this)}finally{o=null,c.onLoad=r??null,u()}}}))},a=c=>{n!==c&&(n=c,i=c.onStart??null,r=c.onLoad??null,c.onStart=function(u,m,f){try{i?.call(this,u,m,f)}finally{l(c)}})};return{name:"three",discover:()=>{let c=s();c&&(a(c),l(c))},seek:c=>{t=Math.max(0,Number(c.time)||0),e=t,window.__hfThreeTime=t,on(t)},pause:()=>{t==null&&(t=Math.max(0,e))},play:()=>{t=null},revert:()=>{t=null,e=0},getReadyPromise:()=>{let c=s();return!c||c.itemsTotal<=c.itemsLoaded?null:(o||l(c),o)}}}function Pe(t){let e=null,n=new WeakSet;return{name:t.name,discover:()=>{},seek:()=>{},pause:()=>{},play:()=>{},revert:()=>{},getReadyPromise:()=>{let i=t.getInstances();if(i.length===0)return null;let r=i.filter(o=>!n.has(o));return r.length===0?null:e||(e=Promise.allSettled(r.map(o=>t.waitFor(o).then(()=>{n.add(o)}))).then(()=>{e=null}),e)}}}function ir(){return Pe({name:"mapbox",getInstances:()=>{if(typeof window>"u")return[];let t=window.__hfMapbox;return Array.isArray(t)?t:[]},waitFor:t=>new Promise(e=>{if(t.loaded()){e();return}t.on("load",e)})})}function rr(){return Pe({name:"leaflet",getInstances:()=>{if(typeof window>"u")return[];let t=window.__hfLeaflet;return Array.isArray(t)?t:[]},waitFor:t=>new Promise(e=>t.whenReady(e))})}function or(){return Pe({name:"google-maps",getInstances:()=>{if(typeof window>"u")return[];let t=window.__hfGoogleMaps;return Array.isArray(t)?t:[]},waitFor:t=>new Promise(e=>{let n=t.addListener("tilesloaded",()=>{n.remove(),e()})})})}function sr(){return Pe({name:"maplibre",getInstances:()=>{if(typeof window>"u")return[];let t=window.__hfMaplibre;return Array.isArray(t)?t:[]},waitFor:t=>new Promise(e=>{if(t.loaded()){e();return}t.on("load",e)})})}function ar(){return Pe({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let t=window.__hfD3;return Array.isArray(t)?t:[]},waitFor:t=>t.end()})}function lr(){let t=null,e=0;return{name:"typegpu",discover:()=>{},seek:n=>{t=Math.max(0,Number(n.time)||0),e=t,window.__hfTypegpuTime=t,on(t)},pause:()=>{t==null&&(t=Math.max(0,e))},play:()=>{t=null},revert:()=>{t=null,e=0}}}function ur(t){let e=t.nextElementSibling;if(e instanceof HTMLImageElement&&e.classList.contains("__render_frame__")&&e.complete&&e.naturalWidth>0)return e;if(t.id){let n=document.getElementById(`__render_frame_${t.id}__`);if(n instanceof HTMLImageElement&&n.complete&&n.naturalWidth>0)return n}return null}function cr(){let t=globalThis.GPUQueue;if(!t?.prototype?.copyExternalImageToTexture)return;let e=t.prototype.copyExternalImageToTexture;t.prototype.copyExternalImageToTexture=function(n,i,r){if(n?.source instanceof HTMLVideoElement){let o=ur(n.source);if(o)return e.call(this,{...n,source:o},i,r)}return e.call(this,n,i,r)}}function dr(){let t=[globalThis.WebGL2RenderingContext,globalThis.WebGLRenderingContext],e=["texImage2D","texSubImage2D"];for(let n of t){let i=n?.prototype;if(i)for(let r of e){let o=i[r];if(typeof o!="function"||o.__hfVideoPatched)continue;let s=function(...l){let a=l.length-1,c=l[a];if(c instanceof HTMLVideoElement){let u=ur(c);u&&(l[a]=u)}return o.apply(this,l)};s.__hfVideoPatched=!0,i[r]=s}}}function fr(){let t=!1,e=0,n=new WeakMap,i=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},r=l=>{let a=Number(l.currentTime);return Number.isFinite(a)&&a>0?a:0},o=(l,a)=>a<=0?l:l>=a?Math.max(0,l-a):l,s=(l,a)=>{let c=n.get(l);if(c)return c;let u={compositionTimeMs:a,animationTimeMs:t?o(r(l),a):r(l)};return n.set(l,u),u};return{name:"waapi",discover:()=>{t=!0;for(let l of i())s(l,e)},seek:l=>{let a=Math.max(0,(Number(l.time)||0)*1e3);e=a;for(let c of i()){let u=t?s(c,a):s(c,0),m=u.animationTimeMs+Math.max(0,a-u.compositionTimeMs);try{c.currentTime=m}catch(f){v("runtime.adapters.waapi.site1",f)}try{c.pause()}catch(f){v("runtime.adapters.waapi.site2",f)}}},pause:()=>{if(document.getAnimations)for(let l of document.getAnimations())try{l.pause()}catch(a){v("runtime.adapters.waapi.site3",a)}}}}function mr(t,e){if(t.length===0)return 1;let n=0;for(;n<t.length-2&&e>=t[n+1].time;)n+=1;let i=t[n],r=t[n+1]??i,o=r.time-i.time,s=o<=0?0:Math.min(1,Math.max(0,(e-i.time)/o));return i.volume+(r.volume-i.volume)*s}function wa(t,e,n,i){let r=Number.parseFloat(t.dataset.start??"0")||0,o=Number.parseFloat(t.dataset.end??""),s=Number.parseFloat(t.dataset.duration??""),l=Number.isFinite(o)&&o>r?o:Number.isFinite(s)&&s>0?r+s:n,a=Number.parseFloat(t.dataset.volume??""),c=Number.isFinite(a)?Math.max(0,Math.min(1,a)):1;t.volume=c;let u=1/Math.min(60,Math.max(1,i)),m=Math.max(0,r),f=Math.min(n,l),x=[];for(let g=m;g<=f+1e-6;g+=u){let b=Math.min(f,g);e(b);let F=Number(t.volume);if(!Number.isFinite(F))continue;let _=Math.max(0,Math.min(1,F)),L=x.at(-1);if((!L||Math.abs(L.volume-_)>1e-4||b===f)&&x.push({time:Number(b.toFixed(6)),volume:Number(_.toFixed(6))}),b===f)break}return x.some(g=>Math.abs(g.volume-c)>1e-4)?x:null}function pr(t,e,n,i){if(!e||!(t instanceof HTMLAudioElement)&&!(t instanceof HTMLVideoElement)||n<=0)return;let o=wa(t,s=>{try{typeof e.totalTime=="function"?e.totalTime(s,!0):typeof e.seek=="function"&&e.seek(s,!0)}catch{}},n,60);o&&i.set(t,o)}function Ct(t){let e=t.defaultPlaybackRate;return Number.isFinite(e)&&e>0?Math.max(.1,Math.min(5,e)):1}function hr(t){let e=Array.from(document.querySelectorAll("video, audio")),n=t?.shouldIncludeElement?e.filter(s=>t.shouldIncludeElement?.(s)):e.filter(s=>s.hasAttribute("data-start")),i=[],r=[],o=0;for(let s of n){let l=t?.resolveStartSeconds?t.resolveStartSeconds(s):Number.parseFloat(s.dataset.start??"0");if(!Number.isFinite(l))continue;let a=Number.parseFloat(s.dataset.playbackStart??s.dataset.mediaStart??"0")||0,c=Ct(s),u=s.loop,m=Number.isFinite(s.duration)&&s.duration>0?s.duration:null,f=t?.resolveDurationSeconds?.(s)??Number.parseFloat(s.dataset.duration??"");(!Number.isFinite(f)||f<=0)&&m!=null&&(f=Math.max(0,(m-a)/c));let x=Number.isFinite(f)&&f>0?l+f:Number.POSITIVE_INFINITY,w=Number.parseFloat(s.dataset.volume??""),g={el:s,start:l,mediaStart:a,duration:Number.isFinite(f)&&f>0?f:Number.POSITIVE_INFINITY,end:x,volume:Number.isFinite(w)?w:null,playbackRate:c,loop:u,sourceDuration:m};i.push(g),s.tagName==="VIDEO"&&r.push(g),Number.isFinite(x)&&(o=Math.max(o,x))}return{timedMediaEls:n,mediaClips:i,videoClips:r,maxMediaEnd:o}}var Gn=new WeakMap,Et=new WeakMap,Wn=new WeakSet,at=new WeakSet;function Ca(t){if(at.has(t))return;at.add(t);let e=()=>at.delete(t);t.addEventListener("playing",e,{once:!0}),t.addEventListener("pause",e,{once:!0}),t.addEventListener("error",e,{once:!0})}var Fa=3;function Ma(t){return t.error!=null||t.networkState===Fa}var Un=new WeakMap;function wt(t){return Number.isFinite(t)?Math.max(0,Math.min(1,t)):1}function xr(t){let e=!!(t.outputMuted||t.userMuted);for(let n of t.clips){let{el:i}=n;if(!i.isConnected)continue;let r=(t.timeSeconds-n.start)*n.playbackRate+n.mediaStart;if(t.timeSeconds>=n.start&&t.timeSeconds<=n.end&&r>=0&&(!i.ended||n.loop)){if(n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let M=n.sourceDuration-n.mediaStart;M>0&&r>=n.sourceDuration&&(r=n.mediaStart+(r-n.mediaStart)%M)}let s=wt(t.userVolume??1),l=wt(n.volume??1),a=Un.get(i),c=wt(i.volume),u;n.volumeKeyframes&&n.volumeKeyframes.length>0?u=wt(mr(n.volumeKeyframes,r)):a===void 0||Math.abs(c-a)>1e-4?u=c:u=l;let m=wt(u*s);i.volume=m,Un.set(i,m),t.onElementVolume?.(i,m),(e||t.isWebAudioOwned?.(i))&&(i.muted=!0),i.preload!=="auto"&&(i.preload="auto");try{i.playbackRate=n.playbackRate*t.playbackRate}catch(M){v("runtime.media.site1",M)}let f=.04,x=2,w=i.currentTime||0,g=Math.abs(w-r),b=r-w,F=Gn.get(i);Gn.set(i,b);let _=F===void 0,L=!_&&Math.abs(b-F)>.5,Q=g>3,H=g>.5&&(_||L||Q),N=i.tagName==="VIDEO"&&!i.paused,y=F!==void 0&&Math.abs(b-F)<.004,A=!1;if(!N&&!H&&!_&&y&&g>f){let M=(Et.get(i)??0)+1;Et.set(i,M),M>=x&&(A=!0,Et.set(i,0))}else g<=f&&Et.set(i,0);let C=!N&&t.forceSync&&g>.02;if(H||A||C){try{i.currentTime=r}catch(M){v("runtime.media.site2",M)}if(Math.abs(i.currentTime-r)>.5&&!Wn.has(i)){Wn.add(i),i.load();try{i.currentTime=r}catch(M){v("runtime.media.site3",M)}}at.delete(i)}t.playing&&i.paused&&!at.has(i)&&!Ma(i)?(Ca(i),i.play().catch(M=>{at.delete(i),(M&&typeof M=="object"&&"name"in M?String(M.name??""):"")==="NotAllowedError"&&t.onAutoplayBlocked?.()})):!t.playing&&!i.paused&&i.pause();continue}Gn.delete(i),Et.delete(i),Wn.delete(i),Un.delete(i),i.paused||i.pause()}}var Na=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),Ta=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(","),_a="data-hf-color-grading-source-hidden";function gr(t){let e=!1,n=null,i=null,r=null,o=null;function s(y,A){try{window.dispatchEvent(new CustomEvent(y,{detail:A}))}catch(C){v("runtime.picker.site1",C)}}function l(y){r=y,s("hyperframe:picker:hovered",{elementInfo:r,isPickMode:e,timestamp:Date.now()})}function a(y){o=y,s("hyperframe:picker:selected",{elementInfo:o,isPickMode:e,timestamp:Date.now()})}function c(y){let A=y.ownerDocument.defaultView;if(!A)return!1;let C=y;for(;C&&C!==document.body&&C!==document.documentElement;){let M=A.getComputedStyle(C);if(M.display==="none"||M.visibility==="hidden"||M.pointerEvents==="none")return!0;let k=Number.parseFloat(M.opacity);if(Number.isFinite(k)&&k<=.01&&!C.hasAttribute(_a))return!0;C=C.parentElement}return!1}function u(y){if(!y||y===document.body||y===document.documentElement)return!1;let A=y.tagName.toLowerCase();return!(A==="script"||A==="style"||A==="link"||A==="meta"||y.classList.contains("__hf-pick-highlight")||y.closest(Na)||c(y))}function m(y){return!!y?.closest(Ta)}function f(y){let A=y;if(A.id)return`#${A.id}`;let C=y.getAttribute("data-composition-id");if(C)return`[data-composition-id="${CSS.escape(C)}"]`;let M=y.getAttribute("data-composition-src");if(M)return`[data-composition-src="${CSS.escape(M)}"]`;let k=y.getAttribute("data-track-index");if(k)return`[data-track-index="${CSS.escape(k)}"]`;let G=y.tagName.toLowerCase(),z=y.parentElement;if(!z)return G;let ee=z.querySelectorAll(`:scope > ${G}`);if(ee.length===1)return G;for(let R=0;R<ee.length;R+=1)if(ee[R]===y)return`${G}:nth-of-type(${R+1})`;return G}function x(y){let A=y.tagName.toLowerCase(),C=(y.textContent??"").trim().replace(/\\s+/g," "),M=(k,G)=>k.length>G?`${k.slice(0,G-1)}\\u2026`:k;return A==="h1"||A==="h2"||A==="h3"?"Heading":A==="p"||A==="span"||A==="div"?C.length>0?M(C,56):"Text":A==="img"?"Image":A==="video"?"Video":A==="audio"?"Audio":A==="svg"?"Shape":y.getAttribute("data-composition-src")?"Composition":A==="section"?"Section":`${A.charAt(0).toUpperCase()}${A.slice(1)}`}function w(y,A,C){let M=typeof C=="number"&&C>0?C:8,k=[];if(document.elementsFromPoint)k=document.elementsFromPoint(y,A);else if(document.elementFromPoint){let ee=document.elementFromPoint(y,A);k=ee?[ee]:[]}if(m(k[0]??null))return[];let G={},z=[];for(let ee=0;ee<k.length;ee+=1){let R=k[ee];if(!u(R))continue;let U=`${R.tagName}::${R.id||""}::${ee}`;if(!G[U]&&(G[U]=!0,z.push(R),z.length>=M))break}return z}function g(y){let A=y.getBoundingClientRect(),C={};for(let k=0;k<y.attributes.length;k+=1){let G=y.attributes[k];G.name.startsWith("data-")&&(C[G.name]=G.value)}return{id:y.id||null,tagName:y.tagName.toLowerCase(),selector:f(y),label:x(y),boundingBox:{x:A.left,y:A.top,width:A.width,height:A.height},textContent:y.textContent?y.textContent.trim().slice(0,200):null,src:y.getAttribute("src")||y.getAttribute("data-composition-src")||null,dataAttributes:C}}function b(y,A,C){return w(y,A,C).map(g)}function F(y){if(!e)return;let C=w(y.clientX,y.clientY,1)[0]??(y.target instanceof Element?y.target:null);if(!u(C)||n===C)return;n&&n.classList.remove("__hf-pick-highlight"),n=C,C.classList.add("__hf-pick-highlight");let M=g(C);l(M),t.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:M})}function _(y){if(!e)return;y.preventDefault(),y.stopPropagation(),y.stopImmediatePropagation();let A=b(y.clientX,y.clientY,8);A.length!==0&&(l(A[0]??null),t.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:A,selectedIndex:0,point:{x:y.clientX,y:y.clientY}}))}function L(y){y.key==="Escape"&&(H(),t.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function Q(){e||(e=!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",F,!0),document.addEventListener("click",_,!0),document.addEventListener("keydown",L,!0),s("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function H(){e&&(e=!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",F,!0),document.removeEventListener("click",_,!0),document.removeEventListener("keydown",L,!0),s("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function N(){window.__HF_PICKER_API={enable:Q,disable:H,isActive:()=>e,getHovered:()=>r,getSelected:()=>o,getCandidatesAtPoint:(y,A,C)=>Number.isFinite(y)&&Number.isFinite(A)?b(y,A,C):[],pickAtPoint:(y,A,C)=>{if(!Number.isFinite(y)||!Number.isFinite(A))return null;let M=b(y,A,8);if(!M.length)return null;let k=Math.max(0,Math.min(M.length-1,Number(C??0))),G=M[k]??null;return G?(a(G),t.postMessage({source:"hf-preview",type:"element-picked",elementInfo:G}),H(),G):null},pickManyAtPoint:(y,A,C)=>{if(!Number.isFinite(y)||!Number.isFinite(A))return[];let M=b(y,A,8);if(!M.length)return[];let k=[],G=Array.isArray(C)?C:[0];for(let z of G){let ee=Math.max(0,Math.min(M.length-1,Math.floor(Number(z)))),R=M[ee];if(!R)continue;k.some(Ne=>Ne.selector===R.selector&&Ne.tagName===R.tagName)||k.push(R)}return k.length?(a(k[0]??null),t.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:k}),H(),k):[]}},s("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:Q,disablePickMode:H,installPickerApi:N}}var La=["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 lt(t,e){let n=Number.isFinite(e)&&e>0?e:30,i=Number.isFinite(t)&&t>0?t:0;return Math.floor(i*n+1e-9)/n}function yr(t,e,n=La){for(let i of n){let r=e.getPropertyValue(i);r&&t.setProperty(i,r)}}function Ft(t,e,n){let i=t?.[e];return typeof i=="function"?Number(i.call(t))||n:typeof i=="number"&&Number.isFinite(i)?i:(i!=null&&v("runtime.player.nonConformantNum",{prop:e,actual:typeof i}),n)}function ke(t,e){let n=t?.[e];if(typeof n=="function"){n.call(t);return}n!==void 0&&v("runtime.player.nonConformantVoid",{method:e,actual:typeof n})}function Mt(t,e,n){if(t){for(let i of Object.values(t))if(!(!i||i===e))try{n(i)}catch(r){v("runtime.player.site1",r)}}}function br(t,e,n){let i=lt(e,n);return ke(t,"pause"),typeof t.totalTime=="function"?t.totalTime(i,!1):typeof t.seek=="function"&&t.seek(i,!1),i}function va(t,e,n,i){let r=[];Mt(t,e,o=>{ke(o,"play"),r.push(o)});try{return br(e,n,i)}finally{for(let o of r)try{ke(o,"pause")}catch(s){v("runtime.player.site2",s)}}}function ka(t,e){Mt(t,e,n=>{ke(n,"play")})}function Sr(t){return{_timeline:null,play:()=>{let e=t.getTimeline();if(!e||t.getIsPlaying())return;let n=Math.max(0,Number(t.getSafeDuration?.()??Ft(e,"duration",0))||0);n>0&&Math.max(0,Ft(e,"time",0))>=n&&(ke(e,"pause"),typeof e.seek=="function"&&e.seek(0,!1),t.onDeterministicSeek(0),t.setIsPlaying(!1),t.onSyncMedia(0,!1),t.onRenderFrameSeek(0)),typeof e.timeScale=="function"&&e.timeScale(t.getPlaybackRate()),ke(e,"play"),Mt(t.getTimelineRegistry?.(),e,i=>{typeof i.timeScale=="function"&&i.timeScale(t.getPlaybackRate()),ke(i,"play")}),t.onDeterministicPlay(),t.setIsPlaying(!0),t.onShowNativeVideos(),t.onStatePost(!0)},pause:()=>{let e=t.getTimeline();if(!e)return;ke(e,"pause"),Mt(t.getTimelineRegistry?.(),e,i=>{ke(i,"pause")});let n=Math.max(0,Ft(e,"time",0));t.onDeterministicSeek(n),t.onDeterministicPause(),t.setIsPlaying(!1),t.onSyncMedia(n,!1),t.onRenderFrameSeek(n),t.onStatePost(!0)},seek:(e,n)=>{let i=t.getTimeline();if(!i)return;let r=Math.max(0,Number(e)||0),o=t.getIsPlaying(),s=va(t.getTimelineRegistry?.(),i,r,t.getCanonicalFps());t.onDeterministicSeek(s),n?.keepPlaying&&o?(typeof i.timeScale=="function"&&i.timeScale(t.getPlaybackRate()),ke(i,"play"),Mt(t.getTimelineRegistry?.(),i,l=>{typeof l.timeScale=="function"&&l.timeScale(t.getPlaybackRate()),ke(l,"play")}),t.onDeterministicPlay(),t.onShowNativeVideos(),t.onSyncMedia(s,!0)):(t.setIsPlaying(!1),t.onSyncMedia(s,!1)),t.onRenderFrameSeek(s),t.onStatePost(!0)},renderSeek:e=>{let n=t.getTimeline(),i=t.getCanonicalFps(),r=n?(ka(t.getTimelineRegistry?.(),n),br(n,e,i)):lt(Math.max(0,Number(e)||0),i);t.onDeterministicSeek(r),t.setIsPlaying(!1),t.onSyncMedia(r,!1),t.onRenderFrameSeek(r),t.onStatePost(!0)},getTime:()=>Ft(t.getTimeline(),"time",0),getDuration:()=>Ft(t.getTimeline(),"duration",0),isPlaying:()=>t.getIsPlaying(),setPlaybackRate:e=>t.setPlaybackRate(e),getPlaybackRate:()=>t.getPlaybackRate()}}function Ar(){return{capturedTimeline:null,isPlaying:!1,currentTime:0,deterministicAdapters:[],canonicalFps:30,bridgeMuted:!1,bridgeVolume:1,mediaOutputMuted:!1,mediaAutoplayBlockedPosted:!1,mediaForceSyncNextTick:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,controlBridgeHandler:null,beforeUnloadHandler:null,injectedCompStyles:[],injectedCompScripts:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,transportClock:null,transportRafId:null}}var Ra="data-hf-authored-duration",Da="data-hf-authored-end";function nt(t){if(t==null||t==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}function Ia(t){return nt(t.getAttribute("data-duration"))}function Pa(t){return nt(t.getAttribute("data-end"))}function Oa(t){return nt(t.getAttribute(Ra))}function Ba(t){return nt(t.getAttribute(Da))}function Ha(t){let e=(t??"").trim();if(!e)return null;let n=nt(e);if(n!=null)return{kind:"absolute",value:n};let i=e.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]??"+",s=i[3]??"0",l=Number.parseFloat(s),a=Number.isFinite(l)?Math.max(0,l):0,c=o==="-"?-a:a;return{kind:"reference",refId:r,offset:c}}function je(t){let e=t.timelineRegistry??{},n=t.includeAuthoredTimingAttrs??!1,i=new WeakMap,r=new WeakMap,o=new Set,s=u=>{let m=document.getElementById(u);return m||(document.querySelector(`[data-composition-id="${CSS.escape(u)}"]`)??null)},l=u=>{let m=r.get(u);if(m!==void 0)return m;let f=null,x=Ia(u)??(n?Oa(u):null);if(x!=null&&x>0&&(f=x),f==null||f<=0){let w=Pa(u)??(n?Ba(u):null);if(w!=null){let g=c(u,0),b=w-g;Number.isFinite(b)&&b>0&&(f=b)}}if((f==null||f<=0)&&u instanceof HTMLMediaElement){let w=nt(u.getAttribute("data-playback-start"))??nt(u.getAttribute("data-media-start"))??0;Number.isFinite(u.duration)&&u.duration>w&&(f=(u.duration-w)/Ct(u))}if(f==null||f<=0){let w=u.getAttribute("data-composition-id");if(w){let g=e[w]??null;if(g&&typeof g.duration=="function")try{let b=Number(g.duration());Number.isFinite(b)&&b>0&&(f=b)}catch(b){v("runtime.startResolver.site1",b)}}}return f!=null&&Number.isFinite(f)&&f>0?(r.set(u,f),f):(r.set(u,null),null)},a=(u,m)=>{if(u.hasAttribute("data-composition-id")){let x=u.parentElement?.closest("[data-composition-id]");return x?c(x,m):0}let f=u.closest("[data-composition-id]");return f?c(f,m):0},c=(u,m)=>{let f=i.get(u);if(f!==void 0)return f??m;if(o.has(u))return m;o.add(u);try{let x=Ha(u.getAttribute("data-start"));if(!x){if(u.hasAttribute("data-composition-id")){let _=u.parentElement;if(_&&(_.hasAttribute("data-composition-src")||_.hasAttribute("data-composition-id"))){let L=c(_,m);return i.set(u,L),L}}return i.set(u,m),m}if(x.kind==="absolute"){let _=Math.max(0,x.value),L=Math.max(0,a(u,m)+_);return i.set(u,L),L}let w=s(x.refId);if(!w)return i.set(u,m),m;let g=c(w,0),b=l(w);if(b==null||b<=0){let _=Math.max(0,g+x.offset);return i.set(u,_),_}let F=Math.max(0,g+b+x.offset);return i.set(u,F),F}finally{o.delete(u)}};return{resolveStartForElement:(u,m=0)=>c(u,Math.max(0,m)),resolveDurationForElement:u=>l(u)}}function Er(t){let e=t.trim().toLowerCase();return!(!e||e==="main"||e.includes("caption")||e.includes("ambient"))}var Ga="data-hf-authored-duration",Wa="data-hf-authored-end";function Ce(t){if(t==null||t==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}function Vn(t){return Ce(t.getAttribute("data-duration"))??Ce(t.getAttribute(Ga))}function wr(t){return Ce(t.getAttribute("data-end"))??Ce(t.getAttribute(Wa))}function zn(...t){let e=t.filter(n=>Number.isFinite(n??null));return e.length===0?null:Math.max(...e)}var Cr={composition:0,video:1,image:2,element:3,audio:4};function Ua(t){if(t.length===0)return;let e=new Map;for(let s of t){let l=e.get(s.track)??new Set;l.add(s.kind),e.set(s.track,l)}if(!Array.from(e.values()).some(s=>s.size>1))return;let i=0,r=new Map,o=[...e.keys()].sort((s,l)=>s-l);for(let s of o){let l=e.get(s);if(l.size===1)r.set(`${s}:${[...l][0]}`,i++);else{let a=[...l].sort((c,u)=>(Cr[c]??99)-(Cr[u]??99));for(let c of a)r.set(`${s}:${c}`,i++)}}for(let s of t){let l=`${s.track}:${s.kind}`,a=r.get(l);a!=null&&(s.track=a)}}function Tt(t){let e=String(t??"").trim();if(!e)return null;let n=e.toLowerCase();if(n.startsWith("data:")||n.startsWith("javascript:"))return null;try{return new URL(e,document.baseURI).toString()}catch{return e}}function Fr(t){let e=t.getAttribute("src")??t.getAttribute("data-src");if(e)return Tt(e);let n=t.getAttribute("data-composition-src");if(n)return Tt(n);let i=t.querySelector("img[src], video[src], audio[src], source[src]");return i?Tt(i.getAttribute("src")):null}function Va(t){let e=t.className;return typeof e!="string"?null:e.split(/\\s+/).map(n=>n.trim()).find(n=>n&&n!=="clip"&&!n.startsWith("__hf-"))??null}function za(t){if(!t)return null;try{return new URL(t,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return t.split(/[\\\\/]/).filter(Boolean).at(-1)??null}}function ja(t){let e=t.textContent?.replace(/\\s+/g," ").trim();return e?e.length>32?`${e.slice(0,31)}...`:e:null}function Nt(t){let e=t.replace(/\\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\\s+/g," ").trim();return e?e.replace(/\\b\\w/g,n=>n.toUpperCase()):t}function qa(t,e,n){let i=t.getAttribute("data-timeline-label")??t.getAttribute("data-label")??t.getAttribute("aria-label")??null;if(i?.trim())return i.trim();let r=t.getAttribute("data-composition-id");if(r)return Nt(r);let o=t.id;if(o)return Nt(o);let s=Va(t);if(s)return Nt(s);let l=za(Fr(t));if(l)return Nt(l);let a=ja(t);return a||`${Nt(e)} ${n+1}`}function Mr(t){let n=window.__timelines??{},i=je({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),r=P=>{if(!P)return null;let D=n[P]??null;if(!D||typeof D.duration!="function")return null;try{let O=Number(D.duration());return Number.isFinite(O)&&O>0?O:null}catch{return null}},o=P=>{let D=Ce(P.getAttribute("data-duration"));if(D!=null&&D>0)return D;let O=Ce(P.getAttribute("data-playback-start"))??Ce(P.getAttribute("data-media-start"))??0;return Number.isFinite(P.duration)&&P.duration>O?Math.max(0,(P.duration-O)/Ct(P)):null},s=()=>{let P=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(P.length===0)return null;let D=0;for(let O of P){let se=O.hasAttribute("data-hf-auto-start")?i.resolveStartForElement(O,0):Math.max(0,Number(O.getAttribute("data-start")??0)||0);if(!Number.isFinite(se))continue;let re=o(O);re==null||re<=0||(D=Math.max(D,Math.max(0,se)+re))}return D>0?D:null},l=(P,D)=>{let O=[],se=null,re=null,j=null,q=P.parentElement;for(;q;){let J=q.getAttribute("data-composition-id");J&&(O.push(J),!j&&q!==D&&(j=J),se==null&&(se=i.resolveStartForElement(q,0)),re==null&&(re=Ce(q.getAttribute("data-duration"))??r(J)??null)),q=q.parentElement}return{parentCompositionId:j,compositionAncestors:O.reverse(),inheritedStart:se,inheritedDuration:re}},a=document.querySelector("[data-composition-id]"),c=Array.from(document.querySelectorAll("[data-composition-id]")),u=a?.getAttribute("data-composition-id")??null,m=a?i.resolveStartForElement(a,0):0,f=s(),x=f!=null?Math.max(0,f-Math.max(0,m)):null,w=r(u),g=Vn(a??document.body),b=zn(...c.filter(P=>P!==a).map(P=>{let D=i.resolveStartForElement(P,0),O=i.resolveDurationForElement(P)??r(P.getAttribute("data-composition-id"))??null;return!Number.isFinite(D)||O==null||O<=0?null:Math.max(0,D)+O})),F=b!=null?Math.max(0,b-Math.max(0,m)):null,_=typeof w=="number"&&Number.isFinite(w)&&w>0?w:null,L=typeof g=="number"&&Number.isFinite(g)&&g>0?g:null,Q=typeof x=="number"&&Number.isFinite(x)&&x>0?x:null,H=typeof F=="number"&&Number.isFinite(F)&&F>0?F:null,N=zn(Q,H),y=_!=null&&N!=null&&_>N+1,C=L??(y?N:zn(_,Q,H))??null,k=(C!=null?m+C:null)??(typeof f=="number"&&Number.isFinite(f)&&f>0?f:null),G=(P,D)=>!Number.isFinite(D)||D<=0?0:k==null||!Number.isFinite(k)?D:!Number.isFinite(P)||P>=k?0:Math.max(0,Math.min(D,k-P)),z=[],ee=[],R=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),U=0;for(let P=0;P<R.length;P+=1){let D=R[P];if(D===a||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(D.tagName))continue;let O=l(D,a),se=i.resolveStartForElement(D,O.inheritedStart??0),re=D.getAttribute("data-composition-id"),j=Vn(D);if((j==null||j<=0)&&re&&re!==u&&(j=r(re)),(j==null||j<=0)&&D instanceof HTMLMediaElement){let we=Ce(D.getAttribute("data-playback-start"))??Ce(D.getAttribute("data-media-start"))??0;Number.isFinite(D.duration)&&D.duration>0&&(j=Math.max(0,D.duration-we))}if(j==null||j<=0){let we=O.inheritedDuration;if(we!=null&&we>0){let Te=(O.inheritedStart??0)+we;j=Math.max(0,Te-se)}}if(j==null||j<=0||(j=G(se,j),j<=0))continue;let q=se+j;U=Math.max(U,q);let J=D.tagName.toLowerCase(),Se=re&&re!==u?"composition":J==="video"?"video":J==="audio"?"audio":J==="img"?"image":"element";z.push({id:D.id||re||null,label:qa(D,Se,z.length),start:se,duration:j,track:Number.parseInt(D.getAttribute("data-track-index")??D.getAttribute("data-track")??String(P),10)||0,kind:Se,tagName:J,compositionId:D.getAttribute("data-composition-id"),compositionAncestors:O.compositionAncestors,parentCompositionId:O.parentCompositionId,nodePath:null,compositionSrc:Tt(D.getAttribute("data-composition-src")),assetUrl:Fr(D),timelineRole:D.getAttribute("data-timeline-role"),timelineLabel:D.getAttribute("data-timeline-label"),timelineGroup:D.getAttribute("data-timeline-group"),timelinePriority:Ce(D.getAttribute("data-timeline-priority"))})}let Ne=new Set(z.map(P=>P.id)),V=a?.getAttribute("data-composition-id")??null,te=V?n[V]??null:null;if(te&&a){let P=te;if(typeof P.getChildren=="function")try{let D=P.getChildren(!0,!0,!1)??[],O=new Map;for(let j of a.children){let q=j;if(!q.id)continue;let J=q.tagName.toLowerCase();J==="script"||J==="style"||J==="link"||O.set(q,{id:q.id,start:1/0,end:-1/0})}let se=j=>{let q=j;for(;q;){if(O.has(q))return q;if(q===a)return null;q=q.parentElement}return null};for(let j of D){if(typeof j.targets!="function"||typeof j.startTime!="function"||typeof j.duration!="function")continue;let q=j.startTime(),J=j.parent;for(;J&&J!==te&&typeof J.startTime=="function";)q+=J.startTime(),J=J.parent;let Se=q+j.duration();if(!(!Number.isFinite(q)||!Number.isFinite(Se)))for(let we of j.targets()){if(!(we instanceof Element))continue;let Be=se(we);if(!Be)continue;let Te=O.get(Be);Te&&(Te.start=Math.min(Te.start,q),Te.end=Math.max(Te.end,Se))}}let re=z.length>0?Math.max(...z.map(j=>j.track))+1:0;for(let[j,q]of O){if(q.start===1/0||q.end===-1/0)continue;let J=j;if(Ne.has(J.id))continue;let Se=Math.max(0,q.end-q.start);if(Se<=0)continue;let we=G(q.start,Se);we<=0||(U=Math.max(U,q.start+we),z.push({id:J.id,label:J.getAttribute("data-timeline-label")??J.getAttribute("data-label")??J.getAttribute("aria-label")??J.id,start:q.start,duration:we,track:Number.parseInt(J.getAttribute("data-track-index")??J.getAttribute("data-track")??"",10)||re,kind:"element",tagName:J.tagName.toLowerCase(),compositionId:J.getAttribute("data-composition-id"),compositionAncestors:V?[V]:[],parentCompositionId:V,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:J.getAttribute("data-timeline-role"),timelineLabel:J.getAttribute("data-timeline-label"),timelineGroup:J.getAttribute("data-timeline-group"),timelinePriority:Ce(J.getAttribute("data-timeline-priority"))}),Ne.add(J.id))}}catch(D){v("runtime.timeline.site1",D)}}if(a&&C!=null&&C>0){let P=z.length>0?Math.max(...z.map(D=>D.track))+1:0;for(let D of a.children){let O=D;if(!O.id||Ne.has(O.id))continue;let se=O.getAttribute("data-timeline-role");if(se!=="overlay"&&se!=="persistent-overlay")continue;let re=O.tagName.toLowerCase();if(re==="script"||re==="style"||re==="link"||re==="meta"||window.getComputedStyle(O).display==="none")continue;let q=G(0,C);q<=0||(U=Math.max(U,q),z.push({id:O.id,label:O.getAttribute("data-timeline-label")??O.getAttribute("data-label")??O.getAttribute("aria-label")??O.id,start:0,duration:q,track:Number.parseInt(O.getAttribute("data-track-index")??O.getAttribute("data-track")??"",10)||P,kind:"element",tagName:re,compositionId:O.getAttribute("data-composition-id"),compositionAncestors:V?[V]:[],parentCompositionId:V,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:se,timelineLabel:O.getAttribute("data-timeline-label"),timelineGroup:O.getAttribute("data-timeline-group"),timelinePriority:Ce(O.getAttribute("data-timeline-priority"))}),Ne.add(O.id))}}Ua(z);for(let P of c){if(P===a)continue;let D=P.getAttribute("data-composition-id");if(!D||!Er(D))continue;let O=i.resolveStartForElement(P,0),se=Vn(P);if((se==null||se<=0)&&wr(P)!=null){let J=wr(P);se=Math.max(0,J-O)}let re=r(D),j=se&&se>0?se:re;if(j==null||j<=0)continue;let q=G(O,j);q<=0||ee.push({id:D,label:P.getAttribute("data-label")??D,start:O,duration:q,thumbnailUrl:Tt(P.getAttribute("data-thumbnail-url")),avatarName:null})}let W=Math.max(1,U||1,C??0);return{source:"hf-preview",type:"timeline",durationInFrames:y&&L==null?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(W*Math.max(1,t.canonicalFps))),clips:z,scenes:ee,compositionWidth:Ce(a?.getAttribute("data-width"))??1920,compositionHeight:Ce(a?.getAttribute("data-height"))??1080}}var $a=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function jn(t){if(t==null)return null;let e=Number(t);return Number.isFinite(e)?e:null}function Ka(t,e){let n=t.getAttribute("data-composition-id");if(!n)return null;let i=Number(e[n]?.duration?.());return Number.isFinite(i)&&i>0?i:null}function Ja(t){if(!(t instanceof HTMLMediaElement)||!Number.isFinite(t.duration))return null;let e=jn(t.getAttribute("data-playback-start"))??jn(t.getAttribute("data-media-start"))??0;return t.duration>e?t.duration-e:null}function Ya(t,e,n,i){let r=jn(t.getAttribute("data-duration"));return r!=null&&r>0?r:Ka(t,e)??Ja(t)??Math.max(0,n-i)}function Xa(t){for(let[e,n]of t){let i=e.parentElement;for(;i;){let r=t.get(i);if(r){n.parentId=r.id,r.children.push(n);break}i=i.parentElement}}}function Nr(t){let{startResolver:e,timelineRegistry:n,rootDuration:i}=t,r=new Map,o=document.querySelector("[data-composition-id]"),s=0;for(let l of document.querySelectorAll("[data-start]")){if(l===o||$a.has(l.tagName))continue;let a=e.resolveStartForElement(l,0);if(Ya(l,n,i,a)<=0)continue;let c={id:l.id||`__clip-${s++}`,element:l,parentId:null,children:[]};r.set(l,c)}return Xa(r),{roots:Array.from(r.values()).filter(l=>l.parentId===null)}}var ce=ba(Zo(),1),es=ce.default,km=ce.default.stringify,Rm=ce.default.fromJSON,Dm=ce.default.plugin,Im=ce.default.parse,Pm=ce.default.list,Om=ce.default.document,Bm=ce.default.comment,Hm=ce.default.atRule,Gm=ce.default.rule,Wm=ce.default.decl,Um=ce.default.root,Vm=ce.default.CssSyntaxError,zm=ce.default.Declaration,jm=ce.default.Container,qm=ce.default.Processor,$m=ce.default.Document,Km=ce.default.Comment,Jm=ce.default.Warning,Ym=ce.default.AtRule,Xm=ce.default.Result,Qm=ce.default.Input,Zm=ce.default.Rule,ep=ce.default.Root,tp=ce.default.Node;var gi="data-hf-authored-id";function yi(t){return t.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function bi(t){return t.replace(/\\\\/g,"\\\\\\\\").replace(/"/g,\'\\\\"\')}function bu(t){return t&&t.replace(/[^a-zA-Z0-9_-]/g,n=>`\\\\${n}`).replace(/^-?\\d/,n=>`\\\\${n}`)}function ts(t){let e=t.trim();return e?Array.from(new Set([e,bu(e)])).filter(Boolean):[]}function Su(t){return!!t&&/[\\w-]/.test(t)}function Au(t,e,n){let i=ts(e).sort((l,a)=>a.length-l.length);if(i.length===0)return t;let r="",o=0,s=null;for(let l=0;l<t.length;l+=1){let a=t[l],c=l>0?t[l-1]:"";if(s){r+=a,a===s&&c!=="\\\\"&&(s=null);continue}if(a===\'"\'||a==="\'"){s=a,r+=a;continue}if(a==="["){o+=1,r+=a;continue}if(a==="]"){o=Math.max(0,o-1),r+=a;continue}if(a==="#"&&o===0){let u=i.find(m=>t.startsWith(m,l+1));if(u){let m=t[l+1+u.length];if(!Su(m)){r+=n,l+=u.length;continue}}}r+=a}return r}function Eu(t,e){let n=e?.trim();return n?Au(t,n,`[${gi}="${bi(n)}"]`):t}function wu(t,e,n,i,r){let o=Eu(t,i),s=Cu(o,e,n),l=s.trim();if(!l||/^(html|body|:root|\\*)$/i.test(l))return t;let a=new RegExp(`\\\\[\\\\s*data-composition-id\\\\s*=\\\\s*(["\'])${yi(n)}\\\\1\\\\s*\\\\]`,"g");if(a.test(l))return s.replace(a,e);let c=s.match(/^\\s*/)?.[0]??"",u=s.match(/\\s*$/)?.[0]??"";if(r){let m=i?`[${gi}="${bi(i)}"]`:null;if(m&&l.startsWith(m)){let f=l.slice(m.length);return`${c}${e}${m}${f}${u}`}}return`${c}${e} ${l}${u}`}function Cu(t,e,n){let i=yi(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 t.replace(new RegExp(`${r}(?:${o})+`,"g"),e).replace(new RegExp(`(?:${o})+${r}`,"g"),e)}var Fu=new Set(["keyframes","-webkit-keyframes","font-face"]);function Mu(t){return t?.type==="atrule"}function Nu(t){let e=t.parent;for(;e;){if(Mu(e)&&Fu.has(e.name.toLowerCase()))return!0;e=e.parent}return!1}function Si(t,e,n,i,r){let o=e.trim();if(!t||!o)return t;let s=n||`[data-composition-id="${bi(o)}"]`,l=es.parse(t);return l.walkRules(a=>{Nu(a)||(a.selectors=a.selectors.map(c=>wu(c,s,o,i,r?.compoundAuthoredRoot)))}),l.toResult({map:!1}).css}function ns(t,e,n="[HyperFrames] composition script error:",i,r=e,o){let s=JSON.stringify(e),l=JSON.stringify(r),a=JSON.stringify(n),c=yi(e),u=JSON.stringify(o?.trim()||null),m=JSON.stringify(i??null),f=JSON.stringify(String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${c}"|\'${c}\')\\s*\\]`),x=JSON.stringify(String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`),w=JSON.stringify(ts(o?.trim()||""));return`(function(){\n var __hfCompId = ${s};\n var __hfTimelineCompId = ${l};\n var __hfErrorLabel = ${a};\n var __hfAuthoredRootId = ${u};\n var __hfAuthoredRootAttr = ${JSON.stringify(gi)};\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 = ${w};\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 return Reflect.get(target, prop === __hfCompId ? __hfTimelineCompId : prop, target);\n },\n set: function(target, prop, value, receiver) {\n return Reflect.set(target, prop === __hfCompId ? __hfTimelineCompId : prop, value, target);\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 return Reflect.get(target, prop, target);\n },\n set: function(target, prop, value, receiver) {\n if (prop === "__timelines") {\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${t.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})();`}function is(){if(typeof document>"u")return{};let t=Ai(document.documentElement),e=Tu();return{...t,...e}}function Ai(t){if(!t)return{};let e=t.getAttribute("data-composition-variables");if(!e)return{};let n;try{n=JSON.parse(e)}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}function Tu(){if(typeof window>"u")return{};let t=window.__hfVariables;return!t||typeof t!="object"||Array.isArray(t)?{}:t}var _u=8e3,Lu=/^(?![a-zA-Z][a-zA-Z\\d+\\-.]*:)(?!\\/\\/)(?!\\/)(?!\\.\\.?\\/).+/;function vu(t,e){return`${t}__hf${e}`}var ku=t=>new Promise(e=>{let n=!1,i=Date.now(),r=null,o=s=>{n||(n=!0,r!=null&&window.clearTimeout(r),e({status:s,elapsedMs:Math.max(0,Date.now()-i)}))};t.addEventListener("load",()=>o("load"),{once:!0}),t.addEventListener("error",()=>o("error"),{once:!0}),r=window.setTimeout(()=>o("timeout"),_u)});function Ei(t){for(;t.firstChild;)t.removeChild(t.firstChild);t.textContent=""}var Ru=["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 Du(t){let e=document.importNode(t,!0),n=e.getAttribute("id")?.trim();for(let o of Ru)e.removeAttribute(o);n&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",n)),e.setAttribute("data-hf-inner-root","true");let i=e.getAttribute("data-width"),r=e.getAttribute("data-height");return e.style.width=i?`${i}px`:"100%",e.style.height=r?`${r}px`:"100%",e}function rs(t,e){let n=t.trim();if(!n)return t;try{return Lu.test(n)?new URL(n,document.baseURI).toString():e?new URL(n,e).toString():new URL(n,document.baseURI).toString()}catch{return t}}function Iu(t){let e=t.getAttribute("data-variable-values");if(!e)return{};let n;try{n=JSON.parse(e)}catch{return{}}return!n||typeof n!="object"||Array.isArray(n)?{}:n}function An(t){let e=(t.getAttribute("data-composition-id")||"").trim()||null;return{authoredCompositionId:(t.getAttribute("data-hf-original-composition-id")||e||"").trim()||null,runtimeCompositionId:e}}function Pu(t){let e=new Map;for(let n of t){let i=An(n).authoredCompositionId||"";i&&e.set(i,(e.get(i)||0)+1)}return e}function os(t){let e=An(t).authoredCompositionId;return e?!!document.querySelector(`template#${CSS.escape(e)}-template`):!1}function Ou(t){return!!t.querySelector(\'[data-hf-inner-root="true"]\')}function Bu(t){return t.hasAttribute("data-composition-src")?!0:os(t)?t.children.length===0||t.hasAttribute("data-hf-original-composition-id")?!0:Ou(t):!1}function Ci(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(e=>e.hasAttribute("data-composition-src")?!0:os(e))}function ss(){let t=window.__hfVariablesByComp;if(!t)return;let e=new Set(Ci().map(n=>An(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(t))e.has(n)||delete t[n]}function as(t,e=Pu(t)){let n=new Map,i=new Map;for(let r of t){let{authoredCompositionId:o,runtimeCompositionId:s}=An(r),l=Bu(r);if(!o){i.set(r,{authoredCompositionId:null,runtimeCompositionId:s});continue}let a=(e.get(o)||0)>1,c=s||o;if(l){let u=a?(n.get(o)||0)+1:0;a&&n.set(o,u),c=a?vu(o,u):o,a?r.setAttribute("data-hf-original-composition-id",o):r.removeAttribute("data-hf-original-composition-id"),r.setAttribute("data-composition-id",c),s&&s!==c&&window.__hfVariablesByComp&&delete window.__hfVariablesByComp[s]}i.set(r,{authoredCompositionId:o,runtimeCompositionId:c})}return i}async function wi(t){let e=null;t.authoredCompositionId&&(e=Array.from(t.sourceNode.querySelectorAll("[data-composition-id]")).find(x=>x.getAttribute("data-composition-id")===t.authoredCompositionId)??null);let n=e??t.sourceNode,i=e?.getAttribute("data-composition-id")?.trim()||t.authoredCompositionId||null,r=t.runtimeCompositionId||i||null,o=e?.getAttribute("id")?.trim()||null,s=r?`[data-composition-id="${CSS.escape(r)}"]`:void 0;if(t.headLinks)for(let f of t.headLinks){let x=f.getAttribute("href")||"";x&&(document.head.querySelector(`link[href="${CSS.escape(x)}"]`)||document.head.appendChild(f.cloneNode(!0)))}if(t.headStyles)for(let f of t.headStyles){let x=f.cloneNode(!0);x instanceof HTMLStyleElement&&(i&&(x.textContent=Si(x.textContent||"",i,s,o)),document.head.appendChild(x),t.injectedStyles.push(x))}let l=Array.from(n.querySelectorAll("style"));for(let f of l){let x=f.cloneNode(!0);x instanceof HTMLStyleElement&&(i&&(x.textContent=Si(x.textContent||"",i,s,o)),document.head.appendChild(x),t.injectedStyles.push(x))}let a=[];if(t.headScripts)for(let f of t.headScripts){let x=f.getAttribute("type")?.trim()??"",w=f.getAttribute("src")?.trim()??"";if(w){let g=rs(w,t.compositionUrl);a.push({kind:"external",src:g,type:x})}else{let g=f.textContent?.trim()??"";g&&a.push({kind:"inline",content:g,type:x,scopeCompositionId:i})}}let c=Array.from(n.querySelectorAll("script")),u=[...a];for(let f of c){let x=f.getAttribute("type")?.trim()??"",w=f.getAttribute("src")?.trim()??"";if(w){let g=rs(w,t.compositionUrl);u.push({kind:"external",src:g,type:x})}else{let g=f.textContent?.trim()??"";g&&u.push({kind:"inline",content:g,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(e){let f=e.getAttribute("data-width"),x=e.getAttribute("data-height"),w=t.parseDimensionPx(f),g=t.parseDimensionPx(x);f&&t.host.setAttribute("data-width",f),x&&t.host.setAttribute("data-height",x),w&&t.host instanceof HTMLElement&&(t.host.style.width=w),g&&t.host instanceof HTMLElement&&(t.host.style.height=g),e.hasAttribute("data-timeline-locked")&&t.host.setAttribute("data-timeline-locked",""),t.host.appendChild(Du(e))}else t.hasTemplate?t.host.appendChild(document.importNode(n,!0)):t.host.innerHTML=t.fallbackBodyInnerHtml;if(r){let f={...t.declaredVariableDefaults??{},...Iu(t.host)};Object.keys(f).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[r]=f):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[r]}for(let f of u){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=ns(f.content,f.scopeCompositionId,"[HyperFrames] composition script error:",s,r||f.scopeCompositionId,o):x.textContent=`(function(){${f.content}})();`,document.body.appendChild(x),t.injectedScripts.push(x),f.kind==="external"){let w=await ku(x);w.status!=="load"&&t.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:t.authoredCompositionId,runtimeCompositionId:t.runtimeCompositionId,hostCompositionSrc:t.hostCompositionSrc,resolvedScriptSrc:f.src,loadStatus:w.status,elapsedMs:w.elapsedMs}})}}}async function ls(t){let e=Ci();if(ss(),e.length===0)return;let n=as(e),i=e.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),s=o?.authoredCompositionId;if(!s)continue;let l=document.querySelector(`template#${CSS.escape(s)}-template`);Ei(r),await wi({host:r,authoredCompositionId:s,runtimeCompositionId:o?.runtimeCompositionId||s,hostCompositionSrc:`template#${s}-template`,sourceNode:l.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:t.injectedStyles,injectedScripts:t.injectedScripts,parseDimensionPx:t.parseDimensionPx,onDiagnostic:t.onDiagnostic})}}async function us(t){let e=Ci();if(ss(),e.length===0)return;let n=as(e),i=e.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 s=n.get(r),l=s?.authoredCompositionId||null,a=s?.runtimeCompositionId||l||null,c=null;try{c=new URL(o,document.baseURI)}catch{c=null}Ei(r);try{let u=l!=null?document.querySelector(`template#${CSS.escape(l)}-template`):null;if(u){await wi({host:r,authoredCompositionId:l,runtimeCompositionId:a,hostCompositionSrc:o,sourceNode:u.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:c,injectedStyles:t.injectedStyles,injectedScripts:t.injectedScripts,parseDimensionPx:t.parseDimensionPx,onDiagnostic:t.onDiagnostic});return}let m=await fetch(o);if(!m.ok)throw new Error(`HTTP ${m.status}`);let f=await m.text(),w=new DOMParser().parseFromString(f,"text/html"),g=(l?w.querySelector(`template#${CSS.escape(l)}-template`):null)??w.querySelector("template"),b=g?g.content:w.body,F=g?void 0:Array.from(w.head.querySelectorAll("style")),_=g?void 0:Array.from(w.head.querySelectorAll("script")),L=g?void 0:Array.from(w.head.querySelectorAll(\'link[rel="stylesheet"], link[rel="preconnect"]\'));await wi({host:r,authoredCompositionId:l,runtimeCompositionId:a,hostCompositionSrc:o,sourceNode:b,hasTemplate:!!g,fallbackBodyInnerHtml:w.body.innerHTML,compositionUrl:c,injectedStyles:t.injectedStyles,injectedScripts:t.injectedScripts,parseDimensionPx:t.parseDimensionPx,headStyles:F,headScripts:_,headLinks:L,declaredVariableDefaults:Ai(w.documentElement),onDiagnostic:t.onDiagnostic})}catch(u){t.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:l,runtimeCompositionId:a,hostCompositionSrc:o,errorMessage:u instanceof Error?u.message:"unknown_error"}}),Ei(r)}}))}function Hu(t){return t instanceof HTMLElement?t.dataset.captionWrapper!=="true"?t:t.querySelector(":scope > span")??null:null}function Gu(){let t=[],e=document.querySelectorAll(".caption-group");for(let n of e)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&&t.push(r)}return t}function Wu(t){let e=t.parentElement;if(e?.dataset.captionWrapper==="true")return e;let n=document.createElement("span");return n.style.display="inline-block",n.dataset.captionWrapper="true",t.parentNode?.insertBefore(n,t),n.appendChild(t),n}function Fi(){let t=window.gsap;t&&document.querySelectorAll(".caption-group").length!==0&&fetch("caption-overrides.json").then(e=>e.ok?e.json():null).then(e=>{if(!e||!Array.isArray(e)||e.length===0)return;let n=Gu();for(let i of e){let r=null;if(i.wordId&&(r=Hu(document.getElementById(i.wordId))),!r&&i.wordIndex!==void 0&&(r=n[i.wordIndex]??null),!r)continue;let o={},s={};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&&(s.opacity=i.opacity),i.fontSize!==void 0&&(s.fontSize=`${i.fontSize}px`),i.fontWeight!==void 0&&(s.fontWeight=i.fontWeight),i.fontFamily!==void 0&&(s.fontFamily=i.fontFamily),i.activeColor||i.dimColor){let a=t.getTweensOf(r).filter(u=>u.vars.color!==void 0).sort((u,m)=>u.startTime()-m.startTime()),c=a.length>0?String(a[0].vars.color):"";for(let u of a)String(u.vars.color)===c?i.dimColor&&(u.vars.color=i.dimColor):i.activeColor&&(u.vars.color=i.activeColor);i.dimColor&&t.set(r,{color:i.dimColor})}if(Object.keys(s).length>0&&t.set(r,s),Object.keys(o).length>0){let l=Wu(r);t.set(l,o)}}}).catch(()=>{})}var Kt="data-color-grading",Uu="rec709",Ye={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,saturation:0},cs=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","saturation"],Vu=[{id:"neutral",label:"Neutral",adjust:{...Ye}},{id:"warm-clean",label:"Warm Clean",adjust:{...Ye,exposure:.05,contrast:.08,highlights:-.08,shadows:.08,temperature:.16,saturation:.06}},{id:"cool-clean",label:"Cool Clean",adjust:{...Ye,contrast:.06,highlights:-.06,shadows:.06,temperature:-.12,tint:.04,saturation:.04}},{id:"soft-boost",label:"Soft Boost",adjust:{...Ye,exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,saturation:.1}},{id:"bright-pop",label:"Bright Pop",adjust:{...Ye,exposure:.12,contrast:.12,whites:.08,blacks:-.04,saturation:.14}},{id:"deep-contrast",label:"Deep Contrast",adjust:{...Ye,exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}}],zu=new Map(Vu.map(t=>[t.id,t])),ju=/^\\$(?:\\{([A-Za-z0-9_.:-]+)\\}|([A-Za-z0-9_.:-]+))$/,qu={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},saturation:{min:-1,max:1}};function $t(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function $u(t,e,n){return Number.isFinite(t)?Math.min(n,Math.max(e,t)):0}function ds(t,e){let n=typeof t=="number"?t:Number(t);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):e}function Ku(t,e){let n=typeof t=="number"?t:Number(t);if(!Number.isFinite(n))return 0;let i=qu[e];return $u(n,i.min,i.max)}function Ju(t){if(t==null)return null;let e=String(t).trim();return e||null}function Yu(t){if(t==null)return null;if(typeof t=="string"){let n=t.trim();return n?{src:n,intensity:1}:null}if(!$t(t))return null;let e=t.src;return typeof e!="string"||e.trim()===""?null:{src:e.trim(),intensity:ds(t.intensity,1)}}function Xu(t){if(typeof t=="string"){let e=t.trim();if(!e)return null;if(e.startsWith("{"))try{let n=JSON.parse(e);return $t(n)?n:null}catch{return null}return{preset:e,intensity:1}}return $t(t)?t:null}function Qu(t,e){let n=t.trim().match(ju);if(!n)return t;let i=n[1]??n[2]??"";return i&&Object.hasOwn(e,i)?e[i]:t}function Mi(t,e){if(typeof t=="string"){let i=Qu(t,e);if(i!==t)return i;let r=t.trim();if(!r.startsWith("{"))return t;try{return Mi(JSON.parse(r),e)}catch{return t}}if(!$t(t))return t;let n={};for(let[i,r]of Object.entries(t))n[i]=Mi(r,e);return n}function Zu(t){return t?zu.get(t)??null:null}function Ni(t){let e=Xu(t);if(!e||e.enabled===!1)return null;let n=Ju(e.preset),r=Zu(n)?.adjust??Ye,o=$t(e.adjust)?e.adjust:{},s=cs.reduce((l,a)=>(l[a]=Ku(o[a]??r[a],a),l),{...Ye});return{enabled:!0,preset:n,intensity:ds(e.intensity,1),adjust:s,lut:Yu(e.lut),colorSpace:typeof e.colorSpace=="string"&&e.colorSpace.trim()?e.colorSpace.trim():Uu}}function fs(t,e){return Ni(Mi(t,e))}function Jt(t){return!t?.enabled||t.intensity===0?!1:t.lut&&t.lut.intensity!==0?!0:cs.some(e=>Math.abs(t.adjust[e])>1e-4)}var Ee=class extends Error{constructor(n,i=null){super(i==null?n:`${n} at line ${i}`);xe(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=i}},ec=[0,0,0],tc=[1,1,1],nc=64;function ic(t){let e=!1;for(let n=0;n<t.length;n++){let i=t[n];if(i===\'"\'&&(e=!e),i==="#"&&!e)return t.slice(0,n)}return t}function pt(t,e){let n=Number(t);if(!Number.isFinite(n))throw new Ee(`Invalid number "${t}"`,e);return n}function ms(t,e,n){if(t.length!==3)throw new Ee(`${e} expects three numbers`,n);return[pt(t[0],n),pt(t[1],n),pt(t[2],n)]}function ps(t,e,n){if(!t)throw new Ee(`${e} expects a size`,n);let i=Number(t);if(!Number.isInteger(i)||i<2)throw new Ee(`${e} must be an integer greater than 1`,n);return i}function rc(t,e){if(e[0]<=t[0]||e[1]<=t[1]||e[2]<=t[2])throw new Ee("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function oc(t){let e=/^TITLE\\s+"([^"]*)"\\s*$/i.exec(t);if(e)return e[1]??null;let n=/^TITLE\\s+(.+)\\s*$/i.exec(t);return n&&(n[1]??"").trim()||null}function sc(t){return/^[+-]?(?:\\d|\\.\\d)/.test(t)}function hs(t,e={}){let n=e.maxSize??nc,i=null,r=ec,o=tc,s=null,l=null,a=[],c=t.replace(/^\\uFEFF/,"").split(/\\r?\\n/);for(let m=0;m<c.length;m++){let f=m+1,x=ic(c[m]??"").trim();if(!x)continue;let w=x.split(/\\s+/),g=(w[0]??"").toUpperCase(),b=w.slice(1);if(g==="TITLE"){i=oc(x);continue}if(g==="DOMAIN_MIN"){r=ms(b,g,f);continue}if(g==="DOMAIN_MAX"){o=ms(b,g,f);continue}if(g==="LUT_1D_SIZE"){s=ps(b[0],g,f);continue}if(g==="LUT_3D_SIZE"){if(l=ps(b[0],g,f),l>n)throw new Ee(`LUT_3D_SIZE ${l} exceeds max ${n}`,f);continue}if(!sc(g)){if(g.startsWith("LUT_"))throw new Ee(`Unsupported cube keyword ${g}`,f);continue}if(!l)throw s?new Ee("1D cube LUTs are not supported yet",f):new Ee("LUT data appears before LUT_3D_SIZE",f);if(w.length!==3)throw new Ee("LUT data rows must contain three numbers",f);a.push(pt(w[0],f),pt(w[1],f),pt(w[2],f))}if(s&&l)throw new Ee("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw s?new Ee("1D cube LUTs are not supported yet"):new Ee("Missing LUT_3D_SIZE");rc(r,o);let u=l*l*l;if(a.length!==u*3)throw new Ee(`Expected ${u} LUT rows for size ${l}, found ${a.length/3}`);return{title:i,size:l,domainMin:r,domainMax:o,data:new Float32Array(a)}}function ac(t){return Number.isFinite(t)?Math.min(1,Math.max(0,t)):0}function Ti(t){return Math.round(ac(t)*255)}function xs(t){let e=t.size,n=e*e,i=e,r=new Uint8Array(n*i*4);for(let o=0;o<e;o++)for(let s=0;s<e;s++)for(let l=0;l<e;l++){let a=((o*e+s)*e+l)*3,c=(s*n+o*e+l)*4;r[c]=Ti(t.data[a]??0),r[c+1]=Ti(t.data[a+1]??0),r[c+2]=Ti(t.data[a+2]??0),r[c+3]=255}return{width:n,height:i,data:r}}var En=new Map,lc="data-hf-color-grading-canvas",As="data-hf-color-grading-source-hidden",uc="__hf_color_grading_canvas__",cc=64,Yt={enabled:!1,position:.5,softness:0,lineWidth:2};function dc(t){let e=window,i=t.closest("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()??"",r=i?e.__hfVariablesByComp?.[i]:void 0;if(r)return r;let o=e.__hyperframes?.getVariables?.();return o&&typeof o=="object"?o:e.__hfVariables??{}}function _i(t){let e=t.getAttribute(Kt);return e==null?null:fs(e,dc(t))}var fc=["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`),mc=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform sampler2D u_lut;","uniform vec2 u_resolution;","uniform vec2 u_uvScale;","uniform vec2 u_uvOffset;","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_saturation;","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)); }","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 sampleColor = texture2D(u_source, uv);"," vec3 original = sampleColor.rgb;"," vec3 color = original * 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;"," color += u_blacks * 0.25 * (1.0 - smoothstep(0.0, 0.35, y));"," color += u_whites * 0.25 * smoothstep(0.65, 1.0, y);"," 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);"," 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);"," 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`);function ot(t){return t instanceof HTMLVideoElement||t instanceof HTMLImageElement}function gs(t,e,n){let i=t.createShader(n);return i?(t.shaderSource(i,e),t.compileShader(i),t.getShaderParameter(i,t.COMPILE_STATUS)?i:(v("runtime.colorGrading.compileShader",t.getShaderInfoLog(i)),t.deleteShader(i),null)):null}function pc(t){let e=gs(t,fc,t.VERTEX_SHADER),n=gs(t,mc,t.FRAGMENT_SHADER);if(!e||!n)return e&&t.deleteShader(e),n&&t.deleteShader(n),null;let i=t.createProgram();return i?(t.attachShader(i,e),t.attachShader(i,n),t.linkProgram(i),t.deleteShader(e),t.deleteShader(n),t.getProgramParameter(i,t.LINK_STATUS)?i:(v("runtime.colorGrading.linkProgram",t.getProgramInfoLog(i)),t.deleteProgram(i),null)):null}function ys(t,e=t.LINEAR){let n=t.createTexture();return n?(t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null),n):null}function hc(t){let e=t.getContext("webgl",{alpha:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!0});if(!e)return null;let n=pc(e),i=ys(e),r=ys(e,e.NEAREST);if(!n||!i||!r)return n&&e.deleteProgram(n),i&&e.deleteTexture(i),r&&e.deleteTexture(r),null;let o=e.createBuffer();return o?(e.bindBuffer(e.ARRAY_BUFFER,o),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),e.STATIC_DRAW),{gl:e,program:{program:n,texture:i,lutTexture:r,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),lut:e.getUniformLocation(n,"u_lut"),resolution:e.getUniformLocation(n,"u_resolution"),uvScale:e.getUniformLocation(n,"u_uvScale"),uvOffset:e.getUniformLocation(n,"u_uvOffset"),lutEnabled:e.getUniformLocation(n,"u_lutEnabled"),lutSize:e.getUniformLocation(n,"u_lutSize"),lutTextureSize:e.getUniformLocation(n,"u_lutTextureSize"),lutDomainMin:e.getUniformLocation(n,"u_lutDomainMin"),lutDomainMax:e.getUniformLocation(n,"u_lutDomainMax"),lutIntensity:e.getUniformLocation(n,"u_lutIntensity"),exposure:e.getUniformLocation(n,"u_exposure"),contrast:e.getUniformLocation(n,"u_contrast"),highlights:e.getUniformLocation(n,"u_highlights"),shadows:e.getUniformLocation(n,"u_shadows"),whites:e.getUniformLocation(n,"u_whites"),blacks:e.getUniformLocation(n,"u_blacks"),temperature:e.getUniformLocation(n,"u_temperature"),tint:e.getUniformLocation(n,"u_tint"),saturation:e.getUniformLocation(n,"u_saturation"),intensity:e.getUniformLocation(n,"u_intensity"),compareEnabled:e.getUniformLocation(n,"u_compareEnabled"),comparePosition:e.getUniformLocation(n,"u_comparePosition"),compareSoftness:e.getUniformLocation(n,"u_compareSoftness"),compareLineWidth:e.getUniformLocation(n,"u_compareLineWidth")}}):(e.deleteProgram(n),e.deleteTexture(i),e.deleteTexture(r),null)}function xc(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function gc(t){if(!xc(t))return{...Yt};let e=(n,i,r,o)=>{let s=typeof n=="number"?n:Number(n);return Math.min(o,Math.max(r,Number.isFinite(s)?s:i))};return{enabled:t.enabled===!0,position:e(t.position,Yt.position,0,1),softness:e(t.softness,Yt.softness,0,.25),lineWidth:e(t.lineWidth,Yt.lineWidth,0,12)}}function Es(t){try{let e=new URL(t,document.baseURI);return e.protocol==="data:"?{href:e.href}:e.protocol!=="http:"&&e.protocol!=="https:"?{error:"LUT must be project-local or a data URL"}:e.origin!==window.location.origin?{error:"Remote LUT URLs are not supported"}:{href:e.href}}catch{return{error:"Invalid LUT URL"}}}function vi(t){return t instanceof Error?t.message:"LUT failed to load"}function yc(t){let e=Es(t);if("error"in e)return{state:"error",message:e.error};let n=En.get(e.href);if(n)return n;let i=fetch(e.href,{credentials:"same-origin"}).then(o=>{if(!o.ok)throw new Error(`Failed to load LUT (${o.status})`);return o.text()}).then(o=>hs(o,{maxSize:cc})),r={state:"pending",promise:i};return En.set(e.href,r),i.then(o=>En.set(e.href,{state:"ready",lut:o}),o=>En.set(e.href,{state:"error",message:vi(o)})),r}function bs(t,e,n){if(t.lut?.src===e)return t.lut;let i=xs(n),{gl:r,program:o}=t;try{return r.activeTexture(r.TEXTURE1),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),t.lut={src:e,title:n.title,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:i.width,textureHeight:i.height},t.lutError=null,t.lutLoadingSrc=null,t.lut}catch(s){return t.lut=null,t.lutError=vi(s),t.lutLoadingSrc=null,v("runtime.colorGrading.uploadLut",s),null}}function bc(t){let e=t.grading.lut?.src.trim()??"",n=t.grading.lut?.intensity??1;if(!e||n<=0)return t.lut=null,t.lutLoadingSrc=null,t.lutError=null,null;let i=Es(e);if("error"in i)return t.lut=null,t.lutLoadingSrc=null,t.lutError=i.error,null;if(t.lut?.src===i.href)return t.lut;t.lut=null;let r=yc(e);return r.state==="ready"?bs(t,i.href,r.lut):r.state==="error"?(t.lutError=r.message,t.lutLoadingSrc=null,null):(t.lutLoadingSrc!==i.href&&(t.lutLoadingSrc=i.href,t.lutError=null,r.promise.then(o=>{t.destroyed||t.grading.lut?.src.trim()!==e||(bs(t,i.href,o),We(t))},o=>{t.destroyed||t.grading.lut?.src.trim()!==e||(t.lut=null,t.lutError=vi(o),t.lutLoadingSrc=null,We(t))})),null)}function Li(t){if(!t)return null;if(typeof t=="string"){let e=t.trim();if(!e)return null;let n=document.getElementById(e.replace(/^#/,""));if(n&&ot(n))return n;try{let i=document.querySelector(e);return i&&ot(i)?i:null}catch{return null}}if(t.hfId){let e=document.querySelector(`[data-hf-id="${CSS.escape(t.hfId)}"]`);if(e&&ot(e))return e}if(t.id){let e=document.getElementById(t.id);if(e&&ot(e))return e}if(!t.selector)return null;try{let e=Array.from(document.querySelectorAll(t.selector)),n=Math.max(0,Math.floor(Number(t.selectorIndex??0)||0)),i=e[n]??null;return i&&ot(i)?i:null}catch{return null}}function Sc(t){return t instanceof HTMLVideoElement?t.videoWidth>0&&t.videoHeight>0?{width:t.videoWidth,height:t.videoHeight}:null:t instanceof HTMLImageElement&&t.naturalWidth>0&&t.naturalHeight>0?{width:t.naturalWidth,height:t.naturalHeight}:null}function ws(t){return t instanceof HTMLVideoElement?t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&t.videoWidth>0&&t.videoHeight>0:t instanceof HTMLImageElement?t.complete&&t.naturalWidth>0&&t.naturalHeight>0:!1}function Ac(t){if(!t.id)return null;let e=document.getElementById(`__render_frame_${t.id}__`);return e instanceof HTMLImageElement&&ws(e)?e:null}function Ec(t){if(t instanceof HTMLVideoElement){let e=Ac(t);if(e)return e}return ws(t)?t:null}function Ss(t,e){let n=t.toLowerCase();if(n==="center")return .5;if(e==="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 wc(t){let e=t.trim().split(/\\s+/).filter(Boolean),n=.5,i=.5;for(let r=0;r<e.length;r++){let o=e[r]??"",s=Ss(o,"x"),l=Ss(o,"y");if(s!==null&&(o==="left"||o==="right"||o.endsWith("%")&&r===0)){n=s;continue}if(l!==null&&(o==="top"||o==="bottom"||o.endsWith("%")&&r>0)){i=l;continue}}return{x:n,y:i}}function Cc(t,e,n,i,r,o){if(t<=0||e<=0||n<=0||i<=0)return{scaleX:1,scaleY:1,offsetX:0,offsetY:0};let s=r||"fill",l=t,a=e;if(s==="contain"||s==="cover"||s==="scale-down"){let f=s==="cover"?Math.max(t/n,e/i):Math.min(t/n,e/i);l=n*f,a=i*f,s==="scale-down"&&l>n&&a>i&&(l=n,a=i)}else s==="none"&&(l=n,a=i);let c=wc(o||"center"),u=(t-l)*c.x/t,m=(e-a)*c.y/e;return{scaleX:l/t,scaleY:a/e,offsetX:u,offsetY:m}}function Fc(t,e){window.getComputedStyle(e).position==="static"&&(t.touchedParent||(t.touchedParent=e,t.parentInlinePosition=e.style.position||null),e.style.position="relative")}function Mc(t,e){let{element:n,canvas:i}=t,r=n.parentElement;r&&Fc(t,r);let o=window.getComputedStyle(e);yr(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=t.sourceOpacityForCanvas,i.style.visibility=t.sourceVisibleForCanvas?"visible":"hidden";let s=n.getBoundingClientRect(),l=Math.max(0,Math.round(n.offsetWidth||s.width)),a=Math.max(0,Math.round(n.offsetHeight||s.height));return l<=0||a<=0?(i.style.display="none",null):(i.width!==l&&(i.width=l),i.height!==a&&(i.height=a),{width:l,height:a})}function Nc(t,e,n,i,r,o,s){t.uniform1i(e.source,0),t.uniform1i(e.lut,1),t.uniform2f(e.resolution,o.width,o.height),t.uniform2f(e.uvScale,s.scaleX,s.scaleY),t.uniform2f(e.uvOffset,s.offsetX,s.offsetY),t.uniform1f(e.lutEnabled,i?1:0),t.uniform1f(e.lutSize,i?.size??2),t.uniform2f(e.lutTextureSize,i?.textureWidth??1,i?.textureHeight??1),t.uniform3f(e.lutDomainMin,i?.domainMin[0]??0,i?.domainMin[1]??0,i?.domainMin[2]??0),t.uniform3f(e.lutDomainMax,i?.domainMax[0]??1,i?.domainMax[1]??1,i?.domainMax[2]??1),t.uniform1f(e.lutIntensity,n.lut?.intensity??0),t.uniform1f(e.exposure,n.adjust.exposure),t.uniform1f(e.contrast,n.adjust.contrast),t.uniform1f(e.highlights,n.adjust.highlights),t.uniform1f(e.shadows,n.adjust.shadows),t.uniform1f(e.whites,n.adjust.whites),t.uniform1f(e.blacks,n.adjust.blacks),t.uniform1f(e.temperature,n.adjust.temperature),t.uniform1f(e.tint,n.adjust.tint),t.uniform1f(e.saturation,n.adjust.saturation),t.uniform1f(e.intensity,n.intensity),t.uniform1f(e.compareEnabled,r.enabled?1:0),t.uniform1f(e.comparePosition,r.position),t.uniform1f(e.compareSoftness,r.softness),t.uniform1f(e.compareLineWidth,r.lineWidth)}function Tc(t){t.sourceHidden||(t.sourceInlineOpacity=t.element.style.getPropertyValue("opacity")||null,t.sourceInlineOpacityPriority=t.element.style.getPropertyPriority("opacity")),t.element.setAttribute(As,"true"),t.element.style.setProperty("opacity","0","important"),t.sourceHidden=!0}function We(t){if(t.destroyed)return!1;let e=Ec(t.element);if(!e)return t.hasDrawn||(t.canvas.style.display="none"),!1;let n=Sc(e);if(!n)return!1;let i=e instanceof HTMLElement?e:t.element,r=t.element.style.getPropertyValue("opacity"),o=t.element.style.getPropertyPriority("opacity"),s=t.sourceHidden&&r==="0"&&o==="important",l=t.element.style.getPropertyValue("visibility");if(!s){let x=window.getComputedStyle(t.element);t.sourceOpacityForCanvas=x.opacity||"1",t.sourceVisibleForCanvas=l!=="hidden"&&x.visibility!=="hidden"}let a=Mc(t,i);if(!a)return!1;let c=window.getComputedStyle(i),u=Cc(a.width,a.height,n.width,n.height,c.objectFit,c.objectPosition),{gl:m,program:f}=t;try{let x=bc(t);return m.viewport(0,0,a.width,a.height),m.useProgram(f.program),m.activeTexture(m.TEXTURE0),m.bindTexture(m.TEXTURE_2D,f.texture),m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,!0),m.texImage2D(m.TEXTURE_2D,0,m.RGBA,m.RGBA,m.UNSIGNED_BYTE,e),m.activeTexture(m.TEXTURE1),m.bindTexture(m.TEXTURE_2D,f.lutTexture),Nc(m,f,t.grading,x,t.compare,a,u),m.enableVertexAttribArray(f.position),m.vertexAttribPointer(f.position,2,m.FLOAT,!1,0,0),m.drawArrays(m.TRIANGLE_STRIP,0,4),Tc(t),t.hasDrawn=!0,!0}catch(x){return v("runtime.colorGrading.drawEntry",x),!1}}function Xe(t,e,n,i){e.addEventListener(n,i),t.cleanup.push(()=>e.removeEventListener(n,i))}function _c(t){t.animationFrame!==null&&(window.cancelAnimationFrame(t.animationFrame),t.animationFrame=null),t.videoFrameHandle!==null&&t.element instanceof HTMLVideoElement&&(t.element.cancelVideoFrameCallback?.(t.videoFrameHandle),t.videoFrameHandle=null)}function Xt(t){if(t.destroyed||!(t.element instanceof HTMLVideoElement)||t.videoFrameHandle!==null||t.animationFrame!==null)return;let e=t.element,n=e;if(typeof n.requestVideoFrameCallback=="function"){t.videoFrameHandle=n.requestVideoFrameCallback(()=>{t.videoFrameHandle=null,We(t),!t.destroyed&&!e.paused&&!e.ended&&Xt(t)});return}t.animationFrame=window.requestAnimationFrame(()=>{t.animationFrame=null,We(t),!t.destroyed&&!e.paused&&!e.ended&&Xt(t)})}function Lc(t){let e=()=>{We(t)};Xe(t,t.element,"load",e),Xe(t,t.element,"loadedmetadata",e),Xe(t,t.element,"loadeddata",e),Xe(t,t.element,"seeked",e),Xe(t,t.element,"timeupdate",e),Xe(t,window,"resize",e),t.element instanceof HTMLVideoElement&&(Xe(t,t.element,"play",()=>Xt(t)),Xe(t,t.element,"pause",e)),typeof ResizeObserver<"u"&&(t.resizeObserver=new ResizeObserver(e),t.resizeObserver.observe(t.element))}function vc(t){if(!t.destroyed){t.destroyed=!0,_c(t),t.resizeObserver?.disconnect();for(let e of t.cleanup)e();if(t.cleanup.length=0,t.canvas.remove(),t.gl.deleteTexture(t.program.texture),t.gl.deleteTexture(t.program.lutTexture),t.gl.deleteProgram(t.program.program),t.sourceHidden){t.element.removeAttribute(As);let e=t.element.style.getPropertyValue("opacity"),n=t.element.style.getPropertyPriority("opacity");e==="0"&&n==="important"&&(t.sourceInlineOpacity===null?t.element.style.removeProperty("opacity"):t.element.style.setProperty("opacity",t.sourceInlineOpacity,t.sourceInlineOpacityPriority))}t.touchedParent&&(t.parentInlinePosition===null?t.touchedParent.style.removeProperty("position"):t.touchedParent.style.position=t.parentInlinePosition)}}function kc(t){let e=document.createElement("canvas");return e.className=uc,e.setAttribute(lc,"true"),e.setAttribute("data-hyperframes-ignore",""),e.setAttribute("data-hyperframes-picker-ignore",""),e.setAttribute("data-hf-ignore",""),e.setAttribute("aria-hidden","true"),e.style.pointerEvents="none",e.style.display="none",t.parentNode?.insertBefore(e,t.nextSibling),e}function Cs(){let t=new WeakMap,e=new Set,n=null,i=!1,r=(g,b,F)=>{let _=t.get(g);if(_)return _.grading=b,_.source=F,We(_),g instanceof HTMLVideoElement&&!g.paused&&Xt(_),!0;let L=kc(g),Q=hc(L);if(!Q)return L.remove(),!1;let H={element:g,canvas:L,gl:Q.gl,program:Q.program,grading:b,compare:{...Yt},lut:null,lutLoadingSrc:null,lutError:null,source:F,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(g).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(g).visibility!=="hidden",hasDrawn:!1,destroyed:!1};return t.set(g,H),e.add(g),Lc(H),We(H),g instanceof HTMLVideoElement&&!g.paused&&Xt(H),!0},o=(g,b)=>{if(i)return!1;let F=Li(g);if(!F)return!1;let _=t.get(F);if(!_){let L=_i(F);if(!Jt(L)||!r(F,L,"attribute"))return!1;_=t.get(F)}return _?(_.compare=gc(b),We(_),!0):!1},s=g=>{let b=t.get(g);b&&(vc(b),t.delete(g),e.delete(g))},l=()=>{if(i)return 0;let g=new Set;document.querySelectorAll(`video[${Kt}], img[${Kt}]`).forEach(F=>{if(!ot(F))return;g.add(F);let _=_i(F);Jt(_)?r(F,_,"attribute"):s(F)});for(let F of Array.from(e)){let _=t.get(F);_&&(!F.isConnected||_.source==="attribute"&&!g.has(F))&&s(F)}return e.size},a=()=>{if(i)return 0;let g=0;for(let b of Array.from(e,F=>t.get(F)))b&&We(b)&&(g+=1);return g},c=(g,b)=>{if(i)return!1;let F=Li(g);if(!F)return!1;let _=Ni(b);return Jt(_)?r(F,_,"live"):(s(F),!0)},u=(g,b)=>{if(!ot(g))return!1;let F=t.get(g);return F?(F.sourceVisibleForCanvas=b,!0):!1},m=g=>{let b=Li(g);if(!b)return{state:"missing",message:"Media not found"};let F=t.get(b);if(F)return F.lutError?{state:"unavailable",message:F.lutError}:F.grading.lut&&F.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:F.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:F.lut?"Shader + LUT active":"Shader active"};let _=_i(b);return Jt(_)?{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},f=()=>{if(!i){i=!0,n?.disconnect(),n=null;for(let g of Array.from(e))s(g)}};document.body&&(n=new MutationObserver(()=>l()),n.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[Kt]}));let x={refresh:l,redraw:a,setGrading:c,setCompare:o,setSourceVisibility:u,getStatus:m,destroy:f},w=window;return w.__hf=w.__hf||{},w.__hf.colorGrading=x,l(),x}var wn=class{constructor(e){xe(this,"_baseTime",0);xe(this,"_playStartMs",null);xe(this,"_rate",1);xe(this,"_duration",1/0);xe(this,"_nowMs");xe(this,"_audioSource",null);this._baseTime=e?.initialTime??0,this._rate=e?.rate??1,this._duration=e?.duration??1/0,this._nowMs=e?.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:s}=this._audioSource;!r.paused&&Number.isFinite(r.currentTime)&&(i=(r.currentTime-s)/(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 e=(this._nowMs()-this._playStartMs)/1e3,n=this._baseTime+e*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(e){let n=Number.isFinite(this._duration)?Math.max(0,Math.min(e,this._duration)):Math.max(0,e);this._baseTime=n,this._playStartMs!==null&&(this._playStartMs=this._nowMs())}isPlaying(){return this._playStartMs!==null}setRate(e){let n=Number.isFinite(e)&&e>0?Math.max(.1,Math.min(5,e)):1;this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs()),this._rate=n}getRate(){return this._rate}setDuration(e){this._duration=Number.isFinite(e)&&e>0?e:1/0,this._baseTime>this._duration&&(this._baseTime=this._duration)}getDuration(){return this._duration}attachAudioSource(e){this._audioSource=e}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:e}=this._audioSource;if(!e.paused&&Number.isFinite(e.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 Fs(t){return!Number.isFinite(t)||t<=0?1:t}function Rc(t,e){e||t.paused||!rn().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",t.currentSrc||t.getAttribute("src")||"")}function Dc(t,e){let{elapsed:n,mediaStart:i,scheduledAt:r,safeRate:o,clipDuration:s}=e,l=Number.isFinite(s)&&s>0,a=s*o;if(n>=0){let u=a-n;return l&&u<=0?!1:(l?t.start(0,n+i,u):t.start(0,n+i),!0)}let c=-n/o;return l?t.start(r+c,i,a):t.start(r+c,i),!0}var Cn=class{constructor(){xe(this,"_ctx",null);xe(this,"_bufferCache",new Map);xe(this,"_failedSrcs",new Set);xe(this,"_activeSources",[]);xe(this,"_masterGain",null);xe(this,"_rateAnchorCtx",0);xe(this,"_rateAnchorComp",0);xe(this,"_rate",1);xe(this,"_paused",!0);xe(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(e){let n=e.currentSrc||e.getAttribute("src");if(!n)return null;if(this._bufferCache.has(n))return this._bufferCache.get(n);if(this._failedSrcs.has(n)||!this._ctx)return null;let i;try{let r=await fetch(n,{cache:"no-store"});if(!r.ok)return v("webAudioTransport.fetch",new Error(`${r.status} ${n}`)),null;i=await r.arrayBuffer()}catch(r){return v("webAudioTransport.fetch",r),null}try{let r=await this._ctx.decodeAudioData(i);return this._bufferCache.set(n,r),r}catch(r){return this._failedSrcs.add(n),v("webAudioTransport.decode",r),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}async schedulePlayback(e,n,i,r,o,s,l,a=1,c=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||l!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),l!==this._playGeneration)return null;let u=Fs(a),m=this._ctx.createBufferSource();m.buffer=n,m.playbackRate.value=u;let f=this._ctx.createGain();f.gain.value=s,m.connect(f),f.connect(this._masterGain);let x=o-i,w=this._ctx.currentTime;if(this._rate=u,this._rateAnchorCtx=w,this._rateAnchorComp=o,!Dc(m,{elapsed:x,mediaStart:r,scheduledAt:w,safeRate:u,clipDuration:c}))return m.disconnect(),f.disconnect(),null;let g=e.muted;e.muted=!0,Rc(e,g);let b={el:e,sourceNode:m,gainNode:f,compositionStart:i,mediaStart:r,scheduledAt:w,priorMuted:g,bounded:Number.isFinite(c)&&c>0};return this._activeSources.push(b),this._paused=!1,m.addEventListener("ended",()=>{let F=this._activeSources.indexOf(b);F!==-1&&(this._activeSources.splice(F,1),e.muted=g,this._activeSources.length===0&&(this._paused=!0))}),b}catch(u){return v("webAudioTransport.schedule",u),null}}setRate(e){let n=Fs(e);if(n===this._rate)return!1;this._ctx&&!this._paused&&(this._rateAnchorComp=this.getTime(),this._rateAnchorCtx=this._ctx.currentTime),this._rate=n;for(let i of this._activeSources)try{i.sourceNode.playbackRate.value=n}catch(r){v("webAudioTransport.setRate",r)}return!0}hasBoundedActiveSources(){return this._activeSources.some(e=>e.bounded)}stopAll(){for(let e of this._activeSources){try{e.sourceNode.stop(),e.sourceNode.disconnect(),e.gainNode.disconnect()}catch{}e.el.muted=e.priorMuted}this._activeSources=[],this._paused=!0}setVolume(e){this._masterGain&&(this._masterGain.gain.value=Math.max(0,Math.min(1,e)))}setElementVolume(e,n){let i=Math.max(0,Math.min(1,n));for(let r of this._activeSources)if(r.el===e)try{r.gainNode.gain.value=i}catch(o){v("webAudioTransport.setElementVolume",o)}}setMuted(e){this._masterGain&&(this._masterGain.gain.value=e?0:1)}isActive(){return this._activeSources.length>0&&!this._paused}ownsElement(e){return!this._paused&&this._activeSources.some(n=>n.el===e)}destroy(){if(this.stopAll(),this._bufferCache.clear(),this._failedSrcs.clear(),this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null}};var Ms="data-hf-studio-manual-edit-gesture";var Ns="data-hf-authored-duration",Ts="data-hf-authored-end";function _s(){let t=Ar(),e=null,n=null,i=null,r=[],o=new Set,s=null;if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(d){v("runtime.init.site1",d)}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"),window.__timelines=window.__timelines||{};let l=d=>{r.push(d)},a=(d,p,h)=>{let S=h??`${d}:${JSON.stringify(p)}`;o.has(S)||(o.add(S),Ae({source:"hf-preview",type:"diagnostic",code:d,details:p}))},c=d=>{let p={scale:1,focusX:960,focusY:540},h=[],S=[],E={time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:d.play,pause:d.pause,seek:d.seek,getTime:d.getTime,getDuration:d.getDuration,isPlaying:d.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>p,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>h,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:d.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>S,getRenderState:()=>({...E,time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying()})}},u=1/60,m=.75,f=2,x=.05,w=100,g=240,b=d=>{if(d instanceof Error)return d.message||String(d);if(typeof d=="string")return d;try{return JSON.stringify(d)}catch{return String(d??"")}},F=d=>{let p=d.toLowerCase();return p.includes("cannot read properties of null")||p.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:p.includes("failed to execute \'queryselector\'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:p.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},_=d=>{if(d==null||d.trim()==="")return null;let p=Number.parseFloat(d);return!Number.isFinite(p)||p<=0?null:`${p}px`},L=()=>{let d=document.querySelector(\'[data-composition-id][data-root="true"]\');if(d instanceof HTMLElement)return d;let p=Array.from(document.querySelectorAll("[data-composition-id]"));return p.length===0?null:p.find(h=>!h.parentElement?.closest("[data-composition-id]"))??p[0]??null},Q=()=>{let d=L();if(!d)return;let p=_(d.getAttribute("data-width")),h=_(d.getAttribute("data-height"));p&&(d.style.width=p),h&&(d.style.height=h),p&&d.style.setProperty("--comp-width",p),h&&d.style.setProperty("--comp-height",h)},H=()=>{let d=L(),p=Array.from(document.querySelectorAll("[data-composition-id]")).filter(h=>h.hasAttribute("data-duration")||h.hasAttribute("data-end"));for(let h of p){if(d&&h===d)continue;let S=h.getAttribute("data-duration"),E=h.getAttribute("data-end");S!=null&&!h.hasAttribute(Ns)&&h.setAttribute(Ns,S),E!=null&&!h.hasAttribute(Ts)&&h.setAttribute(Ts,E),h.removeAttribute("data-duration"),h.removeAttribute("data-end")}},N=()=>{let d=L();if(!d)return;d.style.position||(d.style.position="relative"),d.style.overflow="hidden";let p=_(d.getAttribute("data-width")),h=_(d.getAttribute("data-height"));p&&(d.style.width=p),h&&(d.style.height=h);let S=Array.from(d.children);for(let E of S){let T=E.tagName.toLowerCase();if(T==="script"||T==="style"||T==="link"||T==="meta"||!E.hasAttribute("data-start"))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%",$=/translate\\(\\s*-50%\\s*,\\s*-50%\\s*\\)/.test(E.style.transform);if(I&&$&&!E.hasAttribute("data-width")&&!E.hasAttribute("data-height")){let ze=E.style.top,ge=E.style.left,St=E.style.width,le=E.style.height;E.style.top="",E.style.left="",E.style.width="",E.style.height="";let X=window.getComputedStyle(E);X.top!=="auto"||X.bottom!=="auto"||X.left!=="auto"||X.right!=="auto"||X.width!=="0px"||X.height!=="0px"||(E.style.top=ze,E.style.left=ge,E.style.width=St,E.style.height=le)}let Y=window.getComputedStyle(E),Z=Y.position;if(Z!=="absolute"&&Z!=="fixed"&&(E.style.position="absolute"),!!E.style.top||!!E.style.bottom||Y.top!=="auto"||Y.bottom!=="auto"||(E.style.top="0"),!!E.style.left||!!E.style.right||Y.left!=="auto"||Y.right!=="auto"||(E.style.left="0"),T!=="audio"){let ze=_(E.getAttribute("data-width")),ge=_(E.getAttribute("data-height")),St=Y.width!=="0px"&&Y.width!=="auto",le=Y.height!=="0px"&&Y.height!=="auto";ze?!E.style.width&&!St&&(E.style.width=ze):!E.style.width&&Y.width==="0px"&&(E.style.width="100%"),ge?!E.style.height&&!le&&(E.style.height=ge):!E.style.height&&Y.height==="0px"&&(E.style.height="100%")}}},y=(d,p=0,h)=>je({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:h?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(d,p),A=(d,p)=>je({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:p?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(d),C=(d,p=0)=>!d.hasAttribute("data-hf-auto-start")&&d.hasAttribute("data-start")?Math.max(0,Number(d.getAttribute("data-start")??0)||0):y(d,p),M=(d,p)=>{let h=d.parentElement;for(;h&&h!==p;){if(h.hasAttribute("data-start"))return h;h=h.parentElement}return null},k=(d,p)=>{let h=d.tagName.toLowerCase();if(h==="script"||h==="style"||h==="link"||h==="meta")return!1;let S=h==="video"||h==="audio"?C(d,0):y(d,0),E=A(d),T=d.getAttribute("data-composition-id");if(T){let $=(window.__timelines??{})[T],Y=null;if($&&typeof $.duration=="function"){let ae=Number($.duration());Number.isFinite(ae)&&ae>0&&(Y=ae)}let Z=d.hasAttribute("data-composition-src")||d.hasAttribute("data-composition-file");E!=null&&E>0&&Y!=null&&!Z?E=Math.min(E,Y):(E==null||E<=0)&&Y!=null&&(E=Y)}let I=E!=null&&E>0?S+E:Number.POSITIVE_INFINITY;return p>=S&&(Number.isFinite(I)?p<=I:!0)},G=!!document.querySelector("[data-composition-src]"),z=!1;{let d=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let p of d){let h=p.getAttribute("data-composition-id");if(h&&p.children.length===0&&document.querySelector(`template#${CSS.escape(h)}-template`)){z=!0;break}}}let ee=!G&&!z,R=d=>{if(!d||typeof d.duration!="function")return null;try{let p=Number(d.duration());return Number.isFinite(p)?Math.max(0,p):null}catch{return null}},U=d=>typeof d=="number"&&Number.isFinite(d)&&d>u,Ne=d=>{let p=Number(d.getAttribute("data-duration"));if(Number.isFinite(p)&&p>0)return p;let h=Number(d.getAttribute("data-playback-start")??d.getAttribute("data-media-start")??"0"),S=Number.isFinite(h)?Math.max(0,h):0;return Number.isFinite(d.duration)&&d.duration>S?Math.max(0,d.duration-S):null},V=()=>{let d=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(d.length===0)return null;let p=0;for(let h of d){let S=C(h,0);if(!Number.isFinite(S))continue;let E=Ne(h);E==null||E<=u||(p=Math.max(p,Math.max(0,S)+E))}return p>u?p:null},te=()=>{let d=L();if(!d)return null;let p=window.__timelines??{},h=je({timelineRegistry:p,includeAuthoredTimingAttrs:!0}),S=0,E=Number.parseFloat(d.getAttribute("data-duration")??"");Number.isFinite(E)&&E>0&&(S=E);let T=Array.from(d.querySelectorAll("[data-composition-id][data-start]"));for(let I of T){if(!(I instanceof Element)||I.parentElement?.closest("[data-composition-id]")!==d)continue;let Y=h.resolveStartForElement(I,0),Z=h.resolveDurationForElement(I);!Number.isFinite(Y)||Z==null||Z<=0||(S=Math.max(S,Math.max(0,Y)+Z))}return S>u?S:null},W=()=>{let d=V();return typeof d!="number"||!Number.isFinite(d)||d<=u?null:d},ie=d=>U(d)?Math.max(u,d*m):u,he=(d,p=0)=>{let h=R(d),S=W(),E=te(),T=Math.max(S??0,E??0),I=Number.isFinite(p)&&p>u?p:0,$=0;return U(h)?$=Math.max(h,T,I):U(T)?$=Math.max(T,I):$=I,$>0?Math.max(0,$):0},P=()=>{let d=window.__timelines??{},p=je({timelineRegistry:d,includeAuthoredTimingAttrs:!0}),h=W(),S=te(),E=Math.max(h??0,S??0)||null,T=ie(E),I=le=>{let X=document.querySelector(`[data-composition-id="${CSS.escape(le)}"]`);return X?p.resolveStartForElement(X,0):0},$=le=>{let X=window.gsap;if(!X||typeof X.timeline!="function")return null;let fe=X.timeline({paused:!0});for(let ye of le)fe.add(ye.timeline,I(ye.compositionId));return fe},Y=(le,X)=>{if(!U(le))return null;let fe=window.gsap;if(!fe||typeof fe.timeline!="function")return null;let ye=fe.timeline({paused:!0});if(X)try{ye.add(X,0)}catch(ue){v("runtime.init.site2",ue)}let be=ye;if(typeof be.to=="function")try{be.to({},{duration:le})}catch(ue){v("runtime.init.site3",ue)}return ye},Z=(le,X)=>{let fe=le;if(typeof fe.getChildren!="function")return[];try{let ye=fe.getChildren(!0,!0,!0)??[];if(!Array.isArray(ye))return[];let be=[];for(let ue of X)if(!ye.some(ve=>ve===ue.timeline))try{let ve=I(ue.compositionId);le.add(ue.timeline,ve),be.push(ue.compositionId)}catch(ve){v("runtime.init.site4",ve)}return be}catch{return[]}},ae=L(),de=ae?.getAttribute("data-composition-id")??null;if(!de)return{timeline:null};let Fe=d[de]??null,ge=(()=>{if(!ae)return[];let le=new Set,X=Array.from(ae.querySelectorAll("[data-composition-id]")),fe=[];for(let ye of X){let be=ye.getAttribute("data-composition-id");if(!be||be===de||le.has(be))continue;le.add(be);let ue=d[be]??null;if(!ue||typeof ue.play!="function"||typeof ue.pause!="function")continue;let Me=R(ue);fe.push({compositionId:be,timeline:ue,durationSeconds:Me??0})}return fe})(),St=le=>{for(let X of le){let fe=X.timeline;if(typeof fe.paused=="function")try{fe.paused(!1)}catch(ye){v("runtime.init.site5",ye)}}};if(ge.length>0&&St(ge),Fe){let le=ge.length>0?Z(Fe,ge):[];if((ge.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id=\'"+de+"\'])"))&&(D=!0),le.length>0)try{let ue=Fe.time();Fe.seek(ue,!1)}catch{}let X=R(Fe);if(!U(X)&&ge.length>0){let ue=ge.map(da=>da.compositionId),Me=$(ge),ve=R(Me);if(Me&&U(ve))return{timeline:Me,selectedTimelineIds:ue,selectedDurationSeconds:ve,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:de,rootDurationSeconds:X,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:T,selectedDurationSeconds:ve,mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:S,selectedTimelineIds:ue,autoNestedChildren:le}}};let In=Y(E??0,Fe),Pn=R(In);if(In&&U(Pn))return{timeline:In,selectedTimelineIds:[de],selectedDurationSeconds:Pn,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:de,rootDurationSeconds:X,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:S,selectedDurationSeconds:Pn,selectedTimelineIds:[de],autoNestedChildren:le}}}}if(!U(X)&&ge.length===0){let ue=Y(E??0,Fe),Me=R(ue);if(ue&&U(Me))return{timeline:ue,selectedTimelineIds:[de],selectedDurationSeconds:Me,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:de,rootDurationSeconds:X,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:h,authoredCompositionDurationFloorSeconds:S,selectedDurationSeconds:Me,selectedTimelineIds:[de]}}}}let fe=ae?.getAttribute("data-duration"),ye=fe?parseFloat(fe):null,be=Math.max(U(ye)?ye:0,S??0);if(be>0&&U(be)&&U(X)&&be>=X+.5){let ue=Fe;if(typeof ue.to=="function")try{ue.to({},{duration:0},be)}catch(ve){v("runtime.init.site6",ve)}let Me=R(Fe);if(U(Me))return{timeline:Fe,selectedTimelineIds:[de],selectedDurationSeconds:Me,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:de,rootDurationSeconds:X,rootDeclaredDur:ye,authoredCompositionDurationFloorSeconds:S,newDur:Me}}}}return{timeline:Fe,selectedTimelineIds:[de],selectedDurationSeconds:X,mediaDurationFloorSeconds:h,diagnostics:le.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:de,selectedDurationSeconds:X,autoNestedChildren:le}}:void 0}}if(ge.length>0){let le=ge.map(ye=>ye.compositionId),X=$(ge),fe=R(X);if(X)return{timeline:X,selectedTimelineIds:le,selectedDurationSeconds:fe,mediaDurationFloorSeconds:h,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:de,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:T,selectedDurationSeconds:fe,mediaDurationFloorSeconds:h,selectedTimelineIds:le}}}}return{timeline:null}},D=!1,O=()=>{if(!ee)return!1;let d=t.capturedTimeline,p=R(d),h=U(p);if(d&&h&&D)return!1;let S=P();if(!S.timeline)return!1;if(d&&d===S.timeline)return typeof d.timeScale=="function"&&d.timeScale(t.playbackRate),!1;t.capturedTimeline=S.timeline,typeof t.capturedTimeline.timeScale=="function"&&t.capturedTimeline.timeScale(t.playbackRate);let E=he(t.capturedTimeline,0);if(E>0){try{B.setDuration(E)}catch{}t.capturedTimeline.pause();let T=Math.max(0,t.currentTime||0);typeof t.capturedTimeline.totalTime=="function"&&t.capturedTimeline.totalTime(T,!1);let I=window.__hfStudioManualEditsApply;typeof I=="function"&&I()}if(S.diagnostics&&Ae({source:"hf-preview",type:"diagnostic",code:S.diagnostics.code,details:S.diagnostics.details}),Ae({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:S.selectedTimelineIds??[],selectedDurationSeconds:S.selectedDurationSeconds??null,mediaDurationFloorSeconds:S.mediaDurationFloorSeconds??null}}),window.parent!==window){let T=L(),I=E>0?E:0,$=String(I>0?I:1),Y=new Set;if(t.capturedTimeline.getChildren)try{for(let Z of t.capturedTimeline.getChildren(!0))if(typeof Z.targets=="function")for(let ae of Z.targets())ae instanceof HTMLElement&&ae!==T&&(ae.hasAttribute("data-start")||M(ae,T)||Y.has(ae)||(Y.add(ae),ae.setAttribute("data-start","0"),ae.setAttribute("data-duration",$)))}catch{}if(T instanceof HTMLElement)for(let Z of T.querySelectorAll("[id]"))Z instanceof HTMLElement&&Z!==T&&(Z.hasAttribute("data-start")||M(Z,T)||Y.has(Z)||Z.tagName==="SCRIPT"||Z.tagName==="STYLE"||Z.tagName==="LINK"||(Y.add(Z),Z.setAttribute("data-start","0"),Z.setAttribute("data-duration",$)))}for(let T of Be)Te.delete(T),Gi(T);return!0};window.__hfForceTimelineRebind=()=>{D=!1,O()};let se=()=>{let d=L();if(!(d instanceof HTMLElement))return;let p=d.getBoundingClientRect(),h=Number(d.getAttribute("data-width")),S=Number(d.getAttribute("data-height")),E=window.getComputedStyle(d),T=Number.isFinite(h)&&h>0&&Number.isFinite(S)&&S>0,I=p.width<=0||p.height<=0||d.clientWidth<=0||d.clientHeight<=0;!T||!I||a("root_stage_layout_zero",{compositionId:d.getAttribute("data-composition-id")??null,declaredWidth:h,declaredHeight:S,rectWidth:Math.round(p.width),rectHeight:Math.round(p.height),clientWidth:d.clientWidth,clientHeight:d.clientHeight,display:E.display,visibility:E.visibility,overflow:E.overflow},`root-stage-layout-zero:${d.getAttribute("data-composition-id")??"unknown"}`)},re=()=>{t.tornDown||(s!=null&&window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{s=null,se()}))},j=()=>{n=d=>{let p=b(d.error??d.message).slice(0,g);if(!p)return;let h=F(p);Ae({source:"hf-preview",type:"diagnostic",code:h.code,details:{category:h.category,message:p,filename:d.filename||null,line:Number.isFinite(d.lineno)?d.lineno:null,column:Number.isFinite(d.colno)?d.colno:null}})},i=d=>{let p=b(d.reason).slice(0,g);if(!p)return;let h=F(p);Ae({source:"hf-preview",type:"diagnostic",code:`${h.code}_unhandled_rejection`,details:{category:`${h.category}-unhandled-rejection`,message:p}})},window.addEventListener("error",n),window.addEventListener("unhandledrejection",i)},q=()=>{let d=Array.from(document.querySelectorAll("img, video, audio, source, link[rel=\'stylesheet\']"));for(let h of d){let S=()=>{if(!(h instanceof Element))return;let E=h.tagName.toLowerCase(),T=h.getAttribute("src")??h.getAttribute("href")??h.getAttribute("poster")??null,I=E==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";a(I,{tagName:E,assetUrl:T,currentSrc:(h instanceof HTMLImageElement||h instanceof HTMLMediaElement)&&h.currentSrc||null,readyState:h instanceof HTMLMediaElement?h.readyState:null,networkState:h instanceof HTMLMediaElement?h.networkState:null},`${I}:${E}:${T??"unknown"}`)};h.addEventListener("error",S),l(()=>{h.removeEventListener("error",S)})}let p=document.fonts;p&&p.ready.then(()=>{if(t.tornDown)return;let h=Array.from(p).filter(S=>S.status==="error").map(S=>S.family).filter(S=>!!S).slice(0,10);h.length!==0&&a("runtime_font_load_issue",{failedFamilies:h,totalFaces:Array.from(p).length},`runtime-font-load-issue:${h.join("|")}`)}).catch(()=>{})},J=(d,p)=>{if(!d.timeline)return!1;let h=t.capturedTimeline;if(h&&h===d.timeline)return!1;let S=Math.max(0,t.currentTime||0),E=t.isPlaying;t.capturedTimeline=d.timeline,typeof t.capturedTimeline.timeScale=="function"&&t.capturedTimeline.timeScale(t.playbackRate);try{t.capturedTimeline.pause(),t.capturedTimeline.seek(S,!1),E&&t.capturedTimeline.play()}catch(T){v("runtime.init.site7",T)}return Ae({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:p,previousTime:S,selectedTimelineIds:d.selectedTimelineIds??[],selectedDurationSeconds:d.selectedDurationSeconds??null,mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),!0},Se=null,we=!1,Be=new Set,Te=new WeakMap,en=()=>{t.tornDown||(Se!=null&&window.clearTimeout(Se),Se=window.setTimeout(()=>{if(t.tornDown)return;Se=null;let d=P();if(!d.timeline||!U(d.mediaDurationFloorSeconds??null))return;if(!t.capturedTimeline){O()&&(st(),_e(!0));return}if(we)return;let h=R(t.capturedTimeline),S=d.selectedDurationSeconds??R(d.timeline);U(S)&&(!U(h)||S>=h+x)&&J(d,"manual")&&(we=!0,Ae({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:h??null,selectedDurationSeconds:S??null,selectedTimelineIds:d.selectedTimelineIds??[],mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),st(),_e(!0))},w))},na=()=>{for(let d of Be)d.removeEventListener("loadedmetadata",en),d.removeEventListener("durationchange",en);Be.clear()},Ln=()=>{if(t.tornDown)return;let d=Array.from(document.querySelectorAll("video, audio"));for(let p of d){if(Be.has(p))continue;Be.add(p);let h=Number.parseFloat(p.dataset.volume??"");Number.isFinite(h)&&(p.volume=Math.max(0,Math.min(1,h))),p.addEventListener("loadedmetadata",en),p.addEventListener("durationchange",en),p.preload!=="auto"&&(p.preload="auto"),p.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&p.load(),Gi(p)}},Gi=d=>{Te.has(d)||pr(d,t.capturedTimeline,he(t.capturedTimeline,0),Te)},Ve=()=>{let d=T=>{let I=T.closest("[data-composition-id]"),$=I?y(I,0):null,Y=I?A(I,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:I,inheritedStart:$,inheritedDuration:Y}},p=hr({shouldIncludeElement:T=>T.hasAttribute("data-start")||!!d(T).compositionRoot,resolveStartSeconds:T=>{let I=d(T);return C(T,I.inheritedStart??0)},resolveDurationSeconds:T=>{let I=d(T),$=C(T,I.inheritedStart??0),Y=Number.parseFloat(T.dataset.playbackStart??T.dataset.mediaStart??"0")||0,Z=I.inheritedStart!=null&&I.inheritedDuration!=null&&I.inheritedDuration>0?Math.max(0,I.inheritedStart+I.inheritedDuration-$):null,ae=Number.isFinite(T.duration)&&T.duration>Y?Math.max(0,T.duration-Y):null,de=Number.parseFloat(T.dataset.duration??""),Fe=Number.isFinite(de)&&de>0?de:null,ze=[ae,Z,Fe].filter(ge=>ge!=null);return ze.length>0?Math.min(...ze):null}});for(let T of p.mediaClips){let I=Te.get(T.el);I&&(T.volumeKeyframes=I)}let h=t.mediaForceSyncNextTick;h&&(t.mediaForceSyncNextTick=!1),xr({clips:p.mediaClips,timeSeconds:t.currentTime,playing:t.isPlaying,playbackRate:t.playbackRate,outputMuted:t.mediaOutputMuted,userMuted:t.bridgeMuted,userVolume:t.bridgeVolume,forceSync:h,onElementVolume:(T,I)=>pe.setElementVolume(T,I),isWebAudioOwned:T=>pe.ownsElement(T),onAutoplayBlocked:()=>{t.mediaAutoplayBlockedPosted||(t.mediaAutoplayBlockedPosted=!0,Ae({source:"hf-preview",type:"media-autoplay-blocked"}))}});let S=Array.from(document.querySelectorAll("[data-start]")),E=L();for(let T of S){if(!(T instanceof HTMLElement))continue;let I=k(T,t.currentTime);if(I&&window.parent!==window){let $=T.parentElement;for(;$&&$!==E;){if($ instanceof HTMLElement&&$.hasAttribute("data-start")&&!k($,t.currentTime)){I=!1;break}$=$.parentElement}}T.style.visibility=I?"visible":"hidden",(T instanceof HTMLVideoElement||T instanceof HTMLImageElement)&&e?.setSourceVisibility(T,I)}},_e=d=>{let p=Math.max(0,Math.round((t.currentTime||0)*t.canonicalFps)),h=Date.now();(d||p!==t.bridgeLastPostedFrame||t.isPlaying!==t.bridgeLastPostedPlaying||t.bridgeMuted!==t.bridgeLastPostedMuted||h-t.bridgeLastPostedAt>=t.bridgeMaxPostIntervalMs)&&(t.bridgeLastPostedFrame=p,t.bridgeLastPostedPlaying=t.isPlaying,t.bridgeLastPostedMuted=t.bridgeMuted,t.bridgeLastPostedAt=h,Ae({source:"hf-preview",type:"state",frame:p,isPlaying:t.isPlaying,muted:t.bridgeMuted,playbackRate:t.playbackRate}))},Wi="",ia=()=>{let d="";for(let p of document.querySelectorAll("[data-start]"))d+=`${p.id}:${p.tagName}|`;return d},st=()=>{H(),Q(),N();let d=L();if(d){let S=_(d.getAttribute("data-width")),E=_(d.getAttribute("data-height")),T=S?parseInt(S,10):0,I=E?parseInt(E,10):0;T>0&&I>0&&Ae({source:"hf-preview",type:"stage-size",width:T,height:I})}O();let p=Mr({canonicalFps:t.canonicalFps});window.__clipManifest=p;let h=ia();if(!window.__clipTree||Wi!==h){let S=window;window.__clipTree=Nr({startResolver:je({timelineRegistry:S.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:S.__timelines??{},rootDuration:p.durationInFrames/t.canonicalFps}),Wi=h}Ae(p),re()},Ie=(d,p=0)=>{for(let h of t.deterministicAdapters){try{d==="discover"&&h.discover(),d==="pause"&&h.pause(),d==="play"&&h.play&&h.play()}catch(S){v("runtime.init.site8",S)}if(d==="discover")try{h.seek({time:p})}catch(S){v("runtime.init.site9",S)}}},et=()=>{window.__renderReady=!1},yt=null,bt=!0,ra=()=>{let d=[];for(let p of t.deterministicAdapters){let h=p.getReadyPromise;if(typeof h=="function")try{let S=h();S&&d.push(S)}catch(S){v("runtime.init.adapterReady",S)}}return d},oa=()=>{let d=ra();if(d.length===0)return yt=null,bt=!0,!0;let p=d.length===1?d[0]:Promise.all(d);return p!==yt&&(yt=p,bt=!1,Promise.resolve(p).then(()=>{yt===p&&(bt=!0,et())},h=>{yt===p&&(bt=!0,v("runtime.init.adapterReady",h),et())})),bt};if(ee)Fi();else{let d={injectedStyles:t.injectedCompStyles,injectedScripts:t.injectedCompScripts,parseDimensionPx:_,onDiagnostic:({code:p,details:h})=>{Ae({source:"hf-preview",type:"diagnostic",code:p,details:h})}};us(d).then(()=>ls(d)).finally(()=>{ee=!0,Ln(),q(),Fi(),et()})}let tn=gr({postMessage:d=>Ae(d)});tn.installPickerApi();let He=Cs();e=He,l(()=>{He.destroy(),e=null});let vn=d=>{let p=Number(d);!Number.isFinite(p)||p<=0?t.playbackRate=1:t.playbackRate=Math.max(.1,Math.min(5,p)),t.mediaForceSyncNextTick=!0,t.capturedTimeline&&typeof t.capturedTimeline.timeScale=="function"&&t.capturedTimeline.timeScale(t.playbackRate);let h=document.querySelectorAll("video, audio");for(let S of h)if(S instanceof HTMLMediaElement)try{S.playbackRate=t.playbackRate}catch(E){v("runtime.init.site10",E)}},me=Sr({getTimeline:()=>t.capturedTimeline,setTimeline:d=>{t.capturedTimeline=d},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>t.isPlaying,setIsPlaying:d=>{t.isPlaying!==d&&(t.mediaForceSyncNextTick=!0),t.isPlaying=d},getPlaybackRate:()=>t.playbackRate,setPlaybackRate:vn,getCanonicalFps:()=>t.canonicalFps,onSyncMedia:(d,p)=>{t.currentTime=Math.max(0,Number(d)||0),t.isPlaying!==p&&(t.mediaForceSyncNextTick=!0),t.isPlaying=p,Ve()},onStatePost:_e,onDeterministicSeek:d=>{for(let p of t.deterministicAdapters)try{p.seek({time:Number(d)||0})}catch(h){v("runtime.init.site11",h)}},onDeterministicPause:()=>Ie("pause"),onDeterministicPlay:()=>Ie("play"),onRenderFrameSeek:()=>{He.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>he(t.capturedTimeline,0)});window.__player=c(me),window.__playerReady=!0,Ki(Ae),At("composition_loaded",{duration:me.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),t.controlBridgeHandler=$i({onPlay:()=>{me.play(),At("composition_played",{time:me.getTime()})},onPause:()=>{me.pause(),At("composition_paused",{time:me.getTime()})},onStopMedia:()=>{pe.stopAll();let d=document.querySelectorAll("video, audio");for(let p of d)p instanceof HTMLMediaElement&&!p.paused&&p.pause()},onSeek:(d,p)=>{let h=Math.max(0,d)/t.canonicalFps;me.seek(h),At("composition_seeked",{time:h})},onSetMuted:d=>{t.bridgeMuted=d;let p=d||t.mediaOutputMuted;pe.setMuted(p);let h=document.querySelectorAll("video, audio");for(let S of h)S instanceof HTMLMediaElement&&(S.muted=p||S.defaultMuted)},onSetVolume:d=>{t.bridgeVolume=d,pe.setVolume(d);let p=document.querySelectorAll("video, audio");for(let h of p){if(!(h instanceof HTMLMediaElement))continue;let S=parseFloat(h.dataset.volume??""),E=Number.isFinite(S)?S:1;h.volume=E*d}},onSetMediaOutputMuted:d=>{t.mediaOutputMuted=d;let p=d||t.bridgeMuted;pe.setMuted(p);let h=document.querySelectorAll("video, audio");for(let S of h)S instanceof HTMLMediaElement&&(S.muted=p||S.defaultMuted)},onSetPlaybackRate:d=>{vn(d),t.transportClock&&t.transportClock.setRate(t.playbackRate),ji()},onSetColorGrading:(d,p)=>{He.setGrading(d,p)},onSetColorGradingCompare:(d,p)=>{He.setCompare(d,p)},onTick:()=>{if(t.tornDown||!B.isPlaying())return;let d=B.now();if(t.currentTime=d,tt(d),B.reachedEnd()){pe.stopAll(),B.detachAudioSource(),B.pause(),t.isPlaying=!1;let p=B.getDuration();Number.isFinite(p)&&(B.seek(p),t.currentTime=p,tt(p)),Ie("pause"),Ve(),_e(!0)}},onEnablePickMode:()=>tn.enablePickMode(),onDisablePickMode:()=>tn.disablePickMode()}),t.deterministicAdapters=[fr(),Ji({resolveStartSeconds:d=>y(d,0)}),Xi(),er(),nr(),ir(),rr(),or(),sr(),ar(),lr(),Yi({getTimeline:()=>t.capturedTimeline})],cr(),dr(),window.__hfReseekGpu=d=>{let p=Math.max(0,Number(d)||0);window.__hfThreeTime=p,window.__hfTypegpuTime=p,tr(p)},j(),Ln(),Ie("discover");let B=new wn;t.transportClock=B;let pe=new Cn,kn=!1;pe.init().then(d=>{kn=d});let sa=()=>{let d=t.capturedTimeline,p=O();t.capturedTimeline&&(p||t.capturedTimeline!==d||!me._timeline)&&(me._timeline=t.capturedTimeline);let h=he(t.capturedTimeline,0);h>0&&B.setDuration(h),Ie("discover",t.currentTime),window.__renderReady=!0,st(),_e(!0)};if(et=()=>{if(!ee||window.__hfTimelinesBuilding){window.__renderReady=!1;return}if(Ie("discover",t.currentTime),!oa()){window.__renderReady=!1;return}sa()},window.__hfTimelinesBuilding){window.__renderReady=!1;let d=()=>{window.removeEventListener("hf-timelines-built",d),et()};window.addEventListener("hf-timelines-built",d)}et(),ee&&setTimeout(()=>{et()},0);let nn=0,Rn=!1,aa=(d,p,h)=>{try{d.pause(),typeof d.totalTime=="function"?d.totalTime(p,!1):d.seek(p,!1)}catch(S){v(h,S)}},la=d=>{let p=window.__timelines??{},h=L()?.getAttribute("data-composition-id")??null;for(let[S,E]of Object.entries(p)){if(!E||S===h)continue;let T=document.querySelector(`[data-composition-id="${CSS.escape(S)}"]`);if(!T)continue;let I=y(T,0);if(!Number.isFinite(I))continue;let $=A(T,{includeAuthoredTimingAttrs:!0}),Y=R(E),Z=$!=null&&$>0?$:Y,ae=Math.max(0,Z!=null&&Z>0?Math.min(Z,d-I):d-I);aa(E,ae,"runtime.init.transport.childTimeline")}},ua=d=>{let p=window.__timelines??{};for(let h of Object.values(p))if(!(!h||h===d))try{h.play()}catch(S){v("runtime.init.activateSiblings",S)}},tt=(d,p)=>{let h=t.capturedTimeline;if(h){p?.activateChildren&&ua(h);try{typeof h.totalTime=="function"?h.totalTime(d,!1):h.seek(d,!1)}catch(S){v("runtime.init.transport.seek",S)}}else la(d);for(let S of t.deterministicAdapters)try{S.seek({time:d})}catch(E){v("runtime.init.transport.adapter",E)}},ca=()=>{try{return document.querySelector(`[${Ms}]`)!=null}catch{return!1}},Ui=()=>{if(!(t.tornDown||Rn)){Rn=!0;try{if(t.transportRafId=window.requestAnimationFrame(Ui),nn+=1,nn%60===0&&!(B.isPlaying()&&t.capturedTimeline!=null&&B.now()<f)){let h=t.capturedTimeline;if(O()){t.capturedTimeline&&!me._timeline&&(me._timeline=t.capturedTimeline),t.capturedTimeline&&t.capturedTimeline!==h&&t.capturedTimeline.pause();let S=he(t.capturedTimeline,0);S>0&&B.setDuration(S),st()}}if(nn%20===0&&st(),nn%30===0&&Ln(),t.capturedTimeline){let p=he(t.capturedTimeline,0);p>0&&B.setDuration(p)}if(B.isPlaying()&&!t.mediaOutputMuted)if(pe.isActive()&&pe.context){let p=pe.getTime();p>=0&&B.attachAudioSource({currentTimeSeconds:p})}else{let p=document.querySelectorAll("audio[data-start]"),h=!1;for(let S of p){if(!(S instanceof HTMLMediaElement)||!S.isConnected)continue;let E=Number.parseFloat(S.dataset.start??""),T=Number.parseFloat(S.dataset.duration??""),I=Number.isFinite(T)&&T>0?E+T:1/0,$=Number.parseFloat(S.dataset.playbackStart??S.dataset.mediaStart??"0")||0;if(Number.isFinite(E)&&t.currentTime>=E&&t.currentTime<=I){S.paused?!S.error&&S.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(B.attachAudioSource({currentTimeSeconds:t.currentTime}),h=!0):(B.attachAudioSource({el:S,compositionStart:E,mediaStart:$}),h=!0);break}}!h&&B.hasAudioSource()&&B.detachAudioSource()}else B.hasAudioSource()&&B.detachAudioSource();let d=B.now();if(t.currentTime=d,(B.isPlaying()||!ca())&&tt(d),B.isPlaying()&&B.reachedEnd()){pe.stopAll(),B.detachAudioSource(),B.pause(),t.isPlaying=!1;let p=B.getDuration();Number.isFinite(p)&&(B.seek(p),t.currentTime=p,tt(p)),Ie("pause"),Ve(),_e(!0);return}B.isPlaying()&&Ve(),_e(!1)}finally{Rn=!1}}},Vi=d=>{let p=document.querySelectorAll("video, audio");for(let h of p){if(!(h instanceof HTMLMediaElement)||!h.isConnected)continue;let S=Number.parseFloat(h.dataset.start??"");if(!Number.isFinite(S))continue;let E=Number.parseFloat(h.dataset.duration??""),T=Number.isFinite(E)&&E>0?S+E:1/0;if(d<S||d>=T)continue;let I=Number.parseFloat(h.dataset.playbackStart??h.dataset.mediaStart??"0")||0,$=d-S+I;if($>=0)try{h.currentTime=$}catch{}}},zi=()=>{let d=pe.startGeneration(),p=document.querySelectorAll("audio[data-start]");for(let h of p){if(!(h instanceof HTMLMediaElement)||!h.isConnected)continue;let S=Number.parseFloat(h.dataset.start??"");if(!Number.isFinite(S))continue;let E=Number.parseFloat(h.dataset.playbackStart??h.dataset.mediaStart??"0")||0,T=Number.parseFloat(h.dataset.volume??""),I=Number.isFinite(T)?T:1,$=Number.parseFloat(h.dataset.duration??""),Y=Number.isFinite($)&&$>0?$:Number.POSITIVE_INFINITY,Z=h.closest("[data-composition-id]");if(Z){let ae=y(Z,0),de=A(Z,{includeAuthoredTimingAttrs:!0});de!=null&&de>0&&(Y=Math.min(Y,Math.max(0,ae+de-S)))}pe.decodeAudioElement(h).then(ae=>{!ae||!B.isPlaying()||pe.schedulePlayback(h,ae,S,E,B.now(),I*t.bridgeVolume,d,t.playbackRate,Y)})}},ji=()=>{pe.setRate(t.playbackRate)&&kn&&B.isPlaying()&&pe.hasBoundedActiveSources()&&(pe.stopAll(),zi())};if(me.play=()=>{let d=t.capturedTimeline;if(B.isPlaying())return;let p=he(d,0);if(p>0)B.setDuration(p),B.reachedEnd()&&(B.seek(0),t.currentTime=0,tt(0));else{let h=L(),S=Number(h?.getAttribute("data-duration")??0);S>0&&B.setDuration(S)}d&&d.pause(),B.play()&&(t.isPlaying=!0,t.mediaForceSyncNextTick=!0,Vi(B.now()),kn&&zi(),Ie("play"),Ve(),He.redraw(),_e(!0))},me.pause=()=>{if(!B.isPlaying())return;pe.stopAll(),B.detachAudioSource(),B.pause(),t.isPlaying=!1,t.currentTime=B.now(),t.mediaForceSyncNextTick=!0,Vi(t.currentTime);let d=t.capturedTimeline;d&&d.pause(),Ie("pause"),Ve(),He.redraw(),_e(!0)},me.seek=d=>{let p=lt(Math.max(0,Number(d)||0),t.canonicalFps);pe.stopAll(),B.detachAudioSource(),B.isPlaying()&&B.pause(),B.seek(p),t.currentTime=B.now(),t.isPlaying=!1,t.mediaForceSyncNextTick=!0;let S=t.capturedTimeline;S&&S.pause(),tt(t.currentTime),Ie("pause"),Ve(),He.redraw(),_e(!0)},me.renderSeek=d=>{let p=lt(Math.max(0,Number(d)||0),t.canonicalFps);B.isPlaying()&&B.pause(),B.seek(p),t.currentTime=B.now(),t.isPlaying=!1,t.mediaForceSyncNextTick=!0,tt(t.currentTime,{activateChildren:!0}),Ve(),He.redraw(),_e(!0)},me.getTime=()=>B.now(),me.getDuration=()=>{let d=B.getDuration();return Number.isFinite(d)?d:0},me.isPlaying=()=>B.isPlaying(),me.setPlaybackRate=d=>{vn(d),B.setRate(t.playbackRate),ji()},t.capturedTimeline){let d=he(t.capturedTimeline,0);d>0&&B.setDuration(d),t.capturedTimeline.pause()}let qi=window.__player;if(qi){let d=["play","pause","seek","renderSeek","getTime","getDuration","isPlaying"];for(let p of d)Object.defineProperty(qi,p,{get:()=>me[p],set:h=>{me[p]=h},configurable:!0})}t.transportRafId=window.requestAnimationFrame(Ui),st(),_e(!0);let Dn=()=>{if(!t.tornDown){t.tornDown=!0,t.transportRafId!=null&&(window.cancelAnimationFrame(t.transportRafId),t.transportRafId=null),t.transportClock=null,pe.destroy(),Se!=null&&(window.clearTimeout(Se),Se=null),s!=null&&(window.cancelAnimationFrame(s),s=null),na(),t.controlBridgeHandler&&(window.removeEventListener("message",t.controlBridgeHandler),t.controlBridgeHandler=null),n&&(window.removeEventListener("error",n),n=null),i&&(window.removeEventListener("unhandledrejection",i),i=null),t.beforeUnloadHandler&&(window.removeEventListener("beforeunload",t.beforeUnloadHandler),t.beforeUnloadHandler=null),tn.disablePickMode();for(let d of t.deterministicAdapters)if(!(!d||typeof d.revert!="function"))try{d.revert()}catch(p){v("runtime.init.site12",p)}t.deterministicAdapters=[];for(let d of r.splice(0))try{d()}catch(p){v("runtime.init.site13",p)}for(let d of t.injectedCompStyles)try{d.remove()}catch(p){v("runtime.init.site14",p)}t.injectedCompStyles=[];for(let d of t.injectedCompScripts)try{d.remove()}catch(p){v("runtime.init.site15",p)}t.injectedCompScripts=[],t.capturedTimeline=null,window.__hfRuntimeTeardown===Dn&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=Dn,t.beforeUnloadHandler=Dn,window.addEventListener("beforeunload",t.beforeUnloadHandler)}var Ls=["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"],ki=[[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 Ic(t){if(t<=255)return Ls[t];let e=0,n=ki.length-1;for(;e<=n;){let i=e+n>>1,r=ki[i];if(t<r[0]){n=i-1;continue}if(t>r[1]){e=i+1;continue}return r[2]}return"L"}function Pc(t){let e=t.length;if(e===0)return null;let n=new Array(e),i=!1;for(let c=0;c<e;){let u=t.charCodeAt(c),m=u,f=1;if(u>=55296&&u<=56319&&c+1<e){let w=t.charCodeAt(c+1);w>=56320&&w<=57343&&(m=(u-55296<<10)+(w-56320)+65536,f=2)}let x=Ic(m);(x==="R"||x==="AL"||x==="AN")&&(i=!0);for(let w=0;w<f;w++)n[c+w]=x;c+=f}if(!i)return null;let r=0;for(let c=0;c<e;c++){let u=n[c];if(u==="L"){r=0;break}if(u==="R"||u==="AL"){r=1;break}}let o=new Int8Array(e);for(let c=0;c<e;c++)o[c]=r;let s=r&1?"R":"L",l=s,a=l;for(let c=0;c<e;c++)n[c]==="NSM"?n[c]=a:a=n[c];a=l;for(let c=0;c<e;c++){let u=n[c];u==="EN"?n[c]=a==="AL"?"AN":"EN":(u==="R"||u==="L"||u==="AL")&&(a=u)}for(let c=0;c<e;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<e-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<e;c++){if(n[c]!=="EN")continue;let u;for(u=c-1;u>=0&&n[u]==="ET";u--)n[u]="EN";for(u=c+1;u<e&&n[u]==="ET";u++)n[u]="EN"}for(let c=0;c<e;c++){let u=n[c];(u==="WS"||u==="ES"||u==="ET"||u==="CS")&&(n[c]="ON")}a=l;for(let c=0;c<e;c++){let u=n[c];u==="EN"?n[c]=a==="L"?"L":"EN":(u==="R"||u==="L")&&(a=u)}for(let c=0;c<e;c++){if(n[c]!=="ON")continue;let u=c+1;for(;u<e&&n[u]==="ON";)u++;let m=c>0?n[c-1]:l,f=u<e?n[u]:l,x=m!=="L"?"R":"L";if(x===(f!=="L"?"R":"L"))for(let g=c;g<u;g++)n[g]=x;c=u-1}for(let c=0;c<e;c++)n[c]==="ON"&&(n[c]=s);for(let c=0;c<e;c++){let u=n[c];(o[c]&1)===0?u==="R"?o[c]++:(u==="AN"||u==="EN")&&(o[c]+=2):(u==="L"||u==="AN"||u==="EN")&&o[c]++}return o}function vs(t,e){let n=Pc(t);if(n===null)return null;let i=new Int8Array(e.length);for(let r=0;r<e.length;r++)i[r]=n[e[r]];return i}var Oc=/[ \\t\\n\\r\\f]+/g,Bc=/[\\t\\n\\r\\f]| {2,}|^ | $/;function Hc(t){let e=t??"normal";return e==="pre-wrap"?{mode:e,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:e,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Gc(t){if(!Bc.test(t))return t;let e=t.replace(Oc," ");return e.charCodeAt(0)===32&&(e=e.slice(1)),e.length>0&&e.charCodeAt(e.length-1)===32&&(e=e.slice(0,-1)),e}function Wc(t){return/[\\r\\f]/.test(t)?t.replace(/\\r\\n/g,`\n`).replace(/[\\r\\f]/g,`\n`):t.replace(/\\r\\n/g,`\n`)}var Ri=null,Uc;function Vc(){return Ri===null&&(Ri=new Intl.Segmenter(Uc,{granularity:"word"})),Ri}var zc=/\\p{Script=Arabic}/u,Fn=/\\p{M}/u,Hs=/\\p{Nd}/u;function ks(t){return zc.test(t)}function Rs(t){return t>=19968&&t<=40959||t>=13312&&t<=19903||t>=131072&&t<=173791||t>=173824&&t<=177983||t>=177984&&t<=178207||t>=178208&&t<=183983||t>=183984&&t<=191471||t>=191472&&t<=192093||t>=194560&&t<=195103||t>=196608&&t<=201551||t>=201552&&t<=205743||t>=205744&&t<=210041||t>=63744&&t<=64255||t>=12288&&t<=12351||t>=12352&&t<=12447||t>=12448&&t<=12543||t>=44032&&t<=55215||t>=65280&&t<=65519}function De(t){for(let e=0;e<t.length;e++){let n=t.charCodeAt(e);if(!(n<12288)){if(n>=55296&&n<=56319&&e+1<t.length){let i=t.charCodeAt(e+1);if(i>=56320&&i<=57343){let r=(n-55296<<10)+(i-56320)+65536;if(Rs(r))return!0;e++;continue}}if(Rs(n))return!0}}return!1}function jc(t){let e=Tn(t);return e!==null&&(Nn.has(e)||Qe.has(e))}var qc=new Set(["\\xA0","\\u202F","\\u2060","\\uFEFF"]);function $c(t){return De(t)}function Kc(t){let e=Tn(t);return e!==null&&qc.has(e)}function Mn(t){return!jc(t)&&!Kc(t)}var Nn=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"]),Zt=new Set([\'"\',"(","[","{","\\u201C","\\u2018","\\xAB","\\u2039","\\uFF08","\\u3014","\\u3008","\\u300A","\\u300C","\\u300E","\\u3010","\\u3016","\\u3018","\\u301A"]),Ii=new Set(["\'","\\u2019"]),Qe=new Set([".",",","!","?",":",";","\\u060C","\\u061B","\\u061F","\\u0964","\\u0965","\\u104A","\\u104B","\\u104C","\\u104D","\\u104F",")","]","}","%",\'"\',"\\u201D","\\u2019","\\xBB","\\u203A","\\u2026"]),Jc=new Set([":",".","\\u060C","\\u061B"]),Yc=new Set(["\\u104F"]),Xc=new Set(["\\u201D","\\u2019","\\xBB","\\u203A","\\u300D","\\u300F","\\u3011","\\u300B","\\u3009","\\u3015","\\uFF09"]);function Qc(t){if(Pi(t))return!0;let e=!1;for(let n of t){if(Qe.has(n)){e=!0;continue}if(!(e&&Fn.test(n)))return!1}return e}function Zc(t){for(let e of t)if(!Nn.has(e)&&!Qe.has(e))return!1;return t.length>0}function ed(t){if(Pi(t))return!0;for(let e of t)if(!Zt.has(e)&&!Ii.has(e)&&!Fn.test(e))return!1;return t.length>0}function Pi(t){let e=!1;for(let n of t)if(!(n==="\\\\"||Fn.test(n))){if(Zt.has(n)||Qe.has(n)||Ii.has(n)){e=!0;continue}return!1}return e}function Gs(t,e){let n=e-1;if(n<=0)return Math.max(n,0);let i=t.charCodeAt(n);if(i<56320||i>57343)return n;let r=n-1;if(r<0)return n;let o=t.charCodeAt(r);return o>=55296&&o<=56319?r:n}function Tn(t){if(t.length===0)return null;let e=Gs(t,t.length);return t.slice(e)}function td(t){let e=Array.from(t),n=e.length;for(;n>0;){let i=e[n-1];if(Fn.test(i)){n--;continue}if(Zt.has(i)||Ii.has(i)){n--;continue}break}return n<=0||n===e.length?null:{head:e.slice(0,n).join(""),tail:e.slice(n).join("")}}function nd(t,e,n){return n==="text"&&!e&&t.length===1&&t!=="-"&&t!=="\\u2014"?t:null}function Ds(t,e,n,i){let r=e[i],o=t[i];if(r==null)return o;let s=n[i];if(o.length===s)return o;let l=r.repeat(s);return t[i]=l,l}function Is(t,e){return t&&e!==null&&Jc.has(e)}function id(t){let e=Tn(t);return e!==null&&Yc.has(e)}function rd(t){if(t.length<2||t[0]!==" ")return null;let e=t.slice(1);return/^\\p{M}+$/u.test(e)?{space:" ",marks:e}:null}function _n(t){let e=t.length;for(;e>0;){let n=Gs(t,e),i=t.slice(n,e);if(Xc.has(i))return!0;if(!Qe.has(i))return!1;e=n}return!1}function od(t,e){if(e.preserveOrdinarySpaces||e.preserveHardBreaks){if(t===" ")return"preserved-space";if(t===" ")return"tab";if(e.preserveHardBreaks&&t===`\n`)return"hard-break"}return t===" "?"space":t==="\\xA0"||t==="\\u202F"||t==="\\u2060"||t==="\\uFEFF"?"glue":t==="\\u200B"?"zero-width-break":t==="\\xAD"?"soft-hyphen":"text"}var sd=/[\\x20\\t\\n\\xA0\\xAD\\u200B\\u202F\\u2060\\uFEFF]/;function Le(t){return t.length===1?t[0]:t.join("")}function ad(t,e){let n=[];for(let i=t.length-1;i>=0;i--)n.push(t[i]);return n.push(e),Le(n)}function ld(t,e,n,i){if(!sd.test(t))return[{text:t,isWordLike:e,kind:"text",start:n}];let r=[],o=null,s=[],l=n,a=!1,c=0;for(let u of t){let m=od(u,i),f=m==="text"&&e;if(o!==null&&m===o&&f===a){s.push(u),c+=u.length;continue}o!==null&&r.push({text:Le(s),isWordLike:a,kind:o,start:l}),o=m,s=[u],l=n+c,a=f,c+=u.length}return o!==null&&r.push({text:Le(s),isWordLike:a,kind:o,start:l}),r}function Di(t){return t==="space"||t==="preserved-space"||t==="zero-width-break"||t==="hard-break"}var ud=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function cd(t,e){let n=t.texts[e];return n.startsWith("www.")?!0:ud.test(n)&&e+1<t.len&&t.kinds[e+1]==="text"&&t.texts[e+1]==="//"}function dd(t){return t.includes("?")&&(t.includes("://")||t.startsWith("www."))}function fd(t){let e=t.texts.slice(),n=t.isWordLike.slice(),i=t.kinds.slice(),r=t.starts.slice();for(let s=0;s<t.len;s++){if(i[s]!=="text"||!cd(t,s))continue;let l=[e[s]],a=s+1;for(;a<t.len&&!Di(i[a]);){l.push(e[a]),n[s]=!0;let c=e[a].includes("?");if(i[a]="text",e[a]="",a++,c)break}e[s]=Le(l)}let o=0;for(let s=0;s<e.length;s++){let l=e[s];l.length!==0&&(o!==s&&(e[o]=l,n[o]=n[s],i[o]=i[s],r[o]=r[s]),o++)}return e.length=o,n.length=o,i.length=o,r.length=o,{len:o,texts:e,isWordLike:n,kinds:i,starts:r}}function md(t){let e=[],n=[],i=[],r=[];for(let o=0;o<t.len;o++){let s=t.texts[o];if(e.push(s),n.push(t.isWordLike[o]),i.push(t.kinds[o]),r.push(t.starts[o]),!dd(s))continue;let l=o+1;if(l>=t.len||Di(t.kinds[l]))continue;let a=[],c=t.starts[l],u=l;for(;u<t.len&&!Di(t.kinds[u]);)a.push(t.texts[u]),u++;a.length>0&&(e.push(Le(a)),n.push(!0),i.push("text"),r.push(c),o=u-1)}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}var pd=new Set([":","-","/","\\xD7",",",".","+","\\u2013","\\u2014"]),Ps=/^[A-Za-z0-9_]+[,:;]*$/,Os=/[,:;]+$/;function Ws(t){for(let e of t)if(Hs.test(e))return!0;return!1}function Qt(t){if(t.length===0)return!1;for(let e of t)if(!(Hs.test(e)||pd.has(e)))return!1;return!0}function hd(t){let e=[],n=[],i=[],r=[];for(let o=0;o<t.len;o++){let s=t.texts[o],l=t.kinds[o];if(l==="text"&&Qt(s)&&Ws(s)){let a=[s],c=o+1;for(;c<t.len&&t.kinds[c]==="text"&&Qt(t.texts[c]);)a.push(t.texts[c]),c++;e.push(Le(a)),n.push(!0),i.push("text"),r.push(t.starts[o]),o=c-1;continue}e.push(s),n.push(t.isWordLike[o]),i.push(l),r.push(t.starts[o])}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function xd(t){let e=[],n=[],i=[],r=[];for(let o=0;o<t.len;o++){let s=t.texts[o],l=t.kinds[o],a=t.isWordLike[o];if(l==="text"&&a&&Ps.test(s)){let c=[s],u=Os.test(s),m=o+1;for(;u&&m<t.len&&t.kinds[m]==="text"&&t.isWordLike[m]&&Ps.test(t.texts[m]);){let f=t.texts[m];c.push(f),u=Os.test(f),m++}e.push(Le(c)),n.push(!0),i.push("text"),r.push(t.starts[o]),o=m-1;continue}e.push(s),n.push(a),i.push(l),r.push(t.starts[o])}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function gd(t){let e=[],n=[],i=[],r=[];for(let o=0;o<t.len;o++){let s=t.texts[o];if(t.kinds[o]==="text"&&s.includes("-")){let l=s.split("-"),a=l.length>1;for(let c=0;c<l.length;c++){let u=l[c];if(!a)break;(u.length===0||!Ws(u)||!Qt(u))&&(a=!1)}if(a){let c=0;for(let u=0;u<l.length;u++){let m=l[u],f=u<l.length-1?`${m}-`:m;e.push(f),n.push(!0),i.push("text"),r.push(t.starts[o]+c),c+=f.length}continue}}e.push(s),n.push(t.isWordLike[o]),i.push(t.kinds[o]),r.push(t.starts[o])}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function yd(t){let e=[],n=[],i=[],r=[],o=0;for(;o<t.len;){let s=[t.texts[o]],l=t.isWordLike[o],a=t.kinds[o],c=t.starts[o];if(a==="glue"){let u=[s[0]],m=c;for(o++;o<t.len&&t.kinds[o]==="glue";)u.push(t.texts[o]),o++;let f=Le(u);if(o<t.len&&t.kinds[o]==="text")s[0]=f,s.push(t.texts[o]),l=t.isWordLike[o],a="text",c=m,o++;else{e.push(f),n.push(!1),i.push("glue"),r.push(m);continue}}else o++;if(a==="text")for(;o<t.len&&t.kinds[o]==="glue";){let u=[];for(;o<t.len&&t.kinds[o]==="glue";)u.push(t.texts[o]),o++;let m=Le(u);if(o<t.len&&t.kinds[o]==="text"){s.push(m,t.texts[o]),l=l||t.isWordLike[o],o++;continue}s.push(m)}e.push(Le(s)),n.push(l),i.push(a),r.push(c)}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function bd(t){let e=t.texts.slice(),n=t.isWordLike.slice(),i=t.kinds.slice(),r=t.starts.slice();for(let o=0;o<e.length-1;o++){if(i[o]!=="text"||i[o+1]!=="text"||!De(e[o])||!De(e[o+1]))continue;let s=td(e[o]);s!==null&&(e[o]=s.head,e[o+1]=s.tail+e[o+1],r[o+1]=r[o]+s.head.length)}return{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function Bs(t,e,n){let i=Vc(),r=0,o=[],s=[],l=[],a=[],c=[],u=[],m=[],f=[],x=[],w=[],g=[],b=[];for(let N of i.segment(t))for(let y of ld(N.segment,N.isWordLike??!1,N.index,n)){let U=function(){u[R]!==null&&(s[R]=[Ds(o,u,m,R)],u[R]=null),s[R].push(y.text),l[R]=l[R]||y.isWordLike,f[R]=f[R]||M,x[R]=x[R]||k,w[R]=z,g[R]=ee,b[R]=Is(x[R],G)},A=y.kind==="text",C=nd(y.text,y.isWordLike,y.kind),M=De(y.text),k=ks(y.text),G=Tn(y.text),z=_n(y.text),ee=id(y.text),R=r-1;e.carryCJKAfterClosingQuote&&A&&r>0&&a[R]==="text"&&M&&f[R]&&w[R]||A&&r>0&&a[R]==="text"&&Zc(y.text)&&f[R]||A&&r>0&&a[R]==="text"&&g[R]?U():A&&r>0&&a[R]==="text"&&y.isWordLike&&k&&b[R]?(U(),l[R]=!0):C!==null&&r>0&&a[R]==="text"&&u[R]===C?m[R]=(m[R]??1)+1:A&&!y.isWordLike&&r>0&&a[R]==="text"&&(Qc(y.text)||y.text==="-"&&l[R])?U():(o[r]=y.text,s[r]=[y.text],l[r]=y.isWordLike,a[r]=y.kind,c[r]=y.start,u[r]=C,m[r]=C===null?0:1,f[r]=M,x[r]=k,w[r]=z,g[r]=ee,b[r]=Is(k,G),r++)}for(let N=0;N<r;N++){if(u[N]!==null){o[N]=Ds(o,u,m,N);continue}o[N]=Le(s[N])}for(let N=1;N<r;N++)a[N]==="text"&&!l[N]&&Pi(o[N])&&a[N-1]==="text"&&(o[N-1]+=o[N],l[N-1]=l[N-1]||l[N],o[N]="");let F=Array.from({length:r},()=>null),_=-1;for(let N=r-1;N>=0;N--){let y=o[N];if(y.length!==0){if(a[N]==="text"&&!l[N]&&ed(y)&&_>=0&&a[_]==="text"){let A=F[_]??[];A.push(y),F[_]=A,c[_]=c[N],o[N]="";continue}_=N}}for(let N=0;N<r;N++){let y=F[N];y!=null&&(o[N]=ad(y,o[N]))}let L=0;for(let N=0;N<r;N++){let y=o[N];y.length!==0&&(L!==N&&(o[L]=y,l[L]=l[N],a[L]=a[N],c[L]=c[N]),L++)}o.length=L,l.length=L,a.length=L,c.length=L;let Q=yd({len:L,texts:o,isWordLike:l,kinds:a,starts:c}),H=bd(xd(gd(hd(md(fd(Q))))));for(let N=0;N<H.len-1;N++){let y=rd(H.texts[N]);y!==null&&(H.kinds[N]!=="space"&&H.kinds[N]!=="preserved-space"||H.kinds[N+1]!=="text"||!ks(H.texts[N+1])||(H.texts[N]=y.space,H.isWordLike[N]=!1,H.kinds[N]=H.kinds[N]==="preserved-space"?"preserved-space":"space",H.texts[N+1]=y.marks+H.texts[N+1],H.starts[N+1]=H.starts[N]+y.space.length))}return H}function Sd(t,e){if(t.len===0)return[];if(!e.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:t.len,consumedEndSegmentIndex:t.len}];let n=[],i=0;for(let r=0;r<t.len;r++)t.kinds[r]==="hard-break"&&(n.push({startSegmentIndex:i,endSegmentIndex:r,consumedEndSegmentIndex:r+1}),i=r+1);return i<t.len&&n.push({startSegmentIndex:i,endSegmentIndex:t.len,consumedEndSegmentIndex:t.len}),n}function Ad(t){if(t.len<=1)return t;let e=[],n=[],i=[],r=[],o=null,s=!1,l=0,a=!1,c=!1;function u(){o!==null&&(e.push(Le(o)),n.push(s),i.push("text"),r.push(l),o=null)}for(let m=0;m<t.len;m++){let f=t.texts[m],x=t.kinds[m],w=t.isWordLike[m],g=t.starts[m];if(x==="text"){let b=$c(f),F=Mn(f);if(o!==null&&a&&c){o.push(f),s=s||w,a=a||b,c=F;continue}u(),o=[f],s=w,l=g,a=b,c=F;continue}u(),e.push(f),n.push(w),i.push(x),r.push(g)}return u(),{len:e.length,texts:e,isWordLike:n,kinds:i,starts:r}}function Us(t,e,n="normal",i="normal"){let r=Hc(n),o=r.mode==="pre-wrap"?Wc(t):Gc(t);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let s=i==="keep-all"?Ad(Bs(o,e,r)):Bs(o,e,r);return{normalized:o,chunks:Sd(s,r),...s}}var ht=null,Vs=new Map,xt=null,Ed=96,wd=/\\p{Emoji_Presentation}/u,Cd=/[\\p{Emoji_Presentation}\\p{Extended_Pictographic}\\p{Regional_Indicator}\\uFE0F\\u20E3]/u,Oi=null,zs=new Map;function Bi(){if(ht!==null)return ht;if(typeof OffscreenCanvas<"u")return ht=new OffscreenCanvas(1,1).getContext("2d"),ht;if(typeof document<"u")return ht=document.createElement("canvas").getContext("2d"),ht;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Fd(t){let e=Vs.get(t);return e||(e=new Map,Vs.set(t,e)),e}function Ue(t,e){let n=e.get(t);return n===void 0&&(n={width:Bi().measureText(t).width,containsCJK:De(t)},e.set(t,n)),n}function gt(){if(xt!==null)return xt;if(typeof navigator>"u")return xt={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},xt;let t=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&t.includes("Safari/")&&!t.includes("Chrome/")&&!t.includes("Chromium/")&&!t.includes("CriOS/")&&!t.includes("FxiOS/")&&!t.includes("EdgiOS/"),i=t.includes("Chrome/")||t.includes("Chromium/")||t.includes("CriOS/")||t.includes("Edg/");return xt={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:i,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},xt}function Md(t){let e=t.match(/(\\d+(?:\\.\\d+)?)\\s*px/);return e?parseFloat(e[1]):16}function js(){return Oi===null&&(Oi=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Oi}function Nd(t){return wd.test(t)||t.includes("\\uFE0F")}function qs(t){return Cd.test(t)}function Td(t,e){let n=zs.get(t);if(n!==void 0)return n;let i=Bi();i.font=t;let r=i.measureText("\\u{1F600}").width;if(n=0,r>e+.5&&typeof document<"u"&&document.body!==null){let o=document.createElement("span");o.style.font=t,o.style.display="inline-block",o.style.visibility="hidden",o.style.position="absolute",o.textContent="\\u{1F600}",document.body.appendChild(o);let s=o.getBoundingClientRect().width;document.body.removeChild(o),r-s>.5&&(n=r-s)}return zs.set(t,n),n}function _d(t){let e=0,n=js();for(let i of n.segment(t))Nd(i.segment)&&e++;return e}function Ld(t,e){return e.emojiCount===void 0&&(e.emojiCount=_d(t)),e.emojiCount}function Ze(t,e,n){return n===0?e.width:e.width-Ld(t,e)*n}function $s(t,e,n,i,r){if(e.breakableFitAdvances!==void 0)return e.breakableFitAdvances;let o=js(),s=[];for(let u of o.segment(t))s.push(u.segment);if(s.length<=1)return e.breakableFitAdvances=null,e.breakableFitAdvances;if(r==="sum-graphemes"){let u=[];for(let m of s){let f=Ue(m,n);u.push(Ze(m,f,i))}return e.breakableFitAdvances=u,e.breakableFitAdvances}if(r==="pair-context"||s.length>Ed){let u=[],m=null,f=0;for(let x of s){let w=Ue(x,n),g=Ze(x,w,i);if(m===null)u.push(g);else{let b=m+x,F=Ue(b,n);u.push(Ze(b,F,i)-f)}m=x,f=g}return e.breakableFitAdvances=u,e.breakableFitAdvances}let l=[],a="",c=0;for(let u of s){a+=u;let m=Ue(a,n),f=Ze(a,m,i);l.push(f-c),c=f}return e.breakableFitAdvances=l,e.breakableFitAdvances}function Ks(t,e){let n=Bi();n.font=t;let i=Fd(t),r=Md(t),o=e?Td(t,r):0;return{cache:i,fontSize:r,emojiCorrection:o}}function vd(t,e){for(;e<t.widths.length;){let n=t.kinds[e];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;e++}return e}function kd(t,e){if(e<=0)return 0;let n=t%e;return Math.abs(n)<=1e-6?e:e-n}function Rd(t,e,n,i,r){let o=0,s=e;for(;o<t.length;){let l=s+t[o];if((o+1<t.length?l+r:l)>n+i)break;s=l,o++}return{fitCount:o,fittedWidth:s}}function Js(t,e){return t.simpleLineWalkFastPath?Ys(t,e):Xs(t,e)}function Ys(t,e,n){let{widths:i,kinds:r,breakableFitAdvances:o}=t;if(i.length===0)return 0;let l=gt().lineFitEpsilon,a=e+l,c=0,u=0,m=!1,f=0,x=0,w=0,g=0,b=-1,F=0;function _(){b=-1,F=0}function L(C=w,M=g,k=u){c++,n?.({startSegmentIndex:f,startGraphemeIndex:x,endSegmentIndex:C,endGraphemeIndex:M,width:k}),u=0,m=!1,_()}function Q(C,M){m=!0,f=C,x=0,w=C+1,g=0,u=M}function H(C,M,k){m=!0,f=C,x=M,w=C,g=M+1,u=k}function N(C,M){if(!m){Q(C,M);return}u+=M,w=C+1,g=0}function y(C,M){let k=o[C];for(let G=M;G<k.length;G++){let z=k[G];m?u+z>a?(L(),H(C,G,z)):(u+=z,w=C,g=G+1):H(C,G,z)}m&&w===C&&g===k.length&&(w=C+1,g=0)}let A=0;for(;A<i.length&&!(!m&&(A=vd(t,A),A>=i.length));){let C=i[A],M=r[A],k=M==="space"||M==="preserved-space"||M==="tab"||M==="zero-width-break"||M==="soft-hyphen";if(!m){C>e&&o[A]!==null?y(A,0):Q(A,C),k&&(b=A+1,F=u-C),A++;continue}if(u+C>a){if(k){N(A,C),L(A+1,0,u-C),A++;continue}if(b>=0){if(w>b||w===b&&g>0){L();continue}L(b,0,F);continue}if(C>e&&o[A]!==null){L(),y(A,0),A++;continue}L();continue}N(A,C),k&&(b=A+1,F=u-C),A++}return m&&L(),c}function Xs(t,e,n){if(t.simpleLineWalkFastPath)return Ys(t,e,n);let{widths:i,lineEndFitAdvances:r,lineEndPaintAdvances:o,kinds:s,breakableFitAdvances:l,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:u}=t;if(i.length===0||u.length===0)return 0;let m=gt(),f=m.lineFitEpsilon,x=e+f,w=0,g=0,b=!1,F=0,_=0,L=0,Q=0,H=-1,N=0,y=0,A=null;function C(){H=-1,N=0,y=0,A=null}function M(V=L,te=Q,W=g){w++,n?.({startSegmentIndex:F,startGraphemeIndex:_,endSegmentIndex:V,endGraphemeIndex:te,width:W}),g=0,b=!1,C()}function k(V,te){b=!0,F=V,_=0,L=V+1,Q=0,g=te}function G(V,te,W){b=!0,F=V,_=te,L=V,Q=te+1,g=W}function z(V,te){if(!b){k(V,te);return}g+=te,L=V+1,Q=0}function ee(V,te,W,ie){if(!te)return;let he=V==="tab"?0:r[W],P=V==="tab"?ie:o[W];H=W+1,N=g-ie+he,y=g-ie+P,A=V}function R(V,te){let W=l[V];for(let ie=te;ie<W.length;ie++){let he=W[ie];b?g+he>x?(M(),G(V,ie,he)):(g+=he,L=V,Q=ie+1):G(V,ie,he)}b&&L===V&&Q===W.length&&(L=V+1,Q=0)}function U(V){if(A!=="soft-hyphen")return!1;let te=l[V];if(te==null)return!1;let{fitCount:W,fittedWidth:ie}=Rd(te,g,e,f,a);return W===0?!1:(g=ie,L=V,Q=W,C(),W===te.length?(L=V+1,Q=0,!0):(M(V,W,ie+a),R(V,W),!0))}function Ne(V){w++,n?.({startSegmentIndex:V.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:V.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),C()}for(let V=0;V<u.length;V++){let te=u[V];if(te.startSegmentIndex===te.endSegmentIndex){Ne(te);continue}b=!1,g=0,F=te.startSegmentIndex,_=0,L=te.startSegmentIndex,Q=0,C();let W=te.startSegmentIndex;for(;W<te.endSegmentIndex;){let ie=s[W],he=ie==="space"||ie==="preserved-space"||ie==="tab"||ie==="zero-width-break"||ie==="soft-hyphen",P=ie==="tab"?kd(g,c):i[W];if(ie==="soft-hyphen"){b&&(L=W+1,Q=0,H=W+1,N=g+a,y=g+a,A=ie),W++;continue}if(!b){P>e&&l[W]!==null?R(W,0):k(W,P),ee(ie,he,W,P),W++;continue}if(g+P>x){let O=g+(ie==="tab"?0:r[W]),se=g+(ie==="tab"?P:o[W]);if(A==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&N<=x){M(H,0,y);continue}if(A==="soft-hyphen"&&U(W)){W++;continue}if(he&&O<=x){z(W,P),M(W+1,0,se),W++;continue}if(H>=0&&N<=x){if(L>H||L===H&&Q>0){M();continue}let re=H;M(re,0,y),W=re;continue}if(P>e&&l[W]!==null){M(),R(W,0),W++;continue}M();continue}z(W,P),ee(ie,he,W,P),W++}if(b){let ie=H===te.consumedEndSegmentIndex?y:g;M(te.consumedEndSegmentIndex,0,ie)}}return w}var Hi=null;function Dd(){return Hi===null&&(Hi=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Hi}function Id(t){return t?{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 Pd(t,e){let n=[],i=[],r=0,o=!1,s=!1,l=!1;function a(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:r}),i=[],o=!1,s=!1,l=!1)}function c(m,f,x){i=[m],r=f,o=x,s=_n(m),l=Zt.has(m)}function u(m,f){i.push(m),o=o||f;let x=_n(m);m.length===1&&Qe.has(m)?s=s||x:s=x,l=!1}for(let m of Dd().segment(t)){let f=m.segment,x=De(f);if(i.length===0){c(f,m.index,x);continue}if(l||Nn.has(f)||Qe.has(f)||e.carryCJKAfterClosingQuote&&x&&s){u(f,x);continue}if(!o&&!x){u(f,x);continue}a(),c(f,m.index,x)}return a(),n}function Od(t){if(t.length<=1)return t;let e=[],n=[t[0].text],i=t[0].start,r=De(t[0].text),o=Mn(t[0].text);function s(){e.push({text:n.length===1?n[0]:n.join(""),start:i})}for(let l=1;l<t.length;l++){let a=t[l],c=De(a.text),u=Mn(a.text);if(r&&o){n.push(a.text),r=r||c,o=u;continue}s(),n=[a.text],i=a.start,r=c,o=u}return s(),e}function Bd(t,e,n,i){let r=gt(),{cache:o,emojiCorrection:s}=Ks(e,qs(t.normalized)),l=Ze("-",Ue("-",o),s),c=Ze(" ",Ue(" ",o),s)*8;if(t.len===0)return Id(n);let u=[],m=[],f=[],x=[],w=t.chunks.length<=1,g=n?[]:null,b=[],F=n?[]:null,_=Array.from({length:t.len});function L(y,A,C,M,k,G,z){k!=="text"&&k!=="space"&&k!=="zero-width-break"&&(w=!1),u.push(A),m.push(C),f.push(M),x.push(k),g?.push(G),b.push(z),F!==null&&F.push(y)}function Q(y,A,C,M,k){let G=Ue(y,o),z=Ze(y,G,s),ee=A==="space"||A==="preserved-space"||A==="zero-width-break"?0:z,R=A==="space"||A==="zero-width-break"?0:z;if(k&&M&&y.length>1){let U="sum-graphemes";Qt(y)?U="pair-context":r.preferPrefixWidthsForBreakableRuns&&(U="segment-prefixes");let Ne=$s(y,G,o,s,U);L(y,z,ee,R,A,C,Ne);return}L(y,z,ee,R,A,C,null)}for(let y=0;y<t.len;y++){_[y]=u.length;let A=t.texts[y],C=t.isWordLike[y],M=t.kinds[y],k=t.starts[y];if(M==="soft-hyphen"){L(A,0,l,l,M,k,null);continue}if(M==="hard-break"){L(A,0,0,0,M,k,null);continue}if(M==="tab"){L(A,0,0,0,M,k,null);continue}let G=Ue(A,o);if(M==="text"&&G.containsCJK){let z=Pd(A,r),ee=i==="keep-all"?Od(z):z;for(let R=0;R<ee.length;R++){let U=ee[R];Q(U.text,"text",k+U.start,C,i==="keep-all"||!De(U.text))}continue}Q(A,M,k,C,!0)}let H=Hd(t.chunks,_,u.length),N=g===null?null:vs(t.normalized,g);return F!==null?{widths:u,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:w,segLevels:N,breakableFitAdvances:b,discretionaryHyphenWidth:l,tabStopAdvance:c,chunks:H,segments:F}:{widths:u,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:w,segLevels:N,breakableFitAdvances:b,discretionaryHyphenWidth:l,tabStopAdvance:c,chunks:H}}function Hd(t,e,n){let i=[];for(let r=0;r<t.length;r++){let o=t[r],s=o.startSegmentIndex<e.length?e[o.startSegmentIndex]:n,l=o.endSegmentIndex<e.length?e[o.endSegmentIndex]:n,a=o.consumedEndSegmentIndex<e.length?e[o.consumedEndSegmentIndex]:n;i.push({startSegmentIndex:s,endSegmentIndex:l,consumedEndSegmentIndex:a})}return i}function Gd(t,e,n,i){let r=i?.wordBreak??"normal",o=Us(t,gt(),i?.whiteSpace,r);return Bd(o,e,n,r)}function Qs(t,e,n){return Gd(t,e,!1,n)}function Zs(t,e,n){let i=Js(t,e);return{lineCount:i,height:i*n}}var Wd={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function ea(t,e){let n={...Wd,...e},i=1.2;for(let r=n.baseFontSize;r>=n.minFontSize;r-=n.step){let o=`${n.fontWeight} ${r}px ${n.fontFamily}`,s=Qs(t,o),{lineCount:l}=Zs(s,n.maxWidth,r*i);if(l<=1)return{fontSize:r,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}window.__timelines=window.__timelines||{};window.__hyperframes={fitTextFontSize:ea,getVariables:is};function ta(){let t=window;t.__hyperframeRuntimeBootstrapped||(t.__hyperframeRuntimeBootstrapped=!0,_s())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ta,{once:!0}):ta();})();\n';
|
|
28550
28565
|
}
|
|
28551
28566
|
});
|
|
28552
28567
|
|
|
@@ -32025,6 +32040,7 @@ __export(src_exports, {
|
|
|
32025
32040
|
parseHtml: () => parseHtml,
|
|
32026
32041
|
parseSlideshowManifest: () => parseSlideshowManifest,
|
|
32027
32042
|
quantizeTimeToFrame: () => quantizeTimeToFrame,
|
|
32043
|
+
queryByAttr: () => queryByAttr,
|
|
32028
32044
|
redactTelemetryString: () => redactTelemetryString,
|
|
32029
32045
|
removeElementFromHtml: () => removeElementFromHtml,
|
|
32030
32046
|
resolveHfColorGradingVariables: () => resolveHfColorGradingVariables,
|
|
@@ -32058,6 +32074,7 @@ var init_src = __esm({
|
|
|
32058
32074
|
init_hyperframeLinter();
|
|
32059
32075
|
init_rewriteSubCompPaths();
|
|
32060
32076
|
init_assetPaths();
|
|
32077
|
+
init_cssSelector();
|
|
32061
32078
|
init_urlPath();
|
|
32062
32079
|
init_gif();
|
|
32063
32080
|
init_colorGrading();
|
|
@@ -32365,6 +32382,25 @@ var init_systemMemory = __esm({
|
|
|
32365
32382
|
}
|
|
32366
32383
|
});
|
|
32367
32384
|
|
|
32385
|
+
// ../engine/src/services/vp9Options.ts
|
|
32386
|
+
function normalizeVp9CpuUsed(value) {
|
|
32387
|
+
if (value === void 0 || !Number.isFinite(value)) return DEFAULT_VP9_CPU_USED;
|
|
32388
|
+
const integer = Math.trunc(value);
|
|
32389
|
+
return Math.max(MIN_VP9_CPU_USED, Math.min(MAX_VP9_CPU_USED, integer));
|
|
32390
|
+
}
|
|
32391
|
+
function appendVp9CpuUsedArg(args, value) {
|
|
32392
|
+
args.push("-cpu-used", String(normalizeVp9CpuUsed(value)));
|
|
32393
|
+
}
|
|
32394
|
+
var DEFAULT_VP9_CPU_USED, MIN_VP9_CPU_USED, MAX_VP9_CPU_USED;
|
|
32395
|
+
var init_vp9Options = __esm({
|
|
32396
|
+
"../engine/src/services/vp9Options.ts"() {
|
|
32397
|
+
"use strict";
|
|
32398
|
+
DEFAULT_VP9_CPU_USED = 4;
|
|
32399
|
+
MIN_VP9_CPU_USED = -8;
|
|
32400
|
+
MAX_VP9_CPU_USED = 8;
|
|
32401
|
+
}
|
|
32402
|
+
});
|
|
32403
|
+
|
|
32368
32404
|
// ../engine/src/config.ts
|
|
32369
32405
|
function memoryAdaptiveCacheLimit() {
|
|
32370
32406
|
const total = getSystemTotalMb();
|
|
@@ -32391,6 +32427,11 @@ function resolveConfig(overrides) {
|
|
|
32391
32427
|
if (raw === void 0) return fallback;
|
|
32392
32428
|
return raw === "true";
|
|
32393
32429
|
};
|
|
32430
|
+
const envVp9CpuUsed = () => {
|
|
32431
|
+
const raw = env("PRODUCER_VP9_CPU_USED");
|
|
32432
|
+
if (raw === void 0 || raw === "") return DEFAULT_CONFIG2.vp9CpuUsed;
|
|
32433
|
+
return normalizeVp9CpuUsed(Number(raw));
|
|
32434
|
+
};
|
|
32394
32435
|
const envBrowserGpuMode = () => {
|
|
32395
32436
|
const raw = env("PRODUCER_BROWSER_GPU_MODE");
|
|
32396
32437
|
if (raw === "hardware" || raw === "software" || raw === "auto") return raw;
|
|
@@ -32431,6 +32472,7 @@ function resolveConfig(overrides) {
|
|
|
32431
32472
|
"HF_PAGE_SIDE_COMPOSITING",
|
|
32432
32473
|
DEFAULT_CONFIG2.enablePageSideCompositing
|
|
32433
32474
|
),
|
|
32475
|
+
vp9CpuUsed: envVp9CpuUsed(),
|
|
32434
32476
|
enableChunkedEncode: envBool(
|
|
32435
32477
|
"PRODUCER_ENABLE_CHUNKED_ENCODE",
|
|
32436
32478
|
DEFAULT_CONFIG2.enableChunkedEncode
|
|
@@ -32488,17 +32530,22 @@ function resolveConfig(overrides) {
|
|
|
32488
32530
|
extractCacheDir: env("HYPERFRAMES_EXTRACT_CACHE_DIR")
|
|
32489
32531
|
};
|
|
32490
32532
|
const cleanEnv = Object.fromEntries(Object.entries(fromEnv).filter(([, v2]) => v2 !== void 0));
|
|
32491
|
-
|
|
32533
|
+
const merged = {
|
|
32492
32534
|
...DEFAULT_CONFIG2,
|
|
32493
32535
|
...cleanEnv,
|
|
32494
32536
|
...overrides
|
|
32495
32537
|
};
|
|
32538
|
+
return {
|
|
32539
|
+
...merged,
|
|
32540
|
+
vp9CpuUsed: normalizeVp9CpuUsed(merged.vp9CpuUsed)
|
|
32541
|
+
};
|
|
32496
32542
|
}
|
|
32497
32543
|
var DEFAULT_CONFIG2;
|
|
32498
32544
|
var init_config2 = __esm({
|
|
32499
32545
|
"../engine/src/config.ts"() {
|
|
32500
32546
|
"use strict";
|
|
32501
32547
|
init_systemMemory();
|
|
32548
|
+
init_vp9Options();
|
|
32502
32549
|
DEFAULT_CONFIG2 = {
|
|
32503
32550
|
fps: 30,
|
|
32504
32551
|
quality: "standard",
|
|
@@ -32519,6 +32566,7 @@ var init_config2 = __esm({
|
|
|
32519
32566
|
// DEFAULT_CONFIG (used directly by tests and worker-sizing fallbacks).
|
|
32520
32567
|
lowMemoryMode: false,
|
|
32521
32568
|
enablePageSideCompositing: true,
|
|
32569
|
+
vp9CpuUsed: DEFAULT_VP9_CPU_USED,
|
|
32522
32570
|
enableChunkedEncode: false,
|
|
32523
32571
|
chunkSizeFrames: 360,
|
|
32524
32572
|
enableStreamingEncode: true,
|
|
@@ -34820,15 +34868,322 @@ var init_runFfmpeg = __esm({
|
|
|
34820
34868
|
}
|
|
34821
34869
|
});
|
|
34822
34870
|
|
|
34823
|
-
// ../engine/src/
|
|
34871
|
+
// ../engine/src/utils/ffprobe.ts
|
|
34824
34872
|
import { spawn as spawn3 } from "child_process";
|
|
34873
|
+
import { readFileSync as readFileSync3 } from "fs";
|
|
34874
|
+
import { extname } from "path";
|
|
34875
|
+
function runFfprobe(args) {
|
|
34876
|
+
return new Promise((resolve58, reject) => {
|
|
34877
|
+
const command2 = getFfprobeBinary();
|
|
34878
|
+
const proc = spawn3(command2, args);
|
|
34879
|
+
let stdout2 = "";
|
|
34880
|
+
let stderr = "";
|
|
34881
|
+
proc.stdout.on("data", (data2) => {
|
|
34882
|
+
stdout2 += data2.toString();
|
|
34883
|
+
});
|
|
34884
|
+
proc.stderr.on("data", (data2) => {
|
|
34885
|
+
stderr += data2.toString();
|
|
34886
|
+
});
|
|
34887
|
+
proc.on("close", (code) => {
|
|
34888
|
+
if (code !== 0) {
|
|
34889
|
+
reject(new Error(`[FFmpeg] ffprobe exited with code ${code}: ${stderr}`));
|
|
34890
|
+
} else {
|
|
34891
|
+
resolve58(stdout2);
|
|
34892
|
+
}
|
|
34893
|
+
});
|
|
34894
|
+
proc.on("error", (err) => {
|
|
34895
|
+
if (err.code === "ENOENT") {
|
|
34896
|
+
const configured = process.env[FFPROBE_PATH_ENV]?.trim();
|
|
34897
|
+
reject(
|
|
34898
|
+
new Error(
|
|
34899
|
+
configured ? `[FFmpeg] ffprobe not found at ${FFPROBE_PATH_ENV}="${configured}". Please install FFmpeg.` : "[FFmpeg] ffprobe not found. Please install FFmpeg."
|
|
34900
|
+
)
|
|
34901
|
+
);
|
|
34902
|
+
} else {
|
|
34903
|
+
reject(err);
|
|
34904
|
+
}
|
|
34905
|
+
});
|
|
34906
|
+
});
|
|
34907
|
+
}
|
|
34908
|
+
function parseProbeJson(stdout2) {
|
|
34909
|
+
try {
|
|
34910
|
+
return JSON.parse(stdout2);
|
|
34911
|
+
} catch (e3) {
|
|
34912
|
+
throw new Error(
|
|
34913
|
+
`[FFmpeg] Failed to parse ffprobe output: ${e3 instanceof Error ? e3.message : e3}`
|
|
34914
|
+
);
|
|
34915
|
+
}
|
|
34916
|
+
}
|
|
34917
|
+
function crc32(buf) {
|
|
34918
|
+
let crc = 4294967295;
|
|
34919
|
+
for (let i2 = 0; i2 < buf.length; i2++) {
|
|
34920
|
+
crc ^= buf[i2] ?? 0;
|
|
34921
|
+
for (let bit = 0; bit < 8; bit++) {
|
|
34922
|
+
const mask = -(crc & 1);
|
|
34923
|
+
crc = crc >>> 1 ^ 3988292384 & mask;
|
|
34924
|
+
}
|
|
34925
|
+
}
|
|
34926
|
+
return (crc ^ 4294967295) >>> 0;
|
|
34927
|
+
}
|
|
34928
|
+
function extractPngMetadataFromBuffer(buf) {
|
|
34929
|
+
if (buf.length < 8 || buf[0] !== 137 || buf[1] !== 80 || buf[2] !== 78 || buf[3] !== 71 || buf[4] !== 13 || buf[5] !== 10 || buf[6] !== 26 || buf[7] !== 10) {
|
|
34930
|
+
return null;
|
|
34931
|
+
}
|
|
34932
|
+
let width = 0;
|
|
34933
|
+
let height = 0;
|
|
34934
|
+
let seenIdat = false;
|
|
34935
|
+
let pos = 8;
|
|
34936
|
+
while (pos + 12 <= buf.length) {
|
|
34937
|
+
const chunkLen = buf.readUInt32BE(pos);
|
|
34938
|
+
const chunkType = buf.toString("ascii", pos + 4, pos + 8);
|
|
34939
|
+
if (pos + 12 + chunkLen > buf.length) return null;
|
|
34940
|
+
const chunkData = buf.subarray(pos + 8, pos + 8 + chunkLen);
|
|
34941
|
+
const chunkCrc = buf.readUInt32BE(pos + 8 + chunkLen);
|
|
34942
|
+
const chunkBytes = Buffer.concat([Buffer.from(chunkType, "ascii"), chunkData]);
|
|
34943
|
+
if (crc32(chunkBytes) !== chunkCrc) return null;
|
|
34944
|
+
if (chunkType === "IHDR" && chunkLen >= 8) {
|
|
34945
|
+
width = buf.readUInt32BE(pos + 8);
|
|
34946
|
+
height = buf.readUInt32BE(pos + 12);
|
|
34947
|
+
}
|
|
34948
|
+
if (chunkType === "IDAT") {
|
|
34949
|
+
seenIdat = true;
|
|
34950
|
+
}
|
|
34951
|
+
if (chunkType === "cICP" && chunkLen === 4 && !seenIdat) {
|
|
34952
|
+
const primariesCode = chunkData[0] ?? 0;
|
|
34953
|
+
const transferCode = chunkData[1] ?? 0;
|
|
34954
|
+
const matrixCode = chunkData[2] ?? 0;
|
|
34955
|
+
return {
|
|
34956
|
+
width,
|
|
34957
|
+
height,
|
|
34958
|
+
colorSpace: {
|
|
34959
|
+
colorPrimaries: primariesCode === 9 ? "bt2020" : primariesCode === 1 ? "bt709" : `unknown-${primariesCode}`,
|
|
34960
|
+
colorTransfer: transferCode === 16 ? "smpte2084" : transferCode === 18 ? "arib-std-b67" : transferCode === 1 ? "bt709" : `unknown-${transferCode}`,
|
|
34961
|
+
colorSpace: matrixCode === 9 ? "bt2020nc" : matrixCode === 0 ? "gbr" : `unknown-${matrixCode}`
|
|
34962
|
+
}
|
|
34963
|
+
};
|
|
34964
|
+
}
|
|
34965
|
+
if (chunkType === "IEND") break;
|
|
34966
|
+
pos += 12 + chunkLen;
|
|
34967
|
+
}
|
|
34968
|
+
return width > 0 && height > 0 ? { width, height, colorSpace: null } : null;
|
|
34969
|
+
}
|
|
34970
|
+
function extractStillImageMetadata(filePath) {
|
|
34971
|
+
if (extname(filePath).toLowerCase() !== ".png") return null;
|
|
34972
|
+
try {
|
|
34973
|
+
return extractPngMetadataFromBuffer(readFileSync3(filePath));
|
|
34974
|
+
} catch {
|
|
34975
|
+
return null;
|
|
34976
|
+
}
|
|
34977
|
+
}
|
|
34978
|
+
function readTagCI(tags, name) {
|
|
34979
|
+
if (!tags) return "";
|
|
34980
|
+
const target = name.toLowerCase();
|
|
34981
|
+
for (const [key2, value] of Object.entries(tags)) {
|
|
34982
|
+
if (key2.toLowerCase() === target && typeof value === "string") return value;
|
|
34983
|
+
}
|
|
34984
|
+
return "";
|
|
34985
|
+
}
|
|
34986
|
+
function parseFrameRate(frameRateStr) {
|
|
34987
|
+
if (!frameRateStr) return 0;
|
|
34988
|
+
const parts = frameRateStr.split("/");
|
|
34989
|
+
if (parts.length === 2) {
|
|
34990
|
+
const num = parseFloat(parts[0] ?? "");
|
|
34991
|
+
const den = parseFloat(parts[1] ?? "");
|
|
34992
|
+
if (den !== 0) return Math.round(num / den * 100) / 100;
|
|
34993
|
+
}
|
|
34994
|
+
return parseFloat(frameRateStr) || 0;
|
|
34995
|
+
}
|
|
34996
|
+
async function extractMediaMetadata(filePath) {
|
|
34997
|
+
const cached2 = videoMetadataCache.get(filePath);
|
|
34998
|
+
if (cached2) return cached2;
|
|
34999
|
+
const probePromise = (async () => {
|
|
35000
|
+
const stillImageMeta = extractStillImageMetadata(filePath);
|
|
35001
|
+
let output = null;
|
|
35002
|
+
try {
|
|
35003
|
+
const stdout2 = await runFfprobe([
|
|
35004
|
+
"-v",
|
|
35005
|
+
"quiet",
|
|
35006
|
+
"-print_format",
|
|
35007
|
+
"json",
|
|
35008
|
+
"-show_format",
|
|
35009
|
+
"-show_streams",
|
|
35010
|
+
filePath
|
|
35011
|
+
]);
|
|
35012
|
+
output = parseProbeJson(stdout2);
|
|
35013
|
+
} catch (error) {
|
|
35014
|
+
if (!stillImageMeta) throw error;
|
|
35015
|
+
}
|
|
35016
|
+
const videoStream = output?.streams.find((s2) => s2.codec_type === "video");
|
|
35017
|
+
if (!videoStream) {
|
|
35018
|
+
if (stillImageMeta) {
|
|
35019
|
+
return {
|
|
35020
|
+
durationSeconds: 0,
|
|
35021
|
+
videoStreamDurationSeconds: 0,
|
|
35022
|
+
width: stillImageMeta.width,
|
|
35023
|
+
height: stillImageMeta.height,
|
|
35024
|
+
fps: 0,
|
|
35025
|
+
videoCodec: "png",
|
|
35026
|
+
hasAudio: false,
|
|
35027
|
+
isVFR: false,
|
|
35028
|
+
hasAlpha: false,
|
|
35029
|
+
colorSpace: stillImageMeta.colorSpace
|
|
35030
|
+
};
|
|
35031
|
+
}
|
|
35032
|
+
throw new Error("[FFmpeg] No video stream found");
|
|
35033
|
+
}
|
|
35034
|
+
const rFps = parseFrameRate(videoStream.r_frame_rate);
|
|
35035
|
+
const avgFps = parseFrameRate(videoStream.avg_frame_rate);
|
|
35036
|
+
const fps = avgFps || rFps;
|
|
35037
|
+
const isVFR = rFps > 0 && avgFps > 0 && Math.abs(rFps - avgFps) / Math.max(rFps, avgFps) > 0.1;
|
|
35038
|
+
const colorTransfer = videoStream.color_transfer || "";
|
|
35039
|
+
const colorPrimaries = videoStream.color_primaries || "";
|
|
35040
|
+
const colorSpaceVal = videoStream.color_space || "";
|
|
35041
|
+
const ffprobeColorSpace = colorTransfer || colorPrimaries || colorSpaceVal ? { colorTransfer, colorPrimaries, colorSpace: colorSpaceVal } : null;
|
|
35042
|
+
const colorSpace = ffprobeColorSpace ?? stillImageMeta?.colorSpace ?? null;
|
|
35043
|
+
const pixelFormat = videoStream.pix_fmt || "";
|
|
35044
|
+
const alphaMode = readTagCI(videoStream.tags, "alpha_mode");
|
|
35045
|
+
const hasAlpha = /(^|[^a-z])yuva|rgba|argb|bgra|gbrap|gray[a-z0-9]*a/i.test(pixelFormat) || alphaMode === "1";
|
|
35046
|
+
const containerDuration = output?.format.duration ? parseFloat(output.format.duration) : 0;
|
|
35047
|
+
const streamDuration = videoStream.duration ? parseFloat(videoStream.duration) : 0;
|
|
35048
|
+
return {
|
|
35049
|
+
durationSeconds: containerDuration,
|
|
35050
|
+
videoStreamDurationSeconds: streamDuration > 0 ? streamDuration : containerDuration,
|
|
35051
|
+
width: videoStream.width || stillImageMeta?.width || 0,
|
|
35052
|
+
height: videoStream.height || stillImageMeta?.height || 0,
|
|
35053
|
+
fps,
|
|
35054
|
+
videoCodec: videoStream.codec_name || "unknown",
|
|
35055
|
+
hasAudio: output?.streams.some((s2) => s2.codec_type === "audio") ?? false,
|
|
35056
|
+
isVFR,
|
|
35057
|
+
hasAlpha,
|
|
35058
|
+
colorSpace
|
|
35059
|
+
};
|
|
35060
|
+
})();
|
|
35061
|
+
videoMetadataCache.set(filePath, probePromise);
|
|
35062
|
+
probePromise.catch(() => {
|
|
35063
|
+
if (videoMetadataCache.get(filePath) === probePromise) {
|
|
35064
|
+
videoMetadataCache.delete(filePath);
|
|
35065
|
+
}
|
|
35066
|
+
});
|
|
35067
|
+
return probePromise;
|
|
35068
|
+
}
|
|
35069
|
+
async function extractAudioMetadata(filePath) {
|
|
35070
|
+
const cached2 = audioMetadataCache.get(filePath);
|
|
35071
|
+
if (cached2) return cached2;
|
|
35072
|
+
const probePromise = (async () => {
|
|
35073
|
+
const stdout2 = await runFfprobe([
|
|
35074
|
+
"-v",
|
|
35075
|
+
"quiet",
|
|
35076
|
+
"-print_format",
|
|
35077
|
+
"json",
|
|
35078
|
+
"-show_format",
|
|
35079
|
+
"-show_streams",
|
|
35080
|
+
filePath
|
|
35081
|
+
]);
|
|
35082
|
+
const output = parseProbeJson(stdout2);
|
|
35083
|
+
const audioStream = output.streams.find((s2) => s2.codec_type === "audio");
|
|
35084
|
+
if (!audioStream) throw new Error("[FFmpeg] No audio stream found");
|
|
35085
|
+
const durationSeconds = output.format.duration ? parseFloat(output.format.duration) : 0;
|
|
35086
|
+
return {
|
|
35087
|
+
durationSeconds,
|
|
35088
|
+
sampleRate: audioStream.sample_rate ? parseInt(audioStream.sample_rate) : 44100,
|
|
35089
|
+
channels: audioStream.channels || 2,
|
|
35090
|
+
audioCodec: audioStream.codec_name || "unknown",
|
|
35091
|
+
bitrate: output.format.bit_rate ? parseInt(output.format.bit_rate) : void 0
|
|
35092
|
+
};
|
|
35093
|
+
})();
|
|
35094
|
+
audioMetadataCache.set(filePath, probePromise);
|
|
35095
|
+
probePromise.catch(() => {
|
|
35096
|
+
if (audioMetadataCache.get(filePath) === probePromise) {
|
|
35097
|
+
audioMetadataCache.delete(filePath);
|
|
35098
|
+
}
|
|
35099
|
+
});
|
|
35100
|
+
return probePromise;
|
|
35101
|
+
}
|
|
35102
|
+
async function analyzeKeyframeIntervals(filePath) {
|
|
35103
|
+
const cached2 = keyframeCache.get(filePath);
|
|
35104
|
+
if (cached2) return cached2;
|
|
35105
|
+
const promise = analyzeKeyframeIntervalsUncached(filePath);
|
|
35106
|
+
keyframeCache.set(filePath, promise);
|
|
35107
|
+
promise.catch(() => {
|
|
35108
|
+
if (keyframeCache.get(filePath) === promise) {
|
|
35109
|
+
keyframeCache.delete(filePath);
|
|
35110
|
+
}
|
|
35111
|
+
});
|
|
35112
|
+
return promise;
|
|
35113
|
+
}
|
|
35114
|
+
async function analyzeKeyframeIntervalsUncached(filePath) {
|
|
35115
|
+
const stdout2 = await runFfprobe([
|
|
35116
|
+
"-v",
|
|
35117
|
+
"quiet",
|
|
35118
|
+
"-select_streams",
|
|
35119
|
+
"v:0",
|
|
35120
|
+
"-skip_frame",
|
|
35121
|
+
"nokey",
|
|
35122
|
+
"-show_entries",
|
|
35123
|
+
"frame=pts_time",
|
|
35124
|
+
"-of",
|
|
35125
|
+
"csv=p=0",
|
|
35126
|
+
filePath
|
|
35127
|
+
]);
|
|
35128
|
+
const timestamps = stdout2.split("\n").map((line) => parseFloat(line.trim())).filter((t2) => Number.isFinite(t2));
|
|
35129
|
+
if (timestamps.length < 2) {
|
|
35130
|
+
return {
|
|
35131
|
+
avgIntervalSeconds: 0,
|
|
35132
|
+
maxIntervalSeconds: 0,
|
|
35133
|
+
keyframeCount: timestamps.length,
|
|
35134
|
+
isProblematic: false
|
|
35135
|
+
};
|
|
35136
|
+
}
|
|
35137
|
+
let maxInterval = 0;
|
|
35138
|
+
let totalInterval = 0;
|
|
35139
|
+
for (let i2 = 1; i2 < timestamps.length; i2++) {
|
|
35140
|
+
const interval = (timestamps[i2] ?? 0) - (timestamps[i2 - 1] ?? 0);
|
|
35141
|
+
totalInterval += interval;
|
|
35142
|
+
if (interval > maxInterval) maxInterval = interval;
|
|
35143
|
+
}
|
|
35144
|
+
const avgInterval = totalInterval / (timestamps.length - 1);
|
|
35145
|
+
return {
|
|
35146
|
+
avgIntervalSeconds: Math.round(avgInterval * 100) / 100,
|
|
35147
|
+
maxIntervalSeconds: Math.round(maxInterval * 100) / 100,
|
|
35148
|
+
keyframeCount: timestamps.length,
|
|
35149
|
+
isProblematic: maxInterval > 2
|
|
35150
|
+
};
|
|
35151
|
+
}
|
|
35152
|
+
var videoMetadataCache, audioMetadataCache, extractVideoMetadata, keyframeCache;
|
|
35153
|
+
var init_ffprobe = __esm({
|
|
35154
|
+
"../engine/src/utils/ffprobe.ts"() {
|
|
35155
|
+
"use strict";
|
|
35156
|
+
init_ffmpegBinaries();
|
|
35157
|
+
videoMetadataCache = /* @__PURE__ */ new Map();
|
|
35158
|
+
audioMetadataCache = /* @__PURE__ */ new Map();
|
|
35159
|
+
extractVideoMetadata = extractMediaMetadata;
|
|
35160
|
+
keyframeCache = /* @__PURE__ */ new Map();
|
|
35161
|
+
}
|
|
35162
|
+
});
|
|
35163
|
+
|
|
35164
|
+
// ../engine/src/services/chunkEncoder.ts
|
|
35165
|
+
import { spawn as spawn4 } from "child_process";
|
|
34825
35166
|
import { copyFileSync, existsSync as existsSync6, mkdirSync as mkdirSync3, readdirSync as readdirSync2, statSync, writeFileSync as writeFileSync3 } from "fs";
|
|
34826
|
-
import { join as join6, dirname as dirname4 } from "path";
|
|
35167
|
+
import { join as join6, dirname as dirname4, extname as extname2 } from "path";
|
|
34827
35168
|
function appendEncodeTimeoutMessage(error, timedOut, timeoutMs) {
|
|
34828
35169
|
if (!timedOut) return error;
|
|
34829
35170
|
return `${error}
|
|
34830
35171
|
FFmpeg killed after exceeding ffmpegEncodeTimeout (${timeoutMs} ms)`;
|
|
34831
35172
|
}
|
|
35173
|
+
function isAacSidecar(audioPath) {
|
|
35174
|
+
return extname2(audioPath).toLowerCase() === ".aac";
|
|
35175
|
+
}
|
|
35176
|
+
async function shouldCopyAacSidecar(audioPath, options) {
|
|
35177
|
+
if (options?.audioCodec === "aac" || isAacSidecar(audioPath)) return true;
|
|
35178
|
+
const audioExtension = extname2(audioPath).toLowerCase();
|
|
35179
|
+
if (KNOWN_NON_AAC_AUDIO_EXTENSIONS.has(audioExtension)) return false;
|
|
35180
|
+
try {
|
|
35181
|
+
const metadata = await extractAudioMetadata(audioPath);
|
|
35182
|
+
return metadata.audioCodec === "aac";
|
|
35183
|
+
} catch {
|
|
35184
|
+
return false;
|
|
35185
|
+
}
|
|
35186
|
+
}
|
|
34832
35187
|
function getEncoderPreset(quality, format = "mp4", hdr) {
|
|
34833
35188
|
const base2 = ENCODER_PRESETS[quality];
|
|
34834
35189
|
if (format === "webm") {
|
|
@@ -34866,6 +35221,7 @@ function buildEncoderArgs(options, inputArgs, outputPath, gpuEncoder = null) {
|
|
|
34866
35221
|
quality = 23,
|
|
34867
35222
|
bitrate,
|
|
34868
35223
|
pixelFormat = "yuv420p",
|
|
35224
|
+
vp9CpuUsed,
|
|
34869
35225
|
useGpu = false
|
|
34870
35226
|
} = options;
|
|
34871
35227
|
if (options.hdr && codec === "h264") {
|
|
@@ -34968,6 +35324,7 @@ function buildEncoderArgs(options, inputArgs, outputPath, gpuEncoder = null) {
|
|
|
34968
35324
|
args.push("-c:v", "libvpx-vp9", "-b:v", bitrate || "0", "-crf", String(quality));
|
|
34969
35325
|
args.push("-deadline", preset === "ultrafast" ? "realtime" : "good");
|
|
34970
35326
|
args.push("-row-mt", "1");
|
|
35327
|
+
appendVp9CpuUsedArg(args, vp9CpuUsed);
|
|
34971
35328
|
const lockGopVp9 = options.lockGopForChunkConcat === true;
|
|
34972
35329
|
if (lockGopVp9) {
|
|
34973
35330
|
if (typeof options.gopSize !== "number" || !Number.isFinite(options.gopSize) || options.gopSize <= 0) {
|
|
@@ -34976,16 +35333,7 @@ function buildEncoderArgs(options, inputArgs, outputPath, gpuEncoder = null) {
|
|
|
34976
35333
|
);
|
|
34977
35334
|
}
|
|
34978
35335
|
const gop = Math.floor(options.gopSize);
|
|
34979
|
-
args.push(
|
|
34980
|
-
"-g",
|
|
34981
|
-
String(gop),
|
|
34982
|
-
"-keyint_min",
|
|
34983
|
-
String(gop),
|
|
34984
|
-
"-auto-alt-ref",
|
|
34985
|
-
"0",
|
|
34986
|
-
"-cpu-used",
|
|
34987
|
-
"2"
|
|
34988
|
-
);
|
|
35336
|
+
args.push("-g", String(gop), "-keyint_min", String(gop), "-auto-alt-ref", "0");
|
|
34989
35337
|
}
|
|
34990
35338
|
if (pixelFormat === "yuva420p") {
|
|
34991
35339
|
if (!lockGopVp9) {
|
|
@@ -35064,7 +35412,7 @@ async function encodeFramesFromDir(framesDir, framePattern, outputPath, options,
|
|
|
35064
35412
|
const inputArgs = ["-framerate", fpsToFfmpegArg(options.fps), "-i", inputPath];
|
|
35065
35413
|
const args = buildEncoderArgs(options, inputArgs, outputPath, gpuEncoder);
|
|
35066
35414
|
return new Promise((resolve58) => {
|
|
35067
|
-
const ffmpeg =
|
|
35415
|
+
const ffmpeg = spawn4(getFfmpegBinary(), args);
|
|
35068
35416
|
trackChildProcess(ffmpeg);
|
|
35069
35417
|
let stderr = "";
|
|
35070
35418
|
const onAbort = () => {
|
|
@@ -35181,7 +35529,7 @@ async function encodeFramesChunkedConcat(framesDir, framePattern, outputPath, op
|
|
|
35181
35529
|
if (options.useGpu) gpuEncoder = await getCachedGpuEncoder();
|
|
35182
35530
|
const args = buildEncoderArgs(options, inputArgs, chunkPath, gpuEncoder);
|
|
35183
35531
|
const chunkResult = await new Promise((resolve58) => {
|
|
35184
|
-
const ffmpeg =
|
|
35532
|
+
const ffmpeg = spawn4(getFfmpegBinary(), args);
|
|
35185
35533
|
trackChildProcess(ffmpeg);
|
|
35186
35534
|
let stderr = "";
|
|
35187
35535
|
const encodeTimeout = config?.ffmpegEncodeTimeout ?? DEFAULT_CONFIG2.ffmpegEncodeTimeout;
|
|
@@ -35247,7 +35595,7 @@ async function encodeFramesChunkedConcat(framesDir, framePattern, outputPath, op
|
|
|
35247
35595
|
outputPath
|
|
35248
35596
|
];
|
|
35249
35597
|
const concatResult = await new Promise((resolve58) => {
|
|
35250
|
-
const ffmpeg =
|
|
35598
|
+
const ffmpeg = spawn4(getFfmpegBinary(), concatArgs);
|
|
35251
35599
|
trackChildProcess(ffmpeg);
|
|
35252
35600
|
let stderr = "";
|
|
35253
35601
|
const encodeTimeout = config?.ffmpegEncodeTimeout ?? DEFAULT_CONFIG2.ffmpegEncodeTimeout;
|
|
@@ -35309,13 +35657,22 @@ async function muxVideoWithAudio(videoPath, audioPath, outputPath, signal, confi
|
|
|
35309
35657
|
if (!existsSync6(outputDir)) mkdirSync3(outputDir, { recursive: true });
|
|
35310
35658
|
const isWebm = outputPath.endsWith(".webm");
|
|
35311
35659
|
const isMov = outputPath.endsWith(".mov");
|
|
35660
|
+
const shouldCopyAudio = isWebm ? false : await shouldCopyAacSidecar(audioPath, config);
|
|
35312
35661
|
const args = ["-i", videoPath, "-i", audioPath, "-c:v", "copy"];
|
|
35313
35662
|
if (isWebm) {
|
|
35314
35663
|
args.push("-c:a", "libopus", "-b:a", "128k");
|
|
35315
35664
|
} else if (isMov) {
|
|
35316
|
-
|
|
35665
|
+
if (shouldCopyAudio) {
|
|
35666
|
+
args.push("-c:a", "copy");
|
|
35667
|
+
} else {
|
|
35668
|
+
args.push("-c:a", "aac", "-b:a", "192k");
|
|
35669
|
+
}
|
|
35317
35670
|
} else {
|
|
35318
|
-
|
|
35671
|
+
if (shouldCopyAudio) {
|
|
35672
|
+
args.push("-c:a", "copy", "-movflags", "+faststart");
|
|
35673
|
+
} else {
|
|
35674
|
+
args.push("-c:a", "aac", "-b:a", "192k", "-movflags", "+faststart");
|
|
35675
|
+
}
|
|
35319
35676
|
}
|
|
35320
35677
|
args.push("-avoid_negative_ts", "make_zero");
|
|
35321
35678
|
if (fps !== void 0) {
|
|
@@ -35366,7 +35723,7 @@ async function applyFaststart(inputPath, outputPath, signal, config, fps) {
|
|
|
35366
35723
|
error: !result.success ? formatFfmpegError(result.exitCode, result.stderr) : void 0
|
|
35367
35724
|
};
|
|
35368
35725
|
}
|
|
35369
|
-
var ENCODER_PRESETS;
|
|
35726
|
+
var ENCODER_PRESETS, KNOWN_NON_AAC_AUDIO_EXTENSIONS;
|
|
35370
35727
|
var init_chunkEncoder = __esm({
|
|
35371
35728
|
"../engine/src/services/chunkEncoder.ts"() {
|
|
35372
35729
|
"use strict";
|
|
@@ -35376,18 +35733,29 @@ var init_chunkEncoder = __esm({
|
|
|
35376
35733
|
init_hdr();
|
|
35377
35734
|
init_runFfmpeg();
|
|
35378
35735
|
init_ffmpegBinaries();
|
|
35736
|
+
init_ffprobe();
|
|
35379
35737
|
init_src();
|
|
35738
|
+
init_vp9Options();
|
|
35380
35739
|
init_gpuEncoder();
|
|
35381
35740
|
ENCODER_PRESETS = {
|
|
35382
35741
|
draft: { preset: "ultrafast", quality: 28, codec: "h264" },
|
|
35383
35742
|
standard: { preset: "medium", quality: 18, codec: "h264" },
|
|
35384
35743
|
high: { preset: "slow", quality: 15, codec: "h264" }
|
|
35385
35744
|
};
|
|
35745
|
+
KNOWN_NON_AAC_AUDIO_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
35746
|
+
".flac",
|
|
35747
|
+
".mp3",
|
|
35748
|
+
".oga",
|
|
35749
|
+
".ogg",
|
|
35750
|
+
".opus",
|
|
35751
|
+
".wav",
|
|
35752
|
+
".webm"
|
|
35753
|
+
]);
|
|
35386
35754
|
}
|
|
35387
35755
|
});
|
|
35388
35756
|
|
|
35389
35757
|
// ../engine/src/services/streamingEncoder.ts
|
|
35390
|
-
import { spawn as
|
|
35758
|
+
import { spawn as spawn5 } from "child_process";
|
|
35391
35759
|
import { once } from "events";
|
|
35392
35760
|
import { existsSync as existsSync7, mkdirSync as mkdirSync4, statSync as statSync2 } from "fs";
|
|
35393
35761
|
import { dirname as dirname5 } from "path";
|
|
@@ -35436,6 +35804,7 @@ function buildStreamingArgs(options, outputPath, gpuEncoder = null) {
|
|
|
35436
35804
|
quality = 23,
|
|
35437
35805
|
bitrate,
|
|
35438
35806
|
pixelFormat = "yuv420p",
|
|
35807
|
+
vp9CpuUsed,
|
|
35439
35808
|
useGpu = false,
|
|
35440
35809
|
imageFormat = "jpeg"
|
|
35441
35810
|
} = options;
|
|
@@ -35542,6 +35911,7 @@ function buildStreamingArgs(options, outputPath, gpuEncoder = null) {
|
|
|
35542
35911
|
args.push("-c:v", "libvpx-vp9", "-b:v", bitrate || "0", "-crf", String(quality));
|
|
35543
35912
|
args.push("-deadline", preset === "ultrafast" ? "realtime" : "good");
|
|
35544
35913
|
args.push("-row-mt", "1");
|
|
35914
|
+
appendVp9CpuUsedArg(args, vp9CpuUsed);
|
|
35545
35915
|
if (pixelFormat === "yuva420p") {
|
|
35546
35916
|
args.push("-auto-alt-ref", "0");
|
|
35547
35917
|
args.push("-metadata:s:v:0", "alpha_mode=1");
|
|
@@ -35602,7 +35972,7 @@ async function spawnStreamingEncoder(outputPath, options, signal, config) {
|
|
|
35602
35972
|
}
|
|
35603
35973
|
const args = buildStreamingArgs(options, outputPath, gpuEncoder);
|
|
35604
35974
|
const startTime = Date.now();
|
|
35605
|
-
const ffmpeg =
|
|
35975
|
+
const ffmpeg = spawn5(getFfmpegBinary(), args, {
|
|
35606
35976
|
stdio: ["pipe", "pipe", "pipe"]
|
|
35607
35977
|
});
|
|
35608
35978
|
trackChildProcess(ffmpeg);
|
|
@@ -35741,306 +36111,14 @@ var init_streamingEncoder = __esm({
|
|
|
35741
36111
|
init_hdr();
|
|
35742
36112
|
init_config2();
|
|
35743
36113
|
init_src();
|
|
35744
|
-
|
|
35745
|
-
});
|
|
35746
|
-
|
|
35747
|
-
// ../engine/src/utils/ffprobe.ts
|
|
35748
|
-
import { spawn as spawn5 } from "child_process";
|
|
35749
|
-
import { readFileSync as readFileSync3 } from "fs";
|
|
35750
|
-
import { extname } from "path";
|
|
35751
|
-
function runFfprobe(args) {
|
|
35752
|
-
return new Promise((resolve58, reject) => {
|
|
35753
|
-
const command2 = getFfprobeBinary();
|
|
35754
|
-
const proc = spawn5(command2, args);
|
|
35755
|
-
let stdout2 = "";
|
|
35756
|
-
let stderr = "";
|
|
35757
|
-
proc.stdout.on("data", (data2) => {
|
|
35758
|
-
stdout2 += data2.toString();
|
|
35759
|
-
});
|
|
35760
|
-
proc.stderr.on("data", (data2) => {
|
|
35761
|
-
stderr += data2.toString();
|
|
35762
|
-
});
|
|
35763
|
-
proc.on("close", (code) => {
|
|
35764
|
-
if (code !== 0) {
|
|
35765
|
-
reject(new Error(`[FFmpeg] ffprobe exited with code ${code}: ${stderr}`));
|
|
35766
|
-
} else {
|
|
35767
|
-
resolve58(stdout2);
|
|
35768
|
-
}
|
|
35769
|
-
});
|
|
35770
|
-
proc.on("error", (err) => {
|
|
35771
|
-
if (err.code === "ENOENT") {
|
|
35772
|
-
const configured = process.env[FFPROBE_PATH_ENV]?.trim();
|
|
35773
|
-
reject(
|
|
35774
|
-
new Error(
|
|
35775
|
-
configured ? `[FFmpeg] ffprobe not found at ${FFPROBE_PATH_ENV}="${configured}". Please install FFmpeg.` : "[FFmpeg] ffprobe not found. Please install FFmpeg."
|
|
35776
|
-
)
|
|
35777
|
-
);
|
|
35778
|
-
} else {
|
|
35779
|
-
reject(err);
|
|
35780
|
-
}
|
|
35781
|
-
});
|
|
35782
|
-
});
|
|
35783
|
-
}
|
|
35784
|
-
function parseProbeJson(stdout2) {
|
|
35785
|
-
try {
|
|
35786
|
-
return JSON.parse(stdout2);
|
|
35787
|
-
} catch (e3) {
|
|
35788
|
-
throw new Error(
|
|
35789
|
-
`[FFmpeg] Failed to parse ffprobe output: ${e3 instanceof Error ? e3.message : e3}`
|
|
35790
|
-
);
|
|
35791
|
-
}
|
|
35792
|
-
}
|
|
35793
|
-
function crc32(buf) {
|
|
35794
|
-
let crc = 4294967295;
|
|
35795
|
-
for (let i2 = 0; i2 < buf.length; i2++) {
|
|
35796
|
-
crc ^= buf[i2] ?? 0;
|
|
35797
|
-
for (let bit = 0; bit < 8; bit++) {
|
|
35798
|
-
const mask = -(crc & 1);
|
|
35799
|
-
crc = crc >>> 1 ^ 3988292384 & mask;
|
|
35800
|
-
}
|
|
35801
|
-
}
|
|
35802
|
-
return (crc ^ 4294967295) >>> 0;
|
|
35803
|
-
}
|
|
35804
|
-
function extractPngMetadataFromBuffer(buf) {
|
|
35805
|
-
if (buf.length < 8 || buf[0] !== 137 || buf[1] !== 80 || buf[2] !== 78 || buf[3] !== 71 || buf[4] !== 13 || buf[5] !== 10 || buf[6] !== 26 || buf[7] !== 10) {
|
|
35806
|
-
return null;
|
|
35807
|
-
}
|
|
35808
|
-
let width = 0;
|
|
35809
|
-
let height = 0;
|
|
35810
|
-
let seenIdat = false;
|
|
35811
|
-
let pos = 8;
|
|
35812
|
-
while (pos + 12 <= buf.length) {
|
|
35813
|
-
const chunkLen = buf.readUInt32BE(pos);
|
|
35814
|
-
const chunkType = buf.toString("ascii", pos + 4, pos + 8);
|
|
35815
|
-
if (pos + 12 + chunkLen > buf.length) return null;
|
|
35816
|
-
const chunkData = buf.subarray(pos + 8, pos + 8 + chunkLen);
|
|
35817
|
-
const chunkCrc = buf.readUInt32BE(pos + 8 + chunkLen);
|
|
35818
|
-
const chunkBytes = Buffer.concat([Buffer.from(chunkType, "ascii"), chunkData]);
|
|
35819
|
-
if (crc32(chunkBytes) !== chunkCrc) return null;
|
|
35820
|
-
if (chunkType === "IHDR" && chunkLen >= 8) {
|
|
35821
|
-
width = buf.readUInt32BE(pos + 8);
|
|
35822
|
-
height = buf.readUInt32BE(pos + 12);
|
|
35823
|
-
}
|
|
35824
|
-
if (chunkType === "IDAT") {
|
|
35825
|
-
seenIdat = true;
|
|
35826
|
-
}
|
|
35827
|
-
if (chunkType === "cICP" && chunkLen === 4 && !seenIdat) {
|
|
35828
|
-
const primariesCode = chunkData[0] ?? 0;
|
|
35829
|
-
const transferCode = chunkData[1] ?? 0;
|
|
35830
|
-
const matrixCode = chunkData[2] ?? 0;
|
|
35831
|
-
return {
|
|
35832
|
-
width,
|
|
35833
|
-
height,
|
|
35834
|
-
colorSpace: {
|
|
35835
|
-
colorPrimaries: primariesCode === 9 ? "bt2020" : primariesCode === 1 ? "bt709" : `unknown-${primariesCode}`,
|
|
35836
|
-
colorTransfer: transferCode === 16 ? "smpte2084" : transferCode === 18 ? "arib-std-b67" : transferCode === 1 ? "bt709" : `unknown-${transferCode}`,
|
|
35837
|
-
colorSpace: matrixCode === 9 ? "bt2020nc" : matrixCode === 0 ? "gbr" : `unknown-${matrixCode}`
|
|
35838
|
-
}
|
|
35839
|
-
};
|
|
35840
|
-
}
|
|
35841
|
-
if (chunkType === "IEND") break;
|
|
35842
|
-
pos += 12 + chunkLen;
|
|
35843
|
-
}
|
|
35844
|
-
return width > 0 && height > 0 ? { width, height, colorSpace: null } : null;
|
|
35845
|
-
}
|
|
35846
|
-
function extractStillImageMetadata(filePath) {
|
|
35847
|
-
if (extname(filePath).toLowerCase() !== ".png") return null;
|
|
35848
|
-
try {
|
|
35849
|
-
return extractPngMetadataFromBuffer(readFileSync3(filePath));
|
|
35850
|
-
} catch {
|
|
35851
|
-
return null;
|
|
35852
|
-
}
|
|
35853
|
-
}
|
|
35854
|
-
function readTagCI(tags, name) {
|
|
35855
|
-
if (!tags) return "";
|
|
35856
|
-
const target = name.toLowerCase();
|
|
35857
|
-
for (const [key2, value] of Object.entries(tags)) {
|
|
35858
|
-
if (key2.toLowerCase() === target && typeof value === "string") return value;
|
|
35859
|
-
}
|
|
35860
|
-
return "";
|
|
35861
|
-
}
|
|
35862
|
-
function parseFrameRate(frameRateStr) {
|
|
35863
|
-
if (!frameRateStr) return 0;
|
|
35864
|
-
const parts = frameRateStr.split("/");
|
|
35865
|
-
if (parts.length === 2) {
|
|
35866
|
-
const num = parseFloat(parts[0] ?? "");
|
|
35867
|
-
const den = parseFloat(parts[1] ?? "");
|
|
35868
|
-
if (den !== 0) return Math.round(num / den * 100) / 100;
|
|
35869
|
-
}
|
|
35870
|
-
return parseFloat(frameRateStr) || 0;
|
|
35871
|
-
}
|
|
35872
|
-
async function extractMediaMetadata(filePath) {
|
|
35873
|
-
const cached2 = videoMetadataCache.get(filePath);
|
|
35874
|
-
if (cached2) return cached2;
|
|
35875
|
-
const probePromise = (async () => {
|
|
35876
|
-
const stillImageMeta = extractStillImageMetadata(filePath);
|
|
35877
|
-
let output = null;
|
|
35878
|
-
try {
|
|
35879
|
-
const stdout2 = await runFfprobe([
|
|
35880
|
-
"-v",
|
|
35881
|
-
"quiet",
|
|
35882
|
-
"-print_format",
|
|
35883
|
-
"json",
|
|
35884
|
-
"-show_format",
|
|
35885
|
-
"-show_streams",
|
|
35886
|
-
filePath
|
|
35887
|
-
]);
|
|
35888
|
-
output = parseProbeJson(stdout2);
|
|
35889
|
-
} catch (error) {
|
|
35890
|
-
if (!stillImageMeta) throw error;
|
|
35891
|
-
}
|
|
35892
|
-
const videoStream = output?.streams.find((s2) => s2.codec_type === "video");
|
|
35893
|
-
if (!videoStream) {
|
|
35894
|
-
if (stillImageMeta) {
|
|
35895
|
-
return {
|
|
35896
|
-
durationSeconds: 0,
|
|
35897
|
-
videoStreamDurationSeconds: 0,
|
|
35898
|
-
width: stillImageMeta.width,
|
|
35899
|
-
height: stillImageMeta.height,
|
|
35900
|
-
fps: 0,
|
|
35901
|
-
videoCodec: "png",
|
|
35902
|
-
hasAudio: false,
|
|
35903
|
-
isVFR: false,
|
|
35904
|
-
hasAlpha: false,
|
|
35905
|
-
colorSpace: stillImageMeta.colorSpace
|
|
35906
|
-
};
|
|
35907
|
-
}
|
|
35908
|
-
throw new Error("[FFmpeg] No video stream found");
|
|
35909
|
-
}
|
|
35910
|
-
const rFps = parseFrameRate(videoStream.r_frame_rate);
|
|
35911
|
-
const avgFps = parseFrameRate(videoStream.avg_frame_rate);
|
|
35912
|
-
const fps = avgFps || rFps;
|
|
35913
|
-
const isVFR = rFps > 0 && avgFps > 0 && Math.abs(rFps - avgFps) / Math.max(rFps, avgFps) > 0.1;
|
|
35914
|
-
const colorTransfer = videoStream.color_transfer || "";
|
|
35915
|
-
const colorPrimaries = videoStream.color_primaries || "";
|
|
35916
|
-
const colorSpaceVal = videoStream.color_space || "";
|
|
35917
|
-
const ffprobeColorSpace = colorTransfer || colorPrimaries || colorSpaceVal ? { colorTransfer, colorPrimaries, colorSpace: colorSpaceVal } : null;
|
|
35918
|
-
const colorSpace = ffprobeColorSpace ?? stillImageMeta?.colorSpace ?? null;
|
|
35919
|
-
const pixelFormat = videoStream.pix_fmt || "";
|
|
35920
|
-
const alphaMode = readTagCI(videoStream.tags, "alpha_mode");
|
|
35921
|
-
const hasAlpha = /(^|[^a-z])yuva|rgba|argb|bgra|gbrap|gray[a-z0-9]*a/i.test(pixelFormat) || alphaMode === "1";
|
|
35922
|
-
const containerDuration = output?.format.duration ? parseFloat(output.format.duration) : 0;
|
|
35923
|
-
const streamDuration = videoStream.duration ? parseFloat(videoStream.duration) : 0;
|
|
35924
|
-
return {
|
|
35925
|
-
durationSeconds: containerDuration,
|
|
35926
|
-
videoStreamDurationSeconds: streamDuration > 0 ? streamDuration : containerDuration,
|
|
35927
|
-
width: videoStream.width || stillImageMeta?.width || 0,
|
|
35928
|
-
height: videoStream.height || stillImageMeta?.height || 0,
|
|
35929
|
-
fps,
|
|
35930
|
-
videoCodec: videoStream.codec_name || "unknown",
|
|
35931
|
-
hasAudio: output?.streams.some((s2) => s2.codec_type === "audio") ?? false,
|
|
35932
|
-
isVFR,
|
|
35933
|
-
hasAlpha,
|
|
35934
|
-
colorSpace
|
|
35935
|
-
};
|
|
35936
|
-
})();
|
|
35937
|
-
videoMetadataCache.set(filePath, probePromise);
|
|
35938
|
-
probePromise.catch(() => {
|
|
35939
|
-
if (videoMetadataCache.get(filePath) === probePromise) {
|
|
35940
|
-
videoMetadataCache.delete(filePath);
|
|
35941
|
-
}
|
|
35942
|
-
});
|
|
35943
|
-
return probePromise;
|
|
35944
|
-
}
|
|
35945
|
-
async function extractAudioMetadata(filePath) {
|
|
35946
|
-
const cached2 = audioMetadataCache.get(filePath);
|
|
35947
|
-
if (cached2) return cached2;
|
|
35948
|
-
const probePromise = (async () => {
|
|
35949
|
-
const stdout2 = await runFfprobe([
|
|
35950
|
-
"-v",
|
|
35951
|
-
"quiet",
|
|
35952
|
-
"-print_format",
|
|
35953
|
-
"json",
|
|
35954
|
-
"-show_format",
|
|
35955
|
-
"-show_streams",
|
|
35956
|
-
filePath
|
|
35957
|
-
]);
|
|
35958
|
-
const output = parseProbeJson(stdout2);
|
|
35959
|
-
const audioStream = output.streams.find((s2) => s2.codec_type === "audio");
|
|
35960
|
-
if (!audioStream) throw new Error("[FFmpeg] No audio stream found");
|
|
35961
|
-
const durationSeconds = output.format.duration ? parseFloat(output.format.duration) : 0;
|
|
35962
|
-
return {
|
|
35963
|
-
durationSeconds,
|
|
35964
|
-
sampleRate: audioStream.sample_rate ? parseInt(audioStream.sample_rate) : 44100,
|
|
35965
|
-
channels: audioStream.channels || 2,
|
|
35966
|
-
audioCodec: audioStream.codec_name || "unknown",
|
|
35967
|
-
bitrate: output.format.bit_rate ? parseInt(output.format.bit_rate) : void 0
|
|
35968
|
-
};
|
|
35969
|
-
})();
|
|
35970
|
-
audioMetadataCache.set(filePath, probePromise);
|
|
35971
|
-
probePromise.catch(() => {
|
|
35972
|
-
if (audioMetadataCache.get(filePath) === probePromise) {
|
|
35973
|
-
audioMetadataCache.delete(filePath);
|
|
35974
|
-
}
|
|
35975
|
-
});
|
|
35976
|
-
return probePromise;
|
|
35977
|
-
}
|
|
35978
|
-
async function analyzeKeyframeIntervals(filePath) {
|
|
35979
|
-
const cached2 = keyframeCache.get(filePath);
|
|
35980
|
-
if (cached2) return cached2;
|
|
35981
|
-
const promise = analyzeKeyframeIntervalsUncached(filePath);
|
|
35982
|
-
keyframeCache.set(filePath, promise);
|
|
35983
|
-
promise.catch(() => {
|
|
35984
|
-
if (keyframeCache.get(filePath) === promise) {
|
|
35985
|
-
keyframeCache.delete(filePath);
|
|
35986
|
-
}
|
|
35987
|
-
});
|
|
35988
|
-
return promise;
|
|
35989
|
-
}
|
|
35990
|
-
async function analyzeKeyframeIntervalsUncached(filePath) {
|
|
35991
|
-
const stdout2 = await runFfprobe([
|
|
35992
|
-
"-v",
|
|
35993
|
-
"quiet",
|
|
35994
|
-
"-select_streams",
|
|
35995
|
-
"v:0",
|
|
35996
|
-
"-skip_frame",
|
|
35997
|
-
"nokey",
|
|
35998
|
-
"-show_entries",
|
|
35999
|
-
"frame=pts_time",
|
|
36000
|
-
"-of",
|
|
36001
|
-
"csv=p=0",
|
|
36002
|
-
filePath
|
|
36003
|
-
]);
|
|
36004
|
-
const timestamps = stdout2.split("\n").map((line) => parseFloat(line.trim())).filter((t2) => Number.isFinite(t2));
|
|
36005
|
-
if (timestamps.length < 2) {
|
|
36006
|
-
return {
|
|
36007
|
-
avgIntervalSeconds: 0,
|
|
36008
|
-
maxIntervalSeconds: 0,
|
|
36009
|
-
keyframeCount: timestamps.length,
|
|
36010
|
-
isProblematic: false
|
|
36011
|
-
};
|
|
36012
|
-
}
|
|
36013
|
-
let maxInterval = 0;
|
|
36014
|
-
let totalInterval = 0;
|
|
36015
|
-
for (let i2 = 1; i2 < timestamps.length; i2++) {
|
|
36016
|
-
const interval = (timestamps[i2] ?? 0) - (timestamps[i2 - 1] ?? 0);
|
|
36017
|
-
totalInterval += interval;
|
|
36018
|
-
if (interval > maxInterval) maxInterval = interval;
|
|
36019
|
-
}
|
|
36020
|
-
const avgInterval = totalInterval / (timestamps.length - 1);
|
|
36021
|
-
return {
|
|
36022
|
-
avgIntervalSeconds: Math.round(avgInterval * 100) / 100,
|
|
36023
|
-
maxIntervalSeconds: Math.round(maxInterval * 100) / 100,
|
|
36024
|
-
keyframeCount: timestamps.length,
|
|
36025
|
-
isProblematic: maxInterval > 2
|
|
36026
|
-
};
|
|
36027
|
-
}
|
|
36028
|
-
var videoMetadataCache, audioMetadataCache, extractVideoMetadata, keyframeCache;
|
|
36029
|
-
var init_ffprobe = __esm({
|
|
36030
|
-
"../engine/src/utils/ffprobe.ts"() {
|
|
36031
|
-
"use strict";
|
|
36032
|
-
init_ffmpegBinaries();
|
|
36033
|
-
videoMetadataCache = /* @__PURE__ */ new Map();
|
|
36034
|
-
audioMetadataCache = /* @__PURE__ */ new Map();
|
|
36035
|
-
extractVideoMetadata = extractMediaMetadata;
|
|
36036
|
-
keyframeCache = /* @__PURE__ */ new Map();
|
|
36114
|
+
init_vp9Options();
|
|
36037
36115
|
}
|
|
36038
36116
|
});
|
|
36039
36117
|
|
|
36040
36118
|
// ../engine/src/utils/urlDownloader.ts
|
|
36041
36119
|
import { createWriteStream, existsSync as existsSync8, mkdirSync as mkdirSync5 } from "fs";
|
|
36042
36120
|
import { createHash } from "crypto";
|
|
36043
|
-
import { join as join7, extname as
|
|
36121
|
+
import { join as join7, extname as extname3 } from "path";
|
|
36044
36122
|
import { Readable } from "stream";
|
|
36045
36123
|
import { finished } from "stream/promises";
|
|
36046
36124
|
function isBlockedHost(hostname) {
|
|
@@ -36075,7 +36153,7 @@ function assertPublicHttpsUrl(url) {
|
|
|
36075
36153
|
function getFilenameFromUrl(url) {
|
|
36076
36154
|
const hash2 = createHash("md5").update(url).digest("hex").slice(0, 12);
|
|
36077
36155
|
const urlObj = new URL(url);
|
|
36078
|
-
const ext =
|
|
36156
|
+
const ext = extname3(urlObj.pathname) || ".mp4";
|
|
36079
36157
|
return `download_${hash2}${ext}`;
|
|
36080
36158
|
}
|
|
36081
36159
|
async function downloadToTemp(url, destDir, timeoutMs = 3e5) {
|
|
@@ -36957,7 +37035,7 @@ function inlineSubCompositions(document2, hosts, options) {
|
|
|
36957
37035
|
assertNonEmptyCompositionHtml(contentHtml, src);
|
|
36958
37036
|
const contentDoc = parseHtml2(contentHtml);
|
|
36959
37037
|
assertParsedCompositionDocument(contentDoc, src);
|
|
36960
|
-
const innerRoot = compId ? contentDoc
|
|
37038
|
+
const innerRoot = compId ? queryByAttr(contentDoc, "data-composition-id", compId) : contentDoc.querySelector("[data-composition-id]");
|
|
36961
37039
|
const inferredCompId = innerRoot?.getAttribute("data-composition-id")?.trim() || "";
|
|
36962
37040
|
const authoredRootId = innerRoot?.getAttribute("id")?.trim() || null;
|
|
36963
37041
|
const scopeCompId = compId || inferredCompId;
|
|
@@ -37088,6 +37166,7 @@ var init_inlineSubCompositions = __esm({
|
|
|
37088
37166
|
"../core/src/compiler/inlineSubCompositions.ts"() {
|
|
37089
37167
|
"use strict";
|
|
37090
37168
|
init_rewriteSubCompPaths();
|
|
37169
|
+
init_cssSelector();
|
|
37091
37170
|
init_compositionScoping();
|
|
37092
37171
|
}
|
|
37093
37172
|
});
|
|
@@ -37296,7 +37375,8 @@ function rewriteCssUrlsWithInlinedAssets(cssText, projectDir) {
|
|
|
37296
37375
|
);
|
|
37297
37376
|
}
|
|
37298
37377
|
function cssAttributeSelector(attr2, value) {
|
|
37299
|
-
|
|
37378
|
+
const escaped = value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
37379
|
+
return `[${attr2}="${escaped}"]`;
|
|
37300
37380
|
}
|
|
37301
37381
|
function uniqueCompositionId(baseId, index) {
|
|
37302
37382
|
return `${baseId}__hf${index}`;
|
|
@@ -37528,7 +37608,7 @@ function stripJsCommentsParserSafe(source) {
|
|
|
37528
37608
|
}
|
|
37529
37609
|
}
|
|
37530
37610
|
function ensureExternalScriptTag(doc, src) {
|
|
37531
|
-
if (doc
|
|
37611
|
+
if (queryByAttr(doc, "src", src, "script")) return;
|
|
37532
37612
|
const el = doc.createElement("script");
|
|
37533
37613
|
el.setAttribute("src", src);
|
|
37534
37614
|
doc.body.appendChild(el);
|
|
@@ -37694,7 +37774,7 @@ async function bundleToSingleHtml(projectDir, options) {
|
|
|
37694
37774
|
continue;
|
|
37695
37775
|
}
|
|
37696
37776
|
}
|
|
37697
|
-
if (!document2
|
|
37777
|
+
if (!queryByAttr(document2, "src", extSrc, "script")) {
|
|
37698
37778
|
const extScript = document2.createElement("script");
|
|
37699
37779
|
extScript.setAttribute("src", extSrc);
|
|
37700
37780
|
document2.body.appendChild(extScript);
|
|
@@ -37718,7 +37798,7 @@ async function bundleToSingleHtml(projectDir, options) {
|
|
|
37718
37798
|
const hostIdentity = hostIdentityByElement.get(host);
|
|
37719
37799
|
const runtimeCompId = hostIdentity?.runtimeCompositionId || compId;
|
|
37720
37800
|
const innerDoc = parseHTMLContent(templateHtml);
|
|
37721
|
-
const innerRoot = innerDoc
|
|
37801
|
+
const innerRoot = queryByAttr(innerDoc, "data-composition-id", compId);
|
|
37722
37802
|
const authoredRootId = innerRoot?.getAttribute("id")?.trim() || null;
|
|
37723
37803
|
const runtimeScope = runtimeCompId ? cssAttributeSelector("data-composition-id", runtimeCompId) : "";
|
|
37724
37804
|
const mergedVariables = runtimeCompId ? parseHostVariableValues(host) : {};
|
|
@@ -37843,6 +37923,7 @@ var init_htmlBundler = __esm({
|
|
|
37843
37923
|
init_runtime_inline();
|
|
37844
37924
|
init_getVariables();
|
|
37845
37925
|
init_inlineSubCompositions();
|
|
37926
|
+
init_cssSelector();
|
|
37846
37927
|
init_safePath();
|
|
37847
37928
|
init_colorGrading();
|
|
37848
37929
|
DEFAULT_RUNTIME_SCRIPT_URL = "";
|
|
@@ -40003,7 +40084,7 @@ var init_parallelCoordinator = __esm({
|
|
|
40003
40084
|
import { Hono } from "hono";
|
|
40004
40085
|
import { serve } from "@hono/node-server";
|
|
40005
40086
|
import { readFileSync as readFileSync6, existsSync as existsSync14, statSync as statSync4 } from "fs";
|
|
40006
|
-
import { join as join13, extname as
|
|
40087
|
+
import { join as join13, extname as extname4 } from "path";
|
|
40007
40088
|
function createFileServer(options) {
|
|
40008
40089
|
const { projectDir, compiledDir, port = 0, stripEmbeddedRuntime = true } = options;
|
|
40009
40090
|
const headScripts = options.headScripts ?? [];
|
|
@@ -40021,7 +40102,7 @@ function createFileServer(options) {
|
|
|
40021
40102
|
if (!existsSync14(filePath) || !statSync4(filePath).isFile()) {
|
|
40022
40103
|
return c3.text("Not found", 404);
|
|
40023
40104
|
}
|
|
40024
|
-
const ext =
|
|
40105
|
+
const ext = extname4(filePath).toLowerCase();
|
|
40025
40106
|
const contentType = MIME_TYPES[ext] || "application/octet-stream";
|
|
40026
40107
|
if (ext === ".html") {
|
|
40027
40108
|
const rawHtml = readFileSync6(filePath, "utf-8");
|
|
@@ -41549,6 +41630,7 @@ __export(src_exports2, {
|
|
|
41549
41630
|
BROWSER_GPU_NOT_SOFTWARE: () => BROWSER_GPU_NOT_SOFTWARE,
|
|
41550
41631
|
DEFAULT_CONFIG: () => DEFAULT_CONFIG2,
|
|
41551
41632
|
DEFAULT_HDR10_MASTERING: () => DEFAULT_HDR10_MASTERING,
|
|
41633
|
+
DEFAULT_VP9_CPU_USED: () => DEFAULT_VP9_CPU_USED,
|
|
41552
41634
|
DOM_LAYER_MASK_STYLE_ID: () => DOM_LAYER_MASK_STYLE_ID,
|
|
41553
41635
|
ENABLE_BROWSER_POOL: () => ENABLE_BROWSER_POOL,
|
|
41554
41636
|
ENCODER_PRESETS: () => ENCODER_PRESETS,
|
|
@@ -41556,7 +41638,9 @@ __export(src_exports2, {
|
|
|
41556
41638
|
FFPROBE_PATH_ENV: () => FFPROBE_PATH_ENV,
|
|
41557
41639
|
FrameLookupTable: () => FrameLookupTable,
|
|
41558
41640
|
LOW_MEMORY_TOTAL_MB_THRESHOLD: () => LOW_MEMORY_TOTAL_MB_THRESHOLD,
|
|
41641
|
+
MAX_VP9_CPU_USED: () => MAX_VP9_CPU_USED,
|
|
41559
41642
|
MEDIA_VISUAL_STYLE_PROPERTIES: () => MEDIA_VISUAL_STYLE_PROPERTIES,
|
|
41643
|
+
MIN_VP9_CPU_USED: () => MIN_VP9_CPU_USED,
|
|
41560
41644
|
SwiftShaderAssertionError: () => SwiftShaderAssertionError,
|
|
41561
41645
|
TRANSITIONS: () => TRANSITIONS,
|
|
41562
41646
|
VIDEO_FRAME_FORMATS: () => VIDEO_FRAME_FORMATS,
|
|
@@ -41634,6 +41718,7 @@ __export(src_exports2, {
|
|
|
41634
41718
|
mergeWorkerFrames: () => mergeWorkerFrames,
|
|
41635
41719
|
muxVideoWithAudio: () => muxVideoWithAudio,
|
|
41636
41720
|
normalizeObjectFit: () => normalizeObjectFit,
|
|
41721
|
+
normalizeVp9CpuUsed: () => normalizeVp9CpuUsed,
|
|
41637
41722
|
pageScreenshotCapture: () => pageScreenshotCapture,
|
|
41638
41723
|
parseAudioElements: () => parseAudioElements,
|
|
41639
41724
|
parseImageElements: () => parseImageElements,
|
|
@@ -41666,6 +41751,7 @@ var init_src2 = __esm({
|
|
|
41666
41751
|
"../engine/src/index.ts"() {
|
|
41667
41752
|
"use strict";
|
|
41668
41753
|
init_config2();
|
|
41754
|
+
init_vp9Options();
|
|
41669
41755
|
init_systemMemory();
|
|
41670
41756
|
init_browserManager();
|
|
41671
41757
|
init_frameCapture();
|
|
@@ -45203,9 +45289,9 @@ __export(normalize_exports, {
|
|
|
45203
45289
|
stripBeforeOnset: () => stripBeforeOnset
|
|
45204
45290
|
});
|
|
45205
45291
|
import { readFileSync as readFileSync12, readdirSync as readdirSync7, writeFileSync as writeFileSync8 } from "fs";
|
|
45206
|
-
import { extname as
|
|
45292
|
+
import { extname as extname5, join as join18 } from "path";
|
|
45207
45293
|
function detectFormat(filePath) {
|
|
45208
|
-
const ext =
|
|
45294
|
+
const ext = extname5(filePath).toLowerCase();
|
|
45209
45295
|
if (ext === ".srt") return "srt";
|
|
45210
45296
|
if (ext === ".vtt") return "vtt";
|
|
45211
45297
|
if (ext === ".json") return detectJsonFormat(JSON.parse(readFileSync12(filePath, "utf-8")));
|
|
@@ -45357,7 +45443,7 @@ function round3(n2) {
|
|
|
45357
45443
|
return Math.round(n2 * 1e3) / 1e3;
|
|
45358
45444
|
}
|
|
45359
45445
|
function loadTranscript(filePath) {
|
|
45360
|
-
const ext =
|
|
45446
|
+
const ext = extname5(filePath).toLowerCase();
|
|
45361
45447
|
const content = readFileSync12(filePath, "utf-8");
|
|
45362
45448
|
if (ext === ".srt") {
|
|
45363
45449
|
const words2 = parseSrt(content).map((w3, i2) => ({ ...w3, id: w3.id ?? `w${i2}` }));
|
|
@@ -45482,7 +45568,7 @@ __export(transcribe_exports, {
|
|
|
45482
45568
|
});
|
|
45483
45569
|
import { execFileSync as execFileSync3 } from "child_process";
|
|
45484
45570
|
import { existsSync as existsSync21, readFileSync as readFileSync14, mkdirSync as mkdirSync12, unlinkSync as unlinkSync2 } from "fs";
|
|
45485
|
-
import { join as join20, extname as
|
|
45571
|
+
import { join as join20, extname as extname6 } from "path";
|
|
45486
45572
|
import { tmpdir } from "os";
|
|
45487
45573
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
45488
45574
|
function detectLanguage(whisperPath, modelPath2, wavPath) {
|
|
@@ -45556,10 +45642,10 @@ function detectSpeechOnset(wavPath) {
|
|
|
45556
45642
|
return null;
|
|
45557
45643
|
}
|
|
45558
45644
|
function isAudioFile(filePath) {
|
|
45559
|
-
return AUDIO_EXTENSIONS.has(
|
|
45645
|
+
return AUDIO_EXTENSIONS.has(extname6(filePath).toLowerCase());
|
|
45560
45646
|
}
|
|
45561
45647
|
function isVideoFile(filePath) {
|
|
45562
|
-
return VIDEO_EXTENSIONS.has(
|
|
45648
|
+
return VIDEO_EXTENSIONS.has(extname6(filePath).toLowerCase());
|
|
45563
45649
|
}
|
|
45564
45650
|
function tempWavPath() {
|
|
45565
45651
|
return join20(tmpdir(), `hyperframes-audio-${process.pid}-${randomUUID2()}.wav`);
|
|
@@ -45596,7 +45682,7 @@ function isWav16kMono(filePath) {
|
|
|
45596
45682
|
}
|
|
45597
45683
|
}
|
|
45598
45684
|
function prepareAudio(audioPath) {
|
|
45599
|
-
if (
|
|
45685
|
+
if (extname6(audioPath).toLowerCase() === ".wav" && isWav16kMono(audioPath)) {
|
|
45600
45686
|
return audioPath;
|
|
45601
45687
|
}
|
|
45602
45688
|
const ffmpegPath = findFFmpeg();
|
|
@@ -45620,7 +45706,7 @@ async function transcribe(inputPath, outputDir, options) {
|
|
|
45620
45706
|
onProgress: options?.onProgress
|
|
45621
45707
|
});
|
|
45622
45708
|
let wavPath;
|
|
45623
|
-
const ext =
|
|
45709
|
+
const ext = extname6(inputPath).toLowerCase();
|
|
45624
45710
|
if (isAudioFile(inputPath)) {
|
|
45625
45711
|
options?.onProgress?.("Preparing audio...");
|
|
45626
45712
|
wavPath = prepareAudio(inputPath);
|
|
@@ -45847,7 +45933,7 @@ var init_lint = __esm({
|
|
|
45847
45933
|
|
|
45848
45934
|
// src/utils/lintProject.ts
|
|
45849
45935
|
import { existsSync as existsSync22, readFileSync as readFileSync15, readdirSync as readdirSync8 } from "fs";
|
|
45850
|
-
import { dirname as dirname9, extname as
|
|
45936
|
+
import { dirname as dirname9, extname as extname7, isAbsolute as isAbsolute6, join as join21, posix as posix3, relative as relative4, resolve as resolve12 } from "path";
|
|
45851
45937
|
function readHtmlAttr(tag, name) {
|
|
45852
45938
|
const escaped = name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
45853
45939
|
const match = tag.match(new RegExp(`\\b${escaped}\\s*=\\s*(?:"([^"]*)"|'([^']*)')`, "i"));
|
|
@@ -46020,7 +46106,7 @@ function lintProjectAudioFiles(projectDir, htmlSources) {
|
|
|
46020
46106
|
let audioFiles;
|
|
46021
46107
|
try {
|
|
46022
46108
|
audioFiles = readdirSync8(projectDir).filter(
|
|
46023
|
-
(f3) => AUDIO_EXTENSIONS2.has(
|
|
46109
|
+
(f3) => AUDIO_EXTENSIONS2.has(extname7(f3).toLowerCase())
|
|
46024
46110
|
);
|
|
46025
46111
|
} catch {
|
|
46026
46112
|
return findings;
|
|
@@ -51422,6 +51508,99 @@ var require_dist = __commonJS({
|
|
|
51422
51508
|
}
|
|
51423
51509
|
});
|
|
51424
51510
|
|
|
51511
|
+
// ../core/src/utils/htmlAttrSafety.ts
|
|
51512
|
+
function isAllowedHtmlAttribute(name) {
|
|
51513
|
+
const lower2 = name.toLowerCase();
|
|
51514
|
+
if (lower2.startsWith("on")) return false;
|
|
51515
|
+
if (ALLOWED_HTML_ATTRS.has(lower2)) return true;
|
|
51516
|
+
if (lower2.startsWith("data-")) return true;
|
|
51517
|
+
if (lower2.startsWith("aria-")) return true;
|
|
51518
|
+
return false;
|
|
51519
|
+
}
|
|
51520
|
+
function isSafeAttributeValue(name, value) {
|
|
51521
|
+
if (URI_BEARING_ATTRS.has(name.toLowerCase())) {
|
|
51522
|
+
const trimmed = value.trim();
|
|
51523
|
+
if (DANGEROUS_URI_SCHEMES.test(trimmed)) return false;
|
|
51524
|
+
if (DANGEROUS_DATA_URI.test(trimmed)) return false;
|
|
51525
|
+
}
|
|
51526
|
+
return true;
|
|
51527
|
+
}
|
|
51528
|
+
var ALLOWED_HTML_ATTRS, URI_BEARING_ATTRS, DANGEROUS_URI_SCHEMES, DANGEROUS_DATA_URI;
|
|
51529
|
+
var init_htmlAttrSafety = __esm({
|
|
51530
|
+
"../core/src/utils/htmlAttrSafety.ts"() {
|
|
51531
|
+
"use strict";
|
|
51532
|
+
ALLOWED_HTML_ATTRS = /* @__PURE__ */ new Set([
|
|
51533
|
+
"id",
|
|
51534
|
+
"class",
|
|
51535
|
+
"style",
|
|
51536
|
+
"title",
|
|
51537
|
+
"name",
|
|
51538
|
+
"for",
|
|
51539
|
+
"type",
|
|
51540
|
+
"lang",
|
|
51541
|
+
"dir",
|
|
51542
|
+
"translate",
|
|
51543
|
+
"hidden",
|
|
51544
|
+
"tabindex",
|
|
51545
|
+
"draggable",
|
|
51546
|
+
"contenteditable",
|
|
51547
|
+
"role",
|
|
51548
|
+
"slot",
|
|
51549
|
+
"href",
|
|
51550
|
+
"target",
|
|
51551
|
+
"rel",
|
|
51552
|
+
"src",
|
|
51553
|
+
"srcset",
|
|
51554
|
+
"sizes",
|
|
51555
|
+
"alt",
|
|
51556
|
+
"poster",
|
|
51557
|
+
"loading",
|
|
51558
|
+
"decoding",
|
|
51559
|
+
"crossorigin",
|
|
51560
|
+
"preload",
|
|
51561
|
+
"autoplay",
|
|
51562
|
+
"loop",
|
|
51563
|
+
"muted",
|
|
51564
|
+
"controls",
|
|
51565
|
+
"playsinline",
|
|
51566
|
+
"width",
|
|
51567
|
+
"height",
|
|
51568
|
+
"colspan",
|
|
51569
|
+
"rowspan",
|
|
51570
|
+
"scope",
|
|
51571
|
+
"placeholder",
|
|
51572
|
+
"value",
|
|
51573
|
+
"min",
|
|
51574
|
+
"max",
|
|
51575
|
+
"step",
|
|
51576
|
+
"pattern",
|
|
51577
|
+
"required",
|
|
51578
|
+
"disabled",
|
|
51579
|
+
"readonly",
|
|
51580
|
+
"checked",
|
|
51581
|
+
"selected",
|
|
51582
|
+
"multiple",
|
|
51583
|
+
"accept",
|
|
51584
|
+
"maxlength",
|
|
51585
|
+
"minlength",
|
|
51586
|
+
"rows",
|
|
51587
|
+
"cols",
|
|
51588
|
+
"wrap"
|
|
51589
|
+
]);
|
|
51590
|
+
URI_BEARING_ATTRS = /* @__PURE__ */ new Set([
|
|
51591
|
+
"src",
|
|
51592
|
+
"href",
|
|
51593
|
+
"action",
|
|
51594
|
+
"formaction",
|
|
51595
|
+
"poster",
|
|
51596
|
+
"srcset",
|
|
51597
|
+
"xlink:href"
|
|
51598
|
+
]);
|
|
51599
|
+
DANGEROUS_URI_SCHEMES = /^(?:javascript|vbscript):/i;
|
|
51600
|
+
DANGEROUS_DATA_URI = /^data\s*:\s*text\/html/i;
|
|
51601
|
+
}
|
|
51602
|
+
});
|
|
51603
|
+
|
|
51425
51604
|
// ../core/src/studio-api/helpers/sourceMutation.ts
|
|
51426
51605
|
import postcss4 from "postcss";
|
|
51427
51606
|
function parseSourceDocument(source) {
|
|
@@ -51520,22 +51699,6 @@ function isHTMLElement(el) {
|
|
|
51520
51699
|
const HTMLEl = el.ownerDocument.defaultView?.HTMLElement;
|
|
51521
51700
|
return HTMLEl ? el instanceof HTMLEl : "style" in el;
|
|
51522
51701
|
}
|
|
51523
|
-
function isAllowedHtmlAttribute(name) {
|
|
51524
|
-
const lower2 = name.toLowerCase();
|
|
51525
|
-
if (lower2.startsWith("on")) return false;
|
|
51526
|
-
if (ALLOWED_HTML_ATTRS.has(lower2)) return true;
|
|
51527
|
-
if (lower2.startsWith("data-")) return true;
|
|
51528
|
-
if (lower2.startsWith("aria-")) return true;
|
|
51529
|
-
return false;
|
|
51530
|
-
}
|
|
51531
|
-
function isSafeAttributeValue(name, value) {
|
|
51532
|
-
if (URI_ATTRS.has(name.toLowerCase())) {
|
|
51533
|
-
const trimmed = value.trim();
|
|
51534
|
-
if (DANGEROUS_URI_SCHEMES.test(trimmed)) return false;
|
|
51535
|
-
if (DANGEROUS_DATA_URI.test(trimmed)) return false;
|
|
51536
|
-
}
|
|
51537
|
-
return true;
|
|
51538
|
-
}
|
|
51539
51702
|
function patchStyleAttrString(style, property, value) {
|
|
51540
51703
|
const props = /* @__PURE__ */ new Map();
|
|
51541
51704
|
const order = [];
|
|
@@ -51694,81 +51857,13 @@ function splitElementInHtml(source, target, splitTime, newId) {
|
|
|
51694
51857
|
newId
|
|
51695
51858
|
};
|
|
51696
51859
|
}
|
|
51697
|
-
var import_postcss_selector_parser
|
|
51860
|
+
var import_postcss_selector_parser;
|
|
51698
51861
|
var init_sourceMutation = __esm({
|
|
51699
51862
|
"../core/src/studio-api/helpers/sourceMutation.ts"() {
|
|
51700
51863
|
"use strict";
|
|
51701
51864
|
init_esm10();
|
|
51702
51865
|
import_postcss_selector_parser = __toESM(require_dist(), 1);
|
|
51703
|
-
|
|
51704
|
-
// Identity & structure
|
|
51705
|
-
"id",
|
|
51706
|
-
"class",
|
|
51707
|
-
"style",
|
|
51708
|
-
"title",
|
|
51709
|
-
"name",
|
|
51710
|
-
"for",
|
|
51711
|
-
"type",
|
|
51712
|
-
// Internationalization
|
|
51713
|
-
"lang",
|
|
51714
|
-
"dir",
|
|
51715
|
-
"translate",
|
|
51716
|
-
// Interaction
|
|
51717
|
-
"hidden",
|
|
51718
|
-
"tabindex",
|
|
51719
|
-
"draggable",
|
|
51720
|
-
"contenteditable",
|
|
51721
|
-
// Accessibility
|
|
51722
|
-
"role",
|
|
51723
|
-
"slot",
|
|
51724
|
-
// Links & navigation
|
|
51725
|
-
"href",
|
|
51726
|
-
"target",
|
|
51727
|
-
"rel",
|
|
51728
|
-
// Media
|
|
51729
|
-
"src",
|
|
51730
|
-
"srcset",
|
|
51731
|
-
"sizes",
|
|
51732
|
-
"alt",
|
|
51733
|
-
"poster",
|
|
51734
|
-
"loading",
|
|
51735
|
-
"decoding",
|
|
51736
|
-
"crossorigin",
|
|
51737
|
-
"preload",
|
|
51738
|
-
"autoplay",
|
|
51739
|
-
"loop",
|
|
51740
|
-
"muted",
|
|
51741
|
-
"controls",
|
|
51742
|
-
"playsinline",
|
|
51743
|
-
// Layout
|
|
51744
|
-
"width",
|
|
51745
|
-
"height",
|
|
51746
|
-
"colspan",
|
|
51747
|
-
"rowspan",
|
|
51748
|
-
"scope",
|
|
51749
|
-
// Form
|
|
51750
|
-
"placeholder",
|
|
51751
|
-
"value",
|
|
51752
|
-
"min",
|
|
51753
|
-
"max",
|
|
51754
|
-
"step",
|
|
51755
|
-
"pattern",
|
|
51756
|
-
"required",
|
|
51757
|
-
"disabled",
|
|
51758
|
-
"readonly",
|
|
51759
|
-
"checked",
|
|
51760
|
-
"selected",
|
|
51761
|
-
"multiple",
|
|
51762
|
-
"accept",
|
|
51763
|
-
"maxlength",
|
|
51764
|
-
"minlength",
|
|
51765
|
-
"rows",
|
|
51766
|
-
"cols",
|
|
51767
|
-
"wrap"
|
|
51768
|
-
]);
|
|
51769
|
-
DANGEROUS_URI_SCHEMES = /^(?:javascript|vbscript):/i;
|
|
51770
|
-
DANGEROUS_DATA_URI = /^data\s*:\s*text\/html/i;
|
|
51771
|
-
URI_ATTRS = /* @__PURE__ */ new Set(["src", "href", "action", "formaction", "poster", "srcset"]);
|
|
51866
|
+
init_htmlAttrSafety();
|
|
51772
51867
|
}
|
|
51773
51868
|
});
|
|
51774
51869
|
|
|
@@ -86035,13 +86130,13 @@ var init_subComposition = __esm({
|
|
|
86035
86130
|
// ../core/src/studio-api/helpers/projectSignature.ts
|
|
86036
86131
|
import { createHash as createHash4 } from "crypto";
|
|
86037
86132
|
import { lstatSync, readFileSync as readFileSync21, readdirSync as readdirSync12 } from "fs";
|
|
86038
|
-
import { extname as
|
|
86133
|
+
import { extname as extname8, isAbsolute as isAbsolute7, relative as relative6, resolve as resolve18 } from "path";
|
|
86039
86134
|
function isPathWithin(parentDir, childPath) {
|
|
86040
86135
|
const childRelativePath = relative6(parentDir, childPath);
|
|
86041
86136
|
return childRelativePath === "" || !childRelativePath.startsWith("..") && !isAbsolute7(childRelativePath);
|
|
86042
86137
|
}
|
|
86043
86138
|
function isTextContentEligible(file, size) {
|
|
86044
|
-
return SIGNATURE_TEXT_EXTENSIONS.has(
|
|
86139
|
+
return SIGNATURE_TEXT_EXTENSIONS.has(extname8(file).toLowerCase()) && size <= MAX_SIGNATURE_TEXT_BYTES;
|
|
86045
86140
|
}
|
|
86046
86141
|
function collectProjectSignatureFiles(projectDir, dir, files) {
|
|
86047
86142
|
let entries2;
|
|
@@ -92383,6 +92478,8 @@ function buildAnimatedGifTranscodeArgs(input2) {
|
|
|
92383
92478
|
"0",
|
|
92384
92479
|
"-deadline",
|
|
92385
92480
|
"good",
|
|
92481
|
+
"-cpu-used",
|
|
92482
|
+
String(DEFAULT_VP9_CPU_USED),
|
|
92386
92483
|
"-crf",
|
|
92387
92484
|
"18",
|
|
92388
92485
|
"-b:v",
|
|
@@ -92675,7 +92772,7 @@ var init_hf_early_stub_inline = __esm({
|
|
|
92675
92772
|
import { Hono as Hono3 } from "hono";
|
|
92676
92773
|
import { serve as serve2 } from "@hono/node-server";
|
|
92677
92774
|
import { readFileSync as readFileSync31, existsSync as existsSync38, realpathSync as realpathSync3, statSync as statSync12 } from "fs";
|
|
92678
|
-
import { join as join38, extname as
|
|
92775
|
+
import { join as join38, extname as extname9, resolve as resolve22, sep as sep4 } from "path";
|
|
92679
92776
|
function isPathInside2(child, parent, options = {}) {
|
|
92680
92777
|
const { resolveSymlinks = false, pathModule } = options;
|
|
92681
92778
|
const resolveFn = pathModule?.resolve ?? resolve22;
|
|
@@ -92875,7 +92972,7 @@ function createFileServer2(options) {
|
|
|
92875
92972
|
}
|
|
92876
92973
|
return c3.text("Not found", 404);
|
|
92877
92974
|
}
|
|
92878
|
-
const ext =
|
|
92975
|
+
const ext = extname9(filePath).toLowerCase();
|
|
92879
92976
|
const contentType = MIME_TYPES3[ext] || "application/octet-stream";
|
|
92880
92977
|
if (ext === ".html") {
|
|
92881
92978
|
const rawHtml = readFileSync31(filePath, "utf-8");
|
|
@@ -98436,6 +98533,7 @@ async function runEncodeStage(input2) {
|
|
|
98436
98533
|
quality: effectiveQuality,
|
|
98437
98534
|
bitrate: effectiveBitrate,
|
|
98438
98535
|
pixelFormat: preset.pixelFormat,
|
|
98536
|
+
vp9CpuUsed: engineCfg.vp9CpuUsed,
|
|
98439
98537
|
useGpu: job.config.useGpu,
|
|
98440
98538
|
hdr: preset.hdr,
|
|
98441
98539
|
// Distributed chunk renders pass these so the encoder writes closed-GOP
|
|
@@ -98496,7 +98594,7 @@ async function runAssembleStage(input2) {
|
|
|
98496
98594
|
audioOutputPath,
|
|
98497
98595
|
outputPath,
|
|
98498
98596
|
abortSignal,
|
|
98499
|
-
|
|
98597
|
+
{ audioCodec: "aac" },
|
|
98500
98598
|
job.config.fps
|
|
98501
98599
|
);
|
|
98502
98600
|
assertNotAborted();
|
|
@@ -99361,6 +99459,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
99361
99459
|
quality: effectiveQuality,
|
|
99362
99460
|
bitrate: effectiveBitrate,
|
|
99363
99461
|
pixelFormat: preset.pixelFormat,
|
|
99462
|
+
vp9CpuUsed: cfg.vp9CpuUsed,
|
|
99364
99463
|
useGpu: job.config.useGpu,
|
|
99365
99464
|
imageFormat: captureOptions.format || "jpeg",
|
|
99366
99465
|
hdr: preset.hdr
|
|
@@ -100819,6 +100918,7 @@ async function readFontSnapshotSha() {
|
|
|
100819
100918
|
function buildLockedRenderConfig(input2) {
|
|
100820
100919
|
const { config, forceScreenshot, deviceScaleFactor, ffmpegVersion } = input2;
|
|
100821
100920
|
const { encoder, pixelFormat, preset } = resolveEncoderTriple(config);
|
|
100921
|
+
const locksVp9CpuUsed = encoder === "libvpx-vp9-software" ? { vp9CpuUsed: normalizeVp9CpuUsed(input2.engineConfig.vp9CpuUsed) } : {};
|
|
100822
100922
|
return {
|
|
100823
100923
|
captureMode: forceScreenshot ? "screenshot" : "beginframe",
|
|
100824
100924
|
forceScreenshot,
|
|
@@ -100835,6 +100935,7 @@ function buildLockedRenderConfig(input2) {
|
|
|
100835
100935
|
preset,
|
|
100836
100936
|
crf: config.crf,
|
|
100837
100937
|
bitrate: config.bitrate,
|
|
100938
|
+
...locksVp9CpuUsed,
|
|
100838
100939
|
// GOP === chunkSize so every chunk's first frame is an IDR keyframe and
|
|
100839
100940
|
// ffmpeg concat-copy round-trips losslessly.
|
|
100840
100941
|
gopSize: input2.effectiveChunkSize,
|
|
@@ -101062,6 +101163,7 @@ async function plan(projectDir, config, planDir) {
|
|
|
101062
101163
|
forceScreenshot,
|
|
101063
101164
|
deviceScaleFactor,
|
|
101064
101165
|
ffmpegVersion,
|
|
101166
|
+
engineConfig: cfg,
|
|
101065
101167
|
effectiveChunkSize,
|
|
101066
101168
|
chunkCount,
|
|
101067
101169
|
runtimeEnv
|
|
@@ -101184,7 +101286,7 @@ var init_plan = __esm({
|
|
|
101184
101286
|
// ../producer/src/services/distributed/renderChunk.ts
|
|
101185
101287
|
import { randomBytes as randomBytes2 } from "crypto";
|
|
101186
101288
|
import { existsSync as existsSync51, mkdirSync as mkdirSync30, readFileSync as readFileSync38, readdirSync as readdirSync20, rmSync as rmSync14, writeFileSync as writeFileSync23 } from "fs";
|
|
101187
|
-
import { extname as
|
|
101289
|
+
import { extname as extname10, join as join61 } from "path";
|
|
101188
101290
|
function rebuildExtractedFramesFromPlanDir(planDir, videos) {
|
|
101189
101291
|
const result = [];
|
|
101190
101292
|
for (const v2 of videos) {
|
|
@@ -101194,7 +101296,7 @@ function rebuildExtractedFramesFromPlanDir(planDir, videos) {
|
|
|
101194
101296
|
`[renderChunk] planDir missing extracted video frames for ${JSON.stringify(v2.videoId)}: ${outputDir} not present. plan() should have written frames here; the planDir is malformed.`
|
|
101195
101297
|
);
|
|
101196
101298
|
}
|
|
101197
|
-
const ext = (
|
|
101299
|
+
const ext = (extname10(v2.framePattern) || ".jpg").toLowerCase();
|
|
101198
101300
|
const frames = readdirSync20(outputDir).filter((name) => name.toLowerCase().endsWith(ext)).sort();
|
|
101199
101301
|
const framePaths = /* @__PURE__ */ new Map();
|
|
101200
101302
|
for (let i2 = 0; i2 < frames.length; i2++) {
|
|
@@ -101235,6 +101337,10 @@ function resolvePresetForLockedEncoder(basePreset, lockedEncoder) {
|
|
|
101235
101337
|
}
|
|
101236
101338
|
return basePreset;
|
|
101237
101339
|
}
|
|
101340
|
+
function resolveLockedVp9CpuUsed(lockedEncoder) {
|
|
101341
|
+
if (lockedEncoder.encoder !== "libvpx-vp9-software") return void 0;
|
|
101342
|
+
return lockedEncoder.vp9CpuUsed ?? LEGACY_DISTRIBUTED_VP9_CPU_USED;
|
|
101343
|
+
}
|
|
101238
101344
|
async function renderChunk(planDir, chunkIndex, outputChunkPath) {
|
|
101239
101345
|
const start = Date.now();
|
|
101240
101346
|
const log2 = defaultLogger;
|
|
@@ -101444,6 +101550,10 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath) {
|
|
|
101444
101550
|
preset,
|
|
101445
101551
|
effectiveQuality,
|
|
101446
101552
|
effectiveBitrate,
|
|
101553
|
+
engineConfig: {
|
|
101554
|
+
ffmpegEncodeTimeout: cfg.ffmpegEncodeTimeout,
|
|
101555
|
+
vp9CpuUsed: resolveLockedVp9CpuUsed(encoder) ?? cfg.vp9CpuUsed
|
|
101556
|
+
},
|
|
101447
101557
|
// Distributed chunks emit a single ffmpeg call per chunk; the
|
|
101448
101558
|
// in-process per-chunk-within-chunk path would re-split our
|
|
101449
101559
|
// already-chunked work.
|
|
@@ -101518,7 +101628,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath) {
|
|
|
101518
101628
|
envRestore.restore();
|
|
101519
101629
|
}
|
|
101520
101630
|
}
|
|
101521
|
-
var FFMPEG_VERSION_MISMATCH, PLAN_HASH_MISMATCH, MISSING_PLAN_ARTIFACT, CHUNK_INDEX_OUT_OF_RANGE, MISSING_RUNTIME_ENV_SNAPSHOT, RenderChunkValidationError;
|
|
101631
|
+
var FFMPEG_VERSION_MISMATCH, PLAN_HASH_MISMATCH, MISSING_PLAN_ARTIFACT, CHUNK_INDEX_OUT_OF_RANGE, MISSING_RUNTIME_ENV_SNAPSHOT, LEGACY_DISTRIBUTED_VP9_CPU_USED, RenderChunkValidationError;
|
|
101522
101632
|
var init_renderChunk = __esm({
|
|
101523
101633
|
"../producer/src/services/distributed/renderChunk.ts"() {
|
|
101524
101634
|
"use strict";
|
|
@@ -101538,6 +101648,7 @@ var init_renderChunk = __esm({
|
|
|
101538
101648
|
MISSING_PLAN_ARTIFACT = "MISSING_PLAN_ARTIFACT";
|
|
101539
101649
|
CHUNK_INDEX_OUT_OF_RANGE = "CHUNK_INDEX_OUT_OF_RANGE";
|
|
101540
101650
|
MISSING_RUNTIME_ENV_SNAPSHOT = "MISSING_RUNTIME_ENV_SNAPSHOT";
|
|
101651
|
+
LEGACY_DISTRIBUTED_VP9_CPU_USED = 2;
|
|
101541
101652
|
RenderChunkValidationError = class extends Error {
|
|
101542
101653
|
code;
|
|
101543
101654
|
constructor(code, message) {
|
|
@@ -101551,41 +101662,89 @@ var init_renderChunk = __esm({
|
|
|
101551
101662
|
|
|
101552
101663
|
// ../producer/src/services/render/audioPadTrim.ts
|
|
101553
101664
|
import { spawn as spawn11 } from "child_process";
|
|
101554
|
-
|
|
101665
|
+
import { rmSync as rmSync15 } from "fs";
|
|
101666
|
+
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
101667
|
+
function buildPadTrimAudioPlan(audioPath, outputPath, sourceDurationSeconds, targetDurationSeconds, audioInfo = {}) {
|
|
101555
101668
|
const delta = targetDurationSeconds - sourceDurationSeconds;
|
|
101556
101669
|
const targetSec = formatSeconds(targetDurationSeconds);
|
|
101557
101670
|
if (Math.abs(delta) < AUDIO_DURATION_TOLERANCE_SECONDS) {
|
|
101558
101671
|
return {
|
|
101559
101672
|
operation: "copy",
|
|
101560
|
-
args: ["-i", audioPath, "-c:a", "copy", "-y", outputPath]
|
|
101673
|
+
steps: [{ kind: "copy", args: ["-i", audioPath, "-c:a", "copy", "-y", outputPath] }],
|
|
101674
|
+
cleanupPaths: []
|
|
101561
101675
|
};
|
|
101562
101676
|
}
|
|
101563
101677
|
if (delta > 0) {
|
|
101564
101678
|
const padDur = formatSeconds(delta);
|
|
101679
|
+
const silencePath = `${outputPath}.pad-silence.aac`;
|
|
101565
101680
|
return {
|
|
101566
101681
|
operation: "pad",
|
|
101567
|
-
|
|
101568
|
-
|
|
101569
|
-
|
|
101570
|
-
|
|
101571
|
-
|
|
101572
|
-
|
|
101573
|
-
|
|
101574
|
-
|
|
101575
|
-
|
|
101576
|
-
|
|
101577
|
-
|
|
101578
|
-
|
|
101682
|
+
steps: [
|
|
101683
|
+
{
|
|
101684
|
+
kind: "pad-silence",
|
|
101685
|
+
args: [
|
|
101686
|
+
"-f",
|
|
101687
|
+
"lavfi",
|
|
101688
|
+
"-i",
|
|
101689
|
+
`anullsrc=channel_layout=${channelLayoutForChannels(audioInfo.channels)}:sample_rate=${sampleRateForFilter(audioInfo.sampleRate)}`,
|
|
101690
|
+
"-t",
|
|
101691
|
+
padDur,
|
|
101692
|
+
"-c:a",
|
|
101693
|
+
"aac",
|
|
101694
|
+
"-b:a",
|
|
101695
|
+
"192k",
|
|
101696
|
+
"-y",
|
|
101697
|
+
silencePath
|
|
101698
|
+
]
|
|
101699
|
+
},
|
|
101700
|
+
{
|
|
101701
|
+
kind: "pad-concat",
|
|
101702
|
+
args: [
|
|
101703
|
+
"-f",
|
|
101704
|
+
"concat",
|
|
101705
|
+
"-safe",
|
|
101706
|
+
"0",
|
|
101707
|
+
"-protocol_whitelist",
|
|
101708
|
+
"file,pipe,crypto,data",
|
|
101709
|
+
"-i",
|
|
101710
|
+
"pipe:0",
|
|
101711
|
+
"-c:a",
|
|
101712
|
+
"copy",
|
|
101713
|
+
"-y",
|
|
101714
|
+
outputPath
|
|
101715
|
+
],
|
|
101716
|
+
stdin: `${concatFileLine(audioPath)}
|
|
101717
|
+
${concatFileLine(silencePath)}
|
|
101718
|
+
`
|
|
101719
|
+
}
|
|
101720
|
+
],
|
|
101721
|
+
cleanupPaths: [silencePath]
|
|
101579
101722
|
};
|
|
101580
101723
|
}
|
|
101581
101724
|
return {
|
|
101582
101725
|
operation: "trim",
|
|
101583
|
-
|
|
101726
|
+
steps: [
|
|
101727
|
+
{ kind: "trim", args: ["-i", audioPath, "-t", targetSec, "-c:a", "copy", "-y", outputPath] }
|
|
101728
|
+
],
|
|
101729
|
+
cleanupPaths: []
|
|
101584
101730
|
};
|
|
101585
101731
|
}
|
|
101586
101732
|
function formatSeconds(sec) {
|
|
101587
101733
|
return sec.toFixed(6);
|
|
101588
101734
|
}
|
|
101735
|
+
function sampleRateForFilter(sampleRate) {
|
|
101736
|
+
return sampleRate !== void 0 && Number.isFinite(sampleRate) && sampleRate > 0 ? Math.round(sampleRate) : 48e3;
|
|
101737
|
+
}
|
|
101738
|
+
function channelLayoutForChannels(channels) {
|
|
101739
|
+
if (channels === 1) return "mono";
|
|
101740
|
+
if (channels === 6) return "5.1";
|
|
101741
|
+
if (channels === 8) return "7.1";
|
|
101742
|
+
return "stereo";
|
|
101743
|
+
}
|
|
101744
|
+
function concatFileLine(path2) {
|
|
101745
|
+
const normalized = pathToFileURL2(path2).href;
|
|
101746
|
+
return `file '${normalized.replace(/'/g, "'\\''")}'`;
|
|
101747
|
+
}
|
|
101589
101748
|
async function padOrTrimAudioToVideoFrameCount(input2) {
|
|
101590
101749
|
const probeVideo2 = input2.probeVideoFrameInfo ?? defaultProbeVideoFrameInfo;
|
|
101591
101750
|
const probeAudio = input2.probeAudioInfo ?? defaultProbeAudioInfo;
|
|
@@ -101621,29 +101780,45 @@ async function padOrTrimAudioToVideoFrameCount(input2) {
|
|
|
101621
101780
|
);
|
|
101622
101781
|
}
|
|
101623
101782
|
const targetDurationSeconds = videoInfo.frameCount * videoInfo.fpsDen / videoInfo.fpsNum;
|
|
101624
|
-
const
|
|
101783
|
+
const plan2 = buildPadTrimAudioPlan(
|
|
101625
101784
|
input2.audioPath,
|
|
101626
101785
|
input2.outputPath,
|
|
101627
101786
|
audioInfo.durationSeconds,
|
|
101628
|
-
targetDurationSeconds
|
|
101787
|
+
targetDurationSeconds,
|
|
101788
|
+
audioInfo
|
|
101629
101789
|
);
|
|
101630
|
-
|
|
101631
|
-
|
|
101790
|
+
try {
|
|
101791
|
+
for (const step of plan2.steps) {
|
|
101792
|
+
const ffmpegResult = await runner(step.args, { stdin: step.stdin });
|
|
101793
|
+
if (!ffmpegResult.success) {
|
|
101794
|
+
return {
|
|
101795
|
+
success: false,
|
|
101796
|
+
outputPath: input2.outputPath,
|
|
101797
|
+
targetDurationSeconds,
|
|
101798
|
+
sourceDurationSeconds: audioInfo.durationSeconds,
|
|
101799
|
+
operation: plan2.operation,
|
|
101800
|
+
error: ffmpegResult.error
|
|
101801
|
+
};
|
|
101802
|
+
}
|
|
101803
|
+
}
|
|
101804
|
+
} catch (err) {
|
|
101632
101805
|
return {
|
|
101633
101806
|
success: false,
|
|
101634
101807
|
outputPath: input2.outputPath,
|
|
101635
101808
|
targetDurationSeconds,
|
|
101636
101809
|
sourceDurationSeconds: audioInfo.durationSeconds,
|
|
101637
|
-
operation,
|
|
101638
|
-
error:
|
|
101810
|
+
operation: plan2.operation,
|
|
101811
|
+
error: `audioPadTrim: failed to materialize ${plan2.operation}: ${err instanceof Error ? err.message : String(err)}`
|
|
101639
101812
|
};
|
|
101813
|
+
} finally {
|
|
101814
|
+
for (const path2 of plan2.cleanupPaths) rmSync15(path2, { force: true });
|
|
101640
101815
|
}
|
|
101641
101816
|
return {
|
|
101642
101817
|
success: true,
|
|
101643
101818
|
outputPath: input2.outputPath,
|
|
101644
101819
|
targetDurationSeconds,
|
|
101645
101820
|
sourceDurationSeconds: audioInfo.durationSeconds,
|
|
101646
|
-
operation
|
|
101821
|
+
operation: plan2.operation
|
|
101647
101822
|
};
|
|
101648
101823
|
}
|
|
101649
101824
|
function failResult(outputPath, target, source, error) {
|
|
@@ -101704,9 +101879,15 @@ function parseFrameRate2(rate) {
|
|
|
101704
101879
|
}
|
|
101705
101880
|
async function defaultProbeAudioInfo(audioPath) {
|
|
101706
101881
|
const metadata = await extractAudioMetadata(audioPath);
|
|
101707
|
-
return {
|
|
101882
|
+
return {
|
|
101883
|
+
durationSeconds: metadata.durationSeconds,
|
|
101884
|
+
sampleRate: metadata.sampleRate,
|
|
101885
|
+
channels: metadata.channels,
|
|
101886
|
+
audioCodec: metadata.audioCodec
|
|
101887
|
+
};
|
|
101708
101888
|
}
|
|
101709
|
-
async function defaultRunFfmpeg(args) {
|
|
101889
|
+
async function defaultRunFfmpeg(args, options) {
|
|
101890
|
+
if (options?.stdin !== void 0) return runFfmpegWithStdin(args, options.stdin);
|
|
101710
101891
|
const result = await runFfmpeg(args);
|
|
101711
101892
|
if (result.success) return { success: true };
|
|
101712
101893
|
return {
|
|
@@ -101714,6 +101895,32 @@ async function defaultRunFfmpeg(args) {
|
|
|
101714
101895
|
error: `[audioPadTrim] ${formatFfmpegError(result.exitCode, result.stderr)}`
|
|
101715
101896
|
};
|
|
101716
101897
|
}
|
|
101898
|
+
async function runFfmpegWithStdin(args, stdin) {
|
|
101899
|
+
return new Promise((resolve58) => {
|
|
101900
|
+
const proc = spawn11(getFfmpegBinary(), args);
|
|
101901
|
+
let stderr = "";
|
|
101902
|
+
proc.stderr.on("data", (data2) => {
|
|
101903
|
+
stderr += data2.toString();
|
|
101904
|
+
});
|
|
101905
|
+
proc.on("error", (err) => {
|
|
101906
|
+
resolve58({
|
|
101907
|
+
success: false,
|
|
101908
|
+
error: `[audioPadTrim] ${err instanceof Error ? err.message : String(err)}`
|
|
101909
|
+
});
|
|
101910
|
+
});
|
|
101911
|
+
proc.on("close", (code) => {
|
|
101912
|
+
if (code === 0) {
|
|
101913
|
+
resolve58({ success: true });
|
|
101914
|
+
return;
|
|
101915
|
+
}
|
|
101916
|
+
resolve58({
|
|
101917
|
+
success: false,
|
|
101918
|
+
error: `[audioPadTrim] ${formatFfmpegError(code, stderr)}`
|
|
101919
|
+
});
|
|
101920
|
+
});
|
|
101921
|
+
proc.stdin.end(stdin);
|
|
101922
|
+
});
|
|
101923
|
+
}
|
|
101717
101924
|
function runFfprobeJson(args) {
|
|
101718
101925
|
return new Promise((resolve58, reject) => {
|
|
101719
101926
|
const proc = spawn11(getFfprobeBinary(), args);
|
|
@@ -101761,7 +101968,7 @@ import {
|
|
|
101761
101968
|
mkdirSync as mkdirSync31,
|
|
101762
101969
|
readFileSync as readFileSync39,
|
|
101763
101970
|
readdirSync as readdirSync21,
|
|
101764
|
-
rmSync as
|
|
101971
|
+
rmSync as rmSync16,
|
|
101765
101972
|
statSync as statSync18,
|
|
101766
101973
|
writeFileSync as writeFileSync24
|
|
101767
101974
|
} from "fs";
|
|
@@ -101798,7 +102005,7 @@ async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
|
|
|
101798
102005
|
mkdirSync31(dirname21(outputPath), { recursive: true });
|
|
101799
102006
|
}
|
|
101800
102007
|
const workDir = `${outputPath}.assemble-work`;
|
|
101801
|
-
if (existsSync52(workDir))
|
|
102008
|
+
if (existsSync52(workDir)) rmSync16(workDir, { recursive: true, force: true });
|
|
101802
102009
|
mkdirSync31(workDir, { recursive: true });
|
|
101803
102010
|
try {
|
|
101804
102011
|
const concatOutputPath = join62(workDir, `concat.${plan2.dimensions.format}`);
|
|
@@ -101914,7 +102121,7 @@ async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
|
|
|
101914
102121
|
audioForMux,
|
|
101915
102122
|
muxOutputPath,
|
|
101916
102123
|
abortSignal,
|
|
101917
|
-
|
|
102124
|
+
{ audioCodec: "aac" },
|
|
101918
102125
|
{ num: plan2.dimensions.fpsNum, den: plan2.dimensions.fpsDen }
|
|
101919
102126
|
);
|
|
101920
102127
|
if (!muxResult.success) {
|
|
@@ -101936,7 +102143,7 @@ async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
|
|
|
101936
102143
|
}
|
|
101937
102144
|
} finally {
|
|
101938
102145
|
try {
|
|
101939
|
-
|
|
102146
|
+
rmSync16(workDir, { recursive: true, force: true });
|
|
101940
102147
|
} catch (err) {
|
|
101941
102148
|
log2.warn("[assemble] failed to remove work dir", {
|
|
101942
102149
|
workDir,
|
|
@@ -101953,7 +102160,7 @@ async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
|
|
|
101953
102160
|
};
|
|
101954
102161
|
}
|
|
101955
102162
|
function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, startTimeMs) {
|
|
101956
|
-
if (existsSync52(outputPath))
|
|
102163
|
+
if (existsSync52(outputPath)) rmSync16(outputPath, { recursive: true, force: true });
|
|
101957
102164
|
mkdirSync31(outputPath, { recursive: true });
|
|
101958
102165
|
let globalIdx = 0;
|
|
101959
102166
|
for (const chunkDir of chunkPaths) {
|
|
@@ -104713,7 +104920,7 @@ function buildPresentPage(projectName, islandJson) {
|
|
|
104713
104920
|
<head>
|
|
104714
104921
|
<meta charset="UTF-8" />
|
|
104715
104922
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
104716
|
-
<title>${projectName} \u2014 Presenter</title>
|
|
104923
|
+
<title>${escHtml(projectName)} \u2014 Presenter</title>
|
|
104717
104924
|
<style>
|
|
104718
104925
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
104719
104926
|
html, body { height: 100%; background: #0a0a0a; overflow: hidden; }
|
|
@@ -104732,7 +104939,7 @@ function buildPresentPage(projectName, islandJson) {
|
|
|
104732
104939
|
</head>
|
|
104733
104940
|
<body>
|
|
104734
104941
|
<hyperframes-slideshow tabindex="0" sound>
|
|
104735
|
-
<hyperframes-player src="/composition/index.html"></hyperframes-player>
|
|
104942
|
+
<hyperframes-player interactive src="/composition/index.html"></hyperframes-player>
|
|
104736
104943
|
<script type="application/hyperframes-slideshow+json">
|
|
104737
104944
|
${islandJson}
|
|
104738
104945
|
</script>
|
|
@@ -104780,10 +104987,16 @@ ${islandJson}
|
|
|
104780
104987
|
|
|
104781
104988
|
// Mute state is owned by <hyperframes-slideshow sound>; mirror it.
|
|
104782
104989
|
var muted = false;
|
|
104990
|
+
function setClipsMuted(nextMuted) {
|
|
104991
|
+
Object.keys(clips).forEach(function (name) {
|
|
104992
|
+
clips[name].muted = nextMuted;
|
|
104993
|
+
});
|
|
104994
|
+
}
|
|
104783
104995
|
var ss = document.querySelector("hyperframes-slideshow");
|
|
104784
104996
|
if (ss) {
|
|
104785
104997
|
ss.addEventListener("hf-sound", function (e) {
|
|
104786
104998
|
muted = e.detail && e.detail.muted === true;
|
|
104999
|
+
setClipsMuted(muted);
|
|
104787
105000
|
});
|
|
104788
105001
|
}
|
|
104789
105002
|
|
|
@@ -104834,6 +105047,9 @@ ${islandJson}
|
|
|
104834
105047
|
</body>
|
|
104835
105048
|
</html>`;
|
|
104836
105049
|
}
|
|
105050
|
+
function escHtml(value) {
|
|
105051
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
105052
|
+
}
|
|
104837
105053
|
var examples6, present_default;
|
|
104838
105054
|
var init_present = __esm({
|
|
104839
105055
|
"src/commands/present.ts"() {
|
|
@@ -105877,6 +106093,7 @@ function buildDockerRunArgs(input2) {
|
|
|
105877
106093
|
...options.gifLoop != null ? ["--gif-loop", String(options.gifLoop)] : [],
|
|
105878
106094
|
...options.workers != null ? ["--workers", String(options.workers)] : [],
|
|
105879
106095
|
...options.crf != null ? ["--crf", String(options.crf)] : [],
|
|
106096
|
+
...options.vp9CpuUsed != null ? ["--vp9-cpu-used", String(options.vp9CpuUsed)] : [],
|
|
105880
106097
|
...options.videoBitrate ? ["--video-bitrate", options.videoBitrate] : [],
|
|
105881
106098
|
...options.videoFrameFormat && options.videoFrameFormat !== "auto" ? ["--video-frame-format", options.videoFrameFormat] : [],
|
|
105882
106099
|
...options.quiet ? ["--quiet"] : [],
|
|
@@ -106465,7 +106682,7 @@ __export(render_exports, {
|
|
|
106465
106682
|
renderLocal: () => renderLocal,
|
|
106466
106683
|
resolveBrowserGpuForCli: () => resolveBrowserGpuForCli
|
|
106467
106684
|
});
|
|
106468
|
-
import { mkdirSync as mkdirSync35, readdirSync as readdirSync25, readFileSync as readFileSync48, statSync as statSync21, writeFileSync as writeFileSync28, rmSync as
|
|
106685
|
+
import { mkdirSync as mkdirSync35, readdirSync as readdirSync25, readFileSync as readFileSync48, statSync as statSync21, writeFileSync as writeFileSync28, rmSync as rmSync17 } from "fs";
|
|
106469
106686
|
import { cpus as cpus4, freemem as freemem5, tmpdir as tmpdir5 } from "os";
|
|
106470
106687
|
import { resolve as resolve42, dirname as dirname27, join as join70, basename as basename13 } from "path";
|
|
106471
106688
|
import { execFileSync as execFileSync8, spawn as spawn14 } from "child_process";
|
|
@@ -106557,7 +106774,7 @@ function ensureDockerImage(version2, platform10, quiet) {
|
|
|
106557
106774
|
const message = error instanceof Error ? error.message : String(error);
|
|
106558
106775
|
throw new Error(`Failed to build Docker image: ${message}`);
|
|
106559
106776
|
} finally {
|
|
106560
|
-
|
|
106777
|
+
rmSync17(tmpDir, { recursive: true, force: true });
|
|
106561
106778
|
}
|
|
106562
106779
|
if (!quiet) console.log(c.dim(` Docker image: ${tag} (built)`));
|
|
106563
106780
|
return tag;
|
|
@@ -106619,6 +106836,7 @@ async function renderDocker(projectDir, outputPath, options) {
|
|
|
106619
106836
|
browserGpu: options.browserGpuMode === "hardware",
|
|
106620
106837
|
hdrMode: options.hdrMode,
|
|
106621
106838
|
crf: options.crf,
|
|
106839
|
+
vp9CpuUsed: options.vp9CpuUsed,
|
|
106622
106840
|
videoBitrate: options.videoBitrate,
|
|
106623
106841
|
videoFrameFormat: options.videoFrameFormat,
|
|
106624
106842
|
quiet: options.quiet,
|
|
@@ -106707,7 +106925,8 @@ async function renderLocal(projectDir, outputPath, options) {
|
|
|
106707
106925
|
browserGpuMode: options.browserGpuMode ?? "software",
|
|
106708
106926
|
...options.pageNavigationTimeoutMs != null ? { pageNavigationTimeout: options.pageNavigationTimeoutMs } : {},
|
|
106709
106927
|
...options.protocolTimeout != null && { protocolTimeout: options.protocolTimeout },
|
|
106710
|
-
...options.playerReadyTimeout != null && { playerReadyTimeout: options.playerReadyTimeout }
|
|
106928
|
+
...options.playerReadyTimeout != null && { playerReadyTimeout: options.playerReadyTimeout },
|
|
106929
|
+
...options.vp9CpuUsed != null ? { vp9CpuUsed: options.vp9CpuUsed } : {}
|
|
106711
106930
|
}),
|
|
106712
106931
|
hdrMode: options.hdrMode,
|
|
106713
106932
|
crf: options.crf,
|
|
@@ -107078,6 +107297,10 @@ var init_render2 = __esm({
|
|
|
107078
107297
|
type: "string",
|
|
107079
107298
|
description: "Target video bitrate such as 10M. Mutually exclusive with --crf."
|
|
107080
107299
|
},
|
|
107300
|
+
"vp9-cpu-used": {
|
|
107301
|
+
type: "string",
|
|
107302
|
+
description: "libvpx-vp9 -cpu-used value for WebM encodes (-8 to 8). Higher is faster with a larger quality/size tradeoff. Env: PRODUCER_VP9_CPU_USED."
|
|
107303
|
+
},
|
|
107081
107304
|
gpu: { type: "boolean", description: "Use GPU encoding", default: false },
|
|
107082
107305
|
"browser-gpu": {
|
|
107083
107306
|
type: "boolean",
|
|
@@ -107342,6 +107565,19 @@ var init_render2 = __esm({
|
|
|
107342
107565
|
}
|
|
107343
107566
|
crf = parsed;
|
|
107344
107567
|
}
|
|
107568
|
+
let vp9CpuUsed;
|
|
107569
|
+
if (args["vp9-cpu-used"] != null) {
|
|
107570
|
+
const raw = args["vp9-cpu-used"];
|
|
107571
|
+
const parsed = Number(raw);
|
|
107572
|
+
if (!Number.isInteger(parsed) || parsed < MIN_VP9_CPU_USED || parsed > MAX_VP9_CPU_USED) {
|
|
107573
|
+
errorBox(
|
|
107574
|
+
"Invalid vp9-cpu-used",
|
|
107575
|
+
`Got "${raw}". Must be an integer between ${MIN_VP9_CPU_USED} and ${MAX_VP9_CPU_USED}.`
|
|
107576
|
+
);
|
|
107577
|
+
process.exit(1);
|
|
107578
|
+
}
|
|
107579
|
+
vp9CpuUsed = parsed;
|
|
107580
|
+
}
|
|
107345
107581
|
if (args["video-bitrate"] != null && !videoBitrate) {
|
|
107346
107582
|
errorBox(
|
|
107347
107583
|
"Invalid video-bitrate",
|
|
@@ -107464,6 +107700,7 @@ var init_render2 = __esm({
|
|
|
107464
107700
|
browserGpuMode,
|
|
107465
107701
|
hdrMode,
|
|
107466
107702
|
crf,
|
|
107703
|
+
vp9CpuUsed,
|
|
107467
107704
|
videoBitrate,
|
|
107468
107705
|
quiet: batchQuiet,
|
|
107469
107706
|
browserPath,
|
|
@@ -107511,6 +107748,7 @@ var init_render2 = __esm({
|
|
|
107511
107748
|
browserGpuMode,
|
|
107512
107749
|
hdrMode: args.sdr ? "force-sdr" : args.hdr ? "force-hdr" : "auto",
|
|
107513
107750
|
crf,
|
|
107751
|
+
vp9CpuUsed,
|
|
107514
107752
|
videoBitrate,
|
|
107515
107753
|
videoFrameFormat,
|
|
107516
107754
|
quiet,
|
|
@@ -107534,6 +107772,7 @@ var init_render2 = __esm({
|
|
|
107534
107772
|
browserGpuMode,
|
|
107535
107773
|
hdrMode: args.sdr ? "force-sdr" : args.hdr ? "force-hdr" : "auto",
|
|
107536
107774
|
crf,
|
|
107775
|
+
vp9CpuUsed,
|
|
107537
107776
|
videoBitrate,
|
|
107538
107777
|
videoFrameFormat,
|
|
107539
107778
|
quiet,
|
|
@@ -109953,9 +110192,9 @@ __export(pipeline_exports, {
|
|
|
109953
110192
|
waitForExit: () => waitForExit
|
|
109954
110193
|
});
|
|
109955
110194
|
import { spawn as spawn15 } from "child_process";
|
|
109956
|
-
import { extname as
|
|
110195
|
+
import { extname as extname11 } from "path";
|
|
109957
110196
|
function inferOutputFormat(outputPath) {
|
|
109958
|
-
const ext =
|
|
110197
|
+
const ext = extname11(outputPath).toLowerCase();
|
|
109959
110198
|
if (ext === ".webm") return "webm";
|
|
109960
110199
|
if (ext === ".mov") return "mov";
|
|
109961
110200
|
if (ext === ".png") return "png";
|
|
@@ -109964,7 +110203,7 @@ function inferOutputFormat(outputPath) {
|
|
|
109964
110203
|
);
|
|
109965
110204
|
}
|
|
109966
110205
|
function inferInputKind(inputPath) {
|
|
109967
|
-
const ext =
|
|
110206
|
+
const ext = extname11(inputPath).toLowerCase();
|
|
109968
110207
|
if (VIDEO_EXTENSIONS2.has(ext)) return "video";
|
|
109969
110208
|
if (IMAGE_EXTENSIONS.has(ext)) return "image";
|
|
109970
110209
|
throw new Error(
|
|
@@ -110009,6 +110248,8 @@ function buildEncoderArgs2(format, width, height, fps, outputPath, quality = DEF
|
|
|
110009
110248
|
"good",
|
|
110010
110249
|
"-row-mt",
|
|
110011
110250
|
"1",
|
|
110251
|
+
"-cpu-used",
|
|
110252
|
+
String(DEFAULT_VP9_CPU_USED),
|
|
110012
110253
|
"-auto-alt-ref",
|
|
110013
110254
|
"0",
|
|
110014
110255
|
"-pix_fmt",
|
|
@@ -110064,7 +110305,7 @@ function resolveRenderTargets(inputPath, outputPath, backgroundOutputPath) {
|
|
|
110064
110305
|
const inputKind = inferInputKind(inputPath);
|
|
110065
110306
|
if (inputKind === "image" && format !== "png") {
|
|
110066
110307
|
throw new Error(
|
|
110067
|
-
`Image input requires a .png output (got ${
|
|
110308
|
+
`Image input requires a .png output (got ${extname11(outputPath)}). Use a video input for .webm/.mov.`
|
|
110068
110309
|
);
|
|
110069
110310
|
}
|
|
110070
110311
|
if (inputKind === "video" && format === "png") {
|
|
@@ -110247,6 +110488,7 @@ var init_pipeline = __esm({
|
|
|
110247
110488
|
"use strict";
|
|
110248
110489
|
init_ffmpeg();
|
|
110249
110490
|
init_inference();
|
|
110491
|
+
init_src2();
|
|
110250
110492
|
QUALITY_CRF = {
|
|
110251
110493
|
fast: 30,
|
|
110252
110494
|
balanced: 18,
|
|
@@ -110483,7 +110725,7 @@ __export(transcribe_exports2, {
|
|
|
110483
110725
|
examples: () => examples18
|
|
110484
110726
|
});
|
|
110485
110727
|
import { existsSync as existsSync72, writeFileSync as writeFileSync30 } from "fs";
|
|
110486
|
-
import { resolve as resolve48, join as join78, extname as
|
|
110728
|
+
import { resolve as resolve48, join as join78, extname as extname12, dirname as dirname32 } from "path";
|
|
110487
110729
|
async function importTranscript(inputPath, dir, json) {
|
|
110488
110730
|
const { loadTranscript: loadTranscript2, patchCaptionHtml: patchCaptionHtml2 } = await Promise.resolve().then(() => (init_normalize(), normalize_exports));
|
|
110489
110731
|
const { words, format } = loadTranscript2(inputPath);
|
|
@@ -110619,7 +110861,7 @@ var init_transcribe2 = __esm({
|
|
|
110619
110861
|
process.exit(1);
|
|
110620
110862
|
}
|
|
110621
110863
|
const dir = resolve48(args.dir ?? dirname32(inputPath));
|
|
110622
|
-
const ext =
|
|
110864
|
+
const ext = extname12(inputPath).toLowerCase();
|
|
110623
110865
|
const isImport = ext === ".json" || ext === ".srt" || ext === ".vtt";
|
|
110624
110866
|
if (isImport) {
|
|
110625
110867
|
return importTranscript(inputPath, dir, args.json);
|
|
@@ -110908,7 +111150,7 @@ __export(tts_exports, {
|
|
|
110908
111150
|
examples: () => examples19
|
|
110909
111151
|
});
|
|
110910
111152
|
import { existsSync as existsSync75, readFileSync as readFileSync56 } from "fs";
|
|
110911
|
-
import { resolve as resolve49, extname as
|
|
111153
|
+
import { resolve as resolve49, extname as extname13 } from "path";
|
|
110912
111154
|
function listVoices(json) {
|
|
110913
111155
|
const rows = BUNDLED_VOICES.map((v2) => ({ ...v2, defaultLang: inferLangFromVoiceId(v2.id) }));
|
|
110914
111156
|
if (json) {
|
|
@@ -111017,7 +111259,7 @@ var init_tts = __esm({
|
|
|
111017
111259
|
}
|
|
111018
111260
|
let text;
|
|
111019
111261
|
const maybeFile = resolve49(args.input);
|
|
111020
|
-
if (existsSync75(maybeFile) &&
|
|
111262
|
+
if (existsSync75(maybeFile) && extname13(maybeFile).toLowerCase() === ".txt") {
|
|
111021
111263
|
text = readFileSync56(maybeFile, "utf-8").trim();
|
|
111022
111264
|
if (!text) {
|
|
111023
111265
|
console.error(c.error("File is empty."));
|
|
@@ -111751,8 +111993,9 @@ __export(validate_exports, {
|
|
|
111751
111993
|
import { existsSync as existsSync77, readFileSync as readFileSync58 } from "fs";
|
|
111752
111994
|
import { join as join82, dirname as dirname35 } from "path";
|
|
111753
111995
|
import { fileURLToPath as fileURLToPath13 } from "url";
|
|
111754
|
-
function shouldIgnoreRequestFailure(url, errorText) {
|
|
111996
|
+
function shouldIgnoreRequestFailure(url, errorText, resourceType) {
|
|
111755
111997
|
if (errorText !== "net::ERR_ABORTED") return false;
|
|
111998
|
+
if (resourceType === "media") return true;
|
|
111756
111999
|
try {
|
|
111757
112000
|
return MEDIA_EXTENSIONS.test(new URL(url).pathname);
|
|
111758
112001
|
} catch {
|
|
@@ -111851,7 +112094,7 @@ async function validateInBrowser(projectDir, opts) {
|
|
|
111851
112094
|
const url = req.url();
|
|
111852
112095
|
if (url.includes("favicon") || url.startsWith("data:")) return;
|
|
111853
112096
|
const failureText = req.failure()?.errorText;
|
|
111854
|
-
if (shouldIgnoreRequestFailure(url, failureText)) return;
|
|
112097
|
+
if (shouldIgnoreRequestFailure(url, failureText, req.resourceType())) return;
|
|
111855
112098
|
const path2 = decodeURIComponent(new URL(url).pathname).replace(/^\//, "");
|
|
111856
112099
|
errors.push({
|
|
111857
112100
|
level: "error",
|
|
@@ -111888,6 +112131,63 @@ function printContrastFailures(failures) {
|
|
|
111888
112131
|
);
|
|
111889
112132
|
}
|
|
111890
112133
|
}
|
|
112134
|
+
function emitJsonReport(errors, warnings, contrast, contrastFailures) {
|
|
112135
|
+
console.log(
|
|
112136
|
+
JSON.stringify(
|
|
112137
|
+
withMeta({
|
|
112138
|
+
ok: errors.length === 0,
|
|
112139
|
+
errors,
|
|
112140
|
+
warnings,
|
|
112141
|
+
contrast,
|
|
112142
|
+
contrastFailures: contrastFailures.length
|
|
112143
|
+
}),
|
|
112144
|
+
null,
|
|
112145
|
+
2
|
|
112146
|
+
)
|
|
112147
|
+
);
|
|
112148
|
+
}
|
|
112149
|
+
function formatConsoleEntry(prefix, e3) {
|
|
112150
|
+
return ` ${prefix} ${e3.text}${e3.line ? c.dim(` (line ${e3.line})`) : ""}`;
|
|
112151
|
+
}
|
|
112152
|
+
function formatTotals(errors, warnings, contrastFailures) {
|
|
112153
|
+
const parts = [`${errors.length} error(s)`, `${warnings.length} warning(s)`];
|
|
112154
|
+
if (contrastFailures.length > 0) parts.push(`${contrastFailures.length} contrast warning(s)`);
|
|
112155
|
+
return parts.join(", ");
|
|
112156
|
+
}
|
|
112157
|
+
function emitTextReport(errors, warnings, contrastFailures, contrastPassed) {
|
|
112158
|
+
const hasIssues = errors.length > 0 || warnings.length > 0 || contrastFailures.length > 0;
|
|
112159
|
+
if (!hasIssues) {
|
|
112160
|
+
const suffix = contrastPassed.length > 0 ? ` \xB7 ${contrastPassed.length} text elements pass WCAG AA` : "";
|
|
112161
|
+
console.log(`${c.success("\u25C7")} No console errors${suffix}`);
|
|
112162
|
+
return;
|
|
112163
|
+
}
|
|
112164
|
+
console.log();
|
|
112165
|
+
for (const e3 of errors) console.log(formatConsoleEntry(c.error("\u2717"), e3));
|
|
112166
|
+
for (const w3 of warnings) console.log(formatConsoleEntry(c.warn("\u26A0"), w3));
|
|
112167
|
+
if (contrastFailures.length > 0) printContrastFailures(contrastFailures);
|
|
112168
|
+
console.log();
|
|
112169
|
+
console.log(`${c.accent("\u25C7")} ${formatTotals(errors, warnings, contrastFailures)}`);
|
|
112170
|
+
}
|
|
112171
|
+
function emitFailureReport(message, asJson) {
|
|
112172
|
+
if (asJson) {
|
|
112173
|
+
console.log(
|
|
112174
|
+
JSON.stringify(withMeta({ ok: false, error: message, errors: [], warnings: [] }), null, 2)
|
|
112175
|
+
);
|
|
112176
|
+
return;
|
|
112177
|
+
}
|
|
112178
|
+
console.error(`${c.error("\u2717")} ${message}`);
|
|
112179
|
+
}
|
|
112180
|
+
function printValidationResult(result, asJson) {
|
|
112181
|
+
const { errors, warnings, contrast } = result;
|
|
112182
|
+
const contrastFailures = (contrast ?? []).filter((e3) => !e3.wcagAA);
|
|
112183
|
+
const contrastPassed = (contrast ?? []).filter((e3) => e3.wcagAA);
|
|
112184
|
+
if (asJson) {
|
|
112185
|
+
emitJsonReport(errors, warnings, contrast, contrastFailures);
|
|
112186
|
+
} else {
|
|
112187
|
+
emitTextReport(errors, warnings, contrastFailures, contrastPassed);
|
|
112188
|
+
}
|
|
112189
|
+
return errors.length > 0 ? 1 : 0;
|
|
112190
|
+
}
|
|
111891
112191
|
var __filename2, __dirname3, CONTRAST_SAMPLES, SEEK_SETTLE_MS2, MEDIA_EXTENSIONS, validate_default;
|
|
111892
112192
|
var init_validate = __esm({
|
|
111893
112193
|
"src/commands/validate.ts"() {
|
|
@@ -111931,63 +112231,17 @@ Examples:
|
|
|
111931
112231
|
const project = resolveProject(args.dir);
|
|
111932
112232
|
const timeout = parseInt(args.timeout, 10) || 3e3;
|
|
111933
112233
|
const useContrast = args.contrast ?? true;
|
|
111934
|
-
|
|
112234
|
+
const asJson = Boolean(args.json);
|
|
112235
|
+
if (!asJson) {
|
|
111935
112236
|
console.log(`${c.accent("\u25C6")} Validating ${c.accent(project.name)} in headless Chrome`);
|
|
111936
112237
|
}
|
|
111937
112238
|
try {
|
|
111938
|
-
const
|
|
111939
|
-
|
|
111940
|
-
|
|
111941
|
-
});
|
|
111942
|
-
const contrastFailures = (contrast ?? []).filter((e3) => !e3.wcagAA);
|
|
111943
|
-
const contrastPassed = (contrast ?? []).filter((e3) => e3.wcagAA);
|
|
111944
|
-
if (args.json) {
|
|
111945
|
-
console.log(
|
|
111946
|
-
JSON.stringify(
|
|
111947
|
-
withMeta({
|
|
111948
|
-
ok: errors.length === 0,
|
|
111949
|
-
errors,
|
|
111950
|
-
warnings,
|
|
111951
|
-
contrast,
|
|
111952
|
-
contrastFailures: contrastFailures.length
|
|
111953
|
-
}),
|
|
111954
|
-
null,
|
|
111955
|
-
2
|
|
111956
|
-
)
|
|
111957
|
-
);
|
|
111958
|
-
process.exit(errors.length > 0 ? 1 : 0);
|
|
111959
|
-
}
|
|
111960
|
-
if (errors.length === 0 && warnings.length === 0 && contrastFailures.length === 0) {
|
|
111961
|
-
const suffix = contrastPassed.length > 0 ? ` \xB7 ${contrastPassed.length} text elements pass WCAG AA` : "";
|
|
111962
|
-
console.log(`${c.success("\u25C7")} No console errors${suffix}`);
|
|
111963
|
-
return;
|
|
111964
|
-
}
|
|
111965
|
-
console.log();
|
|
111966
|
-
for (const e3 of errors) {
|
|
111967
|
-
console.log(` ${c.error("\u2717")} ${e3.text}${e3.line ? c.dim(` (line ${e3.line})`) : ""}`);
|
|
111968
|
-
}
|
|
111969
|
-
for (const w3 of warnings) {
|
|
111970
|
-
console.log(` ${c.warn("\u26A0")} ${w3.text}${w3.line ? c.dim(` (line ${w3.line})`) : ""}`);
|
|
111971
|
-
}
|
|
111972
|
-
if (contrastFailures.length > 0) printContrastFailures(contrastFailures);
|
|
111973
|
-
console.log();
|
|
111974
|
-
const parts = [`${errors.length} error(s)`, `${warnings.length} warning(s)`];
|
|
111975
|
-
if (contrastFailures.length > 0) parts.push(`${contrastFailures.length} contrast warning(s)`);
|
|
111976
|
-
console.log(`${c.accent("\u25C7")} ${parts.join(", ")}`);
|
|
111977
|
-
process.exit(errors.length > 0 ? 1 : 0);
|
|
112239
|
+
const result = await validateInBrowser(project.dir, { timeout, contrast: useContrast });
|
|
112240
|
+
const exitCode = printValidationResult(result, asJson);
|
|
112241
|
+
process.exit(exitCode);
|
|
111978
112242
|
} catch (err) {
|
|
111979
112243
|
const message = err instanceof Error ? err.message : String(err);
|
|
111980
|
-
|
|
111981
|
-
console.log(
|
|
111982
|
-
JSON.stringify(
|
|
111983
|
-
withMeta({ ok: false, error: message, errors: [], warnings: [] }),
|
|
111984
|
-
null,
|
|
111985
|
-
2
|
|
111986
|
-
)
|
|
111987
|
-
);
|
|
111988
|
-
process.exit(1);
|
|
111989
|
-
}
|
|
111990
|
-
console.error(`${c.error("\u2717")} ${message}`);
|
|
112244
|
+
emitFailureReport(message, asJson);
|
|
111991
112245
|
process.exit(1);
|
|
111992
112246
|
}
|
|
111993
112247
|
}
|
|
@@ -112006,7 +112260,7 @@ __export(contactSheet_exports, {
|
|
|
112006
112260
|
});
|
|
112007
112261
|
import sharp from "sharp";
|
|
112008
112262
|
import { readdirSync as readdirSync29, readFileSync as readFileSync59, writeFileSync as writeFileSync32, unlinkSync as unlinkSync8, existsSync as existsSync78 } from "fs";
|
|
112009
|
-
import { join as join83, extname as
|
|
112263
|
+
import { join as join83, extname as extname14, basename as basename16, dirname as dirname36 } from "path";
|
|
112010
112264
|
async function createContactSheet(imagePaths, outputPath, opts = {}) {
|
|
112011
112265
|
const {
|
|
112012
112266
|
cols = 3,
|
|
@@ -112039,7 +112293,7 @@ async function createContactSheet(imagePaths, outputPath, opts = {}) {
|
|
|
112039
112293
|
overlays.push({ input: resized, left: x3, top: y + labelH });
|
|
112040
112294
|
let labelText = `${i2 + 1}`;
|
|
112041
112295
|
if (labelMode === "filename") {
|
|
112042
|
-
labelText = `${i2 + 1}. ${basename16(files[i2]).replace(
|
|
112296
|
+
labelText = `${i2 + 1}. ${basename16(files[i2]).replace(extname14(files[i2]), "")}`;
|
|
112043
112297
|
} else if (labelMode === "custom" && labels?.[i2]) {
|
|
112044
112298
|
labelText = `${i2 + 1}. ${labels[i2]}`;
|
|
112045
112299
|
}
|
|
@@ -112121,7 +112375,7 @@ async function createSnapshotContactSheet(snapshotsDir, outputPath) {
|
|
|
112121
112375
|
async function createAssetContactSheet(assetsDir, outputPath) {
|
|
112122
112376
|
if (!existsSync78(assetsDir)) return [];
|
|
112123
112377
|
const imageExts = /* @__PURE__ */ new Set([".png", ".jpg", ".jpeg", ".webp"]);
|
|
112124
|
-
const assetFiles = readdirSync29(assetsDir).filter((f3) => imageExts.has(
|
|
112378
|
+
const assetFiles = readdirSync29(assetsDir).filter((f3) => imageExts.has(extname14(f3).toLowerCase()) && !f3.includes("contact-sheet")).sort();
|
|
112125
112379
|
if (assetFiles.length === 0) return [];
|
|
112126
112380
|
const paths = assetFiles.map((f3) => join83(assetsDir, f3));
|
|
112127
112381
|
return createContactSheetPages(paths, outputPath, {
|
|
@@ -151934,7 +152188,7 @@ __export(snapshot_exports, {
|
|
|
151934
152188
|
examples: () => examples25
|
|
151935
152189
|
});
|
|
151936
152190
|
import { spawn as spawn16 } from "child_process";
|
|
151937
|
-
import { existsSync as existsSync79, mkdtempSync as mkdtempSync5, readFileSync as readFileSync60, mkdirSync as mkdirSync40, rmSync as
|
|
152191
|
+
import { existsSync as existsSync79, mkdtempSync as mkdtempSync5, readFileSync as readFileSync60, mkdirSync as mkdirSync40, rmSync as rmSync18, writeFileSync as writeFileSync33 } from "fs";
|
|
151938
152192
|
import { tmpdir as tmpdir6 } from "os";
|
|
151939
152193
|
import { resolve as resolve51, join as join84, relative as relative14, isAbsolute as isAbsolute12 } from "path";
|
|
151940
152194
|
async function extractVideoFrameToBuffer(videoPath, timeSeconds, useVp9AlphaDecoder = false) {
|
|
@@ -151985,7 +152239,7 @@ async function extractVideoFrameToBuffer(videoPath, timeSeconds, useVp9AlphaDeco
|
|
|
151985
152239
|
return readFileSync60(outPath);
|
|
151986
152240
|
} finally {
|
|
151987
152241
|
try {
|
|
151988
|
-
|
|
152242
|
+
rmSync18(tmp, { recursive: true, force: true });
|
|
151989
152243
|
} catch {
|
|
151990
152244
|
}
|
|
151991
152245
|
}
|
|
@@ -152086,7 +152340,7 @@ async function captureSnapshots(projectDir, opts) {
|
|
|
152086
152340
|
const { readdirSync: readdirSync35 } = await import("fs");
|
|
152087
152341
|
for (const file of readdirSync35(snapshotDir)) {
|
|
152088
152342
|
if (/\.(png|jpg|jpeg)$/i.test(file)) {
|
|
152089
|
-
|
|
152343
|
+
rmSync18(join84(snapshotDir, file), { force: true });
|
|
152090
152344
|
}
|
|
152091
152345
|
}
|
|
152092
152346
|
} catch {
|
|
@@ -152378,7 +152632,7 @@ ${c.error("\u2717")} Snapshot failed: ${msg}`);
|
|
|
152378
152632
|
|
|
152379
152633
|
// src/capture/assetDownloader.ts
|
|
152380
152634
|
import { writeFileSync as writeFileSync34, mkdirSync as mkdirSync41 } from "fs";
|
|
152381
|
-
import { join as join85, extname as
|
|
152635
|
+
import { join as join85, extname as extname15 } from "path";
|
|
152382
152636
|
import { createHash as createHash12 } from "crypto";
|
|
152383
152637
|
function svgContentHashSlug(svgSource, isLogo) {
|
|
152384
152638
|
const hash2 = createHash12("sha1").update(svgSource).digest("hex").slice(0, 8);
|
|
@@ -152413,7 +152667,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
|
|
|
152413
152667
|
for (const icon of faviconLinks || []) {
|
|
152414
152668
|
if (!icon.href) continue;
|
|
152415
152669
|
try {
|
|
152416
|
-
const ext =
|
|
152670
|
+
const ext = extname15(new URL(icon.href).pathname) || ".ico";
|
|
152417
152671
|
const name = `favicon${ext}`;
|
|
152418
152672
|
const localPath = `assets/${name}`;
|
|
152419
152673
|
const buffer = await fetchBuffer(icon.href);
|
|
@@ -152457,7 +152711,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
|
|
|
152457
152711
|
const results = await Promise.allSettled(
|
|
152458
152712
|
batch.map(async ({ url, isPoster, catalog }) => {
|
|
152459
152713
|
const parsedUrl = new URL(url);
|
|
152460
|
-
const pathExt =
|
|
152714
|
+
const pathExt = extname15(parsedUrl.pathname);
|
|
152461
152715
|
const ext = pathExt && pathExt.length <= 5 ? pathExt : ".jpg";
|
|
152462
152716
|
const buffer = await fetchBuffer(url);
|
|
152463
152717
|
if (!buffer) return null;
|
|
@@ -152492,7 +152746,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
|
|
|
152492
152746
|
}
|
|
152493
152747
|
if (tokens.ogImage && !downloadedUrls.has(normalizeUrl(tokens.ogImage))) {
|
|
152494
152748
|
try {
|
|
152495
|
-
const ext =
|
|
152749
|
+
const ext = extname15(new URL(tokens.ogImage).pathname) || ".jpg";
|
|
152496
152750
|
const localPath = `assets/og-image${ext}`;
|
|
152497
152751
|
const buffer = await fetchBuffer(tokens.ogImage);
|
|
152498
152752
|
if (buffer && buffer.length > 5e3) {
|
|
@@ -154226,7 +154480,7 @@ var init_animationCataloger = __esm({
|
|
|
154226
154480
|
|
|
154227
154481
|
// src/capture/mediaCapture.ts
|
|
154228
154482
|
import { mkdirSync as mkdirSync43, writeFileSync as writeFileSync36, readdirSync as readdirSync31, readFileSync as readFileSync63, statSync as statSync25 } from "fs";
|
|
154229
|
-
import { join as join88, extname as
|
|
154483
|
+
import { join as join88, extname as extname16 } from "path";
|
|
154230
154484
|
async function saveLottieAnimations(discoveredLotties, lottieDir) {
|
|
154231
154485
|
let savedCount = 0;
|
|
154232
154486
|
const savedHashes = /* @__PURE__ */ new Set();
|
|
@@ -154365,7 +154619,7 @@ async function downloadVideoBody(srcUrl, filename, videosDir) {
|
|
|
154365
154619
|
if (isPrivateUrl(srcUrl)) return null;
|
|
154366
154620
|
let ext = "";
|
|
154367
154621
|
try {
|
|
154368
|
-
ext =
|
|
154622
|
+
ext = extname16(new URL(srcUrl).pathname).toLowerCase();
|
|
154369
154623
|
} catch {
|
|
154370
154624
|
return null;
|
|
154371
154625
|
}
|
|
@@ -156309,7 +156563,7 @@ __export(state_exports, {
|
|
|
156309
156563
|
stateFilePath: () => stateFilePath,
|
|
156310
156564
|
writeStackOutputs: () => writeStackOutputs
|
|
156311
156565
|
});
|
|
156312
|
-
import { existsSync as existsSync86, mkdirSync as mkdirSync46, readdirSync as readdirSync34, readFileSync as readFileSync66, rmSync as
|
|
156566
|
+
import { existsSync as existsSync86, mkdirSync as mkdirSync46, readdirSync as readdirSync34, readFileSync as readFileSync66, rmSync as rmSync19, writeFileSync as writeFileSync41 } from "fs";
|
|
156313
156567
|
import { dirname as dirname37, join as join94 } from "path";
|
|
156314
156568
|
function stateFilePath(stackName = DEFAULT_STACK_NAME, cwd = process.cwd()) {
|
|
156315
156569
|
return join94(cwd, STATE_DIR_NAME, `${STATE_FILE_PREFIX}${stackName}.json`);
|
|
@@ -156331,7 +156585,7 @@ function readStackOutputs(stackName = DEFAULT_STACK_NAME, cwd = process.cwd()) {
|
|
|
156331
156585
|
}
|
|
156332
156586
|
function deleteStackOutputs(stackName = DEFAULT_STACK_NAME, cwd = process.cwd()) {
|
|
156333
156587
|
const path2 = stateFilePath(stackName, cwd);
|
|
156334
|
-
if (existsSync86(path2))
|
|
156588
|
+
if (existsSync86(path2)) rmSync19(path2);
|
|
156335
156589
|
}
|
|
156336
156590
|
function listStackNames(cwd = process.cwd()) {
|
|
156337
156591
|
const dir = join94(cwd, STATE_DIR_NAME);
|