xvai-loi 0.1.71 → 0.1.72

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.
Files changed (3) hide show
  1. package/co.txt +1 -1
  2. package/package.json +1 -1
  3. package/xvai-loi.js +10 -3
package/co.txt CHANGED
@@ -1 +1 @@
1
- xvaiLoi111747
1
+ xvaiLoi111816
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xvai-loi",
3
- "version": "0.1.71",
3
+ "version": "0.1.72",
4
4
  "description": "Loi dung video (Edit Video Tu Dong) nap vao tool Google Flow qua o cam engine/oCam.ts",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
package/xvai-loi.js CHANGED
@@ -9854,6 +9854,13 @@ function lapAnhTheoKhuon(kb, ws, K = KHUON_TOPN, toiDa = 12) {
9854
9854
  (c) => c && c.tu && /^(anh|ds)$/.test(String(c.kieu))
9855
9855
  /* 'so' vẽ thành chữ to trên người / ô tròn (cut/tron) — không phải trám */
9856
9856
  ).map((c) => timTu(c.tu)).filter((i) => i >= 0).map((i) => W4[i].t0).filter((t) => t > t0 && t < t1).sort((a, b) => a - b);
9857
+ let noi2 = 0;
9858
+ for (let i = 0; i < W4.length; i++) {
9859
+ if (W4[i].t0 < t0 || W4[i].t1 > t1) continue;
9860
+ noi2 += W4[i].t1 - W4[i].t0 + (i + 1 < W4.length ? Math.min(0.4, Math.max(0, W4[i + 1].t0 - W4[i].t1)) : 0);
9861
+ }
9862
+ const mocDu = kb.canh.filter((c) => c && c.tu && /^(anh|ds|vat)$/.test(String(c.kieu))).map((c) => timTu(c.tu)).filter((i) => i >= 0 && W4[i].t0 > t0 && W4[i].t0 < t1).length;
9863
+ if (mocDu / Math.max(1e-6, noi2 / 60) >= 0.9 * K.tram.phut) return 0;
9857
9864
  const pts = [t0, ...moc, t1];
9858
9865
  let them = 0;
9859
9866
  for (let k = 0; k + 1 < pts.length && them < toiDa; k++) {
@@ -18555,7 +18562,7 @@ async function napVideo(b, bao) {
18555
18562
 
18556
18563
  // flow-src/engine/taiSanAI.ts
18557
18564
  var NEN = ", isolated on a plain flat light grey studio background, soft even light, no shadow on background, no text, no watermark, photorealistic";
18558
- var ANH = (x) => "Cinematic photorealistic vertical photo, " + x + ", Vietnamese people and setting, natural light, shallow depth of field, rich detail, no text, no watermark, no logo";
18565
+ var ANH = (x, i = 0) => "Cinematic photorealistic vertical photo, " + x + (i % 2 || /no faces/i.test(x) ? ", Vietnamese setting, close-up of objects, hands or place, no faces" : ", Vietnamese people and setting") + ", natural light, shallow depth of field, rich detail, no text, no watermark, no logo";
18559
18566
  var V3D = (x) => "A single glossy 3D render of " + x + ", bold shapes, warm orange and white palette, soft studio light" + NEN;
18560
18567
  var ICON = (x) => "A single glossy 3D icon of " + x + ", premium app-icon style, smooth plastic and metal materials, vivid but tasteful colors, soft studio lighting, subtle reflection, centered, isolated" + NEN;
18561
18568
  var ICON3D = [["xu", "a shiny gold coin with a dollar sign"], ["dongho", "a modern round alarm clock"], ["canh", "a yellow warning triangle with an exclamation mark"], ["tich", "a green rounded check mark badge"], ["sao", "a golden star"], ["tim", "a glossy red heart"], ["bieu", "a rising bar chart with an upward arrow"], ["lua", "a glowing orange fire flame"], ["tenlua", "a small white and red rocket launching upward"], ["bongden", "a glowing yellow light bulb"], ["qua", "a red gift box with a gold ribbon"], ["giohang", "a shopping cart"], ["nha", "a small modern house"], ["sach", "an open book"], ["dienthoai", "a modern smartphone"], ["cup", "a golden trophy cup"], ["khien", "a blue shield with a white check mark"], ["la", "a fresh green leaf"], ["giot", "a clear blue water drop"], ["kinhlup", "a magnifying glass"], ["sai", "a red cross X mark badge"]];
@@ -18702,7 +18709,7 @@ function dsTaiSan(kieu, kb) {
18702
18709
  return 20;
18703
18710
  }
18704
18711
  })();
18705
- (kb?.canh || []).filter((c) => c && c.tu && c.en && (c.kieu === "anh" || c.kieu === "vat")).slice(0, TRAN_ANH).forEach((c) => ds2.push([c.kieu + ":" + String(c.tu).toLocaleLowerCase("vi"), c.kieu === "anh" ? ANH(String(c.en).slice(0, 220)) : V3D(String(c.en).slice(0, 120)), c.kieu === "anh" ? "9:16" : "1:1"]));
18712
+ (kb?.canh || []).filter((c) => c && c.tu && c.en && (c.kieu === "anh" || c.kieu === "vat")).slice(0, TRAN_ANH).forEach((c, i) => ds2.push([c.kieu + ":" + String(c.tu).toLocaleLowerCase("vi"), c.kieu === "anh" ? ANH(String(c.en).slice(0, 220), i) : V3D(String(c.en).slice(0, 120)), c.kieu === "anh" ? "9:16" : "1:1"]));
18706
18713
  ICON3D.forEach(([k, v]) => ds2.push(["st3d:" + k, ICON(v), "1:1"]));
18707
18714
  return ds2;
18708
18715
  }
@@ -20736,7 +20743,7 @@ function datCauLenh(a) {
20736
20743
  on2 = true;
20737
20744
  window.addEventListener("message", async (ev) => {
20738
20745
  const d = ev.data;
20739
- if (!d || d.xvaiLoi111747 !== true) return;
20746
+ if (!d || d.xvaiLoi111816 !== true) return;
20740
20747
  const o = String(ev.origin || "");
20741
20748
  if (!(o.indexOf("https://flow.google.com") === 0 || o.indexOf("https://labs.google") === 0)) return;
20742
20749
  const tra = (kq) => {