pptx-viewer-core 1.6.2 → 1.6.4

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.
@@ -1401,24 +1401,24 @@ function drawTextSegments(ctx, segments, bodyStyle, w, h, scaleFactor = 1) {
1401
1401
  } else {
1402
1402
  y = padT;
1403
1403
  }
1404
- for (const line of lines) {
1405
- y += line.height;
1406
- const hAlign = line.align ?? bodyStyle?.align ?? "left";
1404
+ for (const line2 of lines) {
1405
+ y += line2.height;
1406
+ const hAlign = line2.align ?? bodyStyle?.align ?? "left";
1407
1407
  let x;
1408
1408
  if (hAlign === "center") {
1409
- x = padL + (maxWidth - line.width) / 2;
1409
+ x = padL + (maxWidth - line2.width) / 2;
1410
1410
  } else if (hAlign === "right") {
1411
- x = padL + maxWidth - line.width;
1411
+ x = padL + maxWidth - line2.width;
1412
1412
  } else {
1413
1413
  x = padL;
1414
1414
  }
1415
- for (const run of line.runs) {
1415
+ for (const run of line2.runs) {
1416
1416
  ctx.font = buildFont(run.style, scaleFactor);
1417
1417
  ctx.fillStyle = run.style.color ?? "#000000";
1418
1418
  ctx.fillText(run.text, x, y);
1419
1419
  x += run.measuredWidth;
1420
1420
  }
1421
- y += line.height * 0.3;
1421
+ y += line2.height * 0.3;
1422
1422
  }
1423
1423
  }
1424
1424
  function splitIntoParagraphs(segments) {
@@ -1960,7 +1960,7 @@ var SlideMetadataRenderer = class {
1960
1960
  if (!notesText) {
1961
1961
  return "";
1962
1962
  }
1963
- const quoted = notesText.split(/\r?\n/).map((line) => `> ${line}`).join("\n");
1963
+ const quoted = notesText.split(/\r?\n/).map((line2) => `> ${line2}`).join("\n");
1964
1964
  return `> **Speaker Notes**
1965
1965
  ${quoted}`;
1966
1966
  }
@@ -2412,7 +2412,2256 @@ function isCodeLikeFont(segment) {
2412
2412
  return MONOSPACE_PATTERNS.some((pattern) => family.includes(pattern));
2413
2413
  }
2414
2414
 
2415
+ // src/core/geometry/custom-geometry-command-order.ts
2416
+ var ORDER_SUFFIX = "#pptx-order-";
2417
+ function stripXmlOrderSuffix(tagName) {
2418
+ const index = tagName.indexOf(ORDER_SUFFIX);
2419
+ return index >= 0 ? tagName.slice(0, index) : tagName;
2420
+ }
2421
+
2422
+ // src/core/geometry/preset-shape-definitions-action-buttons.ts
2423
+ function gd(name, formula) {
2424
+ const parts = formula.trim().split(/\s+/);
2425
+ return { name, formula, args: parts.slice(1) };
2426
+ }
2427
+ function buildActionButton(name) {
2428
+ return {
2429
+ name,
2430
+ avLst: { adj: 6250 },
2431
+ gdLst: [
2432
+ gd("a", "pin 0 adj 50000"),
2433
+ gd("x1", "*/ ss a 100000"),
2434
+ gd("x2", "+- r 0 x1"),
2435
+ gd("y2", "+- b 0 x1")
2436
+ ],
2437
+ rect: { l: "x1", t: "x1", r: "x2", b: "y2" },
2438
+ pathLst: [
2439
+ // Outer rectangle (the button face).
2440
+ {
2441
+ fill: "norm",
2442
+ extrusionOk: false,
2443
+ commands: [
2444
+ { kind: "moveTo", x: "l", y: "t" },
2445
+ { kind: "lnTo", x: "r", y: "t" },
2446
+ { kind: "lnTo", x: "r", y: "b" },
2447
+ { kind: "lnTo", x: "l", y: "b" },
2448
+ { kind: "close" }
2449
+ ]
2450
+ },
2451
+ // Inner inset rectangle (the bevel "well") — drawn darkened so the
2452
+ // renderer can shade it like the spec's recessed face.
2453
+ {
2454
+ fill: "darken",
2455
+ stroke: false,
2456
+ extrusionOk: false,
2457
+ commands: [
2458
+ { kind: "moveTo", x: "x1", y: "x1" },
2459
+ { kind: "lnTo", x: "x2", y: "x1" },
2460
+ { kind: "lnTo", x: "x2", y: "y2" },
2461
+ { kind: "lnTo", x: "x1", y: "y2" },
2462
+ { kind: "close" }
2463
+ ]
2464
+ },
2465
+ // Diagonal bevel facets — stroked-only so a wireframe outline still
2466
+ // reads as a beveled rectangle without overpainting the fill.
2467
+ {
2468
+ stroke: true,
2469
+ fill: "none",
2470
+ extrusionOk: false,
2471
+ commands: [
2472
+ { kind: "moveTo", x: "l", y: "t" },
2473
+ { kind: "lnTo", x: "x1", y: "x1" },
2474
+ { kind: "moveTo", x: "r", y: "t" },
2475
+ { kind: "lnTo", x: "x2", y: "x1" },
2476
+ { kind: "moveTo", x: "r", y: "b" },
2477
+ { kind: "lnTo", x: "x2", y: "y2" },
2478
+ { kind: "moveTo", x: "l", y: "b" },
2479
+ { kind: "lnTo", x: "x1", y: "y2" }
2480
+ ]
2481
+ }
2482
+ ]
2483
+ };
2484
+ }
2485
+ ({
2486
+ actionButtonBlank: buildActionButton("actionButtonBlank"),
2487
+ actionButtonHome: buildActionButton("actionButtonHome"),
2488
+ actionButtonHelp: buildActionButton("actionButtonHelp"),
2489
+ actionButtonInformation: buildActionButton("actionButtonInformation"),
2490
+ actionButtonForwardNext: buildActionButton("actionButtonForwardNext"),
2491
+ actionButtonBackPrevious: buildActionButton("actionButtonBackPrevious"),
2492
+ actionButtonEnd: buildActionButton("actionButtonEnd"),
2493
+ actionButtonBeginning: buildActionButton("actionButtonBeginning"),
2494
+ actionButtonReturn: buildActionButton("actionButtonReturn"),
2495
+ actionButtonDocument: buildActionButton("actionButtonDocument"),
2496
+ actionButtonSound: buildActionButton("actionButtonSound"),
2497
+ actionButtonMovie: buildActionButton("actionButtonMovie")
2498
+ });
2499
+
2500
+ // src/core/geometry/preset-shape-definitions-arrow-callouts.ts
2501
+ function gd2(name, formula) {
2502
+ const parts = formula.trim().split(/\s+/);
2503
+ return { name, formula, args: parts.slice(1) };
2504
+ }
2505
+ ({
2506
+ gdLst: [
2507
+ gd2("a1", "pin 0 adj1 100000"),
2508
+ gd2("a2", "pin 0 adj2 100000"),
2509
+ gd2("a3", "pin 0 adj3 100000"),
2510
+ gd2("a4", "pin 0 adj4 100000"),
2511
+ gd2("y1", "*/ hd2 a2 100000"),
2512
+ gd2("y2", "*/ hd2 a1 100000"),
2513
+ gd2("y3", "+- vc 0 y2"),
2514
+ gd2("y4", "+- vc y2 0"),
2515
+ gd2("y5", "+- vc 0 y1"),
2516
+ gd2("y6", "+- vc y1 0"),
2517
+ gd2("x1", "*/ w a4 100000"),
2518
+ gd2("x2", "*/ w a3 100000"),
2519
+ gd2("x3", "+- r 0 x2")
2520
+ ]});
2521
+ ({
2522
+ gdLst: [
2523
+ gd2("a1", "pin 0 adj1 100000"),
2524
+ gd2("a2", "pin 0 adj2 100000"),
2525
+ gd2("a3", "pin 0 adj3 100000"),
2526
+ gd2("a4", "pin 0 adj4 100000"),
2527
+ gd2("y1", "*/ hd2 a2 100000"),
2528
+ gd2("y2", "*/ hd2 a1 100000"),
2529
+ gd2("y3", "+- vc 0 y2"),
2530
+ gd2("y4", "+- vc y2 0"),
2531
+ gd2("y5", "+- vc 0 y1"),
2532
+ gd2("y6", "+- vc y1 0"),
2533
+ gd2("x1", "*/ w a3 100000"),
2534
+ gd2("x2", "*/ w a4 100000"),
2535
+ gd2("x3", "+- r 0 x2")
2536
+ ]});
2537
+ ({
2538
+ gdLst: [
2539
+ gd2("a1", "pin 0 adj1 100000"),
2540
+ gd2("a2", "pin 0 adj2 100000"),
2541
+ gd2("a3", "pin 0 adj3 100000"),
2542
+ gd2("a4", "pin 0 adj4 100000"),
2543
+ gd2("x1", "*/ wd2 a2 100000"),
2544
+ gd2("x2", "*/ wd2 a1 100000"),
2545
+ gd2("x3", "+- hc 0 x2"),
2546
+ gd2("x4", "+- hc x2 0"),
2547
+ gd2("x5", "+- hc 0 x1"),
2548
+ gd2("x6", "+- hc x1 0"),
2549
+ gd2("y1", "*/ h a3 100000"),
2550
+ gd2("y2", "*/ h a4 100000"),
2551
+ gd2("y3", "+- b 0 y2")
2552
+ ]});
2553
+ ({
2554
+ gdLst: [
2555
+ gd2("a1", "pin 0 adj1 100000"),
2556
+ gd2("a2", "pin 0 adj2 100000"),
2557
+ gd2("a3", "pin 0 adj3 100000"),
2558
+ gd2("a4", "pin 0 adj4 100000"),
2559
+ gd2("x1", "*/ wd2 a2 100000"),
2560
+ gd2("x2", "*/ wd2 a1 100000"),
2561
+ gd2("x3", "+- hc 0 x2"),
2562
+ gd2("x4", "+- hc x2 0"),
2563
+ gd2("x5", "+- hc 0 x1"),
2564
+ gd2("x6", "+- hc x1 0"),
2565
+ gd2("y1", "*/ h a4 100000"),
2566
+ gd2("y2", "*/ h a3 100000"),
2567
+ gd2("y3", "+- b 0 y2")
2568
+ ]});
2569
+ ({
2570
+ gdLst: [
2571
+ gd2("a1", "pin 0 adj1 100000"),
2572
+ gd2("a2", "pin 0 adj2 100000"),
2573
+ gd2("a3", "pin 0 adj3 100000"),
2574
+ gd2("a4", "pin 0 adj4 100000"),
2575
+ gd2("y1", "*/ hd2 a2 100000"),
2576
+ gd2("y2", "*/ hd2 a1 100000"),
2577
+ gd2("y3", "+- vc 0 y2"),
2578
+ gd2("y4", "+- vc y2 0"),
2579
+ gd2("y5", "+- vc 0 y1"),
2580
+ gd2("y6", "+- vc y1 0"),
2581
+ gd2("x1", "*/ wd2 a3 100000"),
2582
+ gd2("x4", "+- r 0 x1"),
2583
+ gd2("cw", "*/ w a4 200000"),
2584
+ gd2("x2", "+- hc 0 cw"),
2585
+ gd2("x3", "+- hc cw 0")
2586
+ ]});
2587
+ ({
2588
+ gdLst: [
2589
+ gd2("a1", "pin 0 adj1 100000"),
2590
+ gd2("a2", "pin 0 adj2 100000"),
2591
+ gd2("a3", "pin 0 adj3 100000"),
2592
+ gd2("a4", "pin 0 adj4 100000"),
2593
+ gd2("x1", "*/ wd2 a2 100000"),
2594
+ gd2("x2", "*/ wd2 a1 100000"),
2595
+ gd2("x3", "+- hc 0 x2"),
2596
+ gd2("x4", "+- hc x2 0"),
2597
+ gd2("x5", "+- hc 0 x1"),
2598
+ gd2("x6", "+- hc x1 0"),
2599
+ gd2("y1", "*/ hd2 a3 100000"),
2600
+ gd2("y4", "+- b 0 y1"),
2601
+ gd2("ch", "*/ h a4 200000"),
2602
+ gd2("y2", "+- vc 0 ch"),
2603
+ gd2("y3", "+- vc ch 0")
2604
+ ]});
2605
+ ({
2606
+ gdLst: [
2607
+ gd2("a1", "pin 0 adj1 100000"),
2608
+ gd2("a2", "pin 0 adj2 100000"),
2609
+ gd2("a3", "pin 0 adj3 100000"),
2610
+ gd2("a4", "pin 0 adj4 100000"),
2611
+ // Shaft thickness offsets (half-thickness on each axis).
2612
+ gd2("x1", "*/ wd2 a2 100000"),
2613
+ gd2("x2", "*/ wd2 a1 100000"),
2614
+ gd2("y1", "*/ hd2 a2 100000"),
2615
+ gd2("y2", "*/ hd2 a1 100000"),
2616
+ // Head body offsets (relative to the centre).
2617
+ gd2("x5", "+- hc 0 x1"),
2618
+ gd2("x6", "+- hc x1 0"),
2619
+ gd2("x3", "+- hc 0 x2"),
2620
+ gd2("x4", "+- hc x2 0"),
2621
+ gd2("y5", "+- vc 0 y1"),
2622
+ gd2("y6", "+- vc y1 0"),
2623
+ gd2("y3", "+- vc 0 y2"),
2624
+ gd2("y4", "+- vc y2 0"),
2625
+ // Head-length distances on each axis.
2626
+ gd2("hl", "*/ wd2 a3 100000"),
2627
+ gd2("vl", "*/ hd2 a3 100000"),
2628
+ gd2("xL", "+- l hl 0"),
2629
+ gd2("xR", "+- r 0 hl"),
2630
+ gd2("yT", "+- t vl 0"),
2631
+ gd2("yB", "+- b 0 vl"),
2632
+ // Central callout body (square-ish region, half-extents).
2633
+ gd2("cw", "*/ w a4 200000"),
2634
+ gd2("ch", "*/ h a4 200000"),
2635
+ gd2("cl", "+- hc 0 cw"),
2636
+ gd2("cr", "+- hc cw 0"),
2637
+ gd2("ct", "+- vc 0 ch"),
2638
+ gd2("cb", "+- vc ch 0")
2639
+ ]});
2640
+ ({
2641
+ gdLst: [
2642
+ gd2("a1", "pin 0 adj1 100000"),
2643
+ gd2("a2", "pin 0 adj2 100000"),
2644
+ gd2("a3", "pin 0 adj3 100000"),
2645
+ gd2("a4", "pin 0 adj4 100000"),
2646
+ // Head + shaft thickness (relative to ss).
2647
+ gd2("th", "*/ ss a2 100000"),
2648
+ gd2("hw", "*/ ss a1 100000"),
2649
+ gd2("hl", "*/ ss a3 100000"),
2650
+ // Vertical-segment x bounds.
2651
+ gd2("xb", "+- l th 0"),
2652
+ // Head x bounds (right end).
2653
+ gd2("xh", "+- xb hl 0"),
2654
+ // Knee line (where horizontal joins vertical).
2655
+ gd2("y1", "+- t hw 0"),
2656
+ gd2("y2", "+- y1 th 0"),
2657
+ gd2("y3", "+- y1 0 hw"),
2658
+ // Callout body — fraction of remaining vertical run.
2659
+ gd2("cy", "*/ h a4 100000"),
2660
+ gd2("cb", "+- b 0 cy")
2661
+ ]});
2662
+ ({
2663
+ gdLst: [
2664
+ gd2("a1", "pin 0 adj1 100000"),
2665
+ gd2("a2", "pin 0 adj2 100000"),
2666
+ gd2("a3", "pin 0 adj3 100000"),
2667
+ gd2("a4", "pin 0 adj4 100000"),
2668
+ gd2("th", "*/ ss a2 100000"),
2669
+ gd2("hw", "*/ ss a1 100000"),
2670
+ gd2("hl", "*/ ss a3 100000"),
2671
+ gd2("y2", "+- b 0 th"),
2672
+ gd2("xh", "+- r 0 hl"),
2673
+ gd2("xb", "+- xh 0 hw"),
2674
+ gd2("xt", "+- xh hw 0"),
2675
+ // Callout body fraction along the bottom run.
2676
+ gd2("cx", "*/ w a4 100000")
2677
+ ]});
2678
+ ({
2679
+ gdLst: [
2680
+ gd2("a1", "pin 0 adj1 100000"),
2681
+ gd2("a2", "pin 0 adj2 100000"),
2682
+ gd2("a3", "pin 0 adj3 100000"),
2683
+ // Head body / length / thickness in raw units.
2684
+ gd2("hw", "*/ ss a1 100000"),
2685
+ gd2("hl", "*/ ss a2 100000"),
2686
+ gd2("th", "*/ ss a3 100000"),
2687
+ // Up-arm head (vertical) — bounds along x.
2688
+ gd2("xc", "+- l hl 0"),
2689
+ gd2("x1", "+- xc 0 0"),
2690
+ gd2("xb", "+- l hl 0"),
2691
+ gd2("xs", "+- xb 0 0"),
2692
+ // The body's "shaft" runs from (hl, hl) to (r, b). Top-left corner of
2693
+ // the up arm is at (xs - hw/2, t), tip at (xs, t)... we use canonical
2694
+ // formulas: vertical head spans from xc-hw to xc+hw centred on xc.
2695
+ gd2("xH1", "+- xc 0 hw"),
2696
+ gd2("xH2", "+- xc hw 0"),
2697
+ // Horizontal head spans from t-hw to t+hw centred on yc.
2698
+ gd2("yc", "+- t hl 0"),
2699
+ gd2("yH1", "+- yc 0 hw"),
2700
+ gd2("yH2", "+- yc hw 0"),
2701
+ // Body inner corner (where the L meets) at (xc + th, yc + th)... the
2702
+ // canonical formulas tie it via head length / thickness.
2703
+ gd2("xt", "+- xc th 0"),
2704
+ gd2("yt", "+- yc th 0")
2705
+ ]});
2706
+
2707
+ // src/core/geometry/preset-shape-definitions-arrows.ts
2708
+ function gd3(name, formula) {
2709
+ const parts = formula.trim().split(/\s+/);
2710
+ return { name, formula, args: parts.slice(1) };
2711
+ }
2712
+ ({
2713
+ gdLst: [
2714
+ gd3("a", "pin 0 adj 50000"),
2715
+ gd3("x1", "*/ ss a 100000"),
2716
+ gd3("x2", "+- r 0 x1"),
2717
+ gd3("y2", "+- b 0 x1")
2718
+ ]});
2719
+ ({
2720
+ gdLst: [
2721
+ gd3("a", "pin 0 adj 50000"),
2722
+ gd3("y1", "*/ h a 200000"),
2723
+ gd3("y2", "+- y1 y1 0"),
2724
+ gd3("y3", "+- b 0 y1")
2725
+ ]});
2726
+ ({
2727
+ gdLst: [
2728
+ gd3("a", "pin 0 adj 100000"),
2729
+ gd3("y1", "*/ ss a 100000"),
2730
+ gd3("y4", "+- b 0 y1"),
2731
+ gd3("x4", "+- r 0 y1")
2732
+ ]});
2733
+ ({
2734
+ gdLst: [
2735
+ gd3("a", "pin 0 adj 50000"),
2736
+ gd3("x1", "*/ w a 200000"),
2737
+ gd3("x2", "+- x1 x1 0"),
2738
+ gd3("x3", "+- r 0 x1")
2739
+ ]});
2740
+ ({
2741
+ gdLst: [
2742
+ gd3("a1", "pin 0 adj1 50000"),
2743
+ gd3("x1", "*/ ss a1 100000"),
2744
+ gd3("x4", "+- r 0 x1"),
2745
+ gd3("y4", "+- b 0 x1")
2746
+ ]});
2747
+ ({
2748
+ gdLst: [
2749
+ gd3("a1", "pin 0 adj1 100000"),
2750
+ gd3("a2", "pin 0 adj2 100000"),
2751
+ gd3("x1", "*/ w a2 100000"),
2752
+ gd3("y1", "*/ h a1 100000"),
2753
+ gd3("dx2", "*/ y1 w h"),
2754
+ gd3("x2", "+- x1 0 dx2"),
2755
+ gd3("dy2", "*/ x1 h w"),
2756
+ gd3("y2", "+- y1 0 dy2")
2757
+ ]});
2758
+ ({
2759
+ gdLst: [
2760
+ gd3("a", "pin 0 adj 50000"),
2761
+ gd3("x1", "*/ ss a 100000"),
2762
+ gd3("x2", "+- r 0 x1"),
2763
+ gd3("y2", "+- b 0 x1")
2764
+ ]});
2765
+ ({
2766
+ gdLst: [
2767
+ gd3("md", "min w h"),
2768
+ gd3("dx2", "*/ md 1 5"),
2769
+ gd3("y2", "+- b 0 dx2"),
2770
+ gd3("x2", "+- r 0 dx2")
2771
+ ]});
2772
+ ({
2773
+ gdLst: [
2774
+ gd3("a1", "pin 0 adj1 100000"),
2775
+ gd3("a2", "pin 0 adj2 100000"),
2776
+ gd3("y1", "*/ hd2 a1 100000"),
2777
+ gd3("y2", "+- vc 0 y1"),
2778
+ gd3("y3", "+- vc y1 0"),
2779
+ gd3("x2", "*/ wd2 a2 100000"),
2780
+ gd3("x1", "+- l x2 0"),
2781
+ gd3("x3", "+- r 0 x2")
2782
+ ]});
2783
+ ({
2784
+ gdLst: [
2785
+ gd3("a1", "pin 0 adj1 100000"),
2786
+ gd3("a2", "pin 0 adj2 100000"),
2787
+ gd3("x1", "*/ wd2 a1 100000"),
2788
+ gd3("x2", "+- hc 0 x1"),
2789
+ gd3("x3", "+- hc x1 0"),
2790
+ gd3("y2", "*/ hd2 a2 100000"),
2791
+ gd3("y1", "+- t y2 0"),
2792
+ gd3("y3", "+- b 0 y2")
2793
+ ]});
2794
+ ({
2795
+ gdLst: [
2796
+ gd3("a1", "pin 0 adj1 100000"),
2797
+ gd3("a2", "pin 0 adj2 100000"),
2798
+ gd3("a3", "pin 0 adj3 100000"),
2799
+ gd3("y1", "*/ hd2 a1 100000"),
2800
+ gd3("y2", "+- b 0 y1"),
2801
+ gd3("y3", "+- b 0 a1"),
2802
+ gd3("hx", "*/ wd2 a2 100000"),
2803
+ gd3("x1", "+- hc 0 hx"),
2804
+ gd3("x2", "+- hc hx 0"),
2805
+ gd3("hl", "*/ wd2 a3 100000"),
2806
+ gd3("xl", "+- l hl 0"),
2807
+ gd3("xr", "+- r 0 hl"),
2808
+ gd3("yh", "+- y1 0 0"),
2809
+ gd3("uy", "*/ h a3 100000"),
2810
+ gd3("up", "+- t uy 0")
2811
+ ]});
2812
+ ({
2813
+ gdLst: [
2814
+ gd3("a1", "pin 0 adj1 100000"),
2815
+ gd3("a2", "pin 0 adj2 100000"),
2816
+ gd3("a3", "pin 0 adj3 100000"),
2817
+ gd3("hx", "*/ wd2 a2 100000"),
2818
+ gd3("hy", "*/ hd2 a2 100000"),
2819
+ gd3("bx1", "+- hc 0 hx"),
2820
+ gd3("bx2", "+- hc hx 0"),
2821
+ gd3("by1", "+- vc 0 hy"),
2822
+ gd3("by2", "+- vc hy 0"),
2823
+ gd3("hl", "*/ wd2 a3 100000"),
2824
+ gd3("vl", "*/ hd2 a3 100000"),
2825
+ gd3("lh", "+- l hl 0"),
2826
+ gd3("rh", "+- r 0 hl"),
2827
+ gd3("th", "+- t vl 0"),
2828
+ gd3("bh", "+- b 0 vl"),
2829
+ gd3("hw", "*/ wd2 a1 100000"),
2830
+ gd3("hh", "*/ hd2 a1 100000"),
2831
+ gd3("hl1", "+- hc 0 hw"),
2832
+ gd3("hl2", "+- hc hw 0"),
2833
+ gd3("vt1", "+- vc 0 hh"),
2834
+ gd3("vt2", "+- vc hh 0")
2835
+ ]});
2836
+ ({
2837
+ gdLst: [
2838
+ gd3("bw", "*/ ss adj1 100000"),
2839
+ gd3("hw", "*/ ss adj2 100000"),
2840
+ gd3("hl", "*/ ss adj3 100000"),
2841
+ gd3("xb", "+- l bw 0"),
2842
+ gd3("xh", "+- xb hl 0"),
2843
+ gd3("y2", "+- b 0 bw"),
2844
+ gd3("y1", "+- y2 0 hw"),
2845
+ gd3("y3", "+- y2 hw 0")
2846
+ ]});
2847
+ ({
2848
+ gdLst: [
2849
+ gd3("bw", "*/ ss adj1 100000"),
2850
+ gd3("hw", "*/ ss adj2 100000"),
2851
+ gd3("hl", "*/ ss adj3 100000"),
2852
+ gd3("y2", "+- b 0 bw"),
2853
+ gd3("xh", "+- r 0 hl"),
2854
+ gd3("xb", "+- xh 0 hw"),
2855
+ gd3("xt", "+- xh hw 0")
2856
+ ]});
2857
+ ({
2858
+ gdLst: [
2859
+ gd3("bw", "*/ ss adj1 100000"),
2860
+ gd3("hw", "*/ ss adj2 100000"),
2861
+ gd3("hl", "*/ ss adj3 100000"),
2862
+ gd3("x1", "+- l bw 0"),
2863
+ gd3("x2", "+- r 0 bw"),
2864
+ gd3("x3", "+- x2 0 hw"),
2865
+ gd3("x4", "+- x2 hw 0"),
2866
+ gd3("y1", "*/ h adj4 100000"),
2867
+ gd3("y2", "+- y1 hw 0")
2868
+ ]});
2869
+ ({
2870
+ gdLst: [
2871
+ gd3("a1", "pin 0 adj1 100000"),
2872
+ gd3("a2", "pin 0 adj2 100000"),
2873
+ gd3("y1", "*/ hd2 a1 100000"),
2874
+ gd3("y2", "+- vc 0 y1"),
2875
+ gd3("y3", "+- vc y1 0"),
2876
+ gd3("x2", "*/ ss 1 32"),
2877
+ gd3("x3", "*/ ss 2 32"),
2878
+ gd3("x4", "*/ ss 5 32"),
2879
+ gd3("x5", "*/ w a2 100000"),
2880
+ gd3("x6", "+- r 0 x5"),
2881
+ gd3("dx", "*/ hd2 x5 wd2"),
2882
+ gd3("x7", "+- x6 dx 0")
2883
+ ]});
2884
+ ({
2885
+ gdLst: [
2886
+ gd3("a1", "pin 0 adj1 100000"),
2887
+ gd3("a2", "pin 0 adj2 100000"),
2888
+ gd3("y1", "*/ hd2 a1 100000"),
2889
+ gd3("y2", "+- vc 0 y1"),
2890
+ gd3("y3", "+- vc y1 0"),
2891
+ gd3("x2", "*/ w a2 100000"),
2892
+ gd3("x1", "+- r 0 x2"),
2893
+ gd3("dx2", "*/ hd2 x2 wd2"),
2894
+ gd3("x3", "+- x1 dx2 0"),
2895
+ gd3("nx", "*/ y1 1 1")
2896
+ ]});
2897
+ ({
2898
+ gdLst: [gd3("a", "pin 0 adj 100000"), gd3("x1", "*/ w a 100000")]});
2899
+ ({
2900
+ gdLst: [gd3("a", "pin 0 adj 100000"), gd3("x1", "*/ w a 100000"), gd3("x2", "+- r 0 x1")]});
2901
+ ({
2902
+ gdLst: [
2903
+ gd3("a", "pin 0 adj 100000"),
2904
+ gd3("x1", "*/ w a 200000"),
2905
+ gd3("x2", "+- r 0 x1"),
2906
+ gd3("y1", "*/ h 25000 100000"),
2907
+ gd3("y2", "+- b 0 y1")
2908
+ ]});
2909
+ ({
2910
+ gdLst: [gd3("th", "*/ ss adj1 100000"), gd3("iwd2", "+- wd2 0 th"), gd3("ihd2", "+- hd2 0 th")]});
2911
+ ({
2912
+ gdLst: [gd3("th", "*/ ss adj1 100000"), gd3("iwd2", "+- wd2 0 th"), gd3("ihd2", "+- hd2 0 th")]});
2913
+ ({
2914
+ gdLst: [gd3("th", "*/ ss adj1 100000"), gd3("iwd2", "+- wd2 0 th"), gd3("ihd2", "+- hd2 0 th")]});
2915
+ ({
2916
+ gdLst: [
2917
+ gd3("a1", "pin 0 adj1 75000"),
2918
+ gd3("a2", "pin 0 adj2 33333"),
2919
+ gd3("ad1", "*/ h a1 100000"),
2920
+ gd3("ad2", "*/ ss a2 100000")
2921
+ ]});
2922
+ ({
2923
+ gdLst: [
2924
+ gd3("a1", "pin 0 adj1 100000"),
2925
+ gd3("a2", "pin 0 adj2 100000"),
2926
+ gd3("a3", "pin 0 adj3 100000"),
2927
+ gd3("th", "*/ ss a1 100000"),
2928
+ gd3("hl", "*/ w a3 100000"),
2929
+ gd3("x1", "+- r 0 hl"),
2930
+ gd3("y1", "*/ h a2 100000")
2931
+ ]});
2932
+
2933
+ // src/core/geometry/preset-shape-definitions-arrows-refined.ts
2934
+ function gd4(name, formula) {
2935
+ const parts = formula.trim().split(/\s+/);
2936
+ return { name, formula, args: parts.slice(1) };
2937
+ }
2938
+ ({
2939
+ gdLst: [
2940
+ // Pin all four adjusts to their valid ranges.
2941
+ gd4("a1", "pin 0 adj1 25000"),
2942
+ gd4("a2", "pin 0 adj2 25000"),
2943
+ gd4("a3", "pin 0 adj3 50000"),
2944
+ gd4("a4", "pin 0 adj4 50000"),
2945
+ // Body half-width and head half-width.
2946
+ gd4("th", "*/ ss a1 100000"),
2947
+ gd4("aw2", "*/ ss a2 100000"),
2948
+ // Arrow-head depth (length).
2949
+ gd4("th2", "*/ th 1 2"),
2950
+ gd4("dh2", "+- aw2 th2 0"),
2951
+ gd4("ah", "*/ ss a3 100000"),
2952
+ // Knee y position.
2953
+ gd4("bw", "+- r 0 ah"),
2954
+ gd4("bh", "+- b 0 dh2"),
2955
+ gd4("bs", "min bw bh"),
2956
+ gd4("maxAdj4", "*/ 100000 bs ss"),
2957
+ gd4("a4p", "pin 0 adj4 maxAdj4"),
2958
+ gd4("bd", "*/ ss a4p 100000"),
2959
+ gd4("bd3", "+- bd 0 th"),
2960
+ gd4("bd2", "max bd3 0"),
2961
+ // Vertical leg geometry.
2962
+ gd4("x3", "+- l th bd2"),
2963
+ gd4("x4", "+- x3 th 0"),
2964
+ gd4("y3", "+- b 0 ah"),
2965
+ gd4("y4", "+- y3 dh2 0"),
2966
+ // Right tip.
2967
+ gd4("y5", "+- y4 0 aw2"),
2968
+ gd4("y6", "+- y4 aw2 0")
2969
+ ]});
2970
+ ({
2971
+ gdLst: [
2972
+ gd4("a1", "pin 0 adj1 50000"),
2973
+ gd4("a2", "pin 0 adj2 50000"),
2974
+ gd4("a3", "pin 0 adj3 50000"),
2975
+ gd4("th", "*/ ss a1 100000"),
2976
+ gd4("aw", "*/ ss a2 100000"),
2977
+ gd4("ah", "*/ ss a3 100000"),
2978
+ gd4("th2", "*/ th 1 2"),
2979
+ gd4("aw2", "*/ aw 1 2"),
2980
+ // Vertical column anchored on the right edge of the spine.
2981
+ gd4("x1", "+- r 0 aw2"),
2982
+ gd4("x1p", "+- x1 0 th2"),
2983
+ gd4("x2", "+- x1 th2 0"),
2984
+ gd4("x3", "+- r 0 aw"),
2985
+ // Y position where arm joins the vertical leg.
2986
+ gd4("y1", "+- b 0 th"),
2987
+ gd4("y2", "+- t ah 0")
2988
+ ]});
2989
+ ({
2990
+ gdLst: [
2991
+ gd4("a1", "pin 0 adj1 25000"),
2992
+ gd4("a2", "pin 0 adj2 25000"),
2993
+ gd4("a3", "pin 0 adj3 50000"),
2994
+ gd4("a5", "pin 1 adj5 100000"),
2995
+ // Body / head dimensions.
2996
+ gd4("th", "*/ ss a1 100000"),
2997
+ gd4("aw2", "*/ ss a2 100000"),
2998
+ gd4("th2", "*/ th 1 2"),
2999
+ gd4("dh2", "+- aw2 th2 0"),
3000
+ gd4("y5", "*/ ss a3 100000"),
3001
+ gd4("ah", "+- y5 0 0"),
3002
+ // Right edge of cap (controls the width of the U).
3003
+ gd4("x9", "*/ w a5 100000"),
3004
+ gd4("bw", "*/ x9 1 2"),
3005
+ gd4("bs", "min bw h"),
3006
+ gd4("maxAdj4", "*/ 100000 bs ss"),
3007
+ gd4("a4", "pin 0 adj4 maxAdj4"),
3008
+ gd4("bh", "*/ ss a4 100000"),
3009
+ gd4("bs2", "+- bh 0 th"),
3010
+ gd4("tm", "min y5 bs2"),
3011
+ gd4("x4", "+- x9 0 bw"),
3012
+ gd4("x5", "+- x4 th 0"),
3013
+ gd4("x8", "+- x9 0 th"),
3014
+ gd4("x6", "+- x8 0 dh2"),
3015
+ gd4("x7", "+- x8 dh2 0"),
3016
+ gd4("y4", "+- b 0 ah"),
3017
+ gd4("y3", "+- y4 dh2 0"),
3018
+ gd4("y2", "+- y4 0 dh2"),
3019
+ gd4("y1", "+- y3 0 th")
3020
+ ]});
3021
+ ({
3022
+ gdLst: [
3023
+ gd4("a1", "pin 0 adj1 25000"),
3024
+ gd4("a2", "pin 0 adj2 21599999"),
3025
+ gd4("a3", "pin 0 adj3 21599999"),
3026
+ gd4("a4", "pin 0 adj4 21599999"),
3027
+ gd4("a5", "pin 0 adj5 25000"),
3028
+ // Body / head thickness.
3029
+ gd4("th", "*/ ss a1 100000"),
3030
+ gd4("thh", "*/ ss a5 100000"),
3031
+ gd4("th2", "*/ th 1 2"),
3032
+ // Inner radii (subtract body thickness).
3033
+ gd4("rw1", "+- wd2 0 th2"),
3034
+ gd4("rh1", "+- hd2 0 th2"),
3035
+ gd4("rw2", "+- rw1 0 thh"),
3036
+ gd4("rh2", "+- rh1 0 thh"),
3037
+ gd4("rw3", "+- rw2 th2 0"),
3038
+ gd4("rh3", "+- rh2 th2 0"),
3039
+ // Centre point of arrow-head triangle on the arc (a4).
3040
+ gd4("wtH", "sin rw3 a4"),
3041
+ gd4("htH", "cos rh3 a4"),
3042
+ gd4("dxH", "cat2 rw3 htH wtH"),
3043
+ gd4("dyH", "sat2 rh3 htH wtH"),
3044
+ gd4("xH", "+- hc dxH 0"),
3045
+ gd4("yH", "+- vc dyH 0"),
3046
+ // End-of-tail point (start of arrow body, a2).
3047
+ gd4("rI", "min rw2 rh2"),
3048
+ gd4("u1", "*/ dxH dxH 1"),
3049
+ gd4("u2", "*/ dyH dyH 1"),
3050
+ gd4("u3", "*/ rI rI 1"),
3051
+ gd4("u4", "+- u1 0 u3"),
3052
+ gd4("u5", "+- u2 0 u3"),
3053
+ gd4("u6", "*/ u4 u5 u1"),
3054
+ gd4("u7", "+- u6 0 u2"),
3055
+ gd4("u8", "*/ u1 1 u2"),
3056
+ gd4("u9", "+/ u7 u8 1"),
3057
+ gd4("u10", "*/ u4 1 dxH"),
3058
+ gd4("u11", "+- 0 0 u10"),
3059
+ gd4("u12", "+/ 1 1 u9"),
3060
+ gd4("u13", "sqrt u12"),
3061
+ gd4("u14", "*/ u11 1 u13"),
3062
+ gd4("u15", "?: u14 u14 0"),
3063
+ gd4("u16", "+- u15 xH 0"),
3064
+ // Head triangle vertices.
3065
+ gd4("u17", "+- yH 0 vc"),
3066
+ gd4("u18", "+- u16 0 hc"),
3067
+ gd4("u19", "at2 u17 u18"),
3068
+ gd4("u20", "+- u19 cd4 0"),
3069
+ gd4("u21", "+- u19 0 cd4"),
3070
+ gd4("wtA", "sin rw3 a3"),
3071
+ gd4("htA", "cos rh3 a3"),
3072
+ gd4("dxA", "cat2 rw3 htA wtA"),
3073
+ gd4("dyA", "sat2 rh3 htA wtA"),
3074
+ gd4("xA", "+- hc dxA 0"),
3075
+ gd4("yA", "+- vc dyA 0"),
3076
+ gd4("wtE", "sin rw1 a2"),
3077
+ gd4("htE", "cos rh1 a2"),
3078
+ gd4("dxE", "cat2 rw1 htE wtE"),
3079
+ gd4("dyE", "sat2 rh1 htE wtE"),
3080
+ gd4("xE", "+- hc dxE 0"),
3081
+ gd4("yE", "+- vc dyE 0"),
3082
+ // Outer/inner head triangle points.
3083
+ gd4("dxG", "cos thh u20"),
3084
+ gd4("dyG", "sin thh u20"),
3085
+ gd4("xG", "+- xH dxG 0"),
3086
+ gd4("yG", "+- yH dyG 0"),
3087
+ gd4("dxB", "cos thh u21"),
3088
+ gd4("dyB", "sin thh u21"),
3089
+ gd4("xB", "+- xH dxB 0"),
3090
+ gd4("yB", "+- yH dyB 0"),
3091
+ // Sweep deltas (signed) for the two arcs.
3092
+ gd4("sw1", "+- a3 0 a2"),
3093
+ gd4("sw2", "+- a4 0 a3")
3094
+ // Inscribed text rect: full bounds is fine.
3095
+ ]});
3096
+ ({
3097
+ gdLst: [
3098
+ gd4("a1", "pin 0 adj1 25000"),
3099
+ gd4("a2", "pin 0 adj2 21599999"),
3100
+ gd4("a3", "pin 0 adj3 21599999"),
3101
+ gd4("a4", "pin 0 adj4 21599999"),
3102
+ gd4("a5", "pin 0 adj5 25000"),
3103
+ gd4("th", "*/ ss a1 100000"),
3104
+ gd4("thh", "*/ ss a5 100000"),
3105
+ gd4("th2", "*/ th 1 2"),
3106
+ gd4("rw1", "+- wd2 0 th2"),
3107
+ gd4("rh1", "+- hd2 0 th2"),
3108
+ gd4("rw2", "+- rw1 0 thh"),
3109
+ gd4("rh2", "+- rh1 0 thh"),
3110
+ gd4("rw3", "+- rw2 th2 0"),
3111
+ gd4("rh3", "+- rh2 th2 0"),
3112
+ gd4("wtH", "sin rw3 a4"),
3113
+ gd4("htH", "cos rh3 a4"),
3114
+ gd4("dxH", "cat2 rw3 htH wtH"),
3115
+ gd4("dyH", "sat2 rh3 htH wtH"),
3116
+ gd4("xH", "+- hc dxH 0"),
3117
+ gd4("yH", "+- vc dyH 0"),
3118
+ gd4("rI", "min rw2 rh2"),
3119
+ gd4("u1", "*/ dxH dxH 1"),
3120
+ gd4("u2", "*/ dyH dyH 1"),
3121
+ gd4("u3", "*/ rI rI 1"),
3122
+ gd4("u4", "+- u1 0 u3"),
3123
+ gd4("u5", "+- u2 0 u3"),
3124
+ gd4("u6", "*/ u4 u5 u1"),
3125
+ gd4("u7", "+- u6 0 u2"),
3126
+ gd4("u8", "*/ u1 1 u2"),
3127
+ gd4("u9", "+/ u7 u8 1"),
3128
+ gd4("u10", "*/ u4 1 dxH"),
3129
+ gd4("u11", "+- 0 0 u10"),
3130
+ gd4("u12", "+/ 1 1 u9"),
3131
+ gd4("u13", "sqrt u12"),
3132
+ gd4("u14", "*/ u11 1 u13"),
3133
+ gd4("u15", "?: u14 u14 0"),
3134
+ gd4("u16", "+- u15 xH 0"),
3135
+ gd4("u17", "+- yH 0 vc"),
3136
+ gd4("u18", "+- u16 0 hc"),
3137
+ gd4("u19", "at2 u17 u18"),
3138
+ gd4("u20", "+- u19 cd4 0"),
3139
+ gd4("u21", "+- u19 0 cd4"),
3140
+ gd4("wtA", "sin rw3 a3"),
3141
+ gd4("htA", "cos rh3 a3"),
3142
+ gd4("dxA", "cat2 rw3 htA wtA"),
3143
+ gd4("dyA", "sat2 rh3 htA wtA"),
3144
+ gd4("xA", "+- hc dxA 0"),
3145
+ gd4("yA", "+- vc dyA 0"),
3146
+ gd4("wtE", "sin rw1 a2"),
3147
+ gd4("htE", "cos rh1 a2"),
3148
+ gd4("dxE", "cat2 rw1 htE wtE"),
3149
+ gd4("dyE", "sat2 rh1 htE wtE"),
3150
+ gd4("xE", "+- hc dxE 0"),
3151
+ gd4("yE", "+- vc dyE 0"),
3152
+ gd4("dxG", "cos thh u20"),
3153
+ gd4("dyG", "sin thh u20"),
3154
+ gd4("xG", "+- xH dxG 0"),
3155
+ gd4("yG", "+- yH dyG 0"),
3156
+ gd4("dxB", "cos thh u21"),
3157
+ gd4("dyB", "sin thh u21"),
3158
+ gd4("xB", "+- xH dxB 0"),
3159
+ gd4("yB", "+- yH dyB 0"),
3160
+ // Mirrored sweep direction: tail at a2, head at a3, head reaches a4.
3161
+ gd4("sw1", "+- a3 0 a2")
3162
+ ]});
3163
+ ({
3164
+ gdLst: [
3165
+ gd4("a1", "pin 0 adj1 25000"),
3166
+ gd4("a2", "pin 0 adj2 21599999"),
3167
+ gd4("a3", "pin 0 adj3 21599999"),
3168
+ gd4("a4", "pin 0 adj4 21599999"),
3169
+ gd4("a5", "pin 0 adj5 25000"),
3170
+ gd4("th", "*/ ss a1 100000"),
3171
+ gd4("thh", "*/ ss a5 100000"),
3172
+ gd4("th2", "*/ th 1 2"),
3173
+ gd4("rw1", "+- wd2 0 th2"),
3174
+ gd4("rh1", "+- hd2 0 th2"),
3175
+ gd4("rw2", "+- rw1 0 thh"),
3176
+ gd4("rh2", "+- rh1 0 thh"),
3177
+ gd4("rw3", "+- rw2 th2 0"),
3178
+ gd4("rh3", "+- rh2 th2 0"),
3179
+ // First head (around a2 — start of arc).
3180
+ gd4("wtH1", "sin rw3 a2"),
3181
+ gd4("htH1", "cos rh3 a2"),
3182
+ gd4("dxH1", "cat2 rw3 htH1 wtH1"),
3183
+ gd4("dyH1", "sat2 rh3 htH1 wtH1"),
3184
+ gd4("xH1", "+- hc dxH1 0"),
3185
+ gd4("yH1", "+- vc dyH1 0"),
3186
+ // Second head (around a4 — end of arc, before a3).
3187
+ gd4("wtH2", "sin rw3 a4"),
3188
+ gd4("htH2", "cos rh3 a4"),
3189
+ gd4("dxH2", "cat2 rw3 htH2 wtH2"),
3190
+ gd4("dyH2", "sat2 rh3 htH2 wtH2"),
3191
+ gd4("xH2", "+- hc dxH2 0"),
3192
+ gd4("yH2", "+- vc dyH2 0"),
3193
+ // Outer/inner shoulder points on the body for both heads.
3194
+ gd4("wtS1", "sin rw1 a2"),
3195
+ gd4("htS1", "cos rh1 a2"),
3196
+ gd4("dxS1", "cat2 rw1 htS1 wtS1"),
3197
+ gd4("dyS1", "sat2 rh1 htS1 wtS1"),
3198
+ gd4("xS1", "+- hc dxS1 0"),
3199
+ gd4("yS1", "+- vc dyS1 0"),
3200
+ gd4("wtS2", "sin rw1 a4"),
3201
+ gd4("htS2", "cos rh1 a4"),
3202
+ gd4("dxS2", "cat2 rw1 htS2 wtS2"),
3203
+ gd4("dyS2", "sat2 rh1 htS2 wtS2"),
3204
+ gd4("xS2", "+- hc dxS2 0"),
3205
+ gd4("yS2", "+- vc dyS2 0"),
3206
+ // Inner-arc start/end on the body (a3 is end of inner sweep).
3207
+ gd4("wtT1", "sin rw2 a2"),
3208
+ gd4("htT1", "cos rh2 a2"),
3209
+ gd4("dxT1", "cat2 rw2 htT1 wtT1"),
3210
+ gd4("dyT1", "sat2 rh2 htT1 wtT1"),
3211
+ gd4("xT1", "+- hc dxT1 0"),
3212
+ gd4("yT1", "+- vc dyT1 0"),
3213
+ gd4("wtT2", "sin rw2 a4"),
3214
+ gd4("htT2", "cos rh2 a4"),
3215
+ gd4("dxT2", "cat2 rw2 htT2 wtT2"),
3216
+ gd4("dyT2", "sat2 rh2 htT2 wtT2"),
3217
+ gd4("xT2", "+- hc dxT2 0"),
3218
+ gd4("yT2", "+- vc dyT2 0"),
3219
+ gd4("sw", "+- a4 0 a2")
3220
+ ]});
3221
+ ({
3222
+ gdLst: [
3223
+ gd4("a1", "pin 1 adj1 75000"),
3224
+ gd4("a2", "pin 0 adj2 33333"),
3225
+ gd4("ad1", "*/ h a1 100000"),
3226
+ gd4("ad2", "*/ ss a2 100000"),
3227
+ gd4("xB", "+- r 0 ad2"),
3228
+ gd4("yB", "+- t ad1 0"),
3229
+ gd4("alfa", "*/ cd4 1 14"),
3230
+ gd4("dx0", "tan ss alfa"),
3231
+ gd4("xC", "+- xB 0 dx0"),
3232
+ gd4("dx1", "tan ad1 alfa"),
3233
+ gd4("yF", "+- yB ad1 0"),
3234
+ gd4("xF", "+- xB dx1 0"),
3235
+ gd4("xE", "+- xF dx0 0"),
3236
+ gd4("yE", "+- yF ad1 0"),
3237
+ gd4("dy2", "*/ ss 1 10"),
3238
+ gd4("yD", "+- yE 0 dy2"),
3239
+ gd4("dy3", "*/ ss 1 8"),
3240
+ gd4("yP1", "+- t dy3 0"),
3241
+ gd4("xP1", "*/ wd2 1 4"),
3242
+ gd4("dy4", "*/ ss 1 80"),
3243
+ gd4("yP2", "+- yB dy4 0"),
3244
+ gd4("xP2", "*/ w 1 6")
3245
+ ]});
3246
+ ({
3247
+ gdLst: [
3248
+ gd4("a1", "pin 0 adj1 100000"),
3249
+ gd4("a2", "pin 0 adj2 100000"),
3250
+ gd4("a3", "pin 0 adj3 100000"),
3251
+ gd4("th", "*/ h a1 100000"),
3252
+ gd4("th2", "*/ th 1 2"),
3253
+ gd4("aw", "*/ h a2 100000"),
3254
+ gd4("aw2", "*/ aw 1 2"),
3255
+ gd4("hl", "*/ w a3 100000"),
3256
+ // Y-positions of the body bands.
3257
+ gd4("y1", "+- th 0 0"),
3258
+ gd4("y2", "+- y1 th2 0"),
3259
+ gd4("y3", "+- y2 th2 0"),
3260
+ gd4("y4", "+- y3 aw2 0"),
3261
+ gd4("y5", "+- b 0 aw2"),
3262
+ gd4("y6", "+- y5 aw2 0"),
3263
+ // X positions: the head shoulder is `hl` in from the right edge.
3264
+ gd4("x1", "+- r 0 hl"),
3265
+ // Outer arc control / sweep helpers.
3266
+ gd4("dx", "+- r 0 l"),
3267
+ gd4("cx1", "*/ dx 1 2"),
3268
+ gd4("cx2", "*/ dx 3 4")
3269
+ ]});
3270
+
3271
+ // src/core/geometry/preset-shape-definitions-connectors-brackets.ts
3272
+ function gd5(name, formula) {
3273
+ const parts = formula.trim().split(/\s+/);
3274
+ return { name, formula, args: parts.slice(1) };
3275
+ }
3276
+ ({
3277
+ gdLst: [
3278
+ gd5("a1", "pin 0 adj1 100000"),
3279
+ // Midpoint x: hc shifted by (a1 - 50000) * w / 100000 → simply a1 * w / 100000.
3280
+ gd5("x2", "*/ w a1 100000"),
3281
+ // Bezier control offsets: half-distance horizontally to keep slope smooth.
3282
+ gd5("x1", "*/ x2 1 2"),
3283
+ gd5("x4", "+- r 0 x2"),
3284
+ gd5("x5", "*/ x4 1 2"),
3285
+ gd5("x6", "+- x2 x5 0")
3286
+ ]});
3287
+ ({
3288
+ gdLst: [
3289
+ gd5("a1", "pin 0 adj1 100000"),
3290
+ gd5("a2", "pin 0 adj2 100000"),
3291
+ gd5("x2", "*/ w a1 100000"),
3292
+ gd5("x4", "*/ w a2 100000"),
3293
+ gd5("y2", "*/ h 33333 100000"),
3294
+ gd5("y4", "*/ h 66667 100000"),
3295
+ gd5("x1", "*/ x2 1 2"),
3296
+ gd5("x3", "*/ x4 1 2"),
3297
+ gd5("x5", "+- r 0 x4"),
3298
+ gd5("x6", "*/ x5 1 2"),
3299
+ gd5("x7", "+- x4 x6 0")
3300
+ ]});
3301
+ ({
3302
+ gdLst: [
3303
+ gd5("a1", "pin 0 adj1 100000"),
3304
+ gd5("a2", "pin 0 adj2 100000"),
3305
+ gd5("a3", "pin 0 adj3 100000"),
3306
+ gd5("x2", "*/ w a1 100000"),
3307
+ gd5("x4", "*/ w a2 100000"),
3308
+ gd5("x6", "*/ w a3 100000"),
3309
+ gd5("y2", "*/ h 25000 100000"),
3310
+ gd5("y4", "*/ h 50000 100000"),
3311
+ gd5("y6", "*/ h 75000 100000"),
3312
+ gd5("x1", "*/ x2 1 2"),
3313
+ gd5("x3", "*/ x4 1 2"),
3314
+ gd5("x5", "*/ x6 1 2"),
3315
+ gd5("x7", "+- r 0 x6"),
3316
+ gd5("x8", "*/ x7 1 2"),
3317
+ gd5("x9", "+- x6 x8 0")
3318
+ ]});
3319
+ ({
3320
+ gdLst: [
3321
+ gd5("a", "pin 0 adj 50000"),
3322
+ gd5("r1", "*/ ss a 100000"),
3323
+ gd5("y1", "+- t r1 0"),
3324
+ gd5("y2", "+- b 0 r1")
3325
+ ]});
3326
+ ({
3327
+ gdLst: [
3328
+ gd5("a", "pin 0 adj 50000"),
3329
+ gd5("r1", "*/ ss a 100000"),
3330
+ gd5("x1", "+- r 0 r1"),
3331
+ gd5("y1", "+- t r1 0"),
3332
+ gd5("y2", "+- b 0 r1")
3333
+ ]});
3334
+ ({
3335
+ gdLst: [
3336
+ gd5("a1", "pin 0 adj1 50000"),
3337
+ gd5("a2", "pin 0 adj2 100000"),
3338
+ gd5("q1", "*/ ss a1 100000"),
3339
+ gd5("q2", "+- 100000 0 a2"),
3340
+ gd5("q3", "*/ q2 1 2"),
3341
+ gd5("y1", "*/ h q3 100000"),
3342
+ gd5("y3", "+- b 0 y1"),
3343
+ gd5("y2", "+- y1 q1 0"),
3344
+ gd5("y4", "+- y3 0 q1")
3345
+ ]});
3346
+ ({
3347
+ gdLst: [
3348
+ gd5("a1", "pin 0 adj1 50000"),
3349
+ gd5("a2", "pin 0 adj2 100000"),
3350
+ gd5("q1", "*/ ss a1 100000"),
3351
+ gd5("q2", "+- 100000 0 a2"),
3352
+ gd5("q3", "*/ q2 1 2"),
3353
+ gd5("y1", "*/ h q3 100000"),
3354
+ gd5("y3", "+- b 0 y1"),
3355
+ gd5("y2", "+- y1 q1 0"),
3356
+ gd5("y4", "+- y3 0 q1"),
3357
+ gd5("x1", "+- r 0 q1")
3358
+ ]});
3359
+ ({
3360
+ gdLst: [
3361
+ gd5("a", "pin 0 adj 50000"),
3362
+ gd5("r1", "*/ ss a 100000"),
3363
+ gd5("x1", "+- l r1 0"),
3364
+ gd5("x2", "+- r 0 r1"),
3365
+ gd5("y1", "+- t r1 0"),
3366
+ gd5("y2", "+- b 0 r1")
3367
+ ]});
3368
+ ({
3369
+ gdLst: [
3370
+ gd5("a", "pin 0 adj 25000"),
3371
+ gd5("q1", "*/ ss a 100000"),
3372
+ gd5("q2", "*/ h 1 2"),
3373
+ gd5("y1", "+- vc 0 q1"),
3374
+ gd5("y2", "+- vc q1 0"),
3375
+ gd5("x2", "+- l q1 0"),
3376
+ gd5("x3", "+- r 0 q1"),
3377
+ gd5("y3", "+- t q1 0"),
3378
+ gd5("y4", "+- b 0 q1")
3379
+ ]});
3380
+
3381
+ // src/core/geometry/preset-shape-definitions-curved-arrows-connectors.ts
3382
+ function gd6(name, formula) {
3383
+ const parts = formula.trim().split(/\s+/);
3384
+ return { name, formula, args: parts.slice(1) };
3385
+ }
3386
+ ({
3387
+ gdLst: [
3388
+ gd6("a1", "pin 0 adj1 100000"),
3389
+ gd6("a2", "pin 0 adj2 100000"),
3390
+ gd6("a3", "pin 0 adj3 100000"),
3391
+ gd6("th", "*/ ss a1 100000"),
3392
+ gd6("hl", "*/ h a3 100000"),
3393
+ gd6("y1", "+- b 0 hl"),
3394
+ gd6("x1", "*/ w a2 100000")
3395
+ ]});
3396
+ ({
3397
+ gdLst: [
3398
+ gd6("a1", "pin 0 adj1 100000"),
3399
+ gd6("a2", "pin 0 adj2 100000"),
3400
+ gd6("a3", "pin 0 adj3 100000"),
3401
+ gd6("th", "*/ ss a1 100000"),
3402
+ gd6("hl", "*/ w a3 100000"),
3403
+ gd6("x1", "+- l 0 0"),
3404
+ gd6("x2", "*/ w a3 100000"),
3405
+ gd6("y1", "*/ h a2 100000")
3406
+ ]});
3407
+ ({
3408
+ gdLst: [
3409
+ gd6("a1", "pin 0 adj1 100000"),
3410
+ gd6("a2", "pin 0 adj2 100000"),
3411
+ gd6("a3", "pin 0 adj3 100000"),
3412
+ gd6("th", "*/ ss a1 100000"),
3413
+ gd6("hl", "*/ h a3 100000"),
3414
+ gd6("y1", "*/ h a3 100000"),
3415
+ gd6("x1", "*/ w a2 100000")
3416
+ ]});
3417
+ ({
3418
+ gdLst: [gd6("a1", "pin 0 adj1 100000"), gd6("x1", "*/ w a1 100000")]});
3419
+ ({
3420
+ gdLst: [
3421
+ gd6("a1", "pin 0 adj1 100000"),
3422
+ gd6("a2", "pin 0 adj2 100000"),
3423
+ gd6("x1", "*/ w a1 100000"),
3424
+ gd6("y1", "*/ h a2 100000")
3425
+ ]});
3426
+ ({
3427
+ gdLst: [
3428
+ gd6("a1", "pin 0 adj1 100000"),
3429
+ gd6("a2", "pin 0 adj2 100000"),
3430
+ gd6("a3", "pin 0 adj3 100000"),
3431
+ gd6("x1", "*/ w a1 100000"),
3432
+ gd6("y1", "*/ h a2 100000"),
3433
+ gd6("x2", "*/ w a3 100000")
3434
+ ]});
3435
+
3436
+ // src/core/geometry/preset-shape-definitions-flowchart.ts
3437
+ function gd7(name, formula) {
3438
+ const parts = formula.trim().split(/\s+/);
3439
+ return { name, formula, args: parts.slice(1) };
3440
+ }
3441
+ ({
3442
+ gdLst: [gd7("ir", "*/ wd2 3 4"), gd7("ib", "*/ hd2 3 4")]});
3443
+ ({
3444
+ gdLst: [gd7("x1", "*/ ss 1 6"), gd7("x2", "+- r 0 x1"), gd7("y2", "+- b 0 x1")]});
3445
+ ({
3446
+ gdLst: [gd7("x2", "*/ w 1 8"), gd7("x3", "*/ w 7 8")]});
3447
+ ({
3448
+ gdLst: [gd7("x2", "*/ w 1 8"), gd7("y2", "*/ h 1 8")]});
3449
+ ({
3450
+ gdLst: [
3451
+ gd7("y1", "*/ h 17322 21600"),
3452
+ gd7("y2", "*/ h 20172 21600"),
3453
+ gd7("y3", "*/ h 23922 21600"),
3454
+ gd7("x1", "*/ w 9722 21600"),
3455
+ gd7("x2", "*/ w 11612 21600")
3456
+ ]});
3457
+ ({
3458
+ gdLst: [
3459
+ gd7("y1", "*/ h 18022 21600"),
3460
+ gd7("y2", "*/ h 3675 21600"),
3461
+ gd7("y3", "*/ h 23542 21600"),
3462
+ gd7("y4", "*/ h 1815 21600"),
3463
+ gd7("y5", "*/ h 16252 21600"),
3464
+ gd7("y6", "*/ h 16352 21600"),
3465
+ gd7("y7", "*/ h 14392 21600"),
3466
+ gd7("y8", "*/ h 20782 21600"),
3467
+ gd7("y9", "*/ h 14467 21600"),
3468
+ gd7("x1", "*/ w 1532 21600"),
3469
+ gd7("x2", "*/ w 20465 21600"),
3470
+ gd7("x3", "*/ w 9722 21600"),
3471
+ gd7("x4", "*/ w 11612 21600"),
3472
+ gd7("x5", "*/ w 2452 21600"),
3473
+ gd7("x6", "*/ w 3027 21600"),
3474
+ gd7("x7", "*/ w 3192 21600"),
3475
+ gd7("x8", "*/ w 20342 21600"),
3476
+ gd7("x9", "*/ w 18512 21600")
3477
+ ]});
3478
+ ({
3479
+ gdLst: [
3480
+ gd7("x1", "*/ w 1075 21600"),
3481
+ gd7("x2", "*/ w 20525 21600"),
3482
+ gd7("y1", "*/ h 17467 21600"),
3483
+ gd7("y2", "*/ h 4135 21600")
3484
+ ]});
3485
+ ({
3486
+ gdLst: [gd7("x2", "*/ w 4175 21600"), gd7("x3", "*/ w 17425 21600")]});
3487
+ ({
3488
+ gdLst: [gd7("y1", "*/ h 4118 21600")]});
3489
+ ({
3490
+ gdLst: [gd7("x1", "*/ w 4137 21600"), gd7("x2", "*/ w 17463 21600")]});
3491
+ ({
3492
+ gdLst: [gd7("idx", "*/ ss 3 4"), gd7("idy", "*/ ss 3 4")]});
3493
+ ({
3494
+ gdLst: [gd7("y1", "*/ h 17567 21600")]});
3495
+ ({
3496
+ gdLst: [gd7("x1", "*/ w 4140 21600"), gd7("y1", "*/ h 4140 21600")]});
3497
+ ({
3498
+ gdLst: [
3499
+ gd7("y1", "*/ h 2230 21600"),
3500
+ gd7("y2", "*/ h 19370 21600"),
3501
+ gd7("xc1", "*/ w 5400 21600"),
3502
+ gd7("xc2", "*/ w 16200 21600"),
3503
+ gd7("yt1", "*/ h 4470 21600"),
3504
+ gd7("yt2", "*/ h 0 21600"),
3505
+ gd7("yb1", "*/ h 17130 21600"),
3506
+ gd7("yb2", "*/ h 21600 21600")
3507
+ ]});
3508
+ ({
3509
+ gdLst: [
3510
+ gd7("idx", "*/ wd2 3 4"),
3511
+ gd7("idy", "*/ hd2 3 4"),
3512
+ gd7("il", "+- hc 0 idx"),
3513
+ gd7("ir", "+- hc idx 0"),
3514
+ gd7("it", "+- vc 0 idy"),
3515
+ gd7("ib", "+- vc idy 0")
3516
+ ]});
3517
+ ({
3518
+ gdLst: [gd7("ir", "*/ wd2 3 4"), gd7("ib", "*/ hd2 3 4")]});
3519
+ ({
3520
+ gdLst: [gd7("ir", "*/ wd2 3 4"), gd7("ib", "*/ hd2 3 4")]});
3521
+ ({
3522
+ gdLst: [gd7("x1", "*/ w 3 4"), gd7("x2", "*/ w 1 4")]});
3523
+ ({
3524
+ gdLst: [gd7("x1", "*/ w 3 4"), gd7("x2", "*/ w 1 4")]});
3525
+ ({
3526
+ gdLst: [gd7("x2", "*/ w 5 6")]});
3527
+ ({
3528
+ gdLst: [gd7("y3", "*/ h 1 8"), gd7("y4", "*/ h 7 8")]});
3529
+ ({
3530
+ gdLst: [gd7("x3", "*/ w 1 8"), gd7("x4", "*/ w 7 8")]});
3531
+ ({
3532
+ gdLst: [
3533
+ gd7("idx", "*/ ss 3 4"),
3534
+ gd7("idy", "*/ ss 3 4"),
3535
+ gd7("ang1", "val 2700000"),
3536
+ gd7("ang2", "val 18900000")
3537
+ ]});
3538
+ ({
3539
+ gdLst: [gd7("x1", "*/ w 1 6"), gd7("x2", "*/ w 5 6")]});
3540
+ ({
3541
+ gdLst: [gd7("x1", "*/ w 1 2")]});
3542
+ ({
3543
+ gdLst: [gd7("x1", "*/ w 1 6"), gd7("x2", "*/ w 5 6")]});
3544
+
3545
+ // src/core/geometry/preset-shape-definitions-misc.ts
3546
+ function gd8(name, formula) {
3547
+ const parts = formula.trim().split(/\s+/);
3548
+ return { name, formula, args: parts.slice(1) };
3549
+ }
3550
+ var FULL_RECT6 = { l: "l", t: "t", r: "r", b: "b" };
3551
+ function starTrigTable(n) {
3552
+ const total = n * 2;
3553
+ const step = Math.PI * 2 / total;
3554
+ const start = -Math.PI / 2;
3555
+ const result = [];
3556
+ for (let i = 0; i < total; i++) {
3557
+ const a = start + i * step;
3558
+ result.push({
3559
+ sin: Math.round(Math.cos(a) * 1e5),
3560
+ cos: Math.round(Math.sin(a) * 1e5)
3561
+ });
3562
+ }
3563
+ return result;
3564
+ }
3565
+ function buildStarN(n, defaultAdj) {
3566
+ const trig = starTrigTable(n);
3567
+ const gdLst = [
3568
+ gd8("a", `pin 0 adj 50000`),
3569
+ gd8("iwd2", "*/ wd2 a 50000"),
3570
+ gd8("ihd2", "*/ hd2 a 50000")
3571
+ ];
3572
+ for (let i = 0; i < trig.length; i++) {
3573
+ const t = trig[i];
3574
+ const isOuter = i % 2 === 0;
3575
+ const radiusW = isOuter ? "wd2" : "iwd2";
3576
+ const radiusH = isOuter ? "hd2" : "ihd2";
3577
+ gdLst.push(gd8(`dx${i}`, `*/ ${radiusW} ${t.sin} 100000`));
3578
+ gdLst.push(gd8(`dy${i}`, `*/ ${radiusH} ${t.cos} 100000`));
3579
+ gdLst.push(gd8(`x${i}`, `+- hc dx${i} 0`));
3580
+ gdLst.push(gd8(`y${i}`, `+- vc dy${i} 0`));
3581
+ }
3582
+ const commands = [{ kind: "moveTo", x: "x0", y: "y0" }];
3583
+ for (let i = 1; i < trig.length; i++) {
3584
+ commands.push({ kind: "lnTo", x: `x${i}`, y: `y${i}` });
3585
+ }
3586
+ commands.push({ kind: "close" });
3587
+ return {
3588
+ name: `star${n}`,
3589
+ avLst: { adj: defaultAdj },
3590
+ gdLst,
3591
+ rect: FULL_RECT6,
3592
+ pathLst: [{ commands }]
3593
+ };
3594
+ }
3595
+ buildStarN(6, 28868);
3596
+ buildStarN(7, 34601);
3597
+ buildStarN(8, 37500);
3598
+ buildStarN(10, 42533);
3599
+ buildStarN(12, 37500);
3600
+ buildStarN(16, 37500);
3601
+ buildStarN(24, 37500);
3602
+ buildStarN(32, 37500);
3603
+ ({
3604
+ gdLst: [
3605
+ gd8("a1", "pin 0 adj1 33333"),
3606
+ gd8("a2", "pin 25000 adj2 75000"),
3607
+ gd8("x10", "+- r 0 wd8"),
3608
+ gd8("dx2", "*/ w a2 200000"),
3609
+ gd8("x2", "+- hc 0 dx2"),
3610
+ gd8("x9", "+- hc dx2 0"),
3611
+ gd8("x3", "+- x2 wd32 0"),
3612
+ gd8("x8", "+- x9 0 wd32"),
3613
+ gd8("x5", "+- x2 wd8 0"),
3614
+ gd8("x6", "+- x9 0 wd8"),
3615
+ gd8("x4", "+- x5 0 wd32"),
3616
+ gd8("x7", "+- x6 wd32 0"),
3617
+ gd8("y1", "*/ h a1 200000"),
3618
+ gd8("y2", "*/ h a1 100000"),
3619
+ gd8("y4", "+- b 0 y2"),
3620
+ gd8("y3", "+- y4 0 y1")
3621
+ ]});
3622
+ ({
3623
+ gdLst: [
3624
+ gd8("a1", "pin 0 adj1 33333"),
3625
+ gd8("a2", "pin 25000 adj2 75000"),
3626
+ gd8("x10", "+- r 0 wd8"),
3627
+ gd8("dx2", "*/ w a2 200000"),
3628
+ gd8("x2", "+- hc 0 dx2"),
3629
+ gd8("x9", "+- hc dx2 0"),
3630
+ gd8("x3", "+- x2 wd32 0"),
3631
+ gd8("x8", "+- x9 0 wd32"),
3632
+ gd8("x5", "+- x2 wd8 0"),
3633
+ gd8("x6", "+- x9 0 wd8"),
3634
+ gd8("x4", "+- x5 0 wd32"),
3635
+ gd8("x7", "+- x6 wd32 0"),
3636
+ gd8("y1", "*/ h a1 200000"),
3637
+ gd8("y2", "*/ h a1 100000"),
3638
+ gd8("y3", "+- t y2 0"),
3639
+ gd8("y4", "+- t y1 y2")
3640
+ ]});
3641
+ ({
3642
+ gdLst: [
3643
+ gd8("a1", "pin 0 adj1 100000"),
3644
+ gd8("a2", "pin 25000 adj2 75000"),
3645
+ gd8("a3", "pin 0 adj3 50000"),
3646
+ gd8("q10", "+- 100000 0 a1"),
3647
+ gd8("q11", "*/ q10 1 2"),
3648
+ gd8("q12", "+- a1 0 q11"),
3649
+ gd8("minAdj3", "*/ q12 -1 1"),
3650
+ gd8("aa3", "pin minAdj3 a3 a1"),
3651
+ gd8("dx2", "*/ w a2 200000"),
3652
+ gd8("x2", "+- hc 0 dx2"),
3653
+ gd8("x9", "+- hc dx2 0"),
3654
+ gd8("x3", "+- x2 wd32 0"),
3655
+ gd8("x8", "+- x9 0 wd32"),
3656
+ gd8("x5", "+- x2 wd8 0"),
3657
+ gd8("x6", "+- x9 0 wd8"),
3658
+ gd8("x4", "+- x5 0 wd32"),
3659
+ gd8("x7", "+- x6 wd32 0"),
3660
+ gd8("x1", "+- l wd8 0"),
3661
+ gd8("x10", "+- r 0 wd8"),
3662
+ gd8("y1", "*/ h a3 100000"),
3663
+ gd8("y3", "*/ h a1 100000"),
3664
+ gd8("y2", "+- y3 0 y1"),
3665
+ gd8("u1", "*/ y3 1 2"),
3666
+ gd8("y4", "+- b 0 u1")
3667
+ ]});
3668
+ ({
3669
+ gdLst: [
3670
+ gd8("a1", "pin 0 adj1 100000"),
3671
+ gd8("a2", "pin 25000 adj2 75000"),
3672
+ gd8("a3", "pin 0 adj3 50000"),
3673
+ gd8("dx2", "*/ w a2 200000"),
3674
+ gd8("x2", "+- hc 0 dx2"),
3675
+ gd8("x9", "+- hc dx2 0"),
3676
+ gd8("x3", "+- x2 wd32 0"),
3677
+ gd8("x8", "+- x9 0 wd32"),
3678
+ gd8("x5", "+- x2 wd8 0"),
3679
+ gd8("x6", "+- x9 0 wd8"),
3680
+ gd8("x4", "+- x5 0 wd32"),
3681
+ gd8("x7", "+- x6 wd32 0"),
3682
+ gd8("x1", "+- l wd8 0"),
3683
+ gd8("x10", "+- r 0 wd8"),
3684
+ gd8("y1", "+- b 0 hd8"),
3685
+ gd8("y3", "*/ h a1 100000"),
3686
+ gd8("y4", "+- b 0 y3"),
3687
+ gd8("y5", "+- y4 hd8 0"),
3688
+ gd8("y6", "+- t hd16 0")
3689
+ ]});
3690
+ ({
3691
+ gdLst: [
3692
+ gd8("a3", "pin 0 adj3 75000"),
3693
+ gd8("a1", "pin 0 adj1 100000"),
3694
+ gd8("w1", "*/ w a3 200000"),
3695
+ gd8("a2", "pin 25000 adj2 75000"),
3696
+ gd8("x1", "+- l hd8 0"),
3697
+ gd8("x4", "+- r 0 hd8"),
3698
+ gd8("dy2", "*/ h a1 200000"),
3699
+ gd8("y2", "+- vc 0 dy2"),
3700
+ gd8("y3", "+- vc dy2 0"),
3701
+ gd8("y1", "+- y2 hd16 0"),
3702
+ gd8("y4", "+- y3 0 hd16"),
3703
+ gd8("x2", "+- l w1 0"),
3704
+ gd8("x3", "+- r 0 w1"),
3705
+ gd8("x5", "+- x2 hd8 0"),
3706
+ gd8("x6", "+- x3 0 hd8")
3707
+ ]});
3708
+ var callout1 = {
3709
+ gdLst: [
3710
+ gd8("y1", "*/ h adj1 100000"),
3711
+ gd8("x1", "*/ w adj2 100000"),
3712
+ gd8("y2", "*/ h adj3 100000"),
3713
+ gd8("x2", "*/ w adj4 100000")
3714
+ ]};
3715
+ var callout2 = {
3716
+ avLst: {
3717
+ },
3718
+ gdLst: [
3719
+ gd8("y1", "*/ h adj1 100000"),
3720
+ gd8("x1", "*/ w adj2 100000"),
3721
+ gd8("y2", "*/ h adj3 100000"),
3722
+ gd8("x2", "*/ w adj4 100000"),
3723
+ gd8("y3", "*/ h adj5 100000"),
3724
+ gd8("x3", "*/ w adj6 100000")
3725
+ ]};
3726
+ var callout3 = {
3727
+ avLst: {
3728
+ },
3729
+ gdLst: [
3730
+ gd8("y1", "*/ h adj1 100000"),
3731
+ gd8("x1", "*/ w adj2 100000"),
3732
+ gd8("y2", "*/ h adj3 100000"),
3733
+ gd8("x2", "*/ w adj4 100000"),
3734
+ gd8("y3", "*/ h adj5 100000"),
3735
+ gd8("x3", "*/ w adj6 100000"),
3736
+ gd8("y4", "*/ h adj7 100000"),
3737
+ gd8("x4", "*/ w adj8 100000")
3738
+ ]};
3739
+ ({
3740
+ gdLst: callout1.gdLst});
3741
+ ({
3742
+ avLst: callout2.avLst,
3743
+ gdLst: callout2.gdLst});
3744
+ ({
3745
+ avLst: callout3.avLst,
3746
+ gdLst: callout3.gdLst});
3747
+ ({
3748
+ gdLst: [
3749
+ gd8("a", "pin -4653 adj 4653"),
3750
+ gd8("x1", "*/ w 4969 21699"),
3751
+ gd8("x2", "*/ w 6215 21600"),
3752
+ gd8("x3", "*/ w 13135 21600"),
3753
+ gd8("x4", "*/ w 14385 21600"),
3754
+ gd8("y1", "*/ h 7570 21600"),
3755
+ gd8("y3", "*/ h 16515 21600"),
3756
+ gd8("dy2", "*/ h a 100000"),
3757
+ gd8("y2", "+- y3 0 dy2"),
3758
+ gd8("y4", "+- y3 dy2 0"),
3759
+ gd8("dx1", "*/ wd2 18436 21600"),
3760
+ gd8("dx2", "*/ wd2 3163 21600"),
3761
+ gd8("dy1", "*/ hd2 7977 21600")
3762
+ ]});
3763
+ ({
3764
+ gdLst: [
3765
+ gd8("a", "pin 12500 adj 46875"),
3766
+ gd8("g0", "*/ ss a 50000"),
3767
+ gd8("g1", "+- wd2 0 g0"),
3768
+ gd8("g2", "+- hd2 0 g0"),
3769
+ gd8("g3", "*/ g0 30274 32768"),
3770
+ gd8("g4", "*/ g0 12540 32768"),
3771
+ gd8("g5", "+- wd2 0 g3"),
3772
+ gd8("g6", "+- wd2 0 g4"),
3773
+ gd8("g7", "+- hd2 0 g3"),
3774
+ gd8("g8", "+- hd2 0 g4"),
3775
+ gd8("g9", "+- wd2 g3 0"),
3776
+ gd8("g10", "+- wd2 g4 0"),
3777
+ gd8("g11", "+- hd2 g3 0"),
3778
+ gd8("g12", "+- hd2 g4 0"),
3779
+ gd8("g13", "*/ g0 23170 32768"),
3780
+ gd8("g14", "+- wd2 0 g13"),
3781
+ gd8("g15", "+- hd2 0 g13"),
3782
+ gd8("g16", "+- wd2 g13 0"),
3783
+ gd8("g17", "+- hd2 g13 0"),
3784
+ gd8("cx", "val wd2"),
3785
+ gd8("cy", "val hd2")
3786
+ ]});
3787
+ ({
3788
+ gdLst: [
3789
+ gd8("a", "pin 0 adj 87500"),
3790
+ gd8("g0", "*/ ss a 100000"),
3791
+ gd8("g1", "+- wd2 0 g0"),
3792
+ gd8("g2", "*/ g1 1 2")
3793
+ ]});
3794
+ ({
3795
+ gdLst: [
3796
+ gd8("a1", "pin 0 adj1 73490"),
3797
+ gd8("dy1", "*/ ss a1 200000"),
3798
+ gd8("dx1", "*/ w 73490 200000"),
3799
+ gd8("y1", "+- vc 0 dy1"),
3800
+ gd8("y2", "+- vc dy1 0"),
3801
+ gd8("x1", "+- hc 0 dx1"),
3802
+ gd8("x2", "+- hc dx1 0")
3803
+ ]});
3804
+ ({
3805
+ gdLst: [
3806
+ gd8("a1", "pin 0 adj1 73490"),
3807
+ gd8("dy1", "*/ ss a1 200000"),
3808
+ gd8("dx1", "*/ w a1 200000"),
3809
+ gd8("y1", "+- vc 0 dy1"),
3810
+ gd8("y2", "+- vc dy1 0"),
3811
+ gd8("x1", "+- hc 0 dx1"),
3812
+ gd8("x2", "+- hc dx1 0")
3813
+ ]});
3814
+ ({
3815
+ gdLst: [
3816
+ gd8("a1", "pin 0 adj1 100000"),
3817
+ gd8("dy1", "*/ h a1 200000"),
3818
+ gd8("y1", "+- vc 0 dy1"),
3819
+ gd8("y2", "+- vc dy1 0")
3820
+ ]});
3821
+ ({
3822
+ gdLst: [
3823
+ gd8("a1", "pin 0 adj1 51965"),
3824
+ // 45° rotation: half bar thickness in each axis.
3825
+ gd8("th", "*/ ss a1 100000"),
3826
+ gd8("a", "at2 w h"),
3827
+ gd8("sa", "sin 1 a"),
3828
+ gd8("ca", "cos 1 a"),
3829
+ gd8("dx1", "*/ th ca 1"),
3830
+ gd8("dy1", "*/ th sa 1"),
3831
+ gd8("x1", "+- l dx1 0"),
3832
+ gd8("x2", "+- r 0 dx1"),
3833
+ gd8("y1", "+- t dy1 0"),
3834
+ gd8("y2", "+- b 0 dy1"),
3835
+ gd8("xa", "+- hc 0 dx1"),
3836
+ gd8("xb", "+- hc dx1 0"),
3837
+ gd8("ya", "+- vc 0 dy1"),
3838
+ gd8("yb", "+- vc dy1 0")
3839
+ ]});
3840
+ ({
3841
+ gdLst: [
3842
+ gd8("a1", "pin 1000 adj1 36745"),
3843
+ gd8("a2", "pin 1000 adj2 50000"),
3844
+ gd8("a3", "pin 1000 adj3 50000"),
3845
+ gd8("dy1", "*/ h a1 200000"),
3846
+ gd8("y1", "+- vc 0 dy1"),
3847
+ gd8("y2", "+- vc dy1 0"),
3848
+ gd8("rad", "*/ ss a2 200000"),
3849
+ gd8("dy2", "*/ h a3 100000"),
3850
+ gd8("y3", "+- t dy2 0"),
3851
+ gd8("y4", "+- b 0 dy2")
3852
+ ]});
3853
+ ({
3854
+ gdLst: [
3855
+ gd8("a1", "pin 0 adj1 36745"),
3856
+ gd8("a2", "pin 0 adj2 50000"),
3857
+ gd8("dy1", "*/ h a1 100000"),
3858
+ gd8("dy2", "*/ h a2 100000"),
3859
+ gd8("y1", "+- vc 0 dy2"),
3860
+ gd8("y2", "+- y1 0 dy1"),
3861
+ gd8("y3", "+- vc dy2 0"),
3862
+ gd8("y4", "+- y3 dy1 0")
3863
+ ]});
3864
+ ({
3865
+ gdLst: [
3866
+ gd8("a1", "pin 0 adj1 50000"),
3867
+ gd8("a3", "pin 0 adj3 50000"),
3868
+ gd8("dy1", "*/ h a1 100000"),
3869
+ gd8("dy2", "*/ h a3 100000"),
3870
+ gd8("y1", "+- vc 0 dy2"),
3871
+ gd8("y2", "+- y1 0 dy1"),
3872
+ gd8("y3", "+- vc dy2 0"),
3873
+ gd8("y4", "+- y3 dy1 0"),
3874
+ gd8("th", "*/ ss a1 100000"),
3875
+ gd8("dx5", "*/ wd2 60000 100000"),
3876
+ gd8("dy5", "*/ hd2 80000 100000"),
3877
+ gd8("x5", "+- hc 0 dx5"),
3878
+ gd8("x6", "+- hc dx5 0"),
3879
+ gd8("y5", "+- vc dy5 0"),
3880
+ gd8("y6", "+- vc 0 dy5")
3881
+ ]});
3882
+ function buildIrregularSeal(name, points) {
3883
+ const commands = [];
3884
+ const first = points[0];
3885
+ if (!first) {
3886
+ return {
3887
+ name,
3888
+ rect: FULL_RECT6,
3889
+ pathLst: [{ commands: [{ kind: "close" }] }]
3890
+ };
3891
+ }
3892
+ commands.push({ kind: "moveTo", x: String(first[0]), y: String(first[1]) });
3893
+ for (let i = 1; i < points.length; i++) {
3894
+ const p = points[i];
3895
+ commands.push({ kind: "lnTo", x: String(p[0]), y: String(p[1]) });
3896
+ }
3897
+ commands.push({ kind: "close" });
3898
+ return {
3899
+ name,
3900
+ rect: { l: "4290", t: "4570", r: "17260", b: "17000" },
3901
+ pathLst: [{ w: 21600, h: 21600, commands }]
3902
+ };
3903
+ }
3904
+ buildIrregularSeal("irregularSeal1", [
3905
+ [10800, 5800],
3906
+ [14522, 0],
3907
+ [14155, 5325],
3908
+ [18380, 4457],
3909
+ [16702, 7315],
3910
+ [21097, 8137],
3911
+ [17607, 10475],
3912
+ [21600, 13290],
3913
+ [16837, 12942],
3914
+ [18145, 18095],
3915
+ [14020, 14457],
3916
+ [13247, 19737],
3917
+ [10532, 14935],
3918
+ [8485, 21600],
3919
+ [7715, 15627],
3920
+ [4762, 17617],
3921
+ [5667, 13937],
3922
+ [135, 14587],
3923
+ [3722, 11775],
3924
+ [0, 8615],
3925
+ [4627, 7617],
3926
+ [370, 2295],
3927
+ [7312, 6320],
3928
+ [8352, 2295]
3929
+ ]);
3930
+ buildIrregularSeal("irregularSeal2", [
3931
+ [11462, 4342],
3932
+ [14790, 0],
3933
+ [14525, 5777],
3934
+ [18007, 3172],
3935
+ [16380, 6532],
3936
+ [20945, 4327],
3937
+ [18482, 8615],
3938
+ [21600, 6970],
3939
+ [19465, 11042],
3940
+ [20720, 12877],
3941
+ [18375, 12825],
3942
+ [18990, 16702],
3943
+ [16380, 14060],
3944
+ [14907, 19260],
3945
+ [13042, 14935],
3946
+ [10817, 21600],
3947
+ [10532, 15422],
3948
+ [6760, 19412],
3949
+ [7507, 13937],
3950
+ [2475, 17945],
3951
+ [5060, 12842],
3952
+ [565, 13687],
3953
+ [3265, 10350],
3954
+ [0, 7507],
3955
+ [3617, 6962],
3956
+ [1305, 3220],
3957
+ [5852, 5285],
3958
+ [6727, 0]
3959
+ ]);
3960
+
3961
+ // src/core/geometry/preset-shape-definitions-rects-snips.ts
3962
+ function gd9(name, formula) {
3963
+ const parts = formula.trim().split(/\s+/);
3964
+ return { name, formula, args: parts.slice(1) };
3965
+ }
3966
+ ({
3967
+ gdLst: [gd9("a", "pin 0 adj 50000"), gd9("x2", "*/ ss a 100000"), gd9("x1", "+- r 0 x2")]});
3968
+ ({
3969
+ gdLst: [
3970
+ gd9("a1", "pin 0 adj1 50000"),
3971
+ gd9("a2", "pin 0 adj2 50000"),
3972
+ gd9("x1", "*/ ss a1 100000"),
3973
+ gd9("x2", "+- r 0 x1"),
3974
+ gd9("x3", "*/ ss a2 100000"),
3975
+ gd9("x4", "+- r 0 x3")
3976
+ ]});
3977
+ ({
3978
+ gdLst: [
3979
+ gd9("a1", "pin 0 adj1 50000"),
3980
+ gd9("a2", "pin 0 adj2 50000"),
3981
+ gd9("x1", "*/ ss a1 100000"),
3982
+ gd9("y1", "+- b 0 x1"),
3983
+ gd9("x2", "*/ ss a2 100000"),
3984
+ gd9("x3", "+- r 0 x2"),
3985
+ gd9("y2", "+- b 0 x2")
3986
+ ]});
3987
+ ({
3988
+ gdLst: [
3989
+ gd9("a1", "pin 0 adj1 50000"),
3990
+ gd9("a2", "pin 0 adj2 50000"),
3991
+ gd9("x1", "*/ ss a1 100000"),
3992
+ gd9("x2", "*/ ss a2 100000"),
3993
+ gd9("x3", "+- r 0 x2")
3994
+ ]});
3995
+ ({
3996
+ gdLst: [gd9("a", "pin 0 adj 50000"), gd9("x1", "*/ ss a 100000"), gd9("dx1", "+- r 0 x1")]});
3997
+ ({
3998
+ gdLst: [
3999
+ gd9("a1", "pin 0 adj1 50000"),
4000
+ gd9("a2", "pin 0 adj2 50000"),
4001
+ gd9("x1", "*/ ss a1 100000"),
4002
+ gd9("x2", "+- r 0 x1"),
4003
+ gd9("x3", "*/ ss a2 100000"),
4004
+ gd9("x4", "+- r 0 x3")
4005
+ ]});
4006
+ ({
4007
+ gdLst: [
4008
+ gd9("a1", "pin 0 adj1 50000"),
4009
+ gd9("a2", "pin 0 adj2 50000"),
4010
+ gd9("x1", "*/ ss a1 100000"),
4011
+ gd9("x2", "+- r 0 x1"),
4012
+ gd9("x3", "*/ ss a2 100000"),
4013
+ gd9("x4", "+- r 0 x3"),
4014
+ gd9("y1", "+- b 0 x3"),
4015
+ gd9("y2", "+- b 0 x1")
4016
+ ]});
4017
+ ({
4018
+ gdLst: [
4019
+ gd9("a", "pin 0 adj 50000"),
4020
+ gd9("dy2", "*/ ss a 100000"),
4021
+ gd9("dy1", "*/ dy2 1 5"),
4022
+ gd9("x1", "+- r 0 dy2"),
4023
+ gd9("x2", "+- x1 dy1 0"),
4024
+ gd9("x3", "+- r 0 dy1"),
4025
+ gd9("y2", "+- b 0 dy2"),
4026
+ gd9("y1", "+- y2 dy1 0"),
4027
+ gd9("y3", "+- b 0 dy1")
4028
+ ]});
4029
+ ({
4030
+ gdLst: [
4031
+ gd9("a", "pin 0 adj 200000"),
4032
+ gd9("dx1", "*/ wd2 a 100000"),
4033
+ gd9("dy1", "*/ hd2 a 100000"),
4034
+ gd9("x1", "+- hc dx1 0"),
4035
+ gd9("y1", "+- vc 0 dy1")
4036
+ ]});
4037
+ ({
4038
+ gdLst: [
4039
+ gd9("a1", "pin 0 adj1 100000"),
4040
+ gd9("a2", "pin 0 adj2 100000"),
4041
+ gd9("x1", "*/ w a2 100000"),
4042
+ gd9("dy1", "*/ h a1 100000"),
4043
+ gd9("y1", "+- b 0 dy1")
4044
+ ]});
4045
+
4046
+ // src/core/geometry/preset-shape-definitions-scrolls-accent-callouts.ts
4047
+ function gd10(name, formula) {
4048
+ const parts = formula.trim().split(/\s+/);
4049
+ return { name, formula, args: parts.slice(1) };
4050
+ }
4051
+ ({
4052
+ gdLst: [
4053
+ gd10("a", "pin 0 adj 25000"),
4054
+ gd10("ch", "*/ ss a 100000"),
4055
+ gd10("ch2", "*/ ch 1 2"),
4056
+ gd10("ch4", "*/ ch 1 4"),
4057
+ gd10("x3", "+- ch ch2 0"),
4058
+ gd10("x4", "+- ch ch 0"),
4059
+ gd10("x6", "+- r 0 ch"),
4060
+ gd10("x7", "+- r 0 ch2"),
4061
+ gd10("x5", "+- x6 0 ch2"),
4062
+ gd10("y3", "+- b 0 ch"),
4063
+ gd10("y4", "+- b 0 ch2")
4064
+ ]});
4065
+ ({
4066
+ gdLst: [
4067
+ gd10("a", "pin 0 adj 25000"),
4068
+ gd10("ch", "*/ ss a 100000"),
4069
+ gd10("ch2", "*/ ch 1 2"),
4070
+ gd10("ch4", "*/ ch 1 4"),
4071
+ gd10("y3", "+- ch ch2 0"),
4072
+ gd10("y4", "+- ch ch 0"),
4073
+ gd10("y6", "+- b 0 ch"),
4074
+ gd10("y7", "+- b 0 ch2"),
4075
+ gd10("y5", "+- y6 0 ch2"),
4076
+ gd10("x3", "+- r 0 ch"),
4077
+ gd10("x4", "+- r 0 ch2")
4078
+ ]});
4079
+ ({
4080
+ gdLst: [
4081
+ gd10("a1", "pin 0 adj1 20000"),
4082
+ gd10("a2", "pin -10000 adj2 10000"),
4083
+ gd10("y1", "*/ h a1 100000"),
4084
+ // amplitude
4085
+ gd10("y2", "+- t y1 0"),
4086
+ // top of left peak
4087
+ gd10("y3", "+- b 0 y1"),
4088
+ // bottom of left peak
4089
+ gd10("y4", "+- b y1 0"),
4090
+ // upper bound of bottom-edge swing
4091
+ gd10("y5", "+- t 0 y1"),
4092
+ // lower bound of top-edge swing
4093
+ gd10("dx2", "*/ w a2 100000"),
4094
+ // phase shift in EMU
4095
+ gd10("xAdj", "+- hc dx2 0"),
4096
+ // mid-x with phase
4097
+ gd10("x3", "+- xAdj 0 hc"),
4098
+ gd10("x4", "+- r x3 0"),
4099
+ // right peak x
4100
+ gd10("x5", "+- l x3 0"),
4101
+ // left peak x
4102
+ gd10("x6", "+- xAdj wd2 0"),
4103
+ gd10("x7", "+- xAdj 0 wd2")
4104
+ ]});
4105
+ ({
4106
+ gdLst: [
4107
+ gd10("a1", "pin 0 adj1 10000"),
4108
+ gd10("a2", "pin -10000 adj2 10000"),
4109
+ gd10("y1", "*/ h a1 100000"),
4110
+ gd10("y2", "+- t y1 0"),
4111
+ gd10("y3", "+- b 0 y1"),
4112
+ gd10("y4", "+- b y1 0"),
4113
+ gd10("y5", "+- t 0 y1"),
4114
+ gd10("dx2", "*/ w a2 100000"),
4115
+ gd10("xAdj", "+- hc dx2 0"),
4116
+ gd10("x3", "+- xAdj 0 hc"),
4117
+ gd10("x4", "+- r x3 0"),
4118
+ gd10("x5", "+- l x3 0"),
4119
+ // quarter-width control points for two-hump bezier.
4120
+ gd10("q1", "*/ w 1 4"),
4121
+ gd10("q2", "*/ w 3 4"),
4122
+ gd10("cx1", "+- l q1 0"),
4123
+ gd10("cx2", "+- l q2 0"),
4124
+ gd10("cx3", "+- l hd2 0")
4125
+ ]});
4126
+ var accentCallout1 = {
4127
+ gdLst: [
4128
+ gd10("y1", "*/ h adj1 100000"),
4129
+ gd10("x1", "*/ w adj2 100000"),
4130
+ gd10("y2", "*/ h adj3 100000"),
4131
+ gd10("x2", "*/ w adj4 100000")
4132
+ ]};
4133
+ var accentCallout2 = {
4134
+ avLst: {
4135
+ },
4136
+ gdLst: [
4137
+ gd10("y1", "*/ h adj1 100000"),
4138
+ gd10("x1", "*/ w adj2 100000"),
4139
+ gd10("y2", "*/ h adj3 100000"),
4140
+ gd10("x2", "*/ w adj4 100000"),
4141
+ gd10("y3", "*/ h adj5 100000"),
4142
+ gd10("x3", "*/ w adj6 100000")
4143
+ ]};
4144
+ var accentCallout3 = {
4145
+ avLst: {
4146
+ },
4147
+ gdLst: [
4148
+ gd10("y1", "*/ h adj1 100000"),
4149
+ gd10("x1", "*/ w adj2 100000"),
4150
+ gd10("y2", "*/ h adj3 100000"),
4151
+ gd10("x2", "*/ w adj4 100000"),
4152
+ gd10("y3", "*/ h adj5 100000"),
4153
+ gd10("x3", "*/ w adj6 100000"),
4154
+ gd10("y4", "*/ h adj7 100000"),
4155
+ gd10("x4", "*/ w adj8 100000")
4156
+ ]};
4157
+ ({
4158
+ gdLst: accentCallout1.gdLst});
4159
+ ({
4160
+ avLst: accentCallout2.avLst,
4161
+ gdLst: accentCallout2.gdLst});
4162
+ ({
4163
+ avLst: accentCallout3.avLst,
4164
+ gdLst: accentCallout3.gdLst});
4165
+
4166
+ // src/core/geometry/preset-shape-definitions-tabs-decorations.ts
4167
+ function gd11(name, formula) {
4168
+ const parts = formula.trim().split(/\s+/);
4169
+ return { name, formula, args: parts.slice(1) };
4170
+ }
4171
+ var FULL_RECT9 = { l: "l", t: "t", r: "r", b: "b" };
4172
+ ({
4173
+ gdLst: [gd11("x1", "*/ w 1 8"), gd11("x2", "+- r 0 x1"), gd11("y1", "*/ h 1 8"), gd11("y2", "+- b 0 y1")]});
4174
+ ({
4175
+ gdLst: [
4176
+ // Tab half-width / half-height in shape coords.
4177
+ gd11("thw", "*/ w 1 16"),
4178
+ gd11("thh", "*/ h 1 16"),
4179
+ // Centred tab spans on each axis.
4180
+ gd11("xa", "+- hc 0 thw"),
4181
+ gd11("xb", "+- hc thw 0"),
4182
+ gd11("ya", "+- vc 0 thh"),
4183
+ gd11("yb", "+- vc thh 0"),
4184
+ // Inset edges for the right and bottom tabs.
4185
+ gd11("rt", "+- r 0 thw"),
4186
+ gd11("bt", "+- b 0 thh")
4187
+ ]});
4188
+ ({
4189
+ gdLst: [
4190
+ gd11("thw", "*/ w 1 16"),
4191
+ gd11("thh", "*/ h 1 16"),
4192
+ gd11("xa", "+- hc 0 thw"),
4193
+ gd11("xb", "+- hc thw 0"),
4194
+ gd11("ya", "+- vc 0 thh"),
4195
+ gd11("yb", "+- vc thh 0"),
4196
+ gd11("lt", "+- l thw 0"),
4197
+ gd11("rt", "+- r 0 thw"),
4198
+ gd11("tt", "+- t thh 0"),
4199
+ gd11("bt", "+- b 0 thh")
4200
+ ]});
4201
+ ({
4202
+ gdLst: [gd11("a", "pin 0 adj 100000"), gd11("x2", "*/ w a 100000"), gd11("y2", "*/ h a 100000")]});
4203
+ ({
4204
+ gdLst: [
4205
+ gd11("a", "pin 0 adj 50000"),
4206
+ gd11("x1", "*/ ss a 100000"),
4207
+ gd11("x2", "+- r 0 x1"),
4208
+ gd11("y2", "+- b 0 x1")
4209
+ ]});
4210
+ function buildGearN(n, defaultAdj) {
4211
+ const total = n * 4;
4212
+ const step = Math.PI * 2 / total;
4213
+ const start = -Math.PI / 2 - step / 2;
4214
+ const verts = [];
4215
+ for (let i = 0; i < total; i++) {
4216
+ const a = start + i * step;
4217
+ verts.push({
4218
+ // sin of polar angle is the x component (right is +); cos is y (down +
4219
+ // in OOXML). Match conventions used by buildStarN in the misc batch.
4220
+ sin: Math.round(Math.cos(a) * 1e5),
4221
+ cos: Math.round(Math.sin(a) * 1e5)
4222
+ });
4223
+ }
4224
+ const gdLst = [
4225
+ gd11("a", `pin 0 adj 50000`),
4226
+ gd11("iwd2", "*/ wd2 a 50000"),
4227
+ gd11("ihd2", "*/ hd2 a 50000"),
4228
+ // Inner radii: outer minus tooth depth.
4229
+ gd11("owd2", "val wd2"),
4230
+ gd11("ohd2", "val hd2"),
4231
+ gd11("inwd2", "+- wd2 0 iwd2"),
4232
+ gd11("inhd2", "+- hd2 0 ihd2")
4233
+ ];
4234
+ const commands = [];
4235
+ for (let i = 0; i < total; i++) {
4236
+ const v = verts[i];
4237
+ const isOuter = i % 4 === 0 || i % 4 === 1;
4238
+ const rxName = `r${i}x`;
4239
+ const ryName = `r${i}y`;
4240
+ const wd = isOuter ? "wd2" : "inwd2";
4241
+ const hd = isOuter ? "hd2" : "inhd2";
4242
+ gdLst.push(gd11(rxName, `*/ ${wd} ${v.sin} 100000`), gd11(ryName, `*/ ${hd} ${v.cos} 100000`));
4243
+ const xVar = `gx${i}`;
4244
+ const yVar = `gy${i}`;
4245
+ gdLst.push(gd11(xVar, `+- hc ${rxName} 0`), gd11(yVar, `+- vc ${ryName} 0`));
4246
+ if (i === 0) {
4247
+ commands.push({ kind: "moveTo", x: xVar, y: yVar });
4248
+ } else {
4249
+ commands.push({ kind: "lnTo", x: xVar, y: yVar });
4250
+ }
4251
+ }
4252
+ commands.push({ kind: "close" });
4253
+ return {
4254
+ name: `gear${n}`,
4255
+ avLst: { adj: defaultAdj },
4256
+ gdLst,
4257
+ rect: FULL_RECT9,
4258
+ pathLst: [{ commands }]
4259
+ };
4260
+ }
4261
+ buildGearN(6, 15e3);
4262
+ buildGearN(9, 1e4);
4263
+ ({
4264
+ gdLst: [gd11("xn", "*/ w 40 100"), gd11("xx", "*/ w 60 100"), gd11("ym", "*/ h 40 100")]});
4265
+ ({
4266
+ gdLst: [
4267
+ gd11("x1", "*/ w 30 100"),
4268
+ gd11("x2", "*/ w 55 100"),
4269
+ gd11("x3", "*/ w 70 100"),
4270
+ gd11("x4", "*/ w 85 100"),
4271
+ gd11("y1", "*/ h 25 100"),
4272
+ gd11("y2", "*/ h 50 100"),
4273
+ gd11("y3", "*/ h 75 100")
4274
+ ]});
4275
+ ({
4276
+ gdLst: [
4277
+ gd11("a", "pin 0 adj 100000"),
4278
+ // Top-left vertex at `adj * w / 200000` from the left.
4279
+ gd11("x1", "*/ w a 200000"),
4280
+ // Top-right vertex at the same offset in from the right; produces an
4281
+ // isosceles trapezoid when adj==50000 and a skewed one otherwise.
4282
+ gd11("x2", "+- r 0 x1"),
4283
+ // Slight horizontal offset that shifts the top edge for visual
4284
+ // asymmetry — mirrors PowerPoint's default rendering, which biases the
4285
+ // top edge slightly to one side at adj1==50000.
4286
+ gd11("dx", "*/ w 5 100"),
4287
+ gd11("x3", "+- x1 0 dx"),
4288
+ gd11("x4", "+- x2 0 dx"),
4289
+ gd11("xt", "*/ x3 1 2"),
4290
+ gd11("xtb", "+- r 0 xt")
4291
+ ]});
4292
+
4293
+ // src/core/geometry/preset-shape-definitions-table.ts
4294
+ function gd12(name, formula) {
4295
+ const parts = formula.trim().split(/\s+/);
4296
+ return { name, formula, args: parts.slice(1) };
4297
+ }
4298
+ ({
4299
+ gdLst: [
4300
+ gd12("a", "pin 0 adj 50000"),
4301
+ gd12("x1", "*/ ss a 100000"),
4302
+ gd12("x2", "+- r 0 x1"),
4303
+ gd12("y2", "+- b 0 x1")
4304
+ ]});
4305
+ ({
4306
+ gdLst: [gd12("idx", "*/ ss 3 4"), gd12("idy", "*/ ls 3 4")]});
4307
+ ({
4308
+ gdLst: [gd12("a", "pin 0 adj 100000"), gd12("x1", "*/ w a 100000")]});
4309
+ ({
4310
+ gdLst: [
4311
+ gd12("a", "pin 0 adj 100000"),
4312
+ gd12("x1", "*/ w a 200000"),
4313
+ gd12("x2", "+- w 0 x1"),
4314
+ gd12("x3", "*/ w a 100000"),
4315
+ gd12("x4", "+- r 0 x3"),
4316
+ gd12("x5", "*/ x3 1 2"),
4317
+ gd12("x6", "+- r 0 x5")
4318
+ ]});
4319
+ ({
4320
+ gdLst: [
4321
+ gd12("a", "pin 0 adj 100000"),
4322
+ gd12("x1", "*/ w a 200000"),
4323
+ gd12("x2", "+- r 0 x1"),
4324
+ gd12("x3", "*/ x1 1 2"),
4325
+ gd12("x4", "+- r 0 x3")
4326
+ ]});
4327
+ ({
4328
+ gdLst: [gd12("ir", "*/ wd2 1 2"), gd12("it", "*/ hd2 1 2")]});
4329
+ ({
4330
+ gdLst: [
4331
+ gd12("hf", "val 105146"),
4332
+ gd12("vf", "val 110557"),
4333
+ gd12("swd2", "*/ wd2 hf 100000"),
4334
+ gd12("shd2", "*/ hd2 vf 100000"),
4335
+ gd12("dx1", "*/ swd2 95106 100000"),
4336
+ gd12("dx2", "*/ swd2 58779 100000"),
4337
+ gd12("dy1", "*/ shd2 80902 100000"),
4338
+ gd12("dy2", "*/ shd2 30902 100000"),
4339
+ gd12("x1", "+- hc 0 dx1"),
4340
+ gd12("x2", "+- hc 0 dx2"),
4341
+ gd12("x3", "+- hc dx2 0"),
4342
+ gd12("x4", "+- hc dx1 0"),
4343
+ gd12("y1", "+- vc 0 dy1"),
4344
+ gd12("y2", "+- vc dy2 0"),
4345
+ gd12("ir", "*/ y2 dx1 dy1"),
4346
+ gd12("ib", "+- b 0 ir")
4347
+ ]});
4348
+ ({
4349
+ gdLst: [
4350
+ gd12("a", "pin 0 adj 100000"),
4351
+ gd12("shd2", "*/ hd2 vf 100000"),
4352
+ gd12("x1", "*/ ss a 100000"),
4353
+ gd12("x2", "+- r 0 x1"),
4354
+ gd12("y1", "+- vc 0 shd2"),
4355
+ gd12("y2", "+- vc shd2 0"),
4356
+ gd12("q1", "*/ shd2 115470 100000"),
4357
+ gd12("ir", "+- x1 0 q1"),
4358
+ gd12("il", "+- x1 q1 0")
4359
+ ]});
4360
+ ({
4361
+ gdLst: [
4362
+ gd12("hf", "val 102572"),
4363
+ gd12("vf", "val 105210"),
4364
+ gd12("swd2", "*/ wd2 hf 100000"),
4365
+ gd12("shd2", "*/ hd2 vf 100000"),
4366
+ gd12("dx1", "*/ swd2 97493 100000"),
4367
+ gd12("dx2", "*/ swd2 78183 100000"),
4368
+ gd12("dx3", "*/ swd2 43388 100000"),
4369
+ gd12("dy1", "*/ shd2 62349 100000"),
4370
+ gd12("dy2", "*/ shd2 22252 100000"),
4371
+ gd12("dy3", "*/ shd2 90097 100000"),
4372
+ gd12("x1", "+- hc 0 dx1"),
4373
+ gd12("x2", "+- hc 0 dx2"),
4374
+ gd12("x3", "+- hc 0 dx3"),
4375
+ gd12("x4", "+- hc dx3 0"),
4376
+ gd12("x5", "+- hc dx2 0"),
4377
+ gd12("x6", "+- hc dx1 0"),
4378
+ gd12("y1", "+- vc 0 dy1"),
4379
+ gd12("y2", "+- vc dy2 0"),
4380
+ gd12("y3", "+- vc dy3 0")
4381
+ ]});
4382
+ ({
4383
+ gdLst: [
4384
+ gd12("a", "pin 0 adj 50000"),
4385
+ gd12("x1", "*/ ss a 100000"),
4386
+ gd12("x2", "+- r 0 x1"),
4387
+ gd12("y2", "+- b 0 x1"),
4388
+ gd12("il", "*/ x1 1 2"),
4389
+ gd12("it", "*/ x1 1 2"),
4390
+ gd12("ir", "+- r 0 il"),
4391
+ gd12("ib", "+- b 0 it")
4392
+ ]});
4393
+ ({
4394
+ gdLst: [
4395
+ gd12("shd2", "*/ hd2 vf 100000"),
4396
+ gd12("dx1", "*/ wd2 95106 100000"),
4397
+ gd12("dx2", "*/ wd2 58779 100000"),
4398
+ gd12("dy1", "*/ shd2 80902 100000"),
4399
+ gd12("dy2", "*/ shd2 30902 100000"),
4400
+ gd12("x1", "+- hc 0 dx1"),
4401
+ gd12("x2", "+- hc 0 dx2"),
4402
+ gd12("x3", "+- hc dx2 0"),
4403
+ gd12("x4", "+- hc dx1 0"),
4404
+ gd12("y1", "+- vc 0 dy1"),
4405
+ gd12("y2", "+- vc 0 dy2"),
4406
+ gd12("y3", "+- vc dy2 0"),
4407
+ gd12("y4", "+- vc dy1 0")
4408
+ ]});
4409
+ ({
4410
+ gdLst: [
4411
+ gd12("dx1", "*/ wd2 86603 100000"),
4412
+ gd12("dx2", "*/ wd2 50000 100000"),
4413
+ gd12("dy1", "*/ hd2 86603 100000"),
4414
+ gd12("dy2", "*/ hd2 50000 100000"),
4415
+ gd12("x1", "+- hc 0 dx1"),
4416
+ gd12("x2", "+- hc 0 dx2"),
4417
+ gd12("x3", "+- hc dx2 0"),
4418
+ gd12("x4", "+- hc dx1 0"),
4419
+ gd12("y1", "+- vc 0 dy1"),
4420
+ gd12("y2", "+- vc 0 dy2"),
4421
+ gd12("y3", "+- vc dy2 0"),
4422
+ gd12("y4", "+- vc dy1 0")
4423
+ ]});
4424
+ ({
4425
+ gdLst: [
4426
+ gd12("stAng", "pin 0 adj1 21599999"),
4427
+ gd12("endAng", "pin 0 adj2 21599999"),
4428
+ gd12("swAng", "+- endAng 0 stAng"),
4429
+ gd12("swAng2", "?: swAng swAng +- 21600000 swAng 0"),
4430
+ gd12("stx", "cos wd2 stAng"),
4431
+ gd12("sty", "sin hd2 stAng"),
4432
+ gd12("x1", "+- hc stx 0"),
4433
+ gd12("y1", "+- vc sty 0")
4434
+ ]});
4435
+ ({
4436
+ gdLst: [
4437
+ gd12("g1", "cos wd2 13500000"),
4438
+ gd12("g2", "sin hd2 13500000"),
4439
+ gd12("x1", "+- hc g1 0"),
4440
+ gd12("y1", "+- vc g2 0")
4441
+ ]});
4442
+ ({
4443
+ gdLst: [
4444
+ gd12("stAng", "pin 0 adj1 21599999"),
4445
+ gd12("endAng", "pin 0 adj2 21599999"),
4446
+ gd12("swAng", "+- endAng 0 stAng"),
4447
+ gd12("swAng2", "?: swAng swAng +- 21600000 swAng 0"),
4448
+ gd12("stx", "cos wd2 stAng"),
4449
+ gd12("sty", "sin hd2 stAng"),
4450
+ gd12("x1", "+- hc stx 0"),
4451
+ gd12("y1", "+- vc sty 0")
4452
+ ]});
4453
+ ({
4454
+ gdLst: [
4455
+ gd12("stAng", "pin 0 adj1 21599999"),
4456
+ gd12("endAng", "pin 0 adj2 21599999"),
4457
+ gd12("swAng", "+- endAng 0 stAng"),
4458
+ gd12("swAng2", "?: swAng swAng +- 21600000 swAng 0"),
4459
+ gd12("stx", "cos wd2 stAng"),
4460
+ gd12("sty", "sin hd2 stAng"),
4461
+ gd12("x1", "+- hc stx 0"),
4462
+ gd12("y1", "+- vc sty 0")
4463
+ ]});
4464
+ ({
4465
+ gdLst: [
4466
+ gd12("a", "pin 0 adj 50000"),
4467
+ gd12("dr", "*/ ss a 100000"),
4468
+ gd12("iwd2", "+- wd2 0 dr"),
4469
+ gd12("ihd2", "+- hd2 0 dr")
4470
+ ]});
4471
+ ({
4472
+ gdLst: [
4473
+ gd12("a", "pin 0 adj 50000"),
4474
+ gd12("dr", "*/ ss a 100000"),
4475
+ gd12("iwd2", "+- wd2 0 dr"),
4476
+ gd12("ihd2", "+- hd2 0 dr"),
4477
+ gd12("ang", "at2 iwd2 ihd2"),
4478
+ gd12("ca", "cos iwd2 ang"),
4479
+ gd12("sa", "sin ihd2 ang"),
4480
+ gd12("x1", "+- hc 0 ca"),
4481
+ gd12("x2", "+- hc ca 0"),
4482
+ gd12("y1", "+- vc 0 sa"),
4483
+ gd12("y2", "+- vc sa 0")
4484
+ ]});
4485
+ ({
4486
+ gdLst: [
4487
+ gd12("stAng", "pin 0 adj1 21599999"),
4488
+ gd12("endAng", "pin 0 adj2 21599999"),
4489
+ gd12("thh", "pin 0 adj3 50000"),
4490
+ gd12("th", "*/ ss thh 100000"),
4491
+ gd12("thw", "*/ wd2 thh 100000"),
4492
+ gd12("thh2", "*/ hd2 thh 100000"),
4493
+ gd12("iwd2", "+- wd2 0 thw"),
4494
+ gd12("ihd2", "+- hd2 0 thh2"),
4495
+ gd12("swAng", "+- endAng 0 stAng"),
4496
+ gd12("swAng2", "?: swAng swAng +- 21600000 swAng 0"),
4497
+ gd12("mswAng", "+- 0 0 swAng2"),
4498
+ gd12("stx", "cos wd2 stAng"),
4499
+ gd12("sty", "sin hd2 stAng"),
4500
+ gd12("x1", "+- hc stx 0"),
4501
+ gd12("y1", "+- vc sty 0"),
4502
+ gd12("istx", "cos iwd2 endAng"),
4503
+ gd12("isty", "sin ihd2 endAng"),
4504
+ gd12("ix1", "+- hc istx 0"),
4505
+ gd12("iy1", "+- vc isty 0")
4506
+ ]});
4507
+ ({
4508
+ gdLst: [
4509
+ gd12("a1", "pin 0 adj1 100000"),
4510
+ gd12("a2", "pin 0 adj2 100000"),
4511
+ gd12("y1", "*/ hd2 a1 100000"),
4512
+ gd12("y2", "+- vc 0 y1"),
4513
+ gd12("y3", "+- vc y1 0"),
4514
+ gd12("x2", "*/ w a2 100000"),
4515
+ gd12("x1", "+- r 0 x2"),
4516
+ gd12("dx2", "*/ hd2 x2 wd2"),
4517
+ gd12("x3", "+- x1 dx2 0")
4518
+ ]});
4519
+ ({
4520
+ gdLst: [
4521
+ gd12("a1", "pin 0 adj1 100000"),
4522
+ gd12("a2", "pin 0 adj2 100000"),
4523
+ gd12("y1", "*/ hd2 a1 100000"),
4524
+ gd12("y2", "+- vc 0 y1"),
4525
+ gd12("y3", "+- vc y1 0"),
4526
+ gd12("x1", "*/ w a2 100000"),
4527
+ gd12("dx2", "*/ hd2 x1 wd2"),
4528
+ gd12("x2", "+- l dx2 0")
4529
+ ]});
4530
+ ({
4531
+ gdLst: [
4532
+ gd12("a1", "pin 0 adj1 100000"),
4533
+ gd12("a2", "pin 0 adj2 100000"),
4534
+ gd12("x1", "*/ wd2 a1 100000"),
4535
+ gd12("x2", "+- hc 0 x1"),
4536
+ gd12("x3", "+- hc x1 0"),
4537
+ gd12("y2", "*/ h a2 100000"),
4538
+ gd12("dy2", "*/ wd2 y2 hd2"),
4539
+ gd12("y1", "+- t dy2 0")
4540
+ ]});
4541
+ ({
4542
+ gdLst: [
4543
+ gd12("a1", "pin 0 adj1 100000"),
4544
+ gd12("a2", "pin 0 adj2 100000"),
4545
+ gd12("x1", "*/ wd2 a1 100000"),
4546
+ gd12("x2", "+- hc 0 x1"),
4547
+ gd12("x3", "+- hc x1 0"),
4548
+ gd12("y1", "*/ h a2 100000"),
4549
+ gd12("y2", "+- b 0 y1"),
4550
+ gd12("dy2", "*/ wd2 y1 hd2"),
4551
+ gd12("y3", "+- b 0 dy2")
4552
+ ]});
4553
+ ({
4554
+ gdLst: [
4555
+ gd12("dxPos", "*/ w adj1 100000"),
4556
+ gd12("dyPos", "*/ h adj2 100000"),
4557
+ gd12("xPos", "+- hc dxPos 0"),
4558
+ gd12("yPos", "+- vc dyPos 0"),
4559
+ gd12("dx", "+- xPos 0 hc"),
4560
+ gd12("dy", "+- yPos 0 vc"),
4561
+ gd12("dq", "*/ dxPos h w"),
4562
+ gd12("ady", "abs dy"),
4563
+ gd12("adq", "abs dq"),
4564
+ gd12("xg1", "?: dxPos 7 2"),
4565
+ gd12("xg2", "?: dxPos 10 5"),
4566
+ gd12("x1", "*/ w xg1 12"),
4567
+ gd12("x2", "*/ w xg2 12"),
4568
+ gd12("yg1", "?: dyPos 7 2"),
4569
+ gd12("yg2", "?: dyPos 10 5"),
4570
+ gd12("y1", "*/ h yg1 12"),
4571
+ gd12("y2", "*/ h yg2 12"),
4572
+ gd12("t1", "?: dxPos l xPos"),
4573
+ gd12("xl", "?: ady adq t1 l"),
4574
+ gd12("t2", "?: dyPos yPos t"),
4575
+ gd12("yt", "?: ady adq t t2"),
4576
+ gd12("t3", "?: dxPos xPos r"),
4577
+ gd12("xr", "?: ady adq t3 r"),
4578
+ gd12("t4", "?: dyPos b yPos"),
4579
+ gd12("yb", "?: ady adq b t4")
4580
+ ]});
4581
+ ({
4582
+ gdLst: [
4583
+ gd12("dxPos", "*/ w adj1 100000"),
4584
+ gd12("dyPos", "*/ h adj2 100000"),
4585
+ gd12("xPos", "+- hc dxPos 0"),
4586
+ gd12("yPos", "+- vc dyPos 0"),
4587
+ gd12("a3", "pin 0 adj3 50000"),
4588
+ gd12("rad", "*/ ss a3 100000"),
4589
+ gd12("x1", "+- l rad 0"),
4590
+ gd12("x2", "+- r 0 rad"),
4591
+ gd12("y1", "+- t rad 0"),
4592
+ gd12("y2", "+- b 0 rad")
4593
+ ]});
4594
+ ({
4595
+ gdLst: [
4596
+ gd12("dxPos", "*/ w adj1 100000"),
4597
+ gd12("dyPos", "*/ h adj2 100000"),
4598
+ gd12("xPos", "+- hc dxPos 0"),
4599
+ gd12("yPos", "+- vc dyPos 0"),
4600
+ gd12("sdx", "*/ dxPos hd2 wd2"),
4601
+ gd12("sdy", "val dyPos"),
4602
+ gd12("pang", "at2 sdx sdy"),
4603
+ gd12("stAng", "+- pang 660000 0"),
4604
+ gd12("enAng", "+- pang 0 660000"),
4605
+ gd12("dx1", "cos wd2 stAng"),
4606
+ gd12("dy1", "sin hd2 stAng"),
4607
+ gd12("x1", "+- hc dx1 0"),
4608
+ gd12("y1", "+- vc dy1 0"),
4609
+ gd12("dx2", "cos wd2 enAng"),
4610
+ gd12("dy2", "sin hd2 enAng"),
4611
+ gd12("x2", "+- hc dx2 0"),
4612
+ gd12("y2", "+- vc dy2 0"),
4613
+ gd12("stAng1", "at2 dx1 dy1"),
4614
+ gd12("enAngFinal", "at2 dx2 dy2"),
4615
+ gd12("swAng1", "+- enAngFinal 0 stAng1"),
4616
+ gd12("swAng", "?: swAng1 swAng1 +- swAng1 21600000 0")
4617
+ ]});
4618
+ ({
4619
+ gdLst: [
4620
+ gd12("a", "pin 0 adj 50000"),
4621
+ gd12("iwd2", "*/ wd2 a 50000"),
4622
+ gd12("ihd2", "*/ hd2 a 50000"),
4623
+ gd12("sdx", "*/ iwd2 92388 100000"),
4624
+ gd12("sdy", "*/ ihd2 92388 100000"),
4625
+ gd12("sx1", "+- hc 0 sdx"),
4626
+ gd12("sx2", "+- hc sdx 0"),
4627
+ gd12("sy1", "+- vc 0 sdy"),
4628
+ gd12("sy2", "+- vc sdy 0"),
4629
+ gd12("yAdj", "+- vc 0 ihd2")
4630
+ ]});
4631
+ ({
4632
+ gdLst: [
4633
+ gd12("a", "pin 0 adj 50000"),
4634
+ gd12("swd2", "*/ wd2 hf 100000"),
4635
+ gd12("shd2", "*/ hd2 vf 100000"),
4636
+ gd12("svc", "*/ vc vf 100000"),
4637
+ gd12("dx1", "*/ swd2 95106 100000"),
4638
+ gd12("dx2", "*/ swd2 58779 100000"),
4639
+ gd12("dy1", "*/ shd2 80902 100000"),
4640
+ gd12("dy2", "*/ shd2 30902 100000"),
4641
+ gd12("x1", "+- hc 0 dx1"),
4642
+ gd12("x2", "+- hc 0 dx2"),
4643
+ gd12("x3", "+- hc dx2 0"),
4644
+ gd12("x4", "+- hc dx1 0"),
4645
+ gd12("y1", "+- svc 0 dy1"),
4646
+ gd12("y2", "+- svc 0 dy2"),
4647
+ gd12("iwd2", "*/ swd2 a 50000"),
4648
+ gd12("ihd2", "*/ shd2 a 50000"),
4649
+ gd12("sdx1", "*/ iwd2 95106 100000"),
4650
+ gd12("sdx2", "*/ iwd2 58779 100000"),
4651
+ gd12("sdy1", "*/ ihd2 80902 100000"),
4652
+ gd12("sdy2", "*/ ihd2 30902 100000"),
4653
+ gd12("sx1", "+- hc 0 sdx1"),
4654
+ gd12("sx2", "+- hc 0 sdx2"),
4655
+ gd12("sx3", "+- hc sdx2 0"),
4656
+ gd12("sx4", "+- hc sdx1 0"),
4657
+ gd12("sy1", "+- svc 0 sdy1"),
4658
+ gd12("sy2", "+- svc 0 sdy2"),
4659
+ gd12("sy3", "+- svc ihd2 0"),
4660
+ gd12("yc", "+- svc 0 ihd2")
4661
+ ]});
4662
+
2415
4663
  // src/converter/OmmlLatexConverter.ts
4664
+ var IGNORED_KEYS = /* @__PURE__ */ new Set(["m:rPr", "m:ctrlPr", "m:argPr"]);
2416
4665
  var OmmlLatexConverter = class {
2417
4666
  /** Extracts LaTeX from an OMML XML node tree. */
2418
4667
  convert(root) {
@@ -2448,37 +4697,56 @@ var OmmlLatexConverter = class {
2448
4697
  if (record["m:t"]) {
2449
4698
  return this.renderNode(record["m:t"]);
2450
4699
  }
2451
- const handlers = [
2452
- (r) => this.tryFraction(r),
2453
- (r) => this.trySuperscript(r),
2454
- (r) => this.trySubscript(r),
2455
- (r) => this.trySubSup(r),
2456
- (r) => this.tryRadical(r),
2457
- (r) => this.tryNary(r),
2458
- (r) => this.tryDelimiter(r),
2459
- (r) => this.tryMatrix(r),
2460
- (r) => this.tryFunction(r),
2461
- (r) => this.tryBar(r),
2462
- (r) => this.tryGroupChar(r),
2463
- (r) => this.tryLimLow(r),
2464
- (r) => this.tryLimUpp(r)
2465
- ];
2466
- for (const handler of handlers) {
2467
- const result = handler(record);
2468
- if (result) {
2469
- return result;
2470
- }
2471
- }
2472
- const ignored = /* @__PURE__ */ new Set(["@_", "m:rPr", "m:ctrlPr", "m:argPr"]);
2473
4700
  let output = "";
2474
4701
  for (const [key, value] of Object.entries(record)) {
2475
- if (ignored.has(key) || key.startsWith("@_")) {
4702
+ if (key.startsWith("@_")) {
2476
4703
  continue;
2477
4704
  }
2478
- output += this.renderNode(value);
4705
+ const tag = stripXmlOrderSuffix(key);
4706
+ if (IGNORED_KEYS.has(tag)) {
4707
+ continue;
4708
+ }
4709
+ const items = Array.isArray(value) ? value : [value];
4710
+ for (const item of items) {
4711
+ output += this.renderElement(tag, item);
4712
+ }
2479
4713
  }
2480
4714
  return output;
2481
4715
  }
4716
+ /** Render one child element by tag; unknown tags fall back to a generic walk. */
4717
+ renderElement(tag, item) {
4718
+ const wrapped = { [tag]: item };
4719
+ switch (tag) {
4720
+ case "m:f":
4721
+ return this.tryFraction(wrapped) ?? this.renderNode(item);
4722
+ case "m:sSup":
4723
+ return this.trySuperscript(wrapped) ?? this.renderNode(item);
4724
+ case "m:sSub":
4725
+ return this.trySubscript(wrapped) ?? this.renderNode(item);
4726
+ case "m:sSubSup":
4727
+ return this.trySubSup(wrapped) ?? this.renderNode(item);
4728
+ case "m:rad":
4729
+ return this.tryRadical(wrapped) ?? this.renderNode(item);
4730
+ case "m:nary":
4731
+ return this.tryNary(wrapped) ?? this.renderNode(item);
4732
+ case "m:d":
4733
+ return this.tryDelimiter(wrapped) ?? this.renderNode(item);
4734
+ case "m:m":
4735
+ return this.tryMatrix(wrapped) ?? this.renderNode(item);
4736
+ case "m:func":
4737
+ return this.tryFunction(wrapped) ?? this.renderNode(item);
4738
+ case "m:bar":
4739
+ return this.tryBar(wrapped) ?? this.renderNode(item);
4740
+ case "m:groupChr":
4741
+ return this.tryGroupChar(wrapped) ?? this.renderNode(item);
4742
+ case "m:limLow":
4743
+ return this.tryLimLow(wrapped) ?? this.renderNode(item);
4744
+ case "m:limUpp":
4745
+ return this.tryLimUpp(wrapped) ?? this.renderNode(item);
4746
+ default:
4747
+ return this.renderNode(item);
4748
+ }
4749
+ }
2482
4750
  tryFraction(node) {
2483
4751
  const value = node["m:f"];
2484
4752
  if (!value) {
@@ -5284,9 +7552,9 @@ function renderChartSvg(element) {
5284
7552
  const y = titleHeight + Math.max(element.height * 0.06, 6);
5285
7553
  const w = Math.max(element.width - x * 1.5, 1);
5286
7554
  const h = Math.max(element.height - y - Math.max(element.height * 0.1, 10), 1);
5287
- const pie = data.chartType === "pie" || data.chartType === "pie3D" || data.chartType === "doughnut";
5288
- const line = data.chartType === "line" || data.chartType === "line3D" || data.chartType === "scatter";
5289
- const marks = data.chartType === "funnel" ? renderFunnelChartSvg(element, x, y, w, h) : pie ? renderPie(element, x, y, w, h) : line ? renderLines(element, x, y, w, h) : renderBars(element, x, y, w, h);
7555
+ const pie2 = data.chartType === "pie" || data.chartType === "pie3D" || data.chartType === "doughnut";
7556
+ const line2 = data.chartType === "line" || data.chartType === "line3D" || data.chartType === "scatter";
7557
+ const marks = data.chartType === "funnel" ? renderFunnelChartSvg(element, x, y, w, h) : pie2 ? renderPie(element, x, y, w, h) : line2 ? renderLines(element, x, y, w, h) : renderBars(element, x, y, w, h);
5290
7558
  const title = data.title ? `<text x="${element.width / 2}" y="${Math.max(titleHeight * 0.75, 14)}" text-anchor="middle" font-family="Arial" font-size="14" fill="#222222">${esc2(data.title)}</text>` : "";
5291
7559
  return `<g data-pptx-element="chart" data-chart-type="${esc2(data.chartType)}"><rect width="${element.width}" height="${element.height}" fill="#FFFFFF" />${title}${marks}</g>`;
5292
7560
  }