silvery 0.21.0 → 0.23.0

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 (224) hide show
  1. package/README.md +1 -1
  2. package/dist/{Text-Lq0dmj8-.mjs → Text-Ci6UCSTL.mjs} +46 -48
  3. package/dist/Text-Ci6UCSTL.mjs.map +1 -0
  4. package/dist/{render-string-DkQacASz.mjs → ag-q9lRlKlt.mjs} +5322 -4259
  5. package/dist/ag-q9lRlKlt.mjs.map +1 -0
  6. package/dist/{animation-ZMN2_XKv.mjs → animation-CZ4x2R7C.mjs} +1 -1
  7. package/dist/{animation-ZMN2_XKv.mjs.map → animation-CZ4x2R7C.mjs.map} +1 -1
  8. package/dist/{ansi-D1KQMAbf.mjs → ansi-CLmIMnop.mjs} +1 -1
  9. package/dist/{ansi-D1KQMAbf.mjs.map → ansi-CLmIMnop.mjs.map} +1 -1
  10. package/dist/{ansi-2Xn0yatP.d.mts → ansi-zmNzgkPB.d.mts} +1 -1
  11. package/dist/{ansi-2Xn0yatP.d.mts.map → ansi-zmNzgkPB.d.mts.map} +1 -1
  12. package/dist/{backend-B-WYLUib.mjs → backend-DSiSIc-h.mjs} +2 -2
  13. package/dist/{backend-B-WYLUib.mjs.map → backend-DSiSIc-h.mjs.map} +1 -1
  14. package/dist/chain-bridge-CkYcMxlq.mjs +4149 -0
  15. package/dist/chain-bridge-CkYcMxlq.mjs.map +1 -0
  16. package/dist/{chunk-BSw8zbkd.mjs → chunk-BEJ448es.mjs} +1 -3
  17. package/dist/cli-VNqUKlXw.mjs +4 -0
  18. package/dist/{context-BU5LkkIy.mjs → context-CEhuD1R_.mjs} +1 -1
  19. package/dist/{context-BU5LkkIy.mjs.map → context-CEhuD1R_.mjs.map} +1 -1
  20. package/dist/devtools-BF4IMumr.mjs +2 -0
  21. package/dist/{devtools-DcQjgyjL.mjs → devtools-td2AjFwc.mjs} +5 -5
  22. package/dist/{devtools-DcQjgyjL.mjs.map → devtools-td2AjFwc.mjs.map} +1 -1
  23. package/dist/{easing-BI-ASGMO.d.mts → easing-C5MrdO7V.d.mts} +1 -1
  24. package/dist/{easing-BI-ASGMO.d.mts.map → easing-C5MrdO7V.d.mts.map} +1 -1
  25. package/dist/{eta-CJlGH06n.mjs → eta-BwYWEjfS.mjs} +1 -1
  26. package/dist/{eta-CJlGH06n.mjs.map → eta-BwYWEjfS.mjs.map} +1 -1
  27. package/dist/{flexily-zero-adapter-C4lW_Ov5.mjs → flexily-zero-adapter-DktX3HsX.mjs} +1 -1
  28. package/dist/{flexily-zero-adapter-C3Vj0fPt.mjs → flexily-zero-adapter-VoBGHG14.mjs} +1 -1
  29. package/dist/{flexily-zero-adapter-C3Vj0fPt.mjs.map → flexily-zero-adapter-VoBGHG14.mjs.map} +1 -1
  30. package/dist/hit-registry-D_nxOivS.d.mts +71 -0
  31. package/dist/hit-registry-D_nxOivS.d.mts.map +1 -0
  32. package/dist/{UPNG-DosRPdF4.mjs → image-CIF75xMr.mjs} +891 -6
  33. package/dist/image-CIF75xMr.mjs.map +1 -0
  34. package/dist/{index-CSQf13CI.d.mts → index-377zdPLP.d.mts} +35 -12
  35. package/dist/index-377zdPLP.d.mts.map +1 -0
  36. package/dist/{index-Cl9KKjQ_.d.mts → index-BcSr0RAQ.d.mts} +8670 -10659
  37. package/dist/index-BcSr0RAQ.d.mts.map +1 -0
  38. package/dist/{index-XbNrPhWl.d.mts → index-DLnpxDAm.d.mts} +2 -2
  39. package/dist/{index-XbNrPhWl.d.mts.map → index-DLnpxDAm.d.mts.map} +1 -1
  40. package/dist/{index-BUMxS65f.d.mts → index-DlNmckTq.d.mts} +2 -2
  41. package/dist/{index-BUMxS65f.d.mts.map → index-DlNmckTq.d.mts.map} +1 -1
  42. package/dist/index.d.mts +12 -8
  43. package/dist/index.d.mts.map +1 -1
  44. package/dist/index.mjs +18 -15
  45. package/dist/index.mjs.map +1 -1
  46. package/dist/{layout-engine-C2px0RJE.mjs → layout-engine-BgR58vL0.mjs} +3 -3
  47. package/dist/{layout-engine-C2px0RJE.mjs.map → layout-engine-BgR58vL0.mjs.map} +1 -1
  48. package/dist/{layout-engine-C07LEXWT.mjs → layout-engine-DNjTha8f.mjs} +1 -1
  49. package/dist/{layout-signals-Cnw6xk8Q.mjs → layout-signals-CGYbHmxy.mjs} +146 -23
  50. package/dist/layout-signals-CGYbHmxy.mjs.map +1 -0
  51. package/dist/{bound-term-0sPrrzH1.d.mts → mouse-events-B2z5tbsL.d.mts} +780 -379
  52. package/dist/mouse-events-B2z5tbsL.d.mts.map +1 -0
  53. package/dist/{mouse-events-Dki3ISIp.mjs → mouse-events-WQ2h-uqG.mjs} +45 -10
  54. package/dist/mouse-events-WQ2h-uqG.mjs.map +1 -0
  55. package/dist/{multi-progress-DHZ2xUT2.d.mts → multi-progress-BaEFfHKP.d.mts} +2 -2
  56. package/dist/{multi-progress-DHZ2xUT2.d.mts.map → multi-progress-BaEFfHKP.d.mts.map} +1 -1
  57. package/dist/{multi-progress-CIRjrzma.mjs → multi-progress-zCWHEm9P.mjs} +3 -3
  58. package/dist/{multi-progress-CIRjrzma.mjs.map → multi-progress-zCWHEm9P.mjs.map} +1 -1
  59. package/dist/{node-CjM5Rt-M.mjs → node-CJ3J_rW-.mjs} +1 -1
  60. package/dist/{node-CjM5Rt-M.mjs.map → node-CJ3J_rW-.mjs.map} +1 -1
  61. package/dist/{progress-DB_Xo071.mjs → progress-6vJ7nxUg.mjs} +4 -4
  62. package/dist/{progress-DB_Xo071.mjs.map → progress-6vJ7nxUg.mjs.map} +1 -1
  63. package/dist/{progress-bar-oJwq22CR.mjs → progress-bar-BlFNsZL8.mjs} +4 -4
  64. package/dist/{progress-bar-oJwq22CR.mjs.map → progress-bar-BlFNsZL8.mjs.map} +1 -1
  65. package/dist/{reconciler-DldIJB93.mjs → reconciler--_-biN23.mjs} +190 -134
  66. package/dist/reconciler--_-biN23.mjs.map +1 -0
  67. package/dist/{render-string-BcoCpjCB.mjs → render-string-DaghHpLN.mjs} +1 -1
  68. package/dist/render-string-DtHZP0cU.mjs +215 -0
  69. package/dist/render-string-DtHZP0cU.mjs.map +1 -0
  70. package/dist/runtime.d.mts +4 -3
  71. package/dist/runtime.mjs +4 -3
  72. package/dist/schemes-DWQPxXAi.mjs +2516 -0
  73. package/dist/{schemes-JjNp4aSl.mjs.map → schemes-DWQPxXAi.mjs.map} +1 -1
  74. package/dist/{spinner-D9lrHr8s.mjs → spinner-B50hILqx.mjs} +19 -4
  75. package/dist/{spinner-D9lrHr8s.mjs.map → spinner-B50hILqx.mjs.map} +1 -1
  76. package/dist/{spinner-CZINHpkV.d.mts → spinner-DN10UfF0.d.mts} +2 -2
  77. package/dist/{spinner-CZINHpkV.d.mts.map → spinner-DN10UfF0.d.mts.map} +1 -1
  78. package/dist/{src-BNTToU7l.mjs → src-B8lf1kiR.mjs} +1507 -1166
  79. package/dist/src-B8lf1kiR.mjs.map +1 -0
  80. package/dist/{src-5w9QR6_8.mjs → src-BOLdi3WG.mjs} +105 -237
  81. package/dist/src-BOLdi3WG.mjs.map +1 -0
  82. package/dist/{src-BR4xNwdG.mjs → src-BXeTHHlL.mjs} +20240 -25437
  83. package/dist/src-BXeTHHlL.mjs.map +1 -0
  84. package/dist/{src-DKp-_OFG.mjs → src-BqeBFB3X.mjs} +90 -47
  85. package/dist/src-BqeBFB3X.mjs.map +1 -0
  86. package/dist/src-DbqcSrhy.mjs +3901 -0
  87. package/dist/src-DbqcSrhy.mjs.map +1 -0
  88. package/dist/{steps-Bp2uNqnn.d.mts → steps-B2kBmFpb.d.mts} +1 -1
  89. package/dist/{steps-Bp2uNqnn.d.mts.map → steps-B2kBmFpb.d.mts.map} +1 -1
  90. package/dist/{svg-Cz0UXcDj.mjs → svg-NmV9dgB9.mjs} +1 -1
  91. package/dist/{svg-Cz0UXcDj.mjs.map → svg-NmV9dgB9.mjs.map} +1 -1
  92. package/dist/{svg-g1D6ErwR.d.mts → svg-VUr78l5d.d.mts} +1 -1
  93. package/dist/{svg-g1D6ErwR.d.mts.map → svg-VUr78l5d.d.mts.map} +1 -1
  94. package/dist/term.d.mts +2 -2
  95. package/dist/term.mjs +3 -8
  96. package/dist/test.d.mts +673 -0
  97. package/dist/test.d.mts.map +1 -0
  98. package/dist/test.mjs +2829 -0
  99. package/dist/test.mjs.map +1 -0
  100. package/dist/theme.d.mts +2 -2
  101. package/dist/theme.d.mts.map +1 -1
  102. package/dist/theme.mjs +3 -8
  103. package/dist/{types-kt_fKR37.d.mts → types-D_E0FbqA.d.mts} +1 -1
  104. package/dist/{types-kt_fKR37.d.mts.map → types-D_E0FbqA.d.mts.map} +1 -1
  105. package/dist/ui/animation.d.mts +2 -2
  106. package/dist/ui/animation.mjs +1 -1
  107. package/dist/ui/ansi.d.mts +1 -1
  108. package/dist/ui/ansi.mjs +1 -1
  109. package/dist/ui/cli.d.mts +3 -3
  110. package/dist/ui/cli.mjs +5 -5
  111. package/dist/ui/image.d.mts +1 -1
  112. package/dist/ui/image.mjs +1 -1
  113. package/dist/ui/progress.d.mts +4 -4
  114. package/dist/ui/progress.mjs +4 -4
  115. package/dist/ui/react.d.mts +1 -1
  116. package/dist/ui/react.mjs +2 -2
  117. package/dist/ui/recording-chrome-react.d.mts +1 -1
  118. package/dist/ui/recording-chrome-react.mjs +2 -2
  119. package/dist/ui/recording-chrome.d.mts +1 -1
  120. package/dist/ui/recording-chrome.mjs +1 -1
  121. package/dist/ui/utils.mjs +1 -1
  122. package/dist/ui/wrappers.d.mts +2 -2
  123. package/dist/ui/wrappers.mjs +1 -1
  124. package/dist/ui.d.mts +6 -6
  125. package/dist/ui.mjs +7 -7
  126. package/dist/unicode-CxyxVGmB.mjs +11077 -0
  127. package/dist/unicode-CxyxVGmB.mjs.map +1 -0
  128. package/dist/{useLatest-DRDDVwjh.d.mts → useLatest-UOvWy0ZW.d.mts} +2 -2
  129. package/dist/{useLatest-DRDDVwjh.d.mts.map → useLatest-UOvWy0ZW.d.mts.map} +1 -1
  130. package/dist/useLayout-D5cE8OCI.mjs +424 -0
  131. package/dist/useLayout-D5cE8OCI.mjs.map +1 -0
  132. package/dist/{with-text-input-YeohVLeo.d.mts → with-text-input-DLoSCBrm.d.mts} +3 -3
  133. package/dist/{with-text-input-YeohVLeo.d.mts.map → with-text-input-DLoSCBrm.d.mts.map} +1 -1
  134. package/dist/wrap-measurer-registration-IV2HtcCd.d.mts +3106 -0
  135. package/dist/wrap-measurer-registration-IV2HtcCd.d.mts.map +1 -0
  136. package/dist/{wrapper-C70ATkVv.mjs → wrapper-CD29afOs.mjs} +59 -17
  137. package/dist/wrapper-CD29afOs.mjs.map +1 -0
  138. package/dist/{wrappers-BCUYITrY.mjs → wrappers-CInBJm44.mjs} +18 -8
  139. package/dist/wrappers-CInBJm44.mjs.map +1 -0
  140. package/dist/{yoga-adapter-BnZX1PAY.mjs → yoga-adapter-9uab5Qn-.mjs} +2 -2
  141. package/dist/{yoga-adapter-BnZX1PAY.mjs.map → yoga-adapter-9uab5Qn-.mjs.map} +1 -1
  142. package/dist/yoga-adapter-yqTl1aXK.mjs +2 -0
  143. package/package.json +59 -14
  144. package/dist/Text-Lq0dmj8-.mjs.map +0 -1
  145. package/dist/UPNG-Bo33r8rA.mjs +0 -3
  146. package/dist/UPNG-DosRPdF4.mjs.map +0 -1
  147. package/dist/__vite-browser-external-2447137e-D_JM6skp.mjs +0 -6
  148. package/dist/__vite-browser-external-2447137e-D_JM6skp.mjs.map +0 -1
  149. package/dist/ansi-yC4RyBNY.mjs +0 -22441
  150. package/dist/ansi-yC4RyBNY.mjs.map +0 -1
  151. package/dist/apng-CR08rIaH.mjs +0 -58
  152. package/dist/apng-CR08rIaH.mjs.map +0 -1
  153. package/dist/apng-DaHfVaVI.mjs +0 -3
  154. package/dist/assets/resvgjs.darwin-arm64-BtufyGW1.node +0 -0
  155. package/dist/assets/skia.darwin-arm64-DQs5sT6N.node +0 -0
  156. package/dist/backends-CUtan80W.mjs +0 -3
  157. package/dist/backends-DIVYzKqd.mjs +0 -1083
  158. package/dist/backends-DIVYzKqd.mjs.map +0 -1
  159. package/dist/bound-term-0sPrrzH1.d.mts.map +0 -1
  160. package/dist/canvas-1v7dPT-_.mjs +0 -3
  161. package/dist/canvas-CSuPOMNt.mjs +0 -1442
  162. package/dist/canvas-CSuPOMNt.mjs.map +0 -1
  163. package/dist/cli-dvo0r2fs.mjs +0 -4
  164. package/dist/compare-CQodSH4G.mjs +0 -376
  165. package/dist/compare-CQodSH4G.mjs.map +0 -1
  166. package/dist/compare-DHlcxEYA.mjs +0 -3
  167. package/dist/devtools-CJdt5H0X.mjs +0 -2
  168. package/dist/fonts-BFmhXDv7.mjs +0 -88
  169. package/dist/fonts-BFmhXDv7.mjs.map +0 -1
  170. package/dist/gif-C_AjaT9d.mjs +0 -188
  171. package/dist/gif-C_AjaT9d.mjs.map +0 -1
  172. package/dist/gif-DaC4XrxA.mjs +0 -3
  173. package/dist/gifenc-BOUT-KFB.mjs +0 -730
  174. package/dist/gifenc-BOUT-KFB.mjs.map +0 -1
  175. package/dist/image-C2Birh2x.mjs +0 -1252
  176. package/dist/image-C2Birh2x.mjs.map +0 -1
  177. package/dist/index-CSQf13CI.d.mts.map +0 -1
  178. package/dist/index-Cl9KKjQ_.d.mts.map +0 -1
  179. package/dist/key-mapping-CS-YD_cD.mjs +0 -132
  180. package/dist/key-mapping-CS-YD_cD.mjs.map +0 -1
  181. package/dist/key-mapping-Yn-Jgrij.mjs +0 -3
  182. package/dist/layout-signals-Cnw6xk8Q.mjs.map +0 -1
  183. package/dist/mouse-events-Dki3ISIp.mjs.map +0 -1
  184. package/dist/playwright-D5YiZcNS.mjs +0 -76397
  185. package/dist/playwright-D5YiZcNS.mjs.map +0 -1
  186. package/dist/png-codec-Dp84742B.mjs +0 -36
  187. package/dist/png-codec-Dp84742B.mjs.map +0 -1
  188. package/dist/png-codec-QwOtJ8Zs.mjs +0 -3
  189. package/dist/rasterizer-BRXrDdWx.mjs +0 -3
  190. package/dist/rasterizer-CpEhJvdR.mjs +0 -296
  191. package/dist/rasterizer-CpEhJvdR.mjs.map +0 -1
  192. package/dist/reconciler-DldIJB93.mjs.map +0 -1
  193. package/dist/render-string-DkQacASz.mjs.map +0 -1
  194. package/dist/resvg-js-DkOndZI3.mjs +0 -203
  195. package/dist/resvg-js-DkOndZI3.mjs.map +0 -1
  196. package/dist/schemes-JjNp4aSl.mjs +0 -2611
  197. package/dist/src-5w9QR6_8.mjs.map +0 -1
  198. package/dist/src-BNTToU7l.mjs.map +0 -1
  199. package/dist/src-BR4xNwdG.mjs.map +0 -1
  200. package/dist/src-DKp-_OFG.mjs.map +0 -1
  201. package/dist/src-bt8wSrfJ.mjs +0 -258
  202. package/dist/src-bt8wSrfJ.mjs.map +0 -1
  203. package/dist/src-e33Y6kNJ.mjs +0 -3
  204. package/dist/src-iDwu25UD.mjs +0 -1814
  205. package/dist/src-iDwu25UD.mjs.map +0 -1
  206. package/dist/svg-15lZZzxq.mjs +0 -486
  207. package/dist/svg-15lZZzxq.mjs.map +0 -1
  208. package/dist/svg-DY72a4HK.mjs +0 -3
  209. package/dist/term.mjs.map +0 -1
  210. package/dist/theme.mjs.map +0 -1
  211. package/dist/ui/display.d.mts +0 -35
  212. package/dist/ui/display.d.mts.map +0 -1
  213. package/dist/ui/display.mjs +0 -123
  214. package/dist/ui/display.mjs.map +0 -1
  215. package/dist/ui/input.d.mts +0 -184
  216. package/dist/ui/input.d.mts.map +0 -1
  217. package/dist/ui/input.mjs +0 -285
  218. package/dist/ui/input.mjs.map +0 -1
  219. package/dist/wrapper-C70ATkVv.mjs.map +0 -1
  220. package/dist/wrappers-BCUYITrY.mjs.map +0 -1
  221. package/dist/yoga-adapter-DxgsQ_gg.mjs +0 -2
  222. package/dist/zipBundle-3nqeDRtm.mjs +0 -3
  223. package/dist/zipBundle-VNAYFmqJ.mjs +0 -2003
  224. package/dist/zipBundle-VNAYFmqJ.mjs.map +0 -1
