@sheetxl/studio-vanilla 0.4.12 → 0.4.13

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 (209) hide show
  1. package/browser/cjs/{BwN8vKi5o3-PbIMo.cjs → -DkdmW3XP1ICRY25.cjs} +2 -2
  2. package/browser/cjs/B-KQs1Bf48nEucW7.cjs +7 -0
  3. package/browser/cjs/B1xnY7pDnbnNzknG.cjs +7 -0
  4. package/browser/cjs/B6A5w_aWHkigBc6j.cjs +7 -0
  5. package/browser/cjs/B9jxuOg1CXcmbi9J.cjs +110 -0
  6. package/browser/cjs/BAYjkr4LmsWRLoPr.cjs +7 -0
  7. package/browser/cjs/{Q_VvA-yUQx3xFKiJ.cjs → BG2uV2RpxrfZyCuV.cjs} +1 -1
  8. package/browser/cjs/{BPzEQNENF-gEBkg9.cjs → BGCPG4Ip5ZijUQwi.cjs} +2 -2
  9. package/browser/cjs/BHTlBOQH-tPGoKgo.cjs +7 -0
  10. package/browser/cjs/BLBNzBvRVl9VLynf.cjs +7 -0
  11. package/browser/cjs/BLh6E7ER8mrM6vc_.cjs +7 -0
  12. package/browser/cjs/{hwDUzorB6aCvH1eL.cjs → BMaq_2S3IFrE5XeJ.cjs} +1 -1
  13. package/browser/cjs/BO7Pbclmywy-QCSV.cjs +13 -0
  14. package/browser/cjs/BPlthbyKkqCDjgxO.cjs +7 -0
  15. package/browser/cjs/BUGo0mXtBfFOmQXV.cjs +7 -0
  16. package/browser/cjs/BdHdXCz_K1djQgI4.cjs +7 -0
  17. package/browser/cjs/BfNkb1jDZkJf3wRA.cjs +7 -0
  18. package/browser/cjs/BfdQd2UEOlOc5iF3.cjs +7 -0
  19. package/browser/cjs/Bi9KvObgq_kJ_pjC.cjs +7 -0
  20. package/browser/cjs/BjPpJjnABDd3_WOZ.cjs +7 -0
  21. package/browser/cjs/BsSNzyN8kOGCKzso.cjs +7 -0
  22. package/browser/cjs/BtCcoaKKb8ZDnliG.cjs +7 -0
  23. package/browser/cjs/{Ccs2ouvlLekaLGH0.cjs → BwHquG4sSd7OJjxz.cjs} +2 -2
  24. package/browser/cjs/{D_VQzwC1zzTJyKtG.cjs → BywNBbTVRYbgRbNI.cjs} +1 -1
  25. package/browser/cjs/C04Qr5P8uyQ6Vcml.cjs +7 -0
  26. package/browser/cjs/C42ZEPRmW9Wcd7tI.cjs +7 -0
  27. package/browser/cjs/{BeZHmOKfa37mFNAu.cjs → CBpt1PBR1VfBegko.cjs} +2 -2
  28. package/browser/cjs/CED8Az5C8GWF7pUT.cjs +7 -0
  29. package/browser/cjs/{JKEGlXjMwGnXk_Gv.cjs → CbD4Wa5QLTdRCYcz.cjs} +2 -2
  30. package/browser/cjs/{L1iE_VcelYZIy0wI.cjs → CbILz9Skl6lWf6yR.cjs} +1 -1
  31. package/browser/cjs/CoFQQqIzuvS9PM77.cjs +7 -0
  32. package/browser/cjs/{B35OZ0mE8aINQPP9.cjs → CpDNo2Lhwr5ZHECs.cjs} +2 -2
  33. package/browser/cjs/{C3OizZPVuxO2fjSG.cjs → CsamfGfFsItvSgo_.cjs} +1 -1
  34. package/browser/cjs/Cx3kn5gBsQ-1bORi.cjs +7 -0
  35. package/browser/cjs/CxLvGnG44-qNI36G.cjs +7 -0
  36. package/browser/cjs/D-xyWit7jxctQCpR.cjs +7 -0
  37. package/browser/cjs/D4XQsK7d7DRctaOO.cjs +7 -0
  38. package/browser/cjs/D9rVEA1BdB0JZwhE.cjs +7 -0
  39. package/browser/cjs/DES2NmIRVZg-HXgs.cjs +7 -0
  40. package/browser/cjs/{CBL6KkiWI2RPflEN.cjs → DFxeLNhACFIHb0nv.cjs} +2 -2
  41. package/browser/cjs/DIv1SrLYeyVwcaxE.cjs +7 -0
  42. package/browser/cjs/DJ6L43osbaMzEV5K.cjs +7 -0
  43. package/browser/cjs/DMjLN_HDktNzzUB8.cjs +7 -0
  44. package/browser/cjs/DVPfPZCFjmYu3xyn.cjs +7 -0
  45. package/browser/cjs/DhSlaiQXxEOVtZkA.cjs +7 -0
  46. package/browser/cjs/{DAHpsyykuPBkoh-Z.cjs → Dh_dFnagz7dMZlGh.cjs} +1 -1
  47. package/browser/cjs/DpF6vgGka2d-RKkb.cjs +10 -0
  48. package/browser/cjs/{BUokV6yuzE-_8MyK.cjs → DtY0Jzlwnr_YKnV4.cjs} +2 -2
  49. package/browser/cjs/DwyyFI1Ix0uc0Qoz.cjs +7 -0
  50. package/browser/cjs/Dy5_viRzFls9rOzN.cjs +7 -0
  51. package/browser/cjs/GkINjQ8Te3GKi2mx.cjs +7 -0
  52. package/browser/cjs/aN3KCqswA1SdJIMq.cjs +7 -0
  53. package/browser/cjs/{no5c2H18QD2qmOH6.cjs → hLJbgylpETByV4wc.cjs} +2 -2
  54. package/browser/cjs/index.cjs +2 -2
  55. package/browser/cjs/qumqKlVHFx89iLeu.cjs +7 -0
  56. package/browser/cjs/{fTGpiXzFm3K_u2Fm.cjs → rKZjTYQ0WpTriIv6.cjs} +2 -2
  57. package/browser/cjs/xjKotAOVt3JH36U7.cjs +7 -0
  58. package/browser/cjs/ymbPxio09Fw7I2BW.cjs +7 -0
  59. package/browser/esm/2P5dQT7wZToOh-n9.mjs +7 -0
  60. package/browser/esm/4GgcUVhUmQmiv9Ha.mjs +110 -0
  61. package/browser/esm/7_x68v6PpvRDox_Z.mjs +7 -0
  62. package/browser/esm/9icgSuuzXq6mlgM8.mjs +7 -0
  63. package/browser/esm/B354iAatN9y9AIIP.mjs +7 -0
  64. package/browser/esm/B5EVyoxm3aSlAnxN.mjs +7 -0
  65. package/browser/esm/BD8rE7MUxuHXsdcf.mjs +7 -0
  66. package/browser/esm/BGFWI1a1PmU8_hCE.mjs +7 -0
  67. package/browser/esm/{Bts4nCgfCAUpTfxz.mjs → BI6JAQCQx1V0F2aC.mjs} +2 -2
  68. package/browser/esm/BIYg30d_9HaluFFz.mjs +7 -0
  69. package/browser/esm/{SAyRTPVprOHZ8Up8.mjs → BKL-uyBp_OE47lXd.mjs} +2 -2
  70. package/browser/esm/BMwJCtLAYUW8wExX.mjs +13 -0
  71. package/browser/esm/BNOfK-lGWF2S8vQE.mjs +7 -0
  72. package/browser/esm/Ba433v6lQUMtECiY.mjs +7 -0
  73. package/browser/esm/BbZWfDW2LUyjqUDy.mjs +7 -0
  74. package/browser/esm/C238uBmZN1XXqMUb.mjs +7 -0
  75. package/browser/esm/C34whwRkHO0lhq4-.mjs +7 -0
  76. package/browser/esm/C6FEpAqSZoW5Hgte.mjs +7 -0
  77. package/browser/esm/COlW5ULL29SUKN1Z.mjs +7 -0
  78. package/browser/esm/CRyxOj2xPj9qe9LK.mjs +7 -0
  79. package/browser/esm/CVeyOpbAhaBhDRye.mjs +7 -0
  80. package/browser/esm/CVyVvtlJuCTn4MDh.mjs +7 -0
  81. package/browser/esm/CapeIfjWq-_BHMlE.mjs +7 -0
  82. package/browser/esm/CcQqGNgK2CsgNtuD.mjs +7 -0
  83. package/browser/esm/CdZSxrk3k1Lx6G8W.mjs +7 -0
  84. package/browser/esm/CdchvB_wAbv_6Whw.mjs +7 -0
  85. package/browser/esm/{D3KNxvnrwR6_fTJE.mjs → Cf8eDl3Tu5NAWWwG.mjs} +1 -1
  86. package/browser/esm/{B8ISUdOxsJMYWzNN.mjs → Cfq9tttQlsKvfaCr.mjs} +2 -2
  87. package/browser/esm/{M4hZ25330e96seUM.mjs → ClR6uLJoM-xKVYEc.mjs} +1 -1
  88. package/browser/esm/Cnl_e-EYkZ3CLbi2.mjs +7 -0
  89. package/browser/esm/CtRS2ZCPF7IH_mXe.mjs +7 -0
  90. package/browser/esm/{DeXfOSxGE_Ez7DZq.mjs → CuV-bwi1vcXAqFUY.mjs} +1 -1
  91. package/browser/esm/CwVE0qelO_xgf-l1.mjs +7 -0
  92. package/browser/esm/{CYIhGb86r-kKOrP5.mjs → D1Dzlta8ZVy08ng6.mjs} +2 -2
  93. package/browser/esm/D1TjRQiHLWhpl-dl.mjs +7 -0
  94. package/browser/esm/D8BJ-y3ulgO_ezrj.mjs +10 -0
  95. package/browser/esm/{dpdy0BU4GGI5lZrX.mjs → DTDXNEbHVnnZONNL.mjs} +1 -1
  96. package/browser/esm/DTWfi8Dl-c2s5moT.mjs +7 -0
  97. package/browser/esm/DYVBXcu1r5KRLB-1.mjs +7 -0
  98. package/browser/esm/{BnJiF38TGudjoHzT.mjs → DZjWyWMvr2XHQrBg.mjs} +1 -1
  99. package/browser/esm/DhHK4QmASvgAq9Xy.mjs +7 -0
  100. package/browser/esm/{DcX8yGEBX6qi9RCe.mjs → DoFV2S6Su86IN5Ul.mjs} +2 -2
  101. package/browser/esm/Dq3ybkgattcCsF_4.mjs +7 -0
  102. package/browser/esm/DqWoZ4TjweoJWX3o.mjs +7 -0
  103. package/browser/esm/DtXxHirBm16ldE1l.mjs +7 -0
  104. package/browser/esm/DtuWZG6c_8vKRSdr.mjs +7 -0
  105. package/browser/esm/FBG8XXdIMd9PfUIo.mjs +7 -0
  106. package/browser/esm/Nh7JiwvF01PblHQ0.mjs +7 -0
  107. package/browser/esm/PVYiH9vBQM6rqXI4.mjs +7 -0
  108. package/browser/esm/U5-LDZQ0qkJ2Y-p8.mjs +7 -0
  109. package/browser/esm/XhQDWZu47oe6bwHh.mjs +7 -0
  110. package/browser/esm/_BjU6TtI-mQfFpfy.mjs +7 -0
  111. package/browser/esm/{DzgM_rkwyIHsCb6I.mjs → gOUfyCw957TzcbNB.mjs} +1 -1
  112. package/browser/esm/index.mjs +2 -2
  113. package/browser/esm/lmkbfs9sNc7f0oe5.mjs +7 -0
  114. package/browser/esm/{oLCocGFRAwsVsOSE.mjs → naa0kcRwxHEYGaQB.mjs} +2 -2
  115. package/browser/esm/qxOkQutRxmAi1vRh.mjs +7 -0
  116. package/browser/esm/tMSro0g2GM5BBTIH.mjs +7 -0
  117. package/cdn/assets/{B3kbBB6oxKBErwzn.js → 0e9wDKSn4SFxSmP5.js} +3 -3
  118. package/cdn/assets/0j_nQmV1Bb0lJ6sB.js +472 -0
  119. package/cdn/assets/2mxiQm6dELsqQoX7.js +5624 -0
  120. package/cdn/assets/5XdpCWQ6AcxZ6oY1.js +10 -0
  121. package/cdn/assets/6JtXguBKwGj6dqfy.js +1577 -0
  122. package/cdn/assets/{Bv0Xb6DdcQbPYJKo.js → 8U2WVdbZHYCBnd9L.js} +13 -14
  123. package/cdn/assets/9-cIcj6CRJx5HTn9.js +10 -0
  124. package/cdn/assets/{BcWoqhD_sX85c7Mh.js → B-kFRtzNNkf4_SiP.js} +1 -1
  125. package/cdn/assets/B1Iys8a964LGNZKf.js +10 -0
  126. package/cdn/assets/B2RAJJJFkcaWUfUW.js +21 -0
  127. package/cdn/assets/{DBL4jY0AVc53RGNm.js → BAzGoI9gE2G3F3on.js} +1 -1
  128. package/cdn/assets/BBJxLS-wB_nXRnI2.js +10 -0
  129. package/cdn/assets/{qA23x9VVBL9R4qxN.js → BDE7FUo2oiivrvBL.js} +14 -14
  130. package/cdn/assets/BL6TUDSeou6wPejW.js +10 -0
  131. package/cdn/assets/{CC-S4NMYhLg3WgqO.js → BLqaorJ5Wl-1YOoy.js} +2 -2
  132. package/cdn/assets/BMiA9p1uOrwnooVT.js +10 -0
  133. package/cdn/assets/{BoOefjrM4kZ-YXxa.js → BNh9nSR83reiVMKt.js} +2 -2
  134. package/cdn/assets/{BtweFYnoj_aEfydW.js → BQON-ToGsIBPrPkM.js} +1 -1
  135. package/cdn/assets/BUwNyHytF9St68tJ.js +10 -0
  136. package/cdn/assets/{D_5RgqgwXsoqLJDR.js → BVYDmdUGWvMG5gNK.js} +1 -1
  137. package/cdn/assets/B_2bXmyji3Dr7LRM.js +50224 -0
  138. package/cdn/assets/BciokME96sykArSM.js +10 -0
  139. package/cdn/assets/BgnlshX157Ob6RLs.js +21 -0
  140. package/cdn/assets/{dk2teWHDODYNarJY.js → BlYoycYtR-sUp0iC.js} +3 -3
  141. package/cdn/assets/{DfmaL8DmDaFAv8M_.js → Bsa9-Itkf_SdDBM9.js} +4 -4
  142. package/cdn/assets/BwpBFv8Ks2ka07ch.js +10 -0
  143. package/cdn/assets/BxblmHGC7YxZcuak.js +10 -0
  144. package/cdn/assets/C-Z8wvIy20kJ7R-k.js +10 -0
  145. package/cdn/assets/C3EFzvmp0DcC_HAx.js +10 -0
  146. package/cdn/assets/C4vStn7wNlvrxdsp.js +10 -0
  147. package/cdn/assets/C5q0qaKi2eeDgoO8.js +10 -0
  148. package/cdn/assets/C9eQW5GKgPRmKKgJ.js +29 -0
  149. package/cdn/assets/{BCK7yhx9JfzU2rF0.js → CHTspRZD2v_dU_eV.js} +9 -9
  150. package/cdn/assets/CKA4s2hlzSnrdWSD.js +10 -0
  151. package/cdn/assets/{BSAH88RG1oubICau.js → CMBDD1Mjde6UL5ep.js} +19 -19
  152. package/cdn/assets/{DDW1WJ2IM_9ZUfKm.js → CR01MBraUPYPpwy4.js} +2 -2
  153. package/cdn/assets/CT0d1P-Aav62lUvV.js +10 -0
  154. package/cdn/assets/CV8UjJPDVplXjK1E.js +49 -0
  155. package/cdn/assets/CrLrvmlJhYpNpXqR.js +10 -0
  156. package/cdn/assets/CsorxCiOoe7qX9j1.js +10 -0
  157. package/cdn/assets/CuNqTH3P8mCglRiz.js +10 -0
  158. package/cdn/assets/{MRBi3juXAW0lA_mj.js → CwdMjMPFdIs8SAV0.js} +1 -1
  159. package/cdn/assets/D-5VYBO5_VEh6fEW.js +24 -0
  160. package/cdn/assets/{BT5EcMEFBsphczwC.js → DD3csu4pddGtMp3n.js} +106 -107
  161. package/cdn/assets/{DWJE3K3jMKMTCi3o.js → DFHruAftzuzBZ71r.js} +2 -2
  162. package/cdn/assets/DHydjLSnijEgtpyU.js +10 -0
  163. package/cdn/assets/DPQqTIMsRLhMxPIy.js +820 -0
  164. package/cdn/assets/{CUc6gRjjRGTFWSHD.js → DUtu7r6CzW4dtW3E.js} +12 -12
  165. package/cdn/assets/{CiY3HumGDc_5bMtR.js → DXHirQMr483hJBil.js} +15 -15
  166. package/cdn/assets/DXtbonLk2ESfF4Dh.js +10 -0
  167. package/cdn/assets/{CsjftXmSYQRHNKdq.js → Dr5X-ng9wbwUWVr4.js} +4 -4
  168. package/cdn/assets/{BB66NDz7S3ocEfRB.js → DvFNLgeMJ9LdQROu.js} +46 -47
  169. package/cdn/assets/Dvj7UEckqOBrgs9i.js +3947 -0
  170. package/cdn/assets/F6zW9Vj410C4yRVG.js +424 -0
  171. package/cdn/assets/{DJQOS9qxVAlpgDMt.js → Gz4u4ewyWfB-Pf-a.js} +20 -21
  172. package/cdn/assets/KDGtuIzSpkf1vsmH.js +10 -0
  173. package/cdn/assets/KtKlo5mM4kTTfFgi.js +46 -0
  174. package/cdn/assets/N3pWBoccPrTedAw-.js +12 -0
  175. package/cdn/assets/{7_O6nILzn1fSVvkO.js → NTINjW8JjyZudT8s.js} +1 -1
  176. package/cdn/assets/{DxMu6URURFWj9aXM.js → R9RwlorPWfftoboH.js} +4 -4
  177. package/cdn/assets/{DgLPO_EQ9DYoGgec.js → Xwyp21e7L5fTeb_y.js} +1 -1
  178. package/cdn/assets/{CfObTzh8pGdd8D23.js → XysyS9rk9tFdbzZh.js} +5 -5
  179. package/cdn/assets/{DkS6quwH1okWaho6.js → f3_QXO8z0p-q4nJo.js} +14 -14
  180. package/cdn/assets/{phYz0vGgqIEQ2hco.js → quOP5QFyTT9soNIl.js} +1 -1
  181. package/cdn/index.js +2 -2
  182. package/cdn/loader.js +1 -1
  183. package/package.json +3 -5
  184. package/browser/cjs/BflJ_0gT9lQtDvY_.cjs +0 -7
  185. package/browser/cjs/CN6-6xpZMpFqSS8M.cjs +0 -7
  186. package/browser/cjs/CTrEV_UpxC0W6cZZ.cjs +0 -7
  187. package/browser/cjs/CU30GVjjFXl44vEU.cjs +0 -7
  188. package/browser/cjs/CZWBxvUXzfpn_zmc.cjs +0 -7
  189. package/browser/cjs/Ce-8L4Viq3I_6j0i.cjs +0 -7
  190. package/browser/cjs/CtNjLzIHB8WX63Bl.cjs +0 -7
  191. package/browser/cjs/DJbKKxeeTEHHA1gR.cjs +0 -107
  192. package/browser/cjs/GrsZZ_mEdsM5dEMA.cjs +0 -7
  193. package/browser/esm/B4Mm5gczpI_k2zzN.mjs +0 -7
  194. package/browser/esm/C3cyAbIH8Qc8MIFN.mjs +0 -107
  195. package/browser/esm/C4jlaVv8bELgiHyE.mjs +0 -7
  196. package/browser/esm/CcpskguvlvemArQn.mjs +0 -7
  197. package/browser/esm/CeRfALx1iU5fqOUg.mjs +0 -7
  198. package/browser/esm/CfYWmP_Hots5f0f6.mjs +0 -7
  199. package/browser/esm/CkarbqNx_lhlBnw7.mjs +0 -7
  200. package/browser/esm/D2PlWNQjrTgf6GuR.mjs +0 -7
  201. package/browser/esm/DIJyH94oCzUnlcNZ.mjs +0 -7
  202. package/browser/esm/DVAG1NxFe3cMjLE1.mjs +0 -7
  203. package/browser/esm/DVqga7g7j0FUiM6p.mjs +0 -7
  204. package/browser/esm/Qp2Toeh_EbJH_f_6.mjs +0 -7
  205. package/browser/esm/_ft7JYO6QdDbIu3d.mjs +0 -7
  206. package/cdn/assets/CJhyHcQcrhbtC33r.js +0 -50
  207. package/cdn/assets/CpPLN0-hDsTIFHZV.js +0 -46
  208. package/cdn/assets/Cq94woVmlxhjWVRI.js +0 -21
  209. package/cdn/assets/Jhm2DAcrfAqiM-Y-.js +0 -26490
