@sheetxl/studio-vanilla 0.3.4 → 0.3.6

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 (197) hide show
  1. package/browser/cjs/3JKPVnbyR3hJBHBj.cjs +6 -0
  2. package/browser/cjs/B1_gRcAH1cv26X_U.cjs +301 -0
  3. package/browser/cjs/B2fgcYTdhA0facdy.cjs +6 -0
  4. package/browser/cjs/B5cmz4f50xr5iF-S.cjs +19 -0
  5. package/browser/cjs/B7eLEpR9cmunfRfq.cjs +6 -0
  6. package/browser/cjs/BDUaerzhOJJZeQgS.cjs +6 -0
  7. package/browser/cjs/BDcLV5_cJTh8yhJI.cjs +7 -0
  8. package/browser/cjs/{CdVKz1bz20BYztuB.cjs → BOSNEoFPpJAjkRsv.cjs} +1 -1
  9. package/browser/cjs/{BDmE5OFneHwyeeiD.cjs → BSfmlz8MvlIKFx_N.cjs} +4 -4
  10. package/browser/cjs/Bdhft6pu1-bwMbfv.cjs +12 -0
  11. package/browser/cjs/BmbGW13BR2649OAV.cjs +6 -0
  12. package/browser/cjs/{DzE824T4cXRcKowY.cjs → Bu6q4vuUt_6LDbk_.cjs} +1 -1
  13. package/browser/cjs/{DD0VHDU8F1FiLKcs.cjs → CXe_6K7OT1AVSgAV.cjs} +1 -1
  14. package/browser/cjs/ChqJwXboF-6-bjIC.cjs +6 -0
  15. package/browser/cjs/CyA00uY0ivUSWJ17.cjs +6 -0
  16. package/browser/cjs/D1jsD18kKrFBRLo8.cjs +12 -0
  17. package/browser/cjs/{D-I49Eh-SQg7zJYX.cjs → DC0sGYXEVcjL3fEu.cjs} +1 -1
  18. package/browser/cjs/{BTgA_stiR3dZAHop.cjs → DQJ0sG5gEZSPPLGp.cjs} +2 -2
  19. package/browser/cjs/{WPXWuf9j-uwazW31.cjs → DUIyD1-nWzOytYDo.cjs} +2 -2
  20. package/browser/cjs/{yZrSgyFKPqsiym7z.cjs → D_RushRsBoa4Hd6w.cjs} +2 -2
  21. package/browser/cjs/{46C8cTP5D1fDfsPs.cjs → D_gx4EJ1Z1jqCpC2.cjs} +1 -1
  22. package/browser/cjs/Dgv9C5kP5-0zdZ_n.cjs +6 -0
  23. package/browser/cjs/{BB5pxJh1jhHsvVZ1.cjs → Dp_f-iB1lirYu5mz.cjs} +1 -1
  24. package/browser/cjs/P2nQEqe-ae2Lk91E.cjs +11 -0
  25. package/browser/cjs/{CpPM7Ir1EZB_8bER.cjs → SvTvsTn26UgPTXmE.cjs} +1 -1
  26. package/browser/cjs/index.cjs +2 -2
  27. package/browser/cjs/{CuldnUeQxpcu8oJ7.cjs → oIH2DXvUemx8KBZE.cjs} +1 -1
  28. package/{cdn/assets/RWhi_dOrWDICNt1t.js → browser/esm/BEdBgMB0JXu6qm1p.mjs} +1 -1
  29. package/browser/esm/{BNq1DlA_v8-hm8PQ.mjs → BUVsXfFhbzBtVoTV.mjs} +71 -70
  30. package/browser/esm/{DLJ1zBZE-WPdkpt2.mjs → BWoHBg8cjtJL9xBv.mjs} +132 -131
  31. package/{cdn/assets/DjHCn_TmfObC_aJ1.js → browser/esm/Bc8I4T3hDcq3Tbe7.mjs} +13 -13
  32. package/{cdn/assets/dQu9CDkkTpS5h580.js → browser/esm/BpIA1_q9rYZhuE_V.mjs} +8 -8
  33. package/browser/esm/{BjLCBG20KyjNKCpy.mjs → BwpZ-CB67KJ8A2Pd.mjs} +2 -2
  34. package/browser/esm/{Dq1oxXMudxqdJaKZ.mjs → CAUWxMHzGpG7-P5A.mjs} +11 -10
  35. package/{cdn/assets/CGUSbWH383tudMFu.js → browser/esm/CFw_ZTxUHsgd5Pf5.mjs} +10 -10
  36. package/browser/esm/{CTdGamCv2VtpI05C.mjs → CIG-Y2tRBFYerBVK.mjs} +1 -1
  37. package/browser/esm/{s8U6UEvd4LQsvEnH.mjs → CRLFplTpJUvecqqq.mjs} +1 -1
  38. package/browser/esm/{CeWIrhJ_bsxOl7mw.mjs → CanwhkFG9e2Ojys-.mjs} +24 -23
  39. package/browser/esm/CcGOjkDDVya2Ff-b.mjs +50 -0
  40. package/browser/esm/{BfNo01-WwZl_5N1M.mjs → Ce53t5Ez6mDQoNNS.mjs} +192 -191
  41. package/browser/esm/{pxRv4ndPNkOMM_s3.mjs → Cmk4lwRc0QJqs2cT.mjs} +13 -13
  42. package/{cdn/assets/CG-YuIoWsi12_nu9.js → browser/esm/CnI4MLBb2ZtZInkh.mjs} +10 -10
  43. package/{cdn/assets/CNhPYXS_v3a2ATBg.js → browser/esm/CrZPGKZDaJ-22LSg.mjs} +791 -788
  44. package/{cdn/assets/Dl02UNFD2tNwtHQ9.js → browser/esm/D-GTj1DQOn_EIw_N.mjs} +1 -1
  45. package/{cdn/assets/ct9ztJbQB16MJoyP.js → browser/esm/D0YFJdBci18KKVSS.mjs} +7 -7
  46. package/{cdn/assets/BY5dcSv5nxuvXMsr.js → browser/esm/D7__-CZBbVdVmNms.mjs} +13 -13
  47. package/{cdn/assets/C-oc6cc0wXRVBFx2.js → browser/esm/DRX3PxyWmwYCO1oC.mjs} +1 -1
  48. package/browser/esm/DtS8vZkP_9xxg-8G.mjs +24893 -0
  49. package/browser/esm/{BXMZNx8rs4_V8pQL.mjs → DuOzS4aDJybvfnas.mjs} +2 -2
  50. package/browser/esm/{C2Ik_RfF43fmFDeS.mjs → ekyugPyyyBIdZgfX.mjs} +1 -1
  51. package/browser/esm/{BrWhLiIy81LKNSUX.mjs → evOdu9Z-9G0PNrGI.mjs} +1 -1
  52. package/browser/esm/{qchlbvmOxrybWJep.mjs → goTiQtfGVEDiRLX3.mjs} +1 -1
  53. package/browser/esm/index.mjs +2 -2
  54. package/browser/esm/{FCkxbRy2XiqD3GdL.mjs → ius8cYWSRDNFx-QU.mjs} +12 -12
  55. package/{browser/esm/BoL2rsWK1YyT1PP7.mjs → cdn/assets/6GT7WcmdWYVxOobM.js} +8 -8
  56. package/{browser/esm/RWhi_dOrWDICNt1t.mjs → cdn/assets/BEdBgMB0JXu6qm1p.js} +1 -1
  57. package/cdn/assets/{6tFlyQMvtppXfmuU.js → BH-qA3U2gj7snkKJ.js} +24 -23
  58. package/{browser/esm/im3UoVISx3VXhEFp.mjs → cdn/assets/BPeDOIBYCZkjaWRD.js} +13 -13
  59. package/cdn/assets/{mAWImp_J2v8z8hbZ.js → BVIGf25ixd6wvJVI.js} +132 -131
  60. package/cdn/assets/{BPStm90FUYfOgibU.js → BcGPdpUCizGdDlXm.js} +12 -12
  61. package/cdn/assets/Be-_CFU80fx1X1E9.js +50 -0
  62. package/cdn/assets/{CTdGamCv2VtpI05C.js → CIG-Y2tRBFYerBVK.js} +1 -1
  63. package/cdn/assets/{s8U6UEvd4LQsvEnH.js → CRLFplTpJUvecqqq.js} +1 -1
  64. package/cdn/assets/{BKDQtGZxRUUzBmnI.js → ChD-x-lrZKLslGbg.js} +2 -2
  65. package/cdn/assets/{COFTB6OufFls7NP1.js → CkMou3XlV2mmYqmq.js} +11 -10
  66. package/cdn/assets/{BMb4pCD8O5vK2p1B.js → Cx6czat4u0MrS9wL.js} +2 -2
  67. package/{browser/esm/Dl02UNFD2tNwtHQ9.mjs → cdn/assets/D-GTj1DQOn_EIw_N.js} +1 -1
  68. package/{browser/esm/GbTp1_3jFZu0Ex24.mjs → cdn/assets/D0YFJdBci18KKVSS.js} +7 -7
  69. package/{browser/esm/C-oc6cc0wXRVBFx2.mjs → cdn/assets/DRX3PxyWmwYCO1oC.js} +1 -1
  70. package/{browser/esm/CZRLp5H9dSrMEgaI.mjs → cdn/assets/DS9Og6WSj_kNksiq.js} +10 -10
  71. package/cdn/assets/De8HwbKM7sZJMZSq.js +24740 -0
  72. package/{browser/esm/CKHDKAaHkwZHUkoS.mjs → cdn/assets/DfoJr75R0GrjAv-i.js} +10 -10
  73. package/cdn/assets/{DYgFWlitgXmKdN_I.js → Dw1Rz_MNeT4QWFeY.js} +192 -191
  74. package/{browser/esm/Br4TnuxGRULZDhCA.mjs → cdn/assets/FSFNUan5QfhjNqMt.js} +791 -788
  75. package/cdn/assets/{Be9YovX6b_0gKXs5.js → Ijbe8IzzEjVScejo.js} +71 -70
  76. package/{browser/esm/Ddm9jggzrr5VJQ68.mjs → cdn/assets/YQRaiV0_mvhQsFVY.js} +13 -13
  77. package/cdn/assets/{LxoKYdUqZ4Zgxjza.js → _W5FqhFhYviNTP8H.js} +13 -13
  78. package/cdn/assets/{C2Ik_RfF43fmFDeS.js → ekyugPyyyBIdZgfX.js} +1 -1
  79. package/cdn/assets/{BrWhLiIy81LKNSUX.js → evOdu9Z-9G0PNrGI.js} +1 -1
  80. package/cdn/assets/{qchlbvmOxrybWJep.js → goTiQtfGVEDiRLX3.js} +1 -1
  81. package/cdn/index.js +8 -8
  82. package/cdn/loader.js +1 -1
  83. package/package.json +8 -7
  84. package/browser/cjs/0dkhOl0ItVZXnHg_.cjs +0 -6
  85. package/browser/cjs/7Xjct_4bBSU-vad1.cjs +0 -6
  86. package/browser/cjs/B2kFbeodTh3Gk-aQ.cjs +0 -6
  87. package/browser/cjs/B5UGK4AzAC9SjXJp.cjs +0 -6
  88. package/browser/cjs/B9kurj8mOePUlJX2.cjs +0 -6
  89. package/browser/cjs/BDACVe5nzEmYknRm.cjs +0 -19
  90. package/browser/cjs/BG8OR9VWCkyIRwrw.cjs +0 -6
  91. package/browser/cjs/BML8p6hKVpqMb-13.cjs +0 -124
  92. package/browser/cjs/BeGusiaaShhfh7Ch.cjs +0 -7
  93. package/browser/cjs/BgJ-surJf8jSxqmk.cjs +0 -6
  94. package/browser/cjs/BgJFVvwpAWB3ssLE.cjs +0 -6
  95. package/browser/cjs/Bi8tk3LAhLkM7IXm.cjs +0 -6
  96. package/browser/cjs/BlYpCVX1NOGpcNB6.cjs +0 -7
  97. package/browser/cjs/BnZdvx8z2BIDZv9J.cjs +0 -355
  98. package/browser/cjs/BvnUfF0WlIXumm-E.cjs +0 -6
  99. package/browser/cjs/BwGs6fp9j-iFwDlB.cjs +0 -32
  100. package/browser/cjs/C4JyilwtB4aWsWnG.cjs +0 -6
  101. package/browser/cjs/C8PUqW17bEbzJthE.cjs +0 -6
  102. package/browser/cjs/CBTWDt8vxgXfkDfh.cjs +0 -6
  103. package/browser/cjs/CJ29qM66PMBNE3G9.cjs +0 -6
  104. package/browser/cjs/CKtzkomrFnDVY5SY.cjs +0 -11
  105. package/browser/cjs/CLarA_vLTlgU3TCF.cjs +0 -13
  106. package/browser/cjs/CN8Y9NZjRCPl8CqY.cjs +0 -6
  107. package/browser/cjs/CNIPdrSO6Xr2gkt9.cjs +0 -6
  108. package/browser/cjs/CNkEdWYoHRiw_Uez.cjs +0 -6
  109. package/browser/cjs/CPFRW8nnIVWYeQYn.cjs +0 -12
  110. package/browser/cjs/CZih4fqvAIVbCVO4.cjs +0 -6
  111. package/browser/cjs/Cx3wCYZR6BKbOtgk.cjs +0 -6
  112. package/browser/cjs/Cx8xafhEESu639Ig.cjs +0 -6
  113. package/browser/cjs/CzqzVoUeKxH16SDC.cjs +0 -6
  114. package/browser/cjs/D-GDPxpVRx45cdpQ.cjs +0 -6
  115. package/browser/cjs/D50Wzp-4UIlO9uVc.cjs +0 -6
  116. package/browser/cjs/DB9rOzEP0g0ZGfBj.cjs +0 -6
  117. package/browser/cjs/DIeyUTfGkxwK6bdT.cjs +0 -15
  118. package/browser/cjs/DX_oDw_K4CB6Ej9i.cjs +0 -6
  119. package/browser/cjs/DcNRcLtSOkHAK_Mt.cjs +0 -6
  120. package/browser/cjs/Df8ZAsCgZ69F33-C.cjs +0 -6
  121. package/browser/cjs/DfCiN8VOEQt4cw-x.cjs +0 -12
  122. package/browser/cjs/DnkG5azaxDtt-73G.cjs +0 -6
  123. package/browser/cjs/Dr_HVAdkD1bM9yrW.cjs +0 -6
  124. package/browser/cjs/KbKjJCMErVEwKqoi.cjs +0 -6
  125. package/browser/cjs/Px_DbuQFWhjhPilq.cjs +0 -6
  126. package/browser/cjs/VmYEO_-N9Cn7JpZN.cjs +0 -6
  127. package/browser/cjs/c4HmqMqg3ugRd4gl.cjs +0 -1501
  128. package/browser/cjs/jmPMUQMT7KTdf9Sr.cjs +0 -6
  129. package/browser/cjs/zRbLzzCcfjQpsQ4j.cjs +0 -6
  130. package/browser/esm/0M23_yfYSvrAB5iY.mjs +0 -472
  131. package/browser/esm/2sPP8EL_OzSYDsKu.mjs +0 -10
  132. package/browser/esm/3SiPV9yNzSbQVINg.mjs +0 -10
  133. package/browser/esm/6CkscKSECxQpy0v6.mjs +0 -10
  134. package/browser/esm/94SRg1Gxbdr9B75m.mjs +0 -10
  135. package/browser/esm/B2I1Hudz2EIGw59h.mjs +0 -10
  136. package/browser/esm/B2fqssq7kMsGIg5g.mjs +0 -10
  137. package/browser/esm/BBBP9totA24zTbqh.mjs +0 -10
  138. package/browser/esm/BEYxIKe5B75ADXWP.mjs +0 -5582
  139. package/browser/esm/BIHHiMjUvXmWQ6w_.mjs +0 -10
  140. package/browser/esm/BYRVuU6FUEX6XBFW.mjs +0 -10
  141. package/browser/esm/Bq_HFm6_6_ycs_gE.mjs +0 -48519
  142. package/browser/esm/Bs6fth_bBoNrYDwE.mjs +0 -21
  143. package/browser/esm/C-QHwmJCeB3o-mzv.mjs +0 -3934
  144. package/browser/esm/C0U_bX9Hj97edVC9.mjs +0 -10
  145. package/browser/esm/CC8aO_pPT-tkJK_H.mjs +0 -10
  146. package/browser/esm/CGxu5NKxrEXE8QIe.mjs +0 -24
  147. package/browser/esm/CbTDhJiJfpR6Btxp.mjs +0 -10
  148. package/browser/esm/CsUNORBKkJ7f3diG.mjs +0 -10
  149. package/browser/esm/CyYXh2ng_dKgHzbE.mjs +0 -29
  150. package/browser/esm/DRFsMc27LyLwGu56.mjs +0 -820
  151. package/browser/esm/DT09m4FGTu5N2LZJ.mjs +0 -10
  152. package/browser/esm/DUgyehn3re1zGQT5.mjs +0 -10
  153. package/browser/esm/DWOT4LkGXRN4FrJI.mjs +0 -10
  154. package/browser/esm/Dx1J8HBJdbrROP0v.mjs +0 -10
  155. package/browser/esm/Dz8v5MSOgkaH_zTd.mjs +0 -49
  156. package/browser/esm/F7oUe3nLrtaRYTas.mjs +0 -10
  157. package/browser/esm/L5HOBW-m9BjZTUuw.mjs +0 -10
  158. package/browser/esm/XL9-bWRsLjEvW1Y0.mjs +0 -10
  159. package/browser/esm/ZXuNMFT0sYh8ui7O.mjs +0 -1575
  160. package/browser/esm/gX1gbnkwbpalR57F.mjs +0 -12
  161. package/browser/esm/kagl0zcUDaK1IX_X.mjs +0 -10
  162. package/browser/esm/t7CffsKJY64LMXgS.mjs +0 -10
  163. package/browser/esm/x9wy-F3t5pNOvOIp.mjs +0 -425
  164. package/cdn/assets/2sPP8EL_OzSYDsKu.js +0 -10
  165. package/cdn/assets/3SiPV9yNzSbQVINg.js +0 -10
  166. package/cdn/assets/6CkscKSECxQpy0v6.js +0 -10
  167. package/cdn/assets/94SRg1Gxbdr9B75m.js +0 -10
  168. package/cdn/assets/B2I1Hudz2EIGw59h.js +0 -10
  169. package/cdn/assets/B2fqssq7kMsGIg5g.js +0 -10
  170. package/cdn/assets/BBBP9totA24zTbqh.js +0 -10
  171. package/cdn/assets/BD1S4plUUe1NPAqV.js +0 -425
  172. package/cdn/assets/BIHHiMjUvXmWQ6w_.js +0 -10
  173. package/cdn/assets/BYRVuU6FUEX6XBFW.js +0 -10
  174. package/cdn/assets/Bs6fth_bBoNrYDwE.js +0 -21
  175. package/cdn/assets/BzlAT8jiYfNV3kGy.js +0 -820
  176. package/cdn/assets/C0U_bX9Hj97edVC9.js +0 -10
  177. package/cdn/assets/CC8aO_pPT-tkJK_H.js +0 -10
  178. package/cdn/assets/CGxu5NKxrEXE8QIe.js +0 -24
  179. package/cdn/assets/CJOmvmuvywU33q7C.js +0 -3934
  180. package/cdn/assets/CbTDhJiJfpR6Btxp.js +0 -10
  181. package/cdn/assets/CsUNORBKkJ7f3diG.js +0 -10
  182. package/cdn/assets/DBq5E3hmvVO5ss1V.js +0 -5582
  183. package/cdn/assets/DT09m4FGTu5N2LZJ.js +0 -10
  184. package/cdn/assets/DUgyehn3re1zGQT5.js +0 -10
  185. package/cdn/assets/DWOT4LkGXRN4FrJI.js +0 -10
  186. package/cdn/assets/Det1P4Jrl9aZHFGe.js +0 -472
  187. package/cdn/assets/Dt3qIbvMvgQhNgeR.js +0 -1575
  188. package/cdn/assets/Dx1J8HBJdbrROP0v.js +0 -10
  189. package/cdn/assets/F7oUe3nLrtaRYTas.js +0 -10
  190. package/cdn/assets/L5HOBW-m9BjZTUuw.js +0 -10
  191. package/cdn/assets/U_ihCP2tbaRnqD2g.js +0 -48366
  192. package/cdn/assets/XL9-bWRsLjEvW1Y0.js +0 -10
  193. package/cdn/assets/Z4Ov3rzhXnezd-gU.js +0 -29
  194. package/cdn/assets/dR_uwa9znq6_hDmB.js +0 -49
  195. package/cdn/assets/gX1gbnkwbpalR57F.js +0 -12
  196. package/cdn/assets/kagl0zcUDaK1IX_X.js +0 -10
  197. package/cdn/assets/t7CffsKJY64LMXgS.js +0 -10
