I want you to use the blow content to make a presentation. SLIDE 21 Emergency Response to PPH First 5 Minutes: "Golden Minutes" PPH is a medical emergency. Immediate action saves lives. Immediate Actions Recognize excessive bleeding. Activate the PPH emergency protocol. Call for senior obstetrician, anesthetist, pediatrician, blood bank, and nursing staff. Inform the operation theatre. Assign roles to team members. Record the time of diagnosis. Team Roles Team Member Responsibility Obstetrician Diagnose cause and control bleeding Anaesthetist Airway, circulation, resuscitation Nurses IV access, medications, monitoring Blood Bank Arrange blood and blood products Clinical Pearl: Never manage severe PPH alone. SLIDE 22 ABCDE Assessment A – Airway Ensure airway is patent. Position patient appropriately. Intubate if unconscious or airway is compromised. B – Breathing Administer 100% oxygen (10–15 L/min) via non-rebreather mask. Monitor SpO₂ continuously. C – Circulation Assess pulse and blood pressure. Insert two wide-bore (14G–16G) IV cannulas. Send blood for investigations. Start rapid fluid resuscitation. D – Disability Assess consciousness (AVPU/GCS). Check blood glucose if altered sensorium. E – Exposure Examine patient completely. Keep the patient warm to prevent hypothermia. SLIDE 23 Initial Resuscitation IV Access Two 14G–16G IV cannulas. Blood Samples CBC Blood grouping and cross-match PT/INR aPTT Fibrinogen Renal function tests Liver function tests ABG (if available) Monitoring Pulse Blood pressure Respiratory rate ECG SpO₂ Urine output Mental status Goal Restore circulating volume while controlling bleeding. SLIDE 24 Fluid Resuscitation Initial Fluids Warm isotonic crystalloids: Normal saline Ringer's lactate Recommendation Infuse 1–2 liters rapidly while arranging blood. Avoid Excessive crystalloids (>3 L) Delayed blood transfusion Monitoring Pulse Blood pressure Urine output Capillary refill Lactate (if available) Clinical Pearl Fluids temporarily restore circulation but do not replace blood loss. SLIDE 25 Blood and Blood Product Replacement Indications Continued bleeding Hemodynamic instability Hb <7 g/dL (or higher threshold if symptomatic) Blood Products Product Purpose Packed RBCs Restore oxygen-carrying capacity Fresh Frozen Plasma (FFP) Replace clotting factors Platelets Treat thrombocytopenia Cryoprecipitate Replace fibrinogen Massive Transfusion Protocol Approximate ratio: PRBC : FFP : Platelets = 1 : 1 : 1 Target Maintain: Hb >7–8 g/dL Platelets >50,000/µL Fibrinogen >2 g/L SLIDE 26 Uterine Massage Purpose Stimulates uterine contraction and reduces bleeding. Technique Place one hand over the uterine fundus. Massage using firm circular movements. Continue until the uterus becomes firm. Benefits Simple Immediate Effective in uterine atony Can be repeated Important Always perform uterine massage while preparing uterotonic drugs. Suggested Image: Technique of fundal massage. SLIDE 27 Uterotonic Drugs First-Line Medical Treatment Drug Dose Route Oxytocin 10 IU IM or slow IV Oxytocin infusion 20–40 IU in 1 L NS/RL IV infusion Methylergometrine 0.2 mg IM/slow IV Carboprost 250 µg IM (repeat every 15–90 min; max 8 doses) Misoprostol 800–1000 µg Rectal or sublingual Principle Use uterotonics early and do not delay escalation if bleeding continues. SLIDE 28 Oxytocin – Drug of Choice Mechanism Stimulates rhythmic uterine contractions. Compresses uterine blood vessels. Promotes hemostasis. Dose 10 IU IM after delivery OR 10 IU slow IV OR 20–40 IU in 1 L crystalloid as IV infusion. Advantages Rapid onset Highly effective Safe Few adverse effects Side Effects Hypotension (rapid IV bolus) Water intoxication (prolonged high-dose infusion) Clinical Pearl Oxytocin is the first-line uterotonic recommended by WHO. SLIDE 29 Other Uterotonics Methylergometrine Dose: 0.2 mg IM Contraindication: Hypertension Preeclampsia Heart disease Carboprost (15-methyl PGF₂α) Dose: 250 µg IM Repeat every 15–90 minutes Maximum: 8 doses Contraindication: Asthma Misoprostol Dose: 800–1000 µg Rectal or sublingual Advantages: Cheap Heat stable Useful in low-resource settings SLIDE 30 Tranexamic Acid (TXA) Mechanism Antifibrinolytic drug Prevents clot breakdown Stabilizes formed clots WHO Recommendation Administer within 3 hours of childbirth in women with PPH. Dose 1 g IV over 10 minutes Repeat 1 g if bleeding continues after 30 minutes or restarts within 24 hours. Benefits Reduces death due to bleeding Decreases need for surgery Effective for all causes of PPH when used early Contraindications Active thromboembolic disease (relative) Known hypersensitivity Key Message TXA should be given as early as possible along with standard PPH treatment—it is not a substitute for uterotonics or surgery.

Reading File
Reading File
Now I have enough to build this. Let me create the presentation using PptxGenJS with a medical/clinical theme - deep navy/red palette appropriate for emergency obstetrics content.
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or missing"

Writing File

~/pph-slides/pph_emergency.js

const pptxgen = require("pptxgenjs");

let pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Emergency Response to PPH";
pres.author = "Clinical Education";

// ─── COLOR PALETTE ───────────────────────────────────────────────────────────
const C = {
  navy:    "0D1B2A",   // dominant dark background
  crimson: "C0392B",   // accent / danger red
  teal:    "1ABC9C",   // highlight / clinical green
  gold:    "F39C12",   // pearl / warning amber
  white:   "FFFFFF",
  light:   "ECF0F1",   // soft white for body text
  slate:   "2C3E50",   // mid-dark for cards
  muted:   "7F8C8D",   // de-emphasised text
  pearl:   "FFF3CD",   // clinical pearl bg
  pearlTx: "856404",   // clinical pearl text
};

