@turmind/halo 0.1.9
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.
- package/LICENSE +21 -0
- package/README.md +143 -0
- package/admin-out/404.html +1 -0
- package/admin-out/_next/static/IBP_mwBDf-cPwZSZZGpi8/_buildManifest.js +1 -0
- package/admin-out/_next/static/IBP_mwBDf-cPwZSZZGpi8/_ssgManifest.js +1 -0
- package/admin-out/_next/static/chunks/1d2d5650-810a3ca1ae20cab5.js +18 -0
- package/admin-out/_next/static/chunks/200.3b8f8a74f005a134.js +1 -0
- package/admin-out/_next/static/chunks/220.3dc41cd6269b88e6.js +1 -0
- package/admin-out/_next/static/chunks/298-d6b224b569da4de0.js +1 -0
- package/admin-out/_next/static/chunks/304eda7d.b1ee7f523653e027.js +1 -0
- package/admin-out/_next/static/chunks/330.3b784cf0dcd69163.js +1 -0
- package/admin-out/_next/static/chunks/442.f4302087bddb1ec1.js +1 -0
- package/admin-out/_next/static/chunks/443.d1b289781793f8de.js +25 -0
- package/admin-out/_next/static/chunks/503-7c6d9935df6e0cea.js +1 -0
- package/admin-out/_next/static/chunks/533.5f2d4bfe3d076095.js +1 -0
- package/admin-out/_next/static/chunks/579.a2718ddd395a2f3a.js +1 -0
- package/admin-out/_next/static/chunks/635-3dd0043ed0520b9d.js +1 -0
- package/admin-out/_next/static/chunks/65.859665ba6717967a.js +1 -0
- package/admin-out/_next/static/chunks/661.a4fe93f3f2a5e871.js +1 -0
- package/admin-out/_next/static/chunks/688.4e014ac6cfc7e152.js +1 -0
- package/admin-out/_next/static/chunks/868.0c95dfe283400a00.js +1 -0
- package/admin-out/_next/static/chunks/app/_not-found/page-8e35399c8fd5016d.js +1 -0
- package/admin-out/_next/static/chunks/app/layout-58f773336e6fce61.js +1 -0
- package/admin-out/_next/static/chunks/app/page-cc8043335282d745.js +1 -0
- package/admin-out/_next/static/chunks/db534642.09d3c650ff587175.js +1 -0
- package/admin-out/_next/static/chunks/fb4ec4d6-3fa44f69484f91b9.js +1 -0
- package/admin-out/_next/static/chunks/framework-c3031ae54a63fe16.js +1 -0
- package/admin-out/_next/static/chunks/main-14b48e3c2588354f.js +1 -0
- package/admin-out/_next/static/chunks/main-app-483b436873410ddc.js +1 -0
- package/admin-out/_next/static/chunks/pages/_app-b2fc6e5f920d1b1a.js +1 -0
- package/admin-out/_next/static/chunks/pages/_error-f3696a8f3d67d150.js +1 -0
- package/admin-out/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/admin-out/_next/static/chunks/webpack-8bd7ef88a6527feb.js +1 -0
- package/admin-out/_next/static/css/659eccb5db697b76.css +1 -0
- package/admin-out/_next/static/css/8fce4e1a54dac12a.css +3 -0
- package/admin-out/_next/static/media/19cfc7226ec3afaa-s.woff2 +0 -0
- package/admin-out/_next/static/media/21350d82a1f187e9-s.woff2 +0 -0
- package/admin-out/_next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
- package/admin-out/_next/static/media/ba9851c3c22cd980-s.woff2 +0 -0
- package/admin-out/_next/static/media/c5fe6dc8356a8c31-s.woff2 +0 -0
- package/admin-out/_next/static/media/df0a9ae256c0569c-s.woff2 +0 -0
- package/admin-out/_next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
- package/admin-out/favicon.ico +0 -0
- package/admin-out/icon.svg +18 -0
- package/admin-out/index.html +1 -0
- package/admin-out/index.txt +23 -0
- package/admin-out/monaco/vs/_commonjsHelpers-CT9FvmAN.js +1 -0
- package/admin-out/monaco/vs/abap-D-t0cyap.js +1 -0
- package/admin-out/monaco/vs/apex-CcIm7xu6.js +1 -0
- package/admin-out/monaco/vs/assets/css.worker-HnVq6Ewq.js +93 -0
- package/admin-out/monaco/vs/assets/editor.worker-Be8ye1pW.js +26 -0
- package/admin-out/monaco/vs/assets/html.worker-B51mlPHg.js +470 -0
- package/admin-out/monaco/vs/assets/json.worker-DKiEKt88.js +58 -0
- package/admin-out/monaco/vs/assets/ts.worker-CMbG-7ft.js +67731 -0
- package/admin-out/monaco/vs/azcli-BA0tQDCg.js +1 -0
- package/admin-out/monaco/vs/basic-languages/monaco.contribution.js +1 -0
- package/admin-out/monaco/vs/bat-C397hTD6.js +1 -0
- package/admin-out/monaco/vs/bicep-DF5aW17k.js +2 -0
- package/admin-out/monaco/vs/cameligo-plsz8qhj.js +1 -0
- package/admin-out/monaco/vs/clojure-Y2auQMzK.js +1 -0
- package/admin-out/monaco/vs/coffee-Bu45yuWE.js +1 -0
- package/admin-out/monaco/vs/cpp-CkKPQIni.js +1 -0
- package/admin-out/monaco/vs/csharp-CX28MZyh.js +1 -0
- package/admin-out/monaco/vs/csp-D8uWnyxW.js +1 -0
- package/admin-out/monaco/vs/css-CaeNmE3S.js +3 -0
- package/admin-out/monaco/vs/cssMode-CjiAH6dQ.js +1 -0
- package/admin-out/monaco/vs/cypher-DVThT8BS.js +1 -0
- package/admin-out/monaco/vs/dart-CmGfCvrO.js +1 -0
- package/admin-out/monaco/vs/dockerfile-CZqqYdch.js +1 -0
- package/admin-out/monaco/vs/ecl-30fUercY.js +1 -0
- package/admin-out/monaco/vs/editor/editor.main.css +1 -0
- package/admin-out/monaco/vs/editor/editor.main.js +5 -0
- package/admin-out/monaco/vs/editor.api-CalNCsUg.js +903 -0
- package/admin-out/monaco/vs/elixir-xjPaIfzF.js +1 -0
- package/admin-out/monaco/vs/flow9-DqtmStfK.js +1 -0
- package/admin-out/monaco/vs/freemarker2-Cz_sV6Md.js +3 -0
- package/admin-out/monaco/vs/fsharp-BOMdg4U1.js +1 -0
- package/admin-out/monaco/vs/go-D_hbi-Jt.js +1 -0
- package/admin-out/monaco/vs/graphql-CKUU4kLG.js +1 -0
- package/admin-out/monaco/vs/handlebars-OwglfO-1.js +1 -0
- package/admin-out/monaco/vs/hcl-DTaboeZW.js +1 -0
- package/admin-out/monaco/vs/html-Pa1xEWsY.js +1 -0
- package/admin-out/monaco/vs/htmlMode-Bz67EXwp.js +1 -0
- package/admin-out/monaco/vs/ini-CsNwO04R.js +1 -0
- package/admin-out/monaco/vs/java-CI4ZMsH9.js +1 -0
- package/admin-out/monaco/vs/javascript-PczUCGdz.js +1 -0
- package/admin-out/monaco/vs/jsonMode-DULH5oaX.js +7 -0
- package/admin-out/monaco/vs/julia-BwzEvaQw.js +1 -0
- package/admin-out/monaco/vs/kotlin-IUYPiTV8.js +1 -0
- package/admin-out/monaco/vs/language/css/monaco.contribution.js +1 -0
- package/admin-out/monaco/vs/language/html/monaco.contribution.js +1 -0
- package/admin-out/monaco/vs/language/json/monaco.contribution.js +1 -0
- package/admin-out/monaco/vs/language/typescript/monaco.contribution.js +1 -0
- package/admin-out/monaco/vs/less-C0eDYdqa.js +2 -0
- package/admin-out/monaco/vs/lexon-iON-Kj97.js +1 -0
- package/admin-out/monaco/vs/liquid-DqKjdPGy.js +1 -0
- package/admin-out/monaco/vs/loader.js +1368 -0
- package/admin-out/monaco/vs/lspLanguageFeatures-kM9O9rjY.js +4 -0
- package/admin-out/monaco/vs/lua-DtygF91M.js +1 -0
- package/admin-out/monaco/vs/m3-CsR4AuFi.js +1 -0
- package/admin-out/monaco/vs/markdown-C_rD0bIw.js +1 -0
- package/admin-out/monaco/vs/mdx-DEWtB1K5.js +1 -0
- package/admin-out/monaco/vs/mips-CiYP61RB.js +1 -0
- package/admin-out/monaco/vs/monaco.contribution-D2OdxNBt.js +1 -0
- package/admin-out/monaco/vs/monaco.contribution-DO3azKX8.js +1 -0
- package/admin-out/monaco/vs/monaco.contribution-EcChJV6a.js +1 -0
- package/admin-out/monaco/vs/monaco.contribution-qLAYrEOP.js +1 -0
- package/admin-out/monaco/vs/msdax-C38-sJlp.js +1 -0
- package/admin-out/monaco/vs/mysql-CdtbpvbG.js +1 -0
- package/admin-out/monaco/vs/nls.messages-loader.js +1 -0
- package/admin-out/monaco/vs/nls.messages.cs.js.js +17 -0
- package/admin-out/monaco/vs/nls.messages.de.js.js +17 -0
- package/admin-out/monaco/vs/nls.messages.es.js.js +17 -0
- package/admin-out/monaco/vs/nls.messages.fr.js.js +15 -0
- package/admin-out/monaco/vs/nls.messages.it.js.js +15 -0
- package/admin-out/monaco/vs/nls.messages.ja.js.js +17 -0
- package/admin-out/monaco/vs/nls.messages.js.js +10 -0
- package/admin-out/monaco/vs/nls.messages.ko.js.js +25 -0
- package/admin-out/monaco/vs/nls.messages.pl.js.js +17 -0
- package/admin-out/monaco/vs/nls.messages.pt-br.js.js +6 -0
- package/admin-out/monaco/vs/nls.messages.ru.js.js +17 -0
- package/admin-out/monaco/vs/nls.messages.tr.js.js +15 -0
- package/admin-out/monaco/vs/nls.messages.zh-cn.js.js +17 -0
- package/admin-out/monaco/vs/nls.messages.zh-tw.js.js +15 -0
- package/admin-out/monaco/vs/objective-c-CntZFaHX.js +1 -0
- package/admin-out/monaco/vs/pascal-r6kuqfl_.js +1 -0
- package/admin-out/monaco/vs/pascaligo-BiXoTmXh.js +1 -0
- package/admin-out/monaco/vs/perl-DABw_TcH.js +1 -0
- package/admin-out/monaco/vs/pgsql-me_jFXeX.js +1 -0
- package/admin-out/monaco/vs/php-D_kh-9LK.js +1 -0
- package/admin-out/monaco/vs/pla-VfZjczW0.js +1 -0
- package/admin-out/monaco/vs/postiats-BBSzz8Pk.js +1 -0
- package/admin-out/monaco/vs/powerquery-Dt-g_2cc.js +1 -0
- package/admin-out/monaco/vs/powershell-B-7ap1zc.js +1 -0
- package/admin-out/monaco/vs/protobuf-BmtuEB1A.js +2 -0
- package/admin-out/monaco/vs/pug-BRpRNeEb.js +1 -0
- package/admin-out/monaco/vs/python-Cr0UkIbn.js +1 -0
- package/admin-out/monaco/vs/qsharp-BzsFaUU9.js +1 -0
- package/admin-out/monaco/vs/r-f8dDdrp4.js +1 -0
- package/admin-out/monaco/vs/razor-BYAHOTkz.js +1 -0
- package/admin-out/monaco/vs/redis-fvZQY4PI.js +1 -0
- package/admin-out/monaco/vs/redshift-45Et0LQi.js +1 -0
- package/admin-out/monaco/vs/restructuredtext-C7UUFKFD.js +1 -0
- package/admin-out/monaco/vs/ruby-CZO8zYTz.js +1 -0
- package/admin-out/monaco/vs/rust-Bfetafyc.js +1 -0
- package/admin-out/monaco/vs/sb-3GYllVck.js +1 -0
- package/admin-out/monaco/vs/scala-foMgrKo1.js +1 -0
- package/admin-out/monaco/vs/scheme-CHdMtr7p.js +1 -0
- package/admin-out/monaco/vs/scss-C1cmLt9V.js +3 -0
- package/admin-out/monaco/vs/shell-ClXCKCEW.js +1 -0
- package/admin-out/monaco/vs/solidity-MZ6ExpPy.js +1 -0
- package/admin-out/monaco/vs/sophia-DWkuSsPQ.js +1 -0
- package/admin-out/monaco/vs/sparql-AUGFYSyk.js +1 -0
- package/admin-out/monaco/vs/sql-32GpJSV2.js +1 -0
- package/admin-out/monaco/vs/st-CuDFIVZ_.js +1 -0
- package/admin-out/monaco/vs/swift-n-2HociN.js +3 -0
- package/admin-out/monaco/vs/systemverilog-Ch4vA8Yt.js +1 -0
- package/admin-out/monaco/vs/tcl-D74tq1nH.js +1 -0
- package/admin-out/monaco/vs/tsMode-CZz1Umrk.js +11 -0
- package/admin-out/monaco/vs/twig-C6taOxMV.js +1 -0
- package/admin-out/monaco/vs/typescript-DfOrAzoV.js +1 -0
- package/admin-out/monaco/vs/typespec-D-PIh9Xw.js +1 -0
- package/admin-out/monaco/vs/vb-Dyb2648j.js +1 -0
- package/admin-out/monaco/vs/wgsl-BhLXMOR0.js +298 -0
- package/admin-out/monaco/vs/workers-DcJshg-q.js +1 -0
- package/admin-out/monaco/vs/xml-CdsdnY8S.js +1 -0
- package/admin-out/monaco/vs/yaml-DYGvmE88.js +1 -0
- package/bin/halo.js +9 -0
- package/bundled-docs/design/agent.md +145 -0
- package/bundled-docs/design/architecture.md +270 -0
- package/bundled-docs/design/background-dispatch.md +151 -0
- package/bundled-docs/design/command.md +58 -0
- package/bundled-docs/design/cron.md +88 -0
- package/bundled-docs/design/evolution.md +383 -0
- package/bundled-docs/design/express-self.md +145 -0
- package/bundled-docs/design/feishu.md +224 -0
- package/bundled-docs/design/halo-city.md +112 -0
- package/bundled-docs/design/prompt-system.md +411 -0
- package/bundled-docs/design/session.md +321 -0
- package/bundled-docs/design/slack.md +212 -0
- package/bundled-docs/design/storage.md +578 -0
- package/bundled-docs/design/telegram.md +161 -0
- package/bundled-docs/design/web.md +222 -0
- package/bundled-docs/design/wechat.md +146 -0
- package/bundled-docs/design/ws.md +144 -0
- package/bundled-docs/dev/acp-adapter.md +337 -0
- package/bundled-docs/dev/add-channel.md +376 -0
- package/bundled-docs/dev/add-model-provider.md +386 -0
- package/bundled-docs/dev/api.md +686 -0
- package/bundled-docs/dev/deploy.md +198 -0
- package/bundled-docs/dev/desktop-packaging.md +327 -0
- package/bundled-docs/dev/env.md +158 -0
- package/bundled-docs/dev/logging.md +85 -0
- package/bundled-docs/dev/previews.md +225 -0
- package/bundled-docs/dev/tools.md +331 -0
- package/bundled-docs/guide/README.md +29 -0
- package/bundled-docs/guide/agents.md +264 -0
- package/bundled-docs/guide/channels/README.md +62 -0
- package/bundled-docs/guide/channels/acp.md +150 -0
- package/bundled-docs/guide/channels/feishu.md +154 -0
- package/bundled-docs/guide/channels/slack.md +156 -0
- package/bundled-docs/guide/channels/telegram.md +112 -0
- package/bundled-docs/guide/channels/web.md +149 -0
- package/bundled-docs/guide/channels/wechat.md +110 -0
- package/bundled-docs/guide/chat.md +112 -0
- package/bundled-docs/guide/cli.md +197 -0
- package/bundled-docs/guide/getting-started.md +93 -0
- package/bundled-docs/guide/secrets-and-credentials.md +161 -0
- package/bundled-docs/guide/sessions.md +104 -0
- package/bundled-docs/guide/skills.md +302 -0
- package/bundled-docs/guide/testing-agents-and-skills.md +136 -0
- package/bundled-docs/guide/workspace.md +131 -0
- package/bundled-docs/plans/cron-tasks.md +362 -0
- package/bundled-docs/plans/design-suggestions.md +203 -0
- package/bundled-docs/plans/issue-session-deep-nesting.md +208 -0
- package/bundled-docs/plans/launch-plan.md +111 -0
- package/bundled-docs/plans/md-and-agent-refactor.md +197 -0
- package/bundled-docs/plans/remote-mac-worker.md +196 -0
- package/bundled-docs/plans/roadmap.md +40 -0
- package/bundled-docs/plans/self-evolution.md +1379 -0
- package/bundled-docs/plans/todo.md +32 -0
- package/bundled-docs/plans/weixin-channel.md +255 -0
- package/bundled-docs/requirements/agent.md +92 -0
- package/bundled-docs/requirements/chat.md +81 -0
- package/bundled-docs/requirements/command.md +130 -0
- package/bundled-docs/requirements/editor.md +82 -0
- package/bundled-docs/requirements/explorer.md +89 -0
- package/bundled-docs/requirements/overview.md +62 -0
- package/bundled-docs/requirements/session.md +73 -0
- package/bundled-docs/requirements/settings.md +224 -0
- package/bundled-docs/requirements/skill.md +125 -0
- package/bundled-docs/requirements/source-control.md +82 -0
- package/bundled-docs/requirements/terminal.md +118 -0
- package/bundled-docs/requirements/workspace.md +80 -0
- package/bundled-docs/test/docs-seeding.md +101 -0
- package/bundled-docs/test/session.md +374 -0
- package/dist/index.js +26750 -0
- package/package.json +67 -0
- package/templates/INSTRUCTIONS.md +25 -0
- package/templates/agents/__apply_agent__/AGENT.md +229 -0
- package/templates/agents/__apply_agent__/agent.yaml +30 -0
- package/templates/agents/__evo_agent__/AGENT.md +323 -0
- package/templates/agents/__evo_agent__/agent.yaml +29 -0
- package/templates/agents/__score__/AGENT.md +177 -0
- package/templates/agents/__score__/agent.yaml +29 -0
- package/templates/agents/deep-executor/AGENT.md +60 -0
- package/templates/agents/deep-executor/agent.yaml +25 -0
- package/templates/agents/default/AGENT.md +38 -0
- package/templates/agents/default/agent.yaml +51 -0
- package/templates/agents/executor/AGENT.md +38 -0
- package/templates/agents/executor/agent.yaml +25 -0
- package/templates/aliases.yaml +26 -0
- package/templates/canvas/self.html +660 -0
- package/templates/config.yaml +69 -0
- package/templates/models/anthropic.yaml +47 -0
- package/templates/models/aws-bedrock-claude-invoke.yaml +156 -0
- package/templates/models/aws-bedrock-mantle.yaml +89 -0
- package/templates/models/deepseek.yaml +62 -0
- package/templates/models/doubao.yaml +137 -0
- package/templates/models/hunyuan.yaml +56 -0
- package/templates/models/kimi.yaml +41 -0
- package/templates/models/mimo-token-plan-china.yaml +61 -0
- package/templates/models/minimax.yaml +80 -0
- package/templates/models/openai.yaml +51 -0
- package/templates/models/qwen.yaml +78 -0
- package/templates/optional-skills/tavily-web-search/SKILL.md +91 -0
- package/templates/optional-skills/tavily-web-search/config.yaml +10 -0
- package/templates/prompts/all/TOOL_GUIDELINES.md +35 -0
- package/templates/prompts/all/TOOL_SHELL.md +4 -0
- package/templates/prompts/all/TOOL_SHELL.windows.md +7 -0
- package/templates/prompts/bootstrap/BOOTSTRAP.md +26 -0
- package/templates/prompts/root/WORKSPACE_MEMORY.md +11 -0
- package/templates/schema.sql +30 -0
- package/templates/skills/acp/SKILL.md +236 -0
- package/templates/skills/acp/templates/SKILL.md.tmpl +74 -0
- package/templates/skills/acp/templates/ask.py +176 -0
- package/templates/skills/acp/templates/config.yaml.tmpl +33 -0
- package/templates/skills/agent/SKILL.md +128 -0
- package/templates/skills/aws-knowledge/SKILL.md +82 -0
- package/templates/skills/aws-knowledge/scripts/aws_kb.py +61 -0
- package/templates/skills/cron/SKILL.md +217 -0
- package/templates/skills/cron/manage-cron.py +434 -0
- package/templates/skills/halo/SKILL.md +98 -0
- package/templates/skills/nova-web-search/SKILL.md +65 -0
- package/templates/skills/self/SKILL.md +139 -0
- package/templates/skills/send-file/SKILL.md +28 -0
- package/templates/skills/send-file/feishu.md +16 -0
- package/templates/skills/send-file/slack.md +7 -0
- package/templates/skills/send-file/telegram.md +9 -0
- package/templates/skills/send-file/web.md +6 -0
- package/templates/skills/send-file/wechat.md +8 -0
- package/templates/skills/skill/SKILL.md +131 -0
- package/templates/skills/workspace/SKILL.md +28 -0
- package/templates/skills/workspace/setup-tidy.md +265 -0
- package/templates/skills/workspace/share.md +187 -0
- package/templates/skills/workspace/stage.py +487 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[443],{51443:(e,t,s)=>{let n;s.d(t,{parse:()=>tG,stringify:()=>tW});let i=Symbol.for("yaml.alias"),r=Symbol.for("yaml.document"),o=Symbol.for("yaml.map"),l=Symbol.for("yaml.pair"),a=Symbol.for("yaml.scalar"),c=Symbol.for("yaml.seq"),u=Symbol.for("yaml.node.type"),h=e=>!!e&&"object"==typeof e&&e[u]===i,f=e=>!!e&&"object"==typeof e&&e[u]===r,d=e=>!!e&&"object"==typeof e&&e[u]===o,p=e=>!!e&&"object"==typeof e&&e[u]===l,m=e=>!!e&&"object"==typeof e&&e[u]===a,y=e=>!!e&&"object"==typeof e&&e[u]===c;function g(e){if(e&&"object"==typeof e)switch(e[u]){case o:case c:return!0}return!1}function b(e){if(e&&"object"==typeof e)switch(e[u]){case i:case o:case a:case c:return!0}return!1}let k=e=>(m(e)||g(e))&&!!e.anchor,w=Symbol("break visit"),v=Symbol("skip children"),S=Symbol("remove node");function E(e,t){let s=T(t);f(e)?N(null,e.contents,s,Object.freeze([e]))===S&&(e.contents=null):N(null,e,s,Object.freeze([]))}function N(e,t,s,n){let i=I(e,t,s,n);if(b(i)||p(i))return x(e,n,i),N(e,i,s,n);if("symbol"!=typeof i){if(g(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){let i=N(e,t.items[e],s,n);if("number"==typeof i)e=i-1;else{if(i===w)return w;i===S&&(t.items.splice(e,1),e-=1)}}}else if(p(t)){n=Object.freeze(n.concat(t));let e=N("key",t.key,s,n);if(e===w)return w;e===S&&(t.key=null);let i=N("value",t.value,s,n);if(i===w)return w;i===S&&(t.value=null)}}return i}async function O(e,t){let s=T(t);f(e)?await A(null,e.contents,s,Object.freeze([e]))===S&&(e.contents=null):await A(null,e,s,Object.freeze([]))}async function A(e,t,s,n){let i=await I(e,t,s,n);if(b(i)||p(i))return x(e,n,i),A(e,i,s,n);if("symbol"!=typeof i){if(g(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){let i=await A(e,t.items[e],s,n);if("number"==typeof i)e=i-1;else{if(i===w)return w;i===S&&(t.items.splice(e,1),e-=1)}}}else if(p(t)){n=Object.freeze(n.concat(t));let e=await A("key",t.key,s,n);if(e===w)return w;e===S&&(t.key=null);let i=await A("value",t.value,s,n);if(i===w)return w;i===S&&(t.value=null)}}return i}function T(e){return"object"==typeof e&&(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 I(e,t,s,n){return"function"==typeof s?s(e,t,n):d(t)?s.Map?.(e,t,n):y(t)?s.Seq?.(e,t,n):p(t)?s.Pair?.(e,t,n):m(t)?s.Scalar?.(e,t,n):h(t)?s.Alias?.(e,t,n):void 0}function x(e,t,s){let n=t[t.length-1];if(g(n))n.items[e]=s;else if(p(n))"key"===e?n.key=s:n.value=s;else if(f(n))n.contents=s;else{let e=h(n)?"alias":"scalar";throw Error(`Cannot replace node with ${e} parent`)}}E.BREAK=w,E.SKIP=v,E.REMOVE=S,O.BREAK=w,O.SKIP=v,O.REMOVE=S;let $={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},L=e=>e.replace(/[!,[\]{}]/g,e=>$[e]);class C{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},C.defaultYaml,e),this.tags=Object.assign({},C.defaultTags,t)}clone(){let e=new C(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new C(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:C.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},C.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:C.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},C.defaultTags),this.atNextDocument=!1);let s=e.trim().split(/[ \t]+/),n=s.shift();switch(n){case"%TAG":{if(2!==s.length&&(t(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[e,n]=s;return this.tags[e]=n,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==s.length)return t(0,"%YAML directive should contain exactly one part"),!1;let[e]=s;if("1.1"===e||"1.2"===e)return this.yaml.version=e,!0;{let s=/^\d+\.\d+$/.test(e);return t(6,`Unsupported YAML version ${e}`,s),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){let s=e.slice(2,-1);return"!"===s||"!!"===s?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),s)}let[,s,n]=e.match(/^(.*!)([^!]*)$/s);n||t(`The ${e} tag has no suffix`);let i=this.tags[s];if(i)try{return i+decodeURIComponent(n)}catch(e){return t(String(e)),null}return"!"===s?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,s]of Object.entries(this.tags))if(e.startsWith(s))return t+L(e.substring(s.length));return"!"===e[0]?e:`!<${e}>`}toString(e){let t,s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);if(e&&n.length>0&&b(e.contents)){let s={};E(e.contents,(e,t)=>{b(t)&&t.tag&&(s[t.tag]=!0)}),t=Object.keys(s)}else t=[];for(let[i,r]of n)("!!"!==i||"tag:yaml.org,2002:"!==r)&&(!e||t.some(e=>e.startsWith(r)))&&s.push(`%TAG ${i} ${r}`);return s.join("\n")}}function _(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=JSON.stringify(e);throw Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0}function B(e){let t=new Set;return E(e,{Value(e,s){s.anchor&&t.add(s.anchor)}}),t}function K(e,t){for(let s=1;;++s){let n=`${e}${s}`;if(!t.has(n))return n}}function j(e,t,s,n){if(n&&"object"==typeof n)if(Array.isArray(n))for(let t=0,s=n.length;t<s;++t){let s=n[t],i=j(e,n,String(t),s);void 0===i?delete n[t]:i!==s&&(n[t]=i)}else if(n instanceof Map)for(let t of Array.from(n.keys())){let s=n.get(t),i=j(e,n,t,s);void 0===i?n.delete(t):i!==s&&n.set(t,i)}else if(n instanceof Set)for(let t of Array.from(n)){let s=j(e,n,t,t);void 0===s?n.delete(t):s!==t&&(n.delete(t),n.add(s))}else for(let[t,s]of Object.entries(n)){let i=j(e,n,t,s);void 0===i?delete n[t]:i!==s&&(n[t]=i)}return e.call(t,s,n)}function M(e,t,s){if(Array.isArray(e))return e.map((e,t)=>M(e,String(t),s));if(e&&"function"==typeof e.toJSON){if(!s||!k(e))return e.toJSON(t,s);let n={aliasCount:0,count:1,res:void 0};s.anchors.set(e,n),s.onCreate=e=>{n.res=e,delete s.onCreate};let i=e.toJSON(t,s);return s.onCreate&&s.onCreate(i),i}return"bigint"!=typeof e||s?.keep?e:Number(e)}C.defaultYaml={explicit:!1,version:"1.2"},C.defaultTags={"!!":"tag:yaml.org,2002:"};class D{constructor(e){Object.defineProperty(this,u,{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:s,onAnchor:n,reviver:i}={}){if(!f(e))throw TypeError("A document argument is required");let r={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof s?s:100},o=M(this,"",r);if("function"==typeof n)for(let{count:e,res:t}of r.anchors.values())n(t,e);return"function"==typeof i?j(i,{"":o},"",o):o}}class P extends D{constructor(e){super(i),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){let s,n;for(let i of(t?.aliasResolveCache?s=t.aliasResolveCache:(s=[],E(e,{Node:(e,t)=>{(h(t)||k(t))&&s.push(t)}}),t&&(t.aliasResolveCache=s)),s)){if(i===this)break;i.anchor===this.source&&(n=i)}return n}toJSON(e,t){if(!t)return{source:this.source};let{anchors:s,doc:n,maxAliasCount:i}=t,r=this.resolve(n,t);if(!r)throw ReferenceError(`Unresolved alias (the anchor must be set before the alias): ${this.source}`);let o=s.get(r);if(o||(M(r,null,t),o=s.get(r)),o?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(o.count+=1,0===o.aliasCount&&(o.aliasCount=function e(t,s,n){if(h(s)){let e=s.resolve(t),i=n&&e&&n.get(e);return i?i.count*i.aliasCount:0}if(g(s)){let i=0;for(let r of s.items){let s=e(t,r,n);s>i&&(i=s)}return i}return p(s)?Math.max(e(t,s.key,n),e(t,s.value,n)):1}(n,r,s)),o.count*o.aliasCount>i))throw ReferenceError("Excessive alias count indicates a resource exhaustion attack");return o.res}toString(e,t,s){let n=`*${this.source}`;if(e){if(_(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source))throw Error(`Unresolved alias (the anchor must be set before the alias): ${this.source}`);if(e.implicitKey)return`${n} `}return n}}let q=e=>!e||"function"!=typeof e&&"object"!=typeof e;class U extends D{constructor(e){super(a),this.value=e}toJSON(e,t){return t?.keep?this.value:M(this.value,e,t)}toString(){return String(this.value)}}function R(e,t,s){let n;if(f(e)&&(e=e.contents),b(e))return e;if(p(e)){let t=s.schema[o].createNode?.(s.schema,null,s);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"undefined"!=typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:l,schema:a,sourceObjects:u}=s;if(i&&e&&"object"==typeof e){if(n=u.get(e))return n.anchor??(n.anchor=r(e)),new P(n.anchor);n={anchor:null,node:null},u.set(e,n)}t?.startsWith("!!")&&(t="tag:yaml.org,2002:"+t.slice(2));let h=function(e,t,s){if(t){let e=s.filter(e=>e.tag===t),n=e.find(e=>!e.format)??e[0];if(!n)throw Error(`Tag ${t} not found`);return n}return s.find(t=>t.identify?.(e)&&!t.format)}(e,t,a.tags);if(!h){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e){let t=new U(e);return n&&(n.node=t),t}h=e instanceof Map?a[o]:Symbol.iterator in Object(e)?a[c]:a[o]}l&&(l(h),delete s.onTagObj);let d=h?.createNode?h.createNode(s.schema,e,s):"function"==typeof h?.nodeClass?.from?h.nodeClass.from(s.schema,e,s):new U(e);return t?d.tag=t:h.default||(d.tag=h.tag),n&&(n.node=d),d}function F(e,t,s){let n=s;for(let e=t.length-1;e>=0;--e){let s=t[e];if("number"==typeof s&&Number.isInteger(s)&&s>=0){let e=[];e[s]=n,n=e}else n=new Map([[s,n]])}return R(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}U.BLOCK_FOLDED="BLOCK_FOLDED",U.BLOCK_LITERAL="BLOCK_LITERAL",U.PLAIN="PLAIN",U.QUOTE_DOUBLE="QUOTE_DOUBLE",U.QUOTE_SINGLE="QUOTE_SINGLE";let J=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class V extends D{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=>b(t)||p(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(J(e))this.add(t);else{let[s,...n]=e,i=this.get(s,!0);if(g(i))i.addIn(n,t);else if(void 0===i&&this.schema)this.set(s,F(this.schema,n,t));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}}deleteIn(e){let[t,...s]=e;if(0===s.length)return this.delete(t);let n=this.get(t,!0);if(g(n))return n.deleteIn(s);throw Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){let[s,...n]=e,i=this.get(s,!0);return 0===n.length?!t&&m(i)?i.value:i:g(i)?i.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!p(t))return!1;let s=t.value;return null==s||e&&m(s)&&null==s.value&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){let[t,...s]=e;if(0===s.length)return this.has(t);let n=this.get(t,!0);return!!g(n)&&n.hasIn(s)}setIn(e,t){let[s,...n]=e;if(0===n.length)this.set(s,t);else{let e=this.get(s,!0);if(g(e))e.setIn(n,t);else if(void 0===e&&this.schema)this.set(s,F(this.schema,n,t));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${n}`)}}}let G=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function W(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}let Y=(e,t,s)=>e.endsWith("\n")?W(s,t):s.includes("\n")?"\n"+W(s,t):(e.endsWith(" ")?"":" ")+s,H="flow",Q="block",X="quoted";function z(e,t,s="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:l}={}){let a,c,u;if(!i||i<0)return e;i<r&&(r=0);let h=Math.max(1+r,1+i-t.length);if(e.length<=h)return e;let f=[],d={},p=i-t.length;"number"==typeof n&&(n>i-Math.max(2,r)?f.push(0):p=i-n);let m=!1,y=-1,g=-1,b=-1;for(s===Q&&-1!==(y=Z(e,y,t.length))&&(p=y+h);u=e[y+=1];){if(s===X&&"\\"===u){switch(g=y,e[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}b=y}if("\n"===u)s===Q&&(y=Z(e,y,t.length)),p=y+t.length+h,a=void 0;else{if(" "===u&&c&&" "!==c&&"\n"!==c&&" "!==c){let t=e[y+1];t&&" "!==t&&"\n"!==t&&" "!==t&&(a=y)}if(y>=p)if(a)f.push(a),p=a+h,a=void 0;else if(s===X){for(;" "===c||" "===c;)c=u,u=e[y+=1],m=!0;let t=y>b+1?y-2:g-1;if(d[t])return e;f.push(t),d[t]=!0,p=t+h,a=void 0}else m=!0}c=u}if(m&&l&&l(),0===f.length)return e;o&&o();let k=e.slice(0,f[0]);for(let n=0;n<f.length;++n){let i=f[n],r=f[n+1]||e.length;0===i?k=`
|
|
2
|
+
${t}${e.slice(0,r)}`:(s===X&&d[i]&&(k+=`${e[i]}\\`),k+=`
|
|
3
|
+
${t}${e.slice(i+1,r)}`)}return k}function Z(e,t,s){let n=t,i=t+1,r=e[i];for(;" "===r||" "===r;)if(t<i+s)r=e[++t];else{do r=e[++t];while(r&&"\n"!==r);n=t,r=e[i=t+1]}return n}let ee=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),et=e=>/^(%|---|\.\.\.)/m.test(e);function es(e,t){let s=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return s;let{implicitKey:n}=t,i=t.options.doubleQuotedMinMultiLineLength,r=t.indent||(et(e)?" ":""),o="",l=0;for(let e=0,t=s[e];t;t=s[++e])if(" "===t&&"\\"===s[e+1]&&"n"===s[e+2]&&(o+=s.slice(l,e)+"\\ ",e+=1,l=e,t="\\"),"\\"===t)switch(s[e+1]){case"u":{o+=s.slice(l,e);let t=s.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:"00"===t.substr(0,2)?o+="\\x"+t.substr(2):o+=s.substr(e,6)}e+=5,l=e+1}break;case"n":if(n||'"'===s[e+2]||s.length<i)e+=1;else{for(o+=s.slice(l,e)+"\n\n";"\\"===s[e+2]&&"n"===s[e+3]&&'"'!==s[e+4];)o+="\n",e+=2;o+=r," "===s[e+2]&&(o+="\\"),e+=1,l=e+1}break;default:e+=1}return o=l?o+s.slice(l):s,n?o:z(o,r,X,ee(t,!1))}function en(e,t){if(!1===t.options.singleQuote||t.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return es(e,t);let s=t.indent||(et(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
4
|
+
${s}`)+"'";return t.implicitKey?n:z(n,s,H,ee(t,!1))}function ei(e,t){let s,{singleQuote:n}=t.options;if(!1===n)s=es;else{let t=e.includes('"'),i=e.includes("'");s=t&&!i?en:i&&!t?es:n?en:es}return s(e,t)}try{n=RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{n=/\n+(?!\n|$)/g}function er({comment:e,type:t,value:s},i,r,o){let l,a,c,{blockQuote:u,commentString:h,lineWidth:f}=i.options;if(!u||/\n[\t ]+$/.test(s))return ei(s,i);let d=i.indent||(i.forceBlockIndent||et(s)?" ":""),p="literal"===u||"folded"!==u&&t!==U.BLOCK_FOLDED&&(t===U.BLOCK_LITERAL||!function(e,t,s){if(!t||t<0)return!1;let n=t-s,i=e.length;if(i<=n)return!1;for(let t=0,s=0;t<i;++t)if("\n"===e[t]){if(t-s>n)return!0;if(i-(s=t+1)<=n)return!1}return!0}(s,f,d.length));if(!s)return p?"|\n":">\n";for(a=s.length;a>0;--a){let e=s[a-1];if("\n"!==e&&" "!==e&&" "!==e)break}let m=s.substring(a),y=m.indexOf("\n");-1===y?l="-":s===m||y!==m.length-1?(l="+",o&&o()):l="",m&&(s=s.slice(0,-m.length),"\n"===m[m.length-1]&&(m=m.slice(0,-1)),m=m.replace(n,`$&${d}`));let g=!1,b=-1;for(c=0;c<s.length;++c){let e=s[c];if(" "===e)g=!0;else if("\n"===e)b=c;else break}let k=s.substring(0,b<c?b+1:c);k&&(s=s.substring(k.length),k=k.replace(/\n+/g,`$&${d}`));let w=d?"2":"1",v=(g?w:"")+l;if(e&&(v+=" "+h(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!p){let e=s.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`),n=!1,r=ee(i,!0);"folded"!==u&&t!==U.BLOCK_FOLDED&&(r.onOverflow=()=>{n=!0});let o=z(`${k}${e}${m}`,d,Q,r);if(!n)return`>${v}
|
|
5
|
+
${d}${o}`}return s=s.replace(/\n+/g,`$&${d}`),`|${v}
|
|
6
|
+
${d}${k}${s}${m}`}function eo(e,t,s,n){let{implicitKey:i,inFlow:r}=t,o="string"==typeof e.value?e:Object.assign({},e,{value:String(e.value)}),{type:l}=e;l!==U.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=U.QUOTE_DOUBLE);let a=e=>{switch(e){case U.BLOCK_FOLDED:case U.BLOCK_LITERAL:return i||r?ei(o.value,t):er(o,t,s,n);case U.QUOTE_DOUBLE:return es(o.value,t);case U.QUOTE_SINGLE:return en(o.value,t);case U.PLAIN:return function(e,t,s,n){let{type:i,value:r}=e,{actualString:o,implicitKey:l,indent:a,indentStep:c,inFlow:u}=t;if(l&&r.includes("\n")||u&&/[[\]{},]/.test(r))return ei(r,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return l||u||!r.includes("\n")?ei(r,t):er(e,t,s,n);if(!l&&!u&&i!==U.PLAIN&&r.includes("\n"))return er(e,t,s,n);if(et(r)){if(""===a)return t.forceBlockIndent=!0,er(e,t,s,n);else if(l&&a===c)return ei(r,t)}let h=r.replace(/\n+/g,`$&
|
|
7
|
+
${a}`);if(o){let e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(h),{compat:s,tags:n}=t.doc.schema;if(n.some(e)||s?.some(e))return ei(r,t)}return l?h:z(h,a,H,ee(t,!1))}(o,t,s,n);default:return null}},c=a(l);if(null===c){let{defaultKeyType:e,defaultStringType:s}=t.options,n=i&&e||s;if(null===(c=a(n)))throw Error(`Unsupported default string type ${n}`)}return c}function el(e,t){let s,n=Object.assign({blockQuote:!0,commentString:G,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);switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof n.indent?" ".repeat(n.indent):" ",inFlow:s,options:n}}function ea(e,t,s,n){let i;if(p(e))return e.toString(t,s,n);if(h(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 r=b(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??(i=function(e,t){let s,n;if(t.tag){let s=e.filter(e=>e.tag===t.tag);if(s.length>0)return s.find(e=>e.format===t.format)??s[0]}if(m(t)){s=t.value;let i=e.filter(e=>e.identify?.(s));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 s=t,n=e.find(e=>e.nodeClass&&s instanceof e.nodeClass);if(!n){let e=s?.constructor?.name??(null===s?"null":typeof s);throw Error(`Tag not resolved for ${e} value`)}return n}(t.doc.schema.tags,r));let o=function(e,t,{anchors:s,doc:n}){if(!n.directives)return"";let i=[],r=(m(e)||g(e))&&e.anchor;r&&_(r)&&(s.add(r),i.push(`&${r}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(n.directives.tagString(o)),i.join(" ")}(r,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let l="function"==typeof i.stringify?i.stringify(r,t,s,n):m(r)?eo(r,t,s,n):r.toString(t,s,n);return o?m(r)||"{"===l[0]||"["===l[0]?`${o} ${l}`:`${o}
|
|
8
|
+
${t.indent}${l}`:l}function ec(e,t){("debug"===e||"warn"===e)&&console.warn(t)}let eu={identify:e=>"<<"===e||"symbol"==typeof e&&"<<"===e.description,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new U(Symbol("<<")),{addToJSMap:eh}),stringify:()=>"<<"};function eh(e,t,s){if(y(s=e&&h(s)?s.resolve(e.doc):s))for(let n of s.items)ef(e,t,n);else if(Array.isArray(s))for(let n of s)ef(e,t,n);else ef(e,t,s)}function ef(e,t,s){let n=e&&h(s)?s.resolve(e.doc):s;if(!d(n))throw Error("Merge sources must be maps or map aliases");for(let[s,i]of n.toJSON(null,e,Map))t instanceof Map?t.has(s)||t.set(s,i):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:i,writable:!0,enumerable:!0,configurable:!0});return t}function ed(e,t,{key:s,value:n}){if(b(s)&&s.addToJSMap)s.addToJSMap(e,t,n);else if((eu.identify(s)||m(s)&&(!s.type||s.type===U.PLAIN)&&eu.identify(s.value))&&e?.doc.schema.tags.some(e=>e.tag===eu.tag&&e.default))eh(e,t,n);else{let i=M(s,"",e);if(t instanceof Map)t.set(i,M(n,i,e));else if(t instanceof Set)t.add(i);else{let r=function(e,t,s){if(null===t)return"";if("object"!=typeof t)return String(t);if(b(e)&&s?.doc){let t=el(s.doc,{});for(let e of(t.anchors=new Set,s.anchors.keys()))t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let n=e.toString(t);if(!s.mapKeyWarned){let e=JSON.stringify(n);e.length>40&&(e=e.substring(0,36)+'..."'),ec(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return n}return JSON.stringify(t)}(s,i,e),o=M(n,r,e);r in t?Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[r]=o}}return t}function ep(e,t,s){return new em(R(e,void 0,s),R(t,void 0,s))}class em{constructor(e,t=null){Object.defineProperty(this,u,{value:l}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;return b(t)&&(t=t.clone(e)),b(s)&&(s=s.clone(e)),new em(t,s)}toJSON(e,t){let s=t?.mapAsMap?new Map:{};return ed(t,s,this)}toString(e,t,s){return e?.doc?function({key:e,value:t},s,n,i){let r,o,l,{allNullValues:a,doc:c,indent:u,indentStep:h,options:{commentString:f,indentSeq:d,simpleKeys:p}}=s,k=b(e)&&e.comment||null;if(p){if(k)throw Error("With simple keys, key nodes cannot have comments");if(g(e)||!b(e)&&"object"==typeof e)throw Error("With simple keys, collection cannot be used as a key value")}let w=!p&&(!e||k&&null==t&&!s.inFlow||g(e)||(m(e)?e.type===U.BLOCK_FOLDED||e.type===U.BLOCK_LITERAL:"object"==typeof e));s=Object.assign({},s,{allNullValues:!1,implicitKey:!w&&(p||!a),indent:u+h});let v=!1,S=!1,E=ea(e,s,()=>v=!0,()=>S=!0);if(!w&&!s.inFlow&&E.length>1024){if(p)throw Error("With simple keys, single line scalar must not span more than 1024 characters");w=!0}if(s.inFlow){if(a||null==t)return v&&n&&n(),""===E?"?":w?`? ${E}`:E}else if(a&&!p||null==t&&w)return E=`? ${E}`,k&&!v?E+=Y(E,s.indent,f(k)):S&&i&&i(),E;v&&(k=null),w?(k&&(E+=Y(E,s.indent,f(k))),E=`? ${E}
|
|
9
|
+
${u}:`):(E=`${E}:`,k&&(E+=Y(E,s.indent,f(k)))),b(t)?(r=!!t.spaceBefore,o=t.commentBefore,l=t.comment):(r=!1,o=null,l=null,t&&"object"==typeof t&&(t=c.createNode(t))),s.implicitKey=!1,!w&&!k&&m(t)&&(s.indentAtStart=E.length+1),S=!1,!(!d&&h.length>=2&&!s.inFlow&&!w&&y(t))||t.flow||t.tag||t.anchor||(s.indent=s.indent.substring(2));let N=!1,O=ea(t,s,()=>N=!0,()=>S=!0),A=" ";if(k||r||o){if(A=r?"\n":"",o){let e=f(o);A+=`
|
|
10
|
+
${W(e,s.indent)}`}""!==O||s.inFlow?A+=`
|
|
11
|
+
${s.indent}`:"\n"===A&&l&&(A="\n\n")}else if(!w&&g(t)){let e=O[0],n=O.indexOf("\n"),i=-1!==n,r=s.inFlow??t.flow??0===t.items.length;if(i||!r){let t=!1;if(i&&("&"===e||"!"===e)){let s=O.indexOf(" ");"&"===e&&-1!==s&&s<n&&"!"===O[s+1]&&(s=O.indexOf(" ",s+1)),(-1===s||n<s)&&(t=!0)}t||(A=`
|
|
12
|
+
${s.indent}`)}}else(""===O||"\n"===O[0])&&(A="");return E+=A+O,s.inFlow?N&&n&&n():l&&!N?E+=Y(E,s.indent,f(l)):S&&i&&i(),E}(this,e,t,s):JSON.stringify(this)}}function ey(e,t,s){return(t.inFlow??e.flow?function({items:e},t,{flowChars:s,itemIndent:n}){let{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:l}}=t,a=Object.assign({},t,{indent:n+=r,inFlow:!0,type:null}),c=!1,u=0,h=[];for(let s=0;s<e.length;++s){let i=e[s],r=null;if(b(i))i.spaceBefore&&h.push(""),eg(t,h,i.commentBefore,!1),i.comment&&(r=i.comment);else if(p(i)){let e=b(i.key)?i.key:null;e&&(e.spaceBefore&&h.push(""),eg(t,h,e.commentBefore,!1),e.comment&&(c=!0));let s=b(i.value)?i.value:null;s?(s.comment&&(r=s.comment),s.commentBefore&&(c=!0)):null==i.value&&e?.comment&&(r=e.comment)}r&&(c=!0);let o=ea(i,a,()=>r=null);c||(c=h.length>u||o.includes("\n")),s<e.length-1?o+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(c||(c=h.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth)),c&&(o+=",")),r&&(o+=Y(o,n,l(r))),h.push(o),u=h.length}let{start:f,end:d}=s;if(0===h.length)return f+d;if(!c){let e=h.reduce((e,t)=>e+t.length+2,2);c=t.options.lineWidth>0&&e>t.options.lineWidth}if(!c)return`${f}${o}${h.join(" ")}${o}${d}`;{let e=f;for(let t of h)e+=t?`
|
|
13
|
+
${r}${i}${t}`:"\n";return`${e}
|
|
14
|
+
${i}${d}`}}:function({comment:e,items:t},s,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:l}){let a,{indent:c,options:{commentString:u}}=s,h=Object.assign({},s,{indent:r,type:null}),f=!1,d=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(b(i))!f&&i.spaceBefore&&d.push(""),eg(s,d,i.commentBefore,f),i.comment&&(o=i.comment);else if(p(i)){let e=b(i.key)?i.key:null;e&&(!f&&e.spaceBefore&&d.push(""),eg(s,d,e.commentBefore,f))}f=!1;let l=ea(i,h,()=>o=null,()=>f=!0);o&&(l+=Y(l,r,u(o))),f&&o&&(f=!1),d.push(n+l)}if(0===d.length)a=i.start+i.end;else{a=d[0];for(let e=1;e<d.length;++e){let t=d[e];a+=t?`
|
|
15
|
+
${c}${t}`:"\n"}}return e?(a+="\n"+W(u(e),c),l&&l()):f&&o&&o(),a})(e,t,s)}function eg({indent:e,options:{commentString:t}},s,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let i=W(t(n),e);s.push(i.trimStart())}}function eb(e,t){let s=m(t)?t.value:t;for(let n of e)if(p(n)&&(n.key===t||n.key===s||m(n.key)&&n.key.value===s))return n}class ek extends V{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(o,e),this.items=[]}static from(e,t,s){let{keepUndefined:n,replacer:i}=s,r=new this(e),o=(e,o)=>{if("function"==typeof i)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(void 0!==o||n)&&r.items.push(ep(e,o,s))};if(t instanceof Map)for(let[e,s]of t)o(e,s);else if(t&&"object"==typeof t)for(let e of Object.keys(t))o(e,t[e]);return"function"==typeof e.sortMapEntries&&r.items.sort(e.sortMapEntries),r}add(e,t){let s;s=p(e)?e:e&&"object"==typeof e&&"key"in e?new em(e.key,e.value):new em(e,e?.value);let n=eb(this.items,s.key),i=this.schema?.sortMapEntries;if(n){if(!t)throw Error(`Key ${s.key} already set`);m(n.value)&&q(s.value)?n.value.value=s.value:n.value=s.value}else if(i){let e=this.items.findIndex(e=>0>i(s,e));-1===e?this.items.push(s):this.items.splice(e,0,s)}else this.items.push(s)}delete(e){let t=eb(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let s=eb(this.items,e),n=s?.value;return(!t&&m(n)?n.value:n)??void 0}has(e){return!!eb(this.items,e)}set(e,t){this.add(new em(e,t),!0)}toJSON(e,t,s){let n=s?new s:t?.mapAsMap?new Map:{};for(let e of(t?.onCreate&&t.onCreate(n),this.items))ed(t,n,e);return n}toString(e,t,s){if(!e)return JSON.stringify(this);for(let e of this.items)if(!p(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})),ey(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}}let ew={collection:"map",default:!0,nodeClass:ek,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(d(e)||t("Expected a mapping for this tag"),e),createNode:(e,t,s)=>ek.from(e,t,s)};class ev extends V{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(c,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=eS(e);return"number"==typeof t&&this.items.splice(t,1).length>0}get(e,t){let s=eS(e);if("number"!=typeof s)return;let n=this.items[s];return!t&&m(n)?n.value:n}has(e){let t=eS(e);return"number"==typeof t&&t<this.items.length}set(e,t){let s=eS(e);if("number"!=typeof s)throw Error(`Expected a valid index, not ${e}.`);let n=this.items[s];m(n)&&q(t)?n.value=t:this.items[s]=t}toJSON(e,t){let s=[];t?.onCreate&&t.onCreate(s);let n=0;for(let e of this.items)s.push(M(e,String(n++),t));return s}toString(e,t,s){return e?ey(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:t}):JSON.stringify(this)}static from(e,t,s){let{replacer:n}=s,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let r of t){if("function"==typeof n){let s=t instanceof Set?r:String(e++);r=n.call(t,s,r)}i.items.push(R(r,void 0,s))}}return i}}function eS(e){let t=m(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}let eE={collection:"seq",default:!0,nodeClass:ev,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(y(e)||t("Expected a sequence for this tag"),e),createNode:(e,t,s)=>ev.from(e,t,s)},eN={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(e,t,s,n)=>eo(e,t=Object.assign({actualString:!0},t),s,n)},eO={identify:e=>null==e,createNode:()=>new U(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new U(null),stringify:({source:e},t)=>"string"==typeof e&&eO.test.test(e)?e:t.options.nullStr},eA={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new U("t"===e[0]||"T"===e[0]),stringify:({source:e,value:t},s)=>e&&eA.test.test(e)&&t===("t"===e[0]||"T"===e[0])?e:t?s.options.trueStr:s.options.falseStr};function eT({format:e,minFractionDigits:t,tag:s,value:n}){if("bigint"==typeof n)return String(n);let i="number"==typeof n?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!s||"tag:yaml.org,2002:float"===s)&&/^\d/.test(r)){let e=r.indexOf(".");e<0&&(e=r.length,r+=".");let s=t-(r.length-e-1);for(;s-- >0;)r+="0"}return r}let eI={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?-1/0:1/0,stringify:eT},ex={identify:e=>"number"==typeof e,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():eT(e)}},e$={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new U(parseFloat(e)),s=e.indexOf(".");return -1!==s&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-s-1),t},stringify:eT},eL=e=>"bigint"==typeof e||Number.isInteger(e),eC=(e,t,s,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),s);function e_(e,t,s){let{value:n}=e;return eL(n)&&n>=0?s+n.toString(t):eT(e)}let eB={identify:e=>eL(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,s)=>eC(e,2,8,s),stringify:e=>e_(e,8,"0o")},eK={identify:eL,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>eC(e,0,10,s),stringify:eT},ej={identify:e=>eL(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,s)=>eC(e,2,16,s),stringify:e=>e_(e,16,"0x")},eM=[ew,eE,eN,eO,eA,eB,eK,ej,eI,ex,e$];function eD(e){return"bigint"==typeof e||Number.isInteger(e)}let eP=({value:e})=>JSON.stringify(e),eq=[ew,eE].concat([{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:eP},{identify:e=>null==e,createNode:()=>new U(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:eP},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:eP},{identify:eD,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:s})=>s?BigInt(e):parseInt(e,10),stringify:({value:e})=>eD(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:eP}],{default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)}),eU={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if("function"!=typeof atob)return t("This environment does not support reading binary tags; either Buffer or atob is required"),e;{let t=atob(e.replace(/[\n\r]/g,"")),s=new Uint8Array(t.length);for(let e=0;e<t.length;++e)s[e]=t.charCodeAt(e);return s}},stringify({comment:e,type:t,value:s},n,i,r){let o;if(!s)return"";if("function"==typeof btoa){let e="";for(let t=0;t<s.length;++t)e+=String.fromCharCode(s[t]);o=btoa(e)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=U.BLOCK_LITERAL),t!==U.QUOTE_DOUBLE){let e=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),s=Math.ceil(o.length/e),i=Array(s);for(let t=0,n=0;t<s;++t,n+=e)i[t]=o.substr(n,e);o=i.join(t===U.BLOCK_LITERAL?"\n":" ")}return eo({comment:e,type:t,value:o},n,i,r)}};function eR(e,t){if(y(e))for(let s=0;s<e.items.length;++s){let n=e.items[s];if(!p(n)){if(d(n)){n.items.length>1&&t("Each pair must have its own sequence indicator");let e=n.items[0]||new em(new U(null));if(n.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${n.commentBefore}
|
|
16
|
+
${e.key.commentBefore}`:n.commentBefore),n.comment){let t=e.value??e.key;t.comment=t.comment?`${n.comment}
|
|
17
|
+
${t.comment}`:n.comment}n=e}e.items[s]=p(n)?n:new em(n)}}else t("Expected a sequence for this tag");return e}function eF(e,t,s){let{replacer:n}=s,i=new ev(e);i.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let e of t){let o,l;if("function"==typeof n&&(e=n.call(t,String(r++),e)),Array.isArray(e))if(2===e.length)o=e[0],l=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(1===t.length)l=e[o=t[0]];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(ep(o,l,s))}return i}let eJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:eR,createNode:eF};class eV extends ev{constructor(){super(),this.add=ek.prototype.add.bind(this),this.delete=ek.prototype.delete.bind(this),this.get=ek.prototype.get.bind(this),this.has=ek.prototype.has.bind(this),this.set=ek.prototype.set.bind(this),this.tag=eV.tag}toJSON(e,t){if(!t)return super.toJSON(e);let s=new Map;for(let e of(t?.onCreate&&t.onCreate(s),this.items)){let n,i;if(p(e)?(n=M(e.key,"",t),i=M(e.value,n,t)):n=M(e,"",t),s.has(n))throw Error("Ordered maps must not include duplicate keys");s.set(n,i)}return s}static from(e,t,s){let n=eF(e,t,s),i=new this;return i.items=n.items,i}}eV.tag="tag:yaml.org,2002:omap";let eG={collection:"seq",identify:e=>e instanceof Map,nodeClass:eV,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let s=eR(e,t),n=[];for(let{key:e}of s.items)m(e)&&(n.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):n.push(e.value));return Object.assign(new eV,s)},createNode:(e,t,s)=>eV.from(e,t,s)};function eW({value:e,source:t},s){return t&&(e?eY:eH).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}let eY={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new U(!0),stringify:eW},eH={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new U(!1),stringify:eW},eQ=e=>"bigint"==typeof e||Number.isInteger(e);function eX(e,t,s,{intAsBigInt:n}){let i=e[0];if(("-"===i||"+"===i)&&(t+=1),e=e.substring(t).replace(/_/g,""),n){switch(s){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 r=parseInt(e,s);return"-"===i?-1*r:r}function ez(e,t,s){let{value:n}=e;if(eQ(n)){let e=n.toString(t);return n<0?"-"+s+e.substr(1):s+e}return eT(e)}class eZ extends ek{constructor(e){super(e),this.tag=eZ.tag}add(e){let t;t=p(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new em(e.key,null):new em(e,null),eb(this.items,t.key)||this.items.push(t)}get(e,t){let s=eb(this.items,e);return!t&&p(s)?m(s.key)?s.key.value:s.key:s}set(e,t){if("boolean"!=typeof t)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let s=eb(this.items,e);s&&!t?this.items.splice(this.items.indexOf(s),1):!s&&t&&this.items.push(new em(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);throw Error("Set items must all have null values")}static from(e,t,s){let{replacer:n}=s,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)"function"==typeof n&&(e=n.call(t,e,e)),i.items.push(ep(e,null,s));return i}}eZ.tag="tag:yaml.org,2002:set";let e0={collection:"map",identify:e=>e instanceof Set,nodeClass:eZ,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>eZ.from(e,t,s),resolve(e,t){if(d(e))if(e.hasAllNullValues(!0))return Object.assign(new eZ,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};function e1(e,t){let s=e[0],n="-"===s||"+"===s?e.substring(1):e,i=e=>t?BigInt(e):Number(e),r=n.replace(/_/g,"").split(":").reduce((e,t)=>e*i(60)+i(t),i(0));return"-"===s?i(-1)*r:r}function e2(e){let{value:t}=e,s=e=>e;if("bigint"==typeof t)s=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return eT(e);let n="";t<0&&(n="-",t*=s(-1));let i=s(60),r=[t%i];return t<60?r.unshift(0):(t=(t-r[0])/i,r.unshift(t%i),t>=60&&(t=(t-r[0])/i,r.unshift(t))),n+r.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}let e9={identify:e=>"bigint"==typeof e||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:s})=>e1(e,s),stringify:e2},e8={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>e1(e,!1),stringify:e2},e4={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(e4.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,s,n,i,r,o,l]=t.map(Number),a=Date.UTC(s,n-1,i,r||0,o||0,l||0,t[7]?Number((t[7]+"00").substr(1,3)):0),c=t[8];if(c&&"Z"!==c){let e=e1(c,!1);30>Math.abs(e)&&(e*=60),a-=6e4*e}return new Date(a)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},e3=[ew,eE,eN,eO,eY,eH,{identify:eQ,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>eX(e,2,2,s),stringify:e=>ez(e,2,"0b")},{identify:eQ,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>eX(e,1,8,s),stringify:e=>ez(e,8,"0")},{identify:eQ,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>eX(e,0,10,s),stringify:eT},{identify:eQ,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>eX(e,2,16,s),stringify:e=>ez(e,16,"0x")},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?-1/0:1/0,stringify:eT},{identify:e=>"number"==typeof e,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():eT(e)}},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new U(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(-1!==s){let n=e.substring(s+1).replace(/_/g,"");"0"===n[n.length-1]&&(t.minFractionDigits=n.length)}return t},stringify:eT},eU,eu,eG,eJ,e0,e9,e8,e4],e6=new Map([["core",eM],["failsafe",[ew,eE,eN]],["json",eq],["yaml11",e3],["yaml-1.1",e3]]),e7={binary:eU,bool:eA,float:e$,floatExp:ex,floatNaN:eI,floatTime:e8,int:eK,intHex:ej,intOct:eB,intTime:e9,map:ew,merge:eu,null:eO,omap:eG,pairs:eJ,seq:eE,set:e0,timestamp:e4},e5={"tag:yaml.org,2002:binary":eU,"tag:yaml.org,2002:merge":eu,"tag:yaml.org,2002:omap":eG,"tag:yaml.org,2002:pairs":eJ,"tag:yaml.org,2002:set":e0,"tag:yaml.org,2002:timestamp":e4};function te(e,t,s){let n=e6.get(t);if(n&&!e)return s&&!n.includes(eu)?n.concat(eu):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(e6.keys()).filter(e=>"yaml11"!==e).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"function"==typeof e&&(i=e(i.slice()));return s&&(i=i.concat(eu)),i.reduce((e,t)=>{let s="string"==typeof t?e7[t]:t;if(!s){let e=JSON.stringify(t),s=Object.keys(e7).map(e=>JSON.stringify(e)).join(", ");throw Error(`Unknown custom tag ${e}; use one of ${s}`)}return e.includes(s)||e.push(s),e},[])}let tt=(e,t)=>e.key<t.key?-1:+(e.key>t.key);class ts{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:n,schema:i,sortMapEntries:r,toStringDefaults:l}){this.compat=Array.isArray(e)?te(e,"compat"):e?te(null,e):null,this.name="string"==typeof i&&i||"core",this.knownTags=n?e5:{},this.tags=te(t,this.name,s),this.toStringOptions=l??null,Object.defineProperty(this,o,{value:ew}),Object.defineProperty(this,a,{value:eN}),Object.defineProperty(this,c,{value:eE}),this.sortMapEntries="function"==typeof r?r:!0===r?tt:null}clone(){let e=Object.create(ts.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}class tn{constructor(e,t,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,u,{value:r});let n=null;"function"==typeof t||Array.isArray(t)?n=t:void 0===s&&t&&(s=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=i;let{version:o}=i;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new C({version:o}),this.setSchema(o,s),this.contents=void 0===e?null:this.createNode(e,n,s)}clone(){let e=Object.create(tn.prototype,{[u]:{value:r}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=b(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ti(this.contents)&&this.contents.add(e)}addIn(e,t){ti(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let s=B(this);e.anchor=!t||s.has(t)?K(t||"a",s):t}return new P(e.anchor)}createNode(e,t,s){let n;if("function"==typeof t)e=t.call({"":e},"",e),n=t;else if(Array.isArray(t)){let e=t.filter(e=>"number"==typeof e||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),n=t}else void 0===s&&t&&(s=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:r,flow:o,keepUndefined:l,onTagObj:a,tag:c}=s??{},{onAnchor:u,setAnchors:h,sourceObjects:f}=function(e,t){let s=[],n=new Map,i=null;return{onAnchor:n=>{s.push(n),i??(i=B(e));let r=K(t,i);return i.add(r),r},setAnchors:()=>{for(let e of s){let t=n.get(e);if("object"==typeof t&&t.anchor&&(m(t.node)||g(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:n}}(this,r||"a"),d={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:u,onTagObj:a,replacer:n,schema:this.schema,sourceObjects:f},p=R(e,c,d);return o&&g(p)&&(p.flow=!0),h(),p}createPair(e,t,s={}){return new em(this.createNode(e,null,s),this.createNode(t,null,s))}delete(e){return!!ti(this.contents)&&this.contents.delete(e)}deleteIn(e){return J(e)?null!=this.contents&&(this.contents=null,!0):!!ti(this.contents)&&this.contents.deleteIn(e)}get(e,t){return g(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return J(e)?!t&&m(this.contents)?this.contents.value:this.contents:g(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!g(this.contents)&&this.contents.has(e)}hasIn(e){return J(e)?void 0!==this.contents:!!g(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=F(this.schema,[e],t):ti(this.contents)&&this.contents.set(e,t)}setIn(e,t){J(e)?this.contents=t:null==this.contents?this.contents=F(this.schema,Array.from(e),t):ti(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){let s;switch("number"==typeof e&&(e=String(e)),e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new C({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new C({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=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(s)this.schema=new ts(Object.assign(s,t));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:n,onAnchor:i,reviver:r}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===s,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},l=M(this.contents,t??"",o);if("function"==typeof i)for(let{count:e,res:t}of o.anchors.values())i(t,e);return"function"==typeof r?j(r,{"":l},"",l):l}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)||0>=Number(e.indent))){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return function(e,t){let s=[],n=!0===t.directives;if(!1!==t.directives&&e.directives){let t=e.directives.toString(e);t?(s.push(t),n=!0):e.directives.docStart&&(n=!0)}n&&s.push("---");let i=el(e,t),{commentString:r}=i.options;if(e.commentBefore){1!==s.length&&s.unshift("");let t=r(e.commentBefore);s.unshift(W(t,""))}let o=!1,l=null;if(e.contents){if(b(e.contents)){if(e.contents.spaceBefore&&n&&s.push(""),e.contents.commentBefore){let t=r(e.contents.commentBefore);s.push(W(t,""))}i.forceBlockIndent=!!e.comment,l=e.contents.comment}let t=l?void 0:()=>o=!0,a=ea(e.contents,i,()=>l=null,t);l&&(a+=Y(a,"",r(l))),("|"===a[0]||">"===a[0])&&"---"===s[s.length-1]?s[s.length-1]=`--- ${a}`:s.push(a)}else s.push(ea(e.contents,i));if(e.directives?.docEnd)if(e.comment){let t=r(e.comment);t.includes("\n")?(s.push("..."),s.push(W(t,""))):s.push(`... ${t}`)}else s.push("...");else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,"")),t&&((!o||l)&&""!==s[s.length-1]&&s.push(""),s.push(W(r(t),"")))}return s.join("\n")+"\n"}(this,e)}}function ti(e){if(g(e))return!0;throw Error("Expected a YAML collection as document contents")}class tr extends Error{constructor(e,t,s,n){super(),this.name=e,this.code=s,this.message=n,this.pos=t}}class to extends tr{constructor(e,t,s){super("YAMLParseError",e,t,s)}}class tl extends tr{constructor(e,t,s){super("YAMLWarning",e,t,s)}}let ta=(e,t)=>s=>{if(-1===s.pos[0])return;s.linePos=s.pos.map(e=>t.linePos(e));let{line:n,col:i}=s.linePos[0];s.message+=` at line ${n}, column ${i}`;let r=i-1,o=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){let e=Math.min(r-39,o.length-79);o="…"+o.substring(e),r-=e-1}if(o.length>80&&(o=o.substring(0,79)+"…"),n>1&&/^ *$/.test(o.substring(0,r))){let s=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);s.length>80&&(s=s.substring(0,79)+"…\n"),o=s+o}if(/[^ ]/.test(o)){let e=1,t=s.linePos[1];t?.line===n&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-r)));let l=" ".repeat(r)+"^".repeat(e);s.message+=`:
|
|
18
|
+
|
|
19
|
+
${o}
|
|
20
|
+
${l}
|
|
21
|
+
`}};function tc(e,{flow:t,indicator:s,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:l}){let a=!1,c=l,u=l,h="",f="",d=!1,p=!1,m=null,y=null,g=null,b=null,k=null,w=null,v=null;for(let i of e)switch(p&&("space"!==i.type&&"newline"!==i.type&&"comma"!==i.type&&r(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p=!1),m&&(c&&"comment"!==i.type&&"newline"!==i.type&&r(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),i.type){case"space":!t&&("doc-start"!==s||n?.type!=="flow-collection")&&i.source.includes(" ")&&(m=i),u=!0;break;case"comment":{u||r(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let e=i.source.substring(1)||" ";h?h+=f+e:h=e,f="",c=!1;break}case"newline":c?h?h+=i.source:w&&"seq-item-ind"===s||(a=!0):f+=i.source,c=!0,d=!0,(y||g)&&(b=i),u=!0;break;case"anchor":y&&r(i,"MULTIPLE_ANCHORS","A node can have at most one anchor"),i.source.endsWith(":")&&r(i.offset+i.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),y=i,v??(v=i.offset),c=!1,u=!1,p=!0;break;case"tag":g&&r(i,"MULTIPLE_TAGS","A node can have at most one tag"),g=i,v??(v=i.offset),c=!1,u=!1,p=!0;break;case s:(y||g)&&r(i,"BAD_PROP_ORDER",`Anchors and tags must be after the ${i.source} indicator`),w&&r(i,"UNEXPECTED_TOKEN",`Unexpected ${i.source} in ${t??"collection"}`),w=i,c="seq-item-ind"===s||"explicit-key-ind"===s,u=!1;break;case"comma":if(t){k&&r(i,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),k=i,c=!1,u=!1;break}default:r(i,"UNEXPECTED_TOKEN",`Unexpected ${i.type} token`),c=!1,u=!1}let S=e[e.length-1],E=S?S.offset+S.source.length:i;return p&&n&&"space"!==n.type&&"newline"!==n.type&&"comma"!==n.type&&("scalar"!==n.type||""!==n.source)&&r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(c&&m.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&r(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:w,spaceBefore:a,comment:h,hasNewline:d,anchor:y,tag:g,newlineAfterProp:b,end:E,start:v??E}}function tu(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes("\n"))return!0;if(e.end){for(let t of e.end)if("newline"===t.type)return!0}return!1;case"flow-collection":for(let t of e.items){for(let e of t.start)if("newline"===e.type)return!0;if(t.sep){for(let e of t.sep)if("newline"===e.type)return!0}if(tu(t.key)||tu(t.value))return!0}return!1;default:return!0}}function th(e,t,s){if(t?.type==="flow-collection"){let n=t.end[0];n.indent===e&&("]"===n.source||"}"===n.source)&&tu(t)&&s(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function tf(e,t,s){let{uniqueKeys:n}=e.options;if(!1===n)return!1;let i="function"==typeof n?n:(e,t)=>e===t||m(e)&&m(t)&&e.value===t.value;return t.some(e=>i(e.key,s))}let td="All mapping items must start at the same column";function tp(e,t,s,n){let i="";if(e){let r=!1,o="";for(let l of e){let{source:e,type:a}=l;switch(a){case"space":r=!0;break;case"comment":{s&&!r&&n(l,"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),r=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${a} at node end`)}t+=e.length}}return{comment:i,offset:t}}let tm="Block collections are not allowed within flow collections",ty=e=>e&&("block-map"===e.type||"block-seq"===e.type);function tg(e,t,s,n,i,r){let o="block-map"===s.type?function({composeNode:e,composeEmptyNode:t},s,n,i,r){let o=new(r?.nodeClass??ek)(s.schema);s.atRoot&&(s.atRoot=!1);let l=n.offset,a=null;for(let r of n.items){let{start:c,key:u,sep:h,value:f}=r,d=tc(c,{indicator:"explicit-key-ind",next:u??h?.[0],offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0}),p=!d.found;if(p){if(u&&("block-seq"===u.type?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==n.indent&&i(l,"BAD_INDENT",td)),!d.anchor&&!d.tag&&!h){a=d.end,d.comment&&(o.comment?o.comment+="\n"+d.comment:o.comment=d.comment);continue}(d.newlineAfterProp||tu(u))&&i(u??c[c.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==n.indent&&i(l,"BAD_INDENT",td);s.atKey=!0;let m=d.end,y=u?e(s,u,d,i):t(s,m,c,null,d,i);s.schema.compat&&th(n.indent,u,i),s.atKey=!1,tf(s,o.items,y)&&i(m,"DUPLICATE_KEY","Map keys must be unique");let g=tc(h??[],{indicator:"map-value-ind",next:f,offset:y.range[2],onError:i,parentIndent:n.indent,startOnNewline:!u||"block-scalar"===u.type});if(l=g.end,g.found){p&&(f?.type!=="block-map"||g.hasNewline||i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&d.start<g.found.offset-1024&&i(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let a=f?e(s,f,g,i):t(s,l,h,null,g,i);s.schema.compat&&th(n.indent,f,i),l=a.range[2];let c=new em(y,a);s.options.keepSourceTokens&&(c.srcToken=r),o.items.push(c)}else{p&&i(y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),g.comment&&(y.comment?y.comment+="\n"+g.comment:y.comment=g.comment);let e=new em(y);s.options.keepSourceTokens&&(e.srcToken=r),o.items.push(e)}}return a&&a<l&&i(a,"IMPOSSIBLE","Map comment with trailing content"),o.range=[n.offset,l,a??l],o}(e,t,s,n,r):"block-seq"===s.type?function({composeNode:e,composeEmptyNode:t},s,n,i,r){let o=new(r?.nodeClass??ev)(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let l=n.offset,a=null;for(let{start:r,value:c}of n.items){let u=tc(r,{indicator:"seq-item-ind",next:c,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||c)c?.type==="block-seq"?i(u.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{a=u.end,u.comment&&(o.comment=u.comment);continue}let h=c?e(s,c,u,i):t(s,u.end,r,null,u,i);s.schema.compat&&th(n.indent,c,i),l=h.range[2],o.items.push(h)}return o.range=[n.offset,l,a??l],o}(e,t,s,n,r):function({composeNode:e,composeEmptyNode:t},s,n,i,r){let o="{"===n.start.source,l=o?"flow map":"flow sequence",a=new(r?.nodeClass??(o?ek:ev))(s.schema);a.flow=!0;let c=s.atRoot;c&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let u=n.offset+n.start.source.length;for(let r=0;r<n.items.length;++r){let c=n.items[r],{start:h,key:f,sep:d,value:m}=c,y=tc(h,{flow:l,indicator:"explicit-key-ind",next:f??d?.[0],offset:u,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!y.found){if(!y.anchor&&!y.tag&&!d&&!m){0===r&&y.comma?i(y.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):r<n.items.length-1&&i(y.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),y.comment&&(a.comment?a.comment+="\n"+y.comment:a.comment=y.comment),u=y.end;continue}!o&&s.options.strict&&tu(f)&&i(f,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(0===r)y.comma&&i(y.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(y.comma||i(y.start,"MISSING_CHAR",`Missing , between ${l} items`),y.comment){let e="";e:for(let t of h)switch(t.type){case"comma":case"space":break;case"comment":e=t.source.substring(1);break e;default:break e}if(e){let t=a.items[a.items.length-1];p(t)&&(t=t.value??t.key),t.comment?t.comment+="\n"+e:t.comment=e,y.comment=y.comment.substring(e.length+1)}}if(o||d||y.found){s.atKey=!0;let r=y.end,p=f?e(s,f,y,i):t(s,r,h,null,y,i);ty(f)&&i(p.range,"BLOCK_IN_FLOW",tm),s.atKey=!1;let g=tc(d??[],{flow:l,indicator:"map-value-ind",next:m,offset:p.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(g.found){if(!o&&!y.found&&s.options.strict){if(d)for(let e of d){if(e===g.found)break;if("newline"===e.type){i(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}y.start<g.found.offset-1024&&i(g.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else m&&("source"in m&&m.source?.[0]===":"?i(m,"MISSING_CHAR",`Missing space after : in ${l}`):i(g.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let b=m?e(s,m,g,i):g.found?t(s,g.end,d,null,g,i):null;b?ty(m)&&i(b.range,"BLOCK_IN_FLOW",tm):g.comment&&(p.comment?p.comment+="\n"+g.comment:p.comment=g.comment);let k=new em(p,b);if(s.options.keepSourceTokens&&(k.srcToken=c),o)tf(s,a.items,p)&&i(r,"DUPLICATE_KEY","Map keys must be unique"),a.items.push(k);else{let e=new ek(s.schema);e.flow=!0,e.items.push(k);let t=(b??p).range;e.range=[p.range[0],t[1],t[2]],a.items.push(e)}u=b?b.range[2]:g.end}else{let n=m?e(s,m,y,i):t(s,y.end,d,null,y,i);a.items.push(n),u=n.range[2],ty(m)&&i(n.range,"BLOCK_IN_FLOW",tm)}}let h=o?"}":"]",[f,...d]=n.end,m=u;if(f?.source===h)m=f.offset+f.source.length;else{let e=l[0].toUpperCase()+l.substring(1),t=c?`${e} must end with a ${h}`:`${e} in block collection must be sufficiently indented and end with a ${h}`;i(u,c?"MISSING_CHAR":"BAD_INDENT",t),f&&1!==f.source.length&&d.unshift(f)}if(d.length>0){let e=tp(d,m,s.options.strict,i);e.comment&&(a.comment?a.comment+="\n"+e.comment:a.comment=e.comment),a.range=[n.offset,m,e.offset]}else a.range=[n.offset,m,m];return a}(e,t,s,n,r),l=o.constructor;return"!"===i||i===l.tagName?o.tag=l.tagName:i&&(o.tag=i),o}function tb(e){let t,s;try{t=RegExp("(.*?)(?<![ ])[ ]*\r?\n","sy"),s=RegExp("[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?\n","sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,s=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=t.exec(e);if(!n)return e;let i=n[1],r=" ",o=t.lastIndex;for(s.lastIndex=o;n=s.exec(e);)""===n[1]?"\n"===r?i+=r:r="\n":(i+=r+n[1],r=" "),o=s.lastIndex;let l=/[ \t]*(.*)/sy;return l.lastIndex=o,n=l.exec(e),i+r+(n?.[1]??"")}let tk={0:"\0",a:"\x07",b:"\b",e:"\x1b",f:"\f",n:"\n",r:"\r",t:" ",v:"\v",N:"\x85",_:"\xa0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function tw(e,t,s,n){let i,r,{value:o,type:l,comment:c,range:u}="block-scalar"===t.type?function(e,t,s){let n=t.offset,i=function({offset:e,props:t},s,n){if("block-scalar-header"!==t[0].type)return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],r=i[0],o=0,l="",a=-1;for(let t=1;t<i.length;++t){let s=i[t];if(l||"-"!==s&&"+"!==s){let n=Number(s);!o&&n?o=n:-1===a&&(a=e+t)}else l=s}-1!==a&&n(a,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,u="",h=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case"space":c=!0;case"newline":h+=i.source.length;break;case"comment":s&&!c&&n(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),h+=i.source.length,u=i.source.substring(1);break;case"error":n(i,"UNEXPECTED_TOKEN",i.message),h+=i.source.length;break;default:{let e=`Unexpected token in block scalar header: ${i.type}`;n(i,"UNEXPECTED_TOKEN",e);let t=i.source;t&&"string"==typeof t&&(h+=t.length)}}}return{mode:r,indent:o,chomp:l,comment:u,length:h}}(t,e.options.strict,s);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let r=">"===i.mode?U.BLOCK_FOLDED:U.BLOCK_LITERAL,o=t.source?function(e){let t=e.split(/\n( *)/),s=t[0],n=s.match(/^( *)/),i=[n?.[1]?[n[1],s.slice(n[1].length)]:["",s]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}(t.source):[],l=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(""===t||"\r"===t)l=e;else break}if(0===l){let e="+"===i.chomp&&o.length>0?"\n".repeat(Math.max(1,o.length-1)):"",s=n+i.length;return t.source&&(s+=t.source.length),{value:e,type:r,comment:i.comment,range:[n,s,s]}}let a=t.indent+i.indent,c=t.offset+i.length,u=0;for(let t=0;t<l;++t){let[n,r]=o[t];if(""===r||"\r"===r)0===i.indent&&n.length>a&&(a=n.length);else{n.length<a&&s(c+n.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),0===i.indent&&(a=n.length),u=t,0!==a||e.atRoot||s(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=n.length+r.length+1}for(let e=o.length-1;e>=l;--e)o[e][0].length>a&&(l=e+1);let h="",f="",d=!1;for(let e=0;e<u;++e)h+=o[e][0].slice(a)+"\n";for(let e=u;e<l;++e){let[t,n]=o[e];c+=t.length+n.length+1;let l="\r"===n[n.length-1];if(l&&(n=n.slice(0,-1)),n&&t.length<a){let e=i.indent?"explicit indentation indicator":"first line",r=`Block scalar lines must not be less indented than their ${e}`;s(c-n.length-(l?2:1),"BAD_INDENT",r),t=""}r===U.BLOCK_LITERAL?(h+=f+t.slice(a)+n,f="\n"):t.length>a||" "===n[0]?(" "===f?f="\n":d||"\n"!==f||(f="\n\n"),h+=f+t.slice(a)+n,f="\n",d=!0):""===n?"\n"===f?h+="\n":f="\n":(h+=f+n,f=" ",d=!1)}switch(i.chomp){case"-":break;case"+":for(let e=l;e<o.length;++e)h+="\n"+o[e][0].slice(a);"\n"!==h[h.length-1]&&(h+="\n");break;default:h+="\n"}let p=n+i.length+t.source.length;return{value:h,type:r,comment:i.comment,range:[n,p,p]}}(e,t,n):function(e,t,s){let n,i,{offset:r,type:o,source:l,end:a}=e,c=(e,t,n)=>s(r+e,t,n);switch(o){case"scalar":n=U.PLAIN,i=function(e,t){let s="";switch(e[0]){case" ":s="a tab character";break;case",":s="flow indicator character ,";break;case"%":s="directive indicator character %";break;case"|":case">":s=`block scalar indicator ${e[0]}`;break;case"@":case"`":s=`reserved character ${e[0]}`}return s&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`),tb(e)}(l,c);break;case"single-quoted-scalar":var u,h;n=U.QUOTE_SINGLE,u=l,h=c,("'"!==u[u.length-1]||1===u.length)&&h(u.length,"MISSING_CHAR","Missing closing 'quote"),i=tb(u.slice(1,-1)).replace(/''/g,"'");break;case"double-quoted-scalar":n=U.QUOTE_DOUBLE,i=function(e,t){let s="";for(let n=1;n<e.length-1;++n){let i=e[n];if("\r"!==i||"\n"!==e[n+1])if("\n"===i){let{fold:t,offset:i}=function(e,t){let s="",n=e[t+1];for(;(" "===n||" "===n||"\n"===n||"\r"===n)&&("\r"!==n||"\n"===e[t+2]);)"\n"===n&&(s+="\n"),t+=1,n=e[t+1];return s||(s=" "),{fold:s,offset:t}}(e,n);s+=t,n=i}else if("\\"===i){let i=e[++n],r=tk[i];if(r)s+=r;else if("\n"===i)for(i=e[n+1];" "===i||" "===i;)i=e[++n+1];else if("\r"===i&&"\n"===e[n+1])for(i=e[++n+1];" "===i||" "===i;)i=e[++n+1];else if("x"===i||"u"===i||"U"===i){let r={x:2,u:4,U:8}[i];s+=function(e,t,s,n){let i=e.substr(t,s),r=i.length===s&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(r)){let i=e.substr(t-2,s+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),i}return String.fromCodePoint(r)}(e,n+1,r,t),n+=r}else{let i=e.substr(n-1,2);t(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),s+=i}}else if(" "===i||" "===i){let t=n,r=e[n+1];for(;" "===r||" "===r;)r=e[++n+1];"\n"!==r&&("\r"!==r||"\n"!==e[n+2])&&(s+=n>t?e.slice(t,n+1):i)}else s+=i}return('"'!==e[e.length-1]||1===e.length)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),s}(l,c);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[r,r+l.length,r+l.length]}}let f=r+l.length,d=tp(a,f,t,s);return{value:i,type:n,comment:d.comment,range:[r,f,d.offset]}}(t,e.options.strict,n),h=s?e.directives.tagName(s.source,e=>n(s,"TAG_RESOLVE_FAILED",e)):null;i=e.options.stringKeys&&e.atKey?e.schema[a]:h?function(e,t,s,n,i){if("!"===s)return e[a];let r=[];for(let t of e.tags)if(!t.collection&&t.tag===s)if(!t.default||!t.test)return t;else r.push(t);for(let e of r)if(e.test?.test(t))return e;let o=e.knownTags[s];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,"tag:yaml.org,2002:str"!==s),e[a])}(e.schema,o,h,s,n):"scalar"===t.type?function({atKey:e,directives:t,schema:s},n,i,r){let o=s.tags.find(t=>(!0===t.default||e&&"key"===t.default)&&t.test?.test(n))||s[a];if(s.compat){let e=s.compat.find(e=>e.default&&e.test?.test(n))??s[a];if(o.tag!==e.tag){let s=t.tagString(o.tag),n=t.tagString(e.tag);r(i,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${s} or ${n}`,!0)}}return o}(e,o,t,n):e.schema[a];try{let l=i.resolve(o,e=>n(s??t,"TAG_RESOLVE_FAILED",e),e.options);r=m(l)?l:new U(l)}catch(e){n(s??t,"TAG_RESOLVE_FAILED",e instanceof Error?e.message:String(e)),r=new U(o)}return r.range=u,r.source=o,l&&(r.type=l),h&&(r.tag=h),i.format&&(r.format=i.format),c&&(r.comment=c),r}let tv={composeNode:tS,composeEmptyNode:tE};function tS(e,t,s,n){let i,r=e.atKey,{spaceBefore:o,comment:l,anchor:a,tag:c}=s,u=!0;switch(t.type){case"alias":i=function({options:e},{offset:t,source:s,end:n},i){let r=new P(s.substring(1));""===r.source&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(t+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=t+s.length,l=tp(n,o,e.strict,i);return r.range=[t,o,l.offset],l.comment&&(r.comment=l.comment),r}(e,t,n),(a||c)&&n(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":i=tw(e,t,c,n),a&&(i.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{i=function(e,t,s,n,i){let r=n.tag,o=r?t.directives.tagName(r.source,e=>i(r,"TAG_RESOLVE_FAILED",e)):null;if("block-seq"===s.type){let{anchor:e,newlineAfterProp:t}=n,s=e&&r?e.offset>r.offset?e:r:e??r;s&&(!t||t.offset<s.offset)&&i(s,"MISSING_CHAR","Missing newline after block sequence props")}let l="block-map"===s.type?"map":"block-seq"===s.type?"seq":"{"===s.start.source?"map":"seq";if(!r||!o||"!"===o||o===ek.tagName&&"map"===l||o===ev.tagName&&"seq"===l)return tg(e,t,s,i,o);let a=t.schema.tags.find(e=>e.tag===o&&e.collection===l);if(!a){let n=t.schema.knownTags[o];if(n?.collection!==l)return n?i(r,"BAD_COLLECTION_TYPE",`${n.tag} used for ${l} collection, but expects ${n.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),tg(e,t,s,i,o);t.schema.tags.push(Object.assign({},n,{default:!1})),a=n}let c=tg(e,t,s,i,o,a),u=a.resolve?.(c,e=>i(r,"TAG_RESOLVE_FAILED",e),t.options)??c,h=b(u)?u:new U(u);return h.range=c.range,h.tag=o,a?.format&&(h.format=a.format),h}(tv,e,t,s,n),a&&(i.anchor=a.source.substring(1))}catch(e){n(t,"RESOURCE_EXHAUSTION",e instanceof Error?e.message:String(e))}break;default:{let e="error"===t.type?t.message:`Unsupported token (type: ${t.type})`;n(t,"UNEXPECTED_TOKEN",e),u=!1}}return i??(i=tE(e,t.offset,void 0,null,s,n)),a&&""===i.anchor&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!m(i)||"string"!=typeof i.value||i.tag&&"tag:yaml.org,2002:str"!==i.tag)&&n(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(i.spaceBefore=!0),l&&("scalar"===t.type&&""===t.source?i.comment=l:i.commentBefore=l),e.options.keepSourceTokens&&u&&(i.srcToken=t),i}function tE(e,t,s,n,{spaceBefore:i,comment:r,anchor:o,tag:l,end:a},c){let u=tw(e,{type:"scalar",offset:function(e,t,s){if(t){s??(s=t.length);for(let n=s-1;n>=0;--n){let s=t[n];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++n];s?.type==="space";)e+=s.source.length,s=t[++n];break}}return e}(t,s,n),indent:-1,source:""},l,c);return o&&(u.anchor=o.source.substring(1),""===u.anchor&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(u.spaceBefore=!0),r&&(u.comment=r,u.range[2]=a),u}function tN(e){if("number"==typeof e)return[e,e+1];if(Array.isArray(e))return 2===e.length?e:[e[0],e[1]];let{offset:t,source:s}=e;return[t,t+("string"==typeof s?s.length:1)]}function tO(e){let t="",s=!1,n=!1;for(let i=0;i<e.length;++i){let r=e[i];switch(r[0]){case"#":t+=(""===t?"":n?"\n\n":"\n")+(r.substring(1)||" "),s=!0,n=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),s=!1;break;default:s||(n=!0),s=!1}}return{comment:t,afterEmptyLine:n}}class tA{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,s,n)=>{let i=tN(e);n?this.warnings.push(new tl(i,t,s)):this.errors.push(new to(i,t,s))},this.directives=new C({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:s,afterEmptyLine:n}=tO(this.prelude);if(s){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
22
|
+
${s}`:s;else if(n||e.directives.docStart||!i)e.commentBefore=s;else if(g(i)&&!i.flow&&i.items.length>0){let e=i.items[0];p(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${s}
|
|
23
|
+
${t}`:s}else{let e=i.commentBefore;i.commentBefore=e?`${s}
|
|
24
|
+
${e}`:s}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:tO(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(let t of e)yield*this.next(t);yield*this.end(t,s)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,s,n)=>{let i=tN(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",s,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=function(e,t,{offset:s,start:n,value:i,end:r},o){let l=new tn(void 0,Object.assign({_directives:t},e)),a={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},c=tc(n,{indicator:"doc-start",next:i??r?.[0],offset:s,onError:o,parentIndent:0,startOnNewline:!0});c.found&&(l.directives.docStart=!0,i&&("block-map"===i.type||"block-seq"===i.type)&&!c.hasNewline&&o(c.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?tS(a,i,c,o):tE(a,c.end,n,null,c,o);let u=l.contents.range[2],h=tp(r,u,!1,o);return h.comment&&(l.comment=h.comment),l.range=[s,u,h.offset],l}(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,s=new to(tN(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){this.errors.push(new to(tN(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=tp(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}
|
|
25
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new to(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 tn(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}}}let tT=Symbol("break visit"),tI=Symbol("skip children"),tx=Symbol("remove item");function t$(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),function e(t,s,n){let i=n(s,t);if("symbol"==typeof i)return i;for(let r of["key","value"]){let o=s[r];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let i=e(Object.freeze(t.concat([[r,s]])),o.items[s],n);if("number"==typeof i)s=i-1;else{if(i===tT)return tT;i===tx&&(o.items.splice(s,1),s-=1)}}"function"==typeof i&&"key"===r&&(i=i(s,t))}}return"function"==typeof i?i(s,t):i}(Object.freeze([]),e,t)}function tL(e){switch(e){case void 0:case" ":case"\n":case"\r":case" ":return!0;default:return!1}}t$.BREAK=tT,t$.SKIP=tI,t$.REMOVE=tx,t$.itemAtPath=(e,t)=>{let s=e;for(let[e,n]of t){let t=s?.[e];if(!t||!("items"in t))return;s=t.items[n]}return s},t$.parentCollection=(e,t)=>{let s=t$.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],i=s?.[n];if(i&&"items"in i)return i;throw Error("Parent collection not found")};let tC=new Set("0123456789ABCDEFabcdef"),t_=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),tB=new Set(",[]{}"),tK=new Set(" ,[]{}\n\r "),tj=e=>!e||tK.has(e);class tM{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("string"!=typeof e)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let s=this.next??"stream";for(;s&&(t||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||" "===t;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let s=0;for(;" "===t;)t=this.buffer[++s+e];if("\r"===t){let t=this.buffer[s+e+1];if("\n"===t||!t&&!this.atEnd)return e+s+1}return"\n"!==t&&!(s>=this.indentNext)&&(t||this.atEnd)?-1:e+s}if("-"===t||"."===t){let t=this.buffer.substr(e,3);if(("---"===t||"..."===t)&&tL(this.buffer[e+3]))return -1}return e}getLine(){let e=this.lineEndPos;return(("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e)?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),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(null===e)return this.setNext("stream");if("\uFEFF"===e[0]&&(yield*this.pushCount(1),e=e.substring(1)),"%"===e[0]){let t=e.length,s=e.indexOf("#");for(;-1!==s;){let n=e[s-1];if(" "===n||" "===n){t=s-1;break}s=e.indexOf("#",s+1)}for(;;){let s=e[t-1];if(" "===s||" "===s)t-=1;else break}let n=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),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"\x02",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)&&tL(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&&!tL(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)&&tL(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(null===e)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(tj),"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,s=-1;do(e=yield*this.pushNewline())>0?(t=yield*this.pushSpaces(!1),this.indentValue=s=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let n=this.getLine();if(null===n)return this.setNext("flow");if((-1!==s&&s<this.indentNext&&"#"!==n[0]||0===s&&(n.startsWith("---")||n.startsWith("..."))&&tL(n[3]))&&(s!==this.indentNext-1||1!==this.flowLevel||"]"!==n[0]&&"}"!==n[0]))return this.flowLevel=0,yield"\x18",yield*this.parseLineStart();let i=0;for(;","===n[i];)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(n[i+=yield*this.pushIndicators()]){case void 0:return"flow";case"#":return yield*this.pushCount(n.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-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(tj),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let e=this.charAt(1);if(this.flowKey||tL(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(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1)}let s=this.buffer.substring(0,t),n=s.indexOf("\n",this.pos);if(-1!==n){for(;-1!==n;){let e=this.continueScalar(n+1);if(-1===e)break;n=s.indexOf("\n",e)}-1!==n&&(t=n-("\r"===s[n-1]?2:1))}if(-1===t){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=>tL(e)||"#"===e)}*parseBlockScalar(){let e,t=this.pos-1,s=0;e:for(let n=this.pos;e=this.buffer[n];++n)switch(e){case" ":s+=1;break;case"\n":t=n,s=0;break;case"\r":{let e=this.buffer[n+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if("\n"===e)break}default:break e}if(!e&&!this.atEnd)return this.setNext("block-scalar");if(s>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=s:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{let e=this.continueScalar(t+1);if(-1===e)break;t=this.buffer.indexOf("\n",e)}while(-1!==t);if(-1===t){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let n=t+1;for(e=this.buffer[n];" "===e;)e=this.buffer[++n];if(" "===e){for(;" "===e||" "===e||"\r"===e||"\n"===e;)e=this.buffer[++n];t=n-1}else if(!this.blockScalarKeep)for(;;){let e=t-1,n=this.buffer[e];"\r"===n&&(n=this.buffer[--e]);let i=e;for(;" "===n;)n=this.buffer[--e];if("\n"===n&&e>=this.pos&&e+1+s>i)t=e;else break}return yield"\x1f",yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e,t=this.flowLevel>0,s=this.pos-1,n=this.pos-1;for(;e=this.buffer[++n];)if(":"===e){let e=this.buffer[n+1];if(tL(e)||t&&tB.has(e))break;s=n}else if(tL(e)){let i=this.buffer[n+1];if("\r"===e&&("\n"===i?(n+=1,e="\n",i=this.buffer[n+1]):s=n),"#"===i||t&&tB.has(i))break;if("\n"===e){let e=this.continueScalar(n+1);if(-1===e)break;n=Math.max(n,e-2)}}else{if(t&&tB.has(e))break;s=n}return e||this.atEnd?(yield"\x1f",yield*this.pushToIndex(s+1,!0),t?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(tj))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,t=this.charAt(1);if(tL(t)||e&&tB.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,t=this.buffer[e];for(;!tL(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(t_.has(t))t=this.buffer[++e];else if("%"===t&&tC.has(this.buffer[e+1])&&tC.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"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,s=this.pos-1;do t=this.buffer[++s];while(" "===t||e&&" "===t);let n=s-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=s),n}*pushUntil(e){let t=this.pos,s=this.buffer[t];for(;!e(s);)s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}function tD(e,t){for(let s=0;s<e.length;++s)if(e[s].type===t)return!0;return!1}function tP(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 tq(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 tU(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 tR(e){if(0===e.length)return[];let t=e.length;e: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 e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function tF(e){if("flow-seq-start"===e.start.type)for(let t of e.items)!t.sep||t.value||tD(t.start,"explicit-key-ind")||tD(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,tq(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class tJ{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 tM,this.onNewLine=e}*parse(e,t=!1){for(let s of(this.onNewLine&&0===this.offset&&this.onNewLine(0),this.lexer.lex(e,t)))yield*this.next(s);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=function(e){switch(e){case"\uFEFF":return"byte-order-mark";case"\x02":return"doc-mode";case"\x18":return"flow-error-end";case"\x1f":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":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}(e);if(t)if("scalar"===t)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}else{let t=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:t,source:e}),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("doc-end"===this.type&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}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)if(0===this.stack.length)yield t;else{let e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&tF(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{let s=e.items[e.items.length-1];if(s.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(s.sep)s.value=t;else{Object.assign(s,{key:t,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{let s=e.items[e.items.length-1];s.value?e.items.push({start:[],value:t}):s.value=t;break}case"flow-collection":{let s=e.items[e.items.length-1];!s||s.value?e.items.push({start:[],key:t,sep:[]}):s.sep?s.value=t:Object.assign(s,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if(("document"===e.type||"block-map"===e.type||"block-seq"===e.type)&&("block-map"===t.type||"block-seq"===t.type)){let s=t.items[t.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&-1===tP(s.start)&&(0===t.indent||s.start.every(e=>"comment"!==e.type||e.indent<t.indent))&&("document"===e.type?e.end=s.start:e.items.push({start:s.start}),t.items.splice(-1,1))}}else yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"}}*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:[]};"doc-start"===this.type&&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":-1!==tP(e.start)?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);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("map-value-ind"===this.type){let t,s=tR(tU(this.peek(2)));e.end?((t=e.end).push(this.sourceToken),delete e.end):t=[this.sourceToken];let n={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:t}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=n}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("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",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 s="end"in t.value?t.value.end:void 0,n=Array.isArray(s)?s[s.length-1]:void 0;n?.type==="comment"?s?.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 s=e.items[e.items.length-2],n=s?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let s=!this.onKeyLine&&this.indent===e.indent,n=s&&(t.sep||t.explicitKey)&&"seq-item-ind"!==this.type,i=[];if(n&&t.sep&&!t.value){let s=[];for(let n=0;n<t.sep.length;++n){let i=t.sep[n];switch(i.type){case"newline":s.push(n);break;case"space":break;case"comment":i.indent>e.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(i=t.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":n||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?n||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}]}):(t.start.push(this.sourceToken),t.explicitKey=!0),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(tD(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(tq(t.key)&&!tD(t.sep,"newline")){let e=tR(t.start),s=t.key,n=t.sep;n.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:s,sep:n}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(tD(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=tR(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||n?e.items.push({start:i,key:null,sep:[this.sourceToken]}):tD(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 s=this.flowScalar(this.type);n||t.value?(e.items.push({start:i,key:s,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(s):(Object.assign(t,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let n=this.startBlockValue(e);if(n){if("block-seq"===n.type){if(!t.explicitKey&&t.sep&&!tD(t.sep,"newline"))return void(yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source}))}else s&&e.items.push({start:i});this.stack.push(n);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 s="end"in t.value?t.value.end:void 0,n=Array.isArray(s)?s[s.length-1]:void 0;n?.type==="comment"?s?.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 s=e.items[e.items.length-2],n=s?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(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||tD(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)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do yield*this.pop(),e=this.peek(1);while(e?.type==="flow-collection")}else if(0===e.end.length){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 s=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:s,sep:[]}):t.sep?this.stack.push(s):Object.assign(t,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if("block-map"!==t.type||("map-value-ind"!==this.type||t.indent!==e.indent)&&("newline"!==this.type||t.items[t.items.length-1].sep))if("map-value-ind"===this.type&&"flow-collection"!==t.type){let s=tR(tU(t));tF(e);let n=e.end.splice(1,e.end.length);n.push(this.sourceToken);let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e);else yield*this.pop(),yield*this.step()}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",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(tU(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(tU(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"comment"===this.type&&!(this.indent<=t)&&e.every(e=>"newline"===e.type||"space"===e.type)}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(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],"newline"===this.type&&(yield*this.pop())}}}class tV{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,s=this.lineStarts.length;for(;t<s;){let n=t+s>>1;this.lineStarts[n]<e?t=n+1:s=n}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(0===t)return{line:0,col:e};let n=this.lineStarts[t-1];return{line:t,col:e-n+1}}}}function tG(e,t,s){let n;"function"==typeof t?n=t:void 0===s&&t&&"object"==typeof t&&(s=t);let i=function(e,t={}){let{lineCounter:s,prettyErrors:n}=function(e){let t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new tV||null,prettyErrors:t}}(t),i=new tJ(s?.addNewLine),r=new tA(t),o=null;for(let t of r.compose(i.parse(e),!0,e.length))if(o){if("silent"!==o.options.logLevel){o.errors.push(new to(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else o=t;return n&&s&&(o.errors.forEach(ta(e,s)),o.warnings.forEach(ta(e,s))),o}(e,s);if(!i)return null;if(i.warnings.forEach(e=>ec(i.options.logLevel,e)),i.errors.length>0)if("silent"!==i.options.logLevel)throw i.errors[0];else i.errors=[];return i.toJS(Object.assign({reviver:n},s))}function tW(e,t,s){let n=null;if("function"==typeof t||Array.isArray(t)?n=t:void 0===s&&t&&(s=t),"string"==typeof s&&(s=s.length),"number"==typeof s){let e=Math.round(s);s=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){let{keepUndefined:e}=s??t??{};if(!e)return}return f(e)&&!n?e.toString(s):new tn(e,n,s).toString(s)}}}]);
|