@redocly/cli 2.43.0 → 2.43.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a as x}from"./UXH3ZSSV.js";import{a as v,b as y,c as R,d as u}from"./QFG7TTKG.js";import{c as f,d as w}from"./L3YH7RCT.js";import{a as g,b as m}from"./X6IKW6K4.js";import{O as a}from"./WNTLDT6L.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{mkdir as A,writeFile as C}from"node:fs/promises";import S from"node:path";async function F(e){let i=await w(e.trafficPath);if(i.length===0)throw new Error("No traffic files found in the provided traffic path.");let t=y.create({openApiIndex:e.openApiIndex,matchMode:e.matchMode,ignoreCookies:e.ignoreCookies,ignoreHeaders:e.ignoreHeaders,previewFindingsLimit:e.previewFindingsLimit,activeRules:e.activeRules,server:e.server,minSeverity:e.minSeverity}),r=0,o=0;for(let n of i){let s=await x(n,e.format);if(!s){a.warn(`Skipping traffic file with unrecognized format: ${n}
7
+ import{a as x}from"./E4UJ56QF.js";import{a as v,b as y,c as R,d as u}from"./VK2PYQAI.js";import{c as f,d as w}from"./F4I4B6CF.js";import{a as g,b as m}from"./FJ3ZKIJG.js";import{O as a}from"./PQKTPLKO.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{mkdir as A,writeFile as C}from"node:fs/promises";import S from"node:path";async function F(e){let i=await w(e.trafficPath);if(i.length===0)throw new Error("No traffic files found in the provided traffic path.");let t=y.create({openApiIndex:e.openApiIndex,matchMode:e.matchMode,ignoreCookies:e.ignoreCookies,ignoreHeaders:e.ignoreHeaders,previewFindingsLimit:e.previewFindingsLimit,activeRules:e.activeRules,server:e.server,minSeverity:e.minSeverity}),r=0,o=0;for(let n of i){let s=await x(n,e.format);if(!s){a.warn(`Skipping traffic file with unrecognized format: ${n}
8
8
  `);continue}r+=1;for await(let c of s.parse(n))await t.process({...c,index:o}),o+=1}if(r===0)throw new Error("No supported traffic files found. In auto mode, files must match built-in traffic parser signatures.");if(o===0)throw new Error("No HTTP exchanges were parsed from the provided traffic files.");return t.finalize()}var E=!!process.stdout.isTTY&&process.env.NO_COLOR===void 0;function T(e){let i=new Set;for(let t of e.operationsByMethod.values())for(let r of t)for(let o of r.servers)i.add(o.rawUrl);return Array.from(i).sort()}function I(e,i,t){let r=e.totalExchanges-e.skippedExchanges;if(r===0&&e.skippedExchanges>0){a.warn(`All ${e.skippedExchanges} exchange(s) were outside the --server "${t}" and were skipped. Check that the server matches the traffic URLs.
9
9
  `);return}if(e.documentedExchanges>0||r===0)return;let o=T(i),n=t?`Check that the --server "${t}" matches the traffic URLs and that the description paths align with the remainder.`:e.hostCompatibleExchanges===r?`The traffic hosts are compatible with the description servers (${o.join(", ")}), so the endpoints are likely undocumented; if they should be documented, check that the description base paths and paths align with the traffic URLs, or use --server to declare the server the traffic was captured against.`:`Check that the traffic host and base path match the description servers (${o.join(", ")}), or use --server to declare the server the traffic was captured against.`;a.warn(`None of the ${r} validated exchange(s) matched a documented operation. ${n}
