dispach 0.1.2 → 0.2.0-pilot.1

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 (247) hide show
  1. package/README.md +196 -118
  2. package/dist/APEv2Parser-2wqk09q7.js +5 -0
  3. package/dist/APEv2Parser-2wqk09q7.js.map +9 -0
  4. package/dist/AiffParser-zw4g2bdd.js +5 -0
  5. package/dist/AiffParser-zw4g2bdd.js.map +12 -0
  6. package/dist/App-ez7ve0yp.js +11 -0
  7. package/dist/{App-b1yrwrcq.js.map → App-ez7ve0yp.js.map} +6 -7
  8. package/dist/AsfParser-2hfcf5z2.js +5 -0
  9. package/dist/AsfParser-2hfcf5z2.js.map +14 -0
  10. package/dist/ConfigEditor-aamadrx3.js +6 -0
  11. package/dist/{ConfigEditor-n8hdw6r7.js.map → ConfigEditor-aamadrx3.js.map} +2 -2
  12. package/dist/DsdiffParser-n8smktvb.js +5 -0
  13. package/dist/DsdiffParser-n8smktvb.js.map +11 -0
  14. package/dist/DsfParser-npmjp4vr.js +5 -0
  15. package/dist/DsfParser-npmjp4vr.js.map +11 -0
  16. package/dist/FlacParser-xpbs2zmb.js +5 -0
  17. package/dist/FlacParser-xpbs2zmb.js.map +9 -0
  18. package/dist/KeyProbe-4fp152yv.js +5 -0
  19. package/dist/{KeyProbe-9jjeze5r.js.map → KeyProbe-4fp152yv.js.map} +2 -2
  20. package/dist/MP4Parser-es3afcmw.js +5 -0
  21. package/dist/MP4Parser-es3afcmw.js.map +12 -0
  22. package/dist/MatroskaParser-kxysj649.js +5 -0
  23. package/dist/MatroskaParser-kxysj649.js.map +13 -0
  24. package/dist/MpegParser-b3rr7b0f.js +5 -0
  25. package/dist/MpegParser-b3rr7b0f.js.map +13 -0
  26. package/dist/MusepackParser-sgjzmq0r.js +5 -0
  27. package/dist/MusepackParser-sgjzmq0r.js.map +16 -0
  28. package/dist/OggParser-x8h54ynf.js +5 -0
  29. package/dist/OggParser-x8h54ynf.js.map +18 -0
  30. package/dist/Picker-rq015kzc.js +5 -0
  31. package/dist/{Picker-hfeh1g6m.js.map → Picker-rq015kzc.js.map} +2 -2
  32. package/dist/SessionPicker-03zyvd2f.js +5 -0
  33. package/dist/{SessionPicker-zyqkg4dn.js.map → SessionPicker-03zyvd2f.js.map} +2 -2
  34. package/dist/SkillBrowser-8s8rjv98.js +5 -0
  35. package/dist/{SkillBrowser-3qdp8080.js.map → SkillBrowser-8s8rjv98.js.map} +2 -2
  36. package/dist/WavPackParser-w515nnw2.js +5 -0
  37. package/dist/WavPackParser-w515nnw2.js.map +11 -0
  38. package/dist/WaveParser-sb0w9m20.js +5 -0
  39. package/dist/WaveParser-sb0w9m20.js.map +13 -0
  40. package/dist/WizardApp-wr1tftcr.js +5 -0
  41. package/dist/{WizardApp-vzpbydy3.js.map → WizardApp-wr1tftcr.js.map} +3 -3
  42. package/dist/agents.d.ts +19 -3
  43. package/dist/agents.d.ts.map +1 -1
  44. package/dist/channels-gx951qdp.js +31 -0
  45. package/dist/channels-gx951qdp.js.map +10 -0
  46. package/dist/channels.d.ts +26 -0
  47. package/dist/channels.d.ts.map +1 -0
  48. package/dist/client.js +11 -11
  49. package/dist/client.js.map +3 -3
  50. package/dist/config-wvjeejgd.js +24 -0
  51. package/dist/{config-g7za9x13.js.map → config-wvjeejgd.js.map} +2 -2
  52. package/dist/credential-10dn3fxj.js +19 -0
  53. package/dist/{credential-npr6z8c8.js.map → credential-10dn3fxj.js.map} +1 -1
  54. package/dist/daemon.d.ts.map +1 -1
  55. package/dist/index-10009hp8.js +11 -0
  56. package/dist/index-10009hp8.js.map +11 -0
  57. package/dist/index-1xwrkwh5.js +14 -0
  58. package/dist/index-1xwrkwh5.js.map +50 -0
  59. package/dist/index-34p39yfc.js +47 -0
  60. package/dist/index-34p39yfc.js.map +15 -0
  61. package/dist/index-3y96s740.js +6 -0
  62. package/dist/{index-hwpvhaza.js.map → index-3y96s740.js.map} +1 -1
  63. package/dist/index-4ybeefmn.js +6 -0
  64. package/dist/index-4ybeefmn.js.map +11 -0
  65. package/dist/index-59z88wrb.js +6 -0
  66. package/dist/{index-h9mw7b9d.js.map → index-59z88wrb.js.map} +2 -2
  67. package/dist/index-5fwzn21m.js +6 -0
  68. package/dist/{index-gz9x25tz.js.map → index-5fwzn21m.js.map} +2 -2
  69. package/dist/index-6dvnfk8y.js +6 -0
  70. package/dist/index-6dvnfk8y.js.map +10 -0
  71. package/dist/index-6p70fnb7.js +153 -0
  72. package/dist/index-6p70fnb7.js.map +20 -0
  73. package/dist/index-6s471ydn.js +12 -0
  74. package/dist/{index-j55s3ehk.js.map → index-6s471ydn.js.map} +2 -2
  75. package/dist/index-87wcawta.js +6 -0
  76. package/dist/{index-0d93hyfc.js.map → index-87wcawta.js.map} +2 -2
  77. package/dist/index-92gfcbw0.js +6 -0
  78. package/dist/index-92gfcbw0.js.map +9 -0
  79. package/dist/index-a0h0p20f.js +991 -0
  80. package/dist/{index-tv4yv7d2.js.map → index-a0h0p20f.js.map} +27 -23
  81. package/dist/index-bamw24xc.js +6 -0
  82. package/dist/{index-6q4wf8e3.js.map → index-bamw24xc.js.map} +1 -1
  83. package/dist/index-c8ge88a9.js +12 -0
  84. package/dist/{index-258d8bzg.js.map → index-c8ge88a9.js.map} +4 -3
  85. package/dist/index-cb2q8nae.js +6 -0
  86. package/dist/index-cb2q8nae.js.map +13 -0
  87. package/dist/index-ct6bw0a6.js +6 -0
  88. package/dist/{index-4z7axw4r.js.map → index-ct6bw0a6.js.map} +1 -1
  89. package/dist/index-cz6yjxyz.js +10 -0
  90. package/dist/index-cz6yjxyz.js.map +42 -0
  91. package/dist/index-d0c5abkw.js +6 -0
  92. package/dist/{index-vgc3y3rm.js.map → index-d0c5abkw.js.map} +3 -3
  93. package/dist/index-d0vagham.js +31 -0
  94. package/dist/index-d0vagham.js.map +188 -0
  95. package/dist/index-d0zxvr99.js +90 -0
  96. package/dist/index-d0zxvr99.js.map +13 -0
  97. package/dist/{index-s9mbq7h6.js → index-d9c97ver.js} +4 -4
  98. package/dist/{index-s9mbq7h6.js.map → index-d9c97ver.js.map} +1 -1
  99. package/dist/index-e508e0vt.js +6 -0
  100. package/dist/{index-tf71ap9v.js.map → index-e508e0vt.js.map} +1 -1
  101. package/dist/index-esq0knqx.js +6 -0
  102. package/dist/index-esq0knqx.js.map +10 -0
  103. package/dist/index-featyhps.js +6 -0
  104. package/dist/index-featyhps.js.map +10 -0
  105. package/dist/index-fnq44zdt.js +45 -0
  106. package/dist/index-fnq44zdt.js.map +74 -0
  107. package/dist/index-gmn80dwc.js +7 -0
  108. package/dist/{index-02dn6m2j.js.map → index-gmn80dwc.js.map} +2 -2
  109. package/dist/index-gwhx69qs.js +66 -0
  110. package/dist/index-gwhx69qs.js.map +12 -0
  111. package/dist/index-kjgzhf3w.js +9 -0
  112. package/dist/{index-6p999cx4.js.map → index-kjgzhf3w.js.map} +4 -6
  113. package/dist/index-m68cd91a.js +12 -0
  114. package/dist/index-m68cd91a.js.map +23 -0
  115. package/dist/{index-3g3ny01d.js → index-mhmgw54j.js} +4 -4
  116. package/dist/{index-3g3ny01d.js.map → index-mhmgw54j.js.map} +1 -1
  117. package/dist/{index-gme2egyq.js → index-qm612hwa.js} +4 -4
  118. package/dist/{index-gme2egyq.js.map → index-qm612hwa.js.map} +1 -1
  119. package/dist/{index-j7gyr5nx.js → index-qwntpbwe.js} +7 -7
  120. package/dist/{index-j7gyr5nx.js.map → index-qwntpbwe.js.map} +1 -1
  121. package/dist/index-qx3xdk4x.js +6 -0
  122. package/dist/{index-d4x6yvqh.js.map → index-qx3xdk4x.js.map} +3 -4
  123. package/dist/{index-4cf6v9nb.js → index-rh0meegk.js} +4 -4
  124. package/dist/{index-4cf6v9nb.js.map → index-rh0meegk.js.map} +1 -1
  125. package/dist/index-ryb159ff.js +9 -0
  126. package/dist/{index-ff514z3y.js.map → index-ryb159ff.js.map} +3 -5
  127. package/dist/{index-ammv5st7.js → index-s6zfpyqa.js} +6 -6
  128. package/dist/{index-ammv5st7.js.map → index-s6zfpyqa.js.map} +1 -1
  129. package/dist/index-s9va2kmc.js +429 -0
  130. package/dist/index-s9va2kmc.js.map +11 -0
  131. package/dist/index-v5dmsgpx.js +7 -0
  132. package/dist/index-v5dmsgpx.js.map +11 -0
  133. package/dist/index-vaj3mn3a.js +6 -0
  134. package/dist/index-vaj3mn3a.js.map +14 -0
  135. package/dist/index-vy0rbzws.js +6 -0
  136. package/dist/{index-fex44816.js.map → index-vy0rbzws.js.map} +2 -2
  137. package/dist/index-w0s77wfx.js +6 -0
  138. package/dist/{index-v8e92nfw.js.map → index-w0s77wfx.js.map} +1 -1
  139. package/dist/index-wx1jzjzr.js +6 -0
  140. package/dist/{index-qdbq8crg.js.map → index-wx1jzjzr.js.map} +2 -2
  141. package/dist/index-xbn26c8g.js +126 -0
  142. package/dist/index-xbn26c8g.js.map +14 -0
  143. package/dist/index-ytvwyp6k.js +6 -0
  144. package/dist/{index-9r0wyj6w.js.map → index-ytvwyp6k.js.map} +2 -2
  145. package/dist/{index-cqqb6gaq.js → index-yvnwpxbb.js} +5 -5
  146. package/dist/{index-cqqb6gaq.js.map → index-yvnwpxbb.js.map} +1 -1
  147. package/dist/index.js +379 -448
  148. package/dist/index.js.map +26 -28
  149. package/dist/init.d.ts.map +1 -1
  150. package/dist/lib/agent-secrets.d.ts +38 -0
  151. package/dist/lib/agent-secrets.d.ts.map +1 -0
  152. package/dist/lib/agent-template.d.ts +54 -0
  153. package/dist/lib/agent-template.d.ts.map +1 -0
  154. package/dist/lib/channel-actions.d.ts +103 -0
  155. package/dist/lib/channel-actions.d.ts.map +1 -0
  156. package/dist/lib/chat-frame.d.ts +12 -1
  157. package/dist/lib/chat-frame.d.ts.map +1 -1
  158. package/dist/lib/commands.d.ts +13 -0
  159. package/dist/lib/commands.d.ts.map +1 -1
  160. package/dist/lib/const.d.ts +1 -1
  161. package/dist/lib/daemon-plan.d.ts.map +1 -1
  162. package/dist/lib/help.d.ts.map +1 -1
  163. package/dist/lib/host-actions.d.ts +121 -0
  164. package/dist/lib/host-actions.d.ts.map +1 -0
  165. package/dist/lib/init-flow.d.ts +32 -0
  166. package/dist/lib/init-flow.d.ts.map +1 -1
  167. package/dist/lib/init-whatsapp.d.ts +52 -0
  168. package/dist/lib/init-whatsapp.d.ts.map +1 -0
  169. package/dist/lib/plugin-install.d.ts +120 -0
  170. package/dist/lib/plugin-install.d.ts.map +1 -0
  171. package/dist/lib/providers.d.ts.map +1 -1
  172. package/dist/lib/provision.d.ts +13 -0
  173. package/dist/lib/provision.d.ts.map +1 -1
  174. package/dist/lib/readme-table.d.ts +15 -0
  175. package/dist/lib/readme-table.d.ts.map +1 -0
  176. package/dist/lib/sandbox.d.ts +17 -0
  177. package/dist/lib/sandbox.d.ts.map +1 -1
  178. package/dist/lib/schema.d.ts +34 -1
  179. package/dist/lib/schema.d.ts.map +1 -1
  180. package/dist/lib/subcommand.d.ts.map +1 -1
  181. package/dist/lib/web-url.d.ts +15 -0
  182. package/dist/lib/web-url.d.ts.map +1 -0
  183. package/dist/lib/wizard.d.ts.map +1 -1
  184. package/dist/memory.d.ts.map +1 -1
  185. package/dist/model.d.ts.map +1 -1
  186. package/dist/plugins.d.ts +27 -8
  187. package/dist/plugins.d.ts.map +1 -1
  188. package/dist/restart.d.ts +21 -0
  189. package/dist/restart.d.ts.map +1 -0
  190. package/dist/run.d.ts.map +1 -1
  191. package/dist/schedules.d.ts.map +1 -1
  192. package/dist/serve.d.ts.map +1 -1
  193. package/dist/sessions.d.ts.map +1 -1
  194. package/dist/skills.d.ts.map +1 -1
  195. package/dist/status.d.ts +16 -0
  196. package/dist/status.d.ts.map +1 -0
  197. package/dist/tools.d.ts.map +1 -1
  198. package/dist/validate.d.ts.map +1 -1
  199. package/dist/web-61cjhpv2.js +14 -0
  200. package/dist/{web-vkb16r62.js.map → web-61cjhpv2.js.map} +3 -3
  201. package/dist/web.d.ts +2 -13
  202. package/dist/web.d.ts.map +1 -1
  203. package/dist/workspace.d.ts.map +1 -1
  204. package/dist/wrapper-9msjh1xg.js +5 -0
  205. package/dist/wrapper-9msjh1xg.js.map +9 -0
  206. package/package.json +6 -3
  207. package/dist/App-b1yrwrcq.js +0 -11
  208. package/dist/ConfigEditor-n8hdw6r7.js +0 -6
  209. package/dist/KeyProbe-9jjeze5r.js +0 -5
  210. package/dist/Picker-hfeh1g6m.js +0 -5
  211. package/dist/SessionPicker-zyqkg4dn.js +0 -5
  212. package/dist/SkillBrowser-3qdp8080.js +0 -5
  213. package/dist/WizardApp-vzpbydy3.js +0 -5
  214. package/dist/config-g7za9x13.js +0 -24
  215. package/dist/credential-npr6z8c8.js +0 -19
  216. package/dist/index-02dn6m2j.js +0 -7
  217. package/dist/index-0d93hyfc.js +0 -6
  218. package/dist/index-1c5113t4.js +0 -66
  219. package/dist/index-1c5113t4.js.map +0 -12
  220. package/dist/index-258d8bzg.js +0 -12
  221. package/dist/index-4z7axw4r.js +0 -6
  222. package/dist/index-6p999cx4.js +0 -9
  223. package/dist/index-6q4wf8e3.js +0 -6
  224. package/dist/index-9r0wyj6w.js +0 -6
  225. package/dist/index-d4x6yvqh.js +0 -6
  226. package/dist/index-fecm8xe7.js +0 -77
  227. package/dist/index-fecm8xe7.js.map +0 -12
  228. package/dist/index-fex44816.js +0 -6
  229. package/dist/index-ff514z3y.js +0 -14
  230. package/dist/index-gz9x25tz.js +0 -6
  231. package/dist/index-h9mw7b9d.js +0 -6
  232. package/dist/index-hwpvhaza.js +0 -6
  233. package/dist/index-j55s3ehk.js +0 -12
  234. package/dist/index-mtn0g9vc.js +0 -7
  235. package/dist/index-mtn0g9vc.js.map +0 -11
  236. package/dist/index-qdbq8crg.js +0 -6
  237. package/dist/index-tf71ap9v.js +0 -6
  238. package/dist/index-ttwyrdjs.js +0 -427
  239. package/dist/index-ttwyrdjs.js.map +0 -11
  240. package/dist/index-tv4yv7d2.js +0 -903
  241. package/dist/index-ty24n0jh.js +0 -167
  242. package/dist/index-ty24n0jh.js.map +0 -19
  243. package/dist/index-v8e92nfw.js +0 -6
  244. package/dist/index-vgc3y3rm.js +0 -6
  245. package/dist/index-whaw4b18.js +0 -6
  246. package/dist/index-whaw4b18.js.map +0 -10
  247. package/dist/web-vkb16r62.js +0 -14
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import{spawn as s,spawnSync as f}from"node:child_process";function Ro(n){let e=f(n.command,[...n.args],{encoding:"utf8",...n.input===void 0?{}:{input:n.input},...n.cwd===void 0?{}:{cwd:n.cwd},...n.env===void 0?{}:{env:n.env},...n.timeoutMs===void 0?{}:{timeout:n.timeoutMs},...n.maxBuffer===void 0?{}:{maxBuffer:n.maxBuffer}}),d=e.error?.code;return{code:e.status??1,stdout:e.stdout??"",stderr:e.stderr??"",signalled:e.signal!==null,notFound:d==="ENOENT"}}function ge(n){return new Promise((e)=>{let d=s(n.command,[...n.args],{...n.cwd===void 0?{}:{cwd:n.cwd},...n.env===void 0?{}:{env:n.env},stdio:[n.input===void 0?"ignore":"pipe","pipe","pipe"]});if(n.input!==void 0)d.stdin?.end(n.input);let t="",a="",r=!1,u=n.maxBuffer??33554432;d.stdout?.on("data",(o)=>{if(t.length<u)t+=o.toString("utf8")}),d.stderr?.on("data",(o)=>{if(a.length<u)a+=o.toString("utf8")});let i=n.timeoutMs===void 0?void 0:setTimeout(()=>{r=!0,d.kill("SIGTERM")},n.timeoutMs);d.on("error",(o)=>{if(i!==void 0)clearTimeout(i);e({code:1,stdout:t,stderr:o.message,signalled:r,notFound:o.code==="ENOENT"})}),d.on("close",(o,l)=>{if(i!==void 0)clearTimeout(i);e({code:o??1,stdout:t,stderr:a,signalled:r||l!==null,notFound:!1})})})}
3
- export{Ro,ge};
2
+ import{spawn as s,spawnSync as f}from"node:child_process";function Tr(n){let e=f(n.command,[...n.args],{encoding:"utf8",...n.input===void 0?{}:{input:n.input},...n.cwd===void 0?{}:{cwd:n.cwd},...n.env===void 0?{}:{env:n.env},...n.timeoutMs===void 0?{}:{timeout:n.timeoutMs},...n.maxBuffer===void 0?{}:{maxBuffer:n.maxBuffer}}),d=e.error?.code;return{code:e.status??1,stdout:e.stdout??"",stderr:e.stderr??"",signalled:e.signal!==null,notFound:d==="ENOENT"}}function nA(n){return new Promise((e)=>{let d=s(n.command,[...n.args],{...n.cwd===void 0?{}:{cwd:n.cwd},...n.env===void 0?{}:{env:n.env},stdio:[n.input===void 0?"ignore":"pipe","pipe","pipe"]});if(n.input!==void 0)d.stdin?.end(n.input);let t="",a="",r=!1,u=n.maxBuffer??33554432;d.stdout?.on("data",(o)=>{if(t.length<u)t+=o.toString("utf8")}),d.stderr?.on("data",(o)=>{if(a.length<u)a+=o.toString("utf8")});let i=n.timeoutMs===void 0?void 0:setTimeout(()=>{r=!0,d.kill("SIGTERM")},n.timeoutMs);d.on("error",(o)=>{if(i!==void 0)clearTimeout(i);e({code:1,stdout:t,stderr:o.message,signalled:r,notFound:o.code==="ENOENT"})}),d.on("close",(o,l)=>{if(i!==void 0)clearTimeout(i);e({code:o??1,stdout:t,stderr:a,signalled:r||l!==null,notFound:!1})})})}
3
+ export{Tr,nA};
4
4
 
5
- //# debugId=40F37B7163E8814864756E2164756E21
6
- //# sourceMappingURL=index-s9mbq7h6.js.map
5
+ //# debugId=E611DCBFDF96302964756E2164756E21
6
+ //# sourceMappingURL=index-d9c97ver.js.map
@@ -5,6 +5,6 @@
5
5
  "/**\n * The one place in this package that starts a process.\n *\n * There were two callers before this file existed and the second one is what created it: `lib/service.ts`\n * ran `launchctl`, and fetching a skill source needs `git`. The rule the boundaries test enforces is\n * \"exactly one module imports `node:child_process`\", and its stated reason is that a second call site is a\n * second place a test has to intercept — the first one that forgets reaches somebody's real machine. Two\n * callers of one seam keeps that property; an allowlist with two entries in it loses it, and would go on\n * losing it once per phase.\n *\n * Deliberately thin, and deliberately not clever. Everything specific to a tool — git's four ways of\n * being told not to prompt, launchd's exit-status decoding — belongs to the caller that knows about it.\n * What lives here is \"run this, capture what it said, and tell me honestly how it ended\".\n *\n * `notFound` is a field rather than an exception because the two callers want different sentences for it:\n * a missing `git` has a remedy the person can act on, and a missing `launchctl` means this is not the\n * operating system the caller thought it was. A shared error message would be wrong for both.\n */\n\nimport { spawn, spawnSync } from \"node:child_process\"\n\nexport interface SpawnRequest {\n readonly command: string\n readonly args: readonly string[]\n readonly cwd?: string\n /** Replaces the environment entirely when given. Callers spread `process.env` themselves. */\n readonly env?: Readonly<Record<string, string | undefined>>\n readonly timeoutMs?: number\n readonly maxBuffer?: number\n /**\n * Text to write to the child's stdin, which is then closed.\n *\n * Added for the clipboard: `pbcopy` reads what it copies from stdin and there is no argument form. The\n * alternative was a temporary file, which puts whatever was selected on disk — and a selection is\n * routinely the most sensitive thing on the screen. The seam grows rather than the caller working\n * around it, per the rule about first-party code not getting private escape hatches.\n */\n readonly input?: string\n}\n\nexport interface SpawnResult {\n readonly code: number\n readonly stdout: string\n readonly stderr: string\n /** True when a timeout or a signal ended it, rather than the process choosing to exit. */\n readonly signalled: boolean\n /** True when the command is not on PATH at all. */\n readonly notFound: boolean\n}\n\nexport function spawnCapture(request: SpawnRequest): SpawnResult {\n const result = spawnSync(request.command, [...request.args], {\n encoding: \"utf8\",\n ...(request.input === undefined ? {} : { input: request.input }),\n ...(request.cwd === undefined ? {} : { cwd: request.cwd }),\n ...(request.env === undefined ? {} : { env: request.env as NodeJS.ProcessEnv }),\n ...(request.timeoutMs === undefined ? {} : { timeout: request.timeoutMs }),\n ...(request.maxBuffer === undefined ? {} : { maxBuffer: request.maxBuffer }),\n })\n const code = (result.error as NodeJS.ErrnoException | undefined)?.code\n return {\n code: result.status ?? 1,\n stdout: result.stdout ?? \"\",\n stderr: result.stderr ?? \"\",\n signalled: result.signal !== null,\n notFound: code === \"ENOENT\",\n }\n}\n\n/**\n * The same thing, without blocking the event loop.\n *\n * Exists because `spawnSync` inside an Ink app freezes the whole terminal: no spinner frame advances, and\n * the keypresses that arrive during a twenty-second `git clone` are echoed by the tty instead of being\n * consumed by the app — which is how `^[[B^[[A` ended up printed in the middle of a fetch progress line.\n * Anything a rendered screen waits on has to be awaited, not blocked on.\n */\nexport function spawnCaptureAsync(request: SpawnRequest): Promise<SpawnResult> {\n return new Promise((resolve) => {\n const child = spawn(request.command, [...request.args], {\n ...(request.cwd === undefined ? {} : { cwd: request.cwd }),\n ...(request.env === undefined ? {} : { env: request.env as NodeJS.ProcessEnv }),\n // Never inherit: a child that writes to the terminal would paint over the rendered frame, and\n // one that reads from it would steal the keys the app is listening for.\n // A pipe only when there is something to write. `ignore` otherwise, for the reason below.\n stdio: [request.input === undefined ? \"ignore\" : \"pipe\", \"pipe\", \"pipe\"],\n })\n if (request.input !== undefined) {\n // Ended immediately: a child reading stdin waits for EOF, so a pipe left open is a process\n // that never exits and a promise that never settles.\n child.stdin?.end(request.input)\n }\n let stdout = \"\"\n let stderr = \"\"\n let signalled = false\n const cap = request.maxBuffer ?? 32 * 1024 * 1024\n child.stdout?.on(\"data\", (chunk: Buffer) => {\n if (stdout.length < cap) stdout += chunk.toString(\"utf8\")\n })\n child.stderr?.on(\"data\", (chunk: Buffer) => {\n if (stderr.length < cap) stderr += chunk.toString(\"utf8\")\n })\n const timer =\n request.timeoutMs === undefined\n ? undefined\n : setTimeout(() => {\n signalled = true\n // The group, not the pid: `git clone` spawns helpers, and killing only the parent\n // leaves them running with nothing referencing them.\n child.kill(\"SIGTERM\")\n }, request.timeoutMs)\n child.on(\"error\", (error: NodeJS.ErrnoException) => {\n if (timer !== undefined) clearTimeout(timer)\n resolve({\n code: 1,\n stdout,\n stderr: error.message,\n signalled,\n notFound: error.code === \"ENOENT\",\n })\n })\n child.on(\"close\", (code, signal) => {\n if (timer !== undefined) clearTimeout(timer)\n resolve({\n code: code ?? 1,\n stdout,\n stderr,\n signalled: signalled || signal !== null,\n notFound: false,\n })\n })\n })\n}\n"
