@sisense/sdk-ui 1.22.0 → 1.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/ai.cjs +53 -45
  2. package/dist/ai.js +780 -702
  3. package/dist/analytics-composer.cjs +89 -148
  4. package/dist/analytics-composer.js +1196 -1479
  5. package/dist/index.cjs +119 -118
  6. package/dist/index.js +4898 -5523
  7. package/dist/packages/sdk-ui/src/ai/api/chat-rest-api.d.ts +1 -1
  8. package/dist/packages/sdk-ui/src/ai/api/types.d.ts +3 -23
  9. package/dist/packages/sdk-ui/src/ai/chart/chart-insights.d.ts +6 -0
  10. package/dist/packages/sdk-ui/src/ai/chart/nlq-chart-widget.d.ts +46 -0
  11. package/dist/packages/sdk-ui/src/ai/icons/ai-icon.d.ts +2 -0
  12. package/dist/packages/sdk-ui/src/ai/icons/exclamation-mark-brand-icon.d.ts +3 -0
  13. package/dist/packages/sdk-ui/src/ai/index.d.ts +2 -3
  14. package/dist/packages/sdk-ui/src/ai/messages/chart-message.d.ts +1 -2
  15. package/dist/packages/sdk-ui/src/ai/use-get-data-source-fields.d.ts +1 -1
  16. package/dist/packages/sdk-ui/src/analytics-composer/{translators → code}/code-templates.d.ts +1 -1
  17. package/dist/packages/sdk-ui/src/analytics-composer/{translators → code}/generate-code.d.ts +3 -3
  18. package/dist/packages/sdk-ui/src/analytics-composer/{translators → common}/utils.d.ts +3 -1
  19. package/dist/packages/sdk-ui/src/analytics-composer/index.d.ts +12 -1
  20. package/dist/packages/sdk-ui/src/analytics-composer/query/index.d.ts +1 -0
  21. package/dist/packages/sdk-ui/src/analytics-composer/{translators → query}/query-translator.d.ts +2 -3
  22. package/dist/packages/sdk-ui/src/analytics-composer/types.d.ts +153 -0
  23. package/dist/packages/sdk-ui/src/{ai/messages → analytics-composer/widget/chart-options}/get-widget-options.d.ts +5 -14
  24. package/dist/packages/sdk-ui/src/analytics-composer/widget/stringify-filters.d.ts +2 -0
  25. package/dist/packages/sdk-ui/src/analytics-composer/widget/to-widget-code.d.ts +3 -0
  26. package/dist/packages/sdk-ui/src/analytics-composer/widget/to-widget-props.d.ts +3 -0
  27. package/dist/packages/sdk-ui/src/analytics-composer/widget/widget-composer.d.ts +16 -0
  28. package/dist/packages/sdk-ui/src/api/rest-api.d.ts +13 -2
  29. package/dist/packages/sdk-ui/src/api/types/dashboard-dto.d.ts +1 -1
  30. package/dist/packages/sdk-ui/src/app/client-application.d.ts +7 -7
  31. package/dist/packages/sdk-ui/src/app/settings/types/user.d.ts +0 -1
  32. package/dist/packages/sdk-ui/src/chart/advanced-chart.d.ts +1 -1
  33. package/dist/packages/sdk-ui/src/chart/helpers/derive-chart-family.d.ts +8 -0
  34. package/dist/packages/sdk-ui/src/chart/regular-chart.d.ts +3 -0
  35. package/dist/packages/sdk-ui/src/chart-data-options/utils.d.ts +1 -0
  36. package/dist/packages/sdk-ui/src/chart-options-processor/category-chart-options.d.ts +2 -1
  37. package/dist/packages/sdk-ui/src/chart-options-processor/translations/sunburst/sunburst-options.d.ts +2 -1
  38. package/dist/packages/sdk-ui/src/chart-options-processor/translations/treemap/treemap-options.d.ts +2 -1
  39. package/dist/packages/sdk-ui/src/chart-options-processor/translations/treemap/treemap-tooltip.d.ts +3 -2
  40. package/dist/packages/sdk-ui/src/chart-options-processor/translations/types.d.ts +2 -0
  41. package/dist/packages/sdk-ui/src/common/components/menu/types.d.ts +1 -0
  42. package/dist/packages/sdk-ui/src/dashboard/components/dashboard-container.d.ts +1 -1
  43. package/dist/packages/sdk-ui/src/dashboard/components/horizontal-collapse.d.ts +6 -0
  44. package/dist/packages/sdk-ui/src/dashboard/dashboard.d.ts +6 -1
  45. package/dist/packages/sdk-ui/src/dashboard/hooks/use-filters-panel-collapsed-state.d.ts +8 -0
  46. package/dist/packages/sdk-ui/src/dashboard/types.d.ts +19 -1
  47. package/dist/packages/sdk-ui/src/decorators/component-decorators/with-error-boundary.d.ts +3 -1
  48. package/dist/packages/sdk-ui/src/error-boundary/error-boundary.d.ts +4 -2
  49. package/dist/packages/sdk-ui/src/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts +2 -0
  50. package/dist/packages/sdk-ui/src/filters/components/common/member-radio.d.ts +8 -0
  51. package/dist/packages/sdk-ui/src/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +2 -0
  52. package/dist/packages/sdk-ui/src/filters/components/custom-filter-tile.d.ts +2 -0
  53. package/dist/packages/sdk-ui/src/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +2 -0
  54. package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/helpers.d.ts +6 -0
  55. package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-tile.d.ts +2 -0
  56. package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/relative-date-filter.d.ts +2 -1
  57. package/dist/packages/sdk-ui/src/filters/components/filter-tile.d.ts +1 -0
  58. package/dist/packages/sdk-ui/src/filters/components/filters-panel/filters-panel-tile.d.ts +3 -1
  59. package/dist/packages/sdk-ui/src/filters/components/icons/trash-icon.d.ts +1 -1
  60. package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/member-filter-tile.d.ts +2 -0
  61. package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/member-list.d.ts +1 -0
  62. package/dist/packages/sdk-ui/src/filters/components/unsupported-filter-tile.d.ts +3 -1
  63. package/dist/packages/sdk-ui/src/index.d.ts +15 -8
  64. package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-dto-utils.d.ts +2 -2
  65. package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-utils.d.ts +1 -1
  66. package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dasboard-model-utils.d.ts +2 -4
  67. package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model-reducer.d.ts +24 -16
  68. package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model.d.ts +1 -0
  69. package/dist/packages/sdk-ui/src/models/dashboard/use-get-dashboard-model.d.ts +2 -2
  70. package/dist/packages/sdk-ui/src/models/hierarchy/get-hierarchy-models.d.ts +6 -1
  71. package/dist/packages/sdk-ui/src/models/hierarchy/hierarchy-model-translator.d.ts +1 -1
  72. package/dist/packages/sdk-ui/src/models/hierarchy/types.d.ts +3 -0
  73. package/dist/packages/sdk-ui/src/models/hierarchy/use-get-hierarchy-models.d.ts +4 -4
  74. package/dist/packages/sdk-ui/src/models/widget/widget-model-translator.d.ts +12 -2
  75. package/dist/packages/sdk-ui/src/models/widget/widget-model.d.ts +1 -1
  76. package/dist/packages/sdk-ui/src/pivot-table/hooks/use-render-pivot.d.ts +3 -1
  77. package/dist/packages/sdk-ui/src/props.d.ts +29 -17
  78. package/dist/packages/sdk-ui/src/query-execution/types.d.ts +1 -1
  79. package/dist/packages/sdk-ui/src/sisense-context/custom-sisense-context-provider.d.ts +1 -3
  80. package/dist/packages/sdk-ui/src/sisense-context/sisense-context.d.ts +5 -0
  81. package/dist/packages/sdk-ui/src/table/table-component.d.ts +1 -1
  82. package/dist/packages/sdk-ui/src/translation/i18n-provider.d.ts +3 -1
  83. package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +27 -2
  84. package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +32 -4
  85. package/dist/packages/sdk-ui/src/types.d.ts +12 -5
  86. package/dist/packages/sdk-ui/src/utils/filters.d.ts +1 -0
  87. package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/dashboard-widget.d.ts +2 -1
  88. package/dist/packages/sdk-ui/src/widget-by-id/translate-dashboard-filters.d.ts +4800 -0
  89. package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/translate-panel-color-format.d.ts +3 -3
  90. package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/translate-widget-data-options.d.ts +5 -5
  91. package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/translate-widget-drilldown-options.d.ts +2 -2
  92. package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/translate-widget-filters.d.ts +85 -83
  93. package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/types.d.ts +1 -1
  94. package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/use-fetch-widget-dto-model.d.ts +3 -3
  95. package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/utils.d.ts +14 -13
  96. package/dist/packages/sdk-ui/src/widget-by-id/widget-by-id.d.ts +26 -0
  97. package/dist/packages/sdk-ui/src/widgets/common/use-drilldown-core.d.ts +7 -0
  98. package/dist/packages/sdk-ui/src/widgets/common/widget-container.d.ts +2 -0
  99. package/dist/packages/sdk-ui/src/widgets/common/widget-errors-and-warnings-context.d.ts +14 -0
  100. package/dist/packages/sdk-ui/src/widgets/common/widget-header-info-button.d.ts +3 -1
  101. package/dist/packages/sdk-ui/src/widgets/common/widget-header.d.ts +2 -0
  102. package/dist/packages/sdk-ui/src/widgets/hooks/use-drilldown.d.ts +2 -0
  103. package/dist/useQuery-CIeSzN0Z.js +7945 -0
  104. package/dist/useQuery-LqaaNBLw.cjs +175 -0
  105. package/dist/widget-composer-CvgsMHyb.cjs +237 -0
  106. package/dist/widget-composer-L8kmRhgX.js +624 -0
  107. package/dist/widget-model-translator-CYeCKnTa.js +116687 -0
  108. package/dist/widget-model-translator-_Z-8UaTN.cjs +917 -0
  109. package/package.json +7 -7
  110. package/dist/get-widget-options-DTIulxC2.js +0 -44253
  111. package/dist/get-widget-options-DixoCEhn.cjs +0 -271
  112. package/dist/packages/sdk-ui/src/ai/messages/jaql-element.d.ts +0 -28
  113. package/dist/packages/sdk-ui/src/analytics-composer/translators/index.d.ts +0 -3
  114. package/dist/packages/sdk-ui/src/analytics-composer/translators/model-translator.d.ts +0 -48
  115. package/dist/packages/sdk-ui/src/analytics-composer/translators/translate-filters-to-code.d.ts +0 -2
  116. package/dist/packages/sdk-ui/src/analytics-composer/translators/types.d.ts +0 -95
  117. package/dist/packages/sdk-ui/src/dashboard/components/HorizontalCollapse.d.ts +0 -5
  118. package/dist/packages/sdk-ui/src/dashboard-widget/translate-dashboard-filters.d.ts +0 -4798
  119. package/dist/packages/sdk-ui/src/translation/custom-translations-loader.d.ts +0 -10
  120. package/dist/table-widget-CLL1iN3H.js +0 -79317
  121. package/dist/table-widget-CYCcYqzZ.cjs +0 -821
  122. /package/dist/packages/sdk-ui/src/analytics-composer/{translators → query}/query-templates.d.ts +0 -0
  123. /package/dist/packages/sdk-ui/src/analytics-composer/{translators/translate-props-to-code.d.ts → widget/stringify-props.d.ts} +0 -0
  124. /package/dist/packages/sdk-ui/src/{dashboard-widget → widget-by-id}/translate-widget-style-options.d.ts +0 -0
