@redocly/cli 0.0.0-snapshot.1786088185 → 0.0.0-snapshot.1786199735

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/lib/chunks/2VVGA7JY.js +7 -0
  2. package/lib/chunks/{5H7FLUJ4.js → 5KALNFRG.js} +1 -1
  3. package/lib/chunks/{OAY4A6XN.js → 6ATAJMOK.js} +1 -1
  4. package/lib/chunks/{THHXMEO4.js → 6P5CEWFQ.js} +1 -1
  5. package/lib/chunks/{6ZLMHCAS.js → AYXBQ5ZL.js} +1 -1
  6. package/lib/chunks/{RF73X3WC.js → BDIXGM4J.js} +1 -1
  7. package/lib/chunks/{LDCNA5N4.js → CDIETNM7.js} +1 -1
  8. package/lib/chunks/{HGS5KAIG.js → DQWFUOGC.js} +2 -2
  9. package/lib/chunks/FGZLHC6B.js +16 -0
  10. package/lib/chunks/{C4ODKAHR.js → HY6IQ5MU.js} +1 -1
  11. package/lib/chunks/{5A26CSMF.js → JXLOSJZ3.js} +1 -1
  12. package/lib/chunks/{JZFVSOS5.js → JZMDULX5.js} +2 -2
  13. package/lib/chunks/{4W64I7XA.js → NIXODD2W.js} +1 -1
  14. package/lib/chunks/{TPULXBPS.js → SQTDATOG.js} +1 -1
  15. package/lib/chunks/{XKUBVXQP.js → V6VQXQSU.js} +1 -1
  16. package/lib/chunks/{SHLXMMCF.js → ZXLNDDJH.js} +76 -10
  17. package/lib/eject-assets/generators/cli-docs.mjs +26 -2
  18. package/lib/eject-assets/generators/cli.mjs +6 -3
  19. package/lib/eject-assets/generators/go.mjs +9 -2
  20. package/lib/eject-assets/generators/mock.mjs +3 -2
  21. package/lib/eject-assets/generators/php.mjs +9 -2
  22. package/lib/eject-assets/generators/python.mjs +8 -2
  23. package/lib/eject-assets/generators/sdk.mjs +3 -3
  24. package/lib/eject-assets/generators/swr.mjs +4 -2
  25. package/lib/eject-assets/generators/tanstack-query.mjs +4 -2
  26. package/lib/eject-assets/generators/transformers.mjs +4 -2
  27. package/lib/eject-assets/generators/zod.mjs +2 -2
  28. package/lib/index.js +30 -30
  29. package/package.json +1 -1
  30. package/lib/chunks/5GW2PIPF.js +0 -14
  31. package/lib/chunks/QZAA7G5W.js +0 -7
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ var U={"server-url":{key:"serverUrl"},format:{key:"format"},"dry-run":{key:"dryRun",boolean:!0},"page-all":{key:"pageAll",boolean:!0},output:{key:"output"},token:{key:"token"},json:{key:"json"}};function O(n){return n.trim().replace(/[^A-Za-z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()}function A(n){return n.replace(/\s+/g," ").trim()}function x(n,e){if(e.length===0||e[0]==="--help")return{kind:"help"};if(e[0]==="schema"){let t=n.find(o=>o.name===e[1]);return t?{kind:"schema",command:t}:{kind:"usage-error",message:`Unknown command: schema ${e[1]??""}`.trim()}}let y=new Set(n.filter(t=>t.group).map(t=>O(t.group))),s,f;if(y.has(e[0])){if(e[1]==="--help"||e[1]===void 0)return{kind:"help",topic:e[0]};if(s=n.find(t=>t.group&&O(t.group)===e[0]&&t.name===e[1]),!s)return{kind:"usage-error",message:`Unknown command: ${e[0]} ${e[1]}`};f=e.slice(2)}else{let t=n.filter(o=>o.name===e[0]);if(s=t.find(o=>o.group===void 0)??(t.length===1?t[0]:void 0),!s)return{kind:"usage-error",message:t.length>1?`Ambiguous command: ${e[0]} \u2014 prefix it with its group (${t.map(r=>O(r.group)).join(", ")})`:`Unknown command: ${e[0]}`};f=e.slice(1)}if(f.includes("--help"))return{kind:"help",topic:s};let u={},a={},d={},j=0;for(let t=0;t<f.length;t++){let o=f[t];if(!o.startsWith("--")){let c=s.positionals[j++];if(!c)return{kind:"usage-error",message:`Unexpected argument: ${o}`};u[c.name]=o;continue}let r=o.indexOf("="),m=r===-1?o.slice(2):o.slice(2,r),l=r===-1?void 0:o.slice(r+1),h=()=>l!==void 0?l:f[++t],b=U[m];if(b){if(b.boolean){d[b.key]=!0;continue}let c=h();if(c===void 0)return{kind:"usage-error",message:`Flag --${m} expects a value`};if(b.key==="format"&&c!=="json"&&c!=="ndjson")return{kind:"usage-error",message:"--format must be one of: json, ndjson"};d[b.key]=c;continue}let p=s.flags.find(c=>c.name===m);if(!p)return{kind:"usage-error",message:`Unknown flag: --${m}`};if(p.type==="boolean"){a[p.param]=!0;continue}let k=h();if(k===void 0)return{kind:"usage-error",message:`Flag --${m} expects a value`};if(p.enum&&!p.enum.includes(k))return{kind:"usage-error",message:`--${m} must be one of: ${p.enum.join(", ")}`};if(p.type==="number"){let c=Number(k);if(Number.isNaN(c))return{kind:"usage-error",message:`--${m} expects a number, got "${k}"`};a[p.param]=c}else if(p.type==="array"){let c=a[p.param];a[p.param]=Array.isArray(c)?[...c,k]:[k]}else a[p.param]=k}for(let t of s.positionals)if(!(t.name in u))return{kind:"usage-error",message:`Missing required argument: <${t.name}>`};for(let t of s.flags)if(t.required&&!(t.param in a))return{kind:"usage-error",message:`Missing required flag: --${t.name}`};return d.json!==void 0&&!s.body?{kind:"usage-error",message:`${s.name} does not accept a request body`}:s.body?.required&&d.json===void 0?{kind:"usage-error",message:`${s.name} requires a request body: pass --json '<json>', --json @file.json, or --json @-`}:d.pageAll&&!s.paginated?{kind:"usage-error",message:`${s.name} is not paginated; --page-all only applies to paginated operations`}:{kind:"run",command:s,positionals:u,params:a,globals:d}}function S(n){return n.replace(/[^A-Za-z0-9]+/g,"_").replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()}function N(n,e){let y=n.env??{},s=S(n.binName),f={};for(let u of n.schemes??[])if(u.kind==="bearer"){let a=e??y[`${s}_TOKEN`];a!==void 0&&(f.bearer=a)}else if(u.kind==="basic"){let a=y[`${s}_USERNAME`],d=y[`${s}_PASSWORD`];a!==void 0&&d!==void 0&&(f.basic={username:a,password:d})}else{let a=y[`${s}_API_KEY_${S(u.key)}`];a!==void 0&&(f.apiKey={...f.apiKey,[u.key]:a})}return f}function _(n){return{operationId:n.name,...n.group===void 0?{}:{group:O(n.group)},...n.summary===void 0?{}:{summary:A(n.summary)},method:n.method,path:n.path,parameters:{path:n.positionals.map(e=>({name:e.name,type:e.type??"string",required:!0,...e.description===void 0?{}:{description:A(e.description)}})),query:n.flags.map(e=>({name:e.name,param:e.param,type:e.type,required:e.required,...e.enum===void 0?{}:{enum:e.enum},...e.description===void 0?{}:{description:A(e.description)}}))},...n.body===void 0?{}:{body:n.body},...n.unsupportedBody===void 0?{}:{unsupportedBody:n.unsupportedBody},...n.paginated===!0?{paginated:!0}:{},...n.sse===!0?{sse:!0}:{},...n.blob===!0?{blob:!0}:{},...n.schemas??{}}}function E(n,e,y,s){if(s!==void 0&&typeof s!="string"){let r=s,l=[`Usage: ${[e,...r.group?[O(r.group)]:[],r.name,...r.positionals.map(h=>`<${h.name}>`),...r.flags.length>0?["[flags]"]:[],...r.body?["--json '<json>' | @file | @-"]:[]].join(" ")}`];if(r.summary&&l.push("",r.summary),r.unsupportedBody!==void 0&&l.push("",`This operation takes a ${r.unsupportedBody} body, which the CLI cannot build \u2014 call it through the generated client instead.`),r.flags.length>0){l.push("","Flags:");for(let h of r.flags){let b=h.enum?` (one of: ${h.enum.join(", ")})`:"",p=h.required?" [required]":"";l.push(` --${h.name} <${h.type}>${b}${p} ${A(h.description??"")}`.trimEnd())}}return l}let f=typeof s=="string"?n.filter(r=>r.group&&O(r.group)===s):n,u=typeof s=="string"?[`Usage: ${e} ${s} <command> \u2026`,"","Commands:"]:[`Usage: ${e} [group] <command> \u2026`,"","Commands:"],a=new Set,d=n.some(r=>r.group);for(let r of f){if(typeof s!="string"&&r.group){let m=O(r.group);if(a.has(m))continue;a.add(m);let l=m===r.group?"":` (${r.group})`;u.push(` ${m} <command>${l}`);continue}u.push(` ${[r.group===void 0?void 0:O(r.group),r.name].filter(Boolean).join(" ")} ${A(r.summary??"")}`.trimEnd())}let j=S(e),t=new Set(y.map(r=>r.kind)),o=[...t.has("bearer")?[`${j}_TOKEN`]:[],...t.has("basic")?[`${j}_USERNAME`,`${j}_PASSWORD`]:[],...y.filter(r=>r.kind==="apiKey").map(r=>`${j}_API_KEY_${S(r.key)}`)];return u.push("","Global flags:"," --server-url <url> Override the baked server URL"," --format <json|ndjson> Output format"," --dry-run Print the prepared request without sending it"," --page-all Follow pagination, one JSON page per line"," --output <path> Write the response body to a file (required for binary)",...t.has("bearer")?[" --token <token> Bearer token"]:[]," --json <json|@file|@-> Request body",...o.length>0?["","Environment:",` ${o.join(", ")}`]:[],"",`Run ${e} ${d?"<group> <command>":"<command>"} --help for command details; ${e} schema <command> prints its schemas.`),u}function I(n,e){let y=n==="@-"?(e.stdin??(()=>""))():n.startsWith("@")?(e.readFile??(()=>""))(n.slice(1)):n;return JSON.parse(y)}function R(n,e){let y={};for(let[s,f]of Object.entries(n))y[s]=e.some(u=>u!==""&&f.includes(u))?"***":f;return y}async function w(n,e,y){let{stdout:s,stderr:f}=e,u=(g,i)=>(f(JSON.stringify({error:{code:g,...i}})),g),a=x(n,y);if(a.kind==="usage-error")return u(4,{message:a.message});if(a.kind==="help"){for(let g of E(n,e.binName,e.schemes??[],a.topic))s(g);return 0}if(a.kind==="schema")return s(JSON.stringify(_(a.command),null,2)),0;let{command:d,positionals:j,params:t,globals:o}=a,r=e.schemes??[];if(o.token!==void 0&&!r.some(g=>g.kind==="bearer")){let g=r.map(i=>`${i.key} (${i.kind})`).join(", ");return u(4,{message:"--token is a bearer credential, and this API declares no bearer scheme. "+(g===""?"It declares no security schemes at all.":`It accepts: ${g}.`)})}if(d.blob&&o.output===void 0)return u(4,{message:`${d.name} downloads a file: pass --output <path>`,operationId:d.name});let m;if(o.json!==void 0)try{m=I(o.json,e)}catch(g){return u(4,{message:`Invalid --json body: ${g.message}`,operationId:d.name})}let l=N(e,o.token);Object.keys(l).length>0&&e.configure({auth:l}),o.serverUrl!==void 0&&e.configure({serverUrl:o.serverUrl});let h=[...typeof l.bearer=="string"?[l.bearer]:[],...l.basic?[l.basic.password]:[],...Object.values(l.apiKey??{})],b;o.dryRun&&e.configure({fetch:async(g,i)=>(b={url:g,method:i.method,headers:R(i.headers??{},h),...i.body!==void 0&&i.body!==null?{body:String(i.body)}:{}},new Response("{}",{status:200,headers:{"content-type":"application/json"}}))});let p={...j};Object.keys(t).length>0&&(p.params=t),m!==void 0&&(p.body=m);let k=Object.keys(p).length>0?p:void 0,c=e.client;try{if(o.pageAll&&!o.dryRun){let $=c[d.name];for await(let q of $.pages(k))s(JSON.stringify(q));return 0}let g=c[d.name],i=await g(k);if(o.dryRun)return s(JSON.stringify(b,null,2)),0;if(d.sse){for await(let $ of i)s(JSON.stringify($));return 0}if(d.blob){let $=new Uint8Array(await i.arrayBuffer());return(e.writeFile??(()=>{}))(o.output,$),s(JSON.stringify({saved:o.output,bytes:$.length})),0}return i!=null&&s(JSON.stringify(i,null,2)),0}catch(g){let i=g,$={message:i.message,operationId:d.name,...i.status!==void 0?{status:i.status}:{},...i.issues!==void 0?{issues:i.issues}:{}};return i.name==="ZodValidationError"?u(3,$):i.name==="ApiError"&&(i.status===401||i.status===403)?u(2,$):u(1,$)}}export{O as a,S as b,w as c};
@@ -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{a as m,c as l}from"./HGS5KAIG.js";import"./OAY4A6XN.js";import"./SHLXMMCF.js";import"./P3HJG5ZU.js";import"./OAHVR5VG.js";import"./YSMUBJCG.js";import"./C65SIVY5.js";import"./NEWT5A6S.js";import"./3GFYSU6P.js";import{f as a}from"./BDG6IUCF.js";import"./3XBPOSEL.js";import"./RFWIIJFG.js";import{join as s}from"node:path";function p(o){return o.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()||"client"}var g=({model:o,outputPath:i,emit:n,selected:r})=>{let{dir:e,stem:t}=a(i),c=l(o,{stem:t,importExt:n.importExt??"js",runtime:n.runtime??"inline",zodSelected:r?.includes("zod")??!1,binName:n.binName??p(t),pagination:n.pagination});return[{path:s(e,`${t}.cli.ts`),content:c}]};function $(o,i){let n=m(i.model,{pagination:i.emit.pagination}).find(e=>e.name===o.name);return n===void 0?void 0:{lang:"shell",label:"CLI",source:`npx tsx client.cli.ts ${["client",...n.group?[n.group]:[],n.name,...n.positionals.map(e=>`<${e.name}>`),...n.flags.filter(e=>e.required).map(e=>`--${e.name} <${e.type}>`),...n.body?["--json '<json>'"]:[]].slice(1).join(" ")}
7
+ import{a as m,c as l}from"./DQWFUOGC.js";import"./6ATAJMOK.js";import"./ZXLNDDJH.js";import"./P3HJG5ZU.js";import"./OAHVR5VG.js";import"./YSMUBJCG.js";import"./C65SIVY5.js";import"./NEWT5A6S.js";import"./3GFYSU6P.js";import{f as a}from"./BDG6IUCF.js";import"./3XBPOSEL.js";import"./RFWIIJFG.js";import{join as s}from"node:path";function p(o){return o.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()||"client"}var g=({model:o,outputPath:i,emit:n,selected:r})=>{let{dir:e,stem:t}=a(i),c=l(o,{stem:t,importExt:n.importExt??"js",runtime:n.runtime??"inline",zodSelected:r?.includes("zod")??!1,binName:n.binName??p(t),pagination:n.pagination});return[{path:s(e,`${t}.cli.ts`),content:c}]};function $(o,i){let n=m(i.model,{pagination:i.emit.pagination}).find(e=>e.name===o.name);return n===void 0?void 0:{lang:"shell",label:"CLI",source:`npx tsx client.cli.ts ${["client",...n.group?[n.group]:[],n.name,...n.positionals.map(e=>`<${e.name}>`),...n.flags.filter(e=>e.required).map(e=>`--${e.name} <${e.type}>`),...n.body?["--json '<json>'"]:[]].slice(1).join(" ")}
8
8
  `}}export{g as cliGenerator,$ as cliSample};
@@ -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 i}from"./SHLXMMCF.js";var s="// \u2500\u2500\u2500 Embedded runtime (@redocly/client-generator, assembled per this API's needs) \u2500\u2500\u2500";function o(t){let e=["types.ts","errors.ts","url.ts","parse.ts","retry.ts"];return t.multipart&&e.push("multipart.ts"),t.auth&&e.push("auth.ts"),t.setup&&e.push("setup.ts"),t.paginate&&e.push("paginate.ts"),e.push("send.ts"),t.sse&&e.push("sse.ts"),e.push("create-client.ts"),[s,...e.map(n=>i[n]),r(t)].join(`
7
+ import{a as i}from"./ZXLNDDJH.js";var s="// \u2500\u2500\u2500 Embedded runtime (@redocly/client-generator, assembled per this API's needs) \u2500\u2500\u2500";function o(t){let e=["types.ts","errors.ts","url.ts","parse.ts","retry.ts"];return t.multipart&&e.push("multipart.ts"),t.auth&&e.push("auth.ts"),t.setup&&e.push("setup.ts"),t.paginate&&e.push("paginate.ts"),e.push("send.ts"),t.sse&&e.push("sse.ts"),e.push("create-client.ts"),[s,...e.map(n=>i[n]),r(t)].join(`
8
8
 
9
9
  `)}function p(){return i["cli.ts"]}function r(t){let e=[...t.multipart?["serializeMultipart: toFormData"]:[],...t.auth?["resolveAuth"]:[],...t.sse?["sse"]:[],...t.paginate?["paginate: { pages, items, pagesByLink, itemsByLink }"]:[]];return`/**
10
10
  * The client factory: \`createClientCore\` wired with the capabilities this API needs.
@@ -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"./5A26CSMF.js";import"./RS5PUOTT.js";import"./BXI4SF2U.js";import"./32XCOMOR.js";import"./P26PQ2RU.js";import"./6ZLMHCAS.js";import"./C65SIVY5.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{a as RedoclyOAuthClient};
7
+ import{h as a}from"./JXLOSJZ3.js";import"./RS5PUOTT.js";import"./BXI4SF2U.js";import"./32XCOMOR.js";import"./P26PQ2RU.js";import"./AYXBQ5ZL.js";import"./C65SIVY5.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{a as RedoclyOAuthClient};
@@ -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:"0.0.0-snapshot.1786088185",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.5","@redocly/client-generator":"0.0.0-snapshot.1786088185","@redocly/openapi-core":"0.0.0-snapshot.1786088185","@redocly/respect-core":"0.0.0-snapshot.1786088185","@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.28.0",yargs:"17.0.1"}};var{version:s,name:i,engines:n}=e,p=e.devDependencies.redoc,c="sha384-xiEssMQFSpSfLbzRZCGfxxIM5QDb2DTrU6vyoZdp2sV1L6pmOMy6MpTtUoLbpC96";export{s as a,i as b,n as c,p as d,c as e};
7
+ var e={name:"@redocly/cli",version:"0.0.0-snapshot.1786199735",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.5","@redocly/client-generator":"0.0.0-snapshot.1786199735","@redocly/openapi-core":"0.0.0-snapshot.1786199735","@redocly/respect-core":"0.0.0-snapshot.1786199735","@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.28.0",yargs:"17.0.1"}};var{version:s,name:i,engines:n}=e,p=e.devDependencies.redoc,c="sha384-xiEssMQFSpSfLbzRZCGfxxIM5QDb2DTrU6vyoZdp2sV1L6pmOMy6MpTtUoLbpC96";export{s as a,i as b,n as c,p as d,c as e};
@@ -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 c={name:"@redocly/client-generator",version:"0.0.0-snapshot.1786088185",description:"Generate typed, zero-dependency TypeScript clients (fetch, auth, retries, middleware, SSE) from OpenAPI descriptions.",type:"module",types:"lib/index.d.ts",sideEffects:!1,exports:{".":{types:"./lib/index.d.ts",import:"./lib/index.js",default:"./lib/index.js"},"./generate":{types:"./lib/generate.d.ts",import:"./lib/generate.js",default:"./lib/generate.js"},"./runtime-sources":{types:"./lib/runtime-sources.d.ts",import:"./lib/runtime-sources.js",default:"./lib/runtime-sources.js"},"./package.json":"./package.json"},engines:{node:">=22.12.0 || >=20.19.0 <21.0.0",npm:">=10"},engineStrict:!0,publishConfig:{access:"public"},scripts:{"examples:regen":"node scripts/regenerate-examples.mjs",prepare:"node scripts/generate-runtime-sources.mjs && node scripts/generate-eject-assets.mjs","typecheck:examples":"node scripts/typecheck-examples.mjs"},license:"MIT",repository:{type:"git",url:"git+https://github.com/Redocly/redocly-cli.git"},homepage:"https://github.com/Redocly/redocly-cli",keywords:["OpenAPI","Swagger","TypeScript","client","generator","codegen","fetch"],contributors:["Roman Marshevskyi <roman.marshevskyy@redocly.com> (https://redocly.com/)"],dependencies:{"@redocly/openapi-core":"0.0.0-snapshot.1786088185"},peerDependencies:{typescript:">=5.5.0"},peerDependenciesMeta:{typescript:{optional:!0}},devDependencies:{typescript:"6.0.2"},files:["lib","eject-assets"]};var u=c.version;function o(s){let e=/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(s.trim());return e===null?void 0:[Number(e[1]),Number(e[2]),Number(e[3])]}function i(s,e){return s[0]-e[0]||s[1]-e[1]||s[2]-e[2]}function l(s,e){let n=/^[\^~]|^>=/.exec(e.trim())?.[0]??"",t=o(e.trim().slice(n.length)),r=o(s);if(!(t===void 0||r===void 0))return i(r,t)<0?!1:n===">="?!0:n===""?i(r,t)===0:n==="~"?r[0]===t[0]&&r[1]===t[1]:t[0]!==0?r[0]===t[0]:t[1]!==0?r[0]===0&&r[1]===t[1]:i(r,t)===0}export{u as a,l as b};
7
+ var c={name:"@redocly/client-generator",version:"0.0.0-snapshot.1786199735",description:"Generate typed, zero-dependency TypeScript clients (fetch, auth, retries, middleware, SSE) from OpenAPI descriptions.",type:"module",types:"lib/index.d.ts",sideEffects:!1,exports:{".":{types:"./lib/index.d.ts",import:"./lib/index.js",default:"./lib/index.js"},"./generate":{types:"./lib/generate.d.ts",import:"./lib/generate.js",default:"./lib/generate.js"},"./runtime-sources":{types:"./lib/runtime-sources.d.ts",import:"./lib/runtime-sources.js",default:"./lib/runtime-sources.js"},"./package.json":"./package.json"},engines:{node:">=22.12.0 || >=20.19.0 <21.0.0",npm:">=10"},engineStrict:!0,publishConfig:{access:"public"},scripts:{"examples:regen":"node scripts/regenerate-examples.mjs",prepare:"node scripts/generate-runtime-sources.mjs && node scripts/generate-eject-assets.mjs","typecheck:examples":"node scripts/typecheck-examples.mjs"},license:"MIT",repository:{type:"git",url:"git+https://github.com/Redocly/redocly-cli.git"},homepage:"https://github.com/Redocly/redocly-cli",keywords:["OpenAPI","Swagger","TypeScript","client","generator","codegen","fetch"],contributors:["Roman Marshevskyi <roman.marshevskyy@redocly.com> (https://redocly.com/)"],dependencies:{"@redocly/openapi-core":"0.0.0-snapshot.1786199735"},peerDependencies:{typescript:">=5.5.0"},peerDependenciesMeta:{typescript:{optional:!0}},devDependencies:{typescript:"6.0.2"},files:["lib","eject-assets"]};var u=c.version;function o(s){let e=/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(s.trim());return e===null?void 0:[Number(e[1]),Number(e[2]),Number(e[3])]}function i(s,e){return s[0]-e[0]||s[1]-e[1]||s[2]-e[2]}function l(s,e){let n=/^[\^~]|^>=/.exec(e.trim())?.[0]??"",t=o(e.trim().slice(n.length)),r=o(s);if(!(t===void 0||r===void 0))return i(r,t)<0?!1:n===">="?!0:n===""?i(r,t)===0:n==="~"?r[0]===t[0]&&r[1]===t[1]:t[0]!==0?r[0]===t[0]:t[1]!==0?r[0]===0&&r[1]===t[1]:i(r,t)===0}export{u as a,l as b};
@@ -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{b as i}from"./SHLXMMCF.js";import{g as a}from"./3XBPOSEL.js";function s(r,t){return t?"setApiKey":`setApiKey${a(r)}`}function l(r){let t=[];r.some(e=>e.kind==="bearer")&&t.push("setBearer"),r.some(e=>e.kind==="basic")&&t.push("setBasicAuth");let n=r.filter(e=>e.kind==="apiKeyHeader"||e.kind==="apiKeyQuery"||e.kind==="apiKeyCookie");for(let e of n)t.push(s(e.key,n.length===1));return t}var p=["client","OPERATIONS","Ops","OperationId","OperationPath","OperationTag","createClient","mergeSetup","ApiError","TimeoutError","configure","use","auth","defaultRetryOn","ClientConfig","RequestOptions","SseOptions","Middleware","OperationDescriptor","ServerSentEvent","Result","Envelope","EnvelopeResult","TokenProvider","__redoclySetup"],u=["z","http","HttpResponse","handlers","faker","queryOptions","useSWR","useSWRMutation","__Writable"],c=["AbortSignal","Array","ArrayBuffer","ArrayBufferView","AsyncGenerator","AsyncIterable","Blob","BodyInit","Boolean","DOMException","Date","Error","Extract","FormData","Headers","HeadersInit","JSON","Map","Math","NonNullable","Number","Object","Omit","Partial","Promise","ReadableStream","Record","RegExp","RegExpExecArray","Request","RequestInit","Response","Set","String","TextDecoder","TextEncoder","TypeError","Uint8Array","URL","URLSearchParams","btoa","clearTimeout","crypto","decodeURIComponent","document","encodeURIComponent","fetch","globalThis","setTimeout","undefined"],o;function S(){return o===void 0&&(o=new Set([...p,...u,...c,...i])),o}export{s as a,l as b,p as c,S as d};
7
+ import{b as i}from"./ZXLNDDJH.js";import{g as a}from"./3XBPOSEL.js";function s(r,t){return t?"setApiKey":`setApiKey${a(r)}`}function l(r){let t=[];r.some(e=>e.kind==="bearer")&&t.push("setBearer"),r.some(e=>e.kind==="basic")&&t.push("setBasicAuth");let n=r.filter(e=>e.kind==="apiKeyHeader"||e.kind==="apiKeyQuery"||e.kind==="apiKeyCookie");for(let e of n)t.push(s(e.key,n.length===1));return t}var p=["client","OPERATIONS","Ops","OperationId","OperationPath","OperationTag","createClient","mergeSetup","ApiError","TimeoutError","configure","use","auth","defaultRetryOn","ClientConfig","RequestOptions","SseOptions","Middleware","OperationDescriptor","ServerSentEvent","Result","Envelope","EnvelopeResult","TokenProvider","__redoclySetup"],u=["z","http","HttpResponse","handlers","faker","queryOptions","useSWR","useSWRMutation","__Writable"],c=["AbortSignal","Array","ArrayBuffer","ArrayBufferView","AsyncGenerator","AsyncIterable","Blob","BodyInit","Boolean","DOMException","Date","Error","Extract","FormData","Headers","HeadersInit","JSON","Map","Math","NonNullable","Number","Object","Omit","Partial","Promise","ReadableStream","Record","RegExp","RegExpExecArray","Request","RequestInit","Response","Set","String","TextDecoder","TextEncoder","TypeError","Uint8Array","URL","URLSearchParams","btoa","clearTimeout","crypto","decodeURIComponent","document","encodeURIComponent","fetch","globalThis","setTimeout","undefined"],o;function S(){return o===void 0&&(o=new Set([...p,...u,...c,...i])),o}export{s as a,l as b,p as c,S as d};
@@ -4,14 +4,14 @@ 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 p}from"./OAY4A6XN.js";import{a as l}from"./P3HJG5ZU.js";import{a as d}from"./OAHVR5VG.js";import{a as m}from"./3GFYSU6P.js";import{c as u}from"./BDG6IUCF.js";function f(n){return d.snake(n).replace(/_/g,"-")}function y(n){let e=n.schema,t=e.kind==="array"?"array":e.kind==="scalar"&&(e.scalar==="integer"||e.scalar==="number")?"number":e.kind==="scalar"&&e.scalar==="boolean"?"boolean":"string";return{name:f(n.name),param:n.name,type:t,required:n.required,...e.kind==="enum"?{enum:e.values.map(String)}:{},...n.description!==void 0?{description:n.description}:{}}}function g(n){let e=n.successResponses;return e.some(t=>t.contentType.toLowerCase().includes("json"))?!1:e.some(t=>t.contentType.startsWith("image/")||t.contentType==="application/octet-stream")}function h(n){return n.successResponses.find(e=>e.contentType.toLowerCase().includes("json"))?.schema}function S(n,e){let t=[];for(let o of n.services)for(let r of o.operations){let i=r.requestBody?.contentType.toLowerCase().includes("json")?r.requestBody:void 0,s=h(r);t.push({...r.tags.length>0?{group:r.tags[0]}:{},name:r.name,...r.summary!==void 0?{summary:r.summary}:{},method:r.method.toUpperCase(),path:r.path,positionals:r.pathParams.map(a=>({name:a.name,...a.description!==void 0?{description:a.description}:{}})),flags:r.queryParams.map(y),...i?{body:{required:i.required}}:{},...i===void 0&&r.requestBody!==void 0?{unsupportedBody:r.requestBody.contentType}:{},...l(r,n,e.pagination).spec!==void 0?{paginated:!0}:{},...m(r)?{sse:!0}:{},...g(r)?{blob:!0}:{},...i!==void 0||s!==void 0?{schemas:{...i?{request:i.schema}:{},...s!==void 0?{response:s}:{}}}:{}})}return t}function c(n,e){return JSON.stringify(n,null,e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function b(n){return n.securitySchemes.map(e=>({key:e.key,kind:e.kind==="bearer"||e.kind==="basic"?e.kind:"apiKey"}))}function j(n,e){let t=S(n,{pagination:e.pagination}),o=b(n),r=`./${e.stem}.${e.importExt}`,i=["client","configure",...e.zodSelected?["use"]:[]];return["#!/usr/bin/env node",u,'import { readFileSync, writeFileSync } from "node:fs";',[...e.runtime==="package"?['import { runCli, type CliCommand } from "@redocly/client-generator";']:[],`import { ${i.join(", ")} } from "${r}";`,...e.zodSelected?[`import { zodValidation } from "./${e.stem}.zod.${e.importExt}";`]:[]].join(`
7
+ import{b as p}from"./6ATAJMOK.js";import{a as l}from"./P3HJG5ZU.js";import{a as d}from"./OAHVR5VG.js";import{a as m}from"./3GFYSU6P.js";import{c as u}from"./BDG6IUCF.js";function y(n){return d.snake(n).replace(/_/g,"-")}function f(n){let e=n.schema,t=e.kind==="array"?"array":e.kind==="scalar"&&(e.scalar==="integer"||e.scalar==="number")?"number":e.kind==="scalar"&&e.scalar==="boolean"?"boolean":"string";return{name:y(n.name),param:n.name,type:t,required:n.required,...e.kind==="enum"?{enum:e.values.map(String)}:{},...n.description!==void 0?{description:n.description}:{}}}function g(n){let e=n.successResponses;return e.some(t=>t.contentType.toLowerCase().includes("json"))?!1:e.some(t=>t.contentType.startsWith("image/")||t.contentType==="application/octet-stream")}function h(n){return n.successResponses.find(e=>e.contentType.toLowerCase().includes("json"))?.schema}function S(n,e){let t=[];for(let a of n.services)for(let r of a.operations){let i=r.requestBody?.contentType.toLowerCase().includes("json")?r.requestBody:void 0,s=h(r);t.push({...r.tags.length>0?{group:r.tags[0]}:{},name:r.name,...r.summary!==void 0?{summary:r.summary}:{},method:r.method.toUpperCase(),path:r.path,positionals:r.pathParams.map(o=>({name:o.name,type:f(o).type,...o.description!==void 0?{description:o.description}:{}})),flags:r.queryParams.map(f),...i?{body:{required:i.required}}:{},...i===void 0&&r.requestBody!==void 0?{unsupportedBody:r.requestBody.contentType}:{},...l(r,n,e.pagination).spec!==void 0?{paginated:!0}:{},...m(r)?{sse:!0}:{},...g(r)?{blob:!0}:{},...i!==void 0||s!==void 0?{schemas:{...i?{request:i.schema}:{},...s!==void 0?{response:s}:{}}}:{}})}return t}function c(n,e){return JSON.stringify(n,null,e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function b(n){return n.securitySchemes.map(e=>({key:e.key,kind:e.kind==="bearer"||e.kind==="basic"?e.kind:"apiKey"}))}function j(n,e){let t=S(n,{pagination:e.pagination}),a=b(n),r=`./${e.stem}.${e.importExt}`,i=["client","configure",...e.zodSelected?["use"]:[]];return["#!/usr/bin/env node",u,'import { readFileSync, writeFileSync } from "node:fs";',[...e.runtime==="package"?['import { runCli, type CliCommand } from "@redocly/client-generator";']:[],`import { ${i.join(", ")} } from "${r}";`,...e.zodSelected?[`import { zodValidation } from "./${e.stem}.zod.${e.importExt}";`]:[]].join(`
8
8
  `),...e.runtime==="inline"?[`// \u2500\u2500\u2500 Embedded cli engine (@redocly/client-generator) \u2500\u2500\u2500
9
9
  `+p()]:[],`const COMMANDS: CliCommand[] = ${c(t,2)};`,...e.zodSelected?['use(zodValidation(process.argv.includes("--dry-run") ? { response: false } : {}));']:[],`process.exit(
10
10
  await runCli(COMMANDS, {
11
11
  binName: ${c(e.binName)},
12
12
  client,
13
13
  configure,
14
- schemes: ${c(o)},
14
+ schemes: ${c(a)},
15
15
  env: process.env,
16
16
  stdin: () => readFileSync(0, "utf-8"),
17
17
  readFile: (path: string) => readFileSync(path, "utf-8"),
@@ -0,0 +1,16 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ import{a as T,b as Y}from"./BDIXGM4J.js";import{b as ee,d as te}from"./CDIETNM7.js";import"./ZXLNDDJH.js";import{a as h}from"./WZXA5XPB.js";import{a as Z}from"./YSMUBJCG.js";import{C as H,O as $,R as J,W as V,aa as W,c as q,ca as I,ja as Q,q as S,s as F}from"./C65SIVY5.js";import"./NEWT5A6S.js";import{b as M,c as R,g as D}from"./3XBPOSEL.js";import"./RFWIIJFG.js";import{mkdir as at,readFile as ct,writeFile as ut}from"node:fs/promises";import{dirname as $e,resolve as E,sep as ft}from"node:path";function A(e){return{requires:["sdk"],errorModes:["throw"],load:()=>import("./LUHMTQUR.js").then(t=>({run:t.tanstackQueryGenerator(e)}))}}var U={outputMode:"it always emits one self-contained file",runtime:"the runtime is always embedded in the generated file",argsStyle:"inputs follow the target language's own idiom",importExt:"the generated file has no relative imports"},G={sdk:{load:()=>import("./SQTDATOG.js").then(e=>({run:e.sdkGenerator,sample:e.sdkSample}))},zod:{load:()=>import("./MK4LHZVA.js").then(e=>({run:e.zodGenerator}))},transformers:{requires:["sdk"],dateTypes:["Date"],load:()=>import("./HLD5FTSQ.js").then(e=>({run:e.transformersGenerator}))},"tanstack-query":A("react"),"tanstack-query-vue":A("vue"),"tanstack-query-svelte":A("svelte"),"tanstack-query-solid":A("solid"),swr:{requires:["sdk"],errorModes:["throw"],load:()=>import("./25GSVUWJ.js").then(e=>({run:e.swrGenerator}))},mock:{requires:["sdk"],load:()=>import("./PYCIZVAB.js").then(e=>({run:e.mockGenerator}))},cli:{requires:["sdk","zod"],errorModes:["throw"],load:()=>import("./5KALNFRG.js").then(e=>({run:e.cliGenerator,sample:e.cliSample}))},"cli-docs":{requires:["cli"],errorModes:["throw"],notApplicable:{outputMode:"it emits one Markdown page",importExt:"a Markdown page has no imports",runtime:"a Markdown page embeds no runtime"},load:()=>import("./HY6IQ5MU.js").then(e=>({run:e.cliDocsGenerator,options:e.cliDocsOptions}))},python:{notApplicable:U,load:()=>import("./G332MANL.js").then(e=>({run:e.pythonGenerator,sample:e.pythonSample}))},go:{errorModes:["throw"],notApplicable:U,load:()=>import("./HU2IUTZL.js").then(e=>({run:e.goGenerator,sample:e.goSample}))},php:{errorModes:["throw"],notApplicable:U,load:()=>import("./DDSMAYCX.js").then(e=>({run:e.phpGenerator,sample:e.phpSample}))}},ke=[{option:"binName",generators:["cli","cli-docs"],reason:"it names the generated command"},{option:"goPackage",generators:["go"],reason:"it declares the Go package clause"}];function ne(e,t,n,r){let s=new Set(e);for(let{option:c,generators:u,reason:d}of ke)t[c]!==void 0&&!u.some(f=>s.has(f))&&$.warn(`generate-client: ${c} is ignored \u2014 ${d}, and no selected generator uses it (add --generator ${u[0]}).
8
+ `);let o=t.errorMode??"throw",i=t.dateType??"string",a=t.runtime??"inline";for(let c of e){let u=n.get(c);if(!u)throw new h(`Unknown generator: ${c}`);for(let f of u.requires??[])if(!s.has(f)){let m=[...new Set([f,...e])].map(l=>`--generator ${l}`).join(" ");throw new h(`The "${c}" generator requires the "${f}" generator. Add it, e.g. ${m}.`)}if(u.errorModes&&!u.errorModes.includes(o))throw new h(`The "${c}" generator does not support --error-mode "${o}" (supported: ${u.errorModes.join(", ")}).`);if(u.dateTypes&&!u.dateTypes.includes(i))throw new h(`The "${c}" generator requires --date-type ${u.dateTypes.join(" or ")} (got "${i}") so the runtime values match the generated types.`);if(u.runtimes&&!u.runtimes.includes(a))throw new h(`The "${c}" generator does not support runtime "${a}" (supported: ${u.runtimes.join(", ")}).`);let d={...t,outputMode:r};for(let[f,m]of Object.entries(u.notApplicable??{}))d[f]!==void 0&&$.warn(`generate-client: the "${c}" generator ignores ${f} \u2014 ${m}.
9
+ `)}}function re(e,t,n){let r=new Map;for(let s of e){let o=t.get(s)?.options,i=n?.[s];if(o===void 0){i!==void 0&&$.warn(`generate-client: the "${s}" generator declares no options, so client.options.${s} is ignored.
10
+ `),r.set(s,{});continue}r.set(s,Se(s,o,i))}return r}function Se(e,t,n){if(n!==void 0&&!q(n))throw new h(`The "${e}" generator's options must be a map of option names to values.`);let r=n??{},s=Object.keys(t.properties);if(t.additionalProperties!==!0){for(let i of Object.keys(r))if(!s.includes(i))throw new h(`The "${e}" generator got an unknown option "${i}". Declared options: ${s.join(", ")||"(none)"}.`)}for(let i of t.required??[])if(r[i]===void 0)throw new h(`The "${e}" generator requires the "${i}" option.`);let o={...r};for(let[i,a]of Object.entries(t.properties)){if(o[i]===void 0){a.default!==void 0&&(o[i]=a.default);continue}let c=ve(a,o[i]);if(c!==void 0)throw new h(`The "${e}" generator's "${i}" ${c}.`)}return o}function ve(e,t){if("enum"in e)return e.enum.includes(t)?void 0:`must be one of: ${e.enum.join(", ")}`;if(e.type==="array"){let n=e.items.type;return Array.isArray(t)&&t.every(r=>typeof r===n)?void 0:`must be an array of ${n}`}return typeof t===e.type?void 0:`must be a ${e.type}`}import{isAbsolute as Oe,resolve as qe}from"node:path";import{pathToFileURL as xe}from"node:url";async function se(e,t={}){let n=new Map;for(let a of t.customGenerators??[])ie(n,a);let r=[];for(let a of e)r.push(await oe(a,n,t.configDir));let s=[],o=new Set,i=async a=>{if(!(s.includes(a)||o.has(a))){o.add(a);for(let c of n.get(a).requires??[])(n.has(c)||c in G)&&await i(await oe(c,n,t.configDir));o.delete(a),s.push(a)}};for(let a of r)await i(a);return{selected:s,registry:n}}async function oe(e,t,n){if(t.has(e))return e;let r=G[e];if(r!==void 0){let{load:o,...i}=r;return t.set(e,{...i,...await o()}),e}let s=await Pe(e,n??process.cwd());return ie(t,s),s.name}function ie(e,t){if(!q(t)||typeof t.name!="string"||t.name===""||typeof t.run!="function")throw new h("Invalid custom generator: expected an object with a non-empty string `name` and a `run` function (build one with `defineGenerator`).");if(e.has(t.name))throw new h(`Generator name "${t.name}" collides with an existing generator. Rename the custom generator.`);if(t.requiresGenerator!==void 0){let n=Y(T,t.requiresGenerator);if(n===void 0)throw new h(`Generator "${t.name}" declares requiresGenerator "${t.requiresGenerator}", which is not a range we read. Use ^1.2.0, ~1.2.0, >=1.2.0, or an exact version.`);if(!n)throw new h(`Generator "${t.name}" needs @redocly/client-generator ${t.requiresGenerator}; this CLI ships ${T}. Upgrade @redocly/cli if the generator is newer, or update the generator \u2014 \`redocly eject-generator <name> --update\` for an ejected file, or upgrade its package.`)}t.name in G&&$.warn(`generate-client: custom generator "${t.name}" takes over the built-in generator of the same name.
11
+ `),e.set(t.name,{run:t.run,sample:t.sample,options:t.options,requires:t.requires,errorModes:t.errorModes,dateTypes:t.dateTypes,runtimes:t.runtimes})}async function Pe(e,t){if(F(e))throw new h(`Remote generator modules are not supported \u2014 use a local path or a package name. Got: ${e}`);let r=e.startsWith(".")||Oe(e)?xe(qe(t,e)).href:e,s;try{s=await import(r)}catch(i){throw new h(`Could not load generator "${e}": ${i.message}`)}let o=s.default??s.generator;if(o===void 0)throw new h(`Generator module "${e}" must export a generator (a default export or a \`generator\` export built with \`defineGenerator\`).`);return o}function ue(e){let t=new Set,n=new Set,r=new Map;for(let l of e.securitySchemes){let p=C(l.key,t,n);p!==l.key&&(r.set(l.key,p),L("security scheme",l.key,p,ce(l.key,t)),l.key=p)}let s=new Set([...te(),...ee(e.securitySchemes)]),o=new Set(s),i=new Set,a=new Map;for(let l of e.schemas){let p=C(l.name,o,i);p!==l.name&&(a.set(l.name,p),L("schema",l.name,p,ce(l.name,s)),l.name=p)}let c=l=>a.get(l)??ae(l),u=l=>r.get(l)??ae(l);for(let l of e.schemas)w(l.schema,c);let d=new Set(o),f=new Set,m=new Set;for(let l of e.services)for(let p of l.operations){let g=m.has(p.name);m.add(p.name);let k=p.name,P=C(p.name,d,f);if(P!==p.name){let N=g?{kind:"duplicate-operation-id"}:s.has(k)?{kind:"reserved"}:o.has(k)?{kind:"schema-collision"}:{kind:"unusable"};L("operation",k,P,N),p.specName=p.name,p.name=P}je(p,c),p.security=p.security.map(N=>N.map(u))}}function C(e,t,n){let r=R(e),s=r,o=2;for(;t.has(s)||n.has(D(s));)s=`${r}_${o++}`;return t.add(s),n.add(D(s)),s}var Ne=["params","body","headers","cookies"];function fe(e){for(let t of e.services)for(let n of t.operations)for(let r of n.pathParams)if(Ne.includes(r.name))throw new h(`Operation "${n.specName??n.name}": path parameter "${r.name}" collides with the "${r.name}" request-argument slot; rename the parameter in the API description.`)}function pe(e){for(let t of e.schemas)if(!M(t.name))throw B("schema",t.name);for(let t of e.securitySchemes)if(!M(t.key))throw B("security scheme",t.key);for(let t of e.services)for(let n of t.operations)if(!M(n.name))throw B("operation",n.name)}function B(e,t){return new Error(`Internal error: ${e} name ${JSON.stringify(t)} is not a safe identifier after sanitization.`)}function ae(e){return R(e)}function L(e,t,n,r){let s=JSON.stringify(t),o=JSON.stringify(n),i=r.kind==="duplicate-operation-id"?`two operations share the operationId ${s}; the second is emitted as ${o} \u2014 give each operation a unique operationId to control its method name`:r.kind==="schema-collision"?`${e} ${s} collides with the schema of the same name, so it is emitted as ${o} \u2014 rename the operation or the schema in the description to control its name`:r.kind==="reserved"?`${e} ${s} is a name a generated client already declares, so it is emitted as ${o} \u2014 the reserved set spans every target language, so one schema keeps one name across the SDKs you generate`:`${e} ${s} is not a usable identifier, so it is emitted as ${o}`;$.warn(`generate-client: ${i}.
12
+ `)}function ce(e,t){return t.has(e)?{kind:"reserved"}:{kind:"unusable"}}function w(e,t){switch(e.kind){case"ref":e.name=t(e.name);break;case"omit":e.base=t(e.base);break;case"array":w(e.items,t);break;case"record":w(e.value,t);break;case"object":for(let n of e.properties)w(n.schema,t);break;case"union":for(let n of e.members)w(n,t);if(e.discriminator)for(let n of e.discriminator.mapping)n.schemaName=t(n.schemaName);break;case"intersection":for(let n of e.members)w(n,t);break}}function je(e,t){for(let n of e.pathParams)w(n.schema,t);for(let n of e.queryParams)w(n.schema,t);for(let n of e.headerParams)w(n.schema,t);for(let n of e.cookieParams)w(n.schema,t);e.requestBody&&w(e.requestBody.schema,t);for(let n of[...e.successResponses,...e.errorResponses])w(n.schema,t),n.itemSchema&&w(n.itemSchema,t)}var Me=["get","post","put","delete","patch","head","options"];function le(e,t){if(!t.startsWith("#/"))throw new h(`External $ref not supported: ${t}`);let n=t.slice(2).split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~")),r=e;for(let s of n){if(!q(r)&&!Array.isArray(r))throw new h(`Cannot resolve $ref: ${t}`);r=r[s]}if(r===void 0)throw new h(`Cannot resolve $ref: ${t}`);return r}function v(e,t){return S(t)?le(e,t.$ref):t}function j(e){let t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function Ae(e){let t=e,n={};return typeof t.minimum=="number"&&(n.minimum=t.minimum),typeof t.maximum=="number"&&(n.maximum=t.maximum),typeof t.exclusiveMinimum=="number"?n.exclusiveMinimum=t.exclusiveMinimum:t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(n.exclusiveMinimum=t.minimum,delete n.minimum),typeof t.exclusiveMaximum=="number"?n.exclusiveMaximum=t.exclusiveMaximum:t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(n.exclusiveMaximum=t.maximum,delete n.maximum),typeof t.minLength=="number"&&(n.minLength=t.minLength),typeof t.maxLength=="number"&&(n.maxLength=t.maxLength),typeof t.pattern=="string"&&(n.pattern=t.pattern),typeof t.minItems=="number"&&(n.minItems=t.minItems),typeof t.maxItems=="number"&&(n.maxItems=t.maxItems),t.uniqueItems===!0&&(n.uniqueItems=!0),typeof t.format=="string"&&(n.format=t.format),t.deprecated===!0&&(n.deprecated=!0),t.example!==void 0?n.example=t.example:Array.isArray(t.examples)&&t.examples.length>0&&(n.example=t.examples[0]),t.default!==void 0&&(n.default=t.default),Object.keys(n).length>0?n:void 0}function Ge(e,t){let n=e.discriminator;if(!n||typeof n.propertyName!="string")return;let r=[];if(n.mapping)for(let[s,o]of Object.entries(n.mapping))r.push({value:s,schemaName:j(o)});else for(let s of t)if(S(s)){let o=j(s.$ref);r.push({value:o,schemaName:o})}if(r.length!==0)return{propertyName:n.propertyName,mapping:r}}function b(e,t){return t?{...e,metadata:t}:e}function z(e,t){return e?t?{...e,...t}:e:t}function Ee(e){return e?e.url.replace(/\{([^{}]+)\}/g,(t,n)=>e.variables?.[n]?.default??t):""}function me(e){let t=e.info?.title??"Api",n=e.info?.version??"0.0.0",r=e.info?.description,s=Ee(e.servers?.[0]),o=(e.servers??[]).map(d=>({url:d.url,description:d.description,variables:Object.entries(d.variables??{}).map(([f,m])=>({name:f,default:m.default,description:m.description}))})),i=Be(e),a=Ue(e),c=Le(e,a),u={title:t,version:n,description:r,serverUrl:s,servers:o,services:c,schemas:i,securitySchemes:a};return ue(u),Ie(c,i),pe(u),fe(u),u}function Ie(e,t){let n=new Map(t.map(r=>[r.name,r.schema]));for(let r of e)for(let s of r.operations)s.requestBody&&(s.requestBody.schema=Re(s.requestBody.schema,n))}function Te(e){let t=e.filter(n=>n.kind!=="unknown");return t.length>0?t:[{kind:"unknown"}]}function Re(e,t){if(e.kind==="ref"){let n=De(e,t,new Set);return n.length>0?{kind:"omit",base:e.name,keys:n}:e}if(e.kind==="object"){let n=e.properties.filter(r=>!r.readOnly);return n.length===e.properties.length?e:{...e,properties:n}}return e}function De(e,t,n){let r=[],s=o=>{if(o.kind==="ref"){if(n.has(o.name))return;n.add(o.name);let i=t.get(o.name);i&&s(i)}else if(o.kind==="object")for(let i of o.properties)i.readOnly&&!r.includes(i.name)&&r.push(i.name);else if(o.kind==="intersection")for(let i of o.members)s(i)};return s(e),r}function Ue(e){let t=e.components?.securitySchemes;if(!t)return[];let n=[];for(let[r,s]of Object.entries(t)){let o=v(e,s),i=o.type;i==="oauth2"||i==="openIdConnect"?n.push({kind:"bearer",key:r}):i==="http"&&(o.scheme??"").toLowerCase()==="bearer"?n.push({kind:"bearer",key:r}):i==="http"&&(o.scheme??"").toLowerCase()==="basic"?n.push({kind:"basic",key:r}):i==="apiKey"&&o.in==="header"&&typeof o.name=="string"?n.push({kind:"apiKeyHeader",key:r,headerName:o.name}):i==="apiKey"&&o.in==="query"&&typeof o.name=="string"?n.push({kind:"apiKeyQuery",key:r,paramName:o.name}):i==="apiKey"&&o.in==="cookie"&&typeof o.name=="string"&&($.warn(`generate-client: security scheme "${r}" sends its credential in the Cookie header, which browsers ignore \u2014 cookie auth works only in server-side clients.
13
+ `),n.push({kind:"apiKeyCookie",key:r,cookieName:o.name}))}return n}function Ce(e,t,n){let r=e.security??t.security;if(!r)return[];let s=[];for(let o of r){let i=Object.keys(o);i.length!==0&&i.every(a=>n.has(a))&&s.push([...new Set(i)])}return s}function Be(e){let t=e.components?.schemas;return t?Object.entries(t).map(([n,r])=>{if(S(r)){let o=le(e,r.$ref);return{name:n,schema:x(o,`components.schemas.${n}`,e),description:o.description}}let s=x(r,`components.schemas.${n}`,e);return{name:n,schema:s,description:r.description}}):[]}function Le(e,t){let n=new Set(t.map(i=>i.key)),r=[],s=new Set;for(let[i,a]of Object.entries(e.paths??{})){if(!a)continue;let c=v(e,a),u=(c.parameters??[]).map(d=>he(v(e,d),`paths.${i}.parameters`,e));for(let d of Me){let f=c[d];f&&(r.push({method:d,path:i,operation:f,pathLevelParams:u}),f.operationId&&s.add(f.operationId))}}return[{name:"Default",operations:r.map(i=>{let a=i.operation.operationId??_e(ze(i.method,i.path),s);return Xe(i.method,i.path,i.operation,a,i.pathLevelParams,e,n)})}]}function ze(e,t){let n=t.split("/").filter(Boolean).map(r=>Ke(r.replace(/[{}]/g,"")));return`${e}${n.join("")}`}function Ke(e){return e.split(/[^A-Za-z0-9]+/).filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function _e(e,t){let n=e,r=2;for(;t.has(n);)n=`${e}${r++}`;return t.add(n),n}function Xe(e,t,n,r,s,o,i){let a=(n.parameters??[]).map(y=>he(v(o,y),`paths.${t}.${e}.parameters`,o)),c=new Set,u=[];for(let y of a)c.add(`${y.in}:${y.name}`),u.push(y);for(let y of s)c.has(`${y.in}:${y.name}`)||u.push(y);let d=u.filter(y=>y.in==="path"),f=u.filter(y=>y.in==="query"),m=u.filter(y=>y.in==="header"),l=u.filter(y=>y.in==="cookie"),p=n.requestBody?Fe(v(o,n.requestBody),`${e} ${t}`,o):void 0,{successResponses:g,successResponseHeaders:k}=He(n,t,o),P=Ve(n,t,o),N=Ce(n,o,i),X=n["x-redoclyPagination"];return{name:r,method:e,path:t,summary:n.summary,description:n.description,pathParams:d,queryParams:f,headerParams:m,cookieParams:l,requestBody:p,successResponses:g,...k===void 0?{}:{successResponseHeaders:k},errorResponses:P,security:N,tags:Array.isArray(n.tags)?n.tags.filter(y=>typeof y=="string"):[],...X!==void 0?{paginationExtension:X}:{}}}function he(e,t,n){if(!e.in)throw new h(`Parameter ${e.name} at ${t} is missing "in"`);if(!["path","query","header","cookie"].includes(e.in))throw new h(`Unsupported parameter location "${e.in}" for ${e.name} at ${t}`);let r=O(e.schema,`${t}.${e.name}`,n);e.deprecated===!0&&(r={...r,metadata:z(r.metadata,{deprecated:!0})});let s={name:e.name,in:e.in,schema:r,required:!!e.required,description:e.description};if(s.in==="query"){let o=e;(o.style==="form"||o.style==="spaceDelimited"||o.style==="pipeDelimited"||o.style==="deepObject")&&(s.style=o.style),typeof o.explode=="boolean"&&(s.explode=o.explode),typeof o.allowReserved=="boolean"&&(s.allowReserved=o.allowReserved)}return s}function Fe(e,t,n){let r=e.content??{},s=r["application/json"]??r["application/merge-patch+json"]??r["application/x-www-form-urlencoded"]??r["multipart/form-data"]??Object.values(r)[0];if(!s)return;let o=Object.keys(r).find(a=>r[a]===s),i=O(s.schema,`${t}.requestBody`,n);return{contentType:o,schema:i,required:!!e.required,description:e.description}}function He(e,t,n){let r=e.responses??{},s=Object.keys(r).filter(m=>/^2\d\d$/.test(m));s.length===0&&(r["2XX"]?s.push("2XX"):r.default&&s.push("default"));let o=s[0];if(!o)return{successResponses:[]};let i=r[o];if(!i)return{successResponses:[]};let a=v(n,i),c=Je(a.headers,`paths.${t}.response.${o}`,n),u=a.content;if(!u)return{successResponses:[],...c===void 0?{}:{successResponseHeaders:c}};let d=o==="default"||o==="2XX"?o:Number(o),f=[];for(let[m,l]of Object.entries(u)){let p=O(l.schema,`paths.${t}.response.${o}.${m}`,n),g=l.itemSchema,k=g!==void 0?O(g,`paths.${t}.response.${o}.${m}.itemSchema`,n):void 0;f.push({contentType:m,schema:p,status:d,...k===void 0?{}:{itemSchema:k}})}return{successResponses:f,...c===void 0?{}:{successResponseHeaders:c}}}function Je(e,t,n){if(!e)return;let r=[];for(let[s,o]of Object.entries(e)){let i=v(n,o),a={name:s.toLowerCase(),schema:O(i.schema===void 0?void 0:v(n,i.schema),`${t}.headers.${s}`,n)};i.required===!0&&(a.required=!0),r.push(a)}return r.length>0?r:void 0}function Ve(e,t,n){let r=e.responses??{},s=Object.keys(r).filter(a=>/^([45]\d\d|4XX|5XX)$/.test(a));Object.keys(r).some(a=>/^(2\d\d|2XX)$/.test(a))&&r.default&&s.push("default");let i=[];for(let a of s){let c=r[a];if(!c)continue;let d=v(n,c).content;if(!d)continue;let f=a==="default"||a==="4XX"||a==="5XX"?a:Number(a);for(let[m,l]of Object.entries(d)){let p=O(l.schema,`paths.${t}.response.${a}.${m}`,n);i.push({contentType:m,schema:p,status:f})}}return i}function O(e,t,n){return e===void 0||typeof e=="boolean"?{kind:"unknown"}:S(e)?{kind:"ref",name:j(e.$ref)}:x(e,t,n)}function x(e,t,n){let r=Ae(e),s=e.oneOf??e.anyOf;if(s){let a=s.map((d,f)=>S(d)?{kind:"ref",name:j(d.$ref)}:x(d,`${t}.[${f}]`,n)),c=Te(a);if(c.length===1&&c.length<a.length){let d=c[0];return{...d,description:d.description??e.description,metadata:z(r,d.metadata)}}let u=Ge(e,s);return b({kind:"union",members:c,discriminator:u,description:e.description},r)}if(e.allOf){let a=e.allOf.map((u,d)=>S(u)?{kind:"ref",name:j(u.$ref)}:x(u,`${t}.allOf[${d}]`,n)),c=de(e,t,n);if(c.length>0&&a.unshift({kind:"object",properties:c}),a.length===1){let u=a[0];return{...u,description:u.description??e.description,metadata:z(r,u.metadata)}}return b({kind:"intersection",members:a,description:e.description},r)}let o=e.type;if(Array.isArray(o)){let a=o.filter(d=>d!=="null"),c=o.includes("null"),u=a.map(d=>{let f={...e,type:d};if(Array.isArray(f.enum)){let m=f.enum.filter(l=>l!==null);f.enum=m.length>0?m:void 0}return x(f,t,n)});return c&&u.push({kind:"null"}),u.length===1?u[0]:b({kind:"union",members:u,description:e.description},r)}if(e.nullable)return{kind:"union",members:[x({...e,nullable:void 0},t,n),{kind:"null"}],description:e.description};if(e.const!==void 0){let a=e.const;if(typeof a!="string"&&typeof a!="number"&&typeof a!="boolean")throw new h(`Unsupported const value at ${t}: ${JSON.stringify(a)}`);return b({kind:"literal",value:a,description:e.description},r)}if(e.enum){let a=e.enum,c=a.filter(m=>m!==null),u=c.length!==a.length;if(c.length===0)return b({kind:"null",description:e.description},r);let d=We(c,t),f=d==="boolean"?{kind:"scalar",scalar:"boolean",description:e.description}:{kind:"enum",values:c,scalar:d,description:e.description};return b(u?{kind:"union",members:[f,{kind:"null"}],description:e.description}:f,r)}let i=o;if(i==="null")return b({kind:"null",description:e.description},r);if(i==="array"){let a=e.items,c=O(a,`${t}.items`,n);return b({kind:"array",items:c,description:e.description},r)}if(i==="object"||e.properties||e.additionalProperties){let a=de(e,t,n),c=e.additionalProperties;if(a.length===0&&c!==!1){let u=O(c,`${t}.additionalProperties`,n);return b({kind:"record",value:u,description:e.description},r)}return b({kind:"object",properties:a,description:e.description},r)}return b(i==="string"||i==="number"||i==="integer"||i==="boolean"?{kind:"scalar",scalar:i,description:e.description}:{kind:"unknown",description:e.description},r)}function We(e,t){let n=!1,r=!1,s=!1;for(let o of e)if(typeof o=="string")n=!0;else if(typeof o=="number")r=!0;else if(typeof o=="boolean")s=!0;else throw new h(`Unsupported enum value type at ${t}: ${JSON.stringify(o)}`);return n&&!r&&!s?"string":r&&!n&&!s?"number":s&&!n&&!r?"boolean":"string"}function Qe(e){return!(e.openapi??"").startsWith("3.0")}function de(e,t,n){let r=e.properties??{},s=new Set(e.required??[]),o=Qe(n);return Object.entries(r).map(([i,a])=>{let c=a.readOnly===!0;c&&S(a)&&!o&&$.warn(`generate-client: "${i}" declares readOnly beside a $ref, which OpenAPI ${n.openapi} ignores \u2014 the property stays in request bodies. Inline the schema, wrap the $ref in allOf, or move the description to OpenAPI 3.1.
14
+ `);let u=c&&(o||!S(a));return{name:i,schema:O(a,`${t}.${i}`,n),required:s.has(i),description:a.description,...u?{readOnly:!0}:{}}})}function ye(e){let t=K(e),n={...t};delete n.swagger,delete n.host,delete n.basePath,delete n.schemes,delete n.definitions,delete n.securityDefinitions,delete n.consumes,delete n.produces,delete n.parameters,delete n.responses,n.openapi="3.0.3";let r=Ye(t);return r&&(n.servers=r),n.components=Ze(t),n.paths=rt(t.paths??{},t.consumes??void 0,t.produces??void 0),n}function Ye(e){let t=e.host,n=e.basePath??"",r=(e.schemes??["https"])[0]??"https";if(t)return[{url:`${r}://${t}${n}`}]}function Ze(e){let t={};e.definitions&&(t.schemas=e.definitions),e.parameters&&(t.parameters=Object.fromEntries(Object.entries(e.parameters).map(([r,s])=>[r,_(s)]))),e.responses&&(t.responses=we(e.responses,void 0));let n=e.securityDefinitions;if(n){let r={};for(let[s,o]of Object.entries(n))r[s]=et(o);t.securitySchemes=r}return t}function et(e){switch(e.type){case"basic":return{type:"http",scheme:"basic"};case"apiKey":return{type:"apiKey",name:e.name,in:e.in};case"oauth2":{let t=e.flow==="accessCode"?"authorizationCode":e.flow==="application"?"clientCredentials":e.flow,n={scopes:e.scopes??{}};return e.authorizationUrl&&(n.authorizationUrl=e.authorizationUrl),e.tokenUrl&&(n.tokenUrl=e.tokenUrl),{type:"oauth2",flows:{[t]:n}}}default:return e}}function K(e){if(Array.isArray(e))return e.map(K);if(q(e)){let t={};for(let[n,r]of Object.entries(e))n==="$ref"&&typeof r=="string"?t.$ref=r.replace("#/definitions/","#/components/schemas/").replace("#/parameters/","#/components/parameters/").replace("#/responses/","#/components/responses/"):t[n]=K(r);return t}return e}var tt="application/json",nt="application/json",ge=new Set(["name","in","required","description","deprecated","allowEmptyValue","collectionFormat"]);function rt(e,t,n){let r={};for(let[s,o]of Object.entries(e)){let i=o,a={};for(let[c,u]of Object.entries(i)){if(c==="parameters"&&Array.isArray(u)){a.parameters=u.map(_);continue}if(!ot(c)){a[c]=u;continue}a[c]=st(u,t,n)}r[s]=a}return r}function ot(e){return["get","put","post","delete","options","head","patch"].includes(e.toLowerCase())}function st(e,t,n){let r=e.consumes??t,s=e.produces??n,o=e.parameters??[],i=o.find(f=>f.in==="body"),a=o.filter(f=>f.in==="formData"),c=o.filter(f=>f.in!=="body"&&f.in!=="formData").map(_),u={...e,parameters:c};delete u.consumes,delete u.produces;let d=r?.[0]??tt;if(i)u.requestBody={required:!!i.required,content:{[d]:{schema:i.schema}}};else if(a.length>0){let f={},m=[];for(let g of a)f[g.name]=it(g),g.required&&m.push(g.name);let l={type:"object",properties:f};m.length>0&&(l.required=m);let p=r?.find(g=>g==="multipart/form-data")??r?.[0]??"application/x-www-form-urlencoded";u.requestBody={required:m.length>0,content:{[p]:{schema:l}}}}return e.responses&&(u.responses=we(e.responses,s)),u}function _(e){if(e.$ref!==void 0||e.in==="body"||e.in==="formData")return e;let t={},n={};for(let[r,s]of Object.entries(e))ge.has(r)?t[r]=s:n[r]=s;if(t.schema=n,delete t.collectionFormat,e.in==="query"&&n.type==="array"){let r=e.collectionFormat??"csv";r!=="multi"&&(t.style=r==="ssv"?"spaceDelimited":r==="pipes"?"pipeDelimited":"form",t.explode=!1)}return t}function it(e){let t={};for(let[n,r]of Object.entries(e))ge.has(n)||(t[n]=r);return t}function we(e,t){let n=t?.[0]??nt,r={};for(let[s,o]of Object.entries(e)){let i=o;if(i.schema===void 0){r[s]=i;continue}let{schema:a,...c}=i;r[s]={...c,content:{[n]:{schema:a}}}}return r}async function be(e,t){let n=t??await I({}),r=await W({ref:e,config:n}),s=await I({rules:{struct:"error"}}),o=await Q({externalRefResolver:new V,document:r.bundle,config:s}),i=[...r.problems,...o].filter(c=>c.severity==="error");if(i.length>0){let c=i.map(u=>`- ${u.message} (at ${u.location?.[0]?.pointer??e})`).join(`
15
+ `);throw new Error(`The API description has ${i.length} error(s):
16
+ ${c}`)}let a=r.bundle.parsed;return{document:a,version:J(a)}}function pt(e,t){let n=[],r=new Set,s=E($e(t.outputPath));for(let o of t.generators){let i=t.registry.get(o),a;try{a=i.run({model:e,outputPath:t.outputPath,outputMode:t.outputMode,emit:t.emit,selected:t.generators,options:t.generatorOptions?.get(o)??{}})}catch(c){let u=c instanceof Error?c.message:String(c);throw new Error(`Generator "${o}" failed: ${u}`)}if(!Array.isArray(a)||a.some(c=>typeof c?.path!="string"||c.path===""||typeof c.content!="string"))throw new Error(`Generator "${o}" failed: run() must return an array of { path, content } files.`);for(let c of a){let u=E(s,c.path);if(u!==s&&!u.startsWith(s+ft))throw new Error(`Generator "${o}" failed: file path escapes the output directory: ${c.path}`);if(r.has(c.path))throw new Error(`Generator conflict: ${c.path} already emitted by an earlier generator`);r.add(c.path),n.push(c)}}return n}function dt(e,t,n,r){let s=[];for(let o of Z(e.services)){let i=n.map(a=>r.get(a)?.sample?.(o,{model:e,emit:t})).filter(a=>a!==void 0);i.length>0&&s.push({target:`$.paths['${o.path.replaceAll("'","''")}'].${o.method}`,update:{"x-codeSamples":i}})}if(s.length!==0)return H({overlay:"1.0.0",info:{title:`Code samples for ${e.title}`,version:e.version},actions:s})}async function Yt(e){if(e.output.split(/[\\/]/).some(p=>p==="undefined"||p==="null"))throw new Error(`output path "${e.output}" contains a literal "undefined" or "null" segment \u2014 this looks like an interpolation bug in the caller`);if(e.setup&&/^[a-z][a-z0-9+.-]+:/i.test(e.setup))throw new h(`setup must be a local file path \u2014 remote setup modules are not supported (got: ${e.setup})`);let t=E(e.output),{document:n,version:r}=await be(e.api,e.config),s=r==="oas2"?ye(n):n,o=me(s),i;if(e.setup){let{bakeSetup:p}=await import("./L5QMCITI.js"),g=E(e.configDir??process.cwd(),e.setup);i=p(await ct(g,"utf-8"))}let a=e.generators?.length?e.generators:["sdk"],{selected:c,registry:u}=await se(a,{customGenerators:e.customGenerators,configDir:e.configDir}),d={serverUrl:e.serverUrl,argsStyle:e.argsStyle,errorMode:e.errorMode,dateType:e.dateType,mockData:e.mockData,mockSeed:e.mockSeed,queryKeyPrefix:e.queryKeyPrefix,setup:i,runtime:e.runtime,importExt:e.importExt,binName:e.binName,goPackage:e.goPackage,pagination:e.pagination};ne(c,d,u,e.outputMode);let f=re(c,u,e.options),m=pt(o,{outputPath:t,outputMode:e.outputMode??"single",emit:d,generators:c,generatorOptions:f,registry:u});if(e.codeSamples===!0){let p=dt(o,d,c,u);p!==void 0&&m.push({path:t.replace(/\.[^.]+$/,".code-samples.yaml"),content:p})}let l=[];for(let p of m)await at($e(p.path),{recursive:!0}),await ut(p.path,p.content,"utf-8"),l.push({path:p.path,bytes:Buffer.byteLength(p.content,"utf-8")});return{outputPath:t,bytes:l.reduce((p,g)=>p+g.bytes,0),files:l}}export{Yt as generateClient,pt as runGenerators};
@@ -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 s,b as d}from"./QZAA7G5W.js";import{a as p,b as g}from"./HGS5KAIG.js";import"./OAY4A6XN.js";import{a as c}from"./ZGQWJITG.js";import"./SHLXMMCF.js";import"./P3HJG5ZU.js";import"./OAHVR5VG.js";import"./YSMUBJCG.js";import"./C65SIVY5.js";import"./NEWT5A6S.js";import"./3GFYSU6P.js";import{f as u}from"./BDG6IUCF.js";import"./3XBPOSEL.js";import"./RFWIIJFG.js";import{join as y}from"node:path";function f(i){return(i??"").replace(/\s+/g," ").trim().replace(/\\/g,"\\\\").replace(/\|/g,"\\|")}function b(i){return[i.group===void 0?void 0:s(i.group),i.name].filter(Boolean).join(" ")}function m(i,n){return[i,b(n),...n.positionals.map(t=>`<${t.name}>`),...n.flags.filter(t=>t.required).map(t=>`--${t.name} <${t.type}>`),...n.body?[n.body.required?"--json '<json>'":"[--json '<json>']"]:[]].filter(t=>t!=="").join(" ")}function $(i,n){i.line("| Flag | Type | Required | Description |"),i.line("| ---- | ---- | -------- | ----------- |");for(let e of n){let t=[f(e.description),e.enum===void 0?"":`One of ${e.enum.map(o=>`\`${o}\``).join(", ")}.`,e.type==="array"?"Repeat the flag for multiple values.":""].filter(o=>o!=="").join(" ");i.line(`| \`--${e.name}\` | ${e.type} | ${e.required?"yes":"no"} | ${t} |`)}i.blank()}function k(i,n,e){if(i.line(`### \`${b(n)}\``),i.blank(),n.summary!==void 0&&(i.line(f(n.summary)),i.blank()),i.line(`\`${n.method} ${n.path}\``),i.blank(),i.line("```sh"),i.line(m(e.binName,n)),i.line("```"),i.blank(),n.positionals.length>0){i.line("| Argument | Description |"),i.line("| -------- | ----------- |");for(let o of n.positionals)i.line(`| \`<${o.name}>\` | ${f(o.description)} |`);i.blank()}n.flags.length>0&&$(i,n.flags);let t=[n.body===void 0?"":`Takes a JSON body${n.body.required?" (required)":""}: \`--json '<json>'\`, \`--json @file.json\`, or \`--json @-\` for stdin.`,n.unsupportedBody===void 0?"":`Takes a \`${n.unsupportedBody}\` body, which the CLI cannot build \u2014 call this operation through the generated client instead.`,n.paginated===!0?"Paginated: `--page-all` follows every page, printing one JSON page per line.":"",n.sse===!0?"Streams server-sent events as one JSON object per line.":"",n.blob===!0?"Returns binary content, so `--output <path>` is required.":""].filter(o=>o!=="");for(let o of t)i.line(o);t.length>0&&i.blank()}function h(i,n){let e=new c;n.frontmatter&&(e.line("---"),e.line(`title: ${n.title}`),e.line("---"),e.blank()),e.line(`# ${n.title}`),e.blank(),e.line(`Generated command-line reference for \`${n.binName}\`, produced from the API description by \`redocly generate-client\`.`),e.line("Re-run generation to update it \u2014 this file is not hand-edited."),e.blank(),e.line("## Usage"),e.blank(),e.line("```sh"),e.line(`${n.binName} <command> [flags]`),e.line(`${n.binName} --help`),e.line(`${n.binName} schema <command> # request/response schemas`),e.line("```"),e.blank(),e.line("## Global flags"),e.blank(),e.line("| Flag | Description |"),e.line("| ---- | ----------- |");for(let[r,l]of[["--server-url <url>","Override the server URL included in the client."],["--format <json\\|ndjson>","Output format."],["--dry-run","Print the prepared request, credentials redacted, without sending it."],["--page-all","Follow pagination, printing one JSON page per line."],["--output <path>","Write the response body to a file. Required for binary responses."],["--token <token>","Bearer token, overriding the environment."],["--json <json\\|@file\\|@->","Request body, inline or from a file or stdin."]])e.line(`| \`${r}\` | ${l} |`);e.blank();let t=d(n.binName);if(e.line("## Credentials"),e.blank(),n.schemes.length===0)e.line("The description declares no security schemes, so no credentials are read.");else{e.line("Credentials come from the environment:"),e.blank(),e.line("| Scheme | Variable |"),e.line("| ------ | -------- |");for(let r of n.schemes){let l=r.kind==="bearer"?`\`${t}_TOKEN\` (or \`--token\`)`:r.kind==="basic"?`\`${t}_USERNAME\` and \`${t}_PASSWORD\``:`\`${t}_API_KEY_${d(r.key)}\``;e.line(`| ${r.kind} (\`${r.key}\`) | ${l} |`)}}e.blank(),e.line("## Exit codes"),e.blank(),e.line("| Code | Meaning |"),e.line("| ---- | ------- |");for(let[r,l]of[[0,"success"],[1,"API error (status other than 401 or 403)"],[2,"auth error (401 or 403)"],[3,"validation error"],[4,"usage error (unknown command or flag, bad `--json`)"]])e.line(`| ${r} | ${l} |`);e.blank(),e.line("Errors print one JSON object to stderr, so stdout stays clean for piping."),e.blank();let o=[...new Set(i.map(r=>r.group))];for(let r of o){let l=i.filter(a=>a.group===r);r===void 0?(e.line("## Commands"),e.blank()):(e.line(`## ${r}`),e.blank(),e.line(`Addressed as \`${n.binName} ${s(r)} <command>\`.`),e.blank());for(let a of l)k(e,a,n)}return e.toString().replace(/\n{3,}/g,`
7
+ import{a as s,b as d}from"./2VVGA7JY.js";import{a as p,b as g}from"./DQWFUOGC.js";import"./6ATAJMOK.js";import{a as c}from"./ZGQWJITG.js";import"./ZXLNDDJH.js";import"./P3HJG5ZU.js";import"./OAHVR5VG.js";import"./YSMUBJCG.js";import"./C65SIVY5.js";import"./NEWT5A6S.js";import"./3GFYSU6P.js";import{f as u}from"./BDG6IUCF.js";import"./3XBPOSEL.js";import"./RFWIIJFG.js";import{join as y}from"node:path";function f(i){return(i??"").replace(/\s+/g," ").trim().replace(/\\/g,"\\\\").replace(/\|/g,"\\|")}function b(i){return[i.group===void 0?void 0:s(i.group),i.name].filter(Boolean).join(" ")}function m(i,n){return[i,b(n),...n.positionals.map(t=>`<${t.name}>`),...n.flags.filter(t=>t.required).map(t=>`--${t.name} <${t.type}>`),...n.body?[n.body.required?"--json '<json>'":"[--json '<json>']"]:[]].filter(t=>t!=="").join(" ")}function $(i,n){i.line("| Flag | Type | Required | Description |"),i.line("| ---- | ---- | -------- | ----------- |");for(let e of n){let t=[f(e.description),e.enum===void 0?"":`One of ${e.enum.map(o=>`\`${o}\``).join(", ")}.`,e.type==="array"?"Repeat the flag for multiple values.":""].filter(o=>o!=="").join(" ");i.line(`| \`--${e.name}\` | ${e.type} | ${e.required?"yes":"no"} | ${t} |`)}i.blank()}function k(i,n,e){if(i.line(`### \`${b(n)}\``),i.blank(),n.summary!==void 0&&(i.line(f(n.summary)),i.blank()),i.line(`\`${n.method} ${n.path}\``),i.blank(),i.line("```sh"),i.line(m(e.binName,n)),i.line("```"),i.blank(),n.positionals.length>0){i.line("| Argument | Description |"),i.line("| -------- | ----------- |");for(let o of n.positionals)i.line(`| \`<${o.name}>\` | ${f(o.description)} |`);i.blank()}n.flags.length>0&&$(i,n.flags);let t=[n.body===void 0?"":`Takes a JSON body${n.body.required?" (required)":""}: \`--json '<json>'\`, \`--json @file.json\`, or \`--json @-\` for stdin.`,n.unsupportedBody===void 0?"":`Takes a \`${n.unsupportedBody}\` body, which the CLI cannot build \u2014 call this operation through the generated client instead.`,n.paginated===!0?"Paginated: `--page-all` follows every page, printing one JSON page per line.":"",n.sse===!0?"Streams server-sent events as one JSON object per line.":"",n.blob===!0?"Returns binary content, so `--output <path>` is required.":""].filter(o=>o!=="");for(let o of t)i.line(o);t.length>0&&i.blank()}function h(i,n){let e=new c;n.frontmatter&&(e.line("---"),e.line(`title: ${n.title}`),e.line("---"),e.blank()),e.line(`# ${n.title}`),e.blank(),e.line(`Generated command-line reference for \`${n.binName}\`, produced from the API description by \`redocly generate-client\`.`),e.line("Re-run generation to update it \u2014 this file is not hand-edited."),e.blank(),e.line("## Usage"),e.blank(),e.line("```sh"),e.line(`${n.binName} <command> [flags]`),e.line(`${n.binName} --help`),e.line(`${n.binName} schema <command> # request/response schemas`),e.line("```"),e.blank(),e.line("## Global flags"),e.blank(),e.line("| Flag | Description |"),e.line("| ---- | ----------- |");for(let[r,l]of[["--server-url <url>","Override the server URL included in the client."],["--format <json\\|ndjson>","Output format."],["--dry-run","Print the prepared request, credentials redacted, without sending it."],["--page-all","Follow pagination, printing one JSON page per line."],["--output <path>","Write the response body to a file. Required for binary responses."],["--token <token>","Bearer token, overriding the environment."],["--json <json\\|@file\\|@->","Request body, inline or from a file or stdin."]])e.line(`| \`${r}\` | ${l} |`);e.blank();let t=d(n.binName);if(e.line("## Credentials"),e.blank(),n.schemes.length===0)e.line("The description declares no security schemes, so no credentials are read.");else{e.line("Credentials come from the environment:"),e.blank(),e.line("| Scheme | Variable |"),e.line("| ------ | -------- |");for(let r of n.schemes){let l=r.kind==="bearer"?`\`${t}_TOKEN\` (or \`--token\`)`:r.kind==="basic"?`\`${t}_USERNAME\` and \`${t}_PASSWORD\``:`\`${t}_API_KEY_${d(r.key)}\``;e.line(`| ${r.kind} (\`${r.key}\`) | ${l} |`)}}e.blank(),e.line("## Exit codes"),e.blank(),e.line("| Code | Meaning |"),e.line("| ---- | ------- |");for(let[r,l]of[[0,"success"],[1,"API error (status other than 401 or 403)"],[2,"auth error (401 or 403)"],[3,"validation error"],[4,"usage error (unknown command or flag, bad `--json`)"]])e.line(`| ${r} | ${l} |`);e.blank(),e.line("Errors print one JSON object to stderr, so stdout stays clean for piping."),e.blank();let o=[...new Set(i.map(r=>r.group))];for(let r of o){let l=i.filter(a=>a.group===r);r===void 0?(e.line("## Commands"),e.blank()):(e.line(`## ${r}`),e.blank(),e.line(`Addressed as \`${n.binName} ${s(r)} <command>\`.`),e.blank());for(let a of l)k(e,a,n)}return e.toString().replace(/\n{3,}/g,`
8
8
 
9
9
  `).trimEnd()+`
10
10
  `}var P={type:"object",properties:{title:{type:"string",description:'Page heading. Defaults to "<API title> command-line reference".'},frontmatter:{type:"boolean",default:!1,description:"Emit YAML front matter carrying the title, for docs sites that expect it."}},additionalProperties:!1};function j(i){return i.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()||"client"}var D=({model:i,outputPath:n,emit:e,options:t})=>{let{dir:o,stem:r}=u(n),l=h(p(i,{pagination:e.pagination}),{title:t?.title??`${i.title} command-line reference`,frontmatter:t?.frontmatter===!0,binName:e.binName??j(r),schemes:g(i)});return[{path:y(o,`${r}.cli.md`),content:l}]};export{D as cliDocsGenerator,P as cliDocsOptions};
@@ -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 O}from"./RS5PUOTT.js";import{a as I}from"./BXI4SF2U.js";import{c as p}from"./P26PQ2RU.js";import{a as R}from"./6ZLMHCAS.js";import{G as T,I as w,O as a}from"./C65SIVY5.js";import{e as C}from"./RFWIIJFG.js";import{Buffer as P}from"node:buffer";import y from"node:crypto";import{mkdirSync as j,existsSync as F,writeFileSync as q,readFileSync as z,rmSync as M}from"node:fs";import{homedir as H}from"node:os";import B from"node:path";var l={us:"https://app.cloud.redocly.com",eu:"https://app.cloud.eu.redocly.com"};function G(){return process.env.REDOCLY_DOMAIN||l.us}var U=D((o,e)=>{try{let t=e||o?.resolvedConfig.residency;return W(t)?l[t]:t?new URL(t).origin:o?.resolvedConfig.scorecard?.fromProjectUrl?new URL(o.resolvedConfig.scorecard.fromProjectUrl).origin:l.us}catch{throw new f}});function x(o){try{U(void 0,o)}catch{return!1}return!0}function D(o){return(...e)=>{let t=o(...e);if(!t.startsWith("https://"))throw new f;return t}}var f=class extends Error{constructor(){super("Invalid Reunite URL")}};function W(o){return typeof o=="string"&&o in l}import*as k from"node:child_process";var g=C(I(),1);var N=C(O(),1);function b(){return process.env.HTTPS_PROXY||process.env.HTTP_PROXY||process.env.http_proxy||process.env.https_proxy}function S(o){let e=process.env.NO_PROXY||process.env.no_proxy;if(!e)return!1;let t=e.split(",").map(s=>s.trim().toLowerCase()).filter(Boolean);if(t.length===0)return!1;let r;try{r=new URL(o).hostname.toLowerCase()}catch{return!1}return t.some(s=>!!(s==="*"||r===s||s.startsWith(".")&&r.endsWith(s)||!s.startsWith(".")&&r.endsWith("."+s)))}var _=async(o,{timeout:e,...t}={})=>{let r=b(),s=r&&!S(o),n,i=e?{connect:{timeout:e}}:{};return s?n=new g.ProxyAgent({uri:r,...i}):e&&(n=new g.Agent(i)),await fetch(o,{signal:e?AbortSignal.timeout(e):void 0,...t,dispatcher:n})};var c=class extends Error{constructor(t,r){super(t);this.status=r}status},h=class{constructor(e){this.command=e}command;sunsetWarnings=[];async request(e,t){let r={...t.headers,"user-agent":`redocly-cli/${R} ${this.command}`};try{let s=await _(e,{...t,headers:r});return this.collectSunsetWarning(s),s}catch(s){let n="Failed to fetch.";throw s.cause&&(n+=` Caused by ${s.cause.message||s.cause.name}.`),(s.code||s.cause?.code)&&(n+=` Code: ${s.code||s.cause?.code}`),new Error(n)}}collectSunsetWarning(e){let t=this.getSunsetDate(e);if(!t)return;let r=new Date(t);t>Date.now()?this.sunsetWarnings.push({sunsetDate:r,isSunsetExpired:!1}):this.sunsetWarnings.push({sunsetDate:r,isSunsetExpired:!0})}getSunsetDate(e){let{headers:t}=e;if(!t)return;let r=t.get("sunset")||t.get("Sunset");if(r)return Date.parse(r)}},v=class{constructor(e,t,r){this.client=e;this.domain=t;this.apiKey=r}client;domain;apiKey;async getParsedResponse(e){let t=await e.json();if(e.ok)return t;throw new c(`${t.title||e.statusText||"Unknown error"}.`,e.status)}async getDefaultBranch(e,t){try{let r=await this.client.request(`${this.domain}/api/orgs/${e}/projects/${t}/source`,{timeout:p,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`}});return(await this.getParsedResponse(r)).branchName}catch(r){let s=`Failed to fetch default branch. ${r.message}`;throw r instanceof c?new c(s,r.status):new Error(s)}}async upsert(e,t,r){try{let s=await this.client.request(`${this.domain}/api/orgs/${e}/projects/${t}/remotes`,{timeout:p,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({mountPath:r.mountPath,mountBranchName:r.mountBranchName,type:"CICD",autoMerge:!0})});return await this.getParsedResponse(s)}catch(s){let n=`Failed to upsert remote. ${s.message}`;throw s instanceof c?new c(n,s.status):new Error(n)}}async push(e,t,r,s){let n=new globalThis.FormData;n.append("remoteId",r.remoteId),n.append("commit[message]",r.commit.message),n.append("commit[author][name]",r.commit.author.name),n.append("commit[author][email]",r.commit.author.email),n.append("commit[branchName]",r.commit.branchName),r.commit.url&&n.append("commit[url]",r.commit.url),r.commit.namespace&&n.append("commit[namespaceId]",r.commit.namespace),r.commit.sha&&n.append("commit[sha]",r.commit.sha),r.commit.repository&&n.append("commit[repositoryId]",r.commit.repository),r.commit.createdAt&&n.append("commit[createdAt]",r.commit.createdAt);for(let i of s){let u=Buffer.isBuffer(i.stream)?new Blob([i.stream]):new Blob([await L(i.stream)]);n.append(`files[${i.path}]`,u,i.path)}r.isMainBranch&&n.append("isMainBranch","true");try{let i=await this.client.request(`${this.domain}/api/orgs/${e}/projects/${t}/pushes`,{method:"POST",headers:{Authorization:`Bearer ${this.apiKey}`},body:n});return await this.getParsedResponse(i)}catch(i){let u=`Failed to push. ${i.message}`;throw i instanceof c?new c(u,i.status):new Error(u)}}async getRemotesList({organizationId:e,projectId:t,mountPath:r}){try{let s=await this.client.request(`${this.domain}/api/orgs/${e}/projects/${t}/remotes?filter=mountPath:/${r}/`,{timeout:p,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`}});return await this.getParsedResponse(s)}catch(s){let n=`Failed to get remote list. ${s.message}`;throw s instanceof c?new c(n,s.status):new Error(n)}}async getPush({organizationId:e,projectId:t,pushId:r}){try{let s=await this.client.request(`${this.domain}/api/orgs/${e}/projects/${t}/pushes/${r}`,{timeout:p,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`}});return await this.getParsedResponse(s)}catch(s){let n=`Failed to get push status. ${s.message}`;throw s instanceof c?new c(n,s.status):new Error(n)}}},$=class{apiClient;command;remotes;constructor({domain:e,apiKey:t,command:r}){this.command=r,this.apiClient=new h(this.command),this.remotes=new v(this.apiClient,e,t)}reportSunsetWarnings(){let e=this.apiClient.sunsetWarnings;if(e.length){let[{isSunsetExpired:t,sunsetDate:r}]=e.sort((n,i)=>n.isSunsetExpired!==i.isSunsetExpired?n.isSunsetExpired?-1:1:n.sunsetDate>i.sunsetDate?1:-1),s='Update to the latest version by running "npm install @redocly/cli@latest".';t?a.error(`The "${this.command}" command is not compatible with your version of Redocly CLI. ${s}
7
+ import{a as O}from"./RS5PUOTT.js";import{a as I}from"./BXI4SF2U.js";import{c as p}from"./P26PQ2RU.js";import{a as R}from"./AYXBQ5ZL.js";import{G as T,I as w,O as a}from"./C65SIVY5.js";import{e as C}from"./RFWIIJFG.js";import{Buffer as P}from"node:buffer";import y from"node:crypto";import{mkdirSync as j,existsSync as F,writeFileSync as q,readFileSync as z,rmSync as M}from"node:fs";import{homedir as H}from"node:os";import B from"node:path";var l={us:"https://app.cloud.redocly.com",eu:"https://app.cloud.eu.redocly.com"};function G(){return process.env.REDOCLY_DOMAIN||l.us}var U=D((o,e)=>{try{let t=e||o?.resolvedConfig.residency;return W(t)?l[t]:t?new URL(t).origin:o?.resolvedConfig.scorecard?.fromProjectUrl?new URL(o.resolvedConfig.scorecard.fromProjectUrl).origin:l.us}catch{throw new f}});function x(o){try{U(void 0,o)}catch{return!1}return!0}function D(o){return(...e)=>{let t=o(...e);if(!t.startsWith("https://"))throw new f;return t}}var f=class extends Error{constructor(){super("Invalid Reunite URL")}};function W(o){return typeof o=="string"&&o in l}import*as k from"node:child_process";var g=C(I(),1);var N=C(O(),1);function b(){return process.env.HTTPS_PROXY||process.env.HTTP_PROXY||process.env.http_proxy||process.env.https_proxy}function S(o){let e=process.env.NO_PROXY||process.env.no_proxy;if(!e)return!1;let t=e.split(",").map(s=>s.trim().toLowerCase()).filter(Boolean);if(t.length===0)return!1;let r;try{r=new URL(o).hostname.toLowerCase()}catch{return!1}return t.some(s=>!!(s==="*"||r===s||s.startsWith(".")&&r.endsWith(s)||!s.startsWith(".")&&r.endsWith("."+s)))}var _=async(o,{timeout:e,...t}={})=>{let r=b(),s=r&&!S(o),n,i=e?{connect:{timeout:e}}:{};return s?n=new g.ProxyAgent({uri:r,...i}):e&&(n=new g.Agent(i)),await fetch(o,{signal:e?AbortSignal.timeout(e):void 0,...t,dispatcher:n})};var c=class extends Error{constructor(t,r){super(t);this.status=r}status},h=class{constructor(e){this.command=e}command;sunsetWarnings=[];async request(e,t){let r={...t.headers,"user-agent":`redocly-cli/${R} ${this.command}`};try{let s=await _(e,{...t,headers:r});return this.collectSunsetWarning(s),s}catch(s){let n="Failed to fetch.";throw s.cause&&(n+=` Caused by ${s.cause.message||s.cause.name}.`),(s.code||s.cause?.code)&&(n+=` Code: ${s.code||s.cause?.code}`),new Error(n)}}collectSunsetWarning(e){let t=this.getSunsetDate(e);if(!t)return;let r=new Date(t);t>Date.now()?this.sunsetWarnings.push({sunsetDate:r,isSunsetExpired:!1}):this.sunsetWarnings.push({sunsetDate:r,isSunsetExpired:!0})}getSunsetDate(e){let{headers:t}=e;if(!t)return;let r=t.get("sunset")||t.get("Sunset");if(r)return Date.parse(r)}},v=class{constructor(e,t,r){this.client=e;this.domain=t;this.apiKey=r}client;domain;apiKey;async getParsedResponse(e){let t=await e.json();if(e.ok)return t;throw new c(`${t.title||e.statusText||"Unknown error"}.`,e.status)}async getDefaultBranch(e,t){try{let r=await this.client.request(`${this.domain}/api/orgs/${e}/projects/${t}/source`,{timeout:p,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`}});return(await this.getParsedResponse(r)).branchName}catch(r){let s=`Failed to fetch default branch. ${r.message}`;throw r instanceof c?new c(s,r.status):new Error(s)}}async upsert(e,t,r){try{let s=await this.client.request(`${this.domain}/api/orgs/${e}/projects/${t}/remotes`,{timeout:p,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({mountPath:r.mountPath,mountBranchName:r.mountBranchName,type:"CICD",autoMerge:!0})});return await this.getParsedResponse(s)}catch(s){let n=`Failed to upsert remote. ${s.message}`;throw s instanceof c?new c(n,s.status):new Error(n)}}async push(e,t,r,s){let n=new globalThis.FormData;n.append("remoteId",r.remoteId),n.append("commit[message]",r.commit.message),n.append("commit[author][name]",r.commit.author.name),n.append("commit[author][email]",r.commit.author.email),n.append("commit[branchName]",r.commit.branchName),r.commit.url&&n.append("commit[url]",r.commit.url),r.commit.namespace&&n.append("commit[namespaceId]",r.commit.namespace),r.commit.sha&&n.append("commit[sha]",r.commit.sha),r.commit.repository&&n.append("commit[repositoryId]",r.commit.repository),r.commit.createdAt&&n.append("commit[createdAt]",r.commit.createdAt);for(let i of s){let u=Buffer.isBuffer(i.stream)?new Blob([i.stream]):new Blob([await L(i.stream)]);n.append(`files[${i.path}]`,u,i.path)}r.isMainBranch&&n.append("isMainBranch","true");try{let i=await this.client.request(`${this.domain}/api/orgs/${e}/projects/${t}/pushes`,{method:"POST",headers:{Authorization:`Bearer ${this.apiKey}`},body:n});return await this.getParsedResponse(i)}catch(i){let u=`Failed to push. ${i.message}`;throw i instanceof c?new c(u,i.status):new Error(u)}}async getRemotesList({organizationId:e,projectId:t,mountPath:r}){try{let s=await this.client.request(`${this.domain}/api/orgs/${e}/projects/${t}/remotes?filter=mountPath:/${r}/`,{timeout:p,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`}});return await this.getParsedResponse(s)}catch(s){let n=`Failed to get remote list. ${s.message}`;throw s instanceof c?new c(n,s.status):new Error(n)}}async getPush({organizationId:e,projectId:t,pushId:r}){try{let s=await this.client.request(`${this.domain}/api/orgs/${e}/projects/${t}/pushes/${r}`,{timeout:p,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`}});return await this.getParsedResponse(s)}catch(s){let n=`Failed to get push status. ${s.message}`;throw s instanceof c?new c(n,s.status):new Error(n)}}},$=class{apiClient;command;remotes;constructor({domain:e,apiKey:t,command:r}){this.command=r,this.apiClient=new h(this.command),this.remotes=new v(this.apiClient,e,t)}reportSunsetWarnings(){let e=this.apiClient.sunsetWarnings;if(e.length){let[{isSunsetExpired:t,sunsetDate:r}]=e.sort((n,i)=>n.isSunsetExpired!==i.isSunsetExpired?n.isSunsetExpired?-1:1:n.sunsetDate>i.sunsetDate?1:-1),s='Update to the latest version by running "npm install @redocly/cli@latest".';t?a.error(`The "${this.command}" command is not compatible with your version of Redocly CLI. ${s}
8
8
 
9
9
  `):a.warn(`The "${this.command}" command will be incompatible with your version of Redocly CLI after ${r.toLocaleString()}. ${s}
10
10
 
@@ -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{c as ce}from"./QZAA7G5W.js";import{a as le}from"./RF73X3WC.js";import{a as Ie,b as Me}from"./ZLT4SN3P.js";import{a as Oe}from"./ZGQWJITG.js";import{a as fe}from"./WZXA5XPB.js";import{a as ke,b as je,c as $e,d as De,e as Ne,f as Ke,g as Be,h as qe,i as Le,j as Pe,k as Ue}from"./OAHVR5VG.js";import"./RFWIIJFG.js";function pe(e){return e}async function V(e){return typeof e=="function"?await e():e}function me(e){let t="";for(let n of new TextEncoder().encode(e))t+=String.fromCharCode(n);return btoa(t)}function ye(e,t){return e.kind==="apiKey"?t.auth?.apiKey?.[e.scheme]!==void 0:e.kind==="bearer"?t.auth?.bearer!==void 0:t.auth?.basic!==void 0}async function Q(e,t){let n=e.find(d=>d.every(a=>ye(a,t)))??e[0]??[],o={},r={},s=[];for(let d of n)if(d.kind==="apiKey"){let a=t.auth?.apiKey?.[d.scheme];if(a===void 0)continue;let c=await V(a);d.in==="header"?o[d.name]=c:d.in==="query"?r[d.name]=c:s.push(`${d.name}=${encodeURIComponent(c)}`)}else if(d.kind==="bearer"){let a=t.auth?.bearer;a!==void 0&&(o.Authorization=`Bearer ${await V(a)}`)}else{let a=t.auth?.basic;a!==void 0&&(o.Authorization=`Basic ${me(`${a.username}:${a.password}`)}`)}return s.length>0&&(o.Cookie=s.join("; ")),{headers:o,query:r}}var R=class extends Error{url;status;statusText;body;constructor(t,n,o,r){super(`Request failed with status ${n}`),this.name="ApiError",this.url=t,this.status=n,this.statusText=o,this.body=r}},O=class extends Error{operationId;timeout;attempt;constructor(t,n,o){super(`Request "${t}" timed out after ${n} ms (attempt ${o})`),this.name="TimeoutError",this.operationId=t,this.timeout=n,this.attempt=o}};function j(e){let t=e.reason;return t instanceof Error?t:new DOMException("The operation was aborted.","AbortError")}async function P(e,t){if(t==="void"){if(e.status===204||e.status===205||e.status===304||!(e.headers.get("content-type")??"").toLowerCase().includes("json"))return;let s=await e.text().catch(()=>"");if(s==="")return;try{return JSON.parse(s)}catch{return}}if(e.status===204)return;if(t==="stream")return e.body;if(t==="blob")return e.blob();if(t==="arrayBuffer")return e.arrayBuffer();if(t==="formData")return e.formData();if(t==="text")return e.text();if(t==="json")return e.json();let n=(e.headers.get("content-type")??"").toLowerCase();if(n.includes("json"))return e.json();if(n.startsWith("text/"))return e.text();let o=await e.blob();return o.size>0?o:void 0}async function k(e){return(e.headers.get("content-type")??"").toLowerCase().includes("json")?e.json().catch(()=>{}):e.text().catch(()=>{})}var he=new Set(["GET","HEAD","PUT","DELETE","OPTIONS"]),we=new Set([408,429,500,502,503,504]);function U(e){return he.has(e.request.method.toUpperCase())||"Idempotency-Key"in e.request.headers||"idempotency-key"in e.request.headers?e.response===void 0||we.has(e.response.status):!1}function z(e,t,n){if(n){let s=Number(n);if(!Number.isNaN(s))return s*1e3;let d=Date.parse(n);if(!Number.isNaN(d))return Math.max(0,d-Date.now())}let o=e.retryDelay??1e3,r=e.retryStrategy==="fixed"?o:o*Math.pow(2,t-1);return e.jitter===!1?r:Math.random()*r}function $(e,t){return new Promise((n,o)=>{if(t?.aborted){o(j(t));return}let r=()=>{clearTimeout(s),o(j(t))},s=setTimeout(()=>{t&&t.removeEventListener("abort",r),n()},e);t&&t.addEventListener("abort",r,{once:!0})})}function I(e){if(e===void 0)return{};if(e instanceof Headers){let t={};return e.forEach((n,o)=>{t[o]=n}),t}return Array.isArray(e)?Object.fromEntries(e):e}function _(e){return[...e.onRequest||e.onResponse||e.onError?[{onRequest:e.onRequest,onResponse:e.onResponse,onError:e.onError}]:[],...e.middleware??[]]}async function D(e,t,n,o,r,s,d,a="application/json"){let{retry:c,timeout:f,idempotencyKey:u,...i}=o,l={...e.retry,...c},p=f??e.timeout,m=u??e.idempotencyKey,E=typeof e.headers=="function"?await e.headers():e.headers,S={Accept:a,...E,...I(i.headers)},B=(i.method??"GET").toUpperCase();m!==void 0&&m!==!1&&(B==="POST"||B==="PATCH")&&!("Idempotency-Key"in S)&&!("idempotency-key"in S)&&(S["Idempotency-Key"]=typeof m=="string"?m:typeof m=="function"?m():crypto.randomUUID()),typeof e.clientHeader=="string"&&typeof document>"u"&&!("X-Redocly-Client"in S)&&!("x-redocly-client"in S)&&(S["X-Redocly-Client"]=e.clientHeader);let y={url:n,method:i.method??"GET",headers:S,body:r,operation:t},T=_(e);for(let h of T)h.onRequest&&await h.onRequest(y);let A;if(y.body!==void 0){let h=y.body,w=h instanceof Blob||h instanceof ArrayBuffer||ArrayBuffer.isView(h),g=typeof FormData<"u"&&h instanceof FormData,L=h instanceof URLSearchParams;if(g||L||w||typeof h=="string")A=h;else if(s?.multipart===!0){if(!d.serializeMultipart)throw new Error("Multipart capability not wired: cannot serialize the request body");A=d.serializeMultipart(h)}else A=JSON.stringify(h),!("Content-Type"in y.headers)&&!("content-type"in y.headers)&&(y.headers["Content-Type"]=s?.contentType??"application/json")}let q=e.fetch??fetch,v=1+(l.retries??0),C=l.retryOn??U,x=i.signal??void 0,b=0;for(;;){if(b++,x?.aborted)throw j(x);let h=p?x?AbortSignal.any([x,AbortSignal.timeout(p)]):AbortSignal.timeout(p):x,w;try{w=await q(y.url,{...i,signal:h,method:y.method,headers:y.headers,body:A})}catch(g){if(b<v&&!x?.aborted&&await C({attempt:b,request:y,error:g})){await $(z(l,b,null),x);continue}throw p&&!x?.aborted&&g instanceof DOMException&&g.name==="TimeoutError"?new O(t.id,p,b):g}for(let g=T.length-1;g>=0;g--){let L=T[g].onResponse;if(L){let H=await L(w,y);H&&H!==w&&(await w.body?.cancel().catch(()=>{}),w=H)}}if(!w.ok&&b<v&&!x?.aborted&&await C({attempt:b,request:y,response:w})){let g=w.headers.get("retry-after");await w.body?.cancel().catch(()=>{}),await $(z(l,b,g),x);continue}return{response:w,context:y}}}function M(e){return encodeURIComponent(e).replace(/%(3A|2F|3F|23|5B|5D|40|21|24|26|27|28|29|2A|2B|2C|3B|3D)/g,t=>decodeURIComponent(t))}function X(e,t){return e.replace(/\{([^{}]+)\}/g,(n,o)=>{let r=t[o];if(r===void 0)throw new Error(`Missing path parameter "${o}"`);return encodeURIComponent(String(r))})}function Y(e,t,n,o){let r=e.length;for(;r>0&&e.charCodeAt(r-1)===47;)r--;let s=e.slice(0,r)+t;if(!n)return s;let d=new URLSearchParams,a=[];for(let[f,u]of Object.entries(n)){if(u==null)continue;let i=o?.[f];if(!i){if(Array.isArray(u))for(let l of u)l!=null&&d.append(f,String(l));else if(Object(u)===u)for(let[l,p]of Object.entries(u))p!=null&&d.append(`${f}[${l}]`,String(p));else d.append(f,String(u));continue}if(Array.isArray(u)){let l=u.filter(p=>p!=null).map(String);if(i.style==="form"&&i.explode)for(let p of l)i.allowReserved?a.push(`${f}=${M(p)}`):d.append(f,p);else{let p=i.style==="pipeDelimited"?"|":i.style==="spaceDelimited"?"%20":",",m=i.allowReserved?M:encodeURIComponent;a.push(`${encodeURIComponent(f)}=${l.map(m).join(p)}`)}}else if(Object(u)===u)for(let[l,p]of Object.entries(u))p!=null&&(i.allowReserved?a.push(`${f}[${l}]=${M(String(p))}`):d.append(`${f}[${l}]`,String(p)));else i.allowReserved?a.push(`${f}=${M(String(u))}`):d.append(f,String(u))}let c=[d.toString(),...a].filter(Boolean).join("&");return c?`${s}?${c}`:s}function te(e){return e==="text"?"text/*":e==="blob"||e==="arrayBuffer"||e==="stream"||e==="formData"?"*/*":"application/json"}function re(e){return e.responseKind==="void"||e.responseKind==="blob"||e.responseKind==="text"?e.responseKind:"auto"}function be(e,t){let n={},o=new Set;for(let r of e.params??[])r.in==="path"&&(o.add(r.name),n[r.name]=t[r.name]);for(let r of Object.keys(t))if(!(r==="params"||r==="body"||r==="headers"||r==="cookies")&&!o.has(r))throw new TypeError(`Unknown argument "${r}" for operation "${e.id}". Query parameters go under params: { \u2026 } and the request body under body; valid keys are params, body, headers, cookies`+(o.size>0?`, and the path parameters (${[...o].join(", ")}).`:"."));return{path:n,query:t.params,body:t.body,headers:t.headers,cookies:t.cookies}}function xe(e){let t;for(let n of e.params??[])n.in!=="query"||!(n.style!==void 0&&n.style!=="form"||n.explode===!1||n.allowReserved===!0)||(t??={},t[n.name]={style:n.style??"form",explode:n.explode??!0,allowReserved:n.allowReserved});return t}function ge(e){let t={};for(let[n,o]of Object.entries(e??{}))o!=null&&(t[n]=String(o));return t}async function G(e,t,n,o,r){let{path:s,query:d,body:a,headers:c,cookies:f}=be(t,n),u=t.security?.length&&r.resolveAuth?await r.resolveAuth(t.security,e):{headers:{},query:{}},i=Object.entries(f??{}).filter(([,E])=>E!=null).map(([E,S])=>`${E}=${encodeURIComponent(String(S))}`);i.length>0&&(u.headers.Cookie=[u.headers.Cookie,...i].filter(Boolean).join("; "));let l={...d,...u.query},p=Y(e.serverUrl??"",X(t.path,s),Object.keys(l).length>0?l:void 0,xe(t)),m={...o,method:t.method.toUpperCase(),headers:{...u.headers,...ge(c),...I(o.headers)}};return{url:p,init:m,body:a}}function Ee(e,t){if(e!==null){if(t==="number"){if(e.trim()==="")return;let n=Number(e);return Number.isFinite(n)?n:void 0}if(t==="boolean"){let n=e.trim().toLowerCase();return n==="true"?!0:n==="false"?!1:void 0}return e}}function ve(e,t){let n={};for(let o of t??[]){let r=Ee(e.headers.get(o.name),o.type);r!==void 0&&(n[o.key]=r)}return n}async function Re(e,t,n,o,r){let s=await G(e,t,n,o,r),d={id:t.id,path:t.path,tags:[...t.tags??[]]},{parseAs:a,envelope:c,...f}=s.init,u=a??re(t),{response:i,context:l}=await D(e,d,s.url,f,s.body,t.body,r,te(u));if(e.errorMode==="result")return i.ok?{data:await P(i,u),error:void 0,response:i}:{data:void 0,error:await k(i),response:i};if(!i.ok){let m=new R(l.url,i.status,i.statusText,await k(i));for(let E of _(e))E.onError&&(m=await E.onError(m,l));throw m}let p=await P(i,u);return c===!0?{data:p,headers:ve(i,t.responseHeaders),response:i}:p}function F(e,t){if(!e.paginate)throw new Error(`Pagination capability not wired: cannot iterate operation "${t.id}"`);return e.paginate}function Z(e,t){let n=(o,r)=>{if(!r||r.envelope===void 0)return e(o,r);let{envelope:s,...d}=r;return e(o,d)};return t.errorMode!=="result"?n:async(o,r)=>{let s=await n(o,r);if(!s.response.ok){let{response:d}=s;throw new R(d.url,d.status,d.statusText,s.error)}return s.data}}function ee(e,t,n){return async(o={},r={})=>{let s=await G(e,t,o,r,n),{parseAs:d,envelope:a,...c}=s.init,f=d??re(t),u={id:t.id,path:t.path,tags:[...t.tags??[]]},{response:i}=await D(e,u,s.url,c,s.body,t.body,n,te(f));if(!i.ok)throw new R(s.url,i.status,i.statusText,await k(i));return{page:await P(i,f),linkHeader:i.headers.get("link"),url:i.url===""?s.url:i.url}}}function ne(e,t={},n={}){let o=t,r={...o,middleware:[...o.middleware??[]]},s={};for(let[d,a]of Object.entries(e))if(a.responseKind==="sse"){let c=(f={},u={})=>{if(!n.sse)throw new Error(`SSE capability not wired: cannot stream operation "${a.id}"`);let i=n.sse;return(async function*(){let l={id:a.id,path:a.path,tags:[...a.tags??[]]};yield*i(r,l,async()=>{let m=await G(r,a,f,u,n);return{url:m.url,init:m.init,body:m.body}},a.sseDataKind??"text")})()};Object.defineProperty(c,"name",{value:d}),Object.defineProperty(c,"operationId",{value:a.id}),s[d]=c}else{let c=(u={},i={})=>Re(r,a,u,i,n);Object.defineProperty(c,"name",{value:d}),Object.defineProperty(c,"operationId",{value:a.id});let f=a.pagination;s[d]=f===void 0?c:f.style==="link"?Object.assign(c,{pages:(u,i)=>F(n,a).pagesByLink(ee(r,a,n),u,i),items:(u,i)=>F(n,a).itemsByLink(ee(r,a,n),f,u,i)}):Object.assign(c,{pages:(u,i)=>F(n,a).pages(Z(c,r),f,u,i),items:(u,i)=>F(n,a).items(Z(c,r),f,u,i)})}return s.configure=d=>{let{errorMode:a,auth:c,...f}=d;Object.assign(r,f),c&&(r.auth={...r.auth,...c,...c.apiKey?{apiKey:{...r.auth?.apiKey,...c.apiKey}}:{}})},s.use=(...d)=>{r.middleware=[...r.middleware??[],...d]},s.auth={bearer(d){r.auth={...r.auth,bearer:d}},basic(d,a){r.auth={...r.auth,basic:{username:d,password:a}}},apiKey(d,a){r.auth={...r.auth,apiKey:{...r.auth?.apiKey,[d]:a}}}},s}function oe(e){let t=new FormData,n=(o,r)=>{r!=null&&(r instanceof Blob||typeof r=="string"?t.append(o,r):r instanceof Date?t.append(o,r.toISOString()):Object(r)===r?t.append(o,JSON.stringify(r)):t.append(o,String(r)))};for(let[o,r]of Object.entries(e))if(Array.isArray(r))for(let s of r)n(o,s);else n(o,r);return t}function N(e,t){if(t==="")return e;if(!t.startsWith("/"))return;let n=e;for(let o of t.slice(1).split("/")){let r=o.replaceAll("~1","/").replaceAll("~0","~");if(Array.isArray(n)){if(!/^(0|[1-9]\d*)$/.test(r))return;n=n[Number(r)]}else if(Object(n)===n&&r in n)n=n[r];else return}return n}async function*J(e,t,n={},o){if(t.style==="cursor"){let r=n.params?.[t.param];for(;;){let s={...n.params};r!==void 0&&(s[t.param]=r);let d=await e({...n,params:s},o);if(yield d,t.hasMore!==void 0&&N(d,t.hasMore)===!1)return;let a=N(d,t.nextCursor);if(a==null||a==="")return;if(typeof a!="string"&&typeof a!="number")throw new Error(`Pagination cursor at ${t.nextCursor} is not a string or number`);if(a===r)throw new Error("Pagination did not advance: operation returned the same cursor twice");r=a}}else{if(t.style==="link")throw new Error("link-style pagination iterates via pagesByLink");{let r=n.params?.[t.param],s=t.style==="page"?1:0,a=r==null||r===""||Number.isNaN(Number(r))?s:Number(r),c;for(;;){let f=await e({...n,params:{...n.params,[t.param]:a}},o),u=N(f,t.items),i=Array.isArray(u)?JSON.stringify(u):void 0;if(i!==void 0&&i===c)throw new Error("Pagination did not advance: the operation returned the same page twice");if(yield f,!Array.isArray(u)||u.length===0)return;c=i,a+=t.style==="page"?1:u.length}}}}async function*ie(e,t,n,o){for await(let r of J(e,t,n,o)){let s=N(r,t.items);Array.isArray(s)&&(yield*s)}}function Se(e){if(e!==null)for(let t of e.split(/,\s*(?=<)/)){let n=/^\s*<([^>]*)>(.*)$/.exec(t);if(!n)continue;let o=/;\s*rel\s*=\s*"?([^";]+)"?/i.exec(n[2]);if(o&&o[1].split(/\s+/).includes("next"))return n[1]}}async function*W(e,t={},n){let o=t.params,r;for(;;){let{page:s,linkHeader:d,url:a}=await e({...t,params:o},n);yield s;let c=Se(d);if(c===void 0)return;let f=new URL(a,"http://relative.invalid"),u=new URL(c,f).toString();if(u===r||u===f.toString())throw new Error('Pagination did not advance: the Link rel="next" target repeats');r=u;let i={};for(let[l,p]of new URL(u).searchParams){let m=i[l];m===void 0?i[l]=p:Array.isArray(m)?m.push(p):i[l]=[m,p]}o={...t.params,...i}}}async function*ae(e,t,n,o){for await(let r of W(e,n,o)){let s=N(r,t.items);Array.isArray(s)&&(yield*s)}}var Ae=/(?:\r\n|\r|\n){2}/,K=class extends Error{};async function*de(e,t,n,o="text"){let r,s,d=0;for(;;){let{url:a,init:c,body:f}=await n(),{reconnect:u=!0,reconnectDelay:i,...l}=c,p=l.signal??void 0;if(p?.aborted)return;let m={Accept:"text/event-stream",...I(l.headers)},E=r===void 0?m:{...m,"Last-Event-ID":r};try{let{response:y}=await D(e,t,a,{...l,method:l.method??"GET",headers:E,timeout:0},f,void 0,{});if(!y.ok){let C=await k(y);throw new R(a,y.status,y.statusText,C)}d=0;let T=y.body;if(!T)return;let A=T.getReader(),q=new TextDecoder,v="";try{for(;;){let{done:C,value:x}=await A.read();v+=C?q.decode():q.decode(x,{stream:!0});let b;for(;(b=Ae.exec(v))!==null;){let h=v.slice(0,b.index);v=v.slice(b.index+b[0].length);let w=se(h,o);w&&(w.id!==void 0&&(r=w.id),w.retry!==void 0&&(s=w.retry),yield w)}if(C){let h=v.length>0?se(v,o):void 0;h&&(h.id!==void 0&&(r=h.id),h.retry!==void 0&&(s=h.retry),yield h);return}if(v.length>1048576)throw new K("SSE frame exceeded 1048576 characters without a delimiter")}}finally{await A.cancel().catch(()=>{})}}catch(y){if(p?.aborted)return;if(y instanceof R||y instanceof K||!u)throw y}d++;let B=Math.min((s??i??1e3)*Math.pow(2,d-1),3e4);try{await $(Math.random()*B,p)}catch{return}}}function se(e,t){let n,o=[],r,s,d=!1;for(let f of e.split(/\r\n|\n|\r/)){if(f===""||f.startsWith(":"))continue;let u=f.indexOf(":"),i=u===-1?f:f.slice(0,u),l=u===-1?"":f.slice(u+1);l.startsWith(" ")&&(l=l.slice(1)),d=!0,i==="event"?n=l:i==="data"?o.push(l):i==="id"?r=l:i==="retry"&&/^\d+$/.test(l)&&(s=Number(l))}if(!d)return;let a=o.join(`
8
- `),c=a;if(t==="json"&&a!=="")try{c=JSON.parse(a)}catch(f){throw new K(`Failed to parse SSE event data as JSON: ${f instanceof Error?f.message:String(f)}`)}return{event:n,data:c,id:r,retry:s}}function ue(e,t={}){return{...e?.config,...t,middleware:[...e?.middleware??[],...t.middleware??[]]}}function Ce(e,t){return ne(e,t,{serializeMultipart:oe,resolveAuth:Q,sse:de,paginate:{pages:J,items:ie,pagesByLink:W,itemsByLink:ae}})}function Te(e,t){let n={...e};for(let[o,r]of Object.entries(t))r!==void 0&&(n[o]=r);return n}function Et(e){return e}async function St(e){return(await import("./5GW2PIPF.js")).generateClient(e)}export{Me as AUTHORING_HELPER_NAMES,R as ApiError,le as GENERATOR_VERSION,fe as NotSupportedError,Oe as Printer,je as RESERVED_WORDS,O as TimeoutError,ke as casing,Ce as createClient,U as defaultRetryOn,pe as defineClientSetup,Et as defineGenerator,Ne as discriminatorCases,Le as docText,qe as enumValues,De as flattenAllOf,St as generateClient,Ue as headerCoerceType,$e as identifierFor,Ke as isNullable,Te as mergeConfig,ue as mergeSetup,Ie as paginationRuleFor,ce as runCli,Pe as schemaAtPointer,Be as unwrapNullable};
7
+ import{c as ce}from"./2VVGA7JY.js";import{a as le}from"./BDIXGM4J.js";import{a as Ie,b as Me}from"./ZLT4SN3P.js";import{a as Oe}from"./ZGQWJITG.js";import{a as fe}from"./WZXA5XPB.js";import{a as ke,b as je,c as $e,d as De,e as Ne,f as Ke,g as Be,h as qe,i as Le,j as Pe,k as Ue}from"./OAHVR5VG.js";import"./RFWIIJFG.js";function pe(e){return e}async function V(e){return typeof e=="function"?await e():e}function me(e){let t="";for(let n of new TextEncoder().encode(e))t+=String.fromCharCode(n);return btoa(t)}function ye(e,t){return e.kind==="apiKey"?t.auth?.apiKey?.[e.scheme]!==void 0:e.kind==="bearer"?t.auth?.bearer!==void 0:t.auth?.basic!==void 0}async function Q(e,t){let n=e.find(d=>d.every(a=>ye(a,t)))??e[0]??[],o={},r={},s=[];for(let d of n)if(d.kind==="apiKey"){let a=t.auth?.apiKey?.[d.scheme];if(a===void 0)continue;let c=await V(a);d.in==="header"?o[d.name]=c:d.in==="query"?r[d.name]=c:s.push(`${d.name}=${encodeURIComponent(c)}`)}else if(d.kind==="bearer"){let a=t.auth?.bearer;a!==void 0&&(o.Authorization=`Bearer ${await V(a)}`)}else{let a=t.auth?.basic;a!==void 0&&(o.Authorization=`Basic ${me(`${a.username}:${a.password}`)}`)}return s.length>0&&(o.Cookie=s.join("; ")),{headers:o,query:r}}var R=class extends Error{url;status;statusText;body;constructor(t,n,o,r){super(`Request failed with status ${n}`),this.name="ApiError",this.url=t,this.status=n,this.statusText=o,this.body=r}},O=class extends Error{operationId;timeout;attempt;constructor(t,n,o){super(`Request "${t}" timed out after ${n} ms (attempt ${o})`),this.name="TimeoutError",this.operationId=t,this.timeout=n,this.attempt=o}};function j(e){let t=e.reason;return t instanceof Error?t:new DOMException("The operation was aborted.","AbortError")}async function P(e,t){if(t==="void"){if(e.status===204||e.status===205||e.status===304||!(e.headers.get("content-type")??"").toLowerCase().includes("json"))return;let s=await e.text().catch(()=>"");if(s==="")return;try{return JSON.parse(s)}catch{return}}if(e.status===204)return;if(t==="stream")return e.body;if(t==="blob")return e.blob();if(t==="arrayBuffer")return e.arrayBuffer();if(t==="formData")return e.formData();if(t==="text")return e.text();if(t==="json")return e.json();let n=(e.headers.get("content-type")??"").toLowerCase();if(n.includes("json"))return e.json();if(n.startsWith("text/"))return e.text();let o=await e.blob();return o.size>0?o:void 0}async function k(e){return(e.headers.get("content-type")??"").toLowerCase().includes("json")?e.json().catch(()=>{}):e.text().catch(()=>{})}var he=new Set(["GET","HEAD","PUT","DELETE","OPTIONS"]),we=new Set([408,429,500,502,503,504]);function U(e){return he.has(e.request.method.toUpperCase())||"Idempotency-Key"in e.request.headers||"idempotency-key"in e.request.headers?e.response===void 0||we.has(e.response.status):!1}function z(e,t,n){if(n){let s=Number(n);if(!Number.isNaN(s))return s*1e3;let d=Date.parse(n);if(!Number.isNaN(d))return Math.max(0,d-Date.now())}let o=e.retryDelay??1e3,r=e.retryStrategy==="fixed"?o:o*Math.pow(2,t-1);return e.jitter===!1?r:Math.random()*r}function $(e,t){return new Promise((n,o)=>{if(t?.aborted){o(j(t));return}let r=()=>{clearTimeout(s),o(j(t))},s=setTimeout(()=>{t&&t.removeEventListener("abort",r),n()},e);t&&t.addEventListener("abort",r,{once:!0})})}function I(e){if(e===void 0)return{};if(e instanceof Headers){let t={};return e.forEach((n,o)=>{t[o]=n}),t}return Array.isArray(e)?Object.fromEntries(e):e}function _(e){return[...e.onRequest||e.onResponse||e.onError?[{onRequest:e.onRequest,onResponse:e.onResponse,onError:e.onError}]:[],...e.middleware??[]]}async function D(e,t,n,o,r,s,d,a="application/json"){let{retry:c,timeout:f,idempotencyKey:u,...i}=o,l={...e.retry,...c},p=f??e.timeout,m=u??e.idempotencyKey,E=typeof e.headers=="function"?await e.headers():e.headers,S={Accept:a,...E,...I(i.headers)},B=(i.method??"GET").toUpperCase();m!==void 0&&m!==!1&&(B==="POST"||B==="PATCH")&&!("Idempotency-Key"in S)&&!("idempotency-key"in S)&&(S["Idempotency-Key"]=typeof m=="string"?m:typeof m=="function"?m():crypto.randomUUID()),typeof e.clientHeader=="string"&&typeof document>"u"&&!("X-Redocly-Client"in S)&&!("x-redocly-client"in S)&&(S["X-Redocly-Client"]=e.clientHeader);let y={url:n,method:i.method??"GET",headers:S,body:r,operation:t},T=_(e);for(let h of T)h.onRequest&&await h.onRequest(y);let A;if(y.body!==void 0){let h=y.body,w=h instanceof Blob||h instanceof ArrayBuffer||ArrayBuffer.isView(h),g=typeof FormData<"u"&&h instanceof FormData,L=h instanceof URLSearchParams;if(g||L||w||typeof h=="string")A=h;else if(s?.multipart===!0){if(!d.serializeMultipart)throw new Error("Multipart capability not wired: cannot serialize the request body");A=d.serializeMultipart(h)}else A=JSON.stringify(h),!("Content-Type"in y.headers)&&!("content-type"in y.headers)&&(y.headers["Content-Type"]=s?.contentType??"application/json")}let q=e.fetch??fetch,v=1+(l.retries??0),C=l.retryOn??U,x=i.signal??void 0,b=0;for(;;){if(b++,x?.aborted)throw j(x);let h=p?x?AbortSignal.any([x,AbortSignal.timeout(p)]):AbortSignal.timeout(p):x,w;try{w=await q(y.url,{...i,signal:h,method:y.method,headers:y.headers,body:A})}catch(g){if(b<v&&!x?.aborted&&await C({attempt:b,request:y,error:g})){await $(z(l,b,null),x);continue}throw p&&!x?.aborted&&g instanceof DOMException&&g.name==="TimeoutError"?new O(t.id,p,b):g}for(let g=T.length-1;g>=0;g--){let L=T[g].onResponse;if(L){let H=await L(w,y);H&&H!==w&&(await w.body?.cancel().catch(()=>{}),w=H)}}if(!w.ok&&b<v&&!x?.aborted&&await C({attempt:b,request:y,response:w})){let g=w.headers.get("retry-after");await w.body?.cancel().catch(()=>{}),await $(z(l,b,g),x);continue}return{response:w,context:y}}}function M(e){return encodeURIComponent(e).replace(/%(3A|2F|3F|23|5B|5D|40|21|24|26|27|28|29|2A|2B|2C|3B|3D)/g,t=>decodeURIComponent(t))}function X(e,t){return e.replace(/\{([^{}]+)\}/g,(n,o)=>{let r=t[o];if(r===void 0)throw new Error(`Missing path parameter "${o}"`);return encodeURIComponent(String(r))})}function Y(e,t,n,o){let r=e.length;for(;r>0&&e.charCodeAt(r-1)===47;)r--;let s=e.slice(0,r)+t;if(!n)return s;let d=new URLSearchParams,a=[];for(let[f,u]of Object.entries(n)){if(u==null)continue;let i=o?.[f];if(!i){if(Array.isArray(u))for(let l of u)l!=null&&d.append(f,String(l));else if(Object(u)===u)for(let[l,p]of Object.entries(u))p!=null&&d.append(`${f}[${l}]`,String(p));else d.append(f,String(u));continue}if(Array.isArray(u)){let l=u.filter(p=>p!=null).map(String);if(i.style==="form"&&i.explode)for(let p of l)i.allowReserved?a.push(`${f}=${M(p)}`):d.append(f,p);else{let p=i.style==="pipeDelimited"?"|":i.style==="spaceDelimited"?"%20":",",m=i.allowReserved?M:encodeURIComponent;a.push(`${encodeURIComponent(f)}=${l.map(m).join(p)}`)}}else if(Object(u)===u)for(let[l,p]of Object.entries(u))p!=null&&(i.allowReserved?a.push(`${f}[${l}]=${M(String(p))}`):d.append(`${f}[${l}]`,String(p)));else i.allowReserved?a.push(`${f}=${M(String(u))}`):d.append(f,String(u))}let c=[d.toString(),...a].filter(Boolean).join("&");return c?`${s}?${c}`:s}function te(e){return e==="text"?"text/*":e==="blob"||e==="arrayBuffer"||e==="stream"||e==="formData"?"*/*":"application/json"}function re(e){return e.responseKind==="void"||e.responseKind==="blob"||e.responseKind==="text"?e.responseKind:"auto"}function be(e,t){let n={},o=new Set;for(let r of e.params??[])r.in==="path"&&(o.add(r.name),n[r.name]=t[r.name]);for(let r of Object.keys(t))if(!(r==="params"||r==="body"||r==="headers"||r==="cookies")&&!o.has(r))throw new TypeError(`Unknown argument "${r}" for operation "${e.id}". Query parameters go under params: { \u2026 } and the request body under body; valid keys are params, body, headers, cookies`+(o.size>0?`, and the path parameters (${[...o].join(", ")}).`:"."));return{path:n,query:t.params,body:t.body,headers:t.headers,cookies:t.cookies}}function xe(e){let t;for(let n of e.params??[])n.in!=="query"||!(n.style!==void 0&&n.style!=="form"||n.explode===!1||n.allowReserved===!0)||(t??={},t[n.name]={style:n.style??"form",explode:n.explode??!0,allowReserved:n.allowReserved});return t}function ge(e){let t={};for(let[n,o]of Object.entries(e??{}))o!=null&&(t[n]=String(o));return t}async function G(e,t,n,o,r){let{path:s,query:d,body:a,headers:c,cookies:f}=be(t,n),u=t.security?.length&&r.resolveAuth?await r.resolveAuth(t.security,e):{headers:{},query:{}},i=Object.entries(f??{}).filter(([,E])=>E!=null).map(([E,S])=>`${E}=${encodeURIComponent(String(S))}`);i.length>0&&(u.headers.Cookie=[u.headers.Cookie,...i].filter(Boolean).join("; "));let l={...d,...u.query},p=Y(e.serverUrl??"",X(t.path,s),Object.keys(l).length>0?l:void 0,xe(t)),m={...o,method:t.method.toUpperCase(),headers:{...u.headers,...ge(c),...I(o.headers)}};return{url:p,init:m,body:a}}function Ee(e,t){if(e!==null){if(t==="number"){if(e.trim()==="")return;let n=Number(e);return Number.isFinite(n)?n:void 0}if(t==="boolean"){let n=e.trim().toLowerCase();return n==="true"?!0:n==="false"?!1:void 0}return e}}function ve(e,t){let n={};for(let o of t??[]){let r=Ee(e.headers.get(o.name),o.type);r!==void 0&&(n[o.key]=r)}return n}async function Re(e,t,n,o,r){let s=await G(e,t,n,o,r),d={id:t.id,path:t.path,tags:[...t.tags??[]]},{parseAs:a,envelope:c,...f}=s.init,u=a??re(t),{response:i,context:l}=await D(e,d,s.url,f,s.body,t.body,r,te(u));if(e.errorMode==="result")return i.ok?{data:await P(i,u),error:void 0,response:i}:{data:void 0,error:await k(i),response:i};if(!i.ok){let m=new R(l.url,i.status,i.statusText,await k(i));for(let E of _(e))E.onError&&(m=await E.onError(m,l));throw m}let p=await P(i,u);return c===!0?{data:p,headers:ve(i,t.responseHeaders),response:i}:p}function F(e,t){if(!e.paginate)throw new Error(`Pagination capability not wired: cannot iterate operation "${t.id}"`);return e.paginate}function Z(e,t){let n=(o,r)=>{if(!r||r.envelope===void 0)return e(o,r);let{envelope:s,...d}=r;return e(o,d)};return t.errorMode!=="result"?n:async(o,r)=>{let s=await n(o,r);if(!s.response.ok){let{response:d}=s;throw new R(d.url,d.status,d.statusText,s.error)}return s.data}}function ee(e,t,n){return async(o={},r={})=>{let s=await G(e,t,o,r,n),{parseAs:d,envelope:a,...c}=s.init,f=d??re(t),u={id:t.id,path:t.path,tags:[...t.tags??[]]},{response:i}=await D(e,u,s.url,c,s.body,t.body,n,te(f));if(!i.ok)throw new R(s.url,i.status,i.statusText,await k(i));return{page:await P(i,f),linkHeader:i.headers.get("link"),url:i.url===""?s.url:i.url}}}function ne(e,t={},n={}){let o=t,r={...o,middleware:[...o.middleware??[]]},s={};for(let[d,a]of Object.entries(e))if(a.responseKind==="sse"){let c=(f={},u={})=>{if(!n.sse)throw new Error(`SSE capability not wired: cannot stream operation "${a.id}"`);let i=n.sse;return(async function*(){let l={id:a.id,path:a.path,tags:[...a.tags??[]]};yield*i(r,l,async()=>{let m=await G(r,a,f,u,n);return{url:m.url,init:m.init,body:m.body}},a.sseDataKind??"text")})()};Object.defineProperty(c,"name",{value:d}),Object.defineProperty(c,"operationId",{value:a.id}),s[d]=c}else{let c=(u={},i={})=>Re(r,a,u,i,n);Object.defineProperty(c,"name",{value:d}),Object.defineProperty(c,"operationId",{value:a.id});let f=a.pagination;s[d]=f===void 0?c:f.style==="link"?Object.assign(c,{pages:(u,i)=>F(n,a).pagesByLink(ee(r,a,n),u,i),items:(u,i)=>F(n,a).itemsByLink(ee(r,a,n),f,u,i)}):Object.assign(c,{pages:(u,i)=>F(n,a).pages(Z(c,r),f,u,i),items:(u,i)=>F(n,a).items(Z(c,r),f,u,i)})}return s.configure=d=>{let{errorMode:a,auth:c,...f}=d;Object.assign(r,f),c&&(r.auth={...r.auth,...c,...c.apiKey?{apiKey:{...r.auth?.apiKey,...c.apiKey}}:{}})},s.use=(...d)=>{r.middleware=[...r.middleware??[],...d]},s.auth={bearer(d){r.auth={...r.auth,bearer:d}},basic(d,a){r.auth={...r.auth,basic:{username:d,password:a}}},apiKey(d,a){r.auth={...r.auth,apiKey:{...r.auth?.apiKey,[d]:a}}}},s}function oe(e){let t=new FormData,n=(o,r)=>{r!=null&&(r instanceof Blob||typeof r=="string"?t.append(o,r):r instanceof Date?t.append(o,r.toISOString()):Object(r)===r?t.append(o,JSON.stringify(r)):t.append(o,String(r)))};for(let[o,r]of Object.entries(e))if(Array.isArray(r))for(let s of r)n(o,s);else n(o,r);return t}function N(e,t){if(t==="")return e;if(!t.startsWith("/"))return;let n=e;for(let o of t.slice(1).split("/")){let r=o.replaceAll("~1","/").replaceAll("~0","~");if(Array.isArray(n)){if(!/^(0|[1-9]\d*)$/.test(r))return;n=n[Number(r)]}else if(Object(n)===n&&r in n)n=n[r];else return}return n}async function*J(e,t,n={},o){if(t.style==="cursor"){let r=n.params?.[t.param];for(;;){let s={...n.params};r!==void 0&&(s[t.param]=r);let d=await e({...n,params:s},o);if(yield d,t.hasMore!==void 0&&N(d,t.hasMore)===!1)return;let a=N(d,t.nextCursor);if(a==null||a==="")return;if(typeof a!="string"&&typeof a!="number")throw new Error(`Pagination cursor at ${t.nextCursor} is not a string or number`);if(a===r)throw new Error("Pagination did not advance: operation returned the same cursor twice");r=a}}else{if(t.style==="link")throw new Error("link-style pagination iterates via pagesByLink");{let r=n.params?.[t.param],s=t.style==="page"?1:0,a=r==null||r===""||Number.isNaN(Number(r))?s:Number(r),c;for(;;){let f=await e({...n,params:{...n.params,[t.param]:a}},o),u=N(f,t.items),i=Array.isArray(u)?JSON.stringify(u):void 0;if(i!==void 0&&i===c)throw new Error("Pagination did not advance: the operation returned the same page twice");if(yield f,!Array.isArray(u)||u.length===0)return;c=i,a+=t.style==="page"?1:u.length}}}}async function*ie(e,t,n,o){for await(let r of J(e,t,n,o)){let s=N(r,t.items);Array.isArray(s)&&(yield*s)}}function Se(e){if(e!==null)for(let t of e.split(/,\s*(?=<)/)){let n=/^\s*<([^>]*)>(.*)$/.exec(t);if(!n)continue;let o=/;\s*rel\s*=\s*"?([^";]+)"?/i.exec(n[2]);if(o&&o[1].split(/\s+/).includes("next"))return n[1]}}async function*W(e,t={},n){let o=t.params,r;for(;;){let{page:s,linkHeader:d,url:a}=await e({...t,params:o},n);yield s;let c=Se(d);if(c===void 0)return;let f=new URL(a,"http://relative.invalid"),u=new URL(c,f).toString();if(u===r||u===f.toString())throw new Error('Pagination did not advance: the Link rel="next" target repeats');r=u;let i={};for(let[l,p]of new URL(u).searchParams){let m=i[l];m===void 0?i[l]=p:Array.isArray(m)?m.push(p):i[l]=[m,p]}o={...t.params,...i}}}async function*ae(e,t,n,o){for await(let r of W(e,n,o)){let s=N(r,t.items);Array.isArray(s)&&(yield*s)}}var Ae=/(?:\r\n|\r|\n){2}/,K=class extends Error{};async function*de(e,t,n,o="text"){let r,s,d=0;for(;;){let{url:a,init:c,body:f}=await n(),{reconnect:u=!0,reconnectDelay:i,...l}=c,p=l.signal??void 0;if(p?.aborted)return;let m={Accept:"text/event-stream",...I(l.headers)},E=r===void 0?m:{...m,"Last-Event-ID":r};try{let{response:y}=await D(e,t,a,{...l,method:l.method??"GET",headers:E,timeout:0},f,void 0,{});if(!y.ok){let C=await k(y);throw new R(a,y.status,y.statusText,C)}d=0;let T=y.body;if(!T)return;let A=T.getReader(),q=new TextDecoder,v="";try{for(;;){let{done:C,value:x}=await A.read();v+=C?q.decode():q.decode(x,{stream:!0});let b;for(;(b=Ae.exec(v))!==null;){let h=v.slice(0,b.index);v=v.slice(b.index+b[0].length);let w=se(h,o);w&&(w.id!==void 0&&(r=w.id),w.retry!==void 0&&(s=w.retry),yield w)}if(C){let h=v.length>0?se(v,o):void 0;h&&(h.id!==void 0&&(r=h.id),h.retry!==void 0&&(s=h.retry),yield h);return}if(v.length>1048576)throw new K("SSE frame exceeded 1048576 characters without a delimiter")}}finally{await A.cancel().catch(()=>{})}}catch(y){if(p?.aborted)return;if(y instanceof R||y instanceof K||!u)throw y}d++;let B=Math.min((s??i??1e3)*Math.pow(2,d-1),3e4);try{await $(Math.random()*B,p)}catch{return}}}function se(e,t){let n,o=[],r,s,d=!1;for(let f of e.split(/\r\n|\n|\r/)){if(f===""||f.startsWith(":"))continue;let u=f.indexOf(":"),i=u===-1?f:f.slice(0,u),l=u===-1?"":f.slice(u+1);l.startsWith(" ")&&(l=l.slice(1)),d=!0,i==="event"?n=l:i==="data"?o.push(l):i==="id"?r=l:i==="retry"&&/^\d+$/.test(l)&&(s=Number(l))}if(!d)return;let a=o.join(`
8
+ `),c=a;if(t==="json"&&a!=="")try{c=JSON.parse(a)}catch(f){throw new K(`Failed to parse SSE event data as JSON: ${f instanceof Error?f.message:String(f)}`)}return{event:n,data:c,id:r,retry:s}}function ue(e,t={}){return{...e?.config,...t,middleware:[...e?.middleware??[],...t.middleware??[]]}}function Ce(e,t){return ne(e,t,{serializeMultipart:oe,resolveAuth:Q,sse:de,paginate:{pages:J,items:ie,pagesByLink:W,itemsByLink:ae}})}function Te(e,t){let n={...e};for(let[o,r]of Object.entries(t))r!==void 0&&(n[o]=r);return n}function Et(e){return e}async function St(e){return(await import("./FGZLHC6B.js")).generateClient(e)}export{Me as AUTHORING_HELPER_NAMES,R as ApiError,le as GENERATOR_VERSION,fe as NotSupportedError,Oe as Printer,je as RESERVED_WORDS,O as TimeoutError,ke as casing,Ce as createClient,U as defaultRetryOn,pe as defineClientSetup,Et as defineGenerator,Ne as discriminatorCases,Le as docText,qe as enumValues,De as flattenAllOf,St as generateClient,Ue as headerCoerceType,$e as identifierFor,Ke as isNullable,Te as mergeConfig,ue as mergeSetup,Ie as paginationRuleFor,ce as runCli,Pe as schemaAtPointer,Be as unwrapNullable};
@@ -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"./OBMFFMGK.js";import{b as g1}from"./3IIQ4P4P.js";import{a as tre,b as nre}from"./O6PRCLSV.js";import{a as ere}from"./RS5PUOTT.js";import"./32XCOMOR.js";import{d as Uz,e as Hz}from"./6ZLMHCAS.js";import{O as zv,k as Jne,s as p1,v as zz,w as $ne}from"./C65SIVY5.js";import"./NEWT5A6S.js";import{a as Fr,b as Bz,c as V,d as Kne,e as Bv,f as Zne}from"./RFWIIJFG.js";var Yz=V((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"./OBMFFMGK.js";import{b as g1}from"./3IIQ4P4P.js";import{a as tre,b as nre}from"./O6PRCLSV.js";import{a as ere}from"./RS5PUOTT.js";import"./32XCOMOR.js";import{d as Uz,e as Hz}from"./AYXBQ5ZL.js";import{O as zv,k as Jne,s as p1,v as zz,w as $ne}from"./C65SIVY5.js";import"./NEWT5A6S.js";import{a as Fr,b as Bz,c as V,d as Kne,e as Bv,f as Zne}from"./RFWIIJFG.js";var Yz=V((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)$/,H=/.$/,z=/(at|bl|iz)$/,$=new RegExp("([^aeiouylsz])\\1$"),U=new RegExp("^"+o+i+"[^aeiouwxy]$"),oe=/^(.+?[^aeiou])y$/,j=/^(.+?)(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=H,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=z,De=$,at=U,_e.test(ce)?ce=ce+"e":De.test(ce)?(ne=H,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=j,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=H,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 H=O[N],z=this.invertedIndex[H],$=z._index,k=0;k<c.fields.length;k++){var R=c.fields[k],U=z[R],oe=Object.keys(U),j=H+"/"+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[j]){for(var re=0;re<oe.length;re++){var fe=oe[re],he=new e.FieldRef(fe,R),Y=U[fe],le;(le=r[he])===void 0?r[he]=new e.MatchData(H,R,Y):le.add(H,R,Y)}o[j]=!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],H=T.metadata[N];this.invertedIndex[T][s][r][N]==null&&(this.invertedIndex[T][s][r][N]=[]),this.invertedIndex[T][s][r][N].push(H)}}}},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,H,z,$;i[k]===void 0?(H=e.idf(this.invertedIndex[k],this.documentCount),i[k]=H):H=i[k],z=H*((this._k1+1)*R)/(this._k1*(1-this._b+this._b*(l/this.averageFieldLength[a]))+R),z*=x,z*=T,$=Math.round(z*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=V((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=V((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=V(($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=V((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(),H())}function N(Se){setTimeout(function(){t.pageYOffset!=r.top&&(r.top=t.pageYOffset,H())},0)}function H(){for(var Se=n.length-1;Se>=0;Se--)z(n[Se])}function z(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 U(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"),z(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 j(){for(var Se=n.length-1;Se>=0;Se--)U(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(),j(),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);j()}}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?U(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=V(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=V(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=V(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=V(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=V(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=V(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=V(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=V(_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=V($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=V(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=V(_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=V(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(`