qsharp-lang 1.26.2-dev → 1.26.3-dev

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 (337) hide show
  1. package/dist/data-structures/circuit.d.ts +0 -15
  2. package/dist/data-structures/circuit.js +1 -19
  3. package/dist/katas-content.generated.js +1 -1
  4. package/dist/katas-content.generated.md.js +1 -1
  5. package/dist/samples.generated.js +4 -4
  6. package/docs/Microsoft.Quantum.Core/IsRangeEmpty.md +1 -1
  7. package/docs/Microsoft.Quantum.Core/Length.md +1 -1
  8. package/docs/Microsoft.Quantum.Core/RangeEnd.md +1 -1
  9. package/docs/Microsoft.Quantum.Core/RangeStart.md +1 -1
  10. package/docs/Microsoft.Quantum.Core/Repeated.md +1 -1
  11. package/docs/Microsoft.Quantum.Core/index.md +1 -1
  12. package/docs/Std.Arithmetic/AddLE.md +1 -1
  13. package/docs/Std.Arithmetic/ApplyIfEqualL.md +1 -1
  14. package/docs/Std.Arithmetic/ApplyIfEqualLE.md +1 -1
  15. package/docs/Std.Arithmetic/ApplyIfGreaterL.md +1 -1
  16. package/docs/Std.Arithmetic/ApplyIfGreaterLE.md +1 -1
  17. package/docs/Std.Arithmetic/ApplyIfGreaterOrEqualL.md +1 -1
  18. package/docs/Std.Arithmetic/ApplyIfGreaterOrEqualLE.md +1 -1
  19. package/docs/Std.Arithmetic/ApplyIfLessL.md +1 -1
  20. package/docs/Std.Arithmetic/ApplyIfLessLE.md +1 -1
  21. package/docs/Std.Arithmetic/ApplyIfLessOrEqualL.md +1 -1
  22. package/docs/Std.Arithmetic/ApplyIfLessOrEqualLE.md +1 -1
  23. package/docs/Std.Arithmetic/FourierTDIncByLE.md +1 -1
  24. package/docs/Std.Arithmetic/IncByI.md +1 -1
  25. package/docs/Std.Arithmetic/IncByIUsingIncByLE.md +1 -1
  26. package/docs/Std.Arithmetic/IncByL.md +1 -1
  27. package/docs/Std.Arithmetic/IncByLE.md +1 -1
  28. package/docs/Std.Arithmetic/IncByLEUsingAddLE.md +1 -1
  29. package/docs/Std.Arithmetic/IncByLUsingIncByLE.md +1 -1
  30. package/docs/Std.Arithmetic/LookAheadDKRSAddLE.md +1 -1
  31. package/docs/Std.Arithmetic/MAJ.md +1 -1
  32. package/docs/Std.Arithmetic/ReflectAboutInteger.md +1 -1
  33. package/docs/Std.Arithmetic/RippleCarryCGAddLE.md +1 -1
  34. package/docs/Std.Arithmetic/RippleCarryCGIncByLE.md +1 -1
  35. package/docs/Std.Arithmetic/RippleCarryTTKIncByLE.md +1 -1
  36. package/docs/Std.Arithmetic/index.md +1 -1
  37. package/docs/Std.Arrays/All.md +1 -1
  38. package/docs/Std.Arrays/Any.md +1 -1
  39. package/docs/Std.Arrays/Chunks.md +1 -1
  40. package/docs/Std.Arrays/CircularlyShifted.md +1 -1
  41. package/docs/Std.Arrays/ColumnAt.md +1 -1
  42. package/docs/Std.Arrays/Count.md +1 -1
  43. package/docs/Std.Arrays/Diagonal.md +1 -1
  44. package/docs/Std.Arrays/DrawMany.md +1 -1
  45. package/docs/Std.Arrays/Enumerated.md +1 -1
  46. package/docs/Std.Arrays/Excluding.md +1 -1
  47. package/docs/Std.Arrays/Filtered.md +1 -1
  48. package/docs/Std.Arrays/FlatMapped.md +1 -1
  49. package/docs/Std.Arrays/Flattened.md +1 -1
  50. package/docs/Std.Arrays/Fold.md +1 -1
  51. package/docs/Std.Arrays/ForEach.md +1 -1
  52. package/docs/Std.Arrays/Head.md +1 -1
  53. package/docs/Std.Arrays/HeadAndRest.md +1 -1
  54. package/docs/Std.Arrays/IndexOf.md +1 -1
  55. package/docs/Std.Arrays/IndexRange.md +1 -1
  56. package/docs/Std.Arrays/Interleaved.md +1 -1
  57. package/docs/Std.Arrays/IsEmpty.md +1 -1
  58. package/docs/Std.Arrays/IsRectangularArray.md +1 -1
  59. package/docs/Std.Arrays/IsSorted.md +1 -1
  60. package/docs/Std.Arrays/IsSquareArray.md +1 -1
  61. package/docs/Std.Arrays/Mapped.md +1 -1
  62. package/docs/Std.Arrays/MappedByIndex.md +1 -1
  63. package/docs/Std.Arrays/MappedOverRange.md +1 -1
  64. package/docs/Std.Arrays/Most.md +1 -1
  65. package/docs/Std.Arrays/MostAndTail.md +1 -1
  66. package/docs/Std.Arrays/Padded.md +1 -1
  67. package/docs/Std.Arrays/Partitioned.md +1 -1
  68. package/docs/Std.Arrays/Rest.md +1 -1
  69. package/docs/Std.Arrays/Reversed.md +1 -1
  70. package/docs/Std.Arrays/SequenceI.md +1 -1
  71. package/docs/Std.Arrays/SequenceL.md +1 -1
  72. package/docs/Std.Arrays/Sorted.md +1 -1
  73. package/docs/Std.Arrays/Subarray.md +1 -1
  74. package/docs/Std.Arrays/Swapped.md +1 -1
  75. package/docs/Std.Arrays/Tail.md +1 -1
  76. package/docs/Std.Arrays/Transposed.md +1 -1
  77. package/docs/Std.Arrays/Unzipped.md +1 -1
  78. package/docs/Std.Arrays/Where.md +1 -1
  79. package/docs/Std.Arrays/Windows.md +1 -1
  80. package/docs/Std.Arrays/Zipped.md +1 -1
  81. package/docs/Std.Arrays/index.md +1 -1
  82. package/docs/Std.Canon/ApplyCNOTChain.md +1 -1
  83. package/docs/Std.Canon/ApplyControlledOnBitString.md +1 -1
  84. package/docs/Std.Canon/ApplyControlledOnInt.md +1 -1
  85. package/docs/Std.Canon/ApplyOperationPowerA.md +1 -1
  86. package/docs/Std.Canon/ApplyOperationPowerCA.md +1 -1
  87. package/docs/Std.Canon/ApplyP.md +1 -1
  88. package/docs/Std.Canon/ApplyPauli.md +1 -1
  89. package/docs/Std.Canon/ApplyPauliFromBitString.md +1 -1
  90. package/docs/Std.Canon/ApplyPauliFromInt.md +1 -1
  91. package/docs/Std.Canon/ApplyQFT.md +1 -1
  92. package/docs/Std.Canon/ApplyQPE.md +1 -1
  93. package/docs/Std.Canon/ApplyToEach.md +1 -1
  94. package/docs/Std.Canon/ApplyToEachA.md +1 -1
  95. package/docs/Std.Canon/ApplyToEachC.md +1 -1
  96. package/docs/Std.Canon/ApplyToEachCA.md +1 -1
  97. package/docs/Std.Canon/ApplyXorInPlace.md +1 -1
  98. package/docs/Std.Canon/ApplyXorInPlaceL.md +1 -1
  99. package/docs/Std.Canon/CX.md +1 -1
  100. package/docs/Std.Canon/CY.md +1 -1
  101. package/docs/Std.Canon/CZ.md +1 -1
  102. package/docs/Std.Canon/Fst.md +1 -1
  103. package/docs/Std.Canon/MapPauliAxis.md +1 -1
  104. package/docs/Std.Canon/Relabel.md +1 -1
  105. package/docs/Std.Canon/Snd.md +1 -1
  106. package/docs/Std.Canon/SwapReverseRegister.md +1 -1
  107. package/docs/Std.Canon/index.md +1 -1
  108. package/docs/Std.Convert/BigIntAsBoolArray.md +1 -1
  109. package/docs/Std.Convert/BigIntAsInt.md +1 -1
  110. package/docs/Std.Convert/BoolArrayAsBigInt.md +1 -1
  111. package/docs/Std.Convert/BoolArrayAsInt.md +1 -1
  112. package/docs/Std.Convert/BoolArrayAsResultArray.md +1 -1
  113. package/docs/Std.Convert/BoolAsResult.md +1 -1
  114. package/docs/Std.Convert/ComplexAsComplexPolar.md +1 -1
  115. package/docs/Std.Convert/ComplexPolarAsComplex.md +1 -1
  116. package/docs/Std.Convert/DoubleAsStringWithPrecision.md +1 -1
  117. package/docs/Std.Convert/IntAsBigInt.md +1 -1
  118. package/docs/Std.Convert/IntAsBoolArray.md +1 -1
  119. package/docs/Std.Convert/IntAsDouble.md +1 -1
  120. package/docs/Std.Convert/ResultArrayAsBoolArray.md +1 -1
  121. package/docs/Std.Convert/ResultArrayAsInt.md +1 -1
  122. package/docs/Std.Convert/ResultAsBool.md +1 -1
  123. package/docs/Std.Convert/index.md +1 -1
  124. package/docs/Std.Core/Complex.md +1 -1
  125. package/docs/Std.Core/Length.md +1 -1
  126. package/docs/Std.Core/Repeated.md +1 -1
  127. package/docs/Std.Core/index.md +1 -1
  128. package/docs/Std.Diagnostics/ApplyIdleNoise.md +1 -1
  129. package/docs/Std.Diagnostics/BitFlipNoise.md +1 -1
  130. package/docs/Std.Diagnostics/CheckAllZero.md +1 -1
  131. package/docs/Std.Diagnostics/CheckOperationsAreEqual.md +1 -1
  132. package/docs/Std.Diagnostics/CheckZero.md +1 -1
  133. package/docs/Std.Diagnostics/ConfigurePauliNoise.md +1 -1
  134. package/docs/Std.Diagnostics/ConfigureQubitLoss.md +1 -1
  135. package/docs/Std.Diagnostics/DepolarizingNoise.md +1 -1
  136. package/docs/Std.Diagnostics/DumpMachine.md +1 -1
  137. package/docs/Std.Diagnostics/DumpOperation.md +1 -1
  138. package/docs/Std.Diagnostics/DumpRegister.md +1 -1
  139. package/docs/Std.Diagnostics/Fact.md +1 -1
  140. package/docs/Std.Diagnostics/NoNoise.md +1 -1
  141. package/docs/Std.Diagnostics/PhaseFlipNoise.md +1 -1
  142. package/docs/Std.Diagnostics/PostSelectZ.md +40 -0
  143. package/docs/Std.Diagnostics/StartCountingFunction.md +1 -1
  144. package/docs/Std.Diagnostics/StartCountingOperation.md +1 -1
  145. package/docs/Std.Diagnostics/StartCountingQubits.md +1 -1
  146. package/docs/Std.Diagnostics/StopCountingFunction.md +1 -1
  147. package/docs/Std.Diagnostics/StopCountingOperation.md +1 -1
  148. package/docs/Std.Diagnostics/StopCountingQubits.md +1 -1
  149. package/docs/Std.Diagnostics/index.md +2 -1
  150. package/docs/Std.Intrinsic/AND.md +1 -1
  151. package/docs/Std.Intrinsic/ApplyUnitary.md +1 -1
  152. package/docs/Std.Intrinsic/CCNOT.md +1 -1
  153. package/docs/Std.Intrinsic/CNOT.md +1 -1
  154. package/docs/Std.Intrinsic/Exp.md +1 -1
  155. package/docs/Std.Intrinsic/H.md +1 -1
  156. package/docs/Std.Intrinsic/I.md +1 -1
  157. package/docs/Std.Intrinsic/M.md +1 -1
  158. package/docs/Std.Intrinsic/Measure.md +1 -1
  159. package/docs/Std.Intrinsic/Message.md +1 -1
  160. package/docs/Std.Intrinsic/R.md +1 -1
  161. package/docs/Std.Intrinsic/R1.md +1 -1
  162. package/docs/Std.Intrinsic/R1Frac.md +1 -1
  163. package/docs/Std.Intrinsic/RFrac.md +1 -1
  164. package/docs/Std.Intrinsic/Reset.md +1 -1
  165. package/docs/Std.Intrinsic/ResetAll.md +1 -1
  166. package/docs/Std.Intrinsic/Rx.md +1 -1
  167. package/docs/Std.Intrinsic/Rxx.md +1 -1
  168. package/docs/Std.Intrinsic/Ry.md +1 -1
  169. package/docs/Std.Intrinsic/Ryy.md +1 -1
  170. package/docs/Std.Intrinsic/Rz.md +1 -1
  171. package/docs/Std.Intrinsic/Rzz.md +1 -1
  172. package/docs/Std.Intrinsic/S.md +1 -1
  173. package/docs/Std.Intrinsic/SWAP.md +1 -1
  174. package/docs/Std.Intrinsic/SX.md +1 -1
  175. package/docs/Std.Intrinsic/T.md +1 -1
  176. package/docs/Std.Intrinsic/X.md +1 -1
  177. package/docs/Std.Intrinsic/Y.md +1 -1
  178. package/docs/Std.Intrinsic/Z.md +1 -1
  179. package/docs/Std.Intrinsic/index.md +1 -1
  180. package/docs/Std.Logical/Xor.md +1 -1
  181. package/docs/Std.Logical/index.md +1 -1
  182. package/docs/Std.Math/AbsComplex.md +1 -1
  183. package/docs/Std.Math/AbsComplexPolar.md +1 -1
  184. package/docs/Std.Math/AbsD.md +1 -1
  185. package/docs/Std.Math/AbsI.md +1 -1
  186. package/docs/Std.Math/AbsL.md +1 -1
  187. package/docs/Std.Math/AbsSquaredComplex.md +1 -1
  188. package/docs/Std.Math/AbsSquaredComplexPolar.md +1 -1
  189. package/docs/Std.Math/ApproximateFactorial.md +1 -1
  190. package/docs/Std.Math/ArcCos.md +1 -1
  191. package/docs/Std.Math/ArcCosh.md +1 -1
  192. package/docs/Std.Math/ArcSin.md +1 -1
  193. package/docs/Std.Math/ArcSinh.md +1 -1
  194. package/docs/Std.Math/ArcTan.md +1 -1
  195. package/docs/Std.Math/ArcTan2.md +1 -1
  196. package/docs/Std.Math/ArcTanh.md +1 -1
  197. package/docs/Std.Math/ArgComplex.md +1 -1
  198. package/docs/Std.Math/ArgComplexPolar.md +1 -1
  199. package/docs/Std.Math/Binom.md +1 -1
  200. package/docs/Std.Math/BitSizeI.md +1 -1
  201. package/docs/Std.Math/BitSizeL.md +1 -1
  202. package/docs/Std.Math/Ceiling.md +1 -1
  203. package/docs/Std.Math/Complex.md +1 -1
  204. package/docs/Std.Math/ComplexPolar.md +1 -1
  205. package/docs/Std.Math/ContinuedFractionConvergentI.md +1 -1
  206. package/docs/Std.Math/ContinuedFractionConvergentL.md +1 -1
  207. package/docs/Std.Math/Cos.md +1 -1
  208. package/docs/Std.Math/Cosh.md +1 -1
  209. package/docs/Std.Math/DivRemI.md +1 -1
  210. package/docs/Std.Math/DivRemL.md +1 -1
  211. package/docs/Std.Math/DividedByC.md +1 -1
  212. package/docs/Std.Math/DividedByCP.md +1 -1
  213. package/docs/Std.Math/E.md +1 -1
  214. package/docs/Std.Math/ExpModI.md +1 -1
  215. package/docs/Std.Math/ExpModL.md +1 -1
  216. package/docs/Std.Math/ExtendedGreatestCommonDivisorI.md +1 -1
  217. package/docs/Std.Math/ExtendedGreatestCommonDivisorL.md +1 -1
  218. package/docs/Std.Math/FactorialI.md +1 -1
  219. package/docs/Std.Math/FactorialL.md +1 -1
  220. package/docs/Std.Math/Floor.md +1 -1
  221. package/docs/Std.Math/GreatestCommonDivisorI.md +1 -1
  222. package/docs/Std.Math/GreatestCommonDivisorL.md +1 -1
  223. package/docs/Std.Math/HammingWeightI.md +1 -1
  224. package/docs/Std.Math/InverseModI.md +1 -1
  225. package/docs/Std.Math/InverseModL.md +1 -1
  226. package/docs/Std.Math/IsCoprimeI.md +1 -1
  227. package/docs/Std.Math/IsCoprimeL.md +1 -1
  228. package/docs/Std.Math/IsInfinite.md +1 -1
  229. package/docs/Std.Math/IsNaN.md +1 -1
  230. package/docs/Std.Math/LargestFixedPoint.md +1 -1
  231. package/docs/Std.Math/Lg.md +1 -1
  232. package/docs/Std.Math/Log.md +1 -1
  233. package/docs/Std.Math/Log10.md +1 -1
  234. package/docs/Std.Math/LogFactorialD.md +1 -1
  235. package/docs/Std.Math/LogGammaD.md +1 -1
  236. package/docs/Std.Math/LogOf2.md +1 -1
  237. package/docs/Std.Math/Max.md +1 -1
  238. package/docs/Std.Math/MaxD.md +1 -1
  239. package/docs/Std.Math/MaxI.md +1 -1
  240. package/docs/Std.Math/MaxL.md +1 -1
  241. package/docs/Std.Math/Min.md +1 -1
  242. package/docs/Std.Math/MinD.md +1 -1
  243. package/docs/Std.Math/MinI.md +1 -1
  244. package/docs/Std.Math/MinL.md +1 -1
  245. package/docs/Std.Math/MinusC.md +1 -1
  246. package/docs/Std.Math/MinusCP.md +1 -1
  247. package/docs/Std.Math/ModulusI.md +1 -1
  248. package/docs/Std.Math/ModulusL.md +1 -1
  249. package/docs/Std.Math/NegationC.md +1 -1
  250. package/docs/Std.Math/NegationCP.md +1 -1
  251. package/docs/Std.Math/PI.md +1 -1
  252. package/docs/Std.Math/PNorm.md +1 -1
  253. package/docs/Std.Math/PNormalized.md +1 -1
  254. package/docs/Std.Math/PlusC.md +1 -1
  255. package/docs/Std.Math/PlusCP.md +1 -1
  256. package/docs/Std.Math/PowC.md +1 -1
  257. package/docs/Std.Math/PowCP.md +1 -1
  258. package/docs/Std.Math/RealMod.md +1 -1
  259. package/docs/Std.Math/Round.md +1 -1
  260. package/docs/Std.Math/RoundHalfAwayFromZero.md +1 -1
  261. package/docs/Std.Math/SignD.md +1 -1
  262. package/docs/Std.Math/SignI.md +1 -1
  263. package/docs/Std.Math/SignL.md +1 -1
  264. package/docs/Std.Math/Sin.md +1 -1
  265. package/docs/Std.Math/Sinh.md +1 -1
  266. package/docs/Std.Math/SmallestFixedPoint.md +1 -1
  267. package/docs/Std.Math/Sqrt.md +1 -1
  268. package/docs/Std.Math/SquaredNorm.md +1 -1
  269. package/docs/Std.Math/Tan.md +1 -1
  270. package/docs/Std.Math/Tanh.md +1 -1
  271. package/docs/Std.Math/TimesC.md +1 -1
  272. package/docs/Std.Math/TimesCP.md +1 -1
  273. package/docs/Std.Math/TrailingZeroCountI.md +1 -1
  274. package/docs/Std.Math/TrailingZeroCountL.md +1 -1
  275. package/docs/Std.Math/Truncate.md +1 -1
  276. package/docs/Std.Math/index.md +1 -1
  277. package/docs/Std.Measurement/IsLossResult.md +1 -1
  278. package/docs/Std.Measurement/MResetEachZ.md +1 -1
  279. package/docs/Std.Measurement/MResetX.md +1 -1
  280. package/docs/Std.Measurement/MResetY.md +1 -1
  281. package/docs/Std.Measurement/MResetZ.md +1 -1
  282. package/docs/Std.Measurement/MResetZChecked.md +1 -1
  283. package/docs/Std.Measurement/MeasureAllZ.md +1 -1
  284. package/docs/Std.Measurement/MeasureEachZ.md +1 -1
  285. package/docs/Std.Measurement/MeasureInteger.md +1 -1
  286. package/docs/Std.Measurement/index.md +1 -1
  287. package/docs/Std.Random/DrawRandomBool.md +1 -1
  288. package/docs/Std.Random/DrawRandomDouble.md +1 -1
  289. package/docs/Std.Random/DrawRandomInt.md +1 -1
  290. package/docs/Std.Random/index.md +1 -1
  291. package/docs/Std.Range/IsRangeEmpty.md +1 -1
  292. package/docs/Std.Range/RangeEnd.md +1 -1
  293. package/docs/Std.Range/RangeReverse.md +1 -1
  294. package/docs/Std.Range/RangeStart.md +1 -1
  295. package/docs/Std.Range/RangeStep.md +1 -1
  296. package/docs/Std.Range/index.md +1 -1
  297. package/docs/Std.ResourceEstimation/AccountForEstimates.md +1 -1
  298. package/docs/Std.ResourceEstimation/AuxQubitCount.md +1 -1
  299. package/docs/Std.ResourceEstimation/BeginEstimateCaching.md +1 -1
  300. package/docs/Std.ResourceEstimation/BeginRepeatEstimates.md +1 -1
  301. package/docs/Std.ResourceEstimation/CczCount.md +1 -1
  302. package/docs/Std.ResourceEstimation/EnableMemoryComputeArchitecture.md +1 -1
  303. package/docs/Std.ResourceEstimation/EndEstimateCaching.md +1 -1
  304. package/docs/Std.ResourceEstimation/EndRepeatEstimates.md +1 -1
  305. package/docs/Std.ResourceEstimation/LeastFrequentlyUsed.md +1 -1
  306. package/docs/Std.ResourceEstimation/LeastRecentlyUsed.md +1 -1
  307. package/docs/Std.ResourceEstimation/MeasurementCount.md +1 -1
  308. package/docs/Std.ResourceEstimation/PSSPCLayout.md +1 -1
  309. package/docs/Std.ResourceEstimation/RepeatEstimates.md +1 -1
  310. package/docs/Std.ResourceEstimation/RotationCount.md +1 -1
  311. package/docs/Std.ResourceEstimation/RotationDepth.md +1 -1
  312. package/docs/Std.ResourceEstimation/SingleVariant.md +1 -1
  313. package/docs/Std.ResourceEstimation/TCount.md +1 -1
  314. package/docs/Std.ResourceEstimation/index.md +1 -1
  315. package/docs/Std.StatePreparation/ApproximatelyPreparePureStateCP.md +1 -1
  316. package/docs/Std.StatePreparation/PreparePureStateD.md +1 -1
  317. package/docs/Std.StatePreparation/PrepareUniformSuperposition.md +1 -1
  318. package/docs/Std.StatePreparation/index.md +1 -1
  319. package/docs/Std.TableLookup/Select.md +1 -1
  320. package/docs/Std.TableLookup/index.md +1 -1
  321. package/docs/index.md +1 -1
  322. package/docs/toc.yml +1 -0
  323. package/lib/nodejs/qsc_wasm.cjs +1318 -1392
  324. package/lib/nodejs/qsc_wasm.d.cts +313 -290
  325. package/lib/nodejs/qsc_wasm_bg.wasm +0 -0
  326. package/lib/web/qsc_wasm.d.ts +388 -364
  327. package/lib/web/qsc_wasm.js +1346 -1346
  328. package/lib/web/qsc_wasm_bg.wasm +0 -0
  329. package/package.json +1 -1
  330. package/ux/circuit-vis/circuit.ts +0 -1
  331. package/ux/circuit-vis/formatters/gateFormatter.ts +111 -86
  332. package/ux/circuit-vis/formatters/registerFormatter.ts +2 -5
  333. package/ux/circuit-vis/gateRenderData.ts +10 -3
  334. package/ux/circuit-vis/panel.ts +1 -0
  335. package/ux/circuit-vis/process.ts +162 -57
  336. package/ux/circuit-vis/sqore.ts +34 -28
  337. package/ux/circuit-vis/utils.ts +2 -1
