pptx-react-viewer 4.19.0 → 4.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/{AiChatPanel-6ABOTMI4.js → AiChatPanel-3SIQQCI5.js} +27 -27
  3. package/dist/AiChatPanel-3SIQQCI5.js.br +0 -0
  4. package/dist/AiChatPanel-3SIQQCI5.js.gz +0 -0
  5. package/dist/{AiChatPanel-QEOFQGNY.mjs → AiChatPanel-GBKB26LM.mjs} +3 -3
  6. package/dist/AiChatPanel-GBKB26LM.mjs.br +0 -0
  7. package/dist/AiChatPanel-GBKB26LM.mjs.gz +0 -0
  8. package/dist/{Model3DScene-CKBO4RI2.mjs → Model3DScene-MKHAUUHQ.mjs} +1 -1
  9. package/dist/Model3DScene-MKHAUUHQ.mjs.br +0 -0
  10. package/dist/Model3DScene-MKHAUUHQ.mjs.gz +0 -0
  11. package/dist/{Model3DScene-ESGCOB2O.js → Model3DScene-NN27BONQ.js} +2 -2
  12. package/dist/Model3DScene-NN27BONQ.js.br +0 -0
  13. package/dist/Model3DScene-NN27BONQ.js.gz +0 -0
  14. package/dist/{chunk-FNO4C3LU.js → chunk-2GK65XF6.js} +821 -821
  15. package/dist/chunk-2GK65XF6.js.br +0 -0
  16. package/dist/chunk-2GK65XF6.js.gz +0 -0
  17. package/dist/{chunk-QSBL4SL6.js → chunk-2TASAHPC.js} +1229 -1203
  18. package/dist/chunk-2TASAHPC.js.br +0 -0
  19. package/dist/chunk-2TASAHPC.js.gz +0 -0
  20. package/dist/{chunk-WAUDRNBY.js → chunk-63VPDT3H.js} +187 -187
  21. package/dist/chunk-63VPDT3H.js.br +0 -0
  22. package/dist/chunk-63VPDT3H.js.gz +0 -0
  23. package/dist/{chunk-E3TLDJPS.js → chunk-B7VFDY5Z.js} +975 -493
  24. package/dist/chunk-B7VFDY5Z.js.br +0 -0
  25. package/dist/chunk-B7VFDY5Z.js.gz +0 -0
  26. package/dist/{chunk-LE3JUNIR.mjs → chunk-EYBZSFNK.mjs} +1 -1
  27. package/dist/chunk-EYBZSFNK.mjs.br +0 -0
  28. package/dist/chunk-EYBZSFNK.mjs.gz +0 -0
  29. package/dist/{chunk-YL7IPY2B.mjs → chunk-IXVT2EV2.mjs} +137 -111
  30. package/dist/chunk-IXVT2EV2.mjs.br +0 -0
  31. package/dist/chunk-IXVT2EV2.mjs.gz +0 -0
  32. package/dist/{chunk-YYVPC6KI.mjs → chunk-MEVOWZCB.mjs} +974 -494
  33. package/dist/chunk-MEVOWZCB.mjs.br +0 -0
  34. package/dist/chunk-MEVOWZCB.mjs.gz +0 -0
  35. package/dist/{chunk-H7FXW2Q3.js → chunk-P6YP7XYO.js} +5 -5
  36. package/dist/chunk-P6YP7XYO.js.br +0 -0
  37. package/dist/chunk-P6YP7XYO.js.gz +0 -0
  38. package/dist/{chunk-VX52VUBD.mjs → chunk-QDMBU7AS.mjs} +1 -1
  39. package/dist/chunk-QDMBU7AS.mjs.br +0 -0
  40. package/dist/chunk-QDMBU7AS.mjs.gz +0 -0
  41. package/dist/{chunk-OCUCBRXU.mjs → chunk-QZLRYVNR.mjs} +3 -3
  42. package/dist/chunk-QZLRYVNR.mjs.br +0 -0
  43. package/dist/chunk-QZLRYVNR.mjs.gz +0 -0
  44. package/dist/index.js +61 -61
  45. package/dist/index.js.br +0 -0
  46. package/dist/index.js.gz +0 -0
  47. package/dist/index.mjs +5 -5
  48. package/dist/index.mjs.br +0 -0
  49. package/dist/index.mjs.gz +0 -0
  50. package/dist/internals.js +104 -104
  51. package/dist/internals.js.br +0 -0
  52. package/dist/internals.js.gz +0 -0
  53. package/dist/internals.mjs +3 -3
  54. package/dist/internals.mjs.br +0 -0
  55. package/dist/internals.mjs.gz +0 -0
  56. package/dist/viewer/index.js +26 -26
  57. package/dist/viewer/index.js.br +0 -0
  58. package/dist/viewer/index.js.gz +0 -0
  59. package/dist/viewer/index.mjs +5 -5
  60. package/dist/viewer/index.mjs.br +3 -1
  61. package/dist/viewer/index.mjs.gz +0 -0
  62. package/package.json +2 -2
  63. package/dist/AiChatPanel-6ABOTMI4.js.br +0 -0
  64. package/dist/AiChatPanel-6ABOTMI4.js.gz +0 -0
  65. package/dist/AiChatPanel-QEOFQGNY.mjs.br +0 -0
  66. package/dist/AiChatPanel-QEOFQGNY.mjs.gz +0 -0
  67. package/dist/Model3DScene-CKBO4RI2.mjs.br +0 -0
  68. package/dist/Model3DScene-CKBO4RI2.mjs.gz +0 -0
  69. package/dist/Model3DScene-ESGCOB2O.js.br +0 -0
  70. package/dist/Model3DScene-ESGCOB2O.js.gz +0 -0
  71. package/dist/chunk-E3TLDJPS.js.br +0 -0
  72. package/dist/chunk-E3TLDJPS.js.gz +0 -0
  73. package/dist/chunk-FNO4C3LU.js.br +0 -0
  74. package/dist/chunk-FNO4C3LU.js.gz +0 -0
  75. package/dist/chunk-H7FXW2Q3.js.br +0 -0
  76. package/dist/chunk-H7FXW2Q3.js.gz +0 -0
  77. package/dist/chunk-LE3JUNIR.mjs.br +0 -0
  78. package/dist/chunk-LE3JUNIR.mjs.gz +0 -0
  79. package/dist/chunk-OCUCBRXU.mjs.br +0 -0
  80. package/dist/chunk-OCUCBRXU.mjs.gz +0 -0
  81. package/dist/chunk-QSBL4SL6.js.br +0 -0
  82. package/dist/chunk-QSBL4SL6.js.gz +0 -0
  83. package/dist/chunk-VX52VUBD.mjs.br +0 -0
  84. package/dist/chunk-VX52VUBD.mjs.gz +0 -0
  85. package/dist/chunk-WAUDRNBY.js.br +0 -0
  86. package/dist/chunk-WAUDRNBY.js.gz +0 -0
  87. package/dist/chunk-YL7IPY2B.mjs.br +0 -0
  88. package/dist/chunk-YL7IPY2B.mjs.gz +0 -0
  89. package/dist/chunk-YYVPC6KI.mjs.br +0 -0
  90. package/dist/chunk-YYVPC6KI.mjs.gz +0 -0
@@ -32687,11 +32687,11 @@ var init_raster_canvas = __esm({
32687
32687
  };
32688
32688
  }
32689
32689
  });
