@elixir-playground/runtime 0.0.0-stage → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/LICENSE +73 -0
  2. package/NOTICE.md +43 -0
  3. package/chunks/ansi-styles-Bkz3XA_r.js +1 -0
  4. package/chunks/browser-iHf7-8M7.js +113 -0
  5. package/chunks/dist-0mSzsNc8.js +10 -0
  6. package/chunks/fs-GnBaZCKr.js +1 -0
  7. package/chunks/git-remote-Bb9EZlDN.js +16 -0
  8. package/chunks/lookup-NMT_UyaB.js +1 -0
  9. package/chunks/manifest-DOTdOkY7.js +2 -0
  10. package/chunks/preload-helper-DHhhL8Zf.js +1 -0
  11. package/chunks/semver-CK47NiDu.js +1 -0
  12. package/chunks/slice-ansi-CtePLJj8.js +1 -0
  13. package/chunks/string-width-Dyomz-Kx.js +1 -0
  14. package/chunks/strip-ansi-B9O1Kiar.js +1 -0
  15. package/chunks/wasi-BuobPCe8.js +1 -0
  16. package/chunks/wrap-ansi-v-UhTxgf.js +9 -0
  17. package/exec.html +10 -0
  18. package/files.js +2 -0
  19. package/frames/browser-C1G3It0R.js +682 -0
  20. package/frames/esbuild-DJd0QPVm.wasm +0 -0
  21. package/frames/exec-C4uIgAUX.js +1 -0
  22. package/frames/host-f4apmOAk.js +1959 -0
  23. package/frames/relay-CFTN70Gw.js +9 -0
  24. package/frames/site-Bq_qZN66.js +1 -0
  25. package/git.js +1 -0
  26. package/licenses/abort-controller-3.0.0/LICENSE +21 -0
  27. package/licenses/ansi-regex-6.4.0/license +9 -0
  28. package/licenses/ansi-styles-6.2.3/license +9 -0
  29. package/licenses/base64-js-1.5.1/LICENSE +21 -0
  30. package/licenses/buffer-6.0.3/LICENSE +21 -0
  31. package/licenses/elixir-playground-playground/LICENSE +73 -0
  32. package/licenses/elixir-playground-playground/NOTICE +11 -0
  33. package/licenses/esbuild-wasm-0.25.4/LICENSE.md +21 -0
  34. package/licenses/events-3.3.0/LICENSE +22 -0
  35. package/licenses/fflate-0.8.2/LICENSE +21 -0
  36. package/licenses/get-east-asian-width-1.7.0/license +9 -0
  37. package/licenses/ieee754-1.2.1/LICENSE +11 -0
  38. package/licenses/index.json +295 -0
  39. package/licenses/is-fullwidth-code-point-5.1.0/license +9 -0
  40. package/licenses/jridgewell_gen-mapping-0.3.13/LICENSE +19 -0
  41. package/licenses/jridgewell_resolve-uri-3.1.2/LICENSE +19 -0
  42. package/licenses/jridgewell_sourcemap-codec-1.6.0/LICENSE +19 -0
  43. package/licenses/jridgewell_trace-mapping-0.3.31/LICENSE +19 -0
  44. package/licenses/lines-and-columns-1.2.4/LICENSE +21 -0
  45. package/licenses/noble_hashes-2.0.1/LICENSE +21 -0
  46. package/licenses/readable-stream-4.7.0/LICENSE +47 -0
  47. package/licenses/safe-buffer-5.2.1/LICENSE +21 -0
  48. package/licenses/semver-7.7.3/LICENSE +15 -0
  49. package/licenses/slice-ansi-9.0.1/license +10 -0
  50. package/licenses/smol-toml-1.9.1/LICENSE +24 -0
  51. package/licenses/string-width-8.3.0/license +9 -0
  52. package/licenses/string_decoder-1.3.0/LICENSE +48 -0
  53. package/licenses/strip-ansi-7.2.0/license +9 -0
  54. package/licenses/sucrase-3.35.0/LICENSE +21 -0
  55. package/licenses/tailwindcss-4.3.3/LICENSE +21 -0
  56. package/licenses/ts-interface-checker-0.1.13/LICENSE +201 -0
  57. package/licenses/vite-8.3.4/LICENSE.md +2265 -0
  58. package/licenses/wrap-ansi-10.0.2/license +9 -0
  59. package/licenses/yaml-2.9.1/LICENSE +13 -0
  60. package/nodejs.js +181 -0
  61. package/package.json +56 -4
  62. package/relay.html +10 -0
  63. package/root/relay.html +30 -0
  64. package/root/sw.js +1 -0
  65. package/worker.js +15 -0
  66. package/README.md +0 -3