// ─── HELPERS ─────────────────────────────────────────────────────────────────
function addSlideHeader(slide, title, slideNum, accentColor = C.crimson) {
  // Top bar
  slide.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 10, h: 0.72,
    fill: { color: accentColor },
    line: { type: "none" },
  });
  // Slide number badge
  slide.addShape(pres.ShapeType.rect, {
    x: 9.3, y: 0.12, w: 0.55, h: 0.44,
    fill: { color: "FFFFFF22" },
    line: { type: "none" },
    rectRadius: 0.05,
  });
  slide.addText(`${slideNum}`, {
    x: 9.3, y: 0.12, w: 0.55, h: 0.44,
    fontSize: 11, bold: true, color: C.white,
    align: "center", valign: "middle", margin: 0,
  });
  // Title text
  slide.addText(title, {
    x: 0.25, y: 0, w: 8.9, h: 0.72,
    fontSize: 19, bold: true, color: C.white,
    valign: "middle", margin: 0,
    fontFace: "Calibri",
  });
  // Background
  slide.background = { color: C.navy };
}

function addClinicalPearl(slide, text, y = 4.8) {
  slide.addShape(pres.ShapeType.rect, {
    x: 0.35, y: y, w: 9.3, h: 0.62,
    fill: { color: C.gold },
    line: { type: "none" },
    rectRadius: 0.06,
  });
  slide.addText([
    { text: "💡 Clinical Pearl: ", options: { bold: true, color: "7B3F00" } },
    { text: text, options: { bold: false, color: "3B2001" } },
  ], {
    x: 0.35, y: y, w: 9.3, h: 0.62,
    fontSize: 11.5, valign: "middle", margin: [0, 10, 0, 10],
    fontFace: "Calibri",
  });
}

function bulletList(items, opts = {}) {
  return items.map((item, i) => ({
    text: item,
    options: {
      bullet: { type: "bullet", characterCode: "25B6", color: opts.bulletColor || C.teal },
      color: opts.color || C.light,
      fontSize: opts.fontSize || 12,
      breakLine: i < items.length - 1,
      bold: false,
      indentLevel: opts.indent || 0,
    },
  }));
}

