fable-editor 1.3.0 → 1.3.1

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.
@@ -1,4 +1,4 @@
1
- const rt = {
1
+ const ct = {
2
2
  en: {
3
3
  dir: "ltr",
4
4
  file: "File",
@@ -384,10 +384,10 @@ const rt = {
384
384
  emcat_flags: "أعلام"
385
385
  }
386
386
  };
387
- function D(d) {
388
- return rt[d];
387
+ function O(h) {
388
+ return ct[h];
389
389
  }
390
- const at = "undo redo | preview print | importword revhistory | fontfamily fontsize | fontsizeincrease fontsizedecrease | bold italic underline strikethrough | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent | link blockquote code changecase lineheight wordspacing letterspacing | removeformat | blocks | ltr rtl | quickimage quickvideo quicktable codesample template charmap emoji | fullscreen sourcecode", ct = "file edit view insert format tools table help", ht = [
390
+ const ht = "undo redo | preview print | importword revhistory | fontfamily fontsize | fontsizeincrease fontsizedecrease | bold italic underline strikethrough | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent | link blockquote code changecase lineheight wordspacing letterspacing | removeformat | blocks | ltr rtl | quickimage quickvideo quicktable codesample template charmap emoji | fullscreen sourcecode", dt = "file edit view insert format tools table help", pt = [
391
391
  ["Andale Mono", "andale mono,times"],
392
392
  ["Arial", "arial,helvetica,sans-serif"],
393
393
  ["Arial Black", "arial black,avant garde"],
@@ -407,7 +407,7 @@ const at = "undo redo | preview print | importword revhistory | fontfamily fonts
407
407
  ["Verdana", "verdana,geneva"],
408
408
  ["Webdings", "webdings"],
409
409
  ["Wingdings", "wingdings,zapf dingbats"]
410
- ], dt = ["8px", "9px", "10px", "11px", "12px", "14px", "16px", "18px", "20px", "24px", "28px", "32px", "36px", "48px", "72px", "96px"], pt = 1, mt = 100, U = ["1", "1.15", "1.4", "1.5", "1.75", "2", "2.5", "3"], W = ["1px", "2px", "4px", "6px", "8px", "12px"], j = ["0.5px", "1px", "1.5px", "2px", "3px", "4px"], V = [
410
+ ], ut = ["8px", "9px", "10px", "11px", "12px", "14px", "16px", "18px", "20px", "24px", "28px", "32px", "36px", "48px", "72px", "96px"], mt = 1, gt = 100, W = ["1", "1.15", "1.4", "1.5", "1.75", "2", "2.5", "3"], V = ["1px", "2px", "4px", "6px", "8px", "12px"], j = ["0.5px", "1px", "1.5px", "2px", "3px", "4px"], X = [
411
411
  ["plain", "Plain text"],
412
412
  ["html", "HTML/XML"],
413
413
  ["css", "CSS"],
@@ -424,7 +424,7 @@ const at = "undo redo | preview print | importword revhistory | fontfamily fonts
424
424
  ["rust", "Rust"],
425
425
  ["sql", "SQL"],
426
426
  ["bash", "Bash/Shell"]
427
- ], X = [
427
+ ], Q = [
428
428
  ["p", "para"],
429
429
  ["h1", "heading1"],
430
430
  ["h2", "heading2"],
@@ -433,7 +433,7 @@ const at = "undo redo | preview print | importword revhistory | fontfamily fonts
433
433
  ["h5", "heading5"],
434
434
  ["h6", "heading6"],
435
435
  ["pre", "pre"]
436
- ], ut = ["#F76707", "#4263EB", "#CC5DE8"], gt = [
436
+ ], ft = ["#F76707", "#4263EB", "#CC5DE8"], vt = [
437
437
  "#FFFFFF",
438
438
  "#F4F4F4",
439
439
  "#E8EAED",
@@ -459,7 +459,7 @@ const at = "undo redo | preview print | importword revhistory | fontfamily fonts
459
459
  "#8E24AA",
460
460
  "#C2185B",
461
461
  "#6D4C41"
462
- ], ft = [
462
+ ], bt = [
463
463
  {
464
464
  key: "chcat_currency",
465
465
  chars: [
@@ -799,7 +799,7 @@ const at = "undo redo | preview print | importword revhistory | fontfamily fonts
799
799
  "ة"
800
800
  ]
801
801
  }
802
- ], vt = [
802
+ ], yt = [
803
803
  {
804
804
  key: "emcat_smileys",
805
805
  chars: [
@@ -1524,7 +1524,7 @@ const at = "undo redo | preview print | importword revhistory | fontfamily fonts
1524
1524
  "🇲🇦"
1525
1525
  ]
1526
1526
  }
1527
- ], Jt = [
1527
+ ], pe = [
1528
1528
  "©",
1529
1529
  "®",
1530
1530
  "™",
@@ -1573,244 +1573,244 @@ const at = "undo redo | preview print | importword revhistory | fontfamily fonts
1573
1573
  "ـ",
1574
1574
  "٠",
1575
1575
  "١"
1576
- ], y = (d, t) => `<svg viewBox="${t || "0 0 24 24"}">${d}</svg>`, f = (d) => y(`<path class="f" d="${d}"/>`, "0 -960 960 960"), q = (d, t = 7.5) => y(
1577
- '<path d="M10 6h10M10 12h10M10 18h10"/>' + d.map(
1576
+ ], x = (h, t) => `<svg viewBox="${t || "0 0 24 24"}">${h}</svg>`, v = (h) => x(`<path class="f" d="${h}"/>`, "0 -960 960 960"), q = (h, t = 7.5) => x(
1577
+ '<path d="M10 6h10M10 12h10M10 18h10"/>' + h.map(
1578
1578
  (e, i) => `<text x="2.5" y="${8.4 + i * 6}" font-size="${t}" stroke="none" fill="#222f3e" font-family="Arial">${e}</text>`
1579
1579
  ).join("")
1580
1580
  ), c = {
1581
- bold: f(
1581
+ bold: v(
1582
1582
  "M272-200v-560h221q65 0 120 40t55 111q0 51-23 78.5T602-491q25 11 55.5 41t30.5 90q0 89-65 124.5T501-200H272Zm121-112h104q48 0 58.5-24.5T566-372q0-11-10.5-35.5T494-432H393v120Zm0-228h93q33 0 48-17t15-38q0-24-17-39t-44-15h-95v109Z"
1583
1583
  ),
1584
- italic: f("M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"),
1585
- underline: f(
1584
+ italic: v("M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"),
1585
+ underline: v(
1586
1586
  "M200-120v-80h560v80H200Zm123-223q-56-63-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63q-101 0-157-63Z"
1587
1587
  ),
1588
- strikethrough: f(
1588
+ strikethrough: v(
1589
1589
  "M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z"
1590
1590
  ),
1591
- undo: f("M280-200v-80h284q63 0 109.5-40T720-420q0-60-46.5-100T564-560H312l104 104-56 56-200-200 200-200 56 56-104 104h252q97 0 166.5 63T800-420q0 94-69.5 157T564-200H280Z"),
1592
- redo: f("M396-200q-97 0-166.5-63T160-420q0-94 69.5-157T396-640h252L544-744l56-56 200 200-200 200-56-56 104-104H396q-63 0-109.5 40T240-420q0 60 46.5 100T396-280h284v80H396Z"),
1593
- ltr: f(
1591
+ undo: v("M280-200v-80h284q63 0 109.5-40T720-420q0-60-46.5-100T564-560H312l104 104-56 56-200-200 200-200 56 56-104 104h252q97 0 166.5 63T800-420q0 94-69.5 157T564-200H280Z"),
1592
+ redo: v("M396-200q-97 0-166.5-63T160-420q0-94 69.5-157T396-640h252L544-744l56-56 200 200-200 200-56-56 104-104H396q-63 0-109.5 40T240-420q0 60 46.5 100T396-280h284v80H396Z"),
1593
+ ltr: v(
1594
1594
  "M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm0-280v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80ZM680-80l-56-56 64-64H120v-80h568l-64-64 56-56 160 160L680-80Z"
1595
1595
  ),
1596
- rtl: f(
1596
+ rtl: v(
1597
1597
  "M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm-88 160 64 64-56 56-160-160 160-160 56 56-64 64h568v80H272Zm88-440v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80Z"
1598
1598
  ),
1599
- alignleft: f(
1599
+ alignleft: v(
1600
1600
  "M120-120v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Z"
1601
1601
  ),
1602
- aligncenter: f(
1602
+ aligncenter: v(
1603
1603
  "M120-120v-80h720v80H120Zm160-160v-80h400v80H280ZM120-440v-80h720v80H120Zm160-160v-80h400v80H280ZM120-760v-80h720v80H120Z"
1604
1604
  ),
1605
- alignright: f(
1605
+ alignright: v(
1606
1606
  "M120-760v-80h720v80H120Zm240 160v-80h480v80H360ZM120-440v-80h720v80H120Zm240 160v-80h480v80H360ZM120-120v-80h720v80H120Z"
1607
1607
  ),
1608
- alignjustify: f(
1608
+ alignjustify: v(
1609
1609
  "M120-120v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Z"
1610
1610
  ),
1611
- fullscreen: f(
1611
+ fullscreen: v(
1612
1612
  "M120-120v-200h80v120h120v80H120Zm520 0v-80h120v-120h80v200H640ZM120-640v-200h200v80H200v120h-80Zm640 0v-120H640v-80h200v200h-80Z"
1613
1613
  ),
1614
- clearformatic: f(
1614
+ clearformatic: v(
1615
1615
  "m528-546-93-93-121-121h486v120H568l-40 94ZM792-56 460-388l-80 188H249l119-280L56-792l56-56 736 736-56 56Z"
1616
1616
  ),
1617
- numlist: f(
1617
+ numlist: v(
1618
1618
  "M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z"
1619
1619
  ),
1620
- bullist: f(
1620
+ bullist: v(
1621
1621
  "M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm-56.5-263.5Q120-687 120-720t23.5-56.5Q167-800 200-800t56.5 23.5Q280-753 280-720t-23.5 56.5Q233-640 200-640t-56.5-23.5Z"
1622
1622
  ),
1623
- chev: y('<path d="M2 3.5 6 7.5 10 3.5"/>', "0 0 12 11"),
1624
- backcolor: f(
1623
+ chev: x('<path d="M2 3.5 6 7.5 10 3.5"/>', "0 0 12 11"),
1624
+ backcolor: v(
1625
1625
  "M440-80q-33 0-56.5-23.5T360-160v-160H240q-33 0-56.5-23.5T160-400v-280q0-66 47-113t113-47h480v440q0 33-23.5 56.5T720-320H600v160q0 33-23.5 56.5T520-80h-80ZM240-560h480v-200h-40v160h-80v-160h-40v80h-80v-80H320q-33 0-56.5 23.5T240-680v120Zm0 160h480v-80H240v80Zm0 0v-80 80Z"
1626
1626
  ),
1627
- outdent: f(
1627
+ outdent: v(
1628
1628
  "M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z"
1629
1629
  ),
1630
- indent: f(
1630
+ indent: v(
1631
1631
  "M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z"
1632
1632
  ),
1633
- more: y(
1633
+ more: x(
1634
1634
  '<circle class="f" cx="5" cy="12" r="1.7"/><circle class="f" cx="12" cy="12" r="1.7"/><circle class="f" cx="19" cy="12" r="1.7"/>'
1635
1635
  ),
1636
- image: f(
1636
+ image: v(
1637
1637
  "M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"
1638
1638
  ),
1639
- uploadic: f(
1639
+ uploadic: v(
1640
1640
  "M440-200v-326L336-422l-56-58 200-200 200 200-56 58-104-104v326h-80ZM240-80q-33 0-56.5-23.5T160-160v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-80H240Z"
1641
1641
  ),
1642
- tableic: f(
1642
+ tableic: v(
1643
1643
  "M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z"
1644
1644
  ),
1645
- hric: y('<path d="M4 12h16"/>'),
1646
- charic: f(
1645
+ hric: x('<path d="M4 12h16"/>'),
1646
+ charic: v(
1647
1647
  "M120-120v-120h200q-84-45-132-125t-48-175q0-142 99-241t241-99q142 0 241 99t99 241q0 95-48 175T640-240h200v120H520v-204q78-14 129-75t51-141q0-92-64-156t-156-64q-92 0-156 64t-64 156q0 80 51 141t129 75v204H120Z"
1648
1648
  ),
1649
- dateic: y(
1649
+ dateic: x(
1650
1650
  '<rect x="4" y="6" width="16" height="14" rx="1.5"/><path d="M4 10h16M8 4v4M16 4v4"/>'
1651
1651
  ),
1652
- pbic: f(
1652
+ pbic: v(
1653
1653
  "M240-80q-33 0-56.5-23.5T160-160v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-80H240Zm-80-440v-280q0-33 23.5-56.5T240-880h320l240 240v120h-80v-80H520v-200H240v280h-80Zm200 160v-80h240v80H360Zm320 0v-80h240v80H680Zm-640 0v-80h240v80H40Zm440-160Zm0 240Z"
1654
1654
  ),
1655
- nbspic: y('<path d="M6 12v4h12v-4"/>'),
1656
- srcic: f(
1655
+ nbspic: x('<path d="M6 12v4h12v-4"/>'),
1656
+ srcic: v(
1657
1657
  "M240-280 40-480l200-200 56 56-143 144 143 144-56 56Zm178 132-76-24 200-640 76 24-200 640Zm302-132-56-56 143-144-143-144 56-56 200 200-200 200Z"
1658
1658
  ),
1659
- prevw: f(
1659
+ prevw: v(
1660
1660
  "M607.5-372.5Q660-425 660-500t-52.5-127.5Q555-680 480-680t-127.5 52.5Q300-575 300-500t52.5 127.5Q405-320 480-320t127.5-52.5Zm-204-51Q372-455 372-500t31.5-76.5Q435-608 480-608t76.5 31.5Q588-545 588-500t-31.5 76.5Q525-392 480-392t-76.5-31.5ZM214-281.5Q94-363 40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200q-146 0-266-81.5ZM480-500Zm207.5 160.5Q782-399 832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280q113 0 207.5-59.5Z"
1661
1661
  ),
1662
- printic: f(
1662
+ printic: v(
1663
1663
  "M640-640v-120H320v120h-80v-200h480v200h-80Zm-480 80h640-640Zm560 100q17 0 28.5-11.5T760-500q0-17-11.5-28.5T720-540q-17 0-28.5 11.5T680-500q0 17 11.5 28.5T720-460Zm-80 260v-160H320v160h320Zm80 80H240v-160H80v-240q0-51 35-85.5t85-34.5h560q51 0 85.5 34.5T880-520v240H720v160Zm80-240v-160q0-17-11.5-28.5T760-560H200q-17 0-28.5 11.5T160-520v160h80v-80h480v80h80Z"
1664
1664
  ),
1665
- cutic: f(
1665
+ cutic: v(
1666
1666
  "M760-120 480-400l-94 94q8 15 11 32t3 34q0 66-47 113T240-80q-66 0-113-47T80-240q0-66 47-113t113-47q17 0 34 3t32 11l94-94-94-94q-15 8-32 11t-34 3q-66 0-113-47T80-720q0-66 47-113t113-47q66 0 113 47t47 113q0 17-3 34t-11 32l494 494v40H760ZM600-520l-80-80 240-240h120v40L600-520ZM296.5-663.5Q320-687 320-720t-23.5-56.5Q273-800 240-800t-56.5 23.5Q160-753 160-720t23.5 56.5Q207-640 240-640t56.5-23.5ZM494-466q6-6 6-14t-6-14q-6-6-14-6t-14 6q-6 6-6 14t6 14q6 6 14 6t14-6ZM296.5-183.5Q320-207 320-240t-23.5-56.5Q273-320 240-320t-56.5 23.5Q160-273 160-240t23.5 56.5Q207-160 240-160t56.5-23.5Z"
1667
1667
  ),
1668
- copyic: f(
1668
+ copyic: v(
1669
1669
  "M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"
1670
1670
  ),
1671
- pasteic: f(
1671
+ pasteic: v(
1672
1672
  "M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h167q11-35 43-57.5t70-22.5q40 0 71.5 22.5T594-840h166q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560h-80v120H280v-120h-80v560Zm308.5-571.5Q520-783 520-800t-11.5-28.5Q497-840 480-840t-28.5 11.5Q440-817 440-800t11.5 28.5Q463-760 480-760t28.5-11.5Z"
1673
1673
  ),
1674
- selall: f(
1674
+ selall: v(
1675
1675
  "M280-280v-400h400v400H280Zm80-80h240v-240H360v240ZM200-200v80q-33 0-56.5-23.5T120-200h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm80-160h-80q0-33 23.5-56.5T200-840v80Zm80 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm160 640v-80h80q0 33-23.5 56.5T760-120Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80q33 0 56.5 23.5T840-760h-80Z"
1676
1676
  ),
1677
- superscriptic: f(
1677
+ superscriptic: v(
1678
1678
  "M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z"
1679
1679
  ),
1680
- subscriptic: f(
1680
+ subscriptic: v(
1681
1681
  "M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z"
1682
1682
  ),
1683
- newic: y('<path d="M6 3h8l5 5v13H6z"/><path d="M14 3v5h5"/>'),
1684
- helpic: y(
1683
+ newic: x('<path d="M6 3h8l5 5v13H6z"/><path d="M14 3v5h5"/>'),
1684
+ helpic: x(
1685
1685
  '<circle cx="12" cy="12" r="8.5"/><path d="M9.6 9.6a2.5 2.5 0 1 1 3.4 2.6c-.8.3-1 .9-1 1.8"/><circle class="f" cx="12" cy="16.6" r="1.1"/>'
1686
1686
  ),
1687
- wcic: y('<path d="M4 6h16M4 10h16M4 14h9"/><path d="M15 17.5l2 2 3.6-4"/>'),
1688
- rowbefore: f(
1687
+ wcic: x('<path d="M4 6h16M4 10h16M4 14h9"/><path d="M15 17.5l2 2 3.6-4"/>'),
1688
+ rowbefore: v(
1689
1689
  "M200-160h560v-240H200v240Zm640 80H120v-720h160v80h-80v240h560v-240h-80v-80h160v720ZM480-480Zm0 80v-80 80Zm0 0Zm-40-240v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80Z"
1690
1690
  ),
1691
- rowafter: f(
1691
+ rowafter: v(
1692
1692
  "M200-560h560v-240H200v240Zm-80 400v-720h720v720H680v-80h80v-240H200v240h80v80H120Zm360-320Zm0-80v80-80Zm0 0ZM440-80v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80Z"
1693
1693
  ),
1694
- rowdelete: f(
1694
+ rowdelete: v(
1695
1695
  "M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200ZM200-200h560v-560H200ZM200-400v-160h560v160H200ZM330-580l250 250 50-50-250-250ZM330-380l250-250 50 50-250 250Z"
1696
1696
  ),
1697
- colbefore: f(
1697
+ colbefore: v(
1698
1698
  "M800-200v-560H560v560h240Zm-640 80v-160h80v80h240v-560H240v80h-80v-160h720v720H160Zm320-360Zm80 0h-80 80Zm0 0ZM160-360v-80H80v-80h80v-80h80v80h80v80h-80v80h-80Z"
1699
1699
  ),
1700
- colafter: f(
1700
+ colafter: v(
1701
1701
  "M160-760v560h240v-560H160ZM80-120v-720h720v160h-80v-80H480v560h240v-80h80v160H80Zm400-360Zm-80 0h80-80Zm0 0Zm320 120v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80Z"
1702
1702
  ),
1703
- coldelete: f(
1703
+ coldelete: v(
1704
1704
  "M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200ZM200-200h560v-560H200ZM400-200v-560h160v560H400ZM330-580l250 250 50-50-250-250ZM330-380l250-250 50 50-250 250Z"
1705
1705
  ),
1706
- tabledelete: y(
1706
+ tabledelete: x(
1707
1707
  '<rect x="4" y="5" width="16" height="14" rx="1.5"/><path d="M4 10h16M4 14.5h16M9.5 5v14M14.5 5v14"/><path d="M6.5 6.5l11 11M17.5 6.5l-11 11" stroke-width="2.1"/>'
1708
1708
  ),
1709
- quote: f(
1709
+ quote: v(
1710
1710
  "m228-240 92-160q-66 0-113-47t-47-113q0-66 47-113t113-47q66 0 113 47t47 113q0 23-5.5 42.5T458-480L320-240h-92Zm360 0 92-160q-66 0-113-47t-47-113q0-66 47-113t113-47q66 0 113 47t47 113q0 23-5.5 42.5T818-480L680-240h-92ZM362.5-517.5Q380-535 380-560t-17.5-42.5Q345-620 320-620t-42.5 17.5Q260-585 260-560t17.5 42.5Q295-500 320-500t42.5-17.5Zm360 0Q740-535 740-560t-17.5-42.5Q705-620 680-620t-42.5 17.5Q620-585 620-560t17.5 42.5Q655-500 680-500t42.5-17.5ZM680-560Zm-360 0Z"
1711
1711
  ),
1712
- link: f(
1712
+ link: v(
1713
1713
  "M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"
1714
1714
  ),
1715
- unlink: y(
1715
+ unlink: x(
1716
1716
  '<path d="M13.5 6.5l1.7-1.7a4 4 0 0 1 5.6 5.6L19 12.2"/><path d="M10.5 17.5l-1.7 1.7a4 4 0 0 1-5.6-5.6L5 11.8"/><path d="M4 4l16 16"/>'
1717
1717
  ),
1718
- lineheight: f(
1718
+ lineheight: v(
1719
1719
  "M240-160 80-320l56-56 64 62v-332l-64 62-56-56 160-160 160 160-56 56-64-62v332l64-62 56 56-160 160Zm240-40v-80h400v80H480Zm0-240v-80h400v80H480Zm0-240v-80h400v80H480Z"
1720
1720
  ),
1721
- wordspacing: f(
1721
+ wordspacing: v(
1722
1722
  "M320-80 160-240l160-160 57 56-64 64h334l-63-64 56-56 160 160L640-80l-57-56 64-64H313l63 64-56 56ZM200-480v-400h80v400h-80Zm240 0v-400h80v400h-80Zm240 0v-400h80v400h-80Z"
1723
1723
  ),
1724
- caseic: f(
1724
+ caseic: v(
1725
1725
  "m131-252 165-440h79l165 440h-76l-39-112H247l-40 112h-76Zm139-176h131l-64-182h-4l-63 182Zm395 186q-51 0-81-27.5T554-342q0-44 34.5-72.5T677-443q23 0 45 4t38 11v-12q0-29-20.5-47T685-505q-23 0-42 9.5T610-468l-47-35q24-29 54.5-43t68.5-14q69 0 103 32.5t34 97.5v178h-63v-37h-4q-14 23-38 35t-53 12Zm12-54q35 0 59.5-24t24.5-56q-14-8-33.5-12.5T689-393q-32 0-50 14t-18 37q0 20 16 33t40 13Z"
1726
1726
  ),
1727
- uppercaseic: f(
1727
+ uppercaseic: v(
1728
1728
  "M660-240v-248l-64 64-56-56 160-160 160 160-56 56-64-64v248h-80Zm-540 0 165-440h79l165 440h-76l-39-113H236l-40 113h-76Zm139-177h131l-65-182h-4l-62 182Z"
1729
1729
  ),
1730
- lowercaseic: f(
1730
+ lowercaseic: v(
1731
1731
  "M300-240q-51 0-81-27.5T189-340q0-44 34.5-72.5T312-441q23 0 45 4t38 11v-12q0-29-20.5-47T320-503q-23 0-42 9.5T245-466l-47-35q24-29 54.5-43t68.5-14q69 0 103 32.5t34 97.5v178h-63v-37h-4q-14 23-38 35t-53 12Zm12-54q35 0 59.5-24t24.5-56q-14-8-33.5-12.5T324-391q-32 0-50 14t-18 37q0 20 16 33t40 13Zm388 54L540-400l56-56 64 64v-248h80v248l64-64 56 56-160 160Z"
1732
1732
  ),
1733
- capitalizeic: f(
1733
+ capitalizeic: v(
1734
1734
  "M344-250v-366H224v-64h308v64H412v366h-68Zm344 10q-44 0-69-25.5T594-336v-162h-54v-58h54v-87h66v87h74v58h-74v148q0 23 10.5 36t28.5 13q9 0 18.5-3.5T736-314v65q-10 5-22 7t-26 2Z"
1735
1735
  ),
1736
- plus: y('<path d="M12 5.5v13M5.5 12h13"/>'),
1737
- minus: y('<path d="M5.5 12h13"/>'),
1738
- fontsizeup: f(
1736
+ plus: x('<path d="M12 5.5v13M5.5 12h13"/>'),
1737
+ minus: x('<path d="M5.5 12h13"/>'),
1738
+ fontsizeup: v(
1739
1739
  "m40-200 210-560h100l210 560h-96l-51-143H187l-51 143H40Zm176-224h168l-82-232h-4l-82 232Zm504 104v-120H600v-80h120v-120h80v120h120v80H800v120h-80Z"
1740
1740
  ),
1741
- fontsizedown: f(
1741
+ fontsizedown: v(
1742
1742
  "m40-200 210-560h100l210 560h-96l-51-143H187l-51 143H40Zm176-224h168l-82-232h-4l-82 232Zm384-16v-80h320v80H600Z"
1743
1743
  ),
1744
- historyic: f(
1744
+ historyic: v(
1745
1745
  "M480-120q-138 0-240.5-91.5T122-440h82q14 104 92.5 172T480-200q117 0 198.5-81.5T760-480q0-117-81.5-198.5T480-760q-69 0-129 32t-101 88h110v80H120v-240h80v94q51-64 124.5-99T480-840q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-480q0 75-28.5 140.5t-77 114q-48.5 48.5-114 77T480-120Zm112-192L440-464v-216h80v184l128 128-56 56Z"
1746
1746
  ),
1747
- wordic: y(
1747
+ wordic: x(
1748
1748
  '<path d="M6 3h8l5 5v13H6z"/><path d="M14 3v5h5"/><text x="8" y="17" font-size="8.5" stroke="none" fill="#222f3e" font-family="Arial" font-weight="bold">W</text>'
1749
1749
  ),
1750
- draftic: f(
1750
+ draftic: v(
1751
1751
  "M480-160q-134 0-227-93t-93-227q0-134 93-227t227-93q69 0 132 28.5T720-690v-110h80v280H520v-80h168q-32-56-87.5-88T480-720q-100 0-170 70t-70 170q0 100 70 170t170 70q77 0 139-44t87-116h84q-28 106-114 173t-196 67Z"
1752
1752
  ),
1753
- trash: y(
1753
+ trash: x(
1754
1754
  '<path d="M5 7h14M10 7V5h4v2M7.5 7l1 13h7l1-13"/>'
1755
1755
  ),
1756
- templateic: y(
1756
+ templateic: x(
1757
1757
  '<rect x="4" y="4" width="16" height="16" rx="1.5"/><rect x="6.5" y="6.5" width="5" height="5" rx=".5"/><path d="M14 7.5h3.5M14 10h3.5M6.5 14h11M6.5 17h11"/>'
1758
1758
  ),
1759
- tplleft: y(
1759
+ tplleft: x(
1760
1760
  '<rect x="3" y="5" width="8" height="8" rx=".8"/><path d="M13.5 6.5H21M13.5 9.5H21M13.5 12.5H21M3 15.5h18M3 18.5h18"/>'
1761
1761
  ),
1762
- tplright: y(
1762
+ tplright: x(
1763
1763
  '<rect x="13" y="5" width="8" height="8" rx=".8"/><path d="M3 6.5h7.5M3 9.5h7.5M3 12.5h7.5M3 15.5h18M3 18.5h18"/>'
1764
1764
  ),
1765
- tpltop: y(
1765
+ tpltop: x(
1766
1766
  '<rect x="5" y="3" width="14" height="9" rx=".8"/><path d="M3 15h18M3 18h18M3 21h12"/>'
1767
1767
  ),
1768
- tplcenter: y(
1768
+ tplcenter: x(
1769
1769
  '<path d="M3 4h18M3 7h18M3 10h12"/><rect x="5" y="12.5" width="14" height="9" rx=".8"/>'
1770
1770
  ),
1771
- rotateleft: y(
1771
+ rotateleft: x(
1772
1772
  '<polyline points="1 4 1 10 7 10"/><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"/>'
1773
1773
  ),
1774
- rotateright: y(
1774
+ rotateright: x(
1775
1775
  '<polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/>'
1776
1776
  ),
1777
- fliphorizontal: y(
1777
+ fliphorizontal: x(
1778
1778
  '<path d="M12 3v18"/><path d="M7 8l-4 4 4 4"/><path d="M17 8l4 4-4 4"/>'
1779
1779
  ),
1780
- flipvertical: y(
1780
+ flipvertical: x(
1781
1781
  '<path d="M3 12h18"/><path d="M8 7l4-4 4 4"/><path d="M8 17l4 4 4-4"/>'
1782
1782
  ),
1783
- check: y('<path d="M5 12.5 9.5 17 19 7"/>'),
1784
- palette: y(
1783
+ check: x('<path d="M5 12.5 9.5 17 19 7"/>'),
1784
+ palette: x(
1785
1785
  '<path d="M12 3a9 9 0 1 0 0 18h1.2a2 2 0 0 0 2-2 2 2 0 0 1 2-2H18a3 3 0 0 0 3-3c0-6.1-4.5-11-9-11z"/><circle class="f" cx="7.8" cy="10.2" r="1.3"/><circle class="f" cx="11.6" cy="7.3" r="1.3"/><circle class="f" cx="15.8" cy="9.6" r="1.3"/><circle class="f" cx="9" cy="14.8" r="1.3"/>'
1786
1786
  ),
1787
- ul_circle: f(
1787
+ ul_circle: v(
1788
1788
  "M280-600v-80h560v80H280Zm0 160v-80h560v80H280Zm0 160v-80h560v80H280ZM160-600q-17 0-28.5-11.5T120-640q0-17 11.5-28.5T160-680q17 0 28.5 11.5T200-640q0 17-11.5 28.5T160-600Zm0 160q-17 0-28.5-11.5T120-480q0-17 11.5-28.5T160-520q17 0 28.5 11.5T200-480q0 17-11.5 28.5T160-440Zm0 160q-17 0-28.5-11.5T120-320q0-17 11.5-28.5T160-360q17 0 28.5 11.5T200-320q0 17-11.5 28.5T160-280Z"
1789
1789
  ),
1790
- ul_square: f(
1790
+ ul_square: v(
1791
1791
  "M80-160v-160h160v160H80Zm240 0v-160h560v160H320ZM80-400v-160h160v160H80Zm240 0v-160h560v160H320ZM80-640v-160h160v160H80Zm240 0v-160h560v160H320Z"
1792
1792
  ),
1793
1793
  ol_alpha: q(["a", "b", "c"]),
1794
1794
  ol_roman: q(["i", "ii", "iii"], 6.5),
1795
1795
  ol_alphau: q(["A", "B", "C"]),
1796
1796
  ol_romanu: q(["I", "II", "III"], 6.5),
1797
- video: y('<rect x="3" y="6" width="13" height="12" rx="1.5"/><path d="M16 10l5-3v10l-5-3z"/>'),
1798
- editic: y('<path d="M4 20l1-4.5L15.5 5 19 8.5 8.5 19 4 20z"/><path d="M13.5 6.5l4 4"/>'),
1799
- letterspacing: y(
1797
+ video: x('<rect x="3" y="6" width="13" height="12" rx="1.5"/><path d="M16 10l5-3v10l-5-3z"/>'),
1798
+ editic: x('<path d="M4 20l1-4.5L15.5 5 19 8.5 8.5 19 4 20z"/><path d="M13.5 6.5l4 4"/>'),
1799
+ letterspacing: x(
1800
1800
  '<text x="2.5" y="13" font-size="12" stroke="none" fill="#222f3e" font-family="Arial" font-weight="bold">A</text><text x="13" y="13" font-size="12" stroke="none" fill="#222f3e" font-family="Arial" font-weight="bold">B</text><path d="M7 18.5h10"/><path class="f" d="M7.5 18.5 4.5 16.6v3.8z"/><path class="f" d="M16.5 18.5l3-1.9v3.8z"/>'
1801
1801
  ),
1802
- emojiic: y(
1802
+ emojiic: x(
1803
1803
  '<circle cx="12" cy="12" r="8.5"/><path d="M8.6 14.3a4.6 4.6 0 0 0 6.8 0"/><path d="M9.2 9.6v.7M14.8 9.6v.7"/>'
1804
1804
  ),
1805
- inlinecodeic: y('<path d="M8.5 8 4.5 12l4 4M15.5 8l4 4-4 4"/><path d="M13 6l-2 12"/>'),
1806
- moverowup: y('<rect x="4" y="15.5" width="16" height="5" rx="1"/><path d="M12 12.5V4M8.5 7.5 12 4l3.5 3.5"/>'),
1807
- moverowdown: y('<rect x="4" y="3.5" width="16" height="5" rx="1"/><path d="M12 11.5V20M8.5 16.5 12 20l3.5-3.5"/>'),
1808
- movecolleft: y('<rect x="15.5" y="4" width="5" height="16" rx="1"/><path d="M12.5 12H4M7.5 8.5 4 12l3.5 3.5"/>'),
1809
- movecolright: y('<rect x="3.5" y="4" width="5" height="16" rx="1"/><path d="M11.5 12H20M16.5 8.5 20 12l-3.5 3.5"/>'),
1810
- codesampleic: y(
1805
+ inlinecodeic: x('<path d="M8.5 8 4.5 12l4 4M15.5 8l4 4-4 4"/><path d="M13 6l-2 12"/>'),
1806
+ moverowup: x('<rect x="4" y="15.5" width="16" height="5" rx="1"/><path d="M12 12.5V4M8.5 7.5 12 4l3.5 3.5"/>'),
1807
+ moverowdown: x('<rect x="4" y="3.5" width="16" height="5" rx="1"/><path d="M12 11.5V20M8.5 16.5 12 20l3.5-3.5"/>'),
1808
+ movecolleft: x('<rect x="15.5" y="4" width="5" height="16" rx="1"/><path d="M12.5 12H4M7.5 8.5 4 12l3.5 3.5"/>'),
1809
+ movecolright: x('<rect x="3.5" y="4" width="5" height="16" rx="1"/><path d="M11.5 12H20M16.5 8.5 20 12l-3.5 3.5"/>'),
1810
+ codesampleic: x(
1811
1811
  '<rect x="3.5" y="4" width="17" height="16" rx="2"/><path d="M3.5 8.5h17"/><path d="M9.5 12 7 14.25l2.5 2.25M14.5 12l2.5 2.25-2.5 2.25"/>'
1812
1812
  )
1813
- }, te = (d) => `<span class="txt">${d}</span>`, bt = /* @__PURE__ */ new Set([
1813
+ }, ue = (h) => `<span class="txt">${h}</span>`, xt = /* @__PURE__ */ new Set([
1814
1814
  "p",
1815
1815
  "div",
1816
1816
  "span",
@@ -1852,7 +1852,7 @@ const at = "undo redo | preview print | importword revhistory | fontfamily fonts
1852
1852
  "figure",
1853
1853
  "figcaption",
1854
1854
  "mark"
1855
- ]), yt = /* @__PURE__ */ new Set([
1855
+ ]), Ct = /* @__PURE__ */ new Set([
1856
1856
  "text-align",
1857
1857
  "direction",
1858
1858
  "unicode-bidi",
@@ -1908,7 +1908,7 @@ const at = "undo redo | preview print | importword revhistory | fontfamily fonts
1908
1908
  "box-sizing",
1909
1909
  "list-style-type",
1910
1910
  "white-space"
1911
- ]), Q = {
1911
+ ]), G = {
1912
1912
  "*": ["dir", "lang", "colspan", "rowspan"],
1913
1913
  a: ["href", "target", "rel", "title"],
1914
1914
  img: ["src", "alt", "width", "height", "title"],
@@ -1917,26 +1917,26 @@ const at = "undo redo | preview print | importword revhistory | fontfamily fonts
1917
1917
  th: ["width", "valign"],
1918
1918
  table: ["width", "cellpadding", "cellspacing"]
1919
1919
  };
1920
- function R(d) {
1921
- const t = {}, e = d.getAttribute && d.getAttribute("style");
1920
+ function P(h) {
1921
+ const t = {}, e = h.getAttribute && h.getAttribute("style");
1922
1922
  return e && e.split(";").forEach((i) => {
1923
1923
  const s = i.indexOf(":");
1924
1924
  s < 1 || (t[i.slice(0, s).trim().toLowerCase()] = i.slice(s + 1).trim());
1925
1925
  }), t;
1926
1926
  }
1927
- function xt(d) {
1928
- return d.replace(/<!--\[if !supportLists\]-->([\s\S]*?)<!--\[endif\]-->/gi, "$1").replace(/<!--\[if !supportLists\]>([\s\S]*?)<!\[endif\]-->/gi, "$1").replace(/<!\[if !supportLists\]>([\s\S]*?)<!\[endif\]>/gi, "$1").replace(/<!--\[if [\s\S]*?<!\[endif\]-->/gi, "").replace(/<!--[\s\S]*?-->/g, "").replace(/<(script|style|xml|title)[\s\S]*?<\/\1>/gi, "").replace(/<\/?(meta|link)[^>]*>/gi, "").replace(/<\?xml[\s\S]*?\?>/gi, "").replace(/<\/?(o|v|w|m|st1):[^>]*>/gi, "");
1927
+ function wt(h) {
1928
+ return h.replace(/<!--\[if !supportLists\]-->([\s\S]*?)<!--\[endif\]-->/gi, "$1").replace(/<!--\[if !supportLists\]>([\s\S]*?)<!\[endif\]-->/gi, "$1").replace(/<!\[if !supportLists\]>([\s\S]*?)<!\[endif\]>/gi, "$1").replace(/<!--\[if [\s\S]*?<!\[endif\]-->/gi, "").replace(/<!--[\s\S]*?-->/g, "").replace(/<(script|style|xml|title)[\s\S]*?<\/\1>/gi, "").replace(/<\/?(meta|link)[^>]*>/gi, "").replace(/<\?xml[\s\S]*?\?>/gi, "").replace(/<\/?(o|v|w|m|st1):[^>]*>/gi, "");
1929
1929
  }
1930
- function Ct(d) {
1931
- return /^[0-9]+[\.\)،]/.test(d) ? { ordered: !0 } : /^[٠-٩۰-۹]+/.test(d) ? { ordered: !0, style: "arabic-indic" } : /^[ivxlc]{2,}[\.\)]/.test(d) ? { ordered: !0, style: "lower-roman" } : /^[IVXLC]{2,}[\.\)]/.test(d) ? { ordered: !0, style: "upper-roman" } : /^[a-z][\.\)]/.test(d) ? { ordered: !0, style: "lower-alpha" } : /^[A-Z][\.\)]/.test(d) ? { ordered: !0, style: "upper-alpha" } : /^[ء-ي][\.\)،-]/.test(d) ? { ordered: !0, style: "arabic-indic" } : { ordered: !1 };
1930
+ function Tt(h) {
1931
+ return /^[0-9]+[\.\)،]/.test(h) ? { ordered: !0 } : /^[٠-٩۰-۹]+/.test(h) ? { ordered: !0, style: "arabic-indic" } : /^[ivxlc]{2,}[\.\)]/.test(h) ? { ordered: !0, style: "lower-roman" } : /^[IVXLC]{2,}[\.\)]/.test(h) ? { ordered: !0, style: "upper-roman" } : /^[a-z][\.\)]/.test(h) ? { ordered: !0, style: "lower-alpha" } : /^[A-Z][\.\)]/.test(h) ? { ordered: !0, style: "upper-alpha" } : /^[ء-ي][\.\)،-]/.test(h) ? { ordered: !0, style: "arabic-indic" } : { ordered: !1 };
1932
1932
  }
1933
- function wt(d) {
1933
+ function St(h) {
1934
1934
  const t = (s) => {
1935
1935
  const l = (s.getAttribute("style") || "") + " " + (s.className || "");
1936
1936
  return /mso-list\s*:(?!\s*ignore)/i.test(l) || /MsoListParagraph/i.test(l);
1937
1937
  }, e = [];
1938
1938
  let i = null;
1939
- Array.from(d.body.querySelectorAll("p")).forEach((s) => {
1939
+ Array.from(h.body.querySelectorAll("p")).forEach((s) => {
1940
1940
  if (!t(s)) {
1941
1941
  i = null;
1942
1942
  return;
@@ -1946,66 +1946,66 @@ function wt(d) {
1946
1946
  }), e.forEach((s) => {
1947
1947
  const l = [], n = s[0];
1948
1948
  s.forEach((o) => {
1949
- var x, C, S;
1950
- const a = +(((x = (o.getAttribute("style") || "").match(/level(\d+)/i)) == null ? void 0 : x[1]) || 1), h = Array.from(o.querySelectorAll("span")).find(
1949
+ var y, C, S;
1950
+ const a = +(((y = (o.getAttribute("style") || "").match(/level(\d+)/i)) == null ? void 0 : y[1]) || 1), d = Array.from(o.querySelectorAll("span")).find(
1951
1951
  (w) => /mso-list\s*:\s*ignore/i.test(w.getAttribute("style") || "")
1952
- ), p = h ? ((C = h.textContent) == null ? void 0 : C.trim()) || "" : (((S = o.textContent) == null ? void 0 : S.trim().match(/^\S{1,4}/)) || [""])[0], { ordered: m, style: g } = Ct(p);
1953
- for (h && h.remove(); l.length && l[l.length - 1].level > a; ) l.pop();
1952
+ ), p = d ? ((C = d.textContent) == null ? void 0 : C.trim()) || "" : (((S = o.textContent) == null ? void 0 : S.trim().match(/^\S{1,4}/)) || [""])[0], { ordered: u, style: g } = Tt(p);
1953
+ for (d && d.remove(); l.length && l[l.length - 1].level > a; ) l.pop();
1954
1954
  if (!l.length || l[l.length - 1].level < a) {
1955
- const w = d.createElement(m ? "ol" : "ul");
1956
- if (m && g && (w.style.listStyleType = g), l.length) {
1955
+ const w = h.createElement(u ? "ol" : "ul");
1956
+ if (u && g && (w.style.listStyleType = g), l.length) {
1957
1957
  const k = l[l.length - 1].list;
1958
1958
  (k.lastElementChild || k).appendChild(w);
1959
1959
  } else
1960
1960
  n.parentNode.insertBefore(w, n);
1961
1961
  l.push({ list: w, level: a });
1962
1962
  }
1963
- const u = d.createElement("li"), v = R(o), b = ["text-align", "direction", "unicode-bidi", "color", "font-size", "font-family", "background-color"].filter((w) => v[w]).map((w) => w + ":" + v[w]).join(";");
1964
- for (b && u.setAttribute("style", b), o.getAttribute("dir") && u.setAttribute("dir", o.getAttribute("dir")); o.firstChild; ) u.appendChild(o.firstChild);
1965
- l[l.length - 1].list.appendChild(u), o.remove();
1963
+ const m = h.createElement("li"), f = P(o), b = ["text-align", "direction", "unicode-bidi", "color", "font-size", "font-family", "background-color"].filter((w) => f[w]).map((w) => w + ":" + f[w]).join(";");
1964
+ for (b && m.setAttribute("style", b), o.getAttribute("dir") && m.setAttribute("dir", o.getAttribute("dir")); o.firstChild; ) m.appendChild(o.firstChild);
1965
+ l[l.length - 1].list.appendChild(m), o.remove();
1966
1966
  });
1967
1967
  });
1968
1968
  }
1969
- function Tt(d) {
1970
- d.querySelectorAll('b[id^="docs-internal-guid"]').forEach((t) => {
1969
+ function Et(h) {
1970
+ h.querySelectorAll('b[id^="docs-internal-guid"]').forEach((t) => {
1971
1971
  for (; t.firstChild; ) t.parentNode.insertBefore(t.firstChild, t);
1972
1972
  t.remove();
1973
1973
  });
1974
1974
  }
1975
- function St(d) {
1976
- d.querySelectorAll("table").forEach((t) => {
1975
+ function Mt(h) {
1976
+ h.querySelectorAll("table").forEach((t) => {
1977
1977
  const e = t;
1978
- R(e)["border-collapse"] || (e.style.borderCollapse = "collapse");
1979
- }), d.querySelectorAll("[align]").forEach((t) => {
1978
+ P(e)["border-collapse"] || (e.style.borderCollapse = "collapse");
1979
+ }), h.querySelectorAll("[align]").forEach((t) => {
1980
1980
  const e = t, i = e.getAttribute("align").toLowerCase();
1981
1981
  e.tagName.toLowerCase() === "table" ? i === "center" ? (e.style.marginLeft = e.style.marginLeft || "auto", e.style.marginRight = e.style.marginRight || "auto") : i === "right" ? e.style.marginLeft = e.style.marginLeft || "auto" : i === "left" && (e.style.marginRight = e.style.marginRight || "auto") : ["left", "right", "center", "justify"].includes(i) && (e.style.textAlign = e.style.textAlign || i, Array.from(e.children).forEach((s) => {
1982
1982
  if (s.tagName.toLowerCase() !== "table") return;
1983
1983
  const l = s;
1984
1984
  i === "center" ? (l.style.marginLeft = l.style.marginLeft || "auto", l.style.marginRight = l.style.marginRight || "auto") : i === "right" ? l.style.marginLeft = l.style.marginLeft || "auto" : i === "left" && (l.style.marginRight = l.style.marginRight || "auto");
1985
1985
  })), e.removeAttribute("align");
1986
- }), d.querySelectorAll("center table").forEach((t) => {
1986
+ }), h.querySelectorAll("center table").forEach((t) => {
1987
1987
  const e = t;
1988
1988
  e.style.marginLeft = e.style.marginLeft || "auto", e.style.marginRight = e.style.marginRight || "auto";
1989
- }), d.querySelectorAll("[bgcolor]").forEach((t) => {
1989
+ }), h.querySelectorAll("[bgcolor]").forEach((t) => {
1990
1990
  const e = t;
1991
1991
  e.style.backgroundColor = e.style.backgroundColor || e.getAttribute("bgcolor"), e.removeAttribute("bgcolor");
1992
1992
  });
1993
1993
  }
1994
- function Z(d, t) {
1995
- Array.from(d.childNodes).forEach((e) => {
1994
+ function Z(h, t) {
1995
+ Array.from(h.childNodes).forEach((e) => {
1996
1996
  if (e.nodeType === Node.COMMENT_NODE) {
1997
1997
  e.remove();
1998
1998
  return;
1999
1999
  }
2000
2000
  if (e.nodeType !== Node.ELEMENT_NODE) return;
2001
2001
  const i = e, s = i.tagName.toLowerCase();
2002
- if (!bt.has(s)) {
2002
+ if (!xt.has(s)) {
2003
2003
  if (s === "font") {
2004
2004
  const r = t.createElement("span");
2005
2005
  i.getAttribute("style") && r.setAttribute("style", i.getAttribute("style")), i.getAttribute("color") && (r.style.color = i.getAttribute("color")), i.getAttribute("face") && (r.style.fontFamily = i.getAttribute("face"));
2006
2006
  const a = i.getAttribute("size");
2007
2007
  if (a && !r.style.fontSize) {
2008
- const h = {
2008
+ const d = {
2009
2009
  1: "8pt",
2010
2010
  2: "10pt",
2011
2011
  3: "12pt",
@@ -2014,7 +2014,7 @@ function Z(d, t) {
2014
2014
  6: "24pt",
2015
2015
  7: "36pt"
2016
2016
  };
2017
- h[a] && (r.style.fontSize = h[a]);
2017
+ d[a] && (r.style.fontSize = d[a]);
2018
2018
  }
2019
2019
  for (; i.firstChild; ) r.appendChild(i.firstChild);
2020
2020
  i.replaceWith(r), Z(r, t);
@@ -2024,7 +2024,7 @@ function Z(d, t) {
2024
2024
  i.remove();
2025
2025
  return;
2026
2026
  }
2027
- const l = /* @__PURE__ */ new Set([...Q["*"] || [], ...Q[s] || []]);
2027
+ const l = /* @__PURE__ */ new Set([...G["*"] || [], ...G[s] || []]);
2028
2028
  if (Array.from(i.attributes).forEach((r) => {
2029
2029
  const a = r.name.toLowerCase();
2030
2030
  a !== "style" && !l.has(a) && i.removeAttribute(r.name);
@@ -2040,19 +2040,19 @@ function Z(d, t) {
2040
2040
  return;
2041
2041
  }
2042
2042
  }
2043
- const n = R(i), o = [];
2043
+ const n = P(i), o = [];
2044
2044
  for (const [r, a] of Object.entries(n))
2045
- yt.has(r) && (/expression|javascript|url\s*\(\s*['"]?\s*file:/i.test(a) || r === "font-weight" && /^(400|normal)$/i.test(a) || r === "font-style" && /^normal$/i.test(a) || r === "text-decoration" && /^none$/i.test(a) || o.push(r + ":" + a));
2045
+ Ct.has(r) && (/expression|javascript|url\s*\(\s*['"]?\s*file:/i.test(a) || r === "font-weight" && /^(400|normal)$/i.test(a) || r === "font-style" && /^normal$/i.test(a) || r === "text-decoration" && /^none$/i.test(a) || o.push(r + ":" + a));
2046
2046
  if (o.length ? i.setAttribute("style", o.join(";")) : i.removeAttribute("style"), i.removeAttribute("class"), Z(i, t), s === "span" && !i.attributes.length) {
2047
2047
  for (; i.firstChild; ) i.parentNode.insertBefore(i.firstChild, i);
2048
2048
  i.remove();
2049
2049
  }
2050
2050
  });
2051
2051
  }
2052
- function Mt(d) {
2052
+ function Lt(h) {
2053
2053
  const t = [], e = /<style[^>]*>([\s\S]*?)<\/style>/gi;
2054
2054
  let i;
2055
- for (; i = e.exec(d); ) {
2055
+ for (; i = e.exec(h); ) {
2056
2056
  let s = i[1].replace(/<!--|-->/g, "").replace(/\/\*[\s\S]*?\*\//g, "");
2057
2057
  s = s.replace(/@media[^{]*\{(?:[^{}]*\{[^{}]*\})*[^{}]*\}/gi, ""), s = s.replace(/@[\w-]+[^{]*\{[^{}]*\}/g, "");
2058
2058
  let l;
@@ -2067,13 +2067,13 @@ function Mt(d) {
2067
2067
  }
2068
2068
  return t;
2069
2069
  }
2070
- function Et(d, t) {
2070
+ function Ht(h, t) {
2071
2071
  if (!t.length) return;
2072
2072
  const e = /* @__PURE__ */ new Map();
2073
2073
  t.forEach(({ sel: i, decls: s }) => {
2074
2074
  let l;
2075
2075
  try {
2076
- l = d.querySelectorAll(i);
2076
+ l = h.querySelectorAll(i);
2077
2077
  } catch {
2078
2078
  return;
2079
2079
  }
@@ -2084,24 +2084,24 @@ function Et(d, t) {
2084
2084
  });
2085
2085
  });
2086
2086
  }), e.forEach((i, s) => {
2087
- const l = R(s), n = s.hasAttribute("dir"), o = s.hasAttribute("align"), r = Object.entries(i).filter(([p]) => !(p in l || (p === "direction" || p === "unicode-bidi") && n || p === "text-align" && (o || n) || (p === "background" || p === "background-color") && s.hasAttribute("bgcolor")));
2087
+ const l = P(s), n = s.hasAttribute("dir"), o = s.hasAttribute("align"), r = Object.entries(i).filter(([p]) => !(p in l || (p === "direction" || p === "unicode-bidi") && n || p === "text-align" && (o || n) || (p === "background" || p === "background-color") && s.hasAttribute("bgcolor")));
2088
2088
  if (!r.length) return;
2089
- const a = r.map(([p, m]) => p + ":" + m).join(";"), h = s.getAttribute("style");
2090
- s.setAttribute("style", h ? a + ";" + h : a);
2089
+ const a = r.map(([p, u]) => p + ":" + u).join(";"), d = s.getAttribute("style");
2090
+ s.setAttribute("style", d ? a + ";" + d : a);
2091
2091
  });
2092
2092
  }
2093
- function st(d) {
2094
- return d.replace(/[ﭐ-﷿ﹰ-ﻼ]+/g, (t) => t.normalize("NFKC"));
2093
+ function lt(h) {
2094
+ return h.replace(/[ﭐ-﷿ﹰ-ﻼ]+/g, (t) => t.normalize("NFKC"));
2095
2095
  }
2096
- function Lt(d) {
2097
- const t = d.createTreeWalker(d.body, NodeFilter.SHOW_TEXT, null);
2096
+ function kt(h) {
2097
+ const t = h.createTreeWalker(h.body, NodeFilter.SHOW_TEXT, null);
2098
2098
  let e;
2099
2099
  for (; e = t.nextNode(); )
2100
- /[ﭐ-﷿ﹰ-ﻼ]/.test(e.nodeValue || "") && (e.nodeValue = st(e.nodeValue || ""));
2100
+ /[ﭐ-﷿ﹰ-ﻼ]/.test(e.nodeValue || "") && (e.nodeValue = lt(e.nodeValue || ""));
2101
2101
  }
2102
- function Ht(d, t = "ltr") {
2103
- const e = Mt(d), i = new DOMParser().parseFromString(xt(d), "text/html");
2104
- Et(i, e), /class="?Mso|mso-|urn:schemas-microsoft-com/i.test(i.body.innerHTML) && wt(i), Tt(i), St(i), Z(i.body, i), Lt(i);
2102
+ function At(h, t = "ltr") {
2103
+ const e = Lt(h), i = new DOMParser().parseFromString(wt(h), "text/html");
2104
+ Ht(i, e), /class="?Mso|mso-|urn:schemas-microsoft-com/i.test(i.body.innerHTML) && St(i), Et(i), Mt(i), Z(i.body, i), kt(i);
2105
2105
  const s = (l) => {
2106
2106
  var n;
2107
2107
  return l && l.tagName === "P" && !((n = l.textContent) != null && n.trim()) && !l.querySelector("img,table");
@@ -2110,23 +2110,23 @@ function Ht(d, t = "ltr") {
2110
2110
  for (; s(i.body.lastElementChild); ) i.body.lastElementChild.remove();
2111
2111
  return i.body.innerHTML.trim();
2112
2112
  }
2113
- function kt(d) {
2114
- const t = st(d).replace(/\r/g, ""), e = (i) => i.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
2113
+ function It(h) {
2114
+ const t = lt(h).replace(/\r/g, ""), e = (i) => i.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
2115
2115
  return /\n/.test(t) ? t.split(/\n{2,}/).map((i) => `<p dir="auto">${e(i).replace(/\n/g, "<br>") || "<br>"}</p>`).join("") : e(t);
2116
2116
  }
2117
- const At = 10 * 1024 * 1024, lt = /^(https?:|data:image\/|blob:)/i;
2118
- function G(d, t) {
2117
+ const qt = 10 * 1024 * 1024, ot = /^(https?:|data:image\/|blob:)/i;
2118
+ function Y(h, t) {
2119
2119
  const e = [], i = "{\\" + t;
2120
2120
  let s = 0;
2121
- for (; (s = d.indexOf(i, s)) !== -1; ) {
2122
- const l = d[s + i.length];
2121
+ for (; (s = h.indexOf(i, s)) !== -1; ) {
2122
+ const l = h[s + i.length];
2123
2123
  if (l && /[a-z0-9]/i.test(l)) {
2124
2124
  s += i.length;
2125
2125
  continue;
2126
2126
  }
2127
2127
  let n = 0, o = s;
2128
- for (; o < d.length; o++) {
2129
- const r = d[o];
2128
+ for (; o < h.length; o++) {
2129
+ const r = h[o];
2130
2130
  if (r === "\\") {
2131
2131
  o++;
2132
2132
  continue;
@@ -2135,78 +2135,78 @@ function G(d, t) {
2135
2135
  else if (r === "}" && (n--, !n))
2136
2136
  break;
2137
2137
  }
2138
- e.push({ start: s, end: o + 1, body: d.slice(s + i.length, o) }), s = o + 1;
2138
+ e.push({ start: s, end: o + 1, body: h.slice(s + i.length, o) }), s = o + 1;
2139
2139
  }
2140
2140
  return e;
2141
2141
  }
2142
- function It(d) {
2143
- const t = new Uint8Array(d.length / 2);
2144
- for (let e = 0; e < t.length; e++) t[e] = parseInt(d.substr(e * 2, 2), 16);
2142
+ function Bt(h) {
2143
+ const t = new Uint8Array(h.length / 2);
2144
+ for (let e = 0; e < t.length; e++) t[e] = parseInt(h.substr(e * 2, 2), 16);
2145
2145
  return t;
2146
2146
  }
2147
- function F(d) {
2147
+ function F(h) {
2148
2148
  let t = "";
2149
- for (let e = 0; e < d.length; e++) t += String.fromCharCode(d[e]);
2149
+ for (let e = 0; e < h.length; e++) t += String.fromCharCode(h[e]);
2150
2150
  return btoa(t);
2151
2151
  }
2152
- function Y(d, t) {
2153
- t: for (let e = 0; e + t.length <= d.length; e++) {
2154
- for (let i = 0; i < t.length; i++) if (d[e + i] !== t[i]) continue t;
2152
+ function K(h, t) {
2153
+ t: for (let e = 0; e + t.length <= h.length; e++) {
2154
+ for (let i = 0; i < t.length; i++) if (h[e + i] !== t[i]) continue t;
2155
2155
  return e;
2156
2156
  }
2157
2157
  return -1;
2158
2158
  }
2159
- const qt = [137, 80, 78, 71], Bt = [255, 216, 255];
2160
- function Nt(d) {
2159
+ const Nt = [137, 80, 78, 71], Rt = [255, 216, 255];
2160
+ function Zt(h) {
2161
2161
  let t = null;
2162
- if (/\\pngblip/.test(d) ? t = "image/png" : /\\jpegblip/.test(d) ? t = "image/jpeg" : (/\\wmetafile\d*/.test(d) || /\\emfblip/.test(d)) && (t = "metafile"), !t) return null;
2163
- let e = d.replace(/\{[^{}]*\}/g, "").replace(/\\[a-z]+-?\d*\s?/gi, "").replace(/[^0-9a-fA-F]/g, "");
2162
+ if (/\\pngblip/.test(h) ? t = "image/png" : /\\jpegblip/.test(h) ? t = "image/jpeg" : (/\\wmetafile\d*/.test(h) || /\\emfblip/.test(h)) && (t = "metafile"), !t) return null;
2163
+ let e = h.replace(/\{[^{}]*\}/g, "").replace(/\\[a-z]+-?\d*\s?/gi, "").replace(/[^0-9a-fA-F]/g, "");
2164
2164
  if (e.length % 2 && (e = e.slice(0, -1)), !e) return null;
2165
- const i = It(e);
2165
+ const i = Bt(e);
2166
2166
  if (t === "metafile") {
2167
- const s = Y(i, qt);
2167
+ const s = K(i, Nt);
2168
2168
  if (s >= 0) return "data:image/png;base64," + F(i.slice(s));
2169
- const l = Y(i, Bt);
2169
+ const l = K(i, Rt);
2170
2170
  return l >= 0 ? "data:image/jpeg;base64," + F(i.slice(l)) : null;
2171
2171
  }
2172
2172
  return "data:" + t + ";base64," + F(i);
2173
2173
  }
2174
- function Zt(d) {
2175
- if (!d || d.indexOf("\\pict") === -1) return [];
2176
- let t = d;
2177
- G(d, "nonshppict").reverse().forEach((i) => {
2174
+ function Dt(h) {
2175
+ if (!h || h.indexOf("\\pict") === -1) return [];
2176
+ let t = h;
2177
+ Y(h, "nonshppict").reverse().forEach((i) => {
2178
2178
  t = t.slice(0, i.start) + t.slice(i.end);
2179
2179
  });
2180
- let e = At;
2181
- return G(t, "pict").map((i) => {
2180
+ let e = qt;
2181
+ return Y(t, "pict").map((i) => {
2182
2182
  if (e <= 0) return null;
2183
- const s = Nt(i.body);
2183
+ const s = Zt(i.body);
2184
2184
  return s && (e -= s.length * 0.75), s;
2185
2185
  });
2186
2186
  }
2187
- function nt(d, t) {
2188
- if (!d || !t.length) return { html: d, injected: [] };
2187
+ function nt(h, t) {
2188
+ if (!h || !t.length) return { html: h, injected: [] };
2189
2189
  const e = [];
2190
2190
  let i = 0;
2191
- return { html: d.replace(/<img\b[^>]*>/gi, (l) => {
2191
+ return { html: h.replace(/<img\b[^>]*>/gi, (l) => {
2192
2192
  const n = (l.match(/\ssrc\s*=\s*["']?([^"'\s>]+)/i) || [])[1] || "";
2193
- if (lt.test(n)) return l;
2193
+ if (ot.test(n)) return l;
2194
2194
  const o = t[i++];
2195
2195
  return o ? (e.push(o), /\ssrc\s*=\s*["']/i.test(l) ? l.replace(/(\ssrc\s*=\s*)(["'])[^"']*\2/i, '$1"' + o + '"') : l.replace(/(\ssrc\s*=\s*)[^\s>]+/i, '$1"' + o + '"')) : l;
2196
2196
  }), injected: e };
2197
2197
  }
2198
- function Pt(d, t) {
2199
- return !d || !t ? { html: d, injected: [] } : nt(d, Zt(t));
2198
+ function Pt(h, t) {
2199
+ return !h || !t ? { html: h, injected: [] } : nt(h, Dt(t));
2200
2200
  }
2201
- function Rt(d) {
2202
- const t = d.match(/<img\b[^>]*>/gi);
2201
+ function Ot(h) {
2202
+ const t = h.match(/<img\b[^>]*>/gi);
2203
2203
  return t ? t.filter((e) => {
2204
2204
  const i = (e.match(/\ssrc\s*=\s*["']?([^"'\s>]+)/i) || [])[1] || "";
2205
- return !lt.test(i);
2205
+ return !ot.test(i);
2206
2206
  }).length : 0;
2207
2207
  }
2208
- function Dt(d, t) {
2209
- const e = d.match(/^data:([^;,]+);base64,(.*)$/);
2208
+ function Ft(h, t) {
2209
+ const e = h.match(/^data:([^;,]+);base64,(.*)$/);
2210
2210
  if (!e) return null;
2211
2211
  const i = (e[1].split("/")[1] || "png").replace(/[^a-z0-9]/gi, "") || "png";
2212
2212
  try {
@@ -2217,10 +2217,10 @@ function Dt(d, t) {
2217
2217
  return null;
2218
2218
  }
2219
2219
  }
2220
- function Ft(d) {
2221
- const t = new DataView(d), e = /* @__PURE__ */ new Map();
2220
+ function $t(h) {
2221
+ const t = new DataView(h), e = /* @__PURE__ */ new Map();
2222
2222
  let i = -1;
2223
- for (let o = d.byteLength - 22; o >= Math.max(0, d.byteLength - 22 - 65535); o--)
2223
+ for (let o = h.byteLength - 22; o >= Math.max(0, h.byteLength - 22 - 65535); o--)
2224
2224
  if (t.getUint32(o, !0) === 101010256) {
2225
2225
  i = o;
2226
2226
  break;
@@ -2230,38 +2230,38 @@ function Ft(d) {
2230
2230
  let l = t.getUint32(i + 16, !0);
2231
2231
  const n = new TextDecoder();
2232
2232
  for (let o = 0; o < s && t.getUint32(l, !0) === 33639248; o++) {
2233
- const r = t.getUint16(l + 10, !0), a = t.getUint32(l + 20, !0), h = t.getUint16(l + 28, !0), p = t.getUint16(l + 30, !0), m = t.getUint16(l + 32, !0), g = t.getUint32(l + 42, !0), u = n.decode(new Uint8Array(d, l + 46, h));
2234
- e.set(u, { name: u, method: r, compSize: a, localOffset: g }), l += 46 + h + p + m;
2233
+ const r = t.getUint16(l + 10, !0), a = t.getUint32(l + 20, !0), d = t.getUint16(l + 28, !0), p = t.getUint16(l + 30, !0), u = t.getUint16(l + 32, !0), g = t.getUint32(l + 42, !0), m = n.decode(new Uint8Array(h, l + 46, d));
2234
+ e.set(m, { name: m, method: r, compSize: a, localOffset: g }), l += 46 + d + p + u;
2235
2235
  }
2236
2236
  return e;
2237
2237
  }
2238
- async function K(d, t) {
2239
- const e = new DataView(d, t.localOffset);
2238
+ async function J(h, t) {
2239
+ const e = new DataView(h, t.localOffset);
2240
2240
  if (e.getUint32(0, !0) !== 67324752) throw new Error("Bad local header");
2241
- const i = e.getUint16(26, !0), s = e.getUint16(28, !0), l = t.localOffset + 30 + i + s, n = new Uint8Array(d.slice(l, l + t.compSize));
2241
+ const i = e.getUint16(26, !0), s = e.getUint16(28, !0), l = t.localOffset + 30 + i + s, n = new Uint8Array(h.slice(l, l + t.compSize));
2242
2242
  if (t.method === 0) return n;
2243
2243
  if (t.method !== 8) throw new Error("Unsupported compression method " + t.method);
2244
2244
  const o = new Blob([n]).stream().pipeThrough(new DecompressionStream("deflate-raw"));
2245
2245
  return new Uint8Array(await new Response(o).arrayBuffer());
2246
2246
  }
2247
- const J = (d) => d.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;"), P = (d, t) => Array.from(d.children).filter((e) => e.localName === t), M = (d, ...t) => {
2248
- let e = d;
2247
+ const tt = (h) => h.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;"), D = (h, t) => Array.from(h.children).filter((e) => e.localName === t), E = (h, ...t) => {
2248
+ let e = h;
2249
2249
  for (const i of t) {
2250
2250
  if (!e) return null;
2251
2251
  e = Array.from(e.children).find((s) => s.localName === i) || null;
2252
2252
  }
2253
2253
  return e;
2254
- }, T = (d, t = "val") => {
2255
- if (!d) return "";
2256
- for (const e of Array.from(d.attributes))
2254
+ }, T = (h, t = "val") => {
2255
+ if (!h) return "";
2256
+ for (const e of Array.from(h.attributes))
2257
2257
  if (e.localName === t) return e.value;
2258
2258
  return "";
2259
- }, B = (d, t) => {
2260
- const e = d ? M(d, t) : null;
2259
+ }, B = (h, t) => {
2260
+ const e = h ? E(h, t) : null;
2261
2261
  if (!e) return !1;
2262
2262
  const i = T(e);
2263
2263
  return i !== "false" && i !== "0";
2264
- }, tt = {
2264
+ }, et = {
2265
2265
  yellow: "#FFFF00",
2266
2266
  green: "#00FF00",
2267
2267
  cyan: "#00FFFF",
@@ -2278,7 +2278,7 @@ const J = (d) => d.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&
2278
2278
  lightGray: "#D3D3D3",
2279
2279
  black: "#000000",
2280
2280
  white: "#FFFFFF"
2281
- }, Ot = {
2281
+ }, _t = {
2282
2282
  png: "image/png",
2283
2283
  jpg: "image/jpeg",
2284
2284
  jpeg: "image/jpeg",
@@ -2286,13 +2286,13 @@ const J = (d) => d.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&
2286
2286
  bmp: "image/bmp",
2287
2287
  webp: "image/webp"
2288
2288
  };
2289
- function $t(d) {
2289
+ function zt(h) {
2290
2290
  let t = "";
2291
- for (let e = 0; e < d.length; e += 32768)
2292
- t += String.fromCharCode(...d.subarray(e, e + 32768));
2291
+ for (let e = 0; e < h.length; e += 32768)
2292
+ t += String.fromCharCode(...h.subarray(e, e + 32768));
2293
2293
  return btoa(t);
2294
2294
  }
2295
- class _t {
2295
+ class Ut {
2296
2296
  constructor(t, e, i) {
2297
2297
  this.rels = t, this.images = e, this.numFmt = i;
2298
2298
  }
@@ -2317,20 +2317,20 @@ class _t {
2317
2317
  return s(0), e || "<p><br></p>";
2318
2318
  }
2319
2319
  paraList(t) {
2320
- const e = M(t, "pPr", "numPr");
2320
+ const e = E(t, "pPr", "numPr");
2321
2321
  if (!e) return null;
2322
- const i = T(M(e, "numId"));
2322
+ const i = T(E(e, "numId"));
2323
2323
  if (!i || i === "0") return null;
2324
- const s = parseInt(T(M(e, "ilvl")) || "0", 10) || 0;
2324
+ const s = parseInt(T(E(e, "ilvl")) || "0", 10) || 0;
2325
2325
  return { type: this.numFmt.get(i) || "ul", ilvl: Math.min(s, 8) };
2326
2326
  }
2327
2327
  convertPara(t) {
2328
- const e = M(t, "pPr"), i = T(M(t, "pPr", "pStyle"));
2328
+ const e = E(t, "pPr"), i = T(E(t, "pPr", "pStyle"));
2329
2329
  let s = "p";
2330
2330
  const l = /^Heading([1-6])$/i.exec(i);
2331
2331
  l ? s = "h" + l[1] : /^Title$/i.test(i) && (s = "h1");
2332
- const n = [], o = T(M(t, "pPr", "jc"));
2333
- o === "center" ? n.push("text-align:center") : o === "right" || o === "end" ? n.push("text-align:right") : (o === "both" || o === "distribute") && n.push("text-align:justify"), e && M(e, "bidi") && n.push("direction:rtl");
2332
+ const n = [], o = T(E(t, "pPr", "jc"));
2333
+ o === "center" ? n.push("text-align:center") : o === "right" || o === "end" ? n.push("text-align:right") : (o === "both" || o === "distribute") && n.push("text-align:justify"), e && E(e, "bidi") && n.push("direction:rtl");
2334
2334
  const r = this.runsOf(t), a = n.length ? ` style="${n.join(";")}"` : "";
2335
2335
  return `<${s}${a}>${r || "<br>"}</${s}>`;
2336
2336
  }
@@ -2343,26 +2343,26 @@ class _t {
2343
2343
  const l = T(i, "anchor");
2344
2344
  !s && l && (s = "#" + l);
2345
2345
  const n = this.runsOf(i);
2346
- e += s ? `<a href="${J(s)}">${n}</a>` : n;
2346
+ e += s ? `<a href="${tt(s)}">${n}</a>` : n;
2347
2347
  } else (i.localName === "smartTag" || i.localName === "ins") && (e += this.runsOf(i));
2348
2348
  return e;
2349
2349
  }
2350
2350
  convertRun(t) {
2351
- const e = M(t, "rPr");
2351
+ const e = E(t, "rPr");
2352
2352
  let i = "";
2353
2353
  for (const p of Array.from(t.children))
2354
- p.localName === "t" ? i += J(p.textContent || "") : p.localName === "br" || p.localName === "cr" ? i += "<br>" : p.localName === "tab" ? i += "&emsp;" : (p.localName === "drawing" || p.localName === "pict" || p.localName === "object") && (i += this.convertImage(p));
2354
+ p.localName === "t" ? i += tt(p.textContent || "") : p.localName === "br" || p.localName === "cr" ? i += "<br>" : p.localName === "tab" ? i += "&emsp;" : (p.localName === "drawing" || p.localName === "pict" || p.localName === "object") && (i += this.convertImage(p));
2355
2355
  if (!i) return "";
2356
- const s = [], l = T(e ? M(e, "color") : null);
2356
+ const s = [], l = T(e ? E(e, "color") : null);
2357
2357
  l && l !== "auto" && s.push("color:#" + l);
2358
- const n = T(e ? M(e, "highlight") : null);
2359
- n && tt[n] && s.push("background-color:" + tt[n]);
2360
- const o = parseFloat(T(e ? M(e, "sz") : null));
2358
+ const n = T(e ? E(e, "highlight") : null);
2359
+ n && et[n] && s.push("background-color:" + et[n]);
2360
+ const o = parseFloat(T(e ? E(e, "sz") : null));
2361
2361
  o && s.push("font-size:" + Math.round(o / 2 * (4 / 3)) + "px");
2362
- const r = e ? M(e, "rFonts") : null, a = T(r, "ascii") || T(r, "cs");
2363
- a && s.push(`font-family:'${a}'`), s.length && (i = `<span style="${s.join(";")}">${i}</span>`), B(e, "b") && (i = `<strong>${i}</strong>`), B(e, "i") && (i = `<em>${i}</em>`), B(e, "u") && T(M(e, "u")) !== "none" && (i = `<u>${i}</u>`), B(e, "strike") && (i = `<s>${i}</s>`);
2364
- const h = T(e ? M(e, "vertAlign") : null);
2365
- return h === "superscript" ? i = `<sup>${i}</sup>` : h === "subscript" && (i = `<sub>${i}</sub>`), i;
2362
+ const r = e ? E(e, "rFonts") : null, a = T(r, "ascii") || T(r, "cs");
2363
+ a && s.push(`font-family:'${a}'`), s.length && (i = `<span style="${s.join(";")}">${i}</span>`), B(e, "b") && (i = `<strong>${i}</strong>`), B(e, "i") && (i = `<em>${i}</em>`), B(e, "u") && T(E(e, "u")) !== "none" && (i = `<u>${i}</u>`), B(e, "strike") && (i = `<s>${i}</s>`);
2364
+ const d = T(e ? E(e, "vertAlign") : null);
2365
+ return d === "superscript" ? i = `<sup>${i}</sup>` : d === "subscript" && (i = `<sub>${i}</sub>`), i;
2366
2366
  }
2367
2367
  convertImage(t) {
2368
2368
  let e = "", i = 0;
@@ -2381,10 +2381,10 @@ class _t {
2381
2381
  }
2382
2382
  convertTable(t) {
2383
2383
  let e = '<table style="border-collapse:collapse;width:100%"><tbody>';
2384
- for (const i of P(t, "tr")) {
2384
+ for (const i of D(t, "tr")) {
2385
2385
  e += "<tr>";
2386
- for (const s of P(i, "tc")) {
2387
- const l = parseInt(T(M(s, "tcPr", "gridSpan")) || "1", 10) || 1, n = l > 1 ? ` colspan="${l}"` : "";
2386
+ for (const s of D(i, "tc")) {
2387
+ const l = parseInt(T(E(s, "tcPr", "gridSpan")) || "1", 10) || 1, n = l > 1 ? ` colspan="${l}"` : "";
2388
2388
  let o = "";
2389
2389
  for (const r of Array.from(s.children))
2390
2390
  r.localName === "p" ? o += this.convertPara(r) : r.localName === "tbl" && (o += this.convertTable(r));
@@ -2395,114 +2395,188 @@ class _t {
2395
2395
  return e + "</tbody></table>";
2396
2396
  }
2397
2397
  }
2398
- async function zt(d) {
2399
- const t = d instanceof ArrayBuffer ? d : await d.arrayBuffer(), e = Ft(t), i = new TextDecoder(), s = async (u) => {
2400
- const v = e.get(u);
2401
- return v ? new DOMParser().parseFromString(i.decode(await K(t, v)), "application/xml") : null;
2398
+ async function Wt(h) {
2399
+ const t = h instanceof ArrayBuffer ? h : await h.arrayBuffer(), e = $t(t), i = new TextDecoder(), s = async (m) => {
2400
+ const f = e.get(m);
2401
+ return f ? new DOMParser().parseFromString(i.decode(await J(t, f)), "application/xml") : null;
2402
2402
  }, l = await s("word/document.xml"), n = l == null ? void 0 : l.getElementsByTagName("*");
2403
2403
  let o = null;
2404
2404
  if (n) {
2405
- for (const u of Array.from(n))
2406
- if (u.localName === "body") {
2407
- o = u;
2405
+ for (const m of Array.from(n))
2406
+ if (m.localName === "body") {
2407
+ o = m;
2408
2408
  break;
2409
2409
  }
2410
2410
  }
2411
2411
  if (!o) throw new Error("word/document.xml missing or invalid");
2412
- const r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), h = await s("word/_rels/document.xml.rels");
2413
- if (h)
2414
- for (const u of Array.from(h.getElementsByTagName("*"))) {
2415
- if (u.localName !== "Relationship") continue;
2416
- const v = u.getAttribute("Id") || "", b = u.getAttribute("Target") || "", x = u.getAttribute("Type") || "";
2417
- /hyperlink/i.test(x) ? r.set(v, b) : /image/i.test(x) && a.set(v, b);
2412
+ const r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), d = await s("word/_rels/document.xml.rels");
2413
+ if (d)
2414
+ for (const m of Array.from(d.getElementsByTagName("*"))) {
2415
+ if (m.localName !== "Relationship") continue;
2416
+ const f = m.getAttribute("Id") || "", b = m.getAttribute("Target") || "", y = m.getAttribute("Type") || "";
2417
+ /hyperlink/i.test(y) ? r.set(f, b) : /image/i.test(y) && a.set(f, b);
2418
2418
  }
2419
2419
  const p = /* @__PURE__ */ new Map();
2420
- for (const [u, v] of a) {
2421
- const b = v.startsWith("/") ? v.slice(1) : "word/" + v.replace(/^\.\//, ""), x = e.get(b);
2422
- if (!x) continue;
2423
- const C = (b.split(".").pop() || "").toLowerCase(), S = Ot[C];
2420
+ for (const [m, f] of a) {
2421
+ const b = f.startsWith("/") ? f.slice(1) : "word/" + f.replace(/^\.\//, ""), y = e.get(b);
2422
+ if (!y) continue;
2423
+ const C = (b.split(".").pop() || "").toLowerCase(), S = _t[C];
2424
2424
  if (S)
2425
2425
  try {
2426
- p.set(u, `data:${S};base64,${$t(await K(t, x))}`);
2426
+ p.set(m, `data:${S};base64,${zt(await J(t, y))}`);
2427
2427
  } catch {
2428
2428
  }
2429
2429
  }
2430
- const m = /* @__PURE__ */ new Map(), g = await s("word/numbering.xml");
2430
+ const u = /* @__PURE__ */ new Map(), g = await s("word/numbering.xml");
2431
2431
  if (g) {
2432
- const u = /* @__PURE__ */ new Map(), v = Array.from(g.getElementsByTagName("*"));
2433
- for (const b of v) {
2432
+ const m = /* @__PURE__ */ new Map(), f = Array.from(g.getElementsByTagName("*"));
2433
+ for (const b of f) {
2434
2434
  if (b.localName !== "abstractNum") continue;
2435
- const x = T(b, "abstractNumId"), C = P(b, "lvl").find((w) => T(w, "ilvl") === "0") || P(b, "lvl")[0], S = C ? T(M(C, "numFmt")) : "";
2436
- u.set(x, S === "bullet" ? "ul" : "ol");
2435
+ const y = T(b, "abstractNumId"), C = D(b, "lvl").find((w) => T(w, "ilvl") === "0") || D(b, "lvl")[0], S = C ? T(E(C, "numFmt")) : "";
2436
+ m.set(y, S === "bullet" ? "ul" : "ol");
2437
2437
  }
2438
- for (const b of v) {
2438
+ for (const b of f) {
2439
2439
  if (b.localName !== "num") continue;
2440
- const x = T(b, "numId"), C = T(M(b, "abstractNumId"));
2441
- m.set(x, u.get(C) || "ul");
2440
+ const y = T(b, "numId"), C = T(E(b, "abstractNumId"));
2441
+ u.set(y, m.get(C) || "ul");
2442
2442
  }
2443
2443
  }
2444
- return new _t(r, p, m).convertBody(o);
2444
+ return new Ut(r, p, u).convertBody(o);
2445
2445
  }
2446
- const Ut = ["nw", "ne", "sw", "se"], O = ["img-left", "img-right", "img-top", "img-center"], $ = {
2446
+ const Vt = ["nw", "ne", "sw", "se"], $ = ["img-left", "img-right", "img-top", "img-center"], _ = {
2447
2447
  "img-left": "tplimgleft",
2448
2448
  "img-right": "tplimgright",
2449
2449
  "img-top": "tplimgtop",
2450
2450
  "img-center": "tplimgcenter"
2451
- }, Wt = {
2451
+ }, jt = {
2452
2452
  "img-left": c.tplleft,
2453
2453
  "img-right": c.tplright,
2454
2454
  "img-top": c.tpltop,
2455
2455
  "img-center": c.tplcenter
2456
- }, jt = ".tox,.pop,.tblctx,.imgctx,.selctx,.dlg";
2457
- let E = null, A = null, _ = 0, et = !1;
2456
+ }, Xt = ".tox,.pop,.tblctx,.imgctx,.selctx,.dlg";
2457
+ let M = null, A = null, z = 0, it = !1;
2458
2458
  function N() {
2459
- clearTimeout(_), A = null, E && E.classList.remove("show");
2459
+ clearTimeout(z), A = null, M && M.classList.remove("show");
2460
2460
  }
2461
- function Vt(d) {
2462
- const t = d.dataset.tip;
2461
+ function Qt(h) {
2462
+ const t = h.dataset.tip;
2463
2463
  if (!t) return;
2464
- A = d, clearTimeout(_);
2465
- const e = E && E.classList.contains("show") ? 60 : 350;
2466
- _ = window.setTimeout(() => {
2467
- if (A !== d || !document.contains(d)) return;
2468
- E || (E = document.createElement("div"), E.className = "etip", document.body.appendChild(E)), E.textContent = t, E.classList.add("show");
2469
- const i = d.getBoundingClientRect(), s = E.offsetWidth, l = E.offsetHeight;
2464
+ A = h, clearTimeout(z);
2465
+ const e = M && M.classList.contains("show") ? 60 : 350;
2466
+ z = window.setTimeout(() => {
2467
+ if (A !== h || !document.contains(h)) return;
2468
+ M || (M = document.createElement("div"), M.className = "etip", document.body.appendChild(M)), M.textContent = t, M.classList.add("show");
2469
+ const i = h.getBoundingClientRect(), s = M.offsetWidth, l = M.offsetHeight;
2470
2470
  let n = i.left + i.width / 2 - s / 2;
2471
2471
  n = Math.max(6, Math.min(n, innerWidth - s - 6));
2472
2472
  let o = i.bottom + 7;
2473
- o + l > innerHeight - 6 && (o = i.top - l - 7), E.style.left = n + "px", E.style.top = o + "px";
2473
+ o + l > innerHeight - 6 && (o = i.top - l - 7), M.style.left = n + "px", M.style.top = o + "px";
2474
2474
  }, e);
2475
2475
  }
2476
- function Xt() {
2477
- et || (et = !0, document.addEventListener("mouseover", (d) => {
2478
- const t = d.target, e = t.closest ? t.closest("[title],[data-tip]") : null;
2479
- if (!e || !e.closest(jt) || e.closest(".earea")) {
2476
+ function Gt() {
2477
+ it || (it = !0, document.addEventListener("mouseover", (h) => {
2478
+ const t = h.target, e = t.closest ? t.closest("[title],[data-tip]") : null;
2479
+ if (!e || !e.closest(Xt) || e.closest(".earea")) {
2480
2480
  e !== A && N();
2481
2481
  return;
2482
2482
  }
2483
2483
  const i = e.getAttribute("title");
2484
- i && (e.dataset.tip = i, e.removeAttribute("title"), e.getAttribute("aria-label") || e.setAttribute("aria-label", i)), e !== A && Vt(e);
2485
- }), document.addEventListener("mouseout", (d) => {
2486
- A && !A.contains(d.relatedTarget) && N();
2484
+ i && (e.dataset.tip = i, e.removeAttribute("title"), e.getAttribute("aria-label") || e.setAttribute("aria-label", i)), e !== A && Qt(e);
2485
+ }), document.addEventListener("mouseout", (h) => {
2486
+ A && !A.contains(h.relatedTarget) && N();
2487
2487
  }), document.addEventListener("mousedown", N, !0), addEventListener("scroll", N, !0));
2488
2488
  }
2489
- const Qt = /[\u0590-\u05FF\u0600-\u06FF\u0750-\u077F\u0780-\u07BF\u08A0-\u08FF\uFB1D-\uFB4F\uFB50-\uFDFF\uFE70-\uFEFF]/, Gt = new RegExp("\\p{L}", "u"), Yt = "p,div,li,td,th,blockquote,h1,h2,h3,h4,h5,h6,pre,figcaption";
2490
- function Kt(d) {
2491
- for (const t of d) {
2492
- if (Qt.test(t)) return "rtl";
2493
- if (Gt.test(t)) return "ltr";
2489
+ const Yt = /[\u0590-\u05FF\u0600-\u06FF\u0750-\u077F\u0780-\u07BF\u08A0-\u08FF\uFB1D-\uFB4F\uFB50-\uFDFF\uFE70-\uFEFF]/, Kt = new RegExp("\\p{L}", "u"), Jt = "p,div,li,td,th,blockquote,h1,h2,h3,h4,h5,h6,pre,figcaption";
2490
+ function te(h) {
2491
+ for (const t of h) {
2492
+ if (Yt.test(t)) return "rtl";
2493
+ if (Kt.test(t)) return "ltr";
2494
2494
  }
2495
2495
  return null;
2496
2496
  }
2497
- function ot(d) {
2497
+ const R = ["top", "right", "bottom", "left"], ee = /^(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset)$/i, ie = /^(thin|medium|thick|[+-]?(\d+\.?\d*|\.\d+)(px|pt|em|rem|ex|ch|cm|mm|in|pc|q)?)$/i, se = /^[+-]?0*(\.0*)?(px|pt|em|rem|ex|ch|cm|mm|in|pc|q)?$/i, le = /^border-(collapse|spacing|radius|image|block|inline|start|end)/i, oe = /^border(?:-(top|right|bottom|left))?(?:-(width|style|color))?$/, ne = /^(inherit|initial|unset|revert|revert-layer)$/i;
2498
+ function rt(h) {
2499
+ const t = [];
2500
+ let e = 0, i = "";
2501
+ for (const s of h)
2502
+ s === "(" ? e++ : s === ")" && e--, e === 0 && /\s/.test(s) ? (i && t.push(i), i = "") : i += s;
2503
+ return i && t.push(i), t;
2504
+ }
2505
+ function re(h) {
2506
+ const [t, e = t, i = t, s = e] = h;
2507
+ return [t, e, i, s];
2508
+ }
2509
+ function ae(h) {
2510
+ const t = { width: "medium", style: "none", color: "" };
2511
+ return rt(h).forEach((e) => {
2512
+ ee.test(e) ? t.style = e.toLowerCase() : ie.test(e) ? t.width = e : t.color = e;
2513
+ }), t;
2514
+ }
2515
+ function ce(h) {
2516
+ return !h || /^currentcolor$/i.test(h) ? "" : /^windowtext$/i.test(h) ? "#000000" : h;
2517
+ }
2518
+ function he(h) {
2519
+ if (h.width === null && h.style === null && h.color === null) return "";
2520
+ const t = h.style ?? "solid";
2521
+ return t === "none" || t === "hidden" || h.width && se.test(h.width) ? "none" : [h.width && h.width !== "medium" ? h.width : "", t, ce(h.color || "")].filter(Boolean).join(" ");
2522
+ }
2523
+ function de(h) {
2524
+ h.querySelectorAll("table,td,th").forEach((t) => {
2525
+ const e = t.getAttribute("style") || "";
2526
+ if (!/border/i.test(e)) return;
2527
+ const i = {
2528
+ top: { width: null, style: null, color: null },
2529
+ right: { width: null, style: null, color: null },
2530
+ bottom: { width: null, style: null, color: null },
2531
+ left: { width: null, style: null, color: null }
2532
+ }, s = [];
2533
+ let l = !1, n = !1;
2534
+ if (e.split(";").forEach((a) => {
2535
+ const d = a.indexOf(":");
2536
+ if (d < 1) {
2537
+ a.trim() && s.push(a.trim());
2538
+ return;
2539
+ }
2540
+ const p = a.slice(0, d).trim().toLowerCase(), u = a.slice(d + 1).trim(), g = oe.exec(p);
2541
+ if (!g || le.test(p)) {
2542
+ s.push(p + ":" + u);
2543
+ return;
2544
+ }
2545
+ if (ne.test(u)) {
2546
+ n = !0;
2547
+ return;
2548
+ }
2549
+ l = !0;
2550
+ const m = g[1], f = g[2];
2551
+ if (f)
2552
+ if (m)
2553
+ i[m][f] = u;
2554
+ else {
2555
+ const b = re(rt(u));
2556
+ R.forEach((y, C) => {
2557
+ i[y][f] = b[C];
2558
+ });
2559
+ }
2560
+ else {
2561
+ const b = ae(u);
2562
+ (m ? [m] : R.slice()).forEach((y) => {
2563
+ i[y] = { ...b };
2564
+ });
2565
+ }
2566
+ }), n || !l) return;
2567
+ const o = R.map((a) => he(i[a])), r = s.slice();
2568
+ o.every((a) => a && a === o[0]) ? r.push("border:" + o[0]) : R.forEach((a, d) => o[d] && r.push(`border-${a}:` + o[d])), t.setAttribute("style", r.join(";"));
2569
+ });
2570
+ }
2571
+ function at(h) {
2498
2572
  let t = "";
2499
- return d.childNodes.forEach((e) => {
2573
+ return h.childNodes.forEach((e) => {
2500
2574
  if (e.nodeType === Node.TEXT_NODE)
2501
2575
  t += e.nodeValue || "";
2502
2576
  else if (e.nodeType === Node.ELEMENT_NODE) {
2503
2577
  const i = e, s = (i.getAttribute("dir") || "").toLowerCase();
2504
2578
  if (s === "rtl" || s === "ltr") return;
2505
- t += ot(i);
2579
+ t += at(i);
2506
2580
  }
2507
2581
  }), t;
2508
2582
  }
@@ -2522,20 +2596,20 @@ const I = class I {
2522
2596
  statusbar: t.statusbar ?? !0,
2523
2597
  readonly: t.readonly ?? !1,
2524
2598
  draftKey: t.draftKey ?? (typeof location < "u" ? location.pathname : "default"),
2525
- fontFamilyFormats: t.fontFamilyFormats ?? ht,
2599
+ fontFamilyFormats: t.fontFamilyFormats ?? pt,
2526
2600
  imageFileTypes: t.imageFileTypes ?? ["image/jpeg", "image/jpg", "image/png", "image/gif", "image/bmp", "image/webp"],
2527
2601
  videoFileTypes: t.videoFileTypes ?? ["video/mp4", "video/webm", "video/ogg"]
2528
2602
  }, this.imageUploadHandler = t.imageUploadHandler, this.onImageUploadError = t.onImageUploadError, this.videoUploadHandler = t.videoUploadHandler, this.onVideoUploadError = t.onVideoUploadError, this.contentStyle = t.contentStyle, this.applyTheme(t), this.lang = this.options.language, this.draftStorageKey = "tmclone-draft:" + this.options.draftKey, this.initDOM(), this.bindEvents(), this.initUI(), this.recordRevision(), this.stampExistingImages(), this.options.onReady(this);
2529
2603
  }
2530
2604
  t(t) {
2531
- const e = D(this.lang)[t];
2605
+ const e = O(this.lang)[t];
2532
2606
  return typeof e == "string" ? e : e.join(",");
2533
2607
  }
2534
2608
  tArr(t) {
2535
- return D(this.lang)[t];
2609
+ return O(this.lang)[t];
2536
2610
  }
2537
2611
  dir() {
2538
- return D(this.lang).dir;
2612
+ return O(this.lang).dir;
2539
2613
  }
2540
2614
  /* ---------------------------------------------------------- DOM setup */
2541
2615
  initDOM() {
@@ -2548,7 +2622,7 @@ const I = class I {
2548
2622
  </span>
2549
2623
  `, this.sbHelp = this.statusbar.querySelector(".mid"), this.sbWords = this.statusbar.querySelector(".words");
2550
2624
  const e = this.statusbar.querySelector(".grip");
2551
- this.bindGrip(e), this.shell.appendChild(this.menubar), this.shell.appendChild(this.toolbar), this.shell.appendChild(this.ed), this.shell.appendChild(this.statusbar), this.contentStyle && (this.contentStyleEl = document.createElement("style"), this.contentStyleEl.textContent = this.scopeContentStyle(this.contentStyle), this.shell.appendChild(this.contentStyleEl)), t.appendChild(this.shell), Xt(), this.options.statusbar || (this.statusbar.style.display = "none"), this.imgInput = document.createElement("input"), this.imgInput.type = "file", this.imgInput.accept = this.options.imageFileTypes.join(","), this.imgInput.style.display = "none", t.appendChild(this.imgInput), this.vidInput = document.createElement("input"), this.vidInput.type = "file", this.vidInput.accept = this.options.videoFileTypes.join(","), this.vidInput.style.display = "none", t.appendChild(this.vidInput), this.docInput = document.createElement("input"), this.docInput.type = "file", this.docInput.accept = ".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document", this.docInput.style.display = "none", t.appendChild(this.docInput);
2625
+ this.bindGrip(e), this.shell.appendChild(this.menubar), this.shell.appendChild(this.toolbar), this.shell.appendChild(this.ed), this.shell.appendChild(this.statusbar), this.contentStyle && (this.contentStyleEl = document.createElement("style"), this.contentStyleEl.textContent = this.scopeContentStyle(this.contentStyle), this.shell.appendChild(this.contentStyleEl)), t.appendChild(this.shell), Gt(), this.options.statusbar || (this.statusbar.style.display = "none"), this.imgInput = document.createElement("input"), this.imgInput.type = "file", this.imgInput.accept = this.options.imageFileTypes.join(","), this.imgInput.style.display = "none", t.appendChild(this.imgInput), this.vidInput = document.createElement("input"), this.vidInput.type = "file", this.vidInput.accept = this.options.videoFileTypes.join(","), this.vidInput.style.display = "none", t.appendChild(this.vidInput), this.docInput = document.createElement("input"), this.docInput.type = "file", this.docInput.accept = ".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document", this.docInput.style.display = "none", t.appendChild(this.docInput);
2552
2626
  }
2553
2627
  /** Theme options land as CSS variables on the document root rather than the editor
2554
2628
  * shell, because dialogs, popups and floating context toolbars are appended to
@@ -2595,28 +2669,28 @@ const I = class I {
2595
2669
  t.preventDefault();
2596
2670
  const e = t.target, i = (l = e.closest) == null ? void 0 : l.call(e, ".img-ph:not(.vid-ph)");
2597
2671
  if (i && this.ed.contains(i) && !this.options.readonly) {
2598
- const a = Array.from(((n = t.dataTransfer) == null ? void 0 : n.files) || []).find((h) => h.type.startsWith("image/"));
2672
+ const a = Array.from(((n = t.dataTransfer) == null ? void 0 : n.files) || []).find((d) => d.type.startsWith("image/"));
2599
2673
  a && this.readImageFileInto(a, i);
2600
2674
  return;
2601
2675
  }
2602
2676
  const s = (o = e.closest) == null ? void 0 : o.call(e, ".vid-ph");
2603
2677
  if (s && this.ed.contains(s) && !this.options.readonly) {
2604
- const a = Array.from(((r = t.dataTransfer) == null ? void 0 : r.files) || []).find((h) => h.type.startsWith("video/"));
2678
+ const a = Array.from(((r = t.dataTransfer) == null ? void 0 : r.files) || []).find((d) => d.type.startsWith("video/"));
2605
2679
  a && this.readVideoFileInto(a, s);
2606
2680
  }
2607
2681
  }), this.on(this.ed, "dragover", (t) => t.preventDefault()), this.on(this.ed, "mousedown", (t) => {
2608
- var h, p, m, g, u, v, b;
2609
- const e = t.target, i = (h = e.closest) == null ? void 0 : h.call(e, "table");
2682
+ var d, p, u, g, m, f, b;
2683
+ const e = t.target, i = (d = e.closest) == null ? void 0 : d.call(e, "table");
2610
2684
  i && this.ed.contains(i) ? this.selectTableForResize(i) : this.clearTableHandles();
2611
2685
  const s = (p = e.closest) == null ? void 0 : p.call(e, ".img-ph:not(.vid-ph)");
2612
2686
  s && this.ed.contains(s) && !this.options.readonly ? (t.preventDefault(), this.ed.focus(), this.selectImgPlaceholder(s)) : this.clearImgPlaceholderSel();
2613
- const l = (m = e.closest) == null ? void 0 : m.call(e, ".vid-ph");
2687
+ const l = (u = e.closest) == null ? void 0 : u.call(e, ".vid-ph");
2614
2688
  l && this.ed.contains(l) && !this.options.readonly ? (t.preventDefault(), this.ed.focus(), this.selectVphPlaceholder(l)) : this.clearVphPlaceholderSel();
2615
2689
  const n = (g = e.closest) == null ? void 0 : g.call(e, ".tpl");
2616
2690
  n && this.ed.contains(n) && !this.options.readonly ? this.selectTemplate(n) : this.clearTplSel();
2617
- const o = (u = e.closest) == null ? void 0 : u.call(e, "pre.code-block");
2691
+ const o = (m = e.closest) == null ? void 0 : m.call(e, "pre.code-block");
2618
2692
  o && this.ed.contains(o) && !this.options.readonly ? (t.preventDefault(), this.selectCodeEl(o)) : this.clearCodeSel();
2619
- const r = (v = e.closest) == null ? void 0 : v.call(e, "img");
2693
+ const r = (f = e.closest) == null ? void 0 : f.call(e, "img");
2620
2694
  r && this.ed.contains(r) && !this.options.readonly ? (t.preventDefault(), this.selectImage(r)) : this.clearImageHandles();
2621
2695
  const a = (b = e.closest) == null ? void 0 : b.call(e, "video, .video-embed");
2622
2696
  a && this.ed.contains(a) && !this.options.readonly ? (t.preventDefault(), this.selectVideo(a)) : this.clearVidHandles();
@@ -2723,22 +2797,25 @@ const I = class I {
2723
2797
  if (r !== "rtl" && r !== "ltr") return;
2724
2798
  const a = r;
2725
2799
  i || (i = a), /text-align\s*:/i.test(o.getAttribute("style") || "") || t(o, `text-align:${a === "rtl" ? "right" : "left"}`);
2726
- }), e.querySelectorAll(Yt).forEach((o) => {
2800
+ }), e.querySelectorAll(Jt).forEach((o) => {
2727
2801
  const r = (o.getAttribute("dir") || "").toLowerCase();
2728
2802
  if (r === "rtl" || r === "ltr") return;
2729
- const a = Kt(ot(o));
2803
+ const a = te(at(o));
2730
2804
  if (!a) return;
2731
2805
  i || (i = a), o.setAttribute("dir", a);
2732
- const h = /text-align\s*:/i.test(o.getAttribute("style") || "");
2733
- t(o, h ? `direction:${a}` : `direction:${a};text-align:${a === "rtl" ? "right" : "left"}`);
2806
+ const d = /text-align\s*:/i.test(o.getAttribute("style") || "");
2807
+ t(o, d ? `direction:${a}` : `direction:${a};text-align:${a === "rtl" ? "right" : "left"}`);
2734
2808
  });
2735
2809
  const s = this.ed.querySelectorAll("img");
2736
2810
  e.querySelectorAll("img").forEach((o, r) => {
2737
2811
  if (o.closest(".tpl-media")) return;
2738
- const a = s[r], h = Math.round((a == null ? void 0 : a.getBoundingClientRect().width) || 0);
2739
- h > 0 && !o.getAttribute("width") && o.setAttribute("width", String(h));
2812
+ const a = s[r], d = Math.round((a == null ? void 0 : a.getBoundingClientRect().width) || 0);
2813
+ d > 0 && !o.getAttribute("width") && o.setAttribute("width", String(d));
2740
2814
  const p = o.getAttribute("style") || "";
2741
- h > 0 && !/(^|;)\s*width\s*:/i.test(p) && t(o, `width:${h}px`), /max-width\s*:/i.test(o.getAttribute("style") || "") || t(o, "max-width:100%"), /(^|;)\s*height\s*:/i.test(o.getAttribute("style") || "") || t(o, "height:auto");
2815
+ d > 0 && !/(^|;)\s*width\s*:/i.test(p) && t(o, `width:${d}px`), /max-width\s*:/i.test(o.getAttribute("style") || "") || t(o, "max-width:100%"), /(^|;)\s*height\s*:/i.test(o.getAttribute("style") || "") || t(o, "height:auto");
2816
+ }), de(e), e.querySelectorAll("table").forEach((o) => {
2817
+ const r = o.getAttribute("style") || "";
2818
+ /border-collapse\s*:/i.test(r) || t(o, "border-collapse:collapse"), !/border-spacing\s*:/i.test(r) && !o.hasAttribute("cellspacing") && o.setAttribute("cellspacing", "0");
2742
2819
  });
2743
2820
  const l = i || this.ed.getAttribute("dir") || this.dir();
2744
2821
  return e.querySelectorAll("table:not([dir])").forEach((o) => {
@@ -2758,7 +2835,7 @@ const I = class I {
2758
2835
  this.ed.focus();
2759
2836
  }
2760
2837
  async importWordFile(t) {
2761
- const e = await zt(t);
2838
+ const e = await Wt(t);
2762
2839
  this.recordRevision(), this.setContent(e), this.recordRevision();
2763
2840
  }
2764
2841
  restoreDraft() {
@@ -2876,21 +2953,21 @@ const I = class I {
2876
2953
  hour: "2-digit",
2877
2954
  minute: "2-digit",
2878
2955
  second: "2-digit"
2879
- }), r = {}, a = (h) => {
2880
- n = h, this.revisions.forEach((p, m) => {
2956
+ }), r = {}, a = (d) => {
2957
+ n = d, this.revisions.forEach((p, u) => {
2881
2958
  var g;
2882
- return (g = r[m]) == null ? void 0 : g.classList.toggle("on", m === h);
2883
- }), s.innerHTML = this.revisions[h].html, l.disabled = h === this.revisions.length - 1;
2959
+ return (g = r[u]) == null ? void 0 : g.classList.toggle("on", u === d);
2960
+ }), s.innerHTML = this.revisions[d].html, l.disabled = d === this.revisions.length - 1;
2884
2961
  };
2885
- for (let h = this.revisions.length - 1; h >= 0; h--) {
2886
- const p = this.revisions[h], m = document.createElement("button");
2887
- m.type = "button";
2888
- const g = (new DOMParser().parseFromString(p.html, "text/html").body.textContent || "").trim(), u = g ? g.split(/\s+/).length : 0, v = h === this.revisions.length - 1;
2889
- m.innerHTML = `<span>${v ? this.t("currentver") : o.format(new Date(p.time))}</span><span class="wc">${u} ${this.t("words")}</span>`, m.addEventListener("click", () => a(h)), r[h] = m, i.appendChild(m);
2962
+ for (let d = this.revisions.length - 1; d >= 0; d--) {
2963
+ const p = this.revisions[d], u = document.createElement("button");
2964
+ u.type = "button";
2965
+ const g = (new DOMParser().parseFromString(p.html, "text/html").body.textContent || "").trim(), m = g ? g.split(/\s+/).length : 0, f = d === this.revisions.length - 1;
2966
+ u.innerHTML = `<span>${f ? this.t("currentver") : o.format(new Date(p.time))}</span><span class="wc">${m} ${this.t("words")}</span>`, u.addEventListener("click", () => a(d)), r[d] = u, i.appendChild(u);
2890
2967
  }
2891
2968
  i.append(l), l.addEventListener("click", () => {
2892
- const h = this.revisions[n];
2893
- h && (this.recordRevision(), this.setContent(h.html), this.recordRevision(), this.closeDlg());
2969
+ const d = this.revisions[n];
2970
+ d && (this.recordRevision(), this.setContent(d.html), this.recordRevision(), this.closeDlg());
2894
2971
  }), e.append(i, s), t.appendChild(e), a(n);
2895
2972
  });
2896
2973
  }
@@ -2990,7 +3067,7 @@ const I = class I {
2990
3067
  return l.type = "button", l.className = "cchip", l.title = s, l.addEventListener("mousedown", (n) => {
2991
3068
  n.preventDefault(), this.saveSel();
2992
3069
  }), l;
2993
- }, e = ut.map((s) => {
3070
+ }, e = ft.map((s) => {
2994
3071
  const l = t(this.t("forecolor"));
2995
3072
  return l.style.background = s, l.addEventListener("click", () => this.applyColor("fore", s)), l;
2996
3073
  }), i = t(this.t("forecolor"));
@@ -3027,22 +3104,22 @@ const I = class I {
3027
3104
  ["circle", c.ul_circle],
3028
3105
  ["square", c.ul_square]
3029
3106
  ], l = this.tArr(e === "ol" ? "liststyles_ol" : "liststyles_ul").slice(1), n = window.getSelection(), o = n ? (a = this.closestBlock(n.anchorNode)) == null ? void 0 : a.closest(e) : null, r = o ? o.style.listStyleType : "";
3030
- this.popup(t, (h) => {
3031
- this.menuItems(h, [
3107
+ this.popup(t, (d) => {
3108
+ this.menuItems(d, [
3032
3109
  {
3033
3110
  label: this.t(e === "ol" ? "numlist" : "bullist"),
3034
3111
  icon: e === "ol" ? c.numlist : c.bullist,
3035
3112
  on: document.queryCommandState(i),
3036
3113
  action: () => this.exec(i)
3037
3114
  }
3038
- ]), h.insertAdjacentHTML("beforeend", '<div class="sep"></div>');
3115
+ ]), d.insertAdjacentHTML("beforeend", '<div class="sep"></div>');
3039
3116
  const p = document.createElement("div");
3040
- p.className = "mi-grid", s.forEach(([m, g], u) => {
3041
- const v = document.createElement("button");
3042
- v.className = "mi" + (r === m ? " on" : ""), v.innerHTML = `<span class="ic">${g}</span><span class="prev">${l[u]}</span>`, v.addEventListener("click", () => {
3043
- this.closePop(), this.setListStyle(e, m);
3044
- }), p.appendChild(v);
3045
- }), h.appendChild(p);
3117
+ p.className = "mi-grid", s.forEach(([u, g], m) => {
3118
+ const f = document.createElement("button");
3119
+ f.className = "mi" + (r === u ? " on" : ""), f.innerHTML = `<span class="ic">${g}</span><span class="prev">${l[m]}</span>`, f.addEventListener("click", () => {
3120
+ this.closePop(), this.setListStyle(e, u);
3121
+ }), p.appendChild(f);
3122
+ }), d.appendChild(p);
3046
3123
  });
3047
3124
  }
3048
3125
  /** Shared color-picker popup body — swatch grid plus the current-color /
@@ -3050,11 +3127,11 @@ const I = class I {
3050
3127
  * table cell-background menu all show the identical popup. */
3051
3128
  buildPaletteInto(t, e, i) {
3052
3129
  const s = document.createElement("div");
3053
- s.className = "cpal", gt.forEach((p) => {
3054
- const m = document.createElement("button");
3055
- m.type = "button", m.style.background = p, m.title = p, m.addEventListener("click", () => {
3130
+ s.className = "cpal", vt.forEach((p) => {
3131
+ const u = document.createElement("button");
3132
+ u.type = "button", u.style.background = p, u.title = p, u.addEventListener("click", () => {
3056
3133
  this.closePop(), i(p);
3057
- }), s.appendChild(m);
3134
+ }), s.appendChild(u);
3058
3135
  }), t.appendChild(s), t.insertAdjacentHTML("beforeend", '<div class="sep"></div>');
3059
3136
  const l = document.createElement("div");
3060
3137
  l.className = "cfoot";
@@ -3066,10 +3143,10 @@ const I = class I {
3066
3143
  });
3067
3144
  const a = document.createElement("label");
3068
3145
  a.className = "cswatch cwheel", a.title = this.t("customcolor"), a.innerHTML = c.palette;
3069
- const h = document.createElement("input");
3070
- h.type = "color", h.value = n, h.addEventListener("change", () => {
3071
- this.closePop(), i(h.value);
3072
- }), a.appendChild(h), l.append(o, r, a), t.appendChild(l);
3146
+ const d = document.createElement("input");
3147
+ d.type = "color", d.value = n, d.addEventListener("change", () => {
3148
+ this.closePop(), i(d.value);
3149
+ }), a.appendChild(d), l.append(o, r, a), t.appendChild(l);
3073
3150
  }
3074
3151
  colorMenu(t, e) {
3075
3152
  this.popup(
@@ -3099,7 +3176,7 @@ const I = class I {
3099
3176
  this.popup(t, (e) => this.menuItems(e, this.fontItems()));
3100
3177
  }
3101
3178
  sizeItems() {
3102
- return dt.map((t) => ({
3179
+ return ut.map((t) => ({
3103
3180
  label: t,
3104
3181
  on: this.currentSize() === t,
3105
3182
  action: () => this.applyFontSize(t)
@@ -3152,7 +3229,7 @@ const I = class I {
3152
3229
  this.saveSel(), this.refreshState(), this.onChange();
3153
3230
  }
3154
3231
  stepFontSize(t) {
3155
- const e = parseInt(this.currentSize(), 10) || 14, i = Math.min(mt, Math.max(pt, e + t));
3232
+ const e = parseInt(this.currentSize(), 10) || 14, i = Math.min(gt, Math.max(mt, e + t));
3156
3233
  i !== e && this.applyFontSize(i + "px");
3157
3234
  }
3158
3235
  /* ------------------------------------------------ case / spacing / link */
@@ -3166,9 +3243,9 @@ const I = class I {
3166
3243
  l.forEach((o) => {
3167
3244
  const r = o === i.startContainer ? i.startOffset : 0, a = o === i.endContainer ? i.endOffset : o.data.length;
3168
3245
  if (a <= r) return;
3169
- const h = o.data.slice(r, a);
3170
- let p = h;
3171
- t === "lower" ? p = h.toLowerCase() : t === "upper" ? p = h.toUpperCase() : p = h.replace(/(^|\s)(\S)/g, (m, g, u) => g + u.toUpperCase()), o.replaceData(r, a - r, p);
3246
+ const d = o.data.slice(r, a);
3247
+ let p = d;
3248
+ t === "lower" ? p = d.toLowerCase() : t === "upper" ? p = d.toUpperCase() : p = d.replace(/(^|\s)(\S)/g, (u, g, m) => g + m.toUpperCase()), o.replaceData(r, a - r, p);
3172
3249
  }), this.saveSel(), this.refreshState(), this.onChange();
3173
3250
  }
3174
3251
  caseItems() {
@@ -3204,10 +3281,10 @@ const I = class I {
3204
3281
  ];
3205
3282
  }
3206
3283
  lineHeightMenu(t) {
3207
- this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("lineHeight", U)));
3284
+ this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("lineHeight", W)));
3208
3285
  }
3209
3286
  wordSpacingMenu(t) {
3210
- this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("wordSpacing", W)));
3287
+ this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("wordSpacing", V)));
3211
3288
  }
3212
3289
  letterSpacingMenu(t) {
3213
3290
  this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("letterSpacing", j)));
@@ -3263,7 +3340,7 @@ const I = class I {
3263
3340
  );
3264
3341
  }
3265
3342
  blockItems() {
3266
- return X.map(([t]) => ({
3343
+ return Q.map(([t]) => ({
3267
3344
  label: this.blockLabel(t),
3268
3345
  previewStyle: t.startsWith("h") ? `font-weight:700;font-size:${22 - 2 * +t[1]}px` : t === "pre" ? "font-family:monospace" : "",
3269
3346
  on: this.currentBlock() === t,
@@ -3305,7 +3382,7 @@ const I = class I {
3305
3382
  for (let r = 0; r < 10; r++) {
3306
3383
  const a = document.createElement("span");
3307
3384
  a.dataset.r = String(o), a.dataset.c = String(r), a.addEventListener("mouseenter", () => {
3308
- n.forEach((h) => h.classList.toggle("hot", +h.dataset.r <= o && +h.dataset.c <= r)), l.textContent = r + 1 + " × " + (o + 1);
3385
+ n.forEach((d) => d.classList.toggle("hot", +d.dataset.r <= o && +d.dataset.c <= r)), l.textContent = r + 1 + " × " + (o + 1);
3309
3386
  }), a.addEventListener("click", () => {
3310
3387
  this.closePop(), this.insertTable(o + 1, r + 1), e == null || e();
3311
3388
  }), n.push(a), s.appendChild(a);
@@ -3393,7 +3470,7 @@ const I = class I {
3393
3470
  }
3394
3471
  buildToolbar() {
3395
3472
  this.toolbar.innerHTML = "";
3396
- const t = this.options.toolbar === !0 ? at : this.options.toolbar, e = this.buildToolbarRegistry();
3473
+ const t = this.options.toolbar === !0 ? ht : this.options.toolbar, e = this.buildToolbarRegistry();
3397
3474
  this.parseToolbarString(t).forEach((i) => {
3398
3475
  const s = [];
3399
3476
  i.forEach((l) => {
@@ -3503,8 +3580,8 @@ const I = class I {
3503
3580
  { label: this.t("fontsize"), subBuild: (s) => this.menuItems(s, this.sizeItems()) },
3504
3581
  { label: this.t("blocks"), subBuild: (s) => this.menuItems(s, this.blockItems()) },
3505
3582
  { label: this.t("align"), subBuild: (s) => this.menuItems(s, this.alignItems()) },
3506
- { label: this.t("lineheight"), icon: c.lineheight, subBuild: (s) => this.menuItems(s, this.blockStyleItems("lineHeight", U)) },
3507
- { label: this.t("wordspacing"), icon: c.wordspacing, subBuild: (s) => this.menuItems(s, this.blockStyleItems("wordSpacing", W)) },
3583
+ { label: this.t("lineheight"), icon: c.lineheight, subBuild: (s) => this.menuItems(s, this.blockStyleItems("lineHeight", W)) },
3584
+ { label: this.t("wordspacing"), icon: c.wordspacing, subBuild: (s) => this.menuItems(s, this.blockStyleItems("wordSpacing", V)) },
3508
3585
  { label: this.t("letterspacing"), icon: c.letterspacing, subBuild: (s) => this.menuItems(s, this.blockStyleItems("letterSpacing", j)) },
3509
3586
  "|",
3510
3587
  { label: this.t("forecolor"), icon: c.palette, subBuild: (s) => this.buildPaletteInto(s, this.foreColor, (l) => this.applyColor("fore", l)) },
@@ -3575,7 +3652,7 @@ const I = class I {
3575
3652
  { label: this.t("deltable"), icon: c.trash, action: () => this.tableOp("deltable") }
3576
3653
  ],
3577
3654
  help: [this.mItem("helpttl", c.helpic, () => this.helpDlg(), "Alt+0")]
3578
- }, e = this.options.menubar === !0 ? ct : this.options.menubar, i = /* @__PURE__ */ new Set();
3655
+ }, e = this.options.menubar === !0 ? dt : this.options.menubar, i = /* @__PURE__ */ new Set();
3579
3656
  e.split(/\s+/).filter(Boolean).forEach((s) => {
3580
3657
  if (i.has(s)) return;
3581
3658
  if (i.add(s), !t[s]) {
@@ -3590,17 +3667,17 @@ const I = class I {
3590
3667
  }
3591
3668
  /* ---------------------------------------------------------- table ops */
3592
3669
  tableOp(t) {
3593
- var r, a, h;
3670
+ var r, a, d;
3594
3671
  this.restoreSel();
3595
3672
  const e = window.getSelection();
3596
3673
  if (!e) return;
3597
- const i = ((r = this.closestBlock(e.anchorNode)) == null ? void 0 : r.closest("td,th")) || (e.anchorNode && e.anchorNode.nodeType === 1 ? (h = (a = e.anchorNode).closest) == null ? void 0 : h.call(a, "td,th") : null);
3674
+ const i = ((r = this.closestBlock(e.anchorNode)) == null ? void 0 : r.closest("td,th")) || (e.anchorNode && e.anchorNode.nodeType === 1 ? (d = (a = e.anchorNode).closest) == null ? void 0 : d.call(a, "td,th") : null);
3598
3675
  if (!i) return;
3599
3676
  const s = i.parentElement, l = i.closest("table"), n = Array.from(s.children).indexOf(i), o = () => {
3600
3677
  const p = s.cloneNode(!1);
3601
- return Array.from(s.children).forEach((m) => {
3602
- const g = document.createElement("td"), u = m.getAttribute("style");
3603
- u && g.setAttribute("style", u), g.style.removeProperty("background-color"), g.innerHTML = "<br>", p.appendChild(g);
3678
+ return Array.from(s.children).forEach((u) => {
3679
+ const g = document.createElement("td"), m = u.getAttribute("style");
3680
+ m && g.setAttribute("style", m), g.style.removeProperty("background-color"), g.innerHTML = "<br>", p.appendChild(g);
3604
3681
  }), p;
3605
3682
  };
3606
3683
  if (t === "rowabove" && s.before(o()), t === "rowbelow" && s.after(o()), t === "delrow") {
@@ -3608,11 +3685,11 @@ const I = class I {
3608
3685
  s.remove(), p.querySelector("tr") || l.remove();
3609
3686
  }
3610
3687
  (t === "colbefore" || t === "colafter") && l.querySelectorAll("tr").forEach((p) => {
3611
- const m = p.children[Math.min(n, p.children.length - 1)], g = document.createElement("td"), u = m.getAttribute("style");
3612
- u && g.setAttribute("style", u), g.style.removeProperty("width"), g.style.removeProperty("background-color"), g.innerHTML = "<br>", t === "colbefore" ? m.before(g) : m.after(g);
3688
+ const u = p.children[Math.min(n, p.children.length - 1)], g = document.createElement("td"), m = u.getAttribute("style");
3689
+ m && g.setAttribute("style", m), g.style.removeProperty("width"), g.style.removeProperty("background-color"), g.innerHTML = "<br>", t === "colbefore" ? u.before(g) : u.after(g);
3613
3690
  }), t === "delcol" && (l.querySelectorAll("tr").forEach((p) => {
3614
- var m;
3615
- return (m = p.children[n]) == null ? void 0 : m.remove();
3691
+ var u;
3692
+ return (u = p.children[n]) == null ? void 0 : u.remove();
3616
3693
  }), l.querySelector("td,th") || l.remove()), t === "deltable" && l.remove(), this.onChange(), this.positionTableHandles();
3617
3694
  }
3618
3695
  /** Reorders the current row/column: 'rowup'/'rowdown' swap the caret's row with
@@ -3632,11 +3709,11 @@ const I = class I {
3632
3709
  r && r.after(i);
3633
3710
  }
3634
3711
  t === "colleft" && l > 0 && s.querySelectorAll("tr").forEach((r) => {
3635
- const a = r.children[l], h = r.children[l - 1];
3636
- a && h && h.before(a);
3712
+ const a = r.children[l], d = r.children[l - 1];
3713
+ a && d && d.before(a);
3637
3714
  }), t === "colright" && s.querySelectorAll("tr").forEach((r) => {
3638
- const a = r.children[l], h = r.children[l + 1];
3639
- a && h && h.after(a);
3715
+ const a = r.children[l], d = r.children[l + 1];
3716
+ a && d && d.after(a);
3640
3717
  });
3641
3718
  const n = document.createRange();
3642
3719
  n.selectNodeContents(e), n.collapse(!0);
@@ -3679,7 +3756,7 @@ const I = class I {
3679
3756
  const t = this.tblActive;
3680
3757
  if (!t) return;
3681
3758
  let e, i, s, l, n;
3682
- const o = "display:flex;align-items:center;gap:10px;margin:10px 0", r = "width:120px;color:#556;flex:none", a = "flex:1;border:1px solid #cfd6df;border-radius:6px;padding:7px 9px;font:14px inherit", h = t.querySelector("td,th"), p = t.style.width || "", m = h && h.style.padding ? parseFloat(h.style.padding) : "", g = t.style.borderSpacing ? parseFloat(t.style.borderSpacing) : "", u = t.style.borderWidth ? parseFloat(t.style.borderWidth) : "", v = t.style.marginLeft, b = t.style.marginRight, x = v === "auto" && b === "auto" ? "center" : v === "auto" ? "right" : b === "auto" && v === "0" ? "left" : "";
3759
+ const o = "display:flex;align-items:center;gap:10px;margin:10px 0", r = "width:120px;color:#556;flex:none", a = "flex:1;border:1px solid #cfd6df;border-radius:6px;padding:7px 9px;font:14px inherit", d = t.querySelector("td,th"), p = t.style.width || "", u = d && d.style.padding ? parseFloat(d.style.padding) : "", g = t.style.borderSpacing ? parseFloat(t.style.borderSpacing) : "", m = t.style.borderWidth ? parseFloat(t.style.borderWidth) : "", f = t.style.marginLeft, b = t.style.marginRight, y = f === "auto" && b === "auto" ? "center" : f === "auto" ? "right" : b === "auto" && f === "0" ? "left" : "";
3683
3760
  this.dialog(
3684
3761
  this.t("tablepropsttl"),
3685
3762
  (C) => {
@@ -3689,14 +3766,14 @@ const I = class I {
3689
3766
  const H = document.createElement("span");
3690
3767
  H.style.cssText = r, H.textContent = this.t(w), L.append(H, k), C.appendChild(L);
3691
3768
  };
3692
- e = document.createElement("input"), e.type = "text", e.style.cssText = a, e.placeholder = "e.g. 600px or 100%", e.value = p, S("tblwidth", e), i = document.createElement("input"), i.type = "number", i.min = "0", i.style.cssText = a, i.value = String(m), S("tblcellpadding", i), s = document.createElement("input"), s.type = "number", s.min = "0", s.style.cssText = a, s.value = String(g), S("tblcellspacing", s), l = document.createElement("input"), l.type = "number", l.min = "0", l.style.cssText = a, l.value = String(u), S("tblborder", l), n = document.createElement("select"), n.style.cssText = a, [
3769
+ e = document.createElement("input"), e.type = "text", e.style.cssText = a, e.placeholder = "e.g. 600px or 100%", e.value = p, S("tblwidth", e), i = document.createElement("input"), i.type = "number", i.min = "0", i.style.cssText = a, i.value = String(u), S("tblcellpadding", i), s = document.createElement("input"), s.type = "number", s.min = "0", s.style.cssText = a, s.value = String(g), S("tblcellspacing", s), l = document.createElement("input"), l.type = "number", l.min = "0", l.style.cssText = a, l.value = String(m), S("tblborder", l), n = document.createElement("select"), n.style.cssText = a, [
3693
3770
  ["", "alignnone"],
3694
3771
  ["left", "alignleft"],
3695
3772
  ["center", "aligncenter"],
3696
3773
  ["right", "alignright"]
3697
3774
  ].forEach(([w, k]) => {
3698
3775
  const L = document.createElement("option");
3699
- L.value = w, L.textContent = this.t(k), w === x && (L.selected = !0), n.appendChild(L);
3776
+ L.value = w, L.textContent = this.t(k), w === y && (L.selected = !0), n.appendChild(L);
3700
3777
  }), S("tblalign", n);
3701
3778
  },
3702
3779
  [
@@ -3938,25 +4015,25 @@ const I = class I {
3938
4015
  o.className = "chpanel";
3939
4016
  const r = document.createElement("div");
3940
4017
  r.className = "chgrid" + (i ? " emgrid" : ""), o.appendChild(r);
3941
- const a = (h) => {
3942
- n.querySelectorAll("button").forEach((p, m) => p.classList.toggle("on", m === h)), r.innerHTML = "", e[h].chars.forEach((p) => {
3943
- const m = document.createElement("button");
3944
- m.type = "button", m.textContent = p, m.onclick = () => {
4018
+ const a = (d) => {
4019
+ n.querySelectorAll("button").forEach((p, u) => p.classList.toggle("on", u === d)), r.innerHTML = "", e[d].chars.forEach((p) => {
4020
+ const u = document.createElement("button");
4021
+ u.type = "button", u.textContent = p, u.onclick = () => {
3945
4022
  this.closeDlg(), this.exec("insertText", p);
3946
- }, r.appendChild(m);
4023
+ }, r.appendChild(u);
3947
4024
  }), o.scrollTop = 0;
3948
4025
  };
3949
- e.forEach((h, p) => {
3950
- const m = document.createElement("button");
3951
- m.type = "button", m.textContent = this.t(h.key), m.addEventListener("click", () => a(p)), n.appendChild(m);
4026
+ e.forEach((d, p) => {
4027
+ const u = document.createElement("button");
4028
+ u.type = "button", u.textContent = this.t(d.key), u.addEventListener("click", () => a(p)), n.appendChild(u);
3952
4029
  }), l.append(n, o), s.appendChild(l), a(0);
3953
4030
  });
3954
4031
  }
3955
4032
  charMap() {
3956
- this.glyphPickerDlg(this.t("charmap").replace("…", ""), ft, !1);
4033
+ this.glyphPickerDlg(this.t("charmap").replace("…", ""), bt, !1);
3957
4034
  }
3958
4035
  emojiMap() {
3959
- this.glyphPickerDlg(this.t("emoji").replace("…", ""), vt, !0);
4036
+ this.glyphPickerDlg(this.t("emoji").replace("…", ""), yt, !0);
3960
4037
  }
3961
4038
  printDoc() {
3962
4039
  const t = window.open("", "_blank");
@@ -4250,13 +4327,13 @@ const I = class I {
4250
4327
  const e = document.createElement("div");
4251
4328
  e.className = "imgctx", e.dir = this.dir();
4252
4329
  const i = () => {
4253
- var h;
4330
+ var d;
4254
4331
  const a = this.buildVideoCtxToolbar(t);
4255
- (h = this.vidCtx) == null || h.replaceWith(a), this.vidCtx = a, this.positionVidCtx();
4332
+ (d = this.vidCtx) == null || d.replaceWith(a), this.vidCtx = a, this.positionVidCtx();
4256
4333
  }, s = (a) => {
4257
4334
  this.setVideoAlign(t, a), i();
4258
- }, l = t.style.float === "left", n = t.style.float === "right", o = !l && !n && t.style.marginLeft === "auto" && t.style.marginRight === "auto", r = (a, h, p, m) => {
4259
- const g = this.ctxBtn(a, h, m);
4335
+ }, l = t.style.float === "left", n = t.style.float === "right", o = !l && !n && t.style.marginLeft === "auto" && t.style.marginRight === "auto", r = (a, d, p, u) => {
4336
+ const g = this.ctxBtn(a, d, u);
4260
4337
  return g.classList.toggle("on", p), g;
4261
4338
  };
4262
4339
  return e.append(
@@ -4305,11 +4382,11 @@ const I = class I {
4305
4382
  videoDlg() {
4306
4383
  this.saveSel();
4307
4384
  let t, e, i, s, l, n;
4308
- const o = (a, h) => {
4385
+ const o = (a, d) => {
4309
4386
  const p = document.createElement("div");
4310
4387
  p.className = "dfield";
4311
- const m = document.createElement("label");
4312
- return m.textContent = this.t(a), p.append(m, h), p;
4388
+ const u = document.createElement("label");
4389
+ return u.textContent = this.t(a), p.append(u, d), p;
4313
4390
  }, r = () => {
4314
4391
  const a = document.createElement("input");
4315
4392
  return a.type = "url", a;
@@ -4317,55 +4394,55 @@ const I = class I {
4317
4394
  this.dialog(
4318
4395
  this.t("videodlgttl"),
4319
4396
  (a) => {
4320
- const h = document.createElement("div");
4321
- h.className = "dtabs";
4322
- const p = [], m = (v, b) => {
4323
- const x = document.createElement("button");
4324
- x.type = "button", x.textContent = this.t(v);
4397
+ const d = document.createElement("div");
4398
+ d.className = "dtabs";
4399
+ const p = [], u = (f, b) => {
4400
+ const y = document.createElement("button");
4401
+ y.type = "button", y.textContent = this.t(f);
4325
4402
  const C = document.createElement("div");
4326
4403
  C.className = "dtabpanel", b(C);
4327
4404
  const S = p.length;
4328
- p.push(C), x.addEventListener("click", () => g(S)), h.appendChild(x);
4329
- }, g = (v) => {
4330
- h.querySelectorAll("button").forEach((b, x) => b.classList.toggle("on", x === v)), p.forEach((b, x) => b.style.display = x === v ? "" : "none");
4405
+ p.push(C), y.addEventListener("click", () => g(S)), d.appendChild(y);
4406
+ }, g = (f) => {
4407
+ d.querySelectorAll("button").forEach((b, y) => b.classList.toggle("on", y === f)), p.forEach((b, y) => b.style.display = y === f ? "" : "none");
4331
4408
  };
4332
- m("vidgeneral", (v) => {
4409
+ u("vidgeneral", (f) => {
4333
4410
  t = r(), t.placeholder = this.t("videourlph");
4334
4411
  const b = document.createElement("div");
4335
4412
  b.className = "drow";
4336
- const x = document.createElement("button");
4337
- x.type = "button", x.className = "txtbtn", x.textContent = this.t("uploadvideo");
4413
+ const y = document.createElement("button");
4414
+ y.type = "button", y.className = "txtbtn", y.textContent = this.t("uploadvideo");
4338
4415
  const C = document.createElement("input");
4339
- C.type = "file", C.accept = this.options.videoFileTypes.join(","), C.style.display = "none", x.addEventListener("click", () => {
4416
+ C.type = "file", C.accept = this.options.videoFileTypes.join(","), C.style.display = "none", y.addEventListener("click", () => {
4340
4417
  C.value = "", C.click();
4341
4418
  }), C.addEventListener("change", () => {
4342
4419
  var L;
4343
4420
  const w = (L = C.files) == null ? void 0 : L[0];
4344
4421
  if (!w) return;
4345
- x.disabled = !0, x.textContent = this.t("uploading");
4422
+ y.disabled = !0, y.textContent = this.t("uploading");
4346
4423
  const k = (H) => {
4347
- t.value = H, x.disabled = !1, x.textContent = this.t("uploadvideo");
4424
+ t.value = H, y.disabled = !1, y.textContent = this.t("uploadvideo");
4348
4425
  };
4349
4426
  if (this.videoUploadHandler)
4350
4427
  this.videoUploadHandler(w).then(k).catch((H) => {
4351
- var z;
4352
- x.disabled = !1, x.textContent = this.t("uploadfailed"), (z = this.onVideoUploadError) == null || z.call(this, H, w);
4428
+ var U;
4429
+ y.disabled = !1, y.textContent = this.t("uploadfailed"), (U = this.onVideoUploadError) == null || U.call(this, H, w);
4353
4430
  });
4354
4431
  else {
4355
4432
  const H = new FileReader();
4356
4433
  H.onload = () => k(H.result), H.readAsDataURL(w);
4357
4434
  }
4358
- }), b.append(t, x, C), t.style.flex = "1", v.appendChild(o("vidsource", b));
4435
+ }), b.append(t, y, C), t.style.flex = "1", f.appendChild(o("vidsource", b));
4359
4436
  const S = document.createElement("div");
4360
- S.className = "drow", e = document.createElement("input"), e.type = "number", e.value = "560", i = document.createElement("input"), i.type = "number", i.value = "314", S.append(o("tblwidth", e), o("tblheight", i)), v.appendChild(S);
4361
- }), m("vidembed", (v) => {
4437
+ S.className = "drow", e = document.createElement("input"), e.type = "number", e.value = "560", i = document.createElement("input"), i.type = "number", i.value = "314", S.append(o("tblwidth", e), o("tblheight", i)), f.appendChild(S);
4438
+ }), u("vidembed", (f) => {
4362
4439
  const b = document.createElement("p");
4363
- b.textContent = this.t("vidembedhint"), b.style.cssText = "margin:0 0 8px;color:#556;font-size:13.5px", s = document.createElement("textarea"), s.style.cssText = "width:100%;box-sizing:border-box;height:160px", v.append(b, s);
4364
- }), m("vidadvanced", (v) => {
4365
- l = r(), n = r(), v.append(o("vidaltsource", l), o("vidposter", n));
4440
+ b.textContent = this.t("vidembedhint"), b.style.cssText = "margin:0 0 8px;color:#556;font-size:13.5px", s = document.createElement("textarea"), s.style.cssText = "width:100%;box-sizing:border-box;height:160px", f.append(b, s);
4441
+ }), u("vidadvanced", (f) => {
4442
+ l = r(), n = r(), f.append(o("vidaltsource", l), o("vidposter", n));
4366
4443
  });
4367
- const u = document.createElement("div");
4368
- u.className = "dtabbody", p.forEach((v) => u.appendChild(v)), a.append(h, u), g(0), setTimeout(() => t.focus(), 0);
4444
+ const m = document.createElement("div");
4445
+ m.className = "dtabbody", p.forEach((f) => m.appendChild(f)), a.append(d, m), g(0), setTimeout(() => t.focus(), 0);
4369
4446
  },
4370
4447
  [
4371
4448
  { label: this.t("cancel"), action: () => this.closeDlg() },
@@ -4373,21 +4450,21 @@ const I = class I {
4373
4450
  label: this.t("save"),
4374
4451
  primary: !0,
4375
4452
  action: () => {
4376
- const a = s.value.trim(), h = t.value.trim(), p = parseInt(e.value, 10) || 560, m = parseInt(i.value, 10) || 314;
4377
- if (this.closeDlg(), !a && !h) return;
4453
+ const a = s.value.trim(), d = t.value.trim(), p = parseInt(e.value, 10) || 560, u = parseInt(i.value, 10) || 314;
4454
+ if (this.closeDlg(), !a && !d) return;
4378
4455
  if (this.restoreSel(), a) {
4379
4456
  document.execCommand("insertHTML", !1, `<span class="video-embed" contenteditable="false">${a}</span>`), this.onChange();
4380
4457
  return;
4381
4458
  }
4382
- const g = this.videoEmbedUrl(h);
4459
+ const g = this.videoEmbedUrl(d);
4383
4460
  if (g)
4384
- document.execCommand("insertHTML", !1, this.videoEmbedHTML(g, p, m));
4461
+ document.execCommand("insertHTML", !1, this.videoEmbedHTML(g, p, u));
4385
4462
  else {
4386
- const u = l.value.trim(), v = n.value.trim();
4463
+ const m = l.value.trim(), f = n.value.trim();
4387
4464
  document.execCommand(
4388
4465
  "insertHTML",
4389
4466
  !1,
4390
- `<video controls width="${p}" height="${m}"${v ? ` poster="${this.escapeAttr(v)}"` : ""}><source src="${this.escapeAttr(h)}">${u ? `<source src="${this.escapeAttr(u)}">` : ""}</video>`
4467
+ `<video controls width="${p}" height="${u}"${f ? ` poster="${this.escapeAttr(f)}"` : ""}><source src="${this.escapeAttr(d)}">${m ? `<source src="${this.escapeAttr(m)}">` : ""}</video>`
4391
4468
  );
4392
4469
  }
4393
4470
  this.onChange();
@@ -4438,11 +4515,11 @@ const I = class I {
4438
4515
  /** Typing `snippet` converts to an inline <code> run the moment the closing
4439
4516
  * backtick is typed, so code can be marked up without reaching for the toolbar. */
4440
4517
  tryCodeTyping(t) {
4441
- var h;
4518
+ var d;
4442
4519
  const e = window.getSelection();
4443
4520
  if (!e || !e.isCollapsed || !e.anchorNode) return;
4444
4521
  const i = e.anchorNode;
4445
- if (i.nodeType !== Node.TEXT_NODE || !this.ed.contains(i) || (h = i.parentElement) != null && h.closest("code, pre")) return;
4522
+ if (i.nodeType !== Node.TEXT_NODE || !this.ed.contains(i) || (d = i.parentElement) != null && d.closest("code, pre")) return;
4446
4523
  const l = (i.textContent || "").slice(0, e.anchorOffset).match(/(?:^|[^`])`([^`]+)$/);
4447
4524
  if (!l) return;
4448
4525
  const n = l[1];
@@ -4468,10 +4545,10 @@ const I = class I {
4468
4545
  const n = document.createElement("span");
4469
4546
  n.className = "lbl", n.textContent = ((r = t.find(([a]) => a === e)) == null ? void 0 : r[1]) || "", l.append(n), l.insertAdjacentHTML("beforeend", c.chev);
4470
4547
  const o = document.createElement("div");
4471
- return o.className = "dsel-list", t.forEach(([a, h]) => {
4548
+ return o.className = "dsel-list", t.forEach(([a, d]) => {
4472
4549
  const p = document.createElement("button");
4473
- p.type = "button", p.textContent = h, p.classList.toggle("on", a === i), p.addEventListener("click", () => {
4474
- i = a, n.textContent = h, o.querySelectorAll("button").forEach((m) => m.classList.toggle("on", m === p)), s.classList.remove("open"), l.focus();
4550
+ p.type = "button", p.textContent = d, p.classList.toggle("on", a === i), p.addEventListener("click", () => {
4551
+ i = a, n.textContent = d, o.querySelectorAll("button").forEach((u) => u.classList.toggle("on", u === p)), s.classList.remove("open"), l.focus();
4475
4552
  }), o.appendChild(p);
4476
4553
  }), l.addEventListener("click", () => {
4477
4554
  var a;
@@ -4495,7 +4572,7 @@ const I = class I {
4495
4572
  const l = document.createElement("div");
4496
4573
  l.className = "dfield";
4497
4574
  const n = document.createElement("label");
4498
- n.textContent = this.t("codelang"), e = this.dlgSelect(V, (t == null ? void 0 : t.dataset.lang) || "plain"), l.append(n, e.el), i = document.createElement("textarea"), i.className = "code-input", i.spellcheck = !1, i.value = ((o = t == null ? void 0 : t.querySelector("code")) == null ? void 0 : o.textContent) || "", i.placeholder = "const answer = 42;", s.append(l, i), setTimeout(() => i.focus(), 0);
4575
+ n.textContent = this.t("codelang"), e = this.dlgSelect(X, (t == null ? void 0 : t.dataset.lang) || "plain"), l.append(n, e.el), i = document.createElement("textarea"), i.className = "code-input", i.spellcheck = !1, i.value = ((o = t == null ? void 0 : t.querySelector("code")) == null ? void 0 : o.textContent) || "", i.placeholder = "const answer = 42;", s.append(l, i), setTimeout(() => i.focus(), 0);
4499
4576
  },
4500
4577
  [
4501
4578
  { label: this.t("cancel"), action: () => this.closeDlg() },
@@ -4504,7 +4581,7 @@ const I = class I {
4504
4581
  primary: !0,
4505
4582
  action: () => {
4506
4583
  var o;
4507
- const s = i.value.replace(/\s+$/, ""), l = e.value(), n = ((o = V.find(([r]) => r === l)) == null ? void 0 : o[1]) || l;
4584
+ const s = i.value.replace(/\s+$/, ""), l = e.value(), n = ((o = X.find(([r]) => r === l)) == null ? void 0 : o[1]) || l;
4508
4585
  if (this.closeDlg(), !!s.trim()) {
4509
4586
  if (t) {
4510
4587
  t.dataset.lang = l, t.setAttribute("data-lang-label", n);
@@ -4577,9 +4654,9 @@ const I = class I {
4577
4654
  }
4578
4655
  buildTemplatePickInto(t, e) {
4579
4656
  const i = document.createElement("div");
4580
- i.className = "tplpick", O.forEach((s) => {
4657
+ i.className = "tplpick", $.forEach((s) => {
4581
4658
  const l = document.createElement("button");
4582
- l.type = "button", l.className = "tpltile", l.title = this.t($[s]), l.innerHTML = this.tplPreviewHTML(s) + `<span class="tpllbl">${this.t($[s])}</span>`, l.addEventListener("click", () => {
4659
+ l.type = "button", l.className = "tpltile", l.title = this.t(_[s]), l.innerHTML = this.tplPreviewHTML(s) + `<span class="tpllbl">${this.t(_[s])}</span>`, l.addEventListener("click", () => {
4583
4660
  this.closePop(), this.insertTemplate(s), e == null || e();
4584
4661
  }), i.appendChild(l);
4585
4662
  }), t.appendChild(i);
@@ -4598,15 +4675,15 @@ const I = class I {
4598
4675
  }
4599
4676
  renderTplCtxButtons() {
4600
4677
  const t = this.tplCtx, e = this.tplActive;
4601
- !t || !e || (t.innerHTML = "", O.forEach((i) => {
4602
- const s = this.ctxBtn(Wt[i], this.t($[i]), () => this.setTplLayout(i));
4678
+ !t || !e || (t.innerHTML = "", $.forEach((i) => {
4679
+ const s = this.ctxBtn(jt[i], this.t(_[i]), () => this.setTplLayout(i));
4603
4680
  s.classList.toggle("on", e.classList.contains("tpl-" + i)), t.appendChild(s);
4604
4681
  }), t.append(this.ctxSep(), this.ctxBtn(c.trash, this.t("deltemplate"), () => this.removeTemplate())), this.positionTplCtx());
4605
4682
  }
4606
4683
  setTplLayout(t) {
4607
4684
  const e = this.tplActive;
4608
4685
  if (!e) return;
4609
- O.forEach((l) => e.classList.remove("tpl-" + l)), e.classList.add("tpl-" + t);
4686
+ $.forEach((l) => e.classList.remove("tpl-" + l)), e.classList.add("tpl-" + t);
4610
4687
  const i = e.querySelector(":scope > .tpl-media"), s = e.querySelector(":scope > .tpl-text");
4611
4688
  i && s && (t === "img-center" ? e.appendChild(i) : e.insertBefore(i, s)), this.renderTplCtxButtons(), this.positionImgPhCtx(), this.positionImageHandles(), this.onChange();
4612
4689
  }
@@ -4658,10 +4735,10 @@ const I = class I {
4658
4735
  this.tblOpMarkKind = t, this.positionOpMark();
4659
4736
  }
4660
4737
  positionOpMark() {
4661
- var h;
4738
+ var d;
4662
4739
  const t = this.tblOpMarkKind, e = t ? this.currentCell() : null;
4663
4740
  if (!t || !e || !this.tblActive || e.closest("table") !== this.tblActive) {
4664
- (h = this.tblOpMark) == null || h.remove(), this.tblOpMark = null;
4741
+ (d = this.tblOpMark) == null || d.remove(), this.tblOpMark = null;
4665
4742
  return;
4666
4743
  }
4667
4744
  this.tblOpMark || (this.tblOpMark = document.createElement("div"), this.tblOpMark.className = "tbl-opmark", document.body.appendChild(this.tblOpMark));
@@ -4715,17 +4792,17 @@ const I = class I {
4715
4792
  const t = this.ed.getAttribute("dir") === "rtl", e = this.tblActive.getBoundingClientRect(), i = e.top + scrollY, s = e.left + scrollX, l = e.right + scrollX, n = e.bottom + scrollY;
4716
4793
  if (this.tblCorner && (this.tblCorner.style.top = n - 5 + "px", this.tblCorner.style.left = (t ? s - 5 : l - 5) + "px", this.tblCorner.style.cursor = t ? "nesw-resize" : "nwse-resize"), this.tblCtx) {
4717
4794
  const r = this.tblCtx.offsetWidth, a = this.tblCtx.offsetHeight;
4718
- let h = s + (l - s) / 2 - r / 2;
4719
- h = Math.max(8 + scrollX, Math.min(h, scrollX + innerWidth - r - 8));
4795
+ let d = s + (l - s) / 2 - r / 2;
4796
+ d = Math.max(8 + scrollX, Math.min(d, scrollX + innerWidth - r - 8));
4720
4797
  let p = i - a - 8;
4721
- p < this.ctxMinTop() && (p = n + 8), this.tblCtx.style.left = h + "px", this.tblCtx.style.top = p + "px";
4798
+ p < this.ctxMinTop() && (p = n + 8), this.tblCtx.style.left = d + "px", this.tblCtx.style.top = p + "px";
4722
4799
  }
4723
4800
  this.tblColBars.forEach((r) => r.remove()), this.tblColBars = [];
4724
4801
  const o = this.tblActive.rows[0];
4725
4802
  if (o)
4726
4803
  for (let r = 0; r < o.cells.length - 1; r++) {
4727
- const a = o.cells[r].getBoundingClientRect(), h = (t ? a.left : a.right) + scrollX, p = document.createElement("div");
4728
- p.className = "tbl-colbar", p.style.top = i + "px", p.style.left = h + "px", p.style.height = n - i + "px", document.body.appendChild(p), p.addEventListener("mousedown", (m) => this.startColBarDrag(m, r)), this.tblColBars.push(p);
4804
+ const a = o.cells[r].getBoundingClientRect(), d = (t ? a.left : a.right) + scrollX, p = document.createElement("div");
4805
+ p.className = "tbl-colbar", p.style.top = i + "px", p.style.left = d + "px", p.style.height = n - i + "px", document.body.appendChild(p), p.addEventListener("mousedown", (u) => this.startColBarDrag(u, r)), this.tblColBars.push(p);
4729
4806
  }
4730
4807
  this.positionCellMarker(), this.positionOpMark();
4731
4808
  }
@@ -4745,8 +4822,8 @@ const I = class I {
4745
4822
  const i = this.ed.getAttribute("dir") === "rtl", s = t.clientX, l = e.getBoundingClientRect().width;
4746
4823
  e.style.tableLayout = e.style.tableLayout || "fixed", this.withNoTextSelect((n) => {
4747
4824
  const o = (a) => {
4748
- const h = i ? -(a.clientX - s) : a.clientX - s;
4749
- e.style.width = Math.max(60, Math.round(l + h)) + "px", this.positionTableHandles();
4825
+ const d = i ? -(a.clientX - s) : a.clientX - s;
4826
+ e.style.width = Math.max(60, Math.round(l + d)) + "px", this.positionTableHandles();
4750
4827
  }, r = () => {
4751
4828
  window.removeEventListener("mousemove", o), window.removeEventListener("mouseup", r), n(), this.onChange();
4752
4829
  };
@@ -4759,15 +4836,15 @@ const I = class I {
4759
4836
  if (!i) return;
4760
4837
  const s = this.ed.getAttribute("dir") === "rtl", l = Array.from(i.rows), n = l.map((p) => p.cells[e]).filter(Boolean), o = l.map((p) => p.cells[e + 1]).filter(Boolean);
4761
4838
  if (!n.length || !o.length) return;
4762
- const r = t.clientX, a = n[0].getBoundingClientRect().width, h = o[0].getBoundingClientRect().width;
4839
+ const r = t.clientX, a = n[0].getBoundingClientRect().width, d = o[0].getBoundingClientRect().width;
4763
4840
  i.style.tableLayout = "fixed", this.withNoTextSelect((p) => {
4764
- const m = (u) => {
4765
- const v = (s ? -1 : 1) * (u.clientX - r);
4766
- n.forEach((b) => b.style.width = Math.max(24, Math.round(a + v)) + "px"), o.forEach((b) => b.style.width = Math.max(24, Math.round(h - v)) + "px"), this.positionTableHandles();
4841
+ const u = (m) => {
4842
+ const f = (s ? -1 : 1) * (m.clientX - r);
4843
+ n.forEach((b) => b.style.width = Math.max(24, Math.round(a + f)) + "px"), o.forEach((b) => b.style.width = Math.max(24, Math.round(d - f)) + "px"), this.positionTableHandles();
4767
4844
  }, g = () => {
4768
- window.removeEventListener("mousemove", m), window.removeEventListener("mouseup", g), p(), this.onChange();
4845
+ window.removeEventListener("mousemove", u), window.removeEventListener("mouseup", g), p(), this.onChange();
4769
4846
  };
4770
- window.addEventListener("mousemove", m), window.addEventListener("mouseup", g);
4847
+ window.addEventListener("mousemove", u), window.addEventListener("mouseup", g);
4771
4848
  });
4772
4849
  }
4773
4850
  /* ---------------------------------------------------------- image toolbar / resize */
@@ -4782,7 +4859,7 @@ const I = class I {
4782
4859
  this.cancelImgHide(), this.imgHandles.forEach((i) => i.remove()), this.imgHandles = [], (t = this.imgCtx) == null || t.remove(), this.imgCtx = null, (e = this.imgActive) == null || e.classList.remove("img-selected"), this.imgActive = null;
4783
4860
  }
4784
4861
  selectImage(t) {
4785
- this.imgActive !== t && (this.clearImageHandles(), this.imgActive = t, t.classList.add("img-selected"), this.imgHandles = Ut.map((e) => {
4862
+ this.imgActive !== t && (this.clearImageHandles(), this.imgActive = t, t.classList.add("img-selected"), this.imgHandles = Vt.map((e) => {
4786
4863
  const i = document.createElement("div");
4787
4864
  return i.className = "img-handle img-handle-" + e, i.dataset.corner = e, i.addEventListener("mousedown", (s) => this.startImageResizeDrag(s, e)), i.addEventListener("mouseenter", () => this.cancelImgHide()), i.addEventListener("mouseleave", () => this.scheduleImgHide()), document.body.appendChild(i), i;
4788
4865
  }), this.imgCtx = this.buildImageCtxToolbar(t), this.positionImageHandles());
@@ -4791,13 +4868,13 @@ const I = class I {
4791
4868
  const e = document.createElement("div");
4792
4869
  e.className = "imgctx", e.dir = this.dir();
4793
4870
  const i = () => {
4794
- var h;
4871
+ var d;
4795
4872
  const a = this.buildImageCtxToolbar(t);
4796
- (h = this.imgCtx) == null || h.replaceWith(a), this.imgCtx = a, this.positionImageHandles();
4873
+ (d = this.imgCtx) == null || d.replaceWith(a), this.imgCtx = a, this.positionImageHandles();
4797
4874
  }, s = (a) => {
4798
4875
  this.setImageAlign(t, a), i();
4799
- }, l = t.style.float === "left", n = t.style.float === "right", o = !l && !n && t.style.marginLeft === "auto" && t.style.marginRight === "auto", r = (a, h, p, m) => {
4800
- const g = this.ctxBtn(a, h, m);
4876
+ }, l = t.style.float === "left", n = t.style.float === "right", o = !l && !n && t.style.marginLeft === "auto" && t.style.marginRight === "auto", r = (a, d, p, u) => {
4877
+ const g = this.ctxBtn(a, d, u);
4801
4878
  return g.classList.toggle("on", p), g;
4802
4879
  };
4803
4880
  return e.append(
@@ -4858,8 +4935,8 @@ const I = class I {
4858
4935
  const o = this.imgCtx.offsetWidth, r = this.imgCtx.offsetHeight;
4859
4936
  let a = i + (s - i) / 2 - o / 2;
4860
4937
  a = Math.max(8 + scrollX, Math.min(a, scrollX + innerWidth - o - 8));
4861
- let h = e - r - 8;
4862
- h < this.ctxMinTop() && (h = l + 8), this.imgCtx.style.left = a + "px", this.imgCtx.style.top = h + "px";
4938
+ let d = e - r - 8;
4939
+ d < this.ctxMinTop() && (d = l + 8), this.imgCtx.style.left = a + "px", this.imgCtx.style.top = d + "px";
4863
4940
  }
4864
4941
  }
4865
4942
  startImageResizeDrag(t, e) {
@@ -4869,12 +4946,12 @@ const I = class I {
4869
4946
  this.cancelImgHide();
4870
4947
  const s = t.clientX, l = i.getBoundingClientRect().width, n = e === "nw" || e === "sw" ? -1 : 1;
4871
4948
  this.withNoTextSelect((o) => {
4872
- const r = (h) => {
4873
- i.style.width = Math.max(24, Math.round(l + n * (h.clientX - s))) + "px", i.style.height = "auto", this.positionImageHandles();
4949
+ const r = (d) => {
4950
+ i.style.width = Math.max(24, Math.round(l + n * (d.clientX - s))) + "px", i.style.height = "auto", this.positionImageHandles();
4874
4951
  }, a = () => {
4875
4952
  window.removeEventListener("mousemove", r), window.removeEventListener("mouseup", a), o();
4876
- const h = parseInt(i.style.width, 10);
4877
- h > 0 && !i.closest(".tpl-media") && (i.setAttribute("width", String(h)), i.removeAttribute("height")), this.onChange();
4953
+ const d = parseInt(i.style.width, 10);
4954
+ d > 0 && !i.closest(".tpl-media") && (i.setAttribute("width", String(d)), i.removeAttribute("height")), this.onChange();
4878
4955
  };
4879
4956
  window.addEventListener("mousemove", r), window.addEventListener("mouseup", a);
4880
4957
  });
@@ -4947,8 +5024,8 @@ const I = class I {
4947
5024
  const e = t.getBoundingClientRect(), i = e.top + scrollY, s = e.left + scrollX, l = e.right + scrollX, n = e.bottom + scrollY, o = this.selCtx.offsetWidth, r = this.selCtx.offsetHeight;
4948
5025
  let a = s + (l - s) / 2 - o / 2;
4949
5026
  a = Math.max(8 + scrollX, Math.min(a, scrollX + innerWidth - o - 8));
4950
- let h = i - r - 8;
4951
- h < this.ctxMinTop() && (h = n + 8), this.selCtx.style.left = a + "px", this.selCtx.style.top = h + "px";
5027
+ let d = i - r - 8;
5028
+ d < this.ctxMinTop() && (d = n + 8), this.selCtx.style.left = a + "px", this.selCtx.style.top = d + "px";
4952
5029
  }
4953
5030
  repositionSelToolbar() {
4954
5031
  if (!this.selCtx) return;
@@ -4981,7 +5058,7 @@ const I = class I {
4981
5058
  return t > 0 ? t + "px" : "";
4982
5059
  }
4983
5060
  refreshState() {
4984
- var r, a, h;
5061
+ var r, a, d;
4985
5062
  const t = window.getSelection(), e = t ? this.ed.contains(t.anchorNode) : !1, i = this.currentBlock();
4986
5063
  [this.toolbar, this.selCtx].filter(Boolean).forEach((p) => {
4987
5064
  [
@@ -4996,22 +5073,22 @@ const I = class I {
4996
5073
  "insertOrderedList",
4997
5074
  "insertUnorderedList"
4998
5075
  ].forEach((g) => {
4999
- const u = p.querySelector(`[data-id=${g}]`);
5000
- u && u.classList.toggle("on", e && document.queryCommandState(g));
5076
+ const m = p.querySelector(`[data-id=${g}]`);
5077
+ m && m.classList.toggle("on", e && document.queryCommandState(g));
5001
5078
  }), ["h2", "h3", "blockquote"].forEach((g) => {
5002
- const u = p.querySelector(`[data-id=${g}]`);
5003
- u && u.classList.toggle("on", e && i === g);
5079
+ const m = p.querySelector(`[data-id=${g}]`);
5080
+ m && m.classList.toggle("on", e && i === g);
5004
5081
  });
5005
- const m = p.querySelector("[data-id=code]");
5006
- m && m.classList.toggle("on", e && !!this.closestInlineCode());
5082
+ const u = p.querySelector("[data-id=code]");
5083
+ u && u.classList.toggle("on", e && !!this.closestInlineCode());
5007
5084
  });
5008
5085
  const l = t ? this.closestBlock(t.anchorNode) : null, n = ((r = l == null ? void 0 : l.closest("[dir]")) == null ? void 0 : r.getAttribute("dir")) || this.ed.getAttribute("dir") || this.dir();
5009
- (a = this.toolbar.querySelector("[data-id=ltr]")) == null || a.classList.toggle("on", e && n === "ltr"), (h = this.toolbar.querySelector("[data-id=rtl]")) == null || h.classList.toggle("on", e && n === "rtl");
5010
- const o = (p, m, g) => {
5011
- const u = this.toolbar.querySelector(`[data-id=${p}] .lbl`);
5012
- u && (u.textContent = m || g || "", u.classList.toggle("empty", !m));
5086
+ (a = this.toolbar.querySelector("[data-id=ltr]")) == null || a.classList.toggle("on", e && n === "ltr"), (d = this.toolbar.querySelector("[data-id=rtl]")) == null || d.classList.toggle("on", e && n === "rtl");
5087
+ const o = (p, u, g) => {
5088
+ const m = this.toolbar.querySelector(`[data-id=${p}] .lbl`);
5089
+ m && (m.textContent = u || g || "", m.classList.toggle("empty", !u));
5013
5090
  };
5014
- o("fontsel", this.currentFont()), o("sizesel", this.currentSize().replace("px", "")), e && o("blocksel", X.some((p) => p[0] === i) ? this.blockLabel(i) : this.t("para")), this.sbWords.textContent = this.countWords() + " " + this.t("words");
5091
+ o("fontsel", this.currentFont()), o("sizesel", this.currentSize().replace("px", "")), e && o("blocksel", Q.some((p) => p[0] === i) ? this.blockLabel(i) : this.t("para")), this.sbWords.textContent = this.countWords() + " " + this.t("words");
5015
5092
  }
5016
5093
  countWords() {
5017
5094
  const t = (this.ed.textContent || "").trim();
@@ -5037,7 +5114,7 @@ const I = class I {
5037
5114
  return;
5038
5115
  }
5039
5116
  }
5040
- i ? this.pasteRichHTML(i, e, s) : (document.execCommand("insertHTML", !1, kt(e.getData("text/plain"))), this.onChange());
5117
+ i ? this.pasteRichHTML(i, e, s) : (document.execCommand("insertHTML", !1, It(e.getData("text/plain"))), this.onChange());
5041
5118
  }
5042
5119
  /** Rich-HTML paste. Before the (untouched) paste engine runs, pictures Word left
5043
5120
  * behind as unreadable file:// refs are pulled out of the clipboard's RTF flavor
@@ -5052,7 +5129,7 @@ const I = class I {
5052
5129
  const n = Pt(t, l);
5053
5130
  t = n.html, s = n.injected;
5054
5131
  }
5055
- if (i && Rt(t) === 1) {
5132
+ if (i && Ot(t) === 1) {
5056
5133
  const n = i.getAsFile();
5057
5134
  if (n) {
5058
5135
  const o = t;
@@ -5078,10 +5155,10 @@ const I = class I {
5078
5155
  const s = this.imageUploadHandler, l = e.filter((n, o) => e.indexOf(n) === o);
5079
5156
  i || this.saveSel(), Promise.all(
5080
5157
  l.map((n, o) => {
5081
- const r = Dt(n, "pasted-image-" + (o + 1));
5158
+ const r = Ft(n, "pasted-image-" + (o + 1));
5082
5159
  return r ? s(r).catch((a) => {
5083
- var h;
5084
- return (h = this.onImageUploadError) == null || h.call(this, a, r), n;
5160
+ var d;
5161
+ return (d = this.onImageUploadError) == null || d.call(this, a, r), n;
5085
5162
  }) : Promise.resolve(n);
5086
5163
  })
5087
5164
  ).then((n) => {
@@ -5094,7 +5171,7 @@ const I = class I {
5094
5171
  /** `deferred` means the insert is happening after an async hop, so the caret the
5095
5172
  * paste started from has to be put back first. */
5096
5173
  insertPastedHTML(t, e = !1) {
5097
- e && this.restoreSel(), document.execCommand("insertHTML", !1, Ht(t, this.dir())), e && this.saveSel(), this.onChange();
5174
+ e && this.restoreSel(), document.execCommand("insertHTML", !1, At(t, this.dir())), e && this.saveSel(), this.onChange();
5098
5175
  }
5099
5176
  /* ---------------------------------------------------------- init */
5100
5177
  initUI() {
@@ -5102,18 +5179,18 @@ const I = class I {
5102
5179
  }
5103
5180
  };
5104
5181
  I.instanceCounter = 0, I.TBR_COLLAPSE_MAX = 992;
5105
- let it = I;
5182
+ let st = I;
5106
5183
  export {
5107
- X as BLOCKS,
5108
- Jt as CHARS,
5109
- gt as COLORS,
5110
- ht as FONTS,
5111
- it as FableEditor,
5112
- rt as I18N,
5184
+ Q as BLOCKS,
5185
+ pe as CHARS,
5186
+ vt as COLORS,
5187
+ pt as FONTS,
5188
+ st as FableEditor,
5189
+ ct as I18N,
5113
5190
  c as IC,
5114
- dt as SIZES,
5115
- te as TXT,
5116
- Ht as cleanPastedHTML,
5117
- D as getStrings,
5118
- kt as normalizeTextPaste
5191
+ ut as SIZES,
5192
+ ue as TXT,
5193
+ At as cleanPastedHTML,
5194
+ O as getStrings,
5195
+ It as normalizeTextPaste
5119
5196
  };