10
10
  `)}async function $(e,i){let t=f(e);await A(S.dirname(t),{recursive:!0}),await C(t,i,"utf8")}async function q({argv:e,config:i}){let t=f(e.traffic),r=e["traffic-format"],o=e.rules?u(e.rules):void 0,n=e["ignore-headers"]?u(e["ignore-headers"]):void 0,s=e.server;if(s&&e["match-mode"])return m("The --server and --match-mode options are mutually exclusive: --match-mode controls how requests are located via the description servers, while --server replaces the description servers with the one the traffic was captured against.");let c=e["match-mode"]??"strict-host",d=f(e.api),p=await R(d,i);if(p.loadedOperations===0)return m(`No OpenAPI operations were loaded from: ${d}`);let{runId:k,summary:h,findings:O}=await F({trafficPath:t,format:r,matchMode:c,ignoreCookies:e["ignore-cookies"],ignoreHeaders:n,previewFindingsLimit:e["max-findings"],activeRules:o,openApiIndex:p,server:s,minSeverity:e["min-severity"]});I(h,p,s);let l=v({runId:k,summary:h,findings:O,meta:{specSource:d,trafficPath:t,format:r,matchMode:c,server:s}},{format:e["report-format"],color:E&&e["report-format"]==="pretty"&&!e.output,maxFindings:e["max-findings"]});if(e.output?(await $(e.output,l),a.info(`Drift report written to: ${f(e.output)}
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a,b,c,d,e,f,g}from"./PFD7KGH7.js";import"./O6PRCLSV.js";import"./32XCOMOR.js";import"./WNTLDT6L.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{d as RESET_ESCAPE_CODE,c as calculateTotals,f as conditionallyMaskSecrets,b as generate,e as maskSecrets,a as parseRuntimeExpression,g as run};
7
+ import{a,b,c,d,e,f,g}from"./N2HAOFWU.js";import"./O6PRCLSV.js";import"./32XCOMOR.js";import"./PQKTPLKO.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{d as RESET_ESCAPE_CODE,c as calculateTotals,f as conditionallyMaskSecrets,b as generate,e as maskSecrets,a as parseRuntimeExpression,g as run};
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a as T,b as O,c as A,d as E}from"./QFG7TTKG.js";import{c as m,k as C,r as $}from"./L3YH7RCT.js";import{a as R,b as y}from"./X6IKW6K4.js";import{a as q}from"./O6MCQRCP.js";import{O as u,c as H}from"./WNTLDT6L.js";import"./NEWT5A6S.js";import{e as z}from"./RFWIIJFG.js";import{createReadStream as F,createWriteStream as k,existsSync as V}from"node:fs";import{appendFile as N,mkdir as j,rm as _,writeFile as W}from"node:fs/promises";import B from"node:path";import{createInterface as G}from"node:readline";var w=class{outputPath;entriesPath;creatorVersion;writeChain=Promise.resolve();directoryEnsured=!1;started=!1;count=0;constructor(t,r){this.outputPath=B.resolve(process.cwd(),t),this.entriesPath=`${this.outputPath}.entries.tmp`,this.creatorVersion=r}get entryCount(){return this.count}add(t){let r=`${JSON.stringify(t)}
7
+ import{a as T,b as O,c as A,d as E}from"./VK2PYQAI.js";import{c as m,k as C,r as $}from"./F4I4B6CF.js";import{a as R,b as y}from"./FJ3ZKIJG.js";import{a as q}from"./O6MCQRCP.js";import{O as u,c as H}from"./PQKTPLKO.js";import"./NEWT5A6S.js";import{e as z}from"./RFWIIJFG.js";import{createReadStream as F,createWriteStream as k,existsSync as V}from"node:fs";import{appendFile as N,mkdir as j,rm as _,writeFile as W}from"node:fs/promises";import B from"node:path";import{createInterface as G}from"node:readline";var w=class{outputPath;entriesPath;creatorVersion;writeChain=Promise.resolve();directoryEnsured=!1;started=!1;count=0;constructor(t,r){this.outputPath=B.resolve(process.cwd(),t),this.entriesPath=`${this.outputPath}.entries.tmp`,this.creatorVersion=r}get entryCount(){return this.count}add(t){let r=`${JSON.stringify(t)}
8
8
  `,n=this.writeChain.catch(()=>{}).then(()=>this.append(r)).then(()=>{this.count+=1});return this.writeChain=n.catch(()=>{}),n}async finalize(){await this.writeChain.catch(()=>{}),await this.ensureDirectory(),await this.writeDocument(),await _(this.entriesPath,{force:!0})}async append(t){if(await this.ensureDirectory(),!this.started){await W(this.entriesPath,t,"utf8"),this.started=!0;return}await N(this.entriesPath,t,"utf8")}async ensureDirectory(){this.directoryEnsured||(await j(B.dirname(this.outputPath),{recursive:!0}),this.directoryEnsured=!0)}async writeDocument(){let t=k(this.outputPath,{encoding:"utf8"}),r=n=>new Promise((o,s)=>{t.write(n,i=>i?s(i):o())});try{let n=JSON.stringify({name:"redocly-cli proxy",version:this.creatorVersion});await r(`{
9
9
  "log": {
10
10
  "version": "1.2",
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- var e={name:"@redocly/cli",version:"2.43.0",description:"",license:"MIT",bin:{redocly:"bin/cli.js",openapi:"bin/cli.js"},type:"module",engines:{node:">=22.12.0 || >=20.19.0 <21.0.0",npm:">=10"},engineStrict:!0,scripts:{build:"node ./scripts/build.mjs","prepare:publish-dir":"node ./scripts/prepare-publish-dir.mjs","clean:publish-dir":`node -e "require('fs').rmSync('.publish', {recursive:true, force:true})"`},publishConfig:{directory:".publish"},repository:{type:"git",url:"https://github.com/Redocly/redocly-cli.git"},homepage:"https://github.com/Redocly/redocly-cli",keywords:["linter","OpenAPI","Swagger","OpenAPI linter","Swagger linter","AsyncAPI linter","Arazzo linter","oas"],contributors:["Roman Hotsiy <roman@redocly.com> (https://redocly.com/)"],devDependencies:{"@opentelemetry/exporter-trace-otlp-http":"0.219.0","@opentelemetry/resources":"2.8.0","@opentelemetry/sdk-trace-node":"2.8.0","@opentelemetry/semantic-conventions":"1.41.1","@redocly/cli-otel":"0.3.4","@redocly/client-generator":"0.1.1","@redocly/openapi-core":"2.43.0","@redocly/respect-core":"2.43.0","@types/cookie":"0.6.0","@types/har-format":"^1.2.16","@types/react":"^17.0.0 || ^18.2.21 || ^19.2.16","@types/react-dom":"^17.0.0 || ^18.2.7 || ^19.2.3","@types/semver":"^7.5.0","@types/set-cookie-parser":"2.4.10","@types/yargs":"17.0.32",colorette:"^1.2.0",cookie:"^0.7.2",dotenv:"16.4.7",esbuild:"^0.28.0",glob:"^13.0.5",handlebars:"^4.7.9","https-proxy-agent":"^7.0.5",react:"^17.0.0 || ^18.2.0 || ^19.2.7","react-dom":"^17.0.0 || ^18.2.0 || ^19.2.7",redoc:"2.5.3",semver:"^7.5.2","set-cookie-parser":"^2.3.5","styled-components":"6.4.2",typescript:"6.0.2",ulid:"^3.0.1",undici:"^6.27.0",yargs:"17.0.1"}};var{version:s,name:i,engines:c}=e,n=e.devDependencies.redoc,p="sha384-xiEssMQFSpSfLbzRZCGfxxIM5QDb2DTrU6vyoZdp2sV1L6pmOMy6MpTtUoLbpC96";export{s as a,i as b,c,n as d,p as e};
7
+ var e={name:"@redocly/cli",version:"2.43.1",description:"",license:"MIT",bin:{redocly:"bin/cli.js",openapi:"bin/cli.js"},type:"module",engines:{node:">=22.12.0 || >=20.19.0 <21.0.0",npm:">=10"},engineStrict:!0,scripts:{build:"node ./scripts/build.mjs","prepare:publish-dir":"node ./scripts/prepare-publish-dir.mjs","clean:publish-dir":`node -e "require('fs').rmSync('.publish', {recursive:true, force:true})"`},publishConfig:{directory:".publish"},repository:{type:"git",url:"https://github.com/Redocly/redocly-cli.git"},homepage:"https://github.com/Redocly/redocly-cli",keywords:["linter","OpenAPI","Swagger","OpenAPI linter","Swagger linter","AsyncAPI linter","Arazzo linter","oas"],contributors:["Roman Hotsiy <roman@redocly.com> (https://redocly.com/)"],devDependencies:{"@opentelemetry/exporter-trace-otlp-http":"0.219.0","@opentelemetry/resources":"2.8.0","@opentelemetry/sdk-trace-node":"2.8.0","@opentelemetry/semantic-conventions":"1.41.1","@redocly/cli-otel":"0.3.4","@redocly/client-generator":"0.1.2","@redocly/openapi-core":"2.43.1","@redocly/respect-core":"2.43.1","@types/cookie":"0.6.0","@types/har-format":"^1.2.16","@types/react":"^17.0.0 || ^18.2.21 || ^19.2.16","@types/react-dom":"^17.0.0 || ^18.2.7 || ^19.2.3","@types/semver":"^7.5.0","@types/set-cookie-parser":"2.4.10","@types/yargs":"17.0.32",colorette:"^1.2.0",cookie:"^0.7.2",dotenv:"16.4.7",esbuild:"^0.28.0",glob:"^13.0.5",handlebars:"^4.7.9","https-proxy-agent":"^7.0.5",react:"^17.0.0 || ^18.2.0 || ^19.2.7","react-dom":"^17.0.0 || ^18.2.0 || ^19.2.7",redoc:"2.5.3",semver:"^7.5.2","set-cookie-parser":"^2.3.5","styled-components":"6.4.2",typescript:"6.0.2",ulid:"^3.0.1",undici:"^6.27.0",yargs:"17.0.1"}};var{version:s,name:i,engines:c}=e,n=e.devDependencies.redoc,p="sha384-xiEssMQFSpSfLbzRZCGfxxIM5QDb2DTrU6vyoZdp2sV1L6pmOMy6MpTtUoLbpC96";export{s as a,i as b,c,n as d,p as e};
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a as G}from"./UXH3ZSSV.js";import{c as I,d as N,e as fe,h as q,j as _,k as ue,v as D,w as B}from"./L3YH7RCT.js";import{a as ce,c as pe}from"./C35TOMVY.js";import{b as ae}from"./X6IKW6K4.js";import{B as oe,C as P,O as y,c as b,ca as se,ia as ie,l as $}from"./WNTLDT6L.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{mkdir as Bt,writeFile as zt}from"node:fs/promises";import Ht from"node:path";import*as Ce from"node:process";var Ve=/^[a-zA-Z][a-zA-Z0-9]*(?:[_\-.][a-zA-Z0-9]+)*$/,Fe=/^[0-9a-f-]{8,}$/i,Ye=[["uuid",/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i],["date-time",/^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:[Zz]|[+-]\d{2}:\d{2})$/],["date",/^\d{4}-\d{2}-\d{2}$/],["email",/^[^\s@]+@[^\s@]+\.[^\s@]+$/],["uri",/^https?:\/\/\S+$/],["ipv4",/^(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|1?\d?\d)$/]],J=new WeakMap;function z(e){return{formats:Ye.filter(([,t])=>t.test(e)).map(([t])=>t),values:[e],count:1,overflow:!1}}function C(e,t){if(!e)return t;if(!t)return e;let r={formats:e.formats.filter(n=>t.formats.includes(n)),values:[],count:e.count+t.count,overflow:e.overflow||t.overflow};if(!r.overflow){let n=[...e.values];for(let o of t.values)n.includes(o)||n.push(o);n.length>10?r.overflow=!0:r.values=n}return r}function H(e,t){J.set(e,t)}function L(e){return J.get(e)}function U(e,t){let r=J.get(e);r&&J.set(t,r)}function Ke(e){return e.length<=30&&!Fe.test(e)&&Ve.test(e)}function W(e,t){return e.formats.length>0?{format:e.formats[0]}:t&&!e.overflow&&e.count>=4&&e.values.length>0&&e.values.length<=5&&e.values.length*2<=e.count&&e.values.every(Ke)?{enum:[...e.values].sort()}:{}}function R(e){let t=J.get(e);if(t){let r=typeof e.type=="string"?[e.type]:e.type??[];r.includes("string")&&Object.assign(e,W(t,r.length===1))}for(let r of Object.values(e.properties??{}))R(r);e.additionalProperties&&R(e.additionalProperties),e.items&&R(e.items);for(let r of e.oneOf??[])R(r)}function me(e){for(let t of Object.values(e.paths))for(let r of Object.values(t)){for(let n of Object.values(r.requestBody?.content??{}))R(n.schema);for(let n of Object.values(r.responses))for(let o of Object.values(n.content??{}))R(o.schema)}for(let t of Object.values(e.components?.schemas??{}))R(t);return e}var be=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,F=/^\d+$/,We=/^[0-9a-hjkmnp-tv-z]{26}$/i,Xe=/^[a-z][a-z0-9]*_(?=[0-9a-z]*\d)[0-9a-z]{10,}$/i,Ze=/^[a-z](?=[a-z0-9]*\d)[a-z0-9]{23,24}$/,Z=new Set(ce),Qe=new Set(["get","head"]),de="application/x-www-form-urlencoded",le="multipart/form-data";function et(e){return e?F.test(e)||be.test(e)||We.test(e)||Xe.test(e)||Ze.test(e)?!0:/^[0-9a-f]{16,}$/i.test(e):!1}function Q(e){let t=e.split("/"),r=[],n=new Set;return{template:t.map((s,a)=>{if(!et(s))return s;let i=t[a-1],c=i?`${$(i,1)}Id`:"id",p=1;for(;n.has(c);)p+=1,c=i?`${$(i,1)}Id${p}`:`id${p}`;return n.add(c),r.push({name:c,value:s}),`{${c}}`}).join("/")||"/",params:r}}function A(e){if(e===null)return{type:"null"};if(Array.isArray(e)){if(e.length===0)return{type:"array"};let t=e.slice(0,20).map(A);return{type:"array",items:x(t)}}switch(typeof e){case"string":{let t={type:"string"};return H(t,z(e)),t}case"boolean":return{type:"boolean"};case"number":return Number.isInteger(e)?{type:"integer"}:{type:"number"};case"object":{let t=Object.entries(e);if(t.length>0&&(t.every(([a])=>F.test(a))||t.every(([a])=>be.test(a))))return{type:"object",additionalProperties:x(t.map(([,a])=>A(a)))};let r={},n=[];for(let[s,a]of t)r[s]=A(a),n.push(s);let o={type:"object",properties:r};return n.length>0&&(o.required=n),o}default:return{}}}function x(e){if(e.length===0)return{};let[t,...r]=e,n=t;for(let o of r)n=V(n,o);return n}function he(e){return Object.keys(e).length===0}function k(e){return e.additionalProperties?"map":e.type==="object"?"object":e.type==="array"?"array":"scalar"}function X(e){return e.oneOf?e.oneOf.flatMap(X):Array.isArray(e.type)?e.type.map(t=>{if(t==="object"){let n={type:"object"};return e.properties&&(n.properties=e.properties),e.required&&(n.required=e.required),e.additionalProperties&&(n.additionalProperties=e.additionalProperties),n}if(t==="array")return e.items?{type:"array",items:e.items}:{type:"array"};let r={type:t};return t==="string"&&U(e,r),r}):[e]}var tt=.5,rt=3;function we(e,t){let r=Object.keys(e.properties??{}),n=Object.keys(t.properties??{});if(r.length===0||n.length===0)return 1;let o=new Set(n),s=r.filter(a=>o.has(a)).length;return s/(r.length+n.length-s)}function nt(e,t){let r=k(e);if(r!==k(t))return!1;switch(r){case"scalar":return e.type===t.type||e.type==="integer"&&t.type==="number"||e.type==="number"&&t.type==="integer";case"object":return we(e,t)>=tt;default:return!0}}function ve(e,t){switch(k(e)){case"scalar":{if(e.type!==t.type)return{type:"number"};if(e.type==="string"){let r=C(L(e),L(t));if(r){let n={type:"string"};return H(n,r),n}}return e}case"map":return{type:"object",additionalProperties:V(e.additionalProperties??{},t.additionalProperties??{})};case"object":{let r={...e.properties??{}};for(let[a,i]of Object.entries(t.properties??{}))r[a]=r[a]?V(r[a],i):i;let n=new Set(t.required??[]),o=(e.required??[]).filter(a=>n.has(a)),s={type:"object",properties:r};return o.length>0&&(s.required=o),s}case"array":{if(!e.items||!t.items){let r=e.items??t.items;return r?{type:"array",items:r}:{type:"array"}}return{type:"array",items:V(e.items,t.items)}}}}function ot(e){let t=[...e],r=()=>t.filter(n=>k(n)==="object").length;for(;r()>rt;){let n=-1,o=-1,s=-1;for(let a=0;a<t.length;a++)if(k(t[a])==="object")for(let i=a+1;i<t.length;i++){if(k(t[i])!=="object")continue;let c=we(t[a],t[i]);c>s&&(s=c,n=a,o=i)}t[n]=ve(t[n],t[o]),t.splice(o,1)}return t}var st=["boolean","integer","number","string","null"];function it(e){if(e.length===1)return e[0];let t=[],r=new Set,n;for(let i of e)k(i)==="scalar"&&typeof i.type=="string"?(r.add(i.type),i.type==="string"&&(n=C(n,L(i)))):t.push(i);let o=st.filter(i=>r.has(i)),s=i=>{let c={type:i};return(typeof i=="string"?i==="string":i.includes("string"))&&n&&H(c,n),c};if(t.length===0)return o.length===1?s(o[0]):s(o);if(t.length===1&&o.length===1&&o[0]==="null"&&typeof t[0].type=="string")return{...t[0],type:[t[0].type,"null"]};let a=[...t];return o.length===1?a.push(s(o[0])):o.length>1&&a.push(s(o)),{oneOf:a}}function V(e,t){if(he(e)||he(t))return{};let r=X(e);for(let n of X(t)){let o=r.findIndex(s=>nt(s,n));o===-1?r.push(n):r[o]=ve(r[o],n)}return it(ot(r))}function at(e){if(!e)return;let t=e.trim();if(!(!t.startsWith("{")&&!t.startsWith("[")))try{return JSON.parse(t)}catch{return}}function ct(e,t){let r=t?.match(/boundary="?([^";,]+)"?/i)?.[1];if(!r)return;let n={};for(let o of e.split(`--${r}`)){let s=o.match(/^\r?\n([\s\S]*?)\r?\n\r?\n([\s\S]*)\r?\n$/);if(!s)continue;let[,a,i]=s,c=a.match(/\bname="([^"]*)"/i)?.[1];c!==void 0&&(n[c]=/\bfilename="/i.test(a)?{type:"string",format:"binary"}:A(i))}if(Object.keys(n).length!==0)return{type:"object",properties:n,required:Object.keys(n)}}function ge(e){let t=_(e.contentType);if(e.bodyJson!==void 0)return{mime:ue(t)?t:"application/json",schema:A(e.bodyJson)};if(t===de&&e.bodyText){let n={};for(let[o,s]of new URLSearchParams(e.bodyText))n[o]=s;return Object.keys(n).length===0?void 0:{mime:de,schema:A(n)}}if(t===le&&e.bodyText){let n=ct(e.bodyText,e.contentType);return n?{mime:le,schema:n}:void 0}let r=at(e.bodyText);if(r!==void 0)return{mime:"application/json",schema:A(r)}}function ye(e,t,r){let n=e.get(t);e.set(t,n?x([n,r]):r)}async function Oe(e){let t=await N(e.trafficPath);if(t.length===0)throw new Error("No traffic files found in the provided traffic path.");let r=D(e.server),n=new Map,o=new Set,s=0,a=c=>{let p=c.request.method.toLowerCase();if(!Z.has(p))return;let f=c.request.path||"/";if(r){let u=B(c.request,r);if(u===void 0)return;f=u}else c.request.host&&!fe(c.request.host)&&o.add(`${c.request.protocol}//${c.request.host}`);let{template:l,params:m}=Q(q(f)),w=`${p} ${l}`,d=n.get(w);d||(d={method:p,template:l,pathParams:new Map,queryParams:new Map,requestBodies:new Map,responses:new Map},n.set(w,d));for(let{name:u,value:h}of m){let g=d.pathParams.get(u);d.pathParams.set(u,{numeric:(g?.numeric??!0)&&F.test(h),observations:C(g?.observations,z(h))})}for(let u of new Set(c.request.query.keys())){let h=c.request.query.getAll(u),g=d.queryParams.get(u),v=h.length>0&&h.every(O=>F.test(O)),S=g?.observations;for(let O of h)S=C(S,z(O));d.queryParams.set(u,{numeric:(g?.numeric??!0)&&v,observations:S})}if(!Qe.has(p)){let u=ge(c.request);u&&ye(d.requestBodies,u.mime,u.schema)}if(c.response&&c.response.status>=100){let u=String(c.response.status),h=d.responses.get(u);h||(h={bodies:new Map},d.responses.set(u,h)),h.statusText??=c.response.statusText||void 0;let g=ge(c.response);g&&ye(h.bodies,g.mime,g.schema)}};for(let c of t){let p=await G(c,e.format);if(!p){y.warn(`Skipping traffic file with unrecognized format: ${c}
7
+ import{a as G}from"./E4UJ56QF.js";import{c as I,d as N,e as fe,h as q,j as _,k as ue,v as D,w as B}from"./F4I4B6CF.js";import{a as ce,c as pe}from"./DO2OO6JA.js";import{b as ae}from"./FJ3ZKIJG.js";import{B as oe,C as P,O as y,c as b,ca as se,ia as ie,l as $}from"./PQKTPLKO.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{mkdir as Bt,writeFile as zt}from"node:fs/promises";import Ht from"node:path";import*as Ce from"node:process";var Ve=/^[a-zA-Z][a-zA-Z0-9]*(?:[_\-.][a-zA-Z0-9]+)*$/,Fe=/^[0-9a-f-]{8,}$/i,Ye=[["uuid",/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i],["date-time",/^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:[Zz]|[+-]\d{2}:\d{2})$/],["date",/^\d{4}-\d{2}-\d{2}$/],["email",/^[^\s@]+@[^\s@]+\.[^\s@]+$/],["uri",/^https?:\/\/\S+$/],["ipv4",/^(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|1?\d?\d)$/]],J=new WeakMap;function z(e){return{formats:Ye.filter(([,t])=>t.test(e)).map(([t])=>t),values:[e],count:1,overflow:!1}}function C(e,t){if(!e)return t;if(!t)return e;let r={formats:e.formats.filter(n=>t.formats.includes(n)),values:[],count:e.count+t.count,overflow:e.overflow||t.overflow};if(!r.overflow){let n=[...e.values];for(let o of t.values)n.includes(o)||n.push(o);n.length>10?r.overflow=!0:r.values=n}return r}function H(e,t){J.set(e,t)}function L(e){return J.get(e)}function U(e,t){let r=J.get(e);r&&J.set(t,r)}function Ke(e){return e.length<=30&&!Fe.test(e)&&Ve.test(e)}function W(e,t){return e.formats.length>0?{format:e.formats[0]}:t&&!e.overflow&&e.count>=4&&e.values.length>0&&e.values.length<=5&&e.values.length*2<=e.count&&e.values.every(Ke)?{enum:[...e.values].sort()}:{}}function R(e){let t=J.get(e);if(t){let r=typeof e.type=="string"?[e.type]:e.type??[];r.includes("string")&&Object.assign(e,W(t,r.length===1))}for(let r of Object.values(e.properties??{}))R(r);e.additionalProperties&&R(e.additionalProperties),e.items&&R(e.items);for(let r of e.oneOf??[])R(r)}function me(e){for(let t of Object.values(e.paths))for(let r of Object.values(t)){for(let n of Object.values(r.requestBody?.content??{}))R(n.schema);for(let n of Object.values(r.responses))for(let o of Object.values(n.content??{}))R(o.schema)}for(let t of Object.values(e.components?.schemas??{}))R(t);return e}var be=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,F=/^\d+$/,We=/^[0-9a-hjkmnp-tv-z]{26}$/i,Xe=/^[a-z][a-z0-9]*_(?=[0-9a-z]*\d)[0-9a-z]{10,}$/i,Ze=/^[a-z](?=[a-z0-9]*\d)[a-z0-9]{23,24}$/,Z=new Set(ce),Qe=new Set(["get","head"]),de="application/x-www-form-urlencoded",le="multipart/form-data";function et(e){return e?F.test(e)||be.test(e)||We.test(e)||Xe.test(e)||Ze.test(e)?!0:/^[0-9a-f]{16,}$/i.test(e):!1}function Q(e){let t=e.split("/"),r=[],n=new Set;return{template:t.map((s,a)=>{if(!et(s))return s;let i=t[a-1],c=i?`${$(i,1)}Id`:"id",p=1;for(;n.has(c);)p+=1,c=i?`${$(i,1)}Id${p}`:`id${p}`;return n.add(c),r.push({name:c,value:s}),`{${c}}`}).join("/")||"/",params:r}}function A(e){if(e===null)return{type:"null"};if(Array.isArray(e)){if(e.length===0)return{type:"array"};let t=e.slice(0,20).map(A);return{type:"array",items:x(t)}}switch(typeof e){case"string":{let t={type:"string"};return H(t,z(e)),t}case"boolean":return{type:"boolean"};case"number":return Number.isInteger(e)?{type:"integer"}:{type:"number"};case"object":{let t=Object.entries(e);if(t.length>0&&(t.every(([a])=>F.test(a))||t.every(([a])=>be.test(a))))return{type:"object",additionalProperties:x(t.map(([,a])=>A(a)))};let r={},n=[];for(let[s,a]of t)r[s]=A(a),n.push(s);let o={type:"object",properties:r};return n.length>0&&(o.required=n),o}default:return{}}}function x(e){if(e.length===0)return{};let[t,...r]=e,n=t;for(let o of r)n=V(n,o);return n}function he(e){return Object.keys(e).length===0}function k(e){return e.additionalProperties?"map":e.type==="object"?"object":e.type==="array"?"array":"scalar"}function X(e){return e.oneOf?e.oneOf.flatMap(X):Array.isArray(e.type)?e.type.map(t=>{if(t==="object"){let n={type:"object"};return e.properties&&(n.properties=e.properties),e.required&&(n.required=e.required),e.additionalProperties&&(n.additionalProperties=e.additionalProperties),n}if(t==="array")return e.items?{type:"array",items:e.items}:{type:"array"};let r={type:t};return t==="string"&&U(e,r),r}):[e]}var tt=.5,rt=3;function we(e,t){let r=Object.keys(e.properties??{}),n=Object.keys(t.properties??{});if(r.length===0||n.length===0)return 1;let o=new Set(n),s=r.filter(a=>o.has(a)).length;return s/(r.length+n.length-s)}function nt(e,t){let r=k(e);if(r!==k(t))return!1;switch(r){case"scalar":return e.type===t.type||e.type==="integer"&&t.type==="number"||e.type==="number"&&t.type==="integer";case"object":return we(e,t)>=tt;default:return!0}}function ve(e,t){switch(k(e)){case"scalar":{if(e.type!==t.type)return{type:"number"};if(e.type==="string"){let r=C(L(e),L(t));if(r){let n={type:"string"};return H(n,r),n}}return e}case"map":return{type:"object",additionalProperties:V(e.additionalProperties??{},t.additionalProperties??{})};case"object":{let r={...e.properties??{}};for(let[a,i]of Object.entries(t.properties??{}))r[a]=r[a]?V(r[a],i):i;let n=new Set(t.required??[]),o=(e.required??[]).filter(a=>n.has(a)),s={type:"object",properties:r};return o.length>0&&(s.required=o),s}case"array":{if(!e.items||!t.items){let r=e.items??t.items;return r?{type:"array",items:r}:{type:"array"}}return{type:"array",items:V(e.items,t.items)}}}}function ot(e){let t=[...e],r=()=>t.filter(n=>k(n)==="object").length;for(;r()>rt;){let n=-1,o=-1,s=-1;for(let a=0;a<t.length;a++)if(k(t[a])==="object")for(let i=a+1;i<t.length;i++){if(k(t[i])!=="object")continue;let c=we(t[a],t[i]);c>s&&(s=c,n=a,o=i)}t[n]=ve(t[n],t[o]),t.splice(o,1)}return t}var st=["boolean","integer","number","string","null"];function it(e){if(e.length===1)return e[0];let t=[],r=new Set,n;for(let i of e)k(i)==="scalar"&&typeof i.type=="string"?(r.add(i.type),i.type==="string"&&(n=C(n,L(i)))):t.push(i);let o=st.filter(i=>r.has(i)),s=i=>{let c={type:i};return(typeof i=="string"?i==="string":i.includes("string"))&&n&&H(c,n),c};if(t.length===0)return o.length===1?s(o[0]):s(o);if(t.length===1&&o.length===1&&o[0]==="null"&&typeof t[0].type=="string")return{...t[0],type:[t[0].type,"null"]};let a=[...t];return o.length===1?a.push(s(o[0])):o.length>1&&a.push(s(o)),{oneOf:a}}function V(e,t){if(he(e)||he(t))return{};let r=X(e);for(let n of X(t)){let o=r.findIndex(s=>nt(s,n));o===-1?r.push(n):r[o]=ve(r[o],n)}return it(ot(r))}function at(e){if(!e)return;let t=e.trim();if(!(!t.startsWith("{")&&!t.startsWith("[")))try{return JSON.parse(t)}catch{return}}function ct(e,t){let r=t?.match(/boundary="?([^";,]+)"?/i)?.[1];if(!r)return;let n={};for(let o of e.split(`--${r}`)){let s=o.match(/^\r?\n([\s\S]*?)\r?\n\r?\n([\s\S]*)\r?\n$/);if(!s)continue;let[,a,i]=s,c=a.match(/\bname="([^"]*)"/i)?.[1];c!==void 0&&(n[c]=/\bfilename="/i.test(a)?{type:"string",format:"binary"}:A(i))}if(Object.keys(n).length!==0)return{type:"object",properties:n,required:Object.keys(n)}}function ge(e){let t=_(e.contentType);if(e.bodyJson!==void 0)return{mime:ue(t)?t:"application/json",schema:A(e.bodyJson)};if(t===de&&e.bodyText){let n={};for(let[o,s]of new URLSearchParams(e.bodyText))n[o]=s;return Object.keys(n).length===0?void 0:{mime:de,schema:A(n)}}if(t===le&&e.bodyText){let n=ct(e.bodyText,e.contentType);return n?{mime:le,schema:n}:void 0}let r=at(e.bodyText);if(r!==void 0)return{mime:"application/json",schema:A(r)}}function ye(e,t,r){let n=e.get(t);e.set(t,n?x([n,r]):r)}async function Oe(e){let t=await N(e.trafficPath);if(t.length===0)throw new Error("No traffic files found in the provided traffic path.");let r=D(e.server),n=new Map,o=new Set,s=0,a=c=>{let p=c.request.method.toLowerCase();if(!Z.has(p))return;let f=c.request.path||"/";if(r){let u=B(c.request,r);if(u===void 0)return;f=u}else c.request.host&&!fe(c.request.host)&&o.add(`${c.request.protocol}//${c.request.host}`);let{template:l,params:m}=Q(q(f)),w=`${p} ${l}`,d=n.get(w);d||(d={method:p,template:l,pathParams:new Map,queryParams:new Map,requestBodies:new Map,responses:new Map},n.set(w,d));for(let{name:u,value:h}of m){let g=d.pathParams.get(u);d.pathParams.set(u,{numeric:(g?.numeric??!0)&&F.test(h),observations:C(g?.observations,z(h))})}for(let u of new Set(c.request.query.keys())){let h=c.request.query.getAll(u),g=d.queryParams.get(u),v=h.length>0&&h.every(O=>F.test(O)),S=g?.observations;for(let O of h)S=C(S,z(O));d.queryParams.set(u,{numeric:(g?.numeric??!0)&&v,observations:S})}if(!Qe.has(p)){let u=ge(c.request);u&&ye(d.requestBodies,u.mime,u.schema)}if(c.response&&c.response.status>=100){let u=String(c.response.status),h=d.responses.get(u);h||(h={bodies:new Map},d.responses.set(u,h)),h.statusText??=c.response.statusText||void 0;let g=ge(c.response);g&&ye(h.bodies,g.mime,g.schema)}};for(let c of t){let p=await G(c,e.format);if(!p){y.warn(`Skipping traffic file with unrecognized format: ${c}
8
8
  `);continue}s+=1;for await(let f of p.parse(c))a(f)}if(s===0)throw new Error("No supported traffic files found to generate an OpenAPI description from.");if(n.size===0)throw new Error(r?`No HTTP exchanges in the traffic matched the server "${r}".`:"No HTTP exchanges were observed in the traffic. Cannot generate an OpenAPI description.");let i=r?[r]:Array.from(o).sort();return pt(n,e.title??"Generated API",i)}function $e(e){return Object.values(e.paths).reduce((t,r)=>t+Object.keys(r).length,0)}function Se(e,t){if(e.numeric)return{type:"integer"};let r={type:"string"};return e.observations&&Object.assign(r,W(e.observations,t)),r}function pt(e,t,r){let n={};for(let o of e.values()){let s=n[o.template]??={},a=[...Array.from(o.pathParams).map(([c,p])=>({name:c,in:"path",required:!0,schema:Se(p,!1)})),...Array.from(o.queryParams).map(([c,p])=>({name:c,in:"query",required:!1,schema:Se(p,!0)}))],i={operationId:ft(o.method,o.template),responses:{}};if(a.length>0&&(i.parameters=a),o.requestBodies.size>0){let c={};for(let[p,f]of o.requestBodies)c[p]={schema:f};i.requestBody={content:c}}if(o.responses.size===0)i.responses.default={description:"Observed response"};else for(let[c,p]of o.responses){let f={description:p.statusText||"Observed response"};if(p.bodies.size>0){let l={};for(let[m,w]of p.bodies)l[m]={schema:w};f.content=l}i.responses[c]=f}s[o.method]=i}return{openapi:"3.2.0",info:{title:t,version:"1.0.0"},...r.length>0?{servers:r.map(o=>({url:o}))}:{},paths:n}}function ft(e,t){let r=t.split("/").filter(Boolean).map(n=>n.replace(/[{}]/g,"")).join("-");return`${e}-${r||"root"}`}function Y(e,t){return`${e.toUpperCase()} ${t}`}function Pe(e,t){let r;if(e.bodyJson!==void 0)try{r=JSON.stringify(e.bodyJson)}catch{r=void 0}if(r??=e.bodyText,!r)return;let n=r.trim();if(n)return n.length>t?`${n.slice(0,t)}\u2026[truncated]`:n}function Te(e){if(!e)return"";let t=e.bodyJson;return t===void 0?e.bodyText?_(e.contentType)||"text":"":t===null?"null":Array.isArray(t)?`array<${t.length>0?Ee(t[0]):""}>`:Ee(t)}function Ee(e){return b(e)?Object.keys(e).sort().join(","):e===null?"null":typeof e}async function Re(e){let t=e.perGroup??2,r=e.perOperation??4,n=e.maxBodyChars??2e3,o=D(e.server),s=await N(e.trafficPath),a=new Map;for(let c of s){let p=await G(c,e.format);if(p)for await(let f of p.parse(c)){let l=f.request.method.toUpperCase();if(!Z.has(l.toLowerCase()))continue;let m=f.request.path||"/";if(o){let ne=B(f.request,o);if(ne===void 0)continue;m=ne}let w=q(m),{template:d}=Q(w),u=f.response&&f.response.status>=100?f.response:void 0,h=u?.status,g=`${Te(f.request)}\u2192${Te(u)}`,v=a.get(Y(l,d));v||(v=new Map,a.set(Y(l,d),v));let S=`${h??""} ${g}`,O=v.get(S);O||(O=[],v.set(S,O)),!(O.length>=t)&&O.push({method:l,path:w,query:f.request.query.toString(),status:h,requestContentType:f.request.contentType,requestBody:Pe(f.request,n),responseContentType:u?.contentType,responseBody:u?Pe(u,n):void 0})}}let i=new Map;for(let[c,p]of a){let f=[];for(let l=0;l<t&&f.length<r;l++)for(let m of p.values()){if(f.length>=r)break;m[l]&&f.push(m[l])}i.set(c,f)}return i}var ut=`You are an expert API designer. You are given one operation from an OpenAPI 3.2 description that was inferred mechanically from recorded HTTP traffic, the component schemas it references, and a sample of the real recorded HTTP exchanges for that operation. The inferred description is only a hypothesis: types are coarse, every observed property is marked required, and descriptions are missing. Alternative body shapes observed in the traffic appear as "oneOf" variants or type unions. Common string formats (uuid, date-time, date, email, uri, ipv4) and small closed enums are detected conservatively from the observed values.
9
9
 
10
10
  Refine the operation into the most accurate OpenAPI 3.2 definition you can justify from the evidence, while staying conservative:
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{h as a}from"./3BCHPW6T.js";import"./P26PQ2RU.js";import"./RS5PUOTT.js";import"./NGPG6D6W.js";import"./O6MCQRCP.js";import"./32XCOMOR.js";import"./WNTLDT6L.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{a as RedoclyOAuthClient};
7
+ import{h as a}from"./XWDP43JH.js";import"./P26PQ2RU.js";import"./RS5PUOTT.js";import"./7LVD3IVI.js";import"./O6MCQRCP.js";import"./32XCOMOR.js";import"./PQKTPLKO.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{a as RedoclyOAuthClient};
@@ -4,5 +4,5 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{O as e}from"./WNTLDT6L.js";var n=["get","put","post","delete","options","head","patch","trace","query"],o=["schemas","responses","parameters","examples","headers","requestBodies","links","callbacks","securitySchemes"];import*as r from"node:process";var i=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],t=class{frames;currentFrame;intervalId;message;constructor(){this.frames=i,this.currentFrame=0,this.intervalId=null,this.message=""}showFrame(){e.info("\r"+this.frames[this.currentFrame]+" "+this.message),this.currentFrame=(this.currentFrame+1)%this.frames.length}start(s){if(this.message!==s){if(this.message=s,!r.stderr.isTTY){e.info(`${s}...
7
+ import{O as e}from"./PQKTPLKO.js";var n=["get","put","post","delete","options","head","patch","trace","query"],o=["schemas","responses","parameters","examples","headers","requestBodies","links","callbacks","securitySchemes"];import*as r from"node:process";var i=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],t=class{frames;currentFrame;intervalId;message;constructor(){this.frames=i,this.currentFrame=0,this.intervalId=null,this.message=""}showFrame(){e.info("\r"+this.frames[this.currentFrame]+" "+this.message),this.currentFrame=(this.currentFrame+1)%this.frames.length}start(s){if(this.message!==s){if(this.message=s,!r.stderr.isTTY){e.info(`${s}...
8
8
  `);return}this.intervalId===null&&(this.intervalId=setInterval(()=>{this.showFrame()},100))}}stop(){this.intervalId!==null&&(clearInterval(this.intervalId),this.intervalId=null,e.info("\r")),this.message=""}};export{n as a,o as b,t as c};
@@ -4,6 +4,6 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{b as m,j as C,o as a,p,q as T,r as l,s as h,t as f,u as d}from"./L3YH7RCT.js";import{c as g}from"./WNTLDT6L.js";import A from"node:path";function L(e,n){if(C(e)!=="application/x-www-form-urlencoded"||!Array.isArray(n))return;let o=new URLSearchParams;for(let s of n){if(!g(s))continue;let t=a(s.name);t!==void 0&&o.append(t,a(s.value)??"")}return o.size>0?o.toString():void 0}function K(e,n,o){let s=e?.request,t=e?.response;if(!s)return null;let r=s?.postData,i=a(r?.mimeType),u=r?.text??L(i,r?.params),c=a(r?.encoding),y=t?.content?.text,S=a(t?.content?.encoding),q=p(t?.status);return l({method:a(s?.method),url:a(s?.url),requestHeaders:s?.headers,requestBody:T(u,c),requestContentType:i,responseStatus:q===0?void 0:q,responseStatusText:a(t?.statusText),responseHeaders:t?.headers,responseBody:T(y,S),responseContentType:a(t?.content?.mimeType),startedAt:a(e?.startedDateTime),raw:e},n,o)}var b=class{id="har";canParse(n,o){if(A.extname(n).toLowerCase()===".har")return!0;let t=o.toLowerCase();return t.includes('"log"')&&t.includes('"entries"')}async*parse(n){let o=0;for await(let s of f(n,"log.entries")){let t=K(s,o,n);t&&(yield t),o+=1}}};import $ from"node:path";function H(e){let n=a(e.url??e.uri);if(n)return{url:n};let o=a(e.host??e.headers?.host),s=a(e.path??e.request_uri),t=a(e.scheme??e.forwarded_proto);return o&&s?{url:`${t??"http"}://${o}${s}`,schemeKnown:!!t}:{url:s,schemeKnown:!!t}}function z(e,n,o){let s=e?.request??e?.req??e?.http?.request;if(!s)return null;let t=e?.response??e?.res??e?.http?.response,r=t?.body??t?.raw_body??t?.payload??t?.data,i=s?.body??s?.raw_body??s?.payload??s?.data,{url:u,schemeKnown:c}=H(s);return l({method:a(s?.method??s?.http_method),url:u,schemeKnown:c,requestHeaders:s?.headers,requestBody:i,requestContentType:d(s?.headers),responseStatus:p(t?.status??t?.statusCode),responseHeaders:t?.headers,responseBody:r,responseContentType:d(t?.headers),startedAt:a(e?.started_at??e?.startedAt??e?.timestamp),raw:e},n,o)}var x=class{id="kong";canParse(n,o){if($.extname(n).toLowerCase()===".kong")return!0;let t=o.toLowerCase();return t.includes('"latencies"')||t.includes('"request"')&&t.includes('"response"')&&t.includes('"route"')}async*parse(n){let o=(await m(n,16)).trim().slice(0,1),s=0;if(o==="["){for await(let t of f(n)){let r=z(t,s,n);r&&(yield r),s+=1}return}for await(let t of h(n)){let r=z(t,s,n);r&&(yield r),s+=1}}};import R from"node:path";function U(e){return e?.request??e?.req??e?.httpRequest??e?.http?.request??e}function I(e){return e?.response??e?.res??e?.httpResponse??e?.http?.response}function O(e,n){let o=a(n?.url??n?.uri??n?.requestUrl??e?.url);if(o)return{url:o};let s=a(n?.host??n?.headers?.host??e?.host),t=a(n?.path??e?.path??n?.pathname),r=a(n?.scheme??e?.scheme);return s&&t?{url:`${r??"http"}://${s}${t}`,schemeKnown:!!r}:{url:t,schemeKnown:!!r}}function k(e,n,o){let s=U(e),t=I(e),r=s?.body??s?.bodyText??s?.payload??s?.data??s?.rawBody,i=t?.body??t?.bodyText??t?.payload??t?.data??t?.rawBody,{url:u,schemeKnown:c}=O(e,s);return l({method:a(s?.method??s?.httpMethod??e?.method??e?.httpMethod),url:u,schemeKnown:c,requestHeaders:s?.headers,requestBody:r,requestContentType:d(s?.headers),responseStatus:p(t?.status??t?.statusCode??e?.status??e?.statusCode),responseHeaders:t?.headers,responseBody:i,responseContentType:d(t?.headers),startedAt:a(e?.startedAt??e?.timestamp??e?.time),raw:e},n,o)}var w=class{id="ndjson";canParse(n,o){let s=R.extname(n).toLowerCase();if(s===".ndjson"||s===".jsonl"||s===".jsonlines")return!0;let t=o.lastIndexOf(`
7
+ import{b as m,j as C,o as a,p,q as T,r as l,s as h,t as f,u as d}from"./F4I4B6CF.js";import{c as g}from"./PQKTPLKO.js";import A from"node:path";function L(e,n){if(C(e)!=="application/x-www-form-urlencoded"||!Array.isArray(n))return;let o=new URLSearchParams;for(let s of n){if(!g(s))continue;let t=a(s.name);t!==void 0&&o.append(t,a(s.value)??"")}return o.size>0?o.toString():void 0}function K(e,n,o){let s=e?.request,t=e?.response;if(!s)return null;let r=s?.postData,i=a(r?.mimeType),u=r?.text??L(i,r?.params),c=a(r?.encoding),y=t?.content?.text,S=a(t?.content?.encoding),q=p(t?.status);return l({method:a(s?.method),url:a(s?.url),requestHeaders:s?.headers,requestBody:T(u,c),requestContentType:i,responseStatus:q===0?void 0:q,responseStatusText:a(t?.statusText),responseHeaders:t?.headers,responseBody:T(y,S),responseContentType:a(t?.content?.mimeType),startedAt:a(e?.startedDateTime),raw:e},n,o)}var b=class{id="har";canParse(n,o){if(A.extname(n).toLowerCase()===".har")return!0;let t=o.toLowerCase();return t.includes('"log"')&&t.includes('"entries"')}async*parse(n){let o=0;for await(let s of f(n,"log.entries")){let t=K(s,o,n);t&&(yield t),o+=1}}};import $ from"node:path";function H(e){let n=a(e.url??e.uri);if(n)return{url:n};let o=a(e.host??e.headers?.host),s=a(e.path??e.request_uri),t=a(e.scheme??e.forwarded_proto);return o&&s?{url:`${t??"http"}://${o}${s}`,schemeKnown:!!t}:{url:s,schemeKnown:!!t}}function z(e,n,o){let s=e?.request??e?.req??e?.http?.request;if(!s)return null;let t=e?.response??e?.res??e?.http?.response,r=t?.body??t?.raw_body??t?.payload??t?.data,i=s?.body??s?.raw_body??s?.payload??s?.data,{url:u,schemeKnown:c}=H(s);return l({method:a(s?.method??s?.http_method),url:u,schemeKnown:c,requestHeaders:s?.headers,requestBody:i,requestContentType:d(s?.headers),responseStatus:p(t?.status??t?.statusCode),responseHeaders:t?.headers,responseBody:r,responseContentType:d(t?.headers),startedAt:a(e?.started_at??e?.startedAt??e?.timestamp),raw:e},n,o)}var x=class{id="kong";canParse(n,o){if($.extname(n).toLowerCase()===".kong")return!0;let t=o.toLowerCase();return t.includes('"latencies"')||t.includes('"request"')&&t.includes('"response"')&&t.includes('"route"')}async*parse(n){let o=(await m(n,16)).trim().slice(0,1),s=0;if(o==="["){for await(let t of f(n)){let r=z(t,s,n);r&&(yield r),s+=1}return}for await(let t of h(n)){let r=z(t,s,n);r&&(yield r),s+=1}}};import R from"node:path";function U(e){return e?.request??e?.req??e?.httpRequest??e?.http?.request??e}function I(e){return e?.response??e?.res??e?.httpResponse??e?.http?.response}function O(e,n){let o=a(n?.url??n?.uri??n?.requestUrl??e?.url);if(o)return{url:o};let s=a(n?.host??n?.headers?.host??e?.host),t=a(n?.path??e?.path??n?.pathname),r=a(n?.scheme??e?.scheme);return s&&t?{url:`${r??"http"}://${s}${t}`,schemeKnown:!!r}:{url:t,schemeKnown:!!r}}function k(e,n,o){let s=U(e),t=I(e),r=s?.body??s?.bodyText??s?.payload??s?.data??s?.rawBody,i=t?.body??t?.bodyText??t?.payload??t?.data??t?.rawBody,{url:u,schemeKnown:c}=O(e,s);return l({method:a(s?.method??s?.httpMethod??e?.method??e?.httpMethod),url:u,schemeKnown:c,requestHeaders:s?.headers,requestBody:r,requestContentType:d(s?.headers),responseStatus:p(t?.status??t?.statusCode??e?.status??e?.statusCode),responseHeaders:t?.headers,responseBody:i,responseContentType:d(t?.headers),startedAt:a(e?.startedAt??e?.timestamp??e?.time),raw:e},n,o)}var w=class{id="ndjson";canParse(n,o){let s=R.extname(n).toLowerCase();if(s===".ndjson"||s===".jsonl"||s===".jsonlines")return!0;let t=o.lastIndexOf(`
8
8
  `),i=(t===-1?o:o.slice(0,t)).split(`
9
9
  `).map(u=>u.trim()).find(Boolean);if(!i?.startsWith("{")||!i.endsWith("}"))return!1;try{return JSON.parse(i),!0}catch{return!1}}async*parse(n){let o=0;for await(let s of h(n)){let t=k(s,o,n);t&&(yield t),o+=1}}};import J from"node:path";function P(e){if(!e)return{};let n=e.trim().split(/\s+/);return n.length<2?{}:{method:n[0],path:n[1],protocol:n[2]}}function W(e,n){let o=a(n?.url??n?.request_uri??n?.uri??e?.url??e?.request_url??e?.absolute_uri),s=P(a(e?.request??n?.request_line)),t=a(n?.request_uri??n?.uri??n?.path??e?.request_uri??e?.uri)??s.path;if(o?.startsWith("http://")||o?.startsWith("https://"))return{url:o};let r=a(n?.host??n?.headers?.host??e?.host??e?.http_host??e?.server_name??e?.vhost),i=a(e?.scheme??n?.scheme??e?.request_scheme),u=!!i;if(r&&(o||t)){let c=i??"http",y=o??t;return y?.startsWith("/")?{url:`${c}://${r}${y}`,schemeKnown:u}:{url:`${c}://${r}/${y}`,schemeKnown:u}}return{url:o??t,schemeKnown:u}}function E(e,n,o){let s=g(e?.request)?e.request:e,t=g(e?.response)?e.response:void 0,r=P(a(e?.request)),i=a(s?.method??s?.request_method??e?.request_method??e?.method)??r.method,{url:u,schemeKnown:c}=W(e,s);return l({method:i,url:u,schemeKnown:c,requestHeaders:s?.headers??s?.request_headers??e?.request_headers??e?.headers,requestBody:s?.body??s?.request_body??e?.request_body??e?.body,requestContentType:d(s?.headers??s?.request_headers??e?.request_headers),responseStatus:p(t?.status??t?.status_code??e?.status??e?.status_code??e?.response_status),responseHeaders:t?.headers??t?.response_headers??e?.response_headers??e?.headers_out,responseBody:t?.body??t?.response_body??e?.response_body,responseContentType:d(t?.headers??t?.response_headers??e?.response_headers),startedAt:a(e?.time_iso8601??e?.timestamp??e?.time??e?.time_local??e?.["@timestamp"]),raw:e},n,o)}async function*j(e){if((await m(e,16)).trim().slice(0,1)==="["){yield*f(e);return}for await(let o of h(e))yield o}var N=class{id="nginx-json";canParse(n,o){let s=J.extname(n).toLowerCase(),t=n.toLowerCase();if(s===".ndjson"&&t.includes("nginx"))return!0;let r=o.toLowerCase();return r.includes('"request_uri"')||r.includes('"time_iso8601"')||r.includes('"upstream_response_time"')||r.includes('"remote_addr"')}async*parse(n){let o=0;for await(let s of j(n)){let t=E(s,o,n);t&&(yield t),o+=1}}},_=class{id="apache-json";canParse(n,o){let s=J.extname(n).toLowerCase(),t=n.toLowerCase();if(s===".ndjson"&&t.includes("apache"))return!0;let r=o.toLowerCase();return r.includes('"request_method"')||r.includes('"request_uri"')||r.includes('"vhost"')||r.includes('"response_status"')}async*parse(n){let o=0;for await(let s of j(n)){let t=E(s,o,n);t&&(yield t),o+=1}}};var B=[new b,new x,new N,new _,new w];async function le(e,n){if(n!=="auto"){let s=B.find(t=>t.id===n);if(!s)throw new Error(`Unsupported parser format: ${n}`);return s}let o=await m(e);return B.find(s=>s.canParse(e,o))}export{le as a};
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{c as Wz,e as jz}from"./3VZLNQK3.js";import{b as g1}from"./X6IKW6K4.js";import{a as ere}from"./RS5PUOTT.js";import{d as Uz,e as Hz}from"./NGPG6D6W.js";import{a as tre,b as nre}from"./O6PRCLSV.js";import"./32XCOMOR.js";import{O as zv,k as Jne,s as p1,v as zz,w as $ne}from"./WNTLDT6L.js";import"./NEWT5A6S.js";import{a as Fr,b as Bz,c as j,d as Kne,e as Bv,f as Zne}from"./RFWIIJFG.js";var Yz=j((Vz,Gz)=>{(function(){var e=function(t){var n=new e.Builder;return n.pipeline.add(e.trimmer,e.stopWordFilter,e.stemmer),n.searchPipeline.add(e.stemmer),t.call(n,n),n.build()};e.version="2.3.9";e.utils={},e.utils.warn=(function(t){return function(n){t.console&&console.warn&&console.warn(n)}})(this),e.utils.asString=function(t){return t==null?"":t.toString()},e.utils.clone=function(t){if(t==null)return t;for(var n=Object.create(null),r=Object.keys(t),i=0;i<r.length;i++){var o=r[i],s=t[o];if(Array.isArray(s)){n[o]=s.slice();continue}if(typeof s=="string"||typeof s=="number"||typeof s=="boolean"){n[o]=s;continue}throw new TypeError("clone is not deep and does not support nested objects")}return n},e.FieldRef=function(t,n,r){this.docRef=t,this.fieldName=n,this._stringValue=r},e.FieldRef.joiner="/",e.FieldRef.fromString=function(t){var n=t.indexOf(e.FieldRef.joiner);if(n===-1)throw"malformed field ref string";var r=t.slice(0,n),i=t.slice(n+1);return new e.FieldRef(i,r,t)},e.FieldRef.prototype.toString=function(){return this._stringValue==null&&(this._stringValue=this.fieldName+e.FieldRef.joiner+this.docRef),this._stringValue};e.Set=function(t){if(this.elements=Object.create(null),t){this.length=t.length;for(var n=0;n<this.length;n++)this.elements[t[n]]=!0}else this.length=0},e.Set.complete={intersect:function(t){return t},union:function(){return this},contains:function(){return!0}},e.Set.empty={intersect:function(){return this},union:function(t){return t},contains:function(){return!1}},e.Set.prototype.contains=function(t){return!!this.elements[t]},e.Set.prototype.intersect=function(t){var n,r,i,o=[];if(t===e.Set.complete)return this;if(t===e.Set.empty)return t;this.length<t.length?(n=this,r=t):(n=t,r=this),i=Object.keys(n.elements);for(var s=0;s<i.length;s++){var a=i[s];a in r.elements&&o.push(a)}return new e.Set(o)},e.Set.prototype.union=function(t){return t===e.Set.complete?e.Set.complete:t===e.Set.empty?this:new e.Set(Object.keys(this.elements).concat(Object.keys(t.elements)))},e.idf=function(t,n){var r=0;for(var i in t)i!="_index"&&(r+=Object.keys(t[i]).length);var o=(n-r+.5)/(r+.5);return Math.log(1+Math.abs(o))},e.Token=function(t,n){this.str=t||"",this.metadata=n||{}},e.Token.prototype.toString=function(){return this.str},e.Token.prototype.update=function(t){return this.str=t(this.str,this.metadata),this},e.Token.prototype.clone=function(t){return t=t||function(n){return n},new e.Token(t(this.str,this.metadata),this.metadata)};e.tokenizer=function(t,n){if(t==null||t==null)return[];if(Array.isArray(t))return t.map(function(d){return new e.Token(e.utils.asString(d).toLowerCase(),e.utils.clone(n))});for(var r=t.toString().toLowerCase(),i=r.length,o=[],s=0,a=0;s<=i;s++){var l=r.charAt(s),c=s-a;if(l.match(e.tokenizer.separator)||s==i){if(c>0){var y=e.utils.clone(n)||{};y.position=[a,c],y.index=o.length,o.push(new e.Token(r.slice(a,s),y))}a=s+1}}return o},e.tokenizer.separator=/[\s\-]+/;e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,n){n in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+n),t.label=n,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var n=t.label&&t.label in this.registeredFunctions;n||e.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index.
7
+ import{c as Wz,e as jz}from"./UN3N7VZE.js";import{b as g1}from"./FJ3ZKIJG.js";import{a as ere}from"./RS5PUOTT.js";import{d as Uz,e as Hz}from"./7LVD3IVI.js";import{a as tre,b as nre}from"./O6PRCLSV.js";import"./32XCOMOR.js";import{O as zv,k as Jne,s as p1,v as zz,w as $ne}from"./PQKTPLKO.js";import"./NEWT5A6S.js";import{a as Fr,b as Bz,c as j,d as Kne,e as Bv,f as Zne}from"./RFWIIJFG.js";var Yz=j((Vz,Gz)=>{(function(){var e=function(t){var n=new e.Builder;return n.pipeline.add(e.trimmer,e.stopWordFilter,e.stemmer),n.searchPipeline.add(e.stemmer),t.call(n,n),n.build()};e.version="2.3.9";e.utils={},e.utils.warn=(function(t){return function(n){t.console&&console.warn&&console.warn(n)}})(this),e.utils.asString=function(t){return t==null?"":t.toString()},e.utils.clone=function(t){if(t==null)return t;for(var n=Object.create(null),r=Object.keys(t),i=0;i<r.length;i++){var o=r[i],s=t[o];if(Array.isArray(s)){n[o]=s.slice();continue}if(typeof s=="string"||typeof s=="number"||typeof s=="boolean"){n[o]=s;continue}throw new TypeError("clone is not deep and does not support nested objects")}return n},e.FieldRef=function(t,n,r){this.docRef=t,this.fieldName=n,this._stringValue=r},e.FieldRef.joiner="/",e.FieldRef.fromString=function(t){var n=t.indexOf(e.FieldRef.joiner);if(n===-1)throw"malformed field ref string";var r=t.slice(0,n),i=t.slice(n+1);return new e.FieldRef(i,r,t)},e.FieldRef.prototype.toString=function(){return this._stringValue==null&&(this._stringValue=this.fieldName+e.FieldRef.joiner+this.docRef),this._stringValue};e.Set=function(t){if(this.elements=Object.create(null),t){this.length=t.length;for(var n=0;n<this.length;n++)this.elements[t[n]]=!0}else this.length=0},e.Set.complete={intersect:function(t){return t},union:function(){return this},contains:function(){return!0}},e.Set.empty={intersect:function(){return this},union:function(t){return t},contains:function(){return!1}},e.Set.prototype.contains=function(t){return!!this.elements[t]},e.Set.prototype.intersect=function(t){var n,r,i,o=[];if(t===e.Set.complete)return this;if(t===e.Set.empty)return t;this.length<t.length?(n=this,r=t):(n=t,r=this),i=Object.keys(n.elements);for(var s=0;s<i.length;s++){var a=i[s];a in r.elements&&o.push(a)}return new e.Set(o)},e.Set.prototype.union=function(t){return t===e.Set.complete?e.Set.complete:t===e.Set.empty?this:new e.Set(Object.keys(this.elements).concat(Object.keys(t.elements)))},e.idf=function(t,n){var r=0;for(var i in t)i!="_index"&&(r+=Object.keys(t[i]).length);var o=(n-r+.5)/(r+.5);return Math.log(1+Math.abs(o))},e.Token=function(t,n){this.str=t||"",this.metadata=n||{}},e.Token.prototype.toString=function(){return this.str},e.Token.prototype.update=function(t){return this.str=t(this.str,this.metadata),this},e.Token.prototype.clone=function(t){return t=t||function(n){return n},new e.Token(t(this.str,this.metadata),this.metadata)};e.tokenizer=function(t,n){if(t==null||t==null)return[];if(Array.isArray(t))return t.map(function(d){return new e.Token(e.utils.asString(d).toLowerCase(),e.utils.clone(n))});for(var r=t.toString().toLowerCase(),i=r.length,o=[],s=0,a=0;s<=i;s++){var l=r.charAt(s),c=s-a;if(l.match(e.tokenizer.separator)||s==i){if(c>0){var y=e.utils.clone(n)||{};y.position=[a,c],y.index=o.length,o.push(new e.Token(r.slice(a,s),y))}a=s+1}}return o},e.tokenizer.separator=/[\s\-]+/;e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,n){n in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+n),t.label=n,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var n=t.label&&t.label in this.registeredFunctions;n||e.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index.
8
8
  `,t)},e.Pipeline.load=function(t){var n=new e.Pipeline;return t.forEach(function(r){var i=e.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(n){e.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},e.Pipeline.prototype.after=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(t);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},e.Pipeline.prototype.before=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(t);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},e.Pipeline.prototype.remove=function(t){var n=this._stack.indexOf(t);n!=-1&&this._stack.splice(n,1)},e.Pipeline.prototype.run=function(t){for(var n=this._stack.length,r=0;r<n;r++){for(var i=this._stack[r],o=[],s=0;s<t.length;s++){var a=i(t[s],s,t);if(!(a==null||a===""))if(Array.isArray(a))for(var l=0;l<a.length;l++)o.push(a[l]);else o.push(a)}t=o}return t},e.Pipeline.prototype.runString=function(t,n){var r=new e.Token(t,n);return this.run([r]).map(function(i){return i.toString()})},e.Pipeline.prototype.reset=function(){this._stack=[]},e.Pipeline.prototype.toJSON=function(){return this._stack.map(function(t){return e.Pipeline.warnIfFunctionNotRegistered(t),t.label})};e.Vector=function(t){this._magnitude=0,this.elements=t||[]},e.Vector.prototype.positionForIndex=function(t){if(this.elements.length==0)return 0;for(var n=0,r=this.elements.length/2,i=r-n,o=Math.floor(i/2),s=this.elements[o*2];i>1&&(s<t&&(n=o),s>t&&(r=o),s!=t);)i=r-n,o=n+Math.floor(i/2),s=this.elements[o*2];if(s==t||s>t)return o*2;if(s<t)return(o+1)*2},e.Vector.prototype.insert=function(t,n){this.upsert(t,n,function(){throw"duplicate index"})},e.Vector.prototype.upsert=function(t,n,r){this._magnitude=0;var i=this.positionForIndex(t);this.elements[i]==t?this.elements[i+1]=r(this.elements[i+1],n):this.elements.splice(i,0,t,n)},e.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var t=0,n=this.elements.length,r=1;r<n;r+=2){var i=this.elements[r];t+=i*i}return this._magnitude=Math.sqrt(t)},e.Vector.prototype.dot=function(t){for(var n=0,r=this.elements,i=t.elements,o=r.length,s=i.length,a=0,l=0,c=0,y=0;c<o&&y<s;)a=r[c],l=i[y],a<l?c+=2:a>l?y+=2:a==l&&(n+=r[c+1]*i[y+1],c+=2,y+=2);return n},e.Vector.prototype.similarity=function(t){return this.dot(t)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var t=new Array(this.elements.length/2),n=1,r=0;n<this.elements.length;n+=2,r++)t[r]=this.elements[n];return t},e.Vector.prototype.toJSON=function(){return this.elements};e.stemmer=(function(){var t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},n={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},r="[^aeiou]",i="[aeiouy]",o=r+"[^aeiouy]*",s=i+"[aeiou]*",a="^("+o+")?"+s+o,l="^("+o+")?"+s+o+"("+s+")?$",c="^("+o+")?"+s+o+s+o,y="^("+o+")?"+i,d=new RegExp(a),v=new RegExp(c),x=new RegExp(l),T=new RegExp(y),O=/^(.+?)(ss|i)es$/,k=/^(.+?)([^s])s$/,R=/^(.+?)eed$/,N=/^(.+?)(ed|ing)$/,W=/.$/,V=/(at|bl|iz)$/,$=new RegExp("([^aeiouylsz])\\1$"),z=new RegExp("^"+o+i+"[^aeiouwxy]$"),oe=/^(.+?[^aeiou])y$/,H=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,ie=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,re=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,fe=/^(.+?)(s|t)(ion)$/,he=/^(.+?)e$/,Y=/ll$/,le=new RegExp("^"+o+i+"[^aeiouwxy]$"),de=function(ce){var Ee,pe,Oe,ne,_e,De,at;if(ce.length<3)return ce;if(Oe=ce.substr(0,1),Oe=="y"&&(ce=Oe.toUpperCase()+ce.substr(1)),ne=O,_e=k,ne.test(ce)?ce=ce.replace(ne,"$1$2"):_e.test(ce)&&(ce=ce.replace(_e,"$1$2")),ne=R,_e=N,ne.test(ce)){var Ge=ne.exec(ce);ne=d,ne.test(Ge[1])&&(ne=W,ce=ce.replace(ne,""))}else if(_e.test(ce)){var Ge=_e.exec(ce);Ee=Ge[1],_e=T,_e.test(Ee)&&(ce=Ee,_e=V,De=$,at=z,_e.test(ce)?ce=ce+"e":De.test(ce)?(ne=W,ce=ce.replace(ne,"")):at.test(ce)&&(ce=ce+"e"))}if(ne=oe,ne.test(ce)){var Ge=ne.exec(ce);Ee=Ge[1],ce=Ee+"i"}if(ne=H,ne.test(ce)){var Ge=ne.exec(ce);Ee=Ge[1],pe=Ge[2],ne=d,ne.test(Ee)&&(ce=Ee+t[pe])}if(ne=ie,ne.test(ce)){var Ge=ne.exec(ce);Ee=Ge[1],pe=Ge[2],ne=d,ne.test(Ee)&&(ce=Ee+n[pe])}if(ne=re,_e=fe,ne.test(ce)){var Ge=ne.exec(ce);Ee=Ge[1],ne=v,ne.test(Ee)&&(ce=Ee)}else if(_e.test(ce)){var Ge=_e.exec(ce);Ee=Ge[1]+Ge[2],_e=v,_e.test(Ee)&&(ce=Ee)}if(ne=he,ne.test(ce)){var Ge=ne.exec(ce);Ee=Ge[1],ne=v,_e=x,De=le,(ne.test(Ee)||_e.test(Ee)&&!De.test(Ee))&&(ce=Ee)}return ne=Y,_e=v,ne.test(ce)&&_e.test(ce)&&(ne=W,ce=ce.replace(ne,"")),Oe=="y"&&(ce=Oe.toLowerCase()+ce.substr(1)),ce};return function(ve){return ve.update(de)}})(),e.Pipeline.registerFunction(e.stemmer,"stemmer");e.generateStopWordFilter=function(t){var n=t.reduce(function(r,i){return r[i]=i,r},{});return function(r){if(r&&n[r.toString()]!==r.toString())return r}},e.stopWordFilter=e.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),e.Pipeline.registerFunction(e.stopWordFilter,"stopWordFilter");e.trimmer=function(t){return t.update(function(n){return n.replace(/^\W+/,"").replace(/\W+$/,"")})},e.Pipeline.registerFunction(e.trimmer,"trimmer");e.TokenSet=function(){this.final=!1,this.edges={},this.id=e.TokenSet._nextId,e.TokenSet._nextId+=1},e.TokenSet._nextId=1,e.TokenSet.fromArray=function(t){for(var n=new e.TokenSet.Builder,r=0,i=t.length;r<i;r++)n.insert(t[r]);return n.finish(),n.root},e.TokenSet.fromClause=function(t){return"editDistance"in t?e.TokenSet.fromFuzzyString(t.term,t.editDistance):e.TokenSet.fromString(t.term)},e.TokenSet.fromFuzzyString=function(t,n){for(var r=new e.TokenSet,i=[{node:r,editsRemaining:n,str:t}];i.length;){var o=i.pop();if(o.str.length>0){var s=o.str.charAt(0),a;s in o.node.edges?a=o.node.edges[s]:(a=new e.TokenSet,o.node.edges[s]=a),o.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:o.editsRemaining,str:o.str.slice(1)})}if(o.editsRemaining!=0){if("*"in o.node.edges)var l=o.node.edges["*"];else{var l=new e.TokenSet;o.node.edges["*"]=l}if(o.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:o.editsRemaining-1,str:o.str}),o.str.length>1&&i.push({node:o.node,editsRemaining:o.editsRemaining-1,str:o.str.slice(1)}),o.str.length==1&&(o.node.final=!0),o.str.length>=1){if("*"in o.node.edges)var c=o.node.edges["*"];else{var c=new e.TokenSet;o.node.edges["*"]=c}o.str.length==1&&(c.final=!0),i.push({node:c,editsRemaining:o.editsRemaining-1,str:o.str.slice(1)})}if(o.str.length>1){var y=o.str.charAt(0),d=o.str.charAt(1),v;d in o.node.edges?v=o.node.edges[d]:(v=new e.TokenSet,o.node.edges[d]=v),o.str.length==1&&(v.final=!0),i.push({node:v,editsRemaining:o.editsRemaining-1,str:y+o.str.slice(2)})}}}return r},e.TokenSet.fromString=function(t){for(var n=new e.TokenSet,r=n,i=0,o=t.length;i<o;i++){var s=t[i],a=i==o-1;if(s=="*")n.edges[s]=n,n.final=a;else{var l=new e.TokenSet;l.final=a,n.edges[s]=l,n=l}}return r},e.TokenSet.prototype.toArray=function(){for(var t=[],n=[{prefix:"",node:this}];n.length;){var r=n.pop(),i=Object.keys(r.node.edges),o=i.length;r.node.final&&(r.prefix.charAt(0),t.push(r.prefix));for(var s=0;s<o;s++){var a=i[s];n.push({prefix:r.prefix.concat(a),node:r.node.edges[a]})}}return t},e.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var t=this.final?"1":"0",n=Object.keys(this.edges).sort(),r=n.length,i=0;i<r;i++){var o=n[i],s=this.edges[o];t=t+o+s.id}return t},e.TokenSet.prototype.intersect=function(t){for(var n=new e.TokenSet,r=void 0,i=[{qNode:t,output:n,node:this}];i.length;){r=i.pop();for(var o=Object.keys(r.qNode.edges),s=o.length,a=Object.keys(r.node.edges),l=a.length,c=0;c<s;c++)for(var y=o[c],d=0;d<l;d++){var v=a[d];if(v==y||y=="*"){var x=r.node.edges[v],T=r.qNode.edges[y],O=x.final&&T.final,k=void 0;v in r.output.edges?(k=r.output.edges[v],k.final=k.final||O):(k=new e.TokenSet,k.final=O,r.output.edges[v]=k),i.push({qNode:T,output:k,node:x})}}}return n},e.TokenSet.Builder=function(){this.previousWord="",this.root=new e.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},e.TokenSet.Builder.prototype.insert=function(t){var n,r=0;if(t<this.previousWord)throw new Error("Out of order word insertion");for(var i=0;i<t.length&&i<this.previousWord.length&&t[i]==this.previousWord[i];i++)r++;this.minimize(r),this.uncheckedNodes.length==0?n=this.root:n=this.uncheckedNodes[this.uncheckedNodes.length-1].child;for(var i=r;i<t.length;i++){var o=new e.TokenSet,s=t[i];n.edges[s]=o,this.uncheckedNodes.push({parent:n,char:s,child:o}),n=o}n.final=!0,this.previousWord=t},e.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},e.TokenSet.Builder.prototype.minimize=function(t){for(var n=this.uncheckedNodes.length-1;n>=t;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};e.Index=function(t){this.invertedIndex=t.invertedIndex,this.fieldVectors=t.fieldVectors,this.tokenSet=t.tokenSet,this.fields=t.fields,this.pipeline=t.pipeline},e.Index.prototype.search=function(t){return this.query(function(n){var r=new e.QueryParser(t,n);r.parse()})},e.Index.prototype.query=function(t){for(var n=new e.Query(this.fields),r=Object.create(null),i=Object.create(null),o=Object.create(null),s=Object.create(null),a=Object.create(null),l=0;l<this.fields.length;l++)i[this.fields[l]]=new e.Vector;t.call(n,n);for(var l=0;l<n.clauses.length;l++){var c=n.clauses[l],y=null,d=e.Set.empty;c.usePipeline?y=this.pipeline.runString(c.term,{fields:c.fields}):y=[c.term];for(var v=0;v<y.length;v++){var x=y[v];c.term=x;var T=e.TokenSet.fromClause(c),O=this.tokenSet.intersect(T).toArray();if(O.length===0&&c.presence===e.Query.presence.REQUIRED){for(var k=0;k<c.fields.length;k++){var R=c.fields[k];s[R]=e.Set.empty}break}for(var N=0;N<O.length;N++)for(var W=O[N],V=this.invertedIndex[W],$=V._index,k=0;k<c.fields.length;k++){var R=c.fields[k],z=V[R],oe=Object.keys(z),H=W+"/"+R,ie=new e.Set(oe);if(c.presence==e.Query.presence.REQUIRED&&(d=d.union(ie),s[R]===void 0&&(s[R]=e.Set.complete)),c.presence==e.Query.presence.PROHIBITED){a[R]===void 0&&(a[R]=e.Set.empty),a[R]=a[R].union(ie);continue}if(i[R].upsert($,c.boost,function(Q,Le){return Q+Le}),!o[H]){for(var re=0;re<oe.length;re++){var fe=oe[re],he=new e.FieldRef(fe,R),Y=z[fe],le;(le=r[he])===void 0?r[he]=new e.MatchData(W,R,Y):le.add(W,R,Y)}o[H]=!0}}}if(c.presence===e.Query.presence.REQUIRED)for(var k=0;k<c.fields.length;k++){var R=c.fields[k];s[R]=s[R].intersect(d)}}for(var de=e.Set.complete,ve=e.Set.empty,l=0;l<this.fields.length;l++){var R=this.fields[l];s[R]&&(de=de.intersect(s[R])),a[R]&&(ve=ve.union(a[R]))}var ce=Object.keys(r),Ee=[],pe=Object.create(null);if(n.isNegated()){ce=Object.keys(this.fieldVectors);for(var l=0;l<ce.length;l++){var he=ce[l],Oe=e.FieldRef.fromString(he);r[he]=new e.MatchData}}for(var l=0;l<ce.length;l++){var Oe=e.FieldRef.fromString(ce[l]),ne=Oe.docRef;if(de.contains(ne)&&!ve.contains(ne)){var _e=this.fieldVectors[Oe],De=i[Oe.fieldName].similarity(_e),at;if((at=pe[ne])!==void 0)at.score+=De,at.matchData.combine(r[Oe]);else{var Ge={ref:ne,score:De,matchData:r[Oe]};pe[ne]=Ge,Ee.push(Ge)}}}return Ee.sort(function(Se,Fe){return Fe.score-Se.score})},e.Index.prototype.toJSON=function(){var t=Object.keys(this.invertedIndex).sort().map(function(r){return[r,this.invertedIndex[r]]},this),n=Object.keys(this.fieldVectors).map(function(r){return[r,this.fieldVectors[r].toJSON()]},this);return{version:e.version,fields:this.fields,fieldVectors:n,invertedIndex:t,pipeline:this.pipeline.toJSON()}},e.Index.load=function(t){var n={},r={},i=t.fieldVectors,o=Object.create(null),s=t.invertedIndex,a=new e.TokenSet.Builder,l=e.Pipeline.load(t.pipeline);t.version!=e.version&&e.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+e.version+"' does not match serialized index '"+t.version+"'");for(var c=0;c<i.length;c++){var y=i[c],d=y[0],v=y[1];r[d]=new e.Vector(v)}for(var c=0;c<s.length;c++){var y=s[c],x=y[0],T=y[1];a.insert(x),o[x]=T}return a.finish(),n.fields=t.fields,n.fieldVectors=r,n.invertedIndex=o,n.tokenSet=a.root,n.pipeline=l,new e.Index(n)};e.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=e.tokenizer,this.pipeline=new e.Pipeline,this.searchPipeline=new e.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},e.Builder.prototype.ref=function(t){this._ref=t},e.Builder.prototype.field=function(t,n){if(/\//.test(t))throw new RangeError("Field '"+t+"' contains illegal character '/'");this._fields[t]=n||{}},e.Builder.prototype.b=function(t){t<0?this._b=0:t>1?this._b=1:this._b=t},e.Builder.prototype.k1=function(t){this._k1=t},e.Builder.prototype.add=function(t,n){var r=t[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var o=0;o<i.length;o++){var s=i[o],a=this._fields[s].extractor,l=a?a(t):t[s],c=this.tokenizer(l,{fields:[s]}),y=this.pipeline.run(c),d=new e.FieldRef(r,s),v=Object.create(null);this.fieldTermFrequencies[d]=v,this.fieldLengths[d]=0,this.fieldLengths[d]+=y.length;for(var x=0;x<y.length;x++){var T=y[x];if(v[T]==null&&(v[T]=0),v[T]+=1,this.invertedIndex[T]==null){var O=Object.create(null);O._index=this.termIndex,this.termIndex+=1;for(var k=0;k<i.length;k++)O[i[k]]=Object.create(null);this.invertedIndex[T]=O}this.invertedIndex[T][s][r]==null&&(this.invertedIndex[T][s][r]=Object.create(null));for(var R=0;R<this.metadataWhitelist.length;R++){var N=this.metadataWhitelist[R],W=T.metadata[N];this.invertedIndex[T][s][r][N]==null&&(this.invertedIndex[T][s][r][N]=[]),this.invertedIndex[T][s][r][N].push(W)}}}},e.Builder.prototype.calculateAverageFieldLengths=function(){for(var t=Object.keys(this.fieldLengths),n=t.length,r={},i={},o=0;o<n;o++){var s=e.FieldRef.fromString(t[o]),a=s.fieldName;i[a]||(i[a]=0),i[a]+=1,r[a]||(r[a]=0),r[a]+=this.fieldLengths[s]}for(var l=Object.keys(this._fields),o=0;o<l.length;o++){var c=l[o];r[c]=r[c]/i[c]}this.averageFieldLength=r},e.Builder.prototype.createFieldVectors=function(){for(var t={},n=Object.keys(this.fieldTermFrequencies),r=n.length,i=Object.create(null),o=0;o<r;o++){for(var s=e.FieldRef.fromString(n[o]),a=s.fieldName,l=this.fieldLengths[s],c=new e.Vector,y=this.fieldTermFrequencies[s],d=Object.keys(y),v=d.length,x=this._fields[a].boost||1,T=this._documents[s.docRef].boost||1,O=0;O<v;O++){var k=d[O],R=y[k],N=this.invertedIndex[k]._index,W,V,$;i[k]===void 0?(W=e.idf(this.invertedIndex[k],this.documentCount),i[k]=W):W=i[k],V=W*((this._k1+1)*R)/(this._k1*(1-this._b+this._b*(l/this.averageFieldLength[a]))+R),V*=x,V*=T,$=Math.round(V*1e3)/1e3,c.insert(N,$)}t[s]=c}this.fieldVectors=t},e.Builder.prototype.createTokenSet=function(){this.tokenSet=e.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},e.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new e.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},e.Builder.prototype.use=function(t){var n=Array.prototype.slice.call(arguments,1);n.unshift(this),t.apply(this,n)},e.MatchData=function(t,n,r){for(var i=Object.create(null),o=Object.keys(r||{}),s=0;s<o.length;s++){var a=o[s];i[a]=r[a].slice()}this.metadata=Object.create(null),t!==void 0&&(this.metadata[t]=Object.create(null),this.metadata[t][n]=i)},e.MatchData.prototype.combine=function(t){for(var n=Object.keys(t.metadata),r=0;r<n.length;r++){var i=n[r],o=Object.keys(t.metadata[i]);this.metadata[i]==null&&(this.metadata[i]=Object.create(null));for(var s=0;s<o.length;s++){var a=o[s],l=Object.keys(t.metadata[i][a]);this.metadata[i][a]==null&&(this.metadata[i][a]=Object.create(null));for(var c=0;c<l.length;c++){var y=l[c];this.metadata[i][a][y]==null?this.metadata[i][a][y]=t.metadata[i][a][y]:this.metadata[i][a][y]=this.metadata[i][a][y].concat(t.metadata[i][a][y])}}}},e.MatchData.prototype.add=function(t,n,r){if(!(t in this.metadata)){this.metadata[t]=Object.create(null),this.metadata[t][n]=r;return}if(!(n in this.metadata[t])){this.metadata[t][n]=r;return}for(var i=Object.keys(r),o=0;o<i.length;o++){var s=i[o];s in this.metadata[t][n]?this.metadata[t][n][s]=this.metadata[t][n][s].concat(r[s]):this.metadata[t][n][s]=r[s]}},e.Query=function(t){this.clauses=[],this.allFields=t},e.Query.wildcard=new String("*"),e.Query.wildcard.NONE=0,e.Query.wildcard.LEADING=1,e.Query.wildcard.TRAILING=2,e.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},e.Query.prototype.clause=function(t){return"fields"in t||(t.fields=this.allFields),"boost"in t||(t.boost=1),"usePipeline"in t||(t.usePipeline=!0),"wildcard"in t||(t.wildcard=e.Query.wildcard.NONE),t.wildcard&e.Query.wildcard.LEADING&&t.term.charAt(0)!=e.Query.wildcard&&(t.term="*"+t.term),t.wildcard&e.Query.wildcard.TRAILING&&t.term.slice(-1)!=e.Query.wildcard&&(t.term=""+t.term+"*"),"presence"in t||(t.presence=e.Query.presence.OPTIONAL),this.clauses.push(t),this},e.Query.prototype.isNegated=function(){for(var t=0;t<this.clauses.length;t++)if(this.clauses[t].presence!=e.Query.presence.PROHIBITED)return!1;return!0},e.Query.prototype.term=function(t,n){if(Array.isArray(t))return t.forEach(function(i){this.term(i,e.utils.clone(n))},this),this;var r=n||{};return r.term=t.toString(),this.clause(r),this},e.QueryParseError=function(t,n,r){this.name="QueryParseError",this.message=t,this.start=n,this.end=r},e.QueryParseError.prototype=new Error,e.QueryLexer=function(t){this.lexemes=[],this.str=t,this.length=t.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},e.QueryLexer.prototype.run=function(){for(var t=e.QueryLexer.lexText;t;)t=t(this)},e.QueryLexer.prototype.sliceString=function(){for(var t=[],n=this.start,r=this.pos,i=0;i<this.escapeCharPositions.length;i++)r=this.escapeCharPositions[i],t.push(this.str.slice(n,r)),n=r+1;return t.push(this.str.slice(n,this.pos)),this.escapeCharPositions.length=0,t.join("")},e.QueryLexer.prototype.emit=function(t){this.lexemes.push({type:t,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},e.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},e.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,n;do t=this.next(),n=t.charCodeAt(0);while(n>47&&n<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos<this.length},e.QueryLexer.EOS="EOS",e.QueryLexer.FIELD="FIELD",e.QueryLexer.TERM="TERM",e.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",e.QueryLexer.BOOST="BOOST",e.QueryLexer.PRESENCE="PRESENCE",e.QueryLexer.lexField=function(t){return t.backup(),t.emit(e.QueryLexer.FIELD),t.ignore(),e.QueryLexer.lexText},e.QueryLexer.lexTerm=function(t){if(t.width()>1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var n=t.next();if(n==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){t.escapeCharacter();continue}if(n==":")return e.QueryLexer.lexField;if(n=="~")return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if(n=="^")return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if(n=="+"&&t.width()===1||n=="-"&&t.width()===1)return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(n.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}},e.QueryParser=function(t,n){this.lexer=new e.QueryLexer(t),this.query=n,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var t=this.peekLexeme();return this.lexemeIdx+=1,t},e.QueryParser.prototype.nextClause=function(){var t=this.currentClause;this.query.clause(t),this.currentClause={}},e.QueryParser.parseClause=function(t){var n=t.peekLexeme();if(n!=null)switch(n.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new e.QueryParseError(r,n.start,n.end)}},e.QueryParser.parsePresence=function(t){var n=t.consumeLexeme();if(n!=null){switch(n.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new e.QueryParseError(r,n.start,n.end)}var i=t.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new e.QueryParseError(r,n.start,n.end)}switch(i.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new e.QueryParseError(r,i.start,i.end)}}},e.QueryParser.parseField=function(t){var n=t.consumeLexeme();if(n!=null){if(t.query.allFields.indexOf(n.str)==-1){var r=t.query.allFields.map(function(s){return"'"+s+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new e.QueryParseError(i,n.start,n.end)}t.currentClause.fields=[n.str];var o=t.peekLexeme();if(o==null){var i="expecting term, found nothing";throw new e.QueryParseError(i,n.start,n.end)}if(o.type===e.QueryLexer.TERM)return e.QueryParser.parseTerm;var i="expecting term, found '"+o.type+"'";throw new e.QueryParseError(i,o.start,o.end)}},e.QueryParser.parseTerm=function(t){var n=t.consumeLexeme();if(n!=null){t.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var r=t.peekLexeme();if(r==null){t.nextClause();return}switch(r.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new e.QueryParseError(i,r.start,r.end)}}},e.QueryParser.parseEditDistance=function(t){var n=t.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new e.QueryParseError(i,n.start,n.end)}t.currentClause.editDistance=r;var o=t.peekLexeme();if(o==null){t.nextClause();return}switch(o.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+o.type+"'";throw new e.QueryParseError(i,o.start,o.end)}}},e.QueryParser.parseBoost=function(t){var n=t.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new e.QueryParseError(i,n.start,n.end)}t.currentClause.boost=r;var o=t.peekLexeme();if(o==null){t.nextClause();return}switch(o.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+o.type+"'";throw new e.QueryParseError(i,o.start,o.end)}}},(function(t,n){typeof define=="function"&&define.amd?define(n):typeof Vz=="object"?Gz.exports=n():t.lunr=n()})(this,function(){return e})})()});var qz=j((ZFe,Xz)=>{"use strict";function rre(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(t){setTimeout(t,0)}}Xz.exports=rre()});var Zz=j((JFe,Kz)=>{"use strict";var Qz=qz();Kz.exports=function(t,n){if(t){n.then(function(r){Qz(function(){t(null,r)})},function(r){Qz(function(){t(r)})});return}else return n}});var r5=j(($Fe,n5)=>{n5.exports=kS;kS.default=kS;kS.stable=e5;kS.stableStringify=e5;var m1="[...]",Jz="[Circular]",Py=[],Cy=[];function $z(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function kS(e,t,n,r){typeof r>"u"&&(r=$z()),VA(e,"",0,[],void 0,0,r);var i;try{Cy.length===0?i=JSON.stringify(e,t,n):i=JSON.stringify(e,t5(t),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Py.length!==0;){var o=Py.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function Uv(e,t,n,r){var i=Object.getOwnPropertyDescriptor(r,n);i.get!==void 0?i.configurable?(Object.defineProperty(r,n,{value:e}),Py.push([r,n,t,i])):Cy.push([t,n,e]):(r[n]=e,Py.push([r,n,t]))}function VA(e,t,n,r,i,o,s){o+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<r.length;a++)if(r[a]===e){Uv(Jz,e,t,i);return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){Uv(m1,e,t,i);return}if(typeof s.edgesLimit<"u"&&n+1>s.edgesLimit){Uv(m1,e,t,i);return}if(r.push(e),Array.isArray(e))for(a=0;a<e.length;a++)VA(e[a],a,a,r,e,o,s);else{var l=Object.keys(e);for(a=0;a<l.length;a++){var c=l[a];VA(e[c],c,a,r,e,o,s)}}r.pop()}}function ire(e,t){return e<t?-1:e>t?1:0}function e5(e,t,n,r){typeof r>"u"&&(r=$z());var i=GA(e,"",0,[],void 0,0,r)||e,o;try{Cy.length===0?o=JSON.stringify(i,t,n):o=JSON.stringify(i,t5(t),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Py.length!==0;){var s=Py.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return o}function GA(e,t,n,r,i,o,s){o+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<r.length;a++)if(r[a]===e){Uv(Jz,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){Uv(m1,e,t,i);return}if(typeof s.edgesLimit<"u"&&n+1>s.edgesLimit){Uv(m1,e,t,i);return}if(r.push(e),Array.isArray(e))for(a=0;a<e.length;a++)GA(e[a],a,a,r,e,o,s);else{var l={},c=Object.keys(e).sort(ire);for(a=0;a<c.length;a++){var y=c[a];GA(e[y],y,a,r,e,o,s),l[y]=e[y]}if(typeof i<"u")Py.push([i,t,e]),i[t]=l;else return l}r.pop()}}function t5(e){return e=typeof e<"u"?e:function(t,n){return n},function(t,n){if(Cy.length>0)for(var r=0;r<Cy.length;r++){var i=Cy[r];if(i[1]===t&&i[0]===n){n=i[2],Cy.splice(r,1);break}}return e.call(this,t,n)}}});var o5=j((e3e,i5)=>{i5.exports=(function(e,t){e||(e=document),t||(t=window);var n=[],r,i=!1,o=e.documentElement,s=function(){},a,l="hidden",c="visibilitychange";e.webkitHidden!==void 0&&(l="webkitHidden",c="webkitvisibilitychange"),t.getComputedStyle||x();for(var y=["","-webkit-","-moz-","-ms-"],d=document.createElement("div"),v=y.length-1;v>=0;v--){try{d.style.position=y[v]+"sticky"}catch{}d.style.position!=""&&x()}k();function x(){pe=at=Oe=ne=_e=De=s}function T(Se,Fe){for(key in Fe)Fe.hasOwnProperty(key)&&(Se[key]=Fe[key])}function O(Se){return parseFloat(Se)||0}function k(){r={top:t.pageYOffset,left:t.pageXOffset}}function R(){if(t.pageXOffset!=r.left){k(),Oe();return}t.pageYOffset!=r.top&&(k(),W())}function N(Se){setTimeout(function(){t.pageYOffset!=r.top&&(r.top=t.pageYOffset,W())},0)}function W(){for(var Se=n.length-1;Se>=0;Se--)V(n[Se])}function V(Se){if(Se.inited){var Fe=r.top<=Se.limit.start?0:r.top>=Se.limit.end?2:1;Se.mode!=Fe&&re(Se,Fe)}}function $(){for(var Se=n.length-1;Se>=0;Se--)if(n[Se].inited){var Fe=Math.abs(le(n[Se].clone)-n[Se].docOffsetTop),L=Math.abs(n[Se].parent.node.offsetHeight-n[Se].parent.height);if(Fe>=2||L>=2)return!1}return!0}function z(Se){isNaN(parseFloat(Se.computed.top))||Se.isCell||(Se.inited=!0,Se.clone||fe(Se),Se.parent.computed.position!="absolute"&&Se.parent.computed.position!="relative"&&(Se.parent.node.style.position="relative"),V(Se),Se.parent.height=Se.parent.node.offsetHeight,Se.docOffsetTop=le(Se.clone))}function oe(Se){var Fe=!0;Se.clone&&he(Se),T(Se.node.style,Se.css);for(var L=n.length-1;L>=0;L--)if(n[L].node!==Se.node&&n[L].parent.node===Se.parent.node){Fe=!1;break}Fe&&(Se.parent.node.style.position=Se.parent.css.position),Se.mode=-1}function H(){for(var Se=n.length-1;Se>=0;Se--)z(n[Se])}function ie(){for(var Se=n.length-1;Se>=0;Se--)oe(n[Se])}function re(Se,Fe){var L=Se.node.style;switch(Fe){case 0:L.position="absolute",L.left=Se.offset.left+"px",L.right=Se.offset.right+"px",L.top=Se.offset.top+"px",L.bottom="auto",L.width="auto",L.marginLeft=0,L.marginRight=0,L.marginTop=0;break;case 1:L.position="fixed",L.left=Se.box.left+"px",L.right=Se.box.right+"px",L.top=Se.css.top,L.bottom="auto",L.width="auto",L.marginLeft=0,L.marginRight=0,L.marginTop=0;break;case 2:L.position="absolute",L.left=Se.offset.left+"px",L.right=Se.offset.right+"px",L.top="auto",L.bottom=0,L.width="auto",L.marginLeft=0,L.marginRight=0;break}Se.mode=Fe}function fe(Se){Se.clone=document.createElement("div");var Fe=Se.node.nextSibling||Se.node,L=Se.clone.style;L.height=Se.height+"px",L.width=Se.width+"px",L.marginTop=Se.computed.marginTop,L.marginBottom=Se.computed.marginBottom,L.marginLeft=Se.computed.marginLeft,L.marginRight=Se.computed.marginRight,L.padding=L.border=L.borderSpacing=0,L.fontSize="1em",L.position="static",L.cssFloat=Se.computed.cssFloat,Se.node.parentNode.insertBefore(Se.clone,Fe)}function he(Se){Se.clone.parentNode.removeChild(Se.clone),Se.clone=void 0}function Y(Se){var Fe=getComputedStyle(Se),L=Se.parentNode,Q=getComputedStyle(L),Le=Se.style.position;Se.style.position="relative";var Ye={top:Fe.top,marginTop:Fe.marginTop,marginBottom:Fe.marginBottom,marginLeft:Fe.marginLeft,marginRight:Fe.marginRight,cssFloat:Fe.cssFloat},Pe={top:O(Fe.top),marginBottom:O(Fe.marginBottom),paddingLeft:O(Fe.paddingLeft),paddingRight:O(Fe.paddingRight),borderLeftWidth:O(Fe.borderLeftWidth),borderRightWidth:O(Fe.borderRightWidth)};Se.style.position=Le;var q={position:Se.style.position,top:Se.style.top,bottom:Se.style.bottom,left:Se.style.left,right:Se.style.right,width:Se.style.width,marginTop:Se.style.marginTop,marginLeft:Se.style.marginLeft,marginRight:Se.style.marginRight},ee=de(Se),Re=de(L),Te={node:L,css:{position:L.style.position},computed:{position:Q.position},numeric:{borderLeftWidth:O(Q.borderLeftWidth),borderRightWidth:O(Q.borderRightWidth),borderTopWidth:O(Q.borderTopWidth),borderBottomWidth:O(Q.borderBottomWidth)}},nt={node:Se,box:{left:ee.win.left,right:o.clientWidth-ee.win.right},offset:{top:ee.win.top-Re.win.top-Te.numeric.borderTopWidth,left:ee.win.left-Re.win.left-Te.numeric.borderLeftWidth,right:-ee.win.right+Re.win.right-Te.numeric.borderRightWidth},css:q,isCell:Fe.display=="table-cell",computed:Ye,numeric:Pe,width:ee.win.right-ee.win.left,height:ee.win.bottom-ee.win.top,mode:-1,inited:!1,parent:Te,limit:{start:ee.doc.top-Pe.top,end:Re.doc.top+L.offsetHeight-Te.numeric.borderBottomWidth-Se.offsetHeight-Pe.top-Pe.marginBottom}};return nt}function le(Se){for(var Fe=0;Se;)Fe+=Se.offsetTop,Se=Se.offsetParent;return Fe}function de(Se){var Fe=Se.getBoundingClientRect();return{doc:{top:Fe.top+t.pageYOffset,left:Fe.left+t.pageXOffset},win:Fe}}function ve(){a=setInterval(function(){!$()&&Oe()},500)}function ce(){clearInterval(a)}function Ee(){i&&(document[l]?ce():ve())}function pe(){i||(k(),H(),t.addEventListener("scroll",R),t.addEventListener("wheel",N),t.addEventListener("resize",Oe),t.addEventListener("orientationchange",Oe),e.addEventListener(c,Ee),ve(),i=!0)}function Oe(){if(i){ie();for(var Se=n.length-1;Se>=0;Se--)n[Se]=Y(n[Se].node);H()}}function ne(){t.removeEventListener("scroll",R),t.removeEventListener("wheel",N),t.removeEventListener("resize",Oe),t.removeEventListener("orientationchange",Oe),e.removeEventListener(c,Ee),ce(),i=!1}function _e(){ne(),ie()}function De(){for(_e();n.length;)n.pop()}function at(Se){for(var Fe=n.length-1;Fe>=0;Fe--)if(n[Fe].node===Se)return;var L=Y(Se);n.push(L),i?z(L):pe()}function Ge(Se){for(var Fe=n.length-1;Fe>=0;Fe--)n[Fe].node===Se&&(oe(n[Fe]),n.splice(Fe,1))}return{stickies:n,add:at,remove:Ge,init:pe,rebuild:Oe,pause:ne,stop:_e,kill:De}})});var tr=j(oa=>{"use strict";var YA=Symbol.for("yaml.alias"),s5=Symbol.for("yaml.document"),y1=Symbol.for("yaml.map"),a5=Symbol.for("yaml.pair"),XA=Symbol.for("yaml.scalar"),b1=Symbol.for("yaml.seq"),ep=Symbol.for("yaml.node.type"),ore=e=>!!e&&typeof e=="object"&&e[ep]===YA,sre=e=>!!e&&typeof e=="object"&&e[ep]===s5,are=e=>!!e&&typeof e=="object"&&e[ep]===y1,lre=e=>!!e&&typeof e=="object"&&e[ep]===a5,l5=e=>!!e&&typeof e=="object"&&e[ep]===XA,cre=e=>!!e&&typeof e=="object"&&e[ep]===b1;function c5(e){if(e&&typeof e=="object")switch(e[ep]){case y1:case b1:return!0}return!1}function ure(e){if(e&&typeof e=="object")switch(e[ep]){case YA:case y1:case XA:case b1:return!0}return!1}var fre=e=>(l5(e)||c5(e))&&!!e.anchor;oa.ALIAS=YA;oa.DOC=s5;oa.MAP=y1;oa.NODE_TYPE=ep;oa.PAIR=a5;oa.SCALAR=XA;oa.SEQ=b1;oa.hasAnchor=fre;oa.isAlias=ore;oa.isCollection=c5;oa.isDocument=sre;oa.isMap=are;oa.isNode=ure;oa.isPair=lre;oa.isScalar=l5;oa.isSeq=cre});var CS=j(qA=>{"use strict";var xs=tr(),dc=Symbol("break visit"),u5=Symbol("skip children"),Hd=Symbol("remove node");function v1(e,t){let n=f5(t);xs.isDocument(e)?Hv(null,e.contents,n,Object.freeze([e]))===Hd&&(e.contents=null):Hv(null,e,n,Object.freeze([]))}v1.BREAK=dc;v1.SKIP=u5;v1.REMOVE=Hd;function Hv(e,t,n,r){let i=d5(e,t,n,r);if(xs.isNode(i)||xs.isPair(i))return h5(e,r,i),Hv(e,i,n,r);if(typeof i!="symbol"){if(xs.isCollection(t)){r=Object.freeze(r.concat(t));for(let o=0;o<t.items.length;++o){let s=Hv(o,t.items[o],n,r);if(typeof s=="number")o=s-1;else{if(s===dc)return dc;s===Hd&&(t.items.splice(o,1),o-=1)}}}else if(xs.isPair(t)){r=Object.freeze(r.concat(t));let o=Hv("key",t.key,n,r);if(o===dc)return dc;o===Hd&&(t.key=null);let s=Hv("value",t.value,n,r);if(s===dc)return dc;s===Hd&&(t.value=null)}}return i}async function w1(e,t){let n=f5(t);xs.isDocument(e)?await Wv(null,e.contents,n,Object.freeze([e]))===Hd&&(e.contents=null):await Wv(null,e,n,Object.freeze([]))}w1.BREAK=dc;w1.SKIP=u5;w1.REMOVE=Hd;async function Wv(e,t,n,r){let i=await d5(e,t,n,r);if(xs.isNode(i)||xs.isPair(i))return h5(e,r,i),Wv(e,i,n,r);if(typeof i!="symbol"){if(xs.isCollection(t)){r=Object.freeze(r.concat(t));for(let o=0;o<t.items.length;++o){let s=await Wv(o,t.items[o],n,r);if(typeof s=="number")o=s-1;else{if(s===dc)return dc;s===Hd&&(t.items.splice(o,1),o-=1)}}}else if(xs.isPair(t)){r=Object.freeze(r.concat(t));let o=await Wv("key",t.key,n,r);if(o===dc)return dc;o===Hd&&(t.key=null);let s=await Wv("value",t.value,n,r);if(s===dc)return dc;s===Hd&&(t.value=null)}}return i}function f5(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function d5(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(xs.isMap(t))return n.Map?.(e,t,r);if(xs.isSeq(t))return n.Seq?.(e,t,r);if(xs.isPair(t))return n.Pair?.(e,t,r);if(xs.isScalar(t))return n.Scalar?.(e,t,r);if(xs.isAlias(t))return n.Alias?.(e,t,r)}function h5(e,t,n){let r=t[t.length-1];if(xs.isCollection(r))r.items[e]=n;else if(xs.isPair(r))e==="key"?r.key=n:r.value=n;else if(xs.isDocument(r))r.contents=n;else{let i=xs.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}qA.visit=v1;qA.visitAsync=w1});var QA=j(g5=>{"use strict";var p5=tr(),dre=CS(),hre={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},pre=e=>e.replace(/[!,[\]{}]/g,t=>hre[t]),PS=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[o,s]=r;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=r;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,s),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let s=t.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}let[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);let o=this.tags[r];if(o)try{return o+decodeURIComponent(i)}catch(s){return n(String(s)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+pre(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),i;if(t&&r.length>0&&p5.isNode(t.contents)){let o={};dre.visit(t.contents,(s,a)=>{p5.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of r)o==="!!"&&s==="tag:yaml.org,2002:"||(!t||i.some(a=>a.startsWith(s)))&&n.push(`%TAG ${o} ${s}`);return n.join(`
9
9
  `)}};PS.defaultYaml={explicit:!1,version:"1.2"};PS.defaultTags={"!!":"tag:yaml.org,2002:"};g5.Directives=PS});var S1=j(AS=>{"use strict";var m5=tr(),gre=CS();function mre(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function y5(e){let t=new Set;return gre.visit(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function b5(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function yre(e,t){let n=[],r=new Map,i=null;return{onAnchor:o=>{n.push(o),i??(i=y5(e));let s=b5(t,i);return i.add(s),s},setAnchors:()=>{for(let o of n){let s=r.get(o);if(typeof s=="object"&&s.anchor&&(m5.isScalar(s.node)||m5.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:r}}AS.anchorIsValid=mre;AS.anchorNames=y5;AS.createNodeAnchors=yre;AS.findNewAnchor=b5});var KA=j(v5=>{"use strict";function RS(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,o=r.length;i<o;++i){let s=r[i],a=RS(e,r,String(i),s);a===void 0?delete r[i]:a!==s&&(r[i]=a)}else if(r instanceof Map)for(let i of Array.from(r.keys())){let o=r.get(i),s=RS(e,r,i,o);s===void 0?r.delete(i):s!==o&&r.set(i,s)}else if(r instanceof Set)for(let i of Array.from(r)){let o=RS(e,r,i,i);o===void 0?r.delete(i):o!==i&&(r.delete(i),r.add(o))}else for(let[i,o]of Object.entries(r)){let s=RS(e,r,i,o);s===void 0?delete r[i]:s!==o&&(r[i]=s)}return e.call(t,n,r)}v5.applyReviver=RS});var Bg=j(S5=>{"use strict";var bre=tr();function w5(e,t,n){if(Array.isArray(e))return e.map((r,i)=>w5(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!bre.hasAnchor(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=o=>{r.res=o,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!n?.keep?Number(e):e}S5.toJS=w5});var x1=j(E5=>{"use strict";var vre=KA(),x5=tr(),wre=Bg(),ZA=class{constructor(t){Object.defineProperty(this,x5.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){if(!x5.isDocument(t))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=wre.toJS(this,"",s);if(typeof i=="function")for(let{count:l,res:c}of s.anchors.values())i(c,l);return typeof o=="function"?vre.applyReviver(o,{"":a},"",a):a}};E5.NodeBase=ZA});var IS=j(_5=>{"use strict";var Sre=S1(),xre=CS(),jv=tr(),Ere=x1(),_re=Bg(),JA=class extends Ere.NodeBase{constructor(t){super(jv.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],xre.visit(t,{Node:(o,s)=>{(jv.isAlias(s)||jv.hasAnchor(s))&&r.push(s)}}),n&&(n.aliasResolveCache=r));let i;for(let o of r){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(t,n){if(!n)return{source:this.source};let{anchors:r,doc:i,maxAliasCount:o}=n,s=this.resolve(i,n);if(!s){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=r.get(s);if(a||(_re.toJS(s,null,n),a=r.get(s)),a?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=E1(i,s,r)),a.count*a.aliasCount>o)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(t,n,r){let i=`*${this.source}`;if(t){if(Sre.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${i} `}return i}};function E1(e,t,n){if(jv.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(jv.isCollection(t)){let r=0;for(let i of t.items){let o=E1(e,i,n);o>r&&(r=o)}return r}else if(jv.isPair(t)){let r=E1(e,t.key,n),i=E1(e,t.value,n);return Math.max(r,i)}return 1}_5.Alias=JA});var os=j($A=>{"use strict";var Ore=tr(),Tre=x1(),kre=Bg(),Cre=e=>!e||typeof e!="function"&&typeof e!="object",zg=class extends Tre.NodeBase{constructor(t){super(Ore.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:kre.toJS(this.value,t,n)}toString(){return String(this.value)}};zg.BLOCK_FOLDED="BLOCK_FOLDED";zg.BLOCK_LITERAL="BLOCK_LITERAL";zg.PLAIN="PLAIN";zg.QUOTE_DOUBLE="QUOTE_DOUBLE";zg.QUOTE_SINGLE="QUOTE_SINGLE";$A.Scalar=zg;$A.isScalarValue=Cre});var MS=j(T5=>{"use strict";var Pre=IS(),Ay=tr(),O5=os(),Are="tag:yaml.org,2002:";function Rre(e,t,n){if(t){let r=n.filter(o=>o.tag===t),i=r.find(o=>!o.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>r.identify?.(e)&&!r.format)}function Ire(e,t,n){if(Ay.isDocument(e)&&(e=e.contents),Ay.isNode(e))return e;if(Ay.isPair(e)){let d=n.schema[Ay.MAP].createNode?.(n.schema,null,n);return d.items.push(e),d}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=n,l;if(r&&e&&typeof e=="object"){if(l=a.get(e),l)return l.anchor??(l.anchor=i(e)),new Pre.Alias(l.anchor);l={anchor:null,node:null},a.set(e,l)}t?.startsWith("!!")&&(t=Are+t.slice(2));let c=Rre(e,t,s.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let d=new O5.Scalar(e);return l&&(l.node=d),d}c=e instanceof Map?s[Ay.MAP]:Symbol.iterator in Object(e)?s[Ay.SEQ]:s[Ay.MAP]}o&&(o(c),delete n.onTagObj);let y=c?.createNode?c.createNode(n.schema,e,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,e,n):new O5.Scalar(e);return t?y.tag=t:c.default||(y.tag=c.tag),l&&(l.node=y),y}T5.createNode=Ire});var O1=j(_1=>{"use strict";var Mre=MS(),Wd=tr(),Lre=x1();function eR(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){let o=t[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=r,r=s}else r=new Map([[o,r]])}return Mre.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var k5=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,tR=class extends Lre.NodeBase{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>Wd.isNode(r)||Wd.isPair(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(k5(t))this.add(n);else{let[r,...i]=t,o=this.get(r,!0);if(Wd.isCollection(o))o.addIn(i,n);else if(o===void 0&&this.schema)this.set(r,eR(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){let[n,...r]=t;if(r.length===0)return this.delete(n);let i=this.get(n,!0);if(Wd.isCollection(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){let[r,...i]=t,o=this.get(r,!0);return i.length===0?!n&&Wd.isScalar(o)?o.value:o:Wd.isCollection(o)?o.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Wd.isPair(n))return!1;let r=n.value;return r==null||t&&Wd.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){let[n,...r]=t;if(r.length===0)return this.has(n);let i=this.get(n,!0);return Wd.isCollection(i)?i.hasIn(r):!1}setIn(t,n){let[r,...i]=t;if(i.length===0)this.set(r,n);else{let o=this.get(r,!0);if(Wd.isCollection(o))o.setIn(i,n);else if(o===void 0&&this.schema)this.set(r,eR(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};_1.Collection=tR;_1.collectionFromPath=eR;_1.isEmptyPath=k5});var LS=j(T1=>{"use strict";var Nre=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function nR(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Dre=(e,t,n)=>e.endsWith(`
10
10
  `)?nR(n,t):n.includes(`