@@ -0,0 +1,1577 @@
1
+ /**
2
+ * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.13
3
+ *
4
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
+ * License: The license can be found at https://www.sheetxl.com/license.
6
+ */
7
+ let c = class {
8
+ constructor(e) {
9
+ this._worker = null, this._nextId = 1, this._pendingRequests = /* @__PURE__ */ new Map(), this._workerFactory = e;
10
+ }
11
+ start() {
12
+ if (typeof Worker > "u") throw new Error("Web Workers are not supported in this environment.");
13
+ return this._worker || (this._worker = this._workerFactory(), this._worker.onmessage = (e) => {
14
+ const { id: n, result: t, error: r } = e.data, o = this._pendingRequests.get(n);
15
+ if (o) if (this._pendingRequests.delete(n), r) {
16
+ const i = new Error(r.message);
17
+ i.stack = r.stack, r.cause && (i.cause = r.cause), o.reject(i);
18
+ } else o.resolve(t);
19
+ }, this._worker.onerror = (e) => {
20
+ console.error("Worker error:", e), this._pendingRequests.forEach((n) => {
21
+ n.reject(new Error(`Worker failed: ${e.message}`));
22
+ }), this._pendingRequests.clear(), this._worker = null;
23
+ }), Promise.resolve();
24
+ }
25
+ execute(e) {
26
+ if (!this._worker) throw new Error("Worker is not initialized. Call start() first.");
27
+ const n = this._nextId++;
28
+ return new Promise((t, r) => {
29
+ this._pendingRequests.set(n, { resolve: t, reject: r }), this._worker.postMessage({ id: n, params: e });
30
+ });
31
+ }
32
+ terminate() {
33
+ this._worker && (this._worker.terminate(), this._worker = null);
34
+ }
35
+ };
36
+ class u {
37
+ constructor(n) {
38
+ this._onExecute = n;
39
+ }
40
+ execute(n) {
41
+ return this._onExecute(n);
42
+ }
43
+ start() {
44
+ return Promise.resolve();
45
+ }
46
+ terminate() {
47
+ }
48
+ }
49
+ const s = `/**
50
+ * @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.4.13
51
+ *
52
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
53
+ * License: The license can be found at https://www.sheetxl.com/license.
54
+ */
55
+ const W = { Number: "n", String: "s", Boolean: "b", Error: "e", Null: "z" };
56
+ var Re, ae, d;
57
+ (ae = Re || (Re = {})).Orientation = { Column: "column", Row: "row" }, ae.Orientations = { ...ae.Orientation, Both: "both" }, ae.Direction = { Up: "up", Down: "down", Left: "left", Right: "right" }, ((e) => {
58
+ e.Code = { Parse: 0, Null: 1, Div0: 2, Value: 3, Ref: 4, Name: 5, Num: 6, NA: 7, GettingData: 8, Spill: 9, Connect: 10, Blocked: 11, Unknown: 12, Field: 13, Calc: 14, Busy: 16, Python: 19, Timeout: 20 }, e.Label = { Parse: "#PARSE!", Null: "#NULL!", Div0: "#DIV/0!", Value: "#VALUE!", Ref: "#REF!", Name: "#NAME?", Num: "#NUM!", NA: "#N/A", GettingData: "#GETTING_DATA", Spill: "#SPILL!", Connect: "#CONNECT!", Blocked: "#BLOCKED!", Unknown: "#UNKNOWN!", Field: "#FIELD!", Calc: "#CALC!", Busy: "#BUSY!", Python: "#PYTHON!", Timeout: "#TIMEOUT!" };
59
+ class t extends Error {
60
+ constructor(c, m, fe, B) {
61
+ super(fe, B), this._label = m, this._code = c, this.details = B;
62
+ }
63
+ static {
64
+ this.code = e.Code.Unknown;
65
+ }
66
+ get isFormulaError() {
67
+ return !0;
68
+ }
69
+ getLabel() {
70
+ return this._label;
71
+ }
72
+ getCode() {
73
+ return this._code;
74
+ }
75
+ equals(c) {
76
+ return !!c && (this._code === c._code || this._code === c.code);
77
+ }
78
+ get [Symbol.toStringTag]() {
79
+ return "[FormulaError]";
80
+ }
81
+ toString() {
82
+ return this.message || this._label;
83
+ }
84
+ }
85
+ e.Known = t;
86
+ class n extends t {
87
+ constructor(c, m) {
88
+ super(e.Code.Parse, e.Label.Parse, c, m);
89
+ }
90
+ static {
91
+ this.code = e.Code.Parse;
92
+ }
93
+ getDetails() {
94
+ const c = this.details;
95
+ return { line: c?.line ?? 1, column: c?.column ?? 1, offset: c?.offset ?? 0, length: c?.length ?? 0 };
96
+ }
97
+ }
98
+ e.Parse = n;
99
+ class r extends t {
100
+ constructor(c, m) {
101
+ super(e.Code.Null, e.Label.Null, c, m);
102
+ }
103
+ static {
104
+ this.code = e.Code.Null;
105
+ }
106
+ }
107
+ e.Null = r;
108
+ class o extends t {
109
+ constructor(c, m) {
110
+ super(e.Code.Div0, e.Label.Div0, c, m);
111
+ }
112
+ static {
113
+ this.code = e.Code.Div0;
114
+ }
115
+ }
116
+ e.Div0 = o;
117
+ class i extends t {
118
+ constructor(c, m) {
119
+ super(e.Code.Value, e.Label.Value, c, m);
120
+ }
121
+ static {
122
+ this.code = e.Code.Value;
123
+ }
124
+ }
125
+ e.Value = i;
126
+ class a extends t {
127
+ constructor(c, m) {
128
+ super(e.Code.Ref, e.Label.Ref, c, m);
129
+ }
130
+ static {
131
+ this.code = e.Code.Ref;
132
+ }
133
+ }
134
+ e.Ref = a;
135
+ class l extends t {
136
+ constructor(c, m) {
137
+ super(e.Code.Name, e.Label.Name, c, m);
138
+ }
139
+ static {
140
+ this.code = e.Code.Name;
141
+ }
142
+ }
143
+ e.Name = l;
144
+ class u extends t {
145
+ constructor(c, m) {
146
+ super(e.Code.Num, e.Label.Num, c, m);
147
+ }
148
+ static {
149
+ this.code = e.Code.Num;
150
+ }
151
+ }
152
+ e.Num = u;
153
+ class f extends t {
154
+ constructor(c, m) {
155
+ super(e.Code.NA, e.Label.NA, c, m);
156
+ }
157
+ static {
158
+ this.code = e.Code.NA;
159
+ }
160
+ }
161
+ e.NA = f;
162
+ class h extends t {
163
+ constructor(c, m) {
164
+ super(e.Code.GettingData, e.Label.GettingData, c, m);
165
+ }
166
+ static {
167
+ this.code = e.Code.GettingData;
168
+ }
169
+ }
170
+ e.GettingData = h;
171
+ class g extends t {
172
+ constructor(c, m) {
173
+ super(e.Code.Spill, e.Label.Spill, c, m);
174
+ }
175
+ static {
176
+ this.code = e.Code.Spill;
177
+ }
178
+ }
179
+ e.Spill = g;
180
+ class p extends t {
181
+ constructor(c, m) {
182
+ super(e.Code.Connect, e.Label.Connect, c, m);
183
+ }
184
+ static {
185
+ this.code = e.Code.Connect;
186
+ }
187
+ }
188
+ e.Connect = p;
189
+ class y extends t {
190
+ constructor(c, m) {
191
+ super(e.Code.Blocked, e.Label.Blocked, c, m);
192
+ }
193
+ static {
194
+ this.code = e.Code.Blocked;
195
+ }
196
+ }
197
+ e.Blocked = y;
198
+ class T extends t {
199
+ constructor(c, m) {
200
+ super(e.Code.Unknown, e.Label.Unknown, c, m);
201
+ }
202
+ static {
203
+ this.code = e.Code.Unknown;
204
+ }
205
+ }
206
+ e.Unknown = T;
207
+ class A extends t {
208
+ constructor(c, m) {
209
+ super(e.Code.Field, e.Label.Field, c, m);
210
+ }
211
+ static {
212
+ this.code = e.Code.Field;
213
+ }
214
+ }
215
+ e.Field = A;
216
+ class D extends t {
217
+ constructor(c, m) {
218
+ super(e.Code.Calc, e.Label.Calc, c, m);
219
+ }
220
+ static {
221
+ this.code = e.Code.Calc;
222
+ }
223
+ }
224
+ e.Calc = D;
225
+ class U extends t {
226
+ constructor(c, m) {
227
+ super(e.Code.Busy, e.Label.Busy, c, m);
228
+ }
229
+ static {
230
+ this.code = e.Code.Busy;
231
+ }
232
+ }
233
+ e.Busy = U;
234
+ class I extends t {
235
+ constructor(c, m) {
236
+ super(e.Code.Python, e.Label.Python, c, m);
237
+ }
238
+ static {
239
+ this.code = e.Code.Python;
240
+ }
241
+ }
242
+ e.Python = I;
243
+ class J extends t {
244
+ constructor(c, m) {
245
+ super(e.Code.Timeout, e.Label.Timeout, c, m);
246
+ }
247
+ static {
248
+ this.code = e.Code.Timeout;
249
+ }
250
+ }
251
+ e.Timeout = J;
252
+ })(d || (d = {}));
253
+ const _ = {};
254
+ _[d.Code.Parse] = d.Parse, _[d.Code.Null] = d.Null, _[d.Code.Div0] = d.Div0, _[d.Code.Value] = d.Value, _[d.Code.Ref] = d.Ref, _[d.Code.Name] = d.Name, _[d.Code.Num] = d.Num, _[d.Code.NA] = d.NA, _[d.Code.GettingData] = d.GettingData, _[d.Code.Spill] = d.Spill, _[d.Code.Connect] = d.Connect, _[d.Code.Blocked] = d.Blocked, _[d.Code.Unknown] = d.Unknown, _[d.Code.Field] = d.Field, _[d.Code.Calc] = d.Calc, _[d.Code.Busy] = d.Busy, _[d.Code.Python] = d.Python, _[d.Code.Timeout] = d.Timeout;
255
+ const et = /* @__PURE__ */ new Map(), Te = /* @__PURE__ */ new Map(), tt = /* @__PURE__ */ new Map(), nt = /* @__PURE__ */ new Map(), ke = Object.keys(_);
256
+ for (let e = 0; e < ke.length; e++) {
257
+ const t = ke[e], n = _[t];
258
+ tt.set(d.Label[t], n), nt.set(d.Code[t], n);
259
+ const r = new n();
260
+ et.set(r.getLabel(), r), Te.set(r.getCode(), r);
261
+ }
262
+ const Et = Te.get(d.Code.Unknown);
263
+ var v;
264
+ (v = d || (d = {})).BuiltIn = { Parse: new v.Parse(), Null: new v.Null(), Div0: new v.Div0(), Value: new v.Value(), Ref: new v.Ref(), Name: new v.Name(), Num: new v.Num(), NA: new v.NA(), GettingData: new v.GettingData(), Spill: new v.Spill(), Connect: new v.Connect(), Blocked: new v.Blocked(), Unknown: new v.Unknown(), Field: new v.Field(), Calc: new v.Calc(), Busy: new v.Busy(), Python: new v.Python(), Timeout: new v.Timeout() }, v.getBuiltInByLabel = (e) => et.get(e), v.newTypedError = (e, t, n) => {
265
+ let r;
266
+ return r = typeof e == "string" ? tt.get(e) : nt.get(e), r || (r = v.Unknown), new r(t, n);
267
+ }, v.getBuiltInById = (e) => Te.get(e) || Et;
268
+ /**
269
+ * @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.4.13
270
+ *
271
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
272
+ * License: The license can be found at https://www.sheetxl.com/license.
273
+ */
274
+ const S = { html: "text/html", plain: "text/plain", png: "image/png" }, St = Object.freeze({ left: 0, top: 0 }), xt = Object.freeze({ left: 0, top: 0, bottom: 0, right: 0 }), Ct = Object.freeze({ x: 0, y: 0, width: 0, height: 0 });
275
+ Object.freeze(Object.defineProperty({ __proto__: null, EmptyBounds: Ct, EmptyRect: xt, EmptyTopLeft: St }, Symbol.toStringTag, { value: "Module" }));
276
+ const j = { Column: "column", Row: "row" }, vt = Object.freeze({ colIndex: 0, rowIndex: 0 }), Tt = Object.freeze({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }), rt = (e, t) => e.colStart === t.colStart ? e.rowStart - t.rowStart : e.colStart - t.colStart, ot = (e, t) => e.rowStart === t.rowStart ? e.colStart - t.colStart : e.rowStart - t.rowStart, _t = (e, t) => e.rowEnd === t.rowEnd ? t.colEnd - e.colEnd : t.rowEnd - e.rowEnd, Ot = (e, t) => e.colEnd === t.colEnd ? t.rowEnd - e.rowEnd : t.colEnd - e.colEnd, Le = (e, t) => e.colIndex === t.colIndex ? e.rowIndex - t.rowIndex : e.colIndex - t.colIndex, Ae = (e, t) => e.rowIndex === t.rowIndex ? e.colIndex - t.colIndex : e.rowIndex - t.rowIndex, it = (e = j.Row, t = !1) => t ? e !== j.Column ? _t : Ot : e !== j.Column ? ot : rt, Me = (e, t) => e === t || !(!e || !t) && e.rowIndex === t.rowIndex && e.colIndex === t.colIndex, Se = (e, t) => e === t || !(!e || !t) && e.rowStart === t.rowStart && e.rowEnd === t.rowEnd && e.colStart === t.colStart && e.colEnd === t.colEnd, xe = (e, t) => !(!e || !t) && !(e.colStart > t.colEnd || t.colStart > e.colEnd) && !(e.rowStart > t.rowEnd || t.rowStart > e.rowEnd), je = (e, t) => {
277
+ if (e === t) return !0;
278
+ if (!e || !t || e.length !== t.length) return !1;
279
+ for (let n = 0; n < e.length; n++) if (!Se(e[n], t[n])) return !1;
280
+ return !0;
281
+ }, he = (e, t, n) => {
282
+ if (!e && !t) return null;
283
+ if (!e) return n ? t : { ...t };
284
+ if (!t) return n ? e : { ...e };
285
+ const r = Math.min(e.colStart, t.colStart), o = Math.min(e.rowStart, t.rowStart), i = Math.max(e.colEnd, t.colEnd), a = Math.max(e.rowEnd, t.rowEnd);
286
+ let l = n;
287
+ return l ? (l.colStart = r, l.rowStart = o, l.colEnd = i, l.rowEnd = a) : l = { colStart: r, rowStart: o, colEnd: i, rowEnd: a }, l;
288
+ }, Pe = (e, t) => {
289
+ if (!t || t.length === 0) return e;
290
+ const n = { ...e };
291
+ for (let r = 0; r < t.length; r++) {
292
+ const o = t[r];
293
+ xe(n, o) && (n.rowStart = Math.min(n.rowStart, o.rowStart), n.colStart = Math.min(n.colStart, o.colStart), n.rowEnd = Math.max(n.rowEnd, o.rowEnd), n.colEnd = Math.max(n.colEnd, o.colEnd));
294
+ }
295
+ return n;
296
+ }, It = [null, null], Nt = (e, t, n) => {
297
+ if (e[0].value === e[1].value) return t;
298
+ };
299
+ function Fe(e, t = 2, n, r = j.Row, o) {
300
+ let i = [...e];
301
+ if (t <= 0 || e.length <= 1) return i;
302
+ let a = r === j.Column, l = 0, u = !1;
303
+ do {
304
+ const f = i.sort(it(a ? j.Row : j.Column));
305
+ i = [], i.push(f[0]);
306
+ const h = f.length;
307
+ let g = 0, p = f[0], y = p.colStart, T = p.rowStart, A = p.colEnd, D = p.rowEnd;
308
+ for (let U = 1; U < h; U++) {
309
+ const I = f[U];
310
+ let J = !1;
311
+ if (J = a ? p && T === I.rowStart && D === I.rowEnd && A + 1 === I.colStart : p && y === I.colStart && A === I.colEnd && D + 1 === I.rowStart, J) {
312
+ let E = { colStart: y, rowStart: T, colEnd: a ? I.colEnd : A, rowEnd: a ? D : I.rowEnd };
313
+ if (p.value !== void 0 && (E.value = p.value), n) {
314
+ const c = o ?? [null, null];
315
+ c[0] = p, c[1] = I, E = n(c, E, r);
316
+ }
317
+ if (E) {
318
+ i[g] = E, u = !0, p = E, y = p.colStart, T = p.rowStart, A = p.colEnd, D = p.rowEnd;
319
+ continue;
320
+ }
321
+ }
322
+ i[++g] = I, p = I, y = p.colStart, T = p.rowStart, A = p.colEnd, D = p.rowEnd;
323
+ }
324
+ l++, a = !a, l === 1 && (u = !0);
325
+ } while (l < t && u && i.length > 1);
326
+ return i;
327
+ }
328
+ Object.freeze(Object.defineProperty({ __proto__: null, EmptyCell: vt, EmptyRange: Tt, cellToRange: (e, t) => {
329
+ if (!e) return null;
330
+ let n = t;
331
+ return n || (n = { ...e }, delete n.colIndex, delete n.rowIndex), n.colStart = e.colIndex ?? 0, n.rowStart = e.rowIndex ?? 0, n.colEnd = e.colIndex ?? 0, n.rowEnd = e.rowIndex ?? 0, n;
332
+ }, columnFirstCellComparator: Le, columnFirstRangeComparator: rt, createCellComparator: (e = j.Row, t = !1) => t ? e !== j.Column ? (n, r) => n.rowIndex === r.rowIndex ? r.colIndex - n.colIndex : r.rowIndex - n.rowIndex : (n, r) => n.colIndex === r.colIndex ? r.rowIndex - n.rowIndex : r.colIndex - n.colIndex : e !== j.Column ? Ae : Le, createConflatingRanges: (e, t = !1) => {
333
+ const n = [];
334
+ let r, o, i = Number.MIN_SAFE_INTEGER, a = Number.MIN_SAFE_INTEGER;
335
+ return { append: (l, u, f) => {
336
+ let h = !0;
337
+ const g = f !== void 0;
338
+ if (g) {
339
+ const T = e ? e(o, f, t) : o === f ? f : void 0;
340
+ T === void 0 ? h = !1 : f = T;
341
+ }
342
+ if (h && u === a + 1 && l === i) return t ? r.rowEnd = u : r.colEnd = u, a = u, void (o = f);
343
+ r && n.push(r);
344
+ const p = t ? l : u, y = t ? u : l;
345
+ r = { colStart: p, rowStart: y, colEnd: p, rowEnd: y }, g && (r.value = f), i = l, a = u, o = f;
346
+ }, done: (l) => (r && (n.push(r), r = null), l ? Fe(n, 3, l === !0 ? Nt : l, t ? j.Column : j.Row, It) : n) };
347
+ }, createRangeComparator: it, defaultRange: (e, t, n) => e ? n ? (n.colStart = e.colStart ?? t.colStart, n.rowStart = e.rowStart ?? t.rowStart, n.colEnd = e.colEnd ?? t.colEnd, n.rowEnd = e.rowEnd ?? t.rowEnd, n) : { colStart: e.colStart ?? t.colStart, rowStart: e.rowStart ?? t.rowStart, colEnd: e.colEnd ?? t.colEnd, rowEnd: e.rowEnd ?? t.rowEnd } : t, extendRangeToIntersectingRanges: Pe, extendRangeToUnionRanges: (e, t) => {
348
+ if (!t || t.length === 0) return e;
349
+ let n = e, r = null;
350
+ for (; !Se(n, r); ) r = n, n = Pe(r, t);
351
+ return n;
352
+ }, indexOfCoords: (e, t) => {
353
+ const n = { colStart: e.colIndex, rowStart: e.rowIndex, colEnd: e.colIndex, rowEnd: e.rowIndex };
354
+ for (let r = t.length - 1; r >= 0; r--) if (xe(n, t[r])) return r;
355
+ return -1;
356
+ }, intersectRanges: (e, t, n) => {
357
+ if (!e) return n ? t : { ...t };
358
+ if (!t) return n ? e : { ...e };
359
+ if (!e && !t || e.rowStart > t.rowEnd || e.rowEnd < t.rowStart || e.colStart > t.colEnd || e.colEnd < t.colStart) return null;
360
+ const r = Math.max(e.colStart, t.colStart), o = Math.max(e.rowStart, t.rowStart), i = Math.min(e.colEnd, t.colEnd), a = Math.min(e.rowEnd, t.rowEnd);
361
+ let l = n;
362
+ return l ? (l.colStart = r, l.rowStart = o, l.colEnd = i, l.rowEnd = a) : l = { colStart: r, rowStart: o, colEnd: i, rowEnd: a }, l;
363
+ }, isCellWithinRange: (e, t) => !(!e || !t) && !(e.rowIndex < t.rowStart || e.rowIndex > t.rowEnd) && !(e.colIndex < t.colStart || e.colIndex > t.colEnd), isEqualCells: Me, isEqualRanges: Se, isEqualRangesArrays: je, isEqualSelectionCoords: (e, t) => e === t || !(!e || !t) && e.rangeIndex === t.rangeIndex && !!Me(e.cell, t.cell) && je(e.ranges, t.ranges), isRangeWithinRange: (e, t) => !(e.rowStart < t.rowStart || e.rowEnd > t.rowEnd) && !(e.colStart < t.colStart || e.colEnd > t.colEnd), isRangesIntersect: xe, isSingleCell: (e) => !!e && e.rowEnd === e.rowStart && e.colStart === e.colEnd, isValidRange: (e) => !!e && !(typeof e.colStart != "number" || e.colStart < 0) && !(typeof e.colEnd != "number" || e.colEnd < e.colStart) && !(typeof e.rowStart != "number" || e.rowStart < 0) && !(typeof e.rowEnd != "number" || e.rowEnd < e.rowStart), mergeRangedValues: Fe, rowFirstCellComparator: Ae, rowFirstRangeComparator: ot, sanitizeRange: (e) => e ? { colStart: e.colIndex ?? e.colStart ?? 0, rowStart: e.rowIndex ?? e.rowStart ?? 0, colEnd: e.colIndex ?? e.colEnd ?? 0, rowEnd: e.rowIndex ?? e.rowEnd ?? 0 } : null, translateRange: (e, t = -e.rowStart, n = -e.colStart, r) => r ? (r.colStart = e.colStart + n, r.rowStart = e.rowStart + t, r.colEnd = e.colEnd + n, r.rowEnd = e.rowEnd + t, r) : { colStart: e.colStart + n, rowStart: e.rowStart + t, colEnd: e.colEnd + n, rowEnd: e.rowEnd + t }, unionRanges: he, unionRangesArrays: (e, t, n) => {
364
+ if (!e || e.length === 0) return null;
365
+ if (e.length === 1 && !t) return e[0];
366
+ let r = e[0];
367
+ for (let o = 1; o < e.length; o++) r = he(r, e[o], n);
368
+ return t && (r = he(r, t, n)), r;
369
+ } }, Symbol.toStringTag, { value: "Module" }));
370
+ function Rt(e) {
371
+ const t = Object.prototype.toString.call(e);
372
+ return t === "[object RegExp]" || t === "[object Date]" || function(n) {
373
+ return n.$$typeof === kt;
374
+ }(e);
375
+ }
376
+ const kt = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.element") : 60103;
377
+ function Lt(e) {
378
+ return /* @__PURE__ */ function(t) {
379
+ return !!t && typeof t == "object";
380
+ }(e) && !Rt(e);
381
+ }
382
+ function re(e, t) {
383
+ return t.clone !== !1 && t.isMergeableObject(e) ? Y((n = e, Array.isArray(n) ? [] : {}), e, t) : e;
384
+ var n;
385
+ }
386
+ function At(e, t, n) {
387
+ return e.concat(t).map(function(r) {
388
+ return re(r, n);
389
+ });
390
+ }
391
+ function De(e) {
392
+ return Object.keys(e).concat(function(t) {
393
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(n) {
394
+ return Object.propertyIsEnumerable.call(t, n);
395
+ }) : [];
396
+ }(e));
397
+ }
398
+ function Ue(e, t) {
399
+ try {
400
+ return t in e;
401
+ } catch {
402
+ return !1;
403
+ }
404
+ }
405
+ function Mt(e, t, n) {
406
+ const r = {};
407
+ return n.isMergeableObject(e) && De(e).forEach(function(o) {
408
+ r[o] = re(e[o], n);
409
+ }), De(t).forEach(function(o) {
410
+ (function(i, a) {
411
+ return Ue(i, a) && !(Object.hasOwnProperty.call(i, a) && Object.propertyIsEnumerable.call(i, a));
412
+ })(e, o) || (Ue(e, o) && n.isMergeableObject(t[o]) ? r[o] = function(i, a) {
413
+ if (!a.customMerge) return Y;
414
+ const l = a.customMerge(i);
415
+ return typeof l == "function" ? l : Y;
416
+ }(o, n)(e[o], t[o], n) : r[o] = re(t[o], n));
417
+ }), r;
418
+ }
419
+ function Y(e, t, n) {
420
+ (n = n || {}).arrayMerge = n.arrayMerge || At, n.isMergeableObject = n.isMergeableObject || Lt, n.cloneUnlessOtherwiseSpecified = re;
421
+ const r = Array.isArray(t);
422
+ return r === Array.isArray(e) ? r ? n.arrayMerge(e, t, n) : Mt(e, t, n) : re(t, n);
423
+ }
424
+ Y.all = function(e, t) {
425
+ if (!Array.isArray(e)) throw new Error("first argument should be an array");
426
+ return e.reduce(function(n, r) {
427
+ return Y(n, r, t);
428
+ }, {});
429
+ };
430
+ const jt = Object.freeze([]), Pt = Object.freeze({}), Be = (e) => e, de = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
431
+ let t = 16 * Math.random() | 0;
432
+ return (e === "x" ? t : 3 & t | 8).toString(16);
433
+ }), Ft = (e) => 1 * e, at = (e, t) => e === t || !(!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length) && e.every((n, r) => n === t[r]), ne = (e) => typeof e == "object" && !Array.isArray(e) && e !== null, lt = (e) => typeof e != "object" || Array.isArray(e) || e === null ? e : (Object.keys(e).forEach(function(t) {
434
+ e[t] && typeof e[t] == "object" ? lt(e[t]) : e[t] !== null && e[t] !== void 0 || delete e[t], typeof e[t] == "object" && Object.keys(e[t]).length === 0 && delete e[t];
435
+ }), Object.keys(e).length === 0 ? null : e), Dt = (e, t) => !(e !== t && !at(e, t)) || !!e.isEqual?.(t), st = (e, t, n = Dt) => {
436
+ if (e == null || e === t) return null;
437
+ if (!e || typeof e != "object" || Array.isArray(e) || e.isImmutable?.()) return n(e, t) ? null : e;
438
+ const r = Object.keys(e);
439
+ if (r.length === 0) return null;
440
+ let o = !1;
441
+ for (let i = 0; i < r.length; i++) {
442
+ const a = r[i];
443
+ st(e[a], t?.[a], n) === null && (o = !0, delete e[a]);
444
+ }
445
+ return o && Object.keys(e).length === 0 ? null : void 0;
446
+ }, $e = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now(), ze = (e) => e == null, Ke = (e, t) => !(t.left > e.right || t.right < e.left || t.top > e.bottom || t.bottom < e.top), Ve = !(typeof window > "u" || !window.document || !window.document.createElement), k = { Windows: "windows", MacOS: "macos", IOS: "ios", Linux: "linux", Android: "android", Safari: "safari", Firefox: "firefox", Node: "node", Unknown: "unknown" }, oe = () => {
447
+ if (ct()) return k.Node;
448
+ const e = globalThis.navigator !== void 0 && globalThis.navigator.userAgent ? globalThis.navigator.userAgent.toLowerCase() : "";
449
+ return e ? /(win32|win64|windows|wince)/i.test(e) ? k.Windows : /(macintosh|macintel|macppc|mac68k|macos)/i.test(e) ? k.MacOS : /(iphone|ipad|ipod)/i.test(e) ? k.IOS : /android/.test(e) ? k.Android : /linux/.test(e) ? k.Linux : /^((?!chrome|android|).)*safari/i.test(e) ? k.Safari : /^((?!chrome|android|Seamonkey).)*firefox/i.test(e) ? k.Firefox : k.Unknown : k.Unknown;
450
+ };
451
+ function ct() {
452
+ return typeof process < "u" && process.release?.name === "node" || (typeof process < "u" && process.browser, !1);
453
+ }
454
+ const qe = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeElement || e?.contains(document.activeElement)), Ut = Object.freeze(Object.defineProperty({ __proto__: null, EmptyArray: jt, EmptyObject: Pt, OSType: k, arrayMove: function(e, t, n) {
455
+ const r = e.slice();
456
+ return r.splice(n < 0 ? r.length + n : n, 0, r.splice(t, 1)[0]), r;
457
+ }, asNumber: (e) => {
458
+ const t = Ft(e);
459
+ return Number.isFinite(t) ? t : 0;
460
+ }, camelToPrettyCase: (e) => e.length === 1 ? e.toUpperCase() : e.replace(/([A-Z])/g, " $1").replace(/^./, function(t) {
461
+ return t.toUpperCase();
462
+ }).trim(), canUseDOM: Ve, cancelTimeout: (e) => {
463
+ cancelAnimationFrame(e.id);
464
+ }, castToString: (e) => e == null || e === void 0 ? "" : typeof e != "string" ? "" + e : e, cloneObject: (e) => ze(e) ? e : JSON.parse(JSON.stringify(e)), consoleWithNoSource: (...e) => new Promise((t) => {
465
+ setTimeout(() => {
466
+ Function("console.log.apply(console, arguments)").apply(null, e), t();
467
+ });
468
+ }), debounce: function(e, t = 300, n = !1) {
469
+ let r, o, i, a, l = 0;
470
+ function u() {
471
+ let h = Date.now() - l;
472
+ h < t && h >= 0 ? r = setTimeout(u, t - h) : (r = null, n || (a = e.apply(i, o), i = o = null));
473
+ }
474
+ t == null && (t = 100);
475
+ const f = function() {
476
+ i = globalThis, o = arguments, l = Date.now();
477
+ var h = n && !r;
478
+ return r || (r = setTimeout(u, t)), h && (a = e.apply(i, o), i = o = null), a;
479
+ };
480
+ return f.clear = function() {
481
+ r && (clearTimeout(r), r = null);
482
+ }, f.flush = function() {
483
+ r && (a = e.apply(i, o), i = o = null, clearTimeout(r), r = null);
484
+ }, f;
485
+ }, deepEqual: function e(t, n) {
486
+ if (t === n) return !0;
487
+ if (t && n && typeof t == "object" && typeof n == "object") {
488
+ if (t.constructor !== n.constructor) return !1;
489
+ let r, o, i;
490
+ if (Array.isArray(t)) {
491
+ if (r = t.length, r != n.length) return !1;
492
+ for (o = r; o-- !== 0; ) if (!e(t[o], n[o])) return !1;
493
+ return !0;
494
+ }
495
+ if (t instanceof Map && n instanceof Map) {
496
+ if (t.size !== n.size) return !1;
497
+ for (o of t.entries()) if (!n.has(o[0])) return !1;
498
+ for (o of t.entries()) if (!e(o[1], n.get(o[0]))) return !1;
499
+ return !0;
500
+ }
501
+ if (t instanceof Set && n instanceof Set) {
502
+ if (t.size !== n.size) return !1;
503
+ for (o of t.entries()) if (!n.has(o[0])) return !1;
504
+ return !0;
505
+ }
506
+ if (ArrayBuffer.isView(t) && ArrayBuffer.isView(n)) {
507
+ if (r = t.length, r != n.length) return !1;
508
+ for (o = r; o-- !== 0; ) if (t[o] !== n[o]) return !1;
509
+ return !0;
510
+ }
511
+ if (t.constructor === RegExp) return t.source === n.source && t.flags === n.flags;
512
+ if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === n.valueOf();
513
+ if (t.toString !== Object.prototype.toString) return t.toString() === n.toString();
514
+ if (i = Object.keys(t), r = i.length, r !== Object.keys(n).length) return !1;
515
+ for (o = r; o-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(n, i[o])) return !1;
516
+ for (o = r; o-- !== 0; ) {
517
+ let a = i[o];
518
+ if ((a !== "_owner" || !t.$$typeof) && !e(t[a], n[a])) return !1;
519
+ }
520
+ return !0;
521
+ }
522
+ return t != t && n != n;
523
+ }, deepFreeze: function e(t) {
524
+ return Object.freeze(t), Object.keys(t).forEach((n) => {
525
+ typeof t[n] != "object" || t[n] === null || Object.isFrozen(t[n]) || e(t[n]);
526
+ }), t;
527
+ }, deepMerge: Y, diffValues: (e, t) => {
528
+ const n = {}, r = Object.keys(t), o = r.length;
529
+ for (let i = 0; i < o; i++) {
530
+ const a = r[i];
531
+ e[a] !== t[a] && (e[a] === void 0 ? n[a] = t[a] : n[a] = e[a]);
532
+ }
533
+ return Object.keys(n).length === 0 ? null : n;
534
+ }, findEqualOrGreater: function(e, t, n = Be) {
535
+ let r = 0, o = e.length - 1;
536
+ for (; r <= o; ) {
537
+ let i = Math.floor((r + o) / 2), a = n(e[i]);
538
+ if (a === t) return i;
539
+ a < t ? r = i + 1 : o = i - 1;
540
+ }
541
+ return r;
542
+ }, findEqualOrLesser: function(e, t, n = Be) {
543
+ let r = e.length - 1, o = 0;
544
+ for (; r >= o; ) {
545
+ let i = Math.floor((r + o) / 2), a = n(e[i]);
546
+ if (a === t) return i;
547
+ a > t ? r = i - 1 : o = i + 1;
548
+ }
549
+ return r;
550
+ }, findNextStep: (e, t = !0, n = 15, r = 10, o = 400) => {
551
+ const i = Math.max(e - r, 0) + (t ? 1 : -1);
552
+ return Math.min(o, Math[t ? "ceil" : "floor"](i / n) * n + r);
553
+ }, getDPI: () => {
554
+ let e = 1;
555
+ return typeof window == "object" && (e = window.devicePixelRatio || 1), e;
556
+ }, getFromPath: (e, t) => {
557
+ const n = t.split(".");
558
+ let r = e;
559
+ for (let o = 0; o < n.length; o++) {
560
+ const i = n[o];
561
+ if (!r) return null;
562
+ let a = r[i];
563
+ if (typeof a == "function" && (a = a.bind(r)()), !a || !ne(a)) return a;
564
+ r = a;
565
+ }
566
+ return r ?? null;
567
+ }, getOS: oe, hasFocus: qe, isDefined: (e) => e != null, isEmpty: (e) => e == null || e === "", isEqualArrays: at, isEqualBounds: (e, t) => e === t || !(e && !t || t && !e) && e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height, isEqualObjectKeys: (e, t) => {
568
+ if (e === t) return !0;
569
+ if (e && !t || t && !e) return !1;
570
+ const n = Object.keys(e);
571
+ if (n.length !== Object.keys(t).length) return !1;
572
+ for (let r = 0; r < n.length; r++) if (e[n[r]] !== t[n[r]]) return !1;
573
+ return !0;
574
+ }, isNode: ct, isNullOrUndefined: ze, isNumeric: (e) => {
575
+ const t = 1 * e;
576
+ return Number.isFinite(t) && typeof t == "number";
577
+ }, isObject: ne, isPromiseLike: (e) => !!e && typeof e.then == "function", isRectInsideRect: (e, t) => e.top >= t.top && e.bottom <= t.bottom && e.left >= t.left && e.right <= t.right, isRectIntersect: Ke, mergeContentful: (...e) => {
578
+ const t = e.length;
579
+ if (t > 0 && e[t - 1] !== void 0 && !ne(e[t - 1])) return e[t - 1];
580
+ let n = e[0] || {};
581
+ for (let r = 1; r < t; r++) n = Y(n, e[r] || {}, { arrayMerge: (o, i) => [...i] });
582
+ return n;
583
+ }, nextTick: (e) => {
584
+ typeof window < "u" && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame(() => {
585
+ e();
586
+ }) : (typeof setImmediate == "function" ? setImmediate : setTimeout)(() => {
587
+ e();
588
+ });
589
+ }, openFileDialog: (e = "*.*") => new Promise((t, n) => {
590
+ if (!Ve) return void n("Unable to open dialog with no dom.");
591
+ const r = document.createElement("input");
592
+ r.type = "file", r.accept = e;
593
+ let o = null, i = !1;
594
+ globalThis.addEventListener?.("focus", () => {
595
+ setTimeout(() => {
596
+ o || i || (i = !0, t(null));
597
+ }, 1e3);
598
+ }, { once: !0, passive: !0 }), r.onchange = () => {
599
+ if (o = r.files[0], o) {
600
+ if (i) return void console.warn("File open detected after faux cancel.", o);
601
+ t(o);
602
+ }
603
+ }, r.autofocus = !0, r.click();
604
+ }), rafThrottle: (e) => {
605
+ let t, n = !1, r = function() {
606
+ n = !1, e(t);
607
+ };
608
+ return function(o) {
609
+ t = o, t && t.persist && t.persist(), n || (n = !0, requestAnimationFrame(r));
610
+ };
611
+ }, removeEmptyProperties: lt, removeEqualValues: st, removeListenerAll: (e) => {
612
+ if (!e) return [];
613
+ for (let t = 0; t < e.length; t++) e[t] && e[t]();
614
+ return [];
615
+ }, requestTimeout: (e, t) => {
616
+ const n = $e(), r = { id: requestAnimationFrame(function o() {
617
+ $e() - n >= t ? e.call(null) : r.id = requestAnimationFrame(o);
618
+ }) };
619
+ return r;
620
+ }, roundAccurately: (e, t = 0) => {
621
+ if (e == null || !isFinite(e)) return null;
622
+ const n = 10 ** t;
623
+ return Number(Math.round(e * n) / n);
624
+ }, setToPath: (e, t, n) => {
625
+ const r = t.split(".");
626
+ let o = e;
627
+ if (!o) throw new Error("Can not set path to a null path.");
628
+ for (let i = 0; o && i < r.length - 1; i++) {
629
+ const a = r[i];
630
+ let l = o[a];
631
+ if (l == null && (l = {}, o[a] = l), !ne(l)) throw new Error("Can not set path to a non object path.");
632
+ o = l;
633
+ }
634
+ if (typeof n != "number" && typeof n != "boolean" && typeof n != "string" && !ne(n)) throw new Error(\`Can not set path to \${n} that is not a a supported primitive.\`);
635
+ return o[r[r.length - 1]] = n, e;
636
+ }, splitNumber: (e) => {
637
+ let t = Math.abs(e);
638
+ if (isNaN(t) || !isFinite(e)) return null;
639
+ let n = 0 | t, r = t - n, o = 0, i = 0, a = 1;
640
+ if (r > 5e-8) for (; i < 8 && Math.abs(o / a - r) > 5e-8; ) i++, a *= 10, o = Math.round(r * a);
641
+ return { ip: Math.trunc(e), fp: o, ipLength: Math.ceil(Math.log10(n + 1)), fpLength: i };
642
+ }, subtractRect: (e, t, n = !1) => {
643
+ if (!t) return [e];
644
+ if (!Ke(e, t)) return [];
645
+ const r = [];
646
+ let o = e;
647
+ const i = () => {
648
+ t.top > o.top && t.top < o.bottom && (r.push({ ...o, bottom: t.top }), o = { ...o, top: t.top });
649
+ }, a = () => {
650
+ t.bottom > o.top && t.bottom < o.bottom && (r.push({ ...o, top: t.bottom }), o = { ...o, bottom: t.bottom });
651
+ }, l = () => {
652
+ t.right > o.left && t.right < o.right && (r.push({ ...o, left: t.right }), o = { ...o, right: t.right });
653
+ }, u = () => {
654
+ t.left > o.left && t.left < o.right && (r.push({ ...o, right: t.left }), o = { ...o, left: t.left });
655
+ };
656
+ return n ? (u(), l(), i(), a()) : (i(), a(), l(), u()), r;
657
+ }, textToKey: (e) => e.replace(/[^a-zA-Z0-9]/g, "").toLowerCase(), throttle: function(e, t) {
658
+ let n = null;
659
+ return (...r) => {
660
+ const o = Date.now();
661
+ (!n || o - n >= t) && (n = o, e(...r));
662
+ };
663
+ }, toSafeJSON: function e(t) {
664
+ if (t === null || typeof t != "object") return t;
665
+ if (typeof t.toJSON == "function") return t.toJSON();
666
+ if (Array.isArray(t)) return t.map((r) => e(r));
667
+ if (typeof t.toString == "function" && t.toString !== Object.prototype.toString) return t.toString();
668
+ const n = {};
669
+ for (const r in t) t.hasOwnProperty(r) && (n[r] = e(t[r]));
670
+ return n;
671
+ }, transpose: (e) => {
672
+ if (!e) return e;
673
+ const t = e.length, n = e[0].length, r = [];
674
+ for (let o = 0; o < n; o++) r[o] = Array(t);
675
+ for (let o = 0; o < t; o++) for (let i = 0; i < n; i++) r[i][o] = e[o][i];
676
+ return r;
677
+ }, uuidV4: de, validEnumValue: (e, t) => {
678
+ if (!Object.values(e).includes(t)) throw new Error(\`Invalid type: \${t ?? "null"}. Must be one of: \${Object.values(t).join(", ")}.\`);
679
+ }, whenFocus: async (e, t = !1) => new Promise((n) => {
680
+ qe(e, t) ? n(!0) : e.addEventListener("focusin", () => {
681
+ n(!0);
682
+ }, { once: !0 }), e.focus();
683
+ }) }, Symbol.toStringTag, { value: "Module" }));
684
+ Object.freeze(Object.defineProperty({ __proto__: null, MESSAGE_ERROR_INVALID_ARG: (e) => \`Invalid argument: '\${e}'.\` }, Symbol.toStringTag, { value: "Module" }));
685
+ const ut = (e) => {
686
+ const t = new Uint8Array(e), n = t.byteLength;
687
+ let r = "";
688
+ for (let o = 0; o < n; o++) r += String.fromCharCode(t[o]);
689
+ if (typeof window < "u" && typeof globalThis.btoa == "function") return globalThis.btoa(r);
690
+ if (typeof Buffer < "u") return Buffer.from(r, "binary").toString("base64");
691
+ throw new Error("Unsupported environment");
692
+ }, Ce = (e) => new Promise((t, n) => {
693
+ if (e) if (typeof FileReader < "u") {
694
+ const r = new FileReader();
695
+ r.onload = () => {
696
+ t(r.result);
697
+ }, r.onerror = () => {
698
+ n(r.error);
699
+ }, r.readAsText(e);
700
+ } else if (typeof Buffer < "u") {
701
+ const r = (o) => Buffer.from(o).toString("utf-8");
702
+ e.arrayBuffer().then((o) => {
703
+ t(r(o));
704
+ }).catch((o) => {
705
+ n(o);
706
+ });
707
+ } else n(new Error("Unsupported environment"));
708
+ else t("");
709
+ });
710
+ Object.freeze(Object.defineProperty({ __proto__: null, DEFAULT_MIME_TYPE: "*/*", arrayBufferToBase64: ut, base64ToArrayBuffer: (e) => {
711
+ const t = typeof window < "u" && typeof globalThis.atob == "function" ? globalThis.atob(e) : Buffer.from(e, "base64").toString("binary"), n = t.length, r = new Uint8Array(n);
712
+ for (let o = 0; o < n; o++) r[o] = t.charCodeAt(o);
713
+ return r.buffer;
714
+ }, blobToString: Ce }, Symbol.toStringTag, { value: "Module" }));
715
+ const dt = "data:image/png;base64,", ft = "Unable to resolve image.", Ge = (e) => new Promise(async (t, n) => {
716
+ let r = null;
717
+ try {
718
+ r = new Image(), r.src = e, r.addEventListener("load", function() {
719
+ t({ width: r.naturalWidth, height: r.naturalHeight });
720
+ }, { once: !0 }), r.addEventListener("error", function() {
721
+ URL.revokeObjectURL(e), n("Invalid Image");
722
+ }, { once: !0 }), await r.decode("sync");
723
+ } catch {
724
+ r?.src && URL.revokeObjectURL(r.src);
725
+ }
726
+ r || n(ft);
727
+ }), we = "image/svg+xml";
728
+ Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: dt, getImageDataUrl: (e, t = 1) => new Promise(async (n, r) => {
729
+ let o = null;
730
+ try {
731
+ o = new Image(), o.src = e, o.addEventListener("load", function() {
732
+ try {
733
+ const i = document.createElement("canvas");
734
+ i.width = o.naturalWidth, i.height = o.naturalHeight, i.getContext("2d").drawImage(o, 0, 0);
735
+ const a = i.toDataURL("image/png", t);
736
+ n({ elemImg: o, dataUrl: a });
737
+ } catch (i) {
738
+ URL.revokeObjectURL(e), r(i);
739
+ }
740
+ }, { once: !0 }), o.addEventListener("error", function() {
741
+ URL.revokeObjectURL(e), r("Invalid Image");
742
+ }, { once: !0 }), await o.decode("sync");
743
+ } catch {
744
+ o?.src && URL.revokeObjectURL(o.src);
745
+ }
746
+ o || r(ft);
747
+ }), loadImageDetails: async (e, t = null) => {
748
+ let n = null;
749
+ const r = async () => {
750
+ try {
751
+ const i = t ?? "image/*", a = URL.createObjectURL(new Blob([e], { type: i })), l = await Ge(a);
752
+ n = { mimeType: i, naturalDimensions: l, asUrl: a };
753
+ } catch {
754
+ }
755
+ }, o = async () => {
756
+ try {
757
+ const i = new TextDecoder().decode(e), a = URL.createObjectURL(new Blob([i], { type: we })), l = await Ge(a);
758
+ n = { mimeType: t ?? we, naturalDimensions: l, asUrl: a, asSVGText: i };
759
+ } catch {
760
+ }
761
+ };
762
+ if (t === we ? await o() : t.startsWith("image/") ? await r() : (await r(), n || await o()), !n) throw new Error("Failed to load image");
763
+ return n;
764
+ } }, Symbol.toStringTag, { value: "Module" }));
765
+ var We, Ye;
766
+ (Ye = We || (We = {})).resolveTypedUpdates = (e, t, n, r) => {
767
+ if (e === null) return e;
768
+ if (e === void 0) return r;
769
+ let o = e;
770
+ if (t?.shorthand) {
771
+ const u = t?.shorthand(e, n);
772
+ u !== void 0 && (o = u);
773
+ }
774
+ if (o !== null && t?.getSubType) {
775
+ const u = t.getSubType(o);
776
+ u && (t = u);
777
+ }
778
+ const i = t?.properties, a = t?.arrayType ?? !1;
779
+ let l = o;
780
+ if (t && t.merge && l && r) l = t.merge(l, r, n);
781
+ else if (!a) {
782
+ if (i) {
783
+ const u = Object.keys({ ...o, ...r });
784
+ l = null;
785
+ for (let f = 0; f < u.length; f++) {
786
+ const h = u[f];
787
+ let g, p = o[h];
788
+ if (p !== void 0) {
789
+ const y = i[h];
790
+ g = y ? (0, Ye.resolveTypedUpdates)(p, y, n, r?.[h]) : p;
791
+ } else g = r?.[h];
792
+ g != null && (l = l ?? {}, l[h] = g);
793
+ }
794
+ }
795
+ }
796
+ return l;
797
+ };
798
+ const Je = \`The Safari browser does not support advanced copy and paste.
799
+ Copy and paste will be limited to within the browser tab.
800
+
801
+ Please use Chrome or Edge if external copy and paste is required.\`, ye = \`You do not have permissions to access the clipboard.
802
+ All copy and paste operations will be limited to the browser tab.\`, pt = { Safari: \`The Safari browser does not support advanced copy and paste.
803
+ Copy and paste will be limited to within the browser tab.
804
+
805
+ Please use Chrome or Edge if external copy and paste is required.\`, Perms: ye, PermsWrite: oe() === k.Safari ? Je : ye, PermsRead: oe() === k.Safari ? Je : ye }, ge = async () => new Promise((e) => {
806
+ document.hasFocus() ? e() : globalThis.addEventListener?.("focus", () => {
807
+ e();
808
+ }, { once: !0 }), document.activeElement.focus?.();
809
+ }), be = async (e, t, n) => {
810
+ if (oe() === k.Safari) return await n(new Error(pt.Safari));
811
+ try {
812
+ const r = async (a) => {
813
+ try {
814
+ return await a();
815
+ } catch (l) {
816
+ if (l.message?.includes("Document is not focused")) return !1;
817
+ throw l;
818
+ }
819
+ }, o = await globalThis?.navigator?.permissions?.query({ name: e, allowWithoutGesture: !0, allowWithoutSanitization: !0 });
820
+ let i = !1;
821
+ if (o.state === "prompt" && (i = await r(t)), i || o.state !== "granted" || (i = await t()), !i) return await n(new Error(o.state));
822
+ } catch (r) {
823
+ return r.message === "No valid data on clipboard" || r.name === "DataError" ? void 0 : await n(r);
824
+ }
825
+ }, mt = async (e) => {
826
+ try {
827
+ return await e.read({ unsanitized: [S.html] });
828
+ } catch {
829
+ }
830
+ return await e.read();
831
+ }, Bt = async (e, t) => {
832
+ if (!e) return null;
833
+ const n = await mt(e);
834
+ let r = !1;
835
+ for (let o = 0; !r && n && o < n.length; o++) if (r = n[o].types.includes(t), r)
836
+ return await n[o].getType(t);
837
+ return r ? void 0 : null;
838
+ };
839
+ if (!globalThis.ClipboardItem) {
840
+ const e = (n, r) => new Blob([r], { type: n });
841
+ class t {
842
+ constructor(r, o) {
843
+ this._items = {}, this._types = Object.keys(r);
844
+ const i = {}, a = Object.keys(r);
845
+ for (let l = 0; l < a.length; l++) {
846
+ const u = a[l];
847
+ let f = r[u];
848
+ i[u] = typeof f == "string" ? e(u, f) : f;
849
+ }
850
+ this._items = i, this._presentationStyle = o?.presentationStyle ?? "unspecified";
851
+ }
852
+ get types() {
853
+ return this._types;
854
+ }
855
+ getType(r) {
856
+ return Promise.resolve(this._items[r]);
857
+ }
858
+ supports(r) {
859
+ return !0;
860
+ }
861
+ }
862
+ globalThis.ClipboardItem = t;
863
+ }
864
+ const ve = async (e, t = S.html) => new Promise(async (n, r) => {
865
+ try {
866
+ const o = await Bt(e, t);
867
+ if (o) {
868
+ const i = new FileReader();
869
+ i.onload = () => {
870
+ n(i.result);
871
+ }, i.onerror = () => {
872
+ n("");
873
+ }, i.readAsText(o);
874
+ } else n("");
875
+ } catch (o) {
876
+ r(o);
877
+ }
878
+ }), He = async (e, t = S.html) => {
879
+ const n = await ve(e, t);
880
+ if (!n) return null;
881
+ let r = null;
882
+ try {
883
+ r = new DOMParser().parseFromString(n, S.html);
884
+ } catch {
885
+ console.warn("Can't parse html from clipboard.");
886
+ }
887
+ return r;
888
+ }, $t = async (e) => {
889
+ e && await e.writeText("");
890
+ }, ie = "clipboard-uuid", Q = "web text/uuid", Xe = (e) => \`<div style="display:none" \${ie}="\${e}"/>\`, zt = (e, t) => {
891
+ let n = null;
892
+ try {
893
+ const r = new DOMParser().parseFromString(t, S.html);
894
+ r.body.firstElementChild.setAttribute(ie, e), n = r.getElementsByTagName("body")[0].innerHTML;
895
+ } catch (r) {
896
+ console.warn("Can't embed uuid.", r);
897
+ }
898
+ return n;
899
+ }, Ze = (e, t) => {
900
+ if (!t || !e) return !1;
901
+ try {
902
+ const n = t.querySelectorAll(\`[\${ie}="\${e}"]\`);
903
+ if (n && n.length === 1) return !0;
904
+ if (t.querySelector("parsererror")) throw new Error("We are unable to parse node");
905
+ return !1;
906
+ } catch {
907
+ return !1;
908
+ }
909
+ };
910
+ class Qe {
911
+ constructor(t) {
912
+ if (t?.nativeClipboard === void 0 || t?.nativeClipboard === !0) try {
913
+ this._nativeClipboard = globalThis?.navigator.clipboard;
914
+ } catch {
915
+ t?.nativeClipboard === !0 && console.warn("NativeClipboard option set to true but no native clipboard available.");
916
+ }
917
+ else this._nativeClipboard = t?.nativeClipboard === !1 ? null : t?.nativeClipboard;
918
+ this._disableCheckOnFocus = t?.disableCheckOnFocus ?? !1, this._init();
919
+ }
920
+ async _checkForChanges() {
921
+ this._nativeClipboard && this._state && !this._disableCheckOnFocus && await be("clipboard-read", async () => {
922
+ await ge();
923
+ const t = await ve(this._nativeClipboard, Q);
924
+ if (!this._state || t && t === this._state.uuid) return !0;
925
+ const n = await He(this._nativeClipboard, S.html);
926
+ return !this._state || (Ze(this._state.uuid, n) || this.clear(), !0);
927
+ }, async (t) => {
928
+ t?.message === "denied" || t.message?.includes("Document is not focused") || oe() === k.Safari || console.warn("Unable to detect clipboard changes: ", t);
929
+ });
930
+ }
931
+ _init() {
932
+ const t = this;
933
+ this._listeners = /* @__PURE__ */ new Map(), this._listenersCapture = /* @__PURE__ */ new Map(), this._state = null, this._nativeClipboard && (this._onFocus = () => {
934
+ t._checkForChanges();
935
+ }, this._onBlur = () => {
936
+ globalThis.addEventListener?.("focus", t._onFocus, { once: !0 });
937
+ }, globalThis.addEventListener?.("blur", this._onBlur), this._nativeClipboard.addEventListener("clipboardchange", (n) => {
938
+ t._checkForChanges();
939
+ }));
940
+ }
941
+ async read() {
942
+ if (!this._nativeClipboard) return this._state?.items ?? null;
943
+ const t = this;
944
+ return await be("clipboard-read", async () => {
945
+ if (await ge(), this._state?.uuid) {
946
+ const n = await ve(this._nativeClipboard, Q);
947
+ if (n && n === t._state.uuid) return !0;
948
+ const r = await He(this._nativeClipboard, S.html);
949
+ if (Ze(t._state?.uuid, r)) return !0;
950
+ }
951
+ return t._state = { items: await mt(this._nativeClipboard), uuid: null, ref: null }, this.dispatchEvent(new Event("clipboardread")), !0;
952
+ }, async (n) => {
953
+ this.dispatchEvent(new Event("clipboarderrorread"));
954
+ }), this._state?.items ?? [];
955
+ }
956
+ async write(t) {
957
+ return this._write({ uuid: de(), items: t, ref: null });
958
+ }
959
+ async _write(t) {
960
+ if (!this._nativeClipboard) return this._state = t, this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")), null;
961
+ const n = this, r = [], o = t.uuid;
962
+ let i = t.items ?? [];
963
+ const a = () => {
964
+ n._state = { uuid: o, ref: t.ref, items: r }, n.dispatchEvent(new Event("clipboardwrite")), n.dispatchEvent(new Event("clipboardchange"));
965
+ };
966
+ await be("clipboard-write", async () => {
967
+ await ge(), o && i.length === 0 && (i.push(new ClipboardItem({ [Q]: new Blob([o], { type: Q }) })), i.push(new ClipboardItem({ [S.html]: new Blob([Xe(o)], { type: S.html }) })));
968
+ for (let l = 0; l < Math.min(1, i.length); l++) {
969
+ const u = i[l];
970
+ let f = u.types.indexOf(S.html), h = null;
971
+ if (f !== -1) {
972
+ const y = await u.getType(S.html);
973
+ h = await Ce(y), h && (h = zt(o, h));
974
+ }
975
+ if (!h && u.types.includes(S.plain)) {
976
+ const y = await u.getType(S.plain);
977
+ if (y) {
978
+ let T = null;
979
+ typeof y == "string" ? (console.warn("text as string", y), T = y) : T = await Ce(y), T && (h = \`<div \${ie}="\${o}">\${T}</div>\`);
980
+ }
981
+ }
982
+ if (!h && u.types.includes(S.png)) {
983
+ const y = await u.getType(S.png), T = ut(await y.arrayBuffer());
984
+ h = \`<div \${ie}="\${o}"><img src="\${dt + T}"/></div>\`;
985
+ }
986
+ !h && o && (h = Xe(o));
987
+ const g = new Blob([h ?? ""], { type: S.html }), p = {};
988
+ for (let y = 0; y < u.types.length; y++) {
989
+ const T = u.types[y];
990
+ p[T] = y === f ? g : u.getType(T);
991
+ }
992
+ h && f === -1 && (p[S.html] = g), o && (p[Q] = new Blob([o], { type: Q })), r.push(new ClipboardItem(p));
993
+ }
994
+ try {
995
+ r && r.length !== 0 ? await this._nativeClipboard.write(r) : await $t(this._nativeClipboard);
996
+ } catch (l) {
997
+ l.message?.includes("Document is not focused") || console.warn("Unable to write to native clipboard: ", l);
998
+ }
999
+ return a(), !0;
1000
+ }, async (l) => {
1001
+ this.dispatchEvent(new Event("clipboarderrorwrite")), a();
1002
+ });
1003
+ }
1004
+ async writeReference(t) {
1005
+ if (!t) return void this.clear();
1006
+ let n = null;
1007
+ const r = {};
1008
+ try {
1009
+ const i = await t.toText?.() ?? null;
1010
+ i && (r[S.plain] = new Blob([i ?? ""], { type: S.plain }));
1011
+ } catch (i) {
1012
+ n = i;
1013
+ }
1014
+ try {
1015
+ const i = await t.toHtml?.() ?? null;
1016
+ i && (r[S.html] = new Blob([i], { type: S.html }));
1017
+ } catch (i) {
1018
+ n = i, console.warn("export to html", i);
1019
+ }
1020
+ try {
1021
+ const i = await t.toImage?.() ?? null;
1022
+ i && (r[S.png] = i);
1023
+ } catch (i) {
1024
+ n = i, console.warn("export to png", i);
1025
+ }
1026
+ const o = this._write({ uuid: de(), ref: t, items: Object.keys(r).length > 0 ? [new ClipboardItem(r)] : null });
1027
+ if (n) throw n;
1028
+ return o;
1029
+ }
1030
+ clear(t = !1) {
1031
+ this._state && (this._state = null, t && this._write({ uuid: null, ref: null, items: null }), this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")));
1032
+ }
1033
+ async readReference() {
1034
+ return await this.read(), this._state?.ref ?? null;
1035
+ }
1036
+ readText() {
1037
+ return new Promise(async (t, n) => {
1038
+ const r = await this.read();
1039
+ let o = null;
1040
+ for (let a = 0; !o && r && a < r.length; a++) r[a].types.includes(S.plain) && (o = await r[a].getType(S.plain));
1041
+ if (!o) return void t("");
1042
+ const i = new FileReader();
1043
+ i.onload = () => {
1044
+ t(i.result);
1045
+ }, i.readAsText(o), i.onerror = (a) => {
1046
+ n(a);
1047
+ };
1048
+ });
1049
+ }
1050
+ async writeText(t) {
1051
+ const n = [new ClipboardItem({ [S.plain]: new Blob([t], { type: S.plain }) })];
1052
+ return this._write({ uuid: de(), items: n, ref: null });
1053
+ }
1054
+ addEventListener(t, n, r = {}) {
1055
+ const o = r?.capture ? this._listenersCapture : this._listeners;
1056
+ let i = o.get(t);
1057
+ i || (i = /* @__PURE__ */ new Map(), o.set(t, i)), i.set(n, typeof r == "boolean" ? {} : r);
1058
+ }
1059
+ dispatchEvent(t) {
1060
+ if (!t) return;
1061
+ const n = (r) => {
1062
+ const o = r.get(t.type);
1063
+ o && o.forEach((i, a) => {
1064
+ try {
1065
+ typeof a == "function" ? a(t) : a.handleEvent && a.handleEvent(t), i.once && o.delete(a);
1066
+ } catch (l) {
1067
+ console.warn(l);
1068
+ }
1069
+ });
1070
+ };
1071
+ return n(this._listenersCapture), n(this._listeners), !0;
1072
+ }
1073
+ removeEventListener(t, n, r) {
1074
+ const o = r?.capture ? this._listenersCapture : this._listeners, i = o.get(t);
1075
+ i && (i.delete(n), i.size === 0 && o.delete(t));
1076
+ }
1077
+ close() {
1078
+ globalThis.removeEventListener?.("focus", this._onFocus), globalThis.removeEventListener?.("blur", this._onBlur);
1079
+ }
1080
+ }
1081
+ var Ee;
1082
+ (Ee = Qe || (Qe = {})).ErrorMessages = pt, Ee.Global = new Ee();
1083
+ const Kt = "__SHEETXL";
1084
+ let ee = null, le = null;
1085
+ async function Vt() {
1086
+ if (ee)
1087
+ return ee;
1088
+ if (le) {
1089
+ if (await le, !ee)
1090
+ throw new Error("ESBuild initialization promise resolved, but instance is not available.");
1091
+ return ee;
1092
+ }
1093
+ let e, t;
1094
+ le = new Promise((n, r) => {
1095
+ e = n, t = r;
1096
+ });
1097
+ try {
1098
+ const { initialize: n } = await Promise.resolve().then(function() {
1099
+ return nn;
1100
+ });
1101
+ return ee = await n(), e(), ee;
1102
+ } catch (n) {
1103
+ throw console.error("Failed to import or initialize esbuild:", n), le = null, t(n), n;
1104
+ }
1105
+ }
1106
+ const qt = {
1107
+ // ESBuild.TsconfigRaw =
1108
+ compilerOptions: {
1109
+ target: "esnext"
1110
+ }
1111
+ };
1112
+ async function Gt(e, t, n = "/script.js", r = Kt) {
1113
+ try {
1114
+ const o = await Vt(), i = "@sheetxl/primitives", a = \`
1115
+ export const FormulaContext = globalThis.\${r}?.FormulaContext;
1116
+ export const ScalarType = globalThis.\${r}?.ScalarType;
1117
+ export const Observable = globalThis.\${r}?.Observable;
1118
+ export const IRange = globalThis.\${r}?.IRange;
1119
+ export const FormulaError = globalThis.\${r}?.FormulaError;
1120
+ // Add more exports as needed
1121
+ \`, l = {
1122
+ // ESBuild.Plugin = {
1123
+ name: "sheetxl-esbuild-in-memory",
1124
+ setup(f) {
1125
+ const h = "sheetxl-" + (/* @__PURE__ */ new Date()).getTime();
1126
+ f.onResolve({ filter: new RegExp(\`^(\${n.replace("/", "\\\\/")}|\${i})$\`) }, (g) => ({
1127
+ path: g.path,
1128
+ namespace: h
1129
+ })), f.onResolve({ filter: /.*/ }, (g) => {
1130
+ if (g.namespace !== h)
1131
+ return console.warn(\`esbuild: Treating import "\${g.path}" as external.\`), { path: g.path, external: !0 };
1132
+ }), f.onLoad({ filter: /.*/, namespace: h }, (g) => {
1133
+ let p;
1134
+ if (g.path === n)
1135
+ p = t;
1136
+ else if (g.path === i)
1137
+ p = a;
1138
+ else
1139
+ return {
1140
+ errors: [{ text: \`Cannot load unknown path in \${h}: \${g.path}\` }]
1141
+ };
1142
+ return {
1143
+ contents: p,
1144
+ loader: "ts"
1145
+ // leave this as 'ts' so esbuild generates proper sourcemaps
1146
+ };
1147
+ });
1148
+ }
1149
+ }, u = await o.build({
1150
+ entryPoints: [n],
1151
+ // Use the virtual entry point
1152
+ bundle: !0,
1153
+ // IMPORTANT: Enable bundling
1154
+ write: !1,
1155
+ // IMPORTANT: Return result in memory
1156
+ format: "esm",
1157
+ // Output format
1158
+ plugins: [l],
1159
+ // TODO - later change to external and prepend when executing from ui
1160
+ sourcemap: "inline",
1161
+ // Generate separate source map string
1162
+ tsconfigRaw: qt,
1163
+ // Pass the mapped options
1164
+ minify: !0,
1165
+ // sourcemap: 'external', // Generate separate source map string
1166
+ // Or use 'inline' if you prefer data URLs embedded in the code
1167
+ // To suppress warnings about dynamic import() if esbuild complains:
1168
+ // supported: { 'dynamic-import': true },
1169
+ platform: "neutral"
1170
+ // not really needed
1171
+ });
1172
+ if (u.outputFiles && u.outputFiles.length > 0)
1173
+ return u.outputFiles[0].text;
1174
+ throw u.errors && u.errors.length > 0 ? new Error(\`esbuild bundling failed: \${u.errors.map((f) => f.text).join(\`
1175
+ \`)}\`) : new Error("esbuild did not produce an output file.");
1176
+ } catch (o) {
1177
+ throw console.error("esbuild bundling process failed:", o), o;
1178
+ }
1179
+ }
1180
+ const Wt = \`
1181
+ /**
1182
+ * Represents the completion of an asynchronous operation
1183
+ */
1184
+ interface Promise<T> {
1185
+ /**
1186
+ * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
1187
+ * resolved value cannot be modified from the callback.
1188
+ * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
1189
+ * @returns A Promise for the completion of the callback.
1190
+ */
1191
+ finally(onfinally?: (() => void) | undefined | null): Promise<T>;
1192
+ }
1193
+ \`, Yt = \`
1194
+ interface FirstTest {
1195
+ isTrue?: boolean;
1196
+ }
1197
+ \`, Jt = async () => Yt, ht = /* @__PURE__ */ new Map([
1198
+ ["IReferenceRange", "r"],
1199
+ ["IRange", "l"]
1200
+ ]), wt = /* @__PURE__ */ new Map([
1201
+ ["IWorkbook", "workbook"],
1202
+ ["ISheet", "sheet"],
1203
+ ["ICellRanges", "ranges"],
1204
+ ["ICellRange", "range"],
1205
+ ["IFormulaContext", "context"]
1206
+ ]), _e = (e, t) => {
1207
+ Array.from(t.keys()).forEach((r) => {
1208
+ const o = t.get(r);
1209
+ t.set(\`\${e}.\${r}\`, o);
1210
+ });
1211
+ }, Ht = /* @__PURE__ */ new Map([
1212
+ ["Scalar", "*"],
1213
+ ["FormulaError.Known", W.Error],
1214
+ ["Date", "Date"],
1215
+ ["JSON", "JSON"]
1216
+ ]), Xt = /* @__PURE__ */ new Map([
1217
+ // Repeating
1218
+ ]), Oe = "SheetXL";
1219
+ _e(Oe, ht);
1220
+ _e(Oe, wt);
1221
+ _e(Oe, Xt);
1222
+ const Zt = /* @__PURE__ */ new Map([
1223
+ ["Promise", () => ({ async: !0 })],
1224
+ // ['PromiseLike', (): Partial<IFunction.ReturnTypeJSON> => {
1225
+ // return { async: true };
1226
+ // }],
1227
+ ["Observable", () => ({ stream: !0 })]
1228
+ ]);
1229
+ let se = null;
1230
+ async function Qt() {
1231
+ if (se)
1232
+ return se;
1233
+ try {
1234
+ return await (await Promise.resolve().then(function() {
1235
+ return on;
1236
+ })).initialize();
1237
+ } catch (e) {
1238
+ throw se = null, e;
1239
+ } finally {
1240
+ se = null;
1241
+ }
1242
+ }
1243
+ async function en(e) {
1244
+ const t = e?.source ?? null;
1245
+ if (!t) return null;
1246
+ const n = (e.disableBundle || e.declarationsOnly) ?? !1, r = [
1247
+ Jt(),
1248
+ //import('typescript'), // when bundled, but node check causes issues. We could bundle replace isNode but felt hacky
1249
+ Qt()
1250
+ ], o = await Promise.all(r), i = o[0], a = o[1];
1251
+ let l = "", u = null;
1252
+ const f = [], h = {
1253
+ allowJs: !0,
1254
+ declaration: !1,
1255
+ sourceMap: !1,
1256
+ // was true but now bundler will do this
1257
+ inlineSourceMap: !1,
1258
+ inlineSources: !1,
1259
+ isolatedModules: !0,
1260
+ preserveConstEnums: !1,
1261
+ // types: ['WebWorker'],
1262
+ module: 99,
1263
+ //"esNext",
1264
+ noResolve: !0,
1265
+ emitDeclarationOnly: !1,
1266
+ target: a.ScriptTarget.ES2020
1267
+ // lib: ['webworker', 'es2020', 'esnext.asynciterable'], // Use the webworker lib instead of dom
1268
+ }, g = "script", p = \`\${g}.ts\`, y = "lib.d.ts", T = "global.d.ts", A = {
1269
+ [p]: t,
1270
+ [y]: Wt,
1271
+ [T]: i
1272
+ }, D = {
1273
+ getSourceFile: (s, w, L, P) => a.createSourceFile(s, A[s], a.ScriptTarget.Latest, !0),
1274
+ fileExists: (s) => A[s] !== void 0,
1275
+ readFile: (s) => A[s],
1276
+ writeFile: (s, w) => {
1277
+ A[s] = w;
1278
+ },
1279
+ // not used
1280
+ getCurrentDirectory: () => "./",
1281
+ getCanonicalFileName: (s) => s,
1282
+ useCaseSensitiveFileNames: () => !0,
1283
+ getDefaultLibFileName: (s) => y,
1284
+ getNewLine: () => \`
1285
+ \`
1286
+ }, U = a.createProgram([p, T], h, D), I = U.getTypeChecker(), J = U.getSourceFile(p), E = U.emit();
1287
+ E.diagnostics.length > 0 && console.warn(E.diagnostics), l = A[\`\${g}.js\`];
1288
+ const c = (s, w, L, P) => {
1289
+ if (!s) {
1290
+ $(s, new Error(\`Type is not defined for '\${w?.name ?? "return"}'.\`));
1291
+ return;
1292
+ }
1293
+ if (s.kind === a.SyntaxKind.NumberKeyword)
1294
+ w.scalar = W.Number;
1295
+ else if (s.kind === a.SyntaxKind.StringKeyword)
1296
+ w.scalar = W.String;
1297
+ else if (s.kind === a.SyntaxKind.BooleanKeyword)
1298
+ w.scalar = W.Boolean;
1299
+ else if (s.kind === a.SyntaxKind.UndefinedKeyword || s.kind === a.SyntaxKind.NullKeyword || s.kind === a.SyntaxKind.VoidKeyword) {
1300
+ if (P) {
1301
+ $(s, new Error(\`'undefined' is not a valid type for input: '\${s?.parent?.name?.escapedText}'.\`));
1302
+ return;
1303
+ }
1304
+ w.scalar = W.Null;
1305
+ } else if (s.kind === a.SyntaxKind.BigIntKeyword)
1306
+ w.scalar = W.Number;
1307
+ else if (s.kind === a.SyntaxKind.AnyKeyword)
1308
+ w.scalar = W.Null;
1309
+ else if (s.kind === a.SyntaxKind.ArrayType) {
1310
+ const M = s.elementType;
1311
+ if (!M) {
1312
+ $(s, new Error(\`'Array' must be typed: '\${s?.parent?.name?.escapedText}'.\`));
1313
+ return;
1314
+ }
1315
+ w.arrayDepth = (w.arrayDepth ?? 0) + 1, c(M, w, L, P);
1316
+ } else if (s.kind !== a.SyntaxKind.TupleType) {
1317
+ if (s.kind === a.SyntaxKind.TypeReference) {
1318
+ const M = s.typeName?.getText?.() ?? null, K = ht.get(M);
1319
+ let V = !1;
1320
+ K && (w.range = K, V = !0);
1321
+ const q = Ht.get(M);
1322
+ if (q && (w.scalar = q), q !== void 0 && (V = !0), P) {
1323
+ const R = wt.get(M);
1324
+ if (R)
1325
+ return R;
1326
+ } else {
1327
+ const R = Zt.get(M);
1328
+ if (R) {
1329
+ const b = { ...w, ...R() };
1330
+ let N = 0;
1331
+ if (b.async && N++, b.stream && N++, N > 1) {
1332
+ $(s, new Error(\`'\${M}' cannot have multiple modifiers: '\${s?.parent?.name?.escapedText}'.\`));
1333
+ return;
1334
+ }
1335
+ w = b, V = !0;
1336
+ }
1337
+ }
1338
+ if (!V) {
1339
+ $("node", new Error(\`'\${M}' is not a valid type: '\${s?.parent?.name?.escapedText}'.\`));
1340
+ return;
1341
+ }
1342
+ const H = s.typeArguments;
1343
+ if (H) {
1344
+ if (H.length !== 1) {
1345
+ $(s, new Error(\`'\${M}' must be typed with exactly 1 type: '\${s?.parent?.name?.escapedText}'.\`));
1346
+ return;
1347
+ }
1348
+ c(H[0], w, L, P);
1349
+ }
1350
+ }
1351
+ }
1352
+ }, m = (s) => (a.getCombinedModifierFlags(s) & a.ModifierFlags.Export) !== 0, fe = (s) => (a.getCombinedModifierFlags(s) & a.ModifierFlags.Default) !== 0, B = [], $ = (s, w) => {
1353
+ B.push(w);
1354
+ };
1355
+ if (a.forEachChild(J, (s) => {
1356
+ if (m(s) && a.isFunctionDeclaration(s)) {
1357
+ const w = {}, L = {
1358
+ parameters: {}
1359
+ }, P = s?.name?.getText();
1360
+ try {
1361
+ w.name = P;
1362
+ const K = I.getSymbolAtLocation(s.name).getDocumentationComment(I);
1363
+ if (K && K.length > 0 && K[0].text) {
1364
+ let R = K[0].text;
1365
+ R = R.replace(/[\\r\\n]+/g, "\\\\n").trim(), L.summary = R;
1366
+ }
1367
+ const V = {};
1368
+ c(s.type, V, w, !1), w.returnType = V;
1369
+ const q = {};
1370
+ fe(s) && (q.default = !0, u = P), Object.keys(q).length > 0 && (w.behavior = q), w.parameters = [];
1371
+ const H = /* @__PURE__ */ new Map();
1372
+ for (let R = 0; R < s.parameters.length; R++) {
1373
+ const b = s.parameters[R], N = {};
1374
+ N.name = b.name?.getText();
1375
+ const X = c(b.type, N, w, !0);
1376
+ if (X) {
1377
+ if (w.parameters.length !== 0) {
1378
+ const F = s?.parent?.name?.getText();
1379
+ $(s, new Error(\`'\${w.name}' contexts must be the first parameter: '\${F}'.\`));
1380
+ return;
1381
+ }
1382
+ w.context = X;
1383
+ continue;
1384
+ }
1385
+ const z = !((b.initializer === void 0 || b.initializer === null) && (b.questionToken === void 0 || b.questionToken === null));
1386
+ let C;
1387
+ if (z && (N.optional = !0, b.initializer))
1388
+ try {
1389
+ b.initializer.kind === a.SyntaxKind.StringLiteral ? C = b.initializer.text : b.initializer.kind === a.SyntaxKind.NumericLiteral ? C = parseFloat(b.initializer.text) : b.initializer.kind === a.SyntaxKind.TrueKeyword || b.initializer.kind === a.SyntaxKind.FalseKeyword ? C = b.initializer.kind === a.SyntaxKind.TrueKeyword : b.initializer.kind === a.SyntaxKind.NullKeyword ? C = null : b.initializer.kind === a.SyntaxKind.ObjectLiteralExpression || b.initializer.kind === a.SyntaxKind.ArrayLiteralExpression ? C = b.initializer.getText() : C = b.initializer.getText?.();
1390
+ } catch (O) {
1391
+ console.warn(\`Couldn't extract default value for parameter '\${N.name}'\`, O);
1392
+ }
1393
+ b.dotDotDotToken && (N.rest = !0), w.parameters.push(N);
1394
+ const x = { description: "" };
1395
+ L.parameters[N.name] = x;
1396
+ const G = I.getSymbolAtLocation(b.name).getDocumentationComment(I);
1397
+ G && G.length > 0 && G[0].text && (x.description = G[0].text), C !== void 0 && (x.defaultValue = C), H.set(N.name, N);
1398
+ }
1399
+ if (s.jsDoc && s.jsDoc.length > 0) {
1400
+ const R = s.jsDoc;
1401
+ for (let b = 0; b < R.length; b++) {
1402
+ const N = R[b]?.tags;
1403
+ if (N)
1404
+ for (let X = 0; X < N.length; X++) {
1405
+ const z = N[X];
1406
+ let C = z?.tagName?.text;
1407
+ if (!C) continue;
1408
+ C = C.toLowerCase();
1409
+ let x = z.comment;
1410
+ const G = C === "hidden";
1411
+ if (!(typeof x != "string" && !G) && (typeof x == "string" && (x = x.replace(/[\\r\\n]+/g, "\\\\n").trim()), !(!G && x && (x = x.split(/\\\\n/)[0], !x || x.length === 0)))) {
1412
+ if (x && typeof x == "string") {
1413
+ const O = /\\{@link(code|plain)?\\s+([^}|]+)(?:\\s*\\|\\s*([^}]+))?\\}/g;
1414
+ let F, Z = x, te = [];
1415
+ for (; (F = O.exec(x)) !== null; ) {
1416
+ const [pe, me, gt, Ne] = F, bt = [gt.trim()];
1417
+ Ne && bt.push(Ne.trim());
1418
+ }
1419
+ x = Z, te.length > 0 && C === "see" && (L.links || (L.links = []), L.links.push(...te));
1420
+ }
1421
+ if (C === "name") {
1422
+ const O = x;
1423
+ O !== P && (L.name = O);
1424
+ } else if (C === "description") {
1425
+ const O = x;
1426
+ } else if (C === "summary") {
1427
+ const O = x;
1428
+ O && (L.summary = O);
1429
+ } else if (C === "param") {
1430
+ const O = z.name?.text, F = H.get(O);
1431
+ if (!F) {
1432
+ B.push(new Error(\`Parameter '\${O}' not found in function '\${P}'.\`));
1433
+ continue;
1434
+ }
1435
+ if (z.typeExpression && z.typeExpression.type)
1436
+ try {
1437
+ const Z = z.typeExpression.type;
1438
+ if (Z.kind === a.SyntaxKind.UnionType) {
1439
+ const te = [];
1440
+ F.enums = te, Z.types.forEach((pe) => {
1441
+ if (pe.kind === a.SyntaxKind.LiteralType) {
1442
+ const me = pe.literal.text;
1443
+ me && te.push(me);
1444
+ }
1445
+ });
1446
+ }
1447
+ } catch (Z) {
1448
+ console.warn("Error parsing JSDoc type expression:", Z);
1449
+ }
1450
+ } else if (C === "returns" || C === "return")
1451
+ w.returnType.description = x;
1452
+ else if (C === "category")
1453
+ L.category = x;
1454
+ else if (C === "hidden") {
1455
+ let O = !0;
1456
+ const F = x?.toLowerCase();
1457
+ F === "false" ? O = !1 : F !== "true" && (O = x), O !== !1 && (L.hidden = O ?? !0);
1458
+ }
1459
+ }
1460
+ }
1461
+ }
1462
+ }
1463
+ Object.keys(w.returnType).length === 0 && delete w.returnType, f.push([w, L]);
1464
+ } catch (M) {
1465
+ $(s, new Error(\`'\${P}': \${M.message}\`));
1466
+ }
1467
+ }
1468
+ }), B.length > 0)
1469
+ throw console.warn(B), new Error("There were compilation errors.", { cause: B });
1470
+ if (f.length === 0)
1471
+ throw new Error("No exported functions.");
1472
+ const yt = \`\${Ut.uuidV4()}-script\`;
1473
+ try {
1474
+ !n && B.length === 0 && (l = await Gt(a, l, g));
1475
+ } catch {
1476
+ console.warn("Error bundling script");
1477
+ }
1478
+ const Ie = {
1479
+ functions: f,
1480
+ commitId: yt,
1481
+ source: t,
1482
+ name: "Script",
1483
+ language: "typescript",
1484
+ // default
1485
+ compiled: l
1486
+ };
1487
+ return u && (Ie.autoRun = u), Ie;
1488
+ }
1489
+ self.addEventListener("message", async (e) => {
1490
+ const { id: t, params: n } = e.data;
1491
+ try {
1492
+ const r = await en(n);
1493
+ self.postMessage({ id: t, result: r, error: null });
1494
+ } catch (r) {
1495
+ self.postMessage({
1496
+ id: t,
1497
+ result: null,
1498
+ error: {
1499
+ message: r.message,
1500
+ stack: r.stack,
1501
+ cause: r.cause
1502
+ }
1503
+ });
1504
+ }
1505
+ });
1506
+ let ce = null;
1507
+ async function tn() {
1508
+ return ce || (ce = new Promise(async (e, t) => {
1509
+ try {
1510
+ const n = "0.20.2", r = \`https://esm.sh/esbuild-wasm@\${n}\`, o = \`https://esm.sh/esbuild-wasm@\${n}/esbuild.wasm\`, a = (await import(
1511
+ /* webpackIgnore: true */
1512
+ /* @vite-ignore */
1513
+ r
1514
+ )).default;
1515
+ await a.initialize({
1516
+ wasmURL: o,
1517
+ // Provide the specific WASM URL
1518
+ worker: !1
1519
+ // Keep processing on the current thread
1520
+ }), e(a);
1521
+ } catch (n) {
1522
+ console.error("Error initializing esbuild:", n), t(n);
1523
+ }
1524
+ }), ce);
1525
+ }
1526
+ var nn = /* @__PURE__ */ Object.freeze({
1527
+ __proto__: null,
1528
+ initialize: tn
1529
+ });
1530
+ let ue = null;
1531
+ async function rn() {
1532
+ return ue || (ue = new Promise(async (e, t) => {
1533
+ let n = null;
1534
+ try {
1535
+ n = await import("https://esm.sh/typescript@5.7.2");
1536
+ } catch (r) {
1537
+ console.error("Error initializing Browser TypeScript module:", r);
1538
+ }
1539
+ n || console.log("use script fallback"), e(n);
1540
+ }), ue);
1541
+ }
1542
+ var on = /* @__PURE__ */ Object.freeze({
1543
+ __proto__: null,
1544
+ initialize: rn
1545
+ });
1546
+ `, a = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", s], { type: "text/javascript;charset=utf-8" });
1547
+ function d(e) {
1548
+ let n;
1549
+ try {
1550
+ if (n = a && (self.URL || self.webkitURL).createObjectURL(a), !n) throw "";
1551
+ const t = new Worker(n, { type: "module", name: e?.name });
1552
+ return t.addEventListener("error", () => {
1553
+ (self.URL || self.webkitURL).revokeObjectURL(n);
1554
+ }), t;
1555
+ } catch {
1556
+ return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(s), { type: "module", name: e?.name });
1557
+ }
1558
+ }
1559
+ async function p() {
1560
+ if (typeof process < "u" && process.versions?.node && typeof Worker > "u") return await l();
1561
+ if (typeof Worker < "u") {
1562
+ const e = new c(() => new d());
1563
+ try {
1564
+ return await e.start(), e;
1565
+ } catch (n) {
1566
+ console.error("Failed to start TypescriptCompiler worker reverting to fallback:", n);
1567
+ }
1568
+ }
1569
+ return await l();
1570
+ }
1571
+ const l = async () => {
1572
+ const { compileModule: e } = await import("./0j_nQmV1Bb0lJ6sB.js"), n = new u((t) => e(t));
1573
+ return await n.start(), n;
1574
+ };
1575
+ export {
1576
+ p as createCompilerWorker
1577
+ };