@redocly/cli 2.53.2 → 2.53.3

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 (87) hide show
  1. package/lib/chunks/{JA4LTWW3.js → 2HTEK7CB.js} +1 -1
  2. package/lib/chunks/{DQLEE5LL.js → 2LLR76SN.js} +1 -1
  3. package/lib/chunks/{7GYVSRCX.js → 4BHLSA4G.js} +1 -1
  4. package/lib/chunks/{LUCPX66E.js → 4RWMTNRF.js} +1 -1
  5. package/lib/chunks/{WV7XOOFD.js → 6NEJXWUE.js} +1 -1
  6. package/lib/chunks/{NPD4SXEI.js → 7V5AWKRU.js} +1 -1
  7. package/lib/chunks/{T226COGJ.js → BGOL5GAO.js} +1 -1
  8. package/lib/chunks/{WEAET3FR.js → BST7IEDL.js} +1 -1
  9. package/lib/chunks/{Q3LFOSXJ.js → C25ULQVR.js} +1 -1
  10. package/lib/chunks/{YLZS72LY.js → C4FLQ63T.js} +1 -1
  11. package/lib/chunks/{LGWICMQK.js → CPXI7K7L.js} +1 -1
  12. package/lib/chunks/{QJ4W6N5P.js → DFCB4ULY.js} +1 -1
  13. package/lib/chunks/{KQUR5LDF.js → EDS62CRZ.js} +1 -1
  14. package/lib/chunks/{NU76FSGR.js → GBTKUMLF.js} +1 -1
  15. package/lib/chunks/{R2EWSE4Z.js → J2VIXY4S.js} +1 -1
  16. package/lib/chunks/{RGJTOYYC.js → JT5UMLP2.js} +1 -1
  17. package/lib/chunks/{HY6IF56V.js → JXAKPU5V.js} +1 -1
  18. package/lib/chunks/{UZQGV3C7.js → MEVUBG5J.js} +1 -1
  19. package/lib/chunks/{53VK4LV5.js → MXEA2HJF.js} +1 -1
  20. package/lib/chunks/{HE2DJR6Y.js → NMVCH6CZ.js} +1 -1
  21. package/lib/chunks/{3BIPHQGZ.js → O6EXHS4S.js} +1 -1
  22. package/lib/chunks/{EFVXVP5M.js → PDTJPHOV.js} +1 -1
  23. package/lib/chunks/{BVF3GEBD.js → Q3XI4H3K.js} +1 -1
  24. package/lib/chunks/{ZBW2UTL4.js → QE555QD2.js} +1 -1
  25. package/lib/chunks/{FKRGYVXD.js → S7LWRM6M.js} +1 -1
  26. package/lib/chunks/{RD64AQAZ.js → T2XFX5KV.js} +1 -1
  27. package/lib/chunks/{I4EFNEXU.js → TOCY6E4B.js} +1 -1
  28. package/lib/chunks/{Z57CXIHX.js → TXEDXTQA.js} +1 -1
  29. package/lib/chunks/{SCWHIBJL.js → UF33MFZE.js} +1 -1
  30. package/lib/chunks/{SP5G6SN2.js → VH573B5Z.js} +1 -1
  31. package/lib/chunks/{4BCUUE3J.js → VL4UXBSF.js} +1 -1
  32. package/lib/chunks/{FPOO3NKZ.js → W3YACFG2.js} +1 -1
  33. package/lib/chunks/{BSAURQIG.js → XX6OZNQL.js} +1 -1
  34. package/lib/eject-assets/generators/cli/docs.ts +1 -1
  35. package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
  36. package/lib/eject-assets/generators/cli/index.ts +2 -2
  37. package/lib/eject-assets/generators/cli/render.ts +1 -1
  38. package/lib/eject-assets/generators/go/client.ts +1 -1
  39. package/lib/eject-assets/generators/go/descriptor.ts +1 -1
  40. package/lib/eject-assets/generators/go/index.ts +2 -2
  41. package/lib/eject-assets/generators/go/models.ts +1 -1
  42. package/lib/eject-assets/generators/go/naming.ts +1 -1
  43. package/lib/eject-assets/generators/go/operations.ts +1 -1
  44. package/lib/eject-assets/generators/go/pagination.ts +1 -1
  45. package/lib/eject-assets/generators/go/types.ts +1 -1
  46. package/lib/eject-assets/generators/mock/faker.ts +1 -1
  47. package/lib/eject-assets/generators/mock/index.ts +2 -2
  48. package/lib/eject-assets/generators/mock/render.ts +1 -1
  49. package/lib/eject-assets/generators/mock/sample.ts +1 -1
  50. package/lib/eject-assets/generators/mock/values.ts +1 -1
  51. package/lib/eject-assets/generators/php/client.ts +1 -1
  52. package/lib/eject-assets/generators/php/descriptor.ts +1 -1
  53. package/lib/eject-assets/generators/php/index.ts +2 -2
  54. package/lib/eject-assets/generators/php/models.ts +1 -1
  55. package/lib/eject-assets/generators/php/naming.ts +1 -1
  56. package/lib/eject-assets/generators/php/operations.ts +1 -1
  57. package/lib/eject-assets/generators/php/pagination.ts +1 -1
  58. package/lib/eject-assets/generators/php/types.ts +1 -1
  59. package/lib/eject-assets/generators/python/client.ts +1 -1
  60. package/lib/eject-assets/generators/python/descriptor.ts +1 -1
  61. package/lib/eject-assets/generators/python/index.ts +2 -2
  62. package/lib/eject-assets/generators/python/models.ts +1 -1
  63. package/lib/eject-assets/generators/python/naming.ts +1 -1
  64. package/lib/eject-assets/generators/python/operations.ts +1 -1
  65. package/lib/eject-assets/generators/python/pagination.ts +1 -1
  66. package/lib/eject-assets/generators/python/types.ts +1 -1
  67. package/lib/eject-assets/generators/swr/index.ts +2 -2
  68. package/lib/eject-assets/generators/swr/render.ts +1 -1
  69. package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
  70. package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
  71. package/lib/eject-assets/generators/transformers/index.ts +2 -2
  72. package/lib/eject-assets/generators/transformers/render.ts +1 -1
  73. package/lib/eject-assets/generators/typescript/banner.ts +1 -1
  74. package/lib/eject-assets/generators/typescript/client.ts +1 -1
  75. package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
  76. package/lib/eject-assets/generators/typescript/index.ts +2 -2
  77. package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
  78. package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
  79. package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
  80. package/lib/eject-assets/generators/typescript/operations.ts +1 -1
  81. package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
  82. package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
  83. package/lib/eject-assets/generators/typescript/types.ts +1 -1
  84. package/lib/eject-assets/generators/zod/index.ts +2 -2
  85. package/lib/eject-assets/generators/zod/schemas.ts +1 -1
  86. package/lib/index.js +8 -8
  87. package/package.json +1 -1
