editorbrain 0.61.0 → 0.62.0

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.
@@ -430,8 +430,8 @@ function esc(str3) {
430
430
  function slugify(input2) {
431
431
  return input2.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
432
432
  }
433
- function isObject(data2) {
434
- return typeof data2 === "object" && data2 !== null && !Array.isArray(data2);
433
+ function isObject(data) {
434
+ return typeof data === "object" && data !== null && !Array.isArray(data);
435
435
  }
436
436
  function isPlainObject(o) {
437
437
  if (isObject(o) === false)
@@ -460,10 +460,10 @@ function shallowClone(o) {
460
460
  return new Set(o);
461
461
  return o;
462
462
  }
463
- function numKeys(data2) {
463
+ function numKeys(data) {
464
464
  let keyCount = 0;
465
- for (const key in data2) {
466
- if (Object.prototype.hasOwnProperty.call(data2, key)) {
465
+ for (const key in data) {
466
+ if (Object.prototype.hasOwnProperty.call(data, key)) {
467
467
  keyCount++;
468
468
  }
469
469
  }
@@ -744,20 +744,20 @@ function getLengthableOrigin(input2) {
744
744
  return "string";
745
745
  return "unknown";
746
746
  }
747
- function parsedType(data2) {
748
- const t = typeof data2;
747
+ function parsedType(data) {
748
+ const t = typeof data;
749
749
  switch (t) {
750
750
  case "number": {
751
- return Number.isNaN(data2) ? "nan" : "number";
751
+ return Number.isNaN(data) ? "nan" : "number";
752
752
  }
753
753
  case "object": {
754
- if (data2 === null) {
754
+ if (data === null) {
755
755
  return "null";
756
756
  }
757
- if (Array.isArray(data2)) {
757
+ if (Array.isArray(data)) {
758
758
  return "array";
759
759
  }
760
- const obj5 = data2;
760
+ const obj5 = data;
761
761
  if (obj5 && Object.getPrototypeOf(obj5) !== Object.prototype && "constructor" in obj5 && obj5.constructor) {
762
762
  return obj5.constructor.name;
763
763
  }
@@ -958,15 +958,15 @@ var init_util = __esm({
958
958
  return false;
959
959
  }
960
960
  });
961
- getParsedType = (data2) => {
962
- const t = typeof data2;
961
+ getParsedType = (data) => {
962
+ const t = typeof data;
963
963
  switch (t) {
964
964
  case "undefined":
965
965
  return "undefined";
966
966
  case "string":
967
967
  return "string";
968
968
  case "number":
969
- return Number.isNaN(data2) ? "nan" : "number";
969
+ return Number.isNaN(data) ? "nan" : "number";
970
970
  case "boolean":
971
971
  return "boolean";
972
972
  case "function":
@@ -976,25 +976,25 @@ var init_util = __esm({
976
976
  case "symbol":
977
977
  return "symbol";
978
978
  case "object":
979
- if (Array.isArray(data2)) {
979
+ if (Array.isArray(data)) {
980
980
  return "array";
981
981
  }
982
- if (data2 === null) {
982
+ if (data === null) {
983
983
  return "null";
984
984
  }
985
- if (data2.then && typeof data2.then === "function" && data2.catch && typeof data2.catch === "function") {
985
+ if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
986
986
  return "promise";
987
987
  }
988
- if (typeof Map !== "undefined" && data2 instanceof Map) {
988
+ if (typeof Map !== "undefined" && data instanceof Map) {
989
989
  return "map";
990
990
  }
991
- if (typeof Set !== "undefined" && data2 instanceof Set) {
991
+ if (typeof Set !== "undefined" && data instanceof Set) {
992
992
  return "set";
993
993
  }
994
- if (typeof Date !== "undefined" && data2 instanceof Date) {
994
+ if (typeof Date !== "undefined" && data instanceof Date) {
995
995
  return "date";
996
996
  }
997
- if (typeof File !== "undefined" && data2 instanceof File) {
997
+ if (typeof File !== "undefined" && data instanceof File) {
998
998
  return "file";
999
999
  }
1000
1000
  return "object";
@@ -2335,24 +2335,24 @@ function isValidCIDRv6(value) {
2335
2335
  return false;
2336
2336
  return isValidIPv6(address);
2337
2337
  }
2338
- function isValidBase64(data2) {
2339
- if (data2 === "")
2338
+ function isValidBase64(data) {
2339
+ if (data === "")
2340
2340
  return true;
2341
- if (/\s/.test(data2))
2341
+ if (/\s/.test(data))
2342
2342
  return false;
2343
- if (data2.length % 4 !== 0)
2343
+ if (data.length % 4 !== 0)
2344
2344
  return false;
2345
2345
  try {
2346
- atob(data2);
2346
+ atob(data);
2347
2347
  return true;
2348
2348
  } catch {
2349
2349
  return false;
2350
2350
  }
2351
2351
  }
2352
- function isValidBase64URL(data2) {
2353
- if (!base64urlCharset.test(data2))
2352
+ function isValidBase64URL(data) {
2353
+ if (!base64urlCharset.test(data))
2354
2354
  return false;
2355
- const base643 = data2.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
2355
+ const base643 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
2356
2356
  const padded = base643.padEnd(Math.ceil(base643.length / 4) * 4, "=");
2357
2357
  return isValidBase64(padded);
2358
2358
  }
@@ -9163,8 +9163,8 @@ var capitalizeFirstCharacter, error33;
9163
9163
  var init_lt = __esm({
9164
9164
  "node_modules/zod/v4/locales/lt.js"() {
9165
9165
  init_util();
9166
- capitalizeFirstCharacter = (text17) => {
9167
- return text17.charAt(0).toUpperCase() + text17.slice(1);
9166
+ capitalizeFirstCharacter = (text18) => {
9167
+ return text18.charAt(0).toUpperCase() + text18.slice(1);
9168
9168
  };
9169
9169
  error33 = () => {
9170
9170
  const Sizable = {
@@ -13110,22 +13110,22 @@ function installCompiledUserMethods(target, source2, parser) {
13110
13110
  const sourceAny = source2;
13111
13111
  if (typeof sourceAny.safeParse === "function") {
13112
13112
  const originalSafeParse = sourceAny.safeParse;
13113
- targetAny.safeParse = (data2, params) => {
13114
- const out = parser(data2);
13113
+ targetAny.safeParse = (data, params) => {
13114
+ const out = parser(data);
13115
13115
  if (out !== INVALID) {
13116
13116
  return { success: true, data: out };
13117
13117
  }
13118
- return originalSafeParse(data2, params);
13118
+ return originalSafeParse(data, params);
13119
13119
  };
13120
13120
  }
13121
13121
  if (typeof sourceAny.parse === "function") {
13122
13122
  const originalParse = sourceAny.parse;
13123
- targetAny.parse = (data2, params) => {
13124
- const out = parser(data2);
13123
+ targetAny.parse = (data, params) => {
13124
+ const out = parser(data);
13125
13125
  if (out !== INVALID) {
13126
13126
  return out;
13127
13127
  }
13128
- return originalParse(data2, params);
13128
+ return originalParse(data, params);
13129
13129
  };
13130
13130
  }
13131
13131
  }
@@ -15677,12 +15677,12 @@ function _stringbool(Classes, _params) {
15677
15677
  in: stringSchema,
15678
15678
  out: booleanSchema,
15679
15679
  transform: ((input2, payload) => {
15680
- let data2 = input2;
15680
+ let data = input2;
15681
15681
  if (params.case !== "sensitive")
15682
- data2 = data2.toLowerCase();
15683
- if (truthySet.has(data2)) {
15682
+ data = data.toLowerCase();
15683
+ if (truthySet.has(data)) {
15684
15684
  return true;
15685
- } else if (falsySet.has(data2)) {
15685
+ } else if (falsySet.has(data)) {
15686
15686
  return false;
15687
15687
  } else {
15688
15688
  payload.issues.push({
@@ -18226,7 +18226,7 @@ function _instanceof(cls, params = {}) {
18226
18226
  const inst = new ZodInstanceOf({
18227
18227
  type: "custom",
18228
18228
  check: "custom",
18229
- fn: (data2) => data2 instanceof cls,
18229
+ fn: (data) => data instanceof cls,
18230
18230
  abort: true,
18231
18231
  ...util_exports.normalizeParams(params)
18232
18232
  });
@@ -18382,17 +18382,17 @@ var init_schemas2 = __esm({
18382
18382
  set "~standard"(value) {
18383
18383
  util_exports.own(this, "~standard", value);
18384
18384
  },
18385
- parse: function _parse2(data2, params) {
18386
- return parse2(this, data2, params, { callee: _parse2 });
18385
+ parse: function _parse2(data, params) {
18386
+ return parse2(this, data, params, { callee: _parse2 });
18387
18387
  },
18388
- parseAsync: async function _parseAsync2(data2, params) {
18389
- return await parseAsync2(this, data2, params, { callee: _parseAsync2 });
18388
+ parseAsync: async function _parseAsync2(data, params) {
18389
+ return await parseAsync2(this, data, params, { callee: _parseAsync2 });
18390
18390
  },
18391
- safeParse(data2, params) {
18392
- return safeParse2(this, data2, params);
18391
+ safeParse(data, params) {
18392
+ return safeParse2(this, data, params);
18393
18393
  },
18394
- async safeParseAsync(data2, params) {
18395
- return safeParseAsync2(this, data2, params);
18394
+ async safeParseAsync(data, params) {
18395
+ return safeParseAsync2(this, data, params);
18396
18396
  },
18397
18397
  // `spa` is an alias: same function object as `safeParseAsync`, as before.
18398
18398
  get spa() {
@@ -18401,35 +18401,35 @@ var init_schemas2 = __esm({
18401
18401
  set spa(value) {
18402
18402
  util_exports.own(this, "spa", value);
18403
18403
  },
18404
- validate(data2, params) {
18405
- return validate(this, data2, params);
18404
+ validate(data, params) {
18405
+ return validate(this, data, params);
18406
18406
  },
18407
- validateAsync(data2, params) {
18408
- return validateAsync(this, data2, params);
18407
+ validateAsync(data, params) {
18408
+ return validateAsync(this, data, params);
18409
18409
  },
18410
- encode: function _encode2(data2, params) {
18411
- return encode2(this, data2, params, { callee: _encode2 });
18410
+ encode: function _encode2(data, params) {
18411
+ return encode2(this, data, params, { callee: _encode2 });
18412
18412
  },
18413
- decode: function _decode2(data2, params) {
18414
- return decode2(this, data2, params, { callee: _decode2 });
18413
+ decode: function _decode2(data, params) {
18414
+ return decode2(this, data, params, { callee: _decode2 });
18415
18415
  },
18416
- encodeAsync: async function _encodeAsync2(data2, params) {
18417
- return await encodeAsync2(this, data2, params, { callee: _encodeAsync2 });
18416
+ encodeAsync: async function _encodeAsync2(data, params) {
18417
+ return await encodeAsync2(this, data, params, { callee: _encodeAsync2 });
18418
18418
  },
18419
- decodeAsync: async function _decodeAsync2(data2, params) {
18420
- return await decodeAsync2(this, data2, params, { callee: _decodeAsync2 });
18419
+ decodeAsync: async function _decodeAsync2(data, params) {
18420
+ return await decodeAsync2(this, data, params, { callee: _decodeAsync2 });
18421
18421
  },
18422
- safeEncode(data2, params) {
18423
- return safeEncode2(this, data2, params);
18422
+ safeEncode(data, params) {
18423
+ return safeEncode2(this, data, params);
18424
18424
  },
18425
- safeDecode(data2, params) {
18426
- return safeDecode2(this, data2, params);
18425
+ safeDecode(data, params) {
18426
+ return safeDecode2(this, data, params);
18427
18427
  },
18428
- async safeEncodeAsync(data2, params) {
18429
- return safeEncodeAsync2(this, data2, params);
18428
+ async safeEncodeAsync(data, params) {
18429
+ return safeEncodeAsync2(this, data, params);
18430
18430
  },
18431
- async safeDecodeAsync(data2, params) {
18432
- return safeDecodeAsync2(this, data2, params);
18431
+ async safeDecodeAsync(data, params) {
18432
+ return safeDecodeAsync2(this, data, params);
18433
18433
  },
18434
18434
  toJSONSchema(params) {
18435
18435
  return createToJSONSchemaMethod(this, {})(params);
@@ -20683,7 +20683,7 @@ var init_commercial = __esm({
20683
20683
  MOTION_ACCESS_OFFER = { revision: "curated-61f888a2346f-100", free: 241, premium: 94, total: 335 };
20684
20684
  COMMERCIAL_PLAN_IDS = Object.keys(COMMERCIAL_PLANS);
20685
20685
  COMMUNITY_PLAN = { name: "Comunidad", monthlyCents: 0, credits: COMMERCIAL_PLANS.studio.credits, brands: COMMERCIAL_PLANS.studio.brands, storageBytes: COMMERCIAL_PLANS.studio.storageBytes, searches: COMMERCIAL_PLANS.studio.searches, editors: COMMERCIAL_PLANS.studio.editors };
20686
- COMMUNITY_INSTANT_CREDITS = 200;
20686
+ COMMUNITY_INSTANT_CREDITS = COMMUNITY_PLAN.credits;
20687
20687
  ENTITLED_PLAN_TERMS = { ...COMMERCIAL_PLANS, community: COMMUNITY_PLAN };
20688
20688
  ANNUAL_PAID_MONTHS = 10;
20689
20689
  TOP_UPS = [
@@ -21615,7 +21615,7 @@ function styleThumbnailPath(styleId2) {
21615
21615
  }
21616
21616
  function readImageInfo(bytes) {
21617
21617
  const b = bytes, u16 = (i) => b[i] << 8 | b[i + 1], le16 = (i) => b[i] | b[i + 1] << 8, le24 = (i) => b[i] | b[i + 1] << 8 | b[i + 2] << 16;
21618
- const ascii = (i, text17) => [...text17].every((c, k) => b[i + k] === c.charCodeAt(0));
21618
+ const ascii = (i, text18) => [...text18].every((c, k) => b[i + k] === c.charCodeAt(0));
21619
21619
  const valid = (info) => info.width > 0 && info.height > 0 ? info : void 0;
21620
21620
  if (b.length >= 24 && b[0] === 137 && ascii(1, "PNG") && ascii(12, "IHDR")) {
21621
21621
  const width = (b[16] << 24 >>> 0) + (b[17] << 16) + (b[18] << 8) + b[19], height = (b[20] << 24 >>> 0) + (b[21] << 16) + (b[22] << 8) + b[23];
@@ -21770,7 +21770,7 @@ function validateStyleResources(value, expectedId) {
21770
21770
  const fields3 = (entry2, allowed, label3) => {
21771
21771
  if (Object.keys(entry2).some((key) => !allowed.includes(key))) add(`${label3} has unsupported fields; do not include URLs, credentials or hidden resource sources`);
21772
21772
  };
21773
- const text17 = (value2, label3) => {
21773
+ const text18 = (value2, label3) => {
21774
21774
  if (!nonempty(value2)) add(`${label3} must be nonempty text`);
21775
21775
  else if (forbiddenText.test(value2) || /[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/.test(value2)) add(`${label3} cannot contain URLs, credentials or control characters`);
21776
21776
  };
@@ -21792,7 +21792,7 @@ function validateStyleResources(value, expectedId) {
21792
21792
  else if (ids2.has(resource.id)) add(`Duplicate resource id: ${resource.id}`);
21793
21793
  else ids2.add(resource.id);
21794
21794
  if (!kinds.includes(resource.kind)) add(`${label3} has kind ${JSON.stringify(resource.kind ?? null)}; use ${kinds.join(" | ")}`);
21795
- text17(resource.purpose, `${label3} purpose`);
21795
+ text18(resource.purpose, `${label3} purpose`);
21796
21796
  if (typeof resource.required !== "boolean") add(`${label3} required must be boolean`);
21797
21797
  const source2 = resource.source;
21798
21798
  if (!object4(source2)) {
@@ -21820,7 +21820,7 @@ function validateStyleResources(value, expectedId) {
21820
21820
  if (source2.fileName !== void 0 && (typeof source2.fileName !== "string" || !/^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,99}$/.test(source2.fileName))) add(`${label3} fileName must be a portable basename, not a path.`);
21821
21821
  } else if (source2.type === "requirement") {
21822
21822
  fields3(source2, ["type", "description"], `${label3} requirement source`);
21823
- text17(source2.description, `${label3} requirement description`);
21823
+ text18(source2.description, `${label3} requirement description`);
21824
21824
  } else add(`${label3} source must be local, asset or requirement`);
21825
21825
  }
21826
21826
  }
@@ -22191,9 +22191,9 @@ var init_style_audio_mix = __esm({
22191
22191
 
22192
22192
  // packages/core/src/caption-renderer-v2.ts
22193
22193
  function captionLayerV2(preset2, cues, width, height, fontDataUrl2, options) {
22194
- const data2 = JSON.stringify({ preset: preset2, cues, width, height, fontDataUrl: fontDataUrl2, options }).replace(/[<>&\u2028\u2029]/g, (c) => "\\u" + c.charCodeAt(0).toString(16).padStart(4, "0"));
22194
+ const data = JSON.stringify({ preset: preset2, cues, width, height, fontDataUrl: fontDataUrl2, options }).replace(/[<>&\u2028\u2029]/g, (c) => "\\u" + c.charCodeAt(0).toString(16).padStart(4, "0"));
22195
22195
  return `<!doctype html><html><meta charset="utf-8"><title>Caption preview</title><style>html,body{margin:0;background:transparent;overflow:hidden}body{width:${width}px;height:${height}px}#caption{position:absolute;transform:translate(-50%,-50%);white-space:pre-wrap;max-width:90%;text-align:center;box-sizing:border-box;line-height:1.2;isolation:isolate}#text{position:relative;z-index:1}#marker{position:absolute;inset:0;overflow:visible;z-index:0;pointer-events:none}#demo{position:absolute;left:2%;top:2%;font:14px sans-serif;color:white;background:#222;padding:6px}</style><div id="caption" hidden><svg id="marker" xmlns="http://www.w3.org/2000/svg"></svg><span id="text"></span></div><div id="demo" hidden>DEMO \xB7 SYNTHETIC WORD TIMING \xB7 NOT TRANSCRIPT EVIDENCE</div><script>(()=>{
22196
- const data=${data2},p=data.preset,el=document.getElementById('caption'),text=document.getElementById('text'),svg=document.getElementById('marker');
22196
+ const data=${data},p=data.preset,el=document.getElementById('caption'),text=document.getElementById('text'),svg=document.getElementById('marker');
22197
22197
  const scale=Math.min(data.width/p.referenceSize.width,data.height/p.referenceSize.height),padding=p.activeBox.padding*scale;
22198
22198
  const family='EditorBrainCaptionExact';
22199
22199
  Object.assign(el.style,{fontFamily:family,fontWeight:String(p.font.weight),fontSize:p.font.size*scale+'px',color:p.font.color,left:p.position.x*data.width+'px',top:p.position.y*data.height+'px'});
@@ -22382,9 +22382,9 @@ function captionLayer(preset2, cues, width, height, fontDataUrl2, options = {})
22382
22382
  if (preset2.enabled && !fontDataUrl2) throw new Error("Captions v2 requires the exact embedded font; no fallback font is allowed.");
22383
22383
  return captionLayerV2(preset2, cues, width, height, fontDataUrl2, options);
22384
22384
  }
22385
- const data2 = JSON.stringify({ preset: preset2, cues, width, height, fontDataUrl: fontDataUrl2, options }).replace(/[<>&\u2028\u2029]/g, (c) => "\\u" + c.charCodeAt(0).toString(16).padStart(4, "0"));
22385
+ const data = JSON.stringify({ preset: preset2, cues, width, height, fontDataUrl: fontDataUrl2, options }).replace(/[<>&\u2028\u2029]/g, (c) => "\\u" + c.charCodeAt(0).toString(16).padStart(4, "0"));
22386
22386
  return `<!doctype html><html><meta charset="utf-8"><title>Caption layer</title><style>html,body{margin:0;background:transparent;overflow:hidden}#caption{position:absolute;transform:translate(-50%,-50%);white-space:pre-wrap;max-width:90%;text-align:center;box-sizing:border-box;line-height:1.2}body{width:${width}px;height:${height}px}</style><span id="caption" hidden></span>${options.syntheticDemo ? '<div style="position:absolute;left:2%;top:2%;font:14px sans-serif;color:white;background:#222;padding:6px">DEMO \xB7 SYNTHETIC WORD TIMING \xB7 NOT TRANSCRIPT EVIDENCE</div>' : ""}<script>(()=>{
22387
- const data=${data2};const p=data.preset;const el=document.getElementById('caption');
22387
+ const data=${data};const p=data.preset;const el=document.getElementById('caption');
22388
22388
  Object.assign(el.style,{fontFamily:p.font.family,fontWeight:String(p.font.weight),fontSize:p.font.size+'px',color:p.font.color,left:p.position.x*data.width+'px',top:p.position.y*data.height+'px'});
22389
22389
  const fontReady=data.fontDataUrl?new FontFace(p.font.family,'url('+JSON.stringify(data.fontDataUrl)+')').load().then(font=>document.fonts.add(font)):Promise.resolve();
22390
22390
  window.renderAt=async function(seconds){
@@ -22530,16 +22530,16 @@ function parseResourceSelection(value) {
22530
22530
  return { schemaVersion: 1, resources };
22531
22531
  }
22532
22532
  function indexFromTempo(transcript, original, mapping) {
22533
- const data2 = transcript, map2 = mapping;
22534
- if (!data2 || data2.kind !== "editorbrain.transcript" || !["tempo", "scribe"].includes(data2.tool) || !Array.isArray(data2.words) || !data2.words.length || data2.words.length > 1e5 || !map2 || map2.sourceSha256 !== original.sha256 || map2.sha256 !== data2.assetId || map2.timestampBasis !== "milliseconds_from_container_start" || map2.silenceRemoved !== false || !Number.isSafeInteger(map2.durationMs) || !Number.isSafeInteger(data2.durationMs) || Math.abs(map2.durationMs - data2.durationMs) > 1) throw new Error("Tempo result needs its matching, untrimmed studio prepare source mapping");
22533
+ const data = transcript, map2 = mapping;
22534
+ if (!data || data.kind !== "editorbrain.transcript" || !["tempo", "scribe"].includes(data.tool) || !Array.isArray(data.words) || !data.words.length || data.words.length > 1e5 || !map2 || map2.sourceSha256 !== original.sha256 || map2.sha256 !== data.assetId || map2.timestampBasis !== "milliseconds_from_container_start" || map2.silenceRemoved !== false || !Number.isSafeInteger(map2.durationMs) || !Number.isSafeInteger(data.durationMs) || Math.abs(map2.durationMs - data.durationMs) > 1) throw new Error("Tempo result needs its matching, untrimmed studio prepare source mapping");
22535
22535
  const segments = [];
22536
22536
  let words2 = [], start4 = 0, end4 = 0, last = -1;
22537
22537
  const flush = () => {
22538
22538
  if (words2.length) segments.push({ id: `tempo-${segments.length + 1}`, kind: "transcript", text: words2.join(" "), startMs: start4, endMs: end4 });
22539
22539
  words2 = [];
22540
22540
  };
22541
- for (const word of data2.words) {
22542
- if (typeof word?.text !== "string" || !word.text.trim() || word.text.length > 500 || !Number.isSafeInteger(word.startMs) || !Number.isSafeInteger(word.endMs) || word.startMs < last || word.endMs <= word.startMs || word.endMs > data2.durationMs || original.durationMs !== null && word.endMs > original.durationMs) throw new Error("Review invalid Tempo timestamps; do not clamp or fabricate times");
22541
+ for (const word of data.words) {
22542
+ if (typeof word?.text !== "string" || !word.text.trim() || word.text.length > 500 || !Number.isSafeInteger(word.startMs) || !Number.isSafeInteger(word.endMs) || word.startMs < last || word.endMs <= word.startMs || word.endMs > data.durationMs || original.durationMs !== null && word.endMs > original.durationMs) throw new Error("Review invalid Tempo timestamps; do not clamp or fabricate times");
22543
22543
  if (words2.length && (word.startMs - end4 > 1e3 || words2.join(" ").length + word.text.length > 800)) flush();
22544
22544
  if (!words2.length) start4 = word.startMs;
22545
22545
  end4 = word.endMs;
@@ -22568,6 +22568,7 @@ function recoveryGuidance(code, status2, details = {}) {
22568
22568
  if (code === "resource_plan_required" && status2 === 403 && details.feature === "render_storage_beta") {
22569
22569
  return unavailableExecutionGuidance();
22570
22570
  }
22571
+ if (code === "resource_plan_required" && details.requiredPlan === "community") return void 0;
22571
22572
  if (code === "cloud_access_required" && [403, 503].includes(status2) || code === "cloud_policy_unavailable" && status2 === 503) return unavailableExecutionGuidance();
22572
22573
  if (!Object.hasOwn(guidance, code) || guidance[code].status !== status2) return void 0;
22573
22574
  const help = guidance[code].help;
@@ -22632,12 +22633,12 @@ var init_recovery_guidance = __esm({
22632
22633
  resource_plan_required: { status: 403, help: { message: "Este recurso requiere un plan de pago (Creator, Pro o Agencia).", nextStep: "Puedes ver su preview o proponer un recurso con access.canUse=true que encaje con la escena. Una recarga de cr\xE9ditos no desbloquea recursos premium. No sustituyas la elecci\xF3n expl\xEDcita del usuario ni cambies de plan autom\xE1ticamente.", actions: [billing, { label: "Explorar animaciones", url: "https://editorbrain.com/app/animations" }] } },
22633
22634
  studio_insufficient_credits: { status: 402, help: {
22634
22635
  message: "No alcanzan tus cr\xE9ditos creativos de EditorBrain para este encargo.",
22635
- nextStep: "Solo est\xE1 bloqueado este encargo de EditorBrain: puedes seguir editando en Gratis y sin cr\xE9ditos con tus herramientas o material disponible. Para transcribir, puedes elegir Whisper local/online, tu cuenta de AssemblyAI o una transcripci\xF3n existente. Comprueba el acceso y presupuesto de la alternativa; no recargues ni cambies de proveedor autom\xE1ticamente. Si prefieres el servicio integrado, consulta Plan y cr\xE9ditos para ver las opciones de recarga disponibles. Los l\xEDmites de biblioteca premium, b\xFAsquedas y almacenamiento se mantienen.",
22636
+ nextStep: "Solo est\xE1 bloqueado este encargo de EditorBrain: puedes seguir editando en Gratis y sin cr\xE9ditos con tus herramientas o material disponible. Para transcribir, puedes elegir Whisper local/online, tu cuenta de AssemblyAI o una transcripci\xF3n existente. Comprueba el acceso y presupuesto de la alternativa; no recargues ni cambies de proveedor autom\xE1ticamente. Si prefieres el servicio integrado, consulta Plan y cr\xE9ditos para ver las opciones de recarga disponibles. Los l\xEDmites de biblioteca premium, b\xFAsquedas en la biblioteca y almacenamiento se mantienen.",
22636
22637
  actions: [billing, integrations]
22637
22638
  } },
22638
22639
  search_allowance_exhausted: { status: 429, help: {
22639
- message: "Alcanzaste las b\xFAsquedas incluidas en este ciclo.",
22640
- nextStep: "Consulta tu plan y cu\xE1ndo se renueva el l\xEDmite. Una recarga de cr\xE9ditos creativos no implica m\xE1s b\xFAsquedas. Puedes continuar con referencias ya consultadas y v\xE1lidas; una integraci\xF3n externa no elimina este l\xEDmite.",
22640
+ message: "Alcanzaste las b\xFAsquedas en la biblioteca incluidas en este ciclo.",
22641
+ nextStep: "Consulta tu plan y cu\xE1ndo se renueva el l\xEDmite. Una recarga de cr\xE9ditos creativos no implica m\xE1s b\xFAsquedas en la biblioteca. Puedes continuar con referencias ya consultadas y v\xE1lidas; una integraci\xF3n externa no elimina este l\xEDmite.",
22641
22642
  actions: [billing]
22642
22643
  } },
22643
22644
  studio_unavailable: { status: 503, help: {
@@ -22909,18 +22910,18 @@ function normalizeCustomChoice(value) {
22909
22910
  function customChoicesIssues(value, allowRemoval = false) {
22910
22911
  if (!record5(value)) return ["Las elecciones propias deben ser un objeto por secci\xF3n."];
22911
22912
  const issues = [];
22912
- for (const [key, text17] of Object.entries(value)) {
22913
+ for (const [key, text18] of Object.entries(value)) {
22913
22914
  if (!customChoiceSections.includes(key)) {
22914
22915
  issues.push(`Secci\xF3n desconocida en tus elecciones propias: ${key.slice(0, 40)}.`);
22915
22916
  continue;
22916
22917
  }
22917
- if (allowRemoval && text17 === null) continue;
22918
- if (typeof text17 !== "string" || !normalizeCustomChoice(text17)) {
22918
+ if (allowRemoval && text18 === null) continue;
22919
+ if (typeof text18 !== "string" || !normalizeCustomChoice(text18)) {
22919
22920
  issues.push(`Tu elecci\xF3n propia para \xAB${labels[key]}\xBB debe tener texto.`);
22920
22921
  continue;
22921
22922
  }
22922
- if (normalizeCustomChoice(text17).length > CUSTOM_CHOICE_MAX) issues.push(`Tu elecci\xF3n propia para \xAB${labels[key]}\xBB admite hasta ${CUSTOM_CHOICE_MAX} caracteres.`);
22923
- if (/<!--|-->|```/.test(text17)) issues.push(`Tu elecci\xF3n propia para \xAB${labels[key]}\xBB no puede incluir marcas de comentario ni bloques de c\xF3digo.`);
22923
+ if (normalizeCustomChoice(text18).length > CUSTOM_CHOICE_MAX) issues.push(`Tu elecci\xF3n propia para \xAB${labels[key]}\xBB admite hasta ${CUSTOM_CHOICE_MAX} caracteres.`);
22924
+ if (/<!--|-->|```/.test(text18)) issues.push(`Tu elecci\xF3n propia para \xAB${labels[key]}\xBB no puede incluir marcas de comentario ni bloques de c\xF3digo.`);
22924
22925
  }
22925
22926
  return issues;
22926
22927
  }
@@ -22940,8 +22941,8 @@ function readCustomChoices(content) {
22940
22941
  if (issues.length) throw new Error(issues.join("\n"));
22941
22942
  const choices2 = {};
22942
22943
  for (const section2 of customChoiceSections) {
22943
- const text17 = value.choices[section2];
22944
- if (typeof text17 === "string" && Object.hasOwn(value.choices, section2)) choices2[section2] = normalizeCustomChoice(text17);
22944
+ const text18 = value.choices[section2];
22945
+ if (typeof text18 === "string" && Object.hasOwn(value.choices, section2)) choices2[section2] = normalizeCustomChoice(text18);
22945
22946
  }
22946
22947
  return choices2;
22947
22948
  }
@@ -22949,8 +22950,8 @@ function writeCustomChoices(content, value) {
22949
22950
  readCustomChoices(content);
22950
22951
  const choices2 = {};
22951
22952
  for (const section2 of customChoiceSections) {
22952
- const text17 = value[section2];
22953
- if (typeof text17 === "string" && normalizeCustomChoice(text17)) choices2[section2] = normalizeCustomChoice(text17);
22953
+ const text18 = value[section2];
22954
+ if (typeof text18 === "string" && normalizeCustomChoice(text18)) choices2[section2] = normalizeCustomChoice(text18);
22954
22955
  }
22955
22956
  const issues = customChoicesIssues(choices2);
22956
22957
  if (issues.length) throw new Error(issues.join("\n"));
@@ -22997,7 +22998,7 @@ var init_custom_choices = __esm({
22997
22998
  limits: "L\xEDmites (adem\xE1s de los elegidos)"
22998
22999
  };
22999
23000
  record5 = (value) => !!value && typeof value === "object" && !Array.isArray(value);
23000
- escape = (text17) => text17.replace(/</g, "\u2039").replace(/>/g, "\u203A");
23001
+ escape = (text18) => text18.replace(/</g, "\u2039").replace(/>/g, "\u203A");
23001
23002
  }
23002
23003
  });
23003
23004
 
@@ -23081,11 +23082,11 @@ function knownFields(value, allowed) {
23081
23082
  if (Object.keys(value).some((key) => !allowed.includes(key))) throw new Error("Unknown integration field. Credentials and user/workspace IDs are not accepted.");
23082
23083
  }
23083
23084
  function containsCredential(value) {
23084
- let text17 = value;
23085
- for (let depth = 0; depth < 2; depth++) text17 = text17.replace(/\\u([\da-f]{4})/gi, (_, hex5) => String.fromCharCode(parseInt(hex5, 16))).replace(/\\(["'\\])/g, "$1").replace(/\\[nrt]/g, " ");
23086
- text17 = text17.normalize("NFKD").replace(new RegExp("\\p{M}", "gu"), "");
23085
+ let text18 = value;
23086
+ for (let depth = 0; depth < 2; depth++) text18 = text18.replace(/\\u([\da-f]{4})/gi, (_, hex5) => String.fromCharCode(parseInt(hex5, 16))).replace(/\\(["'\\])/g, "$1").replace(/\\[nrt]/g, " ");
23087
+ text18 = text18.normalize("NFKD").replace(new RegExp("\\p{M}", "gu"), "");
23087
23088
  const assignment = /(?:api[\s_-]*key|access[\s_-]*token|secret|password|authorization|contrasena|clave[\s_-]+(?:de[\s_-]+)?api|token[\s_-]+(?:de[\s_-]+)?acceso)["'’”]?\s*[:=]\s*(?:["'‘“][^"'’”]+["'’”]|[^\s"'‘’“”]+)/i;
23088
- return assignment.test(text17) || /-----BEGIN [A-Z ]*PRIVATE KEY-----|\bBearer\s+\S{8,}|\b(?:sk-(?:proj-)?|AIza|cfat_|apikey_|tlk_|rpa_)[A-Za-z0-9_-]{15,}|\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+|https?:\/\/[^\s/]+@|[?&](?:key|token|secret|password|signature|X-Amz-Credential|X-Amz-Signature|access_token|api_key)=/i.test(text17);
23089
+ return assignment.test(text18) || /-----BEGIN [A-Z ]*PRIVATE KEY-----|\bBearer\s+\S{8,}|\b(?:sk-(?:proj-)?|AIza|cfat_|apikey_|tlk_|rpa_)[A-Za-z0-9_-]{15,}|\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+|https?:\/\/[^\s/]+@|[?&](?:key|token|secret|password|signature|X-Amz-Credential|X-Amz-Signature|access_token|api_key)=/i.test(text18);
23089
23090
  }
23090
23091
  function safeText(value, field, max, required2 = false) {
23091
23092
  if (value === void 0 && !required2) return void 0;
@@ -24236,8 +24237,8 @@ ${profileHeading}`)) return content;
24236
24237
  let effectiveJson = json3[0];
24237
24238
  if (json3[0].includes("questionMode")) {
24238
24239
  try {
24239
- const data2 = JSON.parse(json3[0].slice(json3[0].indexOf("\n") + 1, json3[0].lastIndexOf("\n")));
24240
- if (data2?.questionMode === "essential") effectiveJson = profileJson({ ...data2, questionMode: normalizeQuestionMode(data2.questionMode) });
24240
+ const data = JSON.parse(json3[0].slice(json3[0].indexOf("\n") + 1, json3[0].lastIndexOf("\n")));
24241
+ if (data?.questionMode === "essential") effectiveJson = profileJson({ ...data, questionMode: normalizeQuestionMode(data.questionMode) });
24241
24242
  } catch {
24242
24243
  return content;
24243
24244
  }
@@ -24797,14 +24798,14 @@ var init_onboarding_guide = __esm({
24797
24798
  // packages/core/src/library-sheet.ts
24798
24799
  function sheetTerms(brief) {
24799
24800
  if (!brief) return [];
24800
- let text17 = ` ${tokens(brief).join(" ")} `;
24801
+ let text18 = ` ${tokens(brief).join(" ")} `;
24801
24802
  const terms2 = [];
24802
24803
  for (const { phrase, index: index2 } of phraseGroups) {
24803
- if (!text17.includes(` ${phrase} `)) continue;
24804
+ if (!text18.includes(` ${phrase} `)) continue;
24804
24805
  terms2.push({ term: phrase, alternatives: [...SHEET_SYNONYMS[index2]] });
24805
- text17 = text17.replace(` ${phrase} `, " ");
24806
+ text18 = text18.replace(` ${phrase} `, " ");
24806
24807
  }
24807
- for (const word of text17.split(" ").filter(Boolean)) {
24808
+ for (const word of text18.split(" ").filter(Boolean)) {
24808
24809
  if (STOPWORDS.has(word) || terms2.some((term) => term.term === word)) continue;
24809
24810
  const groups3 = groupsByWord.get(word) ?? [];
24810
24811
  terms2.push({ term: word, alternatives: [.../* @__PURE__ */ new Set([word, ...groups3.flatMap((index2) => SHEET_SYNONYMS[index2])])] });
@@ -25108,11 +25109,11 @@ function memoryPreferenceConflicts(entry2, state) {
25108
25109
  };
25109
25110
  if (intent && !memoryIntentIssues(intent).length) add(intent.field, intent.value, "explicit_intent");
25110
25111
  else {
25111
- const text17 = entry2.text.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").trim();
25112
- if (/^(?:nada de|sin|no quiero) subtitulos[.!]?$/.test(text17)) add("captionsEnabled", false, "literal_rejection");
25113
- if (state.captionTreatment === "karaoke" && /^(?:nada de|sin|no quiero|evita) (?:subtitulos )?(?:palabra (?:por|a) palabra|karaoke)[.!]?$/.test(text17)) add("captionTreatment", null, "literal_rejection");
25114
- if (/^(?:nada de|sin|no quiero) musica[.!]?$/.test(text17)) add("musicIntensity", "none", "literal_rejection");
25115
- if (/^(?:nada de|sin|no quiero) (?:efectos de sonido|sfx)[.!]?$/.test(text17)) add("sfxDensity", "none", "literal_rejection");
25112
+ const text18 = entry2.text.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").trim();
25113
+ if (/^(?:nada de|sin|no quiero) subtitulos[.!]?$/.test(text18)) add("captionsEnabled", false, "literal_rejection");
25114
+ if (state.captionTreatment === "karaoke" && /^(?:nada de|sin|no quiero|evita) (?:subtitulos )?(?:palabra (?:por|a) palabra|karaoke)[.!]?$/.test(text18)) add("captionTreatment", null, "literal_rejection");
25115
+ if (/^(?:nada de|sin|no quiero) musica[.!]?$/.test(text18)) add("musicIntensity", "none", "literal_rejection");
25116
+ if (/^(?:nada de|sin|no quiero) (?:efectos de sonido|sfx)[.!]?$/.test(text18)) add("sfxDensity", "none", "literal_rejection");
25116
25117
  }
25117
25118
  return conflicts;
25118
25119
  }
@@ -25392,42 +25393,42 @@ function rasterDimensions(binary2, mime2, name) {
25392
25393
  return;
25393
25394
  }
25394
25395
  if (le32(4) !== binary2.length - 8) throw invalid25();
25395
- const frameDimensions = (kind3, size, data2) => {
25396
+ const frameDimensions = (kind3, size, data) => {
25396
25397
  if (kind3 === "VP8L") {
25397
- if (size < 5 || byte(data2) !== 47 || byte(data2 + 4) >> 5 !== 0) throw invalid25();
25398
- const width = 1 + (byte(data2 + 1) | (byte(data2 + 2) & 63) << 8);
25399
- const height = 1 + (byte(data2 + 2) >> 6 | byte(data2 + 3) << 2 | (byte(data2 + 4) & 15) << 10);
25398
+ if (size < 5 || byte(data) !== 47 || byte(data + 4) >> 5 !== 0) throw invalid25();
25399
+ const width = 1 + (byte(data + 1) | (byte(data + 2) & 63) << 8);
25400
+ const height = 1 + (byte(data + 2) >> 6 | byte(data + 3) << 2 | (byte(data + 4) & 15) << 10);
25400
25401
  check3(width, height);
25401
25402
  return true;
25402
25403
  }
25403
25404
  if (kind3 === "VP8 ") {
25404
- if (size < 10 || byte(data2) & 1 || binary2.slice(data2 + 3, data2 + 6) !== "\x9D*") throw invalid25();
25405
- check3(le16(data2 + 6) & 16383, le16(data2 + 8) & 16383);
25405
+ if (size < 10 || byte(data) & 1 || binary2.slice(data + 3, data + 6) !== "\x9D*") throw invalid25();
25406
+ check3(le16(data + 6) & 16383, le16(data + 8) & 16383);
25406
25407
  return true;
25407
25408
  }
25408
25409
  return false;
25409
25410
  };
25410
25411
  let offset = 12, found = false;
25411
25412
  while (offset + 8 <= binary2.length) {
25412
- const kind3 = binary2.slice(offset, offset + 4), size = le32(offset + 4), data2 = offset + 8;
25413
- if (size > binary2.length - data2) throw invalid25();
25413
+ const kind3 = binary2.slice(offset, offset + 4), size = le32(offset + 4), data = offset + 8;
25414
+ if (size > binary2.length - data) throw invalid25();
25414
25415
  if (kind3 === "VP8X") {
25415
25416
  if (size !== 10) throw invalid25();
25416
- check3(le24(data2 + 4) + 1, le24(data2 + 7) + 1);
25417
+ check3(le24(data + 4) + 1, le24(data + 7) + 1);
25417
25418
  found = true;
25418
25419
  } else if (kind3 === "ANMF") {
25419
25420
  if (size < 16) throw invalid25();
25420
- check3(le24(data2 + 6) + 1, le24(data2 + 9) + 1);
25421
- let nested = data2 + 16, frame = false;
25422
- while (nested + 8 <= data2 + size) {
25421
+ check3(le24(data + 6) + 1, le24(data + 9) + 1);
25422
+ let nested = data + 16, frame = false;
25423
+ while (nested + 8 <= data + size) {
25423
25424
  const frameKind = binary2.slice(nested, nested + 4), frameSize = le32(nested + 4), frameData = nested + 8;
25424
- if (frameSize > data2 + size - frameData) throw invalid25();
25425
+ if (frameSize > data + size - frameData) throw invalid25();
25425
25426
  frame = frameDimensions(frameKind, frameSize, frameData) || frame;
25426
25427
  nested = frameData + frameSize + frameSize % 2;
25427
25428
  }
25428
- if (!frame || nested !== data2 + size) throw invalid25();
25429
- } else found = frameDimensions(kind3, size, data2) || found;
25430
- offset = data2 + size + size % 2;
25429
+ if (!frame || nested !== data + size) throw invalid25();
25430
+ } else found = frameDimensions(kind3, size, data) || found;
25431
+ offset = data + size + size % 2;
25431
25432
  }
25432
25433
  if (!found || offset !== binary2.length) throw invalid25();
25433
25434
  }
@@ -25891,12 +25892,12 @@ var init_production_evidence = __esm({
25891
25892
 
25892
25893
  // packages/core/src/mix-review.ts
25893
25894
  function runBiquads(input2, filters) {
25894
- let data2 = input2;
25895
+ let data = input2;
25895
25896
  for (const { b, a } of filters) {
25896
- const out = new Float32Array(data2.length);
25897
+ const out = new Float32Array(data.length);
25897
25898
  let x1 = 0, x2 = 0, y1 = 0, y2 = 0;
25898
- for (let i = 0; i < data2.length; i++) {
25899
- const x = data2[i];
25899
+ for (let i = 0; i < data.length; i++) {
25900
+ const x = data[i];
25900
25901
  const y = b[0] * x + b[1] * x1 + b[2] * x2 - a[1] * y1 - a[2] * y2;
25901
25902
  out[i] = y;
25902
25903
  x2 = x1;
@@ -25904,9 +25905,9 @@ function runBiquads(input2, filters) {
25904
25905
  y2 = y1;
25905
25906
  y1 = y;
25906
25907
  }
25907
- data2 = out;
25908
+ data = out;
25908
25909
  }
25909
- return data2;
25910
+ return data;
25910
25911
  }
25911
25912
  function kWeight(samples, rate3 = MIX_REVIEW_RATE) {
25912
25913
  let f0 = 1681.974450955533, Q = 0.7071752369554196, K = Math.tan(Math.PI * f0 / rate3);
@@ -25925,12 +25926,12 @@ function bandpass(lo, hi, rate3) {
25925
25926
  return { b: [alpha / a0, 0, -alpha / a0], a: [1, -2 * Math.cos(w) / a0, (1 - alpha) / a0] };
25926
25927
  }
25927
25928
  function frameEnergy(samples, rate3 = MIX_REVIEW_RATE, weighted = true) {
25928
- const data2 = weighted ? kWeight(samples, rate3) : samples;
25929
- const block = Math.round(rate3 * HOP), frames = Math.ceil(data2.length / block), out = new Float32Array(frames);
25929
+ const data = weighted ? kWeight(samples, rate3) : samples;
25930
+ const block = Math.round(rate3 * HOP), frames = Math.ceil(data.length / block), out = new Float32Array(frames);
25930
25931
  for (let f = 0; f < frames; f++) {
25931
25932
  let sum = 0;
25932
- const end4 = Math.min(data2.length, (f + 1) * block);
25933
- for (let i = f * block; i < end4; i++) sum += data2[i] * data2[i];
25933
+ const end4 = Math.min(data.length, (f + 1) * block);
25934
+ for (let i = f * block; i < end4; i++) sum += data[i] * data[i];
25934
25935
  out[f] = sum / block;
25935
25936
  }
25936
25937
  return out;
@@ -25979,8 +25980,8 @@ function validateMusicDuck(value, name = "timeline.music.duck") {
25979
25980
  return result2;
25980
25981
  }
25981
25982
  function duckRegions(speech, duck) {
25982
- const join43 = Math.max(duck.bridgeMs, duck.attackMs + duck.holdMs + duck.releaseMs) / 1e3;
25983
- let bridge = join43;
25983
+ const join44 = Math.max(duck.bridgeMs, duck.attackMs + duck.holdMs + duck.releaseMs) / 1e3;
25984
+ let bridge = join44;
25984
25985
  let merged = [];
25985
25986
  do {
25986
25987
  merged = [];
@@ -26348,12 +26349,12 @@ function detectDropouts(samples, rate3 = MIX_REVIEW_RATE, words2) {
26348
26349
  }
26349
26350
  return findings;
26350
26351
  }
26351
- function normalizeToken(text17) {
26352
- const t = text17.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^\p{L}\p{N}]+/gu, "");
26352
+ function normalizeToken(text18) {
26353
+ const t = text18.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^\p{L}\p{N}]+/gu, "");
26353
26354
  return NUMBERS[t] ?? t;
26354
26355
  }
26355
- function tokenizeScript(text17) {
26356
- return text17.split(/[\s—–/]+/).map(normalizeToken).filter(Boolean);
26356
+ function tokenizeScript(text18) {
26357
+ return text18.split(/[\s—–/]+/).map(normalizeToken).filter(Boolean);
26357
26358
  }
26358
26359
  function compareWords(expected, heard) {
26359
26360
  const e = expected.map((w) => ({ ...w, token: normalizeToken(w.text) })).filter((w) => w.token);
@@ -26970,8 +26971,8 @@ function checkCuts(options) {
26970
26971
  const length = Math.min(last.end, current2.end) - last.start;
26971
26972
  const pauseBefore = before ? last.start - before.end : last.start;
26972
26973
  const pauseAfter = after ? after.start - last.end : Infinity;
26973
- const text17 = textIn(last.start, Math.min(last.end, current2.end));
26974
- const wordCount = text17 ? text17.split(" ").length : 0;
26974
+ const text18 = textIn(last.start, Math.min(last.end, current2.end));
26975
+ const wordCount = text18 ? text18.split(" ").length : 0;
26975
26976
  if (length <= D.danglingMaxSeconds && pauseBefore >= D.danglingPauseBeforeSeconds && pauseAfter > D.longPauseSeconds && (!words2 || wordCount <= 2)) {
26976
26977
  const floor2 = before ? before.end + 0.02 : current2.start;
26977
26978
  const out = snap(envelope, Math.max(floor2, last.start - D.padBeforeOutSeconds));
@@ -26986,10 +26987,10 @@ function checkCuts(options) {
26986
26987
  segment: k,
26987
26988
  source: { out: round(current2.end), in: round(next.start) },
26988
26989
  final,
26989
- ...text17 ? { text: text17 } : {},
26990
+ ...text18 ? { text: text18 } : {},
26990
26991
  evidence: { fragmentStart: round(last.start), fragmentEnd: round(last.end), pauseBeforeSeconds: round(pauseBefore), pauseAfterSeconds: Number.isFinite(pauseAfter) ? round(pauseAfter) : "end_of_source" },
26991
26992
  suggested: { out, in: into },
26992
- message: `Segment ${k + 1} ends on an isolated ${text17 ? `\xAB${text17}\xBB` : "fragment"} (${round(length)} s) that the speaker followed with a ${Number.isFinite(pauseAfter) ? `${round(pauseAfter)} s` : "final"} pause, then joins another take. It usually sounds like a false start: end the segment before it.`
26993
+ message: `Segment ${k + 1} ends on an isolated ${text18 ? `\xAB${text18}\xBB` : "fragment"} (${round(length)} s) that the speaker followed with a ${Number.isFinite(pauseAfter) ? `${round(pauseAfter)} s` : "final"} pause, then joins another take. It usually sounds like a false start: end the segment before it.`
26993
26994
  });
26994
26995
  }
26995
26996
  }
@@ -27128,7 +27129,7 @@ var init_cut_check = __esm({
27128
27129
  };
27129
27130
  frameTime = (envelope, index2) => (index2 + 0.5) * envelope.hopSeconds;
27130
27131
  round = (value) => Math.round(value * 1e3) / 1e3;
27131
- normalize2 = (text17) => text17.normalize("NFD").replace(new RegExp("\\p{M}", "gu"), "").toLowerCase().replace(/[^\p{L}\p{N}]/gu, "");
27132
+ normalize2 = (text18) => text18.normalize("NFD").replace(new RegExp("\\p{M}", "gu"), "").toLowerCase().replace(/[^\p{L}\p{N}]/gu, "");
27132
27133
  }
27133
27134
  });
27134
27135
 
@@ -205838,8 +205839,8 @@ var init_authored_motion_facets = __esm({
205838
205839
  });
205839
205840
 
205840
205841
  // packages/core/src/authored-motion-catalog.ts
205841
- function withFacets(data2) {
205842
- return data2.map((scene) => {
205842
+ function withFacets(data) {
205843
+ return data.map((scene) => {
205843
205844
  const facets = getAuthoredMotionFacets(scene.id, scene.runtime);
205844
205845
  if (!facets) throw new Error(`Missing authored motion facets for ${scene.id}.`);
205845
205846
  const requirements = facets.material === "video" ? {
@@ -205861,8 +205862,8 @@ function perVersion(build) {
205861
205862
  function isAuthoredMotionVersion(value) {
205862
205863
  return Object.hasOwn(catalogData, value);
205863
205864
  }
205864
- function stems(text17) {
205865
- return new Set((normalized(text17).match(/[a-z0-9]+/g) ?? []).filter((word) => word.length > 2 && !stopwords.has(word)).map((word) => word.slice(0, 5)));
205865
+ function stems(text18) {
205866
+ return new Set((normalized(text18).match(/[a-z0-9]+/g) ?? []).filter((word) => word.length > 2 && !stopwords.has(word)).map((word) => word.slice(0, 5)));
205866
205867
  }
205867
205868
  function discoveryTerms(search) {
205868
205869
  const translated = search.replace(/\blower third\b/g, "nombre cargo").replace(/\bcount up\b/g, "contador").replace(/\b[a-z0-9]+\b/g, (word) => Object.hasOwn(discoveryWords, word) ? discoveryWords[word] : word);
@@ -205911,8 +205912,8 @@ function rankedCandidates(search, version3, bilingual = false) {
205911
205912
  function legacyCandidates(search) {
205912
205913
  const terms2 = search.split(" ").filter(Boolean);
205913
205914
  return catalog("1.0.0").filter((scene) => {
205914
- const text17 = normalized([scene.id, scene.title, scene.mechanism, scene.intent, scene.niche, scene.style, aliases[scene.id] || ""].join(" "));
205915
- return terms2.every((term) => text17.includes(term));
205915
+ const text18 = normalized([scene.id, scene.title, scene.mechanism, scene.intent, scene.niche, scene.style, aliases[scene.id] || ""].join(" "));
205916
+ return terms2.every((term) => text18.includes(term));
205916
205917
  });
205917
205918
  }
205918
205919
  function compositing(scene) {
@@ -206200,9 +206201,9 @@ var init_authored_motion_catalog = __esm({
206200
206201
  [(scene.crossNicheUses ?? []).join(" "), 2.5],
206201
206202
  [(scene.presets ?? []).map((preset2) => `${preset2.name.replace(/-/g, " ")} ${preset2.summary}`).join(" "), 2],
206202
206203
  [scene.useFor ?? "", 1.5]
206203
- ].map(([text17, weight]) => {
206204
- const terms2 = stems(text17);
206205
- if (precise && /\bcontador(?:es)?\b/.test(normalized(text17))) terms2.add("contador");
206204
+ ].map(([text18, weight]) => {
206205
+ const terms2 = stems(text18);
206206
+ if (precise && /\bcontador(?:es)?\b/.test(normalized(text18))) terms2.add("contador");
206206
206207
  return { terms: terms2, weight };
206207
206208
  }) }));
206208
206209
  searchIndex = perVersion((version3) => {
@@ -206212,8 +206213,8 @@ var init_authored_motion_catalog = __esm({
206212
206213
  bilingualIndex = () => bilingualSearchIndex ??= (builds.searchIndex.push("1.4.0-bilingual"), buildSearchIndex(catalog("1.4.0"), true));
206213
206214
  v14TermWeights = () => v14Weights ??= termWeights(searchIndex("1.4.0"));
206214
206215
  bilingualTermWeights = () => bilingualWeights ??= termWeights(bilingualIndex());
206215
- oneLine = (text17, max = 180) => {
206216
- const clean = text17.replace(/\s+/g, " ").trim();
206216
+ oneLine = (text18, max = 180) => {
206217
+ const clean = text18.replace(/\s+/g, " ").trim();
206217
206218
  return clean.length <= max ? clean : `${clean.slice(0, max - 1).replace(/\s+\S*$/, "")}\u2026`;
206218
206219
  };
206219
206220
  AUTHORED_MOTION_SHEET_MAX_LIMIT = 100;
@@ -206319,7 +206320,7 @@ function creditPriceGuide(options = {}) {
206319
206320
  summary: id5 === "free" ? t(`${planName(id5)}: 0 USD. ${p.credits} cr\xE9ditos de bienvenida y, a partir del segundo mes, ${p.monthlyCredits} cada mes.`, `${planName(id5)}: 0 USD. ${p.credits} welcome credits, then ${p.monthlyCredits} every month from the second month.`) : t(`${planName(id5)}: ${fmt2(p.monthlyCents / 100, lang)} USD al mes, ${fmt2(p.credits, lang)} cr\xE9ditos cada mes.`, `${planName(id5)}: ${fmt2(p.monthlyCents / 100, lang)} USD a month, ${fmt2(p.credits, lang)} credits every month.`)
206320
206321
  };
206321
206322
  });
206322
- const communityArrival = t(`Los ${fmt2(COMMUNITY_PLAN.credits, lang)} cr\xE9ditos de cada ciclo no llegan todos juntos: ${fmt2(COMMUNITY_INSTANT_CREDITS, lang)} llegan en cuanto reclamas tu plan y el resto llega cuando se confirma tu membres\xEDa de la comunidad (puede tardar hasta una hora).`, `The ${fmt2(COMMUNITY_PLAN.credits, lang)} credits of each cycle do not all arrive at once: ${fmt2(COMMUNITY_INSTANT_CREDITS, lang)} arrive as soon as you claim your plan and the rest arrive when your community membership is confirmed (it can take up to an hour).`);
206323
+ const communityArrival = t(`Los ${fmt2(COMMUNITY_INSTANT_CREDITS, lang)} cr\xE9ditos de cada ciclo llegan juntos: en cuanto activas tu plan ya los tienes. Si eres fundador, tu bono de bienvenida llega cuando se confirma tu membres\xEDa de la comunidad (casi siempre en menos de una hora).`, `The ${fmt2(COMMUNITY_INSTANT_CREDITS, lang)} credits of each cycle arrive together: you have them as soon as you activate your plan. If you are a founder, your welcome bonus arrives when your community membership is confirmed (usually within the hour).`);
206323
206324
  const startCredits = options.plan ? options.plan === "community" ? COMMUNITY_PLAN.credits : COMMERCIAL_PLANS[options.plan].credits : void 0;
206324
206325
  const credits = options.credits ?? startCredits;
206325
206326
  return {
@@ -206562,9 +206563,9 @@ function parseReviewTranscript(value) {
206562
206563
  function normalizePreservedElements(value) {
206563
206564
  const limits = `preservedElements must be a non-empty string or an array of 1\u2013${PRESERVED_ELEMENTS_MAX_ITEMS} non-empty strings, at most ${PRESERVED_ELEMENTS_MAX_CHARS} characters in total`;
206564
206565
  if (typeof value === "string") {
206565
- const text18 = value.trim();
206566
- if (!text18 || text18.length > PRESERVED_ELEMENTS_MAX_CHARS) throw new Error(`${limits} (received ${text18.length}).`);
206567
- return text18;
206566
+ const text19 = value.trim();
206567
+ if (!text19 || text19.length > PRESERVED_ELEMENTS_MAX_CHARS) throw new Error(`${limits} (received ${text19.length}).`);
206568
+ return text19;
206568
206569
  }
206569
206570
  if (!Array.isArray(value)) throw new Error(`${limits}; received ${value === null ? "null" : typeof value}.`);
206570
206571
  if (!value.length || value.length > PRESERVED_ELEMENTS_MAX_ITEMS) throw new Error(`${limits} (received ${value.length} items).`);
@@ -206572,9 +206573,9 @@ function normalizePreservedElements(value) {
206572
206573
  if (typeof item !== "string" || !item.trim()) throw new Error(`${limits}; item ${index2} is empty or not a string.`);
206573
206574
  return item.trim();
206574
206575
  });
206575
- const text17 = `- ${items.join("\n- ")}`;
206576
- if (text17.length > PRESERVED_ELEMENTS_MAX_CHARS) throw new Error(`${limits} (the joined list has ${text17.length}).`);
206577
- return text17;
206576
+ const text18 = `- ${items.join("\n- ")}`;
206577
+ if (text18.length > PRESERVED_ELEMENTS_MAX_CHARS) throw new Error(`${limits} (the joined list has ${text18.length}).`);
206578
+ return text18;
206578
206579
  }
206579
206580
  var REVIEW_TRANSCRIPT_MAX_BYTES, REVIEW_SAMPLE_MAX_BYTES, PRESERVED_ELEMENTS_MAX_CHARS, PRESERVED_ELEMENTS_MAX_ITEMS;
206580
206581
  var init_review_transcript = __esm({
@@ -206607,20 +206608,20 @@ async function findPersonalResourceByOriginal(sha2567, brandId2, read) {
206607
206608
  let after, previousId = "";
206608
206609
  const cursors = /* @__PURE__ */ new Set();
206609
206610
  for (let page2 = 0; page2 < 100; page2++) {
206610
- const data2 = await read({ sha256: sha2567, ...brandId2 === null ? {} : { brandId: brandId2 }, state, limit: 50, ...after ? { after } : {} });
206611
- if (!object12(data2) || !Array.isArray(data2.items) || data2.items.length > 50 || !(data2.nextCursor === null || typeof data2.nextCursor === "string" && /^[a-f0-9]{64}\.[a-f0-9-]{36}$/.test(data2.nextCursor))) throw new Error("Invalid resource search response.");
206611
+ const data = await read({ sha256: sha2567, ...brandId2 === null ? {} : { brandId: brandId2 }, state, limit: 50, ...after ? { after } : {} });
206612
+ if (!object12(data) || !Array.isArray(data.items) || data.items.length > 50 || !(data.nextCursor === null || typeof data.nextCursor === "string" && /^[a-f0-9]{64}\.[a-f0-9-]{36}$/.test(data.nextCursor))) throw new Error("Invalid resource search response.");
206612
206613
  const items = [];
206613
- for (const item of data2.items) {
206614
+ for (const item of data.items) {
206614
206615
  if (!object12(item) || typeof item.id !== "string" || !uuid3.test(item.id) || item.id <= previousId || item.sourceSha256 !== sha2567 || item.state !== state || !(item.brandId === null || typeof item.brandId === "string" && /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,79}$/.test(item.brandId)) || brandId2 !== null && item.brandId !== null && item.brandId !== brandId2) throw new Error("Resource search changed scope or did not advance.");
206615
206616
  previousId = item.id;
206616
206617
  items.push({ id: item.id, brandId: item.brandId });
206617
206618
  }
206618
206619
  const match = items.find((item) => item.brandId === brandId2);
206619
206620
  if (match) return match;
206620
- if (data2.nextCursor === null) break;
206621
- if (!items.length || cursors.has(data2.nextCursor) || data2.nextCursor.slice(65) !== previousId || after && data2.nextCursor.slice(0, 64) !== after.slice(0, 64) || page2 === 99) throw new Error("Resource search cursor repeated or exceeded the page limit.");
206622
- cursors.add(data2.nextCursor);
206623
- after = data2.nextCursor;
206621
+ if (data.nextCursor === null) break;
206622
+ if (!items.length || cursors.has(data.nextCursor) || data.nextCursor.slice(65) !== previousId || after && data.nextCursor.slice(0, 64) !== after.slice(0, 64) || page2 === 99) throw new Error("Resource search cursor repeated or exceeded the page limit.");
206623
+ cursors.add(data.nextCursor);
206624
+ after = data.nextCursor;
206624
206625
  }
206625
206626
  }
206626
206627
  return void 0;
@@ -207349,8 +207350,8 @@ function prepareCaptionStyleCues(preset2, input2) {
207349
207350
  });
207350
207351
  return { cues: out, warnings };
207351
207352
  }
207352
- function demoCaptionWords(text17, durationSeconds, emphasis = []) {
207353
- const tokens3 = text17.trim().split(/\s+/u);
207353
+ function demoCaptionWords(text18, durationSeconds, emphasis = []) {
207354
+ const tokens3 = text18.trim().split(/\s+/u);
207354
207355
  const fold4 = (s) => s.normalize("NFD").replace(new RegExp("\\p{M}", "gu"), "").toLowerCase().replace(/[^\p{L}\p{N}]/gu, "");
207355
207356
  const marked2 = new Set(emphasis.map(fold4));
207356
207357
  return { schemaVersion: 1, timeUnit: "seconds", timing: "measured", words: tokens3.map((t, i) => ({ text: t, start: i * durationSeconds / tokens3.length, end: (i + 1) * durationSeconds / tokens3.length, ...marked2.has(fold4(t)) ? { emphasis: true } : {} })) };
@@ -207367,9 +207368,9 @@ function captionLayerV3(preset2, cues, width, height, fonts, options = {}) {
207367
207368
  }
207368
207369
  if (options.layer !== void 0 && !["all", "front", "back"].includes(options.layer)) throw new Error("layer must be all|front|back.");
207369
207370
  if (options.startSeconds !== void 0 && (!Number.isFinite(options.startSeconds) || options.startSeconds < 0 || options.startSeconds > 86400)) throw new Error("Invalid caption source start seconds.");
207370
- const data2 = JSON.stringify({ preset: preset2, cues, width, height, fonts, options: { layer: "all", ...options } }).replace(/[<>&\u2028\u2029]/g, (c) => "\\u" + c.charCodeAt(0).toString(16).padStart(4, "0"));
207371
+ const data = JSON.stringify({ preset: preset2, cues, width, height, fonts, options: { layer: "all", ...options } }).replace(/[<>&\u2028\u2029]/g, (c) => "\\u" + c.charCodeAt(0).toString(16).padStart(4, "0"));
207371
207372
  return `<!doctype html><html><meta charset="utf-8"><title>Caption layer</title><style>html,body{margin:0;background:transparent;overflow:hidden}body{width:${width}px;height:${height}px;position:relative}#front,#back{position:absolute;inset:0;pointer-events:none}#back{z-index:0}#front{z-index:1}.page{position:absolute;box-sizing:border-box;white-space:normal}.line{display:block;white-space:nowrap}.w{display:inline-block;position:relative;white-space:pre}.l{display:inline-block;white-space:pre}#demo{position:absolute;left:2%;top:2%;font:14px sans-serif;color:white;background:#222;padding:6px;z-index:3}</style><div id="back"></div><div id="front"></div><div id="demo" hidden>DEMO \xB7 SYNTHETIC WORD TIMING \xB7 NOT TRANSCRIPT EVIDENCE</div><script>(()=>{
207372
- const data=${data2},p=data.preset,W=data.width,H=data.height,S=Math.min(W/p.referenceSize.width,H/p.referenceSize.height);
207373
+ const data=${data},p=data.preset,W=data.width,H=data.height,S=Math.min(W/p.referenceSize.width,H/p.referenceSize.height);
207373
207374
  const front=document.getElementById('front'),back=document.getElementById('back');
207374
207375
  document.getElementById('demo').hidden=!data.options.syntheticDemo;
207375
207376
  const loadFont=(name,f,url)=>new FontFace(name,'url('+JSON.stringify(url)+')',{weight:f.file.format==='woff2'&&f.file.source==='catalog'?String(f.weight):'100 900',style:f.italic?'italic':'normal'}).load().then(x=>document.fonts.add(x));
@@ -210754,10 +210755,39 @@ var init_style_source_data_v6 = __esm({
210754
210755
  }
210755
210756
  });
210756
210757
 
210758
+ // packages/core/src/style-source-data-v7.ts
210759
+ var styleSourceData7;
210760
+ var init_style_source_data_v7 = __esm({
210761
+ "packages/core/src/style-source-data-v7.ts"() {
210762
+ "use strict";
210763
+ styleSourceData7 = [
210764
+ {
210765
+ "id": "catalogo-editorial",
210766
+ "name": "Cat\xE1logo editorial animado",
210767
+ "summary": "Sin c\xE1mara: l\xE1minas y diagramas que se acumulan hasta revelar tu recurso descargable.",
210768
+ "needs": [
210769
+ "tu voz (o un texto para narrar)",
210770
+ "la lista del cat\xE1logo y el contenido de cada l\xE1mina",
210771
+ "tu recurso o documento y su palabra clave"
210772
+ ],
210773
+ "sourceVersion": "1.0.3",
210774
+ "sourceSha256": "06ce511146bacdc529c80801b2b29b805b57ed64bce15f1884281d7cbf036b09",
210775
+ "sourceBytes": 4860687,
210776
+ "fileCount": 62,
210777
+ "unpackedBytes": 9072158,
210778
+ "requiredPlan": "creator",
210779
+ "ratio": "tall",
210780
+ "demoSha256": "37f09c3244148068931b7e2d7ae99870511e8a7c301d36aef07b6dcb689fffc0",
210781
+ "engine": "motion-scene"
210782
+ }
210783
+ ];
210784
+ }
210785
+ });
210786
+
210757
210787
  // packages/core/src/style-sources.ts
210758
210788
  function listStyleSources() {
210759
210789
  const latest2 = /* @__PURE__ */ new Map(), versions = /* @__PURE__ */ new Map();
210760
- for (const style of styleSourceData7) {
210790
+ for (const style of styleSourceData8) {
210761
210791
  latest2.set(style.id, style);
210762
210792
  versions.set(style.id, (versions.get(style.id) ?? /* @__PURE__ */ new Set()).add(style.sourceVersion));
210763
210793
  }
@@ -210767,14 +210797,14 @@ function styleSourceAliases(style) {
210767
210797
  return style.aliases ?? [];
210768
210798
  }
210769
210799
  function resolveStyleSourceId(id5) {
210770
- if (styleSourceData7.some((style) => style.id === id5)) return id5;
210771
- return [...styleSourceData7].reverse().find((style) => styleSourceAliases(style).includes(id5))?.id;
210800
+ if (styleSourceData8.some((style) => style.id === id5)) return id5;
210801
+ return [...styleSourceData8].reverse().find((style) => styleSourceAliases(style).includes(id5))?.id;
210772
210802
  }
210773
210803
  function getStyleSource(id5, version3) {
210774
210804
  const canonical2 = resolveStyleSourceId(id5);
210775
- return styleSourceData7.find((style) => style.id === canonical2 && style.sourceVersion === version3);
210805
+ return styleSourceData8.find((style) => style.id === canonical2 && style.sourceVersion === version3);
210776
210806
  }
210777
- var styleSourceData7, STYLE_SOURCE_MAX_BYTES;
210807
+ var styleSourceData8, STYLE_SOURCE_MAX_BYTES;
210778
210808
  var init_style_sources = __esm({
210779
210809
  "packages/core/src/style-sources.ts"() {
210780
210810
  "use strict";
@@ -210784,7 +210814,8 @@ var init_style_sources = __esm({
210784
210814
  init_style_source_data_v4();
210785
210815
  init_style_source_data_v5();
210786
210816
  init_style_source_data_v6();
210787
- styleSourceData7 = [...styleSourceData, ...styleSourceData2, ...styleSourceData3, ...styleSourceData4, ...styleSourceData5, ...styleSourceData6];
210817
+ init_style_source_data_v7();
210818
+ styleSourceData8 = [...styleSourceData, ...styleSourceData2, ...styleSourceData3, ...styleSourceData4, ...styleSourceData5, ...styleSourceData6, ...styleSourceData7];
210788
210819
  STYLE_SOURCE_MAX_BYTES = 128 * 1024 * 1024;
210789
210820
  }
210790
210821
  });
@@ -210804,11 +210835,13 @@ var init_style_demos = __esm({
210804
210835
  "packages/core/src/style-demos.ts"() {
210805
210836
  "use strict";
210806
210837
  published = {
210807
- "style-demos-v2": ["catalogo-editorial", "comando-y-resultado", "documental-de-archivo", "ensayo-cinematografico", "explicador-con-evidencias", "infografia-de-objetos", "monologo-con-dipticos", "narrador-sobre-collage", "pantalla-fisica", "personaje-en-papel", "pizarra-minimalista", "presentador-con-interfaz", "ranking-con-escala", "recorrido-de-experto", "relato-ilustrado", "simulacion-en-el-mapa", "tablero-que-se-llena", "tutorial-por-capitulos", "vlog-intimo"],
210838
+ "style-demos-v2": ["comando-y-resultado", "documental-de-archivo", "ensayo-cinematografico", "explicador-con-evidencias", "infografia-de-objetos", "monologo-con-dipticos", "narrador-sobre-collage", "pantalla-fisica", "personaje-en-papel", "pizarra-minimalista", "presentador-con-interfaz", "ranking-con-escala", "recorrido-de-experto", "relato-ilustrado", "simulacion-en-el-mapa", "tablero-que-se-llena", "tutorial-por-capitulos", "vlog-intimo"],
210808
210839
  "style-demos-v3": ["analisis-con-clips", "argumento-de-valor", "comparacion-con-retratos", "demo-de-fundador", "diorama-de-objetos", "herramientas-en-pasos", "historia-cenital", "lanzamiento-con-entrevista", "podcast-con-inserts", "presentador-con-evidencia", "reto-con-reloj", "tutorial-con-etiquetas"],
210809
210840
  "style-demos-v4": ["carrera-de-datos", "documental-horizontal", "ensayo-abstracto-3d", "lobby-de-personajes", "pov-sorpresa", "sketch-dos-papeles", "tutorial-dialogado"],
210810
210841
  "style-demos-v5": ["mapa-postales", "mecanismo-macro", "parabola-de-papel", "tipografia-collage", "versus-simultaneo", "zoom-por-escalas"],
210811
- "style-demos-v6": ["arquitectura-editorial", "claridad-documental", "cocina-editorial", "concepto-en-movimiento", "diario-de-viaje", "editorial-cercano", "editorial-suave", "el-oficio-en-detalle", "energia-en-movimiento", "look-en-construccion", "producto-a-todo-color", "relato-en-capas"]
210842
+ "style-demos-v6": ["arquitectura-editorial", "claridad-documental", "cocina-editorial", "concepto-en-movimiento", "diario-de-viaje", "editorial-cercano", "editorial-suave", "el-oficio-en-detalle", "energia-en-movimiento", "look-en-construccion", "producto-a-todo-color", "relato-en-capas"],
210843
+ // catalogo-editorial 1.0.3 (source release v7): new demo without the empty frame; its 1.0.2 demo stays in style-demos-v2.
210844
+ "style-demos-v7": ["catalogo-editorial"]
210812
210845
  };
210813
210846
  folderOf = new Map(Object.entries(published).flatMap(([folder, ids2]) => ids2.map((id5) => [id5, folder])));
210814
210847
  SITE = "https://editorbrain.com";
@@ -210966,21 +210999,31 @@ var init_style_glance_data_v1 = __esm({
210966
210999
  }
210967
211000
  });
210968
211001
 
211002
+ // packages/core/src/style-glance-data-v2.ts
211003
+ var styleGlanceDataV2;
211004
+ var init_style_glance_data_v2 = __esm({
211005
+ "packages/core/src/style-glance-data-v2.ts"() {
211006
+ "use strict";
211007
+ styleGlanceDataV2 = /* data */
211008
+ { "schemaVersion": 1, "release": "v2", "folder": "style-glance-v2", "styles": { "catalogo-editorial": { "ratio": "tall", "duration": 23.2, "hero": 0, "tiles": [{ "at": 1, "start": 0.1, "end": 1.46, "slot": "gancho", "label": { "es": "Promesa en serif con la palabra clave en it\xE1lica roja subrayada", "en": "Serif promise with the key word in red italics, underlined" } }, { "at": 2, "start": 1.3, "end": 2.9, "slot": "ritmo", "label": { "es": "Corte seco a un campo rojo con una frase en it\xE1lica clara", "en": "Hard cut to a red field with a light italic phrase" } }, { "at": 3.93, "start": 3, "end": 4.8, "slot": "texto", "label": { "es": "Frase en sans negra; una palabra cambia de letra hasta quedar en it\xE1lica", "en": "Black sans phrase; one word cycles typefaces and lands in italics" } }, { "at": 5.6, "start": 4.9, "end": 7.5, "slot": "apoyo", "label": { "es": "L\xE1mina con marco fino, t\xEDtulo en it\xE1lica y diagrama versus", "en": "Plate with a thin frame, italic title and a versus diagram" } }, { "at": 12.5, "start": 11.6, "end": 14.2, "slot": "texto", "label": { "es": "T\xEDtulo en dos l\xEDneas con cuatro pasos y un pie", "en": "Two-line title with four steps and a footer" } }, { "at": 19.4, "start": 18.5, "end": 21.1, "slot": "apoyo", "label": { "es": "Mosaico con todas las l\xE1minas en tres columnas", "en": "Mosaic of every plate in three columns" } }, { "at": 23.13, "start": 20.96, "end": 23.16, "slot": "cierre", "label": { "es": "Documento que se desplaza con la promesa de enviarlo gratis", "en": "Scrolling document with the promise to send it for free" } }], "palette": [{ "name": { "es": "Fondo", "en": "Background" }, "hex": "#F2EFEC" }, { "name": { "es": "Acento", "en": "Accent" }, "hex": "#B41E2A" }, { "name": { "es": "Campo", "en": "Field" }, "hex": "#971305" }, { "name": { "es": "Tinta", "en": "Ink" }, "hex": "#15172A" }, { "name": { "es": "Verde del documento", "en": "Document green" }, "hex": "#127868" }], "type": { "es": "Instrument Serif recta e it\xE1lica; Inter 700 compacta", "en": "Instrument Serif roman and italic; tight Inter 700" } } } };
211009
+ }
211010
+ });
211011
+
210969
211012
  // packages/core/src/style-glance.ts
210970
211013
  function styleGlanceUrl(ids2) {
210971
211014
  return `${STYLE_GLANCE_PAGE}?ids=${ids2.map(encodeURIComponent).join(",")}`;
210972
211015
  }
210973
211016
  function styleGlance(id5, lang = "es", site = SITE2) {
210974
- const raw = data.styles[id5];
210975
- if (!raw) return void 0;
210976
- const base = `${site}/brand/${data.folder}/${id5}`;
211017
+ const board = boards.get(id5);
211018
+ if (!board) return void 0;
211019
+ const { raw, release, folder } = board, base = `${site}/brand/${folder}/${id5}`;
210977
211020
  const moments = raw.tiles.map((tile, index2) => {
210978
211021
  const n2 = String(index2 + 1).padStart(2, "0");
210979
211022
  return { at: tile.at, start: tile.start, end: tile.end, slot: tile.slot, label: tile.label[lang], clipUrl: `${base}/${n2}.mp4`, stillUrl: `${base}/${n2}.webp` };
210980
211023
  });
210981
211024
  return {
210982
211025
  id: id5,
210983
- release: data.release,
211026
+ release,
210984
211027
  ratio: raw.ratio === "wide" ? "wide" : "tall",
210985
211028
  seconds: raw.duration,
210986
211029
  hero: raw.hero,
@@ -211013,11 +211056,12 @@ function styleGlanceLayout(width, ratio, moments) {
211013
211056
  }
211014
211057
  return { columns, hero, palette: best.palette, recipe: best.recipe };
211015
211058
  }
211016
- var styleGlanceSlots, STYLE_GLANCE_MAX_COMPARE, SITE2, STYLE_GLANCE_PAGE, styleGlanceSlotNames, data, styleGlanceRelease, hasStyleGlance;
211059
+ var styleGlanceSlots, STYLE_GLANCE_MAX_COMPARE, SITE2, STYLE_GLANCE_PAGE, styleGlanceSlotNames, releases, boards, styleGlanceRelease, hasStyleGlance;
211017
211060
  var init_style_glance = __esm({
211018
211061
  "packages/core/src/style-glance.ts"() {
211019
211062
  "use strict";
211020
211063
  init_style_glance_data_v1();
211064
+ init_style_glance_data_v2();
211021
211065
  styleGlanceSlots = ["gancho", "texto", "presentador", "apoyo", "ritmo", "cierre"];
211022
211066
  STYLE_GLANCE_MAX_COMPARE = 3;
211023
211067
  SITE2 = "https://editorbrain.com";
@@ -211030,9 +211074,11 @@ var init_style_glance = __esm({
211030
211074
  ritmo: { es: { name: "Ritmo y cortes", hint: "C\xF3mo pasa de un plano a otro" }, en: { name: "Pace and cuts", hint: "How one shot passes to the next" } },
211031
211075
  cierre: { es: { name: "Cierre", hint: "La llamada a la acci\xF3n" }, en: { name: "Closing", hint: "The call to action" } }
211032
211076
  };
211033
- data = styleGlanceDataV1;
211034
- styleGlanceRelease = data.release;
211035
- hasStyleGlance = (id5) => Object.hasOwn(data.styles, id5);
211077
+ releases = [styleGlanceDataV1, styleGlanceDataV2];
211078
+ boards = /* @__PURE__ */ new Map();
211079
+ for (const { release, folder, styles } of releases) for (const [id5, raw] of Object.entries(styles)) boards.set(id5, { raw, release, folder });
211080
+ styleGlanceRelease = releases.at(-1).release;
211081
+ hasStyleGlance = (id5) => boards.has(id5);
211036
211082
  }
211037
211083
  });
211038
211084
 
@@ -211411,7 +211457,7 @@ var init_style_sheet_data_v1 = __esm({
211411
211457
  },
211412
211458
  "catalogo-editorial": {
211413
211459
  "seconds": 23.2,
211414
- "guideSha256": "dea681c5bde94019fb2e607ee67e7789c80bb8ab45821ff415cae0cea0de40ff",
211460
+ "guideSha256": "db88a3ba3e4f98b0dc816a72585933b84b0b8cd786e3bd267be64c432645eea1",
211415
211461
  "es": {
211416
211462
  "idealFor": [
211417
211463
  "listas y principios",
@@ -212882,9 +212928,9 @@ function styleSheetText(id5, lang = "es") {
212882
212928
  const row = sheetRows[id5];
212883
212929
  return row && { ...row[lang], seconds: row.seconds };
212884
212930
  }
212885
- function terms(text17) {
212931
+ function terms(text18) {
212886
212932
  const out = /* @__PURE__ */ new Set();
212887
- for (const raw of fold3(text17).split(/[^a-z0-9-]+/)) {
212933
+ for (const raw of fold3(text18).split(/[^a-z0-9-]+/)) {
212888
212934
  if (!raw || stop.has(raw) || raw.length < 2 || raw.length < 3 && !groups2[raw]) continue;
212889
212935
  const word = stem(raw), group = groups2[word];
212890
212936
  out.add(group ?? word);
@@ -212949,7 +212995,7 @@ function buildStyleSheet(sources, options = {}) {
212949
212995
  selected = scored.sort((a, b) => b.score - a.score || a.index - b.index).map(({ row }) => row);
212950
212996
  }
212951
212997
  const rows = selected.map(({ style, material, words: words2, onlyClip: clip }) => {
212952
- const text17 = styleSheetText(style.id, lang);
212998
+ const text18 = styleSheetText(style.id, lang);
212953
212999
  const demo = style.demoUrl ? { demoUrl: style.demoUrl, ...style.posterUrl ? { posterUrl: style.posterUrl } : {} } : styleDemo(style.id);
212954
213000
  const compact = {
212955
213001
  id: style.id,
@@ -212957,7 +213003,7 @@ function buildStyleSheet(sources, options = {}) {
212957
213003
  material,
212958
213004
  ...clip !== void 0 ? { onlyClip: clip } : {},
212959
213005
  ratio: style.ratio ?? "tall",
212960
- ...text17 ? { seconds: text17.seconds, idealFor: text17.idealFor, structure: text17.structure, feel: text17.feel, notFor: text17.notFor } : { summary: words2.summary, sheet: "missing" }
213006
+ ...text18 ? { seconds: text18.seconds, idealFor: text18.idealFor, structure: text18.structure, feel: text18.feel, notFor: text18.notFor } : { summary: words2.summary, sheet: "missing" }
212961
213007
  };
212962
213008
  if (detail !== "full") return compact;
212963
213009
  return {
@@ -213025,7 +213071,7 @@ var init_style_sheet = __esm({
213025
213071
  };
213026
213072
  sheetRows = styleSheetData.styles;
213027
213073
  styleSheetVersion = styleSheetData.sheetVersion;
213028
- fold3 = (text17) => text17.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase();
213074
+ fold3 = (text18) => text18.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase();
213029
213075
  stem = (word) => word.length > 4 && word.endsWith("es") ? word.slice(0, -2) : word.length > 3 && word.endsWith("s") ? word.slice(0, -1) : word;
213030
213076
  stop = new Set("de del la las el los un una unos unas y o en con para por que como su sus tu tus mi mis al lo es son se sin sobre entre muy mas the a an and or of to in on for with by from at is are be it its this that my your our their as into about very more video videos quiero want make hacer".split(" "));
213031
213077
  groups2 = {};
@@ -214578,8 +214624,8 @@ var init_user_guides = __esm({
214578
214624
  password: "contrasena",
214579
214625
  resume: "retomar"
214580
214626
  };
214581
- normalize3 = (text17) => text17.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, " ").trim();
214582
- tokens2 = (text17) => normalize3(text17).split(" ").filter((word) => word.length > 1 && !stopWords2.has(word)).map((word) => synonyms[word] ?? word);
214627
+ normalize3 = (text18) => text18.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, " ").trim();
214628
+ tokens2 = (text18) => normalize3(text18).split(" ").filter((word) => word.length > 1 && !stopWords2.has(word)).map((word) => synonyms[word] ?? word);
214583
214629
  records = USER_GUIDES.map((guide) => ({
214584
214630
  guide,
214585
214631
  title: new Set(tokens2(guide.title)),
@@ -223428,12 +223474,76 @@ var init_style_source_guards_v6 = __esm({
223428
223474
  }
223429
223475
  });
223430
223476
 
223477
+ // packages/core/src/style-source-guards-v7.ts
223478
+ var styleSourceGuards7;
223479
+ var init_style_source_guards_v7 = __esm({
223480
+ "packages/core/src/style-source-guards-v7.ts"() {
223481
+ "use strict";
223482
+ styleSourceGuards7 = {
223483
+ "catalogo-editorial": {
223484
+ "runtimeSha256": "aa8d22988d8ff149aac5765f021bc4412186b8fae33c00c3d48218894ff19e71",
223485
+ "adaptedRuntimeSha256": "4e0862005eef5fb62860d635756d45e0218e13f0f59342726553cc978320cece",
223486
+ "runtime": "// EditorBrain authored motion \xB7 scene runtime.\n// One canvas, explicit time: window.renderAt(seconds) draws the exact state for that time.\n// URL: ?ratio=wide|square|tall &theme=<kit> &t=<sec> &capture=1 &autoplay=1 &controls=0\n(function () {\n const RATIOS = { wide: [1920, 1080], square: [1080, 1080], tall: [1080, 1920] };\n const LIB_BASE = new URL('..', document.currentScript.src).href; // library root\n const q = new URLSearchParams(location.search);\n const capture = q.get('capture') === '1';\n\n const isObj = v => v && typeof v === 'object' && !Array.isArray(v);\n const merge = (a, b) => {\n if (!isObj(b)) return b === undefined ? a : b;\n const out = { ...(isObj(a) ? a : {}) };\n for (const k of Object.keys(b)) out[k] = merge(out[k], b[k]);\n return out;\n };\n\n function readParams() {\n const el = document.getElementById('params');\n let p = el ? JSON.parse(el.textContent) : {};\n if (window.__overrides) p = merge(p, window.__overrides);\n const enc = q.get('params');\n if (enc) { const supplied = JSON.parse(decodeURIComponent(escape(atob(enc)))); window.__overrides = merge(window.__overrides || {}, supplied); p = merge(p, supplied); }\n window.EB_VALIDATE_PARAMS(p, q);\n return p;\n }\n\n async function loadFonts(F, warn) {\n const families = new Set(Object.values(F).map(f => f.family));\n const status = {};\n for (const fam of families) {\n const defs = (window.EB_FONTS || {})[fam];\n if (!defs) {\n status[fam] = 'not-registered';\n warn(`font family not registered: ${fam}`);\n continue;\n }\n const results = await Promise.all(defs.map(async d => {\n const src = d.local ? d.local.map(n => `local(\"${n}\")`).join(', ') : `url(\"${new URL(d.src, LIB_BASE).href}\")`;\n const desc = {};\n if (d.weight) desc.weight = d.weight;\n if (d.style) desc.style = d.style;\n if (d.stretch) desc.stretch = d.stretch;\n try {\n const face = new FontFace(fam, src, desc);\n await face.load();\n document.fonts.add(face);\n return true;\n } catch (e) {\n return false;\n }\n }));\n const ok = results.filter(Boolean).length;\n status[fam] = ok === defs.length ? 'loaded' : ok ? `partial ${ok}/${defs.length}` : 'missing';\n if (!ok) warn(`font unavailable, renderer would fall back: ${fam}`);\n }\n return status;\n }\n\n function loadImage(src) {\n return new Promise((res, rej) => {\n const img = new Image();\n img.onload = () => res(img);\n img.onerror = () => rej(new Error('image failed: ' + src));\n img.src = src;\n });\n }\n\n function resolveTheme(params) {\n const kits = window.EB_THEMES || {};\n const id = q.get('theme') || params.theme || Object.keys(kits)[0];\n const kit = kits[id] || kits[Object.keys(kits)[0]];\n const brand = params.brand || {};\n const C = { ...kit.colors, ...(brand.colors || {}) };\n C.series = brand.series || kit.series;\n const F = {};\n for (const role of new Set(['display', 'text', 'heavy', 'mono', 'hand', ...Object.keys(brand.fonts || {})])) F[role] = { ...(kit.fonts[role] || kit.fonts.text), ...((brand.fonts || {})[role] || {}) };\n return { id, kit, C, F };\n }\n\n window.EB = {\n RATIOS,\n scene(def) {\n const warnings = new Set();\n const warn = m => { warnings.add(m); if (q.get(\"demo\") !== \"1\") throw new Error(m); };\n try {\n void boot(def, warn, warnings).catch(e => { window.__motionError = String(e && e.stack || e); console.error(window.__motionError); });\n } catch (e) {\n window.__motionError = String(e && e.stack || e);\n throw e;\n }\n },\n };\n\n async function boot(def, warn, warnings) {\n const P = readParams();\n const ratio = q.get('ratio') || P.ratio || 'wide';\n const [W, H] = RATIOS[ratio] || RATIOS.wide;\n const { id: themeId, C, F } = resolveTheme(P);\n const timeScale = P.timeScale || 1;\n const duration = (P.duration || def.duration || 10) * timeScale;\n const fps = P.fps || 30;\n\n document.documentElement.style.background = capture ? C.bg : '#0b0b0a';\n document.body.style.margin = '0';\n const canvas = document.createElement('canvas');\n canvas.id = 'stage';\n canvas.width = W;\n canvas.height = H;\n const ctx = canvas.getContext('2d');\n\n const S = {\n W, H, ratio, P, C, F, themeId, fps, duration, timeScale,\n u: Math.min(W, H) / 1080, // 1 unit = 1px at 1080 short side\n wide: ratio === 'wide', square: ratio === 'square', tall: ratio === 'tall',\n warn, lib: LIB_BASE, frame: 0, images: {}, beats: P.beats || {},\n };\n S.pick = (wide, square, tall) => (S.tall ? tall : S.square ? square : wide);\n\n const fontStatus = await loadFonts(F, warn);\n if (Object.values(fontStatus).some(value => value !== \"loaded\")) throw new Error(\"All registered font faces must load; fallback is not permitted.\");\n for (const [k, rel] of Object.entries(P.media || {})) {\n try { S.images[k] = await loadImage(new URL(rel, location.href).href); } catch (e) { warn(String(e.message)); }\n }\n if (def.setup) await def.setup(S, ctx);\n\n // Scenes with external frames (video clips) define `prepare(t, S)`; renderAt then returns a\n // promise that resolves after those frames are decoded, so captures stay frame-exact.\n function renderAt(t) {\n t = Math.max(0, Math.min(duration, t));\n if (def.prepare) {\n const token = (S._token = (S._token || 0) + 1);\n return Promise.resolve(def.prepare(t / timeScale, S)).then(() => (token === S._token ? paint(t) : false));\n }\n return paint(t);\n }\n function paint(t) {\n S.frame = Math.round(t * fps);\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n ctx.globalCompositeOperation = 'source-over';\n ctx.fillStyle = C.bg;\n ctx.fillRect(0, 0, W, H);\n def.draw(ctx, t / timeScale, S);\n return true;\n }\n\n const beatTime = v => (typeof v === 'number' ? v : (S.beats[v] ?? 0));\n // cues from params plus cues the scene derives from its own data (def.cues)\n const rawCues = P.sound?.enabled === false ? [] : [...((P.sound && P.sound.cues) || []), ...(def.cues ? def.cues(S) : [])];\n const cues = rawCues.map(c => ({\n t: +((beatTime(c.at) + (c.offset || 0)) * timeScale).toFixed(4),\n sfx: c.sfx, file: c.file, dur: c.dur, trim: c.trim, gain: c.gain ?? (c.file ? 0.3 : 1),\n })).sort((a, b) => a.t - b.t);\n\n window.renderAt = renderAt;\n window.__sceneMeta = { id: def.id, W, H, ratio, fps, duration, frames: Math.round(duration * fps), theme: themeId, cues, timeScale, music: P.sound?.enabled === false ? null : P.sound?.music || null, voice: P.sound?.enabled === false ? null : P.sound?.voice || null, loudness: P.sound?.enabled === false ? null : P.sound?.loudness || null };\n window.getDiagnostics = () => ({ fonts: fontStatus, warnings: [...warnings], meta: window.__sceneMeta });\n\n document.body.appendChild(canvas);\n if (capture) {\n canvas.style.cssText = 'display:block';\n await renderAt(+(q.get('t') || 0));\n window.__ready = true;\n return;\n }\n preview(canvas, renderAt, S, cues);\n window.__ready = true;\n }\n\n // ---------- interactive preview (never used for rendering) ----------\n function preview(canvas, renderAt, S, cues) {\n const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches;\n const showControls = q.get('controls') !== '0';\n const style = document.createElement('style');\n style.textContent = `\n body{height:100vh;display:flex;flex-direction:column;font:13px/1.3 -apple-system,system-ui,sans-serif;color:#e9e4da;background:#0b0b0a}\n #wrap{flex:1;display:flex;align-items:center;justify-content:center;min-height:0;padding:${showControls ? '12px' : '0'}}\n #stage{max-width:100%;max-height:100%;width:auto;height:auto;box-shadow:0 10px 40px rgba(0,0,0,.45)}\n #bar{display:flex;gap:10px;align-items:center;padding:10px 14px;background:#151412;border-top:1px solid #2a2824;flex-wrap:wrap}\n #bar button,#bar select{background:#24221f;color:#e9e4da;border:1px solid #3a3732;border-radius:6px;padding:5px 9px;font:inherit;cursor:pointer}\n #bar button.on{background:#E89A4A;color:#1b1a18;border-color:#E89A4A}\n #bar input[type=range]{flex:1;min-width:160px;accent-color:#E89A4A}\n #tm{font-variant-numeric:tabular-nums;min-width:92px}`;\n document.head.appendChild(style);\n const wrap = document.createElement('div');\n wrap.id = 'wrap';\n document.body.appendChild(wrap);\n wrap.appendChild(canvas);\n\n let t = q.has('t') ? +q.get('t') : reduced ? (S.P.reducedHold ?? S.duration * 0.9) : 0;\n let playing = !reduced && q.get('autoplay') === '1';\n let last = null;\n let sound = q.get('sound') === '1';\n const audio = audioEngine(cues, S);\n\n let range, tm, playBtn, soundBtn;\n if (showControls) {\n const bar = document.createElement('div');\n bar.id = 'bar';\n bar.innerHTML = `<button id=\"pp\"></button><input id=\"rg\" type=\"range\" min=\"0\" max=\"${S.duration}\" step=\"${1 / S.fps}\"><span id=\"tm\"></span>\n <span>${['wide', 'square', 'tall'].map(r => `<button data-r=\"${r}\" class=\"${r === S.ratio ? 'on' : ''}\">${{ wide: '16:9', square: '1:1', tall: '9:16' }[r]}</button>`).join(' ')}</span>\n <select id=\"th\">${Object.entries(window.EB_THEMES).map(([k, v]) => `<option value=\"${k}\" ${k === S.themeId ? 'selected' : ''}>${v.label}</option>`).join('')}</select>\n <button id=\"snd\"></button>`;\n document.body.appendChild(bar);\n range = bar.querySelector('#rg');\n tm = bar.querySelector('#tm');\n playBtn = bar.querySelector('#pp');\n soundBtn = bar.querySelector('#snd');\n const go = (k, v) => { const u = new URL(location.href); u.searchParams.set(k, v); u.searchParams.delete('t'); location.href = u.href; };\n bar.querySelectorAll('[data-r]').forEach(b => b.onclick = () => go('ratio', b.dataset.r));\n bar.querySelector('#th').onchange = e => go('theme', e.target.value);\n playBtn.onclick = toggle;\n soundBtn.onclick = () => { sound = !sound; audio.stop(); if (sound && playing) audio.start(t); sync(); };\n range.oninput = () => { t = +range.value; audio.stop(); if (playing && sound) audio.start(t); draw(); };\n }\n addEventListener('keydown', e => { if (e.code === 'Space') { e.preventDefault(); toggle(); } });\n canvas.onclick = toggle;\n function toggle() {\n playing = !playing;\n if (playing && t >= S.duration - 0.01) t = 0;\n last = null;\n audio.stop();\n if (playing && sound) audio.start(t);\n sync();\n }\n function sync() {\n if (!showControls) return;\n playBtn.textContent = playing ? 'Pausa' : 'Reproducir';\n soundBtn.textContent = sound ? 'Sonido: s\xED' : 'Sonido: no';\n soundBtn.className = sound ? 'on' : '';\n soundBtn.disabled = !cues.length;\n if (!cues.length) soundBtn.textContent = 'Sin sonido';\n }\n function draw() {\n renderAt(t);\n if (showControls) {\n range.value = t;\n tm.textContent = `${t.toFixed(2)} / ${S.duration.toFixed(1)} s`;\n }\n }\n // Pause off-screen / hidden tabs.\n let visible = true;\n new IntersectionObserver(es => { visible = es[0].isIntersecting; }).observe(canvas);\n function loop(now) {\n if (playing && visible && !document.hidden) {\n if (last !== null) t += (now - last) / 1000;\n if (t >= S.duration) {\n t = q.get('loop') === '0' ? S.duration : 0;\n if (q.get('loop') === '0') playing = false;\n audio.stop();\n if (playing && sound) audio.start(t);\n }\n draw();\n }\n last = playing ? now : null;\n requestAnimationFrame(loop);\n }\n sync();\n draw();\n requestAnimationFrame(loop);\n }\n\n // Preview-only audio: schedules the scene's cues from the synthesized SFX bank.\n function audioEngine(cues, S) {\n let ac = null, nodes = [];\n const buffers = {};\n async function buf(name) {\n if (!buffers[name]) {\n const r = await fetch(new URL(`sfx/${name}.wav`, S.lib));\n buffers[name] = await ac.decodeAudioData(await r.arrayBuffer());\n }\n return buffers[name];\n }\n return {\n async start(from) {\n if (!cues.length) return;\n ac = ac || new AudioContext();\n const t0 = ac.currentTime + 0.05;\n for (const c of cues) {\n if (c.t < from - 0.02) continue;\n const b = await buf(c.sfx);\n const src = ac.createBufferSource(), g = ac.createGain();\n src.buffer = b;\n g.gain.value = c.gain;\n src.connect(g).connect(ac.destination);\n src.start(t0 + (c.t - from));\n nodes.push(src);\n }\n },\n stop() { nodes.forEach(n => { try { n.stop(); } catch (e) {} }); nodes = []; },\n };\n }\n})();\n",
223487
+ "guard": `// Portable safety wrapper; original scene source is separately hashed.
223488
+ (function () {
223489
+ const fail = message => { throw new Error('EditorBrain project binding: ' + message); };
223490
+ const record = value => value && typeof value === 'object' && !Array.isArray(value);
223491
+ const colors = ['bg','surface','ink','muted','line','accent','accent2','pos','neg'];
223492
+ const fonts = ['display','text','heavy','mono','hand'];
223493
+ window.EB_VALIDATE_PARAMS = (p, q) => {
223494
+ const theme = q.get('theme') || p.theme;
223495
+ if (!Object.hasOwn(window.EB_THEMES || {}, theme)) fail('unknown theme');
223496
+ const ratio = q.get('ratio') || p.ratio || 'wide';
223497
+ if (!['wide','square','tall'].includes(ratio)) fail('unknown ratio');
223498
+ for (const [key, min, max] of [['duration',0.1,300],['fps',1,60],['timeScale',0.1,10]]) {
223499
+ if (p[key] !== undefined && (typeof p[key] !== 'number' || !Number.isFinite(p[key]) || p[key] < min || p[key] > max)) fail(key + ' outside supported range');
223500
+ }
223501
+ if ((p.timeScale ?? 1) !== 1 && (p.sound?.voice || p.sound?.music)) fail('voice/music require timeScale=1 until explicit audio retiming is implemented');
223502
+ if (p.sound?.enabled !== undefined && typeof p.sound.enabled !== 'boolean') fail('sound.enabled must be boolean');
223503
+ if (q.get('demo') === '1') return;
223504
+ const b = window.__overrides?.brand;
223505
+ if (!record(b) || !record(b.colors) || !record(b.fonts)) fail('provide complete window.__overrides.brand from the selected project; demo themes are not customer defaults');
223506
+ for (const role of colors) if (!/^#[0-9a-f]{6}$/i.test(b.colors[role] || '')) fail('missing color role ' + role);
223507
+ if (typeof b.colors.dark !== 'boolean') fail('colors.dark must be explicit');
223508
+ if (!Array.isArray(b.series) || b.series.length < 6 || b.series.some(c => !/^#[0-9a-f]{6}$/i.test(c))) fail('provide at least six explicit series hex colors; roles may repeat project colors but never inherit demo colors');
223509
+ for (const role of fonts) {
223510
+ const font = b.fonts[role];
223511
+ if (!record(font) || typeof font.family !== 'string' || !font.family.trim() || !Number.isFinite(font.weight) || font.weight < 100 || font.weight > 1000 || !['normal','italic','oblique'].includes(font.style)) fail('provide explicit family, weight and style for font role ' + role);
223512
+ if (!Object.hasOwn(window.EB_FONTS || {}, font.family)) fail('register local font files in EB_FONTS: ' + font.family);
223513
+ }
223514
+ if (!record(window.__overrides.sound) || typeof window.__overrides.sound.enabled !== 'boolean') fail('set sound.enabled from project preferences');
223515
+ };
223516
+ })();
223517
+
223518
+ (function () {
223519
+ const base = window.EB_VALIDATE_PARAMS;
223520
+ const roles = ["accent","bg","cta","doc","docAccent","docGap","docMint","docNavy","field","fieldGlow","fieldInk","icon","ink","line","muted","rule","sheet","soft","title"];
223521
+ const fontRoles = ["alt1","alt2","hand","label","sans","serif","small"];
223522
+ window.EB_VALIDATE_PARAMS = (params, query) => {
223523
+ base(params, query);
223524
+ if (query.get('demo') === '1') return;
223525
+ for (const role of roles) {
223526
+ if (!/^#[0-9a-f]{6}$/i.test(window.__overrides?.brand?.colors?.[role] || '')) throw new Error('EditorBrain project binding: provide scene-specific color role ' + role + '; never inherit demo/preset brand colors.');
223527
+ }
223528
+ for (const role of fontRoles) {
223529
+ const font = window.__overrides?.brand?.fonts?.[role];
223530
+ if (!font || typeof font.family !== 'string' || !font.family.trim() || !Number.isFinite(font.weight) || font.weight < 100 || font.weight > 1000 || !['normal','italic','oblique'].includes(font.style)) throw new Error('EditorBrain project binding: provide complete scene-specific font role ' + role + '; never inherit demo/preset typography.');
223531
+ if (!Object.hasOwn(window.EB_FONTS || {}, font.family)) throw new Error('EditorBrain project binding: register local font files for role ' + role + ': ' + font.family);
223532
+ }
223533
+ };
223534
+ })();
223535
+ `
223536
+ }
223537
+ };
223538
+ }
223539
+ });
223540
+
223431
223541
  // packages/core/src/style-source-guards.ts
223432
223542
  function getStyleSourceGuard(id5, version3) {
223433
- for (let i = releases.length - 1; i >= 0; i--) if (releases[i].some((s) => s.id === id5 && s.sourceVersion === version3)) return byRelease[i][id5];
223543
+ for (let i = releases2.length - 1; i >= 0; i--) if (releases2[i].some((s) => s.id === id5 && s.sourceVersion === version3)) return byRelease[i][id5];
223434
223544
  return void 0;
223435
223545
  }
223436
- var releases, byRelease, styleSourceGuards7;
223546
+ var releases2, byRelease, styleSourceGuards8;
223437
223547
  var init_style_source_guards = __esm({
223438
223548
  "packages/core/src/style-source-guards.ts"() {
223439
223549
  "use strict";
@@ -223443,15 +223553,17 @@ var init_style_source_guards = __esm({
223443
223553
  init_style_source_guards_v4();
223444
223554
  init_style_source_guards_v5();
223445
223555
  init_style_source_guards_v6();
223556
+ init_style_source_guards_v7();
223446
223557
  init_style_source_data_v1();
223447
223558
  init_style_source_data_v2();
223448
223559
  init_style_source_data_v3();
223449
223560
  init_style_source_data_v4();
223450
223561
  init_style_source_data_v5();
223451
223562
  init_style_source_data_v6();
223452
- releases = [styleSourceData, styleSourceData2, styleSourceData3, styleSourceData4, styleSourceData5, styleSourceData6];
223453
- byRelease = [styleSourceGuards, styleSourceGuards2, styleSourceGuards3, styleSourceGuards4, styleSourceGuards5, styleSourceGuards6];
223454
- styleSourceGuards7 = { ...styleSourceGuards, ...styleSourceGuards2, ...styleSourceGuards3, ...styleSourceGuards4, ...styleSourceGuards5, ...styleSourceGuards6 };
223563
+ init_style_source_data_v7();
223564
+ releases2 = [styleSourceData, styleSourceData2, styleSourceData3, styleSourceData4, styleSourceData5, styleSourceData6, styleSourceData7];
223565
+ byRelease = [styleSourceGuards, styleSourceGuards2, styleSourceGuards3, styleSourceGuards4, styleSourceGuards5, styleSourceGuards6, styleSourceGuards7];
223566
+ styleSourceGuards8 = { ...styleSourceGuards, ...styleSourceGuards2, ...styleSourceGuards3, ...styleSourceGuards4, ...styleSourceGuards5, ...styleSourceGuards6, ...styleSourceGuards7 };
223455
223567
  }
223456
223568
  });
223457
223569
 
@@ -224011,8 +224123,8 @@ function parseBatchReviewArtifact(value) {
224011
224123
  });
224012
224124
  return result2;
224013
224125
  }
224014
- function batchArtifactProjects(data2) {
224015
- return data2.stage === "directions" ? (data2.projectIds ?? []).map((projectId) => ({ projectId, contextVersion: data2.contextVersions?.[projectId] ?? null })) : (data2.items ?? []).map((item) => ({ projectId: item.projectId, contextVersion: item.contextVersion ?? null }));
224126
+ function batchArtifactProjects(data) {
224127
+ return data.stage === "directions" ? (data.projectIds ?? []).map((projectId) => ({ projectId, contextVersion: data.contextVersions?.[projectId] ?? null })) : (data.items ?? []).map((item) => ({ projectId: item.projectId, contextVersion: item.contextVersion ?? null }));
224016
224128
  }
224017
224129
  var BATCH_REVIEW_MAX_ITEMS, invalid4, hash7, UUID, isBatchReviewArtifact;
224018
224130
  var init_review_batch_artifact = __esm({
@@ -224236,10 +224348,10 @@ function studioPreferences(snapshot2, locale = "es") {
224236
224348
  const fields3 = [];
224237
224349
  const en = locale === "en", say = (label3) => en ? english2[label3] ?? label3 : label3, unset = en ? "Not set yet" : "Por definir";
224238
224350
  const add = (id5, group, label3, value, choices2) => {
224239
- const text17 = value === void 0 || value === null ? unset : typeof value === "string" ? value : JSON.stringify(value);
224351
+ const text18 = value === void 0 || value === null ? unset : typeof value === "string" ? value : JSON.stringify(value);
224240
224352
  const options = choices2?.map(([value2, label4]) => ({ value: value2, label: say(label4) }));
224241
- if (options && !options.some((o) => o.value === text17)) options.unshift({ value: text17, label: text17 });
224242
- fields3.push({ id: id5, group, label: say(label3), value: text17.slice(0, 2e3) || unset, ...options ? { options } : {} });
224353
+ if (options && !options.some((o) => o.value === text18)) options.unshift({ value: text18, label: text18 });
224354
+ fields3.push({ id: id5, group, label: say(label3), value: text18.slice(0, 2e3) || unset, ...options ? { options } : {} });
224243
224355
  };
224244
224356
  add("identity.name", "brand", "Nombre", snapshot2.identity?.name ?? snapshot2.brandId);
224245
224357
  add("identity.audience", "brand", "A qui\xE9n le hablas", snapshot2.identity?.audience);
@@ -224430,7 +224542,7 @@ var init_studio_preferences = __esm({
224430
224542
  function isCliVersion(value) {
224431
224543
  return typeof value === "string" && value.trim() === value && /^(?:0|[1-9]\d{0,5})\.(?:0|[1-9]\d{0,5})\.(?:0|[1-9]\d{0,5})$/.test(value);
224432
224544
  }
224433
- var CLI_0_53_0, CLI_0_54_1, CLI_0_55_0, CLI_0_56_0, CLI_0_57_0, CLI_0_58_0, CLI_0_59_0, CLI_0_60_0, PRODUCT_RELEASE_NOTICES;
224545
+ var CLI_0_53_0, CLI_0_54_1, CLI_0_55_0, CLI_0_56_0, CLI_0_57_0, CLI_0_58_0, CLI_0_59_0, CLI_0_60_0, CLI_0_61_0, PRODUCT_RELEASE_NOTICES;
224434
224546
  var init_client_releases = __esm({
224435
224547
  "packages/core/src/client-releases.ts"() {
224436
224548
  "use strict";
@@ -224482,7 +224594,23 @@ var init_client_releases = __esm({
224482
224594
  notesUrl: "https://editorbrain.com/docs/versiones",
224483
224595
  updateGuideUrl: "https://editorbrain.com/docs/actualizar"
224484
224596
  });
224597
+ CLI_0_61_0 = Object.freeze({
224598
+ version: "0.61.0",
224599
+ publishedAt: "2026-11-26T04:16:03.848Z",
224600
+ notesUrl: "https://editorbrain.com/docs/versiones",
224601
+ updateGuideUrl: "https://editorbrain.com/docs/actualizar"
224602
+ });
224485
224603
  PRODUCT_RELEASE_NOTICES = Object.freeze([
224604
+ Object.freeze({
224605
+ ...CLI_0_61_0,
224606
+ id: "cli-0.61.0",
224607
+ title: "Mira un estilo en segundos",
224608
+ summary: "Cada uno de los 56 estilos tiene ahora su muestrario: sus momentos clave en video corto, en una sola pantalla.",
224609
+ highlights: Object.freeze([
224610
+ "Compara dos o tres estilos lado a lado, momento por momento: el gancho, el texto, el cierre.",
224611
+ "P\xEDdeselo a tu IA en el chat (\xABens\xE9\xF1ame un estilo minimalista\xBB, \xABcomp\xE1ralo con\u2026\xBB) y te lo abre al instante, tambi\xE9n con tus propios videos."
224612
+ ])
224613
+ }),
224486
224614
  Object.freeze({
224487
224615
  ...CLI_0_60_0,
224488
224616
  id: "cli-0.60.0",
@@ -224828,27 +224956,27 @@ function lastWordEndSeconds(value, duration3) {
224828
224956
  if (last > duration3 * 5 && last / 1e3 <= duration3 + 1) last /= 1e3;
224829
224957
  return last > duration3 + 1 ? null : round3(last, 3);
224830
224958
  }
224831
- function isContactText(text17, words2 = 2) {
224832
- if (/^\S\s+[a-z0-9-]+\.[a-z]{2,}\//i.test(text17) || /\.[a-z]{2,}(\/[^\s/]+){2,}/i.test(text17)) return false;
224833
- if (CONTACT_WORDS.test(text17)) return true;
224834
- if (words2 === 1 && HANDLE.test(text17) && !(/^[O0]/.test(text17) && WORD_ENDING.test(text17))) return true;
224835
- const digits = (text17.match(/\d/g) ?? []).length;
224836
- if (/^\D*\b(?:1\d{3}|20\d{2})\s*[-–]\s*(?:1\d{3}|20\d{2})\b\D*$/.test(text17) && digits === 8) return false;
224837
- return digits >= 7 && /\d{2,}[\s-]?\d{3,}/.test(text17) && !DATE.test(text17);
224959
+ function isContactText(text18, words2 = 2) {
224960
+ if (/^\S\s+[a-z0-9-]+\.[a-z]{2,}\//i.test(text18) || /\.[a-z]{2,}(\/[^\s/]+){2,}/i.test(text18)) return false;
224961
+ if (CONTACT_WORDS.test(text18)) return true;
224962
+ if (words2 === 1 && HANDLE.test(text18) && !(/^[O0]/.test(text18) && WORD_ENDING.test(text18))) return true;
224963
+ const digits = (text18.match(/\d/g) ?? []).length;
224964
+ if (/^\D*\b(?:1\d{3}|20\d{2})\s*[-–]\s*(?:1\d{3}|20\d{2})\b\D*$/.test(text18) && digits === 8) return false;
224965
+ return digits >= 7 && /\d{2,}[\s-]?\d{3,}/.test(text18) && !DATE.test(text18);
224838
224966
  }
224839
224967
  function textLines(m, th = QUALITY_THRESHOLDS) {
224840
224968
  const groups3 = /* @__PURE__ */ new Map();
224841
224969
  for (const w of m.words) if (w.confidence >= th.ocrConfidence && alnum(w.text) >= 1) groups3.set(w.line, [...groups3.get(w.line) ?? [], w]);
224842
224970
  const lines = [];
224843
224971
  for (const words2 of groups3.values()) {
224844
- const text17 = words2.map((w) => w.text).join(" ");
224845
- if (alnum(text17) < 2) continue;
224972
+ const text18 = words2.map((w) => w.text).join(" ");
224973
+ if (alnum(text18) < 2) continue;
224846
224974
  const top = Math.min(...words2.map((w) => w.y)), bottom = Math.max(...words2.map((w) => w.y + w.height));
224847
224975
  const left = Math.min(...words2.map((w) => w.x)), right = Math.max(...words2.map((w) => w.x + w.width));
224848
224976
  const heights = words2.filter((w) => alnum(w.text) >= 2).map((w) => w.height).sort((a, b) => a - b);
224849
224977
  const h = heights.length ? Math.min(bottom - top, heights[Math.floor(heights.length / 2)] * 1.15) : bottom - top;
224850
- const line = { text: text17, x: left, y: top, width: right - left, height: bottom - top, heightPct: round3(h / m.height, 4), confidence: round3(words2.reduce((a, w) => a + w.confidence, 0) / words2.length, 1), contact: isContactText(text17, words2.length) };
224851
- if (line.heightPct < 0.01 && (alnum(text17) < 3 || line.confidence < 80 || !words2.some((w) => alnum(w.text) >= 3))) continue;
224978
+ const line = { text: text18, x: left, y: top, width: right - left, height: bottom - top, heightPct: round3(h / m.height, 4), confidence: round3(words2.reduce((a, w) => a + w.confidence, 0) / words2.length, 1), contact: isContactText(text18, words2.length) };
224979
+ if (line.heightPct < 0.01 && (alnum(text18) < 3 || line.confidence < 80 || !words2.some((w) => alnum(w.text) >= 3))) continue;
224852
224980
  lines.push(line);
224853
224981
  }
224854
224982
  return lines;
@@ -225097,8 +225225,8 @@ function qualityFindings(input2, th = QUALITY_THRESHOLDS) {
225097
225225
  const contactRead = (l) => l.contact && l.confidence >= 80;
225098
225226
  const byText = (hits) => {
225099
225227
  const groups3 = /* @__PURE__ */ new Map();
225100
- const keyOf = (text17) => {
225101
- const t = text17.toLowerCase(), digits = t.replace(/\D/g, "");
225228
+ const keyOf = (text18) => {
225229
+ const t = text18.toLowerCase(), digits = t.replace(/\D/g, "");
225102
225230
  if (digits.length >= 7) return `tel:${digits.slice(-7)}`;
225103
225231
  const bare = /^[o0©®@]([a-z0-9_.]{6,})$/.exec(t.trim());
225104
225232
  if (bare) return `id:@${bare[1]}`;
@@ -225281,8 +225409,8 @@ function parseDenseKinds(value, duration3) {
225281
225409
  if (!kinds4.length || kinds4.some((k) => !["hook", "ending", "cuts", "motion"].includes(k))) throw new Error("--dense takes any of hook,ending,cuts,motion (or none).");
225282
225410
  return [...new Set(kinds4)];
225283
225411
  }
225284
- function compareSide(duration3, motion2, text17, loudness) {
225285
- const mains = text17.map((t) => t.mainPct).filter((x) => x !== null), smallest = text17.map((t) => t.smallestPct).filter((x) => x !== null);
225412
+ function compareSide(duration3, motion2, text18, loudness) {
225413
+ const mains = text18.map((t) => t.mainPct).filter((x) => x !== null), smallest = text18.map((t) => t.smallestPct).filter((x) => x !== null);
225286
225414
  return {
225287
225415
  duration: round3(duration3),
225288
225416
  cuts: motion2.cuts.length,
@@ -225292,7 +225420,7 @@ function compareSide(duration3, motion2, text17, loudness) {
225292
225420
  textMainPct: mains.length ? [round3(Math.min(...mains) * 100, 1), round3(Math.max(...mains) * 100, 1)] : null,
225293
225421
  textSmallestPct: smallest.length ? round3(Math.min(...smallest) * 100, 1) : null,
225294
225422
  loudnessLufs: loudness,
225295
- textMeasured: text17.some((t) => t.status === "complete")
225423
+ textMeasured: text18.some((t) => t.status === "complete")
225296
225424
  };
225297
225425
  }
225298
225426
  function compareNotes(out, ref) {
@@ -225400,7 +225528,7 @@ var init_course_formats = __esm({
225400
225528
  COURSE_FORMAT_ID = /^[a-z0-9][a-z0-9-]{2,79}$/;
225401
225529
  isCourseFormatId = (value) => typeof value === "string" && COURSE_FORMAT_ID.test(value);
225402
225530
  isCourseFormatVersion = (value) => typeof value === "string" && SEMVER.test(value);
225403
- MEDIA_LIMITS2 = { demo: { bytes: 200 * 1024 * 1024, seconds: 600 }, preview: { bytes: 20 * 1024 * 1024, seconds: 30 }, thumbnail: { bytes: 4 * 1024 * 1024 }, original: { bytes: 2 * 1024 * 1024 } };
225531
+ MEDIA_LIMITS2 = { demo: { bytes: 200 * 1024 * 1024, seconds: 600 }, preview: { bytes: 20 * 1024 * 1024, seconds: 30 }, thumbnail: { bytes: 4 * 1024 * 1024 }, original: { bytes: 2 * 1024 * 1024 }, "glance-clip": { bytes: 2 * 1024 * 1024, seconds: 4 }, "glance-still": { bytes: 512 * 1024 } };
225404
225532
  isSafeCourseFormatKitPath = (path) => path.length <= 200 && /^editorbrain-(?:cursos|curso-[a-z0-9][a-z0-9-]{2,79})\/[A-Za-z0-9._/-]+$/.test(path) && !path.split("/").some((part) => part === "" || part.startsWith("."));
225405
225533
  }
225406
225534
  });
@@ -226893,6 +227021,10 @@ function safeDiagnosticDetails(body) {
226893
227021
  if (typeof e.code === "string" && Object.hasOwn(searchProviderErrors, e.code)) return {};
226894
227022
  const details = {};
226895
227023
  if (e.code === "resource_plan_required" && e.feature === "render_storage_beta") return { feature: "render_storage_beta" };
227024
+ if (e.code === "resource_plan_required" && e.requiredPlan === "community") {
227025
+ const message = typeof e.message === "string" && e.message.length <= 2e3 ? sanitizeErrorMessage(e.message).trim() : "";
227026
+ return message ? { requiredPlan: "community", message } : { requiredPlan: "community" };
227027
+ }
226896
227028
  if (e.code === "cloud_access_required") return {};
226897
227029
  if (e.code === "review_required") {
226898
227030
  if (typeof e.projectId === "string" && /^[a-zA-Z0-9_-]{1,80}$/.test(e.projectId)) details.projectId = e.projectId;
@@ -226985,22 +227117,22 @@ async function boundedText2(response, limit = 16 * 1024 * 1024) {
226985
227117
  }
226986
227118
  parts.push(value);
226987
227119
  }
226988
- const data2 = new Uint8Array(length);
227120
+ const data = new Uint8Array(length);
226989
227121
  let offset = 0;
226990
227122
  for (const part of parts) {
226991
- data2.set(part, offset);
227123
+ data.set(part, offset);
226992
227124
  offset += part.length;
226993
227125
  }
226994
227126
  try {
226995
- return new TextDecoder("utf-8", { fatal: true }).decode(data2);
227127
+ return new TextDecoder("utf-8", { fatal: true }).decode(data);
226996
227128
  } catch {
226997
227129
  throw new CliError("INVALID_RESPONSE", "The API did not return valid UTF-8.", "Check the endpoint and service status.");
226998
227130
  }
226999
227131
  }
227000
227132
  async function boundedJson(response, limit = 16 * 1024 * 1024) {
227001
- const text17 = await boundedText2(response, limit);
227133
+ const text18 = await boundedText2(response, limit);
227002
227134
  try {
227003
- return JSON.parse(text17);
227135
+ return JSON.parse(text18);
227004
227136
  } catch {
227005
227137
  throw new CliError("INVALID_RESPONSE", "The API did not return valid JSON.", "Check the endpoint and service status.");
227006
227138
  }
@@ -227198,7 +227330,7 @@ ${conflicts.join("\n")}`, "Run pull --dry-run and reconcile the reported paths."
227198
227330
  await saveSyncState(root, state);
227199
227331
  return { downloaded, unchanged: unchanged2 };
227200
227332
  }
227201
- var searchProviderErrors, searchErrors, firstCreationConflicts, briefAllowed, ApiError, UnsupportedDocumentError, RATE_LIMIT_CODE, RATE_LIMIT_TRANSFER_WAIT_MS, RATE_LIMIT_CALL_WAIT_MS, RATE_LIMIT_MIN_PAUSE_MS, RATE_LIMIT_MAX_PAUSE_MS, RATE_LIMIT_DEFAULT_PAUSE_MS, Client;
227333
+ var searchProviderErrors, searchErrors, firstCreationConflicts, briefAllowed, COMMUNITY_RESOURCE_HINT, ApiError, UnsupportedDocumentError, RATE_LIMIT_CODE, RATE_LIMIT_TRANSFER_WAIT_MS, RATE_LIMIT_CALL_WAIT_MS, RATE_LIMIT_MIN_PAUSE_MS, RATE_LIMIT_MAX_PAUSE_MS, RATE_LIMIT_DEFAULT_PAUSE_MS, Client;
227202
227334
  var init_client = __esm({
227203
227335
  "packages/cli/src/client.ts"() {
227204
227336
  "use strict";
@@ -227363,7 +227495,7 @@ var init_client = __esm({
227363
227495
  team_seat_limit: { status: 409, code: "TEAM_SEAT_LIMIT", hint: "Run editorbrain team members and inspect editorSeats. Ask the owner to review the indicated plan upgrade at https://editorbrain.com/app/billing or explicitly remove an editor or cancel a pending invitation. Existing editors use one seat across brands; reviewers use none. Buying credits does not add editor seats." },
227364
227496
  invitation_email_limit: { status: 429, code: "INVITATION_EMAIL_LIMIT", hint: "Invitation email is rate-limited for 24 hours, independently of credits. Wait; cancelling or recreating invitations does not reset this limit. Check existing invitations with editorbrain team members." },
227365
227497
  invitation_pending: { status: 409, code: "INVITATION_PENDING", hint: "Run editorbrain team members. Review the pending invitation before canceling or creating a replacement." },
227366
- search_allowance_exhausted: { status: 429, code: "SEARCH_ALLOWANCE_EXHAUSTED", hint: "Consult your search allowance in Plan y cr\xE9ditos." },
227498
+ search_allowance_exhausted: { status: 429, code: "SEARCH_ALLOWANCE_EXHAUSTED", hint: "The library searches (\xABb\xFAsquedas en la biblioteca\xBB) of this cycle are used up. Check when they renew in Plan y cr\xE9ditos; credits do not add searches." },
227367
227499
  studio_unavailable: { status: 503, code: "STUDIO_UNAVAILABLE", hint: "This EditorBrain tool is not activated. No generation was started." },
227368
227500
  studio_insufficient_credits: { status: 402, code: "STUDIO_INSUFFICIENT_CREDITS", hint: "Check studio catalog for available creative credits. Reconnecting does not replenish credits." },
227369
227501
  studio_quote_expired: { status: 409, code: "STUDIO_QUOTE_EXPIRED", hint: "Request a new quote and review its price before authorizing." },
@@ -227410,6 +227542,7 @@ var init_client = __esm({
227410
227542
  "The guide or your access changed. Read the current state."
227411
227543
  ]);
227412
227544
  briefAllowed = { "source.inspected": "script, frames, motion, audio (still photos are frames)", "source.kind": "script, video or mixed", eventQueries: "at most 2 entries, each a string or {query, channels}" };
227545
+ COMMUNITY_RESOURCE_HINT = "Tell the person the service message as written: it names the plans that include this library. Do not add a plan, purchase or invitation of your own; buying credits does not unlock it.";
227413
227546
  ApiError = class extends CliError {
227414
227547
  constructor(status2, body, retryAfterMs, safeToRetry = false) {
227415
227548
  const codes = {
@@ -227423,10 +227556,13 @@ var init_client = __esm({
227423
227556
  const details = diagnostic ? safeDiagnosticDetails(body) : {};
227424
227557
  const briefFields = diagnostic?.serviceCode === "invalid_search_brief" ? rejectedBriefFields({ error: { message: `Invalid fields: ${String(body?.error?.invalidFields ?? "")}. ` } }) : void 0;
227425
227558
  if (briefFields?.length) details.invalidFields = briefFields.join(",");
227426
- const recovery2 = diagnostic ? recoveryGuidance(diagnostic.serviceCode, status2, details) : void 0;
227559
+ const community = diagnostic?.serviceCode === "resource_plan_required" && details.requiredPlan === "community";
227560
+ const recovery2 = diagnostic && !community ? recoveryGuidance(diagnostic.serviceCode, status2, details) : void 0;
227561
+ const serviceMessage = community ? details.message : void 0;
227562
+ if (community) delete details.message;
227427
227563
  const preferenceHint = diagnostic?.serviceCode === "studio_preference_conflict" && details.conflict === "narration" ? 'Read workflow and the returned projectPath/documentPath. Only after an explicit user request, save narrationOverride={value:"voiceover",reason:"user-requested reason"} in this project.json, then choose an authorized public voice with studio voices and studio voice VOICE_ID --project ID --expected-revision N. Preserve the brand. Quote again; a preference exception never authorizes spending.' : diagnostic?.serviceCode === "studio_preference_conflict" && details.conflict === "voice_selection" ? "Read workflow and studio voice --project ID. Reconcile the requested public alias with the authorized saved voice using studio voices; a deliberate change uses studio voice VOICE_ID --project ID --expected-revision N. Preserve original/no-narration restrictions and the brand. Quote again; a voice selection never authorizes spending." : void 0;
227428
- const message = diagnostic && Object.hasOwn(searchProviderErrors, diagnostic.serviceCode) ? recovery2?.message ?? "El proveedor de b\xFAsqueda de EditorBrain no pudo completar la solicitud." : diagnostic?.serviceCode === "review_required" ? "The required visual presentation or approval is not recorded for this project context." : diagnostic?.serviceCode === "first_creation_conflict" ? typeof details.reason === "string" ? details.reason : "The first session refused this step." : diagnostic?.serviceCode === "brand_limit_reached" ? `Este espacio alcanz\xF3 su l\xEDmite de marcas${typeof details.used === "number" && typeof details.limit === "number" ? ` (${details.used}/${details.limit})` : ""}.` : `API request failed (HTTP ${status2}).`;
227429
- super(diagnostic?.code ?? code, message, recovery2 ? recoveryHint(recovery2) : preferenceHint ?? (briefFields ? briefHint(briefFields) : void 0) ?? diagnostic?.hint ?? hint2, !diagnostic && safeToRetry && (status2 === 429 || status2 >= 500), { status: status2, ...recovery2 ? { recovery: recovery2 } : {}, ...diagnostic ? { serviceCode: diagnostic.serviceCode, ...details } : {}, ...retryAfterMs === void 0 ? {} : { retryAfterMs } });
227564
+ const message = diagnostic && Object.hasOwn(searchProviderErrors, diagnostic.serviceCode) ? recovery2?.message ?? "El proveedor de b\xFAsqueda de EditorBrain no pudo completar la solicitud." : community ? typeof serviceMessage === "string" ? serviceMessage : "This resource is not included in your plan." : diagnostic?.serviceCode === "review_required" ? "The required visual presentation or approval is not recorded for this project context." : diagnostic?.serviceCode === "first_creation_conflict" ? typeof details.reason === "string" ? details.reason : "The first session refused this step." : diagnostic?.serviceCode === "brand_limit_reached" ? `Este espacio alcanz\xF3 su l\xEDmite de marcas${typeof details.used === "number" && typeof details.limit === "number" ? ` (${details.used}/${details.limit})` : ""}.` : `API request failed (HTTP ${status2}).`;
227565
+ super(diagnostic?.code ?? code, message, recovery2 ? recoveryHint(recovery2) : community ? COMMUNITY_RESOURCE_HINT : preferenceHint ?? (briefFields ? briefHint(briefFields) : void 0) ?? diagnostic?.hint ?? hint2, !diagnostic && safeToRetry && (status2 === 429 || status2 >= 500), { status: status2, ...recovery2 ? { recovery: recovery2 } : {}, ...diagnostic ? { serviceCode: diagnostic.serviceCode, ...details } : {}, ...retryAfterMs === void 0 ? {} : { retryAfterMs } });
227430
227566
  this.status = status2;
227431
227567
  this.body = body;
227432
227568
  }
@@ -227529,13 +227665,13 @@ var init_client = __esm({
227529
227665
  }
227530
227666
  parts.push(value);
227531
227667
  }
227532
- const data2 = new Uint8Array(n2);
227668
+ const data = new Uint8Array(n2);
227533
227669
  let offset = 0;
227534
227670
  for (const part of parts) {
227535
- data2.set(part, offset);
227671
+ data.set(part, offset);
227536
227672
  offset += part.length;
227537
227673
  }
227538
- return data2;
227674
+ return data;
227539
227675
  }
227540
227676
  /** Catalog caption font bytes (OFL woff2). The caller verifies the SHA-256 before use. */
227541
227677
  async captionFont(sha) {
@@ -227565,13 +227701,13 @@ var init_client = __esm({
227565
227701
  });
227566
227702
  }
227567
227703
  if (!n2) throw new Error("Empty caption font");
227568
- const data2 = new Uint8Array(n2);
227704
+ const data = new Uint8Array(n2);
227569
227705
  let offset = 0;
227570
227706
  for (const part of parts) {
227571
- data2.set(part, offset);
227707
+ data.set(part, offset);
227572
227708
  offset += part.length;
227573
227709
  }
227574
- return data2;
227710
+ return data;
227575
227711
  }
227576
227712
  async renderDeliveryChunk(path, start4, end4, total) {
227577
227713
  if (!/^\/v1\/render-cloud\/[a-f0-9-]{36}\/delivery\/content$/.test(path) || !Number.isSafeInteger(start4) || !Number.isSafeInteger(end4) || !Number.isSafeInteger(total) || start4 < 0 || end4 < start4 || end4 >= total || end4 - start4 + 1 > 4 * 1024 * 1024) throw new Error("Invalid render delivery range");
@@ -227694,8 +227830,8 @@ var init_client = __esm({
227694
227830
  return this.request("/v1/me");
227695
227831
  }
227696
227832
  async list(prefix = "") {
227697
- const data2 = await this.request("/v1/documents" + (prefix ? "?" + new URLSearchParams({ prefix }) : ""));
227698
- return data2.documents;
227833
+ const data = await this.request("/v1/documents" + (prefix ? "?" + new URLSearchParams({ prefix }) : ""));
227834
+ return data.documents;
227699
227835
  }
227700
227836
  async get(path) {
227701
227837
  return this.request(`/v1/documents/${safeDocumentPath(path).split("/").map(encodeURIComponent).join("/")}`);
@@ -227743,7 +227879,7 @@ var init_client = __esm({
227743
227879
  return this.media(path, { content, mimeType });
227744
227880
  }
227745
227881
  async media(path, options = {}) {
227746
- if (!/^\/v1\/assets\/[a-f0-9]{64}(?:\?|$)/.test(path) && !(!options.content && /^\/v1\/library\/[^/?#]+\/media\/[a-f0-9]{64}$/.test(path))) throw new Error("Invalid asset endpoint");
227882
+ if (!/^\/v1\/assets\/[a-f0-9]{64}(?:\?|$)/.test(path) && !(!options.content && (/^\/v1\/library\/[^/?#]+\/media\/[a-f0-9]{64}$/.test(path) || /^\/v1\/course-formats\/[a-z0-9][a-z0-9-]{2,79}\/media\/glance-\d{2}(?:-still)?$/.test(path)))) throw new Error("Invalid asset endpoint");
227747
227883
  const headers = await this.authHeaders();
227748
227884
  if (options.content) {
227749
227885
  headers["Content-Type"] = options.mimeType ?? "application/octet-stream";
@@ -227908,11 +228044,11 @@ async function memoryUsageCommand(client, root, flags) {
227908
228044
  const path = `/v1/projects/${encodeURIComponent(projectId)}/memory-usage`;
227909
228045
  if (flags.file === void 0) return client.request(path + (flags.after ? "?" + new URLSearchParams({ after: flags.after }) : ""));
227910
228046
  if (typeof flags.file !== "string" || !flags.file) fail6("--file requires a JSON receipt path.");
227911
- const data2 = await readProductionJson(root, flags.file);
227912
- if (!data2 || typeof data2 !== "object" || Array.isArray(data2) || "projectId" in data2 && data2.projectId !== projectId) fail6("The receipt projectId must match --project.");
228047
+ const data = await readProductionJson(root, flags.file);
228048
+ if (!data || typeof data !== "object" || Array.isArray(data) || "projectId" in data && data.projectId !== projectId) fail6("The receipt projectId must match --project.");
227913
228049
  let body;
227914
228050
  try {
227915
- body = parseMemoryUsage({ ...data2, projectId });
228051
+ body = parseMemoryUsage({ ...data, projectId });
227916
228052
  } catch (error62) {
227917
228053
  return fail6(error62.message);
227918
228054
  }
@@ -228735,28 +228871,28 @@ var reviewControlsEnglish = [
228735
228871
  ];
228736
228872
  var ordered = (pairs) => [...pairs].sort((a, b) => b[0].length - a[0].length);
228737
228873
  var cache = /* @__PURE__ */ new Map();
228738
- function localizeReviewText(text17, pairs) {
228874
+ function localizeReviewText(text18, pairs) {
228739
228875
  let sorted = cache.get(pairs);
228740
228876
  if (!sorted) {
228741
228877
  sorted = ordered(pairs);
228742
228878
  cache.set(pairs, sorted);
228743
228879
  }
228744
- for (const [es, en] of sorted) text17 = text17.split(es).join(en);
228745
- return text17;
228880
+ for (const [es, en] of sorted) text18 = text18.split(es).join(en);
228881
+ return text18;
228746
228882
  }
228747
228883
 
228748
228884
  // packages/core/src/review-artifact-html.ts
228749
228885
  function reviewApp() {
228750
- const data2 = JSON.parse(document.getElementById("review-data").textContent);
228886
+ const data = JSON.parse(document.getElementById("review-data").textContent);
228751
228887
  const $ = (id5) => document.getElementById(id5);
228752
- const text17 = (tag, value, cls = "") => {
228888
+ const text18 = (tag, value, cls = "") => {
228753
228889
  const node2 = document.createElement(tag);
228754
228890
  node2.textContent = value;
228755
228891
  node2.className = cls;
228756
228892
  return node2;
228757
228893
  };
228758
228894
  const button = (label3, run4, cls = "") => {
228759
- const node2 = text17("button", label3, cls);
228895
+ const node2 = text18("button", label3, cls);
228760
228896
  node2.type = "button";
228761
228897
  node2.onclick = run4;
228762
228898
  return node2;
@@ -228769,7 +228905,7 @@ function reviewApp() {
228769
228905
  let point, parentCommentId, commentKind;
228770
228906
  let likedAspects = [];
228771
228907
  let notes2 = [], choice = "", approval = false;
228772
- const moments = Array.isArray(data2.moments) ? data2.moments : [];
228908
+ const moments = Array.isArray(data.moments) ? data.moments : [];
228773
228909
  const variantChoices = /* @__PURE__ */ Object.create(null), momentNotes = /* @__PURE__ */ Object.create(null);
228774
228910
  let activeMoment = 0;
228775
228911
  const activeVariant = /* @__PURE__ */ Object.create(null);
@@ -228777,23 +228913,23 @@ function reviewApp() {
228777
228913
  let learningChoices = {};
228778
228914
  let removed, storageOk = true, restoredDraft = "", copied = false;
228779
228915
  let step = 1;
228780
- const key = "editorbrain:review:" + data2.artifactId;
228916
+ const key = "editorbrain:review:" + data.artifactId;
228781
228917
  const note = $("note");
228782
228918
  const player = $("player");
228783
228919
  let mediaReady = false;
228784
- const isDirections = data2.stage === "directions";
228785
- const hasDirections = isDirections && Array.isArray(data2.directions) && data2.directions.length > 0;
228920
+ const isDirections = data.stage === "directions";
228921
+ const hasDirections = isDirections && Array.isArray(data.directions) && data.directions.length > 0;
228786
228922
  const momentsReady = () => moments.every((m) => !!variantChoices[m.id]);
228787
228923
  const directionsReady = () => (!hasDirections || !!choice) && momentsReady();
228788
- const isDelivery = data2.stage === "delivery";
228789
- if (data2.surface === "cloud") {
228924
+ const isDelivery = data.stage === "delivery";
228925
+ if (data.surface === "cloud") {
228790
228926
  $("review-location").textContent = "Studio \xB7 Revisi\xF3n privada";
228791
228927
  $("phone").hidden = true;
228792
228928
  }
228793
228929
  const approvalReady = () => approval && mediaReady && !player.hidden && !note.value.trim();
228794
228930
  const guide = $("review-guide");
228795
228931
  const guideButton = $("how-it-works");
228796
- const guideSteps = data2.view === "preferences" ? [["Revisa tu marca", "Estas son las preferencias del proyecto seleccionado."], ["Prepara una propuesta", "Abre una fila para elegir un cambio. Puedes descartarlo."], ["Copia para tu IA", "Pega la propuesta en el mismo chat. Nada se guarda autom\xE1ticamente."], ["Confirma el alcance", "Decide con tu agente si cambia solo este video o tu preferencia guardada."]] : isDirections && !hasDirections ? [
228932
+ const guideSteps = data.view === "preferences" ? [["Revisa tu marca", "Estas son las preferencias del proyecto seleccionado."], ["Prepara una propuesta", "Abre una fila para elegir un cambio. Puedes descartarlo."], ["Copia para tu IA", "Pega la propuesta en el mismo chat. Nada se guarda autom\xE1ticamente."], ["Confirma el alcance", "Decide con tu agente si cambia solo este video o tu preferencia guardada."]] : isDirections && !hasDirections ? [
228797
228933
  ["Compara las versiones", "Cada fila es un momento del video. Reproduce sus versiones juntas."],
228798
228934
  ["Elige una por momento", "Pulsa Elegir en la que prefieras. Tu IA marca una recomendada."],
228799
228935
  ["Copia tu elecci\xF3n", "El mensaje incluye cada momento y la versi\xF3n elegida."],
@@ -228809,13 +228945,13 @@ function reviewApp() {
228809
228945
  ["Guarda tus comentarios", "Guarda cada nota y pulsa Enviar cambios para ver el mensaje completo."],
228810
228946
  ["Copia y pega en tu chat", "Copia el mensaje y p\xE9galo en la misma conversaci\xF3n de Claude o Codex."]
228811
228947
  ];
228812
- $("guide-title").textContent = data2.view === "preferences" ? "Revisa tus preferencias" : isDirections ? hasDirections ? "Elige la direcci\xF3n de tu video" : "Elige una versi\xF3n por momento" : isDelivery ? "Revisa y aprueba la entrega" : "Revisa tu video sin complicarte";
228948
+ $("guide-title").textContent = data.view === "preferences" ? "Revisa tus preferencias" : isDirections ? hasDirections ? "Elige la direcci\xF3n de tu video" : "Elige una versi\xF3n por momento" : isDelivery ? "Revisa y aprueba la entrega" : "Revisa tu video sin complicarte";
228813
228949
  for (const [title, description] of guideSteps) {
228814
- const item = text17("li", "");
228815
- item.append(text17("strong", title), text17("p", description));
228950
+ const item = text18("li", "");
228951
+ item.append(text18("strong", title), text18("p", description));
228816
228952
  $("guide-steps").append(item);
228817
228953
  }
228818
- $("guide-approval").hidden = isDirections || data2.view === "preferences";
228954
+ $("guide-approval").hidden = isDirections || data.view === "preferences";
228819
228955
  $("guide-approval").textContent = isDelivery ? "Sin cambios: pulsa Aprobar esta entrega y copia la aprobaci\xF3n al chat." : "Sin cambios: pulsa Me gusta esta versi\xF3n y copia la aprobaci\xF3n al chat.";
228820
228956
  guideButton.onclick = () => {
228821
228957
  for (const video of Array.from(document.querySelectorAll("video"))) video.pause();
@@ -228827,14 +228963,14 @@ function reviewApp() {
228827
228963
  try {
228828
228964
  const saved = JSON.parse(localStorage.getItem(key) || "null");
228829
228965
  if (saved) {
228830
- for (const proposal of data2.learnings ?? []) {
228966
+ for (const proposal of data.learnings ?? []) {
228831
228967
  const value = saved.learningChoices?.[proposal.id];
228832
228968
  if (value && ["project", "style", "series", "format", "brand"].includes(value.target)) {
228833
228969
  learningChoices[proposal.id] = { selected: value.selected === true, target: value.target };
228834
228970
  }
228835
228971
  }
228836
228972
  notes2 = Array.isArray(saved.notes) ? saved.notes.filter((n2) => n2 && typeof n2.id === "string" && typeof n2.text === "string" && n2.text.length <= 1500 && [n2.startMs, n2.endMs].every((t) => t === void 0 || Number.isFinite(t) && t >= 0 && t <= 36e6) && (n2.segmentId === void 0 || typeof n2.segmentId === "string") && (!n2.point || n2.startMs !== void 0 && [n2.point.x, n2.point.y].every((v) => Number.isFinite(v) && v >= 0 && v <= 1)) && (n2.endMs === void 0 || n2.startMs !== void 0 && n2.endMs > n2.startMs)).slice(0, 100) : [];
228837
- choice = data2.directions?.some((d2) => d2.id === saved.choice) ? saved.choice : "";
228973
+ choice = data.directions?.some((d2) => d2.id === saved.choice) ? saved.choice : "";
228838
228974
  for (const m of moments) {
228839
228975
  const own6 = (map2) => map2 && typeof map2 === "object" && Object.prototype.hasOwnProperty.call(map2, m.id) ? map2[m.id] : void 0;
228840
228976
  const v = own6(saved.variantChoices);
@@ -228878,16 +229014,16 @@ function reviewApp() {
228878
229014
  }
228879
229015
  const kindLabel = (kind3) => ({ hook: "Gancho", title: "T\xEDtulo", cta: "Cierre", captions: "Subt\xEDtulos" })[kind3] ?? "Momento";
228880
229016
  const letter = (m, variantId) => String.fromCharCode(65 + Math.max(0, m.variants.findIndex((v) => v.id === variantId)));
228881
- const feedback2 = () => ({ schemaVersion: 1, kind: "editorbrain.review-feedback", projectId: data2.projectId, artifactId: data2.artifactId, version: data2.version, videoSha256: data2.video?.sha256 ?? null, ...data2.video?.masterSha256 ? { masterSha256: data2.video.masterSha256 } : {}, stage: data2.stage, contextVersion: data2.contextVersion ?? null, ...data2.surface === "cloud" ? { revisionId: data2.revisionBindings?.find((b) => b.slot === (data2.stage === "directions" ? choice || (moments[0] && variantChoices[moments[0].id] ? "moment:" + moments[0].id + ":" + variantChoices[moments[0].id] : "") : "video"))?.revisionId ?? null } : {}, scope: "project", directionId: choice || null, ...moments.length ? { variantChoices: { ...variantChoices }, ...Object.values(momentNotes).some((v) => v.trim()) ? { momentNotes: Object.fromEntries(Object.entries(momentNotes).filter(([, v]) => v.trim()).map(([k, v]) => [k, v.trim()])) } : {} } : {}, decision: approvalReady() ? data2.stage === "delivery" ? "approve_final" : "approve_sample" : "changes", comments: notes2, ...approvalReady() ? { likedAspects, learningRequests: (data2.learnings ?? []).filter((p) => learningChoices[p.id]?.selected).map((p) => ({ ...p, target: learningChoices[p.id].target, context: data2.learningContext, userConfirmed: true })) } : {} });
229017
+ const feedback2 = () => ({ schemaVersion: 1, kind: "editorbrain.review-feedback", projectId: data.projectId, artifactId: data.artifactId, version: data.version, videoSha256: data.video?.sha256 ?? null, ...data.video?.masterSha256 ? { masterSha256: data.video.masterSha256 } : {}, stage: data.stage, contextVersion: data.contextVersion ?? null, ...data.surface === "cloud" ? { revisionId: data.revisionBindings?.find((b) => b.slot === (data.stage === "directions" ? choice || (moments[0] && variantChoices[moments[0].id] ? "moment:" + moments[0].id + ":" + variantChoices[moments[0].id] : "") : "video"))?.revisionId ?? null } : {}, scope: "project", directionId: choice || null, ...moments.length ? { variantChoices: { ...variantChoices }, ...Object.values(momentNotes).some((v) => v.trim()) ? { momentNotes: Object.fromEntries(Object.entries(momentNotes).filter(([, v]) => v.trim()).map(([k, v]) => [k, v.trim()])) } : {} } : {}, decision: approvalReady() ? data.stage === "delivery" ? "approve_final" : "approve_sample" : "changes", comments: notes2, ...approvalReady() ? { likedAspects, learningRequests: (data.learnings ?? []).filter((p) => learningChoices[p.id]?.selected).map((p) => ({ ...p, target: learningChoices[p.id].target, context: data.learningContext, userConfirmed: true })) } : {} });
228882
229018
  const draftWarning = () => note.value.trim() ? "Hay un comentario sin guardar. No interpretes este mensaje como una aprobaci\xF3n ni como la lista completa de cambios. P\xEDdeme guardar el comentario y volver a copiar la indicaci\xF3n.\n\n" : "";
228883
229019
  const prompt = () => {
228884
229020
  const payload = feedback2();
228885
- return agentHandoffPrompt({ kind: "studio", projectId: data2.projectId, version: data2.version, artifactId: data2.artifactId, revisionId: payload.revisionId ?? null, stage: data2.stage, decision: payload.decision, directionId: payload.directionId, variantChoices: moments.filter((m) => variantChoices[m.id]).map((m) => {
229021
+ return agentHandoffPrompt({ kind: "studio", projectId: data.projectId, version: data.version, artifactId: data.artifactId, revisionId: payload.revisionId ?? null, stage: data.stage, decision: payload.decision, directionId: payload.directionId, variantChoices: moments.filter((m) => variantChoices[m.id]).map((m) => {
228886
229022
  const v = m.variants.find((item) => item.id === variantChoices[m.id]);
228887
229023
  return { momentId: m.id, variantId: v.id, momentTitle: m.title, variantTitle: `${letter(m, v.id)} \xB7 ${v.title}`, ...kindLabel(m.kind) !== m.title ? { kind: kindLabel(m.kind) } : {}, ...momentNotes[m.id]?.trim() ? { note: momentNotes[m.id].trim() } : {} };
228888
- }), comments: notes2, draftPending: !!note.value.trim(), previewOnly: data2.video?.purpose === "preview" && !data2.video?.masterSha256, masterSha256: data2.video?.masterSha256 ?? null, learningRequests: payload.learningRequests?.length ?? 0, payload });
229024
+ }), comments: notes2, draftPending: !!note.value.trim(), previewOnly: data.video?.purpose === "preview" && !data.video?.masterSha256, masterSha256: data.video?.masterSha256 ?? null, learningRequests: payload.learningRequests?.length ?? 0, payload });
228889
229025
  };
228890
- const phonePrompt = () => `Quiero revisar en mi tel\xE9fono esta versi\xF3n de EditorBrain: proyecto ${data2.projectId}, versi\xF3n ${data2.version}, artifactId ${data2.artifactId}, video SHA-256 ${data2.video?.sha256 ?? "sin video"}. Mant\xE9n \xABEn computadora\xBB como opci\xF3n principal. ${data2.stage === "directions" ? "Mu\xE9strame estas propuestas con im\xE1genes ligeras en el chat m\xF3vil; todav\xEDa no hay una muestra de video para registrar." : "Autorizo subir solo una copia ligera de esta muestra a mi proyecto privado de EditorBrain. Reutiliza la copia y el registro si ya existen; verifica el hash, el contexto, el espacio disponible y las reservas antes de subir. Conserva originales y master en mi computadora. No subas originales para completar una transcripci\xF3n. Si falta espacio, conserva la revisi\xF3n local y ofrece alternativas sin borrar archivos ni cambiar mi plan. Devu\xE9lveme el enlace autenticado al proyecto, nunca localhost ni un enlace p\xFAblico. Comprueba reproducci\xF3n y versi\xF3n. No crees un enlace hasta confirmar la subida y el registro."} Esto no aprueba la edici\xF3n ni autoriza generar contenido de pago. Mis comentarios locales no se sincronizan solos; te adjunto los guardados para que los concilies antes de continuar.
229026
+ const phonePrompt = () => `Quiero revisar en mi tel\xE9fono esta versi\xF3n de EditorBrain: proyecto ${data.projectId}, versi\xF3n ${data.version}, artifactId ${data.artifactId}, video SHA-256 ${data.video?.sha256 ?? "sin video"}. Mant\xE9n \xABEn computadora\xBB como opci\xF3n principal. ${data.stage === "directions" ? "Mu\xE9strame estas propuestas con im\xE1genes ligeras en el chat m\xF3vil; todav\xEDa no hay una muestra de video para registrar." : "Autorizo subir solo una copia ligera de esta muestra a mi proyecto privado de EditorBrain. Reutiliza la copia y el registro si ya existen; verifica el hash, el contexto, el espacio disponible y las reservas antes de subir. Conserva originales y master en mi computadora. No subas originales para completar una transcripci\xF3n. Si falta espacio, conserva la revisi\xF3n local y ofrece alternativas sin borrar archivos ni cambiar mi plan. Devu\xE9lveme el enlace autenticado al proyecto, nunca localhost ni un enlace p\xFAblico. Comprueba reproducci\xF3n y versi\xF3n. No crees un enlace hasta confirmar la subida y el registro."} Esto no aprueba la edici\xF3n ni autoriza generar contenido de pago. Mis comentarios locales no se sincronizan solos; te adjunto los guardados para que los concilies antes de continuar.
228891
229027
 
228892
229028
  ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", decision: "request_phone_review" }, null, 2)}`;
228893
229029
  function renderSteps() {
@@ -228974,10 +229110,10 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
228974
229110
  $("draft-count").textContent = `${note.value.length} / 1500`;
228975
229111
  }
228976
229112
  function renderSummary() {
228977
- const chosen = data2.directions?.find((d2) => d2.id === choice);
229113
+ const chosen = data.directions?.find((d2) => d2.id === choice);
228978
229114
  const pendingDraft = !!note.value.trim();
228979
229115
  $("summary-title").textContent = pendingDraft ? "Comentario sin guardar" : isDirections ? "Tu elecci\xF3n" : approvalReady() ? "Aprobaci\xF3n preparada" : `${notes2.length} ${notes2.length === 1 ? "cambio para tu agente" : "cambios para tu agente"}`;
228980
- $("summary-detail").textContent = pendingDraft ? "Guarda tu comentario para preparar una indicaci\xF3n completa. Todav\xEDa no hay una aprobaci\xF3n lista para enviar." : isDirections ? [chosen?.title, moments.length ? `${moments.filter((m) => variantChoices[m.id]).length} de ${moments.length} momentos elegidos` : ""].filter(Boolean).join(" \xB7 ") : `${data2.version} \xB7 ${approvalReady() ? "Se enviar\xE1 \xFAnicamente la aprobaci\xF3n de esta versi\xF3n." : "Tu agente aplicar\xE1 estos ajustes. Esta vista todav\xEDa muestra la versi\xF3n anterior."}`;
229116
+ $("summary-detail").textContent = pendingDraft ? "Guarda tu comentario para preparar una indicaci\xF3n completa. Todav\xEDa no hay una aprobaci\xF3n lista para enviar." : isDirections ? [chosen?.title, moments.length ? `${moments.filter((m) => variantChoices[m.id]).length} de ${moments.length} momentos elegidos` : ""].filter(Boolean).join(" \xB7 ") : `${data.version} \xB7 ${approvalReady() ? "Se enviar\xE1 \xFAnicamente la aprobaci\xF3n de esta versi\xF3n." : "Tu agente aplicar\xE1 estos ajustes. Esta vista todav\xEDa muestra la versi\xF3n anterior."}`;
228981
229117
  }
228982
229118
  function refreshOutput() {
228983
229119
  $("request").value = prompt();
@@ -228994,7 +229130,7 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
228994
229130
  $("notes").replaceChildren();
228995
229131
  $("markers").replaceChildren();
228996
229132
  for (const item of [...notes2].sort((a, b) => (a.startMs ?? -1) - (b.startMs ?? -1))) {
228997
- const card = text17("article", "", item.startMs === void 0 ? "general-note" : ""), head = text17("div", "", "note-head");
229133
+ const card = text18("article", "", item.startMs === void 0 ? "general-note" : ""), head = text18("div", "", "note-head");
228998
229134
  const jump = button(item.startMs === void 0 ? item.segmentId ? "Frase del original" : "Todo el video" : time3(item.startMs) + (item.endMs !== void 0 ? "\u2013" + time3(item.endMs) : ""), () => {
228999
229135
  if (item.startMs !== void 0) {
229000
229136
  setStep(2, false);
@@ -229010,7 +229146,7 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229010
229146
  update();
229011
229147
  $("undo").hidden = false;
229012
229148
  }));
229013
- card.append(head, text17("p", item.text));
229149
+ card.append(head, text18("p", item.text));
229014
229150
  $("notes").append(card);
229015
229151
  if (item.startMs !== void 0) {
229016
229152
  const marker = button(time3(item.startMs), () => seek(item.startMs));
@@ -229044,11 +229180,11 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229044
229180
  persist();
229045
229181
  studioController?.refresh();
229046
229182
  }
229047
- $("title").textContent = data2.title;
229048
- $("version").textContent = data2.version;
229183
+ $("title").textContent = data.title;
229184
+ $("version").textContent = data.version;
229049
229185
  $("phase").textContent = isDirections ? "Propuestas para este video" : isDelivery ? "Entrega" : "Revisi\xF3n";
229050
229186
  $(isDirections ? "phase-directions" : isDelivery ? "phase-delivery" : "phase-review").setAttribute("aria-current", "step");
229051
- $("media-quality").textContent = data2.video?.purpose === "preview" ? `Vista previa${data2.video.quality ? " \xB7 " + data2.video.quality + "p" : ""} \xB7 Revisa cortes, textos y audio` : data2.video?.purpose === "final" ? "Render final" : "Vista de revisi\xF3n";
229187
+ $("media-quality").textContent = data.video?.purpose === "preview" ? `Vista previa${data.video.quality ? " \xB7 " + data.video.quality + "p" : ""} \xB7 Revisa cortes, textos y audio` : data.video?.purpose === "final" ? "Render final" : "Vista de revisi\xF3n";
229052
229188
  $("step-watch").onclick = () => setStep(1);
229053
229189
  $("step-change").onclick = () => setStep(2);
229054
229190
  $("step-send").onclick = () => setStep(3);
@@ -229164,7 +229300,7 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229164
229300
  const blob = new Blob([JSON.stringify(feedback2(), null, 2)], { type: "application/json" });
229165
229301
  const url3 = URL.createObjectURL(blob), anchor2 = document.createElement("a");
229166
229302
  anchor2.href = url3;
229167
- anchor2.download = `${data2.projectId}-review-${data2.artifactId.slice(0, 8)}.json`;
229303
+ anchor2.download = `${data.projectId}-review-${data.artifactId.slice(0, 8)}.json`;
229168
229304
  anchor2.click();
229169
229305
  setTimeout(() => URL.revokeObjectURL(url3), 1e3);
229170
229306
  status2("Adjunta el archivo descargado al mismo chat. Todav\xEDa no se ha enviado al agente.");
@@ -229191,8 +229327,8 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229191
229327
  { title: "Audio y ritmo", items: [["Baja la m\xFAsica", "Baja la m\xFAsica para que se entienda mejor la voz."], ["Deja respirar", "Dale un poco m\xE1s de tiempo a este momento."], ["Hazlo m\xE1s \xE1gil", "Acorta este tramo manteniendo la idea completa."]] }
229192
229328
  ];
229193
229329
  for (const group of templateGroups) {
229194
- const block = text17("section", "");
229195
- block.append(text17("h4", group.title));
229330
+ const block = text18("section", "");
229331
+ block.append(text18("h4", group.title));
229196
229332
  for (const [title, suggestion] of group.items) block.append(button(title, () => {
229197
229333
  const next = note.value.trim() ? note.value + "\n" + suggestion : suggestion;
229198
229334
  if (next.length > 1500) {
@@ -229206,7 +229342,7 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229206
229342
  $("template-groups").append(block);
229207
229343
  }
229208
229344
  for (const [id5, labelText] of [["rhythm", "Ritmo"], ["captions", "Subt\xEDtulos"], ["music", "M\xFAsica"], ["visuals", "Visuales"], ["ending", "Cierre"]]) {
229209
- const label3 = text17("label", "", "liked-aspect"), check3 = document.createElement("input");
229345
+ const label3 = text18("label", "", "liked-aspect"), check3 = document.createElement("input");
229210
229346
  check3.type = "checkbox";
229211
229347
  check3.checked = likedAspects.includes(id5);
229212
229348
  check3.onchange = () => {
@@ -229216,14 +229352,14 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229216
229352
  label3.append(check3, document.createTextNode(labelText));
229217
229353
  $("liked-aspects").append(label3);
229218
229354
  }
229219
- for (const proposal of data2.learnings ?? []) {
229220
- const item = text17("article", ""), label3 = text17("label", ""), check3 = document.createElement("input");
229355
+ for (const proposal of data.learnings ?? []) {
229356
+ const item = text18("article", ""), label3 = text18("label", ""), check3 = document.createElement("input");
229221
229357
  check3.type = "checkbox";
229222
229358
  check3.checked = learningChoices[proposal.id]?.selected ?? false;
229223
229359
  const select = document.createElement("select");
229224
229360
  select.setAttribute("aria-label", "Alcance: " + proposal.text);
229225
229361
  for (const [value, title] of [["project", "Solo este video"], ["style", "Este estilo, dentro de mi marca"], ["series", "Esta serie"], ["format", "Este formato"], ["brand", "Toda mi marca"]]) {
229226
- if (value === "series" && !data2.learningContext?.seriesId || value === "format" && !data2.learningContext?.formatId) continue;
229362
+ if (value === "series" && !data.learningContext?.seriesId || value === "format" && !data.learningContext?.formatId) continue;
229227
229363
  const option = document.createElement("option");
229228
229364
  option.value = value;
229229
229365
  option.textContent = title;
@@ -229240,7 +229376,7 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229240
229376
  check3.onchange = save;
229241
229377
  select.onchange = save;
229242
229378
  label3.append(check3, document.createTextNode(proposal.text));
229243
- item.append(label3, text17("p", proposal.conditions || "Revisar seg\xFAn la escena.", "muted"), text17("p", "De tu correcci\xF3n: " + proposal.origin.evidence, "muted"), select);
229379
+ item.append(label3, text18("p", proposal.conditions || "Revisar seg\xFAn la escena.", "muted"), text18("p", "De tu correcci\xF3n: " + proposal.origin.evidence, "muted"), select);
229244
229380
  $("learning-options").append(item);
229245
229381
  }
229246
229382
  const momentRows = [];
@@ -229249,7 +229385,7 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229249
229385
  const done = moments.filter((m) => variantChoices[m.id]).length, ready = directionsReady();
229250
229386
  $("moments-count").textContent = `${done} de ${moments.length} ${moments.length === 1 ? "momento elegido" : "momentos elegidos"}`;
229251
229387
  $("moments-pills").replaceChildren(...moments.map((m) => {
229252
- const pill = text17("span", "", "moment-pill" + (variantChoices[m.id] ? " chosen" : ""));
229388
+ const pill = text18("span", "", "moment-pill" + (variantChoices[m.id] ? " chosen" : ""));
229253
229389
  pill.title = m.title;
229254
229390
  return pill;
229255
229391
  }));
@@ -229276,7 +229412,7 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229276
229412
  }
229277
229413
  $("moment-chips").replaceChildren(...moments.map((m) => {
229278
229414
  const v = m.variants.find((item) => item.id === variantChoices[m.id]);
229279
- const chip = text17("span", `${kindLabel(m.kind)} ${v ? letter(m, v.id) + " \xB7 " + v.title : "\xB7 sin elegir"}`, "moment-chip" + (v ? " chosen" : ""));
229415
+ const chip = text18("span", `${kindLabel(m.kind)} ${v ? letter(m, v.id) + " \xB7 " + v.title : "\xB7 sin elegir"}`, "moment-chip" + (v ? " chosen" : ""));
229280
229416
  return chip;
229281
229417
  }));
229282
229418
  const pending = moments.length - done, copyButton = $("moment-copy");
@@ -229309,21 +229445,21 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229309
229445
  }
229310
229446
  };
229311
229447
  $("moment-tabs").append(tab);
229312
- const card = text17("article", "", "moment");
229448
+ const card = text18("article", "", "moment");
229313
229449
  card.id = "moment-" + m.id;
229314
229450
  card.dataset.moment = m.id;
229315
229451
  card.setAttribute("aria-labelledby", "moment-title-" + m.id);
229316
- const info = text17("div", "", "moment-info"), heading = text17("div", "", "moment-heading");
229317
- heading.append(text17("span", String(index2 + 1).padStart(2, "0"), "moment-index"), text17("span", kindLabel(m.kind), "moment-kind"));
229318
- const title = text17("h3", m.title);
229452
+ const info = text18("div", "", "moment-info"), heading = text18("div", "", "moment-heading");
229453
+ heading.append(text18("span", String(index2 + 1).padStart(2, "0"), "moment-index"), text18("span", kindLabel(m.kind), "moment-kind"));
229454
+ const title = text18("h3", m.title);
229319
229455
  title.id = "moment-title-" + m.id;
229320
229456
  info.append(heading, title);
229321
- if (m.at) info.append(text17("p", `${time3(m.at.startMs)} \u2013 ${time3(m.at.endMs)}`, "moment-time"));
229457
+ if (m.at) info.append(text18("p", `${time3(m.at.startMs)} \u2013 ${time3(m.at.endMs)}`, "moment-time"));
229322
229458
  const recommended = m.variants.find((v) => v.id === m.recommendedVariantId);
229323
229459
  if (recommended) {
229324
- const advice = text17("div", "", "moment-advice");
229325
- advice.append(text17("strong", `Tu IA recomienda ${letter(m, recommended.id)} \xB7 ${recommended.title}`));
229326
- if (m.recommendationReason) advice.append(text17("p", m.recommendationReason));
229460
+ const advice = text18("div", "", "moment-advice");
229461
+ advice.append(text18("strong", `Tu IA recomienda ${letter(m, recommended.id)} \xB7 ${recommended.title}`));
229462
+ if (m.recommendationReason) advice.append(text18("p", m.recommendationReason));
229327
229463
  info.append(advice);
229328
229464
  }
229329
229465
  const videos = [];
@@ -229344,10 +229480,10 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229344
229480
  }
229345
229481
  }, "moment-play");
229346
229482
  play.setAttribute("aria-label", `Reproducir o pausar las versiones de ${m.title} a la vez`);
229347
- const progress2 = text17("div", "", "moment-progress"), bar = text17("span", "");
229483
+ const progress2 = text18("div", "", "moment-progress"), bar = text18("span", "");
229348
229484
  progress2.append(bar);
229349
229485
  progress2.setAttribute("aria-hidden", "true");
229350
- const noteLabel = text17("label", "Nota para este momento \xB7 opcional", "moment-note"), noteInput = document.createElement("input");
229486
+ const noteLabel = text18("label", "Nota para este momento \xB7 opcional", "moment-note"), noteInput = document.createElement("input");
229351
229487
  noteInput.maxLength = 200;
229352
229488
  noteInput.value = momentNotes[m.id] ?? "";
229353
229489
  noteInput.placeholder = "Por ejemplo: m\xE1s corto, sin la pregunta\u2026";
@@ -229371,14 +229507,14 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229371
229507
  if (videos.every((video) => video.paused)) play.click();
229372
229508
  }
229373
229509
  };
229374
- const grid = text17("div", "", "moment-variants");
229510
+ const grid = text18("div", "", "moment-variants");
229375
229511
  grid.setAttribute("role", "group");
229376
229512
  grid.setAttribute("aria-label", `Versiones de ${m.title}`);
229377
229513
  grid.style.setProperty("--variant-count", String(m.variants.length));
229378
229514
  for (const v of m.variants) {
229379
- const node2 = text17("article", "", "variant");
229515
+ const node2 = text18("article", "", "variant");
229380
229516
  node2.dataset.variant = v.id;
229381
- const media2 = text17("div", "", "variant-media");
229517
+ const media2 = text18("div", "", "variant-media");
229382
229518
  const isVideo = v.preview.mimeType.startsWith("video/");
229383
229519
  const element = document.createElement(isVideo ? "video" : "img");
229384
229520
  element.src = v.preview.uri;
@@ -229402,8 +229538,8 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229402
229538
  if (element.naturalHeight) media2.style.aspectRatio = element.naturalWidth + "/" + element.naturalHeight;
229403
229539
  };
229404
229540
  }
229405
- media2.append(element, text17("span", letter(m, v.id), "variant-letter"));
229406
- if (v.id === m.recommendedVariantId) media2.append(text17("span", "Recomendada", "variant-recommended"));
229541
+ media2.append(element, text18("span", letter(m, v.id), "variant-letter"));
229542
+ if (v.id === m.recommendedVariantId) media2.append(text18("span", "Recomendada", "variant-recommended"));
229407
229543
  const pick3 = button("Elegir", () => {
229408
229544
  variantChoices[m.id] = v.id;
229409
229545
  activeVariant[m.id] = m.variants.indexOf(v);
@@ -229412,8 +229548,8 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229412
229548
  status2(momentsReady() ? "Elegiste una versi\xF3n de cada momento. Copia tu elecci\xF3n y p\xE9gala en el chat." : `Elegiste ${letter(m, v.id)} para ${m.title}.`);
229413
229549
  }, "variant-choice");
229414
229550
  pick3.setAttribute("aria-label", `Versi\xF3n ${letter(m, v.id)} \xB7 ${v.title}`);
229415
- node2.append(media2, text17("h4", v.title));
229416
- if (v.description) node2.append(text17("p", v.description));
229551
+ node2.append(media2, text18("h4", v.title));
229552
+ if (v.description) node2.append(text18("p", v.description));
229417
229553
  node2.append(pick3);
229418
229554
  grid.append(node2);
229419
229555
  }
@@ -229426,18 +229562,18 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229426
229562
  refreshMoments();
229427
229563
  buttons[next].focus();
229428
229564
  };
229429
- const nav = text17("div", "", "variant-nav");
229565
+ const nav = text18("div", "", "variant-nav");
229430
229566
  const step2 = (delta) => {
229431
229567
  activeVariant[m.id] = Math.min(Math.max(0, (activeVariant[m.id] ?? 0) + delta), m.variants.length - 1);
229432
229568
  refreshMoments();
229433
229569
  };
229434
- nav.append(button("\u2039 Anterior", () => step2(-1)), text17("span", "", "variant-counter"), button("Siguiente \u203A", () => step2(1)));
229570
+ nav.append(button("\u2039 Anterior", () => step2(-1)), text18("span", "", "variant-counter"), button("Siguiente \u203A", () => step2(1)));
229435
229571
  card.append(info, grid, nav);
229436
229572
  if (!videos.length) {
229437
229573
  play.hidden = true;
229438
229574
  progress2.hidden = true;
229439
229575
  } else {
229440
- const audioLabel = text17("label", "Sonido de la comparaci\xF3n", "moment-note moment-audio");
229576
+ const audioLabel = text18("label", "Sonido de la comparaci\xF3n", "moment-note moment-audio");
229441
229577
  audioLabel.append(audio);
229442
229578
  noteLabel.before(audioLabel);
229443
229579
  const leader = videos[0];
@@ -229468,10 +229604,10 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229468
229604
  $("intro").textContent = hasDirections ? moments.length ? "Primero elige el estilo; despu\xE9s, una versi\xF3n de cada momento. Tu agente har\xE1 la edici\xF3n completa con lo que elijas." : "Son propuestas para este video. Elige la que m\xE1s te guste; tu agente preparar\xE1 la primera muestra con ella." : "Tu IA prepar\xF3 versiones cortas de los momentos clave. Elige una de cada uno; despu\xE9s har\xE1 la edici\xF3n completa.";
229469
229605
  $("phone").querySelector("p").textContent = "Pide ver estas propuestas con im\xE1genes ligeras en tu chat m\xF3vil. No se sube ning\xFAn video autom\xE1ticamente.";
229470
229606
  $("back-edit").hidden = true;
229471
- for (const direction of data2.directions ?? []) {
229472
- const card = text17("article", "", "direction");
229607
+ for (const direction of data.directions ?? []) {
229608
+ const card = text18("article", "", "direction");
229473
229609
  card.dataset.choice = direction.id;
229474
- const media2 = text17("div", "", "direction-media");
229610
+ const media2 = text18("div", "", "direction-media");
229475
229611
  if (direction.preview) {
229476
229612
  const isVideo = direction.preview.mimeType.startsWith("video/");
229477
229613
  const element = document.createElement(isVideo ? "video" : "img");
@@ -229487,19 +229623,19 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229487
229623
  }
229488
229624
  media2.append(element);
229489
229625
  } else {
229490
- const blank2 = text17("div", "", "no-preview");
229491
- blank2.append(text17("span", "A"), text17("span", "Sin muestra visual adjunta"));
229626
+ const blank2 = text18("div", "", "no-preview");
229627
+ blank2.append(text18("span", "A"), text18("span", "Sin muestra visual adjunta"));
229492
229628
  media2.append(blank2);
229493
229629
  }
229494
- const chosen = text17("span", "\u2713 Elegida", "chosen-label");
229630
+ const chosen = text18("span", "\u2713 Elegida", "chosen-label");
229495
229631
  chosen.hidden = true;
229496
229632
  media2.append(chosen);
229497
- card.append(media2, text17("h3", direction.title), text17("p", direction.description));
229633
+ card.append(media2, text18("h3", direction.title), text18("p", direction.description));
229498
229634
  if (direction.references?.length) {
229499
- const refs = text17("details", "");
229500
- refs.append(text17("summary", "Ver referencias"));
229635
+ const refs = text18("details", "");
229636
+ refs.append(text18("summary", "Ver referencias"));
229501
229637
  for (const reference of direction.references) {
229502
- const anchor2 = text17("a", reference.label);
229638
+ const anchor2 = text18("a", reference.label);
229503
229639
  anchor2.href = reference.url;
229504
229640
  anchor2.target = "_blank";
229505
229641
  anchor2.rel = "noopener noreferrer";
@@ -229523,7 +229659,7 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229523
229659
  $("back").disabled = !mediaReady;
229524
229660
  $("forward").disabled = !mediaReady;
229525
229661
  $("media-error").hidden = true;
229526
- if (data2.transcript && Math.abs(player.duration * 1e3 - data2.transcript.durationMs) > 300) {
229662
+ if (data.transcript && Math.abs(player.duration * 1e3 - data.transcript.durationMs) > 300) {
229527
229663
  $("transcript").hidden = true;
229528
229664
  $("transcript-panel").hidden = true;
229529
229665
  $("workspace").classList.add("no-transcript");
@@ -229536,7 +229672,7 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229536
229672
  approval = false;
229537
229673
  copied = false;
229538
229674
  for (const id5 of ["mark", "back", "forward"]) $(id5).disabled = true;
229539
- const message = data2.video.uri.startsWith("data:") ? "Este visor no pudo reproducir el video. Pide a tu agente abrir una revisi\xF3n local ligera. No apruebes una muestra que no pudiste revisar." : "No se pudo cargar el video. Pide a tu agente mantener abierto el servidor de revisi\xF3n y comprobar el preview en tu navegador. No apruebes una muestra que no pudiste revisar.";
229675
+ const message = data.video.uri.startsWith("data:") ? "Este visor no pudo reproducir el video. Pide a tu agente abrir una revisi\xF3n local ligera. No apruebes una muestra que no pudiste revisar." : "No se pudo cargar el video. Pide a tu agente mantener abierto el servidor de revisi\xF3n y comprobar el preview en tu navegador. No apruebes una muestra que no pudiste revisar.";
229540
229676
  $("media-error").textContent = message;
229541
229677
  $("media-error").hidden = false;
229542
229678
  status2(message);
@@ -229546,11 +229682,11 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229546
229682
  $("clock").textContent = `${time3(player.currentTime * 1e3)} / ${time3(Number.isFinite(player.duration) ? player.duration * 1e3 : 0)}`;
229547
229683
  for (const row of Array.from(document.querySelectorAll("[data-start]"))) row.classList.toggle("speaking", player.currentTime * 1e3 >= Number(row.dataset.start) && player.currentTime * 1e3 < Number(row.dataset.end));
229548
229684
  };
229549
- if (data2.transcript?.segments.length) {
229685
+ if (data.transcript?.segments.length) {
229550
229686
  $("transcript").hidden = false;
229551
229687
  $("transcript-panel").hidden = false;
229552
- for (const segment2 of data2.transcript.segments) {
229553
- const row = text17("article", "", segment2.state === "removed" ? "removed" : "");
229688
+ for (const segment2 of data.transcript.segments) {
229689
+ const row = text18("article", "", segment2.state === "removed" ? "removed" : "");
229554
229690
  row.dataset.state = segment2.state;
229555
229691
  if (segment2.state === "kept") {
229556
229692
  row.dataset.start = segment2.startMs;
@@ -229558,10 +229694,10 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229558
229694
  row.append(button(time3(segment2.startMs) + " \xB7 " + segment2.text, () => seek(segment2.startMs)));
229559
229695
  } else {
229560
229696
  row.hidden = true;
229561
- row.append(text17("small", "Recortada del original \xB7 " + time3(segment2.source.startMs)), text17("p", segment2.text));
229697
+ row.append(text18("small", "Recortada del original \xB7 " + time3(segment2.source.startMs)), text18("p", segment2.text));
229562
229698
  }
229563
229699
  if (segment2.state === "kept" && segment2.words?.length) {
229564
- const words2 = text17("p", "", "studio-words");
229700
+ const words2 = text18("p", "", "studio-words");
229565
229701
  for (const word of segment2.words) {
229566
229702
  const w = button(word.text, () => seek(word.startMs));
229567
229703
  w.dataset.wordStart = String(word.startMs);
@@ -229587,19 +229723,19 @@ ${JSON.stringify({ ...feedback2(), kind: "editorbrain.review-access-request", de
229587
229723
  }));
229588
229724
  $("phrases").append(row);
229589
229725
  }
229590
- $("show-cuts-label").hidden = !data2.transcript.segments.some((segment2) => segment2.state === "removed");
229726
+ $("show-cuts-label").hidden = !data.transcript.segments.some((segment2) => segment2.state === "removed");
229591
229727
  $("show-cuts").onchange = (event) => {
229592
229728
  for (const row of Array.from(document.querySelectorAll('[data-state="removed"]'))) row.hidden = !event.target.checked;
229593
229729
  };
229594
229730
  } else $("workspace").classList.add("no-transcript");
229595
- if (data2.video) player.src = data2.video.uri;
229731
+ if (data.video) player.src = data.video.uri;
229596
229732
  }
229597
229733
  $("future").onclick = () => {
229598
229734
  $("future-details").open = !$("future-details").open;
229599
229735
  };
229600
229736
  update();
229601
229737
  if (!isDirections) {
229602
- studioController = reviewStudioApp(data2, { changed: update, seek, send: () => setStep(3), notes: () => notes2, comment: (target, value) => {
229738
+ studioController = reviewStudioApp(data, { changed: update, seek, send: () => setStep(3), notes: () => notes2, comment: (target, value) => {
229603
229739
  mark = target.startMs;
229604
229740
  endMs = target.endMs;
229605
229741
  point = target.point;
@@ -229619,10 +229755,10 @@ var DATA_SLOT = "\0review-data\0";
229619
229755
  var SCRIPT_SLOT = "\0review-script\0";
229620
229756
  var reviewArtifactScriptSource = (locale = "es") => `${embeddedFunctions({ agentHandoffPrompt })}
229621
229757
  ${locale === "en" ? localizeReviewText(studioControlsScript, reviewControlsEnglish) : studioControlsScript}(${locale === "en" ? localizeReviewText(reviewApp.toString(), reviewScriptEnglish) : reviewApp.toString()})();`;
229622
- function renderReviewArtifact(data2, wordmark, locale = "es") {
229758
+ function renderReviewArtifact(data, wordmark, locale = "es") {
229623
229759
  const script = compactScript(reviewArtifactScriptSource(locale));
229624
229760
  const hash16 = createHash2("sha256").update(script).digest("base64");
229625
- const json3 = JSON.stringify(data2).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
229761
+ const json3 = JSON.stringify(data).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
229626
229762
  const markup = `<!doctype html>
229627
229763
  <html lang="es"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
229628
229764
  <meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'sha256-${hash16}'; style-src 'unsafe-inline'; img-src 'self' data:; media-src 'self' data: blob:; connect-src 'none'; font-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none'">
@@ -230054,11 +230190,11 @@ async function styleTemplateCommand(client, positional, flags) {
230054
230190
  "Provide --file with the reviewed publication request.",
230055
230191
  "Keep id stable on retry; explicit sharing/content/rights confirmations are required."
230056
230192
  );
230057
- const text17 = await readFile2(resolve2(value("dir") ?? process.cwd(), value("file")), "utf8");
230058
- if (Buffer.byteLength(text17) > 32768) throw new Error("Publication request exceeds 32 KiB");
230193
+ const text18 = await readFile2(resolve2(value("dir") ?? process.cwd(), value("file")), "utf8");
230194
+ if (Buffer.byteLength(text18) > 32768) throw new Error("Publication request exceeds 32 KiB");
230059
230195
  return client.request("/v1/style-templates/publish", {
230060
230196
  method: "POST",
230061
- body: JSON.parse(text17),
230197
+ body: JSON.parse(text18),
230062
230198
  timeoutMs: 18e4
230063
230199
  });
230064
230200
  }
@@ -231679,7 +231815,7 @@ async function previewCaptions(directory, options, dependencies) {
231679
231815
  if (options.demoText !== void 0) {
231680
231816
  const tokens3 = options.demoText.trim().split(/\s+/u);
231681
231817
  if (tokens3.length > 100) throw new Error("Caption demo accepts at most 100 words.");
231682
- const words2 = tokens3.map((text17, i) => ({ text: text17, start: i * duration3 / tokens3.length, end: (i + 1) * duration3 / tokens3.length }));
231818
+ const words2 = tokens3.map((text18, i) => ({ text: text18, start: i * duration3 / tokens3.length, end: (i + 1) * duration3 / tokens3.length }));
231683
231819
  if (preset2.schemaVersion === 2) {
231684
231820
  const result2 = makeCaptionChunks(words2, preset2.chunk);
231685
231821
  cues = result2.cues;
@@ -232542,7 +232678,7 @@ function footageRetagArgs(source2, target, fields3, format) {
232542
232678
  }
232543
232679
  var PROBE_ARGS = (source2) => ["-v", "error", "-protocol_whitelist", "file", "-f", "mov", "-select_streams", "v:0", "-show_entries", "stream=codec_name,pix_fmt,width,height,time_base,start_time,duration,nb_frames,sample_aspect_ratio,color_range,color_space,color_primaries,color_transfer:stream_tags=rotate:stream_side_data=rotation:format=start_time,duration", "-of", "json", source2];
232544
232680
  var WORKING_COPY = Object.freeze({ minKeyframeSpacing: 60, probePackets: 600, threads: 4, maxBytes: 4 * 1024 ** 3, reserveBytes: 2 * 1024 ** 3, minBytes: 16 * 1024 ** 2, prepareMs: 3e5 });
232545
- var rotated = (stream) => !!Number(stream.tags?.rotate) || (stream.side_data_list ?? []).some((data2) => Number(data2?.rotation));
232681
+ var rotated = (stream) => !!Number(stream.tags?.rotate) || (stream.side_data_list ?? []).some((data) => Number(data?.rotation));
232546
232682
  function workingCopyKind(stream, extension2) {
232547
232683
  return !!stream && extension2 in CONTAINERS && stream.codec_name === "h264" && ["yuv420p", "yuvj420p"].includes(stream.pix_fmt) && stream.width > 0 && stream.height > 0 && !rotated(stream);
232548
232684
  }
@@ -232651,9 +232787,9 @@ function runFootageTool(command, args, timeoutMs, signal, digest11 = false) {
232651
232787
  if (output3.length < 65536) output3 += chunk2;
232652
232788
  return;
232653
232789
  }
232654
- const text17 = rest + chunk2, end4 = text17.lastIndexOf("\n");
232655
- rest = text17.slice(end4 + 1);
232656
- for (const line of text17.slice(0, end4 + 1).split("\n")) {
232790
+ const text18 = rest + chunk2, end4 = text18.lastIndexOf("\n");
232791
+ rest = text18.slice(end4 + 1);
232792
+ for (const line of text18.slice(0, end4 + 1).split("\n")) {
232657
232793
  if (!line || line[0] === "#" && !line.startsWith("#tb")) continue;
232658
232794
  hash16.update(line + "\n");
232659
232795
  if (line[0] !== "#") frames++;
@@ -233305,18 +233441,18 @@ function decodePng(png) {
233305
233441
  try {
233306
233442
  if (png.length < 45 || png.readUInt32BE(0) !== 2303741511 || png.readUInt32BE(4) !== 218765834) return void 0;
233307
233443
  let offset = 8, header;
233308
- const data2 = [];
233444
+ const data = [];
233309
233445
  while (offset + 12 <= png.length) {
233310
233446
  const length = png.readUInt32BE(offset), type = png.toString("latin1", offset + 4, offset + 8), body = png.subarray(offset + 8, offset + 8 + length);
233311
233447
  if (type === "IHDR") header = body;
233312
- else if (type === "IDAT") data2.push(body);
233448
+ else if (type === "IDAT") data.push(body);
233313
233449
  else if (type === "IEND") break;
233314
233450
  offset += 12 + length;
233315
233451
  }
233316
- if (!header || header.length < 13 || !data2.length) return void 0;
233452
+ if (!header || header.length < 13 || !data.length) return void 0;
233317
233453
  const width = header.readUInt32BE(0), height = header.readUInt32BE(4), channels = { 0: 1, 2: 3, 4: 2, 6: 4 }[header[9]];
233318
233454
  if (header[8] !== 8 || !channels || header[12] !== 0 || !width || !height) return void 0;
233319
- const stride = width * channels, raw = inflateSync(Buffer.concat(data2));
233455
+ const stride = width * channels, raw = inflateSync(Buffer.concat(data));
233320
233456
  if (raw.length !== (stride + 1) * height) return void 0;
233321
233457
  const pixels = Buffer.allocUnsafe(stride * height);
233322
233458
  for (let y = 0; y < height; y++) {
@@ -233510,7 +233646,7 @@ var kinds3 = { html: "html", htm: "html", css: "css", js: "js", mjs: "js" };
233510
233646
  function sceneSourceKind(path) {
233511
233647
  return kinds3[path.slice(path.lastIndexOf(".") + 1).toLowerCase()];
233512
233648
  }
233513
- var blank = (text17) => text17.replace(/[^\n]/g, " ");
233649
+ var blank = (text18) => text18.replace(/[^\n]/g, " ");
233514
233650
  var external = /^\s*(?:https?:)?\/\//i;
233515
233651
  function originOf(value) {
233516
233652
  try {
@@ -233520,9 +233656,9 @@ function originOf(value) {
233520
233656
  return void 0;
233521
233657
  }
233522
233658
  }
233523
- function lineCounter(text17) {
233659
+ function lineCounter(text18) {
233524
233660
  const starts = [0];
233525
- for (let at = text17.indexOf("\n"); at >= 0; at = text17.indexOf("\n", at + 1)) starts.push(at + 1);
233661
+ for (let at = text18.indexOf("\n"); at >= 0; at = text18.indexOf("\n", at + 1)) starts.push(at + 1);
233526
233662
  return (index2) => {
233527
233663
  let low = 0, high = starts.length - 1;
233528
233664
  while (low < high) {
@@ -233533,8 +233669,8 @@ function lineCounter(text17) {
233533
233669
  return low + 1;
233534
233670
  };
233535
233671
  }
233536
- function cssHits(text17, offset = 0) {
233537
- const source2 = text17.replace(/\/\*[\s\S]*?\*\//g, blank), hits = [], imports = /* @__PURE__ */ new Set();
233672
+ function cssHits(text18, offset = 0) {
233673
+ const source2 = text18.replace(/\/\*[\s\S]*?\*\//g, blank), hits = [], imports = /* @__PURE__ */ new Set();
233538
233674
  for (const match of source2.matchAll(/@import\s+(?:url\(\s*)?["']?((?:https?:)?\/\/[^"')\s;]+)/gi)) {
233539
233675
  imports.add(match.index + match[0].indexOf(match[1]));
233540
233676
  hits.push({ index: offset + match.index, severity: "error", value: match[1], what: "a stylesheet @import" });
@@ -233545,12 +233681,12 @@ function cssHits(text17, offset = 0) {
233545
233681
  }
233546
233682
  return hits;
233547
233683
  }
233548
- function jsHits(text17, offset = 0) {
233684
+ function jsHits(text18, offset = 0) {
233549
233685
  const hits = [];
233550
- for (const match of text17.matchAll(/^[ \t]*(?:import\s*|(?:import|export)\b[^'"\n;]*?\bfrom\s*)["']((?:https?:)?\/\/[^"'\n]+)["']/gm)) hits.push({ index: offset + match.index, severity: "error", value: match[1], what: "a module import" });
233551
- for (const match of text17.matchAll(/\b(?:fetch|import|importScripts|Worker|SharedWorker|EventSource|WebSocket)\s*\(\s*["'`]((?:https?|wss?):\/\/[^"'`\s)]+)/g)) hits.push({ index: offset + match.index, severity: "warning", value: match[1], what: "a script request" });
233552
- for (const match of text17.matchAll(/\.(?:src|href)\s*=\s*["'`](https?:\/\/[^"'`\s]+)/g)) hits.push({ index: offset + match.index, severity: "warning", value: match[1], what: "an address assigned by a script" });
233553
- for (const match of text17.matchAll(/url\(\s*\\?["']?(https?:\/\/[^"')\s\\]+)/g)) hits.push({ index: offset + match.index, severity: "warning", value: match[1], what: "a CSS url() written by a script" });
233686
+ for (const match of text18.matchAll(/^[ \t]*(?:import\s*|(?:import|export)\b[^'"\n;]*?\bfrom\s*)["']((?:https?:)?\/\/[^"'\n]+)["']/gm)) hits.push({ index: offset + match.index, severity: "error", value: match[1], what: "a module import" });
233687
+ for (const match of text18.matchAll(/\b(?:fetch|import|importScripts|Worker|SharedWorker|EventSource|WebSocket)\s*\(\s*["'`]((?:https?|wss?):\/\/[^"'`\s)]+)/g)) hits.push({ index: offset + match.index, severity: "warning", value: match[1], what: "a script request" });
233688
+ for (const match of text18.matchAll(/\.(?:src|href)\s*=\s*["'`](https?:\/\/[^"'`\s]+)/g)) hits.push({ index: offset + match.index, severity: "warning", value: match[1], what: "an address assigned by a script" });
233689
+ for (const match of text18.matchAll(/url\(\s*\\?["']?(https?:\/\/[^"')\s\\]+)/g)) hits.push({ index: offset + match.index, severity: "warning", value: match[1], what: "a CSS url() written by a script" });
233554
233690
  return hits;
233555
233691
  }
233556
233692
  var scriptTypes = /* @__PURE__ */ new Set(["", "module", "text/javascript", "application/javascript", "text/ecmascript", "application/ecmascript"]);
@@ -233560,9 +233696,9 @@ function attributes(source2) {
233560
233696
  return result2;
233561
233697
  }
233562
233698
  var srcsetUrls = (value) => value.split(",").map((candidate) => candidate.trim().split(/\s+/)[0]).filter(Boolean);
233563
- function htmlHits(text17) {
233699
+ function htmlHits(text18) {
233564
233700
  const hits = [];
233565
- let markup = text17.replace(/<!--[\s\S]*?-->/g, blank);
233701
+ let markup = text18.replace(/<!--[\s\S]*?-->/g, blank);
233566
233702
  markup = markup.replace(/(<script\b[^>]*>)([\s\S]*?)(<\/script\s*>)/gi, (whole, open32, body, close, index2) => {
233567
233703
  const type = (attributes(open32.slice(7, -1)).get("type") ?? "").trim().toLowerCase();
233568
233704
  if (scriptTypes.has(type)) hits.push(...jsHits(body, index2 + open32.length));
@@ -233609,8 +233745,8 @@ function htmlHits(text17) {
233609
233745
  }
233610
233746
  return hits;
233611
233747
  }
233612
- function cssFontFacts(text17, offset, facts) {
233613
- const source2 = text17.replace(/\/\*[\s\S]*?\*\//g, blank);
233748
+ function cssFontFacts(text18, offset, facts) {
233749
+ const source2 = text18.replace(/\/\*[\s\S]*?\*\//g, blank);
233614
233750
  const outside = source2.replace(/@font-face\s*\{[^}]*\}/gi, (rule, index2) => {
233615
233751
  const family = primaryFamily(/font-family\s*:\s*([^;}]+)/i.exec(rule)?.[1]), sources = /(?:^|[;{\s])src\s*:\s*([^;}]+)/i.exec(rule)?.[1] ?? "";
233616
233752
  if (family) {
@@ -233624,24 +233760,24 @@ function cssFontFacts(text17, offset, facts) {
233624
233760
  if (family && familyKind(family) === "named" && /^[\w .,'-]+$/.test(family)) facts.used.push({ index: offset + match.index + match[0].indexOf(match[1]), family });
233625
233761
  }
233626
233762
  }
233627
- function sceneFontFacts(text17, kind3) {
233763
+ function sceneFontFacts(text18, kind3) {
233628
233764
  const facts = { declared: [], localOnly: [], used: [], scripted: false };
233629
233765
  const script = (body, offset) => {
233630
233766
  if (/\bnew\s+FontFace\b|\bfonts\s*\.\s*add\s*\(/.test(body)) facts.scripted = true;
233631
233767
  for (const match of body.matchAll(/\bnew\s+FontFace\s*\(\s*(["'`])((?:\\.|(?!\1)[^\\\n])*)\1\s*,\s*(["'`])((?:\\.|(?!\3)[^\\\n])*)\3/g)) if (/\blocal\(/i.test(match[4]) && !/\burl\(/i.test(match[4]) && !match[4].includes("${")) facts.localOnly.push({ index: offset + match.index, family: match[2] });
233632
233768
  };
233633
- if (kind3 === "css") cssFontFacts(text17, 0, facts);
233634
- else if (kind3 === "js") script(text17, 0);
233769
+ if (kind3 === "css") cssFontFacts(text18, 0, facts);
233770
+ else if (kind3 === "js") script(text18, 0);
233635
233771
  else {
233636
- const markup = text17.replace(/<!--[\s\S]*?-->/g, blank);
233772
+ const markup = text18.replace(/<!--[\s\S]*?-->/g, blank);
233637
233773
  for (const match of markup.matchAll(/(<script\b[^>]*>)([\s\S]*?)<\/script\s*>/gi)) if (scriptTypes.has((attributes(match[1].slice(7, -1)).get("type") ?? "").trim().toLowerCase())) script(match[2], match.index + match[1].length);
233638
233774
  for (const match of markup.matchAll(/(<style\b[^>]*>)([\s\S]*?)<\/style\s*>/gi)) cssFontFacts(match[2], match.index + match[1].length, facts);
233639
233775
  for (const match of markup.replace(/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/gi, blank).matchAll(/\sstyle\s*=\s*(?:"([^"]*)"|'([^']*)')/gi)) cssFontFacts((match[1] ?? match[2]).replace(/&quot;/g, '"').replace(/&#39;|&apos;/g, "'"), match.index + match[0].indexOf(match[1] ?? match[2]), facts);
233640
233776
  }
233641
233777
  return facts;
233642
233778
  }
233643
- function scanSceneText(file3, text17, kind3 = sceneSourceKind(file3) ?? "js") {
233644
- const lineOf = lineCounter(text17), hits = (kind3 === "html" ? htmlHits(text17) : kind3 === "css" ? cssHits(text17) : jsHits(text17)).sort((a, b) => a.index - b.index);
233779
+ function scanSceneText(file3, text18, kind3 = sceneSourceKind(file3) ?? "js") {
233780
+ const lineOf = lineCounter(text18), hits = (kind3 === "html" ? htmlHits(text18) : kind3 === "css" ? cssHits(text18) : jsHits(text18)).sort((a, b) => a.index - b.index);
233645
233781
  const seen = /* @__PURE__ */ new Set(), findings = [];
233646
233782
  for (const hit of hits) {
233647
233783
  const line = lineOf(hit.index), origin = originOf(hit.value), key = `${line}:${hit.severity}:${origin}`;
@@ -233672,14 +233808,14 @@ async function scanSceneSources(root, manifest, options = {}) {
233672
233808
  skippedFiles.push(file3.path);
233673
233809
  continue;
233674
233810
  }
233675
- let text17;
233811
+ let text18;
233676
233812
  try {
233677
233813
  const path = await resolvePath(file3.path), info = await stat5(path);
233678
233814
  if (!info.isFile() || info.size > MAX_FILE_BYTES || total + info.size > MAX_TOTAL_BYTES) {
233679
233815
  skippedFiles.push(file3.path);
233680
233816
  continue;
233681
233817
  }
233682
- text17 = await readFile4(path, "utf8");
233818
+ text18 = await readFile4(path, "utf8");
233683
233819
  total += info.size;
233684
233820
  } catch {
233685
233821
  skippedFiles.push(file3.path);
@@ -233687,14 +233823,14 @@ async function scanSceneSources(root, manifest, options = {}) {
233687
233823
  }
233688
233824
  scannedFiles.push(file3.path);
233689
233825
  if (file3.path === manifest.entry) entryRead = true;
233690
- if (kind3 !== "css" && /\b(?:editorbrainSeek|renderAt)\b/.test(text17)) adapterNamed = true;
233691
- if (findings.length < MAX_FINDINGS) findings.push(...scanSceneText(file3.path, text17, kind3).slice(0, MAX_FINDINGS - findings.length));
233826
+ if (kind3 !== "css" && /\b(?:editorbrainSeek|renderAt)\b/.test(text18)) adapterNamed = true;
233827
+ if (findings.length < MAX_FINDINGS) findings.push(...scanSceneText(file3.path, text18, kind3).slice(0, MAX_FINDINGS - findings.length));
233692
233828
  if (file3.path.includes(".editorbrain-local/hyperframes/")) continue;
233693
- const lineOf = lineCounter(text17);
233694
- fonts.push({ file: file3.path, facts: sceneFontFacts(text17, kind3), lineOf });
233829
+ const lineOf = lineCounter(text18);
233830
+ fonts.push({ file: file3.path, facts: sceneFontFacts(text18, kind3), lineOf });
233695
233831
  for (const family of options.locateFamilies ?? []) {
233696
233832
  if (families[family] || !family) continue;
233697
- const at = text17.toLowerCase().indexOf(family.toLowerCase());
233833
+ const at = text18.toLowerCase().indexOf(family.toLowerCase());
233698
233834
  if (at >= 0) families[family] = { file: file3.path, line: lineOf(at) };
233699
233835
  }
233700
233836
  }
@@ -233741,9 +233877,9 @@ function hyperframesAdapterBoot(config3) {
233741
233877
  const pause = (ms2) => new Promise((resolve35) => setTimeout(resolve35, ms2));
233742
233878
  const numeric3 = (value) => {
233743
233879
  if (value == null) return null;
233744
- const text17 = String(value).trim();
233745
- if (!text17) return null;
233746
- const parsed = Number(text17);
233880
+ const text18 = String(value).trim();
233881
+ if (!text18) return null;
233882
+ const parsed = Number(text18);
233747
233883
  return Number.isFinite(parsed) ? parsed : null;
233748
233884
  };
233749
233885
  const LIMIT_MS = 15e4;
@@ -234232,13 +234368,13 @@ function fontFamilyList(value) {
234232
234368
  return pieces.map((piece) => piece.replace(/!important/i, "").trim().replace(/^['"]/, "").replace(/['"]$/, "").trim()).filter(Boolean);
234233
234369
  }
234234
234370
  function leadingVariable(value) {
234235
- const text17 = value.trim();
234236
- if (!/^var\(/i.test(text17)) return null;
234371
+ const text18 = value.trim();
234372
+ if (!/^var\(/i.test(text18)) return null;
234237
234373
  let depth = 0;
234238
- for (let index2 = 0; index2 < text17.length; index2++) {
234239
- if (text17[index2] === "(") depth++;
234240
- else if (text17[index2] === ")" && --depth === 0) {
234241
- const inner = text17.slice(4, index2).trim(), comma = inner.indexOf(","), name = (comma < 0 ? inner : inner.slice(0, comma)).trim();
234374
+ for (let index2 = 0; index2 < text18.length; index2++) {
234375
+ if (text18[index2] === "(") depth++;
234376
+ else if (text18[index2] === ")" && --depth === 0) {
234377
+ const inner = text18.slice(4, index2).trim(), comma = inner.indexOf(","), name = (comma < 0 ? inner : inner.slice(0, comma)).trim();
234242
234378
  return /^--[\w-]+$/.test(name) ? { name, fallback: comma < 0 ? null : inner.slice(comma + 1) } : null;
234243
234379
  }
234244
234380
  }
@@ -234477,12 +234613,12 @@ function hasDisplayTransform(stream) {
234477
234613
  const rotate = stream.tags?.rotate;
234478
234614
  if (rotate !== void 0 && (!Number.isFinite(Number(rotate)) || Number(rotate) % 360 !== 0)) return true;
234479
234615
  const sideData = Array.isArray(stream.side_data_list) ? stream.side_data_list : [];
234480
- return sideData.some((data2) => {
234481
- if (!data2 || typeof data2 !== "object") return false;
234482
- if (data2.rotation !== void 0 && (!Number.isFinite(Number(data2.rotation)) || Number(data2.rotation) % 360 !== 0)) return true;
234483
- if (data2.displaymatrix === void 0) return data2.side_data_type === "Display Matrix";
234484
- if (typeof data2.displaymatrix !== "string") return true;
234485
- const values = data2.displaymatrix.trim().split("\n").flatMap((line) => line.replace(/^[^:]*:/, "").trim().split(/\s+/).map(Number));
234616
+ return sideData.some((data) => {
234617
+ if (!data || typeof data !== "object") return false;
234618
+ if (data.rotation !== void 0 && (!Number.isFinite(Number(data.rotation)) || Number(data.rotation) % 360 !== 0)) return true;
234619
+ if (data.displaymatrix === void 0) return data.side_data_type === "Display Matrix";
234620
+ if (typeof data.displaymatrix !== "string") return true;
234621
+ const values = data.displaymatrix.trim().split("\n").flatMap((line) => line.replace(/^[^:]*:/, "").trim().split(/\s+/).map(Number));
234486
234622
  const identity = [65536, 0, 0, 0, 65536, 0, 0, 0, 1073741824];
234487
234623
  return values.length !== 9 || values.some((value, index2) => value !== identity[index2]);
234488
234624
  });
@@ -234551,9 +234687,9 @@ var GENERATED_MARK = "editorbrain-hyperframes";
234551
234687
  var sha2563 = (bytes) => createHash15("sha256").update(bytes).digest("hex");
234552
234688
  var numeric2 = (value) => {
234553
234689
  if (value === void 0) return null;
234554
- const text17 = value.trim();
234555
- if (!text17) return null;
234556
- const parsed = Number(text17);
234690
+ const text18 = value.trim();
234691
+ if (!text18) return null;
234692
+ const parsed = Number(text18);
234557
234693
  return Number.isFinite(parsed) ? parsed : null;
234558
234694
  };
234559
234695
  var unsupported = (message, next, details = {}) => new CliError("RENDER_HYPERFRAMES_UNSUPPORTED", message, next, false, details);
@@ -234602,9 +234738,9 @@ var EXTERNAL = /^\s*(?:https?:)?\/\//i;
234602
234738
  var ASSET = /\.(?:png|jpe?g|webp|gif|svg|avif|bmp|ico|mp4|webm|mov|m4v|ogv|mp3|wav|m4a|aac|ogg|opus|flac|woff2?|ttf|otf|json|js|mjs|css|html?|glb|gltf|bin|hdr|ktx2|wasm|txt|csv|lottie|vtt|srt)$/i;
234603
234739
  var VOID = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"]);
234604
234740
  function localReference(value) {
234605
- const text17 = value.trim();
234606
- if (!text17 || /^(?:[a-z][a-z0-9+.-]*:|\/\/|#|%23)/i.test(text17) || /[${}<>]/.test(text17)) return null;
234607
- const clean = text17.split(/[?#]/)[0];
234741
+ const text18 = value.trim();
234742
+ if (!text18 || /^(?:[a-z][a-z0-9+.-]*:|\/\/|#|%23)/i.test(text18) || /[${}<>]/.test(text18)) return null;
234743
+ const clean = text18.split(/[?#]/)[0];
234608
234744
  if (!clean) return null;
234609
234745
  try {
234610
234746
  return decodeURI(clean);
@@ -234657,13 +234793,13 @@ async function addReference(walk, from, line, value, base, required2, depth) {
234657
234793
  const kind3 = /\.(?:css)$/i.test(path) ? "css" : /\.(?:m?js)$/i.test(path) ? "js" : null;
234658
234794
  if (kind3 && depth < MAX_DEPTH && !walk.scanned.has(path)) {
234659
234795
  walk.scanned.add(path);
234660
- const text17 = await readTextFile(walk.root, path);
234661
- if (text17 === null) return;
234662
- walk.sources.push(text17);
234663
- if (kind3 === "css") walk.css.push(text17);
234664
- const lineOf = lineCounter(text17);
234665
- if (kind3 === "css") for (const hit of cssReferences(text17)) await addReference(walk, path, lineOf(hit.index), hit.value, posix6.dirname(path) === "." ? "" : posix6.dirname(path), true, depth + 1);
234666
- else for (const hit of stringLiterals(text17)) await addReference(walk, path, lineOf(hit.index), hit.value, walk.base, false, depth + 1);
234796
+ const text18 = await readTextFile(walk.root, path);
234797
+ if (text18 === null) return;
234798
+ walk.sources.push(text18);
234799
+ if (kind3 === "css") walk.css.push(text18);
234800
+ const lineOf = lineCounter(text18);
234801
+ if (kind3 === "css") for (const hit of cssReferences(text18)) await addReference(walk, path, lineOf(hit.index), hit.value, posix6.dirname(path) === "." ? "" : posix6.dirname(path), true, depth + 1);
234802
+ else for (const hit of stringLiterals(text18)) await addReference(walk, path, lineOf(hit.index), hit.value, walk.base, false, depth + 1);
234667
234803
  }
234668
234804
  }
234669
234805
  async function walkDocument(walk, file3, html, offset, depth, entry2) {
@@ -234693,11 +234829,11 @@ async function walkDocument(walk, file3, html, offset, depth, entry2) {
234693
234829
  const source2 = attrs.get("data-composition-src");
234694
234830
  if (source2 !== void 0) {
234695
234831
  walk.subcompositions++;
234696
- const reference = localReference(source2), path = reference === null ? null : resolveReference(walk.base, reference), text17 = path === null || depth >= MAX_DEPTH ? null : await readTextFile(walk.root, path);
234697
- if (path === null || text17 === null || !renderPath.safeParse(path).success) walk.findings.push({ severity: "error", code: "subcomposition_missing", file: file3, line, message: `${file3}:${line} hosts the sub-composition ${source2}, which is not a readable file of this project.`, next: "Restore the file or correct data-composition-src; a composition cannot render without its parts." });
234832
+ const reference = localReference(source2), path = reference === null ? null : resolveReference(walk.base, reference), text18 = path === null || depth >= MAX_DEPTH ? null : await readTextFile(walk.root, path);
234833
+ if (path === null || text18 === null || !renderPath.safeParse(path).success) walk.findings.push({ severity: "error", code: "subcomposition_missing", file: file3, line, message: `${file3}:${line} hosts the sub-composition ${source2}, which is not a readable file of this project.`, next: "Restore the file or correct data-composition-src; a composition cannot render without its parts." });
234698
234834
  else {
234699
234835
  walk.files.add(path);
234700
- await walkDocument(walk, path, text17, inner, depth + 1, false);
234836
+ await walkDocument(walk, path, text18, inner, depth + 1, false);
234701
234837
  }
234702
234838
  }
234703
234839
  }
@@ -234890,9 +235026,9 @@ function vendorName(url3) {
234890
235026
  }
234891
235027
  async function pinnedRelease(root, base) {
234892
235028
  for (let folder = base; ; folder = posix6.dirname(folder) === "." ? "" : posix6.dirname(folder)) {
234893
- const text17 = await readTextFile(root, posix6.join(folder, "package.json"));
234894
- if (text17 !== null) {
234895
- const match = /\bhyperframes@(\d+\.\d+\.\d+)\b/.exec(text17) ?? /"hyperframes"\s*:\s*"(\d+\.\d+\.\d+)"/.exec(text17);
235029
+ const text18 = await readTextFile(root, posix6.join(folder, "package.json"));
235030
+ if (text18 !== null) {
235031
+ const match = /\bhyperframes@(\d+\.\d+\.\d+)\b/.exec(text18) ?? /"hyperframes"\s*:\s*"(\d+\.\d+\.\d+)"/.exec(text18);
234896
235032
  if (match) return match[1];
234897
235033
  }
234898
235034
  if (!folder) return null;
@@ -235522,7 +235658,7 @@ async function describeFootage(path) {
235522
235658
  startTime: typeof stream.start_time === "string" ? stream.start_time : null,
235523
235659
  durationSeconds: Number.isFinite(duration3) && duration3 > 0 ? duration3 : null,
235524
235660
  alpha: Object.entries(stream.tags ?? {}).some(([name, value]) => name.toLowerCase() === "alpha_mode" && value === "1"),
235525
- rotated: !!Number(stream.tags?.rotate) || (Array.isArray(stream.side_data_list) ? stream.side_data_list : []).some((data2) => Number(data2?.rotation)),
235661
+ rotated: !!Number(stream.tags?.rotate) || (Array.isArray(stream.side_data_list) ? stream.side_data_list : []).some((data) => Number(data?.rotation)),
235526
235662
  colour: { range: named2(stream.color_range), space: named2(stream.color_space), primaries: named2(stream.color_primaries), transfer: named2(stream.color_transfer) }
235527
235663
  };
235528
235664
  }
@@ -235590,7 +235726,7 @@ async function fixFootageKeyframes(root, files, inspect, options = {}) {
235590
235726
  report.fixes.push({ file: file3, keyframeEveryFramesBefore: finding.keyframeEveryFrames, keyframeEveryFramesAfter: after, bytesBefore: original.bytes, bytesAfter, seconds: Math.round((now() - started) / 100) / 10, cached: cached3, recipe: recipe.id });
235591
235727
  report.sources[file3] = relative7;
235592
235728
  };
235593
- const kept = await readFile7(note, "utf8").then((text17) => JSON.parse(text17), () => null), size = await stat6(copy).then((info) => info.isFile() ? info.size : 0, () => 0);
235729
+ const kept = await readFile7(note, "utf8").then((text18) => JSON.parse(text18), () => null), size = await stat6(copy).then((info) => info.isFile() ? info.size : 0, () => 0);
235594
235730
  if (kept && size > 0 && kept.bytes === size && Number.isFinite(kept.keyframeEveryFrames) && kept.keyframeEveryFrames <= FOOTAGE_KEYFRAME_INTERVAL) {
235595
235731
  accept(kept.keyframeEveryFrames, size, true);
235596
235732
  continue;
@@ -235720,7 +235856,7 @@ function snapshot(job, nowSeconds) {
235720
235856
  remainingSeconds: count(job.estimatedSecondsRemaining, MAX_TIMEOUT_SECONDS * 7),
235721
235857
  ...token(job.mode) === "fast" || token(job.mode) === "normal" ? { mode: token(job.mode) } : {},
235722
235858
  ...Array.isArray(record15(job.partialDelivery).parts) && record15(job.partialDelivery).parts.length ? { partialFiles: record15(job.partialDelivery).parts.length } : {},
235723
- ...Array.isArray(job.notices) ? { notices: job.notices.map((notice) => prose(record15(notice).message) ?? NOTICES[token(notice) ?? token(record15(notice).code) ?? ""]).filter((text17) => !!text17).slice(0, 4) } : {},
235859
+ ...Array.isArray(job.notices) ? { notices: job.notices.map((notice) => prose(record15(notice).message) ?? NOTICES[token(notice) ?? token(record15(notice).code) ?? ""]).filter((text18) => !!text18).slice(0, 4) } : {},
235724
235860
  completedFrames: count(progress2.completedFrames),
235725
235861
  committedFrames: count(progress2.committedFrames),
235726
235862
  totalFrames: count(progress2.totalFrames),
@@ -235789,16 +235925,16 @@ function describe3(s) {
235789
235925
  function resultGuidance(id5, outcome, s, timeoutSeconds, read) {
235790
235926
  const credits = [s.charged ? `${s.charged} credits charged` : "", s.returned ? `${s.returned} credits returned` : "", s.reserved ? `${s.reserved} credits still reserved` : ""].filter(Boolean).join(", ");
235791
235927
  const unavailable = outcome === "queue_expired" || outcome === "failed" && CLOUD_ROUTE_UNAVAILABLE_CODES.has(s.errorCode ?? "");
235792
- const text17 = [];
235793
- if (outcome === "timeout") text17.push((read ? `Still ${s.status} after waiting ${span(timeoutSeconds)} here.` : `The job could not be read during ${span(timeoutSeconds)} here; its state is unknown, not failed.`) + ` The job continues in the cloud; nothing was cancelled or resubmitted. Run render-cloud wait ${id5} again to keep waiting, or render-cloud cancel ${id5} only if the user asks.`);
235794
- else if (outcome === "succeeded") text17.push(s.delivery ? `Delivery is ${s.delivery}.` : "The render finished.", s.next ?? `Inspect render-cloud delivery ${id5} before reviewing or downloading.`);
235795
- else if (outcome === "cancelled") text17.push(s.partialFiles ? `The job was cancelled and delivered what it had rendered: ${s.partialFiles} file${s.partialFiles === 1 ? "" : "s"}, one per continuous stretch of the video. Save them with render-cloud download ${id5} --out FILE before they expire; they are not the finished video.` : "The job was cancelled and will not run again.", s.next ?? `Confirm creditState with render-cloud get ${id5}.`);
235796
- else if (outcome === "queue_expired") text17.push("No render capacity was assigned within the maximum queue wait, so this job never started.", s.next ?? `Its credit reservation is returned; confirm creditState with render-cloud get ${id5}. A new attempt needs a fresh quote.`);
235797
- else text17.push(s.failure ?? "The render failed.", s.next ?? `Read render-cloud get ${id5} for the reported phase before another attempt; do not resubmit unchanged.`);
235798
- if (credits) text17.push(credits.charAt(0).toUpperCase() + credits.slice(1) + ".");
235799
- for (const notice of s.notices ?? []) text17.push(notice);
235800
- if (unavailable) text17.push("Do not switch to a local render on your own.", LOCAL_RENDER_RULE);
235801
- return text17.join(" ");
235928
+ const text18 = [];
235929
+ if (outcome === "timeout") text18.push((read ? `Still ${s.status} after waiting ${span(timeoutSeconds)} here.` : `The job could not be read during ${span(timeoutSeconds)} here; its state is unknown, not failed.`) + ` The job continues in the cloud; nothing was cancelled or resubmitted. Run render-cloud wait ${id5} again to keep waiting, or render-cloud cancel ${id5} only if the user asks.`);
235930
+ else if (outcome === "succeeded") text18.push(s.delivery ? `Delivery is ${s.delivery}.` : "The render finished.", s.next ?? `Inspect render-cloud delivery ${id5} before reviewing or downloading.`);
235931
+ else if (outcome === "cancelled") text18.push(s.partialFiles ? `The job was cancelled and delivered what it had rendered: ${s.partialFiles} file${s.partialFiles === 1 ? "" : "s"}, one per continuous stretch of the video. Save them with render-cloud download ${id5} --out FILE before they expire; they are not the finished video.` : "The job was cancelled and will not run again.", s.next ?? `Confirm creditState with render-cloud get ${id5}.`);
235932
+ else if (outcome === "queue_expired") text18.push("No render capacity was assigned within the maximum queue wait, so this job never started.", s.next ?? `Its credit reservation is returned; confirm creditState with render-cloud get ${id5}. A new attempt needs a fresh quote.`);
235933
+ else text18.push(s.failure ?? "The render failed.", s.next ?? `Read render-cloud get ${id5} for the reported phase before another attempt; do not resubmit unchanged.`);
235934
+ if (credits) text18.push(credits.charAt(0).toUpperCase() + credits.slice(1) + ".");
235935
+ for (const notice of s.notices ?? []) text18.push(notice);
235936
+ if (unavailable) text18.push("Do not switch to a local render on your own.", LOCAL_RENDER_RULE);
235937
+ return text18.join(" ");
235802
235938
  }
235803
235939
  var pollSeconds = (s) => Math.max(MIN_POLL_SECONDS, s.retryAfter ?? DEFAULT_POLL_SECONDS);
235804
235940
  function transientRead(error62) {
@@ -235816,7 +235952,7 @@ async function waitForRenderJob(client, id5, flags, overrides = {}) {
235816
235952
  if (flags.timeout !== void 0 && (typeof flags.timeout !== "string" || !/^\d{1,5}$/.test(flags.timeout) || Number(flags.timeout) > MAX_TIMEOUT_SECONDS)) throw bad(`--timeout must be a whole number of seconds from 0 to ${MAX_TIMEOUT_SECONDS}.`);
235817
235953
  const timeoutSeconds = flags.timeout === void 0 ? DEFAULT_TIMEOUT_SECONDS : Number(flags.timeout), json3 = flags.json === true;
235818
235954
  const deadline = runtime3.now() + timeoutSeconds * 1e3;
235819
- const emit = (event, text17) => runtime3.write(json3 ? JSON.stringify({ ...event, at: iso(runtime3.now()) }) : `${iso(runtime3.now())} ${text17}`);
235955
+ const emit = (event, text18) => runtime3.write(json3 ? JSON.stringify({ ...event, at: iso(runtime3.now()) }) : `${iso(runtime3.now())} ${text18}`);
235820
235956
  let previous = "", printedAt = -Infinity, failures = 0, polls = 0, last = { status: "unknown", recoveryPending: false, cleanupPending: false };
235821
235957
  const finish2 = (outcome, job) => {
235822
235958
  const exitCode = RENDER_WAIT_EXIT[outcome], guidance2 = resultGuidance(id5, outcome, last, timeoutSeconds, polls > 0);
@@ -235932,14 +236068,14 @@ function parseManifest(value, file3) {
235932
236068
  }
235933
236069
  async function readRenderJson(root, file3) {
235934
236070
  const raw = await readFile8(await checkedPath(root, file3, false), "utf8");
235935
- let data2;
236071
+ let data;
235936
236072
  try {
235937
- data2 = JSON.parse(raw);
236073
+ data = JSON.parse(raw);
235938
236074
  } catch {
235939
236075
  throw invalidManifest(file3, [{ path: "document", message: "Expected valid JSON; remove comments, trailing commas or incomplete values." }]);
235940
236076
  }
235941
- if (!data2 || typeof data2 !== "object" || Array.isArray(data2)) throw invalidManifest(file3, [{ path: "document", message: "Expected a JSON object." }]);
235942
- return data2;
236077
+ if (!data || typeof data !== "object" || Array.isArray(data)) throw invalidManifest(file3, [{ path: "document", message: "Expected a JSON object." }]);
236078
+ return data;
235943
236079
  }
235944
236080
  async function inspectRenderFile(path, label3, onChunk, chunkBytes = RENDER_CHUNK_BYTES) {
235945
236081
  const handle = await open13(path, "r");
@@ -236123,11 +236259,11 @@ async function cloudRenderCommand(client, root, command, id5, flags, waitRuntime
236123
236259
  try {
236124
236260
  for (let c = 0; c < o.chunks; c++) {
236125
236261
  const start4 = c * RENDER_CHUNK_BYTES;
236126
- const data2 = delivery ? await client.renderDeliveryChunk(`${endpoint2}/delivery/content`, start4, Math.min(o.bytes, start4 + RENDER_CHUNK_BYTES) - 1, o.bytes) : await client.renderChunk(`${endpoint2}/output/${c}`);
236127
- if (data2.length !== Math.min(RENDER_CHUNK_BYTES, o.bytes - count3)) throw bad2("Unexpected output chunk size.");
236128
- await handle.writeFile(data2);
236129
- hash16.update(data2);
236130
- count3 += data2.length;
236262
+ const data = delivery ? await client.renderDeliveryChunk(`${endpoint2}/delivery/content`, start4, Math.min(o.bytes, start4 + RENDER_CHUNK_BYTES) - 1, o.bytes) : await client.renderChunk(`${endpoint2}/output/${c}`);
236263
+ if (data.length !== Math.min(RENDER_CHUNK_BYTES, o.bytes - count3)) throw bad2("Unexpected output chunk size.");
236264
+ await handle.writeFile(data);
236265
+ hash16.update(data);
236266
+ count3 += data.length;
236131
236267
  }
236132
236268
  if (hash16.digest("hex") !== o.sha256) throw bad2("Output checksum mismatch.");
236133
236269
  await publishDownloadedRender(handle, temp, dest);
@@ -236316,11 +236452,11 @@ async function downloadPartialDelivery(client, root, id5, job, out) {
236316
236452
  let count3 = 0;
236317
236453
  try {
236318
236454
  for (let c = 0; c < part.chunks; c++) {
236319
- const data2 = await client.renderChunk(`/v1/render-cloud/${id5}/output/parts/${part.index}/${c}`);
236320
- if (data2.length !== Math.min(RENDER_CHUNK_BYTES, part.bytes - count3)) throw bad2("Unexpected output chunk size.");
236321
- await handle.writeFile(data2);
236322
- hash16.update(data2);
236323
- count3 += data2.length;
236455
+ const data = await client.renderChunk(`/v1/render-cloud/${id5}/output/parts/${part.index}/${c}`);
236456
+ if (data.length !== Math.min(RENDER_CHUNK_BYTES, part.bytes - count3)) throw bad2("Unexpected output chunk size.");
236457
+ await handle.writeFile(data);
236458
+ hash16.update(data);
236459
+ count3 += data.length;
236324
236460
  }
236325
236461
  if (hash16.digest("hex") !== part.sha256) throw bad2("Output checksum mismatch.");
236326
236462
  await publishDownloadedRender(handle, temp, dest);
@@ -236532,7 +236668,7 @@ async function waitForRenderBatch(client, id5, flags, overrides) {
236532
236668
  }, ...overrides };
236533
236669
  if (flags.timeout !== void 0 && (typeof flags.timeout !== "string" || !/^\d{1,5}$/.test(flags.timeout))) throw bad3("--timeout must be a whole number of seconds from 0 to 86400.");
236534
236670
  const timeoutSeconds = flags.timeout === void 0 ? 3600 : Math.min(86400, Number(flags.timeout)), deadline = runtime3.now() + timeoutSeconds * 1e3, json3 = flags.json === true;
236535
- const emit = (event, text17) => runtime3.write(json3 ? JSON.stringify({ ...event, at: new Date(runtime3.now()).toISOString() }) : `${new Date(runtime3.now()).toISOString()} ${text17}`);
236671
+ const emit = (event, text18) => runtime3.write(json3 ? JSON.stringify({ ...event, at: new Date(runtime3.now()).toISOString() }) : `${new Date(runtime3.now()).toISOString()} ${text18}`);
236536
236672
  const finish2 = (outcome, state2, guidance2, batch) => {
236537
236673
  const exitCode = RENDER_WAIT_EXIT[outcome];
236538
236674
  emit({ event: "result", batchId: id5, outcome, exitCode, state: state2, guidance: guidance2, ...batch ? { batch } : {} }, `Result: ${outcome} (exit ${exitCode}). ${guidance2}`);
@@ -236642,10 +236778,10 @@ function evaluateContinuity(input2) {
236642
236778
  limitations: ["Transcript timings and rectangles are supplied evidence, not independently detected or certified.", "No face boxes between sampled frames are inferred. Crops, speed changes and translations must be reflected in the final-coordinate evidence.", "Energy cannot distinguish voice from music or SFX; high energy is a listening-review candidate, never proof of a clipped word."]
236643
236779
  };
236644
236780
  }
236645
- function parseEnergyFrames(text17) {
236781
+ function parseEnergyFrames(text18) {
236646
236782
  const frames = [];
236647
236783
  let t;
236648
- for (const line of text17.split("\n")) {
236784
+ for (const line of text18.split("\n")) {
236649
236785
  const time3 = /pts_time:([\d.e+-]+)/.exec(line);
236650
236786
  if (time3) t = Number(time3[1]);
236651
236787
  const rms = /^lavfi\.astats\.Overall\.RMS_level=(-inf|[-\d.]+)$/.exec(line);
@@ -236744,8 +236880,8 @@ async function projectVariants(directory, project2, operation, id5, changes) {
236744
236880
  const item = JSON.parse(raw);
236745
236881
  let baseChanged = false;
236746
236882
  for (const [path, sha] of Object.entries(item.sourceHashes ?? {})) {
236747
- const text17 = await readText(root, path).catch(() => null);
236748
- if (text17 === null || createHash18("sha256").update(text17).digest("hex") !== sha) baseChanged = true;
236883
+ const text18 = await readText(root, path).catch(() => null);
236884
+ if (text18 === null || createHash18("sha256").update(text18).digest("hex") !== sha) baseChanged = true;
236749
236885
  }
236750
236886
  variants.push({ ...item, baseChanged });
236751
236887
  }
@@ -236757,18 +236893,18 @@ async function projectVariants(directory, project2, operation, id5, changes) {
236757
236893
  if (!c || typeof c !== "object" || Array.isArray(c) || Object.keys(c).some((k) => !["hook", "cta", "instructions"].includes(k)) || !Object.keys(c).length || Object.values(c).some((v) => typeof v !== "string" || !v.trim() || v.length > 4e3)) throw new CliError("INVALID_VARIANT", "Use hook, cta and/or instructions as nonempty text (up to 4000 characters each).", "Only scoped changes belong here; the base brand and editing preferences remain unchanged.");
236758
236894
  return withWorkspaceLock(root, async () => {
236759
236895
  const sourceHashes = {}, documents = {};
236760
- for (const [path, text17] of Object.entries(await readProjectWorkspace(root, project2))) sourceHashes[path] = createHash18("sha256").update(text17).digest("hex");
236896
+ for (const [path, text18] of Object.entries(await readProjectWorkspace(root, project2))) sourceHashes[path] = createHash18("sha256").update(text18).digest("hex");
236761
236897
  for (const name of ["project.json", "brief.md", "direction.md"]) {
236762
236898
  const path = `videos/${project2}/${name}`;
236763
- let text17;
236899
+ let text18;
236764
236900
  try {
236765
- text17 = await readText(root, path);
236901
+ text18 = await readText(root, path);
236766
236902
  } catch (e) {
236767
236903
  if (e.code === "ENOENT" && name !== "project.json") continue;
236768
236904
  throw e;
236769
236905
  }
236770
- documents[name] = text17;
236771
- sourceHashes[path] = createHash18("sha256").update(text17).digest("hex");
236906
+ documents[name] = text18;
236907
+ sourceHashes[path] = createHash18("sha256").update(text18).digest("hex");
236772
236908
  }
236773
236909
  const target = `${base}/${id5}`;
236774
236910
  await mkdir11(await checkedPath(root, base, false), { recursive: true });
@@ -236780,7 +236916,7 @@ async function projectVariants(directory, project2, operation, id5, changes) {
236780
236916
  }
236781
236917
  const manifest = { schemaVersion: 1, kind: "editorbrain.edit-variant", id: id5, project: project2, brand: JSON.parse(projectRaw).brand, sourceHashes, changes: c, mediaRoot: `.editorbrain-local/${project2}`, outputDirectory: `${target}/renders`, status: "draft", requiresTimingReview: true, approvalInherited: false };
236782
236918
  try {
236783
- for (const [name, text17] of Object.entries(documents)) await atomicWrite(root, `${target}/${name}`, text17, { document: false, overwrite: false });
236919
+ for (const [name, text18] of Object.entries(documents)) await atomicWrite(root, `${target}/${name}`, text18, { document: false, overwrite: false });
236784
236920
  await atomicWrite(root, `${target}/variant.json`, stableJson(manifest), { document: false, overwrite: false });
236785
236921
  } catch (error62) {
236786
236922
  throw new CliError("VARIANT_WRITE_INCOMPLETE", `Variant ${id5} could not be completed. Files already written remain at ${target}.`, "Inspect the partial directory and the base project. Choose a new variant ID after resolving the filesystem error.", false, { causeCode: error62.code ?? "WRITE_FAILED" });
@@ -238076,41 +238212,41 @@ async function presentProduction(client, root, projectId, value, options = {}) {
238076
238212
  if (await sha256(html.toString()) !== source2.sha256) throw invalid10("The artifact changed during presentation verification.");
238077
238213
  const matches2 = [...html.toString().matchAll(/<script id="review-data" type="application\/json">([\s\S]*?)<\/script>/g)];
238078
238214
  if (matches2.length !== 1) throw invalid10("This is not an identifiable EditorBrain review artifact.");
238079
- let data2;
238215
+ let data;
238080
238216
  try {
238081
- data2 = JSON.parse(matches2[0][1]);
238217
+ data = JSON.parse(matches2[0][1]);
238082
238218
  } catch {
238083
238219
  throw invalid10("The artifact identity JSON is invalid.");
238084
238220
  }
238085
- const { artifactId: embeddedId, ...clean } = data2;
238221
+ const { artifactId: embeddedId, ...clean } = data;
238086
238222
  if (embeddedId !== source2.artifactId || await sha256(JSON.stringify(clean)) !== source2.artifactId) throw invalid10("The immutable artifact lacks a matching identity for source.artifactId. Use the artifactId that production review-artifact returned for this file.");
238087
- if (data2.projectId !== projectId) throw invalid10("The immutable artifact was generated for a different project. Present an artifact generated for this project.");
238088
- if (data2.contextVersion === void 0) throw invalid10("The immutable artifact was generated without a contextVersion, so it cannot prove which editorial context was shown. Generate a new artifact with the contextVersion from production present; preserve the old one.");
238089
- if (data2.contextVersion !== evidence.contextVersion) throw invalid10("The immutable artifact was generated for a different editorial context than this evidence. Generate a new artifact with the current contextVersion from production present; preserve the old one.");
238090
- if (data2.stage !== evidence.phase) throw invalid10(`The immutable artifact was generated for the ${typeof data2.stage === "string" && /^[a-z]{1,20}$/.test(data2.stage) ? `"${data2.stage}"` : "another"} phase, not "${evidence.phase}". Generate a ${evidence.phase} artifact with production review-artifact (stage: ${evidence.phase}).`);
238091
- for (const key of ["projectId", "contextVersion", "stage"]) if (sidecar[key] !== void 0 && sidecar[key] !== data2[key]) throw invalid10("The sidecar identity conflicts with the immutable artifact.");
238092
- const momentList = Array.isArray(data2.moments) ? data2.moments.slice(0, 6) : [];
238223
+ if (data.projectId !== projectId) throw invalid10("The immutable artifact was generated for a different project. Present an artifact generated for this project.");
238224
+ if (data.contextVersion === void 0) throw invalid10("The immutable artifact was generated without a contextVersion, so it cannot prove which editorial context was shown. Generate a new artifact with the contextVersion from production present; preserve the old one.");
238225
+ if (data.contextVersion !== evidence.contextVersion) throw invalid10("The immutable artifact was generated for a different editorial context than this evidence. Generate a new artifact with the current contextVersion from production present; preserve the old one.");
238226
+ if (data.stage !== evidence.phase) throw invalid10(`The immutable artifact was generated for the ${typeof data.stage === "string" && /^[a-z]{1,20}$/.test(data.stage) ? `"${data.stage}"` : "another"} phase, not "${evidence.phase}". Generate a ${evidence.phase} artifact with production review-artifact (stage: ${evidence.phase}).`);
238227
+ for (const key of ["projectId", "contextVersion", "stage"]) if (sidecar[key] !== void 0 && sidecar[key] !== data[key]) throw invalid10("The sidecar identity conflicts with the immutable artifact.");
238228
+ const momentList = Array.isArray(data.moments) ? data.moments.slice(0, 6) : [];
238093
238229
  const mediaLimit = 3 + momentList.reduce((total, moment) => total + (Array.isArray(moment?.variants) ? Math.min(moment.variants.length, 4) : 0), 0);
238094
238230
  if (!Array.isArray(sidecar.media) || !sidecar.media.length || sidecar.media.length > mediaLimit) throw invalid10("The local review must include verified visual media; text-only proposals are not visual evidence.");
238095
238231
  const verifiedPreview = (preview) => hash13(preview?.sha256) && sidecar.media.some((entry2) => entry2.sha256 === preview.sha256 && entry2.uri === preview.uri);
238096
238232
  if (evidence.phase === "directions") {
238097
- const hasDirections = Array.isArray(data2.directions) && data2.directions.length > 0;
238233
+ const hasDirections = Array.isArray(data.directions) && data.directions.length > 0;
238098
238234
  if (!hasDirections && !momentList.length) throw invalid10("Every proposed direction needs its own verified visual preview.");
238099
- if (hasDirections && data2.directions.some((direction) => !verifiedPreview(direction?.preview))) throw invalid10("Every proposed direction needs its own verified visual preview.");
238235
+ if (hasDirections && data.directions.some((direction) => !verifiedPreview(direction?.preview))) throw invalid10("Every proposed direction needs its own verified visual preview.");
238100
238236
  if (momentList.some((moment) => !Array.isArray(moment?.variants) || moment.variants.some((variant) => !verifiedPreview(variant?.preview)))) throw invalid10("Every version shown for a moment needs its own verified preview in this artifact.");
238101
238237
  const decision = evidence.decision;
238102
- if (decision?.directionId !== void 0 && !(hasDirections && data2.directions.some((direction) => direction.id === decision.directionId))) throw invalid10("The selected direction does not exist in this artifact.");
238238
+ if (decision?.directionId !== void 0 && !(hasDirections && data.directions.some((direction) => direction.id === decision.directionId))) throw invalid10("The selected direction does not exist in this artifact.");
238103
238239
  if (decision && "variantChoices" in decision) {
238104
238240
  const issues = variantChoiceIssues(momentList, decision.variantChoices);
238105
238241
  if (issues.length) throw invalid10(`The variant choice does not match this artifact: ${issues.join(" ")}`);
238106
238242
  if (hasDirections && decision.directionId === void 0) throw invalid10("This artifact also proposes directions: include the chosen directionId together with variantChoices.");
238107
238243
  }
238108
- } else if (!hash13(data2.video?.sha256) || !sidecar.media.some((entry2) => entry2.sha256 === data2.video.sha256 && entry2.uri === data2.video.uri && ["video/mp4", "video/webm"].includes(entry2.mimeType))) {
238244
+ } else if (!hash13(data.video?.sha256) || !sidecar.media.some((entry2) => entry2.sha256 === data.video.sha256 && entry2.uri === data.video.uri && ["video/mp4", "video/webm"].includes(entry2.mimeType))) {
238109
238245
  throw invalid10("A review or delivery requires its exact video medium.");
238110
238246
  }
238111
238247
  if (evidence.phase === "delivery") {
238112
- if (source2.mediaSha256 && source2.mediaSha256 !== data2.video.sha256) throw invalid10("source.mediaSha256 must match the exact video in this artifact.");
238113
- source2.mediaSha256 = data2.video.sha256;
238248
+ if (source2.mediaSha256 && source2.mediaSha256 !== data.video.sha256) throw invalid10("source.mediaSha256 must match the exact video in this artifact.");
238249
+ source2.mediaSha256 = data.video.sha256;
238114
238250
  }
238115
238251
  for (const entry2 of sidecar.media) {
238116
238252
  if (!entry2 || typeof entry2.file !== "string" || !entry2.file.startsWith(`${source2.relativePath}.media-`) || !hash13(entry2.sha256)) throw invalid10("The local review contains an invalid media reference.");
@@ -238179,16 +238315,16 @@ async function presentBatchProduction(client, root, batchId, value, options = {}
238179
238315
  if (await sha256(html) !== source2.sha256) throw invalid10("The artifact changed during presentation verification.");
238180
238316
  const matches2 = [...html.matchAll(/<script id="review-data" type="application\/json">([\s\S]*?)<\/script>/g)];
238181
238317
  if (matches2.length !== 1) throw invalid10("This is not an identifiable EditorBrain batch Studio.");
238182
- let data2;
238318
+ let data;
238183
238319
  try {
238184
- data2 = JSON.parse(matches2[0][1]);
238320
+ data = JSON.parse(matches2[0][1]);
238185
238321
  } catch {
238186
238322
  throw invalid10("The artifact identity JSON is invalid.");
238187
238323
  }
238188
- const { artifactId: embeddedId, ...clean } = data2;
238324
+ const { artifactId: embeddedId, ...clean } = data;
238189
238325
  if (embeddedId !== source2.artifactId || await sha256(JSON.stringify(clean)) !== source2.artifactId) throw invalid10("The immutable batch Studio lacks a matching identity for source.artifactId.");
238190
- if (data2.kind !== "editorbrain.batch-review" || data2.batchId !== batchId) throw invalid10("This Studio was generated for another batch. Present the Studio of this batch.");
238191
- if (data2.stage !== input2.phase) throw invalid10(`The batch Studio was generated for the "${String(data2.stage).slice(0, 20)}" phase, not "${input2.phase}".`);
238326
+ if (data.kind !== "editorbrain.batch-review" || data.batchId !== batchId) throw invalid10("This Studio was generated for another batch. Present the Studio of this batch.");
238327
+ if (data.stage !== input2.phase) throw invalid10(`The batch Studio was generated for the "${String(data.stage).slice(0, 20)}" phase, not "${input2.phase}".`);
238192
238328
  if (!Array.isArray(sidecar.media) || !sidecar.media.length || sidecar.media.length > 28) throw invalid10("The batch Studio must include its verified visual media.");
238193
238329
  for (const entry2 of sidecar.media) {
238194
238330
  if (!entry2 || typeof entry2.file !== "string" || !entry2.file.startsWith(`${source2.relativePath}.media-`) || !hash13(entry2.sha256)) throw invalid10("The batch Studio contains an invalid media reference.");
@@ -238198,13 +238334,13 @@ async function presentBatchProduction(client, root, batchId, value, options = {}
238198
238334
  if (media2.sha256 !== entry2.sha256 || media2.bytes !== entry2.bytes) throw invalid10("A batch medium changed or is missing. Present a new verified Studio.");
238199
238335
  }
238200
238336
  const shown = (medium) => hash13(medium?.sha256) && sidecar.media.some((entry2) => entry2.sha256 === medium.sha256 && entry2.uri === medium.uri);
238201
- const projects = batchArtifactProjects(data2);
238337
+ const projects = batchArtifactProjects(data);
238202
238338
  if (input2.phase === "directions") {
238203
- if (!Array.isArray(data2.directions) || data2.directions.some((direction) => !shown(direction?.preview))) throw invalid10("Every proposed direction needs its own verified visual preview.");
238204
- if (input2.decision !== void 0 && (!input2.decision || input2.decision.userConfirmed !== true || Object.keys(input2.decision).length !== 2 || !data2.directions.some((direction) => direction.id === input2.decision.directionId))) throw invalid10("decision must be {userConfirmed:true, directionId} naming a direction of this Studio, as the user chose it.");
238339
+ if (!Array.isArray(data.directions) || data.directions.some((direction) => !shown(direction?.preview))) throw invalid10("Every proposed direction needs its own verified visual preview.");
238340
+ if (input2.decision !== void 0 && (!input2.decision || input2.decision.userConfirmed !== true || Object.keys(input2.decision).length !== 2 || !data.directions.some((direction) => direction.id === input2.decision.directionId))) throw invalid10("decision must be {userConfirmed:true, directionId} naming a direction of this Studio, as the user chose it.");
238205
238341
  if (input2.decisions !== void 0) throw invalid10("A directions batch records one shared choice in decision.");
238206
238342
  } else {
238207
- if ((data2.items ?? []).some((item) => !shown(item.video) || !String(item.video.mimeType).startsWith("video/"))) throw invalid10("Each batch item needs its exact video medium.");
238343
+ if ((data.items ?? []).some((item) => !shown(item.video) || !String(item.video.mimeType).startsWith("video/"))) throw invalid10("Each batch item needs its exact video medium.");
238208
238344
  if (input2.decision !== void 0) throw invalid10("Review and delivery decisions are per video: use decisions {projectId: {userConfirmed:true, approved:true}} only for videos the user approved.");
238209
238345
  for (const [projectId, decision] of Object.entries(input2.decisions ?? {})) if (!projects.some((p) => p.projectId === projectId) || decision?.userConfirmed !== true || decision?.approved !== true || Object.keys(decision).length !== 2) throw invalid10(`decisions.${projectId} must name a project of this Studio with {userConfirmed:true, approved:true}.`);
238210
238346
  }
@@ -238217,7 +238353,7 @@ async function presentBatchProduction(client, root, batchId, value, options = {}
238217
238353
  }
238218
238354
  if (Object.keys(unsynced).length) throw new CliError("PRESENTATION_CONTEXT_UNSYNCED", `These projects changed since the batch Studio was generated: ${Object.keys(unsynced).join(", ")}.`, "Reconcile each project, then generate and present a new batch Studio. Nothing was recorded or uploaded.", false, { projects: unsynced });
238219
238355
  const items = projects.map((project2) => {
238220
- const item = (data2.items ?? []).find((entry2) => entry2.projectId === project2.projectId);
238356
+ const item = (data.items ?? []).find((entry2) => entry2.projectId === project2.projectId);
238221
238357
  return { projectId: project2.projectId, contextVersion: project2.contextVersion, ...input2.phase === "delivery" ? { mediaSha256: item.video.sha256 } : {}, ...input2.decisions?.[project2.projectId] ? { decision: input2.decisions[project2.projectId] } : {} };
238222
238358
  });
238223
238359
  const body = {
@@ -238227,7 +238363,7 @@ async function presentBatchProduction(client, root, batchId, value, options = {}
238227
238363
  source: { kind: "local", artifactId: source2.artifactId, sha256: source2.sha256, relativePath: source2.relativePath },
238228
238364
  ...input2.decision ? { decision: input2.decision } : {},
238229
238365
  items,
238230
- ...input2.phase === "directions" && input2.decision ? { proposal: { directions: data2.directions.map((direction) => ({ id: direction.id, title: direction.title, description: direction.description })) } } : {}
238366
+ ...input2.phase === "directions" && input2.decision ? { proposal: { directions: data.directions.map((direction) => ({ id: direction.id, title: direction.title, description: direction.description })) } } : {}
238231
238367
  };
238232
238368
  const response = await client.request(`/v1/batches/${batchId}/review-evidence`, { method: "POST", body });
238233
238369
  if (response?.batchId !== batchId || !Array.isArray(response.results)) throw new CliError("PRESENTATION_OUTCOME_UNKNOWN", "The batch presentation receipt could not be verified.", "Repeat the same command with the same evidenceId: each project reuses its receipt. Never create another ID to conceal an uncertain write.", false, { evidenceId: input2.evidenceId, outcome: "unknown" });
@@ -238283,16 +238419,16 @@ init_src();
238283
238419
  // packages/core/src/review-batch-html.ts
238284
238420
  init_agent_handoff();
238285
238421
  import { createHash as createHash21 } from "node:crypto";
238286
- function batchReviewHandoff(data2, state) {
238287
- const directions = data2.stage === "directions", delivery = data2.stage === "delivery";
238288
- const entries = directions ? (data2.projectIds ?? []).map((projectId) => ({ projectId, title: projectId, version: "", contextVersion: data2.contextVersions?.[projectId] ?? null, video: void 0, revisionId: void 0 })) : (data2.items ?? []).map((item) => ({ projectId: item.projectId, title: item.title, version: item.version, contextVersion: item.contextVersion ?? null, video: item.video, revisionId: item.revisionId }));
238422
+ function batchReviewHandoff(data, state) {
238423
+ const directions = data.stage === "directions", delivery = data.stage === "delivery";
238424
+ const entries = directions ? (data.projectIds ?? []).map((projectId) => ({ projectId, title: projectId, version: "", contextVersion: data.contextVersions?.[projectId] ?? null, video: void 0, revisionId: void 0 })) : (data.items ?? []).map((item) => ({ projectId: item.projectId, title: item.title, version: item.version, contextVersion: item.contextVersion ?? null, video: item.video, revisionId: item.revisionId }));
238289
238425
  const feedback2 = [], blocks = [];
238290
238426
  let decided = 0;
238291
238427
  entries.forEach((entry2, index2) => {
238292
238428
  const own6 = state.items[entry2.projectId] ?? { comments: [] }, comments = own6.comments ?? [];
238293
238429
  const decision = directions ? state.choice ? "direction" : "undecided" : comments.length || own6.decision === "changes" ? "changes" : own6.decision === "approve" ? delivery ? "approve_final" : "approve_sample" : "undecided";
238294
238430
  if (decision !== "undecided") decided++;
238295
- feedback2.push({ schemaVersion: 1, kind: "editorbrain.review-feedback", batchId: data2.batchId, projectId: entry2.projectId, artifactId: data2.artifactId, version: entry2.version || null, videoSha256: entry2.video?.sha256 ?? null, ...entry2.video?.masterSha256 ? { masterSha256: entry2.video.masterSha256 } : {}, stage: data2.stage, contextVersion: entry2.contextVersion, ...entry2.revisionId ? { revisionId: entry2.revisionId } : {}, scope: "project", directionId: directions ? state.choice || null : null, decision, comments });
238431
+ feedback2.push({ schemaVersion: 1, kind: "editorbrain.review-feedback", batchId: data.batchId, projectId: entry2.projectId, artifactId: data.artifactId, version: entry2.version || null, videoSha256: entry2.video?.sha256 ?? null, ...entry2.video?.masterSha256 ? { masterSha256: entry2.video.masterSha256 } : {}, stage: data.stage, contextVersion: entry2.contextVersion, ...entry2.revisionId ? { revisionId: entry2.revisionId } : {}, scope: "project", directionId: directions ? state.choice || null : null, decision, comments });
238296
238432
  const head = `\u2014 ${index2 + 1}/${entries.length} \xB7 ${entry2.title}${entry2.title !== entry2.projectId ? ` (${entry2.projectId})` : ""}`;
238297
238433
  if (decision === "undecided") {
238298
238434
  blocks.push(`${head}
@@ -238300,17 +238436,17 @@ Sin decisi\xF3n todav\xEDa: no lo cambies ni lo apruebes; preg\xFAntame por este
238300
238436
  return;
238301
238437
  }
238302
238438
  blocks.push(`${head}
238303
- ${agentHandoffPrompt({ kind: "studio", projectId: entry2.projectId, version: entry2.version || null, artifactId: data2.artifactId, revisionId: entry2.revisionId ?? null, stage: data2.stage, decision, directionId: directions ? state.choice : null, comments, previewOnly: entry2.video?.purpose === "preview" && !entry2.video?.masterSha256, masterSha256: entry2.video?.masterSha256 ?? null })}`);
238439
+ ${agentHandoffPrompt({ kind: "studio", projectId: entry2.projectId, version: entry2.version || null, artifactId: data.artifactId, revisionId: entry2.revisionId ?? null, stage: data.stage, decision, directionId: directions ? state.choice : null, comments, previewOnly: entry2.video?.purpose === "preview" && !entry2.video?.masterSha256, masterSha256: entry2.video?.masterSha256 ?? null })}`);
238304
238440
  });
238305
238441
  const lines = [];
238306
238442
  if (state.draftPending) lines.push("Atenci\xF3n: hay un comentario sin guardar: esto no es una aprobaci\xF3n ni la lista completa. P\xEDdeme guardarlo y volver a copiar.");
238307
- lines.push(directions ? `EditorBrain \xB7 Lote ${data2.batchId}: eleg\xED la direcci\xF3n ${state.choice || "(ninguna)"} para los ${entries.length} videos (artefacto ${data2.artifactId}). Desarr\xF3llala en cada proyecto con su propio material y contexto; registra la elecci\xF3n con production present --batch ${data2.batchId} (MCP: record_review_evidence por proyecto, mismo directionId).` : `EditorBrain \xB7 Lote ${data2.batchId}: decid\xED ${decided} de ${entries.length} videos en un Studio (artefacto ${data2.artifactId}). Cada bloque es de su propio proyecto: aplica cada decisi\xF3n solo a ese video y no mezcles materiales.`);
238443
+ lines.push(directions ? `EditorBrain \xB7 Lote ${data.batchId}: eleg\xED la direcci\xF3n ${state.choice || "(ninguna)"} para los ${entries.length} videos (artefacto ${data.artifactId}). Desarr\xF3llala en cada proyecto con su propio material y contexto; registra la elecci\xF3n con production present --batch ${data.batchId} (MCP: record_review_evidence por proyecto, mismo directionId).` : `EditorBrain \xB7 Lote ${data.batchId}: decid\xED ${decided} de ${entries.length} videos en un Studio (artefacto ${data.artifactId}). Cada bloque es de su propio proyecto: aplica cada decisi\xF3n solo a ese video y no mezcles materiales.`);
238308
238444
  lines.push(...blocks);
238309
- lines.push(JSON.stringify({ schemaVersion: 1, kind: "editorbrain.batch-review-feedback", batchId: data2.batchId, artifactId: data2.artifactId, stage: data2.stage, items: feedback2 }));
238445
+ lines.push(JSON.stringify({ schemaVersion: 1, kind: "editorbrain.batch-review-feedback", batchId: data.batchId, artifactId: data.artifactId, stage: data.stage, items: feedback2 }));
238310
238446
  return lines.join("\n\n");
238311
238447
  }
238312
238448
  function batchReviewApp() {
238313
- const data2 = JSON.parse(document.getElementById("review-data").textContent);
238449
+ const data = JSON.parse(document.getElementById("review-data").textContent);
238314
238450
  const $ = (id5) => document.getElementById(id5);
238315
238451
  const el = (tag, value = "", cls = "") => {
238316
238452
  const node2 = document.createElement(tag);
@@ -238325,16 +238461,16 @@ function batchReviewApp() {
238325
238461
  return node2;
238326
238462
  };
238327
238463
  const clock3 = (ms2) => `${Math.floor(ms2 / 6e4)}:${String(Math.floor(ms2 / 1e3 % 60)).padStart(2, "0")}.${Math.floor(ms2 / 100 % 10)}`;
238328
- const isDirections = data2.stage === "directions", isDelivery = data2.stage === "delivery";
238329
- const key = "editorbrain:batch-review:" + data2.artifactId;
238330
- const projects = isDirections ? data2.projectIds : data2.items.map((i) => i.projectId);
238464
+ const isDirections = data.stage === "directions", isDelivery = data.stage === "delivery";
238465
+ const key = "editorbrain:batch-review:" + data.artifactId;
238466
+ const projects = isDirections ? data.projectIds : data.items.map((i) => i.projectId);
238331
238467
  let state = { items: {} };
238332
238468
  let storageOk = true;
238333
238469
  const drafts = {};
238334
238470
  try {
238335
238471
  const saved = JSON.parse(localStorage.getItem(key) || "null");
238336
238472
  if (saved && typeof saved === "object") {
238337
- if (isDirections && data2.directions.some((d2) => d2.id === saved.choice)) state.choice = saved.choice;
238473
+ if (isDirections && data.directions.some((d2) => d2.id === saved.choice)) state.choice = saved.choice;
238338
238474
  for (const id5 of projects) {
238339
238475
  const value = saved.items?.[id5];
238340
238476
  if (!value) continue;
@@ -238355,11 +238491,11 @@ function batchReviewApp() {
238355
238491
  $("saved").textContent = storageOk ? "Guardado en este navegador \xB7 Nada se env\xEDa solo" : "No se pudo guardar aqu\xED \xB7 Copia o descarga antes de cerrar";
238356
238492
  };
238357
238493
  const draftPending = () => Object.values(drafts).some((d2) => d2.text.trim());
238358
- const handoff2 = () => batchReviewHandoff(data2, { choice: state.choice, items: Object.fromEntries(projects.map((id5) => [id5, { decision: item(id5).decision, comments: item(id5).comments.map(({ id: _id, ...c }) => c) }])), draftPending: draftPending() });
238494
+ const handoff2 = () => batchReviewHandoff(data, { choice: state.choice, items: Object.fromEntries(projects.map((id5) => [id5, { decision: item(id5).decision, comments: item(id5).comments.map(({ id: _id, ...c }) => c) }])), draftPending: draftPending() });
238359
238495
  const status2 = (message) => {
238360
238496
  $("status").textContent = message;
238361
238497
  };
238362
- $("title").textContent = data2.title;
238498
+ $("title").textContent = data.title;
238363
238499
  $("count").textContent = `${projects.length} ${projects.length === 1 ? "video" : "videos"} \xB7 ${isDirections ? "Propuestas" : isDelivery ? "Entrega" : "Revisi\xF3n"}`;
238364
238500
  $("heading").textContent = isDirections ? "Elige una direcci\xF3n para todo el lote" : `Revisa los ${projects.length} videos del lote`;
238365
238501
  $("intro").textContent = isDirections ? "La direcci\xF3n elegida se aplica a cada video con su propio material. Nada se env\xEDa solo." : "Decide video por video o aplica a todos. Tus decisiones se quedan aqu\xED hasta que las copies a tu chat.";
@@ -238378,7 +238514,7 @@ function batchReviewApp() {
238378
238514
  const grid = $("items");
238379
238515
  grid.replaceChildren();
238380
238516
  grid.className = "batch-directions";
238381
- for (const direction of data2.directions) {
238517
+ for (const direction of data.directions) {
238382
238518
  const card = el("article", "", "batch-card");
238383
238519
  card.dataset.direction = direction.id;
238384
238520
  if (direction.preview) {
@@ -238422,7 +238558,7 @@ function batchReviewApp() {
238422
238558
  const list3 = $("items");
238423
238559
  list3.replaceChildren();
238424
238560
  list3.className = "batch-items";
238425
- data2.items.forEach((entry2, index2) => {
238561
+ data.items.forEach((entry2, index2) => {
238426
238562
  const id5 = entry2.projectId, own6 = item(id5), card = el("article", "", "batch-card");
238427
238563
  card.dataset.project = id5;
238428
238564
  const head = el("div", "", "card-head");
@@ -238551,14 +238687,14 @@ function batchReviewApp() {
238551
238687
  status2(`Comentario agregado a los ${projects.length} videos.`);
238552
238688
  };
238553
238689
  $("copy").onclick = async () => {
238554
- const text17 = handoff2();
238690
+ const text18 = handoff2();
238555
238691
  try {
238556
- await navigator.clipboard.writeText(text17);
238692
+ await navigator.clipboard.writeText(text18);
238557
238693
  status2("Copiado. P\xE9galo en la misma conversaci\xF3n de Claude o Codex.");
238558
238694
  } catch {
238559
238695
  $("manual").open = true;
238560
238696
  const area = $("request");
238561
- area.value = text17;
238697
+ area.value = text18;
238562
238698
  area.select();
238563
238699
  status2("No se pudo copiar autom\xE1ticamente. Copia el texto seleccionado.");
238564
238700
  }
@@ -238566,7 +238702,7 @@ function batchReviewApp() {
238566
238702
  $("download").onclick = () => {
238567
238703
  const url3 = URL.createObjectURL(new Blob([handoff2()], { type: "text/plain" })), anchor2 = document.createElement("a");
238568
238704
  anchor2.href = url3;
238569
- anchor2.download = `batch-${data2.batchId.slice(0, 8)}-review-${data2.artifactId.slice(0, 8)}.txt`;
238705
+ anchor2.download = `batch-${data.batchId.slice(0, 8)}-review-${data.artifactId.slice(0, 8)}.txt`;
238570
238706
  anchor2.click();
238571
238707
  setTimeout(() => URL.revokeObjectURL(url3), 1e3);
238572
238708
  };
@@ -238613,10 +238749,10 @@ textarea{width:100%;min-height:76px;padding:10px 12px;border:1px solid var(--lin
238613
238749
  footer{margin-top:32px;font-size:12px;color:var(--muted);display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
238614
238750
  @media (max-width:520px){.decide{grid-template-columns:1fr}}
238615
238751
  `;
238616
- function renderBatchReviewArtifact(data2, wordmark) {
238752
+ function renderBatchReviewArtifact(data, wordmark) {
238617
238753
  const script = `${embeddedFunctions({ agentHandoffPrompt, batchReviewHandoff })}(${batchReviewApp.toString()})();`;
238618
238754
  const hash16 = createHash21("sha256").update(script).digest("base64");
238619
- const json3 = JSON.stringify(data2).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
238755
+ const json3 = JSON.stringify(data).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
238620
238756
  return `<!doctype html>
238621
238757
  <html lang="es"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
238622
238758
  <meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'sha256-${hash16}'; style-src 'unsafe-inline'; img-src 'self' data:; media-src 'self' data: blob:; connect-src 'none'; font-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none'">
@@ -239104,13 +239240,13 @@ async function localReviewIdentity(root, html) {
239104
239240
  assertIdentifier(sidecar.projectId);
239105
239241
  const page2 = (await readReviewFile(await checkedPath(root, html, false), 2 * 1024 * 1024)).toString();
239106
239242
  const matches2 = [...page2.matchAll(/<script id="review-data" type="application\/json">([\s\S]*?)<\/script>/g)];
239107
- let data2 = {};
239243
+ let data = {};
239108
239244
  try {
239109
- if (matches2.length === 1) data2 = JSON.parse(matches2[0][1]);
239245
+ if (matches2.length === 1) data = JSON.parse(matches2[0][1]);
239110
239246
  } catch {
239111
239247
  }
239112
- const text17 = (value, fallback) => typeof value === "string" && value.trim() ? value.trim().slice(0, 80) : fallback;
239113
- return { projectId: sidecar.projectId, stage: sidecar.stage, videoFile: sidecar.videoFile, title: text17(data2.title, sidecar.projectId), version: text17(data2.version, "revisi\xF3n") };
239248
+ const text18 = (value, fallback) => typeof value === "string" && value.trim() ? value.trim().slice(0, 80) : fallback;
239249
+ return { projectId: sidecar.projectId, stage: sidecar.stage, videoFile: sidecar.videoFile, title: text18(data.title, sidecar.projectId), version: text18(data.version, "revisi\xF3n") };
239114
239250
  }
239115
239251
  async function shareReviewToCloud(client, root, options, runtime3 = { submit: submitProduction }) {
239116
239252
  const { projectId, stage } = options;
@@ -239813,10 +239949,10 @@ function readStyleArchive(bytes, pin) {
239813
239949
  const manifest = JSON.parse(files.get("BUNDLE-MANIFEST.json")?.toString("utf8") ?? "null");
239814
239950
  if (!manifest || manifest.style !== pin.id || manifest.version !== pin.version || manifest.entry !== (manifest.engine === "hyperframes" ? "index.html" : `styles/${pin.id}/scene.html`) || !manifest.files || Array.isArray(manifest.files)) throw new Error("Invalid style manifest");
239815
239951
  if (Object.keys(manifest.files).length !== files.size - 1) throw new Error("Incomplete style manifest");
239816
- for (const [name, data2] of files) {
239952
+ for (const [name, data] of files) {
239817
239953
  if (name === "BUNDLE-MANIFEST.json") continue;
239818
239954
  const expected = manifest.files[name];
239819
- if (!expected || expected.bytes !== data2.length || expected.sha256 !== archiveHash(data2)) throw new Error("Manifest hash mismatch: " + name);
239955
+ if (!expected || expected.bytes !== data.length || expected.sha256 !== archiveHash(data)) throw new Error("Manifest hash mismatch: " + name);
239820
239956
  }
239821
239957
  return { files, manifest };
239822
239958
  }
@@ -239951,7 +240087,7 @@ async function prepareStyleSource(root, requested, version3, file3, out, options
239951
240087
  const { binding, tokensSha256 } = options.brandId ? await bindStyleBrand(root, files, { id: id5, version: version3, guard: guard.guard, html, brandId: options.brandId }) : { binding: void 0, tokensSha256: void 0 };
239952
240088
  files.set(entry2, Buffer.from(html.replace(marker, (binding ? '<script src="../../lib/project-brand.js"></script>\n' : "") + '<script src="../../lib/project-binding.js"></script>\n' + marker)));
239953
240089
  const listRoles = sceneListColorRoles(sceneDemoBrand(html)), guardText = allowEmptySfx(allowListColorRoles(guard.guard, listRoles)), savedGuides = await readSavedGuides(root, id5);
239954
- for (const [name, data2] of savedGuides) files.set(name, data2);
240090
+ for (const [name, data] of savedGuides) files.set(name, data);
239955
240091
  files.set("lib/runtime.js", Buffer.from(guard.runtime));
239956
240092
  files.set("lib/project-binding.js", Buffer.from(guardText));
239957
240093
  const ratio = selected.ratio === "wide" ? "wide" : "tall";
@@ -239980,10 +240116,10 @@ ${voice0 ? `Voz: ${voice0.message} Opciones: ${voice0.options.join(" ")} Estilos
239980
240116
  await checkedPath(root, out, false);
239981
240117
  await mkdir16(target, { mode: 448 });
239982
240118
  try {
239983
- for (const [name, data2] of files) {
240119
+ for (const [name, data] of files) {
239984
240120
  const destination = await checkedPath(target, name, false);
239985
240121
  await mkdir16(dirname19(destination), { recursive: true });
239986
- await writeFile2(destination, data2, { flag: "wx", mode: 384 });
240122
+ await writeFile2(destination, data, { flag: "wx", mode: 384 });
239987
240123
  }
239988
240124
  } catch (error62) {
239989
240125
  await rm8(target, { recursive: true, force: true });
@@ -240186,9 +240322,9 @@ async function readSettings(directory, file3) {
240186
240322
  try {
240187
240323
  const info = await handle.stat();
240188
240324
  if (!info.isFile() || info.size > 32768) throw new Error("--file must be a regular JSON file of at most 32 KiB.");
240189
- const text17 = new TextDecoder("utf-8", { fatal: true }).decode(await handle.readFile());
240325
+ const text18 = new TextDecoder("utf-8", { fatal: true }).decode(await handle.readFile());
240190
240326
  try {
240191
- input2 = JSON.parse(text17);
240327
+ input2 = JSON.parse(text18);
240192
240328
  } catch {
240193
240329
  throw new Error("--file must contain valid JSON email settings.");
240194
240330
  }
@@ -240244,9 +240380,9 @@ async function agencyCommunicationsCommand(client, command, flags) {
240244
240380
  return Number(v);
240245
240381
  };
240246
240382
  const plain2 = (key, max) => {
240247
- const text17 = required2(key);
240248
- if (text17.length > max || /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/.test(text17) || !text17.trim()) throw new Error(`--${key} must be nonempty plain text of at most ${max} characters.`);
240249
- return text17;
240383
+ const text18 = required2(key);
240384
+ if (text18.length > max || /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/.test(text18) || !text18.trim()) throw new Error(`--${key} must be nonempty plain text of at most ${max} characters.`);
240385
+ return text18;
240250
240386
  };
240251
240387
  const root = value("dir") ?? process.cwd();
240252
240388
  if (command === "email-settings") {
@@ -240702,6 +240838,98 @@ import { fileURLToPath } from "node:url";
240702
240838
 
240703
240839
  // packages/cli/src/agent-guidance-history.ts
240704
240840
  var VERIFIED_GUIDANCE_RELEASES = [
240841
+ {
240842
+ "version": "0.61.0",
240843
+ "archiveSha256": "a25ee843eb0b4e46642a2db90c6e501862f61d59f5664e5232734f882fc9e6a9",
240844
+ "files": {
240845
+ "editorbrain-formats/SKILL.md": "6070a620aa2e9d94864161f7511500467bbe183ba8c5fd173cdd633076505323",
240846
+ "editorbrain-formats/references/adaptation.md": "3d0676fa62f2b143694a2daa41514a901cede38fa1b917936663f0dbc3ca664b",
240847
+ "editorbrain-formats/references/aspirational-list-demo.md": "d80d5d301343d9716c7e9f58a0f71c74a254df85497280b70f7dc82c8731d700",
240848
+ "editorbrain-formats/references/cumulative-tier-list.md": "7b7e8208687c6b925443e55d640ced6c1d09824377884244a09d7f3089d60aa5",
240849
+ "editorbrain-formats/references/numbered-tutorial.md": "539a4a63d0dad303d3acdf935c38de5943cd6d9a7b1fa5ad6cc4dcfa2c7cc3df",
240850
+ "editorbrain-motion/SKILL.md": "2f7a92aef2bf3f20b57def99e41ce5f14822659cfcc39fd1898886ee94beb158",
240851
+ "editorbrain-motion/references/authored-scenes.md": "668967bce8d627979d679ce3c067b3015f9d083b965d6866a0ca70b8e1148372",
240852
+ "editorbrain-motion/references/code-motion.md": "d0e0dc5fc0268b077f435739d2004f5f5dfe5867e6418801cbe5e93ba5a4e047",
240853
+ "editorbrain-motion/references/component-library.md": "e88ed19d2ab9dca8d2ea02abe6c476021c03b9679bce99292cf7da52d65d2236",
240854
+ "editorbrain-motion/references/generated-motion.md": "a8d214b53c15f742658abd84f03b768fa2821f8cde94f50aab82a3759a30b36b",
240855
+ "editorbrain-motion/references/motion-craft.md": "ff98268b1f03526cfca63b4948d84270085f794650a04a860cef8bb3cf1a8059",
240856
+ "editorbrain-reference/SKILL.md": "2f08e5473a7f17d78e35d8e2f31320981c9884a23e226136817bb9dc71d5e4fd",
240857
+ "editorbrain-reference/references/measure.md": "c7ec73b088d5ff0f6984ed7d99d4ccbe7c6be4ec574b20cd3f9dac80dcf515a2",
240858
+ "editorbrain-reference/references/observe.md": "496d47c2a2a576a55850b192b676d87ed5cc442da49f11b38ca785e45642d639",
240859
+ "editorbrain-reference/references/replicate.md": "9a522fcc7bfab4c4aba18312fb11094c001914928878232875764787efe04de6",
240860
+ "editorbrain-reference/references/style-mapping.md": "ee19e86756a00275c60c69c331b4d2113300df786f20d667619a7110a2a0233e",
240861
+ "editorbrain/AGENTS.md": "7457e24a8cd52c26748dd13c6aea1f6d76efc42524339caa41fa29886aa73338",
240862
+ "editorbrain/SKILL.md": "5cc25cd2d700b96a26bf8d62860920909d2b4e2b1f39efde6d276d83ba39f305",
240863
+ "editorbrain/references/agency.md": "456165c906a5d127131fe8d4d472d5e7016b30f333bbad67019824ebccca3cfb",
240864
+ "editorbrain/references/audio-production.md": "c1734640cb56362bd5d4adf0bd11d2d5cd6fa0c8cf9a6a711d4e9479b1d02505",
240865
+ "editorbrain/references/caption-styles.md": "c73230fdb51ca12948a537315a33f393341a130cbceebfb8315fe8c89586862e",
240866
+ "editorbrain/references/captions.md": "8c45e1023b2ba4b58f52fc6598d1312494608571b1ba089fa8a29af2358d4b02",
240867
+ "editorbrain/references/chat-attachments.md": "176df1013086dfe008df863b3f5ca5b6f30c3e84b9c595a8e514f17c07f222f0",
240868
+ "editorbrain/references/choice-page.md": "66d46616ebd421c59420d750f18db39bdde08548bea958c99fa414be7d1af966",
240869
+ "editorbrain/references/cli-mcp.md": "66e57d7669cb9ae3ed2c65872167de3c5be4a79892001ebcf91fc455eb4dfa15",
240870
+ "editorbrain/references/cloud-production.md": "d2dd7ba1f8920be4fe3b8253a6d74366ae050ebe6a078371ee8c0fe5af6100ca",
240871
+ "editorbrain/references/editorial-contract.md": "efa0018f21dc6f0fd5b58b97214b8ba7f233e95eac0c09cc0702ccd6f165d374",
240872
+ "editorbrain/references/editorial-evidence.md": "79ed5bd90eb903014313c32a1e337822c5cb454e642bcfa852dcb77d30a9392e",
240873
+ "editorbrain/references/editorial-families.md": "44ed72b00ffe1df25af58a1cea46901e20bb19469c07a47c63f29303b91bff38",
240874
+ "editorbrain/references/editorial-profile.md": "0eb2d17a4f83d676c391d83caf2a111754b429c3a7b1589b6fa45dcfce4d2910",
240875
+ "editorbrain/references/family-animated.md": "54a140d0a64b01147c52ea8cbaab4e4599bfe1af330f5a3ad6ef2a30351ab47d",
240876
+ "editorbrain/references/family-demonstration.md": "737334a8d9230682cde3a6ed11bfc02c4f9795c8f25a3b668be9d7393ec3e53d",
240877
+ "editorbrain/references/family-essay.md": "003f2cd450f33ba6641a9b1114cbc578c04cbb658b992c89c765d43198d1b4c2",
240878
+ "editorbrain/references/family-personal.md": "e93c304d7bc7d3eb31a3c9cb3be83f4f48d41319c2ac2e1e6f53f38576f5e644",
240879
+ "editorbrain/references/family-presenter.md": "76b8140b924930b306ce97772d6a7b683870bd14f19772b5339a490752b7de24",
240880
+ "editorbrain/references/first-edit.md": "92746e06cde876bd60d0d7e4aa6c88c40d095308c37332a21de9de8c8fdb1940",
240881
+ "editorbrain/references/first-session-choosing.md": "74f71727f4b63b2398b63b6604183bf2fec2826e58d900470d40d6c77dffcb07",
240882
+ "editorbrain/references/first-session-money.md": "d307064d919cfcc437ce93bc63e3536b7d983fffeb99d29fbb389503eb1cb45e",
240883
+ "editorbrain/references/first-session-pages.md": "6b60c3229de9bdb8cbb64676e328be7f8b9c5df064fe86d143e69c104febdddf",
240884
+ "editorbrain/references/first-session-records.md": "0957a44acce92e5f7523e72f7e541c410e2a1a7fbf8a3866be5eada08aaf698a",
240885
+ "editorbrain/references/first-session-video.md": "d9e7c88614b11141043632170e17a8a3d2a7b1205c3cc53d6365972345c11289",
240886
+ "editorbrain/references/integrations.md": "355eb6f6db53f51c917608bd97e5a3bdcae98fae099b35524fddb9dc514bcf05",
240887
+ "editorbrain/references/library-sheets.md": "5a2ff7bc1eeffea2a42ad0a2050ab0d2a8cc9f84b67b5d430f43fb8f59afbc5c",
240888
+ "editorbrain/references/local-production.md": "a5f00ab2657c418680a1d6ed4bb0228ce8972b17ca766d4c1b8786ea937c1e44",
240889
+ "editorbrain/references/mcp-studio-artifact.md": "1b665f1737300c701ef29facd429a4631914b064bba21c4ca58e638af8da0dbb",
240890
+ "editorbrain/references/media-preferences.md": "d8c22cd1e861b95ba5a82b34ddef0dc12282dd0fc1581e96487f51b339dcc3a3",
240891
+ "editorbrain/references/memory-and-review.md": "383d8e0fe610b014db7092e495f14c07f339ad40a2b92f31d6cb4a654151a28d",
240892
+ "editorbrain/references/motion-review.md": "0fb09a2d61ecd13114ced5cca5daa4580a922cf7d7b3f8698077ceb0e96da6f0",
240893
+ "editorbrain/references/onboarding.md": "5f1a18813308c82c6e120291098aec362e81b781ba3013fb598f5c9f1863c1df",
240894
+ "editorbrain/references/personal-resources.md": "bb3a17ed575b16f36470dd3f60efc6699cf9197a39654b6a981d4b1f2b110988",
240895
+ "editorbrain/references/pro-moves.md": "2c4aad100d531b0fa63c5cdaa0287eb5f3864094bbcb18bb836fbbd099f2f90c",
240896
+ "editorbrain/references/production-and-review.md": "d235083c17f3d4caa118a2399509089f55db99fe664f9d9b6b40043ec650e954",
240897
+ "editorbrain/references/production-continuity.md": "12cf2733ab1a8507b542ed00f254814347df5a1d518c9b751935a8445860d320",
240898
+ "editorbrain/references/production-routing.md": "ccbee2ba5182d801491e7c4919edfd73f487463e5c007f350d2b9134158d4a63",
240899
+ "editorbrain/references/project-batches.md": "fee274fa69070364869b09568d4d73644d15369c059ffafd70b94fa7e04c50fb",
240900
+ "editorbrain/references/quality-checks.md": "41175552b8f3dbb1c2befb1282f305ce722b048a21af7f271266b9b473ffbf75",
240901
+ "editorbrain/references/real-media.md": "2fce05015b45e0d2fe6b700a1d12b14633054c5fa8466a93a842d2bc7ef49b65",
240902
+ "editorbrain/references/render-delivery.md": "c9cef593860b381cb08953d6771b0fea6b5465dee5483c3535f6854097181d87",
240903
+ "editorbrain/references/search-brief.md": "7352dcd2d97ca0d30caa6879798da5c7d9c09a5425e46348b9f9cf5f239a37a6",
240904
+ "editorbrain/references/sfx-library.md": "2975d2d65687f9f68c5f79ef744f3e0c502105f316572f1e6f187ceca9d43cae",
240905
+ "editorbrain/references/starting-an-edit.md": "64b10f8f2dfcbfc56c84dabf28fea0415f75a21dafc4f2ab9ee4757d10784ae3",
240906
+ "editorbrain/references/starting-points.md": "540a88423558d758e3187ac997043e9636447f3d96bebc270d1a08ed146a76a1",
240907
+ "editorbrain/references/storage-and-previews.md": "60040658617ec9f34ccb7306880309c1da296e3e4850807ec610fa8a13d1b907",
240908
+ "editorbrain/references/studio-review.md": "e8859ade78992759207766c7d3801cbd4db1598d80c56d6a3e0443717592643c",
240909
+ "editorbrain/references/studio.md": "da28d2af22d7afc88fb6deb79f9ad3fba7b9ed8b74f4feb4111c323abcd2b78f",
240910
+ "editorbrain/references/style-creator.md": "87e332178b74e3f7469383a331d4feb40164077e39b7bdf1c0890a477fb0d6e9",
240911
+ "editorbrain/references/style-glance.md": "12241f2a9d2cc42885a858c6b6676bc56e892fc4fd743d3d0c3fb57f255bb1c6",
240912
+ "editorbrain/references/style-rules.md": "e00400a7248eb2809593dd658c1f860dda89d57588f2287cc3967758f4865371",
240913
+ "editorbrain/references/style-sharing.md": "11079572c54222fc708d5a85cadf4064b07ae6febff42d8c5fdf5719f934b3fc",
240914
+ "editorbrain/references/style-source.md": "be79be9b42905f1c94c55cc99b9bdd0b7b6baa772f00fa4618c0383fae29511c",
240915
+ "editorbrain/references/support.md": "cc3ec494c544dde5433614c23a2d4ea168cac506ea3c7742289920c4f2b81007",
240916
+ "editorbrain/references/task-map.md": "72eb2b813d99f8a098b9524b32b195d943d3b1efe5548600a33be463493741dc",
240917
+ "editorbrain/references/user-guides.md": "47b49bff489ccd973badebf1a122d5d0e8acc451424afdb9ef19e1fe4c197f2a",
240918
+ "editorbrain/references/visual-pages.md": "172399cee928cfe75fe875836d016396783fff5d473a53dd31cf3c6d85b4d872",
240919
+ "editorbrain/references/voice-cleanup.md": "7a7101068c671fcb9a7228f3cdae5cc7a4c2e54a50c86f8f6b27b481d9aba416",
240920
+ "editorbrain/references/workflow-context.md": "6bd1acfba26f60c1b51cb0381357203a9f3e2a5b154b04cbb676f42863ae1849",
240921
+ "editorbrain/references/workflow-evidence.md": "5c0c1b56cf165c3e980ed9fe276130292a517c18d254e744381810a77f176d18",
240922
+ "editorbrain/references/workflows/correction.md": "0e10d5cfa92d225a9528e4192d80a842ee7ae4ab2d0410a36d73df2d0d5a958e",
240923
+ "editorbrain/references/workflows/delivery.md": "f6d38d04954e06d6443f27779b8365687b2ac11c4ddf1170b4cb02ab802dc2b8",
240924
+ "editorbrain/references/workflows/first-creation.md": "bfc87c673fea6b3899c51b5743eeaf2de1aff57b3ad2e03c741917ac26a22f86",
240925
+ "editorbrain/references/workflows/not-there-yet.md": "8f6832f23a4b4218aa6c9674a94b96110af2e8a203f75d7048a8b0ffe2c2118e",
240926
+ "editorbrain/references/workflows/resume.md": "14e4b28c23d8095892cdff235710dc4af89d800530de5cc56b61fad0fa9afd8b",
240927
+ "editorbrain/references/workflows/setup.md": "17532d2fd02743329a096829bedb1fe6886a2651ed8c1582e79321407f48681b",
240928
+ "editorbrain/references/workflows/start.md": "8767197d83163f52b89ef21d5f74b0edf2f6cbaf2513b7cad15142beed37f9be",
240929
+ "editorbrain/references/workspace-files.md": "cfa9aa41a18a52bd49dcb7181979595f6735c67e5562f8e8408d8576655e4737",
240930
+ "editorbrain/scripts/deepfilter-cleanup.mjs": "e557a31bea16570c7ab16aaf54f883110bad8a42e28fac6282b0a1aa81de635e"
240931
+ }
240932
+ },
240705
240933
  {
240706
240934
  "version": "0.60.0",
240707
240935
  "archiveSha256": "6999cb7f8824bebdb679b8ff83f821d4f7198f6be67d546f3e728f12f44864e6",
@@ -242954,11 +243182,11 @@ async function readGeminiSettings(path) {
242954
243182
  throw error62;
242955
243183
  }
242956
243184
  if (info.isSymbolicLink() || !info.isFile()) throw new CliError("UNSAFE_GEMINI_SETTINGS", "The Gemini settings file is not a regular file.", "Inspect it manually; setup did not change it.");
242957
- const text17 = await readFile10(path, "utf8");
243185
+ const text18 = await readFile10(path, "utf8");
242958
243186
  let value = {};
242959
- if (text17.trim()) {
243187
+ if (text18.trim()) {
242960
243188
  try {
242961
- value = JSON.parse(text17);
243189
+ value = JSON.parse(text18);
242962
243190
  } catch {
242963
243191
  throw invalid16(path);
242964
243192
  }
@@ -242966,7 +243194,7 @@ async function readGeminiSettings(path) {
242966
243194
  if (!value || typeof value !== "object" || Array.isArray(value)) throw invalid16(path);
242967
243195
  const servers = value.mcpServers ?? {};
242968
243196
  if (!servers || typeof servers !== "object" || Array.isArray(servers)) throw invalid16(path);
242969
- return { exists: true, text: text17, mode: info.mode & 511, value, servers };
243197
+ return { exists: true, text: text18, mode: info.mode & 511, value, servers };
242970
243198
  }
242971
243199
  function findGeminiServer(servers, endpoint2) {
242972
243200
  for (const [name, server] of Object.entries(servers)) {
@@ -243165,12 +243393,12 @@ var links = { credits: "https://editorbrain.com/app/billing", integrations: "htt
243165
243393
  function studioSummary(value) {
243166
243394
  const invalid25 = () => new CliError("INVALID_RESPONSE", "Respuesta de herramientas IA incompleta.", "Consulta editorbrain studio catalog; no inicies una generaci\xF3n con estado desconocido.");
243167
243395
  if (!value || typeof value !== "object") throw invalid25();
243168
- const data2 = value;
243169
- if (typeof data2.balance !== "number" || !Number.isFinite(data2.balance) || data2.balance < 0 || typeof data2.checkoutAvailable !== "boolean" || !Array.isArray(data2.tools) || data2.tools.length > 20) throw invalid25();
243396
+ const data = value;
243397
+ if (typeof data.balance !== "number" || !Number.isFinite(data.balance) || data.balance < 0 || typeof data.checkoutAvailable !== "boolean" || !Array.isArray(data.tools) || data.tools.length > 20) throw invalid25();
243170
243398
  const names = { scribe: "tempo", tempo: "tempo", prism: "prism", vox: "vox", music: "aura", aura: "aura" };
243171
- const tools = data2.tools.map((item) => {
243399
+ const tools = data.tools.map((item) => {
243172
243400
  if (!item || typeof item !== "object" || typeof item.id !== "string" || !Object.hasOwn(names, item.id) || typeof item.available !== "boolean" || typeof item.canSpend !== "boolean") throw invalid25();
243173
- const reasons = [!item.available ? "unavailable" : null, !item.canSpend ? "permission_required" : null, data2.balance === 0 ? "no_credits" : null].filter((reason) => reason !== null);
243401
+ const reasons = [!item.available ? "unavailable" : null, !item.canSpend ? "permission_required" : null, data.balance === 0 ? "no_credits" : null].filter((reason) => reason !== null);
243174
243402
  return {
243175
243403
  id: names[item.id],
243176
243404
  available: item.available,
@@ -243181,8 +243409,8 @@ function studioSummary(value) {
243181
243409
  });
243182
243410
  if (tools.length !== 4 || new Set(tools.map((tool) => tool.id)).size !== 4) throw invalid25();
243183
243411
  return {
243184
- balance: data2.balance,
243185
- checkoutAvailable: data2.checkoutAvailable,
243412
+ balance: data.balance,
243413
+ checkoutAvailable: data.checkoutAvailable,
243186
243414
  tools,
243187
243415
  notice: "Saldo y disponibilidad no garantizan que alcance para un encargo. Cotiza y respeta las preferencias y el presupuesto autorizado; las integraciones personales tienen saldo independiente."
243188
243416
  };
@@ -243443,7 +243671,7 @@ async function latestPublishedVersion(fetcher = fetch) {
243443
243671
  if (!response.ok) throw new Error("registry unavailable");
243444
243672
  const reader = response.body?.getReader();
243445
243673
  if (!reader) throw new Error("missing registry response");
243446
- let data2 = "";
243674
+ let data = "";
243447
243675
  let size = 0;
243448
243676
  try {
243449
243677
  while (true) {
@@ -243451,12 +243679,12 @@ async function latestPublishedVersion(fetcher = fetch) {
243451
243679
  if (chunk2.done) break;
243452
243680
  size += chunk2.value.length;
243453
243681
  if (size > 131072) throw new Error("registry response too large");
243454
- data2 += Buffer.from(chunk2.value).toString("utf8");
243682
+ data += Buffer.from(chunk2.value).toString("utf8");
243455
243683
  }
243456
243684
  } finally {
243457
243685
  await reader.cancel();
243458
243686
  }
243459
- const metadata = JSON.parse(data2);
243687
+ const metadata = JSON.parse(data);
243460
243688
  if (metadata.name !== "editorbrain" || !stableVersion(metadata.version)) throw new Error("invalid version");
243461
243689
  return metadata.version;
243462
243690
  } catch {
@@ -243639,7 +243867,7 @@ import { createHash as createHash28 } from "node:crypto";
243639
243867
  import { lstat as lstat29 } from "node:fs/promises";
243640
243868
  init_io();
243641
243869
  var skillRoots = { claude: ".claude/skills", codex: ".agents/skills", gemini: ".gemini/skills" };
243642
- var sha2564 = (text17) => createHash28("sha256").update(text17).digest("hex");
243870
+ var sha2564 = (text18) => createHash28("sha256").update(text18).digest("hex");
243643
243871
  async function listFormats(client) {
243644
243872
  return client.request("/v1/formats");
243645
243873
  }
@@ -243688,7 +243916,7 @@ import { createHash as createHash29 } from "node:crypto";
243688
243916
  import { lstat as lstat30 } from "node:fs/promises";
243689
243917
  init_io();
243690
243918
  var skillRoots2 = { claude: ".claude/skills", codex: ".agents/skills", gemini: ".gemini/skills" };
243691
- var sha2565 = (text17) => createHash29("sha256").update(text17).digest("hex");
243919
+ var sha2565 = (text18) => createHash29("sha256").update(text18).digest("hex");
243692
243920
  async function listViralAds(client) {
243693
243921
  return client.request("/v1/viral-ads");
243694
243922
  }
@@ -243739,7 +243967,7 @@ import { lstat as lstat31 } from "node:fs/promises";
243739
243967
  init_errors3();
243740
243968
  init_io();
243741
243969
  var skillRoots3 = { claude: ".claude/skills", codex: ".agents/skills", gemini: ".gemini/skills" };
243742
- var sha2566 = (text17) => createHash30("sha256").update(text17).digest("hex");
243970
+ var sha2566 = (text18) => createHash30("sha256").update(text18).digest("hex");
243743
243971
  function check2(id5, version3) {
243744
243972
  if (id5 !== void 0 && !isCourseFormatId(id5)) throw new CliError("INVALID_ARGUMENT", "Unknown course format ID.", "Run editorbrain courses list and use one of its ids.");
243745
243973
  if (version3 !== void 0 && !isCourseFormatVersion(version3)) throw new CliError("INVALID_ARGUMENT", "--version must be an exact catalog version such as 1.0.0.", "Omit --version for the current catalog.");
@@ -243829,9 +244057,9 @@ var status = (error62) => error62?.status;
243829
244057
  async function librarySheetRemote(client, path, options, fallback) {
243830
244058
  const query2 = new URLSearchParams();
243831
244059
  for (const [key, value] of Object.entries(options)) if (value !== void 0) query2.set(key, value);
243832
- const text17 = query2.toString();
244060
+ const text18 = query2.toString();
243833
244061
  try {
243834
- return await client.request(text17 ? `${path}?${text17}` : path);
244062
+ return await client.request(text18 ? `${path}?${text18}` : path);
243835
244063
  } catch (error62) {
243836
244064
  if (!fallback || status(error62) !== 404 || fallback.realNotFound?.test(JSON.stringify(error62.body ?? ""))) throw error62;
243837
244065
  if (fallback.list) {
@@ -244111,17 +244339,17 @@ async function projectIntakeCommand(client, command, argument, flags) {
244111
244339
  };
244112
244340
  const allowed = command === "create" ? ["brand", "style", "output-profile", "name", "topic", "goal", "url", "dir"] : ["project", "url", "dir"];
244113
244341
  for (const key of Object.keys(flags)) if (!allowed.includes(key)) fail6(`--${key} is not supported for projects ${command}.`);
244114
- const text17 = (key) => typeof flags[key] === "string" ? flags[key] : void 0;
244342
+ const text18 = (key) => typeof flags[key] === "string" ? flags[key] : void 0;
244115
244343
  let input2, defaults3;
244116
244344
  if (command === "create") {
244117
244345
  if (!argument) fail6("projects create needs the new project ID.");
244118
- defaults3 = await inferProjectDefaults(client, { brandId: text17("brand"), styleId: text17("style"), outputProfileId: text17("output-profile") });
244119
- const parsed = createProjectIntakeSchema.safeParse({ id: argument, brandId: defaults3.brandId, styleId: defaults3.styleId, outputProfileId: defaults3.outputProfileId, name: text17("name"), topic: text17("topic"), goal: text17("goal") });
244346
+ defaults3 = await inferProjectDefaults(client, { brandId: text18("brand"), styleId: text18("style"), outputProfileId: text18("output-profile") });
244347
+ const parsed = createProjectIntakeSchema.safeParse({ id: argument, brandId: defaults3.brandId, styleId: defaults3.styleId, outputProfileId: defaults3.outputProfileId, name: text18("name"), topic: text18("topic"), goal: text18("goal") });
244120
244348
  if (!parsed.success) fail6(parsed.error.issues.map((x) => `${x.path.join(".")}: ${x.message}`).join(";"));
244121
244349
  input2 = parsed.data;
244122
- } else if (command !== "intake" || argument || !text17("project")) fail6("projects intake requires --project ID and no positional ID.");
244123
- const project2 = command === "intake" ? assertIdentifier(text17("project")) : void 0;
244124
- const root = await ensureRoot(text17("dir") ?? process.cwd());
244350
+ } else if (command !== "intake" || argument || !text18("project")) fail6("projects intake requires --project ID and no positional ID.");
244351
+ const project2 = command === "intake" ? assertIdentifier(text18("project")) : void 0;
244352
+ const root = await ensureRoot(text18("dir") ?? process.cwd());
244125
244353
  if (command === "intake") {
244126
244354
  const me = await client.me();
244127
244355
  await loadSyncState(root, client.url, me.workspaceId);
@@ -244354,13 +244582,13 @@ function parseWhisperJson(value) {
244354
244582
  if (!Array.isArray(list3)) throw new Error("The local transcriber returned no transcription list.");
244355
244583
  const words2 = [];
244356
244584
  for (const item of list3) {
244357
- const text17 = typeof item?.text === "string" ? item.text : "", from = Number(item?.offsets?.from), to = Number(item?.offsets?.to);
244358
- if (!text17.trim() || !Number.isFinite(from) || !Number.isFinite(to)) continue;
244585
+ const text18 = typeof item?.text === "string" ? item.text : "", from = Number(item?.offsets?.from), to = Number(item?.offsets?.to);
244586
+ if (!text18.trim() || !Number.isFinite(from) || !Number.isFinite(to)) continue;
244359
244587
  const last = words2[words2.length - 1];
244360
- if (last && !/^\s/.test(text17)) {
244361
- last.text += text17;
244588
+ if (last && !/^\s/.test(text18)) {
244589
+ last.text += text18;
244362
244590
  last.end = to / 1e3;
244363
- } else words2.push({ text: text17.trim(), start: from / 1e3, end: Math.max(from, to) / 1e3 });
244591
+ } else words2.push({ text: text18.trim(), start: from / 1e3, end: Math.max(from, to) / 1e3 });
244364
244592
  }
244365
244593
  return words2.filter((w) => w.text.replace(/[^\p{L}\p{N}]/gu, ""));
244366
244594
  }
@@ -244417,7 +244645,7 @@ async function reviewFinalAudio(options) {
244417
244645
  const duration3 = probe2.durationSeconds;
244418
244646
  if (duration3 !== null && duration3 > MAX_ANALYSIS_SECONDS) throw new CliError("AUDIO_DURATION_LIMIT", "The final audio review handles up to 30 minutes.", "Check the piece in parts.");
244419
244647
  const samples = await decodeMono(probe2.path);
244420
- const expected = options.words !== void 0 ? heardWordsFrom(options.words) : options.script !== void 0 ? tokenizeScript(options.script).map((text17) => ({ text: text17 })) : null;
244648
+ const expected = options.words !== void 0 ? heardWordsFrom(options.words) : options.script !== void 0 ? tokenizeScript(options.script).map((text18) => ({ text: text18 })) : null;
244421
244649
  let heard = null, transcription = "not_requested", localTranscriber, complete = true;
244422
244650
  const findings = [];
244423
244651
  if (options.transcript !== void 0) {
@@ -244516,8 +244744,8 @@ async function decode3(file3, target) {
244516
244744
  await unlink15(target);
244517
244745
  return floats2(b);
244518
244746
  }
244519
- function wav(data2) {
244520
- const b = Buffer.alloc(44 + data2.length * 2);
244747
+ function wav(data) {
244748
+ const b = Buffer.alloc(44 + data.length * 2);
244521
244749
  b.write("RIFF");
244522
244750
  b.writeUInt32LE(b.length - 8, 4);
244523
244751
  b.write("WAVEfmt ", 8);
@@ -244529,8 +244757,8 @@ function wav(data2) {
244529
244757
  b.writeUInt16LE(4, 32);
244530
244758
  b.writeUInt16LE(16, 34);
244531
244759
  b.write("data", 36);
244532
- b.writeUInt32LE(data2.length * 2, 40);
244533
- for (let i = 0; i < data2.length; i++) b.writeInt16LE(Math.round(Math.max(-1, Math.min(32767 / 32768, data2[i])) * 32768), 44 + i * 2);
244760
+ b.writeUInt32LE(data.length * 2, 40);
244761
+ for (let i = 0; i < data.length; i++) b.writeInt16LE(Math.round(Math.max(-1, Math.min(32767 / 32768, data[i])) * 32768), 44 + i * 2);
244534
244762
  return b;
244535
244763
  }
244536
244764
  async function mixEvents(options) {
@@ -245221,16 +245449,16 @@ async function motionPass(file3, probe2, directory, th = QUALITY_THRESHOLDS) {
245221
245449
  const fineOn = v.duration <= 180, W = fineOn ? GRAY_W * 2 : GRAY_W;
245222
245450
  const gh = Math.max(2, Math.round(GRAY_W * v.height / v.width / 2) * 2), H = fineOn ? gh * 2 : gh, size = GRAY_W * gh, big = W * H, raw = join24(directory, "motion.gray");
245223
245451
  await runMediaTool("ffmpeg", ["-v", "error", "-nostats", "-n", ...localInputArgs(file3), "-filter_complex", `[0:${v.index}]fps=fps=${fps}:start_time=0,scale=${W}:${H},format=gray[g]`, "-map", "[g]", "-an", "-f", "rawvideo", raw], { timeoutMs: 6e5, maxOutputBytes: 1024 * 1024 });
245224
- const data2 = await readFile16(raw);
245452
+ const data = await readFile16(raw);
245225
245453
  await unlink16(raw);
245226
- const n2 = Math.floor(data2.length / big), small = new Uint8Array(n2 * size);
245454
+ const n2 = Math.floor(data.length / big), small = new Uint8Array(n2 * size);
245227
245455
  for (let i = 0; i < n2; i++) for (let y = 0; y < gh; y++) for (let x = 0; x < GRAY_W; x++) {
245228
245456
  if (!fineOn) {
245229
- small[i * size + y * GRAY_W + x] = data2[i * big + y * W + x];
245457
+ small[i * size + y * GRAY_W + x] = data[i * big + y * W + x];
245230
245458
  continue;
245231
245459
  }
245232
245460
  const o = i * big + 2 * y * W + 2 * x;
245233
- small[i * size + y * GRAY_W + x] = data2[o] + data2[o + 1] + data2[o + W] + data2[o + W + 1] + 2 >> 2;
245461
+ small[i * size + y * GRAY_W + x] = data[o] + data[o + 1] + data[o + W] + data[o + W + 1] + 2 >> 2;
245234
245462
  }
245235
245463
  const samples = [];
245236
245464
  for (let i = 1; i < n2; i++) {
@@ -245241,7 +245469,7 @@ async function motionPass(file3, probe2, directory, th = QUALITY_THRESHOLDS) {
245241
245469
  if (d2 > th.pixelDelta) changed2++;
245242
245470
  }
245243
245471
  if (fineOn) {
245244
- for (let k = 0; k < big; k++) if (Math.abs(data2[i * big + k] - data2[(i - 1) * big + k]) > 40) fine++;
245472
+ for (let k = 0; k < big; k++) if (Math.abs(data[i * big + k] - data[(i - 1) * big + k]) > 40) fine++;
245245
245473
  }
245246
245474
  const { flat, edges } = frameContent(small.subarray(i * size, (i + 1) * size), GRAY_W, gh);
245247
245475
  samples.push({ time: i / fps, changed: changed2 / size, mean: sum / size, ...fineOn ? { fine: fine / big } : {}, flat, edges });
@@ -245266,10 +245494,10 @@ async function grab(file3, probe2, directory, tag, select, seek, ocrEvery, cw, c
245266
245494
  const graph = ocrEvery ? `[0:${v.index}]select='${select}',showinfo,split=2[a][b];[a]scale=${cw}:${ch},format=rgb24[c];[b]select='not(mod(n\\,${ocrEvery}))',scale=-2:'min(1920,ih)'[o]` : `[0:${v.index}]select='${select}',showinfo,scale=${cw}:${ch},format=rgb24[c]`;
245267
245495
  if (ocrEvery) await mkdir23(ocrDir, { recursive: true });
245268
245496
  const out = await runMediaTool("ffmpeg", [...args, "-filter_complex", graph, "-map", "[c]", "-an", "-fps_mode", "passthrough", "-f", "rawvideo", cells, ...ocrEvery ? ["-map", "[o]", "-an", "-fps_mode", "passthrough", join24(ocrDir, "f-%05d.png")] : []], { timeoutMs: 6e5, maxOutputBytes: 16 * 1024 * 1024 });
245269
- const times = showinfoTimes(out.stderr), data2 = await readFile16(cells);
245497
+ const times = showinfoTimes(out.stderr), data = await readFile16(cells);
245270
245498
  await unlink16(cells);
245271
- const size = cw * ch * 3, n2 = Math.min(times.length, Math.floor(data2.length / size));
245272
- const grabs = Array.from({ length: n2 }, (_, i) => ({ time: times[i], rgb: new Uint8Array(data2.subarray(i * size, (i + 1) * size)) }));
245499
+ const size = cw * ch * 3, n2 = Math.min(times.length, Math.floor(data.length / size));
245500
+ const grabs = Array.from({ length: n2 }, (_, i) => ({ time: times[i], rgb: new Uint8Array(data.subarray(i * size, (i + 1) * size)) }));
245273
245501
  if (ocrEvery) {
245274
245502
  const pngs = (await readdir16(ocrDir)).filter((f) => /^f-\d+\.png$/.test(f)).sort();
245275
245503
  pngs.forEach((p, j) => {
@@ -245353,7 +245581,7 @@ async function runQualityCheck(o) {
245353
245581
  groups3.push({ kind: w.kind, label: w.label, start: w.start, end: w.end, grabs: await grab(o.file, o.probe, work, `dense-${i}`, sel, Math.max(0, w.start - 2), ocrOn ? ocrEvery : null, cw, ch) });
245354
245582
  }
245355
245583
  const momentsByGrab = /* @__PURE__ */ new Map();
245356
- const text17 = [];
245584
+ const text18 = [];
245357
245585
  let ocrCalls = 0;
245358
245586
  const rawMoments = [];
245359
245587
  for (const g of groups3) for (const grabbed of g.grabs) {
@@ -245362,10 +245590,10 @@ async function runQualityCheck(o) {
245362
245590
  const raw = await ocrPng(grabbed.ocrPng, g.label, round5(grabbed.time, 3), language);
245363
245591
  const m = measureMoment(raw, o.platform, th);
245364
245592
  momentsByGrab.set(grabbed, m);
245365
- text17.push(m);
245593
+ text18.push(m);
245366
245594
  rawMoments.push(raw);
245367
245595
  }
245368
- const ocrState = o.ocr === false ? "disabled" : !ocrOn ? "unavailable" : text17.every((t) => t.status === "complete") ? "complete" : "partial";
245596
+ const ocrState = o.ocr === false ? "disabled" : !ocrOn ? "unavailable" : text18.every((t) => t.status === "complete") ? "complete" : "partial";
245369
245597
  const sheets = [];
245370
245598
  const chunks = [];
245371
245599
  const per = columns * 4;
@@ -245379,8 +245607,8 @@ async function runQualityCheck(o) {
245379
245607
  const hit = sheets.filter((s) => s.end >= start4 - 0.5 && s.start <= end4 + 0.5);
245380
245608
  return [...hit.filter((s) => s.kind !== "overview").slice(0, 3), ...hit.filter((s) => s.kind === "overview").slice(0, 1)].map((s) => s.path);
245381
245609
  };
245382
- const findings = qualityFindings({ duration: v.duration, motion: motion2, text: text17, ocr: ocrState, lastWordEnd: o.lastWordEnd ?? null, holds: o.holds ?? [], platform: o.platform, waivers: o.waivers, firstFrameFlat: mp.firstFrameFlat, audio, sheetsFor, firstVideo: o.firstVideo }, th);
245383
- await writeFile5(join24(o.directory, "measurements.json"), JSON.stringify({ schemaVersion: 1, duration: v.duration, fps: v.fps, width: v.width, height: v.height, motion: motion2, audio, firstFrameFlat: mp.firstFrameFlat, platform: o.platform ?? null, text: text17, rawMoments, samples: mp.samples.map((x) => [round5(x.time, 3), round5(x.changed, 5), round5(x.mean, 3), round5(x.fine ?? 0, 6), x.flat ?? null, x.edges ?? null]) }), { flag: "wx", mode: 384 });
245610
+ const findings = qualityFindings({ duration: v.duration, motion: motion2, text: text18, ocr: ocrState, lastWordEnd: o.lastWordEnd ?? null, holds: o.holds ?? [], platform: o.platform, waivers: o.waivers, firstFrameFlat: mp.firstFrameFlat, audio, sheetsFor, firstVideo: o.firstVideo }, th);
245611
+ await writeFile5(join24(o.directory, "measurements.json"), JSON.stringify({ schemaVersion: 1, duration: v.duration, fps: v.fps, width: v.width, height: v.height, motion: motion2, audio, firstFrameFlat: mp.firstFrameFlat, platform: o.platform ?? null, text: text18, rawMoments, samples: mp.samples.map((x) => [round5(x.time, 3), round5(x.changed, 5), round5(x.mean, 3), round5(x.fine ?? 0, 6), x.flat ?? null, x.edges ?? null]) }), { flag: "wx", mode: 384 });
245384
245612
  const frameDur = 1 / v.fps;
245385
245613
  for (const { sheet, grabs } of chunks) {
245386
245614
  const cells = grabs.map((g) => {
@@ -245404,7 +245632,7 @@ async function runQualityCheck(o) {
245404
245632
  const title = `${sheet.label} ${sheet.start.toFixed(2)}-${sheet.end.toFixed(2)}S ${cells.length} FRAMES${flagged ? ` - ${flagged} MUST-FIX` : ""}`;
245405
245633
  await writeFile5(sheet.path, renderSheet(title, cells, columns), { flag: "wx", mode: 384 });
245406
245634
  }
245407
- const mains = text17.map((t) => t.mainPct).filter((x) => x !== null), smalls = text17.map((t) => t.smallestPct).filter((x) => x !== null);
245635
+ const mains = text18.map((t) => t.mainPct).filter((x) => x !== null), smalls = text18.map((t) => t.smallestPct).filter((x) => x !== null);
245408
245636
  const report = {
245409
245637
  schemaVersion: 1,
245410
245638
  kind: "editorbrain.quality-check",
@@ -245422,10 +245650,10 @@ async function runQualityCheck(o) {
245422
245650
  text: {
245423
245651
  ocr: ocrState,
245424
245652
  engine: ocrVersion ? `tesseract ${ocrVersion} (${language})` : null,
245425
- moments: text17.length,
245653
+ moments: text18.length,
245426
245654
  mainPct: mains.length ? [round5(Math.min(...mains) * 100, 1), round5(Math.max(...mains) * 100, 1)] : null,
245427
245655
  smallestPct: smalls.length ? round5(Math.min(...smalls) * 100, 1) : null,
245428
- perMoment: text17.map((t) => ({ time: t.time, window: t.window, status: t.status, mainPct: t.mainPct === null ? null : round5(t.mainPct * 100, 1), smallestPct: t.smallestPct === null ? null : round5(t.smallestPct * 100, 1), lines: t.lines.length, unreadable: t.unreadable }))
245656
+ perMoment: text18.map((t) => ({ time: t.time, window: t.window, status: t.status, mainPct: t.mainPct === null ? null : round5(t.mainPct * 100, 1), smallestPct: t.smallestPct === null ? null : round5(t.smallestPct * 100, 1), lines: t.lines.length, unreadable: t.unreadable }))
245429
245657
  },
245430
245658
  thresholds: th,
245431
245659
  waivers: o.waivers ?? [],
@@ -245439,7 +245667,7 @@ async function runQualityCheck(o) {
245439
245667
  "No aesthetic judgement: compare with the style demo (production compare) and watch the video."
245440
245668
  ]
245441
245669
  };
245442
- return { report, text: text17 };
245670
+ return { report, text: text18 };
245443
245671
  } finally {
245444
245672
  await rm12(work, { recursive: true, force: true });
245445
245673
  }
@@ -245458,15 +245686,15 @@ async function compareVideos(o) {
245458
245686
  const times = [...fractions.map((f) => Math.min(v.duration - 1.5 / v.fps, f * v.duration)), Math.min(0.5, v.duration / 2), Math.min(1.5, v.duration / 2), Math.max(0, v.duration - 1)];
245459
245687
  const { cw, ch } = cellSize(v.width, v.height), cell = { cw: Math.round(cw * 0.9 / 2) * 2, ch: Math.round(ch * 0.9 / 2) * 2 };
245460
245688
  const grabs = /* @__PURE__ */ new Map();
245461
- const text17 = [];
245689
+ const text18 = [];
245462
245690
  for (const [i, t] of times.entries()) {
245463
245691
  const half = 0.5 / v.fps;
245464
245692
  const g = (await grab(file3, probe2, work, `${name}-${i}`, `between(t\\,${(t - half).toFixed(4)}\\,${(t + half).toFixed(4)})`, Math.max(0, t - 2), ocrVersion ? 1 : null, cell.cw, cell.ch))[0];
245465
245693
  if (!g) continue;
245466
245694
  grabs.set(labels2[i], g);
245467
- if (g.ocrPng && i < fractions.length) text17.push(measureMoment(await ocrPng(g.ocrPng, name, round5(g.time, 3), o.ocrLanguage ?? "eng"), void 0));
245695
+ if (g.ocrPng && i < fractions.length) text18.push(measureMoment(await ocrPng(g.ocrPng, name, round5(g.time, 3), o.ocrLanguage ?? "eng"), void 0));
245468
245696
  }
245469
- sides.push({ name, file: file3, probe: probe2, v, motion: motion2, text: text17, loud: await integratedLoudness(file3, probe2), grabs });
245697
+ sides.push({ name, file: file3, probe: probe2, v, motion: motion2, text: text18, loud: await integratedLoudness(file3, probe2), grabs });
245470
245698
  }
245471
245699
  const [out, ref] = sides;
245472
245700
  const table = { output: compareSide(out.v.duration, out.motion, out.text, out.loud), reference: compareSide(ref.v.duration, ref.motion, ref.text, ref.loud) };
@@ -245549,18 +245777,18 @@ async function createProductionSheet(options) {
245549
245777
  await mkdir24(directory, { mode: 448 });
245550
245778
  const raw = join25(directory, "samples.gray");
245551
245779
  const result2 = await runMediaTool("ffmpeg", ["-v", "info", "-nostats", "-n", "-copyts", "-start_at_zero", ...localInputArgs(source2.path), "-filter_complex", `[0:${video[0].index}]split=2[a][b];[a]freezedetect=n=0.003:d=1,fps=fps=1:start_time=0:round=up,scale=240:240:force_original_aspect_ratio=decrease,setsar=1[thumb];[b]fps=fps=1:start_time=0:round=up,scale=96:96,format=gray[gray]`, "-map", "[thumb]", "-an", "-fps_mode", "passthrough", "-q:v", "3", join25(directory, "frame-%05d.jpg"), "-map", "[gray]", "-an", "-f", "rawvideo", raw], { timeoutMs: 6e5, maxOutputBytes: 8 * 1024 * 1024 });
245552
- const data2 = await readFile17(raw);
245780
+ const data = await readFile17(raw);
245553
245781
  await unlink17(raw);
245554
- const count3 = data2.length / (96 * 96);
245782
+ const count3 = data.length / (96 * 96);
245555
245783
  if (!Number.isInteger(count3) || count3 < 1 || count3 > 3601 || count3 < Math.ceil(duration3 - 1e-6)) throw new Error("Incomplete frame sampling; no complete review was accepted.");
245556
245784
  if ((await probeLocalMedia(source2.path)).sha256 !== source2.sha256) throw new Error("Source changed during review.");
245557
245785
  const freezes = freezeIntervals(result2.stderr, duration3).flatMap((i) => unplannedIntervals(i.start, i.end, input2.holds ?? []));
245558
- const flat = Array.from({ length: count3 }, (_, i) => ({ time: i, flatFraction: frameFlatness(data2.subarray(i * 9216, (i + 1) * 9216)) })).filter((x) => x.flatFraction > 0.985);
245786
+ const flat = Array.from({ length: count3 }, (_, i) => ({ time: i, flatFraction: frameFlatness(data.subarray(i * 9216, (i + 1) * 9216)) })).filter((x) => x.flatFraction > 0.985);
245559
245787
  const geometry = (input2.geometry ?? []).map((g) => ({ time: g.time, ...reviewSocialGeometry(video[0].width, video[0].height, g.boxes, platform) }));
245560
245788
  const quality = (await runQualityCheck({ file: source2.path, probe: source2, directory: join25(directory, "quality"), platform, holds: input2.holds ?? [], waivers: options.waivers === void 0 ? [] : validateQualityWaivers(options.waivers, duration3), dense: parseDenseKinds(options.dense, duration3), windows: options.windows, lastWordEnd: options.words === void 0 ? null : lastWordEndSeconds(options.words, duration3), ocr: options.ocr, ocrLanguage: options.ocrLanguage, firstVideo: options.firstVideo })).report;
245561
245789
  const { shown, more } = readerFindings(quality.findings);
245562
245790
  if ((await probeLocalMedia(source2.path)).sha256 !== source2.sha256) throw new Error("Source changed during review.");
245563
- const report = { schemaVersion: 1, kind: "editorbrain.production-sheet", artifact: source2, complete: true, platform: platform ?? null, safeProfile: platform ? `${platform}-conservative-v1` : null, sampling: { fps: 1, frames: count3, timestampBasis: "resampled_output_clock", durationSeconds: duration3, fullRateFreezeDetection: true }, holds: input2.holds ?? [], candidates: { freezes, nearlyEmpty: flat, geometry: geometry.filter((g) => g.candidates.length) }, geometryStatus: input2.geometry?.length ? "declared_boxes_only" : "not_checked_no_boxes", ocr: "see_quality_text", logosDetected: false, matte: options.matte ? { coverage: "sampled_pixels_only", lowForegroundCandidates: flat.filter((x) => data2.subarray(x.time * 9216, (x.time + 1) * 9216).every((v) => v < 8)), silhouetteQuality: "not_assessed" } : null, limitations: ["Flat frames and freezes are candidates, not editorial defects.", "1 fps cannot detect every transient or motion; watch full playback and sensitive intervals.", "Text/logo safety and edge clipping require supplied rendered ink bounds; unknown geometry is not a pass.", "Platform guides approximate UI risk, not official device-specific guarantees."], creativeQuality: "not_assessed", mediaUploaded: false, modelCalls: 0, quality };
245791
+ const report = { schemaVersion: 1, kind: "editorbrain.production-sheet", artifact: source2, complete: true, platform: platform ?? null, safeProfile: platform ? `${platform}-conservative-v1` : null, sampling: { fps: 1, frames: count3, timestampBasis: "resampled_output_clock", durationSeconds: duration3, fullRateFreezeDetection: true }, holds: input2.holds ?? [], candidates: { freezes, nearlyEmpty: flat, geometry: geometry.filter((g) => g.candidates.length) }, geometryStatus: input2.geometry?.length ? "declared_boxes_only" : "not_checked_no_boxes", ocr: "see_quality_text", logosDetected: false, matte: options.matte ? { coverage: "sampled_pixels_only", lowForegroundCandidates: flat.filter((x) => data.subarray(x.time * 9216, (x.time + 1) * 9216).every((v) => v < 8)), silhouetteQuality: "not_assessed" } : null, limitations: ["Flat frames and freezes are candidates, not editorial defects.", "1 fps cannot detect every transient or motion; watch full playback and sensitive intervals.", "Text/logo safety and edge clipping require supplied rendered ink bounds; unknown geometry is not a pass.", "Platform guides approximate UI risk, not official device-specific guarantees."], creativeQuality: "not_assessed", mediaUploaded: false, modelCalls: 0, quality };
245564
245792
  const p = platform ? SOCIAL_SAFE_PROFILES[platform] : null;
245565
245793
  const cards = Array.from({ length: count3 }, (_, i) => {
245566
245794
  const warnings = [...flat.some((f) => f.time === i) ? ["Posible cuadro vac\xEDo"] : [], ...freezes.some((f) => i >= f.start && i < f.end) ? ["Sin cambio >1 s"] : [], ...geometry.filter((g) => Math.floor(g.time) === i).flatMap((g) => g.candidates.map((c) => c.kind + ": " + c.boxIds.join(", ")))];
@@ -245683,8 +245911,8 @@ async function listMemory(client, flags) {
245683
245911
  const result2 = await client.request("/v1/memory?" + new URLSearchParams(target));
245684
245912
  let memory = result2.memory;
245685
245913
  if (!memory) {
245686
- const data2 = JSON.parse(result2.content ?? "{}");
245687
- memory = { schemaVersion: data2.schemaVersion, scope: data2.scope ?? target.scope, scopeId: data2.scopeId ?? target.scopeId, entries: [...data2.entries ?? [], ...data2.scopedEntries ?? []] };
245914
+ const data = JSON.parse(result2.content ?? "{}");
245915
+ memory = { schemaVersion: data.schemaVersion, scope: data.scope ?? target.scope, scopeId: data.scopeId ?? target.scopeId, entries: [...data.entries ?? [], ...data.scopedEntries ?? []] };
245688
245916
  }
245689
245917
  return {
245690
245918
  path: result2.path,
@@ -246545,15 +246773,15 @@ async function setupDirectory(directory, projectId) {
246545
246773
  var runHost = (command, args, cwd, interactive = false) => new Promise((done, reject) => {
246546
246774
  const child = spawn7(command, args, { cwd, shell: false, stdio: ["ignore", interactive ? 2 : "pipe", interactive ? 2 : "pipe"], windowsHide: !interactive });
246547
246775
  let stdout = "", stderr = "", size = 0;
246548
- const collect = (kind3, data2) => {
246549
- size += data2.length;
246776
+ const collect = (kind3, data) => {
246777
+ size += data.length;
246550
246778
  if (size > 1024 * 1024) {
246551
246779
  child.kill();
246552
246780
  reject(new CliError("HOST_OUTPUT_LIMIT", "Agent CLI returned too much output.", "Configure MCP using the documented manual command."));
246553
246781
  return;
246554
246782
  }
246555
- if (kind3 === "stdout") stdout += data2;
246556
- else stderr += data2;
246783
+ if (kind3 === "stdout") stdout += data;
246784
+ else stderr += data;
246557
246785
  };
246558
246786
  child.stdout?.on("data", (chunk2) => collect("stdout", chunk2));
246559
246787
  child.stderr?.on("data", (chunk2) => collect("stderr", chunk2));
@@ -246881,10 +247109,10 @@ function tokenWarnings(intakeTokens, snapshot2) {
246881
247109
  } catch {
246882
247110
  }
246883
247111
  const all = { ...saved, ...intakeTokens };
246884
- const bg = hexValue(all["color.background"]) ?? hexValue(all["color.bg"]) ?? hexValue(all["color.paper"]), text17 = hexValue(all["color.text"]) ?? hexValue(all["color.ink"]);
246885
- if (!bg || !text17) return [];
246886
- const [a, b] = [luminance2(bg), luminance2(text17)], ratio = (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);
246887
- return ratio < 3 ? [`color.text (${text17}) has almost no contrast against color.background (${bg}): text in that brand would be unreadable. Ask the person which color is the text and which the background before saving.`] : [];
247112
+ const bg = hexValue(all["color.background"]) ?? hexValue(all["color.bg"]) ?? hexValue(all["color.paper"]), text18 = hexValue(all["color.text"]) ?? hexValue(all["color.ink"]);
247113
+ if (!bg || !text18) return [];
247114
+ const [a, b] = [luminance2(bg), luminance2(text18)], ratio = (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);
247115
+ return ratio < 3 ? [`color.text (${text18}) has almost no contrast against color.background (${bg}): text in that brand would be unreadable. Ask the person which color is the text and which the background before saving.`] : [];
246888
247116
  }
246889
247117
  var plural3 = (count3) => `${count3} ${count3 === 1 ? "marca" : "marcas"}`;
246890
247118
  function brandLimitError(error62, brandId2) {
@@ -247083,12 +247311,12 @@ function chooseStyles(listing, filters = {}) {
247083
247311
  const matches2 = purpose ? [...fitting.filter((style) => style.purpose.includes(purpose)), ...fitting.filter((style) => !style.purpose.includes(purpose))] : fitting;
247084
247312
  const styles = matches2.slice(0, limit).map((style) => {
247085
247313
  const en = lang === "en" ? styleEnglish(style.id) : void 0;
247086
- const text17 = en && en.needs.length === (style.needs ?? []).length ? en : { name: style.name, summary: style.summary, needs: style.needs ?? [] };
247314
+ const text18 = en && en.needs.length === (style.needs ?? []).length ? en : { name: style.name, summary: style.summary, needs: style.needs ?? [] };
247087
247315
  return {
247088
247316
  id: style.id,
247089
- name: text17.name,
247090
- summary: text17.summary,
247091
- needs: text17.needs,
247317
+ name: text18.name,
247318
+ summary: text18.summary,
247319
+ needs: text18.needs,
247092
247320
  material: style.material,
247093
247321
  ...style.onlyClip !== void 0 ? { onlyClip: style.onlyClip } : {},
247094
247322
  purpose: style.purpose,
@@ -247183,13 +247411,13 @@ function renderOnboardingArtifact({ intake, submission, requiresIdentity = false
247183
247411
  }
247184
247412
  }).map((example) => ({ ratio: example.ratio, url: example.url })) }));
247185
247413
  const validatedIntake = validateOnboardingIntake(intake);
247186
- const data2 = { creatorContextOptions, requiresIdentity, restoredDraft, demos: onboardingDemoExamples, hooks: onboardingHookOptions, hookIntensities: onboardingHookIntensityOptions, reviewModes: onboardingReviewOptions, integrations: integrationCatalogFor(validatedIntake.accountSetup?.integrations ?? []), intake: validatedIntake, submission: submission || null, options: profileOptions, styles, questionModes: questionModeOptions, creativeDirections: creativeDirectionOptions, creativeSections: creativePreferenceSections, steps: localOnboardingSteps };
247414
+ const data = { creatorContextOptions, requiresIdentity, restoredDraft, demos: onboardingDemoExamples, hooks: onboardingHookOptions, hookIntensities: onboardingHookIntensityOptions, reviewModes: onboardingReviewOptions, integrations: integrationCatalogFor(validatedIntake.accountSetup?.integrations ?? []), intake: validatedIntake, submission: submission || null, options: profileOptions, styles, questionModes: questionModeOptions, creativeDirections: creativeDirectionOptions, creativeSections: creativePreferenceSections, steps: localOnboardingSteps };
247187
247415
  return `<!doctype html>
247188
247416
  <html lang="es"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="referrer" content="no-referrer"><title>Tu cerebro editorial \xB7 EditorBrain</title><style>${artifactCss}</style></head>
247189
247417
  <body data-theme="light"><div class="app"><header class="top"><a href="#main" class="product-label" aria-label="EditorBrain, ir a tus preferencias">${onboardingWordmark}</a><div class="top-actions"><span class="local-badge">Preferencias locales</span><button type="button" id="theme-toggle" class="theme-toggle" aria-label="Cambiar a modo oscuro" title="Cambiar a modo oscuro"><svg class="moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M20.9 13a9 9 0 0 1-9.9-9.9A9 9 0 1 0 20.9 13Z"/></svg><svg class="sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2m0 16v2M2 12h2m16 0h2M5 5l1.5 1.5m11 11L19 19M5 19l1.5-1.5m11-11L19 5"/></svg></button></div></header>
247190
247418
  <nav id="steps" aria-label="Pasos de tus preferencias"></nav><div class="layout"><main id="main" tabindex="-1"><div class="page-top"><span id="step-count" class="eyebrow"></span><div class="draft-actions"><button type="button" id="save-draft" class="text-button">Guardar borrador</button><button type="button" id="import-draft" class="text-button" hidden>Importar borrador</button><input type="file" id="draft-file" accept="application/json,.json" hidden><button type="button" id="download-top" class="text-button">Descargar respuestas</button></div></div><h1 id="page-title" tabindex="-1"></h1><p id="page-description" class="intro"></p><p id="draft-help" class="small"></p><form id="preferences" novalidate><div id="panel"></div></form><div id="error" class="notice error" role="alert" hidden></div><div id="status" class="notice" role="status" hidden></div><footer class="actions"><button type="button" id="previous" class="button secondary">\u2190 Atr\xE1s</button><span id="save-hint">Puedes cambiar tus preferencias despu\xE9s.</span><button type="button" id="next" class="button primary">Continuar \u2192</button></footer></main></div><footer class="bottom">EditorBrain \xB7 Tu criterio, en cada edici\xF3n.<span>Preferencias locales. No conecta servicios ni activa compras.</span></footer></div>
247191
247419
  <dialog id="style-dialog" aria-labelledby="dialog-title"><div class="dialog-head"><div><span class="eyebrow">REFERENCIA DE APARIENCIA</span><h2 id="dialog-title"></h2></div><button type="button" id="close-dialog" class="button secondary">Cerrar</button></div><p id="dialog-description"></p><div id="dialog-examples"></div><p class="small">Ejemplos generados con IA. Orientan el tratamiento visual; no sustituyen tu marca ni acreditan hechos reales.</p></dialog>
247192
- <script id="onboarding-data" type="application/json">${safeJson(data2)}</script><script>${artifactScript}</script></body></html>`;
247420
+ <script id="onboarding-data" type="application/json">${safeJson(data)}</script><script>${artifactScript}</script></body></html>`;
247193
247421
  }
247194
247422
  var artifactCss = String.raw`
247195
247423
  :root{color-scheme:light;--paper:#fafafa;--surface:#ffffff;--surface-2:#f3f3f2;--surface-soft:#f5f0e8;--ink:#1b1b19;--muted:#575651;--line:#d9d8d5;--line-subtle:#eae9e6;--select:#f1e4cf;--select-border:#72706b;--select-ink:#141312;--select-muted:#4f4943;--focus:#4f4943;--accent:#93460c;--action:#e89a4a;--action-hover:#f0ad6a;--action-ink:#141312;--success:#28633a;--success-bg:#e8f4eb;--danger:#b53725;--danger-bg:#fff0ed;--overlay:#0005;--brand-bg:#f1e8d8;--brand-text:#282621;--brand-accent:#aa765d}
@@ -248563,10 +248791,10 @@ async function redeemSetupCode(options, fetcher = fetch) {
248563
248791
 
248564
248792
  // packages/cli/src/index.ts
248565
248793
  init_src();
248566
- import { chmod as chmod8, lstat as lstat44, mkdir as mkdir39, open as open31, readFile as readFile30 } from "node:fs/promises";
248794
+ import { chmod as chmod8, lstat as lstat44, mkdir as mkdir40, open as open31, readFile as readFile30 } from "node:fs/promises";
248567
248795
  import { constants as constants26 } from "node:fs";
248568
248796
  import { homedir as homedir11 } from "node:os";
248569
- import { basename as basename14, dirname as dirname37, extname as extname22, join as join42, resolve as resolve34 } from "node:path";
248797
+ import { basename as basename14, dirname as dirname38, extname as extname22, join as join43, resolve as resolve34 } from "node:path";
248570
248798
  init_errors3();
248571
248799
 
248572
248800
  // packages/cli/src/workspace-context.ts
@@ -248641,11 +248869,11 @@ var record17 = (value) => value !== null && typeof value === "object" && !Array.
248641
248869
  var array3 = (value) => Array.isArray(value) ? value : [];
248642
248870
  function plain(value, max = 2e3) {
248643
248871
  if (typeof value !== "string" || value.length > 16e3) return null;
248644
- const text17 = value.replace(/<[^>]*>/g, " ").replace(/&#(x[0-9a-f]+|[0-9]+);/gi, (_, number6) => {
248872
+ const text18 = value.replace(/<[^>]*>/g, " ").replace(/&#(x[0-9a-f]+|[0-9]+);/gi, (_, number6) => {
248645
248873
  const code = number6[0].toLowerCase() === "x" ? parseInt(number6.slice(1), 16) : Number(number6);
248646
248874
  return code > 0 && code <= 1114111 ? String.fromCodePoint(code) : "";
248647
248875
  }).replace(/&(amp|quot|apos|lt|gt|nbsp);/g, (_, entity) => ({ amp: "&", quot: '"', apos: "'", lt: "<", gt: ">", nbsp: " " })[entity]).replace(/[\u0000-\u001f\u007f-\u009f\u202a-\u202e\u2066-\u2069]/g, " ").replace(/\s+/g, " ").trim();
248648
- return text17 ? text17.slice(0, max) : null;
248876
+ return text18 ? text18.slice(0, max) : null;
248649
248877
  }
248650
248878
  function texts3(value) {
248651
248879
  return (Array.isArray(value) ? value.slice(0, 8) : [value]).map((item) => plain(item)).filter((item) => item !== null);
@@ -248757,9 +248985,9 @@ var JsonClient = class {
248757
248985
  if (length > this.responseCap || this.bytes > this.totalCap) throw failure3("MEDIA_SOURCE_RESPONSE_TOO_LARGE", "The provider response exceeds the metadata byte limit.");
248758
248986
  chunks.push(part.value);
248759
248987
  }
248760
- const data2 = JSON.parse(Buffer.concat(chunks).toString("utf8"));
248761
- if (!data2 || typeof data2 !== "object" || Array.isArray(data2)) throw new Error("shape");
248762
- return data2;
248988
+ const data = JSON.parse(Buffer.concat(chunks).toString("utf8"));
248989
+ if (!data || typeof data !== "object" || Array.isArray(data)) throw new Error("shape");
248990
+ return data;
248763
248991
  } catch (error62) {
248764
248992
  void reader.cancel().catch(() => {
248765
248993
  });
@@ -248815,9 +249043,9 @@ async function searchProvider(provider, query2, limit, client, report) {
248815
249043
  const retrieved = report.generatedAt;
248816
249044
  if (provider === "wikimedia") {
248817
249045
  const url3 = endpoint("https://commons.wikimedia.org/w/api.php", { action: "query", format: "json", formatversion: "2", generator: "search", gsrsearch: query2, gsrnamespace: "6", gsrlimit: String(limit), prop: "imageinfo", iiprop: "url|timestamp|extmetadata", iiurlwidth: "640" });
248818
- const data2 = await client.get(url3);
248819
- if (data2.error) throw failure3("MEDIA_SOURCE_PROVIDER_ERROR", "Wikimedia rejected the public metadata query.");
248820
- const pages = data2.batchcomplete !== void 0 && data2.query === void 0 ? [] : requiredList(record17(data2.query).pages);
249046
+ const data = await client.get(url3);
249047
+ if (data.error) throw failure3("MEDIA_SOURCE_PROVIDER_ERROR", "Wikimedia rejected the public metadata query.");
249048
+ const pages = data.batchcomplete !== void 0 && data.query === void 0 ? [] : requiredList(record17(data.query).pages);
248821
249049
  for (const value of pages.slice(0, limit)) {
248822
249050
  const page2 = record17(value), info = record17(array3(page2.imageinfo)[0]), ext = record17(info.extmetadata);
248823
249051
  const meta3 = (key) => record17(ext[key]).value;
@@ -248836,8 +249064,8 @@ async function searchProvider(provider, query2, limit, client, report) {
248836
249064
  }
248837
249065
  } else if (provider === "nasa") {
248838
249066
  const url3 = endpoint("https://images-api.nasa.gov/search", { q: query2, media_type: "image", page: "1", page_size: String(limit) });
248839
- const data2 = await client.get(url3);
248840
- for (const value of requiredList(record17(data2.collection).items).slice(0, limit)) {
249067
+ const data = await client.get(url3);
249068
+ for (const value of requiredList(record17(data.collection).items).slice(0, limit)) {
248841
249069
  const entry2 = record17(value), metadata = record17(array3(entry2.data)[0]), id5 = identifier14(metadata.nasa_id);
248842
249070
  const item = result(provider, id5, metadata.title, id5 ? `https://images.nasa.gov/details/${encodeURIComponent(id5)}` : null, url3.href, retrieved);
248843
249071
  if (item) {
@@ -248850,8 +249078,8 @@ async function searchProvider(provider, query2, limit, client, report) {
248850
249078
  }
248851
249079
  } else if (provider === "loc") {
248852
249080
  const url3 = endpoint("https://www.loc.gov/photos/", { q: query2, fo: "json", c: String(limit), at: "results,pagination" });
248853
- const data2 = await client.get(url3);
248854
- for (const value of requiredList(data2.results).slice(0, limit)) {
249081
+ const data = await client.get(url3);
249082
+ for (const value of requiredList(data.results).slice(0, limit)) {
248855
249083
  const summary2 = record17(value), page2 = safeUrl(summary2.id ?? summary2.url, ["www.loc.gov", "loc.gov"]);
248856
249084
  if (!page2 || !/^\/(?:item|pictures\/item)\/[a-zA-Z0-9_./-]+\/$/.test(new URL(page2).pathname)) {
248857
249085
  add(null);
@@ -248883,8 +249111,8 @@ async function searchProvider(provider, query2, limit, client, report) {
248883
249111
  const url3 = endpoint("https://archive.org/advancedsearch.php", { q: `(${query2}) AND mediatype:image`, output: "json", rows: String(limit), page: "1" });
248884
249112
  url3.searchParams.append("fl[]", "identifier");
248885
249113
  url3.searchParams.append("fl[]", "title");
248886
- const data2 = await client.get(url3);
248887
- for (const value of requiredList(record17(data2.response).docs).slice(0, limit)) {
249114
+ const data = await client.get(url3);
249115
+ for (const value of requiredList(record17(data.response).docs).slice(0, limit)) {
248888
249116
  const summary2 = record17(value), id5 = identifier14(summary2.identifier);
248889
249117
  if (!id5) {
248890
249118
  add(null);
@@ -248892,7 +249120,7 @@ async function searchProvider(provider, query2, limit, client, report) {
248892
249120
  }
248893
249121
  const detail = new URL(`https://archive.org/metadata/${encodeURIComponent(id5)}/metadata`);
248894
249122
  try {
248895
- const data3 = await client.get(detail), metadata = requiredRecord(data3.result);
249123
+ const data2 = await client.get(detail), metadata = requiredRecord(data2.result);
248896
249124
  const item = result(provider, id5, firstText(metadata.title, summary2.title), `https://archive.org/details/${encodeURIComponent(id5)}`, detail.href, retrieved);
248897
249125
  if (item) {
248898
249126
  item.author = texts3(metadata.creator).join("; ") || null;
@@ -249433,44 +249661,44 @@ function createEditorialRenderer(config3, g) {
249433
249661
  const z2 = 0.82, w = 4.6 / (z2 * duration3), d2 = w * Math.sqrt(1 - z2 * z2), x = t - start4;
249434
249662
  return 1 - Math.exp(-z2 * w * x) * (Math.cos(d2 * x) + z2 / Math.sqrt(1 - z2 * z2) * Math.sin(d2 * x));
249435
249663
  }
249436
- function type(text17, x, y, size, color3) {
249664
+ function type(text18, x, y, size, color3) {
249437
249665
  g.font = `800 ${size}px EditorBrainEmbedded`;
249438
249666
  g.textAlign = "center";
249439
249667
  g.textBaseline = "alphabetic";
249440
249668
  g.fillStyle = color3;
249441
- g.fillText(text17, x, y);
249442
- const tm = g.measureText(text17), m = g.getTransform(), left = x - (tm.actualBoundingBoxLeft ?? tm.width / 2), top = y - (tm.actualBoundingBoxAscent ?? size), width = (tm.actualBoundingBoxLeft ?? tm.width / 2) + (tm.actualBoundingBoxRight ?? tm.width / 2), height = (tm.actualBoundingBoxAscent ?? size) + (tm.actualBoundingBoxDescent ?? size * 0.25);
249669
+ g.fillText(text18, x, y);
249670
+ const tm = g.measureText(text18), m = g.getTransform(), left = x - (tm.actualBoundingBoxLeft ?? tm.width / 2), top = y - (tm.actualBoundingBoxAscent ?? size), width = (tm.actualBoundingBoxLeft ?? tm.width / 2) + (tm.actualBoundingBoxRight ?? tm.width / 2), height = (tm.actualBoundingBoxAscent ?? size) + (tm.actualBoundingBoxDescent ?? size * 0.25);
249443
249671
  const points = [[left, top], [left + width, top], [left, top + height], [left + width, top + height]].map(([a, b]) => ({ x: m.a * a + m.c * b + m.e, y: m.b * a + m.d * b + m.f }));
249444
249672
  const bx = Math.min(...points.map((p2) => p2.x)), by = Math.min(...points.map((p2) => p2.y)), bw = Math.max(...points.map((p2) => p2.x)) - bx, bh = Math.max(...points.map((p2) => p2.y)) - by;
249445
- inkBounds.push({ key: `ink-${inkBounds.length}`, text: text17, x: bx, y: by, width: bw, height: bh, fontSize: size, overflow: false, outOfBounds: bx < 0 || by < 0 || bx + bw > W || by + bh > H });
249673
+ inkBounds.push({ key: `ink-${inkBounds.length}`, text: text18, x: bx, y: by, width: bw, height: bh, fontSize: size, overflow: false, outOfBounds: bx < 0 || by < 0 || bx + bw > W || by + bh > H });
249446
249674
  }
249447
- function fitted(text17, size, max) {
249675
+ function fitted(text18, size, max) {
249448
249676
  g.font = `800 ${size}px EditorBrainEmbedded`;
249449
- return Math.min(size, size * max / Math.max(1, g.measureText(text17).width));
249677
+ return Math.min(size, size * max / Math.max(1, g.measureText(text18).width));
249450
249678
  }
249451
- function maskedLine(text17, x, y, size, t, start4) {
249452
- const s = fitted(text17, size, W * 0.7), pr = config3.motion === "reduced" ? 1 : spring(t, start4);
249679
+ function maskedLine(text18, x, y, size, t, start4) {
249680
+ const s = fitted(text18, size, W * 0.7), pr = config3.motion === "reduced" ? 1 : spring(t, start4);
249453
249681
  g.save();
249454
249682
  g.beginPath();
249455
249683
  g.rect(W * 0.08, y - s * 1.25, W * 0.84, s * 1.65);
249456
249684
  g.clip();
249457
- type(text17, x, y + s * 1.5 * (1 - pr), s, p.foreground);
249685
+ type(text18, x, y + s * 1.5 * (1 - pr), s, p.foreground);
249458
249686
  g.restore();
249459
249687
  }
249460
- function odometer(text17, x, y, size, t) {
249461
- size = fitted(text17, size, W * 0.7);
249688
+ function odometer(text18, x, y, size, t) {
249689
+ size = fitted(text18, size, W * 0.7);
249462
249690
  g.save();
249463
249691
  g.font = `800 ${size}px EditorBrainEmbedded`;
249464
249692
  g.textAlign = "center";
249465
249693
  g.textBaseline = "alphabetic";
249466
249694
  g.fillStyle = p.foreground;
249467
249695
  const digit = Math.max(...Array.from("0123456789", (c) => g.measureText(c).width));
249468
- const cells = Array.from(text17, (c) => /\d/.test(c) ? digit : g.measureText(c).width), total = cells.reduce((a, b) => a + b, 0);
249696
+ const cells = Array.from(text18, (c) => /\d/.test(c) ? digit : g.measureText(c).width), total = cells.reduce((a, b) => a + b, 0);
249469
249697
  let left = x - total / 2;
249470
249698
  g.beginPath();
249471
249699
  g.rect(left - 8, y - size * 1.15, total + 16, size * 1.45);
249472
249700
  g.clip();
249473
- Array.from(text17).forEach((c, i) => {
249701
+ Array.from(text18).forEach((c, i) => {
249474
249702
  const cx = left + cells[i] / 2;
249475
249703
  left += cells[i];
249476
249704
  const pr = config3.motion === "reduced" ? 1 : expo(clamp((t - i * 0.04) / 0.8));
@@ -249481,7 +249709,7 @@ function createEditorialRenderer(config3, g) {
249481
249709
  });
249482
249710
  g.restore();
249483
249711
  }
249484
- function stamp(text17, t) {
249712
+ function stamp(text18, t) {
249485
249713
  const pr = config3.motion === "reduced" ? 1 : clamp(t / 0.14), scale = (1.5 - 0.5 * pr * pr * pr) * (1 + 0.018 * Math.sin(clamp((t - 0.14) / 0.2) * Math.PI));
249486
249714
  g.save();
249487
249715
  g.translate(W * 0.46, H * 0.53);
@@ -249491,7 +249719,7 @@ function createEditorialRenderer(config3, g) {
249491
249719
  g.strokeStyle = p.accent;
249492
249720
  g.lineWidth = U * 9e-3;
249493
249721
  g.strokeRect(-W * 0.33, -U * 0.105, W * 0.7, U * 0.21);
249494
- type(text17, 0, U * 0.035, fitted(text17, U * 0.09, W * 0.6), p.foreground);
249722
+ type(text18, 0, U * 0.035, fitted(text18, U * 0.09, W * 0.6), p.foreground);
249495
249723
  g.restore();
249496
249724
  }
249497
249725
  function fallingLogo(draw, t) {
@@ -249714,8 +249942,8 @@ function createLiquidRenderer(config3, context) {
249714
249942
  context.strokeStyle = rgba(palette.foreground, 0.14);
249715
249943
  context.lineWidth = Math.max(0.5, min * 1e-3);
249716
249944
  context.stroke();
249717
- const text17 = [{ key: "title", text: config3.title, x: w * 0.065, y: h * 0.055, width: w * 0.87, height: h * (tall ? 0.095 : 0.12), size: min * 0.062, weight: 760 }];
249718
- if (config3.subtitle) text17.push({ key: "subtitle", text: config3.subtitle, x: w * 0.067, y: h * (tall ? 0.159 : 0.176), width: w * 0.85, height: h * (tall ? 0.057 : 0.065), size: min * 0.025, opacity: 0.79 });
249945
+ const text18 = [{ key: "title", text: config3.title, x: w * 0.065, y: h * 0.055, width: w * 0.87, height: h * (tall ? 0.095 : 0.12), size: min * 0.062, weight: 760 }];
249946
+ if (config3.subtitle) text18.push({ key: "subtitle", text: config3.subtitle, x: w * 0.067, y: h * (tall ? 0.159 : 0.176), width: w * 0.85, height: h * (tall ? 0.057 : 0.065), size: min * 0.025, opacity: 0.79 });
249719
249947
  const active = config3.motion === "reduced" ? items.length - 1 : Math.min(items.length - 1, Math.floor(p * items.length));
249720
249948
  items.forEach((item, index2) => {
249721
249949
  const col = wide ? 0 : index2 % 2, row = wide ? index2 : Math.floor(index2 / 2);
@@ -249737,11 +249965,11 @@ function createLiquidRenderer(config3, context) {
249737
249965
  context.lineWidth = min * 3e-3;
249738
249966
  context.stroke();
249739
249967
  }
249740
- text17.push({ key: `number-${index2}`, text: String(index2 + 1).padStart(2, "0"), x, y, width: min * 0.049, height: min * 0.04, size: min * 0.022, weight: 700, opacity: 0.65 });
249741
- text17.push({ key: `label-${index2}`, text: item.label, x: x + min * 0.06, y, width: width - min * 0.06, height: h * (wide ? 0.062 : tall ? 0.045 : 0.055), size: min * 0.03, weight: 720, opacity: active === index2 || p >= 0.88 ? 1 : 0.75 });
249742
- if (item.detail) text17.push({ key: `detail-${index2}`, text: item.detail, x, y: y + h * (wide ? 0.065 : tall ? 0.048 : 0.06), width, height: h * (wide ? 0.067 : tall ? 0.072 : 0.065), size: min * 0.022, opacity: 0.72 });
249968
+ text18.push({ key: `number-${index2}`, text: String(index2 + 1).padStart(2, "0"), x, y, width: min * 0.049, height: min * 0.04, size: min * 0.022, weight: 700, opacity: 0.65 });
249969
+ text18.push({ key: `label-${index2}`, text: item.label, x: x + min * 0.06, y, width: width - min * 0.06, height: h * (wide ? 0.062 : tall ? 0.045 : 0.055), size: min * 0.03, weight: 720, opacity: active === index2 || p >= 0.88 ? 1 : 0.75 });
249970
+ if (item.detail) text18.push({ key: `detail-${index2}`, text: item.detail, x, y: y + h * (wide ? 0.065 : tall ? 0.048 : 0.06), width, height: h * (wide ? 0.067 : tall ? 0.072 : 0.065), size: min * 0.022, opacity: 0.72 });
249743
249971
  });
249744
- return text17;
249972
+ return text18;
249745
249973
  } };
249746
249974
  }
249747
249975
 
@@ -249789,7 +250017,7 @@ function createGlassRenderer(config3, context) {
249789
250017
  if (!Number.isFinite(time3)) throw new Error("Glass time must be finite.");
249790
250018
  const p = config3.motion === "reduced" ? 1 : clamp(time3 / config3.duration);
249791
250019
  const phase = config3.motion === "reduced" ? 1.85 : p * Math.PI * 1.7;
249792
- const text17 = [{
250020
+ const text18 = [{
249793
250021
  key: "title",
249794
250022
  text: config3.title,
249795
250023
  x: w * 0.065,
@@ -249799,7 +250027,7 @@ function createGlassRenderer(config3, context) {
249799
250027
  size: min * 0.066,
249800
250028
  weight: 550
249801
250029
  }];
249802
- if (config3.subtitle) text17.push({
250030
+ if (config3.subtitle) text18.push({
249803
250031
  key: "subtitle",
249804
250032
  text: config3.subtitle,
249805
250033
  x: w * 0.067,
@@ -249899,8 +250127,8 @@ function createGlassRenderer(config3, context) {
249899
250127
  context.moveTo(x, y - min * 0.014);
249900
250128
  context.lineTo(x + width * (0.07 + 0.18 * settle2), y - min * 0.014);
249901
250129
  stroke(color3(palette.accent, 0.85), Math.max(1, min * 2e-3));
249902
- text17.push({ key: `label-${index2}`, text: item.label, x, y, width, height: h * (wide ? 0.044 : tall ? 0.043 : 0.048), size: min * 0.031, weight: 620, opacity: 0.74 + settle2 * 0.26 });
249903
- if (item.detail) text17.push({
250130
+ text18.push({ key: `label-${index2}`, text: item.label, x, y, width, height: h * (wide ? 0.044 : tall ? 0.043 : 0.048), size: min * 0.031, weight: 620, opacity: 0.74 + settle2 * 0.26 });
250131
+ if (item.detail) text18.push({
249904
250132
  key: `detail-${index2}`,
249905
250133
  text: item.detail,
249906
250134
  x,
@@ -249911,7 +250139,7 @@ function createGlassRenderer(config3, context) {
249911
250139
  opacity: 0.72
249912
250140
  });
249913
250141
  });
249914
- return text17;
250142
+ return text18;
249915
250143
  } };
249916
250144
  }
249917
250145
 
@@ -249996,8 +250224,8 @@ function createPixelRenderer(config3, context) {
249996
250224
  const p = clamp(stepped / config3.duration), final = p >= 0.9;
249997
250225
  const travel = clamp((p - 0.09) / 0.72) * (items.length - 1), frame = Math.floor(stepped * 10);
249998
250226
  const camera = Math.floor(Math.min(p, 0.9) * 24);
249999
- const text17 = [{ key: "title", text: config3.title, x: w * 0.065, y: h * 0.055, width: w * 0.87, height: h * (tall ? 0.095 : 0.12), size: min * 0.06, weight: 750 }];
250000
- if (config3.subtitle) text17.push({ key: "subtitle", text: config3.subtitle, x: w * 0.067, y: h * (tall ? 0.161 : 0.181), width: w * 0.85, height: h * (tall ? 0.057 : 0.065), size: min * 0.025, opacity: 0.8 });
250227
+ const text18 = [{ key: "title", text: config3.title, x: w * 0.065, y: h * 0.055, width: w * 0.87, height: h * (tall ? 0.095 : 0.12), size: min * 0.06, weight: 750 }];
250228
+ if (config3.subtitle) text18.push({ key: "subtitle", text: config3.subtitle, x: w * 0.067, y: h * (tall ? 0.161 : 0.181), width: w * 0.85, height: h * (tall ? 0.057 : 0.065), size: min * 0.025, opacity: 0.8 });
250001
250229
  const sunX = Math.round(gw * 0.77 - camera * 0.08), sunY = world.top + 8;
250002
250230
  for (let y = -10; y <= 10; y++) {
250003
250231
  const half = Math.floor(Math.sqrt(Math.max(0, 100 - y * y)));
@@ -250061,7 +250289,7 @@ function createPixelRenderer(config3, context) {
250061
250289
  sprite(["aaaaaaa", "aaaaaaa", "aaaaaa.", "aaaa..."], markerX + 1, y - 18 + (wave === 2 ? 1 : 0), visited ? 1 : 0.26);
250062
250290
  rect2(markerX - 2, y - 1, 5, 1, palette.foreground, 0.5);
250063
250291
  }
250064
- text17.push({ key: `milestone-${index2}`, text: String(index2 + 1).padStart(2, "0"), x: (node2.x - 5) * unit3, y: (node2.y + 19) * unit3, width: unit3 * 10, height: unit3 * 7, size: min * 0.022, align: "center", weight: 750, opacity: visited ? 1 : 0.4 });
250292
+ text18.push({ key: `milestone-${index2}`, text: String(index2 + 1).padStart(2, "0"), x: (node2.x - 5) * unit3, y: (node2.y + 19) * unit3, width: unit3 * 10, height: unit3 * 7, size: min * 0.022, align: "center", weight: 750, opacity: visited ? 1 : 0.4 });
250065
250293
  });
250066
250294
  const fromIndex = Math.min(items.length - 2, Math.floor(travel)), amount2 = travel - fromIndex;
250067
250295
  const from = nodes[fromIndex], to = nodes[fromIndex + 1];
@@ -250078,11 +250306,11 @@ function createPixelRenderer(config3, context) {
250078
250306
  const boxW = cellW - w * 0.025, visited = travel >= index2;
250079
250307
  rect2(x / unit3, (y - min * 0.018) / unit3, boxW / unit3, 1, palette.foreground, 0.16);
250080
250308
  rect2(x / unit3, (y - min * 0.018) / unit3, Math.min(boxW / unit3, visited ? 14 : 3), 1, visited ? palette.accent : palette.foreground, visited ? 1 : 0.3);
250081
- text17.push({ key: `label-${index2}`, text: item.label, x, y, width: boxW, height: h * (wide ? 0.054 : tall ? 0.036 : 0.049), size: min * 0.029, weight: 700, opacity: visited ? 1 : 0.6 });
250082
- if (item.detail) text17.push({ key: `detail-${index2}`, text: item.detail, x, y: y + h * (wide ? 0.058 : tall ? 0.039 : 0.053), width: boxW, height: h * (wide ? 0.075 : tall ? 0.058 : 0.09), size: min * 0.022, opacity: visited ? 0.82 : 0.52 });
250309
+ text18.push({ key: `label-${index2}`, text: item.label, x, y, width: boxW, height: h * (wide ? 0.054 : tall ? 0.036 : 0.049), size: min * 0.029, weight: 700, opacity: visited ? 1 : 0.6 });
250310
+ if (item.detail) text18.push({ key: `detail-${index2}`, text: item.detail, x, y: y + h * (wide ? 0.058 : tall ? 0.039 : 0.053), width: boxW, height: h * (wide ? 0.075 : tall ? 0.058 : 0.09), size: min * 0.022, opacity: visited ? 0.82 : 0.52 });
250083
250311
  });
250084
250312
  context.globalAlpha = 1;
250085
- return text17;
250313
+ return text18;
250086
250314
  } };
250087
250315
  }
250088
250316
 
@@ -250165,14 +250393,14 @@ function visualDocumentBoot(config3, factory) {
250165
250393
  ctx.fillStyle = config3.palette.background;
250166
250394
  ctx.fillRect(0, 0, W, H);
250167
250395
  ctx.save();
250168
- let text17;
250396
+ let text18;
250169
250397
  try {
250170
- text17 = renderer.draw(current2);
250398
+ text18 = renderer.draw(current2);
250171
250399
  } finally {
250172
250400
  ctx.restore();
250173
250401
  }
250174
250402
  for (const node2 of nodes.values()) node2.style.display = "none";
250175
- text17.forEach(textNode);
250403
+ text18.forEach(textNode);
250176
250404
  scrubber.value = String(current2);
250177
250405
  timeLabel.textContent = current2.toFixed(1) + " / " + config3.duration.toFixed(1) + " s";
250178
250406
  }
@@ -250330,8 +250558,8 @@ function createIsometricRenderer(config3, context) {
250330
250558
  return { draw(time3) {
250331
250559
  if (!Number.isFinite(time3)) throw new Error("Isometric time must be finite.");
250332
250560
  const p = config3.motion === "reduced" ? 1 : clamp(time3 / config3.duration);
250333
- const text17 = [{ key: "title", text: config3.title, x: w * 0.065, y: h * 0.055, width: w * 0.87, height: h * (tall ? 0.095 : 0.12), size: min * (wide ? 0.059 : 0.06), weight: 750 }];
250334
- if (config3.subtitle) text17.push({ key: "subtitle", text: config3.subtitle, x: w * 0.067, y: h * (tall ? 0.159 : 0.176), width: w * 0.85, height: h * (tall ? 0.057 : 0.065), size: min * 0.025, opacity: 0.78 });
250561
+ const text18 = [{ key: "title", text: config3.title, x: w * 0.065, y: h * 0.055, width: w * 0.87, height: h * (tall ? 0.095 : 0.12), size: min * (wide ? 0.059 : 0.06), weight: 750 }];
250562
+ if (config3.subtitle) text18.push({ key: "subtitle", text: config3.subtitle, x: w * 0.067, y: h * (tall ? 0.159 : 0.176), width: w * 0.85, height: h * (tall ? 0.057 : 0.065), size: min * 0.025, opacity: 0.78 });
250335
250563
  const tiles = [];
250336
250564
  for (let ix = 0; ix < 6; ix++) for (let iy = 0; iy < 6; iy++) tiles.push({ x: -1.75 + ix * 0.7, y: -1.6 + iy * 0.7, depth: ix + iy });
250337
250565
  tiles.sort((a, b) => a.depth - b.depth).forEach((tile) => {
@@ -250375,7 +250603,7 @@ function createIsometricRenderer(config3, context) {
250375
250603
  polygon([project2(x - 0.24, y - 0.24, z2 + 4e-3), project2(x + 0.24, y - 0.24, z2 + 4e-3), project2(x + 0.24, y + 0.24, z2 + 4e-3), project2(x - 0.24, y + 0.24, z2 + 4e-3)], rgba(palette.background, 0.22));
250376
250604
  }
250377
250605
  const anchor2 = project2(x, y, roofHeights[index2] + 0.47);
250378
- text17.push({ key: `node-${index2}`, text: String(index2 + 1).padStart(2, "0"), x: anchor2[0] - min * 0.035, y: anchor2[1] - min * 0.017, width: min * 0.07, height: min * 0.035, size: min * 0.024, opacity: smooth((p - start4 - 0.11) / 0.11), align: "center", weight: 750 });
250606
+ text18.push({ key: `node-${index2}`, text: String(index2 + 1).padStart(2, "0"), x: anchor2[0] - min * 0.035, y: anchor2[1] - min * 0.017, width: min * 0.07, height: min * 0.035, size: min * 0.024, opacity: smooth((p - start4 - 0.11) / 0.11), align: "center", weight: 750 });
250379
250607
  });
250380
250608
  items.forEach((item, index2) => {
250381
250609
  const columns = wide ? 1 : 2, col = index2 % columns, row = Math.floor(index2 / columns);
@@ -250386,11 +250614,11 @@ function createIsometricRenderer(config3, context) {
250386
250614
  line([[x, y - min * 0.012], [x + width, y - min * 0.012]], rgba(palette.foreground, 0.17), strokeWidth);
250387
250615
  const bar = ease((p - 0.12 - index2 * 0.105) / 0.19);
250388
250616
  line([[x, y - min * 0.012], [x + width * bar, y - min * 0.012]], rgba(palette.accent, 0.95), strokeWidth * 2.1);
250389
- text17.push({ key: `index-${index2}`, text: String(index2 + 1).padStart(2, "0"), x, y, width: min * 0.049, height: min * 0.04, size: min * 0.023, opacity: 0.72 + reveal * 0.28, weight: 650 });
250390
- text17.push({ key: `label-${index2}`, text: item.label, x: x + min * 0.06, y, width: width - min * 0.06, height: h * (wide ? 0.062 : tall ? 0.045 : 0.055), size: min * 0.03, weight: 700, opacity: 0.58 + reveal * 0.42 });
250391
- if (item.detail) text17.push({ key: `detail-${index2}`, text: item.detail, x, y: y + h * (wide ? 0.063 : tall ? 0.048 : 0.06), width, height: h * (wide ? 0.067 : tall ? 0.072 : 0.065), size: min * 0.022, opacity: 0.52 + reveal * 0.25 });
250617
+ text18.push({ key: `index-${index2}`, text: String(index2 + 1).padStart(2, "0"), x, y, width: min * 0.049, height: min * 0.04, size: min * 0.023, opacity: 0.72 + reveal * 0.28, weight: 650 });
250618
+ text18.push({ key: `label-${index2}`, text: item.label, x: x + min * 0.06, y, width: width - min * 0.06, height: h * (wide ? 0.062 : tall ? 0.045 : 0.055), size: min * 0.03, weight: 700, opacity: 0.58 + reveal * 0.42 });
250619
+ if (item.detail) text18.push({ key: `detail-${index2}`, text: item.detail, x, y: y + h * (wide ? 0.063 : tall ? 0.048 : 0.06), width, height: h * (wide ? 0.067 : tall ? 0.072 : 0.065), size: min * 0.022, opacity: 0.52 + reveal * 0.25 });
250392
250620
  });
250393
- return text17;
250621
+ return text18;
250394
250622
  } };
250395
250623
  }
250396
250624
 
@@ -250514,7 +250742,7 @@ function createSketchRenderer(config3, context) {
250514
250742
  const phase = reduced ? 1 : clampedTime / config3.duration;
250515
250743
  const frame = reduced ? 0 : Math.floor(clampedTime * 8);
250516
250744
  const titleOpacity = reduced ? 1 : 0.25 + 0.75 * ease(phase / 0.045);
250517
- const text17 = [
250745
+ const text18 = [
250518
250746
  { key: "title", text: config3.title, x: W * 0.065, y: H * 0.055, width: W * 0.87, height: H * 0.145, size: S * 0.081, weight: 600, opacity: titleOpacity },
250519
250747
  { key: "subtitle", text: config3.subtitle || "", x: W * 0.067, y: H * 0.216, width: W * 0.84, height: H * 0.052, size: S * 0.026, weight: 400, opacity: titleOpacity }
250520
250748
  ];
@@ -250547,9 +250775,9 @@ function createSketchRenderer(config3, context) {
250547
250775
  context.restore();
250548
250776
  }
250549
250777
  const numberSize = Math.min(S * 0.039, node2.radius * 0.57);
250550
- text17.push({ key: `number-${index2}`, text: String(index2 + 1).padStart(2, "0"), x: node2.x - node2.radius * 0.52, y: node2.y - numberSize * 0.64, width: node2.radius * 1.04, height: numberSize * 1.4, size: numberSize, weight: 400, align: "center", opacity: appear });
250551
- text17.push({ key: `label-${index2}`, text: config3.items[index2].label, ...node2.label, size: S * (vertical ? 0.043 : 0.046), weight: 600, align: node2.align, opacity: appear });
250552
- text17.push({ key: `detail-${index2}`, text: config3.items[index2].detail || "", ...node2.detail, size: S * (portrait ? 0.028 : 0.024), weight: 400, align: node2.align, opacity: appear });
250778
+ text18.push({ key: `number-${index2}`, text: String(index2 + 1).padStart(2, "0"), x: node2.x - node2.radius * 0.52, y: node2.y - numberSize * 0.64, width: node2.radius * 1.04, height: numberSize * 1.4, size: numberSize, weight: 400, align: "center", opacity: appear });
250779
+ text18.push({ key: `label-${index2}`, text: config3.items[index2].label, ...node2.label, size: S * (vertical ? 0.043 : 0.046), weight: 600, align: node2.align, opacity: appear });
250780
+ text18.push({ key: `detail-${index2}`, text: config3.items[index2].detail || "", ...node2.detail, size: S * (portrait ? 0.028 : 0.024), weight: 400, align: node2.align, opacity: appear });
250553
250781
  const underline = ease((phase - nodeStart(index2) - 0.2) / 0.12);
250554
250782
  const lineY = node2.label.y + node2.label.height + S * 4e-3;
250555
250783
  const lineWidth = node2.label.width * (vertical ? 0.43 : 0.66);
@@ -250561,7 +250789,7 @@ function createSketchRenderer(config3, context) {
250561
250789
  stroke(ellipse(last.x, last.y, last.radius * 1.13, last.radius * 1.115, -0.66, Math.PI * 1.76), finalEmphasis, frame, 66, palette.accent, S * 26e-4, 0.85);
250562
250790
  stroke([{ x: W * 0.067, y: H * 0.94 }, { x: W * 0.933, y: H * 0.94 }], 1, frame, 96, palette.foreground, S * 13e-4, 0.14, false);
250563
250791
  stroke([{ x: W * 0.067, y: H * 0.94 }, { x: W * 0.933, y: H * 0.94 }], reduced ? 1 : clamp(phase / 0.88), frame, 95, palette.accent, S * 24e-4, 0.8, false);
250564
- return text17;
250792
+ return text18;
250565
250793
  }
250566
250794
  };
250567
250795
  }
@@ -250832,10 +251060,10 @@ function motionDocumentBoot(config3) {
250832
251060
  return p * p * p * (p * (p * 6 - 15) + 10);
250833
251061
  };
250834
251062
  const lerp = (a, b, p) => a + (b - a) * p;
250835
- const element = (tag, className, parent = stage, text17) => {
251063
+ const element = (tag, className, parent = stage, text18) => {
250836
251064
  const node2 = document.createElement(tag);
250837
251065
  node2.className = className;
250838
- if (text17 !== void 0) node2.textContent = text17;
251066
+ if (text18 !== void 0) node2.textContent = text18;
250839
251067
  parent.appendChild(node2);
250840
251068
  return node2;
250841
251069
  };
@@ -251083,7 +251311,7 @@ function motionDocumentBoot(config3) {
251083
251311
  const width = ink.width / scale, height = ink.height / scale;
251084
251312
  return { text: node2.textContent, x, y, width, height, fontSize: parseFloat(getComputedStyle(node2).fontSize), container: { x: (rect2.x - stageRect.x) / scale, y: (rect2.y - stageRect.y) / scale, width: rect2.width / scale, height: rect2.height / scale }, outOfBounds: x < -1 || y < -1 || x + width > W + 1 || y + height > H + 1, overflow: node2.scrollWidth > node2.clientWidth + 1 || node2.scrollHeight > node2.clientHeight + 1 };
251085
251313
  });
251086
- return { ready: runtime3.__ready, error: runtime3.__motionError || null, time: currentTime, format: layout.format, activeItem: currentIndex, overview: overviewState, textBounds, outOfBounds: textBounds.some((text17) => text17.outOfBounds || text17.overflow), illustrationFallbacks: config3.items.map((item, index2) => !item.image && config3.componentId === "sticker-explainer" ? index2 : -1).filter((index2) => index2 >= 0), fontLoaded: document.fonts.check("16px EditorBrainEmbedded"), imagesDecoded: images.every((image2) => image2.complete && image2.naturalWidth > 0) };
251314
+ return { ready: runtime3.__ready, error: runtime3.__motionError || null, time: currentTime, format: layout.format, activeItem: currentIndex, overview: overviewState, textBounds, outOfBounds: textBounds.some((text18) => text18.outOfBounds || text18.overflow), illustrationFallbacks: config3.items.map((item, index2) => !item.image && config3.componentId === "sticker-explainer" ? index2 : -1).filter((index2) => index2 >= 0), fontLoaded: document.fonts.check("16px EditorBrainEmbedded"), imagesDecoded: images.every((image2) => image2.complete && image2.naturalWidth > 0) };
251087
251315
  };
251088
251316
  let playing = false, frame = 0, playStart = 0, timeStart = 0;
251089
251317
  const pause = () => {
@@ -253400,7 +253628,7 @@ function paletteCard(b) {
253400
253628
  }
253401
253629
  function recipeCard(b) {
253402
253630
  const c = el("div", "card recipe"); if (!b.structure?.length) { c.append(el("h3", "", b.name)); return c; }
253403
- c.append(el("h3", "", T.recipe(b.structure.length))); const ol = el("ol"); b.structure.forEach(s => ol.append(el("li", "", s))); c.append(ol); return c;
253631
+ c.append(el("h3", "", b.recipeTitle || T.recipe(b.structure.length))); const ol = el("ol"); b.structure.forEach(s => ol.append(el("li", "", s))); c.append(ol); return c;
253404
253632
  }
253405
253633
  function renderBoard() {
253406
253634
  const b = BOARDS[current], stage = $("#stage"); stage.replaceChildren();
@@ -253474,7 +253702,7 @@ $("footer button").onclick = async () => { if (picked < 0) return; try { await n
253474
253702
  addEventListener("keydown", e => { if (e.key === "Escape") stopTour(); });
253475
253703
  new ResizeObserver(() => { if (mode === "board") layout(); }).observe($(".wrap"));
253476
253704
  render(); footer(); if (BOARDS.length < 2) $("footer").hidden = true;`;
253477
- function renderStyleGlancePage(boards, lang, heading) {
253705
+ function renderStyleGlancePage(boards2, lang, heading) {
253478
253706
  const slots = Object.fromEntries(styleGlanceSlots.map((slot) => [slot, styleGlanceSlotNames[slot][lang]]));
253479
253707
  return `<!doctype html>
253480
253708
  <html lang="${lang}">
@@ -253495,7 +253723,7 @@ ${STYLE2}
253495
253723
  </div>
253496
253724
  <footer><p></p><button disabled></button></footer>
253497
253725
  <script>
253498
- const BOARDS = ${scriptJson2(boards)};
253726
+ const BOARDS = ${scriptJson2(boards2)};
253499
253727
  const LANG = ${scriptJson2(lang)};
253500
253728
  const SLOTS = ${scriptJson2(slots)};
253501
253729
  const ORDER = ${scriptJson2(styleGlanceSlots)};
@@ -253512,15 +253740,16 @@ async function showStyleGlance(options) {
253512
253740
  if (!["es", "en"].includes(lang)) throw new CliError("INVALID_ARGUMENT", "--lang must be es or en.", "Write the page in the person's language.");
253513
253741
  const ids2 = [...new Set(options.ids)], local = !!(options.video || options.moments);
253514
253742
  if (local && !(options.video && options.moments)) throw new CliError("INVALID_ARGUMENT", "--video and --moments go together.", "Pass the rendered video and the moments.json that names its moments.");
253515
- const total = ids2.length + (local ? 1 : 0);
253516
- if (!total || total > STYLE_GLANCE_MAX_COMPARE) throw new CliError("INVALID_ARGUMENT", `Show 1 to ${STYLE_GLANCE_MAX_COMPARE} styles: one for its board, two or three to compare them.`, "More than three side by side teaches nothing: shortlist first with styles sheet.");
253743
+ const extraIds = options.extra?.ids ?? [], total = ids2.length + extraIds.length + (local ? 1 : 0);
253744
+ const noun = extraIds.length && !ids2.length ? "course formats" : "styles", shortlist = noun === "styles" ? "styles sheet" : "courses list";
253745
+ if (!total || total > STYLE_GLANCE_MAX_COMPARE) throw new CliError("INVALID_ARGUMENT", `Show 1 to ${STYLE_GLANCE_MAX_COMPARE} ${noun}: one for its board, two or three to compare them.`, `More than three side by side teaches nothing: shortlist first with ${shortlist}.`);
253517
253746
  const unknown2 = ids2.filter((id5) => !hasStyleGlance(id5));
253518
253747
  if (unknown2.length) throw new CliError("STYLE_GLANCE_NOT_FOUND", `No muestrario for: ${unknown2.join(", ")}.`, "Use catalog ids exactly as styles sheet lists them. Own styles: --video render.mp4 --moments moments.json.");
253519
253748
  const root = resolve31(options.dir ?? process.cwd());
253520
253749
  if (!(await stat10(root).catch(() => void 0))?.isDirectory()) throw new CliError("INVALID_ARGUMENT", "--dir must be an existing folder.", "Use the project folder the person works in.");
253521
253750
  const folder = join39(root, FOLDER2[lang]);
253522
253751
  await mkdir37(folder, { recursive: true });
253523
- const boards = ids2.map((id5) => catalogBoard(id5, options.names[id5]?.name ?? id5, options.names[id5]?.kind ?? "", lang));
253752
+ const boards2 = ids2.map((id5) => catalogBoard(id5, options.names[id5]?.name ?? id5, options.names[id5]?.kind ?? "", lang));
253524
253753
  let spec;
253525
253754
  if (local) {
253526
253755
  let parsed;
@@ -253531,17 +253760,17 @@ async function showStyleGlance(options) {
253531
253760
  }
253532
253761
  spec = validateLocalMoments(parsed);
253533
253762
  }
253534
- const heading = [...spec ? [spec.name ?? (lang === "en" ? "Your style" : "Tu estilo")] : [], ...boards.map((board) => board.name)].join(" vs ");
253535
- const stem2 = glanceFileStem([...spec ? [lang === "en" ? "my-video" : "mi-video"] : [], ...ids2], spec ? `${options.video}|${JSON.stringify(spec)}` : "");
253763
+ const stem2 = glanceFileStem([...spec ? [lang === "en" ? "my-video" : "mi-video"] : [], ...extraIds, ...ids2], spec ? `${options.video}|${JSON.stringify(spec)}` : "");
253536
253764
  const file3 = join39(folder, `${stem2}.html`);
253537
253765
  const existing4 = await readFile27(file3, "utf8").catch(() => void 0);
253538
253766
  if (existing4 !== void 0 && !existing4.includes(`<meta name="generator" content="${GENERATOR2}">`)) throw new CliError("EEXIST", `${FOLDER2[lang]}/${stem2}.html exists and was not written by EditorBrain.`, "Rename that file or pass --dir with another folder. Nothing was changed.");
253767
+ if (options.extra) boards2.unshift(...await options.extra.build(join39(folder, `${stem2}-media`, "library"), `${encodeURIComponent(`${stem2}-media`)}/library`));
253539
253768
  if (spec) {
253540
253769
  const video = isAbsolute8(options.video) ? options.video : resolve31(options.video);
253541
253770
  if (!(await stat10(video).catch(() => void 0))?.isFile()) throw new CliError("INVALID_ARGUMENT", "--video was not found.", "Use the rendered or exported video of the style.");
253542
- boards.unshift(await cutLocalBoard(video, spec, join39(folder, `${stem2}-media`), encodeURIComponent(`${stem2}-media`), lang));
253771
+ boards2.unshift(await cutLocalBoard(video, spec, join39(folder, `${stem2}-media`, "own"), `${encodeURIComponent(`${stem2}-media`)}/own`, lang));
253543
253772
  }
253544
- await writeFile12(file3, renderStyleGlancePage(boards, lang, heading));
253773
+ await writeFile12(file3, renderStyleGlancePage(boards2, lang, boards2.map((board) => board.name).join(" vs ")));
253545
253774
  let opened = false;
253546
253775
  if (options.browser !== false && !looksRemote(options.env ?? process.env)) {
253547
253776
  try {
@@ -253551,14 +253780,14 @@ async function showStyleGlance(options) {
253551
253780
  opened = false;
253552
253781
  }
253553
253782
  }
253554
- const catalogIds = boards.filter((board) => !board.own).map((board) => board.id);
253555
- const view = boards.length > 1 ? "compare" : "board";
253783
+ const catalogIds = ids2;
253784
+ const view = boards2.length > 1 ? "compare" : "board";
253556
253785
  return {
253557
253786
  file: file3,
253558
253787
  opened,
253559
253788
  view,
253560
253789
  lang,
253561
- styles: boards.map((board, index2) => ({
253790
+ styles: boards2.map((board, index2) => ({
253562
253791
  number: index2 + 1,
253563
253792
  id: board.id,
253564
253793
  name: board.name,
@@ -253566,19 +253795,100 @@ async function showStyleGlance(options) {
253566
253795
  moments: board.moments.map((moment) => ({ slot: moment.slot, at: moment.at, label: moment.label }))
253567
253796
  })),
253568
253797
  ...catalogIds.length ? { webUrl: styleGlanceUrl(catalogIds) } : {},
253798
+ ...extraIds.length ? { courseWebUrl: `https://editorbrain.com/app/cursos/muestrario?ids=${extraIds.map(encodeURIComponent).join(",")}` } : {},
253569
253799
  ...opened ? {} : { reason: options.browser === false ? "no_browser_flag" : looksRemote(options.env ?? process.env) ? "remote_shell" : "launch_failed" },
253570
253800
  next: opened ? view === "compare" ? "Tell the person a page opened with the styles side by side, moment by moment, and which one you would pick and why in one line. Ask them to answer in the chat; do not assume they saw it. Their choice is a candidate for this video, not a saved preference." : "Tell the person a page opened with the style's moments and what to look at (the hook, the text, the closing). Ask what they think in the chat; do not assume they saw it." : options.browser === false ? "The page was written but not opened. Show it in the host preview pane, or give webUrl (catalog styles only, needs their EditorBrain sign-in)." : `The page did not open. Tell them it is in the ${FOLDER2[lang]} folder of their project, or give webUrl for catalog styles.`
253571
253801
  };
253572
253802
  }
253573
253803
 
253804
+ // packages/cli/src/course-glance.ts
253805
+ init_src();
253806
+ init_errors3();
253807
+ import { createHash as createHash45 } from "node:crypto";
253808
+ import { randomUUID as randomUUID21 } from "node:crypto";
253809
+ import { mkdir as mkdir38, rename as rename10, rm as rm22, writeFile as writeFile13 } from "node:fs/promises";
253810
+ import { dirname as dirname37, join as join40 } from "node:path";
253811
+ var text17 = (value, lang) => (lang === "en" && value?.en?.trim() ? value.en : value?.es) ?? "";
253812
+ var MAX_FILE = 2 * 1024 * 1024;
253813
+ async function saveMedia(client, media2, expectedPath, file3) {
253814
+ if (media2.path !== expectedPath || !/^[a-f0-9]{64}$/.test(media2.sha256) || media2.bytes > MAX_FILE) throw new CliError("COURSE_GLANCE_INVALID", "The service returned an unexpected muestrario file.", "Run the command again; if it repeats, report it with editorbrain support.");
253815
+ const bytes = new Uint8Array(await (await client.media(media2.path)).arrayBuffer());
253816
+ if (bytes.byteLength !== media2.bytes || createHash45("sha256").update(bytes).digest("hex") !== media2.sha256)
253817
+ throw new CliError("COURSE_GLANCE_MISMATCH", "A muestrario file did not match its catalog pin.", "Nothing was opened. Run the command again; never use the mismatched file.");
253818
+ await writeFile13(file3, bytes);
253819
+ }
253820
+ async function courseGlanceBoards(client, ids2, lang, folder, href) {
253821
+ assertCourseGlanceIds(ids2);
253822
+ const sheets = await Promise.all(ids2.map((id5) => client.request(`/v1/course-formats/${id5}`)));
253823
+ const formats = sheets.map((sheet, index2) => {
253824
+ const format = sheet.format, id5 = ids2[index2];
253825
+ if (!format || format.id !== id5 || !format.glance?.moments?.length)
253826
+ throw new CliError("COURSE_GLANCE_NOT_FOUND", `The course format ${id5} has no muestrario yet.`, "Show its demo instead: editorbrain courses show <id> gives the recreation and its preview.");
253827
+ if (format.glance.moments.some((moment) => !styleGlanceSlots.includes(moment.slot))) throw new CliError("COURSE_GLANCE_INVALID", "The service returned an unexpected muestrario moment.", "Run the command again.");
253828
+ return { id: id5, format, glance: format.glance };
253829
+ });
253830
+ const staging = `${folder}.tmp-${randomUUID21()}`;
253831
+ await mkdir38(dirname37(folder), { recursive: true });
253832
+ const boards2 = [];
253833
+ try {
253834
+ for (const { id: id5, format, glance } of formats) {
253835
+ await mkdir38(join40(staging, id5), { recursive: true });
253836
+ const moments = [];
253837
+ for (const [i, moment] of glance.moments.entries()) {
253838
+ const n2 = String(i + 1).padStart(2, "0"), base = `/v1/course-formats/${id5}/media/glance-${n2}`;
253839
+ await saveMedia(client, moment.clip, base, join40(staging, id5, `${n2}.mp4`));
253840
+ await saveMedia(client, moment.still, `${base}-still`, join40(staging, id5, `${n2}.webp`));
253841
+ moments.push({
253842
+ at: moment.at,
253843
+ start: moment.start,
253844
+ end: moment.end,
253845
+ slot: moment.slot,
253846
+ label: text17(moment.label, lang),
253847
+ clip: `${href}/${encodeURIComponent(id5)}/${n2}.mp4`,
253848
+ still: `${href}/${encodeURIComponent(id5)}/${n2}.webp`
253849
+ });
253850
+ }
253851
+ const [w, h] = format.ratio.split(":").map(Number);
253852
+ boards2.push({
253853
+ id: id5,
253854
+ name: text17(format.name, lang),
253855
+ kind: lang === "en" ? "Lessons and courses" : "Clases y cursos",
253856
+ ratio: w > h ? "wide" : "tall",
253857
+ seconds: format.recreation?.demo?.durationSeconds ?? format.durationSeconds,
253858
+ hero: glance.hero,
253859
+ moments,
253860
+ palette: [],
253861
+ ...text17(format.recreation?.palette, lang) ? { type: text17(format.recreation?.palette, lang) } : {},
253862
+ structure: (format.edits ?? []).slice(0, 5).map((edit) => text17(edit, lang)),
253863
+ recipeTitle: lang === "en" ? "What gets edited" : "Lo que se edita",
253864
+ ask: lang === "en" ? `Use EditorBrain to edit my lesson with the \xAB${text17(format.name, "en")}\xBB format.` : `Usa EditorBrain para editar mi clase con el formato \xAB${text17(format.name, "es")}\xBB.`
253865
+ });
253866
+ }
253867
+ await rm22(folder, { recursive: true, force: true });
253868
+ await rename10(staging, folder);
253869
+ } finally {
253870
+ await rm22(staging, { recursive: true, force: true });
253871
+ }
253872
+ return boards2;
253873
+ }
253874
+ function assertCourseGlanceIds(ids2) {
253875
+ for (const id5 of ids2) if (!isCourseFormatId(id5)) throw new CliError("INVALID_ARGUMENT", "Unknown course format ID.", "Run editorbrain courses list and use one of its ids.");
253876
+ }
253877
+ async function runCourseGlance(client, ids2, options) {
253878
+ assertCourseGlanceIds(ids2);
253879
+ let lang = options.lang;
253880
+ if (lang === void 0) lang = await client.request("/v1/me").then((me) => me?.locale === "en" ? "en" : "es", () => "es");
253881
+ return showStyleGlance({ ...options, ids: [], names: {}, lang, extra: { ids: ids2, build: (folder, href) => courseGlanceBoards(client, ids2, lang, folder, href) } });
253882
+ }
253883
+
253574
253884
  // packages/cli/src/index.ts
253575
253885
  init_src();
253576
253886
 
253577
253887
  // packages/cli/src/guide-pages.ts
253578
253888
  init_src();
253579
253889
  init_errors3();
253580
- import { lstat as lstat43, mkdir as mkdir38, readFile as readFile28, stat as stat11, writeFile as writeFile13 } from "node:fs/promises";
253581
- import { join as join40, resolve as resolve32 } from "node:path";
253890
+ import { lstat as lstat43, mkdir as mkdir39, readFile as readFile28, stat as stat11, writeFile as writeFile14 } from "node:fs/promises";
253891
+ import { join as join41, resolve as resolve32 } from "node:path";
253582
253892
  import { pathToFileURL as pathToFileURL4 } from "node:url";
253583
253893
 
253584
253894
  // packages/cli/src/guide-wordmark.ts
@@ -253715,7 +254025,7 @@ var ARROW = '<svg class="arrow" aria-hidden="true" width="24" height="24" viewBo
253715
254025
  var LINK_ARROW = '<svg aria-hidden="true" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg>';
253716
254026
  var link3 = (path, label3) => `<a class="go" href="${WEB}${path}">${esc3(label3)}${LINK_ARROW}</a>`;
253717
254027
  var kicker = (label3, cls = "") => `<span class="kicker${cls ? " " + cls : ""}">${esc3(label3)}</span>`;
253718
- var quote = (lang, text17) => lang === "es" ? `\xAB${text17}\xBB` : `\u201C${text17}\u201D`;
254028
+ var quote = (lang, text18) => lang === "es" ? `\xAB${text18}\xBB` : `\u201C${text18}\u201D`;
253719
254029
  var ICONS = {
253720
254030
  brand: '<circle cx="13.5" cy="6.5" r=".5" fill="#682e3b"/><circle cx="17.5" cy="10.5" r=".5" fill="#682e3b"/><circle cx="8.5" cy="7.5" r=".5" fill="#682e3b"/><circle cx="6.5" cy="12.5" r=".5" fill="#682e3b"/><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z"/>',
253721
254031
  taste: '<path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"/>',
@@ -254074,17 +254384,17 @@ async function showGuidePage(options) {
254074
254384
  const id5 = resolveGuideId(options.page);
254075
254385
  const root = resolve32(options.dir ?? process.cwd());
254076
254386
  if (!(await stat11(root).catch(() => void 0))?.isDirectory()) throw new CliError("INVALID_ARGUMENT", "--dir must be an existing folder.", "Use the project folder the person works in.");
254077
- const folder = join40(root, FOLDER3[lang]);
254078
- await mkdir38(folder, { recursive: true });
254387
+ const folder = join41(root, FOLDER3[lang]);
254388
+ await mkdir39(folder, { recursive: true });
254079
254389
  let name = id5;
254080
254390
  for (let n2 = 2; ; n2++) {
254081
- const candidate = join40(folder, `${name}.html`);
254391
+ const candidate = join41(folder, `${name}.html`);
254082
254392
  if (!await exists5(candidate) || (await readFile28(candidate, "utf8").catch(() => "")).includes(`<meta name="generator" content="${GENERATOR3}">`)) break;
254083
254393
  if (n2 > 99) throw new CliError("EEXIST", "Too many files with this guide name already exist.", `Clean up the ${FOLDER3[lang]} folder.`);
254084
254394
  name = `${id5}-${n2}`;
254085
254395
  }
254086
- const file3 = join40(folder, `${name}.html`);
254087
- await writeFile13(file3, renderGuidePage(id5, lang));
254396
+ const file3 = join41(folder, `${name}.html`);
254397
+ await writeFile14(file3, renderGuidePage(id5, lang));
254088
254398
  const env = options.env ?? process.env;
254089
254399
  let opened = false;
254090
254400
  if (options.browser !== false && !looksRemote(env)) {
@@ -254111,7 +254421,7 @@ async function showGuidePage(options) {
254111
254421
  init_errors3();
254112
254422
  import { readFile as readFile29, realpath as realpath10, stat as stat12 } from "node:fs/promises";
254113
254423
  import { homedir as homedir10 } from "node:os";
254114
- import { basename as basename13, extname as extname21, isAbsolute as isAbsolute9, join as join41, relative as relative6, resolve as resolve33, sep as sep4 } from "node:path";
254424
+ import { basename as basename13, extname as extname21, isAbsolute as isAbsolute9, join as join42, relative as relative6, resolve as resolve33, sep as sep4 } from "node:path";
254115
254425
  var VIDEO = /^\.(mp4|mov|m4v|webm|mkv|gif)$/i;
254116
254426
  var FOLDER_NAMES = { desktop: { es: "Escritorio", en: "Desktop" }, downloads: { es: "Descargas", en: "Downloads" } };
254117
254427
  var NOISE = /^(v\d+|final|finale|render|renders|export|draft|preview|master|out|output|edit|edited|tmp|copy|\d{6,}|[a-f0-9]{8,})$/i;
@@ -254132,12 +254442,12 @@ var inside = (root, path) => {
254132
254442
  async function knownFolder(kind3, home, platform, env) {
254133
254443
  const candidates = [];
254134
254444
  if (platform === "linux") {
254135
- const config3 = await readFile29(join41(env.XDG_CONFIG_HOME || join41(home, ".config"), "user-dirs.dirs"), "utf8").catch(() => "");
254445
+ const config3 = await readFile29(join42(env.XDG_CONFIG_HOME || join42(home, ".config"), "user-dirs.dirs"), "utf8").catch(() => "");
254136
254446
  const match = config3.match(new RegExp(`^XDG_${kind3 === "desktop" ? "DESKTOP" : "DOWNLOAD"}_DIR="([^"]+)"`, "m"));
254137
254447
  if (match) candidates.push(match[1].replace(/^\$HOME/, home));
254138
254448
  }
254139
- if (platform === "win32" && kind3 === "desktop" && env.OneDrive) candidates.push(join41(env.OneDrive, "Desktop"));
254140
- candidates.push(join41(home, kind3 === "desktop" ? "Desktop" : "Downloads"));
254449
+ if (platform === "win32" && kind3 === "desktop" && env.OneDrive) candidates.push(join42(env.OneDrive, "Desktop"));
254450
+ candidates.push(join42(home, kind3 === "desktop" ? "Desktop" : "Downloads"));
254141
254451
  for (const candidate of candidates) if ((await stat12(candidate).catch(() => void 0))?.isDirectory()) return candidate;
254142
254452
  throw new CliError("FOLDER_NOT_FOUND", `This computer has no ${kind3 === "desktop" ? "Desktop" : "Downloads"} folder.`, "Use --to downloads, --to desktop or --to with an existing folder.");
254143
254453
  }
@@ -254167,7 +254477,7 @@ async function deliverVideo(options) {
254167
254477
  const realSource = await realpath10(source2);
254168
254478
  for (let n2 = 1; n2 < 1e3; n2++) {
254169
254479
  const fileName = n2 === 1 ? `${stem2}${extension2.toLowerCase()}` : `${stem2} (${n2})${extension2.toLowerCase()}`;
254170
- const file3 = join41(folder, fileName);
254480
+ const file3 = join42(folder, fileName);
254171
254481
  if (file3 === realSource) continue;
254172
254482
  try {
254173
254483
  await copyExclusive(realSource, file3, info.size);
@@ -254238,6 +254548,7 @@ editorbrain courses list [--version X.Y.Z]
254238
254548
  editorbrain courses show ID [--version X.Y.Z]
254239
254549
  editorbrain courses skill ID [--path file] [--version X.Y.Z]
254240
254550
  editorbrain courses install ID [--dir folder | --global] [--agent codex|claude|gemini|both|all]
254551
+ editorbrain courses glance ID [ID ID] [--video render.mp4 --moments moments.json] [--lang es|en] [--dir folder] [--no-browser]
254241
254552
  editorbrain ads list
254242
254553
  editorbrain ads sheet [--brief text] [--lang es|en] [--category ID] [--ratio 1:1|4:5|9:16|16:9] [--ids id,id --detail]
254243
254554
  editorbrain ads install ID [--dir folder | --global] [--agent codex|claude|gemini|both|all]
@@ -254628,6 +254939,9 @@ function parseArgs(argv) {
254628
254939
  known.add("version");
254629
254940
  booleans.delete("version");
254630
254941
  }
254942
+ if (argv[0] === "courses" && argv[1] === "glance") {
254943
+ for (const flag3 of ["lang", "video", "moments"]) known.add(flag3);
254944
+ }
254631
254945
  if (argv[0] === "billing" && argv[1] === "prices") for (const flag3 of ["lang", "credits", "plan"]) known.add(flag3);
254632
254946
  if (argv[0] === "onboarding" && argv[1] === "choices") {
254633
254947
  known.add("new-brand");
@@ -254795,16 +255109,16 @@ function output2(value) {
254795
255109
  if (value && typeof value === "object" && "status" in value && value.status === "partial" && "synced" in value && value.synced === false) process.exitCode = 2;
254796
255110
  }
254797
255111
  async function configRoot(create = false) {
254798
- let path = process.env.EDITORBRAIN_CONFIG_DIR ?? process.env.EDITORHARNESS_CONFIG_DIR ?? join42(homedir11(), ".config", "editorbrain");
255112
+ let path = process.env.EDITORBRAIN_CONFIG_DIR ?? process.env.EDITORHARNESS_CONFIG_DIR ?? join43(homedir11(), ".config", "editorbrain");
254799
255113
  if (!create && !process.env.EDITORBRAIN_CONFIG_DIR && !process.env.EDITORHARNESS_CONFIG_DIR) {
254800
255114
  try {
254801
255115
  await lstat44(path);
254802
255116
  } catch (error62) {
254803
255117
  if (error62.code !== "ENOENT") throw error62;
254804
- path = join42(homedir11(), ".config", "editorharness");
255118
+ path = join43(homedir11(), ".config", "editorharness");
254805
255119
  }
254806
255120
  }
254807
- if (create) await mkdir39(path, { recursive: true, mode: 448 });
255121
+ if (create) await mkdir40(path, { recursive: true, mode: 448 });
254808
255122
  return ensureRoot(path);
254809
255123
  }
254810
255124
  async function loadConfig() {
@@ -254821,7 +255135,7 @@ async function loadConfig() {
254821
255135
  async function saveConfig(config3) {
254822
255136
  const root = await configRoot(true);
254823
255137
  await atomicWrite(root, "config.json", stableJson(config3), { document: false, mode: 384 });
254824
- await chmod8(join42(root, "config.json"), 384);
255138
+ await chmod8(join43(root, "config.json"), 384);
254825
255139
  }
254826
255140
  async function config2(args, requireKey = true) {
254827
255141
  const stored = await loadConfig();
@@ -255721,7 +256035,7 @@ ${plan.commands.map((c) => ` ${c}`).join("\n")}`)) });
255721
256035
  if (hookEnd !== void 0 && (!hookEnd.trim() || !Number.isFinite(Number(hookEnd)) || Number(hookEnd) < 0)) throw new Error("--hook-end must be nonnegative final seconds.");
255722
256036
  const credentials = projectId && !args.flags.offline ? await config2(args, false) : void 0;
255723
256037
  const context = projectId ? await prepareProductionContext(root2, projectId, credentials?.apiKey ? new Client(credentials) : void 0) : void 0;
255724
- output2(await mixEvents({ root: root2, voice: resolve34(root2, voice), manifest: await readProductionJson(root2, cues), manifestDirectory: dirname37(resolve34(root2, cues)), out, context, hookEndSeconds: hookEnd === void 0 ? void 0 : Number(hookEnd), ...str2(args, "plan") ? { plan: await readProductionJson(root2, str2(args, "plan")) } : {} }));
256038
+ output2(await mixEvents({ root: root2, voice: resolve34(root2, voice), manifest: await readProductionJson(root2, cues), manifestDirectory: dirname38(resolve34(root2, cues)), out, context, hookEndSeconds: hookEnd === void 0 ? void 0 : Number(hookEnd), ...str2(args, "plan") ? { plan: await readProductionJson(root2, str2(args, "plan")) } : {} }));
255725
256039
  return;
255726
256040
  }
255727
256041
  if (command === "production" && ["review-sheet", "matte", "matte-plan", "matte-engines", "matte-check"].includes(subcommand)) {
@@ -255754,8 +256068,8 @@ ${plan.commands.map((c) => ` ${c}`).join("\n")}`)) });
255754
256068
  if (argument || extra.length || !str2(args, "file") || !str2(args, "reference") || !str2(args, "out")) throw new CliError("INVALID_ARGUMENT", "Use production compare --file OUTPUT.mp4 --reference DEMO.mp4 --out .editorbrain-local/compare-1.", "Download the style demo first; --out is a new folder (a .png name becomes a folder of that name).");
255755
256069
  const root2 = await ensureRoot(str2(args, "dir") ?? process.cwd());
255756
256070
  const out = str2(args, "out").replace(/\.png$/i, ""), directory = await productionOutputPath(root2, out);
255757
- await mkdir39(dirname37(directory), { recursive: true, mode: 448 });
255758
- await mkdir39(directory, { mode: 448 });
256071
+ await mkdir40(dirname38(directory), { recursive: true, mode: 448 });
256072
+ await mkdir40(directory, { mode: 448 });
255759
256073
  const output_ = resolve34(root2, str2(args, "file")), reference = resolve34(root2, str2(args, "reference"));
255760
256074
  output2(await compareVideos({ output: output_, reference, outputProbe: await probeLocalMedia(output_), referenceProbe: await probeLocalMedia(reference), directory, ocr: !args.flags["no-ocr"], ocrLanguage: str2(args, "ocr-language") }));
255761
256075
  return;
@@ -255950,6 +256264,13 @@ ${plan.commands.map((c) => ` ${c}`).join("\n")}`)) });
255950
256264
  output2(await librarySheetRemote(new Client(await config2(args)), "/v1/viral-ads", { view: "sheet", brief: str2(args, "brief"), lang: str2(args, "lang"), category: str2(args, "category"), ratio: adsRatio(str2(args, "ratio")), ids: str2(args, "ids"), detail: args.flags.detail ? "full" : void 0 }, { library: "ads", alternative: "editorbrain ads list", list: "/v1/viral-ads" }));
255951
256265
  return;
255952
256266
  }
256267
+ if (command === "courses" && subcommand === "glance") {
256268
+ const ids2 = args.positional.slice(2);
256269
+ if (!ids2.length || Object.keys(args.flags).some((key) => !["video", "moments", "dir", "lang", "no-browser", "url"].includes(key)))
256270
+ throw new CliError("INVALID_ARGUMENT", "Use courses glance <id> [<id> <id>] [--video render.mp4 --moments moments.json] [--lang es|en] [--dir folder] [--no-browser].", "One id shows the format at a glance; two or three compare them. Writes a local page in the project folder.");
256271
+ output2(await runCourseGlance(new Client(await config2(args)), ids2, { video: str2(args, "video"), moments: str2(args, "moments"), dir: str2(args, "dir"), lang: str2(args, "lang"), browser: !args.flags["no-browser"] }));
256272
+ return;
256273
+ }
255953
256274
  if (command === "courses") {
255954
256275
  if (!["list", "show", "skill", "install"].includes(subcommand) || (subcommand === "list" ? argument : !argument) || args.positional.length > 3) throw new CliError("INVALID_ARGUMENT", "Use courses list, courses show <id>, courses skill <id> [--path file] or courses install <id>.", "Run editorbrain courses list for the ids.");
255955
256276
  const allowed = subcommand === "list" || subcommand === "show" ? ["version", "url"] : subcommand === "skill" ? ["version", "path", "url"] : ["version", "dir", "global", "agent", "url"];
@@ -256281,7 +256602,7 @@ ${plan.commands.map((c) => ` ${c}`).join("\n")}`)) });
256281
256602
  if (!/^[a-zA-Z0-9_-]{1,100}$/.test(result2.id) || typeof result2.apiKey !== "string") throw new Error("Invalid key response");
256282
256603
  const file3 = `keys/${result2.id}.json`;
256283
256604
  await atomicWrite(root2, file3, stableJson({ url: client.url, apiKey: result2.apiKey, id: result2.id, label: label3, role: role2 }), { document: false, mode: 384, overwrite: false });
256284
- output2({ id: result2.id, label: label3, role: role2, credentialFile: join42(root2, file3) });
256605
+ output2({ id: result2.id, label: label3, role: role2, credentialFile: join43(root2, file3) });
256285
256606
  return;
256286
256607
  }
256287
256608
  if (subcommand === "revoke" && argument) {
@@ -256501,7 +256822,7 @@ ${plan.commands.map((c) => ` ${c}`).join("\n")}`)) });
256501
256822
  if (subcommand === "download" && argument && str2(args, "out")) {
256502
256823
  if (!/^[a-f0-9]{64}$/.test(argument)) throw new Error("Asset ID must be its SHA-256");
256503
256824
  const destination = resolve34(str2(args, "dir") ?? process.cwd(), str2(args, "out"));
256504
- const root2 = await ensureRoot(dirname37(destination), true);
256825
+ const root2 = await ensureRoot(dirname38(destination), true);
256505
256826
  await checkedPath(root2, basename14(destination), false);
256506
256827
  const response = await client.media(`/v1/assets/${argument}`);
256507
256828
  const bytes = new Uint8Array(await response.arrayBuffer());
@@ -256728,7 +257049,7 @@ ${plan.commands.map((c) => ` ${c}`).join("\n")}`)) });
256728
257049
  const hash16 = str2(args, "sha256");
256729
257050
  if (!hash16 || !/^[a-f0-9]{64}$/.test(hash16)) throw new Error("--sha256 must be a media SHA-256 from library get.");
256730
257051
  const destination = resolve34(str2(args, "dir") ?? process.cwd(), str2(args, "out"));
256731
- const root2 = await ensureRoot(dirname37(destination), true);
257052
+ const root2 = await ensureRoot(dirname38(destination), true);
256732
257053
  await checkedPath(root2, basename14(destination), false);
256733
257054
  const response = await client.media(`/v1/library/${encodeURIComponent(argument)}/media/${hash16}`);
256734
257055
  const reader = response.body?.getReader();