// ─── SLIDE 21: Emergency Response – Golden Minutes ───────────────────────────
{
  const slide = pres.addSlide();
  addSlideHeader(slide, "Emergency Response to PPH  |  First 5 Minutes: 'Golden Minutes'", 21, C.crimson);

  // Intro banner
  slide.addShape(pres.ShapeType.rect, {
    x: 0.35, y: 0.82, w: 9.3, h: 0.44,
    fill: { color: C.crimson + "33" },
    line: { color: C.crimson, pt: 1 },
    rectRadius: 0.05,
  });
  slide.addText("PPH is a medical emergency — Immediate action saves lives.", {
    x: 0.35, y: 0.82, w: 9.3, h: 0.44,
    fontSize: 12, bold: true, color: C.crimson, align: "center", valign: "middle",
    margin: 0, fontFace: "Calibri",
  });

  // Left column: Immediate Actions
  slide.addShape(pres.ShapeType.rect, {
    x: 0.3, y: 1.38, w: 4.5, h: 2.88,
    fill: { color: C.slate },
    line: { type: "none" },
    rectRadius: 0.08,
  });
  slide.addText("⚡ Immediate Actions", {
    x: 0.3, y: 1.38, w: 4.5, h: 0.4,
    fontSize: 12.5, bold: true, color: C.teal,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
  const actions = [
    "Recognize excessive bleeding",
    "Activate the PPH emergency protocol",
    "Call for senior obstetrician, anaesthetist,\n   pediatrician, blood bank & nursing staff",
    "Inform the operation theatre",
    "Assign roles to team members",
    "Record the time of diagnosis",
  ];
  slide.addText(actions.map((a, i) => ({
    text: a,
    options: { bullet: { type: "bullet", characterCode: "25CF", color: C.crimson }, color: C.light, fontSize: 10.5, breakLine: i < actions.length - 1 },
  })), {
    x: 0.3, y: 1.82, w: 4.5, h: 2.3,
    valign: "top", margin: [0, 12, 0, 12], fontFace: "Calibri",
  });

  // Right column: Team Roles table
  slide.addShape(pres.ShapeType.rect, {
    x: 5.0, y: 1.38, w: 4.65, h: 2.88,
    fill: { color: C.slate },
    line: { type: "none" },
    rectRadius: 0.08,
  });
  slide.addText("👥 Team Roles", {
    x: 5.0, y: 1.38, w: 4.65, h: 0.4,
    fontSize: 12.5, bold: true, color: C.teal,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });

  const tableRows = [
    [
      { text: "Team Member", options: { bold: true, color: C.teal, fontSize: 10 } },
      { text: "Responsibility", options: { bold: true, color: C.teal, fontSize: 10 } },
    ],
    [
      { text: "Obstetrician", options: { bold: true, color: C.light, fontSize: 10 } },
      { text: "Diagnose cause & control bleeding", options: { color: C.light, fontSize: 10 } },
    ],
    [
      { text: "Anaesthetist", options: { bold: true, color: C.light, fontSize: 10 } },
      { text: "Airway, circulation, resuscitation", options: { color: C.light, fontSize: 10 } },
    ],
    [
      { text: "Nurses", options: { bold: true, color: C.light, fontSize: 10 } },
      { text: "IV access, medications, monitoring", options: { color: C.light, fontSize: 10 } },
    ],
    [
      { text: "Blood Bank", options: { bold: true, color: C.light, fontSize: 10 } },
      { text: "Arrange blood & blood products", options: { color: C.light, fontSize: 10 } },
    ],
  ];
  slide.addTable(tableRows, {
    x: 5.0, y: 1.82, w: 4.65, h: 2.3,
    colW: [1.6, 3.0],
    border: { type: "solid", color: "2C3E5088", pt: 0.5 },
    fill: "00000000",
    fontFace: "Calibri",
    rowH: 0.42,
  });

  addClinicalPearl(slide, "Never manage severe PPH alone.", 4.82);
}

// ─── SLIDE 22: ABCDE Assessment ──────────────────────────────────────────────
{
  const slide = pres.addSlide();
  addSlideHeader(slide, "ABCDE Assessment", 22, "1A5276");

  const abcde = [
    { letter: "A", color: "#E74C3C", label: "Airway", points: ["Ensure airway is patent", "Position patient appropriately", "Intubate if unconscious or airway compromised"] },
    { letter: "B", color: "#E67E22", label: "Breathing", points: ["100% O₂ (10–15 L/min) via non-rebreather mask", "Monitor SpO₂ continuously"] },
    { letter: "C", color: "#F1C40F", label: "Circulation", points: ["Assess pulse & blood pressure", "Two wide-bore (14G–16G) IV cannulas", "Send blood for investigations", "Start rapid fluid resuscitation"] },
    { letter: "D", color: "#2ECC71", label: "Disability", points: ["Assess consciousness (AVPU/GCS)", "Check blood glucose if altered sensorium"] },
    { letter: "E", color: "#3498DB", label: "Exposure", points: ["Examine patient completely", "Keep warm to prevent hypothermia"] },
  ];

  abcde.forEach((item, idx) => {
    const col = idx < 3 ? idx : idx - 3;
    const row = idx < 3 ? 0 : 1;
    const x = row === 0 ? 0.2 + col * 3.22 : 0.2 + (col + 0.5) * 3.22;
    const y = row === 0 ? 0.85 : 3.02;
    const w = 2.9;
    const h = row === 0 ? 2.0 : 2.0;

    // Card background
    slide.addShape(pres.ShapeType.rect, {
      x, y, w, h,
      fill: { color: C.slate },
      line: { color: item.color.replace("#",""), pt: 1.5 },
      rectRadius: 0.1,
    });
    // Letter badge
    slide.addShape(pres.ShapeType.rect, {
      x: x + 0.1, y: y + 0.08, w: 0.42, h: 0.42,
      fill: { color: item.color.replace("#","") },
      line: { type: "none" },
      rectRadius: 0.05,
    });
    slide.addText(item.letter, {
      x: x + 0.1, y: y + 0.08, w: 0.42, h: 0.42,
      fontSize: 16, bold: true, color: C.white,
      align: "center", valign: "middle", margin: 0, fontFace: "Calibri",
    });
    // Label
    slide.addText(item.label, {
      x: x + 0.6, y: y + 0.08, w: w - 0.7, h: 0.42,
      fontSize: 13, bold: true, color: item.color.replace("#",""),
      valign: "middle", margin: 0, fontFace: "Calibri",
    });
    // Points
    slide.addText(item.points.map((p, i) => ({
      text: p,
      options: { bullet: { type: "bullet", characterCode: "25BA", color: "AAAAAA" }, color: C.light, fontSize: 9.5, breakLine: i < item.points.length - 1 },
    })), {
      x: x + 0.1, y: y + 0.56, w: w - 0.2, h: h - 0.64,
      valign: "top", margin: [0, 4, 0, 4], fontFace: "Calibri",
    });
  });
}

// ─── SLIDE 23: Initial Resuscitation ─────────────────────────────────────────
{
  const slide = pres.addSlide();
  addSlideHeader(slide, "Initial Resuscitation", 23, "6C3483");

  const panels = [
    {
      title: "💉 IV Access",
      x: 0.25, y: 0.85, w: 2.3, h: 4.2,
      items: ["Two 14G–16G\nIV cannulas"],
      highlight: true,
    },
    {
      title: "🔬 Blood Samples",
      x: 2.7, y: 0.85, w: 3.0, h: 4.2,
      items: ["CBC", "Blood grouping & cross-match", "PT / INR", "aPTT", "Fibrinogen", "Renal function tests", "Liver function tests", "ABG (if available)"],
    },
    {
      title: "📊 Monitoring",
      x: 5.85, y: 0.85, w: 2.3, h: 4.2,
      items: ["Pulse", "Blood pressure", "Respiratory rate", "ECG", "SpO₂", "Urine output", "Mental status"],
    },
    {
      title: "🎯 Goal",
      x: 8.3, y: 0.85, w: 1.45, h: 4.2,
      items: ["Restore circulating volume while controlling bleeding"],
      goal: true,
    },
  ];

  panels.forEach(panel => {
    slide.addShape(pres.ShapeType.rect, {
      x: panel.x, y: panel.y, w: panel.w, h: panel.h,
      fill: { color: panel.goal ? C.crimson + "55" : C.slate },
      line: { color: panel.goal ? C.crimson : C.teal, pt: 1 },
      rectRadius: 0.08,
    });
    slide.addText(panel.title, {
      x: panel.x, y: panel.y + 0.05, w: panel.w, h: 0.45,
      fontSize: 11, bold: true, color: C.teal,
      align: "center", valign: "middle", margin: [0, 4, 0, 4], fontFace: "Calibri",
    });
    slide.addShape(pres.ShapeType.line, {
      x: panel.x + 0.15, y: panel.y + 0.5, w: panel.w - 0.3, h: 0,
      line: { color: C.teal + "66", pt: 0.5 },
    });
    slide.addText(panel.items.map((item, i) => ({
      text: item,
      options: {
        bullet: panel.goal ? false : { type: "bullet", characterCode: "25CF", color: C.crimson },
        color: panel.goal ? C.white : C.light,
        fontSize: panel.goal ? 11 : 10.5,
        bold: panel.goal,
        align: panel.goal ? "center" : "left",
        breakLine: i < panel.items.length - 1,
      },
    })), {
      x: panel.x + 0.05, y: panel.y + 0.55, w: panel.w - 0.1, h: panel.h - 0.65,
      valign: "top", margin: [0, 6, 0, 6], fontFace: "Calibri",
    });
  });
}

// ─── SLIDE 24: Fluid Resuscitation ───────────────────────────────────────────
{
  const slide = pres.addSlide();
  addSlideHeader(slide, "Fluid Resuscitation", 24, "117A65");

  // Left: Initial Fluids
  slide.addShape(pres.ShapeType.rect, {
    x: 0.25, y: 0.85, w: 4.5, h: 2.4,
    fill: { color: C.slate },
    line: { color: C.teal, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText("💧 Initial Fluids — Warm Isotonic Crystalloids", {
    x: 0.25, y: 0.85, w: 4.5, h: 0.45,
    fontSize: 11.5, bold: true, color: C.teal,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
  slide.addText([
    { text: "Normal Saline", options: { bullet: { type: "bullet", characterCode: "25B6", color: C.teal }, color: C.light, fontSize: 12, breakLine: true } },
    { text: "Ringer's Lactate", options: { bullet: { type: "bullet", characterCode: "25B6", color: C.teal }, color: C.light, fontSize: 12, breakLine: false } },
  ], {
    x: 0.25, y: 1.35, w: 4.5, h: 0.9,
    valign: "middle", margin: [0, 12, 0, 12], fontFace: "Calibri",
  });
  // Recommendation
  slide.addShape(pres.ShapeType.rect, {
    x: 0.25, y: 2.38, w: 4.5, h: 0.72,
    fill: { color: C.teal + "22" },
    line: { color: C.teal, pt: 0.8 },
    rectRadius: 0.06,
  });
  slide.addText("📋 Infuse 1–2 litres rapidly while arranging blood.", {
    x: 0.25, y: 2.38, w: 4.5, h: 0.72,
    fontSize: 11, color: C.teal, bold: true,
    align: "center", valign: "middle", margin: [0, 8, 0, 8], fontFace: "Calibri",
  });

  // Right: Avoid + Monitoring
  slide.addShape(pres.ShapeType.rect, {
    x: 5.0, y: 0.85, w: 4.65, h: 1.55,
    fill: { color: C.crimson + "22" },
    line: { color: C.crimson, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText("🚫 Avoid", {
    x: 5.0, y: 0.85, w: 4.65, h: 0.4,
    fontSize: 12, bold: true, color: C.crimson,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
  slide.addText([
    { text: "Excessive crystalloids (>3 L)", options: { bullet: { type: "bullet", characterCode: "2716", color: C.crimson }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Delayed blood transfusion", options: { bullet: { type: "bullet", characterCode: "2716", color: C.crimson }, color: C.light, fontSize: 11 } },
  ], {
    x: 5.0, y: 1.28, w: 4.65, h: 1.0,
    valign: "top", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });

  slide.addShape(pres.ShapeType.rect, {
    x: 5.0, y: 2.55, w: 4.65, h: 1.6,
    fill: { color: C.slate },
    line: { color: C.gold, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText("📈 Monitoring", {
    x: 5.0, y: 2.55, w: 4.65, h: 0.4,
    fontSize: 12, bold: true, color: C.gold,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
  slide.addText([
    { text: "Pulse  •  Blood Pressure  •  Urine Output  •  Capillary Refill  •  Lactate (if available)", options: { color: C.light, fontSize: 11, bold: false } },
  ], {
    x: 5.0, y: 3.0, w: 4.65, h: 1.0,
    valign: "middle", margin: [0, 10, 0, 10], align: "center", fontFace: "Calibri",
  });

  addClinicalPearl(slide, "Fluids temporarily restore circulation but do not replace blood loss.", 4.82);
}

// ─── SLIDE 25: Blood and Blood Product Replacement ────────────────────────────
{
  const slide = pres.addSlide();
  addSlideHeader(slide, "Blood & Blood Product Replacement", 25, C.crimson);

  // Indications
  slide.addShape(pres.ShapeType.rect, {
    x: 0.25, y: 0.85, w: 3.5, h: 1.65,
    fill: { color: C.crimson + "22" },
    line: { color: C.crimson, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText("🩸 Indications", {
    x: 0.25, y: 0.85, w: 3.5, h: 0.38,
    fontSize: 12, bold: true, color: C.crimson,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
  slide.addText([
    { text: "Continued bleeding", options: { bullet: { type: "bullet", characterCode: "25CF", color: C.crimson }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Hemodynamic instability", options: { bullet: { type: "bullet", characterCode: "25CF", color: C.crimson }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Hb <7 g/dL (or higher if symptomatic)", options: { bullet: { type: "bullet", characterCode: "25CF", color: C.crimson }, color: C.light, fontSize: 11 } },
  ], {
    x: 0.25, y: 1.28, w: 3.5, h: 1.1,
    valign: "top", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });

  // Blood products table
  slide.addShape(pres.ShapeType.rect, {
    x: 3.95, y: 0.85, w: 5.8, h: 2.6,
    fill: { color: C.slate },
    line: { color: C.teal, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText("🏥 Blood Products", {
    x: 3.95, y: 0.85, w: 5.8, h: 0.38,
    fontSize: 12, bold: true, color: C.teal,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
  const bpRows = [
    [
      { text: "Product", options: { bold: true, color: C.gold, fontSize: 10 } },
      { text: "Purpose", options: { bold: true, color: C.gold, fontSize: 10 } },
    ],
    [
      { text: "Packed RBCs", options: { bold: true, color: C.light, fontSize: 10 } },
      { text: "Restore oxygen-carrying capacity", options: { color: C.light, fontSize: 10 } },
    ],
    [
      { text: "Fresh Frozen Plasma (FFP)", options: { bold: true, color: C.light, fontSize: 10 } },
      { text: "Replace clotting factors", options: { color: C.light, fontSize: 10 } },
    ],
    [
      { text: "Platelets", options: { bold: true, color: C.light, fontSize: 10 } },
      { text: "Treat thrombocytopenia", options: { color: C.light, fontSize: 10 } },
    ],
    [
      { text: "Cryoprecipitate", options: { bold: true, color: C.light, fontSize: 10 } },
      { text: "Replace fibrinogen", options: { color: C.light, fontSize: 10 } },
    ],
  ];
  slide.addTable(bpRows, {
    x: 3.95, y: 1.28, w: 5.8, h: 2.1,
    colW: [2.4, 3.3],
    border: { type: "solid", color: "2C3E5088", pt: 0.5 },
    fill: "00000000",
    fontFace: "Calibri",
    rowH: 0.38,
  });

  // MTP + Targets
  slide.addShape(pres.ShapeType.rect, {
    x: 0.25, y: 2.62, w: 4.65, h: 1.9,
    fill: { color: C.slate },
    line: { color: C.gold, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText("⚡ Massive Transfusion Protocol", {
    x: 0.25, y: 2.62, w: 4.65, h: 0.4,
    fontSize: 12, bold: true, color: C.gold,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
  slide.addShape(pres.ShapeType.rect, {
    x: 0.55, y: 3.1, w: 4.05, h: 0.6,
    fill: { color: C.crimson + "33" },
    line: { type: "none" },
    rectRadius: 0.05,
  });
  slide.addText("PRBC : FFP : Platelets  =  1 : 1 : 1", {
    x: 0.55, y: 3.1, w: 4.05, h: 0.6,
    fontSize: 14, bold: true, color: C.white,
    align: "center", valign: "middle", margin: 0, fontFace: "Calibri",
  });
  slide.addText("(approximate ratio)", {
    x: 0.55, y: 3.75, w: 4.05, h: 0.35,
    fontSize: 10, color: C.muted, italic: true,
    align: "center", valign: "middle", margin: 0, fontFace: "Calibri",
  });

  slide.addShape(pres.ShapeType.rect, {
    x: 5.1, y: 2.62, w: 4.65, h: 1.9,
    fill: { color: C.slate },
    line: { color: C.teal, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText("🎯 Targets", {
    x: 5.1, y: 2.62, w: 4.65, h: 0.4,
    fontSize: 12, bold: true, color: C.teal,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
  slide.addText([
    { text: "Hb > 7–8 g/dL", options: { bullet: { type: "bullet", characterCode: "25B6", color: C.teal }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Platelets > 50,000/µL", options: { bullet: { type: "bullet", characterCode: "25B6", color: C.teal }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Fibrinogen > 2 g/L", options: { bullet: { type: "bullet", characterCode: "25B6", color: C.teal }, color: C.light, fontSize: 11 } },
  ], {
    x: 5.1, y: 3.08, w: 4.65, h: 1.3,
    valign: "top", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
}

// ─── SLIDE 26: Uterine Massage ───────────────────────────────────────────────
{
  const slide = pres.addSlide();
  addSlideHeader(slide, "Uterine Massage", 26, "117A65");

  // Purpose
  slide.addShape(pres.ShapeType.rect, {
    x: 0.25, y: 0.85, w: 5.2, h: 1.05,
    fill: { color: C.teal + "22" },
    line: { color: C.teal, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText([
    { text: "Purpose: ", options: { bold: true, color: C.teal, fontSize: 12 } },
    { text: "Stimulates uterine contraction and reduces bleeding.", options: { color: C.light, fontSize: 12 } },
  ], {
    x: 0.25, y: 0.85, w: 5.2, h: 1.05,
    valign: "middle", margin: [0, 12, 0, 12], fontFace: "Calibri",
  });

  // Technique
  slide.addShape(pres.ShapeType.rect, {
    x: 0.25, y: 2.05, w: 5.2, h: 2.0,
    fill: { color: C.slate },
    line: { color: C.gold, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText("🤲 Technique", {
    x: 0.25, y: 2.05, w: 5.2, h: 0.4,
    fontSize: 12, bold: true, color: C.gold,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
  slide.addText([
    { text: "Place one hand over the uterine fundus", options: { bullet: { type: "bullet", characterCode: "2776", color: C.gold }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Massage using firm circular movements", options: { bullet: { type: "bullet", characterCode: "2777", color: C.gold }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Continue until the uterus becomes firm", options: { bullet: { type: "bullet", characterCode: "2778", color: C.gold }, color: C.light, fontSize: 11 } },
  ], {
    x: 0.25, y: 2.5, w: 5.2, h: 1.45,
    valign: "top", margin: [0, 12, 0, 12], fontFace: "Calibri",
  });

  // Benefits
  slide.addShape(pres.ShapeType.rect, {
    x: 5.6, y: 0.85, w: 4.1, h: 1.82,
    fill: { color: C.slate },
    line: { color: C.teal, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText("✅ Benefits", {
    x: 5.6, y: 0.85, w: 4.1, h: 0.4,
    fontSize: 12, bold: true, color: C.teal,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
  slide.addText([
    { text: "Simple", options: { bullet: { type: "bullet", characterCode: "2714", color: C.teal }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Immediate", options: { bullet: { type: "bullet", characterCode: "2714", color: C.teal }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Effective in uterine atony", options: { bullet: { type: "bullet", characterCode: "2714", color: C.teal }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Can be repeated", options: { bullet: { type: "bullet", characterCode: "2714", color: C.teal }, color: C.light, fontSize: 11 } },
  ], {
    x: 5.6, y: 1.3, w: 4.1, h: 1.25,
    valign: "top", margin: [0, 12, 0, 12], fontFace: "Calibri",
  });

  // Important note
  slide.addShape(pres.ShapeType.rect, {
    x: 5.6, y: 2.78, w: 4.1, h: 1.27,
    fill: { color: C.crimson + "22" },
    line: { color: C.crimson, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText([
    { text: "⚠️ Important: ", options: { bold: true, color: C.crimson, fontSize: 11 } },
    { text: "Always perform uterine massage while preparing uterotonic drugs.", options: { color: C.light, fontSize: 11 } },
  ], {
    x: 5.6, y: 2.78, w: 4.1, h: 1.27,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });

  addClinicalPearl(slide, "Always combine uterine massage with early uterotonic administration.", 4.82);
}

// ─── SLIDE 27: Uterotonic Drugs ──────────────────────────────────────────────
{
  const slide = pres.addSlide();
  addSlideHeader(slide, "Uterotonic Drugs  |  First-Line Medical Treatment", 27, "6C3483");

  const drugRows = [
    [
      { text: "Drug", options: { bold: true, color: C.gold, fontSize: 11 } },
      { text: "Dose", options: { bold: true, color: C.gold, fontSize: 11 } },
      { text: "Route", options: { bold: true, color: C.gold, fontSize: 11 } },
    ],
    [
      { text: "Oxytocin", options: { bold: true, color: C.teal, fontSize: 11 } },
      { text: "10 IU", options: { color: C.light, fontSize: 11 } },
      { text: "IM or slow IV", options: { color: C.light, fontSize: 11 } },
    ],
    [
      { text: "Oxytocin infusion", options: { bold: true, color: C.teal, fontSize: 11 } },
      { text: "20–40 IU in 1 L NS/RL", options: { color: C.light, fontSize: 11 } },
      { text: "IV infusion", options: { color: C.light, fontSize: 11 } },
    ],
    [
      { text: "Methylergometrine", options: { bold: true, color: C.light, fontSize: 11 } },
      { text: "0.2 mg", options: { color: C.light, fontSize: 11 } },
      { text: "IM / slow IV", options: { color: C.light, fontSize: 11 } },
    ],
    [
      { text: "Carboprost", options: { bold: true, color: C.light, fontSize: 11 } },
      { text: "250 µg (repeat q15–90 min; max 8 doses)", options: { color: C.light, fontSize: 11 } },
      { text: "IM", options: { color: C.light, fontSize: 11 } },
    ],
    [
      { text: "Misoprostol", options: { bold: true, color: C.light, fontSize: 11 } },
      { text: "800–1000 µg", options: { color: C.light, fontSize: 11 } },
      { text: "Rectal / sublingual", options: { color: C.light, fontSize: 11 } },
    ],
  ];

  slide.addTable(drugRows, {
    x: 0.25, y: 0.88, w: 9.5, h: 3.5,
    colW: [2.4, 4.1, 2.85],
    border: { type: "solid", color: "2C3E50AA", pt: 0.8 },
    fill: C.slate,
    fontFace: "Calibri",
    rowH: 0.55,
    autoPage: false,
  });

  addClinicalPearl(slide, "Use uterotonics early — do not delay escalation if bleeding continues.", 4.82);
}

// ─── SLIDE 28: Oxytocin ──────────────────────────────────────────────────────
{
  const slide = pres.addSlide();
  addSlideHeader(slide, "Oxytocin  |  Drug of Choice for PPH", 28, "117A65");

  // Mechanism
  slide.addShape(pres.ShapeType.rect, {
    x: 0.25, y: 0.85, w: 4.6, h: 1.65,
    fill: { color: C.slate },
    line: { color: C.teal, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText("⚙️ Mechanism", {
    x: 0.25, y: 0.85, w: 4.6, h: 0.4,
    fontSize: 12, bold: true, color: C.teal,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
  slide.addText([
    { text: "Stimulates rhythmic uterine contractions", options: { bullet: { type: "bullet", characterCode: "25B6", color: C.teal }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Compresses uterine blood vessels", options: { bullet: { type: "bullet", characterCode: "25B6", color: C.teal }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Promotes hemostasis", options: { bullet: { type: "bullet", characterCode: "25B6", color: C.teal }, color: C.light, fontSize: 11 } },
  ], {
    x: 0.25, y: 1.3, w: 4.6, h: 1.1,
    valign: "top", margin: [0, 12, 0, 12], fontFace: "Calibri",
  });

  // Dose
  slide.addShape(pres.ShapeType.rect, {
    x: 5.1, y: 0.85, w: 4.6, h: 1.65,
    fill: { color: C.slate },
    line: { color: C.gold, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText("💊 Dose", {
    x: 5.1, y: 0.85, w: 4.6, h: 0.4,
    fontSize: 12, bold: true, color: C.gold,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
  slide.addText([
    { text: "10 IU IM after delivery   OR", options: { bullet: { type: "bullet", characterCode: "25CF", color: C.gold }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "10 IU slow IV   OR", options: { bullet: { type: "bullet", characterCode: "25CF", color: C.gold }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "20–40 IU in 1 L crystalloid as IV infusion", options: { bullet: { type: "bullet", characterCode: "25CF", color: C.gold }, color: C.light, fontSize: 11 } },
  ], {
    x: 5.1, y: 1.3, w: 4.6, h: 1.1,
    valign: "top", margin: [0, 12, 0, 12], fontFace: "Calibri",
  });

  // Advantages
  slide.addShape(pres.ShapeType.rect, {
    x: 0.25, y: 2.62, w: 4.6, h: 1.6,
    fill: { color: C.teal + "22" },
    line: { color: C.teal, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText("✅ Advantages", {
    x: 0.25, y: 2.62, w: 4.6, h: 0.4,
    fontSize: 12, bold: true, color: C.teal,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
  slide.addText([
    { text: "Rapid onset", options: { bullet: { type: "bullet", characterCode: "2714", color: C.teal }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Highly effective", options: { bullet: { type: "bullet", characterCode: "2714", color: C.teal }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Safe with few adverse effects", options: { bullet: { type: "bullet", characterCode: "2714", color: C.teal }, color: C.light, fontSize: 11 } },
  ], {
    x: 0.25, y: 3.07, w: 4.6, h: 1.05,
    valign: "top", margin: [0, 12, 0, 12], fontFace: "Calibri",
  });

  // Side Effects
  slide.addShape(pres.ShapeType.rect, {
    x: 5.1, y: 2.62, w: 4.6, h: 1.6,
    fill: { color: C.crimson + "22" },
    line: { color: C.crimson, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText("⚠️ Side Effects", {
    x: 5.1, y: 2.62, w: 4.6, h: 0.4,
    fontSize: 12, bold: true, color: C.crimson,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
  slide.addText([
    { text: "Hypotension (rapid IV bolus)", options: { bullet: { type: "bullet", characterCode: "26A0", color: C.crimson }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Water intoxication (prolonged high-dose infusion)", options: { bullet: { type: "bullet", characterCode: "26A0", color: C.crimson }, color: C.light, fontSize: 11 } },
  ], {
    x: 5.1, y: 3.07, w: 4.6, h: 1.05,
    valign: "top", margin: [0, 12, 0, 12], fontFace: "Calibri",
  });

  addClinicalPearl(slide, "Oxytocin is the first-line uterotonic recommended by WHO.", 4.82);
}

// ─── SLIDE 29: Other Uterotonics ─────────────────────────────────────────────
{
  const slide = pres.addSlide();
  addSlideHeader(slide, "Other Uterotonics", 29, "6C3483");

  const drugs = [
    {
      name: "Methylergometrine",
      color: "8E44AD",
      items: [
        { label: "Dose", value: "0.2 mg IM" },
        { label: "Contraindications", value: "Hypertension\nPreeclampsia\nHeart disease" },
      ],
    },
    {
      name: "Carboprost  (15-methyl PGF₂α)",
      color: "E67E22",
      items: [
        { label: "Dose", value: "250 µg IM" },
        { label: "Repeat", value: "Every 15–90 min\nMax: 8 doses" },
        { label: "Contraindication", value: "Asthma" },
      ],
    },
    {
      name: "Misoprostol",
      color: "16A085",
      items: [
        { label: "Dose", value: "800–1000 µg" },
        { label: "Route", value: "Rectal or sublingual" },
        { label: "Advantages", value: "Cheap\nHeat stable\nUseful in low-resource settings" },
      ],
    },
  ];

  drugs.forEach((drug, idx) => {
    const x = 0.25 + idx * 3.25;
    const y = 0.88;
    const w = 3.1;
    const h = 4.25;

    slide.addShape(pres.ShapeType.rect, {
      x, y, w, h,
      fill: { color: C.slate },
      line: { color: drug.color, pt: 2 },
      rectRadius: 0.1,
    });
    // Header band
    slide.addShape(pres.ShapeType.rect, {
      x, y, w, h: 0.48,
      fill: { color: drug.color },
      line: { type: "none" },
      rectRadius: 0.1,
    });
    // Fix bottom rounded corners of header
    slide.addShape(pres.ShapeType.rect, {
      x, y: y + 0.28, w, h: 0.2,
      fill: { color: drug.color },
      line: { type: "none" },
    });
    slide.addText(drug.name, {
      x, y, w, h: 0.48,
      fontSize: 12, bold: true, color: C.white,
      align: "center", valign: "middle", margin: 0, fontFace: "Calibri",
    });

    let curY = y + 0.58;
    drug.items.forEach(item => {
      slide.addText(item.label, {
        x: x + 0.15, y: curY, w: w - 0.3, h: 0.32,
        fontSize: 10, bold: true, color: drug.color,
        valign: "middle", margin: [0, 4, 0, 4], fontFace: "Calibri",
      });
      curY += 0.32;
      const lines = item.value.split("\n");
      const blockH = lines.length * 0.32;
      slide.addText(lines.map((l, i) => ({
        text: l,
        options: {
          bullet: lines.length > 1 ? { type: "bullet", characterCode: "25BA", color: C.muted } : false,
          color: C.light, fontSize: 11,
          breakLine: i < lines.length - 1,
        },
      })), {
        x: x + 0.15, y: curY, w: w - 0.3, h: blockH,
        valign: "top", margin: [0, 4, 0, 4], fontFace: "Calibri",
      });
      curY += blockH + 0.18;
    });
  });
}

// ─── SLIDE 30: Tranexamic Acid (TXA) ─────────────────────────────────────────
{
  const slide = pres.addSlide();
  addSlideHeader(slide, "Tranexamic Acid (TXA)", 30, C.crimson);

  // Left column
  slide.addShape(pres.ShapeType.rect, {
    x: 0.25, y: 0.85, w: 4.6, h: 1.55,
    fill: { color: C.slate },
    line: { color: C.teal, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText("⚙️ Mechanism", {
    x: 0.25, y: 0.85, w: 4.6, h: 0.38,
    fontSize: 12, bold: true, color: C.teal,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
  slide.addText([
    { text: "Antifibrinolytic — prevents clot breakdown", options: { bullet: { type: "bullet", characterCode: "25B6", color: C.teal }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Stabilizes formed clots", options: { bullet: { type: "bullet", characterCode: "25B6", color: C.teal }, color: C.light, fontSize: 11 } },
  ], {
    x: 0.25, y: 1.28, w: 4.6, h: 1.05,
    valign: "top", margin: [0, 12, 0, 12], fontFace: "Calibri",
  });

  // WHO Recommendation banner
  slide.addShape(pres.ShapeType.rect, {
    x: 0.25, y: 2.52, w: 4.6, h: 0.9,
    fill: { color: C.gold + "33" },
    line: { color: C.gold, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText([
    { text: "🌍 WHO Recommendation: ", options: { bold: true, color: C.gold, fontSize: 11 } },
    { text: "Administer within 3 hours of childbirth in women with PPH.", options: { color: C.light, fontSize: 11 } },
  ], {
    x: 0.25, y: 2.52, w: 4.6, h: 0.9,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });

  // Dose box
  slide.addShape(pres.ShapeType.rect, {
    x: 0.25, y: 3.56, w: 4.6, h: 1.1,
    fill: { color: C.crimson + "22" },
    line: { color: C.crimson, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText("💊 Dose", {
    x: 0.25, y: 3.56, w: 4.6, h: 0.38,
    fontSize: 12, bold: true, color: C.crimson,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
  slide.addText([
    { text: "1 g IV over 10 minutes", options: { bullet: { type: "bullet", characterCode: "25CF", color: C.crimson }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Repeat 1 g if bleeding continues after 30 min or restarts within 24 h", options: { bullet: { type: "bullet", characterCode: "25CF", color: C.crimson }, color: C.light, fontSize: 11 } },
  ], {
    x: 0.25, y: 3.99, w: 4.6, h: 0.62,
    valign: "top", margin: [0, 12, 0, 12], fontFace: "Calibri",
  });

  // Right column: Benefits + Contraindications
  slide.addShape(pres.ShapeType.rect, {
    x: 5.1, y: 0.85, w: 4.6, h: 1.85,
    fill: { color: C.teal + "22" },
    line: { color: C.teal, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText("✅ Benefits", {
    x: 5.1, y: 0.85, w: 4.6, h: 0.38,
    fontSize: 12, bold: true, color: C.teal,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
  slide.addText([
    { text: "Reduces death due to bleeding", options: { bullet: { type: "bullet", characterCode: "2714", color: C.teal }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Decreases need for surgery", options: { bullet: { type: "bullet", characterCode: "2714", color: C.teal }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Effective for all causes of PPH when used early", options: { bullet: { type: "bullet", characterCode: "2714", color: C.teal }, color: C.light, fontSize: 11 } },
  ], {
    x: 5.1, y: 1.28, w: 4.6, h: 1.3,
    valign: "top", margin: [0, 12, 0, 12], fontFace: "Calibri",
  });

  slide.addShape(pres.ShapeType.rect, {
    x: 5.1, y: 2.82, w: 4.6, h: 1.1,
    fill: { color: C.crimson + "22" },
    line: { color: C.crimson, pt: 1 },
    rectRadius: 0.08,
  });
  slide.addText("🚫 Contraindications", {
    x: 5.1, y: 2.82, w: 4.6, h: 0.38,
    fontSize: 12, bold: true, color: C.crimson,
    valign: "middle", margin: [0, 10, 0, 10], fontFace: "Calibri",
  });
  slide.addText([
    { text: "Active thromboembolic disease (relative)", options: { bullet: { type: "bullet", characterCode: "2716", color: C.crimson }, color: C.light, fontSize: 11, breakLine: true } },
    { text: "Known hypersensitivity", options: { bullet: { type: "bullet", characterCode: "2716", color: C.crimson }, color: C.light, fontSize: 11 } },
  ], {
    x: 5.1, y: 3.25, w: 4.6, h: 0.6,
    valign: "top", margin: [0, 12, 0, 12], fontFace: "Calibri",
  });

  // Key message
  slide.addShape(pres.ShapeType.rect, {
    x: 5.1, y: 4.03, w: 4.6, h: 0.63,
    fill: { color: C.gold + "33" },
    line: { color: C.gold, pt: 1 },
    rectRadius: 0.06,
  });
  slide.addText([
    { text: "🔑 Key: ", options: { bold: true, color: C.gold, fontSize: 10.5 } },
    { text: "TXA is not a substitute for uterotonics or surgery — give as early as possible alongside standard PPH treatment.", options: { color: C.light, fontSize: 10.5 } },
  ], {
    x: 5.1, y: 4.03, w: 4.6, h: 0.63,
    valign: "middle", margin: [0, 8, 0, 8], fontFace: "Calibri",
  });
}

// ─── WRITE FILE ───────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/pph-slides/PPH_Emergency_Response.pptx" })
  .then(() => console.log("✅ PPH_Emergency_Response.pptx created successfully!"))
  .catch(err => { console.error("❌ Error:", err); process.exit(1); });
Running Command

cd /home/daytona/workspace/pph-slides && node pph_emergency.js 2>&1

The file generated successfully. The warnings are just about alpha/transparency in color codes (8-digit hex). PptxGenJS only accepts 6-digit hex - the transparent fills reverted to black. Let me fix those by replacing all alpha-appended colors with solid equivalents that work visually.
Running Command

cd /home/daytona/workspace/pph-slides && node -e " const fs = require('fs'); let src = fs.readFileSync('pph_emergency.js','utf8'); // Replace all 8-digit hex (6+2 alpha) patterns with proper 6-digit versions // Transparent fills for overlays -> use the base color lightly adjusted const replacements = [ // Semi-transparent whites -> light slate ['FFFFFF22', '1E2F3E'], // Red + alpha variants ['C0392B33', '3D1A18'], ['C0392B22', '321514'], ['C0392B55', '5C2020'], // Teal + alpha ['1ABC9C22', '1A4A40'], ['1ABC9C66', '197A65'], // Gold + alpha ['F39C1233', '4A3208'], // Black transparent (table fills) ['00000000', '1C2A36'], // Slate with alpha (borders) ['2C3E5088', '3D5167'], ['2C3E50AA', '3D5167'], ]; replacements.forEach(([from, to]) => { src = src.split(from).join(to); }); fs.writeFileSync('pph_emergency2.js', src); console.log('Done - wrote pph_emergency2.js'); "

Running Command

cd /home/daytona/workspace/pph-slides && sed -i 's|PPH_Emergency_Response.pptx|PPH_Emergency_Response_v2.pptx|g' pph_emergency2.js && node pph_emergency2.js 2>&1 | tail -5

Running Command

cd /home/daytona/workspace/pph-slides && node -e " const fs = require('fs'); let src = fs.readFileSync('pph_emergency2.js','utf8'); src = src.replace('PPH_Emergency_Response.pptx', 'PPH_Emergency_Response_v2.pptx'); fs.writeFileSync('pph_emergency2.js', src); console.log('renamed output file'); " && node pph_emergency2.js 2>&1 | tail -5

Still a few stragglers. Let me check which exact strings remain and fix them directly:
Running Command

cd /home/daytona/workspace/pph-slides && grep -n "C0392B22\|1ABC9C22\|F39C1233" pph_emergency2.js | head -20

Running Command

cd /home/daytona/workspace/pph-slides && node pph_emergency2.js 2>&1 | grep "not a valid" | sort -u

These are coming from the C color object string concatenations at runtime (e.g. C.teal + "22"). I need to fix those dynamic concatenations in the source. Let me find and replace them:
Running Command

cd /home/daytona/workspace/pph-slides && grep -n 'C\.\(crimson\|teal\|gold\|navy\) + "' pph_emergency2.js | head -40

Running Command

cd /home/daytona/workspace/pph-slides && node -e " const fs = require('fs'); let src = fs.readFileSync('pph_emergency2.js','utf8'); // Replace dynamic concatenations with solid colors src = src .replace(/C\.crimson \+ \"33\"/g, '\"3D1A18\"') .replace(/C\.crimson \+ \"22\"/g, '\"321514\"') .replace(/C\.crimson \+ \"55\"/g, '\"5C2020\"') .replace(/C\.teal \+ \"22\"/g, '\"1A4A40\"') .replace(/C\.teal \+ \"66\"/g, '\"197A65\"') .replace(/C\.gold \+ \"33\"/g, '\"4A3208\"') // Also the conditional one .replace(/C\.crimson \+ \"55\" : C\.slate/g, '\"5C2020\" : C.slate'); fs.writeFileSync('pph_emergency2.js', src); console.log('Patched all dynamic color concatenations'); " && node pph_emergency2.js 2>&1 | grep -E "not a valid|successfully"

Zero warnings, clean success. Let me verify the file was written to the right path:
Running Command

ls -lh /home/daytona/workspace/pph-slides/*.pptx

The clean v2 file is ready (301 KB). Here is your download link:

PPH Emergency Response v2

Presentation · PPTX


Here is what was built across the 10 slides (21-30):
SlideTopicDesign
21Emergency Response - Golden MinutesTwo-column layout: Immediate Actions + Team Roles table
22ABCDE Assessment5 color-coded cards (red A through blue E)
23Initial Resuscitation4-panel column layout: IV Access, Blood Samples, Monitoring, Goal
24Fluid ResuscitationSplit layout: fluids + recommendation / avoid + monitoring
25Blood & Blood Product ReplacementIndications + products table + MTP ratio box + targets
26Uterine MassagePurpose, technique (numbered steps), benefits, warning panel
27Uterotonic DrugsFull drug table: Oxytocin, Ergometrine, Carboprost, Misoprostol
28Oxytocin4 cards: Mechanism, Dose, Advantages, Side Effects
29Other Uterotonics3 drug cards with color-coded headers
30Tranexamic Acid (TXA)Mechanism, WHO rec, Dose, Benefits, Contraindications, Key message
Design choices: Dark navy background throughout, crimson/teal/gold accent palette appropriate for emergency clinical content, Clinical Pearl banners in amber on every applicable slide.
This is a shared conversation. Sign in to Orris to start your own chat.