@@ -1,1442 +0,0 @@
1
- import { i as __require, t as __commonJSMin } from "./chunk-BSw8zbkd.mjs";
2
- //#region ../../node_modules/.bun/@napi-rs+canvas@1.0.0/node_modules/@napi-rs/canvas/js-binding.js
3
- var require_js_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4
- const { readFileSync } = __require("fs");
5
- let nativeBinding = null;
6
- const loadErrors = [];
7
- const isMusl = () => {
8
- let musl = false;
9
- if (process.platform === "linux") {
10
- musl = isMuslFromFilesystem();
11
- if (musl === null) musl = isMuslFromReport();
12
- if (musl === null) musl = isMuslFromChildProcess();
13
- }
14
- return musl;
15
- };
16
- const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
17
- const isMuslFromFilesystem = () => {
18
- try {
19
- return readFileSync("/usr/bin/ldd", "utf-8").includes("musl");
20
- } catch {
21
- return null;
22
- }
23
- };
24
- const isMuslFromReport = () => {
25
- let report = null;
26
- if (typeof process.report?.getReport === "function") {
27
- process.report.excludeNetwork = true;
28
- report = process.report.getReport();
29
- }
30
- if (!report) return null;
31
- if (report.header && report.header.glibcVersionRuntime) return false;
32
- if (Array.isArray(report.sharedObjects)) {
33
- if (report.sharedObjects.some(isFileMusl)) return true;
34
- }
35
- return false;
36
- };
37
- const isMuslFromChildProcess = () => {
38
- try {
39
- return __require("child_process").execSync("ldd --version", { encoding: "utf8" }).includes("musl");
40
- } catch (e) {
41
- return false;
42
- }
43
- };
44
- function requireNative() {
45
- if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) try {
46
- return __require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
47
- } catch (err) {
48
- loadErrors.push(err);
49
- }
50
- else if (process.platform === "android") if (process.arch === "arm64") {
51
- try {
52
- return __require("./skia.android-arm64.node");
53
- } catch (e) {
54
- loadErrors.push(e);
55
- }
56
- try {
57
- return __require("@napi-rs/canvas-android-arm64");
58
- } catch (e) {
59
- loadErrors.push(e);
60
- }
61
- } else if (process.arch === "arm") {
62
- try {
63
- return __require("./skia.android-arm-eabi.node");
64
- } catch (e) {
65
- loadErrors.push(e);
66
- }
67
- try {
68
- return __require("@napi-rs/canvas-android-arm-eabi");
69
- } catch (e) {
70
- loadErrors.push(e);
71
- }
72
- } else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Android ${process.arch}`));
73
- else if (process.platform === "win32") if (process.arch === "x64") if (process.config?.variables?.shlib_suffix === "dll.a" || process.config?.variables?.node_target_type === "shared_library") {
74
- try {
75
- return __require("./skia.win32-x64-gnu.node");
76
- } catch (e) {
77
- loadErrors.push(e);
78
- }
79
- try {
80
- return __require("@napi-rs/canvas-win32-x64-gnu");
81
- } catch (e) {
82
- loadErrors.push(e);
83
- }
84
- } else {
85
- try {
86
- return __require("./skia.win32-x64-msvc.node");
87
- } catch (e) {
88
- loadErrors.push(e);
89
- }
90
- try {
91
- return __require("@napi-rs/canvas-win32-x64-msvc");
92
- } catch (e) {
93
- loadErrors.push(e);
94
- }
95
- }
96
- else if (process.arch === "ia32") {
97
- try {
98
- return __require("./skia.win32-ia32-msvc.node");
99
- } catch (e) {
100
- loadErrors.push(e);
101
- }
102
- try {
103
- return __require("@napi-rs/canvas-win32-ia32-msvc");
104
- } catch (e) {
105
- loadErrors.push(e);
106
- }
107
- } else if (process.arch === "arm64") {
108
- try {
109
- return __require("./skia.win32-arm64-msvc.node");
110
- } catch (e) {
111
- loadErrors.push(e);
112
- }
113
- try {
114
- return __require("@napi-rs/canvas-win32-arm64-msvc");
115
- } catch (e) {
116
- loadErrors.push(e);
117
- }
118
- } else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Windows: ${process.arch}`));
119
- else if (process.platform === "darwin") {
120
- try {
121
- return __require("./skia.darwin-universal.node");
122
- } catch (e) {
123
- loadErrors.push(e);
124
- }
125
- try {
126
- return __require("@napi-rs/canvas-darwin-universal");
127
- } catch (e) {
128
- loadErrors.push(e);
129
- }
130
- if (process.arch === "x64") {
131
- try {
132
- return __require("./skia.darwin-x64.node");
133
- } catch (e) {
134
- loadErrors.push(e);
135
- }
136
- try {
137
- return __require("@napi-rs/canvas-darwin-x64");
138
- } catch (e) {
139
- loadErrors.push(e);
140
- }
141
- } else if (process.arch === "arm64") {
142
- try {
143
- return __require("./skia.darwin-arm64.node");
144
- } catch (e) {
145
- loadErrors.push(e);
146
- }
147
- try {
148
- return __require("./assets/skia.darwin-arm64-DQs5sT6N.node");
149
- } catch (e) {
150
- loadErrors.push(e);
151
- }
152
- } else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on macOS: ${process.arch}`));
153
- } else if (process.platform === "freebsd") if (process.arch === "x64") {
154
- try {
155
- return __require("./skia.freebsd-x64.node");
156
- } catch (e) {
157
- loadErrors.push(e);
158
- }
159
- try {
160
- return __require("@napi-rs/canvas-freebsd-x64");
161
- } catch (e) {
162
- loadErrors.push(e);
163
- }
164
- } else if (process.arch === "arm64") {
165
- try {
166
- return __require("./skia.freebsd-arm64.node");
167
- } catch (e) {
168
- loadErrors.push(e);
169
- }
170
- try {
171
- return __require("@napi-rs/canvas-freebsd-arm64");
172
- } catch (e) {
173
- loadErrors.push(e);
174
- }
175
- } else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
176
- else if (process.platform === "linux") if (process.arch === "x64") if (isMusl()) {
177
- try {
178
- return __require("./skia.linux-x64-musl.node");
179
- } catch (e) {
180
- loadErrors.push(e);
181
- }
182
- try {
183
- return __require("@napi-rs/canvas-linux-x64-musl");
184
- } catch (e) {
185
- loadErrors.push(e);
186
- }
187
- } else {
188
- try {
189
- return __require("./skia.linux-x64-gnu.node");
190
- } catch (e) {
191
- loadErrors.push(e);
192
- }
193
- try {
194
- return __require("@napi-rs/canvas-linux-x64-gnu");
195
- } catch (e) {
196
- loadErrors.push(e);
197
- }
198
- }
199
- else if (process.arch === "arm64") if (isMusl()) {
200
- try {
201
- return __require("./skia.linux-arm64-musl.node");
202
- } catch (e) {
203
- loadErrors.push(e);
204
- }
205
- try {
206
- return __require("@napi-rs/canvas-linux-arm64-musl");
207
- } catch (e) {
208
- loadErrors.push(e);
209
- }
210
- } else {
211
- try {
212
- return __require("./skia.linux-arm64-gnu.node");
213
- } catch (e) {
214
- loadErrors.push(e);
215
- }
216
- try {
217
- return __require("@napi-rs/canvas-linux-arm64-gnu");
218
- } catch (e) {
219
- loadErrors.push(e);
220
- }
221
- }
222
- else if (process.arch === "arm") if (isMusl()) {
223
- try {
224
- return __require("./skia.linux-arm-musleabihf.node");
225
- } catch (e) {
226
- loadErrors.push(e);
227
- }
228
- try {
229
- return __require("@napi-rs/canvas-linux-arm-musleabihf");
230
- } catch (e) {
231
- loadErrors.push(e);
232
- }
233
- } else {
234
- try {
235
- return __require("./skia.linux-arm-gnueabihf.node");
236
- } catch (e) {
237
- loadErrors.push(e);
238
- }
239
- try {
240
- return __require("@napi-rs/canvas-linux-arm-gnueabihf");
241
- } catch (e) {
242
- loadErrors.push(e);
243
- }
244
- }
245
- else if (process.arch === "loong64") if (isMusl()) {
246
- try {
247
- return __require("./skia.linux-loong64-musl.node");
248
- } catch (e) {
249
- loadErrors.push(e);
250
- }
251
- try {
252
- return __require("@napi-rs/canvas-linux-loong64-musl");
253
- } catch (e) {
254
- loadErrors.push(e);
255
- }
256
- } else {
257
- try {
258
- return __require("./skia.linux-loong64-gnu.node");
259
- } catch (e) {
260
- loadErrors.push(e);
261
- }
262
- try {
263
- return __require("@napi-rs/canvas-linux-loong64-gnu");
264
- } catch (e) {
265
- loadErrors.push(e);
266
- }
267
- }
268
- else if (process.arch === "riscv64") if (isMusl()) {
269
- try {
270
- return __require("./skia.linux-riscv64-musl.node");
271
- } catch (e) {
272
- loadErrors.push(e);
273
- }
274
- try {
275
- return __require("@napi-rs/canvas-linux-riscv64-musl");
276
- } catch (e) {
277
- loadErrors.push(e);
278
- }
279
- } else {
280
- try {
281
- return __require("./skia.linux-riscv64-gnu.node");
282
- } catch (e) {
283
- loadErrors.push(e);
284
- }
285
- try {
286
- return __require("@napi-rs/canvas-linux-riscv64-gnu");
287
- } catch (e) {
288
- loadErrors.push(e);
289
- }
290
- }
291
- else if (process.arch === "ppc64") {
292
- try {
293
- return __require("./skia.linux-ppc64-gnu.node");
294
- } catch (e) {
295
- loadErrors.push(e);
296
- }
297
- try {
298
- return __require("@napi-rs/canvas-linux-ppc64-gnu");
299
- } catch (e) {
300
- loadErrors.push(e);
301
- }
302
- } else if (process.arch === "s390x") {
303
- try {
304
- return __require("./skia.linux-s390x-gnu.node");
305
- } catch (e) {
306
- loadErrors.push(e);
307
- }
308
- try {
309
- return __require("@napi-rs/canvas-linux-s390x-gnu");
310
- } catch (e) {
311
- loadErrors.push(e);
312
- }
313
- } else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Linux: ${process.arch}`));
314
- else if (process.platform === "openharmony") if (process.arch === "arm64") {
315
- try {
316
- return __require("./skia.openharmony-arm64.node");
317
- } catch (e) {
318
- loadErrors.push(e);
319
- }
320
- try {
321
- return __require("@napi-rs/canvas-openharmony-arm64");
322
- } catch (e) {
323
- loadErrors.push(e);
324
- }
325
- } else if (process.arch === "x64") {
326
- try {
327
- return __require("./skia.openharmony-x64.node");
328
- } catch (e) {
329
- loadErrors.push(e);
330
- }
331
- try {
332
- return __require("@napi-rs/canvas-openharmony-x64");
333
- } catch (e) {
334
- loadErrors.push(e);
335
- }
336
- } else if (process.arch === "arm") {
337
- try {
338
- return __require("./skia.openharmony-arm.node");
339
- } catch (e) {
340
- loadErrors.push(e);
341
- }
342
- try {
343
- return __require("@napi-rs/canvas-openharmony-arm");
344
- } catch (e) {
345
- loadErrors.push(e);
346
- }
347
- } else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
348
- else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
349
- }
350
- nativeBinding = requireNative();
351
- if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
352
- let wasiBinding = null;
353
- let wasiBindingError = null;
354
- try {
355
- wasiBinding = __require("./skia.wasi.cjs");
356
- nativeBinding = wasiBinding;
357
- } catch (err) {
358
- if (process.env.NAPI_RS_FORCE_WASI) wasiBindingError = err;
359
- }
360
- if (!nativeBinding) try {
361
- wasiBinding = __require("@napi-rs/canvas-wasm32-wasi");
362
- nativeBinding = wasiBinding;
363
- } catch (err) {
364
- if (process.env.NAPI_RS_FORCE_WASI) {
365
- wasiBindingError.cause = err;
366
- loadErrors.push(err);
367
- }
368
- }
369
- }
370
- if (!nativeBinding) {
371
- if (loadErrors.length > 0) throw new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.", { cause: loadErrors.reduce((err, cur) => {
372
- cur.cause = err;
373
- return cur;
374
- }) });
375
- throw new Error(`Failed to load native binding`);
376
- }
377
- module.exports = nativeBinding;
378
- module.exports.GlobalFonts = nativeBinding.GlobalFonts;
379
- module.exports.CanvasElement = nativeBinding.CanvasElement;
380
- module.exports.CanvasGradient = nativeBinding.CanvasGradient;
381
- module.exports.CanvasPattern = nativeBinding.CanvasPattern;
382
- module.exports.CanvasRenderingContext2D = nativeBinding.CanvasRenderingContext2D;
383
- module.exports.FontKey = nativeBinding.FontKey;
384
- module.exports.Image = nativeBinding.Image;
385
- module.exports.ImageData = nativeBinding.ImageData;
386
- module.exports.Path = nativeBinding.Path;
387
- module.exports.PdfDocument = nativeBinding.PdfDocument;
388
- module.exports.SVGCanvas = nativeBinding.SVGCanvas;
389
- module.exports.ChromaSubsampling = nativeBinding.ChromaSubsampling;
390
- module.exports.clearAllCache = nativeBinding.clearAllCache;
391
- module.exports.convertSVGTextToPath = nativeBinding.convertSVGTextToPath;
392
- module.exports.FillType = nativeBinding.FillType;
393
- module.exports.PathOp = nativeBinding.PathOp;
394
- module.exports.StrokeCap = nativeBinding.StrokeCap;
395
- module.exports.StrokeJoin = nativeBinding.StrokeJoin;
396
- module.exports.SvgExportFlag = nativeBinding.SvgExportFlag;
397
- module.exports.GifEncoder = nativeBinding.GifEncoder;
398
- module.exports.GifDisposal = nativeBinding.GifDisposal;
399
- }));
400
- //#endregion
401
- //#region ../../node_modules/.bun/@napi-rs+canvas@1.0.0/node_modules/@napi-rs/canvas/geometry.js
402
- var require_geometry = /* @__PURE__ */ __commonJSMin(((exports, module) => {
403
- const { inspect } = __require("util");
404
- var DOMPoint = class DOMPoint {
405
- constructor(x = 0, y = 0, z = 0, w = 1) {
406
- this.x = x;
407
- this.y = y;
408
- this.z = z;
409
- this.w = w;
410
- }
411
- static fromPoint(otherPoint) {
412
- return new DOMPoint(otherPoint.x, otherPoint.y, otherPoint.z !== void 0 ? otherPoint.z : 0, otherPoint.w !== void 0 ? otherPoint.w : 1);
413
- }
414
- matrixTransform(matrix) {
415
- if ((matrix.is2D || matrix instanceof SVGMatrix) && this.z === 0 && this.w === 1) return new DOMPoint(this.x * matrix.a + this.y * matrix.c + matrix.e, this.x * matrix.b + this.y * matrix.d + matrix.f, 0, 1);
416
- else return new DOMPoint(this.x * matrix.m11 + this.y * matrix.m21 + this.z * matrix.m31 + this.w * matrix.m41, this.x * matrix.m12 + this.y * matrix.m22 + this.z * matrix.m32 + this.w * matrix.m42, this.x * matrix.m13 + this.y * matrix.m23 + this.z * matrix.m33 + this.w * matrix.m43, this.x * matrix.m14 + this.y * matrix.m24 + this.z * matrix.m34 + this.w * matrix.m44);
417
- }
418
- toJSON() {
419
- return {
420
- x: this.x,
421
- y: this.y,
422
- z: this.z,
423
- w: this.w
424
- };
425
- }
426
- };
427
- var DOMRect = class DOMRect {
428
- constructor(x = 0, y = 0, width = 0, height = 0) {
429
- this.x = x;
430
- this.y = y;
431
- this.width = width;
432
- this.height = height;
433
- }
434
- static fromRect(otherRect) {
435
- return new DOMRect(otherRect.x, otherRect.y, otherRect.width, otherRect.height);
436
- }
437
- get top() {
438
- return this.y;
439
- }
440
- get left() {
441
- return this.x;
442
- }
443
- get right() {
444
- return this.x + this.width;
445
- }
446
- get bottom() {
447
- return this.y + this.height;
448
- }
449
- toJSON() {
450
- return {
451
- x: this.x,
452
- y: this.y,
453
- width: this.width,
454
- height: this.height,
455
- top: this.top,
456
- left: this.left,
457
- right: this.right,
458
- bottom: this.bottom
459
- };
460
- }
461
- };
462
- for (const propertyName of [
463
- "top",
464
- "right",
465
- "bottom",
466
- "left"
467
- ]) {
468
- const propertyDescriptor = Object.getOwnPropertyDescriptor(DOMRect.prototype, propertyName);
469
- propertyDescriptor.enumerable = true;
470
- Object.defineProperty(DOMRect.prototype, propertyName, propertyDescriptor);
471
- }
472
- const M11 = 0, M12 = 1, M13 = 2, M14 = 3;
473
- const M21 = 4, M22 = 5, M23 = 6, M24 = 7;
474
- const M31 = 8, M32 = 9, M33 = 10, M34 = 11;
475
- const M41 = 12, M42 = 13, M43 = 14, M44 = 15;
476
- const A = M11, B = M12;
477
- const C = M21, D = M22;
478
- const E = M41, F = M42;
479
- const DEGREE_PER_RAD = 180 / Math.PI;
480
- const RAD_PER_DEGREE = Math.PI / 180;
481
- const VALUES = Symbol("values");
482
- const IS_2D = Symbol("is2D");
483
- function parseMatrix(init) {
484
- let parsed = init.replace(/matrix\(/, "").split(/,/, 7);
485
- if (parsed.length !== 6) throw new Error(`Failed to parse ${init}`);
486
- parsed = parsed.map(parseFloat);
487
- return [
488
- parsed[0],
489
- parsed[1],
490
- 0,
491
- 0,
492
- parsed[2],
493
- parsed[3],
494
- 0,
495
- 0,
496
- 0,
497
- 0,
498
- 1,
499
- 0,
500
- parsed[4],
501
- parsed[5],
502
- 0,
503
- 1
504
- ];
505
- }
506
- function parseMatrix3d(init) {
507
- const parsed = init.replace(/matrix3d\(/, "").split(/,/, 17);
508
- if (parsed.length !== 16) throw new Error(`Failed to parse ${init}`);
509
- return parsed.map(parseFloat);
510
- }
511
- function parseTransform(tform) {
512
- const type = tform.split(/\(/, 1)[0];
513
- if (type === "matrix") return parseMatrix(tform);
514
- else if (type === "matrix3d") return parseMatrix3d(tform);
515
- else throw new Error(`${type} parsing not implemented`);
516
- }
517
- const setNumber2D = (receiver, index, value) => {
518
- if (typeof value !== "number") throw new TypeError("Expected number");
519
- receiver[VALUES][index] = value;
520
- };
521
- const setNumber3D = (receiver, index, value) => {
522
- if (typeof value !== "number") throw new TypeError("Expected number");
523
- if (index === M33 || index === M44) {
524
- if (value !== 1) receiver[IS_2D] = false;
525
- } else if (value !== 0) receiver[IS_2D] = false;
526
- receiver[VALUES][index] = value;
527
- };
528
- const newInstance = (values) => {
529
- const instance = Object.create(DOMMatrix.prototype);
530
- instance.constructor = DOMMatrix;
531
- instance[IS_2D] = true;
532
- instance[VALUES] = values;
533
- return instance;
534
- };
535
- const multiply = (first, second) => {
536
- const dest = new Float64Array(16);
537
- for (let i = 0; i < 4; i++) for (let j = 0; j < 4; j++) {
538
- let sum = 0;
539
- for (let k = 0; k < 4; k++) sum += first[i * 4 + k] * second[k * 4 + j];
540
- dest[i * 4 + j] = sum;
541
- }
542
- return dest;
543
- };
544
- var DOMMatrix = class DOMMatrix {
545
- get m11() {
546
- return this[VALUES][M11];
547
- }
548
- set m11(value) {
549
- setNumber2D(this, M11, value);
550
- }
551
- get m12() {
552
- return this[VALUES][M12];
553
- }
554
- set m12(value) {
555
- setNumber2D(this, M12, value);
556
- }
557
- get m13() {
558
- return this[VALUES][M13];
559
- }
560
- set m13(value) {
561
- setNumber3D(this, M13, value);
562
- }
563
- get m14() {
564
- return this[VALUES][M14];
565
- }
566
- set m14(value) {
567
- setNumber3D(this, M14, value);
568
- }
569
- get m21() {
570
- return this[VALUES][M21];
571
- }
572
- set m21(value) {
573
- setNumber2D(this, M21, value);
574
- }
575
- get m22() {
576
- return this[VALUES][M22];
577
- }
578
- set m22(value) {
579
- setNumber2D(this, M22, value);
580
- }
581
- get m23() {
582
- return this[VALUES][M23];
583
- }
584
- set m23(value) {
585
- setNumber3D(this, M23, value);
586
- }
587
- get m24() {
588
- return this[VALUES][M24];
589
- }
590
- set m24(value) {
591
- setNumber3D(this, M24, value);
592
- }
593
- get m31() {
594
- return this[VALUES][M31];
595
- }
596
- set m31(value) {
597
- setNumber3D(this, M31, value);
598
- }
599
- get m32() {
600
- return this[VALUES][M32];
601
- }
602
- set m32(value) {
603
- setNumber3D(this, M32, value);
604
- }
605
- get m33() {
606
- return this[VALUES][M33];
607
- }
608
- set m33(value) {
609
- setNumber3D(this, M33, value);
610
- }
611
- get m34() {
612
- return this[VALUES][M34];
613
- }
614
- set m34(value) {
615
- setNumber3D(this, M34, value);
616
- }
617
- get m41() {
618
- return this[VALUES][M41];
619
- }
620
- set m41(value) {
621
- setNumber2D(this, M41, value);
622
- }
623
- get m42() {
624
- return this[VALUES][M42];
625
- }
626
- set m42(value) {
627
- setNumber2D(this, M42, value);
628
- }
629
- get m43() {
630
- return this[VALUES][M43];
631
- }
632
- set m43(value) {
633
- setNumber3D(this, M43, value);
634
- }
635
- get m44() {
636
- return this[VALUES][M44];
637
- }
638
- set m44(value) {
639
- setNumber3D(this, M44, value);
640
- }
641
- get a() {
642
- return this[VALUES][A];
643
- }
644
- set a(value) {
645
- setNumber2D(this, A, value);
646
- }
647
- get b() {
648
- return this[VALUES][B];
649
- }
650
- set b(value) {
651
- setNumber2D(this, B, value);
652
- }
653
- get c() {
654
- return this[VALUES][C];
655
- }
656
- set c(value) {
657
- setNumber2D(this, C, value);
658
- }
659
- get d() {
660
- return this[VALUES][D];
661
- }
662
- set d(value) {
663
- setNumber2D(this, D, value);
664
- }
665
- get e() {
666
- return this[VALUES][E];
667
- }
668
- set e(value) {
669
- setNumber2D(this, E, value);
670
- }
671
- get f() {
672
- return this[VALUES][F];
673
- }
674
- set f(value) {
675
- setNumber2D(this, F, value);
676
- }
677
- get is2D() {
678
- return this[IS_2D];
679
- }
680
- get isIdentity() {
681
- const values = this[VALUES];
682
- return values[M11] === 1 && values[M12] === 0 && values[M13] === 0 && values[M14] === 0 && values[M21] === 0 && values[M22] === 1 && values[M23] === 0 && values[M24] === 0 && values[M31] === 0 && values[M32] === 0 && values[M33] === 1 && values[M34] === 0 && values[M41] === 0 && values[M42] === 0 && values[M43] === 0 && values[M44] === 1;
683
- }
684
- static fromMatrix(init) {
685
- if (init instanceof DOMMatrix) return new DOMMatrix(init[VALUES]);
686
- else if (init instanceof SVGMatrix) return new DOMMatrix([
687
- init.a,
688
- init.b,
689
- init.c,
690
- init.d,
691
- init.e,
692
- init.f
693
- ]);
694
- else throw new TypeError("Expected DOMMatrix");
695
- }
696
- static fromFloat32Array(init) {
697
- if (!(init instanceof Float32Array)) throw new TypeError("Expected Float32Array");
698
- return new DOMMatrix(init);
699
- }
700
- static fromFloat64Array(init) {
701
- if (!(init instanceof Float64Array)) throw new TypeError("Expected Float64Array");
702
- return new DOMMatrix(init);
703
- }
704
- constructor(init) {
705
- this[IS_2D] = true;
706
- this[VALUES] = new Float64Array([
707
- 1,
708
- 0,
709
- 0,
710
- 0,
711
- 0,
712
- 1,
713
- 0,
714
- 0,
715
- 0,
716
- 0,
717
- 1,
718
- 0,
719
- 0,
720
- 0,
721
- 0,
722
- 1
723
- ]);
724
- if (typeof init === "string") if (init === "") return;
725
- else {
726
- const tforms = init.split(/\)\s+/, 20).map(parseTransform);
727
- if (tforms.length === 0) return;
728
- init = tforms[0];
729
- for (let i = 1; i < tforms.length; i++) init = multiply(tforms[i], init);
730
- }
731
- let i = 0;
732
- if (init && init.length === 6) {
733
- setNumber2D(this, A, init[i++]);
734
- setNumber2D(this, B, init[i++]);
735
- setNumber2D(this, C, init[i++]);
736
- setNumber2D(this, D, init[i++]);
737
- setNumber2D(this, E, init[i++]);
738
- setNumber2D(this, F, init[i++]);
739
- } else if (init && init.length === 16) {
740
- setNumber2D(this, M11, init[i++]);
741
- setNumber2D(this, M12, init[i++]);
742
- setNumber3D(this, M13, init[i++]);
743
- setNumber3D(this, M14, init[i++]);
744
- setNumber2D(this, M21, init[i++]);
745
- setNumber2D(this, M22, init[i++]);
746
- setNumber3D(this, M23, init[i++]);
747
- setNumber3D(this, M24, init[i++]);
748
- setNumber3D(this, M31, init[i++]);
749
- setNumber3D(this, M32, init[i++]);
750
- setNumber3D(this, M33, init[i++]);
751
- setNumber3D(this, M34, init[i++]);
752
- setNumber2D(this, M41, init[i++]);
753
- setNumber2D(this, M42, init[i++]);
754
- setNumber3D(this, M43, init[i++]);
755
- setNumber3D(this, M44, init[i]);
756
- } else if (init !== void 0) throw new TypeError("Expected string or array.");
757
- }
758
- dump() {
759
- const mat = this[VALUES];
760
- console.info([
761
- mat.slice(0, 4),
762
- mat.slice(4, 8),
763
- mat.slice(8, 12),
764
- mat.slice(12, 16)
765
- ]);
766
- }
767
- [inspect.custom](depth) {
768
- if (depth < 0) return "[DOMMatrix]";
769
- const { a, b, c, d, e, f, is2D, isIdentity } = this;
770
- if (this.is2D) return `DOMMatrix ${inspect({
771
- a,
772
- b,
773
- c,
774
- d,
775
- e,
776
- f,
777
- is2D,
778
- isIdentity
779
- }, { colors: true })}`;
780
- else {
781
- const { m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44, is2D, isIdentity } = this;
782
- return `DOMMatrix ${inspect({
783
- a,
784
- b,
785
- c,
786
- d,
787
- e,
788
- f,
789
- m11,
790
- m12,
791
- m13,
792
- m14,
793
- m21,
794
- m22,
795
- m23,
796
- m24,
797
- m31,
798
- m32,
799
- m33,
800
- m34,
801
- m41,
802
- m42,
803
- m43,
804
- m44,
805
- is2D,
806
- isIdentity
807
- }, { colors: true })}`;
808
- }
809
- }
810
- multiply(other) {
811
- return newInstance(this[VALUES]).multiplySelf(other);
812
- }
813
- multiplySelf(other) {
814
- this[VALUES] = multiply(other[VALUES], this[VALUES]);
815
- if (!other.is2D) this[IS_2D] = false;
816
- return this;
817
- }
818
- preMultiplySelf(other) {
819
- this[VALUES] = multiply(this[VALUES], other[VALUES]);
820
- if (!other.is2D) this[IS_2D] = false;
821
- return this;
822
- }
823
- translate(tx, ty, tz) {
824
- return newInstance(this[VALUES]).translateSelf(tx, ty, tz);
825
- }
826
- translateSelf(tx = 0, ty = 0, tz = 0) {
827
- this[VALUES] = multiply([
828
- 1,
829
- 0,
830
- 0,
831
- 0,
832
- 0,
833
- 1,
834
- 0,
835
- 0,
836
- 0,
837
- 0,
838
- 1,
839
- 0,
840
- tx,
841
- ty,
842
- tz,
843
- 1
844
- ], this[VALUES]);
845
- if (tz !== 0) this[IS_2D] = false;
846
- return this;
847
- }
848
- scale(scaleX, scaleY, scaleZ, originX, originY, originZ) {
849
- return newInstance(this[VALUES]).scaleSelf(scaleX, scaleY, scaleZ, originX, originY, originZ);
850
- }
851
- scale3d(scale, originX, originY, originZ) {
852
- return newInstance(this[VALUES]).scale3dSelf(scale, originX, originY, originZ);
853
- }
854
- scale3dSelf(scale, originX, originY, originZ) {
855
- return this.scaleSelf(scale, scale, scale, originX, originY, originZ);
856
- }
857
- scaleSelf(scaleX, scaleY, scaleZ, originX, originY, originZ) {
858
- if (typeof originX !== "number") originX = 0;
859
- if (typeof originY !== "number") originY = 0;
860
- if (typeof originZ !== "number") originZ = 0;
861
- this.translateSelf(originX, originY, originZ);
862
- if (typeof scaleX !== "number") scaleX = 1;
863
- if (typeof scaleY !== "number") scaleY = scaleX;
864
- if (typeof scaleZ !== "number") scaleZ = 1;
865
- this[VALUES] = multiply([
866
- scaleX,
867
- 0,
868
- 0,
869
- 0,
870
- 0,
871
- scaleY,
872
- 0,
873
- 0,
874
- 0,
875
- 0,
876
- scaleZ,
877
- 0,
878
- 0,
879
- 0,
880
- 0,
881
- 1
882
- ], this[VALUES]);
883
- this.translateSelf(-originX, -originY, -originZ);
884
- if (scaleZ !== 1 || originZ !== 0) this[IS_2D] = false;
885
- return this;
886
- }
887
- rotateFromVector(x, y) {
888
- return newInstance(this[VALUES]).rotateFromVectorSelf(x, y);
889
- }
890
- rotateFromVectorSelf(x = 0, y = 0) {
891
- const theta = x === 0 && y === 0 ? 0 : Math.atan2(y, x) * DEGREE_PER_RAD;
892
- return this.rotateSelf(theta);
893
- }
894
- rotate(rotX, rotY, rotZ) {
895
- return newInstance(this[VALUES]).rotateSelf(rotX, rotY, rotZ);
896
- }
897
- rotateSelf(rotX, rotY, rotZ) {
898
- if (rotY === void 0 && rotZ === void 0) {
899
- rotZ = rotX;
900
- rotX = rotY = 0;
901
- }
902
- if (typeof rotY !== "number") rotY = 0;
903
- if (typeof rotZ !== "number") rotZ = 0;
904
- if (rotX !== 0 || rotY !== 0) this[IS_2D] = false;
905
- rotX *= RAD_PER_DEGREE;
906
- rotY *= RAD_PER_DEGREE;
907
- rotZ *= RAD_PER_DEGREE;
908
- let c = Math.cos(rotZ);
909
- let s = Math.sin(rotZ);
910
- this[VALUES] = multiply([
911
- c,
912
- s,
913
- 0,
914
- 0,
915
- -s,
916
- c,
917
- 0,
918
- 0,
919
- 0,
920
- 0,
921
- 1,
922
- 0,
923
- 0,
924
- 0,
925
- 0,
926
- 1
927
- ], this[VALUES]);
928
- c = Math.cos(rotY);
929
- s = Math.sin(rotY);
930
- this[VALUES] = multiply([
931
- c,
932
- 0,
933
- -s,
934
- 0,
935
- 0,
936
- 1,
937
- 0,
938
- 0,
939
- s,
940
- 0,
941
- c,
942
- 0,
943
- 0,
944
- 0,
945
- 0,
946
- 1
947
- ], this[VALUES]);
948
- c = Math.cos(rotX);
949
- s = Math.sin(rotX);
950
- this[VALUES] = multiply([
951
- 1,
952
- 0,
953
- 0,
954
- 0,
955
- 0,
956
- c,
957
- s,
958
- 0,
959
- 0,
960
- -s,
961
- c,
962
- 0,
963
- 0,
964
- 0,
965
- 0,
966
- 1
967
- ], this[VALUES]);
968
- return this;
969
- }
970
- rotateAxisAngle(x, y, z, angle) {
971
- return newInstance(this[VALUES]).rotateAxisAngleSelf(x, y, z, angle);
972
- }
973
- rotateAxisAngleSelf(x = 0, y = 0, z = 0, angle = 0) {
974
- const length = Math.sqrt(x * x + y * y + z * z);
975
- if (length === 0) return this;
976
- if (length !== 1) {
977
- x /= length;
978
- y /= length;
979
- z /= length;
980
- }
981
- angle *= RAD_PER_DEGREE;
982
- const c = Math.cos(angle);
983
- const s = Math.sin(angle);
984
- const t = 1 - c;
985
- const tx = t * x;
986
- const ty = t * y;
987
- this[VALUES] = multiply([
988
- tx * x + c,
989
- tx * y + s * z,
990
- tx * z - s * y,
991
- 0,
992
- tx * y - s * z,
993
- ty * y + c,
994
- ty * z + s * x,
995
- 0,
996
- tx * z + s * y,
997
- ty * z - s * x,
998
- t * z * z + c,
999
- 0,
1000
- 0,
1001
- 0,
1002
- 0,
1003
- 1
1004
- ], this[VALUES]);
1005
- if (x !== 0 || y !== 0) this[IS_2D] = false;
1006
- return this;
1007
- }
1008
- skewX(sx) {
1009
- return newInstance(this[VALUES]).skewXSelf(sx);
1010
- }
1011
- skewXSelf(sx) {
1012
- if (typeof sx !== "number") return this;
1013
- this[VALUES] = multiply([
1014
- 1,
1015
- 0,
1016
- 0,
1017
- 0,
1018
- Math.tan(sx * RAD_PER_DEGREE),
1019
- 1,
1020
- 0,
1021
- 0,
1022
- 0,
1023
- 0,
1024
- 1,
1025
- 0,
1026
- 0,
1027
- 0,
1028
- 0,
1029
- 1
1030
- ], this[VALUES]);
1031
- return this;
1032
- }
1033
- skewY(sy) {
1034
- return newInstance(this[VALUES]).skewYSelf(sy);
1035
- }
1036
- skewYSelf(sy) {
1037
- if (typeof sy !== "number") return this;
1038
- this[VALUES] = multiply([
1039
- 1,
1040
- Math.tan(sy * RAD_PER_DEGREE),
1041
- 0,
1042
- 0,
1043
- 0,
1044
- 1,
1045
- 0,
1046
- 0,
1047
- 0,
1048
- 0,
1049
- 1,
1050
- 0,
1051
- 0,
1052
- 0,
1053
- 0,
1054
- 1
1055
- ], this[VALUES]);
1056
- return this;
1057
- }
1058
- flipX() {
1059
- return newInstance(multiply([
1060
- -1,
1061
- 0,
1062
- 0,
1063
- 0,
1064
- 0,
1065
- 1,
1066
- 0,
1067
- 0,
1068
- 0,
1069
- 0,
1070
- 1,
1071
- 0,
1072
- 0,
1073
- 0,
1074
- 0,
1075
- 1
1076
- ], this[VALUES]));
1077
- }
1078
- flipY() {
1079
- return newInstance(multiply([
1080
- 1,
1081
- 0,
1082
- 0,
1083
- 0,
1084
- 0,
1085
- -1,
1086
- 0,
1087
- 0,
1088
- 0,
1089
- 0,
1090
- 1,
1091
- 0,
1092
- 0,
1093
- 0,
1094
- 0,
1095
- 1
1096
- ], this[VALUES]));
1097
- }
1098
- inverse() {
1099
- return newInstance(this[VALUES].slice()).invertSelf();
1100
- }
1101
- invertSelf() {
1102
- if (this[IS_2D]) {
1103
- const det = this[VALUES][A] * this[VALUES][D] - this[VALUES][B] * this[VALUES][C];
1104
- if (det !== 0) {
1105
- const newA = this[VALUES][D] / det;
1106
- const newB = -this[VALUES][B] / det;
1107
- const newC = -this[VALUES][C] / det;
1108
- const newD = this[VALUES][A] / det;
1109
- const newE = (this[VALUES][C] * this[VALUES][F] - this[VALUES][D] * this[VALUES][E]) / det;
1110
- const newF = (this[VALUES][B] * this[VALUES][E] - this[VALUES][A] * this[VALUES][F]) / det;
1111
- this.a = newA;
1112
- this.b = newB;
1113
- this.c = newC;
1114
- this.d = newD;
1115
- this.e = newE;
1116
- this.f = newF;
1117
- return this;
1118
- } else {
1119
- this[IS_2D] = false;
1120
- this[VALUES] = [
1121
- NaN,
1122
- NaN,
1123
- NaN,
1124
- NaN,
1125
- NaN,
1126
- NaN,
1127
- NaN,
1128
- NaN,
1129
- NaN,
1130
- NaN,
1131
- NaN,
1132
- NaN,
1133
- NaN,
1134
- NaN,
1135
- NaN,
1136
- NaN
1137
- ];
1138
- return this;
1139
- }
1140
- } else throw new Error("3D matrix inversion is not implemented.");
1141
- }
1142
- setMatrixValue(transformList) {
1143
- const temp = new DOMMatrix(transformList);
1144
- this[VALUES] = temp[VALUES];
1145
- this[IS_2D] = temp[IS_2D];
1146
- return this;
1147
- }
1148
- transformPoint(point) {
1149
- const x = point.x || 0;
1150
- const y = point.y || 0;
1151
- const z = point.z || 0;
1152
- const w = point.w || 1;
1153
- const values = this[VALUES];
1154
- return new DOMPoint(values[M11] * x + values[M21] * y + values[M31] * z + values[M41] * w, values[M12] * x + values[M22] * y + values[M32] * z + values[M42] * w, values[M13] * x + values[M23] * y + values[M33] * z + values[M43] * w, values[M14] * x + values[M24] * y + values[M34] * z + values[M44] * w);
1155
- }
1156
- toFloat32Array() {
1157
- return Float32Array.from(this[VALUES]);
1158
- }
1159
- toFloat64Array() {
1160
- return this[VALUES].slice(0);
1161
- }
1162
- toJSON() {
1163
- return {
1164
- a: this.a,
1165
- b: this.b,
1166
- c: this.c,
1167
- d: this.d,
1168
- e: this.e,
1169
- f: this.f,
1170
- m11: this.m11,
1171
- m12: this.m12,
1172
- m13: this.m13,
1173
- m14: this.m14,
1174
- m21: this.m21,
1175
- m22: this.m22,
1176
- m23: this.m23,
1177
- m24: this.m24,
1178
- m31: this.m31,
1179
- m32: this.m32,
1180
- m33: this.m33,
1181
- m34: this.m34,
1182
- m41: this.m41,
1183
- m42: this.m42,
1184
- m43: this.m43,
1185
- m44: this.m44,
1186
- is2D: this.is2D,
1187
- isIdentity: this.isIdentity
1188
- };
1189
- }
1190
- toString() {
1191
- if (this.is2D) return `matrix(${this.a}, ${this.b}, ${this.c}, ${this.d}, ${this.e}, ${this.f})`;
1192
- else return `matrix3d(${this[VALUES].join(", ")})`;
1193
- }
1194
- };
1195
- for (const propertyName of [
1196
- "a",
1197
- "b",
1198
- "c",
1199
- "d",
1200
- "e",
1201
- "f",
1202
- "m11",
1203
- "m12",
1204
- "m13",
1205
- "m14",
1206
- "m21",
1207
- "m22",
1208
- "m23",
1209
- "m24",
1210
- "m31",
1211
- "m32",
1212
- "m33",
1213
- "m34",
1214
- "m41",
1215
- "m42",
1216
- "m43",
1217
- "m44",
1218
- "is2D",
1219
- "isIdentity"
1220
- ]) {
1221
- const propertyDescriptor = Object.getOwnPropertyDescriptor(DOMMatrix.prototype, propertyName);
1222
- propertyDescriptor.enumerable = true;
1223
- Object.defineProperty(DOMMatrix.prototype, propertyName, propertyDescriptor);
1224
- }
1225
- module.exports = {
1226
- DOMPoint,
1227
- DOMMatrix,
1228
- DOMRect
1229
- };
1230
- }));
1231
- //#endregion
1232
- //#region ../../node_modules/.bun/@napi-rs+canvas@1.0.0/node_modules/@napi-rs/canvas/load-image.js
1233
- var require_load_image = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1234
- const fs = __require("fs");
1235
- const { Readable } = __require("stream");
1236
- const { URL } = __require("url");
1237
- const { Image } = require_js_binding();
1238
- let http, https;
1239
- const MAX_REDIRECTS = 20;
1240
- const REDIRECT_STATUSES = new Set([301, 302]);
1241
- /**
1242
- * Loads the given source into canvas Image
1243
- * @param {string|URL|Image|Buffer} source The image source to be loaded
1244
- * @param {object} options Options passed to the loader
1245
- */
1246
- module.exports = async function loadImage(source, options = {}) {
1247
- if (Buffer.isBuffer(source) || source instanceof Uint8Array) return createImage(source, options.alt);
1248
- if (source instanceof Readable) return createImage(await consumeStream(source), options.alt);
1249
- if (source instanceof ArrayBuffer || source instanceof SharedArrayBuffer) return createImage(new Uint8Array(source), options.alt);
1250
- if (isBufferLike(source)) return createImage(Buffer.from(source), options.alt);
1251
- if (source instanceof Image) return createImage(source.src, options.alt);
1252
- if (typeof source === "string" && source.trimStart().startsWith("data:")) {
1253
- const commaIdx = source.indexOf(",");
1254
- const encoding = source.lastIndexOf("base64", commaIdx) < 0 ? "utf-8" : "base64";
1255
- const data = Buffer.from(source.slice(commaIdx + 1), encoding);
1256
- if (data.length === 0) throw new Error(`Invalid data URI: empty payload in ${source.slice(0, 64)}`);
1257
- return createImage(data, options.alt);
1258
- }
1259
- if (typeof source === "string") if (!source.startsWith("http") && !source.startsWith("https") && await exists(source)) return createImage(source, options.alt);
1260
- else {
1261
- source = new URL(source);
1262
- return createImage(await new Promise((resolve, reject) => makeRequest(source, resolve, reject, typeof options.maxRedirects === "number" && options.maxRedirects >= 0 ? options.maxRedirects : MAX_REDIRECTS, options.requestOptions)), options.alt);
1263
- }
1264
- if (source instanceof URL) if (source.protocol === "file:") return createImage(process.platform === "win32" ? source.pathname.substring(1) : source.pathname, options.alt);
1265
- else return createImage(await new Promise((resolve, reject) => makeRequest(source, resolve, reject, typeof options.maxRedirects === "number" && options.maxRedirects >= 0 ? options.maxRedirects : MAX_REDIRECTS, options.requestOptions)), options.alt);
1266
- throw new TypeError("unsupported image source");
1267
- };
1268
- function makeRequest(url, resolve, reject, redirectCount, requestOptions) {
1269
- (url.protocol === "https:" ? !https ? https = __require("https") : https : !http ? http = __require("http") : http).get(url.toString(), requestOptions || {}, (res) => {
1270
- try {
1271
- if (REDIRECT_STATUSES.has(res.statusCode) && typeof res.headers.location === "string" && redirectCount > 0) return makeRequest(new URL(res.headers.location, url.origin), resolve, reject, redirectCount - 1, requestOptions);
1272
- if (typeof res.statusCode === "number" && (res.statusCode < 200 || res.statusCode >= 300)) return reject(/* @__PURE__ */ new Error(`remote source rejected with status code ${res.statusCode}`));
1273
- consumeStream(res).then(resolve, reject);
1274
- } catch (err) {
1275
- reject(err);
1276
- }
1277
- }).on("error", reject);
1278
- }
1279
- function consumeStream(res) {
1280
- return new Promise((resolve, reject) => {
1281
- const chunks = [];
1282
- res.on("data", (chunk) => chunks.push(chunk));
1283
- res.on("end", () => resolve(Buffer.concat(chunks)));
1284
- res.on("error", reject);
1285
- });
1286
- }
1287
- async function createImage(src, alt) {
1288
- if ((Buffer.isBuffer(src) || src instanceof Uint8Array) && src.length === 0) throw new Error("loadImage: empty image data");
1289
- const image = new Image();
1290
- if (typeof alt === "string") image.alt = alt;
1291
- return new Promise((resolve, reject) => {
1292
- image.onload = () => {
1293
- image.decode().then(() => resolve(image), reject);
1294
- };
1295
- image.onerror = (e) => reject(e);
1296
- image.src = src;
1297
- });
1298
- }
1299
- function isBufferLike(src) {
1300
- return src && src.type === "Buffer" || Array.isArray(src);
1301
- }
1302
- async function exists(path) {
1303
- try {
1304
- await fs.promises.access(path, fs.constants.F_OK);
1305
- return true;
1306
- } catch {
1307
- return false;
1308
- }
1309
- }
1310
- }));
1311
- //#endregion
1312
- //#region ../../node_modules/.bun/@napi-rs+canvas@1.0.0/node_modules/@napi-rs/canvas/index.js
1313
- var require_canvas = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1314
- const { platform, homedir } = __require("os");
1315
- const { join } = __require("path");
1316
- const { clearAllCache, CanvasRenderingContext2D, CanvasElement, SVGCanvas, Path: Path2D, ImageData, Image, FontKey, GlobalFonts, PathOp, FillType, StrokeJoin, StrokeCap, convertSVGTextToPath, PdfDocument, GifEncoder, GifDisposal, LottieAnimation } = require_js_binding();
1317
- const { DOMPoint, DOMMatrix, DOMRect } = require_geometry();
1318
- const loadImage = require_load_image();
1319
- if (GifEncoder && typeof Symbol.dispose !== "undefined") GifEncoder.prototype[Symbol.dispose] = function() {
1320
- this.dispose();
1321
- };
1322
- const SvgExportFlag = {
1323
- ConvertTextToPaths: 1,
1324
- NoPrettyXML: 2,
1325
- RelativePathEncoding: 4
1326
- };
1327
- if (!("families" in GlobalFonts)) Object.defineProperty(GlobalFonts, "families", { get: function() {
1328
- return JSON.parse(GlobalFonts.getFamilies().toString());
1329
- } });
1330
- if (!("has" in GlobalFonts)) Object.defineProperty(GlobalFonts, "has", {
1331
- value: function has(name) {
1332
- return !!JSON.parse(GlobalFonts.getFamilies().toString()).find(({ family }) => family === name);
1333
- },
1334
- configurable: false,
1335
- enumerable: false,
1336
- writable: false
1337
- });
1338
- const _toBlob = CanvasElement.prototype.toBlob;
1339
- const _convertToBlob = CanvasElement.prototype.convertToBlob;
1340
- if ("Blob" in globalThis) {
1341
- CanvasElement.prototype.toBlob = function toBlob(callback, mimeType, quality) {
1342
- _toBlob.call(this, function(imageBuffer) {
1343
- callback(new Blob([imageBuffer.buffer], { type: mimeType }));
1344
- }, mimeType, quality);
1345
- };
1346
- CanvasElement.prototype.convertToBlob = function convertToBlob(options) {
1347
- return _convertToBlob.call(this, options).then((imageBuffer) => {
1348
- return new Blob([imageBuffer.buffer], { type: options?.mime || "image/png" });
1349
- });
1350
- };
1351
- } else {
1352
- CanvasElement.prototype.toBlob = function toBlob(callback, mimeType, quality) {
1353
- callback(null);
1354
- };
1355
- CanvasElement.prototype.convertToBlob = function convertToBlob(options) {
1356
- return Promise.reject(/* @__PURE__ */ new Error("Blob is not supported in this environment"));
1357
- };
1358
- }
1359
- const _getTransform = CanvasRenderingContext2D.prototype.getTransform;
1360
- CanvasRenderingContext2D.prototype.getTransform = function getTransform() {
1361
- const transform = _getTransform.apply(this, arguments);
1362
- if (transform instanceof DOMMatrix) return transform;
1363
- const { a, b, c, d, e, f } = transform;
1364
- return new DOMMatrix([
1365
- a,
1366
- b,
1367
- c,
1368
- d,
1369
- e,
1370
- f
1371
- ]);
1372
- };
1373
- const _drawImage = CanvasRenderingContext2D.prototype.drawImage;
1374
- CanvasRenderingContext2D.prototype.drawImage = function drawImage(image, ...args) {
1375
- if (image && typeof image === "object") {
1376
- if (image.canvas instanceof CanvasElement || image.canvas instanceof SVGCanvas) image = image.canvas;
1377
- else if (image._canvas instanceof CanvasElement || image._canvas instanceof SVGCanvas) image = image._canvas;
1378
- else if (typeof image.getContext === "function" && image.width && image.height) {
1379
- if (!(image instanceof CanvasElement) && !(image instanceof SVGCanvas)) Object.setPrototypeOf(image, CanvasElement.prototype);
1380
- }
1381
- }
1382
- return _drawImage.apply(this, [image, ...args]);
1383
- };
1384
- function createCanvas(width, height, flag) {
1385
- return typeof flag !== "undefined" ? new SVGCanvas(width, height, flag) : new CanvasElement(width, height);
1386
- }
1387
- var Canvas = class {
1388
- constructor(width, height, flag) {
1389
- return createCanvas(width, height, flag);
1390
- }
1391
- static [Symbol.hasInstance](instance) {
1392
- return instance instanceof CanvasElement || instance instanceof SVGCanvas;
1393
- }
1394
- };
1395
- if (!process.env.DISABLE_SYSTEM_FONTS_LOAD) {
1396
- GlobalFonts.loadSystemFonts();
1397
- const platformName = platform();
1398
- const homedirPath = homedir();
1399
- switch (platformName) {
1400
- case "win32":
1401
- GlobalFonts.loadFontsFromDir(join(homedirPath, "AppData", "Local", "Microsoft", "Windows", "Fonts"));
1402
- break;
1403
- case "darwin":
1404
- GlobalFonts.loadFontsFromDir(join(homedirPath, "Library", "Fonts"));
1405
- break;
1406
- case "linux":
1407
- GlobalFonts.loadFontsFromDir(join("usr", "local", "share", "fonts"));
1408
- GlobalFonts.loadFontsFromDir(join(homedirPath, ".fonts"));
1409
- break;
1410
- }
1411
- }
1412
- module.exports = {
1413
- clearAllCache,
1414
- Canvas,
1415
- createCanvas,
1416
- Path2D,
1417
- ImageData,
1418
- Image,
1419
- PathOp,
1420
- FillType,
1421
- StrokeCap,
1422
- StrokeJoin,
1423
- SvgExportFlag,
1424
- GlobalFonts,
1425
- convertSVGTextToPath,
1426
- DOMPoint,
1427
- DOMMatrix,
1428
- DOMRect,
1429
- loadImage,
1430
- FontKey,
1431
- CanvasElement,
1432
- SVGCanvas,
1433
- PDFDocument: PdfDocument,
1434
- GifEncoder,
1435
- GifDisposal,
1436
- LottieAnimation
1437
- };
1438
- }));
1439
- //#endregion
1440
- export { require_canvas as t };
1441
-
1442
- //# sourceMappingURL=canvas-CSuPOMNt.mjs.map