@@ -4,6 +4,6 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a}from"./FPOO3NKZ.js";import{W as p}from"./UWKKXZOE.js";function g(t,r){let n=t.services.flatMap(e=>e.operations),s=n.filter(e=>e.sse!==void 0);s.length>0&&p.warn(`generate-client: ${r} skipped ${s.length} server-sent-events operation(s) \u2014 iterate the sdk's exported async generators directly: ${s.map(e=>e.name).join(", ")}.
7
+ import{a}from"./W3YACFG2.js";import{W as p}from"./UWKKXZOE.js";function g(t,r){let n=t.services.flatMap(e=>e.operations),s=n.filter(e=>e.sse!==void 0);s.length>0&&p.warn(`generate-client: ${r} skipped ${s.length} server-sent-events operation(s) \u2014 iterate the sdk's exported async generators directly: ${s.map(e=>e.name).join(", ")}.
8
8
  `);let i=new Set(t.schemas.map(e=>e.name)),o=n.filter(e=>e.sse===void 0&&m(e,i));return o.length>0&&p.warn(`generate-client: ${r} skipped ${o.length} operation(s) whose variables type name collides with a schema \u2014 rename the schema or the operation: ${o.map(e=>e.name).join(", ")}.
9
9
  `),n.filter(e=>e.sse===void 0&&!m(e,i))}function m(t,r){let n=a(t);return n.hasInputs&&r.has(n.variablesTypeName)}function x(t){return t.method==="get"||t.method==="head"}function u(t){return a(t).hasInputs}function f(t){return a(t).variablesTypeName}function $(t,r,n){let s=[];return a(t).hasInputs?s.push(r):n&&s.push("{}"),n&&s.push("{ ...init, envelope: undefined }"),`${t.name}(${s.join(", ")})`}function v(t,r,n){let s=t.map(e=>e.name).sort(),i=t.filter(u).map(f).sort();return n&&i.push("RequestOptions"),`import { ${[...s,...i.map(e=>`type ${e}`)].join(", ")} } from ${JSON.stringify(r)};`}export{g as a,x as b,u as c,f as d,$ as e,v as f};
@@ -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{b as B}from"./2U6O26CV.js";import{b as X,c as E,d as T,e as W,f as ne,g as te,h as re}from"./RD64AQAZ.js";import{a as Y,c as C,d as p,e as w,f as x,g as D,h as O,i as Z,j,k as I,l as F,n as ee}from"./UW4UC7ZI.js";var U=C.php,q=class extends Y{constructor(){super(" ")}typeName(n){return p(n,{style:"pascal",reserved:U})}memberName(n){return p(n,{style:"camel",reserved:U})}identifier(n){return p(n,{style:"camel",reserved:U})}identifiers(n,s){return w(n,{style:"camel",reserved:U,taken:s})}string(n){return`'${n.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}literal(n){return n==null?"null":typeof n=="boolean"||typeof n=="number"?String(n):typeof n=="string"?this.string(n):Array.isArray(n)?`[${n.map(i=>this.literal(i)).join(", ")}]`:`[${Object.entries(n).map(([i,r])=>`${this.string(i)} => ${this.literal(r)}`).join(", ")}]`}comment(n){for(let s of F(n))this.line(s===""?"//":`// ${s}`);return this}doc(n,s,i=[]){let r=F(s);if(r.length===0&&i.length===0)return this;let t=r.length===0?n:`${n} \u2014 ${r.join(" ")}`;if(i.length===0)return this.line(`/** ${t} */`);this.line("/**"),this.line(` * ${t}`),this.line(" *");for(let a of i)this.line(` * ${a}`);return this.line(" */")}};var h=C.php,G=new q;function y(e){return G.typeName(e)}function b(e){return G.memberName(e)}function c(e){return G.string(e)}function ie(e){return p(e.name,{style:"camel",reserved:h})}function K(e){let n=e.services.flatMap(i=>i.operations),s=w(n.map(i=>i.name),{style:"camel",reserved:h});return new Map(n.map((i,r)=>[i.name,s[r]]))}function de(e){return ne(e).map(s=>s.kind==="literal"?c(s.value):`$${b(s.name)}`).join(" . ")}function se(e,n){let s=n.servers??[];if(s.length===0)return;let i=new Set;e.line("/** The declared servers; variables default to the values from the description. */"),e.line("final class Servers"),e.block("{",()=>{s.forEach((r,t)=>{let a=p(r.description??`server${t+1}`,{style:"camel",reserved:h});i.has(a)&&(a=`${a}${t+1}`),i.add(a);let o=r.variables.map(l=>`string $${b(l.name)} = ${c(l.default)}`);t>0&&e.blank(),e.line(`public static function ${a}(${o.join(", ")}): string`),e.block("{",()=>{e.line(`return ${de(r)};`)},"}")})},"}"),e.blank()}function ae(e,n){let s=te(e,n).map(i=>`[${i.map(t=>t.kind==="apiKey"?`['kind' => 'apiKey', 'scheme' => ${c(t.scheme)}, 'name' => ${c(t.name)}, 'in' => ${c(t.in)}]`:`['kind' => ${c(t.kind)}, 'scheme' => ${c(t.scheme)}]`).join(", ")}]`);if(s.length!==0)return`[${s.join(", ")}]`}function oe(e){return`[${[`'style' => ${c(e.style)}`,...e.param!==void 0?[`'param' => ${c(e.param)}`]:[],...e.nextCursor!==void 0?[`'nextCursor' => ${c(e.nextCursor)}`]:[],...e.hasMore!==void 0?[`'hasMore' => ${c(e.hasMore)}`]:[],...e.limitParam!==void 0?[`'limitParam' => ${c(e.limitParam)}`]:[],...e.items!==void 0?[`'items' => ${c(e.items)}`]:[]].join(", ")}]`}function ce(e,n){let s=new Set;return`[${(e.successResponseHeaders??[]).map(r=>{let t=p(r.name,{style:"camel",reserved:h}),a=2;for(;s.has(t);)t=`${p(r.name,{style:"camel",reserved:h})}_${a++}`;s.add(t);let o=ee(r.schema,n);return`[${c(r.name)}, ${c(t)}, ${c(o)}]`}).join(", ")}]`}function _(e,n){let s=n.schemas.find(t=>t.name===e);if(s===void 0)return"other";let i=s.schema,r=I(i);return r!==void 0&&(r.scalar==="string"||r.scalar==="integer")?"enum":(i.kind==="object"||i.kind==="intersection")&&D(i,n)!==void 0?"class":"other"}function m(e,n,s="string"){if(Z(e)){let i=m(j(e),n,s);return A(i)}switch(e.kind){case"scalar":return s==="Date"&&e.scalar==="string"&&L(e)?"\\DateTimeImmutable":{string:"string",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"array":case"record":return"array";case"ref":{let i=_(e.name,n);if(i==="class"||i==="enum")return y(e.name);let r=x(e,n);return r===void 0?"mixed":m(r,n,s)}case"enum":return{string:"string",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"literal":return typeof e.value=="string"?"string":typeof e.value=="boolean"?"bool":"float";case"omit":return y(e.base);case"union":return me(e.members,n,s);case"null":case"object":case"intersection":case"unknown":return"mixed"}}function L(e){let n=e.metadata?.format;return n==="date"||n==="date-time"}function A(e){return e==="mixed"||e.startsWith("?")||e.endsWith("|null")?e:e.includes("|")?`${e}|null`:`?${e}`}function me(e,n,s){let i=[];for(let r of e){if(r.kind==="null")continue;let t=m(r,n,s);if(t==="mixed")return"mixed";let a=t.startsWith("?")?t.slice(1):t;i.includes(a)||i.push(a),t.startsWith("?")&&!i.includes("null")&&i.push("null")}return i.length===0?"mixed":i.join("|")}function J(e,n,s){if(e===void 0)return;let i=j(e);if(i.kind==="ref"){let t=x(i,n);return _(i.name,n)==="other"?J(t,n,s):void 0}if(i.kind!=="array")return;let r=m(i.items,n,s);return r==="mixed"?void 0:r}function le(e,n){let s=n.schemas.find(i=>i.name===e);return s!==void 0&&O(s.schema,n)!==void 0}function v(e,n,s,i){let r=j(e);if(i==="Date"&&r.kind==="scalar"&&r.scalar==="string"&&L(r))return`new \\DateTimeImmutable(${n})`;if(r.kind==="omit")return v({kind:"ref",name:r.base},n,s,i);if(r.kind==="ref"){let t=_(r.name,s);if(t==="class")return`${y(r.name)}::fromArray(${n})`;if(t==="enum")return`${y(r.name)}::from(${n})`;if(le(r.name,s))return`unmarshal${y(r.name)}(${n})`;let a=x(r,s);return a===void 0?void 0:v(a,n,s,i)}if(r.kind==="array"){let t=v(r.items,"$item",s,i);return t===void 0?void 0:`array_map(static fn ($item) => ${t}, ${n})`}if(r.kind==="record"){let t=v(r.value,"$item",s,i);return t===void 0?void 0:`array_map(static fn ($item) => ${t}, ${n})`}}function N(e,n,s,i="string"){let r=j(e);if(i==="Date"&&r.kind==="scalar"&&r.scalar==="string"){if(r.metadata?.format==="date")return`${n}->format('Y-m-d')`;if(r.metadata?.format==="date-time")return`${n}->format(\\DateTimeInterface::ATOM)`}if(r.kind==="omit")return N({kind:"ref",name:r.base},n,s,i);if(r.kind==="ref"){let t=_(r.name,s);if(t==="class")return`${n}->toArray()`;if(t==="enum")return`${n}->value`;if(le(r.name,s))return`is_object(${n}) ? ${n}->toArray() : ${n}`;let a=x(r,s);return a===void 0?void 0:N(a,n,s,i)}if(r.kind==="array"||r.kind==="record"){let t=r.kind==="array"?r.items:r.value,a=N(t,"$item",s,i);return a===void 0?void 0:`array_map(static fn ($item) => ${a}, ${n})`}}function pe(e,n,s,i,r,t){let a=[...s.filter(o=>o.required),...s.filter(o=>!o.required)];e.doc(y(n),t),e.line(`final class ${y(n)}`),e.block("{",()=>{e.block("public function __construct(",()=>{for(let o of a){let l=m(o.schema,i,r);if(o.required)e.line(`public ${l} $${b(o.name)},`);else{let u=A(l);e.line(`public ${u} $${b(o.name)} = null,`)}}},") {"),e.line("}"),e.blank(),e.line("public static function fromArray(array $data): self"),e.block("{",()=>{e.block("return new self(",()=>{for(let o of a){let l=`$data[${c(o.name)}]`,u=v(o.schema,l,i,r),f=b(o.name);o.required?e.line(`${f}: ${u??l},`):u===void 0?e.line(`${f}: ${l} ?? null,`):e.line(`${f}: isset(${l}) ? ${u} : null,`)}},");")},"}"),e.blank(),e.line("public function toArray(): array"),e.block("{",()=>{e.line("$data = [];");for(let o of a){let l=`$this->${b(o.name)}`,u=N(o.schema,l,i,r)??l;o.required?e.line(`$data[${c(o.name)}] = ${u};`):e.block(`if (${l} !== null) {`,()=>{e.line(`$data[${c(o.name)}] = ${u};`)},"}")}e.line("return $data;")},"}")},"}"),e.blank()}function V(e,n="string"){let s=new q;for(let{name:i,schema:r}of e.schemas){let t=I(r);if(t!==void 0&&(t.scalar==="string"||t.scalar==="integer")){let o=t.scalar==="string"?"string":"int";s.doc(y(i),r.description),s.line(`enum ${y(i)}: ${o}`),s.block("{",()=>{let l=w(t.values.map(u=>String(u)),{style:"pascal",reserved:h});t.values.forEach((u,f)=>{let g=typeof u=="string"?c(u):String(u);s.line(`case ${l[f]} = ${g};`)})},"}"),s.blank();continue}if(r.kind==="object"||r.kind==="intersection"){let o=D(r,e);if(o!==void 0){pe(s,i,o.properties,e,n,o.description??r.description);continue}}let a=O(r,e);if(a!==void 0){let o=y(i),l=a.cases.map(u=>`${u.value} -> ${y(u.schemaName)}`).join(", ");s.line(`/** ${o} is a discriminated union (${c(a.property)}): ${l}. */`),s.line(`function unmarshal${o}(array $data): mixed`),s.block("{",()=>{s.block(`return match ($data[${c(a.property)}] ?? null) {`,()=>{for(let u of a.cases)s.line(`${c(u.value)} => ${y(u.schemaName)}::fromArray($data),`);s.line("default => $data,")},"};")},"}"),s.blank();continue}}return s.toString()}var ue=new Set(["post","put","patch"]),he=["body","headers","idempotencyKey"];function z(e,n,s,i){let r=w([...e.pathParams,...e.queryParams].map(l=>l.name),{style:"camel",reserved:h,taken:he}),t=e.pathParams.map((l,u)=>({php:r[u],wire:l.name,type:m(l.schema,n,i)})),a=e.queryParams.map((l,u)=>{let f=r[e.pathParams.length+u];return{php:f,wire:l.name,type:m(l.schema,n,i),value:N(l.schema,`$${f}`,n,i)??`$${f}`}}),o=[...t.map(({php:l,type:u})=>`${u} $${l}`),...s&&e.requestBody?[`${W(e)?"array":m(e.requestBody.schema,n,i)} $body`]:[],...a.map(({php:l,type:u})=>`${A(u)} $${l} = null`),"?array $headers = null",...s&&ue.has(e.method.toLowerCase())?["?string $idempotencyKey = null"]:[]];return{pathArgs:t,queryArgs:a,signature:o}}function ye(e,n,s){e.line(`$op = OPERATIONS[${c(n.specName??n.name)}];`),e.line("[$authHeaders, $query, $cookies] = resolveAuth($op['security'] ?? [], $this->config->auth);");for(let{php:r,wire:t,value:a}of s.queryArgs)e.block(`if ($${r} !== null) {`,()=>{e.line(`$query[${c(t)}] = ${a};`)},"}");let i=s.pathArgs.map(({php:r,wire:t})=>`${c(t)} => $${r}`).join(", ");e.line(`$url = buildUrl($this->config->serverUrl, $op['path'], [${i}]);`),e.line("$requestHeaders = array_merge($authHeaders, $headers ?? []);"),e.block("if ($cookies !== []) {",()=>{e.line("$requestHeaders['Cookie'] = implode('; ', $cookies);")},"}")}function Q(e,n,s,i,r,t=!1){let a=z(n,i,!0,r),o=T(n),l=E(n),u=o===void 0&&l===void 0&&n.successResponses.some(k=>k.contentType!==""),f=t?"Envelope":o!==void 0?"\\Generator":l!==void 0?m(l,i,r):u?"string":"void",g=t?`${s}WithHeaders`:s,H=t?void 0:J(l,i,r);e.doc(g,t?`Like ${s}(), returning an Envelope with the declared response headers.`:n.summary??`${n.method.toUpperCase()} ${n.path}`,H===void 0?[]:[`@return ${H}[]`]),e.line(`public function ${g}(${a.signature.join(", ")}): ${f}`),e.block("{",()=>{if(ye(e,n,a),o!==void 0){let d=o.schema!==void 0&&o.schema.kind!=="unknown";e.line("$url = appendQuery($url, $query);"),e.block("$open = function (array $extraHeaders) use ($url, $requestHeaders): \\CurlHandle {",()=>{e.line("$handle = curl_init($url);"),e.line("$lines = [];"),e.block("foreach (array_merge($requestHeaders, $extraHeaders) as $name => $value) {",()=>{e.line("$lines[] = $name . ': ' . $value;")},"}"),e.line("curl_setopt($handle, CURLOPT_HTTPHEADER, $lines);"),e.line("return $handle;")},"};"),e.line(`yield from iterSse($open, ${d?"true":"false"});`);return}let k=["'operationId' => $op['id']","'method' => $op['method']","'url' => $url","'headers' => $requestHeaders","'query' => $query"];if(n.requestBody&&W(n))e.line("[$contentType, $encoded] = toMultipart($body);"),k.push("'body' => $encoded","'contentType' => $contentType");else if(n.requestBody){let d=N(n.requestBody.schema,"$body",i,r)??"$body";e.line(`$payload = json_encode(${d});`),k.push("'body' => $payload",`'contentType' => ${c(n.requestBody.contentType)}`)}ue.has(n.method.toLowerCase())&&n.requestBody&&k.push("'idempotencyKey' => $idempotencyKey"),e.line(`$response = send($this->config, [${k.join(", ")}]);`),e.block("if ($response['status'] >= 400) {",()=>{e.line("throw apiErrorFrom($response);")},"}");let $=u?"$response['body']":(l===void 0?void 0:v(l,"decodeJson($response)",i,r))??"decodeJson($response)";if(t){e.line(`$data = ${$};`),e.line(`return new Envelope(data: $data, headers: readEnvelopeHeaders($response, ${ce(n,i)}), status: $response['status']);`);return}if(u){e.line("return $response['body'];");return}if(f==="void"){e.line("decodeJson($response);");return}e.line(`return ${$};`)},"}"),e.blank()}function $e(e,n,s,i,r,t,a,o,l){let u=z(n,i,!1,r),f=s,g=()=>{e.line(`$op = OPERATIONS[${c(n.specName??n.name)}];`),e.line("$base = [];");for(let{php:d,wire:P,value:S}of u.queryArgs)e.block(`if ($${d} !== null) {`,()=>{e.line(`$base[${c(P)}] = ${S};`)},"}");let $=u.pathArgs.map(({php:d,wire:P})=>`${c(P)} => $${d}`).join(", ");e.block("$call = function (array $params) use ($op, $headers): array {",()=>{e.line("[$authHeaders, $authQuery, $cookies] = resolveAuth($op['security'] ?? [], $this->config->auth);"),e.line(`$url = buildUrl($this->config->serverUrl, $op['path'], [${$}]);`),e.line("$requestHeaders = array_merge($authHeaders, $headers ?? []);"),e.block("if ($cookies !== []) {",()=>{e.line("$requestHeaders['Cookie'] = implode('; ', $cookies);")},"}"),e.line("$response = send($this->config, ['operationId' => $op['id'], 'method' => $op['method'], 'url' => $url, 'headers' => $requestHeaders, 'query' => array_merge($params, $authQuery)]);"),e.block("if ($response['status'] >= 400) {",()=>{e.line("throw apiErrorFrom($response);")},"}"),e.line("return [decodeJson($response), $response];")},"};")},H=m(E(n)??{kind:"unknown"},i,r),k=H==="mixed"?"mixed":H;e.line("/**"),e.line(` * ${f} response pages, following the pagination rule automatically.`),e.line(" *"),e.line(` * @return \\Generator<int, ${k}>`),e.line(" */"),e.line(`public function ${f}Pages(${u.signature.join(", ")}): \\Generator`),e.block("{",()=>{g(),e.block("foreach (iterPages($call, $op['pagination'], $base) as $page) {",()=>{e.line(`yield ${t??"$page"};`)},"}")},"}"),e.blank(),e.line("/**"),e.line(` * The items of every ${f} page.`),e.line(" *"),e.line(` * @return \\Generator<int, ${l}>`),e.line(" */"),e.line(`public function ${f}Items(${u.signature.join(", ")}): \\Generator`),e.block("{",()=>{g(),e.block("foreach (iterPages($call, $op['pagination'], $base) as $page) {",()=>{e.line(`$items = resolvePointer($page, ${c(o??"")});`),e.block("foreach (is_array($items) ? $items : [] as $item) {",()=>{e.line(`yield ${a??"$item"};`)},"}")},"}")},"}"),e.blank()}function ge(e){let n=e.split(`
7
+ import{b as B}from"./2U6O26CV.js";import{b as X,c as E,d as T,e as W,f as ne,g as te,h as re}from"./T2XFX5KV.js";import{a as Y,c as C,d as p,e as w,f as x,g as D,h as O,i as Z,j,k as I,l as F,n as ee}from"./UW4UC7ZI.js";var U=C.php,q=class extends Y{constructor(){super(" ")}typeName(n){return p(n,{style:"pascal",reserved:U})}memberName(n){return p(n,{style:"camel",reserved:U})}identifier(n){return p(n,{style:"camel",reserved:U})}identifiers(n,s){return w(n,{style:"camel",reserved:U,taken:s})}string(n){return`'${n.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}literal(n){return n==null?"null":typeof n=="boolean"||typeof n=="number"?String(n):typeof n=="string"?this.string(n):Array.isArray(n)?`[${n.map(i=>this.literal(i)).join(", ")}]`:`[${Object.entries(n).map(([i,r])=>`${this.string(i)} => ${this.literal(r)}`).join(", ")}]`}comment(n){for(let s of F(n))this.line(s===""?"//":`// ${s}`);return this}doc(n,s,i=[]){let r=F(s);if(r.length===0&&i.length===0)return this;let t=r.length===0?n:`${n} \u2014 ${r.join(" ")}`;if(i.length===0)return this.line(`/** ${t} */`);this.line("/**"),this.line(` * ${t}`),this.line(" *");for(let a of i)this.line(` * ${a}`);return this.line(" */")}};var h=C.php,G=new q;function y(e){return G.typeName(e)}function b(e){return G.memberName(e)}function c(e){return G.string(e)}function ie(e){return p(e.name,{style:"camel",reserved:h})}function K(e){let n=e.services.flatMap(i=>i.operations),s=w(n.map(i=>i.name),{style:"camel",reserved:h});return new Map(n.map((i,r)=>[i.name,s[r]]))}function de(e){return ne(e).map(s=>s.kind==="literal"?c(s.value):`$${b(s.name)}`).join(" . ")}function se(e,n){let s=n.servers??[];if(s.length===0)return;let i=new Set;e.line("/** The declared servers; variables default to the values from the description. */"),e.line("final class Servers"),e.block("{",()=>{s.forEach((r,t)=>{let a=p(r.description??`server${t+1}`,{style:"camel",reserved:h});i.has(a)&&(a=`${a}${t+1}`),i.add(a);let o=r.variables.map(l=>`string $${b(l.name)} = ${c(l.default)}`);t>0&&e.blank(),e.line(`public static function ${a}(${o.join(", ")}): string`),e.block("{",()=>{e.line(`return ${de(r)};`)},"}")})},"}"),e.blank()}function ae(e,n){let s=te(e,n).map(i=>`[${i.map(t=>t.kind==="apiKey"?`['kind' => 'apiKey', 'scheme' => ${c(t.scheme)}, 'name' => ${c(t.name)}, 'in' => ${c(t.in)}]`:`['kind' => ${c(t.kind)}, 'scheme' => ${c(t.scheme)}]`).join(", ")}]`);if(s.length!==0)return`[${s.join(", ")}]`}function oe(e){return`[${[`'style' => ${c(e.style)}`,...e.param!==void 0?[`'param' => ${c(e.param)}`]:[],...e.nextCursor!==void 0?[`'nextCursor' => ${c(e.nextCursor)}`]:[],...e.hasMore!==void 0?[`'hasMore' => ${c(e.hasMore)}`]:[],...e.limitParam!==void 0?[`'limitParam' => ${c(e.limitParam)}`]:[],...e.items!==void 0?[`'items' => ${c(e.items)}`]:[]].join(", ")}]`}function ce(e,n){let s=new Set;return`[${(e.successResponseHeaders??[]).map(r=>{let t=p(r.name,{style:"camel",reserved:h}),a=2;for(;s.has(t);)t=`${p(r.name,{style:"camel",reserved:h})}_${a++}`;s.add(t);let o=ee(r.schema,n);return`[${c(r.name)}, ${c(t)}, ${c(o)}]`}).join(", ")}]`}function _(e,n){let s=n.schemas.find(t=>t.name===e);if(s===void 0)return"other";let i=s.schema,r=I(i);return r!==void 0&&(r.scalar==="string"||r.scalar==="integer")?"enum":(i.kind==="object"||i.kind==="intersection")&&D(i,n)!==void 0?"class":"other"}function m(e,n,s="string"){if(Z(e)){let i=m(j(e),n,s);return A(i)}switch(e.kind){case"scalar":return s==="Date"&&e.scalar==="string"&&L(e)?"\\DateTimeImmutable":{string:"string",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"array":case"record":return"array";case"ref":{let i=_(e.name,n);if(i==="class"||i==="enum")return y(e.name);let r=x(e,n);return r===void 0?"mixed":m(r,n,s)}case"enum":return{string:"string",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"literal":return typeof e.value=="string"?"string":typeof e.value=="boolean"?"bool":"float";case"omit":return y(e.base);case"union":return me(e.members,n,s);case"null":case"object":case"intersection":case"unknown":return"mixed"}}function L(e){let n=e.metadata?.format;return n==="date"||n==="date-time"}function A(e){return e==="mixed"||e.startsWith("?")||e.endsWith("|null")?e:e.includes("|")?`${e}|null`:`?${e}`}function me(e,n,s){let i=[];for(let r of e){if(r.kind==="null")continue;let t=m(r,n,s);if(t==="mixed")return"mixed";let a=t.startsWith("?")?t.slice(1):t;i.includes(a)||i.push(a),t.startsWith("?")&&!i.includes("null")&&i.push("null")}return i.length===0?"mixed":i.join("|")}function J(e,n,s){if(e===void 0)return;let i=j(e);if(i.kind==="ref"){let t=x(i,n);return _(i.name,n)==="other"?J(t,n,s):void 0}if(i.kind!=="array")return;let r=m(i.items,n,s);return r==="mixed"?void 0:r}function le(e,n){let s=n.schemas.find(i=>i.name===e);return s!==void 0&&O(s.schema,n)!==void 0}function v(e,n,s,i){let r=j(e);if(i==="Date"&&r.kind==="scalar"&&r.scalar==="string"&&L(r))return`new \\DateTimeImmutable(${n})`;if(r.kind==="omit")return v({kind:"ref",name:r.base},n,s,i);if(r.kind==="ref"){let t=_(r.name,s);if(t==="class")return`${y(r.name)}::fromArray(${n})`;if(t==="enum")return`${y(r.name)}::from(${n})`;if(le(r.name,s))return`unmarshal${y(r.name)}(${n})`;let a=x(r,s);return a===void 0?void 0:v(a,n,s,i)}if(r.kind==="array"){let t=v(r.items,"$item",s,i);return t===void 0?void 0:`array_map(static fn ($item) => ${t}, ${n})`}if(r.kind==="record"){let t=v(r.value,"$item",s,i);return t===void 0?void 0:`array_map(static fn ($item) => ${t}, ${n})`}}function N(e,n,s,i="string"){let r=j(e);if(i==="Date"&&r.kind==="scalar"&&r.scalar==="string"){if(r.metadata?.format==="date")return`${n}->format('Y-m-d')`;if(r.metadata?.format==="date-time")return`${n}->format(\\DateTimeInterface::ATOM)`}if(r.kind==="omit")return N({kind:"ref",name:r.base},n,s,i);if(r.kind==="ref"){let t=_(r.name,s);if(t==="class")return`${n}->toArray()`;if(t==="enum")return`${n}->value`;if(le(r.name,s))return`is_object(${n}) ? ${n}->toArray() : ${n}`;let a=x(r,s);return a===void 0?void 0:N(a,n,s,i)}if(r.kind==="array"||r.kind==="record"){let t=r.kind==="array"?r.items:r.value,a=N(t,"$item",s,i);return a===void 0?void 0:`array_map(static fn ($item) => ${a}, ${n})`}}function pe(e,n,s,i,r,t){let a=[...s.filter(o=>o.required),...s.filter(o=>!o.required)];e.doc(y(n),t),e.line(`final class ${y(n)}`),e.block("{",()=>{e.block("public function __construct(",()=>{for(let o of a){let l=m(o.schema,i,r);if(o.required)e.line(`public ${l} $${b(o.name)},`);else{let u=A(l);e.line(`public ${u} $${b(o.name)} = null,`)}}},") {"),e.line("}"),e.blank(),e.line("public static function fromArray(array $data): self"),e.block("{",()=>{e.block("return new self(",()=>{for(let o of a){let l=`$data[${c(o.name)}]`,u=v(o.schema,l,i,r),f=b(o.name);o.required?e.line(`${f}: ${u??l},`):u===void 0?e.line(`${f}: ${l} ?? null,`):e.line(`${f}: isset(${l}) ? ${u} : null,`)}},");")},"}"),e.blank(),e.line("public function toArray(): array"),e.block("{",()=>{e.line("$data = [];");for(let o of a){let l=`$this->${b(o.name)}`,u=N(o.schema,l,i,r)??l;o.required?e.line(`$data[${c(o.name)}] = ${u};`):e.block(`if (${l} !== null) {`,()=>{e.line(`$data[${c(o.name)}] = ${u};`)},"}")}e.line("return $data;")},"}")},"}"),e.blank()}function V(e,n="string"){let s=new q;for(let{name:i,schema:r}of e.schemas){let t=I(r);if(t!==void 0&&(t.scalar==="string"||t.scalar==="integer")){let o=t.scalar==="string"?"string":"int";s.doc(y(i),r.description),s.line(`enum ${y(i)}: ${o}`),s.block("{",()=>{let l=w(t.values.map(u=>String(u)),{style:"pascal",reserved:h});t.values.forEach((u,f)=>{let g=typeof u=="string"?c(u):String(u);s.line(`case ${l[f]} = ${g};`)})},"}"),s.blank();continue}if(r.kind==="object"||r.kind==="intersection"){let o=D(r,e);if(o!==void 0){pe(s,i,o.properties,e,n,o.description??r.description);continue}}let a=O(r,e);if(a!==void 0){let o=y(i),l=a.cases.map(u=>`${u.value} -> ${y(u.schemaName)}`).join(", ");s.line(`/** ${o} is a discriminated union (${c(a.property)}): ${l}. */`),s.line(`function unmarshal${o}(array $data): mixed`),s.block("{",()=>{s.block(`return match ($data[${c(a.property)}] ?? null) {`,()=>{for(let u of a.cases)s.line(`${c(u.value)} => ${y(u.schemaName)}::fromArray($data),`);s.line("default => $data,")},"};")},"}"),s.blank();continue}}return s.toString()}var ue=new Set(["post","put","patch"]),he=["body","headers","idempotencyKey"];function z(e,n,s,i){let r=w([...e.pathParams,...e.queryParams].map(l=>l.name),{style:"camel",reserved:h,taken:he}),t=e.pathParams.map((l,u)=>({php:r[u],wire:l.name,type:m(l.schema,n,i)})),a=e.queryParams.map((l,u)=>{let f=r[e.pathParams.length+u];return{php:f,wire:l.name,type:m(l.schema,n,i),value:N(l.schema,`$${f}`,n,i)??`$${f}`}}),o=[...t.map(({php:l,type:u})=>`${u} $${l}`),...s&&e.requestBody?[`${W(e)?"array":m(e.requestBody.schema,n,i)} $body`]:[],...a.map(({php:l,type:u})=>`${A(u)} $${l} = null`),"?array $headers = null",...s&&ue.has(e.method.toLowerCase())?["?string $idempotencyKey = null"]:[]];return{pathArgs:t,queryArgs:a,signature:o}}function ye(e,n,s){e.line(`$op = OPERATIONS[${c(n.specName??n.name)}];`),e.line("[$authHeaders, $query, $cookies] = resolveAuth($op['security'] ?? [], $this->config->auth);");for(let{php:r,wire:t,value:a}of s.queryArgs)e.block(`if ($${r} !== null) {`,()=>{e.line(`$query[${c(t)}] = ${a};`)},"}");let i=s.pathArgs.map(({php:r,wire:t})=>`${c(t)} => $${r}`).join(", ");e.line(`$url = buildUrl($this->config->serverUrl, $op['path'], [${i}]);`),e.line("$requestHeaders = array_merge($authHeaders, $headers ?? []);"),e.block("if ($cookies !== []) {",()=>{e.line("$requestHeaders['Cookie'] = implode('; ', $cookies);")},"}")}function Q(e,n,s,i,r,t=!1){let a=z(n,i,!0,r),o=T(n),l=E(n),u=o===void 0&&l===void 0&&n.successResponses.some(k=>k.contentType!==""),f=t?"Envelope":o!==void 0?"\\Generator":l!==void 0?m(l,i,r):u?"string":"void",g=t?`${s}WithHeaders`:s,H=t?void 0:J(l,i,r);e.doc(g,t?`Like ${s}(), returning an Envelope with the declared response headers.`:n.summary??`${n.method.toUpperCase()} ${n.path}`,H===void 0?[]:[`@return ${H}[]`]),e.line(`public function ${g}(${a.signature.join(", ")}): ${f}`),e.block("{",()=>{if(ye(e,n,a),o!==void 0){let d=o.schema!==void 0&&o.schema.kind!=="unknown";e.line("$url = appendQuery($url, $query);"),e.block("$open = function (array $extraHeaders) use ($url, $requestHeaders): \\CurlHandle {",()=>{e.line("$handle = curl_init($url);"),e.line("$lines = [];"),e.block("foreach (array_merge($requestHeaders, $extraHeaders) as $name => $value) {",()=>{e.line("$lines[] = $name . ': ' . $value;")},"}"),e.line("curl_setopt($handle, CURLOPT_HTTPHEADER, $lines);"),e.line("return $handle;")},"};"),e.line(`yield from iterSse($open, ${d?"true":"false"});`);return}let k=["'operationId' => $op['id']","'method' => $op['method']","'url' => $url","'headers' => $requestHeaders","'query' => $query"];if(n.requestBody&&W(n))e.line("[$contentType, $encoded] = toMultipart($body);"),k.push("'body' => $encoded","'contentType' => $contentType");else if(n.requestBody){let d=N(n.requestBody.schema,"$body",i,r)??"$body";e.line(`$payload = json_encode(${d});`),k.push("'body' => $payload",`'contentType' => ${c(n.requestBody.contentType)}`)}ue.has(n.method.toLowerCase())&&n.requestBody&&k.push("'idempotencyKey' => $idempotencyKey"),e.line(`$response = send($this->config, [${k.join(", ")}]);`),e.block("if ($response['status'] >= 400) {",()=>{e.line("throw apiErrorFrom($response);")},"}");let $=u?"$response['body']":(l===void 0?void 0:v(l,"decodeJson($response)",i,r))??"decodeJson($response)";if(t){e.line(`$data = ${$};`),e.line(`return new Envelope(data: $data, headers: readEnvelopeHeaders($response, ${ce(n,i)}), status: $response['status']);`);return}if(u){e.line("return $response['body'];");return}if(f==="void"){e.line("decodeJson($response);");return}e.line(`return ${$};`)},"}"),e.blank()}function $e(e,n,s,i,r,t,a,o,l){let u=z(n,i,!1,r),f=s,g=()=>{e.line(`$op = OPERATIONS[${c(n.specName??n.name)}];`),e.line("$base = [];");for(let{php:d,wire:P,value:S}of u.queryArgs)e.block(`if ($${d} !== null) {`,()=>{e.line(`$base[${c(P)}] = ${S};`)},"}");let $=u.pathArgs.map(({php:d,wire:P})=>`${c(P)} => $${d}`).join(", ");e.block("$call = function (array $params) use ($op, $headers): array {",()=>{e.line("[$authHeaders, $authQuery, $cookies] = resolveAuth($op['security'] ?? [], $this->config->auth);"),e.line(`$url = buildUrl($this->config->serverUrl, $op['path'], [${$}]);`),e.line("$requestHeaders = array_merge($authHeaders, $headers ?? []);"),e.block("if ($cookies !== []) {",()=>{e.line("$requestHeaders['Cookie'] = implode('; ', $cookies);")},"}"),e.line("$response = send($this->config, ['operationId' => $op['id'], 'method' => $op['method'], 'url' => $url, 'headers' => $requestHeaders, 'query' => array_merge($params, $authQuery)]);"),e.block("if ($response['status'] >= 400) {",()=>{e.line("throw apiErrorFrom($response);")},"}"),e.line("return [decodeJson($response), $response];")},"};")},H=m(E(n)??{kind:"unknown"},i,r),k=H==="mixed"?"mixed":H;e.line("/**"),e.line(` * ${f} response pages, following the pagination rule automatically.`),e.line(" *"),e.line(` * @return \\Generator<int, ${k}>`),e.line(" */"),e.line(`public function ${f}Pages(${u.signature.join(", ")}): \\Generator`),e.block("{",()=>{g(),e.block("foreach (iterPages($call, $op['pagination'], $base) as $page) {",()=>{e.line(`yield ${t??"$page"};`)},"}")},"}"),e.blank(),e.line("/**"),e.line(` * The items of every ${f} page.`),e.line(" *"),e.line(` * @return \\Generator<int, ${l}>`),e.line(" */"),e.line(`public function ${f}Items(${u.signature.join(", ")}): \\Generator`),e.block("{",()=>{g(),e.block("foreach (iterPages($call, $op['pagination'], $base) as $page) {",()=>{e.line(`$items = resolvePointer($page, ${c(o??"")});`),e.block("foreach (is_array($items) ? $items : [] as $item) {",()=>{e.line(`yield ${a??"$item"};`)},"}")},"}")},"}"),e.blank()}function ge(e){let n=e.split(`
8
8
  `),s=0;for(let i=0;i<n.length;i++)if(n[i].trim().startsWith("namespace ")){s=i+1;break}return n.slice(s).join(`
9
9
  `).trim()}var ln=({model:e,output:n,banner:s,emit:i,pagination:r})=>{let t=new q,a=i.dateType??"string",o=p(e.title,{style:"pascal",reserved:h});t.line("<?php"),t.blank(),t.line(`// Code generated by @redocly/client-generator (php) from ${c(e.title)} ${e.version}. DO NOT EDIT.`),t.line("// Regenerate with `redocly generate-client`. PHP >= 8.1, curl extension \u2014 zero Composer dependencies."),t.blank(),t.line("declare(strict_types=1);"),t.blank(),t.line(`namespace ${o};`),t.blank(),t.line(V(e,a)),se(t,e),i.runtime==="module"?(t.line("// \u2500\u2500\u2500 Runtime (a real file beside this one, written by the same run) \u2500\u2500\u2500"),t.line("require_once __DIR__ . '/runtime.php';"),t.blank()):(t.line("// \u2500\u2500\u2500 Embedded runtime (@redocly/client-generator php runtime) \u2500\u2500\u2500"),t.line(ge(B)),t.blank());let l=e.services.flatMap($=>$.operations),u=K(e),f=new Map;for(let $ of l){let d=r?.get($.name)?.spec;d!==void 0&&f.set($.name,d)}t.block("const OPERATIONS = [",()=>{for(let $ of l){let d=$.specName??$.name,P=ae($,e),S=f.get($.name),M=[`'id' => ${c(d)}`,`'method' => ${c($.method.toUpperCase())}`,`'path' => ${c($.path)}`,...P!==void 0?[`'security' => ${P}`]:[],...S!==void 0?[`'pagination' => ${oe(S)}`]:[]];t.line(`${c(d)} => [${M.join(", ")}],`)}},"];"),t.blank(),t.doc("Client",`Client for ${e.title} (${e.version}).`),t.line("class Client"),t.block("{",()=>{t.line("public function __construct(private Config $config)"),t.block("{",()=>{t.block("if ($this->config->serverUrl === '') {",()=>{t.line(`$this->config->serverUrl = ${c(i.serverUrl??e.serverUrl??"")};`)},"}")},"}"),t.blank();for(let $ of l){let d=u.get($.name);Q(t,$,d,e,a),T($)===void 0&&($.successResponseHeaders?.length??0)>0&&Q(t,$,d,e,a,!0);let P=f.get($.name);if(P===void 0)continue;let S=E($),M=S===void 0?void 0:v(S,"$page",e,a),R=re(S,P.items,e),fe=R===void 0?void 0:v(R,"$item",e,a);$e(t,$,d,e,a,M,fe,P.items,R===void 0?"mixed":m(R,e,a))}},"}");let g={path:n.path.replace(/\.[^.\\/]+$/,".php"),content:t.toString()};if(i.runtime!=="module")return[g];let H=s.map($=>`// ${$}`).join(`
10
10
  `),k=B.replace(/^namespace .*$/m,`namespace ${o};`).replace(/^<\?php\n/,`<?php
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a}from"./EFVXVP5M.js";import"./RD64AQAZ.js";import"./UZQGV3C7.js";import"./WZXA5XPB.js";import"./UWKKXZOE.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as mockGenerator};
7
+ import{a}from"./PDTJPHOV.js";import"./T2XFX5KV.js";import"./MEVUBG5J.js";import"./WZXA5XPB.js";import"./UWKKXZOE.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as mockGenerator};
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a,b,c,d,e}from"./KQUR5LDF.js";import"./2U6O26CV.js";import"./RD64AQAZ.js";import"./UZQGV3C7.js";import"./WZXA5XPB.js";import"./UWKKXZOE.js";import"./NEWT5A6S.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{e as goDocs,c as goGenerator,d as goSample,a as goType,b as renderGoModels};
7
+ import{a,b,c,d,e}from"./EDS62CRZ.js";import"./2U6O26CV.js";import"./T2XFX5KV.js";import"./MEVUBG5J.js";import"./WZXA5XPB.js";import"./UWKKXZOE.js";import"./NEWT5A6S.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{e as goDocs,c as goGenerator,d as goSample,a as goType,b as renderGoModels};
@@ -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{b as S,c as E,d as w,f as A,g as M,h as q,i as D,j as B,k as F}from"./FPOO3NKZ.js";import{b,g as T}from"./RD64AQAZ.js";import{a as f,c as R,d as v,e as k}from"./UZQGV3C7.js";import{d as I,f as N,h as P,i as j,m as C}from"./LD5MEXEL.js";import{join as Y}from"node:path";var y="// Generated by @redocly/client-generator \u2014 do not edit by hand.\n// Source: OpenAPI description. Re-run `redocly generate-client` to update.";function $(e){return e.filter(t=>t.length>0).join(`
7
+ import{b as S,c as E,d as w,f as A,g as M,h as q,i as D,j as B,k as F}from"./W3YACFG2.js";import{b,g as T}from"./T2XFX5KV.js";import{a as f,c as R,d as v,e as k}from"./MEVUBG5J.js";import{d as I,f as N,h as P,i as j,m as C}from"./LD5MEXEL.js";import{join as Y}from"node:path";var y="// Generated by @redocly/client-generator \u2014 do not edit by hand.\n// Source: OpenAPI description. Re-run `redocly generate-client` to update.";function $(e){return e.filter(t=>t.length>0).join(`
8
8
 
9
9
  `)+`
10
10
  `}function O(e){let t=["/**",` * ${j(`${e.title} (v${e.version})`)}`];if(e.description)for(let n of C(j(e.description)))t.push(` * ${n}`.replace(/ +$/,""));return t.push(" */"),t.join(`
@@ -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"./2U6O26CV.js";import{b as B,c as j,d as N,e as V,f as Q,g as Z,h as Y}from"./RD64AQAZ.js";import{a as H}from"./WZXA5XPB.js";import{a as F,b as T,c as C,d as P,e as W,g as _,h as M,i as A,j as z,k as K,l as U,n as J}from"./UW4UC7ZI.js";var G=C.go,S=class extends F{constructor(){super(" ")}typeName(t){return d(t)}memberName(t){return d(t)}identifier(t){return P(t,{style:"camel",reserved:G})}identifiers(t,n){let r=new Set(n??[]);return t.map(o=>{let s=d(o),a=s;for(let i=2;r.has(a);i++)a=`${s}${i}`;return r.add(a),a})}packageName(t){let n=t.toLowerCase().replace(/[^a-z0-9]/g,"");return n===""||/^[0-9]/.test(n)?"client":n}string(t){let n='"';for(let r of t){let o=r.codePointAt(0);r==="\\"?n+="\\\\":r==='"'?n+='\\"':r===`
7
+ import{a as O}from"./2U6O26CV.js";import{b as B,c as j,d as N,e as V,f as Q,g as Z,h as Y}from"./T2XFX5KV.js";import{a as H}from"./WZXA5XPB.js";import{a as F,b as T,c as C,d as P,e as W,g as _,h as M,i as A,j as z,k as K,l as U,n as J}from"./UW4UC7ZI.js";var G=C.go,S=class extends F{constructor(){super(" ")}typeName(t){return d(t)}memberName(t){return d(t)}identifier(t){return P(t,{style:"camel",reserved:G})}identifiers(t,n){let r=new Set(n??[]);return t.map(o=>{let s=d(o),a=s;for(let i=2;r.has(a);i++)a=`${s}${i}`;return r.add(a),a})}packageName(t){let n=t.toLowerCase().replace(/[^a-z0-9]/g,"");return n===""||/^[0-9]/.test(n)?"client":n}string(t){let n='"';for(let r of t){let o=r.codePointAt(0);r==="\\"?n+="\\\\":r==='"'?n+='\\"':r===`
8
8
  `?n+="\\n":r==="\r"?n+="\\r":r===" "?n+="\\t":o<32||o===127?n+=`\\x${o.toString(16).padStart(2,"0")}`:o>=55296&&o<=57343?n+="\\uFFFD":n+=r}return n+'"'}literal(t){return t==null?"nil":typeof t=="boolean"||typeof t=="number"?String(t):typeof t=="string"?this.string(t):Array.isArray(t)?`[]any{${t.map(r=>this.literal(r)).join(", ")}}`:`map[string]any{${Object.entries(t).map(([r,o])=>`${this.string(r)}: ${this.literal(o)}`).join(", ")}}`}comment(t){for(let n of U(t))this.line(n===""?"//":`// ${n}`);return this}doc(t,n){let r=U(n);if(r.length===0)return this;this.line(`// ${t} \u2014 ${r[0]}`);let o=!1;for(let s of r.slice(1)){if(s===""){o||this.line("//"),o=!0;continue}this.line(`// ${s}`),o=!1}return this}layout(t){return ie(le(t))}toString(){return this.layout(super.toString())}};function d(e){let t=P(e,{style:"pascal",reserved:G});return t.startsWith("_")?`N${t.slice(1)}`:t}function ie(e){return`${e.replace(/\n{3,}/g,`
9
9
 
10
10
  `).trimEnd()}
@@ -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 Z,b as ee,f as te,g as G,h as ne}from"./UZQGV3C7.js";import{a as y}from"./WZXA5XPB.js";import{C as J,H as V,W as b,Y as W,ba as Q,c as x,da as E,ka as Y,q as v,s as H}from"./UWKKXZOE.js";import{b as M,c as T,k as D}from"./LD5MEXEL.js";import{mkdir as at,readFile as ct,writeFile as ut}from"node:fs/promises";import{dirname as $e,parse as dt,resolve as R,sep as ft}from"node:path";function A(e){return{requires:["typescript"],errorModes:["throw"],load:()=>import("./FKRGYVXD.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"},I={typescript:{load:()=>import("./BVF3GEBD.js").then(e=>({run:e.typescriptGenerator,sample:e.typescriptSample,docs:e.typescriptDocs}))},zod:{load:()=>import("./JA4LTWW3.js").then(e=>({run:e.zodGenerator}))},transformers:{requires:["typescript"],dateTypes:["Date"],load:()=>import("./IULINGO6.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:["typescript"],errorModes:["throw"],load:()=>import("./HY6IF56V.js").then(e=>({run:e.swrGenerator}))},mock:{requires:["typescript"],load:()=>import("./YLZS72LY.js").then(e=>({run:e.mockGenerator}))},cli:{requires:["typescript","zod"],errorModes:["throw"],load:()=>import("./I4EFNEXU.js").then(e=>({run:e.cliGenerator,sample:e.cliSample,docs:e.cliDocs}))},python:{notApplicable:U,load:()=>import("./ZBW2UTL4.js").then(e=>({run:e.pythonGenerator,sample:e.pythonSample,docs:e.pythonDocs,options:e.pythonOptions}))},go:{errorModes:["throw"],notApplicable:U,load:()=>import("./LGWICMQK.js").then(e=>({run:e.goGenerator,sample:e.goSample,docs:e.goDocs}))},php:{errorModes:["throw"],notApplicable:U,load:()=>import("./Z57CXIHX.js").then(e=>({run:e.phpGenerator,sample:e.phpSample,docs:e.phpDocs}))}};function re(e,t,n,r){let s=new Set(e);t.goPackage!==void 0&&!s.has("go")&&b.warn(`generate-client: goPackage is ignored \u2014 it declares the Go package clause, and no selected generator uses it (add --generator go).
7
+ import{a as Z,b as ee,f as te,g as G,h as ne}from"./MEVUBG5J.js";import{a as y}from"./WZXA5XPB.js";import{C as J,H as V,W as b,Y as W,ba as Q,c as x,da as E,ka as Y,q as v,s as H}from"./UWKKXZOE.js";import{b as M,c as T,k as D}from"./LD5MEXEL.js";import{mkdir as at,readFile as ct,writeFile as ut}from"node:fs/promises";import{dirname as $e,parse as dt,resolve as R,sep as ft}from"node:path";function A(e){return{requires:["typescript"],errorModes:["throw"],load:()=>import("./S7LWRM6M.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"},I={typescript:{load:()=>import("./Q3XI4H3K.js").then(e=>({run:e.typescriptGenerator,sample:e.typescriptSample,docs:e.typescriptDocs}))},zod:{load:()=>import("./2HTEK7CB.js").then(e=>({run:e.zodGenerator}))},transformers:{requires:["typescript"],dateTypes:["Date"],load:()=>import("./IULINGO6.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:["typescript"],errorModes:["throw"],load:()=>import("./JXAKPU5V.js").then(e=>({run:e.swrGenerator}))},mock:{requires:["typescript"],load:()=>import("./C4FLQ63T.js").then(e=>({run:e.mockGenerator}))},cli:{requires:["typescript","zod"],errorModes:["throw"],load:()=>import("./TOCY6E4B.js").then(e=>({run:e.cliGenerator,sample:e.cliSample,docs:e.cliDocs}))},python:{notApplicable:U,load:()=>import("./QE555QD2.js").then(e=>({run:e.pythonGenerator,sample:e.pythonSample,docs:e.pythonDocs,options:e.pythonOptions}))},go:{errorModes:["throw"],notApplicable:U,load:()=>import("./CPXI7K7L.js").then(e=>({run:e.goGenerator,sample:e.goSample,docs:e.goDocs}))},php:{errorModes:["throw"],notApplicable:U,load:()=>import("./TXEDXTQA.js").then(e=>({run:e.phpGenerator,sample:e.phpSample,docs:e.phpDocs}))}};function re(e,t,n,r){let s=new Set(e);t.goPackage!==void 0&&!s.has("go")&&b.warn(`generate-client: goPackage is ignored \u2014 it declares the Go package clause, and no selected generator uses it (add --generator go).
8
8
  `);let o=t.errorMode??"throw",i=t.dateType??"string";for(let a of e){let c=n.get(a);if(!c)throw new y(`Unknown generator: ${a}`);for(let d of c.requires??[])if(!s.has(d)){let f=[...new Set([d,...e])].map(h=>`--generator ${h}`).join(" ");throw new y(`The "${a}" generator requires the "${d}" generator. Add it, e.g. ${f}.`)}if(c.errorModes&&!c.errorModes.includes(o))throw new y(`The "${a}" generator does not support --error-mode "${o}" (supported: ${c.errorModes.join(", ")}).`);if(c.dateTypes&&!c.dateTypes.includes(i))throw new y(`The "${a}" generator requires --date-type ${c.dateTypes.join(" or ")} (got "${i}") so the runtime values match the generated types.`);let u={...t,outputMode:r};for(let[d,f]of Object.entries(c.notApplicable??{}))u[d]!==void 0&&b.warn(`generate-client: the "${a}" generator ignores ${d} \u2014 ${f}.
9
9
  `)}}function oe(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&&b.warn(`generate-client: the "${s}" generator declares no options, so client.options.${s} is ignored.
10
10
  `),r.set(s,{});continue}r.set(s,ke(s,o,i))}return r}function ke(e,t,n){if(n!==void 0&&!x(n))throw new y(`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 y(`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 y(`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 y(`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 xe}from"node:path";import{pathToFileURL as qe}from"node:url";var Se=function(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,s,o,i){return r?t?".jsx":".js":s&&(!o||!i)?n:s+o+"."+i.toLowerCase()+"js"}):e};async function ie(e,t={}){let n=new Map;for(let a of t.customGenerators??[])ae(n,a);let r=[];for(let a of e)r.push(await se(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 I)&&await i(await se(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 se(e,t,n){if(t.has(e))return e;let r=I[e];if(r!==void 0){let{load:o,...i}=r;return t.set(e,{...i,...await o()}),e}if(e==="sdk")throw new y('The "sdk" generator is now named "typescript". Update the `generators` list or the --generator flag.');let s=await Pe(e,n??process.cwd());return ae(t,s),s.name}function ae(e,t){if(!x(t)||typeof t.name!="string"||t.name===""||typeof t.run!="function")throw new y("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 y(`Generator name "${t.name}" collides with an existing generator. Rename the custom generator.`);if(t.requiresGenerator!==void 0){let n=ne(G,t.requiresGenerator);if(n===void 0)throw new y(`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 y(`Generator "${t.name}" needs @redocly/client-generator ${t.requiresGenerator}; this CLI ships ${G}. 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 I&&b.warn(`generate-client: custom generator "${t.name}" takes over the built-in generator of the same name.
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a as g,b as h,c as r,d as s,e as t,f as u,g as v,h as w,i as x,j as y,k as B,l as C,m as D,n as F,o as G}from"./RD64AQAZ.js";import{a as z,e as A,g as E}from"./UZQGV3C7.js";import{a}from"./WZXA5XPB.js";import"./UWKKXZOE.js";import"./NEWT5A6S.js";import{a as b,b as c,c as d,d as e,e as f,f as i,g as j,h as k,i as l,j as m,k as n,l as o,m as p,n as q}from"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{x as AUTHORING_HELPER_NAMES,E as GENERATOR_VERSION,a as NotSupportedError,b as Printer,d as RESERVED_WORDS,A as WIRING_NAMES,z as allOperations,c as casing,C as constantCase,y as defineClientSetup,F as defineGenerator,i as deref,k as discriminatorCases,o as docText,n as enumValues,j as flattenAllOf,G as generateClient,B as groupSlug,q as headerCoerceType,e as identifierFor,t as isMultipartBody,l as isNullable,r as jsonSuccessSchema,D as mergeConfig,w as paginationItemSchema,g as paginationRuleFor,h as renderReferencePage,p as resolveSchemaPointer,p as schemaAtPointer,v as securityRequirements,u as serverUrlParts,s as sseResponse,f as uniqueIdentifiers,m as unwrapNullable};
7
+ import{a as g,b as h,c as r,d as s,e as t,f as u,g as v,h as w,i as x,j as y,k as B,l as C,m as D,n as F,o as G}from"./T2XFX5KV.js";import{a as z,e as A,g as E}from"./MEVUBG5J.js";import{a}from"./WZXA5XPB.js";import"./UWKKXZOE.js";import"./NEWT5A6S.js";import{a as b,b as c,c as d,d as e,e as f,f as i,g as j,h as k,i as l,j as m,k as n,l as o,m as p,n as q}from"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{x as AUTHORING_HELPER_NAMES,E as GENERATOR_VERSION,a as NotSupportedError,b as Printer,d as RESERVED_WORDS,A as WIRING_NAMES,z as allOperations,c as casing,C as constantCase,y as defineClientSetup,F as defineGenerator,i as deref,k as discriminatorCases,o as docText,n as enumValues,j as flattenAllOf,G as generateClient,B as groupSlug,q as headerCoerceType,e as identifierFor,t as isMultipartBody,l as isNullable,r as jsonSuccessSchema,D as mergeConfig,w as paginationItemSchema,g as paginationRuleFor,h as renderReferencePage,p as resolveSchemaPointer,p as schemaAtPointer,v as securityRequirements,u as serverUrlParts,s as sseResponse,f as uniqueIdentifiers,m 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 U}from"./2U6O26CV.js";import{b as Z,c as R,d as L,e as Y,f as oe,g as K,h as re}from"./RD64AQAZ.js";import{a as X,c as F,d as k,e as D,g as B,h as T,i as ee,j as ne,k as te,l as H,n as se}from"./UW4UC7ZI.js";var M=F.python,j=class extends X{constructor(){super(" ")}typeName(n){return k(n,{style:"pascal",reserved:M})}memberName(n){let t=k(n,{style:"snake",reserved:M});return{identifier:t,renamed:t!==n}}identifier(n){return k(n,{style:"snake",reserved:M})}identifiers(n,t){return D(n,{style:"snake",reserved:M,taken:t})}constName(n){return k(n,{style:"screaming",reserved:M})}string(n){let t='"';for(let s of n){let r=s.codePointAt(0);s==="\\"?t+="\\\\":s==='"'?t+='\\"':s===`
7
+ import{c as U}from"./2U6O26CV.js";import{b as Z,c as R,d as L,e as Y,f as oe,g as K,h as re}from"./T2XFX5KV.js";import{a as X,c as F,d as k,e as D,g as B,h as T,i as ee,j as ne,k as te,l as H,n as se}from"./UW4UC7ZI.js";var M=F.python,j=class extends X{constructor(){super(" ")}typeName(n){return k(n,{style:"pascal",reserved:M})}memberName(n){let t=k(n,{style:"snake",reserved:M});return{identifier:t,renamed:t!==n}}identifier(n){return k(n,{style:"snake",reserved:M})}identifiers(n,t){return D(n,{style:"snake",reserved:M,taken:t})}constName(n){return k(n,{style:"screaming",reserved:M})}string(n){let t='"';for(let s of n){let r=s.codePointAt(0);s==="\\"?t+="\\\\":s==='"'?t+='\\"':s===`
8
8
  `?t+="\\n":s==="\r"?t+="\\r":s===" "?t+="\\t":r<32||r===127?t+=`\\x${r.toString(16).padStart(2,"0")}`:r>=55296&&r<=57343?t+=`\\u${r.toString(16).padStart(4,"0")}`:t+=s}return t+'"'}literal(n){return n==null?"None":n===!0?"True":n===!1?"False":typeof n=="number"?String(n):typeof n=="string"?this.string(n):Array.isArray(n)?`[${n.map(s=>this.literal(s)).join(", ")}]`:`{${Object.entries(n).map(([s,r])=>`${this.string(s)}: ${this.literal(r)}`).join(", ")}}`}comment(n){for(let t of H(n))this.line(t===""?"#":`# ${t}`);return this}doc(n){let t=H(n);if(t.length===0)return this;if(t.length===1)return this.line(`"""${t[0]}"""`);this.line(`"""${t[0]}`);for(let s of t.slice(1))this.line(s);return this.line('"""')}};var N=F.python,f=new j;function O(e){return f.typeName(e)}function q(e){let{identifier:n,renamed:t}=f.memberName(e);return{python:n,renamed:t}}function I(e){let n=e.services.flatMap(s=>s.operations),t=D(n.map(s=>s.name),{style:"snake",reserved:N});return n.map((s,r)=>({op:s,ident:t[r]}))}var W=["self","body","headers","timeout","retry","idempotency_key"];function ae(e){return f.literal(e)}function ie(e){if(e!==void 0)return{style:e.style,...e.param!==void 0?{param:e.param}:{},...e.nextCursor!==void 0?{next_cursor:e.nextCursor}:{},...e.hasMore!==void 0?{has_more:e.hasMore}:{},...e.limitParam!==void 0?{limit_param:e.limitParam}:{},...e.items!==void 0?{items:e.items}:{}}}function ce(e,n){let t=new Set;return`[${(e.successResponseHeaders??[]).map(r=>{let a=k(r.name,{style:"snake",reserved:N}),c=a,i=2;for(;t.has(c);)c=`${a}_${i++}`;t.add(c);let m=se(r.schema,n);return`(${f.string(r.name)}, ${f.string(c)}, ${f.string(m)})`}).join(", ")}]`}function y(e,n="string"){if(ee(e))return`Optional[${y(ne(e),n)}]`;switch(e.kind){case"scalar":if(n==="Date"&&e.scalar==="string"){if(e.metadata?.format==="date-time")return"datetime";if(e.metadata?.format==="date")return"date"}return{string:"str",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"array":return`List[${y(e.items,n)}]`;case"record":return`Dict[str, ${y(e.value,n)}]`;case"ref":return O(e.name);case"literal":return`Literal[${f.literal(e.value)}]`;case"enum":return{string:"str",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"union":return`Union[${e.members.map(t=>y(t,n)).join(", ")}]`;case"null":return"None";case"omit":return O(e.base);case"object":case"intersection":case"unknown":return"Any"}}function G(e,n,t,s,r,a,c,i=!1){let m=D([...n.pathParams,...n.queryParams].map(S=>S.name),{style:"snake",reserved:N,taken:W}),l=n.pathParams.map((S,v)=>({param:S,python:m[v]})),o=n.queryParams.map((S,v)=>({param:S,python:m[n.pathParams.length+v]})),d=l.map(({param:S,python:v})=>`${v}: ${y(S.schema,a)}`),u=n.requestBody?[`body: ${y(n.requestBody.schema,a)}`]:[],$=[...o.map(({param:S,python:v})=>{let A=y(S.schema,a),E=A.startsWith("Optional[")?A:`Optional[${A}]`;return`${v}: ${E} = None`}),"headers: Optional[Dict[str, str]] = None","timeout: Optional[float] = None","retry: Optional[Dict[str, Any]] = None","idempotency_key: Any = None"],h=R(n),g=L(n),x=i?`Envelope[${h===void 0?"None":y(h,a)}]`:g!==void 0?`${r?"AsyncIterator":"Iterator"}[ServerSentEvent]`:s==="result"?"Result":h===void 0?"None":y(h,a),P=r&&g===void 0?"async def":"def",p=r?"await ":"",_=r?"send_async":"send",b=["self",...d,...u,"*",...$].join(", "),w=i?`${t}_with_headers`:t;e.block(`${P} ${w}(${b}) -> ${x}:`,()=>{e.doc(i?`Like ${t}(), returning an Envelope with the declared response headers.`:n.summary),e.line(`op = _OPERATIONS["${t}"]`),e.line('auth_headers, auth_query = resolve_auth(op.get("security") or [], self._auth)'),e.line("params: Dict[str, Any] = dict(auth_query)");for(let{param:E,python:C}of o)e.block(`if ${C} is not None:`,()=>{e.line(`params[${f.string(E.name)}] = encode(${C})`)});let S=l.map(({param:E,python:C})=>`${f.string(E.name)}: ${C}`).join(", ");if(e.line(`url = build_url(self._server_url, op["path"], {${S}})`),g!==void 0){let E=g.schema!==void 0&&g.schema.kind!=="unknown"?"json":"text";e.block("def _open(extra_headers: Dict[str, str]):",()=>{e.line('return self._http.stream(op["method"], url, headers={**auth_headers, **(headers or {}), **extra_headers}, params=params, timeout=timeout)')}),e.line(`return ${r?"aiter_sse":"iter_sse"}(_open, data_kind="${E}")`);return}Y(n)&&e.line("form_data, form_files = to_multipart(body)");let v=n.requestBody?Y(n)?", data=form_data, files=form_files":", json_body=encode(body)":"";e.line(`response = ${p}${_}(self._http, self._config, op, url, method=op["method"], headers={**auth_headers, **(headers or {})}, params=params${v}, timeout=timeout, retry=retry, idempotency_key=idempotency_key)`);let A=h===void 0?"None":`decode(${y(h,a)}, _safe_json(response))`;i?(e.block("if not response.is_success:",()=>{e.line("raise ApiError(url, response.status_code, response.reason_phrase, _safe_json(response))")}),e.line(`return Envelope(data=${A}, headers=read_envelope_headers(response, ${ce(n,c)}), response=response)`)):s==="result"?(e.block("if not response.is_success:",()=>{e.line("return Result(data=None, error=_safe_json(response), response=response)")}),e.line(`return Result(data=${A}, error=None, response=response)`)):(e.block("if not response.is_success:",()=>{e.line("raise ApiError(url, response.status_code, response.reason_phrase, _safe_json(response))")}),e.line(h===void 0?"return None":`return ${A}`))}),e.blank()}function le(e,n,t,s,r,a){let c=R(n),i=c===void 0?"Any":y(c,a),m=D([...n.pathParams,...n.queryParams].map(p=>p.name),{style:"snake",reserved:N,taken:W}),l=n.pathParams.map((p,_)=>({param:p,python:m[_]})),o=n.queryParams.map((p,_)=>({param:p,python:m[n.pathParams.length+_]})),d=l.map(({param:p,python:_})=>`${_}: ${y(p.schema,a)}`),u=[...o.map(({param:p,python:_})=>{let b=y(p.schema,a),w=b.startsWith("Optional[")?b:`Optional[${b}]`;return`${_}: ${w} = None`}),"headers: Optional[Dict[str, str]] = None","timeout: Optional[float] = None","retry: Optional[Dict[str, Any]] = None"],$=["self",...d,"*",...u].join(", "),h=s?"AsyncIterator":"Iterator",g=s?"aiter_pages":"iter_pages",x=s?"aiter_items":"iter_items",P=()=>{e.line("base: Dict[str, Any] = {}");for(let{param:b,python:w}of o)e.block(`if ${w} is not None:`,()=>{e.line(`base[${f.string(b.name)}] = encode(${w})`)});let p=s?"async def":"def",_=s?"await ":"";e.block(`${p} _page(page_params: Dict[str, Any]) -> Tuple[Any, Any]:`,()=>{e.line('auth_headers, auth_query = resolve_auth(op.get("security") or [], self._auth)');let b=l.map(({param:w,python:S})=>`${f.string(w.name)}: ${S}`).join(", ");e.line(`url = build_url(self._server_url, op["path"], {${b}})`),e.line(`response = ${_}${s?"send_async":"send"}(self._http, self._config, op, url, method=op["method"], headers={**auth_headers, **(headers or {})}, params={**page_params, **auth_query}, timeout=timeout, retry=retry)`),e.block("if not response.is_success:",()=>{e.line("raise ApiError(url, response.status_code, response.reason_phrase, _safe_json(response))")}),e.line("return _safe_json(response), response")})};s?(e.block(`async def ${t}_pages(${$}) -> ${h}[${i}]:`,()=>{e.line(`op = _OPERATIONS["${t}"]`),P(),e.block(`async for page in ${g}(_page, op["pagination"], base):`,()=>{e.line(i==="Any"?"yield page":`yield decode(${i}, page)`)})}),e.blank(),e.block(`async def ${t}_items(${$}) -> ${h}[${r}]:`,()=>{e.line(`op = _OPERATIONS["${t}"]`),P(),e.block(`async for item in ${x}(_page, op["pagination"], base):`,()=>{e.line(r==="Any"?"yield item":`yield decode(${r}, item)`)})})):(e.block(`def ${t}_pages(${$}) -> ${h}[${i}]:`,()=>{e.line(`op = _OPERATIONS["${t}"]`),P(),e.line(i==="Any"?`return ${g}(_page, op["pagination"], base)`:`return (decode(${i}, page) for page in ${g}(_page, op["pagination"], base))`)}),e.blank(),e.block(`def ${t}_items(${$}) -> ${h}[${r}]:`,()=>{e.line(`op = _OPERATIONS["${t}"]`),P(),e.line(r==="Any"?`return ${x}(_page, op["pagination"], base)`:`return (decode(${r}, item) for item in ${x}(_page, op["pagination"], base))`)})),e.blank()}function me(e){return oe(e).map(t=>t.kind==="literal"?f.string(t.value):q(t.name).python).join(" + ")}function de(e,n){let t=n.servers??[];if(t.length===0)return;let s=new Set;e.block("class Servers:",()=>{e.line('"""The declared servers; variables default to the values from the description."""'),e.blank(),t.forEach((r,a)=>{let c=k(r.description??`server${a+1}`,{style:"snake",reserved:N});s.has(c)&&(c=`${c}_${a+1}`),s.add(c);let i=r.variables.map(m=>`${q(m.name).python}: str = ${f.string(m.default)}`);a>0&&e.blank(),e.line("@staticmethod"),e.block(`def ${c}(${i.join(", ")}) -> str:`,()=>{e.line(`return ${me(r)}`)})})}),e.blank()}function V(e,n,t,s,r,a,c){let i=s?"AsyncClient":"Client",m=s?"httpx.AsyncClient":"httpx.Client";e.block(`class ${i}:`,()=>{e.doc(`${s?"Async ":""}client for ${n.title} (${n.version}).`),e.block(`def __init__(self, server_url: str = ${f.string(a)}, *, auth: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, str]] = None, timeout: Optional[float] = None, retry: Optional[Dict[str, Any]] = None, middleware: Optional[List[Any]] = None, idempotency_key: Any = None, http_client: Optional[${m}] = None) -> None:`,()=>{e.line("self._server_url = server_url"),e.line("self._auth = auth or {}"),e.line("self._config: Dict[str, Any] = {"),e.indent(()=>{e.line('"headers": headers or {},'),e.line('"timeout": timeout,'),e.line('"retry": retry or {},'),e.line('"middleware": middleware or [],'),e.line('"idempotency_key": idempotency_key,')}),e.line("}"),e.line(`self._http = http_client or ${m}()`)}),e.blank();for(let{op:l,ident:o}of I(n)){G(e,l,o,t,s,c),L(l)===void 0&&(l.successResponseHeaders?.length??0)>0&&G(e,l,o,t,s,c,n,!0);let d=r.get(o);if(d!==void 0){let u=R(l),$=re(u,typeof d.items=="string"?d.items:void 0,n);le(e,l,o,s,$===void 0?"Any":y($,c),c)}}}),e.blank()}function z(e){let n=new Map,t=new Set,s=[];for(let{name:a,schema:c}of e.schemas){let i=T(c,e);if(!(i===void 0||!i.cases.every(l=>B(l.schema,e)?.properties.some(o=>o.name===i.property)===!0))){for(let l of i.cases){let o=n.get(l.schemaName);if(o!==void 0&&o.value!==l.value){t.add(l.schemaName);continue}n.set(l.schemaName,{property:i.property,value:l.value})}s.push({name:a,property:i.property,members:i.cases.map(l=>l.schemaName)})}}let r=new Map;for(let a of s)a.members.some(c=>t.has(c))||r.set(a.name,q(a.property).python);for(let a of t)n.delete(a);return{pins:n,unions:r}}function fe(e,n,t,s,r,a,c){let i=r==="pydantic";i||e.line("@dataclass");let m=i?`class ${O(n)}(BaseModel):`:`class ${O(n)}:`;e.block(m,()=>{e.doc(a),i&&(e.line("model_config = ConfigDict(populate_by_name=True)"),e.blank());let l=[...t.filter(d=>d.required),...t.filter(d=>!d.required)],o=[];l.length===0&&e.line("pass");for(let d of l){let{python:u,renamed:$}=q(d.name);$&&!i&&o.push([u,d.name]);let h=$&&i?`alias=${f.string(d.name)}`:void 0,g=c?.property===d.name?`Literal[${f.literal(c.value)}]`:y(d.schema,s);if(d.required){let x=h===void 0?"":` = Field(${h})`;e.line(`${u}: ${g}${x}`)}else{let x=g.startsWith("Optional[")?g:`Optional[${g}]`,P=h===void 0?"None":`Field(default=None, ${h})`;e.line(`${u}: ${x} = ${P}`)}}if(o.length>0){e.blank(),e.line("# Python field name -> wire (JSON) name, for (de)serialization.");let d=o.map(([u,$])=>`"${u}": ${f.string($)}`).join(", ");e.line(`_field_map: ClassVar[Dict[str, str]] = {${d}}`)}}),e.blank(),e.blank()}function J(e,n="string",t="dataclass"){let s=new j,{pins:r,unions:a}=t==="pydantic"?z(e):{pins:new Map,unions:new Map};s.line("from __future__ import annotations"),s.blank(),t==="dataclass"&&s.line("from dataclasses import dataclass"),s.line("from enum import Enum");let c=["Any","AsyncIterator","Dict","Iterator","List","Literal","Optional","Tuple","Union"];t==="dataclass"&&c.splice(2,0,"ClassVar"),a.size>0&&c.unshift("Annotated"),s.line(`from typing import ${c.join(", ")}`),t==="pydantic"&&s.line("from pydantic import BaseModel, ConfigDict, Field"),n==="Date"&&s.line("from datetime import date, datetime"),s.blank(),s.blank();let i=[];for(let{name:m,schema:l}of e.schemas){let o=te(l);if(o!==void 0){let d=o.scalar==="string"?"str, Enum":"int, Enum";s.block(`class ${O(m)}(${d}):`,()=>{s.doc(l.description),o.values.forEach((u,$)=>{s.line(`${o.memberNames[$]} = ${f.literal(u)}`)})}),s.blank(),s.blank();continue}if(l.kind==="object"||l.kind==="intersection"){let d=B(l,e);if(d!==void 0){fe(s,m,d.properties,n,t,d.description??l.description,r.get(m));continue}}i.push(()=>{let d=T(l,e);if(d!==void 0){let h=d.cases.map(g=>`${g.value} -> ${O(g.schemaName)}`).join(", ");s.line(`# Discriminated by "${d.property}": ${h}`)}let u=a.get(m),$=u===void 0?y(l,n):`Annotated[${y(l,n)}, Field(discriminator=${f.string(u)})]`;s.line(`${O(m)} = ${$}`),s.blank()})}for(let m of i)m();return s.toString()}function pe(e,n){let t=[];for(let{name:s,schema:r}of e.schemas){if(n.has(s))continue;let a=T(r,e);if(a===void 0)continue;let c=a.cases.map(i=>`${f.string(i.value)}: ${O(i.schemaName)}`).join(", ");t.push(`DISCRIMINATORS[${O(s)}] = (${f.string(a.property)}, {${c}})`)}return t}var nn={type:"object",properties:{models:{enum:["dataclass","pydantic"],default:"dataclass",description:"Model style: standard-library dataclasses (default, httpx is the only dependency), or pydantic BaseModel classes (adds pydantic)."}},additionalProperties:!1};function Q(e){let n=e.lastIndexOf("/")>=0?"/":"\\",t=e.lastIndexOf(n),s=t>=0?e.slice(0,t+1):"",r=(t>=0?e.slice(t+1):e).replace(/\.[^.]+$/,"");return`${s}${k(r,{style:"snake",reserved:N})}.py`}var tn=({model:e,output:n,banner:t,emit:s,options:r,pagination:a})=>{let c=s.errorMode??"throw",i=s.dateType??"string",m=r?.models??"dataclass",l=m==="pydantic"?z(e):void 0,o=new j;if(o.line(`# Generated by @redocly/client-generator (python) from "${e.title}" ${e.version}.`),o.line("# Do not edit by hand \u2014 regenerate with `redocly generate-client`."),o.line(m==="pydantic"?"# Requires Python >= 3.9, httpx, and pydantic: pip install httpx pydantic":"# Requires Python >= 3.9 and httpx: pip install httpx"),o.blank(),o.line(J(e,i,m).trimEnd()),o.blank(),o.blank(),de(o,e),s.runtime==="module"){o.line("# \u2500\u2500\u2500 Runtime (real modules beside this file, written by the same run) \u2500\u2500\u2500");for(let p of Object.keys(U))o.line(`from ${p.replace(/\.py$/,"")} import *`);o.blank(),o.blank()}else{o.line("# \u2500\u2500\u2500 Embedded runtime (@redocly/client-generator python runtime) \u2500\u2500\u2500");for(let p of Object.values(U)){let _=p.split(`
9
9
  `).filter(b=>!b.startsWith("from __future__")&&!b.startsWith("from ._")).join(`
10
10
  `).trim();o.line(_),o.blank()}o.blank()}let d=pe(e,new Set(l?.unions.keys()));if(d.length>0){o.line("# Discriminated unions dispatch by their property inside decode().");for(let p of d)o.line(p);o.blank()}o.block("def _safe_json(response: httpx.Response) -> Any:",()=>{o.block("try:",()=>{o.line("return response.json()")}),o.block("except Exception:",()=>{o.line("return None")})}),o.blank();let u=new Map;for(let{op:p,ident:_}of I(e))u.set(_,ie(a?.get(p.name)?.spec));o.line("_OPERATIONS = {"),o.indent(()=>{for(let{op:p,ident:_}of I(e)){let b={id:p.specName??p.name,method:p.method.toUpperCase(),path:p.path,...K(p,e).length>0?{security:K(p,e)}:{},...u.get(_)!==void 0?{pagination:u.get(_)}:{}};o.line(`"${_}": ${ae(b)},`)}}),o.line("}"),o.blank(),o.blank();let $=s.serverUrl??e.serverUrl??"";V(o,e,c,!1,u,$,i),V(o,e,c,!0,u,$,i);let h={path:Q(n.path),content:o.toString()};if(s.runtime!=="module")return[h];let g=t.map(p=>`# ${p}`).join(`
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a}from"./7GYVSRCX.js";import"./WEAET3FR.js";import"./FPOO3NKZ.js";import"./RD64AQAZ.js";import"./UZQGV3C7.js";import"./WZXA5XPB.js";import"./UWKKXZOE.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as swrGenerator};
7
+ import{a}from"./4BHLSA4G.js";import"./BST7IEDL.js";import"./W3YACFG2.js";import"./T2XFX5KV.js";import"./MEVUBG5J.js";import"./WZXA5XPB.js";import"./UWKKXZOE.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as swrGenerator};
@@ -5397,4 +5397,4 @@ async function runSingle(
5397
5397
  }
5398
5398
  return fail(1, detail);
5399
5399
  }
5400
- }`},S=["ApiError","ApiErrorLike","AuthCredentials","BodyMethod","Capabilities","CliAuthScheme","CliCommand","CliFlag","CliGlobals","CliInvocation","CliWiring","Client","ClientConfig","ClientCore","CommandContext","CommandSource","CustomCommand","Envelope","EnvelopeResult","EnvelopeResultForKnownInit","FRAME_DELIMITER","GLOBAL_FLAGS","HeadersOf","IDEMPOTENT_METHODS","LAYERS","LAYER_OF","LinkPageCall","Middleware","NoRequiredKeys","OperationArgs","OperationContext","OperationDescriptor","OperationMethodIdentity","OpsShape","PageOf","Paginated","PaginationSpec","ParamSpec","ParseAs","QueryStyle","QueryValue","RequestContext","RequestOptions","ResolvedCommand","ResponseHeaderSpec","Result","RetryConfig","RetryContext","RetryStrategy","SecuritySpec","SendCapabilities","ServerSentEvent","SseOptions","SseParseError","TRANSIENT_STATUS","ThrowMethod","TimeoutError","TokenProvider","abortError","acceptFor","buildUrl","callInputs","coerceResponseHeader","commandContract","constantCase","createClientCore","defaultRetryOn","encodeBase64","encodeReserved","execute","groupSlug","inputOf","invokedName","isConfigured","items","itemsByLink","kindFor","linkNext","linkPageCall","loadBody","mergeSetup","middlewareChain","namespaceArgs","normalizeCommands","oneLine","pageCall","pages","pagesByLink","paginateCapability","parse","parseInvocation","parseSseFrame","prepareRequest","queryStyles","readEnvelopeHeaders","readError","redactHeaders","renderComposedHelp","renderHelp","resolveAuth","resolvePointer","resolveToken","retryDelay","runCli","runSingle","runSources","send","shadowedCommandName","sleep","splitArgs","sse","stringHeaders","substitutePath","toFormData","toHeaderRecord"];var j=["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"],$=["z","http","HttpResponse","handlers","faker","queryOptions","useSWR","useSWRMutation","__Writable"],N=["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"],w;function Q(){return w===void 0&&(w=new Set([...j,...$,...N,...S])),w}var A={name:"@redocly/client-generator",version:"0.4.11",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"},"./printers/python":{types:"./lib/printers/python.d.ts",import:"./lib/printers/python.js",default:"./lib/printers/python.js"},"./printers/go":{types:"./lib/printers/go.d.ts",import:"./lib/printers/go.js",default:"./lib/printers/go.js"},"./printers/php":{types:"./lib/printers/php.d.ts",import:"./lib/printers/php.js",default:"./lib/printers/php.js"},"./printers/typescript":{types:"./lib/printers/typescript.d.ts",import:"./lib/printers/typescript.js",default:"./lib/printers/typescript.js"},"./printers":{types:"./lib/printers/index.d.ts",import:"./lib/printers/index.js",default:"./lib/printers/index.js"},"./contracts/typescript":{types:"./lib/contracts/typescript.d.ts",import:"./lib/contracts/typescript.js",default:"./lib/contracts/typescript.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":"2.53.2"},peerDependencies:{typescript:">=5.5.0"},peerDependenciesMeta:{typescript:{optional:!0}},devDependencies:{typescript:"6.0.2"},files:["lib","eject-assets"]};var ee=A.version;function T(e){let n=/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(e.trim());return n===null?void 0:[Number(n[1]),Number(n[2]),Number(n[3])]}function v(e,n){return e[0]-n[0]||e[1]-n[1]||e[2]-n[2]}function ne(e,n){let s=/^[\^~]|^>=/.exec(n.trim())?.[0]??"",r=T(n.trim().slice(s.length)),a=T(e);if(!(r===void 0||a===void 0))return v(a,r)<0?!1:s===">="?!0:s===""?v(a,r)===0:s==="~"?a[0]===r[0]&&a[1]===r[1]:r[0]!==0?a[0]===r[0]:r[1]!==0?a[0]===0&&a[1]===r[1]:v(a,r)===0}export{R as a,H as b,G as c,W as d,j as e,Q as f,ee as g,ne as h};
5400
+ }`},S=["ApiError","ApiErrorLike","AuthCredentials","BodyMethod","Capabilities","CliAuthScheme","CliCommand","CliFlag","CliGlobals","CliInvocation","CliWiring","Client","ClientConfig","ClientCore","CommandContext","CommandSource","CustomCommand","Envelope","EnvelopeResult","EnvelopeResultForKnownInit","FRAME_DELIMITER","GLOBAL_FLAGS","HeadersOf","IDEMPOTENT_METHODS","LAYERS","LAYER_OF","LinkPageCall","Middleware","NoRequiredKeys","OperationArgs","OperationContext","OperationDescriptor","OperationMethodIdentity","OpsShape","PageOf","Paginated","PaginationSpec","ParamSpec","ParseAs","QueryStyle","QueryValue","RequestContext","RequestOptions","ResolvedCommand","ResponseHeaderSpec","Result","RetryConfig","RetryContext","RetryStrategy","SecuritySpec","SendCapabilities","ServerSentEvent","SseOptions","SseParseError","TRANSIENT_STATUS","ThrowMethod","TimeoutError","TokenProvider","abortError","acceptFor","buildUrl","callInputs","coerceResponseHeader","commandContract","constantCase","createClientCore","defaultRetryOn","encodeBase64","encodeReserved","execute","groupSlug","inputOf","invokedName","isConfigured","items","itemsByLink","kindFor","linkNext","linkPageCall","loadBody","mergeSetup","middlewareChain","namespaceArgs","normalizeCommands","oneLine","pageCall","pages","pagesByLink","paginateCapability","parse","parseInvocation","parseSseFrame","prepareRequest","queryStyles","readEnvelopeHeaders","readError","redactHeaders","renderComposedHelp","renderHelp","resolveAuth","resolvePointer","resolveToken","retryDelay","runCli","runSingle","runSources","send","shadowedCommandName","sleep","splitArgs","sse","stringHeaders","substitutePath","toFormData","toHeaderRecord"];var j=["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"],$=["z","http","HttpResponse","handlers","faker","queryOptions","useSWR","useSWRMutation","__Writable"],N=["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"],w;function Q(){return w===void 0&&(w=new Set([...j,...$,...N,...S])),w}var A={name:"@redocly/client-generator",version:"0.4.12",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"},"./printers/python":{types:"./lib/printers/python.d.ts",import:"./lib/printers/python.js",default:"./lib/printers/python.js"},"./printers/go":{types:"./lib/printers/go.d.ts",import:"./lib/printers/go.js",default:"./lib/printers/go.js"},"./printers/php":{types:"./lib/printers/php.d.ts",import:"./lib/printers/php.js",default:"./lib/printers/php.js"},"./printers/typescript":{types:"./lib/printers/typescript.d.ts",import:"./lib/printers/typescript.js",default:"./lib/printers/typescript.js"},"./printers":{types:"./lib/printers/index.d.ts",import:"./lib/printers/index.js",default:"./lib/printers/index.js"},"./contracts/typescript":{types:"./lib/contracts/typescript.d.ts",import:"./lib/contracts/typescript.js",default:"./lib/contracts/typescript.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":"2.53.3"},peerDependencies:{typescript:">=5.5.0"},peerDependenciesMeta:{typescript:{optional:!0}},devDependencies:{typescript:"6.0.2"},files:["lib","eject-assets"]};var ee=A.version;function T(e){let n=/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(e.trim());return n===null?void 0:[Number(n[1]),Number(n[2]),Number(n[3])]}function v(e,n){return e[0]-n[0]||e[1]-n[1]||e[2]-n[2]}function ne(e,n){let s=/^[\^~]|^>=/.exec(n.trim())?.[0]??"",r=T(n.trim().slice(s.length)),a=T(e);if(!(r===void 0||a===void 0))return v(a,r)<0?!1:s===">="?!0:s===""?v(a,r)===0:s==="~"?a[0]===r[0]&&a[1]===r[1]:r[0]!==0?a[0]===r[0]:r[1]!==0?a[0]===0&&a[1]===r[1]:v(a,r)===0}export{R as a,H as b,G as c,W as d,j as e,Q as f,ee as g,ne as h};
@@ -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,v as Vz}from"./6LHYZTIP.js";import{b as g1}from"./IMWIJK4I.js";import{a as ere,b as tre}from"./KXHIHQWX.js";import{a as $ne}from"./RS5PUOTT.js";import"./32XCOMOR.js";import{d as Uz,e as Hz}from"./LUCPX66E.js";import{L as Bz,P as zz,S as VA,W as Cy,k as Zne,s as p1,v as Fz,w as Jne}from"./UWKKXZOE.js";import"./NEWT5A6S.js";import{a as Br,b as Dz,c as V,d as Qne,e as Uv,f as Kne}from"./RFWIIJFG.js";var Xz=V((Gz,Yz)=>{(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,v as Vz}from"./6LHYZTIP.js";import{b as g1}from"./IMWIJK4I.js";import{a as ere,b as tre}from"./KXHIHQWX.js";import{a as $ne}from"./RS5PUOTT.js";import"./32XCOMOR.js";import{d as Uz,e as Hz}from"./4RWMTNRF.js";import{L as Bz,P as zz,S as VA,W as Cy,k as Zne,s as p1,v as Fz,w as Jne}from"./UWKKXZOE.js";import"./NEWT5A6S.js";import{a as Br,b as Dz,c as V,d as Qne,e as Uv,f as Kne}from"./RFWIIJFG.js";var Xz=V((Gz,Yz)=>{(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$"),j=new RegExp("^"+o+i+"[^aeiouwxy]$"),re=/^(.+?[^aeiou])y$/,U=/^(.+?)(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)$/,ne=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,ue=/^(.+?)(s|t)(ion)$/,he=/^(.+?)e$/,Y=/ll$/,le=new RegExp("^"+o+i+"[^aeiouwxy]$"),de=function(ce){var Oe,pe,ke,se,we,De,at;if(ce.length<3)return ce;if(ke=ce.substr(0,1),ke=="y"&&(ce=ke.toUpperCase()+ce.substr(1)),se=O,we=k,se.test(ce)?ce=ce.replace(se,"$1$2"):we.test(ce)&&(ce=ce.replace(we,"$1$2")),se=R,we=N,se.test(ce)){var Ge=se.exec(ce);se=d,se.test(Ge[1])&&(se=H,ce=ce.replace(se,""))}else if(we.test(ce)){var Ge=we.exec(ce);Oe=Ge[1],we=T,we.test(Oe)&&(ce=Oe,we=z,De=$,at=j,we.test(ce)?ce=ce+"e":De.test(ce)?(se=H,ce=ce.replace(se,"")):at.test(ce)&&(ce=ce+"e"))}if(se=re,se.test(ce)){var Ge=se.exec(ce);Oe=Ge[1],ce=Oe+"i"}if(se=U,se.test(ce)){var Ge=se.exec(ce);Oe=Ge[1],pe=Ge[2],se=d,se.test(Oe)&&(ce=Oe+t[pe])}if(se=ie,se.test(ce)){var Ge=se.exec(ce);Oe=Ge[1],pe=Ge[2],se=d,se.test(Oe)&&(ce=Oe+n[pe])}if(se=ne,we=ue,se.test(ce)){var Ge=se.exec(ce);Oe=Ge[1],se=v,se.test(Oe)&&(ce=Oe)}else if(we.test(ce)){var Ge=we.exec(ce);Oe=Ge[1]+Ge[2],we=v,we.test(Oe)&&(ce=Oe)}if(se=he,se.test(ce)){var Ge=se.exec(ce);Oe=Ge[1],se=v,we=x,De=le,(se.test(Oe)||we.test(Oe)&&!De.test(Oe))&&(ce=Oe)}return se=Y,we=v,se.test(ce)&&we.test(ce)&&(se=H,ce=ce.replace(se,"")),ke=="y"&&(ce=ke.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],j=z[R],re=Object.keys(j),U=H+"/"+R,ie=new e.Set(re);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(K,Le){return K+Le}),!o[U]){for(var ne=0;ne<re.length;ne++){var ue=re[ne],he=new e.FieldRef(ue,R),Y=j[ue],le;(le=r[he])===void 0?r[he]=new e.MatchData(H,R,Y):le.add(H,R,Y)}o[U]=!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),Oe=[],pe=Object.create(null);if(n.isNegated()){ce=Object.keys(this.fieldVectors);for(var l=0;l<ce.length;l++){var he=ce[l],ke=e.FieldRef.fromString(he);r[he]=new e.MatchData}}for(var l=0;l<ce.length;l++){var ke=e.FieldRef.fromString(ce[l]),se=ke.docRef;if(de.contains(se)&&!ve.contains(se)){var we=this.fieldVectors[ke],De=i[ke.fieldName].similarity(we),at;if((at=pe[se])!==void 0)at.score+=De,at.matchData.combine(r[ke]);else{var Ge={ref:se,score:De,matchData:r[ke]};pe[se]=Ge,Oe.push(Ge)}}}return Oe.sort(function(xe,Be){return Be.score-xe.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 Gz=="object"?Yz.exports=n():t.lunr=n()})(this,function(){return e})})()});var Qz=V((QFe,qz)=>{"use strict";function nre(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(t){setTimeout(t,0)}}qz.exports=nre()});var Jz=V((KFe,Zz)=>{"use strict";var Kz=Qz();Zz.exports=function(t,n){if(t){n.then(function(r){Kz(function(){t(null,r)})},function(r){Kz(function(){t(r)})});return}else return n}});var i5=V((ZFe,r5)=>{r5.exports=TS;TS.default=TS;TS.stable=t5;TS.stableStringify=t5;var m1="[...]",$z="[Circular]",Ay=[],Py=[];function e5(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function TS(e,t,n,r){typeof r>"u"&&(r=e5()),GA(e,"",0,[],void 0,0,r);var i;try{Py.length===0?i=JSON.stringify(e,t,n):i=JSON.stringify(e,n5(t),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ay.length!==0;){var o=Ay.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function Hv(e,t,n,r){var i=Object.getOwnPropertyDescriptor(r,n);i.get!==void 0?i.configurable?(Object.defineProperty(r,n,{value:e}),Ay.push([r,n,t,i])):Py.push([t,n,e]):(r[n]=e,Ay.push([r,n,t]))}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){Hv($z,e,t,i);return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){Hv(m1,e,t,i);return}if(typeof s.edgesLimit<"u"&&n+1>s.edgesLimit){Hv(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=Object.keys(e);for(a=0;a<l.length;a++){var c=l[a];GA(e[c],c,a,r,e,o,s)}}r.pop()}}function rre(e,t){return e<t?-1:e>t?1:0}function t5(e,t,n,r){typeof r>"u"&&(r=e5());var i=YA(e,"",0,[],void 0,0,r)||e,o;try{Py.length===0?o=JSON.stringify(i,t,n):o=JSON.stringify(i,n5(t),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ay.length!==0;){var s=Ay.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return o}function YA(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){Hv($z,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){Hv(m1,e,t,i);return}if(typeof s.edgesLimit<"u"&&n+1>s.edgesLimit){Hv(m1,e,t,i);return}if(r.push(e),Array.isArray(e))for(a=0;a<e.length;a++)YA(e[a],a,a,r,e,o,s);else{var l={},c=Object.keys(e).sort(rre);for(a=0;a<c.length;a++){var y=c[a];YA(e[y],y,a,r,e,o,s),l[y]=e[y]}if(typeof i<"u")Ay.push([i,t,e]),i[t]=l;else return l}r.pop()}}function n5(e){return e=typeof e<"u"?e:function(t,n){return n},function(t,n){if(Py.length>0)for(var r=0;r<Py.length;r++){var i=Py[r];if(i[1]===t&&i[0]===n){n=i[2],Py.splice(r,1);break}}return e.call(this,t,n)}}});var s5=V((JFe,o5)=>{o5.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=ke=se=we=De=s}function T(xe,Be){for(key in Be)Be.hasOwnProperty(key)&&(xe[key]=Be[key])}function O(xe){return parseFloat(xe)||0}function k(){r={top:t.pageYOffset,left:t.pageXOffset}}function R(){if(t.pageXOffset!=r.left){k(),ke();return}t.pageYOffset!=r.top&&(k(),H())}function N(xe){setTimeout(function(){t.pageYOffset!=r.top&&(r.top=t.pageYOffset,H())},0)}function H(){for(var xe=n.length-1;xe>=0;xe--)z(n[xe])}function z(xe){if(xe.inited){var Be=r.top<=xe.limit.start?0:r.top>=xe.limit.end?2:1;xe.mode!=Be&&ne(xe,Be)}}function $(){for(var xe=n.length-1;xe>=0;xe--)if(n[xe].inited){var Be=Math.abs(le(n[xe].clone)-n[xe].docOffsetTop),L=Math.abs(n[xe].parent.node.offsetHeight-n[xe].parent.height);if(Be>=2||L>=2)return!1}return!0}function j(xe){isNaN(parseFloat(xe.computed.top))||xe.isCell||(xe.inited=!0,xe.clone||ue(xe),xe.parent.computed.position!="absolute"&&xe.parent.computed.position!="relative"&&(xe.parent.node.style.position="relative"),z(xe),xe.parent.height=xe.parent.node.offsetHeight,xe.docOffsetTop=le(xe.clone))}function re(xe){var Be=!0;xe.clone&&he(xe),T(xe.node.style,xe.css);for(var L=n.length-1;L>=0;L--)if(n[L].node!==xe.node&&n[L].parent.node===xe.parent.node){Be=!1;break}Be&&(xe.parent.node.style.position=xe.parent.css.position),xe.mode=-1}function U(){for(var xe=n.length-1;xe>=0;xe--)j(n[xe])}function ie(){for(var xe=n.length-1;xe>=0;xe--)re(n[xe])}function ne(xe,Be){var L=xe.node.style;switch(Be){case 0:L.position="absolute",L.left=xe.offset.left+"px",L.right=xe.offset.right+"px",L.top=xe.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=xe.box.left+"px",L.right=xe.box.right+"px",L.top=xe.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=xe.offset.left+"px",L.right=xe.offset.right+"px",L.top="auto",L.bottom=0,L.width="auto",L.marginLeft=0,L.marginRight=0;break}xe.mode=Be}function ue(xe){xe.clone=document.createElement("div");var Be=xe.node.nextSibling||xe.node,L=xe.clone.style;L.height=xe.height+"px",L.width=xe.width+"px",L.marginTop=xe.computed.marginTop,L.marginBottom=xe.computed.marginBottom,L.marginLeft=xe.computed.marginLeft,L.marginRight=xe.computed.marginRight,L.padding=L.border=L.borderSpacing=0,L.fontSize="1em",L.position="static",L.cssFloat=xe.computed.cssFloat,xe.node.parentNode.insertBefore(xe.clone,Be)}function he(xe){xe.clone.parentNode.removeChild(xe.clone),xe.clone=void 0}function Y(xe){var Be=getComputedStyle(xe),L=xe.parentNode,K=getComputedStyle(L),Le=xe.style.position;xe.style.position="relative";var $e={top:Be.top,marginTop:Be.marginTop,marginBottom:Be.marginBottom,marginLeft:Be.marginLeft,marginRight:Be.marginRight,cssFloat:Be.cssFloat},_e={top:O(Be.top),marginBottom:O(Be.marginBottom),paddingLeft:O(Be.paddingLeft),paddingRight:O(Be.paddingRight),borderLeftWidth:O(Be.borderLeftWidth),borderRightWidth:O(Be.borderRightWidth)};xe.style.position=Le;var te={position:xe.style.position,top:xe.style.top,bottom:xe.style.bottom,left:xe.style.left,right:xe.style.right,width:xe.style.width,marginTop:xe.style.marginTop,marginLeft:xe.style.marginLeft,marginRight:xe.style.marginRight},q=de(xe),Ie=de(L),Ee={node:L,css:{position:L.style.position},computed:{position:K.position},numeric:{borderLeftWidth:O(K.borderLeftWidth),borderRightWidth:O(K.borderRightWidth),borderTopWidth:O(K.borderTopWidth),borderBottomWidth:O(K.borderBottomWidth)}},nt={node:xe,box:{left:q.win.left,right:o.clientWidth-q.win.right},offset:{top:q.win.top-Ie.win.top-Ee.numeric.borderTopWidth,left:q.win.left-Ie.win.left-Ee.numeric.borderLeftWidth,right:-q.win.right+Ie.win.right-Ee.numeric.borderRightWidth},css:te,isCell:Be.display=="table-cell",computed:$e,numeric:_e,width:q.win.right-q.win.left,height:q.win.bottom-q.win.top,mode:-1,inited:!1,parent:Ee,limit:{start:q.doc.top-_e.top,end:Ie.doc.top+L.offsetHeight-Ee.numeric.borderBottomWidth-xe.offsetHeight-_e.top-_e.marginBottom}};return nt}function le(xe){for(var Be=0;xe;)Be+=xe.offsetTop,xe=xe.offsetParent;return Be}function de(xe){var Be=xe.getBoundingClientRect();return{doc:{top:Be.top+t.pageYOffset,left:Be.left+t.pageXOffset},win:Be}}function ve(){a=setInterval(function(){!$()&&ke()},500)}function ce(){clearInterval(a)}function Oe(){i&&(document[l]?ce():ve())}function pe(){i||(k(),U(),t.addEventListener("scroll",R),t.addEventListener("wheel",N),t.addEventListener("resize",ke),t.addEventListener("orientationchange",ke),e.addEventListener(c,Oe),ve(),i=!0)}function ke(){if(i){ie();for(var xe=n.length-1;xe>=0;xe--)n[xe]=Y(n[xe].node);U()}}function se(){t.removeEventListener("scroll",R),t.removeEventListener("wheel",N),t.removeEventListener("resize",ke),t.removeEventListener("orientationchange",ke),e.removeEventListener(c,Oe),ce(),i=!1}function we(){se(),ie()}function De(){for(we();n.length;)n.pop()}function at(xe){for(var Be=n.length-1;Be>=0;Be--)if(n[Be].node===xe)return;var L=Y(xe);n.push(L),i?j(L):pe()}function Ge(xe){for(var Be=n.length-1;Be>=0;Be--)n[Be].node===xe&&(re(n[Be]),n.splice(Be,1))}return{stickies:n,add:at,remove:Ge,init:pe,rebuild:ke,pause:se,stop:we,kill:De}})});var nr=V(sa=>{"use strict";var XA=Symbol.for("yaml.alias"),a5=Symbol.for("yaml.document"),y1=Symbol.for("yaml.map"),l5=Symbol.for("yaml.pair"),qA=Symbol.for("yaml.scalar"),b1=Symbol.for("yaml.seq"),ep=Symbol.for("yaml.node.type"),ire=e=>!!e&&typeof e=="object"&&e[ep]===XA,ore=e=>!!e&&typeof e=="object"&&e[ep]===a5,sre=e=>!!e&&typeof e=="object"&&e[ep]===y1,are=e=>!!e&&typeof e=="object"&&e[ep]===l5,c5=e=>!!e&&typeof e=="object"&&e[ep]===qA,lre=e=>!!e&&typeof e=="object"&&e[ep]===b1;function u5(e){if(e&&typeof e=="object")switch(e[ep]){case y1:case b1:return!0}return!1}function cre(e){if(e&&typeof e=="object")switch(e[ep]){case XA:case y1:case qA:case b1:return!0}return!1}var ure=e=>(c5(e)||u5(e))&&!!e.anchor;sa.ALIAS=XA;sa.DOC=a5;sa.MAP=y1;sa.NODE_TYPE=ep;sa.PAIR=l5;sa.SCALAR=qA;sa.SEQ=b1;sa.hasAnchor=ure;sa.isAlias=ire;sa.isCollection=u5;sa.isDocument=ore;sa.isMap=sre;sa.isNode=cre;sa.isPair=are;sa.isScalar=c5;sa.isSeq=lre});var kS=V(QA=>{"use strict";var Es=nr(),hc=Symbol("break visit"),f5=Symbol("skip children"),Wd=Symbol("remove node");function v1(e,t){let n=d5(t);Es.isDocument(e)?Wv(null,e.contents,n,Object.freeze([e]))===Wd&&(e.contents=null):Wv(null,e,n,Object.freeze([]))}v1.BREAK=hc;v1.SKIP=f5;v1.REMOVE=Wd;function Wv(e,t,n,r){let i=h5(e,t,n,r);if(Es.isNode(i)||Es.isPair(i))return p5(e,r,i),Wv(e,i,n,r);if(typeof i!="symbol"){if(Es.isCollection(t)){r=Object.freeze(r.concat(t));for(let o=0;o<t.items.length;++o){let s=Wv(o,t.items[o],n,r);if(typeof s=="number")o=s-1;else{if(s===hc)return hc;s===Wd&&(t.items.splice(o,1),o-=1)}}}else if(Es.isPair(t)){r=Object.freeze(r.concat(t));let o=Wv("key",t.key,n,r);if(o===hc)return hc;o===Wd&&(t.key=null);let s=Wv("value",t.value,n,r);if(s===hc)return hc;s===Wd&&(t.value=null)}}return i}async function w1(e,t){let n=d5(t);Es.isDocument(e)?await jv(null,e.contents,n,Object.freeze([e]))===Wd&&(e.contents=null):await jv(null,e,n,Object.freeze([]))}w1.BREAK=hc;w1.SKIP=f5;w1.REMOVE=Wd;async function jv(e,t,n,r){let i=await h5(e,t,n,r);if(Es.isNode(i)||Es.isPair(i))return p5(e,r,i),jv(e,i,n,r);if(typeof i!="symbol"){if(Es.isCollection(t)){r=Object.freeze(r.concat(t));for(let o=0;o<t.items.length;++o){let s=await jv(o,t.items[o],n,r);if(typeof s=="number")o=s-1;else{if(s===hc)return hc;s===Wd&&(t.items.splice(o,1),o-=1)}}}else if(Es.isPair(t)){r=Object.freeze(r.concat(t));let o=await jv("key",t.key,n,r);if(o===hc)return hc;o===Wd&&(t.key=null);let s=await jv("value",t.value,n,r);if(s===hc)return hc;s===Wd&&(t.value=null)}}return i}function d5(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 h5(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(Es.isMap(t))return n.Map?.(e,t,r);if(Es.isSeq(t))return n.Seq?.(e,t,r);if(Es.isPair(t))return n.Pair?.(e,t,r);if(Es.isScalar(t))return n.Scalar?.(e,t,r);if(Es.isAlias(t))return n.Alias?.(e,t,r)}function p5(e,t,n){let r=t[t.length-1];if(Es.isCollection(r))r.items[e]=n;else if(Es.isPair(r))e==="key"?r.key=n:r.value=n;else if(Es.isDocument(r))r.contents=n;else{let i=Es.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}QA.visit=v1;QA.visitAsync=w1});var KA=V(m5=>{"use strict";var g5=nr(),fre=kS(),dre={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},hre=e=>e.replace(/[!,[\]{}]/g,t=>dre[t]),CS=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+hre(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&&g5.isNode(t.contents)){let o={};fre.visit(t.contents,(s,a)=>{g5.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
  `)}};CS.defaultYaml={explicit:!1,version:"1.2"};CS.defaultTags={"!!":"tag:yaml.org,2002:"};m5.Directives=CS});var S1=V(PS=>{"use strict";var y5=nr(),pre=kS();function gre(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 b5(e){let t=new Set;return pre.visit(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function v5(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function mre(e,t){let n=[],r=new Map,i=null;return{onAnchor:o=>{n.push(o),i??(i=b5(e));let s=v5(t,i);return i.add(s),s},setAnchors:()=>{for(let o of n){let s=r.get(o);if(typeof s=="object"&&s.anchor&&(y5.isScalar(s.node)||y5.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}}PS.anchorIsValid=gre;PS.anchorNames=b5;PS.createNodeAnchors=mre;PS.findNewAnchor=v5});var ZA=V(w5=>{"use strict";function AS(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=AS(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=AS(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=AS(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=AS(e,r,i,o);s===void 0?delete r[i]:s!==o&&(r[i]=s)}return e.call(t,n,r)}w5.applyReviver=AS});var Bg=V(x5=>{"use strict";var yre=nr();function S5(e,t,n){if(Array.isArray(e))return e.map((r,i)=>S5(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!yre.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}x5.toJS=S5});var x1=V(_5=>{"use strict";var bre=ZA(),E5=nr(),vre=Bg(),JA=class{constructor(t){Object.defineProperty(this,E5.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(!E5.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=vre.toJS(this,"",s);if(typeof i=="function")for(let{count:l,res:c}of s.anchors.values())i(c,l);return typeof o=="function"?bre.applyReviver(o,{"":a},"",a):a}};_5.NodeBase=JA});var RS=V(O5=>{"use strict";var wre=S1(),Sre=kS(),Vv=nr(),xre=x1(),Ere=Bg(),$A=class extends xre.NodeBase{constructor(t){super(Vv.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=[],Sre.visit(t,{Node:(o,s)=>{(Vv.isAlias(s)||Vv.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||(Ere.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(wre.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(Vv.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Vv.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(Vv.isPair(t)){let r=E1(e,t.key,n),i=E1(e,t.value,n);return Math.max(r,i)}return 1}O5.Alias=$A});var os=V(eR=>{"use strict";var _re=nr(),Ore=x1(),Tre=Bg(),kre=e=>!e||typeof e!="function"&&typeof e!="object",zg=class extends Ore.NodeBase{constructor(t){super(_re.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:Tre.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";eR.Scalar=zg;eR.isScalarValue=kre});var IS=V(k5=>{"use strict";var Cre=RS(),Ry=nr(),T5=os(),Pre="tag:yaml.org,2002:";function Are(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 Rre(e,t,n){if(Ry.isDocument(e)&&(e=e.contents),Ry.isNode(e))return e;if(Ry.isPair(e)){let d=n.schema[Ry.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 Cre.Alias(l.anchor);l={anchor:null,node:null},a.set(e,l)}t?.startsWith("!!")&&(t=Pre+t.slice(2));let c=Are(e,t,s.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let d=new T5.Scalar(e);return l&&(l.node=d),d}c=e instanceof Map?s[Ry.MAP]:Symbol.iterator in Object(e)?s[Ry.SEQ]:s[Ry.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 T5.Scalar(e);return t?y.tag=t:c.default||(y.tag=c.tag),l&&(l.node=y),y}k5.createNode=Rre});var O1=V(_1=>{"use strict";var Ire=IS(),jd=nr(),Mre=x1();function tR(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 Ire.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 C5=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,nR=class extends Mre.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=>jd.isNode(r)||jd.isPair(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(C5(t))this.add(n);else{let[r,...i]=t,o=this.get(r,!0);if(jd.isCollection(o))o.addIn(i,n);else if(o===void 0&&this.schema)this.set(r,tR(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(jd.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&&jd.isScalar(o)?o.value:o:jd.isCollection(o)?o.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!jd.isPair(n))return!1;let r=n.value;return r==null||t&&jd.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 jd.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(jd.isCollection(o))o.setIn(i,n);else if(o===void 0&&this.schema)this.set(r,tR(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};_1.Collection=nR;_1.collectionFromPath=tR;_1.isEmptyPath=C5});var MS=V(T1=>{"use strict";var Lre=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function rR(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Nre=(e,t,n)=>e.endsWith(`
10
10
  `)?rR(n,t):n.includes(`
@@ -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{h as g}from"./FPOO3NKZ.js";import{k as u,l as m}from"./RD64AQAZ.js";import{c as C,d as j}from"./UZQGV3C7.js";import{W as b}from"./UWKKXZOE.js";import{a as S,b as k}from"./UW4UC7ZI.js";import{join as $}from"node:path";function h(r){return(r??"").replace(/\s+/g," ").trim().replace(/\\/g,"\\\\").replace(/\|/g,"\\|")}function v(r){return[r.group===void 0?void 0:u(r.group),r.name].filter(Boolean).join(" ")}function N(r,e){return[r,v(e),...e.positionals.map(o=>`<${o.name}>`),...e.flags.filter(o=>o.required).map(o=>`--${o.name} <${o.type}>`),...e.body?[e.body.required?"--json '<json>'":"[--json '<json>']"]:[]].filter(o=>o!=="").join(" ")}function T(r,e){r.line("| Flag | Type | Required | Description |"),r.line("| ---- | ---- | -------- | ----------- |");for(let n of e){let o=[h(n.description),n.enum===void 0?"":`One of ${n.enum.map(t=>`\`${t}\``).join(", ")}.`,n.type==="array"?"Repeat the flag for multiple values.":""].filter(t=>t!=="").join(" ");r.line(`| \`--${n.name}\` | ${n.type} | ${n.required?"yes":"no"} | ${o} |`)}r.blank()}function D(r,e,n){if(r.line(`### \`${v(e)}\``),r.blank(),e.summary!==void 0&&(r.line(h(e.summary)),r.blank()),r.line(`\`${e.method} ${e.path}\``),r.blank(),r.line("```sh"),r.line(N(n.name,e)),r.line("```"),r.blank(),e.positionals.length>0){r.line("| Argument | Description |"),r.line("| -------- | ----------- |");for(let t of e.positionals)r.line(`| \`<${t.name}>\` | ${h(t.description)} |`);r.blank()}e.flags.length>0&&T(r,e.flags);let o=[e.body===void 0?"":`Takes a JSON body${e.body.required?" (required)":""}: \`--json '<json>'\`, \`--json @file.json\`, or \`--json @-\` for stdin.`,e.unsupportedBody===void 0?"":`Takes a \`${e.unsupportedBody}\` body, which the CLI cannot build \u2014 call this operation through the generated client instead.`,e.paginated===!0?"Paginated: `--page-all` follows every page, printing one JSON page per line.":"",e.sse===!0?"Streams server-sent events as one JSON object per line.":"",e.blob===!0?"Returns binary content, so `--output <path>` is required.":""].filter(t=>t!=="");for(let t of o)r.line(t);o.length>0&&r.blank()}function w(r,e){let n=new S;e.frontmatter&&(n.line("---"),n.line(`title: ${e.title}`),n.line("---"),n.blank()),n.line(`# ${e.title}`),n.blank(),n.line(`Generated command-line reference for \`${e.name}\`, produced from the API description by \`redocly generate-client\`.`),n.line("Re-run generation to update it \u2014 this file is not hand-edited."),n.blank(),n.line("## Usage"),n.blank(),n.line("```sh"),n.line(`${e.name} <command> [flags]`),n.line(`${e.name} --help`),n.line(`${e.name} schema <command> # request/response schemas`),n.line("```"),n.blank(),n.line("Install the file under any `bin` name: the command takes that name, and the credential variables below do not change."),n.blank(),n.line("## Global flags"),n.blank(),n.line("| Flag | Description |"),n.line("| ---- | ----------- |");let o=e.schemes.some(i=>i.kind==="bearer");for(let[i,s]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."],...o?[["--token <token>","Bearer token, overriding the environment."]]:[],["--json <json\\|@file\\|@->","Request body, inline or from a file or stdin."]])n.line(`| \`${i}\` | ${s} |`);n.blank();let t=m(e.name);if(n.line("## Credentials"),n.blank(),e.schemes.length===0)n.line("The description declares no security schemes, so no credentials are read.");else{n.line("Credentials come from the environment:"),n.blank(),n.line("| Scheme | Variable |"),n.line("| ------ | -------- |");for(let i of e.schemes){let s=i.kind==="bearer"?`\`${t}_TOKEN\` (or \`--token\`)`:i.kind==="basic"?`\`${t}_USERNAME\` and \`${t}_PASSWORD\``:`\`${t}_API_KEY_${m(i.key)}\``;n.line(`| ${i.kind} (\`${i.key}\`) | ${s} |`)}}n.blank(),n.line("## Exit codes"),n.blank(),n.line("| Code | Meaning |"),n.line("| ---- | ------- |");for(let[i,s]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`)"]])n.line(`| ${i} | ${s} |`);n.blank(),n.line("Errors print one JSON object to stderr, so stdout stays clean for piping."),n.blank();let a=[...new Set(r.map(i=>i.group))];for(let i of a){let s=r.filter(l=>l.group===i);i===void 0?(n.line("## Commands"),n.blank()):(n.line(`## ${i}`),n.blank(),n.line(`Addressed as \`${e.name} ${u(i)} <command>\`.`),n.blank());for(let l of s)D(n,l,e)}return n.toString().replace(/\n{3,}/g,`
7
+ import{h as g}from"./W3YACFG2.js";import{k as u,l as m}from"./T2XFX5KV.js";import{c as C,d as j}from"./MEVUBG5J.js";import{W as b}from"./UWKKXZOE.js";import{a as S,b as k}from"./UW4UC7ZI.js";import{join as $}from"node:path";function h(r){return(r??"").replace(/\s+/g," ").trim().replace(/\\/g,"\\\\").replace(/\|/g,"\\|")}function v(r){return[r.group===void 0?void 0:u(r.group),r.name].filter(Boolean).join(" ")}function N(r,e){return[r,v(e),...e.positionals.map(o=>`<${o.name}>`),...e.flags.filter(o=>o.required).map(o=>`--${o.name} <${o.type}>`),...e.body?[e.body.required?"--json '<json>'":"[--json '<json>']"]:[]].filter(o=>o!=="").join(" ")}function T(r,e){r.line("| Flag | Type | Required | Description |"),r.line("| ---- | ---- | -------- | ----------- |");for(let n of e){let o=[h(n.description),n.enum===void 0?"":`One of ${n.enum.map(t=>`\`${t}\``).join(", ")}.`,n.type==="array"?"Repeat the flag for multiple values.":""].filter(t=>t!=="").join(" ");r.line(`| \`--${n.name}\` | ${n.type} | ${n.required?"yes":"no"} | ${o} |`)}r.blank()}function D(r,e,n){if(r.line(`### \`${v(e)}\``),r.blank(),e.summary!==void 0&&(r.line(h(e.summary)),r.blank()),r.line(`\`${e.method} ${e.path}\``),r.blank(),r.line("```sh"),r.line(N(n.name,e)),r.line("```"),r.blank(),e.positionals.length>0){r.line("| Argument | Description |"),r.line("| -------- | ----------- |");for(let t of e.positionals)r.line(`| \`<${t.name}>\` | ${h(t.description)} |`);r.blank()}e.flags.length>0&&T(r,e.flags);let o=[e.body===void 0?"":`Takes a JSON body${e.body.required?" (required)":""}: \`--json '<json>'\`, \`--json @file.json\`, or \`--json @-\` for stdin.`,e.unsupportedBody===void 0?"":`Takes a \`${e.unsupportedBody}\` body, which the CLI cannot build \u2014 call this operation through the generated client instead.`,e.paginated===!0?"Paginated: `--page-all` follows every page, printing one JSON page per line.":"",e.sse===!0?"Streams server-sent events as one JSON object per line.":"",e.blob===!0?"Returns binary content, so `--output <path>` is required.":""].filter(t=>t!=="");for(let t of o)r.line(t);o.length>0&&r.blank()}function w(r,e){let n=new S;e.frontmatter&&(n.line("---"),n.line(`title: ${e.title}`),n.line("---"),n.blank()),n.line(`# ${e.title}`),n.blank(),n.line(`Generated command-line reference for \`${e.name}\`, produced from the API description by \`redocly generate-client\`.`),n.line("Re-run generation to update it \u2014 this file is not hand-edited."),n.blank(),n.line("## Usage"),n.blank(),n.line("```sh"),n.line(`${e.name} <command> [flags]`),n.line(`${e.name} --help`),n.line(`${e.name} schema <command> # request/response schemas`),n.line("```"),n.blank(),n.line("Install the file under any `bin` name: the command takes that name, and the credential variables below do not change."),n.blank(),n.line("## Global flags"),n.blank(),n.line("| Flag | Description |"),n.line("| ---- | ----------- |");let o=e.schemes.some(i=>i.kind==="bearer");for(let[i,s]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."],...o?[["--token <token>","Bearer token, overriding the environment."]]:[],["--json <json\\|@file\\|@->","Request body, inline or from a file or stdin."]])n.line(`| \`${i}\` | ${s} |`);n.blank();let t=m(e.name);if(n.line("## Credentials"),n.blank(),e.schemes.length===0)n.line("The description declares no security schemes, so no credentials are read.");else{n.line("Credentials come from the environment:"),n.blank(),n.line("| Scheme | Variable |"),n.line("| ------ | -------- |");for(let i of e.schemes){let s=i.kind==="bearer"?`\`${t}_TOKEN\` (or \`--token\`)`:i.kind==="basic"?`\`${t}_USERNAME\` and \`${t}_PASSWORD\``:`\`${t}_API_KEY_${m(i.key)}\``;n.line(`| ${i.kind} (\`${i.key}\`) | ${s} |`)}}n.blank(),n.line("## Exit codes"),n.blank(),n.line("| Code | Meaning |"),n.line("| ---- | ------- |");for(let[i,s]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`)"]])n.line(`| ${i} | ${s} |`);n.blank(),n.line("Errors print one JSON object to stderr, so stdout stays clean for piping."),n.blank();let a=[...new Set(r.map(i=>i.group))];for(let i of a){let s=r.filter(l=>l.group===i);i===void 0?(n.line("## Commands"),n.blank()):(n.line(`## ${i}`),n.blank(),n.line(`Addressed as \`${e.name} ${u(i)} <command>\`.`),n.blank());for(let l of s)D(n,l,e)}return n.toString().replace(/\n{3,}/g,`
8
8
 
9
9
  `).trimEnd()+`
10
10
  `}function R(){return j["cli.ts"]}function x(){return C["cli.ts"]}var O="// Generated by @redocly/client-generator \u2014 do not edit by hand.\n// Source: OpenAPI description. Re-run `redocly generate-client` to update.";function q(r){return k.snake(r).replace(/_/g,"-")}function E(r){let e=r.schema,n=e.kind==="array"?"array":e.kind==="scalar"&&(e.scalar==="integer"||e.scalar==="number")?"number":e.kind==="scalar"&&e.scalar==="boolean"?"boolean":"string";return{name:q(r.name),param:r.name,type:n,required:r.required,...e.kind==="enum"?{enum:e.values.map(String)}:{},...r.description!==void 0?{description:r.description}:{}}}function F(r){let e=r.successResponses;return e.some(n=>n.contentType.toLowerCase().includes("json"))?!1:e.some(n=>n.contentType.startsWith("image/")||n.contentType==="application/octet-stream")}function M(r){return r.successResponses.find(e=>e.contentType.toLowerCase().includes("json"))?.schema}function U(r,e,n){if(n!=="flat")return{};let o=g(r,e.schemas);return"mergeBody"in o&&o.mergeBody?{merged:!0}:{}}function _(r,e,n){return n!=="flat"?{}:"collisions"in g(r,e.schemas)?{argsStyle:"grouped"}:{}}function f(r,e){let n=[];for(let o of r.services)for(let t of o.operations){let a=t.requestBody?.contentType.toLowerCase().includes("json")?t.requestBody:void 0,i=M(t);n.push({...t.tags.length>0?{group:t.tags[0]}:{},name:t.name,...t.summary!==void 0?{summary:t.summary}:{},method:t.method.toUpperCase(),path:t.path,positionals:t.pathParams.map(s=>({name:s.name,type:E(s).type,...s.description!==void 0?{description:s.description}:{}})),flags:t.queryParams.map(E),...a?{body:{required:a.required,...U(t,r,e.argsStyle)}}:{},...a===void 0&&t.requestBody!==void 0?{unsupportedBody:t.requestBody.contentType}:{},...e.pagination?.has(t.name)===!0?{paginated:!0}:{},..._(t,r,e.argsStyle),...t.sse!==void 0?{sse:!0}:{},...F(t)?{blob:!0}:{},...a!==void 0||i!==void 0?{schemas:{...a?{request:a.schema}:{},...i!==void 0?{response:i}:{}}}:{}})}return n}var P=`function isProcessEntry(): boolean {
@@ -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{c as a,d as b}from"./NU76FSGR.js";import"./UZQGV3C7.js";import"./WZXA5XPB.js";import"./UWKKXZOE.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{b as generateClient,a as runGenerators};
7
+ import{c as a,d as b}from"./GBTKUMLF.js";import"./MEVUBG5J.js";import"./WZXA5XPB.js";import"./UWKKXZOE.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{b as generateClient,a 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 C}from"./UZQGV3C7.js";import{c as w}from"./UWKKXZOE.js";import{a as H,e as q,g as P,h as g,k as E}from"./LD5MEXEL.js";import{join as ae}from"node:path";var j=class{code;constructor(r){this.code=r}};function A(e,r,n={}){let t=new Map(r.map(s=>[s.name,s.schema])),o=k(e,t,new Set,n.dateType??"string");return o===b?null:o}var b=Symbol("cycle");function J(e,r){if(e.kind==="union"){for(let t of e.members){let o=J(t,r);if(o)return o}return}if(e.kind!=="scalar")return;let n=e.metadata?.format;if(n==="binary")return new j("new Blob([])");if(r==="Date"){if(n==="date-time")return new j('new Date("2024-01-01T00:00:00Z")');if(n==="date")return new j('new Date("2024-01-01")')}}function I(e,r){let n=new Map,t=[],o=!1;for(let s of e){if(s.kind==="unknown")continue;let i=G(s,r);if(i?.kind!=="object"){t.push(s);continue}o=!0;for(let a of i.properties){let u=O(a.schema,r,new Set),c=n.get(a.name);(c===void 0||u>=c.rank)&&n.set(a.name,{schema:a.schema,required:a.required||(c?.required??!1),rank:u})}}return o?{merged:{kind:"object",properties:[...n.entries()].map(([s,i])=>({name:s,schema:i.schema,required:i.required}))},rest:t}:{merged:void 0,rest:t}}function G(e,r){let n=new Set,t=e;for(;t?.kind==="ref";){if(n.has(t.name))return;n.add(t.name),t=r.get(t.name)}return t}function O(e,r,n){switch(e.kind){case"literal":return 40;case"enum":return e.values.length===1?40:30;case"union":return Math.max(0,...e.members.map(t=>O(t,r,n)))-1;case"ref":{if(n.has(e.name))return 20;let t=r.get(e.name);return t===void 0?20:O(t,r,new Set(n).add(e.name))}case"null":case"unknown":return 10;default:return 20}}function k(e,r,n,t){let o=J(e,t);if(o)return o;let s=e.metadata,i=a=>a===null?e.kind==="null"||e.kind==="union"&&e.members.some(u=>u.kind==="null"):e.kind==="enum"?e.values.includes(a):e.kind==="literal"?a===e.value:!0;if(s?.example!==void 0&&i(s.example))return s.example;if(s?.default!==void 0&&i(s.default))return s.default;switch(e.kind){case"scalar":return K(e.scalar,s);case"array":{let a=k(e.items,r,n,t);return a===b?[]:[a]}case"object":return Object.fromEntries(e.properties.flatMap(a=>{let u=k(a.schema,r,n,t);return u===b?a.required?[[a.name,null]]:[]:[[a.name,u]]}));case"record":{let a=k(e.value,r,n,t);return a===b?{}:{key:a}}case"enum":return e.values[0];case"literal":return e.value;case"union":{for(let a of e.members){let u=k(a,r,n,t);if(u!==b)return u}return e.members.length>0?b:null}case"intersection":{let{merged:a,rest:u}=I(e.members,r),c=u.map(m=>k(m,r,n,t)).filter(m=>m!==b);if(a){let m=k(a,r,n,t),M=w(m)?m:{};for(let V of c)w(V)&&Object.assign(M,V);return M}let h=c.filter(w);return h.length>0?h.reduce((m,M)=>Object.assign(m,M),{}):c.length>0?c[0]:{}}case"omit":{let a=r.get(e.base);if(!a)return null;let u=k(a,r,n,t);if(w(u)){let c={...u};for(let h of e.keys)delete c[h];return c}return u}case"ref":{if(n.has(e.name))return b;let a=r.get(e.name);if(!a)return null;n.add(e.name);let u=k(a,r,n,t);return n.delete(e.name),u}case"null":case"unknown":return null}}function K(e,r){if(e==="boolean")return!0;if(e==="integer"||e==="number")return 0;switch(r?.format){case"email":return"user@example.com";case"uuid":return"00000000-0000-4000-8000-000000000000";case"date-time":return"2024-01-01T00:00:00Z";case"date":return"2024-01-01";case"uri":case"url":return"https://example.com";default:return"string"}}var f=e=>({kind:"expr",text:e}),d=e=>({kind:"object",entries:e});function l(e){return e.kind==="object"}function D(e,r){return l(e)?d([...e.entries,{spread:r}]):e}var L=" ";function x(e,r){switch(e.kind){case"expr":return e.text;case"wrap":return`${e.before}${x(e.value,r)}${e.after}`;case"array":{if(e.items.length===0)return"[]";let n=r+L;return`[
7
+ import{a as C}from"./MEVUBG5J.js";import{c as w}from"./UWKKXZOE.js";import{a as H,e as q,g as P,h as g,k as E}from"./LD5MEXEL.js";import{join as ae}from"node:path";var j=class{code;constructor(r){this.code=r}};function A(e,r,n={}){let t=new Map(r.map(s=>[s.name,s.schema])),o=k(e,t,new Set,n.dateType??"string");return o===b?null:o}var b=Symbol("cycle");function J(e,r){if(e.kind==="union"){for(let t of e.members){let o=J(t,r);if(o)return o}return}if(e.kind!=="scalar")return;let n=e.metadata?.format;if(n==="binary")return new j("new Blob([])");if(r==="Date"){if(n==="date-time")return new j('new Date("2024-01-01T00:00:00Z")');if(n==="date")return new j('new Date("2024-01-01")')}}function I(e,r){let n=new Map,t=[],o=!1;for(let s of e){if(s.kind==="unknown")continue;let i=G(s,r);if(i?.kind!=="object"){t.push(s);continue}o=!0;for(let a of i.properties){let u=O(a.schema,r,new Set),c=n.get(a.name);(c===void 0||u>=c.rank)&&n.set(a.name,{schema:a.schema,required:a.required||(c?.required??!1),rank:u})}}return o?{merged:{kind:"object",properties:[...n.entries()].map(([s,i])=>({name:s,schema:i.schema,required:i.required}))},rest:t}:{merged:void 0,rest:t}}function G(e,r){let n=new Set,t=e;for(;t?.kind==="ref";){if(n.has(t.name))return;n.add(t.name),t=r.get(t.name)}return t}function O(e,r,n){switch(e.kind){case"literal":return 40;case"enum":return e.values.length===1?40:30;case"union":return Math.max(0,...e.members.map(t=>O(t,r,n)))-1;case"ref":{if(n.has(e.name))return 20;let t=r.get(e.name);return t===void 0?20:O(t,r,new Set(n).add(e.name))}case"null":case"unknown":return 10;default:return 20}}function k(e,r,n,t){let o=J(e,t);if(o)return o;let s=e.metadata,i=a=>a===null?e.kind==="null"||e.kind==="union"&&e.members.some(u=>u.kind==="null"):e.kind==="enum"?e.values.includes(a):e.kind==="literal"?a===e.value:!0;if(s?.example!==void 0&&i(s.example))return s.example;if(s?.default!==void 0&&i(s.default))return s.default;switch(e.kind){case"scalar":return K(e.scalar,s);case"array":{let a=k(e.items,r,n,t);return a===b?[]:[a]}case"object":return Object.fromEntries(e.properties.flatMap(a=>{let u=k(a.schema,r,n,t);return u===b?a.required?[[a.name,null]]:[]:[[a.name,u]]}));case"record":{let a=k(e.value,r,n,t);return a===b?{}:{key:a}}case"enum":return e.values[0];case"literal":return e.value;case"union":{for(let a of e.members){let u=k(a,r,n,t);if(u!==b)return u}return e.members.length>0?b:null}case"intersection":{let{merged:a,rest:u}=I(e.members,r),c=u.map(m=>k(m,r,n,t)).filter(m=>m!==b);if(a){let m=k(a,r,n,t),M=w(m)?m:{};for(let V of c)w(V)&&Object.assign(M,V);return M}let h=c.filter(w);return h.length>0?h.reduce((m,M)=>Object.assign(m,M),{}):c.length>0?c[0]:{}}case"omit":{let a=r.get(e.base);if(!a)return null;let u=k(a,r,n,t);if(w(u)){let c={...u};for(let h of e.keys)delete c[h];return c}return u}case"ref":{if(n.has(e.name))return b;let a=r.get(e.name);if(!a)return null;n.add(e.name);let u=k(a,r,n,t);return n.delete(e.name),u}case"null":case"unknown":return null}}function K(e,r){if(e==="boolean")return!0;if(e==="integer"||e==="number")return 0;switch(r?.format){case"email":return"user@example.com";case"uuid":return"00000000-0000-4000-8000-000000000000";case"date-time":return"2024-01-01T00:00:00Z";case"date":return"2024-01-01";case"uri":case"url":return"https://example.com";default:return"string"}}var f=e=>({kind:"expr",text:e}),d=e=>({kind:"object",entries:e});function l(e){return e.kind==="object"}function D(e,r){return l(e)?d([...e.entries,{spread:r}]):e}var L=" ";function x(e,r){switch(e.kind){case"expr":return e.text;case"wrap":return`${e.before}${x(e.value,r)}${e.after}`;case"array":{if(e.items.length===0)return"[]";let n=r+L;return`[
8
8
  ${e.items.map((o,s)=>`${n}${x(o,n)}${s===e.items.length-1?"":","}`).join(`
9
9
  `)}
10
10
  ${r}]`}case"object":{if(e.entries.length===0)return"{}";let n=r+L;return`{
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a,b,c}from"./QJ4W6N5P.js";import"./2U6O26CV.js";import"./FPOO3NKZ.js";import"./RD64AQAZ.js";import"./UZQGV3C7.js";import"./WZXA5XPB.js";import"./UWKKXZOE.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{b as typescriptDocs,a as typescriptGenerator,c as typescriptSample};
7
+ import{a,b,c}from"./DFCB4ULY.js";import"./2U6O26CV.js";import"./W3YACFG2.js";import"./T2XFX5KV.js";import"./MEVUBG5J.js";import"./WZXA5XPB.js";import"./UWKKXZOE.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{b as typescriptDocs,a as typescriptGenerator,c as typescriptSample};
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a,b,c,d,e,f}from"./RGJTOYYC.js";import"./2U6O26CV.js";import"./RD64AQAZ.js";import"./UZQGV3C7.js";import"./WZXA5XPB.js";import"./UWKKXZOE.js";import"./NEWT5A6S.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{f as pythonDocs,d as pythonGenerator,c as pythonOptions,e as pythonSample,a as pythonType,b as renderPythonModels};
7
+ import{a,b,c,d,e,f}from"./JT5UMLP2.js";import"./2U6O26CV.js";import"./T2XFX5KV.js";import"./MEVUBG5J.js";import"./WZXA5XPB.js";import"./UWKKXZOE.js";import"./NEWT5A6S.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{f as pythonDocs,d as pythonGenerator,c as pythonOptions,e as pythonSample,a as pythonType,b as renderPythonModels};
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a}from"./DQLEE5LL.js";import"./WEAET3FR.js";import"./FPOO3NKZ.js";import"./RD64AQAZ.js";import"./UZQGV3C7.js";import"./WZXA5XPB.js";import"./UWKKXZOE.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as tanstackQueryGenerator};
7
+ import{a}from"./2LLR76SN.js";import"./BST7IEDL.js";import"./W3YACFG2.js";import"./T2XFX5KV.js";import"./MEVUBG5J.js";import"./WZXA5XPB.js";import"./UWKKXZOE.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as tanstackQueryGenerator};