/* @ds-bundle: {"format":3,"namespace":"HoaMTTrIDesignSystem_847102","components":[],"sourceHashes":{"ui_kits/management-hub-v2/app.js":"3298ac5f4260","ui_kits/management-hub-v2/data.js":"b82a2da67124","ui_kits/management-hub-v2/helpers.js":"9abda399bda0","ui_kits/management-hub-v2/icons.js":"e16a6b65cc30","ui_kits/management-hub-v2/views-approval.js":"d887c5bd1f09","ui_kits/management-hub-v2/views-extra.js":"60dd23f9a270","ui_kits/management-hub-v2/views-overview.js":"b2dea6fb66fd","ui_kits/management-hub/ApprovalQueue.jsx":"c45d21c61568","ui_kits/management-hub/Finance.jsx":"fc8cdba4b42b","ui_kits/management-hub/Overview.jsx":"da76d92c09f6","ui_kits/management-hub/Students.jsx":"f3da4988d8f5","ui_kits/management-hub/app.jsx":"3019e30f8668","ui_kits/management-hub/components.jsx":"0410f1fec08e","ui_kits/management-hub/data.jsx":"5741f68ad25d"},"inlinedExternals":[],"unexposedExports":[]} */

(() => {

const __ds_ns = (window.HoaMTTrIDesignSystem_847102 = window.HoaMTTrIDesignSystem_847102 || {});

const __ds_scope = {};

(__ds_ns.__errors = __ds_ns.__errors || []);

// ui_kits/management-hub-v2/app.js
try { (() => {
/* ============================================================
   App controller — state, routing, interactions, overlays
   ============================================================ */
var HUB = {
  state: {
    area: "overview",
    ovOpt: "a",
    openBundle: null,
    apprFilter: "all",
    finTab: "overview",
    bundles: BUNDLES.map(function (b) {
      return Object.assign({}, b);
    }),
    contributions: CONTRIBUTIONS.map(function (c) {
      return Object.assign({}, c);
    }),
    students: STUDENTS.map(function (s) {
      return Object.assign({}, s);
    })
  }
};
var AREA_LABEL = {
  overview: "Tổng quan",
  activities: "Hoạt động",
  survey: "Khảo sát",
  students: "Quản lý học sinh",
  content: "Kế hoạch nội dung",
  approval: "Hàng đợi duyệt",
  social: "Hiện diện xã hội",
  finance: "Tài trợ & tài chính"
};
function renderArea() {
  var a = HUB.state.area,
    html;
  if (a === "overview") html = renderOverview();else if (a === "approval") html = renderApproval();else if (a === "finance") html = renderFinance();else if (a === "students") html = renderStudents();else html = renderStub(a);
  var view = document.getElementById("view");
  view.innerHTML = "<div class='area is-active'>" + html + "</div>";
  paintIcons(view);
  if (a === "overview") applyOvOpt();
  window.scrollTo(0, 0);
}
function go(area) {
  if (!AREA_LABEL[area]) return;
  HUB.state.area = area;
  if (area !== "approval") HUB.state.openBundle = null;
  // active nav
  document.querySelectorAll(".nav-item[data-area]").forEach(function (n) {
    n.classList.toggle("is-active", n.getAttribute("data-area") === area);
  });
  var label = AREA_LABEL[area];
  document.getElementById("tbArea").textContent = label;
  document.getElementById("tbPage").textContent = label;
  closeMobileNav();
  renderArea();
}
function applyOvOpt() {
  var opt = HUB.state.ovOpt;
  document.querySelectorAll(".opt[data-opt]").forEach(function (o) {
    o.classList.toggle("is-active", o.getAttribute("data-opt") === opt);
  });
  document.querySelectorAll('[data-seg="ov"] button').forEach(function (b) {
    b.classList.toggle("is-active", b.getAttribute("data-opt") === opt);
  });
}

/* ---------- Mobile nav ---------- */
function openMobileNav() {
  document.getElementById("sidebar").classList.add("is-open");
  document.getElementById("scrim").classList.add("is-open");
}
function closeMobileNav() {
  document.getElementById("sidebar").classList.remove("is-open");
  document.getElementById("scrim").classList.remove("is-open");
}

/* ---------- Toasts ---------- */
function toast(msg, kind) {
  kind = kind || "ok";
  var stack = document.getElementById("toastStack");
  var el = document.createElement("div");
  el.className = "toast" + (kind === "ok" ? " toast--ok" : kind === "warn" ? " toast--warn" : "");
  var icn = kind === "ok" ? "check" : kind === "warn" ? "alert-triangle" : "info";
  el.innerHTML = ic(icn, 18) + "<span>" + esc(msg) + "</span><button class='toast__close'>" + ic("x", 16) + "</button>";
  stack.appendChild(el);
  paintIcons(el);
  var kill = function () {
    if (el.parentNode) el.parentNode.removeChild(el);
  };
  el.querySelector(".toast__close").addEventListener("click", kill);
  setTimeout(kill, 3800);
}

/* ---------- Overlays (modal) ---------- */
function openModal(opts) {
  var mount = document.getElementById("overlayMount");
  var foot = opts.foot ? '<div class="modal__foot">' + opts.foot + "</div>" : "";
  mount.innerHTML = '<div class="overlay" id="ov"><div class="modal" style="' + (opts.width ? "max-width:" + opts.width + "px" : "") + '">' + '<div class="modal__head"><div><h3>' + opts.title + "</h3>" + (opts.meta ? '<div class="card__title-meta">' + opts.meta + "</div>" : "") + "</div>" + '<button class="icon-btn" data-closeov>' + ic("x", 18) + "</button></div>" + '<div class="modal__body">' + opts.body + "</div>" + foot + "</div></div>";
  paintIcons(mount);
  var ov = document.getElementById("ov");
  requestAnimationFrame(function () {
    ov.classList.add("is-open");
  });
  ov.addEventListener("click", function (e) {
    if (e.target === ov || e.target.closest("[data-closeov]")) closeOverlay();
  });
  if (opts.onMount) opts.onMount(ov);
  return ov;
}
function openDrawer(opts) {
  var mount = document.getElementById("overlayMount");
  var foot = opts.foot ? '<div class="drawer__foot">' + opts.foot + "</div>" : "";
  mount.innerHTML = '<div class="drawer-overlay" id="dov"></div>' + '<aside class="drawer" id="drw"><div class="drawer__head"><h3>' + opts.title + "</h3>" + '<button class="icon-btn" data-closeov>' + ic("x", 18) + "</button></div>" + '<div class="drawer__body">' + opts.body + "</div>" + foot + "</aside>";
  paintIcons(mount);
  var dov = document.getElementById("dov"),
    drw = document.getElementById("drw");
  requestAnimationFrame(function () {
    dov.classList.add("is-open");
    drw.classList.add("is-open");
  });
  dov.addEventListener("click", closeOverlay);
  mount.querySelectorAll("[data-closeov]").forEach(function (b) {
    b.addEventListener("click", closeOverlay);
  });
  if (opts.onMount) opts.onMount(drw);
  return drw;
}
function closeOverlay() {
  var mount = document.getElementById("overlayMount");
  var ov = mount.querySelector(".overlay, .drawer-overlay");
  var drw = mount.querySelector(".drawer");
  if (ov) ov.classList.remove("is-open");
  if (drw) drw.classList.remove("is-open");
  setTimeout(function () {
    mount.innerHTML = "";
  }, 240);
}
document.addEventListener("keydown", function (e) {
  if (e.key === "Escape") closeOverlay();
});

/* ---------- Domain actions ---------- */
function getBundle(id) {
  return HUB.state.bundles.find(function (b) {
    return b.id === id;
  });
}
function getContribution(id) {
  return HUB.state.contributions.find(function (c) {
    return c.id === id;
  });
}
function approveBundle(id) {
  var b = getBundle(id);
  if (!b) return;
  b.status = "appr";
  b.note = null;
  HUB.state.openBundle = null;
  toast("Đã duyệt — bài sẵn sàng đăng.", "ok");
  renderArea();
}
function rejectModal(id) {
  var b = getBundle(id);
  openModal({
    title: "Từ chối bài đăng",
    meta: esc(b.title),
    body: '<div class="field" style="margin-bottom:0"><label>Lý do từ chối</label>' + '<textarea class="textarea" id="noteInput" placeholder="Nêu lý do để lưu lại và thông báo cho cộng tác viên…"></textarea></div>',
    foot: '<button class="btn btn--ghost" data-closeov>Huỷ</button>' + '<button class="btn btn--danger" id="confirmReject">' + ic("x", 16) + " Xác nhận từ chối</button>",
    onMount: function (ov) {
      var ta = ov.querySelector("#noteInput");
      ta.focus();
      ov.querySelector("#confirmReject").addEventListener("click", function () {
        var v = ta.value.trim();
        if (!v) return;
        b.status = "rej";
        b.note = v;
        HUB.state.openBundle = null;
        closeOverlay();
        toast("Đã từ chối và gửi ghi chú.", "warn");
        renderArea();
      });
    }
  });
}
function changesModal(id) {
  var b = getBundle(id);
  openModal({
    title: "Yêu cầu sửa",
    meta: esc(b.title),
    body: '<div class="field" style="margin-bottom:0"><label>Nội dung cần sửa</label>' + '<textarea class="textarea" id="noteInput" placeholder="Mô tả rõ điều cần chỉnh để cộng tác viên nắm được…">' + esc(b.note || "") + "</textarea>" + '<div class="field__hint">Ghi chú sẽ hiện trên thẻ hàng đợi dưới dạng “Cần sửa: …”.</div></div>',
    foot: '<button class="btn btn--ghost" data-closeov>Huỷ</button>' + '<button class="btn btn--primary" id="confirmChanges">Gửi yêu cầu sửa</button>',
    onMount: function (ov) {
      var ta = ov.querySelector("#noteInput");
      ta.focus();
      ov.querySelector("#confirmChanges").addEventListener("click", function () {
        var v = ta.value.trim();
        if (!v) return;
        b.status = "rev";
        b.note = v;
        HUB.state.openBundle = null;
        closeOverlay();
        toast("Đã gửi yêu cầu sửa.", "warn");
        renderArea();
      });
    }
  });
}
function editCaption(b) {
  var box = document.getElementById("fbCaption");
  box.innerHTML = '<div class="fb-edit"><textarea class="textarea" id="capEdit">' + esc(b.caption) + "</textarea>" + '<div class="btn-row" style="margin-top:8px"><button class="btn btn--primary btn--sm" id="capSave">Lưu caption</button>' + '<button class="btn btn--ghost btn--sm" id="capCancel">Huỷ</button></div></div>';
  var ta = box.querySelector("#capEdit");
  ta.focus();
  box.querySelector("#capSave").addEventListener("click", function () {
    b.caption = ta.value;
    renderArea();
    toast("Đã lưu caption.", "ok");
  });
  box.querySelector("#capCancel").addEventListener("click", function () {
    box.innerHTML = renderCaption(b);
    paintIcons(box);
  });
}
function composeThanks(id) {
  var c = getContribution(id);
  var firstName = c.donor.split(" ").slice(-1).join(" ");
  var draft = "Kính gửi " + c.donor + ",\n\nQuỹ Hoa Mặt Trời xin chân thành cảm ơn tấm lòng của " + firstName + " đã đồng hành cùng các em học sinh. Món quà của " + firstName + " sẽ được trao tận tay tới những hoàn cảnh cần nhất.\n\nTrân trọng,\nQuỹ Hoa Mặt Trời 🌻";
  openModal({
    title: "Soạn lời cảm ơn",
    meta: "Gửi tới: " + esc(c.donor) + " · " + fmtVnd(c.amount),
    body: '<div class="field" style="margin-bottom:0"><label>Nội dung lời cảm ơn</label>' + '<textarea class="textarea" id="thankDraft" style="min-height:170px">' + esc(draft) + "</textarea>" + '<div class="field__hint">Có thể đính kèm biên nhận sau khi gửi.</div></div>',
    foot: '<button class="btn btn--ghost" data-closeov>Huỷ</button>' + '<button class="btn btn--teal" id="sendThanks">' + ic("send", 16) + " Gửi &amp; đánh dấu đã cảm ơn</button>",
    onMount: function (ov) {
      ov.querySelector("#sendThanks").addEventListener("click", function () {
        c.thanked = true;
        closeOverlay();
        toast("Đã gửi lời cảm ơn tới " + c.donor + ".", "ok");
        renderArea();
      });
    }
  });
}
function studentDrawer(id) {
  var s = HUB.state.students.find(function (x) {
    return x.id === id;
  });
  var initial = s.name.split(" ").slice(-1)[0][0];
  var watchBanner = s.watch ? '<div class="banner banner--warn" style="margin:0">' + ic("alert-circle", 18) + '<div class="banner__body">Học sinh đang trong danh sách <b>cần theo dõi</b>.</div></div>' : "";
  openDrawer({
    title: esc(s.name),
    body: '<div class="stack gap4">' + '<div class="row gap3"><div class="avatar" style="width:54px;height:54px;font-size:21px">' + initial + "</div>" + '<div><div style="font-weight:700;color:var(--navy);font-size:18px">' + esc(s.name) + "</div>" + '<div class="td-meta">' + esc(s.grade) + " · " + esc(s.school) + "</div></div></div>" + watchBanner + '<div class="card"><div class="card__body stack gap2">' + '<div class="kv2"><span>Chương trình</span><b>' + esc(s.program) + "</b></div>" + '<div class="kv2"><span>Tham gia từ</span><b>' + esc(s.since) + "</b></div>" + '<div class="kv2"><span>Trạng thái</span><b>' + esc(s.status) + "</b></div>" + "</div></div>" + '<div><div class="eyebrow" style="margin-bottom:10px">Dòng thời gian chăm sóc</div>' + '<div class="stack gap3">' + '<div class="tl"><span class="tl-dot"></span><div><b>Nhận học bổng kỳ II</b><div class="td-meta">12/2024 · Học bổng Mặt Trời</div></div></div>' + '<div class="tl"><span class="tl-dot"></span><div><b>Thăm gia đình</b><div class="td-meta">10/2024 · ghi chú quyền lợi</div></div></div>' + "</div></div>" + "</div>",
    foot: '<button class="btn btn--secondary" id="addNote">' + ic("file-plus", 16) + " Thêm ghi chú</button>" + (s.watch ? '<button class="btn btn--danger right" id="safety">' + ic("alert-triangle", 16) + " Báo cáo an toàn</button>" : ""),
    onMount: function (drw) {
      drw.querySelector("#addNote").addEventListener("click", function () {
        closeOverlay();
        setTimeout(addNoteDrawer, 250);
      });
      var sf = drw.querySelector("#safety");
      if (sf) sf.addEventListener("click", function () {
        toast("Đã chuyển cảnh báo an toàn cho phụ trách.", "warn");
      });
    }
  });
}
function addNoteDrawer() {
  openDrawer({
    title: "Thêm ghi chú chăm sóc",
    body: '<div class="field"><label>Loại ghi chú</label><select class="select"><option>Quyền lợi</option><option>Học tập</option><option>Cảnh báo an toàn</option></select></div>' + '<div class="field" style="margin-bottom:0"><label>Nội dung</label><textarea class="textarea" id="noteBody" placeholder="Nhập ghi chú… giữ tôn trọng và khách quan."></textarea></div>',
    foot: '<button class="btn btn--ghost" data-closeov>Huỷ</button>' + '<button class="btn btn--primary right" id="saveNote">Lưu ghi chú</button>',
    onMount: function (drw) {
      var ta = drw.querySelector("#noteBody");
      ta.focus();
      drw.querySelector("#saveNote").addEventListener("click", function () {
        if (!ta.value.trim()) return;
        closeOverlay();
        toast("Đã lưu ghi chú cho hồ sơ.", "ok");
      });
    }
  });
}

/* ---------- Global event delegation ---------- */
document.addEventListener("click", function (e) {
  var t = e.target;
  var el;
  if (el = t.closest("[data-area]")) {
    e.preventDefault();
    go(el.getAttribute("data-area"));
    return;
  }
  if (el = t.closest("[data-nav]")) {
    e.preventDefault();
    go(el.getAttribute("data-nav"));
    return;
  }
  if (el = t.closest("[data-seg] button")) {
    HUB.state.ovOpt = el.getAttribute("data-opt");
    applyOvOpt();
    return;
  }
  if (el = t.closest("[data-open]")) {
    e.preventDefault();
    HUB.state.openBundle = el.getAttribute("data-open");
    HUB.state.area = "approval";
    renderArea();
    return;
  }
  if (el = t.closest("[data-click]")) {
    e.preventDefault();
    if (el.getAttribute("data-click") === "backQueue") {
      HUB.state.openBundle = null;
      renderArea();
    }
    return;
  }
  if (el = t.closest("[data-filter]")) {
    HUB.state.apprFilter = el.getAttribute("data-filter");
    renderArea();
    return;
  }
  if (el = t.closest("[data-fintab]")) {
    e.preventDefault();
    HUB.state.finTab = el.getAttribute("data-fintab");
    renderArea();
    return;
  }
  if (el = t.closest("[data-action]")) {
    e.preventDefault();
    var a = ACTIONS[+el.getAttribute("data-action")];
    if (a.bundle) {
      HUB.state.openBundle = a.bundle;
      HUB.state.area = "approval";
      go("approval");
    } else go(a.to);
    return;
  }
  if (el = t.closest("[data-modal]")) {
    var m = el.getAttribute("data-modal"),
      id = HUB.state.openBundle;
    if (m === "reject") rejectModal(id);else if (m === "changes") changesModal(id);
    return;
  }
  if (el = t.closest("[data-approve]")) {
    approveBundle(el.getAttribute("data-approve"));
    return;
  }
  if (el = t.closest("[data-editcap]")) {
    e.preventDefault();
    editCaption(getBundle(HUB.state.openBundle));
    return;
  }
  if (el = t.closest("[data-thank]")) {
    composeThanks(el.getAttribute("data-thank"));
    return;
  }
  if (el = t.closest("[data-marksent]")) {
    var c = getContribution(el.getAttribute("data-marksent"));
    c.thanked = true;
    toast("Đã đánh dấu đã cảm ơn " + c.donor + ".", "ok");
    renderArea();
    return;
  }
  if (el = t.closest("[data-student]")) {
    e.preventDefault();
    studentDrawer(el.getAttribute("data-student"));
    return;
  }
});

/* dignity gate */
document.addEventListener("change", function (e) {
  if (e.target.id === "dignity") {
    var btn = document.getElementById("approveBtn");
    var hint = document.getElementById("gateHint");
    if (btn) btn.disabled = !e.target.checked;
    if (hint) hint.style.display = e.target.checked ? "none" : "";
  }
});

/* shell chrome */
document.getElementById("hamburger").addEventListener("click", openMobileNav);
document.getElementById("scrim").addEventListener("click", closeMobileNav);
document.getElementById("logout").addEventListener("click", function (e) {
  e.preventDefault();
  toast("Đây là bản minh hoạ — chưa đăng xuất thật.", "info");
});

/* boot */
renderArea();
})(); } catch (e) { __ds_ns.__errors.push({ path: "ui_kits/management-hub-v2/app.js", error: String((e && e.message) || e) }); }

// ui_kits/management-hub-v2/data.js
try { (() => {
/* ============================================================
   HMT Management Hub — mock data (vanilla)
   ============================================================ */
var STATUS = {
  wait: {
    cls: "pill--wait",
    label: "chờ upload"
  },
  proc: {
    cls: "pill--proc",
    label: "đang xử lý"
  },
  rev: {
    cls: "pill--rev",
    label: "chờ duyệt"
  },
  appr: {
    cls: "pill--appr",
    label: "đã duyệt"
  },
  pub: {
    cls: "pill--pub",
    label: "đã đăng"
  },
  rej: {
    cls: "pill--rej",
    label: "từ chối"
  }
};
var BUNDLES = [{
  id: "evt_2025_0142",
  title: "Trao học bổng THPT Cao Thắng",
  program: "Học bổng Mặt Trời",
  status: "rev",
  age: "2 ngày",
  student: "Nguyễn Thu Hà",
  caption: "Không chỉ trao học bổng — chúng tôi trao cơ hội trưởng thành. Sáng nay, 9 em học sinh THPT Cao Thắng đã nhận học bổng kỳ II từ Quỹ Hoa Mặt Trời. 🌻",
  checklist: [{
    k: "Ảnh đầy đủ",
    ok: true
  }, {
    k: "Alt-text",
    ok: true
  }, {
    k: "Nguồn ảnh",
    ok: true
  }, {
    k: "Caption",
    ok: true
  }],
  findings: [],
  photos: 4,
  note: null,
  postedId: null
}, {
  id: "evt_2025_0139",
  title: "Thăm lớp học vùng cao Hà Giang",
  program: "Đồng hành tới trường",
  status: "rev",
  age: "3 ngày",
  student: null,
  caption: "Một ngày ở Đồng Văn: con đường tới trường còn xa, nhưng nụ cười thì thật gần.",
  checklist: [{
    k: "Ảnh đầy đủ",
    ok: true
  }, {
    k: "Alt-text",
    ok: false
  }, {
    k: "Nguồn ảnh",
    ok: true
  }, {
    k: "Caption",
    ok: true
  }],
  findings: ["Thiếu alt-text cho 2 ảnh"],
  photos: 6,
  note: null,
  postedId: null
}, {
  id: "evt_2025_0137",
  title: "Quà Trung thu cho 40 em nhỏ",
  program: "Tết & Trung thu",
  status: "rej",
  age: "5 ngày",
  student: null,
  caption: "Trăng tròn, lòng ấm. Đêm hội Trung thu cùng 40 em nhỏ tại mái ấm Hoa Sữa.",
  checklist: [{
    k: "Ảnh đầy đủ",
    ok: true
  }, {
    k: "Alt-text",
    ok: true
  }, {
    k: "Nguồn ảnh",
    ok: false
  }, {
    k: "Caption",
    ok: false
  }],
  findings: ["Chưa rõ nguồn ảnh", "Caption nhắc tên em nhỏ"],
  photos: 5,
  note: "Làm mờ khuôn mặt em nhỏ chưa đủ tuổi ở ảnh 2 và bỏ tên riêng trong caption.",
  postedId: null
}, {
  id: "evt_2025_0134",
  title: "Khánh thành thư viện Mặt Trời số 7",
  program: "Thư viện Mặt Trời",
  status: "appr",
  age: "1 tuần",
  student: null,
  caption: "Thư viện thứ 7 đã mở cửa — thêm một nơi để các em được mơ xa hơn.",
  checklist: [{
    k: "Ảnh đầy đủ",
    ok: true
  }, {
    k: "Alt-text",
    ok: true
  }, {
    k: "Nguồn ảnh",
    ok: true
  }, {
    k: "Caption",
    ok: true
  }],
  findings: [],
  photos: 8,
  note: null,
  postedId: null
}, {
  id: "evt_2025_0130",
  title: "Lời cảm ơn nhà tài trợ quý II",
  program: "Tri ân",
  status: "pub",
  age: "2 tuần",
  student: null,
  caption: "Cảm ơn 24 tấm lòng đã đồng hành cùng Hoa Mặt Trời trong quý II/2025.",
  checklist: [{
    k: "Ảnh đầy đủ",
    ok: true
  }, {
    k: "Alt-text",
    ok: true
  }, {
    k: "Nguồn ảnh",
    ok: true
  }, {
    k: "Caption",
    ok: true
  }],
  findings: [],
  photos: 3,
  note: null,
  postedId: "1789123456789"
}];
var CONTRIBUTIONS = [{
  id: "c1",
  donor: "Chị Trần Mai",
  amount: 2000000,
  date: "12/06",
  method: "Chuyển khoản",
  thanked: false,
  kind: "Tiền mặt"
}, {
  id: "c2",
  donor: "Anh Lê Quốc Hùng",
  amount: 5000000,
  date: "11/06",
  method: "Chuyển khoản",
  thanked: false,
  kind: "Tiền mặt"
}, {
  id: "c3",
  donor: "Công ty Minh An",
  amount: 15000000,
  date: "09/06",
  method: "Hợp đồng",
  thanked: false,
  kind: "Tiền mặt"
}, {
  id: "c4",
  donor: "Cô Phạm Lan",
  amount: 1000000,
  date: "08/06",
  method: "Tiền mặt",
  thanked: true,
  kind: "Tiền mặt"
}, {
  id: "c5",
  donor: "Nhóm thiện nguyện Sen",
  amount: 0,
  date: "07/06",
  method: "Hiện vật",
  thanked: false,
  kind: "30 thùng sách"
}];
var FIN_KPI = [{
  label: "Tổng đóng góp tháng",
  value: "48,2",
  unit: "triệu ₫",
  delta: "+12% so với T5",
  up: true,
  icon: "wallet"
}, {
  label: "Nhà tài trợ",
  value: "24",
  unit: "",
  delta: "+3 mới",
  up: true,
  icon: "users"
}, {
  label: "Chờ cảm ơn",
  value: "3",
  unit: "",
  delta: "cần xử lý",
  icon: "heart-handshake",
  to: "thanks"
}, {
  label: "Hiện vật quý này",
  value: "7",
  unit: "lô",
  delta: "đã nhận",
  icon: "package"
}];
var STUDENTS = [{
  id: "s1",
  name: "Nguyễn Thu Hà",
  grade: "Lớp 11",
  school: "THPT Cao Thắng",
  program: "Học bổng Mặt Trời",
  since: "2023",
  watch: false,
  status: "Ổn định"
}, {
  id: "s2",
  name: "Trần Minh Khôi",
  grade: "Lớp 9",
  school: "THCS Tân Lập",
  program: "Đồng hành tới trường",
  since: "2024",
  watch: true,
  status: "Cần theo dõi"
}, {
  id: "s3",
  name: "Lê Bảo Ngọc",
  grade: "Lớp 12",
  school: "THPT Cao Thắng",
  program: "Học bổng Mặt Trời",
  since: "2022",
  watch: false,
  status: "Ổn định"
}, {
  id: "s4",
  name: "Phạm Gia Bảo",
  grade: "Lớp 7",
  school: "THCS Hoà Bình",
  program: "Đồng hành tới trường",
  since: "2024",
  watch: false,
  status: "Ổn định"
}, {
  id: "s5",
  name: "Vũ Khánh Linh",
  grade: "Lớp 10",
  school: "THPT Nguyễn Du",
  program: "Học bổng Mặt Trời",
  since: "2023",
  watch: true,
  status: "Cần theo dõi"
}];
var OV_KPI = [{
  id: "rev",
  label: "Bài chờ duyệt",
  value: "2",
  icon: "inbox",
  delta: "+2 hôm nay",
  up: true,
  preview: ["Trao học bổng THPT Cao Thắng", "Thăm lớp vùng cao Hà Giang"],
  to: "approval",
  cta: "Duyệt ngay"
}, {
  id: "thanks",
  label: "Chờ cảm ơn",
  value: "3",
  icon: "heart-handshake",
  delta: "đóng góp mới",
  preview: ["Chị Trần Mai · 2.000.000 ₫", "Anh Lê Quốc Hùng · 5.000.000 ₫"],
  to: "finance",
  cta: "Xử lý"
}, {
  id: "watch",
  label: "Học sinh cần theo dõi",
  value: "2",
  icon: "alert-circle",
  delta: "watchlist",
  preview: ["Trần Minh Khôi · Lớp 9", "Vũ Khánh Linh · Lớp 10"],
  to: "students",
  cta: "Xem hồ sơ"
}, {
  id: "act",
  label: "Hoạt động tháng",
  value: "12",
  unit: "/15",
  icon: "activity",
  delta: "đúng tiến độ",
  preview: ["Khánh thành thư viện số 7", "Quà Trung thu cho 40 em"],
  to: "activities",
  cta: "Xem tất cả"
}, {
  id: "cov",
  label: "Độ phủ 8 cánh",
  value: "6",
  unit: "/8",
  icon: "flower",
  delta: "2 cánh thiếu nội dung",
  preview: ["Thiếu: Sức khoẻ học đường", "Thiếu: Kỹ năng số"],
  to: "content",
  cta: "Lập kế hoạch"
}];
var ACTIONS = [{
  icon: "check-square",
  text: "Duyệt bài “Trao học bổng THPT Cao Thắng”",
  meta: "Hàng đợi duyệt · chờ 2 ngày",
  to: "approval",
  bundle: "evt_2025_0142",
  kind: "rev",
  tag: "Ưu tiên"
}, {
  icon: "message-square-warning",
  text: "Bài “Thăm lớp vùng cao Hà Giang” thiếu alt-text",
  meta: "Hàng đợi duyệt · cần sửa nhỏ",
  to: "approval",
  bundle: "evt_2025_0139",
  kind: "rev",
  tag: "Cần sửa"
}, {
  icon: "heart-handshake",
  text: "Gửi lời cảm ơn chị Trần Mai (2.000.000 ₫)",
  meta: "Tài trợ · đóng góp 12/06",
  to: "finance",
  kind: "thanks",
  tag: "Tri ân"
}, {
  icon: "alert-circle",
  text: "Xem lại học sinh Trần Minh Khôi (watchlist)",
  meta: "Quản lý học sinh · cảnh báo theo dõi",
  to: "students",
  kind: "watch",
  tag: "An toàn"
}];
function fmtVnd(n) {
  if (n === 0) return "—";
  return n.toLocaleString("vi-VN") + " ₫";
}
function esc(s) {
  return String(s).replace(/[&<>"]/g, function (c) {
    return {
      "&": "&amp;",
      "<": "&lt;",
      ">": "&gt;",
      '"': "&quot;"
    }[c];
  });
}
})(); } catch (e) { __ds_ns.__errors.push({ path: "ui_kits/management-hub-v2/data.js", error: String((e && e.message) || e) }); }

// ui_kits/management-hub-v2/helpers.js
try { (() => {
/* ============================================================
   Shared render helpers (return HTML strings)
   ============================================================ */
function pill(status) {
  var s = STATUS[status];
  return '<span class="pill ' + s.cls + '">' + s.label + '</span>';
}
function pillCustom(cls, label) {
  return '<span class="pill ' + cls + '">' + label + '</span>';
}
function chip(state, label) {
  // state: 'ok' | 'fail' | 'wait'
  var cls = state === "fail" ? "chip--fail" : state === "ok" ? "chip--ok" : "chip--wait";
  var icn = state === "fail" ? "alert-triangle" : state === "ok" ? "check" : "clock";
  return '<span class="chip ' + cls + '">' + ic(icn, 12) + " " + label + "</span>";
}
function breadcrumb(items) {
  // items: [{label, area?}]  last = current
  var html = '<div class="breadcrumb">';
  items.forEach(function (it, i) {
    if (i > 0) html += '<span class="breadcrumb__sep">▸</span>';
    var last = i === items.length - 1;
    if (it.area && !last) html += '<a data-nav="' + it.area + '">' + esc(it.label) + "</a>";else if (it.click && !last) html += '<a data-click="' + it.click + '">' + esc(it.label) + "</a>";else html += '<span class="' + (last ? "breadcrumb__current" : "") + '">' + esc(it.label) + "</span>";
  });
  return html + "</div>";
}
function pageHead(title, sub, actions) {
  return '<div class="page-head"><div><h1>' + title + "</h1>" + (sub ? '<div class="page-head__sub">' + sub + "</div>" : "") + "</div>" + (actions ? '<div class="btn-row">' + actions + "</div>" : "") + "</div>";
}

// Big mini-preview KPI tile (overview)
function kpiPreview(k) {
  var items = k.preview.map(function (p) {
    return '<div class="kpi__preview-item"><span class="dot"></span><span>' + esc(p) + "</span></div>";
  }).join("");
  return '<div class="kpi kpi--preview">' + '<div class="kpi__top">' + '<div><div class="kpi__label">' + ic(k.icon, 16) + " " + esc(k.label) + "</div>" + '<div class="kpi__num" style="margin-top:10px">' + k.value + (k.unit ? "<small>" + k.unit + "</small>" : "") + "</div></div>" + (k.delta ? '<div class="kpi__delta' + (k.up ? " up" : "") + '">' + (k.up ? ic("trending-up", 14) : "") + esc(k.delta) + "</div>" : "") + "</div>" + '<div class="kpi__preview">' + items + '<a class="kpi__preview-link" data-nav="' + k.to + '">' + esc(k.cta || "Xem") + " " + ic("arrow-right", 13) + "</a>" + "</div></div>";
}

// Compact stat KPI tile (finance)
function kpiStat(k, navAttr) {
  return '<a class="kpi"' + (navAttr || "") + '>' + '<div class="kpi__label">' + ic(k.icon, 16) + " " + esc(k.label) + "</div>" + '<div class="kpi__value">' + k.value + (k.unit ? "<small>" + esc(k.unit) + "</small>" : "") + "</div>" + (k.delta ? '<div class="kpi__delta' + (k.up ? " up" : "") + '">' + (k.up ? ic("trending-up", 14) : "") + esc(k.delta) + "</div>" : "") + "</a>";
}
function emptyState(title, body, action) {
  return '<div class="empty"><img class="empty__art" src="assets/hmt-mark.png" alt="" />' + "<h3>" + esc(title) + "</h3>" + (body ? "<p>" + esc(body) + "</p>" : "") + (action || "") + "</div>";
}
})(); } catch (e) { __ds_ns.__errors.push({ path: "ui_kits/management-hub-v2/helpers.js", error: String((e && e.message) || e) }); }

// ui_kits/management-hub-v2/icons.js
try { (() => {
/* ============================================================
   Inline SVG icon sprite — Lucide-style, 2px stroke.
   No CDN, no async. Builds a hidden <svg> sprite and exposes
   ic(name, size) -> HTML string  +  paints [data-ic] elements.
   ============================================================ */
(function () {
  var P = {
    "layout-dashboard": '<rect width="7" height="9" x="3" y="3" rx="1"/><rect width="7" height="5" x="14" y="3" rx="1"/><rect width="7" height="9" x="14" y="12" rx="1"/><rect width="7" height="5" x="3" y="16" rx="1"/>',
    "activity": '<path d="M22 12h-4l-3 9L9 3l-3 9H2"/>',
    "clipboard-list": '<rect width="8" height="4" x="8" y="2" rx="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/><path d="M12 11h4"/><path d="M12 16h4"/><path d="M8 11h.01"/><path d="M8 16h.01"/>',
    "users": '<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/>',
    "calendar-days": '<rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/><path d="M8 2v4"/><path d="M16 2v4"/><path d="M8 14h.01"/><path d="M12 14h.01"/><path d="M16 14h.01"/><path d="M8 18h.01"/><path d="M12 18h.01"/>',
    "check-square": '<path d="m9 11 3 3L22 4"/><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"/>',
    "share-2": '<circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><line x1="8.59" x2="15.42" y1="13.51" y2="17.49"/><line x1="15.41" x2="8.59" y1="6.51" y2="10.49"/>',
    "heart-handshake": '<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"/><path d="M12 5 9.04 7.96a2.17 2.17 0 0 0 0 3.08c.82.82 2.13.85 3 .07l2.07-1.9a2.82 2.82 0 0 1 3.79 0l2.96 2.66"/>',
    "log-out": '<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" x2="9" y1="12" y2="12"/>',
    "menu": '<line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="18" y2="18"/>',
    "search": '<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>',
    "bell": '<path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/>',
    "arrow-right": '<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>',
    "arrow-up-right": '<path d="M7 7h10v10"/><path d="M7 17 17 7"/>',
    "inbox": '<polyline points="22 12 16 12 14 15 10 15 8 12 2 12"/><path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/>',
    "alert-circle": '<circle cx="12" cy="12" r="10"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/>',
    "flower": '<circle cx="12" cy="12" r="3"/><path d="M12 16.5A4.5 4.5 0 1 1 7.5 12 4.5 4.5 0 1 1 12 7.5a4.5 4.5 0 1 1 4.5 4.5 4.5 4.5 0 1 1-4.5 4.5"/><path d="M12 7.5V9"/><path d="M7.5 12H9"/><path d="M16.5 12H15"/><path d="M12 16.5V15"/>',
    "message-square-warning": '<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/><path d="M12 7v2"/><path d="M12 13h.01"/>',
    "flask-conical": '<path d="M10 2v7.31"/><path d="M14 9.3V2"/><path d="M8.5 2h7"/><path d="M14 9.3a6.5 6.5 0 1 1-4 0"/><path d="M5.52 16h12.96"/>',
    "x": '<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',
    "check": '<path d="M20 6 9 17l-5-5"/>',
    "pencil": '<path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/><path d="m15 5 4 4"/>',
    "image": '<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/>',
    "globe": '<circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/>',
    "more-horizontal": '<circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/>',
    "thumbs-up": '<path d="M7 10v12"/><path d="M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"/>',
    "message-circle": '<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/>',
    "share": '<path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"/><polyline points="16 6 12 2 8 6"/><line x1="12" x2="12" y1="2" y2="15"/>',
    "alert-triangle": '<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"/><path d="M12 9v4"/><path d="M12 17h.01"/>',
    "check-circle-2": '<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/>',
    "info": '<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>',
    "lock": '<rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>',
    "user": '<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>',
    "wallet": '<path d="M21 12V7H5a2 2 0 0 1 0-4h14v4"/><path d="M3 5v14a2 2 0 0 0 2 2h16v-5"/><path d="M18 12a2 2 0 0 0 0 4h4v-4Z"/>',
    "package": '<path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 22V12"/>',
    "mail": '<rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/>',
    "send": '<path d="M22 2 11 13"/><path d="M22 2 15 22l-4-9-9-4Z"/>',
    "hand-coins": '<circle cx="8" cy="8" r="6"/><path d="M18.09 10.37A6 6 0 1 1 10.34 18"/><path d="M7 6h1v4"/><path d="m16.71 13.88.7.71-2.82 2.82"/>',
    "list": '<line x1="8" x2="21" y1="6" y2="6"/><line x1="8" x2="21" y1="12" y2="12"/><line x1="8" x2="21" y1="18" y2="18"/><line x1="3" x2="3.01" y1="6" y2="6"/><line x1="3" x2="3.01" y1="12" y2="12"/><line x1="3" x2="3.01" y1="18" y2="18"/>',
    "shield": '<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"/>',
    "user-plus": '<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><line x1="19" x2="19" y1="8" y2="14"/><line x1="22" x2="16" y1="11" y2="11"/>',
    "file-plus": '<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M9 15h6"/><path d="M12 18v-6"/>',
    "file-text": '<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M16 13H8"/><path d="M16 17H8"/><path d="M10 9H8"/>',
    "chevron-right": '<path d="m9 18 6-6-6-6"/>',
    "plus": '<path d="M5 12h14"/><path d="M12 5v14"/>',
    "sun": '<circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/>',
    "trending-up": '<polyline points="22 7 13.5 15.5 8.5 10.5 2 17"/><polyline points="16 7 22 7 22 13"/>',
    "clock": '<circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/>',
    "layout-grid": '<rect width="7" height="7" x="3" y="3" rx="1"/><rect width="7" height="7" x="14" y="3" rx="1"/><rect width="7" height="7" x="14" y="14" rx="1"/><rect width="7" height="7" x="3" y="14" rx="1"/>',
    "layout-rows": '<rect width="18" height="7" x="3" y="3" rx="1"/><rect width="18" height="7" x="3" y="14" rx="1"/>',
    "map-pin": '<path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"/><circle cx="12" cy="10" r="3"/>',
    "circle-dot": '<circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="3"/>',
    "external-link": '<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>',
    "receipt": '<path d="M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z"/><path d="M8 7h8"/><path d="M8 11h8"/><path d="M8 15h5"/>'
  };
  function build() {
    var svg = '<svg width="0" height="0" style="position:absolute" aria-hidden="true">';
    for (var k in P) svg += '<symbol id="i-' + k + '" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">' + P[k] + '</symbol>';
    svg += '</svg>';
    var d = document.createElement('div');
    d.innerHTML = svg;
    document.body.insertBefore(d.firstChild, document.body.firstChild);
  }

  // HTML string for inline use
  window.ic = function (name, size) {
    var s = size || 18;
    return '<span class="ico" style="width:' + s + 'px;height:' + s + 'px"><svg width="' + s + '" height="' + s + '"><use href="#i-' + name + '"/></svg></span>';
  };

  // Paint declarative [data-ic] placeholders
  window.paintIcons = function (root) {
    (root || document).querySelectorAll('[data-ic]').forEach(function (el) {
      var n = el.getAttribute('data-ic');
      var s = el.getAttribute('data-ic-size') || 18;
      el.innerHTML = '<svg width="' + s + '" height="' + s + '"><use href="#i-' + n + '"/></svg>';
      el.classList.add('ico');
      el.style.width = s + 'px';
      el.style.height = s + 'px';
      el.removeAttribute('data-ic');
    });
  };
  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', function () {
      build();
      window.paintIcons();
    });
  } else {
    build();
    window.paintIcons();
  }
})();
})(); } catch (e) { __ds_ns.__errors.push({ path: "ui_kits/management-hub-v2/icons.js", error: String((e && e.message) || e) }); }