@@ -1,719 +1,15 @@
1
+ /* @ts-self-types="./qsc_wasm.d.ts" */
1
2
 
2
- let imports = {};
3
- imports['__wbindgen_placeholder__'] = module.exports;
4
- let wasm;
5
- const { TextEncoder, TextDecoder } = require(`util`);
6
-
7
- const heap = new Array(128).fill(undefined);
8
-
9
- heap.push(undefined, null, true, false);
10
-
11
- function getObject(idx) { return heap[idx]; }
12
-
13
- let WASM_VECTOR_LEN = 0;
14
-
15
- let cachedUint8ArrayMemory0 = null;
16
-
17
- function getUint8ArrayMemory0() {
18
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
19
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
20
- }
21
- return cachedUint8ArrayMemory0;
22
- }
23
-
24
- let cachedTextEncoder = new TextEncoder('utf-8');
25
-
26
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
27
- ? function (arg, view) {
28
- return cachedTextEncoder.encodeInto(arg, view);
29
- }
30
- : function (arg, view) {
31
- const buf = cachedTextEncoder.encode(arg);
32
- view.set(buf);
33
- return {
34
- read: arg.length,
35
- written: buf.length
36
- };
37
- });
38
-
39
- function passStringToWasm0(arg, malloc, realloc) {
40
-
41
- if (realloc === undefined) {
42
- const buf = cachedTextEncoder.encode(arg);
43
- const ptr = malloc(buf.length, 1) >>> 0;
44
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
45
- WASM_VECTOR_LEN = buf.length;
46
- return ptr;
47
- }
48
-
49
- let len = arg.length;
50
- let ptr = malloc(len, 1) >>> 0;
51
-
52
- const mem = getUint8ArrayMemory0();
53
-
54
- let offset = 0;
55
-
56
- for (; offset < len; offset++) {
57
- const code = arg.charCodeAt(offset);
58
- if (code > 0x7F) break;
59
- mem[ptr + offset] = code;
60
- }
61
-
62
- if (offset !== len) {
63
- if (offset !== 0) {
64
- arg = arg.slice(offset);
65
- }
66
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
67
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
68
- const ret = encodeString(arg, view);
69
-
70
- offset += ret.written;
71
- ptr = realloc(ptr, len, offset, 1) >>> 0;
72
- }
73
-
74
- WASM_VECTOR_LEN = offset;
75
- return ptr;
76
- }
77
-
78
- let cachedDataViewMemory0 = null;
79
-
80
- function getDataViewMemory0() {
81
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
82
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
83
- }
84
- return cachedDataViewMemory0;
85
- }
86
-
87
- let heap_next = heap.length;
88
-
89
- function addHeapObject(obj) {
90
- if (heap_next === heap.length) heap.push(heap.length + 1);
91
- const idx = heap_next;
92
- heap_next = heap[idx];
93
-
94
- heap[idx] = obj;
95
- return idx;
96
- }
97
-
98
- function handleError(f, args) {
99
- try {
100
- return f.apply(this, args);
101
- } catch (e) {
102
- wasm.__wbindgen_export_2(addHeapObject(e));
103
- }
104
- }
105
-
106
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
107
-
108
- cachedTextDecoder.decode();
109
-
110
- function getStringFromWasm0(ptr, len) {
111
- ptr = ptr >>> 0;
112
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
113
- }
114
-
115
- function isLikeNone(x) {
116
- return x === undefined || x === null;
117
- }
118
-
119
- function dropObject(idx) {
120
- if (idx < 132) return;
121
- heap[idx] = heap_next;
122
- heap_next = idx;
123
- }
124
-
125
- function takeObject(idx) {
126
- const ret = getObject(idx);
127
- dropObject(idx);
128
- return ret;
129
- }
130
-
131
- const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
132
- ? { register: () => {}, unregister: () => {} }
133
- : new FinalizationRegistry(state => {
134
- wasm.__wbindgen_export_3.get(state.dtor)(state.a, state.b)
135
- });
136
-
137
- function makeMutClosure(arg0, arg1, dtor, f) {
138
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
139
- const real = (...args) => {
140
- // First up with a closure we increment the internal reference
141
- // count. This ensures that the Rust closure environment won't
142
- // be deallocated while we're invoking it.
143
- state.cnt++;
144
- const a = state.a;
145
- state.a = 0;
146
- try {
147
- return f(a, state.b, ...args);
148
- } finally {
149
- if (--state.cnt === 0) {
150
- wasm.__wbindgen_export_3.get(state.dtor)(a, state.b);
151
- CLOSURE_DTORS.unregister(state);
152
- } else {
153
- state.a = a;
154
- }
155
- }
156
- };
157
- real.original = state;
158
- CLOSURE_DTORS.register(real, state, state);
159
- return real;
160
- }
161
-
162
- function debugString(val) {
163
- // primitive types
164
- const type = typeof val;
165
- if (type == 'number' || type == 'boolean' || val == null) {
166
- return `${val}`;
167
- }
168
- if (type == 'string') {
169
- return `"${val}"`;
170
- }
171
- if (type == 'symbol') {
172
- const description = val.description;
173
- if (description == null) {
174
- return 'Symbol';
175
- } else {
176
- return `Symbol(${description})`;
177
- }
178
- }
179
- if (type == 'function') {
180
- const name = val.name;
181
- if (typeof name == 'string' && name.length > 0) {
182
- return `Function(${name})`;
183
- } else {
184
- return 'Function';
185
- }
186
- }
187
- // objects
188
- if (Array.isArray(val)) {
189
- const length = val.length;
190
- let debug = '[';
191
- if (length > 0) {
192
- debug += debugString(val[0]);
193
- }
194
- for(let i = 1; i < length; i++) {
195
- debug += ', ' + debugString(val[i]);
196
- }
197
- debug += ']';
198
- return debug;
199
- }
200
- // Test for built-in
201
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
202
- let className;
203
- if (builtInMatches && builtInMatches.length > 1) {
204
- className = builtInMatches[1];
205
- } else {
206
- // Failed to match the standard '[object ClassName]'
207
- return toString.call(val);
208
- }
209
- if (className == 'Object') {
210
- // we're a user defined class or Object
211
- // JSON.stringify avoids problems with cycles, and is generally much
212
- // easier than looping through ownProperties of `val`.
213
- try {
214
- return 'Object(' + JSON.stringify(val) + ')';
215
- } catch (_) {
216
- return 'Object';
217
- }
218
- }
219
- // errors
220
- if (val instanceof Error) {
221
- return `${val.name}: ${val.message}\n${val.stack}`;
222
- }
223
- // TODO we could test for more things here, like `Set`s and `Map`s.
224
- return className;
225
- }
226
-
227
- let stack_pointer = 128;
228
-
229
- function addBorrowedObject(obj) {
230
- if (stack_pointer == 1) throw new Error('out of js stack');
231
- heap[--stack_pointer] = obj;
232
- return stack_pointer;
233
- }
234
-
235
- let cachedUint32ArrayMemory0 = null;
236
-
237
- function getUint32ArrayMemory0() {
238
- if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
239
- cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
240
- }
241
- return cachedUint32ArrayMemory0;
242
- }
243
-
244
- function passArray32ToWasm0(arg, malloc) {
245
- const ptr = malloc(arg.length * 4, 4) >>> 0;
246
- getUint32ArrayMemory0().set(arg, ptr / 4);
247
- WASM_VECTOR_LEN = arg.length;
248
- return ptr;
249
- }
250
-
251
- function passArrayJsValueToWasm0(array, malloc) {
252
- const ptr = malloc(array.length * 4, 4) >>> 0;
253
- const mem = getDataViewMemory0();
254
- for (let i = 0; i < array.length; i++) {
255
- mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
256
- }
257
- WASM_VECTOR_LEN = array.length;
258
- return ptr;
259
- }
260
-
261
- function getArrayJsValueFromWasm0(ptr, len) {
262
- ptr = ptr >>> 0;
263
- const mem = getDataViewMemory0();
264
- const result = [];
265
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
266
- result.push(takeObject(mem.getUint32(i, true)));
267
- }
268
- return result;
269
- }
270
- /**
271
- * @param {any} callback
272
- * @param {number} level
273
- */
274
- module.exports.initLogging = function(callback, level) {
275
- try {
276
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
277
- wasm.initLogging(retptr, addHeapObject(callback), level);
278
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
279
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
280
- if (r1) {
281
- throw takeObject(r0);
282
- }
283
- } finally {
284
- wasm.__wbindgen_add_to_stack_pointer(16);
285
- }
286
- };
287
-
288
- /**
289
- * @param {number} level
290
- */
291
- module.exports.setLogLevel = function(level) {
292
- wasm.setLogLevel(level);
293
- };
294
-
295
- /**
296
- * @returns {string}
297
- */
298
- module.exports.git_hash = function() {
299
- let deferred1_0;
300
- let deferred1_1;
301
- try {
302
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
303
- wasm.git_hash(retptr);
304
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
305
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
306
- deferred1_0 = r0;
307
- deferred1_1 = r1;
308
- return getStringFromWasm0(r0, r1);
309
- } finally {
310
- wasm.__wbindgen_add_to_stack_pointer(16);
311
- wasm.__wbindgen_export_4(deferred1_0, deferred1_1, 1);
312
- }
313
- };
314
-
315
- /**
316
- * @param {IProgramConfig} program
317
- * @returns {string}
318
- */
319
- module.exports.get_qir = function(program) {
320
- let deferred2_0;
321
- let deferred2_1;
322
- try {
323
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
324
- wasm.get_qir(retptr, addHeapObject(program));
325
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
326
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
327
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
328
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
329
- var ptr1 = r0;
330
- var len1 = r1;
331
- if (r3) {
332
- ptr1 = 0; len1 = 0;
333
- throw takeObject(r2);
334
- }
335
- deferred2_0 = ptr1;
336
- deferred2_1 = len1;
337
- return getStringFromWasm0(ptr1, len1);
338
- } finally {
339
- wasm.__wbindgen_add_to_stack_pointer(16);
340
- wasm.__wbindgen_export_4(deferred2_0, deferred2_1, 1);
341
- }
342
- };
343
-
344
- /**
345
- * @param {IProgramConfig} program
346
- * @param {string} expr
347
- * @param {string} params
348
- * @returns {string}
349
- */
350
- module.exports.get_estimates = function(program, expr, params) {
351
- let deferred4_0;
352
- let deferred4_1;
353
- try {
354
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
355
- const ptr0 = passStringToWasm0(expr, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
356
- const len0 = WASM_VECTOR_LEN;
357
- const ptr1 = passStringToWasm0(params, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
358
- const len1 = WASM_VECTOR_LEN;
359
- wasm.get_estimates(retptr, addHeapObject(program), ptr0, len0, ptr1, len1);
360
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
361
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
362
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
363
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
364
- var ptr3 = r0;
365
- var len3 = r1;
366
- if (r3) {
367
- ptr3 = 0; len3 = 0;
368
- throw takeObject(r2);
369
- }
370
- deferred4_0 = ptr3;
371
- deferred4_1 = len3;
372
- return getStringFromWasm0(ptr3, len3);
373
- } finally {
374
- wasm.__wbindgen_add_to_stack_pointer(16);
375
- wasm.__wbindgen_export_4(deferred4_0, deferred4_1, 1);
376
- }
377
- };
378
-
379
- /**
380
- * @param {IProgramConfig} program
381
- * @param {IOperationInfo | null | undefined} operation
382
- * @param {ICircuitConfig} config
383
- * @returns {any}
384
- */
385
- module.exports.get_circuit = function(program, operation, config) {
386
- try {
387
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
388
- wasm.get_circuit(retptr, addHeapObject(program), isLikeNone(operation) ? 0 : addHeapObject(operation), addHeapObject(config));
389
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
390
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
391
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
392
- if (r2) {
393
- throw takeObject(r1);
394
- }
395
- return takeObject(r0);
396
- } finally {
397
- wasm.__wbindgen_add_to_stack_pointer(16);
398
- }
399
- };
400
-
401
- /**
402
- * @param {string} name
403
- * @returns {string | undefined}
404
- */
405
- module.exports.get_library_source_content = function(name) {
406
- try {
407
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
408
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
409
- const len0 = WASM_VECTOR_LEN;
410
- wasm.get_library_source_content(retptr, ptr0, len0);
411
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
412
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
413
- let v2;
414
- if (r0 !== 0) {
415
- v2 = getStringFromWasm0(r0, r1).slice();
416
- wasm.__wbindgen_export_4(r0, r1 * 1, 1);
417
- }
418
- return v2;
419
- } finally {
420
- wasm.__wbindgen_add_to_stack_pointer(16);
421
- }
422
- };
423
-
424
- /**
425
- * @param {string} code
426
- * @param {string[]} language_features
427
- * @returns {string}
428
- */
429
- module.exports.get_ast = function(code, language_features) {
430
- let deferred4_0;
431
- let deferred4_1;
432
- try {
433
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
434
- const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
435
- const len0 = WASM_VECTOR_LEN;
436
- const ptr1 = passArrayJsValueToWasm0(language_features, wasm.__wbindgen_export_0);
437
- const len1 = WASM_VECTOR_LEN;
438
- wasm.get_ast(retptr, ptr0, len0, ptr1, len1);
439
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
440
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
441
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
442
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
443
- var ptr3 = r0;
444
- var len3 = r1;
445
- if (r3) {
446
- ptr3 = 0; len3 = 0;
447
- throw takeObject(r2);
448
- }
449
- deferred4_0 = ptr3;
450
- deferred4_1 = len3;
451
- return getStringFromWasm0(ptr3, len3);
452
- } finally {
453
- wasm.__wbindgen_add_to_stack_pointer(16);
454
- wasm.__wbindgen_export_4(deferred4_0, deferred4_1, 1);
455
- }
456
- };
457
-
458
- /**
459
- * @param {string} code
460
- * @param {string[]} language_features
461
- * @returns {string}
462
- */
463
- module.exports.get_hir = function(code, language_features) {
464
- let deferred4_0;
465
- let deferred4_1;
466
- try {
467
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
468
- const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
469
- const len0 = WASM_VECTOR_LEN;
470
- const ptr1 = passArrayJsValueToWasm0(language_features, wasm.__wbindgen_export_0);
471
- const len1 = WASM_VECTOR_LEN;
472
- wasm.get_hir(retptr, ptr0, len0, ptr1, len1);
473
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
474
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
475
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
476
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
477
- var ptr3 = r0;
478
- var len3 = r1;
479
- if (r3) {
480
- ptr3 = 0; len3 = 0;
481
- throw takeObject(r2);
482
- }
483
- deferred4_0 = ptr3;
484
- deferred4_1 = len3;
485
- return getStringFromWasm0(ptr3, len3);
486
- } finally {
487
- wasm.__wbindgen_add_to_stack_pointer(16);
488
- wasm.__wbindgen_export_4(deferred4_0, deferred4_1, 1);
489
- }
490
- };
491
-
492
- /**
493
- * @param {IProgramConfig} program
494
- * @returns {string[]}
495
- */
496
- module.exports.get_rir = function(program) {
497
- try {
498
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
499
- wasm.get_rir(retptr, addHeapObject(program));
500
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
501
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
502
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
503
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
504
- if (r3) {
505
- throw takeObject(r2);
506
- }
507
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
508
- wasm.__wbindgen_export_4(r0, r1 * 4, 4);
509
- return v1;
510
- } finally {
511
- wasm.__wbindgen_add_to_stack_pointer(16);
512
- }
513
- };
514
-
515
- /**
516
- * @param {string} file_name
517
- * @param {string} source
518
- * @returns {string | undefined}
519
- */
520
- module.exports.get_target_profile_from_entry_point = function(file_name, source) {
521
- try {
522
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
523
- const ptr0 = passStringToWasm0(file_name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
524
- const len0 = WASM_VECTOR_LEN;
525
- const ptr1 = passStringToWasm0(source, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
526
- const len1 = WASM_VECTOR_LEN;
527
- wasm.get_target_profile_from_entry_point(retptr, ptr0, len0, ptr1, len1);
528
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
529
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
530
- let v3;
531
- if (r0 !== 0) {
532
- v3 = getStringFromWasm0(r0, r1).slice();
533
- wasm.__wbindgen_export_4(r0, r1 * 1, 1);
534
- }
535
- return v3;
536
- } finally {
537
- wasm.__wbindgen_add_to_stack_pointer(16);
538
- }
539
- };
540
-
541
- /**
542
- * @param {IProgramConfig} program
543
- * @param {string} expr
544
- * @param {Function} event_cb
545
- * @param {number} shots
546
- * @returns {boolean}
547
- */
548
- module.exports.run = function(program, expr, event_cb, shots) {
549
- try {
550
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
551
- const ptr0 = passStringToWasm0(expr, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
552
- const len0 = WASM_VECTOR_LEN;
553
- wasm.run(retptr, addHeapObject(program), ptr0, len0, addBorrowedObject(event_cb), shots);
554
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
555
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
556
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
557
- if (r2) {
558
- throw takeObject(r1);
559
- }
560
- return r0 !== 0;
561
- } finally {
562
- wasm.__wbindgen_add_to_stack_pointer(16);
563
- heap[stack_pointer++] = undefined;
564
- }
565
- };
566
-
567
- /**
568
- * @param {IProgramConfig} program
569
- * @param {string} expr
570
- * @param {Function} event_cb
571
- * @param {number} shots
572
- * @param {any} pauliNoise
573
- * @param {any} qubitLoss
574
- * @returns {boolean}
575
- */
576
- module.exports.runWithNoise = function(program, expr, event_cb, shots, pauliNoise, qubitLoss) {
577
- try {
578
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
579
- const ptr0 = passStringToWasm0(expr, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
580
- const len0 = WASM_VECTOR_LEN;
581
- wasm.runWithNoise(retptr, addHeapObject(program), ptr0, len0, addBorrowedObject(event_cb), shots, addBorrowedObject(pauliNoise), addBorrowedObject(qubitLoss));
582
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
583
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
584
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
585
- if (r2) {
586
- throw takeObject(r1);
587
- }
588
- return r0 !== 0;
589
- } finally {
590
- wasm.__wbindgen_add_to_stack_pointer(16);
591
- heap[stack_pointer++] = undefined;
592
- heap[stack_pointer++] = undefined;
593
- heap[stack_pointer++] = undefined;
594
- }
595
- };
596
-
597
- /**
598
- * @param {string} solution_code
599
- * @param {any} exercise_sources_js
600
- * @param {Function} event_cb
601
- * @returns {boolean}
602
- */
603
- module.exports.check_exercise_solution = function(solution_code, exercise_sources_js, event_cb) {
604
- try {
605
- const ptr0 = passStringToWasm0(solution_code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
606
- const len0 = WASM_VECTOR_LEN;
607
- const ret = wasm.check_exercise_solution(ptr0, len0, addHeapObject(exercise_sources_js), addBorrowedObject(event_cb));
608
- return ret !== 0;
609
- } finally {
610
- heap[stack_pointer++] = undefined;
611
- }
612
- };
613
-
614
- /**
615
- * @param {IProgramConfig | null} [additional_program]
616
- * @returns {IDocFile[]}
617
- */
618
- module.exports.generate_docs = function(additional_program) {
619
- try {
620
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
621
- wasm.generate_docs(retptr, isLikeNone(additional_program) ? 0 : addHeapObject(additional_program));
622
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
623
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
624
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
625
- wasm.__wbindgen_export_4(r0, r1 * 4, 4);
626
- return v1;
627
- } finally {
628
- wasm.__wbindgen_add_to_stack_pointer(16);
629
- }
630
- };
631
-
632
- /**
633
- * @returns {string}
634
- */
635
- module.exports.get_library_summaries = function() {
636
- let deferred1_0;
637
- let deferred1_1;
638
- try {
639
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
640
- wasm.get_library_summaries(retptr);
641
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
642
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
643
- deferred1_0 = r0;
644
- deferred1_1 = r1;
645
- return getStringFromWasm0(r0, r1);
646
- } finally {
647
- wasm.__wbindgen_add_to_stack_pointer(16);
648
- wasm.__wbindgen_export_4(deferred1_0, deferred1_1, 1);
649
- }
650
- };
651
-
652
- function __wbg_adapter_52(arg0, arg1, arg2) {
653
- wasm.__wbindgen_export_5(arg0, arg1, addHeapObject(arg2));
654
- }
655
-
656
- function __wbg_adapter_203(arg0, arg1, arg2, arg3) {
657
- wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
658
- }
659
-
660
- /**
661
- * @enum {0 | 1 | 2 | 3 | 4 | 5}
662
- */
663
- module.exports.StepResultId = Object.freeze({
664
- BreakpointHit: 0, "0": "BreakpointHit",
665
- Next: 1, "1": "Next",
666
- StepIn: 2, "2": "StepIn",
667
- StepOut: 3, "3": "StepOut",
668
- Return: 4, "4": "Return",
669
- Fail: 5, "5": "Fail",
670
- });
671
-
672
- const DebugServiceFinalization = (typeof FinalizationRegistry === 'undefined')
673
- ? { register: () => {}, unregister: () => {} }
674
- : new FinalizationRegistry(ptr => wasm.__wbg_debugservice_free(ptr >>> 0, 1));
675
-
676
- class DebugService {
677
-
678
- __destroy_into_raw() {
679
- const ptr = this.__wbg_ptr;
680
- this.__wbg_ptr = 0;
681
- DebugServiceFinalization.unregister(this);
682
- return ptr;
683
- }
684
-
685
- free() {
686
- const ptr = this.__destroy_into_raw();
687
- wasm.__wbg_debugservice_free(ptr, 0);
688
- }
689
- constructor() {
690
- const ret = wasm.debugservice_new();
691
- this.__wbg_ptr = ret >>> 0;
692
- DebugServiceFinalization.register(this, this.__wbg_ptr, this);
693
- return this;
694
- }
695
- /**
696
- * @param {IProgramConfig} program
697
- * @param {string | null} [entry]
698
- * @returns {string}
699
- */
700
- load_program(program, entry) {
701
- let deferred2_0;
702
- let deferred2_1;
703
- try {
704
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
705
- var ptr0 = isLikeNone(entry) ? 0 : passStringToWasm0(entry, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
706
- var len0 = WASM_VECTOR_LEN;
707
- wasm.debugservice_load_program(retptr, this.__wbg_ptr, addHeapObject(program), ptr0, len0);
708
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
709
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
710
- deferred2_0 = r0;
711
- deferred2_1 = r1;
712
- return getStringFromWasm0(r0, r1);
713
- } finally {
714
- wasm.__wbindgen_add_to_stack_pointer(16);
715
- wasm.__wbindgen_export_4(deferred2_0, deferred2_1, 1);
716
- }
3
+ class DebugService {
4
+ __destroy_into_raw() {
5
+ const ptr = this.__wbg_ptr;
6
+ this.__wbg_ptr = 0;
7
+ DebugServiceFinalization.unregister(this);
8
+ return ptr;
9
+ }
10
+ free() {
11
+ const ptr = this.__destroy_into_raw();
12
+ wasm.__wbg_debugservice_free(ptr, 0);
717
13
  }
718
14
  /**
719
15
  * @returns {IQuantumStateList}
@@ -722,42 +18,17 @@ class DebugService {
722
18
  const ret = wasm.debugservice_capture_quantum_state(this.__wbg_ptr);
723
19
  return takeObject(ret);
724
20
  }
725
- /**
726
- * @returns {any}
727
- */
728
- get_circuit() {
729
- try {
730
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
731
- wasm.debugservice_get_circuit(retptr, this.__wbg_ptr);
732
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
733
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
734
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
735
- if (r2) {
736
- throw takeObject(r1);
737
- }
738
- return takeObject(r0);
739
- } finally {
740
- wasm.__wbindgen_add_to_stack_pointer(16);
741
- }
742
- }
743
- /**
744
- * @returns {IStackFrameList}
745
- */
746
- get_stack_frames() {
747
- const ret = wasm.debugservice_get_stack_frames(this.__wbg_ptr);
748
- return takeObject(ret);
749
- }
750
21
  /**
751
22
  * @param {Function} event_cb
752
23
  * @param {Uint32Array} ids
753
24
  * @returns {IStructStepResult}
754
25
  */
755
- eval_next(event_cb, ids) {
26
+ eval_continue(event_cb, ids) {
756
27
  try {
757
28
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
758
- const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_export_0);
29
+ const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_export);
759
30
  const len0 = WASM_VECTOR_LEN;
760
- wasm.debugservice_eval_next(retptr, this.__wbg_ptr, addBorrowedObject(event_cb), ptr0, len0);
31
+ wasm.debugservice_eval_continue(retptr, this.__wbg_ptr, addBorrowedObject(event_cb), ptr0, len0);
761
32
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
762
33
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
763
34
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -775,12 +46,12 @@ class DebugService {
775
46
  * @param {Uint32Array} ids
776
47
  * @returns {IStructStepResult}
777
48
  */
778
- eval_continue(event_cb, ids) {
49
+ eval_next(event_cb, ids) {
779
50
  try {
780
51
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
781
- const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_export_0);
52
+ const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_export);
782
53
  const len0 = WASM_VECTOR_LEN;
783
- wasm.debugservice_eval_continue(retptr, this.__wbg_ptr, addBorrowedObject(event_cb), ptr0, len0);
54
+ wasm.debugservice_eval_next(retptr, this.__wbg_ptr, addBorrowedObject(event_cb), ptr0, len0);
784
55
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
785
56
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
786
57
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -801,7 +72,7 @@ class DebugService {
801
72
  eval_step_in(event_cb, ids) {
802
73
  try {
803
74
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
804
- const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_export_0);
75
+ const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_export);
805
76
  const len0 = WASM_VECTOR_LEN;
806
77
  wasm.debugservice_eval_step_in(retptr, this.__wbg_ptr, addBorrowedObject(event_cb), ptr0, len0);
807
78
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
@@ -824,7 +95,7 @@ class DebugService {
824
95
  eval_step_out(event_cb, ids) {
825
96
  try {
826
97
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
827
- const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_export_0);
98
+ const ptr0 = passArray32ToWasm0(ids, wasm.__wbindgen_export);
828
99
  const len0 = WASM_VECTOR_LEN;
829
100
  wasm.debugservice_eval_step_out(retptr, this.__wbg_ptr, addBorrowedObject(event_cb), ptr0, len0);
830
101
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
@@ -844,11 +115,29 @@ class DebugService {
844
115
  * @returns {IBreakpointSpanList}
845
116
  */
846
117
  get_breakpoints(path) {
847
- const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
118
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
848
119
  const len0 = WASM_VECTOR_LEN;
849
120
  const ret = wasm.debugservice_get_breakpoints(this.__wbg_ptr, ptr0, len0);
850
121
  return takeObject(ret);
851
122
  }
123
+ /**
124
+ * @returns {any}
125
+ */
126
+ get_circuit() {
127
+ try {
128
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
129
+ wasm.debugservice_get_circuit(retptr, this.__wbg_ptr);
130
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
131
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
132
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
133
+ if (r2) {
134
+ throw takeObject(r1);
135
+ }
136
+ return takeObject(r0);
137
+ } finally {
138
+ wasm.__wbindgen_add_to_stack_pointer(16);
139
+ }
140
+ }
852
141
  /**
853
142
  * @param {number} frame_id
854
143
  * @returns {IVariableList}
@@ -857,99 +146,73 @@ class DebugService {
857
146
  const ret = wasm.debugservice_get_locals(this.__wbg_ptr, frame_id);
858
147
  return takeObject(ret);
859
148
  }
149
+ /**
150
+ * @returns {IStackFrameList}
151
+ */
152
+ get_stack_frames() {
153
+ const ret = wasm.debugservice_get_stack_frames(this.__wbg_ptr);
154
+ return takeObject(ret);
155
+ }
156
+ /**
157
+ * @param {IProgramConfig} program
158
+ * @param {string | null} [entry]
159
+ * @returns {string}
160
+ */
161
+ load_program(program, entry) {
162
+ let deferred2_0;
163
+ let deferred2_1;
164
+ try {
165
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
166
+ var ptr0 = isLikeNone(entry) ? 0 : passStringToWasm0(entry, wasm.__wbindgen_export, wasm.__wbindgen_export2);
167
+ var len0 = WASM_VECTOR_LEN;
168
+ wasm.debugservice_load_program(retptr, this.__wbg_ptr, addHeapObject(program), ptr0, len0);
169
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
170
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
171
+ deferred2_0 = r0;
172
+ deferred2_1 = r1;
173
+ return getStringFromWasm0(r0, r1);
174
+ } finally {
175
+ wasm.__wbindgen_add_to_stack_pointer(16);
176
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
177
+ }
178
+ }
179
+ constructor() {
180
+ const ret = wasm.debugservice_new();
181
+ this.__wbg_ptr = ret >>> 0;
182
+ DebugServiceFinalization.register(this, this.__wbg_ptr, this);
183
+ return this;
184
+ }
860
185
  }
861
- module.exports.DebugService = DebugService;
862
-
863
- const LanguageServiceFinalization = (typeof FinalizationRegistry === 'undefined')
864
- ? { register: () => {}, unregister: () => {} }
865
- : new FinalizationRegistry(ptr => wasm.__wbg_languageservice_free(ptr >>> 0, 1));
186
+ if (Symbol.dispose) DebugService.prototype[Symbol.dispose] = DebugService.prototype.free;
187
+ exports.DebugService = DebugService;
866
188
 
867
189
  class LanguageService {
868
-
869
190
  __destroy_into_raw() {
870
191
  const ptr = this.__wbg_ptr;
871
192
  this.__wbg_ptr = 0;
872
193
  LanguageServiceFinalization.unregister(this);
873
194
  return ptr;
874
195
  }
875
-
876
196
  free() {
877
197
  const ptr = this.__destroy_into_raw();
878
198
  wasm.__wbg_languageservice_free(ptr, 0);
879
199
  }
880
- constructor() {
881
- const ret = wasm.languageservice_new();
882
- this.__wbg_ptr = ret >>> 0;
883
- LanguageServiceFinalization.register(this, this.__wbg_ptr, this);
884
- return this;
885
- }
886
- /**
887
- * @param {(uri: string, version: number | undefined, diagnostics: VSDiagnostic[]) => void} diagnostics_callback
888
- * @param {(callables: ITestDescriptor[]) => void} test_callables_callback
889
- * @param {IProjectHost} host
890
- * @returns {Promise<any>}
891
- */
892
- start_background_work(diagnostics_callback, test_callables_callback, host) {
893
- try {
894
- const ret = wasm.languageservice_start_background_work(this.__wbg_ptr, addBorrowedObject(diagnostics_callback), addBorrowedObject(test_callables_callback), addHeapObject(host));
895
- return takeObject(ret);
896
- } finally {
897
- heap[stack_pointer++] = undefined;
898
- heap[stack_pointer++] = undefined;
899
- }
900
- }
901
- stop_background_work() {
902
- wasm.languageservice_stop_background_work(this.__wbg_ptr);
903
- }
904
- /**
905
- * @param {IWorkspaceConfiguration} config
906
- */
907
- update_configuration(config) {
908
- wasm.languageservice_update_configuration(this.__wbg_ptr, addHeapObject(config));
909
- }
910
- /**
911
- * @param {string} uri
912
- * @param {number} version
913
- * @param {string} text
914
- * @param {string} language_id
915
- */
916
- update_document(uri, version, text, language_id) {
917
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
918
- const len0 = WASM_VECTOR_LEN;
919
- const ptr1 = passStringToWasm0(text, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
920
- const len1 = WASM_VECTOR_LEN;
921
- const ptr2 = passStringToWasm0(language_id, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
922
- const len2 = WASM_VECTOR_LEN;
923
- wasm.languageservice_update_document(this.__wbg_ptr, ptr0, len0, version, ptr1, len1, ptr2, len2);
924
- }
925
200
  /**
926
201
  * @param {string} uri
927
202
  * @param {string} language_id
928
203
  */
929
204
  close_document(uri, language_id) {
930
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
205
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
931
206
  const len0 = WASM_VECTOR_LEN;
932
- const ptr1 = passStringToWasm0(language_id, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
207
+ const ptr1 = passStringToWasm0(language_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
933
208
  const len1 = WASM_VECTOR_LEN;
934
209
  wasm.languageservice_close_document(this.__wbg_ptr, ptr0, len0, ptr1, len1);
935
210
  }
936
- /**
937
- * @param {string} notebook_uri
938
- * @param {INotebookMetadata} notebook_metadata
939
- * @param {ICell[]} cells
940
- */
941
- update_notebook_document(notebook_uri, notebook_metadata, cells) {
942
- const ptr0 = passStringToWasm0(notebook_uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
943
- const len0 = WASM_VECTOR_LEN;
944
- const ptr1 = passArrayJsValueToWasm0(cells, wasm.__wbindgen_export_0);
945
- const len1 = WASM_VECTOR_LEN;
946
- wasm.languageservice_update_notebook_document(this.__wbg_ptr, ptr0, len0, addHeapObject(notebook_metadata), ptr1, len1);
947
- }
948
211
  /**
949
212
  * @param {string} notebook_uri
950
213
  */
951
214
  close_notebook_document(notebook_uri) {
952
- const ptr0 = passStringToWasm0(notebook_uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
215
+ const ptr0 = passStringToWasm0(notebook_uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
953
216
  const len0 = WASM_VECTOR_LEN;
954
217
  wasm.languageservice_close_notebook_document(this.__wbg_ptr, ptr0, len0);
955
218
  }
@@ -961,13 +224,32 @@ class LanguageService {
961
224
  get_code_actions(uri, range) {
962
225
  try {
963
226
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
964
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
227
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
965
228
  const len0 = WASM_VECTOR_LEN;
966
229
  wasm.languageservice_get_code_actions(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(range));
967
230
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
968
231
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
969
232
  var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
970
- wasm.__wbindgen_export_4(r0, r1 * 4, 4);
233
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
234
+ return v2;
235
+ } finally {
236
+ wasm.__wbindgen_add_to_stack_pointer(16);
237
+ }
238
+ }
239
+ /**
240
+ * @param {string} uri
241
+ * @returns {ICodeLens[]}
242
+ */
243
+ get_code_lenses(uri) {
244
+ try {
245
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
246
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
247
+ const len0 = WASM_VECTOR_LEN;
248
+ wasm.languageservice_get_code_lenses(retptr, this.__wbg_ptr, ptr0, len0);
249
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
250
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
251
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
252
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
971
253
  return v2;
972
254
  } finally {
973
255
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -979,7 +261,7 @@ class LanguageService {
979
261
  * @returns {ICompletionList}
980
262
  */
981
263
  get_completions(uri, position) {
982
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
264
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
983
265
  const len0 = WASM_VECTOR_LEN;
984
266
  const ret = wasm.languageservice_get_completions(this.__wbg_ptr, ptr0, len0, addHeapObject(position));
985
267
  return takeObject(ret);
@@ -990,27 +272,25 @@ class LanguageService {
990
272
  * @returns {ILocation | undefined}
991
273
  */
992
274
  get_definition(uri, position) {
993
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
275
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
994
276
  const len0 = WASM_VECTOR_LEN;
995
277
  const ret = wasm.languageservice_get_definition(this.__wbg_ptr, ptr0, len0, addHeapObject(position));
996
278
  return takeObject(ret);
997
279
  }
998
280
  /**
999
281
  * @param {string} uri
1000
- * @param {IPosition} position
1001
- * @param {boolean} include_declaration
1002
- * @returns {ILocation[]}
282
+ * @returns {ITextEdit[]}
1003
283
  */
1004
- get_references(uri, position, include_declaration) {
284
+ get_format_changes(uri) {
1005
285
  try {
1006
286
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1007
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
287
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1008
288
  const len0 = WASM_VECTOR_LEN;
1009
- wasm.languageservice_get_references(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(position), include_declaration);
289
+ wasm.languageservice_get_format_changes(retptr, this.__wbg_ptr, ptr0, len0);
1010
290
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1011
291
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1012
292
  var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1013
- wasm.__wbindgen_export_4(r0, r1 * 4, 4);
293
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1014
294
  return v2;
1015
295
  } finally {
1016
296
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -1018,18 +298,31 @@ class LanguageService {
1018
298
  }
1019
299
  /**
1020
300
  * @param {string} uri
1021
- * @returns {ITextEdit[]}
301
+ * @param {IPosition} position
302
+ * @returns {IHover | undefined}
1022
303
  */
1023
- get_format_changes(uri) {
304
+ get_hover(uri, position) {
305
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
306
+ const len0 = WASM_VECTOR_LEN;
307
+ const ret = wasm.languageservice_get_hover(this.__wbg_ptr, ptr0, len0, addHeapObject(position));
308
+ return takeObject(ret);
309
+ }
310
+ /**
311
+ * @param {string} uri
312
+ * @param {IPosition} position
313
+ * @param {boolean} include_declaration
314
+ * @returns {ILocation[]}
315
+ */
316
+ get_references(uri, position, include_declaration) {
1024
317
  try {
1025
318
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1026
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
319
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1027
320
  const len0 = WASM_VECTOR_LEN;
1028
- wasm.languageservice_get_format_changes(retptr, this.__wbg_ptr, ptr0, len0);
321
+ wasm.languageservice_get_references(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(position), include_declaration);
1029
322
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1030
323
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1031
324
  var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1032
- wasm.__wbindgen_export_4(r0, r1 * 4, 4);
325
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1033
326
  return v2;
1034
327
  } finally {
1035
328
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -1037,652 +330,1285 @@ class LanguageService {
1037
330
  }
1038
331
  /**
1039
332
  * @param {string} uri
1040
- * @param {IPosition} position
1041
- * @returns {IHover | undefined}
333
+ * @param {IPosition} position
334
+ * @param {string} new_name
335
+ * @returns {IWorkspaceEdit}
336
+ */
337
+ get_rename(uri, position, new_name) {
338
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
339
+ const len0 = WASM_VECTOR_LEN;
340
+ const ptr1 = passStringToWasm0(new_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
341
+ const len1 = WASM_VECTOR_LEN;
342
+ const ret = wasm.languageservice_get_rename(this.__wbg_ptr, ptr0, len0, addHeapObject(position), ptr1, len1);
343
+ return takeObject(ret);
344
+ }
345
+ /**
346
+ * @param {string} uri
347
+ * @param {IPosition} position
348
+ * @returns {ISignatureHelp | undefined}
349
+ */
350
+ get_signature_help(uri, position) {
351
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
352
+ const len0 = WASM_VECTOR_LEN;
353
+ const ret = wasm.languageservice_get_signature_help(this.__wbg_ptr, ptr0, len0, addHeapObject(position));
354
+ return takeObject(ret);
355
+ }
356
+ constructor() {
357
+ const ret = wasm.languageservice_new();
358
+ this.__wbg_ptr = ret >>> 0;
359
+ LanguageServiceFinalization.register(this, this.__wbg_ptr, this);
360
+ return this;
361
+ }
362
+ /**
363
+ * @param {string} uri
364
+ * @param {IPosition} position
365
+ * @returns {ITextEdit | undefined}
366
+ */
367
+ prepare_rename(uri, position) {
368
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
369
+ const len0 = WASM_VECTOR_LEN;
370
+ const ret = wasm.languageservice_prepare_rename(this.__wbg_ptr, ptr0, len0, addHeapObject(position));
371
+ return takeObject(ret);
372
+ }
373
+ /**
374
+ * @param {(uri: string, version: number | undefined, diagnostics: VSDiagnostic[]) => void} diagnostics_callback
375
+ * @param {(callables: ITestDescriptor[]) => void} test_callables_callback
376
+ * @param {IProjectHost} host
377
+ * @returns {Promise<any>}
378
+ */
379
+ start_background_work(diagnostics_callback, test_callables_callback, host) {
380
+ try {
381
+ const ret = wasm.languageservice_start_background_work(this.__wbg_ptr, addBorrowedObject(diagnostics_callback), addBorrowedObject(test_callables_callback), addHeapObject(host));
382
+ return takeObject(ret);
383
+ } finally {
384
+ heap[stack_pointer++] = undefined;
385
+ heap[stack_pointer++] = undefined;
386
+ }
387
+ }
388
+ stop_background_work() {
389
+ wasm.languageservice_stop_background_work(this.__wbg_ptr);
390
+ }
391
+ /**
392
+ * @param {IWorkspaceConfiguration} config
393
+ */
394
+ update_configuration(config) {
395
+ wasm.languageservice_update_configuration(this.__wbg_ptr, addHeapObject(config));
396
+ }
397
+ /**
398
+ * @param {string} uri
399
+ * @param {number} version
400
+ * @param {string} text
401
+ * @param {string} language_id
1042
402
  */
1043
- get_hover(uri, position) {
1044
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
403
+ update_document(uri, version, text, language_id) {
404
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1045
405
  const len0 = WASM_VECTOR_LEN;
1046
- const ret = wasm.languageservice_get_hover(this.__wbg_ptr, ptr0, len0, addHeapObject(position));
1047
- return takeObject(ret);
406
+ const ptr1 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
407
+ const len1 = WASM_VECTOR_LEN;
408
+ const ptr2 = passStringToWasm0(language_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
409
+ const len2 = WASM_VECTOR_LEN;
410
+ wasm.languageservice_update_document(this.__wbg_ptr, ptr0, len0, version, ptr1, len1, ptr2, len2);
1048
411
  }
1049
412
  /**
1050
- * @param {string} uri
1051
- * @param {IPosition} position
1052
- * @returns {ISignatureHelp | undefined}
413
+ * @param {string} notebook_uri
414
+ * @param {INotebookMetadata} notebook_metadata
415
+ * @param {ICell[]} cells
1053
416
  */
1054
- get_signature_help(uri, position) {
1055
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
417
+ update_notebook_document(notebook_uri, notebook_metadata, cells) {
418
+ const ptr0 = passStringToWasm0(notebook_uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1056
419
  const len0 = WASM_VECTOR_LEN;
1057
- const ret = wasm.languageservice_get_signature_help(this.__wbg_ptr, ptr0, len0, addHeapObject(position));
1058
- return takeObject(ret);
420
+ const ptr1 = passArrayJsValueToWasm0(cells, wasm.__wbindgen_export);
421
+ const len1 = WASM_VECTOR_LEN;
422
+ wasm.languageservice_update_notebook_document(this.__wbg_ptr, ptr0, len0, addHeapObject(notebook_metadata), ptr1, len1);
423
+ }
424
+ }
425
+ if (Symbol.dispose) LanguageService.prototype[Symbol.dispose] = LanguageService.prototype.free;
426
+ exports.LanguageService = LanguageService;
427
+
428
+ /**
429
+ * a minimal implementation for interacting with async JS filesystem callbacks to
430
+ * load project files
431
+ */
432
+ class ProjectLoader {
433
+ __destroy_into_raw() {
434
+ const ptr = this.__wbg_ptr;
435
+ this.__wbg_ptr = 0;
436
+ ProjectLoaderFinalization.unregister(this);
437
+ return ptr;
438
+ }
439
+ free() {
440
+ const ptr = this.__destroy_into_raw();
441
+ wasm.__wbg_projectloader_free(ptr, 0);
1059
442
  }
1060
443
  /**
1061
- * @param {string} uri
1062
- * @param {IPosition} position
1063
- * @param {string} new_name
1064
- * @returns {IWorkspaceEdit}
444
+ * @param {string} file_path
445
+ * @param {string | null} [source]
446
+ * @returns {Promise<IProjectConfig>}
1065
447
  */
1066
- get_rename(uri, position, new_name) {
1067
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
448
+ load_openqasm_project(file_path, source) {
449
+ const ptr0 = passStringToWasm0(file_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1068
450
  const len0 = WASM_VECTOR_LEN;
1069
- const ptr1 = passStringToWasm0(new_name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1070
- const len1 = WASM_VECTOR_LEN;
1071
- const ret = wasm.languageservice_get_rename(this.__wbg_ptr, ptr0, len0, addHeapObject(position), ptr1, len1);
451
+ var ptr1 = isLikeNone(source) ? 0 : passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
452
+ var len1 = WASM_VECTOR_LEN;
453
+ const ret = wasm.projectloader_load_openqasm_project(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1072
454
  return takeObject(ret);
1073
455
  }
1074
456
  /**
1075
- * @param {string} uri
1076
- * @param {IPosition} position
1077
- * @returns {ITextEdit | undefined}
457
+ * @param {string} directory
458
+ * @returns {Promise<IProjectConfig>}
1078
459
  */
1079
- prepare_rename(uri, position) {
1080
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
460
+ load_project_with_deps(directory) {
461
+ const ptr0 = passStringToWasm0(directory, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1081
462
  const len0 = WASM_VECTOR_LEN;
1082
- const ret = wasm.languageservice_prepare_rename(this.__wbg_ptr, ptr0, len0, addHeapObject(position));
463
+ const ret = wasm.projectloader_load_project_with_deps(this.__wbg_ptr, ptr0, len0);
1083
464
  return takeObject(ret);
1084
465
  }
1085
466
  /**
1086
- * @param {string} uri
1087
- * @returns {ICodeLens[]}
467
+ * @param {IProjectHost} project_host
1088
468
  */
1089
- get_code_lenses(uri) {
1090
- try {
1091
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1092
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1093
- const len0 = WASM_VECTOR_LEN;
1094
- wasm.languageservice_get_code_lenses(retptr, this.__wbg_ptr, ptr0, len0);
1095
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1096
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1097
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1098
- wasm.__wbindgen_export_4(r0, r1 * 4, 4);
1099
- return v2;
1100
- } finally {
1101
- wasm.__wbindgen_add_to_stack_pointer(16);
469
+ constructor(project_host) {
470
+ const ret = wasm.projectloader_new(addHeapObject(project_host));
471
+ this.__wbg_ptr = ret >>> 0;
472
+ ProjectLoaderFinalization.register(this, this.__wbg_ptr, this);
473
+ return this;
474
+ }
475
+ }
476
+ if (Symbol.dispose) ProjectLoader.prototype[Symbol.dispose] = ProjectLoader.prototype.free;
477
+ exports.ProjectLoader = ProjectLoader;
478
+
479
+ /**
480
+ * @enum {0 | 1 | 2 | 3 | 4 | 5}
481
+ */
482
+ const StepResultId = Object.freeze({
483
+ BreakpointHit: 0, "0": "BreakpointHit",
484
+ Next: 1, "1": "Next",
485
+ StepIn: 2, "2": "StepIn",
486
+ StepOut: 3, "3": "StepOut",
487
+ Return: 4, "4": "Return",
488
+ Fail: 5, "5": "Fail",
489
+ });
490
+ exports.StepResultId = StepResultId;
491
+
492
+ /**
493
+ * @param {string} solution_code
494
+ * @param {any} exercise_sources_js
495
+ * @param {Function} event_cb
496
+ * @returns {boolean}
497
+ */
498
+ function check_exercise_solution(solution_code, exercise_sources_js, event_cb) {
499
+ try {
500
+ const ptr0 = passStringToWasm0(solution_code, wasm.__wbindgen_export, wasm.__wbindgen_export2);
501
+ const len0 = WASM_VECTOR_LEN;
502
+ const ret = wasm.check_exercise_solution(ptr0, len0, addHeapObject(exercise_sources_js), addBorrowedObject(event_cb));
503
+ return ret !== 0;
504
+ } finally {
505
+ heap[stack_pointer++] = undefined;
506
+ }
507
+ }
508
+ exports.check_exercise_solution = check_exercise_solution;
509
+
510
+ /**
511
+ * @param {IProgramConfig | null} [additional_program]
512
+ * @returns {IDocFile[]}
513
+ */
514
+ function generate_docs(additional_program) {
515
+ try {
516
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
517
+ wasm.generate_docs(retptr, isLikeNone(additional_program) ? 0 : addHeapObject(additional_program));
518
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
519
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
520
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
521
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
522
+ return v1;
523
+ } finally {
524
+ wasm.__wbindgen_add_to_stack_pointer(16);
525
+ }
526
+ }
527
+ exports.generate_docs = generate_docs;
528
+
529
+ /**
530
+ * @param {string} code
531
+ * @param {string[]} language_features
532
+ * @returns {string}
533
+ */
534
+ function get_ast(code, language_features) {
535
+ let deferred4_0;
536
+ let deferred4_1;
537
+ try {
538
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
539
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export, wasm.__wbindgen_export2);
540
+ const len0 = WASM_VECTOR_LEN;
541
+ const ptr1 = passArrayJsValueToWasm0(language_features, wasm.__wbindgen_export);
542
+ const len1 = WASM_VECTOR_LEN;
543
+ wasm.get_ast(retptr, ptr0, len0, ptr1, len1);
544
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
545
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
546
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
547
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
548
+ var ptr3 = r0;
549
+ var len3 = r1;
550
+ if (r3) {
551
+ ptr3 = 0; len3 = 0;
552
+ throw takeObject(r2);
553
+ }
554
+ deferred4_0 = ptr3;
555
+ deferred4_1 = len3;
556
+ return getStringFromWasm0(ptr3, len3);
557
+ } finally {
558
+ wasm.__wbindgen_add_to_stack_pointer(16);
559
+ wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
560
+ }
561
+ }
562
+ exports.get_ast = get_ast;
563
+
564
+ /**
565
+ * @param {IProgramConfig} program
566
+ * @param {IOperationInfo | null | undefined} operation
567
+ * @param {ICircuitConfig} config
568
+ * @returns {any}
569
+ */
570
+ function get_circuit(program, operation, config) {
571
+ try {
572
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
573
+ wasm.get_circuit(retptr, addHeapObject(program), isLikeNone(operation) ? 0 : addHeapObject(operation), addHeapObject(config));
574
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
575
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
576
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
577
+ if (r2) {
578
+ throw takeObject(r1);
579
+ }
580
+ return takeObject(r0);
581
+ } finally {
582
+ wasm.__wbindgen_add_to_stack_pointer(16);
583
+ }
584
+ }
585
+ exports.get_circuit = get_circuit;
586
+
587
+ /**
588
+ * @param {IProgramConfig} program
589
+ * @param {string} expr
590
+ * @param {string} params
591
+ * @returns {string}
592
+ */
593
+ function get_estimates(program, expr, params) {
594
+ let deferred4_0;
595
+ let deferred4_1;
596
+ try {
597
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
598
+ const ptr0 = passStringToWasm0(expr, wasm.__wbindgen_export, wasm.__wbindgen_export2);
599
+ const len0 = WASM_VECTOR_LEN;
600
+ const ptr1 = passStringToWasm0(params, wasm.__wbindgen_export, wasm.__wbindgen_export2);
601
+ const len1 = WASM_VECTOR_LEN;
602
+ wasm.get_estimates(retptr, addHeapObject(program), ptr0, len0, ptr1, len1);
603
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
604
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
605
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
606
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
607
+ var ptr3 = r0;
608
+ var len3 = r1;
609
+ if (r3) {
610
+ ptr3 = 0; len3 = 0;
611
+ throw takeObject(r2);
612
+ }
613
+ deferred4_0 = ptr3;
614
+ deferred4_1 = len3;
615
+ return getStringFromWasm0(ptr3, len3);
616
+ } finally {
617
+ wasm.__wbindgen_add_to_stack_pointer(16);
618
+ wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
619
+ }
620
+ }
621
+ exports.get_estimates = get_estimates;
622
+
623
+ /**
624
+ * @param {string} code
625
+ * @param {string[]} language_features
626
+ * @returns {string}
627
+ */
628
+ function get_hir(code, language_features) {
629
+ let deferred4_0;
630
+ let deferred4_1;
631
+ try {
632
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
633
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export, wasm.__wbindgen_export2);
634
+ const len0 = WASM_VECTOR_LEN;
635
+ const ptr1 = passArrayJsValueToWasm0(language_features, wasm.__wbindgen_export);
636
+ const len1 = WASM_VECTOR_LEN;
637
+ wasm.get_hir(retptr, ptr0, len0, ptr1, len1);
638
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
639
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
640
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
641
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
642
+ var ptr3 = r0;
643
+ var len3 = r1;
644
+ if (r3) {
645
+ ptr3 = 0; len3 = 0;
646
+ throw takeObject(r2);
647
+ }
648
+ deferred4_0 = ptr3;
649
+ deferred4_1 = len3;
650
+ return getStringFromWasm0(ptr3, len3);
651
+ } finally {
652
+ wasm.__wbindgen_add_to_stack_pointer(16);
653
+ wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
654
+ }
655
+ }
656
+ exports.get_hir = get_hir;
657
+
658
+ /**
659
+ * @param {string} name
660
+ * @returns {string | undefined}
661
+ */
662
+ function get_library_source_content(name) {
663
+ try {
664
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
665
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
666
+ const len0 = WASM_VECTOR_LEN;
667
+ wasm.get_library_source_content(retptr, ptr0, len0);
668
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
669
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
670
+ let v2;
671
+ if (r0 !== 0) {
672
+ v2 = getStringFromWasm0(r0, r1).slice();
673
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1102
674
  }
675
+ return v2;
676
+ } finally {
677
+ wasm.__wbindgen_add_to_stack_pointer(16);
1103
678
  }
1104
679
  }
1105
- module.exports.LanguageService = LanguageService;
680
+ exports.get_library_source_content = get_library_source_content;
1106
681
 
1107
- const ProjectLoaderFinalization = (typeof FinalizationRegistry === 'undefined')
1108
- ? { register: () => {}, unregister: () => {} }
1109
- : new FinalizationRegistry(ptr => wasm.__wbg_projectloader_free(ptr >>> 0, 1));
1110
682
  /**
1111
- * a minimal implementation for interacting with async JS filesystem callbacks to
1112
- * load project files
683
+ * @returns {string}
1113
684
  */
1114
- class ProjectLoader {
1115
-
1116
- __destroy_into_raw() {
1117
- const ptr = this.__wbg_ptr;
1118
- this.__wbg_ptr = 0;
1119
- ProjectLoaderFinalization.unregister(this);
1120
- return ptr;
685
+ function get_library_summaries() {
686
+ let deferred1_0;
687
+ let deferred1_1;
688
+ try {
689
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
690
+ wasm.get_library_summaries(retptr);
691
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
692
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
693
+ deferred1_0 = r0;
694
+ deferred1_1 = r1;
695
+ return getStringFromWasm0(r0, r1);
696
+ } finally {
697
+ wasm.__wbindgen_add_to_stack_pointer(16);
698
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1121
699
  }
700
+ }
701
+ exports.get_library_summaries = get_library_summaries;
1122
702
 
1123
- free() {
1124
- const ptr = this.__destroy_into_raw();
1125
- wasm.__wbg_projectloader_free(ptr, 0);
1126
- }
1127
- /**
1128
- * @param {IProjectHost} project_host
1129
- */
1130
- constructor(project_host) {
1131
- const ret = wasm.projectloader_new(addHeapObject(project_host));
1132
- this.__wbg_ptr = ret >>> 0;
1133
- ProjectLoaderFinalization.register(this, this.__wbg_ptr, this);
1134
- return this;
703
+ /**
704
+ * @param {IProgramConfig} program
705
+ * @returns {string}
706
+ */
707
+ function get_qir(program) {
708
+ let deferred2_0;
709
+ let deferred2_1;
710
+ try {
711
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
712
+ wasm.get_qir(retptr, addHeapObject(program));
713
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
714
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
715
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
716
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
717
+ var ptr1 = r0;
718
+ var len1 = r1;
719
+ if (r3) {
720
+ ptr1 = 0; len1 = 0;
721
+ throw takeObject(r2);
722
+ }
723
+ deferred2_0 = ptr1;
724
+ deferred2_1 = len1;
725
+ return getStringFromWasm0(ptr1, len1);
726
+ } finally {
727
+ wasm.__wbindgen_add_to_stack_pointer(16);
728
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
1135
729
  }
1136
- /**
1137
- * @param {string} directory
1138
- * @returns {Promise<IProjectConfig>}
1139
- */
1140
- load_project_with_deps(directory) {
1141
- const ptr0 = passStringToWasm0(directory, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1142
- const len0 = WASM_VECTOR_LEN;
1143
- const ret = wasm.projectloader_load_project_with_deps(this.__wbg_ptr, ptr0, len0);
1144
- return takeObject(ret);
730
+ }
731
+ exports.get_qir = get_qir;
732
+
733
+ /**
734
+ * @param {IProgramConfig} program
735
+ * @returns {string[]}
736
+ */
737
+ function get_rir(program) {
738
+ try {
739
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
740
+ wasm.get_rir(retptr, addHeapObject(program));
741
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
742
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
743
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
744
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
745
+ if (r3) {
746
+ throw takeObject(r2);
747
+ }
748
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
749
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
750
+ return v1;
751
+ } finally {
752
+ wasm.__wbindgen_add_to_stack_pointer(16);
1145
753
  }
1146
- /**
1147
- * @param {string} file_path
1148
- * @param {string | null} [source]
1149
- * @returns {Promise<IProjectConfig>}
1150
- */
1151
- load_openqasm_project(file_path, source) {
1152
- const ptr0 = passStringToWasm0(file_path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
754
+ }
755
+ exports.get_rir = get_rir;
756
+
757
+ /**
758
+ * @param {string} file_name
759
+ * @param {string} source
760
+ * @returns {string | undefined}
761
+ */
762
+ function get_target_profile_from_entry_point(file_name, source) {
763
+ try {
764
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
765
+ const ptr0 = passStringToWasm0(file_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1153
766
  const len0 = WASM_VECTOR_LEN;
1154
- var ptr1 = isLikeNone(source) ? 0 : passStringToWasm0(source, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1155
- var len1 = WASM_VECTOR_LEN;
1156
- const ret = wasm.projectloader_load_openqasm_project(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1157
- return takeObject(ret);
767
+ const ptr1 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
768
+ const len1 = WASM_VECTOR_LEN;
769
+ wasm.get_target_profile_from_entry_point(retptr, ptr0, len0, ptr1, len1);
770
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
771
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
772
+ let v3;
773
+ if (r0 !== 0) {
774
+ v3 = getStringFromWasm0(r0, r1).slice();
775
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
776
+ }
777
+ return v3;
778
+ } finally {
779
+ wasm.__wbindgen_add_to_stack_pointer(16);
1158
780
  }
1159
781
  }
1160
- module.exports.ProjectLoader = ProjectLoader;
1161
-
1162
- module.exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
1163
- const ret = String(getObject(arg1));
1164
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1165
- const len1 = WASM_VECTOR_LEN;
1166
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1167
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1168
- };
1169
-
1170
- module.exports.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
1171
- const ret = getObject(arg0).buffer;
1172
- return addHeapObject(ret);
1173
- };
1174
-
1175
- module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
1176
- const ret = getObject(arg0).call(getObject(arg1));
1177
- return addHeapObject(ret);
1178
- }, arguments) };
1179
-
1180
- module.exports.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
1181
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1182
- return addHeapObject(ret);
1183
- }, arguments) };
1184
-
1185
- module.exports.__wbg_call_b8adc8b1d0a0d8eb = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1186
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
1187
- return addHeapObject(ret);
1188
- }, arguments) };
1189
-
1190
- module.exports.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
1191
- const ret = getObject(arg0).crypto;
1192
- return addHeapObject(ret);
1193
- };
1194
-
1195
- module.exports.__wbg_done_769e5ede4b31c67b = function(arg0) {
1196
- const ret = getObject(arg0).done;
1197
- return ret;
1198
- };
1199
-
1200
- module.exports.__wbg_entries_3265d4158b33e5dc = function(arg0) {
1201
- const ret = Object.entries(getObject(arg0));
1202
- return addHeapObject(ret);
1203
- };
1204
-
1205
- module.exports.__wbg_fetchGithub_8d40e9b8dedfdb81 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) {
1206
- const ret = getObject(arg0).fetchGithub(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), getStringFromWasm0(arg5, arg6), getStringFromWasm0(arg7, arg8));
1207
- return addHeapObject(ret);
1208
- }, arguments) };
1209
-
1210
- module.exports.__wbg_findManifestDirectory_91ae20bc11401cd7 = function(arg0, arg1, arg2) {
1211
- const ret = getObject(arg0).findManifestDirectory(getStringFromWasm0(arg1, arg2));
1212
- return addHeapObject(ret);
1213
- };
1214
-
1215
- module.exports.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
1216
- const ret = Array.from(getObject(arg0));
1217
- return addHeapObject(ret);
1218
- };
1219
-
1220
- module.exports.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
1221
- getObject(arg0).getRandomValues(getObject(arg1));
1222
- }, arguments) };
1223
-
1224
- module.exports.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
1225
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
1226
- return addHeapObject(ret);
1227
- }, arguments) };
1228
-
1229
- module.exports.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
1230
- const ret = getObject(arg0)[arg1 >>> 0];
1231
- return addHeapObject(ret);
1232
- };
782
+ exports.get_target_profile_from_entry_point = get_target_profile_from_entry_point;
1233
783
 
1234
- module.exports.__wbg_getstacktracelimit_af8b40007957b07f = function() {
1235
- const ret = Error.stackTraceLimit;
1236
- return isLikeNone(ret) ? 0x100000001 : (ret) >>> 0;
1237
- };
1238
-
1239
- module.exports.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
1240
- const ret = getObject(arg0)[getObject(arg1)];
1241
- return addHeapObject(ret);
1242
- };
1243
-
1244
- module.exports.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
1245
- let result;
784
+ /**
785
+ * @returns {string}
786
+ */
787
+ function git_hash() {
788
+ let deferred1_0;
789
+ let deferred1_1;
1246
790
  try {
1247
- result = getObject(arg0) instanceof ArrayBuffer;
1248
- } catch (_) {
1249
- result = false;
791
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
792
+ wasm.git_hash(retptr);
793
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
794
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
795
+ deferred1_0 = r0;
796
+ deferred1_1 = r1;
797
+ return getStringFromWasm0(r0, r1);
798
+ } finally {
799
+ wasm.__wbindgen_add_to_stack_pointer(16);
800
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1250
801
  }
1251
- const ret = result;
1252
- return ret;
1253
- };
802
+ }
803
+ exports.git_hash = git_hash;
1254
804
 
1255
- module.exports.__wbg_instanceof_Error_4d54113b22d20306 = function(arg0) {
1256
- let result;
805
+ /**
806
+ * @param {any} callback
807
+ * @param {number} level
808
+ */
809
+ function initLogging(callback, level) {
1257
810
  try {
1258
- result = getObject(arg0) instanceof Error;
1259
- } catch (_) {
1260
- result = false;
811
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
812
+ wasm.initLogging(retptr, addHeapObject(callback), level);
813
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
814
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
815
+ if (r1) {
816
+ throw takeObject(r0);
817
+ }
818
+ } finally {
819
+ wasm.__wbindgen_add_to_stack_pointer(16);
1261
820
  }
1262
- const ret = result;
1263
- return ret;
1264
- };
821
+ }
822
+ exports.initLogging = initLogging;
1265
823
 
1266
- module.exports.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) {
1267
- let result;
824
+ /**
825
+ * @param {IProgramConfig} program
826
+ * @param {string} expr
827
+ * @param {Function} event_cb
828
+ * @param {number} shots
829
+ * @returns {boolean}
830
+ */
831
+ function run(program, expr, event_cb, shots) {
1268
832
  try {
1269
- result = getObject(arg0) instanceof Map;
1270
- } catch (_) {
1271
- result = false;
833
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
834
+ const ptr0 = passStringToWasm0(expr, wasm.__wbindgen_export, wasm.__wbindgen_export2);
835
+ const len0 = WASM_VECTOR_LEN;
836
+ wasm.run(retptr, addHeapObject(program), ptr0, len0, addBorrowedObject(event_cb), shots);
837
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
838
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
839
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
840
+ if (r2) {
841
+ throw takeObject(r1);
842
+ }
843
+ return r0 !== 0;
844
+ } finally {
845
+ wasm.__wbindgen_add_to_stack_pointer(16);
846
+ heap[stack_pointer++] = undefined;
1272
847
  }
1273
- const ret = result;
1274
- return ret;
1275
- };
848
+ }
849
+ exports.run = run;
1276
850
 
1277
- module.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
1278
- let result;
851
+ /**
852
+ * @param {IProgramConfig} program
853
+ * @param {string} expr
854
+ * @param {Function} event_cb
855
+ * @param {number} shots
856
+ * @param {any} pauliNoise
857
+ * @param {any} qubitLoss
858
+ * @returns {boolean}
859
+ */
860
+ function runWithNoise(program, expr, event_cb, shots, pauliNoise, qubitLoss) {
1279
861
  try {
1280
- result = getObject(arg0) instanceof Uint8Array;
1281
- } catch (_) {
1282
- result = false;
862
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
863
+ const ptr0 = passStringToWasm0(expr, wasm.__wbindgen_export, wasm.__wbindgen_export2);
864
+ const len0 = WASM_VECTOR_LEN;
865
+ wasm.runWithNoise(retptr, addHeapObject(program), ptr0, len0, addBorrowedObject(event_cb), shots, addBorrowedObject(pauliNoise), addBorrowedObject(qubitLoss));
866
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
867
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
868
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
869
+ if (r2) {
870
+ throw takeObject(r1);
871
+ }
872
+ return r0 !== 0;
873
+ } finally {
874
+ wasm.__wbindgen_add_to_stack_pointer(16);
875
+ heap[stack_pointer++] = undefined;
876
+ heap[stack_pointer++] = undefined;
877
+ heap[stack_pointer++] = undefined;
1283
878
  }
1284
- const ret = result;
1285
- return ret;
1286
- };
1287
-
1288
- module.exports.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
1289
- const ret = Array.isArray(getObject(arg0));
1290
- return ret;
1291
- };
1292
-
1293
- module.exports.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
1294
- const ret = Number.isSafeInteger(getObject(arg0));
1295
- return ret;
1296
- };
1297
-
1298
- module.exports.__wbg_iterator_9a24c88df860dc65 = function() {
1299
- const ret = Symbol.iterator;
1300
- return addHeapObject(ret);
1301
- };
1302
-
1303
- module.exports.__wbg_length_a446193dc22c12f8 = function(arg0) {
1304
- const ret = getObject(arg0).length;
1305
- return ret;
1306
- };
1307
-
1308
- module.exports.__wbg_length_e2d2a49132c1b256 = function(arg0) {
1309
- const ret = getObject(arg0).length;
1310
- return ret;
1311
- };
1312
-
1313
- module.exports.__wbg_listDirectory_827a3459b52ecade = function(arg0, arg1, arg2) {
1314
- const ret = getObject(arg0).listDirectory(getStringFromWasm0(arg1, arg2));
1315
- return addHeapObject(ret);
1316
- };
1317
-
1318
- module.exports.__wbg_message_97a2af9b89d693a3 = function(arg0) {
1319
- const ret = getObject(arg0).message;
1320
- return addHeapObject(ret);
1321
- };
1322
-
1323
- module.exports.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
1324
- const ret = getObject(arg0).msCrypto;
1325
- return addHeapObject(ret);
1326
- };
879
+ }
880
+ exports.runWithNoise = runWithNoise;
1327
881
 
1328
- module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
1329
- try {
1330
- var state0 = {a: arg0, b: arg1};
1331
- var cb0 = (arg0, arg1) => {
1332
- const a = state0.a;
1333
- state0.a = 0;
882
+ /**
883
+ * @param {number} level
884
+ */
885
+ function setLogLevel(level) {
886
+ wasm.setLogLevel(level);
887
+ }
888
+ exports.setLogLevel = setLogLevel;
889
+
890
+ function __wbg_get_imports() {
891
+ const import0 = {
892
+ __proto__: null,
893
+ __wbg_Error_83742b46f01ce22d: function(arg0, arg1) {
894
+ const ret = Error(getStringFromWasm0(arg0, arg1));
895
+ return addHeapObject(ret);
896
+ },
897
+ __wbg_Number_a5a435bd7bbec835: function(arg0) {
898
+ const ret = Number(getObject(arg0));
899
+ return ret;
900
+ },
901
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
902
+ const ret = String(getObject(arg1));
903
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
904
+ const len1 = WASM_VECTOR_LEN;
905
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
906
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
907
+ },
908
+ __wbg___wbindgen_bigint_get_as_i64_447a76b5c6ef7bda: function(arg0, arg1) {
909
+ const v = getObject(arg1);
910
+ const ret = typeof(v) === 'bigint' ? v : undefined;
911
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
912
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
913
+ },
914
+ __wbg___wbindgen_boolean_get_c0f3f60bac5a78d1: function(arg0) {
915
+ const v = getObject(arg0);
916
+ const ret = typeof(v) === 'boolean' ? v : undefined;
917
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
918
+ },
919
+ __wbg___wbindgen_debug_string_5398f5bb970e0daa: function(arg0, arg1) {
920
+ const ret = debugString(getObject(arg1));
921
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
922
+ const len1 = WASM_VECTOR_LEN;
923
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
924
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
925
+ },
926
+ __wbg___wbindgen_in_41dbb8413020e076: function(arg0, arg1) {
927
+ const ret = getObject(arg0) in getObject(arg1);
928
+ return ret;
929
+ },
930
+ __wbg___wbindgen_is_bigint_e2141d4f045b7eda: function(arg0) {
931
+ const ret = typeof(getObject(arg0)) === 'bigint';
932
+ return ret;
933
+ },
934
+ __wbg___wbindgen_is_function_3c846841762788c1: function(arg0) {
935
+ const ret = typeof(getObject(arg0)) === 'function';
936
+ return ret;
937
+ },
938
+ __wbg___wbindgen_is_object_781bc9f159099513: function(arg0) {
939
+ const val = getObject(arg0);
940
+ const ret = typeof(val) === 'object' && val !== null;
941
+ return ret;
942
+ },
943
+ __wbg___wbindgen_is_string_7ef6b97b02428fae: function(arg0) {
944
+ const ret = typeof(getObject(arg0)) === 'string';
945
+ return ret;
946
+ },
947
+ __wbg___wbindgen_is_undefined_52709e72fb9f179c: function(arg0) {
948
+ const ret = getObject(arg0) === undefined;
949
+ return ret;
950
+ },
951
+ __wbg___wbindgen_jsval_eq_ee31bfad3e536463: function(arg0, arg1) {
952
+ const ret = getObject(arg0) === getObject(arg1);
953
+ return ret;
954
+ },
955
+ __wbg___wbindgen_jsval_loose_eq_5bcc3bed3c69e72b: function(arg0, arg1) {
956
+ const ret = getObject(arg0) == getObject(arg1);
957
+ return ret;
958
+ },
959
+ __wbg___wbindgen_number_get_34bb9d9dcfa21373: function(arg0, arg1) {
960
+ const obj = getObject(arg1);
961
+ const ret = typeof(obj) === 'number' ? obj : undefined;
962
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
963
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
964
+ },
965
+ __wbg___wbindgen_string_get_395e606bd0ee4427: function(arg0, arg1) {
966
+ const obj = getObject(arg1);
967
+ const ret = typeof(obj) === 'string' ? obj : undefined;
968
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
969
+ var len1 = WASM_VECTOR_LEN;
970
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
971
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
972
+ },
973
+ __wbg___wbindgen_throw_6ddd609b62940d55: function(arg0, arg1) {
974
+ throw new Error(getStringFromWasm0(arg0, arg1));
975
+ },
976
+ __wbg__wbg_cb_unref_6b5b6b8576d35cb1: function(arg0) {
977
+ getObject(arg0)._wbg_cb_unref();
978
+ },
979
+ __wbg_call_2d781c1f4d5c0ef8: function() { return handleError(function (arg0, arg1, arg2) {
980
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
981
+ return addHeapObject(ret);
982
+ }, arguments); },
983
+ __wbg_call_e133b57c9155d22c: function() { return handleError(function (arg0, arg1) {
984
+ const ret = getObject(arg0).call(getObject(arg1));
985
+ return addHeapObject(ret);
986
+ }, arguments); },
987
+ __wbg_call_f858478a02f9600f: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
988
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
989
+ return addHeapObject(ret);
990
+ }, arguments); },
991
+ __wbg_crypto_38df2bab126b63dc: function(arg0) {
992
+ const ret = getObject(arg0).crypto;
993
+ return addHeapObject(ret);
994
+ },
995
+ __wbg_done_08ce71ee07e3bd17: function(arg0) {
996
+ const ret = getObject(arg0).done;
997
+ return ret;
998
+ },
999
+ __wbg_entries_e8a20ff8c9757101: function(arg0) {
1000
+ const ret = Object.entries(getObject(arg0));
1001
+ return addHeapObject(ret);
1002
+ },
1003
+ __wbg_fetchGithub_07b18f4c1d353ded: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) {
1004
+ const ret = getObject(arg0).fetchGithub(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), getStringFromWasm0(arg5, arg6), getStringFromWasm0(arg7, arg8));
1005
+ return addHeapObject(ret);
1006
+ }, arguments); },
1007
+ __wbg_findManifestDirectory_033c7b5017798748: function(arg0, arg1, arg2) {
1008
+ const ret = getObject(arg0).findManifestDirectory(getStringFromWasm0(arg1, arg2));
1009
+ return addHeapObject(ret);
1010
+ },
1011
+ __wbg_from_4bdf88943703fd48: function(arg0) {
1012
+ const ret = Array.from(getObject(arg0));
1013
+ return addHeapObject(ret);
1014
+ },
1015
+ __wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
1016
+ getObject(arg0).getRandomValues(getObject(arg1));
1017
+ }, arguments); },
1018
+ __wbg_get_326e41e095fb2575: function() { return handleError(function (arg0, arg1) {
1019
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
1020
+ return addHeapObject(ret);
1021
+ }, arguments); },
1022
+ __wbg_get_a8ee5c45dabc1b3b: function(arg0, arg1) {
1023
+ const ret = getObject(arg0)[arg1 >>> 0];
1024
+ return addHeapObject(ret);
1025
+ },
1026
+ __wbg_get_stack_trace_limit_19dd44bb32fdd0bb: function() {
1027
+ const ret = Error.stackTraceLimit;
1028
+ return isLikeNone(ret) ? 0x100000001 : (ret) >>> 0;
1029
+ },
1030
+ __wbg_get_unchecked_329cfe50afab7352: function(arg0, arg1) {
1031
+ const ret = getObject(arg0)[arg1 >>> 0];
1032
+ return addHeapObject(ret);
1033
+ },
1034
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
1035
+ const ret = getObject(arg0)[getObject(arg1)];
1036
+ return addHeapObject(ret);
1037
+ },
1038
+ __wbg_instanceof_ArrayBuffer_101e2bf31071a9f6: function(arg0) {
1039
+ let result;
1040
+ try {
1041
+ result = getObject(arg0) instanceof ArrayBuffer;
1042
+ } catch (_) {
1043
+ result = false;
1044
+ }
1045
+ const ret = result;
1046
+ return ret;
1047
+ },
1048
+ __wbg_instanceof_Error_4691a5b466e32a80: function(arg0) {
1049
+ let result;
1050
+ try {
1051
+ result = getObject(arg0) instanceof Error;
1052
+ } catch (_) {
1053
+ result = false;
1054
+ }
1055
+ const ret = result;
1056
+ return ret;
1057
+ },
1058
+ __wbg_instanceof_Map_f194b366846aca0c: function(arg0) {
1059
+ let result;
1060
+ try {
1061
+ result = getObject(arg0) instanceof Map;
1062
+ } catch (_) {
1063
+ result = false;
1064
+ }
1065
+ const ret = result;
1066
+ return ret;
1067
+ },
1068
+ __wbg_instanceof_Uint8Array_740438561a5b956d: function(arg0) {
1069
+ let result;
1070
+ try {
1071
+ result = getObject(arg0) instanceof Uint8Array;
1072
+ } catch (_) {
1073
+ result = false;
1074
+ }
1075
+ const ret = result;
1076
+ return ret;
1077
+ },
1078
+ __wbg_isArray_33b91feb269ff46e: function(arg0) {
1079
+ const ret = Array.isArray(getObject(arg0));
1080
+ return ret;
1081
+ },
1082
+ __wbg_isArray_42f3245bcac28e65: function(arg0) {
1083
+ const ret = Array.isArray(getObject(arg0));
1084
+ return ret;
1085
+ },
1086
+ __wbg_isSafeInteger_ecd6a7f9c3e053cd: function(arg0) {
1087
+ const ret = Number.isSafeInteger(getObject(arg0));
1088
+ return ret;
1089
+ },
1090
+ __wbg_iterator_d8f549ec8fb061b1: function() {
1091
+ const ret = Symbol.iterator;
1092
+ return addHeapObject(ret);
1093
+ },
1094
+ __wbg_length_b3416cf66a5452c8: function(arg0) {
1095
+ const ret = getObject(arg0).length;
1096
+ return ret;
1097
+ },
1098
+ __wbg_length_ea16607d7b61445b: function(arg0) {
1099
+ const ret = getObject(arg0).length;
1100
+ return ret;
1101
+ },
1102
+ __wbg_listDirectory_3abb3a7342129e7c: function(arg0, arg1, arg2) {
1103
+ const ret = getObject(arg0).listDirectory(getStringFromWasm0(arg1, arg2));
1104
+ return addHeapObject(ret);
1105
+ },
1106
+ __wbg_message_00d63f20c41713dd: function(arg0) {
1107
+ const ret = getObject(arg0).message;
1108
+ return addHeapObject(ret);
1109
+ },
1110
+ __wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
1111
+ const ret = getObject(arg0).msCrypto;
1112
+ return addHeapObject(ret);
1113
+ },
1114
+ __wbg_new_49af1fa01cd4d19b: function() {
1115
+ const ret = new Error();
1116
+ return addHeapObject(ret);
1117
+ },
1118
+ __wbg_new_49d5571bd3f0c4d4: function() {
1119
+ const ret = new Map();
1120
+ return addHeapObject(ret);
1121
+ },
1122
+ __wbg_new_5f486cdf45a04d78: function(arg0) {
1123
+ const ret = new Uint8Array(getObject(arg0));
1124
+ return addHeapObject(ret);
1125
+ },
1126
+ __wbg_new_a70fbab9066b301f: function() {
1127
+ const ret = new Array();
1128
+ return addHeapObject(ret);
1129
+ },
1130
+ __wbg_new_ab79df5bd7c26067: function() {
1131
+ const ret = new Object();
1132
+ return addHeapObject(ret);
1133
+ },
1134
+ __wbg_new_typed_aaaeaf29cf802876: function(arg0, arg1) {
1334
1135
  try {
1335
- return __wbg_adapter_203(a, state0.b, arg0, arg1);
1136
+ var state0 = {a: arg0, b: arg1};
1137
+ var cb0 = (arg0, arg1) => {
1138
+ const a = state0.a;
1139
+ state0.a = 0;
1140
+ try {
1141
+ return __wasm_bindgen_func_elem_7513(a, state0.b, arg0, arg1);
1142
+ } finally {
1143
+ state0.a = a;
1144
+ }
1145
+ };
1146
+ const ret = new Promise(cb0);
1147
+ return addHeapObject(ret);
1336
1148
  } finally {
1337
- state0.a = a;
1149
+ state0.a = state0.b = 0;
1338
1150
  }
1339
- };
1340
- const ret = new Promise(cb0);
1341
- return addHeapObject(ret);
1151
+ },
1152
+ __wbg_new_with_length_825018a1616e9e55: function(arg0) {
1153
+ const ret = new Uint8Array(arg0 >>> 0);
1154
+ return addHeapObject(ret);
1155
+ },
1156
+ __wbg_next_11b99ee6237339e3: function() { return handleError(function (arg0) {
1157
+ const ret = getObject(arg0).next();
1158
+ return addHeapObject(ret);
1159
+ }, arguments); },
1160
+ __wbg_next_e01a967809d1aa68: function(arg0) {
1161
+ const ret = getObject(arg0).next;
1162
+ return addHeapObject(ret);
1163
+ },
1164
+ __wbg_node_84ea875411254db1: function(arg0) {
1165
+ const ret = getObject(arg0).node;
1166
+ return addHeapObject(ret);
1167
+ },
1168
+ __wbg_packageGraphSources_41adf6632e94af6f: function(arg0) {
1169
+ const ret = getObject(arg0).packageGraphSources;
1170
+ return addHeapObject(ret);
1171
+ },
1172
+ __wbg_process_44c7a14e11e9f69e: function(arg0) {
1173
+ const ret = getObject(arg0).process;
1174
+ return addHeapObject(ret);
1175
+ },
1176
+ __wbg_profile_edbf563ae3d57e6d: function(arg0, arg1) {
1177
+ const ret = getObject(arg1).profile;
1178
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1179
+ const len1 = WASM_VECTOR_LEN;
1180
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1181
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1182
+ },
1183
+ __wbg_projectType_3d7f26604be90e3c: function(arg0, arg1) {
1184
+ const ret = getObject(arg1).projectType;
1185
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1186
+ const len1 = WASM_VECTOR_LEN;
1187
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1188
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1189
+ },
1190
+ __wbg_prototypesetcall_d62e5099504357e6: function(arg0, arg1, arg2) {
1191
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
1192
+ },
1193
+ __wbg_queueMicrotask_0c399741342fb10f: function(arg0) {
1194
+ const ret = getObject(arg0).queueMicrotask;
1195
+ return addHeapObject(ret);
1196
+ },
1197
+ __wbg_queueMicrotask_a082d78ce798393e: function(arg0) {
1198
+ queueMicrotask(getObject(arg0));
1199
+ },
1200
+ __wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
1201
+ getObject(arg0).randomFillSync(takeObject(arg1));
1202
+ }, arguments); },
1203
+ __wbg_readFile_5cf1797fcdea6a2c: function() { return handleError(function (arg0, arg1, arg2) {
1204
+ const ret = getObject(arg0).readFile(getStringFromWasm0(arg1, arg2));
1205
+ return addHeapObject(ret);
1206
+ }, arguments); },
1207
+ __wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {
1208
+ const ret = module.require;
1209
+ return addHeapObject(ret);
1210
+ }, arguments); },
1211
+ __wbg_resolvePath_6e40d08df0c5e326: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1212
+ const ret = getObject(arg0).resolvePath(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1213
+ return addHeapObject(ret);
1214
+ }, arguments); },
1215
+ __wbg_resolve_ae8d83246e5bcc12: function(arg0) {
1216
+ const ret = Promise.resolve(getObject(arg0));
1217
+ return addHeapObject(ret);
1218
+ },
1219
+ __wbg_set_282384002438957f: function(arg0, arg1, arg2) {
1220
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1221
+ },
1222
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
1223
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1224
+ },
1225
+ __wbg_set_bf7251625df30a02: function(arg0, arg1, arg2) {
1226
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
1227
+ return addHeapObject(ret);
1228
+ },
1229
+ __wbg_set_stack_trace_limit_a6b4f5c23511a229: function(arg0) {
1230
+ Error.stackTraceLimit = arg0 >>> 0;
1231
+ },
1232
+ __wbg_stack_948d41d68c41fac5: function(arg0, arg1) {
1233
+ const ret = getObject(arg1).stack;
1234
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1235
+ const len1 = WASM_VECTOR_LEN;
1236
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1237
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1238
+ },
1239
+ __wbg_static_accessor_GLOBAL_8adb955bd33fac2f: function() {
1240
+ const ret = typeof global === 'undefined' ? null : global;
1241
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1242
+ },
1243
+ __wbg_static_accessor_GLOBAL_THIS_ad356e0db91c7913: function() {
1244
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1245
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1246
+ },
1247
+ __wbg_static_accessor_SELF_f207c857566db248: function() {
1248
+ const ret = typeof self === 'undefined' ? null : self;
1249
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1250
+ },
1251
+ __wbg_static_accessor_WINDOW_bb9f1ba69d61b386: function() {
1252
+ const ret = typeof window === 'undefined' ? null : window;
1253
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1254
+ },
1255
+ __wbg_subarray_a068d24e39478a8a: function(arg0, arg1, arg2) {
1256
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
1257
+ return addHeapObject(ret);
1258
+ },
1259
+ __wbg_then_098abe61755d12f6: function(arg0, arg1) {
1260
+ const ret = getObject(arg0).then(getObject(arg1));
1261
+ return addHeapObject(ret);
1262
+ },
1263
+ __wbg_then_9e335f6dd892bc11: function(arg0, arg1, arg2) {
1264
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
1265
+ return addHeapObject(ret);
1266
+ },
1267
+ __wbg_value_21fc78aab0322612: function(arg0) {
1268
+ const ret = getObject(arg0).value;
1269
+ return addHeapObject(ret);
1270
+ },
1271
+ __wbg_versions_276b2795b1c6a219: function(arg0) {
1272
+ const ret = getObject(arg0).versions;
1273
+ return addHeapObject(ret);
1274
+ },
1275
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1276
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 2102, function: Function { arguments: [Externref], shim_idx: 2103, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1277
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7033, __wasm_bindgen_func_elem_7035);
1278
+ return addHeapObject(ret);
1279
+ },
1280
+ __wbindgen_cast_0000000000000002: function(arg0) {
1281
+ // Cast intrinsic for `F64 -> Externref`.
1282
+ const ret = arg0;
1283
+ return addHeapObject(ret);
1284
+ },
1285
+ __wbindgen_cast_0000000000000003: function(arg0) {
1286
+ // Cast intrinsic for `I64 -> Externref`.
1287
+ const ret = arg0;
1288
+ return addHeapObject(ret);
1289
+ },
1290
+ __wbindgen_cast_0000000000000004: function(arg0, arg1) {
1291
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1292
+ const ret = getArrayU8FromWasm0(arg0, arg1);
1293
+ return addHeapObject(ret);
1294
+ },
1295
+ __wbindgen_cast_0000000000000005: function(arg0, arg1) {
1296
+ // Cast intrinsic for `Ref(String) -> Externref`.
1297
+ const ret = getStringFromWasm0(arg0, arg1);
1298
+ return addHeapObject(ret);
1299
+ },
1300
+ __wbindgen_cast_0000000000000006: function(arg0) {
1301
+ // Cast intrinsic for `U64 -> Externref`.
1302
+ const ret = BigInt.asUintN(64, arg0);
1303
+ return addHeapObject(ret);
1304
+ },
1305
+ __wbindgen_object_clone_ref: function(arg0) {
1306
+ const ret = getObject(arg0);
1307
+ return addHeapObject(ret);
1308
+ },
1309
+ __wbindgen_object_drop_ref: function(arg0) {
1310
+ takeObject(arg0);
1311
+ },
1312
+ };
1313
+ return {
1314
+ __proto__: null,
1315
+ "./qsc_wasm_bg.js": import0,
1316
+ };
1317
+ }
1318
+
1319
+ function __wasm_bindgen_func_elem_7035(arg0, arg1, arg2) {
1320
+ try {
1321
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1322
+ wasm.__wasm_bindgen_func_elem_7035(retptr, arg0, arg1, addHeapObject(arg2));
1323
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1324
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1325
+ if (r1) {
1326
+ throw takeObject(r0);
1327
+ }
1342
1328
  } finally {
1343
- state0.a = state0.b = 0;
1329
+ wasm.__wbindgen_add_to_stack_pointer(16);
1344
1330
  }
1345
- };
1346
-
1347
- module.exports.__wbg_new_405e22f390576ce2 = function() {
1348
- const ret = new Object();
1349
- return addHeapObject(ret);
1350
- };
1351
-
1352
- module.exports.__wbg_new_5e0be73521bc8c17 = function() {
1353
- const ret = new Map();
1354
- return addHeapObject(ret);
1355
- };
1356
-
1357
- module.exports.__wbg_new_78feb108b6472713 = function() {
1358
- const ret = new Array();
1359
- return addHeapObject(ret);
1360
- };
1361
-
1362
- module.exports.__wbg_new_a12002a7f91c75be = function(arg0) {
1363
- const ret = new Uint8Array(getObject(arg0));
1364
- return addHeapObject(ret);
1365
- };
1366
-
1367
- module.exports.__wbg_new_a774eb7503f03596 = function() {
1368
- const ret = new Error();
1369
- return addHeapObject(ret);
1370
- };
1371
-
1372
- module.exports.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
1373
- const ret = new Function(getStringFromWasm0(arg0, arg1));
1374
- return addHeapObject(ret);
1375
- };
1376
-
1377
- module.exports.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
1378
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
1379
- return addHeapObject(ret);
1380
- };
1381
-
1382
- module.exports.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
1383
- const ret = new Uint8Array(arg0 >>> 0);
1384
- return addHeapObject(ret);
1385
- };
1386
-
1387
- module.exports.__wbg_next_25feadfc0913fea9 = function(arg0) {
1388
- const ret = getObject(arg0).next;
1389
- return addHeapObject(ret);
1390
- };
1391
-
1392
- module.exports.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
1393
- const ret = getObject(arg0).next();
1394
- return addHeapObject(ret);
1395
- }, arguments) };
1396
-
1397
- module.exports.__wbg_node_02999533c4ea02e3 = function(arg0) {
1398
- const ret = getObject(arg0).node;
1399
- return addHeapObject(ret);
1400
- };
1401
-
1402
- module.exports.__wbg_packageGraphSources_a4ff6a84f5812e15 = function(arg0) {
1403
- const ret = getObject(arg0).packageGraphSources;
1404
- return addHeapObject(ret);
1405
- };
1406
-
1407
- module.exports.__wbg_process_5c1d670bc53614b8 = function(arg0) {
1408
- const ret = getObject(arg0).process;
1409
- return addHeapObject(ret);
1410
- };
1411
-
1412
- module.exports.__wbg_profile_35b65d3ebe7ebbee = function(arg0, arg1) {
1413
- const ret = getObject(arg1).profile;
1414
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1415
- const len1 = WASM_VECTOR_LEN;
1416
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1417
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1418
- };
1419
-
1420
- module.exports.__wbg_projectType_2bf93409ae72a803 = function(arg0, arg1) {
1421
- const ret = getObject(arg1).projectType;
1422
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1423
- const len1 = WASM_VECTOR_LEN;
1424
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1425
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1426
- };
1427
-
1428
- module.exports.__wbg_queueMicrotask_98e746b9f850fe3d = function(arg0) {
1429
- queueMicrotask(getObject(arg0));
1430
- };
1431
-
1432
- module.exports.__wbg_queueMicrotask_c847cc8372bec908 = function(arg0) {
1433
- const ret = getObject(arg0).queueMicrotask;
1434
- return addHeapObject(ret);
1435
- };
1436
-
1437
- module.exports.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) {
1438
- getObject(arg0).randomFillSync(takeObject(arg1));
1439
- }, arguments) };
1440
-
1441
- module.exports.__wbg_readFile_69715ec88ba8893d = function() { return handleError(function (arg0, arg1, arg2) {
1442
- const ret = getObject(arg0).readFile(getStringFromWasm0(arg1, arg2));
1443
- return addHeapObject(ret);
1444
- }, arguments) };
1445
-
1446
- module.exports.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
1447
- const ret = module.require;
1448
- return addHeapObject(ret);
1449
- }, arguments) };
1331
+ }
1450
1332
 