6
6
  ],
7
7
  "mappings": ";AAmBA,gBAAS,eAAO,2BA+BT,SAAS,EAAY,CAAC,EAAoC,CAC7D,IAAM,EAAS,EAAU,EAAQ,QAAS,CAAC,GAAG,EAAQ,IAAI,EAAG,CACzD,SAAU,UACN,EAAQ,QAAU,OAAY,CAAC,EAAI,CAAE,MAAO,EAAQ,KAAM,KAC1D,EAAQ,MAAQ,OAAY,CAAC,EAAI,CAAE,IAAK,EAAQ,GAAI,KACpD,EAAQ,MAAQ,OAAY,CAAC,EAAI,CAAE,IAAK,EAAQ,GAAyB,KACzE,EAAQ,YAAc,OAAY,CAAC,EAAI,CAAE,QAAS,EAAQ,SAAU,KACpE,EAAQ,YAAc,OAAY,CAAC,EAAI,CAAE,UAAW,EAAQ,SAAU,CAC9E,CAAC,EACK,EAAQ,EAAO,OAA6C,KAClE,MAAO,CACH,KAAM,EAAO,QAAU,EACvB,OAAQ,EAAO,QAAU,GACzB,OAAQ,EAAO,QAAU,GACzB,UAAW,EAAO,SAAW,KAC7B,SAAU,IAAS,QACvB,EAWG,SAAS,EAAiB,CAAC,EAA6C,CAC3E,OAAO,IAAI,QAAQ,CAAC,IAAY,CAC5B,IAAM,EAAQ,EAAM,EAAQ,QAAS,CAAC,GAAG,EAAQ,IAAI,EAAG,IAChD,EAAQ,MAAQ,OAAY,CAAC,EAAI,CAAE,IAAK,EAAQ,GAAI,KACpD,EAAQ,MAAQ,OAAY,CAAC,EAAI,CAAE,IAAK,EAAQ,GAAyB,EAI7E,MAAO,CAAC,EAAQ,QAAU,OAAY,SAAW,OAAQ,OAAQ,MAAM,CAC3E,CAAC,EACD,GAAI,EAAQ,QAAU,OAGlB,EAAM,OAAO,IAAI,EAAQ,KAAK,EAElC,IAAI,EAAS,GACT,EAAS,GACT,EAAY,GACV,EAAM,EAAQ,WAAa,SACjC,EAAM,QAAQ,GAAG,OAAQ,CAAC,IAAkB,CACxC,GAAI,EAAO,OAAS,EAAK,GAAU,EAAM,SAAS,MAAM,EAC3D,EACD,EAAM,QAAQ,GAAG,OAAQ,CAAC,IAAkB,CACxC,GAAI,EAAO,OAAS,EAAK,GAAU,EAAM,SAAS,MAAM,EAC3D,EACD,IAAM,EACF,EAAQ,YAAc,OAChB,OACA,WAAW,IAAM,CACb,EAAY,GAGZ,EAAM,KAAK,SAAS,GACrB,EAAQ,SAAS,EAC9B,EAAM,GAAG,QAAS,CAAC,IAAiC,CAChD,GAAI,IAAU,OAAW,aAAa,CAAK,EAC3C,EAAQ,CACJ,KAAM,EACN,SACA,OAAQ,EAAM,QACd,YACA,SAAU,EAAM,OAAS,QAC7B,CAAC,EACJ,EACD,EAAM,GAAG,QAAS,CAAC,EAAM,IAAW,CAChC,GAAI,IAAU,OAAW,aAAa,CAAK,EAC3C,EAAQ,CACJ,KAAM,GAAQ,EACd,SACA,SACA,UAAW,GAAa,IAAW,KACnC,SAAU,EACd,CAAC,EACJ,EACJ",
8
- "debugId": "40F37B7163E8814864756E2164756E21",
8
+ "debugId": "E611DCBFDF96302964756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import{rA,_n,mi,M}from"./index-a0h0p20f.js";import{existsSync as b,readFileSync as E}from"node:fs";import{dirname as l,join as o,resolve as u}from"node:path";function EA(n){let e=o(l(n),".env"),r={};if(b(e))try{r=rA(E(e,"utf8"))}catch{}return _n(r,M([n]))}function bt(n,e){let r=n[e];return r!==void 0&&r!==""}function f(n,e,r={}){let i=l(n),t=u(r.cwd??process.cwd()),d=r.readDir??mi,v=r.env??process.env,g=M([n],r),m=d(i),p=d(t),a=g[e];if(a!==void 0&&a!==""){let y=u(i)===t,c=p[e];if(!y&&c!==void 0&&v[e]===c)return{kind:"ambiguous",path:o(t,".env")};return{kind:"export"}}let s=m[e];if(s!==void 0&&s!=="")return{kind:"agent",path:o(i,".env")};return{kind:"unset"}}function $i(n){switch(n.kind){case"export":return"from the environment, not a .env file";case"ambiguous":return"from the environment or ./.env — indistinguishable";case"agent":return;case"unset":return"not set"}}function er(n){let e=[],r=h(n.rawModelId);if(r!==void 0)e.push({field:"model.main.id",variable:r,origin:f(n.manifestPath,r,n.options??{})});if(n.apiKeyEnv!==void 0)e.push({field:"model.main.apiKeyEnv",variable:n.apiKeyEnv,origin:f(n.manifestPath,n.apiKeyEnv,n.options??{})});return e}function h(n){if(n===void 0)return;return/^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/.exec(n.trim())?.[1]}
3
+ export{EA,bt,$i,er};
4
+
5
+ //# debugId=9183F965CECEE18364756E2164756E21
6
+ //# sourceMappingURL=index-e508e0vt.js.map
@@ -5,6 +5,6 @@
5
5
  "/**\n * Whether a variable an agent depends on is actually set, from that agent's point of view.\n *\n * `ambientEnv` is **not** this. It layers the *cwd*'s `.env` against an agent's — demoting a colliding\n * variable so a project checkout cannot silently change which model a sandbox agent runs on — and it\n * returns `process.env` unchanged whenever nothing is in tension. It never *adds* the agent's own file.\n *\n * The agent's `.env` is merged by `loadManifest`, through core's `layeredEnv`, and that is the answer a\n * question about this agent needs. Reading `process.env` alone reported a variable as unset while the\n * file beside the manifest plainly had it — the same class of mistake `serve` made once, reporting\n * \"unauthenticated\" for a token sitting next to the manifest. It showed up here as an editor row that\n * still read `(not set)` immediately after somebody set it, which is the \"did that work?\" failure this\n * whole surface exists to remove.\n *\n * Precedence is core's, unchanged: the real environment wins, because an operator's export has to beat\n * a file for a container to be able to configure the agent it runs.\n */\n\nimport { existsSync, readFileSync } from \"node:fs\"\nimport { dirname, join, resolve } from \"node:path\"\nimport { type EnvSource, layeredEnv, parseDotEnv } from \"@dispach/core\"\nimport { type AmbientOptions, ambientEnv, readDotEnv } from \"#lib/ambient\"\n\n/** The environment this agent will actually see: its own `.env` under the ambient one. */\nexport function agentEnv(manifestPath: string): EnvSource {\n const path = join(dirname(manifestPath), \".env\")\n let beside: Record<string, string> = {}\n if (existsSync(path)) {\n try {\n beside = parseDotEnv(readFileSync(path, \"utf8\"))\n } catch {\n // An unreadable `.env` is reported by the loader, in the words the loader uses. Here it\n // simply means nothing is known to be set, which is the safe reading for a \"is it set?\"\n // question — claiming a variable is present when the file cannot be read would be worse.\n }\n }\n return layeredEnv(beside, ambientEnv([manifestPath]))\n}\n\n/** Whether `name` has a non-empty value. Empty counts as unset: it fails a load exactly as absent does. */\nexport function isSet(env: EnvSource, name: string): boolean {\n const value = env[name]\n return value !== undefined && value !== \"\"\n}\n\n/**\n * Where a value came from, which is a different question from whether it is set.\n *\n * Three layers can supply one variable and the winner is not obvious from any of them:\n *\n * 1. the real environment — an operator's export, or a container's `environment:` block\n * 2. the `.env` beside the agent's manifest\n * 3. a `.env` in the directory the command was run from, demoted beneath (2) by `ambientEnv`\n *\n * Every one of those is correct on its own, and the composition is unreadable. It produced a real\n * confusion in a container: `docker compose` passes `MODEL_ID` and friends as process environment,\n * so an agent scaffolded inside that container silently ran on the *mounted*\n * agent's model, and the `0600` `.env` that `init` had just written was ignored for exactly those\n * keys — with nothing anywhere saying so.\n *\n * The precedence is not the bug and is not changed here. What was missing is a sentence, and the\n * recorded lesson from the last time this surfaced is that *a warning explained the surprise and\n * did not remove it* — so this reports rather than intervenes.\n */\nexport type EnvOrigin =\n /** The real environment won: an export, or a container's own configuration. */\n | { readonly kind: \"export\" }\n /** The `.env` beside the manifest won. */\n | { readonly kind: \"agent\"; readonly path: string }\n /**\n * Either an export or the cwd's `.env`, and **they cannot be told apart**.\n *\n * Bun auto-loads a `.env` from the current directory into `process.env` before any of this code\n * runs, so once the two agree on a string there is no evidence left distinguishing them. Said\n * rather than guessed: naming one would be a coin toss printed as a fact.\n */\n | { readonly kind: \"ambiguous\"; readonly path: string }\n | { readonly kind: \"unset\" }\n\n/**\n * Which layer supplies `name` for this agent.\n *\n * Mirrors `ambientEnv`'s precedence by *calling* it rather than by restating it — the demotion rule\n * is subtle (a cwd variable is demoted only when the agent's own file also sets it *and* the values\n * match), and a second implementation of that would drift on the first edit.\n */\nexport function sourceOf(\n manifestPath: string,\n name: string,\n options: AmbientOptions = {},\n): EnvOrigin {\n const agentDir = dirname(manifestPath)\n const cwd = resolve(options.cwd ?? process.cwd())\n const read = options.readDir ?? readDotEnv\n const raw = options.env ?? process.env\n\n const ambient = ambientEnv([manifestPath], options)\n const beside = read(agentDir)\n const inCwd = read(cwd)\n\n const fromAmbient = ambient[name]\n if (fromAmbient !== undefined && fromAmbient !== \"\") {\n // The cwd file is only a candidate when it is a *different* directory from the agent's: when\n // they are the same directory, that file **is** the agent's own and `ambientEnv` says so.\n const sameDir = resolve(agentDir) === cwd\n const cwdValue = inCwd[name]\n if (!sameDir && cwdValue !== undefined && raw[name] === cwdValue) {\n return { kind: \"ambiguous\", path: join(cwd, \".env\") }\n }\n return { kind: \"export\" }\n }\n\n const fromFile = beside[name]\n if (fromFile !== undefined && fromFile !== \"\") {\n return { kind: \"agent\", path: join(agentDir, \".env\") }\n }\n\n return { kind: \"unset\" }\n}\n\n/**\n * The phrase for a status line — short, because it rides after a value somebody is already reading.\n *\n * Returns `undefined` for the ordinary case, which is the whole point: a line that always carries a\n * provenance note is a line nobody reads it on. The agent's own `.env` winning is what an author\n * expects, so only the surprising sources say anything.\n */\nexport function describeOrigin(origin: EnvOrigin): string | undefined {\n switch (origin.kind) {\n case \"export\":\n return \"from the environment, not a .env file\"\n case \"ambiguous\":\n return \"from the environment or ./.env — indistinguishable\"\n case \"agent\":\n return undefined\n case \"unset\":\n return \"not set\"\n }\n}\n\n/** One env-backed field, the variable behind it, and where the value came from. */\nexport interface Provenance {\n readonly field: string\n readonly variable: string\n readonly origin: EnvOrigin\n}\n\n/**\n * The env-backed fields worth saying something about, and only when there is something to say.\n *\n * Two fields, chosen because they are the two that produced a real confusion in a container:\n * `docker compose` passes `MODEL_ID` and `MODEL_API_KEY` as process environment, and the ambient\n * environment deliberately beats the agent's own file so an operator can configure the agent their\n * container runs. So an agent scaffolded in that container ran on the *mounted*\n * agent's model and ignored the `0600` `.env` init had just written.\n *\n * The model id is included **only when the manifest writes it as a variable**. A generated manifest\n * carries it literally (which is why `readManifestHeader` can list agents without credentials), and\n * a literal has no provenance to report — printing \"from the environment\" about a value nothing read\n * from the environment would be worse than silence. `apiKeyEnv` is always a variable name by hard\n * rule 10, so it is always askable.\n */\nexport function envProvenance(input: {\n readonly manifestPath: string\n /** The raw, unexpanded `model.main.id` — `readManifestHeader().modelId`. */\n readonly rawModelId: string | undefined\n readonly apiKeyEnv: string | undefined\n readonly options?: AmbientOptions\n}): readonly Provenance[] {\n const rows: Provenance[] = []\n const variable = soleVariable(input.rawModelId)\n if (variable !== undefined) {\n rows.push({\n field: \"model.main.id\",\n variable,\n origin: sourceOf(input.manifestPath, variable, input.options ?? {}),\n })\n }\n if (input.apiKeyEnv !== undefined) {\n rows.push({\n field: \"model.main.apiKeyEnv\",\n variable: input.apiKeyEnv,\n origin: sourceOf(input.manifestPath, input.apiKeyEnv, input.options ?? {}),\n })\n }\n return rows\n}\n\n/**\n * The variable name when a value is exactly one `${VAR}` reference, and nothing otherwise.\n *\n * Deliberately narrow. `prefix-${VAR}` expands from the environment too, but its provenance is a\n * sentence about part of a string, and a half-true note on a compound value is the kind of detail\n * that gets believed whole.\n */\nfunction soleVariable(raw: string | undefined): string | undefined {\n if (raw === undefined) return undefined\n const match = /^\\$\\{([A-Za-z_][A-Za-z0-9_]*)\\}$/.exec(raw.trim())\n return match?.[1]\n}\n"
6
6
  ],
7
7
  "mappings": ";4CAkBA,qBAAS,kBAAY,gBACrB,kBAAS,UAAS,aAAM,kBAKjB,SAAS,EAAQ,CAAC,EAAiC,CACtD,IAAM,EAAO,EAAK,EAAQ,CAAY,EAAG,MAAM,EAC3C,EAAiC,CAAC,EACtC,GAAI,EAAW,CAAI,EACf,GAAI,CACA,EAAS,GAAY,EAAa,EAAM,MAAM,CAAC,EACjD,KAAM,EAMZ,OAAO,GAAW,EAAQ,EAAW,CAAC,CAAY,CAAC,CAAC,EAIjD,SAAS,EAAK,CAAC,EAAgB,EAAuB,CACzD,IAAM,EAAQ,EAAI,GAClB,OAAO,IAAU,QAAa,IAAU,GA4CrC,SAAS,CAAQ,CACpB,EACA,EACA,EAA0B,CAAC,EAClB,CACT,IAAM,EAAW,EAAQ,CAAY,EAC/B,EAAM,EAAQ,EAAQ,KAAO,QAAQ,IAAI,CAAC,EAC1C,EAAO,EAAQ,SAAW,GAC1B,EAAM,EAAQ,KAAO,QAAQ,IAE7B,EAAU,EAAW,CAAC,CAAY,EAAG,CAAO,EAC5C,EAAS,EAAK,CAAQ,EACtB,EAAQ,EAAK,CAAG,EAEhB,EAAc,EAAQ,GAC5B,GAAI,IAAgB,QAAa,IAAgB,GAAI,CAGjD,IAAM,EAAU,EAAQ,CAAQ,IAAM,EAChC,EAAW,EAAM,GACvB,GAAI,CAAC,GAAW,IAAa,QAAa,EAAI,KAAU,EACpD,MAAO,CAAE,KAAM,YAAa,KAAM,EAAK,EAAK,MAAM,CAAE,EAExD,MAAO,CAAE,KAAM,QAAS,EAG5B,IAAM,EAAW,EAAO,GACxB,GAAI,IAAa,QAAa,IAAa,GACvC,MAAO,CAAE,KAAM,QAAS,KAAM,EAAK,EAAU,MAAM,CAAE,EAGzD,MAAO,CAAE,KAAM,OAAQ,EAUpB,SAAS,EAAc,CAAC,EAAuC,CAClE,OAAQ,EAAO,UACN,SACD,MAAO,4CACN,YACD,MAAO,yDACN,QACD,WACC,QACD,MAAO,WA0BZ,SAAS,EAAa,CAAC,EAMJ,CACtB,IAAM,EAAqB,CAAC,EACtB,EAAW,EAAa,EAAM,UAAU,EAC9C,GAAI,IAAa,OACb,EAAK,KAAK,CACN,MAAO,gBACP,WACA,OAAQ,EAAS,EAAM,aAAc,EAAU,EAAM,SAAW,CAAC,CAAC,CACtE,CAAC,EAEL,GAAI,EAAM,YAAc,OACpB,EAAK,KAAK,CACN,MAAO,uBACP,SAAU,EAAM,UAChB,OAAQ,EAAS,EAAM,aAAc,EAAM,UAAW,EAAM,SAAW,CAAC,CAAC,CAC7E,CAAC,EAEL,OAAO,EAUX,SAAS,CAAY,CAAC,EAA6C,CAC/D,GAAI,IAAQ,OAAW,OAEvB,MADc,mCAAmC,KAAK,EAAI,KAAK,CAAC,IACjD",