// ui_kits/management-hub-v2/views-approval.js
try { (() => {
/* ============================================================
   Approval queue + per-bundle detail
   Reads runtime state (HUB.state). Mutations live in app.js.
   ============================================================ */
function renderApproval() {
  var st = HUB.state;
  if (st.openBundle) return renderBundle(st.openBundle);
  var bundles = st.bundles;
  var filter = st.apprFilter || "all";
  var counts = {
    all: bundles.length,
    rev: 0,
    appr: 0,
    rej: 0
  };
  bundles.forEach(function (b) {
    if (counts[b.status] != null) counts[b.status]++;
  });
  var shown = bundles.filter(function (b) {
    return filter === "all" || b.status === filter;
  });
  var pending = counts.rev;
  function fchip(id, label) {
    var n = counts[id] != null ? counts[id] : "";
    return '<button class="filter-chip' + (filter === id ? " is-active" : "") + '" data-filter="' + id + '">' + label + (n !== "" ? ' <span style="opacity:.7">' + n + "</span>" : "") + "</button>";
  }
  var rows = shown.map(function (b) {
    var okCount = b.checklist.filter(function (c) {
      return c.ok;
    }).length;
    var chState = okCount === 4 ? "ok" : okCount < 3 ? "fail" : "wait";
    var capCell = b.note ? '<span class="note-chip">' + ic("message-square-warning", 13) + " <span><b>Cần sửa:</b> " + esc(b.note.slice(0, 44)) + "…</span></span>" : '<span class="td-meta clamp">' + esc(b.caption) + "</span>";
    var actionBtn = b.status === "rev" ? '<button class="btn btn--primary btn--sm" data-open="' + b.id + '">' + ic("check-square", 14) + " Duyệt</button>" : '<button class="btn btn--secondary btn--sm" data-open="' + b.id + '">Mở</button>';
    return "<tr>" + "<td><a class='row-link' data-open='" + b.id + "'>" + esc(b.title) + "</a>" + "<div class='td-meta'><span class='mono'>" + b.id + "</span> · " + esc(b.program) + " · " + esc(b.age) + "</div></td>" + "<td>" + pill(b.status) + "</td>" + "<td>" + chip(chState, okCount + "/4") + "</td>" + "<td class='col-caption'>" + capCell + "</td>" + "<td class='td-actions'>" + actionBtn + "</td>" + "</tr>";
  }).join("");
  var body = shown.length ? "<div class='table-scroll'><table class='data'><thead><tr>" + "<th>Bài đăng</th><th>Trạng thái</th><th>Cổng kiểm tra</th><th>Caption</th><th></th>" + "</tr></thead><tbody>" + rows + "</tbody></table></div>" : emptyState("Không có bài nào ở trạng thái này", "Thử bỏ bộ lọc để xem toàn bộ hàng đợi.");
  return '<div class="content">' + breadcrumb([{
    label: "Trung tâm điều hành"
  }, {
    label: "Hàng đợi duyệt"
  }]) + pageHead("Hàng đợi duyệt", pending + " bài đang chờ bạn duyệt · mở một bài để xem trước và quyết định trong một màn hình.") + '<div class="table-card"><div class="table-toolbar">' + '<div class="table-toolbar__search">' + ic("search", 15) + '<input placeholder="Tìm theo tên bài, mã sự kiện…" /></div>' + fchip("all", "Tất cả") + fchip("rev", "Chờ duyệt") + fchip("appr", "Đã duyệt") + fchip("rej", "Từ chối") + '<span class="table-toolbar__count">' + shown.length + " bài</span>" + "</div>" + body + "</div></div>";
}
function renderBundle(id) {
  var b = HUB.state.bundles.find(function (x) {
    return x.id === id;
  });
  if (!b) return renderApproval();
  var okCount = b.checklist.filter(function (c) {
    return c.ok;
  }).length;
  var chState = okCount === 4 ? "ok" : okCount < 3 ? "fail" : "wait";

  // gallery thumbs
  var thumbs = "";
  var extra = Math.min(b.photos - 1, 3);
  for (var i = 0; i < extra; i++) {
    var miss = i !== 0;
    var more = i === 2 && b.photos > 4 ? '<span class="fb-more">+' + (b.photos - 4) + "</span>" : "";
    thumbs += '<div class="fb-photo">' + ic("image", 22) + more + (miss ? '<span class="fb-alt fb-alt--miss">' + ic("alert-triangle", 11) + " thiếu alt</span>" : '<span class="fb-alt">' + ic("check", 11) + " alt-text</span>") + "</div>";
  }
  var checks = b.checklist.map(function (c) {
    return chip(c.ok ? "ok" : "fail", c.k);
  }).join("");
  var findings = b.findings.length ? b.findings.map(function (f) {
    return '<div class="finding finding--warn">' + ic("alert-triangle", 14) + " " + esc(f) + "</div>";
  }).join("") : '<div class="finding finding--ok">' + ic("check-circle-2", 14) + " Không phát hiện vấn đề tự động.</div>";
  var actions = pill(b.status) + (b.student ? '<button class="btn btn--ghost btn--sm" data-nav="students">' + ic("user", 15) + " " + esc(b.student) + " " + ic("arrow-up-right", 14) + "</button>" : "");
  var noteBanner = b.note ? '<div class="banner banner--warn"><span style="display:inline-flex">' + ic("message-square-warning", 18) + "</span>" + '<div class="banner__body"><b>Ghi chú yêu cầu sửa trước đó:</b> ' + esc(b.note) + "</div></div>" : "";
  var canDecide = b.status === "rev";
  return '<div class="content" style="padding-bottom:0">' + breadcrumb([{
    label: "Hàng đợi duyệt",
    click: "backQueue"
  }, {
    label: "Bài đăng",
    click: "backQueue"
  }, {
    label: b.title
  }]) + pageHead(esc(b.title), "<span class='mono'>" + b.id + "</span> · " + esc(b.program) + " · chờ " + esc(b.age), actions) + noteBanner + '<div class="bundle-grid">' +
  // LEFT: facebook preview
  "<div><div class='eyebrow' style='margin-bottom:10px'>Xem trước bài đăng Facebook</div>" + "<div class='fb-card'>" + "<div class='fb-head'><img src='assets/hmt-mark.png' class='fb-avatar' alt='' />" + "<div><div class='fb-name'>Quỹ Hoa Mặt Trời</div>" + "<div class='fb-meta'>Vừa xong · " + ic("globe", 11) + "</div></div>" + "<button class='icon-btn' style='margin-left:auto'>" + ic("more-horizontal", 18) + "</button></div>" + "<div class='fb-caption' id='fbCaption'>" + renderCaption(b) + "</div>" + "<div class='fb-gallery'><div class='fb-photo fb-photo--main'>" + "<img src='assets/stream-a-chrome-target.png' alt='' />" + "<span class='fb-alt'>" + ic("check", 11) + " alt-text</span></div>" + thumbs + "</div>" + "<div class='fb-foot'><span>" + ic("thumbs-up", 14) + " Thích</span><span>" + ic("message-circle", 14) + " Bình luận</span><span>" + ic("share", 14) + " Chia sẻ</span></div>" + "</div></div>" +
  // RIGHT: gate + info
  "<div class='stack gap4'>" + "<div class='card'><div class='card__head'><h3>Cổng kiểm tra</h3>" + chip(chState, okCount + "/4 đạt") + "</div>" + "<div class='card__body stack gap4'><div class='chips'>" + checks + "</div>" + "<div class='stack gap2'>" + findings + "</div></div></div>" + "<div class='card card--cream'><div class='card__body stack gap2'>" + "<div class='row gap2' style='font-weight:600;color:var(--navy)'>" + ic("info", 15) + " Thông tin</div>" + kv("Chương trình", esc(b.program)) + kv("Số ảnh", b.photos) + kv("Mã sự kiện", "<b class='mono'>" + b.id + "</b>") + kv("posted_id", "<b class='mono'>" + (b.postedId || "—") + "</b>") + "</div></div>" + "</div>" + "</div>" + (
  // STICKY ACTION BAR
  canDecide ? '<div class="action-bar"><div class="action-bar__gate"><div class="decide-context">' + ic("circle-dot", 16) + " <span>Quyết định cho bài này — kiểm tra xem trước bên trên trước khi duyệt.</span></div></div>" + '<div class="action-bar__actions">' + '<button class="btn btn--danger" data-modal="reject">' + ic("x", 16) + " Từ chối</button>" + '<button class="btn btn--secondary" data-modal="changes">' + ic("message-square-warning", 16) + " Yêu cầu sửa</button>" + '<button class="btn btn--primary" id="approveBtn" data-approve="' + b.id + '">' + ic("check", 16) + " Duyệt</button>" + "</div></div>" : '<div style="padding:var(--s5) 0"><button class="btn btn--secondary" data-click="backQueue">' + ic("arrow-right", 16) + " Quay lại hàng đợi</button></div>") + "</div>";
}
function renderCaption(b) {
  return "<div class='fb-caption-row'><p>" + esc(b.caption) + "</p>" + "<button class='inline-edit__btn' data-editcap='1'>" + ic("pencil", 13) + " Sửa</button></div>";
}
function kv(k, v) {
  return "<div class='kv'><span>" + k + "</span><b>" + v + "</b></div>";
}
})(); } catch (e) { __ds_ns.__errors.push({ path: "ui_kits/management-hub-v2/views-approval.js", error: String((e && e.message) || e) }); }