1451
- module.exports.__wbg_resolvePath_b4556f7b4689ad4a = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1452
- const ret = getObject(arg0).resolvePath(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1453
- return addHeapObject(ret);
1454
- }, arguments) };
1333
+ function __wasm_bindgen_func_elem_7513(arg0, arg1, arg2, arg3) {
1334
+ wasm.__wasm_bindgen_func_elem_7513(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
1335
+ }
1455
1336
 
1456
- module.exports.__wbg_resolve_4851785c9c5f573d = function(arg0) {
1457
- const ret = Promise.resolve(getObject(arg0));
1458
- return addHeapObject(ret);
1459
- };
1337
+ const DebugServiceFinalization = (typeof FinalizationRegistry === 'undefined')
1338
+ ? { register: () => {}, unregister: () => {} }
1339
+ : new FinalizationRegistry(ptr => wasm.__wbg_debugservice_free(ptr >>> 0, 1));
1340
+ const LanguageServiceFinalization = (typeof FinalizationRegistry === 'undefined')
1341
+ ? { register: () => {}, unregister: () => {} }
1342
+ : new FinalizationRegistry(ptr => wasm.__wbg_languageservice_free(ptr >>> 0, 1));
1343
+ const ProjectLoaderFinalization = (typeof FinalizationRegistry === 'undefined')
1344
+ ? { register: () => {}, unregister: () => {} }
1345
+ : new FinalizationRegistry(ptr => wasm.__wbg_projectloader_free(ptr >>> 0, 1));
1460
1346
 
1461
- module.exports.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
1462
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1463
- };
1347
+ function addHeapObject(obj) {
1348
+ if (heap_next === heap.length) heap.push(heap.length + 1);
1349
+ const idx = heap_next;
1350
+ heap_next = heap[idx];
1464
1351
 
1465
- module.exports.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
1466
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1467
- };
1352
+ heap[idx] = obj;
1353
+ return idx;
1354
+ }
1468
1355
 