32690
- function drawGlyph(canvas, glyph, ox, oy, size) {
32691
- const color2 = GLYPH_COLORS[glyph];
32690
+ function drawGlyph(canvas, glyph2, ox, oy, size) {
32691
+ const color2 = GLYPH_COLORS[glyph2];
32692
32692
  canvas.fillRect(ox, oy, size, size, color2);
32693
32693
  const inset2 = size * 0.12;
32694
- switch (glyph) {
32694
+ switch (glyph2) {
32695
32695
  case "excel": {
32696
32696
  for (let i2 = 1; i2 < 3; i2++) {
32697
32697
  canvas.drawLine(ox, oy + size * i2 / 3, ox + size, oy + size * i2 / 3, WHITE, 1);
@@ -32726,13 +32726,13 @@ function drawGlyph(canvas, glyph, ox, oy, size) {
32726
32726
  function renderOleIconPng(options = {}) {
32727
32727
  const width = options.width ?? 128;
32728
32728
  const height = options.height ?? 96;
32729
- const glyph = options.glyph ?? "unknown";
32729
+ const glyph2 = options.glyph ?? "unknown";
32730
32730
  const caption = (options.caption ?? "").trim();
32731
32731
  const canvas = new RasterCanvas(width, height, rgb(255, 255, 255, 0));
32732
32732
  const glyphSize = Math.min(width * 0.5, height * 0.55);
32733
32733
  const glyphX = (width - glyphSize) / 2;
32734
32734
  const glyphY = height * 0.08;
32735
- drawGlyph(canvas, glyph, glyphX, glyphY, glyphSize);
32735
+ drawGlyph(canvas, glyph2, glyphX, glyphY, glyphSize);
32736
32736
  if (caption.length > 0) {
32737
32737
  const scale2 = Math.max(1, Math.floor(width / 64));
32738
32738
  const maxTextWidth = width - 8;
@@ -36303,11 +36303,11 @@ function placeTwoColumns(shapes, centre, top, gap, sp) {
36303
36303
  const rects = [];
36304
36304
  let bottom = top;
36305
36305
  for (const side2 of [0, 1]) {
36306
- const column = shapes.filter((_, i2) => i2 % 2 === side2);
36307
- const width = Math.max(0, ...column.map((shape) => boundsOf(shape.rects).w));
36306
+ const column2 = shapes.filter((_, i2) => i2 % 2 === side2);
36307
+ const width = Math.max(0, ...column2.map((shape) => boundsOf(shape.rects).w));
36308
36308
  const left = side2 === 0 ? centre - gap / 2 - width : centre + gap / 2;
36309
36309
  let y = top;
36310
- for (const shape of column) {
36310
+ for (const shape of column2) {
36311
36311
  const bounds = boundsOf(shape.rects);
36312
36312
  rects.push(...shiftShape(shape, left - bounds.x, y - bounds.y).rects);
36313
36313
  y += bounds.h + sp;
@@ -75619,12 +75619,12 @@ var init_PptxTableDataParser = __esm({
75619
75619
  const gridColumns = this.context.ensureArray(
75620
75620
  tableNode["a:tblGrid"]?.["a:gridCol"]
75621
75621
  );
75622
- const totalWidthEmu = gridColumns.reduce((sum, column) => {
75623
- const width = parseInt(String(column?.["@_w"] || "0"), 10) || 0;
75622
+ const totalWidthEmu = gridColumns.reduce((sum, column2) => {
75623
+ const width = parseInt(String(column2?.["@_w"] || "0"), 10) || 0;
75624
75624
  return sum + width;
75625
75625
  }, 0);
75626
- const columnWidths = totalWidthEmu > 0 ? gridColumns.map((column) => {
75627
- const width = parseInt(String(column?.["@_w"] || "0"), 10) || 0;
75626
+ const columnWidths = totalWidthEmu > 0 ? gridColumns.map((column2) => {
75627
+ const width = parseInt(String(column2?.["@_w"] || "0"), 10) || 0;
75628
75628
  return width / totalWidthEmu;
75629
75629
  }) : gridColumns.map(() => 1 / Math.max(gridColumns.length, 1));
75630
75630
  const tableProperties = tableNode["a:tblPr"] || {};
@@ -76513,7 +76513,7 @@ function getTableGridExtent(graphicData) {
76513
76513
  const grid = table2["a:tblGrid"];
76514
76514
  const widthEmu = ensureArrayLike3(
76515
76515
  grid?.["a:gridCol"]
76516
- ).reduce((sum, column) => sum + readPositiveInteger(column?.["@_w"]), 0);
76516
+ ).reduce((sum, column2) => sum + readPositiveInteger(column2?.["@_w"]), 0);
76517
76517
  const heightEmu = ensureArrayLike3(table2["a:tr"]).reduce(
76518
76518
  (sum, row) => sum + readPositiveInteger(row?.["@_h"]),
76519
76519
  0
@@ -128592,8 +128592,8 @@ function writeTableColumnWidths(tbl, columnWidths) {
128592
128592
  if (!columns.length || columns.length !== columnWidths.length) {
128593
128593
  return;
128594
128594
  }
128595
- const existingWidths = columns.map((column) => {
128596
- const value = column["@_w"];
128595
+ const existingWidths = columns.map((column2) => {
128596
+ const value = column2["@_w"];
128597
128597
  return typeof value === "number" || typeof value === "string" && value.trim() !== "" ? Number(value) : NaN;
128598
128598
  });
128599
128599
  if (existingWidths.some((width) => !Number.isSafeInteger(width) || width < 0)) {
@@ -128985,11 +128985,11 @@ function applyTableStructureEditXml(table2, source, next, edit) {
128985
128985
  const removedCells = cells(rows[index]);
128986
128986
  const nextCells = rows[index + 1] ? cells(rows[index + 1]) : [];
128987
128987
  removedCells.forEach(
128988
- (removed, column) => promoteTextBody(
128989
- source?.rows[index]?.cells[column],
128990
- next.rows[index]?.cells[column],
128988
+ (removed, column2) => promoteTextBody(
128989
+ source?.rows[index]?.cells[column2],
128990
+ next.rows[index]?.cells[column2],
128991
128991
  removed,
128992
- nextCells[column],
128992
+ nextCells[column2],
128993
128993
  axis
128994
128994
  )
128995
128995
  );
@@ -167069,13 +167069,13 @@ ${htmlRows.join("\n")}
167069
167069
  escapeHtml(text23) {
167070
167070
  return text23.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
167071
167071
  }
167072
- markOccupied(occupancy, row, column) {
167072
+ markOccupied(occupancy, row, column2) {
167073
167073
  const set2 = occupancy.get(row) ?? /* @__PURE__ */ new Set();
167074
- set2.add(column);
167074
+ set2.add(column2);
167075
167075
  occupancy.set(row, set2);
167076
167076
  }
167077
- isOccupied(occupancy, row, column) {
167078
- return occupancy.get(row)?.has(column) ?? false;
167077
+ isOccupied(occupancy, row, column2) {
167078
+ return occupancy.get(row)?.has(column2) ?? false;
167079
167079
  }
167080
167080
  /**
167081
167081
  * Returns true if the table can be rendered as a simple markdown table
@@ -174848,31 +174848,31 @@ var init_chart_horizontal_axis = __esm2({
174848
174848
  init_chart_view_model();
174849
174849
  }
174850
174850
  });
174851
- function estimatedGlyphAdvanceRatio(glyph) {
174852
- if (/\p{Mark}/u.test(glyph)) {
174851
+ function estimatedGlyphAdvanceRatio(glyph2) {
174852
+ if (/\p{Mark}/u.test(glyph2)) {
174853
174853
  return 0;
174854
174854
  }
174855
- if (/\s/u.test(glyph)) {
174855
+ if (/\s/u.test(glyph2)) {
174856
174856
  return 0.33;
174857
174857
  }
174858
174858
  if (/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Extended_Pictographic}]/u.test(
174859
- glyph
174859
+ glyph2
174860
174860
  )) {
174861
174861
  return 1;
174862
174862
  }
174863
- if (/[A-Z]/u.test(glyph)) {
174863
+ if (/[A-Z]/u.test(glyph2)) {
174864
174864
  return 0.65;
174865
174865
  }
174866
- if (/[a-z0-9]/u.test(glyph)) {
174866
+ if (/[a-z0-9]/u.test(glyph2)) {
174867
174867
  return 0.55;
174868
174868
  }
174869
- if (/[,.;:!?()\u005b\u005d{}'"`\-_/\\]/u.test(glyph)) {
174869
+ if (/[,.;:!?()\u005b\u005d{}'"`\-_/\\]/u.test(glyph2)) {
174870
174870
  return 0.35;
174871
174871
  }
174872
174872
  return 0.6;
174873
174873
  }
174874
174874
  function estimatedTextWidth(glyphs, fontSize) {
174875
- return glyphs.reduce((sum, glyph) => sum + estimatedGlyphAdvanceRatio(glyph) * fontSize, 0);
174875
+ return glyphs.reduce((sum, glyph2) => sum + estimatedGlyphAdvanceRatio(glyph2) * fontSize, 0);
174876
174876
  }
174877
174877
  function estimateTextWidth(text3, fontSize) {
174878
174878
  return estimatedTextWidth(Array.from(text3), fontSize);
@@ -174886,12 +174886,12 @@ function estimatedWrapUnits(text3) {
174886
174886
  unbreakableRun = "";
174887
174887
  }
174888
174888
  };
174889
- for (const glyph of Array.from(text3)) {
174890
- if (/\s/u.test(glyph) || BREAKABLE_GLYPH_RE.test(glyph)) {
174889
+ for (const glyph2 of Array.from(text3)) {
174890
+ if (/\s/u.test(glyph2) || BREAKABLE_GLYPH_RE.test(glyph2)) {
174891
174891
  flushRun();
174892
- units.push(glyph);
174892
+ units.push(glyph2);
174893
174893
  } else {
174894
- unbreakableRun += glyph;
174894
+ unbreakableRun += glyph2;
174895
174895
  }
174896
174896
  }
174897
174897
  flushRun();
@@ -189779,26 +189779,26 @@ function fitGlyphEnvelopeAffine(warp, box, shapeHeight = 0) {
189779
189779
  };
189780
189780
  }
189781
189781
  var FLATTEN_FRACTION = 1 / 240;
189782
- function placeGlyph(glyph, warp, maxSegment, shapeHeight) {
189782
+ function placeGlyph(glyph2, warp, maxSegment, shapeHeight) {
189783
189783
  const base = {
189784
- char: glyph.char,
189785
- segmentIndex: glyph.segmentIndex,
189786
- x: glyph.x,
189787
- y: glyph.baseline
189784
+ char: glyph2.char,
189785
+ segmentIndex: glyph2.segmentIndex,
189786
+ x: glyph2.x,
189787
+ y: glyph2.baseline
189788
189788
  };
189789
- const outlinePath = glyph.outline ? buildWarpedGlyphOutlinePathD(glyph.outline, warp, maxSegment) : void 0;
189789
+ const outlinePath = glyph2.outline ? buildWarpedGlyphOutlinePathD(glyph2.outline, warp, maxSegment) : void 0;
189790
189790
  if (outlinePath) {
189791
- const origin = warp.map(glyph.x, glyph.baseline);
189792
- const dx = origin.x - glyph.x;
189793
- const dy = origin.y - glyph.baseline;
189791
+ const origin = warp.map(glyph2.x, glyph2.baseline);
189792
+ const dx = origin.x - glyph2.x;
189793
+ const dy = origin.y - glyph2.baseline;
189794
189794
  return { ...base, transform: `matrix(1 0 0 1 ${dx} ${dy})`, outlinePath };
189795
189795
  }
189796
- const size = envelopeFontSizePx(glyph.font);
189797
- const box = glyph.ink ? { x0: glyph.ink.left, x1: glyph.ink.right, y0: glyph.ink.top, y1: glyph.ink.bottom } : {
189798
- x0: glyph.x,
189799
- x1: glyph.x + Math.max(glyph.advance, 1e-3),
189800
- y0: glyph.baseline - size * 0.72,
189801
- y1: glyph.baseline
189796
+ const size = envelopeFontSizePx(glyph2.font);
189797
+ const box = glyph2.ink ? { x0: glyph2.ink.left, x1: glyph2.ink.right, y0: glyph2.ink.top, y1: glyph2.ink.bottom } : {
189798
+ x0: glyph2.x,
189799
+ x1: glyph2.x + Math.max(glyph2.advance, 1e-3),
189800
+ y0: glyph2.baseline - size * 0.72,
189801
+ y1: glyph2.baseline
189802
189802
  };
189803
189803
  const fit = fitGlyphEnvelopeAffine(warp, box, shapeHeight);
189804
189804
  return { ...base, transform: fit.transform, slices: fit.slices };
@@ -189818,7 +189818,7 @@ function buildGlyphEnvelopeBlock(preset22, paragraphs2, width, height, align, ad
189818
189818
  }
189819
189819
  const maxSegment = Math.max(1e-3, (layout.box.right - layout.box.left) * FLATTEN_FRACTION);
189820
189820
  return layout.lines.map(
189821
- (line5) => line5.map((glyph) => placeGlyph(glyph, warp, maxSegment, height))
189821
+ (line5) => line5.map((glyph2) => placeGlyph(glyph2, warp, maxSegment, height))
189822
189822
  );
189823
189823
  }
189824
189824
  function signedArea(ring) {
@@ -213670,7 +213670,7 @@ function buildComparisonSlide(ctx) {
213670
213670
  const headerH = 7e5;
213671
213671
  const bodyY = 254e4;
213672
213672
  const bodyH = 358e4;
213673
- const column = (x, headKey, headFill, side2) => [
213673
+ const column2 = (x, headKey, headFill, side2) => [
213674
213674
  templateShape(
213675
213675
  ctx,
213676
213676
  { x, y: headerY, w: HALF_PANEL_W, h: headerH },
@@ -213696,8 +213696,8 @@ function buildComparisonSlide(ctx) {
213696
213696
  ];
213697
213697
  return [
213698
213698
  ...buildTitleBand(ctx, ctx.t("slideTitle")),
213699
- ...column(TEMPLATE_MARGIN_EMU, "optionA", "accent1", "Left"),
213700
- ...column(RIGHT_PANEL_X, "optionB", "accent2", "Right")
213699
+ ...column2(TEMPLATE_MARGIN_EMU, "optionA", "accent1", "Left"),
213700
+ ...column2(RIGHT_PANEL_X, "optionB", "accent2", "Right")
213701
213701
  ];
213702
213702
  }
213703
213703
  function buildQuoteSlide(ctx) {
@@ -214823,10 +214823,10 @@ function measureTextWidth2(text3, font) {
214823
214823
  ctx.font = font;
214824
214824
  return ctx.measureText(text3).width;
214825
214825
  }
214826
- function fillLeaderWithMeasure(glyph, width, measure22) {
214827
- const glyphWidth = Math.max(1, measure22(glyph));
214826
+ function fillLeaderWithMeasure(glyph2, width, measure22) {
214827
+ const glyphWidth = Math.max(1, measure22(glyph2));
214828
214828
  const count = Math.ceil(width / glyphWidth) + 1;
214829
- return glyph.repeat(count);
214829
+ return glyph2.repeat(count);
214830
214830
  }
214831
214831
  init_constants3();
214832
214832
  var ADVANCE_STEPS_PER_PX2 = 6;
@@ -215339,9 +215339,9 @@ function measure3(text3, font) {
215339
215339
  }
215340
215340
  function hangSpaceWordSpacing(ch, font) {
215341
215341
  const size = font.fontSizePx ?? 16;
215342
- const glyph = measure3(ch, font) ?? (ch >= "\uFF61" ? size / 2 : size);
215342
+ const glyph2 = measure3(ch, font) ?? (ch >= "\uFF61" ? size / 2 : size);
215343
215343
  const space = measure3(" ", font) ?? size / 4;
215344
- return `${Math.round((glyph - space) * 1e3) / 1e3}px`;
215344
+ return `${Math.round((glyph2 - space) * 1e3) / 1e3}px`;
215345
215345
  }
215346
215346
  function breaksBetween(ch, next, options) {
215347
215347
  return options.breakAnywhere && next !== void 0 && (isEastAsianChar(ch) || isEastAsianChar(next)) && !/\s/u.test(ch) && !/\s/u.test(next) && !(options.hangingPunctuation && HANGING.has(next));
@@ -240716,12 +240716,12 @@ function themeColorVariantToRef(scheme, variant) {
240716
240716
  return variant.kind === "lighter" ? { scheme, lumMod, lumOff: fraction } : { scheme, lumMod };
240717
240717
  }
240718
240718
  function describeThemeColorSwatch(ref, variant) {
240719
- const column = COLUMN_LABELS[ref.scheme] ?? ref.scheme;
240719
+ const column2 = COLUMN_LABELS[ref.scheme] ?? ref.scheme;
240720
240720
  if (!variant) {
240721
- return column;
240721
+ return column2;
240722
240722
  }
240723
240723
  const word = variant.kind === "lighter" ? "Lighter" : "Darker";
240724
- return `${column}, ${word} ${variant.percent}%`;
240724
+ return `${column2}, ${word} ${variant.percent}%`;
240725
240725
  }
240726
240726
  function buildThemeColorSwatchGrid(themeColorMap) {
240727
240727
  if (!themeColorMap) {
@@ -240765,8 +240765,8 @@ function themeColorRefsEqual(a, b) {
240765
240765
  }
240766
240766
  function findSelectedThemeSwatch(columns, ref, hex22) {
240767
240767
  if (ref) {
240768
- for (const column of columns) {
240769
- const swatches2 = [column.base, ...column.variants];
240768
+ for (const column2 of columns) {
240769
+ const swatches2 = [column2.base, ...column2.variants];
240770
240770
  const match = swatches2.find((swatch) => themeColorRefsEqual(swatch.ref, ref));
240771
240771
  if (match) {
240772
240772
  return match;
@@ -240778,8 +240778,8 @@ function findSelectedThemeSwatch(columns, ref, hex22) {
240778
240778
  return void 0;
240779
240779
  }
240780
240780
  const normalized = hex22.trim().toLowerCase();
240781
- for (const column of columns) {
240782
- const swatches2 = [column.base, ...column.variants];
240781
+ for (const column2 of columns) {
240782
+ const swatches2 = [column2.base, ...column2.variants];
240783
240783
  const match = swatches2.find((swatch) => swatch.hex.toLowerCase() === normalized);
240784
240784
  if (match) {
240785
240785
  return match;
@@ -240794,10 +240794,10 @@ function themeColorSwatchRows(columns) {
240794
240794
  if (columns.length === 0) {
240795
240795
  return [];
240796
240796
  }
240797
- const variantRowCount = Math.max(...columns.map((column) => column.variants.length));
240798
- const rows = [columns.map((column) => column.base)];
240797
+ const variantRowCount = Math.max(...columns.map((column2) => column2.variants.length));
240798
+ const rows = [columns.map((column2) => column2.base)];
240799
240799
  for (let i2 = 0; i2 < variantRowCount; i2++) {
240800
- rows.push(columns.map((column) => column.variants[i2]));
240800
+ rows.push(columns.map((column2) => column2.variants[i2]));
240801
240801
  }
240802
240802
  return rows;
240803
240803
  }
@@ -242404,9 +242404,9 @@ function capitalizeDayName(word) {
242404
242404
  return word;
242405
242405
  }
242406
242406
  function replaceFractions(word) {
242407
- for (const [plain, glyph] of FRACTIONS) {
242407
+ for (const [plain, glyph2] of FRACTIONS) {
242408
242408
  if (word === plain) {
242409
- return glyph;
242409
+ return glyph2;
242410
242410
  }
242411
242411
  }
242412
242412
  return word;
@@ -247492,21 +247492,21 @@ function schemeNode(val2, transforms = {}) {
247492
247492
  function refNode(idx, color2) {
247493
247493
  return { "@_idx": String(idx), ...color2 };
247494
247494
  }
247495
- function refColor2(color2, column) {
247495
+ function refColor2(color2, column2) {
247496
247496
  if (color2 === "col") {
247497
- return schemeNode(column);
247497
+ return schemeNode(column2);
247498
247498
  }
247499
247499
  if (typeof color2 === "string") {
247500
247500
  return schemeNode(color2);
247501
247501
  }
247502
- return schemeNode(column, { shade: color2.shade });
247502
+ return schemeNode(column2, { shade: color2.shade });
247503
247503
  }
247504
- function themeShapeStyleXml(row, column) {
247504
+ function themeShapeStyleXml(row, column2) {
247505
247505
  const spec5 = THEME_ROWS[row];
247506
247506
  return {
247507
- "a:lnRef": refNode(spec5.ln[0], refColor2(spec5.ln[1], column)),
247508
- "a:fillRef": refNode(spec5.fill[0], refColor2(spec5.fill[1], column)),
247509
- "a:effectRef": refNode(spec5.effect, schemeNode(column)),
247507
+ "a:lnRef": refNode(spec5.ln[0], refColor2(spec5.ln[1], column2)),
247508
+ "a:fillRef": refNode(spec5.fill[0], refColor2(spec5.fill[1], column2)),
247509
+ "a:effectRef": refNode(spec5.effect, schemeNode(column2)),
247510
247510
  "a:fontRef": refNode("minor", schemeNode(spec5.font))
247511
247511
  };
247512
247512
  }
@@ -247592,9 +247592,9 @@ function parseItemId(id) {
247592
247592
  }
247593
247593
  const block = match[1];
247594
247594
  const row = Number(match[2]);
247595
- const column = SHAPE_STYLE_COLUMNS[Number(match[3])];
247595
+ const column2 = SHAPE_STYLE_COLUMNS[Number(match[3])];
247596
247596
  const rows = block === "theme" ? SHAPE_THEME_STYLE_ROWS.length : SHAPE_PRESET_ROWS.length;
247597
- return column && row < rows ? { block, row, column } : null;
247597
+ return column2 && row < rows ? { block, row, column: column2 } : null;
247598
247598
  }
247599
247599
  function resolveTheme(xml, ctx) {
247600
247600
  return ctx.resolveStyleMatrix?.(xml) ?? fallbackResolveStyleMatrix(xml, ctx.themeColorMap);
@@ -247609,8 +247609,8 @@ function schemeHex(ref, ctx) {
247609
247609
  const overrides28 = { ...ctx.themeColorMap };
247610
247610
  return parseDrawingColorChoice({ "a:schemeClr": transforms }, overrides28) ?? "#000000";
247611
247611
  }
247612
- function presetStyle(spec5, column, ctx) {
247613
- const scheme = column;
247612
+ function presetStyle(spec5, column2, ctx) {
247613
+ const scheme = column2;
247614
247614
  const style = {};
247615
247615
  if (spec5.fill.kind === "none") {
247616
247616
  Object.assign(style, { fillMode: "none", fillColor: "transparent", fillOpacity: 0 });
@@ -247695,14 +247695,14 @@ function styleMatches(element, style) {
247695
247695
  }
247696
247696
  function item2(block, row, rowIndex, col, ctx) {
247697
247697
  const id = `${block}-${rowIndex}-${col}`;
247698
- const column = SHAPE_STYLE_COLUMNS[col];
247698
+ const column2 = SHAPE_STYLE_COLUMNS[col];
247699
247699
  const resolved = resolveItem(id, ctx);
247700
247700
  const style = resolved?.shapeStyle ?? {};
247701
247701
  return {
247702
247702
  id,
247703
247703
  labelKey: `pptx.gallery.shapeStyles.${row.key}`,
247704
- labelParams: { color: COLUMN_LABELS2[column] },
247705
- label: `${row.label} - ${COLUMN_LABELS2[column]}`,
247704
+ labelParams: { color: COLUMN_LABELS2[column2] },
247705
+ label: `${row.label} - ${COLUMN_LABELS2[column2]}`,
247706
247706
  previewSvg: shapeTileSvg(tileSpecFromShapeStyle(`gss-${id}`, style, TILE4, resolved?.fontColor)),
247707
247707
  applied: styleMatches(ctx.element, style)
247708
247708
  };
@@ -254376,169 +254376,106 @@ var RECORD_COMMAND_GROUPS = [
254376
254376
  ]
254377
254377
  }
254378
254378
  ];
254379
- var EDITOR_ARRANGE_CSS = `
254379
+ var EDITOR_CLUSTER_CSS = `
254380
254380
  @media (min-width: 768px) {
254381
- [data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] :is(
254382
- [data-pptx-chrome="align-controls"], [data-pptx-chrome="distribute-controls"],
254383
- [data-pptx-chrome="flip-controls"], [data-pptx-chrome="group-controls"]
254384
- ) { display: inline-flex; flex: none; align-items: center; gap: 0; border: 0; padding: 0; background: var(--pptx-muted); border-radius: 3px; }
254385
- [data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] :is(
254386
- [data-pptx-chrome="align-controls"], [data-pptx-chrome="distribute-controls"]
254387
- ) > button {
254388
- display: inline-flex; align-items: center; justify-content: center; flex: none;
254389
- box-sizing: border-box; width: 36px; height: 28px; padding: 6px 10px;
254390
- border: 0; border-radius: 3px; font-size: 12px; line-height: 16px; gap: 6px;
254391
- color: var(--pptx-foreground); background: var(--pptx-muted);
254381
+ [data-pptx-editor-chrome] [data-pptx-chrome="control-cluster"] {
254382
+ display: inline-flex; align-items: center; gap: 0; border: 0; padding: 0; background: transparent;
254392
254383
  }
254393
- [data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] [data-pptx-chrome="distribute-controls"] > button:first-child { width: 37px; border-right: 1px solid var(--pptx-border); }
254394
254384
  [data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] :is(
254395
- [data-pptx-chrome="align-controls"], [data-pptx-chrome="distribute-controls"]
254396
- ) > button:disabled { opacity: .4; }
254397
- [data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] :is(
254398
- [data-pptx-chrome="align-controls"], [data-pptx-chrome="distribute-controls"]
254399
- ) svg { width: 16px; height: 16px; flex: none; }
254385
+ [data-pptx-chrome="align-controls"], [data-pptx-chrome="distribute-controls"],
254386
+ [data-pptx-chrome="flip-controls"], [data-pptx-chrome="group-controls"], [data-pptx-chrome="order-controls"]
254387
+ ) { display: inline-flex; flex: none; align-items: center; gap: 0; border: 0; padding: 0; background: transparent; }
254400
254388
  [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-ribbon-control="home.arrange.crop"] {
254401
- display: inline-flex; flex: none; align-items: center; gap: 0; border: 0; padding: 0;
254402
- background: var(--pptx-muted); border-radius: 3px;
254389
+ display: inline-flex; flex: none; align-items: center; gap: 0; border: 0; padding: 0; background: transparent;
254403
254390
  }
254404
254391
  [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-ribbon-control="home.arrange.crop"] [data-pptx-ribbon-control="crop"] {
254405
254392
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
254406
- width: 37px; height: 28px; padding: 6px 10px; margin: 0;
254407
- border: 0; border-right: 1px solid var(--pptx-border); border-radius: 0; background: transparent;
254393
+ min-width: 28px; height: 24px; padding: 0 6px; margin: 0; border: 0; border-radius: 4px 0 0 4px; background: transparent;
254408
254394
  }
254409
254395
  [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-ribbon-control="home.arrange.crop"] [data-pptx-ribbon-control="crop-menu"] {
254410
254396
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
254411
- width: 32px; height: 24px; min-height: 24px; padding: 6px 10px; margin: 0;
254412
- border: 0; border-radius: 0; background: transparent; color: var(--pptx-foreground);
254413
- font-size: 12px; line-height: 16px; gap: normal;
254397
+ width: 16px; min-width: 16px; height: 24px; padding: 0; margin: 0; border: 0; border-radius: 0 4px 4px 0;
254398
+ background: transparent; color: var(--pptx-foreground); font-size: 12px; line-height: 16px; gap: normal;
254414
254399
  }
254415
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-ribbon-control="home.arrange.crop"] [data-pptx-ribbon-control="crop-menu"] svg { width: 12px; height: 12px; }
254416
- }
254417
- `;
254418
- var EDITOR_CLUSTER_CSS = `
254419
- @media (min-width: 768px) {
254420
- [data-pptx-editor-chrome] [data-pptx-chrome="order-controls"],
254421
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
254422
- [data-ribbon-control="home.paragraph.bullets"], [data-ribbon-control="home.paragraph.numbering"]
254423
- ) { background: var(--pptx-muted); border-radius: 3px; }
254424
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon"] [data-pptx-chrome="ribbon-content"] :is(
254425
- [data-ribbon-control="home.paragraph.bullets"], [data-ribbon-control="home.paragraph.numbering"]
254426
- ) [data-pptx-chrome="gallery-caret"] { padding: 0 2px; }
254427
- [data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] [data-pptx-chrome="distribute-controls"] > button {
254428
- border-radius: 0; background: transparent; gap: normal;
254429
- }
254430
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-ribbon-control="home.arrange.crop"]
254431
- [data-pptx-ribbon-control="crop"] { gap: normal; }
254432
- [data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] :is(
254433
- [data-ribbon-control="home.drawing.shapes"], [data-ribbon-control="home.drawing.arrange"]
254434
- ) > button:first-child > svg:first-of-type { order: -1; }
254400
+ [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-ribbon-control="home.arrange.crop"] [data-pptx-ribbon-control="crop-menu"] svg { width: 10px; height: 10px; }
254435
254401
  }
254436
254402
  `;
254403
+ var R = '[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"][data-pptx-chrome]';
254404
+ var BTN = `${R} :is(
254405
+ button[data-ribbon-control^="home."],
254406
+ [data-ribbon-control^="home."] > button,
254407
+ [data-ribbon-control^="home."] > span > button,
254408
+ [data-pptx-chrome="control-cluster"] > button,
254409
+ [data-pptx-chrome$="-controls"] > button
254410
+ )`;
254411
+ var LARGE = `${R} :is(button, [data-ribbon-control^="home."] > button, [data-pptx-chrome="control-cluster"] > button)[data-size="large"]`;
254437
254412
  var EDITOR_CONTROLS_CSS = `
254438
254413
  @media (min-width: 768px) {
254439
254414
  [data-pptx-editor-chrome] [data-pptx-chrome="home-content"] { gap: 0; }
254440
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-ribbon-group^="home."] { gap: 2px; }
254441
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"]
254442
- [data-ribbon-control^="home."]:not(button, input, select, pptx-ui-select) {
254415
+ ${R} [data-ribbon-control^="home."]:not(button, input, select, pptx-ui-select) {
254443
254416
  display: inline-flex; align-items: center; line-height: 16px;
254444
254417
  }
254445
- [data-pptx-editor-chrome] [data-pptx-chrome="home-group"] {
254446
- gap: 2px; padding: 0 4px 0 0; margin-right: 4px;
254447
- border-right: 1px solid color-mix(in oklab, var(--pptx-border) 40%, transparent);
254448
- }
254449
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
254450
- button[data-ribbon-control^="home."],
254451
- [data-ribbon-control^="home."] > button,
254452
- [data-ribbon-control^="home."] > span > button
254453
- ) {
254454
- display: inline-flex; align-items: center; justify-content: center;
254455
- box-sizing: border-box; height: 28px; padding: 6px 10px; min-width: 0; width: auto;
254456
- border: 0; border-radius: 3px; font-size: 12px; line-height: 16px;
254457
- color: var(--pptx-foreground); background: var(--pptx-muted); gap: 6px;
254458
- }
254459
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
254460
- button[data-ribbon-control^="home."], [data-ribbon-control^="home."] > button
254461
- ):disabled { opacity: 0.4; }
254462
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
254463
- button[data-ribbon-control^="home."], [data-ribbon-control^="home."] > button
254464
- ):hover:not(:disabled) { background: var(--pptx-accent); }
254465
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
254466
- button[data-ribbon-control^="home."], [data-ribbon-control^="home."] > button
254467
- )[aria-pressed="true"] { background: var(--pptx-accent); }
254468
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
254469
- button[data-ribbon-control^="home."], [data-ribbon-control^="home."] > button
254470
- ) svg { width: 16px; height: 16px; flex: none; }
254471
- [data-pptx-editor-chrome] [data-pptx-chrome="font-controls"] {
254472
- display: flex; align-items: center; gap: 4px;
254473
- }
254474
- [data-pptx-editor-chrome] [data-pptx-chrome="font-controls-fragment"] { display: contents; }
254475
- [data-pptx-editor-chrome] [data-pptx-chrome="slides-controls"] {
254476
- display: flex; align-items: center; gap: 4px;
254477
- }
254478
- [data-pptx-editor-chrome] [data-pptx-chrome="slides-controls"] > [data-pptx-chrome="slides-buttons"] { display: contents; }
254479
- [data-pptx-editor-chrome] [data-pptx-chrome="split-button"] {
254480
- position: relative; display: inline-flex; align-items: center; gap: 0;
254481
- padding: 0; border: 0; border-radius: 3px; background: transparent;
254482
- }
254483
- [data-pptx-editor-chrome] [data-pptx-chrome="split-segment"] {
254484
- display: inline-flex; align-items: center; padding: 0; border: 0; border-radius: 0;
254485
- }
254486
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-pptx-chrome="split-button"]:has([data-pptx-chrome="split-caret"]:not([hidden])) [data-pptx-chrome="split-main"] {
254487
- border-top-right-radius: 0; border-bottom-right-radius: 0;
254488
- }
254489
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon"] [data-pptx-chrome="ribbon-content"] [data-pptx-chrome="split-main"] {
254490
- display: inline-flex; align-items: center; justify-content: center;
254491
- height: 28px; padding: 6px 10px; gap: 6px; border: 0; border-radius: 3px; font-size: 12px; line-height: 16px;
254492
- background: var(--pptx-muted); color: var(--pptx-foreground);
254493
- }
254494
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon"] [data-pptx-chrome="ribbon-content"] [data-pptx-chrome="split-caret"] {
254495
- display: inline-flex; align-items: center; justify-content: center;
254496
- box-sizing: border-box; height: 28px; width: 36px; min-width: 36px; max-width: 36px;
254497
- padding: 6px 8px; margin: 0; border: 0; border-radius: 0 3px 3px 0;
254498
- font-size: 12px; line-height: 16px; background: var(--pptx-muted); color: var(--pptx-foreground);
254499
- border-left: 1px solid color-mix(in oklab, var(--pptx-border) 40%, transparent);
254500
- }
254501
- [data-pptx-editor-chrome] [data-pptx-chrome="split-caret"] svg { display: block; flex: none; width: 16px; height: 16px; margin: 0; }
254502
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon"] [data-pptx-chrome="ribbon-content"] :is([data-pptx-chrome="split-main"], [data-pptx-chrome="split-caret"]):hover:not(:disabled) {
254503
- background: var(--pptx-accent);
254504
- }
254418
+ ${BTN} {
254419
+ display: inline-flex; align-items: center; justify-content: center; flex: none;
254420
+ box-sizing: border-box; height: 24px; padding: 0 6px; min-width: 28px; width: auto;
254421
+ border: 0; border-radius: 4px; font-size: 12px; line-height: 16px; gap: 6px;
254422
+ color: var(--pptx-foreground); background: transparent; white-space: nowrap;
254423
+ }
254424
+ ${BTN}:disabled { opacity: 0.4; }
254425
+ ${BTN}:hover:not(:disabled) { background: var(--pptx-accent); }
254426
+ ${BTN}:active:not(:disabled) { background: color-mix(in oklab, var(--pptx-accent) 70%, var(--pptx-primary)); }
254427
+ ${BTN}[aria-pressed="true"] {
254428
+ background: color-mix(in oklab, var(--pptx-primary) 22%, transparent);
254429
+ box-shadow: inset 0 0 0 1px var(--pptx-primary);
254430
+ }
254431
+ ${BTN} svg { width: 16px; height: 16px; flex: none; }
254432
+ ${LARGE} {
254433
+ flex-direction: column; justify-content: flex-start; min-width: 48px; height: 66px; min-height: 66px;
254434
+ padding: 3px 6px; gap: 2px; line-height: 15px;
254435
+ }
254436
+ ${LARGE} svg { width: 32px; height: 32px; stroke-width: 1.35; }
254437
+ ${LARGE} svg.chev { width: 9px; height: 9px; margin-top: -1px; stroke-width: 2.2; }
254438
+ ${BTN} svg.chev { width: 10px; height: 10px; stroke-width: 2.2; }
254439
+ ${R} [data-pptx-chrome="font-controls"] { display: flex; align-items: center; gap: 4px; }
254440
+ ${R} [data-pptx-chrome="font-controls-fragment"] { display: contents; }
254441
+ ${R} [data-pptx-chrome="slides-controls"] { display: flex; align-items: flex-start; gap: 2px; }
254442
+ ${R} [data-pptx-chrome="slides-controls"] > [data-pptx-chrome="slides-buttons"] { display: contents; }
254443
+ /* Split buttons: the glyph and caption press the main action, the strip beneath opens the menu. */
254444
+ ${R} [data-pptx-chrome="split-button"] {
254445
+ position: relative; display: inline-flex; align-items: stretch; gap: 0; padding: 0; border: 0; background: transparent;
254446
+ }
254447
+ ${R} [data-pptx-chrome="split-button"]:has([data-size="large"]) { flex-direction: column; }
254448
+ ${R} button[data-pptx-chrome="split-main"][data-size="large"] { height: 52px; min-height: 52px; border-radius: 4px 4px 0 0; }
254449
+ ${R} button[data-pptx-chrome="split-caret"][data-size="caret"] {
254450
+ min-width: 0; height: 14px; min-height: 14px; padding: 0; border-radius: 0 0 4px 4px; align-self: stretch;
254451
+ }
254452
+ ${R} button[data-pptx-chrome="split-caret"][data-size="caret"] svg { width: 10px; height: 10px; stroke-width: 2.2; }
254453
+ ${R} [data-pptx-chrome="split-caret"]:not([data-size]) {
254454
+ min-width: 16px; padding: 0 2px; border-radius: 0 4px 4px 0; height: auto; align-self: stretch;
254455
+ }
254456
+ ${R} [data-pptx-chrome="split-caret"]:not([data-size]) svg { width: 10px; height: 10px; stroke-width: 2.2; }
254505
254457
  }
254506
254458
  `;
254507
254459
  var EDITOR_FONT_PICKER_CSS = `
254508
254460
  @media (min-width: 768px) {
254509
254461
  [data-pptx-editor-chrome] [data-pptx-chrome="font-groups"] { display: contents; }
254510
- [data-pptx-editor-chrome] [data-pptx-chrome="font-picker-controls"] {
254511
- display: flex; align-items: center; gap: 4px;
254512
- }
254513
- [data-pptx-editor-chrome] [data-pptx-chrome="control-cluster"] {
254514
- display: inline-flex; align-items: center; gap: 0; border: 0; padding: 0;
254515
- }
254516
- [data-pptx-editor-chrome] [data-pptx-chrome="font-controls"] [data-pptx-chrome="control-cluster"] {
254517
- background: var(--pptx-muted); border-radius: 3px; overflow: hidden;
254518
- }
254462
+ /* Font and highlight colours: the glyph over its colour bar, as in Office. */
254519
254463
  [data-pptx-editor-chrome] [data-pptx-chrome="font-controls"] :is(
254520
- [data-ribbon-control^="home.font."] > div > button,
254521
- [data-ribbon-control^="home.font."] > button,
254522
- button[data-ribbon-control^="home.font."]
254523
- ) { flex: none; box-sizing: border-box; height: 28px; width: 36px; padding: 6px 10px; gap: 6px; }
254524
- [data-pptx-editor-chrome] [data-pptx-chrome="font-controls"] :is([data-ribbon-control$="Color"] > button:first-child, [data-ribbon-control$="Color"] > div:first-child > button:first-child, [data-ribbon-control$="Color"] > span:first-child > button:first-child) {
254525
- width: 58px; flex-direction: row;
254464
+ [data-ribbon-control$="Color"] > button:first-child, [data-ribbon-control$="Color"] > div:first-child > button:first-child,
254465
+ [data-ribbon-control$="Color"] > span:first-child > button:first-child
254466
+ ) {
254467
+ flex-direction: column; justify-content: center; width: 28px; min-width: 28px; padding: 0; gap: 1px;
254526
254468
  }
254527
254469
  [data-pptx-editor-chrome] [data-pptx-chrome="font-controls"] [data-ribbon-control$="Color"] [data-pptx-chrome="color-swatch"] {
254528
- box-sizing: border-box; display: block; width: 16px; height: 4px; margin: -2px 0 0;
254529
- border: 0; border-radius: 2px; flex: none;
254470
+ box-sizing: border-box; display: block; width: 16px; height: 4px; margin: 0;
254471
+ border: 0; border-radius: 1px; flex: none;
254530
254472
  }
254531
- [data-pptx-editor-chrome] [data-pptx-chrome="font-controls"] [data-ribbon-control^="home.font."] > div > button {
254532
- display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 3px;
254533
- font-size: 12px; line-height: 16px; background: var(--pptx-muted); color: var(--pptx-foreground);
254534
- }
254535
- [data-pptx-editor-chrome] [data-pptx-chrome="font-controls"] [data-ribbon-control^="home.font."] > div > button:disabled { opacity: .4; }
254536
- [data-pptx-editor-chrome] [data-pptx-chrome="font-controls"] [data-ribbon-control^="home.font."] > div > button svg { width: 16px; height: 16px; }
254473
+ [data-pptx-editor-chrome] [data-pptx-chrome="font-controls"] [data-ribbon-control^="home.font."] > button { padding: 0; min-width: 28px; }
254537
254474
  [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
254538
254475
  [data-ribbon-control="home.font.fontFamily"], [data-ribbon-control="home.font.fontSize"]
254539
254476
  ) {
254540
254477
  --pptx-editor-font-picker-width: 120px;
254541
- box-sizing: border-box; flex: none; display: inline-flex; align-items: center; height: 28px;
254478
+ box-sizing: border-box; flex: none; display: inline-flex; align-items: center; height: 24px;
254542
254479
  width: var(--pptx-editor-font-picker-width);
254543
254480
  min-width: var(--pptx-editor-font-picker-width);
254544
254481
  max-width: var(--pptx-editor-font-picker-width);
@@ -254549,86 +254486,135 @@ var EDITOR_FONT_PICKER_CSS = `
254549
254486
  }
254550
254487
  }
254551
254488
  `;
254489
+ var R2 = '[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"][data-pptx-chrome]';
254490
+ var GROUPS = [
254491
+ "home.clipboard",
254492
+ "home.slides",
254493
+ "home.font",
254494
+ "home.paragraph",
254495
+ "home.editing",
254496
+ "home.drawing",
254497
+ "home.arrange"
254498
+ ].map((id) => `[data-ribbon-group="${id}"]`).join(", ");
254499
+ var BREAK = 'content: ""; flex: 0 0 100%; height: 0; order: 6;';
254500
+ var LISTS = `:is([data-ribbon-control="home.paragraph.bullets"], [data-ribbon-control="home.paragraph.numbering"])`;
254501
+ var FILL_IDS = ["shapeFill", "shapeOutline", "shapeEffects"].map(
254502
+ (id) => `[data-ribbon-control="home.drawing.${id}"]`
254503
+ );
254504
+ var FILL_OUTLINE = [...FILL_IDS, ...FILL_IDS.map((id) => `${id} > button`)].join(", ");
254552
254505
  var EDITOR_HOME_LAYOUT_CSS = `
254553
254506
  @media (min-width: 768px) {
254554
254507
  [data-pptx-editor-chrome] [data-pptx-chrome="control-fragment"] { display: contents; }
254555
- [data-pptx-editor-chrome] pptx-ui-select[variant="ribbon-icon"] {
254556
- flex: none; width: 36px; min-width: 36px; max-width: 36px;
254508
+ ${R2} :is(${GROUPS}) {
254509
+ position: relative; box-sizing: border-box; align-self: stretch; flex: none;
254510
+ display: flex; flex-direction: column; align-items: center; justify-content: space-between;
254511
+ min-height: 84px; padding: 3px 6px 0; margin: 0; gap: 0; border: 0;
254557
254512
  }
254558
- [data-pptx-editor-chrome] :is([data-pptx-chrome="paragraph-controls"], [data-pptx-chrome="drawing-controls"], [data-pptx-chrome="arrange-controls"], [data-pptx-chrome="editing-controls"]) {
254559
- display: flex; flex-wrap: nowrap; align-items: center; gap: 4px;
254513
+ ${R2} :is(${GROUPS})::after {
254514
+ content: ""; position: absolute; top: 6px; bottom: 6px; right: 0; width: 1px;
254515
+ background: color-mix(in oklab, var(--pptx-border) 80%, transparent);
254560
254516
  }
254561
- [data-pptx-editor-chrome] [data-pptx-chrome="list-controls"] {
254562
- display: inline-flex; align-items: center; gap: 4px;
254563
- border: 0; padding: 0; background: transparent;
254517
+ ${R2}:has([data-ribbon-group="home.font"]) :is(.w-px.self-stretch, .pptx-rb-sep, [data-pptx-chrome="ribbon-sep"]),
254518
+ [data-pptx-editor-chrome] [data-pptx-chrome="home-content"] > .pptx-svelte-hometab-sep { display: none; }
254519
+ ${R2} [data-pptx-chrome="ribbon-group-label"] {
254520
+ flex: none; max-width: 100%; height: 16px; font-size: 11px; line-height: 16px; font-weight: 400;
254521
+ color: var(--pptx-muted-foreground); text-align: center; white-space: nowrap;
254564
254522
  }
254565
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
254566
- [data-ribbon-control="home.paragraph.bullets"], [data-ribbon-control="home.paragraph.numbering"]
254567
- ) { display: inline-flex; align-items: center; gap: 0; }
254568
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
254569
- [data-ribbon-control="home.paragraph.bullets"], [data-ribbon-control="home.paragraph.numbering"]
254570
- ) > button:first-child { width: 36px; height: 28px; border-radius: 3px; }
254571
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon"] [data-pptx-chrome="ribbon-content"] :is(
254572
- [data-ribbon-control="home.paragraph.bullets"], [data-ribbon-control="home.paragraph.numbering"]
254573
- ) [data-pptx-chrome="gallery-caret"] {
254523
+ ${R2} :is(${GROUPS}) > :is([data-pptx-chrome$="-controls"], .row) {
254524
+ flex: 1 1 auto; display: flex; align-items: flex-start; gap: 2px;
254525
+ }
254526
+ ${R2} :is([data-pptx-chrome="list-controls"], [data-pptx-chrome="font-picker-controls"]) { display: contents; }
254527
+
254528
+ /* Font: family, size, grow, shrink, clear on the first row; styles, spacing, case and colours on the second. */
254529
+ ${R2} [data-ribbon-group="home.font"] [data-pptx-chrome="font-controls"] {
254530
+ flex-wrap: wrap; align-content: flex-start; align-items: center; gap: 5px 2px; width: 282px;
254531
+ }
254532
+ ${R2} [data-ribbon-group="home.font"] [data-pptx-chrome="font-controls"]::after { ${BREAK} }
254533
+ ${R2} [data-ribbon-control="home.font.fontFamily"] { order: 1; }
254534
+ ${R2} [data-ribbon-control="home.font.fontSize"] { order: 2; }
254535
+ ${R2} [data-ribbon-control="home.font.increaseFontSize"] { order: 3; }
254536
+ ${R2} [data-ribbon-control="home.font.decreaseFontSize"] { order: 4; }
254537
+ ${R2} [data-ribbon-control="home.font.clearFormatting"] { order: 5; }
254538
+ ${R2} [data-ribbon-control="home.font.bold"] { order: 10; }
254539
+ ${R2} [data-ribbon-control="home.font.italic"] { order: 11; }
254540
+ ${R2} [data-ribbon-control="home.font.underline"] { order: 12; }
254541
+ ${R2} [data-ribbon-control="home.font.shadow"] { order: 13; }
254542
+ ${R2} [data-ribbon-control="home.font.strikethrough"] { order: 14; }
254543
+ ${R2} [data-ribbon-control="home.font.characterSpacing"] { order: 15; }
254544
+ ${R2} [data-ribbon-control="home.font.changeCase"] { order: 16; }
254545
+ ${R2} [data-ribbon-control="home.font.highlightColor"] { order: 17; }
254546
+ ${R2} [data-ribbon-control="home.font.fontColor"] { order: 18; }
254547
+
254548
+ /* Paragraph: lists, indents and line spacing, then alignment, direction and columns. */
254549
+ ${R2} [data-ribbon-group="home.paragraph"] [data-pptx-chrome="paragraph-controls"] {
254550
+ flex-wrap: wrap; align-content: flex-start; align-items: center; gap: 5px 2px; width: 196px;
254551
+ }
254552
+ ${R2} [data-ribbon-group="home.paragraph"] [data-pptx-chrome="paragraph-controls"]::after { ${BREAK} }
254553
+ ${R2} [data-ribbon-control="home.paragraph.bullets"] { order: 1; }
254554
+ ${R2} [data-ribbon-control="home.paragraph.numbering"] { order: 2; }
254555
+ ${R2} [data-ribbon-control="home.paragraph.decreaseIndent"] { order: 3; }
254556
+ ${R2} [data-ribbon-control="home.paragraph.increaseIndent"] { order: 4; }
254557
+ ${R2} [data-ribbon-control="home.paragraph.lineSpacing"] { order: 5; }
254558
+ ${R2} [data-ribbon-control="home.paragraph.alignLeft"] { order: 10; }
254559
+ ${R2} [data-ribbon-control="home.paragraph.alignCenter"] { order: 11; }
254560
+ ${R2} [data-ribbon-control="home.paragraph.alignRight"] { order: 12; }
254561
+ ${R2} [data-ribbon-control="home.paragraph.justify"] { order: 13; }
254562
+ ${R2} [data-ribbon-control="home.paragraph.textDirection"] { order: 14; }
254563
+ ${R2} [data-ribbon-control="home.paragraph.columns"] { order: 15; }
254564
+ ${R2} ${LISTS} { display: inline-flex; align-items: center; gap: 0; border: 0; background: transparent; }
254565
+ ${R2} ${LISTS} > button:first-child { width: 28px; min-width: 28px; padding: 0; border-radius: 4px 0 0 4px; }
254566
+ ${R2} ${LISTS} [data-pptx-chrome="gallery-caret"] {
254574
254567
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
254575
- width: 24px; min-width: 24px; height: 24px; min-height: 24px; padding: 0 2px;
254576
- border: 0; border-radius: 0; background: transparent; color: var(--pptx-foreground); gap: normal; font-size: 12px; line-height: 16px;
254568
+ width: 16px; min-width: 16px; height: 24px; min-height: 24px; padding: 0; border: 0; border-radius: 0 4px 4px 0;
254569
+ background: transparent; color: var(--pptx-foreground); gap: normal; font-size: 12px; line-height: 16px;
254577
254570
  }
254578
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] :is(
254579
- [data-ribbon-control="home.paragraph.bullets"], [data-ribbon-control="home.paragraph.numbering"]
254580
- ) [data-pptx-chrome="gallery-caret"] svg { width: 12px; height: 12px; }
254581
- [data-pptx-editor-chrome] [data-pptx-chrome="home-content"] > .pptx-svelte-hometab-sep {
254582
- width: 1px; height: 20px; align-self: center; margin: 0 4px;
254583
- background: color-mix(in oklab, var(--pptx-border) 40%, transparent);
254584
- }
254585
- [data-pptx-editor-chrome] [data-pptx-chrome="order-controls"] {
254586
- display: inline-flex; align-items: center; gap: 0; border: 0; padding: 0;
254587
- }
254588
- [data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] [data-pptx-chrome="ribbon-inline-label"] { display: none; }
254589
- [data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] [data-ribbon-control="home.drawing.shapes"] { order: 1; }
254590
- [data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] [data-ribbon-control="home.drawing.arrange"] { order: 2; }
254591
- [data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] [data-ribbon-control="home.drawing.shapeFill"] { order: 3; }
254592
- [data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] [data-ribbon-control="home.drawing.shapeOutline"] { order: 4; }
254593
- [data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] [data-ribbon-control="home.drawing.quickStyles"] { order: 5; }
254594
- [data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] [data-ribbon-control="home.drawing.shapeEffects"] { order: 6; }
254595
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-pptx-chrome="drawing-controls"] :is(
254596
- [data-ribbon-control="home.drawing.shapeFill"], [data-ribbon-control="home.drawing.shapeOutline"]
254597
- ) :is(button:first-child, button svg) { flex: none; }
254598
- [data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] :is(
254599
- [data-ribbon-control="home.drawing.shapeFill"], [data-ribbon-control="home.drawing.shapeOutline"]
254600
- ) > button:first-child,
254601
- [data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] :is(
254602
- [data-ribbon-control="home.drawing.shapeFill"], [data-ribbon-control="home.drawing.shapeOutline"]
254603
- ) > div:first-child > button:first-child {
254604
- display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 28px;
254605
- padding: 6px 10px; border: 0; border-radius: 3px; background: var(--pptx-muted);
254606
- }
254607
- [data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] [data-pptx-chrome="color-swatch"] { display: none; }
254608
- [data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] :is(
254609
- [data-ribbon-control="home.drawing.shapes"], [data-ribbon-control="home.drawing.arrange"]
254610
- ) > button:first-child > svg:nth-of-type(2) { display: none; }
254611
- [data-pptx-editor-chrome] [data-pptx-chrome="drawing-controls"] :is(
254612
- [data-ribbon-control="home.drawing.quickStyles"], [data-ribbon-control="home.drawing.shapeEffects"]
254613
- ) > button > svg:last-child { width: 16px; height: 16px; }
254614
- [data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] .pptx-rb-sep { display: none; }
254615
- [data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] [data-pptx-chrome="arrange-extras"] { display: contents; }
254616
- [data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] [data-ribbon-control="home.arrange.outlineWidth"] { order: 1; }
254617
- [data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] [data-pptx-chrome="order-controls"] { order: 2; }
254618
- [data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] :is(
254619
- [data-ribbon-control="home.arrange.duplicate"], [data-ribbon-control="home.arrange.delete"]
254620
- ) { order: 3; }
254621
- [data-pptx-editor-chrome] [data-pptx-chrome="arrange-controls"] > [data-pptx-chrome="duplicate-controls"] { display: contents; }
254622
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-ribbon-control="home.arrange.outlineWidth"] {
254623
- box-sizing: border-box; flex: none; width: 52px; height: 26px; padding: 0 4px;
254624
- border: 1px solid var(--pptx-border); border-radius: 3px; background: var(--pptx-muted);
254625
- font-size: 11px; line-height: 16px; color: var(--pptx-foreground); text-align: center;
254626
- }
254627
- [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] [data-ribbon-control="home.arrange.outlineWidth"]:disabled { opacity: .4; }
254628
- [data-pptx-editor-chrome] [data-ribbon-group="home.editing"][data-pptx-chrome="home-group"] { padding-right: 0; margin-right: 0; border-right: 0; }
254629
- [data-pptx-editor-chrome] [data-pptx-chrome="list-controls"] > :is(
254630
- [data-ribbon-control="home.paragraph.bullets"], [data-ribbon-control="home.paragraph.numbering"]
254631
- ) > div { border: 0; }
254571
+ ${R2} ${LISTS} [data-pptx-chrome="gallery-caret"] svg { width: 10px; height: 10px; }
254572
+ ${R2} ${LISTS} > div { border: 0; }
254573
+ [data-pptx-editor-chrome] pptx-ui-select[variant="ribbon-icon"] { flex: none; width: 28px; min-width: 28px; max-width: 28px; }
254574
+
254575
+ /* Editing: Find, Replace and Select stack as three labelled rows. */
254576
+ ${R2} [data-ribbon-group="home.editing"] [data-pptx-chrome="editing-controls"] {
254577
+ flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0;
254578
+ }
254579
+ ${R2} [data-ribbon-group="home.editing"] :is(button, [data-ribbon-control]) { justify-content: flex-start; height: 22px; min-height: 22px; }
254580
+ ${R2} [data-ribbon-group="home.editing"] [data-ribbon-control] > button { height: 22px; min-height: 22px; width: 100%; }
254581
+ ${R2} [data-ribbon-group="home.clipboard"] [data-stack] { gap: 0; }
254582
+ ${R2} [data-ribbon-group="home.clipboard"] [data-stack] > button { height: 22px; min-height: 22px; justify-content: flex-start; }
254583
+
254584
+ /* Drawing: Shapes, Arrange and Quick Styles stand tall; Fill, Outline and Effects stack beside them. */
254585
+ ${R2} [data-ribbon-group="home.drawing"] [data-pptx-chrome="drawing-controls"] {
254586
+ flex-direction: column; flex-wrap: wrap; align-content: flex-start; align-items: stretch; gap: 0 2px; height: 66px; max-height: 66px;
254587
+ }
254588
+ ${R2} [data-pptx-chrome="drawing-controls"] [data-pptx-chrome="ribbon-inline-label"] { display: none; }
254589
+ ${R2} [data-pptx-chrome="drawing-controls"] [data-ribbon-control="home.drawing.shapes"] { order: 1; }
254590
+ ${R2} [data-pptx-chrome="drawing-controls"] [data-ribbon-control="home.drawing.arrange"] { order: 2; }
254591
+ ${R2} [data-pptx-chrome="drawing-controls"] [data-ribbon-control="home.drawing.quickStyles"] { order: 3; }
254592
+ ${R2} [data-pptx-chrome="drawing-controls"] [data-ribbon-control="home.drawing.shapeFill"] { order: 4; }
254593
+ ${R2} [data-pptx-chrome="drawing-controls"] [data-ribbon-control="home.drawing.shapeOutline"] { order: 5; }
254594
+ ${R2} [data-pptx-chrome="drawing-controls"] [data-ribbon-control="home.drawing.shapeEffects"] { order: 6; }
254595
+ ${R2} [data-pptx-chrome="drawing-controls"] :is(${FILL_OUTLINE}) { height: 22px; min-height: 22px; }
254596
+ ${R2} [data-pptx-chrome="drawing-controls"] [data-pptx-chrome="color-swatch"] { display: none; }
254597
+ ${R2} [data-ribbon-control="home.drawing.quickStyles"] { height: 66px; }
254598
+ ${R2} [data-ribbon-control="home.drawing.quickStyles"] .trigger {
254599
+ flex-direction: column; justify-content: flex-start; min-width: 56px; height: 66px; padding: 3px 6px; gap: 2px; line-height: 15px;
254600
+ }
254601
+ ${R2} [data-ribbon-control="home.drawing.quickStyles"] .trigger svg { width: 32px; height: 32px; stroke-width: 1.35; }
254602
+ ${R2} [data-ribbon-control="home.drawing.shapeEffects"] .trigger { height: 22px; min-height: 22px; width: 100%; justify-content: flex-start; }
254603
+
254604
+ /* Arrange: the viewer's own order, align and edit commands, as flat buttons. */
254605
+ ${R2} [data-pptx-chrome="arrange-controls"] { flex-wrap: nowrap; align-items: center; gap: 2px; }
254606
+ ${R2} [data-pptx-chrome="arrange-controls"] .pptx-rb-sep { display: none; }
254607
+ ${R2} [data-pptx-chrome="arrange-controls"] [data-pptx-chrome="arrange-extras"],
254608
+ ${R2} [data-pptx-chrome="arrange-controls"] > [data-pptx-chrome="duplicate-controls"] { display: contents; }
254609
+ ${R2} [data-pptx-chrome="arrange-controls"] [data-ribbon-control="home.arrange.outlineWidth"] { order: 1; }
254610
+ ${R2} [data-pptx-chrome="arrange-controls"] [data-pptx-chrome="order-controls"] { order: 2; }
254611
+ ${R2} [data-pptx-chrome="arrange-controls"] :is([data-ribbon-control="home.arrange.duplicate"], [data-ribbon-control="home.arrange.delete"]) { order: 3; }
254612
+ ${R2} [data-ribbon-control="home.arrange.outlineWidth"] {
254613
+ box-sizing: border-box; flex: none; width: 52px; height: 24px; padding: 0 4px;
254614
+ border: 1px solid var(--pptx-border); border-radius: 4px; background: transparent;
254615
+ font-size: 12px; line-height: 16px; color: var(--pptx-foreground); text-align: center;
254616
+ }
254617
+ ${R2} [data-ribbon-control="home.arrange.outlineWidth"]:disabled { opacity: .4; }
254632
254618
  }
254633
254619
  `;
254634
254620
  var EDITOR_INSPECTOR_CSS = `
@@ -254754,6 +254740,45 @@ var EDITOR_LAYOUT_CSS = `
254754
254740
  [data-pptx-editor-chrome] [data-pptx-chrome="notes-header"]:hover { color: var(--pptx-foreground); }
254755
254741
  }
254756
254742
  `;
254743
+ var R3 = '[data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"][data-pptx-chrome]';
254744
+ var FACE = '[data-pptx-chrome="ribbon-collapse"]';
254745
+ var NATIVE = ":not(pptx-ui-ribbon-group)";
254746
+ var EDITOR_COLLAPSE_CSS = `
254747
+ @media (min-width: 768px) {
254748
+ /* The dialog launcher: a corner glyph at the bottom right of a group. */
254749
+ ${R3} [data-ribbon-group] > [data-pptx-chrome="group-launcher"] {
254750
+ position: absolute; right: 1px; bottom: 1px; display: inline-flex; align-items: center; justify-content: center;
254751
+ width: 14px; min-width: 14px; height: 14px; min-height: 14px; padding: 0; border: 0; border-radius: 2px;
254752
+ background: transparent; color: var(--pptx-muted-foreground); cursor: pointer;
254753
+ }
254754
+ ${R3} [data-ribbon-group] > [data-pptx-chrome="group-launcher"] svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
254755
+ ${R3} [data-ribbon-group] > [data-pptx-chrome="group-launcher"]:hover { background: var(--pptx-accent); color: var(--pptx-foreground); }
254756
+ ${R3} [data-ribbon-group] > [data-pptx-chrome="group-launcher"]:focus-visible { outline: 2px solid var(--pptx-ring); outline-offset: 1px; }
254757
+ ${R3} [data-ribbon-group][data-collapsed] > [data-pptx-chrome="group-launcher"] { display: none; }
254758
+ ${R3} [data-ribbon-group] > ${FACE} { display: none; }
254759
+ ${R3} [data-ribbon-group][data-collapsed]${NATIVE} > ${FACE} {
254760
+ display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px;
254761
+ box-sizing: border-box; min-width: 56px; height: 66px; margin: 3px 0 0; padding: 3px 6px;
254762
+ border: 0; border-radius: 4px; background: transparent; color: var(--pptx-foreground);
254763
+ font: inherit; font-size: 12px; line-height: 15px; cursor: pointer;
254764
+ }
254765
+ ${R3} [data-ribbon-group][data-collapsed]${NATIVE} > ${FACE}:hover,
254766
+ ${R3} [data-ribbon-group][data-open]${NATIVE} > ${FACE} { background: var(--pptx-accent); }
254767
+ ${R3} [data-ribbon-group][data-collapsed]${NATIVE} > ${FACE}:focus-visible { outline: 2px solid var(--pptx-ring); outline-offset: 2px; }
254768
+ ${R3} [data-ribbon-group][data-collapsed]${NATIVE} > ${FACE} svg { width: 32px; height: 32px; flex: none; stroke-width: 1.35; color: var(--pptx-primary); }
254769
+ ${R3} [data-ribbon-group][data-collapsed]${NATIVE} > ${FACE} svg.chev { width: 9px; height: 9px; margin-top: -1px; stroke-width: 1.8; color: inherit; }
254770
+ ${R3} [data-ribbon-group][data-collapsed]${NATIVE} > :not(${FACE}) { display: none !important; }
254771
+ ${R3} [data-ribbon-group][data-collapsed][data-open]${NATIVE} > :not(${FACE}):not([data-pptx-chrome="ribbon-group-label"]):not([data-pptx-chrome="group-launcher"]) {
254772
+ display: flex !important; flex-wrap: wrap; position: fixed; top: var(--pptx-collapse-y, 120px); left: var(--pptx-collapse-x, 8px);
254773
+ z-index: 1200; box-sizing: border-box; width: auto; max-width: calc(100vw - 16px); padding: 8px;
254774
+ background: var(--pptx-popover); color: var(--pptx-popover-foreground);
254775
+ border: 1px solid var(--pptx-border); border-radius: 6px; box-shadow: 0 8px 24px #0005;
254776
+ }
254777
+ }
254778
+ @media (forced-colors: active) {
254779
+ ${R3} [data-ribbon-group][data-collapsed][data-open]${NATIVE} > :not(${FACE}) { border-color: ButtonText; }
254780
+ }
254781
+ `;
254757
254782
  var EDITOR_RIBBON_CSS = `
254758
254783
  @media (min-width: 768px) {
254759
254784
  [data-pptx-editor-chrome] [data-pptx-chrome="ribbon"] {
@@ -254793,7 +254818,7 @@ var EDITOR_RIBBON_CSS = `
254793
254818
  height: 2.5px; background: var(--pptx-primary);
254794
254819
  }
254795
254820
  [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-content"] {
254796
- min-height: 82px; padding: 2px 4px; gap: 0; box-sizing: border-box;
254821
+ min-height: 92px; padding: 2px 4px; gap: 0; box-sizing: border-box;
254797
254822
  }
254798
254823
  [data-pptx-editor-chrome] [data-pptx-chrome="ribbon-group-label"] {
254799
254824
  font-size: 9px; line-height: 9px; font-weight: 400;
@@ -254863,7 +254888,7 @@ var EDITOR_THUMBNAIL_CSS = `
254863
254888
  }
254864
254889
  }
254865
254890
  `;
254866
- var EDITOR_CHROME_CSS = EDITOR_LAYOUT_CSS + EDITOR_THUMBNAIL_CSS + EDITOR_RIBBON_CSS + EDITOR_INSPECTOR_CSS + EDITOR_CONTROLS_CSS + EDITOR_FONT_PICKER_CSS + EDITOR_HOME_LAYOUT_CSS + EDITOR_ARRANGE_CSS + EDITOR_CLUSTER_CSS;
254891
+ var EDITOR_CHROME_CSS = EDITOR_LAYOUT_CSS + EDITOR_THUMBNAIL_CSS + EDITOR_RIBBON_CSS + EDITOR_INSPECTOR_CSS + EDITOR_CONTROLS_CSS + EDITOR_FONT_PICKER_CSS + EDITOR_HOME_LAYOUT_CSS + EDITOR_CLUSTER_CSS + EDITOR_COLLAPSE_CSS;
254867
254892
  var ARRANGE_ALIGNMENT_ICONS = {
254868
254893
  "home.arrange.align.left": {
254869
254894
  attrs: {
@@ -256099,6 +256124,10 @@ var control = (id, labelKey, fallback, testId, extra = {}) => ({ id, labelKey, f
256099
256124
  var strip3 = (...controls2) => ({
256100
256125
  controls: controls2
256101
256126
  });
256127
+ var column = (...controls2) => ({
256128
+ controls: controls2,
256129
+ stack: true
256130
+ });
256102
256131
  var pills = (chrome, ...controls2) => ({ controls: controls2, free: true, chrome });
256103
256132
  var text22 = (key2, fallback) => ({ key: key2, fallback });
256104
256133
  var item3 = (value, labelKey, fallback, extra = {}) => ({ value, labelKey, fallback, ...extra });
@@ -256211,6 +256240,7 @@ var RIBBON_HOME_OBJECT_FAMILIES = {
256211
256240
  void 0,
256212
256241
  control("home.slides.newSlide", "pptx.home.newSlide", "New Slide", void 0, {
256213
256242
  text: text22("pptx.home.newSlide", "New Slide"),
256243
+ large: true,
256214
256244
  kind: "layout",
256215
256245
  caret: { labelKey: "pptx.home.chooseLayout", fallback: "Choose layout" }
256216
256246
  }),
@@ -256220,19 +256250,23 @@ var RIBBON_HOME_OBJECT_FAMILIES = {
256220
256250
  "Slide templates",
256221
256251
  void 0,
256222
256252
  {
256223
- text: text22("pptx.home.slideTemplates", "Slide templates")
256253
+ text: text22("pptx.home.slideTemplates", "Slide templates"),
256254
+ large: true
256224
256255
  }
256225
256256
  ),
256226
256257
  control("home.slides.layout", "pptx.master.layout", "Layout", void 0, {
256227
256258
  text: text22("pptx.master.layout", "Layout"),
256259
+ large: true,
256228
256260
  kind: "layout",
256229
256261
  popup: true
256230
256262
  }),
256231
256263
  control("home.slides.reset", "pptx.sections.resetSlideTitle", "Reset slide", void 0, {
256232
- text: text22("pptx.animations.reset", "Reset")
256264
+ text: text22("pptx.animations.reset", "Reset"),
256265
+ large: true
256233
256266
  }),
256234
256267
  control("home.slides.section", "pptx.sections.addSection", "Add section", void 0, {
256235
- text: text22("pptx.sections.sectionButtonLabel", "Section")
256268
+ text: text22("pptx.sections.sectionButtonLabel", "Section"),
256269
+ large: true
256236
256270
  })
256237
256271
  )
256238
256272
  ]
@@ -256243,17 +256277,21 @@ var RIBBON_HOME_OBJECT_FAMILIES = {
256243
256277
  void 0,
256244
256278
  control("home.drawing.shapes", "pptx.drawing.shapes", "Shapes", void 0, {
256245
256279
  text: text22("pptx.drawing.shapes", "Shapes"),
256280
+ large: true,
256246
256281
  kind: "menu",
256247
256282
  items: HOME_SHAPE_ITEMS,
256248
256283
  popup: true
256249
256284
  }),
256250
256285
  control("home.drawing.arrange", "pptx.ribbon.arrange", "Arrange", void 0, {
256251
256286
  text: text22("pptx.ribbon.arrange", "Arrange"),
256287
+ large: true,
256252
256288
  kind: "menu",
256253
256289
  items: HOME_DRAWING_ARRANGE_ITEMS,
256254
256290
  popup: true
256255
256291
  }),
256256
256292
  control("home.drawing.shapeFill", "pptx.drawing.shapeFill", "Shape Fill", void 0, {
256293
+ text: text22("pptx.drawing.shapeFill", "Shape Fill"),
256294
+ chevron: true,
256257
256295
  kind: "colour",
256258
256296
  popup: true,
256259
256297
  colour: { swatches: "shape", theme: true, swatchLabelPrefix: "Fill colour" }
@@ -256264,6 +256302,8 @@ var RIBBON_HOME_OBJECT_FAMILIES = {
256264
256302
  "Shape Outline",
256265
256303
  void 0,
256266
256304
  {
256305
+ text: text22("pptx.drawing.shapeOutline", "Shape Outline"),
256306
+ chevron: true,
256267
256307
  kind: "colour",
256268
256308
  popup: true,
256269
256309
  colour: { swatches: "shape", theme: true, swatchLabelPrefix: "Outline colour" }
@@ -256363,13 +256403,8 @@ var RIBBON_HOME_OBJECT_FAMILIES = {
256363
256403
  )
256364
256404
  ]
256365
256405
  },
256406
+ // No group of its own: the fields are the first row of the Font group the host draws.
256366
256407
  "font-picker": {
256367
- group: {
256368
- id: "home.font",
256369
- captionKey: "pptx.ribbon.font",
256370
- fallback: "Font",
256371
- rowChrome: "font-picker-controls"
256372
- },
256373
256408
  clusters: [
256374
256409
  {
256375
256410
  free: true,
@@ -256444,14 +256479,24 @@ var RIBBON_HOME_FAMILIES = {
256444
256479
  group: { id: "home.clipboard", captionKey: "pptx.ribbon.clipboard", fallback: "Clipboard" },
256445
256480
  clusters: [
256446
256481
  strip3(
256447
- control("home.clipboard.paste", "pptx.arrange.paste", "Paste"),
256448
- control("home.clipboard.cut", "pptx.arrange.cut", "Cut"),
256449
- control("home.clipboard.copy", "pptx.arrange.copy", "Copy"),
256482
+ control("home.clipboard.paste", "pptx.arrange.paste", "Paste", void 0, {
256483
+ large: true,
256484
+ text: text22("pptx.arrange.paste", "Paste")
256485
+ })
256486
+ ),
256487
+ column(
256488
+ control("home.clipboard.cut", "pptx.arrange.cut", "Cut", void 0, {
256489
+ text: text22("pptx.arrange.cut", "Cut")
256490
+ }),
256491
+ control("home.clipboard.copy", "pptx.arrange.copy", "Copy", void 0, {
256492
+ text: text22("pptx.arrange.copy", "Copy")
256493
+ }),
256450
256494
  control(
256451
256495
  "home.clipboard.formatPainter",
256452
256496
  "pptx.arrange.formatPainter",
256453
256497
  "Format Painter",
256454
- "format-painter-toggle"
256498
+ "format-painter-toggle",
256499
+ { text: text22("pptx.arrange.formatPainter", "Format Painter") }
256455
256500
  )
256456
256501
  )
256457
256502
  ]
@@ -256550,13 +256595,18 @@ var RIBBON_HOME_FAMILIES = {
256550
256595
  },
256551
256596
  editing: {
256552
256597
  clusters: [
256553
- strip3(
256554
- control("home.editing.find", "pptx.editing.find", "Find"),
256555
- control("home.editing.replace", "pptx.ribbon.replace", "Replace")
256598
+ column(
256599
+ control("home.editing.find", "pptx.editing.find", "Find", void 0, {
256600
+ text: text22("pptx.editing.find", "Find")
256601
+ }),
256602
+ control("home.editing.replace", "pptx.ribbon.replace", "Replace", void 0, {
256603
+ text: text22("pptx.ribbon.replace", "Replace")
256604
+ })
256556
256605
  ),
256557
256606
  pills(
256558
256607
  void 0,
256559
256608
  control("home.editing.select", "pptx.ribbon.tool.select", "Select", void 0, {
256609
+ text: text22("pptx.ribbon.tool.select", "Select"),
256560
256610
  kind: "menu",
256561
256611
  popup: true,
256562
256612
  items: HOME_SELECT_ITEMS
@@ -257613,7 +257663,7 @@ button.busy::before { content: ''; width: 12px; height: 12px; border: 2px solid
257613
257663
  @media (prefers-reduced-motion: reduce) { button.busy::before { animation: none; } }
257614
257664
  button:disabled { cursor: not-allowed; opacity: .55; }
257615
257665
  button:focus-visible { outline: 2px solid var(--pptx-ring, #6366f1); outline-offset: 2px; }
257616
- @media (pointer: coarse) { button { min-width: 44px; min-height: 44px; } }
257666
+ @media (pointer: coarse), (max-width: 767px) { button { min-width: 44px; min-height: 44px; } }
257617
257667
  @media (forced-colors: active) {
257618
257668
  button, button.primary, button.warning, button.danger { border-color: ButtonText; background: ButtonFace; color: ButtonText; }
257619
257669
  button:hover:not(:disabled) { background: Highlight; color: HighlightText; }
@@ -259729,29 +259779,29 @@ function createAnimationsGalleryView(doc, controlId, aria, columns, pick) {
259729
259779
  strip22.className = "strip";
259730
259780
  const columnEls = [];
259731
259781
  const buttons = [];
259732
- columns.forEach((column) => {
259782
+ columns.forEach((column2) => {
259733
259783
  const el = doc.createElement("div");
259734
259784
  el.className = "column";
259735
259785
  el.setAttribute("role", "group");
259736
259786
  columnEls.push(el);
259737
- for (const item4 of column.items) {
259787
+ for (const item4 of column2.items) {
259738
259788
  const button = doc.createElement("button");
259739
259789
  button.type = "button";
259740
259790
  button.className = "preset";
259741
259791
  button.dataset.pptxCompact = "";
259742
- button.dataset.tone = column.tone;
259792
+ button.dataset.tone = column2.tone;
259743
259793
  button.dataset.animationPreset = item4.value;
259744
259794
  const name = doc.createElement("span");
259745
259795
  name.className = "name";
259746
259796
  button.append(
259747
259797
  icon(
259748
259798
  doc,
259749
- column.tone === "path" ? RIBBON_ANIMATION_ICON_PATHS.moveRight : RIBBON_ANIMATION_ICON_PATHS.star,
259799
+ column2.tone === "path" ? RIBBON_ANIMATION_ICON_PATHS.moveRight : RIBBON_ANIMATION_ICON_PATHS.star,
259750
259800
  "tile-icon"
259751
259801
  ),
259752
259802
  name
259753
259803
  );
259754
- button.addEventListener("click", () => pick(column.key, item4.value));
259804
+ button.addEventListener("click", () => pick(column2.key, item4.value));
259755
259805
  button.addEventListener("keydown", (event) => {
259756
259806
  if (event.key === " " || event.key === "Enter") {
259757
259807
  event.stopPropagation();
@@ -259777,10 +259827,10 @@ function createAnimationsGalleryView(doc, controlId, aria, columns, pick) {
259777
259827
  const moreLabel = animationsLabel(state, "pptx.animations.moreEffects", "More Effects");
259778
259828
  more.setAttribute("aria-label", moreLabel);
259779
259829
  more.title = moreLabel;
259780
- columns.forEach((column, index) => {
259830
+ columns.forEach((column2, index) => {
259781
259831
  columnEls[index].setAttribute(
259782
259832
  "aria-label",
259783
- animationsLabel(state, column.labelKey, column.fallback)
259833
+ animationsLabel(state, column2.labelKey, column2.fallback)
259784
259834
  );
259785
259835
  });
259786
259836
  const gated = animationsGated(state);
@@ -260155,21 +260205,29 @@ var RIBBON_COMMAND_STYLES = `
260155
260205
  .badge { position:absolute; top:0; right:0; border-radius:99px; padding:0 3px; background:var(--pptx-primary,#6366f1); color:var(--pptx-primary-foreground,#fff); font-size:9px; }
260156
260206
  .badge[hidden] { display:none; }
260157
260207
  span[hidden],.caret[hidden] { display:none; }
260208
+ /* The chevron trails the last line of a large command's label, as PowerPoint draws it. */
260158
260209
  .caret { display:inline-block; width:10px; height:10px; margin-inline-start:2px; vertical-align:-1px; color:var(--pptx-muted-foreground,#94a3b8); fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
260210
+ /* Large command: Office draws a 32px glyph above a two-line label. */
260159
260211
  button {
260160
260212
  box-sizing: border-box; position:relative; display: inline-flex; flex-direction: column; align-items: center;
260161
- justify-content: flex-start; gap: 2px; min-width: 54px; max-width: 78px; height: 58px;
260162
- padding: 4px; border: 0; border-radius: 4px; background: transparent;
260213
+ justify-content: flex-start; gap: 2px; min-width: 48px; max-width: 80px; height: 66px;
260214
+ padding: 3px 4px; border: 0; border-radius: 4px; background: transparent;
260163
260215
  color: var(--pptx-foreground, #f9fafb); cursor: pointer; font: inherit;
260164
- font-size: 9px; line-height: 11px; text-align: center;
260216
+ font-size: 12px; line-height: 15px; text-align: center;
260165
260217
  }
260166
- svg { width: 24px; height: 24px; flex: none; color: var(--pptx-primary, #6366f1);
260167
- fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
260218
+ svg { width: 32px; height: 32px; flex: none; color: var(--pptx-primary, #6366f1);
260219
+ fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
260168
260220
  :host([compact]) button { flex-direction: row; align-items: center; justify-content: flex-start;
260169
- gap: 6px; min-width: 88px; max-width: none; height: 26px; padding: 0 4px; font-size: 10px; text-align: left; }
260170
- :host([compact]) svg { width: 16px; height: 16px; }
260221
+ gap: 6px; min-width: 0; max-width: none; height: 24px; padding: 0 6px; font-size: 12px; line-height: 16px; text-align: left; }
260222
+ :host([compact]) svg { width: 16px; height: 16px; stroke-width: 1.5; }
260171
260223
  :host([icon-only]) button { min-width:28px; max-width:none; height:28px; padding:4px; }
260224
+ :host([icon-only]) svg { width: 18px; height: 18px; }
260225
+ /* Drawing tools: a tall, label-less button like Office's pen and eraser tiles. */
260226
+ :host([icon-only][tall]) button { min-width:40px; max-width:none; height:62px; padding:4px; }
260227
+ :host([icon-only][tall]) svg { width:30px; height:30px; }
260228
+ :host([icon-only][tall][active]) button { background: color-mix(in srgb, var(--pptx-primary, #6366f1) 22%, transparent); box-shadow: inset 0 0 0 1px var(--pptx-primary, #6366f1); }
260172
260229
  button:hover:not(:disabled) { background: var(--pptx-accent, #33334d); }
260230
+ button:active:not(:disabled) { background: color-mix(in srgb, var(--pptx-accent, #33334d) 70%, var(--pptx-primary, #6366f1)); }
260173
260231
  :host([active]) button { background: color-mix(in srgb, var(--pptx-primary, #6366f1) 15%, transparent); color: var(--pptx-primary, #6366f1); }
260174
260232
  button:disabled { opacity: .35; cursor: not-allowed; }
260175
260233
  button:focus-visible { outline: 2px solid var(--pptx-ring, #6366f1); outline-offset: 2px; }
@@ -260198,7 +260256,8 @@ function definePptxRibbonCommand(registry) {
260198
260256
  "data-ribbon-control",
260199
260257
  "badge",
260200
260258
  "icon-only",
260201
- "caret"
260259
+ "caret",
260260
+ "tall"
260202
260261
  ];
260203
260262
  button;
260204
260263
  text;
@@ -260284,11 +260343,11 @@ function definePptxRibbonCommand(registry) {
260284
260343
  registry.define("pptx-ui-ribbon-command", RibbonCommand);
260285
260344
  }
260286
260345
  var RIBBON_DRAW_STYLES = `
260287
- :host { display:inline-flex; align-items:center; color:var(--pptx-foreground,#f8fafc); font:inherit; }
260288
- .tools,.settings,label { display:inline-flex; align-items:center; gap:6px; }
260289
- .tools { gap:2px; }
260290
- .settings { gap:10px; margin-inline-start:10px; font-size:11px; }
260291
- label { color:var(--pptx-muted-foreground,#94a3b8); }
260346
+ :host { display:inline-flex; align-items:flex-start; color:var(--pptx-foreground,#f8fafc); font:inherit; }
260347
+ .tools,.settings { display:inline-flex; align-items:flex-start; gap:2px; }
260348
+ .settings { gap:8px; margin-inline-start:6px; padding-inline-start:8px; border-inline-start:1px solid color-mix(in srgb,var(--pptx-border,#374151) 80%,transparent); font-size:12px; }
260349
+ label { display:flex; flex-wrap:wrap; align-items:center; gap:4px 6px; width:150px; color:var(--pptx-foreground,#f8fafc); }
260350
+ label > span { flex:0 0 100%; }
260292
260351
  button,input,summary { font:inherit; color:inherit; box-sizing:border-box; }
260293
260352
  button,summary,input[type=color] { border:1px solid var(--pptx-border,#374151); background:var(--pptx-background,#111827); border-radius:4px; }
260294
260353
  button,summary { cursor:pointer; }
@@ -260299,11 +260358,12 @@ button:disabled,input:disabled { opacity:.4; cursor:default; }
260299
260358
  button:focus-visible,summary:focus-visible,input:focus-visible { outline:2px solid var(--pptx-ring,#818cf8); outline-offset:2px; }
260300
260359
  svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
260301
260360
  details { position:relative; }
260302
- summary { padding:5px 8px; min-height:28px; display:flex; align-items:center; gap:6px; list-style:none; }
260361
+ /* Pen colour: Office shows the ink colour on the tool; here a swatch sits above its caption. */
260362
+ summary { box-sizing:border-box; width:56px; height:62px; padding:4px; display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:3px; border:0; background:transparent; list-style:none; font-size:12px; line-height:15px; text-align:center; }
260303
260363
  summary::-webkit-details-marker { display:none; }
260304
260364
  summary[aria-disabled=true] { opacity:.4; cursor:default; }
260305
- summary::after { content:'\\2304'; }
260306
- .preview { width:14px; height:14px; border:1px solid var(--pptx-border,#374151); }
260365
+ summary::after { content:''; width:6px; height:6px; margin-top:-3px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg) scale(.8); }
260366
+ .preview { width:30px; height:30px; border:1px solid var(--pptx-border,#374151); border-radius:4px; }
260307
260367
  .palette { box-sizing:border-box; position:fixed; z-index:1200; width:240px; max-width:calc(100vw - 16px); max-height:65vh; overflow:auto; padding:8px; background:var(--pptx-popover,#111827); border:1px solid var(--pptx-border,#374151); border-radius:6px; box-shadow:0 8px 24px #0005; }
260308
260368
  .swatches { display:flex; flex-wrap:wrap; gap:4px; margin:4px 0 8px; }
260309
260369
  .swatch { width:28px; height:28px; border:1px solid var(--pptx-border,#374151); }
@@ -260332,7 +260392,7 @@ function createRibbonDrawView(doc, request) {
260332
260392
  const tools = DRAW_RIBBON_TOOLS.map((tool) => {
260333
260393
  const command = doc.createElement("pptx-ui-ribbon-command");
260334
260394
  command.dataset.ribbonControl = `draw.tools.${tool.id}`;
260335
- command.setAttribute("compact", "");
260395
+ command.setAttribute("tall", "");
260336
260396
  command.setAttribute("icon-only", "");
260337
260397
  command.setAttribute("icon", tool.icon);
260338
260398
  command.addEventListener("command-request", (event) => {
@@ -260578,7 +260638,8 @@ ${host} button { box-sizing:border-box; font:inherit; color:inherit; cursor:poin
260578
260638
  ${host} button:hover:not(:disabled) { background:var(--pptx-accent,#33334d); }
260579
260639
  ${host} button:disabled { opacity:.4; cursor:not-allowed; }
260580
260640
  ${host} button:focus-visible { outline:2px solid var(--pptx-ring,#6366f1); outline-offset:2px; }
260581
- ${host} .trigger { display:inline-flex; align-items:center; gap:6px; min-height:26px; padding:4px 8px; font-size:11px; white-space:nowrap; }
260641
+ ${host} .trigger { display:inline-flex; align-items:center; gap:6px; min-height:24px; padding:0 6px; font-size:12px; white-space:nowrap; }
260642
+ ${host}:not([mode=inline]) .trigger { border-color:transparent; background:transparent; }
260582
260643
  ${host} .trigger svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
260583
260644
  ${host}[mode=inline] .trigger, ${host}[chevron-only] .trigger { align-self:stretch; padding:0 4px; }
260584
260645
  ${host} .strip { display:flex; gap:2px; padding:2px; align-items:center; }
@@ -260617,6 +260678,30 @@ function attachRibbonGalleryStyles(doc) {
260617
260678
  doc.head.append(style);
260618
260679
  }
260619
260680
  }
260681
+ var BLOCKED_ELEMENTS = /* @__PURE__ */ new Set(["script", "foreignobject", "iframe", "object", "embed"]);
260682
+ function parseSvgPreview(doc, svg) {
260683
+ const Parser = globalThis.DOMParser;
260684
+ if (typeof Parser !== "function") {
260685
+ return null;
260686
+ }
260687
+ const parsed = new Parser().parseFromString(svg, "image/svg+xml");
260688
+ const root = parsed.documentElement;
260689
+ if (root.localName !== "svg" || parsed.getElementsByTagName("parsererror").length > 0) {
260690
+ return null;
260691
+ }
260692
+ for (const node of Array.from(root.querySelectorAll("*"))) {
260693
+ if (BLOCKED_ELEMENTS.has(node.localName.toLowerCase())) {
260694
+ node.remove();
260695
+ continue;
260696
+ }
260697
+ for (const attribute2 of Array.from(node.attributes)) {
260698
+ if (/^on/iu.test(attribute2.name) || /^\s*javascript:/iu.test(attribute2.value)) {
260699
+ node.removeAttribute(attribute2.name);
260700
+ }
260701
+ }
260702
+ }
260703
+ return doc.importNode(root, true);
260704
+ }
260620
260705
  function createRibbonGalleryView(doc, pick, toggle2) {
260621
260706
  const root = doc.createElement("span");
260622
260707
  root.className = "gallery-view";
@@ -260649,7 +260734,10 @@ function createRibbonGalleryView(doc, pick, toggle2) {
260649
260734
  button.title = galleryItemLabel(item4, t);
260650
260735
  button.style.width = `${width + 6}px`;
260651
260736
  button.style.height = `${height + 6}px`;
260652
- button.innerHTML = item4.previewSvg;
260737
+ const preview = parseSvgPreview(doc, item4.previewSvg);
260738
+ if (preview) {
260739
+ button.append(preview);
260740
+ }
260653
260741
  button.addEventListener("click", () => pick(item4.id));
260654
260742
  return button;
260655
260743
  };
@@ -260954,27 +261042,58 @@ function definePptxRibbonGallery(registry) {
260954
261042
  }
260955
261043
  var STYLES = `
260956
261044
  :host { display: inline-flex; flex: none; align-self: stretch; }
260957
- .group { box-sizing: border-box; display: flex; flex-direction: column; justify-content: space-between;
260958
- min-height: 78px; padding: 4px 8px 2px; border-right: 1px solid color-mix(in srgb, var(--pptx-border, #33334d) 60%, transparent); }
260959
- :host(:last-child) .group { border-right: 0; }
260960
- .row { display: flex; align-items: flex-start; gap: 4px; }
261045
+ .group { position: relative; box-sizing: border-box; display: flex; flex-direction: column; justify-content: space-between;
261046
+ min-height: 84px; padding: 3px 6px 0; }
261047
+ /* Office draws a hairline between groups that stops short of the group's top and bottom. */
261048
+ .group::after { content: ''; position: absolute; top: 6px; bottom: 6px; right: 0; width: 1px;
261049
+ background: color-mix(in srgb, var(--pptx-border, #33334d) 80%, transparent); }
261050
+ :host(:last-child) .group::after { content: none; }
261051
+ .row { display: flex; align-items: flex-start; gap: 2px; flex: 1; }
260961
261052
  /* One-line (compact) groups centre their commands on the whole group box; the caption
260962
261053
  stays in flow and the row's negative margin hands its height to the centring. */
260963
- :host([data-compact-row]) .row { flex: 1; align-items: center; margin-bottom: -14px; }
260964
- /* Several small drop-down galleries or commands (Picture Format > Adjust, SmartArt > Create Graphic) stack in columns of three, as PowerPoint draws them. */
260965
- :host([data-stack]) .row { flex-direction: column; align-items: flex-start; align-content: flex-start; flex-wrap: wrap; max-height: 84px; gap: 2px; margin-bottom: 0; }
261054
+ :host([data-compact-row]) .row { align-items: center; margin-bottom: -14px; }
261055
+ /* Several small drop-down galleries or commands (Picture Format > Adjust, SmartArt > Create Graphic, Design > Variants) stack in columns of three, as PowerPoint draws them. */
261056
+ :host([data-stack]) .row { flex-direction: column; align-items: stretch; align-content: flex-start; flex-wrap: wrap; max-height: 80px; gap: 2px; margin-bottom: 0; }
260966
261057
  ::slotted(*) { flex-shrink: 0; }
260967
- .caption { padding-top: 2px; color: var(--pptx-muted-foreground, #94a3b8); font: inherit;
260968
- font-size: 9px; line-height: 12px; text-align: center; white-space: nowrap; }
261058
+ .foot { position: relative; display: flex; align-items: center; justify-content: center; min-height: 16px; padding: 0 14px; }
261059
+ .caption { color: var(--pptx-muted-foreground, #94a3b8); font: inherit;
261060
+ font-size: 11px; line-height: 16px; text-align: center; white-space: nowrap; }
261061
+ .launcher { position: absolute; right: -2px; bottom: 1px; display: none; width: 14px; height: 14px; padding: 0;
261062
+ align-items: center; justify-content: center; border: 0; border-radius: 2px; background: transparent;
261063
+ color: var(--pptx-muted-foreground, #94a3b8); cursor: pointer; }
261064
+ :host([launcher]) .launcher { display: inline-flex; }
261065
+ .launcher svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
261066
+ .launcher:hover { background: var(--pptx-accent, #33334d); color: var(--pptx-foreground, #f8fafc); }
261067
+ .launcher:focus-visible { outline: 2px solid var(--pptx-ring, #6366f1); outline-offset: 1px; }
261068
+ /* Collapsed (narrow window): the group is one button; its commands open in a popup. */
261069
+ .face { display: none; }
261070
+ :host([data-collapsed]) .face { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px;
261071
+ min-width: 56px; height: 66px; margin-top: 3px; padding: 3px 6px; border: 0; border-radius: 4px; background: transparent;
261072
+ color: var(--pptx-foreground, #f8fafc); font: inherit; font-size: 12px; line-height: 15px; cursor: pointer; }
261073
+ :host([data-collapsed]) .face:hover, :host([data-open]) .face { background: var(--pptx-accent, #33334d); }
261074
+ .face:focus-visible { outline: 2px solid var(--pptx-ring, #6366f1); outline-offset: 2px; }
261075
+ .face svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; color: var(--pptx-primary, #6366f1); }
261076
+ .face svg.chev { width: 9px; height: 9px; margin-top: -1px; stroke-width: 1.8; color: currentColor; }
261077
+ :host([data-collapsed]) .foot { display: none; }
261078
+ :host([data-collapsed]) .row { display: none; }
261079
+ :host([data-collapsed][data-open]) .row { display: flex; flex-wrap: wrap; position: fixed; top: var(--pptx-collapse-y, 120px); left: var(--pptx-collapse-x, 8px);
261080
+ z-index: 1200; box-sizing: border-box; max-width: calc(100vw - 16px); padding: 8px; background: var(--pptx-popover, #111827); color: var(--pptx-popover-foreground, #f9fafb);
261081
+ border: 1px solid var(--pptx-border, #374151); border-radius: 6px; box-shadow: 0 8px 24px #0005; }
261082
+ @media (forced-colors: active) { .group::after { background: ButtonText; } .launcher { color: ButtonText; } :host([data-collapsed][data-open]) .row { border-color: ButtonText; } }
260969
261083
  `;
261084
+ var LAUNCHER_PATH = "M2 2h4M2 2v4M10 10 4 4M10 10H7M10 10V7";
260970
261085
  var COMPACT_ROW_MAX_HEIGHT = 36;
260971
261086
  function definePptxRibbonGroup(registry) {
260972
261087
  if (registry.get("pptx-ui-ribbon-group")) {
260973
261088
  return;
260974
261089
  }
260975
261090
  class RibbonGroup extends HTMLElement {
260976
- static observedAttributes = ["label"];
261091
+ static observedAttributes = ["label", "launcher-label", "data-ribbon-group", "icon"];
260977
261092
  caption;
261093
+ launcherButton;
261094
+ face;
261095
+ facePath;
261096
+ faceLabel;
260978
261097
  observer;
260979
261098
  slotEl;
260980
261099
  constructor() {
@@ -260991,7 +261110,55 @@ function definePptxRibbonGroup(registry) {
260991
261110
  row.append(slot);
260992
261111
  this.caption = document.createElement("span");
260993
261112
  this.caption.className = "caption";
260994
- group2.append(row, this.caption);
261113
+ const foot = document.createElement("div");
261114
+ foot.className = "foot";
261115
+ this.launcherButton = document.createElement("button");
261116
+ this.launcherButton.type = "button";
261117
+ this.launcherButton.className = "launcher";
261118
+ this.launcherButton.dataset.pptxChrome = "group-launcher";
261119
+ const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
261120
+ svg.setAttribute("viewBox", "0 0 12 12");
261121
+ svg.setAttribute("aria-hidden", "true");
261122
+ const path = document.createElementNS("http://www.w3.org/2000/svg", "path");
261123
+ path.setAttribute("d", LAUNCHER_PATH);
261124
+ svg.append(path);
261125
+ this.launcherButton.append(svg);
261126
+ this.launcherButton.addEventListener("click", () => {
261127
+ this.dispatchEvent(
261128
+ new CustomEvent("launcher-request", {
261129
+ detail: { id: this.getAttribute("data-ribbon-group") },
261130
+ bubbles: true,
261131
+ composed: true
261132
+ })
261133
+ );
261134
+ });
261135
+ foot.append(this.caption, this.launcherButton);
261136
+ this.face = document.createElement("button");
261137
+ this.face.type = "button";
261138
+ this.face.className = "face";
261139
+ this.face.dataset.pptxChrome = "ribbon-collapse";
261140
+ this.face.setAttribute("aria-haspopup", "true");
261141
+ const faceSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
261142
+ faceSvg.setAttribute("viewBox", "0 0 20 20");
261143
+ faceSvg.setAttribute("aria-hidden", "true");
261144
+ this.facePath = document.createElementNS("http://www.w3.org/2000/svg", "path");
261145
+ faceSvg.append(this.facePath);
261146
+ this.faceLabel = document.createElement("span");
261147
+ const chevron2 = document.createElementNS("http://www.w3.org/2000/svg", "svg");
261148
+ chevron2.setAttribute("viewBox", "0 0 10 10");
261149
+ chevron2.setAttribute("class", "chev");
261150
+ chevron2.setAttribute("aria-hidden", "true");
261151
+ const chevronPath2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
261152
+ chevronPath2.setAttribute("d", "m1.5 3.5 3.5 3.5 3.5-3.5");
261153
+ chevron2.append(chevronPath2);
261154
+ this.face.append(faceSvg, this.faceLabel, chevron2);
261155
+ this.face.addEventListener(
261156
+ "click",
261157
+ () => this.dispatchEvent(
261158
+ new CustomEvent("ribbon-collapse-toggle", { bubbles: true, composed: true })
261159
+ )
261160
+ );
261161
+ group2.append(this.face, row, foot);
260995
261162
  root.append(group2);
260996
261163
  }
260997
261164
  connectedCallback() {
@@ -261004,6 +261171,9 @@ function definePptxRibbonGroup(registry) {
261004
261171
  }
261005
261172
  observe(slot) {
261006
261173
  this.observer?.disconnect();
261174
+ if (!this.isConnected) {
261175
+ return;
261176
+ }
261007
261177
  if (typeof ResizeObserver !== "undefined") {
261008
261178
  this.observer ??= new ResizeObserver(() => this.measure());
261009
261179
  }
@@ -261035,6 +261205,17 @@ function definePptxRibbonGroup(registry) {
261035
261205
  const label = this.getAttribute("label") ?? "";
261036
261206
  this.caption.textContent = label;
261037
261207
  this.setAttribute("aria-label", label);
261208
+ const launcherLabel = this.getAttribute("launcher-label") ?? `${label} options`;
261209
+ this.faceLabel.textContent = label;
261210
+ this.face.title = label;
261211
+ this.face.setAttribute("aria-label", label);
261212
+ this.face.setAttribute("aria-expanded", String(this.hasAttribute("data-open")));
261213
+ this.facePath.setAttribute(
261214
+ "d",
261215
+ RIBBON_ICON_PATHS[this.getAttribute("icon") ?? "layers"] ?? ""
261216
+ );
261217
+ this.launcherButton.setAttribute("aria-label", launcherLabel);
261218
+ this.launcherButton.title = launcherLabel;
261038
261219
  }
261039
261220
  }
261040
261221
  registry.define("pptx-ui-ribbon-group", RibbonGroup);
@@ -261057,23 +261238,63 @@ var RIBBON_HOME_TAGS = [
261057
261238
  var RIBBON_HOME_STYLES = `
261058
261239
  :host { display:contents; }
261059
261240
  .home { display:contents; }
261060
- .group { display:flex; flex-direction:column; align-items:center; gap:2px; }
261061
- .row { display:flex; align-items:center; gap:4px; }
261062
- .wrap { display:inline-flex; align-items:center; gap:4px; }
261063
- .free { display:inline-flex; align-items:center; gap:4px; }
261241
+ .slot[hidden] { display:none !important; }
261242
+ .free pptx-ui-select, .wrap pptx-ui-select { flex:none; }
261243
+ /* Groups the element renders itself (Clipboard, Slides): Office's column of rows over a caption. */
261244
+ .group { position:relative; box-sizing:border-box; display:flex; flex-direction:column; align-items:stretch; justify-content:space-between; min-height:84px; padding:3px 6px 0; }
261245
+ .group::after { content:''; position:absolute; top:6px; bottom:6px; right:0; width:1px; background:color-mix(in srgb,var(--pptx-border,#475569) 80%,transparent); }
261246
+ .row { display:flex; align-items:flex-start; gap:2px; flex:1; }
261247
+ .wrap { display:inline-flex; align-items:center; gap:2px; }
261248
+ .free { display:inline-flex; align-items:flex-start; gap:2px; }
261064
261249
  .slot { position:relative; display:inline-flex; align-items:center; }
261065
261250
  .slot[hidden] { display:none !important; }
261066
- .free button.b { border-radius:4px; background:var(--pptx-muted,#2a2a3d); gap:6px; white-space:nowrap; }
261067
- .free button.b[data-tone=danger] { background:color-mix(in srgb,#b91c1c 80%,transparent); }
261068
- .free button.b[data-tone=danger]:hover:not(:disabled) { background:#dc2626; }
261069
- .slot > button.b[data-pptx-chrome=split-main] { border-radius:4px 0 0 4px; background:var(--pptx-muted,#2a2a3d); gap:6px; white-space:nowrap; }
261070
- .slot > button.b[data-pptx-chrome=split-caret] { min-width:20px; padding:0 4px; border-radius:0 4px 4px 0; border-left:1px solid color-mix(in srgb,var(--pptx-border,#475569) 40%,transparent); background:var(--pptx-muted,#2a2a3d); align-self:stretch; height:auto; }
261071
- .slot > button.b[data-pptx-chrome=split-caret] svg { width:12px; height:12px; }
261072
261251
  .text { white-space:nowrap; }
261073
- button.b .chev { width:12px; height:12px; }
261074
- .free button.b[aria-pressed=true] { background:var(--pptx-accent,#33334d); }
261075
- .free button.b[data-testid=format-painter-toggle][aria-pressed=true] { background:#d97706; color:#fffbeb; box-shadow:none; }
261076
- .free pptx-ui-select, .wrap pptx-ui-select { flex:none; }
261252
+ .caption { padding-top:0; color:var(--pptx-muted-foreground,#94a3b8); font-size:11px; line-height:16px; text-align:center; white-space:nowrap; }
261253
+ /* Clusters are plain flow containers: Office buttons are flat and joined by position, not by a pill. */
261254
+ .cluster { display:inline-flex; align-items:center; gap:0; }
261255
+ .cluster[data-stack] { flex-direction:column; align-items:stretch; justify-content:flex-start; gap:0; }
261256
+ .cluster[data-stack] > button.b { height:22px; min-height:22px; }
261257
+ .home:not([data-grouped]) .cluster, .home:not([data-grouped]) .free { display:contents; }
261258
+ button.b { box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; min-width:28px; height:24px; padding:0 6px; border:0; border-radius:4px; background:transparent; color:var(--pptx-foreground,#f8fafc); font:inherit; font-size:12px; line-height:16px; gap:6px; white-space:nowrap; cursor:pointer; }
261259
+ button.b[hidden] { display:none !important; }
261260
+ button.b svg { width:16px; height:16px; flex:none; stroke-width:1.5; }
261261
+ button.b svg.chev { width:10px; height:10px; stroke-width:2.2; }
261262
+ .cluster[data-stack] > button.b, .cluster[data-stack] > .slot > button.b { justify-content:flex-start; }
261263
+ /* Large command: a 32px glyph over a one- or two-line caption, chevron beneath. */
261264
+ button.b[data-size=large] { flex-direction:column; justify-content:flex-start; min-width:48px; height:66px; padding:3px 6px; gap:2px; line-height:15px; }
261265
+ button.b[data-size=large] svg:not(.chev) { width:32px; height:32px; stroke-width:1.35; }
261266
+ button.b[data-size=large] svg.chev { width:9px; height:9px; margin-top:-1px; }
261267
+ /* The split halves (New Slide): glyph and caption press the main action, the strip below opens the menu. */
261268
+ .slot[data-pptx-chrome=split-button]:has([data-size=large]) { flex-direction:column; align-items:stretch; }
261269
+ .slot > button.b[data-pptx-chrome=split-main][data-size=large] { height:52px; min-width:56px; border-radius:4px 4px 0 0; }
261270
+ .slot > button.b[data-pptx-chrome=split-caret][data-size=caret] { min-width:0; height:14px; padding:0; border-radius:0 0 4px 4px; border-left:0; align-self:stretch; }
261271
+ .slot > button.b[data-pptx-chrome=split-caret][data-size=caret] svg { width:10px; height:10px; stroke-width:2.2; }
261272
+ .slot > button.b[data-pptx-chrome=split-caret]:not([data-size]) { min-width:16px; padding:0 2px; border-radius:0 4px 4px 0; align-self:stretch; height:auto; }
261273
+ .slot > button.b[data-pptx-chrome=split-caret]:not([data-size]) svg { width:10px; height:10px; }
261274
+ button.b:hover:not(:disabled) { background:var(--pptx-accent,#33334d); }
261275
+ button.b:active:not(:disabled) { background:color-mix(in srgb,var(--pptx-accent,#33334d) 70%,var(--pptx-primary,#6366f1)); }
261276
+ button.b[aria-pressed=true] { background:color-mix(in srgb,var(--pptx-primary,#6366f1) 22%,transparent); box-shadow:inset 0 0 0 1px var(--pptx-primary,#6366f1); }
261277
+ button.b:disabled { opacity:.4; cursor:default; }
261278
+ button.b:focus-visible { outline:2px solid var(--pptx-ring,#818cf8); outline-offset:-2px; }
261279
+ /* Row placement for the shared buttons that sit among native controls (see home-rows-css). */
261280
+ [data-ribbon-control="home.font.increaseFontSize"] { order:3; }
261281
+ [data-ribbon-control="home.font.decreaseFontSize"] { order:4; }
261282
+ [data-ribbon-control="home.font.clearFormatting"] { order:5; }
261283
+ [data-ribbon-control="home.font.bold"] { order:10; }
261284
+ [data-ribbon-control="home.font.italic"] { order:11; }
261285
+ [data-ribbon-control="home.font.underline"] { order:12; }
261286
+ [data-ribbon-control="home.font.shadow"] { order:13; }
261287
+ [data-ribbon-control="home.font.strikethrough"] { order:14; }
261288
+ [data-ribbon-control="home.paragraph.decreaseIndent"] { order:3; }
261289
+ [data-ribbon-control="home.paragraph.increaseIndent"] { order:4; }
261290
+ [data-ribbon-control="home.paragraph.alignLeft"] { order:10; }
261291
+ [data-ribbon-control="home.paragraph.alignCenter"] { order:11; }
261292
+ [data-ribbon-control="home.paragraph.alignRight"] { order:12; }
261293
+ [data-ribbon-control="home.paragraph.justify"] { order:13; }
261294
+ [data-ribbon-control="home.drawing.shapes"] { order:1; }
261295
+ [data-ribbon-control="home.drawing.arrange"] { order:2; }
261296
+ [data-ribbon-control="home.drawing.shapeFill"] { order:4; }
261297
+ [data-ribbon-control="home.drawing.shapeOutline"] { order:5; }
261077
261298
  input.num { box-sizing:border-box; width:52px; height:26px; padding:0 4px; border:1px solid var(--pptx-border,#475569); border-radius:4px; background:var(--pptx-muted,#2a2a3d); color:var(--pptx-foreground,#f8fafc); font:inherit; font-size:11px; text-align:center; }
261078
261299
  input.num:disabled { opacity:.4; }
261079
261300
  input.num:focus-visible { outline:2px solid var(--pptx-ring,#818cf8); outline-offset:-2px; }
@@ -261111,15 +261332,7 @@ input.num:focus-visible { outline:2px solid var(--pptx-ring,#818cf8); outline-of
261111
261332
  .popup .surface { position:absolute; left:0; top:0; transform-origin:top left; overflow:hidden; }
261112
261333
  .popup .frame { position:absolute; box-sizing:border-box; border:0 dashed color-mix(in srgb,var(--pptx-muted-foreground,#94a3b8) 70%,transparent); background:color-mix(in srgb,var(--pptx-background,#111827) 20%,transparent); }
261113
261334
  .popup .name { width:100%; overflow:hidden; text-align:center; text-overflow:ellipsis; white-space:nowrap; }
261114
- .caption { color:var(--pptx-muted-foreground,#94a3b8); font-size:9px; line-height:9px; text-align:center; }
261115
- .cluster { display:inline-flex; align-items:center; border-radius:3px; overflow:hidden; background:var(--pptx-muted,#2a2a3d); }
261116
- button.b { box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; min-width:32px; height:28px; padding:6px 10px; border:0; border-radius:0; background:transparent; color:var(--pptx-foreground,#f8fafc); font:inherit; font-size:12px; cursor:pointer; }
261117
261335
  button.b[hidden] { display:none !important; }
261118
- button.b svg { width:16px; height:16px; flex:none; }
261119
- button.b:hover:not(:disabled) { background:var(--pptx-accent,#33334d); }
261120
- button.b[aria-pressed=true] { background:var(--pptx-accent,#33334d); box-shadow:inset 0 0 0 1px var(--pptx-primary,#6366f1); }
261121
- button.b:disabled { opacity:.4; cursor:default; }
261122
- button.b:focus-visible { outline:2px solid var(--pptx-ring,#818cf8); outline-offset:-2px; }
261123
261336
  @media (pointer:coarse),(max-width:900px) {
261124
261337
  button.b { min-width:44px !important; min-height:44px !important; }
261125
261338
  input.num { min-height:44px; }
@@ -261183,7 +261396,10 @@ function addButtonContent(doc, button, control2) {
261183
261396
  bar.dataset.pptxChrome = "color-swatch";
261184
261397
  button.append(bar);
261185
261398
  }
261186
- if (control2.chevron) {
261399
+ if (control2.large) {
261400
+ button.dataset.size = "large";
261401
+ }
261402
+ if (control2.chevron || control2.large && control2.popup) {
261187
261403
  const chevron2 = createRibbonControlIcon(doc, "home.slides.caret");
261188
261404
  chevron2.classList.add("chev");
261189
261405
  button.append(chevron2);
@@ -261384,8 +261600,8 @@ function paintHomeLayouts(doc, popup, model, state, artwork, pick) {
261384
261600
  var SVG = "http://www.w3.org/2000/svg";
261385
261601
  function shapeGlyph(doc, icon2) {
261386
261602
  const [, spec5] = icon2.split(":");
261387
- const [glyph, glyphClass = ""] = (spec5 ?? "").split("|");
261388
- const path = INSERT_SHAPE_GLYPH_PATHS[glyph];
261603
+ const [glyph2, glyphClass = ""] = (spec5 ?? "").split("|");
261604
+ const path = INSERT_SHAPE_GLYPH_PATHS[glyph2];
261389
261605
  if (!path) {
261390
261606
  return void 0;
261391
261607
  }
@@ -261431,9 +261647,9 @@ function paintHomeMenu(doc, menu, items, state, value, pick) {
261431
261647
  for (const [name, attr22] of Object.entries(row.attrs ?? {})) {
261432
261648
  button.setAttribute(name, attr22);
261433
261649
  }
261434
- const glyph = row.icon?.startsWith("shape:") ? shapeGlyph(doc, row.icon) : void 0;
261435
- if (glyph) {
261436
- button.append(glyph);
261650
+ const glyph2 = row.icon?.startsWith("shape:") ? shapeGlyph(doc, row.icon) : void 0;
261651
+ if (glyph2) {
261652
+ button.append(glyph2);
261437
261653
  }
261438
261654
  const text3 = doc.createElement("span");
261439
261655
  text3.className = "label";
@@ -261605,6 +261821,9 @@ function buildPopupControl(ctx, control2) {
261605
261821
  main.dataset.pptxChrome ??= "split-main";
261606
261822
  caret = makeHomeButton(doc, control2, () => popup.toggle(), "caret");
261607
261823
  caret.dataset.pptxChrome = "split-caret";
261824
+ if (control2.large) {
261825
+ caret.dataset.size = "caret";
261826
+ }
261608
261827
  caret.append(createRibbonControlIcon(doc, "home.slides.caret"));
261609
261828
  for (const [name, value] of Object.entries(control2.caret.attrs ?? {})) {
261610
261829
  caret.setAttribute(name, value);
@@ -261912,6 +262131,9 @@ function createRibbonHomeView(doc, family2, request, popupChange, artwork) {
261912
262131
  const spec5 = RIBBON_HOME_FAMILIES[family2];
261913
262132
  const root = doc.createElement("div");
261914
262133
  root.className = "home";
262134
+ if (spec5.group) {
262135
+ root.dataset.grouped = "";
262136
+ }
261915
262137
  const buttons = /* @__PURE__ */ new Map();
261916
262138
  const anchors = /* @__PURE__ */ new Map();
261917
262139
  const built = [];
@@ -261920,6 +262142,9 @@ function createRibbonHomeView(doc, family2, request, popupChange, artwork) {
261920
262142
  const strip22 = doc.createElement("div");
261921
262143
  strip22.className = cluster.free ? "free" : "cluster";
261922
262144
  strip22.dataset.pptxChrome = cluster.chrome ?? "control-cluster";
262145
+ if (cluster.stack) {
262146
+ strip22.dataset.stack = "";
262147
+ }
261923
262148
  for (const control2 of cluster.controls) {
261924
262149
  const item4 = buildControl(ctx, control2);
261925
262150
  built.push(item4);
@@ -262040,33 +262265,41 @@ var RIBBON_INSERT_STYLES = `
262040
262265
  [hidden] { display:none !important; }
262041
262266
  :host[hidden] { display:none !important; }
262042
262267
  .stack { display:flex; flex-direction:column; justify-content:flex-start; gap:2px; }
262043
- .cluster { display:flex; flex-direction:column; gap:2px; align-items:stretch; }
262044
- .pick,.trigger,.list button { font:inherit; color:inherit; box-sizing:border-box; }
262045
- pptx-ui-select { max-width:112px; font-size:11px; }
262046
- .pick,.trigger { display:inline-flex; align-items:center; justify-content:flex-start; gap:6px; min-height:26px; min-width:88px; padding:0 4px; border:0; border-radius:4px; background:transparent; cursor:pointer; font-size:10px; line-height:11px; }
262047
- .pick:hover:not(:disabled),.trigger:hover:not(:disabled),.list button:hover { background:var(--pptx-accent,#33334d); }
262048
- .pick:disabled,.trigger:disabled,.list button:disabled { opacity:.35; cursor:not-allowed; }
262049
- .pick:focus-visible,.trigger:focus-visible,.list button:focus-visible { outline:2px solid var(--pptx-ring,#6366f1); outline-offset:2px; }
262268
+ .trigger,.list button { font:inherit; color:inherit; box-sizing:border-box; }
262269
+ .trigger { display:inline-flex; align-items:center; justify-content:flex-start; gap:6px; min-height:24px; min-width:0; padding:0 6px; border:0; border-radius:4px; background:transparent; cursor:pointer; font-size:12px; line-height:16px; }
262270
+ .trigger:hover:not(:disabled),.list button:hover { background:var(--pptx-accent,#33334d); }
262271
+ .trigger:active:not(:disabled) { background:color-mix(in srgb,var(--pptx-accent,#33334d) 70%,var(--pptx-primary,#6366f1)); }
262272
+ .trigger:disabled,.list button:disabled { opacity:.35; cursor:not-allowed; }
262273
+ .trigger:focus-visible,.list button:focus-visible { outline:2px solid var(--pptx-ring,#6366f1); outline-offset:2px; }
262050
262274
  svg { width:16px; height:16px; flex:none; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
262051
- .trigger svg:first-child,.pick svg { color:var(--pptx-primary,#6366f1); }
262275
+ .trigger svg:first-child { color:var(--pptx-primary,#6366f1); }
262052
262276
  .trigger svg:last-child { width:10px; height:10px; margin-inline-start:auto; }
262277
+ /* Office large command: a 32px glyph over the label with the chevron beneath. */
262278
+ .trigger.large { flex-direction:column; align-items:center; justify-content:flex-start; gap:2px; min-width:48px; max-width:80px; height:66px; padding:3px 4px; text-align:center; line-height:15px; }
262279
+ .trigger.large svg:first-child { width:32px; height:32px; stroke-width:1.4; }
262280
+ .trigger.large svg:last-child { width:8px; height:8px; margin:0; stroke-width:1.8; }
262053
262281
  .menu { position:relative; display:inline-flex; }
262054
262282
  .list { position:fixed; z-index:1200; display:flex; flex-direction:column; min-width:170px; max-width:calc(100vw - 16px); max-height:65vh; overflow:auto; padding:4px 0; background:var(--pptx-popover,#111827); border:1px solid var(--pptx-border,#374151); border-radius:6px; box-shadow:0 8px 24px #0005; }
262055
262283
  .list[hidden] { display:none; }
262056
262284
  .list button { display:flex; align-items:center; gap:8px; width:100%; min-height:28px; padding:4px 12px; border:0; background:transparent; font-size:12px; text-align:left; cursor:pointer; }
262057
262285
  .list svg { width:16px; height:16px; }
262286
+ .list.grid { display:grid; grid-template-columns:repeat(8,32px); gap:2px; min-width:0; padding:6px; }
262287
+ .list.grid button { width:32px; min-height:32px; height:32px; padding:0; justify-content:center; border-radius:4px; }
262288
+ .list.grid svg { width:18px; height:18px; }
262058
262289
  @media (max-width:767px) {
262059
262290
  :host { flex-wrap:wrap; max-width:100%; }
262060
262291
  }
262061
262292
  @media (pointer:coarse),(max-width:900px) {
262062
- .pick,.list button { min-height:44px; }
262293
+ .list button { min-height:44px; }
262294
+ .list.grid { grid-template-columns:repeat(6,44px); }
262295
+ .list.grid button { width:44px; height:44px; }
262063
262296
  .trigger { min-height:44px; min-width:44px; }
262064
262297
  }
262065
262298
  @media (forced-colors:active) {
262066
262299
  .list { border-color:ButtonText; }
262067
262300
  .trigger svg:first-child { color:ButtonText; }
262068
- .pick:focus-visible,.trigger:focus-visible,.list button:focus-visible { outline-color:Highlight; }
262069
- .pick:disabled,.trigger:disabled { color:GrayText; opacity:1; }
262301
+ .trigger:focus-visible,.list button:focus-visible { outline-color:Highlight; }
262302
+ .trigger:disabled { color:GrayText; opacity:1; }
262070
262303
  }
262071
262304
  `;
262072
262305
  function attachRibbonInsertStyles(doc) {
@@ -262090,20 +262323,21 @@ function insertSvg(doc, path, viewBox = "0 0 20 20") {
262090
262323
  function insertIcon(doc, name) {
262091
262324
  return insertSvg(doc, RIBBON_ICON_PATHS[name] ?? "");
262092
262325
  }
262093
- function createInsertMenu(doc, control2, icon2, pick) {
262326
+ function createInsertMenu(doc, control2, icon2, pick, options = {}) {
262094
262327
  const el = doc.createElement("div");
262095
262328
  el.className = "menu";
262096
262329
  el.dataset.ribbonControl = control2;
262097
262330
  const trigger = doc.createElement("button");
262098
262331
  trigger.type = "button";
262099
- trigger.className = "trigger";
262332
+ trigger.className = options.large ? "trigger large" : "trigger";
262100
262333
  trigger.dataset.pptxCompact = "";
262101
262334
  trigger.setAttribute("aria-haspopup", "menu");
262102
262335
  trigger.setAttribute("aria-expanded", "false");
262103
262336
  const text3 = doc.createElement("span");
262337
+ text3.className = "label";
262104
262338
  trigger.append(insertIcon(doc, icon2), text3, insertIcon(doc, "chevronDown"));
262105
262339
  const list2 = doc.createElement("div");
262106
- list2.className = "list";
262340
+ list2.className = options.grid ? "list grid" : "list";
262107
262341
  list2.setAttribute("role", "menu");
262108
262342
  list2.hidden = true;
262109
262343
  el.append(trigger, list2);
@@ -262179,9 +262413,18 @@ function createInsertMenu(doc, control2, icon2, pick) {
262179
262413
  button.dataset.pptxCompact = "";
262180
262414
  button.dataset.insertItem = item4.id;
262181
262415
  if (item4.glyph) {
262182
- button.append(insertSvg(doc, item4.glyph, "0 0 24 24"));
262416
+ const glyph2 = insertSvg(doc, item4.glyph, item4.viewBox ?? "0 0 24 24");
262417
+ if (item4.transform && item4.transform !== "none") {
262418
+ glyph2.style.transform = item4.transform;
262419
+ }
262420
+ button.append(glyph2);
262421
+ }
262422
+ if (options.grid) {
262423
+ button.title = item4.label;
262424
+ button.setAttribute("aria-label", item4.label);
262425
+ } else {
262426
+ button.append(doc.createTextNode(item4.label));
262183
262427
  }
262184
- button.append(doc.createTextNode(item4.label));
262185
262428
  button.addEventListener("click", () => {
262186
262429
  close();
262187
262430
  trigger.focus();
@@ -262194,59 +262437,6 @@ function createInsertMenu(doc, control2, icon2, pick) {
262194
262437
  }
262195
262438
  };
262196
262439
  }
262197
- function createInsertCluster(doc, control2, pickType, insert) {
262198
- const el = doc.createElement("div");
262199
- el.className = "cluster";
262200
- el.dataset.ribbonControl = control2;
262201
- const select2 = doc.createElement("pptx-ui-select");
262202
- const button = doc.createElement("button");
262203
- button.type = "button";
262204
- button.className = "pick";
262205
- button.dataset.pptxCompact = "";
262206
- const text3 = doc.createElement("span");
262207
- let glyphKey = "";
262208
- select2.addEventListener("change", () => pickType(select2.value));
262209
- button.addEventListener("click", insert);
262210
- button.addEventListener("keydown", (event) => {
262211
- if (event.key === " " || event.key === "Enter") {
262212
- event.stopPropagation();
262213
- }
262214
- });
262215
- el.append(select2, button);
262216
- return {
262217
- el,
262218
- select: select2,
262219
- button,
262220
- sync({ choices: choices2, value, selectLabel, buttonLabel, buttonTitle, disabled, glyph }) {
262221
- const key2 = choices2.map((item4) => `${item4.value}:${item4.label}`).join("|");
262222
- if (select2.dataset.key !== key2) {
262223
- select2.dataset.key = key2;
262224
- select2.replaceChildren(
262225
- ...choices2.map((item4) => {
262226
- const option = doc.createElement("option");
262227
- option.value = item4.value;
262228
- option.textContent = item4.label;
262229
- return option;
262230
- })
262231
- );
262232
- }
262233
- select2.value = value;
262234
- select2.disabled = disabled;
262235
- select2.setAttribute("aria-label", selectLabel);
262236
- select2.title = selectLabel;
262237
- text3.textContent = buttonLabel;
262238
- button.title = buttonTitle;
262239
- button.disabled = disabled;
262240
- const nextGlyph = `${glyph.path}|${glyph.viewBox}|${glyph.transform}`;
262241
- if (nextGlyph !== glyphKey) {
262242
- glyphKey = nextGlyph;
262243
- const svg = insertSvg(doc, glyph.path, glyph.viewBox);
262244
- svg.style.transform = glyph.transform;
262245
- button.replaceChildren(svg, text3);
262246
- }
262247
- }
262248
- };
262249
- }
262250
262440
  var FREEFORM_ICONS = { freeformShape: "penTool", curve: "spline" };
262251
262441
  var FREEFORM_FALLBACKS = {
262252
262442
  freeformShape: "Freeform: Shape",
@@ -262286,25 +262476,29 @@ function createRibbonInsertView(doc, request) {
262286
262476
  spec: spec5,
262287
262477
  el: command(
262288
262478
  spec5.icon,
262289
- true,
262479
+ false,
262290
262480
  () => request({ kind: "command", value: spec5.command }),
262291
262481
  spec5.control
262292
262482
  )
262293
262483
  }));
262294
262484
  const byCommand = (name) => commands.find(({ spec: spec5 }) => spec5.command === name).el;
262295
- let shapeType = "";
262296
- let chartKind = "";
262297
- const shapes = createInsertCluster(
262485
+ const stageThenInsert = (stage, insert) => {
262486
+ request(stage);
262487
+ setTimeout(() => request(insert), 50);
262488
+ };
262489
+ const shapes = createInsertMenu(
262298
262490
  doc,
262299
262491
  "insert.illustrations.shapes",
262300
- (value) => request({ kind: "shapeType", value }),
262301
- () => request({ kind: "shape", value: shapeType })
262492
+ "shapes",
262493
+ (value) => stageThenInsert({ kind: "shapeType", value }, { kind: "shape", value }),
262494
+ { large: true, grid: true }
262302
262495
  );
262303
- const charts = createInsertCluster(
262496
+ const charts = createInsertMenu(
262304
262497
  doc,
262305
262498
  "insert.illustrations.chart",
262306
- (value) => request({ kind: "chartType", value }),
262307
- () => request({ kind: "chart", value: chartKind })
262499
+ "chart",
262500
+ (value) => stageThenInsert({ kind: "chartType", value }, { kind: "chart", value }),
262501
+ { large: true }
262308
262502
  );
262309
262503
  let armed = null;
262310
262504
  const freeform = FREEFORM_TOOL_IDS.map((tool) => {
@@ -262321,27 +262515,27 @@ function createRibbonInsertView(doc, request) {
262321
262515
  doc,
262322
262516
  "insert.links.action",
262323
262517
  "action",
262324
- (value) => request({ kind: "actionButton", value })
262518
+ (value) => request({ kind: "actionButton", value }),
262519
+ { large: true }
262325
262520
  );
262326
262521
  const fields = createInsertMenu(
262327
262522
  doc,
262328
262523
  "insert.text.field",
262329
262524
  "field",
262330
- (value) => request({ kind: "field", value })
262525
+ (value) => request({ kind: "field", value }),
262526
+ { large: true }
262331
262527
  );
262332
262528
  const root = [
262333
262529
  group2("insert.tables", byCommand("table")),
262334
262530
  group2("insert.images", byCommand("image")),
262335
- group2("insert.illustrations", shapes.el, freeformStack, charts.el, byCommand("smartArt")),
262336
- group2("insert.links", stack(byCommand("link"), actions.el)),
262337
- group2("insert.text", stack(byCommand("textBox"), fields.el, byCommand("headerFooter"))),
262531
+ group2("insert.illustrations", shapes.el, freeformStack, byCommand("smartArt"), charts.el),
262532
+ group2("insert.links", byCommand("link"), actions.el),
262533
+ group2("insert.text", byCommand("textBox"), byCommand("headerFooter"), fields.el),
262338
262534
  group2("insert.symbols", byCommand("equation")),
262339
262535
  group2("insert.media", byCommand("media"))
262340
262536
  ];
262341
262537
  const sync = (state) => {
262342
262538
  const text3 = (label) => insertLabel(state, label);
262343
- shapeType = state.shapeType;
262344
- chartKind = state.chartKind;
262345
262539
  armed = state.activeFreeformTool ?? null;
262346
262540
  const disabled = !state.editable;
262347
262541
  for (const [id, el] of groups) {
@@ -262353,36 +262547,34 @@ function createRibbonInsertView(doc, request) {
262353
262547
  el.toggleAttribute("disabled", spec5.command === "link" ? !state.hasSelection : disabled);
262354
262548
  }
262355
262549
  byCommand("headerFooter").toggleAttribute("hidden", state.headerFooterAvailable === false);
262356
- const preset22 = SHAPE_PRESET_DEFS.find((item4) => item4.type === state.shapeType) ?? SHAPE_PRESET_DEFS[0];
262357
- shapes.sync({
262358
- choices: SHAPE_PRESET_DEFS.map((item4) => ({
262359
- value: item4.type,
262360
- label: text3([item4.i18nKey, item4.label])
262550
+ const shapeTitle = text3(["pptx.insert.addShape", "Add shape"]);
262551
+ shapes.sync(
262552
+ text3(["pptx.drawing.shapes", "Shapes"]),
262553
+ shapeTitle,
262554
+ SHAPE_PRESET_DEFS.map((item4) => ({
262555
+ id: item4.type,
262556
+ label: text3([item4.i18nKey, item4.label]),
262557
+ glyph: INSERT_SHAPE_GLYPH_PATHS[item4.glyph],
262558
+ viewBox: "0 0 16 16",
262559
+ transform: insertGlyphTransform(item4.glyphClass)
262361
262560
  })),
262362
- value: preset22.type,
262363
- selectLabel: text3(["pptx.insert.shapeType", "Shape type"]),
262364
- buttonLabel: text3(["pptx.insert.shape", "Shape"]),
262365
- buttonTitle: text3(["pptx.insert.addShape", "Add shape"]),
262366
262561
  disabled,
262367
- glyph: {
262368
- path: INSERT_SHAPE_GLYPH_PATHS[preset22.glyph],
262369
- viewBox: "0 0 16 16",
262370
- transform: insertGlyphTransform(preset22.glyphClass)
262371
- }
262372
- });
262562
+ text3(["pptx.insert.shapeType", "Shape type"])
262563
+ );
262373
262564
  charts.el.hidden = state.chartAvailable === false;
262374
- charts.sync({
262375
- choices: INSERT_CHART_TYPES.map((item4) => ({
262376
- value: item4.id,
262377
- label: text3([item4.labelKey, item4.label])
262565
+ const chartTitle = text3(["pptx.ribbon.insertChart", "Insert chart"]);
262566
+ charts.sync(
262567
+ text3(["pptx.ribbon.chart", "Chart"]),
262568
+ chartTitle,
262569
+ INSERT_CHART_TYPES.map((item4) => ({
262570
+ id: item4.id,
262571
+ label: text3([item4.labelKey, item4.label]),
262572
+ glyph: RIBBON_INSERT_ICON_PATHS.chart,
262573
+ viewBox: "0 0 20 20"
262378
262574
  })),
262379
- value: state.chartKind,
262380
- selectLabel: text3(["pptx.ribbon.chartType", "Chart type"]),
262381
- buttonLabel: text3(["pptx.ribbon.chart", "Chart"]),
262382
- buttonTitle: text3(["pptx.ribbon.insertChart", "Insert chart"]),
262383
262575
  disabled,
262384
- glyph: { path: RIBBON_INSERT_ICON_PATHS.chart, viewBox: "0 0 20 20", transform: "none" }
262385
- });
262576
+ text3(["pptx.ribbon.chartType", "Chart type"])
262577
+ );
262386
262578
  const visible = state.freeformTools ?? [];
262387
262579
  freeformStack.hidden = visible.length === 0;
262388
262580
  for (const { tool, el } of freeform) {
@@ -262416,7 +262608,7 @@ function createRibbonInsertView(doc, request) {
262416
262608
  fieldTitle
262417
262609
  );
262418
262610
  };
262419
- return { root, sync, menus: [actions, fields] };
262611
+ return { root, sync, menus: [shapes, charts, actions, fields] };
262420
262612
  }
262421
262613
  function definePptxRibbonInsert(registry) {
262422
262614
  if (registry.get("pptx-ui-ribbon-insert")) {
@@ -262553,14 +262745,14 @@ function createRibbonSectionView(root) {
262553
262745
  for (const command of group2.commands) {
262554
262746
  let parent = node.el;
262555
262747
  if (command.column !== void 0) {
262556
- let column = node.columns.get(command.column);
262557
- if (!column) {
262558
- column = root.ownerDocument.createElement("div");
262559
- Object.assign(column.style, { display: "flex", flexDirection: "column", gap: "2px" });
262560
- node.columns.set(command.column, column);
262561
- node.el.append(column);
262748
+ let column2 = node.columns.get(command.column);
262749
+ if (!column2) {
262750
+ column2 = root.ownerDocument.createElement("div");
262751
+ Object.assign(column2.style, { display: "flex", flexDirection: "column", gap: "2px" });
262752
+ node.columns.set(command.column, column2);
262753
+ node.el.append(column2);
262562
262754
  }
262563
- parent = column;
262755
+ parent = column2;
262564
262756
  }
262565
262757
  let el = commands.get(command.id);
262566
262758
  if (!el) {
@@ -264139,8 +264331,8 @@ function definePptxSlideShowOptions(registry) {
264139
264331
  const root = this.attachShadow({ mode: "open" });
264140
264332
  attachControlStyles(root, SLIDE_SHOW_OPTIONS_STYLES);
264141
264333
  const columns = [document.createElement("div"), document.createElement("div")];
264142
- for (const column of columns) {
264143
- column.className = "column";
264334
+ for (const column2 of columns) {
264335
+ column2.className = "column";
264144
264336
  }
264145
264337
  SLIDE_SHOW_OPTIONS.forEach((option, index) => {
264146
264338
  const label = document.createElement("label");
@@ -265575,6 +265767,294 @@ function definePptxTitleBar(registry) {
265575
265767
  }
265576
265768
  registry.define("pptx-ui-title-bar", TitleBar);
265577
265769
  }
265770
+ var LAUNCHER_CHROME = "group-launcher";
265771
+ var SELECTOR = `[data-pptx-chrome="${LAUNCHER_CHROME}"]`;
265772
+ var GLYPH = "M2 2h4M2 2v4M10 10 4 4M10 10H7M10 10V7";
265773
+ function glyph(doc) {
265774
+ const svg = doc.createElementNS("http://www.w3.org/2000/svg", "svg");
265775
+ svg.setAttribute("viewBox", "0 0 12 12");
265776
+ svg.setAttribute("aria-hidden", "true");
265777
+ const path = doc.createElementNS(svg.namespaceURI, "path");
265778
+ path.setAttribute("d", GLYPH);
265779
+ svg.append(path);
265780
+ return svg;
265781
+ }
265782
+ function syncLaunchers(content, launchers) {
265783
+ for (const group2 of content.querySelectorAll("[data-ribbon-group]")) {
265784
+ const launcher = launchers[group2.dataset.ribbonGroup ?? ""];
265785
+ if (!launcher || group2.parentElement?.closest("[data-ribbon-group]")) {
265786
+ continue;
265787
+ }
265788
+ const label = launcher.label();
265789
+ if (group2.localName === "pptx-ui-ribbon-group") {
265790
+ group2.setAttribute("launcher", "");
265791
+ group2.setAttribute("launcher-label", label);
265792
+ continue;
265793
+ }
265794
+ let button = group2.querySelector(`:scope > ${SELECTOR}`);
265795
+ if (!button) {
265796
+ button = group2.ownerDocument.createElement("button");
265797
+ button.type = "button";
265798
+ button.dataset.pptxChrome = LAUNCHER_CHROME;
265799
+ button.append(glyph(group2.ownerDocument));
265800
+ group2.append(button);
265801
+ }
265802
+ button.title = label;
265803
+ button.setAttribute("aria-label", label);
265804
+ }
265805
+ }
265806
+ function listenForLaunchers(content, launchers) {
265807
+ const click = (event) => {
265808
+ const button = event.target?.closest?.(SELECTOR);
265809
+ const id = button?.closest("[data-ribbon-group]")?.dataset.ribbonGroup;
265810
+ if (id) {
265811
+ launchers[id]?.run();
265812
+ }
265813
+ };
265814
+ const shared = (event) => {
265815
+ const id = event.detail?.id;
265816
+ if (id) {
265817
+ launchers[id]?.run();
265818
+ }
265819
+ };
265820
+ content.addEventListener("click", click);
265821
+ content.addEventListener("launcher-request", shared);
265822
+ return () => {
265823
+ content.removeEventListener("click", click);
265824
+ content.removeEventListener("launcher-request", shared);
265825
+ };
265826
+ }
265827
+ var HOME_LAUNCHER_GROUPS = ["home.font", "home.paragraph", "home.drawing"];
265828
+ function homeLaunchers(label, run) {
265829
+ return Object.fromEntries(HOME_LAUNCHER_GROUPS.map((id) => [id, { label, run }]));
265830
+ }
265831
+ var COLLAPSE_FACE = "ribbon-collapse";
265832
+ var FACE_SELECTOR = `[data-pptx-chrome="${COLLAPSE_FACE}"]`;
265833
+ var DESKTOP_MIN_WIDTH = 768;
265834
+ var CONTROL_FACE = {
265835
+ "home.clipboard": "home.clipboard.paste",
265836
+ "home.slides": "home.slides.newSlide",
265837
+ "home.font": "home.font.bold",
265838
+ "home.paragraph": "home.paragraph.alignLeft",
265839
+ "home.editing": "home.editing.find",
265840
+ "home.drawing": "home.drawing.shapes",
265841
+ "home.arrange": "home.drawing.arrange"
265842
+ };
265843
+ var PATH_FACE = {
265844
+ "insert.tables": "table",
265845
+ "insert.images": "image",
265846
+ "insert.illustrations": "shapes",
265847
+ "insert.links": "link",
265848
+ "insert.text": "textBox",
265849
+ "insert.symbols": "equation",
265850
+ "insert.media": "video",
265851
+ "draw.tools": "pencil",
265852
+ "design.themes": "palette",
265853
+ "design.variants": "palette",
265854
+ "design.customize": "paint"
265855
+ };
265856
+ var isGroup2 = (el) => el instanceof HTMLElement;
265857
+ var COLLAPSING_GROUPS = /^(home|insert|draw|design)\./u;
265858
+ function groupsOf(content) {
265859
+ return [...content.querySelectorAll("[data-ribbon-group]")].filter(
265860
+ (el) => isGroup2(el) && COLLAPSING_GROUPS.test(el.dataset.ribbonGroup ?? "") && el.getBoundingClientRect().width > 0 && el.parentElement?.closest("[data-ribbon-group]") === null
265861
+ );
265862
+ }
265863
+ function captionOf(group2) {
265864
+ return (group2.getAttribute("label") ?? group2.querySelector(':scope > [data-pptx-chrome="ribbon-group-label"]')?.textContent ?? group2.getAttribute("aria-label") ?? "").trim();
265865
+ }
265866
+ function faceIcon(doc, id) {
265867
+ const control2 = CONTROL_FACE[id];
265868
+ if (control2 && RIBBON_CONTROL_ICONS[control2]) {
265869
+ return createRibbonControlIcon(doc, control2);
265870
+ }
265871
+ const svg = doc.createElementNS("http://www.w3.org/2000/svg", "svg");
265872
+ svg.setAttribute("viewBox", "0 0 20 20");
265873
+ svg.setAttribute("fill", "none");
265874
+ svg.setAttribute("stroke", "currentColor");
265875
+ const path = doc.createElementNS(svg.namespaceURI, "path");
265876
+ path.setAttribute("d", RIBBON_ICON_PATHS[PATH_FACE[id] ?? "layers"] ?? "");
265877
+ svg.append(path);
265878
+ return svg;
265879
+ }
265880
+ function placeCollapsedGroup(group2, face) {
265881
+ const rect3 = face.getBoundingClientRect();
265882
+ const width = group2.ownerDocument.defaultView?.innerWidth ?? 1024;
265883
+ group2.style.setProperty("--pptx-collapse-y", `${Math.round(rect3.bottom + 2)}px`);
265884
+ group2.style.setProperty(
265885
+ "--pptx-collapse-x",
265886
+ `${Math.round(Math.max(4, Math.min(rect3.left, width - 360)))}px`
265887
+ );
265888
+ }
265889
+ function ensureFace(group2) {
265890
+ const id = group2.dataset.ribbonGroup ?? "";
265891
+ if (group2.localName === "pptx-ui-ribbon-group") {
265892
+ if (!group2.hasAttribute("icon")) {
265893
+ group2.setAttribute("icon", PATH_FACE[id] ?? "layers");
265894
+ }
265895
+ return;
265896
+ }
265897
+ const caption = captionOf(group2);
265898
+ let face = group2.querySelector(`:scope > ${FACE_SELECTOR}`);
265899
+ if (!face) {
265900
+ const doc = group2.ownerDocument;
265901
+ face = doc.createElement("button");
265902
+ face.setAttribute("type", "button");
265903
+ face.dataset.pptxChrome = COLLAPSE_FACE;
265904
+ face.setAttribute("aria-haspopup", "true");
265905
+ const label = doc.createElement("span");
265906
+ label.className = "label";
265907
+ const chevron2 = doc.createElementNS("http://www.w3.org/2000/svg", "svg");
265908
+ chevron2.setAttribute("viewBox", "0 0 10 10");
265909
+ chevron2.setAttribute("class", "chev");
265910
+ chevron2.setAttribute("aria-hidden", "true");
265911
+ const path = doc.createElementNS(chevron2.namespaceURI, "path");
265912
+ path.setAttribute("d", "m1.5 3.5 3.5 3.5 3.5-3.5");
265913
+ chevron2.append(path);
265914
+ face.append(faceIcon(doc, id), label, chevron2);
265915
+ group2.prepend(face);
265916
+ }
265917
+ face.querySelector(".label").textContent = caption;
265918
+ face.setAttribute("aria-label", caption);
265919
+ face.title = caption;
265920
+ face.setAttribute("aria-expanded", String(group2.hasAttribute("data-open")));
265921
+ }
265922
+ function closeAll(content) {
265923
+ for (const open of content.querySelectorAll("[data-ribbon-group][data-open]")) {
265924
+ open.removeAttribute("data-open");
265925
+ open.querySelector(`:scope > ${FACE_SELECTOR}`)?.setAttribute("aria-expanded", "false");
265926
+ }
265927
+ }
265928
+ function reflowRibbon(content) {
265929
+ const doc = content.ownerDocument;
265930
+ closeAll(content);
265931
+ for (const collapsed2 of content.querySelectorAll("[data-ribbon-group][data-collapsed]")) {
265932
+ collapsed2.removeAttribute("data-collapsed");
265933
+ }
265934
+ if ((doc.defaultView?.innerWidth ?? DESKTOP_MIN_WIDTH) < DESKTOP_MIN_WIDTH) {
265935
+ return [];
265936
+ }
265937
+ const overflows = () => content.scrollWidth - content.clientWidth > 1;
265938
+ const collapsed = [];
265939
+ if (!overflows()) {
265940
+ return collapsed;
265941
+ }
265942
+ for (const group2 of groupsOf(content).reverse()) {
265943
+ ensureFace(group2);
265944
+ group2.setAttribute("data-collapsed", "");
265945
+ collapsed.push(group2.dataset.ribbonGroup ?? "");
265946
+ if (!overflows()) {
265947
+ break;
265948
+ }
265949
+ }
265950
+ return collapsed;
265951
+ }
265952
+ function attachRibbonOverflow(content, options = {}) {
265953
+ const doc = content.ownerDocument;
265954
+ const view = doc.defaultView;
265955
+ let frame2 = 0;
265956
+ let forced = false;
265957
+ let lastWidth = -1;
265958
+ const schedule2 = (force = false) => {
265959
+ forced ||= force;
265960
+ if (frame2 || !view) {
265961
+ return;
265962
+ }
265963
+ frame2 = view.requestAnimationFrame(() => {
265964
+ frame2 = 0;
265965
+ const rebuild = forced;
265966
+ forced = false;
265967
+ if (!rebuild && lastWidth === content.clientWidth && content.querySelector("[data-ribbon-group][data-open]")) {
265968
+ return;
265969
+ }
265970
+ observer?.disconnect();
265971
+ lastWidth = content.clientWidth;
265972
+ reflowRibbon(content);
265973
+ if (options.launchers) {
265974
+ syncLaunchers(content, options.launchers);
265975
+ }
265976
+ observer?.observe(content, { childList: true, subtree: true });
265977
+ });
265978
+ };
265979
+ const touchesGroup = (record2) => [...record2.addedNodes, ...record2.removedNodes].some(
265980
+ (node) => node instanceof Element && (node.matches("[data-ribbon-group]") || node.querySelector("[data-ribbon-group]") !== null)
265981
+ );
265982
+ const observer = typeof MutationObserver === "undefined" ? void 0 : new MutationObserver((records) => schedule2(records.some(touchesGroup)));
265983
+ const resize = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(() => schedule2());
265984
+ observer?.observe(content, { childList: true, subtree: true });
265985
+ resize?.observe(content);
265986
+ const onWindowResize = () => schedule2();
265987
+ view?.addEventListener("resize", onWindowResize);
265988
+ const toggleGroup = (group2, face) => {
265989
+ if (!face || !content.contains(group2) || !group2.hasAttribute("data-collapsed")) {
265990
+ return;
265991
+ }
265992
+ const open = !group2.hasAttribute("data-open");
265993
+ closeAll(content);
265994
+ if (open) {
265995
+ group2.setAttribute("data-open", "");
265996
+ placeCollapsedGroup(group2, face);
265997
+ face.setAttribute("aria-expanded", "true");
265998
+ }
265999
+ };
266000
+ const toggle2 = (event) => {
266001
+ const face = event.target?.closest?.(FACE_SELECTOR) ?? null;
266002
+ const group2 = face?.closest("[data-ribbon-group]");
266003
+ if (face && group2) {
266004
+ toggleGroup(group2, face);
266005
+ }
266006
+ };
266007
+ const toggleShared = (event) => {
266008
+ const group2 = event.target?.closest?.("[data-ribbon-group]");
266009
+ if (group2) {
266010
+ toggleGroup(group2, group2.shadowRoot?.querySelector(".face") ?? null);
266011
+ }
266012
+ };
266013
+ const outside = (event) => {
266014
+ const open = content.querySelector("[data-ribbon-group][data-open]");
266015
+ if (open && !event.composedPath().includes(open)) {
266016
+ closeAll(content);
266017
+ }
266018
+ };
266019
+ const escape = (event) => {
266020
+ const open = content.querySelector("[data-ribbon-group][data-open]");
266021
+ if (event.key === "Escape" && open) {
266022
+ event.stopPropagation();
266023
+ closeAll(content);
266024
+ (open.querySelector(FACE_SELECTOR) ?? open).focus();
266025
+ }
266026
+ };
266027
+ const afterCommand = (event) => {
266028
+ const open = content.querySelector("[data-ribbon-group][data-open]");
266029
+ const button = event.composedPath()[0]?.closest?.("button");
266030
+ if (open?.contains(button ?? null) && button && !button.matches(`${FACE_SELECTOR}, [aria-haspopup], [aria-expanded]`)) {
266031
+ closeAll(content);
266032
+ }
266033
+ };
266034
+ content.addEventListener("click", toggle2);
266035
+ content.addEventListener("ribbon-collapse-toggle", toggleShared);
266036
+ content.addEventListener("click", afterCommand);
266037
+ content.addEventListener("keydown", escape);
266038
+ doc.addEventListener("pointerdown", outside, true);
266039
+ const stopLaunchers = options.launchers ? listenForLaunchers(content, options.launchers) : void 0;
266040
+ schedule2(true);
266041
+ return () => {
266042
+ stopLaunchers?.();
266043
+ observer?.disconnect();
266044
+ resize?.disconnect();
266045
+ view?.removeEventListener("resize", onWindowResize);
266046
+ view?.cancelAnimationFrame(frame2);
266047
+ content.removeEventListener("click", toggle2);
266048
+ content.removeEventListener("ribbon-collapse-toggle", toggleShared);
266049
+ content.removeEventListener("click", afterCommand);
266050
+ content.removeEventListener("keydown", escape);
266051
+ doc.removeEventListener("pointerdown", outside, true);
266052
+ closeAll(content);
266053
+ for (const collapsed of content.querySelectorAll("[data-ribbon-group][data-collapsed]")) {
266054
+ collapsed.removeAttribute("data-collapsed");
266055
+ }
266056
+ };
266057
+ }
265578
266058
  function contextMenuViewItems(entries2, t, isAvailable2 = () => true) {
265579
266059
  return entries2.map((entry5) => ({
265580
266060
  id: entry5.id,
@@ -269218,6 +269698,7 @@ exports.attachEditorImagePaste = attachEditorImagePaste;
269218
269698
  exports.attachInlineListController = attachInlineListController;
269219
269699
  exports.attachOverlayKeyboard = attachOverlayKeyboard;
269220
269700
  exports.attachPresentationVisibilityPause = attachPresentationVisibilityPause;
269701
+ exports.attachRibbonOverflow = attachRibbonOverflow;
269221
269702
  exports.attachRotateHandlePlacement = attachRotateHandlePlacement;
269222
269703
  exports.authorConnectorBetweenSites = authorConnectorBetweenSites;
269223
269704
  exports.authoredLetterSpacingPx = authoredLetterSpacingPx;
@@ -269651,6 +270132,7 @@ exports.hideChartSeries = hideChartSeries;
269651
270132
  exports.hollowTextFillStyle = hollowTextFillStyle;
269652
270133
  exports.homeGalleryApply = homeGalleryApply;
269653
270134
  exports.homeGalleryControls = homeGalleryControls;
270135
+ exports.homeLaunchers = homeLaunchers;
269654
270136
  exports.imageResetPatch = imageResetPatch;
269655
270137
  exports.imageResetState = imageResetState;
269656
270138
  exports.inlineElementPointerEvents = inlineElementPointerEvents;