// ui_kits/management-hub-v2/views-extra.js
try { (() => {
/* ============================================================
   Finance · Students · stub areas
   ============================================================ */
function renderFinance() {
  var st = HUB.state;
  var tab = st.finTab || "overview";
  var rows = st.contributions;
  var pending = rows.filter(function (r) {
    return !r.thanked;
  });
  var labelMap = {
    overview: "Tổng quan",
    donors: "Nhà tài trợ",
    thanks: "Đóng góp",
    inkind: "Hiện vật",
    list: "Danh sách"
  };
  var nav = [{
    id: "overview",
    label: "Tổng quan",
    icon: "layout-dashboard"
  }, {
    id: "donors",
    label: "Nhà tài trợ",
    icon: "users",
    count: 24
  }, {
    id: "thanks",
    label: "Đóng góp",
    icon: "hand-coins",
    count: pending.length
  }, {
    id: "inkind",
    label: "Hiện vật",
    icon: "package"
  }, {
    id: "list",
    label: "Danh sách",
    icon: "list"
  }].map(function (t) {
    return '<a class="subnav__item' + (tab === t.id ? " is-active" : "") + '" data-fintab="' + t.id + '">' + ic(t.icon, 17) + " " + t.label + (t.count != null ? '<span class="subnav__count">' + t.count + "</span>" : "") + "</a>";
  }).join("");

  // overview pane
  var kpis = FIN_KPI.map(function (k) {
    return kpiStat(k, k.to ? ' data-fintab="' + k.to + '"' : "");
  }).join("");
  var pendPreview = pending.length === 0 ? emptyState("Tất cả đóng góp đã được cảm ơn 🌻", "Khi có đóng góp mới, mục này sẽ tự động hiện ở đây.") : pending.slice(0, 3).map(function (c) {
    return '<div class="thanks-row"><span><b style="color:var(--navy)">' + esc(c.donor) + "</b> <span class='td-meta'>· " + esc(c.kind) + "</span></span>" + "<span class='row gap3'><b class='serif' style='color:var(--navy)'>" + fmtVnd(c.amount) + "</b>" + "<button class='btn btn--teal btn--sm' data-thank='" + c.id + "'>" + ic("mail", 14) + " Cảm ơn</button></span></div>";
  }).join("");
  var paneOverview = '<div class="subtab' + (tab === "overview" ? " is-active" : "") + '">' + '<div class="kpi-row" style="margin-bottom:var(--s6)">' + kpis + "</div>" + '<div class="card"><div class="card__head"><h3>Cần gửi lời cảm ơn</h3>' + '<a data-fintab="thanks">Mở hàng đợi ' + ic("arrow-right", 13) + "</a></div>" + '<div class="card__body">' + pendPreview + "</div></div>" + "</div>";

  // thanks table
  var trows = rows.map(function (c) {
    var statusCell = c.thanked ? pill("appr") + (c.auto ? "<div class='td-meta' style='margin-top:3px'>đã tự động gửi</div>" : "") : pillCustom("pill--rev", "chờ cảm ơn");
    var act = c.thanked ? "<span class='muted row gap1' style='font-size:13px;justify-content:flex-end'>" + ic("check", 14) + " Đã cảm ơn</span>" : "<div class='btn-row'><button class='btn btn--teal btn--sm' data-thank='" + c.id + "'>" + ic("mail", 14) + " Soạn lời cảm ơn</button>" + "<button class='btn btn--secondary btn--sm' data-marksent='" + c.id + "'>Đánh dấu đã cảm ơn</button></div>";
    return "<tr><td><a class='row-link'>" + esc(c.donor) + "</a><div class='td-meta'>" + esc(c.kind) + "</div></td>" + "<td class='td-strong serif'>" + fmtVnd(c.amount) + "</td>" + "<td class='td-meta'>" + esc(c.date) + "</td><td class='td-meta'>" + esc(c.method) + "</td>" + "<td>" + statusCell + "</td><td class='td-actions'>" + act + "</td></tr>";
  }).join("");
  var paneThanks = '<div class="subtab' + (tab === "thanks" ? " is-active" : "") + '">' + '<div class="table-card"><div class="table-toolbar"><div class="table-toolbar__search">' + ic("search", 15) + '<input placeholder="Tìm nhà tài trợ…" /></div><span class="table-toolbar__count">' + rows.length + " đóng góp · " + pending.length + " chờ cảm ơn</span></div>" + "<div class='table-scroll'><table class='data'><thead><tr><th>Nhà tài trợ</th><th>Đóng góp</th><th>Ngày</th><th>Hình thức</th><th>Trạng thái</th><th></th></tr></thead>" + "<tbody>" + trows + "</tbody></table></div></div>" + "</div>";
  function stubPane(id) {
    return '<div class="subtab' + (tab === id ? " is-active" : "") + '"><div class="card"><div class="card__body">' + emptyState("Phần này dùng chung hệ thống", "Màn hình “" + labelMap[id] + "” kế thừa cùng shell, bảng và component — minh hoạ trong bộ thành phần.") + "</div></div></div>";
  }
  return '<div class="content">' + breadcrumb([{
    label: "Trung tâm điều hành"
  }, {
    label: "Tài trợ & tài chính"
  }, {
    label: labelMap[tab]
  }]) + pageHead("Tài trợ & tài chính", "Theo dõi đóng góp, nhà tài trợ và lời cảm ơn — tất cả trong một khu vực.") + '<div class="subnav-layout"><nav class="subnav"><div class="subnav__label">Mục</div>' + nav + "</nav>" + "<div>" + paneOverview + paneThanks + stubPane("donors") + stubPane("inkind") + stubPane("list") + "</div>" + "</div></div>";
}
function renderStudents() {
  var rows = HUB.state.students.map(function (s) {
    return "<tr class='" + (s.watch ? "is-watch" : "") + "'>" + "<td><a class='row-link' data-student='" + s.id + "'>" + esc(s.name) + "</a><div class='td-meta'>Tham gia từ " + esc(s.since) + "</div></td>" + "<td class='td-meta'>" + esc(s.grade) + "</td><td class='td-meta'>" + esc(s.school) + "</td><td class='td-meta'>" + esc(s.program) + "</td>" + "<td>" + (s.watch ? pillCustom("pill--rev", "cần theo dõi") : pillCustom("pill--appr", "ổn định")) + "</td>" + "<td class='td-actions'><button class='btn btn--secondary btn--sm' data-student='" + s.id + "'>" + ic("file-text", 14) + " Hồ sơ</button></td></tr>";
  }).join("");
  return '<div class="content">' + breadcrumb([{
    label: "Trung tâm điều hành"
  }, {
    label: "Quản lý học sinh"
  }]) + pageHead("Quản lý học sinh", "Hồ sơ người được hỗ trợ — dữ liệu nhạy cảm, vui lòng giữ bảo mật và tôn trọng.", '<button class="btn btn--primary">' + ic("user-plus", 16) + " Thêm học sinh</button>") + '<div class="banner banner--cream"><span style="display:inline-flex">' + ic("shield", 18) + "</span>" + '<div class="banner__body">Khu vực chứa thông tin trẻ em. Mọi thao tác đều được ghi nhật ký. Tránh chia sẻ ảnh chụp màn hình.</div></div>' + '<div class="table-card"><div class="table-toolbar"><div class="table-toolbar__search">' + ic("search", 15) + '<input placeholder="Tìm học sinh theo tên, trường…" /></div>' + '<span class="table-toolbar__count">' + HUB.state.students.length + " học sinh · " + HUB.state.students.filter(function (s) {
    return s.watch;
  }).length + " cần theo dõi</span></div>" + "<div class='table-scroll'><table class='data'><thead><tr><th>Học sinh</th><th>Lớp</th><th>Trường</th><th>Chương trình</th><th>Trạng thái</th><th></th></tr></thead>" + "<tbody>" + rows + "</tbody></table></div></div></div>";
}
function renderStub(area) {
  var map = {
    activities: {
      t: "Hoạt động",
      s: "Sổ hoạt động — bảng hoạt động · pill trạng thái · ảnh · bài · thư mục."
    },
    survey: {
      t: "Khảo sát",
      s: "Danh sách ứng viên (chỉ đọc) cho chọn lọc học bổng."
    },
    content: {
      t: "Kế hoạch nội dung",
      s: "Lịch nội dung evergreen + cờ độ phủ 8 cánh."
    },
    social: {
      t: "Hiện diện xã hội",
      s: "Thống kê bài đăng, nhịp 30 ngày, độ phủ 8 cánh, tỉ lệ ask:value."
    }
  }[area] || {
    t: "Khu vực",
    s: ""
  };
  return '<div class="content">' + breadcrumb([{
    label: "Trung tâm điều hành"
  }, {
    label: map.t
  }]) + pageHead(map.t, map.s) + '<div class="card"><div class="card__body">' + emptyState("Màn hình này dùng chung shell & component", "Tất cả khu vực sống trong cùng một shell bền vững. Các màn hình ưu tiên (Tổng quan, Hàng đợi duyệt, Tài trợ, Học sinh) đã được dựng đầy đủ để minh hoạ hệ thống và luồng.") + "</div></div></div>";
}
})(); } catch (e) { __ds_ns.__errors.push({ path: "ui_kits/management-hub-v2/views-extra.js", error: String((e && e.message) || e) }); }