package/LICENSE ADDED
@@ -0,0 +1,73 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+
37
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
38
+
39
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
40
+
41
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
42
+
43
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
+
45
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
+
47
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
+
49
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
+
51
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
+
53
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
+
55
+ END OF TERMS AND CONDITIONS
56
+
57
+ APPENDIX: How to apply the Apache License to your work.
58
+
59
+ To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
60
+
61
+ Copyright [yyyy] [name of copyright owner]
62
+
63
+ Licensed under the Apache License, Version 2.0 (the "License");
64
+ you may not use this file except in compliance with the License.
65
+ You may obtain a copy of the License at
66
+
67
+ http://www.apache.org/licenses/LICENSE-2.0
68
+
69
+ Unless required by applicable law or agreed to in writing, software
70
+ distributed under the License is distributed on an "AS IS" BASIS,
71
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
72
+ See the License for the specific language governing permissions and
73
+ limitations under the License.
package/NOTICE.md ADDED
@@ -0,0 +1,43 @@
1
+ # @elixir-playground/runtime
2
+
3
+ Part of the Elixir Playground (https://github.com/SteffenDE/run-elixir.dev). Its files are under
4
+
5
+ Apache-2.0 AND BSD-3-Clause AND ISC AND MIT
6
+
7
+ each component under its own license, as listed here. `licenses/` has
8
+ their texts, and `licenses/index.json` lists them.
9
+
10
+ | Component | Version | License | Source |
11
+ | --- | --- | --- | --- |
12
+ | [@jridgewell/gen-mapping](https://github.com/jridgewell/sourcemaps/tree/main/packages/gen-mapping) | 0.3.13 | MIT | |
13
+ | [@jridgewell/resolve-uri](https://github.com/jridgewell/resolve-uri) | 3.1.2 | MIT | |
14
+ | [@jridgewell/sourcemap-codec](https://github.com/jridgewell/sourcemaps/tree/main/packages/sourcemap-codec) | 1.6.0 | MIT | |
15
+ | [@jridgewell/trace-mapping](https://github.com/jridgewell/sourcemaps/tree/main/packages/trace-mapping) | 0.3.31 | MIT | |
16
+ | [@noble/hashes](https://paulmillr.com/noble/) | 2.0.1 | MIT | |
17
+ | [abort-controller](https://github.com/mysticatea/abort-controller#readme) | 3.0.0 | MIT | |
18
+ | [ansi-regex](chalk/ansi-regex) | 6.4.0 | MIT | |
19
+ | [ansi-styles](chalk/ansi-styles) | 6.2.3 | MIT | |
20
+ | [base64-js](https://github.com/beatgammit/base64-js) | 1.5.1 | MIT | |
21
+ | [buffer](https://github.com/feross/buffer) | 6.0.3 | MIT | |
22
+ | [elixir-playground](https://github.com/SteffenDE/run-elixir.dev) | playground | Apache-2.0 | |
23
+ | [esbuild-wasm](https://github.com/evanw/esbuild) | 0.25.4 | MIT | |
24
+ | [events](git://github.com/Gozala/events) | 3.3.0 | MIT | |
25
+ | [fflate](https://101arrowz.github.io/fflate) | 0.8.2 | MIT | |
26
+ | [get-east-asian-width](sindresorhus/get-east-asian-width) | 1.7.0 | MIT | |
27
+ | [ieee754](git://github.com/feross/ieee754) | 1.2.1 | BSD-3-Clause | |
28
+ | [is-fullwidth-code-point](sindresorhus/is-fullwidth-code-point) | 5.1.0 | MIT | |
29
+ | [lines-and-columns](https://github.com/eventualbuddha/lines-and-columns#readme) | 1.2.4 | MIT | |
30
+ | [readable-stream](https://github.com/nodejs/readable-stream) | 4.7.0 | MIT | |
31
+ | [safe-buffer](https://github.com/feross/safe-buffer) | 5.2.1 | MIT | |
32
+ | [semver](https://github.com/npm/node-semver) | 7.7.3 | ISC | |
33
+ | [slice-ansi](chalk/slice-ansi) | 9.0.1 | MIT | |
34
+ | [smol-toml](github:squirrelchat/smol-toml) | 1.9.1 | BSD-3-Clause | |
35
+ | [string-width](sindresorhus/string-width) | 8.3.0 | MIT | |
36
+ | [string_decoder](https://github.com/nodejs/string_decoder) | 1.3.0 | MIT | |
37
+ | [strip-ansi](chalk/strip-ansi) | 7.2.0 | MIT | |
38
+ | [sucrase](https://github.com/alangpierce/sucrase) | 3.35.0 | MIT | |
39
+ | [tailwindcss](https://tailwindcss.com) | 4.3.3 | MIT | |
40
+ | [ts-interface-checker](https://github.com/gristlabs/ts-interface-checker) | 0.1.13 | Apache-2.0 | |
41
+ | [vite](https://vite.dev) | 8.3.4 | MIT | |
42
+ | [wrap-ansi](chalk/wrap-ansi) | 10.0.2 | MIT | |
43
+ | [yaml](https://eemeli.org/yaml/) | 2.9.1 | ISC | |
@@ -0,0 +1 @@
1
+ var e=(e=0)=>t=>`\u001B[${t+e}m`,t=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,n=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,r={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(r.modifier);var i=Object.keys(r.color),a=Object.keys(r.bgColor);[...i,...a];function o(){let i=new Map;for(let[e,t]of Object.entries(r)){for(let[e,n]of Object.entries(t))r[e]={open:`\u001B[${n[0]}m`,close:`\u001B[${n[1]}m`},t[e]=r[e],i.set(n[0],n[1]);Object.defineProperty(r,e,{value:t,enumerable:!1})}return Object.defineProperty(r,"codes",{value:i,enumerable:!1}),r.color.close=`\x1B[39m`,r.bgColor.close=`\x1B[49m`,r.color.ansi=e(),r.color.ansi256=t(),r.color.ansi16m=n(),r.bgColor.ansi=e(10),r.bgColor.ansi256=t(10),r.bgColor.ansi16m=n(10),Object.defineProperties(r,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>r.rgbToAnsi256(...r.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>r.ansi256ToAnsi(r.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>r.ansi256ToAnsi(r.hexToAnsi256(e)),enumerable:!1}}),r}var s=o();export{s as t};
@@ -0,0 +1,113 @@
1
+ import{n as e}from"../nodejs.js";var t=Symbol.for(`yaml.alias`),n=Symbol.for(`yaml.document`),r=Symbol.for(`yaml.map`),i=Symbol.for(`yaml.pair`),a=Symbol.for(`yaml.scalar`),o=Symbol.for(`yaml.seq`),s=Symbol.for(`yaml.node.type`),c=e=>!!e&&typeof e==`object`&&e[s]===t,l=e=>!!e&&typeof e==`object`&&e[s]===n,u=e=>!!e&&typeof e==`object`&&e[s]===r,d=e=>!!e&&typeof e==`object`&&e[s]===i,f=e=>!!e&&typeof e==`object`&&e[s]===a,p=e=>!!e&&typeof e==`object`&&e[s]===o;function m(e){if(e&&typeof e==`object`)switch(e[s]){case r:case o:return!0}return!1}function h(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a:case o:return!0}return!1}var g=e=>(f(e)||m(e))&&!!e.anchor,_=Symbol(`break visit`),v=Symbol(`skip children`),y=Symbol(`remove node`);function b(e,t){let n=ee(t);l(e)?x(null,e.contents,n,Object.freeze([e]))===y&&(e.contents=null):x(null,e,n,Object.freeze([]))}b.BREAK=_,b.SKIP=v,b.REMOVE=y;function x(e,t,n,r){let i=w(e,t,n,r);if(h(i)||d(i))return T(e,r,i),x(e,i,n,r);if(typeof i!=`symbol`){if(m(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=x(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===_)return _;else i===y&&(t.items.splice(e,1),--e)}}else if(d(t)){r=Object.freeze(r.concat(t));let e=x(`key`,t.key,n,r);if(e===_)return _;e===y&&(t.key=null);let i=x(`value`,t.value,n,r);if(i===_)return _;i===y&&(t.value=null)}}return i}async function S(e,t){let n=ee(t);l(e)?await C(null,e.contents,n,Object.freeze([e]))===y&&(e.contents=null):await C(null,e,n,Object.freeze([]))}S.BREAK=_,S.SKIP=v,S.REMOVE=y;async function C(e,t,n,r){let i=await w(e,t,n,r);if(h(i)||d(i))return T(e,r,i),C(e,i,n,r);if(typeof i!=`symbol`){if(m(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await C(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===_)return _;else i===y&&(t.items.splice(e,1),--e)}}else if(d(t)){r=Object.freeze(r.concat(t));let e=await C(`key`,t.key,n,r);if(e===_)return _;e===y&&(t.key=null);let i=await C(`value`,t.value,n,r);if(i===_)return _;i===y&&(t.value=null)}}return i}function ee(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function w(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(u(t))return n.Map?.(e,t,r);if(p(t))return n.Seq?.(e,t,r);if(d(t))return n.Pair?.(e,t,r);if(f(t))return n.Scalar?.(e,t,r);if(c(t))return n.Alias?.(e,t,r)}function T(e,t,n){let r=t[t.length-1];if(m(r))r.items[e]=n;else if(d(r))e===`key`?r.key=n:r.value=n;else if(l(r))r.contents=n;else{let e=c(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var te={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},ne=e=>e.replace(/[!,[\]{}]/g,e=>te[e]),E=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+ne(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&h(e.contents)){let t={};b(e.contents,(e,n)=>{h(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)(i!==`!!`||a!==`tag:yaml.org,2002:`)&&(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
2
+ `)}};E.defaultYaml={explicit:!1,version:`1.2`},E.defaultTags={"!!":`tag:yaml.org,2002:`};function re(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function ie(e){let t=new Set;return b(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function ae(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function oe(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=ie(e);let a=ae(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(f(t.node)||m(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function D(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=D(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=D(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=D(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=D(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function O(e,t,n){if(Array.isArray(e))return e.map((e,t)=>O(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!g(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var se=class{constructor(e){Object.defineProperty(this,s,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!l(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=O(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?D(i,{"":o},``,o):o}},k=class extends se{constructor(e){super(t),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],b(e,{Node:(e,t)=>{(c(t)||g(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(O(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=ce(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(re(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function ce(e,t,n){if(c(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(m(t)){let r=0;for(let i of t.items){let t=ce(e,i,n);t>r&&(r=t)}return r}if(d(t)){let r=ce(e,t.key,n),i=ce(e,t.value,n);return Math.max(r,i)}return 1}var le=e=>!e||typeof e!=`function`&&typeof e!=`object`,A=class extends se{constructor(e){super(a),this.value=e}toJSON(e,t){return t?.keep?this.value:O(this.value,e,t)}toString(){return String(this.value)}};A.BLOCK_FOLDED=`BLOCK_FOLDED`,A.BLOCK_LITERAL=`BLOCK_LITERAL`,A.PLAIN=`PLAIN`,A.QUOTE_DOUBLE=`QUOTE_DOUBLE`,A.QUOTE_SINGLE=`QUOTE_SINGLE`;var ue=`tag:yaml.org,2002:`;function de(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function j(e,t,n){if(l(e)&&(e=e.contents),h(e))return e;if(d(e)){let t=n.schema[r].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:i,onAnchor:a,onTagObj:s,schema:c,sourceObjects:u}=n,f;if(i&&e&&typeof e==`object`){if(f=u.get(e),f)return f.anchor??(f.anchor=a(e)),new k(f.anchor);f={anchor:null,node:null},u.set(e,f)}t?.startsWith(`!!`)&&(t=ue+t.slice(2));let p=de(e,t,c.tags);if(!p){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new A(e);return f&&(f.node=t),t}p=e instanceof Map?c[r]:Symbol.iterator in Object(e)?c[o]:c[r]}s&&(s(p),delete n.onTagObj);let m=p?.createNode?p.createNode(n.schema,e,n):typeof p?.nodeClass?.from==`function`?p.nodeClass.from(n.schema,e,n):new A(e);return t?m.tag=t:p.default||(m.tag=p.tag),f&&(f.node=m),m}function fe(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return j(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var M=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,pe=class extends se{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>h(t)||d(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(M(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(m(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,fe(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(m(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&f(i)?i.value:i:m(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!d(t))return!1;let n=t.value;return n==null||e&&f(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return m(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(m(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,fe(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},me=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function N(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var P=(e,t,n)=>e.endsWith(`
3
+ `)?N(n,t):n.includes(`
4
+ `)?`
5
+ `+N(n,t):(e.endsWith(` `)?``:` `)+n,he=`flow`,ge=`block`,_e=`quoted`;function ve(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=ye(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
6
+ `)n===`block`&&(h=ye(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
7
+ `&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
8
+ `&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function ye(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
9
+ `);r=t,i=t+1,a=e[i]}return r}var be=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),xe=e=>/^(%|---|\.\.\.)/m.test(e);function Se(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
10
+ `){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function Ce(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(xe(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
11
+
12
+ `;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
13
+ `,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:ve(o,a,_e,be(t,!1))}function we(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
14
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Ce(e,t);let n=t.indent||(xe(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:ve(r,n,he,be(t,!1))}function F(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=Ce;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?we:i&&!t?Ce:n?we:Ce}return r(e,t)}var Te;try{Te=RegExp(`(^|(?<!
15
+ ))
16
+ +(?!
17
+ |$)`,`g`)}catch{Te=/\n+(?!\n|$)/g}function Ee({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return F(n,r);let l=r.indent||(r.forceBlockIndent||xe(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===A.BLOCK_FOLDED?!1:t===A.BLOCK_LITERAL||!Se(n,c,l.length);if(!n)return u?`|
18
+ `:`>
19
+ `;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
20
+ `&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
21
+ `);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
22
+ `&&(p=p.slice(0,-1)),p.replace(Te,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
23
+ `)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
24
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=be(r,!0);o!==`folded`&&t!==A.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=ve(`${v}${e}${p}`,l,ge,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function De(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
25
+ `)||u&&/[[\]{},]/.test(a))return F(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
26
+ `)?F(a,t):Ee(e,t,n,r);if(!s&&!u&&i!==A.PLAIN&&a.includes(`
27
+ `))return Ee(e,t,n,r);if(xe(a)){if(c===``)return t.forceBlockIndent=!0,Ee(e,t,n,r);if(s&&c===l)return F(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return F(a,t)}return s?d:ve(d,c,he,be(t,!1))}function I(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==A.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=A.QUOTE_DOUBLE);let c=e=>{switch(e){case A.BLOCK_FOLDED:case A.BLOCK_LITERAL:return i||a?F(o.value,t):Ee(o,t,n,r);case A.QUOTE_DOUBLE:return Ce(o.value,t);case A.QUOTE_SINGLE:return we(o.value,t);case A.PLAIN:return De(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function Oe(e,t){let n=Object.assign({blockQuote:!0,commentString:me,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function ke(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(f(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function Ae(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(f(e)||m(e))&&e.anchor;a&&re(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function L(e,t,n,r){if(d(e))return e.toString(t,n,r);if(c(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=h(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=ke(t.doc.schema.tags,a);let o=Ae(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):f(a)?I(a,t,n,r):a.toString(t,n,r);return o?f(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function je({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,g=h(e)&&e.comment||null;if(d){if(g)throw Error(`With simple keys, key nodes cannot have comments`);if(m(e)||!h(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let _=!d&&(!e||g&&t==null&&!n.inFlow||m(e)||(f(e)?e.type===A.BLOCK_FOLDED||e.type===A.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!_&&(d||!a),indent:s+c});let v=!1,y=!1,b=L(e,n,()=>v=!0,()=>y=!0);if(!_&&!n.inFlow&&b.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);_=!0}if(n.inFlow){if(a||t==null)return v&&r&&r(),b===``?`?`:_?`? ${b}`:b}else if(a&&!d||t==null&&_)return b=`? ${b}`,g&&!v?b+=P(b,n.indent,l(g)):y&&i&&i(),b;v&&(g=null),_?(g&&(b+=P(b,n.indent,l(g))),b=`? ${b}\n${s}:`):(b=`${b}:`,g&&(b+=P(b,n.indent,l(g))));let x,S,C;h(t)?(x=!!t.spaceBefore,S=t.commentBefore,C=t.comment):(x=!1,S=null,C=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!_&&!g&&f(t)&&(n.indentAtStart=b.length+1),y=!1,!u&&c.length>=2&&!n.inFlow&&!_&&p(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let ee=!1,w=L(t,n,()=>ee=!0,()=>y=!0),T=` `;if(g||x||S){if(T=x?`
28
+ `:``,S){let e=l(S);T+=`\n${N(e,n.indent)}`}w===``&&!n.inFlow?T===`
29
+ `&&C&&(T=`
30
+
31
+ `):T+=`\n${n.indent}`}else if(!_&&m(t)){let e=w[0],r=w.indexOf(`
32
+ `),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=w.indexOf(` `);e===`&`&&n!==-1&&n<r&&w[n+1]===`!`&&(n=w.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(T=`\n${n.indent}`)}}else(w===``||w[0]===`
33
+ `)&&(T=``);return b+=T+w,n.inFlow?ee&&r&&r():C&&!ee?b+=P(b,n.indent,l(C)):y&&i&&i(),b}function Me(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var Ne=`<<`,R={identify:e=>e===Ne||typeof e==`symbol`&&e.description===Ne,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new A(Symbol(Ne)),{addToJSMap:Fe}),stringify:()=>Ne},Pe=(e,t)=>(R.identify(t)||f(t)&&(!t.type||t.type===A.PLAIN)&&R.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===R.tag&&e.default);function Fe(e,t,n){let r=Le(e,n);if(p(r))for(let n of r.items)Ie(e,t,n);else if(Array.isArray(r))for(let n of r)Ie(e,t,n);else Ie(e,t,r)}function Ie(e,t,n){let r=Le(e,n);if(!u(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function Le(e,t){return e&&c(t)?t.resolve(e.doc,e):t}function Re(e,t,{key:n,value:r}){if(h(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Pe(e,n))Fe(e,t,r);else{let i=O(n,``,e);if(t instanceof Map)t.set(i,O(r,i,e));else if(t instanceof Set)t.add(i);else{let a=ze(n,i,e),o=O(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function ze(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(h(e)&&n?.doc){let t=Oe(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),Me(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Be(e,t,n){return new z(j(e,void 0,n),j(t,void 0,n))}var z=class e{constructor(e,t=null){Object.defineProperty(this,s,{value:i}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return h(n)&&(n=n.clone(t)),h(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return Re(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?je(this,e,t,n):JSON.stringify(this)}};function Ve(e,t,n){return(t.inFlow??e.flow?Ue:He)(e,t,n)}function He({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),f=!1,p=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(h(i))!f&&i.spaceBefore&&p.push(``),We(n,p,i.commentBefore,f),i.comment&&(o=i.comment);else if(d(i)){let e=h(i.key)?i.key:null;e&&(!f&&e.spaceBefore&&p.push(``),We(n,p,e.commentBefore,f))}f=!1;let s=L(i,u,()=>o=null,()=>f=!0);o&&(s+=P(s,a,l(o))),f&&o&&(f=!1),p.push(r+s)}let m;if(p.length===0)m=i.start+i.end;else{m=p[0];for(let e=1;e<p.length;++e){let t=p[e];m+=t?`\n${c}${t}`:`
34
+ `}}return e?(m+=`
35
+ `+N(l(e),c),s&&s()):f&&o&&o(),m}function Ue({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,f=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(h(i))i.spaceBefore&&f.push(``),We(t,f,i.commentBefore,!1),i.comment&&(a=i.comment);else if(d(i)){let e=h(i.key)?i.key:null;e&&(e.spaceBefore&&f.push(``),We(t,f,e.commentBefore,!1),e.comment&&(l=!0));let n=h(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=L(i,c,()=>a=null);l||=f.length>u||o.includes(`
36
+ `),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=f.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=P(o,r,s(a))),f.push(o),u=f.length}let{start:p,end:m}=n;if(f.length===0)return p+m;if(!l){let e=f.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=p;for(let t of f)e+=t?`\n${a}${i}${t}`:`
37
+ `;return`${e}\n${i}${m}`}return`${p}${o}${f.join(` `)}${o}${m}`}function We({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=N(t(r),e);n.push(i.trimStart())}}function B(e,t){let n=f(t)?t.value:t;for(let r of e)if(d(r)&&(r.key===t||r.key===n||f(r.key)&&r.key.value===n))return r}var V=class extends pe{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(r,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(Be(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=d(e)?e:!e||typeof e!=`object`||!(`key`in e)?new z(e,e?.value):new z(e.key,e.value);let r=B(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);f(r.value)&&le(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=B(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=B(this.items,e)?.value;return(!t&&f(n)?n.value:n)??void 0}has(e){return!!B(this.items,e)}set(e,t){this.add(new z(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)Re(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!d(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Ve(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},H={collection:`map`,default:!0,nodeClass:V,tag:`tag:yaml.org,2002:map`,resolve(e,t){return u(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>V.from(e,t,n)},U=class extends pe{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(o,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Ge(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=Ge(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&f(r)?r.value:r}has(e){let t=Ge(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=Ge(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];f(r)&&le(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(O(e,String(r++),t));return n}toString(e,t,n){return e?Ve(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(j(a,void 0,n))}}return i}};function Ge(e){let t=f(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var W={collection:`seq`,default:!0,nodeClass:U,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return p(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>U.from(e,t,n)},Ke={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),I(e,t,n,r)}},qe={identify:e=>e==null,createNode:()=>new A(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new A(null),stringify:({source:e},t)=>typeof e==`string`&&qe.test.test(e)?e:t.options.nullStr},Je={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new A(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&Je.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function G({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var Ye={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:G},Xe={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():G(e)}},Ze={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new A(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:G},Qe=e=>typeof e==`bigint`||Number.isInteger(e),$e=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function et(e,t,n){let{value:r}=e;return Qe(r)&&r>=0?n+r.toString(t):G(e)}var tt={identify:e=>Qe(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>$e(e,2,8,n),stringify:e=>et(e,8,`0o`)},nt={identify:Qe,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>$e(e,0,10,n),stringify:G},rt={identify:e=>Qe(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>$e(e,2,16,n),stringify:e=>et(e,16,`0x`)},it=[H,W,Ke,qe,Je,tt,nt,rt,Ye,Xe,Ze];function at(e){return typeof e==`bigint`||Number.isInteger(e)}var ot=({value:e})=>JSON.stringify(e),st=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:ot},{identify:e=>e==null,createNode:()=>new A(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:ot},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:ot},{identify:at,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>at(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:ot}],ct=[H,W].concat(st,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),lt={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return``;let o=n,s;if(typeof btoa==`function`){let e=``;for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);s=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??=A.BLOCK_LITERAL,t!==A.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(s.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=s.substr(r,e);s=i.join(t===A.BLOCK_LITERAL?`
38
+ `:` `)}return I({comment:e,type:t,value:s},r,i,a)}};function ut(e,t){if(p(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!d(r)){if(u(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new z(new A(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=d(r)?r:new z(r)}}else t(`Expected a sequence for this tag`);return e}function dt(e,t,n){let{replacer:r}=n,i=new U(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(Be(o,s,n))}return i}var ft={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:ut,createNode:dt},pt=class e extends U{constructor(){super(),this.add=V.prototype.add.bind(this),this.delete=V.prototype.delete.bind(this),this.get=V.prototype.get.bind(this),this.has=V.prototype.has.bind(this),this.set=V.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(d(e)?(r=O(e.key,``,t),i=O(e.value,r,t)):r=O(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=dt(e,t,n),i=new this;return i.items=r.items,i}};pt.tag=`tag:yaml.org,2002:omap`;var mt={collection:`seq`,identify:e=>e instanceof Map,nodeClass:pt,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=ut(e,t),r=[];for(let{key:e}of n.items)f(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new pt,n)},createNode:(e,t,n)=>pt.from(e,t,n)};function ht({value:e,source:t},n){return t&&(e?gt:_t).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var gt={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new A(!0),stringify:ht},_t={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new A(!1),stringify:ht},vt={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:G},yt={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():G(e)}},bt={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new A(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:G},K=e=>typeof e==`bigint`||Number.isInteger(e);function xt(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function St(e,t,n){let{value:r}=e;if(K(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return G(e)}var Ct={identify:K,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>xt(e,2,2,n),stringify:e=>St(e,2,`0b`)},wt={identify:K,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>xt(e,1,8,n),stringify:e=>St(e,8,`0`)},Tt={identify:K,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>xt(e,0,10,n),stringify:G},Et={identify:K,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>xt(e,2,16,n),stringify:e=>St(e,16,`0x`)},Dt=class e extends V{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=d(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new z(e.key,null):new z(e,null),B(this.items,t.key)||this.items.push(t)}get(e,t){let n=B(this.items,e);return!t&&d(n)?f(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=B(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new z(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(Be(e,null,n));return i}};Dt.tag=`tag:yaml.org,2002:set`;var Ot={collection:`map`,identify:e=>e instanceof Set,nodeClass:Dt,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>Dt.from(e,t,n),resolve(e,t){if(u(e)){if(e.hasAllNullValues(!0))return Object.assign(new Dt,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function kt(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function At(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return G(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var jt={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>kt(e,n),stringify:At},Mt={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>kt(e,!1),stringify:At},Nt={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(Nt.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=kt(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},Pt=[H,W,Ke,qe,gt,_t,Ct,wt,Tt,Et,vt,yt,bt,lt,R,mt,ft,Ot,jt,Mt,Nt],Ft=new Map([[`core`,it],[`failsafe`,[H,W,Ke]],[`json`,ct],[`yaml11`,Pt],[`yaml-1.1`,Pt]]),It={binary:lt,bool:Je,float:Ze,floatExp:Xe,floatNaN:Ye,floatTime:Mt,int:nt,intHex:rt,intOct:tt,intTime:jt,map:H,merge:R,null:qe,omap:mt,pairs:ft,seq:W,set:Ot,timestamp:Nt},Lt={"tag:yaml.org,2002:binary":lt,"tag:yaml.org,2002:merge":R,"tag:yaml.org,2002:omap":mt,"tag:yaml.org,2002:pairs":ft,"tag:yaml.org,2002:set":Ot,"tag:yaml.org,2002:timestamp":Nt};function Rt(e,t,n){let r=Ft.get(t);if(r&&!e)return n&&!r.includes(R)?r.concat(R):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(Ft.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(R)),i.reduce((e,t)=>{let n=typeof t==`string`?It[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(It).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var zt=(e,t)=>e.key<t.key?-1:+(e.key>t.key),Bt=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:c,toStringDefaults:l}){this.compat=Array.isArray(e)?Rt(e,`compat`):e?Rt(null,e):null,this.name=typeof s==`string`&&s||`core`,this.knownTags=i?Lt:{},this.tags=Rt(t,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,r,{value:H}),Object.defineProperty(this,a,{value:Ke}),Object.defineProperty(this,o,{value:W}),this.sortMapEntries=typeof c==`function`?c:c===!0?zt:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function Vt(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=Oe(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(N(t,``))}let o=!1,s=null;if(e.contents){if(h(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(N(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=L(e.contents,i,()=>s=null,t);s&&(c+=P(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(L(e.contents,i));if(e.directives?.docEnd){if(e.comment){let t=a(e.comment);t.includes(`
39
+ `)?(n.push(`...`),n.push(N(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(N(a(t),``)))}return n.join(`
40
+ `)+`
41
+ `}var Ht=class e{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,s,{value:n});let i=null;typeof t==`function`||Array.isArray(t)?i=t:r===void 0&&t&&(r=t,t=void 0);let a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},r);this.options=a;let{version:o}=a;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new E({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,i,r)}clone(){let t=Object.create(e.prototype,{[s]:{value:n}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=h(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){q(this.contents)&&this.contents.add(e)}addIn(e,t){q(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=ie(this);e.anchor=!t||n.has(t)?ae(t||`a`,n):t}return new k(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=oe(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},h=j(e,l,p);return o&&m(h)&&(h.flow=!0),d(),h}createPair(e,t,n={}){return new z(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return q(this.contents)?this.contents.delete(e):!1}deleteIn(e){return M(e)?this.contents!=null&&(this.contents=null,!0):q(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return m(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return M(e)?!t&&f(this.contents)?this.contents.value:this.contents:m(this.contents)?this.contents.getIn(e,t):void 0}has(e){return m(this.contents)?this.contents.has(e):!1}hasIn(e){return M(e)?this.contents!==void 0:m(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=fe(this.schema,[e],t):q(this.contents)&&this.contents.set(e,t)}setIn(e,t){M(e)?this.contents=t:this.contents==null?this.contents=fe(this.schema,Array.from(e),t):q(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new E({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new E({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Bt(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=O(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?D(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return Vt(this,e)}};function q(e){if(m(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var Ut=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},J=class extends Ut{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},Wt=class extends Ut{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},Gt=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
42
+ `),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function Y(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function Kt(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
43
+ `))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(Kt(t.key)||Kt(t.value))return!0}return!1;default:return!0}}function qt(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&Kt(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function Jt(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||f(e)&&f(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var Yt=`All mapping items must start at the same column`;function Xt({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??V)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=Y(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,Yt)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
44
+ `+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||Kt(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,Yt);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&qt(r.indent,u,i),n.atKey=!1,Jt(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=Y(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&qt(r.indent,f,i),s=c.range[2];let l=new z(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
45
+ `+_.comment:g.comment=_.comment);let e=new z(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function Zt({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??U)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=Y(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&qt(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function Qt(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var $t=`Block collections are not allowed within flow collections`,en=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function tn({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?V:U))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:f,key:p,sep:m,value:h}=l,g=Y(f,{flow:s,indicator:`explicit-key-ind`,next:p??m?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!g.found){if(!g.anchor&&!g.tag&&!m&&!h){a===0&&g.comma?i(g.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(g.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),g.comment&&(c.comment?c.comment+=`
46
+ `+g.comment:c.comment=g.comment),u=g.end;continue}!o&&n.options.strict&&Kt(p)&&i(p,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)g.comma&&i(g.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(g.comma||i(g.start,`MISSING_CHAR`,`Missing , between ${s} items`),g.comment){let e=``;loop:for(let t of f)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];d(t)&&(t=t.value??t.key),t.comment?t.comment+=`
47
+ `+e:t.comment=e,g.comment=g.comment.substring(e.length+1)}}if(!o&&!m&&!g.found){let r=h?e(n,h,g,i):t(n,g.end,m,null,g,i);c.items.push(r),u=r.range[2],en(h)&&i(r.range,`BLOCK_IN_FLOW`,$t)}else{n.atKey=!0;let a=g.end,d=p?e(n,p,g,i):t(n,a,f,null,g,i);en(p)&&i(d.range,`BLOCK_IN_FLOW`,$t),n.atKey=!1;let _=Y(m??[],{flow:s,indicator:`map-value-ind`,next:h,offset:d.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!g.found&&n.options.strict){if(m)for(let e of m){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}g.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else h&&(`source`in h&&h.source?.[0]===`:`?i(h,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=h?e(n,h,_,i):_.found?t(n,_.end,m,null,_,i):null;v?en(h)&&i(v.range,`BLOCK_IN_FLOW`,$t):_.comment&&(d.comment?d.comment+=`
48
+ `+_.comment:d.comment=_.comment);let y=new z(d,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;Jt(n,e.items,d)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new V(n.schema);e.flow=!0,e.items.push(y);let t=(v??d).range;e.range=[d.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let f=o?`}`:`]`,[p,...m]=r.end,h=u;if(p?.source===f)h=p.offset+p.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${f}`:`${e} in block collection must be sufficiently indented and end with a ${f}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),p&&p.source.length!==1&&m.unshift(p)}if(m.length>0){let e=Qt(m,h,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
49
+ `+e.comment:c.comment=e.comment),c.range=[r.offset,h,e.offset]}else c.range=[r.offset,h,h];return c}function nn(e,t,n,r,i,a){let o=n.type===`block-map`?Xt(e,t,n,r,a):n.type===`block-seq`?Zt(e,t,n,r,a):tn(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function rn(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===V.tagName&&s===`map`||o===U.tagName&&s===`seq`)return nn(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),nn(e,t,n,i,o)}let l=nn(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=h(u)?u:new A(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function an(e,t,n){let r=t.offset,i=on(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?A.BLOCK_FOLDED:A.BLOCK_LITERAL,o=t.source?sn(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
50
+ `.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
51
+ `;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===A.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
52
+ `):t.length>c||r[0]===` `?(f===` `?f=`
53
+ `:!p&&f===`
54
+ `&&(f=`
55
+
56
+ `),d+=f+t.slice(c)+r,f=`
57
+ `,p=!0):r===``?f===`
58
+ `?d+=`
59
+ `:f=`
60
+ `:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
61
+ `+o[e][0].slice(c);d[d.length-1]!==`
62
+ `&&(d+=`
63
+ `);break;default:d+=`
64
+ `}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function on({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function sn(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function cn(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=A.PLAIN,c=ln(a,l);break;case`single-quoted-scalar`:s=A.QUOTE_SINGLE,c=un(a,l);break;case`double-quoted-scalar`:s=A.QUOTE_DOUBLE,c=fn(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=Qt(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function ln(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),dn(e)}function un(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),dn(e.slice(1,-1)).replace(/''/g,`'`)}function dn(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
65
+ `?a+=o:o=`
66
+ `:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function fn(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
67
+ `){if(i===`
68
+ `){let{fold:t,offset:i}=pn(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=mn[i];if(a)n+=a;else if(i===`
69
+ `)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
70
+ `)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=hn(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
71
+ `&&(a!==`\r`||e[r+2]!==`
72
+ `)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function pn(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
73
+ `||r===`\r`)&&(r!==`\r`||e[t+2]===`
74
+ `);)r===`
75
+ `&&(n+=`
76
+ `),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var mn={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
77
+ `,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function hn(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function gn(e,t,n,r){let{value:i,type:o,comment:s,range:c}=t.type===`block-scalar`?an(e,t,r):cn(t,e.options.strict,r),l=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,u;u=e.options.stringKeys&&e.atKey?e.schema[a]:l?_n(e.schema,i,l,n,r):t.type===`scalar`?vn(e,i,t,r):e.schema[a];let d;try{let a=u.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);d=f(a)?a:new A(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),d=new A(i)}return d.range=c,d.source=i,o&&(d.type=o),l&&(d.tag=l),u.format&&(d.format=u.format),s&&(d.comment=s),d}function _n(e,t,n,r,i){if(n===`!`)return e[a];let o=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)o.push(t);else return t}for(let e of o)if(e.test?.test(t))return e;let s=e.knownTags[n];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[a])}function vn({atKey:e,directives:t,schema:n},r,i,o){let s=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[a];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[a];s.tag!==e.tag&&o(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(s.tag)} or ${t.tagString(e.tag)}`,!0)}return s}function yn(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var bn={composeNode:xn,composeEmptyNode:Sn};function xn(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=Cn(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=gn(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=rn(bn,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=Sn(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!f(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function Sn(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=gn(e,{type:`scalar`,offset:yn(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function Cn({options:e},{offset:t,source:n,end:r},i){let a=new k(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=Qt(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function wn(e,t,{offset:n,start:r,value:i,end:a},o){let s=new Ht(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=Y(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?xn(c,i,l,o):Sn(c,l.end,r,null,l,o);let u=s.contents.range[2],d=Qt(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function Tn(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function En(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
78
+
79
+ `:`
80
+ `)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var Dn=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=Tn(e);r?this.warnings.push(new Wt(i,t,n)):this.errors.push(new J(i,t,n))},this.directives=new E({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=En(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(m(i)&&!i.flow&&i.items.length>0){let e=i.items[0];d(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:En(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=Tn(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=wn(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new J(Tn(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new J(Tn(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=Qt(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new J(Tn(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new Ht(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}};function On(e,t=!0,n){if(e){let r=(e,t,r)=>{let i=typeof e==`number`?e:Array.isArray(e)?e[0]:e.offset;if(n)n(i,t,r);else throw new J([i,i+1],t,r)};switch(e.type){case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return cn(e,t,r);case`block-scalar`:return an({options:{strict:t}},e,r)}}return null}function kn(e,t){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:a=-1,type:o=`PLAIN`}=t,s=I({type:o,value:e},{implicitKey:n,indent:r>0?` `.repeat(r):``,inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:`newline`,offset:-1,indent:r,source:`
81
+ `}];switch(s[0]){case`|`:case`>`:{let e=s.indexOf(`
82
+ `),t=s.substring(0,e),n=s.substring(e+1)+`
83
+ `,i=[{type:`block-scalar-header`,offset:a,indent:r,source:t}];return Mn(i,c)||i.push({type:`newline`,offset:-1,indent:r,source:`
84
+ `}),{type:`block-scalar`,offset:a,indent:r,props:i,source:n}}case`"`:return{type:`double-quoted-scalar`,offset:a,indent:r,source:s,end:c};case`'`:return{type:`single-quoted-scalar`,offset:a,indent:r,source:s,end:c};default:return{type:`scalar`,offset:a,indent:r,source:s,end:c}}}function An(e,t,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:a=!1,type:o}=n,s=`indent`in e?e.indent:null;if(r&&typeof s==`number`&&(s+=2),!o)switch(e.type){case`single-quoted-scalar`:o=`QUOTE_SINGLE`;break;case`double-quoted-scalar`:o=`QUOTE_DOUBLE`;break;case`block-scalar`:{let t=e.props[0];if(t.type!==`block-scalar-header`)throw Error(`Invalid block scalar header`);o=t.source[0]===`>`?`BLOCK_FOLDED`:`BLOCK_LITERAL`;break}default:o=`PLAIN`}let c=I({type:o,value:t},{implicitKey:i||s===null,indent:s!==null&&s>0?` `.repeat(s):``,inFlow:a,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case`|`:case`>`:jn(e,c);break;case`"`:Nn(e,c,`double-quoted-scalar`);break;case`'`:Nn(e,c,`single-quoted-scalar`);break;default:Nn(e,c,`scalar`)}}function jn(e,t){let n=t.indexOf(`
85
+ `),r=t.substring(0,n),i=t.substring(n+1)+`
86
+ `;if(e.type===`block-scalar`){let t=e.props[0];if(t.type!==`block-scalar-header`)throw Error(`Invalid block scalar header`);t.source=r,e.source=i}else{let{offset:t}=e,n=`indent`in e?e.indent:-1,a=[{type:`block-scalar-header`,offset:t,indent:n,source:r}];Mn(a,`end`in e?e.end:void 0)||a.push({type:`newline`,offset:-1,indent:n,source:`
87
+ `});for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:`block-scalar`,indent:n,props:a,source:i})}}function Mn(e,t){if(t)for(let n of t)switch(n.type){case`space`:case`comment`:e.push(n);break;case`newline`:return e.push(n),!0}return!1}function Nn(e,t,n){switch(e.type){case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:e.type=n,e.source=t;break;case`block-scalar`:{let r=e.props.slice(1),i=t.length;e.props[0].type===`block-scalar-header`&&(i-=e.props[0].source.length);for(let e of r)e.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case`block-map`:case`block-seq`:{let r={type:`newline`,offset:e.offset+t.length,indent:e.indent,source:`
88
+ `};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let r=`indent`in e?e.indent:-1,i=`end`in e&&Array.isArray(e.end)?e.end.filter(e=>e.type===`space`||e.type===`comment`||e.type===`newline`):[];for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}var Pn=e=>`type`in e?Fn(e):In(e);function Fn(e){switch(e.type){case`block-scalar`:{let t=``;for(let n of e.props)t+=Fn(n);return t+e.source}case`block-map`:case`block-seq`:{let t=``;for(let n of e.items)t+=In(n);return t}case`flow-collection`:{let t=e.start.source;for(let n of e.items)t+=In(n);for(let n of e.end)t+=n.source;return t}case`document`:{let t=In(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if(`end`in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function In({start:e,key:t,sep:n,value:r}){let i=``;for(let t of e)i+=t.source;if(t&&(i+=Fn(t)),n)for(let e of n)i+=e.source;return r&&(i+=Fn(r)),i}var Ln=Symbol(`break visit`),Rn=Symbol(`skip children`),zn=Symbol(`remove item`);function X(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),Bn(Object.freeze([]),e,t)}X.BREAK=Ln,X.SKIP=Rn,X.REMOVE=zn,X.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},X.parentCollection=(e,t)=>{let n=X.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function Bn(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=Bn(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===Ln)return Ln;else r===zn&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}var Vn=e({BOM:()=>``,DOCUMENT:()=>``,FLOW_END:()=>``,SCALAR:()=>``,createScalarToken:()=>kn,isCollection:()=>Hn,isScalar:()=>Un,prettyToken:()=>Wn,resolveAsScalar:()=>On,setScalarValue:()=>An,stringify:()=>Pn,tokenType:()=>Gn,visit:()=>X}),Hn=e=>!!e&&`items`in e,Un=e=>!!e&&(e.type===`scalar`||e.type===`single-quoted-scalar`||e.type===`double-quoted-scalar`||e.type===`block-scalar`);function Wn(e){switch(e){case``:return`<BOM>`;case``:return`<DOC>`;case``:return`<FLOW_END>`;case``:return`<SCALAR>`;default:return JSON.stringify(e)}}function Gn(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
89
+ `:case`\r
90
+ `:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function Z(e){switch(e){case void 0:case` `:case`
91
+ `:case`\r`:case` `:return!0;default:return!1}}var Kn=new Set(`0123456789ABCDEFabcdef`),qn=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),Jn=new Set(`,[]{}`),Yn=new Set(` ,[]{}
92
+ \r `),Xn=e=>!e||Yn.has(e),Zn=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
93
+ `||t===`\r`&&this.buffer[e+1]===`
94
+ `}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
95
+ `||!t&&!this.atEnd)return e+n+1}return t===`
96
+ `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&Z(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
97
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&Z(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Z(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&Z(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(Xn),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&Z(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(Xn),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||Z(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
98
+ `,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
99
+ `,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>Z(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
100
+ `:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
101
+ `)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
102
+ `,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
103
+ `;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
104
+ `&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(Z(r)||e&&Jn.has(r))break;t=n}else if(Z(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
105
+ `?(n+=1,r=`
106
+ `,i=this.buffer[n+1]):t=n),i===`#`||e&&Jn.has(i))break;if(r===`
107
+ `){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&Jn.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(Xn),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(Z(n)||t&&Jn.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!Z(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(qn.has(t))t=this.buffer[++e];else if(t===`%`&&Kn.has(this.buffer[e+1])&&Kn.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
108
+ `?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
109
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},Qn=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function Q(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function $n(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function er(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function tr(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function $(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function nr(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function rr(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!Q(t.start,`explicit-key-ind`)&&!Q(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,er(t.value)?t.value.end?nr(t.value.end,t.sep):t.value.end=t.sep:nr(t.start,t.sep),delete t.sep)}var ir=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new Zn,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Gn(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source})}else{if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&rr(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&$n(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:$n(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=$(tr(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
110
+ `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
111
+ `,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){nr(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(Q(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=$(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Q(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(er(t.key)&&!Q(t.sep,`newline`)){let e=$(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):Q(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!Q(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){nr(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||Q(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=$(tr(t));rr(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
112
+ `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
113
+ `,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=$(tr(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=$(tr(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function ar(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Qn||null,prettyErrors:t}}function or(e,t={}){let{lineCounter:n,prettyErrors:r}=ar(t),i=new ir(n?.addNewLine),a=new Dn(t),o=Array.from(a.compose(i.parse(e)));if(r&&n)for(let t of o)t.errors.forEach(Gt(e,n)),t.warnings.forEach(Gt(e,n));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function sr(e,t={}){let{lineCounter:n,prettyErrors:r}=ar(t),i=new ir(n?.addNewLine),a=new Dn(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new J(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Gt(e,n)),o.warnings.forEach(Gt(e,n))),o}function cr(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=sr(e,n);if(!i)return null;if(i.warnings.forEach(e=>Me(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function lr(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return l(e)&&!r?e.toString(n):new Ht(e,r,n).toString(n)}var ur=e({Alias:()=>k,CST:()=>Vn,Composer:()=>Dn,Document:()=>Ht,Lexer:()=>Zn,LineCounter:()=>Qn,Pair:()=>z,Parser:()=>ir,Scalar:()=>A,Schema:()=>Bt,YAMLError:()=>Ut,YAMLMap:()=>V,YAMLParseError:()=>J,YAMLSeq:()=>U,YAMLWarning:()=>Wt,isAlias:()=>c,isCollection:()=>m,isDocument:()=>l,isMap:()=>u,isNode:()=>h,isPair:()=>d,isScalar:()=>f,isSeq:()=>p,parse:()=>cr,parseAllDocuments:()=>or,parseDocument:()=>sr,stringify:()=>lr,visit:()=>b,visitAsync:()=>S});export{k as Alias,Vn as CST,Dn as Composer,Ht as Document,Zn as Lexer,Qn as LineCounter,z as Pair,ir as Parser,A as Scalar,Bt as Schema,Ut as YAMLError,V as YAMLMap,J as YAMLParseError,U as YAMLSeq,Wt as YAMLWarning,ur as default,c as isAlias,m as isCollection,l as isDocument,u as isMap,h as isNode,d as isPair,f as isScalar,p as isSeq,cr as parse,or as parseAllDocuments,sr as parseDocument,lr as stringify,b as visit,S as visitAsync};
@@ -0,0 +1,10 @@
1
+ function e(e,t){let n=e.slice(0,t).split(/\r?\n/);return[n.length,n.pop().length+1]}function t(e,t,n){let r=e.split(/\r?\n/),i=``,a=(Math.log10(t+1)|0)+1;for(let e=t-1;e<=t+1;e++){let o=r[e-1];o&&(i+=e.toString().padEnd(a,` `),i+=`: `,i+=o,i+=`
2
+ `,e===t&&(i+=` `.repeat(a+n+2),i+=`^
3
+ `))}return i}var n=class n extends Error{line;column;codeblock;constructor(n,r){let[i,a]=e(r.toml,r.ptr),o=t(r.toml,i,a);super(`Invalid TOML document: ${n}\n\n${o}`,r),this.line=i,this.column=a,this.codeblock=o}static x(e,t,r){throw new n(e,{toml:t.s,ptr:r??t.p})}};function r(e){let t=e.p,r=e.s.charCodeAt(e.p++),i=r,a=r===39,o=r===e.s.charCodeAt(e.p)&&r===e.s.charCodeAt(e.p+1);o&&((r=e.s.charCodeAt(e.p+=2))===10?e.p++:r===13&&e.s.charCodeAt(e.p+1)===10&&(e.p+=2));let s=``,c=e.p,l=0;for(;e.p<e.s.length;e.p++)if(r=e.s.charCodeAt(e.p),o&&(r===10||r===13&&e.s.charCodeAt(e.p+1)===10))l&&=3;else if(r<32&&r!==9||r===127)n.x(`control characters are not allowed in strings`,e);else if((!l||l===3)&&r===i&&(!o||e.s.charCodeAt(e.p+1)===i&&e.s.charCodeAt(e.p+2)===i)){if(o&&(e.s.charCodeAt(e.p+3)===i&&e.p++,e.s.charCodeAt(e.p+3)===i&&e.p++),!l){let t=e.s.slice(c,e.p);s=s?s+t:t}return e.p+=o?3:1,s}else if(!l)!a&&r===92&&(s+=e.s.slice(c,c=e.p),l=1);else if(l===1){if(r===120||r===117||r===85){let t=e.p++-1,i=0,a=r===120?2:r===117?4:8;for(let t=0;t<a;t++,e.p++){let t=e.s.charCodeAt(e.p),r=t>=48&&t<=57?t-48:t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:-1;r<0&&n.x(`invalid non-hex character in unicode escape`,e),i=i<<4|r}(i<0||i>1114111||i>=55296&&i<=57343)&&n.x(`invalid unicode escape`,e,t),s+=String.fromCodePoint(i),c=e.p--,l=0}else o&&(r===32||r===9)?l=2:(r===98?s+=`\b`:r===116?s+=` `:r===110?s+=`
4
+ `:r===102?s+=`\f`:r===114?s+=`\r`:r===101?s+=`\x1B`:r===34?s+=`"`:r===92?s+=`\\`:n.x(`unrecognised escape sequence`,e),c=e.p+1,l=0)}else r!==32&&r!==9&&(l===2&&n.x(`invalid escape: only line-ending whitespace may be escaped`,e,c),l=+(!a&&r===92),c=e.p);n.x(`unfinished string`,e,t)}var i=/^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[-+]\d{2}:\d{2})?$/i,a=class e extends Date{#e=!1;#t=!1;#n=null;constructor(e,t,n){let r=!0,a=!0,o=`Z`,s;if(typeof e==`string`){if(t)prep:{if(t<3){if(+e.slice(11,13)>23){e=``;break prep}t===2?(o=null,e+=`Z`):(s=e.charCodeAt(e.length-1))!==90&&s!==122&&(o=e.slice(e.length-6)),n&&(e=e.slice(0,10)+`T`+e.slice(11))}else t===4&&(e=+e.slice(0,2)>23?``:`0000-01-01T${e}Z`);r=t!==4,a=t!==3}else{let t=e.match(i);t?(t[1]||(r=!1,e=`0000-01-01T${e}`),a=!!t[2],a&&e[10]===` `&&(e=e.replace(` `,`T`)),t[2]&&+t[2]>23?e=``:(o=t[3]||null,!o&&a&&(e+=`Z`))):e=``}}super(e),isNaN(this.getTime())||(this.#e=r,this.#t=a,this.#n=o)}isDateTime(){return this.#e&&this.#t}isLocal(){return!this.#e||!this.#t||!this.#n}isDate(){return this.#e&&!this.#t}isTime(){return this.#t&&!this.#e}isValid(){return this.#e||this.#t}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#n===null)return e.slice(0,-1);if(this.#n===`Z`||this.#n===`z`)return e;let t=this.#n.slice(1,3)*60+ +this.#n.slice(4,6);return t=this.#n[0]===`-`?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#n}static wrapAsOffsetDateTime(t,n=`Z`){let r=new e(t);return r.#n=n,r}static wrapAsLocalDateTime(t){let n=new e(t);return n.#n=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#t=!1,n.#n=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#e=!1,n.#n=null,n}};function o(e,t=10){return t===16?e>47&&e<58||e>64&&e<71||e>96&&e<103:e>47&&e<48+t}function s(e,t){return e===32||e===9||e===10||e===13||t&&(e===t||e===44)||e===35}function c(e,t){let i=e.p,a=e.s.charCodeAt(e.p);if(a===91||a===123){e.d--||n.x(`document contains excessively nested structures. aborting.`,e);let t=a===91?y(e):v(e);return e.d++,t}return a===34||a===39?r(e):a===116?((e.s.charCodeAt(++e.p)!==114||e.s.charCodeAt(++e.p)!==117||e.s.charCodeAt(++e.p)!==101)&&n.x(`invalid value`,e,i),e.p++,!0):a===102?((e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==108||e.s.charCodeAt(++e.p)!==115||e.s.charCodeAt(++e.p)!==101)&&n.x(`invalid value`,e,i),e.p++,!1):a===43||a===45?l(e,e.p,e.s.charCodeAt(++e.p),44-a,t):e.s.charCodeAt(e.p+4)===45&&e.s.charCodeAt(e.p+7)===45?f(e,a,t):e.s.charCodeAt(e.p+2)===58?p(e,a,t):l(e,e.p,a,0,t)}function l(e,t,r,i,a){let c=r,l=0,f=!1;if(c===105)return(e.s.charCodeAt(++e.p)!==110||e.s.charCodeAt(++e.p)!==102)&&n.x(`invalid value`,e,t),e.p++,(i||1)/0;if(c===110)return(e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==110)&&n.x(`invalid value`,e,t),e.p++,NaN;if(c===48){if(++e.p>=e.s.length||s(c=e.s.charCodeAt(e.p),a))return e.bi===!0?0n:0;if(!i){if(c===120)return u(e,t,16,a);if(c===98)return u(e,t,2,a);if(c===111)return u(e,t,8,a)}c===46?l=2:c===101||c===69?l=4:n.x(`illegal leading zero`,e,t)}else o(c)||n.x(`invalid value`,e,t);for(;++e.p<e.s.length&&(c=e.s.charCodeAt(e.p),!s(c,a));)l||=1,c===95?(l&1||n.x(`illegal underscore`,e),l+=11,f=!0):l===1&&c===46?l=2:(l===1||l===3)&&(c===101||c===69)?l=4:l===4&&(c===43||c===45)?l=6:o(c)?l>9?l-=11:l&1||l++:n.x(`illegal character in numeric literal`,e);if(!l){let t=(r-48)*(i||1);return e.bi===!0?BigInt(t):t}l&1||n.x(`unfinished numeric value`,e,t);let p=e.s.slice(t,e.p);return f&&(p=p.replaceAll(`_`,``)),l>1?parseFloat(p):d(e,p,10,t)}function u(e,t,r,i){let a,c=1;for(;++e.p<e.s.length&&(a=e.s.charCodeAt(e.p),!s(a,i));)a===95?(c&1&&n.x(`illegal underscore`,e),c=3):o(a,r)?c&1&&c--:n.x(`illegal character in numeric literal`,e);c&1&&n.x(`unfinished numeric value`,e);let l=e.s.slice(t+2,e.p);return c&&(l=l.replaceAll(`_`,``)),d(e,l,r,t)}function d(e,t,r,i){if(e.bi!==!0)int:{let a=parseInt(t,r);if(!Number.isSafeInteger(a)){if(e.bi)break int;n.x(`integer value cannot be represented losslessly`,e,i)}return a}return BigInt(r===10?t:(r===2?`0b`:r===8?`0o`:`0x`)+t)}function f(e,t,r){let i=e.p++,a;if(!o(t)||!o(e.s.charCodeAt(e.p++))||!o(e.s.charCodeAt(e.p++))||!o(e.s.charCodeAt(e.p++)))return l(e,e.p=i,t,0,r);if(e.p+=5,o(e.s.charCodeAt(e.p++))||n.x(`invalid date-time: date part is malformed`,e,i),e.p>=e.s.length||((t=e.s.charCodeAt(e.p))!==32||(a=!0,!o(e.s.charCodeAt(e.p+1))))&&t!==84&&t!==116)return m(e,e.s.slice(i,e.p),3,!1,i);if(e.s.charCodeAt(e.p+=3)!==58&&n.x(`invalid date-time: time part is malformed`,e,i),e.s.charCodeAt(e.p+=3)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;o(e.s.charCodeAt(++e.p)););if(t=e.s.charCodeAt(e.p)){if(t===90||t===122)return m(e,e.s.slice(i,++e.p),1,a,i,`[+00:00]`);if(t===43||t===45)return m(e,e.s.slice(i,e.p+=6),1,a,i,!e.ld&&`[`+e.s.slice(e.p-6,e.p)+`]`)}return m(e,e.s.slice(i,e.p),2,a,i)}function p(e,t,n){let r=e.p;if(!o(t)||!o(e.s.charCodeAt(++e.p)))return l(e,--e.p,t,0,n);if(e.s.charCodeAt(e.p+=4)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;o(e.s.charCodeAt(++e.p)););return m(e,e.s.slice(r,e.p),4,!1,r)}function m(e,t,r,i,o,s){if(e.ld){let s=new a(t,r,i);return s.isValid()||n.x(`invalid date`,e,o),s}try{switch(s&&(t+=s),r){case 1:return Temporal.ZonedDateTime.from(t);case 2:return Temporal.PlainDateTime.from(t);case 3:return Temporal.PlainDate.from(t);case 4:return Temporal.PlainTime.from(t)}}catch(t){n.x(t instanceof Error?t.message:``+t,e,o)}}function h(e){for(;e.p<e.s.length;e.p++){let t=e.s.charCodeAt(e.p);if(t===10)break;if(t===13&&e.s.charCodeAt(e.p+1)===10){e.p++;break}(t<32&&t!==9||t===127)&&n.x(`control characters are not allowed in comments`,e)}}function g(e,t,n){let r;for(;e.p<e.s.length;){for(;e.p<e.s.length&&((r=e.s.charCodeAt(e.p))===32||r===9||!t&&(r===10||r===13&&e.s.charCodeAt(e.p+1)===10));)e.p++;if(n||r!==35)break;h(e)}}function _(e,t=61){let i,a=0,o=[],s,c=e.s.charCodeAt(i=e.p);do if(c===t)return a||n.x(`unexpected end of key`,e),a===1&&o.push(e.s.slice(s,e.p)),e.p++,o;else c===46?(a||n.x(`illegal empty bare key`,e),a===1&&o.push(e.s.slice(s,e.p)),a=0):!a&&(c===34||c===39)?(c===e.s.charCodeAt(e.p+1)&&c===e.s.charCodeAt(e.p+2)&&n.x(`illegal quoted key: multiline strings are not allowed`,e),o.push(r(e)),a=2,e.p--):c===32||c===9?a===1&&(o.push(e.s.slice(s,e.p)),a=2):a===2||c<48&&c!==45||c>57&&c<65||c>90&&c<97&&c!==95||c>122?n.x(`illegal character in key`,e):a||(a=1,s=e.p);while(c=e.s.charCodeAt(++e.p));n.x(`incomplete key-value: cannot find end of key`,e,i)}function v(e){let t=e.p++,r=Object.create(null),i=new Set,a;for(;e.p<e.s.length;){if(g(e),(a=e.s.charCodeAt(e.p))===125)return e.p++,r;let t,o=r,s=!1,l=e.p,u=_(e);for(let r=0;r<u.length;r++){r&&(o=s?o[t]:o[t]=Object.create(null)),t=u[r],(s=Object.hasOwn(o,t))&&(typeof o[t]!=`object`||i.has(o[t]))&&n.x(`trying to redefine an already defined value`,e,l);let a=t===`__proto__`;if(e.uk&&(a||t===`constructor`)){o=e.uk!==1&&n.x(`document contains an unsafe property`,e,l);break}!s&&a&&Object.defineProperty(o,t,{enumerable:!0,configurable:!0,writable:!0})}s&&n.x(`trying to redefine an already defined value`,e,l),g(e,!0,!0);let d=c(e,125);if(o&&typeof(o[t]=d)==`object`&&i.add(d),g(e),(a=e.s.charCodeAt(e.p++))===125)return r;a!==44&&n.x(`expected comma or end of structure`,e,e.p-1)}n.x(`unfinished table`,e,t)}function y(e){let t=e.p++,r=[],i;for(;e.p<e.s.length;){if(g(e),(i=e.s.charCodeAt(e.p))===93)return e.p++,r;if(r.push(c(e,93)),g(e),(i=e.s.charCodeAt(e.p++))===93)return r;i!==44&&n.x(`expected comma or end of structure`,e,e.p-1)}n.x(`unfinished array`,e,t)}function b(e,t,n,r,i){let a=n,o=r,s,c=!1,l;for(let n=0;n<t.length;n++){if(n){if(a=c?a[s]:a[s]=Object.create(null),o=(l=o[s]).c,i===0&&(l.t===1||l.t===2))return null;if(l.t===2){let e=a.length-1;a=a[e],o=o[e].c}}if(s=t[n],(c=Object.hasOwn(a,s))&&o[s]?.t===0&&o[s]?.d)return null;if(!c){let r=s===`__proto__`;if(e.uk&&(r||s===`constructor`))return!1;r&&(Object.defineProperty(a,s,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(o,s,{enumerable:!0,configurable:!0,writable:!0})),o[s]={t:n<t.length-1&&i===2?3:i,d:!1,i:0,c:Object.create(null)}}}if(l=o[s],l.t!==i&&(i!==1||l.t!==3)||(i===2&&(l.d||(l.d=!0,a[s]=[]),a[s].push(a=Object.create(null)),l.c[l.i++]=l={t:1,d:!1,i:0,c:Object.create(null)}),l.d))return null;if(l.d=!0,i===1)a=c?a[s]:a[s]=Object.create(null);else if(i===0&&c)return null;return[s,a,l.c]}function x(e,t,r){(t===null||e.uk===2)&&n.x(t===null?`trying to redefine an already defined table or value`:`document contains an unsafe property`,e,r)}function S(e,t={}){let r={s:e,p:0,d:t.maxDepth??1e3,bi:t.integersAsBigInt??!1,ld:t.useLegacyDate??!0,uk:t.unsafeKeyBehaviour===`throw`?2:+(t.unsafeKeyBehaviour===`drop`)},i=Object.create(null),a=Object.create(null),o,s=!1,l=i,u=a;for(e.charCodeAt(0)===65279&&r.p++,g(r);r.p<e.length;){if(e.charCodeAt(r.p)===91){let t=e.charCodeAt(++r.p)===91;o=r.p+=+t,s=!1;let c=_(r,93);t&&(e.charCodeAt(r.p)!==93&&n.x(`expected end of table array declaration`,r),r.p++);let d=b(r,c,i,a,t?2:1);d?(u=d[2],l=d[1]):(x(r,d,o),s=!0)}else{o=r.p;let e=b(r,_(r),l,u,0);!e&&!s&&x(r,e,o),g(r,!0,!0);let t=c(r,void 0);e&&!s&&(e[1][e[0]]=t)}g(r,!0),r.p<e.length&&(o=e.charCodeAt(r.p))!==10&&(o!==13||e.charCodeAt(r.p+1)!==10)&&n.x(`each key-value declaration must be followed by an end-of-line`,r),g(r)}return i}var C=/^[a-z0-9-_]+$/i,w=!!``.isWellFormed;function T(e){let t=typeof e;if(t===`object`){if(Array.isArray(e))return`array`;if(typeof e.getUTCDate==`function`&&e instanceof Date)return`date`;if(globalThis.Temporal){if(e.until){if(e instanceof Temporal.ZonedDateTime)return`temporal/tz+uc`;if(e instanceof Temporal.PlainDateTime||e instanceof Temporal.PlainDate)return`temporal/uc`;if(e instanceof Temporal.PlainTime||e instanceof Temporal.Instant)return`temporal`;if(e instanceof Temporal.PlainYearMonth)return`temporal/x`}else if(e.toPlainDate&&e instanceof Temporal.PlainMonthDay||e.negated&&e instanceof Temporal.Duration)return`temporal/x`}}return t}function E(e){for(let t=0;t<e.length;t++)if(T(e[t])!==`object`)return!1;return e.length!=0}function D(e){return JSON.stringify(e).replaceAll(``,`\\u007f`)}function O(e){return D(w?e.toWellFormed():e)}function k(e){if(C.test(e))return e;if(w&&!e.isWellFormed())throw RangeError(`key contains illegal lone surrogates`);return D(e)}function A(e,t,n,r,i){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);switch(t){case`number`:if(isNaN(e))return`nan`;if(e===1/0)return`inf`;if(e===-1/0)return`-inf`;if(Number.isInteger(e)&&(r||!Number.isSafeInteger(e)))return e.toFixed(1);case`bigint`:case`boolean`:case`temporal`:return e.toString();case`string`:return O(e);case`date`:if(isNaN(e.getTime()))throw TypeError(`cannot serialize invalid date`);return e.toISOString();case`object`:return j(e,n,r,i);case`array`:return M(e,n,r,i);case`temporal/tz+uc`:if(i){let t=e.timeZoneId,n=t.charCodeAt(0);if(n!==43&&n!==45&&(n!==85&&n!==71&&n!==90&&n!==69||t!==`UTC`&&t!==`UCT`&&t!==`Universal`&&t!==`Zulu`&&!t.startsWith(`GMT`)&&t!==`Greenwich`&&!t.startsWith(`Etc/`)))throw TypeError(`Temporal objects with an IANA timezone are not allowed in Temporal strict mode`)}case`temporal/uc`:if(i&&e.calendarId!==`iso8601`)throw TypeError(`Temporal objects with a non-default calendar are not allowed in Temporal strict mode`);return e.toString({calendarName:`never`,timeZoneName:`never`});case`temporal/x`:throw TypeError(`Unsupported `+e[Symbol.toStringTag])}}function j(e,t,n,r){let i=Object.keys(e);if(i.length===0)return`{}`;let a=`{ `;for(let o=0;o<i.length;o++){let s=i[o];o&&(a+=`, `),a+=k(s)+` = `+A(e[s],T(e[s]),t-1,n,r)}return a+` }`}function M(e,t,n,r){if(e.length===0)return`[]`;let i=`[ `;for(let a=0;a<e.length;a++){if(a&&(i+=`, `),e[a]===null||e[a]===void 0)throw TypeError(`arrays cannot contain null or undefined values`);i+=A(e[a],T(e[a]),t-1,n,r)}return i+` ]`}function N(e,t,n,r,i){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let a=``;for(let o=0;o<e.length;o++)a+=`${a&&`
5
+ `}[[${t}]]\n`,a+=P(0,e[o],t,n,r,i);return a}function P(e,t,n,r,i,a){if(r===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let o=``,s=``,c=Object.keys(t);for(let e=0;e<c.length;e++){let l=c[e];if(t[l]!==null&&t[l]!==void 0){let e=T(t[l]);if(e===`symbol`||e===`function`)throw TypeError(`cannot serialize values of type '${e}'`);let c=k(l);if(e===`array`&&E(t[l]))s+=(s&&`
6
+ `)+N(t[l],n?`${n}.${c}`:c,r-1,i,a);else if(e===`object`){let e=n?`${n}.${c}`:c;s+=(s&&`
7
+ `)+P(e,t[l],e,r-1,i,a)}else o+=c,o+=` = `,o+=A(t[l],e,r,i,a),o+=`
8
+ `}}return e&&(o||!s)&&(o=o?`[${e}]\n${o}`:`[${e}]`),o&&s?`${o}\n${s}`:o||s}function F(e,{maxDepth:t=1e3,numbersAsFloat:n=!1,strictTemporal:r=!1}={}){if(T(e)!==`object`)throw TypeError(`stringify can only be called with an object`);let i=P(0,e,``,t,n,r);return i[i.length-1]===`
9
+ `?i:i+`
10
+ `}var I={parse:S,stringify:F,TomlDate:a,TomlError:n};export{a as TomlDate,n as TomlError,I as default,S as parse,F as stringify};
@@ -0,0 +1 @@
1
+ var e={SUCCESS:0,ACCES:2,ADDRINUSE:3,AGAIN:6,CONNREFUSED:14,BADF:8,CHILD:12,EXIST:20,INVAL:28,IO:29,ISDIR:31,LOOP:32,NOENT:44,NOSYS:52,NOTDIR:54,NOTEMPTY:55,NOTSUP:58,PERM:63,PIPE:64,SPIPE:70,SRCH:71,XDEV:75},t={CHAR:2,DIR:3,REG:4,SYMLINK:7},n={CREAT:1,DIRECTORY:2,EXCL:4,TRUNC:8},r={APPEND:1},i=1,a=()=>BigInt(Date.now())*1000000n,o=class{constructor(e=new Uint8Array){this.ino=BigInt(i++),this.data=e,this.size=e.length,this.mtime=a()}reserve(e){if(e>this.data.length){let t=new Uint8Array(Math.max(e,this.data.length*2,4096));t.set(this.data.subarray(0,this.size)),this.data=t}}truncate(e){this.reserve(e),e>this.size&&this.data.fill(0,this.size,e),this.size=e,this.mtime=a()}get bytes(){return this.data.subarray(0,this.size)}};function s(e,t){for(let[n,r,i,a]of e){let e=t.put(n,new o);e.size=r,e.source=n,e.bundle=a,i&&(e.mtime=BigInt(i)*1000000000n)}}function c(e,t){e.source&&=(e.data=t(e.source,e.bundle),e.size=e.data.length,null)}function l(e){for(let t=0;;t++){let n=0;try{let t=new XMLHttpRequest;if(t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(),n=t.status,n===200)return new Uint8Array(t.response)}catch{}if(t===3||n>=400&&n<500)throw Error(`${e.pathname}: ${n||`network error`}`);u(500*2**t)}}function u(e){typeof SharedArrayBuffer<`u`&&Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)}function d(e){let t=new Map,n=new Set;return(r,i)=>{if(!t.has(r)&&!n.has(i)){let r=e(i);n.add(i);for(let{name:e,type:n,body:i}of v(r))n===`0`&&t.set(e,i)}let a=t.get(r);if(!a)throw Error(`${r}: not in bundle ${i}`);return t.delete(r),a}}var f=class e{constructor(){this.ino=BigInt(i++),this.entries=new Map,this.mtime=a()}mkdirs(t,n=0){let r=this;for(let i of t.split(`/`).filter(e=>e&&e!==`.`)){if(i===`..`){r=r.parent||r;continue}let a=r.entries.get(i);if(a instanceof p){if(n>=40)throw Error(`${t}: too many symbolic links`);let e=r;for(;e.parent;)e=e.parent;a=(a.target.startsWith(`/`)?e:r).mkdirs(a.target,n+1)}else if(a&&!(a instanceof e))throw Error(`${t}: ${i} names no directory`);a||(a=new e,a.parent=r,r.entries.set(i,a)),r=a}return r}put(t,n){let r=t.split(`/`).filter(Boolean),i=r.pop(),a=this.mkdirs(r.join(`/`));return n instanceof e&&(n.parent=a),a.entries.set(i,n),n}},p=class{constructor(e){this.ino=BigInt(i++),this.target=e,this.mtime=a()}get size(){return new TextEncoder().encode(this.target).length}};function m(t,n,r,i=!0,a=0){let o=r.startsWith(`/`)?t:n,s=r.split(`/`).filter(e=>e&&e!==`.`);for(let n=0;n<s.length;n++){if(!(o instanceof f))return{error:e.NOTDIR};let r=s[n],c=n===s.length-1;if(r===`..`){if(o=o.parent||o,c)return{node:o};continue}let l=o.entries.get(r);if(l instanceof p&&(!c||i)){if(a>=40)return{error:e.LOOP};let n=m(t,o,l.target,!0,a+1);if(c)return n;if(!n.node)return{error:n.error};o=n.node}else{if(c)return l?{node:l,parent:o,name:r}:{error:e.NOENT,parent:o,name:r};if(!l)return{error:e.NOENT};o=l}}return{node:o}}var h=class{constructor(e){this.ino=BigInt(i++),this.read=e,this.size=0,this.mtime=a()}},g=()=>new h(e=>{let t=new Uint8Array(e);for(let n=0;n<e;n+=65536)crypto.getRandomValues(t.subarray(n,n+65536));return t}),_=()=>new h(()=>new Uint8Array);function*v(e){let t=(t,n)=>{let r=t;for(;r<t+n&&e[r]!==0;)r++;return new TextDecoder().decode(e.subarray(t,r))},n=null,r=null;for(let i=0;i+512<=e.length&&e[i]!==0;){let a=t(i,100),o=t(i+345,155);o&&(a=`${o}/${a}`),n!==null&&(a=n,n=null);let s=parseInt(t(i+124,12).trim()||`0`,8),c=BigInt(parseInt(t(i+136,12).trim()||`0`,8))*1000000000n,l=String.fromCharCode(e[i+156]||48),u=t(i+157,100);r!==null&&l!==`K`&&l!==`L`&&l!==`x`&&(u=r,r=null);let d=i+512;if(l===`L`)n=t(d,s);else if(l===`K`)r=t(d,s);else if(l===`x`){let t=e.subarray(d,d+s);n=y(t,`path`),r=y(t,`linkpath`)}else l!==`g`&&(yield{name:a,type:l,body:e.slice(d,d+s),mtime:c,link:u});i=d+Math.ceil(s/512)*512}}function y(e,t){let n=new TextDecoder;for(let r=0;r<e.length;){let i=e.indexOf(32,r);if(i<0)break;let a=parseInt(n.decode(e.subarray(r,i)),10);if(!(a>0))break;let o=n.decode(e.subarray(i+1,r+a-1));if(o.startsWith(`${t}=`))return o.slice(t.length+1);r+=a}return null}async function b(e,t,n=()=>!0){return S(await x(e),t,n)}async function x(e){let t=new Blob([e]).stream().pipeThrough(new DecompressionStream(`gzip`));return new Uint8Array(await new Response(t).arrayBuffer())}function S(e,t,n=()=>!0){let r=0;for(let{name:i,type:a,body:s,mtime:c,link:l}of v(e))if(n(i)){if(a===`5`)t.mkdirs(i);else if(a===`0`)t.put(i,new o(s)).mtime=c,r++;else if(a===`2`)t.put(i,new p(l)).mtime=c;else if(a===`1`){let[,...e]=`/${l}`.split(`/`),n=t;for(let t of e.filter(Boolean))n=n instanceof f?n.entries.get(t):void 0;n instanceof o&&t.put(i,n)}}return r}function C(e){return e instanceof f?t.DIR:e instanceof p?t.SYMLINK:t.REG}export{g as _,d as a,t as b,l as c,c as d,m as f,S as g,b as h,p as i,C as l,a as m,f as n,_ as o,s as p,o as r,v as s,h as t,x as u,e as v,n as x,r as y};
@@ -0,0 +1,16 @@
1
+ import{_ as e,i as t,o as n,r,s as i,t as a,v as o}from"./fs-GnBaZCKr.js";import{i as s,n as c,r as l,t as u}from"./wasi-BuobPCe8.js";var d=`4.3.3`;function f(e,{args:t}){if(t[0]===`--version`)return e.write(`0.25.4
2
+ `),e.exit(0);e.write(`esbuild: not yet available in the playground
3
+ `),e.exit(1)}function p(e,{args:t}){if(t[0]===`--help`)return e.write(`\u2248 tailwindcss v${d}\n`),e.exit(0);e.write(`tailwind: not yet available in the playground
4
+ `),e.exit(1)}var m=(e,t)=>(n,{args:r,cwd:a,env:o})=>{if(r.length&&r.every(e=>e===`clean`))return n.exit(0);let s=e.readText(`${a}/hex_metadata.config`)??``,c=e=>s.match(RegExp(`\\{<<"${e}">>,\\s*<<"([^"]*)">>\\}`))?.[1],[l,u]=[c(`name`),c(`version`)],d=o.MIX_APP_PATH,f=e=>n.write(`make: ${e}\n`),p=l&&u&&d?t(l,u,f):null;if(!(p instanceof Uint8Array)){let e=l?`${l} ${u}`:a;return f(typeof p==`string`?p:`there is no WebAssembly build of ${e}'s native code in the playground`),n.exit(2)}for(let t of i(p)){let n=`${d}/${t.name.replace(/\/$/,``)}`;t.type===`5`?e.mkdir(n):t.type===`0`&&(e.mkdir(n.slice(0,n.lastIndexOf(`/`))),e.write(n,t.body))}n.write(`make: ${l} ${u}'s native code, built to WebAssembly for the playground\n`),n.exit(0)},h=1,g=2,_=1,v=2,y=3,b=12,ee=(e,{memory:t})=>{let n=new TextEncoder,r=t=>e.write(new Uint8Array([t.length,...t])),i=e=>r(n.encode(e.toString(16))),a=4*1024**3,o=()=>t?.buffer.byteLength??0,s=new Uint8Array;e.oninput=t=>{for(s=new Uint8Array([...s,...t]);s.length&&s.length>=1+s[0];){let t=s[1];if(s=s.subarray(1+s[0]),t===h)i(o()),i(a);else if(t===g){for(let[e,t]of[[_,a],[v,a],[y,a-o()],[b,a-o()]])r(new Uint8Array([e])),i(t);r(new Uint8Array([0]))}else return e.exit(0)}},e.onclose=()=>e.exit(0)};function x(e){let t=[],n=null,r=null;for(let i of e)r?i===r?r=null:n+=i:i===`"`||i===`'`?(r=i,n??=``):/\s/.test(i)?(n!==null&&t.push(n),n=null):n=(n??``)+i;return n!==null&&t.push(n),t}function te(e){let t=e.trim();for(;;){let e=t.replace(/\s*<\s*\/dev\/null\s*$/,``).replace(/^\(([\s\S]*)\)$/,`$1`).trim();if(e===t)break;t=e}let n=[[]];for(let e of x(t))e===`&&`?n.push([]):n[n.length-1].push(e);return n}var S=new Map;function C(e){S.clear();for(let[t,n]of e)S.set(t,n)}var w=e=>S.get(e)?.multicall===!0,T=e=>S.get(e)?.multicall===!1,ne=e=>Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e);function E(e,t){let n=S.get(t);if(n)return(r,{args:i,cwd:a,env:o,root:s})=>{let l=n.multicall?e.module():e.load?.(t)??null;if(!l)return r.write(`${t}: not in this site (${n.url.pathname.split(`/`).pop()})\n`),r.exit(127);let u=e.terminal?.()??null,d=r.input.splice(0),f=!e.read,p=new c({args:[t,...i],env:{...t===`git`?{GIT_PAGER:`cat`}:{},...o,PWD:a,...u?{COLUMNS:String(u[0])}:{}},root:s,stdin:t=>{let n=d[0];if(!n){let n=f?new Uint8Array:e.read(t);return f||=!n.length,n}return n.length<=t?d.shift():(d[0]=n.subarray(t),n.subarray(0,t))},stdout:e=>r.write(e.slice()),stderr:t=>(e.stderr??r.write.bind(r))(t.slice()),sleep:ne,tty:!!u,fetch:e.fetch,shared:e.shared}),m=new WebAssembly.Instance(l,p.imports);r.exit(p.start(m))}}function re(e,t){return(n,r)=>{if(t)return t(n,r);let[i,a=``]=r.args,o=i===`-c`?te(a):[];if(!o.some(e=>w(e[0])))return n.write(`sh: only sh -c runs here
5
+ `),n.exit(127);let c=r.cwd,l=t=>{let i=o.shift();if(t!==0||!i)return n.exit(t);let[a,...u]=i;if(!a)return l(0);if(a===`cd`)return c=O(c,u[0]??r.env.HOME??`/work`),l(0);let d=E(e,a);if(d){let e=new s;d(e,{...r,args:u,cwd:c});for(let t of e.output)n.write(t);return l(e.status??1)}return n.write(`sh: ${a}: not found in the playground\n`),n.exit(127)};l(0)}}function D(e,t){let n={...e};n.sh=re(t,e.sh);for(let e of S.keys())n[e]??=E(t,e);return n}function O(e,t){let n=[];for(let r of(t.startsWith(`/`)?t:`${e}/${t}`).split(`/`))r===`..`?n.pop():r&&r!==`.`&&n.push(r);return`/`+n.join(`/`)}var k=class extends Error{constructor(){super(`shell: buffered output exceeded 16 MiB ahead of its reader`)}},ie=16<<20,A=-1,j=class{constructor(e,t){this.pid=e,this.parent=t,this.adopted=!1,this.status=null,this.signal=null,this.exited=Promise.resolve(0),this.woken=new Promise(e=>this.wake=e)}kill(e){this.status===null&&this.signal===null&&(this.signal=e,this.wake())}check(){if(this.signal!==null)throw new u(128+this.signal)}},M=class{constructor(e,t=()=>{}){this.table=new Map,this.next=2,this.resolve=e,this.idle=t,this.hosting=0}adopt(){let e=new j(this.next++,0);return e.adopted=!0,this.table.set(e.pid,e),e}forget(e){this.table.delete(e.pid)}spawn(e,t=0){let n=this.resolve(e.program,e.args,e.cwd,e.env);if(!n)return null;for(let t of e.stdio)N(t);let r=new j(this.next++,t);return this.table.set(r.pid,r),r.exited=(async()=>{await Promise.resolve();try{r.status=await n(r,e)&255}catch(t){if(t instanceof u)r.status=t.code&255;else{t instanceof k||console.error(t);let n=`${e.program}: ${t.message}\n`;I(e.stdio[2])?.(new TextEncoder().encode(n)),r.status=1}}finally{for(let t of e.stdio)P(t);this.ended(r)}return r.status})(),r.exited.catch(()=>{}),r}task(e,t){let n=new j(this.next++,e);return this.table.set(n.pid,n),n.exited=(async()=>{await Promise.resolve();try{n.status=await t()&255}catch(e){e instanceof u?n.status=e.code&255:(console.error(e),n.status=1)}return this.ended(n),n.status})(),n.exited.catch(()=>{}),n}ended(e){for(let t of this.table.values())t.parent===e.pid&&(t.status===null?t.parent=A:this.table.delete(t.pid));e.parent===A&&this.table.delete(e.pid)}interrupt(e=2){for(let t of this.table.values())t.adopted||t.kill(e)}async wait(e,t){let n=this.table.get(e);if(!n||n.parent!==t)return null;let r=await n.exited;return this.table.delete(e),r}async run(e){let t=this.spawn(e);for(let t of e.stdio)P(t);return t?this.wait(t.pid,0):null}};function N(e){return e.shares=(e.shares??0)+1,e}function P(e){e.shares?e.shares--:e.pipe&&e.pipe.close(!!e.reads)}function F(){let e=new l;return e.open(!0),e.open(!1),[{pipe:e,reads:!0},{pipe:e,reads:!1}]}function ae(e){let[t,n]=F();return n.pipe.write(e,!1),P(n),t}function I(e,t=null){if(e.sink)return e.tty?null:e.sink;if(e.pipe)return t=>{if(e.pipe.size+t.length>16777216)throw new k;e.pipe.write(t,!1)};if(e.remote&&t){let n=e.remote;return e=>{let{answer:r}=t.call({op:`write`,handle:n.handle,offset:n.position,append:n.append},e);r.error||(n.position=r.position)}}if(e.node instanceof r){let t=e.node;return n=>{e.append&&(e.position=t.size);let r=e.position+n.length;t.reserve(r),t.data.set(n,e.position),t.size=Math.max(t.size,r),t.written=!0,e.position=r}}return()=>{}}async function L(e,t){let n=[];if(e.source||e.stream&&!e.sink)return null;if(e.pipe){let t=0;for(;;){let r=e.pipe.read(65536);if(!r)await e.pipe.changed();else if(!r.length)break;else if((t+=r.length)>16777216)throw new k;else n.push(r)}}else if(e.remote&&t)for(;;){let{answer:r,bytes:i}=t.call({op:`read`,handle:e.remote.handle,offset:e.remote.position,length:65536});if(r.error||!i.length)break;e.remote.position+=i.length,n.push(i)}else if(e.node instanceof r)n.push(e.node.bytes.slice(e.position));else if(!(e.node instanceof a))return null;let i=new Uint8Array(n.reduce((e,t)=>e+t.length,0)),o=0;for(let e of n)i.set(e,o),o+=e.length;return i}async function R(e,t,n,r){let i=e.pipe;if(!i)return(e.tty&&e.sink?e.sink:I(e,r))?.(t),!0;let a=0;for(;a<t.length;){if(n.signal!==null)return!1;let e=i.write(t.subarray(a));if(e===-1)return!1;e===null?await Promise.race([i.changed(),n.woken]):a+=e}return!0}async function z(e,t,n,r,i){let a=e.pipe;if(a)for(;;){if(await n(),r())return;let e=a.read(65536);if(!e)await a.changed();else if(e.length)t(e);else break}else{let n=await L(e,i);if(r())return;n?.length&&t(n)}t(null)}function B(e,t,n){return async(r,{program:i,args:a,cwd:o,env:s,stdio:c})=>{let l=await L(c[0],n);e.hosting++;try{return await t(i,a,o,s,{input:l,stdout:I(c[1],n),stderr:I(c[2],n)})??127}finally{e.hosting--}}}function V(e,t,n){return async(r,i)=>{let a=new c({args:[n.argv0??i.program.split(`/`).pop(),...i.args],env:{...n.defaults,...i.env,PWD:i.cwd,...i.stdio[1].tty&&n.columns?{COLUMNS:String(n.columns())}:{}},root:n.root,stdin:()=>new Uint8Array,stdout:()=>{},stderr:()=>{},sleep:()=>{},fetch:n.fetch,shared:n.shared,suspending:!0,pump:()=>{n.pump?.(),r.check()}});a.interrupt=r.woken,i.stdio.forEach((e,t)=>a.fds.set(t,N(e)));let o=new WebAssembly.Instance(t,{...a.imports,processes:H(a,e,r)});a.memory=o.exports.memory,a.exports=o.exports,a.stack=o.exports.__stack_pointer??null;let s=WebAssembly.promising(o.exports._start);try{return await s(),0}catch(e){if(e instanceof u)return e.code;throw e}finally{a.release()}}}function H(e,t,n,r=[]){let i=(t,n)=>e.string(t,n).split(`\0`);return{pipe(t){let[n,r]=F(),i=e.next++,a=e.next++;return e.fds.set(i,n),e.fds.set(a,r),e.view().setUint32(t,i,!0),e.view().setUint32(t+4,a,!0),o.SUCCESS},spawn(a,s,c,l,u,d){let f=i(a,s),[p,m]=f,h=Number(f[2]),g=f.slice(3,3+h),_=Number(f[3+h]),v=Object.fromEntries(f.slice(4+h,4+h+_).map(e=>{let t=e.indexOf(`=`);return[e.slice(0,t),e.slice(t+1)]})),y=[c,l,u].map(t=>{let n=e.fds.get(t);return n?.stream&&!n.source&&!n.sink&&r[t]?r[t]:n});if(y.some(e=>!e))return o.BADF;let b=t.spawn({program:p,args:g,cwd:m,env:v,stdio:y},n.pid);return b?(e.view().setUint32(d,b.pid,!0),o.SUCCESS):o.NOENT},wait:new WebAssembly.Suspending(async(r,i,a)=>{let s=t.table.get(r);if(!s||s.parent!==n.pid)return o.CHILD;if(s.status===null&&a===1||s.status===null&&a===2&&(await e.suspended(Promise.race([s.exited,new Promise(e=>setTimeout(e,10))])),s.status===null))return o.AGAIN;for(;s.status===null;){let r=new Promise(e=>setTimeout(e,50));await e.suspended(Promise.race([s.exited,n.woken,r])),t.idle(),n.check()}let c=await e.suspended(t.wait(r,n.pid)),l=s.signal!==null&&c===128+s.signal;return e.view().setInt32(i,l?s.signal:c<<8,!0),o.SUCCESS}),async_start(r,i,a){let s=e.exports?.wasi_run_async,c=e.stack;if(!s||!c)return o.NOSYS;let l=t.task(n.pid,async()=>(c.value=i,e.strand=r,WebAssembly.promising(s)(r)));return e.view().setUint32(a,l.pid,!0),o.SUCCESS},async_current:()=>e.strand,async_exit(e){throw new u(e)},kill(e,n){let r=t.table.get(e);return r?(r.kill(n),o.SUCCESS):o.SRCH},dup(t,n){let r=e.dup(t);return r===null?o.BADF:(e.view().setUint32(n,r,!0),o.SUCCESS)},dup2(t,n){let r=e.fds.get(t);return r?(t===n||(e.fds.has(n)&&e.close(n),e.fds.set(n,N(r))),o.SUCCESS):o.BADF}}}function U(e,t){return(n,{args:r,cwd:i,env:a})=>{let[o,s]=F(),[c,l]=F(),u=e.spawn({program:t,args:r,cwd:i,env:a,stdio:[o,l,l]});if(P(o),P(l),!u){P(s),P(c),n.write(`${t}: not found\n`),n.exit(127);return}let d=!0;n.oninput=e=>void(d&&s.pipe.write(e,!1)),n.onclose=()=>{d&&P(s),d=!1,u.status===null&&u.kill(15)},(async()=>{let t=c.pipe;for(;;){let e=t.read(65536);if(!e)await t.changed();else if(e.length)n.write(e);else break}P(c);let r=await e.wait(u.pid,0);d&&P(s),d=!1,n.exit(r??1)})()}}var W=new TextEncoder;function G(e){return async(t,{args:n,cwd:r,env:i,stdio:a})=>{let o={...i},s=0;for(;s<n.length;s++){let e=n[s];if(e===`-i`||e===`-`||e===`--ignore-environment`)o={};else if(e===`-u`||e===`--unset`)delete o[n[++s]];else if(e===`--`){s++;break}else break}for(;s<n.length&&/^[^=]+=/.test(n[s]);s++){let e=n[s].indexOf(`=`);o[n[s].slice(0,e)]=n[s].slice(e+1)}if(s===n.length){let e=Object.entries(o).map(([e,t])=>`${e}=${t}\n`).join(``);return await R(a[1],W.encode(e),t,null)?0:141}let c=await e.run({program:n[s],args:n.slice(s+1),cwd:r,env:o,stdio:a.map(e=>N(e))});return c===null?(await R(a[2],W.encode(`env: '${n[s]}': No such file or directory\n`),t,null),127):c}}function K(e){return async(t,{args:n,cwd:r,env:i,stdio:a})=>{let o=!1,s=1/0,c=!1,l=0;for(;l<n.length;l++){let e=n[l];if(e===`-0`||e===`--null`)o=!0;else if(e===`-r`||e===`--no-run-if-empty`)c=!0;else if(e===`-n`)s=Number(n[++l]);else if(/^-n\d+$/.test(e))s=Number(e.slice(2));else if(e===`--`){l++;break}else break}let u=n.length>l?n.slice(l):[`echo`],d=[];await z(a[0],e=>void(e&&d.push(e)),async()=>{},()=>!1,null);let f=new TextDecoder,p=d.map(e=>f.decode(e,{stream:!0})).join(``)+f.decode(),m=o?p.split(`\0`).filter(e=>e.length):q(p);if(!m.length&&c)return 0;let h=0;for(let n=0;n<Math.max(m.length,1);n+=s){let o=await e.run({program:u[0],args:[...u.slice(1),...m.slice(n,n+s)],cwd:r,env:i,stdio:a.map(e=>N(e))});if(o===null)return await R(a[2],W.encode(`xargs: ${u[0]}: No such file or directory\n`),t,null),127;if(o===255)return 124;o&&(h=123)}return h}}function q(e){let t=[],n=null,r=null;for(let i=0;i<e.length;i++){let a=e[i];r?a===r?r=null:n+=a:a===`"`||a===`'`?(r=a,n??=``):a===`\\`&&i+1<e.length?n=(n??``)+e[++i]:/\s/.test(a)?(n!==null&&t.push(n),n=null):n=(n??``)+a}return n!==null&&t.push(n),t}function oe(e,t){return async(e,{args:n,cwd:r,stdio:i})=>{let a=async t=>void await R(i[2],W.encode(`chmod: ${t}\n`),e,null),o=!1,s=null,c=[],l=!0;for(let e of n)l&&e===`--`?l=!1:l&&(e===`-f`||e===`--silent`||e===`--quiet`)?o=!0:l&&e.startsWith(`--reference=`)?s=e:l&&/^--(recursive|changes|verbose|no-preserve-root|preserve-root)$/.test(e)||(l&&/^-[Rcvf]+$/.test(e)?o||=e.includes(`f`):s===null?s=e:c.push(e));if(s===null)return await a(`missing operand`),1;if(!c.length)return await a(`missing operand after '${s}'`),1;let u=/^[ugoa]*([-+=]([rwxXst]*|[ugo]))+$/;if(!(s.startsWith(`--reference=`)||/^[0-7]{1,4}$/.test(s)||s.split(`,`).every(e=>u.test(e))))return await a(`invalid mode: '${s}'`),1;let d=e=>e.startsWith(`/`)?e:`${r}/${e}`;if(s.startsWith(`--reference=`)){let e=s.slice(12);if(t&&!t(d(e)))return await a(`failed to get attributes of '${e}': No such file or directory`),1}let f=0;for(let e of c)t&&!t(d(e))&&(o||await a(`cannot access '${e}': No such file or directory`),f=1);return f}}var J={env:G,xargs:K,chmod:oe},Y={HOME:`/home/user`,LANG:`C.UTF-8`,TERM:`xterm-256color`,PATH:`/usr/bin:/home/user/.mix/escripts`,MIX_HOME:`/home/user/.mix`,TARGET_ARCH:`wasm32`,TARGET_OS:`unknown`,TARGET_ABI:`wasi`},se=e=>({...Y,...e.environment()});function ce(i,{dns:a=!1,inotifywait:o=!1,bin:s=new Map}={}){i.mkdirs(`work`),i.mkdirs(`tmp`),i.mkdirs(`home/user`),i.mkdirs(`shared`),i.mkdirs(`usr/share/git-core/templates`),i.put(`dev/urandom`,e()),i.put(`dev/null`,n());let c=e=>new r(new TextEncoder().encode(e));i.put(`etc/hosts`,c(`127.0.0.1 localhost
6
+ ::1 localhost
7
+ `)),a&&i.put(`etc/resolv.conf`,c(`nameserver 127.0.0.53
8
+ `)),i.put(`etc/inetrc`,c(`{lookup, [file${a?`, dns`:``}]}.\n{host, {127,0,0,1}, ["localhost"]}.
9
+ {host, {0,0,0,0,0,0,0,1}, ["localhost"]}.
10
+ `));for(let[e,n]of s)i.put(`usr/bin/${e}`,new t(n));for(let e of[`git`,`esbuild`,`tailwind`,`make`,`node`,`npm`,`npx`,`claude`,`sh`,`bash`,`elixir`,`iex`,`erl`,`escript`,...S.keys(),...Object.keys(J),...o?[`inotifywait`]:[]])s.has(e)||i.put(`usr/bin/${e}`,new r);for(let e of[`git-upload-pack`,`git-receive-pack`,`git-upload-archive`])i.put(`usr/libexec/git-core/${e}`,new r)}var le=(e,t=()=>null)=>({memsup:ee,esbuild:f,tailwind:p,make:m(e,t)}),X=new TextEncoder,Z=new TextDecoder,Q=[`github.com`,`gitlab.com`,`codeberg.org`],$=`git push does not work in the shell: push from the Changes panel (with your GitHub token from Settings)`,ue=new Set([`git-upload-pack`,`git-receive-pack`,`git-upload-archive`]),de=(()=>{let e=Q.flatMap(e=>[[`url.https://${e}/.insteadOf`,`git@${e}:`],[`url.https://${e}/.insteadOf`,`ssh://git@${e}/`]]);return Object.fromEntries([[`GIT_CONFIG_COUNT`,String(e.length)],...e.flatMap(([e,t],n)=>[[`GIT_CONFIG_KEY_${n}`,e],[`GIT_CONFIG_VALUE_${n}`,t]])])})(),fe=e=>t=>Q.includes(t.hostname)&&/^\/[\w.-]+\/[\w.-]+\/?$/.test(t.pathname)?`${e}/git/${t.hostname}${t.pathname.replace(/\/$/,``)}`:null,pe=class{constructor(e){this.entry=e,this.buffer=new Uint8Array}async fill(e){let t=this.entry.pipe;for(;this.buffer.length<e;){let e=t.read(65536);if(!e)await t.changed();else if(e.length){let t=new Uint8Array(this.buffer.length+e.length);t.set(this.buffer),t.set(e,this.buffer.length),this.buffer=t}else return!1}return!0}take(e){let t=this.buffer.slice(0,e);return this.buffer=this.buffer.subarray(e),t}async line(){for(let e=1;;e=this.buffer.length+1){let t=this.buffer.indexOf(10);if(t>=0)return Z.decode(this.take(t+1)).slice(0,-1);if(!await this.fill(e))return null}}async request(){let e=[];for(;;){if(!await this.fill(4))return null;let t=parseInt(Z.decode(this.buffer.subarray(0,4)),16),n=t<4?4:t;if(!await this.fill(n))return null;if(e.push(this.take(n)),t===0)break}let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t}};function me(e){let t=t=>{let n=parseInt(Z.decode(e.subarray(t,t+4)),16);return{length:n,text:Z.decode(e.subarray(t+4,t+Math.max(n,4)))}},n=0,r=t(0);if(r.text.startsWith(`# service=`)){if(n=r.length,t(n).length!==0)return null;n+=4}return t(n).text===`version 2
11
+ `?e.subarray(n):null}function he(e,t=fetch){return async(n,{args:r,stdio:[i,a,o]})=>{let s=e=>R(a,typeof e==`string`?X.encode(e):e,n,null),c=async e=>(await R(o,X.encode(`fatal: ${e}\n`),n,null),128),l=r[2]??r[1],u=null;try{u=e(new URL(l))}catch{}if(!u)return c(`unable to access '${l}': the playground fetches only from ${Q.join(`, `)} (public repositories, through its proxy)`);let d=new pe(i);for(;;){let e=await d.line();if(e===null)return 0;if(e===``)continue;if(e===`capabilities`){if(!await s(`stateless-connect
12
+
13
+ `))return 141;continue}let[n,r]=e.split(` `);if(n!==`stateless-connect`)return c(`remote-https: ${n}: ${$}`);if(r!==`git-upload-pack`)return await s(`fallback
14
+ `),c(`remote-https: ${r}: ${$}`);let i=await t(`${u}/info/refs?service=${r}`,{headers:{"Git-Protocol":`version=2`}}).catch(e=>e);if(i instanceof Error)return c(`unable to access '${l}': ${i.message}`);if(!i.ok)return c(`unable to access '${l}': the server answered ${i.status}`);let a=me(new Uint8Array(await i.arrayBuffer()));if(!a)return await s(`fallback
15
+ `),c(`unable to access '${l}': the server does not speak protocol v2`);if(!await s(`
16
+ `)||!await s(a))return 141;for(;;){let e=await d.request();if(!e)return 0;let n=await t(`${u}/${r}`,{method:`POST`,headers:{"Content-Type":`application/x-${r}-request`,Accept:`application/x-${r}-result`,"Git-Protocol":`version=2`},body:e}).catch(e=>e);if(n instanceof Error)return c(`unable to access '${l}': ${n.message}`);if(!n.ok||!n.body)return c(`unable to access '${l}': the server answered ${n.status}`);let i=n.body.getReader();for(;;){let{done:e,value:t}=await i.read();if(e)break;if(!await s(t))return i.cancel(),141}if(!await s(`0002`))return 141}}}}export{T as C,x as D,D as E,S,C as T,P as _,Y as a,R as b,le as c,M as d,z as f,H as g,U as h,fe as i,J as l,ae as m,ue as n,se as o,B as p,he as r,ce as s,de as t,ie as u,N as v,w,k as x,V as y};