1469
- module.exports.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
1470
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
1471
- };
1356
+ function addBorrowedObject(obj) {
1357
+ if (stack_pointer == 1) throw new Error('out of js stack');
1358
+ heap[--stack_pointer] = obj;
1359
+ return stack_pointer;
1360
+ }
1472
1361
 
1473
- module.exports.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) {
1474
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
1475
- return addHeapObject(ret);
1476
- };
1362
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
1363
+ ? { register: () => {}, unregister: () => {} }
1364
+ : new FinalizationRegistry(state => state.dtor(state.a, state.b));
1477
1365
 
1478
- module.exports.__wbg_setstacktracelimit_1055f99289ff0c7b = function(arg0) {
1479
- Error.stackTraceLimit = arg0 >>> 0;
1480
- };
1366
+ function debugString(val) {
1367
+ // primitive types
1368
+ const type = typeof val;
1369
+ if (type == 'number' || type == 'boolean' || val == null) {
1370
+ return `${val}`;
1371
+ }
1372
+ if (type == 'string') {
1373
+ return `"${val}"`;
1374
+ }
1375
+ if (type == 'symbol') {
1376
+ const description = val.description;
1377
+ if (description == null) {
1378
+ return 'Symbol';
1379
+ } else {
1380
+ return `Symbol(${description})`;
1381
+ }
1382
+ }
1383
+ if (type == 'function') {
1384
+ const name = val.name;
1385
+ if (typeof name == 'string' && name.length > 0) {
1386
+ return `Function(${name})`;
1387
+ } else {
1388
+ return 'Function';
1389
+ }
1390
+ }
1391
+ // objects
1392
+ if (Array.isArray(val)) {
1393
+ const length = val.length;
1394
+ let debug = '[';
1395
+ if (length > 0) {
1396
+ debug += debugString(val[0]);
1397
+ }
1398
+ for(let i = 1; i < length; i++) {
1399
+ debug += ', ' + debugString(val[i]);
1400
+ }
1401
+ debug += ']';
1402
+ return debug;
1403
+ }
1404
+ // Test for built-in
1405
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
1406
+ let className;
1407
+ if (builtInMatches && builtInMatches.length > 1) {
1408
+ className = builtInMatches[1];
1409
+ } else {
1410
+ // Failed to match the standard '[object ClassName]'
1411
+ return toString.call(val);
1412
+ }
1413
+ if (className == 'Object') {
1414
+ // we're a user defined class or Object
1415
+ // JSON.stringify avoids problems with cycles, and is generally much
1416
+ // easier than looping through ownProperties of `val`.
1417
+ try {
1418
+ return 'Object(' + JSON.stringify(val) + ')';
1419
+ } catch (_) {
1420
+ return 'Object';
1421
+ }
1422
+ }
1423
+ // errors
1424
+ if (val instanceof Error) {
1425
+ return `${val.name}: ${val.message}\n${val.stack}`;
1426
+ }
1427
+ // TODO we could test for more things here, like `Set`s and `Map`s.
1428
+ return className;
1429
+ }
1481
1430
 
