@sheetxl/studio-mui 0.1.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/LICENSE.md +11 -0
  2. package/README.md +24 -0
  3. package/build/browser/cjs/4XrhSt2xtUIXkiCt.cjs +1516 -0
  4. package/build/browser/cjs/B3EvhaQf456RMc1Q.cjs +6 -0
  5. package/build/browser/cjs/B3kl467PN2cpvrfz.cjs +12 -0
  6. package/build/browser/cjs/B5LCoenQbQmzic16.cjs +314 -0
  7. package/build/browser/cjs/BBuyHZwFlDRvHzBH.cjs +7 -0
  8. package/build/browser/cjs/BGoG_ROASNB2owBR.cjs +28 -0
  9. package/build/browser/cjs/BJ6Da8vZLjAl44pz.cjs +6 -0
  10. package/build/browser/cjs/BL_UVvG75SFsFaT3.cjs +6 -0
  11. package/build/browser/cjs/BNDoTytIOGtVh5l9.cjs +6 -0
  12. package/build/browser/cjs/BQOyVCuOdwDja_VV.cjs +42 -0
  13. package/build/browser/cjs/BRiPktKUmeJipjaa.cjs +6 -0
  14. package/build/browser/cjs/BabbNVs5iKg49rfk.cjs +6 -0
  15. package/build/browser/cjs/BcOX5vODdThWbKrR.cjs +6 -0
  16. package/build/browser/cjs/BchlMljYmXDs0Ol2.cjs +6 -0
  17. package/build/browser/cjs/BmYZvm13acvbFhOu.cjs +6 -0
  18. package/build/browser/cjs/BmbsW1n0-CkF3ITF.cjs +6 -0
  19. package/build/browser/cjs/BnCUyGP_ERKmL3ZR.cjs +6 -0
  20. package/build/browser/cjs/BtP4E1_yhMjpfbr5.cjs +6 -0
  21. package/build/browser/cjs/C3E9wmSfmgYmXfJN.cjs +205 -0
  22. package/build/browser/cjs/C3Hl78e9qfEHxJYc.cjs +6 -0
  23. package/build/browser/cjs/CEvRH8aOx3etutK_.cjs +17 -0
  24. package/build/browser/cjs/CLZSdaBnKDfb142R.cjs +6 -0
  25. package/build/browser/cjs/CN1cS39WcNrcPVqS.cjs +129 -0
  26. package/build/browser/cjs/CSH1hUnHovjo8Lb8.cjs +6 -0
  27. package/build/browser/cjs/CTNt3asYQRA-MROc.cjs +47 -0
  28. package/build/browser/cjs/C_JZEtvgcli6T7Wg.cjs +11 -0
  29. package/build/browser/cjs/CbaYZmvS8u-p_Z8Z.cjs +6 -0
  30. package/build/browser/cjs/Cc-4c3DRm96wq5rj.cjs +12 -0
  31. package/build/browser/cjs/CnY6DbatGmPyylfU.cjs +20 -0
  32. package/build/browser/cjs/CqkQGfzNax6GmZFo.cjs +6 -0
  33. package/build/browser/cjs/D2AF0a4vbNKzFxzA.cjs +21 -0
  34. package/build/browser/cjs/D4y1iYdx8sdwQ50T.cjs +6 -0
  35. package/build/browser/cjs/D5cF1EnyvnPY2IxS.cjs +150 -0
  36. package/build/browser/cjs/DA1-OPTYQTepGKEg.cjs +11 -0
  37. package/build/browser/cjs/DJDMVDpUqlEKYLjt.cjs +6 -0
  38. package/build/browser/cjs/DLXLJ8SNNjwM5C-P.cjs +6 -0
  39. package/build/browser/cjs/DV8lOsZBgyx7MTBW.cjs +6 -0
  40. package/build/browser/cjs/DZAPn_d9mpvfRzsb.cjs +6 -0
  41. package/build/browser/cjs/DaicqO_9d1hYzyB_.cjs +11 -0
  42. package/build/browser/cjs/Dfh6eMCbAjW14fdh.cjs +6 -0
  43. package/build/browser/cjs/DhI2lgDZL8GqBejN.cjs +6 -0
  44. package/build/browser/cjs/Ds6s8fpzOZsd2m1r.cjs +6 -0
  45. package/build/browser/cjs/DvIWGmDT5uBVQ5zH.cjs +16 -0
  46. package/build/browser/cjs/DvLgu20RiaayrJcW.cjs +7 -0
  47. package/build/browser/cjs/Dvhwt25gyHzxQLrp.cjs +6 -0
  48. package/build/browser/cjs/DvwApJM_CVrlpLxn.cjs +6 -0
  49. package/build/browser/cjs/DwVYzo4a05DMfta_.cjs +28 -0
  50. package/build/browser/cjs/NYdqUauA5i2q33UZ.cjs +6 -0
  51. package/build/browser/cjs/S2Xfq-KDgoT7ipPC.cjs +25 -0
  52. package/build/browser/cjs/TOZQZr9ZZ_Q-jdQZ.cjs +6 -0
  53. package/build/browser/cjs/bJuLOalXTwrshZL3.cjs +16 -0
  54. package/build/browser/cjs/eh9refYW4Gm25cmW.cjs +6 -0
  55. package/build/browser/cjs/hKqcVeb_8_4M79xj.cjs +6 -0
  56. package/build/browser/cjs/index.cjs +7 -0
  57. package/build/browser/cjs/is17hbP-kpOIBRP3.cjs +6 -0
  58. package/build/browser/cjs/pNY789kHWwRQXqse.cjs +17 -0
  59. package/build/browser/cjs/qJcc3ALtLWml32LU.cjs +18 -0
  60. package/build/browser/cjs/vWgVoELLfZ2ff1xL.cjs +6 -0
  61. package/build/browser/esm/2kwF7RVUWBY1zsgG.mjs +16 -0
  62. package/build/browser/esm/7Imk0owJj7oNHR7v.mjs +48 -0
  63. package/build/browser/esm/AuNwPf0DXe0twn35.mjs +1592 -0
  64. package/build/browser/esm/B1Kw9U_AxCk0Aq9f.mjs +59 -0
  65. package/build/browser/esm/B9l1_Tfw_tMhKCNB.mjs +437 -0
  66. package/build/browser/esm/B9winT3ff8rc4sbn.mjs +490 -0
  67. package/build/browser/esm/BEo9XX1sHmVjScSm.mjs +16 -0
  68. package/build/browser/esm/BGTcOBCyrTTlov_i.mjs +13399 -0
  69. package/build/browser/esm/BMGddfMXtKQ9AXQS.mjs +16 -0
  70. package/build/browser/esm/BQSa7N7QMGysdZdU.mjs +3932 -0
  71. package/build/browser/esm/BVEuc_3fLG2GN34k.mjs +16 -0
  72. package/build/browser/esm/BVh9YUwiSov8wcyY.mjs +1708 -0
  73. package/build/browser/esm/BZt5yM_TvoPXqdeA.mjs +3867 -0
  74. package/build/browser/esm/BfU8KdaB9wrEPWM-.mjs +16 -0
  75. package/build/browser/esm/BjUaiSvRZnas-HJW.mjs +16 -0
  76. package/build/browser/esm/BqiVaoAYJJqPrCUZ.mjs +16 -0
  77. package/build/browser/esm/BtMqJ5CRpKuAC4UQ.mjs +1486 -0
  78. package/build/browser/esm/BwvMR2cgGwFn8hAL.mjs +36 -0
  79. package/build/browser/esm/BxU3eVA-Adrnq7ZJ.mjs +1372 -0
  80. package/build/browser/esm/C00coampLNiXjWJJ.mjs +436 -0
  81. package/build/browser/esm/C6nh1rvYnAg2w2V2.mjs +838 -0
  82. package/build/browser/esm/C8gc149K34Zi2lP2.mjs +16 -0
  83. package/build/browser/esm/CGSkuCZY1EmTUNlQ.mjs +52 -0
  84. package/build/browser/esm/CKXzosgZX8Xe3l59.mjs +16 -0
  85. package/build/browser/esm/CNYANG0Z7mhGYo00.mjs +859 -0
  86. package/build/browser/esm/CV_FNw2i_aEc5nwA.mjs +16 -0
  87. package/build/browser/esm/CYSj0-zys2FKWgnb.mjs +18 -0
  88. package/build/browser/esm/CbTs5cvVaP1vPCYD.mjs +2248 -0
  89. package/build/browser/esm/CfAob8gGydmX1xQu.mjs +16 -0
  90. package/build/browser/esm/ChGigf2OPu7d44Km.mjs +16 -0
  91. package/build/browser/esm/CnzGN0S6zOfL_3SS.mjs +1358 -0
  92. package/build/browser/esm/CpyeUtXgDmrcMESB.mjs +52 -0
  93. package/build/browser/esm/CrEGjvQKhAcdw5sY.mjs +16 -0
  94. package/build/browser/esm/CtrrmHx9YbrOithw.mjs +152 -0
  95. package/build/browser/esm/CzAM0pDdZ7sjGgn9.mjs +86 -0
  96. package/build/browser/esm/D0oVDcgRUMZ9MHzu.mjs +41 -0
  97. package/build/browser/esm/D54Fpmnd9MzCzp-Z.mjs +16 -0
  98. package/build/browser/esm/D78-3ghInxscHLVq.mjs +23 -0
  99. package/build/browser/esm/DEpR6b4DMs-va6RS.mjs +43734 -0
  100. package/build/browser/esm/DEsqE49cIQZ8AqCe.mjs +398 -0
  101. package/build/browser/esm/DGe70xvBhc62ZVZz.mjs +2410 -0
  102. package/build/browser/esm/DXapJ5_yR4E8vDaK.mjs +1685 -0
  103. package/build/browser/esm/DjAZeDxBIBZsRTm3.mjs +24 -0
  104. package/build/browser/esm/DttdPwwDTcRX4uwL.mjs +44 -0
  105. package/build/browser/esm/FXcO0MVElhw9cc3v.mjs +49 -0
  106. package/build/browser/esm/GpycqJcrwTRtjEqA.mjs +16 -0
  107. package/build/browser/esm/HCE-tMxyVd0m-PgN.mjs +16 -0
  108. package/build/browser/esm/OCdyQRicV8KxUwMt.mjs +16 -0
  109. package/build/browser/esm/UukTgmLv7or2mhlB.mjs +16 -0
  110. package/build/browser/esm/_cuE13TWr3oEoKGP.mjs +34 -0
  111. package/build/browser/esm/aIlK3Ybu-1T4WHPv.mjs +640 -0
  112. package/build/browser/esm/bFSkTthAEOn7gv5x.mjs +16 -0
  113. package/build/browser/esm/bOhN6up-rdLRp82s.mjs +5588 -0
  114. package/build/browser/esm/index.mjs +85 -0
  115. package/build/browser/esm/ng3JdG4_hi9SgtHk.mjs +16 -0
  116. package/build/browser/esm/o6U2z4gZ7GE4QKZD.mjs +16 -0
  117. package/build/browser/esm/psav3cvsBQQczhPL.mjs +16 -0
  118. package/build/browser/esm/vn0iS301yg2hAbYd.mjs +51 -0
  119. package/build/licenses/dependencies.txt +1341 -0
  120. package/build/node/assets/style.css +1 -0
  121. package/build/node/esm/2kwF7RVUWBY1zsgG.mjs +16 -0
  122. package/build/node/esm/B-Xlyl81h27-bnvO.mjs +16 -0
  123. package/build/node/esm/B1_NYsn5D8x9QedP.mjs +307 -0
  124. package/build/node/esm/BCA5bxOeDA8k1Bm1.mjs +16 -0
  125. package/build/node/esm/BEo9XX1sHmVjScSm.mjs +16 -0
  126. package/build/node/esm/BIfdVpnJR1TZwCPR.mjs +1378 -0
  127. package/build/node/esm/BIqDzNJtkm-dyH0v.mjs +154 -0
  128. package/build/node/esm/BMGddfMXtKQ9AXQS.mjs +16 -0
  129. package/build/node/esm/BUOdfqhtCh8lhOhm.mjs +4000 -0
  130. package/build/node/esm/BYbE15S73xgn7S5E.mjs +88 -0
  131. package/build/node/esm/BfU8KdaB9wrEPWM-.mjs +16 -0
  132. package/build/node/esm/BkyivirgeiDKFSjk.mjs +16 -0
  133. package/build/node/esm/Bm1RqNJ-XvHpJW9z.mjs +831 -0
  134. package/build/node/esm/BqiVaoAYJJqPrCUZ.mjs +16 -0
  135. package/build/node/esm/Bx-30HInllXS7M_J.mjs +41 -0
  136. package/build/node/esm/Bx3lQBEvcqhxffT-.mjs +1726 -0
  137. package/build/node/esm/BxsKlaBFnb5wNq6R.mjs +53 -0
  138. package/build/node/esm/C4PMhNAV0KpPsKFj.mjs +24 -0
  139. package/build/node/esm/C7x3L6HtPhZjSrrZ.mjs +471 -0
  140. package/build/node/esm/C8gc149K34Zi2lP2.mjs +16 -0
  141. package/build/node/esm/CK-kn1p9NGRVM_h7.mjs +16 -0
  142. package/build/node/esm/CKR6snAwSONs7kfL.mjs +19 -0
  143. package/build/node/esm/CKXzosgZX8Xe3l59.mjs +16 -0
  144. package/build/node/esm/CLE_RHHvsDeoZ9Zd.mjs +561 -0
  145. package/build/node/esm/CMKci_5THkcJ-w9a.mjs +80 -0
  146. package/build/node/esm/CVU9bu6AnxcgkEwq.mjs +13466 -0
  147. package/build/node/esm/CfAob8gGydmX1xQu.mjs +16 -0
  148. package/build/node/esm/ChGigf2OPu7d44Km.mjs +16 -0
  149. package/build/node/esm/CkvkuPSf4R_DqArg.mjs +5648 -0
  150. package/build/node/esm/CnBMj0oJAyr9ZbjP.mjs +23 -0
  151. package/build/node/esm/CrEGjvQKhAcdw5sY.mjs +16 -0
  152. package/build/node/esm/Crx9i_8dm3OQsk_T.mjs +28 -0
  153. package/build/node/esm/CwUulbiMQH11aF4x.mjs +16 -0
  154. package/build/node/esm/D0Lh0V1tkdJPxZnI.mjs +392 -0
  155. package/build/node/esm/D54Fpmnd9MzCzp-Z.mjs +16 -0
  156. package/build/node/esm/D5bg3v_W8K9MVp0j.mjs +1711 -0
  157. package/build/node/esm/D8F08tiG98tM_voL.mjs +16 -0
  158. package/build/node/esm/DR7o1DOIK9zdiBgS.mjs +50 -0
  159. package/build/node/esm/DYEgm2kd3haV-Ml8.mjs +1246 -0
  160. package/build/node/esm/DfzhmhZ4I0Zurcqn.mjs +44 -0
  161. package/build/node/esm/Dg_ERnlsy5hwbzMA.mjs +1498 -0
  162. package/build/node/esm/Dt4cj_0sWgvt4FGj.mjs +92 -0
  163. package/build/node/esm/GpycqJcrwTRtjEqA.mjs +16 -0
  164. package/build/node/esm/LlkIFFfAjLiQ5Or6.mjs +3840 -0
  165. package/build/node/esm/OCdyQRicV8KxUwMt.mjs +16 -0
  166. package/build/node/esm/QATDL2FGAYcVnd33.mjs +49 -0
  167. package/build/node/esm/SvgA2TyqJYOzheuf.mjs +26 -0
  168. package/build/node/esm/VZ150KIUh5JVRqpk.mjs +52 -0
  169. package/build/node/esm/XRLHatWlgABiuBDS.mjs +52 -0
  170. package/build/node/esm/bFSkTthAEOn7gv5x.mjs +16 -0
  171. package/build/node/esm/index.mjs +44754 -0
  172. package/build/node/esm/lgtVRbg712G5Ba-x.mjs +60 -0
  173. package/build/node/esm/ng3JdG4_hi9SgtHk.mjs +16 -0
  174. package/build/node/esm/psav3cvsBQQczhPL.mjs +16 -0
  175. package/build/node/esm/zWnN2OzbhzCc6T7u.mjs +86 -0
  176. package/build/package.json +84 -0
  177. package/build/types/index.d.ts +1848 -0
  178. package/package.json +100 -0