8
- "debugId": "09DE6EA43B9B21E464756E2164756E21",
8
+ "debugId": "9183F965CECEE18364756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import{B,S,bA,k,Wo}from"./index-cz6yjxyz.js";import{ce}from"./index-cb2q8nae.js";import{g}from"./index-92gfcbw0.js";var r=g(S(),1);var t=r.default("music-metadata:parser:ID3");class Ve extends k{constructor(){super(...arguments);this.id3parser=new ce}static async startsWithID3v2Header(e){return(await e.peekToken(bA)).fileIdentifier==="ID3"}async parse(){try{await this.parseID3v2()}catch(e){if(e instanceof B)t("End-of-stream");else throw e}}finalize(){return}async parseID3v2(){if(await this.tryReadId3v2Headers(),t("End of ID3v2 header, go to MPEG-parser: pos=%s",this.tokenizer.position),await this.postId3v2Parse(),this.options.skipPostHeaders&&this.metadata.hasAny())this.finalize();else await new Wo(this.metadata,this.tokenizer,this.options).parse(),this.finalize()}async tryReadId3v2Headers(){if((await this.tokenizer.peekToken(bA)).fileIdentifier==="ID3")return t("Found ID3v2 header, pos=%s",this.tokenizer.position),await this.id3parser.parse(this.metadata,this.tokenizer,this.options),this.tryReadId3v2Headers()}}
3
+ export{Ve};
4
+
5
+ //# debugId=31A66690B37F196764756E2164756E21
6
+ //# sourceMappingURL=index-esq0knqx.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../node_modules/.bun/music-metadata@11.15.0/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js"],
4
+ "sourcesContent": [
5
+ "import { EndOfStreamError } from 'strtok3';\nimport initDebug from 'debug';\nimport { ID3v2Header } from './ID3v2Token.js';\nimport { ID3v2Parser } from './ID3v2Parser.js';\nimport { ID3v1Parser } from '../id3v1/ID3v1Parser.js';\nimport { BasicParser } from '../common/BasicParser.js';\nconst debug = initDebug('music-metadata:parser:ID3');\n/**\n * Abstract parser which tries take ID3v2 and ID3v1 headers.\n */\nexport class AbstractID3Parser extends BasicParser {\n constructor() {\n super(...arguments);\n this.id3parser = new ID3v2Parser();\n }\n static async startsWithID3v2Header(tokenizer) {\n return (await tokenizer.peekToken(ID3v2Header)).fileIdentifier === 'ID3';\n }\n async parse() {\n try {\n await this.parseID3v2();\n }\n catch (err) {\n if (err instanceof EndOfStreamError) {\n debug(\"End-of-stream\");\n }\n else {\n throw err;\n }\n }\n }\n finalize() {\n return;\n }\n async parseID3v2() {\n await this.tryReadId3v2Headers();\n debug('End of ID3v2 header, go to MPEG-parser: pos=%s', this.tokenizer.position);\n await this.postId3v2Parse();\n if (this.options.skipPostHeaders && this.metadata.hasAny()) {\n this.finalize();\n }\n else {\n const id3v1parser = new ID3v1Parser(this.metadata, this.tokenizer, this.options);\n await id3v1parser.parse();\n this.finalize();\n }\n }\n async tryReadId3v2Headers() {\n const id3Header = await this.tokenizer.peekToken(ID3v2Header);\n if (id3Header.fileIdentifier === 'ID3') {\n debug('Found ID3v2 header, pos=%s', this.tokenizer.position);\n await this.id3parser.parse(this.metadata, this.tokenizer, this.options);\n return this.tryReadId3v2Headers();\n }\n }\n}\n"
6
+ ],
7
+ "mappings": ";oHACA,eAKA,IAAM,EAAQ,UAAU,2BAA2B,EAI5C,MAAM,WAA0B,CAAY,CAC/C,WAAW,EAAG,CACV,MAAM,GAAG,SAAS,EAClB,KAAK,UAAY,IAAI,eAEZ,sBAAqB,CAAC,EAAW,CAC1C,OAAQ,MAAM,EAAU,UAAU,EAAW,GAAG,iBAAmB,WAEjE,MAAK,EAAG,CACV,GAAI,CACA,MAAM,KAAK,WAAW,EAE1B,MAAO,EAAK,CACR,GAAI,aAAe,EACf,EAAM,eAAe,EAGrB,WAAM,GAIlB,QAAQ,EAAG,CACP,YAEE,WAAU,EAAG,CAIf,GAHA,MAAM,KAAK,oBAAoB,EAC/B,EAAM,iDAAkD,KAAK,UAAU,QAAQ,EAC/E,MAAM,KAAK,eAAe,EACtB,KAAK,QAAQ,iBAAmB,KAAK,SAAS,OAAO,EACrD,KAAK,SAAS,EAId,WADoB,IAAI,GAAY,KAAK,SAAU,KAAK,UAAW,KAAK,OAAO,EAC7D,MAAM,EACxB,KAAK,SAAS,OAGhB,oBAAmB,EAAG,CAExB,IADkB,MAAM,KAAK,UAAU,UAAU,EAAW,GAC9C,iBAAmB,MAG7B,OAFA,EAAM,6BAA8B,KAAK,UAAU,QAAQ,EAC3D,MAAM,KAAK,UAAU,MAAM,KAAK,SAAU,KAAK,UAAW,KAAK,OAAO,EAC/D,KAAK,oBAAoB,EAG5C",
8
+ "debugId": "31A66690B37F196764756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ function i(e){if(e<1000)return String(e);let n=e/1000;return n<10?`${n.toFixed(1)}k`:`${Math.round(n)}k`}function Vr(e,n,r){if(r)return"installed";let t=i(e);return n===0?t:`${t} · ${n} script${n===1?"":"s"}`}function U(e,n){if(n<=0)return"";let r=e.replace(/\s+/g," ").trim();if(r.length<=n)return r;if(n===1)return"…";return`${r.slice(0,n-1)}…`}function Yn(e,n,r={}){let t=Math.max(18,Math.min(r.nameMax??34,n)),o=18,a=6;if(a+t+o>e)o=Math.max(6,e-a-t);if(a+t+o>e)t=Math.max(6,e-a-o);let m=e-(a+t+o+2);if(e<60||m<24)return{name:t,meta:o,description:0};return{name:t,meta:o,description:m}}function Jn(e,n){return{name:U(e.name,n.name).padEnd(n.name),meta:U(e.meta,n.meta).padEnd(n.meta),description:n.description===0?"":U(e.description,n.description)}}function jn(e,n){let r=U(e,Math.max(0,n-8)),t=r.length+3;return`${r} ${"─".repeat(Math.max(0,Math.min(n,80)-t))}`}function te(e,n,r){if(e<=r)return{from:0,to:e};let t=Math.floor(r/2),o=Math.min(Math.max(0,n-t),e-r);return{from:o,to:o+r}}
3
+ export{Vr,U,Yn,Jn,jn,te};
4
+
5
+ //# debugId=3A58E0B750218CFB64756E2164756E21
6
+ //# sourceMappingURL=index-featyhps.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/lib/rows.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * Laying a catalogue row out in a fixed number of columns. Pure, so the layout is testable as strings.\n *\n * ## Why this is not a component's problem\n *\n * The first version put the name, the size and the whole description in one `<Text>` and let Ink wrap.\n * Every row longer than the terminal became two or three lines, the checkbox column stopped lining up,\n * and a list of forty skills was unreadable. Wrapping is not a styling detail in a list — it destroys the\n * one property a list has, which is that a row is a row.\n *\n * So the width arithmetic lives here, in one place, as functions over numbers and strings: pad the name to\n * a column, pad the meta to a column, give the description whatever is left, and **truncate every field\n * before it can wrap**. `Text` also carries `wrap=\"truncate\"` as a backstop, but a backstop is not a\n * layout — the columns have to add up, or the description gets cut at a width nobody chose.\n */\n\n/** Terminal columns below which the description is dropped rather than shown as three characters. */\nconst NARROW = 60\n/** The name column, wide enough for `create-architectural-decision-record` to be recognisable. */\nconst NAME_MIN = 18\nconst NAME_MAX = 34\n/** `12.3k · 15 scripts` is the widest realistic meta string. */\nconst META = 18\n/** Checkbox plus pointer, both two characters. */\nconst GUTTER = 4\nconst GAP = 2\n\n/** `2284` → `2.3k`. A row is scanned, not audited, and five digits of precision cost a column. */\nexport function compactTokens(tokens: number): string {\n if (tokens < 1000) return String(tokens)\n const thousands = tokens / 1000\n return thousands < 10 ? `${thousands.toFixed(1)}k` : `${Math.round(thousands)}k`\n}\n\nexport function metaOf(tokens: number, scripts: number, installed: boolean): string {\n if (installed) return \"installed\"\n const size = compactTokens(tokens)\n return scripts === 0 ? size : `${size} · ${scripts} script${scripts === 1 ? \"\" : \"s\"}`\n}\n\n/** Cut to `width`, with an ellipsis when anything was lost. Never returns more than `width`. */\nexport function clip(text: string, width: number): string {\n if (width <= 0) return \"\"\n const flat = text.replace(/\\s+/g, \" \").trim()\n if (flat.length <= width) return flat\n if (width === 1) return \"…\"\n return `${flat.slice(0, width - 1)}…`\n}\n\nexport interface RowColumns {\n readonly name: number\n readonly meta: number\n readonly description: number\n}\n\n/**\n * How wide each column is at a given terminal width.\n *\n * The name column flexes with the longest name actually present rather than being fixed: a catalogue of\n * short names should not leave a third of the row empty, and one long name should not push the\n * description off the screen. Clamped at both ends for both reasons.\n */\nexport function columnsFor(\n width: number,\n longestName: number,\n options: { readonly nameMax?: number } = {},\n): RowColumns {\n // Overridden by the plain path, whose names carry a `source/` prefix and which has no cursor to keep\n // near them. Passing a wider name column *without* going through this function is what pushed every\n // piped row twelve characters over the width it was laid out for.\n let name = Math.max(NAME_MIN, Math.min(options.nameMax ?? NAME_MAX, longestName))\n let meta = META\n\n // The name and meta columns shrink before anything else does. Without this the *fixed* part of the row\n // could exceed the terminal on its own — at 40 columns with a 34-character name it came to 60, so every\n // row wrapped no matter what the description did, which is the bug this module exists to remove.\n const chrome = GUTTER + GAP\n if (chrome + name + meta > width) meta = Math.max(6, width - chrome - name)\n if (chrome + name + meta > width) name = Math.max(6, width - chrome - meta)\n\n const description = width - (chrome + name + meta + GAP)\n // Below the threshold the description is dropped entirely. Three characters of a sentence is worse than\n // none: it takes the same column and carries no information.\n if (width < NARROW || description < 24) return { name, meta, description: 0 }\n return { name, meta, description }\n}\n\n/**\n * One row, exactly `width` characters wide or less, in three aligned columns.\n *\n * Returned as one string rather than as fields, because alignment is the whole point and a caller that\n * assembled the parts could get the padding wrong. Colour is applied by the component *around* this — the\n * arithmetic must not know about escape codes, which do not occupy columns and would break every count.\n */\nexport function layoutRow(\n input: {\n readonly name: string\n readonly meta: string\n readonly description: string\n },\n columns: RowColumns,\n): { readonly name: string; readonly meta: string; readonly description: string } {\n return {\n name: clip(input.name, columns.name).padEnd(columns.name),\n meta: clip(input.meta, columns.meta).padEnd(columns.meta),\n description: columns.description === 0 ? \"\" : clip(input.description, columns.description),\n }\n}\n\n/** A heading, drawn as a rule so groups separate without costing a blank line each. */\nexport function headingRule(label: string, width: number): string {\n const text = clip(label, Math.max(0, width - 8))\n const filled = text.length + 3\n return `${text} ${\"─\".repeat(Math.max(0, Math.min(width, 80) - filled))}`\n}\n\n/**\n * Which slice of a longer list to show.\n *\n * Shared by the catalogue list and the input box, which want the same rule for the same reason: both\n * are taller than their allowance and both have a position that must stay visible. It lives here rather\n * than in either component because the second caller is what proved it was layout arithmetic and not a\n * detail of one screen.\n *\n * Originally: Keeps the cursor inside the window rather than paging, because a cursor that jumps a\n * whole viewport loses the reader's place.\n */\nexport function viewport(\n total: number,\n index: number,\n window: number,\n): { readonly from: number; readonly to: number } {\n if (total <= window) return { from: 0, to: total }\n const half = Math.floor(window / 2)\n const from = Math.min(Math.max(0, index - half), total - window)\n return { from, to: from + window }\n}\n"
6
+ ],
7
+ "mappings": ";AA4BO,SAAS,CAAa,CAAC,EAAwB,CAClD,GAAI,EAAS,KAAM,OAAO,OAAO,CAAM,EACvC,IAAM,EAAY,EAAS,KAC3B,OAAO,EAAY,GAAK,GAAG,EAAU,QAAQ,CAAC,KAAO,GAAG,KAAK,MAAM,CAAS,KAGzE,SAAS,EAAM,CAAC,EAAgB,EAAiB,EAA4B,CAChF,GAAI,EAAW,MAAO,YACtB,IAAM,EAAO,EAAc,CAAM,EACjC,OAAO,IAAY,EAAI,EAAO,GAAG,OAAU,WAAiB,IAAY,EAAI,GAAK,MAI9E,SAAS,CAAI,CAAC,EAAc,EAAuB,CACtD,GAAI,GAAS,EAAG,MAAO,GACvB,IAAM,EAAO,EAAK,QAAQ,OAAQ,GAAG,EAAE,KAAK,EAC5C,GAAI,EAAK,QAAU,EAAO,OAAO,EACjC,GAAI,IAAU,EAAG,MAAO,IACxB,MAAO,GAAG,EAAK,MAAM,EAAG,EAAQ,CAAC,KAgB9B,SAAS,EAAU,CACtB,EACA,EACA,EAAyC,CAAC,EAChC,CAIV,IAAI,EAAO,KAAK,IAnDH,GAmDiB,KAAK,IAAI,EAAQ,SAlDlC,GAkDuD,CAAW,CAAC,EAC5E,EAjDK,GAsDH,EAAS,EACf,GAAI,EAAS,EAAO,EAAO,EAAO,EAAO,KAAK,IAAI,EAAG,EAAQ,EAAS,CAAI,EAC1E,GAAI,EAAS,EAAO,EAAO,EAAO,EAAO,KAAK,IAAI,EAAG,EAAQ,EAAS,CAAI,EAE1E,IAAM,EAAc,GAAS,EAAS,EAAO,EAvDrC,GA0DR,GAAI,EAlEO,IAkEW,EAAc,GAAI,MAAO,CAAE,OAAM,OAAM,YAAa,CAAE,EAC5E,MAAO,CAAE,OAAM,OAAM,aAAY,EAU9B,SAAS,EAAS,CACrB,EAKA,EAC8E,CAC9E,MAAO,CACH,KAAM,EAAK,EAAM,KAAM,EAAQ,IAAI,EAAE,OAAO,EAAQ,IAAI,EACxD,KAAM,EAAK,EAAM,KAAM,EAAQ,IAAI,EAAE,OAAO,EAAQ,IAAI,EACxD,YAAa,EAAQ,cAAgB,EAAI,GAAK,EAAK,EAAM,YAAa,EAAQ,WAAW,CAC7F,EAIG,SAAS,EAAW,CAAC,EAAe,EAAuB,CAC9D,IAAM,EAAO,EAAK,EAAO,KAAK,IAAI,EAAG,EAAQ,CAAC,CAAC,EACzC,EAAS,EAAK,OAAS,EAC7B,MAAO,GAAG,KAAQ,IAAI,OAAO,KAAK,IAAI,EAAG,KAAK,IAAI,EAAO,EAAE,EAAI,CAAM,CAAC,IAcnE,SAAS,EAAQ,CACpB,EACA,EACA,EAC8C,CAC9C,GAAI,GAAS,EAAQ,MAAO,CAAE,KAAM,EAAG,GAAI,CAAM,EACjD,IAAM,EAAO,KAAK,MAAM,EAAS,CAAC,EAC5B,EAAO,KAAK,IAAI,KAAK,IAAI,EAAG,EAAQ,CAAI,EAAG,EAAQ,CAAM,EAC/D,MAAO,CAAE,OAAM,GAAI,EAAO,CAAO",
8
+ "debugId": "3A58E0B750218CFB64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env node
2
+ import{g,e,u}from"./index-92gfcbw0.js";var Ir=e(function(Ff,Rr){var Pr=()=>process.platform==="linux",xe=null,Fn=()=>{if(!xe)if(Pr()&&process.report){let r=process.report.excludeNetwork;process.report.excludeNetwork=!0,xe=process.report.getReport(),process.report.excludeNetwork=r}else xe={};return xe};Rr.exports={isLinux:Pr,getReport:Fn}});var Ar=e(function(Df,jr){var ie=u("fs"),Dn=(r)=>{let t=ie.openSync(r,"r"),n=Buffer.alloc(2048),s=ie.readSync(t,n,0,2048,0);return ie.close(t,()=>{}),n.subarray(0,s)},On=(r)=>new Promise((t,n)=>{ie.open(r,"r",(s,a)=>{if(s)n(s);else{let o=Buffer.alloc(2048);ie.read(a,o,0,2048,0,(l,c)=>{t(o.subarray(0,c)),ie.close(a,()=>{})})}})});jr.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:Dn,readFile:On}});var Sr=e(function(Of,kr){var Gn=(r)=>{if(r.length<64)return null;if(r.readUInt32BE(0)!==2135247942)return null;if(r.readUInt8(4)!==2)return null;if(r.readUInt8(5)!==1)return null;let t=r.readUInt32LE(32),n=r.readUInt16LE(54),s=r.readUInt16LE(56);for(let a=0;a<s;a++){let o=t+a*n;if(r.readUInt32LE(o)===3){let c=r.readUInt32LE(o+8),f=r.readUInt32LE(o+32);return r.subarray(c,c+f).toString().replace(/\0.*$/g,"")}}return null};kr.exports={interpreterPath:Gn}});var Re=e(function(Gf,Wr){var $r=u("child_process"),{isLinux:ne,getReport:Nr}=Ir(),{LDD_PATH:Pe,SELF_PATH:_r,readFile:Ge,readFileSync:ze}=Ar(),{interpreterPath:qr}=Sr(),F,D,O,Q="",Tr=()=>{if(!Q)return new Promise((r)=>{$r.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(t,n)=>{Q=t?" ":n,r(Q)})});return Q},Cr=()=>{if(!Q)try{Q=$r.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(r){Q=" "}return Q},H="glibc",Mr=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,ee="musl",zn=(r)=>r.includes("libc.musl-")||r.includes("ld-musl-"),Br=()=>{let r=Nr();if(r.header&&r.header.glibcVersionRuntime)return H;if(Array.isArray(r.sharedObjects)){if(r.sharedObjects.some(zn))return ee}return null},Fr=(r)=>{let[t,n]=r.split(/[\r\n]+/);if(t&&t.includes(H))return H;if(n&&n.includes(ee))return ee;return null},Dr=(r)=>{if(r){if(r.includes("/ld-musl-"))return ee;else if(r.includes("/ld-linux-"))return H}return null},Or=(r)=>{if(r=r.toString(),r.includes("musl"))return ee;if(r.includes("GNU C Library"))return H;return null},Un=async()=>{if(D!==void 0)return D;D=null;try{let r=await Ge(Pe);D=Or(r)}catch(r){}return D},Hn=()=>{if(D!==void 0)return D;D=null;try{let r=ze(Pe);D=Or(r)}catch(r){}return D},Wn=async()=>{if(F!==void 0)return F;F=null;try{let r=await Ge(_r),t=qr(r);F=Dr(t)}catch(r){}return F},Vn=()=>{if(F!==void 0)return F;F=null;try{let r=ze(_r),t=qr(r);F=Dr(t)}catch(r){}return F},Gr=async()=>{let r=null;if(ne()){if(r=await Wn(),!r){if(r=await Un(),!r)r=Br();if(!r){let t=await Tr();r=Fr(t)}}}return r},zr=()=>{let r=null;if(ne()){if(r=Vn(),!r){if(r=Hn(),!r)r=Br();if(!r){let t=Cr();r=Fr(t)}}}return r},Xn=async()=>ne()&&await Gr()!==H,Qn=()=>ne()&&zr()!==H,Jn=async()=>{if(O!==void 0)return O;O=null;try{let t=(await Ge(Pe)).match(Mr);if(t)O=t[1]}catch(r){}return O},Yn=()=>{if(O!==void 0)return O;O=null;try{let t=ze(Pe).match(Mr);if(t)O=t[1]}catch(r){}return O},Ur=()=>{let r=Nr();if(r.header&&r.header.glibcVersionRuntime)return r.header.glibcVersionRuntime;return null},Lr=(r)=>r.trim().split(/\s+/)[1],Hr=(r)=>{let[t,n,s]=r.split(/[\r\n]+/);if(t&&t.includes(H))return Lr(t);if(n&&s&&n.includes(ee))return Lr(s);return null},Kn=async()=>{let r=null;if(ne()){if(r=await Jn(),!r)r=Ur();if(!r){let t=await Tr();r=Hr(t)}}return r},Zn=()=>{let r=null;if(ne()){if(r=Yn(),!r)r=Ur();if(!r){let t=Cr();r=Hr(t)}}return r};Wr.exports={GLIBC:H,MUSL:ee,family:Gr,familySync:zr,isNonGlibcLinux:Xn,isNonGlibcLinuxSync:Qn,version:Kn,versionSync:Zn}});var se=e(function(zf,Vr){var es=Number.MAX_SAFE_INTEGER||9007199254740991,rs=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Vr.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:es,RELEASE_TYPES:rs,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var de=e(function(Uf,Xr){var ts=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};Xr.exports=ts});var ae=e(function(G,Qr){var{MAX_SAFE_COMPONENT_LENGTH:Ue,MAX_SAFE_BUILD_LENGTH:is,MAX_LENGTH:ns}=se(),ss=de();G=Qr.exports={};var as=G.re=[],os=G.safeRe=[],m=G.src=[],ls=G.safeSrc=[],p=G.t={},cs=0,He="[a-zA-Z0-9-]",fs=[["\\s",1],["\\d",ns],[He,is]],hs=(r)=>{for(let[t,n]of fs)r=r.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return r},E=(r,t,n)=>{let s=hs(t),a=cs++;ss(r,a,t),p[r]=a,m[a]=t,ls[a]=s,as[a]=new RegExp(t,n?"g":void 0),os[a]=new RegExp(s,n?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*");E("NUMERICIDENTIFIERLOOSE","\\d+");E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${He}*`);E("MAINVERSION",`(${m[p.NUMERICIDENTIFIER]})\\.(${m[p.NUMERICIDENTIFIER]})\\.(${m[p.NUMERICIDENTIFIER]})`);E("MAINVERSIONLOOSE",`(${m[p.NUMERICIDENTIFIERLOOSE]})\\.(${m[p.NUMERICIDENTIFIERLOOSE]})\\.(${m[p.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASEIDENTIFIER",`(?:${m[p.NONNUMERICIDENTIFIER]}|${m[p.NUMERICIDENTIFIER]})`);E("PRERELEASEIDENTIFIERLOOSE",`(?:${m[p.NONNUMERICIDENTIFIER]}|${m[p.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASE",`(?:-(${m[p.PRERELEASEIDENTIFIER]}(?:\\.${m[p.PRERELEASEIDENTIFIER]})*))`);E("PRERELEASELOOSE",`(?:-?(${m[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${m[p.PRERELEASEIDENTIFIERLOOSE]})*))`);E("BUILDIDENTIFIER",`${He}+`);E("BUILD",`(?:\\+(${m[p.BUILDIDENTIFIER]}(?:\\.${m[p.BUILDIDENTIFIER]})*))`);E("FULLPLAIN",`v?${m[p.MAINVERSION]}${m[p.PRERELEASE]}?${m[p.BUILD]}?`);E("FULL",`^${m[p.FULLPLAIN]}$`);E("LOOSEPLAIN",`[v=\\s]*${m[p.MAINVERSIONLOOSE]}${m[p.PRERELEASELOOSE]}?${m[p.BUILD]}?`);E("LOOSE",`^${m[p.LOOSEPLAIN]}$`);E("GTLT","((?:<|>)?=?)");E("XRANGEIDENTIFIERLOOSE",`${m[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);E("XRANGEIDENTIFIER",`${m[p.NUMERICIDENTIFIER]}|x|X|\\*`);E("XRANGEPLAIN",`[v=\\s]*(${m[p.XRANGEIDENTIFIER]})(?:\\.(${m[p.XRANGEIDENTIFIER]})(?:\\.(${m[p.XRANGEIDENTIFIER]})(?:${m[p.PRERELEASE]})?${m[p.BUILD]}?)?)?`);E("XRANGEPLAINLOOSE",`[v=\\s]*(${m[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${m[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${m[p.XRANGEIDENTIFIERLOOSE]})(?:${m[p.PRERELEASELOOSE]})?${m[p.BUILD]}?)?)?`);E("XRANGE",`^${m[p.GTLT]}\\s*${m[p.XRANGEPLAIN]}$`);E("XRANGELOOSE",`^${m[p.GTLT]}\\s*${m[p.XRANGEPLAINLOOSE]}$`);E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Ue}})(?:\\.(\\d{1,${Ue}}))?(?:\\.(\\d{1,${Ue}}))?`);E("COERCE",`${m[p.COERCEPLAIN]}(?:$|[^\\d])`);E("COERCEFULL",m[p.COERCEPLAIN]+`(?:${m[p.PRERELEASE]})?(?:${m[p.BUILD]})?(?:$|[^\\d])`);E("COERCERTL",m[p.COERCE],!0);E("COERCERTLFULL",m[p.COERCEFULL],!0);E("LONETILDE","(?:~>?)");E("TILDETRIM",`(\\s*)${m[p.LONETILDE]}\\s+`,!0);G.tildeTrimReplace="$1~";E("TILDE",`^${m[p.LONETILDE]}${m[p.XRANGEPLAIN]}$`);E("TILDELOOSE",`^${m[p.LONETILDE]}${m[p.XRANGEPLAINLOOSE]}$`);E("LONECARET","(?:\\^)");E("CARETTRIM",`(\\s*)${m[p.LONECARET]}\\s+`,!0);G.caretTrimReplace="$1^";E("CARET",`^${m[p.LONECARET]}${m[p.XRANGEPLAIN]}$`);E("CARETLOOSE",`^${m[p.LONECARET]}${m[p.XRANGEPLAINLOOSE]}$`);E("COMPARATORLOOSE",`^${m[p.GTLT]}\\s*(${m[p.LOOSEPLAIN]})$|^$`);E("COMPARATOR",`^${m[p.GTLT]}\\s*(${m[p.FULLPLAIN]})$|^$`);E("COMPARATORTRIM",`(\\s*)${m[p.GTLT]}\\s*(${m[p.LOOSEPLAIN]}|${m[p.XRANGEPLAIN]})`,!0);G.comparatorTrimReplace="$1$2$3";E("HYPHENRANGE",`^\\s*(${m[p.XRANGEPLAIN]})\\s+-\\s+(${m[p.XRANGEPLAIN]})\\s*$`);E("HYPHENRANGELOOSE",`^\\s*(${m[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${m[p.XRANGEPLAINLOOSE]})\\s*$`);E("STAR","(<|>)?=?\\s*\\*");E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ie=e(function(Hf,Jr){var us=Object.freeze({loose:!0}),ds=Object.freeze({}),ms=(r)=>{if(!r)return ds;if(typeof r!=="object")return us;return r};Jr.exports=ms});var We=e(function(Wf,Zr){var Yr=/^[0-9]+$/,Kr=(r,t)=>{if(typeof r==="number"&&typeof t==="number")return r===t?0:r<t?-1:1;let n=Yr.test(r),s=Yr.test(t);if(n&&s)r=+r,t=+t;return r===t?0:n&&!s?-1:s&&!n?1:r<t?-1:1},gs=(r,t)=>Kr(t,r);Zr.exports={compareIdentifiers:Kr,rcompareIdentifiers:gs}});var L=e(function(Vf,rt){var je=de(),{MAX_LENGTH:et,MAX_SAFE_INTEGER:Ae}=se(),{safeRe:ke,t:Se}=ae(),ps=Ie(),{compareIdentifiers:Ve}=We(),bs=(r,t)=>{let n=t.split(".");if(n.length>r.length)return!1;for(let s=0;s<n.length;s++)if(Ve(r[s],n[s])!==0)return!1;return!0};class B{constructor(r,t){if(t=ps(t),r instanceof B)if(r.loose===!!t.loose&&r.includePrerelease===!!t.includePrerelease)return r;else r=r.version;else if(typeof r!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof r}".`);if(r.length>et)throw TypeError(`version is longer than ${et} characters`);je("SemVer",r,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=r.trim().match(t.loose?ke[Se.LOOSE]:ke[Se.FULL]);if(!n)throw TypeError(`Invalid Version: ${r}`);if(this.raw=r,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ae||this.major<0)throw TypeError("Invalid major version");if(this.minor>Ae||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Ae||this.patch<0)throw TypeError("Invalid patch version");if(!n[4])this.prerelease=[];else this.prerelease=n[4].split(".").map((s)=>{if(/^[0-9]+$/.test(s)){let a=+s;if(a>=0&&a<Ae)return a}return s});this.build=n[5]?n[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(r){if(je("SemVer.compare",this.version,this.options,r),!(r instanceof B)){if(typeof r==="string"&&r===this.version)return 0;r=new B(r,this.options)}if(r.version===this.version)return 0;return this.compareMain(r)||this.comparePre(r)}compareMain(r){if(!(r instanceof B))r=new B(r,this.options);if(this.major<r.major)return-1;if(this.major>r.major)return 1;if(this.minor<r.minor)return-1;if(this.minor>r.minor)return 1;if(this.patch<r.patch)return-1;if(this.patch>r.patch)return 1;return 0}comparePre(r){if(!(r instanceof B))r=new B(r,this.options);if(this.prerelease.length&&!r.prerelease.length)return-1;else if(!this.prerelease.length&&r.prerelease.length)return 1;else if(!this.prerelease.length&&!r.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],s=r.prerelease[t];if(je("prerelease compare",t,n,s),n===void 0&&s===void 0)return 0;else if(s===void 0)return 1;else if(n===void 0)return-1;else if(n===s)continue;else return Ve(n,s)}while(++t)}compareBuild(r){if(!(r instanceof B))r=new B(r,this.options);let t=0;do{let n=this.build[t],s=r.build[t];if(je("build compare",t,n,s),n===void 0&&s===void 0)return 0;else if(s===void 0)return 1;else if(n===void 0)return-1;else if(n===s)continue;else return Ve(n,s)}while(++t)}inc(r,t,n){if(r.startsWith("pre")){if(!t&&n===!1)throw Error("invalid increment argument: identifier is empty");if(t){let s=`-${t}`.match(this.options.loose?ke[Se.PRERELEASELOOSE]:ke[Se.PRERELEASE]);if(!s||s[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(r){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,n);this.inc("pre",t,n);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let s=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let a=this.prerelease.length;while(--a>=0)if(typeof this.prerelease[a]==="number")this.prerelease[a]++,a=-2;if(a===-1){if(t===this.prerelease.join(".")&&n===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(t){let a=[t,s];if(n===!1)a=[t];if(bs(this.prerelease,t)){let o=this.prerelease[t.split(".").length];if(isNaN(o))this.prerelease=a}else this.prerelease=a}break}default:throw Error(`invalid increment argument: ${r}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}rt.exports=B});var J=e(function(Xf,it){var tt=L(),ws=(r,t,n=!1)=>{if(r instanceof tt)return r;try{return new tt(r,t)}catch(s){if(!n)return null;throw s}};it.exports=ws});var st=e(function(Qf,nt){var vs=J(),Es=(r,t)=>{let n=vs(r,t);return n?n.version:null};nt.exports=Es});var ot=e(function(Jf,at){var ys=J(),xs=(r,t)=>{let n=ys(r.trim().replace(/^[=v]+/,""),t);return n?n.version:null};at.exports=xs});var ft=e(function(Yf,ct){var lt=L(),Ps=(r,t,n,s,a)=>{if(typeof n==="string")a=s,s=n,n=void 0;try{return new lt(r instanceof lt?r.version:r,n).inc(t,s,a).version}catch(o){return null}};ct.exports=Ps});var dt=e(function(Kf,ut){var ht=J(),Rs=(r,t)=>{let n=ht(r,null,!0),s=ht(t,null,!0),a=n.compare(s);if(a===0)return null;let o=a>0,l=o?n:s,c=o?s:n,f=!!l.prerelease.length;if(!!c.prerelease.length&&!f){if(!c.patch&&!c.minor)return"major";if(c.compareMain(l)===0){if(c.minor&&!c.patch)return"minor";return"patch"}}let b=f?"pre":"";if(n.major!==s.major)return b+"major";if(n.minor!==s.minor)return b+"minor";if(n.patch!==s.patch)return b+"patch";return"prerelease"};ut.exports=Rs});var gt=e(function(Zf,mt){var Is=L(),js=(r,t)=>new Is(r,t).major;mt.exports=js});var bt=e(function(eh,pt){var As=L(),ks=(r,t)=>new As(r,t).minor;pt.exports=ks});var vt=e(function(rh,wt){var Ss=L(),Ls=(r,t)=>new Ss(r,t).patch;wt.exports=Ls});var yt=e(function(th,Et){var $s=J(),Ns=(r,t)=>{let n=$s(r,t);return n&&n.prerelease.length?n.prerelease:null};Et.exports=Ns});var C=e(function(ih,Pt){var xt=L(),_s=(r,t,n)=>new xt(r,n).compare(new xt(t,n));Pt.exports=_s});var It=e(function(nh,Rt){var qs=C(),Ts=(r,t,n)=>qs(t,r,n);Rt.exports=Ts});var At=e(function(sh,jt){var Cs=C(),Ms=(r,t)=>Cs(r,t,!0);jt.exports=Ms});var Le=e(function(ah,St){var kt=L(),Bs=(r,t,n)=>{let s=new kt(r,n),a=new kt(t,n);return s.compare(a)||s.compareBuild(a)};St.exports=Bs});var $t=e(function(oh,Lt){var Fs=Le(),Ds=(r,t)=>r.sort((n,s)=>Fs(n,s,t));Lt.exports=Ds});var _t=e(function(lh,Nt){var Os=Le(),Gs=(r,t)=>r.sort((n,s)=>Os(s,n,t));Nt.exports=Gs});var me=e(function(ch,qt){var zs=C(),Us=(r,t,n)=>zs(r,t,n)>0;qt.exports=Us});var $e=e(function(fh,Tt){var Hs=C(),Ws=(r,t,n)=>Hs(r,t,n)<0;Tt.exports=Ws});var Xe=e(function(hh,Ct){var Vs=C(),Xs=(r,t,n)=>Vs(r,t,n)===0;Ct.exports=Xs});var Qe=e(function(uh,Mt){var Qs=C(),Js=(r,t,n)=>Qs(r,t,n)!==0;Mt.exports=Js});var Ne=e(function(dh,Bt){var Ys=C(),Ks=(r,t,n)=>Ys(r,t,n)>=0;Bt.exports=Ks});var _e=e(function(mh,Ft){var Zs=C(),ea=(r,t,n)=>Zs(r,t,n)<=0;Ft.exports=ea});var Je=e(function(gh,Dt){var ra=Xe(),ta=Qe(),ia=me(),na=Ne(),sa=$e(),aa=_e(),oa=(r,t,n,s)=>{switch(t){case"===":if(typeof r==="object")r=r.version;if(typeof n==="object")n=n.version;return r===n;case"!==":if(typeof r==="object")r=r.version;if(typeof n==="object")n=n.version;return r!==n;case"":case"=":case"==":return ra(r,n,s);case"!=":return ta(r,n,s);case">":return ia(r,n,s);case">=":return na(r,n,s);case"<":return sa(r,n,s);case"<=":return aa(r,n,s);default:throw TypeError(`Invalid operator: ${t}`)}};Dt.exports=oa});var Gt=e(function(ph,Ot){var la=L(),ca=J(),{safeRe:qe,t:Te}=ae(),fa=(r,t)=>{if(r instanceof la)return r;if(typeof r==="number")r=String(r);if(typeof r!=="string")return null;t=t||{};let n=null;if(!t.rtl)n=r.match(t.includePrerelease?qe[Te.COERCEFULL]:qe[Te.COERCE]);else{let f=t.includePrerelease?qe[Te.COERCERTLFULL]:qe[Te.COERCERTL],h;while((h=f.exec(r))&&(!n||n.index+n[0].length!==r.length)){if(!n||h.index+h[0].length!==n.index+n[0].length)n=h;f.lastIndex=h.index+h[1].length+h[2].length}f.lastIndex=-1}if(n===null)return null;let s=n[2],a=n[3]||"0",o=n[4]||"0",l=t.includePrerelease&&n[5]?`-${n[5]}`:"",c=t.includePrerelease&&n[6]?`+${n[6]}`:"";return ca(`${s}.${a}.${o}${l}${c}`,t)};Ot.exports=fa});var Ut=e(function(bh,zt){var ha=J(),ua=se(),da=L(),ma=(r,t,n)=>{if(!ua.RELEASE_TYPES.includes(t))return null;let s=ga(r,n);return s&&pa(s,t)},ga=(r,t)=>{let n=r instanceof da?r.version:r;return ha(n,t)},pa=(r,t)=>{if(ba(t))return r.version;switch(r.prerelease=[],t){case"major":r.minor=0,r.patch=0;break;case"minor":r.patch=0;break}return r.format()},ba=(r)=>r.startsWith("pre");zt.exports=ma});var Vt=e(function(wh,Wt){class Ht{constructor(){this.max=1000,this.map=new Map}get(r){let t=this.map.get(r);if(t===void 0)return;else return this.map.delete(r),this.map.set(r,t),t}delete(r){return this.map.delete(r)}set(r,t){if(!this.delete(r)&&t!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(r,t)}return this}}Wt.exports=Ht});var M=e(function(vh,Yt){var wa=/\s+/g;class ge{constructor(r,t){if(t=Ea(t),r instanceof ge)if(r.loose===!!t.loose&&r.includePrerelease===!!t.includePrerelease)return r;else return new ge(r.raw,t);if(r instanceof Ye)return this.raw=r.value,this.set=[[r]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=r.trim().replace(wa," "),this.set=this.raw.split("||").map((n)=>this.parseRange(n.trim())).filter((n)=>n.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter((s)=>!Qt(s[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&Sa(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let r=0;r<this.set.length;r++){if(r>0)this.formatted+="||";let t=this.set[r];for(let n=0;n<t.length;n++){if(n>0)this.formatted+=" ";this.formatted+=t[n].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(r){r=r.replace(ka,"");let n=((this.options.includePrerelease&&ja)|(this.options.loose&&Aa))+":"+r,s=Xt.get(n);if(s)return s;let a=this.options.loose,o=a?_[N.HYPHENRANGELOOSE]:_[N.HYPHENRANGE];r=r.replace(o,Da(this.options.includePrerelease)),P("hyphen replace",r),r=r.replace(_[N.COMPARATORTRIM],Pa),P("comparator trim",r),r=r.replace(_[N.TILDETRIM],Ra),P("tilde trim",r),r=r.replace(_[N.CARETTRIM],Ia),P("caret trim",r);let l=r.split(" ").map((b)=>La(b,this.options)).join(" ").split(/\s+/).map((b)=>Fa(b,this.options));if(a)l=l.filter((b)=>(P("loose invalid filter",b,this.options),!!b.match(_[N.COMPARATORLOOSE])));P("range list",l);let c=new Map,f=l.map((b)=>new Ye(b,this.options));for(let b of f){if(Qt(b))return[b];c.set(b.value,b)}if(c.size>1&&c.has(""))c.delete("");let h=[...c.values()];return Xt.set(n,h),h}intersects(r,t){if(!(r instanceof ge))throw TypeError("a Range is required");return this.set.some((n)=>Jt(n,t)&&r.set.some((s)=>Jt(s,t)&&n.every((a)=>s.every((o)=>a.intersects(o,t)))))}test(r){if(!r)return!1;if(typeof r==="string")try{r=new ya(r,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(Oa(this.set[t],r,this.options))return!0;return!1}}Yt.exports=ge;var va=Vt(),Xt=new va,Ea=Ie(),Ye=pe(),P=de(),ya=L(),{safeRe:_,src:xa,t:N,comparatorTrimReplace:Pa,tildeTrimReplace:Ra,caretTrimReplace:Ia}=ae(),{FLAG_INCLUDE_PRERELEASE:ja,FLAG_LOOSE:Aa}=se(),ka=new RegExp(xa[N.BUILD],"g"),Qt=(r)=>r.value==="<0.0.0-0",Sa=(r)=>r.value==="",Jt=(r,t)=>{let n=!0,s=r.slice(),a=s.pop();while(n&&s.length)n=s.every((o)=>a.intersects(o,t)),a=s.pop();return n},La=(r,t)=>(r=r.replace(_[N.BUILD],""),P("comp",r,t),r=qa(r,t),P("caret",r),r=Na(r,t),P("tildes",r),r=Ca(r,t),P("xrange",r),r=Ba(r,t),P("stars",r),r),j=(r)=>!r||r.toLowerCase()==="x"||r==="*",$a=(r,t,n)=>j(r)&&!j(t)||j(t)&&n&&!j(n),Na=(r,t)=>r.trim().split(/\s+/).map((n)=>_a(n,t)).join(" "),_a=(r,t)=>{let n=t.loose?_[N.TILDELOOSE]:_[N.TILDE],s=t.includePrerelease?"-0":"";return r.replace(n,(a,o,l,c,f)=>{P("tilde",r,a,o,l,c,f);let h;if(j(o))h="";else if(j(l))h=`>=${o}.0.0${s} <${+o+1}.0.0-0`;else if(j(c))h=`>=${o}.${l}.0${s} <${o}.${+l+1}.0-0`;else if(f)P("replaceTilde pr",f),h=`>=${o}.${l}.${c}-${f} <${o}.${+l+1}.0-0`;else h=`>=${o}.${l}.${c} <${o}.${+l+1}.0-0`;return P("tilde return",h),h})},qa=(r,t)=>r.trim().split(/\s+/).map((n)=>Ta(n,t)).join(" "),Ta=(r,t)=>{P("caret",r,t);let n=t.loose?_[N.CARETLOOSE]:_[N.CARET],s=t.includePrerelease?"-0":"";return r.replace(n,(a,o,l,c,f)=>{P("caret",r,a,o,l,c,f);let h;if(j(o))h="";else if(j(l))h=`>=${o}.0.0${s} <${+o+1}.0.0-0`;else if(j(c))if(o==="0")h=`>=${o}.${l}.0${s} <${o}.${+l+1}.0-0`;else h=`>=${o}.${l}.0${s} <${+o+1}.0.0-0`;else if(f)if(P("replaceCaret pr",f),o==="0")if(l==="0")h=`>=${o}.${l}.${c}-${f} <${o}.${l}.${+c+1}-0`;else h=`>=${o}.${l}.${c}-${f} <${o}.${+l+1}.0-0`;else h=`>=${o}.${l}.${c}-${f} <${+o+1}.0.0-0`;else if(P("no pr"),o==="0")if(l==="0")h=`>=${o}.${l}.${c} <${o}.${l}.${+c+1}-0`;else h=`>=${o}.${l}.${c} <${o}.${+l+1}.0-0`;else h=`>=${o}.${l}.${c} <${+o+1}.0.0-0`;return P("caret return",h),h})},Ca=(r,t)=>(P("replaceXRanges",r,t),r.split(/\s+/).map((n)=>Ma(n,t)).join(" ")),Ma=(r,t)=>{r=r.trim();let n=t.loose?_[N.XRANGELOOSE]:_[N.XRANGE];return r.replace(n,(s,a,o,l,c,f)=>{if(P("xRange",r,s,a,o,l,c,f),$a(o,l,c))return r;let h=j(o),b=h||j(l),v=b||j(c),R=v;if(a==="="&&R)a="";if(f=t.includePrerelease?"-0":"",h)if(a===">"||a==="<")s="<0.0.0-0";else s="*";else if(a&&R){if(b)l=0;if(c=0,a===">")if(a=">=",b)o=+o+1,l=0,c=0;else l=+l+1,c=0;else if(a==="<=")if(a="<",b)o=+o+1;else l=+l+1;if(a==="<")f="-0";s=`${a+o}.${l}.${c}${f}`}else if(b)s=`>=${o}.0.0${f} <${+o+1}.0.0-0`;else if(v)s=`>=${o}.${l}.0${f} <${o}.${+l+1}.0-0`;return P("xRange return",s),s})},Ba=(r,t)=>(P("replaceStars",r,t),r.trim().replace(_[N.STAR],"")),Fa=(r,t)=>(P("replaceGTE0",r,t),r.trim().replace(_[t.includePrerelease?N.GTE0PRE:N.GTE0],"")),Da=(r)=>(t,n,s,a,o,l,c,f,h,b,v,R)=>{if(j(s))n="";else if(j(a))n=`>=${s}.0.0${r?"-0":""}`;else if(j(o))n=`>=${s}.${a}.0${r?"-0":""}`;else if(l)n=`>=${n}`;else n=`>=${n}${r?"-0":""}`;if(j(h))f="";else if(j(b))f=`<${+h+1}.0.0-0`;else if(j(v))f=`<${h}.${+b+1}.0-0`;else if(R)f=`<=${h}.${b}.${v}-${R}`;else if(r)f=`<${h}.${b}.${+v+1}-0`;else f=`<=${f}`;return`${n} ${f}`.trim()},Oa=(r,t,n)=>{for(let s=0;s<r.length;s++)if(!r[s].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let s=0;s<r.length;s++){if(P(r[s].semver),r[s].semver===Ye.ANY)continue;if(r[s].semver.prerelease.length>0){let a=r[s].semver;if(a.major===t.major&&a.minor===t.minor&&a.patch===t.patch)return!0}}return!1}return!0}});var pe=e(function(Eh,ii){var be=Symbol("SemVer ANY");class Ce{static get ANY(){return be}constructor(r,t){if(t=Kt(t),r instanceof Ce)if(r.loose===!!t.loose)return r;else r=r.value;if(r=r.trim().split(/\s+/).join(" "),Ze("comparator",r,t),this.options=t,this.loose=!!t.loose,this.parse(r),this.semver===be)this.value="";else this.value=this.operator+this.semver.version;Ze("comp",this)}parse(r){let t=this.options.loose?Zt[ei.COMPARATORLOOSE]:Zt[ei.COMPARATOR],n=r.match(t);if(!n)throw TypeError(`Invalid comparator: ${r}`);if(this.operator=n[1]!==void 0?n[1]:"",this.operator==="=")this.operator="";if(!n[2])this.semver=be;else this.semver=new ri(n[2],this.options.loose)}toString(){return this.value}test(r){if(Ze("Comparator.test",r,this.options.loose),this.semver===be||r===be)return!0;if(typeof r==="string")try{r=new ri(r,this.options)}catch(t){return!1}return Ke(r,this.operator,this.semver,this.options)}intersects(r,t){if(!(r instanceof Ce))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new ti(r.value,t).test(this.value)}else if(r.operator===""){if(r.value==="")return!0;return new ti(this.value,t).test(r.semver)}if(t=Kt(t),t.includePrerelease&&(this.value==="<0.0.0-0"||r.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||r.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&r.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&r.operator.startsWith("<"))return!0;if(this.semver.version===r.semver.version&&this.operator.includes("=")&&r.operator.includes("="))return!0;if(Ke(this.semver,"<",r.semver,t)&&this.operator.startsWith(">")&&r.operator.startsWith("<"))return!0;if(Ke(this.semver,">",r.semver,t)&&this.operator.startsWith("<")&&r.operator.startsWith(">"))return!0;return!1}}ii.exports=Ce;var Kt=Ie(),{safeRe:Zt,t:ei}=ae(),Ke=Je(),Ze=de(),ri=L(),ti=M()});var we=e(function(yh,ni){var Ga=M(),za=(r,t,n)=>{try{t=new Ga(t,n)}catch(s){return!1}return t.test(r)};ni.exports=za});var ai=e(function(xh,si){var Ua=M(),Ha=(r,t)=>new Ua(r,t).set.map((n)=>n.map((s)=>s.value).join(" ").trim().split(" "));si.exports=Ha});var li=e(function(Ph,oi){var Wa=L(),Va=M(),Xa=(r,t,n)=>{let s=null,a=null,o=null;try{o=new Va(t,n)}catch(l){return null}return r.forEach((l)=>{if(o.test(l)){if(!s||a.compare(l)===-1)s=l,a=new Wa(s,n)}}),s};oi.exports=Xa});var fi=e(function(Rh,ci){var Qa=L(),Ja=M(),Ya=(r,t,n)=>{let s=null,a=null,o=null;try{o=new Ja(t,n)}catch(l){return null}return r.forEach((l)=>{if(o.test(l)){if(!s||a.compare(l)===1)s=l,a=new Qa(s,n)}}),s};ci.exports=Ya});var di=e(function(Ih,ui){var er=L(),Ka=M(),hi=me(),Za=(r,t)=>{r=new Ka(r,t);let n=new er("0.0.0");if(r.test(n))return n;if(n=new er("0.0.0-0"),r.test(n))return n;n=null;for(let s=0;s<r.set.length;++s){let a=r.set[s],o=null;if(a.forEach((l)=>{let c=new er(l.semver.version);switch(l.operator){case">":if(c.prerelease.length===0)c.patch++;else c.prerelease.push(0);c.raw=c.format();case"":case">=":if(!o||hi(c,o))o=c;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${l.operator}`)}}),o&&(!n||hi(n,o)))n=o}if(n&&r.test(n))return n;return null};ui.exports=Za});var gi=e(function(jh,mi){var eo=M(),ro=(r,t)=>{try{return new eo(r,t).range||"*"}catch(n){return null}};mi.exports=ro});var Me=e(function(Ah,vi){var to=L(),wi=pe(),{ANY:io}=wi,no=M(),so=we(),pi=me(),bi=$e(),ao=_e(),oo=Ne(),lo=(r,t,n,s)=>{r=new to(r,s),t=new no(t,s);let a,o,l,c,f;switch(n){case">":a=pi,o=ao,l=bi,c=">",f=">=";break;case"<":a=bi,o=oo,l=pi,c="<",f="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(so(r,t,s))return!1;for(let h=0;h<t.set.length;++h){let b=t.set[h],v=null,R=null;if(b.forEach((w)=>{if(w.semver===io)w=new wi(">=0.0.0");if(v=v||w,R=R||w,a(w.semver,v.semver,s))v=w;else if(l(w.semver,R.semver,s))R=w}),v.operator===c||v.operator===f)return!1;if((!R.operator||R.operator===c)&&o(r,R.semver))return!1;else if(R.operator===f&&l(r,R.semver))return!1}return!0};vi.exports=lo});var yi=e(function(kh,Ei){var co=Me(),fo=(r,t,n)=>co(r,t,">",n);Ei.exports=fo});var Pi=e(function(Sh,xi){var ho=Me(),uo=(r,t,n)=>ho(r,t,"<",n);xi.exports=uo});var ji=e(function(Lh,Ii){var Ri=M(),mo=(r,t,n)=>(r=new Ri(r,n),t=new Ri(t,n),r.intersects(t,n));Ii.exports=mo});var ki=e(function($h,Ai){var go=we(),po=C();Ai.exports=(r,t,n)=>{let s=[],a=null,o=null,l=r.sort((b,v)=>po(b,v,n));for(let b of l)if(go(b,t,n)){if(o=b,!a)a=b}else{if(o)s.push([a,o]);o=null,a=null}if(a)s.push([a,null]);let c=[];for(let[b,v]of s)if(b===v)c.push(b);else if(!v&&b===l[0])c.push("*");else if(!v)c.push(`>=${b}`);else if(b===l[0])c.push(`<=${v}`);else c.push(`${b} - ${v}`);let f=c.join(" || "),h=typeof t.raw==="string"?t.raw:String(t);return f.length<h.length?f:t}});var qi=e(function(Nh,_i){var Si=M(),ir=pe(),{ANY:rr}=ir,tr=we(),nr=C(),bo=(r,t,n={})=>{if(r===t)return!0;r=new Si(r,n),t=new Si(t,n);let s=!1;e:for(let a of r.set){for(let o of t.set){let l=vo(a,o,n);if(s=s||l!==null,l)continue e}if(s)return!1}return!0},wo=[new ir(">=0.0.0-0")],Li=[new ir(">=0.0.0")],vo=(r,t,n)=>{if(r===t)return!0;if(r.length===1&&r[0].semver===rr)if(t.length===1&&t[0].semver===rr)return!0;else if(n.includePrerelease)r=wo;else r=Li;if(t.length===1&&t[0].semver===rr)if(n.includePrerelease)return!0;else t=Li;let s=new Set,a,o;for(let w of r)if(w.operator===">"||w.operator===">=")a=$i(a,w,n);else if(w.operator==="<"||w.operator==="<=")o=Ni(o,w,n);else s.add(w.semver);if(s.size>1)return null;let l;if(a&&o){if(l=nr(a.semver,o.semver,n),l>0)return null;else if(l===0&&(a.operator!==">="||o.operator!=="<="))return null}for(let w of s){if(a&&!tr(w,String(a),n))return null;if(o&&!tr(w,String(o),n))return null;for(let Rn of t)if(!tr(w,String(Rn),n))return!1;return!0}let c,f,h,b,v=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1,R=a&&!n.includePrerelease&&a.semver.prerelease.length?a.semver:!1;if(v&&v.prerelease.length===1&&o.operator==="<"&&v.prerelease[0]===0)v=!1;for(let w of t){if(b=b||w.operator===">"||w.operator===">=",h=h||w.operator==="<"||w.operator==="<=",a){if(R){if(w.semver.prerelease&&w.semver.prerelease.length&&w.semver.major===R.major&&w.semver.minor===R.minor&&w.semver.patch===R.patch)R=!1}if(w.operator===">"||w.operator===">="){if(c=$i(a,w,n),c===w&&c!==a)return!1}else if(a.operator===">="&&!w.test(a.semver))return!1}if(o){if(v){if(w.semver.prerelease&&w.semver.prerelease.length&&w.semver.major===v.major&&w.semver.minor===v.minor&&w.semver.patch===v.patch)v=!1}if(w.operator==="<"||w.operator==="<="){if(f=Ni(o,w,n),f===w&&f!==o)return!1}else if(o.operator==="<="&&!w.test(o.semver))return!1}if(!w.operator&&(o||a)&&l!==0)return!1}if(a&&h&&!o&&l!==0)return!1;if(o&&b&&!a&&l!==0)return!1;if(R||v)return!1;return!0},$i=(r,t,n)=>{if(!r)return t;let s=nr(r.semver,t.semver,n);return s>0?r:s<0?t:t.operator===">"&&r.operator===">="?t:r},Ni=(r,t,n)=>{if(!r)return t;let s=nr(r.semver,t.semver,n);return s<0?r:s>0?t:t.operator==="<"&&r.operator==="<="?t:r};_i.exports=bo});var Bi=e(function(_h,Mi){var sr=ae(),Ti=se(),Eo=L(),Ci=We(),yo=J(),xo=st(),Po=ot(),Ro=ft(),Io=dt(),jo=gt(),Ao=bt(),ko=vt(),So=yt(),Lo=C(),$o=It(),No=At(),_o=Le(),qo=$t(),To=_t(),Co=me(),Mo=$e(),Bo=Xe(),Fo=Qe(),Do=Ne(),Oo=_e(),Go=Je(),zo=Gt(),Uo=Ut(),Ho=pe(),Wo=M(),Vo=we(),Xo=ai(),Qo=li(),Jo=fi(),Yo=di(),Ko=gi(),Zo=Me(),el=yi(),rl=Pi(),tl=ji(),il=ki(),nl=qi();Mi.exports={parse:yo,valid:xo,clean:Po,inc:Ro,diff:Io,major:jo,minor:Ao,patch:ko,prerelease:So,compare:Lo,rcompare:$o,compareLoose:No,compareBuild:_o,sort:qo,rsort:To,gt:Co,lt:Mo,eq:Bo,neq:Fo,gte:Do,lte:Oo,cmp:Go,coerce:zo,truncate:Uo,Comparator:Ho,Range:Wo,satisfies:Vo,toComparators:Xo,maxSatisfying:Qo,minSatisfying:Jo,minVersion:Yo,validRange:Ko,outside:Zo,gtr:el,ltr:rl,intersects:tl,simplifyRange:il,subset:nl,SemVer:Eo,re:sr.re,src:sr.src,tokens:sr.t,SEMVER_SPEC_VERSION:Ti.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ti.RELEASE_TYPES,compareIdentifiers:Ci.compareIdentifiers,rcompareIdentifiers:Ci.rcompareIdentifiers}});var cn=e(function(nu,ln){var{defineProperty:br,getOwnPropertyDescriptor:mc,getOwnPropertyNames:gc}=Object,pc=Object.prototype.hasOwnProperty,bc=(r,t)=>{for(var n in t)br(r,n,{get:t[n],enumerable:!0})},wc=(r,t,n,s)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let a of gc(t))if(!pc.call(r,a)&&a!==n)br(r,a,{get:()=>t[a],enumerable:!(s=mc(t,a))||s.enumerable})}return r},vc=(r)=>wc(br({},"__esModule",{value:!0}),r),nn={};bc(nn,{default:()=>_c});ln.exports=vc(nn);var dr={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let r in dr)Object.freeze(dr[r]);var U=Object.freeze(dr),sn=Object.create(null);for(let r in U)if(Object.hasOwn(U,r))sn[U[r]]=r;var q={to:{},get:{}};q.get=function(r){let t=r.slice(0,3).toLowerCase(),n,s;switch(t){case"hsl":{n=q.get.hsl(r),s="hsl";break}case"hwb":{n=q.get.hwb(r),s="hwb";break}default:{n=q.get.rgb(r),s="rgb";break}}if(!n)return null;return{model:s,value:n}};q.get.rgb=function(r){if(!r)return null;let t=/^#([a-f\d]{3,4})$/i,n=/^#([a-f\d]{6})([a-f\d]{2})?$/i,s=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,a=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,o=/^(\w+)$/,l=[0,0,0,1],c,f,h;if(c=r.match(n)){h=c[2],c=c[1];for(f=0;f<3;f++){let b=f*2;l[f]=Number.parseInt(c.slice(b,b+2),16)}if(h)l[3]=Number.parseInt(h,16)/255}else if(c=r.match(t)){c=c[1],h=c[3];for(f=0;f<3;f++)l[f]=Number.parseInt(c[f]+c[f],16);if(h)l[3]=Number.parseInt(h+h,16)/255}else if(c=r.match(s)){for(f=0;f<3;f++)l[f]=Number.parseFloat(c[f+1]);if(c[4])l[3]=c[5]?Number.parseFloat(c[4])*0.01:Number.parseFloat(c[4])}else if(c=r.match(a)){for(f=0;f<3;f++)l[f]=Math.round(Number.parseFloat(c[f+1])*2.55);if(c[4])l[3]=c[5]?Number.parseFloat(c[4])*0.01:Number.parseFloat(c[4])}else if(c=r.toLowerCase().match(o)){if(c[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(U,c[1]))return null;return l=U[c[1]].slice(),l[3]=1,l}else return null;for(f=0;f<3;f++)l[f]=K(l[f],0,255);return l[3]=K(l[3],0,1),l};q.get.hsl=function(r){if(!r)return null;let t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,n=r.match(t);if(n){let s=Number.parseFloat(n[4]),a=(Number.parseFloat(n[1])%360+360)%360,o=K(Number.parseFloat(n[2]),0,100),l=K(Number.parseFloat(n[3]),0,100),c=K(Number.isNaN(s)?1:s,0,1);return[a,o,l,c]}return null};q.get.hwb=function(r){if(!r)return null;let t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,n=r.match(t);if(n){let s=Number.parseFloat(n[4]),a=(Number.parseFloat(n[1])%360+360)%360,o=K(Number.parseFloat(n[2]),0,100),l=K(Number.parseFloat(n[3]),0,100),c=K(Number.isNaN(s)?1:s,0,1);return[a,o,l,c]}return null};q.to.hex=function(...r){return"#"+Oe(r[0])+Oe(r[1])+Oe(r[2])+(r[3]<1?Oe(Math.round(r[3]*255)):"")};q.to.rgb=function(...r){return r.length<4||r[3]===1?"rgb("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+")":"rgba("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+", "+r[3]+")"};q.to.rgb.percent=function(...r){let t=Math.round(r[0]/255*100),n=Math.round(r[1]/255*100),s=Math.round(r[2]/255*100);return r.length<4||r[3]===1?"rgb("+t+"%, "+n+"%, "+s+"%)":"rgba("+t+"%, "+n+"%, "+s+"%, "+r[3]+")"};q.to.hsl=function(...r){return r.length<4||r[3]===1?"hsl("+r[0]+", "+r[1]+"%, "+r[2]+"%)":"hsla("+r[0]+", "+r[1]+"%, "+r[2]+"%, "+r[3]+")"};q.to.hwb=function(...r){let t="";if(r.length>=4&&r[3]!==1)t=", "+r[3];return"hwb("+r[0]+", "+r[1]+"%, "+r[2]+"%"+t+")"};q.to.keyword=function(...r){return sn[r.slice(0,3)]};function K(r,t,n){return Math.min(Math.max(t,r),n)}function Oe(r){let t=Math.round(r).toString(16).toUpperCase();return t.length<2?"0"+t:t}var le=q,an={};for(let r of Object.keys(U))an[U[r]]=r;var d={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},te=d,X=0.008856451679035631;function fe(r){let t=r>0.0031308?1.055*r**0.4166666666666667-0.055:r*12.92;return Math.min(Math.max(0,t),1)}function he(r){return r>0.04045?((r+0.055)/1.055)**2.4:r/12.92}for(let r of Object.keys(d)){if(!("channels"in d[r]))throw Error("missing channels property: "+r);if(!("labels"in d[r]))throw Error("missing channel labels property: "+r);if(d[r].labels.length!==d[r].channels)throw Error("channel and label counts mismatch: "+r);let{channels:t,labels:n}=d[r];delete d[r].channels,delete d[r].labels,Object.defineProperty(d[r],"channels",{value:t}),Object.defineProperty(d[r],"labels",{value:n})}d.rgb.hsl=function(r){let t=r[0]/255,n=r[1]/255,s=r[2]/255,a=Math.min(t,n,s),o=Math.max(t,n,s),l=o-a,c,f;switch(o){case a:{c=0;break}case t:{c=(n-s)/l;break}case n:{c=2+(s-t)/l;break}case s:{c=4+(t-n)/l;break}}if(c=Math.min(c*60,360),c<0)c+=360;let h=(a+o)/2;if(o===a)f=0;else if(h<=0.5)f=l/(o+a);else f=l/(2-o-a);return[c,f*100,h*100]};d.rgb.hsv=function(r){let t,n,s,a,o,l=r[0]/255,c=r[1]/255,f=r[2]/255,h=Math.max(l,c,f),b=h-Math.min(l,c,f),v=function(R){return(h-R)/6/b+0.5};if(b===0)a=0,o=0;else{switch(o=b/h,t=v(l),n=v(c),s=v(f),h){case l:{a=s-n;break}case c:{a=0.3333333333333333+t-s;break}case f:{a=0.6666666666666666+n-t;break}}if(a<0)a+=1;else if(a>1)a-=1}return[a*360,o*100,h*100]};d.rgb.hwb=function(r){let t=r[0],n=r[1],s=r[2],a=d.rgb.hsl(r)[0],o=0.00392156862745098*Math.min(t,Math.min(n,s));return s=1-0.00392156862745098*Math.max(t,Math.max(n,s)),[a,o*100,s*100]};d.rgb.oklab=function(r){let t=he(r[0]/255),n=he(r[1]/255),s=he(r[2]/255),a=Math.cbrt(0.4122214708*t+0.5363325363*n+0.0514459929*s),o=Math.cbrt(0.2119034982*t+0.6806995451*n+0.1073969566*s),l=Math.cbrt(0.0883024619*t+0.2817188376*n+0.6299787005*s),c=0.2104542553*a+0.793617785*o-0.0040720468*l,f=1.9779984951*a-2.428592205*o+0.4505937099*l,h=0.0259040371*a+0.7827717662*o-0.808675766*l;return[c*100,f*100,h*100]};d.rgb.cmyk=function(r){let t=r[0]/255,n=r[1]/255,s=r[2]/255,a=Math.min(1-t,1-n,1-s),o=(1-t-a)/(1-a)||0,l=(1-n-a)/(1-a)||0,c=(1-s-a)/(1-a)||0;return[o*100,l*100,c*100,a*100]};function Ec(r,t){return(r[0]-t[0])**2+(r[1]-t[1])**2+(r[2]-t[2])**2}d.rgb.keyword=function(r){let t=an[r];if(t)return t;let n=Number.POSITIVE_INFINITY,s;for(let a of Object.keys(U)){let o=U[a],l=Ec(r,o);if(l<n)n=l,s=a}return s};d.keyword.rgb=function(r){return[...U[r]]};d.rgb.xyz=function(r){let t=he(r[0]/255),n=he(r[1]/255),s=he(r[2]/255),a=t*0.4124564+n*0.3575761+s*0.1804375,o=t*0.2126729+n*0.7151522+s*0.072175,l=t*0.0193339+n*0.119192+s*0.9503041;return[a*100,o*100,l*100]};d.rgb.lab=function(r){let t=d.rgb.xyz(r),n=t[0],s=t[1],a=t[2];n/=95.047,s/=100,a/=108.883,n=n>X?n**0.3333333333333333:7.787*n+0.13793103448275862,s=s>X?s**0.3333333333333333:7.787*s+0.13793103448275862,a=a>X?a**0.3333333333333333:7.787*a+0.13793103448275862;let o=116*s-16,l=500*(n-s),c=200*(s-a);return[o,l,c]};d.hsl.rgb=function(r){let t=r[0]/360,n=r[1]/100,s=r[2]/100,a,o;if(n===0)return o=s*255,[o,o,o];let l=s<0.5?s*(1+n):s+n-s*n,c=2*s-l,f=[0,0,0];for(let h=0;h<3;h++){if(a=t+0.3333333333333333*-(h-1),a<0)a++;if(a>1)a--;if(6*a<1)o=c+(l-c)*6*a;else if(2*a<1)o=l;else if(3*a<2)o=c+(l-c)*(0.6666666666666666-a)*6;else o=c;f[h]=o*255}return f};d.hsl.hsv=function(r){let t=r[0],n=r[1]/100,s=r[2]/100,a=n,o=Math.max(s,0.01);s*=2,n*=s<=1?s:2-s,a*=o<=1?o:2-o;let l=(s+n)/2,c=s===0?2*a/(o+a):2*n/(s+n);return[t,c*100,l*100]};d.hsv.rgb=function(r){let t=r[0]/60,n=r[1]/100,s=r[2]/100,a=Math.floor(t)%6,o=t-Math.floor(t),l=255*s*(1-n),c=255*s*(1-n*o),f=255*s*(1-n*(1-o));switch(s*=255,a){case 0:return[s,f,l];case 1:return[c,s,l];case 2:return[l,s,f];case 3:return[l,c,s];case 4:return[f,l,s];case 5:return[s,l,c]}};d.hsv.hsl=function(r){let t=r[0],n=r[1]/100,s=r[2]/100,a=Math.max(s,0.01),o,l;l=(2-n)*s;let c=(2-n)*a;return o=n*a,o/=c<=1?c:2-c,o=o||0,l/=2,[t,o*100,l*100]};d.hwb.rgb=function(r){let t=r[0]/360,n=r[1]/100,s=r[2]/100,a=n+s,o;if(a>1)n/=a,s/=a;let l=Math.floor(6*t),c=1-s;if(o=6*t-l,(l&1)!==0)o=1-o;let f=n+o*(c-n),h,b,v;switch(l){default:case 6:case 0:{h=c,b=f,v=n;break}case 1:{h=f,b=c,v=n;break}case 2:{h=n,b=c,v=f;break}case 3:{h=n,b=f,v=c;break}case 4:{h=f,b=n,v=c;break}case 5:{h=c,b=n,v=f;break}}return[h*255,b*255,v*255]};d.cmyk.rgb=function(r){let t=r[0]/100,n=r[1]/100,s=r[2]/100,a=r[3]/100,o=1-Math.min(1,t*(1-a)+a),l=1-Math.min(1,n*(1-a)+a),c=1-Math.min(1,s*(1-a)+a);return[o*255,l*255,c*255]};d.xyz.rgb=function(r){let t=r[0]/100,n=r[1]/100,s=r[2]/100,a,o,l;return a=t*3.2404542+n*-1.5371385+s*-0.4985314,o=t*-0.969266+n*1.8760108+s*0.041556,l=t*0.0556434+n*-0.2040259+s*1.0572252,a=fe(a),o=fe(o),l=fe(l),[a*255,o*255,l*255]};d.xyz.lab=function(r){let t=r[0],n=r[1],s=r[2];t/=95.047,n/=100,s/=108.883,t=t>X?t**0.3333333333333333:7.787*t+0.13793103448275862,n=n>X?n**0.3333333333333333:7.787*n+0.13793103448275862,s=s>X?s**0.3333333333333333:7.787*s+0.13793103448275862;let a=116*n-16,o=500*(t-n),l=200*(n-s);return[a,o,l]};d.xyz.oklab=function(r){let t=r[0]/100,n=r[1]/100,s=r[2]/100,a=Math.cbrt(0.8189330101*t+0.3618667424*n-0.1288597137*s),o=Math.cbrt(0.0329845436*t+0.9293118715*n+0.0361456387*s),l=Math.cbrt(0.0482003018*t+0.2643662691*n+0.633851707*s),c=0.2104542553*a+0.793617785*o-0.0040720468*l,f=1.9779984951*a-2.428592205*o+0.4505937099*l,h=0.0259040371*a+0.7827717662*o-0.808675766*l;return[c*100,f*100,h*100]};d.oklab.oklch=function(r){return d.lab.lch(r)};d.oklab.xyz=function(r){let t=r[0]/100,n=r[1]/100,s=r[2]/100,a=(0.999999998*t+0.396337792*n+0.215803758*s)**3,o=(1.000000008*t-0.105561342*n-0.063854175*s)**3,l=(1.000000055*t-0.089484182*n-1.291485538*s)**3,c=1.227013851*a-0.55779998*o+0.281256149*l,f=-0.040580178*a+1.11225687*o-0.071676679*l,h=-0.076381285*a-0.421481978*o+1.58616322*l;return[c*100,f*100,h*100]};d.oklab.rgb=function(r){let t=r[0]/100,n=r[1]/100,s=r[2]/100,a=(t+0.3963377774*n+0.2158037573*s)**3,o=(t-0.1055613458*n-0.0638541728*s)**3,l=(t-0.0894841775*n-1.291485548*s)**3,c=fe(4.0767416621*a-3.3077115913*o+0.2309699292*l),f=fe(-1.2684380046*a+2.6097574011*o-0.3413193965*l),h=fe(-0.0041960863*a-0.7034186147*o+1.707614701*l);return[c*255,f*255,h*255]};d.oklch.oklab=function(r){return d.lch.lab(r)};d.lab.xyz=function(r){let t=r[0],n=r[1],s=r[2],a,o,l;o=(t+16)/116,a=n/500+o,l=o-s/200;let c=o**3,f=a**3,h=l**3;return o=c>X?c:(o-0.13793103448275862)/7.787,a=f>X?f:(a-0.13793103448275862)/7.787,l=h>X?h:(l-0.13793103448275862)/7.787,a*=95.047,o*=100,l*=108.883,[a,o,l]};d.lab.lch=function(r){let t=r[0],n=r[1],s=r[2],a;if(a=Math.atan2(s,n)*360/2/Math.PI,a<0)a+=360;let l=Math.sqrt(n*n+s*s);return[t,l,a]};d.lch.lab=function(r){let t=r[0],n=r[1],a=r[2]/360*2*Math.PI,o=n*Math.cos(a),l=n*Math.sin(a);return[t,o,l]};d.rgb.ansi16=function(r,t=null){let[n,s,a]=r,o=t===null?d.rgb.hsv(r)[2]:t;if(o=Math.round(o/50),o===0)return 30;let l=30+(Math.round(a/255)<<2|Math.round(s/255)<<1|Math.round(n/255));if(o===2)l+=60;return l};d.hsv.ansi16=function(r){return d.rgb.ansi16(d.hsv.rgb(r),r[2])};d.rgb.ansi256=function(r){let t=r[0],n=r[1],s=r[2];if(t>>4===n>>4&&n>>4===s>>4){if(t<8)return 16;if(t>248)return 231;return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(s/255*5)};d.ansi16.rgb=function(r){r=r[0];let t=r%10;if(t===0||t===7){if(r>50)t+=3.5;return t=t/10.5*255,[t,t,t]}let n=(Math.trunc(r>50)+1)*0.5,s=(t&1)*n*255,a=(t>>1&1)*n*255,o=(t>>2&1)*n*255;return[s,a,o]};d.ansi256.rgb=function(r){if(r=r[0],r>=232){let o=(r-232)*10+8;return[o,o,o]}r-=16;let t,n=Math.floor(r/36)/5*255,s=Math.floor((t=r%36)/6)/5*255,a=t%6/5*255;return[n,s,a]};d.rgb.hex=function(r){let n=(((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255)).toString(16).toUpperCase();return"000000".slice(n.length)+n};d.hex.rgb=function(r){let t=r.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let n=t[0];if(t[0].length===3)n=[...n].map((c)=>c+c).join("");let s=Number.parseInt(n,16),a=s>>16&255,o=s>>8&255,l=s&255;return[a,o,l]};d.rgb.hcg=function(r){let t=r[0]/255,n=r[1]/255,s=r[2]/255,a=Math.max(Math.max(t,n),s),o=Math.min(Math.min(t,n),s),l=a-o,c,f=l<1?o/(1-l):0;if(l<=0)c=0;else if(a===t)c=(n-s)/l%6;else if(a===n)c=2+(s-t)/l;else c=4+(t-n)/l;return c/=6,c%=1,[c*360,l*100,f*100]};d.hsl.hcg=function(r){let t=r[1]/100,n=r[2]/100,s=n<0.5?2*t*n:2*t*(1-n),a=0;if(s<1)a=(n-0.5*s)/(1-s);return[r[0],s*100,a*100]};d.hsv.hcg=function(r){let t=r[1]/100,n=r[2]/100,s=t*n,a=0;if(s<1)a=(n-s)/(1-s);return[r[0],s*100,a*100]};d.hcg.rgb=function(r){let t=r[0]/360,n=r[1]/100,s=r[2]/100;if(n===0)return[s*255,s*255,s*255];let a=[0,0,0],o=t%1*6,l=o%1,c=1-l,f=0;switch(Math.floor(o)){case 0:{a[0]=1,a[1]=l,a[2]=0;break}case 1:{a[0]=c,a[1]=1,a[2]=0;break}case 2:{a[0]=0,a[1]=1,a[2]=l;break}case 3:{a[0]=0,a[1]=c,a[2]=1;break}case 4:{a[0]=l,a[1]=0,a[2]=1;break}default:a[0]=1,a[1]=0,a[2]=c}return f=(1-n)*s,[(n*a[0]+f)*255,(n*a[1]+f)*255,(n*a[2]+f)*255]};d.hcg.hsv=function(r){let t=r[1]/100,n=r[2]/100,s=t+n*(1-t),a=0;if(s>0)a=t/s;return[r[0],a*100,s*100]};d.hcg.hsl=function(r){let t=r[1]/100,s=r[2]/100*(1-t)+0.5*t,a=0;if(s>0&&s<0.5)a=t/(2*s);else if(s>=0.5&&s<1)a=t/(2*(1-s));return[r[0],a*100,s*100]};d.hcg.hwb=function(r){let t=r[1]/100,n=r[2]/100,s=t+n*(1-t);return[r[0],(s-t)*100,(1-s)*100]};d.hwb.hcg=function(r){let t=r[1]/100,s=1-r[2]/100,a=s-t,o=0;if(a<1)o=(s-a)/(1-a);return[r[0],a*100,o*100]};d.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};d.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};d.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};d.gray.hsl=function(r){return[0,0,r[0]]};d.gray.hsv=d.gray.hsl;d.gray.hwb=function(r){return[0,100,r[0]]};d.gray.cmyk=function(r){return[0,0,0,r[0]]};d.gray.lab=function(r){return[r[0],0,0]};d.gray.hex=function(r){let t=Math.round(r[0]/100*255)&255,s=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(s.length)+s};d.rgb.gray=function(r){return[(r[0]+r[1]+r[2])/3/255*100]};function yc(){let r={},t=Object.keys(te);for(let{length:n}=t,s=0;s<n;s++)r[t[s]]={distance:-1,parent:null};return r}function xc(r){let t=yc(),n=[r];t[r].distance=0;while(n.length>0){let s=n.pop(),a=Object.keys(te[s]);for(let{length:o}=a,l=0;l<o;l++){let c=a[l],f=t[c];if(f.distance===-1)f.distance=t[s].distance+1,f.parent=s,n.unshift(c)}}return t}function Pc(r,t){return function(n){return t(r(n))}}function Rc(r,t){let n=[t[r].parent,r],s=te[t[r].parent][r],a=t[r].parent;while(t[a].parent)n.unshift(t[a].parent),s=Pc(te[t[a].parent][a],s),a=t[a].parent;return s.conversion=n,s}function Ic(r){let t=xc(r),n={},s=Object.keys(t);for(let{length:a}=s,o=0;o<a;o++){let l=s[o];if(t[l].parent===null)continue;n[l]=Rc(l,t)}return n}var jc=Ic,ce={},Ac=Object.keys(te);function kc(r){let t=function(...n){let s=n[0];if(s===void 0||s===null)return s;if(s.length>1)n=s;return r(n)};if("conversion"in r)t.conversion=r.conversion;return t}function Sc(r){let t=function(...n){let s=n[0];if(s===void 0||s===null)return s;if(s.length>1)n=s;let a=r(n);if(typeof a==="object")for(let{length:o}=a,l=0;l<o;l++)a[l]=Math.round(a[l]);return a};if("conversion"in r)t.conversion=r.conversion;return t}for(let r of Ac){ce[r]={},Object.defineProperty(ce[r],"channels",{value:te[r].channels}),Object.defineProperty(ce[r],"labels",{value:te[r].labels});let t=jc(r),n=Object.keys(t);for(let s of n){let a=t[s];ce[r][s]=Sc(a),ce[r][s].raw=kc(a)}}var T=ce,on=["keyword","gray","hex"],mr={};for(let r of Object.keys(T))mr[[...T[r].labels].sort().join("")]=r;var gr={};function S(r,t){if(!(this instanceof S))return new S(r,t);if(t&&t in on)t=null;if(t&&!(t in T))throw Error("Unknown model: "+t);let n,s;if(r==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(r instanceof S)this.model=r.model,this.color=[...r.color],this.valpha=r.valpha;else if(typeof r==="string"){let a=le.get(r);if(a===null)throw Error("Unable to parse color from string: "+r);this.model=a.model,s=T[this.model].channels,this.color=a.value.slice(0,s),this.valpha=typeof a.value[s]==="number"?a.value[s]:1}else if(r.length>0){this.model=t||"rgb",s=T[this.model].channels;let a=Array.prototype.slice.call(r,0,s);this.color=pr(a,s),this.valpha=typeof r[s]==="number"?r[s]:1}else if(typeof r==="number")this.model="rgb",this.color=[r>>16&255,r>>8&255,r&255],this.valpha=1;else{this.valpha=1;let a=Object.keys(r);if("alpha"in r)a.splice(a.indexOf("alpha"),1),this.valpha=typeof r.alpha==="number"?r.alpha:0;let o=a.sort().join("");if(!(o in mr))throw Error("Unable to parse color from object: "+JSON.stringify(r));this.model=mr[o];let{labels:l}=T[this.model],c=[];for(n=0;n<l.length;n++)c.push(r[l[n]]);this.color=pr(c)}if(gr[this.model]){s=T[this.model].channels;for(n=0;n<s;n++){let a=gr[this.model][n];if(a)this.color[n]=a(this.color[n])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}S.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(r){let t=this.model in le.to?this:this.rgb();t=t.round(typeof r==="number"?r:1);let n=t.valpha===1?t.color:[...t.color,this.valpha];return le.to[t.model](...n)},percentString(r){let t=this.rgb().round(typeof r==="number"?r:1),n=t.valpha===1?t.color:[...t.color,this.valpha];return le.to.rgb.percent(...n)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let r={},{channels:t}=T[this.model],{labels:n}=T[this.model];for(let s=0;s<t;s++)r[n[s]]=this.color[s];if(this.valpha!==1)r.alpha=this.valpha;return r},unitArray(){let r=this.rgb().color;if(r[0]/=255,r[1]/=255,r[2]/=255,this.valpha!==1)r.push(this.valpha);return r},unitObject(){let r=this.rgb().object();if(r.r/=255,r.g/=255,r.b/=255,this.valpha!==1)r.alpha=this.valpha;return r},round(r){return r=Math.max(r||0,0),new S([...this.color.map($c(r)),this.valpha],this.model)},alpha(r){if(r!==void 0)return new S([...this.color,Math.max(0,Math.min(1,r))],this.model);return this.valpha},red:I("rgb",0,k(255)),green:I("rgb",1,k(255)),blue:I("rgb",2,k(255)),hue:I(["hsl","hsv","hsl","hwb","hcg"],0,(r)=>(r%360+360)%360),saturationl:I("hsl",1,k(100)),lightness:I("hsl",2,k(100)),saturationv:I("hsv",1,k(100)),value:I("hsv",2,k(100)),chroma:I("hcg",1,k(100)),gray:I("hcg",2,k(100)),white:I("hwb",1,k(100)),wblack:I("hwb",2,k(100)),cyan:I("cmyk",0,k(100)),magenta:I("cmyk",1,k(100)),yellow:I("cmyk",2,k(100)),black:I("cmyk",3,k(100)),x:I("xyz",0,k(95.047)),y:I("xyz",1,k(100)),z:I("xyz",2,k(108.833)),l:I("lab",0,k(100)),a:I("lab",1),b:I("lab",2),keyword(r){if(r!==void 0)return new S(r);return T[this.model].keyword(this.color)},hex(r){if(r!==void 0)return new S(r);return le.to.hex(...this.rgb().round().color)},hexa(r){if(r!==void 0)return new S(r);let t=this.rgb().round().color,n=Math.round(this.valpha*255).toString(16).toUpperCase();if(n.length===1)n="0"+n;return le.to.hex(...t)+n},rgbNumber(){let r=this.rgb().color;return(r[0]&255)<<16|(r[1]&255)<<8|r[2]&255},luminosity(){let r=this.rgb().color,t=[];for(let[n,s]of r.entries()){let a=s/255;t[n]=a<=0.04045?a/12.92:((a+0.055)/1.055)**2.4}return 0.2126*t[0]+0.7152*t[1]+0.0722*t[2]},contrast(r){let t=this.luminosity(),n=r.luminosity();if(t>n)return(t+0.05)/(n+0.05);return(n+0.05)/(t+0.05)},level(r){let t=this.contrast(r);if(t>=7)return"AAA";return t>=4.5?"AA":""},isDark(){let r=this.rgb().color;return(r[0]*2126+r[1]*7152+r[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let r=this.rgb();for(let t=0;t<3;t++)r.color[t]=255-r.color[t];return r},lighten(r){let t=this.hsl();return t.color[2]+=t.color[2]*r,t},darken(r){let t=this.hsl();return t.color[2]-=t.color[2]*r,t},saturate(r){let t=this.hsl();return t.color[1]+=t.color[1]*r,t},desaturate(r){let t=this.hsl();return t.color[1]-=t.color[1]*r,t},whiten(r){let t=this.hwb();return t.color[1]+=t.color[1]*r,t},blacken(r){let t=this.hwb();return t.color[2]+=t.color[2]*r,t},grayscale(){let r=this.rgb().color,t=r[0]*0.3+r[1]*0.59+r[2]*0.11;return S.rgb(t,t,t)},fade(r){return this.alpha(this.valpha-this.valpha*r)},opaquer(r){return this.alpha(this.valpha+this.valpha*r)},rotate(r){let t=this.hsl(),n=t.color[0];return n=(n+r)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(r,t){if(!r||!r.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof r);let n=r.rgb(),s=this.rgb(),a=t===void 0?0.5:t,o=2*a-1,l=n.alpha()-s.alpha(),c=((o*l===-1?o:(o+l)/(1+o*l))+1)/2,f=1-c;return S.rgb(c*n.red()+f*s.red(),c*n.green()+f*s.green(),c*n.blue()+f*s.blue(),n.alpha()*a+s.alpha()*(1-a))}};for(let r of Object.keys(T)){if(on.includes(r))continue;let{channels:t}=T[r];S.prototype[r]=function(...n){if(this.model===r)return new S(this);if(n.length>0)return new S(n,r);return new S([...Nc(T[this.model][r].raw(this.color)),this.valpha],r)},S[r]=function(...n){let s=n[0];if(typeof s==="number")s=pr(n,t);return new S(s,r)}}function Lc(r,t){return Number(r.toFixed(t))}function $c(r){return function(t){return Lc(t,r)}}function I(r,t,n){r=Array.isArray(r)?r:[r];for(let s of r)(gr[s]||=[])[t]=n;return r=r[0],function(s){let a;if(s!==void 0){if(n)s=n(s);return a=this[r](),a.color[t]=s,a}if(a=this[r]().color[t],n)a=n(a);return a}}function k(r){return function(t){return Math.max(0,Math.min(r,t))}}function Nc(r){return Array.isArray(r)?r:[r]}function pr(r,t){for(let n=0;n<t;n++)if(typeof r[n]!=="number")r[n]=0;return r}var _c=S});var hn=e(function(su,fn){fn.exports=cn().default});import Il from"node:util";import cr from"node:stream";/*!
3
+ Copyright 2013 Lovell Fuller and others.
4
+ SPDX-License-Identifier: Apache-2.0
5
+ */var xr=(r)=>typeof r<"u"&&r!==null,In=(r)=>typeof r==="object",jn=(r)=>Object.prototype.toString.call(r)==="[object Object]",An=(r)=>typeof r==="function",kn=(r)=>typeof r==="boolean",Sn=(r)=>r instanceof Buffer,Ln=(r)=>{if(xr(r))switch(r.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},$n=(r)=>r instanceof ArrayBuffer,Nn=(r)=>typeof r==="string"&&r.length>0,_n=(r)=>typeof r==="number"&&Number.isFinite(r),qn=(r)=>Number.isInteger(r),Tn=(r,t,n)=>r>=t&&r<=n,Cn=(r,t)=>t.includes(r),Mn=(r,t,n)=>Error(`Expected ${t} for ${r} but received ${n} of type ${typeof n}`),Bn=(r,t)=>(t.message=r.message,t),i={defined:xr,object:In,plainObject:jn,fn:An,bool:kn,buffer:Sn,typedArray:Ln,arrayBuffer:$n,string:Nn,number:_n,integer:qn,inRange:Tn,inArray:Cn,invalidParameterError:Mn,nativeError:Bn};var Fe=g(Re(),1);import{createRequire as yl}from"node:module";var Ee=g(Bi(),1),or=g(Re(),1);import{spawnSync as ve}from"node:child_process";import{createHash as al}from"node:crypto";var W={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.35.4",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unnebäck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix Bünemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","Jérémy Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kotěšovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouciño <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugué <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>","Dmytro Tiapukhin <cool.gegeg@gmail.com>","Florian Lefebvre <contact@florian-lefebvre.dev>"],scripts:{build:"node install/build.js","build:dist":"node scripts/build.mjs",clean:"rm -rf src/build/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types && npm run lint-publish","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-publish":"publint --strict","lint-types":"tsd --files ./test/types/sharp.test-d.{cts,mts}","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./dist/index.d.mts",exports:{".":{import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}}},sideEffects:!0,repository:{type:"git",url:"git+https://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.1.0","detect-libc":"^2.1.2",semver:"^7.8.5"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.4","@img/sharp-darwin-x64":"0.35.4","@img/sharp-freebsd-wasm32":"0.35.4","@img/sharp-libvips-darwin-arm64":"1.3.3","@img/sharp-libvips-darwin-x64":"1.3.3","@img/sharp-libvips-linux-arm":"1.3.3","@img/sharp-libvips-linux-arm64":"1.3.3","@img/sharp-libvips-linux-ppc64":"1.3.3","@img/sharp-libvips-linux-riscv64":"1.3.3","@img/sharp-libvips-linux-s390x":"1.3.3","@img/sharp-libvips-linux-x64":"1.3.3","@img/sharp-libvips-linuxmusl-arm64":"1.3.3","@img/sharp-libvips-linuxmusl-x64":"1.3.3","@img/sharp-linux-arm":"0.35.4","@img/sharp-linux-arm64":"0.35.4","@img/sharp-linux-ppc64":"0.35.4","@img/sharp-linux-riscv64":"0.35.4","@img/sharp-linux-s390x":"0.35.4","@img/sharp-linux-x64":"0.35.4","@img/sharp-linuxmusl-arm64":"0.35.4","@img/sharp-linuxmusl-x64":"0.35.4","@img/sharp-webcontainers-wasm32":"0.35.4","@img/sharp-win32-arm64":"0.35.4","@img/sharp-win32-ia32":"0.35.4","@img/sharp-win32-x64":"0.35.4"},peerDependenciesMeta:{"@types/node":{optional:!0}},devDependencies:{"@biomejs/biome":"^2.5.10","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.3","@img/sharp-libvips-dev":"1.3.3","@img/sharp-libvips-dev-wasm32":"1.3.3","@img/sharp-libvips-win32-arm64":"1.3.3","@img/sharp-libvips-win32-ia32":"1.3.3","@img/sharp-libvips-win32-x64":"1.3.3","@types/node":"*",emnapi:"^1.11.3","exif-reader":"^2.0.3",yauzl:"^3.4.0",icc:"^4.0.0","node-addon-api":"^8.9.2","node-gyp":"^12.4.0",publint:"^0.3.24","tar-fs":"^3.1.3",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.6"},funding:{url:"https://opencollective.com/libvips"}};/*!
6
+ Copyright 2013 Lovell Fuller and others.
7
+ SPDX-License-Identifier: Apache-2.0
8
+ */var ol=process.env.npm_package_config_libvips||W.config.libvips,Di=Ee.default.coerce(ol).version,ll=["darwin-arm64","darwin-x64","freebsd-arm64","freebsd-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-wasm32","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],lr={encoding:"utf8",shell:!0},cl=(r)=>{if(r instanceof Error)console.error(`sharp: Installation error: ${r.message}`);else console.log(`sharp: ${r}`)},Oi=()=>or.default.isNonGlibcLinuxSync()?or.default.familySync():"",fl=()=>`${process.platform}${Oi()}-${process.arch}`,oe=()=>{if(Gi())return"wasm32";let{npm_config_arch:r,npm_config_platform:t,npm_config_libc:n}=process.env,s=typeof n==="string"?n:Oi();return`${t||process.platform}${s}-${r||process.arch}`},hl=()=>{try{return u(`@img/sharp-libvips-dev-${oe()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},ul=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},dl=()=>{try{return u(`@img/sharp-libvips-dev-${oe()}/lib`)}catch{try{return u(`@img/sharp-libvips-${oe()}/lib`)}catch{}}return""},ml=()=>{if(process.release?.name==="node"&&process.versions){if(!Ee.default.satisfies(process.versions.node,W.engines.node))return{found:process.versions.node,expected:W.engines.node}}},Gi=()=>{let{CC:r}=process.env;return Boolean(r?.endsWith("/emcc"))},gl=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(ve("sysctl sysctl.proc_translated",lr).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},Fi=(r)=>al("sha512").update(r).digest("hex"),pl=()=>{try{let r=Fi(`imgsharp-libvips-${oe()}`),t=Ee.default.coerce(W.optionalDependencies[`@img/sharp-libvips-${oe()}`],{includePrerelease:!0}).version;return Fi(`${r}npm:${t}`).slice(0,10)}catch{}return""},bl=()=>ve(`node-gyp rebuild --directory=src ${Gi()?"--nodedir=emscripten":""}`,{...lr,stdio:"inherit"}).status,zi=()=>{if(process.platform!=="win32")return(ve("pkg-config --modversion vips-cpp",{...lr,env:{...process.env,PKG_CONFIG_PATH:Ui()}}).stdout||"").trim();else return""},wl=()=>{try{let r=(ve("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(r)return`${r}/lib/pkgconfig`}catch(r){}return},vl=()=>{try{let r=(ve("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(r)return r}catch(r){}return},Ui=()=>{if(process.platform!=="win32")return[wl(),vl(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},ar=(r,t,n)=>{if(n)n(`Detected ${t}, skipping search for globally-installed libvips`);return r},El=(r)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return ar(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",r);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return ar(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",r);if(gl())return ar(!1,"Rosetta",r);let t=zi();return!!t&&Ee.default.gte(t,Di)},Be={minimumLibvipsVersion:Di,prebuiltPlatforms:ll,buildPlatformArch:oe,buildSharpLibvipsIncludeDir:hl,buildSharpLibvipsCPlusPlusDir:ul,buildSharpLibvipsLibDir:dl,isUnsupportedNodeRuntime:ml,runtimePlatformArch:fl,log:cl,yarnLocator:pl,spawnRebuild:bl,globalLibvipsVersion:zi,pkgConfigPath:Ui,useGlobalLibvips:El};/*!
9
+ Copyright 2013 Lovell Fuller and others.
10
+ SPDX-License-Identifier: Apache-2.0
11
+ */var A=yl(import.meta.url),{version:Wi}=W,{runtimePlatformArch:xl,isUnsupportedNodeRuntime:Hi,prebuiltPlatforms:Pl,minimumLibvipsVersion:Rl}=Be,V=xl(),x,Y=[];try{x=A(`../src/build/Release/sharp-${V}-${Wi}.node`)}catch(r){Y.push(r)}if(!x)try{x=A(`../src/build/Release/sharp-wasm32-${Wi}.node`)}catch(r){Y.push(r)}if(!x)try{switch(V){case"darwin-arm64":x=A("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":x=A("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":x=A("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":x=A("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":x=A("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":x=A("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":x=A("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":x=A("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":x=A("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":x=A("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":x=A("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":x=A("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":x=A("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":x=A("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":x=A("@img/sharp-webcontainers-wasm32/sharp.node");break}if(x&&["linux-x64","linuxmusl-x64"].includes(V)&&!x._isUsingX64V2()){let r=Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");r.code="Unsupported CPU",Y.push(r),x=null}if(x&&process.versions.electron&&V.startsWith("linux"))process.emitWarning("Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux",{code:"SharpElectronLinux"})}catch(r){Y.push(r)}if(!x)try{x=A("@img/sharp-wasm32/sharp.node")}catch(r){Y.push(r)}if(!x){let[r,t,n]=["linux","darwin","win32"].map((o)=>V.startsWith(o)),s=[`Could not load the "sharp" module using the ${V} runtime`];Y.forEach((o)=>{if(!o.code.endsWith("MODULE_NOT_FOUND"))s.push(`${o.code}: ${o.message}`)});let a=Y.map((o)=>o.message).join(" ");if(s.push("Possible solutions:"),Hi()){let{found:o,expected:l}=Hi();s.push("- Please upgrade Node.js:",` Found ${o}`,` Requires ${l}`)}else if(Pl.includes(V)){let[o,l]=V.split("-"),c=o.endsWith("musl")?" --libc=musl":"";s.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${o.replace("musl","")}${c} --cpu=${l} sharp`)}else s.push(`- Manually install libvips >= ${Rl}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if(r&&/(symbol not found|CXXABI_)/i.test(a))try{let{config:o}=A(`@img/sharp-libvips-${V}/package`),l=`${Fe.familySync()} ${Fe.versionSync()}`,c=`${o.musl?"musl":"glibc"} ${o.musl||o.glibc}`;s.push("- Update your OS:",` Found ${l}`,` Requires ${c}`)}catch(o){}if(r&&/\/snap\/core[0-9]{2}/.test(a))s.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(t&&/Incompatible library version/.test(a))s.push("- Update Homebrew:"," brew update && brew upgrade vips");if(Y.some((o)=>o.code==="ERR_DLOPEN_DISABLED"))s.push("- Run Node.js without using the --no-addons flag");if(n&&/The specified procedure could not be found/.test(a))s.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp");throw s.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),Error(s.join(`
12
+ `))}var y=x;/*!
13
+ Copyright 2013 Lovell Fuller and others.
14
+ SPDX-License-Identifier: Apache-2.0
15
+ */var jl=Il.debuglog("sharp"),Al=(r)=>{re.queue.emit("change",r)},re=function(r,t){if(arguments.length===1&&!i.defined(r))throw Error("Invalid input");if(!(this instanceof re))return new re(r,t);return cr.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:0.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:(n)=>{this.emit("warning",n),jl(n)},queueListener:Al},this.options.input=this._createInputDescriptor(r,t,{allowStream:!0}),this};Object.setPrototypeOf(re.prototype,cr.Duplex.prototype);Object.setPrototypeOf(re,cr.Duplex);function kl(){let r=this.constructor.call(),{debuglog:t,queueListener:n,...s}=this.options;if(r.options=structuredClone(s),r.options.debuglog=t,r.options.queueListener=n,this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),r.options.input.buffer=this.options.input.buffer,r.emit("finish")});return r}Object.assign(re.prototype,{clone:kl});var z=re;/*!
16
+ Copyright 2013 Lovell Fuller and others.
17
+ SPDX-License-Identifier: Apache-2.0
18
+ */var Sl={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},Ll=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"];function Vi(r){let t=Ll.filter((n)=>i.defined(r[n])).map((n)=>[n,r[n]]);return t.length?Object.fromEntries(t):void 0}function $l(r,t,n){let s={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(i.string(r))s.file=r;else if(i.buffer(r)){if(r.length===0)throw Error("Input Buffer is empty");s.buffer=r}else if(i.arrayBuffer(r)){if(r.byteLength===0)throw Error("Input bit Array is empty");s.buffer=Buffer.from(r,0,r.byteLength)}else if(i.typedArray(r)){if(r.length===0)throw Error("Input Bit Array is empty");s.buffer=Buffer.from(r.buffer,r.byteOffset,r.byteLength)}else if(i.plainObject(r)&&!i.defined(t)){if(t=r,Vi(t))s.buffer=[]}else if(!i.defined(r)&&!i.defined(t)&&i.object(n)&&n.allowStream)s.buffer=[];else if(Array.isArray(r))if(r.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=r.map((a)=>this._createInputDescriptor(a));else throw Error("Recursive join is unsupported");else throw Error("Expected at least two images to join");else throw Error(`Unsupported input '${r}' of type ${typeof r}${i.defined(t)?` when also providing options of type ${typeof t}`:""}`);if(i.object(t)){if(i.defined(t.failOn))if(i.string(t.failOn)&&i.inArray(t.failOn,["none","truncated","error","warning"]))s.failOn=t.failOn;else throw i.invalidParameterError("failOn","one of: none, truncated, error, warning",t.failOn);if(i.defined(t.autoOrient))if(i.bool(t.autoOrient))s.autoOrient=t.autoOrient;else throw i.invalidParameterError("autoOrient","boolean",t.autoOrient);if(i.defined(t.density))if(i.number(t.density)&&i.inRange(t.density,1,1e5))s.density=t.density;else throw i.invalidParameterError("density","number between 1 and 100000",t.density);if(i.defined(t.ignoreIcc))if(i.bool(t.ignoreIcc))s.ignoreIcc=t.ignoreIcc;else throw i.invalidParameterError("ignoreIcc","boolean",t.ignoreIcc);if(i.defined(t.limitInputPixels))if(i.bool(t.limitInputPixels))s.limitInputPixels=t.limitInputPixels?268402689:0;else if(i.integer(t.limitInputPixels)&&i.inRange(t.limitInputPixels,0,Number.MAX_SAFE_INTEGER))s.limitInputPixels=t.limitInputPixels;else throw i.invalidParameterError("limitInputPixels","positive integer",t.limitInputPixels);if(i.defined(t.limitInputChannels))if(i.bool(t.limitInputChannels))s.limitInputChannels=t.limitInputChannels?5:0;else if(i.integer(t.limitInputChannels)&&i.inRange(t.limitInputChannels,0,Number.MAX_SAFE_INTEGER))s.limitInputChannels=t.limitInputChannels;else throw i.invalidParameterError("limitInputChannels","positive integer",t.limitInputChannels);if(i.defined(t.unlimited))if(i.bool(t.unlimited))s.unlimited=t.unlimited;else throw i.invalidParameterError("unlimited","boolean",t.unlimited);if(i.defined(t.sequentialRead))if(i.bool(t.sequentialRead))s.sequentialRead=t.sequentialRead;else throw i.invalidParameterError("sequentialRead","boolean",t.sequentialRead);if(i.defined(t.raw)){if(i.object(t.raw)&&i.integer(t.raw.width)&&i.inRange(t.raw.width,1,1e8)&&i.integer(t.raw.height)&&i.inRange(t.raw.height,1,1e8)&&i.integer(t.raw.channels)&&i.inRange(t.raw.channels,1,4))switch(s.rawWidth=t.raw.width,s.rawHeight=t.raw.height,s.rawChannels=t.raw.channels,r.constructor){case Uint8Array:case Uint8ClampedArray:s.rawDepth="uchar";break;case Int8Array:s.rawDepth="char";break;case Uint16Array:s.rawDepth="ushort";break;case Int16Array:s.rawDepth="short";break;case Uint32Array:s.rawDepth="uint";break;case Int32Array:s.rawDepth="int";break;case Float32Array:s.rawDepth="float";break;case Float64Array:s.rawDepth="double";break;default:s.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(s.rawPremultiplied=!1,i.defined(t.raw.premultiplied))if(i.bool(t.raw.premultiplied))s.rawPremultiplied=t.raw.premultiplied;else throw i.invalidParameterError("raw.premultiplied","boolean",t.raw.premultiplied);if(s.rawPageHeight=0,i.defined(t.raw.pageHeight))if(i.integer(t.raw.pageHeight)&&t.raw.pageHeight>0&&t.raw.pageHeight<=t.raw.height){if(t.raw.height%t.raw.pageHeight!==0)throw Error(`Expected raw.height ${t.raw.height} to be a multiple of raw.pageHeight ${t.raw.pageHeight}`);s.rawPageHeight=t.raw.pageHeight}else throw i.invalidParameterError("raw.pageHeight","positive integer",t.raw.pageHeight)}if(i.defined(t.animated))if(i.bool(t.animated))s.pages=t.animated?-1:1;else throw i.invalidParameterError("animated","boolean",t.animated);if(i.defined(t.pages))if(i.integer(t.pages)&&i.inRange(t.pages,-1,1e5))s.pages=t.pages;else throw i.invalidParameterError("pages","integer between -1 and 100000",t.pages);if(i.defined(t.page))if(i.integer(t.page)&&i.inRange(t.page,0,1e5))s.page=t.page;else throw i.invalidParameterError("page","integer between 0 and 100000",t.page);if(i.object(t.openSlide)&&i.defined(t.openSlide.level))if(i.integer(t.openSlide.level)&&i.inRange(t.openSlide.level,0,256))s.openSlideLevel=t.openSlide.level;else throw i.invalidParameterError("openSlide.level","integer between 0 and 256",t.openSlide.level);else if(i.defined(t.level))if(i.integer(t.level)&&i.inRange(t.level,0,256))s.openSlideLevel=t.level;else throw i.invalidParameterError("level","integer between 0 and 256",t.level);if(i.object(t.tiff)&&i.defined(t.tiff.subifd))if(i.integer(t.tiff.subifd)&&i.inRange(t.tiff.subifd,-1,1e5))s.tiffSubifd=t.tiff.subifd;else throw i.invalidParameterError("tiff.subifd","integer between -1 and 100000",t.tiff.subifd);else if(i.defined(t.subifd))if(i.integer(t.subifd)&&i.inRange(t.subifd,-1,1e5))s.tiffSubifd=t.subifd;else throw i.invalidParameterError("subifd","integer between -1 and 100000",t.subifd);if(i.object(t.svg)){if(i.defined(t.svg.stylesheet))if(i.string(t.svg.stylesheet))s.svgStylesheet=t.svg.stylesheet;else throw i.invalidParameterError("svg.stylesheet","string",t.svg.stylesheet);if(i.defined(t.svg.highBitdepth))if(i.bool(t.svg.highBitdepth))s.svgHighBitdepth=t.svg.highBitdepth;else throw i.invalidParameterError("svg.highBitdepth","boolean",t.svg.highBitdepth)}if(i.object(t.pdf)&&i.defined(t.pdf.background))s.pdfBackground=this._getBackgroundColourOption(t.pdf.background);else if(i.defined(t.pdfBackground))s.pdfBackground=this._getBackgroundColourOption(t.pdfBackground);if(i.object(t.jp2)&&i.defined(t.jp2.oneshot))if(i.bool(t.jp2.oneshot))s.jp2Oneshot=t.jp2.oneshot;else throw i.invalidParameterError("jp2.oneshot","boolean",t.jp2.oneshot);if(i.defined(t.create))if(i.object(t.create)&&i.integer(t.create.width)&&i.inRange(t.create.width,1,1e8)&&i.integer(t.create.height)&&i.inRange(t.create.height,1,1e8)&&i.integer(t.create.channels)){if(s.createWidth=t.create.width,s.createHeight=t.create.height,s.createChannels=t.create.channels,s.createPageHeight=0,i.defined(t.create.pageHeight))if(i.integer(t.create.pageHeight)&&t.create.pageHeight>0&&t.create.pageHeight<=t.create.height){if(t.create.height%t.create.pageHeight!==0)throw Error(`Expected create.height ${t.create.height} to be a multiple of create.pageHeight ${t.create.pageHeight}`);s.createPageHeight=t.create.pageHeight}else throw i.invalidParameterError("create.pageHeight","positive integer",t.create.pageHeight);if(i.defined(t.create.noise)){if(!i.object(t.create.noise))throw Error("Expected noise to be an object");if(t.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(s.createNoiseType=t.create.noise.type,!i.inRange(t.create.channels,1,4))throw i.invalidParameterError("create.channels","number between 1 and 4",t.create.channels);if(s.createNoiseMean=128,i.defined(t.create.noise.mean))if(i.number(t.create.noise.mean)&&i.inRange(t.create.noise.mean,0,1e4))s.createNoiseMean=t.create.noise.mean;else throw i.invalidParameterError("create.noise.mean","number between 0 and 10000",t.create.noise.mean);if(s.createNoiseSigma=30,i.defined(t.create.noise.sigma))if(i.number(t.create.noise.sigma)&&i.inRange(t.create.noise.sigma,0,1e4))s.createNoiseSigma=t.create.noise.sigma;else throw i.invalidParameterError("create.noise.sigma","number between 0 and 10000",t.create.noise.sigma)}else if(i.defined(t.create.background)){if(!i.inRange(t.create.channels,3,4))throw i.invalidParameterError("create.channels","number between 3 and 4",t.create.channels);s.createBackground=this._getBackgroundColourOption(t.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete s.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(i.defined(t.text))if(i.object(t.text)&&i.string(t.text.text)){if(s.textValue=t.text.text,i.defined(t.text.height)&&i.defined(t.text.dpi))throw Error("Expected only one of dpi or height");if(i.defined(t.text.font))if(i.string(t.text.font))s.textFont=t.text.font;else throw i.invalidParameterError("text.font","string",t.text.font);if(i.defined(t.text.fontfile))if(i.string(t.text.fontfile))s.textFontfile=t.text.fontfile;else throw i.invalidParameterError("text.fontfile","string",t.text.fontfile);if(i.defined(t.text.width))if(i.integer(t.text.width)&&i.inRange(t.text.width,1,1e6))s.textWidth=t.text.width;else throw i.invalidParameterError("text.width","integer between 1 and 1000000",t.text.width);if(i.defined(t.text.height))if(i.integer(t.text.height)&&i.inRange(t.text.height,1,1e6))s.textHeight=t.text.height;else throw i.invalidParameterError("text.height","integer between 1 and 1000000",t.text.height);if(i.defined(t.text.align))if(i.string(t.text.align)&&i.string(this.constructor.align[t.text.align]))s.textAlign=this.constructor.align[t.text.align];else throw i.invalidParameterError("text.align","valid alignment",t.text.align);if(i.defined(t.text.justify))if(i.bool(t.text.justify))s.textJustify=t.text.justify;else throw i.invalidParameterError("text.justify","boolean",t.text.justify);if(i.defined(t.text.dpi))if(i.integer(t.text.dpi)&&i.inRange(t.text.dpi,1,1e6))s.textDpi=t.text.dpi;else throw i.invalidParameterError("text.dpi","integer between 1 and 1000000",t.text.dpi);if(i.defined(t.text.rgba))if(i.bool(t.text.rgba))s.textRgba=t.text.rgba;else throw i.invalidParameterError("text.rgba","bool",t.text.rgba);if(i.defined(t.text.spacing))if(i.integer(t.text.spacing)&&i.inRange(t.text.spacing,-1e6,1e6))s.textSpacing=t.text.spacing;else throw i.invalidParameterError("text.spacing","integer between -1000000 and 1000000",t.text.spacing);if(i.defined(t.text.wrap))if(i.string(t.text.wrap)&&i.inArray(t.text.wrap,["word","char","word-char","none"]))s.textWrap=t.text.wrap;else throw i.invalidParameterError("text.wrap","one of: word, char, word-char, none",t.text.wrap);delete s.buffer}else throw Error("Expected a valid string to create an image with text.");if(i.defined(t.join))if(i.defined(this.options.join)){if(i.defined(t.join.animated))if(i.bool(t.join.animated))s.joinAnimated=t.join.animated;else throw i.invalidParameterError("join.animated","boolean",t.join.animated);if(i.defined(t.join.across))if(i.integer(t.join.across)&&i.inRange(t.join.across,1,1e6))s.joinAcross=t.join.across;else throw i.invalidParameterError("join.across","integer between 1 and 100000",t.join.across);if(i.defined(t.join.shim))if(i.integer(t.join.shim)&&i.inRange(t.join.shim,0,1e6))s.joinShim=t.join.shim;else throw i.invalidParameterError("join.shim","integer between 0 and 100000",t.join.shim);if(i.defined(t.join.background))s.joinBackground=this._getBackgroundColourOption(t.join.background);if(i.defined(t.join.halign))if(i.string(t.join.halign)&&i.string(this.constructor.align[t.join.halign]))s.joinHalign=this.constructor.align[t.join.halign];else throw i.invalidParameterError("join.halign","valid alignment",t.join.halign);if(i.defined(t.join.valign))if(i.string(t.join.valign)&&i.string(this.constructor.align[t.join.valign]))s.joinValign=this.constructor.align[t.join.valign];else throw i.invalidParameterError("join.valign","valid alignment",t.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(i.defined(t))throw Error(`Invalid input options ${t}`);return s}function Nl(r,t,n){if(Array.isArray(this.options.input.buffer))if(i.buffer(r))this.options.input.buffer.push(r),n();else n(Error("Non-Buffer data on Writable Stream"));else n(Error("Unexpected data on Writable Stream"))}function _l(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function ql(){return Array.isArray(this.options.input.buffer)}function Tl(r){if(this.writableFinished)r();else this.once("finish",r)}function Cl(r){let t=Error();if(i.fn(r)){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),y.metadata(this.options,(n,s)=>{if(n)r(i.nativeError(n,t));else r(null,s)})});else y.metadata(this.options,(n,s)=>{if(n)r(i.nativeError(n,t));else r(null,s)});return this}else if(this._isStreamInput())return new Promise((n,s)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),y.metadata(this.options,(a,o)=>{if(a)s(i.nativeError(a,t));else n(o)})})});else return new Promise((n,s)=>{y.metadata(this.options,(a,o)=>{if(a)s(i.nativeError(a,t));else n(o)})})}function Ml(r){let t=Error();if(i.fn(r)){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),y.stats(this.options,(n,s)=>{if(n)r(i.nativeError(n,t));else r(null,s)})});else y.stats(this.options,(n,s)=>{if(n)r(i.nativeError(n,t));else r(null,s)});return this}else if(this._isStreamInput())return new Promise((n,s)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),y.stats(this.options,(a,o)=>{if(a)s(i.nativeError(a,t));else n(o)})})});else return new Promise((n,s)=>{y.stats(this.options,(a,o)=>{if(a)s(i.nativeError(a,t));else n(o)})})}var Xi=(r)=>{Object.assign(r.prototype,{_inputOptionsFromObject:Vi,_createInputDescriptor:$l,_write:Nl,_flattenBufferIn:_l,_isStreamInput:ql,_whenStreamInFinished:Tl,metadata:Cl,stats:Ml}),r.align=Sl};/*!
19
+ Copyright 2013 Lovell Fuller and others.
20
+ SPDX-License-Identifier: Apache-2.0
21
+ */var Ji={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},Yi={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},Qi={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},Ki={entropy:16,attention:17},fr={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},Bl={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},Fl={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};function hr(r){return r.angle%360!==0||r.rotationAngle!==0}function De(r){return r.width!==-1||r.height!==-1}function Dl(r,t,n){if(De(this.options))this.options.debuglog("ignoring previous resize options");if(this.options.widthPost!==-1)this.options.debuglog("operation order will be: extract, resize, extract");if(i.defined(r))if(i.object(r)&&!i.defined(n))n=r;else if(i.integer(r)&&i.inRange(r,1,1e8))this.options.width=r;else throw i.invalidParameterError("width","positive integer between 1 and 100000000",r);else this.options.width=-1;if(i.defined(t))if(i.integer(t)&&i.inRange(t,1,1e8))this.options.height=t;else throw i.invalidParameterError("height","positive integer between 1 and 100000000",t);else this.options.height=-1;if(i.object(n)){if(i.defined(n.width))if(i.integer(n.width)&&i.inRange(n.width,1,1e8))this.options.width=n.width;else throw i.invalidParameterError("width","positive integer between 1 and 100000000",n.width);if(i.defined(n.height))if(i.integer(n.height)&&i.inRange(n.height,1,1e8))this.options.height=n.height;else throw i.invalidParameterError("height","positive integer between 1 and 100000000",n.height);if(i.defined(n.fit)){let s=Fl[n.fit];if(i.string(s))this.options.canvas=s;else throw i.invalidParameterError("fit","valid fit",n.fit)}if(i.defined(n.position)){let s=i.integer(n.position)?n.position:Ki[n.position]||Yi[n.position]||Ji[n.position];if(i.integer(s)&&(i.inRange(s,0,8)||i.inRange(s,16,17)))this.options.position=s;else throw i.invalidParameterError("position","valid position/gravity/strategy",n.position)}if(this._setBackgroundColourOption("resizeBackground",n.background),i.defined(n.kernel))if(i.string(fr[n.kernel]))this.options.kernel=fr[n.kernel];else throw i.invalidParameterError("kernel","valid kernel name",n.kernel);if(i.defined(n.withoutEnlargement))this._setBooleanOption("withoutEnlargement",n.withoutEnlargement);if(i.defined(n.withoutReduction))this._setBooleanOption("withoutReduction",n.withoutReduction);if(i.defined(n.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",n.fastShrinkOnLoad)}if(hr(this.options)&&De(this.options))this.options.rotateBefore=!0;return this}function Ol(r){if(i.integer(r))if(i.inRange(r,1,1e4))this.options.extendTop=r,this.options.extendBottom=r,this.options.extendLeft=r,this.options.extendRight=r;else throw i.invalidParameterError("extend","integer between 1 and 10000",r);else if(i.object(r)){if(i.defined(r.top))if(i.integer(r.top)&&i.inRange(r.top,0,1e4))this.options.extendTop=r.top;else throw i.invalidParameterError("top","integer between 0 and 10000",r.top);if(i.defined(r.bottom))if(i.integer(r.bottom)&&i.inRange(r.bottom,0,1e4))this.options.extendBottom=r.bottom;else throw i.invalidParameterError("bottom","integer between 0 and 10000",r.bottom);if(i.defined(r.left))if(i.integer(r.left)&&i.inRange(r.left,0,1e4))this.options.extendLeft=r.left;else throw i.invalidParameterError("left","integer between 0 and 10000",r.left);if(i.defined(r.right))if(i.integer(r.right)&&i.inRange(r.right,0,1e4))this.options.extendRight=r.right;else throw i.invalidParameterError("right","integer between 0 and 10000",r.right);if(this._setBackgroundColourOption("extendBackground",r.background),i.defined(r.extendWith))if(i.string(Qi[r.extendWith]))this.options.extendWith=Qi[r.extendWith];else throw i.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",r.extendWith)}else throw i.invalidParameterError("extend","integer or object",r);return this}function Gl(r){let t=De(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${t}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function(n){let s=r[n];if(i.integer(s)&&i.inRange(s,0,1e8))this.options[n+(n==="left"||n==="top"?"Offset":"")+t]=s;else throw i.invalidParameterError(n,"integer between 0 and 100000000",s)},this),hr(this.options)&&!De(this.options)){if(this.options.widthPre===-1||this.options.widthPost===-1)this.options.rotateBefore=!0}if(this.options.input.autoOrient)this.options.orientBefore=!0;return this}function zl(r){if(this.options.trimThreshold=10,i.defined(r))if(i.object(r)){if(i.defined(r.background))this._setBackgroundColourOption("trimBackground",r.background);if(i.defined(r.threshold))if(i.number(r.threshold)&&r.threshold>=0)this.options.trimThreshold=r.threshold;else throw i.invalidParameterError("threshold","positive number",r.threshold);if(i.defined(r.lineArt))this._setBooleanOption("trimLineArt",r.lineArt);if(i.defined(r.margin))if(i.integer(r.margin)&&i.inRange(r.margin,0,1e7))this.options.trimMargin=r.margin;else throw i.invalidParameterError("margin","integer between 0 and 10000000",r.margin)}else throw i.invalidParameterError("trim","object",r);if(hr(this.options))this.options.rotateBefore=!0;return this}var Zi=(r)=>{Object.assign(r.prototype,{resize:Dl,extend:Ol,extract:Gl,trim:zl}),r.gravity=Ji,r.strategy=Ki,r.kernel=fr,r.fit=Bl,r.position=Yi};/*!
22
+ Copyright 2013 Lovell Fuller and others.
23
+ SPDX-License-Identifier: Apache-2.0
24
+ */var ur={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"};function Ul(r){if(!Array.isArray(r))throw i.invalidParameterError("images to composite","array",r);return this.options.composite=r.map((t)=>{if(!i.object(t))throw i.invalidParameterError("image to composite","object",t);let n=this._inputOptionsFromObject(t),s={input:this._createInputDescriptor(t.input,n,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(i.defined(t.blend))if(i.string(ur[t.blend]))s.blend=ur[t.blend];else throw i.invalidParameterError("blend","valid blend name",t.blend);if(i.defined(t.tile))if(i.bool(t.tile))s.tile=t.tile;else throw i.invalidParameterError("tile","boolean",t.tile);if(i.defined(t.left))if(i.integer(t.left)&&i.inRange(t.left,-1e8,1e8))s.left=t.left;else throw i.invalidParameterError("left","integer between -100000000 and 100000000",t.left);if(i.defined(t.top))if(i.integer(t.top)&&i.inRange(t.top,-1e8,1e8))s.top=t.top;else throw i.invalidParameterError("top","integer between -100000000 and 100000000",t.top);if(i.defined(t.top)!==i.defined(t.left))throw Error("Expected both left and top to be set");else s.hasOffset=i.integer(t.top)&&i.integer(t.left);if(i.defined(t.gravity))if(i.integer(t.gravity)&&i.inRange(t.gravity,0,8))s.gravity=t.gravity;else if(i.string(t.gravity)&&i.integer(this.constructor.gravity[t.gravity]))s.gravity=this.constructor.gravity[t.gravity];else throw i.invalidParameterError("gravity","valid gravity",t.gravity);if(i.defined(t.premultiplied))if(i.bool(t.premultiplied))s.premultiplied=t.premultiplied;else throw i.invalidParameterError("premultiplied","boolean",t.premultiplied);return s}),this}var en=(r)=>{r.prototype.composite=Ul,r.blend=ur};/*!
25
+ Copyright 2013 Lovell Fuller and others.
26
+ SPDX-License-Identifier: Apache-2.0
27
+ */var rn={integer:"integer",float:"float",approximate:"approximate"};function Hl(r,t){if(!i.defined(r))return this.autoOrient();if(this.options.angle||this.options.rotationAngle)this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0;if(i.integer(r)&&!(r%90))this.options.angle=r;else if(i.number(r)){if(this.options.rotationAngle=r,i.object(t)&&t.background)this._setBackgroundColourOption("rotationBackground",t.background)}else throw i.invalidParameterError("angle","numeric",r);return this}function Wl(){return this.options.input.autoOrient=!0,this}function Vl(r){return this.options.flip=i.bool(r)?r:!0,this}function Xl(r){return this.options.flop=i.bool(r)?r:!0,this}function Ql(r,t){let s=Array.isArray(r)&&(r.length===4&&r.every(i.number)||r.length===2&&r.every((a)=>Array.isArray(a)&&a.length===2))?r.flat():[];if(s.length===4&&s.every(i.number))this.options.affineMatrix=s;else throw i.invalidParameterError("matrix","1x4 or 2x2 array",r);if(i.defined(t))if(i.object(t)){if(this._setBackgroundColourOption("affineBackground",t.background),i.defined(t.idx))if(i.number(t.idx))this.options.affineIdx=t.idx;else throw i.invalidParameterError("options.idx","number",t.idx);if(i.defined(t.idy))if(i.number(t.idy))this.options.affineIdy=t.idy;else throw i.invalidParameterError("options.idy","number",t.idy);if(i.defined(t.odx))if(i.number(t.odx))this.options.affineOdx=t.odx;else throw i.invalidParameterError("options.odx","number",t.odx);if(i.defined(t.ody))if(i.number(t.ody))this.options.affineOdy=t.ody;else throw i.invalidParameterError("options.ody","number",t.ody);if(i.defined(t.interpolator))if(i.inArray(t.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=t.interpolator;else throw i.invalidParameterError("options.interpolator","valid interpolator name",t.interpolator)}else throw i.invalidParameterError("options","object",t);return this}function Jl(r){if(i.plainObject(r)){if(i.number(r.sigma)&&i.inRange(r.sigma,0.000001,10))this.options.sharpenSigma=r.sigma;else throw i.invalidParameterError("options.sigma","number between 0.000001 and 10",r.sigma);if(i.defined(r.m1))if(i.number(r.m1)&&i.inRange(r.m1,0,1e6))this.options.sharpenM1=r.m1;else throw i.invalidParameterError("options.m1","number between 0 and 1000000",r.m1);if(i.defined(r.m2))if(i.number(r.m2)&&i.inRange(r.m2,0,1e6))this.options.sharpenM2=r.m2;else throw i.invalidParameterError("options.m2","number between 0 and 1000000",r.m2);if(i.defined(r.x1))if(i.number(r.x1)&&i.inRange(r.x1,0,1e6))this.options.sharpenX1=r.x1;else throw i.invalidParameterError("options.x1","number between 0 and 1000000",r.x1);if(i.defined(r.y2))if(i.number(r.y2)&&i.inRange(r.y2,0,1e6))this.options.sharpenY2=r.y2;else throw i.invalidParameterError("options.y2","number between 0 and 1000000",r.y2);if(i.defined(r.y3))if(i.number(r.y3)&&i.inRange(r.y3,0,1e6))this.options.sharpenY3=r.y3;else throw i.invalidParameterError("options.y3","number between 0 and 1000000",r.y3)}else this.options.sharpenSigma=-1;return this}function Yl(r){if(!i.defined(r))this.options.medianSize=3;else if(i.integer(r)&&i.inRange(r,1,1000))this.options.medianSize=r;else throw i.invalidParameterError("size","integer between 1 and 1000",r);return this}function Kl(r){let t;if(i.number(r))t=r;else if(i.plainObject(r)){if(!i.number(r.sigma))throw i.invalidParameterError("options.sigma","number between 0.3 and 1000",t);if(t=r.sigma,"precision"in r)if(i.string(rn[r.precision]))this.options.precision=rn[r.precision];else throw i.invalidParameterError("precision","one of: integer, float, approximate",r.precision);if("minAmplitude"in r)if(i.number(r.minAmplitude)&&i.inRange(r.minAmplitude,0.001,1))this.options.minAmpl=r.minAmplitude;else throw i.invalidParameterError("minAmplitude","number between 0.001 and 1",r.minAmplitude)}if(!i.defined(r))this.options.blurSigma=-1;else if(i.bool(r))this.options.blurSigma=r?-1:0;else if(i.number(t)&&i.inRange(t,0.3,1000))this.options.blurSigma=t;else throw i.invalidParameterError("sigma","number between 0.3 and 1000",t);return this}function Zl(r){if(!i.defined(r))this.options.dilateWidth=1;else if(i.integer(r)&&i.inRange(r,1,65536))this.options.dilateWidth=r;else throw i.invalidParameterError("width","integer between 1 and 65536",r);return this}function ec(r){if(!i.defined(r))this.options.erodeWidth=1;else if(i.integer(r)&&i.inRange(r,1,65536))this.options.erodeWidth=r;else throw i.invalidParameterError("width","integer between 1 and 65536",r);return this}function rc(r){if(this.options.flatten=i.bool(r)?r:!0,i.object(r))this._setBackgroundColourOption("flattenBackground",r.background);return this}function tc(){return this.options.unflatten=!0,this}function ic(r,t){if(!i.defined(r))this.options.gamma=2.2;else if(i.number(r)&&i.inRange(r,1,3))this.options.gamma=r;else throw i.invalidParameterError("gamma","number between 1.0 and 3.0",r);if(!i.defined(t))this.options.gammaOut=this.options.gamma;else if(i.number(t)&&i.inRange(t,1,3))this.options.gammaOut=t;else throw i.invalidParameterError("gammaOut","number between 1.0 and 3.0",t);return this}function nc(r){if(this.options.negate=i.bool(r)?r:!0,i.plainObject(r)&&"alpha"in r)if(!i.bool(r.alpha))throw i.invalidParameterError("alpha","should be boolean value",r.alpha);else this.options.negateAlpha=r.alpha;return this}function sc(r){if(i.plainObject(r)){if(i.defined(r.lower))if(i.number(r.lower)&&i.inRange(r.lower,0,99))this.options.normaliseLower=r.lower;else throw i.invalidParameterError("lower","number between 0 and 99",r.lower);if(i.defined(r.upper))if(i.number(r.upper)&&i.inRange(r.upper,1,100))this.options.normaliseUpper=r.upper;else throw i.invalidParameterError("upper","number between 1 and 100",r.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw i.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function ac(r){return this.normalise(r)}function oc(r){if(i.plainObject(r)){if(i.integer(r.width)&&i.inRange(r.width,1,65536))this.options.claheWidth=r.width;else throw i.invalidParameterError("width","integer between 1 and 65536",r.width);if(i.integer(r.height)&&i.inRange(r.height,1,65536))this.options.claheHeight=r.height;else throw i.invalidParameterError("height","integer between 1 and 65536",r.height);if(i.defined(r.maxSlope))if(i.integer(r.maxSlope)&&i.inRange(r.maxSlope,0,100))this.options.claheMaxSlope=r.maxSlope;else throw i.invalidParameterError("maxSlope","integer between 0 and 100",r.maxSlope)}else throw i.invalidParameterError("options","plain object",r);return this}function lc(r){if(!i.object(r)||!Array.isArray(r.kernel)||!i.integer(r.width)||!i.integer(r.height)||!i.inRange(r.width,3,1001)||!i.inRange(r.height,3,1001)||r.height*r.width!==r.kernel.length||!r.kernel.every(i.number))throw Error("Invalid convolution kernel");if(!i.integer(r.scale))r.scale=r.kernel.reduce((t,n)=>t+n,0);if(r.scale<1)r.scale=1;if(!i.integer(r.offset))r.offset=0;return this.options.convKernel=r,this}function cc(r,t){if(!i.defined(r))this.options.threshold=128;else if(i.bool(r))this.options.threshold=r?128:0;else if(i.integer(r)&&i.inRange(r,0,255))this.options.threshold=r;else throw i.invalidParameterError("threshold","integer between 0 and 255",r);if(!i.object(t)||t.greyscale===!0||t.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function fc(r,t,n){if(this.options.boolean=this._createInputDescriptor(r,n),i.string(t)&&i.inArray(t,["and","or","eor"]))this.options.booleanOp=t;else throw i.invalidParameterError("operator","one of: and, or, eor",t);return this}function hc(r,t){if(!i.defined(r)&&i.number(t))r=1;else if(i.number(r)&&!i.defined(t))t=0;if(!i.defined(r))this.options.linearA=[];else if(i.number(r))this.options.linearA=[r];else if(Array.isArray(r)&&r.length&&r.every(i.number))this.options.linearA=r;else throw i.invalidParameterError("a","number or array of numbers",r);if(!i.defined(t))this.options.linearB=[];else if(i.number(t))this.options.linearB=[t];else if(Array.isArray(t)&&t.length&&t.every(i.number))this.options.linearB=t;else throw i.invalidParameterError("b","number or array of numbers",t);if(this.options.linearA.length!==this.options.linearB.length)throw Error("Expected a and b to be arrays of the same length");return this}function uc(r){if(!Array.isArray(r))throw i.invalidParameterError("inputMatrix","array",r);let t=r.length;if(t!==3&&t!==4)throw i.invalidParameterError("inputMatrix","3x3 or 4x4 array",t);if(!r.every((s)=>Array.isArray(s)&&s.length===t))throw i.invalidParameterError("inputMatrix",`array of ${t} arrays of length ${t}`,r);let n=r.flat();if(!n.every(i.number))throw i.invalidParameterError("inputMatrix","array of numbers",n);return this.options.recombMatrix=n,this}function dc(r){if(!i.plainObject(r))throw i.invalidParameterError("options","plain object",r);if("brightness"in r)if(i.number(r.brightness)&&r.brightness>=0)this.options.brightness=r.brightness;else throw i.invalidParameterError("brightness","number above zero",r.brightness);if("saturation"in r)if(i.number(r.saturation)&&r.saturation>=0)this.options.saturation=r.saturation;else throw i.invalidParameterError("saturation","number above zero",r.saturation);if("hue"in r)if(i.integer(r.hue))this.options.hue=r.hue%360;else throw i.invalidParameterError("hue","number",r.hue);if("lightness"in r)if(i.number(r.lightness))this.options.lightness=r.lightness;else throw i.invalidParameterError("lightness","number",r.lightness);return this}var tn=(r)=>{Object.assign(r.prototype,{autoOrient:Wl,rotate:Hl,flip:Vl,flop:Xl,affine:Ql,sharpen:Jl,erode:ec,dilate:Zl,median:Yl,blur:Kl,flatten:rc,unflatten:tc,gamma:ic,negate:nc,normalise:sc,normalize:ac,clahe:oc,convolve:lc,threshold:cc,boolean:fc,linear:hc,recomb:uc,modulate:dc})};var dn=g(hn(),1);/*!
28
+ Copyright 2013 Lovell Fuller and others.
29
+ SPDX-License-Identifier: Apache-2.0
30
+ */var un={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};function qc(r){return this._setBackgroundColourOption("tint",r),this}function Tc(r){return this.options.greyscale=i.bool(r)?r:!0,this}function Cc(r){return this.greyscale(r)}function Mc(r){if(!i.string(r))throw i.invalidParameterError("colourspace","string",r);return this.options.colourspacePipeline=r,this}function Bc(r){return this.pipelineColourspace(r)}function Fc(r){if(!i.string(r))throw i.invalidParameterError("colourspace","string",r);return this.options.colourspace=r,this}function Dc(r){return this.toColourspace(r)}function mn(r){if(i.object(r)||i.string(r)&&r.length>=3&&r.length<=200){let t=dn.default(r),n=t.red(),s=t.green(),a=t.blue(),o=Math.round(t.alpha()*255);for(let[l,c]of[["red",n],["green",s],["blue",a],["alpha",o]])if(!i.number(c))throw i.invalidParameterError(`background.${l}`,"number",c);return[n,s,a,o]}else throw i.invalidParameterError("background","object or string",r)}function Oc(r,t){if(i.defined(t))this.options[r]=mn(t)}var gn=(r)=>{Object.assign(r.prototype,{tint:qc,greyscale:Tc,grayscale:Cc,pipelineColourspace:Mc,pipelineColorspace:Bc,toColourspace:Fc,toColorspace:Dc,_getBackgroundColourOption:mn,_setBackgroundColourOption:Oc}),r.colourspace=un,r.colorspace=un};/*!
31
+ Copyright 2013 Lovell Fuller and others.
32
+ SPDX-License-Identifier: Apache-2.0
33
+ */var Gc={and:"and",or:"or",eor:"eor"};function zc(){return this.options.removeAlpha=!0,this}function Uc(r){if(i.defined(r))if(i.number(r)&&i.inRange(r,0,1))this.options.ensureAlpha=r;else throw i.invalidParameterError("alpha","number between 0 and 1",r);else this.options.ensureAlpha=1;return this}function Hc(r){let t={red:0,green:1,blue:2,alpha:3};if(Object.keys(t).includes(r))r=t[r];if(i.integer(r)&&i.inRange(r,0,4))this.options.extractChannel=r;else throw i.invalidParameterError("channel","integer or one of: red, green, blue, alpha",r);return this}function Wc(r,t){if(Array.isArray(r))r.forEach(function(n){this.options.joinChannelIn.push(this._createInputDescriptor(n,t))},this);else this.options.joinChannelIn.push(this._createInputDescriptor(r,t));return this}function Vc(r){if(i.string(r)&&i.inArray(r,["and","or","eor"]))this.options.bandBoolOp=r;else throw i.invalidParameterError("boolOp","one of: and, or, eor",r);return this}var pn=(r)=>{Object.assign(r.prototype,{removeAlpha:zc,ensureAlpha:Uc,extractChannel:Hc,joinChannel:Wc,bandbool:Vc}),r.bool=Gc};import wr from"node:path";/*!
34
+ Copyright 2013 Lovell Fuller and others.
35
+ SPDX-License-Identifier: Apache-2.0
36
+ */var bn=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),Xc=/\.(jp[2x]|j2[kc])$/i,wn=()=>Error("JP2 output requires libvips with support for OpenJPEG"),vn=(r)=>1<<32-Math.clz32(Math.ceil(Math.log2(r))-1);function Qc(r,t){let n;if(!i.string(r))n=Error("Missing output file path");else if(i.string(this.options.input.file)&&wr.resolve(this.options.input.file)===wr.resolve(r))n=Error("Cannot use same file for input and output");else if(Xc.test(wr.extname(r))&&!this.constructor.format.jp2.output.file)n=wn();if(n)if(i.fn(t))t(n);else return Promise.reject(n);else{this.options.fileOut=r;let s=Error();return this._pipeline(t,s)}return this}function Jc(r,t){if(i.object(r))this._setBooleanOption("resolveWithObject",r.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let n=Error();return this._pipeline(i.fn(r)?r:t,n)}function Yc(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let r=Error();return this._pipeline(null,r)}function Kc(r){if(i.number(r)&&r>0)this.options.withMetadataDensity=r;else throw i.invalidParameterError("density","positive number",r);return this.keepExif()}function Zc(){return this.options.keepMetadata|=1,this}function ef(r){if(i.object(r))for(let[t,n]of Object.entries(r))if(i.object(n))for(let[s,a]of Object.entries(n))if(i.string(a))this.options.withExif[`exif-${t.toLowerCase()}-${s}`]=a;else throw i.invalidParameterError(`${t}.${s}`,"string",a);else throw i.invalidParameterError(t,"object",n);else throw i.invalidParameterError("exif","object",r);return this.options.withExifMerge=!1,this.keepExif()}function rf(r){return this.withExif(r),this.options.withExifMerge=!0,this}function tf(){return this.options.keepMetadata|=8,this}function nf(r,t){if(i.string(r))this.options.withIccProfile=r;else throw i.invalidParameterError("icc","string",r);if(this.keepIccProfile(),i.object(t)){if(i.defined(t.attach))if(i.bool(t.attach)){if(!t.attach)this.options.keepMetadata&=-9}else throw i.invalidParameterError("attach","boolean",t.attach)}return this}function sf(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function af(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function of(){return this.options.keepMetadata|=2,this}function lf(r){if(i.string(r)&&r.length>0)this.options.withXmp=r,this.options.keepMetadata|=2;else throw i.invalidParameterError("xmp","non-empty string",r);return this}function cf(){return this.options.keepMetadata|=31,this}function ff(r){if(this.keepMetadata(),this.withIccProfile("srgb"),i.object(r)){if(i.defined(r.orientation))if(i.integer(r.orientation)&&i.inRange(r.orientation,1,8))this.options.withMetadataOrientation=r.orientation;else throw i.invalidParameterError("orientation","integer between 1 and 8",r.orientation);if(i.defined(r.density))if(i.number(r.density)&&r.density>0)this.options.withMetadataDensity=r.density;else throw i.invalidParameterError("density","positive number",r.density);if(i.defined(r.icc))this.withIccProfile(r.icc);if(i.defined(r.exif))this.withExifMerge(r.exif)}return this}function hf(r,t){let n=bn.get((i.object(r)&&i.string(r.id)?r.id:r).toLowerCase());if(!n)throw i.invalidParameterError("format",`one of: ${[...bn.keys()].join(", ")}`,r);return this[n](t)}function uf(r){if(i.object(r)){if(i.defined(r.quality))if(i.integer(r.quality)&&i.inRange(r.quality,1,100))this.options.jpegQuality=r.quality;else throw i.invalidParameterError("quality","integer between 1 and 100",r.quality);if(i.defined(r.progressive))this._setBooleanOption("jpegProgressive",r.progressive);if(i.defined(r.chromaSubsampling))if(i.string(r.chromaSubsampling)&&i.inArray(r.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=r.chromaSubsampling;else throw i.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",r.chromaSubsampling);let t=i.bool(r.optimizeCoding)?r.optimizeCoding:r.optimiseCoding;if(i.defined(t))this._setBooleanOption("jpegOptimiseCoding",t);if(i.defined(r.mozjpeg))if(i.bool(r.mozjpeg)){if(r.mozjpeg)this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3}else throw i.invalidParameterError("mozjpeg","boolean",r.mozjpeg);let n=i.bool(r.trellisQuantization)?r.trellisQuantization:r.trellisQuantisation;if(i.defined(n))this._setBooleanOption("jpegTrellisQuantisation",n);if(i.defined(r.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",r.overshootDeringing);let s=i.bool(r.optimizeScans)?r.optimizeScans:r.optimiseScans;if(i.defined(s)){if(this._setBooleanOption("jpegOptimiseScans",s),s)this.options.jpegProgressive=!0}let a=i.number(r.quantizationTable)?r.quantizationTable:r.quantisationTable;if(i.defined(a))if(i.integer(a)&&i.inRange(a,0,8))this.options.jpegQuantisationTable=a;else throw i.invalidParameterError("quantisationTable","integer between 0 and 8",a)}return this._updateFormatOut("jpeg",r)}function df(r){if(i.object(r)){if(i.defined(r.progressive))this._setBooleanOption("pngProgressive",r.progressive);if(i.defined(r.compressionLevel))if(i.integer(r.compressionLevel)&&i.inRange(r.compressionLevel,0,9))this.options.pngCompressionLevel=r.compressionLevel;else throw i.invalidParameterError("compressionLevel","integer between 0 and 9",r.compressionLevel);if(i.defined(r.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",r.adaptiveFiltering);let t=r.colours||r.colors;if(i.defined(t))if(i.integer(t)&&i.inRange(t,2,256))this.options.pngBitdepth=vn(t);else throw i.invalidParameterError("colours","integer between 2 and 256",t);if(i.defined(r.palette))this._setBooleanOption("pngPalette",r.palette);else if([r.quality,r.effort,r.colours,r.colors,r.dither].some(i.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(i.defined(r.quality))if(i.integer(r.quality)&&i.inRange(r.quality,0,100))this.options.pngQuality=r.quality;else throw i.invalidParameterError("quality","integer between 0 and 100",r.quality);if(i.defined(r.effort))if(i.integer(r.effort)&&i.inRange(r.effort,1,10))this.options.pngEffort=r.effort;else throw i.invalidParameterError("effort","integer between 1 and 10",r.effort);if(i.defined(r.dither))if(i.number(r.dither)&&i.inRange(r.dither,0,1))this.options.pngDither=r.dither;else throw i.invalidParameterError("dither","number between 0.0 and 1.0",r.dither)}}return this._updateFormatOut("png",r)}function mf(r){if(i.object(r)){if(i.defined(r.quality))if(i.integer(r.quality)&&i.inRange(r.quality,1,100))this.options.webpQuality=r.quality;else throw i.invalidParameterError("quality","integer between 1 and 100",r.quality);if(i.defined(r.alphaQuality))if(i.integer(r.alphaQuality)&&i.inRange(r.alphaQuality,0,100))this.options.webpAlphaQuality=r.alphaQuality;else throw i.invalidParameterError("alphaQuality","integer between 0 and 100",r.alphaQuality);if(i.defined(r.lossless))this._setBooleanOption("webpLossless",r.lossless);if(i.defined(r.nearLossless))this._setBooleanOption("webpNearLossless",r.nearLossless);if(i.defined(r.smartSubsample))this._setBooleanOption("webpSmartSubsample",r.smartSubsample);if(i.defined(r.smartDeblock))this._setBooleanOption("webpSmartDeblock",r.smartDeblock);if(i.defined(r.preset))if(i.string(r.preset)&&i.inArray(r.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=r.preset;else throw i.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",r.preset);if(i.defined(r.effort))if(i.integer(r.effort)&&i.inRange(r.effort,0,6))this.options.webpEffort=r.effort;else throw i.invalidParameterError("effort","integer between 0 and 6",r.effort);if(i.defined(r.minSize))this._setBooleanOption("webpMinSize",r.minSize);if(i.defined(r.mixed))this._setBooleanOption("webpMixed",r.mixed);if(i.defined(r.exact))this._setBooleanOption("webpExact",r.exact)}return vr(r,this.options),this._updateFormatOut("webp",r)}function gf(r){if(i.object(r)){if(i.defined(r.reuse))this._setBooleanOption("gifReuse",r.reuse);if(i.defined(r.progressive))this._setBooleanOption("gifProgressive",r.progressive);let t=r.colours||r.colors;if(i.defined(t))if(i.integer(t)&&i.inRange(t,2,256))this.options.gifBitdepth=vn(t);else throw i.invalidParameterError("colours","integer between 2 and 256",t);if(i.defined(r.effort))if(i.integer(r.effort)&&i.inRange(r.effort,1,10))this.options.gifEffort=r.effort;else throw i.invalidParameterError("effort","integer between 1 and 10",r.effort);if(i.defined(r.dither))if(i.number(r.dither)&&i.inRange(r.dither,0,1))this.options.gifDither=r.dither;else throw i.invalidParameterError("dither","number between 0.0 and 1.0",r.dither);if(i.defined(r.interFrameMaxError))if(i.number(r.interFrameMaxError)&&i.inRange(r.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=r.interFrameMaxError;else throw i.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",r.interFrameMaxError);if(i.defined(r.interPaletteMaxError))if(i.number(r.interPaletteMaxError)&&i.inRange(r.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=r.interPaletteMaxError;else throw i.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",r.interPaletteMaxError);if(i.defined(r.keepDuplicateFrames))if(i.bool(r.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",r.keepDuplicateFrames);else throw i.invalidParameterError("keepDuplicateFrames","boolean",r.keepDuplicateFrames)}return vr(r,this.options),this._updateFormatOut("gif",r)}function pf(r){if(!this.constructor.format.jp2.output.buffer)throw wn();if(i.object(r)){if(i.defined(r.quality))if(i.integer(r.quality)&&i.inRange(r.quality,1,100))this.options.jp2Quality=r.quality;else throw i.invalidParameterError("quality","integer between 1 and 100",r.quality);if(i.defined(r.lossless))if(i.bool(r.lossless))this.options.jp2Lossless=r.lossless;else throw i.invalidParameterError("lossless","boolean",r.lossless);if(i.defined(r.tileWidth))if(i.integer(r.tileWidth)&&i.inRange(r.tileWidth,1,32768))this.options.jp2TileWidth=r.tileWidth;else throw i.invalidParameterError("tileWidth","integer between 1 and 32768",r.tileWidth);if(i.defined(r.tileHeight))if(i.integer(r.tileHeight)&&i.inRange(r.tileHeight,1,32768))this.options.jp2TileHeight=r.tileHeight;else throw i.invalidParameterError("tileHeight","integer between 1 and 32768",r.tileHeight);if(i.defined(r.chromaSubsampling))if(i.string(r.chromaSubsampling)&&i.inArray(r.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=r.chromaSubsampling;else throw i.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",r.chromaSubsampling)}return this._updateFormatOut("jp2",r)}function vr(r,t){if(i.object(r)&&i.defined(r.loop))if(i.integer(r.loop)&&i.inRange(r.loop,0,65535))t.loop=r.loop;else throw i.invalidParameterError("loop","integer between 0 and 65535",r.loop);if(i.object(r)&&i.defined(r.delay))if(i.integer(r.delay)&&i.inRange(r.delay,0,65535))t.delay=[r.delay];else if(Array.isArray(r.delay)&&r.delay.every(i.integer)&&r.delay.every((n)=>i.inRange(n,0,65535)))t.delay=r.delay;else throw i.invalidParameterError("delay","integer or an array of integers between 0 and 65535",r.delay)}function bf(r){if(i.object(r)){if(i.defined(r.quality))if(i.integer(r.quality)&&i.inRange(r.quality,1,100))this.options.tiffQuality=r.quality;else throw i.invalidParameterError("quality","integer between 1 and 100",r.quality);if(i.defined(r.bitdepth))if(i.integer(r.bitdepth)&&i.inArray(r.bitdepth,[1,2,4]))this.options.tiffBitdepth=r.bitdepth;else throw i.invalidParameterError("bitdepth","1, 2 or 4",r.bitdepth);if(i.defined(r.tile))this._setBooleanOption("tiffTile",r.tile);if(i.defined(r.tileWidth))if(i.integer(r.tileWidth)&&i.inRange(r.tileWidth,1,32768))this.options.tiffTileWidth=r.tileWidth;else throw i.invalidParameterError("tileWidth","integer between 1 and 32768",r.tileWidth);if(i.defined(r.tileHeight))if(i.integer(r.tileHeight)&&i.inRange(r.tileHeight,1,32768))this.options.tiffTileHeight=r.tileHeight;else throw i.invalidParameterError("tileHeight","integer between 1 and 32768",r.tileHeight);if(i.defined(r.miniswhite))this._setBooleanOption("tiffMiniswhite",r.miniswhite);if(i.defined(r.pyramid))this._setBooleanOption("tiffPyramid",r.pyramid);if(i.defined(r.xres))if(i.number(r.xres)&&i.inRange(r.xres,0.001,1e6))this.options.tiffXres=r.xres;else throw i.invalidParameterError("xres","number between 0.001 and 1000000",r.xres);if(i.defined(r.yres))if(i.number(r.yres)&&i.inRange(r.yres,0.001,1e6))this.options.tiffYres=r.yres;else throw i.invalidParameterError("yres","number between 0.001 and 1000000",r.yres);if(i.defined(r.compression))if(i.string(r.compression)&&i.inArray(r.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=r.compression;else throw i.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",r.compression);if(i.defined(r.bigtiff))this._setBooleanOption("tiffBigtiff",r.bigtiff);if(i.defined(r.predictor))if(i.string(r.predictor)&&i.inArray(r.predictor,["none","horizontal","float"]))this.options.tiffPredictor=r.predictor;else throw i.invalidParameterError("predictor","one of: none, horizontal, float",r.predictor);if(i.defined(r.resolutionUnit))if(i.string(r.resolutionUnit)&&i.inArray(r.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=r.resolutionUnit;else throw i.invalidParameterError("resolutionUnit","one of: inch, cm",r.resolutionUnit)}return this._updateFormatOut("tiff",r)}function wf(r){return this.heif({...r,compression:"av1"})}function vf(r){if(i.object(r)){if(i.string(r.compression)&&i.inArray(r.compression,["av1","hevc"]))this.options.heifCompression=r.compression;else throw i.invalidParameterError("compression","one of: av1, hevc",r.compression);if(i.defined(r.quality))if(i.integer(r.quality)&&i.inRange(r.quality,1,100))this.options.heifQuality=r.quality;else throw i.invalidParameterError("quality","integer between 1 and 100",r.quality);if(i.defined(r.lossless))if(i.bool(r.lossless))this.options.heifLossless=r.lossless;else throw i.invalidParameterError("lossless","boolean",r.lossless);if(i.defined(r.effort))if(i.integer(r.effort)&&i.inRange(r.effort,0,9))this.options.heifEffort=r.effort;else throw i.invalidParameterError("effort","integer between 0 and 9",r.effort);if(i.defined(r.chromaSubsampling))if(i.string(r.chromaSubsampling)&&i.inArray(r.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=r.chromaSubsampling;else throw i.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",r.chromaSubsampling);if(i.defined(r.bitdepth))if(i.integer(r.bitdepth)&&i.inArray(r.bitdepth,[8,10,12]))this.options.heifBitdepth=r.bitdepth;else throw i.invalidParameterError("bitdepth","8, 10 or 12",r.bitdepth);if(i.defined(r.tune))if(i.string(r.tune)&&i.inArray(r.tune,["auto","iq","psnr","ssim"]))if(this.options.heifLossless&&r.tune==="iq")this.options.heifTune="ssim";else this.options.heifTune=r.tune;else throw i.invalidParameterError("tune","one of: auto, iq, psnr, ssim",r.tune)}else throw i.invalidParameterError("options","Object",r);return this._updateFormatOut("heif",r)}function Ef(r){if(i.object(r)){if(i.defined(r.quality))if(i.integer(r.quality)&&i.inRange(r.quality,1,100))this.options.jxlDistance=r.quality>=30?0.1+(100-r.quality)*0.09:0.017666666666666667*r.quality*r.quality-1.15*r.quality+25;else throw i.invalidParameterError("quality","integer between 1 and 100",r.quality);else if(i.defined(r.distance))if(i.number(r.distance)&&i.inRange(r.distance,0,15))this.options.jxlDistance=r.distance;else throw i.invalidParameterError("distance","number between 0.0 and 15.0",r.distance);if(i.defined(r.decodingTier))if(i.integer(r.decodingTier)&&i.inRange(r.decodingTier,0,4))this.options.jxlDecodingTier=r.decodingTier;else throw i.invalidParameterError("decodingTier","integer between 0 and 4",r.decodingTier);if(i.defined(r.lossless))if(i.bool(r.lossless))this.options.jxlLossless=r.lossless;else throw i.invalidParameterError("lossless","boolean",r.lossless);if(i.defined(r.effort))if(i.integer(r.effort)&&i.inRange(r.effort,1,9))this.options.jxlEffort=r.effort;else throw i.invalidParameterError("effort","integer between 1 and 9",r.effort)}return vr(r,this.options),this._updateFormatOut("jxl",r)}function yf(r){if(i.object(r)){if(i.defined(r.depth))if(i.string(r.depth)&&i.inArray(r.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=r.depth;else throw i.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",r.depth)}return this._updateFormatOut("raw")}function xf(r){if(i.object(r)){if(i.defined(r.size))if(i.integer(r.size)&&i.inRange(r.size,1,8192))this.options.tileSize=r.size;else throw i.invalidParameterError("size","integer between 1 and 8192",r.size);if(i.defined(r.overlap))if(i.integer(r.overlap)&&i.inRange(r.overlap,0,8192)){if(r.overlap>this.options.tileSize)throw i.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,r.overlap);this.options.tileOverlap=r.overlap}else throw i.invalidParameterError("overlap","integer between 0 and 8192",r.overlap);if(i.defined(r.container))if(i.string(r.container)&&i.inArray(r.container,["fs","zip"]))this.options.tileContainer=r.container;else throw i.invalidParameterError("container","one of: fs, zip",r.container);if(i.defined(r.layout))if(i.string(r.layout)&&i.inArray(r.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=r.layout;else throw i.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",r.layout);if(i.defined(r.angle))if(i.integer(r.angle)&&!(r.angle%90))this.options.tileAngle=r.angle;else throw i.invalidParameterError("angle","positive/negative multiple of 90",r.angle);if(this._setBackgroundColourOption("tileBackground",r.background),i.defined(r.depth))if(i.string(r.depth)&&i.inArray(r.depth,["onepixel","onetile","one"]))this.options.tileDepth=r.depth;else throw i.invalidParameterError("depth","one of: onepixel, onetile, one",r.depth);if(i.defined(r.skipBlanks))if(i.integer(r.skipBlanks)&&i.inRange(r.skipBlanks,-1,65535))this.options.tileSkipBlanks=r.skipBlanks;else throw i.invalidParameterError("skipBlanks","integer between -1 and 255/65535",r.skipBlanks);else if(i.defined(r.layout)&&r.layout==="google")this.options.tileSkipBlanks=5;let t=i.bool(r.center)?r.center:r.centre;if(i.defined(t))this._setBooleanOption("tileCentre",t);if(i.defined(r.id))if(i.string(r.id))this.options.tileId=r.id;else throw i.invalidParameterError("id","string",r.id);if(i.defined(r.basename))if(i.string(r.basename))this.options.tileBasename=r.basename;else throw i.invalidParameterError("basename","string",r.basename)}if(i.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw i.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function Pf(r){if(!i.plainObject(r))throw i.invalidParameterError("options","object",r);if(i.integer(r.seconds)&&i.inRange(r.seconds,0,3600))this.options.timeoutSeconds=r.seconds;else throw i.invalidParameterError("seconds","integer between 0 and 3600",r.seconds);return this}function Rf(r,t){if(!(i.object(t)&&t.force===!1))this.options.formatOut=r;return this}function If(r,t){if(i.bool(t))this.options[r]=t;else throw i.invalidParameterError(r,"boolean",t)}function jf(){if(!this.options.streamOut){this.options.streamOut=!0;let r=Error();this._pipeline(void 0,r)}}function Af(r,t){if(typeof r==="function"){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),y.pipeline(this.options,(n,s,a)=>{if(n)r(i.nativeError(n,t));else r(null,s,a)})});else y.pipeline(this.options,(n,s,a)=>{if(n)r(i.nativeError(n,t));else r(null,s,a)});return this}else if(this.options.streamOut){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),y.pipeline(this.options,(n,s,a)=>{if(n)this.emit("error",i.nativeError(n,t));else this.emit("info",a),this.push(s);this.push(null),this.on("end",()=>this.emit("close"))})});else y.pipeline(this.options,(n,s,a)=>{if(n)this.emit("error",i.nativeError(n,t));else this.emit("info",a),this.push(s);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((n,s)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),y.pipeline(this.options,(a,o,l)=>{if(a)s(i.nativeError(a,t));else if(this.options.resolveWithObject)n({data:o,info:l});else n(o)})})});else return new Promise((n,s)=>{y.pipeline(this.options,(a,o,l)=>{if(a)s(i.nativeError(a,t));else if(this.options.resolveWithObject)n({data:o,info:l});else n(o)})})}var En=(r)=>{Object.assign(r.prototype,{toFile:Qc,toBuffer:Jc,toUint8Array:Yc,withDensity:Kc,keepExif:Zc,withExif:ef,withExifMerge:rf,keepIccProfile:tf,withIccProfile:nf,keepGainMap:sf,withGainMap:af,keepXmp:of,withXmp:lf,keepMetadata:cf,withMetadata:ff,toFormat:hf,jpeg:uf,jp2:pf,png:df,webp:mf,tiff:bf,avif:wf,heif:vf,jxl:Ef,gif:gf,raw:yf,tile:xf,timeout:Pf,_updateFormatOut:Rf,_setBooleanOption:If,_read:jf,_pipeline:Af})};var ye=g(Re(),1);import kf from"node:events";import{createRequire as Sf}from"node:module";import{availableParallelism as Lf}from"node:os";/*!
37
+ Copyright 2013 Lovell Fuller and others.
38
+ SPDX-License-Identifier: Apache-2.0
39
+ */var Er=Sf(import.meta.url),yn=Be.runtimePlatformArch(),yr=y.libvipsVersion(),Z=y.format();Z.heif.output.alias=["avif","heic"];Z.jpeg.output.alias=["jpe","jpg"];Z.tiff.output.alias=["tif"];Z.jp2.output.alias=["j2c","j2k","jp2","jpx"];var $f={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},ue={vips:yr.semver};if(!yr.isGlobal)if(!yr.isWasm)try{ue=Er(`@img/sharp-${yn}/versions`)}catch(r){try{ue=Er(`@img/sharp-libvips-${yn}/versions`)}catch(t){}}else try{ue=Er("@img/sharp-wasm32/versions")}catch(r){}ue.sharp=W.version;if(ue.heif&&Z.heif)Z.heif.input.fileSuffix=[".avif"],Z.heif.output.alias=["avif"];function xn(r){if(i.bool(r))if(r)return y.cache(50,20,100);else return y.cache(0,0,0);else if(i.object(r)){for(let t of["memory","files","items"]){let n=r[t];if(i.defined(n)&&!(i.integer(n)&&n>=0))throw i.invalidParameterError(t,"a positive integer",n)}return y.cache(r.memory,r.files,r.items)}else return y.cache()}xn(!0);function Nf(r){return y.concurrency(i.integer(r)?r:null)}if(!process.env.MALLOC_ARENA_MAX&&ye.default.familySync()===ye.default.GLIBC&&!y._isUsingJemalloc())y.concurrency(1);else if(ye.default.familySync()===ye.default.MUSL&&y.concurrency()===1024)y.concurrency(Lf());var _f=new kf.EventEmitter;function qf(){return y.counters()}function Tf(r){return y.simd(i.bool(r)?r:null)}function Cf(r){if(i.object(r))if(Array.isArray(r.operation)&&r.operation.every(i.string))y.block(r.operation,!0);else throw i.invalidParameterError("operation","Array<string>",r.operation);else throw i.invalidParameterError("options","object",r)}function Mf(r){if(i.object(r))if(Array.isArray(r.operation)&&r.operation.every(i.string))y.block(r.operation,!1);else throw i.invalidParameterError("operation","Array<string>",r.operation);else throw i.invalidParameterError("options","object",r)}var Pn=(r)=>{r.cache=xn,r.concurrency=Nf,r.counters=qf,r.simd=Tf,r.format=Z,r.interpolators=$f,r.versions=ue,r.queue=_f,r.block=Cf,r.unblock=Mf};/*!
40
+ Copyright 2013 Lovell Fuller and others.
41
+ SPDX-License-Identifier: Apache-2.0
42
+ */Xi(z);Zi(z);en(z);tn(z);gn(z);pn(z);En(z);Pn(z);var Nu=z;export{Nu as default};
43
+
44
+ //# debugId=391053DE4F9FEF0164756E2164756E21
45
+ //# sourceMappingURL=index-fnq44zdt.js.map