1482
- module.exports.__wbg_stack_ab46af82f81848ee = function(arg0, arg1) {
1483
- const ret = getObject(arg1).stack;
1484
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1485
- const len1 = WASM_VECTOR_LEN;
1486
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1487
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1488
- };
1431
+ function dropObject(idx) {
1432
+ if (idx < 1028) return;
1433
+ heap[idx] = heap_next;
1434
+ heap_next = idx;
1435
+ }
1489
1436
 
1490
- module.exports.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
1491
- const ret = typeof global === 'undefined' ? null : global;
1492
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
1493
- };
1437
+ function getArrayJsValueFromWasm0(ptr, len) {
1438
+ ptr = ptr >>> 0;
1439
+ const mem = getDataViewMemory0();
1440
+ const result = [];
1441
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
1442
+ result.push(takeObject(mem.getUint32(i, true)));
1443
+ }
1444
+ return result;
1445
+ }
1494
1446
 
1495
- module.exports.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
1496
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
1497
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
1498
- };
1447
+ function getArrayU8FromWasm0(ptr, len) {
1448
+ ptr = ptr >>> 0;
1449
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1450
+ }
1499
1451
 
1500
- module.exports.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
1501
- const ret = typeof self === 'undefined' ? null : self;
1502
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
1503
- };
1452
+ let cachedDataViewMemory0 = null;
1453
+ function getDataViewMemory0() {
1454
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
1455
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1456
+ }
1457
+ return cachedDataViewMemory0;
1458
+ }
1504
1459
 
