xvai-loi 0.1.76 → 0.1.77

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 +31 -8
package/co.txt CHANGED
@@ -1 +1 @@
1
- xvaiLoi112057
1
+ xvaiLoi112314
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xvai-loi",
3
- "version": "0.1.76",
3
+ "version": "0.1.77",
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
@@ -6037,7 +6037,7 @@ function catNen(im, buoc = 7, tol = 40) {
6037
6037
  return o;
6038
6038
  }
6039
6039
  var ts = /* @__PURE__ */ new Map();
6040
- var dsTenTaiSan = () => [...ts.keys()].filter((k) => /^(trang|anh|vat|story|logo):|\.(png|jpg)$/i.test(k)).sort();
6040
+ var dsTenTaiSan = () => [...ts.keys(), ...globalThis.__dsTaiSanThu?.() || []].filter((k) => /^(trang|anh|vat|story|logo):|\.(png|jpg)$/i.test(k)).sort();
6041
6041
  var moTaTaiSan = () => [...ts.entries()].filter(([, v]) => v).map(([k, v]) => [k, v.laVideo ? 1 : 0, +(v.dai || 0), v.width || 0, v.height || 0]);
6042
6042
  var taiSan = (ten) => ten ? ts.get(ten) || globalThis.__taiSanThu?.(ten) || null : null;
