Make a PPT on anaphylaxis which souls include all latest guidelines

Asking for Preferences
Reading File
Reading File
Reading File
Finding Sources
Searching PubMed

"anaphylaxis" AND "guidelines"

Searching the Web

anaphylaxis guidelines 2024 2025 WAO AAAAI epinephrine management update

Reading File
Reading File
Reading Web Page

https://www.ccjm.org/content/89/2/106

Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/anaphylaxis-ppt && ls /home/daytona/workspace/a…

Writing File

~/anaphylaxis-ppt/build.js

const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Anaphylaxis: Recognition, Management & 2024 Guidelines";
pres.author = "Medical Education";

// ── COLOR PALETTE ────────────────────────────────────────
const C = {
  navy:    "0A1628",   // dominant dark bg
  crimson: "C0392B",   // accent / danger
  teal:    "1A7A6E",   // second accent / positive
  amber:   "E67E22",   // warning highlight
  white:   "FFFFFF",
  lightBg: "F4F7FA",   // section bg
  silver:  "BDC3C7",
  textDark:"1C2833",
  cardBg:  "1F3247",   // card on dark bg
};

// ── HELPERS ──────────────────────────────────────────────
function darkSlide(slide) {
  slide.background = { color: C.navy };
}
function lightSlide(slide) {
  slide.background = { color: C.lightBg };
}
function sectionHeader(slide, label, color) {
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.55, fill:{ color } });
  slide.addText(label, { x:0.3, y:0.06, w:9.4, h:0.42, fontSize:13, bold:true, color:C.white, margin:0 });
}
function slideTitle(slide, text, color, y=0.62) {
  slide.addText(text, { x:0.35, y, w:9.3, h:0.7, fontSize:22, bold:true, color, margin:0 });
}
function accent(slide, x, y, w, h, color) {
  slide.addShape(pres.ShapeType.rect, { x, y, w, h, fill:{ color }, line:{color, pt:0} });
}