// ui_kits/management-hub-v2/views-overview.js
try { (() => {
/* ============================================================
   Overview — the launchpad. Two layout options (A / B).
   ============================================================ */
function ovHero(optControls) {
  return '<section class="hero">' + '<img class="hero__mark" src="assets/hmt-mark.png" alt="" />' + '<div class="hero__eyebrow eyebrow">Thứ Ba, 03/06/2025</div>' + "<h1>Chào buổi sáng, Linh.</h1>" + '<p class="hero__sub">Có <b>4 việc</b> cần bạn xử lý hôm nay — hai bài chờ duyệt, một lời cảm ơn và một học sinh cần theo dõi.</p>' + '<div class="hero__row">' + '<button class="btn btn--primary" data-nav="approval">' + ic("check-square", 16) + " Bắt đầu duyệt</button>" + '<button class="btn btn--secondary">' + ic("calendar-days", 16) + " Tháng 6/2025</button>" + '<span class="badge-mock">Dữ liệu mẫu</span>' + '<div class="right">' + optControls + "</div>" + "</div></section>";
}
function actionTagClass(kind) {
  return kind === "rev" ? "tag--rev" : kind === "thanks" ? "tag--thanks" : "tag--watch";
}
function actionRow(a, i) {
  return '<a class="action-row" data-action="' + i + '">' + '<span class="action-row__ic action-row__ic--' + a.kind + '">' + ic(a.icon, 18) + "</span>" + '<span class="action-row__body">' + '<span class="action-row__head"><span class="action-row__text">' + a.text + "</span>" + '<span class="tag ' + actionTagClass(a.kind) + '">' + esc(a.tag) + "</span></span>" + '<span class="action-row__meta">' + esc(a.meta) + "</span>" + "</span>" + '<span class="action-row__go">Xử lý ' + ic("arrow-right", 15) + "</span></a>";
}
function renderOverview() {
  var seg = '<div class="segmented" data-seg="ov">' + '<button data-opt="a" class="is-active">' + ic("layout-rows", 14) + " Bố cục A</button>" + '<button data-opt="b">' + ic("layout-grid", 14) + " Bố cục B</button></div>";

  // ---- Option A: editorial launchpad (action list hero + KPI grid) ----
  var rowsA = ACTIONS.map(actionRow).join("");
  var kpisA = OV_KPI.map(kpiPreview).join("");
  var optA = '<div class="opt is-active" data-opt="a">' + '<div class="section-head"><h2>Cần bạn xử lý hôm nay</h2><span class="section-head__note">Bấm để tới thẳng mục cần xử lý</span></div>' + '<div class="card action-list">' + rowsA + "</div>" + '<div class="section-head"><h2>Toàn cảnh</h2><span class="section-head__note">5 chỉ số theo dõi · cập nhật hôm nay</span></div>' + '<div class="kpi-row">' + kpisA + "</div>" + "</div>";

  // ---- Option B: triage command center (featured task + compact rail) ----
  var feat = ACTIONS[0];
  var restB = ACTIONS.slice(1).map(function (a, idx) {
    return actionRow(a, idx + 1);
  }).join("");
  var statRail = OV_KPI.map(function (k) {
    return '<a class="stat-row" data-nav="' + k.to + '">' + '<span class="stat-row__ic">' + ic(k.icon, 16) + "</span>" + '<span class="stat-row__body"><span class="stat-row__label">' + esc(k.label) + "</span>" + '<span class="stat-row__meta">' + esc(k.delta || "") + "</span></span>" + '<span class="stat-row__val serif">' + k.value + (k.unit ? '<small>' + esc(k.unit) + "</small>" : "") + "</span>" + ic("chevron-right", 16) + "</a>";
  }).join("");
  var optB = '<div class="opt" data-opt="b">' + '<div class="triage">' + "<div>" + '<div class="section-head" style="margin-top:0"><h2>Việc cần xử lý</h2><span class="section-head__note">4 việc · ưu tiên cao nhất ở trên</span></div>' + '<a class="feature-card" data-action="0">' + '<div class="feature-card__top"><span class="tag ' + actionTagClass(feat.kind) + '">' + esc(feat.tag) + "</span>" + pill("rev") + "</div>" + "<h3>" + feat.text + "</h3>" + '<div class="feature-card__meta">' + ic("clock", 14) + " " + esc(feat.meta) + "</div>" + '<div class="feature-card__cta">' + ic("check-square", 16) + " Mở để duyệt " + ic("arrow-right", 15) + "</div>" + "</a>" + '<div class="card action-list" style="margin-top:var(--s4)">' + restB + "</div>" + "</div>" + '<aside class="triage__rail">' + '<div class="eyebrow" style="margin-bottom:var(--s3)">Toàn cảnh hôm nay</div>' + '<div class="stat-stack card">' + statRail + "</div>" + '<div class="quote-card">' + '<div class="quote-card__values">Tôn trọng · Đồng hành · Lan toả</div>' + "<p>“Một đứa trẻ cần điều gì để không cảm thấy một mình?”</p>" + "</div>" + "</aside>" + "</div>" + "</div>";
  return '<div class="content">' + breadcrumb([{
    label: "Trung tâm điều hành"
  }, {
    label: "Tổng quan"
  }]) + ovHero(seg) + '<div class="banner banner--warn"><span style="display:inline-flex">' + ic("flask-conical", 18) + "</span>" + '<div class="banner__body"><b>Số liệu đang ở chế độ mẫu.</b> Một số chỉ số minh hoạ bên dưới chưa được kết nối dữ liệu thật.</div>' + '<span class="badge-mock">Dữ liệu mẫu</span></div>' + optA + optB + "</div>";
}
})(); } catch (e) { __ds_ns.__errors.push({ path: "ui_kits/management-hub-v2/views-overview.js", error: String((e && e.message) || e) }); }

// ui_kits/management-hub/ApprovalQueue.jsx
try { (() => {
/* ============================================================
   Approval queue + per-bundle detail
   ============================================================ */
function ApprovalQueue({
  initialBundle,
  push
}) {
  const [bundles, setBundles] = useState(() => BUNDLES.map(b => ({
    ...b
  })));
  const [openId, setOpenId] = useState(initialBundle || null);
  useEffect(() => {
    if (initialBundle) setOpenId(initialBundle);
  }, [initialBundle]);
  const open = bundles.find(b => b.id === openId);
  function applyDecision(id, changes) {
    setBundles(bs => bs.map(b => b.id === id ? {
      ...b,
      ...changes
    } : b));
  }
  if (open) {
    return /*#__PURE__*/React.createElement(BundleDetail, {
      bundle: open,
      onBack: () => setOpenId(null),
      onApprove: () => {
        applyDecision(open.id, {
          status: "appr",
          note: null
        });
        push("Đã duyệt — bài sẵn sàng đăng.", "ok");
        setOpenId(null);
      },
      onReject: note => {
        applyDecision(open.id, {
          status: "rej",
          note
        });
        push("Đã từ chối và gửi ghi chú.", "warn");
        setOpenId(null);
      },
      onChanges: note => {
        applyDecision(open.id, {
          status: "rev",
          note
        });
        push("Đã gửi yêu cầu sửa.", "warn");
        setOpenId(null);
      },
      onCaption: cap => applyDecision(open.id, {
        caption: cap
      })
    });
  }
  const pending = bundles.filter(b => b.status === "rev").length;
  return /*#__PURE__*/React.createElement("div", {
    className: "content"
  }, /*#__PURE__*/React.createElement(Breadcrumb, {
    items: [{
      label: "Trung tâm điều hành"
    }, {
      label: "Hàng đợi duyệt"
    }]
  }), /*#__PURE__*/React.createElement(PageHead, {
    title: "H\xE0ng \u0111\u1EE3i duy\u1EC7t",
    sub: pending + " bài đang chờ bạn duyệt · mở một bài để xem trước và quyết định trong một màn hình."
  }), /*#__PURE__*/React.createElement("div", {
    className: "table-wrap"
  }, /*#__PURE__*/React.createElement("div", {
    className: "table-scroll"
  }, /*#__PURE__*/React.createElement("table", {
    className: "data"
  }, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", null, "B\xE0i \u0111\u0103ng"), /*#__PURE__*/React.createElement("th", null, "Tr\u1EA1ng th\xE1i"), /*#__PURE__*/React.createElement("th", null, "Checklist"), /*#__PURE__*/React.createElement("th", null, "Caption"), /*#__PURE__*/React.createElement("th", null))), /*#__PURE__*/React.createElement("tbody", null, bundles.map(b => {
    const okCount = b.checklist.filter(c => c.ok).length;
    return /*#__PURE__*/React.createElement("tr", {
      key: b.id
    }, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("a", {
      href: "#",
      className: "row-link",
      onClick: e => {
        e.preventDefault();
        setOpenId(b.id);
      }
    }, b.title), /*#__PURE__*/React.createElement("div", {
      className: "td-meta"
    }, /*#__PURE__*/React.createElement("span", {
      className: "mono"
    }, b.id), " \xB7 ", b.program, " \xB7 ", b.age)), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(Pill, {
      status: b.status
    })), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(Chip, {
      ok: okCount === 4,
      fail: okCount < 3
    }, okCount, "/4")), /*#__PURE__*/React.createElement("td", {
      style: {
        maxWidth: 260
      }
    }, b.note ? /*#__PURE__*/React.createElement("span", {
      className: "note-chip",
      style: {
        fontSize: 11,
        padding: "3px 8px"
      }
    }, /*#__PURE__*/React.createElement(Icon, {
      name: "message-square-warning",
      size: 12
    }), " ", /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("b", null, "C\u1EA7n s\u1EEDa:"), " ", b.note.slice(0, 40), "\u2026")) : /*#__PURE__*/React.createElement("span", {
      className: "td-meta",
      style: {
        display: "block",
        overflow: "hidden",
        textOverflow: "ellipsis",
        whiteSpace: "nowrap"
      }
    }, b.caption)), /*#__PURE__*/React.createElement("td", {
      className: "td-actions"
    }, b.status === "rev" ? /*#__PURE__*/React.createElement("button", {
      className: "btn btn--primary btn--sm",
      onClick: () => setOpenId(b.id)
    }, "Duy\u1EC7t") : /*#__PURE__*/React.createElement("button", {
      className: "btn btn--secondary btn--sm",
      onClick: () => setOpenId(b.id)
    }, "M\u1EDF")));
  }))))));
}