@@ -1,201 +1,142 @@
1
- "use strict";var xs=Object.defineProperty,Zs=Object.defineProperties;var en=Object.getOwnPropertyDescriptors;var qe=Object.getOwnPropertySymbols;var Ut=Object.prototype.hasOwnProperty,Vt=Object.prototype.propertyIsEnumerable;var ct=(s,e)=>(e=Symbol[s])?e:Symbol.for("Symbol."+s);var ft=(s,e,t)=>e in s?xs(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,K=(s,e)=>{for(var t in e||(e={}))Ut.call(e,t)&&ft(s,t,e[t]);if(qe)for(var t of qe(e))Vt.call(e,t)&&ft(s,t,e[t]);return s},H=(s,e)=>Zs(s,en(e));var Jt=(s,e)=>{var t={};for(var n in s)Ut.call(s,n)&&e.indexOf(n)<0&&(t[n]=s[n]);if(s!=null&&qe)for(var n of qe(s))e.indexOf(n)<0&&Vt.call(s,n)&&(t[n]=s[n]);return t};var F=(s,e,t)=>(ft(s,typeof e!="symbol"?e+"":e,t),t);var ut=(s,e,t)=>new Promise((n,i)=>{var r=l=>{try{a(t.next(l))}catch(c){i(c)}},o=l=>{try{a(t.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(r,o);a((t=t.apply(s,e)).next())}),tn=function(s,e){this[0]=s,this[1]=e};var d=s=>{var e=s[ct("asyncIterator")],t=!1,n,i={};return e==null?(e=s[ct("iterator")](),n=r=>i[r]=o=>e[r](o)):(e=e.call(s),n=r=>i[r]=o=>{if(t){if(t=!1,r==="throw")throw o;return o}return t=!0,{done:!1,value:new tn(new Promise(a=>{var l=e[r](o);if(!(l instanceof Object))throw TypeError("Object expected");a(l)}),1)}}),i[ct("iterator")]=()=>i,n("next"),"throw"in e?n("throw"):i.throw=r=>{throw r},"return"in e&&n("return"),i};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./get-widget-options-DixoCEhn.cjs"),sn={jaql:{datasource:{title:""},metadata:[]},queryTitle:"",chartRecommendations:{}},wt={model:"",metadata:[],chart:{},queryTitle:""};function nn(s){return s.replace(/\s+/g,"-").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function rn(s){return s.charAt(0).toUpperCase()+s.slice(1)}function on(s){const e=/\[(.+?)\s\(Calendar\)\]/;return s.replace(e,"[$1]").trim()}function an(s){if(s)if(s.metadata){if(!s.model)throw new v.TranslatableError("errors.missingModelTitle")}else throw new v.TranslatableError("errors.missingMetadata");else throw new v.TranslatableError("errors.emptyModel");return s}function ln(s){return!s||!s.jaql.datasource.title||!s.jaql.metadata.length}function Ie(s){return s&&s.replace(new RegExp("(?<!\\\\)'","g"),"\\'")}const cn={react:{baseChartTmpl:`import { {{componentString}} } from '@sisense/sdk-ui';
2
- {{extraImportsString}}
3
- import * as DM from './{{dataSourceString}}'; // generated with @sisense/sdk-cli
4
-
5
- export default function CodeExample() {
6
- return (
7
- <{{componentString}}
8
- title={'{{titleString}}'}
9
- dataSource={DM.DataSource}
10
- chartType={'{{chartTypeString}}'}
11
- dataOptions={ {{dataOptionsString}} }
12
- filters={ {{filtersString}} }
13
- />
14
- );
15
- }`,chartTmpl:"{{baseChartTmpl}}",chartWidgetTmpl:"{{baseChartTmpl}}"},angular:{baseChartTmpl:`import { Component } from '@angular/core';
16
- {{extraImportsString}}
17
- import * as DM from './{{dataSourceString}}'; // generated with @sisense/sdk-cli
18
-
19
- @Component({
20
- selector: 'code-example',
21
- template: \`
22
- <csdk-chart-widget
23
- chartType='{{chartTypeString}}'
24
- [dataSource]='DM.DataSource'
25
- [dataOptions]='dataOptions'
26
- [filters]='filters'
27
- />
28
- \`
29
- })
30
- export class CodeExample {
31
- DM = DM;
32
- dataOptions = {{dataOptionsString}};
33
- filters = {{filtersString}};
34
- }`,chartTmpl:"{{baseChartTmpl}}",chartWidgetTmpl:"{{baseChartTmpl}}"},vue:{baseChartTmpl:`<script setup lang="ts">
35
- import { ref } from 'vue';
36
- import { {{componentString}} } from '@sisense/sdk-ui-vue';
37
- {{extraImportsString}}
38
- import * as DM from './{{dataSourceString}}'; // generated with @sisense/sdk-cli
39
-
40
- const dataOptions = ref({{dataOptionsString}});
41
- const filters = ref({{filtersString}});
42
- <\/script>
43
-
44
- <template>
45
- <{{componentString}}
46
- chartType="{{chartTypeString}}"
47
- :dataOptions="dataOptions"
48
- :filters="filters"
49
- :dataSource="DM.DataSource"
50
- title="{{titleString}}" />
51
- </template>`,chartTmpl:"{{baseChartTmpl}}",chartWidgetTmpl:"{{baseChartTmpl}}"}},is=(s,e)=>cn[e][s].replace(/{{(.*?)Tmpl}}/g,(n,i)=>is(`${i}Tmpl`,e)),rs=(s,e)=>s.replace(/{{(.*?)}}/g,(t,n)=>n in e?e[n]:(console.warn(`Placeholder ${n} not found in data`),t)),fn=(s,e,t="react")=>{const n=is(s,t);return rs(n,e)},Ee=`
52
- `,St="UNKNOWN",un=(s,e)=>{let t="";return t+=`measureFactory.customFormula(
53
- `,t+=" ".repeat(e),t+=` '${Ie(s.title)}',
54
- `,t+=" ".repeat(e),t+=` '${s.formula}',
55
- `,t+=" ".repeat(e),t+=` {
56
- `,Object.entries(s.context).forEach(([n,i])=>{const r=v.normalizeAttributeName(i.table||St,i.column||St,void 0,"DM");t+=" ".repeat(e),t+=` '${n.slice(1,-1)}': ${r},
57
- `}),t+=" ".repeat(e),t+=` }
58
- `,t+=" ".repeat(e),t+=")",t},hn=(s,e)=>{const{level:t,table:n,column:i,agg:r,sort:o,title:a}=s;let l;return n&&i&&(l=v.normalizeAttributeName(n,i,t,"DM")),r&&n&&i&&a&&(l=`measureFactory.${v.DimensionalBaseMeasure.aggregationFromJAQL(r)}(${l}, '${Ie(a)}')`),o&&(l=`{column: ${l}, sortType: '${v.getSortType(o)}'}`),l?`${" ".repeat(e)}${l}`:St},dn=(s,e)=>{const t=s.jaql().jaql;return"formula"in t?un(t,e):Ee+hn(t,e)},$e=(s,e=0,t=!1)=>{if(!s)return"";if(typeof s=="string")return`'${Ie(s)}'`;if(s instanceof v.JaqlElement)return dn(s,e);let n="";return Array.isArray(s)?n+=`[${s.map(i=>$e(i,e+2))}${s.length?Ee+" ".repeat(e+2):""}]`:(n+=`{${Ee}`,Object.entries(s).forEach(([i,r])=>{t&&(i=`'${Ie(i)}'`),n+=" ".repeat(e+2),Array.isArray(r)?n+=`${i}: [${r.map(o=>$e(o,e+4,t))}${r.length?Ee+" ".repeat(e+2):""}]`:typeof r=="object"?n+=`${i}: ${$e(r,e+2,t)}`:["number","boolean","undefined",null].includes(typeof r)?n+=`${i}: ${r}`:n+=`${i}: '${Ie(r)}'`,n+=`,${Ee}`}),n+=" ".repeat(e),n+="}"),n},Yt=`
59
- `,pn=(s,e)=>{if(s.composeCode)return`${Yt}${" ".repeat(e)}${s.composeCode}`;const t=s.jaql().jaql;return`${Yt}${" ".repeat(e)}filterFactory.customFilter(${$e(t,e,!0)})`},mn=(s,e=0)=>{if(!s)return"";let t="";return t+=`[${s.map(n=>pn(n,e+2))}${s.length?`
60
- `+" ".repeat(e+2):""}]`,t};class yn{constructor(e){F(this,"queryModel");F(this,"getChartRecommendationsOrDefault",e=>"chartType"in e?e:{chartType:"table",chartFamily:"table",axesMapping:{}});F(this,"getFilters",e=>e.map(t=>v.createFilterFromJaql(t.jaql)));F(this,"splitMetadata",e=>e.reduce((t,n)=>{if((n.panel==="scope"||n.jaql.filter)&&t.metadataFilters.push(v.cloneDeep(n)),n.panel!=="scope"){const i=v.cloneDeep(n);delete i.jaql.filter,t.metadataColumns.push(i)}return t},{metadataColumns:[],metadataFilters:[]}));F(this,"stringifyDataSource",e=>{if(!e)throw new v.TranslatableError("errors.undefinedDataSource");let t;return typeof e=="object"&&"title"in e?t=e.title:t=e,nn(t)});F(this,"stringifyChartType",e=>e);F(this,"stringifyFilters",e=>{if(!e)return"";if(Array.isArray(e))return mn(e,2);throw new v.TranslatableError("errors.filterRelationsNotSupported")});F(this,"stringifyDataOptions",e=>$e(e,2));F(this,"stringifyExtraImports",e=>{const t=["measureFactory"],{filters:n}=e;return Array.isArray(n)&&n.length>0&&t.push("filterFactory"),`import { ${t.join(", ")} } from '@sisense/sdk-data';`});F(this,"getChartWidgetCode",(e,t)=>{const n={titleString:e.title,dataSourceString:this.stringifyDataSource(e.dataSource),chartTypeString:this.stringifyChartType(e.chartType),dataOptionsString:this.stringifyDataOptions(e.dataOptions),filtersString:this.stringifyFilters(e.filters),componentString:"ChartWidget",extraImportsString:this.stringifyExtraImports(e)};return fn("chartWidgetTmpl",n,t)});this.queryModel=e}toChart(){if(!ln(this.queryModel))try{const e=this.queryModel,{jaql:t,chartRecommendations:n,queryTitle:i}=e,{metadata:r,datasource:{title:o}}=t,a=this.getChartRecommendationsOrDefault(n),l=a.chartType.toLowerCase(),c={cornerRadius:"Small",header:{renderToolbar:()=>null}},{metadataColumns:h,metadataFilters:f}=this.splitMetadata(r),p=this.getFilters(f);return{chartType:l,queryTitle:i,getChartWidgetProps:()=>{const{dataOptions:m,chartStyleOptions:y}=v.getChartOptions(h,a,!1),u=K(K({},y),c);return{chartType:l,dataOptions:m,styleOptions:u,dataSource:o,filters:p,title:i}}}}catch(e){console.log(e);return}}toCode(e,t="react"){try{const n=e.getChartWidgetProps();return this.getChartWidgetCode(n,t)}catch(n){return console.log(n),""}}}const It=Symbol.for("yaml.alias"),kt=Symbol.for("yaml.document"),z=Symbol.for("yaml.map"),os=Symbol.for("yaml.pair"),G=Symbol.for("yaml.scalar"),ge=Symbol.for("yaml.seq"),V=Symbol.for("yaml.node.type"),re=s=>!!s&&typeof s=="object"&&s[V]===It,be=s=>!!s&&typeof s=="object"&&s[V]===kt,we=s=>!!s&&typeof s=="object"&&s[V]===z,I=s=>!!s&&typeof s=="object"&&s[V]===os,A=s=>!!s&&typeof s=="object"&&s[V]===G,Se=s=>!!s&&typeof s=="object"&&s[V]===ge;function L(s){if(s&&typeof s=="object")switch(s[V]){case z:case ge:return!0}return!1}function M(s){if(s&&typeof s=="object")switch(s[V]){case It:case z:case G:case ge:return!0}return!1}const gn=s=>(A(s)||L(s))&&!!s.anchor,P=Symbol("break visit"),as=Symbol("skip children"),W=Symbol("remove node");function X(s,e){const t=ls(e);be(s)?ce(null,s.contents,t,Object.freeze([s]))===W&&(s.contents=null):ce(null,s,t,Object.freeze([]))}X.BREAK=P;X.SKIP=as;X.REMOVE=W;function ce(s,e,t,n){const i=cs(s,e,t,n);if(M(i)||I(i))return fs(s,n,i),ce(s,i,t,n);if(typeof i!="symbol"){if(L(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){const o=ce(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===P)return P;o===W&&(e.items.splice(r,1),r-=1)}}}else if(I(e)){n=Object.freeze(n.concat(e));const r=ce("key",e.key,t,n);if(r===P)return P;r===W&&(e.key=null);const o=ce("value",e.value,t,n);if(o===P)return P;o===W&&(e.value=null)}}return i}function He(s,e){return ut(this,null,function*(){const t=ls(e);be(s)?(yield fe(null,s.contents,t,Object.freeze([s])))===W&&(s.contents=null):yield fe(null,s,t,Object.freeze([]))})}He.BREAK=P;He.SKIP=as;He.REMOVE=W;function fe(s,e,t,n){return ut(this,null,function*(){const i=yield cs(s,e,t,n);if(M(i)||I(i))return fs(s,n,i),fe(s,i,t,n);if(typeof i!="symbol"){if(L(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){const o=yield fe(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===P)return P;o===W&&(e.items.splice(r,1),r-=1)}}}else if(I(e)){n=Object.freeze(n.concat(e));const r=yield fe("key",e.key,t,n);if(r===P)return P;r===W&&(e.key=null);const o=yield fe("value",e.value,t,n);if(o===P)return P;o===W&&(e.value=null)}}return i})}function ls(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function cs(s,e,t,n){var i,r,o,a,l;if(typeof t=="function")return t(s,e,n);if(we(e))return(i=t.Map)==null?void 0:i.call(t,s,e,n);if(Se(e))return(r=t.Seq)==null?void 0:r.call(t,s,e,n);if(I(e))return(o=t.Pair)==null?void 0:o.call(t,s,e,n);if(A(e))return(a=t.Scalar)==null?void 0:a.call(t,s,e,n);if(re(e))return(l=t.Alias)==null?void 0:l.call(t,s,e,n)}function fs(s,e,t){const n=e[e.length-1];if(L(n))n.items[s]=t;else if(I(n))s==="key"?n.key=t:n.value=t;else if(be(n))n.contents=t;else{const i=re(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const bn={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},wn=s=>s.replace(/[!,[\]{}]/g,e=>bn[e]);class B{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},B.defaultYaml,e),this.tags=Object.assign({},B.defaultTags,t)}clone(){const e=new B(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new B(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:B.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},B.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:B.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},B.defaultTags),this.atNextDocument=!1);const n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}const[,n,i]=e.match(new RegExp("^(.*!)([^!]*)$","s"));i||t(`The ${e} tag has no suffix`);const r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+wn(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let i;if(e&&n.length>0&&M(e.contents)){const r={};X(e.contents,(o,a)=>{M(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
61
- `)}}B.defaultYaml={explicit:!1,version:"1.2"};B.defaultTags={"!!":"tag:yaml.org,2002:"};function us(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function hs(s){const e=new Set;return X(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function ds(s,e){for(let t=1;;++t){const n=`${s}${t}`;if(!e.has(n))return n}}function Sn(s,e){const t=[],n=new Map;let i=null;return{onAnchor:r=>{t.push(r),i||(i=hs(s));const o=ds(e,i);return i.add(o),o},setAnchors:()=>{for(const r of t){const o=n.get(r);if(typeof o=="object"&&o.anchor&&(A(o.node)||L(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:n}}function ue(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){const o=n[i],a=ue(s,n,String(i),o);a===void 0?delete n[i]:a!==o&&(n[i]=a)}else if(n instanceof Map)for(const i of Array.from(n.keys())){const r=n.get(i),o=ue(s,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(const i of Array.from(n)){const r=ue(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(const[i,r]of Object.entries(n)){const o=ue(s,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return s.call(e,t,n)}function U(s,e,t){if(Array.isArray(s))return s.map((n,i)=>U(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!gn(s))return s.toJSON(e,t);const n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};const i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!(t!=null&&t.keep)?Number(s):s}class $t{constructor(e){Object.defineProperty(this,V,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!be(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=U(this,"",o);if(typeof i=="function")for(const{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?ue(r,{"":a},"",a):a}}class ze extends $t{constructor(e){super(It),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return X(e,{Node:(n,i)=>{if(i===this)return X.BREAK;i.anchor===this.source&&(t=i)}}),t}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:i,maxAliasCount:r}=t,o=this.resolve(i);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=n.get(o);if(a||(U(o,null,t),a=n.get(o)),!a||a.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Re(i,o,n)),a.count*a.aliasCount>r)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,t,n){const i=`*${this.source}`;if(e){if(us(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}}function Re(s,e,t){if(re(e)){const n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(L(e)){let n=0;for(const i of e.items){const r=Re(s,i,t);r>n&&(n=r)}return n}else if(I(e)){const n=Re(s,e.key,t),i=Re(s,e.value,t);return Math.max(n,i)}return 1}const ps=s=>!s||typeof s!="function"&&typeof s!="object";class O extends $t{constructor(e){super(G),this.value=e}toJSON(e,t){return t!=null&&t.keep?this.value:U(this.value,e,t)}toString(){return String(this.value)}}O.BLOCK_FOLDED="BLOCK_FOLDED";O.BLOCK_LITERAL="BLOCK_LITERAL";O.PLAIN="PLAIN";O.QUOTE_DOUBLE="QUOTE_DOUBLE";O.QUOTE_SINGLE="QUOTE_SINGLE";const kn="tag:yaml.org,2002:";function On(s,e,t){var n;if(e){const i=t.filter(o=>o.tag===e),r=(n=i.find(o=>!o.format))!=null?n:i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return t.find(i=>{var r;return((r=i.identify)==null?void 0:r.call(i,s))&&!i.format})}function Ce(s,e,t){var f,p,m;if(be(s)&&(s=s.contents),M(s))return s;if(I(s)){const y=(p=(f=t.schema[z]).createNode)==null?void 0:p.call(f,t.schema,null,t);return y.items.push(s),y}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt!="undefined"&&s instanceof BigInt)&&(s=s.valueOf());const{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=t;let l;if(n&&s&&typeof s=="object"){if(l=a.get(s),l)return l.anchor||(l.anchor=i(s)),new ze(l.anchor);l={anchor:null,node:null},a.set(s,l)}e!=null&&e.startsWith("!!")&&(e=kn+e.slice(2));let c=On(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){const y=new O(s);return l&&(l.node=y),y}c=s instanceof Map?o[z]:Symbol.iterator in Object(s)?o[ge]:o[z]}r&&(r(c),delete t.onTagObj);const h=c!=null&&c.createNode?c.createNode(t.schema,s,t):typeof((m=c==null?void 0:c.nodeClass)==null?void 0:m.from)=="function"?c.nodeClass.from(t.schema,s,t):new O(s);return e?h.tag=e:c.default||(h.tag=c.tag),l&&(l.node=h),h}function Ye(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){const r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return Ce(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}const Ae=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done;class ms extends $t{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>M(n)||I(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Ae(e))this.add(t);else{const[n,...i]=e,r=this.get(n,!0);if(L(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,Ye(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){const[t,...n]=e;if(n.length===0)return this.delete(t);const i=this.get(t,!0);if(L(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){const[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&A(r)?r.value:r:L(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!I(t))return!1;const n=t.value;return n==null||e&&A(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){const[t,...n]=e;if(n.length===0)return this.has(t);const i=this.get(t,!0);return L(i)?i.hasIn(n):!1}setIn(e,t){const[n,...i]=e;if(i.length===0)this.set(n,t);else{const r=this.get(n,!0);if(L(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,Ye(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}}const Tn=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function Q(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}const te=(s,e,t)=>s.endsWith(`
1
+ "use strict";var Ys=Object.defineProperty,Qs=Object.defineProperties;var Gs=Object.getOwnPropertyDescriptors;var ve=Object.getOwnPropertySymbols;var Dt=Object.prototype.hasOwnProperty,Kt=Object.prototype.propertyIsEnumerable;var ot=(s,e)=>(e=Symbol[s])?e:Symbol.for("Symbol."+s);var lt=(s,e,t)=>e in s?Ys(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,R=(s,e)=>{for(var t in e||(e={}))Dt.call(e,t)&&lt(s,t,e[t]);if(ve)for(var t of ve(e))Kt.call(e,t)&&lt(s,t,e[t]);return s},W=(s,e)=>Qs(s,Gs(e));var Ft=(s,e)=>{var t={};for(var n in s)Dt.call(s,n)&&e.indexOf(n)<0&&(t[n]=s[n]);if(s!=null&&ve)for(var n of ve(s))e.indexOf(n)<0&&Kt.call(s,n)&&(t[n]=s[n]);return t};var at=(s,e,t)=>(lt(s,typeof e!="symbol"?e+"":e,t),t);var ct=(s,e,t)=>new Promise((n,i)=>{var r=a=>{try{l(t.next(a))}catch(c){i(c)}},o=a=>{try{l(t.throw(a))}catch(c){i(c)}},l=a=>a.done?n(a.value):Promise.resolve(a.value).then(r,o);l((t=t.apply(s,e)).next())}),Ws=function(s,e){this[0]=s,this[1]=e};var d=s=>{var e=s[ot("asyncIterator")],t=!1,n,i={};return e==null?(e=s[ot("iterator")](),n=r=>i[r]=o=>e[r](o)):(e=e.call(s),n=r=>i[r]=o=>{if(t){if(t=!1,r==="throw")throw o;return o}return t=!0,{done:!1,value:new Ws(new Promise(l=>{var a=e[r](o);if(!(a instanceof Object))throw TypeError("Object expected");l(a)}),1)}}),i[ot("iterator")]=()=>i,n("next"),"throw"in e?n("throw"):i.throw=r=>{throw r},"return"in e&&n("return"),i};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("./widget-composer-CvgsMHyb.cjs"),Oe=require("./widget-model-translator-_Z-8UaTN.cjs"),Ot=Symbol.for("yaml.alias"),gt=Symbol.for("yaml.document"),H=Symbol.for("yaml.map"),Zt=Symbol.for("yaml.pair"),G=Symbol.for("yaml.scalar"),ye=Symbol.for("yaml.seq"),F=Symbol.for("yaml.node.type"),ie=s=>!!s&&typeof s=="object"&&s[F]===Ot,ge=s=>!!s&&typeof s=="object"&&s[F]===gt,be=s=>!!s&&typeof s=="object"&&s[F]===H,A=s=>!!s&&typeof s=="object"&&s[F]===Zt,I=s=>!!s&&typeof s=="object"&&s[F]===G,we=s=>!!s&&typeof s=="object"&&s[F]===ye;function $(s){if(s&&typeof s=="object")switch(s[F]){case H:case ye:return!0}return!1}function M(s){if(s&&typeof s=="object")switch(s[F]){case Ot:case H:case G:case ye:return!0}return!1}const Hs=s=>(I(s)||$(s))&&!!s.anchor,q=Symbol("break visit"),es=Symbol("skip children"),Y=Symbol("remove node");function X(s,e){const t=ts(e);ge(s)?ae(null,s.contents,t,Object.freeze([s]))===Y&&(s.contents=null):ae(null,s,t,Object.freeze([]))}X.BREAK=q;X.SKIP=es;X.REMOVE=Y;function ae(s,e,t,n){const i=ss(s,e,t,n);if(M(i)||A(i))return ns(s,n,i),ae(s,i,t,n);if(typeof i!="symbol"){if($(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){const o=ae(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===q)return q;o===Y&&(e.items.splice(r,1),r-=1)}}}else if(A(e)){n=Object.freeze(n.concat(e));const r=ae("key",e.key,t,n);if(r===q)return q;r===Y&&(e.key=null);const o=ae("value",e.value,t,n);if(o===q)return q;o===Y&&(e.value=null)}}return i}function Qe(s,e){return ct(this,null,function*(){const t=ts(e);ge(s)?(yield ce(null,s.contents,t,Object.freeze([s])))===Y&&(s.contents=null):yield ce(null,s,t,Object.freeze([]))})}Qe.BREAK=q;Qe.SKIP=es;Qe.REMOVE=Y;function ce(s,e,t,n){return ct(this,null,function*(){const i=yield ss(s,e,t,n);if(M(i)||A(i))return ns(s,n,i),ce(s,i,t,n);if(typeof i!="symbol"){if($(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){const o=yield ce(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===q)return q;o===Y&&(e.items.splice(r,1),r-=1)}}}else if(A(e)){n=Object.freeze(n.concat(e));const r=yield ce("key",e.key,t,n);if(r===q)return q;r===Y&&(e.key=null);const o=yield ce("value",e.value,t,n);if(o===q)return q;o===Y&&(e.value=null)}}return i})}function ts(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function ss(s,e,t,n){var i,r,o,l,a;if(typeof t=="function")return t(s,e,n);if(be(e))return(i=t.Map)==null?void 0:i.call(t,s,e,n);if(we(e))return(r=t.Seq)==null?void 0:r.call(t,s,e,n);if(A(e))return(o=t.Pair)==null?void 0:o.call(t,s,e,n);if(I(e))return(l=t.Scalar)==null?void 0:l.call(t,s,e,n);if(ie(e))return(a=t.Alias)==null?void 0:a.call(t,s,e,n)}function ns(s,e,t){const n=e[e.length-1];if($(n))n.items[s]=t;else if(A(n))s==="key"?n.key=t:n.value=t;else if(ge(n))n.contents=t;else{const i=ie(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Xs={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},zs=s=>s.replace(/[!,[\]{}]/g,e=>Xs[e]);class j{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},j.defaultYaml,e),this.tags=Object.assign({},j.defaultTags,t)}clone(){const e=new j(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new j(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:j.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},j.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:j.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},j.defaultTags),this.atNextDocument=!1);const n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}const[,n,i]=e.match(new RegExp("^(.*!)([^!]*)$","s"));i||t(`The ${e} tag has no suffix`);const r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+zs(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let i;if(e&&n.length>0&&M(e.contents)){const r={};X(e.contents,(o,l)=>{M(l)&&l.tag&&(r[l.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
2
+ `)}}j.defaultYaml={explicit:!1,version:"1.2"};j.defaultTags={"!!":"tag:yaml.org,2002:"};function is(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function rs(s){const e=new Set;return X(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function os(s,e){for(let t=1;;++t){const n=`${s}${t}`;if(!e.has(n))return n}}function xs(s,e){const t=[],n=new Map;let i=null;return{onAnchor:r=>{t.push(r),i||(i=rs(s));const o=os(e,i);return i.add(o),o},setAnchors:()=>{for(const r of t){const o=n.get(r);if(typeof o=="object"&&o.anchor&&(I(o.node)||$(o.node)))o.node.anchor=o.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=r,l}}},sourceObjects:n}}function fe(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){const o=n[i],l=fe(s,n,String(i),o);l===void 0?delete n[i]:l!==o&&(n[i]=l)}else if(n instanceof Map)for(const i of Array.from(n.keys())){const r=n.get(i),o=fe(s,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(const i of Array.from(n)){const r=fe(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(const[i,r]of Object.entries(n)){const o=fe(s,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return s.call(e,t,n)}function K(s,e,t){if(Array.isArray(s))return s.map((n,i)=>K(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!Hs(s))return s.toJSON(e,t);const n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};const i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!(t!=null&&t.keep)?Number(s):s}class Tt{constructor(e){Object.defineProperty(this,F,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!ge(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=K(this,"",o);if(typeof i=="function")for(const{count:a,res:c}of o.anchors.values())i(c,a);return typeof r=="function"?fe(r,{"":l},"",l):l}}class Ge extends Tt{constructor(e){super(Ot),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return X(e,{Node:(n,i)=>{if(i===this)return X.BREAK;i.anchor===this.source&&(t=i)}}),t}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:i,maxAliasCount:r}=t,o=this.resolve(i);if(!o){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(a)}let l=n.get(o);if(l||(K(o,null,t),l=n.get(o)),!l||l.res===void 0){const a="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(a)}if(r>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=De(i,o,n)),l.count*l.aliasCount>r)){const a="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(a)}return l.res}toString(e,t,n){const i=`*${this.source}`;if(e){if(is(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}}function De(s,e,t){if(ie(e)){const n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if($(e)){let n=0;for(const i of e.items){const r=De(s,i,t);r>n&&(n=r)}return n}else if(A(e)){const n=De(s,e.key,t),i=De(s,e.value,t);return Math.max(n,i)}return 1}const ls=s=>!s||typeof s!="function"&&typeof s!="object";class N extends Tt{constructor(e){super(G),this.value=e}toJSON(e,t){return t!=null&&t.keep?this.value:K(this.value,e,t)}toString(){return String(this.value)}}N.BLOCK_FOLDED="BLOCK_FOLDED";N.BLOCK_LITERAL="BLOCK_LITERAL";N.PLAIN="PLAIN";N.QUOTE_DOUBLE="QUOTE_DOUBLE";N.QUOTE_SINGLE="QUOTE_SINGLE";const Zs="tag:yaml.org,2002:";function en(s,e,t){var n;if(e){const i=t.filter(o=>o.tag===e),r=(n=i.find(o=>!o.format))!=null?n:i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return t.find(i=>{var r;return((r=i.identify)==null?void 0:r.call(i,s))&&!i.format})}function Ae(s,e,t){var f,p,m;if(ge(s)&&(s=s.contents),M(s))return s;if(A(s)){const y=(p=(f=t.schema[H]).createNode)==null?void 0:p.call(f,t.schema,null,t);return y.items.push(s),y}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt!="undefined"&&s instanceof BigInt)&&(s=s.valueOf());const{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:l}=t;let a;if(n&&s&&typeof s=="object"){if(a=l.get(s),a)return a.anchor||(a.anchor=i(s)),new Ge(a.anchor);a={anchor:null,node:null},l.set(s,a)}e!=null&&e.startsWith("!!")&&(e=Zs+e.slice(2));let c=en(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){const y=new N(s);return a&&(a.node=y),y}c=s instanceof Map?o[H]:Symbol.iterator in Object(s)?o[ye]:o[H]}r&&(r(c),delete t.onTagObj);const h=c!=null&&c.createNode?c.createNode(t.schema,s,t):typeof((m=c==null?void 0:c.nodeClass)==null?void 0:m.from)=="function"?c.nodeClass.from(t.schema,s,t):new N(s);return e?h.tag=e:c.default||(h.tag=c.tag),a&&(a.node=h),h}function Ue(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){const r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return Ae(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}const Ee=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done;class as extends Tt{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>M(n)||A(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Ee(e))this.add(t);else{const[n,...i]=e,r=this.get(n,!0);if($(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,Ue(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){const[t,...n]=e;if(n.length===0)return this.delete(t);const i=this.get(t,!0);if($(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){const[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&I(r)?r.value:r:$(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!A(t))return!1;const n=t.value;return n==null||e&&I(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){const[t,...n]=e;if(n.length===0)return this.has(t);const i=this.get(t,!0);return $(i)?i.hasIn(n):!1}setIn(e,t){const[n,...i]=e;if(i.length===0)this.set(n,t);else{const r=this.get(n,!0);if($(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,Ue(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}}const tn=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function Q(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}const ee=(s,e,t)=>s.endsWith(`
62
3
  `)?Q(t,e):t.includes(`
63
4
  `)?`
64
- `+Q(t,e):(s.endsWith(" ")?"":" ")+t,ys="flow",Ot="block",Ue="quoted";function Xe(s,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return s;i<r&&(r=0);const l=Math.max(1+r,1+i-e.length);if(s.length<=l)return s;const c=[],h={};let f=i-e.length;typeof n=="number"&&(n>i-Math.max(2,r)?c.push(0):f=i-n);let p,m,y=!1,u=-1,g=-1,b=-1;t===Ot&&(u=Wt(s,u,e.length),u!==-1&&(f=u+l));for(let E;E=s[u+=1];){if(t===Ue&&E==="\\"){switch(g=u,s[u+1]){case"x":u+=3;break;case"u":u+=5;break;case"U":u+=9;break;default:u+=1}b=u}if(E===`
65
- `)t===Ot&&(u=Wt(s,u,e.length)),f=u+e.length+l,p=void 0;else{if(E===" "&&m&&m!==" "&&m!==`
5
+ `+Q(t,e):(s.endsWith(" ")?"":" ")+t,cs="flow",bt="block",Ke="quoted";function We(s,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return s;i<r&&(r=0);const a=Math.max(1+r,1+i-e.length);if(s.length<=a)return s;const c=[],h={};let f=i-e.length;typeof n=="number"&&(n>i-Math.max(2,r)?c.push(0):f=i-n);let p,m,y=!1,u=-1,g=-1,b=-1;t===bt&&(u=Rt(s,u,e.length),u!==-1&&(f=u+a));for(let E;E=s[u+=1];){if(t===Ke&&E==="\\"){switch(g=u,s[u+1]){case"x":u+=3;break;case"u":u+=5;break;case"U":u+=9;break;default:u+=1}b=u}if(E===`
6
+ `)t===bt&&(u=Rt(s,u,e.length)),f=u+e.length+a,p=void 0;else{if(E===" "&&m&&m!==" "&&m!==`
66
7
  `&&m!==" "){const k=s[u+1];k&&k!==" "&&k!==`
67
- `&&k!==" "&&(p=u)}if(u>=f)if(p)c.push(p),f=p+l,p=void 0;else if(t===Ue){for(;m===" "||m===" ";)m=E,E=s[u+=1],y=!0;const k=u>b+1?u-2:g-1;if(h[k])return s;c.push(k),h[k]=!0,f=k+l,p=void 0}else y=!0}m=E}if(y&&a&&a(),c.length===0)return s;o&&o();let S=s.slice(0,c[0]);for(let E=0;E<c.length;++E){const k=c[E],T=c[E+1]||s.length;k===0?S=`
68
- ${e}${s.slice(0,T)}`:(t===Ue&&h[k]&&(S+=`${s[k]}\\`),S+=`
69
- ${e}${s.slice(k+1,T)}`)}return S}function Wt(s,e,t){let n=e,i=e+1,r=s[i];for(;r===" "||r===" ";)if(e<i+t)r=s[++e];else{do r=s[++e];while(r&&r!==`
70
- `);n=e,i=e+1,r=s[i]}return n}const xe=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),Ze=s=>/^(%|---|\.\.\.)/m.test(s);function Nn(s,e,t){if(!e||e<0)return!1;const n=e-t,i=s.length;if(i<=n)return!1;for(let r=0,o=0;r<i;++r)if(s[r]===`
71
- `){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}function Le(s,e){const t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(Ze(s)?" ":"");let o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);const h=t.substr(l+2,4);switch(h){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:h.substr(0,2)==="00"?o+="\\x"+h.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(n||t[l+2]==='"'||t.length<i)l+=1;else{for(o+=t.slice(a,l)+`
8
+ `&&k!==" "&&(p=u)}if(u>=f)if(p)c.push(p),f=p+a,p=void 0;else if(t===Ke){for(;m===" "||m===" ";)m=E,E=s[u+=1],y=!0;const k=u>b+1?u-2:g-1;if(h[k])return s;c.push(k),h[k]=!0,f=k+a,p=void 0}else y=!0}m=E}if(y&&l&&l(),c.length===0)return s;o&&o();let S=s.slice(0,c[0]);for(let E=0;E<c.length;++E){const k=c[E],O=c[E+1]||s.length;k===0?S=`
9
+ ${e}${s.slice(0,O)}`:(t===Ke&&h[k]&&(S+=`${s[k]}\\`),S+=`
10
+ ${e}${s.slice(k+1,O)}`)}return S}function Rt(s,e,t){let n=e,i=e+1,r=s[i];for(;r===" "||r===" ";)if(e<i+t)r=s[++e];else{do r=s[++e];while(r&&r!==`
11
+ `);n=e,i=e+1,r=s[i]}return n}const He=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),Xe=s=>/^(%|---|\.\.\.)/m.test(s);function sn(s,e,t){if(!e||e<0)return!1;const n=e-t,i=s.length;if(i<=n)return!1;for(let r=0,o=0;r<i;++r)if(s[r]===`
12
+ `){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}function Ie(s,e){const t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(Xe(s)?" ":"");let o="",l=0;for(let a=0,c=t[a];c;c=t[++a])if(c===" "&&t[a+1]==="\\"&&t[a+2]==="n"&&(o+=t.slice(l,a)+"\\ ",a+=1,l=a,c="\\"),c==="\\")switch(t[a+1]){case"u":{o+=t.slice(l,a);const h=t.substr(a+2,4);switch(h){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:h.substr(0,2)==="00"?o+="\\x"+h.substr(2):o+=t.substr(a,6)}a+=5,l=a+1}break;case"n":if(n||t[a+2]==='"'||t.length<i)a+=1;else{for(o+=t.slice(l,a)+`
72
13
 
73
- `;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)o+=`
74
- `,l+=2;o+=r,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,n?o:Xe(o,r,Ue,xe(e,!1))}function Tt(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
75
- `)||/[ \t]\n|\n[ \t]/.test(s))return Le(s,e);const t=e.indent||(Ze(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
76
- ${t}`)+"'";return e.implicitKey?n:Xe(n,t,ys,xe(e,!1))}function he(s,e){const{singleQuote:t}=e.options;let n;if(t===!1)n=Le;else{const i=s.includes('"'),r=s.includes("'");i&&!r?n=Tt:r&&!i?n=Le:n=t?Tt:Le}return n(s,e)}let Nt;try{Nt=new RegExp(`(^|(?<!
14
+ `;t[a+2]==="\\"&&t[a+3]==="n"&&t[a+4]!=='"';)o+=`
15
+ `,a+=2;o+=r,t[a+2]===" "&&(o+="\\"),a+=1,l=a+1}break;default:a+=1}return o=l?o+t.slice(l):t,n?o:We(o,r,Ke,He(e,!1))}function wt(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
16
+ `)||/[ \t]\n|\n[ \t]/.test(s))return Ie(s,e);const t=e.indent||(Xe(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
17
+ ${t}`)+"'";return e.implicitKey?n:We(n,t,cs,He(e,!1))}function ue(s,e){const{singleQuote:t}=e.options;let n;if(t===!1)n=Ie;else{const i=s.includes('"'),r=s.includes("'");i&&!r?n=wt:r&&!i?n=Ie:n=t?wt:Ie}return n(s,e)}let St;try{St=new RegExp(`(^|(?<!
77
18
  ))
78
19
  +(?!
79
- |$)`,"g")}catch(s){Nt=/\n+(?!\n|$)/g}function Ve({comment:s,type:e,value:t},n,i,r){const{blockQuote:o,commentString:a,lineWidth:l}=n.options;if(!o||/\n[\t ]+$/.test(t)||/^\s*$/.test(t))return he(t,n);const c=n.indent||(n.forceBlockIndent||Ze(t)?" ":""),h=o==="literal"?!0:o==="folded"||e===O.BLOCK_FOLDED?!1:e===O.BLOCK_LITERAL?!0:!Nn(t,l,c.length);if(!t)return h?`|
20
+ |$)`,"g")}catch(s){St=/\n+(?!\n|$)/g}function Fe({comment:s,type:e,value:t},n,i,r){const{blockQuote:o,commentString:l,lineWidth:a}=n.options;if(!o||/\n[\t ]+$/.test(t)||/^\s*$/.test(t))return ue(t,n);const c=n.indent||(n.forceBlockIndent||Xe(t)?" ":""),h=o==="literal"?!0:o==="folded"||e===N.BLOCK_FOLDED?!1:e===N.BLOCK_LITERAL?!0:!sn(t,a,c.length);if(!t)return h?`|
80
21
  `:`>
81
- `;let f,p;for(p=t.length;p>0;--p){const N=t[p-1];if(N!==`
82
- `&&N!==" "&&N!==" ")break}let m=t.substring(p);const y=m.indexOf(`
22
+ `;let f,p;for(p=t.length;p>0;--p){const T=t[p-1];if(T!==`
23
+ `&&T!==" "&&T!==" ")break}let m=t.substring(p);const y=m.indexOf(`
83
24
  `);y===-1?f="-":t===m||y!==m.length-1?(f="+",r&&r()):f="",m&&(t=t.slice(0,-m.length),m[m.length-1]===`
84
- `&&(m=m.slice(0,-1)),m=m.replace(Nt,`$&${c}`));let u=!1,g,b=-1;for(g=0;g<t.length;++g){const N=t[g];if(N===" ")u=!0;else if(N===`
85
- `)b=g;else break}let S=t.substring(0,b<g?b+1:g);S&&(t=t.substring(S.length),S=S.replace(/\n+/g,`$&${c}`));let k=(h?"|":">")+(u?c?"2":"1":"")+f;if(s&&(k+=" "+a(s.replace(/ ?[\r\n]+/g," ")),i&&i()),h)return t=t.replace(/\n+/g,`$&${c}`),`${k}
25
+ `&&(m=m.slice(0,-1)),m=m.replace(St,`$&${c}`));let u=!1,g,b=-1;for(g=0;g<t.length;++g){const T=t[g];if(T===" ")u=!0;else if(T===`
26
+ `)b=g;else break}let S=t.substring(0,b<g?b+1:g);S&&(t=t.substring(S.length),S=S.replace(/\n+/g,`$&${c}`));let k=(h?"|":">")+(u?c?"2":"1":"")+f;if(s&&(k+=" "+l(s.replace(/ ?[\r\n]+/g," ")),i&&i()),h)return t=t.replace(/\n+/g,`$&${c}`),`${k}
86
27
  ${c}${S}${t}${m}`;t=t.replace(/\n+/g,`
87
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);const T=Xe(`${S}${t}${m}`,c,Ot,xe(n,!0));return`${k}
88
- ${c}${T}`}function En(s,e,t,n){const{type:i,value:r}=s,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:h}=e;if(a&&r.includes(`
89
- `)||h&&/[[\]{},]/.test(r))return he(r,e);if(!r||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||h||!r.includes(`
90
- `)?he(r,e):Ve(s,e,t,n);if(!a&&!h&&i!==O.PLAIN&&r.includes(`
91
- `))return Ve(s,e,t,n);if(Ze(r)){if(l==="")return e.forceBlockIndent=!0,Ve(s,e,t,n);if(a&&l===c)return he(r,e)}const f=r.replace(/\n+/g,`$&
92
- ${l}`);if(o){const p=u=>{var g;return u.default&&u.tag!=="tag:yaml.org,2002:str"&&((g=u.test)==null?void 0:g.test(f))},{compat:m,tags:y}=e.doc.schema;if(y.some(p)||m!=null&&m.some(p))return he(r,e)}return a?f:Xe(f,l,ys,xe(e,!1))}function ve(s,e,t,n){const{implicitKey:i,inFlow:r}=e,o=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)});let{type:a}=s;a!==O.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=O.QUOTE_DOUBLE);const l=h=>{switch(h){case O.BLOCK_FOLDED:case O.BLOCK_LITERAL:return i||r?he(o.value,e):Ve(o,e,t,n);case O.QUOTE_DOUBLE:return Le(o.value,e);case O.QUOTE_SINGLE:return Tt(o.value,e);case O.PLAIN:return En(o,e,t,n);default:return null}};let c=l(a);if(c===null){const{defaultKeyType:h,defaultStringType:f}=e.options,p=i&&h||f;if(c=l(p),c===null)throw new Error(`Unsupported default string type ${p}`)}return c}function gs(s,e){const t=Object.assign({blockQuote:!0,commentString:Tn,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,trueStr:"true",verifyAliasOrder:!0},s.schema.toStringOptions,e);let n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:s,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function An(s,e){var i,r,o,a;if(e.tag){const l=s.filter(c=>c.tag===e.tag);if(l.length>0)return(i=l.find(c=>c.format===e.format))!=null?i:l[0]}let t,n;if(A(e)){n=e.value;const l=s.filter(c=>{var h;return(h=c.identify)==null?void 0:h.call(c,n)});t=(r=l.find(c=>c.format===e.format))!=null?r:l.find(c=>!c.format)}else n=e,t=s.find(l=>l.nodeClass&&n instanceof l.nodeClass);if(!t){const l=(a=(o=n==null?void 0:n.constructor)==null?void 0:o.name)!=null?a:typeof n;throw new Error(`Tag not resolved for ${l} value`)}return t}function In(s,e,{anchors:t,doc:n}){if(!n.directives)return"";const i=[],r=(A(s)||L(s))&&s.anchor;r&&us(r)&&(t.add(r),i.push(`&${r}`));const o=s.tag?s.tag:e.default?null:e.tag;return o&&i.push(n.directives.tagString(o)),i.join(" ")}function me(s,e,t,n){var l,c;if(I(s))return s.toString(e,t,n);if(re(s)){if(e.doc.directives)return s.toString(e);if((l=e.resolvedAliases)!=null&&l.has(s))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(s):e.resolvedAliases=new Set([s]),s=s.resolve(e.doc)}let i;const r=M(s)?s:e.doc.createNode(s,{onTagObj:h=>i=h});i||(i=An(e.doc.schema.tags,r));const o=In(r,i,e);o.length>0&&(e.indentAtStart=((c=e.indentAtStart)!=null?c:0)+o.length+1);const a=typeof i.stringify=="function"?i.stringify(r,e,t,n):A(r)?ve(r,e,t,n):r.toString(e,t,n);return o?A(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
93
- ${e.indent}${a}`:a}function $n({key:s,value:e},t,n,i){var C,w;const{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:h,simpleKeys:f}}=t;let p=M(s)&&s.comment||null;if(f){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(L(s)||!M(s)&&typeof s=="object"){const $="With simple keys, collection cannot be used as a key value";throw new Error($)}}let m=!f&&(!s||p&&e==null&&!t.inFlow||L(s)||(A(s)?s.type===O.BLOCK_FOLDED||s.type===O.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(f||!r),indent:a+l});let y=!1,u=!1,g=me(s,t,()=>y=!0,()=>u=!0);if(!m&&!t.inFlow&&g.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(r||e==null)return y&&n&&n(),g===""?"?":m?`? ${g}`:g}else if(r&&!f||e==null&&m)return g=`? ${g}`,p&&!y?g+=te(g,t.indent,c(p)):u&&i&&i(),g;y&&(p=null),m?(p&&(g+=te(g,t.indent,c(p))),g=`? ${g}
94
- ${a}:`):(g=`${g}:`,p&&(g+=te(g,t.indent,c(p))));let b,S,E;M(e)?(b=!!e.spaceBefore,S=e.commentBefore,E=e.comment):(b=!1,S=null,E=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!m&&!p&&A(e)&&(t.indentAtStart=g.length+1),u=!1,!h&&l.length>=2&&!t.inFlow&&!m&&Se(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let k=!1;const T=me(e,t,()=>k=!0,()=>u=!0);let N=" ";if(p||b||S){if(N=b?`
95
- `:"",S){const $=c(S);N+=`
96
- ${Q($,t.indent)}`}T===""&&!t.inFlow?N===`
97
- `&&(N=`
28
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);const O=We(`${S}${t}${m}`,c,bt,He(n,!0));return`${k}
29
+ ${c}${O}`}function nn(s,e,t,n){const{type:i,value:r}=s,{actualString:o,implicitKey:l,indent:a,indentStep:c,inFlow:h}=e;if(l&&r.includes(`
30
+ `)||h&&/[[\]{},]/.test(r))return ue(r,e);if(!r||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return l||h||!r.includes(`
31
+ `)?ue(r,e):Fe(s,e,t,n);if(!l&&!h&&i!==N.PLAIN&&r.includes(`
32
+ `))return Fe(s,e,t,n);if(Xe(r)){if(a==="")return e.forceBlockIndent=!0,Fe(s,e,t,n);if(l&&a===c)return ue(r,e)}const f=r.replace(/\n+/g,`$&
33
+ ${a}`);if(o){const p=u=>{var g;return u.default&&u.tag!=="tag:yaml.org,2002:str"&&((g=u.test)==null?void 0:g.test(f))},{compat:m,tags:y}=e.doc.schema;if(y.some(p)||m!=null&&m.some(p))return ue(r,e)}return l?f:We(f,a,cs,He(e,!1))}function _e(s,e,t,n){const{implicitKey:i,inFlow:r}=e,o=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)});let{type:l}=s;l!==N.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=N.QUOTE_DOUBLE);const a=h=>{switch(h){case N.BLOCK_FOLDED:case N.BLOCK_LITERAL:return i||r?ue(o.value,e):Fe(o,e,t,n);case N.QUOTE_DOUBLE:return Ie(o.value,e);case N.QUOTE_SINGLE:return wt(o.value,e);case N.PLAIN:return nn(o,e,t,n);default:return null}};let c=a(l);if(c===null){const{defaultKeyType:h,defaultStringType:f}=e.options,p=i&&h||f;if(c=a(p),c===null)throw new Error(`Unsupported default string type ${p}`)}return c}function fs(s,e){const t=Object.assign({blockQuote:!0,commentString:tn,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,trueStr:"true",verifyAliasOrder:!0},s.schema.toStringOptions,e);let n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:s,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function rn(s,e){var i,r,o,l;if(e.tag){const a=s.filter(c=>c.tag===e.tag);if(a.length>0)return(i=a.find(c=>c.format===e.format))!=null?i:a[0]}let t,n;if(I(e)){n=e.value;const a=s.filter(c=>{var h;return(h=c.identify)==null?void 0:h.call(c,n)});t=(r=a.find(c=>c.format===e.format))!=null?r:a.find(c=>!c.format)}else n=e,t=s.find(a=>a.nodeClass&&n instanceof a.nodeClass);if(!t){const a=(l=(o=n==null?void 0:n.constructor)==null?void 0:o.name)!=null?l:typeof n;throw new Error(`Tag not resolved for ${a} value`)}return t}function on(s,e,{anchors:t,doc:n}){if(!n.directives)return"";const i=[],r=(I(s)||$(s))&&s.anchor;r&&is(r)&&(t.add(r),i.push(`&${r}`));const o=s.tag?s.tag:e.default?null:e.tag;return o&&i.push(n.directives.tagString(o)),i.join(" ")}function pe(s,e,t,n){var a,c;if(A(s))return s.toString(e,t,n);if(ie(s)){if(e.doc.directives)return s.toString(e);if((a=e.resolvedAliases)!=null&&a.has(s))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(s):e.resolvedAliases=new Set([s]),s=s.resolve(e.doc)}let i;const r=M(s)?s:e.doc.createNode(s,{onTagObj:h=>i=h});i||(i=rn(e.doc.schema.tags,r));const o=on(r,i,e);o.length>0&&(e.indentAtStart=((c=e.indentAtStart)!=null?c:0)+o.length+1);const l=typeof i.stringify=="function"?i.stringify(r,e,t,n):I(r)?_e(r,e,t,n):r.toString(e,t,n);return o?I(r)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
34
+ ${e.indent}${l}`:l}function ln({key:s,value:e},t,n,i){var _,w;const{allNullValues:r,doc:o,indent:l,indentStep:a,options:{commentString:c,indentSeq:h,simpleKeys:f}}=t;let p=M(s)&&s.comment||null;if(f){if(p)throw new Error("With simple keys, key nodes cannot have comments");if($(s)||!M(s)&&typeof s=="object"){const L="With simple keys, collection cannot be used as a key value";throw new Error(L)}}let m=!f&&(!s||p&&e==null&&!t.inFlow||$(s)||(I(s)?s.type===N.BLOCK_FOLDED||s.type===N.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(f||!r),indent:l+a});let y=!1,u=!1,g=pe(s,t,()=>y=!0,()=>u=!0);if(!m&&!t.inFlow&&g.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(r||e==null)return y&&n&&n(),g===""?"?":m?`? ${g}`:g}else if(r&&!f||e==null&&m)return g=`? ${g}`,p&&!y?g+=ee(g,t.indent,c(p)):u&&i&&i(),g;y&&(p=null),m?(p&&(g+=ee(g,t.indent,c(p))),g=`? ${g}
35
+ ${l}:`):(g=`${g}:`,p&&(g+=ee(g,t.indent,c(p))));let b,S,E;M(e)?(b=!!e.spaceBefore,S=e.commentBefore,E=e.comment):(b=!1,S=null,E=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!m&&!p&&I(e)&&(t.indentAtStart=g.length+1),u=!1,!h&&a.length>=2&&!t.inFlow&&!m&&we(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let k=!1;const O=pe(e,t,()=>k=!0,()=>u=!0);let T=" ";if(p||b||S){if(T=b?`
36
+ `:"",S){const L=c(S);T+=`
37
+ ${Q(L,t.indent)}`}O===""&&!t.inFlow?T===`
38
+ `&&(T=`
98
39
 
99
- `):N+=`
100
- ${t.indent}`}else if(!m&&L(e)){const $=T[0],_=T.indexOf(`
101
- `),j=_!==-1,Z=(w=(C=t.inFlow)!=null?C:e.flow)!=null?w:e.items.length===0;if(j||!Z){let oe=!1;if(j&&($==="&"||$==="!")){let D=T.indexOf(" ");$==="&"&&D!==-1&&D<_&&T[D+1]==="!"&&(D=T.indexOf(" ",D+1)),(D===-1||_<D)&&(oe=!0)}oe||(N=`
102
- ${t.indent}`)}}else(T===""||T[0]===`
103
- `)&&(N="");return g+=N+T,t.inFlow?k&&n&&n():E&&!k?g+=te(g,t.indent,c(E)):u&&i&&i(),g}function bs(s,e){(s==="debug"||s==="warn")&&(typeof process!="undefined"&&process.emitWarning?process.emitWarning(e):console.warn(e))}const Qt="<<";function ws(s,e,{key:t,value:n}){if(s!=null&&s.doc.schema.merge&&Ln(t))if(n=re(n)?n.resolve(s.doc):n,Se(n))for(const i of n.items)ht(s,e,i);else if(Array.isArray(n))for(const i of n)ht(s,e,i);else ht(s,e,n);else{const i=U(t,"",s);if(e instanceof Map)e.set(i,U(n,i,s));else if(e instanceof Set)e.add(i);else{const r=Cn(t,i,s),o=U(n,r,s);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}const Ln=s=>s===Qt||A(s)&&s.value===Qt&&(!s.type||s.type===O.PLAIN);function ht(s,e,t){const n=s&&re(t)?t.resolve(s.doc):t;if(!we(n))throw new Error("Merge sources must be maps or map aliases");const i=n.toJSON(null,s,Map);for(const[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Cn(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(M(s)&&(t!=null&&t.doc)){const n=gs(t.doc,{});n.anchors=new Set;for(const r of t.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;const i=s.toString(n);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),bs(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}function Lt(s,e,t){const n=Ce(s,void 0,t),i=Ce(e,void 0,t);return new q(n,i)}class q{constructor(e,t=null){Object.defineProperty(this,V,{value:os}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return M(t)&&(t=t.clone(e)),M(n)&&(n=n.clone(e)),new q(t,n)}toJSON(e,t){const n=t!=null&&t.mapAsMap?new Map:{};return ws(t,n,this)}toString(e,t,n){return e!=null&&e.doc?$n(this,e,t,n):JSON.stringify(this)}}function Ss(s,e,t){var r;return(((r=e.inFlow)!=null?r:s.flow)?Mn:_n)(s,e,t)}function _n({comment:s,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:c}}=t,h=Object.assign({},t,{indent:r,type:null});let f=!1;const p=[];for(let y=0;y<e.length;++y){const u=e[y];let g=null;if(M(u))!f&&u.spaceBefore&&p.push(""),We(t,p,u.commentBefore,f),u.comment&&(g=u.comment);else if(I(u)){const S=M(u.key)?u.key:null;S&&(!f&&S.spaceBefore&&p.push(""),We(t,p,S.commentBefore,f))}f=!1;let b=me(u,h,()=>g=null,()=>f=!0);g&&(b+=te(b,r,c(g))),f&&g&&(f=!1),p.push(n+b)}let m;if(p.length===0)m=i.start+i.end;else{m=p[0];for(let y=1;y<p.length;++y){const u=p[y];m+=u?`
104
- ${l}${u}`:`
40
+ `):T+=`
41
+ ${t.indent}`}else if(!m&&$(e)){const L=O[0],C=O.indexOf(`
42
+ `),B=C!==-1,x=(w=(_=t.inFlow)!=null?_:e.flow)!=null?w:e.items.length===0;if(B||!x){let re=!1;if(B&&(L==="&"||L==="!")){let v=O.indexOf(" ");L==="&"&&v!==-1&&v<C&&O[v+1]==="!"&&(v=O.indexOf(" ",v+1)),(v===-1||C<v)&&(re=!0)}re||(T=`
43
+ ${t.indent}`)}}else(O===""||O[0]===`
44
+ `)&&(T="");return g+=T+O,t.inFlow?k&&n&&n():E&&!k?g+=ee(g,t.indent,c(E)):u&&i&&i(),g}function us(s,e){(s==="debug"||s==="warn")&&(typeof process!="undefined"&&process.emitWarning?process.emitWarning(e):console.warn(e))}const Ut="<<";function hs(s,e,{key:t,value:n}){if(s!=null&&s.doc.schema.merge&&an(t))if(n=ie(n)?n.resolve(s.doc):n,we(n))for(const i of n.items)ft(s,e,i);else if(Array.isArray(n))for(const i of n)ft(s,e,i);else ft(s,e,n);else{const i=K(t,"",s);if(e instanceof Map)e.set(i,K(n,i,s));else if(e instanceof Set)e.add(i);else{const r=cn(t,i,s),o=K(n,r,s);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}const an=s=>s===Ut||I(s)&&s.value===Ut&&(!s.type||s.type===N.PLAIN);function ft(s,e,t){const n=s&&ie(t)?t.resolve(s.doc):t;if(!be(n))throw new Error("Merge sources must be maps or map aliases");const i=n.toJSON(null,s,Map);for(const[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function cn(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(M(s)&&(t!=null&&t.doc)){const n=fs(t.doc,{});n.anchors=new Set;for(const r of t.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;const i=s.toString(n);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),us(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}function Et(s,e,t){const n=Ae(s,void 0,t),i=Ae(e,void 0,t);return new P(n,i)}class P{constructor(e,t=null){Object.defineProperty(this,F,{value:Zt}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return M(t)&&(t=t.clone(e)),M(n)&&(n=n.clone(e)),new P(t,n)}toJSON(e,t){const n=t!=null&&t.mapAsMap?new Map:{};return hs(t,n,this)}toString(e,t,n){return e!=null&&e.doc?ln(this,e,t,n):JSON.stringify(this)}}function ds(s,e,t){var r;return(((r=e.inFlow)!=null?r:s.flow)?un:fn)(s,e,t)}function fn({comment:s,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:l}){const{indent:a,options:{commentString:c}}=t,h=Object.assign({},t,{indent:r,type:null});let f=!1;const p=[];for(let y=0;y<e.length;++y){const u=e[y];let g=null;if(M(u))!f&&u.spaceBefore&&p.push(""),Ve(t,p,u.commentBefore,f),u.comment&&(g=u.comment);else if(A(u)){const S=M(u.key)?u.key:null;S&&(!f&&S.spaceBefore&&p.push(""),Ve(t,p,S.commentBefore,f))}f=!1;let b=pe(u,h,()=>g=null,()=>f=!0);g&&(b+=ee(b,r,c(g))),f&&g&&(f=!1),p.push(n+b)}let m;if(p.length===0)m=i.start+i.end;else{m=p[0];for(let y=1;y<p.length;++y){const u=p[y];m+=u?`
45
+ ${a}${u}`:`
105
46
  `}}return s?(m+=`
106
- `+Q(c(s),l),a&&a()):f&&o&&o(),m}function Mn({items:s},e,{flowChars:t,itemIndent:n}){const{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=e;n+=r;const l=Object.assign({},e,{indent:n,inFlow:!0,type:null});let c=!1,h=0;const f=[];for(let y=0;y<s.length;++y){const u=s[y];let g=null;if(M(u))u.spaceBefore&&f.push(""),We(e,f,u.commentBefore,!1),u.comment&&(g=u.comment);else if(I(u)){const S=M(u.key)?u.key:null;S&&(S.spaceBefore&&f.push(""),We(e,f,S.commentBefore,!1),S.comment&&(c=!0));const E=M(u.value)?u.value:null;E?(E.comment&&(g=E.comment),E.commentBefore&&(c=!0)):u.value==null&&(S!=null&&S.comment)&&(g=S.comment)}g&&(c=!0);let b=me(u,l,()=>g=null);y<s.length-1&&(b+=","),g&&(b+=te(b,n,a(g))),!c&&(f.length>h||b.includes(`
47
+ `+Q(c(s),a),l&&l()):f&&o&&o(),m}function un({items:s},e,{flowChars:t,itemIndent:n}){const{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:l}}=e;n+=r;const a=Object.assign({},e,{indent:n,inFlow:!0,type:null});let c=!1,h=0;const f=[];for(let y=0;y<s.length;++y){const u=s[y];let g=null;if(M(u))u.spaceBefore&&f.push(""),Ve(e,f,u.commentBefore,!1),u.comment&&(g=u.comment);else if(A(u)){const S=M(u.key)?u.key:null;S&&(S.spaceBefore&&f.push(""),Ve(e,f,S.commentBefore,!1),S.comment&&(c=!0));const E=M(u.value)?u.value:null;E?(E.comment&&(g=E.comment),E.commentBefore&&(c=!0)):u.value==null&&(S!=null&&S.comment)&&(g=S.comment)}g&&(c=!0);let b=pe(u,a,()=>g=null);y<s.length-1&&(b+=","),g&&(b+=ee(b,n,l(g))),!c&&(f.length>h||b.includes(`
107
48
  `))&&(c=!0),f.push(b),h=f.length}const{start:p,end:m}=t;if(f.length===0)return p+m;if(!c){const y=f.reduce((u,g)=>u+g.length+2,2);c=e.options.lineWidth>0&&y>e.options.lineWidth}if(c){let y=p;for(const u of f)y+=u?`
108
49
  ${r}${i}${u}`:`
109
50
  `;return`${y}
110
- ${i}${m}`}else return`${p}${o}${f.join(" ")}${o}${m}`}function We({indent:s,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){const r=Q(e(n),s);t.push(r.trimStart())}}function se(s,e){const t=A(e)?e.value:e;for(const n of s)if(I(n)&&(n.key===e||n.key===t||A(n.key)&&n.key.value===t))return n}class R extends ms{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(z,e),this.items=[]}static from(e,t,n){const{keepUndefined:i,replacer:r}=n,o=new this(e),a=(l,c)=>{if(typeof r=="function")c=r.call(t,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&o.items.push(Lt(l,c,n))};if(t instanceof Map)for(const[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(const l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){var o;let n;I(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new q(e,e==null?void 0:e.value):n=new q(e.key,e.value);const i=se(this.items,n.key),r=(o=this.schema)==null?void 0:o.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);A(i.value)&&ps(n.value)?i.value.value=n.value:i.value=n.value}else if(r){const a=this.items.findIndex(l=>r(n,l)<0);a===-1?this.items.push(n):this.items.splice(a,0,n)}else this.items.push(n)}delete(e){const t=se(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){var r;const n=se(this.items,e),i=n==null?void 0:n.value;return(r=!t&&A(i)?i.value:i)!=null?r:void 0}has(e){return!!se(this.items,e)}set(e,t){this.add(new q(e,t),!0)}toJSON(e,t,n){const i=n?new n:t!=null&&t.mapAsMap?new Map:{};t!=null&&t.onCreate&&t.onCreate(i);for(const r of this.items)ws(t,i,r);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(const i of this.items)if(!I(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Ss(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}const ke={collection:"map",default:!0,nodeClass:R,tag:"tag:yaml.org,2002:map",resolve(s,e){return we(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,t)=>R.from(s,e,t)};class x extends ms{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(ge,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=Be(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const n=Be(e);if(typeof n!="number")return;const i=this.items[n];return!t&&A(i)?i.value:i}has(e){const t=Be(e);return typeof t=="number"&&t<this.items.length}set(e,t){const n=Be(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[n];A(i)&&ps(t)?i.value=t:this.items[n]=t}toJSON(e,t){const n=[];t!=null&&t.onCreate&&t.onCreate(n);let i=0;for(const r of this.items)n.push(U(r,String(i++),t));return n}toString(e,t,n){return e?Ss(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){const{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof i=="function"){const l=t instanceof Set?a:String(o++);a=i.call(t,l,a)}r.items.push(Ce(a,void 0,n))}}return r}}function Be(s){let e=A(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const Oe={collection:"seq",default:!0,nodeClass:x,tag:"tag:yaml.org,2002:seq",resolve(s,e){return Se(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,t)=>x.from(s,e,t)},et={identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify(s,e,t,n){return e=Object.assign({actualString:!0},e),ve(s,e,t,n)}},tt={identify:s=>s==null,createNode:()=>new O(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new O(null),stringify:({source:s},e)=>typeof s=="string"&&tt.test.test(s)?s:e.options.nullStr},Ct={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new O(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&Ct.test.test(s)){const n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};function Y({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);const i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=JSON.stringify(n);if(!s&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}const ks={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Y},Os={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s),stringify(s){const e=Number(s.value);return isFinite(e)?e.toExponential():Y(s)}},Ts={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){const e=new O(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:Y},st=s=>typeof s=="bigint"||Number.isInteger(s),_t=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function Ns(s,e,t){const{value:n}=s;return st(n)&&n>=0?t+n.toString(e):Y(s)}const Es={identify:s=>st(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>_t(s,2,8,t),stringify:s=>Ns(s,8,"0o")},As={identify:st,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>_t(s,0,10,t),stringify:Y},Is={identify:s=>st(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>_t(s,2,16,t),stringify:s=>Ns(s,16,"0x")},vn=[ke,Oe,et,tt,Ct,Es,As,Is,ks,Os,Ts];function Gt(s){return typeof s=="bigint"||Number.isInteger(s)}const Pe=({value:s})=>JSON.stringify(s),Dn=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:Pe},{identify:s=>s==null,createNode:()=>new O(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Pe},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:s=>s==="true",stringify:Pe},{identify:Gt,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(s,e,{intAsBigInt:t})=>t?BigInt(s):parseInt(s,10),stringify:({value:s})=>Gt(s)?s.toString():JSON.stringify(s)},{identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:s=>parseFloat(s),stringify:Pe}],jn={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},qn=[ke,Oe].concat(Dn,jn),Mt={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof Buffer=="function")return Buffer.from(s,"base64");if(typeof atob=="function"){const t=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:e,value:t},n,i,r){const o=t;let a;if(typeof Buffer=="function")a=o instanceof Buffer?o.toString("base64"):Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e||(e=O.BLOCK_LITERAL),e!==O.QUOTE_DOUBLE){const l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/l),h=new Array(c);for(let f=0,p=0;f<c;++f,p+=l)h[f]=a.substr(p,l);a=h.join(e===O.BLOCK_LITERAL?`
111
- `:" ")}return ve({comment:s,type:e,value:a},n,i,r)}};function $s(s,e){var t;if(Se(s))for(let n=0;n<s.items.length;++n){let i=s.items[n];if(!I(i)){if(we(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");const r=i.items[0]||new q(new O(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
51
+ ${i}${m}`}else return`${p}${o}${f.join(" ")}${o}${m}`}function Ve({indent:s,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){const r=Q(e(n),s);t.push(r.trimStart())}}function te(s,e){const t=I(e)?e.value:e;for(const n of s)if(A(n)&&(n.key===e||n.key===t||I(n.key)&&n.key.value===t))return n}class D extends as{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(H,e),this.items=[]}static from(e,t,n){const{keepUndefined:i,replacer:r}=n,o=new this(e),l=(a,c)=>{if(typeof r=="function")c=r.call(t,a,c);else if(Array.isArray(r)&&!r.includes(a))return;(c!==void 0||i)&&o.items.push(Et(a,c,n))};if(t instanceof Map)for(const[a,c]of t)l(a,c);else if(t&&typeof t=="object")for(const a of Object.keys(t))l(a,t[a]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){var o;let n;A(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new P(e,e==null?void 0:e.value):n=new P(e.key,e.value);const i=te(this.items,n.key),r=(o=this.schema)==null?void 0:o.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);I(i.value)&&ls(n.value)?i.value.value=n.value:i.value=n.value}else if(r){const l=this.items.findIndex(a=>r(n,a)<0);l===-1?this.items.push(n):this.items.splice(l,0,n)}else this.items.push(n)}delete(e){const t=te(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){var r;const n=te(this.items,e),i=n==null?void 0:n.value;return(r=!t&&I(i)?i.value:i)!=null?r:void 0}has(e){return!!te(this.items,e)}set(e,t){this.add(new P(e,t),!0)}toJSON(e,t,n){const i=n?new n:t!=null&&t.mapAsMap?new Map:{};t!=null&&t.onCreate&&t.onCreate(i);for(const r of this.items)hs(t,i,r);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(const i of this.items)if(!A(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ds(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}const Se={collection:"map",default:!0,nodeClass:D,tag:"tag:yaml.org,2002:map",resolve(s,e){return be(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,t)=>D.from(s,e,t)};class z extends as{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(ye,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=Be(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const n=Be(e);if(typeof n!="number")return;const i=this.items[n];return!t&&I(i)?i.value:i}has(e){const t=Be(e);return typeof t=="number"&&t<this.items.length}set(e,t){const n=Be(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[n];I(i)&&ls(t)?i.value=t:this.items[n]=t}toJSON(e,t){const n=[];t!=null&&t.onCreate&&t.onCreate(n);let i=0;for(const r of this.items)n.push(K(r,String(i++),t));return n}toString(e,t,n){return e?ds(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){const{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let l of t){if(typeof i=="function"){const a=t instanceof Set?l:String(o++);l=i.call(t,a,l)}r.items.push(Ae(l,void 0,n))}}return r}}function Be(s){let e=I(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const ke={collection:"seq",default:!0,nodeClass:z,tag:"tag:yaml.org,2002:seq",resolve(s,e){return we(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,t)=>z.from(s,e,t)},ze={identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify(s,e,t,n){return e=Object.assign({actualString:!0},e),_e(s,e,t,n)}},xe={identify:s=>s==null,createNode:()=>new N(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new N(null),stringify:({source:s},e)=>typeof s=="string"&&xe.test.test(s)?s:e.options.nullStr},It={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new N(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&It.test.test(s)){const n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};function J({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);const i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=JSON.stringify(n);if(!s&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let l=e-(r.length-o-1);for(;l-- >0;)r+="0"}return r}const ps={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:J},ms={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s),stringify(s){const e=Number(s.value);return isFinite(e)?e.toExponential():J(s)}},ys={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){const e=new N(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:J},Ze=s=>typeof s=="bigint"||Number.isInteger(s),At=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function gs(s,e,t){const{value:n}=s;return Ze(n)&&n>=0?t+n.toString(e):J(s)}const bs={identify:s=>Ze(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>At(s,2,8,t),stringify:s=>gs(s,8,"0o")},ws={identify:Ze,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>At(s,0,10,t),stringify:J},Ss={identify:s=>Ze(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>At(s,2,16,t),stringify:s=>gs(s,16,"0x")},hn=[Se,ke,ze,xe,It,bs,ws,Ss,ps,ms,ys];function Vt(s){return typeof s=="bigint"||Number.isInteger(s)}const Pe=({value:s})=>JSON.stringify(s),dn=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:Pe},{identify:s=>s==null,createNode:()=>new N(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Pe},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:s=>s==="true",stringify:Pe},{identify:Vt,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(s,e,{intAsBigInt:t})=>t?BigInt(s):parseInt(s,10),stringify:({value:s})=>Vt(s)?s.toString():JSON.stringify(s)},{identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:s=>parseFloat(s),stringify:Pe}],pn={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},mn=[Se,ke].concat(dn,pn),Lt={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof Buffer=="function")return Buffer.from(s,"base64");if(typeof atob=="function"){const t=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:e,value:t},n,i,r){const o=t;let l;if(typeof Buffer=="function")l=o instanceof Buffer?o.toString("base64"):Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let a="";for(let c=0;c<o.length;++c)a+=String.fromCharCode(o[c]);l=btoa(a)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e||(e=N.BLOCK_LITERAL),e!==N.QUOTE_DOUBLE){const a=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(l.length/a),h=new Array(c);for(let f=0,p=0;f<c;++f,p+=a)h[f]=l.substr(p,a);l=h.join(e===N.BLOCK_LITERAL?`
52
+ `:" ")}return _e({comment:s,type:e,value:l},n,i,r)}};function ks(s,e){var t;if(we(s))for(let n=0;n<s.items.length;++n){let i=s.items[n];if(!A(i)){if(be(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");const r=i.items[0]||new P(new N(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
112
53
  ${r.key.commentBefore}`:i.commentBefore),i.comment){const o=(t=r.value)!=null?t:r.key;o.comment=o.comment?`${i.comment}
113
- ${o.comment}`:i.comment}i=r}s.items[n]=I(i)?i:new q(i)}}else e("Expected a sequence for this tag");return s}function Ls(s,e,t){const{replacer:n}=t,i=new x(s);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(Lt(a,l,t))}return i}const vt={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:$s,createNode:Ls};class de extends x{constructor(){super(),this.add=R.prototype.add.bind(this),this.delete=R.prototype.delete.bind(this),this.get=R.prototype.get.bind(this),this.has=R.prototype.has.bind(this),this.set=R.prototype.set.bind(this),this.tag=de.tag}toJSON(e,t){if(!t)return super.toJSON(e);const n=new Map;t!=null&&t.onCreate&&t.onCreate(n);for(const i of this.items){let r,o;if(I(i)?(r=U(i.key,"",t),o=U(i.value,r,t)):r=U(i,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,o)}return n}static from(e,t,n){const i=Ls(e,t,n),r=new this;return r.items=i.items,r}}de.tag="tag:yaml.org,2002:omap";const Dt={collection:"seq",identify:s=>s instanceof Map,nodeClass:de,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){const t=$s(s,e),n=[];for(const{key:i}of t.items)A(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new de,t)},createNode:(s,e,t)=>de.from(s,e,t)};function Cs({value:s,source:e},t){return e&&(s?_s:Ms).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}const _s={identify:s=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new O(!0),stringify:Cs},Ms={identify:s=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new O(!1),stringify:Cs},Bn={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Y},Pn={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s.replace(/_/g,"")),stringify(s){const e=Number(s.value);return isFinite(e)?e.toExponential():Y(s)}},Kn={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){const e=new O(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){const n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Y},De=s=>typeof s=="bigint"||Number.isInteger(s);function nt(s,e,t,{intAsBigInt:n}){const i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}const o=BigInt(s);return i==="-"?BigInt(-1)*o:o}const r=parseInt(s,t);return i==="-"?-1*r:r}function jt(s,e,t){const{value:n}=s;if(De(n)){const i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return Y(s)}const Fn={identify:De,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>nt(s,2,2,t),stringify:s=>jt(s,2,"0b")},Rn={identify:De,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>nt(s,1,8,t),stringify:s=>jt(s,8,"0")},Un={identify:De,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>nt(s,0,10,t),stringify:Y},Vn={identify:De,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>nt(s,2,16,t),stringify:s=>jt(s,16,"0x")};class pe extends R{constructor(e){super(e),this.tag=pe.tag}add(e){let t;I(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new q(e.key,null):t=new q(e,null),se(this.items,t.key)||this.items.push(t)}get(e,t){const n=se(this.items,e);return!t&&I(n)?A(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const n=se(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new q(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){const{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(Lt(o,null,n));return r}}pe.tag="tag:yaml.org,2002:set";const qt={collection:"map",identify:s=>s instanceof Set,nodeClass:pe,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>pe.from(s,e,t),resolve(s,e){if(we(s)){if(s.hasAllNullValues(!0))return Object.assign(new pe,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};function Bt(s,e){const t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=o=>e?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return t==="-"?i(-1)*r:r}function vs(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Y(s);let n="";e<0&&(n="-",e*=t(-1));const i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),n+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Ds={identify:s=>typeof s=="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,e,{intAsBigInt:t})=>Bt(s,t),stringify:vs},js={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:s=>Bt(s,!1),stringify:vs},it={identify:s=>s 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(s){const e=s.match(it.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,n,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(t,n-1,i,r||0,o||0,a||0,l);const h=e[8];if(h&&h!=="Z"){let f=Bt(h,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:s})=>s.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},Ht=[ke,Oe,et,tt,_s,Ms,Fn,Rn,Un,Vn,Bn,Pn,Kn,Mt,Dt,vt,qt,Ds,js,it],zt=new Map([["core",vn],["failsafe",[ke,Oe,et]],["json",qn],["yaml11",Ht],["yaml-1.1",Ht]]),Xt={binary:Mt,bool:Ct,float:Ts,floatExp:Os,floatNaN:ks,floatTime:js,int:As,intHex:Is,intOct:Es,intTime:Ds,map:ke,null:tt,omap:Dt,pairs:vt,seq:Oe,set:qt,timestamp:it},Jn={"tag:yaml.org,2002:binary":Mt,"tag:yaml.org,2002:omap":Dt,"tag:yaml.org,2002:pairs":vt,"tag:yaml.org,2002:set":qt,"tag:yaml.org,2002:timestamp":it};function dt(s,e){let t=zt.get(e);if(!t)if(Array.isArray(s))t=[];else{const n=Array.from(zt.keys()).filter(i=>i!=="yaml11").map(i=>JSON.stringify(i)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${n} or define customTags array`)}if(Array.isArray(s))for(const n of s)t=t.concat(n);else typeof s=="function"&&(t=s(t.slice()));return t.map(n=>{if(typeof n!="string")return n;const i=Xt[n];if(i)return i;const r=Object.keys(Xt).map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown custom tag "${n}"; use one of ${r}`)})}const Yn=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0;class rt{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?dt(e,"compat"):e?dt(null,e):null,this.merge=!!n,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Jn:{},this.tags=dt(t,this.name),this.toStringOptions=a!=null?a:null,Object.defineProperty(this,z,{value:ke}),Object.defineProperty(this,G,{value:et}),Object.defineProperty(this,ge,{value:Oe}),this.sortMapEntries=typeof o=="function"?o:o===!0?Yn:null}clone(){const e=Object.create(rt.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function Wn(s,e){var l;const t=[];let n=e.directives===!0;if(e.directives!==!1&&s.directives){const c=s.directives.toString(s);c?(t.push(c),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");const i=gs(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");const c=r(s.commentBefore);t.unshift(Q(c,""))}let o=!1,a=null;if(s.contents){if(M(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){const f=r(s.contents.commentBefore);t.push(Q(f,""))}i.forceBlockIndent=!!s.comment,a=s.contents.comment}const c=a?void 0:()=>o=!0;let h=me(s.contents,i,()=>a=null,c);a&&(h+=te(h,"",r(a))),(h[0]==="|"||h[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${h}`:t.push(h)}else t.push(me(s.contents,i));if((l=s.directives)!=null&&l.docEnd)if(s.comment){const c=r(s.comment);c.includes(`
114
- `)?(t.push("..."),t.push(Q(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=s.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(Q(r(c),"")))}return t.join(`
54
+ ${o.comment}`:i.comment}i=r}s.items[n]=A(i)?i:new P(i)}}else e("Expected a sequence for this tag");return s}function Ns(s,e,t){const{replacer:n}=t,i=new z(s);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(r++),o));let l,a;if(Array.isArray(o))if(o.length===2)l=o[0],a=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)l=c[0],a=o[l];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else l=o;i.items.push(Et(l,a,t))}return i}const $t={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ks,createNode:Ns};class he extends z{constructor(){super(),this.add=D.prototype.add.bind(this),this.delete=D.prototype.delete.bind(this),this.get=D.prototype.get.bind(this),this.has=D.prototype.has.bind(this),this.set=D.prototype.set.bind(this),this.tag=he.tag}toJSON(e,t){if(!t)return super.toJSON(e);const n=new Map;t!=null&&t.onCreate&&t.onCreate(n);for(const i of this.items){let r,o;if(A(i)?(r=K(i.key,"",t),o=K(i.value,r,t)):r=K(i,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,o)}return n}static from(e,t,n){const i=Ns(e,t,n),r=new this;return r.items=i.items,r}}he.tag="tag:yaml.org,2002:omap";const _t={collection:"seq",identify:s=>s instanceof Map,nodeClass:he,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){const t=ks(s,e),n=[];for(const{key:i}of t.items)I(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new he,t)},createNode:(s,e,t)=>he.from(s,e,t)};function Os({value:s,source:e},t){return e&&(s?Ts:Es).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}const Ts={identify:s=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new N(!0),stringify:Os},Es={identify:s=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new N(!1),stringify:Os},yn={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:J},gn={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s.replace(/_/g,"")),stringify(s){const e=Number(s.value);return isFinite(e)?e.toExponential():J(s)}},bn={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){const e=new N(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){const n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:J},Ce=s=>typeof s=="bigint"||Number.isInteger(s);function et(s,e,t,{intAsBigInt:n}){const i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}const o=BigInt(s);return i==="-"?BigInt(-1)*o:o}const r=parseInt(s,t);return i==="-"?-1*r:r}function Ct(s,e,t){const{value:n}=s;if(Ce(n)){const i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return J(s)}const wn={identify:Ce,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>et(s,2,2,t),stringify:s=>Ct(s,2,"0b")},Sn={identify:Ce,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>et(s,1,8,t),stringify:s=>Ct(s,8,"0")},kn={identify:Ce,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>et(s,0,10,t),stringify:J},Nn={identify:Ce,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>et(s,2,16,t),stringify:s=>Ct(s,16,"0x")};class de extends D{constructor(e){super(e),this.tag=de.tag}add(e){let t;A(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new P(e.key,null):t=new P(e,null),te(this.items,t.key)||this.items.push(t)}get(e,t){const n=te(this.items,e);return!t&&A(n)?I(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const n=te(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new P(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){const{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(Et(o,null,n));return r}}de.tag="tag:yaml.org,2002:set";const Mt={collection:"map",identify:s=>s instanceof Set,nodeClass:de,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>de.from(s,e,t),resolve(s,e){if(be(s)){if(s.hasAllNullValues(!0))return Object.assign(new de,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};function vt(s,e){const t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=o=>e?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,l)=>o*i(60)+i(l),i(0));return t==="-"?i(-1)*r:r}function Is(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return J(s);let n="";e<0&&(n="-",e*=t(-1));const i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),n+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const As={identify:s=>typeof s=="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,e,{intAsBigInt:t})=>vt(s,t),stringify:Is},Ls={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:s=>vt(s,!1),stringify:Is},tt={identify:s=>s 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(s){const e=s.match(tt.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,n,i,r,o,l]=e.map(Number),a=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(t,n-1,i,r||0,o||0,l||0,a);const h=e[8];if(h&&h!=="Z"){let f=vt(h,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:s})=>s.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},Jt=[Se,ke,ze,xe,Ts,Es,wn,Sn,kn,Nn,yn,gn,bn,Lt,_t,$t,Mt,As,Ls,tt],Yt=new Map([["core",hn],["failsafe",[Se,ke,ze]],["json",mn],["yaml11",Jt],["yaml-1.1",Jt]]),Qt={binary:Lt,bool:It,float:ys,floatExp:ms,floatNaN:ps,floatTime:Ls,int:ws,intHex:Ss,intOct:bs,intTime:As,map:Se,null:xe,omap:_t,pairs:$t,seq:ke,set:Mt,timestamp:tt},On={"tag:yaml.org,2002:binary":Lt,"tag:yaml.org,2002:omap":_t,"tag:yaml.org,2002:pairs":$t,"tag:yaml.org,2002:set":Mt,"tag:yaml.org,2002:timestamp":tt};function ut(s,e){let t=Yt.get(e);if(!t)if(Array.isArray(s))t=[];else{const n=Array.from(Yt.keys()).filter(i=>i!=="yaml11").map(i=>JSON.stringify(i)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${n} or define customTags array`)}if(Array.isArray(s))for(const n of s)t=t.concat(n);else typeof s=="function"&&(t=s(t.slice()));return t.map(n=>{if(typeof n!="string")return n;const i=Qt[n];if(i)return i;const r=Object.keys(Qt).map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown custom tag "${n}"; use one of ${r}`)})}const Tn=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0;class st{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?ut(e,"compat"):e?ut(null,e):null,this.merge=!!n,this.name=typeof r=="string"&&r||"core",this.knownTags=i?On:{},this.tags=ut(t,this.name),this.toStringOptions=l!=null?l:null,Object.defineProperty(this,H,{value:Se}),Object.defineProperty(this,G,{value:ze}),Object.defineProperty(this,ye,{value:ke}),this.sortMapEntries=typeof o=="function"?o:o===!0?Tn:null}clone(){const e=Object.create(st.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function En(s,e){var a;const t=[];let n=e.directives===!0;if(e.directives!==!1&&s.directives){const c=s.directives.toString(s);c?(t.push(c),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");const i=fs(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");const c=r(s.commentBefore);t.unshift(Q(c,""))}let o=!1,l=null;if(s.contents){if(M(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){const f=r(s.contents.commentBefore);t.push(Q(f,""))}i.forceBlockIndent=!!s.comment,l=s.contents.comment}const c=l?void 0:()=>o=!0;let h=pe(s.contents,i,()=>l=null,c);l&&(h+=ee(h,"",r(l))),(h[0]==="|"||h[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${h}`:t.push(h)}else t.push(pe(s.contents,i));if((a=s.directives)!=null&&a.docEnd)if(s.comment){const c=r(s.comment);c.includes(`
55
+ `)?(t.push("..."),t.push(Q(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=s.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||l)&&t[t.length-1]!==""&&t.push(""),t.push(Q(r(c),"")))}return t.join(`
115
56
  `)+`
116
- `}class Te{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,V,{value:kt});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:o}=r;n!=null&&n._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new B({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){const e=Object.create(Te.prototype,{[V]:{value:kt}});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=M(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ae(this.contents)&&this.contents.add(e)}addIn(e,t){ae(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const n=hs(this);e.anchor=!t||n.has(t)?ds(t||"a",n):t}return new ze(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){const g=S=>typeof S=="number"||S instanceof String||S instanceof Number,b=t.filter(g).map(String);b.length>0&&(t=t.concat(b)),i=t}else n===void 0&&t&&(n=t,t=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:h}=n!=null?n:{},{onAnchor:f,setAnchors:p,sourceObjects:m}=Sn(this,o||"a"),y={aliasDuplicateObjects:r!=null?r:!0,keepUndefined:l!=null?l:!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:m},u=Ce(e,h,y);return a&&L(u)&&(u.flow=!0),p(),u}createPair(e,t,n={}){const i=this.createNode(e,null,n),r=this.createNode(t,null,n);return new q(i,r)}delete(e){return ae(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ae(e)?this.contents==null?!1:(this.contents=null,!0):ae(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return L(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ae(e)?!t&&A(this.contents)?this.contents.value:this.contents:L(this.contents)?this.contents.getIn(e,t):void 0}has(e){return L(this.contents)?this.contents.has(e):!1}hasIn(e){return Ae(e)?this.contents!==void 0:L(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ye(this.schema,[e],t):ae(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ae(e)?this.contents=t:this.contents==null?this.contents=Ye(this.schema,Array.from(e),t):ae(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new B({version:"1.1"}),n={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new B({version:e}),n={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new rt(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=U(this.contents,t!=null?t:"",a);if(typeof r=="function")for(const{count:c,res:h}of a.anchors.values())r(h,c);return typeof o=="function"?ue(o,{"":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 new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Wn(this,e)}}function ae(s){if(L(s))return!0;throw new Error("Expected a YAML collection as document contents")}class Pt extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}}class ne extends Pt{constructor(e,t,n){super("YAMLParseError",e,t,n)}}class qs extends Pt{constructor(e,t,n){super("YAMLWarning",e,t,n)}}const Qe=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));const{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let r=i-1,o=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const a=Math.min(r-39,o.length-79);o="…"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),n>1&&/^ *$/.test(o.substring(0,r))){let a=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`…
117
- `),o=a+o}if(/[^ ]/.test(o)){let a=1;const l=t.linePos[1];l&&l.line===n&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-r)));const c=" ".repeat(r)+"^".repeat(a);t.message+=`:
57
+ `}class Ne{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,F,{value:gt});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:o}=r;n!=null&&n._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new j({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){const e=Object.create(Ne.prototype,{[F]:{value:gt}});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=M(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){oe(this.contents)&&this.contents.add(e)}addIn(e,t){oe(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const n=rs(this);e.anchor=!t||n.has(t)?os(t||"a",n):t}return new Ge(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){const g=S=>typeof S=="number"||S instanceof String||S instanceof Number,b=t.filter(g).map(String);b.length>0&&(t=t.concat(b)),i=t}else n===void 0&&t&&(n=t,t=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:l,keepUndefined:a,onTagObj:c,tag:h}=n!=null?n:{},{onAnchor:f,setAnchors:p,sourceObjects:m}=xs(this,o||"a"),y={aliasDuplicateObjects:r!=null?r:!0,keepUndefined:a!=null?a:!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:m},u=Ae(e,h,y);return l&&$(u)&&(u.flow=!0),p(),u}createPair(e,t,n={}){const i=this.createNode(e,null,n),r=this.createNode(t,null,n);return new P(i,r)}delete(e){return oe(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ee(e)?this.contents==null?!1:(this.contents=null,!0):oe(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return $(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ee(e)?!t&&I(this.contents)?this.contents.value:this.contents:$(this.contents)?this.contents.getIn(e,t):void 0}has(e){return $(this.contents)?this.contents.has(e):!1}hasIn(e){return Ee(e)?this.contents!==void 0:$(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ue(this.schema,[e],t):oe(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ee(e)?this.contents=t:this.contents==null?this.contents=Ue(this.schema,Array.from(e),t):oe(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new j({version:"1.1"}),n={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new j({version:e}),n={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new st(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){const l={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=K(this.contents,t!=null?t:"",l);if(typeof r=="function")for(const{count:c,res:h}of l.anchors.values())r(h,c);return typeof o=="function"?fe(o,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return En(this,e)}}function oe(s){if($(s))return!0;throw new Error("Expected a YAML collection as document contents")}class Bt extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}}class se extends Bt{constructor(e,t,n){super("YAMLParseError",e,t,n)}}class $s extends Bt{constructor(e,t,n){super("YAMLWarning",e,t,n)}}const Je=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(l=>e.linePos(l));const{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let r=i-1,o=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const l=Math.min(r-39,o.length-79);o="…"+o.substring(l),r-=l-1}if(o.length>80&&(o=o.substring(0,79)+"…"),n>1&&/^ *$/.test(o.substring(0,r))){let l=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);l.length>80&&(l=l.substring(0,79)+`…
58
+ `),o=l+o}if(/[^ ]/.test(o)){let l=1;const a=t.linePos[1];a&&a.line===n&&a.col>i&&(l=Math.max(1,Math.min(a.col-i,80-r)));const c=" ".repeat(r)+"^".repeat(l);t.message+=`:
118
59
 
119
60
  ${o}
120
61
  ${c}
121
- `}};function ye(s,{flow:e,indicator:t,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,h=a,f="",p="",m=!1,y=!1,u=null,g=null,b=null,S=null,E=null,k=null,T=null;for(const w of s)switch(y&&(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma"&&r(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),u&&(c&&w.type!=="comment"&&w.type!=="newline"&&r(u,"TAB_AS_INDENT","Tabs are not allowed as indentation"),u=null),w.type){case"space":!e&&(t!=="doc-start"||(n==null?void 0:n.type)!=="flow-collection")&&w.source.includes(" ")&&(u=w),h=!0;break;case"comment":{h||r(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const $=w.source.substring(1)||" ";f?f+=p+$:f=$,p="",c=!1;break}case"newline":c?f?f+=w.source:l=!0:p+=w.source,c=!0,m=!0,(g||b)&&(S=w),h=!0;break;case"anchor":g&&r(w,"MULTIPLE_ANCHORS","A node can have at most one anchor"),w.source.endsWith(":")&&r(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=w,T===null&&(T=w.offset),c=!1,h=!1,y=!0;break;case"tag":{b&&r(w,"MULTIPLE_TAGS","A node can have at most one tag"),b=w,T===null&&(T=w.offset),c=!1,h=!1,y=!0;break}case t:(g||b)&&r(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`),k&&r(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${e!=null?e:"collection"}`),k=w,c=t==="seq-item-ind"||t==="explicit-key-ind",h=!1;break;case"comma":if(e){E&&r(w,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),E=w,c=!1,h=!1;break}default:r(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),c=!1,h=!1}const N=s[s.length-1],C=N?N.offset+N.source.length:i;return y&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),u&&(c&&u.indent<=o||(n==null?void 0:n.type)==="block-map"||(n==null?void 0:n.type)==="block-seq")&&r(u,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:E,found:k,spaceBefore:l,comment:f,hasNewline:m,anchor:g,tag:b,newlineAfterProp:S,end:C,start:T!=null?T:C}}function _e(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
122
- `))return!0;if(s.end){for(const e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of s.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(_e(e.key)||_e(e.value))return!0}return!1;default:return!0}}function Et(s,e,t){if((e==null?void 0:e.type)==="flow-collection"){const n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&_e(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Bs(s,e,t){const{uniqueKeys:n}=s.options;if(n===!1)return!1;const i=typeof n=="function"?n:(r,o)=>r===o||A(r)&&A(o)&&r.value===o.value&&!(r.value==="<<"&&s.schema.merge);return e.some(r=>i(r.key,t))}const xt="All mapping items must start at the same column";function Qn({composeNode:s,composeEmptyNode:e},t,n,i,r){var h,f;const o=(h=r==null?void 0:r.nodeClass)!=null?h:R,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=n.offset,c=null;for(const p of n.items){const{start:m,key:y,sep:u,value:g}=p,b=ye(m,{indicator:"explicit-key-ind",next:y!=null?y:u==null?void 0:u[0],offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0}),S=!b.found;if(S){if(y&&(y.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==n.indent&&i(l,"BAD_INDENT",xt)),!b.anchor&&!b.tag&&!u){c=b.end,b.comment&&(a.comment?a.comment+=`
123
- `+b.comment:a.comment=b.comment);continue}(b.newlineAfterProp||_e(y))&&i(y!=null?y:m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((f=b.found)==null?void 0:f.indent)!==n.indent&&i(l,"BAD_INDENT",xt);const E=b.end,k=y?s(t,y,b,i):e(t,E,m,null,b,i);t.schema.compat&&Et(n.indent,y,i),Bs(t,a.items,k)&&i(E,"DUPLICATE_KEY","Map keys must be unique");const T=ye(u!=null?u:[],{indicator:"map-value-ind",next:g,offset:k.range[2],onError:i,parentIndent:n.indent,startOnNewline:!y||y.type==="block-scalar"});if(l=T.end,T.found){S&&((g==null?void 0:g.type)==="block-map"&&!T.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&b.start<T.found.offset-1024&&i(k.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const N=g?s(t,g,T,i):e(t,l,u,null,T,i);t.schema.compat&&Et(n.indent,g,i),l=N.range[2];const C=new q(k,N);t.options.keepSourceTokens&&(C.srcToken=p),a.items.push(C)}else{S&&i(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),T.comment&&(k.comment?k.comment+=`
124
- `+T.comment:k.comment=T.comment);const N=new q(k);t.options.keepSourceTokens&&(N.srcToken=p),a.items.push(N)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,l,c!=null?c:l],a}function Gn({composeNode:s,composeEmptyNode:e},t,n,i,r){var h;const o=(h=r==null?void 0:r.nodeClass)!=null?h:x,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=n.offset,c=null;for(const{start:f,value:p}of n.items){const m=ye(f,{indicator:"seq-item-ind",next:p,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!m.found)if(m.anchor||m.tag||p)p&&p.type==="block-seq"?i(m.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=m.end,m.comment&&(a.comment=m.comment);continue}const y=p?s(t,p,m,i):e(t,m.end,f,null,m,i);t.schema.compat&&Et(n.indent,p,i),l=y.range[2],a.items.push(y)}return a.range=[n.offset,l,c!=null?c:l],a}function je(s,e,t,n){let i="";if(s){let r=!1,o="";for(const a of s){const{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const h=l.substring(1)||" ";i?i+=o+h:i=h,o="";break}case"newline":i&&(o+=l),r=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}const pt="Block collections are not allowed within flow collections",mt=s=>s&&(s.type==="block-map"||s.type==="block-seq");function Hn({composeNode:s,composeEmptyNode:e},t,n,i,r){var g,b;const o=n.start.source==="{",a=o?"flow map":"flow sequence",l=(g=r==null?void 0:r.nodeClass)!=null?g:o?R:x,c=new l(t.schema);c.flow=!0;const h=t.atRoot;h&&(t.atRoot=!1);let f=n.offset+n.start.source.length;for(let S=0;S<n.items.length;++S){const E=n.items[S],{start:k,key:T,sep:N,value:C}=E,w=ye(k,{flow:a,indicator:"explicit-key-ind",next:T!=null?T:N==null?void 0:N[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!w.found){if(!w.anchor&&!w.tag&&!N&&!C){S===0&&w.comma?i(w.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):S<n.items.length-1&&i(w.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),w.comment&&(c.comment?c.comment+=`
125
- `+w.comment:c.comment=w.comment),f=w.end;continue}!o&&t.options.strict&&_e(T)&&i(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(S===0)w.comma&&i(w.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(w.comma||i(w.start,"MISSING_CHAR",`Missing , between ${a} items`),w.comment){let $="";e:for(const _ of k)switch(_.type){case"comma":case"space":break;case"comment":$=_.source.substring(1);break e;default:break e}if($){let _=c.items[c.items.length-1];I(_)&&(_=(b=_.value)!=null?b:_.key),_.comment?_.comment+=`
126
- `+$:_.comment=$,w.comment=w.comment.substring($.length+1)}}if(!o&&!N&&!w.found){const $=C?s(t,C,w,i):e(t,w.end,N,null,w,i);c.items.push($),f=$.range[2],mt(C)&&i($.range,"BLOCK_IN_FLOW",pt)}else{const $=w.end,_=T?s(t,T,w,i):e(t,$,k,null,w,i);mt(T)&&i(_.range,"BLOCK_IN_FLOW",pt);const j=ye(N!=null?N:[],{flow:a,indicator:"map-value-ind",next:C,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(j.found){if(!o&&!w.found&&t.options.strict){if(N)for(const D of N){if(D===j.found)break;if(D.type==="newline"){i(D,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}w.start<j.found.offset-1024&&i(j.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&C.source&&C.source[0]===":"?i(C,"MISSING_CHAR",`Missing space after : in ${a}`):i(j.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const Z=C?s(t,C,j,i):j.found?e(t,j.end,N,null,j,i):null;Z?mt(C)&&i(Z.range,"BLOCK_IN_FLOW",pt):j.comment&&(_.comment?_.comment+=`
127
- `+j.comment:_.comment=j.comment);const oe=new q(_,Z);if(t.options.keepSourceTokens&&(oe.srcToken=E),o){const D=c;Bs(t,D.items,_)&&i($,"DUPLICATE_KEY","Map keys must be unique"),D.items.push(oe)}else{const D=new R(t.schema);D.flow=!0,D.items.push(oe),c.items.push(D)}f=Z?Z.range[2]:j.end}}const p=o?"}":"]",[m,...y]=n.end;let u=f;if(m&&m.source===p)u=m.offset+m.source.length;else{const S=a[0].toUpperCase()+a.substring(1),E=h?`${S} must end with a ${p}`:`${S} in block collection must be sufficiently indented and end with a ${p}`;i(f,h?"MISSING_CHAR":"BAD_INDENT",E),m&&m.source.length!==1&&y.unshift(m)}if(y.length>0){const S=je(y,u,t.options.strict,i);S.comment&&(c.comment?c.comment+=`
128
- `+S.comment:c.comment=S.comment),c.range=[n.offset,u,S.offset]}else c.range=[n.offset,u,u];return c}function yt(s,e,t,n,i,r){const o=t.type==="block-map"?Qn(s,e,t,n,r):t.type==="block-seq"?Gn(s,e,t,n,r):Hn(s,e,t,n,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function zn(s,e,t,n,i){var p,m;const r=n.tag,o=r?e.directives.tagName(r.source,y=>i(r,"TAG_RESOLVE_FAILED",y)):null;if(t.type==="block-seq"){const{anchor:y,newlineAfterProp:u}=n,g=y&&r?y.offset>r.offset?y:r:y!=null?y:r;g&&(!u||u.offset<g.offset)&&i(g,"MISSING_CHAR","Missing newline after block sequence props")}const a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===R.tagName&&a==="map"||o===x.tagName&&a==="seq")return yt(s,e,t,i,o);let l=e.schema.tags.find(y=>y.tag===o&&y.collection===a);if(!l){const y=e.schema.knownTags[o];if(y&&y.collection===a)e.schema.tags.push(Object.assign({},y,{default:!1})),l=y;else return y!=null&&y.collection?i(r,"BAD_COLLECTION_TYPE",`${y.tag} used for ${a} collection, but expects ${y.collection}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),yt(s,e,t,i,o)}const c=yt(s,e,t,i,o,l),h=(m=(p=l.resolve)==null?void 0:p.call(l,c,y=>i(r,"TAG_RESOLVE_FAILED",y),e.options))!=null?m:c,f=M(h)?h:new O(h);return f.range=c.range,f.tag=o,l!=null&&l.format&&(f.format=l.format),f}function Ps(s,e,t){const n=e.offset,i=Xn(e,s.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};const r=i.mode===">"?O.BLOCK_FOLDED:O.BLOCK_LITERAL,o=e.source?xn(e.source):[];let a=o.length;for(let u=o.length-1;u>=0;--u){const g=o[u][1];if(g===""||g==="\r")a=u;else break}if(a===0){const u=i.chomp==="+"&&o.length>0?`
129
- `.repeat(Math.max(1,o.length-1)):"";let g=n+i.length;return e.source&&(g+=e.source.length),{value:u,type:r,comment:i.comment,range:[n,g,g]}}let l=e.indent+i.indent,c=e.offset+i.length,h=0;for(let u=0;u<a;++u){const[g,b]=o[u];if(b===""||b==="\r")i.indent===0&&g.length>l&&(l=g.length);else{g.length<l&&t(c+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=g.length),h=u,l===0&&!s.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=g.length+b.length+1}for(let u=o.length-1;u>=a;--u)o[u][0].length>l&&(a=u+1);let f="",p="",m=!1;for(let u=0;u<h;++u)f+=o[u][0].slice(l)+`
130
- `;for(let u=h;u<a;++u){let[g,b]=o[u];c+=g.length+b.length+1;const S=b[b.length-1]==="\r";if(S&&(b=b.slice(0,-1)),b&&g.length<l){const k=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-b.length-(S?2:1),"BAD_INDENT",k),g=""}r===O.BLOCK_LITERAL?(f+=p+g.slice(l)+b,p=`
131
- `):g.length>l||b[0]===" "?(p===" "?p=`
62
+ `}};function me(s,{flow:e,indicator:t,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:l}){let a=!1,c=l,h=l,f="",p="",m=!1,y=!1,u=null,g=null,b=null,S=null,E=null,k=null,O=null;for(const w of s)switch(y&&(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma"&&r(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),u&&(c&&w.type!=="comment"&&w.type!=="newline"&&r(u,"TAB_AS_INDENT","Tabs are not allowed as indentation"),u=null),w.type){case"space":!e&&(t!=="doc-start"||(n==null?void 0:n.type)!=="flow-collection")&&w.source.includes(" ")&&(u=w),h=!0;break;case"comment":{h||r(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const L=w.source.substring(1)||" ";f?f+=p+L:f=L,p="",c=!1;break}case"newline":c?f?f+=w.source:a=!0:p+=w.source,c=!0,m=!0,(g||b)&&(S=w),h=!0;break;case"anchor":g&&r(w,"MULTIPLE_ANCHORS","A node can have at most one anchor"),w.source.endsWith(":")&&r(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=w,O===null&&(O=w.offset),c=!1,h=!1,y=!0;break;case"tag":{b&&r(w,"MULTIPLE_TAGS","A node can have at most one tag"),b=w,O===null&&(O=w.offset),c=!1,h=!1,y=!0;break}case t:(g||b)&&r(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`),k&&r(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${e!=null?e:"collection"}`),k=w,c=t==="seq-item-ind"||t==="explicit-key-ind",h=!1;break;case"comma":if(e){E&&r(w,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),E=w,c=!1,h=!1;break}default:r(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),c=!1,h=!1}const T=s[s.length-1],_=T?T.offset+T.source.length:i;return y&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),u&&(c&&u.indent<=o||(n==null?void 0:n.type)==="block-map"||(n==null?void 0:n.type)==="block-seq")&&r(u,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:E,found:k,spaceBefore:a,comment:f,hasNewline:m,anchor:g,tag:b,newlineAfterProp:S,end:_,start:O!=null?O:_}}function Le(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
63
+ `))return!0;if(s.end){for(const e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of s.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(Le(e.key)||Le(e.value))return!0}return!1;default:return!0}}function kt(s,e,t){if((e==null?void 0:e.type)==="flow-collection"){const n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&Le(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function _s(s,e,t){const{uniqueKeys:n}=s.options;if(n===!1)return!1;const i=typeof n=="function"?n:(r,o)=>r===o||I(r)&&I(o)&&r.value===o.value&&!(r.value==="<<"&&s.schema.merge);return e.some(r=>i(r.key,t))}const Gt="All mapping items must start at the same column";function In({composeNode:s,composeEmptyNode:e},t,n,i,r){var h,f;const o=(h=r==null?void 0:r.nodeClass)!=null?h:D,l=new o(t.schema);t.atRoot&&(t.atRoot=!1);let a=n.offset,c=null;for(const p of n.items){const{start:m,key:y,sep:u,value:g}=p,b=me(m,{indicator:"explicit-key-ind",next:y!=null?y:u==null?void 0:u[0],offset:a,onError:i,parentIndent:n.indent,startOnNewline:!0}),S=!b.found;if(S){if(y&&(y.type==="block-seq"?i(a,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==n.indent&&i(a,"BAD_INDENT",Gt)),!b.anchor&&!b.tag&&!u){c=b.end,b.comment&&(l.comment?l.comment+=`
64
+ `+b.comment:l.comment=b.comment);continue}(b.newlineAfterProp||Le(y))&&i(y!=null?y:m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((f=b.found)==null?void 0:f.indent)!==n.indent&&i(a,"BAD_INDENT",Gt);const E=b.end,k=y?s(t,y,b,i):e(t,E,m,null,b,i);t.schema.compat&&kt(n.indent,y,i),_s(t,l.items,k)&&i(E,"DUPLICATE_KEY","Map keys must be unique");const O=me(u!=null?u:[],{indicator:"map-value-ind",next:g,offset:k.range[2],onError:i,parentIndent:n.indent,startOnNewline:!y||y.type==="block-scalar"});if(a=O.end,O.found){S&&((g==null?void 0:g.type)==="block-map"&&!O.hasNewline&&i(a,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&b.start<O.found.offset-1024&&i(k.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const T=g?s(t,g,O,i):e(t,a,u,null,O,i);t.schema.compat&&kt(n.indent,g,i),a=T.range[2];const _=new P(k,T);t.options.keepSourceTokens&&(_.srcToken=p),l.items.push(_)}else{S&&i(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),O.comment&&(k.comment?k.comment+=`
65
+ `+O.comment:k.comment=O.comment);const T=new P(k);t.options.keepSourceTokens&&(T.srcToken=p),l.items.push(T)}}return c&&c<a&&i(c,"IMPOSSIBLE","Map comment with trailing content"),l.range=[n.offset,a,c!=null?c:a],l}function An({composeNode:s,composeEmptyNode:e},t,n,i,r){var h;const o=(h=r==null?void 0:r.nodeClass)!=null?h:z,l=new o(t.schema);t.atRoot&&(t.atRoot=!1);let a=n.offset,c=null;for(const{start:f,value:p}of n.items){const m=me(f,{indicator:"seq-item-ind",next:p,offset:a,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!m.found)if(m.anchor||m.tag||p)p&&p.type==="block-seq"?i(m.end,"BAD_INDENT","All sequence items must start at the same column"):i(a,"MISSING_CHAR","Sequence item without - indicator");else{c=m.end,m.comment&&(l.comment=m.comment);continue}const y=p?s(t,p,m,i):e(t,m.end,f,null,m,i);t.schema.compat&&kt(n.indent,p,i),a=y.range[2],l.items.push(y)}return l.range=[n.offset,a,c!=null?c:a],l}function Me(s,e,t,n){let i="";if(s){let r=!1,o="";for(const l of s){const{source:a,type:c}=l;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const h=a.substring(1)||" ";i?i+=o+h:i=h,o="";break}case"newline":i&&(o+=a),r=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=a.length}}return{comment:i,offset:e}}const ht="Block collections are not allowed within flow collections",dt=s=>s&&(s.type==="block-map"||s.type==="block-seq");function Ln({composeNode:s,composeEmptyNode:e},t,n,i,r){var g,b;const o=n.start.source==="{",l=o?"flow map":"flow sequence",a=(g=r==null?void 0:r.nodeClass)!=null?g:o?D:z,c=new a(t.schema);c.flow=!0;const h=t.atRoot;h&&(t.atRoot=!1);let f=n.offset+n.start.source.length;for(let S=0;S<n.items.length;++S){const E=n.items[S],{start:k,key:O,sep:T,value:_}=E,w=me(k,{flow:l,indicator:"explicit-key-ind",next:O!=null?O:T==null?void 0:T[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!w.found){if(!w.anchor&&!w.tag&&!T&&!_){S===0&&w.comma?i(w.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):S<n.items.length-1&&i(w.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),w.comment&&(c.comment?c.comment+=`
66
+ `+w.comment:c.comment=w.comment),f=w.end;continue}!o&&t.options.strict&&Le(O)&&i(O,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(S===0)w.comma&&i(w.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(w.comma||i(w.start,"MISSING_CHAR",`Missing , between ${l} items`),w.comment){let L="";e:for(const C of k)switch(C.type){case"comma":case"space":break;case"comment":L=C.source.substring(1);break e;default:break e}if(L){let C=c.items[c.items.length-1];A(C)&&(C=(b=C.value)!=null?b:C.key),C.comment?C.comment+=`
67
+ `+L:C.comment=L,w.comment=w.comment.substring(L.length+1)}}if(!o&&!T&&!w.found){const L=_?s(t,_,w,i):e(t,w.end,T,null,w,i);c.items.push(L),f=L.range[2],dt(_)&&i(L.range,"BLOCK_IN_FLOW",ht)}else{const L=w.end,C=O?s(t,O,w,i):e(t,L,k,null,w,i);dt(O)&&i(C.range,"BLOCK_IN_FLOW",ht);const B=me(T!=null?T:[],{flow:l,indicator:"map-value-ind",next:_,offset:C.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(B.found){if(!o&&!w.found&&t.options.strict){if(T)for(const v of T){if(v===B.found)break;if(v.type==="newline"){i(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}w.start<B.found.offset-1024&&i(B.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else _&&("source"in _&&_.source&&_.source[0]===":"?i(_,"MISSING_CHAR",`Missing space after : in ${l}`):i(B.start,"MISSING_CHAR",`Missing , or : between ${l} items`));const x=_?s(t,_,B,i):B.found?e(t,B.end,T,null,B,i):null;x?dt(_)&&i(x.range,"BLOCK_IN_FLOW",ht):B.comment&&(C.comment?C.comment+=`
68
+ `+B.comment:C.comment=B.comment);const re=new P(C,x);if(t.options.keepSourceTokens&&(re.srcToken=E),o){const v=c;_s(t,v.items,C)&&i(L,"DUPLICATE_KEY","Map keys must be unique"),v.items.push(re)}else{const v=new D(t.schema);v.flow=!0,v.items.push(re),c.items.push(v)}f=x?x.range[2]:B.end}}const p=o?"}":"]",[m,...y]=n.end;let u=f;if(m&&m.source===p)u=m.offset+m.source.length;else{const S=l[0].toUpperCase()+l.substring(1),E=h?`${S} must end with a ${p}`:`${S} in block collection must be sufficiently indented and end with a ${p}`;i(f,h?"MISSING_CHAR":"BAD_INDENT",E),m&&m.source.length!==1&&y.unshift(m)}if(y.length>0){const S=Me(y,u,t.options.strict,i);S.comment&&(c.comment?c.comment+=`
69
+ `+S.comment:c.comment=S.comment),c.range=[n.offset,u,S.offset]}else c.range=[n.offset,u,u];return c}function pt(s,e,t,n,i,r){const o=t.type==="block-map"?In(s,e,t,n,r):t.type==="block-seq"?An(s,e,t,n,r):Ln(s,e,t,n,r),l=o.constructor;return i==="!"||i===l.tagName?(o.tag=l.tagName,o):(i&&(o.tag=i),o)}function $n(s,e,t,n,i){var p,m;const r=n.tag,o=r?e.directives.tagName(r.source,y=>i(r,"TAG_RESOLVE_FAILED",y)):null;if(t.type==="block-seq"){const{anchor:y,newlineAfterProp:u}=n,g=y&&r?y.offset>r.offset?y:r:y!=null?y:r;g&&(!u||u.offset<g.offset)&&i(g,"MISSING_CHAR","Missing newline after block sequence props")}const l=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===D.tagName&&l==="map"||o===z.tagName&&l==="seq")return pt(s,e,t,i,o);let a=e.schema.tags.find(y=>y.tag===o&&y.collection===l);if(!a){const y=e.schema.knownTags[o];if(y&&y.collection===l)e.schema.tags.push(Object.assign({},y,{default:!1})),a=y;else return y!=null&&y.collection?i(r,"BAD_COLLECTION_TYPE",`${y.tag} used for ${l} collection, but expects ${y.collection}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),pt(s,e,t,i,o)}const c=pt(s,e,t,i,o,a),h=(m=(p=a.resolve)==null?void 0:p.call(a,c,y=>i(r,"TAG_RESOLVE_FAILED",y),e.options))!=null?m:c,f=M(h)?h:new N(h);return f.range=c.range,f.tag=o,a!=null&&a.format&&(f.format=a.format),f}function Cs(s,e,t){const n=e.offset,i=_n(e,s.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};const r=i.mode===">"?N.BLOCK_FOLDED:N.BLOCK_LITERAL,o=e.source?Cn(e.source):[];let l=o.length;for(let u=o.length-1;u>=0;--u){const g=o[u][1];if(g===""||g==="\r")l=u;else break}if(l===0){const u=i.chomp==="+"&&o.length>0?`
70
+ `.repeat(Math.max(1,o.length-1)):"";let g=n+i.length;return e.source&&(g+=e.source.length),{value:u,type:r,comment:i.comment,range:[n,g,g]}}let a=e.indent+i.indent,c=e.offset+i.length,h=0;for(let u=0;u<l;++u){const[g,b]=o[u];if(b===""||b==="\r")i.indent===0&&g.length>a&&(a=g.length);else{g.length<a&&t(c+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(a=g.length),h=u,a===0&&!s.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=g.length+b.length+1}for(let u=o.length-1;u>=l;--u)o[u][0].length>a&&(l=u+1);let f="",p="",m=!1;for(let u=0;u<h;++u)f+=o[u][0].slice(a)+`
71
+ `;for(let u=h;u<l;++u){let[g,b]=o[u];c+=g.length+b.length+1;const S=b[b.length-1]==="\r";if(S&&(b=b.slice(0,-1)),b&&g.length<a){const k=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-b.length-(S?2:1),"BAD_INDENT",k),g=""}r===N.BLOCK_LITERAL?(f+=p+g.slice(a)+b,p=`
72
+ `):g.length>a||b[0]===" "?(p===" "?p=`
132
73
  `:!m&&p===`
133
74
  `&&(p=`
134
75
 
135
- `),f+=p+g.slice(l)+b,p=`
76
+ `),f+=p+g.slice(a)+b,p=`
136
77
  `,m=!0):b===""?p===`
137
78
  `?f+=`
138
79
  `:p=`
139
- `:(f+=p+b,p=" ",m=!1)}switch(i.chomp){case"-":break;case"+":for(let u=a;u<o.length;++u)f+=`
140
- `+o[u][0].slice(l);f[f.length-1]!==`
80
+ `:(f+=p+b,p=" ",m=!1)}switch(i.chomp){case"-":break;case"+":for(let u=l;u<o.length;++u)f+=`
81
+ `+o[u][0].slice(a);f[f.length-1]!==`
141
82
  `&&(f+=`
142
83
  `);break;default:f+=`
143
- `}const y=n+i.length+e.source.length;return{value:f,type:r,comment:i.comment,range:[n,y,y]}}function Xn({offset:s,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=e[0],r=i[0];let o=0,a="",l=-1;for(let p=1;p<i.length;++p){const m=i[p];if(!a&&(m==="-"||m==="+"))a=m;else{const y=Number(m);!o&&y?o=y:l===-1&&(l=s+p)}}l!==-1&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,h="",f=i.length;for(let p=1;p<e.length;++p){const m=e[p];switch(m.type){case"space":c=!0;case"newline":f+=m.source.length;break;case"comment":t&&!c&&n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=m.source.length,h=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),f+=m.source.length;break;default:{const y=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",y);const u=m.source;u&&typeof u=="string"&&(f+=u.length)}}}return{mode:r,indent:o,chomp:a,comment:h,length:f}}function xn(s){const e=s.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),r=[n!=null&&n[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}function Ks(s,e,t){const{offset:n,type:i,source:r,end:o}=s;let a,l;const c=(p,m,y)=>t(n+p,m,y);switch(i){case"scalar":a=O.PLAIN,l=Zn(r,c);break;case"single-quoted-scalar":a=O.QUOTE_SINGLE,l=ei(r,c);break;case"double-quoted-scalar":a=O.QUOTE_DOUBLE,l=ti(r,c);break;default:return t(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}const h=n+r.length,f=je(o,h,e,t);return{value:l,type:a,comment:f.comment,range:[n,h,f.offset]}}function Zn(s,e){let t="";switch(s[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${s[0]}`;break}case"@":case"`":{t=`reserved character ${s[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),Fs(s)}function ei(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),Fs(s.slice(1,-1)).replace(/''/g,"'")}function Fs(s){var l;let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
84
+ `}const y=n+i.length+e.source.length;return{value:f,type:r,comment:i.comment,range:[n,y,y]}}function _n({offset:s,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=e[0],r=i[0];let o=0,l="",a=-1;for(let p=1;p<i.length;++p){const m=i[p];if(!l&&(m==="-"||m==="+"))l=m;else{const y=Number(m);!o&&y?o=y:a===-1&&(a=s+p)}}a!==-1&&n(a,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,h="",f=i.length;for(let p=1;p<e.length;++p){const m=e[p];switch(m.type){case"space":c=!0;case"newline":f+=m.source.length;break;case"comment":t&&!c&&n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=m.source.length,h=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),f+=m.source.length;break;default:{const y=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",y);const u=m.source;u&&typeof u=="string"&&(f+=u.length)}}}return{mode:r,indent:o,chomp:l,comment:h,length:f}}function Cn(s){const e=s.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),r=[n!=null&&n[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}function Ms(s,e,t){const{offset:n,type:i,source:r,end:o}=s;let l,a;const c=(p,m,y)=>t(n+p,m,y);switch(i){case"scalar":l=N.PLAIN,a=Mn(r,c);break;case"single-quoted-scalar":l=N.QUOTE_SINGLE,a=vn(r,c);break;case"double-quoted-scalar":l=N.QUOTE_DOUBLE,a=Bn(r,c);break;default:return t(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}const h=n+r.length,f=Me(o,h,e,t);return{value:a,type:l,comment:f.comment,range:[n,h,f.offset]}}function Mn(s,e){let t="";switch(s[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${s[0]}`;break}case"@":case"`":{t=`reserved character ${s[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),vs(s)}function vn(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),vs(s.slice(1,-1)).replace(/''/g,"'")}function vs(s){var a;let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
144
85
  `,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
145
86
  `,"sy")}catch(c){e=new RegExp("(.*?)[ \\t]*\\r?\\n","sy"),t=new RegExp("[ \\t]*(.*?)[ \\t]*\\r?\\n","sy")}let n=e.exec(s);if(!n)return s;let i=n[1],r=" ",o=e.lastIndex;for(t.lastIndex=o;n=t.exec(s);)n[1]===""?r===`
146
87
  `?i+=r:r=`
147
- `:(i+=r+n[1],r=" "),o=t.lastIndex;const a=new RegExp("[ \\t]*(.*)","sy");return a.lastIndex=o,n=a.exec(s),i+r+((l=n==null?void 0:n[1])!=null?l:"")}function ti(s,e){let t="";for(let n=1;n<s.length-1;++n){const i=s[n];if(!(i==="\r"&&s[n+1]===`
88
+ `:(i+=r+n[1],r=" "),o=t.lastIndex;const l=new RegExp("[ \\t]*(.*)","sy");return l.lastIndex=o,n=l.exec(s),i+r+((a=n==null?void 0:n[1])!=null?a:"")}function Bn(s,e){let t="";for(let n=1;n<s.length-1;++n){const i=s[n];if(!(i==="\r"&&s[n+1]===`
148
89
  `))if(i===`
149
- `){const{fold:r,offset:o}=si(s,n);t+=r,n=o}else if(i==="\\"){let r=s[++n];const o=ni[r];if(o)t+=o;else if(r===`
90
+ `){const{fold:r,offset:o}=Pn(s,n);t+=r,n=o}else if(i==="\\"){let r=s[++n];const o=jn[r];if(o)t+=o;else if(r===`
150
91
  `)for(r=s[n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="\r"&&s[n+1]===`
151
- `)for(r=s[++n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="x"||r==="u"||r==="U"){const a={x:2,u:4,U:8}[r];t+=ii(s,n+1,a,e),n+=a}else{const a=s.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(i===" "||i===" "){const r=n;let o=s[n+1];for(;o===" "||o===" ";)o=s[++n+1];o!==`
92
+ `)for(r=s[++n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="x"||r==="u"||r==="U"){const l={x:2,u:4,U:8}[r];t+=qn(s,n+1,l,e),n+=l}else{const l=s.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),t+=l}}else if(i===" "||i===" "){const r=n;let o=s[n+1];for(;o===" "||o===" ";)o=s[++n+1];o!==`
152
93
  `&&!(o==="\r"&&s[n+2]===`
153
- `)&&(t+=n>r?s.slice(r,n+1):i)}else t+=i}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}function si(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===`
94
+ `)&&(t+=n>r?s.slice(r,n+1):i)}else t+=i}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}function Pn(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===`
154
95
  `||n==="\r")&&!(n==="\r"&&s[e+2]!==`
155
96
  `);)n===`
156
97
  `&&(t+=`
157
- `),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}const ni={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
158
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function ii(s,e,t,n){const i=s.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const a=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}function Rs(s,e,t,n){const{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?Ps(s,e,n):Ks(e,s.options.strict,n),l=t?s.directives.tagName(t.source,f=>n(t,"TAG_RESOLVE_FAILED",f)):null,c=t&&l?ri(s.schema,i,l,t,n):e.type==="scalar"?oi(s,i,e,n):s.schema[G];let h;try{const f=c.resolve(i,p=>n(t!=null?t:e,"TAG_RESOLVE_FAILED",p),s.options);h=A(f)?f:new O(f)}catch(f){const p=f instanceof Error?f.message:String(f);n(t!=null?t:e,"TAG_RESOLVE_FAILED",p),h=new O(i)}return h.range=a,h.source=i,r&&(h.type=r),l&&(h.tag=l),c.format&&(h.format=c.format),o&&(h.comment=o),h}function ri(s,e,t,n,i){var a;if(t==="!")return s[G];const r=[];for(const l of s.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)r.push(l);else return l;for(const l of r)if((a=l.test)!=null&&a.test(e))return l;const o=s.knownTags[t];return o&&!o.collection?(s.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[G])}function oi({directives:s,schema:e},t,n,i){var o;const r=e.tags.find(a=>{var l;return a.default&&((l=a.test)==null?void 0:l.test(t))})||e[G];if(e.compat){const a=(o=e.compat.find(l=>{var c;return l.default&&((c=l.test)==null?void 0:c.test(t))}))!=null?o:e[G];if(r.tag!==a.tag){const l=s.tagString(r.tag),c=s.tagString(a.tag),h=`Value may be parsed as either ${l} or ${c}`;i(n,"TAG_RESOLVE_FAILED",h,!0)}}return r}function ai(s,e,t){if(e){t===null&&(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}for(i=e[++n];(i==null?void 0:i.type)==="space";)s+=i.source.length,i=e[++n];break}}return s}const li={composeNode:Us,composeEmptyNode:Kt};function Us(s,e,t,n){const{spaceBefore:i,comment:r,anchor:o,tag:a}=t;let l,c=!0;switch(e.type){case"alias":l=ci(s,e,n),(o||a)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Rs(s,e,a,n),o&&(l.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=zn(li,s,e,t,n),o&&(l.anchor=o.source.substring(1));break;default:{const h=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",h),l=Kt(s,e.offset,void 0,null,t,n),c=!1}}return o&&l.anchor===""&&n(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&(l.spaceBefore=!0),r&&(e.type==="scalar"&&e.source===""?l.comment=r:l.commentBefore=r),s.options.keepSourceTokens&&c&&(l.srcToken=e),l}function Kt(s,e,t,n,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){const h={type:"scalar",offset:ai(e,t,n),indent:-1,source:""},f=Rs(s,h,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=l),f}function ci({options:s},{offset:e,source:t,end:n},i){const r=new ze(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=e+t.length,a=je(n,o,s.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}function fi(s,e,{offset:t,start:n,value:i,end:r},o){const a=Object.assign({_directives:e},s),l=new Te(void 0,a),c={atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},h=ye(n,{indicator:"doc-start",next:i!=null?i:r==null?void 0:r[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});h.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!h.hasNewline&&o(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?Us(c,i,h,o):Kt(c,h.end,n,null,h,o);const f=l.contents.range[2],p=je(r,f,!1,o);return p.comment&&(l.comment=p.comment),l.range=[t,f,p.offset],l}function Ne(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];const{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}function Zt(s){var i;let e="",t=!1,n=!1;for(let r=0;r<s.length;++r){const o=s[r];switch(o[0]){case"#":e+=(e===""?"":n?`
98
+ `),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}const jn={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
99
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function qn(s,e,t,n){const i=s.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const l=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}return String.fromCodePoint(o)}function Bs(s,e,t,n){const{value:i,type:r,comment:o,range:l}=e.type==="block-scalar"?Cs(s,e,n):Ms(e,s.options.strict,n),a=t?s.directives.tagName(t.source,f=>n(t,"TAG_RESOLVE_FAILED",f)):null,c=t&&a?Dn(s.schema,i,a,t,n):e.type==="scalar"?Kn(s,i,e,n):s.schema[G];let h;try{const f=c.resolve(i,p=>n(t!=null?t:e,"TAG_RESOLVE_FAILED",p),s.options);h=I(f)?f:new N(f)}catch(f){const p=f instanceof Error?f.message:String(f);n(t!=null?t:e,"TAG_RESOLVE_FAILED",p),h=new N(i)}return h.range=l,h.source=i,r&&(h.type=r),a&&(h.tag=a),c.format&&(h.format=c.format),o&&(h.comment=o),h}function Dn(s,e,t,n,i){var l;if(t==="!")return s[G];const r=[];for(const a of s.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)r.push(a);else return a;for(const a of r)if((l=a.test)!=null&&l.test(e))return a;const o=s.knownTags[t];return o&&!o.collection?(s.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[G])}function Kn({directives:s,schema:e},t,n,i){var o;const r=e.tags.find(l=>{var a;return l.default&&((a=l.test)==null?void 0:a.test(t))})||e[G];if(e.compat){const l=(o=e.compat.find(a=>{var c;return a.default&&((c=a.test)==null?void 0:c.test(t))}))!=null?o:e[G];if(r.tag!==l.tag){const a=s.tagString(r.tag),c=s.tagString(l.tag),h=`Value may be parsed as either ${a} or ${c}`;i(n,"TAG_RESOLVE_FAILED",h,!0)}}return r}function Fn(s,e,t){if(e){t===null&&(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}for(i=e[++n];(i==null?void 0:i.type)==="space";)s+=i.source.length,i=e[++n];break}}return s}const Rn={composeNode:Ps,composeEmptyNode:Pt};function Ps(s,e,t,n){const{spaceBefore:i,comment:r,anchor:o,tag:l}=t;let a,c=!0;switch(e.type){case"alias":a=Un(s,e,n),(o||l)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":a=Bs(s,e,l,n),o&&(a.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":a=$n(Rn,s,e,t,n),o&&(a.anchor=o.source.substring(1));break;default:{const h=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",h),a=Pt(s,e.offset,void 0,null,t,n),c=!1}}return o&&a.anchor===""&&n(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&(a.spaceBefore=!0),r&&(e.type==="scalar"&&e.source===""?a.comment=r:a.commentBefore=r),s.options.keepSourceTokens&&c&&(a.srcToken=e),a}function Pt(s,e,t,n,{spaceBefore:i,comment:r,anchor:o,tag:l,end:a},c){const h={type:"scalar",offset:Fn(e,t,n),indent:-1,source:""},f=Bs(s,h,l,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=a),f}function Un({options:s},{offset:e,source:t,end:n},i){const r=new Ge(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=e+t.length,l=Me(n,o,s.strict,i);return r.range=[e,o,l.offset],l.comment&&(r.comment=l.comment),r}function Vn(s,e,{offset:t,start:n,value:i,end:r},o){const l=Object.assign({_directives:e},s),a=new Ne(void 0,l),c={atRoot:!0,directives:a.directives,options:a.options,schema:a.schema},h=me(n,{indicator:"doc-start",next:i!=null?i:r==null?void 0:r[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});h.found&&(a.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!h.hasNewline&&o(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),a.contents=i?Ps(c,i,h,o):Pt(c,h.end,n,null,h,o);const f=a.contents.range[2],p=Me(r,f,!1,o);return p.comment&&(a.comment=p.comment),a.range=[t,f,p.offset],a}function Te(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];const{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}function Wt(s){var i;let e="",t=!1,n=!1;for(let r=0;r<s.length;++r){const o=s[r];switch(o[0]){case"#":e+=(e===""?"":n?`
159
100
 
160
101
  `:`
161
- `)+(o.substring(1)||" "),t=!0,n=!1;break;case"%":((i=s[r+1])==null?void 0:i[0])!=="#"&&(r+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}class Ft{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,r)=>{const o=Ne(t);r?this.warnings.push(new qs(o,n,i)):this.errors.push(new ne(o,n,i))},this.directives=new B({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:n,afterEmptyLine:i}=Zt(this.prelude);if(n){const r=e.contents;if(t)e.comment=e.comment?`${e.comment}
162
- ${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if(L(r)&&!r.flow&&r.items.length>0){let o=r.items[0];I(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${n}
163
- ${a}`:n}else{const o=r.commentBefore;r.commentBefore=o?`${n}
164
- ${o}`:n}}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:Zt(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(const i of e)yield*d(this.next(i));yield*d(this.end(t,n))}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{const r=Ne(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=fi(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":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new ne(Ne(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const n="Unexpected doc-end without preceding document";this.errors.push(new ne(Ne(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;const t=je(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const n=this.doc.comment;this.doc.comment=n?`${n}
165
- ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new ne(Ne(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){const n=Object.assign({_directives:this.directives},this.options),i=new Te(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}}function ui(s,e=!0,t){if(s){const n=(i,r,o)=>{const a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(a,r,o);else throw new ne([a,a+1],r,o)};switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Ks(s,e,n);case"block-scalar":return Ps({options:{strict:e}},s,n)}}return null}function hi(s,e){var c;const{implicitKey:t=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=ve({type:o,value:s},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=(c=e.end)!=null?c:[{type:"newline",offset:-1,indent:n,source:`
166
- `}];switch(a[0]){case"|":case">":{const h=a.indexOf(`
167
- `),f=a.substring(0,h),p=a.substring(h+1)+`
168
- `,m=[{type:"block-scalar-header",offset:r,indent:n,source:f}];return Vs(m,l)||m.push({type:"newline",offset:-1,indent:n,source:`
169
- `}),{type:"block-scalar",offset:r,indent:n,props:m,source:p}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:n,source:a,end:l};default:return{type:"scalar",offset:r,indent:n,source:a,end:l}}}function di(s,e,t={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=t,a="indent"in s?s.indent:null;if(n&&typeof a=="number"&&(a+=2),!o)switch(s.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const c=s.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const l=ve({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":pi(s,l);break;case'"':gt(s,l,"double-quoted-scalar");break;case"'":gt(s,l,"single-quoted-scalar");break;default:gt(s,l,"scalar")}}function pi(s,e){const t=e.indexOf(`
102
+ `)+(o.substring(1)||" "),t=!0,n=!1;break;case"%":((i=s[r+1])==null?void 0:i[0])!=="#"&&(r+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}class jt{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,r)=>{const o=Te(t);r?this.warnings.push(new $s(o,n,i)):this.errors.push(new se(o,n,i))},this.directives=new j({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:n,afterEmptyLine:i}=Wt(this.prelude);if(n){const r=e.contents;if(t)e.comment=e.comment?`${e.comment}
103
+ ${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if($(r)&&!r.flow&&r.items.length>0){let o=r.items[0];A(o)&&(o=o.key);const l=o.commentBefore;o.commentBefore=l?`${n}
104
+ ${l}`:n}else{const o=r.commentBefore;r.commentBefore=o?`${n}
105
+ ${o}`:n}}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:Wt(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(const i of e)yield*d(this.next(i));yield*d(this.end(t,n))}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{const r=Te(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=Vn(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":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new se(Te(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const n="Unexpected doc-end without preceding document";this.errors.push(new se(Te(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;const t=Me(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const n=this.doc.comment;this.doc.comment=n?`${n}
106
+ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new se(Te(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){const n=Object.assign({_directives:this.directives},this.options),i=new Ne(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}}function Jn(s,e=!0,t){if(s){const n=(i,r,o)=>{const l=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(l,r,o);else throw new se([l,l+1],r,o)};switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Ms(s,e,n);case"block-scalar":return Cs({options:{strict:e}},s,n)}}return null}function Yn(s,e){var c;const{implicitKey:t=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,l=_e({type:o,value:s},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),a=(c=e.end)!=null?c:[{type:"newline",offset:-1,indent:n,source:`
107
+ `}];switch(l[0]){case"|":case">":{const h=l.indexOf(`
108
+ `),f=l.substring(0,h),p=l.substring(h+1)+`
109
+ `,m=[{type:"block-scalar-header",offset:r,indent:n,source:f}];return js(m,a)||m.push({type:"newline",offset:-1,indent:n,source:`
110
+ `}),{type:"block-scalar",offset:r,indent:n,props:m,source:p}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:l,end:a};case"'":return{type:"single-quoted-scalar",offset:r,indent:n,source:l,end:a};default:return{type:"scalar",offset:r,indent:n,source:l,end:a}}}function Qn(s,e,t={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=t,l="indent"in s?s.indent:null;if(n&&typeof l=="number"&&(l+=2),!o)switch(s.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const c=s.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const a=_e({type:o,value:e},{implicitKey:i||l===null,indent:l!==null&&l>0?" ".repeat(l):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(a[0]){case"|":case">":Gn(s,a);break;case'"':mt(s,a,"double-quoted-scalar");break;case"'":mt(s,a,"single-quoted-scalar");break;default:mt(s,a,"scalar")}}function Gn(s,e){const t=e.indexOf(`
170
111
  `),n=e.substring(0,t),i=e.substring(t+1)+`
171
- `;if(s.type==="block-scalar"){const r=s.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=n,s.source=i}else{const{offset:r}=s,o="indent"in s?s.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:n}];Vs(a,"end"in s?s.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
172
- `});for(const l of Object.keys(s))l!=="type"&&l!=="offset"&&delete s[l];Object.assign(s,{type:"block-scalar",indent:o,props:a,source:i})}}function Vs(s,e){if(e)for(const t of e)switch(t.type){case"space":case"comment":s.push(t);break;case"newline":return s.push(t),!0}return!1}function gt(s,e,t){switch(s.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":s.type=t,s.source=e;break;case"block-scalar":{const n=s.props.slice(1);let i=e.length;s.props[0].type==="block-scalar-header"&&(i-=s.props[0].source.length);for(const r of n)r.offset+=i;delete s.props,Object.assign(s,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{const i={type:"newline",offset:s.offset+e.length,indent:s.indent,source:`
173
- `};delete s.items,Object.assign(s,{type:t,source:e,end:[i]});break}default:{const n="indent"in s?s.indent:-1,i="end"in s&&Array.isArray(s.end)?s.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(const r of Object.keys(s))r!=="type"&&r!=="offset"&&delete s[r];Object.assign(s,{type:t,indent:n,source:e,end:i})}}}const mi=s=>"type"in s?Ge(s):Je(s);function Ge(s){switch(s.type){case"block-scalar":{let e="";for(const t of s.props)e+=Ge(t);return e+s.source}case"block-map":case"block-seq":{let e="";for(const t of s.items)e+=Je(t);return e}case"flow-collection":{let e=s.start.source;for(const t of s.items)e+=Je(t);for(const t of s.end)e+=t.source;return e}case"document":{let e=Je(s);if(s.end)for(const t of s.end)e+=t.source;return e}default:{let e=s.source;if("end"in s&&s.end)for(const t of s.end)e+=t.source;return e}}}function Je({start:s,key:e,sep:t,value:n}){let i="";for(const r of s)i+=r.source;if(e&&(i+=Ge(e)),t)for(const r of t)i+=r.source;return n&&(i+=Ge(n)),i}const At=Symbol("break visit"),yi=Symbol("skip children"),Js=Symbol("remove item");function ie(s,e){"type"in s&&s.type==="document"&&(s={start:s.start,value:s.value}),Ys(Object.freeze([]),s,e)}ie.BREAK=At;ie.SKIP=yi;ie.REMOVE=Js;ie.itemAtPath=(s,e)=>{let t=s;for(const[n,i]of e){const r=t==null?void 0:t[n];if(r&&"items"in r)t=r.items[i];else return}return t};ie.parentCollection=(s,e)=>{const t=ie.itemAtPath(s,e.slice(0,-1)),n=e[e.length-1][0],i=t==null?void 0:t[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Ys(s,e,t){let n=t(e,s);if(typeof n=="symbol")return n;for(const i of["key","value"]){const r=e[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){const a=Ys(Object.freeze(s.concat([[i,o]])),r.items[o],t);if(typeof a=="number")o=a-1;else{if(a===At)return At;a===Js&&(r.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,s))}}return typeof n=="function"?n(e,s):n}const ot="\uFEFF",at="",lt="",Me="",gi=s=>!!s&&"items"in s,bi=s=>!!s&&(s.type==="scalar"||s.type==="single-quoted-scalar"||s.type==="double-quoted-scalar"||s.type==="block-scalar");function wi(s){switch(s){case ot:return"<BOM>";case at:return"<DOC>";case lt:return"<FLOW_END>";case Me:return"<SCALAR>";default:return JSON.stringify(s)}}function Ws(s){switch(s){case ot:return"byte-order-mark";case at:return"doc-mode";case lt:return"flow-error-end";case Me:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
112
+ `;if(s.type==="block-scalar"){const r=s.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=n,s.source=i}else{const{offset:r}=s,o="indent"in s?s.indent:-1,l=[{type:"block-scalar-header",offset:r,indent:o,source:n}];js(l,"end"in s?s.end:void 0)||l.push({type:"newline",offset:-1,indent:o,source:`
113
+ `});for(const a of Object.keys(s))a!=="type"&&a!=="offset"&&delete s[a];Object.assign(s,{type:"block-scalar",indent:o,props:l,source:i})}}function js(s,e){if(e)for(const t of e)switch(t.type){case"space":case"comment":s.push(t);break;case"newline":return s.push(t),!0}return!1}function mt(s,e,t){switch(s.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":s.type=t,s.source=e;break;case"block-scalar":{const n=s.props.slice(1);let i=e.length;s.props[0].type==="block-scalar-header"&&(i-=s.props[0].source.length);for(const r of n)r.offset+=i;delete s.props,Object.assign(s,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{const i={type:"newline",offset:s.offset+e.length,indent:s.indent,source:`
114
+ `};delete s.items,Object.assign(s,{type:t,source:e,end:[i]});break}default:{const n="indent"in s?s.indent:-1,i="end"in s&&Array.isArray(s.end)?s.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(const r of Object.keys(s))r!=="type"&&r!=="offset"&&delete s[r];Object.assign(s,{type:t,indent:n,source:e,end:i})}}}const Wn=s=>"type"in s?Ye(s):Re(s);function Ye(s){switch(s.type){case"block-scalar":{let e="";for(const t of s.props)e+=Ye(t);return e+s.source}case"block-map":case"block-seq":{let e="";for(const t of s.items)e+=Re(t);return e}case"flow-collection":{let e=s.start.source;for(const t of s.items)e+=Re(t);for(const t of s.end)e+=t.source;return e}case"document":{let e=Re(s);if(s.end)for(const t of s.end)e+=t.source;return e}default:{let e=s.source;if("end"in s&&s.end)for(const t of s.end)e+=t.source;return e}}}function Re({start:s,key:e,sep:t,value:n}){let i="";for(const r of s)i+=r.source;if(e&&(i+=Ye(e)),t)for(const r of t)i+=r.source;return n&&(i+=Ye(n)),i}const Nt=Symbol("break visit"),Hn=Symbol("skip children"),qs=Symbol("remove item");function ne(s,e){"type"in s&&s.type==="document"&&(s={start:s.start,value:s.value}),Ds(Object.freeze([]),s,e)}ne.BREAK=Nt;ne.SKIP=Hn;ne.REMOVE=qs;ne.itemAtPath=(s,e)=>{let t=s;for(const[n,i]of e){const r=t==null?void 0:t[n];if(r&&"items"in r)t=r.items[i];else return}return t};ne.parentCollection=(s,e)=>{const t=ne.itemAtPath(s,e.slice(0,-1)),n=e[e.length-1][0],i=t==null?void 0:t[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Ds(s,e,t){let n=t(e,s);if(typeof n=="symbol")return n;for(const i of["key","value"]){const r=e[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){const l=Ds(Object.freeze(s.concat([[i,o]])),r.items[o],t);if(typeof l=="number")o=l-1;else{if(l===Nt)return Nt;l===qs&&(r.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,s))}}return typeof n=="function"?n(e,s):n}const nt="\uFEFF",it="",rt="",$e="",Xn=s=>!!s&&"items"in s,zn=s=>!!s&&(s.type==="scalar"||s.type==="single-quoted-scalar"||s.type==="double-quoted-scalar"||s.type==="block-scalar");function xn(s){switch(s){case nt:return"<BOM>";case it:return"<DOC>";case rt:return"<FLOW_END>";case $e:return"<SCALAR>";default:return JSON.stringify(s)}}function Ks(s){switch(s){case nt:return"byte-order-mark";case it:return"doc-mode";case rt:return"flow-error-end";case $e:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
174
115
  `:case`\r
175
- `: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(s[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}const Si=Object.freeze(Object.defineProperty({__proto__:null,BOM:ot,DOCUMENT:at,FLOW_END:lt,SCALAR:Me,createScalarToken:hi,isCollection:gi,isScalar:bi,prettyToken:wi,resolveAsScalar:ui,setScalarValue:di,stringify:mi,tokenType:Ws,visit:ie},Symbol.toStringTag,{value:"Module"}));function J(s){switch(s){case void 0:case" ":case`
176
- `:case"\r":case" ":return!0;default:return!1}}const es=new Set("0123456789ABCDEFabcdef"),ki=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Ke=new Set(",[]{}"),Oi=new Set(` ,[]{}
177
- \r `),bt=s=>!s||Oi.has(s);class Qs{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){var i;if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=(i=this.next)!=null?i:"stream";for(;n&&(t||this.hasChars(1));)n=yield*d(this.parseNext(n))}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
116
+ `: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(s[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}const Zn=Object.freeze(Object.defineProperty({__proto__:null,BOM:nt,DOCUMENT:it,FLOW_END:rt,SCALAR:$e,createScalarToken:Yn,isCollection:Xn,isScalar:zn,prettyToken:xn,resolveAsScalar:Jn,setScalarValue:Qn,stringify:Wn,tokenType:Ks,visit:ne},Symbol.toStringTag,{value:"Module"}));function U(s){switch(s){case void 0:case" ":case`
117
+ `:case"\r":case" ":return!0;default:return!1}}const Ht=new Set("0123456789ABCDEFabcdef"),ei=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),je=new Set(",[]{}"),ti=new Set(` ,[]{}
118
+ \r `),yt=s=>!s||ti.has(s);class Fs{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){var i;if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=(i=this.next)!=null?i:"stream";for(;n&&(t||this.hasChars(1));)n=yield*d(this.parseNext(n))}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
178
119
  `?!0:t==="\r"?this.buffer[e+1]===`
179
120
  `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){const i=this.buffer[n+e+1];if(i===`
180
121
  `||!i&&!this.atEnd)return e+n+1}return t===`
181
- `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){const n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&J(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
182
- `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(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*d(this.parseStream());case"line-start":return yield*d(this.parseLineStart());case"block-start":return yield*d(this.parseBlockStart());case"doc":return yield*d(this.parseDocument());case"flow":return yield*d(this.parseFlowCollection());case"quoted-scalar":return yield*d(this.parseQuotedScalar());case"block-scalar":return yield*d(this.parseBlockScalar());case"plain-scalar":return yield*d(this.parsePlainScalar())}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===ot&&(yield*d(this.pushCount(1)),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){const r=e[n-1];if(r===" "||r===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){const r=e[t-1];if(r===" "||r===" ")t-=1;else break}const i=(yield*d(this.pushCount(t)))+(yield*d(this.pushSpaces(!0)));return yield*d(this.pushCount(e.length-i)),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*d(this.pushSpaces(!0));return yield*d(this.pushCount(e.length-t)),yield*d(this.pushNewline()),"stream"}return yield at,yield*d(this.parseLineStart())}*parseLineStart(){const 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");const t=this.peek(3);if((t==="---"||t==="...")&&J(this.charAt(3)))return yield*d(this.pushCount(3)),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*d(this.pushSpaces(!1)),this.indentNext>this.indentValue&&!J(this.charAt(1))&&(this.indentNext=this.indentValue),yield*d(this.parseBlockStart())}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&J(t)){const n=(yield*d(this.pushCount(1)))+(yield*d(this.pushSpaces(!0)));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*d(this.parseBlockStart())}return"doc"}*parseDocument(){yield*d(this.pushSpaces(!0));const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*d(this.pushIndicators());switch(e[t]){case"#":yield*d(this.pushCount(e.length-t));case void 0:return yield*d(this.pushNewline()),yield*d(this.parseLineStart());case"{":case"[":return yield*d(this.pushCount(1)),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*d(this.pushCount(1)),"doc";case"*":return yield*d(this.pushUntil(bt)),"doc";case'"':case"'":return yield*d(this.parseQuotedScalar());case"|":case">":return t+=yield*d(this.parseBlockScalarHeader()),t+=yield*d(this.pushSpaces(!0)),yield*d(this.pushCount(e.length-t)),yield*d(this.pushNewline()),yield*d(this.parseBlockScalar());default:return yield*d(this.parsePlainScalar())}}*parseFlowCollection(){let e,t,n=-1;do e=yield*d(this.pushNewline()),e>0?(t=yield*d(this.pushSpaces(!1)),this.indentValue=n=t):t=0,t+=yield*d(this.pushSpaces(!0));while(e+t>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&J(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield lt,yield*d(this.parseLineStart());let r=0;for(;i[r]===",";)r+=yield*d(this.pushCount(1)),r+=yield*d(this.pushSpaces(!0)),this.flowKey=!1;switch(r+=yield*d(this.pushIndicators()),i[r]){case void 0:return"flow";case"#":return yield*d(this.pushCount(i.length-r)),"flow";case"{":case"[":return yield*d(this.pushCount(1)),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*d(this.pushCount(1)),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*d(this.pushUntil(bt)),"flow";case'"':case"'":return this.flowKey=!0,yield*d(this.parseQuotedScalar());case":":{const o=this.charAt(1);if(this.flowKey||J(o)||o===",")return this.flowKey=!1,yield*d(this.pushCount(1)),yield*d(this.pushSpaces(!0)),"flow"}default:return this.flowKey=!1,yield*d(this.parsePlainScalar())}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}const n=this.buffer.substring(0,t);let i=n.indexOf(`
122
+ `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){const n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&U(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
123
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(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*d(this.parseStream());case"line-start":return yield*d(this.parseLineStart());case"block-start":return yield*d(this.parseBlockStart());case"doc":return yield*d(this.parseDocument());case"flow":return yield*d(this.parseFlowCollection());case"quoted-scalar":return yield*d(this.parseQuotedScalar());case"block-scalar":return yield*d(this.parseBlockScalar());case"plain-scalar":return yield*d(this.parsePlainScalar())}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===nt&&(yield*d(this.pushCount(1)),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){const r=e[n-1];if(r===" "||r===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){const r=e[t-1];if(r===" "||r===" ")t-=1;else break}const i=(yield*d(this.pushCount(t)))+(yield*d(this.pushSpaces(!0)));return yield*d(this.pushCount(e.length-i)),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*d(this.pushSpaces(!0));return yield*d(this.pushCount(e.length-t)),yield*d(this.pushNewline()),"stream"}return yield it,yield*d(this.parseLineStart())}*parseLineStart(){const 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");const t=this.peek(3);if((t==="---"||t==="...")&&U(this.charAt(3)))return yield*d(this.pushCount(3)),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*d(this.pushSpaces(!1)),this.indentNext>this.indentValue&&!U(this.charAt(1))&&(this.indentNext=this.indentValue),yield*d(this.parseBlockStart())}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&U(t)){const n=(yield*d(this.pushCount(1)))+(yield*d(this.pushSpaces(!0)));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*d(this.parseBlockStart())}return"doc"}*parseDocument(){yield*d(this.pushSpaces(!0));const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*d(this.pushIndicators());switch(e[t]){case"#":yield*d(this.pushCount(e.length-t));case void 0:return yield*d(this.pushNewline()),yield*d(this.parseLineStart());case"{":case"[":return yield*d(this.pushCount(1)),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*d(this.pushCount(1)),"doc";case"*":return yield*d(this.pushUntil(yt)),"doc";case'"':case"'":return yield*d(this.parseQuotedScalar());case"|":case">":return t+=yield*d(this.parseBlockScalarHeader()),t+=yield*d(this.pushSpaces(!0)),yield*d(this.pushCount(e.length-t)),yield*d(this.pushNewline()),yield*d(this.parseBlockScalar());default:return yield*d(this.parsePlainScalar())}}*parseFlowCollection(){let e,t,n=-1;do e=yield*d(this.pushNewline()),e>0?(t=yield*d(this.pushSpaces(!1)),this.indentValue=n=t):t=0,t+=yield*d(this.pushSpaces(!0));while(e+t>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&U(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield rt,yield*d(this.parseLineStart());let r=0;for(;i[r]===",";)r+=yield*d(this.pushCount(1)),r+=yield*d(this.pushSpaces(!0)),this.flowKey=!1;switch(r+=yield*d(this.pushIndicators()),i[r]){case void 0:return"flow";case"#":return yield*d(this.pushCount(i.length-r)),"flow";case"{":case"[":return yield*d(this.pushCount(1)),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*d(this.pushCount(1)),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*d(this.pushUntil(yt)),"flow";case'"':case"'":return this.flowKey=!0,yield*d(this.parseQuotedScalar());case":":{const o=this.charAt(1);if(this.flowKey||U(o)||o===",")return this.flowKey=!1,yield*d(this.pushCount(1)),yield*d(this.pushSpaces(!0)),"flow"}default:return this.flowKey=!1,yield*d(this.parsePlainScalar())}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}const n=this.buffer.substring(0,t);let i=n.indexOf(`
183
124
  `,this.pos);if(i!==-1){for(;i!==-1;){const r=this.continueScalar(i+1);if(r===-1)break;i=n.indexOf(`
184
- `,r)}i!==-1&&(t=i-(n[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*d(this.pushToIndex(t+1,!1)),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const 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*d(this.pushUntil(t=>J(t)||t==="#"))}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case" ":t+=1;break;case`
125
+ `,r)}i!==-1&&(t=i-(n[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*d(this.pushToIndex(t+1,!1)),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const 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*d(this.pushUntil(t=>U(t)||t==="#"))}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case" ":t+=1;break;case`
185
126
  `:e=r,t=0;break;case"\r":{const o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
186
127
  `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
187
128
  `,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
188
- `;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);const a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
189
- `&&r>=this.pos&&r+1+t>a)e=r;else break}while(!0);return yield Me,yield*d(this.pushToIndex(e+1,!0)),yield*d(this.parseLineStart())}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){const r=this.buffer[n+1];if(J(r)||e&&Ke.has(r))break;t=n}else if(J(i)){let r=this.buffer[n+1];if(i==="\r"&&(r===`
129
+ `;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);const l=r;for(;o===" ";)o=this.buffer[--r];if(o===`
130
+ `&&r>=this.pos&&r+1+t>l)e=r;else break}while(!0);return yield $e,yield*d(this.pushToIndex(e+1,!0)),yield*d(this.parseLineStart())}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){const r=this.buffer[n+1];if(U(r)||e&&je.has(r))break;t=n}else if(U(i)){let r=this.buffer[n+1];if(i==="\r"&&(r===`
190
131
  `?(n+=1,i=`
191
- `,r=this.buffer[n+1]):t=n),r==="#"||e&&Ke.has(r))break;if(i===`
192
- `){const o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&Ke.has(i))break;t=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Me,yield*d(this.pushToIndex(t+1,!0)),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*d(this.pushTag()))+(yield*d(this.pushSpaces(!0)))+(yield*d(this.pushIndicators()));case"&":return(yield*d(this.pushUntil(bt)))+(yield*d(this.pushSpaces(!0)))+(yield*d(this.pushIndicators()));case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(J(t)||e&&Ke.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*d(this.pushCount(1)))+(yield*d(this.pushSpaces(!0)))+(yield*d(this.pushIndicators()))}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!J(t)&&t!==">";)t=this.buffer[++e];return yield*d(this.pushToIndex(t===">"?e+1:e,!1))}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(ki.has(t))t=this.buffer[++e];else if(t==="%"&&es.has(this.buffer[e+1])&&es.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*d(this.pushToIndex(e,!1))}}*pushNewline(){const e=this.buffer[this.pos];return e===`
132
+ `,r=this.buffer[n+1]):t=n),r==="#"||e&&je.has(r))break;if(i===`
133
+ `){const o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&je.has(i))break;t=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield $e,yield*d(this.pushToIndex(t+1,!0)),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*d(this.pushTag()))+(yield*d(this.pushSpaces(!0)))+(yield*d(this.pushIndicators()));case"&":return(yield*d(this.pushUntil(yt)))+(yield*d(this.pushSpaces(!0)))+(yield*d(this.pushIndicators()));case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(U(t)||e&&je.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*d(this.pushCount(1)))+(yield*d(this.pushSpaces(!0)))+(yield*d(this.pushIndicators()))}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!U(t)&&t!==">";)t=this.buffer[++e];return yield*d(this.pushToIndex(t===">"?e+1:e,!1))}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(ei.has(t))t=this.buffer[++e];else if(t==="%"&&Ht.has(this.buffer[e+1])&&Ht.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*d(this.pushToIndex(e,!1))}}*pushNewline(){const e=this.buffer[this.pos];return e===`
193
134
  `?yield*d(this.pushCount(1)):e==="\r"&&this.charAt(1)===`
194
- `?yield*d(this.pushCount(2)):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");const i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*d(this.pushToIndex(t,!1))}}class Gs{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){const r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};const i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}}function ee(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}function ts(s){for(let e=0;e<s.length;++e)switch(s[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Hs(s){switch(s==null?void 0:s.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Fe(s){var e;switch(s.type){case"document":return s.start;case"block-map":{const t=s.items[s.items.length-1];return(e=t.sep)!=null?e:t.start}case"block-seq":return s.items[s.items.length-1].start;default:return[]}}function le(s){var t;if(s.length===0)return[];let e=s.length;e:for(;--e>=0;)switch(s[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((t=s[++e])==null?void 0:t.type)==="space";);return s.splice(e,s.length)}function ss(s){if(s.start.type==="flow-seq-start")for(const e of s.items)e.sep&&!e.value&&!ee(e.start,"explicit-key-ind")&&!ee(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Hs(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class Rt{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 Qs,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const n of this.lexer.lex(e,t))yield*d(this.next(n));t||(yield*d(this.end()))}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*d(this.step()),this.offset+=e.length;return}const t=Ws(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*d(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{const n=`Not a YAML token: ${e}`;yield*d(this.pop({type:"error",offset:this.offset,message:n,source:e})),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*d(this.pop())}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*d(this.pop());this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*d(this.stream());switch(e.type){case"document":return yield*d(this.document(e));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*d(this.scalar(e));case"block-scalar":return yield*d(this.blockScalar(e));case"block-map":return yield*d(this.blockMap(e));case"block-seq":return yield*d(this.blockSequence(e));case"flow-collection":return yield*d(this.flowCollection(e));case"doc-end":return yield*d(this.documentEnd(e))}yield*d(this.pop())}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e!=null?e:this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{const n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&ss(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{const i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{const i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*d(this.pop()),yield*d(this.pop(t))}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&ts(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*d(this.lineEnd(e));switch(this.type){case"doc-start":{ts(e.start)!==-1?(yield*d(this.pop()),yield*d(this.step())):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const t=Fe(this.peek(2)),n=le(t);let i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*d(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 t=this.source.indexOf(`
135
+ `?yield*d(this.pushCount(2)):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");const i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*d(this.pushToIndex(t,!1))}}class Rs{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){const r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};const i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}}function Z(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}function Xt(s){for(let e=0;e<s.length;++e)switch(s[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Us(s){switch(s==null?void 0:s.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function qe(s){var e;switch(s.type){case"document":return s.start;case"block-map":{const t=s.items[s.items.length-1];return(e=t.sep)!=null?e:t.start}case"block-seq":return s.items[s.items.length-1].start;default:return[]}}function le(s){var t;if(s.length===0)return[];let e=s.length;e:for(;--e>=0;)switch(s[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((t=s[++e])==null?void 0:t.type)==="space";);return s.splice(e,s.length)}function zt(s){if(s.start.type==="flow-seq-start")for(const e of s.items)e.sep&&!e.value&&!Z(e.start,"explicit-key-ind")&&!Z(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Us(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class qt{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 Fs,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const n of this.lexer.lex(e,t))yield*d(this.next(n));t||(yield*d(this.end()))}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*d(this.step()),this.offset+=e.length;return}const t=Ks(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*d(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{const n=`Not a YAML token: ${e}`;yield*d(this.pop({type:"error",offset:this.offset,message:n,source:e})),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*d(this.pop())}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*d(this.pop());this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*d(this.stream());switch(e.type){case"document":return yield*d(this.document(e));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*d(this.scalar(e));case"block-scalar":return yield*d(this.blockScalar(e));case"block-map":return yield*d(this.blockMap(e));case"block-seq":return yield*d(this.blockSequence(e));case"flow-collection":return yield*d(this.flowCollection(e));case"doc-end":return yield*d(this.documentEnd(e))}yield*d(this.pop())}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e!=null?e:this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{const n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&zt(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{const i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{const i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*d(this.pop()),yield*d(this.pop(t))}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Xt(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*d(this.lineEnd(e));switch(this.type){case"doc-start":{Xt(e.start)!==-1?(yield*d(this.pop()),yield*d(this.step())):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const t=qe(this.peek(2)),n=le(t);let i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*d(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 t=this.source.indexOf(`
195
136
  `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
196
- `,t)+1}yield*d(this.pop());break;default:yield*d(this.pop()),yield*d(this.step())}}*blockMap(e){var n;const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const i="end"in t.value?t.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.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)){const i=e.items[e.items.length-2],r=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const i=!this.onKeyLine&&this.indent===e.indent,r=i&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(r&&t.sep&&!t.value){const a=[];for(let l=0;l<t.sep.length;++l){const c=t.sep[l];switch(c.type){case"newline":a.push(l);break;case"space":break;case"comment":c.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(o=t.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ee(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(Hs(t.key)&&!ee(t.sep,"newline")){const a=le(t.start),l=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:c}]})}else o.length>0?t.sep=t.sep.concat(o,this.sourceToken):t.sep.push(this.sourceToken);else if(ee(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const a=le(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:o,key:null,sep:[this.sourceToken]}):ee(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":{const a=this.flowScalar(this.type);r||t.value?(e.items.push({start:o,key:a,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(a):(Object.assign(t,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{const a=this.startBlockValue(e);if(a){i&&a.type!=="block-seq"&&e.items.push({start:o}),this.stack.push(a);return}}}}yield*d(this.pop()),yield*d(this.step())}*blockSequence(e){var n;const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const i="end"in t.value?t.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.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)){const i=e.items[e.items.length-2],r=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.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||ee(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*d(this.pop()),yield*d(this.step())}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*d(this.pop()),n=this.peek(1);while(n&&n.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const n=this.startBlockValue(e);n?this.stack.push(n):(yield*d(this.pop()),yield*d(this.step()))}else{const n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*d(this.pop()),yield*d(this.step());else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){const i=Fe(n),r=le(i);ss(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*d(this.lineEnd(e))}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
137
+ `,t)+1}yield*d(this.pop());break;default:yield*d(this.pop()),yield*d(this.step())}}*blockMap(e){var n;const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const i="end"in t.value?t.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.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)){const i=e.items[e.items.length-2],r=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const i=!this.onKeyLine&&this.indent===e.indent,r=i&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(r&&t.sep&&!t.value){const l=[];for(let a=0;a<t.sep.length;++a){const c=t.sep[a];switch(c.type){case"newline":l.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(o=t.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Z(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(Us(t.key)&&!Z(t.sep,"newline")){const l=le(t.start),a=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:a,sep:c}]})}else o.length>0?t.sep=t.sep.concat(o,this.sourceToken):t.sep.push(this.sourceToken);else if(Z(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const l=le(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:o,key:null,sep:[this.sourceToken]}):Z(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":{const l=this.flowScalar(this.type);r||t.value?(e.items.push({start:o,key:l,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(l):(Object.assign(t,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(e);if(l){i&&l.type!=="block-seq"&&e.items.push({start:o}),this.stack.push(l);return}}}}yield*d(this.pop()),yield*d(this.step())}*blockSequence(e){var n;const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const i="end"in t.value?t.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.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)){const i=e.items[e.items.length-2],r=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.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||Z(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*d(this.pop()),yield*d(this.step())}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*d(this.pop()),n=this.peek(1);while(n&&n.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const n=this.startBlockValue(e);n?this.stack.push(n):(yield*d(this.pop()),yield*d(this.step()))}else{const n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*d(this.pop()),yield*d(this.step());else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){const i=qe(n),r=le(i);zt(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*d(this.lineEnd(e))}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
197
138
  `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
198
- `,t)+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;const t=Fe(e),n=le(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=Fe(e),n=le(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*d(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*d(this.pop()),yield*d(this.step());break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*d(this.pop()))}}}function zs(s){const e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new Gs||null,prettyErrors:e}}function Ti(s,e={}){const{lineCounter:t,prettyErrors:n}=zs(e),i=new Rt(t==null?void 0:t.addNewLine),r=new Ft(e),o=Array.from(r.compose(i.parse(s)));if(n&&t)for(const a of o)a.errors.forEach(Qe(s,t)),a.warnings.forEach(Qe(s,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function Xs(s,e={}){const{lineCounter:t,prettyErrors:n}=zs(e),i=new Rt(t==null?void 0:t.addNewLine),r=new Ft(e);let o=null;for(const a of r.compose(i.parse(s),!0,s.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new ne(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(Qe(s,t)),o.warnings.forEach(Qe(s,t))),o}function Ni(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);const i=Xs(s,t);if(!i)return null;if(i.warnings.forEach(r=>bs(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function Ei(s,e,t){var i;let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){const r=Math.round(t);t=r<1?void 0:r>8?{indent:8}:{indent:r}}if(s===void 0){const{keepUndefined:r}=(i=t!=null?t:e)!=null?i:{};if(!r)return}return new Te(s,n,t).toString(t)}const ns=Object.freeze(Object.defineProperty({__proto__:null,Alias:ze,CST:Si,Composer:Ft,Document:Te,Lexer:Qs,LineCounter:Gs,Pair:q,Parser:Rt,Scalar:O,Schema:rt,YAMLError:Pt,YAMLMap:R,YAMLParseError:ne,YAMLSeq:x,YAMLWarning:qs,isAlias:re,isCollection:L,isDocument:be,isMap:we,isNode:M,isPair:I,isScalar:A,isSeq:Se,parse:Ni,parseAllDocuments:Ti,parseDocument:Xs,stringify:Ei,visit:X,visitAsync:He},Symbol.toStringTag,{value:"Module"})),Ai=`# This is your query - you can modify it directly and click Run to see new results.
139
+ `,t)+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;const t=qe(e),n=le(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=qe(e),n=le(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*d(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*d(this.pop()),yield*d(this.step());break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*d(this.pop()))}}}function Vs(s){const e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new Rs||null,prettyErrors:e}}function si(s,e={}){const{lineCounter:t,prettyErrors:n}=Vs(e),i=new qt(t==null?void 0:t.addNewLine),r=new jt(e),o=Array.from(r.compose(i.parse(s)));if(n&&t)for(const l of o)l.errors.forEach(Je(s,t)),l.warnings.forEach(Je(s,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function Js(s,e={}){const{lineCounter:t,prettyErrors:n}=Vs(e),i=new qt(t==null?void 0:t.addNewLine),r=new jt(e);let o=null;for(const l of r.compose(i.parse(s),!0,s.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new se(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(Je(s,t)),o.warnings.forEach(Je(s,t))),o}function ni(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);const i=Js(s,t);if(!i)return null;if(i.warnings.forEach(r=>us(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function ii(s,e,t){var i;let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){const r=Math.round(t);t=r<1?void 0:r>8?{indent:8}:{indent:r}}if(s===void 0){const{keepUndefined:r}=(i=t!=null?t:e)!=null?i:{};if(!r)return}return new Ne(s,n,t).toString(t)}const xt=Object.freeze(Object.defineProperty({__proto__:null,Alias:Ge,CST:Zn,Composer:jt,Document:Ne,Lexer:Fs,LineCounter:Rs,Pair:P,Parser:qt,Scalar:N,Schema:st,YAMLError:Bt,YAMLMap:D,YAMLParseError:se,YAMLSeq:z,YAMLWarning:$s,isAlias:ie,isCollection:$,isDocument:ge,isMap:be,isNode:M,isPair:A,isScalar:I,isSeq:we,parse:ni,parseAllDocuments:si,parseDocument:Js,stringify:ii,visit:X,visitAsync:Qe},Symbol.toStringTag,{value:"Module"})),ri=`# This is your query - you can modify it directly and click Run to see new results.
199
140
  # Try uncommenting the elements below
200
141
  # To learn more about the query syntax, visit [Doc URL]
201
142
  ---
@@ -236,4 +177,4 @@ model: {{dataSourceTitle}}
236
177
  # - name: Dimension1
237
178
  # - name: Dimension2
238
179
  # - name: Measure1
239
- # - name: Measure2`;class Ii{constructor(e,t){F(this,"contextTitle");F(this,"indexedFields",{});this.contextTitle=e,this.indexedFields=this.indexFields(t)}indexFields(e){return e.reduce((t,n)=>{const i=n.id;t[i]=n;const r=on(i);return i!==r&&(t[r]=H(K({},n),{id:r})),t},{})}concatAggTypes(){return Object.values(v.AggregationTypes).map(t=>v.DimensionalBaseMeasure.aggregationToJAQL(t)).join("|")}simplifyAggFormula(e){const{formula:t,context:n,filter:i}=e;if(!n||!t)return e;const r=Object.keys(n);if(r.length!==1)return e;const o=r[0],a=n[o],l=this.concatAggTypes(),c=new RegExp(`^\\s*(${l})\\(\\[\\w+\\]\\)$`),h=t.match(c);if(h&&t.includes(o)){const f=h[1];return{dim:a.dim,agg:f,title:e.title,filter:i?K({},i):void 0}}return e}simplifyMetadataItemJaql(e){let t=e;if("formula"in e&&(t=this.simplifyAggFormula(e)),delete t.table,delete t.column,delete t.datatype,"context"in t){const n=K({},t.context);Object.keys(n).forEach(i=>{n[i]=this.simplifyMetadataItemJaql(n[i])}),t.context=n}return t}simplifyMetadataItemFilter(e){var i;const t=e;if(t.panel!=="scope")return t;delete t.format;const{jaql:n}=t;return(i=n.filter)!=null&&i.by&&(n.filter.by=this.simplifyAggFormula(n.filter.by)),H(K({},t),{jaql:n})}simplifyMetadataItemFormat(e){const{jaql:{level:t},format:{mask:n}={}}=e;return t&&(n!=null&&n[t])?H(K({},e),{format:{mask:{[t]:n[t]}}}):e}simplifyMetadataItem(e){let t=e;t.panel&&["rows","columns","measures"].includes(t.panel)&&delete t.panel,t=this.simplifyMetadataItemFilter(t),t=this.simplifyMetadataItemFormat(t);const{jaql:n,measure:i,by:r}=t;return H(K({},t),{jaql:this.simplifyMetadataItemJaql(n),by:r?this.simplifyMetadataItemJaql(r):void 0,measure:i?this.simplifyMetadataItemJaql(i):void 0})}simplifyChartRecommendations(e){if(!("axesMapping"in e))return{};const{chartType:t,axesMapping:n}=e,i=Object.entries(n).reduce((r,[o,a])=>(r[o]=a.map(l=>({name:l.name})),r),{});return{chartType:t,dataOptions:i}}getQueryTitleWithChartType(e,t){let n="chartType"in t?t.chartType:"table";return n!=="table"&&(n+=" chart"),`${n} showing ${e.toLowerCase()}`}translateToSimple(e){try{const{jaql:t,chartRecommendations:n,queryTitle:i}=v.cloneDeep(e);return{model:t.datasource.title,metadata:t.metadata.map(r=>this.simplifyMetadataItem(r)),chart:this.simplifyChartRecommendations(n),queryTitle:this.getQueryTitleWithChartType(i,n)}}catch(t){return console.error("Error running toSimpleQuery",t),wt}}stringifySimple(e){const r=e,{queryTitle:t}=r,n=Jt(r,["queryTitle"]),i=new ns.Document(n);return i.commentBefore=` ${rn(t)}`,i.directives&&(i.directives.docStart=!0),String(i)}getQueryTemplate(){return rs(Ai,{dataSourceTitle:this.contextTitle})}parseSimple(e){try{const t=ns.parseDocument(e),{commentBefore:n}=t,i=an(t.toJS());return i.queryTitle=(n==null?void 0:n.trim())||"",i}catch(t){console.error("Error parsing the YAML string",t)}return wt}expandChartRecommendations(e){if(!e||!("dataOptions"in e))return{};const{chartType:t,dataOptions:n}=e;return{chartFamily:v.deriveChartFamily(t),chartType:t,axesMapping:n}}expandMetadataItemJaql(e){const{dim:t="",agg:n,context:i}=e;i&&(Object.keys(i).forEach(a=>{i[a]=this.expandMetadataItemJaql(i[a])}),e.context=i);const r=this.indexedFields[t];if(!r)return e;let{filter:o}=e;return o!=null&&o.by&&(o=H(K({},o),{by:this.expandMetadataItemJaql(o.by)}),e.filter=o),K({table:r.table,column:r.column,datatype:r.dimtype,title:n?n+" "+r.title:r.title},e)}expandMetadataItem(e){const{jaql:t,measure:n}=e;return n?H(K({},e),{jaql:this.expandMetadataItemJaql(t),measure:this.expandMetadataItemJaql(n)}):H(K({},e),{jaql:this.expandMetadataItemJaql(t)})}translateToExpanded(e){const{model:t,metadata:n,chart:i,queryTitle:r}=v.cloneDeep(e),o={datasource:{title:t},metadata:n.map(l=>this.expandMetadataItem(l))},a=this.expandChartRecommendations(i);return{jaql:o,chartRecommendations:a,queryTitle:r}}}exports.EMPTY_EXPANDED_QUERY_MODEL=sn;exports.EMPTY_SIMPLE_QUERY_MODEL=wt;exports.ModelTranslator=yn;exports.QueryTranslator=Ii;
180
+ # - name: Measure2`;class oi{constructor(e,t){at(this,"contextTitle");at(this,"indexedFields",{});this.contextTitle=e,this.indexedFields=this.indexFields(t)}indexFields(e){return e.reduce((t,n)=>{const i=n.id;t[i]=n;const r=V.sanitizeDimensionId(i);return i!==r&&(t[r]=W(R({},n),{id:r})),t},{})}concatAggTypes(){return Object.values(Oe.AggregationTypes).map(t=>Oe.DimensionalBaseMeasure.aggregationToJAQL(t)).join("|")}simplifyAggFormula(e){const{formula:t,context:n,filter:i}=e;if(!n||!t)return e;const r=Object.keys(n);if(r.length!==1)return e;const o=r[0],l=n[o],a=this.concatAggTypes(),c=new RegExp(`^\\s*(${a})\\(\\[\\w+\\]\\)$`),h=t.match(c);if(h&&t.includes(o)){const f=h[1];return{dim:l.dim,agg:f,title:e.title,filter:i?R({},i):void 0}}return e}simplifyMetadataItemJaql(e){let t=e;if("formula"in e&&(t=this.simplifyAggFormula(e)),delete t.table,delete t.column,delete t.datatype,"context"in t){const n=R({},t.context);Object.keys(n).forEach(i=>{n[i]=this.simplifyMetadataItemJaql(n[i])}),t.context=n}return t}simplifyMetadataItemFilter(e){var i;const t=e;if(t.panel!=="scope")return t;delete t.format;const{jaql:n}=t;return(i=n.filter)!=null&&i.by&&(n.filter.by=this.simplifyAggFormula(n.filter.by)),W(R({},t),{jaql:n})}simplifyMetadataItemFormat(e){const{jaql:{level:t},format:{mask:n}={}}=e;return t&&(n!=null&&n[t])?W(R({},e),{format:{mask:{[t]:n[t]}}}):e}simplifyMetadataItem(e){let t=e;t.panel&&["rows","columns","measures"].includes(t.panel)&&delete t.panel,t=this.simplifyMetadataItemFilter(t),t=this.simplifyMetadataItemFormat(t);const{jaql:n,measure:i,by:r}=t;return W(R({},t),{jaql:this.simplifyMetadataItemJaql(n),by:r?this.simplifyMetadataItemJaql(r):void 0,measure:i?this.simplifyMetadataItemJaql(i):void 0})}simplifyChartRecommendations(e){if(!("axesMapping"in e))return{};const{chartType:t,axesMapping:n}=e,i=Object.entries(n).reduce((r,[o,l])=>(r[o]=l.map(a=>({name:a.name})),r),{});return{chartType:t,dataOptions:i}}getQueryTitleWithChartType(e,t){let n="chartType"in t?t.chartType:"table";return n!=="table"&&(n+=" chart"),`${n} showing ${e.toLowerCase()}`}translateToSimple(e){try{const{jaql:t,chartRecommendations:n,queryTitle:i}=Oe.cloneDeep(e);return{model:t.datasource.title,metadata:t.metadata.map(r=>this.simplifyMetadataItem(r)),chart:this.simplifyChartRecommendations(n),queryTitle:this.getQueryTitleWithChartType(i,n)}}catch(t){return console.error("Error running toSimpleQuery",t),V.EMPTY_SIMPLE_QUERY_MODEL}}stringifySimple(e){const r=e,{queryTitle:t}=r,n=Ft(r,["queryTitle"]),i=new xt.Document(n);return i.commentBefore=` ${V.capitalizeFirstLetter(t)}`,i.directives&&(i.directives.docStart=!0),String(i)}getQueryTemplate(){return V.populatePlaceholders(ri,{dataSourceTitle:this.contextTitle})}parseSimple(e){try{const t=xt.parseDocument(e),{commentBefore:n}=t,i=V.validateQueryModel(t.toJS());return i.queryTitle=(n==null?void 0:n.trim())||"",i}catch(t){console.error("Error parsing the YAML string",t)}return V.EMPTY_SIMPLE_QUERY_MODEL}expandChartRecommendations(e){if(!e||!("dataOptions"in e))return{};const{chartType:t,dataOptions:n}=e;return{chartFamily:Oe.deriveChartFamily(t),chartType:t,axesMapping:n}}expandMetadataItemJaql(e){const{dim:t="",agg:n,context:i}=e;i&&(Object.keys(i).forEach(l=>{i[l]=this.expandMetadataItemJaql(i[l])}),e.context=i);const r=this.indexedFields[t];if(!r)return e;let{filter:o}=e;return o!=null&&o.by&&(o=W(R({},o),{by:this.expandMetadataItemJaql(o.by)}),e.filter=o),R({table:r.table,column:r.column,datatype:r.dimtype,title:n?n+" "+r.title:r.title},e)}expandMetadataItem(e){const{jaql:t,measure:n}=e;return n?W(R({},e),{jaql:this.expandMetadataItemJaql(t),measure:this.expandMetadataItemJaql(n)}):W(R({},e),{jaql:this.expandMetadataItemJaql(t)})}translateToExpanded(e){const{model:t,metadata:n,chart:i,queryTitle:r}=Oe.cloneDeep(e),o={datasource:{title:t},metadata:n.map(a=>this.expandMetadataItem(a))},l=this.expandChartRecommendations(i);return{jaql:o,chartRecommendations:l,queryTitle:r}}}const li=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));exports.EMPTY_EXPANDED_QUERY_MODEL=V.EMPTY_EXPANDED_QUERY_MODEL;exports.EMPTY_SIMPLE_QUERY_MODEL=V.EMPTY_SIMPLE_QUERY_MODEL;exports.isByIdWidgetCodeParams=V.isByIdWidgetCodeParams;exports.isClientSideWidgetCodeParams=V.isClientSideWidgetCodeParams;exports.widgetComposer=V.widgetComposer;exports.QueryTranslator=oi;exports.dashboardComposer=li;