@@ -1,1501 +0,0 @@
1
- "use strict";/**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.3.4
3
- *
4
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let c=class{constructor(e){this._worker=null,this._nextId=1,this._pendingRequests=new Map,this._workerFactory=e}start(){if(typeof Worker>"u")throw new Error("Web Workers are not supported in this environment.");return this._worker||(this._worker=this._workerFactory(),this._worker.onmessage=e=>{const{id:n,result:t,error:r}=e.data,o=this._pendingRequests.get(n);if(o)if(this._pendingRequests.delete(n),r){const i=new Error(r.message);i.stack=r.stack,r.cause&&(i.cause=r.cause),o.reject(i)}else o.resolve(t)},this._worker.onerror=e=>{console.error("Worker error:",e),this._pendingRequests.forEach(n=>{n.reject(new Error(`Worker failed: ${e.message}`))}),this._pendingRequests.clear(),this._worker=null}),Promise.resolve()}execute(e){if(!this._worker)throw new Error("Worker is not initialized. Call start() first.");const n=this._nextId++;return new Promise((t,r)=>{this._pendingRequests.set(n,{resolve:t,reject:r}),this._worker.postMessage({id:n,params:e})})}terminate(){this._worker&&(this._worker.terminate(),this._worker=null)}};class u{constructor(n){this._onExecute=n}execute(n){return this._onExecute(n)}start(){return Promise.resolve()}terminate(){}}const s=`/**
7
- * @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.3.4
8
- *
9
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
10
- * License: The license can be found at https://www.sheetxl.com/license.
11
- */
12
- const W = { Number: "n", String: "s", Boolean: "b", Error: "e", Null: "z" };
13
- var Re, ae, d;
14
- (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) => {
15
- 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!" };
16
- class t extends Error {
17
- constructor(c, m, fe, B) {
18
- super(fe, B), this._label = m, this._code = c, this.details = B;
19
- }
20
- static {
21
- this.code = e.Code.Unknown;
22
- }
23
- get isFormulaError() {
24
- return !0;
25
- }
26
- getLabel() {
27
- return this._label;
28
- }
29
- getCode() {
30
- return this._code;
31
- }
32
- equals(c) {
33
- return !!c && (this._code === c._code || this._code === c.code);
34
- }
35
- get [Symbol.toStringTag]() {
36
- return "[FormulaError]";
37
- }
38
- toString() {
39
- return this.message || this._label;
40
- }
41
- }
42
- e.Known = t;
43
- class r extends t {
44
- constructor(c, m) {
45
- super(e.Code.Parse, e.Label.Parse, c, m);
46
- }
47
- static {
48
- this.code = e.Code.Parse;
49
- }
50
- getDetails() {
51
- const c = this.details;
52
- return { line: c?.line ?? 1, column: c?.column ?? 1, offset: c?.offset ?? 0, length: c?.length ?? 0 };
53
- }
54
- }
55
- e.Parse = r;
56
- class n extends t {
57
- constructor(c, m) {
58
- super(e.Code.Null, e.Label.Null, c, m);
59
- }
60
- static {
61
- this.code = e.Code.Null;
62
- }
63
- }
64
- e.Null = n;
65
- class o extends t {
66
- constructor(c, m) {
67
- super(e.Code.Div0, e.Label.Div0, c, m);
68
- }
69
- static {
70
- this.code = e.Code.Div0;
71
- }
72
- }
73
- e.Div0 = o;
74
- class i extends t {
75
- constructor(c, m) {
76
- super(e.Code.Value, e.Label.Value, c, m);
77
- }
78
- static {
79
- this.code = e.Code.Value;
80
- }
81
- }
82
- e.Value = i;
83
- class a extends t {
84
- constructor(c, m) {
85
- super(e.Code.Ref, e.Label.Ref, c, m);
86
- }
87
- static {
88
- this.code = e.Code.Ref;
89
- }
90
- }
91
- e.Ref = a;
92
- class l extends t {
93
- constructor(c, m) {
94
- super(e.Code.Name, e.Label.Name, c, m);
95
- }
96
- static {
97
- this.code = e.Code.Name;
98
- }
99
- }
100
- e.Name = l;
101
- class u extends t {
102
- constructor(c, m) {
103
- super(e.Code.Num, e.Label.Num, c, m);
104
- }
105
- static {
106
- this.code = e.Code.Num;
107
- }
108
- }
109
- e.Num = u;
110
- class f extends t {
111
- constructor(c, m) {
112
- super(e.Code.NA, e.Label.NA, c, m);
113
- }
114
- static {
115
- this.code = e.Code.NA;
116
- }
117
- }
118
- e.NA = f;
119
- class h extends t {
120
- constructor(c, m) {
121
- super(e.Code.GettingData, e.Label.GettingData, c, m);
122
- }
123
- static {
124
- this.code = e.Code.GettingData;
125
- }
126
- }
127
- e.GettingData = h;
128
- class g extends t {
129
- constructor(c, m) {
130
- super(e.Code.Spill, e.Label.Spill, c, m);
131
- }
132
- static {
133
- this.code = e.Code.Spill;
134
- }
135
- }
136
- e.Spill = g;
137
- class p extends t {
138
- constructor(c, m) {
139
- super(e.Code.Connect, e.Label.Connect, c, m);
140
- }
141
- static {
142
- this.code = e.Code.Connect;
143
- }
144
- }
145
- e.Connect = p;
146
- class y extends t {
147
- constructor(c, m) {
148
- super(e.Code.Blocked, e.Label.Blocked, c, m);
149
- }
150
- static {
151
- this.code = e.Code.Blocked;
152
- }
153
- }
154
- e.Blocked = y;
155
- class T extends t {
156
- constructor(c, m) {
157
- super(e.Code.Unknown, e.Label.Unknown, c, m);
158
- }
159
- static {
160
- this.code = e.Code.Unknown;
161
- }
162
- }
163
- e.Unknown = T;
164
- class A extends t {
165
- constructor(c, m) {
166
- super(e.Code.Field, e.Label.Field, c, m);
167
- }
168
- static {
169
- this.code = e.Code.Field;
170
- }
171
- }
172
- e.Field = A;
173
- class D extends t {
174
- constructor(c, m) {
175
- super(e.Code.Calc, e.Label.Calc, c, m);
176
- }
177
- static {
178
- this.code = e.Code.Calc;
179
- }
180
- }
181
- e.Calc = D;
182
- class U extends t {
183
- constructor(c, m) {
184
- super(e.Code.Busy, e.Label.Busy, c, m);
185
- }
186
- static {
187
- this.code = e.Code.Busy;
188
- }
189
- }
190
- e.Busy = U;
191
- class I extends t {
192
- constructor(c, m) {
193
- super(e.Code.Python, e.Label.Python, c, m);
194
- }
195
- static {
196
- this.code = e.Code.Python;
197
- }
198
- }
199
- e.Python = I;
200
- class J extends t {
201
- constructor(c, m) {
202
- super(e.Code.Timeout, e.Label.Timeout, c, m);
203
- }
204
- static {
205
- this.code = e.Code.Timeout;
206
- }
207
- }
208
- e.Timeout = J;
209
- })(d || (d = {}));
210
- const _ = {};
211
- _[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;
212
- const et = /* @__PURE__ */ new Map(), Te = /* @__PURE__ */ new Map(), tt = /* @__PURE__ */ new Map(), rt = /* @__PURE__ */ new Map(), ke = Object.keys(_);
213
- for (let e = 0; e < ke.length; e++) {
214
- const t = ke[e], r = _[t];
215
- tt.set(d.Label[t], r), rt.set(d.Code[t], r);
216
- const n = new r();
217
- et.set(n.getLabel(), n), Te.set(n.getCode(), n);
218
- }
219
- const Et = Te.get(d.Code.Unknown);
220
- var v;
221
- (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, r) => {
222
- let n;
223
- return n = typeof e == "string" ? tt.get(e) : rt.get(e), n || (n = v.Unknown), new n(t, r);
224
- }, v.getBuiltInById = (e) => Te.get(e) || Et;
225
- /**
226
- * @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.3.4
227
- *
228
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
229
- * License: The license can be found at https://www.sheetxl.com/license.
230
- */
231
- 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 });
232
- Object.freeze(Object.defineProperty({ __proto__: null, EmptyBounds: Ct, EmptyRect: xt, EmptyTopLeft: St }, Symbol.toStringTag, { value: "Module" }));
233
- const j = { Column: "column", Row: "row" }, vt = Object.freeze({ colIndex: 0, rowIndex: 0 }), Tt = Object.freeze({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }), nt = (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 : nt, 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) => {
234
- if (e === t) return !0;
235
- if (!e || !t || e.length !== t.length) return !1;
236
- for (let r = 0; r < e.length; r++) if (!Se(e[r], t[r])) return !1;
237
- return !0;
238
- }, he = (e, t, r) => {
239
- if (!e && !t) return null;
240
- if (!e) return r ? t : { ...t };
241
- if (!t) return r ? e : { ...e };
242
- const n = 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);
243
- let l = r;
244
- return l ? (l.colStart = n, l.rowStart = o, l.colEnd = i, l.rowEnd = a) : l = { colStart: n, rowStart: o, colEnd: i, rowEnd: a }, l;
245
- }, Pe = (e, t) => {
246
- if (!t || t.length === 0) return e;
247
- const r = { ...e };
248
- for (let n = 0; n < t.length; n++) {
249
- const o = t[n];
250
- xe(r, o) && (r.rowStart = Math.min(r.rowStart, o.rowStart), r.colStart = Math.min(r.colStart, o.colStart), r.rowEnd = Math.max(r.rowEnd, o.rowEnd), r.colEnd = Math.max(r.colEnd, o.colEnd));
251
- }
252
- return r;
253
- }, It = [null, null], Nt = (e, t, r) => {
254
- if (e[0].value === e[1].value) return t;
255
- };
256
- function Fe(e, t = 2, r, n = j.Row, o) {
257
- let i = [...e];
258
- if (t <= 0 || e.length <= 1) return i;
259
- let a = n === j.Column, l = 0, u = !1;
260
- do {
261
- const f = i.sort(it(a ? j.Row : j.Column));
262
- i = [], i.push(f[0]);
263
- const h = f.length;
264
- let g = 0, p = f[0], y = p.colStart, T = p.rowStart, A = p.colEnd, D = p.rowEnd;
265
- for (let U = 1; U < h; U++) {
266
- const I = f[U];
267
- let J = !1;
268
- 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) {
269
- let E = { colStart: y, rowStart: T, colEnd: a ? I.colEnd : A, rowEnd: a ? D : I.rowEnd };
270
- if (p.value !== void 0 && (E.value = p.value), r) {
271
- const c = o ?? [null, null];
272
- c[0] = p, c[1] = I, E = r(c, E, n);
273
- }
274
- if (E) {
275
- i[g] = E, u = !0, p = E, y = p.colStart, T = p.rowStart, A = p.colEnd, D = p.rowEnd;
276
- continue;
277
- }
278
- }
279
- i[++g] = I, p = I, y = p.colStart, T = p.rowStart, A = p.colEnd, D = p.rowEnd;
280
- }
281
- l++, a = !a, l === 1 && (u = !0);
282
- } while (l < t && u && i.length > 1);
283
- return i;
284
- }
285
- Object.freeze(Object.defineProperty({ __proto__: null, EmptyCell: vt, EmptyRange: Tt, cellToRange: (e, t) => {
286
- if (!e) return null;
287
- let r = t;
288
- return r || (r = { ...e }, delete r.colIndex, delete r.rowIndex), r.colStart = e.colIndex ?? 0, r.rowStart = e.rowIndex ?? 0, r.colEnd = e.colIndex ?? 0, r.rowEnd = e.rowIndex ?? 0, r;
289
- }, columnFirstCellComparator: Le, columnFirstRangeComparator: nt, createCellComparator: (e = j.Row, t = !1) => t ? e !== j.Column ? (r, n) => r.rowIndex === n.rowIndex ? n.colIndex - r.colIndex : n.rowIndex - r.rowIndex : (r, n) => r.colIndex === n.colIndex ? n.rowIndex - r.rowIndex : n.colIndex - r.colIndex : e !== j.Column ? Ae : Le, createConflatingRanges: (e, t = !1) => {
290
- const r = [];
291
- let n, o, i = Number.MIN_SAFE_INTEGER, a = Number.MIN_SAFE_INTEGER;
292
- return { append: (l, u, f) => {
293
- let h = !0;
294
- const g = f !== void 0;
295
- if (g) {
296
- const T = e ? e(o, f, t) : o === f ? f : void 0;
297
- T === void 0 ? h = !1 : f = T;
298
- }
299
- if (h && u === a + 1 && l === i) return t ? n.rowEnd = u : n.colEnd = u, a = u, void (o = f);
300
- n && r.push(n);
301
- const p = t ? l : u, y = t ? u : l;
302
- n = { colStart: p, rowStart: y, colEnd: p, rowEnd: y }, g && (n.value = f), i = l, a = u, o = f;
303
- }, done: (l) => (n && (r.push(n), n = null), l ? Fe(r, 3, l === !0 ? Nt : l, t ? j.Column : j.Row, It) : r) };
304
- }, createRangeComparator: it, defaultRange: (e, t, r) => e ? r ? (r.colStart = e.colStart ?? t.colStart, r.rowStart = e.rowStart ?? t.rowStart, r.colEnd = e.colEnd ?? t.colEnd, r.rowEnd = e.rowEnd ?? t.rowEnd, r) : { 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) => {
305
- if (!t || t.length === 0) return e;
306
- let r = e, n = null;
307
- for (; !Se(r, n); ) n = r, r = Pe(n, t);
308
- return r;
309
- }, indexOfCoords: (e, t) => {
310
- const r = { colStart: e.colIndex, rowStart: e.rowIndex, colEnd: e.colIndex, rowEnd: e.rowIndex };
311
- for (let n = t.length - 1; n >= 0; n--) if (xe(r, t[n])) return n;
312
- return -1;
313
- }, intersectRanges: (e, t, r) => {
314
- if (!e) return r ? t : { ...t };
315
- if (!t) return r ? e : { ...e };
316
- if (!e && !t || e.rowStart > t.rowEnd || e.rowEnd < t.rowStart || e.colStart > t.colEnd || e.colEnd < t.colStart) return null;
317
- const n = 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);
318
- let l = r;
319
- return l ? (l.colStart = n, l.rowStart = o, l.colEnd = i, l.rowEnd = a) : l = { colStart: n, rowStart: o, colEnd: i, rowEnd: a }, l;
320
- }, 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, r = -e.colStart, n) => n ? (n.colStart = e.colStart + r, n.rowStart = e.rowStart + t, n.colEnd = e.colEnd + r, n.rowEnd = e.rowEnd + t, n) : { colStart: e.colStart + r, rowStart: e.rowStart + t, colEnd: e.colEnd + r, rowEnd: e.rowEnd + t }, unionRanges: he, unionRangesArrays: (e, t, r) => {
321
- if (!e || e.length === 0) return null;
322
- if (e.length === 1 && !t) return e[0];
323
- let n = e[0];
324
- for (let o = 1; o < e.length; o++) n = he(n, e[o], r);
325
- return t && (n = he(n, t, r)), n;
326
- } }, Symbol.toStringTag, { value: "Module" }));
327
- function Rt(e) {
328
- const t = Object.prototype.toString.call(e);
329
- return t === "[object RegExp]" || t === "[object Date]" || function(r) {
330
- return r.$$typeof === kt;
331
- }(e);
332
- }
333
- const kt = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.element") : 60103;
334
- function Lt(e) {
335
- return /* @__PURE__ */ function(t) {
336
- return !!t && typeof t == "object";
337
- }(e) && !Rt(e);
338
- }
339
- function ne(e, t) {
340
- return t.clone !== !1 && t.isMergeableObject(e) ? Y((r = e, Array.isArray(r) ? [] : {}), e, t) : e;
341
- var r;
342
- }
343
- function At(e, t, r) {
344
- return e.concat(t).map(function(n) {
345
- return ne(n, r);
346
- });
347
- }
348
- function De(e) {
349
- return Object.keys(e).concat(function(t) {
350
- return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(r) {
351
- return Object.propertyIsEnumerable.call(t, r);
352
- }) : [];
353
- }(e));
354
- }
355
- function Ue(e, t) {
356
- try {
357
- return t in e;
358
- } catch {
359
- return !1;
360
- }
361
- }
362
- function Mt(e, t, r) {
363
- const n = {};
364
- return r.isMergeableObject(e) && De(e).forEach(function(o) {
365
- n[o] = ne(e[o], r);
366
- }), De(t).forEach(function(o) {
367
- (function(i, a) {
368
- return Ue(i, a) && !(Object.hasOwnProperty.call(i, a) && Object.propertyIsEnumerable.call(i, a));
369
- })(e, o) || (Ue(e, o) && r.isMergeableObject(t[o]) ? n[o] = function(i, a) {
370
- if (!a.customMerge) return Y;
371
- const l = a.customMerge(i);
372
- return typeof l == "function" ? l : Y;
373
- }(o, r)(e[o], t[o], r) : n[o] = ne(t[o], r));
374
- }), n;
375
- }
376
- function Y(e, t, r) {
377
- (r = r || {}).arrayMerge = r.arrayMerge || At, r.isMergeableObject = r.isMergeableObject || Lt, r.cloneUnlessOtherwiseSpecified = ne;
378
- const n = Array.isArray(t);
379
- return n === Array.isArray(e) ? n ? r.arrayMerge(e, t, r) : Mt(e, t, r) : ne(t, r);
380
- }
381
- Y.all = function(e, t) {
382
- if (!Array.isArray(e)) throw new Error("first argument should be an array");
383
- return e.reduce(function(r, n) {
384
- return Y(r, n, t);
385
- }, {});
386
- };
387
- const jt = Object.freeze([]), Pt = Object.freeze({}), Be = (e) => e, de = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
388
- let t = 16 * Math.random() | 0;
389
- return (e === "x" ? t : 3 & t | 8).toString(16);
390
- }), Ft = (e) => 1 * e, at = (e, t) => e === t || !(!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length) && e.every((r, n) => r === t[n]), re = (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) {
391
- 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];
392
- }), Object.keys(e).length === 0 ? null : e), Dt = (e, t) => !(e !== t && !at(e, t)) || !!e.isEqual?.(t), st = (e, t, r = Dt) => {
393
- if (e == null || e === t) return null;
394
- if (!e || typeof e != "object" || Array.isArray(e) || e.isImmutable?.()) return r(e, t) ? null : e;
395
- const n = Object.keys(e);
396
- if (n.length === 0) return null;
397
- let o = !1;
398
- for (let i = 0; i < n.length; i++) {
399
- const a = n[i];
400
- st(e[a], t?.[a], r) === null && (o = !0, delete e[a]);
401
- }
402
- return o && Object.keys(e).length === 0 ? null : void 0;
403
- }, $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 = () => {
404
- if (ct()) return k.Node;
405
- const e = globalThis.navigator !== void 0 && globalThis.navigator.userAgent ? globalThis.navigator.userAgent.toLowerCase() : "";
406
- 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;
407
- };
408
- function ct() {
409
- return typeof process < "u" && process.release?.name === "node" || (typeof process < "u" && process.browser, !1);
410
- }
411
- 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, r) {
412
- const n = e.slice();
413
- return n.splice(r < 0 ? n.length + r : r, 0, n.splice(t, 1)[0]), n;
414
- }, asNumber: (e) => {
415
- const t = Ft(e);
416
- return Number.isFinite(t) ? t : 0;
417
- }, camelToPrettyCase: (e) => e.length === 1 ? e.toUpperCase() : e.replace(/([A-Z])/g, " $1").replace(/^./, function(t) {
418
- return t.toUpperCase();
419
- }).trim(), canUseDOM: Ve, cancelTimeout: (e) => {
420
- cancelAnimationFrame(e.id);
421
- }, 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) => {
422
- setTimeout(() => {
423
- Function("console.log.apply(console, arguments)").apply(null, e), t();
424
- });
425
- }), debounce: function(e, t = 300, r = !1) {
426
- let n, o, i, a, l = 0;
427
- function u() {
428
- let h = Date.now() - l;
429
- h < t && h >= 0 ? n = setTimeout(u, t - h) : (n = null, r || (a = e.apply(i, o), i = o = null));
430
- }
431
- t == null && (t = 100);
432
- const f = function() {
433
- i = globalThis, o = arguments, l = Date.now();
434
- var h = r && !n;
435
- return n || (n = setTimeout(u, t)), h && (a = e.apply(i, o), i = o = null), a;
436
- };
437
- return f.clear = function() {
438
- n && (clearTimeout(n), n = null);
439
- }, f.flush = function() {
440
- n && (a = e.apply(i, o), i = o = null, clearTimeout(n), n = null);
441
- }, f;
442
- }, deepEqual: function e(t, r) {
443
- if (t === r) return !0;
444
- if (t && r && typeof t == "object" && typeof r == "object") {
445
- if (t.constructor !== r.constructor) return !1;
446
- let n, o, i;
447
- if (Array.isArray(t)) {
448
- if (n = t.length, n != r.length) return !1;
449
- for (o = n; o-- !== 0; ) if (!e(t[o], r[o])) return !1;
450
- return !0;
451
- }
452
- if (t instanceof Map && r instanceof Map) {
453
- if (t.size !== r.size) return !1;
454
- for (o of t.entries()) if (!r.has(o[0])) return !1;
455
- for (o of t.entries()) if (!e(o[1], r.get(o[0]))) return !1;
456
- return !0;
457
- }
458
- if (t instanceof Set && r instanceof Set) {
459
- if (t.size !== r.size) return !1;
460
- for (o of t.entries()) if (!r.has(o[0])) return !1;
461
- return !0;
462
- }
463
- if (ArrayBuffer.isView(t) && ArrayBuffer.isView(r)) {
464
- if (n = t.length, n != r.length) return !1;
465
- for (o = n; o-- !== 0; ) if (t[o] !== r[o]) return !1;
466
- return !0;
467
- }
468
- if (t.constructor === RegExp) return t.source === r.source && t.flags === r.flags;
469
- if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === r.valueOf();
470
- if (t.toString !== Object.prototype.toString) return t.toString() === r.toString();
471
- if (i = Object.keys(t), n = i.length, n !== Object.keys(r).length) return !1;
472
- for (o = n; o-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(r, i[o])) return !1;
473
- for (o = n; o-- !== 0; ) {
474
- let a = i[o];
475
- if ((a !== "_owner" || !t.$$typeof) && !e(t[a], r[a])) return !1;
476
- }
477
- return !0;
478
- }
479
- return t != t && r != r;
480
- }, deepFreeze: function e(t) {
481
- return Object.freeze(t), Object.keys(t).forEach((r) => {
482
- typeof t[r] != "object" || t[r] === null || Object.isFrozen(t[r]) || e(t[r]);
483
- }), t;
484
- }, deepMerge: Y, diffValues: (e, t) => {
485
- const r = {}, n = Object.keys(t), o = n.length;
486
- for (let i = 0; i < o; i++) {
487
- const a = n[i];
488
- e[a] !== t[a] && (e[a] === void 0 ? r[a] = t[a] : r[a] = e[a]);
489
- }
490
- return Object.keys(r).length === 0 ? null : r;
491
- }, findEqualOrGreater: function(e, t, r = Be) {
492
- let n = 0, o = e.length - 1;
493
- for (; n <= o; ) {
494
- let i = Math.floor((n + o) / 2), a = r(e[i]);
495
- if (a === t) return i;
496
- a < t ? n = i + 1 : o = i - 1;
497
- }
498
- return n;
499
- }, findEqualOrLesser: function(e, t, r = Be) {
500
- let n = e.length - 1, o = 0;
501
- for (; n >= o; ) {
502
- let i = Math.floor((n + o) / 2), a = r(e[i]);
503
- if (a === t) return i;
504
- a > t ? n = i - 1 : o = i + 1;
505
- }
506
- return n;
507
- }, findNextStep: (e, t = !0, r = 15, n = 10, o = 400) => {
508
- const i = Math.max(e - n, 0) + (t ? 1 : -1);
509
- return Math.min(o, Math[t ? "ceil" : "floor"](i / r) * r + n);
510
- }, getDPI: () => {
511
- let e = 1;
512
- return typeof window == "object" && (e = window.devicePixelRatio || 1), e;
513
- }, getFromPath: (e, t) => {
514
- const r = t.split(".");
515
- let n = e;
516
- for (let o = 0; o < r.length; o++) {
517
- const i = r[o];
518
- if (!n) return null;
519
- let a = n[i];
520
- if (typeof a == "function" && (a = a.bind(n)()), !a || !re(a)) return a;
521
- n = a;
522
- }
523
- return n ?? null;
524
- }, 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) => {
525
- if (e === t) return !0;
526
- if (e && !t || t && !e) return !1;
527
- const r = Object.keys(e);
528
- if (r.length !== Object.keys(t).length) return !1;
529
- for (let n = 0; n < r.length; n++) if (e[r[n]] !== t[r[n]]) return !1;
530
- return !0;
531
- }, isNode: ct, isNullOrUndefined: ze, isNumeric: (e) => {
532
- const t = 1 * e;
533
- return Number.isFinite(t) && typeof t == "number";
534
- }, isObject: re, 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) => {
535
- const t = e.length;
536
- if (t > 0 && e[t - 1] !== void 0 && !re(e[t - 1])) return e[t - 1];
537
- let r = e[0] || {};
538
- for (let n = 1; n < t; n++) r = Y(r, e[n] || {}, { arrayMerge: (o, i) => [...i] });
539
- return r;
540
- }, nextTick: (e) => {
541
- typeof window < "u" && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame(() => {
542
- e();
543
- }) : (typeof setImmediate == "function" ? setImmediate : setTimeout)(() => {
544
- e();
545
- });
546
- }, openFileDialog: (e = "*.*") => new Promise((t, r) => {
547
- if (!Ve) return void r("Unable to open dialog with no dom.");
548
- const n = document.createElement("input");
549
- n.type = "file", n.accept = e;
550
- let o = null, i = !1;
551
- globalThis.addEventListener?.("focus", () => {
552
- setTimeout(() => {
553
- o || i || (i = !0, t(null));
554
- }, 1e3);
555
- }, { once: !0, passive: !0 }), n.onchange = () => {
556
- if (o = n.files[0], o) {
557
- if (i) return void console.warn("File open detected after faux cancel.", o);
558
- t(o);
559
- }
560
- }, n.autofocus = !0, n.click();
561
- }), rafThrottle: (e) => {
562
- let t, r = !1, n = function() {
563
- r = !1, e(t);
564
- };
565
- return function(o) {
566
- t = o, t && t.persist && t.persist(), r || (r = !0, requestAnimationFrame(n));
567
- };
568
- }, removeEmptyProperties: lt, removeEqualValues: st, removeListenerAll: (e) => {
569
- if (!e) return [];
570
- for (let t = 0; t < e.length; t++) e[t] && e[t]();
571
- return [];
572
- }, requestTimeout: (e, t) => {
573
- const r = $e(), n = { id: requestAnimationFrame(function o() {
574
- $e() - r >= t ? e.call(null) : n.id = requestAnimationFrame(o);
575
- }) };
576
- return n;
577
- }, roundAccurately: (e, t = 0) => {
578
- if (e == null || !isFinite(e)) return null;
579
- const r = 10 ** t;
580
- return Number(Math.round(e * r) / r);
581
- }, setToPath: (e, t, r) => {
582
- const n = t.split(".");
583
- let o = e;
584
- if (!o) throw new Error("Can not set path to a null path.");
585
- for (let i = 0; o && i < n.length - 1; i++) {
586
- const a = n[i];
587
- let l = o[a];
588
- if (l == null && (l = {}, o[a] = l), !re(l)) throw new Error("Can not set path to a non object path.");
589
- o = l;
590
- }
591
- if (typeof r != "number" && typeof r != "boolean" && typeof r != "string" && !re(r)) throw new Error(\`Can not set path to \${r} that is not a a supported primitive.\`);
592
- return o[n[n.length - 1]] = r, e;
593
- }, splitNumber: (e) => {
594
- let t = Math.abs(e);
595
- if (isNaN(t) || !isFinite(e)) return null;
596
- let r = 0 | t, n = t - r, o = 0, i = 0, a = 1;
597
- if (n > 5e-8) for (; i < 8 && Math.abs(o / a - n) > 5e-8; ) i++, a *= 10, o = Math.round(n * a);
598
- return { ip: Math.trunc(e), fp: o, ipLength: Math.ceil(Math.log10(r + 1)), fpLength: i };
599
- }, subtractRect: (e, t, r = !1) => {
600
- if (!t) return [e];
601
- if (!Ke(e, t)) return [];
602
- const n = [];
603
- let o = e;
604
- const i = () => {
605
- t.top > o.top && t.top < o.bottom && (n.push({ ...o, bottom: t.top }), o = { ...o, top: t.top });
606
- }, a = () => {
607
- t.bottom > o.top && t.bottom < o.bottom && (n.push({ ...o, top: t.bottom }), o = { ...o, bottom: t.bottom });
608
- }, l = () => {
609
- t.right > o.left && t.right < o.right && (n.push({ ...o, left: t.right }), o = { ...o, right: t.right });
610
- }, u = () => {
611
- t.left > o.left && t.left < o.right && (n.push({ ...o, right: t.left }), o = { ...o, left: t.left });
612
- };
613
- return r ? (u(), l(), i(), a()) : (i(), a(), l(), u()), n;
614
- }, textToKey: (e) => e.replace(/[^a-zA-Z0-9]/g, "").toLowerCase(), throttle: function(e, t) {
615
- let r = null;
616
- return (...n) => {
617
- const o = Date.now();
618
- (!r || o - r >= t) && (r = o, e(...n));
619
- };
620
- }, toSafeJSON: function e(t) {
621
- if (t === null || typeof t != "object") return t;
622
- if (typeof t.toJSON == "function") return t.toJSON();
623
- if (Array.isArray(t)) return t.map((n) => e(n));
624
- if (typeof t.toString == "function" && t.toString !== Object.prototype.toString) return t.toString();
625
- const r = {};
626
- for (const n in t) t.hasOwnProperty(n) && (r[n] = e(t[n]));
627
- return r;
628
- }, transpose: (e) => {
629
- if (!e) return e;
630
- const t = e.length, r = e[0].length, n = [];
631
- for (let o = 0; o < r; o++) n[o] = Array(t);
632
- for (let o = 0; o < t; o++) for (let i = 0; i < r; i++) n[i][o] = e[o][i];
633
- return n;
634
- }, uuidV4: de, validEnumValue: (e, t) => {
635
- if (!Object.values(e).includes(t)) throw new Error(\`Invalid type: \${t ?? "null"}. Must be one of: \${Object.values(t).join(", ")}.\`);
636
- }, whenFocus: async (e, t = !1) => new Promise((r) => {
637
- qe(e, t) ? r(!0) : e.addEventListener("focusin", () => {
638
- r(!0);
639
- }, { once: !0 }), e.focus();
640
- }) }, Symbol.toStringTag, { value: "Module" }));
641
- Object.freeze(Object.defineProperty({ __proto__: null, MESSAGE_ERROR_INVALID_ARG: (e) => \`Invalid argument: '\${e}'.\` }, Symbol.toStringTag, { value: "Module" }));
642
- const ut = (e) => {
643
- const t = new Uint8Array(e), r = t.byteLength;
644
- let n = "";
645
- for (let o = 0; o < r; o++) n += String.fromCharCode(t[o]);
646
- if (typeof window < "u" && typeof globalThis.btoa == "function") return globalThis.btoa(n);
647
- if (typeof Buffer < "u") return Buffer.from(n, "binary").toString("base64");
648
- throw new Error("Unsupported environment");
649
- }, Ce = (e) => new Promise((t, r) => {
650
- if (e) if (typeof FileReader < "u") {
651
- const n = new FileReader();
652
- n.onload = () => {
653
- t(n.result);
654
- }, n.onerror = () => {
655
- r(n.error);
656
- }, n.readAsText(e);
657
- } else if (typeof Buffer < "u") {
658
- const n = (o) => Buffer.from(o).toString("utf-8");
659
- e.arrayBuffer().then((o) => {
660
- t(n(o));
661
- }).catch((o) => {
662
- r(o);
663
- });
664
- } else r(new Error("Unsupported environment"));
665
- else t("");
666
- });
667
- Object.freeze(Object.defineProperty({ __proto__: null, DEFAULT_MIME_TYPE: "*/*", arrayBufferToBase64: ut, base64ToArrayBuffer: (e) => {
668
- const t = typeof window < "u" && typeof globalThis.atob == "function" ? globalThis.atob(e) : Buffer.from(e, "base64").toString("binary"), r = t.length, n = new Uint8Array(r);
669
- for (let o = 0; o < r; o++) n[o] = t.charCodeAt(o);
670
- return n.buffer;
671
- }, blobToString: Ce }, Symbol.toStringTag, { value: "Module" }));
672
- const dt = "data:image/png;base64,", ft = "Unable to resolve image.", Ge = (e) => new Promise(async (t, r) => {
673
- let n = null;
674
- try {
675
- n = new Image(), n.src = e, n.addEventListener("load", function() {
676
- t({ width: n.naturalWidth, height: n.naturalHeight });
677
- }, { once: !0 }), n.addEventListener("error", function() {
678
- URL.revokeObjectURL(e), r("Invalid Image");
679
- }, { once: !0 }), await n.decode("sync");
680
- } catch {
681
- n?.src && URL.revokeObjectURL(n.src);
682
- }
683
- n || r(ft);
684
- }), we = "image/svg+xml";
685
- Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: dt, getImageDataUrl: (e, t = 1) => new Promise(async (r, n) => {
686
- let o = null;
687
- try {
688
- o = new Image(), o.src = e, o.addEventListener("load", function() {
689
- try {
690
- const i = document.createElement("canvas");
691
- i.width = o.naturalWidth, i.height = o.naturalHeight, i.getContext("2d").drawImage(o, 0, 0);
692
- const a = i.toDataURL("image/png", t);
693
- r({ elemImg: o, dataUrl: a });
694
- } catch (i) {
695
- URL.revokeObjectURL(e), n(i);
696
- }
697
- }, { once: !0 }), o.addEventListener("error", function() {
698
- URL.revokeObjectURL(e), n("Invalid Image");
699
- }, { once: !0 }), await o.decode("sync");
700
- } catch {
701
- o?.src && URL.revokeObjectURL(o.src);
702
- }
703
- o || n(ft);
704
- }), loadImageDetails: async (e, t = null) => {
705
- let r = null;
706
- const n = async () => {
707
- try {
708
- const i = t ?? "image/*", a = URL.createObjectURL(new Blob([e], { type: i })), l = await Ge(a);
709
- r = { mimeType: i, naturalDimensions: l, asUrl: a };
710
- } catch {
711
- }
712
- }, o = async () => {
713
- try {
714
- const i = new TextDecoder().decode(e), a = URL.createObjectURL(new Blob([i], { type: we })), l = await Ge(a);
715
- r = { mimeType: t ?? we, naturalDimensions: l, asUrl: a, asSVGText: i };
716
- } catch {
717
- }
718
- };
719
- if (t === we ? await o() : t.startsWith("image/") ? await n() : (await n(), r || await o()), !r) throw new Error("Failed to load image");
720
- return r;
721
- } }, Symbol.toStringTag, { value: "Module" }));
722
- var We, Ye;
723
- (Ye = We || (We = {})).resolveTypedUpdates = (e, t, r, n) => {
724
- if (e === null) return e;
725
- if (e === void 0) return n;
726
- let o = e;
727
- if (t?.shorthand) {
728
- const u = t?.shorthand(e, r);
729
- u !== void 0 && (o = u);
730
- }
731
- if (o !== null && t?.getSubType) {
732
- const u = t.getSubType(o);
733
- u && (t = u);
734
- }
735
- const i = t?.properties, a = t?.arrayType ?? !1;
736
- let l = o;
737
- if (t && t.merge && l && n) l = t.merge(l, n, r);
738
- else if (!a && i) {
739
- const u = Object.keys({ ...o, ...n });
740
- l = null;
741
- for (let f = 0; f < u.length; f++) {
742
- const h = u[f];
743
- let g, p = o[h];
744
- if (p !== void 0) {
745
- const y = i[h];
746
- g = y ? (0, Ye.resolveTypedUpdates)(p, y, r, n?.[h]) : p;
747
- } else g = n?.[h];
748
- g != null && (l = l ?? {}, l[h] = g);
749
- }
750
- }
751
- return l;
752
- };
753
- const Je = \`The Safari browser does not support advanced copy and paste.
754
- Copy and paste will be limited to within the browser tab.
755
-
756
- Please use Chrome or Edge if external copy and paste is required.\`, ye = \`You do not have permissions to access the clipboard.
757
- All copy and paste operations will be limited to the browser tab.\`, pt = { Safari: \`The Safari browser does not support advanced copy and paste.
758
- Copy and paste will be limited to within the browser tab.
759
-
760
- 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) => {
761
- document.hasFocus() ? e() : globalThis.addEventListener?.("focus", () => {
762
- e();
763
- }, { once: !0 }), document.activeElement.focus?.();
764
- }), be = async (e, t, r) => {
765
- if (oe() === k.Safari) return await r(new Error(pt.Safari));
766
- try {
767
- const n = async (a) => {
768
- try {
769
- return await a();
770
- } catch (l) {
771
- if (l.message?.includes("Document is not focused")) return !1;
772
- throw l;
773
- }
774
- }, o = await globalThis?.navigator?.permissions?.query({ name: e, allowWithoutGesture: !0, allowWithoutSanitization: !0 });
775
- let i = !1;
776
- if (o.state === "prompt" && (i = await n(t)), i || o.state !== "granted" || (i = await t()), !i) return await r(new Error(o.state));
777
- } catch (n) {
778
- return n.message === "No valid data on clipboard" || n.name === "DataError" ? void 0 : await r(n);
779
- }
780
- }, mt = async (e) => {
781
- try {
782
- return await e.read({ unsanitized: [S.html] });
783
- } catch {
784
- }
785
- return await e.read();
786
- }, Bt = async (e, t) => {
787
- if (!e) return null;
788
- const r = await mt(e);
789
- let n = !1;
790
- for (let o = 0; !n && r && o < r.length; o++) if (n = r[o].types.includes(t), n)
791
- return await r[o].getType(t);
792
- return n ? void 0 : null;
793
- };
794
- if (!globalThis.ClipboardItem) {
795
- const e = (r, n) => new Blob([n], { type: r });
796
- class t {
797
- constructor(n, o) {
798
- this._items = {}, this._types = Object.keys(n);
799
- const i = {}, a = Object.keys(n);
800
- for (let l = 0; l < a.length; l++) {
801
- const u = a[l];
802
- let f = n[u];
803
- i[u] = typeof f == "string" ? e(u, f) : f;
804
- }
805
- this._items = i, this._presentationStyle = o?.presentationStyle ?? "unspecified";
806
- }
807
- get types() {
808
- return this._types;
809
- }
810
- getType(n) {
811
- return Promise.resolve(this._items[n]);
812
- }
813
- supports(n) {
814
- return !0;
815
- }
816
- }
817
- globalThis.ClipboardItem = t;
818
- }
819
- const ve = async (e, t = S.html) => new Promise(async (r, n) => {
820
- try {
821
- const o = await Bt(e, t);
822
- if (o) {
823
- const i = new FileReader();
824
- i.onload = () => {
825
- r(i.result);
826
- }, i.onerror = () => {
827
- r("");
828
- }, i.readAsText(o);
829
- } else r("");
830
- } catch (o) {
831
- n(o);
832
- }
833
- }), He = async (e, t = S.html) => {
834
- const r = await ve(e, t);
835
- if (!r) return null;
836
- let n = null;
837
- try {
838
- n = new DOMParser().parseFromString(r, S.html);
839
- } catch {
840
- console.warn("Can't parse html from clipboard.");
841
- }
842
- return n;
843
- }, $t = async (e) => {
844
- e && await e.writeText("");
845
- }, ie = "clipboard-uuid", Q = "web text/uuid", Xe = (e) => \`<div style="display:none" \${ie}="\${e}"/>\`, zt = (e, t) => {
846
- let r = null;
847
- try {
848
- const n = new DOMParser().parseFromString(t, S.html);
849
- n.body.firstElementChild.setAttribute(ie, e), r = n.getElementsByTagName("body")[0].innerHTML;
850
- } catch (n) {
851
- console.warn("Can't embed uuid.", n);
852
- }
853
- return r;
854
- }, Ze = (e, t) => {
855
- if (!t || !e) return !1;
856
- try {
857
- const r = t.querySelectorAll(\`[\${ie}="\${e}"]\`);
858
- if (r && r.length === 1) return !0;
859
- if (t.querySelector("parsererror")) throw new Error("We are unable to parse node");
860
- return !1;
861
- } catch {
862
- return !1;
863
- }
864
- };
865
- class Qe {
866
- constructor(t) {
867
- if (t?.nativeClipboard === void 0 || t?.nativeClipboard === !0) try {
868
- this._nativeClipboard = globalThis?.navigator.clipboard;
869
- } catch {
870
- t?.nativeClipboard === !0 && console.warn("NativeClipboard option set to true but no native clipboard available.");
871
- }
872
- else this._nativeClipboard = t?.nativeClipboard === !1 ? null : t?.nativeClipboard;
873
- this._disableCheckOnFocus = t?.disableCheckOnFocus ?? !1, this._init();
874
- }
875
- async _checkForChanges() {
876
- this._nativeClipboard && this._state && !this._disableCheckOnFocus && await be("clipboard-read", async () => {
877
- await ge();
878
- const t = await ve(this._nativeClipboard, Q);
879
- if (!this._state || t && t === this._state.uuid) return !0;
880
- const r = await He(this._nativeClipboard, S.html);
881
- return !this._state || (Ze(this._state.uuid, r) || this.clear(), !0);
882
- }, async (t) => {
883
- t?.message === "denied" || t.message?.includes("Document is not focused") || oe() === k.Safari || console.warn("Unable to detect clipboard changes: ", t);
884
- });
885
- }
886
- _init() {
887
- const t = this;
888
- this._listeners = /* @__PURE__ */ new Map(), this._listenersCapture = /* @__PURE__ */ new Map(), this._state = null, this._nativeClipboard && (this._onFocus = () => {
889
- t._checkForChanges();
890
- }, this._onBlur = () => {
891
- globalThis.addEventListener?.("focus", t._onFocus, { once: !0 });
892
- }, globalThis.addEventListener?.("blur", this._onBlur), this._nativeClipboard.addEventListener("clipboardchange", (r) => {
893
- t._checkForChanges();
894
- }));
895
- }
896
- async read() {
897
- if (!this._nativeClipboard) return this._state?.items ?? null;
898
- const t = this;
899
- return await be("clipboard-read", async () => {
900
- if (await ge(), this._state?.uuid) {
901
- const r = await ve(this._nativeClipboard, Q);
902
- if (r && r === t._state.uuid) return !0;
903
- const n = await He(this._nativeClipboard, S.html);
904
- if (Ze(t._state?.uuid, n)) return !0;
905
- }
906
- return t._state = { items: await mt(this._nativeClipboard), uuid: null, ref: null }, this.dispatchEvent(new Event("clipboardread")), !0;
907
- }, async (r) => {
908
- this.dispatchEvent(new Event("clipboarderrorread"));
909
- }), this._state?.items ?? [];
910
- }
911
- async write(t) {
912
- return this._write({ uuid: de(), items: t, ref: null });
913
- }
914
- async _write(t) {
915
- if (!this._nativeClipboard) return this._state = t, this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")), null;
916
- const r = this, n = [], o = t.uuid;
917
- let i = t.items ?? [];
918
- const a = () => {
919
- r._state = { uuid: o, ref: t.ref, items: n }, r.dispatchEvent(new Event("clipboardwrite")), r.dispatchEvent(new Event("clipboardchange"));
920
- };
921
- await be("clipboard-write", async () => {
922
- 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 }) })));
923
- for (let l = 0; l < Math.min(1, i.length); l++) {
924
- const u = i[l];
925
- let f = u.types.indexOf(S.html), h = null;
926
- if (f !== -1) {
927
- const y = await u.getType(S.html);
928
- h = await Ce(y), h && (h = zt(o, h));
929
- }
930
- if (!h && u.types.includes(S.plain)) {
931
- const y = await u.getType(S.plain);
932
- if (y) {
933
- let T = null;
934
- typeof y == "string" ? (console.warn("text as string", y), T = y) : T = await Ce(y), T && (h = \`<div \${ie}="\${o}">\${T}</div>\`);
935
- }
936
- }
937
- if (!h && u.types.includes(S.png)) {
938
- const y = await u.getType(S.png), T = ut(await y.arrayBuffer());
939
- h = \`<div \${ie}="\${o}"><img src="\${dt + T}"/></div>\`;
940
- }
941
- !h && o && (h = Xe(o));
942
- const g = new Blob([h ?? ""], { type: S.html }), p = {};
943
- for (let y = 0; y < u.types.length; y++) {
944
- const T = u.types[y];
945
- p[T] = y === f ? g : u.getType(T);
946
- }
947
- h && f === -1 && (p[S.html] = g), o && (p[Q] = new Blob([o], { type: Q })), n.push(new ClipboardItem(p));
948
- }
949
- try {
950
- n && n.length !== 0 ? await this._nativeClipboard.write(n) : await $t(this._nativeClipboard);
951
- } catch (l) {
952
- l.message?.includes("Document is not focused") || console.warn("Unable to write to native clipboard: ", l);
953
- }
954
- return a(), !0;
955
- }, async (l) => {
956
- this.dispatchEvent(new Event("clipboarderrorwrite")), a();
957
- });
958
- }
959
- async writeReference(t) {
960
- if (!t) return void this.clear();
961
- let r = null;
962
- const n = {};
963
- try {
964
- const i = await t.toText?.() ?? null;
965
- i && (n[S.plain] = new Blob([i ?? ""], { type: S.plain }));
966
- } catch (i) {
967
- r = i;
968
- }
969
- try {
970
- const i = await t.toHtml?.() ?? null;
971
- i && (n[S.html] = new Blob([i], { type: S.html }));
972
- } catch (i) {
973
- r = i, console.warn("export to html", i);
974
- }
975
- try {
976
- const i = await t.toImage?.() ?? null;
977
- i && (n[S.png] = i);
978
- } catch (i) {
979
- r = i, console.warn("export to png", i);
980
- }
981
- const o = this._write({ uuid: de(), ref: t, items: Object.keys(n).length > 0 ? [new ClipboardItem(n)] : null });
982
- if (r) throw r;
983
- return o;
984
- }
985
- clear(t = !1) {
986
- this._state && (this._state = null, t && this._write({ uuid: null, ref: null, items: null }), this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")));
987
- }
988
- async readReference() {
989
- return await this.read(), this._state?.ref ?? null;
990
- }
991
- readText() {
992
- return new Promise(async (t, r) => {
993
- const n = await this.read();
994
- let o = null;
995
- for (let a = 0; !o && n && a < n.length; a++) n[a].types.includes(S.plain) && (o = await n[a].getType(S.plain));
996
- if (!o) return void t("");
997
- const i = new FileReader();
998
- i.onload = () => {
999
- t(i.result);
1000
- }, i.readAsText(o), i.onerror = (a) => {
1001
- r(a);
1002
- };
1003
- });
1004
- }
1005
- async writeText(t) {
1006
- const r = [new ClipboardItem({ [S.plain]: new Blob([t], { type: S.plain }) })];
1007
- return this._write({ uuid: de(), items: r, ref: null });
1008
- }
1009
- addEventListener(t, r, n = {}) {
1010
- const o = n?.capture ? this._listenersCapture : this._listeners;
1011
- let i = o.get(t);
1012
- i || (i = /* @__PURE__ */ new Map(), o.set(t, i)), i.set(r, typeof n == "boolean" ? {} : n);
1013
- }
1014
- dispatchEvent(t) {
1015
- if (!t) return;
1016
- const r = (n) => {
1017
- const o = n.get(t.type);
1018
- o && o.forEach((i, a) => {
1019
- try {
1020
- typeof a == "function" ? a(t) : a.handleEvent && a.handleEvent(t), i.once && o.delete(a);
1021
- } catch (l) {
1022
- console.warn(l);
1023
- }
1024
- });
1025
- };
1026
- return r(this._listenersCapture), r(this._listeners), !0;
1027
- }
1028
- removeEventListener(t, r, n) {
1029
- const o = n?.capture ? this._listenersCapture : this._listeners, i = o.get(t);
1030
- i && (i.delete(r), i.size === 0 && o.delete(t));
1031
- }
1032
- close() {
1033
- globalThis.removeEventListener?.("focus", this._onFocus), globalThis.removeEventListener?.("blur", this._onBlur);
1034
- }
1035
- }
1036
- var Ee;
1037
- (Ee = Qe || (Qe = {})).ErrorMessages = pt, Ee.Global = new Ee();
1038
- const Kt = "__SHEETXL";
1039
- let ee = null, le = null;
1040
- async function Vt() {
1041
- if (ee)
1042
- return ee;
1043
- if (le) {
1044
- if (await le, !ee)
1045
- throw new Error("ESBuild initialization promise resolved, but instance is not available.");
1046
- return ee;
1047
- }
1048
- let e, t;
1049
- le = new Promise((r, n) => {
1050
- e = r, t = n;
1051
- });
1052
- try {
1053
- const { initialize: r } = await Promise.resolve().then(function() {
1054
- return rr;
1055
- });
1056
- return ee = await r(), e(), ee;
1057
- } catch (r) {
1058
- throw console.error("Failed to import or initialize esbuild:", r), le = null, t(r), r;
1059
- }
1060
- }
1061
- const qt = {
1062
- // ESBuild.TsconfigRaw =
1063
- compilerOptions: {
1064
- target: "esnext"
1065
- }
1066
- };
1067
- async function Gt(e, t, r = "/script.js", n = Kt) {
1068
- try {
1069
- const o = await Vt(), i = "@sheetxl/primitives", a = \`
1070
- export const FormulaContext = globalThis.\${n}?.FormulaContext;
1071
- export const ScalarType = globalThis.\${n}?.ScalarType;
1072
- export const Observable = globalThis.\${n}?.Observable;
1073
- export const IRange = globalThis.\${n}?.IRange;
1074
- export const FormulaError = globalThis.\${n}?.FormulaError;
1075
- // Add more exports as needed
1076
- \`, l = {
1077
- // ESBuild.Plugin = {
1078
- name: "sheetxl-esbuild-in-memory",
1079
- setup(f) {
1080
- const h = "sheetxl-" + (/* @__PURE__ */ new Date()).getTime();
1081
- f.onResolve({ filter: new RegExp(\`^(\${r.replace("/", "\\\\/")}|\${i})$\`) }, (g) => ({
1082
- path: g.path,
1083
- namespace: h
1084
- })), f.onResolve({ filter: /.*/ }, (g) => {
1085
- if (g.namespace !== h)
1086
- return console.warn(\`esbuild: Treating import "\${g.path}" as external.\`), { path: g.path, external: !0 };
1087
- }), f.onLoad({ filter: /.*/, namespace: h }, (g) => {
1088
- let p;
1089
- if (g.path === r)
1090
- p = t;
1091
- else if (g.path === i)
1092
- p = a;
1093
- else
1094
- return {
1095
- errors: [{ text: \`Cannot load unknown path in \${h}: \${g.path}\` }]
1096
- };
1097
- return {
1098
- contents: p,
1099
- loader: "ts"
1100
- // leave this as 'ts' so esbuild generates proper sourcemaps
1101
- };
1102
- });
1103
- }
1104
- }, u = await o.build({
1105
- entryPoints: [r],
1106
- // Use the virtual entry point
1107
- bundle: !0,
1108
- // IMPORTANT: Enable bundling
1109
- write: !1,
1110
- // IMPORTANT: Return result in memory
1111
- format: "esm",
1112
- // Output format
1113
- plugins: [l],
1114
- // TODO - later change to external and prepend when executing from ui
1115
- sourcemap: "inline",
1116
- // Generate separate source map string
1117
- tsconfigRaw: qt,
1118
- // Pass the mapped options
1119
- minify: !0,
1120
- // sourcemap: 'external', // Generate separate source map string
1121
- // Or use 'inline' if you prefer data URLs embedded in the code
1122
- // To suppress warnings about dynamic import() if esbuild complains:
1123
- // supported: { 'dynamic-import': true },
1124
- platform: "neutral"
1125
- // not really needed
1126
- });
1127
- if (u.outputFiles && u.outputFiles.length > 0)
1128
- return u.outputFiles[0].text;
1129
- throw u.errors && u.errors.length > 0 ? new Error(\`esbuild bundling failed: \${u.errors.map((f) => f.text).join(\`
1130
- \`)}\`) : new Error("esbuild did not produce an output file.");
1131
- } catch (o) {
1132
- throw console.error("esbuild bundling process failed:", o), o;
1133
- }
1134
- }
1135
- const Wt = \`
1136
- /**
1137
- * Represents the completion of an asynchronous operation
1138
- */
1139
- interface Promise<T> {
1140
- /**
1141
- * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
1142
- * resolved value cannot be modified from the callback.
1143
- * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
1144
- * @returns A Promise for the completion of the callback.
1145
- */
1146
- finally(onfinally?: (() => void) | undefined | null): Promise<T>;
1147
- }
1148
- \`, Yt = \`
1149
- interface FirstTest {
1150
- isTrue?: boolean;
1151
- }
1152
- \`, Jt = async () => Yt, ht = /* @__PURE__ */ new Map([
1153
- ["IReferenceRange", "r"],
1154
- ["IRange", "l"]
1155
- ]), wt = /* @__PURE__ */ new Map([
1156
- ["IWorkbook", "workbook"],
1157
- ["ISheet", "sheet"],
1158
- ["ICellRanges", "ranges"],
1159
- ["ICellRange", "range"],
1160
- ["IFormulaContext", "context"]
1161
- ]), _e = (e, t) => {
1162
- Array.from(t.keys()).forEach((n) => {
1163
- const o = t.get(n);
1164
- t.set(\`\${e}.\${n}\`, o);
1165
- });
1166
- }, Ht = /* @__PURE__ */ new Map([
1167
- ["Scalar", "*"],
1168
- ["FormulaError.Known", W.Error],
1169
- ["Date", "Date"],
1170
- ["JSON", "JSON"]
1171
- ]), Xt = /* @__PURE__ */ new Map([
1172
- // Repeating
1173
- ]), Oe = "SheetXL";
1174
- _e(Oe, ht);
1175
- _e(Oe, wt);
1176
- _e(Oe, Xt);
1177
- const Zt = /* @__PURE__ */ new Map([
1178
- ["Promise", () => ({ async: !0 })],
1179
- // ['PromiseLike', (): Partial<IFunction.ReturnTypeJSON> => {
1180
- // return { async: true };
1181
- // }],
1182
- ["Observable", () => ({ stream: !0 })]
1183
- ]);
1184
- let se = null;
1185
- async function Qt() {
1186
- if (se)
1187
- return se;
1188
- try {
1189
- return await (await Promise.resolve().then(function() {
1190
- return or;
1191
- })).initialize();
1192
- } catch (e) {
1193
- throw se = null, e;
1194
- } finally {
1195
- se = null;
1196
- }
1197
- }
1198
- async function er(e) {
1199
- const t = e?.source ?? null;
1200
- if (!t) return null;
1201
- const r = (e.disableBundle || e.declarationsOnly) ?? !1, n = [
1202
- Jt(),
1203
- //import('typescript'), // when bundled, but node check causes issues. We could bundle replace isNode but felt hacky
1204
- Qt()
1205
- ], o = await Promise.all(n), i = o[0], a = o[1];
1206
- let l = "", u = null;
1207
- const f = [], h = {
1208
- allowJs: !0,
1209
- declaration: !1,
1210
- sourceMap: !1,
1211
- // was true but now bundler will do this
1212
- inlineSourceMap: !1,
1213
- inlineSources: !1,
1214
- isolatedModules: !0,
1215
- preserveConstEnums: !1,
1216
- // types: ['WebWorker'],
1217
- module: 99,
1218
- //"esNext",
1219
- noResolve: !0,
1220
- emitDeclarationOnly: !1,
1221
- target: a.ScriptTarget.ES2020
1222
- // lib: ['webworker', 'es2020', 'esnext.asynciterable'], // Use the webworker lib instead of dom
1223
- }, g = "script", p = \`\${g}.ts\`, y = "lib.d.ts", T = "global.d.ts", A = {
1224
- [p]: t,
1225
- [y]: Wt,
1226
- [T]: i
1227
- }, D = {
1228
- getSourceFile: (s, w, L, P) => a.createSourceFile(s, A[s], a.ScriptTarget.Latest, !0),
1229
- fileExists: (s) => A[s] !== void 0,
1230
- readFile: (s) => A[s],
1231
- writeFile: (s, w) => {
1232
- A[s] = w;
1233
- },
1234
- // not used
1235
- getCurrentDirectory: () => "./",
1236
- getCanonicalFileName: (s) => s,
1237
- useCaseSensitiveFileNames: () => !0,
1238
- getDefaultLibFileName: (s) => y,
1239
- getNewLine: () => \`
1240
- \`
1241
- }, U = a.createProgram([p, T], h, D), I = U.getTypeChecker(), J = U.getSourceFile(p), E = U.emit();
1242
- E.diagnostics.length > 0 && console.warn(E.diagnostics), l = A[\`\${g}.js\`];
1243
- const c = (s, w, L, P) => {
1244
- if (!s) {
1245
- $(s, new Error(\`Type is not defined for '\${w?.name ?? "return"}'.\`));
1246
- return;
1247
- }
1248
- if (s.kind === a.SyntaxKind.NumberKeyword)
1249
- w.scalar = W.Number;
1250
- else if (s.kind === a.SyntaxKind.StringKeyword)
1251
- w.scalar = W.String;
1252
- else if (s.kind === a.SyntaxKind.BooleanKeyword)
1253
- w.scalar = W.Boolean;
1254
- else if (s.kind === a.SyntaxKind.UndefinedKeyword || s.kind === a.SyntaxKind.NullKeyword || s.kind === a.SyntaxKind.VoidKeyword) {
1255
- if (P) {
1256
- $(s, new Error(\`'undefined' is not a valid type for input: '\${s?.parent?.name?.escapedText}'.\`));
1257
- return;
1258
- }
1259
- w.scalar = W.Null;
1260
- } else if (s.kind === a.SyntaxKind.BigIntKeyword)
1261
- w.scalar = W.Number;
1262
- else if (s.kind === a.SyntaxKind.AnyKeyword)
1263
- w.scalar = W.Null;
1264
- else if (s.kind === a.SyntaxKind.ArrayType) {
1265
- const M = s.elementType;
1266
- if (!M) {
1267
- $(s, new Error(\`'Array' must be typed: '\${s?.parent?.name?.escapedText}'.\`));
1268
- return;
1269
- }
1270
- w.arrayDepth = (w.arrayDepth ?? 0) + 1, c(M, w, L, P);
1271
- } else if (s.kind !== a.SyntaxKind.TupleType) {
1272
- if (s.kind === a.SyntaxKind.TypeReference) {
1273
- const M = s.typeName?.getText?.() ?? null, K = ht.get(M);
1274
- let V = !1;
1275
- K && (w.range = K, V = !0);
1276
- const q = Ht.get(M);
1277
- if (q && (w.scalar = q), q !== void 0 && (V = !0), P) {
1278
- const R = wt.get(M);
1279
- if (R)
1280
- return R;
1281
- } else {
1282
- const R = Zt.get(M);
1283
- if (R) {
1284
- const b = { ...w, ...R() };
1285
- let N = 0;
1286
- if (b.async && N++, b.stream && N++, N > 1) {
1287
- $(s, new Error(\`'\${M}' cannot have multiple modifiers: '\${s?.parent?.name?.escapedText}'.\`));
1288
- return;
1289
- }
1290
- w = b, V = !0;
1291
- }
1292
- }
1293
- if (!V) {
1294
- $("node", new Error(\`'\${M}' is not a valid type: '\${s?.parent?.name?.escapedText}'.\`));
1295
- return;
1296
- }
1297
- const H = s.typeArguments;
1298
- if (H) {
1299
- if (H.length !== 1) {
1300
- $(s, new Error(\`'\${M}' must be typed with exactly 1 type: '\${s?.parent?.name?.escapedText}'.\`));
1301
- return;
1302
- }
1303
- c(H[0], w, L, P);
1304
- }
1305
- }
1306
- }
1307
- }, m = (s) => (a.getCombinedModifierFlags(s) & a.ModifierFlags.Export) !== 0, fe = (s) => (a.getCombinedModifierFlags(s) & a.ModifierFlags.Default) !== 0, B = [], $ = (s, w) => {
1308
- B.push(w);
1309
- };
1310
- if (a.forEachChild(J, (s) => {
1311
- if (m(s) && a.isFunctionDeclaration(s)) {
1312
- const w = {}, L = {
1313
- parameters: {}
1314
- }, P = s?.name?.getText();
1315
- try {
1316
- w.name = P;
1317
- const K = I.getSymbolAtLocation(s.name).getDocumentationComment(I);
1318
- if (K && K.length > 0 && K[0].text) {
1319
- let R = K[0].text;
1320
- R = R.replace(/[\\r\\n]+/g, "\\\\n").trim(), L.summary = R;
1321
- }
1322
- const V = {};
1323
- c(s.type, V, w, !1), w.returnType = V;
1324
- const q = {};
1325
- fe(s) && (q.default = !0, u = P), Object.keys(q).length > 0 && (w.behavior = q), w.parameters = [];
1326
- const H = /* @__PURE__ */ new Map();
1327
- for (let R = 0; R < s.parameters.length; R++) {
1328
- const b = s.parameters[R], N = {};
1329
- N.name = b.name?.getText();
1330
- const X = c(b.type, N, w, !0);
1331
- if (X) {
1332
- if (w.parameters.length !== 0) {
1333
- const F = s?.parent?.name?.getText();
1334
- $(s, new Error(\`'\${w.name}' contexts must be the first parameter: '\${F}'.\`));
1335
- return;
1336
- }
1337
- w.context = X;
1338
- continue;
1339
- }
1340
- const z = !((b.initializer === void 0 || b.initializer === null) && (b.questionToken === void 0 || b.questionToken === null));
1341
- let C;
1342
- if (z && (N.optional = !0, b.initializer))
1343
- try {
1344
- 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?.();
1345
- } catch (O) {
1346
- console.warn(\`Couldn't extract default value for parameter '\${N.name}'\`, O);
1347
- }
1348
- b.dotDotDotToken && (N.rest = !0), w.parameters.push(N);
1349
- const x = { description: "" };
1350
- L.parameters[N.name] = x;
1351
- const G = I.getSymbolAtLocation(b.name).getDocumentationComment(I);
1352
- G && G.length > 0 && G[0].text && (x.description = G[0].text), C !== void 0 && (x.defaultValue = C), H.set(N.name, N);
1353
- }
1354
- if (s.jsDoc && s.jsDoc.length > 0) {
1355
- const R = s.jsDoc;
1356
- for (let b = 0; b < R.length; b++) {
1357
- const N = R[b]?.tags;
1358
- if (N)
1359
- for (let X = 0; X < N.length; X++) {
1360
- const z = N[X];
1361
- let C = z?.tagName?.text;
1362
- if (!C) continue;
1363
- C = C.toLowerCase();
1364
- let x = z.comment;
1365
- const G = C === "hidden";
1366
- 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)))) {
1367
- if (x && typeof x == "string") {
1368
- const O = /\\{@link(code|plain)?\\s+([^}|]+)(?:\\s*\\|\\s*([^}]+))?\\}/g;
1369
- let F, Z = x, te = [];
1370
- for (; (F = O.exec(x)) !== null; ) {
1371
- const [pe, me, gt, Ne] = F, bt = [gt.trim()];
1372
- Ne && bt.push(Ne.trim());
1373
- }
1374
- x = Z, te.length > 0 && C === "see" && (L.links || (L.links = []), L.links.push(...te));
1375
- }
1376
- if (C === "name") {
1377
- const O = x;
1378
- O !== P && (L.name = O);
1379
- } else if (C === "description") {
1380
- const O = x;
1381
- } else if (C === "summary") {
1382
- const O = x;
1383
- O && (L.summary = O);
1384
- } else if (C === "param") {
1385
- const O = z.name?.text, F = H.get(O);
1386
- if (!F) {
1387
- B.push(new Error(\`Parameter '\${O}' not found in function '\${P}'.\`));
1388
- continue;
1389
- }
1390
- if (z.typeExpression && z.typeExpression.type)
1391
- try {
1392
- const Z = z.typeExpression.type;
1393
- if (Z.kind === a.SyntaxKind.UnionType) {
1394
- const te = [];
1395
- F.enums = te, Z.types.forEach((pe) => {
1396
- if (pe.kind === a.SyntaxKind.LiteralType) {
1397
- const me = pe.literal.text;
1398
- me && te.push(me);
1399
- }
1400
- });
1401
- }
1402
- } catch (Z) {
1403
- console.warn("Error parsing JSDoc type expression:", Z);
1404
- }
1405
- } else if (C === "returns" || C === "return")
1406
- w.returnType.description = x;
1407
- else if (C === "category")
1408
- L.category = x;
1409
- else if (C === "hidden") {
1410
- let O = !0;
1411
- const F = x?.toLowerCase();
1412
- F === "false" ? O = !1 : F !== "true" && (O = x), O !== !1 && (L.hidden = O ?? !0);
1413
- }
1414
- }
1415
- }
1416
- }
1417
- }
1418
- Object.keys(w.returnType).length === 0 && delete w.returnType, f.push([w, L]);
1419
- } catch (M) {
1420
- $(s, new Error(\`'\${P}': \${M.message}\`));
1421
- }
1422
- }
1423
- }), B.length > 0)
1424
- throw console.warn(B), new Error("There were compilation errors.", { cause: B });
1425
- if (f.length === 0)
1426
- throw new Error("No exported functions.");
1427
- const yt = \`\${Ut.uuidV4()}-script\`;
1428
- try {
1429
- !r && B.length === 0 && (l = await Gt(a, l, g));
1430
- } catch {
1431
- console.warn("Error bundling script");
1432
- }
1433
- const Ie = {
1434
- functions: f,
1435
- commitId: yt,
1436
- source: t,
1437
- name: "Script",
1438
- language: "typescript",
1439
- // default
1440
- compiled: l
1441
- };
1442
- return u && (Ie.autoRun = u), Ie;
1443
- }
1444
- self.addEventListener("message", async (e) => {
1445
- const { id: t, params: r } = e.data;
1446
- try {
1447
- const n = await er(r);
1448
- self.postMessage({ id: t, result: n, error: null });
1449
- } catch (n) {
1450
- self.postMessage({
1451
- id: t,
1452
- result: null,
1453
- error: {
1454
- message: n.message,
1455
- stack: n.stack,
1456
- cause: n.cause
1457
- }
1458
- });
1459
- }
1460
- });
1461
- let ce = null;
1462
- async function tr() {
1463
- return ce || (ce = new Promise(async (e, t) => {
1464
- try {
1465
- const r = "0.20.2", n = \`https://esm.sh/esbuild-wasm@\${r}\`, o = \`https://esm.sh/esbuild-wasm@\${r}/esbuild.wasm\`, a = (await import(
1466
- /* webpackIgnore: true */
1467
- /* @vite-ignore */
1468
- n
1469
- )).default;
1470
- await a.initialize({
1471
- wasmURL: o,
1472
- // Provide the specific WASM URL
1473
- worker: !1
1474
- // Keep processing on the current thread
1475
- }), e(a);
1476
- } catch (r) {
1477
- console.error("Error initializing esbuild:", r), t(r);
1478
- }
1479
- }), ce);
1480
- }
1481
- var rr = /* @__PURE__ */ Object.freeze({
1482
- __proto__: null,
1483
- initialize: tr
1484
- });
1485
- let ue = null;
1486
- async function nr() {
1487
- return ue || (ue = new Promise(async (e, t) => {
1488
- let r = null;
1489
- try {
1490
- r = await import("https://esm.sh/typescript@5.7.2");
1491
- } catch (n) {
1492
- console.error("Error initializing Browser TypeScript module:", n);
1493
- }
1494
- r || console.log("use script fallback"), e(r);
1495
- }), ue);
1496
- }
1497
- var or = /* @__PURE__ */ Object.freeze({
1498
- __proto__: null,
1499
- initialize: nr
1500
- });
1501
- `,a=typeof self<"u"&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",s],{type:"text/javascript;charset=utf-8"});function d(e){let n;try{if(n=a&&(self.URL||self.webkitURL).createObjectURL(a),!n)throw"";const t=new Worker(n,{type:"module",name:e?.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(n)}),t}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(s),{type:"module",name:e?.name})}}const l=async()=>{const{compileModule:e}=await Promise.resolve().then(()=>require("./BwGs6fp9j-iFwDlB.cjs")),n=new u(t=>e(t));return await n.start(),n};exports.createCompilerWorker=async function(){if(typeof process<"u"&&process.versions?.node&&typeof Worker>"u")return await l();if(typeof Worker<"u"){const e=new c(()=>new d);try{return await e.start(),e}catch(n){console.error("Failed to start TypescriptCompiler worker reverting to fallback:",n)}}return await l()};