/* ---- Bundle detail with sticky action bar + dignity gate ---- */
function BundleDetail({
  bundle,
  onBack,
  onApprove,
  onReject,
  onChanges,
  onCaption
}) {
  const [dignity, setDignity] = useState(false);
  const [editing, setEditing] = useState(false);
  const [cap, setCap] = useState(bundle.caption);
  const [modal, setModal] = useState(null); // 'reject' | 'changes'
  const [note, setNote] = useState("");
  const okCount = bundle.checklist.filter(c => c.ok).length;
  return /*#__PURE__*/React.createElement("div", {
    className: "content",
    style: {
      paddingBottom: 0
    }
  }, /*#__PURE__*/React.createElement(Breadcrumb, {
    items: [{
      label: "Hàng đợi duyệt",
      onClick: onBack
    }, {
      label: "Bài đăng",
      onClick: onBack
    }, {
      label: bundle.title
    }]
  }), /*#__PURE__*/React.createElement(PageHead, {
    title: bundle.title,
    sub: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", {
      className: "mono"
    }, bundle.id), " \xB7 ", bundle.program, " \xB7 ch\u1EDD ", bundle.age),
    actions: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Pill, {
      status: bundle.status
    }), bundle.student && /*#__PURE__*/React.createElement("button", {
      className: "btn btn--ghost btn--sm"
    }, /*#__PURE__*/React.createElement(Icon, {
      name: "user",
      size: 15
    }), " ", bundle.student, " ", /*#__PURE__*/React.createElement(Icon, {
      name: "arrow-up-right",
      size: 14
    })))
  }), bundle.note && /*#__PURE__*/React.createElement("div", {
    className: "banner banner--warn",
    style: {
      alignItems: "center"
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "message-square-warning",
    size: 18
  }), /*#__PURE__*/React.createElement("div", {
    className: "banner__body"
  }, /*#__PURE__*/React.createElement("b", null, "Ghi ch\xFA y\xEAu c\u1EA7u s\u1EEDa tr\u01B0\u1EDBc \u0111\xF3:"), " ", bundle.note)), /*#__PURE__*/React.createElement("div", {
    className: "bundle-grid"
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
    className: "eyebrow",
    style: {
      marginBottom: 8
    }
  }, "Xem tr\u01B0\u1EDBc b\xE0i \u0111\u0103ng Facebook"), /*#__PURE__*/React.createElement("div", {
    className: "fb-card"
  }, /*#__PURE__*/React.createElement("div", {
    className: "fb-head"
  }, /*#__PURE__*/React.createElement("img", {
    src: "../../assets/hmt-mark.png",
    alt: "",
    className: "fb-avatar"
  }), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
    className: "fb-name"
  }, "Qu\u1EF9 Hoa M\u1EB7t Tr\u1EDDi"), /*#__PURE__*/React.createElement("div", {
    className: "fb-meta"
  }, "V\u1EEBa xong \xB7 ", /*#__PURE__*/React.createElement(Icon, {
    name: "globe",
    size: 11
  }))), /*#__PURE__*/React.createElement("button", {
    className: "icon-btn",
    style: {
      marginLeft: "auto"
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "more-horizontal",
    size: 18
  }))), /*#__PURE__*/React.createElement("div", {
    className: "fb-caption"
  }, editing ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("textarea", {
    className: "textarea",
    value: cap,
    onChange: e => setCap(e.target.value),
    autoFocus: true
  }), /*#__PURE__*/React.createElement("div", {
    className: "btn-row",
    style: {
      marginTop: 8
    }
  }, /*#__PURE__*/React.createElement("button", {
    className: "btn btn--primary btn--sm",
    onClick: () => {
      onCaption(cap);
      setEditing(false);
    }
  }, "L\u01B0u caption"), /*#__PURE__*/React.createElement("button", {
    className: "btn btn--ghost btn--sm",
    onClick: () => {
      setCap(bundle.caption);
      setEditing(false);
    }
  }, "Hu\u1EF7"))) : /*#__PURE__*/React.createElement("div", {
    className: "fb-caption-row"
  }, /*#__PURE__*/React.createElement("p", {
    style: {
      margin: 0
    }
  }, bundle.caption), /*#__PURE__*/React.createElement("button", {
    className: "inline-edit__btn",
    onClick: () => setEditing(true)
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "pencil",
    size: 13
  }), " S\u1EEDa"))), /*#__PURE__*/React.createElement("div", {
    className: "fb-gallery"
  }, /*#__PURE__*/React.createElement("div", {
    className: "fb-photo fb-photo--main"
  }, /*#__PURE__*/React.createElement("img", {
    src: "../../assets/stream-a-chrome-target.png",
    alt: ""
  }), /*#__PURE__*/React.createElement("span", {
    className: "fb-alt"
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "check",
    size: 11
  }), " alt-text")), Array.from({
    length: Math.min(bundle.photos - 1, 3)
  }).map((_, i) => /*#__PURE__*/React.createElement("div", {
    className: "fb-photo",
    key: i
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "image",
    size: 22,
    cls: "ph-ic"
  }), i === 2 && bundle.photos > 4 && /*#__PURE__*/React.createElement("span", {
    className: "fb-more"
  }, "+", bundle.photos - 4), i === 0 ? /*#__PURE__*/React.createElement("span", {
    className: "fb-alt"
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "check",
    size: 11
  }), " alt-text") : /*#__PURE__*/React.createElement("span", {
    className: "fb-alt fb-alt--miss"
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "alert-triangle",
    size: 11
  }), " thi\u1EBFu alt")))), /*#__PURE__*/React.createElement("div", {
    className: "fb-foot"
  }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Icon, {
    name: "thumbs-up",
    size: 14
  }), " Th\xEDch"), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Icon, {
    name: "message-circle",
    size: 14
  }), " B\xECnh lu\u1EADn"), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Icon, {
    name: "share",
    size: 14
  }), " Chia s\u1EBB")))), /*#__PURE__*/React.createElement("div", {
    className: "stack gap4"
  }, /*#__PURE__*/React.createElement("div", {
    className: "card"
  }, /*#__PURE__*/React.createElement("div", {
    className: "card__head"
  }, /*#__PURE__*/React.createElement("h3", null, "C\u1ED5ng ki\u1EC3m tra"), /*#__PURE__*/React.createElement(Chip, {
    ok: okCount === 4,
    fail: okCount < 3
  }, okCount, "/4 \u0111\u1EA1t")), /*#__PURE__*/React.createElement("div", {
    className: "card__body stack gap3"
  }, /*#__PURE__*/React.createElement("div", {
    className: "chips"
  }, bundle.checklist.map((c, i) => /*#__PURE__*/React.createElement(Chip, {
    key: i,
    ok: c.ok,
    fail: !c.ok
  }, c.k))), bundle.findings.length > 0 && /*#__PURE__*/React.createElement("div", {
    className: "stack gap2",
    style: {
      marginTop: 4
    }
  }, bundle.findings.map((f, i) => /*#__PURE__*/React.createElement("div", {
    key: i,
    className: "row gap2",
    style: {
      color: "var(--st-rev-fg)",
      fontSize: "var(--t-sm)",
      fontWeight: 600
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "alert-triangle",
    size: 14
  }), " ", f))), bundle.findings.length === 0 && /*#__PURE__*/React.createElement("div", {
    className: "row gap2",
    style: {
      color: "var(--ok-fg)",
      fontSize: "var(--t-sm)",
      fontWeight: 600
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "check-circle-2",
    size: 14
  }), " Kh\xF4ng ph\xE1t hi\u1EC7n v\u1EA5n \u0111\u1EC1 t\u1EF1 \u0111\u1ED9ng."))), /*#__PURE__*/React.createElement("div", {
    className: "card card--cream"
  }, /*#__PURE__*/React.createElement("div", {
    className: "card__body stack gap2"
  }, /*#__PURE__*/React.createElement("div", {
    className: "row gap2",
    style: {
      fontWeight: 600,
      color: "var(--navy)"
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "info",
    size: 15
  }), " Th\xF4ng tin"), /*#__PURE__*/React.createElement("div", {
    className: "kv"
  }, /*#__PURE__*/React.createElement("span", null, "Ch\u01B0\u01A1ng tr\xECnh"), /*#__PURE__*/React.createElement("b", null, bundle.program)), /*#__PURE__*/React.createElement("div", {
    className: "kv"
  }, /*#__PURE__*/React.createElement("span", null, "S\u1ED1 \u1EA3nh"), /*#__PURE__*/React.createElement("b", null, bundle.photos)), /*#__PURE__*/React.createElement("div", {
    className: "kv"
  }, /*#__PURE__*/React.createElement("span", null, "M\xE3 s\u1EF1 ki\u1EC7n"), /*#__PURE__*/React.createElement("b", {
    className: "mono"
  }, bundle.id)), /*#__PURE__*/React.createElement("div", {
    className: "kv"
  }, /*#__PURE__*/React.createElement("span", null, "posted_id"), /*#__PURE__*/React.createElement("b", {
    className: "mono"
  }, bundle.postedId || "—")))))), /*#__PURE__*/React.createElement("div", {
    className: "action-bar"
  }, /*#__PURE__*/React.createElement("div", {
    className: "action-bar__gate"
  }, /*#__PURE__*/React.createElement("div", {
    className: "dignity",
    style: {
      flex: 1
    }
  }, /*#__PURE__*/React.createElement("input", {
    type: "checkbox",
    id: "dignity",
    checked: dignity,
    onChange: e => setDignity(e.target.checked)
  }), /*#__PURE__*/React.createElement("label", {
    htmlFor: "dignity"
  }, "T\xF4i x\xE1c nh\u1EADn n\u1ED9i dung t\xF4n tr\u1ECDng nh\xE2n ph\u1EA9m ng\u01B0\u1EDDi \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3.", /*#__PURE__*/React.createElement("small", null, "B\u1EAFt bu\u1ED9c tr\u01B0\u1EDBc khi duy\u1EC7t \u2014 kh\xF4ng bao gi\u1EDD t\u1EF1 \u0111\u1ED9ng tick.")))), /*#__PURE__*/React.createElement("div", {
    className: "action-bar__actions"
  }, /*#__PURE__*/React.createElement("button", {
    className: "btn btn--danger",
    onClick: () => {
      setModal("reject");
      setNote("");
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "x",
    size: 16
  }), " T\u1EEB ch\u1ED1i"), /*#__PURE__*/React.createElement("button", {
    className: "btn btn--secondary",
    onClick: () => {
      setModal("changes");
      setNote(bundle.note || "");
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "message-square-warning",
    size: 16
  }), " Y\xEAu c\u1EA7u s\u1EEDa"), /*#__PURE__*/React.createElement("button", {
    className: "btn btn--primary",
    disabled: !dignity,
    onClick: onApprove
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "check",
    size: 16
  }), " Duy\u1EC7t"))), !dignity && /*#__PURE__*/React.createElement("div", {
    className: "gate-hint"
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "lock",
    size: 13
  }), " Tick x\xE1c nh\u1EADn nh\xE2n ph\u1EA9m \u0111\u1EC3 m\u1EDF n\xFAt Duy\u1EC7t."), /*#__PURE__*/React.createElement(Modal, {
    open: modal === "changes",
    onClose: () => setModal(null),
    title: "Y\xEAu c\u1EA7u s\u1EEDa",
    meta: bundle.title,
    foot: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
      className: "btn btn--ghost",
      onClick: () => setModal(null)
    }, "Hu\u1EF7"), /*#__PURE__*/React.createElement("button", {
      className: "btn btn--primary",
      disabled: !note.trim(),
      onClick: () => {
        onChanges(note.trim());
        setModal(null);
      }
    }, "G\u1EEDi y\xEAu c\u1EA7u s\u1EEDa"))
  }, /*#__PURE__*/React.createElement("div", {
    className: "field",
    style: {
      marginBottom: 0
    }
  }, /*#__PURE__*/React.createElement("label", null, "N\u1ED9i dung c\u1EA7n s\u1EEDa"), /*#__PURE__*/React.createElement("textarea", {
    className: "textarea",
    value: note,
    onChange: e => setNote(e.target.value),
    placeholder: "M\xF4 t\u1EA3 r\xF5 \u0111i\u1EC1u c\u1EA7n ch\u1EC9nh \u0111\u1EC3 c\u1ED9ng t\xE1c vi\xEAn n\u1EAFm \u0111\u01B0\u1EE3c\u2026",
    autoFocus: true
  }), /*#__PURE__*/React.createElement("div", {
    className: "field__hint"
  }, "Ghi ch\xFA s\u1EBD hi\u1EC7n tr\xEAn th\u1EBB h\xE0ng \u0111\u1EE3i d\u01B0\u1EDBi d\u1EA1ng \u201CC\u1EA7n s\u1EEDa: \u2026\u201D."))), /*#__PURE__*/React.createElement(Modal, {
    open: modal === "reject",
    onClose: () => setModal(null),
    title: "T\u1EEB ch\u1ED1i b\xE0i \u0111\u0103ng",
    meta: bundle.title,
    foot: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
      className: "btn btn--ghost",
      onClick: () => setModal(null)
    }, "Hu\u1EF7"), /*#__PURE__*/React.createElement("button", {
      className: "btn btn--danger",
      disabled: !note.trim(),
      onClick: () => {
        onReject(note.trim());
        setModal(null);
      }
    }, /*#__PURE__*/React.createElement(Icon, {
      name: "x",
      size: 16
    }), " X\xE1c nh\u1EADn t\u1EEB ch\u1ED1i"))
  }, /*#__PURE__*/React.createElement("div", {
    className: "field",
    style: {
      marginBottom: 0
    }
  }, /*#__PURE__*/React.createElement("label", null, "L\xFD do t\u1EEB ch\u1ED1i"), /*#__PURE__*/React.createElement("textarea", {
    className: "textarea",
    value: note,
    onChange: e => setNote(e.target.value),
    placeholder: "N\xEAu l\xFD do \u0111\u1EC3 l\u01B0u l\u1EA1i v\xE0 th\xF4ng b\xE1o cho c\u1ED9ng t\xE1c vi\xEAn\u2026",
    autoFocus: true
  }))), /*#__PURE__*/React.createElement("style", null, `
        .bundle-grid{display:grid;grid-template-columns:1fr 340px;gap:var(--s5);align-items:start}
        .kv{display:flex;justify-content:space-between;gap:var(--s4);font-size:var(--t-sm);color:var(--muted)}
        .kv b{color:var(--ink);font-weight:600}
        .fb-card{background:#fff;border:1px solid var(--hairline);border-radius:var(--r-lg);box-shadow:var(--sh-1);overflow:hidden}
        .fb-head{display:flex;align-items:center;gap:10px;padding:12px var(--s4)}
        .fb-avatar{width:40px;height:40px;border-radius:50%;background:var(--navy);padding:4px;object-fit:contain}
        .fb-name{font-weight:700;color:var(--ink);font-size:14px}
        .fb-meta{color:var(--muted);font-size:12px;display:flex;align-items:center;gap:4px}
        .fb-caption{padding:0 var(--s4) 12px}
        .fb-caption-row{display:flex;align-items:flex-start;gap:10px}
        .fb-caption-row p{font-size:15px;color:var(--ink);line-height:1.5}
        .fb-gallery{display:grid;grid-template-columns:1fr 1fr;gap:3px;background:var(--hairline)}
        .fb-photo{position:relative;aspect-ratio:1/1;background:var(--surface-2);display:flex;align-items:center;justify-content:center;overflow:hidden}
        .fb-photo--main{grid-column:1/-1;aspect-ratio:16/10}
        .fb-photo img{width:100%;height:100%;object-fit:cover}
        .ph-ic{color:var(--faint)}
        .fb-alt{position:absolute;left:8px;bottom:8px;display:inline-flex;align-items:center;gap:4px;font-size:10px;font-weight:700;background:var(--ok-bg);color:var(--ok-fg);padding:2px 7px;border-radius:var(--r-pill)}
        .fb-alt--miss{background:var(--st-rev-bg);color:var(--st-rev-fg)}
        .fb-more{position:absolute;inset:0;background:rgba(28,36,48,.55);color:#fff;display:flex;align-items:center;justify-content:center;font-family:var(--font-display);font-size:22px;font-weight:600}
        .fb-foot{display:flex;justify-content:space-around;padding:8px;border-top:1px solid var(--hairline-2);color:var(--muted);font-weight:600;font-size:13px}
        .fb-foot span{display:inline-flex;align-items:center;gap:6px}
        .gate-hint{display:flex;align-items:center;gap:6px;justify-content:flex-end;color:var(--muted);font-size:var(--t-sm);padding:8px 4px 20px}
        @media(max-width:880px){.bundle-grid{grid-template-columns:1fr}}
      `));
}
Object.assign(window, {
  ApprovalQueue,
  BundleDetail
});
})(); } catch (e) { __ds_ns.__errors.push({ path: "ui_kits/management-hub/ApprovalQueue.jsx", error: String((e && e.message) || e) }); }