6043
6043
  var nhanTaiSan = (ten, im) => {
@@ -9824,9 +9824,12 @@ var KHUON_TOPN = {
9824
9824
  // cảnh trám / phút, % thời lượng, 3 phần đầu/giữa/cuối, độ dài trung vị (s), tỉ lệ clip động; nhanVat: xen kẽ ảnh có người / cận vật-tay-nơi (đối thủ trộn web, stock, 3D — B06-1027: toàn ảnh người → 'không thấy mặt' 12 % < 15)
9825
9825
  chu: { phut: [8, 18] },
9826
9826
  icon: { phut: 11.5 },
9827
- cat: { moi10s: [4, 6] },
9827
+ cat: { moi10s: [4, 6], manhNguoi: 1.2 },
9828
+ // manhNguoi: mẩu người nói kẹp giữa 2 cảnh ngắn hơn thì lấp (trước 0,6 — VD-236)
9828
9829
  nguoi: { phongToiDa: 1.8, matToiDa: 0.55 },
9829
9830
  // matToiDa: hộp đầu (tóc→cằm) cao hơn 0,55 H thì KHÔNG dùng ô người / chia (không vừa ô) // MỌI ô người (PIP, thẻ, chia) phóng khung gốc tối đa 1,8× (độ nét) — trước: PIP 1,6, thẻ 1,3 (B05-1027: thẻ hiện cả người nhỏ)
9831
+ lietKe: { xenKe: 2 },
9832
+ // video liệt kê: cứ thẻ bước thứ 2 → ảnh toàn khung + tiêu đề (đối thủ đổi kiểu, không lặp 1 khuôn thẻ)
9830
9833
  soTrenAnh: { phanDau: 1 / 3, toiDa: 2 },
9831
9834
  // cảnh CON SỐ ở 1/3 đầu → số đè lên ẢNH minh hoạ (đối thủ 1/3 đầu 83 % trám; số trên người nói không tính trám)
9832
9835
  bien: { dau: 1.5, cuoi: 2.5, ctaAnh: true }
@@ -12879,7 +12882,7 @@ function lapCuongMe(o) {
12879
12882
  }
12880
12883
  }
12881
12884
  {
12882
- const nt = (x) => String(x || "").replace(/\s+/g, " ").trim().toLocaleLowerCase("vi");
12885
+ const SOC = { "m\u1ED9t": "1", "hai": "2", "ba": "3", "b\u1ED1n": "4", "n\u0103m": "5", "s\xE1u": "6", "b\u1EA3y": "7", "t\xE1m": "8", "ch\xEDn": "9", "m\u01B0\u1EDDi": "10" }, nt = (x) => String(x || "").normalize("NFC").replace(/\s+/g, " ").trim().toLocaleLowerCase("vi").split(" ").map((w) => SOC[w] ?? w).join(" ");
12883
12886
  sp.sort((p, q) => p.f - q.f);
12884
12887
  for (let i = sp.length - 1; i > 0; i--) {
12885
12888
  const x = sp[i];
@@ -12908,7 +12911,7 @@ function lapCuongMe(o) {
12908
12911
  const ch = sp.filter((x) => x.bo !== "phong");
12909
12912
  for (let i = 0; i + 1 < ch.length; i++) {
12910
12913
  const x = ch[i], y = ch[i + 1], g = y.f - (x.f + x.d);
12911
- if (g > 0.02 && g < 0.6 && !x.khoa) {
12914
+ if (g > 0.02 && g < +(globalThis.__manhNguoi ?? KHUON_TOPN.cat.manhNguoi) && !x.khoa) {
12912
12915
  ghiL("doi", x, "VD-236 lap khe mat " + g.toFixed(2) + " s");
12913
12916
  x.d = +(y.f - x.f).toFixed(2);
12914
12917
  nL++;
@@ -12935,6 +12938,20 @@ function lapCuongMe(o) {
12935
12938
  daTren.add(ten2);
12936
12939
  }
12937
12940
  });
12941
+ {
12942
+ let n2 = 0;
12943
+ the2.forEach((s) => {
12944
+ if (s.so == null || !s.anhTren || s.ui || s.doc) return;
12945
+ const XK = +(globalThis.__lkXenKe ?? KHUON_TOPN.lietKe.xenKe);
12946
+ if (!(XK > 0) || n2++ % XK !== XK - 1) return;
12947
+ s.bo = "anh";
12948
+ s.ten = s.anhTren;
12949
+ s.chu = s.tieu;
12950
+ s.chu2 = "";
12951
+ s.theAnh = 1;
12952
+ ghiL("doi", s, "khuon liet ke: the buoc " + s.so + " \u2192 anh toan khung + tieu de (xen ke " + KHUON_TOPN.lietKe.xenKe + ")");
12953
+ });
12954
+ }
12938
12955
  }
12939
12956
  G4.__lichSp = sp.map((s, i) => ({ i, id: s.id, yChu: s.yChu, coChu: s.coChu, fx: s.fx, stX: s.stX, stY: s.stY, f: +s.f.toFixed(2), d: +s.d.toFixed(2), bo: s.bo, giant: s.giant || "", chu: s.chu || "", chu2: s.chu2 || "", st: s.st || "", ten: s.ten || "", tieu: s.tieu || "", khoa: s.khoa ? 1 : 0 }));
12940
12957
  }
@@ -12950,9 +12967,10 @@ function lapCuongMe(o) {
12950
12967
  const cc = sp.filter((x) => x.bo !== "phong").sort((p, q) => p.f - q.f);
12951
12968
  for (let i = 0; i + 1 < cc.length; i++) {
12952
12969
  const x = cc[i], y = cc[i + 1];
12953
- if (x.f + x.d > y.f - 0.06 && y.f > x.f + 0.3 && !x.khoa) {
12954
- ghiL("doi", x, "N8: cat duoi " + (x.f + x.d - y.f + 0.06).toFixed(2) + " s chong canh sau (2 chu cung hien)");
12955
- x.d = +(y.f - x.f - 0.06).toFixed(2);
12970
+ const coChu = (z) => !!String(z.giant || z.chu || z.tieu || "").trim(), he = coChu(x) && coChu(y) ? 0.06 : 0;
12971
+ if (x.f + x.d > y.f - he && y.f > x.f + 0.3 && !x.khoa) {
12972
+ if (he) ghiL("doi", x, "N8: cat duoi " + (x.f + x.d - y.f + he).toFixed(2) + " s chong canh sau (2 chu cung hien)");
12973
+ x.d = +(y.f - x.f - he).toFixed(2);
12956
12974
  }
12957
12975
  }
12958
12976
  }
@@ -19035,6 +19053,11 @@ async function handleExport(currentProject, setExporting, setExportedBlob, addLo
19035
19053
  });
19036
19054
  } catch (e) {
19037
19055
  }
19056
+ try {
19057
+ const G3 = globalThis;
19058
+ if (G3.__kbNguon === "loi") window.__canhBaoAI = /hạn mức|quota|limit/i.test(String(G3.__kbLoi || "")) ? "AI c\u1EE7a Flow \u0111\xE3 h\u1EBFt h\u1EA1n m\u1EE9c h\xF4m nay \u2014 b\u1EA3n n\xE0y d\u1EF1ng kh\xF4ng c\xF3 k\u1ECBch b\u1EA3n AI (\xEDt c\u1EA3nh minh ho\u1EA1). Th\u1EED l\u1EA1i ng\xE0y mai \u0111\u1EC3 c\xF3 b\u1EA3n \u0111\u1EA7y \u0111\u1EE7." : "AI so\u1EA1n k\u1ECBch b\u1EA3n l\u1ED7i (" + String(G3.__kbLoi || "").slice(0, 60) + ") \u2014 b\u1EA3n d\u1EF1ng \u0111\u01A1n gi\u1EA3n. B\u1EA5m L\xE0m pro l\u1EA1i \u0111\u1EC3 th\u1EED l\u1EA7n n\u1EEFa.";
19059
+ } catch (e) {
19060
+ }
19038
19061
  try {
19039
19062
  window.__anhBu = lapAnhTheoKhuon(kb, window.__wsGocKB || currentProject.speechDraft?.analysis?.words || []);
19040
19063
  } catch (e) {
@@ -20816,7 +20839,7 @@ function datCauLenh(a) {
20816
20839
  on2 = true;
20817
20840
  window.addEventListener("message", async (ev) => {
20818
20841
  const d = ev.data;
20819
- if (!d || d.xvaiLoi112057 !== true) return;
20842
+ if (!d || d.xvaiLoi112314 !== true) return;
20820
20843
  const o = String(ev.origin || "");
20821
20844
  if (!(o.indexOf("https://flow.google.com") === 0 || o.indexOf("https://labs.google") === 0)) return;
20822
20845
  const tra = (kq) => {