hyperframes 0.4.36 → 0.4.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -54,7 +54,7 @@ var VERSION;
54
54
  var init_version = __esm({
55
55
  "src/version.ts"() {
56
56
  "use strict";
57
- VERSION = true ? "0.4.36" : "0.0.0-dev";
57
+ VERSION = true ? "0.4.38" : "0.0.0-dev";
58
58
  }
59
59
  });
60
60
 
@@ -4200,7 +4200,15 @@ function buildLintContext(html, options = {}) {
4200
4200
  const templateMatch = source.match(/<template[^>]*>([\s\S]*)<\/template>/i);
4201
4201
  if (templateMatch?.[1]) source = templateMatch[1];
4202
4202
  const tags = extractOpenTags(source);
4203
- const styles = extractBlocks(source, STYLE_BLOCK_PATTERN);
4203
+ const styles = [
4204
+ ...extractBlocks(source, STYLE_BLOCK_PATTERN),
4205
+ ...(options.externalStyles ?? []).map((style) => ({
4206
+ attrs: `href="${style.href}"`,
4207
+ content: style.content,
4208
+ raw: style.content,
4209
+ index: -1
4210
+ }))
4211
+ ];
4204
4212
  const scripts = extractBlocks(source, SCRIPT_BLOCK_PATTERN);
4205
4213
  const compositionIds = collectCompositionIds(tags);
4206
4214
  const rootTag = findRootTag(source);
@@ -4225,6 +4233,16 @@ var init_context = __esm({
4225
4233
  });
4226
4234
 
4227
4235
  // ../core/src/lint/rules/core.ts
4236
+ import postcss from "postcss";
4237
+ function escapeRegExp(value) {
4238
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4239
+ }
4240
+ function selectorTargetsCompositionId(selector, compositionId) {
4241
+ const escaped = escapeRegExp(compositionId);
4242
+ return new RegExp(
4243
+ String.raw`\[\s*data-composition-id\s*=\s*(?:"${escaped}"|'${escaped}')\s*\]`
4244
+ ).test(selector);
4245
+ }
4228
4246
  var coreRules;
4229
4247
  var init_core = __esm({
4230
4248
  "../core/src/lint/rules/core.ts"() {
@@ -4372,6 +4390,36 @@ var init_core = __esm({
4372
4390
  }
4373
4391
  return findings;
4374
4392
  },
4393
+ // composition_self_attribute_selector
4394
+ ({ styles, rootCompositionId, rootTag }) => {
4395
+ const findings = [];
4396
+ if (!rootCompositionId) return findings;
4397
+ const seenSelectors = /* @__PURE__ */ new Set();
4398
+ const rootId = readAttr(rootTag?.raw || "", "id");
4399
+ for (const style of styles) {
4400
+ let root;
4401
+ try {
4402
+ root = postcss.parse(style.content);
4403
+ } catch {
4404
+ continue;
4405
+ }
4406
+ root.walkRules((rule) => {
4407
+ for (const selector of rule.selectors) {
4408
+ if (!selectorTargetsCompositionId(selector, rootCompositionId)) continue;
4409
+ if (seenSelectors.has(selector)) continue;
4410
+ seenSelectors.add(selector);
4411
+ findings.push({
4412
+ code: "composition_self_attribute_selector",
4413
+ severity: "warning",
4414
+ message: "Selector matches the block's own id; will leak to sibling instances when the block is embedded twice.",
4415
+ selector,
4416
+ fixHint: rootId ? `Use #${rootId} for clearer authoring intent and instance-isolated styling.` : "Add a stable id to the composition root and use that id selector for clearer authoring intent and instance-isolated styling."
4417
+ });
4418
+ }
4419
+ });
4420
+ }
4421
+ return findings;
4422
+ },
4375
4423
  // non_deterministic_code
4376
4424
  ({ scripts }) => {
4377
4425
  const findings = [];
@@ -4423,11 +4471,11 @@ var init_core = __esm({
4423
4471
  });
4424
4472
 
4425
4473
  // ../core/src/lint/rules/media.ts
4426
- function escapeRegExp(value) {
4474
+ function escapeRegExp2(value) {
4427
4475
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4428
4476
  }
4429
4477
  function hasAttrName(tagSource, attr) {
4430
- const escaped = escapeRegExp(attr);
4478
+ const escaped = escapeRegExp2(attr);
4431
4479
  const attrs = tagSource.replace(/^<\s*[a-z][\w:-]*/i, "");
4432
4480
  return new RegExp(`(?:^|\\s)${escaped}(?:\\s*=|\\s|/?>)`, "i").test(attrs);
4433
4481
  }
@@ -4441,13 +4489,13 @@ function selectorTargetsManagedMedia(selector, mediaIndex) {
4441
4489
  if (mediaIndex.hasVideo && /\bvideo\b/i.test(normalized)) return true;
4442
4490
  if (mediaIndex.hasAudio && /\baudio\b/i.test(normalized)) return true;
4443
4491
  for (const mediaId of mediaIndex.ids) {
4444
- const escapedId = escapeRegExp(mediaId);
4492
+ const escapedId = escapeRegExp2(mediaId);
4445
4493
  if (new RegExp(`#${escapedId}(?![\\w-])`).test(normalized) || normalized.includes(`[id="${mediaId}"]`) || normalized.includes(`[id='${mediaId}']`)) {
4446
4494
  return true;
4447
4495
  }
4448
4496
  }
4449
4497
  for (const className of mediaIndex.classes) {
4450
- if (new RegExp(`\\.${escapeRegExp(className)}(?![\\w-])`).test(normalized)) {
4498
+ if (new RegExp(`\\.${escapeRegExp2(className)}(?![\\w-])`).test(normalized)) {
4451
4499
  return true;
4452
4500
  }
4453
4501
  }
@@ -4550,7 +4598,7 @@ function findImperativeMediaControlFindings(ctx) {
4550
4598
  }
4551
4599
  }
4552
4600
  for (const [variableName, elementId] of mediaVars) {
4553
- const escapedVar = escapeRegExp(variableName);
4601
+ const escapedVar = escapeRegExp2(variableName);
4554
4602
  const variablePatterns = [
4555
4603
  { pattern: new RegExp(`\\b${escapedVar}\\.play\\s*\\(`, "g"), kind: "play()" },
4556
4604
  { pattern: new RegExp(`\\b${escapedVar}\\.pause\\s*\\(`, "g"), kind: "pause()" },
@@ -5617,6 +5665,14 @@ function countPhysicalLines(source) {
5617
5665
  const withoutFinalNewline = normalized.endsWith("\n") ? normalized.slice(0, -1) : normalized;
5618
5666
  return withoutFinalNewline.split("\n").length;
5619
5667
  }
5668
+ function isRegistrySourceFile(filePath) {
5669
+ if (!filePath) return false;
5670
+ const normalized = filePath.replace(/\\/g, "/");
5671
+ return /(?:^|\/)registry\/blocks\/([^/]+)\/\1\.html$/i.test(normalized);
5672
+ }
5673
+ function isRegistryInstalledFile(rawSource) {
5674
+ return /^\s*<!--\s*hyperframes-registry-item:[^>]*-->/i.test(rawSource.slice(0, 512));
5675
+ }
5620
5676
  function isCompositionRootOrMount(rawTag) {
5621
5677
  return Boolean(
5622
5678
  readAttr(rawTag, "data-composition-id") || readAttr(rawTag, "data-composition-src")
@@ -5633,6 +5689,7 @@ var init_composition = __esm({
5633
5689
  compositionRules = [
5634
5690
  // composition_file_too_large
5635
5691
  ({ rawSource, options }) => {
5692
+ if (isRegistrySourceFile(options.filePath) || isRegistryInstalledFile(rawSource)) return [];
5636
5693
  const lineCount = countPhysicalLines(rawSource);
5637
5694
  if (lineCount <= MAX_COMPOSITION_LINES) return [];
5638
5695
  const splitTarget = options.isSubComposition ? "Split this sub-composition further into smaller .html files" : "Split coherent scenes or layers into separate .html files under compositions/";
@@ -6244,7 +6301,7 @@ var RUNTIME_IIFE;
6244
6301
  var init_runtime_inline = __esm({
6245
6302
  "../core/src/generated/runtime-inline.ts"() {
6246
6303
  "use strict";
6247
- RUNTIME_IIFE = '"use strict";(()=>{var No=Object.create;var Jn=Object.defineProperty;var wo=Object.getOwnPropertyDescriptor;var Co=Object.getOwnPropertyNames;var Mo=Object.getPrototypeOf,Do=Object.prototype.hasOwnProperty;var K=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var ko=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Co(e))!Do.call(n,r)&&r!==t&&Jn(n,r,{get:()=>e[r],enumerable:!(i=wo(e,r))||i.enumerable});return n};var Lo=(n,e,t)=>(t=n!=null?No(Mo(n)):{},ko(e||!n||!n.__esModule?Jn(t,"default",{value:n,enumerable:!0}):t,n));var hi=K((ja,ln)=>{var q=String,pi=function(){return{isColorSupported:!1,reset:q,bold:q,dim:q,italic:q,underline:q,inverse:q,hidden:q,strikethrough:q,black:q,red:q,green:q,yellow:q,blue:q,magenta:q,cyan:q,white:q,gray:q,bgBlack:q,bgRed:q,bgGreen:q,bgYellow:q,bgBlue:q,bgMagenta:q,bgCyan:q,bgWhite:q,blackBright:q,redBright:q,greenBright:q,yellowBright:q,blueBright:q,magentaBright:q,cyanBright:q,whiteBright:q,bgBlackBright:q,bgRedBright:q,bgGreenBright:q,bgYellowBright:q,bgBlueBright:q,bgMagentaBright:q,bgCyanBright:q,bgWhiteBright:q}};ln.exports=pi();ln.exports.createColors=pi});var an=K(()=>{});var kt=K((Va,Si)=>{"use strict";var xi=hi(),gi=an(),ot=class n extends Error{constructor(e,t,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 t<"u"&&typeof i<"u"&&(typeof t=="number"?(this.line=t,this.column=i):(this.line=t.line,this.column=t.column,this.endLine=i.line,this.endColumn=i.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}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 t=this.source;e==null&&(e=xi.isColorSupported);let i=l=>l,r=l=>l,o=l=>l;if(e){let{bold:l,gray:f,red:m}=xi.createColors(!0);r=h=>l(m(h)),i=h=>f(h),gi&&(o=h=>gi(h))}let s=t.split(/\\r?\\n/),c=Math.max(this.line-3,0),u=Math.min(this.line+2,s.length),a=String(u).length;return s.slice(c,u).map((l,f)=>{let m=c+1+f,h=" "+(" "+m).slice(-a)+" | ";if(m===this.line){if(l.length>160){let C=20,A=Math.max(0,this.column-C),z=Math.max(this.column+C,this.endColumn+C),P=l.slice(A,z),k=i(h.replace(/\\d/g," "))+l.slice(0,Math.min(this.column-1,C-1)).replace(/[^\\t]/g," ");return r(">")+i(h)+o(P)+`\n `+k+r("^")}let M=i(h.replace(/\\d/g," "))+l.slice(0,this.column-1).replace(/[^\\t]/g," ");return r(">")+i(h)+o(l)+`\n `+M+r("^")}return" "+i(h)+o(l)}).join(`\n`)}toString(){let e=this.showSourceCode();return e&&(e=`\n\n`+e+`\n`),this.name+": "+this.message+e}};Si.exports=ot;ot.default=ot});var un=K((Ka,Ai)=>{"use strict";var yi={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function $o(n){return n[0].toUpperCase()+n.slice(1)}var st=class{constructor(e){this.builder=e}atrule(e,t){let i="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?i+=e.raws.afterName:r&&(i+=" "),e.nodes)this.block(e,i+r);else{let o=(e.raws.between||"")+(t?";":"");this.builder(i+r+o,e)}}beforeAfter(e,t){let i;e.type==="decl"?i=this.raw(e,null,"beforeDecl"):e.type==="comment"?i=this.raw(e,null,"beforeComment"):t==="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 c=0;c<o;c++)i+=s}return i}block(e,t){let i=this.raw(e,"between","beforeOpen");this.builder(t+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(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let i=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let o=e.nodes[r],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,t!==r||i)}}comment(e){let t=this.raw(e,"left","commentLeft"),i=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+i+"*/",e)}decl(e,t){let i=this.raw(e,"between","colon"),r=e.prop+i+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,i){let r;if(i||(i=t),t&&(r=e.raws[t],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 yi[i];let s=e.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[i]<"u")return s.rawCache[i];if(i==="before"||i==="after")return this.beforeAfter(e,i);{let c="raw"+$o(i);this[c]?r=this[c](s,e):s.walk(u=>{if(r=u.raws[t],typeof r<"u")return!1})}return typeof r>"u"&&(r=yi[i]),s.rawCache[i]=r,r}rawBeforeClose(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length>0&&typeof i.raws.after<"u")return t=i.raws.after,t.includes(`\n`)&&(t=t.replace(/[^\\n]+$/,"")),!1}),t&&(t=t.replace(/\\S/g,"")),t}rawBeforeComment(e,t){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(t,null,"beforeDecl"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeDecl(e,t){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(t,null,"beforeRule"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeOpen(e){let t;return e.walk(i=>{if(i.type!=="decl"&&(t=i.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(i=>{if(i.nodes&&(i.parent!==e||e.first!==i)&&typeof i.raws.before<"u")return t=i.raws.before,t.includes(`\n`)&&(t=t.replace(/[^\\n]+$/,"")),!1}),t&&(t=t.replace(/\\S/g,"")),t}rawColon(e){let t;return e.walkDecls(i=>{if(typeof i.raws.between<"u")return t=i.raws.between.replace(/[^\\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length===0&&(t=i.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;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 t=o[o.length-1],t=t.replace(/\\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(t=i.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let i=e[t],r=e.raws[t];return r&&r.value===i?r.raw:i}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};Ai.exports=st;st.default=st});var lt=K((Ja,Ei)=>{"use strict";var Vo=un();function cn(n,e){new Vo(e).stringify(n)}Ei.exports=cn;cn.default=cn});var Lt=K((Qa,dn)=>{"use strict";dn.exports.isClean=Symbol("isClean");dn.exports.my=Symbol("my")});var ct=K((Ya,Fi)=>{"use strict";var Ko=kt(),Jo=un(),Qo=lt(),{isClean:at,my:Yo}=Lt();function fn(n,e){let t=new n.constructor;for(let i in n){if(!Object.prototype.hasOwnProperty.call(n,i)||i==="proxyCache")continue;let r=n[i],o=typeof r;i==="parent"&&o==="object"?e&&(t[i]=e):i==="source"?t[i]=r:Array.isArray(r)?t[i]=r.map(s=>fn(s,t)):(o==="object"&&r!==null&&(r=fn(r)),t[i]=r)}return t}function ke(n,e){if(e&&typeof e.offset<"u")return e.offset;let t=1,i=1,r=0;for(let o=0;o<n.length;o++){if(i===e.line&&t===e.column){r=o;break}n[o]===`\n`?(t=1,i+=1):t+=1}return r}var ut=class{get proxyOf(){return this}constructor(e={}){this.raws={},this[at]=!1,this[Yo]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let i of e[t])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\\n\\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\\n\\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];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 t=fn(this);for(let i in e)t[i]=e[i];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:i,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:i.column,line:i.line},t)}return new Ko(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,i){return e[t]===i||(e[t]=i,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markClean(){this[at]=!0}markDirty(){if(this[at]){this[at]=!1;let e=this;for(;e=e.parent;)e[at]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=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(ke(i,this.source.start),ke(i,this.source.end)).indexOf(e.word);o!==-1&&(t=this.positionInside(o))}return t}positionInside(e){let t=this.source.start.column,i=this.source.start.line,r="document"in this.source.input?this.source.input.document:this.source.input.css,o=ke(r,this.source.start),s=o+e;for(let c=o;c<s;c++)r[c]===`\n`?(t=1,i+=1):t+=1;return{column:t,line:i,offset:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="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:ke(t,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:ke(t,this.source.end)+1}:{column:i.column+1,line:i.line,offset:i.offset+1};if(e.word){let s=t.slice(ke(t,this.source.start),ke(t,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:ke(t,e.start)}:e.index&&(i=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line,offset:ke(t,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,t){return new Jo().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,i=!1;for(let r of e)r===this?i=!0:i?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);i||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let i={},r=t==null;t=t||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let c=this[s];if(Array.isArray(c))i[s]=c.map(u=>typeof u=="object"&&u.toJSON?u.toJSON(null,t):u);else if(typeof c=="object"&&c.toJSON)i[s]=c.toJSON(null,t);else if(s==="source"){if(c==null)continue;let u=t.get(c.input);u==null&&(u=o,t.set(c.input,o),o++),i[s]={end:c.end,inputId:u,start:c.start}}else i[s]=c}return r&&(i.inputs=[...t.keys()].map(s=>s.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Qo){e.stringify&&(e=e.stringify);let t="";return e(this,i=>{t+=i}),t}warn(e,t,i={}){let r={node:this};for(let o in i)r[o]=i[o];return e.warn(t,r)}};Fi.exports=ut;ut.default=ut});var ft=K((Za,bi)=>{"use strict";var Zo=ct(),dt=class extends Zo{constructor(e){super(e),this.type="comment"}};bi.exports=dt;dt.default=dt});var pt=K((Xa,Ni)=>{"use strict";var Xo=ct(),mt=class extends Xo{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"}};Ni.exports=mt;mt.default=mt});var ve=K((eu,vi)=>{"use strict";var wi=ft(),Ci=pt(),es=ct(),{isClean:Mi,my:Di}=Lt(),mn,ki,Li,pn;function Ri(n){return n.map(e=>(e.nodes&&(e.nodes=Ri(e.nodes)),delete e.source,e))}function Ti(n){if(n[Mi]=!1,n.proxyOf.nodes)for(let e of n.proxyOf.nodes)Ti(e)}var Ce=class n extends es{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 t of e){let i=this.normalize(t,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 t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),i,r;for(;this.indexes[t]<this.proxyOf.nodes.length&&(i=this.indexes[t],r=e(this.proxyOf.nodes[i],i),r!==!1);)this.indexes[t]+=1;return delete this.indexes[t],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,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...i)=>e[t](...i.map(r=>typeof r=="function"?(o,s)=>r(o.toProxy(),s):r)):t==="every"||t==="some"?i=>e[t]((r,...o)=>i(r.toProxy(),...o)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(i=>i.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,i){return e[t]===i||(e[t]=i,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let i=this.index(e),r=this.normalize(t,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,t){let i=this.index(e),r=i===0?"prepend":!1,o=this.normalize(t,this.proxyOf.nodes[i],r).reverse();i=this.index(e);for(let c of o)this.proxyOf.nodes.splice(i,0,c);let s;for(let c in this.indexes)s=this.indexes[c],i<=s&&(this.indexes[c]=s+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=Ri(ki(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 Ci(e)]}else if(e.selector||e.selectors)e=[new pn(e)];else if(e.name)e=[new mn(e)];else if(e.text)e=[new wi(e)];else throw new Error("Unknown node type in node creation");return e.map(r=>(r[Di]||n.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[Mi]&&Ti(r),r.raws||(r.raws={}),typeof r.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(r.raws.before=t.raws.before.replace(/\\S/g,"")),r.parent=this.proxyOf,r))}prepend(...e){e=e.reverse();for(let t of e){let i=this.normalize(t,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 t;for(let i in this.indexes)t=this.indexes[i],t>=e&&(this.indexes[i]=t-1);return this.markDirty(),this}replaceValues(e,t,i){return i||(i=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,i))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,i)=>{let r;try{r=e(t,i)}catch(o){throw t.addToError(o)}return r!==!1&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="atrule"&&e.test(i.name))return t(i,r)}):this.walk((i,r)=>{if(i.type==="atrule"&&i.name===e)return t(i,r)}):(t=e,this.walk((i,r)=>{if(i.type==="atrule")return t(i,r)}))}walkComments(e){return this.walk((t,i)=>{if(t.type==="comment")return e(t,i)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="decl"&&e.test(i.prop))return t(i,r)}):this.walk((i,r)=>{if(i.type==="decl"&&i.prop===e)return t(i,r)}):(t=e,this.walk((i,r)=>{if(i.type==="decl")return t(i,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="rule"&&e.test(i.selector))return t(i,r)}):this.walk((i,r)=>{if(i.type==="rule"&&i.selector===e)return t(i,r)}):(t=e,this.walk((i,r)=>{if(i.type==="rule")return t(i,r)}))}};Ce.registerParse=n=>{ki=n};Ce.registerRule=n=>{pn=n};Ce.registerAtRule=n=>{mn=n};Ce.registerRoot=n=>{Li=n};vi.exports=Ce;Ce.default=Ce;Ce.rebuild=n=>{n.type==="atrule"?Object.setPrototypeOf(n,mn.prototype):n.type==="rule"?Object.setPrototypeOf(n,pn.prototype):n.type==="decl"?Object.setPrototypeOf(n,Ci.prototype):n.type==="comment"?Object.setPrototypeOf(n,wi.prototype):n.type==="root"&&Object.setPrototypeOf(n,Li.prototype),n[Di]=!0,n.nodes&&n.nodes.forEach(e=>{Ce.rebuild(e)})}});var Rt=K((tu,Oi)=>{"use strict";var Bi=ve(),$e=class extends Bi{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)}};Oi.exports=$e;$e.default=$e;Bi.registerAtRule($e)});var Tt=K((nu,Ii)=>{"use strict";var ts=ve(),Pi,_i,Ue=class extends ts{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Pi(new _i,this,e).stringify()}};Ue.registerLazyResult=n=>{Pi=n};Ue.registerProcessor=n=>{_i=n};Ii.exports=Ue;Ue.default=Ue});var Hi=K((iu,Wi)=>{var ns="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",is=(n,e=21)=>(t=e)=>{let i="",r=t|0;for(;r--;)i+=n[Math.random()*n.length|0];return i},rs=(n=21)=>{let e="",t=n|0;for(;t--;)e+=ns[Math.random()*64|0];return e};Wi.exports={nanoid:rs,customAlphabet:is}});var vt=K(()=>{});var Bt=K(()=>{});var hn=K(()=>{});var Ui=K(()=>{});var gn=K((fu,ji)=>{"use strict";var{existsSync:os,readFileSync:ss}=Ui(),{dirname:xn,join:ls}=vt(),{SourceMapConsumer:qi,SourceMapGenerator:zi}=Bt();function as(n){return Buffer?Buffer.from(n,"base64").toString():window.atob(n)}var ht=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let i=t.map?t.map.prev:void 0,r=this.loadMap(t.from,i);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=xn(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new qi(this.text)),this.consumerCache}decodeInline(e){let t=/^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 c=e.match(t)||e.match(i);if(c)return as(e.substr(c[0].length));let u=e.match(/data:application\\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+u)}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 t=e.match(/\\/\\*\\s*# sourceMappingURL=/g);if(!t)return;let i=e.lastIndexOf(t.pop()),r=e.indexOf("*/",i);i>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(i,r)))}loadFile(e){if(this.root=xn(e),os(e))return this.mapFile=e,ss(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let i=t(e);if(i){let r=this.loadFile(i);if(!r)throw new Error("Unable to load previous source map: "+i.toString());return r}}else{if(t instanceof qi)return zi.fromSourceMap(t).toString();if(t instanceof zi)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let i=this.annotation;return e&&(i=ls(xn(e),i)),this.loadFile(i)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};ji.exports=ht;ht.default=ht});var xt=K((mu,Ji)=>{"use strict";var{nanoid:us}=Hi(),{isAbsolute:An,resolve:En}=vt(),{SourceMapConsumer:cs,SourceMapGenerator:ds}=Bt(),{fileURLToPath:Gi,pathToFileURL:Ot}=hn(),$i=kt(),fs=gn(),Sn=an(),yn=Symbol("lineToIndexCache"),ms=!!(cs&&ds),Vi=!!(En&&An);function Ki(n){if(n[yn])return n[yn];let e=n.css.split(`\n`),t=new Array(e.length),i=0;for(let r=0,o=e.length;r<o;r++)t[r]=i,i+=e[r].length+1;return n[yn]=t,t}var Ve=class{get from(){return this.file||this.id}constructor(e,t={}){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,t.document&&(this.document=t.document.toString()),t.from&&(!Vi||/^\\w+:\\/\\//.test(t.from)||An(t.from)?this.file=t.from:this.file=En(t.from)),Vi&&ms){let i=new fs(this.css,t);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 "+us(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,i,r={}){let o,s,c,u,a;if(t&&typeof t=="object"){let f=t,m=i;if(typeof f.offset=="number"){u=f.offset;let h=this.fromOffset(u);t=h.line,i=h.col}else t=f.line,i=f.column,u=this.fromLineAndColumn(t,i);if(typeof m.offset=="number"){c=m.offset;let h=this.fromOffset(c);s=h.line,o=h.col}else s=m.line,o=m.column,c=this.fromLineAndColumn(m.line,m.column)}else if(i)u=this.fromLineAndColumn(t,i);else{u=t;let f=this.fromOffset(u);t=f.line,i=f.col}let l=this.origin(t,i,s,o);return l?a=new $i(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,r.plugin):a=new $i(e,s===void 0?t:{column:i,line:t},s===void 0?i:{column:o,line:s},this.css,this.file,r.plugin),a.input={column:i,endColumn:o,endLine:s,endOffset:c,line:t,offset:u,source:this.css},this.file&&(Ot&&(a.input.url=Ot(this.file).toString()),a.input.file=this.file),a}fromLineAndColumn(e,t){return Ki(this)[e-1]+t-1}fromOffset(e){let t=Ki(this),i=t[t.length-1],r=0;if(e>=i)r=t.length-1;else{let o=t.length-2,s;for(;r<o;)if(s=r+(o-r>>1),e<t[s])o=s-1;else if(e>=t[s+1])r=s+1;else{r=s;break}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\\w+:\\/\\//.test(e)?e:En(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,i,r){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:t,line:e});if(!s.source)return!1;let c;typeof i=="number"&&(c=o.originalPositionFor({column:r,line:i}));let u;An(s.source)?u=Ot(s.source):u=new URL(s.source,this.map.consumer().sourceRoot||Ot(this.map.mapFile));let a={column:s.column,endColumn:c&&c.column,endLine:c&&c.line,line:s.line,url:u.toString()};if(u.protocol==="file:")if(Gi)a.file=Gi(u);else throw new Error("file: protocol is not available in this PostCSS build");let l=o.sourceContentFor(s.source);return l&&(a.source=l),a}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};Ji.exports=Ve;Ve.default=Ve;Sn&&Sn.registerInput&&Sn.registerInput(Ve)});var Ke=K((pu,Xi)=>{"use strict";var Qi=ve(),Yi,Zi,Be=class extends Qi{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,i){let r=super.normalize(e);if(t){if(i==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let o of r)o.raws.before=t.raws.before}return r}removeChild(e,t){let i=this.index(e);return!t&&i===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),super.removeChild(e)}toResult(e={}){return new Yi(new Zi,this,e).stringify()}};Be.registerLazyResult=n=>{Yi=n};Be.registerProcessor=n=>{Zi=n};Xi.exports=Be;Be.default=Be;Qi.registerRoot(Be)});var Fn=K((hu,er)=>{"use strict";var gt={comma(n){return gt.split(n,[","],!0)},space(n){let e=[" ",`\n`," "];return gt.split(n,e)},split(n,e,t){let i=[],r="",o=!1,s=0,c=!1,u="",a=!1;for(let l of n)a?a=!1:l==="\\\\"?a=!0:c?l===u&&(c=!1):l===\'"\'||l==="\'"?(c=!0,u=l):l==="("?s+=1:l===")"?s>0&&(s-=1):s===0&&e.includes(l)&&(o=!0),o?(r!==""&&i.push(r.trim()),r="",o=!1):r+=l;return(t||r!=="")&&i.push(r.trim()),i}};er.exports=gt;gt.default=gt});var Pt=K((xu,nr)=>{"use strict";var tr=ve(),ps=Fn(),Je=class extends tr{get selectors(){return ps.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\\s*/):null,i=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(i)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}};nr.exports=Je;Je.default=Je;tr.registerRule(Je)});var rr=K((gu,ir)=>{"use strict";var hs=Rt(),xs=ft(),gs=pt(),Ss=xt(),ys=gn(),As=Ke(),Es=Pt();function St(n,e){if(Array.isArray(n))return n.map(r=>St(r));let{inputs:t,...i}=n;if(t){e=[];for(let r of t){let o={...r,__proto__:Ss.prototype};o.map&&(o.map={...o.map,__proto__:ys.prototype}),e.push(o)}}if(i.nodes&&(i.nodes=n.nodes.map(r=>St(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 As(i);if(i.type==="decl")return new gs(i);if(i.type==="rule")return new Es(i);if(i.type==="comment")return new xs(i);if(i.type==="atrule")return new hs(i);throw new Error("Unknown node type: "+n.type)}ir.exports=St;St.default=St});var Nn=K((Su,cr)=>{"use strict";var{dirname:_t,relative:sr,resolve:lr,sep:ar}=vt(),{SourceMapConsumer:ur,SourceMapGenerator:It}=Bt(),{pathToFileURL:or}=hn(),Fs=xt(),bs=!!(ur&&It),Ns=!!(_t&&lr&&sr&&ar),bn=class{constructor(e,t,i,r){this.stringify=e,this.mapOpts=i.map||{},this.root=t,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 t=`\n`;this.css.includes(`\\r\n`)&&(t=`\\r\n`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),i=e.root||_t(e.file),r;this.mapOpts.sourcesContent===!1?(r=new ur(e.text),r.sourcesContent&&(r.sourcesContent=null)):r=e.consumer(),this.map.applySourceMap(r,t,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else if(this.css){let e;for(;(e=this.css.lastIndexOf("/*#"))!==-1;){let t=this.css.indexOf("*/",e+3);if(t===-1)break;for(;e>0&&this.css[e-1]===`\n`;)e--;this.css=this.css.slice(0,e)+this.css.slice(t+2)}}}}generate(){if(this.clearAnnotation(),Ns&&bs&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[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=It.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new It({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 It({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,i="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(c,u,a)=>{if(this.css+=c,u&&a!=="end"&&(r.generated.line=e,r.generated.column=t-1,u.source&&u.source.start?(r.source=this.sourcePath(u),r.original.line=u.source.start.line,r.original.column=u.source.start.column-1,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,this.map.addMapping(r))),s=c.match(/\\n/g),s?(e+=s.length,o=c.lastIndexOf(`\n`),t=c.length-o):t+=c.length,u&&a!=="start"){let l=u.parent||{raws:{}};(!(u.type==="decl"||u.type==="atrule"&&!u.nodes)||u!==l.last||l.raws.semicolon)&&(u.source&&u.source.end?(r.source=this.sourcePath(u),r.original.line=u.source.end.line,r.original.column=u.source.end.column-1,r.generated.line=e,r.generated.column=t-2,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,r.generated.line=e,r.generated.column=t-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(t=>t.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 t=this.memoizedPaths.get(e);if(t)return t;let i=this.opts.to?_t(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(i=_t(lr(i,this.mapOpts.annotation)));let r=sr(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 t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Fs(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let i=t.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,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,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 t=this.memoizedFileURLs.get(e);if(t)return t;if(or){let i=or(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 t=this.memoizedURLs.get(e);if(t)return t;ar==="\\\\"&&(e=e.replace(/\\\\/g,"/"));let i=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,i),i}};cr.exports=bn});var mr=K((yu,fr)=>{"use strict";var Wt=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,Ht=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,ws=/.[\\r\\n"\'(/\\\\]/,dr=/[\\da-f]/i;fr.exports=function(e,t={}){let i=e.css.valueOf(),r=t.ignoreErrors,o,s,c,u,a,l,f,m,h,M,C=i.length,A=0,z=[],P=[];function k(){return A}function Y(F){throw e.error("Unclosed "+F,A)}function y(){return P.length===0&&A>=C}function p(F){if(P.length)return P.pop();if(A>=C)return;let b=F?F.ignoreUnclosed:!1;switch(o=i.charCodeAt(A),o){case 10:case 32:case 9:case 13:case 12:{u=A;do u+=1,o=i.charCodeAt(u);while(o===32||o===10||o===9||o===13||o===12);l=["space",i.slice(A,u)],A=u-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let N=String.fromCharCode(o);l=[N,N,A];break}case 40:{if(M=z.length?z.pop()[1]:"",h=i.charCodeAt(A+1),M==="url"&&h!==39&&h!==34&&h!==32&&h!==10&&h!==9&&h!==12&&h!==13){u=A;do{if(f=!1,u=i.indexOf(")",u+1),u===-1)if(r||b){u=A;break}else Y("bracket");for(m=u;i.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);l=["brackets",i.slice(A,u+1),A,u],A=u}else u=i.indexOf(")",A+1),s=i.slice(A,u+1),u===-1||ws.test(s)?l=["(","(",A]:(l=["brackets",s,A,u],A=u);break}case 39:case 34:{a=o===39?"\'":\'"\',u=A;do{if(f=!1,u=i.indexOf(a,u+1),u===-1)if(r||b){u=A+1;break}else Y("string");for(m=u;i.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);l=["string",i.slice(A,u+1),A,u],A=u;break}case 64:{Wt.lastIndex=A+1,Wt.test(i),Wt.lastIndex===0?u=i.length-1:u=Wt.lastIndex-2,l=["at-word",i.slice(A,u+1),A,u],A=u;break}case 92:{for(u=A,c=!0;i.charCodeAt(u+1)===92;)u+=1,c=!c;if(o=i.charCodeAt(u+1),c&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(u+=1,dr.test(i.charAt(u)))){for(;dr.test(i.charAt(u+1));)u+=1;i.charCodeAt(u+1)===32&&(u+=1)}l=["word",i.slice(A,u+1),A,u],A=u;break}default:{o===47&&i.charCodeAt(A+1)===42?(u=i.indexOf("*/",A+2)+1,u===0&&(r||b?u=i.length:Y("comment")),l=["comment",i.slice(A,u+1),A,u],A=u):(Ht.lastIndex=A+1,Ht.test(i),Ht.lastIndex===0?u=i.length-1:u=Ht.lastIndex-2,l=["word",i.slice(A,u+1),A,u],z.push(l),A=u);break}}return A++,l}function S(F){P.push(F)}return{back:S,endOfFile:y,nextToken:p,position:k}}});var gr=K((Au,xr)=>{"use strict";var Cs=Rt(),Ms=ft(),Ds=pt(),ks=Ke(),pr=Pt(),Ls=mr(),hr={empty:!0,space:!0};function Rs(n){for(let e=n.length-1;e>=0;e--){let t=n[e],i=t[3]||t[2];if(i)return i}}var wn=class{constructor(e){this.input=e,this.root=new ks,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 t=new Cs;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let i,r,o,s=!1,c=!1,u=[],a=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),i=e[0],i==="("||i==="["?a.push(i==="("?")":"]"):i==="{"&&a.length>0?a.push("}"):i===a[a.length-1]&&a.pop(),a.length===0)if(i===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){c=!0;break}else if(i==="}"){if(u.length>0){for(o=u.length-1,r=u[o];r&&r[0]==="space";)r=u[--o];r&&(t.source.end=this.getPosition(r[3]||r[2]),t.source.end.offset++)}this.end(e);break}else u.push(e);else u.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(u),u.length?(t.raws.afterName=this.spacesAndCommentsFromStart(u),this.raw(t,"params",u),s&&(e=u[u.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),c&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let i=0,r;for(let o=t-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 t=0,i,r,o;for(let[s,c]of e.entries()){if(r=c,o=r[0],o==="("&&(t+=1),o===")"&&(t-=1),t===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 t=new Ms;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let i=e[1].slice(2,-2);if(!i.trim())t.text="",t.raws.left=i,t.raws.right="";else{let r=i.match(/^(\\s*)([^]*\\S)(\\s*)$/);t.text=r[2],t.raws.left=r[1],t.raws.right=r[3]}}createTokenizer(){this.tokenizer=Ls(this.input)}decl(e,t){let i=new Ds;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]||Rs(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 a=e[0][0];if(a===":"||a==="space"||a==="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=[],c;for(;e.length&&(c=e[0][0],!(c!=="space"&&c!=="comment"));)s.push(e.shift());this.precheckMissedSemicolon(e);for(let a=e.length-1;a>=0;a--){if(o=e[a],o[1].toLowerCase()==="!important"){i.important=!0;let l=this.stringFrom(e,a);l=this.spacesFromEnd(e)+l,l!==" !important"&&(i.raws.important=l);break}else if(o[1].toLowerCase()==="important"){let l=e.slice(0),f="";for(let m=a;m>0;m--){let h=l[m][0];if(f.trim().startsWith("!")&&h!=="space")break;f=l.pop()[1]+f}f.trim().startsWith("!")&&(i.important=!0,i.raws.important=f,e=l)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(a=>a[0]!=="space"&&a[0]!=="comment")&&(i.raws.between+=s.map(a=>a[1]).join(""),s=[]),this.raw(i,"value",s.concat(e),t),i.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new pr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}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 t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,i=null,r=!1,o=null,s=[],c=e[1].startsWith("--"),u=[],a=e;for(;a;){if(i=a[0],u.push(a),i==="("||i==="[")o||(o=a),s.push(i==="("?")":"]");else if(c&&r&&i==="{")o||(o=a),s.push("}");else if(s.length===0)if(i===";")if(r){this.decl(u,c);return}else break;else if(i==="{"){this.rule(u);return}else if(i==="}"){this.tokenizer.back(u.pop()),t=!0;break}else i===":"&&(r=!0);else i===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),s.length>0&&this.unclosedBracket(o),t&&r){if(!c)for(;u.length&&(a=u[u.length-1][0],!(a!=="space"&&a!=="comment"));)this.tokenizer.back(u.pop());this.decl(u,c)}else this.unknownWord(u)}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,t,i,r){let o,s,c=i.length,u="",a=!0,l,f;for(let m=0;m<c;m+=1)o=i[m],s=o[0],s==="space"&&m===c-1&&!r?a=!1:s==="comment"?(f=i[m-1]?i[m-1][0]:"empty",l=i[m+1]?i[m+1][0]:"empty",!hr[f]&&!hr[l]?u.slice(-1)===","?a=!1:u+=o[1]:a=!1):u+=o[1];if(!a){let m=i.reduce((h,M)=>h+M[1],"");e.raws[t]={raw:m,value:u}}e[t]=u}rule(e){e.pop();let t=new pr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,i="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)i=e.pop()[1]+i;return i}spacesAndCommentsFromStart(e){let t,i="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)i+=e.shift()[1];return i}spacesFromEnd(e){let t,i="";for(;e.length&&(t=e[e.length-1][0],t==="space");)i=e.pop()[1]+i;return i}stringFrom(e,t){let i="";for(let r=t;r<e.length;r++)i+=e[r][1];return e.splice(t,e.length-t),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,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};xr.exports=wn});var qt=K((Eu,Sr)=>{"use strict";var Ts=ve(),vs=xt(),Bs=gr();function Ut(n,e){let t=new vs(n,e),i=new Bs(t);try{i.parse()}catch(r){throw r}return i.root}Sr.exports=Ut;Ut.default=Ut;Ts.registerParse(Ut)});var Cn=K((Fu,yr)=>{"use strict";var yt=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let i=t.node.rangeBy(t);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(let i in t)this[i]=t[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}};yr.exports=yt;yt.default=yt});var zt=K((bu,Ar)=>{"use strict";var Os=Cn(),At=class{get content(){return this.css}constructor(e,t,i){this.processor=e,this.messages=[],this.root=t,this.opts=i,this.css="",this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let i=new Os(e,t);return this.messages.push(i),i}warnings(){return this.messages.filter(e=>e.type==="warning")}};Ar.exports=At;At.default=At});var Mn=K((Nu,Fr)=>{"use strict";var Er={};Fr.exports=function(e){Er[e]||(Er[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))}});var Ln=K((Cu,Cr)=>{"use strict";var Ps=ve(),_s=Tt(),Is=Nn(),Ws=qt(),br=zt(),Hs=Ke(),Us=lt(),{isClean:De,my:qs}=Lt(),wu=Mn(),zs={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},js={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},Gs={Once:!0,postcssPlugin:!0,prepare:!0},Qe=0;function Et(n){return typeof n=="object"&&typeof n.then=="function"}function wr(n){let e=!1,t=zs[n.type];return n.type==="decl"?e=n.prop.toLowerCase():n.type==="atrule"&&(e=n.name.toLowerCase()),e&&n.append?[t,t+"-"+e,Qe,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:n.append?[t,Qe,t+"Exit"]:[t,t+"Exit"]}function Nr(n){let e;return n.type==="document"?e=["Document",Qe,"DocumentExit"]:n.type==="root"?e=["Root",Qe,"RootExit"]:e=wr(n),{eventIndex:0,events:e,iterator:0,node:n,visitorIndex:0,visitors:[]}}function Dn(n){return n[De]=!1,n.nodes&&n.nodes.forEach(e=>Dn(e)),n}var kn={},Oe=class n{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,t,i){this.stringified=!1,this.processed=!1;let r;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))r=Dn(t);else if(t instanceof n||t instanceof br)r=Dn(t.root),t.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=t.map);else{let o=Ws;i.syntax&&(o=i.syntax.parse),i.parser&&(o=i.parser),o.parse&&(o=o.parse);try{r=o(t,i)}catch(s){this.processed=!0,this.error=s}r&&!r[qs]&&Ps.rebuild(r)}this.result=new br(e,r,i),this.helpers={...kn,postcss:kn,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,t){let i=this.result.lastPlugin;try{t&&t.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=(t,i,r)=>{this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push([t,r])};for(let t of this.plugins)if(typeof t=="object")for(let i in t){if(!js[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Gs[i])if(typeof t[i]=="object")for(let r in t[i])r==="*"?e(t,i,t[i][r]):e(t,i+"-"+r.toLowerCase(),t[i][r]);else typeof t[i]=="function"&&e(t,i,t[i])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],i=this.runOnRoot(t);if(Et(i))try{await i}catch(r){throw this.handleError(r)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[De];){e[De]=!0;let t=[Nr(e)];for(;t.length>0;){let i=this.visitTick(t);if(Et(i))try{await i}catch(r){let o=t[t.length-1].node;throw this.handleError(r,o)}}}if(this.listeners.OnceExit)for(let[t,i]of this.listeners.OnceExit){this.result.lastPlugin=t;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 t=this.result.root.nodes.map(i=>e.Once(i,this.helpers));return Et(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Us;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Is(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[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 t=this.runOnRoot(e);if(Et(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[De];)e[De]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[i,r]of e){this.result.lastPlugin=i;let o;try{o=r(t,this.helpers)}catch(s){throw this.handleError(s,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(Et(o))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:i,visitors:r}=t;if(i.type!=="root"&&i.type!=="document"&&!i.parent){e.pop();return}if(r.length>0&&t.visitorIndex<r.length){let[s,c]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=s;try{return c(i.toProxy(),this.helpers)}catch(u){throw this.handleError(u,i)}}if(t.iterator!==0){let s=t.iterator,c;for(;c=i.nodes[i.indexes[s]];)if(i.indexes[s]+=1,!c[De]){c[De]=!0,e.push(Nr(c));return}t.iterator=0,delete i.indexes[s]}let o=t.events;for(;t.eventIndex<o.length;){let s=o[t.eventIndex];if(t.eventIndex+=1,s===Qe){i.nodes&&i.nodes.length&&(i[De]=!0,t.iterator=i.getIterator());return}else if(this.listeners[s]){t.visitors=this.listeners[s];return}}e.pop()}walkSync(e){e[De]=!0;let t=wr(e);for(let i of t)if(i===Qe)e.nodes&&e.each(r=>{r[De]||this.walkSync(r)});else{let r=this.listeners[i];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}};Oe.registerPostcss=n=>{kn=n};Cr.exports=Oe;Oe.default=Oe;Hs.registerLazyResult(Oe);_s.registerLazyResult(Oe)});var Dr=K((Du,Mr)=>{"use strict";var $s=Nn(),Vs=qt(),Ks=zt(),Js=lt(),Mu=Mn(),Ft=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,t=Vs;try{e=t(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,t,i){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=i,this._map=void 0;let r=Js;this.result=new Ks(this._processor,void 0,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let s=new $s(r,void 0,this._opts,t);if(s.isMap()){let[c,u]=s.generate();c&&(this.result.css=c),u&&(this.result.map=u)}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,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}};Mr.exports=Ft;Ft.default=Ft});var Lr=K((ku,kr)=>{"use strict";var Qs=Tt(),Ys=Ln(),Zs=Dr(),Xs=Ke(),qe=class{constructor(e=[]){this.version="8.5.8",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let i of e)if(i.postcss===!0?i=i():i.postcss&&(i=i.postcss),typeof i=="object"&&Array.isArray(i.plugins))t=t.concat(i.plugins);else if(typeof i=="object"&&i.postcssPlugin)t.push(i);else if(typeof i=="function")t.push(i);else if(!(typeof i=="object"&&(i.parse||i.stringify)))throw new Error(i+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new Zs(this,e,t):new Ys(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};kr.exports=qe;qe.default=qe;Xs.registerProcessor(qe);Qs.registerProcessor(qe)});var Ir=K((Lu,_r)=>{"use strict";var Rr=Rt(),Tr=ft(),el=ve(),tl=kt(),vr=pt(),Br=Tt(),nl=rr(),il=xt(),rl=Ln(),ol=Fn(),sl=ct(),ll=qt(),Rn=Lr(),al=zt(),Or=Ke(),Pr=Pt(),ul=lt(),cl=Cn();function te(...n){return n.length===1&&Array.isArray(n[0])&&(n=n[0]),new Rn(n)}te.plugin=function(e,t){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 c=t(...s);return c.postcssPlugin=e,c.postcssVersion=new Rn().version,c}let o;return Object.defineProperty(r,"postcss",{get(){return o||(o=r()),o}}),r.process=function(s,c,u){return te([r(u)]).process(s,c)},r};te.stringify=ul;te.parse=ll;te.fromJSON=nl;te.list=ol;te.comment=n=>new Tr(n);te.atRule=n=>new Rr(n);te.decl=n=>new vr(n);te.rule=n=>new Pr(n);te.root=n=>new Or(n);te.document=n=>new Br(n);te.CssSyntaxError=tl;te.Declaration=vr;te.Container=el;te.Processor=Rn;te.Document=Br;te.Comment=Tr;te.Warning=cl;te.AtRule=Rr;te.Result=al;te.Input=il;te.Rule=Pr;te.Root=Or;te.Node=sl;rl.registerPostcss(te);_r.exports=te;te.default=te});function ge(n){try{window.parent.postMessage(n,"*")}catch{}}function Qn(n){let e=t=>{let i=t.data;if(!i||i.source!=="hf-parent"||i.type!=="control")return;let r=i.action;if(r==="play"){n.onPlay();return}if(r==="pause"){n.onPause();return}if(r==="seek"){n.onSeek(Number(i.frame??0),i.seekMode??"commit");return}if(r==="set-muted"){n.onSetMuted(!!i.muted);return}if(r==="set-media-output-muted"){n.onSetMediaOutputMuted(!!i.muted);return}if(r==="set-playback-rate"){n.onSetPlaybackRate(Number(i.playbackRate??1));return}if(r==="enable-pick-mode"){n.onEnablePickMode();return}if(r==="disable-pick-mode"){n.onDisablePickMode();return}if(r==="flash-elements"){let o=i.selectors,s=i.duration||800;o&&Ro(o,s)}};return window.addEventListener("message",e),e}function Ro(n,e){if(!document.getElementById("__hf-flash-styles")){let t=document.createElement("style");t.id="__hf-flash-styles",t.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(t)}for(let t of n)try{document.querySelectorAll(t).forEach(r=>{r.classList.add("__hf-flash"),setTimeout(()=>r.classList.remove("__hf-flash"),e)})}catch{}}var tn=null;function Yn(n){tn=n}function nt(n,e){if(tn)try{tn({source:"hf-preview",type:"analytics",event:n,properties:e??{}})}catch{}}function Zn(n){let e=[],t=c=>{if(typeof c.getAnimations!="function")return[];try{return c.getAnimations()}catch{return[]}},i=(c,u)=>{for(let a of c){try{a.currentTime=u}catch{}try{a.pause()}catch{}}},r=c=>{for(let u of c)try{u.play()}catch{}},o=c=>{for(let u of c)try{u.pause()}catch{}},s=c=>{c.baseDelay?c.el.style.animationDelay=c.baseDelay:c.el.style.removeProperty("animation-delay"),c.basePlayState?c.el.style.animationPlayState=c.basePlayState:c.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{e=[];let c=document.querySelectorAll("*");for(let u of c){if(!(u instanceof HTMLElement))continue;let a=window.getComputedStyle(u);!a.animationName||a.animationName==="none"||e.push({el:u,baseDelay:u.style.animationDelay||"",basePlayState:u.style.animationPlayState||""})}},seek:c=>{let u=Number(c.time)||0;for(let a of e){if(!a.el.isConnected)continue;let l=n?.resolveStartSeconds?n.resolveStartSeconds(a.el):Number.parseFloat(a.el.getAttribute("data-start")??"0")||0,f=Math.max(0,u-l)*1e3,m=t(a.el);if(m.length>0){i(m,f);continue}a.el.style.animationPlayState="paused",a.el.style.animationDelay=`-${(f/1e3).toFixed(3)}s`}},pause:()=>{for(let c of e){if(!c.el.isConnected)continue;let u=t(c.el);u.length>0&&o(u),s(c)}},play:()=>{for(let c of e)c.el.isConnected&&(s(c),r(t(c.el)))},revert:()=>{e=[]}}}function Xn(n){return{name:"gsap",discover:()=>{},seek:e=>{let t=n.getTimeline();if(!t)return;t.pause();let i=Math.max(0,Number(e.time)||0);typeof t.totalTime=="function"?t.totalTime(i,!1):t.seek(i,!1)},pause:()=>{let e=n.getTimeline();e&&e.pause()}}}function ni(){return{name:"lottie",discover:()=>{try{let n=window.lottie;if(n&&typeof n.getRegisteredAnimations=="function"){let e=n.getRegisteredAnimations();if(Array.isArray(e)&&e.length>0){let t=window.__hfLottie??[],i=new Set(t);for(let r of e)i.has(r)||t.push(r);window.__hfLottie=t}}}catch{}},seek:n=>{let e=Math.max(0,Number(n.time)||0),t=window.__hfLottie;if(!(!t||t.length===0))for(let i of t)try{if(ei(i))i.goToAndStop(e*1e3,!1);else if(ti(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{}},pause:()=>{let n=window.__hfLottie;if(!(!n||n.length===0))for(let e of n)try{(ei(e)||ti(e))&&e.pause()}catch{}},revert:()=>{}}}function ei(n){return typeof n=="object"&&n!==null&&typeof n.goToAndStop=="function"}function ti(n){return typeof n=="object"&&n!==null&&typeof n.pause=="function"&&("totalFrames"in n||"duration"in n)}function ii(){let n=null,e=0;return{name:"three",discover:()=>{},seek:t=>{n=Math.max(0,Number(t.time)||0),e=n,window.__hfThreeTime=n;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:n}}))}catch{}},pause:()=>{n==null&&(n=Math.max(0,e))},play:()=>{n=null},revert:()=>{n=null,e=0}}}function ri(){return{name:"waapi",discover:()=>{},seek:n=>{if(!document.getAnimations)return;let e=Math.max(0,(Number(n.time)||0)*1e3);for(let t of document.getAnimations()){try{t.currentTime=e}catch{}try{t.pause()}catch{}}},pause:()=>{if(document.getAnimations)for(let n of document.getAnimations())try{n.pause()}catch{}}}}function oi(n){let e=Array.from(document.querySelectorAll("video, audio")),t=n?.shouldIncludeElement?e.filter(s=>n.shouldIncludeElement?.(s)):e.filter(s=>s.hasAttribute("data-start")),i=[],r=[],o=0;for(let s of t){let c=n?.resolveStartSeconds?n.resolveStartSeconds(s):Number.parseFloat(s.dataset.start??"0");if(!Number.isFinite(c))continue;let u=Number.parseFloat(s.dataset.playbackStart??s.dataset.mediaStart??"0")||0,a=s.defaultPlaybackRate,l=Number.isFinite(a)&&a>0?Math.max(.1,Math.min(5,a)):1,f=s.loop,m=Number.isFinite(s.duration)&&s.duration>0?s.duration:null,h=n?.resolveDurationSeconds?.(s)??Number.parseFloat(s.dataset.duration??"");(!Number.isFinite(h)||h<=0)&&m!=null&&(h=Math.max(0,(m-u)/l));let M=Number.isFinite(h)&&h>0?c+h:Number.POSITIVE_INFINITY,C=Number.parseFloat(s.dataset.volume??""),A={el:s,start:c,mediaStart:u,duration:Number.isFinite(h)&&h>0?h:Number.POSITIVE_INFINITY,end:M,volume:Number.isFinite(C)?C:null,playbackRate:l,loop:f,sourceDuration:m};i.push(A),s.tagName==="VIDEO"&&r.push(A),Number.isFinite(M)&&(o=Math.max(o,M))}return{timedMediaEls:t,mediaClips:i,videoClips:r,maxMediaEnd:o}}var nn=new WeakMap,it=new WeakSet;function To(n){if(it.has(n))return;it.add(n);let e=()=>it.delete(n);n.addEventListener("playing",e,{once:!0}),n.addEventListener("pause",e,{once:!0}),n.addEventListener("error",e,{once:!0})}function si(n){let e=!!(n.outputMuted||n.userMuted);for(let t of n.clips){let{el:i}=t;if(!i.isConnected)continue;let r=(n.timeSeconds-t.start)*t.playbackRate+t.mediaStart;if(n.timeSeconds>=t.start&&n.timeSeconds<t.end&&r>=0){if(t.loop&&t.sourceDuration!=null&&t.sourceDuration>0){let h=t.sourceDuration-t.mediaStart;h>0&&r>=t.sourceDuration&&(r=t.mediaStart+(r-t.mediaStart)%h)}t.volume!=null&&(i.volume=t.volume),e&&(i.muted=!0);try{i.playbackRate=t.playbackRate*n.playbackRate}catch{}let s=i.currentTime||0,c=Math.abs(s-r),u=r-s,a=nn.get(i);nn.set(i,u);let l=a===void 0,f=!l&&Math.abs(u-a)>.5,m=c>3;if(c>.5&&(l||f||m))try{i.currentTime=r}catch{}n.playing&&i.paused&&!it.has(i)?(i.preload!=="auto"&&(i.preload="auto"),To(i),i.play().catch(h=>{it.delete(i),(h&&typeof h=="object"&&"name"in h?String(h.name??""):"")==="NotAllowedError"&&n.onAutoplayBlocked?.()})):!n.playing&&!i.paused&&i.pause();continue}nn.delete(i),i.paused||i.pause()}}function li(n){let e=!1,t=null,i=null,r=null,o=null;function s(y,p){try{window.dispatchEvent(new CustomEvent(y,{detail:p}))}catch{}}function c(y){r=y,s("hyperframe:picker:hovered",{elementInfo:r,isPickMode:e,timestamp:Date.now()})}function u(y){o=y,s("hyperframe:picker:selected",{elementInfo:o,isPickMode:e,timestamp:Date.now()})}function a(y){if(!y||y===document.body||y===document.documentElement)return!1;let p=y.tagName.toLowerCase();return!(p==="script"||p==="style"||p==="link"||p==="meta"||y.classList.contains("__hf-pick-highlight"))}function l(y){let p=y;if(p.id)return`#${p.id}`;let S=y.getAttribute("data-composition-id");if(S)return`[data-composition-id="${S}"]`;let F=y.getAttribute("data-composition-src");if(F)return`[data-composition-src="${F}"]`;let b=y.getAttribute("data-track-index");if(b)return`[data-track-index="${b}"]`;let N=y.tagName.toLowerCase(),B=y.parentElement;if(!B)return N;let W=B.querySelectorAll(`:scope > ${N}`);if(W.length===1)return N;for(let H=0;H<W.length;H+=1)if(W[H]===y)return`${N}:nth-of-type(${H+1})`;return N}function f(y){let p=y.tagName.toLowerCase(),S=(y.textContent??"").trim().replace(/\\s+/g," "),F=(b,N)=>b.length>N?`${b.slice(0,N-1)}\\u2026`:b;return p==="h1"||p==="h2"||p==="h3"?"Heading":p==="p"||p==="span"||p==="div"?S.length>0?F(S,56):"Text":p==="img"?"Image":p==="video"?"Video":p==="audio"?"Audio":p==="svg"?"Shape":y.getAttribute("data-composition-src")?"Composition":p==="section"?"Section":`${p.charAt(0).toUpperCase()}${p.slice(1)}`}function m(y,p,S){let F=typeof S=="number"&&S>0?S:8,b=[];if(document.elementsFromPoint)b=document.elementsFromPoint(y,p);else if(document.elementFromPoint){let W=document.elementFromPoint(y,p);b=W?[W]:[]}let N={},B=[];for(let W=0;W<b.length;W+=1){let H=b[W];if(!a(H))continue;let X=`${H.tagName}::${H.id||""}::${W}`;if(!N[X]&&(N[X]=!0,B.push(H),B.length>=F))break}return B}function h(y){let p=y.getBoundingClientRect(),S={};for(let b=0;b<y.attributes.length;b+=1){let N=y.attributes[b];N.name.startsWith("data-")&&(S[N.name]=N.value)}return{id:y.id||null,tagName:y.tagName.toLowerCase(),selector:l(y),label:f(y),boundingBox:{x:p.left,y:p.top,width:p.width,height:p.height},textContent:y.textContent?y.textContent.trim().slice(0,200):null,src:y.getAttribute("src")||y.getAttribute("data-composition-src")||null,dataAttributes:S}}function M(y,p,S){return m(y,p,S).map(h)}function C(y){if(!e)return;let S=m(y.clientX,y.clientY,1)[0]??(y.target instanceof Element?y.target:null);if(!a(S)||t===S)return;t&&t.classList.remove("__hf-pick-highlight"),t=S,S.classList.add("__hf-pick-highlight");let F=h(S);c(F),n.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:F})}function A(y){if(!e)return;y.preventDefault(),y.stopPropagation(),y.stopImmediatePropagation();let p=M(y.clientX,y.clientY,8);p.length!==0&&(c(p[0]??null),n.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:p,selectedIndex:0,point:{x:y.clientX,y:y.clientY}}))}function z(y){y.key==="Escape"&&(k(),n.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function P(){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",C,!0),document.addEventListener("click",A,!0),document.addEventListener("keydown",z,!0),s("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function k(){e&&(e=!1,t&&(t.classList.remove("__hf-pick-highlight"),t=null),i&&(i.remove(),i=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",C,!0),document.removeEventListener("click",A,!0),document.removeEventListener("keydown",z,!0),s("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function Y(){window.__HF_PICKER_API={enable:P,disable:k,isActive:()=>e,getHovered:()=>r,getSelected:()=>o,getCandidatesAtPoint:(y,p,S)=>Number.isFinite(y)&&Number.isFinite(p)?M(y,p,S):[],pickAtPoint:(y,p,S)=>{if(!Number.isFinite(y)||!Number.isFinite(p))return null;let F=M(y,p,8);if(!F.length)return null;let b=Math.max(0,Math.min(F.length-1,Number(S??0))),N=F[b]??null;return N?(u(N),n.postMessage({source:"hf-preview",type:"element-picked",elementInfo:N}),k(),N):null},pickManyAtPoint:(y,p,S)=>{if(!Number.isFinite(y)||!Number.isFinite(p))return[];let F=M(y,p,8);if(!F.length)return[];let b=[],N=Array.isArray(S)?S:[0];for(let B of N){let W=Math.max(0,Math.min(F.length-1,Math.floor(Number(B)))),H=F[W];if(!H)continue;b.some(R=>R.selector===H.selector&&R.tagName===H.tagName)||b.push(H)}return b.length?(u(b[0]??null),n.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:b}),k(),b):[]}},s("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:P,disablePickMode:k,installPickerApi:Y}}function rn(n,e){let t=Number.isFinite(e)&&e>0?e:30,i=Number.isFinite(n)&&n>0?n:0;return Math.floor(i*t+1e-9)/t}function Dt(n,e,t){if(n){for(let i of Object.values(n))if(!(!i||i===e))try{t(i)}catch{}}}function ai(n,e,t){let i=rn(e,t);return n.pause(),typeof n.totalTime=="function"?n.totalTime(i,!1):n.seek(i,!1),i}function vo(n,e,t,i){let r=[];Dt(n,e,o=>{o.play(),r.push(o)});try{return ai(e,t,i)}finally{for(let o of r)try{o.pause()}catch{}}}function Bo(n,e){Dt(n,e,t=>{t.play()})}function ui(n){return{_timeline:null,play:()=>{let e=n.getTimeline();if(!e||n.getIsPlaying())return;let t=Math.max(0,Number(n.getSafeDuration?.()??e.duration()??0)||0);t>0&&Math.max(0,Number(e.time())||0)>=t&&(e.pause(),e.seek(0,!1),n.onDeterministicSeek(0),n.setIsPlaying(!1),n.onSyncMedia(0,!1),n.onRenderFrameSeek(0)),typeof e.timeScale=="function"&&e.timeScale(n.getPlaybackRate()),e.play(),Dt(n.getTimelineRegistry?.(),e,i=>{typeof i.timeScale=="function"&&i.timeScale(n.getPlaybackRate()),i.play()}),n.onDeterministicPlay(),n.setIsPlaying(!0),n.onShowNativeVideos(),n.onStatePost(!0)},pause:()=>{let e=n.getTimeline();if(!e)return;e.pause(),Dt(n.getTimelineRegistry?.(),e,i=>{i.pause()});let t=Math.max(0,Number(e.time())||0);n.onDeterministicSeek(t),n.onDeterministicPause(),n.setIsPlaying(!1),n.onSyncMedia(t,!1),n.onRenderFrameSeek(t),n.onStatePost(!0)},seek:e=>{let t=n.getTimeline();if(!t)return;let i=Math.max(0,Number(e)||0),r=vo(n.getTimelineRegistry?.(),t,i,n.getCanonicalFps());n.onDeterministicSeek(r),n.setIsPlaying(!1),n.onSyncMedia(r,!1),n.onRenderFrameSeek(r),n.onStatePost(!0)},renderSeek:e=>{let t=n.getTimeline(),i=n.getCanonicalFps(),r=t?(Bo(n.getTimelineRegistry?.(),t),ai(t,e,i)):rn(Math.max(0,Number(e)||0),i);n.onDeterministicSeek(r),n.setIsPlaying(!1),n.onSyncMedia(r,!1),n.onRenderFrameSeek(r),n.onStatePost(!0)},getTime:()=>Number(n.getTimeline()?.time()??0),getDuration:()=>Number(n.getTimeline()?.duration()??0),isPlaying:()=>n.getIsPlaying(),setPlaybackRate:e=>n.setPlaybackRate(e),getPlaybackRate:()=>n.getPlaybackRate()}}function ci(){return{capturedTimeline:null,isPlaying:!1,rafId:null,currentTime:0,deterministicAdapters:[],parityModeEnabled:!0,canonicalFps:30,bridgeMuted:!1,mediaOutputMuted:!1,mediaAutoplayBlockedPosted:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,timelinePollIntervalId:null,controlBridgeHandler:null,clampDurationLoggedRaw:null,beforeUnloadHandler:null,domReadyHandler:null,injectedCompStyles:[],injectedCompScripts:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,maxTimelineDurationSeconds:1800,nativeVisualWatchdogTick:0}}var Oo="data-hf-authored-duration",Po="data-hf-authored-end";function We(n){if(n==null||n==="")return null;let e=Number(n);return Number.isFinite(e)?e:null}function _o(n){return We(n.getAttribute("data-duration"))}function Io(n){return We(n.getAttribute("data-end"))}function Wo(n){return We(n.getAttribute(Oo))}function Ho(n){return We(n.getAttribute(Po))}function Uo(n){let e=(n??"").trim();if(!e)return null;let t=We(e);if(t!=null)return{kind:"absolute",value:t};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",c=Number.parseFloat(s),u=Number.isFinite(c)?Math.max(0,c):0,a=o==="-"?-u:u;return{kind:"reference",refId:r,offset:a}}function He(n){let e=n.timelineRegistry??{},t=n.includeAuthoredTimingAttrs??!1,i=new WeakMap,r=new WeakMap,o=new Set,s=l=>{let f=document.getElementById(l);return f||(document.querySelector(`[data-composition-id="${CSS.escape(l)}"]`)??null)},c=l=>{let f=r.get(l);if(f!==void 0)return f;let m=null,h=_o(l)??(t?Wo(l):null);if(h!=null&&h>0&&(m=h),m==null||m<=0){let M=Io(l)??(t?Ho(l):null);if(M!=null){let C=a(l,0),A=M-C;Number.isFinite(A)&&A>0&&(m=A)}}if((m==null||m<=0)&&l instanceof HTMLMediaElement){let M=We(l.getAttribute("data-playback-start"))??We(l.getAttribute("data-media-start"))??0;Number.isFinite(l.duration)&&l.duration>M&&(m=l.duration-M)}if(m==null||m<=0){let M=l.getAttribute("data-composition-id");if(M){let C=e[M]??null;if(C&&typeof C.duration=="function")try{let A=Number(C.duration());Number.isFinite(A)&&A>0&&(m=A)}catch{}}}return m!=null&&Number.isFinite(m)&&m>0?(r.set(l,m),m):(r.set(l,null),null)},u=(l,f)=>{if(l.hasAttribute("data-composition-id")){let h=l.parentElement?.closest("[data-composition-id]");return h?a(h,f):0}let m=l.closest("[data-composition-id]");return m?a(m,f):0},a=(l,f)=>{let m=i.get(l);if(m!==void 0)return m??f;if(o.has(l))return f;o.add(l);try{let h=Uo(l.getAttribute("data-start"));if(!h){if(l.hasAttribute("data-composition-id")){let P=l.parentElement;if(P&&(P.hasAttribute("data-composition-src")||P.hasAttribute("data-composition-id"))){let k=a(P,f);return i.set(l,k),k}}return i.set(l,f),f}if(h.kind==="absolute"){let P=Math.max(0,h.value),k=Math.max(0,u(l,f)+P);return i.set(l,k),k}let M=s(h.refId);if(!M)return i.set(l,f),f;let C=a(M,0),A=c(M);if(A==null||A<=0){let P=Math.max(0,C+h.offset);return i.set(l,P),P}let z=Math.max(0,C+A+h.offset);return i.set(l,z),z}finally{o.delete(l)}};return{resolveStartForElement:(l,f=0)=>a(l,Math.max(0,f)),resolveDurationForElement:l=>c(l)}}var qo="data-hf-authored-duration",zo="data-hf-authored-end";function Se(n){if(n==null||n==="")return null;let e=Number(n);return Number.isFinite(e)?e:null}function on(n){return Se(n.getAttribute("data-duration"))??Se(n.getAttribute(qo))}function di(n){return Se(n.getAttribute("data-end"))??Se(n.getAttribute(zo))}function sn(...n){let e=n.filter(t=>Number.isFinite(t??null));return e.length===0?null:Math.max(...e)}var fi={composition:0,video:1,image:2,element:3,audio:4};function jo(n){if(n.length===0)return;let e=new Map;for(let s of n){let c=e.get(s.track)??new Set;c.add(s.kind),e.set(s.track,c)}if(!Array.from(e.values()).some(s=>s.size>1))return;let i=0,r=new Map,o=[...e.keys()].sort((s,c)=>s-c);for(let s of o){let c=e.get(s);if(c.size===1)r.set(`${s}:${[...c][0]}`,i++);else{let u=[...c].sort((a,l)=>(fi[a]??99)-(fi[l]??99));for(let a of u)r.set(`${s}:${a}`,i++)}}for(let s of n){let c=`${s.track}:${s.kind}`,u=r.get(c);u!=null&&(s.track=u)}}function rt(n){let e=String(n??"").trim();if(!e)return null;let t=e.toLowerCase();if(t.startsWith("data:")||t.startsWith("javascript:"))return null;try{return new URL(e,document.baseURI).toString()}catch{return e}}function Go(n){let e=n.getAttribute("src")??n.getAttribute("data-src");if(e)return rt(e);let t=n.getAttribute("data-composition-src");if(t)return rt(t);let i=n.querySelector("img[src], video[src], audio[src], source[src]");return i?rt(i.getAttribute("src")):null}function mi(n){let t=window.__timelines??{},i=He({timelineRegistry:t,includeAuthoredTimingAttrs:!0}),r=T=>{if(!T)return null;let D=t[T]??null;if(!D||typeof D.duration!="function")return null;try{let L=Number(D.duration());return Number.isFinite(L)&&L>0?L:null}catch{return null}},o=T=>{let D=Se(T.getAttribute("data-duration"));if(D!=null&&D>0)return D;let L=Se(T.getAttribute("data-playback-start"))??Se(T.getAttribute("data-media-start"))??0;return Number.isFinite(T.duration)&&T.duration>L?Math.max(0,T.duration-L):null},s=()=>{let T=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(T.length===0)return null;let D=0;for(let L of T){let Q=i.resolveStartForElement(L,0);if(!Number.isFinite(Q))continue;let ne=o(L);ne==null||ne<=0||(D=Math.max(D,Math.max(0,Q)+ne))}return D>0?D:null},c=T=>{let D=T.trim().toLowerCase();return!(!D||D==="main"||D.includes("caption")||D.includes("ambient"))},u=(T,D)=>{let L=[],Q=null,ne=null,_=null,I=T.parentElement;for(;I;){let j=I.getAttribute("data-composition-id");j&&(L.push(j),!_&&I!==D&&(_=j),Q==null&&(Q=i.resolveStartForElement(I,0)),ne==null&&(ne=Se(I.getAttribute("data-duration"))??r(j)??null)),I=I.parentElement}return{parentCompositionId:_,compositionAncestors:L.reverse(),inheritedStart:Q,inheritedDuration:ne}},a=document.querySelector("[data-composition-id]"),l=Array.from(document.querySelectorAll("[data-composition-id]")),f=a?.getAttribute("data-composition-id")??null,m=a?i.resolveStartForElement(a,0):0,h=s(),M=h!=null?Math.max(0,h-Math.max(0,m)):null,C=r(f),A=on(a??document.body),z=sn(...l.filter(T=>T!==a).map(T=>{let D=i.resolveStartForElement(T,0),L=i.resolveDurationForElement(T)??r(T.getAttribute("data-composition-id"))??null;return!Number.isFinite(D)||L==null||L<=0?null:Math.max(0,D)+L})),P=z!=null?Math.max(0,z-Math.max(0,m)):null,k=typeof C=="number"&&Number.isFinite(C)&&C>0?C:null,Y=typeof A=="number"&&Number.isFinite(A)&&A>0?A:null,y=typeof M=="number"&&Number.isFinite(M)&&M>0?M:null,p=typeof P=="number"&&Number.isFinite(P)&&P>0?P:null,S=sn(y,p),F=k!=null&&S!=null&&k>S+1,b=Y??(F?S:sn(k,y,p)),N=b!=null?Math.min(b,n.maxTimelineDurationSeconds):null,W=(N!=null?m+N:null)??(typeof h=="number"&&Number.isFinite(h)&&h>0?h:null),H=(T,D)=>!Number.isFinite(D)||D<=0?0:W==null||!Number.isFinite(W)?D:!Number.isFinite(T)||T>=W?0:Math.max(0,Math.min(D,W-T)),X=[],R=[],Z=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),ee=0;for(let T=0;T<Z.length;T+=1){let D=Z[T];if(D===a||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(D.tagName))continue;let L=u(D,a),Q=i.resolveStartForElement(D,L.inheritedStart??0),ne=D.getAttribute("data-composition-id"),_=on(D);if((_==null||_<=0)&&ne&&ne!==f&&(_=r(ne)),(_==null||_<=0)&&D instanceof HTMLMediaElement){let ce=Se(D.getAttribute("data-playback-start"))??Se(D.getAttribute("data-media-start"))??0;Number.isFinite(D.duration)&&D.duration>0&&(_=Math.max(0,D.duration-ce))}if(_==null||_<=0){let ce=L.inheritedDuration;if(ce!=null&&ce>0){let Fe=(L.inheritedStart??0)+ce;_=Math.max(0,Fe-Q)}}if(_==null||_<=0||(_=H(Q,_),_<=0))continue;let I=Q+_;ee=Math.max(ee,I);let j=D.tagName.toLowerCase(),Ne=ne&&ne!==f?"composition":j==="video"?"video":j==="audio"?"audio":j==="img"?"image":"element";X.push({id:D.id||ne||`__node__index_${T}`,label:D.getAttribute("data-timeline-label")??D.getAttribute("data-label")??D.getAttribute("aria-label")??ne??D.id??D.className?.split(" ")[0]??Ne,start:Q,duration:_,track:Number.parseInt(D.getAttribute("data-track-index")??D.getAttribute("data-track")??String(T),10)||0,kind:Ne,tagName:j,compositionId:D.getAttribute("data-composition-id"),compositionAncestors:L.compositionAncestors,parentCompositionId:L.parentCompositionId,nodePath:null,compositionSrc:rt(D.getAttribute("data-composition-src")),assetUrl:Go(D),timelineRole:D.getAttribute("data-timeline-role"),timelineLabel:D.getAttribute("data-timeline-label"),timelineGroup:D.getAttribute("data-timeline-group"),timelinePriority:Se(D.getAttribute("data-timeline-priority"))})}let U=new Set(X.map(T=>T.id)),G=a?.getAttribute("data-composition-id")??null,v=G?t[G]??null:null;if(v&&a){let T=v;if(typeof T.getChildren=="function")try{let D=T.getChildren(!0,!0,!1)??[],L=new Map;for(let _ of a.children){let I=_;if(!I.id)continue;let j=I.tagName.toLowerCase();j==="script"||j==="style"||j==="link"||L.set(I,{id:I.id,start:1/0,end:-1/0})}let Q=_=>{let I=_;for(;I;){if(L.has(I))return I;if(I===a)return null;I=I.parentElement}return null};for(let _ of D){if(typeof _.targets!="function"||typeof _.startTime!="function"||typeof _.duration!="function")continue;let I=_.startTime(),j=_.parent;for(;j&&j!==v&&typeof j.startTime=="function";)I+=j.startTime(),j=j.parent;let Ne=I+_.duration();if(!(!Number.isFinite(I)||!Number.isFinite(Ne)))for(let ce of _.targets()){if(!(ce instanceof Element))continue;let ze=Q(ce);if(!ze)continue;let Fe=L.get(ze);Fe&&(Fe.start=Math.min(Fe.start,I),Fe.end=Math.max(Fe.end,Ne))}}let ne=X.length>0?Math.max(...X.map(_=>_.track))+1:0;for(let[_,I]of L){if(I.start===1/0||I.end===-1/0)continue;let j=_;if(U.has(j.id))continue;let Ne=Math.max(0,I.end-I.start);if(Ne<=0)continue;let ce=H(I.start,Ne);ce<=0||(ee=Math.max(ee,I.start+ce),X.push({id:j.id,label:j.getAttribute("data-timeline-label")??j.getAttribute("data-label")??j.getAttribute("aria-label")??j.id,start:I.start,duration:ce,track:Number.parseInt(j.getAttribute("data-track-index")??j.getAttribute("data-track")??"",10)||ne,kind:"element",tagName:j.tagName.toLowerCase(),compositionId:j.getAttribute("data-composition-id"),compositionAncestors:G?[G]:[],parentCompositionId:G,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:Se(j.getAttribute("data-timeline-priority"))}),U.add(j.id))}}catch{}}if(a&&N!=null&&N>0){let T=X.length>0?Math.max(...X.map(D=>D.track))+1:0;for(let D of a.children){let L=D;if(!L.id||U.has(L.id))continue;let Q=L.getAttribute("data-timeline-role");if(Q!=="overlay"&&Q!=="persistent-overlay")continue;let ne=L.tagName.toLowerCase();if(ne==="script"||ne==="style"||ne==="link"||ne==="meta"||window.getComputedStyle(L).display==="none")continue;let I=H(0,N);I<=0||(ee=Math.max(ee,I),X.push({id:L.id,label:L.getAttribute("data-timeline-label")??L.getAttribute("data-label")??L.getAttribute("aria-label")??L.id,start:0,duration:I,track:Number.parseInt(L.getAttribute("data-track-index")??L.getAttribute("data-track")??"",10)||T,kind:"element",tagName:ne,compositionId:L.getAttribute("data-composition-id"),compositionAncestors:G?[G]:[],parentCompositionId:G,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:Q,timelineLabel:L.getAttribute("data-timeline-label"),timelineGroup:L.getAttribute("data-timeline-group"),timelinePriority:Se(L.getAttribute("data-timeline-priority"))}),U.add(L.id))}}jo(X);for(let T of l){if(T===a)continue;let D=T.getAttribute("data-composition-id");if(!D||!c(D))continue;let L=i.resolveStartForElement(T,0),Q=on(T);if((Q==null||Q<=0)&&di(T)!=null){let j=di(T);Q=Math.max(0,j-L)}let ne=r(D),_=Q&&Q>0?Q:ne;if(_==null||_<=0)continue;let I=H(L,_);I<=0||R.push({id:D,label:T.getAttribute("data-label")??D,start:L,duration:I,thumbnailUrl:rt(T.getAttribute("data-thumbnail-url")),avatarName:null})}let J=Math.max(1,Math.min(Math.max(ee||1,N??0),n.maxTimelineDurationSeconds));return{source:"hf-preview",type:"timeline",durationInFrames:F&&Y==null?Number.POSITIVE_INFINITY:Math.max(1,Math.round(J*Math.max(1,n.canonicalFps))),clips:X,scenes:R,compositionWidth:Se(a?.getAttribute("data-width"))??1920,compositionHeight:Se(a?.getAttribute("data-height"))??1080}}var re=Lo(Ir(),1),Wr=re.default,Ru=re.default.stringify,Tu=re.default.fromJSON,vu=re.default.plugin,Bu=re.default.parse,Ou=re.default.list,Pu=re.default.document,_u=re.default.comment,Iu=re.default.atRule,Wu=re.default.rule,Hu=re.default.decl,Uu=re.default.root,qu=re.default.CssSyntaxError,zu=re.default.Declaration,ju=re.default.Container,Gu=re.default.Processor,$u=re.default.Document,Vu=re.default.Comment,Ku=re.default.Warning,Ju=re.default.AtRule,Qu=re.default.Result,Yu=re.default.Input,Zu=re.default.Rule,Xu=re.default.Root,ec=re.default.Node;function Tn(n){return n.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function dl(n){return n.replace(/\\\\/g,"\\\\\\\\").replace(/"/g,\'\\\\"\')}function fl(n,e,t){let i=ml(n,e,t),r=i.trim();if(!r||/^(html|body|:root|\\*)$/i.test(r))return n;if(new RegExp(`data-composition-id\\\\s*=\\\\s*(["\'])${Tn(t)}\\\\1`).test(r))return i;let s=i.match(/^\\s*/)?.[0]??"",c=i.match(/\\s*$/)?.[0]??"";return`${s}${e} ${r}${c}`}function ml(n,e,t){let i=Tn(t),r=String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${i}"|\'${i}\')\\s*\\]`,o=String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`;return n.replace(new RegExp(`${r}(?:${o})+`,"g"),e).replace(new RegExp(`(?:${o})+${r}`,"g"),e)}var pl=new Set(["keyframes","-webkit-keyframes","font-face"]);function hl(n){return n?.type==="atrule"}function xl(n){let e=n.parent;for(;e;){if(hl(e)&&pl.has(e.name.toLowerCase()))return!0;e=e.parent}return!1}function vn(n,e){let t=e.trim();if(!n||!t)return n;let i=`[data-composition-id="${dl(t)}"]`,r=Wr.parse(n);return r.walkRules(o=>{xl(o)||(o.selectors=o.selectors.map(s=>fl(s,i,t)))}),r.toResult({map:!1}).css}function Hr(n,e,t="[HyperFrames] composition script error:"){let i=JSON.stringify(e),r=JSON.stringify(t),o=Tn(e),s=JSON.stringify(String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${o}"|\'${o}\')\\s*\\]`),c=JSON.stringify(String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`);return`(function(){\n var __hfCompId = ${i};\n var __hfErrorLabel = ${r};\n var __hfEscapeAttr = function(value) {\n return (value + "").replace(/\\\\\\\\/g, "\\\\\\\\\\\\\\\\").replace(/"/g, "\\\\\\\\\\\\"");\n };\n var __hfRootSelector = __hfCompId\n ? \'[data-composition-id="\' + __hfEscapeAttr(__hfCompId) + \'"]\'\n : "";\n var __hfRoot = null;\n var __hfRootSelectorPattern = ${s};\n var __hfTimingSelectorPattern = ${c};\n var __hfNormalizeSelector = function(selector) {\n if (!__hfCompId || typeof selector !== "string") return selector;\n return selector\n .replace(new RegExp(__hfRootSelectorPattern + \'(?:\' + __hfTimingSelectorPattern + \')+\', \'g\'), __hfRootSelector)\n .replace(new RegExp(\'(?:\' + __hfTimingSelectorPattern + \')+\' + __hfRootSelectorPattern, \'g\'), __hfRootSelector);\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 __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") {\n return function(id) {\n var found = target.getElementById(id);\n return found && __hfContains(found) ? found : null;\n };\n }\n var value = Reflect.get(target, prop, receiver);\n return typeof value === "function" ? value.bind(target) : value;\n },\n })\n : window.document;\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 (_err) {}\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.slice.call(root.querySelectorAll(selector));\n };\n };\n }\n var value = Reflect.get(utilsTarget, utilsProp, utilsReceiver);\n return typeof value === "function" ? value.bind(utilsTarget) : value;\n },\n });\n }\n var value = Reflect.get(target, prop, receiver);\n return typeof value === "function" ? value.bind(target) : value;\n },\n });\n var __hfRun = function() {\n try {\n (function(document, gsap) {\n${n}\n }).call(window, __hfScopedDocument, __hfScopedGsap);\n } catch (_err) {\n console.error(__hfErrorLabel, __hfCompId, _err);\n }\n };\n __hfFindRoot();\n __hfRun();\n})()`}var gl=8e3,Sl=/^(?![a-zA-Z][a-zA-Z\\d+\\-.]*:)(?!\\/\\/)(?!\\/)(?!\\.\\.?\\/).+/,yl=n=>new Promise(e=>{let t=!1,i=Date.now(),r=null,o=s=>{t||(t=!0,r!=null&&window.clearTimeout(r),e({status:s,elapsedMs:Math.max(0,Date.now()-i)}))};n.addEventListener("load",()=>o("load"),{once:!0}),n.addEventListener("error",()=>o("error"),{once:!0}),r=window.setTimeout(()=>o("timeout"),gl)});function Bn(n){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=""}function Ur(n,e){let t=n.trim();if(!t)return n;try{return Sl.test(t)?new URL(t,document.baseURI).toString():e?new URL(t,e).toString():new URL(t,document.baseURI).toString()}catch{return n}}async function On(n){let e=null;n.hostCompositionId&&(e=Array.from(n.sourceNode.querySelectorAll("[data-composition-id]")).find(l=>l.getAttribute("data-composition-id")===n.hostCompositionId)??null);let t=e??n.sourceNode,i=e?.getAttribute("data-composition-id")?.trim()||n.hostCompositionId||null;if(n.headStyles)for(let a of n.headStyles){let l=a.cloneNode(!0);l instanceof HTMLStyleElement&&(i&&(l.textContent=vn(l.textContent||"",i)),document.head.appendChild(l),n.injectedStyles.push(l))}let r=Array.from(t.querySelectorAll("style"));for(let a of r){let l=a.cloneNode(!0);l instanceof HTMLStyleElement&&(i&&(l.textContent=vn(l.textContent||"",i)),document.head.appendChild(l),n.injectedStyles.push(l))}let o=[];if(n.headScripts)for(let a of n.headScripts){let l=a.getAttribute("type")?.trim()??"",f=a.getAttribute("src")?.trim()??"";if(f){let m=Ur(f,n.compositionUrl);o.push({kind:"external",src:m,type:l})}else{let m=a.textContent?.trim()??"";m&&o.push({kind:"inline",content:m,type:l,scopeCompositionId:i})}}let s=Array.from(t.querySelectorAll("script")),c=[...o];for(let a of s){let l=a.getAttribute("type")?.trim()??"",f=a.getAttribute("src")?.trim()??"";if(f){let m=Ur(f,n.compositionUrl);c.push({kind:"external",src:m,type:l})}else{let m=a.textContent?.trim()??"";m&&c.push({kind:"inline",content:m,type:l,scopeCompositionId:i})}a.parentNode?.removeChild(a)}let u=Array.from(t.querySelectorAll("style"));for(let a of u)a.parentNode?.removeChild(a);if(e){let a=document.importNode(e,!0),l=e.getAttribute("data-width"),f=e.getAttribute("data-height"),m=n.parseDimensionPx(l),h=n.parseDimensionPx(f);for(l&&n.host.setAttribute("data-width",l),f&&n.host.setAttribute("data-height",f),m&&n.host instanceof HTMLElement&&(n.host.style.width=m),h&&n.host instanceof HTMLElement&&(n.host.style.height=h);a.firstChild;)n.host.appendChild(a.firstChild)}else n.hasTemplate?n.host.appendChild(document.importNode(t,!0)):n.host.innerHTML=n.fallbackBodyInnerHtml;for(let a of c){let l=document.createElement("script");if(a.type&&(l.type=a.type),l.async=!1,a.kind==="external"?l.src=a.src:a.type.toLowerCase()==="module"?l.textContent=a.content:a.scopeCompositionId?l.textContent=Hr(a.content,a.scopeCompositionId):l.textContent=`(function(){${a.content}})();`,document.body.appendChild(l),n.injectedScripts.push(l),a.kind==="external"){let f=await yl(l);f.status!=="load"&&n.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:n.hostCompositionId,hostCompositionSrc:n.hostCompositionSrc,resolvedScriptSrc:a.src,loadStatus:f.status,elapsedMs:f.elapsedMs}})}}}async function qr(n){let e=Array.from(document.querySelectorAll("[data-composition-id]:not([data-composition-src])")).filter(t=>{if(t.children.length>0)return!1;let i=t.getAttribute("data-composition-id");return i?!!document.querySelector(`template#${CSS.escape(i)}-template`):!1});if(e.length!==0)for(let t of e){let i=t.getAttribute("data-composition-id"),r=document.querySelector(`template#${CSS.escape(i)}-template`);Bn(t),await On({host:t,hostCompositionId:i,hostCompositionSrc:`template#${i}-template`,sourceNode:r.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:n.injectedStyles,injectedScripts:n.injectedScripts,parseDimensionPx:n.parseDimensionPx,onDiagnostic:n.onDiagnostic})}}async function zr(n){let e=Array.from(document.querySelectorAll("[data-composition-src]"));e.length!==0&&await Promise.all(e.map(async t=>{let i=t.getAttribute("data-composition-src");if(!i)return;let r=null;try{r=new URL(i,document.baseURI)}catch{r=null}Bn(t);try{let o=t.getAttribute("data-composition-id"),s=o!=null?document.querySelector(`template#${CSS.escape(o)}-template`):null;if(s){await On({host:t,hostCompositionId:o,hostCompositionSrc:i,sourceNode:s.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:r,injectedStyles:n.injectedStyles,injectedScripts:n.injectedScripts,parseDimensionPx:n.parseDimensionPx,onDiagnostic:n.onDiagnostic});return}let c=await fetch(i);if(!c.ok)throw new Error(`HTTP ${c.status}`);let u=await c.text(),l=new DOMParser().parseFromString(u,"text/html"),f=(o?l.querySelector(`template#${CSS.escape(o)}-template`):null)??l.querySelector("template"),m=f?f.content:l.body,h=f?void 0:Array.from(l.head.querySelectorAll("style")),M=f?void 0:Array.from(l.head.querySelectorAll("script"));await On({host:t,hostCompositionId:o,hostCompositionSrc:i,sourceNode:m,hasTemplate:!!f,fallbackBodyInnerHtml:l.body.innerHTML,compositionUrl:r,injectedStyles:n.injectedStyles,injectedScripts:n.injectedScripts,parseDimensionPx:n.parseDimensionPx,headStyles:h,headScripts:M,onDiagnostic:n.onDiagnostic})}catch(o){n.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:t.getAttribute("data-composition-id"),hostCompositionSrc:i,errorMessage:o instanceof Error?o.message:"unknown_error"}}),Bn(t)}}))}function Pn(){let n=window.gsap;n&&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 t=[],i=document.querySelectorAll(".caption-group");for(let r of i){let o=r.querySelectorAll(":scope > span");for(let s of o)t.push(s)}for(let r of e){let o=null;if(r.wordId&&(o=document.getElementById(r.wordId)),!o&&r.wordIndex!==void 0&&(o=t[r.wordIndex]??null),!o||!(o instanceof HTMLElement))continue;let s={},c={};if(r.x!==void 0&&(s.x=r.x),r.y!==void 0&&(s.y=r.y),r.scale!==void 0&&(s.scale=r.scale),r.rotation!==void 0&&(s.rotation=r.rotation),r.opacity!==void 0&&(c.opacity=r.opacity),r.fontSize!==void 0&&(c.fontSize=`${r.fontSize}px`),r.fontWeight!==void 0&&(c.fontWeight=r.fontWeight),r.fontFamily!==void 0&&(c.fontFamily=r.fontFamily),r.activeColor||r.dimColor){let a=n.getTweensOf(o).filter(f=>f.vars.color!==void 0).sort((f,m)=>f.startTime()-m.startTime()),l=a.length>0?String(a[0].vars.color):"";for(let f of a)String(f.vars.color)===l?r.dimColor&&(f.vars.color=r.dimColor):r.activeColor&&(f.vars.color=r.activeColor);r.dimColor&&n.set(o,{color:r.dimColor})}if(Object.keys(c).length>0&&n.set(o,c),Object.keys(s).length>0){let u=document.createElement("span");u.style.display="inline-block",u.dataset.captionWrapper="true",o.parentNode?.insertBefore(u,o),u.appendChild(o),n.set(u,s)}}}).catch(()=>{})}var jr="data-hf-authored-duration",Gr="data-hf-authored-end";function $r(){let n=ci(),e=window,t=null,i=null,r=[],o=new Set,s=null;if(typeof e.__hfRuntimeTeardown=="function")try{e.__hfRuntimeTeardown()}catch{}document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden"),window.__timelines=window.__timelines||{};let c=d=>{r.push(d)},u=(d,g,x)=>{let w=x??`${d}:${JSON.stringify(g)}`;o.has(w)||(o.add(w),ge({source:"hf-preview",type:"diagnostic",code:d,details:g}))},a=d=>{let g={scale:1,focusX:960,focusY:540},x=[],w=[],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:()=>g,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>x,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:()=>w,getRenderState:()=>({...E,time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying()})}},l=1/60,f=.75,m=.75,h=.35,M=900,C=3,A=2,z=.05,P=100,k=240,Y=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??"")}},y=d=>{let g=d.toLowerCase();return g.includes("cannot read properties of null")||g.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:g.includes("failed to execute \'queryselector\'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:g.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},p=d=>{if(d==null||d.trim()==="")return null;let g=Number.parseFloat(d);return!Number.isFinite(g)||g<=0?null:`${g}px`},S=()=>{let d=document.querySelector(\'[data-composition-id][data-root="true"]\');if(d instanceof HTMLElement)return d;let g=Array.from(document.querySelectorAll("[data-composition-id]"));return g.length===0?null:g.find(x=>!x.parentElement?.closest("[data-composition-id]"))??g[0]??null},F=()=>{let d=S();if(!d)return;let g=p(d.getAttribute("data-width")),x=p(d.getAttribute("data-height"));g&&(d.style.width=g),x&&(d.style.height=x),g&&d.style.setProperty("--comp-width",g),x&&d.style.setProperty("--comp-height",x)},b=()=>{let d=S(),g=Array.from(document.querySelectorAll("[data-composition-id]")).filter(x=>x.hasAttribute("data-duration")||x.hasAttribute("data-end"));for(let x of g){if(d&&x===d)continue;let w=x.getAttribute("data-duration"),E=x.getAttribute("data-end");w!=null&&!x.hasAttribute(jr)&&x.setAttribute(jr,w),E!=null&&!x.hasAttribute(Gr)&&x.setAttribute(Gr,E),x.removeAttribute("data-duration"),x.removeAttribute("data-end")}},N=()=>{let d=S();if(!d)return;d.style.position||(d.style.position="relative"),d.style.overflow="hidden";let g=p(d.getAttribute("data-width")),x=p(d.getAttribute("data-height"));g&&(d.style.width=g),x&&(d.style.height=x);let w=Array.from(d.children);for(let E of w){let O=E.tagName.toLowerCase();if(O==="script"||O==="style"||O==="link"||O==="meta"||!E.hasAttribute("data-start"))continue;let le=(E.style.top==="0px"||E.style.top==="0")&&(E.style.left==="0px"||E.style.left==="0")&&E.style.width==="100%"&&E.style.height==="100%",ae=/translate\\(\\s*-50%\\s*,\\s*-50%\\s*\\)/.test(E.style.transform);if(le&&ae&&!E.hasAttribute("data-width")&&!E.hasAttribute("data-height")){let ye=E.style.top,ue=E.style.left,tt=E.style.width,ie=E.style.height;E.style.top="",E.style.left="",E.style.width="",E.style.height="";let $=window.getComputedStyle(E);$.top!=="auto"||$.bottom!=="auto"||$.left!=="auto"||$.right!=="auto"||$.width!=="0px"||$.height!=="0px"||(E.style.top=ye,E.style.left=ue,E.style.width=tt,E.style.height=ie)}let V=window.getComputedStyle(E),we=V.position;if(we!=="absolute"&&we!=="fixed"&&(E.style.position="absolute"),!!E.style.top||!!E.style.bottom||V.top!=="auto"||V.bottom!=="auto"||(E.style.top="0"),!!E.style.left||!!E.style.right||V.left!=="auto"||V.right!=="auto"||(E.style.left="0"),O!=="audio"){let ye=p(E.getAttribute("data-width")),ue=p(E.getAttribute("data-height")),tt=V.width!=="0px"&&V.width!=="auto",ie=V.height!=="0px"&&V.height!=="auto";ye?!E.style.width&&!tt&&(E.style.width=ye):!E.style.width&&V.width==="0px"&&(E.style.width="100%"),ue?!E.style.height&&!ie&&(E.style.height=ue):!E.style.height&&V.height==="0px"&&(E.style.height="100%")}}},B=(d,g=0,x)=>He({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:x?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(d,g),W=(d,g)=>He({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:g?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(d),H=!!document.querySelector("[data-composition-src]"),X=!1;{let d=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let g of d){let x=g.getAttribute("data-composition-id");if(x&&g.children.length===0&&document.querySelector(`template#${CSS.escape(x)}-template`)){X=!0;break}}}let R=!H&&!X,Z=d=>{if(!d||typeof d.duration!="function")return null;try{let g=Number(d.duration());return Number.isFinite(g)?Math.max(0,g):null}catch{return null}},ee=d=>typeof d=="number"&&Number.isFinite(d)&&d>l,U=d=>{let g=Number(d.getAttribute("data-duration"));if(Number.isFinite(g)&&g>0)return g;let x=Number(d.getAttribute("data-playback-start")??d.getAttribute("data-media-start")??"0"),w=Number.isFinite(x)?Math.max(0,x):0;return Number.isFinite(d.duration)&&d.duration>w?Math.max(0,d.duration-w):null},G=()=>{let d=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(d.length===0)return null;let g=0;for(let x of d){let w=B(x,0);if(!Number.isFinite(w))continue;let E=U(x);E==null||E<=l||(g=Math.max(g,Math.max(0,w)+E))}return g>l?g:null},v=()=>{let d=S();if(!d)return null;let g=window.__timelines??{},x=He({timelineRegistry:g,includeAuthoredTimingAttrs:!0}),w=0,E=Array.from(d.querySelectorAll("[data-composition-id][data-start]"));for(let O of E){if(!(O instanceof Element)||O.parentElement?.closest("[data-composition-id]")!==d)continue;let ae=x.resolveStartForElement(O,0),V=x.resolveDurationForElement(O);!Number.isFinite(ae)||V==null||V<=0||(w=Math.max(w,Math.max(0,ae)+V))}return w>l?w:null},J=()=>{let d=G();return typeof d!="number"||!Number.isFinite(d)||d<=l?null:d},Ee=d=>ee(d)?Math.max(l,d*f):l,xe=(d,g=0)=>{let x=Z(d),w=J(),E=v(),O=Math.max(w??0,E??0),le=Number.isFinite(g)&&g>l?g:0,ae=0;ee(x)?ae=Math.max(x,O,le):ee(O)?ae=Math.max(O,le):ae=le;let V=Math.max(1,Number(n.maxTimelineDurationSeconds)||1800);return ae>0?Math.max(0,Math.min(ae,V)):0},T=()=>{let d=window.__timelines??{},g=He({timelineRegistry:d,includeAuthoredTimingAttrs:!0}),x=J(),w=v(),E=Math.max(x??0,w??0)||null,O=Ee(E),le=ie=>{let $=document.querySelector(`[data-composition-id="${CSS.escape(ie)}"]`);return $?g.resolveStartForElement($,0):0},ae=ie=>{let $=window.gsap;if(!$||typeof $.timeline!="function")return null;let oe=$.timeline({paused:!0});for(let pe of ie)oe.add(pe.timeline,le(pe.compositionId));return oe},V=(ie,$)=>{if(!ee(ie))return null;let oe=window.gsap;if(!oe||typeof oe.timeline!="function")return null;let pe=oe.timeline({paused:!0});if($)try{pe.add($,0)}catch{}let he=pe;if(typeof he.to=="function")try{he.to({},{duration:ie})}catch{}return pe},we=(ie,$)=>{let oe=ie;if(typeof oe.getChildren!="function")return[];try{let pe=oe.getChildren(!0,!0,!0)??[];if(!Array.isArray(pe))return[];let he=[];for(let se of $)if(!pe.some(Ie=>Ie===se.timeline))try{let Ie=le(se.compositionId);ie.add(se.timeline,Ie),he.push(se.compositionId)}catch{}return he}catch{return[]}},Te=S(),de=Te?.getAttribute("data-composition-id")??null;if(!de)return{timeline:null};let me=d[de]??null,ue=(()=>{if(!Te)return[];let ie=new Set,$=Array.from(Te.querySelectorAll("[data-composition-id]")),oe=[];for(let pe of $){let he=pe.getAttribute("data-composition-id");if(!he||he===de||ie.has(he))continue;ie.add(he);let se=d[he]??null;if(!se||typeof se.play!="function"||typeof se.pause!="function")continue;let Ae=Z(se);oe.push({compositionId:he,timeline:se,durationSeconds:Ae??0})}return oe})(),tt=ie=>{for(let $ of ie){let oe=$.timeline;if(typeof oe.paused=="function")try{oe.paused(!1)}catch{}}};if(ue.length>0&&tt(ue),me){let ie=ue.length>0?we(me,ue):[];if((ue.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id=\'"+de+"\'])"))&&(L=!0),ie.length>0)try{let se=me.time();me.seek(se,!1)}catch{}let $=Z(me);if(!ee($)&&ue.length>0){let se=ue.map(bo=>bo.compositionId),Ae=ae(ue),Ie=Z(Ae);if(Ae&&ee(Ie))return{timeline:Ae,selectedTimelineIds:se,selectedDurationSeconds:Ie,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:de,rootDurationSeconds:$,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:O,selectedDurationSeconds:Ie,mediaDurationFloorSeconds:x,authoredCompositionDurationFloorSeconds:w,selectedTimelineIds:se,autoNestedChildren:ie}}};let Xt=V(E??0,me),en=Z(Xt);if(Xt&&ee(en))return{timeline:Xt,selectedTimelineIds:[de],selectedDurationSeconds:en,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:de,rootDurationSeconds:$,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:x,authoredCompositionDurationFloorSeconds:w,selectedDurationSeconds:en,selectedTimelineIds:[de],autoNestedChildren:ie}}}}if(!ee($)&&ue.length===0){let se=V(E??0,me),Ae=Z(se);if(se&&ee(Ae))return{timeline:se,selectedTimelineIds:[de],selectedDurationSeconds:Ae,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:de,rootDurationSeconds:$,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:x,authoredCompositionDurationFloorSeconds:w,selectedDurationSeconds:Ae,selectedTimelineIds:[de]}}}}let oe=Te?.getAttribute("data-duration"),pe=oe?parseFloat(oe):null,he=Math.max(ee(pe)?pe:0,w??0);if(he>0&&ee(he)&&ee($)&&he>=$+.5){let se=me;if(typeof se.to=="function")try{se.to({},{duration:0},he)}catch{}let Ae=Z(me);if(ee(Ae))return{timeline:me,selectedTimelineIds:[de],selectedDurationSeconds:Ae,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:de,rootDurationSeconds:$,rootDeclaredDur:pe,authoredCompositionDurationFloorSeconds:w,newDur:Ae}}}}return{timeline:me,selectedTimelineIds:[de],selectedDurationSeconds:$,mediaDurationFloorSeconds:x,diagnostics:ie.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:de,selectedDurationSeconds:$,autoNestedChildren:ie}}:void 0}}if(ue.length>0){let ie=ue.map(pe=>pe.compositionId),$=ae(ue),oe=Z($);if($)return{timeline:$,selectedTimelineIds:ie,selectedDurationSeconds:oe,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:de,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:O,selectedDurationSeconds:oe,mediaDurationFloorSeconds:x,selectedTimelineIds:ie}}}}return{timeline:null}},D=()=>{let d=n.capturedTimeline;if(!d||typeof d.time!="function")return;let g=Number(d.time());Number.isFinite(g)&&(n.currentTime=Math.max(0,g))},L=!1,Q=()=>{if(!R)return!1;let d=n.capturedTimeline,g=Z(d),x=ee(g);if(d&&x&&L)return!1;let w=T();return w.timeline?d&&d===w.timeline?(typeof d.timeScale=="function"&&d.timeScale(n.playbackRate),!1):(n.capturedTimeline=w.timeline,typeof n.capturedTimeline.timeScale=="function"&&n.capturedTimeline.timeScale(n.playbackRate),w.diagnostics&&ge({source:"hf-preview",type:"diagnostic",code:w.diagnostics.code,details:w.diagnostics.details}),ge({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:w.selectedTimelineIds??[],selectedDurationSeconds:w.selectedDurationSeconds??null,mediaDurationFloorSeconds:w.mediaDurationFloorSeconds??null}}),!0):!1},ne=()=>{let d=S();if(!(d instanceof HTMLElement))return;let g=d.getBoundingClientRect(),x=Number(d.getAttribute("data-width")),w=Number(d.getAttribute("data-height")),E=window.getComputedStyle(d),O=Number.isFinite(x)&&x>0&&Number.isFinite(w)&&w>0,le=g.width<=0||g.height<=0||d.clientWidth<=0||d.clientHeight<=0;!O||!le||u("root_stage_layout_zero",{compositionId:d.getAttribute("data-composition-id")??null,declaredWidth:x,declaredHeight:w,rectWidth:Math.round(g.width),rectHeight:Math.round(g.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"}`)},_=()=>{n.tornDown||(s!=null&&window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{s=null,ne()}))},I=()=>{t=d=>{let g=Y(d.error??d.message).slice(0,k);if(!g)return;let x=y(g);ge({source:"hf-preview",type:"diagnostic",code:x.code,details:{category:x.category,message:g,filename:d.filename||null,line:Number.isFinite(d.lineno)?d.lineno:null,column:Number.isFinite(d.colno)?d.colno:null}})},i=d=>{let g=Y(d.reason).slice(0,k);if(!g)return;let x=y(g);ge({source:"hf-preview",type:"diagnostic",code:`${x.code}_unhandled_rejection`,details:{category:`${x.category}-unhandled-rejection`,message:g}})},window.addEventListener("error",t),window.addEventListener("unhandledrejection",i)},j=()=>{let d=Array.from(document.querySelectorAll("img, video, audio, source, link[rel=\'stylesheet\']"));for(let x of d){let w=()=>{if(!(x instanceof Element))return;let E=x.tagName.toLowerCase(),O=x.getAttribute("src")??x.getAttribute("href")??x.getAttribute("poster")??null,le=E==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";u(le,{tagName:E,assetUrl:O,currentSrc:(x instanceof HTMLImageElement||x instanceof HTMLMediaElement)&&x.currentSrc||null,readyState:x instanceof HTMLMediaElement?x.readyState:null,networkState:x instanceof HTMLMediaElement?x.networkState:null},`${le}:${E}:${O??"unknown"}`)};x.addEventListener("error",w),c(()=>{x.removeEventListener("error",w)})}let g=document.fonts;g&&g.ready.then(()=>{if(n.tornDown)return;let x=Array.from(g).filter(w=>w.status==="error").map(w=>w.family).filter(w=>!!w).slice(0,10);x.length!==0&&u("runtime_font_load_issue",{failedFamilies:x,totalFaces:Array.from(g).length},`runtime-font-load-issue:${x.join("|")}`)}).catch(()=>{})},Ne=(d,g)=>{if(!d.timeline)return!1;let x=n.capturedTimeline;if(x&&x===d.timeline)return!1;let w=Math.max(0,n.currentTime||0),E=n.isPlaying;n.capturedTimeline=d.timeline,typeof n.capturedTimeline.timeScale=="function"&&n.capturedTimeline.timeScale(n.playbackRate);try{n.capturedTimeline.pause(),n.capturedTimeline.seek(w,!1),E&&n.capturedTimeline.play()}catch{}return ge({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:g,previousTime:w,selectedTimelineIds:d.selectedTimelineIds??[],selectedDurationSeconds:d.selectedDurationSeconds??null,mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),!0},ce=null,ze=!1,Fe=new Set,wt=()=>{n.tornDown||(ce!=null&&window.clearTimeout(ce),ce=window.setTimeout(()=>{if(n.tornDown)return;ce=null;let d=T();if(!d.timeline||!ee(d.mediaDurationFloorSeconds??null))return;if(!n.capturedTimeline){Q()&&(je(),Re(!0));return}if(ze)return;let x=Z(n.capturedTimeline),w=d.selectedDurationSeconds??Z(d.timeline);ee(w)&&(!ee(x)||w>=x+z)&&Ne(d,"manual")&&(ze=!0,ge({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:x??null,selectedDurationSeconds:w??null,selectedTimelineIds:d.selectedTimelineIds??[],mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),je(),Re(!0))},P))},Ao=()=>{for(let d of Fe)d.removeEventListener("loadedmetadata",wt),d.removeEventListener("durationchange",wt);Fe.clear()},Jt=()=>{if(n.tornDown)return;let d=Array.from(document.querySelectorAll("video, audio"));for(let g of d)Fe.has(g)||(Fe.add(g),g.addEventListener("loadedmetadata",wt),g.addEventListener("durationchange",wt),g.preload!=="auto"&&(g.preload="auto"),g.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&g.load())},Gn=()=>{let d=E=>{let O=E.closest("[data-composition-id]"),le=O?B(O,0):null,ae=O?W(O,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:O,inheritedStart:le,inheritedDuration:ae}},g=oi({shouldIncludeElement:E=>E.hasAttribute("data-start")||!!d(E).compositionRoot,resolveStartSeconds:E=>{let O=d(E);return B(E,O.inheritedStart??0)},resolveDurationSeconds:E=>{let O=d(E),le=B(E,O.inheritedStart??0),ae=Number.parseFloat(E.dataset.playbackStart??E.dataset.mediaStart??"0")||0,V=O.inheritedStart!=null&&O.inheritedDuration!=null&&O.inheritedDuration>0?Math.max(0,O.inheritedStart+O.inheritedDuration-le):null,we=Number.isFinite(E.duration)&&E.duration>ae?Math.max(0,E.duration-ae):null;return we!=null&&V!=null?Math.min(we,V):we??V}});si({clips:g.mediaClips,timeSeconds:n.currentTime,playing:n.isPlaying,playbackRate:n.playbackRate,outputMuted:n.mediaOutputMuted,userMuted:n.bridgeMuted,onAutoplayBlocked:()=>{n.mediaAutoplayBlockedPosted||(n.mediaAutoplayBlockedPosted=!0,ge({source:"hf-preview",type:"media-autoplay-blocked"}))}});let x=document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null,w=Array.from(document.querySelectorAll("[data-start]"));for(let E of w){if(!(E instanceof HTMLElement))continue;let O=E.tagName.toLowerCase();if(O==="script"||O==="style"||O==="link"||O==="meta")continue;if(!E.getAttribute("data-composition-id")){let ye=E.closest("[data-composition-id]")?.getAttribute("data-composition-id")??null;if(ye&&ye!==x)continue}let ae=B(E,0),V=W(E),we=E.getAttribute("data-composition-id");if(we){let me=(window.__timelines??{})[we],ye=null;if(me&&typeof me.duration=="function"){let ue=Number(me.duration());Number.isFinite(ue)&&ue>0&&(ye=ue)}V!=null&&V>0&&ye!=null?V=Math.min(V,ye):(V==null||V<=0)&&ye!=null&&(V=ye)}let Te=V!=null&&V>0?ae+V:Number.POSITIVE_INFINITY,de=n.currentTime>=ae&&(Number.isFinite(Te)?n.currentTime<Te:!0);E.style.visibility=de?"visible":"hidden"}},Re=d=>{D();let g=Math.max(0,Math.round((n.currentTime||0)*n.canonicalFps)),x=Date.now();(d||g!==n.bridgeLastPostedFrame||n.isPlaying!==n.bridgeLastPostedPlaying||n.bridgeMuted!==n.bridgeLastPostedMuted||x-n.bridgeLastPostedAt>=n.bridgeMaxPostIntervalMs)&&(n.bridgeLastPostedFrame=g,n.bridgeLastPostedPlaying=n.isPlaying,n.bridgeLastPostedMuted=n.bridgeMuted,n.bridgeLastPostedAt=x,ge({source:"hf-preview",type:"state",frame:g,isPlaying:n.isPlaying,muted:n.bridgeMuted,playbackRate:n.playbackRate}))},je=()=>{b(),F(),N();let d=S();if(d){let x=p(d.getAttribute("data-width")),w=p(d.getAttribute("data-height")),E=x?parseInt(x,10):0,O=w?parseInt(w,10):0;E>0&&O>0&&ge({source:"hf-preview",type:"stage-size",width:E,height:O})}Q();let g=mi({canonicalFps:n.canonicalFps,maxTimelineDurationSeconds:n.maxTimelineDurationSeconds});window.__clipManifest=g,ge(g),_()},et=(d,g=0)=>{for(let x of n.deterministicAdapters){try{d==="discover"&&x.discover(),d==="pause"&&x.pause(),d==="play"&&x.play&&x.play()}catch{}if(d==="discover")try{x.seek({time:g})}catch{}}};if(R)Pn();else{let d={injectedStyles:n.injectedCompStyles,injectedScripts:n.injectedCompScripts,parseDimensionPx:p,onDiagnostic:({code:g,details:x})=>{ge({source:"hf-preview",type:"diagnostic",code:g,details:x})}};zr(d).then(()=>qr(d)).finally(()=>{R=!0,et("discover",n.currentTime),Jt(),j(),Pn(),je(),Re(!0)})}let Ct=li({postMessage:d=>ge(d)});Ct.installPickerApi();let $n=d=>{let g=Number(d);!Number.isFinite(g)||g<=0?n.playbackRate=1:n.playbackRate=Math.max(.1,Math.min(5,g)),n.capturedTimeline&&typeof n.capturedTimeline.timeScale=="function"&&n.capturedTimeline.timeScale(n.playbackRate);let x=document.querySelectorAll("video, audio");for(let w of x)if(w instanceof HTMLMediaElement)try{w.playbackRate=n.playbackRate}catch{}},fe=ui({getTimeline:()=>n.capturedTimeline,setTimeline:d=>{n.capturedTimeline=d},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>n.isPlaying,setIsPlaying:d=>{n.isPlaying=d},getPlaybackRate:()=>n.playbackRate,setPlaybackRate:$n,getCanonicalFps:()=>n.canonicalFps,onSyncMedia:(d,g)=>{n.currentTime=Math.max(0,Number(d)||0),n.isPlaying=g,Gn()},onStatePost:Re,onDeterministicSeek:d=>{for(let g of n.deterministicAdapters)try{g.seek({time:Number(d)||0})}catch{}},onDeterministicPause:()=>et("pause"),onDeterministicPlay:()=>et("play"),onRenderFrameSeek:()=>{},onShowNativeVideos:()=>{},getSafeDuration:()=>xe(n.capturedTimeline,0)});window.__player=a(fe),window.__playerReady=!0,window.__renderReady=!0,Yn(ge),nt("composition_loaded",{duration:fe.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),n.controlBridgeHandler=Qn({onPlay:()=>{fe.play(),nt("composition_played",{time:fe.getTime()})},onPause:()=>{fe.pause(),nt("composition_paused",{time:fe.getTime()})},onSeek:(d,g)=>{let x=Math.max(0,d)/n.canonicalFps;fe.seek(x),nt("composition_seeked",{time:x})},onSetMuted:d=>{n.bridgeMuted=d;let g=d||n.mediaOutputMuted,x=document.querySelectorAll("video, audio");for(let w of x)w instanceof HTMLMediaElement&&(w.muted=g)},onSetMediaOutputMuted:d=>{n.mediaOutputMuted=d;let g=d||n.bridgeMuted,x=document.querySelectorAll("video, audio");for(let w of x)w instanceof HTMLMediaElement&&(w.muted=g)},onSetPlaybackRate:d=>$n(d),onEnablePickMode:()=>Ct.enablePickMode(),onDisablePickMode:()=>Ct.disablePickMode()}),Q(),n.capturedTimeline&&(fe._timeline=n.capturedTimeline),R&&setTimeout(()=>{let d=n.capturedTimeline;Q()&&n.capturedTimeline!==d&&(fe._timeline=n.capturedTimeline),et("discover",n.currentTime),je(),Re(!0)},0),n.deterministicAdapters=[ri(),Zn({resolveStartSeconds:d=>B(d,0)}),ni(),ii(),Xn({getTimeline:()=>n.capturedTimeline})],I(),et("discover"),Jt(),n.timelinePollIntervalId&&clearInterval(n.timelinePollIntervalId);let Qt=0,Mt=null,Vn=0,Yt=!1,Ge=0,Kn=()=>{Vn=Date.now(),Yt=!1,Ge=0};n.timelinePollIntervalId=setInterval(()=>{Qt+=1;let g=n.isPlaying&&n.capturedTimeline!=null&&Math.max(0,n.currentTime||0)<A?!1:Q();if(n.capturedTimeline&&!fe._timeline&&(fe._timeline=n.capturedTimeline),(g||Qt%20===0)&&je(),Qt%10===0&&Jt(),D(),n.isPlaying&&n.capturedTimeline){let x=Math.max(0,n.currentTime||0),w=Mt,E=xe(n.capturedTimeline,0);if(E>0&&x>=E){fe.pause(),fe.seek(E),Mt=E,Ge=0,Re(!0);return}if(w!=null&&w>=m&&x<=h?Ge+=1:Ge=0,!Yt&&Ge>=C&&Date.now()-Vn>M){let le=T();Ne(le,"loop_guard")&&(Yt=!0,Ge=0)}Mt=Math.max(0,n.currentTime||0)}else Mt=Math.max(0,n.currentTime||0);n.isPlaying&&Gn(),Re(!1)},50),je(),Re(!0);let Eo=fe.seek;fe.seek=d=>{Kn(),Eo(d)};let Fo=fe.renderSeek;fe.renderSeek=d=>{Kn(),Fo(d)};let Zt=()=>{if(!n.tornDown){n.tornDown=!0,n.timelinePollIntervalId&&(clearInterval(n.timelinePollIntervalId),n.timelinePollIntervalId=null),ce!=null&&(window.clearTimeout(ce),ce=null),s!=null&&(window.cancelAnimationFrame(s),s=null),Ao(),n.controlBridgeHandler&&(window.removeEventListener("message",n.controlBridgeHandler),n.controlBridgeHandler=null),t&&(window.removeEventListener("error",t),t=null),i&&(window.removeEventListener("unhandledrejection",i),i=null),n.beforeUnloadHandler&&(window.removeEventListener("beforeunload",n.beforeUnloadHandler),n.beforeUnloadHandler=null),Ct.disablePickMode();for(let d of n.deterministicAdapters)if(!(!d||typeof d.revert!="function"))try{d.revert()}catch{}n.deterministicAdapters=[];for(let d of r.splice(0))try{d()}catch{}for(let d of n.injectedCompStyles)try{d.remove()}catch{}n.injectedCompStyles=[];for(let d of n.injectedCompScripts)try{d.remove()}catch{}n.injectedCompScripts=[],n.capturedTimeline=null,e.__hfRuntimeTeardown===Zt&&(e.__hfRuntimeTeardown=null)}};e.__hfRuntimeTeardown=Zt,n.beforeUnloadHandler=Zt,window.addEventListener("beforeunload",n.beforeUnloadHandler)}var Vr=["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"],_n=[[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 Al(n){if(n<=255)return Vr[n];let e=0,t=_n.length-1;for(;e<=t;){let i=e+t>>1,r=_n[i];if(n<r[0]){t=i-1;continue}if(n>r[1]){e=i+1;continue}return r[2]}return"L"}function El(n){let e=n.length;if(e===0)return null;let t=new Array(e),i=!1;for(let a=0;a<e;){let l=n.charCodeAt(a),f=l,m=1;if(l>=55296&&l<=56319&&a+1<e){let M=n.charCodeAt(a+1);M>=56320&&M<=57343&&(f=(l-55296<<10)+(M-56320)+65536,m=2)}let h=Al(f);(h==="R"||h==="AL"||h==="AN")&&(i=!0);for(let M=0;M<m;M++)t[a+M]=h;a+=m}if(!i)return null;let r=0;for(let a=0;a<e;a++){let l=t[a];if(l==="L"){r=0;break}if(l==="R"||l==="AL"){r=1;break}}let o=new Int8Array(e);for(let a=0;a<e;a++)o[a]=r;let s=r&1?"R":"L",c=s,u=c;for(let a=0;a<e;a++)t[a]==="NSM"?t[a]=u:u=t[a];u=c;for(let a=0;a<e;a++){let l=t[a];l==="EN"?t[a]=u==="AL"?"AN":"EN":(l==="R"||l==="L"||l==="AL")&&(u=l)}for(let a=0;a<e;a++)t[a]==="AL"&&(t[a]="R");for(let a=1;a<e-1;a++)t[a]==="ES"&&t[a-1]==="EN"&&t[a+1]==="EN"&&(t[a]="EN"),t[a]==="CS"&&(t[a-1]==="EN"||t[a-1]==="AN")&&t[a+1]===t[a-1]&&(t[a]=t[a-1]);for(let a=0;a<e;a++){if(t[a]!=="EN")continue;let l;for(l=a-1;l>=0&&t[l]==="ET";l--)t[l]="EN";for(l=a+1;l<e&&t[l]==="ET";l++)t[l]="EN"}for(let a=0;a<e;a++){let l=t[a];(l==="WS"||l==="ES"||l==="ET"||l==="CS")&&(t[a]="ON")}u=c;for(let a=0;a<e;a++){let l=t[a];l==="EN"?t[a]=u==="L"?"L":"EN":(l==="R"||l==="L")&&(u=l)}for(let a=0;a<e;a++){if(t[a]!=="ON")continue;let l=a+1;for(;l<e&&t[l]==="ON";)l++;let f=a>0?t[a-1]:c,m=l<e?t[l]:c,h=f!=="L"?"R":"L";if(h===(m!=="L"?"R":"L"))for(let C=a;C<l;C++)t[C]=h;a=l-1}for(let a=0;a<e;a++)t[a]==="ON"&&(t[a]=s);for(let a=0;a<e;a++){let l=t[a];(o[a]&1)===0?l==="R"?o[a]++:(l==="AN"||l==="EN")&&(o[a]+=2):(l==="L"||l==="AN"||l==="EN")&&o[a]++}return o}function Kr(n,e){let t=El(n);if(t===null)return null;let i=new Int8Array(e.length);for(let r=0;r<e.length;r++)i[r]=t[e[r]];return i}var Fl=/[ \\t\\n\\r\\f]+/g,bl=/[\\t\\n\\r\\f]| {2,}|^ | $/;function Nl(n){let e=n??"normal";return e==="pre-wrap"?{mode:e,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:e,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function wl(n){if(!bl.test(n))return n;let e=n.replace(Fl," ");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 Cl(n){return/[\\r\\f]/.test(n)?n.replace(/\\r\\n/g,`\n`).replace(/[\\r\\f]/g,`\n`):n.replace(/\\r\\n/g,`\n`)}var In=null,Ml;function Dl(){return In===null&&(In=new Intl.Segmenter(Ml,{granularity:"word"})),In}var kl=/\\p{Script=Arabic}/u,jt=/\\p{M}/u,no=/\\p{Nd}/u;function Jr(n){return kl.test(n)}function Qr(n){return n>=19968&&n<=40959||n>=13312&&n<=19903||n>=131072&&n<=173791||n>=173824&&n<=177983||n>=177984&&n<=178207||n>=178208&&n<=183983||n>=183984&&n<=191471||n>=191472&&n<=192093||n>=194560&&n<=195103||n>=196608&&n<=201551||n>=201552&&n<=205743||n>=205744&&n<=210041||n>=63744&&n<=64255||n>=12288&&n<=12351||n>=12352&&n<=12447||n>=12448&&n<=12543||n>=44032&&n<=55215||n>=65280&&n<=65519}function Me(n){for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);if(!(t<12288)){if(t>=55296&&t<=56319&&e+1<n.length){let i=n.charCodeAt(e+1);if(i>=56320&&i<=57343){let r=(t-55296<<10)+(i-56320)+65536;if(Qr(r))return!0;e++;continue}}if(Qr(t))return!0}}return!1}function Ll(n){let e=Vt(n);return e!==null&&($t.has(e)||Pe.has(e))}var Rl=new Set(["\\xA0","\\u202F","\\u2060","\\uFEFF"]);function Tl(n){return Me(n)}function vl(n){let e=Vt(n);return e!==null&&Rl.has(e)}function Gt(n){return!Ll(n)&&!vl(n)}var $t=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"]),Nt=new Set([\'"\',"(","[","{","\\u201C","\\u2018","\\xAB","\\u2039","\\uFF08","\\u3014","\\u3008","\\u300A","\\u300C","\\u300E","\\u3010","\\u3016","\\u3018","\\u301A"]),Hn=new Set(["\'","\\u2019"]),Pe=new Set([".",",","!","?",":",";","\\u060C","\\u061B","\\u061F","\\u0964","\\u0965","\\u104A","\\u104B","\\u104C","\\u104D","\\u104F",")","]","}","%",\'"\',"\\u201D","\\u2019","\\xBB","\\u203A","\\u2026"]),Bl=new Set([":",".","\\u060C","\\u061B"]),Ol=new Set(["\\u104F"]),Pl=new Set(["\\u201D","\\u2019","\\xBB","\\u203A","\\u300D","\\u300F","\\u3011","\\u300B","\\u3009","\\u3015","\\uFF09"]);function _l(n){if(Un(n))return!0;let e=!1;for(let t of n){if(Pe.has(t)){e=!0;continue}if(!(e&&jt.test(t)))return!1}return e}function Il(n){for(let e of n)if(!$t.has(e)&&!Pe.has(e))return!1;return n.length>0}function Wl(n){if(Un(n))return!0;for(let e of n)if(!Nt.has(e)&&!Hn.has(e)&&!jt.test(e))return!1;return n.length>0}function Un(n){let e=!1;for(let t of n)if(!(t==="\\\\"||jt.test(t))){if(Nt.has(t)||Pe.has(t)||Hn.has(t)){e=!0;continue}return!1}return e}function io(n,e){let t=e-1;if(t<=0)return Math.max(t,0);let i=n.charCodeAt(t);if(i<56320||i>57343)return t;let r=t-1;if(r<0)return t;let o=n.charCodeAt(r);return o>=55296&&o<=56319?r:t}function Vt(n){if(n.length===0)return null;let e=io(n,n.length);return n.slice(e)}function Hl(n){let e=Array.from(n),t=e.length;for(;t>0;){let i=e[t-1];if(jt.test(i)){t--;continue}if(Nt.has(i)||Hn.has(i)){t--;continue}break}return t<=0||t===e.length?null:{head:e.slice(0,t).join(""),tail:e.slice(t).join("")}}function Ul(n,e,t){return t==="text"&&!e&&n.length===1&&n!=="-"&&n!=="\\u2014"?n:null}function Yr(n,e,t,i){let r=e[i],o=n[i];if(r==null)return o;let s=t[i];if(o.length===s)return o;let c=r.repeat(s);return n[i]=c,c}function Zr(n,e){return n&&e!==null&&Bl.has(e)}function ql(n){let e=Vt(n);return e!==null&&Ol.has(e)}function zl(n){if(n.length<2||n[0]!==" ")return null;let e=n.slice(1);return/^\\p{M}+$/u.test(e)?{space:" ",marks:e}:null}function Kt(n){let e=n.length;for(;e>0;){let t=io(n,e),i=n.slice(t,e);if(Pl.has(i))return!0;if(!Pe.has(i))return!1;e=t}return!1}function jl(n,e){if(e.preserveOrdinarySpaces||e.preserveHardBreaks){if(n===" ")return"preserved-space";if(n===" ")return"tab";if(e.preserveHardBreaks&&n===`\n`)return"hard-break"}return n===" "?"space":n==="\\xA0"||n==="\\u202F"||n==="\\u2060"||n==="\\uFEFF"?"glue":n==="\\u200B"?"zero-width-break":n==="\\xAD"?"soft-hyphen":"text"}var Gl=/[\\x20\\t\\n\\xA0\\xAD\\u200B\\u202F\\u2060\\uFEFF]/;function be(n){return n.length===1?n[0]:n.join("")}function $l(n,e){let t=[];for(let i=n.length-1;i>=0;i--)t.push(n[i]);return t.push(e),be(t)}function Vl(n,e,t,i){if(!Gl.test(n))return[{text:n,isWordLike:e,kind:"text",start:t}];let r=[],o=null,s=[],c=t,u=!1,a=0;for(let l of n){let f=jl(l,i),m=f==="text"&&e;if(o!==null&&f===o&&m===u){s.push(l),a+=l.length;continue}o!==null&&r.push({text:be(s),isWordLike:u,kind:o,start:c}),o=f,s=[l],c=t+a,u=m,a+=l.length}return o!==null&&r.push({text:be(s),isWordLike:u,kind:o,start:c}),r}function Wn(n){return n==="space"||n==="preserved-space"||n==="zero-width-break"||n==="hard-break"}var Kl=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Jl(n,e){let t=n.texts[e];return t.startsWith("www.")?!0:Kl.test(t)&&e+1<n.len&&n.kinds[e+1]==="text"&&n.texts[e+1]==="//"}function Ql(n){return n.includes("?")&&(n.includes("://")||n.startsWith("www."))}function Yl(n){let e=n.texts.slice(),t=n.isWordLike.slice(),i=n.kinds.slice(),r=n.starts.slice();for(let s=0;s<n.len;s++){if(i[s]!=="text"||!Jl(n,s))continue;let c=[e[s]],u=s+1;for(;u<n.len&&!Wn(i[u]);){c.push(e[u]),t[s]=!0;let a=e[u].includes("?");if(i[u]="text",e[u]="",u++,a)break}e[s]=be(c)}let o=0;for(let s=0;s<e.length;s++){let c=e[s];c.length!==0&&(o!==s&&(e[o]=c,t[o]=t[s],i[o]=i[s],r[o]=r[s]),o++)}return e.length=o,t.length=o,i.length=o,r.length=o,{len:o,texts:e,isWordLike:t,kinds:i,starts:r}}function Zl(n){let e=[],t=[],i=[],r=[];for(let o=0;o<n.len;o++){let s=n.texts[o];if(e.push(s),t.push(n.isWordLike[o]),i.push(n.kinds[o]),r.push(n.starts[o]),!Ql(s))continue;let c=o+1;if(c>=n.len||Wn(n.kinds[c]))continue;let u=[],a=n.starts[c],l=c;for(;l<n.len&&!Wn(n.kinds[l]);)u.push(n.texts[l]),l++;u.length>0&&(e.push(be(u)),t.push(!0),i.push("text"),r.push(a),o=l-1)}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}var Xl=new Set([":","-","/","\\xD7",",",".","+","\\u2013","\\u2014"]),Xr=/^[A-Za-z0-9_]+[,:;]*$/,eo=/[,:;]+$/;function ro(n){for(let e of n)if(no.test(e))return!0;return!1}function bt(n){if(n.length===0)return!1;for(let e of n)if(!(no.test(e)||Xl.has(e)))return!1;return!0}function ea(n){let e=[],t=[],i=[],r=[];for(let o=0;o<n.len;o++){let s=n.texts[o],c=n.kinds[o];if(c==="text"&&bt(s)&&ro(s)){let u=[s],a=o+1;for(;a<n.len&&n.kinds[a]==="text"&&bt(n.texts[a]);)u.push(n.texts[a]),a++;e.push(be(u)),t.push(!0),i.push("text"),r.push(n.starts[o]),o=a-1;continue}e.push(s),t.push(n.isWordLike[o]),i.push(c),r.push(n.starts[o])}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function ta(n){let e=[],t=[],i=[],r=[];for(let o=0;o<n.len;o++){let s=n.texts[o],c=n.kinds[o],u=n.isWordLike[o];if(c==="text"&&u&&Xr.test(s)){let a=[s],l=eo.test(s),f=o+1;for(;l&&f<n.len&&n.kinds[f]==="text"&&n.isWordLike[f]&&Xr.test(n.texts[f]);){let m=n.texts[f];a.push(m),l=eo.test(m),f++}e.push(be(a)),t.push(!0),i.push("text"),r.push(n.starts[o]),o=f-1;continue}e.push(s),t.push(u),i.push(c),r.push(n.starts[o])}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function na(n){let e=[],t=[],i=[],r=[];for(let o=0;o<n.len;o++){let s=n.texts[o];if(n.kinds[o]==="text"&&s.includes("-")){let c=s.split("-"),u=c.length>1;for(let a=0;a<c.length;a++){let l=c[a];if(!u)break;(l.length===0||!ro(l)||!bt(l))&&(u=!1)}if(u){let a=0;for(let l=0;l<c.length;l++){let f=c[l],m=l<c.length-1?`${f}-`:f;e.push(m),t.push(!0),i.push("text"),r.push(n.starts[o]+a),a+=m.length}continue}}e.push(s),t.push(n.isWordLike[o]),i.push(n.kinds[o]),r.push(n.starts[o])}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function ia(n){let e=[],t=[],i=[],r=[],o=0;for(;o<n.len;){let s=[n.texts[o]],c=n.isWordLike[o],u=n.kinds[o],a=n.starts[o];if(u==="glue"){let l=[s[0]],f=a;for(o++;o<n.len&&n.kinds[o]==="glue";)l.push(n.texts[o]),o++;let m=be(l);if(o<n.len&&n.kinds[o]==="text")s[0]=m,s.push(n.texts[o]),c=n.isWordLike[o],u="text",a=f,o++;else{e.push(m),t.push(!1),i.push("glue"),r.push(f);continue}}else o++;if(u==="text")for(;o<n.len&&n.kinds[o]==="glue";){let l=[];for(;o<n.len&&n.kinds[o]==="glue";)l.push(n.texts[o]),o++;let f=be(l);if(o<n.len&&n.kinds[o]==="text"){s.push(f,n.texts[o]),c=c||n.isWordLike[o],o++;continue}s.push(f)}e.push(be(s)),t.push(c),i.push(u),r.push(a)}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function ra(n){let e=n.texts.slice(),t=n.isWordLike.slice(),i=n.kinds.slice(),r=n.starts.slice();for(let o=0;o<e.length-1;o++){if(i[o]!=="text"||i[o+1]!=="text"||!Me(e[o])||!Me(e[o+1]))continue;let s=Hl(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:t,kinds:i,starts:r}}function to(n,e,t){let i=Dl(),r=0,o=[],s=[],c=[],u=[],a=[],l=[],f=[],m=[],h=[],M=[],C=[],A=[];for(let p of i.segment(n))for(let S of Vl(p.segment,p.isWordLike??!1,p.index,t)){let Z=function(){l[R]!==null&&(s[R]=[Yr(o,l,f,R)],l[R]=null),s[R].push(S.text),c[R]=c[R]||S.isWordLike,m[R]=m[R]||N,h[R]=h[R]||B,M[R]=H,C[R]=X,A[R]=Zr(h[R],W)},F=S.kind==="text",b=Ul(S.text,S.isWordLike,S.kind),N=Me(S.text),B=Jr(S.text),W=Vt(S.text),H=Kt(S.text),X=ql(S.text),R=r-1;e.carryCJKAfterClosingQuote&&F&&r>0&&u[R]==="text"&&N&&m[R]&&M[R]||F&&r>0&&u[R]==="text"&&Il(S.text)&&m[R]||F&&r>0&&u[R]==="text"&&C[R]?Z():F&&r>0&&u[R]==="text"&&S.isWordLike&&B&&A[R]?(Z(),c[R]=!0):b!==null&&r>0&&u[R]==="text"&&l[R]===b?f[R]=(f[R]??1)+1:F&&!S.isWordLike&&r>0&&u[R]==="text"&&(_l(S.text)||S.text==="-"&&c[R])?Z():(o[r]=S.text,s[r]=[S.text],c[r]=S.isWordLike,u[r]=S.kind,a[r]=S.start,l[r]=b,f[r]=b===null?0:1,m[r]=N,h[r]=B,M[r]=H,C[r]=X,A[r]=Zr(B,W),r++)}for(let p=0;p<r;p++){if(l[p]!==null){o[p]=Yr(o,l,f,p);continue}o[p]=be(s[p])}for(let p=1;p<r;p++)u[p]==="text"&&!c[p]&&Un(o[p])&&u[p-1]==="text"&&(o[p-1]+=o[p],c[p-1]=c[p-1]||c[p],o[p]="");let z=Array.from({length:r},()=>null),P=-1;for(let p=r-1;p>=0;p--){let S=o[p];if(S.length!==0){if(u[p]==="text"&&!c[p]&&Wl(S)&&P>=0&&u[P]==="text"){let F=z[P]??[];F.push(S),z[P]=F,a[P]=a[p],o[p]="";continue}P=p}}for(let p=0;p<r;p++){let S=z[p];S!=null&&(o[p]=$l(S,o[p]))}let k=0;for(let p=0;p<r;p++){let S=o[p];S.length!==0&&(k!==p&&(o[k]=S,c[k]=c[p],u[k]=u[p],a[k]=a[p]),k++)}o.length=k,c.length=k,u.length=k,a.length=k;let Y=ia({len:k,texts:o,isWordLike:c,kinds:u,starts:a}),y=ra(ta(na(ea(Zl(Yl(Y))))));for(let p=0;p<y.len-1;p++){let S=zl(y.texts[p]);S!==null&&(y.kinds[p]!=="space"&&y.kinds[p]!=="preserved-space"||y.kinds[p+1]!=="text"||!Jr(y.texts[p+1])||(y.texts[p]=S.space,y.isWordLike[p]=!1,y.kinds[p]=y.kinds[p]==="preserved-space"?"preserved-space":"space",y.texts[p+1]=S.marks+y.texts[p+1],y.starts[p+1]=y.starts[p]+S.space.length))}return y}function oa(n,e){if(n.len===0)return[];if(!e.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:n.len,consumedEndSegmentIndex:n.len}];let t=[],i=0;for(let r=0;r<n.len;r++)n.kinds[r]==="hard-break"&&(t.push({startSegmentIndex:i,endSegmentIndex:r,consumedEndSegmentIndex:r+1}),i=r+1);return i<n.len&&t.push({startSegmentIndex:i,endSegmentIndex:n.len,consumedEndSegmentIndex:n.len}),t}function sa(n){if(n.len<=1)return n;let e=[],t=[],i=[],r=[],o=null,s=!1,c=0,u=!1,a=!1;function l(){o!==null&&(e.push(be(o)),t.push(s),i.push("text"),r.push(c),o=null)}for(let f=0;f<n.len;f++){let m=n.texts[f],h=n.kinds[f],M=n.isWordLike[f],C=n.starts[f];if(h==="text"){let A=Tl(m),z=Gt(m);if(o!==null&&u&&a){o.push(m),s=s||M,u=u||A,a=z;continue}l(),o=[m],s=M,c=C,u=A,a=z;continue}l(),e.push(m),t.push(M),i.push(h),r.push(C)}return l(),{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function oo(n,e,t="normal",i="normal"){let r=Nl(t),o=r.mode==="pre-wrap"?Cl(n):wl(n);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let s=i==="keep-all"?sa(to(o,e,r)):to(o,e,r);return{normalized:o,chunks:oa(s,r),...s}}var Ye=null,so=new Map,Ze=null,la=96,aa=/\\p{Emoji_Presentation}/u,ua=/[\\p{Emoji_Presentation}\\p{Extended_Pictographic}\\p{Regional_Indicator}\\uFE0F\\u20E3]/u,qn=null,lo=new Map;function zn(){if(Ye!==null)return Ye;if(typeof OffscreenCanvas<"u")return Ye=new OffscreenCanvas(1,1).getContext("2d"),Ye;if(typeof document<"u")return Ye=document.createElement("canvas").getContext("2d"),Ye;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function ca(n){let e=so.get(n);return e||(e=new Map,so.set(n,e)),e}function Le(n,e){let t=e.get(n);return t===void 0&&(t={width:zn().measureText(n).width,containsCJK:Me(n)},e.set(n,t)),t}function Xe(){if(Ze!==null)return Ze;if(typeof navigator>"u")return Ze={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ze;let n=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&n.includes("Safari/")&&!n.includes("Chrome/")&&!n.includes("Chromium/")&&!n.includes("CriOS/")&&!n.includes("FxiOS/")&&!n.includes("EdgiOS/"),i=n.includes("Chrome/")||n.includes("Chromium/")||n.includes("CriOS/")||n.includes("Edg/");return Ze={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:i,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Ze}function da(n){let e=n.match(/(\\d+(?:\\.\\d+)?)\\s*px/);return e?parseFloat(e[1]):16}function ao(){return qn===null&&(qn=new Intl.Segmenter(void 0,{granularity:"grapheme"})),qn}function fa(n){return aa.test(n)||n.includes("\\uFE0F")}function uo(n){return ua.test(n)}function ma(n,e){let t=lo.get(n);if(t!==void 0)return t;let i=zn();i.font=n;let r=i.measureText("\\u{1F600}").width;if(t=0,r>e+.5&&typeof document<"u"&&document.body!==null){let o=document.createElement("span");o.style.font=n,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&&(t=r-s)}return lo.set(n,t),t}function pa(n){let e=0,t=ao();for(let i of t.segment(n))fa(i.segment)&&e++;return e}function ha(n,e){return e.emojiCount===void 0&&(e.emojiCount=pa(n)),e.emojiCount}function _e(n,e,t){return t===0?e.width:e.width-ha(n,e)*t}function co(n,e,t,i,r){if(e.breakableFitAdvances!==void 0)return e.breakableFitAdvances;let o=ao(),s=[];for(let l of o.segment(n))s.push(l.segment);if(s.length<=1)return e.breakableFitAdvances=null,e.breakableFitAdvances;if(r==="sum-graphemes"){let l=[];for(let f of s){let m=Le(f,t);l.push(_e(f,m,i))}return e.breakableFitAdvances=l,e.breakableFitAdvances}if(r==="pair-context"||s.length>la){let l=[],f=null,m=0;for(let h of s){let M=Le(h,t),C=_e(h,M,i);if(f===null)l.push(C);else{let A=f+h,z=Le(A,t);l.push(_e(A,z,i)-m)}f=h,m=C}return e.breakableFitAdvances=l,e.breakableFitAdvances}let c=[],u="",a=0;for(let l of s){u+=l;let f=Le(u,t),m=_e(u,f,i);c.push(m-a),a=m}return e.breakableFitAdvances=c,e.breakableFitAdvances}function fo(n,e){let t=zn();t.font=n;let i=ca(n),r=da(n),o=e?ma(n,r):0;return{cache:i,fontSize:r,emojiCorrection:o}}function xa(n,e){for(;e<n.widths.length;){let t=n.kinds[e];if(t!=="space"&&t!=="zero-width-break"&&t!=="soft-hyphen")break;e++}return e}function ga(n,e){if(e<=0)return 0;let t=n%e;return Math.abs(t)<=1e-6?e:e-t}function Sa(n,e,t,i,r){let o=0,s=e;for(;o<n.length;){let c=s+n[o];if((o+1<n.length?c+r:c)>t+i)break;s=c,o++}return{fitCount:o,fittedWidth:s}}function mo(n,e){return n.simpleLineWalkFastPath?po(n,e):ho(n,e)}function po(n,e,t){let{widths:i,kinds:r,breakableFitAdvances:o}=n;if(i.length===0)return 0;let c=Xe().lineFitEpsilon,u=e+c,a=0,l=0,f=!1,m=0,h=0,M=0,C=0,A=-1,z=0;function P(){A=-1,z=0}function k(b=M,N=C,B=l){a++,t?.({startSegmentIndex:m,startGraphemeIndex:h,endSegmentIndex:b,endGraphemeIndex:N,width:B}),l=0,f=!1,P()}function Y(b,N){f=!0,m=b,h=0,M=b+1,C=0,l=N}function y(b,N,B){f=!0,m=b,h=N,M=b,C=N+1,l=B}function p(b,N){if(!f){Y(b,N);return}l+=N,M=b+1,C=0}function S(b,N){let B=o[b];for(let W=N;W<B.length;W++){let H=B[W];f?l+H>u?(k(),y(b,W,H)):(l+=H,M=b,C=W+1):y(b,W,H)}f&&M===b&&C===B.length&&(M=b+1,C=0)}let F=0;for(;F<i.length&&!(!f&&(F=xa(n,F),F>=i.length));){let b=i[F],N=r[F],B=N==="space"||N==="preserved-space"||N==="tab"||N==="zero-width-break"||N==="soft-hyphen";if(!f){b>e&&o[F]!==null?S(F,0):Y(F,b),B&&(A=F+1,z=l-b),F++;continue}if(l+b>u){if(B){p(F,b),k(F+1,0,l-b),F++;continue}if(A>=0){if(M>A||M===A&&C>0){k();continue}k(A,0,z);continue}if(b>e&&o[F]!==null){k(),S(F,0),F++;continue}k();continue}p(F,b),B&&(A=F+1,z=l-b),F++}return f&&k(),a}function ho(n,e,t){if(n.simpleLineWalkFastPath)return po(n,e,t);let{widths:i,lineEndFitAdvances:r,lineEndPaintAdvances:o,kinds:s,breakableFitAdvances:c,discretionaryHyphenWidth:u,tabStopAdvance:a,chunks:l}=n;if(i.length===0||l.length===0)return 0;let f=Xe(),m=f.lineFitEpsilon,h=e+m,M=0,C=0,A=!1,z=0,P=0,k=0,Y=0,y=-1,p=0,S=0,F=null;function b(){y=-1,p=0,S=0,F=null}function N(U=k,G=Y,v=C){M++,t?.({startSegmentIndex:z,startGraphemeIndex:P,endSegmentIndex:U,endGraphemeIndex:G,width:v}),C=0,A=!1,b()}function B(U,G){A=!0,z=U,P=0,k=U+1,Y=0,C=G}function W(U,G,v){A=!0,z=U,P=G,k=U,Y=G+1,C=v}function H(U,G){if(!A){B(U,G);return}C+=G,k=U+1,Y=0}function X(U,G,v,J){if(!G)return;let Ee=U==="tab"?0:r[v],xe=U==="tab"?J:o[v];y=v+1,p=C-J+Ee,S=C-J+xe,F=U}function R(U,G){let v=c[U];for(let J=G;J<v.length;J++){let Ee=v[J];A?C+Ee>h?(N(),W(U,J,Ee)):(C+=Ee,k=U,Y=J+1):W(U,J,Ee)}A&&k===U&&Y===v.length&&(k=U+1,Y=0)}function Z(U){if(F!=="soft-hyphen")return!1;let G=c[U];if(G==null)return!1;let{fitCount:v,fittedWidth:J}=Sa(G,C,e,m,u);return v===0?!1:(C=J,k=U,Y=v,b(),v===G.length?(k=U+1,Y=0,!0):(N(U,v,J+u),R(U,v),!0))}function ee(U){M++,t?.({startSegmentIndex:U.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:U.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),b()}for(let U=0;U<l.length;U++){let G=l[U];if(G.startSegmentIndex===G.endSegmentIndex){ee(G);continue}A=!1,C=0,z=G.startSegmentIndex,P=0,k=G.startSegmentIndex,Y=0,b();let v=G.startSegmentIndex;for(;v<G.endSegmentIndex;){let J=s[v],Ee=J==="space"||J==="preserved-space"||J==="tab"||J==="zero-width-break"||J==="soft-hyphen",xe=J==="tab"?ga(C,a):i[v];if(J==="soft-hyphen"){A&&(k=v+1,Y=0,y=v+1,p=C+u,S=C+u,F=J),v++;continue}if(!A){xe>e&&c[v]!==null?R(v,0):B(v,xe),X(J,Ee,v,xe),v++;continue}if(C+xe>h){let D=C+(J==="tab"?0:r[v]),L=C+(J==="tab"?xe:o[v]);if(F==="soft-hyphen"&&f.preferEarlySoftHyphenBreak&&p<=h){N(y,0,S);continue}if(F==="soft-hyphen"&&Z(v)){v++;continue}if(Ee&&D<=h){H(v,xe),N(v+1,0,L),v++;continue}if(y>=0&&p<=h){if(k>y||k===y&&Y>0){N();continue}let Q=y;N(Q,0,S),v=Q;continue}if(xe>e&&c[v]!==null){N(),R(v,0),v++;continue}N();continue}H(v,xe),X(J,Ee,v,xe),v++}if(A){let J=y===G.consumedEndSegmentIndex?S:C;N(G.consumedEndSegmentIndex,0,J)}}return M}var jn=null;function ya(){return jn===null&&(jn=new Intl.Segmenter(void 0,{granularity:"grapheme"})),jn}function Aa(n){return n?{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 Ea(n,e){let t=[],i=[],r=0,o=!1,s=!1,c=!1;function u(){i.length!==0&&(t.push({text:i.length===1?i[0]:i.join(""),start:r}),i=[],o=!1,s=!1,c=!1)}function a(f,m,h){i=[f],r=m,o=h,s=Kt(f),c=Nt.has(f)}function l(f,m){i.push(f),o=o||m;let h=Kt(f);f.length===1&&Pe.has(f)?s=s||h:s=h,c=!1}for(let f of ya().segment(n)){let m=f.segment,h=Me(m);if(i.length===0){a(m,f.index,h);continue}if(c||$t.has(m)||Pe.has(m)||e.carryCJKAfterClosingQuote&&h&&s){l(m,h);continue}if(!o&&!h){l(m,h);continue}u(),a(m,f.index,h)}return u(),t}function Fa(n){if(n.length<=1)return n;let e=[],t=[n[0].text],i=n[0].start,r=Me(n[0].text),o=Gt(n[0].text);function s(){e.push({text:t.length===1?t[0]:t.join(""),start:i})}for(let c=1;c<n.length;c++){let u=n[c],a=Me(u.text),l=Gt(u.text);if(r&&o){t.push(u.text),r=r||a,o=l;continue}s(),t=[u.text],i=u.start,r=a,o=l}return s(),e}function ba(n,e,t,i){let r=Xe(),{cache:o,emojiCorrection:s}=fo(e,uo(n.normalized)),c=_e("-",Le("-",o),s),a=_e(" ",Le(" ",o),s)*8;if(n.len===0)return Aa(t);let l=[],f=[],m=[],h=[],M=n.chunks.length<=1,C=t?[]:null,A=[],z=t?[]:null,P=Array.from({length:n.len});function k(S,F,b,N,B,W,H){B!=="text"&&B!=="space"&&B!=="zero-width-break"&&(M=!1),l.push(F),f.push(b),m.push(N),h.push(B),C?.push(W),A.push(H),z!==null&&z.push(S)}function Y(S,F,b,N,B){let W=Le(S,o),H=_e(S,W,s),X=F==="space"||F==="preserved-space"||F==="zero-width-break"?0:H,R=F==="space"||F==="zero-width-break"?0:H;if(B&&N&&S.length>1){let Z="sum-graphemes";bt(S)?Z="pair-context":r.preferPrefixWidthsForBreakableRuns&&(Z="segment-prefixes");let ee=co(S,W,o,s,Z);k(S,H,X,R,F,b,ee);return}k(S,H,X,R,F,b,null)}for(let S=0;S<n.len;S++){P[S]=l.length;let F=n.texts[S],b=n.isWordLike[S],N=n.kinds[S],B=n.starts[S];if(N==="soft-hyphen"){k(F,0,c,c,N,B,null);continue}if(N==="hard-break"){k(F,0,0,0,N,B,null);continue}if(N==="tab"){k(F,0,0,0,N,B,null);continue}let W=Le(F,o);if(N==="text"&&W.containsCJK){let H=Ea(F,r),X=i==="keep-all"?Fa(H):H;for(let R=0;R<X.length;R++){let Z=X[R];Y(Z.text,"text",B+Z.start,b,i==="keep-all"||!Me(Z.text))}continue}Y(F,N,B,b,!0)}let y=Na(n.chunks,P,l.length),p=C===null?null:Kr(n.normalized,C);return z!==null?{widths:l,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:h,simpleLineWalkFastPath:M,segLevels:p,breakableFitAdvances:A,discretionaryHyphenWidth:c,tabStopAdvance:a,chunks:y,segments:z}:{widths:l,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:h,simpleLineWalkFastPath:M,segLevels:p,breakableFitAdvances:A,discretionaryHyphenWidth:c,tabStopAdvance:a,chunks:y}}function Na(n,e,t){let i=[];for(let r=0;r<n.length;r++){let o=n[r],s=o.startSegmentIndex<e.length?e[o.startSegmentIndex]:t,c=o.endSegmentIndex<e.length?e[o.endSegmentIndex]:t,u=o.consumedEndSegmentIndex<e.length?e[o.consumedEndSegmentIndex]:t;i.push({startSegmentIndex:s,endSegmentIndex:c,consumedEndSegmentIndex:u})}return i}function wa(n,e,t,i){let r=i?.wordBreak??"normal",o=oo(n,Xe(),i?.whiteSpace,r);return ba(o,e,t,r)}function xo(n,e,t){return wa(n,e,!1,t)}function go(n,e,t){let i=mo(n,e);return{lineCount:i,height:i*t}}var Ca={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function So(n,e){let t={...Ca,...e},i=1.2;for(let r=t.baseFontSize;r>=t.minFontSize;r-=t.step){let o=`${t.fontWeight} ${r}px ${t.fontFamily}`,s=xo(n,o),{lineCount:c}=go(s,t.maxWidth,r*i);if(c<=1)return{fontSize:r,fits:!0}}return{fontSize:t.minFontSize,fits:!1}}window.__timelines=window.__timelines||{};window.__hyperframes={fitTextFontSize:So};function yo(){let n=window;n.__hyperframeRuntimeBootstrapped||(n.__hyperframeRuntimeBootstrapped=!0,$r())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",yo,{once:!0}):yo();})();\n';
6304
+ RUNTIME_IIFE = '"use strict";(()=>{var wo=Object.create;var Jn=Object.defineProperty;var Co=Object.getOwnPropertyDescriptor;var Mo=Object.getOwnPropertyNames;var ko=Object.getPrototypeOf,Do=Object.prototype.hasOwnProperty;var K=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var Lo=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Mo(e))!Do.call(n,r)&&r!==t&&Jn(n,r,{get:()=>e[r],enumerable:!(i=Co(e,r))||i.enumerable});return n};var vo=(n,e,t)=>(t=n!=null?wo(ko(n)):{},Lo(e||!n||!n.__esModule?Jn(t,"default",{value:n,enumerable:!0}):t,n));var xi=K(($a,ln)=>{var q=String,hi=function(){return{isColorSupported:!1,reset:q,bold:q,dim:q,italic:q,underline:q,inverse:q,hidden:q,strikethrough:q,black:q,red:q,green:q,yellow:q,blue:q,magenta:q,cyan:q,white:q,gray:q,bgBlack:q,bgRed:q,bgGreen:q,bgYellow:q,bgBlue:q,bgMagenta:q,bgCyan:q,bgWhite:q,blackBright:q,redBright:q,greenBright:q,yellowBright:q,blueBright:q,magentaBright:q,cyanBright:q,whiteBright:q,bgBlackBright:q,bgRedBright:q,bgGreenBright:q,bgYellowBright:q,bgBlueBright:q,bgMagentaBright:q,bgCyanBright:q,bgWhiteBright:q}};ln.exports=hi();ln.exports.createColors=hi});var an=K(()=>{});var Dt=K((Ja,Si)=>{"use strict";var gi=xi(),yi=an(),ot=class n extends Error{constructor(e,t,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 t<"u"&&typeof i<"u"&&(typeof t=="number"?(this.line=t,this.column=i):(this.line=t.line,this.column=t.column,this.endLine=i.line,this.endColumn=i.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}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 t=this.source;e==null&&(e=gi.isColorSupported);let i=l=>l,r=l=>l,o=l=>l;if(e){let{bold:l,gray:f,red:m}=gi.createColors(!0);r=h=>l(m(h)),i=h=>f(h),yi&&(o=h=>yi(h))}let s=t.split(/\\r?\\n/),c=Math.max(this.line-3,0),u=Math.min(this.line+2,s.length),a=String(u).length;return s.slice(c,u).map((l,f)=>{let m=c+1+f,h=" "+(" "+m).slice(-a)+" | ";if(m===this.line){if(l.length>160){let C=20,A=Math.max(0,this.column-C),z=Math.max(this.column+C,this.endColumn+C),O=l.slice(A,z),D=i(h.replace(/\\d/g," "))+l.slice(0,Math.min(this.column-1,C-1)).replace(/[^\\t]/g," ");return r(">")+i(h)+o(O)+`\n `+D+r("^")}let M=i(h.replace(/\\d/g," "))+l.slice(0,this.column-1).replace(/[^\\t]/g," ");return r(">")+i(h)+o(l)+`\n `+M+r("^")}return" "+i(h)+o(l)}).join(`\n`)}toString(){let e=this.showSourceCode();return e&&(e=`\n\n`+e+`\n`),this.name+": "+this.message+e}};Si.exports=ot;ot.default=ot});var un=K((Qa,Ei)=>{"use strict";var Ai={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Vo(n){return n[0].toUpperCase()+n.slice(1)}var st=class{constructor(e){this.builder=e}atrule(e,t){let i="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?i+=e.raws.afterName:r&&(i+=" "),e.nodes)this.block(e,i+r);else{let o=(e.raws.between||"")+(t?";":"");this.builder(i+r+o,e)}}beforeAfter(e,t){let i;e.type==="decl"?i=this.raw(e,null,"beforeDecl"):e.type==="comment"?i=this.raw(e,null,"beforeComment"):t==="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 c=0;c<o;c++)i+=s}return i}block(e,t){let i=this.raw(e,"between","beforeOpen");this.builder(t+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(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let i=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let o=e.nodes[r],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,t!==r||i)}}comment(e){let t=this.raw(e,"left","commentLeft"),i=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+i+"*/",e)}decl(e,t){let i=this.raw(e,"between","colon"),r=e.prop+i+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,i){let r;if(i||(i=t),t&&(r=e.raws[t],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 Ai[i];let s=e.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[i]<"u")return s.rawCache[i];if(i==="before"||i==="after")return this.beforeAfter(e,i);{let c="raw"+Vo(i);this[c]?r=this[c](s,e):s.walk(u=>{if(r=u.raws[t],typeof r<"u")return!1})}return typeof r>"u"&&(r=Ai[i]),s.rawCache[i]=r,r}rawBeforeClose(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length>0&&typeof i.raws.after<"u")return t=i.raws.after,t.includes(`\n`)&&(t=t.replace(/[^\\n]+$/,"")),!1}),t&&(t=t.replace(/\\S/g,"")),t}rawBeforeComment(e,t){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(t,null,"beforeDecl"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeDecl(e,t){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(t,null,"beforeRule"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeOpen(e){let t;return e.walk(i=>{if(i.type!=="decl"&&(t=i.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(i=>{if(i.nodes&&(i.parent!==e||e.first!==i)&&typeof i.raws.before<"u")return t=i.raws.before,t.includes(`\n`)&&(t=t.replace(/[^\\n]+$/,"")),!1}),t&&(t=t.replace(/\\S/g,"")),t}rawColon(e){let t;return e.walkDecls(i=>{if(typeof i.raws.between<"u")return t=i.raws.between.replace(/[^\\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length===0&&(t=i.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;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 t=o[o.length-1],t=t.replace(/\\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(t=i.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let i=e[t],r=e.raws[t];return r&&r.value===i?r.raw:i}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};Ei.exports=st;st.default=st});var lt=K((Ya,Fi)=>{"use strict";var Ko=un();function cn(n,e){new Ko(e).stringify(n)}Fi.exports=cn;cn.default=cn});var Lt=K((Za,dn)=>{"use strict";dn.exports.isClean=Symbol("isClean");dn.exports.my=Symbol("my")});var ct=K((Xa,bi)=>{"use strict";var Jo=Dt(),Qo=un(),Yo=lt(),{isClean:at,my:Zo}=Lt();function fn(n,e){let t=new n.constructor;for(let i in n){if(!Object.prototype.hasOwnProperty.call(n,i)||i==="proxyCache")continue;let r=n[i],o=typeof r;i==="parent"&&o==="object"?e&&(t[i]=e):i==="source"?t[i]=r:Array.isArray(r)?t[i]=r.map(s=>fn(s,t)):(o==="object"&&r!==null&&(r=fn(r)),t[i]=r)}return t}function De(n,e){if(e&&typeof e.offset<"u")return e.offset;let t=1,i=1,r=0;for(let o=0;o<n.length;o++){if(i===e.line&&t===e.column){r=o;break}n[o]===`\n`?(t=1,i+=1):t+=1}return r}var ut=class{get proxyOf(){return this}constructor(e={}){this.raws={},this[at]=!1,this[Zo]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let i of e[t])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\\n\\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\\n\\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];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 t=fn(this);for(let i in e)t[i]=e[i];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:i,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:i.column,line:i.line},t)}return new Jo(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,i){return e[t]===i||(e[t]=i,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markClean(){this[at]=!0}markDirty(){if(this[at]){this[at]=!1;let e=this;for(;e=e.parent;)e[at]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=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(De(i,this.source.start),De(i,this.source.end)).indexOf(e.word);o!==-1&&(t=this.positionInside(o))}return t}positionInside(e){let t=this.source.start.column,i=this.source.start.line,r="document"in this.source.input?this.source.input.document:this.source.input.css,o=De(r,this.source.start),s=o+e;for(let c=o;c<s;c++)r[c]===`\n`?(t=1,i+=1):t+=1;return{column:t,line:i,offset:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="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:De(t,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:De(t,this.source.end)+1}:{column:i.column+1,line:i.line,offset:i.offset+1};if(e.word){let s=t.slice(De(t,this.source.start),De(t,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:De(t,e.start)}:e.index&&(i=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line,offset:De(t,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,t){return new Qo().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,i=!1;for(let r of e)r===this?i=!0:i?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);i||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let i={},r=t==null;t=t||new Map;let o=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let c=this[s];if(Array.isArray(c))i[s]=c.map(u=>typeof u=="object"&&u.toJSON?u.toJSON(null,t):u);else if(typeof c=="object"&&c.toJSON)i[s]=c.toJSON(null,t);else if(s==="source"){if(c==null)continue;let u=t.get(c.input);u==null&&(u=o,t.set(c.input,o),o++),i[s]={end:c.end,inputId:u,start:c.start}}else i[s]=c}return r&&(i.inputs=[...t.keys()].map(s=>s.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Yo){e.stringify&&(e=e.stringify);let t="";return e(this,i=>{t+=i}),t}warn(e,t,i={}){let r={node:this};for(let o in i)r[o]=i[o];return e.warn(t,r)}};bi.exports=ut;ut.default=ut});var ft=K((eu,Ni)=>{"use strict";var Xo=ct(),dt=class extends Xo{constructor(e){super(e),this.type="comment"}};Ni.exports=dt;dt.default=dt});var pt=K((tu,wi)=>{"use strict";var es=ct(),mt=class extends es{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"}};wi.exports=mt;mt.default=mt});var Te=K((nu,Bi)=>{"use strict";var Ci=ft(),Mi=pt(),ts=ct(),{isClean:ki,my:Di}=Lt(),mn,Li,vi,pn;function Ri(n){return n.map(e=>(e.nodes&&(e.nodes=Ri(e.nodes)),delete e.source,e))}function Ti(n){if(n[ki]=!1,n.proxyOf.nodes)for(let e of n.proxyOf.nodes)Ti(e)}var Ce=class n extends ts{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 t of e){let i=this.normalize(t,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 t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),i,r;for(;this.indexes[t]<this.proxyOf.nodes.length&&(i=this.indexes[t],r=e(this.proxyOf.nodes[i],i),r!==!1);)this.indexes[t]+=1;return delete this.indexes[t],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,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...i)=>e[t](...i.map(r=>typeof r=="function"?(o,s)=>r(o.toProxy(),s):r)):t==="every"||t==="some"?i=>e[t]((r,...o)=>i(r.toProxy(),...o)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(i=>i.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,i){return e[t]===i||(e[t]=i,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let i=this.index(e),r=this.normalize(t,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,t){let i=this.index(e),r=i===0?"prepend":!1,o=this.normalize(t,this.proxyOf.nodes[i],r).reverse();i=this.index(e);for(let c of o)this.proxyOf.nodes.splice(i,0,c);let s;for(let c in this.indexes)s=this.indexes[c],i<=s&&(this.indexes[c]=s+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=Ri(Li(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 Mi(e)]}else if(e.selector||e.selectors)e=[new pn(e)];else if(e.name)e=[new mn(e)];else if(e.text)e=[new Ci(e)];else throw new Error("Unknown node type in node creation");return e.map(r=>(r[Di]||n.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[ki]&&Ti(r),r.raws||(r.raws={}),typeof r.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(r.raws.before=t.raws.before.replace(/\\S/g,"")),r.parent=this.proxyOf,r))}prepend(...e){e=e.reverse();for(let t of e){let i=this.normalize(t,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 t;for(let i in this.indexes)t=this.indexes[i],t>=e&&(this.indexes[i]=t-1);return this.markDirty(),this}replaceValues(e,t,i){return i||(i=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,i))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,i)=>{let r;try{r=e(t,i)}catch(o){throw t.addToError(o)}return r!==!1&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="atrule"&&e.test(i.name))return t(i,r)}):this.walk((i,r)=>{if(i.type==="atrule"&&i.name===e)return t(i,r)}):(t=e,this.walk((i,r)=>{if(i.type==="atrule")return t(i,r)}))}walkComments(e){return this.walk((t,i)=>{if(t.type==="comment")return e(t,i)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="decl"&&e.test(i.prop))return t(i,r)}):this.walk((i,r)=>{if(i.type==="decl"&&i.prop===e)return t(i,r)}):(t=e,this.walk((i,r)=>{if(i.type==="decl")return t(i,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((i,r)=>{if(i.type==="rule"&&e.test(i.selector))return t(i,r)}):this.walk((i,r)=>{if(i.type==="rule"&&i.selector===e)return t(i,r)}):(t=e,this.walk((i,r)=>{if(i.type==="rule")return t(i,r)}))}};Ce.registerParse=n=>{Li=n};Ce.registerRule=n=>{pn=n};Ce.registerAtRule=n=>{mn=n};Ce.registerRoot=n=>{vi=n};Bi.exports=Ce;Ce.default=Ce;Ce.rebuild=n=>{n.type==="atrule"?Object.setPrototypeOf(n,mn.prototype):n.type==="rule"?Object.setPrototypeOf(n,pn.prototype):n.type==="decl"?Object.setPrototypeOf(n,Mi.prototype):n.type==="comment"?Object.setPrototypeOf(n,Ci.prototype):n.type==="root"&&Object.setPrototypeOf(n,vi.prototype),n[Di]=!0,n.nodes&&n.nodes.forEach(e=>{Ce.rebuild(e)})}});var vt=K((iu,Oi)=>{"use strict";var _i=Te(),$e=class extends _i{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)}};Oi.exports=$e;$e.default=$e;_i.registerAtRule($e)});var Rt=K((ru,Wi)=>{"use strict";var ns=Te(),Pi,Ii,Ue=class extends ns{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Pi(new Ii,this,e).stringify()}};Ue.registerLazyResult=n=>{Pi=n};Ue.registerProcessor=n=>{Ii=n};Wi.exports=Ue;Ue.default=Ue});var Ui=K((ou,Hi)=>{var is="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",rs=(n,e=21)=>(t=e)=>{let i="",r=t|0;for(;r--;)i+=n[Math.random()*n.length|0];return i},os=(n=21)=>{let e="",t=n|0;for(;t--;)e+=is[Math.random()*64|0];return e};Hi.exports={nanoid:os,customAlphabet:rs}});var Tt=K(()=>{});var Bt=K(()=>{});var hn=K(()=>{});var qi=K(()=>{});var gn=K((pu,Gi)=>{"use strict";var{existsSync:ss,readFileSync:ls}=qi(),{dirname:xn,join:as}=Tt(),{SourceMapConsumer:zi,SourceMapGenerator:ji}=Bt();function us(n){return Buffer?Buffer.from(n,"base64").toString():window.atob(n)}var ht=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let i=t.map?t.map.prev:void 0,r=this.loadMap(t.from,i);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=xn(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new zi(this.text)),this.consumerCache}decodeInline(e){let t=/^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 c=e.match(t)||e.match(i);if(c)return us(e.substr(c[0].length));let u=e.match(/data:application\\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+u)}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 t=e.match(/\\/\\*\\s*# sourceMappingURL=/g);if(!t)return;let i=e.lastIndexOf(t.pop()),r=e.indexOf("*/",i);i>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(i,r)))}loadFile(e){if(this.root=xn(e),ss(e))return this.mapFile=e,ls(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let i=t(e);if(i){let r=this.loadFile(i);if(!r)throw new Error("Unable to load previous source map: "+i.toString());return r}}else{if(t instanceof zi)return ji.fromSourceMap(t).toString();if(t instanceof ji)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let i=this.annotation;return e&&(i=as(xn(e),i)),this.loadFile(i)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};Gi.exports=ht;ht.default=ht});var xt=K((hu,Qi)=>{"use strict";var{nanoid:cs}=Ui(),{isAbsolute:An,resolve:En}=Tt(),{SourceMapConsumer:ds,SourceMapGenerator:fs}=Bt(),{fileURLToPath:$i,pathToFileURL:_t}=hn(),Vi=Dt(),ms=gn(),yn=an(),Sn=Symbol("lineToIndexCache"),ps=!!(ds&&fs),Ki=!!(En&&An);function Ji(n){if(n[Sn])return n[Sn];let e=n.css.split(`\n`),t=new Array(e.length),i=0;for(let r=0,o=e.length;r<o;r++)t[r]=i,i+=e[r].length+1;return n[Sn]=t,t}var Ve=class{get from(){return this.file||this.id}constructor(e,t={}){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,t.document&&(this.document=t.document.toString()),t.from&&(!Ki||/^\\w+:\\/\\//.test(t.from)||An(t.from)?this.file=t.from:this.file=En(t.from)),Ki&&ps){let i=new ms(this.css,t);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 "+cs(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,i,r={}){let o,s,c,u,a;if(t&&typeof t=="object"){let f=t,m=i;if(typeof f.offset=="number"){u=f.offset;let h=this.fromOffset(u);t=h.line,i=h.col}else t=f.line,i=f.column,u=this.fromLineAndColumn(t,i);if(typeof m.offset=="number"){c=m.offset;let h=this.fromOffset(c);s=h.line,o=h.col}else s=m.line,o=m.column,c=this.fromLineAndColumn(m.line,m.column)}else if(i)u=this.fromLineAndColumn(t,i);else{u=t;let f=this.fromOffset(u);t=f.line,i=f.col}let l=this.origin(t,i,s,o);return l?a=new Vi(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,r.plugin):a=new Vi(e,s===void 0?t:{column:i,line:t},s===void 0?i:{column:o,line:s},this.css,this.file,r.plugin),a.input={column:i,endColumn:o,endLine:s,endOffset:c,line:t,offset:u,source:this.css},this.file&&(_t&&(a.input.url=_t(this.file).toString()),a.input.file=this.file),a}fromLineAndColumn(e,t){return Ji(this)[e-1]+t-1}fromOffset(e){let t=Ji(this),i=t[t.length-1],r=0;if(e>=i)r=t.length-1;else{let o=t.length-2,s;for(;r<o;)if(s=r+(o-r>>1),e<t[s])o=s-1;else if(e>=t[s+1])r=s+1;else{r=s;break}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\\w+:\\/\\//.test(e)?e:En(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,i,r){if(!this.map)return!1;let o=this.map.consumer(),s=o.originalPositionFor({column:t,line:e});if(!s.source)return!1;let c;typeof i=="number"&&(c=o.originalPositionFor({column:r,line:i}));let u;An(s.source)?u=_t(s.source):u=new URL(s.source,this.map.consumer().sourceRoot||_t(this.map.mapFile));let a={column:s.column,endColumn:c&&c.column,endLine:c&&c.line,line:s.line,url:u.toString()};if(u.protocol==="file:")if($i)a.file=$i(u);else throw new Error("file: protocol is not available in this PostCSS build");let l=o.sourceContentFor(s.source);return l&&(a.source=l),a}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};Qi.exports=Ve;Ve.default=Ve;yn&&yn.registerInput&&yn.registerInput(Ve)});var Ke=K((xu,er)=>{"use strict";var Yi=Te(),Zi,Xi,Be=class extends Yi{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,i){let r=super.normalize(e);if(t){if(i==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let o of r)o.raws.before=t.raws.before}return r}removeChild(e,t){let i=this.index(e);return!t&&i===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),super.removeChild(e)}toResult(e={}){return new Zi(new Xi,this,e).stringify()}};Be.registerLazyResult=n=>{Zi=n};Be.registerProcessor=n=>{Xi=n};er.exports=Be;Be.default=Be;Yi.registerRoot(Be)});var Fn=K((gu,tr)=>{"use strict";var gt={comma(n){return gt.split(n,[","],!0)},space(n){let e=[" ",`\n`," "];return gt.split(n,e)},split(n,e,t){let i=[],r="",o=!1,s=0,c=!1,u="",a=!1;for(let l of n)a?a=!1:l==="\\\\"?a=!0:c?l===u&&(c=!1):l===\'"\'||l==="\'"?(c=!0,u=l):l==="("?s+=1:l===")"?s>0&&(s-=1):s===0&&e.includes(l)&&(o=!0),o?(r!==""&&i.push(r.trim()),r="",o=!1):r+=l;return(t||r!=="")&&i.push(r.trim()),i}};tr.exports=gt;gt.default=gt});var Ot=K((yu,ir)=>{"use strict";var nr=Te(),hs=Fn(),Je=class extends nr{get selectors(){return hs.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\\s*/):null,i=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(i)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}};ir.exports=Je;Je.default=Je;nr.registerRule(Je)});var or=K((Su,rr)=>{"use strict";var xs=vt(),gs=ft(),ys=pt(),Ss=xt(),As=gn(),Es=Ke(),Fs=Ot();function yt(n,e){if(Array.isArray(n))return n.map(r=>yt(r));let{inputs:t,...i}=n;if(t){e=[];for(let r of t){let o={...r,__proto__:Ss.prototype};o.map&&(o.map={...o.map,__proto__:As.prototype}),e.push(o)}}if(i.nodes&&(i.nodes=n.nodes.map(r=>yt(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 Es(i);if(i.type==="decl")return new ys(i);if(i.type==="rule")return new Fs(i);if(i.type==="comment")return new gs(i);if(i.type==="atrule")return new xs(i);throw new Error("Unknown node type: "+n.type)}rr.exports=yt;yt.default=yt});var Nn=K((Au,dr)=>{"use strict";var{dirname:Pt,relative:lr,resolve:ar,sep:ur}=Tt(),{SourceMapConsumer:cr,SourceMapGenerator:It}=Bt(),{pathToFileURL:sr}=hn(),bs=xt(),Ns=!!(cr&&It),ws=!!(Pt&&ar&&lr&&ur),bn=class{constructor(e,t,i,r){this.stringify=e,this.mapOpts=i.map||{},this.root=t,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 t=`\n`;this.css.includes(`\\r\n`)&&(t=`\\r\n`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),i=e.root||Pt(e.file),r;this.mapOpts.sourcesContent===!1?(r=new cr(e.text),r.sourcesContent&&(r.sourcesContent=null)):r=e.consumer(),this.map.applySourceMap(r,t,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else if(this.css){let e;for(;(e=this.css.lastIndexOf("/*#"))!==-1;){let t=this.css.indexOf("*/",e+3);if(t===-1)break;for(;e>0&&this.css[e-1]===`\n`;)e--;this.css=this.css.slice(0,e)+this.css.slice(t+2)}}}}generate(){if(this.clearAnnotation(),ws&&Ns&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[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=It.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new It({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 It({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,i="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,s;this.stringify(this.root,(c,u,a)=>{if(this.css+=c,u&&a!=="end"&&(r.generated.line=e,r.generated.column=t-1,u.source&&u.source.start?(r.source=this.sourcePath(u),r.original.line=u.source.start.line,r.original.column=u.source.start.column-1,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,this.map.addMapping(r))),s=c.match(/\\n/g),s?(e+=s.length,o=c.lastIndexOf(`\n`),t=c.length-o):t+=c.length,u&&a!=="start"){let l=u.parent||{raws:{}};(!(u.type==="decl"||u.type==="atrule"&&!u.nodes)||u!==l.last||l.raws.semicolon)&&(u.source&&u.source.end?(r.source=this.sourcePath(u),r.original.line=u.source.end.line,r.original.column=u.source.end.column-1,r.generated.line=e,r.generated.column=t-2,this.map.addMapping(r)):(r.source=i,r.original.line=1,r.original.column=0,r.generated.line=e,r.generated.column=t-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(t=>t.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 t=this.memoizedPaths.get(e);if(t)return t;let i=this.opts.to?Pt(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(i=Pt(ar(i,this.mapOpts.annotation)));let r=lr(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 t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new bs(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let i=t.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,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,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 t=this.memoizedFileURLs.get(e);if(t)return t;if(sr){let i=sr(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 t=this.memoizedURLs.get(e);if(t)return t;ur==="\\\\"&&(e=e.replace(/\\\\/g,"/"));let i=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,i),i}};dr.exports=bn});var pr=K((Eu,mr)=>{"use strict";var Wt=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,Ht=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,Cs=/.[\\r\\n"\'(/\\\\]/,fr=/[\\da-f]/i;mr.exports=function(e,t={}){let i=e.css.valueOf(),r=t.ignoreErrors,o,s,c,u,a,l,f,m,h,M,C=i.length,A=0,z=[],O=[];function D(){return A}function Y(F){throw e.error("Unclosed "+F,A)}function S(){return O.length===0&&A>=C}function p(F){if(O.length)return O.pop();if(A>=C)return;let b=F?F.ignoreUnclosed:!1;switch(o=i.charCodeAt(A),o){case 10:case 32:case 9:case 13:case 12:{u=A;do u+=1,o=i.charCodeAt(u);while(o===32||o===10||o===9||o===13||o===12);l=["space",i.slice(A,u)],A=u-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let N=String.fromCharCode(o);l=[N,N,A];break}case 40:{if(M=z.length?z.pop()[1]:"",h=i.charCodeAt(A+1),M==="url"&&h!==39&&h!==34&&h!==32&&h!==10&&h!==9&&h!==12&&h!==13){u=A;do{if(f=!1,u=i.indexOf(")",u+1),u===-1)if(r||b){u=A;break}else Y("bracket");for(m=u;i.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);l=["brackets",i.slice(A,u+1),A,u],A=u}else u=i.indexOf(")",A+1),s=i.slice(A,u+1),u===-1||Cs.test(s)?l=["(","(",A]:(l=["brackets",s,A,u],A=u);break}case 39:case 34:{a=o===39?"\'":\'"\',u=A;do{if(f=!1,u=i.indexOf(a,u+1),u===-1)if(r||b){u=A+1;break}else Y("string");for(m=u;i.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);l=["string",i.slice(A,u+1),A,u],A=u;break}case 64:{Wt.lastIndex=A+1,Wt.test(i),Wt.lastIndex===0?u=i.length-1:u=Wt.lastIndex-2,l=["at-word",i.slice(A,u+1),A,u],A=u;break}case 92:{for(u=A,c=!0;i.charCodeAt(u+1)===92;)u+=1,c=!c;if(o=i.charCodeAt(u+1),c&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(u+=1,fr.test(i.charAt(u)))){for(;fr.test(i.charAt(u+1));)u+=1;i.charCodeAt(u+1)===32&&(u+=1)}l=["word",i.slice(A,u+1),A,u],A=u;break}default:{o===47&&i.charCodeAt(A+1)===42?(u=i.indexOf("*/",A+2)+1,u===0&&(r||b?u=i.length:Y("comment")),l=["comment",i.slice(A,u+1),A,u],A=u):(Ht.lastIndex=A+1,Ht.test(i),Ht.lastIndex===0?u=i.length-1:u=Ht.lastIndex-2,l=["word",i.slice(A,u+1),A,u],z.push(l),A=u);break}}return A++,l}function y(F){O.push(F)}return{back:y,endOfFile:S,nextToken:p,position:D}}});var yr=K((Fu,gr)=>{"use strict";var Ms=vt(),ks=ft(),Ds=pt(),Ls=Ke(),hr=Ot(),vs=pr(),xr={empty:!0,space:!0};function Rs(n){for(let e=n.length-1;e>=0;e--){let t=n[e],i=t[3]||t[2];if(i)return i}}var wn=class{constructor(e){this.input=e,this.root=new Ls,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 t=new Ms;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let i,r,o,s=!1,c=!1,u=[],a=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),i=e[0],i==="("||i==="["?a.push(i==="("?")":"]"):i==="{"&&a.length>0?a.push("}"):i===a[a.length-1]&&a.pop(),a.length===0)if(i===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){c=!0;break}else if(i==="}"){if(u.length>0){for(o=u.length-1,r=u[o];r&&r[0]==="space";)r=u[--o];r&&(t.source.end=this.getPosition(r[3]||r[2]),t.source.end.offset++)}this.end(e);break}else u.push(e);else u.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(u),u.length?(t.raws.afterName=this.spacesAndCommentsFromStart(u),this.raw(t,"params",u),s&&(e=u[u.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),c&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let i=0,r;for(let o=t-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 t=0,i,r,o;for(let[s,c]of e.entries()){if(r=c,o=r[0],o==="("&&(t+=1),o===")"&&(t-=1),t===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 t=new ks;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let i=e[1].slice(2,-2);if(!i.trim())t.text="",t.raws.left=i,t.raws.right="";else{let r=i.match(/^(\\s*)([^]*\\S)(\\s*)$/);t.text=r[2],t.raws.left=r[1],t.raws.right=r[3]}}createTokenizer(){this.tokenizer=vs(this.input)}decl(e,t){let i=new Ds;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]||Rs(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 a=e[0][0];if(a===":"||a==="space"||a==="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=[],c;for(;e.length&&(c=e[0][0],!(c!=="space"&&c!=="comment"));)s.push(e.shift());this.precheckMissedSemicolon(e);for(let a=e.length-1;a>=0;a--){if(o=e[a],o[1].toLowerCase()==="!important"){i.important=!0;let l=this.stringFrom(e,a);l=this.spacesFromEnd(e)+l,l!==" !important"&&(i.raws.important=l);break}else if(o[1].toLowerCase()==="important"){let l=e.slice(0),f="";for(let m=a;m>0;m--){let h=l[m][0];if(f.trim().startsWith("!")&&h!=="space")break;f=l.pop()[1]+f}f.trim().startsWith("!")&&(i.important=!0,i.raws.important=f,e=l)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(a=>a[0]!=="space"&&a[0]!=="comment")&&(i.raws.between+=s.map(a=>a[1]).join(""),s=[]),this.raw(i,"value",s.concat(e),t),i.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new hr;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}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 t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,i=null,r=!1,o=null,s=[],c=e[1].startsWith("--"),u=[],a=e;for(;a;){if(i=a[0],u.push(a),i==="("||i==="[")o||(o=a),s.push(i==="("?")":"]");else if(c&&r&&i==="{")o||(o=a),s.push("}");else if(s.length===0)if(i===";")if(r){this.decl(u,c);return}else break;else if(i==="{"){this.rule(u);return}else if(i==="}"){this.tokenizer.back(u.pop()),t=!0;break}else i===":"&&(r=!0);else i===s[s.length-1]&&(s.pop(),s.length===0&&(o=null));a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),s.length>0&&this.unclosedBracket(o),t&&r){if(!c)for(;u.length&&(a=u[u.length-1][0],!(a!=="space"&&a!=="comment"));)this.tokenizer.back(u.pop());this.decl(u,c)}else this.unknownWord(u)}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,t,i,r){let o,s,c=i.length,u="",a=!0,l,f;for(let m=0;m<c;m+=1)o=i[m],s=o[0],s==="space"&&m===c-1&&!r?a=!1:s==="comment"?(f=i[m-1]?i[m-1][0]:"empty",l=i[m+1]?i[m+1][0]:"empty",!xr[f]&&!xr[l]?u.slice(-1)===","?a=!1:u+=o[1]:a=!1):u+=o[1];if(!a){let m=i.reduce((h,M)=>h+M[1],"");e.raws[t]={raw:m,value:u}}e[t]=u}rule(e){e.pop();let t=new hr;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,i="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)i=e.pop()[1]+i;return i}spacesAndCommentsFromStart(e){let t,i="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)i+=e.shift()[1];return i}spacesFromEnd(e){let t,i="";for(;e.length&&(t=e[e.length-1][0],t==="space");)i=e.pop()[1]+i;return i}stringFrom(e,t){let i="";for(let r=t;r<e.length;r++)i+=e[r][1];return e.splice(t,e.length-t),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,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};gr.exports=wn});var qt=K((bu,Sr)=>{"use strict";var Ts=Te(),Bs=xt(),_s=yr();function Ut(n,e){let t=new Bs(n,e),i=new _s(t);try{i.parse()}catch(r){throw r}return i.root}Sr.exports=Ut;Ut.default=Ut;Ts.registerParse(Ut)});var Cn=K((Nu,Ar)=>{"use strict";var St=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let i=t.node.rangeBy(t);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(let i in t)this[i]=t[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}};Ar.exports=St;St.default=St});var zt=K((wu,Er)=>{"use strict";var Os=Cn(),At=class{get content(){return this.css}constructor(e,t,i){this.processor=e,this.messages=[],this.root=t,this.opts=i,this.css="",this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let i=new Os(e,t);return this.messages.push(i),i}warnings(){return this.messages.filter(e=>e.type==="warning")}};Er.exports=At;At.default=At});var Mn=K((Cu,br)=>{"use strict";var Fr={};br.exports=function(e){Fr[e]||(Fr[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))}});var Ln=K((ku,Mr)=>{"use strict";var Ps=Te(),Is=Rt(),Ws=Nn(),Hs=qt(),Nr=zt(),Us=Ke(),qs=lt(),{isClean:ke,my:zs}=Lt(),Mu=Mn(),js={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Gs={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},$s={Once:!0,postcssPlugin:!0,prepare:!0},Qe=0;function Et(n){return typeof n=="object"&&typeof n.then=="function"}function Cr(n){let e=!1,t=js[n.type];return n.type==="decl"?e=n.prop.toLowerCase():n.type==="atrule"&&(e=n.name.toLowerCase()),e&&n.append?[t,t+"-"+e,Qe,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:n.append?[t,Qe,t+"Exit"]:[t,t+"Exit"]}function wr(n){let e;return n.type==="document"?e=["Document",Qe,"DocumentExit"]:n.type==="root"?e=["Root",Qe,"RootExit"]:e=Cr(n),{eventIndex:0,events:e,iterator:0,node:n,visitorIndex:0,visitors:[]}}function kn(n){return n[ke]=!1,n.nodes&&n.nodes.forEach(e=>kn(e)),n}var Dn={},_e=class n{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,t,i){this.stringified=!1,this.processed=!1;let r;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))r=kn(t);else if(t instanceof n||t instanceof Nr)r=kn(t.root),t.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=t.map);else{let o=Hs;i.syntax&&(o=i.syntax.parse),i.parser&&(o=i.parser),o.parse&&(o=o.parse);try{r=o(t,i)}catch(s){this.processed=!0,this.error=s}r&&!r[zs]&&Ps.rebuild(r)}this.result=new Nr(e,r,i),this.helpers={...Dn,postcss:Dn,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,t){let i=this.result.lastPlugin;try{t&&t.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=(t,i,r)=>{this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push([t,r])};for(let t of this.plugins)if(typeof t=="object")for(let i in t){if(!Gs[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!$s[i])if(typeof t[i]=="object")for(let r in t[i])r==="*"?e(t,i,t[i][r]):e(t,i+"-"+r.toLowerCase(),t[i][r]);else typeof t[i]=="function"&&e(t,i,t[i])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],i=this.runOnRoot(t);if(Et(i))try{await i}catch(r){throw this.handleError(r)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ke];){e[ke]=!0;let t=[wr(e)];for(;t.length>0;){let i=this.visitTick(t);if(Et(i))try{await i}catch(r){let o=t[t.length-1].node;throw this.handleError(r,o)}}}if(this.listeners.OnceExit)for(let[t,i]of this.listeners.OnceExit){this.result.lastPlugin=t;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 t=this.result.root.nodes.map(i=>e.Once(i,this.helpers));return Et(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=qs;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Ws(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[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 t=this.runOnRoot(e);if(Et(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ke];)e[ke]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[i,r]of e){this.result.lastPlugin=i;let o;try{o=r(t,this.helpers)}catch(s){throw this.handleError(s,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(Et(o))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:i,visitors:r}=t;if(i.type!=="root"&&i.type!=="document"&&!i.parent){e.pop();return}if(r.length>0&&t.visitorIndex<r.length){let[s,c]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=s;try{return c(i.toProxy(),this.helpers)}catch(u){throw this.handleError(u,i)}}if(t.iterator!==0){let s=t.iterator,c;for(;c=i.nodes[i.indexes[s]];)if(i.indexes[s]+=1,!c[ke]){c[ke]=!0,e.push(wr(c));return}t.iterator=0,delete i.indexes[s]}let o=t.events;for(;t.eventIndex<o.length;){let s=o[t.eventIndex];if(t.eventIndex+=1,s===Qe){i.nodes&&i.nodes.length&&(i[ke]=!0,t.iterator=i.getIterator());return}else if(this.listeners[s]){t.visitors=this.listeners[s];return}}e.pop()}walkSync(e){e[ke]=!0;let t=Cr(e);for(let i of t)if(i===Qe)e.nodes&&e.each(r=>{r[ke]||this.walkSync(r)});else{let r=this.listeners[i];if(r&&this.visitSync(r,e.toProxy()))return}}warnings(){return this.sync().warnings()}};_e.registerPostcss=n=>{Dn=n};Mr.exports=_e;_e.default=_e;Us.registerLazyResult(_e);Is.registerLazyResult(_e)});var Dr=K((Lu,kr)=>{"use strict";var Vs=Nn(),Ks=qt(),Js=zt(),Qs=lt(),Du=Mn(),Ft=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,t=Ks;try{e=t(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,t,i){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=i,this._map=void 0;let r=Qs;this.result=new Js(this._processor,void 0,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let s=new Vs(r,void 0,this._opts,t);if(s.isMap()){let[c,u]=s.generate();c&&(this.result.css=c),u&&(this.result.map=u)}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,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}};kr.exports=Ft;Ft.default=Ft});var vr=K((vu,Lr)=>{"use strict";var Ys=Rt(),Zs=Ln(),Xs=Dr(),el=Ke(),qe=class{constructor(e=[]){this.version="8.5.8",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let i of e)if(i.postcss===!0?i=i():i.postcss&&(i=i.postcss),typeof i=="object"&&Array.isArray(i.plugins))t=t.concat(i.plugins);else if(typeof i=="object"&&i.postcssPlugin)t.push(i);else if(typeof i=="function")t.push(i);else if(!(typeof i=="object"&&(i.parse||i.stringify)))throw new Error(i+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new Xs(this,e,t):new Zs(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};Lr.exports=qe;qe.default=qe;el.registerProcessor(qe);Ys.registerProcessor(qe)});var Wr=K((Ru,Ir)=>{"use strict";var Rr=vt(),Tr=ft(),tl=Te(),nl=Dt(),Br=pt(),_r=Rt(),il=or(),rl=xt(),ol=Ln(),sl=Fn(),ll=ct(),al=qt(),vn=vr(),ul=zt(),Or=Ke(),Pr=Ot(),cl=lt(),dl=Cn();function te(...n){return n.length===1&&Array.isArray(n[0])&&(n=n[0]),new vn(n)}te.plugin=function(e,t){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 c=t(...s);return c.postcssPlugin=e,c.postcssVersion=new vn().version,c}let o;return Object.defineProperty(r,"postcss",{get(){return o||(o=r()),o}}),r.process=function(s,c,u){return te([r(u)]).process(s,c)},r};te.stringify=cl;te.parse=al;te.fromJSON=il;te.list=sl;te.comment=n=>new Tr(n);te.atRule=n=>new Rr(n);te.decl=n=>new Br(n);te.rule=n=>new Pr(n);te.root=n=>new Or(n);te.document=n=>new _r(n);te.CssSyntaxError=nl;te.Declaration=Br;te.Container=tl;te.Processor=vn;te.Document=_r;te.Comment=Tr;te.Warning=dl;te.AtRule=Rr;te.Result=ul;te.Input=rl;te.Rule=Pr;te.Root=Or;te.Node=ll;ol.registerPostcss(te);Ir.exports=te;te.default=te});function ge(n){try{window.parent.postMessage(n,"*")}catch{}}function Qn(n){let e=t=>{let i=t.data;if(!i||i.source!=="hf-parent"||i.type!=="control")return;let r=i.action;if(r==="play"){n.onPlay();return}if(r==="pause"){n.onPause();return}if(r==="seek"){n.onSeek(Number(i.frame??0),i.seekMode??"commit");return}if(r==="set-muted"){n.onSetMuted(!!i.muted);return}if(r==="set-media-output-muted"){n.onSetMediaOutputMuted(!!i.muted);return}if(r==="set-playback-rate"){n.onSetPlaybackRate(Number(i.playbackRate??1));return}if(r==="enable-pick-mode"){n.onEnablePickMode();return}if(r==="disable-pick-mode"){n.onDisablePickMode();return}if(r==="flash-elements"){let o=i.selectors,s=i.duration||800;o&&Ro(o,s)}};return window.addEventListener("message",e),e}function Ro(n,e){if(!document.getElementById("__hf-flash-styles")){let t=document.createElement("style");t.id="__hf-flash-styles",t.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(t)}for(let t of n)try{document.querySelectorAll(t).forEach(r=>{r.classList.add("__hf-flash"),setTimeout(()=>r.classList.remove("__hf-flash"),e)})}catch{}}var tn=null;function Yn(n){tn=n}function nt(n,e){if(tn)try{tn({source:"hf-preview",type:"analytics",event:n,properties:e??{}})}catch{}}function Zn(n){let e=[],t=c=>{if(typeof c.getAnimations!="function")return[];try{return c.getAnimations()}catch{return[]}},i=(c,u)=>{for(let a of c){try{a.currentTime=u}catch{}try{a.pause()}catch{}}},r=c=>{for(let u of c)try{u.play()}catch{}},o=c=>{for(let u of c)try{u.pause()}catch{}},s=c=>{c.baseDelay?c.el.style.animationDelay=c.baseDelay:c.el.style.removeProperty("animation-delay"),c.basePlayState?c.el.style.animationPlayState=c.basePlayState:c.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{e=[];let c=document.querySelectorAll("*");for(let u of c){if(!(u instanceof HTMLElement))continue;let a=window.getComputedStyle(u);!a.animationName||a.animationName==="none"||e.push({el:u,baseDelay:u.style.animationDelay||"",basePlayState:u.style.animationPlayState||""})}},seek:c=>{let u=Number(c.time)||0;for(let a of e){if(!a.el.isConnected)continue;let l=n?.resolveStartSeconds?n.resolveStartSeconds(a.el):Number.parseFloat(a.el.getAttribute("data-start")??"0")||0,f=Math.max(0,u-l)*1e3,m=t(a.el);if(m.length>0){i(m,f);continue}a.el.style.animationPlayState="paused",a.el.style.animationDelay=`-${(f/1e3).toFixed(3)}s`}},pause:()=>{for(let c of e){if(!c.el.isConnected)continue;let u=t(c.el);u.length>0&&o(u),s(c)}},play:()=>{for(let c of e)c.el.isConnected&&(s(c),r(t(c.el)))},revert:()=>{e=[]}}}function Xn(n){return{name:"gsap",discover:()=>{},seek:e=>{let t=n.getTimeline();if(!t)return;t.pause();let i=Math.max(0,Number(e.time)||0);typeof t.totalTime=="function"?t.totalTime(i,!1):t.seek(i,!1)},pause:()=>{let e=n.getTimeline();e&&e.pause()}}}function ei(){return{name:"animejs",discover:()=>{try{let n=window.anime;if(!n||typeof n.running>"u")return;let e=n.running;if(!Array.isArray(e)||e.length===0)return;let t=window.__hfAnime??[],i=new Set(t);for(let r of e)i.has(r)||t.push(r);window.__hfAnime=t}catch{}},seek:n=>{let e=Math.max(0,(Number(n.time)||0)*1e3),t=window.__hfAnime;if(!(!t||t.length===0))for(let i of t)try{typeof i.seek=="function"&&i.seek(e)}catch{}},pause:()=>{let n=window.__hfAnime;if(!(!n||n.length===0))for(let e of n)try{typeof e.pause=="function"&&e.pause()}catch{}},play:()=>{let n=window.__hfAnime;if(!(!n||n.length===0))for(let e of n)try{typeof e.play=="function"&&e.play()}catch{}},revert:()=>{}}}function ii(){return{name:"lottie",discover:()=>{try{let n=window.lottie;if(n&&typeof n.getRegisteredAnimations=="function"){let e=n.getRegisteredAnimations();if(Array.isArray(e)&&e.length>0){let t=window.__hfLottie??[],i=new Set(t);for(let r of e)i.has(r)||t.push(r);window.__hfLottie=t}}}catch{}},seek:n=>{let e=Math.max(0,Number(n.time)||0),t=window.__hfLottie;if(!(!t||t.length===0))for(let i of t)try{if(ti(i))i.goToAndStop(e*1e3,!1);else if(ni(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{}},pause:()=>{let n=window.__hfLottie;if(!(!n||n.length===0))for(let e of n)try{(ti(e)||ni(e))&&e.pause()}catch{}},revert:()=>{}}}function ti(n){return typeof n=="object"&&n!==null&&typeof n.goToAndStop=="function"}function ni(n){return typeof n=="object"&&n!==null&&typeof n.pause=="function"&&("totalFrames"in n||"duration"in n)}function ri(){let n=null,e=0;return{name:"three",discover:()=>{},seek:t=>{n=Math.max(0,Number(t.time)||0),e=n,window.__hfThreeTime=n;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:n}}))}catch{}},pause:()=>{n==null&&(n=Math.max(0,e))},play:()=>{n=null},revert:()=>{n=null,e=0}}}function oi(){return{name:"waapi",discover:()=>{},seek:n=>{if(!document.getAnimations)return;let e=Math.max(0,(Number(n.time)||0)*1e3);for(let t of document.getAnimations()){try{t.currentTime=e}catch{}try{t.pause()}catch{}}},pause:()=>{if(document.getAnimations)for(let n of document.getAnimations())try{n.pause()}catch{}}}}function si(n){let e=Array.from(document.querySelectorAll("video, audio")),t=n?.shouldIncludeElement?e.filter(s=>n.shouldIncludeElement?.(s)):e.filter(s=>s.hasAttribute("data-start")),i=[],r=[],o=0;for(let s of t){let c=n?.resolveStartSeconds?n.resolveStartSeconds(s):Number.parseFloat(s.dataset.start??"0");if(!Number.isFinite(c))continue;let u=Number.parseFloat(s.dataset.playbackStart??s.dataset.mediaStart??"0")||0,a=s.defaultPlaybackRate,l=Number.isFinite(a)&&a>0?Math.max(.1,Math.min(5,a)):1,f=s.loop,m=Number.isFinite(s.duration)&&s.duration>0?s.duration:null,h=n?.resolveDurationSeconds?.(s)??Number.parseFloat(s.dataset.duration??"");(!Number.isFinite(h)||h<=0)&&m!=null&&(h=Math.max(0,(m-u)/l));let M=Number.isFinite(h)&&h>0?c+h:Number.POSITIVE_INFINITY,C=Number.parseFloat(s.dataset.volume??""),A={el:s,start:c,mediaStart:u,duration:Number.isFinite(h)&&h>0?h:Number.POSITIVE_INFINITY,end:M,volume:Number.isFinite(C)?C:null,playbackRate:l,loop:f,sourceDuration:m};i.push(A),s.tagName==="VIDEO"&&r.push(A),Number.isFinite(M)&&(o=Math.max(o,M))}return{timedMediaEls:t,mediaClips:i,videoClips:r,maxMediaEnd:o}}var nn=new WeakMap,it=new WeakSet;function To(n){if(it.has(n))return;it.add(n);let e=()=>it.delete(n);n.addEventListener("playing",e,{once:!0}),n.addEventListener("pause",e,{once:!0}),n.addEventListener("error",e,{once:!0})}function li(n){let e=!!(n.outputMuted||n.userMuted);for(let t of n.clips){let{el:i}=t;if(!i.isConnected)continue;let r=(n.timeSeconds-t.start)*t.playbackRate+t.mediaStart;if(n.timeSeconds>=t.start&&n.timeSeconds<t.end&&r>=0){if(t.loop&&t.sourceDuration!=null&&t.sourceDuration>0){let h=t.sourceDuration-t.mediaStart;h>0&&r>=t.sourceDuration&&(r=t.mediaStart+(r-t.mediaStart)%h)}t.volume!=null&&(i.volume=t.volume),e&&(i.muted=!0);try{i.playbackRate=t.playbackRate*n.playbackRate}catch{}let s=i.currentTime||0,c=Math.abs(s-r),u=r-s,a=nn.get(i);nn.set(i,u);let l=a===void 0,f=!l&&Math.abs(u-a)>.5,m=c>3;if(c>.5&&(l||f||m))try{i.currentTime=r}catch{}n.playing&&i.paused&&!it.has(i)?(i.preload!=="auto"&&(i.preload="auto"),To(i),i.play().catch(h=>{it.delete(i),(h&&typeof h=="object"&&"name"in h?String(h.name??""):"")==="NotAllowedError"&&n.onAutoplayBlocked?.()})):!n.playing&&!i.paused&&i.pause();continue}nn.delete(i),i.paused||i.pause()}}function ai(n){let e=!1,t=null,i=null,r=null,o=null;function s(S,p){try{window.dispatchEvent(new CustomEvent(S,{detail:p}))}catch{}}function c(S){r=S,s("hyperframe:picker:hovered",{elementInfo:r,isPickMode:e,timestamp:Date.now()})}function u(S){o=S,s("hyperframe:picker:selected",{elementInfo:o,isPickMode:e,timestamp:Date.now()})}function a(S){if(!S||S===document.body||S===document.documentElement)return!1;let p=S.tagName.toLowerCase();return!(p==="script"||p==="style"||p==="link"||p==="meta"||S.classList.contains("__hf-pick-highlight"))}function l(S){let p=S;if(p.id)return`#${p.id}`;let y=S.getAttribute("data-composition-id");if(y)return`[data-composition-id="${y}"]`;let F=S.getAttribute("data-composition-src");if(F)return`[data-composition-src="${F}"]`;let b=S.getAttribute("data-track-index");if(b)return`[data-track-index="${b}"]`;let N=S.tagName.toLowerCase(),B=S.parentElement;if(!B)return N;let W=B.querySelectorAll(`:scope > ${N}`);if(W.length===1)return N;for(let H=0;H<W.length;H+=1)if(W[H]===S)return`${N}:nth-of-type(${H+1})`;return N}function f(S){let p=S.tagName.toLowerCase(),y=(S.textContent??"").trim().replace(/\\s+/g," "),F=(b,N)=>b.length>N?`${b.slice(0,N-1)}\\u2026`:b;return p==="h1"||p==="h2"||p==="h3"?"Heading":p==="p"||p==="span"||p==="div"?y.length>0?F(y,56):"Text":p==="img"?"Image":p==="video"?"Video":p==="audio"?"Audio":p==="svg"?"Shape":S.getAttribute("data-composition-src")?"Composition":p==="section"?"Section":`${p.charAt(0).toUpperCase()}${p.slice(1)}`}function m(S,p,y){let F=typeof y=="number"&&y>0?y:8,b=[];if(document.elementsFromPoint)b=document.elementsFromPoint(S,p);else if(document.elementFromPoint){let W=document.elementFromPoint(S,p);b=W?[W]:[]}let N={},B=[];for(let W=0;W<b.length;W+=1){let H=b[W];if(!a(H))continue;let X=`${H.tagName}::${H.id||""}::${W}`;if(!N[X]&&(N[X]=!0,B.push(H),B.length>=F))break}return B}function h(S){let p=S.getBoundingClientRect(),y={};for(let b=0;b<S.attributes.length;b+=1){let N=S.attributes[b];N.name.startsWith("data-")&&(y[N.name]=N.value)}return{id:S.id||null,tagName:S.tagName.toLowerCase(),selector:l(S),label:f(S),boundingBox:{x:p.left,y:p.top,width:p.width,height:p.height},textContent:S.textContent?S.textContent.trim().slice(0,200):null,src:S.getAttribute("src")||S.getAttribute("data-composition-src")||null,dataAttributes:y}}function M(S,p,y){return m(S,p,y).map(h)}function C(S){if(!e)return;let y=m(S.clientX,S.clientY,1)[0]??(S.target instanceof Element?S.target:null);if(!a(y)||t===y)return;t&&t.classList.remove("__hf-pick-highlight"),t=y,y.classList.add("__hf-pick-highlight");let F=h(y);c(F),n.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:F})}function A(S){if(!e)return;S.preventDefault(),S.stopPropagation(),S.stopImmediatePropagation();let p=M(S.clientX,S.clientY,8);p.length!==0&&(c(p[0]??null),n.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:p,selectedIndex:0,point:{x:S.clientX,y:S.clientY}}))}function z(S){S.key==="Escape"&&(D(),n.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function O(){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",C,!0),document.addEventListener("click",A,!0),document.addEventListener("keydown",z,!0),s("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function D(){e&&(e=!1,t&&(t.classList.remove("__hf-pick-highlight"),t=null),i&&(i.remove(),i=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",C,!0),document.removeEventListener("click",A,!0),document.removeEventListener("keydown",z,!0),s("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function Y(){window.__HF_PICKER_API={enable:O,disable:D,isActive:()=>e,getHovered:()=>r,getSelected:()=>o,getCandidatesAtPoint:(S,p,y)=>Number.isFinite(S)&&Number.isFinite(p)?M(S,p,y):[],pickAtPoint:(S,p,y)=>{if(!Number.isFinite(S)||!Number.isFinite(p))return null;let F=M(S,p,8);if(!F.length)return null;let b=Math.max(0,Math.min(F.length-1,Number(y??0))),N=F[b]??null;return N?(u(N),n.postMessage({source:"hf-preview",type:"element-picked",elementInfo:N}),D(),N):null},pickManyAtPoint:(S,p,y)=>{if(!Number.isFinite(S)||!Number.isFinite(p))return[];let F=M(S,p,8);if(!F.length)return[];let b=[],N=Array.isArray(y)?y:[0];for(let B of N){let W=Math.max(0,Math.min(F.length-1,Math.floor(Number(B)))),H=F[W];if(!H)continue;b.some(v=>v.selector===H.selector&&v.tagName===H.tagName)||b.push(H)}return b.length?(u(b[0]??null),n.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:b}),D(),b):[]}},s("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:O,disablePickMode:D,installPickerApi:Y}}function rn(n,e){let t=Number.isFinite(e)&&e>0?e:30,i=Number.isFinite(n)&&n>0?n:0;return Math.floor(i*t+1e-9)/t}function kt(n,e,t){if(n){for(let i of Object.values(n))if(!(!i||i===e))try{t(i)}catch{}}}function ui(n,e,t){let i=rn(e,t);return n.pause(),typeof n.totalTime=="function"?n.totalTime(i,!1):n.seek(i,!1),i}function Bo(n,e,t,i){let r=[];kt(n,e,o=>{o.play(),r.push(o)});try{return ui(e,t,i)}finally{for(let o of r)try{o.pause()}catch{}}}function _o(n,e){kt(n,e,t=>{t.play()})}function ci(n){return{_timeline:null,play:()=>{let e=n.getTimeline();if(!e||n.getIsPlaying())return;let t=Math.max(0,Number(n.getSafeDuration?.()??e.duration()??0)||0);t>0&&Math.max(0,Number(e.time())||0)>=t&&(e.pause(),e.seek(0,!1),n.onDeterministicSeek(0),n.setIsPlaying(!1),n.onSyncMedia(0,!1),n.onRenderFrameSeek(0)),typeof e.timeScale=="function"&&e.timeScale(n.getPlaybackRate()),e.play(),kt(n.getTimelineRegistry?.(),e,i=>{typeof i.timeScale=="function"&&i.timeScale(n.getPlaybackRate()),i.play()}),n.onDeterministicPlay(),n.setIsPlaying(!0),n.onShowNativeVideos(),n.onStatePost(!0)},pause:()=>{let e=n.getTimeline();if(!e)return;e.pause(),kt(n.getTimelineRegistry?.(),e,i=>{i.pause()});let t=Math.max(0,Number(e.time())||0);n.onDeterministicSeek(t),n.onDeterministicPause(),n.setIsPlaying(!1),n.onSyncMedia(t,!1),n.onRenderFrameSeek(t),n.onStatePost(!0)},seek:e=>{let t=n.getTimeline();if(!t)return;let i=Math.max(0,Number(e)||0),r=Bo(n.getTimelineRegistry?.(),t,i,n.getCanonicalFps());n.onDeterministicSeek(r),n.setIsPlaying(!1),n.onSyncMedia(r,!1),n.onRenderFrameSeek(r),n.onStatePost(!0)},renderSeek:e=>{let t=n.getTimeline(),i=n.getCanonicalFps(),r=t?(_o(n.getTimelineRegistry?.(),t),ui(t,e,i)):rn(Math.max(0,Number(e)||0),i);n.onDeterministicSeek(r),n.setIsPlaying(!1),n.onSyncMedia(r,!1),n.onRenderFrameSeek(r),n.onStatePost(!0)},getTime:()=>Number(n.getTimeline()?.time()??0),getDuration:()=>Number(n.getTimeline()?.duration()??0),isPlaying:()=>n.getIsPlaying(),setPlaybackRate:e=>n.setPlaybackRate(e),getPlaybackRate:()=>n.getPlaybackRate()}}function di(){return{capturedTimeline:null,isPlaying:!1,rafId:null,currentTime:0,deterministicAdapters:[],parityModeEnabled:!0,canonicalFps:30,bridgeMuted:!1,mediaOutputMuted:!1,mediaAutoplayBlockedPosted:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,timelinePollIntervalId:null,controlBridgeHandler:null,clampDurationLoggedRaw:null,beforeUnloadHandler:null,domReadyHandler:null,injectedCompStyles:[],injectedCompScripts:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,maxTimelineDurationSeconds:1800,nativeVisualWatchdogTick:0}}var Oo="data-hf-authored-duration",Po="data-hf-authored-end";function We(n){if(n==null||n==="")return null;let e=Number(n);return Number.isFinite(e)?e:null}function Io(n){return We(n.getAttribute("data-duration"))}function Wo(n){return We(n.getAttribute("data-end"))}function Ho(n){return We(n.getAttribute(Oo))}function Uo(n){return We(n.getAttribute(Po))}function qo(n){let e=(n??"").trim();if(!e)return null;let t=We(e);if(t!=null)return{kind:"absolute",value:t};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",c=Number.parseFloat(s),u=Number.isFinite(c)?Math.max(0,c):0,a=o==="-"?-u:u;return{kind:"reference",refId:r,offset:a}}function He(n){let e=n.timelineRegistry??{},t=n.includeAuthoredTimingAttrs??!1,i=new WeakMap,r=new WeakMap,o=new Set,s=l=>{let f=document.getElementById(l);return f||(document.querySelector(`[data-composition-id="${CSS.escape(l)}"]`)??null)},c=l=>{let f=r.get(l);if(f!==void 0)return f;let m=null,h=Io(l)??(t?Ho(l):null);if(h!=null&&h>0&&(m=h),m==null||m<=0){let M=Wo(l)??(t?Uo(l):null);if(M!=null){let C=a(l,0),A=M-C;Number.isFinite(A)&&A>0&&(m=A)}}if((m==null||m<=0)&&l instanceof HTMLMediaElement){let M=We(l.getAttribute("data-playback-start"))??We(l.getAttribute("data-media-start"))??0;Number.isFinite(l.duration)&&l.duration>M&&(m=l.duration-M)}if(m==null||m<=0){let M=l.getAttribute("data-composition-id");if(M){let C=e[M]??null;if(C&&typeof C.duration=="function")try{let A=Number(C.duration());Number.isFinite(A)&&A>0&&(m=A)}catch{}}}return m!=null&&Number.isFinite(m)&&m>0?(r.set(l,m),m):(r.set(l,null),null)},u=(l,f)=>{if(l.hasAttribute("data-composition-id")){let h=l.parentElement?.closest("[data-composition-id]");return h?a(h,f):0}let m=l.closest("[data-composition-id]");return m?a(m,f):0},a=(l,f)=>{let m=i.get(l);if(m!==void 0)return m??f;if(o.has(l))return f;o.add(l);try{let h=qo(l.getAttribute("data-start"));if(!h){if(l.hasAttribute("data-composition-id")){let O=l.parentElement;if(O&&(O.hasAttribute("data-composition-src")||O.hasAttribute("data-composition-id"))){let D=a(O,f);return i.set(l,D),D}}return i.set(l,f),f}if(h.kind==="absolute"){let O=Math.max(0,h.value),D=Math.max(0,u(l,f)+O);return i.set(l,D),D}let M=s(h.refId);if(!M)return i.set(l,f),f;let C=a(M,0),A=c(M);if(A==null||A<=0){let O=Math.max(0,C+h.offset);return i.set(l,O),O}let z=Math.max(0,C+A+h.offset);return i.set(l,z),z}finally{o.delete(l)}};return{resolveStartForElement:(l,f=0)=>a(l,Math.max(0,f)),resolveDurationForElement:l=>c(l)}}var zo="data-hf-authored-duration",jo="data-hf-authored-end";function ye(n){if(n==null||n==="")return null;let e=Number(n);return Number.isFinite(e)?e:null}function on(n){return ye(n.getAttribute("data-duration"))??ye(n.getAttribute(zo))}function fi(n){return ye(n.getAttribute("data-end"))??ye(n.getAttribute(jo))}function sn(...n){let e=n.filter(t=>Number.isFinite(t??null));return e.length===0?null:Math.max(...e)}var mi={composition:0,video:1,image:2,element:3,audio:4};function Go(n){if(n.length===0)return;let e=new Map;for(let s of n){let c=e.get(s.track)??new Set;c.add(s.kind),e.set(s.track,c)}if(!Array.from(e.values()).some(s=>s.size>1))return;let i=0,r=new Map,o=[...e.keys()].sort((s,c)=>s-c);for(let s of o){let c=e.get(s);if(c.size===1)r.set(`${s}:${[...c][0]}`,i++);else{let u=[...c].sort((a,l)=>(mi[a]??99)-(mi[l]??99));for(let a of u)r.set(`${s}:${a}`,i++)}}for(let s of n){let c=`${s.track}:${s.kind}`,u=r.get(c);u!=null&&(s.track=u)}}function rt(n){let e=String(n??"").trim();if(!e)return null;let t=e.toLowerCase();if(t.startsWith("data:")||t.startsWith("javascript:"))return null;try{return new URL(e,document.baseURI).toString()}catch{return e}}function $o(n){let e=n.getAttribute("src")??n.getAttribute("data-src");if(e)return rt(e);let t=n.getAttribute("data-composition-src");if(t)return rt(t);let i=n.querySelector("img[src], video[src], audio[src], source[src]");return i?rt(i.getAttribute("src")):null}function pi(n){let t=window.__timelines??{},i=He({timelineRegistry:t,includeAuthoredTimingAttrs:!0}),r=R=>{if(!R)return null;let k=t[R]??null;if(!k||typeof k.duration!="function")return null;try{let L=Number(k.duration());return Number.isFinite(L)&&L>0?L:null}catch{return null}},o=R=>{let k=ye(R.getAttribute("data-duration"));if(k!=null&&k>0)return k;let L=ye(R.getAttribute("data-playback-start"))??ye(R.getAttribute("data-media-start"))??0;return Number.isFinite(R.duration)&&R.duration>L?Math.max(0,R.duration-L):null},s=()=>{let R=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(R.length===0)return null;let k=0;for(let L of R){let Q=i.resolveStartForElement(L,0);if(!Number.isFinite(Q))continue;let ne=o(L);ne==null||ne<=0||(k=Math.max(k,Math.max(0,Q)+ne))}return k>0?k:null},c=R=>{let k=R.trim().toLowerCase();return!(!k||k==="main"||k.includes("caption")||k.includes("ambient"))},u=(R,k)=>{let L=[],Q=null,ne=null,P=null,I=R.parentElement;for(;I;){let j=I.getAttribute("data-composition-id");j&&(L.push(j),!P&&I!==k&&(P=j),Q==null&&(Q=i.resolveStartForElement(I,0)),ne==null&&(ne=ye(I.getAttribute("data-duration"))??r(j)??null)),I=I.parentElement}return{parentCompositionId:P,compositionAncestors:L.reverse(),inheritedStart:Q,inheritedDuration:ne}},a=document.querySelector("[data-composition-id]"),l=Array.from(document.querySelectorAll("[data-composition-id]")),f=a?.getAttribute("data-composition-id")??null,m=a?i.resolveStartForElement(a,0):0,h=s(),M=h!=null?Math.max(0,h-Math.max(0,m)):null,C=r(f),A=on(a??document.body),z=sn(...l.filter(R=>R!==a).map(R=>{let k=i.resolveStartForElement(R,0),L=i.resolveDurationForElement(R)??r(R.getAttribute("data-composition-id"))??null;return!Number.isFinite(k)||L==null||L<=0?null:Math.max(0,k)+L})),O=z!=null?Math.max(0,z-Math.max(0,m)):null,D=typeof C=="number"&&Number.isFinite(C)&&C>0?C:null,Y=typeof A=="number"&&Number.isFinite(A)&&A>0?A:null,S=typeof M=="number"&&Number.isFinite(M)&&M>0?M:null,p=typeof O=="number"&&Number.isFinite(O)&&O>0?O:null,y=sn(S,p),F=D!=null&&y!=null&&D>y+1,b=Y??(F?y:sn(D,S,p)),N=b!=null?Math.min(b,n.maxTimelineDurationSeconds):null,W=(N!=null?m+N:null)??(typeof h=="number"&&Number.isFinite(h)&&h>0?h:null),H=(R,k)=>!Number.isFinite(k)||k<=0?0:W==null||!Number.isFinite(W)?k:!Number.isFinite(R)||R>=W?0:Math.max(0,Math.min(k,W-R)),X=[],v=[],Z=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),ee=0;for(let R=0;R<Z.length;R+=1){let k=Z[R];if(k===a||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(k.tagName))continue;let L=u(k,a),Q=i.resolveStartForElement(k,L.inheritedStart??0),ne=k.getAttribute("data-composition-id"),P=on(k);if((P==null||P<=0)&&ne&&ne!==f&&(P=r(ne)),(P==null||P<=0)&&k instanceof HTMLMediaElement){let ce=ye(k.getAttribute("data-playback-start"))??ye(k.getAttribute("data-media-start"))??0;Number.isFinite(k.duration)&&k.duration>0&&(P=Math.max(0,k.duration-ce))}if(P==null||P<=0){let ce=L.inheritedDuration;if(ce!=null&&ce>0){let Fe=(L.inheritedStart??0)+ce;P=Math.max(0,Fe-Q)}}if(P==null||P<=0||(P=H(Q,P),P<=0))continue;let I=Q+P;ee=Math.max(ee,I);let j=k.tagName.toLowerCase(),Ne=ne&&ne!==f?"composition":j==="video"?"video":j==="audio"?"audio":j==="img"?"image":"element";X.push({id:k.id||ne||`__node__index_${R}`,label:k.getAttribute("data-timeline-label")??k.getAttribute("data-label")??k.getAttribute("aria-label")??ne??k.id??k.className?.split(" ")[0]??Ne,start:Q,duration:P,track:Number.parseInt(k.getAttribute("data-track-index")??k.getAttribute("data-track")??String(R),10)||0,kind:Ne,tagName:j,compositionId:k.getAttribute("data-composition-id"),compositionAncestors:L.compositionAncestors,parentCompositionId:L.parentCompositionId,nodePath:null,compositionSrc:rt(k.getAttribute("data-composition-src")),assetUrl:$o(k),timelineRole:k.getAttribute("data-timeline-role"),timelineLabel:k.getAttribute("data-timeline-label"),timelineGroup:k.getAttribute("data-timeline-group"),timelinePriority:ye(k.getAttribute("data-timeline-priority"))})}let U=new Set(X.map(R=>R.id)),G=a?.getAttribute("data-composition-id")??null,T=G?t[G]??null:null;if(T&&a){let R=T;if(typeof R.getChildren=="function")try{let k=R.getChildren(!0,!0,!1)??[],L=new Map;for(let P of a.children){let I=P;if(!I.id)continue;let j=I.tagName.toLowerCase();j==="script"||j==="style"||j==="link"||L.set(I,{id:I.id,start:1/0,end:-1/0})}let Q=P=>{let I=P;for(;I;){if(L.has(I))return I;if(I===a)return null;I=I.parentElement}return null};for(let P of k){if(typeof P.targets!="function"||typeof P.startTime!="function"||typeof P.duration!="function")continue;let I=P.startTime(),j=P.parent;for(;j&&j!==T&&typeof j.startTime=="function";)I+=j.startTime(),j=j.parent;let Ne=I+P.duration();if(!(!Number.isFinite(I)||!Number.isFinite(Ne)))for(let ce of P.targets()){if(!(ce instanceof Element))continue;let ze=Q(ce);if(!ze)continue;let Fe=L.get(ze);Fe&&(Fe.start=Math.min(Fe.start,I),Fe.end=Math.max(Fe.end,Ne))}}let ne=X.length>0?Math.max(...X.map(P=>P.track))+1:0;for(let[P,I]of L){if(I.start===1/0||I.end===-1/0)continue;let j=P;if(U.has(j.id))continue;let Ne=Math.max(0,I.end-I.start);if(Ne<=0)continue;let ce=H(I.start,Ne);ce<=0||(ee=Math.max(ee,I.start+ce),X.push({id:j.id,label:j.getAttribute("data-timeline-label")??j.getAttribute("data-label")??j.getAttribute("aria-label")??j.id,start:I.start,duration:ce,track:Number.parseInt(j.getAttribute("data-track-index")??j.getAttribute("data-track")??"",10)||ne,kind:"element",tagName:j.tagName.toLowerCase(),compositionId:j.getAttribute("data-composition-id"),compositionAncestors:G?[G]:[],parentCompositionId:G,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:ye(j.getAttribute("data-timeline-priority"))}),U.add(j.id))}}catch{}}if(a&&N!=null&&N>0){let R=X.length>0?Math.max(...X.map(k=>k.track))+1:0;for(let k of a.children){let L=k;if(!L.id||U.has(L.id))continue;let Q=L.getAttribute("data-timeline-role");if(Q!=="overlay"&&Q!=="persistent-overlay")continue;let ne=L.tagName.toLowerCase();if(ne==="script"||ne==="style"||ne==="link"||ne==="meta"||window.getComputedStyle(L).display==="none")continue;let I=H(0,N);I<=0||(ee=Math.max(ee,I),X.push({id:L.id,label:L.getAttribute("data-timeline-label")??L.getAttribute("data-label")??L.getAttribute("aria-label")??L.id,start:0,duration:I,track:Number.parseInt(L.getAttribute("data-track-index")??L.getAttribute("data-track")??"",10)||R,kind:"element",tagName:ne,compositionId:L.getAttribute("data-composition-id"),compositionAncestors:G?[G]:[],parentCompositionId:G,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:Q,timelineLabel:L.getAttribute("data-timeline-label"),timelineGroup:L.getAttribute("data-timeline-group"),timelinePriority:ye(L.getAttribute("data-timeline-priority"))}),U.add(L.id))}}Go(X);for(let R of l){if(R===a)continue;let k=R.getAttribute("data-composition-id");if(!k||!c(k))continue;let L=i.resolveStartForElement(R,0),Q=on(R);if((Q==null||Q<=0)&&fi(R)!=null){let j=fi(R);Q=Math.max(0,j-L)}let ne=r(k),P=Q&&Q>0?Q:ne;if(P==null||P<=0)continue;let I=H(L,P);I<=0||v.push({id:k,label:R.getAttribute("data-label")??k,start:L,duration:I,thumbnailUrl:rt(R.getAttribute("data-thumbnail-url")),avatarName:null})}let J=Math.max(1,Math.min(Math.max(ee||1,N??0),n.maxTimelineDurationSeconds));return{source:"hf-preview",type:"timeline",durationInFrames:F&&Y==null?Number.POSITIVE_INFINITY:Math.max(1,Math.round(J*Math.max(1,n.canonicalFps))),clips:X,scenes:v,compositionWidth:ye(a?.getAttribute("data-width"))??1920,compositionHeight:ye(a?.getAttribute("data-height"))??1080}}var re=vo(Wr(),1),Hr=re.default,Tu=re.default.stringify,Bu=re.default.fromJSON,_u=re.default.plugin,Ou=re.default.parse,Pu=re.default.list,Iu=re.default.document,Wu=re.default.comment,Hu=re.default.atRule,Uu=re.default.rule,qu=re.default.decl,zu=re.default.root,ju=re.default.CssSyntaxError,Gu=re.default.Declaration,$u=re.default.Container,Vu=re.default.Processor,Ku=re.default.Document,Ju=re.default.Comment,Qu=re.default.Warning,Yu=re.default.AtRule,Zu=re.default.Result,Xu=re.default.Input,ec=re.default.Rule,tc=re.default.Root,nc=re.default.Node;function Rn(n){return n.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function fl(n){return n.replace(/\\\\/g,"\\\\\\\\").replace(/"/g,\'\\\\"\')}function ml(n,e,t){let i=pl(n,e,t),r=i.trim();if(!r||/^(html|body|:root|\\*)$/i.test(r))return n;let o=new RegExp(`\\\\[\\\\s*data-composition-id\\\\s*=\\\\s*(["\'])${Rn(t)}\\\\1\\\\s*\\\\]`,"g");if(o.test(r))return i.replace(o,e);let s=i.match(/^\\s*/)?.[0]??"",c=i.match(/\\s*$/)?.[0]??"";return`${s}${e} ${r}${c}`}function pl(n,e,t){let i=Rn(t),r=String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${i}"|\'${i}\')\\s*\\]`,o=String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`;return n.replace(new RegExp(`${r}(?:${o})+`,"g"),e).replace(new RegExp(`(?:${o})+${r}`,"g"),e)}var hl=new Set(["keyframes","-webkit-keyframes","font-face"]);function xl(n){return n?.type==="atrule"}function gl(n){let e=n.parent;for(;e;){if(xl(e)&&hl.has(e.name.toLowerCase()))return!0;e=e.parent}return!1}function Tn(n,e,t){let i=e.trim();if(!n||!i)return n;let r=t||`[data-composition-id="${fl(i)}"]`,o=Hr.parse(n);return o.walkRules(s=>{gl(s)||(s.selectors=s.selectors.map(c=>ml(c,r,i)))}),o.toResult({map:!1}).css}function Ur(n,e,t="[HyperFrames] composition script error:",i,r=e){let o=JSON.stringify(e),s=JSON.stringify(r),c=JSON.stringify(t),u=Rn(e),a=JSON.stringify(i??null),l=JSON.stringify(String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${u}"|\'${u}\')\\s*\\]`),f=JSON.stringify(String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`);return`(function(){\n var __hfCompId = ${o};\n var __hfTimelineCompId = ${s};\n var __hfErrorLabel = ${c};\n var __hfEscapeAttr = function(value) {\n return (value + "").replace(/\\\\\\\\/g, "\\\\\\\\\\\\\\\\").replace(/"/g, "\\\\\\\\\\\\"");\n };\n var __hfRootSelector = ${a} || (__hfCompId\n ? \'[data-composition-id="\' + __hfEscapeAttr(__hfCompId) + \'"]\'\n : "");\n var __hfRoot = null;\n var __hfRootSelectorPattern = ${l};\n var __hfTimingSelectorPattern = ${f};\n var __hfNormalizeSelector = function(selector) {\n if (!__hfCompId || typeof selector !== "string") return selector;\n return selector\n .replace(new RegExp(__hfRootSelectorPattern + \'(?:\' + __hfTimingSelectorPattern + \')+\', \'g\'), __hfRootSelector)\n .replace(new RegExp(\'(?:\' + __hfTimingSelectorPattern + \')+\' + __hfRootSelectorPattern, \'g\'), __hfRootSelector);\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 __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") {\n return function(id) {\n var found = target.getElementById(id);\n return found && __hfContains(found) ? found : null;\n };\n }\n var value = Reflect.get(target, prop, receiver);\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, receiver);\n },\n set: function(target, prop, value, receiver) {\n return Reflect.set(target, prop === __hfCompId ? __hfTimelineCompId : prop, value, receiver);\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 var value = Reflect.get(target, prop, receiver);\n return typeof value === "function" ? value.bind(target) : value;\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, receiver);\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 (_err) {}\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.slice.call(root.querySelectorAll(selector));\n };\n };\n }\n var value = Reflect.get(utilsTarget, utilsProp, utilsReceiver);\n return typeof value === "function" ? value.bind(utilsTarget) : value;\n },\n });\n }\n var value = Reflect.get(target, prop, receiver);\n return typeof value === "function" ? value.bind(target) : value;\n },\n });\n var __hfRun = function() {\n try {\n (function(document, gsap, window) {\n${n}\n }).call(window, __hfScopedDocument, __hfScopedGsap, __hfScopedWindow);\n } catch (_err) {\n console.error(__hfErrorLabel, __hfCompId, _err);\n }\n };\n __hfFindRoot();\n __hfRun();\n})()`}var yl=8e3,Sl=/^(?![a-zA-Z][a-zA-Z\\d+\\-.]*:)(?!\\/\\/)(?!\\/)(?!\\.\\.?\\/).+/,Al=n=>new Promise(e=>{let t=!1,i=Date.now(),r=null,o=s=>{t||(t=!0,r!=null&&window.clearTimeout(r),e({status:s,elapsedMs:Math.max(0,Date.now()-i)}))};n.addEventListener("load",()=>o("load"),{once:!0}),n.addEventListener("error",()=>o("error"),{once:!0}),r=window.setTimeout(()=>o("timeout"),yl)});function Bn(n){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=""}function qr(n,e){let t=n.trim();if(!t)return n;try{return Sl.test(t)?new URL(t,document.baseURI).toString():e?new URL(t,e).toString():new URL(t,document.baseURI).toString()}catch{return n}}async function _n(n){let e=null;n.hostCompositionId&&(e=Array.from(n.sourceNode.querySelectorAll("[data-composition-id]")).find(l=>l.getAttribute("data-composition-id")===n.hostCompositionId)??null);let t=e??n.sourceNode,i=e?.getAttribute("data-composition-id")?.trim()||n.hostCompositionId||null;if(n.headStyles)for(let a of n.headStyles){let l=a.cloneNode(!0);l instanceof HTMLStyleElement&&(i&&(l.textContent=Tn(l.textContent||"",i)),document.head.appendChild(l),n.injectedStyles.push(l))}let r=Array.from(t.querySelectorAll("style"));for(let a of r){let l=a.cloneNode(!0);l instanceof HTMLStyleElement&&(i&&(l.textContent=Tn(l.textContent||"",i)),document.head.appendChild(l),n.injectedStyles.push(l))}let o=[];if(n.headScripts)for(let a of n.headScripts){let l=a.getAttribute("type")?.trim()??"",f=a.getAttribute("src")?.trim()??"";if(f){let m=qr(f,n.compositionUrl);o.push({kind:"external",src:m,type:l})}else{let m=a.textContent?.trim()??"";m&&o.push({kind:"inline",content:m,type:l,scopeCompositionId:i})}}let s=Array.from(t.querySelectorAll("script")),c=[...o];for(let a of s){let l=a.getAttribute("type")?.trim()??"",f=a.getAttribute("src")?.trim()??"";if(f){let m=qr(f,n.compositionUrl);c.push({kind:"external",src:m,type:l})}else{let m=a.textContent?.trim()??"";m&&c.push({kind:"inline",content:m,type:l,scopeCompositionId:i})}a.parentNode?.removeChild(a)}let u=Array.from(t.querySelectorAll("style"));for(let a of u)a.parentNode?.removeChild(a);if(e){let a=document.importNode(e,!0),l=e.getAttribute("data-width"),f=e.getAttribute("data-height"),m=n.parseDimensionPx(l),h=n.parseDimensionPx(f);for(l&&n.host.setAttribute("data-width",l),f&&n.host.setAttribute("data-height",f),m&&n.host instanceof HTMLElement&&(n.host.style.width=m),h&&n.host instanceof HTMLElement&&(n.host.style.height=h);a.firstChild;)n.host.appendChild(a.firstChild)}else n.hasTemplate?n.host.appendChild(document.importNode(t,!0)):n.host.innerHTML=n.fallbackBodyInnerHtml;for(let a of c){let l=document.createElement("script");if(a.type&&(l.type=a.type),l.async=!1,a.kind==="external"?l.src=a.src:a.type.toLowerCase()==="module"?l.textContent=a.content:a.scopeCompositionId?l.textContent=Ur(a.content,a.scopeCompositionId):l.textContent=`(function(){${a.content}})();`,document.body.appendChild(l),n.injectedScripts.push(l),a.kind==="external"){let f=await Al(l);f.status!=="load"&&n.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:n.hostCompositionId,hostCompositionSrc:n.hostCompositionSrc,resolvedScriptSrc:a.src,loadStatus:f.status,elapsedMs:f.elapsedMs}})}}}async function zr(n){let e=Array.from(document.querySelectorAll("[data-composition-id]:not([data-composition-src])")).filter(t=>{if(t.children.length>0)return!1;let i=t.getAttribute("data-composition-id");return i?!!document.querySelector(`template#${CSS.escape(i)}-template`):!1});if(e.length!==0)for(let t of e){let i=t.getAttribute("data-composition-id"),r=document.querySelector(`template#${CSS.escape(i)}-template`);Bn(t),await _n({host:t,hostCompositionId:i,hostCompositionSrc:`template#${i}-template`,sourceNode:r.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:n.injectedStyles,injectedScripts:n.injectedScripts,parseDimensionPx:n.parseDimensionPx,onDiagnostic:n.onDiagnostic})}}async function jr(n){let e=Array.from(document.querySelectorAll("[data-composition-src]"));e.length!==0&&await Promise.all(e.map(async t=>{let i=t.getAttribute("data-composition-src");if(!i)return;let r=null;try{r=new URL(i,document.baseURI)}catch{r=null}Bn(t);try{let o=t.getAttribute("data-composition-id"),s=o!=null?document.querySelector(`template#${CSS.escape(o)}-template`):null;if(s){await _n({host:t,hostCompositionId:o,hostCompositionSrc:i,sourceNode:s.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:r,injectedStyles:n.injectedStyles,injectedScripts:n.injectedScripts,parseDimensionPx:n.parseDimensionPx,onDiagnostic:n.onDiagnostic});return}let c=await fetch(i);if(!c.ok)throw new Error(`HTTP ${c.status}`);let u=await c.text(),l=new DOMParser().parseFromString(u,"text/html"),f=(o?l.querySelector(`template#${CSS.escape(o)}-template`):null)??l.querySelector("template"),m=f?f.content:l.body,h=f?void 0:Array.from(l.head.querySelectorAll("style")),M=f?void 0:Array.from(l.head.querySelectorAll("script"));await _n({host:t,hostCompositionId:o,hostCompositionSrc:i,sourceNode:m,hasTemplate:!!f,fallbackBodyInnerHtml:l.body.innerHTML,compositionUrl:r,injectedStyles:n.injectedStyles,injectedScripts:n.injectedScripts,parseDimensionPx:n.parseDimensionPx,headStyles:h,headScripts:M,onDiagnostic:n.onDiagnostic})}catch(o){n.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:t.getAttribute("data-composition-id"),hostCompositionSrc:i,errorMessage:o instanceof Error?o.message:"unknown_error"}}),Bn(t)}}))}function On(){let n=window.gsap;n&&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 t=[],i=document.querySelectorAll(".caption-group");for(let r of i){let o=r.querySelectorAll(":scope > span");for(let s of o)t.push(s)}for(let r of e){let o=null;if(r.wordId&&(o=document.getElementById(r.wordId)),!o&&r.wordIndex!==void 0&&(o=t[r.wordIndex]??null),!o||!(o instanceof HTMLElement))continue;let s={},c={};if(r.x!==void 0&&(s.x=r.x),r.y!==void 0&&(s.y=r.y),r.scale!==void 0&&(s.scale=r.scale),r.rotation!==void 0&&(s.rotation=r.rotation),r.opacity!==void 0&&(c.opacity=r.opacity),r.fontSize!==void 0&&(c.fontSize=`${r.fontSize}px`),r.fontWeight!==void 0&&(c.fontWeight=r.fontWeight),r.fontFamily!==void 0&&(c.fontFamily=r.fontFamily),r.activeColor||r.dimColor){let a=n.getTweensOf(o).filter(f=>f.vars.color!==void 0).sort((f,m)=>f.startTime()-m.startTime()),l=a.length>0?String(a[0].vars.color):"";for(let f of a)String(f.vars.color)===l?r.dimColor&&(f.vars.color=r.dimColor):r.activeColor&&(f.vars.color=r.activeColor);r.dimColor&&n.set(o,{color:r.dimColor})}if(Object.keys(c).length>0&&n.set(o,c),Object.keys(s).length>0){let u=document.createElement("span");u.style.display="inline-block",u.dataset.captionWrapper="true",o.parentNode?.insertBefore(u,o),u.appendChild(o),n.set(u,s)}}}).catch(()=>{})}var Gr="data-hf-authored-duration",$r="data-hf-authored-end";function Vr(){let n=di(),e=window,t=null,i=null,r=[],o=new Set,s=null;if(typeof e.__hfRuntimeTeardown=="function")try{e.__hfRuntimeTeardown()}catch{}document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden"),window.__timelines=window.__timelines||{};let c=d=>{r.push(d)},u=(d,g,x)=>{let w=x??`${d}:${JSON.stringify(g)}`;o.has(w)||(o.add(w),ge({source:"hf-preview",type:"diagnostic",code:d,details:g}))},a=d=>{let g={scale:1,focusX:960,focusY:540},x=[],w=[],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:()=>g,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>x,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:()=>w,getRenderState:()=>({...E,time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying()})}},l=1/60,f=.75,m=.75,h=.35,M=900,C=3,A=2,z=.05,O=100,D=240,Y=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??"")}},S=d=>{let g=d.toLowerCase();return g.includes("cannot read properties of null")||g.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:g.includes("failed to execute \'queryselector\'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:g.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},p=d=>{if(d==null||d.trim()==="")return null;let g=Number.parseFloat(d);return!Number.isFinite(g)||g<=0?null:`${g}px`},y=()=>{let d=document.querySelector(\'[data-composition-id][data-root="true"]\');if(d instanceof HTMLElement)return d;let g=Array.from(document.querySelectorAll("[data-composition-id]"));return g.length===0?null:g.find(x=>!x.parentElement?.closest("[data-composition-id]"))??g[0]??null},F=()=>{let d=y();if(!d)return;let g=p(d.getAttribute("data-width")),x=p(d.getAttribute("data-height"));g&&(d.style.width=g),x&&(d.style.height=x),g&&d.style.setProperty("--comp-width",g),x&&d.style.setProperty("--comp-height",x)},b=()=>{let d=y(),g=Array.from(document.querySelectorAll("[data-composition-id]")).filter(x=>x.hasAttribute("data-duration")||x.hasAttribute("data-end"));for(let x of g){if(d&&x===d)continue;let w=x.getAttribute("data-duration"),E=x.getAttribute("data-end");w!=null&&!x.hasAttribute(Gr)&&x.setAttribute(Gr,w),E!=null&&!x.hasAttribute($r)&&x.setAttribute($r,E),x.removeAttribute("data-duration"),x.removeAttribute("data-end")}},N=()=>{let d=y();if(!d)return;d.style.position||(d.style.position="relative"),d.style.overflow="hidden";let g=p(d.getAttribute("data-width")),x=p(d.getAttribute("data-height"));g&&(d.style.width=g),x&&(d.style.height=x);let w=Array.from(d.children);for(let E of w){let _=E.tagName.toLowerCase();if(_==="script"||_==="style"||_==="link"||_==="meta"||!E.hasAttribute("data-start"))continue;let le=(E.style.top==="0px"||E.style.top==="0")&&(E.style.left==="0px"||E.style.left==="0")&&E.style.width==="100%"&&E.style.height==="100%",ae=/translate\\(\\s*-50%\\s*,\\s*-50%\\s*\\)/.test(E.style.transform);if(le&&ae&&!E.hasAttribute("data-width")&&!E.hasAttribute("data-height")){let Se=E.style.top,ue=E.style.left,tt=E.style.width,ie=E.style.height;E.style.top="",E.style.left="",E.style.width="",E.style.height="";let $=window.getComputedStyle(E);$.top!=="auto"||$.bottom!=="auto"||$.left!=="auto"||$.right!=="auto"||$.width!=="0px"||$.height!=="0px"||(E.style.top=Se,E.style.left=ue,E.style.width=tt,E.style.height=ie)}let V=window.getComputedStyle(E),we=V.position;if(we!=="absolute"&&we!=="fixed"&&(E.style.position="absolute"),!!E.style.top||!!E.style.bottom||V.top!=="auto"||V.bottom!=="auto"||(E.style.top="0"),!!E.style.left||!!E.style.right||V.left!=="auto"||V.right!=="auto"||(E.style.left="0"),_!=="audio"){let Se=p(E.getAttribute("data-width")),ue=p(E.getAttribute("data-height")),tt=V.width!=="0px"&&V.width!=="auto",ie=V.height!=="0px"&&V.height!=="auto";Se?!E.style.width&&!tt&&(E.style.width=Se):!E.style.width&&V.width==="0px"&&(E.style.width="100%"),ue?!E.style.height&&!ie&&(E.style.height=ue):!E.style.height&&V.height==="0px"&&(E.style.height="100%")}}},B=(d,g=0,x)=>He({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:x?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(d,g),W=(d,g)=>He({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:g?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(d),H=!!document.querySelector("[data-composition-src]"),X=!1;{let d=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let g of d){let x=g.getAttribute("data-composition-id");if(x&&g.children.length===0&&document.querySelector(`template#${CSS.escape(x)}-template`)){X=!0;break}}}let v=!H&&!X,Z=d=>{if(!d||typeof d.duration!="function")return null;try{let g=Number(d.duration());return Number.isFinite(g)?Math.max(0,g):null}catch{return null}},ee=d=>typeof d=="number"&&Number.isFinite(d)&&d>l,U=d=>{let g=Number(d.getAttribute("data-duration"));if(Number.isFinite(g)&&g>0)return g;let x=Number(d.getAttribute("data-playback-start")??d.getAttribute("data-media-start")??"0"),w=Number.isFinite(x)?Math.max(0,x):0;return Number.isFinite(d.duration)&&d.duration>w?Math.max(0,d.duration-w):null},G=()=>{let d=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(d.length===0)return null;let g=0;for(let x of d){let w=B(x,0);if(!Number.isFinite(w))continue;let E=U(x);E==null||E<=l||(g=Math.max(g,Math.max(0,w)+E))}return g>l?g:null},T=()=>{let d=y();if(!d)return null;let g=window.__timelines??{},x=He({timelineRegistry:g,includeAuthoredTimingAttrs:!0}),w=0,E=Array.from(d.querySelectorAll("[data-composition-id][data-start]"));for(let _ of E){if(!(_ instanceof Element)||_.parentElement?.closest("[data-composition-id]")!==d)continue;let ae=x.resolveStartForElement(_,0),V=x.resolveDurationForElement(_);!Number.isFinite(ae)||V==null||V<=0||(w=Math.max(w,Math.max(0,ae)+V))}return w>l?w:null},J=()=>{let d=G();return typeof d!="number"||!Number.isFinite(d)||d<=l?null:d},Ee=d=>ee(d)?Math.max(l,d*f):l,xe=(d,g=0)=>{let x=Z(d),w=J(),E=T(),_=Math.max(w??0,E??0),le=Number.isFinite(g)&&g>l?g:0,ae=0;ee(x)?ae=Math.max(x,_,le):ee(_)?ae=Math.max(_,le):ae=le;let V=Math.max(1,Number(n.maxTimelineDurationSeconds)||1800);return ae>0?Math.max(0,Math.min(ae,V)):0},R=()=>{let d=window.__timelines??{},g=He({timelineRegistry:d,includeAuthoredTimingAttrs:!0}),x=J(),w=T(),E=Math.max(x??0,w??0)||null,_=Ee(E),le=ie=>{let $=document.querySelector(`[data-composition-id="${CSS.escape(ie)}"]`);return $?g.resolveStartForElement($,0):0},ae=ie=>{let $=window.gsap;if(!$||typeof $.timeline!="function")return null;let oe=$.timeline({paused:!0});for(let pe of ie)oe.add(pe.timeline,le(pe.compositionId));return oe},V=(ie,$)=>{if(!ee(ie))return null;let oe=window.gsap;if(!oe||typeof oe.timeline!="function")return null;let pe=oe.timeline({paused:!0});if($)try{pe.add($,0)}catch{}let he=pe;if(typeof he.to=="function")try{he.to({},{duration:ie})}catch{}return pe},we=(ie,$)=>{let oe=ie;if(typeof oe.getChildren!="function")return[];try{let pe=oe.getChildren(!0,!0,!0)??[];if(!Array.isArray(pe))return[];let he=[];for(let se of $)if(!pe.some(Ie=>Ie===se.timeline))try{let Ie=le(se.compositionId);ie.add(se.timeline,Ie),he.push(se.compositionId)}catch{}return he}catch{return[]}},Re=y(),de=Re?.getAttribute("data-composition-id")??null;if(!de)return{timeline:null};let me=d[de]??null,ue=(()=>{if(!Re)return[];let ie=new Set,$=Array.from(Re.querySelectorAll("[data-composition-id]")),oe=[];for(let pe of $){let he=pe.getAttribute("data-composition-id");if(!he||he===de||ie.has(he))continue;ie.add(he);let se=d[he]??null;if(!se||typeof se.play!="function"||typeof se.pause!="function")continue;let Ae=Z(se);oe.push({compositionId:he,timeline:se,durationSeconds:Ae??0})}return oe})(),tt=ie=>{for(let $ of ie){let oe=$.timeline;if(typeof oe.paused=="function")try{oe.paused(!1)}catch{}}};if(ue.length>0&&tt(ue),me){let ie=ue.length>0?we(me,ue):[];if((ue.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id=\'"+de+"\'])"))&&(L=!0),ie.length>0)try{let se=me.time();me.seek(se,!1)}catch{}let $=Z(me);if(!ee($)&&ue.length>0){let se=ue.map(No=>No.compositionId),Ae=ae(ue),Ie=Z(Ae);if(Ae&&ee(Ie))return{timeline:Ae,selectedTimelineIds:se,selectedDurationSeconds:Ie,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:de,rootDurationSeconds:$,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:_,selectedDurationSeconds:Ie,mediaDurationFloorSeconds:x,authoredCompositionDurationFloorSeconds:w,selectedTimelineIds:se,autoNestedChildren:ie}}};let Xt=V(E??0,me),en=Z(Xt);if(Xt&&ee(en))return{timeline:Xt,selectedTimelineIds:[de],selectedDurationSeconds:en,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:de,rootDurationSeconds:$,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:x,authoredCompositionDurationFloorSeconds:w,selectedDurationSeconds:en,selectedTimelineIds:[de],autoNestedChildren:ie}}}}if(!ee($)&&ue.length===0){let se=V(E??0,me),Ae=Z(se);if(se&&ee(Ae))return{timeline:se,selectedTimelineIds:[de],selectedDurationSeconds:Ae,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:de,rootDurationSeconds:$,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:x,authoredCompositionDurationFloorSeconds:w,selectedDurationSeconds:Ae,selectedTimelineIds:[de]}}}}let oe=Re?.getAttribute("data-duration"),pe=oe?parseFloat(oe):null,he=Math.max(ee(pe)?pe:0,w??0);if(he>0&&ee(he)&&ee($)&&he>=$+.5){let se=me;if(typeof se.to=="function")try{se.to({},{duration:0},he)}catch{}let Ae=Z(me);if(ee(Ae))return{timeline:me,selectedTimelineIds:[de],selectedDurationSeconds:Ae,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:de,rootDurationSeconds:$,rootDeclaredDur:pe,authoredCompositionDurationFloorSeconds:w,newDur:Ae}}}}return{timeline:me,selectedTimelineIds:[de],selectedDurationSeconds:$,mediaDurationFloorSeconds:x,diagnostics:ie.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:de,selectedDurationSeconds:$,autoNestedChildren:ie}}:void 0}}if(ue.length>0){let ie=ue.map(pe=>pe.compositionId),$=ae(ue),oe=Z($);if($)return{timeline:$,selectedTimelineIds:ie,selectedDurationSeconds:oe,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:de,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:_,selectedDurationSeconds:oe,mediaDurationFloorSeconds:x,selectedTimelineIds:ie}}}}return{timeline:null}},k=()=>{let d=n.capturedTimeline;if(!d||typeof d.time!="function")return;let g=Number(d.time());Number.isFinite(g)&&(n.currentTime=Math.max(0,g))},L=!1,Q=()=>{if(!v)return!1;let d=n.capturedTimeline,g=Z(d),x=ee(g);if(d&&x&&L)return!1;let w=R();return w.timeline?d&&d===w.timeline?(typeof d.timeScale=="function"&&d.timeScale(n.playbackRate),!1):(n.capturedTimeline=w.timeline,typeof n.capturedTimeline.timeScale=="function"&&n.capturedTimeline.timeScale(n.playbackRate),w.diagnostics&&ge({source:"hf-preview",type:"diagnostic",code:w.diagnostics.code,details:w.diagnostics.details}),ge({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:w.selectedTimelineIds??[],selectedDurationSeconds:w.selectedDurationSeconds??null,mediaDurationFloorSeconds:w.mediaDurationFloorSeconds??null}}),!0):!1},ne=()=>{let d=y();if(!(d instanceof HTMLElement))return;let g=d.getBoundingClientRect(),x=Number(d.getAttribute("data-width")),w=Number(d.getAttribute("data-height")),E=window.getComputedStyle(d),_=Number.isFinite(x)&&x>0&&Number.isFinite(w)&&w>0,le=g.width<=0||g.height<=0||d.clientWidth<=0||d.clientHeight<=0;!_||!le||u("root_stage_layout_zero",{compositionId:d.getAttribute("data-composition-id")??null,declaredWidth:x,declaredHeight:w,rectWidth:Math.round(g.width),rectHeight:Math.round(g.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"}`)},P=()=>{n.tornDown||(s!=null&&window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{s=null,ne()}))},I=()=>{t=d=>{let g=Y(d.error??d.message).slice(0,D);if(!g)return;let x=S(g);ge({source:"hf-preview",type:"diagnostic",code:x.code,details:{category:x.category,message:g,filename:d.filename||null,line:Number.isFinite(d.lineno)?d.lineno:null,column:Number.isFinite(d.colno)?d.colno:null}})},i=d=>{let g=Y(d.reason).slice(0,D);if(!g)return;let x=S(g);ge({source:"hf-preview",type:"diagnostic",code:`${x.code}_unhandled_rejection`,details:{category:`${x.category}-unhandled-rejection`,message:g}})},window.addEventListener("error",t),window.addEventListener("unhandledrejection",i)},j=()=>{let d=Array.from(document.querySelectorAll("img, video, audio, source, link[rel=\'stylesheet\']"));for(let x of d){let w=()=>{if(!(x instanceof Element))return;let E=x.tagName.toLowerCase(),_=x.getAttribute("src")??x.getAttribute("href")??x.getAttribute("poster")??null,le=E==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";u(le,{tagName:E,assetUrl:_,currentSrc:(x instanceof HTMLImageElement||x instanceof HTMLMediaElement)&&x.currentSrc||null,readyState:x instanceof HTMLMediaElement?x.readyState:null,networkState:x instanceof HTMLMediaElement?x.networkState:null},`${le}:${E}:${_??"unknown"}`)};x.addEventListener("error",w),c(()=>{x.removeEventListener("error",w)})}let g=document.fonts;g&&g.ready.then(()=>{if(n.tornDown)return;let x=Array.from(g).filter(w=>w.status==="error").map(w=>w.family).filter(w=>!!w).slice(0,10);x.length!==0&&u("runtime_font_load_issue",{failedFamilies:x,totalFaces:Array.from(g).length},`runtime-font-load-issue:${x.join("|")}`)}).catch(()=>{})},Ne=(d,g)=>{if(!d.timeline)return!1;let x=n.capturedTimeline;if(x&&x===d.timeline)return!1;let w=Math.max(0,n.currentTime||0),E=n.isPlaying;n.capturedTimeline=d.timeline,typeof n.capturedTimeline.timeScale=="function"&&n.capturedTimeline.timeScale(n.playbackRate);try{n.capturedTimeline.pause(),n.capturedTimeline.seek(w,!1),E&&n.capturedTimeline.play()}catch{}return ge({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:g,previousTime:w,selectedTimelineIds:d.selectedTimelineIds??[],selectedDurationSeconds:d.selectedDurationSeconds??null,mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),!0},ce=null,ze=!1,Fe=new Set,wt=()=>{n.tornDown||(ce!=null&&window.clearTimeout(ce),ce=window.setTimeout(()=>{if(n.tornDown)return;ce=null;let d=R();if(!d.timeline||!ee(d.mediaDurationFloorSeconds??null))return;if(!n.capturedTimeline){Q()&&(je(),ve(!0));return}if(ze)return;let x=Z(n.capturedTimeline),w=d.selectedDurationSeconds??Z(d.timeline);ee(w)&&(!ee(x)||w>=x+z)&&Ne(d,"manual")&&(ze=!0,ge({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:x??null,selectedDurationSeconds:w??null,selectedTimelineIds:d.selectedTimelineIds??[],mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),je(),ve(!0))},O))},Eo=()=>{for(let d of Fe)d.removeEventListener("loadedmetadata",wt),d.removeEventListener("durationchange",wt);Fe.clear()},Jt=()=>{if(n.tornDown)return;let d=Array.from(document.querySelectorAll("video, audio"));for(let g of d)Fe.has(g)||(Fe.add(g),g.addEventListener("loadedmetadata",wt),g.addEventListener("durationchange",wt),g.preload!=="auto"&&(g.preload="auto"),g.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&g.load())},Gn=()=>{let d=E=>{let _=E.closest("[data-composition-id]"),le=_?B(_,0):null,ae=_?W(_,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:_,inheritedStart:le,inheritedDuration:ae}},g=si({shouldIncludeElement:E=>E.hasAttribute("data-start")||!!d(E).compositionRoot,resolveStartSeconds:E=>{let _=d(E);return B(E,_.inheritedStart??0)},resolveDurationSeconds:E=>{let _=d(E),le=B(E,_.inheritedStart??0),ae=Number.parseFloat(E.dataset.playbackStart??E.dataset.mediaStart??"0")||0,V=_.inheritedStart!=null&&_.inheritedDuration!=null&&_.inheritedDuration>0?Math.max(0,_.inheritedStart+_.inheritedDuration-le):null,we=Number.isFinite(E.duration)&&E.duration>ae?Math.max(0,E.duration-ae):null;return we!=null&&V!=null?Math.min(we,V):we??V}});li({clips:g.mediaClips,timeSeconds:n.currentTime,playing:n.isPlaying,playbackRate:n.playbackRate,outputMuted:n.mediaOutputMuted,userMuted:n.bridgeMuted,onAutoplayBlocked:()=>{n.mediaAutoplayBlockedPosted||(n.mediaAutoplayBlockedPosted=!0,ge({source:"hf-preview",type:"media-autoplay-blocked"}))}});let x=document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null,w=Array.from(document.querySelectorAll("[data-start]"));for(let E of w){if(!(E instanceof HTMLElement))continue;let _=E.tagName.toLowerCase();if(_==="script"||_==="style"||_==="link"||_==="meta")continue;if(!E.getAttribute("data-composition-id")){let Se=E.closest("[data-composition-id]")?.getAttribute("data-composition-id")??null;if(Se&&Se!==x)continue}let ae=B(E,0),V=W(E),we=E.getAttribute("data-composition-id");if(we){let me=(window.__timelines??{})[we],Se=null;if(me&&typeof me.duration=="function"){let ue=Number(me.duration());Number.isFinite(ue)&&ue>0&&(Se=ue)}V!=null&&V>0&&Se!=null?V=Math.min(V,Se):(V==null||V<=0)&&Se!=null&&(V=Se)}let Re=V!=null&&V>0?ae+V:Number.POSITIVE_INFINITY,de=n.currentTime>=ae&&(Number.isFinite(Re)?n.currentTime<Re:!0);E.style.visibility=de?"visible":"hidden"}},ve=d=>{k();let g=Math.max(0,Math.round((n.currentTime||0)*n.canonicalFps)),x=Date.now();(d||g!==n.bridgeLastPostedFrame||n.isPlaying!==n.bridgeLastPostedPlaying||n.bridgeMuted!==n.bridgeLastPostedMuted||x-n.bridgeLastPostedAt>=n.bridgeMaxPostIntervalMs)&&(n.bridgeLastPostedFrame=g,n.bridgeLastPostedPlaying=n.isPlaying,n.bridgeLastPostedMuted=n.bridgeMuted,n.bridgeLastPostedAt=x,ge({source:"hf-preview",type:"state",frame:g,isPlaying:n.isPlaying,muted:n.bridgeMuted,playbackRate:n.playbackRate}))},je=()=>{b(),F(),N();let d=y();if(d){let x=p(d.getAttribute("data-width")),w=p(d.getAttribute("data-height")),E=x?parseInt(x,10):0,_=w?parseInt(w,10):0;E>0&&_>0&&ge({source:"hf-preview",type:"stage-size",width:E,height:_})}Q();let g=pi({canonicalFps:n.canonicalFps,maxTimelineDurationSeconds:n.maxTimelineDurationSeconds});window.__clipManifest=g,ge(g),P()},et=(d,g=0)=>{for(let x of n.deterministicAdapters){try{d==="discover"&&x.discover(),d==="pause"&&x.pause(),d==="play"&&x.play&&x.play()}catch{}if(d==="discover")try{x.seek({time:g})}catch{}}};if(v)On();else{let d={injectedStyles:n.injectedCompStyles,injectedScripts:n.injectedCompScripts,parseDimensionPx:p,onDiagnostic:({code:g,details:x})=>{ge({source:"hf-preview",type:"diagnostic",code:g,details:x})}};jr(d).then(()=>zr(d)).finally(()=>{v=!0,et("discover",n.currentTime),Jt(),j(),On(),je(),ve(!0)})}let Ct=ai({postMessage:d=>ge(d)});Ct.installPickerApi();let $n=d=>{let g=Number(d);!Number.isFinite(g)||g<=0?n.playbackRate=1:n.playbackRate=Math.max(.1,Math.min(5,g)),n.capturedTimeline&&typeof n.capturedTimeline.timeScale=="function"&&n.capturedTimeline.timeScale(n.playbackRate);let x=document.querySelectorAll("video, audio");for(let w of x)if(w instanceof HTMLMediaElement)try{w.playbackRate=n.playbackRate}catch{}},fe=ci({getTimeline:()=>n.capturedTimeline,setTimeline:d=>{n.capturedTimeline=d},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>n.isPlaying,setIsPlaying:d=>{n.isPlaying=d},getPlaybackRate:()=>n.playbackRate,setPlaybackRate:$n,getCanonicalFps:()=>n.canonicalFps,onSyncMedia:(d,g)=>{n.currentTime=Math.max(0,Number(d)||0),n.isPlaying=g,Gn()},onStatePost:ve,onDeterministicSeek:d=>{for(let g of n.deterministicAdapters)try{g.seek({time:Number(d)||0})}catch{}},onDeterministicPause:()=>et("pause"),onDeterministicPlay:()=>et("play"),onRenderFrameSeek:()=>{},onShowNativeVideos:()=>{},getSafeDuration:()=>xe(n.capturedTimeline,0)});window.__player=a(fe),window.__playerReady=!0,window.__renderReady=!0,Yn(ge),nt("composition_loaded",{duration:fe.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),n.controlBridgeHandler=Qn({onPlay:()=>{fe.play(),nt("composition_played",{time:fe.getTime()})},onPause:()=>{fe.pause(),nt("composition_paused",{time:fe.getTime()})},onSeek:(d,g)=>{let x=Math.max(0,d)/n.canonicalFps;fe.seek(x),nt("composition_seeked",{time:x})},onSetMuted:d=>{n.bridgeMuted=d;let g=d||n.mediaOutputMuted,x=document.querySelectorAll("video, audio");for(let w of x)w instanceof HTMLMediaElement&&(w.muted=g)},onSetMediaOutputMuted:d=>{n.mediaOutputMuted=d;let g=d||n.bridgeMuted,x=document.querySelectorAll("video, audio");for(let w of x)w instanceof HTMLMediaElement&&(w.muted=g)},onSetPlaybackRate:d=>$n(d),onEnablePickMode:()=>Ct.enablePickMode(),onDisablePickMode:()=>Ct.disablePickMode()}),Q(),n.capturedTimeline&&(fe._timeline=n.capturedTimeline),v&&setTimeout(()=>{let d=n.capturedTimeline;Q()&&n.capturedTimeline!==d&&(fe._timeline=n.capturedTimeline),et("discover",n.currentTime),je(),ve(!0)},0),n.deterministicAdapters=[oi(),Zn({resolveStartSeconds:d=>B(d,0)}),ei(),ii(),ri(),Xn({getTimeline:()=>n.capturedTimeline})],I(),et("discover"),Jt(),n.timelinePollIntervalId&&clearInterval(n.timelinePollIntervalId);let Qt=0,Mt=null,Vn=0,Yt=!1,Ge=0,Kn=()=>{Vn=Date.now(),Yt=!1,Ge=0};n.timelinePollIntervalId=setInterval(()=>{Qt+=1;let g=n.isPlaying&&n.capturedTimeline!=null&&Math.max(0,n.currentTime||0)<A?!1:Q();if(n.capturedTimeline&&!fe._timeline&&(fe._timeline=n.capturedTimeline),(g||Qt%20===0)&&je(),Qt%10===0&&Jt(),k(),n.isPlaying&&n.capturedTimeline){let x=Math.max(0,n.currentTime||0),w=Mt,E=xe(n.capturedTimeline,0);if(E>0&&x>=E){fe.pause(),fe.seek(E),Mt=E,Ge=0,ve(!0);return}if(w!=null&&w>=m&&x<=h?Ge+=1:Ge=0,!Yt&&Ge>=C&&Date.now()-Vn>M){let le=R();Ne(le,"loop_guard")&&(Yt=!0,Ge=0)}Mt=Math.max(0,n.currentTime||0)}else Mt=Math.max(0,n.currentTime||0);n.isPlaying&&Gn(),ve(!1)},50),je(),ve(!0);let Fo=fe.seek;fe.seek=d=>{Kn(),Fo(d)};let bo=fe.renderSeek;fe.renderSeek=d=>{Kn(),bo(d)};let Zt=()=>{if(!n.tornDown){n.tornDown=!0,n.timelinePollIntervalId&&(clearInterval(n.timelinePollIntervalId),n.timelinePollIntervalId=null),ce!=null&&(window.clearTimeout(ce),ce=null),s!=null&&(window.cancelAnimationFrame(s),s=null),Eo(),n.controlBridgeHandler&&(window.removeEventListener("message",n.controlBridgeHandler),n.controlBridgeHandler=null),t&&(window.removeEventListener("error",t),t=null),i&&(window.removeEventListener("unhandledrejection",i),i=null),n.beforeUnloadHandler&&(window.removeEventListener("beforeunload",n.beforeUnloadHandler),n.beforeUnloadHandler=null),Ct.disablePickMode();for(let d of n.deterministicAdapters)if(!(!d||typeof d.revert!="function"))try{d.revert()}catch{}n.deterministicAdapters=[];for(let d of r.splice(0))try{d()}catch{}for(let d of n.injectedCompStyles)try{d.remove()}catch{}n.injectedCompStyles=[];for(let d of n.injectedCompScripts)try{d.remove()}catch{}n.injectedCompScripts=[],n.capturedTimeline=null,e.__hfRuntimeTeardown===Zt&&(e.__hfRuntimeTeardown=null)}};e.__hfRuntimeTeardown=Zt,n.beforeUnloadHandler=Zt,window.addEventListener("beforeunload",n.beforeUnloadHandler)}var Kr=["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"],Pn=[[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 El(n){if(n<=255)return Kr[n];let e=0,t=Pn.length-1;for(;e<=t;){let i=e+t>>1,r=Pn[i];if(n<r[0]){t=i-1;continue}if(n>r[1]){e=i+1;continue}return r[2]}return"L"}function Fl(n){let e=n.length;if(e===0)return null;let t=new Array(e),i=!1;for(let a=0;a<e;){let l=n.charCodeAt(a),f=l,m=1;if(l>=55296&&l<=56319&&a+1<e){let M=n.charCodeAt(a+1);M>=56320&&M<=57343&&(f=(l-55296<<10)+(M-56320)+65536,m=2)}let h=El(f);(h==="R"||h==="AL"||h==="AN")&&(i=!0);for(let M=0;M<m;M++)t[a+M]=h;a+=m}if(!i)return null;let r=0;for(let a=0;a<e;a++){let l=t[a];if(l==="L"){r=0;break}if(l==="R"||l==="AL"){r=1;break}}let o=new Int8Array(e);for(let a=0;a<e;a++)o[a]=r;let s=r&1?"R":"L",c=s,u=c;for(let a=0;a<e;a++)t[a]==="NSM"?t[a]=u:u=t[a];u=c;for(let a=0;a<e;a++){let l=t[a];l==="EN"?t[a]=u==="AL"?"AN":"EN":(l==="R"||l==="L"||l==="AL")&&(u=l)}for(let a=0;a<e;a++)t[a]==="AL"&&(t[a]="R");for(let a=1;a<e-1;a++)t[a]==="ES"&&t[a-1]==="EN"&&t[a+1]==="EN"&&(t[a]="EN"),t[a]==="CS"&&(t[a-1]==="EN"||t[a-1]==="AN")&&t[a+1]===t[a-1]&&(t[a]=t[a-1]);for(let a=0;a<e;a++){if(t[a]!=="EN")continue;let l;for(l=a-1;l>=0&&t[l]==="ET";l--)t[l]="EN";for(l=a+1;l<e&&t[l]==="ET";l++)t[l]="EN"}for(let a=0;a<e;a++){let l=t[a];(l==="WS"||l==="ES"||l==="ET"||l==="CS")&&(t[a]="ON")}u=c;for(let a=0;a<e;a++){let l=t[a];l==="EN"?t[a]=u==="L"?"L":"EN":(l==="R"||l==="L")&&(u=l)}for(let a=0;a<e;a++){if(t[a]!=="ON")continue;let l=a+1;for(;l<e&&t[l]==="ON";)l++;let f=a>0?t[a-1]:c,m=l<e?t[l]:c,h=f!=="L"?"R":"L";if(h===(m!=="L"?"R":"L"))for(let C=a;C<l;C++)t[C]=h;a=l-1}for(let a=0;a<e;a++)t[a]==="ON"&&(t[a]=s);for(let a=0;a<e;a++){let l=t[a];(o[a]&1)===0?l==="R"?o[a]++:(l==="AN"||l==="EN")&&(o[a]+=2):(l==="L"||l==="AN"||l==="EN")&&o[a]++}return o}function Jr(n,e){let t=Fl(n);if(t===null)return null;let i=new Int8Array(e.length);for(let r=0;r<e.length;r++)i[r]=t[e[r]];return i}var bl=/[ \\t\\n\\r\\f]+/g,Nl=/[\\t\\n\\r\\f]| {2,}|^ | $/;function wl(n){let e=n??"normal";return e==="pre-wrap"?{mode:e,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:e,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Cl(n){if(!Nl.test(n))return n;let e=n.replace(bl," ");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 Ml(n){return/[\\r\\f]/.test(n)?n.replace(/\\r\\n/g,`\n`).replace(/[\\r\\f]/g,`\n`):n.replace(/\\r\\n/g,`\n`)}var In=null,kl;function Dl(){return In===null&&(In=new Intl.Segmenter(kl,{granularity:"word"})),In}var Ll=/\\p{Script=Arabic}/u,jt=/\\p{M}/u,io=/\\p{Nd}/u;function Qr(n){return Ll.test(n)}function Yr(n){return n>=19968&&n<=40959||n>=13312&&n<=19903||n>=131072&&n<=173791||n>=173824&&n<=177983||n>=177984&&n<=178207||n>=178208&&n<=183983||n>=183984&&n<=191471||n>=191472&&n<=192093||n>=194560&&n<=195103||n>=196608&&n<=201551||n>=201552&&n<=205743||n>=205744&&n<=210041||n>=63744&&n<=64255||n>=12288&&n<=12351||n>=12352&&n<=12447||n>=12448&&n<=12543||n>=44032&&n<=55215||n>=65280&&n<=65519}function Me(n){for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);if(!(t<12288)){if(t>=55296&&t<=56319&&e+1<n.length){let i=n.charCodeAt(e+1);if(i>=56320&&i<=57343){let r=(t-55296<<10)+(i-56320)+65536;if(Yr(r))return!0;e++;continue}}if(Yr(t))return!0}}return!1}function vl(n){let e=Vt(n);return e!==null&&($t.has(e)||Oe.has(e))}var Rl=new Set(["\\xA0","\\u202F","\\u2060","\\uFEFF"]);function Tl(n){return Me(n)}function Bl(n){let e=Vt(n);return e!==null&&Rl.has(e)}function Gt(n){return!vl(n)&&!Bl(n)}var $t=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"]),Nt=new Set([\'"\',"(","[","{","\\u201C","\\u2018","\\xAB","\\u2039","\\uFF08","\\u3014","\\u3008","\\u300A","\\u300C","\\u300E","\\u3010","\\u3016","\\u3018","\\u301A"]),Hn=new Set(["\'","\\u2019"]),Oe=new Set([".",",","!","?",":",";","\\u060C","\\u061B","\\u061F","\\u0964","\\u0965","\\u104A","\\u104B","\\u104C","\\u104D","\\u104F",")","]","}","%",\'"\',"\\u201D","\\u2019","\\xBB","\\u203A","\\u2026"]),_l=new Set([":",".","\\u060C","\\u061B"]),Ol=new Set(["\\u104F"]),Pl=new Set(["\\u201D","\\u2019","\\xBB","\\u203A","\\u300D","\\u300F","\\u3011","\\u300B","\\u3009","\\u3015","\\uFF09"]);function Il(n){if(Un(n))return!0;let e=!1;for(let t of n){if(Oe.has(t)){e=!0;continue}if(!(e&&jt.test(t)))return!1}return e}function Wl(n){for(let e of n)if(!$t.has(e)&&!Oe.has(e))return!1;return n.length>0}function Hl(n){if(Un(n))return!0;for(let e of n)if(!Nt.has(e)&&!Hn.has(e)&&!jt.test(e))return!1;return n.length>0}function Un(n){let e=!1;for(let t of n)if(!(t==="\\\\"||jt.test(t))){if(Nt.has(t)||Oe.has(t)||Hn.has(t)){e=!0;continue}return!1}return e}function ro(n,e){let t=e-1;if(t<=0)return Math.max(t,0);let i=n.charCodeAt(t);if(i<56320||i>57343)return t;let r=t-1;if(r<0)return t;let o=n.charCodeAt(r);return o>=55296&&o<=56319?r:t}function Vt(n){if(n.length===0)return null;let e=ro(n,n.length);return n.slice(e)}function Ul(n){let e=Array.from(n),t=e.length;for(;t>0;){let i=e[t-1];if(jt.test(i)){t--;continue}if(Nt.has(i)||Hn.has(i)){t--;continue}break}return t<=0||t===e.length?null:{head:e.slice(0,t).join(""),tail:e.slice(t).join("")}}function ql(n,e,t){return t==="text"&&!e&&n.length===1&&n!=="-"&&n!=="\\u2014"?n:null}function Zr(n,e,t,i){let r=e[i],o=n[i];if(r==null)return o;let s=t[i];if(o.length===s)return o;let c=r.repeat(s);return n[i]=c,c}function Xr(n,e){return n&&e!==null&&_l.has(e)}function zl(n){let e=Vt(n);return e!==null&&Ol.has(e)}function jl(n){if(n.length<2||n[0]!==" ")return null;let e=n.slice(1);return/^\\p{M}+$/u.test(e)?{space:" ",marks:e}:null}function Kt(n){let e=n.length;for(;e>0;){let t=ro(n,e),i=n.slice(t,e);if(Pl.has(i))return!0;if(!Oe.has(i))return!1;e=t}return!1}function Gl(n,e){if(e.preserveOrdinarySpaces||e.preserveHardBreaks){if(n===" ")return"preserved-space";if(n===" ")return"tab";if(e.preserveHardBreaks&&n===`\n`)return"hard-break"}return n===" "?"space":n==="\\xA0"||n==="\\u202F"||n==="\\u2060"||n==="\\uFEFF"?"glue":n==="\\u200B"?"zero-width-break":n==="\\xAD"?"soft-hyphen":"text"}var $l=/[\\x20\\t\\n\\xA0\\xAD\\u200B\\u202F\\u2060\\uFEFF]/;function be(n){return n.length===1?n[0]:n.join("")}function Vl(n,e){let t=[];for(let i=n.length-1;i>=0;i--)t.push(n[i]);return t.push(e),be(t)}function Kl(n,e,t,i){if(!$l.test(n))return[{text:n,isWordLike:e,kind:"text",start:t}];let r=[],o=null,s=[],c=t,u=!1,a=0;for(let l of n){let f=Gl(l,i),m=f==="text"&&e;if(o!==null&&f===o&&m===u){s.push(l),a+=l.length;continue}o!==null&&r.push({text:be(s),isWordLike:u,kind:o,start:c}),o=f,s=[l],c=t+a,u=m,a+=l.length}return o!==null&&r.push({text:be(s),isWordLike:u,kind:o,start:c}),r}function Wn(n){return n==="space"||n==="preserved-space"||n==="zero-width-break"||n==="hard-break"}var Jl=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Ql(n,e){let t=n.texts[e];return t.startsWith("www.")?!0:Jl.test(t)&&e+1<n.len&&n.kinds[e+1]==="text"&&n.texts[e+1]==="//"}function Yl(n){return n.includes("?")&&(n.includes("://")||n.startsWith("www."))}function Zl(n){let e=n.texts.slice(),t=n.isWordLike.slice(),i=n.kinds.slice(),r=n.starts.slice();for(let s=0;s<n.len;s++){if(i[s]!=="text"||!Ql(n,s))continue;let c=[e[s]],u=s+1;for(;u<n.len&&!Wn(i[u]);){c.push(e[u]),t[s]=!0;let a=e[u].includes("?");if(i[u]="text",e[u]="",u++,a)break}e[s]=be(c)}let o=0;for(let s=0;s<e.length;s++){let c=e[s];c.length!==0&&(o!==s&&(e[o]=c,t[o]=t[s],i[o]=i[s],r[o]=r[s]),o++)}return e.length=o,t.length=o,i.length=o,r.length=o,{len:o,texts:e,isWordLike:t,kinds:i,starts:r}}function Xl(n){let e=[],t=[],i=[],r=[];for(let o=0;o<n.len;o++){let s=n.texts[o];if(e.push(s),t.push(n.isWordLike[o]),i.push(n.kinds[o]),r.push(n.starts[o]),!Yl(s))continue;let c=o+1;if(c>=n.len||Wn(n.kinds[c]))continue;let u=[],a=n.starts[c],l=c;for(;l<n.len&&!Wn(n.kinds[l]);)u.push(n.texts[l]),l++;u.length>0&&(e.push(be(u)),t.push(!0),i.push("text"),r.push(a),o=l-1)}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}var ea=new Set([":","-","/","\\xD7",",",".","+","\\u2013","\\u2014"]),eo=/^[A-Za-z0-9_]+[,:;]*$/,to=/[,:;]+$/;function oo(n){for(let e of n)if(io.test(e))return!0;return!1}function bt(n){if(n.length===0)return!1;for(let e of n)if(!(io.test(e)||ea.has(e)))return!1;return!0}function ta(n){let e=[],t=[],i=[],r=[];for(let o=0;o<n.len;o++){let s=n.texts[o],c=n.kinds[o];if(c==="text"&&bt(s)&&oo(s)){let u=[s],a=o+1;for(;a<n.len&&n.kinds[a]==="text"&&bt(n.texts[a]);)u.push(n.texts[a]),a++;e.push(be(u)),t.push(!0),i.push("text"),r.push(n.starts[o]),o=a-1;continue}e.push(s),t.push(n.isWordLike[o]),i.push(c),r.push(n.starts[o])}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function na(n){let e=[],t=[],i=[],r=[];for(let o=0;o<n.len;o++){let s=n.texts[o],c=n.kinds[o],u=n.isWordLike[o];if(c==="text"&&u&&eo.test(s)){let a=[s],l=to.test(s),f=o+1;for(;l&&f<n.len&&n.kinds[f]==="text"&&n.isWordLike[f]&&eo.test(n.texts[f]);){let m=n.texts[f];a.push(m),l=to.test(m),f++}e.push(be(a)),t.push(!0),i.push("text"),r.push(n.starts[o]),o=f-1;continue}e.push(s),t.push(u),i.push(c),r.push(n.starts[o])}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function ia(n){let e=[],t=[],i=[],r=[];for(let o=0;o<n.len;o++){let s=n.texts[o];if(n.kinds[o]==="text"&&s.includes("-")){let c=s.split("-"),u=c.length>1;for(let a=0;a<c.length;a++){let l=c[a];if(!u)break;(l.length===0||!oo(l)||!bt(l))&&(u=!1)}if(u){let a=0;for(let l=0;l<c.length;l++){let f=c[l],m=l<c.length-1?`${f}-`:f;e.push(m),t.push(!0),i.push("text"),r.push(n.starts[o]+a),a+=m.length}continue}}e.push(s),t.push(n.isWordLike[o]),i.push(n.kinds[o]),r.push(n.starts[o])}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function ra(n){let e=[],t=[],i=[],r=[],o=0;for(;o<n.len;){let s=[n.texts[o]],c=n.isWordLike[o],u=n.kinds[o],a=n.starts[o];if(u==="glue"){let l=[s[0]],f=a;for(o++;o<n.len&&n.kinds[o]==="glue";)l.push(n.texts[o]),o++;let m=be(l);if(o<n.len&&n.kinds[o]==="text")s[0]=m,s.push(n.texts[o]),c=n.isWordLike[o],u="text",a=f,o++;else{e.push(m),t.push(!1),i.push("glue"),r.push(f);continue}}else o++;if(u==="text")for(;o<n.len&&n.kinds[o]==="glue";){let l=[];for(;o<n.len&&n.kinds[o]==="glue";)l.push(n.texts[o]),o++;let f=be(l);if(o<n.len&&n.kinds[o]==="text"){s.push(f,n.texts[o]),c=c||n.isWordLike[o],o++;continue}s.push(f)}e.push(be(s)),t.push(c),i.push(u),r.push(a)}return{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function oa(n){let e=n.texts.slice(),t=n.isWordLike.slice(),i=n.kinds.slice(),r=n.starts.slice();for(let o=0;o<e.length-1;o++){if(i[o]!=="text"||i[o+1]!=="text"||!Me(e[o])||!Me(e[o+1]))continue;let s=Ul(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:t,kinds:i,starts:r}}function no(n,e,t){let i=Dl(),r=0,o=[],s=[],c=[],u=[],a=[],l=[],f=[],m=[],h=[],M=[],C=[],A=[];for(let p of i.segment(n))for(let y of Kl(p.segment,p.isWordLike??!1,p.index,t)){let Z=function(){l[v]!==null&&(s[v]=[Zr(o,l,f,v)],l[v]=null),s[v].push(y.text),c[v]=c[v]||y.isWordLike,m[v]=m[v]||N,h[v]=h[v]||B,M[v]=H,C[v]=X,A[v]=Xr(h[v],W)},F=y.kind==="text",b=ql(y.text,y.isWordLike,y.kind),N=Me(y.text),B=Qr(y.text),W=Vt(y.text),H=Kt(y.text),X=zl(y.text),v=r-1;e.carryCJKAfterClosingQuote&&F&&r>0&&u[v]==="text"&&N&&m[v]&&M[v]||F&&r>0&&u[v]==="text"&&Wl(y.text)&&m[v]||F&&r>0&&u[v]==="text"&&C[v]?Z():F&&r>0&&u[v]==="text"&&y.isWordLike&&B&&A[v]?(Z(),c[v]=!0):b!==null&&r>0&&u[v]==="text"&&l[v]===b?f[v]=(f[v]??1)+1:F&&!y.isWordLike&&r>0&&u[v]==="text"&&(Il(y.text)||y.text==="-"&&c[v])?Z():(o[r]=y.text,s[r]=[y.text],c[r]=y.isWordLike,u[r]=y.kind,a[r]=y.start,l[r]=b,f[r]=b===null?0:1,m[r]=N,h[r]=B,M[r]=H,C[r]=X,A[r]=Xr(B,W),r++)}for(let p=0;p<r;p++){if(l[p]!==null){o[p]=Zr(o,l,f,p);continue}o[p]=be(s[p])}for(let p=1;p<r;p++)u[p]==="text"&&!c[p]&&Un(o[p])&&u[p-1]==="text"&&(o[p-1]+=o[p],c[p-1]=c[p-1]||c[p],o[p]="");let z=Array.from({length:r},()=>null),O=-1;for(let p=r-1;p>=0;p--){let y=o[p];if(y.length!==0){if(u[p]==="text"&&!c[p]&&Hl(y)&&O>=0&&u[O]==="text"){let F=z[O]??[];F.push(y),z[O]=F,a[O]=a[p],o[p]="";continue}O=p}}for(let p=0;p<r;p++){let y=z[p];y!=null&&(o[p]=Vl(y,o[p]))}let D=0;for(let p=0;p<r;p++){let y=o[p];y.length!==0&&(D!==p&&(o[D]=y,c[D]=c[p],u[D]=u[p],a[D]=a[p]),D++)}o.length=D,c.length=D,u.length=D,a.length=D;let Y=ra({len:D,texts:o,isWordLike:c,kinds:u,starts:a}),S=oa(na(ia(ta(Xl(Zl(Y))))));for(let p=0;p<S.len-1;p++){let y=jl(S.texts[p]);y!==null&&(S.kinds[p]!=="space"&&S.kinds[p]!=="preserved-space"||S.kinds[p+1]!=="text"||!Qr(S.texts[p+1])||(S.texts[p]=y.space,S.isWordLike[p]=!1,S.kinds[p]=S.kinds[p]==="preserved-space"?"preserved-space":"space",S.texts[p+1]=y.marks+S.texts[p+1],S.starts[p+1]=S.starts[p]+y.space.length))}return S}function sa(n,e){if(n.len===0)return[];if(!e.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:n.len,consumedEndSegmentIndex:n.len}];let t=[],i=0;for(let r=0;r<n.len;r++)n.kinds[r]==="hard-break"&&(t.push({startSegmentIndex:i,endSegmentIndex:r,consumedEndSegmentIndex:r+1}),i=r+1);return i<n.len&&t.push({startSegmentIndex:i,endSegmentIndex:n.len,consumedEndSegmentIndex:n.len}),t}function la(n){if(n.len<=1)return n;let e=[],t=[],i=[],r=[],o=null,s=!1,c=0,u=!1,a=!1;function l(){o!==null&&(e.push(be(o)),t.push(s),i.push("text"),r.push(c),o=null)}for(let f=0;f<n.len;f++){let m=n.texts[f],h=n.kinds[f],M=n.isWordLike[f],C=n.starts[f];if(h==="text"){let A=Tl(m),z=Gt(m);if(o!==null&&u&&a){o.push(m),s=s||M,u=u||A,a=z;continue}l(),o=[m],s=M,c=C,u=A,a=z;continue}l(),e.push(m),t.push(M),i.push(h),r.push(C)}return l(),{len:e.length,texts:e,isWordLike:t,kinds:i,starts:r}}function so(n,e,t="normal",i="normal"){let r=wl(t),o=r.mode==="pre-wrap"?Ml(n):Cl(n);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let s=i==="keep-all"?la(no(o,e,r)):no(o,e,r);return{normalized:o,chunks:sa(s,r),...s}}var Ye=null,lo=new Map,Ze=null,aa=96,ua=/\\p{Emoji_Presentation}/u,ca=/[\\p{Emoji_Presentation}\\p{Extended_Pictographic}\\p{Regional_Indicator}\\uFE0F\\u20E3]/u,qn=null,ao=new Map;function zn(){if(Ye!==null)return Ye;if(typeof OffscreenCanvas<"u")return Ye=new OffscreenCanvas(1,1).getContext("2d"),Ye;if(typeof document<"u")return Ye=document.createElement("canvas").getContext("2d"),Ye;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function da(n){let e=lo.get(n);return e||(e=new Map,lo.set(n,e)),e}function Le(n,e){let t=e.get(n);return t===void 0&&(t={width:zn().measureText(n).width,containsCJK:Me(n)},e.set(n,t)),t}function Xe(){if(Ze!==null)return Ze;if(typeof navigator>"u")return Ze={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ze;let n=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&n.includes("Safari/")&&!n.includes("Chrome/")&&!n.includes("Chromium/")&&!n.includes("CriOS/")&&!n.includes("FxiOS/")&&!n.includes("EdgiOS/"),i=n.includes("Chrome/")||n.includes("Chromium/")||n.includes("CriOS/")||n.includes("Edg/");return Ze={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:i,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Ze}function fa(n){let e=n.match(/(\\d+(?:\\.\\d+)?)\\s*px/);return e?parseFloat(e[1]):16}function uo(){return qn===null&&(qn=new Intl.Segmenter(void 0,{granularity:"grapheme"})),qn}function ma(n){return ua.test(n)||n.includes("\\uFE0F")}function co(n){return ca.test(n)}function pa(n,e){let t=ao.get(n);if(t!==void 0)return t;let i=zn();i.font=n;let r=i.measureText("\\u{1F600}").width;if(t=0,r>e+.5&&typeof document<"u"&&document.body!==null){let o=document.createElement("span");o.style.font=n,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&&(t=r-s)}return ao.set(n,t),t}function ha(n){let e=0,t=uo();for(let i of t.segment(n))ma(i.segment)&&e++;return e}function xa(n,e){return e.emojiCount===void 0&&(e.emojiCount=ha(n)),e.emojiCount}function Pe(n,e,t){return t===0?e.width:e.width-xa(n,e)*t}function fo(n,e,t,i,r){if(e.breakableFitAdvances!==void 0)return e.breakableFitAdvances;let o=uo(),s=[];for(let l of o.segment(n))s.push(l.segment);if(s.length<=1)return e.breakableFitAdvances=null,e.breakableFitAdvances;if(r==="sum-graphemes"){let l=[];for(let f of s){let m=Le(f,t);l.push(Pe(f,m,i))}return e.breakableFitAdvances=l,e.breakableFitAdvances}if(r==="pair-context"||s.length>aa){let l=[],f=null,m=0;for(let h of s){let M=Le(h,t),C=Pe(h,M,i);if(f===null)l.push(C);else{let A=f+h,z=Le(A,t);l.push(Pe(A,z,i)-m)}f=h,m=C}return e.breakableFitAdvances=l,e.breakableFitAdvances}let c=[],u="",a=0;for(let l of s){u+=l;let f=Le(u,t),m=Pe(u,f,i);c.push(m-a),a=m}return e.breakableFitAdvances=c,e.breakableFitAdvances}function mo(n,e){let t=zn();t.font=n;let i=da(n),r=fa(n),o=e?pa(n,r):0;return{cache:i,fontSize:r,emojiCorrection:o}}function ga(n,e){for(;e<n.widths.length;){let t=n.kinds[e];if(t!=="space"&&t!=="zero-width-break"&&t!=="soft-hyphen")break;e++}return e}function ya(n,e){if(e<=0)return 0;let t=n%e;return Math.abs(t)<=1e-6?e:e-t}function Sa(n,e,t,i,r){let o=0,s=e;for(;o<n.length;){let c=s+n[o];if((o+1<n.length?c+r:c)>t+i)break;s=c,o++}return{fitCount:o,fittedWidth:s}}function po(n,e){return n.simpleLineWalkFastPath?ho(n,e):xo(n,e)}function ho(n,e,t){let{widths:i,kinds:r,breakableFitAdvances:o}=n;if(i.length===0)return 0;let c=Xe().lineFitEpsilon,u=e+c,a=0,l=0,f=!1,m=0,h=0,M=0,C=0,A=-1,z=0;function O(){A=-1,z=0}function D(b=M,N=C,B=l){a++,t?.({startSegmentIndex:m,startGraphemeIndex:h,endSegmentIndex:b,endGraphemeIndex:N,width:B}),l=0,f=!1,O()}function Y(b,N){f=!0,m=b,h=0,M=b+1,C=0,l=N}function S(b,N,B){f=!0,m=b,h=N,M=b,C=N+1,l=B}function p(b,N){if(!f){Y(b,N);return}l+=N,M=b+1,C=0}function y(b,N){let B=o[b];for(let W=N;W<B.length;W++){let H=B[W];f?l+H>u?(D(),S(b,W,H)):(l+=H,M=b,C=W+1):S(b,W,H)}f&&M===b&&C===B.length&&(M=b+1,C=0)}let F=0;for(;F<i.length&&!(!f&&(F=ga(n,F),F>=i.length));){let b=i[F],N=r[F],B=N==="space"||N==="preserved-space"||N==="tab"||N==="zero-width-break"||N==="soft-hyphen";if(!f){b>e&&o[F]!==null?y(F,0):Y(F,b),B&&(A=F+1,z=l-b),F++;continue}if(l+b>u){if(B){p(F,b),D(F+1,0,l-b),F++;continue}if(A>=0){if(M>A||M===A&&C>0){D();continue}D(A,0,z);continue}if(b>e&&o[F]!==null){D(),y(F,0),F++;continue}D();continue}p(F,b),B&&(A=F+1,z=l-b),F++}return f&&D(),a}function xo(n,e,t){if(n.simpleLineWalkFastPath)return ho(n,e,t);let{widths:i,lineEndFitAdvances:r,lineEndPaintAdvances:o,kinds:s,breakableFitAdvances:c,discretionaryHyphenWidth:u,tabStopAdvance:a,chunks:l}=n;if(i.length===0||l.length===0)return 0;let f=Xe(),m=f.lineFitEpsilon,h=e+m,M=0,C=0,A=!1,z=0,O=0,D=0,Y=0,S=-1,p=0,y=0,F=null;function b(){S=-1,p=0,y=0,F=null}function N(U=D,G=Y,T=C){M++,t?.({startSegmentIndex:z,startGraphemeIndex:O,endSegmentIndex:U,endGraphemeIndex:G,width:T}),C=0,A=!1,b()}function B(U,G){A=!0,z=U,O=0,D=U+1,Y=0,C=G}function W(U,G,T){A=!0,z=U,O=G,D=U,Y=G+1,C=T}function H(U,G){if(!A){B(U,G);return}C+=G,D=U+1,Y=0}function X(U,G,T,J){if(!G)return;let Ee=U==="tab"?0:r[T],xe=U==="tab"?J:o[T];S=T+1,p=C-J+Ee,y=C-J+xe,F=U}function v(U,G){let T=c[U];for(let J=G;J<T.length;J++){let Ee=T[J];A?C+Ee>h?(N(),W(U,J,Ee)):(C+=Ee,D=U,Y=J+1):W(U,J,Ee)}A&&D===U&&Y===T.length&&(D=U+1,Y=0)}function Z(U){if(F!=="soft-hyphen")return!1;let G=c[U];if(G==null)return!1;let{fitCount:T,fittedWidth:J}=Sa(G,C,e,m,u);return T===0?!1:(C=J,D=U,Y=T,b(),T===G.length?(D=U+1,Y=0,!0):(N(U,T,J+u),v(U,T),!0))}function ee(U){M++,t?.({startSegmentIndex:U.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:U.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),b()}for(let U=0;U<l.length;U++){let G=l[U];if(G.startSegmentIndex===G.endSegmentIndex){ee(G);continue}A=!1,C=0,z=G.startSegmentIndex,O=0,D=G.startSegmentIndex,Y=0,b();let T=G.startSegmentIndex;for(;T<G.endSegmentIndex;){let J=s[T],Ee=J==="space"||J==="preserved-space"||J==="tab"||J==="zero-width-break"||J==="soft-hyphen",xe=J==="tab"?ya(C,a):i[T];if(J==="soft-hyphen"){A&&(D=T+1,Y=0,S=T+1,p=C+u,y=C+u,F=J),T++;continue}if(!A){xe>e&&c[T]!==null?v(T,0):B(T,xe),X(J,Ee,T,xe),T++;continue}if(C+xe>h){let k=C+(J==="tab"?0:r[T]),L=C+(J==="tab"?xe:o[T]);if(F==="soft-hyphen"&&f.preferEarlySoftHyphenBreak&&p<=h){N(S,0,y);continue}if(F==="soft-hyphen"&&Z(T)){T++;continue}if(Ee&&k<=h){H(T,xe),N(T+1,0,L),T++;continue}if(S>=0&&p<=h){if(D>S||D===S&&Y>0){N();continue}let Q=S;N(Q,0,y),T=Q;continue}if(xe>e&&c[T]!==null){N(),v(T,0),T++;continue}N();continue}H(T,xe),X(J,Ee,T,xe),T++}if(A){let J=S===G.consumedEndSegmentIndex?y:C;N(G.consumedEndSegmentIndex,0,J)}}return M}var jn=null;function Aa(){return jn===null&&(jn=new Intl.Segmenter(void 0,{granularity:"grapheme"})),jn}function Ea(n){return n?{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 Fa(n,e){let t=[],i=[],r=0,o=!1,s=!1,c=!1;function u(){i.length!==0&&(t.push({text:i.length===1?i[0]:i.join(""),start:r}),i=[],o=!1,s=!1,c=!1)}function a(f,m,h){i=[f],r=m,o=h,s=Kt(f),c=Nt.has(f)}function l(f,m){i.push(f),o=o||m;let h=Kt(f);f.length===1&&Oe.has(f)?s=s||h:s=h,c=!1}for(let f of Aa().segment(n)){let m=f.segment,h=Me(m);if(i.length===0){a(m,f.index,h);continue}if(c||$t.has(m)||Oe.has(m)||e.carryCJKAfterClosingQuote&&h&&s){l(m,h);continue}if(!o&&!h){l(m,h);continue}u(),a(m,f.index,h)}return u(),t}function ba(n){if(n.length<=1)return n;let e=[],t=[n[0].text],i=n[0].start,r=Me(n[0].text),o=Gt(n[0].text);function s(){e.push({text:t.length===1?t[0]:t.join(""),start:i})}for(let c=1;c<n.length;c++){let u=n[c],a=Me(u.text),l=Gt(u.text);if(r&&o){t.push(u.text),r=r||a,o=l;continue}s(),t=[u.text],i=u.start,r=a,o=l}return s(),e}function Na(n,e,t,i){let r=Xe(),{cache:o,emojiCorrection:s}=mo(e,co(n.normalized)),c=Pe("-",Le("-",o),s),a=Pe(" ",Le(" ",o),s)*8;if(n.len===0)return Ea(t);let l=[],f=[],m=[],h=[],M=n.chunks.length<=1,C=t?[]:null,A=[],z=t?[]:null,O=Array.from({length:n.len});function D(y,F,b,N,B,W,H){B!=="text"&&B!=="space"&&B!=="zero-width-break"&&(M=!1),l.push(F),f.push(b),m.push(N),h.push(B),C?.push(W),A.push(H),z!==null&&z.push(y)}function Y(y,F,b,N,B){let W=Le(y,o),H=Pe(y,W,s),X=F==="space"||F==="preserved-space"||F==="zero-width-break"?0:H,v=F==="space"||F==="zero-width-break"?0:H;if(B&&N&&y.length>1){let Z="sum-graphemes";bt(y)?Z="pair-context":r.preferPrefixWidthsForBreakableRuns&&(Z="segment-prefixes");let ee=fo(y,W,o,s,Z);D(y,H,X,v,F,b,ee);return}D(y,H,X,v,F,b,null)}for(let y=0;y<n.len;y++){O[y]=l.length;let F=n.texts[y],b=n.isWordLike[y],N=n.kinds[y],B=n.starts[y];if(N==="soft-hyphen"){D(F,0,c,c,N,B,null);continue}if(N==="hard-break"){D(F,0,0,0,N,B,null);continue}if(N==="tab"){D(F,0,0,0,N,B,null);continue}let W=Le(F,o);if(N==="text"&&W.containsCJK){let H=Fa(F,r),X=i==="keep-all"?ba(H):H;for(let v=0;v<X.length;v++){let Z=X[v];Y(Z.text,"text",B+Z.start,b,i==="keep-all"||!Me(Z.text))}continue}Y(F,N,B,b,!0)}let S=wa(n.chunks,O,l.length),p=C===null?null:Jr(n.normalized,C);return z!==null?{widths:l,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:h,simpleLineWalkFastPath:M,segLevels:p,breakableFitAdvances:A,discretionaryHyphenWidth:c,tabStopAdvance:a,chunks:S,segments:z}:{widths:l,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:h,simpleLineWalkFastPath:M,segLevels:p,breakableFitAdvances:A,discretionaryHyphenWidth:c,tabStopAdvance:a,chunks:S}}function wa(n,e,t){let i=[];for(let r=0;r<n.length;r++){let o=n[r],s=o.startSegmentIndex<e.length?e[o.startSegmentIndex]:t,c=o.endSegmentIndex<e.length?e[o.endSegmentIndex]:t,u=o.consumedEndSegmentIndex<e.length?e[o.consumedEndSegmentIndex]:t;i.push({startSegmentIndex:s,endSegmentIndex:c,consumedEndSegmentIndex:u})}return i}function Ca(n,e,t,i){let r=i?.wordBreak??"normal",o=so(n,Xe(),i?.whiteSpace,r);return Na(o,e,t,r)}function go(n,e,t){return Ca(n,e,!1,t)}function yo(n,e,t){let i=po(n,e);return{lineCount:i,height:i*t}}var Ma={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function So(n,e){let t={...Ma,...e},i=1.2;for(let r=t.baseFontSize;r>=t.minFontSize;r-=t.step){let o=`${t.fontWeight} ${r}px ${t.fontFamily}`,s=go(n,o),{lineCount:c}=yo(s,t.maxWidth,r*i);if(c<=1)return{fontSize:r,fits:!0}}return{fontSize:t.minFontSize,fits:!1}}window.__timelines=window.__timelines||{};window.__hyperframes={fitTextFontSize:So};function Ao(){let n=window;n.__hyperframeRuntimeBootstrapped||(n.__hyperframeRuntimeBootstrapped=!0,Vr())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Ao,{once:!0}):Ao();})();\n';
6248
6305
  }
6249
6306
  });
6250
6307
 
@@ -9639,6 +9696,7 @@ var init_resolver = __esm({
9639
9696
  });
9640
9697
 
9641
9698
  // src/registry/installer.ts
9699
+ import { readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
9642
9700
  import { resolve as resolve3, relative, isAbsolute } from "path";
9643
9701
  function assertSafeTarget(destDir, target) {
9644
9702
  if (isAbsolute(target)) {
@@ -9656,6 +9714,16 @@ function assertSafeTarget(destDir, target) {
9656
9714
  throw new Error(`Unsafe target "${target}": resolves outside destDir ${destDir}.`);
9657
9715
  }
9658
9716
  }
9717
+ function isInstalledRegistryBlockComposition(item, file) {
9718
+ return item.type === "hyperframes:block" && file.type === "hyperframes:composition" && file.target.toLowerCase().endsWith(".html");
9719
+ }
9720
+ function addRegistryItemMarker(source, item) {
9721
+ if (/^\s*<!--\s*hyperframes-registry-item:[^>]*-->/i.test(source.slice(0, 512))) {
9722
+ return source;
9723
+ }
9724
+ return `<!-- hyperframes-registry-item: ${item.name} -->
9725
+ ${source}`;
9726
+ }
9659
9727
  async function installItem(item, options) {
9660
9728
  const baseUrl = options.baseUrl ?? DEFAULT_REGISTRY_URL;
9661
9729
  const destDir = resolve3(options.destDir);
@@ -9666,6 +9734,10 @@ async function installItem(item, options) {
9666
9734
  item.files.map(async (file) => {
9667
9735
  const destPath = resolve3(destDir, file.target);
9668
9736
  await fetchItemFile(item, file, destPath, baseUrl);
9737
+ if (isInstalledRegistryBlockComposition(item, file)) {
9738
+ const source = readFileSync2(destPath, "utf-8");
9739
+ writeFileSync2(destPath, addRegistryItemMarker(source, item), "utf-8");
9740
+ }
9669
9741
  return destPath;
9670
9742
  })
9671
9743
  );
@@ -9738,7 +9810,7 @@ var init_remote2 = __esm({
9738
9810
  });
9739
9811
 
9740
9812
  // src/telemetry/config.ts
9741
- import { existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
9813
+ import { existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
9742
9814
  import { join as join4 } from "path";
9743
9815
  import { homedir as homedir2 } from "os";
9744
9816
  import { randomUUID } from "crypto";
@@ -9750,7 +9822,7 @@ function readConfig() {
9750
9822
  return config;
9751
9823
  }
9752
9824
  try {
9753
- const raw = readFileSync2(CONFIG_FILE, "utf-8");
9825
+ const raw = readFileSync3(CONFIG_FILE, "utf-8");
9754
9826
  const parsed = JSON.parse(raw);
9755
9827
  const config = {
9756
9828
  telemetryEnabled: parsed.telemetryEnabled ?? DEFAULT_CONFIG.telemetryEnabled,
@@ -9773,7 +9845,7 @@ function readConfig() {
9773
9845
  function writeConfig(config) {
9774
9846
  try {
9775
9847
  mkdirSync2(CONFIG_DIR, { recursive: true, mode: 448 });
9776
- writeFileSync2(CONFIG_FILE, JSON.stringify(config, null, 2) + "\n", { mode: 384 });
9848
+ writeFileSync3(CONFIG_FILE, JSON.stringify(config, null, 2) + "\n", { mode: 384 });
9777
9849
  cachedConfig = { ...config };
9778
9850
  } catch {
9779
9851
  }
@@ -9818,7 +9890,7 @@ var init_env = __esm({
9818
9890
 
9819
9891
  // src/telemetry/system.ts
9820
9892
  import { cpus, totalmem, platform, release } from "os";
9821
- import { existsSync as existsSync4, readFileSync as readFileSync3, statfsSync } from "fs";
9893
+ import { existsSync as existsSync4, readFileSync as readFileSync4, statfsSync } from "fs";
9822
9894
  function bytesToMb(bytes) {
9823
9895
  return Math.trunc(bytes / (1024 * 1024));
9824
9896
  }
@@ -9844,7 +9916,7 @@ function detectDocker() {
9844
9916
  try {
9845
9917
  if (existsSync4("/.dockerenv")) return true;
9846
9918
  if (platform() === "linux") {
9847
- const cgroup = readFileSync3("/proc/1/cgroup", "utf-8");
9919
+ const cgroup = readFileSync4("/proc/1/cgroup", "utf-8");
9848
9920
  if (cgroup.includes("docker") || cgroup.includes("containerd")) return true;
9849
9921
  }
9850
9922
  } catch {
@@ -9869,7 +9941,7 @@ function detectWSL() {
9869
9941
  try {
9870
9942
  const osRelease = release().toLowerCase();
9871
9943
  if (osRelease.includes("microsoft") || osRelease.includes("wsl")) return true;
9872
- const procVersion = readFileSync3("/proc/version", "utf-8").toLowerCase();
9944
+ const procVersion = readFileSync4("/proc/version", "utf-8").toLowerCase();
9873
9945
  return procVersion.includes("microsoft") || procVersion.includes("wsl");
9874
9946
  } catch {
9875
9947
  return false;
@@ -10332,13 +10404,13 @@ __export(normalize_exports, {
10332
10404
  patchCaptionHtml: () => patchCaptionHtml,
10333
10405
  stripBeforeOnset: () => stripBeforeOnset
10334
10406
  });
10335
- import { readFileSync as readFileSync4, readdirSync, writeFileSync as writeFileSync3 } from "fs";
10407
+ import { readFileSync as readFileSync5, readdirSync, writeFileSync as writeFileSync4 } from "fs";
10336
10408
  import { extname, join as join6 } from "path";
10337
10409
  function detectFormat(filePath) {
10338
10410
  const ext = extname(filePath).toLowerCase();
10339
10411
  if (ext === ".srt") return "srt";
10340
10412
  if (ext === ".vtt") return "vtt";
10341
- if (ext === ".json") return detectJsonFormat(JSON.parse(readFileSync4(filePath, "utf-8")));
10413
+ if (ext === ".json") return detectJsonFormat(JSON.parse(readFileSync5(filePath, "utf-8")));
10342
10414
  throw new Error(`Unsupported transcript file extension: ${ext}. Use .json, .srt, or .vtt`);
10343
10415
  }
10344
10416
  function detectJsonFormat(raw) {
@@ -10488,7 +10560,7 @@ function round3(n) {
10488
10560
  }
10489
10561
  function loadTranscript(filePath) {
10490
10562
  const ext = extname(filePath).toLowerCase();
10491
- const content = readFileSync4(filePath, "utf-8");
10563
+ const content = readFileSync5(filePath, "utf-8");
10492
10564
  if (ext === ".srt") {
10493
10565
  const words2 = parseSrt(content).map((w, i2) => ({ ...w, id: w.id ?? `w${i2}` }));
10494
10566
  return { words: words2, format: "srt" };
@@ -10520,7 +10592,7 @@ function patchCaptionHtml(dir, words) {
10520
10592
  return;
10521
10593
  }
10522
10594
  for (const file of htmlFiles) {
10523
- let content = readFileSync4(file, "utf-8");
10595
+ let content = readFileSync5(file, "utf-8");
10524
10596
  const scriptBlocks = content.match(/<script>[\s\S]*?<\/script>/g) ?? [];
10525
10597
  let scriptMatch = null;
10526
10598
  let transcriptMatch = null;
@@ -10532,7 +10604,7 @@ function patchCaptionHtml(dir, words) {
10532
10604
  if (match) {
10533
10605
  const varName = scriptMatch ? "script" : "TRANSCRIPT";
10534
10606
  content = content.replace(match[0], `const ${varName} = ${wordsJson};`);
10535
- writeFileSync3(file, content, "utf-8");
10607
+ writeFileSync4(file, content, "utf-8");
10536
10608
  }
10537
10609
  }
10538
10610
  }
@@ -10554,7 +10626,7 @@ __export(projectConfig_exports, {
10554
10626
  readProjectConfig: () => readProjectConfig,
10555
10627
  writeProjectConfig: () => writeProjectConfig
10556
10628
  });
10557
- import { readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "fs";
10629
+ import { readFileSync as readFileSync6, writeFileSync as writeFileSync5 } from "fs";
10558
10630
  import { join as join7, resolve as resolve4 } from "path";
10559
10631
  function projectConfigPath(projectDir) {
10560
10632
  return join7(resolve4(projectDir), PROJECT_CONFIG_FILENAME);
@@ -10562,7 +10634,7 @@ function projectConfigPath(projectDir) {
10562
10634
  function readProjectConfig(projectDir) {
10563
10635
  const path2 = projectConfigPath(projectDir);
10564
10636
  try {
10565
- const parsed = JSON.parse(readFileSync5(path2, "utf-8"));
10637
+ const parsed = JSON.parse(readFileSync6(path2, "utf-8"));
10566
10638
  return normalizeConfig(parsed);
10567
10639
  } catch {
10568
10640
  return void 0;
@@ -10581,7 +10653,7 @@ function normalizeConfig(partial) {
10581
10653
  }
10582
10654
  function writeProjectConfig(projectDir, config = DEFAULT_PROJECT_CONFIG) {
10583
10655
  const path2 = projectConfigPath(projectDir);
10584
- writeFileSync4(path2, JSON.stringify(config, null, 2) + "\n", "utf-8");
10656
+ writeFileSync5(path2, JSON.stringify(config, null, 2) + "\n", "utf-8");
10585
10657
  }
10586
10658
  function loadProjectConfig(projectDir) {
10587
10659
  return readProjectConfig(projectDir) ?? DEFAULT_PROJECT_CONFIG;
@@ -10614,7 +10686,7 @@ __export(transcribe_exports, {
10614
10686
  transcribe: () => transcribe
10615
10687
  });
10616
10688
  import { execFileSync as execFileSync2 } from "child_process";
10617
- import { existsSync as existsSync6, readFileSync as readFileSync6, mkdirSync as mkdirSync4, unlinkSync as unlinkSync2 } from "fs";
10689
+ import { existsSync as existsSync6, readFileSync as readFileSync7, mkdirSync as mkdirSync4, unlinkSync as unlinkSync2 } from "fs";
10618
10690
  import { join as join8, extname as extname2 } from "path";
10619
10691
  import { tmpdir } from "os";
10620
10692
  function detectLanguage(whisperPath, modelPath, wavPath) {
@@ -10650,7 +10722,7 @@ function detectSpeechOnset(wavPath) {
10650
10722
  const SILENCE_THRESHOLD_RATIO = 0.6;
10651
10723
  const MIN_INTRO_SECONDS = 3;
10652
10724
  try {
10653
- const buf = readFileSync6(wavPath);
10725
+ const buf = readFileSync7(wavPath);
10654
10726
  const dataChunk = findWavDataChunk(buf);
10655
10727
  if (!dataChunk) return null;
10656
10728
  const pcm = new Int16Array(buf.buffer, buf.byteOffset + dataChunk.offset, dataChunk.size / 2);
@@ -10791,7 +10863,7 @@ async function transcribe(inputPath, outputDir, options) {
10791
10863
  if (!existsSync6(transcriptPath)) {
10792
10864
  throw new Error("Whisper did not produce output. Check the input file.");
10793
10865
  }
10794
- const transcript = JSON.parse(readFileSync6(transcriptPath, "utf-8"));
10866
+ const transcript = JSON.parse(readFileSync7(transcriptPath, "utf-8"));
10795
10867
  const segments = transcript.transcription ?? [];
10796
10868
  let wordCount = 0;
10797
10869
  let maxEnd = 0;
@@ -10911,15 +10983,38 @@ var init_lint = __esm({
10911
10983
  });
10912
10984
 
10913
10985
  // src/utils/lintProject.ts
10914
- import { existsSync as existsSync7, readFileSync as readFileSync7, readdirSync as readdirSync2 } from "fs";
10915
- import { join as join9, resolve as resolve5, extname as extname3 } from "path";
10986
+ import { existsSync as existsSync7, readFileSync as readFileSync8, readdirSync as readdirSync2 } from "fs";
10987
+ import { dirname as dirname4, join as join9, resolve as resolve5, extname as extname3 } from "path";
10988
+ function isLocalStylesheetHref(href) {
10989
+ return !!href && !/^(https?:|data:|blob:|\/\/)/i.test(href);
10990
+ }
10991
+ function collectExternalStyles(projectDir, html, compSrcPath) {
10992
+ const styles = [];
10993
+ const linkRe = /<link\b[^>]*>/gi;
10994
+ let match;
10995
+ while ((match = linkRe.exec(html)) !== null) {
10996
+ const tag = match[0];
10997
+ const rel = tag.match(/\brel\s*=\s*["']([^"']+)["']/i)?.[1] ?? "";
10998
+ if (!rel.split(/\s+/).some((part) => part.toLowerCase() === "stylesheet")) continue;
10999
+ const href = tag.match(/\bhref\s*=\s*["']([^"']+)["']/i)?.[1] ?? "";
11000
+ if (!isLocalStylesheetHref(href)) continue;
11001
+ const rootRelative = compSrcPath ? join9(dirname4(compSrcPath), href) : href;
11002
+ const resolved = resolve5(projectDir, rootRelative);
11003
+ if (!existsSync7(resolved)) continue;
11004
+ styles.push({ href, content: readFileSync8(resolved, "utf-8") });
11005
+ }
11006
+ return styles;
11007
+ }
10916
11008
  function lintProject(project) {
10917
11009
  const results = [];
10918
11010
  let totalErrors = 0;
10919
11011
  let totalWarnings = 0;
10920
11012
  let totalInfos = 0;
10921
- const rootHtml = readFileSync7(project.indexPath, "utf-8");
10922
- const rootResult = lintHyperframeHtml(rootHtml, { filePath: project.indexPath });
11013
+ const rootHtml = readFileSync8(project.indexPath, "utf-8");
11014
+ const rootResult = lintHyperframeHtml(rootHtml, {
11015
+ filePath: project.indexPath,
11016
+ externalStyles: collectExternalStyles(project.dir, rootHtml)
11017
+ });
10923
11018
  results.push({ file: "index.html", result: rootResult });
10924
11019
  totalErrors += rootResult.errorCount;
10925
11020
  totalWarnings += rootResult.warningCount;
@@ -10930,9 +11025,14 @@ function lintProject(project) {
10930
11025
  const files = readdirSync2(compositionsDir).filter((f3) => f3.endsWith(".html"));
10931
11026
  for (const file of files) {
10932
11027
  const filePath = join9(compositionsDir, file);
10933
- const html = readFileSync7(filePath, "utf-8");
10934
- allHtmlSources.push({ html, compSrcPath: `compositions/${file}` });
10935
- const result = lintHyperframeHtml(html, { filePath, isSubComposition: true });
11028
+ const html = readFileSync8(filePath, "utf-8");
11029
+ const compSrcPath = `compositions/${file}`;
11030
+ allHtmlSources.push({ html, compSrcPath });
11031
+ const result = lintHyperframeHtml(html, {
11032
+ filePath,
11033
+ isSubComposition: true,
11034
+ externalStyles: collectExternalStyles(project.dir, html, compSrcPath)
11035
+ });
10936
11036
  results.push({ file: `compositions/${file}`, result });
10937
11037
  totalErrors += result.errorCount;
10938
11038
  totalWarnings += result.warningCount;
@@ -11019,7 +11119,7 @@ function lintMultipleRootCompositions(projectDir) {
11019
11119
  const rootHtmlFiles = readdirSync2(projectDir).filter((f3) => f3.endsWith(".html"));
11020
11120
  const rootCompositions = [];
11021
11121
  for (const file of rootHtmlFiles) {
11022
- const content = readFileSync7(join9(projectDir, file), "utf-8");
11122
+ const content = readFileSync8(join9(projectDir, file), "utf-8");
11023
11123
  if (/data-composition-id/i.test(content)) {
11024
11124
  rootCompositions.push(file);
11025
11125
  }
@@ -11426,8 +11526,8 @@ var runtimeSource_exports = {};
11426
11526
  __export(runtimeSource_exports, {
11427
11527
  loadRuntimeSource: () => loadRuntimeSource
11428
11528
  });
11429
- import { existsSync as existsSync8, readFileSync as readFileSync8 } from "fs";
11430
- import { resolve as resolve7, dirname as dirname4 } from "path";
11529
+ import { existsSync as existsSync8, readFileSync as readFileSync9 } from "fs";
11530
+ import { resolve as resolve7, dirname as dirname5 } from "path";
11431
11531
  async function loadRuntimeSource() {
11432
11532
  return await buildFromSource2() ?? await getInlinedRuntime() ?? readPrebuiltArtifact();
11433
11533
  }
@@ -11459,7 +11559,7 @@ function readPrebuiltArtifact() {
11459
11559
  function readFromDir(dir) {
11460
11560
  for (const name of ARTIFACT_NAMES) {
11461
11561
  const path2 = resolve7(dir, name);
11462
- if (existsSync8(path2)) return readFileSync8(path2, "utf-8");
11562
+ if (existsSync8(path2)) return readFileSync9(path2, "utf-8");
11463
11563
  }
11464
11564
  return null;
11465
11565
  }
@@ -11474,7 +11574,7 @@ function readFromNodeModules() {
11474
11574
  const result = readFromDir(resolve7(dir, sub));
11475
11575
  if (result) return result;
11476
11576
  }
11477
- const parent = dirname4(dir);
11577
+ const parent = dirname5(dir);
11478
11578
  if (parent === dir) break;
11479
11579
  dir = parent;
11480
11580
  }
@@ -11593,7 +11693,7 @@ var init_mime = __esm({
11593
11693
 
11594
11694
  // ../core/src/studio-api/helpers/waveform.ts
11595
11695
  import { spawn as spawn2 } from "child_process";
11596
- import { existsSync as existsSync9, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5 } from "fs";
11696
+ import { existsSync as existsSync9, writeFileSync as writeFileSync6, mkdirSync as mkdirSync5 } from "fs";
11597
11697
  import { join as join11 } from "path";
11598
11698
  function buildWaveformCacheKey(assetPath) {
11599
11699
  return `${WAVEFORM_CACHE_VERSION}_${assetPath.replace(/[/\\]/g, "_")}.json`;
@@ -11661,7 +11761,7 @@ async function generateWaveformCache(projectDir, assetPath) {
11661
11761
  if (existsSync9(cachePath2)) return;
11662
11762
  const peaks = await decodeAudioPeaks(audioPath);
11663
11763
  mkdirSync5(cacheDir, { recursive: true });
11664
- writeFileSync5(cachePath2, JSON.stringify(peaks));
11764
+ writeFileSync6(cachePath2, JSON.stringify(peaks));
11665
11765
  }
11666
11766
  var SAMPLE_RATE, PEAK_COUNT, WAVEFORM_CACHE_VERSION;
11667
11767
  var init_waveform = __esm({
@@ -11675,7 +11775,7 @@ var init_waveform = __esm({
11675
11775
 
11676
11776
  // ../core/src/studio-api/helpers/mediaValidation.ts
11677
11777
  import { spawnSync } from "child_process";
11678
- import { mkdtempSync, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "fs";
11778
+ import { mkdtempSync, rmSync as rmSync2, writeFileSync as writeFileSync7 } from "fs";
11679
11779
  import { tmpdir as tmpdir2 } from "os";
11680
11780
  import { basename, join as join12 } from "path";
11681
11781
  function validateUploadedMedia(filePath, runner = spawnSync) {
@@ -11719,7 +11819,7 @@ function validateUploadedMediaBuffer(fileName, buffer, runner = spawnSync) {
11719
11819
  const tempDir = mkdtempSync(join12(tmpdir2(), "hyperframes-upload-"));
11720
11820
  const tempPath = join12(tempDir, basename(fileName));
11721
11821
  try {
11722
- writeFileSync6(tempPath, buffer);
11822
+ writeFileSync7(tempPath, buffer);
11723
11823
  return validateUploadedMedia(tempPath, runner);
11724
11824
  } finally {
11725
11825
  rmSync2(tempDir, { recursive: true, force: true });
@@ -24377,8 +24477,8 @@ var init_sourceMutation = __esm({
24377
24477
  import { bodyLimit } from "hono/body-limit";
24378
24478
  import {
24379
24479
  existsSync as existsSync10,
24380
- readFileSync as readFileSync9,
24381
- writeFileSync as writeFileSync7,
24480
+ readFileSync as readFileSync10,
24481
+ writeFileSync as writeFileSync8,
24382
24482
  mkdirSync as mkdirSync6,
24383
24483
  unlinkSync as unlinkSync3,
24384
24484
  rmSync as rmSync3,
@@ -24386,7 +24486,7 @@ import {
24386
24486
  renameSync as renameSync2,
24387
24487
  readdirSync as readdirSync4
24388
24488
  } from "fs";
24389
- import { resolve as resolve9, dirname as dirname5, join as join13 } from "path";
24489
+ import { resolve as resolve9, dirname as dirname6, join as join13 } from "path";
24390
24490
  async function resolveProjectFile(c2, adapter2, opts) {
24391
24491
  const id = c2.req.param("id");
24392
24492
  const project = await adapter2.resolveProject(id);
@@ -24407,7 +24507,7 @@ async function resolveProjectFile(c2, adapter2, opts) {
24407
24507
  return { project, filePath, absPath };
24408
24508
  }
24409
24509
  function ensureDir(filePath) {
24410
- const dir = dirname5(filePath);
24510
+ const dir = dirname6(filePath);
24411
24511
  if (!existsSync10(dir)) mkdirSync6(dir, { recursive: true });
24412
24512
  }
24413
24513
  function generateCopyPath(projectDir, originalPath) {
@@ -24444,11 +24544,11 @@ function updateReferences(projectDir, oldPath, newPath) {
24444
24544
  );
24445
24545
  let updatedCount = 0;
24446
24546
  for (const file of textFiles) {
24447
- const content = readFileSync9(file, "utf-8");
24547
+ const content = readFileSync10(file, "utf-8");
24448
24548
  if (!content.includes(oldPath)) continue;
24449
24549
  const updated = content.split(oldPath).join(newPath);
24450
24550
  if (updated !== content) {
24451
- writeFileSync7(file, updated, "utf-8");
24551
+ writeFileSync8(file, updated, "utf-8");
24452
24552
  updatedCount++;
24453
24553
  }
24454
24554
  }
@@ -24458,7 +24558,7 @@ function registerFileRoutes(api, adapter2) {
24458
24558
  api.get("/projects/:id/files/*", async (c2) => {
24459
24559
  const res = await resolveProjectFile(c2, adapter2, { mustExist: true });
24460
24560
  if ("error" in res) return res.error;
24461
- const content = readFileSync9(res.absPath, "utf-8");
24561
+ const content = readFileSync10(res.absPath, "utf-8");
24462
24562
  return c2.json({ filename: res.filePath, content });
24463
24563
  });
24464
24564
  api.put("/projects/:id/files/*", async (c2) => {
@@ -24466,7 +24566,7 @@ function registerFileRoutes(api, adapter2) {
24466
24566
  if ("error" in res) return res.error;
24467
24567
  ensureDir(res.absPath);
24468
24568
  const body = await c2.req.text();
24469
- writeFileSync7(res.absPath, body, "utf-8");
24569
+ writeFileSync8(res.absPath, body, "utf-8");
24470
24570
  return c2.json({ ok: true });
24471
24571
  });
24472
24572
  api.post("/projects/:id/files/*", async (c2) => {
@@ -24477,7 +24577,7 @@ function registerFileRoutes(api, adapter2) {
24477
24577
  }
24478
24578
  ensureDir(res.absPath);
24479
24579
  const body = await c2.req.text().catch(() => "");
24480
- writeFileSync7(res.absPath, body, "utf-8");
24580
+ writeFileSync8(res.absPath, body, "utf-8");
24481
24581
  return c2.json({ ok: true, path: res.filePath }, 201);
24482
24582
  });
24483
24583
  api.delete("/projects/:id/files/*", async (c2) => {
@@ -24512,12 +24612,12 @@ function registerFileRoutes(api, adapter2) {
24512
24612
  if (!body?.target) {
24513
24613
  return c2.json({ error: "target required" }, 400);
24514
24614
  }
24515
- const originalContent = readFileSync9(absPath, "utf-8");
24615
+ const originalContent = readFileSync10(absPath, "utf-8");
24516
24616
  const patchedContent = removeElementFromHtml2(originalContent, body.target);
24517
24617
  if (patchedContent === originalContent) {
24518
24618
  return c2.json({ ok: true, changed: false, content: originalContent });
24519
24619
  }
24520
- writeFileSync7(absPath, patchedContent, "utf-8");
24620
+ writeFileSync8(absPath, patchedContent, "utf-8");
24521
24621
  return c2.json({ ok: true, changed: true, content: patchedContent });
24522
24622
  });
24523
24623
  api.patch("/projects/:id/files/*", async (c2) => {
@@ -24556,7 +24656,7 @@ function registerFileRoutes(api, adapter2) {
24556
24656
  return c2.json({ error: "forbidden" }, 403);
24557
24657
  }
24558
24658
  ensureDir(destAbs);
24559
- writeFileSync7(destAbs, readFileSync9(srcAbs));
24659
+ writeFileSync8(destAbs, readFileSync10(srcAbs));
24560
24660
  return c2.json({ ok: true, path: copyPath }, 201);
24561
24661
  });
24562
24662
  const MAX_UPLOAD_BYTES = 500 * 1024 * 1024;
@@ -24608,7 +24708,7 @@ function registerFileRoutes(api, adapter2) {
24608
24708
  invalid.push({ name: finalName, reason: validation.reason });
24609
24709
  continue;
24610
24710
  }
24611
- writeFileSync7(finalPath, buffer);
24711
+ writeFileSync8(finalPath, buffer);
24612
24712
  const relativePath = subDir ? join13(subDir, finalName) : finalName;
24613
24713
  uploaded.push(relativePath);
24614
24714
  if (isAudioFile2(finalName)) {
@@ -24632,12 +24732,12 @@ var init_files = __esm({
24632
24732
  });
24633
24733
 
24634
24734
  // ../core/src/studio-api/helpers/subComposition.ts
24635
- import { existsSync as existsSync11, readFileSync as readFileSync10 } from "fs";
24735
+ import { existsSync as existsSync11, readFileSync as readFileSync11 } from "fs";
24636
24736
  import { join as join14 } from "path";
24637
24737
  function buildSubCompositionHtml(projectDir, compPath, runtimeUrl, baseHref) {
24638
24738
  const compFile = join14(projectDir, compPath);
24639
24739
  if (!existsSync11(compFile)) return null;
24640
- const rawComp = readFileSync10(compFile, "utf-8");
24740
+ const rawComp = readFileSync11(compFile, "utf-8");
24641
24741
  const templateMatch = rawComp.match(/<template[^>]*>([\s\S]*)<\/template>/i);
24642
24742
  const content = templateMatch?.[1] ?? rawComp;
24643
24743
  const { document: contentDoc } = parseHTML(
@@ -24658,7 +24758,7 @@ function buildSubCompositionHtml(projectDir, compPath, runtimeUrl, baseHref) {
24658
24758
  const indexPath = join14(projectDir, "index.html");
24659
24759
  let headContent = "";
24660
24760
  if (existsSync11(indexPath)) {
24661
- const indexHtml = readFileSync10(indexPath, "utf-8");
24761
+ const indexHtml = readFileSync11(indexPath, "utf-8");
24662
24762
  const headMatch = indexHtml.match(/<head[^>]*>([\s\S]*?)<\/head>/i);
24663
24763
  headContent = headMatch?.[1] ?? "";
24664
24764
  }
@@ -24694,7 +24794,7 @@ var init_subComposition = __esm({
24694
24794
  });
24695
24795
 
24696
24796
  // ../core/src/studio-api/routes/preview.ts
24697
- import { existsSync as existsSync12, readFileSync as readFileSync11, statSync as statSync2 } from "fs";
24797
+ import { existsSync as existsSync12, readFileSync as readFileSync12, statSync as statSync2 } from "fs";
24698
24798
  import { resolve as resolve10 } from "path";
24699
24799
  function registerPreviewRoutes(api, adapter2) {
24700
24800
  api.get("/projects/:id/preview", async (c2) => {
@@ -24705,7 +24805,7 @@ function registerPreviewRoutes(api, adapter2) {
24705
24805
  if (!bundled) {
24706
24806
  const indexPath = resolve10(project.dir, "index.html");
24707
24807
  if (!existsSync12(indexPath)) return c2.text("not found", 404);
24708
- bundled = readFileSync11(indexPath, "utf-8");
24808
+ bundled = readFileSync12(indexPath, "utf-8");
24709
24809
  }
24710
24810
  if (!bundled.includes("hyperframe.runtime") && !bundled.includes("hyperframes-preview-runtime")) {
24711
24811
  const runtimeTag = `<script src="${adapter2.runtimeUrl}"></script>`;
@@ -24720,7 +24820,7 @@ ${runtimeTag}`;
24720
24820
  return c2.html(bundled);
24721
24821
  } catch {
24722
24822
  const file = resolve10(project.dir, "index.html");
24723
- if (existsSync12(file)) return c2.html(readFileSync11(file, "utf-8"));
24823
+ if (existsSync12(file)) return c2.html(readFileSync12(file, "utf-8"));
24724
24824
  return c2.text("not found", 404);
24725
24825
  }
24726
24826
  });
@@ -24751,7 +24851,7 @@ ${runtimeTag}`;
24751
24851
  }
24752
24852
  const contentType = getMimeType(subPath);
24753
24853
  const isText2 = /\.(html|css|js|json|svg|txt|md)$/i.test(subPath);
24754
- const buffer = isText2 ? Buffer.from(readFileSync11(file, "utf-8"), "utf-8") : readFileSync11(file);
24854
+ const buffer = isText2 ? Buffer.from(readFileSync12(file, "utf-8"), "utf-8") : readFileSync12(file);
24755
24855
  const totalSize2 = buffer.length;
24756
24856
  const rangeHeader = c2.req.header("Range");
24757
24857
  if (rangeHeader) {
@@ -24791,7 +24891,7 @@ var init_preview = __esm({
24791
24891
  });
24792
24892
 
24793
24893
  // ../core/src/studio-api/routes/lint.ts
24794
- import { readFileSync as readFileSync12 } from "fs";
24894
+ import { readFileSync as readFileSync13 } from "fs";
24795
24895
  import { join as join15 } from "path";
24796
24896
  function registerLintRoutes(api, adapter2) {
24797
24897
  api.get("/projects/:id/lint", async (c2) => {
@@ -24801,7 +24901,7 @@ function registerLintRoutes(api, adapter2) {
24801
24901
  const htmlFiles = walkDir(project.dir).filter((f3) => f3.endsWith(".html"));
24802
24902
  const allFindings = [];
24803
24903
  for (const file of htmlFiles) {
24804
- const content = readFileSync12(join15(project.dir, file), "utf-8");
24904
+ const content = readFileSync13(join15(project.dir, file), "utf-8");
24805
24905
  const result = await adapter2.lint(content, { filePath: file });
24806
24906
  if (result?.findings) {
24807
24907
  for (const f3 of result.findings) {
@@ -24825,7 +24925,7 @@ var init_lint2 = __esm({
24825
24925
 
24826
24926
  // ../core/src/studio-api/routes/render.ts
24827
24927
  import { streamSSE } from "hono/streaming";
24828
- import { existsSync as existsSync13, readFileSync as readFileSync13, mkdirSync as mkdirSync7, unlinkSync as unlinkSync4, readdirSync as readdirSync5, statSync as statSync3 } from "fs";
24928
+ import { existsSync as existsSync13, readFileSync as readFileSync14, mkdirSync as mkdirSync7, unlinkSync as unlinkSync4, readdirSync as readdirSync5, statSync as statSync3 } from "fs";
24829
24929
  import { join as join16 } from "path";
24830
24930
  function registerRenderRoutes(api, adapter2) {
24831
24931
  const renderJobs = /* @__PURE__ */ new Map();
@@ -24935,7 +25035,7 @@ function registerRenderRoutes(api, adapter2) {
24935
25035
  }
24936
25036
  const contentType = renderContentType(job.outputPath);
24937
25037
  const filename = job.outputPath.split("/").pop() ?? `render.mp4`;
24938
- const content = readFileSync13(job.outputPath);
25038
+ const content = readFileSync14(job.outputPath);
24939
25039
  return new Response(content, {
24940
25040
  headers: {
24941
25041
  "Content-Type": contentType,
@@ -24953,7 +25053,7 @@ function registerRenderRoutes(api, adapter2) {
24953
25053
  }
24954
25054
  const contentType = renderContentType(job.outputPath);
24955
25055
  const filename = job.outputPath.split("/").pop() ?? `render.mp4`;
24956
- const content = readFileSync13(job.outputPath);
25056
+ const content = readFileSync14(job.outputPath);
24957
25057
  return new Response(content, {
24958
25058
  headers: {
24959
25059
  "Content-Type": contentType,
@@ -24985,7 +25085,7 @@ function registerRenderRoutes(api, adapter2) {
24985
25085
  const fp = join16(rendersDir, filename);
24986
25086
  if (!existsSync13(fp)) return c2.json({ error: "not found" }, 404);
24987
25087
  const contentType = renderContentType(fp);
24988
- const content = readFileSync13(fp);
25088
+ const content = readFileSync14(fp);
24989
25089
  return new Response(content, {
24990
25090
  headers: {
24991
25091
  "Content-Type": contentType,
@@ -25009,7 +25109,7 @@ function registerRenderRoutes(api, adapter2) {
25009
25109
  let durationMs;
25010
25110
  if (existsSync13(metaPath)) {
25011
25111
  try {
25012
- const meta = JSON.parse(readFileSync13(metaPath, "utf-8"));
25112
+ const meta = JSON.parse(readFileSync14(metaPath, "utf-8"));
25013
25113
  if (meta.status === "failed") status = "failed";
25014
25114
  if (meta.durationMs) durationMs = meta.durationMs;
25015
25115
  } catch {
@@ -25045,7 +25145,7 @@ var init_render = __esm({
25045
25145
  });
25046
25146
 
25047
25147
  // ../core/src/studio-api/routes/thumbnail.ts
25048
- import { existsSync as existsSync14, readFileSync as readFileSync14, writeFileSync as writeFileSync8, mkdirSync as mkdirSync8 } from "fs";
25148
+ import { existsSync as existsSync14, readFileSync as readFileSync15, writeFileSync as writeFileSync9, mkdirSync as mkdirSync8 } from "fs";
25049
25149
  import { join as join17 } from "path";
25050
25150
  function registerThumbnailRoutes(api, adapter2) {
25051
25151
  api.get("/projects/:id/thumbnail/*", async (c2) => {
@@ -25063,12 +25163,14 @@ function registerThumbnailRoutes(api, adapter2) {
25063
25163
  const vpWidth = parseInt(url.searchParams.get("w") || "0") || 0;
25064
25164
  const vpHeight = parseInt(url.searchParams.get("h") || "0") || 0;
25065
25165
  const selector = url.searchParams.get("selector") || void 0;
25166
+ const format = url.searchParams.get("format") === "png" ? "png" : "jpeg";
25167
+ const contentType = format === "png" ? "image/png" : "image/jpeg";
25066
25168
  let compW = vpWidth || 1920;
25067
25169
  let compH = vpHeight || 1080;
25068
25170
  if (!vpWidth) {
25069
25171
  const htmlFile = join17(project.dir, compPath);
25070
25172
  if (existsSync14(htmlFile)) {
25071
- const html = readFileSync14(htmlFile, "utf-8");
25173
+ const html = readFileSync15(htmlFile, "utf-8");
25072
25174
  const wMatch = html.match(/data-width=["'](\d+)["']/);
25073
25175
  const hMatch = html.match(/data-height=["'](\d+)["']/);
25074
25176
  if (wMatch?.[1]) compW = parseInt(wMatch[1]);
@@ -25078,11 +25180,11 @@ function registerThumbnailRoutes(api, adapter2) {
25078
25180
  const previewUrl = compPath === "index.html" ? `http://${c2.req.header("host")}/api/projects/${project.id}/preview` : `http://${c2.req.header("host")}/api/projects/${project.id}/preview/comp/${compPath}`;
25079
25181
  const cacheDir = join17(project.dir, ".thumbnails");
25080
25182
  const selectorKey = selector ? `_${selector.replace(/[^a-zA-Z0-9_-]+/g, "_").slice(0, 80)}` : "";
25081
- const cacheKey = `${THUMBNAIL_CACHE_VERSION}_${compPath.replace(/\//g, "_")}_${seekTime.toFixed(2)}${selectorKey}.jpg`;
25183
+ const cacheKey = `${THUMBNAIL_CACHE_VERSION}_${format}_${compPath.replace(/\//g, "_")}_${seekTime.toFixed(2)}${selectorKey}.${format === "png" ? "png" : "jpg"}`;
25082
25184
  const cachePath2 = join17(cacheDir, cacheKey);
25083
25185
  if (existsSync14(cachePath2)) {
25084
- return new Response(new Uint8Array(readFileSync14(cachePath2)), {
25085
- headers: { "Content-Type": "image/jpeg", "Cache-Control": "public, max-age=60" }
25186
+ return new Response(new Uint8Array(readFileSync15(cachePath2)), {
25187
+ headers: { "Content-Type": contentType, "Cache-Control": "public, max-age=60" }
25086
25188
  });
25087
25189
  }
25088
25190
  try {
@@ -25093,15 +25195,16 @@ function registerThumbnailRoutes(api, adapter2) {
25093
25195
  width: compW,
25094
25196
  height: compH,
25095
25197
  previewUrl,
25096
- selector
25198
+ selector,
25199
+ format
25097
25200
  });
25098
25201
  if (!buffer) {
25099
25202
  return c2.json({ error: "Thumbnail generation returned null" }, 500);
25100
25203
  }
25101
25204
  if (!existsSync14(cacheDir)) mkdirSync8(cacheDir, { recursive: true });
25102
- writeFileSync8(cachePath2, buffer);
25205
+ writeFileSync9(cachePath2, buffer);
25103
25206
  return new Response(new Uint8Array(buffer), {
25104
- headers: { "Content-Type": "image/jpeg", "Cache-Control": "public, max-age=60" }
25207
+ headers: { "Content-Type": contentType, "Cache-Control": "public, max-age=60" }
25105
25208
  });
25106
25209
  } catch (err) {
25107
25210
  const msg = err instanceof Error ? err.message : String(err);
@@ -25118,7 +25221,7 @@ var init_thumbnail = __esm({
25118
25221
  });
25119
25222
 
25120
25223
  // ../core/src/studio-api/routes/waveform.ts
25121
- import { existsSync as existsSync15, readFileSync as readFileSync15, writeFileSync as writeFileSync9, mkdirSync as mkdirSync9 } from "fs";
25224
+ import { existsSync as existsSync15, readFileSync as readFileSync16, writeFileSync as writeFileSync10, mkdirSync as mkdirSync9 } from "fs";
25122
25225
  import { join as join18 } from "path";
25123
25226
  function registerWaveformRoutes(api, adapter2) {
25124
25227
  api.get("/projects/:id/waveform/*", async (c2) => {
@@ -25133,7 +25236,7 @@ function registerWaveformRoutes(api, adapter2) {
25133
25236
  const cachePath2 = join18(cacheDir, buildWaveformCacheKey(assetPath));
25134
25237
  if (existsSync15(cachePath2)) {
25135
25238
  try {
25136
- const peaks2 = JSON.parse(readFileSync15(cachePath2, "utf-8"));
25239
+ const peaks2 = JSON.parse(readFileSync16(cachePath2, "utf-8"));
25137
25240
  return c2.json({ peaks: peaks2 });
25138
25241
  } catch {
25139
25242
  }
@@ -25146,7 +25249,7 @@ function registerWaveformRoutes(api, adapter2) {
25146
25249
  }
25147
25250
  try {
25148
25251
  mkdirSync9(cacheDir, { recursive: true });
25149
- writeFileSync9(cachePath2, JSON.stringify(peaks));
25252
+ writeFileSync10(cachePath2, JSON.stringify(peaks));
25150
25253
  } catch {
25151
25254
  }
25152
25255
  return c2.json({ peaks });
@@ -25931,7 +26034,7 @@ var init_screenshotService = __esm({
25931
26034
  });
25932
26035
 
25933
26036
  // ../engine/src/services/frameCapture.ts
25934
- import { existsSync as existsSync18, mkdirSync as mkdirSync10, writeFileSync as writeFileSync10 } from "fs";
26037
+ import { existsSync as existsSync18, mkdirSync as mkdirSync10, writeFileSync as writeFileSync11 } from "fs";
25935
26038
  import { join as join21 } from "path";
25936
26039
  async function createCaptureSession(serverUrl, outputDir, options, onBeforeCapture = null, config) {
25937
26040
  if (!existsSync18(outputDir)) mkdirSync10(outputDir, { recursive: true });
@@ -26143,8 +26246,8 @@ async function captureFrameErrorDiagnostics(session, frameIndex, time, error) {
26143
26246
  const base = join21(diagnosticsDir, `frame-error-${frameIndex}`);
26144
26247
  await session.page.screenshot({ path: `${base}.png`, type: "png", fullPage: true });
26145
26248
  const html = await session.page.content();
26146
- writeFileSync10(`${base}.html`, html, "utf-8");
26147
- writeFileSync10(
26249
+ writeFileSync11(`${base}.html`, html, "utf-8");
26250
+ writeFileSync11(
26148
26251
  `${base}.json`,
26149
26252
  JSON.stringify(
26150
26253
  {
@@ -26239,7 +26342,7 @@ async function captureFrame(session, frameIndex, time) {
26239
26342
  const ext = options.format === "png" ? "png" : "jpg";
26240
26343
  const frameName = `frame_${String(frameIndex).padStart(6, "0")}.${ext}`;
26241
26344
  const framePath = join21(outputDir, frameName);
26242
- writeFileSync10(framePath, buffer);
26345
+ writeFileSync11(framePath, buffer);
26243
26346
  return { frameIndex, time: quantizedTime, path: framePath, captureTimeMs };
26244
26347
  }
26245
26348
  async function captureFrameToBuffer(session, frameIndex, time) {
@@ -26497,8 +26600,8 @@ var init_runFfmpeg = __esm({
26497
26600
 
26498
26601
  // ../engine/src/services/chunkEncoder.ts
26499
26602
  import { spawn as spawn5 } from "child_process";
26500
- import { copyFileSync, existsSync as existsSync19, mkdirSync as mkdirSync11, readdirSync as readdirSync7, statSync as statSync4, writeFileSync as writeFileSync11 } from "fs";
26501
- import { join as join22, dirname as dirname6 } from "path";
26603
+ import { copyFileSync, existsSync as existsSync19, mkdirSync as mkdirSync11, readdirSync as readdirSync7, statSync as statSync4, writeFileSync as writeFileSync12 } from "fs";
26604
+ import { join as join22, dirname as dirname7 } from "path";
26502
26605
  function getEncoderPreset(quality, format = "mp4", hdr) {
26503
26606
  const base = ENCODER_PRESETS[quality];
26504
26607
  if (format === "webm") {
@@ -26648,7 +26751,7 @@ function buildEncoderArgs(options, inputArgs, outputPath, gpuEncoder = null) {
26648
26751
  }
26649
26752
  async function encodeFramesFromDir(framesDir, framePattern, outputPath, options, signal, config) {
26650
26753
  const startTime = Date.now();
26651
- const outputDir = dirname6(outputPath);
26754
+ const outputDir = dirname7(outputPath);
26652
26755
  if (!existsSync19(outputDir)) mkdirSync11(outputDir, { recursive: true });
26653
26756
  const files = readdirSync7(framesDir).filter((f3) => f3.match(/\.(jpg|jpeg|png)$/i));
26654
26757
  const frameCount = files.length;
@@ -26747,7 +26850,7 @@ async function encodeFramesChunkedConcat(framesDir, framePattern, outputPath, op
26747
26850
  }
26748
26851
  const chunkSize = Math.max(30, Math.floor(chunkSizeFrames));
26749
26852
  const chunkCount = Math.ceil(files.length / chunkSize);
26750
- const chunkDir = join22(dirname6(outputPath), "chunk-encode");
26853
+ const chunkDir = join22(dirname7(outputPath), "chunk-encode");
26751
26854
  if (!existsSync19(chunkDir)) mkdirSync11(chunkDir, { recursive: true });
26752
26855
  const chunkPaths = [];
26753
26856
  for (let i2 = 0; i2 < chunkCount; i2++) {
@@ -26807,7 +26910,7 @@ async function encodeFramesChunkedConcat(framesDir, framePattern, outputPath, op
26807
26910
  }
26808
26911
  const concatListPath = join22(chunkDir, "concat-list.txt");
26809
26912
  const concatInput = chunkPaths.map((path2) => `file '${path2.replace(/'/g, "'\\''")}'`).join("\n");
26810
- writeFileSync11(concatListPath, concatInput, "utf-8");
26913
+ writeFileSync12(concatListPath, concatInput, "utf-8");
26811
26914
  const concatArgs = [
26812
26915
  "-f",
26813
26916
  "concat",
@@ -26854,7 +26957,7 @@ async function encodeFramesChunkedConcat(framesDir, framePattern, outputPath, op
26854
26957
  };
26855
26958
  }
26856
26959
  async function muxVideoWithAudio(videoPath, audioPath, outputPath, signal, config) {
26857
- const outputDir = dirname6(outputPath);
26960
+ const outputDir = dirname7(outputPath);
26858
26961
  if (!existsSync19(outputDir)) mkdirSync11(outputDir, { recursive: true });
26859
26962
  const isWebm = outputPath.endsWith(".webm");
26860
26963
  const isMov = outputPath.endsWith(".mov");
@@ -26927,7 +27030,7 @@ var init_chunkEncoder = __esm({
26927
27030
  // ../engine/src/services/streamingEncoder.ts
26928
27031
  import { spawn as spawn6 } from "child_process";
26929
27032
  import { existsSync as existsSync20, mkdirSync as mkdirSync12, statSync as statSync5 } from "fs";
26930
- import { dirname as dirname7 } from "path";
27033
+ import { dirname as dirname8 } from "path";
26931
27034
  function createFrameReorderBuffer(startFrame, endFrame) {
26932
27035
  let cursor = startFrame;
26933
27036
  const pending = /* @__PURE__ */ new Map();
@@ -27108,7 +27211,7 @@ function buildStreamingArgs(options, outputPath, gpuEncoder = null) {
27108
27211
  return args;
27109
27212
  }
27110
27213
  async function spawnStreamingEncoder(outputPath, options, signal, config) {
27111
- const outputDir = dirname7(outputPath);
27214
+ const outputDir = dirname8(outputPath);
27112
27215
  if (!existsSync20(outputDir)) mkdirSync12(outputDir, { recursive: true });
27113
27216
  let gpuEncoder = null;
27114
27217
  if (options.useGpu) {
@@ -27210,7 +27313,7 @@ var init_streamingEncoder = __esm({
27210
27313
 
27211
27314
  // ../engine/src/utils/ffprobe.ts
27212
27315
  import { spawn as spawn7 } from "child_process";
27213
- import { readFileSync as readFileSync16 } from "fs";
27316
+ import { readFileSync as readFileSync17 } from "fs";
27214
27317
  import { extname as extname4 } from "path";
27215
27318
  function runFfprobe(args) {
27216
27319
  return new Promise((resolve39, reject) => {
@@ -27304,7 +27407,7 @@ function extractPngMetadataFromBuffer(buf) {
27304
27407
  function extractStillImageMetadata(filePath) {
27305
27408
  if (extname4(filePath).toLowerCase() !== ".png") return null;
27306
27409
  try {
27307
- return extractPngMetadataFromBuffer(readFileSync16(filePath));
27410
+ return extractPngMetadataFromBuffer(readFileSync17(filePath));
27308
27411
  } catch {
27309
27412
  return null;
27310
27413
  }
@@ -27600,7 +27703,7 @@ var init_htmlTemplate = __esm({
27600
27703
 
27601
27704
  // ../engine/src/services/extractionCache.ts
27602
27705
  import { createHash as createHash2 } from "crypto";
27603
- import { mkdirSync as mkdirSync14, readdirSync as readdirSync8, statSync as statSync6, writeFileSync as writeFileSync12 } from "fs";
27706
+ import { mkdirSync as mkdirSync14, readdirSync as readdirSync8, statSync as statSync6, writeFileSync as writeFileSync13 } from "fs";
27604
27707
  import { existsSync as existsSync22 } from "fs";
27605
27708
  import { join as join24 } from "path";
27606
27709
  function readKeyStat(videoPath) {
@@ -27639,7 +27742,7 @@ function ensureCacheEntryDir(entry) {
27639
27742
  mkdirSync14(entry.dir, { recursive: true });
27640
27743
  }
27641
27744
  function markCacheEntryComplete(entry) {
27642
- writeFileSync12(join24(entry.dir, COMPLETE_SENTINEL), "", "utf-8");
27745
+ writeFileSync13(join24(entry.dir, COMPLETE_SENTINEL), "", "utf-8");
27643
27746
  }
27644
27747
  function rehydrateCacheEntry(entry, options) {
27645
27748
  const framePattern = `${FRAME_FILENAME_PREFIX}%05d.${options.format}`;
@@ -28635,7 +28738,7 @@ var init_videoFrameInjector = __esm({
28635
28738
 
28636
28739
  // ../engine/src/services/audioMixer.ts
28637
28740
  import { existsSync as existsSync24, mkdirSync as mkdirSync16, rmSync as rmSync6 } from "fs";
28638
- import { isAbsolute as isAbsolute3, join as join26, dirname as dirname8 } from "path";
28741
+ import { isAbsolute as isAbsolute3, join as join26, dirname as dirname9 } from "path";
28639
28742
  function parseAudioElements(html) {
28640
28743
  const elements = [];
28641
28744
  const { document: document2 } = parseHTML(unwrapTemplate(html));
@@ -28685,7 +28788,7 @@ function parseAudioElements(html) {
28685
28788
  }
28686
28789
  async function extractAudioFromVideo(videoPath, outputPath, options, signal, config) {
28687
28790
  const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG2.ffmpegProcessTimeout;
28688
- const outputDir = dirname8(outputPath);
28791
+ const outputDir = dirname9(outputPath);
28689
28792
  if (!existsSync24(outputDir)) mkdirSync16(outputDir, { recursive: true });
28690
28793
  const args = ["-i", videoPath];
28691
28794
  if (options?.startTime !== void 0) args.push("-ss", String(options.startTime));
@@ -28712,7 +28815,7 @@ async function extractAudioFromVideo(videoPath, outputPath, options, signal, con
28712
28815
  }
28713
28816
  async function prepareAudioTrack(srcPath, outputPath, mediaStart, duration, signal, config) {
28714
28817
  const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG2.ffmpegProcessTimeout;
28715
- const outputDir = dirname8(outputPath);
28818
+ const outputDir = dirname9(outputPath);
28716
28819
  if (!existsSync24(outputDir)) mkdirSync16(outputDir, { recursive: true });
28717
28820
  const args = [
28718
28821
  "-ss",
@@ -28748,7 +28851,7 @@ async function prepareAudioTrack(srcPath, outputPath, mediaStart, duration, sign
28748
28851
  }
28749
28852
  async function generateSilence(outputPath, duration, signal, config) {
28750
28853
  const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG2.ffmpegProcessTimeout;
28751
- const outputDir = dirname8(outputPath);
28854
+ const outputDir = dirname9(outputPath);
28752
28855
  if (!existsSync24(outputDir)) mkdirSync16(outputDir, { recursive: true });
28753
28856
  const args = [
28754
28857
  "-f",
@@ -28791,7 +28894,7 @@ async function mixAudioTracks(tracks, outputPath, totalDuration, signal, config)
28791
28894
  error: result2.error
28792
28895
  };
28793
28896
  }
28794
- const outputDir = dirname8(outputPath);
28897
+ const outputDir = dirname9(outputPath);
28795
28898
  if (!existsSync24(outputDir)) mkdirSync16(outputDir, { recursive: true });
28796
28899
  const inputs = [];
28797
28900
  const filterParts = [];
@@ -29155,7 +29258,7 @@ var init_parallelCoordinator = __esm({
29155
29258
  // ../engine/src/services/fileServer.ts
29156
29259
  import { Hono as Hono2 } from "hono";
29157
29260
  import { serve } from "@hono/node-server";
29158
- import { readFileSync as readFileSync17, existsSync as existsSync26, statSync as statSync7 } from "fs";
29261
+ import { readFileSync as readFileSync18, existsSync as existsSync26, statSync as statSync7 } from "fs";
29159
29262
  import { join as join28, extname as extname6 } from "path";
29160
29263
  function stripEmbeddedRuntimeScripts(html) {
29161
29264
  if (!html) return html;
@@ -29236,11 +29339,11 @@ function createFileServer(options) {
29236
29339
  const ext = extname6(filePath).toLowerCase();
29237
29340
  const contentType = MIME_TYPES2[ext] || "application/octet-stream";
29238
29341
  if (ext === ".html") {
29239
- const rawHtml = readFileSync17(filePath, "utf-8");
29342
+ const rawHtml = readFileSync18(filePath, "utf-8");
29240
29343
  const html = relativePath === "index.html" ? injectScriptsIntoHtml(rawHtml, headScripts, bodyScripts, stripEmbeddedRuntime) : rawHtml;
29241
29344
  return c2.text(html, 200, { "Content-Type": contentType });
29242
29345
  }
29243
- const content = readFileSync17(filePath);
29346
+ const content = readFileSync18(filePath);
29244
29347
  return new Response(content, {
29245
29348
  status: 200,
29246
29349
  headers: { "Content-Type": contentType }
@@ -30924,8 +31027,8 @@ var init_htmlCompiler = __esm({
30924
31027
  });
30925
31028
 
30926
31029
  // ../core/src/compiler/compositionScoping.ts
30927
- import postcss from "postcss";
30928
- function escapeRegExp2(value) {
31030
+ import postcss2 from "postcss";
31031
+ function escapeRegExp3(value) {
30929
31032
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
30930
31033
  }
30931
31034
  function escapeCssAttributeValue(value) {
@@ -30941,15 +31044,18 @@ function scopeSelector(selector, scope, compositionId) {
30941
31044
  if (!trimmed) return selector;
30942
31045
  if (/^(html|body|:root|\*)$/i.test(trimmed)) return selector;
30943
31046
  const compositionIdPattern = new RegExp(
30944
- `data-composition-id\\s*=\\s*(["'])${escapeRegExp2(compositionId)}\\1`
31047
+ `\\[\\s*data-composition-id\\s*=\\s*(["'])${escapeRegExp3(compositionId)}\\1\\s*\\]`,
31048
+ "g"
30945
31049
  );
30946
- if (compositionIdPattern.test(trimmed)) return selectorWithoutRootTiming;
31050
+ if (compositionIdPattern.test(trimmed)) {
31051
+ return selectorWithoutRootTiming.replace(compositionIdPattern, scope);
31052
+ }
30947
31053
  const leading = selectorWithoutRootTiming.match(/^\s*/)?.[0] ?? "";
30948
31054
  const trailing = selectorWithoutRootTiming.match(/\s*$/)?.[0] ?? "";
30949
31055
  return `${leading}${scope} ${trimmed}${trailing}`;
30950
31056
  }
30951
31057
  function normalizeCompositionRootSelector(selector, scope, compositionId) {
30952
- const quotedCompId = escapeRegExp2(compositionId);
31058
+ const quotedCompId = escapeRegExp3(compositionId);
30953
31059
  const compAttr = String.raw`\[\s*data-composition-id\s*=\s*(?:"${quotedCompId}"|'${quotedCompId}')\s*\]`;
30954
31060
  const timingAttr = String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`;
30955
31061
  return selector.replace(new RegExp(`${compAttr}(?:${timingAttr})+`, "g"), scope).replace(new RegExp(`(?:${timingAttr})+${compAttr}`, "g"), scope);
@@ -30967,11 +31073,11 @@ function isInsideGlobalAtRule(rule) {
30967
31073
  }
30968
31074
  return false;
30969
31075
  }
30970
- function scopeCssToComposition(css, compositionId) {
31076
+ function scopeCssToComposition(css, compositionId, scopeSelectorOverride) {
30971
31077
  const trimmedCompositionId = compositionId.trim();
30972
31078
  if (!css || !trimmedCompositionId) return css;
30973
- const scope = `[data-composition-id="${escapeCssAttributeValue(trimmedCompositionId)}"]`;
30974
- const root = postcss.parse(css);
31079
+ const scope = scopeSelectorOverride || `[data-composition-id="${escapeCssAttributeValue(trimmedCompositionId)}"]`;
31080
+ const root = postcss2.parse(css);
30975
31081
  root.walkRules((rule) => {
30976
31082
  if (isInsideGlobalAtRule(rule)) return;
30977
31083
  rule.selectors = rule.selectors.map(
@@ -30980,10 +31086,12 @@ function scopeCssToComposition(css, compositionId) {
30980
31086
  });
30981
31087
  return root.toResult({ map: false }).css;
30982
31088
  }
30983
- function wrapScopedCompositionScript(source, compositionId, errorLabel = "[HyperFrames] composition script error:") {
31089
+ function wrapScopedCompositionScript(source, compositionId, errorLabel = "[HyperFrames] composition script error:", scopeSelectorOverride, timelineCompositionId = compositionId) {
30984
31090
  const compositionIdLiteral = JSON.stringify(compositionId);
31091
+ const timelineCompositionIdLiteral = JSON.stringify(timelineCompositionId);
30985
31092
  const errorLabelLiteral = JSON.stringify(errorLabel);
30986
- const escapedCompositionId = escapeRegExp2(compositionId);
31093
+ const escapedCompositionId = escapeRegExp3(compositionId);
31094
+ const scopeSelectorLiteral = JSON.stringify(scopeSelectorOverride ?? null);
30987
31095
  const rootSelectorPatternLiteral = JSON.stringify(
30988
31096
  String.raw`\[\s*data-composition-id\s*=\s*(?:"${escapedCompositionId}"|'${escapedCompositionId}')\s*\]`
30989
31097
  );
@@ -30992,13 +31100,14 @@ function wrapScopedCompositionScript(source, compositionId, errorLabel = "[Hyper
30992
31100
  );
30993
31101
  return `(function(){
30994
31102
  var __hfCompId = ${compositionIdLiteral};
31103
+ var __hfTimelineCompId = ${timelineCompositionIdLiteral};
30995
31104
  var __hfErrorLabel = ${errorLabelLiteral};
30996
31105
  var __hfEscapeAttr = function(value) {
30997
31106
  return (value + "").replace(/\\\\/g, "\\\\\\\\").replace(/"/g, "\\\\\\"");
30998
31107
  };
30999
- var __hfRootSelector = __hfCompId
31108
+ var __hfRootSelector = ${scopeSelectorLiteral} || (__hfCompId
31000
31109
  ? '[data-composition-id="' + __hfEscapeAttr(__hfCompId) + '"]'
31001
- : "";
31110
+ : "");
31002
31111
  var __hfRoot = null;
31003
31112
  var __hfRootSelectorPattern = ${rootSelectorPatternLiteral};
31004
31113
  var __hfTimingSelectorPattern = ${timingSelectorPatternLiteral};
@@ -31047,6 +31156,41 @@ function wrapScopedCompositionScript(source, compositionId, errorLabel = "[Hyper
31047
31156
  },
31048
31157
  })
31049
31158
  : window.document;
31159
+ var __hfTimelineRegistryProxy = null;
31160
+ var __hfGetTimelineRegistry = function() {
31161
+ window.__timelines = window.__timelines || {};
31162
+ if (!__hfCompId || __hfCompId === __hfTimelineCompId || typeof Proxy !== "function") {
31163
+ return window.__timelines;
31164
+ }
31165
+ if (!__hfTimelineRegistryProxy) {
31166
+ __hfTimelineRegistryProxy = new Proxy(window.__timelines, {
31167
+ get: function(target, prop, receiver) {
31168
+ return Reflect.get(target, prop === __hfCompId ? __hfTimelineCompId : prop, receiver);
31169
+ },
31170
+ set: function(target, prop, value, receiver) {
31171
+ return Reflect.set(target, prop === __hfCompId ? __hfTimelineCompId : prop, value, receiver);
31172
+ },
31173
+ });
31174
+ }
31175
+ return __hfTimelineRegistryProxy;
31176
+ };
31177
+ var __hfScopedWindow = typeof Proxy === "function"
31178
+ ? new Proxy(window, {
31179
+ get: function(target, prop, receiver) {
31180
+ if (prop === "__timelines") return __hfGetTimelineRegistry();
31181
+ var value = Reflect.get(target, prop, receiver);
31182
+ return typeof value === "function" ? value.bind(target) : value;
31183
+ },
31184
+ set: function(target, prop, value, receiver) {
31185
+ if (prop === "__timelines") {
31186
+ target.__timelines = value || {};
31187
+ __hfTimelineRegistryProxy = null;
31188
+ return true;
31189
+ }
31190
+ return Reflect.set(target, prop, value, receiver);
31191
+ },
31192
+ })
31193
+ : window;
31050
31194
  var __hfResolveGsapTarget = function(target) {
31051
31195
  if (typeof target !== "string") return target;
31052
31196
  return __hfQueryAll(target);
@@ -31118,9 +31262,9 @@ function wrapScopedCompositionScript(source, compositionId, errorLabel = "[Hyper
31118
31262
  });
31119
31263
  var __hfRun = function() {
31120
31264
  try {
31121
- (function(document, gsap) {
31265
+ (function(document, gsap, window) {
31122
31266
  ${source}
31123
- }).call(window, __hfScopedDocument, __hfScopedGsap);
31267
+ }).call(window, __hfScopedDocument, __hfScopedGsap, __hfScopedWindow);
31124
31268
  } catch (_err) {
31125
31269
  console.error(__hfErrorLabel, __hfCompId, _err);
31126
31270
  }
@@ -31165,7 +31309,7 @@ var init_staticGuard = __esm({
31165
31309
  });
31166
31310
 
31167
31311
  // ../core/src/compiler/htmlBundler.ts
31168
- import { readFileSync as readFileSync18, existsSync as existsSync28 } from "fs";
31312
+ import { readFileSync as readFileSync19, existsSync as existsSync28 } from "fs";
31169
31313
  import { join as join30, resolve as resolve12, isAbsolute as isAbsolute4, sep as sep2 } from "path";
31170
31314
  import { transformSync } from "esbuild";
31171
31315
  function parseHTMLContent2(html) {
@@ -31236,7 +31380,7 @@ function isRelativeUrl(url) {
31236
31380
  function safeReadFile(filePath) {
31237
31381
  if (!existsSync28(filePath)) return null;
31238
31382
  try {
31239
- return readFileSync18(filePath, "utf-8");
31383
+ return readFileSync19(filePath, "utf-8");
31240
31384
  } catch {
31241
31385
  return null;
31242
31386
  }
@@ -31244,7 +31388,7 @@ function safeReadFile(filePath) {
31244
31388
  function safeReadFileBuffer(filePath) {
31245
31389
  if (!existsSync28(filePath)) return null;
31246
31390
  try {
31247
- return readFileSync18(filePath);
31391
+ return readFileSync19(filePath);
31248
31392
  } catch {
31249
31393
  return null;
31250
31394
  }
@@ -31318,6 +31462,12 @@ function rewriteCssUrlsWithInlinedAssets(cssText, projectDir) {
31318
31462
  }
31319
31463
  );
31320
31464
  }
31465
+ function cssAttributeSelector(attr, value) {
31466
+ return `[${attr}="${value.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"]`;
31467
+ }
31468
+ function uniqueCompositionId(baseId, index) {
31469
+ return `${baseId}__hf${index}`;
31470
+ }
31321
31471
  function enforceCompositionPixelSizing(document2) {
31322
31472
  const compositionEls = [
31323
31473
  ...document2.querySelectorAll("[data-composition-id][data-width][data-height]")
@@ -31437,7 +31587,7 @@ function stripJsCommentsParserSafe(source) {
31437
31587
  async function bundleToSingleHtml(projectDir, options) {
31438
31588
  const indexPath = join30(projectDir, "index.html");
31439
31589
  if (!existsSync28(indexPath)) throw new Error("index.html not found in project directory");
31440
- const rawHtml = readFileSync18(indexPath, "utf-8");
31590
+ const rawHtml = readFileSync19(indexPath, "utf-8");
31441
31591
  const compiled = await compileHtml(rawHtml, projectDir, options?.probeMediaDuration);
31442
31592
  const staticGuard = validateHyperframeHtmlContract(compiled);
31443
31593
  if (!staticGuard.isValid) {
@@ -31508,7 +31658,15 @@ async function bundleToSingleHtml(projectDir, options) {
31508
31658
  const compStyleChunks = [];
31509
31659
  const compScriptChunks = [];
31510
31660
  const compExternalScriptSrcs = [];
31511
- for (const hostEl of [...document2.querySelectorAll("[data-composition-src]")]) {
31661
+ const subCompositionHosts = [...document2.querySelectorAll("[data-composition-src]")];
31662
+ const hostCountsByCompositionId = /* @__PURE__ */ new Map();
31663
+ for (const hostEl of subCompositionHosts) {
31664
+ const compId = (hostEl.getAttribute("data-composition-id") || "").trim();
31665
+ if (!compId) continue;
31666
+ hostCountsByCompositionId.set(compId, (hostCountsByCompositionId.get(compId) || 0) + 1);
31667
+ }
31668
+ const hostInstanceByCompositionId = /* @__PURE__ */ new Map();
31669
+ for (const hostEl of subCompositionHosts) {
31512
31670
  const src = hostEl.getAttribute("data-composition-src");
31513
31671
  if (!src || !isRelativeUrl(src)) continue;
31514
31672
  const compPath = safePath(projectDir, src);
@@ -31525,10 +31683,21 @@ async function bundleToSingleHtml(projectDir, options) {
31525
31683
  const innerRoot = compId ? contentDoc.querySelector(`[data-composition-id="${compId}"]`) : contentDoc.querySelector("[data-composition-id]");
31526
31684
  const inferredCompId = innerRoot?.getAttribute("data-composition-id")?.trim() || "";
31527
31685
  const scopeCompId = compId || inferredCompId;
31686
+ const duplicateInstance = scopeCompId && (hostCountsByCompositionId.get(scopeCompId) || 0) > 1;
31687
+ const instanceIndex = duplicateInstance ? (hostInstanceByCompositionId.get(scopeCompId) || 0) + 1 : 0;
31688
+ if (duplicateInstance) hostInstanceByCompositionId.set(scopeCompId, instanceIndex);
31689
+ const runtimeCompId = duplicateInstance && scopeCompId ? uniqueCompositionId(scopeCompId, instanceIndex) : scopeCompId;
31690
+ const runtimeScope = runtimeCompId ? cssAttributeSelector("data-composition-id", runtimeCompId) : "";
31691
+ if (duplicateInstance && runtimeCompId) {
31692
+ hostEl.setAttribute("data-hf-original-composition-id", scopeCompId);
31693
+ hostEl.setAttribute("data-composition-id", runtimeCompId);
31694
+ }
31528
31695
  if (!contentRoot && compDoc.head) {
31529
31696
  for (const s2 of [...compDoc.head.querySelectorAll("style")]) {
31530
31697
  const css = rewriteCssAssetUrls(s2.textContent || "", src);
31531
- compStyleChunks.push(scopeCompId ? scopeCssToComposition(css, scopeCompId) : css);
31698
+ compStyleChunks.push(
31699
+ scopeCompId ? scopeCssToComposition(css, scopeCompId, runtimeScope) : css
31700
+ );
31532
31701
  }
31533
31702
  for (const s2 of [...compDoc.head.querySelectorAll("script")]) {
31534
31703
  const externalSrc = (s2.getAttribute("src") || "").trim();
@@ -31539,7 +31708,9 @@ async function bundleToSingleHtml(projectDir, options) {
31539
31708
  }
31540
31709
  for (const s2 of [...contentDoc.querySelectorAll("style")]) {
31541
31710
  const css = rewriteCssAssetUrls(s2.textContent || "", src);
31542
- compStyleChunks.push(scopeCompId ? scopeCssToComposition(css, scopeCompId) : css);
31711
+ compStyleChunks.push(
31712
+ scopeCompId ? scopeCssToComposition(css, scopeCompId, runtimeScope) : css
31713
+ );
31543
31714
  s2.remove();
31544
31715
  }
31545
31716
  for (const s2 of [...contentDoc.querySelectorAll("script")]) {
@@ -31553,7 +31724,9 @@ async function bundleToSingleHtml(projectDir, options) {
31553
31724
  scopeCompId ? wrapScopedCompositionScript(
31554
31725
  s2.textContent || "",
31555
31726
  scopeCompId,
31556
- "[HyperFrames] composition script error:"
31727
+ "[HyperFrames] composition script error:",
31728
+ runtimeScope,
31729
+ runtimeCompId || scopeCompId
31557
31730
  ) : `(function(){ try { ${s2.textContent || ""} } catch (_err) { console.error('[HyperFrames] composition script error:', _err); } })();`
31558
31731
  );
31559
31732
  }
@@ -31731,8 +31904,8 @@ var init_compiler = __esm({
31731
31904
 
31732
31905
  // ../producer/src/services/hyperframeRuntimeLoader.ts
31733
31906
  import { createHash as createHash3 } from "crypto";
31734
- import { existsSync as existsSync29, readFileSync as readFileSync19 } from "fs";
31735
- import { dirname as dirname9, resolve as resolve13 } from "path";
31907
+ import { existsSync as existsSync29, readFileSync as readFileSync20 } from "fs";
31908
+ import { dirname as dirname10, resolve as resolve13 } from "path";
31736
31909
  import { fileURLToPath as fileURLToPath2 } from "url";
31737
31910
  function resolveHyperframeManifestPath() {
31738
31911
  if (process.env.PRODUCER_HYPERFRAME_MANIFEST_PATH) {
@@ -31760,7 +31933,7 @@ function resolveVerifiedHyperframeRuntime() {
31760
31933
  `[HyperframeRuntimeLoader] Missing manifest at ${manifestPath}. Build core runtime artifacts before rendering.`
31761
31934
  );
31762
31935
  }
31763
- const manifestRaw = readFileSync19(manifestPath, "utf8");
31936
+ const manifestRaw = readFileSync20(manifestPath, "utf8");
31764
31937
  const manifest = JSON.parse(manifestRaw);
31765
31938
  const runtimeFileName = manifest.artifacts?.iife;
31766
31939
  if (!runtimeFileName || !manifest.sha256) {
@@ -31768,11 +31941,11 @@ function resolveVerifiedHyperframeRuntime() {
31768
31941
  `[HyperframeRuntimeLoader] Invalid manifest at ${manifestPath}; missing iife artifact or sha256.`
31769
31942
  );
31770
31943
  }
31771
- const runtimePath = resolve13(dirname9(manifestPath), runtimeFileName);
31944
+ const runtimePath = resolve13(dirname10(manifestPath), runtimeFileName);
31772
31945
  if (!existsSync29(runtimePath)) {
31773
31946
  throw new Error(`[HyperframeRuntimeLoader] Missing runtime artifact at ${runtimePath}.`);
31774
31947
  }
31775
- const runtimeSource = readFileSync19(runtimePath, "utf8");
31948
+ const runtimeSource = readFileSync20(runtimePath, "utf8");
31776
31949
  const runtimeSha = createHash3("sha256").update(runtimeSource, "utf8").digest("hex");
31777
31950
  if (runtimeSha !== manifest.sha256) {
31778
31951
  throw new Error(
@@ -31791,7 +31964,7 @@ var PRODUCER_DIR, SIBLING_MANIFEST_PATH, MODULE_RELATIVE_MANIFEST_PATH, CWD_RELA
31791
31964
  var init_hyperframeRuntimeLoader = __esm({
31792
31965
  "../producer/src/services/hyperframeRuntimeLoader.ts"() {
31793
31966
  "use strict";
31794
- PRODUCER_DIR = dirname9(fileURLToPath2(import.meta.url));
31967
+ PRODUCER_DIR = dirname10(fileURLToPath2(import.meta.url));
31795
31968
  SIBLING_MANIFEST_PATH = resolve13(PRODUCER_DIR, "hyperframe.manifest.json");
31796
31969
  MODULE_RELATIVE_MANIFEST_PATH = resolve13(
31797
31970
  PRODUCER_DIR,
@@ -31811,7 +31984,7 @@ var init_hyperframeRuntimeLoader = __esm({
31811
31984
  // ../producer/src/services/fileServer.ts
31812
31985
  import { Hono as Hono3 } from "hono";
31813
31986
  import { serve as serve2 } from "@hono/node-server";
31814
- import { readFileSync as readFileSync20, existsSync as existsSync30, realpathSync, statSync as statSync8 } from "fs";
31987
+ import { readFileSync as readFileSync21, existsSync as existsSync30, realpathSync, statSync as statSync8 } from "fs";
31815
31988
  import { join as join31, extname as extname7, resolve as resolve14, sep as sep3 } from "path";
31816
31989
  function isPathInside(child, parent, options = {}) {
31817
31990
  const { resolveSymlinks = false, pathModule } = options;
@@ -31929,7 +32102,7 @@ function createFileServer2(options) {
31929
32102
  const ext = extname7(filePath).toLowerCase();
31930
32103
  const contentType = MIME_TYPES3[ext] || "application/octet-stream";
31931
32104
  if (ext === ".html") {
31932
- const rawHtml = readFileSync20(filePath, "utf-8");
32105
+ const rawHtml = readFileSync21(filePath, "utf-8");
31933
32106
  const isIndex = relativePath === "index.html";
31934
32107
  let html = rawHtml;
31935
32108
  if (preHeadScripts.length > 0) {
@@ -31938,7 +32111,7 @@ function createFileServer2(options) {
31938
32111
  html = isIndex ? injectScriptsIntoHtml2(html, headScripts, bodyScripts, stripEmbeddedRuntime) : html;
31939
32112
  return c2.text(html, 200, { "Content-Type": contentType });
31940
32113
  }
31941
- const content = readFileSync20(filePath);
32114
+ const content = readFileSync21(filePath);
31942
32115
  return new Response(content, {
31943
32116
  status: 200,
31944
32117
  headers: { "Content-Type": contentType }
@@ -32384,7 +32557,7 @@ var init_fontData_generated = __esm({
32384
32557
  });
32385
32558
 
32386
32559
  // ../producer/src/services/deterministicFonts.ts
32387
- import { existsSync as existsSync31, mkdirSync as mkdirSync18, readFileSync as readFileSync21, writeFileSync as writeFileSync13 } from "fs";
32560
+ import { existsSync as existsSync31, mkdirSync as mkdirSync18, readFileSync as readFileSync22, writeFileSync as writeFileSync14 } from "fs";
32388
32561
  import { homedir as homedir7 } from "os";
32389
32562
  import { join as join33 } from "path";
32390
32563
  function normalizeFamilyName(family) {
@@ -32535,12 +32708,12 @@ async function fetchGoogleFont(familyName) {
32535
32708
  const fontRes = await fetch(woff2Url);
32536
32709
  if (!fontRes.ok) continue;
32537
32710
  const buffer = Buffer.from(await fontRes.arrayBuffer());
32538
- writeFileSync13(cachePath2, buffer);
32711
+ writeFileSync14(cachePath2, buffer);
32539
32712
  } catch {
32540
32713
  continue;
32541
32714
  }
32542
32715
  }
32543
- const fontBytes = readFileSync21(cachePath2);
32716
+ const fontBytes = readFileSync22(cachePath2);
32544
32717
  const dataUri = `data:font/woff2;base64,${fontBytes.toString("base64")}`;
32545
32718
  faces.push({ weight, style, dataUri });
32546
32719
  }
@@ -32722,8 +32895,8 @@ var init_deterministicFonts = __esm({
32722
32895
  });
32723
32896
 
32724
32897
  // ../producer/src/services/htmlCompiler.ts
32725
- import { readFileSync as readFileSync22, existsSync as existsSync32, mkdirSync as mkdirSync19 } from "fs";
32726
- import { join as join34, dirname as dirname10, resolve as resolve16 } from "path";
32898
+ import { readFileSync as readFileSync23, existsSync as existsSync32, mkdirSync as mkdirSync19 } from "fs";
32899
+ import { join as join34, dirname as dirname11, resolve as resolve16 } from "path";
32727
32900
  function dedupeElementsById(elements) {
32728
32901
  const deduped = /* @__PURE__ */ new Map();
32729
32902
  for (const element of elements) {
@@ -32874,7 +33047,7 @@ async function parseSubCompositions(html, projectDir, downloadDir, parentOffset
32874
33047
  if (!existsSync32(filePath)) {
32875
33048
  continue;
32876
33049
  }
32877
- const rawSubHtml = readFileSync22(filePath, "utf-8");
33050
+ const rawSubHtml = readFileSync23(filePath, "utf-8");
32878
33051
  const nestedVisited = new Set(visited);
32879
33052
  nestedVisited.add(filePath);
32880
33053
  workItems.push({ srcPath, absoluteStart, absoluteEnd, filePath, rawSubHtml, nestedVisited });
@@ -32883,7 +33056,7 @@ async function parseSubCompositions(html, projectDir, downloadDir, parentOffset
32883
33056
  workItems.map(async (item) => {
32884
33057
  const { html: compiledSub } = await compileHtmlFile(
32885
33058
  item.rawSubHtml,
32886
- dirname10(item.filePath),
33059
+ dirname11(item.filePath),
32887
33060
  downloadDir
32888
33061
  );
32889
33062
  const nested = await parseSubCompositions(
@@ -33061,7 +33234,7 @@ function inlineSubCompositions(html, subCompositions, projectDir) {
33061
33234
  if (!compHtml) {
33062
33235
  const filePath = resolve16(projectDir, srcPath);
33063
33236
  if (existsSync32(filePath)) {
33064
- compHtml = readFileSync22(filePath, "utf-8");
33237
+ compHtml = readFileSync23(filePath, "utf-8");
33065
33238
  }
33066
33239
  }
33067
33240
  if (!compHtml) {
@@ -33307,7 +33480,7 @@ function collectExternalAssets(html, projectDir) {
33307
33480
  };
33308
33481
  }
33309
33482
  async function compileForRender(projectDir, htmlPath, downloadDir) {
33310
- const rawHtml = readFileSync22(htmlPath, "utf-8");
33483
+ const rawHtml = readFileSync23(htmlPath, "utf-8");
33311
33484
  const { html: compiledHtml, unresolvedCompositions } = await compileHtmlFile(
33312
33485
  rawHtml,
33313
33486
  projectDir,
@@ -33616,17 +33789,17 @@ import {
33616
33789
  existsSync as existsSync33,
33617
33790
  mkdirSync as mkdirSync20,
33618
33791
  rmSync as rmSync7,
33619
- readFileSync as readFileSync23,
33792
+ readFileSync as readFileSync24,
33620
33793
  openSync,
33621
33794
  readSync,
33622
33795
  closeSync,
33623
33796
  readdirSync as readdirSync12,
33624
33797
  statSync as statSync9,
33625
- writeFileSync as writeFileSync14,
33798
+ writeFileSync as writeFileSync15,
33626
33799
  copyFileSync as copyFileSync2,
33627
33800
  appendFileSync
33628
33801
  } from "fs";
33629
- import { join as join35, dirname as dirname11, resolve as resolve17 } from "path";
33802
+ import { join as join35, dirname as dirname12, resolve as resolve17 } from "path";
33630
33803
  import { randomUUID as randomUUID2 } from "crypto";
33631
33804
  import { freemem as freemem2 } from "os";
33632
33805
  import { fileURLToPath as fileURLToPath3 } from "url";
@@ -33817,11 +33990,11 @@ function installDebugLogger(logPath, log2 = defaultLogger) {
33817
33990
  function writeCompiledArtifacts(compiled, workDir, includeSummary) {
33818
33991
  const compileDir = join35(workDir, "compiled");
33819
33992
  mkdirSync20(compileDir, { recursive: true });
33820
- writeFileSync14(join35(compileDir, "index.html"), compiled.html, "utf-8");
33993
+ writeFileSync15(join35(compileDir, "index.html"), compiled.html, "utf-8");
33821
33994
  for (const [srcPath, html] of compiled.subCompositions) {
33822
33995
  const outPath = join35(compileDir, srcPath);
33823
- mkdirSync20(dirname11(outPath), { recursive: true });
33824
- writeFileSync14(outPath, html, "utf-8");
33996
+ mkdirSync20(dirname12(outPath), { recursive: true });
33997
+ writeFileSync15(outPath, html, "utf-8");
33825
33998
  }
33826
33999
  for (const [relativePath, absolutePath] of compiled.externalAssets) {
33827
34000
  const outPath = resolve17(join35(compileDir, relativePath));
@@ -33829,7 +34002,7 @@ function writeCompiledArtifacts(compiled, workDir, includeSummary) {
33829
34002
  console.warn(`[Render] Skipping external asset with unsafe path: ${relativePath}`);
33830
34003
  continue;
33831
34004
  }
33832
- mkdirSync20(dirname11(outPath), { recursive: true });
34005
+ mkdirSync20(dirname12(outPath), { recursive: true });
33833
34006
  copyFileSync2(absolutePath, outPath);
33834
34007
  }
33835
34008
  if (includeSummary) {
@@ -33855,7 +34028,7 @@ function writeCompiledArtifacts(compiled, workDir, includeSummary) {
33855
34028
  renderModeHints: compiled.renderModeHints,
33856
34029
  hasShaderTransitions: compiled.hasShaderTransitions
33857
34030
  };
33858
- writeFileSync14(join35(compileDir, "summary.json"), JSON.stringify(summary, null, 2), "utf-8");
34031
+ writeFileSync15(join35(compileDir, "summary.json"), JSON.stringify(summary, null, 2), "utf-8");
33859
34032
  }
33860
34033
  }
33861
34034
  function applyRenderModeHints(cfg, compiled, log2 = defaultLogger) {
@@ -34021,7 +34194,7 @@ function isRecoverableParallelCaptureError(error) {
34021
34194
  }
34022
34195
  function shouldFallbackToScreenshotAfterCalibrationError(error) {
34023
34196
  const message = error instanceof Error ? error.message : String(error);
34024
- return /HeadlessExperimental\.beginFrame timed out|beginFrame probe timeout|Another frame is pending|Frame still pending|Protocol error.*HeadlessExperimental\.beginFrame/i.test(
34197
+ return /HeadlessExperimental\.beginFrame timed out|beginFrame probe timeout|Another frame is pending|Frame still pending|Protocol error.*HeadlessExperimental\.beginFrame|Runtime\.callFunctionOn timed out|Runtime\.evaluate timed out/i.test(
34025
34198
  message
34026
34199
  );
34027
34200
  }
@@ -34484,7 +34657,7 @@ async function compositeHdrFrame(ctx, canvas, time, fullStacking, elementFilter,
34484
34657
  const after2 = countNonZeroRgb48(canvas);
34485
34658
  const dumpName = `frame_${String(debugFrameIndex).padStart(4, "0")}_layer_${String(layerIdx).padStart(2, "0")}_dom.png`;
34486
34659
  const dumpPath = join35(debugDumpDir, dumpName);
34487
- writeFileSync14(dumpPath, domPng);
34660
+ writeFileSync15(dumpPath, domPng);
34488
34661
  log2.info("[diag] dom layer blit", {
34489
34662
  frame: debugFrameIndex,
34490
34663
  layerIdx,
@@ -34555,10 +34728,10 @@ function extractStandaloneEntryFromIndex(indexHtml, entryFile) {
34555
34728
  return document2.toString();
34556
34729
  }
34557
34730
  async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSignal) {
34558
- const moduleDir = dirname11(fileURLToPath3(import.meta.url));
34731
+ const moduleDir = dirname12(fileURLToPath3(import.meta.url));
34559
34732
  const producerRoot = process.env.PRODUCER_RENDERS_DIR ? resolve17(process.env.PRODUCER_RENDERS_DIR, "..") : resolve17(moduleDir, "../..");
34560
34733
  const debugDir = join35(producerRoot, ".debug");
34561
- const workDir = job.config.debug ? join35(debugDir, job.id) : join35(dirname11(outputPath), `work-${job.id}`);
34734
+ const workDir = job.config.debug ? join35(debugDir, job.id) : join35(dirname12(outputPath), `work-${job.id}`);
34562
34735
  const pipelineStart = Date.now();
34563
34736
  const log2 = job.config.logger ?? defaultLogger;
34564
34737
  let fileServer = null;
@@ -34616,7 +34789,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
34616
34789
  throw new Error(`Entry file not found: ${htmlPath}`);
34617
34790
  }
34618
34791
  assertNotAborted();
34619
- const rawEntry = readFileSync23(htmlPath, "utf-8");
34792
+ const rawEntry = readFileSync24(htmlPath, "utf-8");
34620
34793
  if (entryFile !== "index.html" && rawEntry.trimStart().startsWith("<template")) {
34621
34794
  const wrapperPath = join35(workDir, "standalone-entry.html");
34622
34795
  const projectIndexPath = join35(projectDir, "index.html");
@@ -34626,7 +34799,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
34626
34799
  );
34627
34800
  }
34628
34801
  const standaloneHtml = extractStandaloneEntryFromIndex(
34629
- readFileSync23(projectIndexPath, "utf-8"),
34802
+ readFileSync24(projectIndexPath, "utf-8"),
34630
34803
  entryFile
34631
34804
  );
34632
34805
  if (!standaloneHtml) {
@@ -34634,7 +34807,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
34634
34807
  `Entry file "${entryFile}" is not mounted from index.html via data-composition-src, so it cannot be rendered independently.`
34635
34808
  );
34636
34809
  }
34637
- writeFileSync14(wrapperPath, standaloneHtml, "utf-8");
34810
+ writeFileSync15(wrapperPath, standaloneHtml, "utf-8");
34638
34811
  htmlPath = wrapperPath;
34639
34812
  log2.info("Extracted standalone entry from index.html host context", {
34640
34813
  entryFile
@@ -35364,7 +35537,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
35364
35537
  const hdrImageBuffers = /* @__PURE__ */ new Map();
35365
35538
  for (const [imageId, srcPath] of hdrImageSrcPaths) {
35366
35539
  try {
35367
- const decoded = decodePngToRgb48le(readFileSync23(srcPath));
35540
+ const decoded = decodePngToRgb48le(readFileSync24(srcPath));
35368
35541
  const layout2 = hdrExtractionDims.get(imageId);
35369
35542
  const fitInfo = hdrImageFitInfo.get(imageId);
35370
35543
  if (layout2 && (layout2.width !== decoded.width || layout2.height !== decoded.height)) {
@@ -35602,7 +35775,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
35602
35775
  debugDumpDir,
35603
35776
  `frame_${String(i2).padStart(4, "0")}_final_rgb48le.bin`
35604
35777
  );
35605
- writeFileSync14(previewPath, normalCanvas);
35778
+ writeFileSync15(previewPath, normalCanvas);
35606
35779
  }
35607
35780
  timingStart = Date.now();
35608
35781
  hdrEncoder.writeFrame(normalCanvas);
@@ -36013,7 +36186,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
36013
36186
  job.perfSummary = perfSummary;
36014
36187
  if (job.config.debug) {
36015
36188
  try {
36016
- writeFileSync14(perfOutputPath, JSON.stringify(perfSummary, null, 2), "utf-8");
36189
+ writeFileSync15(perfOutputPath, JSON.stringify(perfSummary, null, 2), "utf-8");
36017
36190
  } catch (err) {
36018
36191
  log2.debug("Failed to write perf summary", {
36019
36192
  perfOutputPath,
@@ -36171,7 +36344,7 @@ var init_config3 = __esm({
36171
36344
  });
36172
36345
 
36173
36346
  // ../producer/src/services/hyperframeLint.ts
36174
- import { existsSync as existsSync34, readFileSync as readFileSync24, statSync as statSync10 } from "fs";
36347
+ import { existsSync as existsSync34, readFileSync as readFileSync25, statSync as statSync10 } from "fs";
36175
36348
  import { resolve as resolve18, join as join36 } from "path";
36176
36349
  function isStringRecord(value) {
36177
36350
  if (!value || typeof value !== "object" || Array.isArray(value)) {
@@ -36214,7 +36387,7 @@ function readProjectEntryFile(projectDir, preferredEntryFile) {
36214
36387
  if (existsSync34(absoluteEntryPath) && statSync10(absoluteEntryPath).isFile()) {
36215
36388
  return {
36216
36389
  entryFile,
36217
- html: readFileSync24(absoluteEntryPath, "utf-8"),
36390
+ html: readFileSync25(absoluteEntryPath, "utf-8"),
36218
36391
  source: "projectDir"
36219
36392
  };
36220
36393
  }
@@ -36312,11 +36485,11 @@ import {
36312
36485
  mkdirSync as mkdirSync21,
36313
36486
  statSync as statSync11,
36314
36487
  mkdtempSync as mkdtempSync2,
36315
- writeFileSync as writeFileSync15,
36488
+ writeFileSync as writeFileSync16,
36316
36489
  rmSync as rmSync8,
36317
36490
  createReadStream
36318
36491
  } from "fs";
36319
- import { resolve as resolve19, dirname as dirname12, join as join37 } from "path";
36492
+ import { resolve as resolve19, dirname as dirname13, join as join37 } from "path";
36320
36493
  import { tmpdir as tmpdir3 } from "os";
36321
36494
  import { parseArgs as parseArgs2 } from "util";
36322
36495
  import crypto2 from "crypto";
@@ -36369,7 +36542,7 @@ async function prepareRenderBody(body) {
36369
36542
  }
36370
36543
  const tempRoot = process.env.PRODUCER_TMP_PROJECT_DIR || tmpdir3();
36371
36544
  const tempProjectDir = mkdtempSync2(join37(tempRoot, "producer-project-"));
36372
- writeFileSync15(join37(tempProjectDir, "index.html"), htmlContent, "utf-8");
36545
+ writeFileSync16(join37(tempProjectDir, "index.html"), htmlContent, "utf-8");
36373
36546
  return {
36374
36547
  prepared: {
36375
36548
  input: {
@@ -36491,7 +36664,7 @@ function createRenderHandlers(options = {}) {
36491
36664
  rendersDir,
36492
36665
  log2
36493
36666
  );
36494
- const outputDir = dirname12(absoluteOutputPath);
36667
+ const outputDir = dirname13(absoluteOutputPath);
36495
36668
  if (!existsSync35(outputDir)) mkdirSync21(outputDir, { recursive: true });
36496
36669
  const release2 = await renderSemaphore.acquire();
36497
36670
  log2.info("render started", {
@@ -36602,7 +36775,7 @@ function createRenderHandlers(options = {}) {
36602
36775
  rendersDir,
36603
36776
  log2
36604
36777
  );
36605
- const outputDir = dirname12(absoluteOutputPath);
36778
+ const outputDir = dirname13(absoluteOutputPath);
36606
36779
  if (!existsSync35(outputDir)) mkdirSync21(outputDir, { recursive: true });
36607
36780
  log2.info("render-stream started", { requestId, projectDir: input.projectDir });
36608
36781
  const job = createRenderJob({
@@ -36845,7 +37018,7 @@ __export(studioServer_exports, {
36845
37018
  });
36846
37019
  import { Hono as Hono5 } from "hono";
36847
37020
  import { streamSSE as streamSSE3 } from "hono/streaming";
36848
- import { existsSync as existsSync36, readFileSync as readFileSync25, writeFileSync as writeFileSync16, statSync as statSync12 } from "fs";
37021
+ import { existsSync as existsSync36, readFileSync as readFileSync26, writeFileSync as writeFileSync17, statSync as statSync12 } from "fs";
36849
37022
  import { resolve as resolve20, join as join38, basename as basename3 } from "path";
36850
37023
  function resolveDistDir() {
36851
37024
  return resolveStudioBundle().dir;
@@ -36982,7 +37155,7 @@ function createStudioServer(options) {
36982
37155
  state.status = "complete";
36983
37156
  state.progress = 100;
36984
37157
  const metaPath = opts.outputPath.replace(/\.(mp4|webm|mov)$/, ".meta.json");
36985
- writeFileSync16(
37158
+ writeFileSync17(
36986
37159
  metaPath,
36987
37160
  JSON.stringify({ status: "complete", durationMs: Date.now() - startTime })
36988
37161
  );
@@ -36991,7 +37164,7 @@ function createStudioServer(options) {
36991
37164
  state.error = err instanceof Error ? err.message : String(err);
36992
37165
  try {
36993
37166
  const metaPath = opts.outputPath.replace(/\.(mp4|webm|mov)$/, ".meta.json");
36994
- writeFileSync16(metaPath, JSON.stringify({ status: "failed" }));
37167
+ writeFileSync17(metaPath, JSON.stringify({ status: "failed" }));
36995
37168
  } catch {
36996
37169
  }
36997
37170
  }
@@ -37039,11 +37212,16 @@ function createStudioServer(options) {
37039
37212
  };
37040
37213
  }, opts.selector);
37041
37214
  }
37042
- const screenshot = await page.screenshot({
37043
- type: "jpeg",
37044
- quality: 80,
37045
- ...clip ? { clip } : {}
37046
- });
37215
+ const screenshot = await page.screenshot(
37216
+ opts.format === "png" ? {
37217
+ type: "png",
37218
+ ...clip ? { clip } : {}
37219
+ } : {
37220
+ type: "jpeg",
37221
+ quality: 80,
37222
+ ...clip ? { clip } : {}
37223
+ }
37224
+ );
37047
37225
  return screenshot;
37048
37226
  } catch {
37049
37227
  return null;
@@ -37064,7 +37242,7 @@ function createStudioServer(options) {
37064
37242
  });
37065
37243
  app.get("/api/runtime.js", (c2) => {
37066
37244
  const serve4 = async () => {
37067
- const runtimeSource = await loadRuntimeSource() ?? (existsSync36(runtimePath) ? readFileSync25(runtimePath, "utf-8") : null);
37245
+ const runtimeSource = await loadRuntimeSource() ?? (existsSync36(runtimePath) ? readFileSync26(runtimePath, "utf-8") : null);
37068
37246
  if (!runtimeSource) return c2.text("runtime not available", 404);
37069
37247
  return c2.body(runtimeSource, 200, {
37070
37248
  "Content-Type": "text/javascript",
@@ -37101,7 +37279,7 @@ function createStudioServer(options) {
37101
37279
  app.get("/assets/*", (c2) => {
37102
37280
  const filePath = resolve20(studioDir, c2.req.path.slice(1));
37103
37281
  if (!existsSync36(filePath) || !statSync12(filePath).isFile()) return c2.text("not found", 404);
37104
- const content = readFileSync25(filePath);
37282
+ const content = readFileSync26(filePath);
37105
37283
  return new Response(content, {
37106
37284
  headers: { "Content-Type": getMimeType(filePath), "Cache-Control": "no-store" }
37107
37285
  });
@@ -37109,7 +37287,7 @@ function createStudioServer(options) {
37109
37287
  app.get("/icons/*", (c2) => {
37110
37288
  const filePath = resolve20(studioDir, c2.req.path.slice(1));
37111
37289
  if (!existsSync36(filePath) || !statSync12(filePath).isFile()) return c2.text("not found", 404);
37112
- const content = readFileSync25(filePath);
37290
+ const content = readFileSync26(filePath);
37113
37291
  return new Response(content, {
37114
37292
  headers: { "Content-Type": getMimeType(filePath), "Cache-Control": "no-store" }
37115
37293
  });
@@ -37172,7 +37350,7 @@ function createStudioServer(options) {
37172
37350
  500
37173
37351
  );
37174
37352
  }
37175
- return c2.html(readFileSync25(indexPath, "utf-8"));
37353
+ return c2.html(readFileSync26(indexPath, "utf-8"));
37176
37354
  });
37177
37355
  return { app, watcher };
37178
37356
  }
@@ -37197,12 +37375,12 @@ __export(preview_exports, {
37197
37375
  });
37198
37376
  import { spawn as spawn9 } from "child_process";
37199
37377
  import { existsSync as existsSync37, lstatSync, symlinkSync, unlinkSync as unlinkSync5, readlinkSync, mkdirSync as mkdirSync22 } from "fs";
37200
- import { resolve as resolve21, dirname as dirname13, basename as basename4, join as join39 } from "path";
37378
+ import { resolve as resolve21, dirname as dirname14, basename as basename4, join as join39 } from "path";
37201
37379
  import { fileURLToPath as fileURLToPath4 } from "url";
37202
37380
  import { createRequire } from "module";
37203
37381
  async function runDevMode(dir, projectName) {
37204
37382
  const thisFile = fileURLToPath4(import.meta.url);
37205
- const repoRoot = resolve21(dirname13(thisFile), "..", "..", "..", "..");
37383
+ const repoRoot = resolve21(dirname14(thisFile), "..", "..", "..", "..");
37206
37384
  const projectsDir = join39(repoRoot, "packages", "studio", "data", "projects");
37207
37385
  const pName = projectName ?? basename4(dir);
37208
37386
  const symlinkPath = join39(projectsDir, pName);
@@ -37283,7 +37461,7 @@ function hasLocalStudio(dir) {
37283
37461
  }
37284
37462
  async function runLocalStudioMode(dir, projectName) {
37285
37463
  const req = createRequire(join39(dir, "package.json"));
37286
- const studioPkgPath = dirname13(req.resolve("@hyperframes/studio/package.json"));
37464
+ const studioPkgPath = dirname14(req.resolve("@hyperframes/studio/package.json"));
37287
37465
  const pName = projectName ?? basename4(dir);
37288
37466
  const projectsDir = join39(studioPkgPath, "data", "projects");
37289
37467
  const symlinkPath = join39(projectsDir, pName);
@@ -37544,11 +37722,11 @@ import {
37544
37722
  mkdirSync as mkdirSync23,
37545
37723
  copyFileSync as copyFileSync3,
37546
37724
  cpSync,
37547
- writeFileSync as writeFileSync17,
37548
- readFileSync as readFileSync26,
37725
+ writeFileSync as writeFileSync18,
37726
+ readFileSync as readFileSync27,
37549
37727
  readdirSync as readdirSync13
37550
37728
  } from "fs";
37551
- import { resolve as resolve22, basename as basename5, join as join40, dirname as dirname14 } from "path";
37729
+ import { resolve as resolve22, basename as basename5, join as join40, dirname as dirname15 } from "path";
37552
37730
  import { fileURLToPath as fileURLToPath5 } from "url";
37553
37731
  import { execFileSync as execFileSync4, spawn as spawn10 } from "child_process";
37554
37732
  function probeVideo(filePath) {
@@ -37617,7 +37795,7 @@ function transcodeToMp4(inputPath, outputPath) {
37617
37795
  });
37618
37796
  }
37619
37797
  function resolveAssetDir(devSegments, builtSegments) {
37620
- const base = dirname14(fileURLToPath5(import.meta.url));
37798
+ const base = dirname15(fileURLToPath5(import.meta.url));
37621
37799
  const devPath = resolve22(base, ...devSegments);
37622
37800
  const builtPath = resolve22(base, ...builtSegments);
37623
37801
  return existsSync38(devPath) ? devPath : builtPath;
@@ -37631,7 +37809,7 @@ function getSharedTemplateDir() {
37631
37809
  function patchVideoSrc(dir, videoFilename, durationSeconds) {
37632
37810
  const htmlFiles = readdirSync13(dir, { withFileTypes: true, recursive: true }).filter((e2) => e2.isFile() && e2.name.endsWith(".html")).map((e2) => join40(e2.parentPath ?? e2.path, e2.name));
37633
37811
  for (const file of htmlFiles) {
37634
- let content = readFileSync26(file, "utf-8");
37812
+ let content = readFileSync27(file, "utf-8");
37635
37813
  if (videoFilename) {
37636
37814
  content = content.replaceAll("__VIDEO_SRC__", videoFilename);
37637
37815
  } else {
@@ -37642,7 +37820,7 @@ function patchVideoSrc(dir, videoFilename, durationSeconds) {
37642
37820
  }
37643
37821
  const dur = durationSeconds ? String(Math.round(durationSeconds * 100) / 100) : "10";
37644
37822
  content = content.replaceAll("__VIDEO_DURATION__", dur);
37645
- writeFileSync17(file, content, "utf-8");
37823
+ writeFileSync18(file, content, "utf-8");
37646
37824
  }
37647
37825
  }
37648
37826
  async function patchTranscript(dir, transcriptPath) {
@@ -37742,7 +37920,7 @@ async function scaffoldProject(destDir, name, templateId, localVideoName, durati
37742
37920
  await fetchRemoteTemplate(templateId, destDir);
37743
37921
  }
37744
37922
  patchVideoSrc(destDir, localVideoName, durationSeconds);
37745
- writeFileSync17(
37923
+ writeFileSync18(
37746
37924
  resolve22(destDir, "meta.json"),
37747
37925
  JSON.stringify(
37748
37926
  {
@@ -38580,10 +38758,10 @@ __export(play_exports, {
38580
38758
  default: () => play_default,
38581
38759
  examples: () => examples5
38582
38760
  });
38583
- import { existsSync as existsSync41, readFileSync as readFileSync27 } from "fs";
38584
- import { resolve as resolve26, dirname as dirname15 } from "path";
38761
+ import { existsSync as existsSync41, readFileSync as readFileSync28 } from "fs";
38762
+ import { resolve as resolve26, dirname as dirname16 } from "path";
38585
38763
  function commandDir() {
38586
- return dirname15(new URL(import.meta.url).pathname);
38764
+ return dirname16(new URL(import.meta.url).pathname);
38587
38765
  }
38588
38766
  function resolveRuntimePath2() {
38589
38767
  const d = commandDir();
@@ -38696,13 +38874,13 @@ var init_play = __esm({
38696
38874
  const { createAdaptorServer } = await import("@hono/node-server");
38697
38875
  const app = new Hono6();
38698
38876
  app.get("/player.js", (ctx) => {
38699
- return ctx.body(readFileSync27(playerPath, "utf-8"), 200, {
38877
+ return ctx.body(readFileSync28(playerPath, "utf-8"), 200, {
38700
38878
  "Content-Type": "application/javascript",
38701
38879
  "Cache-Control": "no-cache"
38702
38880
  });
38703
38881
  });
38704
38882
  app.get("/runtime.js", (ctx) => {
38705
- return ctx.body(readFileSync27(runtimePath, "utf-8"), 200, {
38883
+ return ctx.body(readFileSync28(runtimePath, "utf-8"), 200, {
38706
38884
  "Content-Type": "application/javascript",
38707
38885
  "Cache-Control": "no-cache"
38708
38886
  });
@@ -38712,7 +38890,7 @@ var init_play = __esm({
38712
38890
  const filePath = resolve26(project.dir, reqPath);
38713
38891
  if (!filePath.startsWith(project.dir)) return ctx.text("Forbidden", 403);
38714
38892
  if (!existsSync41(filePath)) return ctx.text("Not found", 404);
38715
- const content = readFileSync27(filePath, "utf-8");
38893
+ const content = readFileSync28(filePath, "utf-8");
38716
38894
  if (filePath.endsWith(".html")) {
38717
38895
  const injected = injectRuntime(content);
38718
38896
  return ctx.html(injected);
@@ -38731,7 +38909,7 @@ var init_play = __esm({
38731
38909
  mp3: "audio/mpeg",
38732
38910
  wav: "audio/wav"
38733
38911
  };
38734
- return ctx.body(readFileSync27(filePath), 200, {
38912
+ return ctx.body(readFileSync28(filePath), 200, {
38735
38913
  "Content-Type": types3[ext] ?? "application/octet-stream"
38736
38914
  });
38737
38915
  });
@@ -38788,7 +38966,7 @@ var init_play = __esm({
38788
38966
 
38789
38967
  // src/utils/publishProject.ts
38790
38968
  import { basename as basename7, join as join41, relative as relative4 } from "path";
38791
- import { readdirSync as readdirSync14, readFileSync as readFileSync28, statSync as statSync14 } from "fs";
38969
+ import { readdirSync as readdirSync14, readFileSync as readFileSync29, statSync as statSync14 } from "fs";
38792
38970
  import AdmZip from "adm-zip";
38793
38971
  function isRecord(value) {
38794
38972
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -38898,7 +39076,7 @@ function createPublishArchive(projectDir) {
38898
39076
  }
38899
39077
  const archive = new AdmZip();
38900
39078
  for (const filePath of filePaths) {
38901
- archive.addFile(filePath, readFileSync28(join41(projectDir, filePath)));
39079
+ archive.addFile(filePath, readFileSync29(join41(projectDir, filePath)));
38902
39080
  }
38903
39081
  return {
38904
39082
  buffer: archive.toBuffer(),
@@ -39222,9 +39400,9 @@ __export(render_exports, {
39222
39400
  default: () => render_default,
39223
39401
  examples: () => examples7
39224
39402
  });
39225
- import { mkdirSync as mkdirSync24, readFileSync as readFileSync29, statSync as statSync15, writeFileSync as writeFileSync18, rmSync as rmSync9 } from "fs";
39403
+ import { mkdirSync as mkdirSync24, readFileSync as readFileSync30, statSync as statSync15, writeFileSync as writeFileSync19, rmSync as rmSync9 } from "fs";
39226
39404
  import { cpus as cpus3, freemem as freemem3, tmpdir as tmpdir4 } from "os";
39227
- import { resolve as resolve28, dirname as dirname16, join as join43, basename as basename9 } from "path";
39405
+ import { resolve as resolve28, dirname as dirname17, join as join43, basename as basename9 } from "path";
39228
39406
  import { execFileSync as execFileSync5, spawn as spawn11 } from "child_process";
39229
39407
  function dockerImageTag(version) {
39230
39408
  return `${DOCKER_IMAGE_PREFIX}:${version}`;
@@ -39260,7 +39438,7 @@ function ensureDockerImage(version, quiet) {
39260
39438
  const dockerfilePath = resolveDockerfilePath();
39261
39439
  const tmpDir = join43(tmpdir4(), `hyperframes-docker-${Date.now()}`);
39262
39440
  mkdirSync24(tmpDir, { recursive: true });
39263
- writeFileSync18(join43(tmpDir, "Dockerfile"), readFileSync29(dockerfilePath));
39441
+ writeFileSync19(join43(tmpDir, "Dockerfile"), readFileSync30(dockerfilePath));
39264
39442
  try {
39265
39443
  execFileSync5(
39266
39444
  "docker",
@@ -39304,7 +39482,7 @@ async function renderDocker(projectDir, outputPath, options) {
39304
39482
  );
39305
39483
  process.exit(1);
39306
39484
  }
39307
- const outputDir = dirname16(outputPath);
39485
+ const outputDir = dirname17(outputPath);
39308
39486
  const outputFilename = basename9(outputPath);
39309
39487
  const dockerArgs = buildDockerRunArgs({
39310
39488
  imageTag,
@@ -39614,7 +39792,7 @@ var init_render2 = __esm({
39614
39792
  const datePart = now.toISOString().slice(0, 10);
39615
39793
  const timePart = now.toTimeString().slice(0, 8).replace(/:/g, "-");
39616
39794
  const outputPath = args.output ? resolve28(args.output) : join43(rendersDir, `${project.name}_${datePart}_${timePart}${ext}`);
39617
- mkdirSync24(dirname16(outputPath), { recursive: true });
39795
+ mkdirSync24(dirname17(outputPath), { recursive: true });
39618
39796
  const useDocker = args.docker ?? false;
39619
39797
  const useGpu = args.gpu ?? false;
39620
39798
  const quiet = args.quiet ?? false;
@@ -40092,8 +40270,8 @@ __export(layout_exports, {
40092
40270
  examples: () => examples9
40093
40271
  });
40094
40272
  import { createServer } from "http";
40095
- import { existsSync as existsSync43, readFileSync as readFileSync30 } from "fs";
40096
- import { dirname as dirname17, isAbsolute as isAbsolute6, join as join44, relative as relative5, resolve as resolve29 } from "path";
40273
+ import { existsSync as existsSync43, readFileSync as readFileSync31 } from "fs";
40274
+ import { dirname as dirname18, isAbsolute as isAbsolute6, join as join44, relative as relative5, resolve as resolve29 } from "path";
40097
40275
  import { fileURLToPath as fileURLToPath6 } from "url";
40098
40276
  async function getCompositionDuration2(page) {
40099
40277
  return page.evaluate(() => {
@@ -40164,7 +40342,7 @@ async function bundleProjectHtml(projectDir) {
40164
40342
  "hyperframe.runtime.iife.js"
40165
40343
  );
40166
40344
  if (existsSync43(runtimePath)) {
40167
- const runtimeSource = readFileSync30(runtimePath, "utf-8");
40345
+ const runtimeSource = readFileSync31(runtimePath, "utf-8");
40168
40346
  html = html.replace(
40169
40347
  /<script[^>]*data-hyperframes-preview-runtime[^>]*src="[^"]*"[^>]*><\/script>/,
40170
40348
  () => `<script data-hyperframes-preview-runtime="1">${runtimeSource}</script>`
@@ -40190,7 +40368,7 @@ async function serveProject(projectDir, html) {
40190
40368
  }
40191
40369
  if (existsSync43(filePath)) {
40192
40370
  res.writeHead(200, { "Content-Type": getMimeType2(filePath) });
40193
- res.end(readFileSync30(filePath));
40371
+ res.end(readFileSync31(filePath));
40194
40372
  return;
40195
40373
  }
40196
40374
  res.writeHead(404);
@@ -40296,7 +40474,7 @@ function loadLayoutAuditScript() {
40296
40474
  join44(__dirname2, "commands", "layout-audit.browser.js")
40297
40475
  ];
40298
40476
  for (const candidate of candidates) {
40299
- if (existsSync43(candidate)) return readFileSync30(candidate, "utf-8");
40477
+ if (existsSync43(candidate)) return readFileSync31(candidate, "utf-8");
40300
40478
  }
40301
40479
  throw new Error("Missing layout audit browser script");
40302
40480
  }
@@ -40462,7 +40640,7 @@ var init_layout2 = __esm({
40462
40640
  init_updateCheck();
40463
40641
  init_layoutAudit();
40464
40642
  __filename = fileURLToPath6(import.meta.url);
40465
- __dirname2 = dirname17(__filename);
40643
+ __dirname2 = dirname18(__filename);
40466
40644
  SEEK_SETTLE_MS = 120;
40467
40645
  INSPECT_SCHEMA_VERSION = 1;
40468
40646
  examples9 = [
@@ -40516,7 +40694,7 @@ __export(info_exports, {
40516
40694
  default: () => info_default,
40517
40695
  examples: () => examples11
40518
40696
  });
40519
- import { readFileSync as readFileSync31, readdirSync as readdirSync15, statSync as statSync16 } from "fs";
40697
+ import { readFileSync as readFileSync32, readdirSync as readdirSync15, statSync as statSync16 } from "fs";
40520
40698
  import { join as join45 } from "path";
40521
40699
  function totalSize(dir) {
40522
40700
  let total = 0;
@@ -40553,7 +40731,7 @@ var init_info = __esm({
40553
40731
  },
40554
40732
  async run({ args }) {
40555
40733
  const project = resolveProject(args.dir);
40556
- const html = readFileSync31(project.indexPath, "utf-8");
40734
+ const html = readFileSync32(project.indexPath, "utf-8");
40557
40735
  ensureDOMParser();
40558
40736
  const parsed = parseHtml(html);
40559
40737
  const tracks = new Set(parsed.elements.map((el) => el.zIndex));
@@ -40609,8 +40787,8 @@ __export(compositions_exports, {
40609
40787
  default: () => compositions_default,
40610
40788
  examples: () => examples12
40611
40789
  });
40612
- import { existsSync as existsSync44, readFileSync as readFileSync32 } from "fs";
40613
- import { resolve as resolve30, dirname as dirname18 } from "path";
40790
+ import { existsSync as existsSync44, readFileSync as readFileSync33 } from "fs";
40791
+ import { resolve as resolve30, dirname as dirname19 } from "path";
40614
40792
  function parseCompositions(html, baseDir) {
40615
40793
  const parser = new DOMParser();
40616
40794
  const doc = parser.parseFromString(html, "text/html");
@@ -40624,7 +40802,7 @@ function parseCompositions(html, baseDir) {
40624
40802
  if (compositionSrc) {
40625
40803
  const subPath = resolve30(baseDir, compositionSrc);
40626
40804
  if (existsSync44(subPath)) {
40627
- const subHtml = readFileSync32(subPath, "utf-8");
40805
+ const subHtml = readFileSync33(subPath, "utf-8");
40628
40806
  const subInfo = parseSubComposition(subHtml, id, width, height);
40629
40807
  compositions.push({ ...subInfo, source: compositionSrc });
40630
40808
  return;
@@ -40718,9 +40896,9 @@ var init_compositions = __esm({
40718
40896
  },
40719
40897
  async run({ args }) {
40720
40898
  const project = resolveProject(args.dir);
40721
- const html = readFileSync32(project.indexPath, "utf-8");
40899
+ const html = readFileSync33(project.indexPath, "utf-8");
40722
40900
  ensureDOMParser();
40723
- const compositions = parseCompositions(html, dirname18(project.indexPath));
40901
+ const compositions = parseCompositions(html, dirname19(project.indexPath));
40724
40902
  if (compositions.length === 0) {
40725
40903
  console.log(`${c.success("\u25C7")} ${c.accent(project.name)} \u2014 no compositions found`);
40726
40904
  return;
@@ -41062,7 +41240,7 @@ __export(transcribe_exports2, {
41062
41240
  default: () => transcribe_default,
41063
41241
  examples: () => examples15
41064
41242
  });
41065
- import { existsSync as existsSync46, writeFileSync as writeFileSync19 } from "fs";
41243
+ import { existsSync as existsSync46, writeFileSync as writeFileSync20 } from "fs";
41066
41244
  import { resolve as resolve32, join as join47, extname as extname8 } from "path";
41067
41245
  async function importTranscript(inputPath, dir, json) {
41068
41246
  const { loadTranscript: loadTranscript2, patchCaptionHtml: patchCaptionHtml2 } = await Promise.resolve().then(() => (init_normalize(), normalize_exports));
@@ -41072,7 +41250,7 @@ async function importTranscript(inputPath, dir, json) {
41072
41250
  process.exit(1);
41073
41251
  }
41074
41252
  const outPath = join47(dir, "transcript.json");
41075
- writeFileSync19(outPath, JSON.stringify(words, null, 2));
41253
+ writeFileSync20(outPath, JSON.stringify(words, null, 2));
41076
41254
  patchCaptionHtml2(dir, words);
41077
41255
  if (json) {
41078
41256
  console.log(
@@ -41107,7 +41285,7 @@ async function transcribeAudio(inputPath, dir, opts) {
41107
41285
  );
41108
41286
  }
41109
41287
  }
41110
- writeFileSync19(result.transcriptPath, JSON.stringify(words, null, 2));
41288
+ writeFileSync20(result.transcriptPath, JSON.stringify(words, null, 2));
41111
41289
  patchCaptionHtml2(dir, words);
41112
41290
  if (opts.json) {
41113
41291
  console.log(
@@ -41315,8 +41493,8 @@ __export(synthesize_exports, {
41315
41493
  synthesize: () => synthesize
41316
41494
  });
41317
41495
  import { execFileSync as execFileSync6 } from "child_process";
41318
- import { existsSync as existsSync48, writeFileSync as writeFileSync20, mkdirSync as mkdirSync26, readdirSync as readdirSync16, unlinkSync as unlinkSync6 } from "fs";
41319
- import { join as join49, dirname as dirname19, basename as basename10 } from "path";
41496
+ import { existsSync as existsSync48, writeFileSync as writeFileSync21, mkdirSync as mkdirSync26, readdirSync as readdirSync16, unlinkSync as unlinkSync6 } from "fs";
41497
+ import { join as join49, dirname as dirname20, basename as basename10 } from "path";
41320
41498
  import { homedir as homedir9 } from "os";
41321
41499
  function findPython() {
41322
41500
  for (const name of ["python3", "python"]) {
@@ -41354,7 +41532,7 @@ function hasPythonPackage(python, pkg) {
41354
41532
  function ensureSynthScript() {
41355
41533
  if (!existsSync48(SCRIPT_PATH)) {
41356
41534
  mkdirSync26(SCRIPT_DIR, { recursive: true });
41357
- writeFileSync20(SCRIPT_PATH, SYNTH_SCRIPT);
41535
+ writeFileSync21(SCRIPT_PATH, SYNTH_SCRIPT);
41358
41536
  const currentName = basename10(SCRIPT_PATH);
41359
41537
  try {
41360
41538
  for (const entry of readdirSync16(SCRIPT_DIR)) {
@@ -41394,7 +41572,7 @@ async function synthesize(text, outputPath, options) {
41394
41572
  ensureVoices({ onProgress: options?.onProgress })
41395
41573
  ]);
41396
41574
  const scriptPath = ensureSynthScript();
41397
- mkdirSync26(dirname19(outputPath), { recursive: true });
41575
+ mkdirSync26(dirname20(outputPath), { recursive: true });
41398
41576
  options?.onProgress?.(`Generating speech with voice ${voice} (${lang})...`);
41399
41577
  try {
41400
41578
  const stdout2 = execFileSync6(
@@ -41481,7 +41659,7 @@ __export(tts_exports, {
41481
41659
  default: () => tts_default,
41482
41660
  examples: () => examples16
41483
41661
  });
41484
- import { existsSync as existsSync49, readFileSync as readFileSync33 } from "fs";
41662
+ import { existsSync as existsSync49, readFileSync as readFileSync34 } from "fs";
41485
41663
  import { resolve as resolve33, extname as extname9 } from "path";
41486
41664
  function listVoices(json) {
41487
41665
  const rows = BUNDLED_VOICES.map((v) => ({ ...v, defaultLang: inferLangFromVoiceId(v.id) }));
@@ -41592,7 +41770,7 @@ var init_tts = __esm({
41592
41770
  let text;
41593
41771
  const maybeFile = resolve33(args.input);
41594
41772
  if (existsSync49(maybeFile) && extname9(maybeFile).toLowerCase() === ".txt") {
41595
- text = readFileSync33(maybeFile, "utf-8").trim();
41773
+ text = readFileSync34(maybeFile, "utf-8").trim();
41596
41774
  if (!text) {
41597
41775
  console.error(c.error("File is empty."));
41598
41776
  process.exit(1);
@@ -41684,12 +41862,12 @@ __export(docs_exports, {
41684
41862
  default: () => docs_default,
41685
41863
  examples: () => examples17
41686
41864
  });
41687
- import { readFileSync as readFileSync34, existsSync as existsSync50 } from "fs";
41688
- import { resolve as resolve34, dirname as dirname20, join as join50 } from "path";
41865
+ import { readFileSync as readFileSync35, existsSync as existsSync50 } from "fs";
41866
+ import { resolve as resolve34, dirname as dirname21, join as join50 } from "path";
41689
41867
  import { fileURLToPath as fileURLToPath7 } from "url";
41690
41868
  function docsDir() {
41691
41869
  const thisFile = fileURLToPath7(import.meta.url);
41692
- const dir = dirname20(thisFile);
41870
+ const dir = dirname21(thisFile);
41693
41871
  const devPath = resolve34(dir, "..", "docs");
41694
41872
  const builtPath = resolve34(dir, "docs");
41695
41873
  return existsSync50(devPath) ? devPath : builtPath;
@@ -41794,7 +41972,7 @@ var init_docs = __esm({
41794
41972
  console.error(c.error(`Doc file not found: ${filePath}`));
41795
41973
  process.exit(1);
41796
41974
  }
41797
- const content = readFileSync34(filePath, "utf-8");
41975
+ const content = readFileSync35(filePath, "utf-8");
41798
41976
  console.log();
41799
41977
  renderMarkdown(content);
41800
41978
  }
@@ -42206,11 +42384,20 @@ Run ${c.accent("hyperframes telemetry --help")} for usage.`
42206
42384
  // src/commands/validate.ts
42207
42385
  var validate_exports = {};
42208
42386
  __export(validate_exports, {
42209
- default: () => validate_default
42387
+ default: () => validate_default,
42388
+ shouldIgnoreRequestFailure: () => shouldIgnoreRequestFailure
42210
42389
  });
42211
- import { existsSync as existsSync51, readFileSync as readFileSync35 } from "fs";
42212
- import { resolve as resolve35, join as join51, dirname as dirname21 } from "path";
42390
+ import { existsSync as existsSync51, readFileSync as readFileSync36 } from "fs";
42391
+ import { resolve as resolve35, join as join51, dirname as dirname22 } from "path";
42213
42392
  import { fileURLToPath as fileURLToPath8 } from "url";
42393
+ function shouldIgnoreRequestFailure(url, errorText) {
42394
+ if (errorText !== "net::ERR_ABORTED") return false;
42395
+ try {
42396
+ return MEDIA_EXTENSIONS.test(new URL(url).pathname);
42397
+ } catch {
42398
+ return false;
42399
+ }
42400
+ }
42214
42401
  async function getCompositionDuration3(page) {
42215
42402
  return page.evaluate(() => {
42216
42403
  if (window.__hf?.duration && window.__hf.duration > 0) return window.__hf.duration;
@@ -42257,7 +42444,7 @@ function loadContrastAuditScript() {
42257
42444
  join51(__dirname3, "commands", "contrast-audit.browser.js")
42258
42445
  ];
42259
42446
  for (const candidate of candidates) {
42260
- if (existsSync51(candidate)) return readFileSync35(candidate, "utf-8");
42447
+ if (existsSync51(candidate)) return readFileSync36(candidate, "utf-8");
42261
42448
  }
42262
42449
  throw new Error("Missing contrast audit browser script");
42263
42450
  }
@@ -42275,7 +42462,7 @@ async function validateInBrowser(projectDir, opts) {
42275
42462
  "hyperframe.runtime.iife.js"
42276
42463
  );
42277
42464
  if (existsSync51(runtimePath)) {
42278
- const runtimeSource = readFileSync35(runtimePath, "utf-8");
42465
+ const runtimeSource = readFileSync36(runtimePath, "utf-8");
42279
42466
  html = html.replace(
42280
42467
  /<script[^>]*data-hyperframes-preview-runtime[^>]*src="[^"]*"[^>]*><\/script>/,
42281
42468
  () => `<script data-hyperframes-preview-runtime="1">${runtimeSource}</script>`
@@ -42293,7 +42480,7 @@ async function validateInBrowser(projectDir, opts) {
42293
42480
  const filePath = join51(projectDir, decodeURIComponent(url));
42294
42481
  if (existsSync51(filePath)) {
42295
42482
  res.writeHead(200, { "Content-Type": getMimeType2(filePath) });
42296
- res.end(readFileSync35(filePath));
42483
+ res.end(readFileSync36(filePath));
42297
42484
  return;
42298
42485
  }
42299
42486
  res.writeHead(404);
@@ -42335,10 +42522,12 @@ async function validateInBrowser(projectDir, opts) {
42335
42522
  page.on("requestfailed", (req) => {
42336
42523
  const url = req.url();
42337
42524
  if (url.includes("favicon") || url.startsWith("data:")) return;
42525
+ const failureText = req.failure()?.errorText;
42526
+ if (shouldIgnoreRequestFailure(url, failureText)) return;
42338
42527
  const path2 = decodeURIComponent(new URL(url).pathname).replace(/^\//, "");
42339
42528
  errors.push({
42340
42529
  level: "error",
42341
- text: `Failed to load ${path2}: ${req.failure()?.errorText ?? "net::ERR_FAILED"}`,
42530
+ text: `Failed to load ${path2}: ${failureText ?? "net::ERR_FAILED"}`,
42342
42531
  url
42343
42532
  });
42344
42533
  });
@@ -42371,7 +42560,7 @@ function printContrastFailures(failures) {
42371
42560
  );
42372
42561
  }
42373
42562
  }
42374
- var __filename2, __dirname3, CONTRAST_SAMPLES, SEEK_SETTLE_MS2, validate_default;
42563
+ var __filename2, __dirname3, CONTRAST_SAMPLES, SEEK_SETTLE_MS2, MEDIA_EXTENSIONS, validate_default;
42375
42564
  var init_validate = __esm({
42376
42565
  "src/commands/validate.ts"() {
42377
42566
  "use strict";
@@ -42380,9 +42569,10 @@ var init_validate = __esm({
42380
42569
  init_colors();
42381
42570
  init_updateCheck();
42382
42571
  __filename2 = fileURLToPath8(import.meta.url);
42383
- __dirname3 = dirname21(__filename2);
42572
+ __dirname3 = dirname22(__filename2);
42384
42573
  CONTRAST_SAMPLES = 5;
42385
42574
  SEEK_SETTLE_MS2 = 150;
42575
+ MEDIA_EXTENSIONS = /\.(aac|flac|m4a|mov|mp3|mp4|oga|ogg|wav|webm)$/i;
42386
42576
  validate_default = defineCommand({
42387
42577
  meta: {
42388
42578
  name: "validate",
@@ -42483,7 +42673,7 @@ __export(snapshot_exports, {
42483
42673
  examples: () => examples21
42484
42674
  });
42485
42675
  import { spawn as spawn12 } from "child_process";
42486
- import { existsSync as existsSync52, mkdtempSync as mkdtempSync3, readFileSync as readFileSync36, mkdirSync as mkdirSync27, rmSync as rmSync10 } from "fs";
42676
+ import { existsSync as existsSync52, mkdtempSync as mkdtempSync3, readFileSync as readFileSync37, mkdirSync as mkdirSync27, rmSync as rmSync10 } from "fs";
42487
42677
  import { tmpdir as tmpdir5 } from "os";
42488
42678
  import { resolve as resolve36, join as join52, relative as relative6, isAbsolute as isAbsolute7 } from "path";
42489
42679
  async function extractVideoFrameToBuffer(videoPath, timeSeconds, useVp9AlphaDecoder = false) {
@@ -42529,7 +42719,7 @@ async function extractVideoFrameToBuffer(videoPath, timeSeconds, useVp9AlphaDeco
42529
42719
  }
42530
42720
  );
42531
42721
  if (result.code !== 0 || result.timedOut || !existsSync52(outPath)) return null;
42532
- return readFileSync36(outPath);
42722
+ return readFileSync37(outPath);
42533
42723
  } finally {
42534
42724
  try {
42535
42725
  rmSync10(tmp, { recursive: true, force: true });
@@ -42568,7 +42758,7 @@ async function captureSnapshots(projectDir, opts) {
42568
42758
  }
42569
42759
  if (existsSync52(filePath)) {
42570
42760
  res.writeHead(200, { "Content-Type": getMimeType2(filePath) });
42571
- res.end(readFileSync36(filePath));
42761
+ res.end(readFileSync37(filePath));
42572
42762
  return;
42573
42763
  }
42574
42764
  res.writeHead(404);
@@ -42829,7 +43019,7 @@ ${c.error("\u2717")} Snapshot failed: ${msg}`);
42829
43019
  });
42830
43020
 
42831
43021
  // src/capture/assetDownloader.ts
42832
- import { writeFileSync as writeFileSync21, mkdirSync as mkdirSync28 } from "fs";
43022
+ import { writeFileSync as writeFileSync22, mkdirSync as mkdirSync28 } from "fs";
42833
43023
  import { join as join53, extname as extname10 } from "path";
42834
43024
  async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks) {
42835
43025
  const assetsDir = join53(outputDir, "assets");
@@ -42844,7 +43034,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
42844
43034
  const name = label2 ? slugify(label2) + ".svg" : svg.isLogo ? `logo-${i2}.svg` : `icon-${i2}.svg`;
42845
43035
  const localPath = `assets/svgs/${name}`;
42846
43036
  try {
42847
- writeFileSync21(join53(outputDir, localPath), svg.outerHTML, "utf-8");
43037
+ writeFileSync22(join53(outputDir, localPath), svg.outerHTML, "utf-8");
42848
43038
  assets.push({ url: "", localPath, type: "svg" });
42849
43039
  } catch {
42850
43040
  }
@@ -42857,7 +43047,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
42857
43047
  const localPath = `assets/${name}`;
42858
43048
  const buffer = await fetchBuffer(icon.href);
42859
43049
  if (buffer) {
42860
- writeFileSync21(join53(outputDir, localPath), buffer);
43050
+ writeFileSync22(join53(outputDir, localPath), buffer);
42861
43051
  assets.push({ url: icon.href, localPath, type: "favicon" });
42862
43052
  break;
42863
43053
  }
@@ -42914,7 +43104,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
42914
43104
  const slug = isMeaningful ? slugify(rawName) : `${prefix}-${imgIdx}`;
42915
43105
  const name = `${slug}${ext}`;
42916
43106
  const localPath = `assets/${name}`;
42917
- writeFileSync21(join53(outputDir, localPath), buffer);
43107
+ writeFileSync22(join53(outputDir, localPath), buffer);
42918
43108
  assets.push({ url, localPath, type: "image" });
42919
43109
  imgIdx++;
42920
43110
  } catch {
@@ -42927,7 +43117,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
42927
43117
  const localPath = `assets/og-image${ext}`;
42928
43118
  const buffer = await fetchBuffer(tokens.ogImage);
42929
43119
  if (buffer && buffer.length > 5e3) {
42930
- writeFileSync21(join53(outputDir, localPath), buffer);
43120
+ writeFileSync22(join53(outputDir, localPath), buffer);
42931
43121
  assets.push({ url: tokens.ogImage, localPath, type: "image" });
42932
43122
  }
42933
43123
  } catch {
@@ -42990,7 +43180,7 @@ async function downloadAndRewriteFonts(css, outputDir) {
42990
43180
  const relativePath = `assets/fonts/${filename}`;
42991
43181
  const buffer = await fetchBuffer(fontUrl);
42992
43182
  if (buffer) {
42993
- writeFileSync21(localPath, buffer);
43183
+ writeFileSync22(localPath, buffer);
42994
43184
  rewritten = rewritten.split(fontUrl).join(relativePath);
42995
43185
  familyCounts.set(family, familyCount + 1);
42996
43186
  count++;
@@ -43783,7 +43973,7 @@ var init_animationCataloger = __esm({
43783
43973
  });
43784
43974
 
43785
43975
  // src/capture/mediaCapture.ts
43786
- import { mkdirSync as mkdirSync29, writeFileSync as writeFileSync22, readdirSync as readdirSync17, readFileSync as readFileSync37, statSync as statSync18 } from "fs";
43976
+ import { mkdirSync as mkdirSync29, writeFileSync as writeFileSync23, readdirSync as readdirSync17, readFileSync as readFileSync38, statSync as statSync18 } from "fs";
43787
43977
  import { join as join54 } from "path";
43788
43978
  async function saveLottieAnimations(discoveredLotties, lottieDir) {
43789
43979
  let savedCount = 0;
@@ -43817,7 +44007,7 @@ async function saveLottieAnimations(discoveredLotties, lottieDir) {
43817
44007
  const hash2 = buf.toString("base64").slice(0, 100);
43818
44008
  if (savedHashes.has(hash2)) continue;
43819
44009
  savedHashes.add(hash2);
43820
- writeFileSync22(join54(lottieDir, `animation-${savedCount}.lottie`), buf);
44010
+ writeFileSync23(join54(lottieDir, `animation-${savedCount}.lottie`), buf);
43821
44011
  savedCount++;
43822
44012
  continue;
43823
44013
  }
@@ -43835,7 +44025,7 @@ async function saveLottieAnimations(discoveredLotties, lottieDir) {
43835
44025
  } catch {
43836
44026
  continue;
43837
44027
  }
43838
- writeFileSync22(join54(lottieDir, `animation-${savedCount}.json`), jsonData, "utf-8");
44028
+ writeFileSync23(join54(lottieDir, `animation-${savedCount}.json`), jsonData, "utf-8");
43839
44029
  savedCount++;
43840
44030
  }
43841
44031
  } catch {
@@ -43850,7 +44040,7 @@ async function renderLottiePreviews(chromeBrowser, lottieDir, outputDir) {
43850
44040
  for (const file of readdirSync17(lottieDir)) {
43851
44041
  if (!file.endsWith(".json")) continue;
43852
44042
  try {
43853
- const raw = JSON.parse(readFileSync37(join54(lottieDir, file), "utf-8"));
44043
+ const raw = JSON.parse(readFileSync38(join54(lottieDir, file), "utf-8"));
43854
44044
  const fr = raw.fr || 30;
43855
44045
  const dur = ((raw.op || 0) - (raw.ip || 0)) / fr;
43856
44046
  const previewName = file.replace(".json", "-preview.png");
@@ -43860,7 +44050,7 @@ async function renderLottiePreviews(chromeBrowser, lottieDir, outputDir) {
43860
44050
  try {
43861
44051
  previewPage = await chromeBrowser.newPage();
43862
44052
  await previewPage.setViewport({ width: 400, height: 400 });
43863
- const animData = JSON.parse(readFileSync37(join54(lottieDir, file), "utf-8"));
44053
+ const animData = JSON.parse(readFileSync38(join54(lottieDir, file), "utf-8"));
43864
44054
  const midFrame = Math.floor(((raw.op || 0) - (raw.ip || 0)) * 0.3);
43865
44055
  await previewPage.setContent(
43866
44056
  `<!DOCTYPE html>
@@ -43913,7 +44103,7 @@ async function renderLottiePreviews(chromeBrowser, lottieDir, outputDir) {
43913
44103
  }
43914
44104
  }
43915
44105
  if (manifest.length > 0) {
43916
- writeFileSync22(
44106
+ writeFileSync23(
43917
44107
  join54(outputDir, "extracted", "lottie-manifest.json"),
43918
44108
  JSON.stringify(manifest, null, 2),
43919
44109
  "utf-8"
@@ -44022,7 +44212,7 @@ async function captureVideoManifest(page, outputDir, progress) {
44022
44212
  });
44023
44213
  }
44024
44214
  if (videoManifest.length > 0) {
44025
- writeFileSync22(
44215
+ writeFileSync23(
44026
44216
  join54(outputDir, "extracted", "video-manifest.json"),
44027
44217
  JSON.stringify(videoManifest, null, 2),
44028
44218
  "utf-8"
@@ -84478,7 +84668,7 @@ ${underline2}`);
84478
84668
  });
84479
84669
 
84480
84670
  // src/capture/contentExtractor.ts
84481
- import { readdirSync as readdirSync18, statSync as statSync20, readFileSync as readFileSync38 } from "fs";
84671
+ import { readdirSync as readdirSync18, statSync as statSync20, readFileSync as readFileSync39 } from "fs";
84482
84672
  import { join as join55 } from "path";
84483
84673
  async function detectLibraries(page, capturedShaders) {
84484
84674
  let detectedLibraries = [];
@@ -84611,7 +84801,7 @@ async function captionImagesWithGemini(outputDir, progress, warnings) {
84611
84801
  const filePath = join55(outputDir, "assets", file);
84612
84802
  const stat3 = statSync20(filePath);
84613
84803
  if (stat3.size > 4e6) return { file, caption: "" };
84614
- const buffer = readFileSync38(filePath);
84804
+ const buffer = readFileSync39(filePath);
84615
84805
  const base64 = buffer.toString("base64");
84616
84806
  const ext = file.split(".").pop()?.toLowerCase() || "png";
84617
84807
  const mimeType = ext === "jpg" ? "image/jpeg" : `image/${ext}`;
@@ -84724,13 +84914,13 @@ var agentPromptGenerator_exports = {};
84724
84914
  __export(agentPromptGenerator_exports, {
84725
84915
  generateAgentPrompt: () => generateAgentPrompt
84726
84916
  });
84727
- import { writeFileSync as writeFileSync23 } from "fs";
84917
+ import { writeFileSync as writeFileSync24 } from "fs";
84728
84918
  import { join as join56 } from "path";
84729
84919
  function generateAgentPrompt(outputDir, url, tokens, _animations, hasScreenshot, hasLottie, hasShaders, _catalogedAssets, detectedLibraries) {
84730
84920
  const prompt = buildPrompt(url, tokens, hasScreenshot, hasLottie, hasShaders, detectedLibraries);
84731
- writeFileSync23(join56(outputDir, "AGENTS.md"), prompt, "utf-8");
84732
- writeFileSync23(join56(outputDir, "CLAUDE.md"), prompt, "utf-8");
84733
- writeFileSync23(join56(outputDir, ".cursorrules"), prompt, "utf-8");
84921
+ writeFileSync24(join56(outputDir, "AGENTS.md"), prompt, "utf-8");
84922
+ writeFileSync24(join56(outputDir, "CLAUDE.md"), prompt, "utf-8");
84923
+ writeFileSync24(join56(outputDir, ".cursorrules"), prompt, "utf-8");
84734
84924
  }
84735
84925
  function buildPrompt(url, tokens, hasScreenshot, hasLottie, hasShaders, detectedLibraries) {
84736
84926
  const title = tokens.title || new URL(url).hostname.replace(/^www\./, "");
@@ -84797,7 +84987,7 @@ var init_agentPromptGenerator = __esm({
84797
84987
  });
84798
84988
 
84799
84989
  // src/capture/scaffolding.ts
84800
- import { existsSync as existsSync53, writeFileSync as writeFileSync24, readFileSync as readFileSync39 } from "fs";
84990
+ import { existsSync as existsSync53, writeFileSync as writeFileSync25, readFileSync as readFileSync40 } from "fs";
84801
84991
  import { join as join57, resolve as resolve37 } from "path";
84802
84992
  function loadEnvFile(startDir) {
84803
84993
  try {
@@ -84805,7 +84995,7 @@ function loadEnvFile(startDir) {
84805
84995
  for (let i2 = 0; i2 < 5; i2++) {
84806
84996
  const envPath = resolve37(dir, ".env");
84807
84997
  try {
84808
- const envContent = readFileSync39(envPath, "utf-8");
84998
+ const envContent = readFileSync40(envPath, "utf-8");
84809
84999
  for (const line of envContent.split("\n")) {
84810
85000
  const trimmed = line.trim();
84811
85001
  if (!trimmed || trimmed.startsWith("#")) continue;
@@ -84827,7 +85017,7 @@ async function generateProjectScaffold(outputDir, url, tokens, animationCatalog,
84827
85017
  const metaPath = join57(outputDir, "meta.json");
84828
85018
  if (!existsSync53(metaPath)) {
84829
85019
  const hostname = new URL(url).hostname.replace(/^www\./, "");
84830
- writeFileSync24(
85020
+ writeFileSync25(
84831
85021
  metaPath,
84832
85022
  JSON.stringify({ id: hostname + "-video", name: tokens.title || hostname }, null, 2),
84833
85023
  "utf-8"
@@ -84862,7 +85052,7 @@ var screenshotCapture_exports = {};
84862
85052
  __export(screenshotCapture_exports, {
84863
85053
  captureScrollScreenshots: () => captureScrollScreenshots
84864
85054
  });
84865
- import { writeFileSync as writeFileSync25, mkdirSync as mkdirSync30 } from "fs";
85055
+ import { writeFileSync as writeFileSync26, mkdirSync as mkdirSync30 } from "fs";
84866
85056
  import { join as join58 } from "path";
84867
85057
  async function captureScrollScreenshots(page, outputDir) {
84868
85058
  const screenshotsDir = join58(outputDir, "screenshots");
@@ -84901,7 +85091,7 @@ async function captureScrollScreenshots(page, outputDir) {
84901
85091
  const filename = `scroll-${String(Math.min(pct, 100)).padStart(3, "0")}.png`;
84902
85092
  const filePath = join58(screenshotsDir, filename);
84903
85093
  const buffer = await page.screenshot({ type: "png" });
84904
- writeFileSync25(filePath, buffer);
85094
+ writeFileSync26(filePath, buffer);
84905
85095
  filePaths.push(`screenshots/${filename}`);
84906
85096
  }
84907
85097
  await page.evaluate(`window.scrollTo(0, 0)`);
@@ -85212,7 +85402,7 @@ var capture_exports = {};
85212
85402
  __export(capture_exports, {
85213
85403
  captureWebsite: () => captureWebsite
85214
85404
  });
85215
- import { mkdirSync as mkdirSync31, writeFileSync as writeFileSync26, existsSync as existsSync54 } from "fs";
85405
+ import { mkdirSync as mkdirSync31, writeFileSync as writeFileSync27, existsSync as existsSync54 } from "fs";
85216
85406
  import { join as join59 } from "path";
85217
85407
  async function captureWebsite(opts, onProgress) {
85218
85408
  const {
@@ -85407,7 +85597,7 @@ async function captureWebsite(opts, onProgress) {
85407
85597
  return true;
85408
85598
  });
85409
85599
  capturedShaders = unique;
85410
- writeFileSync26(
85600
+ writeFileSync27(
85411
85601
  join59(outputDir, "extracted", "shaders.json"),
85412
85602
  JSON.stringify(unique, null, 2),
85413
85603
  "utf-8"
@@ -85418,7 +85608,7 @@ async function captureWebsite(opts, onProgress) {
85418
85608
  }
85419
85609
  progress("tokens", "Extracting design tokens...");
85420
85610
  const tokens = await extractTokens(page1);
85421
- writeFileSync26(
85611
+ writeFileSync27(
85422
85612
  join59(outputDir, "extracted", "tokens.json"),
85423
85613
  JSON.stringify(tokens, null, 2),
85424
85614
  "utf-8"
@@ -85492,7 +85682,7 @@ async function captureWebsite(opts, onProgress) {
85492
85682
  scrollTriggeredElements: (animationCatalog.scrollTargets || []).length,
85493
85683
  representativeAnimations: representativeAnims
85494
85684
  };
85495
- writeFileSync26(
85685
+ writeFileSync27(
85496
85686
  join59(outputDir, "extracted", "animations.json"),
85497
85687
  JSON.stringify(leanCatalog, null, 2),
85498
85688
  "utf-8"
@@ -85504,17 +85694,17 @@ async function captureWebsite(opts, onProgress) {
85504
85694
  assets = await downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks);
85505
85695
  }
85506
85696
  if (visibleTextContent) {
85507
- writeFileSync26(join59(outputDir, "extracted", "visible-text.txt"), visibleTextContent, "utf-8");
85697
+ writeFileSync27(join59(outputDir, "extracted", "visible-text.txt"), visibleTextContent, "utf-8");
85508
85698
  }
85509
85699
  if (catalogedAssets.length > 0) {
85510
- writeFileSync26(
85700
+ writeFileSync27(
85511
85701
  join59(outputDir, "extracted", "assets-catalog.json"),
85512
85702
  JSON.stringify(catalogedAssets, null, 2),
85513
85703
  "utf-8"
85514
85704
  );
85515
85705
  }
85516
85706
  if (detectedLibraries.length > 0) {
85517
- writeFileSync26(
85707
+ writeFileSync27(
85518
85708
  join59(outputDir, "extracted", "detected-libraries.json"),
85519
85709
  JSON.stringify(detectedLibraries, null, 2),
85520
85710
  "utf-8"
@@ -85525,7 +85715,7 @@ async function captureWebsite(opts, onProgress) {
85525
85715
  try {
85526
85716
  const lines = generateAssetDescriptions(outputDir, tokens, catalogedAssets, geminiCaptions);
85527
85717
  if (lines.length > 0) {
85528
- writeFileSync26(
85718
+ writeFileSync27(
85529
85719
  join59(outputDir, "extracted", "asset-descriptions.md"),
85530
85720
  "# Asset Descriptions\n\nOne line per file. Read this instead of opening every image individually.\n\n" + lines.map((l) => "- " + l).join("\n") + "\n",
85531
85721
  "utf-8"
@@ -85721,11 +85911,11 @@ var init_capture2 = __esm({
85721
85911
  } catch (err) {
85722
85912
  const errMsg = err instanceof Error ? err.message : String(err);
85723
85913
  try {
85724
- const { mkdirSync: mkdirSync33, writeFileSync: writeFileSync27 } = await import("fs");
85914
+ const { mkdirSync: mkdirSync33, writeFileSync: writeFileSync28 } = await import("fs");
85725
85915
  mkdirSync33(outputDir, { recursive: true });
85726
85916
  const isTimeout = /timeout|timed out/i.test(errMsg);
85727
85917
  const reason = isTimeout ? "Page navigation timed out \u2014 the site may be blocking headless browsers or requires authentication." : `Capture failed: ${errMsg}`;
85728
- writeFileSync27(
85918
+ writeFileSync28(
85729
85919
  `${outputDir}/BLOCKED.md`,
85730
85920
  `# Capture Failed
85731
85921