// ui_kits/management-hub/Finance.jsx
try { (() => {
/* ============================================================
   Tài trợ & tài chính — overview + actionable thank-you queue
   ============================================================ */
function Finance({
  push
}) {
  const [tab, setTab] = useState("overview");
  const [rows, setRows] = useState(() => CONTRIBUTIONS.map(c => ({
    ...c
  })));
  const [compose, setCompose] = useState(null); // contribution being thanked
  const [draft, setDraft] = useState("");
  const pending = rows.filter(r => !r.thanked);
  function markSent(id, auto) {
    setRows(rs => rs.map(r => r.id === id ? {
      ...r,
      thanked: true,
      auto
    } : r));
  }
  function openCompose(c) {
    setCompose(c);
    setDraft(`Kính gửi ${c.donor},\n\nQuỹ Hoa Mặt Trời xin chân thành cảm ơn tấm lòng của ${"" + c.donor.split(" ").slice(-1)} đã đồng hành cùng các em học sinh. Món quà của ${"" + c.donor.split(" ")[0]} sẽ được trao tận tay tới những hoàn cảnh cần nhất.\n\nTrân trọng,\nQuỹ Hoa Mặt Trời 🌻`);
  }
  return /*#__PURE__*/React.createElement("div", {
    className: "content"
  }, /*#__PURE__*/React.createElement(Breadcrumb, {
    items: [{
      label: "Trung tâm điều hành"
    }, {
      label: "Tài trợ & tài chính"
    }, {
      label: tab === "overview" ? "Tổng quan" : tab === "thanks" ? "Đóng góp" : tab === "donors" ? "Nhà tài trợ" : tab === "inkind" ? "Hiện vật" : "Danh sách"
    }]
  }), /*#__PURE__*/React.createElement(PageHead, {
    title: "T\xE0i tr\u1EE3 & t\xE0i ch\xEDnh",
    sub: "Theo d\xF5i \u0111\xF3ng g\xF3p, nh\xE0 t\xE0i tr\u1EE3 v\xE0 l\u1EDDi c\u1EA3m \u01A1n \u2014 t\u1EA5t c\u1EA3 trong m\u1ED9t khu v\u1EF1c."
  }), /*#__PURE__*/React.createElement("div", {
    className: "subnav-layout"
  }, /*#__PURE__*/React.createElement("nav", {
    className: "subnav"
  }, /*#__PURE__*/React.createElement("div", {
    className: "subnav__label"
  }, "M\u1EE5c"), [{
    id: "overview",
    label: "Tổng quan",
    icon: "layout-dashboard"
  }, {
    id: "donors",
    label: "Nhà tài trợ",
    icon: "users",
    count: 24
  }, {
    id: "thanks",
    label: "Đóng góp",
    icon: "hand-coins",
    count: pending.length
  }, {
    id: "inkind",
    label: "Hiện vật",
    icon: "package"
  }, {
    id: "list",
    label: "Danh sách",
    icon: "list"
  }].map(t => /*#__PURE__*/React.createElement("a", {
    key: t.id,
    href: "#",
    className: "subnav__item" + (tab === t.id ? " is-active" : ""),
    onClick: e => {
      e.preventDefault();
      setTab(t.id);
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: t.icon,
    size: 17
  }), " ", t.label, t.count != null && /*#__PURE__*/React.createElement("span", {
    className: "subnav__count"
  }, t.count)))), /*#__PURE__*/React.createElement("div", {
    className: "stack"
  }, tab === "overview" && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
    className: "kpi-row",
    style: {
      marginBottom: "var(--s6)"
    }
  }, FIN_KPI.map((k, i) => /*#__PURE__*/React.createElement(Kpi, {
    key: i,
    k: k,
    onClick: () => k.to && setTab(k.to)
  }))), /*#__PURE__*/React.createElement("div", {
    className: "card"
  }, /*#__PURE__*/React.createElement("div", {
    className: "card__head"
  }, /*#__PURE__*/React.createElement("h3", null, "C\u1EA7n g\u1EEDi l\u1EDDi c\u1EA3m \u01A1n"), /*#__PURE__*/React.createElement("a", {
    href: "#",
    onClick: e => {
      e.preventDefault();
      setTab("thanks");
    }
  }, "M\u1EDF h\xE0ng \u0111\u1EE3i ", /*#__PURE__*/React.createElement(Icon, {
    name: "arrow-right",
    size: 13
  }))), /*#__PURE__*/React.createElement("div", {
    className: "card__body"
  }, pending.length === 0 ? /*#__PURE__*/React.createElement(Empty, {
    title: "T\u1EA5t c\u1EA3 \u0111\xF3ng g\xF3p \u0111\xE3 \u0111\u01B0\u1EE3c c\u1EA3m \u01A1n \uD83C\uDF3B"
  }, "Khi c\xF3 \u0111\xF3ng g\xF3p m\u1EDBi, m\u1EE5c n\xE0y s\u1EBD t\u1EF1 \u0111\u1ED9ng hi\u1EC7n \u1EDF \u0111\xE2y.") : /*#__PURE__*/React.createElement("div", {
    className: "stack gap2"
  }, pending.slice(0, 3).map(c => /*#__PURE__*/React.createElement("div", {
    key: c.id,
    className: "row gap3",
    style: {
      justifyContent: "space-between",
      padding: "6px 0",
      borderBottom: "1px solid var(--hairline-2)"
    }
  }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("b", {
    style: {
      color: "var(--navy)"
    }
  }, c.donor), " ", /*#__PURE__*/React.createElement("span", {
    className: "td-meta"
  }, "\xB7 ", c.kind)), /*#__PURE__*/React.createElement("span", {
    className: "row gap3"
  }, /*#__PURE__*/React.createElement("b", {
    className: "serif",
    style: {
      color: "var(--navy)"
    }
  }, fmtVnd(c.amount)), /*#__PURE__*/React.createElement("button", {
    className: "btn btn--teal btn--sm",
    onClick: () => openCompose(c)
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "mail",
    size: 14
  }), " C\u1EA3m \u01A1n")))))))), tab === "thanks" && /*#__PURE__*/React.createElement("div", {
    className: "table-wrap"
  }, /*#__PURE__*/React.createElement("div", {
    className: "table-scroll"
  }, /*#__PURE__*/React.createElement("table", {
    className: "data"
  }, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", null, "Nh\xE0 t\xE0i tr\u1EE3"), /*#__PURE__*/React.createElement("th", null, "\u0110\xF3ng g\xF3p"), /*#__PURE__*/React.createElement("th", null, "Ng\xE0y"), /*#__PURE__*/React.createElement("th", null, "H\xECnh th\u1EE9c"), /*#__PURE__*/React.createElement("th", null, "Tr\u1EA1ng th\xE1i"), /*#__PURE__*/React.createElement("th", null))), /*#__PURE__*/React.createElement("tbody", null, rows.map(c => /*#__PURE__*/React.createElement("tr", {
    key: c.id
  }, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("a", {
    href: "#",
    className: "row-link",
    onClick: e => e.preventDefault()
  }, c.donor), /*#__PURE__*/React.createElement("div", {
    className: "td-meta"
  }, c.kind)), /*#__PURE__*/React.createElement("td", {
    className: "td-strong serif"
  }, fmtVnd(c.amount)), /*#__PURE__*/React.createElement("td", {
    className: "td-meta"
  }, c.date), /*#__PURE__*/React.createElement("td", {
    className: "td-meta"
  }, c.method), /*#__PURE__*/React.createElement("td", null, c.thanked ? /*#__PURE__*/React.createElement(Pill, {
    status: "appr"
  }) : /*#__PURE__*/React.createElement("span", {
    className: "pill pill--rev"
  }, "ch\u1EDD c\u1EA3m \u01A1n"), c.thanked && c.auto && /*#__PURE__*/React.createElement("div", {
    className: "td-meta",
    style: {
      marginTop: 3
    }
  }, "\u0111\xE3 t\u1EF1 \u0111\u1ED9ng g\u1EEDi")), /*#__PURE__*/React.createElement("td", {
    className: "td-actions"
  }, c.thanked ? /*#__PURE__*/React.createElement("span", {
    className: "muted row gap1",
    style: {
      fontSize: 13
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "check",
    size: 14
  }), " \u0110\xE3 c\u1EA3m \u01A1n") : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
    className: "btn btn--teal btn--sm",
    onClick: () => openCompose(c)
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "mail",
    size: 14
  }), " So\u1EA1n l\u1EDDi c\u1EA3m \u01A1n"), /*#__PURE__*/React.createElement("button", {
    className: "btn btn--secondary btn--sm",
    onClick: () => {
      markSent(c.id, false);
      push("Đã đánh dấu đã cảm ơn " + c.donor + ".", "ok");
    }
  }, "\u0110\xE1nh d\u1EA5u \u0111\xE3 c\u1EA3m \u01A1n"))))))))), (tab === "donors" || tab === "inkind" || tab === "list") && /*#__PURE__*/React.createElement("div", {
    className: "card"
  }, /*#__PURE__*/React.createElement("div", {
    className: "card__body"
  }, /*#__PURE__*/React.createElement(Empty, {
    title: "Ph\u1EA7n n\xE0y d\xF9ng chung h\u1EC7 th\u1ED1ng"
  }, "M\xE0n h\xECnh \u201C", tab === "donors" ? "Nhà tài trợ" : tab === "inkind" ? "Hiện vật" : "Danh sách", "\u201D k\u1EBF th\u1EEBa c\xF9ng shell, b\u1EA3ng v\xE0 component \u2014 minh ho\u1EA1 trong b\u1ED9 th\xE0nh ph\u1EA7n."))))), /*#__PURE__*/React.createElement(Modal, {
    open: !!compose,
    onClose: () => setCompose(null),
    title: "So\u1EA1n l\u1EDDi c\u1EA3m \u01A1n",
    meta: compose ? `Gửi tới: ${compose.donor} · ${fmtVnd(compose.amount)}` : "",
    foot: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
      className: "btn btn--ghost",
      onClick: () => setCompose(null)
    }, "Hu\u1EF7"), /*#__PURE__*/React.createElement("button", {
      className: "btn btn--teal",
      onClick: () => {
        markSent(compose.id, false);
        push("Đã gửi lời cảm ơn tới " + compose.donor + ".", "ok");
        setCompose(null);
      }
    }, /*#__PURE__*/React.createElement(Icon, {
      name: "send",
      size: 16
    }), " G\u1EEDi & \u0111\xE1nh d\u1EA5u \u0111\xE3 c\u1EA3m \u01A1n"))
  }, /*#__PURE__*/React.createElement("div", {
    className: "field",
    style: {
      marginBottom: 0
    }
  }, /*#__PURE__*/React.createElement("label", null, "N\u1ED9i dung l\u1EDDi c\u1EA3m \u01A1n"), /*#__PURE__*/React.createElement("textarea", {
    className: "textarea",
    style: {
      minHeight: 160
    },
    value: draft,
    onChange: e => setDraft(e.target.value)
  }), /*#__PURE__*/React.createElement("div", {
    className: "field__hint"
  }, "C\xF3 th\u1EC3 \u0111\xEDnh k\xE8m bi\xEAn nh\u1EADn sau khi g\u1EEDi. Khi t\xEDch h\u1EE3p t\u1EF1 \u0111\u1ED9ng, c\xE1c \u0111\xF3ng g\xF3p \u0111\u1EE7 \u0111i\u1EC1u ki\u1EC7n s\u1EBD hi\u1EC7n tr\u1EA1ng th\xE1i \u201C\u0111\xE3 t\u1EF1 \u0111\u1ED9ng g\u1EEDi\u201D."))));
}
Object.assign(window, {
  Finance
});
})(); } catch (e) { __ds_ns.__errors.push({ path: "ui_kits/management-hub/Finance.jsx", error: String((e && e.message) || e) }); }

// ui_kits/management-hub/Overview.jsx
try { (() => {
/* ============================================================
   Overview — the launchpad
   ============================================================ */
function Overview({
  go
}) {
  return /*#__PURE__*/React.createElement("div", {
    className: "content"
  }, /*#__PURE__*/React.createElement(Breadcrumb, {
    items: [{
      label: "Trung tâm điều hành"
    }, {
      label: "Tổng quan"
    }]
  }), /*#__PURE__*/React.createElement(PageHead, {
    title: "Ch\xE0o bu\u1ED5i s\xE1ng, Linh \uD83C\uDF3B",
    sub: "Th\u1EE9 Ba, 03/06 \xB7 C\xF3 4 vi\u1EC7c c\u1EA7n b\u1EA1n x\u1EED l\xFD h\xF4m nay.",
    actions: /*#__PURE__*/React.createElement("button", {
      className: "btn btn--secondary"
    }, /*#__PURE__*/React.createElement(Icon, {
      name: "calendar-days",
      size: 16
    }), " Th\xE1ng 6/2025")
  }), /*#__PURE__*/React.createElement("div", {
    className: "banner banner--warn"
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "flask-conical",
    size: 18
  }), /*#__PURE__*/React.createElement("div", {
    className: "banner__body"
  }, /*#__PURE__*/React.createElement("b", null, "S\u1ED1 li\u1EC7u \u0111ang \u1EDF ch\u1EBF \u0111\u1ED9 M\u1EAAU."), " M\u1ED9t s\u1ED1 ch\u1EC9 s\u1ED1 minh ho\u1EA1 b\xEAn d\u01B0\u1EDBi ch\u01B0a \u0111\u01B0\u1EE3c k\u1EBFt n\u1ED1i d\u1EEF li\u1EC7u th\u1EADt."), /*#__PURE__*/React.createElement("span", {
    className: "badge-mock"
  }, "D\u1EEF li\u1EC7u m\u1EABu")), /*#__PURE__*/React.createElement("div", {
    className: "section-head",
    style: {
      marginTop: 0
    }
  }, /*#__PURE__*/React.createElement("h2", null, "C\u1EA7n b\u1EA1n x\u1EED l\xFD h\xF4m nay"), /*#__PURE__*/React.createElement("span", {
    className: "muted",
    style: {
      fontSize: "var(--t-sm)"
    }
  }, "B\u1EA5m \u0111\u1EC3 t\u1EDBi th\u1EB3ng m\u1EE5c c\u1EA7n x\u1EED l\xFD")), /*#__PURE__*/React.createElement("div", {
    className: "card"
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      padding: "4px 0"
    }
  }, ACTIONS.map((a, i) => /*#__PURE__*/React.createElement("a", {
    key: i,
    href: "#",
    onClick: e => {
      e.preventDefault();
      go(a.to, a.bundle ? {
        bundle: a.bundle
      } : null);
    },
    className: "action-row"
  }, /*#__PURE__*/React.createElement("span", {
    className: "action-row__ic action-row__ic--" + a.kind
  }, /*#__PURE__*/React.createElement(Icon, {
    name: a.icon,
    size: 18
  })), /*#__PURE__*/React.createElement("span", {
    className: "action-row__body"
  }, /*#__PURE__*/React.createElement("span", {
    className: "action-row__text"
  }, a.text), /*#__PURE__*/React.createElement("span", {
    className: "action-row__meta"
  }, a.meta)), /*#__PURE__*/React.createElement("span", {
    className: "action-row__go"
  }, "X\u1EED l\xFD ", /*#__PURE__*/React.createElement(Icon, {
    name: "arrow-right",
    size: 15
  })))))), /*#__PURE__*/React.createElement("div", {
    className: "section-head"
  }, /*#__PURE__*/React.createElement("h2", null, "To\xE0n c\u1EA3nh")), /*#__PURE__*/React.createElement("div", {
    className: "kpi-row"
  }, OV_KPI.map(k => /*#__PURE__*/React.createElement(Kpi, {
    key: k.id,
    k: k,
    onClick: () => go(k.to)
  }))), /*#__PURE__*/React.createElement("style", null, `
        .action-row{display:flex;align-items:center;gap:var(--s4);padding:16px var(--s6);border-bottom:1px solid var(--hairline-2);text-decoration:none;transition:background .12s}
        .action-row:last-child{border-bottom:none}
        .action-row:hover{background:var(--surface-2);text-decoration:none}
        .action-row:hover .action-row__go{opacity:1;transform:translateX(0)}
        .action-row__ic{width:40px;height:40px;border-radius:var(--r-md);display:inline-flex;align-items:center;justify-content:center;flex:none}
        .action-row__ic--rev{background:var(--st-rev-bg);color:var(--st-rev-fg)}
        .action-row__ic--thanks{background:var(--teal-soft);color:var(--teal-deep)}
        .action-row__ic--watch{background:var(--st-rej-bg);color:var(--st-rej-fg)}
        .action-row__body{flex:1;display:flex;flex-direction:column;min-width:0}
        .action-row__text{font-weight:600;color:var(--navy);font-size:var(--t-base)}
        .action-row__meta{color:var(--muted);font-size:var(--t-sm)}
        .action-row__go{color:var(--teal);font-weight:600;font-size:var(--t-sm);display:inline-flex;align-items:center;gap:5px;opacity:.5;transform:translateX(-4px);transition:.14s;white-space:nowrap}
      `));
}
Object.assign(window, {
  Overview
});
})(); } catch (e) { __ds_ns.__errors.push({ path: "ui_kits/management-hub/Overview.jsx", error: String((e && e.message) || e) }); }