@@ -0,0 +1,1486 @@
1
+ import { ap as Pt, J as Vt, aq as be, ar as xe, as as Rt, at as wt, F as re, au as we, av as ve, ae as Se, aw as Ce, D as te, k as ke, P as pe, ax as Ae, Y as De } from "./DEpR6b4DMs-va6RS.mjs";
2
+ /**
3
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.0.0
4
+ *
5
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
6
+ * License: The license can be found at https://www.sheetxl.com/license.
7
+ */
8
+ /**
9
+ * @license @sheetxl/io - IO - Import/Export Libraries for SheetXL. - v0.0.0
10
+ *
11
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
12
+ * License: The license can be found at https://www.sheetxl.com/license.
13
+ */
14
+ const ne = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", Ee = new RegExp(`^[${ne}][-${ne}.0-9·̀-ͯ‿-⁀]*$`, "u");
15
+ /**
16
+ * Character classes and associated utilities for the 5th edition of XML 1.0.
17
+ *
18
+ * @author Louis-Dominique Dubeau
19
+ * @license MIT
20
+ * @copyright Louis-Dominique Dubeau
21
+ */
22
+ function ge(i) {
23
+ return i >= 65 && i <= 90 || i >= 97 && i <= 122 || i === 58 || i === 95 || i === 8204 || i === 8205 || i >= 192 && i <= 214 || i >= 216 && i <= 246 || i >= 248 && i <= 767 || i >= 880 && i <= 893 || i >= 895 && i <= 8191 || i >= 8304 && i <= 8591 || i >= 11264 && i <= 12271 || i >= 12289 && i <= 55295 || i >= 63744 && i <= 64975 || i >= 65008 && i <= 65533 || i >= 65536 && i <= 983039;
24
+ }
25
+ /**
26
+ * Character class utilities for XML NS 1.0 edition 3.
27
+ *
28
+ * @author Louis-Dominique Dubeau
29
+ * @license MIT
30
+ * @copyright Louis-Dominique Dubeau
31
+ */
32
+ const ae = "A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", Pe = new RegExp(`^[${ae}][-${ae}.0-9·̀-ͯ‿-⁀]*$`, "u");
33
+ function fe(i) {
34
+ return i >= 65 && i <= 90 || i === 95 || i >= 97 && i <= 122 || i >= 192 && i <= 214 || i >= 216 && i <= 246 || i >= 248 && i <= 767 || i >= 880 && i <= 893 || i >= 895 && i <= 8191 || i >= 8204 && i <= 8205 || i >= 8304 && i <= 8591 || i >= 11264 && i <= 12271 || i >= 12289 && i <= 55295 || i >= 63744 && i <= 64975 || i >= 65008 && i <= 65533 || i >= 65536 && i <= 983039;
35
+ }
36
+ const rt = function(i) {
37
+ return i === 32 || i === 10 || i === 13 || i === 9;
38
+ }, Oe = function(i) {
39
+ return i >= 32 && i <= 55295 || i === 10 || i === 13 || i === 9 || i >= 57344 && i <= 65533 || i >= 65536 && i <= 1114111;
40
+ }, zt = ge, le = function(i) {
41
+ return ge(i) || i >= 48 && i <= 57 || i === 45 || i === 46 || i === 183 || i >= 768 && i <= 879 || i >= 8255 && i <= 8256;
42
+ }, me = [32, 10, 13, 9], Ie = Ee, Ve = function(i) {
43
+ return i >= 1 && i <= 55295 || i >= 57344 && i <= 65533 || i >= 65536 && i <= 1114111;
44
+ }, Le = fe, Ne = function(i) {
45
+ return fe(i) || i === 45 || i === 46 || i >= 48 && i <= 57 || i === 183 || i >= 768 && i <= 879 || i >= 8255 && i <= 8256;
46
+ }, Re = Pe, Yt = "http://www.w3.org/XML/1998/namespace", Ht = "http://www.w3.org/2000/xmlns/", $e = { __proto__: null, xml: Yt, xmlns: Ht }, Me = { __proto__: null, amp: "&", gt: ">", lt: "<", quot: '"', apos: "'" }, N = -1, bt = -2, tt = 13, Ot = 33, pt = 10, At = 60, Mt = 61, B = 62, z = 63, jt = 93, Kt = (i) => i === 34 || i === 39, Te = [34, 39], je = [...Te, 91, B], He = [...Te, At, jt], Fe = [Mt, z, ...me], Xe = [...me, B, 38, At];
47
+ function ee(i, t, s) {
48
+ switch (t) {
49
+ case "xml":
50
+ s !== Yt && i.fail(`xml prefix must be bound to ${Yt}.`);
51
+ break;
52
+ case "xmlns":
53
+ s !== Ht && i.fail(`xmlns prefix must be bound to ${Ht}.`);
54
+ }
55
+ switch (s) {
56
+ case Ht:
57
+ i.fail(t === "" ? `the default namespace may not be set to ${s}.` : `may not assign a prefix (even "xmlns") to the URI ${Ht}.`);
58
+ break;
59
+ case Yt:
60
+ switch (t) {
61
+ case "xml":
62
+ break;
63
+ case "":
64
+ i.fail(`the default namespace may not be set to ${s}.`);
65
+ break;
66
+ default:
67
+ i.fail("may not assign the xml namespace to another prefix.");
68
+ }
69
+ }
70
+ }
71
+ const Be = (i) => Re.test(i), We = (i) => Ie.test(i), ce = { xmldecl: "xmldeclHandler", text: "textHandler", processinginstruction: "piHandler", doctype: "doctypeHandler", comment: "commentHandler", opentagstart: "openTagStartHandler", attribute: "attributeHandler", opentag: "openTagHandler", closetag: "closeTagHandler", cdata: "cdataHandler", error: "errorHandler", end: "endHandler", ready: "readyHandler" };
72
+ class _e {
73
+ constructor(t) {
74
+ this.i = 0, this.prevI = 0, this.opt = t ?? {}, this.fragmentOpt = !!this.opt.fragment;
75
+ const s = this.xmlnsOpt = !!this.opt.xmlns;
76
+ if (this.trackPosition = this.opt.position !== !1, this.fileName = this.opt.fileName, s) {
77
+ this.nameStartCheck = Le, this.nameCheck = Ne, this.isName = Be, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = { __proto__: null, ...$e };
78
+ const o = this.opt.additionalNamespaces;
79
+ o != null && (function(n, a) {
80
+ for (const l of Object.keys(a)) ee(n, l, a[l]);
81
+ }(this, o), Object.assign(this.ns, o));
82
+ } else this.nameStartCheck = zt, this.nameCheck = le, this.isName = We, this.processAttribs = this.processAttribsPlain, this.pushAttrib = this.pushAttribPlain;
83
+ this.stateTable = [this.sBegin, this.sBeginWhitespace, this.sDoctype, this.sDoctypeQuote, this.sDTD, this.sDTDQuoted, this.sDTDOpenWaka, this.sDTDOpenWakaBang, this.sDTDComment, this.sDTDCommentEnding, this.sDTDCommentEnded, this.sDTDPI, this.sDTDPIEnding, this.sText, this.sEntity, this.sOpenWaka, this.sOpenWakaBang, this.sComment, this.sCommentEnding, this.sCommentEnded, this.sCData, this.sCDataEnding, this.sCDataEnding2, this.sPIFirstChar, this.sPIRest, this.sPIBody, this.sPIEnding, this.sXMLDeclNameStart, this.sXMLDeclName, this.sXMLDeclEq, this.sXMLDeclValueStart, this.sXMLDeclValue, this.sXMLDeclSeparator, this.sXMLDeclEnding, this.sOpenTag, this.sOpenTagSlash, this.sAttrib, this.sAttribName, this.sAttribNameSawWhite, this.sAttribValue, this.sAttribValueQuoted, this.sAttribValueClosed, this.sAttribValueUnquoted, this.sCloseTag, this.sCloseTagSawWhite], this._init();
84
+ }
85
+ get closed() {
86
+ return this._closed;
87
+ }
88
+ _init() {
89
+ this.openWakaBang = "", this.text = "", this.name = "", this.piTarget = "", this.entity = "", this.q = null, this.tags = [], this.tag = null, this.topNS = null, this.chunk = "", this.chunkPosition = 0, this.i = 0, this.prevI = 0, this.carriedFromPrevious = void 0, this.forbiddenState = 0, this.attribList = [];
90
+ const { fragmentOpt: t } = this;
91
+ this.state = t ? tt : 0, this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot = this.sawRoot = t, this.xmlDeclPossible = !t, this.xmlDeclExpects = ["version"], this.entityReturnState = void 0;
92
+ let { defaultXMLVersion: s } = this.opt;
93
+ if (s === void 0) {
94
+ if (this.opt.forceXMLVersion === !0) throw new Error("forceXMLVersion set but defaultXMLVersion is not set");
95
+ s = "1.0";
96
+ }
97
+ this.setXMLVersion(s), this.positionAtNewLine = 0, this.doctype = !1, this._closed = !1, this.xmlDecl = { version: void 0, encoding: void 0, standalone: void 0 }, this.line = 1, this.column = 0, this.ENTITIES = Object.create(Me), this.readyHandler?.();
98
+ }
99
+ get position() {
100
+ return this.chunkPosition + this.i;
101
+ }
102
+ get columnIndex() {
103
+ return this.position - this.positionAtNewLine;
104
+ }
105
+ on(t, s) {
106
+ this[ce[t]] = s;
107
+ }
108
+ off(t) {
109
+ this[ce[t]] = void 0;
110
+ }
111
+ makeError(t) {
112
+ let s = this.fileName ?? "";
113
+ return this.trackPosition && (s.length > 0 && (s += ":"), s += `${this.line}:${this.column}`), s.length > 0 && (s += ": "), new Error(s + t);
114
+ }
115
+ fail(t) {
116
+ const s = this.makeError(t), o = this.errorHandler;
117
+ if (o === void 0) throw s;
118
+ return o(s), this;
119
+ }
120
+ write(t) {
121
+ if (this.closed) return this.fail("cannot write after close; assign an onready handler.");
122
+ let s = !1;
123
+ t === null ? (s = !0, t = "") : typeof t == "object" && (t = t.toString()), this.carriedFromPrevious !== void 0 && (t = `${this.carriedFromPrevious}${t}`, this.carriedFromPrevious = void 0);
124
+ let o = t.length;
125
+ const n = t.charCodeAt(o - 1);
126
+ !s && (n === 13 || n >= 55296 && n <= 56319) && (this.carriedFromPrevious = t[o - 1], o--, t = t.slice(0, o));
127
+ const { stateTable: a } = this;
128
+ for (this.chunk = t, this.i = 0; this.i < o; ) a[this.state].call(this);
129
+ return this.chunkPosition += o, s ? this.end() : this;
130
+ }
131
+ close() {
132
+ return this.write(null);
133
+ }
134
+ getCode10() {
135
+ const t = this.chunk, s = this.i;
136
+ if (this.prevI = s, this.i++, s >= t.length) return N;
137
+ const o = t.charCodeAt(s);
138
+ if (this.column++, o < 55296) {
139
+ if (o >= 32 || o === 9) return o;
140
+ switch (o) {
141
+ case pt:
142
+ return this.line++, this.column = 0, this.positionAtNewLine = this.position, pt;
143
+ case 13:
144
+ return t.charCodeAt(s + 1) === pt && (this.i = s + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, bt;
145
+ default:
146
+ return this.fail("disallowed character."), o;
147
+ }
148
+ }
149
+ if (o > 56319) return o >= 57344 && o <= 65533 || this.fail("disallowed character."), o;
150
+ const n = 65536 + 1024 * (o - 55296) + (t.charCodeAt(s + 1) - 56320);
151
+ return this.i = s + 2, n > 1114111 && this.fail("disallowed character."), n;
152
+ }
153
+ getCode11() {
154
+ const { chunk: t, i: s } = this;
155
+ if (this.prevI = s, this.i = s + 1, s >= t.length) return N;
156
+ const o = t.charCodeAt(s);
157
+ if (this.column++, o < 55296) {
158
+ if (o > 31 && o < 127 || o > 159 && o !== 8232 || o === 9) return o;
159
+ switch (o) {
160
+ case pt:
161
+ return this.line++, this.column = 0, this.positionAtNewLine = this.position, pt;
162
+ case 13: {
163
+ const a = t.charCodeAt(s + 1);
164
+ a !== pt && a !== 133 || (this.i = s + 2);
165
+ }
166
+ case 133:
167
+ case 8232:
168
+ return this.line++, this.column = 0, this.positionAtNewLine = this.position, bt;
169
+ default:
170
+ return this.fail("disallowed character."), o;
171
+ }
172
+ }
173
+ if (o > 56319) return o >= 57344 && o <= 65533 || this.fail("disallowed character."), o;
174
+ const n = 65536 + 1024 * (o - 55296) + (t.charCodeAt(s + 1) - 56320);
175
+ return this.i = s + 2, n > 1114111 && this.fail("disallowed character."), n;
176
+ }
177
+ getCodeNorm() {
178
+ const t = this.getCode();
179
+ return t === bt ? pt : t;
180
+ }
181
+ unget() {
182
+ this.i = this.prevI, this.column--;
183
+ }
184
+ captureTo(t) {
185
+ let { i: s } = this;
186
+ const { chunk: o } = this;
187
+ for (; ; ) {
188
+ const n = this.getCode(), a = n === bt, l = a ? pt : n;
189
+ if (l === N || t.includes(l)) return this.text += o.slice(s, this.prevI), l;
190
+ a && (this.text += `${o.slice(s, this.prevI)}
191
+ `, s = this.i);
192
+ }
193
+ }
194
+ captureToChar(t) {
195
+ let { i: s } = this;
196
+ const { chunk: o } = this;
197
+ for (; ; ) {
198
+ let n = this.getCode();
199
+ switch (n) {
200
+ case bt:
201
+ this.text += `${o.slice(s, this.prevI)}
202
+ `, s = this.i, n = pt;
203
+ break;
204
+ case N:
205
+ return this.text += o.slice(s), !1;
206
+ }
207
+ if (n === t) return this.text += o.slice(s, this.prevI), !0;
208
+ }
209
+ }
210
+ captureNameChars() {
211
+ const { chunk: t, i: s } = this;
212
+ for (; ; ) {
213
+ const o = this.getCode();
214
+ if (o === N) return this.name += t.slice(s), N;
215
+ if (!le(o)) return this.name += t.slice(s, this.prevI), o === bt ? pt : o;
216
+ }
217
+ }
218
+ skipSpaces() {
219
+ for (; ; ) {
220
+ const t = this.getCodeNorm();
221
+ if (t === N || !rt(t)) return t;
222
+ }
223
+ }
224
+ setXMLVersion(t) {
225
+ this.currentXMLVersion = t, t === "1.0" ? (this.isChar = Oe, this.getCode = this.getCode10) : (this.isChar = Ve, this.getCode = this.getCode11);
226
+ }
227
+ sBegin() {
228
+ this.chunk.charCodeAt(0) === 65279 && (this.i++, this.column++), this.state = 1;
229
+ }
230
+ sBeginWhitespace() {
231
+ const t = this.i, s = this.skipSpaces();
232
+ switch (this.prevI !== t && (this.xmlDeclPossible = !1), s) {
233
+ case At:
234
+ if (this.state = 15, this.text.length !== 0) throw new Error("no-empty text at start");
235
+ break;
236
+ case N:
237
+ break;
238
+ default:
239
+ this.unget(), this.state = tt, this.xmlDeclPossible = !1;
240
+ }
241
+ }
242
+ sDoctype() {
243
+ const t = this.captureTo(je);
244
+ switch (t) {
245
+ case B:
246
+ this.doctypeHandler?.(this.text), this.text = "", this.state = tt, this.doctype = !0;
247
+ break;
248
+ case N:
249
+ break;
250
+ default:
251
+ this.text += String.fromCodePoint(t), t === 91 ? this.state = 4 : Kt(t) && (this.state = 3, this.q = t);
252
+ }
253
+ }
254
+ sDoctypeQuote() {
255
+ const t = this.q;
256
+ this.captureToChar(t) && (this.text += String.fromCodePoint(t), this.q = null, this.state = 2);
257
+ }
258
+ sDTD() {
259
+ const t = this.captureTo(He);
260
+ t !== N && (this.text += String.fromCodePoint(t), t === jt ? this.state = 2 : t === At ? this.state = 6 : Kt(t) && (this.state = 5, this.q = t));
261
+ }
262
+ sDTDQuoted() {
263
+ const t = this.q;
264
+ this.captureToChar(t) && (this.text += String.fromCodePoint(t), this.state = 4, this.q = null);
265
+ }
266
+ sDTDOpenWaka() {
267
+ const t = this.getCodeNorm();
268
+ switch (this.text += String.fromCodePoint(t), t) {
269
+ case 33:
270
+ this.state = 7, this.openWakaBang = "";
271
+ break;
272
+ case z:
273
+ this.state = 11;
274
+ break;
275
+ default:
276
+ this.state = 4;
277
+ }
278
+ }
279
+ sDTDOpenWakaBang() {
280
+ const t = String.fromCodePoint(this.getCodeNorm()), s = this.openWakaBang += t;
281
+ this.text += t, s !== "-" && (this.state = s === "--" ? 8 : 4, this.openWakaBang = "");
282
+ }
283
+ sDTDComment() {
284
+ this.captureToChar(45) && (this.text += "-", this.state = 9);
285
+ }
286
+ sDTDCommentEnding() {
287
+ const t = this.getCodeNorm();
288
+ this.text += String.fromCodePoint(t), this.state = t === 45 ? 10 : 8;
289
+ }
290
+ sDTDCommentEnded() {
291
+ const t = this.getCodeNorm();
292
+ this.text += String.fromCodePoint(t), t === B ? this.state = 4 : (this.fail("malformed comment."), this.state = 8);
293
+ }
294
+ sDTDPI() {
295
+ this.captureToChar(z) && (this.text += "?", this.state = 12);
296
+ }
297
+ sDTDPIEnding() {
298
+ const t = this.getCodeNorm();
299
+ this.text += String.fromCodePoint(t), t === B && (this.state = 4);
300
+ }
301
+ sText() {
302
+ this.tags.length !== 0 ? this.handleTextInRoot() : this.handleTextOutsideRoot();
303
+ }
304
+ sEntity() {
305
+ let { i: t } = this;
306
+ const { chunk: s } = this;
307
+ t: for (; ; ) switch (this.getCode()) {
308
+ case bt:
309
+ this.entity += `${s.slice(t, this.prevI)}
310
+ `, t = this.i;
311
+ break;
312
+ case 59: {
313
+ const { entityReturnState: o } = this, n = this.entity + s.slice(t, this.prevI);
314
+ let a;
315
+ this.state = o, n === "" ? (this.fail("empty entity name."), a = "&;") : (a = this.parseEntity(n), this.entity = ""), o === tt && this.textHandler === void 0 || (this.text += a);
316
+ break t;
317
+ }
318
+ case N:
319
+ this.entity += s.slice(t);
320
+ break t;
321
+ }
322
+ }
323
+ sOpenWaka() {
324
+ const t = this.getCode();
325
+ if (zt(t)) this.state = 34, this.unget(), this.xmlDeclPossible = !1;
326
+ else switch (t) {
327
+ case 47:
328
+ this.state = 43, this.xmlDeclPossible = !1;
329
+ break;
330
+ case 33:
331
+ this.state = 16, this.openWakaBang = "", this.xmlDeclPossible = !1;
332
+ break;
333
+ case z:
334
+ this.state = 23;
335
+ break;
336
+ default:
337
+ this.fail("disallowed character in tag name"), this.state = tt, this.xmlDeclPossible = !1;
338
+ }
339
+ }
340
+ sOpenWakaBang() {
341
+ switch (this.openWakaBang += String.fromCodePoint(this.getCodeNorm()), this.openWakaBang) {
342
+ case "[CDATA[":
343
+ this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = !0), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = !0), this.state = 20, this.openWakaBang = "";
344
+ break;
345
+ case "--":
346
+ this.state = 17, this.openWakaBang = "";
347
+ break;
348
+ case "DOCTYPE":
349
+ this.state = 2, (this.doctype || this.sawRoot) && this.fail("inappropriately located doctype declaration."), this.openWakaBang = "";
350
+ break;
351
+ default:
352
+ this.openWakaBang.length >= 7 && this.fail("incorrect syntax.");
353
+ }
354
+ }
355
+ sComment() {
356
+ this.captureToChar(45) && (this.state = 18);
357
+ }
358
+ sCommentEnding() {
359
+ const t = this.getCodeNorm();
360
+ t === 45 ? (this.state = 19, this.commentHandler?.(this.text), this.text = "") : (this.text += `-${String.fromCodePoint(t)}`, this.state = 17);
361
+ }
362
+ sCommentEnded() {
363
+ const t = this.getCodeNorm();
364
+ t !== B ? (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(t)}`, this.state = 17) : this.state = tt;
365
+ }
366
+ sCData() {
367
+ this.captureToChar(jt) && (this.state = 21);
368
+ }
369
+ sCDataEnding() {
370
+ const t = this.getCodeNorm();
371
+ t === jt ? this.state = 22 : (this.text += `]${String.fromCodePoint(t)}`, this.state = 20);
372
+ }
373
+ sCDataEnding2() {
374
+ const t = this.getCodeNorm();
375
+ switch (t) {
376
+ case B:
377
+ this.cdataHandler?.(this.text), this.text = "", this.state = tt;
378
+ break;
379
+ case jt:
380
+ this.text += "]";
381
+ break;
382
+ default:
383
+ this.text += `]]${String.fromCodePoint(t)}`, this.state = 20;
384
+ }
385
+ }
386
+ sPIFirstChar() {
387
+ const t = this.getCodeNorm();
388
+ this.nameStartCheck(t) ? (this.piTarget += String.fromCodePoint(t), this.state = 24) : t === z || rt(t) ? (this.fail("processing instruction without a target."), this.state = t === z ? 26 : 25) : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(t), this.state = 24);
389
+ }
390
+ sPIRest() {
391
+ const { chunk: t, i: s } = this;
392
+ for (; ; ) {
393
+ const o = this.getCodeNorm();
394
+ if (o === N) return void (this.piTarget += t.slice(s));
395
+ if (!this.nameCheck(o)) {
396
+ this.piTarget += t.slice(s, this.prevI);
397
+ const n = o === z;
398
+ n || rt(o) ? this.piTarget === "xml" ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = n ? Ot : 27) : this.state = n ? 26 : 25 : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(o));
399
+ break;
400
+ }
401
+ }
402
+ }
403
+ sPIBody() {
404
+ if (this.text.length === 0) {
405
+ const t = this.getCodeNorm();
406
+ t === z ? this.state = 26 : rt(t) || (this.text = String.fromCodePoint(t));
407
+ } else this.captureToChar(z) && (this.state = 26);
408
+ }
409
+ sPIEnding() {
410
+ const t = this.getCodeNorm();
411
+ if (t === B) {
412
+ const { piTarget: s } = this;
413
+ s.toLowerCase() === "xml" && this.fail("the XML declaration must appear at the start of the document."), this.piHandler?.({ target: s, body: this.text }), this.piTarget = this.text = "", this.state = tt;
414
+ } else t === z ? this.text += "?" : (this.text += `?${String.fromCodePoint(t)}`, this.state = 25);
415
+ this.xmlDeclPossible = !1;
416
+ }
417
+ sXMLDeclNameStart() {
418
+ const t = this.skipSpaces();
419
+ t !== z ? t !== N && (this.state = 28, this.name = String.fromCodePoint(t)) : this.state = Ot;
420
+ }
421
+ sXMLDeclName() {
422
+ const t = this.captureTo(Fe);
423
+ if (t === z) return this.state = Ot, this.name += this.text, this.text = "", void this.fail("XML declaration is incomplete.");
424
+ if (rt(t) || t === Mt) {
425
+ if (this.name += this.text, this.text = "", !this.xmlDeclExpects.includes(this.name)) switch (this.name.length) {
426
+ case 0:
427
+ this.fail("did not expect any more name/value pairs.");
428
+ break;
429
+ case 1:
430
+ this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);
431
+ break;
432
+ default:
433
+ this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`);
434
+ }
435
+ this.state = t === Mt ? 30 : 29;
436
+ }
437
+ }
438
+ sXMLDeclEq() {
439
+ const t = this.getCodeNorm();
440
+ if (t === z) return this.state = Ot, void this.fail("XML declaration is incomplete.");
441
+ rt(t) || (t !== Mt && this.fail("value required."), this.state = 30);
442
+ }
443
+ sXMLDeclValueStart() {
444
+ const t = this.getCodeNorm();
445
+ if (t === z) return this.state = Ot, void this.fail("XML declaration is incomplete.");
446
+ rt(t) || (Kt(t) ? this.q = t : (this.fail("value must be quoted."), this.q = 32), this.state = 31);
447
+ }
448
+ sXMLDeclValue() {
449
+ const t = this.captureTo([this.q, z]);
450
+ if (t === z) return this.state = Ot, this.text = "", void this.fail("XML declaration is incomplete.");
451
+ if (t === N) return;
452
+ const s = this.text;
453
+ switch (this.text = "", this.name) {
454
+ case "version": {
455
+ this.xmlDeclExpects = ["encoding", "standalone"];
456
+ const o = s;
457
+ this.xmlDecl.version = o, /^1\.[0-9]+$/.test(o) ? this.opt.forceXMLVersion || this.setXMLVersion(o) : this.fail("version number must match /^1\\.[0-9]+$/.");
458
+ break;
459
+ }
460
+ case "encoding":
461
+ /^[A-Za-z][A-Za-z0-9._-]*$/.test(s) || this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."), this.xmlDeclExpects = ["standalone"], this.xmlDecl.encoding = s;
462
+ break;
463
+ case "standalone":
464
+ s !== "yes" && s !== "no" && this.fail('standalone value must match "yes" or "no".'), this.xmlDeclExpects = [], this.xmlDecl.standalone = s;
465
+ }
466
+ this.name = "", this.state = 32;
467
+ }
468
+ sXMLDeclSeparator() {
469
+ const t = this.getCodeNorm();
470
+ t !== z ? (rt(t) || (this.fail("whitespace required."), this.unget()), this.state = 27) : this.state = Ot;
471
+ }
472
+ sXMLDeclEnding() {
473
+ this.getCodeNorm() === B ? (this.piTarget !== "xml" ? this.fail("processing instructions are not allowed before root.") : this.name !== "version" && this.xmlDeclExpects.includes("version") && this.fail("XML declaration must contain a version."), this.xmldeclHandler?.(this.xmlDecl), this.name = "", this.piTarget = this.text = "", this.state = tt) : this.fail("The character ? is disallowed anywhere in XML declarations."), this.xmlDeclPossible = !1;
474
+ }
475
+ sOpenTag() {
476
+ const t = this.captureNameChars();
477
+ if (t === N) return;
478
+ const s = this.tag = { name: this.name, attributes: /* @__PURE__ */ Object.create(null) };
479
+ switch (this.name = "", this.xmlnsOpt && (this.topNS = s.ns = /* @__PURE__ */ Object.create(null)), this.openTagStartHandler?.(s), this.sawRoot = !0, !this.fragmentOpt && this.closedRoot && this.fail("documents may contain only one root."), t) {
480
+ case B:
481
+ this.openTag();
482
+ break;
483
+ case 47:
484
+ this.state = 35;
485
+ break;
486
+ default:
487
+ rt(t) || this.fail("disallowed character in tag name."), this.state = 36;
488
+ }
489
+ }
490
+ sOpenTagSlash() {
491
+ this.getCode() === B ? this.openSelfClosingTag() : (this.fail("forward-slash in opening tag not followed by >."), this.state = 36);
492
+ }
493
+ sAttrib() {
494
+ const t = this.skipSpaces();
495
+ t !== N && (zt(t) ? (this.unget(), this.state = 37) : t === B ? this.openTag() : t === 47 ? this.state = 35 : this.fail("disallowed character in attribute name."));
496
+ }
497
+ sAttribName() {
498
+ const t = this.captureNameChars();
499
+ t === Mt ? this.state = 39 : rt(t) ? this.state = 38 : t === B ? (this.fail("attribute without value."), this.pushAttrib(this.name, this.name), this.name = this.text = "", this.openTag()) : t !== N && this.fail("disallowed character in attribute name.");
500
+ }
501
+ sAttribNameSawWhite() {
502
+ const t = this.skipSpaces();
503
+ switch (t) {
504
+ case N:
505
+ return;
506
+ case Mt:
507
+ this.state = 39;
508
+ break;
509
+ default:
510
+ this.fail("attribute without value."), this.text = "", this.name = "", t === B ? this.openTag() : zt(t) ? (this.unget(), this.state = 37) : (this.fail("disallowed character in attribute name."), this.state = 36);
511
+ }
512
+ }
513
+ sAttribValue() {
514
+ const t = this.getCodeNorm();
515
+ Kt(t) ? (this.q = t, this.state = 40) : rt(t) || (this.fail("unquoted attribute value."), this.state = 42, this.unget());
516
+ }
517
+ sAttribValueQuoted() {
518
+ const { q: t, chunk: s } = this;
519
+ let { i: o } = this;
520
+ for (; ; ) switch (this.getCode()) {
521
+ case t:
522
+ return this.pushAttrib(this.name, this.text + s.slice(o, this.prevI)), this.name = this.text = "", this.q = null, void (this.state = 41);
523
+ case 38:
524
+ return this.text += s.slice(o, this.prevI), this.state = 14, void (this.entityReturnState = 40);
525
+ case pt:
526
+ case bt:
527
+ case 9:
528
+ this.text += `${s.slice(o, this.prevI)} `, o = this.i;
529
+ break;
530
+ case At:
531
+ return this.text += s.slice(o, this.prevI), void this.fail("disallowed character.");
532
+ case N:
533
+ return void (this.text += s.slice(o));
534
+ }
535
+ }
536
+ sAttribValueClosed() {
537
+ const t = this.getCodeNorm();
538
+ rt(t) ? this.state = 36 : t === B ? this.openTag() : t === 47 ? this.state = 35 : zt(t) ? (this.fail("no whitespace between attributes."), this.unget(), this.state = 37) : this.fail("disallowed character in attribute name.");
539
+ }
540
+ sAttribValueUnquoted() {
541
+ const t = this.captureTo(Xe);
542
+ switch (t) {
543
+ case 38:
544
+ this.state = 14, this.entityReturnState = 42;
545
+ break;
546
+ case At:
547
+ this.fail("disallowed character.");
548
+ break;
549
+ case N:
550
+ break;
551
+ default:
552
+ this.text.includes("]]>") && this.fail('the string "]]>" is disallowed in char data.'), this.pushAttrib(this.name, this.text), this.name = this.text = "", t === B ? this.openTag() : this.state = 36;
553
+ }
554
+ }
555
+ sCloseTag() {
556
+ const t = this.captureNameChars();
557
+ t === B ? this.closeTag() : rt(t) ? this.state = 44 : t !== N && this.fail("disallowed character in closing tag.");
558
+ }
559
+ sCloseTagSawWhite() {
560
+ switch (this.skipSpaces()) {
561
+ case B:
562
+ this.closeTag();
563
+ break;
564
+ case N:
565
+ break;
566
+ default:
567
+ this.fail("disallowed character in closing tag.");
568
+ }
569
+ }
570
+ handleTextInRoot() {
571
+ let { i: t, forbiddenState: s } = this;
572
+ const { chunk: o, textHandler: n } = this;
573
+ t: for (; ; ) switch (this.getCode()) {
574
+ case At:
575
+ if (this.state = 15, n !== void 0) {
576
+ const { text: a } = this, l = o.slice(t, this.prevI);
577
+ a.length !== 0 ? (n(a + l), this.text = "") : l.length !== 0 && n(l);
578
+ }
579
+ s = 0;
580
+ break t;
581
+ case 38:
582
+ this.state = 14, this.entityReturnState = tt, n !== void 0 && (this.text += o.slice(t, this.prevI)), s = 0;
583
+ break t;
584
+ case jt:
585
+ switch (s) {
586
+ case 0:
587
+ s = 1;
588
+ break;
589
+ case 1:
590
+ s = 2;
591
+ break;
592
+ case 2:
593
+ break;
594
+ default:
595
+ throw new Error("impossible state");
596
+ }
597
+ break;
598
+ case B:
599
+ s === 2 && this.fail('the string "]]>" is disallowed in char data.'), s = 0;
600
+ break;
601
+ case bt:
602
+ n !== void 0 && (this.text += `${o.slice(t, this.prevI)}
603
+ `), t = this.i, s = 0;
604
+ break;
605
+ case N:
606
+ n !== void 0 && (this.text += o.slice(t));
607
+ break t;
608
+ default:
609
+ s = 0;
610
+ }
611
+ this.forbiddenState = s;
612
+ }
613
+ handleTextOutsideRoot() {
614
+ let { i: t } = this;
615
+ const { chunk: s, textHandler: o } = this;
616
+ let n = !1;
617
+ t: for (; ; ) {
618
+ const a = this.getCode();
619
+ switch (a) {
620
+ case At:
621
+ if (this.state = 15, o !== void 0) {
622
+ const { text: l } = this, g = s.slice(t, this.prevI);
623
+ l.length !== 0 ? (o(l + g), this.text = "") : g.length !== 0 && o(g);
624
+ }
625
+ break t;
626
+ case 38:
627
+ this.state = 14, this.entityReturnState = tt, o !== void 0 && (this.text += s.slice(t, this.prevI)), n = !0;
628
+ break t;
629
+ case bt:
630
+ o !== void 0 && (this.text += `${s.slice(t, this.prevI)}
631
+ `), t = this.i;
632
+ break;
633
+ case N:
634
+ o !== void 0 && (this.text += s.slice(t));
635
+ break t;
636
+ default:
637
+ rt(a) || (n = !0);
638
+ }
639
+ }
640
+ n && (this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = !0), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = !0));
641
+ }
642
+ pushAttribNS(t, s) {
643
+ const { prefix: o, local: n } = this.qname(t), a = { name: t, prefix: o, local: n, value: s };
644
+ if (this.attribList.push(a), this.attributeHandler?.(a), o === "xmlns") {
645
+ const l = s.trim();
646
+ this.currentXMLVersion === "1.0" && l === "" && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[n] = l, ee(this, n, l);
647
+ } else if (t === "xmlns") {
648
+ const l = s.trim();
649
+ this.topNS[""] = l, ee(this, "", l);
650
+ }
651
+ }
652
+ pushAttribPlain(t, s) {
653
+ const o = { name: t, value: s };
654
+ this.attribList.push(o), this.attributeHandler?.(o);
655
+ }
656
+ end() {
657
+ this.sawRoot || this.fail("document must contain a root element.");
658
+ const { tags: t } = this;
659
+ for (; t.length > 0; ) {
660
+ const o = t.pop();
661
+ this.fail(`unclosed tag: ${o.name}`);
662
+ }
663
+ this.state !== 0 && this.state !== tt && this.fail("unexpected end.");
664
+ const { text: s } = this;
665
+ return s.length !== 0 && (this.textHandler?.(s), this.text = ""), this._closed = !0, this.endHandler?.(), this._init(), this;
666
+ }
667
+ resolve(t) {
668
+ let s = this.topNS[t];
669
+ if (s !== void 0) return s;
670
+ const { tags: o } = this;
671
+ for (let n = o.length - 1; n >= 0; n--) if (s = o[n].ns[t], s !== void 0) return s;
672
+ return s = this.ns[t], s !== void 0 ? s : this.opt.resolvePrefix?.(t);
673
+ }
674
+ qname(t) {
675
+ const s = t.indexOf(":");
676
+ if (s === -1) return { prefix: "", local: t };
677
+ const o = t.slice(s + 1), n = t.slice(0, s);
678
+ return (n === "" || o === "" || o.includes(":")) && this.fail(`malformed name: ${t}.`), { prefix: n, local: o };
679
+ }
680
+ processAttribsNS() {
681
+ const { attribList: t } = this, s = this.tag;
682
+ {
683
+ const { prefix: a, local: l } = this.qname(s.name);
684
+ s.prefix = a, s.local = l;
685
+ const g = s.uri = this.resolve(a) ?? "";
686
+ a !== "" && (a === "xmlns" && this.fail('tags may not have "xmlns" as prefix.'), g === "" && (this.fail(`unbound namespace prefix: ${JSON.stringify(a)}.`), s.uri = a));
687
+ }
688
+ if (t.length === 0) return;
689
+ const { attributes: o } = s, n = /* @__PURE__ */ new Set();
690
+ for (const a of t) {
691
+ const { name: l, prefix: g, local: S } = a;
692
+ let b, x;
693
+ g === "" ? (b = l === "xmlns" ? Ht : "", x = l) : (b = this.resolve(g), b === void 0 && (this.fail(`unbound namespace prefix: ${JSON.stringify(g)}.`), b = g), x = `{${b}}${S}`), n.has(x) && this.fail(`duplicate attribute: ${x}.`), n.add(x), a.uri = b, o[l] = a;
694
+ }
695
+ this.attribList = [];
696
+ }
697
+ processAttribsPlain() {
698
+ const { attribList: t } = this, s = this.tag.attributes;
699
+ for (const { name: o, value: n } of t) s[o] !== void 0 && this.fail(`duplicate attribute: ${o}.`), s[o] = n;
700
+ this.attribList = [];
701
+ }
702
+ openTag() {
703
+ this.processAttribs();
704
+ const { tags: t } = this, s = this.tag;
705
+ s.isSelfClosing = !1, this.openTagHandler?.(s), t.push(s), this.state = tt, this.name = "";
706
+ }
707
+ openSelfClosingTag() {
708
+ this.processAttribs();
709
+ const { tags: t } = this, s = this.tag;
710
+ s.isSelfClosing = !0, this.openTagHandler?.(s), this.closeTagHandler?.(s), (this.tag = t[t.length - 1] ?? null) === null && (this.closedRoot = !0), this.state = tt, this.name = "";
711
+ }
712
+ closeTag() {
713
+ const { tags: t, name: s } = this;
714
+ if (this.state = tt, this.name = "", s === "") return this.fail("weird empty close tag."), void (this.text += "</>");
715
+ const o = this.closeTagHandler;
716
+ let n = t.length;
717
+ for (; n-- > 0; ) {
718
+ const a = this.tag = t.pop();
719
+ if (this.topNS = a.ns, o?.(a), a.name === s) break;
720
+ this.fail("unexpected close tag.");
721
+ }
722
+ n === 0 ? this.closedRoot = !0 : n < 0 && (this.fail(`unmatched closing tag: ${s}.`), this.text += `</${s}>`);
723
+ }
724
+ parseEntity(t) {
725
+ if (t[0] !== "#") {
726
+ const o = this.ENTITIES[t];
727
+ return o !== void 0 ? o : (this.fail(this.isName(t) ? "undefined entity." : "disallowed character in entity name."), `&${t};`);
728
+ }
729
+ let s = NaN;
730
+ return t[1] === "x" && /^#x[0-9a-f]+$/i.test(t) ? s = parseInt(t.slice(2), 16) : /^#[0-9]+$/.test(t) && (s = parseInt(t.slice(1), 10)), this.isChar(s) ? String.fromCodePoint(s) : (this.fail("malformed character entity."), `&${t};`);
731
+ }
732
+ }
733
+ var se, Ct;
734
+ (Ct = se || (se = {})).Events = { XmlDecl: "xmldecl", Text: "text", ProcessingInstruction: "processinginstruction", Doctype: "doctype", Comment: "comment", OpenTagStart: "opentagstart", Attribute: "attribute", OpenTag: "opentag", CloseTag: "closetag", CDdata: "cdata", Error: "error", End: "end", Ready: "ready" }, Ct.parseStream = async (i, t, s) => {
735
+ const o = new _e({ position: !1, ...s });
736
+ let n;
737
+ if (t.onOpenTagStart && o.on(Ct.Events.OpenTagStart, t.onOpenTagStart), t.onOpenTag && o.on(Ct.Events.OpenTag, t.onOpenTag), t.onCloseTag && o.on(Ct.Events.CloseTag, t.onCloseTag), t.onAttribute && o.on(Ct.Events.Attribute, t.onAttribute), t.onText && o.on(Ct.Events.Text, t.onText), t.onError && o.on(Ct.Events.Error, t.onError), t.onEnd) {
738
+ t.onEnd;
739
+ const a = () => {
740
+ n = t.onEnd();
741
+ };
742
+ o.on(Ct.Events.End, a);
743
+ }
744
+ for (; ; ) {
745
+ const { value: a, done: l } = await i.read();
746
+ if (l) break;
747
+ o.write(a);
748
+ }
749
+ return o.close(), n;
750
+ };
751
+ const P = (i) => i === !0 || i === "1" || i === "on" || i === "true" || i !== !1 && i !== "0" && i !== "off" && i !== "false" && null, L = (i) => {
752
+ const t = parseInt(i);
753
+ return isNaN(t) ? null : t;
754
+ }, xt = (i) => {
755
+ const t = parseFloat(i);
756
+ return isNaN(t) ? null : t;
757
+ }, O = null;
758
+ class qe {
759
+ constructor() {
760
+ this._registeredVisitors = /* @__PURE__ */ new Map();
761
+ }
762
+ registerVisitor(t) {
763
+ this._registeredVisitors.set(t.from, t);
764
+ }
765
+ createEventHandler(t, s, o) {
766
+ const n = this._registeredVisitors, a = [];
767
+ let l = null, g = null, S = null, b = null;
768
+ const x = [], C = { key: null, source: t };
769
+ let w = null, u = !1;
770
+ const A = (T, m) => {
771
+ let I = S.attributes[T];
772
+ if (m) {
773
+ if (Array.isArray(m)) {
774
+ for (let H = 0; H < m.length; H++) if (I == null || (I = m[H](I), I == null)) return;
775
+ } else if (I == null || (I = m(I), I == null)) return;
776
+ }
777
+ return I;
778
+ }, f = { getSource: () => w.source, setSource: (T) => {
779
+ w.source = T;
780
+ }, setKey: (T) => {
781
+ w.key = T;
782
+ }, getFrom: () => S, getAttribute: (T, m) => A(T, m) ?? null, hasAttribute: (T) => f.getAttribute(T) !== null, getParent: () => x[x.length - 2].source, getPath: () => {
783
+ const T = [];
784
+ for (let m = 0; m < a.length; m++) T.push(a[m].local);
785
+ return T.join("\\");
786
+ }, parseAttribute: A, copyToObject: (T, m, I, H) => {
787
+ const W = A(H ?? m, I);
788
+ W !== void 0 && (T[m] = W);
789
+ }, copyTo: (T, m, I) => {
790
+ const H = A(I ?? T, m);
791
+ H !== void 0 && (w.source[T] = H);
792
+ }, warn: (T) => {
793
+ o ? o?.(T) : console.warn(T);
794
+ } };
795
+ return { onOpenTag: (T) => {
796
+ let m = T.name;
797
+ const I = m.indexOf(":");
798
+ I !== -1 && (m = m.slice(I + 1));
799
+ const H = n.get(m);
800
+ if (l = { local: m, visitor: H, tag: T, destination: null }, u) return a.push(l), g = m, void (S = T);
801
+ b = l?.visitor ?? null, H && (w = a.length === 0 ? C : b?.to !== null ? { key: null, source: {} } : null, l.destination = w, w && x.push(w)), a.push(l), g = m, S = T, u = b?.to === null, b?.openTag?.(f);
802
+ }, onCloseTag: (T) => {
803
+ let m = T.name;
804
+ const I = m.indexOf(":");
805
+ if (I !== -1 && (m = m.slice(I + 1)), m !== g) throw new Error(`mismatch open/close tag: '${m}'/'${g}'`);
806
+ u || b?.closeTag?.(f);
807
+ const H = a.pop() ?? null;
808
+ l = a[a.length - 1] ?? null;
809
+ const W = H?.destination;
810
+ if (W) {
811
+ x.pop(), w = x[x.length - 1] ?? C;
812
+ const Z = H.visitor;
813
+ Z && Z.to && W.source !== void 0 && (Array.isArray(Z.to) ? w.source.push ? w.source.push(W.source) : o?.(`Unable to parse array for ${Z.from} at ${f.getPath()}`) : W.key ? w.source[W.key] = W.source : typeof Z.to == "string" && (w.source[Z.to] = W.source));
814
+ }
815
+ g = l?.local ?? null, S = l?.tag ?? null, b = l?.visitor ?? null, u = !l?.destination;
816
+ }, onText: (T) => {
817
+ b?.text?.(T, f);
818
+ }, onEnd: s };
819
+ }
820
+ }
821
+ const he = (i, t, s, o = null) => {
822
+ if (!i) return null;
823
+ let n = i;
824
+ n.startsWith("/") && (n = n.substring(1));
825
+ let a = o?.parsedRefs?.get(i);
826
+ if (a !== void 0) return a;
827
+ const l = t(n);
828
+ if (!l) return null;
829
+ let g = l.content;
830
+ try {
831
+ s && (g = s(g));
832
+ } catch (S) {
833
+ console.warn(S);
834
+ }
835
+ return o?.parsedRefs?.set(i, g), g;
836
+ }, ie = (i, t, s, o, n = null) => {
837
+ if (!i) return null;
838
+ let a = i;
839
+ a.startsWith("/") && (a = a.substring(1));
840
+ let l = n?.parsedRefs?.get(i);
841
+ if (l !== void 0) return l;
842
+ const g = t(a);
843
+ if (!g) return null;
844
+ const S = g.content;
845
+ try {
846
+ const b = new TextDecoder().decode(S), x = s.parseFromString(b, "text/xml"), C = o.convert(x, i, n);
847
+ return n?.parsedRefs?.set(i, C), C;
848
+ } catch (b) {
849
+ console.warn(b);
850
+ }
851
+ return null;
852
+ }, $t = (i, t, s, o, n = null) => {
853
+ const a = /* @__PURE__ */ new Map();
854
+ let l = t.Directory[i];
855
+ const g = l ? l.length : 0;
856
+ for (let S = 0; S < g; S++) {
857
+ const b = l[S];
858
+ if (!b) continue;
859
+ let x = b;
860
+ x.startsWith("/") && (x = x.substring(1));
861
+ const C = ie(x, (w) => t.files[w], s, o, n);
862
+ a.set(x, C);
863
+ }
864
+ return a;
865
+ }, ze = ["lt1", "dk1", "lt2", "dk2", "accent1", "accent2", "accent3", "accent4", "accent5", "accent6", "hlink", "folHlink"], ue = (i, t = "dk1") => {
866
+ let s;
867
+ const o = i("auto");
868
+ o === void 0 || o !== "1" && o !== "true" || (s = t);
869
+ const n = i("indexed");
870
+ n && (s = `index${n}`);
871
+ const a = i("rgb");
872
+ a && (s = a.toLowerCase(), a.length !== 8 || a.startsWith("FF") || (s = "FF" + a.substring(2, a.length)));
873
+ const l = i("theme");
874
+ l && (s = ze[l]);
875
+ let g = i("tint");
876
+ if (g && (s += ` ${Ce.AdjustmentType.ETint} ${parseFloat(g)}`), s) return s;
877
+ }, Ue = (i) => i && i.replace(/^\{([\s\S]+)\}$/, "$1"), Ke = (i) => i ? pe.roundAccurately(parseFloat(i) / 12700, 4) : null, Ye = (i) => i ? pe.roundAccurately(parseFloat(i) / 9525, 1) : null, ts = (i) => parseFloat(i) / 1e3, es = (i) => parseFloat(i) / 6e4, Ge = (i) => i === "true" || i === "1";
878
+ class It {
879
+ static {
880
+ this.Collapsed = 1;
881
+ }
882
+ static {
883
+ this.CustomFormat = 2;
884
+ }
885
+ static {
886
+ this.CustomHeight = 4;
887
+ }
888
+ static {
889
+ this.Hidden = 8;
890
+ }
891
+ static {
892
+ this.Ht = 16;
893
+ }
894
+ static {
895
+ this.OutlineLevel = 32;
896
+ }
897
+ static {
898
+ this.Ph = 64;
899
+ }
900
+ static {
901
+ this.R = 128;
902
+ }
903
+ static {
904
+ this.S = 256;
905
+ }
906
+ static {
907
+ this.Spans = 512;
908
+ }
909
+ static {
910
+ this.ThickBot = 1024;
911
+ }
912
+ static {
913
+ this.ThickTop = 2048;
914
+ }
915
+ }
916
+ const Ze = (i, t, s) => {
917
+ if (i[0].value[0] === i[1].value[0]) return t;
918
+ }, de = { colStart: 0, colEnd: 0, rowStart: 0, rowEnd: 0 }, Je = (i, t, s, o, n, a) => {
919
+ let l = !1, g = !1, S = [], b = !1, x = null, C = null, w = null, u = null, A = null, f = null;
920
+ const T = a?.get("richData") ?? [], m = wt.normalizeA1ToR1C1, I = te.createConflatingRanges(), H = /* @__PURE__ */ new Map(), W = [];
921
+ let Z = null;
922
+ const Ft = te.createConflatingRanges();
923
+ let gt, ct = !1, F = -1, $ = -1, et = null, vt = null;
924
+ const Xt = [];
925
+ let Lt = null, Bt = -2, ht = 0, ut = "", ft = "", mt = "", J = "", dt = "", Tt = "", St = "", Dt = "", Ut = "", Nt = "", Gt = "", Zt = "", D = "", U = "", M = !0, q = null;
926
+ return { ...s, onEnd: () => {
927
+ Xt.length > 0 && (t.rows = Xt);
928
+ let d = I.done(Ze);
929
+ const p = d.length;
930
+ if (p > 0) {
931
+ const E = new Array(p);
932
+ for (let v = 0; v < p; v++) {
933
+ const R = d[v], G = wt.rangeToString(R), st = R.value[1], it = wt.resolveRelativeToA1(st, R.rowStart, R.colStart);
934
+ E[v] = [G, it];
935
+ }
936
+ t.formulas = E;
937
+ }
938
+ const Q = Ft.done(!0), V = Q.length;
939
+ if (V > 0) {
940
+ const E = new Array(V);
941
+ for (let v = 0; v < V; v++) {
942
+ const R = Q[v], G = wt.rangeToString(R);
943
+ E[v] = G;
944
+ }
945
+ t.volatile = E;
946
+ }
947
+ if (W.length > 0 && (t.dynamicArray = [...W]), S.length > 0) {
948
+ S.sort(te.createRangeComparator(ke.Orientation.Column));
949
+ const E = [];
950
+ let v = null, R = -1, G = -1, st = -1, it = -1, Y = null;
951
+ const yt = S.length;
952
+ yt > 0 && (v = S[0], R = v.colStart, G = v.colEnd, st = v.rowEnd, it = v.value, E.push(v));
953
+ for (let k = 1; k < yt; k++) Y = S[k], it !== Y.value || R !== Y.colStart || G !== Y.colEnd || st + 1 !== Y.rowEnd ? (E.push(Y), v = Y, R = v.colStart, G = v.colEnd, st = v.rowEnd, it = v.value) : (st = Y.rowEnd, v.rowEnd = st);
954
+ let Wt = [];
955
+ for (let k = 0; k < E.length; k++) {
956
+ const X = E[k];
957
+ Wt.push({ r: { colStart: X.colStart, colEnd: X.colEnd, rowStart: X.rowStart, rowEnd: X.rowEnd }, v: X.value });
958
+ }
959
+ t.directStyles = Wt;
960
+ }
961
+ const K = i.build();
962
+ if (K) {
963
+ const E = K.tuples;
964
+ t.data = E;
965
+ }
966
+ s?.onEnd?.();
967
+ }, onOpenTag: (d) => {
968
+ let p = d.name;
969
+ const Q = p.indexOf(":");
970
+ if (Q !== -1 && (p = p.slice(Q + 1)), gt) {
971
+ const V = d.attributes;
972
+ switch (p) {
973
+ case "v":
974
+ g = !0;
975
+ break;
976
+ case "f":
977
+ switch (V.t ?? null) {
978
+ case null:
979
+ case "normal":
980
+ b = !0;
981
+ break;
982
+ case "shared":
983
+ const K = V.si;
984
+ C = V.ref, x = K;
985
+ break;
986
+ case "array":
987
+ b = !0, C = V.ref, Z = [C, !1];
988
+ break;
989
+ case "datatable":
990
+ b = !0, C = V.ref, b = !0;
991
+ }
992
+ V.ca !== void 0 && Ft.append(F, $);
993
+ break;
994
+ case "is":
995
+ return void (ct = !0);
996
+ }
997
+ return void (ct && n?.onOpenTag(d));
998
+ }
999
+ if (l) {
1000
+ if (p === "c") {
1001
+ gt = d;
1002
+ const V = d.attributes.r;
1003
+ $ = wt.fastStringToCol(V);
1004
+ const K = d.attributes.t;
1005
+ K === void 0 ? vt = null : (vt = K, vt === "str" && (ct = !0));
1006
+ let E = d.attributes.s;
1007
+ E !== void 0 && (E = parseInt(E), q && q.value === E && q.colEnd + 1 === $ ? q.colEnd = $ : (q = { colStart: $, rowStart: F, colEnd: $, rowEnd: F, value: E }, S.push(q)));
1008
+ }
1009
+ } else {
1010
+ if (p === "row") {
1011
+ l = !0;
1012
+ const V = d.attributes.r;
1013
+ if (F = parseInt(V) - 1, ht = 0, ft = d.attributes.customHeight, ft !== void 0 && (ht |= It.CustomHeight), ft !== Ut && (M = !0, Ut = ft), ut = d.attributes.ht, ut !== void 0 && (ht |= It.Ht), ut !== Dt && (M = !0, Dt = ut), mt = d.attributes.hidden, mt !== void 0 && (ht |= It.Hidden), mt !== Nt && (M = !0, Nt = mt), dt = d.attributes.s, dt !== void 0 && (ht |= It.S), dt !== Zt && (M = !0, Zt = dt), J = d.attributes.customFormat, J !== void 0 && (ht |= It.CustomFormat), J !== Gt && (M = !0, Gt = J), Tt = d.attributes.outlineLevel, Tt !== void 0 && (ht |= It.OutlineLevel), Tt !== D && (M = !0, D = Tt), St = d.attributes.collapsed, St !== void 0 && (ht |= It.Collapsed), St !== U && (M = !0, U = St), ht !== 0) if (Bt + 1 !== F || M) {
1014
+ const K = ft !== void 0 && (ft === "1" || ft === "true"), E = J !== void 0 && (J === "1" || J === "true");
1015
+ Lt = { min: F, max: F, sz: K && ut !== void 0 ? parseFloat(ut) : -1, csz: K, h: mt !== void 0 && (mt === "1" || mt === "true"), s: K && dt !== void 0 && dt !== "0" ? parseInt(dt) : 0, cs: E, l: Tt === void 0 || Tt === "0" ? 0 : parseInt(Tt), cl: St !== void 0 && (St === "1" || St === "true") }, Xt.push(Lt);
1016
+ } else Lt.max = F;
1017
+ return Bt = F, void (M = !1);
1018
+ }
1019
+ s?.onOpenTag(d);
1020
+ }
1021
+ }, onCloseTag: (d) => {
1022
+ if (gt) {
1023
+ let p = d.name;
1024
+ const Q = p.indexOf(":");
1025
+ if (Q !== -1 && (p = p.slice(Q + 1)), ct) if (p === "is" || p === "v") {
1026
+ const V = n?.onEnd();
1027
+ V !== null && i.addValue(F, $, "" + V);
1028
+ } else n?.onCloseTag?.(d);
1029
+ return g && (g = !1), void (p === "c" && (gt = null, ct = !1));
1030
+ }
1031
+ if (l) return l = !1, void (q = null);
1032
+ s?.onCloseTag(d);
1033
+ }, onText: (d) => {
1034
+ if (d = d.trim(), g) {
1035
+ switch (et = null, vt) {
1036
+ case null:
1037
+ case "n":
1038
+ et = parseFloat(d);
1039
+ break;
1040
+ case "b":
1041
+ et = d === "1" || d === "true";
1042
+ break;
1043
+ case "s":
1044
+ et = d;
1045
+ break;
1046
+ case "e":
1047
+ if (d === "#VALUE!") {
1048
+ const Q = gt.attributes.vm;
1049
+ if (Q !== void 0) {
1050
+ const V = T[parseInt(Q) - 1];
1051
+ if (V && V.isFormulaError) {
1052
+ et = { t: Vt.Error, v: V.getCode() };
1053
+ break;
1054
+ }
1055
+ }
1056
+ }
1057
+ const p = De.getBuiltInByLabel(d);
1058
+ p ? et = { t: Vt.Error, v: p.getCode() } : (et = d, o?.(`Unknown formula error '${d}' in cell ${wt.cellToString({ colIndex: $, rowIndex: F })}`));
1059
+ break;
1060
+ case "str":
1061
+ case "inlineStr":
1062
+ ct = !0;
1063
+ }
1064
+ et !== null && i.addValue(F, $, et);
1065
+ }
1066
+ if (Z && (vt === "e" && (Z[1] = !0), W.push(Z), Z = null), x) if (A === x) u = f;
1067
+ else {
1068
+ if (u = H.get(x), !u) {
1069
+ const p = [];
1070
+ w = m(d, F, $, p), u = [w, p, d], H.set(x, u);
1071
+ }
1072
+ A = x, f = u;
1073
+ }
1074
+ if (b) {
1075
+ const p = [];
1076
+ w = m(d, F, $, p), u = [w, p, d];
1077
+ }
1078
+ if (u) return I.append(F, $, u), u = null, b = !1, x = null, void (C = null);
1079
+ ct ? n?.onText(d) : l || s?.onText(d);
1080
+ } };
1081
+ }, ss = Object.freeze(Object.defineProperty({ __proto__: null, fromBufferXLSX: async (i, t) => {
1082
+ const { password: s, onWarning: o, constructorOptions: n = {}, ...a } = t ?? {}, l = import("./BGTcOBCyrTTlov_i.mjs"), g = import("./BVh9YUwiSov8wcyY.mjs");
1083
+ let S = null;
1084
+ try {
1085
+ S = new DOMParser();
1086
+ } catch {
1087
+ }
1088
+ let b = null;
1089
+ S || (b = import("./CnzGN0S6zOfL_3SS.mjs").then((u) => u.i));
1090
+ let x = null, C = null, w = null;
1091
+ try {
1092
+ const u = await Promise.all([l, g, b]);
1093
+ x = u[0], C = u[1], w = u[2];
1094
+ } catch (u) {
1095
+ throw new Error("Unable to load XLSX parser.", { cause: u });
1096
+ }
1097
+ try {
1098
+ const u = x.read(i, { type: "array", sheets: [], cellStyles: !1, bookFiles: !0 });
1099
+ if (!u.Directory) throw new Error("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
1100
+ u.Directory.richstructure = ["/xl/richData/rdrichvaluestructure.xml"], u.Directory.richdata = ["/xl/richData/rdrichvalue.xml"];
1101
+ const A = new C.FromOOXMLConverter(), f = S ?? new w.DOMParser(), T = n?.resources ?? new be(), m = T.beginPersist(), I = {}, H = /* @__PURE__ */ new Set(), W = /* @__PURE__ */ new Map();
1102
+ W.set("richTypes", []);
1103
+ const Z = /* @__PURE__ */ new Map(), Ft = [], gt = (D) => u.files[D], ct = (D, U) => {
1104
+ const M = D.lastIndexOf("/"), q = D.substring(0, M + 1) + "_rels/" + D.substring(M + 1, D.length) + ".rels";
1105
+ let d = U.get(q);
1106
+ return d || (d = ((p, Q, V, K, E = null) => {
1107
+ if (!p) return null;
1108
+ const v = ie(p, Q, V, K, E);
1109
+ if (!v) return null;
1110
+ const R = /* @__PURE__ */ new Map(), G = Object.keys(v), st = G.length;
1111
+ for (let it = 0; it < st; it++) {
1112
+ const Y = G[it], yt = v[Y];
1113
+ R.set(Y, yt);
1114
+ }
1115
+ return R;
1116
+ })(q, gt, f, A, $), U.set(q, d)), d;
1117
+ }, F = (D, U, M, q = Z) => {
1118
+ let d = ct(U, q).get(D), p = d?.target;
1119
+ if (!p) return null;
1120
+ if (d.targetMode === "External") return d.target;
1121
+ const Q = U.lastIndexOf("/"), V = U.substring(0, Q + 1);
1122
+ p.startsWith("/") || (p = V + p), p = ((v) => {
1123
+ const R = v.split(/\/+/);
1124
+ return R.reduce((G, st, it) => (st === "." ? G.splice(it, 1) : st === ".." && G.splice(it - 1, 2), G), R).join("/");
1125
+ })(p);
1126
+ const K = A?.getVisitorParamsState().get("dxfs");
1127
+ let E = q.get(p);
1128
+ if (!E) if (d.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet") {
1129
+ const v = {};
1130
+ E = v;
1131
+ const R = async () => {
1132
+ const G = ((k, X, _t, ot, nt, at, kt) => {
1133
+ const h = new qe(), lt = new xe.TransposedBuilder();
1134
+ let _ = null;
1135
+ h.registerVisitor({ from: "autoFilter", to: "filter", openTag: (e) => {
1136
+ e.copyTo("ref", O);
1137
+ } }), h.registerVisitor({ from: "conditionalFormatting", to: {}, openTag: (e) => {
1138
+ const r = e.getParent();
1139
+ r.conditionals || (r.conditionals = []), r.conditionals.push(e.getSource());
1140
+ const c = e.getAttribute("sqref");
1141
+ c && (e.getSource().ref = c.split(" ").join(",")), e.copyTo("pivot", P);
1142
+ }, closeTag: (e) => {
1143
+ const r = e.getSource();
1144
+ if (r.rule) {
1145
+ const c = Object.keys(r.rule);
1146
+ for (let y = 0; y < c.length; y++) {
1147
+ const j = c[y];
1148
+ j !== "rule" && (r[j] = r.rule[j]);
1149
+ }
1150
+ }
1151
+ delete r.rule;
1152
+ } }), h.registerVisitor({ from: "cfRule", to: "rule", openTag: (e) => {
1153
+ const r = e.getParent();
1154
+ e.copyToObject(r, "type", O), e.copyToObject(r, "priority", L), e.copyToObject(r, "stopIfTrue", P);
1155
+ const c = e.getAttribute("dxfId", L);
1156
+ if (c !== null) {
1157
+ let y = ot?.get(c);
1158
+ y || (at?.(`Unable to load conditional color. Invalid dxfI: '${c}' at '${e.getPath()}'.`), y = {}), r.style = y;
1159
+ }
1160
+ e.copyToObject(r, "aboveAverage", P), e.copyToObject(r, "equalAverage", P), e.copyToObject(r, "stdDev", L), e.copyToObject(r, "bottom", P), e.copyToObject(r, "percent", P), e.copyToObject(r, "rank", L), e.copyToObject(r, "operator", O), e.copyToObject(r, "text", O), e.copyToObject(r, "timePeriod", O);
1161
+ } }), h.registerVisitor({ from: "colorScale", to: "colorScale" }), h.registerVisitor({ from: "dataBar", to: "dataBar", openTag: (e) => {
1162
+ e.copyTo("maxLength", L), e.copyTo("minLength", L), e.copyTo("showValue", P);
1163
+ } }), h.registerVisitor({ from: "iconSet", to: "iconSet", openTag: (e) => {
1164
+ e.copyTo("iconSet", O), e.copyTo("reverse", P), e.copyTo("showValue", P);
1165
+ } }), h.registerVisitor({ from: "formula", to: null, text: (e, r) => {
1166
+ const c = r.getParent();
1167
+ let y = c.formulas;
1168
+ y || (y = [], c.formulas = y), y.push(e);
1169
+ } }), h.registerVisitor({ from: "cfvo", to: {}, openTag: (e) => {
1170
+ const r = e.getParent();
1171
+ r.conditions || (r.conditions = []), r.conditions.push(e.getSource()), e.copyTo("type", O), e.copyTo("value", xt, "val"), e.copyTo("gte", P);
1172
+ } }), h.registerVisitor({ from: "color", to: {}, openTag: (e) => {
1173
+ const r = e.getParent();
1174
+ r.colors || (r.colors = []);
1175
+ const c = ue((y) => e.getAttribute(y));
1176
+ r.colors.push(c);
1177
+ } }), h.registerVisitor({ from: "filterColumn", to: "filterColumn", openTag: (e) => {
1178
+ const r = e.getParent();
1179
+ r.fields || (r.fields = []), r.fields.push(e.getSource()), e.copyTo("offset", L, "colId"), e.copyTo("hiddenButton", P), e.copyTo("showButton", P);
1180
+ } }), h.registerVisitor({ from: "colorFilter", to: "colorFilter", openTag: (e) => {
1181
+ const r = e.getParent();
1182
+ r.criteria || (r.criteria = []), r.criteria.push(e.getSource()), e.getSource().type = Rt.Type.Color, e.copyTo("cellColor", P), e.copyTo("styleId", L, "dxfId");
1183
+ } }), h.registerVisitor({ from: "dynamicFilter", to: "dynamicFilter", openTag: (e) => {
1184
+ const r = e.getParent();
1185
+ r.criteria || (r.criteria = []), r.criteria.push(e.getSource()), e.getSource().type = Rt.Type.Dynamic, e.copyTo("dynamicType", O, "type"), e.copyTo("val", xt), e.copyTo("maxVal", xt, "maxVal");
1186
+ } }), h.registerVisitor({ from: "iconFilter", to: "iconFilter", openTag: (e) => {
1187
+ const r = e.getParent();
1188
+ r.criteria || (r.criteria = []), r.criteria.push(e.getSource()), e.getSource().type = Rt.Type.Icon, e.copyTo("iconId", L), e.copyTo("iconSet", O);
1189
+ } }), h.registerVisitor({ from: "top10", to: "top10", openTag: (e) => {
1190
+ const r = e.getParent();
1191
+ r.criteria || (r.criteria = []), r.criteria.push(e.getSource()), e.getSource().type = Rt.Type.Top10, e.copyTo("filterVal", xt), e.copyTo("percent", P), e.copyTo("top", P), e.copyTo("val", xt);
1192
+ } }), h.registerVisitor({ from: "filters", to: "filters", openTag: (e) => {
1193
+ const r = e.getParent();
1194
+ r.criteria || (r.criteria = []), r.criteria.push(e.getSource()), e.getSource().type = Rt.Type.Items, e.copyTo("blank", P), e.copyTo("calendarType", O);
1195
+ } }), h.registerVisitor({ from: "dateGroupItem", to: "dateGroupItem", openTag: (e) => {
1196
+ const r = e.getParent();
1197
+ r.dateGroups || (r.dateGroups = []), r.dateGroups.push(e.getSource()), e.copyTo("group", O, "dateTimeGrouping"), e.copyTo("day", L), e.copyTo("hour", L), e.copyTo("minute", L), e.copyTo("month", L), e.copyTo("second", L), e.copyTo("year", L);
1198
+ } }), h.registerVisitor({ from: "filter", to: "filter", openTag: (e) => {
1199
+ const r = e.getParent();
1200
+ r.items || (r.items = []), r.items.push(e.getAttribute("val", xt));
1201
+ } }), h.registerVisitor({ from: "customFilters", to: "customFilters", openTag: (e) => {
1202
+ const r = e.getParent();
1203
+ r.criteria || (r.criteria = []), r.criteria.push(e.getSource()), e.getSource().type = Rt.Type.Custom, e.copyTo("and", P);
1204
+ } }), h.registerVisitor({ from: "customFilter", to: "customFilter", openTag: (e) => {
1205
+ const r = e.getParent();
1206
+ r.filters || (r.filters = []), r.filters.push(e.getSource()), e.copyTo("operator", O), e.copyTo("value", xt, "val");
1207
+ } }), h.registerVisitor({ from: "sortState", to: "sort", openTag: (e) => {
1208
+ e.copyTo("ref", O);
1209
+ } }), h.registerVisitor({ from: "sortCondition", to: "sortCondition", openTag: (e) => {
1210
+ const r = e.getParent();
1211
+ r.fields || (r.fields = []);
1212
+ const c = e.getSource();
1213
+ r.fields.push(c), e.copyTo("sortOn", O, "sortBy"), e.copyTo("dxfId", O, "sortBy"), e.copyTo("iconSet", O), e.copyTo("customList", O);
1214
+ const y = e.getAttribute("ref");
1215
+ if (y) {
1216
+ const j = wt.fastStringToRange(y, de).colStart, Et = wt.fastStringToRange(r.ref, de), Qt = Et.colStart;
1217
+ c.offset = Et ? j - Qt : j;
1218
+ }
1219
+ c.reverse = e.getAttribute("descending", P) ?? !1;
1220
+ } }), h.registerVisitor({ from: "AlternateContent", to: null });
1221
+ const Jt = (e) => {
1222
+ _ = e.getSource(), e.copyTo("topLeft", O, "topLeftCell");
1223
+ const r = Ge(e.getAttribute("defaultGridColor")), c = e.getAttribute("colorId");
1224
+ c === null || r || (e.getSource().gridLineColor = "index" + parseFloat(c)), e.copyTo("showZeros", P), e.copyTo("showFormulas", P), e.copyTo("zoomScale", L), e.copyTo("showRowHeaders", P, "showRowColHeaders"), e.copyTo("showColumnHeaders", P, "showRowColHeaders"), e.copyTo("showRowGridlines", P, "showGridLines"), e.copyTo("showColumnGridlines", P, "showGridLines");
1225
+ };
1226
+ h.registerVisitor({ from: "sheetView", to: "view", openTag: (e) => {
1227
+ Jt(e);
1228
+ }, closeTag: () => {
1229
+ _ = null;
1230
+ } }), h.registerVisitor({ from: "customSheetViews", to: "customSheetViews", openTag: (e) => {
1231
+ e.setSource([]);
1232
+ } }), h.registerVisitor({ from: "customSheetView", to: [], openTag: (e) => {
1233
+ Jt(e);
1234
+ }, closeTag: () => {
1235
+ _ = null;
1236
+ } }), h.registerVisitor({ from: "selection", to: "selection", openTag: (e) => {
1237
+ if (!_) return;
1238
+ e.copyTo("cell", O, "activeCell"), e.copyTo("rangeIndex", L, "activeCellId");
1239
+ const r = e.getAttribute("activeCell"), c = e.getAttribute("sqref");
1240
+ c && c !== r && (e.getSource().ranges = c.split(" "));
1241
+ } }), h.registerVisitor({ from: "pane", to: "pane", openTag: (e) => {
1242
+ if (_ && e.getAttribute("state") === "frozen") {
1243
+ const r = {};
1244
+ _.freezePanes = r, e.copyToObject(r, "topLeft", O, "topLeftCell");
1245
+ const c = _.topLeft ? wt.fastStringToCell(_.topLeft) : { colIndex: 0, rowIndex: 0 }, y = { colIndex: 0, rowIndex: 0 };
1246
+ e.copyToObject(y, "colIndex", L, "xSplit"), e.copyToObject(y, "rowIndex", L, "ySplit");
1247
+ const j = { colIndex: c.colIndex + y.colIndex, rowIndex: c.rowIndex + y.rowIndex };
1248
+ r.coords = wt.cellToString(j);
1249
+ }
1250
+ } }), h.registerVisitor({ from: "tabColor", to: null, openTag: (e) => {
1251
+ const r = ue((c) => e.getAttribute(c));
1252
+ r && (k.tabColor = r);
1253
+ } }), h.registerVisitor({ from: "pageSetUpPr", to: "pageSetUpPr", openTag: (e) => {
1254
+ } }), h.registerVisitor({ from: "outlinePr", to: "outlinePr", openTag: (e) => {
1255
+ } }), h.registerVisitor({ from: "pageMargins", to: "pageMargins", openTag: (e) => {
1256
+ } }), h.registerVisitor({ from: "pageSetup", to: "pageSetup", openTag: (e) => {
1257
+ } }), h.registerVisitor({ from: "printOptions", to: "printOptions", openTag: (e) => {
1258
+ } }), h.registerVisitor({ from: "mergeCells", to: "merges", openTag: (e) => {
1259
+ e.setSource([]);
1260
+ } }), h.registerVisitor({ from: "mergeCell", to: [], openTag: (e) => {
1261
+ const r = e.getAttribute("ref");
1262
+ e.setSource(r);
1263
+ } }), h.registerVisitor({ from: "hyperlinks", to: "hyperlinks", openTag: (e) => {
1264
+ e.setSource([]);
1265
+ } }), h.registerVisitor({ from: "hyperlink", to: [], openTag: (e) => {
1266
+ const r = e.getAttribute("r:id"), c = e.getAttribute("ref");
1267
+ if (!c) return void console.warn("No ref found for hyperlink");
1268
+ e.setKey(c);
1269
+ let y = r ? X(r) : "";
1270
+ if (typeof y != "string") return void console.warn("Invalid address ", y);
1271
+ const j = e.getAttribute("location");
1272
+ y.endsWith("\\") && (y = y.substring(0, y.length - 1));
1273
+ const Et = e.getAttribute("location");
1274
+ if (Et && (j && j !== Et && console.warn("display and location are different", j, Et), y += "#" + Et), !y) return void console.warn("No address found for hyperlink. r:id", r);
1275
+ let Qt;
1276
+ const oe = e.getAttribute("tooltip");
1277
+ Qt = oe ? { address: y, tooltip: oe } : y, e.setSource({ r: c, v: Qt });
1278
+ } }), h.registerVisitor({ from: "drawing", to: "movables", openTag: (e) => {
1279
+ const r = e.getAttribute("r:id");
1280
+ if (!r) return;
1281
+ const c = X(r);
1282
+ c ? e.setSource(c.movables) : console.warn("no drawing found for rId", r);
1283
+ } }), h.registerVisitor({ from: "tableParts", to: "tables", openTag: (e) => {
1284
+ e.setSource([]);
1285
+ } }), h.registerVisitor({ from: "tablePart", to: [], openTag: (e) => {
1286
+ const r = e.getAttribute("r:id");
1287
+ if (!r) return;
1288
+ const c = X(r);
1289
+ c ? e.setSource(c) : console.warn("no table found for rId", r);
1290
+ } }), h.registerVisitor({ from: "worksheet", to: "worksheet", openTag: (e) => {
1291
+ } }), h.registerVisitor({ from: "sheetProtection", to: "protection", openTag: (e) => {
1292
+ let r = !1;
1293
+ if (e.hasAttribute("sheet") && P(e.getAttribute("sheet")) && (r = !0), !r) return void e.setSource(void 0);
1294
+ const c = (j) => j === !0 || j === "1" || j === "on" || j === "true" || j === !1 || j === "0" || j === "off" || j === "false" || null;
1295
+ e.copyTo("autoFilter", c), e.copyTo("deleteColumns", c), e.copyTo("formatCells", c), e.copyTo("formatColumns", c), e.copyTo("formatRows", c), e.copyTo("insertColumns", c), e.copyTo("insertHyperlinks", c), e.copyTo("insertRows", c), e.copyTo("objects", c), e.copyTo("pivotTables", c), e.copyTo("scenarios", c), e.copyTo("selectUnlockedCells", c), e.copyTo("selectUnlockedCells", c), e.copyTo("sort", c);
1296
+ const y = {};
1297
+ e.copyToObject(y, "hash", O, "hashValue"), e.copyToObject(y, "algorithm", O, "algorithmName"), e.copyToObject(y, "salt", O, "saltValue"), e.copyToObject(y, "spinCount", L), Object.keys(y).length > 0 && (e.getSource().password = y);
1298
+ } }), h.registerVisitor({ from: "protectedRanges", to: "protectedRanges", openTag: (e) => {
1299
+ e.setSource({});
1300
+ } }), h.registerVisitor({ from: "protectedRange", to: {}, openTag: (e) => {
1301
+ const r = e.getAttribute("sqref");
1302
+ e.setKey(r), e.copyTo("name"), e.copyTo("securityDescriptor");
1303
+ const c = {};
1304
+ e.copyToObject(c, "hash", O, "hashValue"), e.copyToObject(c, "algorithm", O, "algorithmName"), e.copyToObject(c, "salt", O, "saltValue"), e.copyToObject(c, "spinCount", L), Object.keys(c).length > 0 && (e.getSource().password = c);
1305
+ } }), h.registerVisitor({ from: "sheetFormatPr", to: "sheetFormatPr", openTag: (e) => {
1306
+ e.copyToObject(k, "defaultColSize", xt, "defaultColWidth"), e.copyToObject(k, "outlineLevelCol", L, "outlineLevelCol");
1307
+ const r = e.getAttribute("customHeight");
1308
+ r !== "1" && r !== "true" || e.copyToObject(k, "defaultRowSize", xt, "defaultRowHeight"), e.copyToObject(k, "outlineLevelRow", L, "outlineLevelRow");
1309
+ } }), h.registerVisitor({ from: "cols", to: "cols", openTag: (e) => {
1310
+ e.setSource([]);
1311
+ } }), h.registerVisitor({ from: "col", to: [], openTag: (e) => {
1312
+ e.copyTo("min", (r) => parseInt(r) - 1), e.copyTo("max", (r) => parseInt(r) - 1), e.copyTo("sz", xt, "width"), e.copyTo("cs", P, "customWidth"), e.copyTo("h", P, "hidden"), e.copyTo("l", L, "outlineLevel"), e.copyTo("s", L, "style");
1313
+ } }), h.registerVisitor({ from: "oleObjects", to: null, openTag: (e) => {
1314
+ e.warn("'OLE Objects' are not supported.");
1315
+ } });
1316
+ let qt = null;
1317
+ const ye = { onOpenTag: (e) => {
1318
+ qt === null && (qt = "");
1319
+ }, onText: (e) => {
1320
+ qt += e;
1321
+ }, onEnd: () => {
1322
+ const e = _t(qt);
1323
+ return qt = null, e;
1324
+ }, onError: (e) => {
1325
+ } };
1326
+ return Je(lt, k, h.createEventHandler(k, () => {
1327
+ }, at), at, ye, kt);
1328
+ })(v, (k, X = !1) => F(k, p, X) ?? null, ht, K, 0, (k) => {
1329
+ o && (k = p + ": " + k, o?.(k));
1330
+ }, W), st = he(p, gt), it = await (async (k, X = 8388608) => {
1331
+ await (async () => {
1332
+ if (typeof ReadableStream > "u") if (typeof window > "u") {
1333
+ const { ReadableStream: at } = await import("./DXapJ5_yR4E8vDaK.mjs");
1334
+ global.ReadableStream = at;
1335
+ } else console.warn("Browser does not support ReadableStream; consider loading a polyfill.");
1336
+ })();
1337
+ const _t = new TextDecoder("utf-8");
1338
+ let ot = 0;
1339
+ const nt = k instanceof Uint8Array ? k : new Uint8Array(k);
1340
+ return new ReadableStream({ pull(at) {
1341
+ if (ot >= nt.byteLength) return void at.close();
1342
+ const kt = nt.subarray(ot, Math.min(ot + X, nt.byteLength)), h = _t.decode(kt, { stream: ot + X < nt.byteLength });
1343
+ at.enqueue(h), ot += kt.length;
1344
+ } }).getReader();
1345
+ })(st);
1346
+ try {
1347
+ await se.parseStream(it, G, { xmlns: !1 });
1348
+ } catch (k) {
1349
+ throw console.warn(`Error parsing sheet: '${p}'`, k), new Error(`Error parsing sheet: '${p}'`, { cause: k });
1350
+ }
1351
+ const Y = ct(p, q);
1352
+ let yt, Wt = /* @__PURE__ */ new Map();
1353
+ if (Y) {
1354
+ const k = "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment";
1355
+ let X;
1356
+ Y.forEach((ot, nt) => {
1357
+ ot.type === k && (yt = F(nt, p, !1, q)?.comments, yt && yt.forEach((at) => {
1358
+ Wt.set(at.id, at);
1359
+ }));
1360
+ });
1361
+ const _t = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
1362
+ if (Y.forEach((ot, nt) => {
1363
+ ot.type === _t && (X = F(nt, p, !1, q));
1364
+ }), X || yt) {
1365
+ const ot = yt ?? [], nt = X?.comments;
1366
+ if (nt) {
1367
+ const at = X?.authors;
1368
+ for (let kt = 0; kt < nt.length; kt++) {
1369
+ const h = nt[kt];
1370
+ let lt = h.authorId !== void 0 ? at[h.authorId] : void 0;
1371
+ if ((!lt || lt.startsWith("tc=")) && (lt = Ue(lt.substring(3)), Wt.has(lt))) continue;
1372
+ let _ = ut.get(lt);
1373
+ _ || (_ = ft.get(lt)), _ || (_ = { id: re.uuidV4(), displayName: lt }, ft.set(_.displayName, _), ut.set(_.id, _)), lt = _?.id ?? null;
1374
+ const Jt = { id: re.uuidV4(), personId: lt, ref: h.ref, done: !1, asNote: !0, content: h.content };
1375
+ ot.push(Jt);
1376
+ }
1377
+ }
1378
+ v.comments = ot;
1379
+ }
1380
+ }
1381
+ };
1382
+ Ft.push(R());
1383
+ } else E = M ? he(p, gt, (v) => {
1384
+ const R = T.add({ buffer: v });
1385
+ return R.addReference(I), H.add(R), m.toResourceId(R);
1386
+ }, $) : ie(p, gt, f, A, $);
1387
+ return E;
1388
+ }, $ = { paramMap: W, getRefs: ct, getRef: F, parsedRefs: Z, onWarning: o, addPerson: (D) => null }, et = [];
1389
+ let vt = 0;
1390
+ u.Strings && (vt = parseInt(u.Strings.Unique ?? u.Strings.length ?? 0));
1391
+ const Xt = u.Strings ?? [];
1392
+ for (let D = 0; D < vt; D++) et.push(Xt[D]?.t ?? "");
1393
+ const Lt = /* @__PURE__ */ new Map();
1394
+ let Bt = vt;
1395
+ const ht = (D) => {
1396
+ const U = Lt.get(D);
1397
+ if (U !== void 0) return U;
1398
+ const M = Bt;
1399
+ return Lt.set(D, Bt++), et.push(D), M;
1400
+ }, ut = ($t("richstructure", u, f, A, $), $t("richdata", u, f, A, $), /* @__PURE__ */ new Map()), ft = /* @__PURE__ */ new Map(), mt = $t("people", u, f, A);
1401
+ let J = null;
1402
+ if (mt.size > 0 && (J = mt.entries().next()?.value?.[1]?.persons, J)) {
1403
+ const D = J.length;
1404
+ for (let U = 0; U < D; U++) {
1405
+ const M = J[U];
1406
+ ut.set(M.id, M), ut.set(M.displayName, M);
1407
+ }
1408
+ }
1409
+ const dt = $t("themes", u, f, A, $);
1410
+ let Tt = null;
1411
+ if (dt && dt.entries) {
1412
+ let D = dt.entries().next();
1413
+ D?.value?.[1] && (Tt = D.value[1]);
1414
+ }
1415
+ const St = new we(Tt);
1416
+ let Dt = $t("styles", u, f, A, $).entries().next()?.value[1];
1417
+ Dt && (Dt = JSON.parse(ve(Dt)));
1418
+ const Ut = $t("workbooks", u, f, A, $);
1419
+ await Promise.all(Ft);
1420
+ const Nt = { ...Ut.entries().next().value[1], styles: Dt, theme: St.toJSON() };
1421
+ et.length > 0 && (Nt.strings = et), J && J.length > 0 && (Nt.people = J);
1422
+ const Gt = { ...n, resources: T, json: Nt }, Zt = new Se(Gt);
1423
+ return H.forEach((D) => {
1424
+ D.deleteReference(I);
1425
+ }), m.endPersist(), Zt;
1426
+ } catch (u) {
1427
+ let A = "Unable to parse XLSX.";
1428
+ throw u instanceof Ae && (A = "Unable to open XLSX. There are too many rows or columns."), new Error(A, { cause: u });
1429
+ }
1430
+ }, toBufferXLSX: async (i, t) => {
1431
+ const s = await import("./BGTcOBCyrTTlov_i.mjs"), o = await i.toJSON(!0), n = s.utils.book_new();
1432
+ for (let a = 0; a < o.sheets.length; a++) {
1433
+ const l = o.sheets[a], g = s.utils.json_to_sheet([{}]);
1434
+ s.utils.book_append_sheet(n, g, l.name);
1435
+ const S = l.sheet, b = i.getSheetAt(a), x = b.getUsedRange();
1436
+ if (x ? (g["!ref"] = x.getA1(), x.forEach((C, w) => {
1437
+ const u = { t: "z" }, A = w.getCell().getStyle();
1438
+ if (!A.isNormal()) {
1439
+ let f = A.getNumberFormat();
1440
+ f !== Pt.Type.General && (f === Pt.Type.ShortDate ? f = "m/d/yyyy" : f === Pt.Type.MediumDate ? f = "d-mmm-yy" : f === Pt.Type.LongDate ? f = "[$-x-sysdate]dddd, mmmm dd, yyyy" : f === Pt.Type.ShortTime ? f = "h:mm" : f === Pt.Type.MediumTime ? f = "h:mm AM/PM" : f === Pt.Type.LongTime && (f = "h:mm:ss AM/PM"), u.z = f);
1441
+ }
1442
+ if (C !== null) switch (w.getType()) {
1443
+ case Vt.Number:
1444
+ u.t = "n", u.v = C;
1445
+ break;
1446
+ case Vt.String:
1447
+ u.t = "s", u.v = C;
1448
+ break;
1449
+ case Vt.Boolean:
1450
+ u.t = "b", u.v = C;
1451
+ break;
1452
+ case Vt.Error:
1453
+ u.t = "e", u.v = C.toString();
1454
+ case Vt.RichData:
1455
+ }
1456
+ g[w.getA1()] = u;
1457
+ })) : g["!ref"] = "A1:A1", S.merges?.length > 0) {
1458
+ const C = [];
1459
+ g["!merges"] = C;
1460
+ for (let w = 0; w < S.merges.length; w++) C.push(s.utils.decode_range(S.merges[w]));
1461
+ }
1462
+ if (S.cols?.length > 0) {
1463
+ const C = [];
1464
+ g["!cols"] = C;
1465
+ const w = S.cols, u = { width: S.defaultColSize ?? b.getColumnWidthAsFontUnit(b.getColumnHeaders().getDefaultSize()) };
1466
+ for (let A = 0; A < w.length; A++) {
1467
+ const f = w[A];
1468
+ for (let m = C.length; m <= f.min - 1; m++) C.push(u);
1469
+ const T = {};
1470
+ f.sz !== void 0 && (T.width = f.sz), f.h !== void 0 && (T.hidden = f.h), f.l !== void 0 && (T.level = f.l);
1471
+ for (let m = f.min; m <= f.max; m++) C.push(T);
1472
+ }
1473
+ }
1474
+ }
1475
+ return s.write(n, { type: "array", bookType: "xlsx" }), s.write(n, { type: "array", bookType: "xlsx" });
1476
+ } }, Symbol.toStringTag, { value: "Module" }));
1477
+ export {
1478
+ ts as a,
1479
+ Ge as b,
1480
+ Ye as c,
1481
+ ue as d,
1482
+ ss as i,
1483
+ es as p,
1484
+ Ue as r,
1485
+ Ke as t
1486
+ };