@canonry/canonry 4.154.0 → 4.155.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.
- package/README.md +2 -2
- package/assets/agent-workspace/AGENTS.md +2 -2
- package/assets/agent-workspace/skills/aero/references/orchestration.md +3 -3
- package/assets/agent-workspace/skills/canonry/SKILL.md +6 -21
- package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +14 -6
- package/assets/assets/{AuditHistoryPanel-WWT1n8jp.js → AuditHistoryPanel-BlbMBxOY.js} +1 -1
- package/assets/assets/BacklinksPage-DA9EaV9q.js +1 -0
- package/assets/assets/HistoryPage-BTrIHjMQ.js +1 -0
- package/assets/assets/MeasurementPropertyPage-CN6o5xFg.js +1 -0
- package/assets/assets/{ProjectPage-BR5ECwUP.js → ProjectPage-CsDbgp_0.js} +9 -9
- package/assets/assets/{RunRow-OE5tiuih.js → RunRow-ch_OlCPs.js} +1 -1
- package/assets/assets/RunsPage-T89Y_yS8.js +1 -0
- package/assets/assets/SettingsPage-DnmEq3F9.js +1 -0
- package/assets/assets/TrafficPage-CW1UhaJt.js +1 -0
- package/assets/assets/TrafficSourceDetailPage-r4Ji3wJm.js +1 -0
- package/assets/assets/extract-error-message-a8EErBoZ.js +1 -0
- package/assets/assets/index-BKq6k5Of.js +83 -0
- package/assets/assets/vendor-lucide-ByU7vBHt.js +1 -0
- package/assets/assets/vendor-yaml-GWJz5H2G.js +131 -0
- package/assets/index.html +3 -1
- package/dist/{chunk-ANSQ6JNO.js → chunk-OSHRDV36.js} +317 -4
- package/dist/{chunk-NNW7TJUZ.js → chunk-VIKPFI6F.js} +200 -5
- package/dist/{chunk-IFZS2TXV.js → chunk-VOL2BSM5.js} +1133 -104
- package/dist/{chunk-X5I7CAXH.js → chunk-YSESZNVT.js} +609 -165
- package/dist/cli.js +342 -7
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-B5AETQ5N.js → intelligence-service-G4NV3X36.js} +2 -2
- package/dist/mcp.js +2 -2
- package/package.json +9 -9
- package/assets/assets/BacklinksPage-DIjUnsVL.js +0 -1
- package/assets/assets/HistoryPage-CrIBhGuW.js +0 -1
- package/assets/assets/MeasurementPropertyPage-uN4BWigS.js +0 -1
- package/assets/assets/RunsPage-C6xBmjps.js +0 -1
- package/assets/assets/SettingsPage-CUjjr8U0.js +0 -1
- package/assets/assets/TrafficPage-DrEfsHiE.js +0 -1
- package/assets/assets/TrafficSourceDetailPage-B3DX5BEk.js +0 -1
- package/assets/assets/arrow-left-CLmqvCqU.js +0 -1
- package/assets/assets/extract-error-message-BEBd1a5v.js +0 -1
- package/assets/assets/index-CsM-Xxia.js +0 -213
- package/assets/assets/refresh-cw-DYSS2Wd-.js +0 -1
- package/assets/assets/trash-2-VoiF_ckU.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n}from"./vendor-tanstack-BjS7iY3g.js";const _=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),M=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,o,c)=>c?c.toUpperCase():o.toLowerCase()),y=a=>{const t=M(a);return t.charAt(0).toUpperCase()+t.slice(1)},r=(...a)=>a.filter((t,o,c)=>!!t&&t.trim()!==""&&c.indexOf(t)===o).join(" ").trim(),m=a=>{for(const t in a)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var v={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const u=n.forwardRef(({color:a="currentColor",size:t=24,strokeWidth:o=2,absoluteStrokeWidth:c,className:s="",children:h,iconNode:i,...d},k)=>n.createElement("svg",{ref:k,...v,width:t,height:t,stroke:a,strokeWidth:c?Number(o)*24/Number(t):o,className:r("lucide",s),...!h&&!m(d)&&{"aria-hidden":"true"},...d},[...i.map(([p,l])=>n.createElement(p,l)),...Array.isArray(h)?h:[h]]));const e=(a,t)=>{const o=n.forwardRef(({className:c,...s},h)=>n.createElement(u,{ref:h,iconNode:t,className:r(`lucide-${_(y(a))}`,`lucide-${a}`,c),...s}));return o.displayName=y(a),o};const x=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],i1=e("arrow-left",x);const g=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],k1=e("arrow-right",g);const w=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],p1=e("arrow-up",w);const $=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],l1=e("book-open",$);const N=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],_1=e("check",N);const f=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],M1=e("chevron-down",f);const z=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],m1=e("chevron-left",z);const q=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],v1=e("chevron-right",q);const C=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],u1=e("circle-check",C);const j=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],x1=e("circle-question-mark",j);const A=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],g1=e("cloud",A);const b=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],w1=e("copy",b);const L=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],$1=e("download",L);const H=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],N1=e("external-link",H);const R=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],f1=e("file-text",R);const V=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],z1=e("github",V);const E=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],q1=e("globe",E);const P=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],C1=e("history",P);const Z=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],j1=e("layout-dashboard",Z);const U=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],A1=e("link-2",U);const B=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],b1=e("loader-circle",B);const D=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],L1=e("maximize-2",D);const S=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],H1=e("menu",S);const T=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],R1=e("minimize-2",T);const G=[["path",{d:"M5 12h14",key:"1ays0h"}]],V1=e("minus",G);const W=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],E1=e("panel-left-close",W);const F=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],P1=e("panel-left-open",F);const I=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Z1=e("play",I);const O=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],U1=e("plus",O);const K=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],B1=e("radar",K);const Q=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],D1=e("radio",Q);const X=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],S1=e("refresh-cw",X);const J=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],T1=e("rocket",J);const Y=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],G1=e("rotate-ccw",Y);const e1=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]],W1=e("scan-search",e1);const t1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],F1=e("search",t1);const a1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],I1=e("settings",a1);const o1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],O1=e("trash-2",o1);const c1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],K1=e("triangle-alert",c1);const h1=[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]],Q1=e("triangle",h1);const n1=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],X1=e("unplug",n1);const s1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],J1=e("upload",s1);const d1=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Y1=e("wrench",d1);const y1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],e2=e("x",y1);export{k1 as A,l1 as B,M1 as C,$1 as D,N1 as E,f1 as F,q1 as G,C1 as H,i1 as I,b1 as L,R1 as M,Z1 as P,D1 as R,F1 as S,K1 as T,X1 as U,Y1 as W,e2 as X,G1 as a,L1 as b,p1 as c,_1 as d,v1 as e,w1 as f,j1 as g,B1 as h,A1 as i,I1 as j,T1 as k,z1 as l,P1 as m,E1 as n,H1 as o,U1 as p,m1 as q,S1 as r,J1 as s,u1 as t,x1 as u,V1 as v,W1 as w,O1 as x,g1 as y,Q1 as z};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
const Ze=Symbol.for("yaml.alias"),Qe=Symbol.for("yaml.document"),J=Symbol.for("yaml.map"),Tt=Symbol.for("yaml.pair"),q=Symbol.for("yaml.scalar"),oe=Symbol.for("yaml.seq"),P=Symbol.for("yaml.node.type"),W=n=>!!n&&typeof n=="object"&&n[P]===Ze,_e=n=>!!n&&typeof n=="object"&&n[P]===Qe,ge=n=>!!n&&typeof n=="object"&&n[P]===J,$=n=>!!n&&typeof n=="object"&&n[P]===Tt,T=n=>!!n&&typeof n=="object"&&n[P]===q,ye=n=>!!n&&typeof n=="object"&&n[P]===oe;function E(n){if(n&&typeof n=="object")switch(n[P]){case J:case oe:return!0}return!1}function L(n){if(n&&typeof n=="object")switch(n[P]){case Ze:case J:case q:case oe:return!0}return!1}const Et=n=>(T(n)||E(n))&&!!n.anchor,Y=Symbol("break visit"),as=Symbol("skip children"),he=Symbol("remove node");function le(n,e){const t=cs(e);_e(n)?Z(null,n.contents,t,Object.freeze([n]))===he&&(n.contents=null):Z(null,n,t,Object.freeze([]))}le.BREAK=Y;le.SKIP=as;le.REMOVE=he;function Z(n,e,t,s){const i=fs(n,e,t,s);if(L(i)||$(i))return us(n,s,i),Z(n,i,t,s);if(typeof i!="symbol"){if(E(e)){s=Object.freeze(s.concat(e));for(let r=0;r<e.items.length;++r){const o=Z(r,e.items[r],t,s);if(typeof o=="number")r=o-1;else{if(o===Y)return Y;o===he&&(e.items.splice(r,1),r-=1)}}}else if($(e)){s=Object.freeze(s.concat(e));const r=Z("key",e.key,t,s);if(r===Y)return Y;r===he&&(e.key=null);const o=Z("value",e.value,t,s);if(o===Y)return Y;o===he&&(e.value=null)}}return i}function cs(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function fs(n,e,t,s){if(typeof t=="function")return t(n,e,s);if(ge(e))return t.Map?.(n,e,s);if(ye(e))return t.Seq?.(n,e,s);if($(e))return t.Pair?.(n,e,s);if(T(e))return t.Scalar?.(n,e,s);if(W(e))return t.Alias?.(n,e,s)}function us(n,e,t){const s=e[e.length-1];if(E(s))s.items[n]=t;else if($(s))n==="key"?s.key=t:s.value=t;else if(_e(s))s.contents=t;else{const i=W(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const hs={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ds=n=>n.replace(/[!,[\]{}]/g,e=>hs[e]);class v{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},v.defaultYaml,e),this.tags=Object.assign({},v.defaultTags,t)}clone(){const e=new v(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new v(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:v.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},v.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:v.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},v.defaultTags),this.atNextDocument=!1);const s=e.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[r,o]=s;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[r]=s;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[,s,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);const r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return s==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,s]of Object.entries(this.tags))if(e.startsWith(s))return t+ds(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let i;if(e&&s.length>0&&L(e.contents)){const r={};le(e.contents,(o,l)=>{L(l)&&l.tag&&(r[l.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,o]of s)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
|
|
2
|
+
`)}}v.defaultYaml={explicit:!1,version:"1.2"};v.defaultTags={"!!":"tag:yaml.org,2002:"};function Lt(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function $t(n){const e=new Set;return le(n,{Value(t,s){s.anchor&&e.add(s.anchor)}}),e}function Ct(n,e){for(let t=1;;++t){const s=`${n}${t}`;if(!e.has(s))return s}}function ps(n,e){const t=[],s=new Map;let i=null;return{onAnchor:r=>{t.push(r),i??(i=$t(n));const o=Ct(e,i);return i.add(o),o},setAnchors:()=>{for(const r of t){const o=s.get(r);if(typeof o=="object"&&o.anchor&&(T(o.node)||E(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:s}}function ee(n,e,t,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;i<r;++i){const o=s[i],l=ee(n,s,String(i),o);l===void 0?delete s[i]:l!==o&&(s[i]=l)}else if(s instanceof Map)for(const i of Array.from(s.keys())){const r=s.get(i),o=ee(n,s,i,r);o===void 0?s.delete(i):o!==r&&s.set(i,o)}else if(s instanceof Set)for(const i of Array.from(s)){const r=ee(n,s,i,i);r===void 0?s.delete(i):r!==i&&(s.delete(i),s.add(r))}else for(const[i,r]of Object.entries(s)){const o=ee(n,s,i,r);o===void 0?delete s[i]:o!==r&&(s[i]=o)}return n.call(e,t,s)}function K(n,e,t){if(Array.isArray(n))return n.map((s,i)=>K(s,String(i),t));if(n&&typeof n.toJSON=="function"){if(!t||!Et(n))return n.toJSON(e,t);const s={aliasCount:0,count:1,res:void 0};t.anchors.set(n,s),t.onCreate=r=>{s.res=r,delete t.onCreate};const i=n.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof n=="bigint"&&!t?.keep?Number(n):n}class et{constructor(e){Object.defineProperty(this,P,{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:s,onAnchor:i,reviver:r}={}){if(!_e(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 s=="number"?s: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"?ee(r,{"":l},"",l):l}}class tt extends et{constructor(e){super(Ze),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let s;t?.aliasResolveCache?s=t.aliasResolveCache:(s=[],le(e,{Node:(r,o)=>{(W(o)||Et(o))&&s.push(o)}}),t&&(t.aliasResolveCache=s));let i;for(const r of s){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(e,t){if(!t)return{source:this.source};const{anchors:s,doc:i,maxAliasCount:r}=t,o=this.resolve(i,t);if(!o){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(a)}let l=s.get(o);if(l||(K(o,null,t),l=s.get(o)),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=Te(i,o,s)),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,s){const i=`*${this.source}`;if(e){if(Lt(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 Te(n,e,t){if(W(e)){const s=e.resolve(n),i=t&&s&&t.get(s);return i?i.count*i.aliasCount:0}else if(E(e)){let s=0;for(const i of e.items){const r=Te(n,i,t);r>s&&(s=r)}return s}else if($(e)){const s=Te(n,e.key,t),i=Te(n,e.value,t);return Math.max(s,i)}return 1}const _t=n=>!n||typeof n!="function"&&typeof n!="object";class O extends et{constructor(e){super(q),this.value=e}toJSON(e,t){return t?.keep?this.value:K(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 ms="tag:yaml.org,2002:";function gs(n,e,t){if(e){const s=t.filter(r=>r.tag===e),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(s=>s.identify?.(n)&&!s.format)}function pe(n,e,t){if(_e(n)&&(n=n.contents),L(n))return n;if($(n)){const f=t.schema[J].createNode?.(t.schema,null,t);return f.items.push(n),f}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());const{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:o,sourceObjects:l}=t;let a;if(s&&n&&typeof n=="object"){if(a=l.get(n),a)return a.anchor??(a.anchor=i(n)),new tt(a.anchor);a={anchor:null,node:null},l.set(n,a)}e?.startsWith("!!")&&(e=ms+e.slice(2));let c=gs(n,e,o.tags);if(!c){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){const f=new O(n);return a&&(a.node=f),f}c=n instanceof Map?o[J]:Symbol.iterator in Object(n)?o[oe]:o[J]}r&&(r(c),delete t.onTagObj);const d=c?.createNode?c.createNode(t.schema,n,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,n,t):new O(n);return e?d.tag=e:c.default||(d.tag=c.tag),a&&(a.node=d),d}function $e(n,e,t){let s=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]=s,s=o}else s=new Map([[r,s]])}return pe(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}const ue=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done;class vt extends et{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(s=>L(s)||$(s)?s.clone(e):s),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(ue(e))this.add(t);else{const[s,...i]=e,r=this.get(s,!0);if(E(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(s,$e(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(e){const[t,...s]=e;if(s.length===0)return this.delete(t);const i=this.get(t,!0);if(E(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){const[s,...i]=e,r=this.get(s,!0);return i.length===0?!t&&T(r)?r.value:r:E(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!$(t))return!1;const s=t.value;return s==null||e&&T(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){const[t,...s]=e;if(s.length===0)return this.has(t);const i=this.get(t,!0);return E(i)?i.hasIn(s):!1}setIn(e,t){const[s,...i]=e;if(i.length===0)this.set(s,t);else{const r=this.get(s,!0);if(E(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(s,$e(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}}const ys=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function F(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}const G=(n,e,t)=>n.endsWith(`
|
|
3
|
+
`)?F(t,e):t.includes(`
|
|
4
|
+
`)?`
|
|
5
|
+
`+F(t,e):(n.endsWith(" ")?"":" ")+t,Bt="flow",He="block",Ee="quoted";function ve(n,e,t="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return n;i<r&&(r=0);const a=Math.max(1+r,1+i-e.length);if(n.length<=a)return n;const c=[],d={};let f=i-e.length;typeof s=="number"&&(s>i-Math.max(2,r)?c.push(0):f=i-s);let u,m,g=!1,h=-1,p=-1,b=-1;t===He&&(h=mt(n,h,e.length),h!==-1&&(f=h+a));for(let k;k=n[h+=1];){if(t===Ee&&k==="\\"){switch(p=h,n[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}b=h}if(k===`
|
|
6
|
+
`)t===He&&(h=mt(n,h,e.length)),f=h+e.length+a,u=void 0;else{if(k===" "&&m&&m!==" "&&m!==`
|
|
7
|
+
`&&m!==" "){const S=n[h+1];S&&S!==" "&&S!==`
|
|
8
|
+
`&&S!==" "&&(u=h)}if(h>=f)if(u)c.push(u),f=u+a,u=void 0;else if(t===Ee){for(;m===" "||m===" ";)m=k,k=n[h+=1],g=!0;const S=h>b+1?h-2:p-1;if(d[S])return n;c.push(S),d[S]=!0,f=S+a,u=void 0}else g=!0}m=k}if(g&&l&&l(),c.length===0)return n;o&&o();let w=n.slice(0,c[0]);for(let k=0;k<c.length;++k){const S=c[k],N=c[k+1]||n.length;S===0?w=`
|
|
9
|
+
${e}${n.slice(0,N)}`:(t===Ee&&d[S]&&(w+=`${n[S]}\\`),w+=`
|
|
10
|
+
${e}${n.slice(S+1,N)}`)}return w}function mt(n,e,t){let s=e,i=e+1,r=n[i];for(;r===" "||r===" ";)if(e<i+t)r=n[++e];else{do r=n[++e];while(r&&r!==`
|
|
11
|
+
`);s=e,i=e+1,r=n[i]}return s}const Be=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),Me=n=>/^(%|---|\.\.\.)/m.test(n);function bs(n,e,t){if(!e||e<0)return!1;const s=e-t,i=n.length;if(i<=s)return!1;for(let r=0,o=0;r<i;++r)if(n[r]===`
|
|
12
|
+
`){if(r-o>s)return!0;if(o=r+1,i-o<=s)return!1}return!0}function de(n,e){const t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:s}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(Me(n)?" ":"");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 d=t.substr(a+2,4);switch(d){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:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=t.substr(a,6)}a+=5,l=a+1}break;case"n":if(s||t[a+2]==='"'||t.length<i)a+=1;else{for(o+=t.slice(l,a)+`
|
|
13
|
+
|
|
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,s?o:ve(o,r,Ee,Be(e,!1))}function We(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
|
|
16
|
+
`)||/[ \t]\n|\n[ \t]/.test(n))return de(n,e);const t=e.indent||(Me(n)?" ":""),s="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
17
|
+
${t}`)+"'";return e.implicitKey?s:ve(s,t,Bt,Be(e,!1))}function te(n,e){const{singleQuote:t}=e.options;let s;if(t===!1)s=de;else{const i=n.includes('"'),r=n.includes("'");i&&!r?s=We:r&&!i?s=de:s=t?We:de}return s(n,e)}let Xe;try{Xe=new RegExp(`(^|(?<!
|
|
18
|
+
))
|
|
19
|
+
+(?!
|
|
20
|
+
|$)`,"g")}catch{Xe=/\n+(?!\n|$)/g}function Le({comment:n,type:e,value:t},s,i,r){const{blockQuote:o,commentString:l,lineWidth:a}=s.options;if(!o||/\n[\t ]+$/.test(t))return te(t,s);const c=s.indent||(s.forceBlockIndent||Me(t)?" ":""),d=o==="literal"?!0:o==="folded"||e===O.BLOCK_FOLDED?!1:e===O.BLOCK_LITERAL?!0:!bs(t,a,c.length);if(!t)return d?`|
|
|
21
|
+
`:`>
|
|
22
|
+
`;let f,u;for(u=t.length;u>0;--u){const N=t[u-1];if(N!==`
|
|
23
|
+
`&&N!==" "&&N!==" ")break}let m=t.substring(u);const g=m.indexOf(`
|
|
24
|
+
`);g===-1?f="-":t===m||g!==m.length-1?(f="+",r&&r()):f="",m&&(t=t.slice(0,-m.length),m[m.length-1]===`
|
|
25
|
+
`&&(m=m.slice(0,-1)),m=m.replace(Xe,`$&${c}`));let h=!1,p,b=-1;for(p=0;p<t.length;++p){const N=t[p];if(N===" ")h=!0;else if(N===`
|
|
26
|
+
`)b=p;else break}let w=t.substring(0,b<p?b+1:p);w&&(t=t.substring(w.length),w=w.replace(/\n+/g,`$&${c}`));let S=(h?c?"2":"1":"")+f;if(n&&(S+=" "+l(n.replace(/ ?[\r\n]+/g," ")),i&&i()),!d){const N=t.replace(/\n+/g,`
|
|
27
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let A=!1;const I=Be(s,!0);o!=="folded"&&e!==O.BLOCK_FOLDED&&(I.onOverflow=()=>{A=!0});const y=ve(`${w}${N}${m}`,c,He,I);if(!A)return`>${S}
|
|
28
|
+
${c}${y}`}return t=t.replace(/\n+/g,`$&${c}`),`|${S}
|
|
29
|
+
${c}${w}${t}${m}`}function ws(n,e,t,s){const{type:i,value:r}=n,{actualString:o,implicitKey:l,indent:a,indentStep:c,inFlow:d}=e;if(l&&r.includes(`
|
|
30
|
+
`)||d&&/[[\]{},]/.test(r))return te(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return l||d||!r.includes(`
|
|
31
|
+
`)?te(r,e):Le(n,e,t,s);if(!l&&!d&&i!==O.PLAIN&&r.includes(`
|
|
32
|
+
`))return Le(n,e,t,s);if(Me(r)){if(a==="")return e.forceBlockIndent=!0,Le(n,e,t,s);if(l&&a===c)return te(r,e)}const f=r.replace(/\n+/g,`$&
|
|
33
|
+
${a}`);if(o){const u=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(f),{compat:m,tags:g}=e.doc.schema;if(g.some(u)||m?.some(u))return te(r,e)}return l?f:ve(f,a,Bt,Be(e,!1))}function st(n,e,t,s){const{implicitKey:i,inFlow:r}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)});let{type:l}=n;l!==O.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=O.QUOTE_DOUBLE);const a=d=>{switch(d){case O.BLOCK_FOLDED:case O.BLOCK_LITERAL:return i||r?te(o.value,e):Le(o,e,t,s);case O.QUOTE_DOUBLE:return de(o.value,e);case O.QUOTE_SINGLE:return We(o.value,e);case O.PLAIN:return ws(o,e,t,s);default:return null}};let c=a(l);if(c===null){const{defaultKeyType:d,defaultStringType:f}=e.options,u=i&&d||f;if(c=a(u),c===null)throw new Error(`Unsupported default string type ${u}`)}return c}function Mt(n,e){const t=Object.assign({blockQuote:!0,commentString:ys,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},n.schema.toStringOptions,e);let s;switch(t.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:s,options:t}}function ks(n,e){if(e.tag){const i=n.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let t,s;if(T(e)){s=e.value;let i=n.filter(r=>r.identify?.(s));if(i.length>1){const r=i.filter(o=>o.test);r.length>0&&(i=r)}t=i.find(r=>r.format===e.format)??i.find(r=>!r.format)}else s=e,t=n.find(i=>i.nodeClass&&s instanceof i.nodeClass);if(!t){const i=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${i} value`)}return t}function Ss(n,e,{anchors:t,doc:s}){if(!s.directives)return"";const i=[],r=(T(n)||E(n))&&n.anchor;r&&Lt(r)&&(t.add(r),i.push(`&${r}`));const o=n.tag??(e.default?null:e.tag);return o&&i.push(s.directives.tagString(o)),i.join(" ")}function ie(n,e,t,s){if($(n))return n.toString(e,t,s);if(W(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let i;const r=L(n)?n:e.doc.createNode(n,{onTagObj:a=>i=a});i??(i=ks(e.doc.schema.tags,r));const o=Ss(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const l=typeof i.stringify=="function"?i.stringify(r,e,t,s):T(r)?st(r,e,t,s):r.toString(e,t,s);return o?T(r)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
|
|
34
|
+
${e.indent}${l}`:l}function Ns({key:n,value:e},t,s,i){const{allNullValues:r,doc:o,indent:l,indentStep:a,options:{commentString:c,indentSeq:d,simpleKeys:f}}=t;let u=L(n)&&n.comment||null;if(f){if(u)throw new Error("With simple keys, key nodes cannot have comments");if(E(n)||!L(n)&&typeof n=="object"){const I="With simple keys, collection cannot be used as a key value";throw new Error(I)}}let m=!f&&(!n||u&&e==null&&!t.inFlow||E(n)||(T(n)?n.type===O.BLOCK_FOLDED||n.type===O.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(f||!r),indent:l+a});let g=!1,h=!1,p=ie(n,t,()=>g=!0,()=>h=!0);if(!m&&!t.inFlow&&p.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 g&&s&&s(),p===""?"?":m?`? ${p}`:p}else if(r&&!f||e==null&&m)return p=`? ${p}`,u&&!g?p+=G(p,t.indent,c(u)):h&&i&&i(),p;g&&(u=null),m?(u&&(p+=G(p,t.indent,c(u))),p=`? ${p}
|
|
35
|
+
${l}:`):(p=`${p}:`,u&&(p+=G(p,t.indent,c(u))));let b,w,k;L(e)?(b=!!e.spaceBefore,w=e.commentBefore,k=e.comment):(b=!1,w=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!m&&!u&&T(e)&&(t.indentAtStart=p.length+1),h=!1,!d&&a.length>=2&&!t.inFlow&&!m&&ye(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let S=!1;const N=ie(e,t,()=>S=!0,()=>h=!0);let A=" ";if(u||b||w){if(A=b?`
|
|
36
|
+
`:"",w){const I=c(w);A+=`
|
|
37
|
+
${F(I,t.indent)}`}N===""&&!t.inFlow?A===`
|
|
38
|
+
`&&k&&(A=`
|
|
39
|
+
|
|
40
|
+
`):A+=`
|
|
41
|
+
${t.indent}`}else if(!m&&E(e)){const I=N[0],y=N.indexOf(`
|
|
42
|
+
`),C=y!==-1,R=t.inFlow??e.flow??e.items.length===0;if(C||!R){let X=!1;if(C&&(I==="&"||I==="!")){let _=N.indexOf(" ");I==="&"&&_!==-1&&_<y&&N[_+1]==="!"&&(_=N.indexOf(" ",_+1)),(_===-1||y<_)&&(X=!0)}X||(A=`
|
|
43
|
+
${t.indent}`)}}else(N===""||N[0]===`
|
|
44
|
+
`)&&(A="");return p+=A+N,t.inFlow?S&&s&&s():k&&!S?p+=G(p,t.indent,c(k)):h&&i&&i(),p}function Os(n,e){(n==="debug"||n==="warn")&&console.warn(e)}const ke="<<",U={identify:n=>n===ke||typeof n=="symbol"&&n.description===ke,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new O(Symbol(ke)),{addToJSMap:Kt}),stringify:()=>ke},As=(n,e)=>(U.identify(e)||T(e)&&(!e.type||e.type===O.PLAIN)&&U.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===U.tag&&t.default);function Kt(n,e,t){if(t=n&&W(t)?t.resolve(n.doc):t,ye(t))for(const s of t.items)Ue(n,e,s);else if(Array.isArray(t))for(const s of t)Ue(n,e,s);else Ue(n,e,t)}function Ue(n,e,t){const s=n&&W(t)?t.resolve(n.doc):t;if(!ge(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,n,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 Pt(n,e,{key:t,value:s}){if(L(t)&&t.addToJSMap)t.addToJSMap(n,e,s);else if(As(n,t))Kt(n,e,s);else{const i=K(t,"",n);if(e instanceof Map)e.set(i,K(s,i,n));else if(e instanceof Set)e.add(i);else{const r=Is(t,i,n),o=K(s,r,n);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}function Is(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(L(n)&&t?.doc){const s=Mt(t.doc,{});s.anchors=new Set;for(const r of t.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;const i=n.toString(s);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),Os(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 nt(n,e,t){const s=pe(n,void 0,t),i=pe(e,void 0,t);return new B(s,i)}class B{constructor(e,t=null){Object.defineProperty(this,P,{value:Tt}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;return L(t)&&(t=t.clone(e)),L(s)&&(s=s.clone(e)),new B(t,s)}toJSON(e,t){const s=t?.mapAsMap?new Map:{};return Pt(t,s,this)}toString(e,t,s){return e?.doc?Ns(this,e,t,s):JSON.stringify(this)}}function jt(n,e,t){return(e.inFlow??n.flow?Es:Ts)(n,e,t)}function Ts({comment:n,items:e},t,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:o,onComment:l}){const{indent:a,options:{commentString:c}}=t,d=Object.assign({},t,{indent:r,type:null});let f=!1;const u=[];for(let g=0;g<e.length;++g){const h=e[g];let p=null;if(L(h))!f&&h.spaceBefore&&u.push(""),Ce(t,u,h.commentBefore,f),h.comment&&(p=h.comment);else if($(h)){const w=L(h.key)?h.key:null;w&&(!f&&w.spaceBefore&&u.push(""),Ce(t,u,w.commentBefore,f))}f=!1;let b=ie(h,d,()=>p=null,()=>f=!0);p&&(b+=G(b,r,c(p))),f&&p&&(f=!1),u.push(s+b)}let m;if(u.length===0)m=i.start+i.end;else{m=u[0];for(let g=1;g<u.length;++g){const h=u[g];m+=h?`
|
|
45
|
+
${a}${h}`:`
|
|
46
|
+
`}}return n?(m+=`
|
|
47
|
+
`+F(c(n),a),l&&l()):f&&o&&o(),m}function Es({items:n},e,{flowChars:t,itemIndent:s}){const{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:l}}=e;s+=r;const a=Object.assign({},e,{indent:s,inFlow:!0,type:null});let c=!1,d=0;const f=[];for(let g=0;g<n.length;++g){const h=n[g];let p=null;if(L(h))h.spaceBefore&&f.push(""),Ce(e,f,h.commentBefore,!1),h.comment&&(p=h.comment);else if($(h)){const w=L(h.key)?h.key:null;w&&(w.spaceBefore&&f.push(""),Ce(e,f,w.commentBefore,!1),w.comment&&(c=!0));const k=L(h.value)?h.value:null;k?(k.comment&&(p=k.comment),k.commentBefore&&(c=!0)):h.value==null&&w?.comment&&(p=w.comment)}p&&(c=!0);let b=ie(h,a,()=>p=null);g<n.length-1&&(b+=","),p&&(b+=G(b,s,l(p))),!c&&(f.length>d||b.includes(`
|
|
48
|
+
`))&&(c=!0),f.push(b),d=f.length}const{start:u,end:m}=t;if(f.length===0)return u+m;if(!c){const g=f.reduce((h,p)=>h+p.length+2,2);c=e.options.lineWidth>0&&g>e.options.lineWidth}if(c){let g=u;for(const h of f)g+=h?`
|
|
49
|
+
${r}${i}${h}`:`
|
|
50
|
+
`;return`${g}
|
|
51
|
+
${i}${m}`}else return`${u}${o}${f.join(" ")}${o}${m}`}function Ce({indent:n,options:{commentString:e}},t,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const r=F(e(s),n);t.push(r.trimStart())}}function Q(n,e){const t=T(e)?e.value:e;for(const s of n)if($(s)&&(s.key===e||s.key===t||T(s.key)&&s.key.value===t))return s}class M extends vt{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(J,e),this.items=[]}static from(e,t,s){const{keepUndefined:i,replacer:r}=s,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(nt(a,c,s))};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){let s;$(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new B(e,e?.value):s=new B(e.key,e.value);const i=Q(this.items,s.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${s.key} already set`);T(i.value)&&_t(s.value)?i.value.value=s.value:i.value=s.value}else if(r){const o=this.items.findIndex(l=>r(s,l)<0);o===-1?this.items.push(s):this.items.splice(o,0,s)}else this.items.push(s)}delete(e){const t=Q(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){const i=Q(this.items,e)?.value;return(!t&&T(i)?i.value:i)??void 0}has(e){return!!Q(this.items,e)}set(e,t){this.add(new B(e,t),!0)}toJSON(e,t,s){const i=s?new s:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(const r of this.items)Pt(t,i,r);return i}toString(e,t,s){if(!e)return JSON.stringify(this);for(const i of this.items)if(!$(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})),jt(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}}const ae={collection:"map",default:!0,nodeClass:M,tag:"tag:yaml.org,2002:map",resolve(n,e){return ge(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>M.from(n,e,t)};class H extends vt{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(oe,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=Se(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const s=Se(e);if(typeof s!="number")return;const i=this.items[s];return!t&&T(i)?i.value:i}has(e){const t=Se(e);return typeof t=="number"&&t<this.items.length}set(e,t){const s=Se(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[s];T(i)&&_t(t)?i.value=t:this.items[s]=t}toJSON(e,t){const s=[];t?.onCreate&&t.onCreate(s);let i=0;for(const r of this.items)s.push(K(r,String(i++),t));return s}toString(e,t,s){return e?jt(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:t}):JSON.stringify(this)}static from(e,t,s){const{replacer:i}=s,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(pe(l,void 0,s))}}return r}}function Se(n){let e=T(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const ce={collection:"seq",default:!0,nodeClass:H,tag:"tag:yaml.org,2002:seq",resolve(n,e){return ye(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>H.from(n,e,t)},Ke={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,s){return e=Object.assign({actualString:!0},e),st(n,e,t,s)}},Pe={identify:n=>n==null,createNode:()=>new O(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new O(null),stringify:({source:n},e)=>typeof n=="string"&&Pe.test.test(n)?n:e.options.nullStr},it={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new O(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&it.test.test(n)){const s=n[0]==="t"||n[0]==="T";if(e===s)return n}return e?t.options.trueStr:t.options.falseStr}};function D({format:n,minFractionDigits:e,tag:t,value:s}){if(typeof s=="bigint")return String(s);const i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!n&&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 Dt={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:D},qt={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():D(n)}},Ft={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){const e=new O(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:D},je=n=>typeof n=="bigint"||Number.isInteger(n),rt=(n,e,t,{intAsBigInt:s})=>s?BigInt(n):parseInt(n.substring(e),t);function Ut(n,e,t){const{value:s}=n;return je(s)&&s>=0?t+s.toString(e):D(n)}const Rt={identify:n=>je(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>rt(n,2,8,t),stringify:n=>Ut(n,8,"0o")},Vt={identify:je,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>rt(n,0,10,t),stringify:D},Jt={identify:n=>je(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>rt(n,2,16,t),stringify:n=>Ut(n,16,"0x")},Ls=[ae,ce,Ke,Pe,it,Rt,Vt,Jt,Dt,qt,Ft];function gt(n){return typeof n=="bigint"||Number.isInteger(n)}const Ne=({value:n})=>JSON.stringify(n),$s=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:Ne},{identify:n=>n==null,createNode:()=>new O(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ne},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:Ne},{identify:gt,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>gt(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:Ne}],Cs={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},_s=[ae,ce].concat($s,Cs),ot={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof atob=="function"){const t=atob(n.replace(/[\n\r]/g,"")),s=new Uint8Array(t.length);for(let i=0;i<t.length;++i)s[i]=t.charCodeAt(i);return s}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},s,i,r){if(!t)return"";const o=t;let l;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=O.BLOCK_LITERAL),e!==O.QUOTE_DOUBLE){const a=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),c=Math.ceil(l.length/a),d=new Array(c);for(let f=0,u=0;f<c;++f,u+=a)d[f]=l.substr(u,a);l=d.join(e===O.BLOCK_LITERAL?`
|
|
52
|
+
`:" ")}return st({comment:n,type:e,value:l},s,i,r)}};function Yt(n,e){if(ye(n))for(let t=0;t<n.items.length;++t){let s=n.items[t];if(!$(s)){if(ge(s)){s.items.length>1&&e("Each pair must have its own sequence indicator");const i=s.items[0]||new B(new O(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore}
|
|
53
|
+
${i.key.commentBefore}`:s.commentBefore),s.comment){const r=i.value??i.key;r.comment=r.comment?`${s.comment}
|
|
54
|
+
${r.comment}`:s.comment}s=i}n.items[t]=$(s)?s:new B(s)}}else e("Expected a sequence for this tag");return n}function Gt(n,e,t){const{replacer:s}=t,i=new H(n);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.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(nt(l,a,t))}return i}const lt={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Yt,createNode:Gt};class se extends H{constructor(){super(),this.add=M.prototype.add.bind(this),this.delete=M.prototype.delete.bind(this),this.get=M.prototype.get.bind(this),this.has=M.prototype.has.bind(this),this.set=M.prototype.set.bind(this),this.tag=se.tag}toJSON(e,t){if(!t)return super.toJSON(e);const s=new Map;t?.onCreate&&t.onCreate(s);for(const i of this.items){let r,o;if($(i)?(r=K(i.key,"",t),o=K(i.value,r,t)):r=K(i,"",t),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,o)}return s}static from(e,t,s){const i=Gt(e,t,s),r=new this;return r.items=i.items,r}}se.tag="tag:yaml.org,2002:omap";const at={collection:"seq",identify:n=>n instanceof Map,nodeClass:se,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){const t=Yt(n,e),s=[];for(const{key:i}of t.items)T(i)&&(s.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new se,t)},createNode:(n,e,t)=>se.from(n,e,t)};function Qt({value:n,source:e},t){return e&&(n?Ht:Wt).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}const Ht={identify:n=>n===!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:Qt},Wt={identify:n=>n===!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:Qt},vs={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:D},Bs={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():D(n)}},Ms={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){const e=new O(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){const s=n.substring(t+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:D},be=n=>typeof n=="bigint"||Number.isInteger(n);function De(n,e,t,{intAsBigInt:s}){const i=n[0];if((i==="-"||i==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),s){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}const o=BigInt(n);return i==="-"?BigInt(-1)*o:o}const r=parseInt(n,t);return i==="-"?-1*r:r}function ct(n,e,t){const{value:s}=n;if(be(s)){const i=s.toString(e);return s<0?"-"+t+i.substr(1):t+i}return D(n)}const Ks={identify:be,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>De(n,2,2,t),stringify:n=>ct(n,2,"0b")},Ps={identify:be,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>De(n,1,8,t),stringify:n=>ct(n,8,"0")},js={identify:be,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>De(n,0,10,t),stringify:D},Ds={identify:be,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>De(n,2,16,t),stringify:n=>ct(n,16,"0x")};class ne extends M{constructor(e){super(e),this.tag=ne.tag}add(e){let t;$(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new B(e.key,null):t=new B(e,null),Q(this.items,t.key)||this.items.push(t)}get(e,t){const s=Q(this.items,e);return!t&&$(s)?T(s.key)?s.key.value:s.key:s}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 s=Q(this.items,e);s&&!t?this.items.splice(this.items.indexOf(s),1):!s&&t&&this.items.push(new B(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);throw new Error("Set items must all have null values")}static from(e,t,s){const{replacer:i}=s,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(nt(o,null,s));return r}}ne.tag="tag:yaml.org,2002:set";const ft={collection:"map",identify:n=>n instanceof Set,nodeClass:ne,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>ne.from(n,e,t),resolve(n,e){if(ge(n)){if(n.hasAllNullValues(!0))return Object.assign(new ne,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};function ut(n,e){const t=n[0],s=t==="-"||t==="+"?n.substring(1):n,i=o=>e?BigInt(o):Number(o),r=s.replace(/_/g,"").split(":").reduce((o,l)=>o*i(60)+i(l),i(0));return t==="-"?i(-1)*r:r}function Xt(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return D(n);let s="";e<0&&(s="-",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))),s+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const zt={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>ut(n,t),stringify:Xt},xt={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>ut(n,!1),stringify:Xt},qe={identify:n=>n 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(n){const e=n.match(qe.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,s,i,r,o,l]=e.map(Number),a=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(t,s-1,i,r||0,o||0,l||0,a);const d=e[8];if(d&&d!=="Z"){let f=ut(d,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:n})=>n?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},yt=[ae,ce,Ke,Pe,Ht,Wt,Ks,Ps,js,Ds,vs,Bs,Ms,ot,U,at,lt,ft,zt,xt,qe],bt=new Map([["core",Ls],["failsafe",[ae,ce,Ke]],["json",_s],["yaml11",yt],["yaml-1.1",yt]]),wt={binary:ot,bool:it,float:Ft,floatExp:qt,floatNaN:Dt,floatTime:xt,int:Vt,intHex:Jt,intOct:Rt,intTime:zt,map:ae,merge:U,null:Pe,omap:at,pairs:lt,seq:ce,set:ft,timestamp:qe},qs={"tag:yaml.org,2002:binary":ot,"tag:yaml.org,2002:merge":U,"tag:yaml.org,2002:omap":at,"tag:yaml.org,2002:pairs":lt,"tag:yaml.org,2002:set":ft,"tag:yaml.org,2002:timestamp":qe};function Re(n,e,t){const s=bt.get(e);if(s&&!n)return t&&!s.includes(U)?s.concat(U):s.slice();let i=s;if(!i)if(Array.isArray(n))i=[];else{const r=Array.from(bt.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(n))for(const r of n)i=i.concat(r);else typeof n=="function"&&(i=n(i.slice()));return t&&(i=i.concat(U)),i.reduce((r,o)=>{const l=typeof o=="string"?wt[o]:o;if(!l){const a=JSON.stringify(o),c=Object.keys(wt).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${a}; use one of ${c}`)}return r.includes(l)||r.push(l),r},[])}const Fs=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0;class ht{constructor({compat:e,customTags:t,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?Re(e,"compat"):e?Re(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?qs:{},this.tags=Re(t,this.name,s),this.toStringOptions=l??null,Object.defineProperty(this,J,{value:ae}),Object.defineProperty(this,q,{value:Ke}),Object.defineProperty(this,oe,{value:ce}),this.sortMapEntries=typeof o=="function"?o:o===!0?Fs:null}clone(){const e=Object.create(ht.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function Us(n,e){const t=[];let s=e.directives===!0;if(e.directives!==!1&&n.directives){const a=n.directives.toString(n);a?(t.push(a),s=!0):n.directives.docStart&&(s=!0)}s&&t.push("---");const i=Mt(n,e),{commentString:r}=i.options;if(n.commentBefore){t.length!==1&&t.unshift("");const a=r(n.commentBefore);t.unshift(F(a,""))}let o=!1,l=null;if(n.contents){if(L(n.contents)){if(n.contents.spaceBefore&&s&&t.push(""),n.contents.commentBefore){const d=r(n.contents.commentBefore);t.push(F(d,""))}i.forceBlockIndent=!!n.comment,l=n.contents.comment}const a=l?void 0:()=>o=!0;let c=ie(n.contents,i,()=>l=null,a);l&&(c+=G(c,"",r(l))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(ie(n.contents,i));if(n.directives?.docEnd)if(n.comment){const a=r(n.comment);a.includes(`
|
|
55
|
+
`)?(t.push("..."),t.push(F(a,""))):t.push(`... ${a}`)}else t.push("...");else{let a=n.comment;a&&o&&(a=a.replace(/^\n+/,"")),a&&((!o||l)&&t[t.length-1]!==""&&t.push(""),t.push(F(r(a),"")))}return t.join(`
|
|
56
|
+
`)+`
|
|
57
|
+
`}class Fe{constructor(e,t,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,P,{value:Qe});let i=null;typeof t=="function"||Array.isArray(t)?i=t:s===void 0&&t&&(s=t,t=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:o}=r;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new v({version:o}),this.setSchema(o,s),this.contents=e===void 0?null:this.createNode(e,i,s)}clone(){const e=Object.create(Fe.prototype,{[P]:{value:Qe}});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=L(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){z(this.contents)&&this.contents.add(e)}addIn(e,t){z(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const s=$t(this);e.anchor=!t||s.has(t)?Ct(t||"a",s):t}return new tt(e.anchor)}createNode(e,t,s){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){const p=w=>typeof w=="number"||w instanceof String||w instanceof Number,b=t.filter(p).map(String);b.length>0&&(t=t.concat(b)),i=t}else s===void 0&&t&&(s=t,t=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:l,keepUndefined:a,onTagObj:c,tag:d}=s??{},{onAnchor:f,setAnchors:u,sourceObjects:m}=ps(this,o||"a"),g={aliasDuplicateObjects:r??!0,keepUndefined:a??!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:m},h=pe(e,d,g);return l&&E(h)&&(h.flow=!0),u(),h}createPair(e,t,s={}){const i=this.createNode(e,null,s),r=this.createNode(t,null,s);return new B(i,r)}delete(e){return z(this.contents)?this.contents.delete(e):!1}deleteIn(e){return ue(e)?this.contents==null?!1:(this.contents=null,!0):z(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return E(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return ue(e)?!t&&T(this.contents)?this.contents.value:this.contents:E(this.contents)?this.contents.getIn(e,t):void 0}has(e){return E(this.contents)?this.contents.has(e):!1}hasIn(e){return ue(e)?this.contents!==void 0:E(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=$e(this.schema,[e],t):z(this.contents)&&this.contents.set(e,t)}setIn(e,t){ue(e)?this.contents=t:this.contents==null?this.contents=$e(this.schema,Array.from(e),t):z(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new v({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new v({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=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(s)this.schema=new ht(Object.assign(s,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:i,onAnchor:r,reviver:o}={}){const l={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=K(this.contents,t??"",l);if(typeof r=="function")for(const{count:c,res:d}of l.anchors.values())r(d,c);return typeof o=="function"?ee(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 Us(this,e)}}function z(n){if(E(n))return!0;throw new Error("Expected a YAML collection as document contents")}class Zt extends Error{constructor(e,t,s,i){super(),this.name=e,this.code=s,this.message=i,this.pos=t}}class Oe extends Zt{constructor(e,t,s){super("YAMLParseError",e,t,s)}}class Rs extends Zt{constructor(e,t,s){super("YAMLWarning",e,t,s)}}const kt=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(l=>e.linePos(l));const{line:s,col:i}=t.linePos[0];t.message+=` at line ${s}, column ${i}`;let r=i-1,o=n.substring(e.lineStarts[s-1],e.lineStarts[s]).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)+"…"),s>1&&/^ *$/.test(o.substring(0,r))){let l=n.substring(e.lineStarts[s-2],e.lineStarts[s-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?.line===s&&a.col>i&&(l=Math.max(1,Math.min(a.col-i,80-r)));const c=" ".repeat(r)+"^".repeat(l);t.message+=`:
|
|
59
|
+
|
|
60
|
+
${o}
|
|
61
|
+
${c}
|
|
62
|
+
`}};function re(n,{flow:e,indicator:t,next:s,offset:i,onError:r,parentIndent:o,startOnNewline:l}){let a=!1,c=l,d=l,f="",u="",m=!1,g=!1,h=null,p=null,b=null,w=null,k=null,S=null,N=null;for(const y of n)switch(g&&(y.type!=="space"&&y.type!=="newline"&&y.type!=="comma"&&r(y.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),h&&(c&&y.type!=="comment"&&y.type!=="newline"&&r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),y.type){case"space":!e&&(t!=="doc-start"||s?.type!=="flow-collection")&&y.source.includes(" ")&&(h=y),d=!0;break;case"comment":{d||r(y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const C=y.source.substring(1)||" ";f?f+=u+C:f=C,u="",c=!1;break}case"newline":c?f?f+=y.source:(!S||t!=="seq-item-ind")&&(a=!0):u+=y.source,c=!0,m=!0,(p||b)&&(w=y),d=!0;break;case"anchor":p&&r(y,"MULTIPLE_ANCHORS","A node can have at most one anchor"),y.source.endsWith(":")&&r(y.offset+y.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),p=y,N??(N=y.offset),c=!1,d=!1,g=!0;break;case"tag":{b&&r(y,"MULTIPLE_TAGS","A node can have at most one tag"),b=y,N??(N=y.offset),c=!1,d=!1,g=!0;break}case t:(p||b)&&r(y,"BAD_PROP_ORDER",`Anchors and tags must be after the ${y.source} indicator`),S&&r(y,"UNEXPECTED_TOKEN",`Unexpected ${y.source} in ${e??"collection"}`),S=y,c=t==="seq-item-ind"||t==="explicit-key-ind",d=!1;break;case"comma":if(e){k&&r(y,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=y,c=!1,d=!1;break}default:r(y,"UNEXPECTED_TOKEN",`Unexpected ${y.type} token`),c=!1,d=!1}const A=n[n.length-1],I=A?A.offset+A.source.length:i;return g&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(c&&h.indent<=o||s?.type==="block-map"||s?.type==="block-seq")&&r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:S,spaceBefore:a,comment:f,hasNewline:m,anchor:p,tag:b,newlineAfterProp:w,end:I,start:N??I}}function me(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
|
|
63
|
+
`))return!0;if(n.end){for(const e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of n.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(me(e.key)||me(e.value))return!0}return!1;default:return!0}}function ze(n,e,t){if(e?.type==="flow-collection"){const s=e.end[0];s.indent===n&&(s.source==="]"||s.source==="}")&&me(e)&&t(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function es(n,e,t){const{uniqueKeys:s}=n.options;if(s===!1)return!1;const i=typeof s=="function"?s:(r,o)=>r===o||T(r)&&T(o)&&r.value===o.value;return e.some(r=>i(r.key,t))}const St="All mapping items must start at the same column";function Vs({composeNode:n,composeEmptyNode:e},t,s,i,r){const o=r?.nodeClass??M,l=new o(t.schema);t.atRoot&&(t.atRoot=!1);let a=s.offset,c=null;for(const d of s.items){const{start:f,key:u,sep:m,value:g}=d,h=re(f,{indicator:"explicit-key-ind",next:u??m?.[0],offset:a,onError:i,parentIndent:s.indent,startOnNewline:!0}),p=!h.found;if(p){if(u&&(u.type==="block-seq"?i(a,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in u&&u.indent!==s.indent&&i(a,"BAD_INDENT",St)),!h.anchor&&!h.tag&&!m){c=h.end,h.comment&&(l.comment?l.comment+=`
|
|
64
|
+
`+h.comment:l.comment=h.comment);continue}(h.newlineAfterProp||me(u))&&i(u??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==s.indent&&i(a,"BAD_INDENT",St);t.atKey=!0;const b=h.end,w=u?n(t,u,h,i):e(t,b,f,null,h,i);t.schema.compat&&ze(s.indent,u,i),t.atKey=!1,es(t,l.items,w)&&i(b,"DUPLICATE_KEY","Map keys must be unique");const k=re(m??[],{indicator:"map-value-ind",next:g,offset:w.range[2],onError:i,parentIndent:s.indent,startOnNewline:!u||u.type==="block-scalar"});if(a=k.end,k.found){p&&(g?.type==="block-map"&&!k.hasNewline&&i(a,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&h.start<k.found.offset-1024&&i(w.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const S=g?n(t,g,k,i):e(t,a,m,null,k,i);t.schema.compat&&ze(s.indent,g,i),a=S.range[2];const N=new B(w,S);t.options.keepSourceTokens&&(N.srcToken=d),l.items.push(N)}else{p&&i(w.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(w.comment?w.comment+=`
|
|
65
|
+
`+k.comment:w.comment=k.comment);const S=new B(w);t.options.keepSourceTokens&&(S.srcToken=d),l.items.push(S)}}return c&&c<a&&i(c,"IMPOSSIBLE","Map comment with trailing content"),l.range=[s.offset,a,c??a],l}function Js({composeNode:n,composeEmptyNode:e},t,s,i,r){const o=r?.nodeClass??H,l=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let a=s.offset,c=null;for(const{start:d,value:f}of s.items){const u=re(d,{indicator:"seq-item-ind",next:f,offset:a,onError:i,parentIndent:s.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||f)f?.type==="block-seq"?i(u.end,"BAD_INDENT","All sequence items must start at the same column"):i(a,"MISSING_CHAR","Sequence item without - indicator");else{c=u.end,u.comment&&(l.comment=u.comment);continue}const m=f?n(t,f,u,i):e(t,u.end,d,null,u,i);t.schema.compat&&ze(s.indent,f,i),a=m.range[2],l.items.push(m)}return l.range=[s.offset,a,c??a],l}function we(n,e,t,s){let i="";if(n){let r=!1,o="";for(const l of n){const{source:a,type:c}=l;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&s(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const d=a.substring(1)||" ";i?i+=o+d:i=d,o="";break}case"newline":i&&(o+=a),r=!0;break;default:s(l,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=a.length}}return{comment:i,offset:e}}const Ve="Block collections are not allowed within flow collections",Je=n=>n&&(n.type==="block-map"||n.type==="block-seq");function Ys({composeNode:n,composeEmptyNode:e},t,s,i,r){const o=s.start.source==="{",l=o?"flow map":"flow sequence",a=r?.nodeClass??(o?M:H),c=new a(t.schema);c.flow=!0;const d=t.atRoot;d&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=s.offset+s.start.source.length;for(let p=0;p<s.items.length;++p){const b=s.items[p],{start:w,key:k,sep:S,value:N}=b,A=re(w,{flow:l,indicator:"explicit-key-ind",next:k??S?.[0],offset:f,onError:i,parentIndent:s.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!S&&!N){p===0&&A.comma?i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):p<s.items.length-1&&i(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),A.comment&&(c.comment?c.comment+=`
|
|
66
|
+
`+A.comment:c.comment=A.comment),f=A.end;continue}!o&&t.options.strict&&me(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)A.comma&&i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(A.comma||i(A.start,"MISSING_CHAR",`Missing , between ${l} items`),A.comment){let I="";e:for(const y of w)switch(y.type){case"comma":case"space":break;case"comment":I=y.source.substring(1);break e;default:break e}if(I){let y=c.items[c.items.length-1];$(y)&&(y=y.value??y.key),y.comment?y.comment+=`
|
|
67
|
+
`+I:y.comment=I,A.comment=A.comment.substring(I.length+1)}}if(!o&&!S&&!A.found){const I=N?n(t,N,A,i):e(t,A.end,S,null,A,i);c.items.push(I),f=I.range[2],Je(N)&&i(I.range,"BLOCK_IN_FLOW",Ve)}else{t.atKey=!0;const I=A.end,y=k?n(t,k,A,i):e(t,I,w,null,A,i);Je(k)&&i(y.range,"BLOCK_IN_FLOW",Ve),t.atKey=!1;const C=re(S??[],{flow:l,indicator:"map-value-ind",next:N,offset:y.range[2],onError:i,parentIndent:s.indent,startOnNewline:!1});if(C.found){if(!o&&!A.found&&t.options.strict){if(S)for(const _ of S){if(_===C.found)break;if(_.type==="newline"){i(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<C.found.offset-1024&&i(C.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else N&&("source"in N&&N.source?.[0]===":"?i(N,"MISSING_CHAR",`Missing space after : in ${l}`):i(C.start,"MISSING_CHAR",`Missing , or : between ${l} items`));const R=N?n(t,N,C,i):C.found?e(t,C.end,S,null,C,i):null;R?Je(N)&&i(R.range,"BLOCK_IN_FLOW",Ve):C.comment&&(y.comment?y.comment+=`
|
|
68
|
+
`+C.comment:y.comment=C.comment);const X=new B(y,R);if(t.options.keepSourceTokens&&(X.srcToken=b),o){const _=c;es(t,_.items,y)&&i(I,"DUPLICATE_KEY","Map keys must be unique"),_.items.push(X)}else{const _=new M(t.schema);_.flow=!0,_.items.push(X);const pt=(R??y).range;_.range=[y.range[0],pt[1],pt[2]],c.items.push(_)}f=R?R.range[2]:C.end}}const u=o?"}":"]",[m,...g]=s.end;let h=f;if(m?.source===u)h=m.offset+m.source.length;else{const p=l[0].toUpperCase()+l.substring(1),b=d?`${p} must end with a ${u}`:`${p} in block collection must be sufficiently indented and end with a ${u}`;i(f,d?"MISSING_CHAR":"BAD_INDENT",b),m&&m.source.length!==1&&g.unshift(m)}if(g.length>0){const p=we(g,h,t.options.strict,i);p.comment&&(c.comment?c.comment+=`
|
|
69
|
+
`+p.comment:c.comment=p.comment),c.range=[s.offset,h,p.offset]}else c.range=[s.offset,h,h];return c}function Ye(n,e,t,s,i,r){const o=t.type==="block-map"?Vs(n,e,t,s,r):t.type==="block-seq"?Js(n,e,t,s,r):Ys(n,e,t,s,r),l=o.constructor;return i==="!"||i===l.tagName?(o.tag=l.tagName,o):(i&&(o.tag=i),o)}function Gs(n,e,t,s,i){const r=s.tag,o=r?e.directives.tagName(r.source,u=>i(r,"TAG_RESOLVE_FAILED",u)):null;if(t.type==="block-seq"){const{anchor:u,newlineAfterProp:m}=s,g=u&&r?u.offset>r.offset?u:r:u??r;g&&(!m||m.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===M.tagName&&l==="map"||o===H.tagName&&l==="seq")return Ye(n,e,t,i,o);let a=e.schema.tags.find(u=>u.tag===o&&u.collection===l);if(!a){const u=e.schema.knownTags[o];if(u?.collection===l)e.schema.tags.push(Object.assign({},u,{default:!1})),a=u;else return u?i(r,"BAD_COLLECTION_TYPE",`${u.tag} used for ${l} collection, but expects ${u.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ye(n,e,t,i,o)}const c=Ye(n,e,t,i,o,a),d=a.resolve?.(c,u=>i(r,"TAG_RESOLVE_FAILED",u),e.options)??c,f=L(d)?d:new O(d);return f.range=c.range,f.tag=o,a?.format&&(f.format=a.format),f}function Qs(n,e,t){const s=e.offset,i=Hs(e,n.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};const r=i.mode===">"?O.BLOCK_FOLDED:O.BLOCK_LITERAL,o=e.source?Ws(e.source):[];let l=o.length;for(let h=o.length-1;h>=0;--h){const p=o[h][1];if(p===""||p==="\r")l=h;else break}if(l===0){const h=i.chomp==="+"&&o.length>0?`
|
|
70
|
+
`.repeat(Math.max(1,o.length-1)):"";let p=s+i.length;return e.source&&(p+=e.source.length),{value:h,type:r,comment:i.comment,range:[s,p,p]}}let a=e.indent+i.indent,c=e.offset+i.length,d=0;for(let h=0;h<l;++h){const[p,b]=o[h];if(b===""||b==="\r")i.indent===0&&p.length>a&&(a=p.length);else{p.length<a&&t(c+p.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(a=p.length),d=h,a===0&&!n.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=p.length+b.length+1}for(let h=o.length-1;h>=l;--h)o[h][0].length>a&&(l=h+1);let f="",u="",m=!1;for(let h=0;h<d;++h)f+=o[h][0].slice(a)+`
|
|
71
|
+
`;for(let h=d;h<l;++h){let[p,b]=o[h];c+=p.length+b.length+1;const w=b[b.length-1]==="\r";if(w&&(b=b.slice(0,-1)),b&&p.length<a){const S=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-b.length-(w?2:1),"BAD_INDENT",S),p=""}r===O.BLOCK_LITERAL?(f+=u+p.slice(a)+b,u=`
|
|
72
|
+
`):p.length>a||b[0]===" "?(u===" "?u=`
|
|
73
|
+
`:!m&&u===`
|
|
74
|
+
`&&(u=`
|
|
75
|
+
|
|
76
|
+
`),f+=u+p.slice(a)+b,u=`
|
|
77
|
+
`,m=!0):b===""?u===`
|
|
78
|
+
`?f+=`
|
|
79
|
+
`:u=`
|
|
80
|
+
`:(f+=u+b,u=" ",m=!1)}switch(i.chomp){case"-":break;case"+":for(let h=l;h<o.length;++h)f+=`
|
|
81
|
+
`+o[h][0].slice(a);f[f.length-1]!==`
|
|
82
|
+
`&&(f+=`
|
|
83
|
+
`);break;default:f+=`
|
|
84
|
+
`}const g=s+i.length+e.source.length;return{value:f,type:r,comment:i.comment,range:[s,g,g]}}function Hs({offset:n,props:e},t,s){if(e[0].type!=="block-scalar-header")return s(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 u=1;u<i.length;++u){const m=i[u];if(!l&&(m==="-"||m==="+"))l=m;else{const g=Number(m);!o&&g?o=g:a===-1&&(a=n+u)}}a!==-1&&s(a,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,d="",f=i.length;for(let u=1;u<e.length;++u){const m=e[u];switch(m.type){case"space":c=!0;case"newline":f+=m.source.length;break;case"comment":t&&!c&&s(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=m.source.length,d=m.source.substring(1);break;case"error":s(m,"UNEXPECTED_TOKEN",m.message),f+=m.source.length;break;default:{const g=`Unexpected token in block scalar header: ${m.type}`;s(m,"UNEXPECTED_TOKEN",g);const h=m.source;h&&typeof h=="string"&&(f+=h.length)}}}return{mode:r,indent:o,chomp:l,comment:d,length:f}}function Ws(n){const e=n.split(/\n( *)/),t=e[0],s=t.match(/^( *)/),r=[s?.[1]?[s[1],t.slice(s[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}function Xs(n,e,t){const{offset:s,type:i,source:r,end:o}=n;let l,a;const c=(u,m,g)=>t(s+u,m,g);switch(i){case"scalar":l=O.PLAIN,a=zs(r,c);break;case"single-quoted-scalar":l=O.QUOTE_SINGLE,a=xs(r,c);break;case"double-quoted-scalar":l=O.QUOTE_DOUBLE,a=Zs(r,c);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[s,s+r.length,s+r.length]}}const d=s+r.length,f=we(o,d,e,t);return{value:a,type:l,comment:f.comment,range:[s,d,f.offset]}}function zs(n,e){let t="";switch(n[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 ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),ts(n)}function xs(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),ts(n.slice(1,-1)).replace(/''/g,"'")}function ts(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
85
|
+
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
86
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=e.exec(n);if(!s)return n;let i=s[1],r=" ",o=e.lastIndex;for(t.lastIndex=o;s=t.exec(n);)s[1]===""?r===`
|
|
87
|
+
`?i+=r:r=`
|
|
88
|
+
`:(i+=r+s[1],r=" "),o=t.lastIndex;const l=/[ \t]*(.*)/sy;return l.lastIndex=o,s=l.exec(n),i+r+(s?.[1]??"")}function Zs(n,e){let t="";for(let s=1;s<n.length-1;++s){const i=n[s];if(!(i==="\r"&&n[s+1]===`
|
|
89
|
+
`))if(i===`
|
|
90
|
+
`){const{fold:r,offset:o}=en(n,s);t+=r,s=o}else if(i==="\\"){let r=n[++s];const o=tn[r];if(o)t+=o;else if(r===`
|
|
91
|
+
`)for(r=n[s+1];r===" "||r===" ";)r=n[++s+1];else if(r==="\r"&&n[s+1]===`
|
|
92
|
+
`)for(r=n[++s+1];r===" "||r===" ";)r=n[++s+1];else if(r==="x"||r==="u"||r==="U"){const l={x:2,u:4,U:8}[r];t+=sn(n,s+1,l,e),s+=l}else{const l=n.substr(s-1,2);e(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),t+=l}}else if(i===" "||i===" "){const r=s;let o=n[s+1];for(;o===" "||o===" ";)o=n[++s+1];o!==`
|
|
93
|
+
`&&!(o==="\r"&&n[s+2]===`
|
|
94
|
+
`)&&(t+=s>r?n.slice(r,s+1):i)}else t+=i}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function en(n,e){let t="",s=n[e+1];for(;(s===" "||s===" "||s===`
|
|
95
|
+
`||s==="\r")&&!(s==="\r"&&n[e+2]!==`
|
|
96
|
+
`);)s===`
|
|
97
|
+
`&&(t+=`
|
|
98
|
+
`),e+=1,s=n[e+1];return t||(t=" "),{fold:t,offset:e}}const tn={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
99
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function sn(n,e,t,s){const i=n.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const l=n.substr(e-2,t+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}return String.fromCodePoint(o)}function ss(n,e,t,s){const{value:i,type:r,comment:o,range:l}=e.type==="block-scalar"?Qs(n,e,s):Xs(e,n.options.strict,s),a=t?n.directives.tagName(t.source,f=>s(t,"TAG_RESOLVE_FAILED",f)):null;let c;n.options.stringKeys&&n.atKey?c=n.schema[q]:a?c=nn(n.schema,i,a,t,s):e.type==="scalar"?c=rn(n,i,e,s):c=n.schema[q];let d;try{const f=c.resolve(i,u=>s(t??e,"TAG_RESOLVE_FAILED",u),n.options);d=T(f)?f:new O(f)}catch(f){const u=f instanceof Error?f.message:String(f);s(t??e,"TAG_RESOLVE_FAILED",u),d=new O(i)}return d.range=l,d.source=i,r&&(d.type=r),a&&(d.tag=a),c.format&&(d.format=c.format),o&&(d.comment=o),d}function nn(n,e,t,s,i){if(t==="!")return n[q];const r=[];for(const l of n.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)r.push(l);else return l;for(const l of r)if(l.test?.test(e))return l;const o=n.knownTags[t];return o&&!o.collection?(n.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[q])}function rn({atKey:n,directives:e,schema:t},s,i,r){const o=t.tags.find(l=>(l.default===!0||n&&l.default==="key")&&l.test?.test(s))||t[q];if(t.compat){const l=t.compat.find(a=>a.default&&a.test?.test(s))??t[q];if(o.tag!==l.tag){const a=e.tagString(o.tag),c=e.tagString(l.tag),d=`Value may be parsed as either ${a} or ${c}`;r(i,"TAG_RESOLVE_FAILED",d,!0)}}return o}function on(n,e,t){if(e){t??(t=e.length);for(let s=t-1;s>=0;--s){let i=e[s];switch(i.type){case"space":case"comment":case"newline":n-=i.source.length;continue}for(i=e[++s];i?.type==="space";)n+=i.source.length,i=e[++s];break}}return n}const ln={composeNode:ns,composeEmptyNode:dt};function ns(n,e,t,s){const i=n.atKey,{spaceBefore:r,comment:o,anchor:l,tag:a}=t;let c,d=!0;switch(e.type){case"alias":c=an(n,e,s),(l||a)&&s(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":c=ss(n,e,a,s),l&&(c.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=Gs(ln,n,e,t,s),l&&(c.anchor=l.source.substring(1));break;default:{const f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",f),c=dt(n,e.offset,void 0,null,t,s),d=!1}}return l&&c.anchor===""&&s(l,"BAD_ALIAS","Anchor cannot be an empty string"),i&&n.options.stringKeys&&(!T(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&s(a??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),n.options.keepSourceTokens&&d&&(c.srcToken=e),c}function dt(n,e,t,s,{spaceBefore:i,comment:r,anchor:o,tag:l,end:a},c){const d={type:"scalar",offset:on(e,t,s),indent:-1,source:""},f=ss(n,d,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 an({options:n},{offset:e,source:t,end:s},i){const r=new tt(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=we(s,o,n.strict,i);return r.range=[e,o,l.offset],l.comment&&(r.comment=l.comment),r}function cn(n,e,{offset:t,start:s,value:i,end:r},o){const l=Object.assign({_directives:e},n),a=new Fe(void 0,l),c={atKey:!1,atRoot:!0,directives:a.directives,options:a.options,schema:a.schema},d=re(s,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(a.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),a.contents=i?ns(c,i,d,o):dt(c,d.end,s,null,d,o);const f=a.contents.range[2],u=we(r,f,!1,o);return u.comment&&(a.comment=u.comment),a.range=[t,f,u.offset],a}function fe(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];const{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function Nt(n){let e="",t=!1,s=!1;for(let i=0;i<n.length;++i){const r=n[i];switch(r[0]){case"#":e+=(e===""?"":s?`
|
|
100
|
+
|
|
101
|
+
`:`
|
|
102
|
+
`)+(r.substring(1)||" "),t=!0,s=!1;break;case"%":n[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(s=!0),t=!1}}return{comment:e,afterEmptyLine:s}}class fn{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,s,i,r)=>{const o=fe(t);r?this.warnings.push(new Rs(o,s,i)):this.errors.push(new Oe(o,s,i))},this.directives=new v({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:s,afterEmptyLine:i}=Nt(this.prelude);if(s){const r=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
103
|
+
${s}`:s;else if(i||e.directives.docStart||!r)e.commentBefore=s;else if(E(r)&&!r.flow&&r.items.length>0){let o=r.items[0];$(o)&&(o=o.key);const l=o.commentBefore;o.commentBefore=l?`${s}
|
|
104
|
+
${l}`:s}else{const o=r.commentBefore;r.commentBefore=o?`${s}
|
|
105
|
+
${o}`:s}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Nt(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(const i of e)yield*this.next(i);yield*this.end(t,s)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,s,i)=>{const r=fe(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",s,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=cn(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,s=new Oe(fe(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new Oe(fe(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const t=we(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const s=this.doc.comment;this.doc.comment=s?`${s}
|
|
106
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Oe(fe(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 s=Object.assign({_directives:this.directives},this.options),i=new Fe(void 0,s);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}}const is="\uFEFF",rs="",os="",xe="";function un(n){switch(n){case is:return"byte-order-mark";case rs:return"doc-mode";case os:return"flow-error-end";case xe:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
107
|
+
`:case`\r
|
|
108
|
+
`: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(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function j(n){switch(n){case void 0:case" ":case`
|
|
109
|
+
`:case"\r":case" ":return!0;default:return!1}}const Ot=new Set("0123456789ABCDEFabcdef"),hn=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Ae=new Set(",[]{}"),dn=new Set(` ,[]{}
|
|
110
|
+
\r `),Ge=n=>!n||dn.has(n);class pn{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let s=this.next??"stream";for(;s&&(t||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
111
|
+
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
112
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let s=0;for(;t===" ";)t=this.buffer[++s+e];if(t==="\r"){const i=this.buffer[s+e+1];if(i===`
|
|
113
|
+
`||!i&&!this.atEnd)return e+s+1}return t===`
|
|
114
|
+
`||s>=this.indentNext||!t&&!this.atEnd?e+s:-1}if(t==="-"||t==="."){const s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&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(`
|
|
115
|
+
`,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*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===is&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,s=e.indexOf("#");for(;s!==-1;){const r=e[s-1];if(r===" "||r===" "){t=s-1;break}else s=e.indexOf("#",s+1)}for(;;){const r=e[t-1];if(r===" "||r===" ")t-=1;else break}const i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield rs,yield*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*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!j(this.charAt(1))&&(this.indentNext=this.indentValue),yield*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 s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Ge),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,s=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=s=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&i[0]!=="#"||s===0&&(i.startsWith("---")||i.startsWith("..."))&&j(i[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield os,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Ge),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||j(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*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 s=this.buffer.substring(0,t);let i=s.indexOf(`
|
|
116
|
+
`,this.pos);if(i!==-1){for(;i!==-1;){const r=this.continueScalar(i+1);if(r===-1)break;i=s.indexOf(`
|
|
117
|
+
`,r)}i!==-1&&(t=i-(s[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){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*this.pushUntil(t=>j(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,s;e:for(let r=this.pos;s=this.buffer[r];++r)switch(s){case" ":t+=1;break;case`
|
|
118
|
+
`:e=r,t=0;break;case"\r":{const o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
119
|
+
`)break}default:break e}if(!s&&!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(`
|
|
120
|
+
`,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(s=this.buffer[i];s===" ";)s=this.buffer[++i];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
|
|
121
|
+
`;)s=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===`
|
|
122
|
+
`&&r>=this.pos&&r+1+t>l)e=r;else break}while(!0);return yield xe,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,s=this.pos-1,i;for(;i=this.buffer[++s];)if(i===":"){const r=this.buffer[s+1];if(j(r)||e&&Ae.has(r))break;t=s}else if(j(i)){let r=this.buffer[s+1];if(i==="\r"&&(r===`
|
|
123
|
+
`?(s+=1,i=`
|
|
124
|
+
`,r=this.buffer[s+1]):t=s),r==="#"||e&&Ae.has(r))break;if(i===`
|
|
125
|
+
`){const o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(e&&Ae.has(i))break;t=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield xe,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Ge))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(j(t)||e&&Ae.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!j(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(hn.has(t))t=this.buffer[++e];else if(t==="%"&&Ot.has(this.buffer[e+1])&&Ot.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
|
|
126
|
+
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
127
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,s;do s=this.buffer[++t];while(s===" "||e&&s===" ");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,s=this.buffer[t];for(;!e(s);)s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class mn{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,s=this.lineStarts.length;for(;t<s;){const r=t+s>>1;this.lineStarts[r]<e?t=r+1:s=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 V(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function At(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function ls(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Ie(n){switch(n.type){case"document":return n.start;case"block-map":{const e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function x(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function It(n){if(n.start.type==="flow-seq-start")for(const e of n.items)e.sep&&!e.value&&!V(e.start,"explicit-key-ind")&&!V(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,ls(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 gn{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 pn,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(e,t))yield*this.next(s);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const t=un(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{const s=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in s?s.indent:0:t.type==="flow-collection"&&s.type==="document"&&(t.indent=0),t.type==="flow-collection"&&It(t),s.type){case"document":s.value=t;break;case"block-scalar":s.props.push(t);break;case"block-map":{const i=s.items[s.items.length-1];if(i.value){s.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=s.items[s.items.length-1];i.value?s.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{const i=s.items[s.items.length-1];!i||i.value?s.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((s.type==="document"||s.type==="block-map"||s.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&&At(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(s.type==="document"?s.end=i.start:s.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*this.lineEnd(e);switch(this.type){case"doc-start":{At(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}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=Ie(this.peek(2)),s=x(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:s,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
128
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
129
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const s=!this.onKeyLine&&this.indent===e.indent,i=s&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let r=[];if(i&&t.sep&&!t.value){const o=[];for(let l=0;l<t.sep.length;++l){const a=t.sep[l];switch(a.type){case"newline":o.push(l);break;case"space":break;case"comment":a.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(r.push(this.sourceToken),e.items.push({start:r}),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):i||t.value?(r.push(this.sourceToken),e.items.push({start:r,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(V(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(ls(t.key)&&!V(t.sep,"newline")){const o=x(t.start),l=t.key,a=t.sep;a.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:a}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(V(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const o=x(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):V(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 o=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!V(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&e.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.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||V(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const s=this.startBlockValue(e);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s?.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 s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const i=Ie(s),r=x(i);It(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*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
130
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
131
|
+
`,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=Ie(e),s=x(t);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=Ie(e),s=x(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function yn(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new mn||null,prettyErrors:e}}function bn(n,e={}){const{lineCounter:t,prettyErrors:s}=yn(e),i=new gn(t?.addNewLine),r=new fn(e),o=Array.from(r.compose(i.parse(n)));if(s&&t)for(const l of o)l.errors.forEach(kt(n,t)),l.warnings.forEach(kt(n,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}export{bn as p};
|
package/assets/index.html
CHANGED
|
@@ -12,11 +12,13 @@
|
|
|
12
12
|
<link rel="icon" type="image/png" sizes="32x32" href="./favicon-32.png" />
|
|
13
13
|
<link rel="apple-touch-icon" href="./apple-touch-icon.png" />
|
|
14
14
|
<title>Canonry</title>
|
|
15
|
-
<script type="module" crossorigin src="./assets/index-
|
|
15
|
+
<script type="module" crossorigin src="./assets/index-BKq6k5Of.js"></script>
|
|
16
16
|
<link rel="modulepreload" crossorigin href="./assets/vendor-tanstack-BjS7iY3g.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="./assets/vendor-radix-DnzzbllM.js">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="./assets/vendor-recharts-33ACLxsD.js">
|
|
19
|
+
<link rel="modulepreload" crossorigin href="./assets/vendor-lucide-ByU7vBHt.js">
|
|
19
20
|
<link rel="modulepreload" crossorigin href="./assets/vendor-markdown-CpDJch4G.js">
|
|
21
|
+
<link rel="modulepreload" crossorigin href="./assets/vendor-yaml-GWJz5H2G.js">
|
|
20
22
|
<link rel="stylesheet" crossorigin href="./assets/index-DyL54s8x.css">
|
|
21
23
|
</head>
|
|
22
24
|
<body>
|