1505
- module.exports.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
1506
- const ret = typeof window === 'undefined' ? null : window;
1507
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
1508
- };
1460
+ function getStringFromWasm0(ptr, len) {
1461
+ ptr = ptr >>> 0;
1462
+ return decodeText(ptr, len);
1463
+ }
1509
1464
 
1510
- module.exports.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
1511
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
1512
- return addHeapObject(ret);
1513
- };
1465
+ let cachedUint32ArrayMemory0 = null;
1466
+ function getUint32ArrayMemory0() {
1467
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
1468
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
1469
+ }
1470
+ return cachedUint32ArrayMemory0;
1471
+ }
1514
1472
 
1515
- module.exports.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
1516
- const ret = getObject(arg0).then(getObject(arg1));
1517
- return addHeapObject(ret);
1518
- };
1473
+ let cachedUint8ArrayMemory0 = null;
1474
+ function getUint8ArrayMemory0() {
1475
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1476
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1477
+ }
1478
+ return cachedUint8ArrayMemory0;
1479
+ }
1519
1480
 
1520
- module.exports.__wbg_then_48b406749878a531 = function(arg0, arg1, arg2) {
1521
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
1522
- return addHeapObject(ret);
1523
- };
1481
+ function getObject(idx) { return heap[idx]; }
1524
1482
 
