@redocly/cli 2.56.0 → 2.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/THIRD_PARTY_NOTICES +14 -30
  2. package/lib/chunks/{ICOYFJR4.js → 2PGNW76R.js} +1 -1
  3. package/lib/chunks/3I7XLHPY.js +45 -0
  4. package/lib/chunks/{JADJJP6R.js → 3QGJWJKQ.js} +1 -1
  5. package/lib/chunks/{BH4SKQ6M.js → 4HG5PCQA.js} +1 -1
  6. package/lib/chunks/{N2FNYVCN.js → 4JBK2BSL.js} +1 -1
  7. package/lib/chunks/4PTNG4EI.js +7 -0
  8. package/lib/chunks/{NPBKCM7B.js → 4SXCDBB7.js} +1 -1
  9. package/lib/chunks/{DOJW7C4M.js → 52MXI4PU.js} +2 -2
  10. package/lib/chunks/{WUXDP2A3.js → 5FVKAWNE.js} +1 -1
  11. package/lib/chunks/{TVL6DMBV.js → 5UDC2SWY.js} +3 -3
  12. package/lib/chunks/64G5RPLP.js +7 -0
  13. package/lib/chunks/{MGMNYFOR.js → 65AQJO4M.js} +2 -2
  14. package/lib/chunks/{SH75MWAC.js → 664FDTDV.js} +1 -1
  15. package/lib/chunks/7EB22KXX.js +14 -0
  16. package/lib/chunks/{3R32Y5ZJ.js → 7XKYPQPI.js} +1 -1
  17. package/lib/chunks/{BDCNFVGZ.js → AOCVSFC3.js} +1 -1
  18. package/lib/chunks/{LPB2X45H.js → ARDTVDGR.js} +1 -1
  19. package/lib/chunks/{DSD57XD4.js → CWEET26O.js} +1 -1
  20. package/lib/chunks/{YJ2CV2FV.js → D7WNH6Z5.js} +1 -1
  21. package/lib/chunks/{E2KKD73B.js → DMW5VJBT.js} +1 -1
  22. package/lib/chunks/{DXEOF3IX.js → DT66L2TO.js} +1 -1
  23. package/lib/chunks/EDU3YBRA.js +7 -0
  24. package/lib/chunks/F57WBWGV.js +29 -0
  25. package/lib/chunks/{JDBGRKTP.js → F5V42ZYY.js} +1 -1
  26. package/lib/chunks/FDOONAMV.js +20 -0
  27. package/lib/chunks/{EJXJAU3Z.js → GEWI247R.js} +1 -1
  28. package/lib/chunks/{UNHSYVDZ.js → GHOLYNZA.js} +1 -1
  29. package/lib/chunks/GHSNC2OX.js +9 -0
  30. package/lib/chunks/{7MISZQY2.js → GVJFU4AP.js} +1 -1
  31. package/lib/chunks/{N2D5LLBV.js → H5OX3UOD.js} +1 -1
  32. package/lib/chunks/HBUZKWXC.js +7 -0
  33. package/lib/chunks/{7BAI3GZ5.js → IDI3SURO.js} +4 -4
  34. package/lib/chunks/{TC3EIKUK.js → J3DL5HGI.js} +1 -1
  35. package/lib/chunks/{FKC3B2RN.js → JMFIKCPX.js} +1 -1
  36. package/lib/chunks/{O64VVDHW.js → K2ENYHHD.js} +1 -1
  37. package/lib/chunks/{QKT4AI5U.js → LI6IH6DJ.js} +1 -1
  38. package/lib/chunks/{QXIVVOOR.js → LJPUHAWE.js} +1 -1
  39. package/lib/chunks/LUW2ZJJO.js +13 -0
  40. package/lib/chunks/M4YE5ALG.js +193 -0
  41. package/lib/chunks/MKS4O6F4.js +119 -0
  42. package/lib/chunks/MZWBJKK2.js +10 -0
  43. package/lib/chunks/{MWNK3IKD.js → N2GTHB37.js} +1 -1
  44. package/lib/chunks/NALRPITK.js +7 -0
  45. package/lib/chunks/{FTARAJQN.js → OM4VGI2Q.js} +1 -1
  46. package/lib/chunks/{XKNG65W6.js → OR3KBRCI.js} +1 -1
  47. package/lib/chunks/P7A7BCIN.js +14 -0
  48. package/lib/chunks/{NHMYQF3F.js → QDSAT32N.js} +1 -1
  49. package/lib/chunks/{RZ6XOBIA.js → R2FG6TUX.js} +1 -1
  50. package/lib/chunks/{RDLDTF4L.js → S5PUZGYS.js} +1 -1
  51. package/lib/chunks/SJHPKWSD.js +9 -0
  52. package/lib/chunks/{ISBVQBNS.js → SRCGYHDN.js} +1 -1
  53. package/lib/chunks/U5DIFWGH.js +7 -0
  54. package/lib/chunks/{7IULUVWX.js → UF2ZCH7W.js} +1 -1
  55. package/lib/chunks/{GORWWTSA.js → UXFJO2OQ.js} +1 -1
  56. package/lib/chunks/{3L35HFJG.js → VBHLPG5Q.js} +1 -1
  57. package/lib/chunks/{ARIBTVNO.js → VE7VT5PT.js} +1 -1
  58. package/lib/chunks/{VM6OOWSF.js → VIPV4IEH.js} +1 -1
  59. package/lib/chunks/VT3BHT6S.js +34 -0
  60. package/lib/chunks/{ZHK7GAOT.js → VUU57INZ.js} +1 -1
  61. package/lib/chunks/{P43DKA2E.js → VYHYEZI5.js} +1 -1
  62. package/lib/chunks/{5KSMVZSO.js → WKCOTH3C.js} +1 -1
  63. package/lib/chunks/X5NXRMUW.js +11 -0
  64. package/lib/chunks/{6WNK6ZW5.js → XTTR5PBC.js} +1 -1
  65. package/lib/chunks/XYKNLM5G.js +10 -0
  66. package/lib/chunks/{UQHIGGP6.js → Y2AFRRAT.js} +1 -1
  67. package/lib/chunks/{LGQZK7NR.js → YDVOCOBI.js} +1 -1
  68. package/lib/chunks/{HOUAVEH6.js → YEACSN2C.js} +1 -1
  69. package/lib/chunks/YFI3NLJF.js +9 -0
  70. package/lib/chunks/YMDFCK3F.js +18 -0
  71. package/lib/chunks/YOBULQYM.js +11 -0
  72. package/lib/chunks/{AOFLS3JM.js → YUNIBLZR.js} +2 -2
  73. package/lib/chunks/ZBOUASE7.js +7 -0
  74. package/lib/chunks/{ZQHPJPJ2.js → ZFJHZEI3.js} +1 -1
  75. package/lib/chunks/{UTZVN6YA.js → ZVXAH4QD.js} +1 -1
  76. package/lib/eject-assets/generators/cli/docs.ts +1 -1
  77. package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
  78. package/lib/eject-assets/generators/cli/index.ts +2 -2
  79. package/lib/eject-assets/generators/cli/render.ts +1 -1
  80. package/lib/eject-assets/generators/go/client.ts +1 -1
  81. package/lib/eject-assets/generators/go/descriptor.ts +1 -1
  82. package/lib/eject-assets/generators/go/index.ts +2 -2
  83. package/lib/eject-assets/generators/go/models.ts +1 -1
  84. package/lib/eject-assets/generators/go/naming.ts +1 -1
  85. package/lib/eject-assets/generators/go/operations.ts +1 -1
  86. package/lib/eject-assets/generators/go/pagination.ts +1 -1
  87. package/lib/eject-assets/generators/go/types.ts +1 -1
  88. package/lib/eject-assets/generators/mock/faker.ts +1 -1
  89. package/lib/eject-assets/generators/mock/index.ts +2 -2
  90. package/lib/eject-assets/generators/mock/render.ts +1 -1
  91. package/lib/eject-assets/generators/mock/sample.ts +1 -1
  92. package/lib/eject-assets/generators/mock/values.ts +1 -1
  93. package/lib/eject-assets/generators/php/client.ts +1 -1
  94. package/lib/eject-assets/generators/php/descriptor.ts +1 -1
  95. package/lib/eject-assets/generators/php/index.ts +2 -2
  96. package/lib/eject-assets/generators/php/models.ts +1 -1
  97. package/lib/eject-assets/generators/php/naming.ts +1 -1
  98. package/lib/eject-assets/generators/php/operations.ts +1 -1
  99. package/lib/eject-assets/generators/php/pagination.ts +1 -1
  100. package/lib/eject-assets/generators/php/types.ts +1 -1
  101. package/lib/eject-assets/generators/python/client.ts +1 -1
  102. package/lib/eject-assets/generators/python/descriptor.ts +1 -1
  103. package/lib/eject-assets/generators/python/index.ts +2 -2
  104. package/lib/eject-assets/generators/python/models.ts +1 -1
  105. package/lib/eject-assets/generators/python/naming.ts +1 -1
  106. package/lib/eject-assets/generators/python/operations.ts +1 -1
  107. package/lib/eject-assets/generators/python/pagination.ts +1 -1
  108. package/lib/eject-assets/generators/python/types.ts +1 -1
  109. package/lib/eject-assets/generators/swr/index.ts +2 -2
  110. package/lib/eject-assets/generators/swr/render.ts +1 -1
  111. package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
  112. package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
  113. package/lib/eject-assets/generators/transformers/index.ts +2 -2
  114. package/lib/eject-assets/generators/transformers/render.ts +1 -1
  115. package/lib/eject-assets/generators/typescript/banner.ts +1 -1
  116. package/lib/eject-assets/generators/typescript/client.ts +1 -1
  117. package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
  118. package/lib/eject-assets/generators/typescript/index.ts +2 -2
  119. package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
  120. package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
  121. package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
  122. package/lib/eject-assets/generators/typescript/operations.ts +1 -1
  123. package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
  124. package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
  125. package/lib/eject-assets/generators/typescript/types.ts +1 -1
  126. package/lib/eject-assets/generators/zod/index.ts +2 -2
  127. package/lib/eject-assets/generators/zod/schemas.ts +1 -1
  128. package/lib/index.js +78 -293
  129. package/package.json +1 -1
  130. package/lib/chunks/EVTLV6L3.js +0 -13
  131. package/lib/chunks/M4FV4I2Z.js +0 -47
  132. package/lib/chunks/UVKEIQXW.js +0 -193
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ var l={},c=new Set(["typescript","zod","tanstack-query","tanstack-query-vue","tanstack-query-svelte","tanstack-query-solid","swr","transformers","mock","cli","python","go","php"]),s=/import\s*(?:type\s*)?\{([^}]*)\}\s*from\s*['"]@redocly\/client-generator(?:\/generate)?['"]/g;function _(e,t){let o=new Set(t),r=new Set;for(let i of e.matchAll(s))for(let a of i[1].split(",")){let n=a.trim().replace(/^type\s+/,"").split(/\s+as\s+/)[0].trim();o.has(n)&&r.add(n)}return[...r]}var g=/^\/\/ Ejected from @redocly\/client-generator@([\w.-]+) — the built-in "([a-z-]+)" generator\./;function u(e){let t=e.match(g);if(!(!t||!c.has(t[2])))return{name:t[2],version:t[1]}}function p(e){return e.includes("Invalid pagination configuration")?"pagination":e.includes("Could not load generator")?"generator-load":/^Generator "[^"]+" failed:/.test(e)?"generator-run":e.includes("Unknown generator")||e.includes("does not support")?"not-supported":"other"}var d={};export{l as a,c as b,_ as c,u as d,p as e,d as f};
@@ -10,4 +10,4 @@ import{a as bt,c as Nt}from"./RFWIIJFG.js";var Xt=Nt((Xe,Wt)=>{var Re=Object.pro
10
10
  `);let t=new tt("!xml"),e=t,i="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;let n=this.options,o=new Z(n.processEntities),u=r.length;for(let s=0;s<u;s++)if(r[s]==="<"){let d=r.charCodeAt(s+1);if(d===47){let p=xt(r,">",s,"Closing Tag is not closed."),g=r.substring(s+2,p).trim();if(n.removeNSPrefix){let M=g.indexOf(":");M!==-1&&(g=g.substr(M+1))}g=Pt(n.transformTagName,g,"",n).tagName,e&&(i=this.saveTextToParentTag(i,e,this.readonlyMatcher));let O=this.matcher.getCurrentTag();if(g&&n.unpairedTagsSet.has(g))throw new Error(`Unpaired tag can not be used as closing tag: </${g}>`);O&&n.unpairedTagsSet.has(O)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,e=this.tagsNodeStack.pop(),i="",s=p}else if(d===63){let p=_t(r,s,!1,"?>");if(!p)throw new Error("Pi Tag is not closed.");i=this.saveTextToParentTag(i,e,this.readonlyMatcher);let g=this.buildAttributesMap(p.tagExp,this.matcher,p.tagName,!0);if(g){let O=g[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(O)||1)}if(!(n.ignoreDeclaration&&p.tagName==="?xml"||n.ignorePiTags)){let O=new tt(p.tagName);O.add(n.textNodeName,""),p.tagName!==p.tagExp&&p.attrExpPresent&&n.ignoreAttributes!==!0&&(O[":@"]=g),this.addChild(e,O,this.readonlyMatcher,s)}s=p.closeIndex+1}else if(d===33&&r.charCodeAt(s+2)===45&&r.charCodeAt(s+3)===45){let p=xt(r,"-->",s+4,"Comment is not closed.");if(n.commentPropName){let g=r.substring(s+4,p-2);i=this.saveTextToParentTag(i,e,this.readonlyMatcher),e.add(n.commentPropName,[{[n.textNodeName]:g}])}s=p}else if(d===33&&r.charCodeAt(s+2)===68){let p=o.readDocType(r,s);this.entityDecoder.addInputEntities(p.entities),s=p.i}else if(d===33&&r.charCodeAt(s+2)===91){let p=xt(r,"]]>",s,"CDATA is not closed.")-2,g=r.substring(s+9,p);i=this.saveTextToParentTag(i,e,this.readonlyMatcher);let O=this.parseTextData(g,e.tagname,this.readonlyMatcher,!0,!1,!0,!0);O==null&&(O=""),n.cdataPropName?e.add(n.cdataPropName,[{[n.textNodeName]:g}]):e.add(n.textNodeName,O),s=p+2}else{let p=_t(r,s,n.removeNSPrefix);if(!p){let at=r.substring(Math.max(0,s-50),Math.min(u,s+50));throw new Error(`readTagExp returned undefined at position ${s}. Context: "${at}"`)}let g=p.tagName,O=p.rawTagName,M=p.tagExp,L=p.attrExpPresent,k=p.closeIndex;if({tagName:g,tagExp:M}=Pt(n.transformTagName,g,M,n),n.strictReservedNames&&(g===n.commentPropName||g===n.cdataPropName||g===n.textNodeName||g===n.attributesGroupName))throw new Error(`Invalid tag name: ${g}`);e&&i&&e.tagname!=="!xml"&&(i=this.saveTextToParentTag(i,e,this.readonlyMatcher,!1));let V=e;V&&n.unpairedTagsSet.has(V.tagname)&&(e=this.tagsNodeStack.pop(),this.matcher.pop());let rt=!1;M.length>0&&M.lastIndexOf("/")===M.length-1&&(rt=!0,g[g.length-1]==="/"?(g=g.substr(0,g.length-1),M=g):M=M.substr(0,M.length-1),L=g!==M);let ot,st=null,dt={};ot=le(O),g!==t.tagname&&this.matcher.push(g,{},ot),g!==M&&L&&(st=this.buildAttributesMap(M,this.matcher,g),st&&(dt=ae(st,n))),g!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());let ct=s;if(this.isCurrentNodeStopNode){let at="";if(rt)s=p.closeIndex;else if(n.unpairedTagsSet.has(g))s=p.closeIndex;else{let jt=this.readStopNodeData(r,O,k+1);if(!jt)throw new Error(`Unexpected end of ${O}`);s=jt.i,at=jt.tagContent}let Ct=new tt(g);st&&(Ct[":@"]=st),Ct.add(n.textNodeName,at),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(e,Ct,this.readonlyMatcher,ct)}else{if(rt){({tagName:g,tagExp:M}=Pt(n.transformTagName,g,M,n));let at=new tt(g);st&&(at[":@"]=st),this.addChild(e,at,this.readonlyMatcher,ct),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(n.unpairedTagsSet.has(g)){let at=new tt(g);st&&(at[":@"]=st),this.addChild(e,at,this.readonlyMatcher,ct),this.matcher.pop(),this.isCurrentNodeStopNode=!1,s=p.closeIndex;continue}{let at=new tt(g);if(this.tagsNodeStack.length>n.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(e),st&&(at[":@"]=st),this.addChild(e,at,this.readonlyMatcher,ct),e=at}}i="",s=k}}}else i+=r[s];return t.child};function me(r,t,e,i){this.options.captureMetaData||(i=void 0);let n=this.options.jPath?e.toString():e,o=this.options.updateTag(t.tagname,n,t[":@"]);o===!1||(typeof o=="string"&&(t.tagname=o),r.addChild(t,i))}function ge(r,t,e){let i=this.options.processEntities;if(!i||!i.enabled)return r;if(i.allowedTags){let n=this.options.jPath?e.toString():e;if(!(Array.isArray(i.allowedTags)?i.allowedTags.includes(t):i.allowedTags(t,n)))return r}if(i.tagFilter){let n=this.options.jPath?e.toString():e;if(!i.tagFilter(t,n))return r}return this.entityDecoder.decode(r)}function ye(r,t,e,i){return r&&(i===void 0&&(i=t.child.length===0),(r=this.parseTextData(r,t.tagname,e,!1,!!t[":@"]&&Object.keys(t[":@"]).length!==0,i))!==void 0&&r!==""&&t.add(this.options.textNodeName,r),r=""),r}function be(){return this.stopNodeExpressionsSet.size!==0&&this.matcher.matchesAny(this.stopNodeExpressionsSet)}function xt(r,t,e,i){let n=r.indexOf(t,e);if(n===-1)throw new Error(i);return n+t.length-1}function ve(r,t,e,i){let n=r.indexOf(t,e);if(n===-1)throw new Error(i);return n}function _t(r,t,e,i=">"){let n=(function(O,M,L=">"){let k=0,V=[],rt=O.length,ot=L.charCodeAt(0),st=L.length>1?L.charCodeAt(1):-1;for(let dt=M;dt<rt;dt++){let ct=O.charCodeAt(dt);if(k)ct===k&&(k=0);else if(ct===34||ct===39)k=ct;else if(ct===ot){if(st===-1)return{data:String.fromCharCode(...V),index:dt};if(O.charCodeAt(dt+1)===st)return{data:String.fromCharCode(...V),index:dt}}else if(ct===9){V.push(32);continue}V.push(ct)}})(r,t+1,i);if(!n)return;let o=n.data,u=n.index,s=o.search(/\s/),d=o,p=!0;s!==-1&&(d=o.substring(0,s),o=o.substring(s+1).trimStart());let g=d;if(e){let O=d.indexOf(":");O!==-1&&(d=d.substr(O+1),p=d!==n.data.substr(O+1))}return{tagName:d,tagExp:o,closeIndex:u,attrExpPresent:p,rawTagName:g}}function xe(r,t,e){let i=e,n=1,o=r.length;for(;e<o;e++)if(r[e]==="<"){let u=r.charCodeAt(e+1);if(u===47){let s=ve(r,">",e,`${t} is not closed`);if(r.substring(e+2,s).trim()===t&&(n--,n===0))return{tagContent:r.substring(i,e),i:s};e=s}else if(u===63)e=xt(r,"?>",e+1,"StopNode is not closed.");else if(u===33&&r.charCodeAt(e+2)===45&&r.charCodeAt(e+3)===45)e=xt(r,"-->",e+3,"StopNode is not closed.");else if(u===33&&r.charCodeAt(e+2)===91)e=xt(r,"]]>",e,"StopNode is not closed.")-2;else{let s=_t(r,e,">");s&&((s&&s.tagName)===t&&s.tagExp[s.tagExp.length-1]!=="/"&&n++,e=s.closeIndex)}}}function Rt(r,t,e){if(t&&typeof r=="string"){let i=r.trim();return i==="true"||i!=="false"&&(function(n,o={}){if(o=Object.assign({},Ht,o),!n||typeof n!="string")return n;let u=n.trim();if(u.length===0||o.skipLike!==void 0&&o.skipLike.test(u))return n;if(u==="0")return 0;if(o.hex&&gt.test(u))return(function(d){if(parseInt)return parseInt(d,16);if(Number.parseInt)return Number.parseInt(d,16);if(window&&window.parseInt)return window.parseInt(d,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")})(u);if(isFinite(u)){if(u.includes("e")||u.includes("E"))return(function(d,p,g){if(!g.eNotation)return d;let O=p.match(Qt);if(O){let M=O[1]||"",L=O[3].indexOf("e")===-1?"E":"e",k=O[2],V=M?d[k.length+1]===L:d[k.length]===L;return k.length>1&&V?d:(k.length!==1||!O[3].startsWith(`.${L}`)&&O[3][0]!==L)&&k.length>0?g.leadingZeros&&!V?(p=(O[1]||"")+O[3],Number(p)):d:Number(p)}return d})(n,u,o);{let d=ht.exec(u);if(d){let p=d[1]||"",g=d[2],O=((s=d[3])&&s.indexOf(".")!==-1&&((s=s.replace(/0+$/,""))==="."?s="0":s[0]==="."?s="0"+s:s[s.length-1]==="."&&(s=s.substring(0,s.length-1))),s),M=p?n[g.length+1]===".":n[g.length]===".";if(!o.leadingZeros&&(g.length>1||g.length===1&&!M))return n;{let L=Number(u),k=String(L);if(L===0)return L;if(k.search(/[eE]/)!==-1)return o.eNotation?L:n;if(u.indexOf(".")!==-1)return k==="0"||k===O||k===`${p}${O}`?L:n;let V=g?O:u;return g?V===k||p+V===k?L:n:V===k||V===p+k?L:n}}return n}}var s;return(function(d,p,g){let O=p===1/0;switch(g.infinity.toLowerCase()){case"null":return null;case"infinity":return p;case"string":return O?"Infinity":"-Infinity";default:return d}})(n,Number(u),o)})(r,e)}return r!==void 0?r:""}function Pt(r,t,e,i){if(r){let n=r(t);e===t&&(e=n),t=n}return{tagName:t=kt(t,i),tagExp:e}}function kt(r,t){if($.includes(r))throw new Error(`[SECURITY] Invalid name: "${r}" is a reserved JavaScript keyword that could cause prototype pollution`);return j.includes(r)?t.onDangerousProperty(r):r}let At=tt.getMetaDataSymbol();function Ne(r,t){if(!r||typeof r!="object")return{};if(!t)return r;let e={};for(let i in r)i.startsWith(t)?e[i.substring(t.length)]=r[i]:e[i]=r[i];return e}function we(r,t,e,i){return Vt(r,t,e,i)}function Vt(r,t,e,i){let n,o={};for(let u=0;u<r.length;u++){let s=r[u],d=Oe(s);if(d!==void 0&&d!==t.textNodeName){let p=Ne(s[":@"]||{},t.attributeNamePrefix);e.push(d,p)}if(d===t.textNodeName)n===void 0?n=s[d]:n+=""+s[d];else{if(d===void 0)continue;if(s[d]){let p=Vt(s[d],t,e,i),g=Se(p,t);if(s[":@"]?Ee(p,s[":@"],i,t):Object.keys(p).length!==1||p[t.textNodeName]===void 0||t.alwaysCreateTextNode?Object.keys(p).length===0&&(t.alwaysCreateTextNode?p[t.textNodeName]="":p=""):p=p[t.textNodeName],s[At]!==void 0&&typeof p=="object"&&p!==null&&(p[At]=s[At]),o[d]!==void 0&&Object.prototype.hasOwnProperty.call(o,d))Array.isArray(o[d])||(o[d]=[o[d]]),o[d].push(p);else{let O=t.jPath?i.toString():i;t.isArray(d,O,g)?o[d]=[p]:o[d]=p}d!==void 0&&d!==t.textNodeName&&e.pop()}}}return typeof n=="string"?n.length>0&&(o[t.textNodeName]=n):n!==void 0&&(o[t.textNodeName]=n),o}function Oe(r){let t=Object.keys(r);for(let e=0;e<t.length;e++){let i=t[e];if(i!==":@")return i}}function Ee(r,t,e,i){if(t){let n=Object.keys(t),o=n.length;for(let u=0;u<o;u++){let s=n[u],d=s.startsWith(i.attributeNamePrefix)?s.substring(i.attributeNamePrefix.length):s,p=i.jPath?e.toString()+"."+d:e;i.isArray(s,p,!0,!0)?r[s]=[t[s]]:r[s]=t[s]}}}function Se(r,t){let{textNodeName:e}=t,i=Object.keys(r).length;return i===0||!(i!==1||!r[e]&&typeof r[e]!="boolean"&&r[e]!==0)}class _e{constructor(t){this.externalEntities={},this.options=G(t)}parse(t,e){if(typeof t!="string"&&t.toString)t=t.toString();else if(typeof t!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(e){e===!0&&(e={});let o=c(t,e);if(o!==!0)throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`)}let i=new ue(this.options);i.entityDecoder.setExternalEntities(this.externalEntities);let n=i.parseXml(t);return this.options.preserveOrder||n===void 0?n:we(n,this.options,i.matcher,i.readonlyMatcher)}addEntity(t,e){if(e.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(e==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}static getMetaDataSymbol(){return tt.getMetaDataSymbol()}}function Pe(r,t){let e="";t.format&&t.indentBy.length>0&&(e=`
11
11
  `);let i=[];if(t.stopNodes&&Array.isArray(t.stopNodes))for(let n=0;n<t.stopNodes.length;n++){let o=t.stopNodes[n];typeof o=="string"?i.push(new vt(o)):o instanceof vt&&i.push(o)}return Ft(r,t,e,new Ot,i)}function Ft(r,t,e,i,n){let o="",u=!1;if(t.maxNestedTags&&i.getDepth()>t.maxNestedTags)throw new Error("Maximum nested tags exceeded");if(!Array.isArray(r)){if(r!=null){let s=r.toString();return s=Tt(s,t),s}return""}for(let s=0;s<r.length;s++){let d=r[s],p=Gt(d);if(p===void 0)continue;let g=Ae(d[":@"],t);i.push(p,g);let O=Ce(i,n);if(p===t.textNodeName){let V=d[p];O||(V=t.tagValueProcessor(p,V),V=Tt(V,t)),u&&(o+=e),o+=V,u=!1,i.pop();continue}if(p===t.cdataPropName){u&&(o+=e);let V=d[p][0][t.textNodeName];o+=`<![CDATA[${String(V).replace(/\]\]>/g,"]]]]><![CDATA[>")}]]>`,u=!1,i.pop();continue}if(p===t.commentPropName){let V=d[p][0][t.textNodeName];o+=e+`<!--${String(V).replace(/--/g,"- -").replace(/-$/,"- ")}-->`,u=!0,i.pop();continue}if(p[0]==="?"){let V=Bt(d[":@"],t,O),rt=p==="?xml"?"":e,ot=d[p][0][t.textNodeName];ot=ot.length!==0?" "+ot:"",o+=rt+`<${p}${ot}${V}?>`,u=!0,i.pop();continue}let M=e;M!==""&&(M+=t.indentBy);let L=e+`<${p}${Bt(d[":@"],t,O)}`,k;k=O?Ut(d[p],t):Ft(d[p],t,M,i,n),t.unpairedTags.indexOf(p)!==-1?t.suppressUnpairedNode?o+=L+">":o+=L+"/>":k&&k.length!==0||!t.suppressEmptyNode?k&&k.endsWith(">")?o+=L+`>${k}${e}</${p}>`:(o+=L+">",k&&e!==""&&(k.includes("/>")||k.includes("</"))?o+=e+t.indentBy+k+e:o+=k,o+=`</${p}>`):o+=L+"/>",u=!0,i.pop()}return o}function Ae(r,t){if(!r||t.ignoreAttributes)return null;let e={},i=!1;for(let n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n.startsWith(t.attributeNamePrefix)?n.substr(t.attributeNamePrefix.length):n]=r[n],i=!0);return i?e:null}function Ut(r,t){if(!Array.isArray(r))return r!=null?r.toString():"";let e="";for(let i=0;i<r.length;i++){let n=r[i],o=Gt(n);if(o===t.textNodeName)e+=n[o];else if(o===t.cdataPropName)e+=n[o][0][t.textNodeName];else if(o===t.commentPropName)e+=n[o][0][t.textNodeName];else{if(o&&o[0]==="?")continue;if(o){let u=Te(n[":@"],t),s=Ut(n[o],t);s&&s.length!==0?e+=`<${o}${u}>${s}</${o}>`:e+=`<${o}${u}/>`}}}return e}function Te(r,t){let e="";if(r&&!t.ignoreAttributes)for(let i in r){if(!Object.prototype.hasOwnProperty.call(r,i))continue;let n=r[i];n===!0&&t.suppressBooleanAttributes?e+=` ${i.substr(t.attributeNamePrefix.length)}`:e+=` ${i.substr(t.attributeNamePrefix.length)}="${n}"`}return e}function Gt(r){let t=Object.keys(r);for(let e=0;e<t.length;e++){let i=t[e];if(Object.prototype.hasOwnProperty.call(r,i)&&i!==":@")return i}}function Bt(r,t,e){let i="";if(r&&!t.ignoreAttributes)for(let n in r){if(!Object.prototype.hasOwnProperty.call(r,n))continue;let o;e?o=r[n]:(o=t.attributeValueProcessor(n,r[n]),o=Tt(o,t)),o===!0&&t.suppressBooleanAttributes?i+=` ${n.substr(t.attributeNamePrefix.length)}`:i+=` ${n.substr(t.attributeNamePrefix.length)}="${o}"`}return i}function Ce(r,t){if(!t||t.length===0)return!1;for(let e=0;e<t.length;e++)if(r.matches(t[e]))return!0;return!1}function Tt(r,t){if(r&&r.length>0&&t.processEntities)for(let e=0;e<t.entities.length;e++){let i=t.entities[e];r=r.replace(i.regex,i.val)}return r}let je={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(r,t){return t},attributeValueProcessor:function(r,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0};function pt(r){if(this.options=Object.assign({},je,r),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(e=>typeof e=="string"&&e.startsWith("*.")?".."+e.substring(2):e)),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(let e=0;e<this.options.stopNodes.length;e++){let i=this.options.stopNodes[e];typeof i=="string"?this.stopNodeExpressions.push(new vt(i)):i instanceof vt&&this.stopNodeExpressions.push(i)}var t;this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=typeof(t=this.options.ignoreAttributes)=="function"?t:Array.isArray(t)?e=>{for(let i of t)if(typeof i=="string"&&e===i||i instanceof RegExp&&i.test(e))return!0}:()=>!1,this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=De),this.processTextOrObjNode=Me,this.options.format?(this.indentate=Ie,this.tagEndChar=`>
12
12
  `,this.newLine=`
13
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function Me(r,t,e,i){let n=this.extractAttributes(r);if(i.push(t,n),this.checkStopNode(i)){let u=this.buildRawContent(r),s=this.buildAttributesForStopNode(r);return i.pop(),this.buildObjectNode(u,t,s,e)}let o=this.j2x(r,e+1,i);return i.pop(),r[this.options.textNodeName]!==void 0&&Object.keys(r).length===1?this.buildTextValNode(r[this.options.textNodeName],t,o.attrStr,e,i):this.buildObjectNode(o.val,t,o.attrStr,e)}function Ie(r){return this.options.indentBy.repeat(r)}function De(r){return!(!r.startsWith(this.options.attributeNamePrefix)||r===this.options.textNodeName)&&r.substr(this.attrPrefixLen)}pt.prototype.build=function(r){if(this.options.preserveOrder)return Pe(r,this.options);{Array.isArray(r)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(r={[this.options.arrayNodeName]:r});let t=new Ot;return this.j2x(r,0,t).val}},pt.prototype.j2x=function(r,t,e){let i="",n="";if(this.options.maxNestedTags&&e.getDepth()>=this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");let o=this.options.jPath?e.toString():e,u=this.checkStopNode(e);for(let s in r)if(Object.prototype.hasOwnProperty.call(r,s))if(r[s]===void 0)this.isAttribute(s)&&(n+="");else if(r[s]===null)this.isAttribute(s)||s===this.options.cdataPropName?n+="":s[0]==="?"?n+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(r[s]instanceof Date)n+=this.buildTextValNode(r[s],s,"",t,e);else if(typeof r[s]!="object"){let d=this.isAttribute(s);if(d&&!this.ignoreAttributesFn(d,o))i+=this.buildAttrPairStr(d,""+r[s],u);else if(!d)if(s===this.options.textNodeName){let p=this.options.tagValueProcessor(s,""+r[s]);n+=this.replaceEntitiesValue(p)}else{e.push(s);let p=this.checkStopNode(e);if(e.pop(),p){let g=""+r[s];n+=g===""?this.indentate(t)+"<"+s+this.closeTag(s)+this.tagEndChar:this.indentate(t)+"<"+s+">"+g+"</"+s+this.tagEndChar}else n+=this.buildTextValNode(r[s],s,"",t,e)}}else if(Array.isArray(r[s])){let d=r[s].length,p="",g="";for(let O=0;O<d;O++){let M=r[s][O];if(M!==void 0)if(M===null)s[0]==="?"?n+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(typeof M=="object")if(this.options.oneListGroup){e.push(s);let L=this.j2x(M,t+1,e);e.pop(),p+=L.val,this.options.attributesGroupName&&M.hasOwnProperty(this.options.attributesGroupName)&&(g+=L.attrStr)}else p+=this.processTextOrObjNode(M,s,t,e);else if(this.options.oneListGroup){let L=this.options.tagValueProcessor(s,M);L=this.replaceEntitiesValue(L),p+=L}else{e.push(s);let L=this.checkStopNode(e);if(e.pop(),L){let k=""+M;p+=k===""?this.indentate(t)+"<"+s+this.closeTag(s)+this.tagEndChar:this.indentate(t)+"<"+s+">"+k+"</"+s+this.tagEndChar}else p+=this.buildTextValNode(M,s,"",t,e)}}this.options.oneListGroup&&(p=this.buildObjectNode(p,s,g,t)),n+=p}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){let d=Object.keys(r[s]),p=d.length;for(let g=0;g<p;g++)i+=this.buildAttrPairStr(d[g],""+r[s][d[g]],u)}else n+=this.processTextOrObjNode(r[s],s,t,e);return{attrStr:i,val:n}},pt.prototype.buildAttrPairStr=function(r,t,e){return e||(t=this.options.attributeValueProcessor(r,""+t),t=this.replaceEntitiesValue(t)),this.options.suppressBooleanAttributes&&t==="true"?" "+r:" "+r+'="'+t+'"'},pt.prototype.extractAttributes=function(r){if(!r||typeof r!="object")return null;let t={},e=!1;if(this.options.attributesGroupName&&r[this.options.attributesGroupName]){let i=r[this.options.attributesGroupName];for(let n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n.startsWith(this.options.attributeNamePrefix)?n.substring(this.options.attributeNamePrefix.length):n]=i[n],e=!0)}else for(let i in r){if(!Object.prototype.hasOwnProperty.call(r,i))continue;let n=this.isAttribute(i);n&&(t[n]=r[i],e=!0)}return e?t:null},pt.prototype.buildRawContent=function(r){if(typeof r=="string")return r;if(typeof r!="object"||r===null)return String(r);if(r[this.options.textNodeName]!==void 0)return r[this.options.textNodeName];let t="";for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e)||this.isAttribute(e)||this.options.attributesGroupName&&e===this.options.attributesGroupName)continue;let i=r[e];if(e===this.options.textNodeName)t+=i;else if(Array.isArray(i)){for(let n of i)if(typeof n=="string"||typeof n=="number")t+=`<${e}>${n}</${e}>`;else if(typeof n=="object"&&n!==null){let o=this.buildRawContent(n),u=this.buildAttributesForStopNode(n);t+=o===""?`<${e}${u}/>`:`<${e}${u}>${o}</${e}>`}}else if(typeof i=="object"&&i!==null){let n=this.buildRawContent(i),o=this.buildAttributesForStopNode(i);t+=n===""?`<${e}${o}/>`:`<${e}${o}>${n}</${e}>`}else t+=`<${e}>${i}</${e}>`}return t},pt.prototype.buildAttributesForStopNode=function(r){if(!r||typeof r!="object")return"";let t="";if(this.options.attributesGroupName&&r[this.options.attributesGroupName]){let e=r[this.options.attributesGroupName];for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let n=i.startsWith(this.options.attributeNamePrefix)?i.substring(this.options.attributeNamePrefix.length):i,o=e[i];o===!0&&this.options.suppressBooleanAttributes?t+=" "+n:t+=" "+n+'="'+o+'"'}}else for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let i=this.isAttribute(e);if(i){let n=r[e];n===!0&&this.options.suppressBooleanAttributes?t+=" "+i:t+=" "+i+'="'+n+'"'}}return t},pt.prototype.buildObjectNode=function(r,t,e,i){if(r==="")return t[0]==="?"?this.indentate(i)+"<"+t+e+"?"+this.tagEndChar:this.indentate(i)+"<"+t+e+this.closeTag(t)+this.tagEndChar;{let n="</"+t+this.tagEndChar,o="";return t[0]==="?"&&(o="?",n=""),!e&&e!==""||r.indexOf("<")!==-1?this.options.commentPropName!==!1&&t===this.options.commentPropName&&o.length===0?this.indentate(i)+`<!--${r}-->`+this.newLine:this.indentate(i)+"<"+t+e+o+this.tagEndChar+r+this.indentate(i)+n:this.indentate(i)+"<"+t+e+o+">"+r+n}},pt.prototype.closeTag=function(r){let t="";return this.options.unpairedTags.indexOf(r)!==-1?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${r}`,t},pt.prototype.checkStopNode=function(r){if(!this.stopNodeExpressions||this.stopNodeExpressions.length===0)return!1;for(let t=0;t<this.stopNodeExpressions.length;t++)if(r.matches(this.stopNodeExpressions[t]))return!0;return!1},pt.prototype.buildTextValNode=function(r,t,e,i,n){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName){let o=String(r).replace(/\]\]>/g,"]]]]><![CDATA[>");return this.indentate(i)+`<![CDATA[${o}]]>`+this.newLine}if(this.options.commentPropName!==!1&&t===this.options.commentPropName){let o=String(r).replace(/--/g,"- -").replace(/-$/,"- ");return this.indentate(i)+`<!--${o}-->`+this.newLine}if(t[0]==="?")return this.indentate(i)+"<"+t+e+"?"+this.tagEndChar;{let o=this.options.tagValueProcessor(t,r);return o=this.replaceEntitiesValue(o),o===""?this.indentate(i)+"<"+t+e+this.closeTag(t)+this.tagEndChar:this.indentate(i)+"<"+t+e+">"+o+"</"+t+this.tagEndChar}},pt.prototype.replaceEntitiesValue=function(r){if(r&&r.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){let e=this.options.entities[t];r=r.replace(e.regex,e.val)}return r};let $e=pt,Le={validate:c};R.exports=h})()},{}],2:[function(_,R,w){var I=Object.prototype.hasOwnProperty,h=Object.prototype.toString;R.exports=function(y,N,D){if(h.call(N)!=="[object Function]")throw new TypeError("iterator must be a function");var j=y.length;if(j===+j)for(var $=0;$<j;$++)N.call(D,y[$],$,y);else for(var l in y)I.call(y,l)&&N.call(D,y[l],l,y)}},{}],3:[function(_,R,w){"use strict";var I=_("foreach");R.exports=h;function h(A,y,N){if(arguments.length===3)return h.set(A,y,N);if(arguments.length===2)return h.get(A,y);var D=h.bind(h,A);for(var j in h)h.hasOwnProperty(j)&&(D[j]=h[j].bind(D,A));return D}h.get=function(y,N){for(var D=Array.isArray(N)?N:h.parse(N),j=0;j<D.length;++j){var $=D[j];if(!(typeof y=="object"&&$ in y))throw new Error("Invalid reference token: "+$);y=y[$]}return y},h.set=function(y,N,D){var j=Array.isArray(N)?N:h.parse(N),$=j[0];if(j.length===0)throw Error("Can not set the root object");for(var l=0;l<j.length-1;++l){var c=j[l];typeof c!="string"&&typeof c!="number"&&(c=String(c)),!(c==="__proto__"||c==="constructor"||c==="prototype")&&(c==="-"&&Array.isArray(y)&&(c=y.length),$=j[l+1],c in y||($.match(/^(\d+|-)$/)?y[c]=[]:y[c]={}),y=y[c])}return $==="-"&&Array.isArray(y)&&($=y.length),y[$]=D,this},h.remove=function(A,y){var N=Array.isArray(y)?y:h.parse(y),D=N[N.length-1];if(D===void 0)throw new Error('Invalid JSON pointer for remove: "'+y+'"');var j=h.get(A,N.slice(0,-1));if(Array.isArray(j)){var $=+D;if(D===""&&isNaN($))throw new Error('Invalid array index: "'+D+'"');Array.prototype.splice.call(j,$,1)}else delete j[D]},h.dict=function(y,N){var D={};return h.walk(y,function(j,$){D[$]=j},N),D},h.walk=function(y,N,D){var j=[];D=D||function($){var l=Object.prototype.toString.call($);return l==="[object Object]"||l==="[object Array]"},(function $(l){I(l,function(c,v){j.push(String(v)),D(c)?$(c):N(c,h.compile(j)),j.pop()})})(y)},h.has=function(y,N){try{h.get(y,N)}catch{return!1}return!0},h.escape=function(y){return y.toString().replace(/~/g,"~0").replace(/\//g,"~1")},h.unescape=function(y){return y.replace(/~1/g,"/").replace(/~0/g,"~")},h.parse=function(y){if(y==="")return[];if(y.charAt(0)!=="/")throw new Error("Invalid JSON pointer: "+y);return y.substring(1).split(/\//).map(h.unescape)},h.compile=function(y){return y.length===0?"":"/"+y.map(h.escape).join("/")}},{foreach:2}],4:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.allOfSample=$;var I=_("./traverse"),h=_("./utils");function A(l,c){var v=Object.keys(l);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(l);c&&(P=P.filter(function(E){return Object.getOwnPropertyDescriptor(l,E).enumerable})),v.push.apply(v,P)}return v}function y(l){for(var c=1;c<arguments.length;c++){var v=arguments[c]!=null?arguments[c]:{};c%2?A(Object(v),!0).forEach(function(P){N(l,P,v[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(v)):A(Object(v)).forEach(function(P){Object.defineProperty(l,P,Object.getOwnPropertyDescriptor(v,P))})}return l}function N(l,c,v){return(c=D(c))in l?Object.defineProperty(l,c,{value:v,enumerable:!0,configurable:!0,writable:!0}):l[c]=v,l}function D(l){var c=j(l,"string");return typeof c=="symbol"?c:c+""}function j(l,c){if(typeof l!="object"||!l)return l;var v=l[Symbol.toPrimitive];if(v!==void 0){var P=v.call(l,c||"default");if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(l)}function $(l,c,v,P,E){let F=(0,I.traverse)(l,v,P),q=[];for(let W of c){let{type:U,readOnly:K,writeOnly:f,value:m}=(0,I.traverse)(y({type:F.type},W),v,P,y(y({},E),{},{isAllOfChild:!0}));F.type&&U&&U!==F.type&&(console.warn("allOf: schemas with different types can't be merged"),F.type=U),F.type=F.type||U,F.readOnly=F.readOnly||K,F.writeOnly=F.writeOnly||f,m!=null&&q.push(m)}if(F.type==="object"){F.value=(0,h.mergeDeep)(F.value||{},...q.filter(W=>typeof W=="object"));for(let W in F.value)F.value[W]===h.SKIP_SYMBOL&&delete F.value[W];return F}else{F.type==="array"&&(v.quiet||console.warn('OpenAPI Sampler: found allOf with "array" type. Result may be incorrect'));let W=q[q.length-1];return F.value=W??F.value,F}}},{"./traverse":14,"./utils":15}],5:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.inferType=h;let I={multipleOf:"number",maximum:"number",exclusiveMaximum:"number",minimum:"number",exclusiveMinimum:"number",maxLength:"string",minLength:"string",pattern:"string",items:"array",maxItems:"array",minItems:"array",uniqueItems:"array",additionalItems:"array",maxProperties:"object",minProperties:"object",required:"object",additionalProperties:"object",properties:"object",patternProperties:"object",dependencies:"object"};function h(A){if(A.type!==void 0)return Array.isArray(A.type)?A.type.length===0?null:A.type[0]:A.type;let y=Object.keys(I);for(var N=0;N<y.length;N++){let D=y[N],j=I[D];if(A[D]!==void 0)return j}return null}},{}],6:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w._registerSampler=l,w._samplers=void 0,Object.defineProperty(w,"inferType",{enumerable:!0,get:function(){return y.inferType}}),w.sample=$;var I=_("./traverse"),h=_("./samplers/index"),A=_("fast-xml-parser"),y=_("./infer"),N=w._samplers={};let D={skipReadOnly:!1,maxSampleDepth:15};function j(c,v){if(!c)throw new Error("Unknown format output for building XML.");if(Array.isArray(c)||Object.keys(c).length>1){var P;c={[(v==null||(P=v.xml)===null||P===void 0?void 0:P.name)||"root"]:c}}return new A.XMLBuilder({ignoreAttributes:!1,format:!0,attributeNamePrefix:"$",textNodeName:"#text",cdataPropName:"#cdata"}).build(c)}function $(c,v,P){let E=Object.assign({},D,v);(0,I.clearCache)();let F=(0,I.traverse)(c,E,P).value;return E?.format==="xml"?j(F,c):F}function l(c,v){N[c]=v}l("array",h.sampleArray),l("boolean",h.sampleBoolean),l("integer",h.sampleNumber),l("number",h.sampleNumber),l("object",h.sampleObject),l("string",h.sampleString)},{"./infer":5,"./samplers/index":9,"./traverse":14,"fast-xml-parser":1}],7:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.sampleArray=$;var I=_("../traverse"),h=_("../utils");function A(l,c){var v=Object.keys(l);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(l);c&&(P=P.filter(function(E){return Object.getOwnPropertyDescriptor(l,E).enumerable})),v.push.apply(v,P)}return v}function y(l){for(var c=1;c<arguments.length;c++){var v=arguments[c]!=null?arguments[c]:{};c%2?A(Object(v),!0).forEach(function(P){N(l,P,v[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(v)):A(Object(v)).forEach(function(P){Object.defineProperty(l,P,Object.getOwnPropertyDescriptor(v,P))})}return l}function N(l,c,v){return(c=D(c))in l?Object.defineProperty(l,c,{value:v,enumerable:!0,configurable:!0,writable:!0}):l[c]=v,l}function D(l){var c=j(l,"string");return typeof c=="symbol"?c:c+""}function j(l,c){if(typeof l!="object"||!l)return l;var v=l[Symbol.toPrimitive];if(v!==void 0){var P=v.call(l,c||"default");if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(l)}function $(l){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=arguments.length>2?arguments[2]:void 0,P=arguments.length>3?arguments[3]:void 0,E=P&&P.depth||1,F=Math.min(l.maxItems!=null?l.maxItems:1/0,l.minItems||1),q=l.prefixItems||l.items||l.contains;Array.isArray(q)&&(F=Math.max(F,q.length));let W=f=>Array.isArray(q)?q[f]||{}:q||{},U=[];if(!q)return U;for(let f=0;f<F;f++){let m=W(f),{value:a}=(0,I.traverse)(m,c,v,{depth:E+1});if(c?.format==="xml"){let{value:x,propertyName:b}=(0,h.applyXMLAttributes)({value:a},m,P);if(b){var K;(K=U)!==null&&K!==void 0&&K[b]||(U=y(y({},U),{},{[b]:[]})),U[b].push(x)}else U=y(y({},U),x)}else U.push(a)}if(c?.format==="xml"&&E===1){let{value:f,propertyName:m}=(0,h.applyXMLAttributes)({value:null},l,P);m&&(f?U=Array.isArray(U)?{[m]:y(y({},f),U.map(a=>({"#text":y({},a)})))}:{[m]:y(y({},U),f)}:U={[m]:U})}return U}},{"../traverse":14,"../utils":15}],8:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.sampleBoolean=I;function I(h){return!0}},{}],9:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),Object.defineProperty(w,"sampleArray",{enumerable:!0,get:function(){return I.sampleArray}}),Object.defineProperty(w,"sampleBoolean",{enumerable:!0,get:function(){return h.sampleBoolean}}),Object.defineProperty(w,"sampleNumber",{enumerable:!0,get:function(){return A.sampleNumber}}),Object.defineProperty(w,"sampleObject",{enumerable:!0,get:function(){return y.sampleObject}}),Object.defineProperty(w,"sampleString",{enumerable:!0,get:function(){return N.sampleString}});var I=_("./array"),h=_("./boolean"),A=_("./number"),y=_("./object"),N=_("./string")},{"./array":7,"./boolean":8,"./number":10,"./object":11,"./string":13}],10:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.sampleNumber=I;function I(h){let A=0;if(h.type==="number"&&(h.format==="float"||h.format==="double")&&(A=.1),typeof h.exclusiveMinimum=="boolean"||typeof h.exclusiveMaximum=="boolean"){if(Number.isFinite(h.maximum)&&Number.isFinite(h.minimum))return A=h.exclusiveMinimum?Math.floor(h.minimum)+1:h.minimum,(h.exclusiveMaximum&&A>=h.maximum||!h.exclusiveMaximum&&A>h.maximum)&&(A=(h.maximum+h.minimum)/2),A;if(Number.isFinite(h.minimum))return h.exclusiveMinimum?Math.floor(h.minimum)+1:h.minimum;if(Number.isFinite(h.maximum))return h.exclusiveMaximum?h.maximum>0?0:Math.floor(h.maximum)-1:h.maximum>0?0:h.maximum}else{if(Number.isFinite(h.minimum))return h.minimum;Number.isFinite(h.exclusiveMinimum)?(A=Math.floor(h.exclusiveMinimum)+1,A===h.exclusiveMaximum&&(A=(A+Math.floor(h.exclusiveMaximum)-1)/2)):Number.isFinite(h.exclusiveMaximum)?A=Math.floor(h.exclusiveMaximum)-1:Number.isFinite(h.maximum)&&(A=h.maximum)}return A}},{}],11:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.sampleObject=$;var I=_("../traverse"),h=_("../utils");function A(l,c){var v=Object.keys(l);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(l);c&&(P=P.filter(function(E){return Object.getOwnPropertyDescriptor(l,E).enumerable})),v.push.apply(v,P)}return v}function y(l){for(var c=1;c<arguments.length;c++){var v=arguments[c]!=null?arguments[c]:{};c%2?A(Object(v),!0).forEach(function(P){N(l,P,v[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(v)):A(Object(v)).forEach(function(P){Object.defineProperty(l,P,Object.getOwnPropertyDescriptor(v,P))})}return l}function N(l,c,v){return(c=D(c))in l?Object.defineProperty(l,c,{value:v,enumerable:!0,configurable:!0,writable:!0}):l[c]=v,l}function D(l){var c=j(l,"string");return typeof c=="symbol"?c:c+""}function j(l,c){if(typeof l!="object"||!l)return l;var v=l[Symbol.toPrimitive];if(v!==void 0){var P=v.call(l,c||"default");if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(l)}function $(l){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=arguments.length>2?arguments[2]:void 0,P=arguments.length>3?arguments[3]:void 0,E={},F=P&&P.depth||1;if(l&&typeof l.properties=="object"){let q=Array.isArray(l.required)?l.required:[],W={};for(let U of q)W[U]=!0;Object.keys(l.properties).forEach(U=>{if(c.skipNonRequired&&!W.hasOwnProperty(U))return;let K=(0,I.traverse)(l.properties[U],c,v,{propertyName:U,depth:F+1});if(c.skipReadOnly&&K.readOnly){P!=null&&P.isAllOfChild&&(E[U]=h.SKIP_SYMBOL);return}if(c.skipWriteOnly&&K.writeOnly){P!=null&&P.isAllOfChild&&(E[U]=h.SKIP_SYMBOL);return}if(c?.format==="xml"){let{propertyName:f,value:m}=(0,h.applyXMLAttributes)(K,l.properties[U],{propertyName:U});f?E[f]=m:m!==null&&typeof m=="object"&&(E=y(y({},E),m))}else E[U]=K.value})}if(l&&typeof l.additionalProperties=="object"){let q=l.additionalProperties["x-additionalPropertiesName"]||"property";E["".concat(String(q),"1")]=(0,I.traverse)(l.additionalProperties,c,v,{depth:F+1}).value,E["".concat(String(q),"2")]=(0,I.traverse)(l.additionalProperties,c,v,{depth:F+1}).value}if(l&&typeof l.properties=="object"&&l.maxProperties!==void 0&&Object.keys(E).length>l.maxProperties){let q={},W=0;(Array.isArray(l.required)?l.required:[]).forEach(K=>{E[K]!==void 0&&(q[K]=E[K],W++)}),Object.keys(E).forEach(K=>{W<l.maxProperties&&!q.hasOwnProperty(K)&&(q[K]=E[K],W++)}),E=q}return E}},{"../traverse":14,"../utils":15}],12:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.regexSample=y;function I(){return!0}function h(N,D){return N}function A(N,D,j){let $=1;if(N)switch(N){case"?":{$=I()?0:1;break}case"*":{$=h(0,8);break}case"+":{$=h(1,8);break}default:throw new Error("Unknown quantifier symbol provided.")}else D!=null&&j!=null?$=h(parseInt(D),parseInt(j)):D!=null&&j==null&&($=parseInt(D));return $}function y(N){let D=!1;if(N instanceof RegExp){var j,$;D=N.flags.includes("i"),N=N.toString(),N=(j=($=N.match(/\/(.+?)\//))===null||$===void 0?void 0:$[1])!==null&&j!==void 0?j:""}N=N.replace(/^(\^)?(.*?)(\$)?$/,"$2");let l,c,v,P=/([.A-Za-z0-9])(?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+))(?![^[]*]|[^{]*})/,E=N.match(P);for(;E!=null;){let K=E[2],f=E[3],m=E[4];v=A(m,K,f),N=N.slice(0,E.index)+E[1].repeat(v)+N.slice(E.index+E[0].length),E=N.match(P)}let F=/(\d-\d|\w-\w|\d|\w|[-!@#$&()`.+,/"])/,q=/\[(\^|)(-|)(.+?)\](?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+)|)/;for(E=N.match(q);E!=null;){let K=E[1]==="^",f=E[2]==="-",m=E[4],a=E[5],x=E[6],b=[],T=E[3],B=T.match(F);for(f&&b.push(45);B!=null;){if(B[0].indexOf("-")===-1)D&&isNaN(Number(B[0]))?(b.push(B[0].toUpperCase().charCodeAt(0)),b.push(B[0].toLowerCase().charCodeAt(0))):b.push(B[0].charCodeAt(0));else{let H=B[0].split("-").map(S=>S.charCodeAt(0));if(l=H[0],c=H[1],l>c)throw new Error("Character range provided is out of order.");for(let S=l;S<=c;S++)if(D&&isNaN(Number(String.fromCharCode(S)))){let G=String.fromCharCode(S);b.push(G.toUpperCase().charCodeAt(0)),b.push(G.toLowerCase().charCodeAt(0))}else b.push(S)}T=T.substring(B[0].length),B=T.match(F)}if(v=A(x,m,a),K){let H=-1;for(let S=48;S<=57;S++){if(H=b.indexOf(S),H>-1){b.splice(H,1);continue}b.push(S)}for(let S=65;S<=90;S++){if(H=b.indexOf(S),H>-1){b.splice(H,1);continue}b.push(S)}for(let S=97;S<=122;S++){if(H=b.indexOf(S),H>-1){b.splice(H,1);continue}b.push(S)}}let Q=Array.from({length:v},()=>String.fromCharCode(b[h(0,b.length-1)])).join("");N=N.slice(0,E.index)+Q+N.slice(E.index+E[0].length),E=N.match(q)}let W=/(.)\{(\d+)\,(\d+)\}/;for(E=N.match(W);E!=null;){if(l=parseInt(E[2]),c=parseInt(E[3]),l>c)throw new Error("Numbers out of order in {} quantifier.");v=h(l,c),N=N.slice(0,E.index)+E[1].repeat(v)+N.slice(E.index+E[0].length),E=N.match(W)}let U=/(.)\{(\d+)\}/;for(E=N.match(U);E!=null;)v=parseInt(E[2]),N=N.slice(0,E.index)+E[1].repeat(v)+N.slice(E.index+E[0].length),E=N.match(U);return N}},{}],13:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.sampleString=H;var I=_("../utils"),h=A(_("./string-regex"));function A(S,G){if(typeof WeakMap=="function")var X=new WeakMap,tt=new WeakMap;return(A=function(Z,z){if(!z&&Z&&Z.__esModule)return Z;var nt,ut,gt={__proto__:null,default:Z};if(Z===null||typeof Z!="object"&&typeof Z!="function")return gt;if(nt=z?tt:X){if(nt.has(Z))return nt.get(Z);nt.set(Z,gt)}for(let ht in Z)ht!=="default"&&{}.hasOwnProperty.call(Z,ht)&&((ut=(nt=Object.defineProperty)&&Object.getOwnPropertyDescriptor(Z,ht))&&(ut.get||ut.set)?nt(gt,ht,ut):gt[ht]=Z[ht]);return gt})(S,G)}let y="qwerty!@#$%^123456";function N(){return"user@example.com"}function D(){return"\u043F\u043E\u0448\u0442\u0430@\u0443\u043A\u0440.\u043D\u0435\u0442"}function j(S,G){let X="pa$$word";return S>X.length&&(X+="_",X+=(0,I.ensureMinLength)(y,S-X.length).substring(0,S-X.length)),X}function $(S){let{min:G,max:X,omitTime:tt,omitDate:Z}=S,z=(0,I.toRFCDateTime)(new Date("2019-08-24T14:15:22.123Z"),tt,Z,!1);return z.length<G&&console.warn("Using minLength = ".concat(G,' is incorrect with format "date-time"')),X&&z.length>X&&console.warn("Using maxLength = ".concat(X,' is incorrect with format "date-time"')),z}function l(S,G){return $({min:S,max:G,omitTime:!1,omitDate:!1})}function c(S,G){return $({min:S,max:G,omitTime:!0,omitDate:!1})}function v(S,G){return $({min:S,max:G,omitTime:!1,omitDate:!0}).slice(1)}function P(S,G,X,tt){let Z=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(tt&&Z)return h.regexSample(tt);let z=(0,I.ensureMinLength)("string",S);return G&&z.length>G&&(z=z.substring(0,G)),z}function E(){return"192.168.0.1"}function F(){return"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}function q(){return"example.com"}function W(){return"\u043F\u0440\u0438\u043A\u043B\u0430\u0434.\u0443\u043A\u0440"}function U(){return"http://example.com"}function K(){return"../dictionary"}function f(){return"http://example.com/{endpoint}"}function m(){return"http://example.com/entity/1"}function a(){return"/entity/1"}function x(S,G,X){return(0,I.uuid)(X||"id")}function b(){return"/json/pointer"}function T(){return"1/relative/json/pointer"}function B(){return"/regex/"}let Q={email:N,"idn-email":D,password:j,"date-time":l,date:c,time:v,ipv4:E,ipv6:F,hostname:q,"idn-hostname":W,iri:m,"iri-reference":a,uri:U,"uri-reference":K,"uri-template":f,uuid:x,default:P,"json-pointer":b,"relative-json-pointer":T,regex:B};function H(S,G,X,tt){let Z=S.format||"default",z=Q[Z]||P,nt=tt&&tt.propertyName;return z(S.minLength||0,S.maxLength,nt,S.pattern,G?.enablePatterns)}},{"../utils":15,"./string-regex":12}],14:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.clearCache=U,w.traverse=m;var I=_("./openapi-sampler"),h=_("./allOf"),A=_("./infer"),y=_("./utils"),N=j(_("json-pointer"));let D=["if","then"];function j(a){return a&&a.__esModule?a:{default:a}}function $(a,x){if(a==null)return{};var b,T,B=l(a,x);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(a);for(T=0;T<Q.length;T++)b=Q[T],x.indexOf(b)===-1&&{}.propertyIsEnumerable.call(a,b)&&(B[b]=a[b])}return B}function l(a,x){if(a==null)return{};var b={};for(var T in a)if({}.hasOwnProperty.call(a,T)){if(x.indexOf(T)!==-1)continue;b[T]=a[T]}return b}function c(a,x){var b=Object.keys(a);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(a);x&&(T=T.filter(function(B){return Object.getOwnPropertyDescriptor(a,B).enumerable})),b.push.apply(b,T)}return b}function v(a){for(var x=1;x<arguments.length;x++){var b=arguments[x]!=null?arguments[x]:{};x%2?c(Object(b),!0).forEach(function(T){P(a,T,b[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):c(Object(b)).forEach(function(T){Object.defineProperty(a,T,Object.getOwnPropertyDescriptor(b,T))})}return a}function P(a,x,b){return(x=E(x))in a?Object.defineProperty(a,x,{value:b,enumerable:!0,configurable:!0,writable:!0}):a[x]=b,a}function E(a){var x=F(a,"string");return typeof x=="symbol"?x:x+""}function F(a,x){if(typeof a!="object"||!a)return a;var b=a[Symbol.toPrimitive];if(b!==void 0){var T=b.call(a,x||"default");if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(x==="string"?String:Number)(a)}let q={},W=[];function U(){q={},W=[]}function K(a){let x;return a.const!==void 0?x=a.const:a.examples!==void 0&&a.examples.length?x=a.examples[0]:a.enum!==void 0&&a.enum.length?x=a.enum[0]:a.default!==void 0&&(x=a.default),x}function f(a){let x=K(a);if(x!==void 0)return{value:x,readOnly:a.readOnly,writeOnly:a.writeOnly,type:null}}function m(a,x,b,T){if(T){if(W.includes(a))return(0,y.getResultForCircular)((0,A.inferType)(a));W.push(a)}if(T&&T.depth>x.maxSampleDepth)return(0,y.popSchemaStack)(W,T),(0,y.getResultForCircular)((0,A.inferType)(a));if(a.$ref){if(!b)throw new Error("Your schema contains $ref. You must provide full specification in the third parameter.");let S=decodeURIComponent(a.$ref);S.startsWith("#")&&(S=S.substring(1));let G=N.default.get(b,S),X;if(q[S]!==!0){q[S]=!0;let tt=m(G,x,b,T);if(x.format==="xml"){let Z=S.split("/").pop(),z=v(v({},T),{},{propertyName:T?.propertyName||Z}),{propertyName:nt,value:ut}=(0,y.applyXMLAttributes)(tt,G,z);X=v(v({},tt),{},{value:{[nt||"root"]:ut}})}else X=tt;q[S]=!1}else{let tt=(0,A.inferType)(G);X=(0,y.getResultForCircular)(tt)}return(0,y.popSchemaStack)(W,T),X}if(a.example!==void 0)return(0,y.popSchemaStack)(W,T),{value:a.example,readOnly:a.readOnly,writeOnly:a.writeOnly,type:a.type};if(a.allOf!==void 0)return(0,y.popSchemaStack)(W,T),f(a)||(0,h.allOfSample)(v(v({},a),{},{allOf:void 0}),a.allOf,x,b,T);if(a.oneOf&&a.oneOf.length){a.anyOf&&(x.quiet||console.warn("oneOf and anyOf are not supported on the same level. Skipping anyOf")),(0,y.popSchemaStack)(W,T);let S=Object.assign({readOnly:a.readOnly,writeOnly:a.writeOnly},a.oneOf[0]);return H(a,S)}if(a.anyOf&&a.anyOf.length){(0,y.popSchemaStack)(W,T);let S=Object.assign({readOnly:a.readOnly,writeOnly:a.writeOnly},a.anyOf[0]);return H(a,S)}if(a.if&&a.then){(0,y.popSchemaStack)(W,T);let{if:S,then:G}=a,X=$(a,D);return m((0,y.mergeDeep)(X,S,G),x,b,T)}let B=K(a),Q=null;if(B===void 0){B=null,Q=a.type,Array.isArray(Q)&&a.type.length>0&&(Q=a.type[0]),Q||(Q=(0,A.inferType)(a));let S=I._samplers[Q];S&&(B=S(a,x,b,T))}return(0,y.popSchemaStack)(W,T),{value:B,readOnly:a.readOnly,writeOnly:a.writeOnly,type:Q};function H(S,G){let X=f(S);if(X!==void 0)return X;let tt=m(v(v({},S),{},{oneOf:void 0,anyOf:void 0}),x,b,T),Z=m(G,x,b,T);if(typeof tt.value=="object"&&typeof Z.value=="object"){let z=(0,y.mergeDeep)(tt.value,Z.value);return v(v({},Z),{},{value:z})}return Z}}},{"./allOf":4,"./infer":5,"./openapi-sampler":6,"./utils":15,"json-pointer":3}],15:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.SKIP_SYMBOL=void 0,w.applyXMLAttributes=W,w.ensureMinLength=l,w.getResultForCircular=P,w.getXMLAttributes=F,w.mergeDeep=c,w.popSchemaStack=E,w.toRFCDateTime=$,w.uuid=v;function I(f,m){var a=Object.keys(f);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(f);m&&(x=x.filter(function(b){return Object.getOwnPropertyDescriptor(f,b).enumerable})),a.push.apply(a,x)}return a}function h(f){for(var m=1;m<arguments.length;m++){var a=arguments[m]!=null?arguments[m]:{};m%2?I(Object(a),!0).forEach(function(x){A(f,x,a[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(a)):I(Object(a)).forEach(function(x){Object.defineProperty(f,x,Object.getOwnPropertyDescriptor(a,x))})}return f}function A(f,m,a){return(m=y(m))in f?Object.defineProperty(f,m,{value:a,enumerable:!0,configurable:!0,writable:!0}):f[m]=a,f}function y(f){var m=N(f,"string");return typeof m=="symbol"?m:m+""}function N(f,m){if(typeof f!="object"||!f)return f;var a=f[Symbol.toPrimitive];if(a!==void 0){var x=a.call(f,m||"default");if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(f)}let D=w.SKIP_SYMBOL=Symbol("skip");function j(f){return f<10?"0"+f:f}function $(f,m,a,x){var b=a?"":f.getUTCFullYear()+"-"+j(f.getUTCMonth()+1)+"-"+j(f.getUTCDate());return m||(b+="T"+j(f.getUTCHours())+":"+j(f.getUTCMinutes())+":"+j(f.getUTCSeconds())+(x?"."+(f.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5):"")+"Z"),b}function l(f,m){return m>f.length?f.repeat(Math.trunc(m/f.length)+1).substring(0,m):f}function c(){let f=b=>b&&typeof b=="object";for(var m=arguments.length,a=new Array(m),x=0;x<m;x++)a[x]=arguments[x];return a.reduce((b,T)=>(Object.keys(T||{}).forEach(B=>{let Q=b[B],H=T[B];f(Q)&&f(H)?b[B]=c(Q,H):b[B]=H}),b),Array.isArray(a[a.length-1])?[]:{})}function v(f){var m=U(f),a=K(m,m,m,m),x="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,b=>{var T=a()*16%16|0;return(b=="x"?T:T&3|8).toString(16)});return x}function P(f){return{value:f==="object"?{}:f==="array"?[]:void 0}}function E(f,m){m&&f.pop()}function F(f){var m,a,x,b,T,B,Q;return{name:(f==null||(m=f.xml)===null||m===void 0?void 0:m.name)||"",prefix:(f==null||(a=f.xml)===null||a===void 0?void 0:a.prefix)||"",namespace:(f==null||(x=f.xml)===null||x===void 0?void 0:x.namespace)||null,attribute:(b=f==null||(T=f.xml)===null||T===void 0?void 0:T.attribute)!==null&&b!==void 0?b:!1,wrapped:(B=f==null||(Q=f.xml)===null||Q===void 0?void 0:Q.wrapped)!==null&&B!==void 0?B:!1}}function q(f){let m=f?.xml;return m!=null&&m.nodeType?m.nodeType:m?.attribute===!0?"attribute":m?.wrapped===!0&&f?.type==="array"?"element":f!=null&&f.$ref||f!=null&&f.$dynamicRef||f?.type==="array"||f!=null&&f.oneOf||f!=null&&f.anyOf||f!=null&&f.allOf?"none":"element"}function W(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{value:x}=f,{propertyName:b}=a,{name:T,prefix:B,namespace:Q}=F(m),H=q(m),S=T||b?"".concat(B?B+":":"").concat(T||b):null,G=typeof x=="object"?Array.isArray(x)?[...x]:h({},x):x;switch(H){case"attribute":S&&(S="$".concat(S));break;case"text":S="#text";break;case"cdata":S="#cdata";break;case"none":if(m.type==="array"){if(S=null,m.example!==void 0){var X;S=((X=m.items)===null||X===void 0||(X=X.xml)===null||X===void 0?void 0:X.name)||S}}else S=null;break;default:m.type==="array"&&Array.isArray(G)&&(G={[S]:[...G]});break}return Q&&H!=="text"&&H!=="cdata"&&H!=="none"&&(typeof G=="object"?G["$xmlns".concat(B?":"+B:"")]=Q:G={["$xmlns".concat(B?":"+B:"")]:Q,"#text":G}),{propertyName:S,value:G}}function U(f){var m=0;if(f.length==0)return m;for(var a=0;a<f.length;a++){var x=f.charCodeAt(a);m=(m<<5)-m+x,m=m&m}return m}function K(f,m,a,x){return function(){f|=0,m|=0,a|=0,x|=0;var b=f-(m<<27|m>>>5)|0;return f=m^(a<<17|a>>>15),m=a+x|0,a=x+b|0,x=f+b|0,(x>>>0)/4294967296}}},{}]},{},[6])(6)})});var zt=Nt((Ke,Kt)=>{"use strict";Kt.exports=(Y,C=process.argv)=>{let J=Y.startsWith("-")?"":Y.length===1?"-":"--",_=C.indexOf(J+Y),R=C.indexOf("--");return _!==-1&&(R===-1||_<R)}});var We=Nt((ze,Zt)=>{"use strict";var Ge=bt("os"),Jt=bt("tty"),ft=zt(),{env:it}=process,mt;ft("no-color")||ft("no-colors")||ft("color=false")||ft("color=never")?mt=0:(ft("color")||ft("colors")||ft("color=true")||ft("color=always"))&&(mt=1);"FORCE_COLOR"in it&&(it.FORCE_COLOR==="true"?mt=1:it.FORCE_COLOR==="false"?mt=0:mt=it.FORCE_COLOR.length===0?1:Math.min(parseInt(it.FORCE_COLOR,10),3));function It(Y){return Y===0?!1:{level:Y,hasBasic:!0,has256:Y>=2,has16m:Y>=3}}function Dt(Y,C){if(mt===0)return 0;if(ft("color=16m")||ft("color=full")||ft("color=truecolor"))return 3;if(ft("color=256"))return 2;if(Y&&!C&&mt===void 0)return 0;let J=mt||0;if(it.TERM==="dumb")return J;if(process.platform==="win32"){let _=Ge.release().split(".");return Number(_[0])>=10&&Number(_[2])>=10586?Number(_[2])>=14931?3:2:1}if("CI"in it)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(_=>_ in it)||it.CI_NAME==="codeship"?1:J;if("TEAMCITY_VERSION"in it)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(it.TEAMCITY_VERSION)?1:0;if(it.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in it){let _=parseInt((it.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(it.TERM_PROGRAM){case"iTerm.app":return _>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(it.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(it.TERM)||"COLORTERM"in it?1:J}function Be(Y){let C=Dt(Y,Y&&Y.isTTY);return It(C)}Zt.exports={supportsColor:Be,stdout:It(Dt(!0,Jt.isatty(1))),stderr:It(Dt(!0,Jt.isatty(2)))}});export{Fe as a,Ue as b,We as c};
13
+ `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function Me(r,t,e,i){let n=this.extractAttributes(r);if(i.push(t,n),this.checkStopNode(i)){let u=this.buildRawContent(r),s=this.buildAttributesForStopNode(r);return i.pop(),this.buildObjectNode(u,t,s,e)}let o=this.j2x(r,e+1,i);return i.pop(),r[this.options.textNodeName]!==void 0&&Object.keys(r).length===1?this.buildTextValNode(r[this.options.textNodeName],t,o.attrStr,e,i):this.buildObjectNode(o.val,t,o.attrStr,e)}function Ie(r){return this.options.indentBy.repeat(r)}function De(r){return!(!r.startsWith(this.options.attributeNamePrefix)||r===this.options.textNodeName)&&r.substr(this.attrPrefixLen)}pt.prototype.build=function(r){if(this.options.preserveOrder)return Pe(r,this.options);{Array.isArray(r)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(r={[this.options.arrayNodeName]:r});let t=new Ot;return this.j2x(r,0,t).val}},pt.prototype.j2x=function(r,t,e){let i="",n="";if(this.options.maxNestedTags&&e.getDepth()>=this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");let o=this.options.jPath?e.toString():e,u=this.checkStopNode(e);for(let s in r)if(Object.prototype.hasOwnProperty.call(r,s))if(r[s]===void 0)this.isAttribute(s)&&(n+="");else if(r[s]===null)this.isAttribute(s)||s===this.options.cdataPropName?n+="":s[0]==="?"?n+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(r[s]instanceof Date)n+=this.buildTextValNode(r[s],s,"",t,e);else if(typeof r[s]!="object"){let d=this.isAttribute(s);if(d&&!this.ignoreAttributesFn(d,o))i+=this.buildAttrPairStr(d,""+r[s],u);else if(!d)if(s===this.options.textNodeName){let p=this.options.tagValueProcessor(s,""+r[s]);n+=this.replaceEntitiesValue(p)}else{e.push(s);let p=this.checkStopNode(e);if(e.pop(),p){let g=""+r[s];n+=g===""?this.indentate(t)+"<"+s+this.closeTag(s)+this.tagEndChar:this.indentate(t)+"<"+s+">"+g+"</"+s+this.tagEndChar}else n+=this.buildTextValNode(r[s],s,"",t,e)}}else if(Array.isArray(r[s])){let d=r[s].length,p="",g="";for(let O=0;O<d;O++){let M=r[s][O];if(M!==void 0)if(M===null)s[0]==="?"?n+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(typeof M=="object")if(this.options.oneListGroup){e.push(s);let L=this.j2x(M,t+1,e);e.pop(),p+=L.val,this.options.attributesGroupName&&M.hasOwnProperty(this.options.attributesGroupName)&&(g+=L.attrStr)}else p+=this.processTextOrObjNode(M,s,t,e);else if(this.options.oneListGroup){let L=this.options.tagValueProcessor(s,M);L=this.replaceEntitiesValue(L),p+=L}else{e.push(s);let L=this.checkStopNode(e);if(e.pop(),L){let k=""+M;p+=k===""?this.indentate(t)+"<"+s+this.closeTag(s)+this.tagEndChar:this.indentate(t)+"<"+s+">"+k+"</"+s+this.tagEndChar}else p+=this.buildTextValNode(M,s,"",t,e)}}this.options.oneListGroup&&(p=this.buildObjectNode(p,s,g,t)),n+=p}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){let d=Object.keys(r[s]),p=d.length;for(let g=0;g<p;g++)i+=this.buildAttrPairStr(d[g],""+r[s][d[g]],u)}else n+=this.processTextOrObjNode(r[s],s,t,e);return{attrStr:i,val:n}},pt.prototype.buildAttrPairStr=function(r,t,e){return e||(t=this.options.attributeValueProcessor(r,""+t),t=this.replaceEntitiesValue(t)),this.options.suppressBooleanAttributes&&t==="true"?" "+r:" "+r+'="'+t+'"'},pt.prototype.extractAttributes=function(r){if(!r||typeof r!="object")return null;let t={},e=!1;if(this.options.attributesGroupName&&r[this.options.attributesGroupName]){let i=r[this.options.attributesGroupName];for(let n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n.startsWith(this.options.attributeNamePrefix)?n.substring(this.options.attributeNamePrefix.length):n]=i[n],e=!0)}else for(let i in r){if(!Object.prototype.hasOwnProperty.call(r,i))continue;let n=this.isAttribute(i);n&&(t[n]=r[i],e=!0)}return e?t:null},pt.prototype.buildRawContent=function(r){if(typeof r=="string")return r;if(typeof r!="object"||r===null)return String(r);if(r[this.options.textNodeName]!==void 0)return r[this.options.textNodeName];let t="";for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e)||this.isAttribute(e)||this.options.attributesGroupName&&e===this.options.attributesGroupName)continue;let i=r[e];if(e===this.options.textNodeName)t+=i;else if(Array.isArray(i)){for(let n of i)if(typeof n=="string"||typeof n=="number")t+=`<${e}>${n}</${e}>`;else if(typeof n=="object"&&n!==null){let o=this.buildRawContent(n),u=this.buildAttributesForStopNode(n);t+=o===""?`<${e}${u}/>`:`<${e}${u}>${o}</${e}>`}}else if(typeof i=="object"&&i!==null){let n=this.buildRawContent(i),o=this.buildAttributesForStopNode(i);t+=n===""?`<${e}${o}/>`:`<${e}${o}>${n}</${e}>`}else t+=`<${e}>${i}</${e}>`}return t},pt.prototype.buildAttributesForStopNode=function(r){if(!r||typeof r!="object")return"";let t="";if(this.options.attributesGroupName&&r[this.options.attributesGroupName]){let e=r[this.options.attributesGroupName];for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let n=i.startsWith(this.options.attributeNamePrefix)?i.substring(this.options.attributeNamePrefix.length):i,o=e[i];o===!0&&this.options.suppressBooleanAttributes?t+=" "+n:t+=" "+n+'="'+o+'"'}}else for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let i=this.isAttribute(e);if(i){let n=r[e];n===!0&&this.options.suppressBooleanAttributes?t+=" "+i:t+=" "+i+'="'+n+'"'}}return t},pt.prototype.buildObjectNode=function(r,t,e,i){if(r==="")return t[0]==="?"?this.indentate(i)+"<"+t+e+"?"+this.tagEndChar:this.indentate(i)+"<"+t+e+this.closeTag(t)+this.tagEndChar;{let n="</"+t+this.tagEndChar,o="";return t[0]==="?"&&(o="?",n=""),!e&&e!==""||r.indexOf("<")!==-1?this.options.commentPropName!==!1&&t===this.options.commentPropName&&o.length===0?this.indentate(i)+`<!--${r}-->`+this.newLine:this.indentate(i)+"<"+t+e+o+this.tagEndChar+r+this.indentate(i)+n:this.indentate(i)+"<"+t+e+o+">"+r+n}},pt.prototype.closeTag=function(r){let t="";return this.options.unpairedTags.indexOf(r)!==-1?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${r}`,t},pt.prototype.checkStopNode=function(r){if(!this.stopNodeExpressions||this.stopNodeExpressions.length===0)return!1;for(let t=0;t<this.stopNodeExpressions.length;t++)if(r.matches(this.stopNodeExpressions[t]))return!0;return!1},pt.prototype.buildTextValNode=function(r,t,e,i,n){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName){let o=String(r).replace(/\]\]>/g,"]]]]><![CDATA[>");return this.indentate(i)+`<![CDATA[${o}]]>`+this.newLine}if(this.options.commentPropName!==!1&&t===this.options.commentPropName){let o=String(r).replace(/--/g,"- -").replace(/-$/,"- ");return this.indentate(i)+`<!--${o}-->`+this.newLine}if(t[0]==="?")return this.indentate(i)+"<"+t+e+"?"+this.tagEndChar;{let o=this.options.tagValueProcessor(t,r);return o=this.replaceEntitiesValue(o),o===""?this.indentate(i)+"<"+t+e+this.closeTag(t)+this.tagEndChar:this.indentate(i)+"<"+t+e+">"+o+"</"+t+this.tagEndChar}},pt.prototype.replaceEntitiesValue=function(r){if(r&&r.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){let e=this.options.entities[t];r=r.replace(e.regex,e.val)}return r};let $e=pt,Le={validate:c};R.exports=h})()},{}],2:[function(_,R,w){var I=Object.prototype.hasOwnProperty,h=Object.prototype.toString;R.exports=function(y,N,D){if(h.call(N)!=="[object Function]")throw new TypeError("iterator must be a function");var j=y.length;if(j===+j)for(var $=0;$<j;$++)N.call(D,y[$],$,y);else for(var l in y)I.call(y,l)&&N.call(D,y[l],l,y)}},{}],3:[function(_,R,w){"use strict";var I=_("foreach");R.exports=h;function h(A,y,N){if(arguments.length===3)return h.set(A,y,N);if(arguments.length===2)return h.get(A,y);var D=h.bind(h,A);for(var j in h)h.hasOwnProperty(j)&&(D[j]=h[j].bind(D,A));return D}h.get=function(y,N){for(var D=Array.isArray(N)?N:h.parse(N),j=0;j<D.length;++j){var $=D[j];if(!(typeof y=="object"&&$ in y))throw new Error("Invalid reference token: "+$);y=y[$]}return y},h.set=function(y,N,D){var j=Array.isArray(N)?N:h.parse(N),$=j[0];if(j.length===0)throw Error("Can not set the root object");for(var l=0;l<j.length-1;++l){var c=j[l];typeof c!="string"&&typeof c!="number"&&(c=String(c)),!(c==="__proto__"||c==="constructor"||c==="prototype")&&(c==="-"&&Array.isArray(y)&&(c=y.length),$=j[l+1],c in y||($.match(/^(\d+|-)$/)?y[c]=[]:y[c]={}),y=y[c])}return $==="-"&&Array.isArray(y)&&($=y.length),y[$]=D,this},h.remove=function(A,y){var N=Array.isArray(y)?y:h.parse(y),D=N[N.length-1];if(D===void 0)throw new Error('Invalid JSON pointer for remove: "'+y+'"');var j=h.get(A,N.slice(0,-1));if(Array.isArray(j)){var $=+D;if(D===""&&isNaN($))throw new Error('Invalid array index: "'+D+'"');Array.prototype.splice.call(j,$,1)}else delete j[D]},h.dict=function(y,N){var D={};return h.walk(y,function(j,$){D[$]=j},N),D},h.walk=function(y,N,D){var j=[];D=D||function($){var l=Object.prototype.toString.call($);return l==="[object Object]"||l==="[object Array]"},(function $(l){I(l,function(c,v){j.push(String(v)),D(c)?$(c):N(c,h.compile(j)),j.pop()})})(y)},h.has=function(y,N){try{h.get(y,N)}catch{return!1}return!0},h.escape=function(y){return y.toString().replace(/~/g,"~0").replace(/\//g,"~1")},h.unescape=function(y){return y.replace(/~1/g,"/").replace(/~0/g,"~")},h.parse=function(y){if(y==="")return[];if(y.charAt(0)!=="/")throw new Error("Invalid JSON pointer: "+y);return y.substring(1).split(/\//).map(h.unescape)},h.compile=function(y){return y.length===0?"":"/"+y.map(h.escape).join("/")}},{foreach:2}],4:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.allOfSample=$;var I=_("./traverse"),h=_("./utils");function A(l,c){var v=Object.keys(l);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(l);c&&(P=P.filter(function(E){return Object.getOwnPropertyDescriptor(l,E).enumerable})),v.push.apply(v,P)}return v}function y(l){for(var c=1;c<arguments.length;c++){var v=arguments[c]!=null?arguments[c]:{};c%2?A(Object(v),!0).forEach(function(P){N(l,P,v[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(v)):A(Object(v)).forEach(function(P){Object.defineProperty(l,P,Object.getOwnPropertyDescriptor(v,P))})}return l}function N(l,c,v){return(c=D(c))in l?Object.defineProperty(l,c,{value:v,enumerable:!0,configurable:!0,writable:!0}):l[c]=v,l}function D(l){var c=j(l,"string");return typeof c=="symbol"?c:c+""}function j(l,c){if(typeof l!="object"||!l)return l;var v=l[Symbol.toPrimitive];if(v!==void 0){var P=v.call(l,c||"default");if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(l)}function $(l,c,v,P,E){let F=(0,I.traverse)(l,v,P),q=[];for(let W of c){let{type:U,readOnly:K,writeOnly:f,value:m}=(0,I.traverse)(y({type:F.type},W),v,P,y(y({},E),{},{isAllOfChild:!0}));F.type&&U&&U!==F.type&&(console.warn("allOf: schemas with different types can't be merged"),F.type=U),F.type=F.type||U,F.readOnly=F.readOnly||K,F.writeOnly=F.writeOnly||f,m!=null&&q.push(m)}if(F.type==="object"){F.value=(0,h.mergeDeep)(F.value||{},...q.filter(W=>typeof W=="object"));for(let W in F.value)F.value[W]===h.SKIP_SYMBOL&&delete F.value[W];return F}else{F.type==="array"&&(v.quiet||console.warn('OpenAPI Sampler: found allOf with "array" type. Result may be incorrect'));let W=q[q.length-1];return F.value=W??F.value,F}}},{"./traverse":14,"./utils":15}],5:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.inferType=h;let I={multipleOf:"number",maximum:"number",exclusiveMaximum:"number",minimum:"number",exclusiveMinimum:"number",maxLength:"string",minLength:"string",pattern:"string",items:"array",maxItems:"array",minItems:"array",uniqueItems:"array",additionalItems:"array",maxProperties:"object",minProperties:"object",required:"object",additionalProperties:"object",properties:"object",patternProperties:"object",dependencies:"object"};function h(A){if(A.type!==void 0)return Array.isArray(A.type)?A.type.length===0?null:A.type[0]:A.type;let y=Object.keys(I);for(var N=0;N<y.length;N++){let D=y[N],j=I[D];if(A[D]!==void 0)return j}return null}},{}],6:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w._registerSampler=l,w._samplers=void 0,Object.defineProperty(w,"inferType",{enumerable:!0,get:function(){return y.inferType}}),w.sample=$;var I=_("./traverse"),h=_("./samplers/index"),A=_("fast-xml-parser"),y=_("./infer"),N=w._samplers={};let D={skipReadOnly:!1,maxSampleDepth:15};function j(c,v){if(!c)throw new Error("Unknown format output for building XML.");if(Array.isArray(c)||Object.keys(c).length>1){var P;c={[(v==null||(P=v.xml)===null||P===void 0?void 0:P.name)||"root"]:c}}return new A.XMLBuilder({ignoreAttributes:!1,format:!0,attributeNamePrefix:"$",textNodeName:"#text",cdataPropName:"#cdata"}).build(c)}function $(c,v,P){let E=Object.assign({},D,v);(0,I.clearCache)();let F=(0,I.traverse)(c,E,P).value;return E?.format==="xml"?j(F,c):F}function l(c,v){N[c]=v}l("array",h.sampleArray),l("boolean",h.sampleBoolean),l("integer",h.sampleNumber),l("number",h.sampleNumber),l("object",h.sampleObject),l("string",h.sampleString)},{"./infer":5,"./samplers/index":9,"./traverse":14,"fast-xml-parser":1}],7:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.sampleArray=$;var I=_("../traverse"),h=_("../utils");function A(l,c){var v=Object.keys(l);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(l);c&&(P=P.filter(function(E){return Object.getOwnPropertyDescriptor(l,E).enumerable})),v.push.apply(v,P)}return v}function y(l){for(var c=1;c<arguments.length;c++){var v=arguments[c]!=null?arguments[c]:{};c%2?A(Object(v),!0).forEach(function(P){N(l,P,v[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(v)):A(Object(v)).forEach(function(P){Object.defineProperty(l,P,Object.getOwnPropertyDescriptor(v,P))})}return l}function N(l,c,v){return(c=D(c))in l?Object.defineProperty(l,c,{value:v,enumerable:!0,configurable:!0,writable:!0}):l[c]=v,l}function D(l){var c=j(l,"string");return typeof c=="symbol"?c:c+""}function j(l,c){if(typeof l!="object"||!l)return l;var v=l[Symbol.toPrimitive];if(v!==void 0){var P=v.call(l,c||"default");if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(l)}function $(l){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=arguments.length>2?arguments[2]:void 0,P=arguments.length>3?arguments[3]:void 0,E=P&&P.depth||1,F=Math.min(l.maxItems!=null?l.maxItems:1/0,l.minItems||1),q=l.prefixItems||l.items||l.contains;Array.isArray(q)&&(F=Math.max(F,q.length));let W=f=>Array.isArray(q)?q[f]||{}:q||{},U=[];if(!q)return U;for(let f=0;f<F;f++){let m=W(f),{value:a}=(0,I.traverse)(m,c,v,{depth:E+1});if(c?.format==="xml"){let{value:x,propertyName:b}=(0,h.applyXMLAttributes)({value:a},m,P);if(b){var K;(K=U)!==null&&K!==void 0&&K[b]||(U=y(y({},U),{},{[b]:[]})),U[b].push(x)}else U=y(y({},U),x)}else U.push(a)}if(c?.format==="xml"&&E===1){let{value:f,propertyName:m}=(0,h.applyXMLAttributes)({value:null},l,P);m&&(f?U=Array.isArray(U)?{[m]:y(y({},f),U.map(a=>({"#text":y({},a)})))}:{[m]:y(y({},U),f)}:U={[m]:U})}return U}},{"../traverse":14,"../utils":15}],8:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.sampleBoolean=I;function I(h){return!0}},{}],9:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),Object.defineProperty(w,"sampleArray",{enumerable:!0,get:function(){return I.sampleArray}}),Object.defineProperty(w,"sampleBoolean",{enumerable:!0,get:function(){return h.sampleBoolean}}),Object.defineProperty(w,"sampleNumber",{enumerable:!0,get:function(){return A.sampleNumber}}),Object.defineProperty(w,"sampleObject",{enumerable:!0,get:function(){return y.sampleObject}}),Object.defineProperty(w,"sampleString",{enumerable:!0,get:function(){return N.sampleString}});var I=_("./array"),h=_("./boolean"),A=_("./number"),y=_("./object"),N=_("./string")},{"./array":7,"./boolean":8,"./number":10,"./object":11,"./string":13}],10:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.sampleNumber=I;function I(h){let A=0;if(h.type==="number"&&(h.format==="float"||h.format==="double")&&(A=.1),typeof h.exclusiveMinimum=="boolean"||typeof h.exclusiveMaximum=="boolean"){if(Number.isFinite(h.maximum)&&Number.isFinite(h.minimum))return A=h.exclusiveMinimum?Math.floor(h.minimum)+1:h.minimum,(h.exclusiveMaximum&&A>=h.maximum||!h.exclusiveMaximum&&A>h.maximum)&&(A=(h.maximum+h.minimum)/2),A;if(Number.isFinite(h.minimum))return h.exclusiveMinimum?Math.floor(h.minimum)+1:h.minimum;if(Number.isFinite(h.maximum))return h.exclusiveMaximum?h.maximum>0?0:Math.floor(h.maximum)-1:h.maximum>0?0:h.maximum}else{if(Number.isFinite(h.minimum))return h.minimum;Number.isFinite(h.exclusiveMinimum)?(A=Math.floor(h.exclusiveMinimum)+1,A===h.exclusiveMaximum&&(A=(A+Math.floor(h.exclusiveMaximum)-1)/2)):Number.isFinite(h.exclusiveMaximum)?A=Math.floor(h.exclusiveMaximum)-1:Number.isFinite(h.maximum)&&(A=h.maximum)}return A}},{}],11:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.sampleObject=$;var I=_("../traverse"),h=_("../utils");function A(l,c){var v=Object.keys(l);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(l);c&&(P=P.filter(function(E){return Object.getOwnPropertyDescriptor(l,E).enumerable})),v.push.apply(v,P)}return v}function y(l){for(var c=1;c<arguments.length;c++){var v=arguments[c]!=null?arguments[c]:{};c%2?A(Object(v),!0).forEach(function(P){N(l,P,v[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(v)):A(Object(v)).forEach(function(P){Object.defineProperty(l,P,Object.getOwnPropertyDescriptor(v,P))})}return l}function N(l,c,v){return(c=D(c))in l?Object.defineProperty(l,c,{value:v,enumerable:!0,configurable:!0,writable:!0}):l[c]=v,l}function D(l){var c=j(l,"string");return typeof c=="symbol"?c:c+""}function j(l,c){if(typeof l!="object"||!l)return l;var v=l[Symbol.toPrimitive];if(v!==void 0){var P=v.call(l,c||"default");if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(l)}function $(l){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=arguments.length>2?arguments[2]:void 0,P=arguments.length>3?arguments[3]:void 0,E={},F=P&&P.depth||1;if(l&&typeof l.properties=="object"){let q=Array.isArray(l.required)?l.required:[],W={};for(let U of q)W[U]=!0;Object.keys(l.properties).forEach(U=>{if(c.skipNonRequired&&!W.hasOwnProperty(U))return;let K=(0,I.traverse)(l.properties[U],c,v,{propertyName:U,depth:F+1});if(c.skipReadOnly&&K.readOnly){P!=null&&P.isAllOfChild&&(E[U]=h.SKIP_SYMBOL);return}if(c.skipWriteOnly&&K.writeOnly){P!=null&&P.isAllOfChild&&(E[U]=h.SKIP_SYMBOL);return}if(c?.format==="xml"){let{propertyName:f,value:m}=(0,h.applyXMLAttributes)(K,l.properties[U],{propertyName:U});f?E[f]=m:m!==null&&typeof m=="object"&&(E=y(y({},E),m))}else E[U]=K.value})}if(l&&typeof l.additionalProperties=="object"){let q=l.additionalProperties["x-additionalPropertiesName"]||"property";E["".concat(String(q),"1")]=(0,I.traverse)(l.additionalProperties,c,v,{depth:F+1}).value,E["".concat(String(q),"2")]=(0,I.traverse)(l.additionalProperties,c,v,{depth:F+1}).value}if(l&&typeof l.properties=="object"&&l.maxProperties!==void 0&&Object.keys(E).length>l.maxProperties){let q={},W=0;(Array.isArray(l.required)?l.required:[]).forEach(K=>{E[K]!==void 0&&(q[K]=E[K],W++)}),Object.keys(E).forEach(K=>{W<l.maxProperties&&!q.hasOwnProperty(K)&&(q[K]=E[K],W++)}),E=q}return E}},{"../traverse":14,"../utils":15}],12:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.regexSample=y;function I(){return!0}function h(N,D){return N}function A(N,D,j){let $=1;if(N)switch(N){case"?":{$=I()?0:1;break}case"*":{$=h(0,8);break}case"+":{$=h(1,8);break}default:throw new Error("Unknown quantifier symbol provided.")}else D!=null&&j!=null?$=h(parseInt(D),parseInt(j)):D!=null&&j==null&&($=parseInt(D));return $}function y(N){let D=!1;if(N instanceof RegExp){var j,$;D=N.flags.includes("i"),N=N.toString(),N=(j=($=N.match(/\/(.+?)\//))===null||$===void 0?void 0:$[1])!==null&&j!==void 0?j:""}N=N.replace(/^(\^)?(.*?)(\$)?$/,"$2");let l,c,v,P=/([.A-Za-z0-9])(?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+))(?![^[]*]|[^{]*})/,E=N.match(P);for(;E!=null;){let K=E[2],f=E[3],m=E[4];v=A(m,K,f),N=N.slice(0,E.index)+E[1].repeat(v)+N.slice(E.index+E[0].length),E=N.match(P)}let F=/(\d-\d|\w-\w|\d|\w|[-!@#$&()`.+,/"])/,q=/\[(\^|)(-|)(.+?)\](?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+)|)/;for(E=N.match(q);E!=null;){let K=E[1]==="^",f=E[2]==="-",m=E[4],a=E[5],x=E[6],b=[],T=E[3],B=T.match(F);for(f&&b.push(45);B!=null;){if(B[0].indexOf("-")===-1)D&&isNaN(Number(B[0]))?(b.push(B[0].toUpperCase().charCodeAt(0)),b.push(B[0].toLowerCase().charCodeAt(0))):b.push(B[0].charCodeAt(0));else{let H=B[0].split("-").map(S=>S.charCodeAt(0));if(l=H[0],c=H[1],l>c)throw new Error("Character range provided is out of order.");for(let S=l;S<=c;S++)if(D&&isNaN(Number(String.fromCharCode(S)))){let G=String.fromCharCode(S);b.push(G.toUpperCase().charCodeAt(0)),b.push(G.toLowerCase().charCodeAt(0))}else b.push(S)}T=T.substring(B[0].length),B=T.match(F)}if(v=A(x,m,a),K){let H=-1;for(let S=48;S<=57;S++){if(H=b.indexOf(S),H>-1){b.splice(H,1);continue}b.push(S)}for(let S=65;S<=90;S++){if(H=b.indexOf(S),H>-1){b.splice(H,1);continue}b.push(S)}for(let S=97;S<=122;S++){if(H=b.indexOf(S),H>-1){b.splice(H,1);continue}b.push(S)}}let Q=Array.from({length:v},()=>String.fromCharCode(b[h(0,b.length-1)])).join("");N=N.slice(0,E.index)+Q+N.slice(E.index+E[0].length),E=N.match(q)}let W=/(.)\{(\d+)\,(\d+)\}/;for(E=N.match(W);E!=null;){if(l=parseInt(E[2]),c=parseInt(E[3]),l>c)throw new Error("Numbers out of order in {} quantifier.");v=h(l,c),N=N.slice(0,E.index)+E[1].repeat(v)+N.slice(E.index+E[0].length),E=N.match(W)}let U=/(.)\{(\d+)\}/;for(E=N.match(U);E!=null;)v=parseInt(E[2]),N=N.slice(0,E.index)+E[1].repeat(v)+N.slice(E.index+E[0].length),E=N.match(U);return N}},{}],13:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.sampleString=H;var I=_("../utils"),h=A(_("./string-regex"));function A(S,G){if(typeof WeakMap=="function")var X=new WeakMap,tt=new WeakMap;return(A=function(Z,z){if(!z&&Z&&Z.__esModule)return Z;var nt,ut,gt={__proto__:null,default:Z};if(Z===null||typeof Z!="object"&&typeof Z!="function")return gt;if(nt=z?tt:X){if(nt.has(Z))return nt.get(Z);nt.set(Z,gt)}for(let ht in Z)ht!=="default"&&{}.hasOwnProperty.call(Z,ht)&&((ut=(nt=Object.defineProperty)&&Object.getOwnPropertyDescriptor(Z,ht))&&(ut.get||ut.set)?nt(gt,ht,ut):gt[ht]=Z[ht]);return gt})(S,G)}let y="qwerty!@#$%^123456";function N(){return"user@example.com"}function D(){return"\u043F\u043E\u0448\u0442\u0430@\u0443\u043A\u0440.\u043D\u0435\u0442"}function j(S,G){let X="pa$$word";return S>X.length&&(X+="_",X+=(0,I.ensureMinLength)(y,S-X.length).substring(0,S-X.length)),X}function $(S){let{min:G,max:X,omitTime:tt,omitDate:Z}=S,z=(0,I.toRFCDateTime)(new Date("2019-08-24T14:15:22.123Z"),tt,Z,!1);return z.length<G&&console.warn("Using minLength = ".concat(G,' is incorrect with format "date-time"')),X&&z.length>X&&console.warn("Using maxLength = ".concat(X,' is incorrect with format "date-time"')),z}function l(S,G){return $({min:S,max:G,omitTime:!1,omitDate:!1})}function c(S,G){return $({min:S,max:G,omitTime:!0,omitDate:!1})}function v(S,G){return $({min:S,max:G,omitTime:!1,omitDate:!0}).slice(1)}function P(S,G,X,tt){let Z=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(tt&&Z)return h.regexSample(tt);let z=(0,I.ensureMinLength)("string",S);return G&&z.length>G&&(z=z.substring(0,G)),z}function E(){return"192.168.0.1"}function F(){return"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}function q(){return"example.com"}function W(){return"\u043F\u0440\u0438\u043A\u043B\u0430\u0434.\u0443\u043A\u0440"}function U(){return"http://example.com"}function K(){return"../dictionary"}function f(){return"http://example.com/{endpoint}"}function m(){return"http://example.com/entity/1"}function a(){return"/entity/1"}function x(S,G,X){return(0,I.uuid)(X||"id")}function b(){return"/json/pointer"}function T(){return"1/relative/json/pointer"}function B(){return"/regex/"}let Q={email:N,"idn-email":D,password:j,"date-time":l,date:c,time:v,ipv4:E,ipv6:F,hostname:q,"idn-hostname":W,iri:m,"iri-reference":a,uri:U,"uri-reference":K,"uri-template":f,uuid:x,default:P,"json-pointer":b,"relative-json-pointer":T,regex:B};function H(S,G,X,tt){let Z=S.format||"default",z=Q[Z]||P,nt=tt&&tt.propertyName;return z(S.minLength||0,S.maxLength,nt,S.pattern,G?.enablePatterns)}},{"../utils":15,"./string-regex":12}],14:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.clearCache=U,w.traverse=m;var I=_("./openapi-sampler"),h=_("./allOf"),A=_("./infer"),y=_("./utils"),N=j(_("json-pointer"));let D=["if","then"];function j(a){return a&&a.__esModule?a:{default:a}}function $(a,x){if(a==null)return{};var b,T,B=l(a,x);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(a);for(T=0;T<Q.length;T++)b=Q[T],x.indexOf(b)===-1&&{}.propertyIsEnumerable.call(a,b)&&(B[b]=a[b])}return B}function l(a,x){if(a==null)return{};var b={};for(var T in a)if({}.hasOwnProperty.call(a,T)){if(x.indexOf(T)!==-1)continue;b[T]=a[T]}return b}function c(a,x){var b=Object.keys(a);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(a);x&&(T=T.filter(function(B){return Object.getOwnPropertyDescriptor(a,B).enumerable})),b.push.apply(b,T)}return b}function v(a){for(var x=1;x<arguments.length;x++){var b=arguments[x]!=null?arguments[x]:{};x%2?c(Object(b),!0).forEach(function(T){P(a,T,b[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):c(Object(b)).forEach(function(T){Object.defineProperty(a,T,Object.getOwnPropertyDescriptor(b,T))})}return a}function P(a,x,b){return(x=E(x))in a?Object.defineProperty(a,x,{value:b,enumerable:!0,configurable:!0,writable:!0}):a[x]=b,a}function E(a){var x=F(a,"string");return typeof x=="symbol"?x:x+""}function F(a,x){if(typeof a!="object"||!a)return a;var b=a[Symbol.toPrimitive];if(b!==void 0){var T=b.call(a,x||"default");if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(x==="string"?String:Number)(a)}let q={},W=[];function U(){q={},W=[]}function K(a){let x;return a.const!==void 0?x=a.const:a.examples!==void 0&&a.examples.length?x=a.examples[0]:a.enum!==void 0&&a.enum.length?x=a.enum[0]:a.default!==void 0&&(x=a.default),x}function f(a){let x=K(a);if(x!==void 0)return{value:x,readOnly:a.readOnly,writeOnly:a.writeOnly,type:null}}function m(a,x,b,T){if(T){if(W.includes(a))return(0,y.getResultForCircular)((0,A.inferType)(a));W.push(a)}if(T&&T.depth>x.maxSampleDepth)return(0,y.popSchemaStack)(W,T),(0,y.getResultForCircular)((0,A.inferType)(a));if(a.$ref){if(!b)throw new Error("Your schema contains $ref. You must provide full specification in the third parameter.");let S=decodeURIComponent(a.$ref);S.startsWith("#")&&(S=S.substring(1));let G=N.default.get(b,S),X;if(q[S]!==!0){q[S]=!0;let tt=m(G,x,b,T);if(x.format==="xml"){let Z=S.split("/").pop(),z=v(v({},T),{},{propertyName:T?.propertyName||Z}),{propertyName:nt,value:ut}=(0,y.applyXMLAttributes)(tt,G,z);X=v(v({},tt),{},{value:{[nt||"root"]:ut}})}else X=tt;q[S]=!1}else{let tt=(0,A.inferType)(G);X=(0,y.getResultForCircular)(tt)}return(0,y.popSchemaStack)(W,T),X}if(a.example!==void 0)return(0,y.popSchemaStack)(W,T),{value:a.example,readOnly:a.readOnly,writeOnly:a.writeOnly,type:a.type};if(a.allOf!==void 0)return(0,y.popSchemaStack)(W,T),f(a)||(0,h.allOfSample)(v(v({},a),{},{allOf:void 0}),a.allOf,x,b,T);if(a.oneOf&&a.oneOf.length){a.anyOf&&(x.quiet||console.warn("oneOf and anyOf are not supported on the same level. Skipping anyOf")),(0,y.popSchemaStack)(W,T);let S=Object.assign({readOnly:a.readOnly,writeOnly:a.writeOnly},a.oneOf[0]);return H(a,S)}if(a.anyOf&&a.anyOf.length){(0,y.popSchemaStack)(W,T);let S=Object.assign({readOnly:a.readOnly,writeOnly:a.writeOnly},a.anyOf[0]);return H(a,S)}if(a.if&&a.then){(0,y.popSchemaStack)(W,T);let{if:S,then:G}=a,X=$(a,D);return m((0,y.mergeDeep)(X,S,G),x,b,T)}let B=K(a),Q=null;if(B===void 0){B=null,Q=a.type,Array.isArray(Q)&&a.type.length>0&&(Q=a.type[0]),Q||(Q=(0,A.inferType)(a));let S=I._samplers[Q];S&&(B=S(a,x,b,T))}return(0,y.popSchemaStack)(W,T),{value:B,readOnly:a.readOnly,writeOnly:a.writeOnly,type:Q};function H(S,G){let X=f(S);if(X!==void 0)return X;let tt=m(v(v({},S),{},{oneOf:void 0,anyOf:void 0}),x,b,T),Z=m(G,x,b,T);if(typeof tt.value=="object"&&typeof Z.value=="object"){let z=(0,y.mergeDeep)(tt.value,Z.value);return v(v({},Z),{},{value:z})}return Z}}},{"./allOf":4,"./infer":5,"./openapi-sampler":6,"./utils":15,"json-pointer":3}],15:[function(_,R,w){"use strict";Object.defineProperty(w,"__esModule",{value:!0}),w.SKIP_SYMBOL=void 0,w.applyXMLAttributes=W,w.ensureMinLength=l,w.getResultForCircular=P,w.getXMLAttributes=F,w.mergeDeep=c,w.popSchemaStack=E,w.toRFCDateTime=$,w.uuid=v;function I(f,m){var a=Object.keys(f);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(f);m&&(x=x.filter(function(b){return Object.getOwnPropertyDescriptor(f,b).enumerable})),a.push.apply(a,x)}return a}function h(f){for(var m=1;m<arguments.length;m++){var a=arguments[m]!=null?arguments[m]:{};m%2?I(Object(a),!0).forEach(function(x){A(f,x,a[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(a)):I(Object(a)).forEach(function(x){Object.defineProperty(f,x,Object.getOwnPropertyDescriptor(a,x))})}return f}function A(f,m,a){return(m=y(m))in f?Object.defineProperty(f,m,{value:a,enumerable:!0,configurable:!0,writable:!0}):f[m]=a,f}function y(f){var m=N(f,"string");return typeof m=="symbol"?m:m+""}function N(f,m){if(typeof f!="object"||!f)return f;var a=f[Symbol.toPrimitive];if(a!==void 0){var x=a.call(f,m||"default");if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(f)}let D=w.SKIP_SYMBOL=Symbol("skip");function j(f){return f<10?"0"+f:f}function $(f,m,a,x){var b=a?"":f.getUTCFullYear()+"-"+j(f.getUTCMonth()+1)+"-"+j(f.getUTCDate());return m||(b+="T"+j(f.getUTCHours())+":"+j(f.getUTCMinutes())+":"+j(f.getUTCSeconds())+(x?"."+(f.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5):"")+"Z"),b}function l(f,m){return m>f.length?f.repeat(Math.trunc(m/f.length)+1).substring(0,m):f}function c(){let f=b=>b&&typeof b=="object";for(var m=arguments.length,a=new Array(m),x=0;x<m;x++)a[x]=arguments[x];return a.reduce((b,T)=>(Object.keys(T||{}).forEach(B=>{let Q=b[B],H=T[B];f(Q)&&f(H)?b[B]=c(Q,H):b[B]=H}),b),Array.isArray(a[a.length-1])?[]:{})}function v(f){var m=U(f),a=K(m,m,m,m),x="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,b=>{var T=a()*16%16|0;return(b=="x"?T:T&3|8).toString(16)});return x}function P(f){return{value:f==="object"?{}:f==="array"?[]:void 0}}function E(f,m){m&&f.pop()}function F(f){var m,a,x,b,T,B,Q;return{name:(f==null||(m=f.xml)===null||m===void 0?void 0:m.name)||"",prefix:(f==null||(a=f.xml)===null||a===void 0?void 0:a.prefix)||"",namespace:(f==null||(x=f.xml)===null||x===void 0?void 0:x.namespace)||null,attribute:(b=f==null||(T=f.xml)===null||T===void 0?void 0:T.attribute)!==null&&b!==void 0?b:!1,wrapped:(B=f==null||(Q=f.xml)===null||Q===void 0?void 0:Q.wrapped)!==null&&B!==void 0?B:!1}}function q(f){let m=f?.xml;return m!=null&&m.nodeType?m.nodeType:m?.attribute===!0?"attribute":m?.wrapped===!0&&f?.type==="array"?"element":f!=null&&f.$ref||f!=null&&f.$dynamicRef||f?.type==="array"||f!=null&&f.oneOf||f!=null&&f.anyOf||f!=null&&f.allOf?"none":"element"}function W(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{value:x}=f,{propertyName:b}=a,{name:T,prefix:B,namespace:Q}=F(m),H=q(m),S=T||b?"".concat(B?B+":":"").concat(T||b):null,G=typeof x=="object"?Array.isArray(x)?[...x]:h({},x):x;switch(H){case"attribute":S&&(S="$".concat(S));break;case"text":S="#text";break;case"cdata":S="#cdata";break;case"none":if(m.type==="array"){if(S=null,m.example!==void 0){var X;S=((X=m.items)===null||X===void 0||(X=X.xml)===null||X===void 0?void 0:X.name)||S}}else S=null;break;default:m.type==="array"&&Array.isArray(G)&&(G={[S]:[...G]});break}return Q&&H!=="text"&&H!=="cdata"&&H!=="none"&&(typeof G=="object"?G["$xmlns".concat(B?":"+B:"")]=Q:G={["$xmlns".concat(B?":"+B:"")]:Q,"#text":G}),{propertyName:S,value:G}}function U(f){var m=0;if(f.length==0)return m;for(var a=0;a<f.length;a++){var x=f.charCodeAt(a);m=(m<<5)-m+x,m=m&m}return m}function K(f,m,a,x){return function(){f|=0,m|=0,a|=0,x|=0;var b=f-(m<<27|m>>>5)|0;return f=m^(a<<17|a>>>15),m=a+x|0,a=x+b|0,x=f+b|0,(x>>>0)/4294967296}}},{}]},{},[6])(6)})});var zt=Nt((Ke,Kt)=>{"use strict";Kt.exports=(Y,C=process.argv)=>{let J=Y.startsWith("-")?"":Y.length===1?"-":"--",_=C.indexOf(J+Y),R=C.indexOf("--");return _!==-1&&(R===-1||_<R)}});var We=Nt((ze,Zt)=>{"use strict";var Ge=bt("os"),Jt=bt("tty"),ft=zt(),{env:it}=process,mt;ft("no-color")||ft("no-colors")||ft("color=false")||ft("color=never")?mt=0:(ft("color")||ft("colors")||ft("color=true")||ft("color=always"))&&(mt=1);"FORCE_COLOR"in it&&(it.FORCE_COLOR==="true"?mt=1:it.FORCE_COLOR==="false"?mt=0:mt=it.FORCE_COLOR.length===0?1:Math.min(parseInt(it.FORCE_COLOR,10),3));function It(Y){return Y===0?!1:{level:Y,hasBasic:!0,has256:Y>=2,has16m:Y>=3}}function Dt(Y,C){if(mt===0)return 0;if(ft("color=16m")||ft("color=full")||ft("color=truecolor"))return 3;if(ft("color=256"))return 2;if(Y&&!C&&mt===void 0)return 0;let J=mt||0;if(it.TERM==="dumb")return J;if(process.platform==="win32"){let _=Ge.release().split(".");return Number(_[0])>=10&&Number(_[2])>=10586?Number(_[2])>=14931?3:2:1}if("CI"in it)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(_=>_ in it)||it.CI_NAME==="codeship"?1:J;if("TEAMCITY_VERSION"in it)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(it.TEAMCITY_VERSION)?1:0;if(it.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in it){let _=parseInt((it.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(it.TERM_PROGRAM){case"iTerm.app":return _>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(it.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(it.TERM)||"COLORTERM"in it?1:J}function Be(Y){let C=Dt(Y,Y&&Y.isTTY);return It(C)}Zt.exports={supportsColor:Be,stdout:It(Dt(!0,Jt.isatty(1))),stderr:It(Dt(!0,Jt.isatty(2)))}});export{We as a,Fe as b,Ue as c};
@@ -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 q}from"./DXEOF3IX.js";import{h as H,l as B,q as z,s as K,t as V,u as Z,v as _}from"./FTARAJQN.js";import{c as J,e as M,f as Y,v as L}from"./M4FV4I2Z.js";import"./LRUXN6H5.js";import{I as N,M as v,O,P as A,Q as j,R as b,T as y,U as C,V as R,X as e,ca as w,da as D,ia as S,l as h,la as g}from"./UVKEIQXW.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{dirname as le}from"node:path";function W(r,t,o,n){n&&e.info(C(v(`
7
+ import{a as q}from"./DT66L2TO.js";import{h as H,l as B,q as z,s as K,t as V,u as Z,v as _}from"./OM4VGI2Q.js";import"./LRUXN6H5.js";import{d as J,f as M,g as Y,w as L}from"./3I7XLHPY.js";import{I as N,M as v,O,P as A,Q as j,R as b,T as y,U as C,V as R,X as e,ca as w,da as D,ia as S,l as h,la as g}from"./M4YE5ALG.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{dirname as le}from"node:path";function W(r,t,o,n){n&&e.info(C(v(`
8
8
  \u2611\uFE0F Achieved Level: ${y(o)}
9
9
 
10
10
  `))),e.output(`<?xml version="1.0" encoding="UTF-8"?>
@@ -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"./DXEOF3IX.js";import{h as s,l as a}from"./FTARAJQN.js";import"./LRUXN6H5.js";import{P as t,X as e,ca as i}from"./UVKEIQXW.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";async function y({argv:r,config:l,version:d}){let o=s(l,r.residency);try{let n=new a(d);r.verbose&&(e.info(`OAuth client initialized.
7
+ import{a as c}from"./DT66L2TO.js";import{h as s,l as a}from"./OM4VGI2Q.js";import"./LRUXN6H5.js";import{P as t,X as e,ca as i}from"./M4YE5ALG.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";async function y({argv:r,config:l,version:d}){let o=s(l,r.residency);try{let n=new a(d);r.verbose&&(e.info(`OAuth client initialized.
8
8
  `),e.info(`Local credentials file path: ${n.credentialsFilePath}
9
9
  `)),await n.login(o,c),e.output(t(`\u2705 Logged in
10
10
 
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a,b,c,d,e,f,g}from"./TVL6DMBV.js";import"./7IULUVWX.js";import"./UVKEIQXW.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{d as RESET_ESCAPE_CODE,c as calculateTotals,f as conditionallyMaskSecrets,b as generate,e as maskSecrets,a as parseRuntimeExpression,g as run};
7
+ import{a,b,c,d,e,f,g}from"./5UDC2SWY.js";import"./UF2ZCH7W.js";import"./M4YE5ALG.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{d as RESET_ESCAPE_CODE,c as calculateTotals,f as conditionallyMaskSecrets,b as generate,e as maskSecrets,a as parseRuntimeExpression,g as run};
@@ -8,4 +8,4 @@ import{a as f,m as u}from"./UW4UC7ZI.js";function m(e,t){let n=t??{},i=e.specNam
8
8
  `))e.line(c);e.line("```"),e.blank()}let a=[...t.pathParams,...t.queryParams,...t.headerParams];a.length>0&&T(e,a),t.requestBody!==void 0&&e.line(`Body: \`${t.requestBody.contentType}\`${t.requestBody.required?", required":", optional"}, of type ${o(t.requestBody.schema)}.`);let r=t.successResponses[0];e.line(r===void 0?"Returns no content.":`Returns \`${r.contentType}\`, of type ${o(r.schema)}.`),(n.paginated!==void 0?n.paginated.has(t.name):m(t,n.pagination)!==void 0)&&e.line("This operation is paginated, so the SDK gives it page and item iterators."),t.successResponses.some(c=>c.contentType==="text/event-stream")&&e.line("This operation streams server-sent events, so the SDK iterates the events."),P(t)&&e.line("This operation returns binary content."),e.blank()}function v(e,t){let n=new f;if(t.frontmatter&&(n.line("---"),n.line(`title: ${t.title}`),n.line("---"),n.blank()),n.line(`# ${t.title}`),n.blank(),n.line(`Generated reference for the ${t.language.label} SDK, 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(t.language.requires),n.blank(),n.line("## Authentication"),n.blank(),e.securitySchemes.length===0)n.line("The description declares no security schemes.");else{n.line("The description declares these schemes, which you pass to the client:"),n.blank(),n.line("| Scheme | Kind | Sent as |"),n.line("| ------ | ---- | ------- |");for(let r of e.securitySchemes){let s=r.kind==="bearer"?"`Authorization: Bearer <token>`":r.kind==="basic"?"`Authorization: Basic <base64>`":r.kind==="apiKeyHeader"?`the \`${r.headerName}\` header`:r.kind==="apiKeyQuery"?`the \`${r.paramName}\` query parameter`:`the \`${r.cookieName}\` cookie`;n.line(`| \`${r.key}\` | ${r.kind} | ${s} |`)}}n.blank();let i=e.services.flatMap(r=>r.operations),a=[...new Set(i.map(r=>r.tags[0]))];for(let r of a){n.line(r===void 0?"## Operations":`## ${r}`),n.blank();for(let s of i.filter(c=>c.tags[0]===r))C(n,s,t)}return n.toString().replace(/\n{3,}/g,`
9
9
 
10
10
  `).trimEnd()+`
11
- `}var ee=["Printer","casing","identifierFor","uniqueIdentifiers","RESERVED_WORDS","flattenAllOf","deref","discriminatorCases","jsonSuccessSchema","sseResponse","isMultipartBody","isBinaryContentType","serverUrlParts","securityRequirements","paginationItemSchema","isNullable","unwrapNullable","enumValues","docText","headerCoerceType","schemaAtPointer","paginationRuleFor","renderReferencePage","NotSupportedError"];function E(e){return e}function w(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("-")}function A(e){return e.replace(/[^A-Za-z0-9]+/g,"_").replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()}function q(e,t){let n={...e};for(let[i,a]of Object.entries(t))a!==void 0&&(n[i]=a);return n}function de(e){return e}async function ke(e){return(await import("./XKNG65W6.js")).generateClient(e)}export{m as a,h as b,x as c,k as d,d as e,b as f,S as g,$ as h,v as i,ee as j,E as k,w as l,A as m,q as n,de as o,ke as p};
11
+ `}var ee=["Printer","casing","identifierFor","uniqueIdentifiers","RESERVED_WORDS","flattenAllOf","deref","discriminatorCases","jsonSuccessSchema","sseResponse","isMultipartBody","isBinaryContentType","serverUrlParts","securityRequirements","paginationItemSchema","isNullable","unwrapNullable","enumValues","docText","headerCoerceType","schemaAtPointer","paginationRuleFor","renderReferencePage","NotSupportedError"];function E(e){return e}function w(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("-")}function A(e){return e.replace(/[^A-Za-z0-9]+/g,"_").replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()}function q(e,t){let n={...e};for(let[i,a]of Object.entries(t))a!==void 0&&(n[i]=a);return n}function de(e){return e}async function ke(e){return(await import("./OR3KBRCI.js")).generateClient(e)}export{m as a,h as b,x as c,k as d,d as e,b as f,S as g,$ as h,v as i,ee as j,E as k,w as l,A as m,q as n,de as o,ke as p};
@@ -0,0 +1,34 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ import{a as l,b as O,c as v,d as U,e as F}from"./U5DIFWGH.js";import{d as R}from"./3I7XLHPY.js";import{Q as k,R as $,V as S,X as b,c as G,ca as g,l as P}from"./M4YE5ALG.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{readFileSync as z}from"node:fs";import{mkdir as H,writeFile as B}from"node:fs/promises";import{basename as T,dirname as A,extname as I,isAbsolute as N,relative as j,resolve as f}from"node:path";var V=/^[a-z][a-z0-9+.-]+:/i;function L(e,n){let{setup:o}=e;if(typeof o!="string")return e;if(V.test(o))throw new g(`
8
+ \u274C \`client.setup\` must be a local file path \u2014 remote setup modules are not supported.
9
+ Got: ${o}
10
+ `);return N(o)?e:{...e,setup:f(n,o)}}function q(e){return`${e.replace(/[\\/]/g,"_")}.client.ts`}function D(e){if(e.startsWith("//"))return!1;if(e.startsWith("/"))return!0;try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"}catch{return!1}}async function ie({argv:e,config:n}){let{AUTHORING_HELPER_NAMES:o,generateClient:c,mergeConfig:m}=await import("./QDSAT32N.js"),t=n.configPath?A(n.configPath):process.cwd(),s={serverUrl:e["server-url"],outputMode:e["output-mode"],runtime:e.runtime,importExt:e["import-ext"],goPackage:e["go-package"],argsStyle:e["args-style"],errorMode:e["error-mode"],dateType:e["date-type"],mockData:e["mock-data"],mockSeed:e["mock-seed"],docs:e.docs,generators:e.generator?.map(a=>a.startsWith(".")?f(a):a),setup:e.setup===void 0?void 0:L({setup:e.setup},process.cwd()).setup},r=n.resolvedConfig.apis??{},i=Object.keys(r).filter(a=>G(r[a].client)||r[a].clientOutput!==void 0);if(e.api===void 0){if(e.output)throw new g("\n\u274C --output can't target multiple APIs. Set `clientOutput` under each api in redocly.yaml, or pass a single <api>.\n");if(i.length===0)throw new g("\n\u274C No API to generate. Add a `client` block or `clientOutput` under an `apis:` entry, or pass <api> (a file/URL or an `apis:` alias).\n")}let u=await R(e.api===void 0?i:[e.api],n),p={config:n,configDir:t,cliFlags:s,outputFlag:e.output,toolkit:{generateClient:c,mergeConfig:m,helperNames:o},seenOutputs:new Set,composable:[]};for(let a of u)await J(a,p);let y=G(n.resolvedConfig.client)?n.resolvedConfig.client:{};y.cliOutput!==void 0&&e.api===void 0&&p.composable.length>0&&await K(y.cliOutput,p)}async function J(e,{config:n,configDir:o,cliFlags:c,outputFlag:m,toolkit:t,seenOutputs:s,composable:r}){let{path:i,alias:u}=e,p=u??T(i,I(i)),y=n.forAlias(u),{client:a,clientOutput:E}=y.resolvedConfig,W=L(G(a)?a:{},o),h=t.mergeConfig(W,c);Q(h.generators??[],t.helperNames,o);let C=m!==void 0?f(m):E!==void 0?f(o,E):f(o,q(p));if(!C.endsWith(".ts"))throw new g(`
11
+ \u274C output must point at a TypeScript file (ending in .ts).
12
+ Got: ${C}
13
+ `);if(s.has(C))throw new g(`
14
+ \u274C Two APIs write to the same path: ${C}.
15
+ Give each api a distinct \`clientOutput\`.
16
+ `);if(s.add(C),h.serverUrl!==void 0&&!D(h.serverUrl))throw new g(`
17
+ \u274C serverUrl must be an absolute URL (https://api.example.com) or a root-relative path (/v1) \u2014 set via --server-url or the \`client\` block in redocly.yaml.
18
+ Got: ${h.serverUrl}
19
+ `);try{b.info(S(`
20
+ Generating client for ${p}...
21
+ `));let d=await t.generateClient({...h,api:i,output:C,config:y,configDir:o}),w=d.files.find(_=>_.path.endsWith(".cli.ts"));if(w!==void 0){let _=h.importExt??"js";r.push({alias:p,cliPath:w.path.replace(/\.ts$/,_==="ts"?".ts":".js")})}for(let _ of d.files)s.add(_.path);let M=`Client successfully generated: ${`${d.files.length} ${P("file",d.files.length)}`} (${d.bytes} bytes) at ${k(d.outputPath)}.`;b.info(`
22
+ `+$(M)+`
23
+ `)}catch(d){let w=d instanceof Error?d.message:String(d);throw l.generate_client_error_category=F(w),new g(`
24
+ \u274C Failed to generate client for ${p}.
25
+ ${w}
26
+ `)}}async function K(e,{configDir:n,seenOutputs:o,composable:c}){let{renderComposedCliEntry:m}=await import("./GEWI247R.js"),t=f(n,e);if(!t.endsWith(".ts"))throw new g(`
27
+ \u274C client.cliOutput must point at a TypeScript file (ending in .ts).
28
+ Got: ${t}
29
+ `);if(o.has(t))throw new g(`
30
+ \u274C client.cliOutput resolves to a file this run generated: ${t}.
31
+ Give the composed entry its own path.
32
+ `);let s=T(t,I(t)),r=m(c.map(({alias:i,cliPath:u})=>({alias:i,modulePath:`./${j(A(t),u).split("\\").join("/")}`})),s);await H(A(t),{recursive:!0}),await B(t,r,"utf-8"),l.generate_client_composed_apis_count=c.length,b.info(`
33
+ `+$(`Composed CLI written to ${k(j(process.cwd(),t))} \u2014 ${c.map(({alias:i})=>i).join(", ")} behind one \`${s}\` binary.`)+`
34
+ `)}var x=new Set;function Q(e,n,o){let c=new Set(l.generate_client_builtin_generators??[]),m=new Set(l.generate_client_toolkit_imports??[]),t=new Set(l.generate_client_ejected_generators??[]),s=l.generate_client_custom_generators_count??0;for(let r of e){if(O.has(r)){c.add(r);continue}if(!x.has(r)&&(x.add(r),s++,r.startsWith(".")||N(r)))try{let i=z(f(o,r),"utf-8");for(let p of v(i,n))m.add(p);let u=U(i);u&&t.add(`${u.name}@${u.version}`)}catch{}}l.generate_client_builtin_generators=[...c],l.generate_client_custom_generators_count=s,l.generate_client_toolkit_imports=[...m],l.generate_client_ejected_generators=[...t]}export{Q as collectGeneratorUsage,ie as handleGenerateClient};
@@ -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"./LGQZK7NR.js";import"./TC3EIKUK.js";import"./FKC3B2RN.js";import"./VM6OOWSF.js";import"./MGMNYFOR.js";import"./WZXA5XPB.js";import"./UVKEIQXW.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as swrGenerator};
7
+ import{a}from"./YDVOCOBI.js";import"./J3DL5HGI.js";import"./JMFIKCPX.js";import"./VIPV4IEH.js";import"./65AQJO4M.js";import"./WZXA5XPB.js";import"./M4YE5ALG.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as swrGenerator};
@@ -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}from"./AOFLS3JM.js";import"./FTARAJQN.js";import"./HOUAVEH6.js";import"./M4FV4I2Z.js";import"./LRUXN6H5.js";import"./UVKEIQXW.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{a as DeploymentError,b as handlePushStatus,c as handleReuniteError,d as printSunsetWarning};
7
+ import{a,b,c,d}from"./YUNIBLZR.js";import"./YEACSN2C.js";import"./OM4VGI2Q.js";import"./LRUXN6H5.js";import"./3I7XLHPY.js";import"./M4YE5ALG.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{a as DeploymentError,b as handlePushStatus,c as handleReuniteError,d as printSunsetWarning};
@@ -4,5 +4,5 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{c}from"./UVKEIQXW.js";import{open as U,readdir as H,stat as J}from"node:fs/promises";import x from"node:path";var L=new Set([".yaml",".yml",".json"]);async function K(e){let n=[];async function t(r){let o=await H(r,{withFileTypes:!0});for(let s of o){if(s.name.startsWith("."))continue;let i=x.join(r,s.name);if(s.isDirectory()){await t(i);continue}s.isFile()&&L.has(x.extname(s.name).toLowerCase())&&n.push(i)}}return await t(e),n.sort(),n}async function G(e,n=4096){let t=await U(e,"r");try{let r=Buffer.allocUnsafe(n),{bytesRead:o}=await t.read(r,0,n,0);return r.toString("utf8",0,o)}finally{await t.close()}}function X(e){return x.resolve(process.cwd(),e)}async function Y(e){let n=await J(e);if(n.isFile())return[e];if(!n.isDirectory())return[];let t=[];async function r(o){let s=await H(o,{withFileTypes:!0});for(let i of s){if(i.name.startsWith("."))continue;let a=x.join(o,i.name);if(i.isDirectory()){await r(a);continue}i.isFile()&&t.push(a)}}return await r(e),t.sort(),t}var z="drift.local",B=`http://${z}`;function l(e){return e===z}var I=new Set(["accept","accept-charset","accept-encoding","accept-language","authorization","baggage","cache-control","cdn-loop","cookie","connection","content-length","content-type","dpr","dnt","downlink","ect","forwarded","host","if-match","if-modified-since","if-none-match","if-range","if-unmodified-since","origin","pragma","priority","range","referer","sec-fetch-dest","sec-fetch-mode","sec-fetch-site","sec-fetch-user","sec-gpc","sentry-trace","te","traceparent","tracestate","upgrade","upgrade-insecure-requests","user-agent","via","x-client-trace-id","x-cloud-trace-context","x-correlation-id","x-http-method-override","x-hub-signature","x-hub-signature-256","x-method-override","x-real-ip","x-request-id","x-forwarded-for","x-forwarded-host","x-forwarded-port","x-forwarded-proto"]),q=["cf-","sec-ch-","sec-fetch-","x-amz-","x-amzn-","x-b3-","x-envoy-","x-forwarded-","x-github-"],T=`
7
+ import{c}from"./M4YE5ALG.js";import{open as U,readdir as H,stat as J}from"node:fs/promises";import x from"node:path";var L=new Set([".yaml",".yml",".json"]);async function K(e){let n=[];async function t(r){let o=await H(r,{withFileTypes:!0});for(let s of o){if(s.name.startsWith("."))continue;let i=x.join(r,s.name);if(s.isDirectory()){await t(i);continue}s.isFile()&&L.has(x.extname(s.name).toLowerCase())&&n.push(i)}}return await t(e),n.sort(),n}async function G(e,n=4096){let t=await U(e,"r");try{let r=Buffer.allocUnsafe(n),{bytesRead:o}=await t.read(r,0,n,0);return r.toString("utf8",0,o)}finally{await t.close()}}function X(e){return x.resolve(process.cwd(),e)}async function Y(e){let n=await J(e);if(n.isFile())return[e];if(!n.isDirectory())return[];let t=[];async function r(o){let s=await H(o,{withFileTypes:!0});for(let i of s){if(i.name.startsWith("."))continue;let a=x.join(o,i.name);if(i.isDirectory()){await r(a);continue}i.isFile()&&t.push(a)}}return await r(e),t.sort(),t}var z="drift.local",B=`http://${z}`;function l(e){return e===z}var I=new Set(["accept","accept-charset","accept-encoding","accept-language","authorization","baggage","cache-control","cdn-loop","cookie","connection","content-length","content-type","dpr","dnt","downlink","ect","forwarded","host","if-match","if-modified-since","if-none-match","if-range","if-unmodified-since","origin","pragma","priority","range","referer","sec-fetch-dest","sec-fetch-mode","sec-fetch-site","sec-fetch-user","sec-gpc","sentry-trace","te","traceparent","tracestate","upgrade","upgrade-insecure-requests","user-agent","via","x-client-trace-id","x-cloud-trace-context","x-correlation-id","x-http-method-override","x-hub-signature","x-hub-signature-256","x-method-override","x-real-ip","x-request-id","x-forwarded-for","x-forwarded-host","x-forwarded-port","x-forwarded-proto"]),q=["cf-","sec-ch-","sec-fetch-","x-amz-","x-amzn-","x-b3-","x-envoy-","x-forwarded-","x-github-"],T=`
8
8
  `;function Z(e){return e.split(T)}function S(e,n,t){let r=n.toLowerCase(),o=e[r];if(o===void 0){e[r]=t;return}e[r]=r==="set-cookie"?`${o}${T}${t}`:`${o},${t}`}function w(e){if(!c(e)&&!Array.isArray(e))return{};let n={};if(Array.isArray(e)){for(let t of e){if(!c(t))continue;let{name:r,value:o}=t;typeof r=="string"&&o!==void 0&&S(n,r,String(o))}return n}for(let[t,r]of Object.entries(e))if(r!=null){if(Array.isArray(r)){for(let o of r)S(n,t,String(o));continue}S(n,t,String(r))}return n}function m(e){try{return new URL(e)}catch{return new URL(e,B)}}function N(e){return e.length>1&&e.endsWith("/")?e.slice(0,-1):e}function b(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(e){let n=[],t=0,r=e.startsWith("/")?e:`/${e}`,s=N(r).split("/").map(i=>{if(!i)return"";let a=[...i.matchAll(/\{([^}]+)\}/g)],h=n.length,u="",p=0,f=0;for(let[y,d]of a.entries()){let R=i.slice(f,d.index);u+=b(R),p+=R.length,n.push(d[1]),f=d.index+d[0].length;let E=a[y+1];if(!E){u+="([^/]+)";continue}let A=i.slice(f,E.index);u+=A?`((?:(?!${b(A)})[^/])+)`:"([^/])"}let g=i.slice(f);return u+=b(g),p+=g.length,n.length===h?t+=2:p>0&&(t+=1),u}).join("/");return{regex:new RegExp(`^${s||"/"}$`),params:n,score:t}}function k(e,n){if(n&&P(e))try{return JSON.parse(n)}catch{return}}function C(e){return e?e.split(";")[0]?.trim().toLowerCase()??"":""}function P(e){let n=C(e);return n==="application/json"||n.endsWith("+json")}function ee(e,n){let t=C(n);if(!t)return e["application/json"]??e["*/*"];if(e[t]!==void 0)return e[t];let[r,o]=t.split("/");if(r&&o){let s=`${r}/*`;if(e[s]!==void 0)return e[s]}return e["*/*"]}function ne(e){let n=new Set,t=[];for(let r of e){let o=r.trim().toLowerCase();o.length!==0&&(o.endsWith("*")?t.push(o.slice(0,-1)):n.add(o))}return{names:n,prefixes:t}}function te(e,n){let t=e.toLowerCase();return t.startsWith(":")||I.has(t)||q.some(r=>t.startsWith(r))?!0:n?n.names.has(t)||n.prefixes.some(r=>t.startsWith(r)):!1}import{createReadStream as F}from"node:fs";import{readFile as j}from"node:fs/promises";import{createInterface as W}from"node:readline";function D(e){if(e!=null){if(typeof e=="string")return e;if(Buffer.isBuffer(e))return e.toString("utf8");if(c(e)||Array.isArray(e))try{return JSON.stringify(e)}catch{return String(e)}return String(e)}}function ue(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()!==""){let n=Number(e);if(Number.isFinite(n))return n}}function $(e,n){if(e!=null){if(n==="base64"&&typeof e=="string")try{return Buffer.from(e,"base64").toString("utf8")}catch{return e}return D(e)}}function fe(e,n,t){let r=e.method?.toUpperCase(),o=e.url;if(!r||!o)return null;let s=w(e.requestHeaders),i=m(o);if(l(i.host)&&s.host)try{i=new URL(`${i.protocol}//${s.host}${i.pathname}${i.search}`)}catch{i=m(o)}let a=e.requestContentType??s["content-type"],h=$(e.requestBody),u={method:r,url:i.toString(),path:i.pathname,query:i.searchParams,protocol:i.protocol,protocolKnown:e.schemeKnown??/^https?:\/\//i.test(o),host:l(i.host)?void 0:i.host||void 0,headers:s,contentType:a,bodyText:h,bodyJson:k(a,h)},p,f=e.responseStatus;if(f!==void 0){let g=w(e.responseHeaders),y=e.responseContentType??g["content-type"],d=$(e.responseBody);p={status:f,statusText:e.responseStatusText,headers:g,contentType:y,bodyText:d,bodyJson:k(y,d)}}return{index:n,source:t,startedAt:e.startedAt,request:u,response:p,raw:e.raw}}async function*de(e){let n=F(e,{encoding:"utf8"}),t=W({input:n,crlfDelay:1/0});for await(let r of t){let o=r.trim();if(o)try{let s=JSON.parse(o);c(s)&&(yield s)}catch{}}}async function*pe(e,n){let t=await j(e,"utf8"),r=JSON.parse(t);if(n)for(let o of n.split("."))r=c(r)?r[o]:void 0;if(Array.isArray(r))for(let o of r)c(o)&&(yield o)}function ge(e){return w(e)["content-type"]}function he(e){return e?.replace(/\/+$/,"")||void 0}function O(e,n){if(!n||n==="/")return e||"/";if(e===n)return"/";if(e.startsWith(`${n}/`))return e.slice(n.length)||"/"}function ye(e,n){if(n.startsWith("/"))return O(e.path,n);let t=m(n.includes("://")?n:`http://${n}`);if(!(l(t.host)||e.host!==void 0&&e.host.toLowerCase()!==t.host))return O(e.path,N(t.pathname))}export{K as a,G as b,X as c,Y as d,l as e,Z as f,m as g,N as h,v as i,C as j,P as k,ee as l,ne as m,te as n,D as o,ue as p,$ as q,fe as r,de as s,pe as t,ge as u,he as v,ye as w};
@@ -0,0 +1,11 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ import{a as F,b as ae,c as me,d as pe,e as K}from"./EDU3YBRA.js";import{a as ce,b as fe}from"./64G5RPLP.js";import{h as oe,i as x,j as ie,k as se,n as T,o as h,p as re}from"./3I7XLHPY.js";import{G as Z,O as ee,P as te,R as u,X as N,Z as ne,b as U,c as I,ca as b,d as O,h as L,o as d,r as S}from"./M4YE5ALG.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import*as Me from"node:fs";import{performance as We}from"perf_hooks";import*as ve from"node:fs";import*as G from"node:path";import*as le from"node:path";function A(e,t,n={}){pe(e,i=>{if(S(i)&&K(i.$ref))o(i,"$ref");else if(I(i.discriminator)&&I(i.discriminator.mapping)){let{mapping:s}=i.discriminator;for(let m of Object.keys(s)){let a=s[m];typeof a=="string"&&K(a)&&o(i.discriminator.mapping,m)}}});function o(i,s){let m=i[s].split("/"),a=m.pop(),p=m[2],r=n[p];if(!r||!r[a])return;let c=d(le.relative(t,r[a].filename));c.startsWith(".")||(c="./"+c),i[s]=c}}import*as Q from"node:path";import*as ye from"node:path";function E(e,t,n){return ye.join(e,t)+`.${n}`}var he=["schemas","messages","securitySchemes","parameters","correlationIds","messageTraits","operationTraits","serverBindings","channelBindings","operationBindings","messageBindings"];var Ae=["schemas","messages","securitySchemes","servers","serverVariables","parameters","replies","replyAddresses","correlationIds","messageTraits","operationTraits","tags","externalDocs","serverBindings","channelBindings","operationBindings","messageBindings"];function Y(e,t){return(t==="async2"?he:Ae).filter(o=>o in e)}function de({asyncapi:e,asyncapiDir:t,componentsFiles:n,ext:o,specVersion:i}){let s=e.components;if(!s)return;let m=Q.join(t,F),a=Y(s,i);for(let p of a){let r=Q.join(m,p);for(let c of Object.keys(s[p]||{})){let y=E(r,c,o),f=[];p==="schemas"&&(f=(s[p]?.[c]?.allOf||[]).map(({$ref:l})=>l).filter(L)),n[p]=n[p]||{},n[p][c]={inherits:f,filename:y}}}}import*as ue from"node:fs";import*as w from"node:path";import*as M from"node:path";function g(e,t,n){let o=M.resolve(e),i=M.resolve(t);if(i!==o&&!i.startsWith(o+M.sep))throw new b(`Refusing to write "${n}" outside the output directory.`)}import*as P from"node:fs";import*as ge from"node:path";function v(e,t,n){if(!P.existsSync(e)||!P.statSync(e).isDirectory())return;let o=P.readdirSync(e);for(let i of o){let s=ge.join(e,i);P.statSync(s).isDirectory()?v(s,t,n):t(s,e,n)}}function $(e,t,n){if(!Z(e))return;let o=T(e);A(o,t,n),h(o,e)}function Ce({channels:e,asyncapiDir:t,outDir:n,componentsFiles:o,pathSeparator:i,ext:s}){let m={};if(!e)return m;ue.mkdirSync(n,{recursive:!0});for(let a of Object.keys(e)){let p=`${w.join(n,x(a,i))}.${s}`,r=e[a];S(r)||(g(t,p,a),m[a]=p,A(r,w.dirname(p),o),h(r,p),e[a]={$ref:d(w.relative(t,p))},v(n,$,o))}return m}import*as De from"node:fs";import*as R from"node:path";import*as Oe from"node:fs";function j(e){return e!=="securitySchemes"}function V(e,t){j(t)&&Oe.mkdirSync(e,{recursive:!0})}import*as Se from"node:fs";function H(e,t){return Se.existsSync(e)&&!U(T(e),t)}import*as Ne from"node:path";function k(e,t,n){if(!(!I(e)&&!Array.isArray(e))){if(Array.isArray(e)){for(let o of e)k(o,t,n);return}for(let o of Object.keys(e)){let i=e[o];if(o==="$ref"&&typeof i=="string"&&i.startsWith("#/channels/")){let s=i.slice(11),m=s.indexOf("/"),a=m===-1?s:s.slice(0,m),p=m===-1?"":s.slice(m),r=n[a];if(r){let c=d(Ne.relative(t,r));e[o]=p?`${c}#${p}`:c}}else k(i,t,n)}}}function Fe(e,t){let n=e.components;n&&(O(n[t])&&delete n[t],O(n)&&delete e.components)}function xe({asyncapi:e,asyncapiDir:t,componentsFiles:n,channelsFiles:o,ext:i,specVersion:s}){let m=e.components;if(m){let r=function(c){let y=R.join(a,c);V(y,c);for(let f of Object.keys(m?.[c]||{})){let l=E(y,f,i);g(t,l,f);let C=m?.[c]?.[f];A(C,R.dirname(l),n),k(C,R.dirname(l),o),H(l,C)?N.warn(`warning: conflict for ${f} - file already exists with different content: ${u(l)} ... Skip.
8
+ `):h(C,l),delete m?.[c]?.[f]}Fe(e,c)},a=R.join(t,F);De.mkdirSync(a,{recursive:!0}),Y(m,s).forEach(r)}}import*as Ee from"node:fs";import*as _ from"node:path";function Pe({operations:e,asyncapiDir:t,outDir:n,componentsFiles:o,channelsFiles:i,pathSeparator:s,ext:m}){if(e){Ee.mkdirSync(n,{recursive:!0});for(let a of Object.keys(e)){let p=`${_.join(n,x(a,s))}.${m}`,r=e[a];S(r)||(g(t,p,a),A(r,_.dirname(p),o),k(r,_.dirname(p),i),h(r,p),e[a]={$ref:d(_.relative(t,p))},v(n,$,o))}}}function _e({asyncapi:e,asyncapiDir:t,pathSeparator:n,ext:o,specVersion:i}){ve.mkdirSync(t,{recursive:!0});let s={};de({asyncapi:e,asyncapiDir:t,componentsFiles:s,ext:o,specVersion:i});let m=e.channels,a=m?Ce({channels:m,asyncapiDir:t,outDir:G.join(t,ae),componentsFiles:s,pathSeparator:n,ext:o}):{};xe({asyncapi:e,asyncapiDir:t,componentsFiles:s,channelsFiles:a,ext:o,specVersion:i}),i==="async3"&&e.operations&&Pe({operations:e.operations,asyncapiDir:t,outDir:G.join(t,me),componentsFiles:s,channelsFiles:a,pathSeparator:n,ext:o}),A(e,t,s),h(e,G.join(t,`asyncapi.${o}`))}import*as Be from"node:fs";import*as J from"node:path";import*as ke from"node:fs";import*as B from"node:path";import*as q from"node:path";function be(e){return q.basename(e,q.extname(e))}function Te(e){return e?fe.filter(t=>j(t)&&Object.keys(e).includes(t)):[]}function $e(e,t,n,o,i){let s=[];n==="schemas"&&(s=(e?.[n]?.[o]?.allOf||[]).map(({$ref:m})=>m).filter(L)),t[n]=t[n]||{},t[n][o]={inherits:s,filename:i}}import*as X from"node:path";function we(e,t,n,o){if(!e.discriminator)return;let i=`#/${F}/schemas/${t}`,s={};for(let[r,{inherits:c,filename:y}]of Object.entries(o))if(c.indexOf(i)>-1){let f=d(X.relative(X.dirname(n),y));s[r]=f.startsWith(".")?f:"./"+f}if(O(s))return;let m=e.properties[e.discriminator.propertyName],a=m&&m.enum,p=e.discriminator.mapping=e.discriminator.mapping||{};for(let r of Object.keys(s))a&&!a.includes(r)||(p[r]&&p[r]!==s[r]&&N.warn(`warning: explicit mapping overlaps with local mapping entry ${ee(r)} at ${u(n)}. Please check it.`),p[r]=s[r])}function je(e,t){e.components&&O(e.components[t])&&delete e.components[t],O(e.components)&&delete e.components}function Re(e,t,n,o){let{components:i}=e;if(i){let a=function(r){let c=B.join(s,r);for(let y of Object.keys(i?.[r]||{})){let f=E(c,y,o);g(t,f,y),$e(i,n,r,y,f)}},p=function(r){let c=B.join(s,r);V(c,r);for(let y of Object.keys(i?.[r]||{})){let f=E(c,y,o),l=i?.[r]?.[y];A(l,B.dirname(f),n),we(l,be(f),f,n.schemas||{}),H(f,l)?N.warn(`warning: conflict for ${y} - file already exists with different content: ${u(f)} ... Skip.
9
+ `):h(l,f),j(r)&&delete e.components?.[r]?.[y]}je(e,r)},s=B.join(t,F);ke.mkdirSync(s,{recursive:!0});let m=Te(i);m.forEach(a),m.forEach(p)}}import*as W from"node:fs";import*as D from"node:path";function z(e,t,n,o,i,s="",m){if(e){W.mkdirSync(n,{recursive:!0});for(let a of Object.keys(e)){let p=`${D.join(n,x(a,i))}.${m}`,r=e[a];if(!S(r)){g(t,p,a);for(let c of ce){let y=r[c],f=y?.["x-code-samples"]||y?.["x-codeSamples"];if(!(!f||!Array.isArray(f)))for(let l of f){if(l.source&&l.source.$ref)continue;let C=D.join(t,"code_samples",ie(l.lang),s+x(a,i),c+se(l.lang));g(t,C,l.lang),W.mkdirSync(D.dirname(C),{recursive:!0}),W.writeFileSync(C,l.source),l.source={$ref:d(D.relative(n,C))}}}h(r,p),e[a]={$ref:d(D.relative(t,p))},v(n,$,o)}}}}function Ie(e,t,n,o){Be.mkdirSync(t,{recursive:!0});let i={};Re(e,t,i,o),z(e.paths,t,J.join(t,"paths"),i,n,void 0,o);let s=e.webhooks||e["x-webhooks"];z(s,t,J.join(t,"webhooks"),i,n,"webhook_",o),A(e,t,i),h(e,J.join(t,`openapi.${o}`))}async function Vn({argv:e,collectSpecData:t}){let n=We.now(),{api:o,outDir:i,separator:s}=e,m=re(o);if(!Me.existsSync(o))throw new b(`File ${u(o)} does not exist.`);let a=T(o);t?.({parsed:a});let p=ne(a);switch(p){case"async2":case"async3":_e({asyncapi:a,asyncapiDir:i,pathSeparator:s,ext:m,specVersion:p});break;case"oas3_0":case"oas3_1":case"oas3_2":Ie(a,i,s,m);break;case"oas2":throw new b("OpenAPI 2 is not supported by this command.");default:throw new b("File does not conform to the OpenAPI or AsyncAPI Specification. Version is not specified.")}N.info(`\u{1FA93} Document: ${u(o)} ${te("is successfully split")}
10
+ and all related files are saved to the directory: ${u(i)}
11
+ `),oe("split",n,o)}export{Vn as handleSplit,z as iteratePathItems};
@@ -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"./E2KKD73B.js";import"./2U6O26CV.js";import"./VM6OOWSF.js";import"./MGMNYFOR.js";import"./WZXA5XPB.js";import"./UVKEIQXW.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"./DMW5VJBT.js";import"./2U6O26CV.js";import"./VIPV4IEH.js";import"./65AQJO4M.js";import"./WZXA5XPB.js";import"./M4YE5ALG.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};
@@ -0,0 +1,10 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ import{a as o,b as t,c as e}from"./HBUZKWXC.js";import{X as r}from"./M4YE5ALG.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{spawn as p}from"node:child_process";var u=async({argv:n})=>{r.info(`
8
+ Launching translate using NPX.
9
+
10
+ `);let{npxExecutableName:s,sanitize:a,shell:i}=e(),l=a(n["project-dir"],o),c=a(n.locale,t);p(s,["-y","@redocly/realm","translate",c,`-d=${l}`],{stdio:"inherit",shell:i}).on("error",m=>{throw r.info(`Translate launch failed: ${m.message}`),new Error("Translate launch failed.")})};export{u as handleTranslations};
@@ -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"./FKC3B2RN.js";import{e as C,l as u,m as p}from"./VM6OOWSF.js";import{c as j,d as v}from"./MGMNYFOR.js";import{X as b}from"./UVKEIQXW.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 w(r){return[r.group===void 0?void 0:u(r.group),r.name].filter(Boolean).join(" ")}function T(r,e){return[r,w(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 B(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(`### \`${w(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(T(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&&B(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 R(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=p(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_${p(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"./JMFIKCPX.js";import{e as C,l as u,m as p}from"./VIPV4IEH.js";import{c as j,d as v}from"./65AQJO4M.js";import{X as b}from"./M4YE5ALG.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 w(r){return[r.group===void 0?void 0:u(r.group),r.name].filter(Boolean).join(" ")}function T(r,e){return[r,w(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 B(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(`### \`${w(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(T(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&&B(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 R(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=p(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_${p(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 x(){return v["cli.ts"]}function E(){return j["cli.ts"]}var q="// Generated by @redocly/client-generator \u2014 do not edit by hand.\n// Source: OpenAPI description. Re-run `redocly generate-client` to update.";function P(r){return k.snake(r).replace(/_/g,"-")}function O(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:P(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=>C(n.contentType))}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:O(s).type,...s.description!==void 0?{description:s.description}:{}})),flags:t.queryParams.map(O),...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 A=`function isProcessEntry(): boolean {
@@ -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 $,b as a,c,d as i,e as m,f}from"./TC3EIKUK.js";import{k as l}from"./LD5MEXEL.js";import{join as p}from"node:path";function k(t,n){let e=$(t,"swr");if(e.length===0)return"";let s=e.some(a),o=e.some(r=>!a(r));return[...s?['import useSWR from "swr";']:[],...o?['import useSWRMutation from "swr/mutation";']:[],f(e,n.sdkModule,s),...e.flatMap(r=>a(r)?g(r):[S(r)])].join(`
7
+ import{a as $,b as a,c,d as i,e as m,f}from"./J3DL5HGI.js";import{k as l}from"./LD5MEXEL.js";import{join as p}from"node:path";function k(t,n){let e=$(t,"swr");if(e.length===0)return"";let s=e.some(a),o=e.some(r=>!a(r));return[...s?['import useSWR from "swr";']:[],...o?['import useSWRMutation from "swr/mutation";']:[],f(e,n.sdkModule,s),...e.flatMap(r=>a(r)?g(r):[S(r)])].join(`
8
8
 
9
9
  `)}function y(t,n,e){return`export function use${l(t.name)}(${n}) {
10
10
  return ${e};
@@ -4,5 +4,5 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{X as t}from"./UVKEIQXW.js";import*as e from"node:process";var o=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],n=class{frames;currentFrame;intervalId;message;constructor(){this.frames=o,this.currentFrame=0,this.intervalId=null,this.message=""}showFrame(){t.info("\r"+this.frames[this.currentFrame]+" "+this.message),this.currentFrame=(this.currentFrame+1)%this.frames.length}start(r){if(this.message!==r){if(this.message=r,!e.stderr.isTTY){t.info(`${r}...
7
+ import{X as t}from"./M4YE5ALG.js";import*as e from"node:process";var o=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],n=class{frames;currentFrame;intervalId;message;constructor(){this.frames=o,this.currentFrame=0,this.intervalId=null,this.message=""}showFrame(){t.info("\r"+this.frames[this.currentFrame]+" "+this.message),this.currentFrame=(this.currentFrame+1)%this.frames.length}start(r){if(this.message!==r){if(this.message=r,!e.stderr.isTTY){t.info(`${r}...
8
8
  `);return}this.intervalId===null&&(this.intervalId=setInterval(()=>{this.showFrame()},100))}}stop(){this.intervalId!==null&&(clearInterval(this.intervalId),this.intervalId=null,t.info("\r")),this.message=""}};function h(i){i.stop(),e.stderr.isTTY&&t.info("\x1B[2K")}function m(i,r){let[s]=r.inFlight;if(!s)return;let a=r.inFlight.size>1?` (+${r.inFlight.size-1} more)`:"";i.start(`[${r.position}/${r.total}] ${r.action} ${s}${a}`)}export{n as a,h as b,m as c};
@@ -0,0 +1,9 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ import{d as xe,h as Pe}from"./3I7XLHPY.js";import{I as le,J as he,M as b,O as fe,P as de,Q as j,S as ye,T as U,U as A,X as k,Y as Se,Z as ge,_ as Q,aa as K,c as L,ca as Ce,f as ie,fa as be,q as ae,r as pe,s as ce,u as me,v as ue}from"./M4YE5ALG.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{performance as mt}from"perf_hooks";var D={thresholds:{maxParamsGood:5,maxDepthGood:4,maxPolymorphismGood:2,maxDependencyDepthGood:3,maxAmbiguousGood:0,maxOperationsForDiscoverability:1e3},weights:{parameterSimplicity:.1,schemaSimplicity:.1,documentationQuality:.18,constraintClarity:.12,exampleCoverage:.18,errorClarity:.12,dependencyClarity:.1,identifierClarity:.05,polymorphismClarity:.05,anyOfPenaltyMultiplier:2,discoverabilityWeight:.1},hotspotLimit:10},Oe=new Set(["id","name","type","value","data","key","status","state","code","result","item","object","resource","entity","input","output","payload","body","content","info"]);function B(e){if(e.length===0)return 0;let r=[...e].sort((o,n)=>o-n),t=Math.floor(r.length/2);return r.length%2!==0?r[t]:(r[t-1]+r[t])/2}function He(e,r,t=D){let{thresholds:o,weights:n}=t,s=x(1-e.parameterCount/(o.maxParamsGood*2)),a=Math.max(e.maxRequestSchemaDepth,e.maxResponseSchemaDepth)/(o.maxDepthGood*2),c=De(e,n.anyOfPenaltyMultiplier)/(o.maxPolymorphismGood*3),h=x(1-a-c),u=(e.operationDescriptionPresent?1:0)+e.paramsWithDescription+e.schemaPropertiesWithDescription,f=1+e.parameterCount+e.totalSchemaProperties,$=f>0?x(u/f):1,O=e.totalSchemaProperties>0?x(e.constraintCount/e.totalSchemaProperties):1,y=(e.requestExamplePresent?1:0)+(e.responseExamplePresent?1:0),g=(e.requestBodyPresent?1:0)+1,M=x(y/g),T=e.totalErrorResponses>0?x(e.structuredErrorResponseCount/e.totalErrorResponses):1,I=x(1-r/(o.maxDependencyDepthGood*2)),l=x(1-e.ambiguousIdentifierCount/Math.max(o.maxAmbiguousGood+3,1)),m=De(e,n.anyOfPenaltyMultiplier),d=m===0?1:e.hasDiscriminator?x(1-m/(o.maxPolymorphismGood*4)):x(1-m/(o.maxPolymorphismGood*2));return{parameterSimplicity:s,schemaSimplicity:h,documentationQuality:$,constraintClarity:O,exampleCoverage:M,errorClarity:T,dependencyClarity:I,identifierClarity:l,polymorphismClarity:d}}function ze(e,r=D){let t=r.weights,o=e.parameterSimplicity*t.parameterSimplicity+e.schemaSimplicity*t.schemaSimplicity+e.documentationQuality*t.documentationQuality+e.constraintClarity*t.constraintClarity+e.exampleCoverage*t.exampleCoverage+e.errorClarity*t.errorClarity+e.dependencyClarity*t.dependencyClarity+e.identifierClarity*t.identifierClarity+e.polymorphismClarity*t.polymorphismClarity;return $e(x(o)*100)}function Re(e,r,t=D){let o=new Map;for(let[n,s]of e.operations){let i=r.get(n)??0,a=He(s,i,t);o.set(n,{agentReadiness:ze(a,t),subscores:a})}return o}function Me(e,r=D){return x(1-e/r.thresholds.maxOperationsForDiscoverability)}function ve(e,r,t=D){if(e.size===0)return{agentReadiness:100};let o=[];for(let i of e.values())o.push(i.agentReadiness);let n=t.weights.discoverabilityWeight,s=r*100;return{agentReadiness:$e(B(o)*(1-n)+s*n)}}function J(e,r,t){return e-r+r*t}function De(e,r){return J(e.polymorphismCount,e.anyOfCount,r)}function x(e){return Math.max(0,Math.min(1,e))}function Ee(e){let r=e.size||1,t={parameterSimplicity:0,schemaSimplicity:0,documentationQuality:0,constraintClarity:0,exampleCoverage:0,errorClarity:0,dependencyClarity:0,identifierClarity:0,polymorphismClarity:0};for(let o of e.values())t.parameterSimplicity+=o.subscores.parameterSimplicity,t.schemaSimplicity+=o.subscores.schemaSimplicity,t.documentationQuality+=o.subscores.documentationQuality,t.constraintClarity+=o.subscores.constraintClarity,t.exampleCoverage+=o.subscores.exampleCoverage,t.errorClarity+=o.subscores.errorClarity,t.dependencyClarity+=o.subscores.dependencyClarity,t.identifierClarity+=o.subscores.identifierClarity,t.polymorphismClarity+=o.subscores.polymorphismClarity;return t.parameterSimplicity/=r,t.schemaSimplicity/=r,t.documentationQuality/=r,t.constraintClarity/=r,t.exampleCoverage/=r,t.errorClarity/=r,t.dependencyClarity/=r,t.identifierClarity/=r,t.polymorphismClarity/=r,t}function $e(e){return Math.round(e*10)/10}function we(e,r,t){let o=Math.max(1,e);return r/o+t/o}function Qe(e,r){return r.totalSchemaProperties>e.totalSchemaProperties?!0:r.totalSchemaProperties<e.totalSchemaProperties?!1:we(r.totalSchemaProperties,r.schemaPropertiesWithDescription,r.constraintCount)>we(e.totalSchemaProperties,e.schemaPropertiesWithDescription,e.constraintCount)}var Ke=["enum","const","format","pattern","minimum","maximum","minLength","maxLength","minItems","maxItems","minProperties","maxProperties","multipleOf","exclusiveMinimum","exclusiveMaximum","uniqueItems"];function Y(){return{depth:-1,maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[],debugEntries:null,pendingRef:null}}function Ie(e){Object.assign(e,Y())}function Le(e){return{ref:{enter(r){typeof r?.$ref=="string"&&(e.refsUsed.push(r.$ref),e.pendingRef=r.$ref)}},Schema:{enter(r,t){e.depth++,e.maxDepth=Math.max(e.maxDepth,e.depth);let o=0;for(let i of Ke)r[i]!==void 0&&(e.constraintCount++,o++);r.discriminator?.propertyName&&(e.hasDiscriminator=!0);let n={};for(let i of["oneOf","anyOf","allOf"]){let a=r[i];Array.isArray(a)&&(e.polymorphismCount+=a.length,i==="anyOf"&&(e.anyOfCount+=a.length),n[i]=a.length)}let s=[];if(L(r.properties)){let i=Object.entries(r.properties);e.totalSchemaProperties+=i.length;for(let[a,c]of i){s.push(a);let h=c&&"$ref"in c&&c.$ref?t.resolve(c)?.node??c:c;h?.description&&e.schemaPropertiesWithDescription++,(h?.example!==void 0||h?.examples)&&(e.hasPropertyExamples=!0),h?.readOnly||e.writableTopLevelFields++}}e.debugEntries!==null&&e.debugEntries.push({ref:e.pendingRef,depth:e.depth,propertyNames:s,polymorphism:Object.keys(n).length>0?n:{},constraintCount:o}),e.pendingRef=null},leave(){e.depth--}}}}function qe(e,r,t){return{operations:new Map,currentPath:"",pathLevelParams:[],current:null,walkSchema:e,anyOfPenaltyMultiplier:r,debugOperationId:t,debugLogs:[]}}function Je(e,r,t){return{path:e,method:r,operationId:t.operationId,operationDescriptionPresent:!!t.description,parameterCount:0,requiredParameterCount:0,paramsWithDescription:0,ambiguousIdentifierCount:0,maxRequestSchemaDepth:0,maxResponseSchemaDepth:0,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,topLevelWritableFieldCount:0,requestBodyPresent:!1,requestExamplePresent:!1,responseExamplePresent:!1,structuredErrorResponseCount:0,totalErrorResponses:0,inRequestBody:!1,inResponse:!1,currentResponseCode:"",errorStructuredCounted:!1,maxEffectivePolymorphism:-1,refsUsed:new Set}}function Ye(e){let{inRequestBody:r,inResponse:t,currentResponseCode:o,errorStructuredCounted:n,maxEffectivePolymorphism:s,...i}=e;return i}function We(e){return{RequestBody:{enter(){e.current&&(e.current.requestBodyPresent=!0,e.current.inRequestBody=!0)},leave(){e.current&&(e.current.inRequestBody=!1)}},Response:{enter(r,t){let o=e.current;if(!o)return;let n=String(t.key);o.inResponse=!0,o.currentResponseCode=n,o.errorStructuredCounted=!1,Te(n)&&(o.totalErrorResponses++,!r.content&&r.description&&(o.structuredErrorResponseCount++,o.errorStructuredCounted=!0))},leave(){e.current&&(e.current.inResponse=!1)}},MediaType:{enter(r){let t=e.current;if(t&&(Ze(r)&&(t.inRequestBody&&(t.requestExamplePresent=!0),t.inResponse&&(t.responseExamplePresent=!0)),t.inResponse&&Te(t.currentResponseCode)&&!t.errorStructuredCounted&&(t.structuredErrorResponseCount++,t.errorStructuredCounted=!0),r.schema)){let o=!!e.debugOperationId&&(t.operationId===e.debugOperationId||`${t.method.toUpperCase()} ${t.path}`===e.debugOperationId),n=e.walkSchema(r.schema,o);Qe(t,n)&&(t.totalSchemaProperties=n.totalSchemaProperties,t.schemaPropertiesWithDescription=n.schemaPropertiesWithDescription,t.constraintCount=n.constraintCount);let s=J(n.polymorphismCount,n.anyOfCount,e.anyOfPenaltyMultiplier);s>t.maxEffectivePolymorphism&&(t.maxEffectivePolymorphism=s,t.polymorphismCount=n.polymorphismCount,t.anyOfCount=n.anyOfCount),n.hasDiscriminator&&(t.hasDiscriminator=!0);for(let i of n.refsUsed)t.refsUsed.add(i);if(n.hasPropertyExamples&&(t.inRequestBody&&(t.requestExamplePresent=!0),t.inResponse&&(t.responseExamplePresent=!0)),t.inRequestBody&&(t.maxRequestSchemaDepth=Math.max(t.maxRequestSchemaDepth,n.maxDepth),t.topLevelWritableFieldCount=Math.max(t.topLevelWritableFieldCount,n.writableTopLevelFields)),t.inResponse&&(t.maxResponseSchemaDepth=Math.max(t.maxResponseSchemaDepth,n.maxDepth)),o&&n.debugEntries){let i=t.inRequestBody?"REQUEST BODY":`RESPONSE ${t.currentResponseCode}`;e.debugLogs.push({context:i,entries:n.debugEntries,totalProperties:n.totalSchemaProperties,totalPolymorphism:n.polymorphismCount,totalConstraints:n.constraintCount,maxDepth:n.maxDepth})}}}},Paths:{PathItem:{enter(r,t){e.currentPath=String(t.key),e.pathLevelParams=r.parameters??[]},Operation:{enter(r,t){let o=String(t.key),n=Je(e.currentPath,o,r);e.current=n;let s=Xe(e.pathLevelParams,r.parameters??[],t.resolve);for(let i of s.values())n.parameterCount++,i.required&&n.requiredParameterCount++,i.description&&n.paramsWithDescription++,et(i)&&n.ambiguousIdentifierCount++},leave(r){let t=e.current;if(!t)return;let o=r.operationId??`${t.method.toUpperCase()} ${t.path}`;e.operations.set(o,Ye(t)),e.current=null}}}}}}function Ue(e){return{operationCount:e.operations.size,operations:e.operations}}function Ae(e,r){return r(e).node}function Xe(e,r,t){let o=new Map;for(let n of e){let s=Ae(n,t);s?.name&&s.in&&o.set(`${s.in}:${s.name}`,s)}for(let n of r){let s=Ae(n,t);s?.name&&s.in&&o.set(`${s.in}:${s.name}`,s)}return o}function Ze(e){return e.example!==void 0||ie(e.examples)}function et(e){if(e.description)return!1;let r=(e.name??"").toLowerCase();return Oe.has(r)}function Te(e){if(e==="default"||/^4xx$/i.test(e)||/^5xx$/i.test(e))return!0;let r=parseInt(e,10);return r>=400&&r<600}function tt(e,r){if(!r.startsWith("#/"))return;let t=e;for(let o of r.slice(2).split("/"))t=t?.[ce(o)];return t}function ke({document:e,types:r,resolvedRefMap:t,ctx:o,debugOperationId:n,scoringConstants:s}){let i=s?.weights.anyOfPenaltyMultiplier??D.weights.anyOfPenaltyMultiplier,a=Y(),c=Le(a),h=Q([{severity:"warn",ruleId:"score-schema",visitor:c}],r),u=(l,m)=>{Ie(a),m&&(a.debugEntries=[]),K({document:{...e,parsed:l},rootType:r.Schema,normalizedVisitors:h,resolvedRefMap:t,ctx:o});let{depth:d,pendingRef:w,debugEntries:_,...N}=a;return{...N,refsUsed:[...a.refsUsed],debugEntries:m?a.debugEntries??void 0:void 0}},f=new Map,$=new WeakSet,O={maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[]};function y(l,m){return{maxDepth:Math.max(l.maxDepth,m.maxDepth),polymorphismCount:l.polymorphismCount+m.polymorphismCount,anyOfCount:l.anyOfCount+m.anyOfCount,hasDiscriminator:l.hasDiscriminator||m.hasDiscriminator,totalSchemaProperties:l.totalSchemaProperties+m.totalSchemaProperties,schemaPropertiesWithDescription:l.schemaPropertiesWithDescription+m.schemaPropertiesWithDescription,constraintCount:l.constraintCount+m.constraintCount,hasPropertyExamples:l.hasPropertyExamples||m.hasPropertyExamples,writableTopLevelFields:l.writableTopLevelFields+m.writableTopLevelFields,refsUsed:[...l.refsUsed,...m.refsUsed],debugEntries:l.debugEntries||m.debugEntries?[...l.debugEntries??[],...m.debugEntries??[]]:void 0}}let g=(l,m=!1)=>{let d=l,w=pe(l)?l.$ref:void 0;if(w){if(!m){let S=f.get(w);if(S)return S}d=tt(e.parsed,w)??l}if(L(d)&&$.has(d))return{...O};L(d)&&$.add(d);let _=d?.oneOf,N=d?.anyOf,Z=Array.isArray(_)&&_.length>1,ee=Array.isArray(N)&&N.length>1,G=Z||ee,te=Array.isArray(d?.allOf)&&d.allOf.length>0,V=d?.discriminator,q=!G&&L(V?.mapping)?Object.values(V.mapping).filter(S=>typeof S=="string"&&me(S)).map(S=>({$ref:S})):null,re=Array.isArray(q)&&q.length>0,C;if(G||te||re){let S={...d},F=null,oe=P=>{F=F?y(F,P):P},ne=(P,v)=>{let E=g(v[0],m);for(let z=1;z<v.length;z++){let se=g(v[z],m);se.totalSchemaProperties>E.totalSchemaProperties&&(E=se)}return{...E,polymorphismCount:E.polymorphismCount+v.length,anyOfCount:E.anyOfCount+(P==="anyOf"?v.length:0),hasDiscriminator:E.hasDiscriminator||!!V}};G&&delete S.discriminator,Z&&(delete S.oneOf,oe(ne("oneOf",_))),ee&&(delete S.anyOf,oe(ne("anyOf",N)));let H=null;if(re){delete S.discriminator;let P=g(q[0],m);for(let v=1;v<q.length;v++){let E=g(q[v],m);E.totalSchemaProperties>P.totalSchemaProperties&&(P=E)}H={...P,polymorphismCount:P.polymorphismCount+q.length,hasDiscriminator:!0}}let W=null;if(te){delete S.allOf,W={...O};for(let P of d.allOf)W=y(W,g(P,m));W.polymorphismCount+=d.allOf.length}C=u(S,m),W&&(C=y(C,W)),F&&(C=y(C,F)),H&&(C=y(C,H)),w&&(C={...C,refsUsed:[w,...C.refsUsed]})}else C=u(l,m);return L(d)&&$.delete(d),w&&!m&&f.set(w,C),C},M=qe(g,i,n),T=We(M),I=Q([{severity:"warn",ruleId:"score",visitor:T}],r);return K({document:e,rootType:r.Root,normalizedVisitors:I,resolvedRefMap:t,ctx:o}),{metrics:Ue(M),debugLogs:M.debugLogs}}function Ne(e){let r=new Map;for(let[n,s]of e)for(let i of s.refsUsed){let a=r.get(i);a||(a=new Set,r.set(i,a)),a.add(n)}let t=new Map;for(let n of e.keys())t.set(n,new Set);for(let n of r.values()){if(n.size<2)continue;let s=Array.from(n);for(let i=0;i<s.length;i++)for(let a=i+1;a<s.length;a++)t.get(s[i]).add(s[a]),t.get(s[a]).add(s[i])}let o=new Map;for(let n of e.keys()){let s=rt(n,t);o.set(n,s)}return o}function rt(e,r){let t=new Set([e]),o=[e],n=0;for(;o.length>0;){let s=[];for(let i of o)for(let a of r.get(i)??[])t.has(a)||(t.add(a),s.push(a));s.length>0&&n++,o=s}return n}function Fe(e){let r={agentReadiness:e.agentReadiness,discoverability:Math.round(e.discoverability*100),subscores:e.subscores,rawMetrics:{operationCount:e.rawMetrics.operationCount,operations:Object.fromEntries(Array.from(e.rawMetrics.operations.entries()).map(([t,o])=>{let{refsUsed:n,...s}=o;return[t,s]}))},operationScores:Object.fromEntries(e.operationScores),dependencyDepths:Object.fromEntries(e.dependencyDepths),hotspots:e.hotspots};k.output(JSON.stringify(r,null,2))}function je(e,r=!1){ot(e),nt(e),it(e),r&&at(e),pt(e)}function _e(e){return e>=80?de:e>=50?j:fe}function Be(e){return _e(e)(b(e.toFixed(1)))}function p(e){k.output(e+`
8
+ `)}function ot(e){p(""),p(b(A(" Scores"))),p(""),p(` Agent Readiness: ${Be(e.agentReadiness)}/100`),p("")}function nt(e){p(b(A(" Subscores"))),p("");let r=e.subscores;R("Parameter Simplicity",r.parameterSimplicity),R("Schema Simplicity",r.schemaSimplicity),R("Documentation Quality",r.documentationQuality),R("Constraint Clarity",r.constraintClarity),R("Example Coverage",r.exampleCoverage),R("Error Clarity",r.errorClarity),R("Dependency Clarity",r.dependencyClarity),R("Identifier Clarity",r.identifierClarity),R("Polymorphism Clarity",r.polymorphismClarity),R("Discoverability",e.discoverability),p("")}function R(e,r){let t=Math.round(r*100),o=st(r);p(` ${e.padEnd(24)} ${o} ${_e(t)(t+"%")}`)}function st(e){let t=Math.round(e*20);return U("["+"\u2588".repeat(t)+"\u2591".repeat(20-t)+"]")}function it(e){if(p(b(A(" Raw Metrics Summary"))),p(""),p(` Total operations: ${e.rawMetrics.operationCount}`),e.rawMetrics.operationCount===0){p("");return}let r=[],t=[],o=[],n=[],s=0,i=0,a=0;for(let u of e.rawMetrics.operations.values())r.push(u.parameterCount),t.push(Math.max(u.maxRequestSchemaDepth,u.maxResponseSchemaDepth)),o.push(u.polymorphismCount),n.push(u.totalSchemaProperties),u.requestExamplePresent&&s++,u.responseExamplePresent&&i++,u.operationDescriptionPresent&&a++;let c=e.rawMetrics.operationCount;function h(u,f){let O=(f.reduce((T,I)=>T+I,0)/c).toFixed(1),y=B(f).toFixed(1),g=Math.min(...f),M=Math.max(...f);p(` ${u.padEnd(26)} avg ${O.padStart(6)} median ${y.padStart(6)} min ${String(g).padStart(5)} max ${String(M).padStart(5)}`)}h("Parameters/operation:",r),h("Schema depth:",t),h("Polymorphism/operation:",o),h("Properties/operation:",n),p(` Operations with request examples: ${s}/${c} (${X(s,c)})`),p(` Operations with response examples: ${i}/${c} (${X(i,c)})`),p(` Operations with description: ${a}/${c} (${X(a,c)})`),p("")}function X(e,r){return r>0?`${Math.round(e/r*100)}%`:"N/A"}function at(e){p(b(A(" Per-Operation Metrics"))),p("");let r=" "+"Operation".padEnd(50)+"Props".padStart(7)+"Poly".padStart(7)+"Depth".padStart(7)+"Params".padStart(8)+"Constr".padStart(8);p(U(r)),p(U(" "+"\u2500".repeat(r.length-2)));let t=[...e.rawMetrics.operations.entries()].sort(([,o],[,n])=>n.totalSchemaProperties-o.totalSchemaProperties);for(let[,o]of t){let n=(o.operationId??`${o.method.toUpperCase()} ${o.path}`).slice(0,48),s=Math.max(o.maxRequestSchemaDepth,o.maxResponseSchemaDepth),i=" "+n.padEnd(50)+String(o.totalSchemaProperties).padStart(7)+String(o.polymorphismCount).padStart(7)+String(s).padStart(7)+String(o.parameterCount).padStart(8)+String(o.constraintCount).padStart(8);p(i)}p("")}function Ge(e,r){if(p(""),p(b(A(` Debug: ${e} schema breakdown`))),p(""),r.length===0){p(j(` No schemas found for operation "${e}".`)),p(j(' Make sure the value matches an operationId or "METHOD /path" exactly.')),p("");return}for(let t of r){p(b(U(` ${t.context}`))),p(U(" "+"\u2500".repeat(70)));let o=new Map;for(let s of t.entries){let i=s.ref??`(inline depth ${s.depth})`,a=o.get(i);if(a){a.count++,a.totalProps+=s.propertyNames.length;for(let c of s.propertyNames)a.propNames.includes(c)||a.propNames.push(c)}else o.set(i,{count:1,totalProps:s.propertyNames.length,propNames:[...s.propertyNames]})}for(let s of t.entries){let i=s.ref??"(inline)",a=" ".repeat(Math.min(s.depth,6)),c=s.propertyNames.length,h=` ${a}${i}`;c>0&&(h+=` (${c} properties)`);let u=[];if(s.polymorphism.oneOf&&u.push(`oneOf:${s.polymorphism.oneOf}`),s.polymorphism.anyOf&&u.push(`anyOf:${s.polymorphism.anyOf}`),s.polymorphism.allOf&&u.push(`allOf:${s.polymorphism.allOf}`),u.length>0&&(h+=` [${u.join(", ")}]`),s.constraintCount>0&&(h+=` {${s.constraintCount} constraints}`),p(h),c>0&&c<=20)p(` ${a} properties: ${s.propertyNames.join(", ")}`);else if(c>20){let f=s.propertyNames.slice(0,15).join(", ");p(` ${a} properties: ${f}, ... +${c-15} more`)}}p(""),p(` Totals: ${t.totalProperties} properties, ${t.totalPolymorphism} polymorphism items, ${t.totalConstraints} constraints, max depth ${t.maxDepth}`);let n=[...o.entries()].filter(([,s])=>s.totalProps>0).sort(([,s],[,i])=>i.totalProps-s.totalProps).slice(0,10);if(n.length>0){p(""),p(b(" Top schemas by property count:"));for(let[s,i]of n)p(` ${s}: ${i.totalProps} properties`)}p("")}}function pt(e){if(e.hotspots.length===0){p(b(A(" No hotspot operations found."))),p("");return}p(b(A(` Top ${e.hotspots.length} Hotspot Operations`))),p("");for(let r of e.hotspots){let t=r.operationId?`${r.method.toUpperCase()} ${r.path} (${r.operationId})`:`${r.method.toUpperCase()} ${r.path}`;p(b(` ${t}`)),p(` Agent Readiness: ${Be(r.agentReadinessScore)}`);for(let o of r.reasons)p(j(` - ${o}`));p("")}}function Ve(e,r,t,o=D){let n=[];for(let[s,i]of r){let a=e.operations.get(s);if(!a)continue;let c=ct(a,t.get(s)??0,o);c.length!==0&&n.push({path:a.path,method:a.method,operationId:a.operationId,agentReadinessScore:i.agentReadiness,reasons:c})}return n.sort((s,i)=>s.reasons.length!==i.reasons.length?i.reasons.length-s.reasons.length:s.agentReadinessScore-i.agentReadinessScore),n.slice(0,o.hotspotLimit)}function ct(e,r,t){let{thresholds:o}=t,n=[];e.parameterCount>o.maxParamsGood&&n.push(`High parameter count (${e.parameterCount})`);let s=Math.max(e.maxRequestSchemaDepth,e.maxResponseSchemaDepth);s>o.maxDepthGood&&n.push(`Deep schema nesting (depth ${s})`),e.anyOfCount>0&&!e.hasDiscriminator?n.push(`Polymorphism (anyOf) without discriminator (${e.anyOfCount} anyOf)`):e.polymorphismCount>o.maxPolymorphismGood&&n.push(`High polymorphism count (${e.polymorphismCount})`);let i=e.requestBodyPresent&&!e.requestExamplePresent,a=!e.responseExamplePresent;return i&&a?n.push("Missing request and response examples"):i?n.push("Missing request body examples"):a&&n.push("Missing response examples"),e.totalErrorResponses>0&&e.structuredErrorResponseCount===0&&n.push("No structured error responses (4xx/5xx)"),e.operationDescriptionPresent||n.push("Missing operation description"),e.parameterCount>0&&e.paramsWithDescription===0&&n.push("No parameter descriptions"),r>o.maxDependencyDepthGood&&n.push(`High dependency depth (${r})`),e.ambiguousIdentifierCount>o.maxAmbiguousGood&&n.push(`Ambiguous identifiers (${e.ambiguousIdentifierCount})`),n}async function Vt({argv:e,config:r,collectSpecData:t}){let[{path:o}]=await xe(e.api?[e.api]:[],r),n=new le(r.resolve),{bundle:s}=await be({config:r,ref:o});t?.(s);let i=ge(s.parsed);if(Se(i)!=="oas3")throw new Ce(`The score command currently supports only OpenAPI 3.x. Detected: ${i}`);let a=mt.now(),c=ae(r.extendTypes(ue(i),i),r),h=await he({rootDocument:s,rootType:c.Root,externalRefResolver:n}),u=e["debug-operation-id"],{metrics:f,debugLogs:$}=ke({document:s,types:c,resolvedRefMap:h,ctx:{problems:[],specVersion:i,config:r,visitorsData:{}},debugOperationId:u}),O=Ne(f.operations),y=Re(f,O),g=Me(f.operationCount),{agentReadiness:M}=ve(y,g),T=Ve(f,y,O),I={agentReadiness:M,discoverability:g,subscores:Ee(y),rawMetrics:f,hotspots:T,operationScores:y,dependencyDepths:O};ut(I,o,a,e.format,!!e["operation-details"],u?{operationId:u,logs:$}:void 0)}function ut(e,r,t,o,n,s){k.info(`Document: ${ye(r)} score:
9
+ `),o==="json"?Fe(e):je(e,n),s&&Ge(s.operationId,s.logs),Pe("score",t,r)}export{Vt as handleScore};