// ui_kits/management-hub/Students.jsx
try { (() => {
/* ============================================================
   Quản lý học sinh — roster + profile drawer (sober, dignified)
   ============================================================ */
function Students({
  push
}) {
  const [sel, setSel] = useState(null);
  const [noteOpen, setNoteOpen] = useState(false);
  const [noteText, setNoteText] = useState("");
  const [noteKind, setNoteKind] = useState("Quyền lợi");
  return /*#__PURE__*/React.createElement("div", {
    className: "content"
  }, /*#__PURE__*/React.createElement(Breadcrumb, {
    items: [{
      label: "Trung tâm điều hành"
    }, {
      label: "Quản lý học sinh"
    }]
  }), /*#__PURE__*/React.createElement(PageHead, {
    title: "Qu\u1EA3n l\xFD h\u1ECDc sinh",
    sub: "H\u1ED3 s\u01A1 ng\u01B0\u1EDDi \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3 \u2014 d\u1EEF li\u1EC7u nh\u1EA1y c\u1EA3m, vui l\xF2ng gi\u1EEF b\u1EA3o m\u1EADt v\xE0 t\xF4n tr\u1ECDng.",
    actions: /*#__PURE__*/React.createElement("button", {
      className: "btn btn--primary"
    }, /*#__PURE__*/React.createElement(Icon, {
      name: "user-plus",
      size: 16
    }), " Th\xEAm h\u1ECDc sinh")
  }), /*#__PURE__*/React.createElement("div", {
    className: "banner banner--cream"
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "shield",
    size: 18
  }), /*#__PURE__*/React.createElement("div", {
    className: "banner__body"
  }, "Khu v\u1EF1c ch\u1EE9a th\xF4ng tin tr\u1EBB em. M\u1ECDi thao t\xE1c \u0111\u1EC1u \u0111\u01B0\u1EE3c ghi nh\u1EADt k\xFD. Tr\xE1nh chia s\u1EBB \u1EA3nh ch\u1EE5p m\xE0n h\xECnh.")), /*#__PURE__*/React.createElement("div", {
    className: "table-wrap"
  }, /*#__PURE__*/React.createElement("div", {
    className: "table-scroll"
  }, /*#__PURE__*/React.createElement("table", {
    className: "data"
  }, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", null, "H\u1ECDc sinh"), /*#__PURE__*/React.createElement("th", null, "L\u1EDBp"), /*#__PURE__*/React.createElement("th", null, "Tr\u01B0\u1EDDng"), /*#__PURE__*/React.createElement("th", null, "Ch\u01B0\u01A1ng tr\xECnh"), /*#__PURE__*/React.createElement("th", null, "Tr\u1EA1ng th\xE1i"), /*#__PURE__*/React.createElement("th", null))), /*#__PURE__*/React.createElement("tbody", null, STUDENTS.map(s => /*#__PURE__*/React.createElement("tr", {
    key: s.id,
    className: s.watch ? "" : ""
  }, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("a", {
    href: "#",
    className: "row-link",
    onClick: e => {
      e.preventDefault();
      setSel(s);
    }
  }, s.name), /*#__PURE__*/React.createElement("div", {
    className: "td-meta"
  }, "Tham gia t\u1EEB ", s.since)), /*#__PURE__*/React.createElement("td", {
    className: "td-meta"
  }, s.grade), /*#__PURE__*/React.createElement("td", {
    className: "td-meta"
  }, s.school), /*#__PURE__*/React.createElement("td", {
    className: "td-meta"
  }, s.program), /*#__PURE__*/React.createElement("td", null, s.watch ? /*#__PURE__*/React.createElement("span", {
    className: "pill pill--rev"
  }, "c\u1EA7n theo d\xF5i") : /*#__PURE__*/React.createElement("span", {
    className: "pill pill--appr"
  }, "\u1ED5n \u0111\u1ECBnh")), /*#__PURE__*/React.createElement("td", {
    className: "td-actions"
  }, /*#__PURE__*/React.createElement("button", {
    className: "btn btn--secondary btn--sm",
    onClick: () => setSel(s)
  }, "H\u1ED3 s\u01A1")))))))), /*#__PURE__*/React.createElement(Drawer, {
    open: !!sel,
    onClose: () => setSel(null),
    title: sel ? sel.name : "",
    foot: sel && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
      className: "btn btn--secondary",
      onClick: () => {
        setNoteText("");
        setNoteOpen(true);
      }
    }, /*#__PURE__*/React.createElement(Icon, {
      name: "file-plus",
      size: 16
    }), " Th\xEAm ghi ch\xFA"), sel.watch && /*#__PURE__*/React.createElement("button", {
      className: "btn btn--danger right",
      onClick: () => push("Đã chuyển cảnh báo an toàn cho phụ trách.", "warn")
    }, /*#__PURE__*/React.createElement(Icon, {
      name: "alert-triangle",
      size: 16
    }), " B\xE1o c\xE1o an to\xE0n"))
  }, sel && /*#__PURE__*/React.createElement("div", {
    className: "stack gap4"
  }, /*#__PURE__*/React.createElement("div", {
    className: "row gap3",
    style: {
      alignItems: "center"
    }
  }, /*#__PURE__*/React.createElement("div", {
    className: "avatar",
    style: {
      width: 52,
      height: 52,
      fontSize: 20
    }
  }, sel.name.split(" ").slice(-1)[0][0]), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
    style: {
      fontWeight: 700,
      color: "var(--navy)",
      fontSize: 17
    }
  }, sel.name), /*#__PURE__*/React.createElement("div", {
    className: "td-meta"
  }, sel.grade, " \xB7 ", sel.school))), sel.watch && /*#__PURE__*/React.createElement("div", {
    className: "banner banner--warn",
    style: {
      margin: 0
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "alert-circle",
    size: 18
  }), /*#__PURE__*/React.createElement("div", {
    className: "banner__body"
  }, "H\u1ECDc sinh \u0111ang trong danh s\xE1ch ", /*#__PURE__*/React.createElement("b", null, "c\u1EA7n theo d\xF5i"), ".")), /*#__PURE__*/React.createElement("div", {
    className: "card"
  }, /*#__PURE__*/React.createElement("div", {
    className: "card__body stack gap2"
  }, /*#__PURE__*/React.createElement("div", {
    className: "kv2"
  }, /*#__PURE__*/React.createElement("span", null, "Ch\u01B0\u01A1ng tr\xECnh"), /*#__PURE__*/React.createElement("b", null, sel.program)), /*#__PURE__*/React.createElement("div", {
    className: "kv2"
  }, /*#__PURE__*/React.createElement("span", null, "Tham gia t\u1EEB"), /*#__PURE__*/React.createElement("b", null, sel.since)), /*#__PURE__*/React.createElement("div", {
    className: "kv2"
  }, /*#__PURE__*/React.createElement("span", null, "Tr\u1EA1ng th\xE1i"), /*#__PURE__*/React.createElement("b", null, sel.status)))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
    className: "eyebrow",
    style: {
      marginBottom: 8
    }
  }, "D\xF2ng th\u1EDDi gian ch\u0103m s\xF3c"), /*#__PURE__*/React.createElement("div", {
    className: "stack gap2"
  }, /*#__PURE__*/React.createElement("div", {
    className: "tl"
  }, /*#__PURE__*/React.createElement("span", {
    className: "tl-dot"
  }), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("b", null, "Nh\u1EADn h\u1ECDc b\u1ED5ng k\u1EF3 II"), /*#__PURE__*/React.createElement("div", {
    className: "td-meta"
  }, "12/2024 \xB7 H\u1ECDc b\u1ED5ng M\u1EB7t Tr\u1EDDi"))), /*#__PURE__*/React.createElement("div", {
    className: "tl"
  }, /*#__PURE__*/React.createElement("span", {
    className: "tl-dot"
  }), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("b", null, "Th\u0103m gia \u0111\xECnh"), /*#__PURE__*/React.createElement("div", {
    className: "td-meta"
  }, "10/2024 \xB7 ghi ch\xFA quy\u1EC1n l\u1EE3i"))))))), /*#__PURE__*/React.createElement(Drawer, {
    open: noteOpen,
    onClose: () => setNoteOpen(false),
    title: "Th\xEAm ghi ch\xFA ch\u0103m s\xF3c",
    foot: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
      className: "btn btn--ghost",
      onClick: () => setNoteOpen(false)
    }, "Hu\u1EF7"), /*#__PURE__*/React.createElement("button", {
      className: "btn btn--primary right",
      disabled: !noteText.trim(),
      onClick: () => {
        setNoteOpen(false);
        push("Đã lưu ghi chú cho hồ sơ.", "ok");
      }
    }, "L\u01B0u ghi ch\xFA"))
  }, /*#__PURE__*/React.createElement("div", {
    className: "field"
  }, /*#__PURE__*/React.createElement("label", null, "Lo\u1EA1i ghi ch\xFA"), /*#__PURE__*/React.createElement("select", {
    className: "select",
    value: noteKind,
    onChange: e => setNoteKind(e.target.value)
  }, /*#__PURE__*/React.createElement("option", null, "Quy\u1EC1n l\u1EE3i"), /*#__PURE__*/React.createElement("option", null, "H\u1ECDc t\u1EADp"), /*#__PURE__*/React.createElement("option", null, "C\u1EA3nh b\xE1o an to\xE0n"))), /*#__PURE__*/React.createElement("div", {
    className: "field",
    style: {
      marginBottom: 0
    }
  }, /*#__PURE__*/React.createElement("label", null, "N\u1ED9i dung"), /*#__PURE__*/React.createElement("textarea", {
    className: "textarea",
    value: noteText,
    onChange: e => setNoteText(e.target.value),
    placeholder: "Nh\u1EADp ghi ch\xFA\u2026 gi\u1EEF t\xF4n tr\u1ECDng v\xE0 kh\xE1ch quan.",
    autoFocus: true
  }))), /*#__PURE__*/React.createElement("style", null, `
        .kv2{display:flex;justify-content:space-between;font-size:var(--t-sm);color:var(--muted)}
        .kv2 b{color:var(--ink)}
        .tl{display:flex;gap:10px;align-items:flex-start;padding-left:4px}
        .tl-dot{width:9px;height:9px;border-radius:50%;background:var(--sunflower-deep);margin-top:5px;flex:none;box-shadow:0 0 0 3px var(--sunflower-soft)}
        .tl b{color:var(--navy)}
      `));
}

/* Placeholder areas that reuse the shell */
function AreaStub({
  area
}) {
  const map = {
    activities: {
      t: "Hoạt động",
      s: "Sổ hoạt động — bảng hoạt động · pill trạng thái · ảnh · bài · thư mục."
    },
    survey: {
      t: "Khảo sát",
      s: "Danh sách ứng viên (chỉ đọc) cho chọn lọc học bổng."
    },
    content: {
      t: "Kế hoạch nội dung",
      s: "Lịch nội dung evergreen + cờ độ phủ."
    },
    social: {
      t: "Hiện diện xã hội",
      s: "Thống kê bài đăng, nhịp 30 ngày, độ phủ 8 cánh, tỉ lệ ask:value."
    }
  }[area] || {
    t: "Khu vực",
    s: ""
  };
  return /*#__PURE__*/React.createElement("div", {
    className: "content"
  }, /*#__PURE__*/React.createElement(Breadcrumb, {
    items: [{
      label: "Trung tâm điều hành"
    }, {
      label: map.t
    }]
  }), /*#__PURE__*/React.createElement(PageHead, {
    title: map.t,
    sub: map.s
  }), /*#__PURE__*/React.createElement("div", {
    className: "card"
  }, /*#__PURE__*/React.createElement("div", {
    className: "card__body"
  }, /*#__PURE__*/React.createElement(Empty, {
    title: "M\xE0n h\xECnh n\xE0y d\xF9ng chung shell & component"
  }, "T\u1EA5t c\u1EA3 c\xE1c khu v\u1EF1c s\u1ED1ng trong c\xF9ng m\u1ED9t shell b\u1EC1n v\u1EEFng. C\xE1c m\xE0n h\xECnh \u01B0u ti\xEAn (T\u1ED5ng quan, H\xE0ng \u0111\u1EE3i duy\u1EC7t, T\xE0i tr\u1EE3) \u0111\xE3 \u0111\u01B0\u1EE3c d\u1EF1ng \u0111\u1EA7y \u0111\u1EE7 \u0111\u1EC3 ch\u1EE9ng minh h\u1EC7 th\u1ED1ng v\xE0 lu\u1ED3ng."))));
}
Object.assign(window, {
  Students,
  AreaStub
});
})(); } catch (e) { __ds_ns.__errors.push({ path: "ui_kits/management-hub/Students.jsx", error: String((e && e.message) || e) }); }

// ui_kits/management-hub/app.jsx
try { (() => {
/* ============================================================
   Root — persistent shell + lightweight client-side routing
   ============================================================ */
function App() {
  const [area, setArea] = useState("overview");
  const [params, setParams] = useState(null);
  const [navOpen, setNavOpen] = useState(false);
  const {
    toasts,
    push,
    dismiss
  } = useToasts();
  function go(next, p) {
    setArea(next);
    setParams(p || null);
    window.scrollTo(0, 0);
  }
  const areaLabel = (NAV.find(n => n.id === area) || {}).label || "Trung tâm điều hành";
  const pageTitle = {
    overview: "Tổng quan",
    approval: "Hàng đợi duyệt",
    finance: "Tài trợ & tài chính",
    students: "Quản lý học sinh",
    activities: "Hoạt động",
    survey: "Khảo sát",
    content: "Kế hoạch nội dung",
    social: "Hiện diện xã hội"
  }[area] || areaLabel;
  return /*#__PURE__*/React.createElement("div", {
    className: "app"
  }, /*#__PURE__*/React.createElement(Sidebar, {
    area: area,
    go: go,
    open: navOpen,
    onClose: () => setNavOpen(false)
  }), /*#__PURE__*/React.createElement("div", {
    className: "main"
  }, /*#__PURE__*/React.createElement(Topbar, {
    areaLabel: areaLabel,
    pageTitle: pageTitle,
    onMenu: () => setNavOpen(true)
  }), area === "overview" && /*#__PURE__*/React.createElement(Overview, {
    go: go
  }), area === "approval" && /*#__PURE__*/React.createElement(ApprovalQueue, {
    initialBundle: params && params.bundle,
    push: push
  }), area === "finance" && /*#__PURE__*/React.createElement(Finance, {
    push: push
  }), area === "students" && /*#__PURE__*/React.createElement(Students, {
    push: push
  }), ["activities", "survey", "content", "social"].includes(area) && /*#__PURE__*/React.createElement(AreaStub, {
    area: area
  })), /*#__PURE__*/React.createElement(Toasts, {
    toasts: toasts,
    dismiss: dismiss
  }));
}
ReactDOM.createRoot(document.getElementById("root")).render(/*#__PURE__*/React.createElement(App, null));
})(); } catch (e) { __ds_ns.__errors.push({ path: "ui_kits/management-hub/app.jsx", error: String((e && e.message) || e) }); }

// ui_kits/management-hub/components.jsx
try { (() => {
/* ============================================================
   Shared primitives for the HMT Management Hub UI kit
   ============================================================ */
const {
  useState,
  useEffect,
  useRef,
  useLayoutEffect
} = React;

/* --- Icon: render a Lucide icon by name --- */
function Icon({
  name,
  size = 16,
  color,
  style,
  cls
}) {
  const ref = useRef(null);
  useLayoutEffect(() => {
    const el = ref.current;
    if (!el || !window.lucide) return;
    el.innerHTML = "";
    const i = document.createElement("i");
    i.setAttribute("data-lucide", name);
    el.appendChild(i);
    window.lucide.createIcons();
  }, [name]);
  return /*#__PURE__*/React.createElement("span", {
    ref: ref,
    className: "ico" + (cls ? " " + cls : ""),
    style: {
      display: "inline-flex",
      width: size,
      height: size,
      color,
      ...style
    }
  });
}

/* --- Status pill --- */
function Pill({
  status
}) {
  const s = STATUS[status];
  return /*#__PURE__*/React.createElement("span", {
    className: "pill " + s.cls
  }, s.label);
}

/* --- Checklist chip --- */
function Chip({
  ok,
  children,
  fail
}) {
  const cls = fail ? "chip--fail" : ok ? "chip--ok" : "chip--wait";
  const ic = fail ? "alert-triangle" : ok ? "check" : "clock";
  return /*#__PURE__*/React.createElement("span", {
    className: "chip " + cls
  }, /*#__PURE__*/React.createElement(Icon, {
    name: ic,
    size: 12
  }), " ", children);
}

/* --- KPI tile (clickable + optional mini-preview) --- */
function Kpi({
  k,
  onClick
}) {
  return /*#__PURE__*/React.createElement("a", {
    className: "kpi" + (k.preview ? "" : ""),
    href: "#",
    onClick: e => {
      e.preventDefault();
      onClick && onClick(k);
    }
  }, /*#__PURE__*/React.createElement("div", {
    className: "kpi__label"
  }, /*#__PURE__*/React.createElement(Icon, {
    name: k.icon,
    size: 16
  }), " ", k.label), /*#__PURE__*/React.createElement("div", {
    className: "kpi__value"
  }, k.value, k.unit && /*#__PURE__*/React.createElement("small", null, k.unit)), k.delta && /*#__PURE__*/React.createElement("div", {
    className: "kpi__delta" + (k.up ? " up" : "")
  }, k.delta), k.preview && /*#__PURE__*/React.createElement("div", {
    className: "kpi__preview"
  }, k.preview.map((p, i) => /*#__PURE__*/React.createElement("div", {
    className: "kpi__preview-item",
    key: i
  }, /*#__PURE__*/React.createElement("span", {
    className: "dot"
  }), /*#__PURE__*/React.createElement("span", null, p))), /*#__PURE__*/React.createElement("span", {
    className: "kpi__preview-link"
  }, k.cta || "Xem", " ", /*#__PURE__*/React.createElement(Icon, {
    name: "arrow-right",
    size: 13
  }))), !k.preview && k.cta && /*#__PURE__*/React.createElement("span", {
    className: "kpi__cta"
  }, k.cta, " ", /*#__PURE__*/React.createElement(Icon, {
    name: "arrow-right",
    size: 14
  })));
}

/* --- Breadcrumb --- */
function Breadcrumb({
  items
}) {
  return /*#__PURE__*/React.createElement("div", {
    className: "breadcrumb"
  }, items.map((it, i) => /*#__PURE__*/React.createElement(React.Fragment, {
    key: i
  }, i > 0 && /*#__PURE__*/React.createElement("span", {
    className: "breadcrumb__sep"
  }, "\u25B8"), it.onClick && i < items.length - 1 ? /*#__PURE__*/React.createElement("a", {
    href: "#",
    onClick: e => {
      e.preventDefault();
      it.onClick();
    }
  }, it.label) : /*#__PURE__*/React.createElement("span", {
    className: i === items.length - 1 ? "breadcrumb__current" : ""
  }, it.label))));
}

/* --- Sidebar --- */
const NAV = [{
  id: "overview",
  label: "Tổng quan",
  icon: "layout-dashboard"
}, {
  id: "activities",
  label: "Hoạt động",
  icon: "activity"
}, {
  id: "survey",
  label: "Khảo sát",
  icon: "clipboard-list"
}, {
  id: "students",
  label: "Quản lý học sinh",
  icon: "users",
  badge: 2
}, {
  id: "content",
  label: "Kế hoạch nội dung",
  icon: "calendar-days"
}, {
  id: "approval",
  label: "Hàng đợi duyệt",
  icon: "check-square",
  badge: 2
}, {
  id: "social",
  label: "Hiện diện xã hội",
  icon: "share-2"
}, {
  id: "finance",
  label: "Tài trợ & tài chính",
  icon: "heart-handshake",
  badge: 3
}];
function Sidebar({
  area,
  go,
  open,
  onClose
}) {
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
    className: "scrim" + (open ? " is-open" : ""),
    onClick: onClose
  }), /*#__PURE__*/React.createElement("aside", {
    className: "sidebar" + (open ? " is-open" : "")
  }, /*#__PURE__*/React.createElement("div", {
    className: "sidebar__brand"
  }, /*#__PURE__*/React.createElement("img", {
    src: "../../assets/hmt-mark.png",
    alt: ""
  }), /*#__PURE__*/React.createElement("div", {
    className: "sidebar__brand-text"
  }, /*#__PURE__*/React.createElement("span", {
    className: "sidebar__brand-name"
  }, "hoa m\u1EB7t tr\u1EDDi"), /*#__PURE__*/React.createElement("span", {
    className: "sidebar__brand-sub"
  }, "Qu\u1EF9 t\u1EEB thi\u1EC7n"))), /*#__PURE__*/React.createElement("div", {
    className: "nav-group"
  }, /*#__PURE__*/React.createElement("div", {
    className: "nav-group__label"
  }, "\u0110i\u1EC1u h\xE0nh"), NAV.map(n => /*#__PURE__*/React.createElement("a", {
    key: n.id,
    href: "#",
    className: "nav-item" + (area === n.id ? " is-active" : ""),
    onClick: e => {
      e.preventDefault();
      go(n.id);
      onClose && onClose();
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: n.icon,
    size: 18
  }), " ", n.label, n.badge && /*#__PURE__*/React.createElement("span", {
    className: "nav-item__badge"
  }, n.badge)))), /*#__PURE__*/React.createElement("div", {
    className: "sidebar__foot"
  }, /*#__PURE__*/React.createElement("a", {
    href: "#",
    className: "nav-item",
    onClick: e => e.preventDefault()
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "log-out",
    size: 18
  }), " \u0110\u0103ng xu\u1EA5t"))));
}