1525
- module.exports.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
1526
- const ret = getObject(arg0).value;
1527
- return addHeapObject(ret);
1528
- };
1483
+ function handleError(f, args) {
1484
+ try {
1485
+ return f.apply(this, args);
1486
+ } catch (e) {
1487
+ wasm.__wbindgen_export3(addHeapObject(e));
1488
+ }
1489
+ }
1529
1490
 
1530
- module.exports.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
1531
- const ret = getObject(arg0).versions;
1532
- return addHeapObject(ret);
1533
- };
1491
+ let heap = new Array(1024).fill(undefined);
1492
+ heap.push(undefined, null, true, false);
1534
1493
 
1535
- module.exports.__wbindgen_as_number = function(arg0) {
1536
- const ret = +getObject(arg0);
1537
- return ret;
1538
- };
1494
+ let heap_next = heap.length;
1539
1495
 
1540
- module.exports.__wbindgen_bigint_from_i64 = function(arg0) {
1541
- const ret = arg0;
1542
- return addHeapObject(ret);
1543
- };
1496
+ function isLikeNone(x) {
1497
+ return x === undefined || x === null;
1498
+ }
1544
1499
 
1545
- module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
1546
- const ret = BigInt.asUintN(64, arg0);
1547
- return addHeapObject(ret);
1548
- };
1500
+ function makeMutClosure(arg0, arg1, dtor, f) {
1501
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
1502
+ const real = (...args) => {
1549
1503
 
1550
- module.exports.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
1551
- const v = getObject(arg1);
1552
- const ret = typeof(v) === 'bigint' ? v : undefined;
1553
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
1554
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1555
- };
1504
+ // First up with a closure we increment the internal reference
1505
+ // count. This ensures that the Rust closure environment won't
1506
+ // be deallocated while we're invoking it.
1507
+ state.cnt++;
1508
+ const a = state.a;
1509
+ state.a = 0;
1510
+ try {
1511
+ return f(a, state.b, ...args);
1512
+ } finally {
1513
+ state.a = a;
1514
+ real._wbg_cb_unref();
1515
+ }
1516
+ };
1517
+ real._wbg_cb_unref = () => {
1518
+ if (--state.cnt === 0) {
1519
+ state.dtor(state.a, state.b);
1520
+ state.a = 0;
1521
+ CLOSURE_DTORS.unregister(state);
1522
+ }
1523
+ };
1524
+ CLOSURE_DTORS.register(real, state, state);
1525
+ return real;
1526
+ }
1556
1527
 