// ── HELPER: bulletBox ────────────────────────────────────
function bulletBox(slide, items, opts={}) {
  const {x=0.35, y=1.4, w=9.3, h=3.7, fontSize=13.5, color=C.textDark, indent=0.3, bold=false} = opts;
  const lines = items.flatMap((it, i) => {
    if (typeof it === "string") {
      return [{ text: it, options:{ bullet:{ indent }, fontSize, color, bold, breakLine: i<items.length-1 } }];
    }
    // {head, sub:[...]}
    const arr = [{ text: it.head, options:{ bullet:{ indent }, fontSize, color, bold:true, breakLine:true } }];
    it.sub.forEach((s,si) => arr.push({ text: s, options:{ bullet:{ indent:indent+0.25 }, fontSize:fontSize-1, color, breakLine: si<it.sub.length-1 } }));
    return arr;
  });
  slide.addText(lines, { x, y, w, h, valign:"top", margin:4, paraSpaceAfter:2 });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 1 — TITLE
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  darkSlide(s);
  // bold red bar
  accent(s, 0, 0, 10, 0.18, C.crimson);
  // bottom bar
  accent(s, 0, 5.43, 10, 0.19, C.teal);

  s.addText("ANAPHYLAXIS", {
    x:0.4, y:0.55, w:9.2, h:1.3, fontSize:54, bold:true, color:C.white,
    charSpacing:6, align:"center"
  });
  s.addText("Recognition · Management · Latest 2024 Guidelines", {
    x:0.4, y:1.85, w:9.2, h:0.55, fontSize:20, color:C.silver, align:"center", italic:true
  });

  // divider line
  accent(s, 1.5, 2.52, 7, 0.06, C.crimson);

  s.addText([
    { text: "AAAAI / ACAAI 2023 Practice Parameter Update  ", options:{ bold:true, color:C.amber } },
    { text: "| WAO 2024 Criteria | AHA 2024 First Aid Guidelines", options:{ color:C.silver } }
  ], { x:0.4, y:2.72, w:9.2, h:0.5, fontSize:12.5, align:"center" });

  s.addText("For Clinicians & Residents — July 2026", {
    x:0.4, y:5.1, w:9.2, h:0.35, fontSize:11, color:C.silver, align:"center", italic:true
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 2 — OVERVIEW / CONTENTS
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  darkSlide(s);
  accent(s, 0, 0, 10, 0.55, C.teal);
  s.addText("CONTENTS", { x:0.35, y:0.08, w:9.3, h:0.38, fontSize:16, bold:true, color:C.white, margin:0 });

  const topics = [
    ["01", "Definition & Pathophysiology"],
    ["02", "Epidemiology & Common Triggers"],
    ["03", "Diagnostic Criteria (WAO 2024 / NIAID)"],
    ["04", "Clinical Presentation — Organ Systems"],
    ["05", "Risk Stratification & Severity Grading"],
    ["06", "Differential Diagnosis"],
    ["07", "Immediate Management Algorithm"],
    ["08", "Pharmacotherapy — Epinephrine (First-Line)"],
    ["09", "Adjunct Therapies — Antihistamines & Steroids"],
    ["10", "Biphasic Anaphylaxis & Observation Period"],
    ["11", "Special Populations"],
    ["12", "Self-Injectable Epinephrine & Discharge Planning"],
    ["13", "Long-Term Prevention & Immunotherapy"],
    ["14", "Key 2024 Guideline Updates"],
    ["15", "References"],
  ];

  const col1 = topics.slice(0,8);
  const col2 = topics.slice(8);

  col1.forEach(([num,title], i) => {
    const y = 0.72 + i*0.58;
    accent(s, 0.35, y+0.06, 0.42, 0.34, C.crimson);
    s.addText(num, { x:0.35, y:y+0.04, w:0.42, h:0.34, fontSize:11, bold:true, color:C.white, align:"center", margin:0 });
    s.addText(title, { x:0.88, y, w:3.8, h:0.45, fontSize:12, color:C.white, valign:"middle", margin:0 });
  });
  col2.forEach(([num,title], i) => {
    const y = 0.72 + i*0.58;
    accent(s, 5.15, y+0.06, 0.42, 0.34, C.amber);
    s.addText(num, { x:5.15, y:y+0.04, w:0.42, h:0.34, fontSize:11, bold:true, color:C.white, align:"center", margin:0 });
    s.addText(title, { x:5.68, y, w:3.9, h:0.45, fontSize:12, color:C.white, valign:"middle", margin:0 });
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 3 — DEFINITION & PATHOPHYSIOLOGY
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionHeader(s, "DEFINITION & PATHOPHYSIOLOGY", C.navy);
  slideTitle(s, "What Is Anaphylaxis?", C.navy);

  // definition box
  accent(s, 0.35, 1.42, 9.3, 0.02, C.crimson);
  s.addShape(pres.ShapeType.rect, { x:0.35, y:1.44, w:9.3, h:1.0, fill:{ color:"FFE8E6" }, line:{color:"FFE8E6",pt:0} });
  s.addText(
    "Anaphylaxis is a serious, potentially life-threatening systemic hypersensitivity reaction that arises when mast cells and basophils release potent vasoactive mediators affecting the cardiovascular, cutaneous, respiratory, and gastrointestinal systems simultaneously.",
    { x:0.55, y:1.48, w:8.9, h:0.9, fontSize:12.5, color:C.textDark, italic:true }
  );

  s.addText("Mechanism", { x:0.35, y:2.56, w:9.3, h:0.35, fontSize:14, bold:true, color:C.navy });
  bulletBox(s, [
    { head:"IgE-Mediated (Allergic)", sub:["Multivalent allergen cross-links IgE bound to FcεRI on mast cells/basophils","Triggers degranulation → release of histamine, tryptase, PGD₂, LTC₄, PAF"] },
    { head:"Non-IgE-Mediated (Anaphylactoid)", sub:["Direct mast cell activation (radiocontrast, opioids, vancomycin)","Complement activation (C3a, C5a anaphylatoxins)"] },
    { head:"Key Mediators & Effects", sub:["Histamine/leukotrienes → vasodilation, increased permeability, bronchoconstriction","Tryptase → marker for mast cell activation (peaks 1–2 h post-reaction)","PAF → cardiac depression, thrombosis"] },
  ], { x:0.35, y:2.9, w:9.3, h:2.65, fontSize:12.5 });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 4 — EPIDEMIOLOGY & TRIGGERS
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionHeader(s, "EPIDEMIOLOGY & TRIGGERS", C.navy);
  slideTitle(s, "How Common Is It & What Causes It?", C.navy);

  // stat cards
  const stats = [
    { n:"2–8%", label:"Lifetime incidence\nin adults" },
    { n:"~1500–2000", label:"Annual deaths in\nthe USA" },
    { n:"<1%", label:"Fatal cases among\nall anaphylaxis events" },
    { n:"~50%", label:"Reactions occur\nat home" },
  ];
  stats.forEach((st, i) => {
    const x = 0.35 + i*2.4;
    s.addShape(pres.ShapeType.rect, { x, y:1.42, w:2.2, h:1.4, fill:{ color:C.navy }, line:{color:C.navy,pt:0}, shadow:{type:"outer",blur:5,offset:2,angle:45,color:"888888"} });
    s.addText(st.n, { x, y:1.5, w:2.2, h:0.7, fontSize:22, bold:true, color:C.amber, align:"center" });
    s.addText(st.label, { x, y:2.18, w:2.2, h:0.58, fontSize:10.5, color:C.white, align:"center" });
  });

  // trigger table — two columns
  s.addText("Common Triggers", { x:0.35, y:2.95, w:9.3, h:0.35, fontSize:14, bold:true, color:C.navy });

  const left = [
    ["IgE-Mediated", "Foods (peanut, tree nut, shellfish, milk, egg)"],
    ["","Insect venom (bee, wasp, fire ant)"],
    ["","Drugs (beta-lactam antibiotics, NSAIDs)"],
    ["","Latex / allergen immunotherapy"],
  ];
  const right = [
    ["Non-IgE-Mediated","Radiocontrast media (non-IgE, idiosyncratic)"],
    ["","Opioids, vancomycin (direct mast cell release)"],
    ["","NSAIDs via COX-1 inhibition"],
    ["Idiopathic","No identifiable trigger in ~20% of cases"],
  ];

  const mkRows = (rows) => rows.map(([cat, val]) => [
    { text: cat, options:{ bold:!!cat, fontSize:11, color:C.white, fill:{ color: cat ? C.teal : C.cardBg } } },
    { text: val, options:{ fontSize:11, color:C.white, fill:{ color:C.cardBg } } },
  ]);

  s.addTable(mkRows(left), { x:0.35, y:3.35, w:4.55, colW:[1.25,3.3], rowH:0.36, border:{pt:1,color:"2A4A6A"} });
  s.addTable(mkRows(right), { x:5.1, y:3.35, w:4.55, colW:[1.35,3.2], rowH:0.36, border:{pt:1,color:"2A4A6A"} });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 5 — DIAGNOSTIC CRITERIA (WAO / NIAID 2024)
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionHeader(s, "DIAGNOSTIC CRITERIA", C.crimson);
  slideTitle(s, "WAO 2024 / NIAID-FAAN Clinical Criteria", C.navy);

  s.addText("Anaphylaxis is HIGHLY LIKELY when ANY ONE of the following criteria is met:", {
    x:0.35, y:1.38, w:9.3, h:0.4, fontSize:12.5, bold:true, color:C.crimson
  });

  const criteria = [
    {
      num:"1",
      head:"Acute onset (minutes to hours) with skin/mucosal involvement PLUS at least one of:",
      items:["Respiratory compromise (dyspnea, wheeze, stridor, hypoxia)","Reduced BP or end-organ dysfunction (syncope, incontinence)"],
    },
    {
      num:"2",
      head:"Two or more of the following after exposure to a LIKELY allergen (rapid onset):",
      items:["Skin/mucosal involvement","Respiratory compromise","Reduced BP / end-organ dysfunction","Persistent GI symptoms (cramping, vomiting)"],
    },
    {
      num:"3",
      head:"Reduced BP after exposure to a KNOWN allergen for that patient:",
      items:["Adults: systolic <90 mmHg or >30% drop from baseline","Infants/children: age-specific low BP or >30% drop in systolic"],
    },
  ];

  criteria.forEach((cr, i) => {
    const y = 1.84 + i*1.2;
    accent(s, 0.35, y, 0.42, 0.42, i===0?C.crimson:i===1?C.teal:C.amber);
    s.addText(cr.num, { x:0.35, y:y+0.03, w:0.42, h:0.38, fontSize:16, bold:true, color:C.white, align:"center", margin:0 });
    s.addText(cr.head, { x:0.88, y, w:8.75, h:0.42, fontSize:12, bold:true, color:C.textDark, valign:"middle" });
    const subLines = cr.items.map((it,si) => ({
      text: it,
      options:{ bullet:{ indent:0.25 }, fontSize:11.5, color:C.textDark, breakLine: si<cr.items.length-1 }
    }));
    s.addText(subLines, { x:0.9, y:y+0.43, w:8.7, h:0.7, valign:"top" });
  });

  s.addShape(pres.ShapeType.rect, { x:0.35, y:5.18, w:9.3, h:0.38, fill:{ color:C.navy }, line:{color:C.navy,pt:0} });
  s.addText("Note: Epinephrine is appropriate even when criteria are not fully met if allergen exposure occurs with ANY systemic symptom.", {
    x:0.5, y:5.22, w:9.0, h:0.3, fontSize:10.5, color:C.amber, italic:true
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 6 — CLINICAL PRESENTATION
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionHeader(s, "CLINICAL PRESENTATION", C.navy);
  slideTitle(s, "Organ System Manifestations", C.navy);

  const systems = [
    { sys:"Cutaneous\n(~90%)", items:["Urticaria, flushing, pruritus","Angioedema (face, lips, tongue)","Erythema / morbilliform rash"], col:C.crimson },
    { sys:"Respiratory\n(~70%)", items:["Bronchospasm, wheezing","Stridor (laryngeal edema)","Rhinorrhea, hoarseness"], col:C.teal },
    { sys:"Cardiovascular\n(~45%)", items:["Hypotension, tachycardia","Arrhythmias","Chest pain, palpitations"], col:C.amber },
    { sys:"GI (~45%)", items:["Nausea, vomiting","Abdominal cramps, diarrhea"], col:"7D3C98" },
    { sys:"Neurological", items:["Anxiety, dizziness","Syncope, altered consciousness","Seizures (rare)"], col:"1A5276" },
  ];

  systems.forEach((sys, i) => {
    const col = i < 3 ? i : i-3;
    const row = i < 3 ? 0 : 1;
    const x = i<3 ? 0.35 + i*3.2 : 0.35 + col*4.8;
    const y = row===0 ? 1.42 : 3.42;
    const w = i<3 ? 3.0 : 4.5;

    s.addShape(pres.ShapeType.rect, { x, y, w, h:1.85, fill:{ color:"FFFFFF" }, line:{color:sys.col,pt:2} });
    accent(s, x, y, w, 0.42, sys.col);
    s.addText(sys.sys, { x, y:y+0.04, w, h:0.38, fontSize:11.5, bold:true, color:C.white, align:"center", margin:0 });
    const lines = sys.items.map((it,si) => ({
      text:it, options:{ bullet:{indent:0.2}, fontSize:11, color:C.textDark, breakLine:si<sys.items.length-1 }
    }));
    s.addText(lines, { x:x+0.1, y:y+0.46, w:w-0.2, h:1.32, valign:"top" });
  });

  s.addText("⚠  Absence of skin signs does NOT exclude anaphylaxis (occurs in ~10–20% of cases)", {
    x:0.35, y:5.23, w:9.3, h:0.36, fontSize:11, color:C.crimson, bold:true, italic:true
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 7 — RISK STRATIFICATION & GRADING
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionHeader(s, "RISK STRATIFICATION", C.navy);
  slideTitle(s, "Severity Grading (Ring & Messmer) & Risk Factors", C.navy);

  const grades = [
    { g:"Grade I", feat:"Skin / mucosa only (urticaria, angioedema, flushing)", bg:"FEF9E7", border:C.amber },
    { g:"Grade II", feat:"Moderate: multi-organ (skin + mild respiratory / GI / CV)", bg:"FDEBD0", border:"E67E22" },
    { g:"Grade III", feat:"Severe: bronchospasm, laryngeal edema, or significant hypotension", bg:"FDEDEC", border:C.crimson },
    { g:"Grade IV", feat:"Cardiac/respiratory arrest", bg:"F5B7B1", border:"922B21" },
  ];

  grades.forEach((gr,i) => {
    const y = 1.44 + i*0.88;
    s.addShape(pres.ShapeType.rect, { x:0.35, y, w:9.3, h:0.76, fill:{ color:gr.bg }, line:{color:gr.border,pt:2} });
    s.addText(gr.g, { x:0.5, y:y+0.1, w:1.2, h:0.5, fontSize:12.5, bold:true, color:gr.border });
    s.addText(gr.feat, { x:1.8, y:y+0.1, w:7.7, h:0.5, fontSize:12, color:C.textDark, valign:"middle" });
  });

  s.addText("High-Risk Features (severity amplifiers):", { x:0.35, y:5.0, w:4.5, h:0.35, fontSize:12.5, bold:true, color:C.navy });
  const riskItems = ["Cardiovascular disease / asthma","Age extremes (infants, elderly)","Beta-blockers / ACE inhibitors","Mastocytosis / hereditary α-tryptasemia","Delayed epinephrine administration","Upright posture at reaction onset"];
  const riskLines = riskItems.map((it,si) => ({ text:it, options:{ bullet:{indent:0.2}, fontSize:11, color:C.textDark, breakLine:si<riskItems.length-1 } }));
  s.addText(riskLines, { x:0.35, y:5.35, w:4.5, h:1.9, valign:"top" });

  s.addShape(pres.ShapeType.rect, { x:5.0, y:5.0, w:4.7, h:0.38, fill:{ color:C.crimson }, line:{color:C.crimson,pt:0} });
  s.addText("2024 Guideline: Severe = respiratory failure OR cardiovascular collapse", { x:5.1, y:5.04, w:4.5, h:0.3, fontSize:10.5, color:C.white, italic:true });
  const addlItems = ["Prior anaphylaxis episode","NSAIDs concurrent use","Exercise as cofactor","Cognitive-impairing drugs (alcohol, sedatives)"];
  const addlLines = addlItems.map((it,si) => ({ text:it, options:{ bullet:{indent:0.2}, fontSize:11, color:C.textDark, breakLine:si<addlItems.length-1 } }));
  s.addText(addlLines, { x:5.0, y:5.42, w:4.7, h:1.5, valign:"top" });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 8 — DIFFERENTIAL DIAGNOSIS
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionHeader(s, "DIFFERENTIAL DIAGNOSIS", C.navy);
  slideTitle(s, "What Else Could It Be?", C.navy);

  const ddx = [
    { cat:"Vasovagal syncope", notes:"Bradycardia (not tachycardia); pallor > urticaria; no respiratory sx; resolves with supine position" },
    { cat:"Acute severe asthma", notes:"No skin/mucosal signs, no hypotension; slower onset; responds to bronchodilators alone" },
    { cat:"Angioedema (HAE / ACE-i induced)", notes:"No urticaria; no cardiovascular collapse; C4 low in HAE; history of ACE inhibitor use" },
    { cat:"Panic attack", notes:"No objective signs; BP may rise; no urticaria or angioedema; SpO₂ normal" },
    { cat:"Vocal cord dysfunction", notes:"Stridor on inspiration; laryngoscopy confirms; SpO₂ usually maintained" },
    { cat:"Scombroid fish poisoning", notes:"Flushing, headache; histamine ingestion from spoiled fish; tryptase normal" },
    { cat:"Carcinoid syndrome", notes:"Flushing, diarrhea, wheezing; chronic; elevated 5-HIAA; no IgE involvement" },
    { cat:"Distributive shock (sepsis, neurogenic)", notes:"Relevant history; no allergen exposure; no skin/mucosal changes" },
  ];

  const rows = ddx.map((row,i) => [
    { text: row.cat, options:{ bold:true, fontSize:11, color:C.white, fill:{ color: i%2===0 ? C.navy : C.cardBg } } },
    { text: row.notes, options:{ fontSize:11, color:C.white, fill:{ color: i%2===0 ? C.navy : C.cardBg } } },
  ]);

  s.addTable(rows, {
    x:0.35, y:1.42, w:9.3, colW:[2.2, 7.1], rowH:0.4,
    border:{ pt:1, color:"2A4A6A" },
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 9 — IMMEDIATE MANAGEMENT ALGORITHM
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  darkSlide(s);
  accent(s, 0, 0, 10, 0.55, C.crimson);
  s.addText("IMMEDIATE MANAGEMENT ALGORITHM", { x:0.3, y:0.08, w:9.4, h:0.38, fontSize:15, bold:true, color:C.white, margin:0 });
  slideTitle(s, "AAAAI/ACAAI 2024 — First 15 Minutes", C.white);

  const steps = [
    { n:"1", title:"CALL FOR HELP / ACTIVATE EMS", detail:"Position supine (or lateral if vomiting); elevate legs (unless dyspnea);\nRemove trigger if still present", col:C.crimson },
    { n:"2", title:"EPINEPHRINE 1:1000 — IM MID-OUTER THIGH", detail:"Adults: 0.3–0.5 mg (0.3–0.5 mL)  |  Children: 0.01 mg/kg (max 0.5 mg)\nRepeat every 5–15 min if inadequate response", col:"8B0000" },
    { n:"3", title:"AIRWAY + OXYGEN", detail:"High-flow O₂ (8–10 L/min)  |  Intubate early if stridor / worsening airway\nPrepare for surgical airway if intubation fails", col:C.teal },
    { n:"4", title:"IV ACCESS + FLUIDS", detail:"Large-bore IV  |  Aggressive IV crystalloid 1–2 L bolus for hypotension\nRepeat boluses if needed", col:"0E6655" },
    { n:"5", title:"MONITOR & REASSESS", detail:"Continuous cardiac + pulse oximetry monitoring\nRepeat epinephrine PRN; consider IV epinephrine infusion (0.05–0.2 mcg/kg/min) if refractory", col:C.amber },
  ];

  steps.forEach((st, i) => {
    const y = 1.44 + i*0.79;
    s.addShape(pres.ShapeType.rect, { x:0.35, y, w:0.5, h:0.65, fill:{ color:st.col }, line:{color:st.col,pt:0} });
    s.addText(st.n, { x:0.35, y, w:0.5, h:0.65, fontSize:18, bold:true, color:C.white, align:"center", valign:"middle" });
    s.addShape(pres.ShapeType.rect, { x:0.92, y, w:8.73, h:0.65, fill:{ color:C.cardBg }, line:{color:"2A4A6A",pt:1} });
    s.addText(st.title, { x:1.05, y:y+0.04, w:8.5, h:0.28, fontSize:12.5, bold:true, color:C.amber, margin:0 });
    s.addText(st.detail, { x:1.05, y:y+0.32, w:8.5, h:0.3, fontSize:10.5, color:C.silver, margin:0 });
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 10 — EPINEPHRINE (FIRST LINE)
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionHeader(s, "PHARMACOTHERAPY", C.crimson);
  slideTitle(s, "Epinephrine — Undisputed First-Line Agent", C.navy);

  // why epi box
  s.addShape(pres.ShapeType.rect, { x:0.35, y:1.42, w:9.3, h:0.7, fill:{ color:C.crimson }, line:{color:C.crimson,pt:0} });
  s.addText("Why Epinephrine? — α₁: vasoconstriction ↑BP  |  β₁: ↑HR & inotropy  |  β₂: bronchodilation  |  ↓ mast cell mediator release", {
    x:0.5, y:1.5, w:9.0, h:0.54, fontSize:12, bold:true, color:C.white
  });

  const dosingRows = [
    ["Route", "IM (mid-outer thigh)", "IV infusion (refractory)", "Subcutaneous", "Intranasal (neffy®, FDA 2023)"],
    ["Adults", "0.3–0.5 mg (1:1000)", "0.05–0.2 mcg/kg/min", "Less preferred — slower absorption", "2 mg per nostril (≥30 kg)"],
    ["Children", "0.01 mg/kg, max 0.5 mg", "0.01–0.1 mcg/kg/min", "Not recommended acutely", "1 mg if 15–<30 kg (FDA 2025)"],
    ["Repeat", "Every 5–15 min PRN", "Titrate to response", "—", "May repeat once in 10 min"],
  ];

  const tableRows = dosingRows.map((row, ri) => row.map((cell, ci) => ({
    text: cell,
    options: { bold: ri===0 || ci===0, fontSize:10.5, color:C.white, fill:{ color: ri===0 ? C.navy : ci===0 ? C.cardBg : "1C3248" } }
  })));

  s.addTable(tableRows, { x:0.35, y:2.18, w:9.3, colW:[1.4,2.5,2.1,1.9,1.4], rowH:0.52, border:{pt:1,color:"2A4A6A"} });

  s.addText("Common Myths vs. 2024 Evidence", { x:0.35, y:4.5, w:9.3, h:0.35, fontSize:13, bold:true, color:C.navy });
  const myths = [
    "❌ 'Try antihistamine first' → 2024 guidelines: epinephrine is first AND only essential acute medication",
    "❌ 'Subcutaneous epi is equivalent' → IM mid-outer thigh gives faster, higher peak serum levels",
    "❌ 'Mild reactions don't need epi' → severity can escalate unpredictably; treat early",
    "✅ neffy® (intranasal epinephrine) FDA-approved 2023 (adults/children ≥30 kg); pediatric 15–<30 kg dose added 2025",
  ];
  const mythLines = myths.map((m,mi) => ({ text:m, options:{ bullet:false, fontSize:11, color:C.textDark, breakLine:mi<myths.length-1 } }));
  s.addText(mythLines, { x:0.35, y:4.9, w:9.3, h:1.5, valign:"top", margin:4 });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 11 — ADJUNCT THERAPIES
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionHeader(s, "PHARMACOTHERAPY — ADJUNCTS", C.teal);
  slideTitle(s, "What About Antihistamines & Steroids? (2024 Update)", C.navy);

  // big warning
  s.addShape(pres.ShapeType.rect, { x:0.35, y:1.42, w:9.3, h:0.62, fill:{ color:"FFF3CD" }, line:{color:C.amber,pt:2} });
  s.addText("⚠  2024 Practice Parameter: Antihistamines & corticosteroids are ADJUNCT therapies only — they do NOT prevent or abort anaphylaxis progression and should NEVER delay epinephrine.", {
    x:0.55, y:1.5, w:8.9, h:0.5, fontSize:11.5, bold:true, color:"7B4F00"
  });

  const drugs = [
    {
      name:"H1 Antihistamines\n(e.g., diphenhydramine, cetirizine)",
      role:"Relieve cutaneous symptoms (urticaria, pruritus)\nNo effect on blood pressure or bronchospasm",
      dose:"Diphenhydramine: 25–50 mg IV/IM/PO\nCetirizine 10 mg PO (less sedating — preferred in 2024 guidance)",
      caveat:"Sedating antihistamines may mask progression. Non-sedating preferred in ambulatory follow-up.",
      col:C.teal,
    },
    {
      name:"H2 Antihistamines\n(ranitidine → now famotidine 20 mg IV)",
      role:"Additive benefit for skin symptoms; mild BP effect",
      dose:"Famotidine 20 mg IV — may be used adjunctively",
      caveat:"Evidence limited; use as adjunct only",
      col:"117A65",
    },
    {
      name:"Corticosteroids\n(methylprednisolone, hydrocortisone, prednisone)",
      role:"Historically used to prevent biphasic anaphylaxis\n2024: NO convincing evidence they prevent biphasic reactions",
      dose:"Methylprednisolone 1–2 mg/kg IV (or prednisone 1 mg/kg PO)\nDuration 1–3 days if given",
      caveat:"2024 guidelines: Routine steroids are being de-emphasized. Many EDs removing them from anaphylaxis order sets.",
      col:C.crimson,
    },
  ];

  drugs.forEach((dr, i) => {
    const y = 2.14 + i*1.08;
    s.addShape(pres.ShapeType.rect, { x:0.35, y, w:9.3, h:0.98, fill:{ color:"FFFFFF" }, line:{color:dr.col,pt:2} });
    accent(s, 0.35, y, 2.15, 0.36, dr.col);
    s.addText(dr.name, { x:0.45, y:y+0.03, w:2.0, h:0.3, fontSize:10, bold:true, color:C.white, margin:0 });
    s.addText("Role: " + dr.role, { x:2.62, y:y+0.03, w:3.55, h:0.44, fontSize:10, color:C.textDark });
    s.addText("Dose: " + dr.dose, { x:6.28, y:y+0.03, w:3.28, h:0.44, fontSize:10, color:C.textDark });
    s.addText("⚑ " + dr.caveat, { x:0.45, y:y+0.52, w:9.1, h:0.4, fontSize:9.5, color:"555555", italic:true });
  });

  // bronchodilators
  s.addShape(pres.ShapeType.rect, { x:0.35, y:5.3, w:9.3, h:0.38, fill:{ color:C.navy }, line:{color:C.navy,pt:0} });
  s.addText("Bronchodilators (salbutamol / albuterol nebulization): for bronchospasm AFTER epinephrine, not as substitute", {
    x:0.5, y:5.34, w:9.0, h:0.3, fontSize:10.5, color:C.amber
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 12 — REFRACTORY ANAPHYLAXIS
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  darkSlide(s);
  accent(s, 0, 0, 10, 0.55, C.crimson);
  s.addText("REFRACTORY ANAPHYLAXIS", { x:0.3, y:0.08, w:9.4, h:0.38, fontSize:15, bold:true, color:C.white, margin:0 });
  slideTitle(s, "When Standard Therapy Fails", C.white);

  const agents = [
    { drug:"IV Epinephrine Infusion", detail:"0.05–0.2 mcg/kg/min; titrate to MAP >65; requires cardiac monitoring", ind:"Multiple epi doses without improvement" },
    { drug:"Glucagon", detail:"1–2 mg IV/IM, repeat q5 min or infusion 5–15 mcg/min", ind:"Beta-blocker–induced refractoriness; blocks epinephrine effect" },
    { drug:"Vasopressors (norepinephrine, vasopressin)", detail:"Norepinephrine 0.1–1 mcg/kg/min; Vasopressin 0.03 units/min", ind:"Refractory distributive shock despite fluid resuscitation" },
    { drug:"Atropine", detail:"0.5 mg IV repeated PRN (max 3 mg)", ind:"Bradycardia complicating anaphylaxis" },
    { drug:"Methylene Blue (emerging)", detail:"1–2 mg/kg IV — inhibits NO synthase, for severe refractory vasodilation", ind:"Vasoplegic state unresponsive to catecholamines" },
    { drug:"ECMO / Cardiac Support", detail:"In extremis: cardiogenic shock or cardiac arrest not responding to resuscitation", ind:"Last-resort measure in specialized centers" },
  ];

  const rows = agents.map((ag, i) => [
    { text:ag.drug, options:{ bold:true, fontSize:10.5, color:C.white, fill:{ color: i%2===0 ? C.cardBg : "142535" } } },
    { text:ag.detail, options:{ fontSize:10, color:C.silver, fill:{ color: i%2===0 ? C.cardBg : "142535" } } },
    { text:ag.ind, options:{ fontSize:10, italic:true, color:C.amber, fill:{ color: i%2===0 ? C.cardBg : "142535" } } },
  ]);

  s.addTable(
    [[
      { text:"Agent", options:{ bold:true, fontSize:11, color:C.white, fill:{ color:C.crimson } } },
      { text:"Dose / Administration", options:{ bold:true, fontSize:11, color:C.white, fill:{ color:C.crimson } } },
      { text:"Indication / Context", options:{ bold:true, fontSize:11, color:C.white, fill:{ color:C.crimson } } },
    ], ...rows],
    { x:0.35, y:1.44, w:9.3, colW:[2.2,4.2,2.9], rowH:0.55, border:{pt:1,color:"2A4A6A"} }
  );
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 13 — BIPHASIC ANAPHYLAXIS
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionHeader(s, "BIPHASIC ANAPHYLAXIS & OBSERVATION", C.navy);
  slideTitle(s, "When Symptoms Return After Resolution", C.navy);

  // stat box
  s.addShape(pres.ShapeType.rect, { x:0.35, y:1.42, w:4.4, h:1.8, fill:{ color:C.navy }, line:{color:C.navy,pt:0} });
  s.addText("Biphasic Anaphylaxis", { x:0.5, y:1.52, w:4.1, h:0.36, fontSize:14, bold:true, color:C.amber });
  s.addText([
    { text:"Incidence: ", options:{ bold:true, color:C.white } },
    { text:"~1–20% of cases\n", options:{ color:C.silver } },
    { text:"Onset: ", options:{ bold:true, color:C.white } },
    { text:"1 to 72 hours after initial reaction\n", options:{ color:C.silver } },
    { text:"Peak risk: ", options:{ bold:true, color:C.white } },
    { text:"8–12 hours post-reaction\n", options:{ color:C.silver } },
    { text:"Severity: ", options:{ bold:true, color:C.white } },
    { text:"Can be equal to or worse than initial", options:{ color:C.silver } },
  ], { x:0.5, y:1.94, w:4.1, h:1.22, fontSize:11.5 });

  s.addShape(pres.ShapeType.rect, { x:5.0, y:1.42, w:4.65, h:1.8, fill:{ color:"FFF3CD" }, line:{color:C.amber,pt:2} });
  s.addText("Risk Factors for Biphasic Reaction:", { x:5.15, y:1.52, w:4.35, h:0.36, fontSize:13, bold:true, color:C.textDark });
  const biphasicRF = ["Severe initial reaction","Required >1 dose of epinephrine","Unknown or ongoing allergen exposure","Delayed initial epinephrine","Protracted initial reaction"];
  const bpLines = biphasicRF.map((it,si) => ({ text:it, options:{ bullet:{indent:0.2}, fontSize:11, color:C.textDark, breakLine:si<biphasicRF.length-1 } }));
  s.addText(bpLines, { x:5.15, y:1.94, w:4.35, h:1.22, valign:"top" });

  s.addText("Observation Period — 2024 Recommendations", { x:0.35, y:3.35, w:9.3, h:0.38, fontSize:14, bold:true, color:C.navy });

  const obs = [
    { time:"≥1 hour", desc:"Mild reaction, rapid COMPLETE response to single epi, no high-risk features, reliable EAI access", col:C.teal },
    { time:"4–6 hours", desc:"Moderate reaction OR required >1 epi dose OR presence of any risk factor for severity", col:C.amber },
    { time:"≥6–24 hours", desc:"Severe reaction (Grade III–IV), refractory, uncertain trigger or access issues", col:C.crimson },
  ];
  obs.forEach((ob, i) => {
    const y = 3.8 + i*0.56;
    accent(s, 0.35, y, 1.35, 0.47, ob.col);
    s.addText(ob.time, { x:0.35, y:y+0.05, w:1.35, h:0.38, fontSize:13, bold:true, color:C.white, align:"center", margin:0 });
    s.addShape(pres.ShapeType.rect, { x:1.76, y, w:7.89, h:0.47, fill:{ color:"FFFFFF" }, line:{color:ob.col,pt:1} });
    s.addText(ob.desc, { x:1.9, y:y+0.06, w:7.6, h:0.38, fontSize:11, color:C.textDark, valign:"middle" });
  });

  s.addShape(pres.ShapeType.rect, { x:0.35, y:5.5, w:9.3, h:0.3, fill:{ color:C.navy }, line:{color:C.navy,pt:0} });
  s.addText("2024 Update: Steroids do NOT reliably prevent biphasic reactions — observation period is the key safeguard", {
    x:0.5, y:5.53, w:9.0, h:0.24, fontSize:10, color:C.amber, italic:true
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 14 — SPECIAL POPULATIONS
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionHeader(s, "SPECIAL POPULATIONS", C.teal);
  slideTitle(s, "Infants, Pregnancy, Beta-Blocker Users, Mastocytosis", C.navy);

  const pops = [
    {
      pop:"Infants & Toddlers",
      icon:"👶",
      pts:["Diagnosis challenging — no age-specific criteria; use standard WAO/NIAID criteria","Key signs: crying/irritability, sudden pallor, limpness, drooling, stridor","EpiPen Jr (150 mcg) for 7.5–20 kg; neffy not yet approved <15 kg","2024 guideline: Discuss EAI prescription at every allergist visit"],
      col:C.teal,
    },
    {
      pop:"Pregnancy",
      icon:"🤱",
      pts:["Epinephrine is SAFE and MANDATORY — do not withhold","Uterine artery vasoconstriction (maternal benefit outweighs fetal risk)","Position in left lateral decubitus if >20 weeks (avoid aortocaval compression)","Fetal monitoring in all cases of maternal anaphylaxis"],
      col:"7D3C98",
    },
    {
      pop:"Beta-Blocker / ACE-i Users",
      icon:"💊",
      pts:["Beta-blockers blunt epinephrine response → more severe, prolonged reaction","ACE inhibitors impair bradykinin breakdown → worsen angioedema","Use glucagon 1–2 mg IV if epi inadequate","Higher-dose epinephrine may be needed; avoid EAI dose capping"],
      col:C.crimson,
    },
    {
      pop:"Mastocytosis / Hereditary α-Tryptasemia",
      icon:"🔬",
      pts:["Elevated baseline tryptase (>11.4 ng/mL) — key marker","Idiopathic anaphylaxis and insect-sting reactions most common triggers","Anti-IgE therapy (omalizumab) emerging for recurrent anaphylaxis","Check baseline tryptase in all recurrent idiopathic anaphylaxis cases"],
      col:C.amber,
    },
  ];

  pops.forEach((pop, i) => {
    const x = i < 2 ? 0.35 : 5.1;
    const y = i % 2 === 0 ? 1.42 : 3.52;
    s.addShape(pres.ShapeType.rect, { x, y, w:4.55, h:1.92, fill:{ color:"FFFFFF" }, line:{color:pop.col,pt:2} });
    accent(s, x, y, 4.55, 0.42, pop.col);
    s.addText(pop.pop, { x:x+0.08, y:y+0.06, w:4.3, h:0.32, fontSize:12, bold:true, color:C.white });
    const lines = pop.pts.map((pt,pi) => ({ text:pt, options:{ bullet:{indent:0.2}, fontSize:10.5, color:C.textDark, breakLine:pi<pop.pts.length-1 } }));
    s.addText(lines, { x:x+0.1, y:y+0.47, w:4.3, h:1.4, valign:"top", margin:2 });
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 15 — TRYPTASE & INVESTIGATIONS
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionHeader(s, "INVESTIGATIONS", C.navy);
  slideTitle(s, "Serum Tryptase & Diagnostic Workup", C.navy);

  s.addText("Anaphylaxis is a CLINICAL diagnosis — no test is required before treatment", {
    x:0.35, y:1.42, w:9.3, h:0.42, fontSize:13, bold:true, color:C.crimson, italic:true
  });

  const invs = [
    { test:"Serum Tryptase (Total)", timing:"ACUTE: 1–2 h post-reaction\nBASELINE: ≥24 h later", value:">2 + (1.2 × baseline) = positive\nBaseline >11.4 ng/mL → possible mastocytosis", use:"Confirms mast cell activation; medicolegal; prognostication" },
    { test:"CBC / Metabolic Panel", timing:"At presentation if severe", value:"Haemoconcentration, lactic acidosis, eosinophilia (in chronic)", use:"Assess severity, complications (AKI, DIC)" },
    { test:"Specific IgE (RAST) / Skin Prick Tests", timing:"4–6 weeks post-reaction", value:"Identifies triggering allergen", use:"Guides avoidance counseling and immunotherapy eligibility" },
    { test:"Serum Histamine", timing:"Within 30–60 min of reaction", value:"Very short half-life — practically less useful", use:"Research; rarely practical in clinical setting" },
    { test:"Urinary Histamine Metabolites", timing:"2–24 h post-reaction", value:"N-methylhistamine in 24-h urine", use:"Alternative when blood sample missed" },
  ];

  const rows = invs.map((inv, i) => [
    { text:inv.test, options:{ bold:true, fontSize:10.5, color:C.white, fill:{ color: i%2===0 ? C.navy : C.cardBg } } },
    { text:inv.timing, options:{ fontSize:10, color:C.silver, fill:{ color: i%2===0 ? C.navy : C.cardBg } } },
    { text:inv.value, options:{ fontSize:10, color:C.amber, fill:{ color: i%2===0 ? C.navy : C.cardBg } } },
    { text:inv.use, options:{ fontSize:10, color:C.silver, fill:{ color: i%2===0 ? C.navy : C.cardBg } } },
  ]);

  s.addTable(
    [[
      { text:"Test", options:{ bold:true, fontSize:11, color:C.white, fill:{ color:C.teal } } },
      { text:"Timing", options:{ bold:true, fontSize:11, color:C.white, fill:{ color:C.teal } } },
      { text:"Interpretation", options:{ bold:true, fontSize:11, color:C.white, fill:{ color:C.teal } } },
      { text:"Clinical Use", options:{ bold:true, fontSize:11, color:C.white, fill:{ color:C.teal } } },
    ], ...rows],
    { x:0.35, y:1.94, w:9.3, colW:[1.9,1.85,2.75,2.8], rowH:0.56, border:{pt:1,color:"2A4A6A"} }
  );

  s.addShape(pres.ShapeType.rect, { x:0.35, y:5.2, w:9.3, h:0.4, fill:{ color:"E8F8F5" }, line:{color:C.teal,pt:1} });
  s.addText("💡 2024 Recommendation: Measure tryptase in ALL ED-attended anaphylaxis cases; use formula (2 + 1.2×baseline) for diagnosis confirmation", {
    x:0.5, y:5.24, w:9.0, h:0.32, fontSize:10.5, color:C.teal
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 16 — DISCHARGE & EAI
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionHeader(s, "DISCHARGE PLANNING & SELF-MANAGEMENT", C.teal);
  slideTitle(s, "Epinephrine Auto-Injectors & Patient Education", C.navy);

  // EAI prescribing
  s.addShape(pres.ShapeType.rect, { x:0.35, y:1.42, w:9.3, h:0.38, fill:{ color:C.teal }, line:{color:C.teal,pt:0} });
  s.addText("ALL patients who experienced anaphylaxis should be prescribed ≥2 epinephrine auto-injectors at discharge", {
    x:0.5, y:1.46, w:9.0, h:0.3, fontSize:12, bold:true, color:C.white
  });

  const eaiData = [
    { brand:"EpiPen Jr® / Auvi-Q 0.1 mg", weight:"7.5–15 kg", dose:"150 mcg", note:"Toddler / small child" },
    { brand:"EpiPen® / Auvi-Q 0.15 mg", weight:"15–30 kg", dose:"150–300 mcg", note:"Children (standard)" },
    { brand:"EpiPen® / neffy® 2 mg intranasal", weight:"≥30 kg / adult", dose:"300–500 mcg", note:"Most adults; neffy nasal spray 2 mg" },
    { brand:"neffy® 1 mg intranasal", weight:"15–<30 kg", dose:"1 mg per nostril", note:"FDA-approved March 2025 for pediatric" },
  ];
  const eaiRows = eaiData.map((row, i) => [
    { text:row.brand, options:{ bold:true, fontSize:11, color:C.white, fill:{ color:i%2===0?C.navy:C.cardBg } } },
    { text:row.weight, options:{ fontSize:11, color:C.white, fill:{ color:i%2===0?C.navy:C.cardBg }, align:"center" } },
    { text:row.dose, options:{ bold:true, fontSize:11, color:C.amber, fill:{ color:i%2===0?C.navy:C.cardBg }, align:"center" } },
    { text:row.note, options:{ fontSize:11, color:C.silver, fill:{ color:i%2===0?C.navy:C.cardBg } } },
  ]);
  s.addTable(
    [[{text:"Device",options:{bold:true,fontSize:11,color:C.white,fill:{color:C.crimson}}},{text:"Weight",options:{bold:true,fontSize:11,color:C.white,fill:{color:C.crimson}}},{text:"Dose",options:{bold:true,fontSize:11,color:C.white,fill:{color:C.crimson}}},{text:"Notes",options:{bold:true,fontSize:11,color:C.white,fill:{color:C.crimson}}}}, ...eaiRows],
    { x:0.35, y:1.88, w:9.3, colW:[3.0,1.7,1.8,2.8], rowH:0.44, border:{pt:1,color:"2A4A6A"} }
  );

  s.addText("Discharge Checklist (2024 Guidelines)", { x:0.35, y:4.05, w:4.5, h:0.35, fontSize:13, bold:true, color:C.navy });
  const checklist = ["Prescribe ≥2 EAIs (check for concurrent prescriptions in household)","Written anaphylaxis action plan","Instruction on EAI technique (demonstrate)","Allergen avoidance counseling (trigger-specific)","Medical alert bracelet / jewellery recommendation","Referral to allergist within 1 month","Discuss EMS call: NOT mandatory if complete response to epi + access to 2nd dose","Schedule follow-up serum tryptase (baseline if not done)"];
  const checkLines = checklist.map((it,si) => ({ text:"☐  "+it, options:{ fontSize:11, color:C.textDark, breakLine:si<checklist.length-1 } }));
  s.addText(checkLines, { x:0.35, y:4.44, w:4.55, h:3.0, valign:"top", margin:2 });

  // EMS update box
  s.addShape(pres.ShapeType.rect, { x:5.1, y:4.05, w:4.55, h:1.62, fill:{ color:"E8F8F5" }, line:{color:C.teal,pt:2} });
  s.addText("2024 Update: EMS Activation", { x:5.25, y:4.12, w:4.2, h:0.36, fontSize:13, bold:true, color:C.teal });
  s.addText("EMS activation after EAI use MAY NOT be required if:\n• Prompt, complete, durable symptom resolution\n• Access to ≥2 additional EAIs\n• Reliable patient/caregiver\n\nEMS is still required for:\n• Severe anaphylaxis (respiratory failure, CV collapse)\n• Incomplete or worsening response\n• Return of symptoms", {
    x:5.25, y:4.5, w:4.3, h:2.0, fontSize:10.5, color:C.textDark
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 17 — LONG-TERM PREVENTION & IMMUNOTHERAPY
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionHeader(s, "LONG-TERM PREVENTION", C.teal);
  slideTitle(s, "Allergen Immunotherapy, Omalizumab & Risk Reduction", C.navy);

  const strategies = [
    {
      title:"Venom Immunotherapy (VIT)",
      detail:"Highly effective (97–98%) for Hymenoptera venom allergy\nRecommended for all adults with systemic venom reactions\n3–5 year course; consider lifelong if severe reaction or mastocytosis",
      evidence:"Strong — Grade A recommendation",
      col:C.teal,
    },
    {
      title:"Drug Desensitization",
      detail:"For patients requiring a causative drug (e.g. aspirin, platinum chemotherapy)\nRapid graded-dose protocol under supervised setting\nConfers temporary tolerance only — must repeat",
      evidence:"Moderate — case series, expert consensus",
      col:C.navy,
    },
    {
      title:"Oral Immunotherapy (OIT) — Food",
      detail:"Peanut OIT (Palforzia) FDA-approved for ages 4–17\nReduces threshold dose significantly\n2024 EAACI food allergy guidelines: OIT preferred over avoidance alone",
      evidence:"Strong for peanut — Grade B for others",
      col:"1A5276",
    },
    {
      title:"Omalizumab (anti-IgE)",
      detail:"Reduces anaphylaxis risk in food-triggered disease\nApproved 2024 by FDA for IgE-mediated food allergy (6+ years)\nAlso used in mastocytosis and chronic spontaneous urticaria",
      evidence:"Strong for food allergy and chronic urticaria",
      col:C.crimson,
    },
  ];

  strategies.forEach((str, i) => {
    const x = i < 2 ? 0.35 : 5.1;
    const y = i%2===0 ? 1.42 : 3.3;
    s.addShape(pres.ShapeType.rect, { x, y, w:4.55, h:1.74, fill:{ color:"FFFFFF" }, line:{color:str.col,pt:2} });
    accent(s, x, y, 4.55, 0.4, str.col);
    s.addText(str.title, { x:x+0.1, y:y+0.05, w:4.3, h:0.32, fontSize:12, bold:true, color:C.white });
    s.addText(str.detail, { x:x+0.1, y:y+0.44, w:4.3, h:0.9, fontSize:10.5, color:C.textDark, valign:"top" });
    s.addShape(pres.ShapeType.rect, { x, y:y+1.36, w:4.55, h:0.38, fill:{ color:str.col+"33" }, line:{color:str.col,pt:0} });
    s.addText("Evidence: " + str.evidence, { x:x+0.1, y:y+1.4, w:4.3, h:0.3, fontSize:10, italic:true, color:str.col });
  });

  s.addShape(pres.ShapeType.rect, { x:0.35, y:5.12, w:9.3, h:0.42, fill:{ color:"FFF9E6" }, line:{color:C.amber,pt:1} });
  s.addText("Cofactor management: advise NSAID avoidance before known allergen exposure; exercise precautions in food-dependent EIA", {
    x:0.5, y:5.16, w:9.0, h:0.34, fontSize:11, color:C.textDark
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 18 — PERIOPERATIVE ANAPHYLAXIS
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionHeader(s, "PERIOPERATIVE ANAPHYLAXIS", C.crimson);
  slideTitle(s, "Intraoperative Recognition & Management", C.navy);

  s.addText("Incidence: 1 in 2,000–10,000 anesthetics | Mortality: ~3–9%", {
    x:0.35, y:1.44, w:9.3, h:0.38, fontSize:13, bold:true, color:C.crimson
  });

  const triggers = [
    ["Neuromuscular blocking agents (NMBAs)","Most common — rocuronium, succinylcholine","IgE-mediated or direct degranulation"],
    ["Antibiotics","Penicillins, cephalosporins, vancomycin","IgE-mediated or infusion-related"],
    ["Latex","Gloves, drapes — less common post-latex-free protocols","IgE-mediated"],
    ["Chlorhexidine","Skin prep, IV flush","IgE-mediated; often delayed presentation"],
    ["Dyes (isosulfan blue, patent blue)","Sentinel node biopsy","IgE-mediated; cutaneous signs may be hidden"],
    ["Colloids / gelatin","Plasma expanders","Non-IgE complement activation"],
  ];

  const trigRows = triggers.map((row, i) => row.map((cell, ci) => ({
    text:cell,
    options:{ bold:ci===0, fontSize:10.5, color:C.white, fill:{ color:i%2===0?C.cardBg:C.navy } }
  })));
  s.addTable(
    [[{text:"Trigger",options:{bold:true,fontSize:11,color:C.white,fill:{color:C.crimson}}},{text:"Notes",options:{bold:true,fontSize:11,color:C.white,fill:{color:C.crimson}}},{text:"Mechanism",options:{bold:true,fontSize:11,color:C.white,fill:{color:C.crimson}}}}, ...trigRows],
    { x:0.35, y:1.9, w:9.3, colW:[2.5,3.8,3.0], rowH:0.44, border:{pt:1,color:"2A4A6A"} }
  );

  s.addShape(pres.ShapeType.rect, { x:0.35, y:4.98, w:9.3, h:0.62, fill:{ color:"FFF3CD" }, line:{color:C.amber,pt:2} });
  s.addText("Intraoperative signs may be masked by drapes: monitor for unexplained tachycardia, bronchospasm, hypotension, capnography changes. \nTreat with IM/IV epinephrine immediately; stop surgery if safe; call allergist within 24 h for full workup.", {
    x:0.5, y:5.03, w:9.0, h:0.5, fontSize:10.5, color:"7B4F00"
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 19 — 2024 GUIDELINE KEY UPDATES
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  darkSlide(s);
  accent(s, 0, 0, 10, 0.55, C.amber);
  s.addText("KEY 2024 GUIDELINE UPDATES", { x:0.3, y:0.08, w:9.4, h:0.38, fontSize:16, bold:true, color:C.navy, margin:0 });
  slideTitle(s, "AAAAI/ACAAI 2023 Practice Parameter (Annals 2024) — What Changed?", C.white);

  const updates = [
    {
      tag:"Epinephrine",
      text:"Epinephrine at first concern for systemic allergic reaction — even if formal criteria not yet met. No more 'wait and see' approach.",
      col:C.crimson,
    },
    {
      tag:"Steroids",
      text:"Corticosteroids de-emphasized: no reliable evidence they prevent biphasic reactions. Many centres removing them from standard anaphylaxis pathways.",
      col:C.amber,
    },
    {
      tag:"Antihistamines",
      text:"Non-sedating antihistamines preferred over diphenhydramine. Sedating antihistamines may mask symptom progression during active reaction.",
      col:C.teal,
    },
    {
      tag:"Observation",
      text:"Individualised observation: 1 h for mild complete responders; ≥6 h for severe/refractory; steroid-based biphasic prevention abandoned.",
      col:"7D3C98",
    },
    {
      tag:"EMS After EAI",
      text:"EMS NOT mandatory if: complete + durable symptom resolution after EAI AND patient has access to ≥2 additional EAIs. Still required for severe reactions.",
      col:"1A5276",
    },
    {
      tag:"Infants",
      text:"Standard WAO/NIAID criteria apply to infants/toddlers — no separate criteria. Skin signs may be subtle; stridor and limpness are key red flags.",
      col:"117A65",
    },
    {
      tag:"Tryptase Formula",
      text:"Diagnosis supported by: serum tryptase > (2 + 1.2 × baseline). Baseline tryptase >11.4 ng/mL warrants workup for mastocytosis/hereditary α-tryptasemia.",
      col:"884EA0",
    },
    {
      tag:"neffy® (intranasal epi)",
      text:"FDA approved 2023 for adults/≥30 kg; pediatric dose 1 mg for 15–<30 kg approved March 2025. Addresses needle phobia barriers to epinephrine access.",
      col:C.crimson,
    },
  ];

  updates.forEach((upd, i) => {
    const x = i < 4 ? 0.35 : 5.1;
    const y = 1.44 + (i%4)*0.97;
    s.addShape(pres.ShapeType.rect, { x, y, w:4.55, h:0.87, fill:{ color:C.cardBg }, line:{color:upd.col,pt:2} });
    s.addShape(pres.ShapeType.rect, { x, y, w:1.2, h:0.38, fill:{ color:upd.col }, line:{color:upd.col,pt:0} });
    s.addText(upd.tag, { x, y:y+0.04, w:1.2, h:0.3, fontSize:10.5, bold:true, color:C.white, align:"center", margin:0 });
    s.addText(upd.text, { x:x+0.1, y:y+0.4, w:4.3, h:0.44, fontSize:10, color:C.silver, valign:"top" });
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 20 — RADIOCONTRAST MEDIA
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  lightSlide(s);
  sectionHeader(s, "RADIOCONTRAST MEDIA REACTIONS", C.navy);
  slideTitle(s, "Management & Premedication — 2024 Update", C.navy);

  s.addShape(pres.ShapeType.rect, { x:0.35, y:1.42, w:9.3, h:0.46, fill:{ color:"E8F8F5" }, line:{color:C.teal,pt:2} });
  s.addText("ICM reactions are largely NON-IgE; prior seafood/iodine allergy does NOT increase risk — avoid this label", {
    x:0.5, y:1.47, w:9.0, h:0.36, fontSize:12, bold:true, color:C.teal
  });

  const cols = [
    {
      title:"Risk Factors for ICM Reaction",
      items:["Prior adverse reaction to ICM (strongest)","History of atopy, asthma","Certain medications: ACE inhibitors, β-blockers, proton pump inhibitors","Renal impairment (for delayed reactions)"],
      col:C.crimson
    },
    {
      title:"Premedication Protocol\n(CAR/CSACI 2025 Guidance)",
      items:["Prednisolone 50 mg PO at 13h, 7h, 1h before ICM","Diphenhydramine 50 mg PO/IM 1h before","Use LOW/ISO-osmolar contrast preferentially","2024 Update: Routine premedication questioned — evidence weak for low-osmolar agents; individualise risk-benefit"],
      col:C.teal
    },
    {
      title:"2024 Practical Note",
      items:["Do NOT delay emergent CT scanning to administer premedication","Switch to alternative imaging if non-emergent in high-risk patient","GBCA (MRI contrast): cross-reactivity with ICM = NONE","Report all reactions to pharmacovigilance"],
      col:C.amber
    }
  ];

  cols.forEach((col, i) => {
    const x = 0.35 + i*3.2;
    s.addShape(pres.ShapeType.rect, { x, y:2.0, w:3.0, h:3.35, fill:{ color:"FFFFFF" }, line:{color:col.col,pt:2} });
    accent(s, x, 2.0, 3.0, 0.42, col.col);
    s.addText(col.title, { x:x+0.05, y:2.04, w:2.9, h:0.38, fontSize:10.5, bold:true, color:C.white, align:"center", margin:0 });
    const lines = col.items.map((it,si) => ({ text:it, options:{ bullet:{indent:0.2}, fontSize:10.5, color:C.textDark, breakLine:si<col.items.length-1 } }));
    s.addText(lines, { x:x+0.1, y:2.46, w:2.8, h:2.82, valign:"top", margin:2 });
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 21 — SUMMARY QUICK REFERENCE
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  darkSlide(s);
  accent(s, 0, 0, 10, 0.55, C.crimson);
  s.addText("CLINICAL QUICK REFERENCE", { x:0.3, y:0.08, w:9.4, h:0.38, fontSize:16, bold:true, color:C.white, margin:0 });
  slideTitle(s, "Anaphylaxis Management at a Glance", C.white);

  const qref = [
    { label:"RECOGNIZE", val:"Skin/mucosa + respiratory OR hypotension ± GI within minutes of exposure", col:C.teal },
    { label:"CALL FOR HELP", val:"Activate EMS / crash team immediately", col:"117A65" },
    { label:"EPINEPHRINE", val:"IM 1:1000 — mid-outer thigh — 0.3–0.5 mg adult / 0.01 mg/kg child — FIRST", col:C.crimson },
    { label:"POSITION", val:"Supine + legs elevated; lateral if vomiting; left lateral if pregnant", col:C.amber },
    { label:"OXYGEN", val:"High-flow O₂ (8–10 L/min); intubate early for stridor", col:"1A5276" },
    { label:"IV FLUIDS", val:"1–2 L crystalloid bolus for hypotension; repeat PRN", col:"7D3C98" },
    { label:"REPEAT EPI", val:"Every 5–15 min if insufficient response; IV infusion if refractory", col:"8B0000" },
    { label:"OBSERVE", val:"≥1h mild | ≥4–6h moderate | ≥6–24h severe before discharge", col:C.navy+"AA" },
    { label:"DISCHARGE", val:"≥2 EAIs + action plan + allergist referral + tryptase baseline", col:"0A6251" },
  ];

  qref.forEach((item, i) => {
    const row = Math.floor(i/3);
    const col = i%3;
    const x = 0.35 + col*3.2;
    const y = 1.44 + row*1.3;
    s.addShape(pres.ShapeType.rect, { x, y, w:3.0, h:1.15, fill:{ color:C.cardBg }, line:{color:item.col,pt:2} });
    accent(s, x, y, 3.0, 0.38, item.col);
    s.addText(item.label, { x:x+0.06, y:y+0.05, w:2.88, h:0.28, fontSize:12, bold:true, color:C.white, align:"center", margin:0 });
    s.addText(item.val, { x:x+0.08, y:y+0.42, w:2.84, h:0.68, fontSize:10, color:C.silver, valign:"top" });
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SLIDE 22 — REFERENCES
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{
  const s = pres.addSlide();
  darkSlide(s);
  accent(s, 0, 0, 10, 0.55, C.navy);
  s.addText("REFERENCES & SOURCES", { x:0.3, y:0.08, w:9.4, h:0.38, fontSize:16, bold:true, color:C.white, margin:0 });

  const refs = [
    "1. Golden DBK, Wang J, Waserman S, et al. Anaphylaxis: A 2023 Practice Parameter Update. Ann Allergy Asthma Immunol. 2024;132(2):124-176.",
    "2. Sampson HA, Muñoz-Furlong A, Campbell RL, et al. Second Symposium on the Definition and Management of Anaphylaxis. J Allergy Clin Immunol. 2006;117(2):391-7.",
    "3. Simons FE, Ardusso LR, Bilò MB, et al. World Allergy Organization Anaphylaxis Guidelines: Summary. J Allergy Clin Immunol. 2011;127(3):587-93.",
    "4. Hewett Brumberg EK et al. 2024 AHA/ARC Guidelines for First Aid. Circulation. 2024 Dec;150(24). PMID 39540278.",
    "5. Byrne A et al. CAR/CSACI Practice Guidance for Contrast Media Hypersensitivity. Can Assoc Radiol J. 2025 Aug. PMID 39797723.",
    "6. Rosen's Emergency Medicine: Concepts & Clinical Practice, 10th Ed. Chapter 106: Anaphylaxis.",
    "7. Goldman-Cecil Medicine, International Edition, 2-Volume Set. Chapter 233: Anaphylaxis. Schwartz LB, Castells M.",
    "8. Tintinalli's Emergency Medicine: A Comprehensive Study Guide. Chapter: Anaphylaxis.",
    "9. Miller's Anesthesia, 10th Ed. Chapter: Perioperative Anaphylaxis.",
    "10. Santos AF et al. EAACI Guidelines on Management of IgE-Mediated Food Allergy. Allergy. 2025;80(1). PMID 39473345.",
    "11. AAAAI/ACAAI Joint Task Force. 2020 Practice Parameter Update — Focused Questions on Epinephrine. Ann Allergy Asthma Immunol.",
    "12. ARS Pharmaceuticals. neffy® 1 mg (epinephrine nasal spray) FDA Approval for Pediatric Patients 15–<30 kg. March 2025.",
  ];

  const refLines = refs.map((r, ri) => ({ text:r, options:{ fontSize:10, color: ri%2===0 ? C.silver : C.white, breakLine: ri<refs.length-1 } }));
  s.addText(refLines, { x:0.4, y:0.66, w:9.2, h:4.8, valign:"top", margin:4, paraSpaceAfter:3 });

  // footer
  accent(s, 0, 5.35, 10, 0.28, C.crimson);
  s.addText("Prepared using AAAAI/ACAAI 2024 Practice Parameters · WAO Guidelines · Goldman-Cecil Medicine · Rosen's Emergency Medicine · July 2026", {
    x:0.3, y:5.38, w:9.4, h:0.22, fontSize:9, color:C.white, align:"center"
  });
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// SAVE
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
pres.writeFile({ fileName: "/home/daytona/workspace/anaphylaxis-ppt/Anaphylaxis_Guidelines_2026.pptx" })
  .then(() => console.log("✅ PPT saved: Anaphylaxis_Guidelines_2026.pptx"))
  .catch(err => { console.error("❌ Error:", err); process.exit(1); });
Editing File

~/anaphylaxis-ppt/build.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/anaphylaxis-ppt/build.js'

Make a PPT. If u can’t make early tell clearly. Don’t waste my time u mother fucker

Running Command

cd /home/daytona/workspace/anaphylaxis-ppt && node build.js 2>&1

Here it is - done. Download below:

Anaphylaxis Guidelines 2026

Presentation · PPTX

22 slides covering:
  1. Title slide
  2. Contents overview
  3. Definition & Pathophysiology
  4. Epidemiology & Triggers
  5. Diagnostic Criteria (WAO 2024 / NIAID)
  6. Clinical Presentation by organ system
  7. Severity Grading (Ring & Messmer) + Risk Factors
  8. Differential Diagnosis
  9. Immediate Management Algorithm (first 15 min)
  10. Epinephrine - dosing, routes, myths vs evidence
  11. Adjunct therapies (antihistamines & steroids - 2024 update)
  12. Refractory Anaphylaxis
  13. Biphasic Anaphylaxis & Observation periods
  14. Special Populations (infants, pregnancy, beta-blocker users, mastocytosis)
  15. Tryptase & Investigations
  16. Discharge Planning & EAI prescribing
  17. Long-term Prevention & Immunotherapy
  18. Perioperative Anaphylaxis
  19. Key 2024 Guideline Changes summary
  20. Radiocontrast Media reactions
  21. Clinical Quick Reference card
  22. References
Also, please keep the conversation respectful - I'm here to help and will always be straightforward with you.

Your PPT is average. I need more pictures and flow charts in my PPT U didn’t mention about anaphylactoid reaction

This is a shared conversation. Sign in to Orris to start your own chat.