/* --- Topbar --- */
function Topbar({
  areaLabel,
  pageTitle,
  onMenu
}) {
  return /*#__PURE__*/React.createElement("header", {
    className: "topbar"
  }, /*#__PURE__*/React.createElement("button", {
    className: "icon-btn hamburger",
    onClick: onMenu,
    "aria-label": "Menu"
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "menu",
    size: 18
  })), /*#__PURE__*/React.createElement("div", {
    className: "topbar__title"
  }, /*#__PURE__*/React.createElement("span", {
    className: "topbar__area"
  }, areaLabel), /*#__PURE__*/React.createElement("span", {
    className: "topbar__page"
  }, pageTitle)), /*#__PURE__*/React.createElement("div", {
    className: "topbar__spacer"
  }), /*#__PURE__*/React.createElement("div", {
    className: "topbar__search"
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "search",
    size: 16
  }), /*#__PURE__*/React.createElement("input", {
    placeholder: "T\xECm ho\u1EA1t \u0111\u1ED9ng, h\u1ECDc sinh, nh\xE0 t\xE0i tr\u1EE3\u2026"
  })), /*#__PURE__*/React.createElement("div", {
    className: "topbar__user"
  }, /*#__PURE__*/React.createElement("button", {
    className: "icon-btn"
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "bell",
    size: 18
  })), /*#__PURE__*/React.createElement("div", {
    className: "avatar"
  }, "L")));
}

/* --- Modal --- */
function Modal({
  open,
  onClose,
  title,
  meta,
  children,
  foot,
  width
}) {
  useEffect(() => {
    function esc(e) {
      if (e.key === "Escape") onClose();
    }
    if (open) document.addEventListener("keydown", esc);
    return () => document.removeEventListener("keydown", esc);
  }, [open, onClose]);
  return /*#__PURE__*/React.createElement("div", {
    className: "overlay" + (open ? " is-open" : ""),
    onClick: onClose
  }, /*#__PURE__*/React.createElement("div", {
    className: "modal",
    style: width ? {
      maxWidth: width
    } : null,
    onClick: e => e.stopPropagation()
  }, /*#__PURE__*/React.createElement("div", {
    className: "modal__head"
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h3", null, title), meta && /*#__PURE__*/React.createElement("div", {
    className: "card__title-meta"
  }, meta)), /*#__PURE__*/React.createElement("button", {
    className: "icon-btn",
    onClick: onClose
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "x",
    size: 18
  }))), /*#__PURE__*/React.createElement("div", {
    className: "modal__body"
  }, children), foot && /*#__PURE__*/React.createElement("div", {
    className: "modal__foot"
  }, foot)));
}

/* --- Drawer --- */
function Drawer({
  open,
  onClose,
  title,
  children,
  foot
}) {
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
    className: "overlay" + (open ? " is-open" : ""),
    onClick: onClose,
    style: {
      background: "rgba(28,36,48,.42)"
    }
  }), /*#__PURE__*/React.createElement("aside", {
    className: "drawer" + (open ? " is-open" : "")
  }, /*#__PURE__*/React.createElement("div", {
    className: "drawer__head"
  }, /*#__PURE__*/React.createElement("h3", null, title), /*#__PURE__*/React.createElement("button", {
    className: "icon-btn",
    onClick: onClose
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "x",
    size: 18
  }))), /*#__PURE__*/React.createElement("div", {
    className: "drawer__body"
  }, children), foot && /*#__PURE__*/React.createElement("div", {
    className: "drawer__foot"
  }, foot)));
}

/* --- Toast stack (controlled by useToasts) --- */
function useToasts() {
  const [toasts, setToasts] = useState([]);
  function push(msg, kind = "ok") {
    const id = Math.random().toString(36).slice(2);
    setToasts(t => [...t, {
      id,
      msg,
      kind
    }]);
    setTimeout(() => setToasts(t => t.filter(x => x.id !== id)), 3600);
  }
  return {
    toasts,
    push,
    dismiss: id => setToasts(t => t.filter(x => x.id !== id))
  };
}
function Toasts({
  toasts,
  dismiss
}) {
  return /*#__PURE__*/React.createElement("div", {
    className: "toast-stack"
  }, toasts.map(t => /*#__PURE__*/React.createElement("div", {
    key: t.id,
    className: "toast" + (t.kind === "ok" ? " toast--ok" : t.kind === "warn" ? " toast--warn" : "")
  }, /*#__PURE__*/React.createElement(Icon, {
    name: t.kind === "ok" ? "check" : t.kind === "warn" ? "alert-triangle" : "info",
    size: 18
  }), t.msg, /*#__PURE__*/React.createElement("button", {
    className: "toast__close",
    onClick: () => dismiss(t.id)
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "x",
    size: 16
  })))));
}

/* --- Page header --- */
function PageHead({
  title,
  sub,
  actions
}) {
  return /*#__PURE__*/React.createElement("div", {
    className: "page-head"
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h1", null, title), sub && /*#__PURE__*/React.createElement("div", {
    className: "page-head__sub"
  }, sub)), actions && /*#__PURE__*/React.createElement("div", {
    className: "btn-row"
  }, actions));
}

/* --- Empty state --- */
function Empty({
  title,
  children,
  action
}) {
  return /*#__PURE__*/React.createElement("div", {
    className: "empty"
  }, /*#__PURE__*/React.createElement("img", {
    className: "empty__art",
    src: "../../assets/hmt-mark.png",
    alt: ""
  }), /*#__PURE__*/React.createElement("h3", null, title), children && /*#__PURE__*/React.createElement("p", null, children), action);
}
Object.assign(window, {
  Icon,
  Pill,
  Chip,
  Kpi,
  Breadcrumb,
  Sidebar,
  Topbar,
  Modal,
  Drawer,
  useToasts,
  Toasts,
  PageHead,
  Empty,
  NAV
});
})(); } catch (e) { __ds_ns.__errors.push({ path: "ui_kits/management-hub/components.jsx", error: String((e && e.message) || e) }); }

// ui_kits/management-hub/data.jsx
try { (() => {
/* ============================================================
   Mock data for the HMT Management Hub UI kit
   ============================================================ */

const STATUS = {
  wait: {
    cls: "pill--wait",
    label: "chờ upload"
  },
  proc: {
    cls: "pill--proc",
    label: "đang xử lý"
  },
  rev: {
    cls: "pill--rev",
    label: "chờ duyệt"
  },
  appr: {
    cls: "pill--appr",
    label: "đã duyệt"
  },
  pub: {
    cls: "pill--pub",
    label: "đã đăng"
  },
  rej: {
    cls: "pill--rej",
    label: "từ chối"
  }
};

// --- Post-bundles for the approval queue ---
const BUNDLES = [{
  id: "evt_2025_0142",
  title: "Trao học bổng THPT Cao Thắng",
  program: "Học bổng Mặt Trời",
  status: "rev",
  age: "2 ngày",
  student: "Nguyễn Thu Hà",
  caption: "Không chỉ trao học bổng — chúng tôi trao cơ hội trưởng thành. Sáng nay, 9 em học sinh THPT Cao Thắng đã nhận học bổng kỳ II từ Quỹ Hoa Mặt Trời. 🌻",
  checklist: [{
    k: "Ảnh đầy đủ",
    ok: true
  }, {
    k: "Alt-text",
    ok: true
  }, {
    k: "Nguồn ảnh",
    ok: true
  }, {
    k: "Caption",
    ok: true
  }],
  findings: [],
  photos: 4,
  note: null,
  postedId: null
}, {
  id: "evt_2025_0139",
  title: "Thăm lớp học vùng cao Hà Giang",
  program: "Đồng hành tới trường",
  status: "rev",
  age: "3 ngày",
  student: null,
  caption: "Một ngày ở Đồng Văn: con đường tới trường còn xa, nhưng nụ cười thì thật gần.",
  checklist: [{
    k: "Ảnh đầy đủ",
    ok: true
  }, {
    k: "Alt-text",
    ok: false
  }, {
    k: "Nguồn ảnh",
    ok: true
  }, {
    k: "Caption",
    ok: true
  }],
  findings: ["Thiếu alt-text cho 2 ảnh"],
  photos: 6,
  note: null,
  postedId: null
}, {
  id: "evt_2025_0137",
  title: "Quà Trung thu cho 40 em nhỏ",
  program: "Tết & Trung thu",
  status: "rej",
  age: "5 ngày",
  student: null,
  caption: "Trăng tròn, lòng ấm. Đêm hội Trung thu cùng 40 em nhỏ tại mái ấm Hoa Sữa.",
  checklist: [{
    k: "Ảnh đầy đủ",
    ok: true
  }, {
    k: "Alt-text",
    ok: true
  }, {
    k: "Nguồn ảnh",
    ok: false
  }, {
    k: "Caption",
    ok: false
  }],
  findings: ["Chưa rõ nguồn ảnh", "Caption nhắc tên em nhỏ"],
  photos: 5,
  note: "Làm mờ khuôn mặt em nhỏ chưa đủ tuổi ở ảnh 2 và bỏ tên riêng trong caption.",
  postedId: null
}, {
  id: "evt_2025_0134",
  title: "Khánh thành thư viện Mặt Trời số 7",
  program: "Thư viện Mặt Trời",
  status: "appr",
  age: "1 tuần",
  student: null,
  caption: "Thư viện thứ 7 đã mở cửa — thêm một nơi để các em được mơ xa hơn.",
  checklist: [{
    k: "Ảnh đầy đủ",
    ok: true
  }, {
    k: "Alt-text",
    ok: true
  }, {
    k: "Nguồn ảnh",
    ok: true
  }, {
    k: "Caption",
    ok: true
  }],
  findings: [],
  photos: 8,
  note: null,
  postedId: null
}, {
  id: "evt_2025_0130",
  title: "Lời cảm ơn nhà tài trợ quý II",
  program: "Tri ân",
  status: "pub",
  age: "2 tuần",
  student: null,
  caption: "Cảm ơn 24 tấm lòng đã đồng hành cùng Hoa Mặt Trời trong quý II/2025.",
  checklist: [{
    k: "Ảnh đầy đủ",
    ok: true
  }, {
    k: "Alt-text",
    ok: true
  }, {
    k: "Nguồn ảnh",
    ok: true
  }, {
    k: "Caption",
    ok: true
  }],
  findings: [],
  photos: 3,
  note: null,
  postedId: "1789123456789"
}];

// --- Contributions for finance thank-you queue ---
const CONTRIBUTIONS = [{
  id: "c1",
  donor: "Chị Trần Mai",
  amount: 2000000,
  date: "12/06",
  method: "Chuyển khoản",
  thanked: false,
  kind: "Tiền mặt"
}, {
  id: "c2",
  donor: "Anh Lê Quốc Hùng",
  amount: 5000000,
  date: "11/06",
  method: "Chuyển khoản",
  thanked: false,
  kind: "Tiền mặt"
}, {
  id: "c3",
  donor: "Công ty Minh An",
  amount: 15000000,
  date: "09/06",
  method: "Hợp đồng",
  thanked: false,
  kind: "Tiền mặt"
}, {
  id: "c4",
  donor: "Cô Phạm Lan",
  amount: 1000000,
  date: "08/06",
  method: "Tiền mặt",
  thanked: true,
  kind: "Tiền mặt"
}, {
  id: "c5",
  donor: "Nhóm thiện nguyện Sen",
  amount: 0,
  date: "07/06",
  method: "Hiện vật",
  thanked: false,
  kind: "30 thùng sách"
}];
const FIN_KPI = [{
  label: "Tổng đóng góp tháng",
  value: "48,2",
  unit: "triệu ₫",
  delta: "+12% so với T5",
  up: true,
  icon: "wallet"
}, {
  label: "Nhà tài trợ",
  value: "24",
  unit: "",
  delta: "+3 mới",
  up: true,
  icon: "users"
}, {
  label: "Chờ cảm ơn",
  value: "3",
  unit: "",
  delta: "cần xử lý",
  icon: "heart-handshake",
  to: "thanks"
}, {
  label: "Hiện vật quý này",
  value: "7",
  unit: "lô",
  delta: "đã nhận",
  icon: "package"
}];

// --- Students roster ---
const STUDENTS = [{
  id: "s1",
  name: "Nguyễn Thu Hà",
  grade: "Lớp 11",
  school: "THPT Cao Thắng",
  program: "Học bổng Mặt Trời",
  since: "2023",
  watch: false,
  status: "Ổn định"
}, {
  id: "s2",
  name: "Trần Minh Khôi",
  grade: "Lớp 9",
  school: "THCS Tân Lập",
  program: "Đồng hành tới trường",
  since: "2024",
  watch: true,
  status: "Cần theo dõi"
}, {
  id: "s3",
  name: "Lê Bảo Ngọc",
  grade: "Lớp 12",
  school: "THPT Cao Thắng",
  program: "Học bổng Mặt Trời",
  since: "2022",
  watch: false,
  status: "Ổn định"
}, {
  id: "s4",
  name: "Phạm Gia Bảo",
  grade: "Lớp 7",
  school: "THCS Hoà Bình",
  program: "Đồng hành tới trường",
  since: "2024",
  watch: false,
  status: "Ổn định"
}, {
  id: "s5",
  name: "Vũ Khánh Linh",
  grade: "Lớp 10",
  school: "THPT Nguyễn Du",
  program: "Học bổng Mặt Trời",
  since: "2023",
  watch: true,
  status: "Cần theo dõi"
}];

// --- Overview KPIs ---
const OV_KPI = [{
  id: "rev",
  label: "Bài chờ duyệt",
  value: "2",
  icon: "inbox",
  delta: "+2 hôm nay",
  up: true,
  preview: ["Trao học bổng THPT Cao Thắng", "Thăm lớp vùng cao Hà Giang"],
  to: "approval",
  cta: "Duyệt ngay"
}, {
  id: "thanks",
  label: "Chờ cảm ơn",
  value: "3",
  icon: "heart-handshake",
  delta: "đóng góp mới",
  preview: ["Chị Trần Mai · 2.000.000 ₫", "Anh Lê Quốc Hùng · 5.000.000 ₫"],
  to: "finance",
  cta: "Xử lý"
}, {
  id: "watch",
  label: "Học sinh cần theo dõi",
  value: "2",
  icon: "alert-circle",
  delta: "watchlist",
  preview: ["Trần Minh Khôi · Lớp 9", "Vũ Khánh Linh · Lớp 10"],
  to: "students",
  cta: "Xem hồ sơ"
}, {
  id: "act",
  label: "Hoạt động tháng",
  value: "12",
  unit: "/15",
  icon: "activity",
  delta: "đúng tiến độ",
  preview: ["Khánh thành thư viện số 7", "Quà Trung thu cho 40 em"],
  to: "approval",
  cta: "Xem tất cả"
}, {
  id: "cov",
  label: "Độ phủ 8 cánh",
  value: "6",
  unit: "/8",
  icon: "flower",
  delta: "2 cánh thiếu nội dung",
  preview: ["Thiếu: Sức khoẻ học đường", "Thiếu: Kỹ năng số"],
  to: "approval",
  cta: "Lập kế hoạch"
}];

// --- Today's action list ---
const ACTIONS = [{
  icon: "check-square",
  text: "Duyệt bài “Trao học bổng THPT Cao Thắng”",
  meta: "Hàng đợi duyệt · chờ 2 ngày",
  to: "approval",
  bundle: "evt_2025_0142",
  kind: "rev"
}, {
  icon: "message-square-warning",
  text: "Bài “Thăm lớp vùng cao Hà Giang” thiếu alt-text",
  meta: "Hàng đợi duyệt · cần sửa nhỏ",
  to: "approval",
  bundle: "evt_2025_0139",
  kind: "rev"
}, {
  icon: "heart-handshake",
  text: "Gửi lời cảm ơn chị Trần Mai (2.000.000 ₫)",
  meta: "Tài trợ · đóng góp 12/06",
  to: "finance",
  kind: "thanks"
}, {
  icon: "alert-circle",
  text: "Xem lại học sinh Trần Minh Khôi (watchlist)",
  meta: "Quản lý học sinh · cảnh báo theo dõi",
  to: "students",
  kind: "watch"
}];
function fmtVnd(n) {
  if (n === 0) return "—";
  return n.toLocaleString("vi-VN") + " ₫";
}
Object.assign(window, {
  STATUS,
  BUNDLES,
  CONTRIBUTIONS,
  FIN_KPI,
  STUDENTS,
  OV_KPI,
  ACTIONS,
  fmtVnd
});
})(); } catch (e) { __ds_ns.__errors.push({ path: "ui_kits/management-hub/data.jsx", error: String((e && e.message) || e) }); }

})();