1557
- module.exports.__wbindgen_boolean_get = function(arg0) {
1558
- const v = getObject(arg0);
1559
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1560
- return ret;
1561
- };
1528
+ function passArray32ToWasm0(arg, malloc) {
1529
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
1530
+ getUint32ArrayMemory0().set(arg, ptr / 4);
1531
+ WASM_VECTOR_LEN = arg.length;
1532
+ return ptr;
1533
+ }
1562
1534
 
1563
- module.exports.__wbindgen_cb_drop = function(arg0) {
1564
- const obj = takeObject(arg0).original;
1565
- if (obj.cnt-- == 1) {
1566
- obj.a = 0;
1567
- return true;
1535
+ function passArrayJsValueToWasm0(array, malloc) {
1536
+ const ptr = malloc(array.length * 4, 4) >>> 0;
1537
+ const mem = getDataViewMemory0();
1538
+ for (let i = 0; i < array.length; i++) {
1539
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
1568
1540
  }
1569
- const ret = false;
1570
- return ret;
1571
- };
1572
-
1573
- module.exports.__wbindgen_closure_wrapper6738 = function(arg0, arg1, arg2) {
1574
- const ret = makeMutClosure(arg0, arg1, 2131, __wbg_adapter_52);
1575
- return addHeapObject(ret);
1576
- };
1577
-
1578
- module.exports.__wbindgen_debug_string = function(arg0, arg1) {
1579
- const ret = debugString(getObject(arg1));
1580
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1581
- const len1 = WASM_VECTOR_LEN;
1582
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1583
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1584
- };
1585
-
1586
- module.exports.__wbindgen_error_new = function(arg0, arg1) {
1587
- const ret = new Error(getStringFromWasm0(arg0, arg1));
1588
- return addHeapObject(ret);
1589
- };
1541
+ WASM_VECTOR_LEN = array.length;
1542
+ return ptr;
1543
+ }
1590
1544
 
1591
- module.exports.__wbindgen_in = function(arg0, arg1) {
1592
- const ret = getObject(arg0) in getObject(arg1);
1593
- return ret;
1594
- };
1545
+ function passStringToWasm0(arg, malloc, realloc) {
1546
+ if (realloc === undefined) {
1547
+ const buf = cachedTextEncoder.encode(arg);
1548
+ const ptr = malloc(buf.length, 1) >>> 0;
1549
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
1550
+ WASM_VECTOR_LEN = buf.length;
1551
+ return ptr;
1552
+ }
1595
1553
 
1596
- module.exports.__wbindgen_is_array = function(arg0) {
1597
- const ret = Array.isArray(getObject(arg0));
1598
- return ret;
1599
- };
1554
+ let len = arg.length;
1555
+ let ptr = malloc(len, 1) >>> 0;
1600
1556
 
1601
- module.exports.__wbindgen_is_bigint = function(arg0) {
1602
- const ret = typeof(getObject(arg0)) === 'bigint';
1603
- return ret;
1604
- };
1557
+ const mem = getUint8ArrayMemory0();
1605
1558
 
1606
- module.exports.__wbindgen_is_function = function(arg0) {
1607
- const ret = typeof(getObject(arg0)) === 'function';
1608
- return ret;
1609
- };
1559
+ let offset = 0;
1610
1560
 
1611
- module.exports.__wbindgen_is_object = function(arg0) {
1612
- const val = getObject(arg0);
1613
- const ret = typeof(val) === 'object' && val !== null;
1614
- return ret;
1615
- };
1561
+ for (; offset < len; offset++) {
1562
+ const code = arg.charCodeAt(offset);
1563
+ if (code > 0x7F) break;
1564
+ mem[ptr + offset] = code;
1565
+ }
1566
+ if (offset !== len) {
1567
+ if (offset !== 0) {
1568
+ arg = arg.slice(offset);
1569
+ }
1570
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1571
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1572
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1616
1573
 
1617
- module.exports.__wbindgen_is_string = function(arg0) {
1618
- const ret = typeof(getObject(arg0)) === 'string';
1619
- return ret;
1620
- };
1574
+ offset += ret.written;
1575
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1576
+ }
1621
1577
 
1622
- module.exports.__wbindgen_is_undefined = function(arg0) {
1623
- const ret = getObject(arg0) === undefined;
1624
- return ret;
1625
- };
1578
+ WASM_VECTOR_LEN = offset;
1579
+ return ptr;
1580
+ }
1626
1581
 
1627
- module.exports.__wbindgen_jsval_eq = function(arg0, arg1) {
1628
- const ret = getObject(arg0) === getObject(arg1);
1629
- return ret;
1630
- };
1582
+ let stack_pointer = 1024;
1631
1583
 
1632
- module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
1633
- const ret = getObject(arg0) == getObject(arg1);
1584
+ function takeObject(idx) {
1585
+ const ret = getObject(idx);
1586
+ dropObject(idx);
1634
1587
  return ret;
1635
- };
1636
-
1637
- module.exports.__wbindgen_memory = function() {
1638
- const ret = wasm.memory;
1639
- return addHeapObject(ret);
1640
- };
1641
-
1642
- module.exports.__wbindgen_number_get = function(arg0, arg1) {
1643
- const obj = getObject(arg1);
1644
- const ret = typeof(obj) === 'number' ? obj : undefined;
1645
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1646
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1647
- };
1648
-
1649
- module.exports.__wbindgen_number_new = function(arg0) {
1650
- const ret = arg0;
1651
- return addHeapObject(ret);
1652
- };
1653
-
1654
- module.exports.__wbindgen_object_clone_ref = function(arg0) {
1655
- const ret = getObject(arg0);
1656
- return addHeapObject(ret);
1657
- };
1658
-
1659
- module.exports.__wbindgen_object_drop_ref = function(arg0) {
1660
- takeObject(arg0);
1661
- };
1662
-
1663
- module.exports.__wbindgen_string_get = function(arg0, arg1) {
1664
- const obj = getObject(arg1);
1665
- const ret = typeof(obj) === 'string' ? obj : undefined;
1666
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1667
- var len1 = WASM_VECTOR_LEN;
1668
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1669
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1670
- };
1588
+ }
1671
1589
 
1672
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
1673
- const ret = getStringFromWasm0(arg0, arg1);
1674
- return addHeapObject(ret);
1675
- };
1590
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1591
+ cachedTextDecoder.decode();
1592
+ function decodeText(ptr, len) {
1593
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1594
+ }
1676
1595
 
1677
- module.exports.__wbindgen_throw = function(arg0, arg1) {
1678
- throw new Error(getStringFromWasm0(arg0, arg1));
1679
- };
1596
+ const cachedTextEncoder = new TextEncoder();
1680
1597
 
1681
- const path = require('path').join(__dirname, 'qsc_wasm_bg.wasm');
1682
- const bytes = require('fs').readFileSync(path);
1598
+ if (!('encodeInto' in cachedTextEncoder)) {
1599
+ cachedTextEncoder.encodeInto = function (arg, view) {
1600
+ const buf = cachedTextEncoder.encode(arg);
1601
+ view.set(buf);
1602
+ return {
1603
+ read: arg.length,
1604
+ written: buf.length
1605
+ };
1606
+ };
1607
+ }
1683
1608
 
1684
- const wasmModule = new WebAssembly.Module(bytes);
1685
- const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
1686
- wasm = wasmInstance.exports;
1687
- module.exports.__wasm = wasm;
1609
+ let WASM_VECTOR_LEN = 0;
1688
1610
 
1611
+ const wasmPath = `${__dirname}/qsc_wasm_bg.wasm`;
1612
+ const wasmBytes = require('fs').readFileSync(wasmPath);
1613
+ const wasmModule = new WebAssembly.Module(wasmBytes);
1614
+ let wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;