From 1e199064b0418b11b56ce08bad3d96ff2bead10c Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 6 Jan 2025 20:53:29 +0000 Subject: [PATCH] =?UTF-8?q?build(release):=20=F0=9F=9A=80=20v10.1.0-next.3?= =?UTF-8?q?=20=F0=9F=A6=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # [10.1.0-next.3](https://github.com/readmeio/rdme/compare/v10.1.0-next.2...v10.1.0-next.3) (2025-01-06) ### Bug Fixes * **openapi:** type fixes in `prepareOas` ([#1141](https://github.com/readmeio/rdme/issues/1141)) ([fc55d28](https://github.com/readmeio/rdme/commit/fc55d285658e7918bc697398d7c2b10e8a39cacc)) [skip ci] --- CHANGELOG.md | 7 +++++++ dist-gha/commands.js | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f23f7e25..2b6698b80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [10.1.0-next.3](https://github.com/readmeio/rdme/compare/v10.1.0-next.2...v10.1.0-next.3) (2025-01-06) + + +### Bug Fixes + +* **openapi:** type fixes in `prepareOas` ([#1141](https://github.com/readmeio/rdme/issues/1141)) ([fc55d28](https://github.com/readmeio/rdme/commit/fc55d285658e7918bc697398d7c2b10e8a39cacc)) + # [10.1.0-next.2](https://github.com/readmeio/rdme/compare/v10.1.0-next.1...v10.1.0-next.2) (2025-01-06) diff --git a/dist-gha/commands.js b/dist-gha/commands.js index d02db9d08..3a6a5a6e6 100644 --- a/dist-gha/commands.js +++ b/dist-gha/commands.js @@ -90,4 +90,4 @@ o[i-4]=this.maskKey[0],o[i-3]=this.maskKey[1],o[i-2]=this.maskKey[2],o[i-1]=this * mustache.js - Logic-less {{mustache}} templates with JavaScript * http://github.com/janl/mustache.js */ -var e=Object.prototype.toString,t=Array.isArray||function(t){return"[object Array]"===e.call(t)};function n(e){return"function"==typeof e}function r(e){return t(e)?"array":typeof e}function i(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(e,t){return null!=e&&"object"==typeof e&&t in e}function s(e,t){return null!=e&&"object"!=typeof e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var a=RegExp.prototype.test;function c(e,t){return a.call(e,t)}var u=/\S/;function l(e){return!c(u,e)}var d={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function p(e){return String(e).replace(/[&<>"'`=\/]/g,(function(e){return d[e]}))}var f=/\s*/,_=/\s+/,m=/\s*=/,h=/\s*\}/,g=/#|\^|\/|>|\{|&|=|!/;function A(e,n){if(!e)return[];var r,o,s,a=!1,c=[],u=[],d=[],p=!1,A=!1,C="",E=0;function S(){if(p&&!A)for(;d.length;)delete u[d.pop()];else d=[];p=!1,A=!1}function k(e){if("string"==typeof e&&(e=e.split(_,2)),!t(e)||2!==e.length)throw new Error("Invalid tags: "+e);r=new RegExp(i(e[0])+"\\s*"),o=new RegExp("\\s*"+i(e[1])),s=new RegExp("\\s*"+i("}"+e[1]))}k(n||x.tags);for(var D,w,I,T,R,F,P=new b(e);!P.eos();){if(D=P.pos,I=P.scanUntil(r))for(var N=0,B=I.length;N0?i[i.length-1][4]:n;break;default:r.push(t)}return n}function b(e){this.string=e,this.tail=e,this.pos=0}function C(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function E(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}b.prototype.eos=function(){return""===this.tail},b.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},b.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},C.prototype.push=function(e){return new C(e,this)},C.prototype.lookup=function(e){var t,r=this.cache;if(r.hasOwnProperty(e))t=r[e];else{for(var i,a,c,u=this,l=!1;u;){if(e.indexOf(".")>0)for(i=u.view,a=e.split("."),c=0;null!=i&&c"===s?a=this.renderPartial(o,t,n,i):"&"===s?a=this.unescapedValue(o,t):"name"===s?a=this.escapedValue(o,t,i):"text"===s&&(a=this.rawValue(o)),void 0!==a&&(c+=a);return c},E.prototype.renderSection=function(e,r,i,o,s){var a=this,c="",u=r.lookup(e[1]);function l(e){return a.render(e,r,i,s)}if(u){if(t(u))for(var d=0,p=u.length;d0||!n)&&(i[o]=r+i[o]);return i.join("\n")},E.prototype.renderPartial=function(e,t,r,i){if(r){var o=this.getConfigTags(i),s=n(r)?r(e[1]):r[e[1]];if(null!=s){var a=e[6],c=e[5],u=e[4],l=s;0==c&&u&&(l=this.indentPartial(s,u,a));var d=this.parse(l,o);return this.renderTokens(d,t,r,l,i)}}},E.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return n},E.prototype.escapedValue=function(e,t,n){var r=this.getConfigEscape(n)||x.escape,i=t.lookup(e[1]);if(null!=i)return"number"==typeof i&&r===x.escape?String(i):r(i)},E.prototype.rawValue=function(e){return e[1]},E.prototype.getConfigTags=function(e){return t(e)?e:e&&"object"==typeof e?e.tags:void 0},E.prototype.getConfigEscape=function(e){return e&&"object"==typeof e&&!t(e)?e.escape:void 0};var x={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){S.templateCache=e},get templateCache(){return S.templateCache}},S=new E;return x.clearCache=function(){return S.clearCache()},x.parse=function(e,t){return S.parse(e,t)},x.render=function(e,t,n,i){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+r(e)+'" was given as the first argument for mustache#render(template, view, partials)');return S.render(e,t,n,i)},x.escape=p,x.Scanner=b,x.Context=C,x.Writer=E,x}()),mustache$1.exports}function requireVarReplacer(){if(hasRequiredVarReplacer)return varReplacer;hasRequiredVarReplacer=1;const e=requireMustache();return e.Writer.prototype.escapedValue=function(e,t){const n=t.lookup(e[1])||`{{${e[1]}}}`;return String(n)},varReplacer=function(t,n={}){const r=JSON.parse(t),{variable:i=[]}=r,o={...i.reduce(((e,{key:t,value:n})=>(e[t]=n,e)),{}),...n};return e.render(t,o)}}function requireSrc$3(){if(hasRequiredSrc$3)return src$3;hasRequiredSrc$3=1;const{promises:{writeFile:e,readFile:t}}=require$$0$8,{getStatusCodeMessage:n}=requireSrc$4(),{dump:r}=requireJsYaml(),i=require$$3,o=requireLodash_camelcase(),{parseMdTable:s}=requireMdUtils(),a=requireVarReplacer();function c({tag:e,name:t},{separator:n=" > ",concat:r=!0}){return e&&r?`${e}${n}${t}`:t}function u(e,t){const{info:{name:n,description:r},variable:i=[]}=e,o=y(i,"version","1.0.0"),{title:s=n,description:a=r,version:c=o,termsOfService:u,license:f,contact:_,xLogo:m}=t;return{title:s,description:a,version:c,...l(i,m),...u?{termsOfService:u}:{},...p(i,_),...d(i,f)}}function l(e,t={}){const n=y(e,"x-logo.urlVar"),r=y(e,"x-logo.backgroundColorVar"),i=y(e,"x-logo.altTextVar"),o=y(e,"x-logo.hrefVar"),{url:s=n,backgroundColor:a=r,altText:c=i,href:u=o}=t;return null!=s?{"x-logo":{url:s,backgroundColor:a,altText:c,href:u}}:{}}function d(e,t={}){const n=y(e,"license.name"),r=y(e,"license.url"),{name:i=n,url:o=r}=t;return null!=i?{license:{name:i,...o?{url:o}:{}}}:{}}function p(e,t={}){const n=y(e,"contact.name"),r=y(e,"contact.url"),i=y(e,"contact.email"),{name:o=n,url:s=r,email:a=i}=t;return[o,s,a].some((e=>null!=e))?{contact:{...o?{name:o}:{},...s?{url:s}:{},...a?{email:a}:{}}}:{}}function f(e,t){const n=y(e,"externalDocs.description"),r=y(e,"externalDocs.url"),{description:i=n,url:o=r}=t;return null!=o?{externalDocs:{url:o,...i?{description:i}:{}}}:{}}function _(e={},t){if(["GET","DELETE"].includes(t))return{};const{mode:n,raw:r,options:o={raw:r}}=e;let s={};switch(n){case"raw":{const{raw:{language:e}}=o;let t="";if("json"===e){if(r){const e=[];t=i.parse(r,e),e.length>0&&(t=r)}s={"application/json":{schema:{type:"object",example:t}}}}else s="text"===e?{"text/plain":{schema:{type:"string",example:r}}}:{"*/*":{schema:{type:"string",example:JSON.stringify(r)}}};break}case"file":s={"text/plain":{}};break;case"formdata":s={"multipart/form-data":m(e.formdata)};break;case"urlencoded":s={"application/x-www-form-urlencoded":m(e.urlencoded)}}return{requestBody:{content:s}}}function m(e){return e.reduce(((e,{key:t,type:n,description:r,value:i})=>{const{schema:o}=e;return function(e){return/\[required\]/gi.test(e)}(r)&&(o.required=o.required||[]).push(t),(o.properties=o.properties||{})[t]={type:v(i),...r?{description:r.replace(/ ?\[required\] ?/gi,"")}:{},...i?{example:i}:{},..."file"===n?{format:"binary"}:{}},e}),{schema:{type:"object"}})}const h=(e,t)=>(e.has(t.name)||e.set(t.name,t),e);function g(e,t,n,r={},i,{includeQuery:o=!1,includeHeader:s=!1},a=h){const c=[...t.reduce(A("header",s,a),new Map).values()];return c.push(...e.reduce(A("query",o,a),new Map).values()),c.push(...function(e,t,n){const r=e.match(/{\s*[\w-]+\s*}/g)||[];return r.map((e=>{const r=e.slice(1,-1),{type:i="string",description:o,value:s}=n[r]||{},{type:a=i,description:c=o,example:u=s}=t[r]||{};return{name:r,in:"path",schema:{type:a},required:!0,...c?{description:c}:{},...u?{example:u}:{}}}))}(n,r,i)),c.length?{parameters:c}:{}}function A(e,t,n){return(r,{key:i,description:o,value:s,disabled:a})=>{if(!t&&!0===a)return r;const c=/\[required\]/gi.test(o);return n(r,{name:i,in:e,schema:{type:v(s)},...c?{required:c}:{},...o?{description:o.replace(/ ?\[required\] ?/gi,"")}:{},...s?{example:s}:{}}),r}}function y(e,t,n=void 0){const r=e.find((({key:e})=>e===t));return r?r.value:n}function v(e){return/^\d+$/.test(e)?"integer":/^[+-]?([0-9]*[.])?[0-9]+$/.test(e)?"number":/^(true|false)$/.test(e)?"boolean":"string"}function b({auth:e},t,n){return null!=t?function(e){const t={},n=[];for(const[r,i]of Object.entries(e)){const{type:e,scheme:o,...s}=i;"http"===e&&["bearer","basic"].includes(o)&&(t[r]={type:"http",scheme:o,...s},n.push({[r]:[]}))}return 0===Object.keys(t).length?{}:{components:{securitySchemes:t},security:n}}(t):function(e={},t){const{type:n}=e;if(null!=n)return t[`${n}Auth`]={type:"http",scheme:n},{components:{securitySchemes:t},security:[{[`${n}Auth`]:[]}]};return 0===Object.keys(t).length?{}:{components:{securitySchemes:t}}}(e,n)}function C(e,t,n){if(null==e||null!=n)return{};const{type:r}=e;return t[`${r}Auth`]={type:"http",scheme:r},{security:[{[`${r}Auth`]:[]}]}}function E(e,t){return`/${(e=e.slice(t)).map((e=>e=(e=e.replace(/([{}])\1+/g,"$1")).replace(/^:(.*)/g,"{$1}"))).join("/")}`}function x(e,t,n){return`${e}://${t.join(".")}${n?`:${n}`:""}`}function S(e){if(void 0===e||""===e||""===e.raw)return{valid:!1};const t="string"==typeof e||e instanceof String?e:e.raw,n=t.startsWith("{{")?`http://${t}`:t,r=new URL(n);return{raw:t,path:decodeURIComponent(r.pathname).slice(1).split("/"),query:k(r.searchParams,e.query),protocol:r.protocol.slice(0,-1),host:decodeURIComponent(r.hostname).split("."),port:r.port,valid:!0,pathVars:null==e.variable?{}:e.variable.reduce(((e,{key:t,value:n,description:r})=>(e[t]={value:n,description:r,type:v(n)},e)),{})}}function k(e,t=[]){return t}function D(e,t){let n;return n=null!=t?t.map((({url:e,description:t})=>({url:e,description:t}))):Array.from(e).map((e=>({url:e}))),n.length>0?{servers:n}:{}}function w(e){const t=Object.entries(e).map((([e,t])=>({name:e,description:t})));return t.length>0?{tags:t}:{}}function I(e){if(null==e)return{description:e};const t=e.split(/# postman-to-openapi/gi);return 1===t.length?{description:e}:{description:t[0].trim(),paramsMeta:s(t[1])}}function T(e,t,r){return null!=e&&Array.isArray(e)&&e.length>0?function(e,t){const r=e.reduce(((e,{name:t,code:r,status:i,header:o,body:s,_postman_previewlanguage:a})=>{if(void 0===r&&(r="default"),!i)try{i=n({code:r})}catch(e){i=r}return r in e?(a in e[r].bodies||(e[r].bodies[a]=[]),e[r].bodies[a].push({name:t,body:s})):e[r]={description:i,header:o,bodies:{[a]:[{name:t,body:s}]}},e}),{}),i=Object.entries(r).reduce(((e,[n,{description:r,header:i,bodies:o}])=>(e[n]={description:r,...B(i,t),...F(o)},e)),{});return{responses:i}}(e,r):{responses:R(t)}}function R(e=[]){let t=200;const n=e.filter((e=>"test"===e.listen));if(n.length>0){const e=n[0].script.exec.join().match(/\.response\.code\)\.to\.eql\((\d{3})\)|\.to\.have\.status\((\d{3})\)/);t=e&&null!=e[1]?e[1]:e&&null!=e[2]?e[2]:t}return{[t]:{description:"Successful response",content:{"application/json":{}}}}}function F(e){return{content:Object.entries(e).reduce(((e,[t,n])=>("json"===t?e["application/json"]={schema:{type:"object"},...P(n,"json")}:e["text/plain"]={schema:{type:"string"},...P(n,"text")},e)),{})}}function P(e,t){if(Array.isArray(e)&&e.length>1)return{examples:e.reduce(((e,{name:n,body:r},i)=>(e[`example-${i}`]={summary:n,value:N(r,n,t)},e)),{})};const{body:n,name:r}=e[0];return{example:N(n,r,t)}}function N(e,t,n){if("json"===n){const n=[],r=i.parse(null==e||0===e.trim().length?"{}":e,n);if(n.length>0)throw new Error(`Error parsing response example "${t}"`);return r}return e}function B(e,t){if(!t)return{};const n=(e=e||[]).reduce(((e,{key:t,value:n})=>(e[t]={schema:{type:v(n),example:n}},e)),{});return Object.keys(n).length>0?{headers:n}:{}}function O(e,t,n){let r;switch(e){case"off":break;case"auto":r=o(n);break;case"brackets":{const e=t.match(/\[([^\[\]]*)\]/);r=e?e[1]:void 0;break}}return r?{operationId:r}:{}}return src$3=async function(n,i,{info:o={},defaultTag:s="default",pathDepth:l=0,auth:d,servers:p,externalDocs:m={},folders:h={},responseHeaders:A=!0,replaceVars:y=!1,additionalVars:v={},outputFormat:k="yaml",disabledParams:R={includeQuery:!1,includeHeader:!1},operationId:F="off"}={}){let P=await async function(e){if(e.trim().startsWith("{"))return e;return t(e,"utf8")}(n);y&&(P=a(P,v));const N=JSON.parse(P),B=N.collection||N,{item:q,variable:$=[]}=B,Q={},L=new Set,M={},j={};for(let[e,t]of q.entries()){for(;null!=t&&null!=t.item;){const{item:n,description:r}=t,i=c(t,h),o=n.map((e=>({...e,tag:i})));M[i]=r,q.splice(e,1,...o),t=o.length>0?o.shift():q[e]}if(null!=t){const{request:{url:e,method:n,body:r,description:i,header:o=[],auth:a},name:c,tag:u=s,event:p,response:f}=t,{path:m,query:h,protocol:y,host:v,port:b,valid:k,pathVars:D}=S(e);if(k){const e=c.replace(/ \[([^\[\]]*)\]/gi,"");L.add(x(y,v,b));const t=E(m,l);Q[t]||(Q[t]={});const{description:s,paramsMeta:S}=I(i);Q[t][n.toLowerCase()]={tags:[u],summary:e,...O(F,c,e),...s?{description:s}:{},..._(r,n),...C(a,j,d),...g(h,o,t,S,D,R),...T(f,p,A)}}}}const U={openapi:"3.0.0",info:u(B,o),...f($,m),...D(L,p),...b(B,d,j),...w(M),paths:Q},J="json"===k?JSON.stringify(U,null,4):r(U,{skipInvalid:!0});return null!=i&&await e(i,J,"utf8"),J},src$3}var srcExports$2=requireSrc$3(),postmanToOpenAPI=getDefaultExportFromCjs(srcExports$2),utils$1,hasRequiredUtils$1,requestOptions,hasRequiredRequestOptions,request,hasRequiredRequest,http_1,hasRequiredHttp,https_1,hasRequiredHttps,lib$8,hasRequiredLib$7;function requireUtils$1(){if(hasRequiredUtils$1)return utils$1;hasRequiredUtils$1=1;class e extends TypeError{constructor(e,t,n){e.includes(".");determiner}}return utils$1={ERR_INVALID_ARG_TYPE:e,assertIsObject:function t(n,r,i="Object"){if(void 0!==n&&(null===n||"object"!=typeof n||Array.isArray(n))){const o=new e(r,i,n);throw Error.captureStackTrace(o,t),o}},DebounceTimers:class{constructor(e,t){this.cb=e,this.delay=t,this.timers={},this.pausers={}}setDelay(e){e>=0&&(this.delay=e)}pause(e){this.pausers[e]=this.pausers[e]||0,this.pausers[e]++}unpause(e){var t=this.pausers[e]||0;t>0&&t--,this.pausers[e]=t}unpauseAndTime(e){this.unpause(e),this.time(e)}time(e){var t=this,n=this.timers,r=this.timers[e];this.pausers[e]>0||(r&&clearTimeout(r),n[e]=setTimeout((function(){t.cb(e),delete n[e]}),t.delay))}}},utils$1}function requireRequestOptions(){if(hasRequiredRequestOptions)return requestOptions;hasRequiredRequestOptions=1;const{assertIsObject:e}=requireUtils$1();function t(t){return e(t,"options"),(t=Object.assign({},t)).allowHalfOpen=!0,t.rejectUnauthorized=!1,e(t.settings,"options.settings"),t.settings=Object.assign({},t.settings),t.Http1IncomingMessage=t.Http1IncomingMessage||this.http.IncomingMessage,t.Http1ServerResponse=t.Http1ServerResponse||this.http.ServerResponse,t.Http2ServerRequest=t.Http2ServerRequest||(this.http2||{}).Http2ServerRequest,t.Http2ServerResponse=t.Http2ServerResponse||(this.http2||{}).Http2ServerResponse,t}return requestOptions={initializeTLSOptions:function(e,n){var r=(e=t.call(this,e)).ALPNProtocols=[];return this.http2Support&&r.push("h2"),1!=e.allowHTTP1&&this.http2Support||r.push("http/1.1"),void 0!==n&&void 0===e.servername&&(e.servername=n),e}},requestOptions}function requireRequest(){if(hasRequiredRequest)return request;hasRequiredRequest=1;const{URL:e}=require$$0$e,{EventEmitter:t}=require$$0$d,n=require$$0__default._extend,{DebounceTimers:r,assertIsObject:i,ERR_INVALID_ARG_TYPE:o}=requireUtils$1(),{initializeTLSOptions:s}=requireRequestOptions(),a=require$$2$1,c=require$$1$4,{Stream:u}=require$$0$c;function l(e,t){const n=t.prototype;Object.keys(n).forEach((t=>{-1==e.indexOf(t)&&0!=t.indexOf("_")&&"function"==typeof n[t]&&e.push(t)}))}const d=[];l(d,a.ClientRequest),l(d,a.OutgoingMessage),l(d,t),l(d,u);const p=["httpVersionMajor","httpVersionMinor","httpVersion"],f=["host","connection"],_=Symbol("stubs");function m(){this.http2Mimic=!0,this[_]=[];for(var t=0;te.agent?"https:"==e.agent.protocol?y.globalManager:b.globalManager:h.globalManager,genericStubber(e,t){return this[_]?(this[_].push([e,t]),!0):this[e](...arguments)},on(e,t){"response"==e&&(t.http2Safe||(arguments[0]=e="http1.response")),this._on?this._on(...arguments):this.genericStubber("on",arguments)},once(e,t){"response"==e&&(t.http2Safe||(e="http1.response")),this._once?this._once(...arguments):this.genericStubber("once",arguments)},emitError(e){if(!this[_])return this.emit("error",e);this[_].forEach((([t,n])=>{"on"!==t&&"once"!==t||"error"!==n[0]||n[1](e)}))},take(e){for(var t=0;to};process.nextTick(function(){r.makeRequest(e,i,t,n,s)}.bind(r))}else r.holdConnectionToIdentification(i,t,function(o,s){o?e.emitError(o):r.makeRequest(e,i,t,n,s)}.bind(r))}getClientKey(e){return`${e.protocol||this.enforceProtocol}${e.servername||e.host||e.hostname}:${e.port}`}getHttp2Client(e){return this.http2Clients[e]}setHttp2Client(e,t){const n=this,r=n.http2Clients[e];function i(){n.removeHttp2Client(e,t)}r&&n.removeHttp2Client(e,r),n.http2Clients[e]=t,t.on("close",i),t.on("goaway",i),t.on("error",i),t.on("frameError",i),t.on("timeout",i)}removeHttp2Client(e,t){try{delete this.http2Clients[e],t.closed||t.close()}catch(e){}t.removeAllListeners("close"),t.removeAllListeners("error"),t.removeAllListeners("frameError"),t.removeAllListeners("timeout")}request(e,t,n){var r=new A(arguments);return this.enforceProtocol&&(r.protocol=this.enforceProtocol),new m(r)}get(){var e=new A(arguments);e.method="GET";var t=this.request(e);return t.end(),t}hasCachedConnection(e){return!!this.getHttp2Client(e)||this.cachedHTTP1Result[e]+this.keepH1IdentificationCacheFori};if("h2"==s&&this.http2Support){var c=this.http2.connect(t,a);this.setHttp2Client(e,c)}else this.cachedHTTP1Result[e]=Date.now();n(null,a),this.emit(r,a)}.bind(this))}}makeHttpRequest(t,r,i,o,s){i instanceof e&&(i=g(i));const a=n({},i);s&&(a.createConnection=s.createConnection);const c=("https:"==a.protocol?this.https:this.http).request(a,o);r.take(c),r._on("response",(function(e){this.emit("http1.response",e)}))}makeHttp2Request(e,t,r,i,o){var s=this.http2Debouncer;s.pause(e);var a=n({},i.headers||{});i.method&&(a[":method"]=i.method),i.path&&(a[":path"]=i.path),Object.keys(a).forEach((e=>{-1!=f.indexOf((e+"").toLowerCase())&&delete a[e]})),i.headers=a;var c=r.request(a);let u;t.emit("socket",i.createConnection());let l=0;function d(n){u=parseInt(n["content-length"]),u<0&&this.http2Debouncer.unpauseAndTime(e),h.httpCompatibleResponse(c,i,n),t.emit("http1.response",c),o&&o(c)}c.on("data",(function(t){l+=t.length,l>=u&&s.unpauseAndTime(e)})),t.take(c),d.http2Safe=!0,c.once("response",d.bind(this))}static httpCompatibleResponse(e,t,n){e.httpVersion="2.0",e.rawHeaders=n,e.headers=n,e.statusCode=n[":status"],delete n[":status"]}identifyConnection(e,t){var n=this.connect(e,{allowHTTP1:!0},(function(){n.removeListener("error",t),"h2"==n.alpnProtocol?t(null,"h2"):(n.end(),t(null,"h1"))}));return n.on("error",t),n}connect(t,n,r){"function"==typeof n&&(r=n,n=void 0),i(n,"options"),n=Object.assign({},n),"string"==typeof t&&(t=new e(t)),i(t,"authority",["string","Object","URL"]);var o,a=t.protocol||n.protocol||("detect"!=this.enforceProtocol?this.enforceProtocol:null)||"http:",c=""+(""!==t.port?t.port:"http:"===t.protocol?80:443),u=t.hostname||t.host||"localhost";if("function"==typeof n.createConnection)o=n.createConnection(t,n);else switch(a){case"http:":o=this.net.connect(c,u,r);break;case"https:":o=this.tls.connect(c,u,s.call(this,n,u),r);break;default:throw new Error("Not supprted"+a)}return o}}function g(e){var t={protocol:e.protocol,hostname:e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:`${e.pathname}${e.search}`,href:e.href};return""!==e.port&&(t.port=Number(e.port)),(e.username||e.password)&&(t.auth=`${e.username}:${e.password}`),t}class A{constructor(e){if(e[0]instanceof A)return e[0];this.args=e,this.method=null,this.protocol=null}}class y extends h{constructor(){super(...arguments),this.Agent=c.Agent,this.globalAgent=c.globalAgent,this.enforceProtocol="https:"}}const v=new y;y.globalManager=v,y.Manager=y;class b extends h{constructor(){super(...arguments),this.Agent=a.Agent,this.globalAgent=a.globalAgent,this.enforceProtocol="http:"}}const C=new b;b.globalManager=C,b.Manager=b;const E=new h;return E.enforceProtocol="detect",h.globalManager=E,request={HttpRequest:b,HttpsRequest:y,HTTP2OutgoingMessage:m,ClientRequest:m,HttpRequestManager:h}}function requireHttp(){if(hasRequiredHttp)return http_1;hasRequiredHttp=1;const{HttpRequest:e,ClientRequest:t}=requireRequest(),n=e.globalManager,r=n.request.bind(n),i=n.get.bind(n),o=Object.assign({},require$$2$1);return http_1=Object.assign(o,{ClientRequest:t,globalManager:n,request:r,get:i})}function requireHttps(){if(hasRequiredHttps)return https_1;hasRequiredHttps=1;const{HttpsRequest:e,ClientRequest:t}=requireRequest(),n=e.globalManager,r=n.request.bind(n),i=n.get.bind(n),o=Object.assign({},require$$1$4);return https_1=Object.assign(o,{ClientRequest:t,globalManager:n,request:r,get:i})}function requireLib$7(){if(hasRequiredLib$7)return lib$8;hasRequiredLib$7=1;const{HttpRequestManager:e,HTTP2OutgoingMessage:t,ClientRequest:n}=requireRequest(),r=requireHttp(),i=requireHttps(),o=new e;e.globalManager=o;const s=o.request.bind(o),a=o.get.bind(o);return lib$8={HTTP2OutgoingMessage:t,ClientRequest:n,globalManager:e.globalManager,request:s,get:a,http:r,https:i}}var libExports$1=requireLib$7(),h2=getDefaultExportFromCjs(libExports$1);const BUFFER=Symbol("buffer"),TYPE=Symbol("type");let Blob$1=class e{constructor(){this[TYPE]="";const t=arguments[0],n=arguments[1],r=[];if(t){const n=t,i=Number(n.length);for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:{},r=n.size;let i=void 0===r?0:r;var o=n.timeout;let s=void 0===o?0:o;null==e?e=null:isURLSearchParams(e)?e=Buffer.from(e.toString()):e instanceof Blob$1?e=e[BUFFER]:Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof require$$0$c||(e=Buffer.from(String(e)))),this[INTERNALS]={body:e,disturbed:!1,error:null},this.size=i,this.timeout=s,e instanceof require$$0$c&&e.on("error",(function(e){const n="AbortError"===e.name?e:new FetchError(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[INTERNALS].error=n}))}function consumeBody(){var e=this;if(this[INTERNALS].disturbed)return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[INTERNALS].disturbed=!0,this[INTERNALS].error)return Body.Promise.reject(this[INTERNALS].error);if(null===this.body)return Body.Promise.resolve(Buffer.alloc(0));if(Buffer.isBuffer(this.body))return Body.Promise.resolve(this.body);if(!(this.body instanceof require$$0$c))return Body.Promise.resolve(Buffer.alloc(0));let t=[],n=0,r=!1;return new Body.Promise((function(i,o){let s;e.timeout&&(s=setTimeout((function(){r=!0,o(new FetchError(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)),e.body.on("error",(function(t){"AbortError"===t.name?(r=!0,o(t)):o(new FetchError(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))})),e.body.on("data",(function(i){if(!r&&null!==i){if(e.size&&n+i.length>e.size)return r=!0,void o(new FetchError(`content size at ${e.url} over limit: ${e.size}`,"max-size"));n+=i.length,t.push(i)}})),e.body.on("end",(function(){if(!r){clearTimeout(s);try{i(Buffer.concat(t))}catch(t){o(new FetchError(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}}))}))}function convertBody(e,t){if("function"!=typeof convert)throw new Error("The package `encoding` must be installed to use the textConverted() function");const n=t.get("content-type");let r,i,o="utf-8";return n&&(r=/charset=([^;]*)/i.exec(n)),i=e.slice(0,1024).toString(),!r&&i&&(r=/0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[MAP]=Object.create(null),t instanceof e){const e=t.raw(),n=Object.keys(e);for(const t of n)for(const n of e[t])this.append(t,n)}else if(null==t);else{if("object"!=typeof t)throw new TypeError("Provided initializer must be an object");{const e=t[Symbol.iterator];if(null!=e){if("function"!=typeof e)throw new TypeError("Header pairs must be iterable");const n=[];for(const e of t){if("object"!=typeof e||"function"!=typeof e[Symbol.iterator])throw new TypeError("Each header pair must be iterable");n.push(Array.from(e))}for(const e of n){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const e of Object.keys(t)){const n=t[e];this.append(e,n)}}}}get(e){validateName(e=`${e}`);const t=find(this[MAP],e);return void 0===t?null:this[MAP][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=getHeaders(this),r=0;for(;r1&&void 0!==arguments[1]?arguments[1]:"key+value";return Object.keys(e[MAP]).sort().map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[MAP][t].join(", ")}:function(t){return[t.toLowerCase(),e[MAP][t].join(", ")]})}Headers$1.prototype.entries=Headers$1.prototype[Symbol.iterator],Object.defineProperty(Headers$1.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(Headers$1.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const INTERNAL=Symbol("internal");function createHeadersIterator(e,t){const n=Object.create(HeadersIteratorPrototype);return n[INTERNAL]={target:e,kind:t,index:0},n}const HeadersIteratorPrototype=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==HeadersIteratorPrototype)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[INTERNAL];const t=e.target,n=e.kind,r=e.index,i=getHeaders(t,n);return r>=i.length?{value:void 0,done:!0}:(this[INTERNAL].index=r+1,{value:i[r],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function exportNodeCompatibleHeaders(e){const t=Object.assign({__proto__:null},e[MAP]),n=find(e[MAP],"Host");return void 0!==n&&(t[n]=t[n][0]),t}function createHeadersLenient(e){const t=new Headers$1;for(const n of Object.keys(e))if(!invalidTokenRegex.test(n))if(Array.isArray(e[n]))for(const r of e[n])invalidHeaderCharRegex.test(r)||(void 0===t[MAP][n]?t[MAP][n]=[r]:t[MAP][n].push(r));else invalidHeaderCharRegex.test(e[n])||(t[MAP][n]=[e[n]]);return t}Object.defineProperty(HeadersIteratorPrototype,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const INTERNALS$1=Symbol("Response internals"),STATUS_CODES=require$$2$1.STATUS_CODES;class Response{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Body.call(this,e,t);const n=t.status||200,r=new Headers$1(t.headers);if(null!=e&&!r.has("Content-Type")){const t=extractContentType(e);t&&r.append("Content-Type",t)}this[INTERNALS$1]={url:t.url,status:n,statusText:t.statusText||STATUS_CODES[n],headers:r}}get url(){return this[INTERNALS$1].url}get status(){return this[INTERNALS$1].status}get ok(){return this[INTERNALS$1].status>=200&&this[INTERNALS$1].status<300}get statusText(){return this[INTERNALS$1].statusText}get headers(){return this[INTERNALS$1].headers}clone(){return new Response(clone(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok})}}Body.mixIn(Response.prototype),Object.defineProperties(Response.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(Response.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const INTERNALS$2=Symbol("Request internals"),parse_url=require$$0$e.parse,format_url=require$$0$e.format,streamDestructionSupported="destroy"in require$$0$c.Readable.prototype;function isRequest(e){return"object"==typeof e&&"object"==typeof e[INTERNALS$2]}function isAbortSignal(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}class Request{constructor(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};isRequest(e)?t=parse_url(e.url):(t=e&&e.href?parse_url(e.href):parse_url(`${e}`),e={});let r=n.method||e.method||"GET";if(r=r.toUpperCase(),(null!=n.body||isRequest(e)&&null!==e.body)&&("GET"===r||"HEAD"===r))throw new TypeError("Request with GET/HEAD method cannot have body");let i=null!=n.body?n.body:isRequest(e)&&null!==e.body?clone(e):null;Body.call(this,i,{timeout:n.timeout||e.timeout||0,size:n.size||e.size||0});const o=new Headers$1(n.headers||e.headers||{});if(null!=i&&!o.has("Content-Type")){const e=extractContentType(i);e&&o.append("Content-Type",e)}let s=isRequest(e)?e.signal:null;if("signal"in n&&(s=n.signal),null!=s&&!isAbortSignal(s))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[INTERNALS$2]={method:r,redirect:n.redirect||e.redirect||"follow",headers:o,parsedURL:t,signal:s},this.follow=void 0!==n.follow?n.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==n.compress?n.compress:void 0===e.compress||e.compress,this.counter=n.counter||e.counter||0,this.agent=n.agent||e.agent}get method(){return this[INTERNALS$2].method}get url(){return format_url(this[INTERNALS$2].parsedURL)}get headers(){return this[INTERNALS$2].headers}get redirect(){return this[INTERNALS$2].redirect}get signal(){return this[INTERNALS$2].signal}clone(){return new Request(this)}}function getNodeRequestOptions(e){const t=e[INTERNALS$2].parsedURL,n=new Headers$1(e[INTERNALS$2].headers);if(n.has("Accept")||n.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof require$$0$c.Readable&&!streamDestructionSupported)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let r=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(r="0"),null!=e.body){const t=getTotalBytes(e);"number"==typeof t&&(r=String(t))}return r&&n.set("Content-Length",r),n.has("User-Agent")||n.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!n.has("Accept-Encoding")&&n.set("Accept-Encoding","gzip,deflate"),n.has("Connection")||e.agent||n.set("Connection","close"),Object.assign({},t,{method:e.method,headers:exportNodeCompatibleHeaders(n),agent:e.agent})}function AbortError(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}Body.mixIn(Request.prototype),Object.defineProperty(Request.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(Request.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),AbortError.prototype=Object.create(Error.prototype),AbortError.prototype.constructor=AbortError,AbortError.prototype.name="AbortError";const PassThrough$1=require$$0$c.PassThrough,resolve_url=require$$0$e.resolve;function fetch$1(e,t){if(!fetch$1.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return Body.Promise=fetch$1.Promise,new fetch$1.Promise((function(n,r){const i=new Request(e,t),o=getNodeRequestOptions(i),s=h2.request,a=i.signal;let c=null;const u=function(){let e=new AbortError("The user aborted a request.");r(e),i.body&&i.body instanceof require$$0$c.Readable&&i.body.destroy(e),c&&c.body&&c.body.emit("error",e)};if(a&&a.aborted)return void u();const l=function(){u(),f()},d=s(o);let p;function f(){d.abort(),a&&a.removeEventListener("abort",l),clearTimeout(p)}a&&a.addEventListener("abort",l),i.timeout&&d.once("socket",(function(e){p=setTimeout((function(){r(new FetchError(`network timeout at: ${i.url}`,"request-timeout")),f()}),i.timeout)})),d.on("error",(function(e){r(new FetchError(`request to ${i.url} failed, reason: ${e.message}`,"system",e)),f()})),d.on("response",(function(e){clearTimeout(p);const t=createHeadersLenient(e.headers);if(fetch$1.isRedirect(e.statusCode)){const o=t.get("Location"),s=null===o?null:resolve_url(i.url,o);switch(i.redirect){case"error":return r(new FetchError(`redirect mode is set to error: ${i.url}`,"no-redirect")),void f();case"manual":if(null!==s)try{t.set("Location",s)}catch(e){r(e)}break;case"follow":if(null===s)break;if(i.counter>=i.follow)return r(new FetchError(`maximum redirect reached at: ${i.url}`,"max-redirect")),void f();const o={headers:new Headers$1(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:i.body,signal:i.signal};return 303!==e.statusCode&&i.body&&null===getTotalBytes(i)?(r(new FetchError("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void f()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==i.method)||(o.method="GET",o.body=void 0,o.headers.delete("content-length")),n(fetch$1(new Request(s,o))),void f())}}e.once("end",(function(){a&&a.removeEventListener("abort",l)}));let o=e.pipe(new PassThrough$1);const s={url:i.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:i.size,timeout:i.timeout},u=t.get("Content-Encoding");if(!i.compress||"HEAD"===i.method||null===u||204===e.statusCode||304===e.statusCode)return c=new Response(o,s),void n(c);const d={flush:zlib.Z_SYNC_FLUSH,finishFlush:zlib.Z_SYNC_FLUSH};if("gzip"==u||"x-gzip"==u)return o=o.pipe(zlib.createGunzip(d)),c=new Response(o,s),void n(c);if("deflate"!=u&&"x-deflate"!=u)c=new Response(o,s),n(c);else{e.pipe(new PassThrough$1).once("data",(function(e){o=8==(15&e[0])?o.pipe(zlib.createInflate()):o.pipe(zlib.createInflateRaw()),c=new Response(o,s),n(c)}))}})),writeToStream(d,i)}))}fetch$1.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},fetch$1.Promise=global.Promise;var lib$7=Object.freeze({__proto__:null,FetchError:FetchError,Headers:Headers$1,Request:Request,Response:Response,default:fetch$1}),require$$4=getAugmentedNamespace(lib$7),dist$1={},parseCst={},PlainValueEc8e588e={},hasRequiredPlainValueEc8e588e,hasRequiredParseCst;function requirePlainValueEc8e588e(){if(hasRequiredPlainValueEc8e588e)return PlainValueEc8e588e;hasRequiredPlainValueEc8e588e=1;const e={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},t={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"};function n(e){const t=[0];let n=e.indexOf("\n");for(;-1!==n;)n+=1,t.push(n),n=e.indexOf("\n",n);return t}function r(e){let t,r;return"string"==typeof e?(t=n(e),r=e):(Array.isArray(e)&&(e=e[0]),e&&e.context&&(e.lineStarts||(e.lineStarts=n(e.context.src)),t=e.lineStarts,r=e.context.src)),{lineStarts:t,src:r}}function i(e,t){if("number"!=typeof e||e<0)return null;const{lineStarts:n,src:i}=r(t);if(!n||!i||e>i.length)return null;for(let t=0;t=1)||e>n.length)return null;const o=n[e-1];let s=n[e];for(;s&&s>o&&"\n"===i[s-1];)--s;return i.slice(o,s)}(e.line,n);if(!o)return null;let{col:s}=e;if(o.length>i)if(s<=i-10)o=o.substr(0,i-1)+"…";else{const e=Math.round(i/2);o.length>s+e&&(o=o.substr(0,s+e-1)+"…"),s-=o.length-i,o="…"+o.substr(1-i)}let a=1,c="";t&&(t.line===e.line&&s+(t.col-e.col)<=i+1?a=t.col-e.col:(a=Math.min(o.length+1,i)-s,c="…"));return`${o}\n${s>1?" ".repeat(s-1):""}${"^".repeat(a)}${c}`}class s{static copy(e){return new s(e.start,e.end)}constructor(e,t){this.start=e,this.end=t||e}isEmpty(){return"number"!=typeof this.start||!this.end||this.end<=this.start}setOrigRange(e,t){const{start:n,end:r}=this;if(0===e.length||r<=e[0])return this.origStart=n,this.origEnd=r,t;let i=t;for(;in);)++i;this.origStart=n+i;const o=i;for(;i=r);)++i;return this.origEnd=r+i,o}}class a{static addStringTerminator(e,t,n){if("\n"===n[n.length-1])return n;const r=a.endOfWhiteSpace(e,t);return r>=e.length||"\n"===e[r]?n+"\n":n}static atDocumentBoundary(t,n,r){const i=t[n];if(!i)return!0;const o=t[n-1];if(o&&"\n"!==o)return!1;if(r){if(i!==r)return!1}else if(i!==e.DIRECTIVES_END&&i!==e.DOCUMENT_END)return!1;const s=t[n+1],a=t[n+2];if(s!==i||a!==i)return!1;const c=t[n+3];return!c||"\n"===c||"\t"===c||" "===c}static endOfIdentifier(e,t){let n=e[t];const r="<"===n,i=r?["\n","\t"," ",">"]:["\n","\t"," ","[","]","{","}",","];for(;n&&-1===i.indexOf(n);)n=e[t+=1];return r&&">"===n&&(t+=1),t}static endOfIndent(e,t){let n=e[t];for(;" "===n;)n=e[t+=1];return t}static endOfLine(e,t){let n=e[t];for(;n&&"\n"!==n;)n=e[t+=1];return t}static endOfWhiteSpace(e,t){let n=e[t];for(;"\t"===n||" "===n;)n=e[t+=1];return t}static startOfLine(e,t){let n=e[t-1];if("\n"===n)return t;for(;n&&"\n"!==n;)n=e[t-=1];return t+1}static endOfBlockIndent(e,t,n){const r=a.endOfIndent(e,n);if(r>n+t)return r;{const t=a.endOfWhiteSpace(e,r),n=e[t];if(!n||"\n"===n)return t}return null}static atBlank(e,t,n){const r=e[t];return"\n"===r||"\t"===r||" "===r||n&&!r}static nextNodeIsIndented(e,t,n){return!(!e||t<0)&&(t>0||n&&"-"===e)}static normalizeOffset(e,t){const n=e[t];return n?"\n"!==n&&"\n"===e[t-1]?t-1:a.endOfWhiteSpace(e,t):t}static foldNewline(e,t,n){let r=0,i=!1,o="",s=e[t+1];for(;" "===s||"\t"===s||"\n"===s;){switch(s){case"\n":r=0,t+=1,o+="\n";break;case"\t":r<=n&&(i=!0),t=a.endOfWhiteSpace(e,t+2)-1;break;case" ":r+=1,t+=1}s=e[t+1]}return o||(o=" "),s&&r<=n&&(i=!0),{fold:o,offset:t,error:i}}constructor(e,t,n){Object.defineProperty(this,"context",{value:n||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=t||[],this.type=e,this.value=null}getPropValue(e,t,n){if(!this.context)return null;const{src:r}=this.context,i=this.props[e];return i&&r[i.start]===t?r.slice(i.start+(n?1:0),i.end):null}get anchor(){for(let t=0;t0?t.join("\n"):null}commentHasRequiredWhitespace(e){const{src:t}=this.context;if(this.header&&e===this.header.end)return!1;if(!this.valueRange)return!1;const{end:n}=this.valueRange;return e!==n||a.atBlank(t,n-1)}get hasComment(){if(this.context){const{src:t}=this.context;for(let n=0;nn.setOrigRange(e,t))),t}toString(){const{context:{src:e},range:t,value:n}=this;if(null!=n)return n;const r=e.slice(t.start,t.end);return a.addStringTerminator(e,t.end,r)}}class c extends Error{constructor(e,t,n){if(!(n&&t instanceof a))throw new Error(`Invalid arguments for new ${e}`);super(),this.name=e,this.message=n,this.source=t}makePretty(){if(!this.source)return;this.nodeType=this.source.type;const e=this.source.context&&this.source.context.root;if("number"==typeof this.offset){this.range=new s(this.offset,this.offset+1);const t=e&&i(this.offset,e);if(t){const e={line:t.line,col:t.col+1};this.linePos={start:t,end:e}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){const{line:t,col:n}=this.linePos.start;this.message+=` at line ${t}, column ${n}`;const r=e&&o(this.linePos,e);r&&(this.message+=`:\n\n${r}\n`)}delete this.source}}class u extends c{constructor(e,t){super("YAMLSemanticError",e,t)}}class l extends a{static endOfLine(e,t,n){let r=e[t],i=t;for(;r&&"\n"!==r&&(!n||"["!==r&&"]"!==r&&"{"!==r&&"}"!==r&&","!==r);){const t=e[i+1];if(":"===r&&(!t||"\n"===t||"\t"===t||" "===t||n&&","===t))break;if((" "===r||"\t"===r)&&"#"===t)break;i+=1,r=t}return i}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:t}=this.valueRange;const{src:n}=this.context;let r=n[t-1];for(;eo?n.slice(o,r+1):e)}else i+=e}const o=n[e];switch(o){case"\t":return{errors:[new u(this,"Plain value cannot start with a tab character")],str:i};case"@":case"`":return{errors:[new u(this,`Plain value cannot start with reserved character ${o}`)],str:i};default:return i}}parseBlockValue(e){const{indent:t,inFlow:n,src:r}=this.context;let i=e,o=e;for(let e=r[i];"\n"===e&&!a.atDocumentBoundary(r,i+1);e=r[i]){const e=a.endOfBlockIndent(r,t,i+1);if(null===e||"#"===r[e])break;"\n"===r[e]?i=e:(o=l.endOfLine(r,e,n),i=o)}return this.valueRange.isEmpty()&&(this.valueRange.start=e),this.valueRange.end=o,o}parse(e,t){this.context=e;const{inFlow:n,src:r}=e;let i=t;const o=r[i];return o&&"#"!==o&&"\n"!==o&&(i=l.endOfLine(r,t,n)),this.valueRange=new s(t,i),i=a.endOfWhiteSpace(r,i),i=this.parseComment(i),this.hasComment&&!this.valueRange.isEmpty()||(i=this.parseBlockValue(i)),i}}return PlainValueEc8e588e.Char=e,PlainValueEc8e588e.Node=a,PlainValueEc8e588e.PlainValue=l,PlainValueEc8e588e.Range=s,PlainValueEc8e588e.Type=t,PlainValueEc8e588e.YAMLError=c,PlainValueEc8e588e.YAMLReferenceError=class extends c{constructor(e,t){super("YAMLReferenceError",e,t)}},PlainValueEc8e588e.YAMLSemanticError=u,PlainValueEc8e588e.YAMLSyntaxError=class extends c{constructor(e,t){super("YAMLSyntaxError",e,t)}},PlainValueEc8e588e.YAMLWarning=class extends c{constructor(e,t){super("YAMLWarning",e,t)}},PlainValueEc8e588e._defineProperty=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},PlainValueEc8e588e.defaultTagPrefix="tag:yaml.org,2002:",PlainValueEc8e588e.defaultTags={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"},PlainValueEc8e588e}function requireParseCst(){if(hasRequiredParseCst)return parseCst;hasRequiredParseCst=1;var e=requirePlainValueEc8e588e();class t extends e.Node{constructor(){super(e.Type.BLANK_LINE)}get includesTrailingLines(){return!0}parse(t,n){return this.context=t,this.range=new e.Range(n,n+1),n+1}}class n extends e.Node{constructor(e,t){super(e,t),this.node=null}get includesTrailingLines(){return!!this.node&&this.node.includesTrailingLines}parse(n,r){this.context=n;const{parseNode:i,src:o}=n;let{atLineStart:s,lineStart:a}=n;s||this.type!==e.Type.SEQ_ITEM||(this.error=new e.YAMLSemanticError(this,"Sequence items must not have preceding content on the same line"));const c=s?r-a:n.indent;let u=e.Node.endOfWhiteSpace(o,r+1),l=o[u];const d="#"===l,p=[];let f=null;for(;"\n"===l||"#"===l;){if("#"===l){const t=e.Node.endOfLine(o,u+1);p.push(new e.Range(u,t)),u=t}else{s=!0,a=u+1;"\n"===o[e.Node.endOfWhiteSpace(o,a)]&&0===p.length&&(f=new t,a=f.parse({src:o},a)),u=e.Node.endOfIndent(o,a)}l=o[u]}if(e.Node.nextNodeIsIndented(l,u-(a+c),this.type!==e.Type.SEQ_ITEM)?this.node=i({atLineStart:s,inCollection:!1,indent:c,lineStart:a,parent:this},u):l&&a>r+1&&(u=a-1),this.node){if(f){const e=n.parent.items||n.parent.contents;e&&e.push(f)}p.length&&Array.prototype.push.apply(this.props,p),u=this.node.range.end}else if(d){const e=p[0];this.props.push(e),u=e.end}else u=e.Node.endOfLine(o,r+1);const _=this.node?this.node.valueRange.end:u;return this.valueRange=new e.Range(r,_),u}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.node?this.node.setOrigRanges(e,t):t}toString(){const{context:{src:t},node:n,range:r,value:i}=this;if(null!=i)return i;const o=n?t.slice(r.start,n.range.start)+String(n):t.slice(r.start,r.end);return e.Node.addStringTerminator(t,r.end,o)}}class r extends e.Node{constructor(){super(e.Type.COMMENT)}parse(t,n){this.context=t;const r=this.parseComment(n);return this.range=new e.Range(n,r),r}}function i(t){let r=t;for(;r instanceof n;)r=r.node;if(!(r instanceof o))return null;const i=r.items.length;let s=-1;for(let t=i-1;t>=0;--t){const n=r.items[t];if(n.type===e.Type.COMMENT){const{indent:e,lineStart:r}=n.context;if(e>0&&n.range.start>=r+e)break;s=t}else{if(n.type!==e.Type.BLANK_LINE)break;s=t}}if(-1===s)return null;const a=r.items.splice(s,i-s),c=a[0].range.start;for(;r.range.end=c,r.valueRange&&r.valueRange.end>c&&(r.valueRange.end=c),r!==t;)r=r.context.parent;return a}class o extends e.Node{static nextContentHasIndent(t,n,r){const i=e.Node.endOfLine(t,n)+1,s=t[n=e.Node.endOfWhiteSpace(t,i)];return!!s&&(n>=i+r||("#"===s||"\n"===s)&&o.nextContentHasIndent(t,n,r))}constructor(t){super(t.type===e.Type.SEQ_ITEM?e.Type.SEQ:e.Type.MAP);for(let e=t.props.length-1;e>=0;--e)if(t.props[e].start0}parse(n,s){this.context=n;const{parseNode:a,src:c}=n;let u=e.Node.startOfLine(c,s);const l=this.items[0];l.context.parent=this,this.valueRange=e.Range.copy(l.valueRange);const d=l.range.start-l.context.lineStart;let p=s;p=e.Node.normalizeOffset(c,p);let f=c[p],_=e.Node.endOfWhiteSpace(c,u)===p,m=!1;for(;f;){for(;"\n"===f||"#"===f;){if(_&&"\n"===f&&!m){const e=new t;if(p=e.parse({src:c},p),this.valueRange.end=p,p>=c.length){f=null;break}this.items.push(e),p-=1}else if("#"===f){if(p=c.length){f=null;break}}if(u=p+1,p=e.Node.endOfIndent(c,u),e.Node.atBlank(c,p)){const t=e.Node.endOfWhiteSpace(c,p),n=c[t];n&&"\n"!==n&&"#"!==n||(p=t)}f=c[p],_=!0}if(!f)break;if(p!==u+d&&(_||":"!==f)){if(ps&&(p=u);break}if(!this.error){const t="All collection items must start at the same column";this.error=new e.YAMLSyntaxError(this,t)}}if(l.type===e.Type.SEQ_ITEM){if("-"!==f){u>s&&(p=u);break}}else if("-"===f&&!this.error){const t=c[p+1];if(!t||"\n"===t||"\t"===t||" "===t){const t="A collection cannot be both a mapping and a sequence";this.error=new e.YAMLSyntaxError(this,t)}}const n=a({atLineStart:_,inCollection:!0,indent:d,lineStart:u,parent:this},p);if(!n)return p;if(this.items.push(n),this.valueRange.end=n.valueRange.end,p=e.Node.normalizeOffset(c,n.range.end),f=c[p],_=!1,m=n.includesTrailingLines,f){let e=p-1,t=c[e];for(;" "===t||"\t"===t;)t=c[--e];"\n"===t&&(u=e+1,_=!0)}const h=i(n);h&&Array.prototype.push.apply(this.items,h)}return p}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.items.forEach((n=>{t=n.setOrigRanges(e,t)})),t}toString(){const{context:{src:t},items:n,range:r,value:i}=this;if(null!=i)return i;let o=t.slice(r.start,n[0].range.start)+String(n[0]);for(let e=1;e0&&(this.contents=this.directives,this.directives=[]),u}return i[u]?(this.directivesEndMarker=new e.Range(u,u+3),u+3):(c?this.error=new e.YAMLSemanticError(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),u)}parseContents(n){const{parseNode:o,src:s}=this.context;this.contents||(this.contents=[]);let c=n;for(;"-"===s[c-1];)c-=1;let u=e.Node.endOfWhiteSpace(s,n),l=c===n;for(this.valueRange=new e.Range(u);!e.Node.atDocumentBoundary(s,u,e.Char.DOCUMENT_END);){switch(s[u]){case"\n":if(l){const e=new t;u=e.parse({src:s},u),u{t=n.setOrigRanges(e,t)})),this.directivesEndMarker&&(t=this.directivesEndMarker.setOrigRange(e,t)),this.contents.forEach((n=>{t=n.setOrigRanges(e,t)})),this.documentEndMarker&&(t=this.documentEndMarker.setOrigRange(e,t)),t}toString(){const{contents:t,directives:n,value:r}=this;if(null!=r)return r;let i=n.join("");return t.length>0&&((n.length>0||t[0].type===e.Type.COMMENT)&&(i+="---\n"),i+=t.join("")),"\n"!==i[i.length-1]&&(i+="\n"),i}}class c extends e.Node{parse(t,n){this.context=t;const{src:r}=t;let i=e.Node.endOfIdentifier(r,n+1);return this.valueRange=new e.Range(n+1,i),i=e.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i}}const u="CLIP",l="KEEP",d="STRIP";class p extends e.Node{constructor(e,t){super(e,t),this.blockIndent=null,this.chomping=u,this.header=null}get includesTrailingLines(){return this.chomping===l}get strValue(){if(!this.valueRange||!this.context)return null;let{start:t,end:n}=this.valueRange;const{indent:r,src:i}=this.context;if(this.valueRange.isEmpty())return"";let o=null,s=i[n-1];for(;"\n"===s||"\t"===s||" "===s;){if(n-=1,n<=t){if(this.chomping===l)break;return""}"\n"===s&&(o=n),s=i[n-1]}let a=n+1;o&&(this.chomping===l?(a=o,n=this.valueRange.end):n=o);const c=r+this.blockIndent,u=this.type===e.Type.BLOCK_FOLDED;let p=!0,f="",_="",m=!1;for(let r=t;ra&&(a=u);o="\n"===r[t]?t:s=e.Node.endOfLine(r,t)}return this.chomping!==l&&(o=r[s]?s+1:s),this.valueRange=new e.Range(t+1,o),o}parse(t,n){this.context=t;const{src:r}=t;let i=this.parseBlockHeader(n);return i=e.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i=this.parseBlockValue(i),i}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.header?this.header.setOrigRange(e,t):t}}class f extends e.Node{constructor(e,t){super(e,t),this.items=null}prevNodeIsJsonLike(t=this.items.length){const n=this.items[t-1];return!!n&&(n.jsonLike||n.type===e.Type.COMMENT&&this.prevNodeIsJsonLike(t-1))}parse(n,i){this.context=n;const{parseNode:o,src:s}=n;let{indent:a,lineStart:c}=n,u=s[i];this.items=[{char:u,offset:i}];let l=e.Node.endOfWhiteSpace(s,i+1);for(u=s[l];u&&"]"!==u&&"}"!==u;){switch(u){case"\n":c=l+1;if("\n"===s[e.Node.endOfWhiteSpace(s,c)]){const e=new t;c=e.parse({src:s},c),this.items.push(e)}if(l=e.Node.endOfIndent(s,c),l<=c+a&&(u=s[l],l{if(r instanceof e.Node)n=r.setOrigRanges(t,n);else if(0===t.length)r.origOffset=r.offset;else{let e=n;for(;er.offset);)++e;r.origOffset=r.offset+e,n=e}})),n}toString(){const{context:{src:t},items:n,range:r,value:i}=this;if(null!=i)return i;const o=n.filter((t=>t instanceof e.Node));let s="",a=r.start;return o.forEach((e=>{const n=t.slice(a,e.range.start);a=e.range.end,s+=n+String(e),"\n"===s[s.length-1]&&"\n"!==t[a-1]&&"\n"===t[a]&&(a+=1)})),s+=t.slice(a,r.end),e.Node.addStringTerminator(t,r.end,s)}}class _ extends e.Node{static endOfQuote(e,t){let n=e[t];for(;n&&'"'!==n;)n=e[t+="\\"===n?2:1];return t+1}get strValue(){if(!this.valueRange||!this.context)return null;const t=[],{start:n,end:r}=this.valueRange,{indent:i,src:o}=this.context;'"'!==o[r-1]&&t.push(new e.YAMLSyntaxError(this,'Missing closing "quote'));let s="";for(let a=n+1;ae?o.slice(e,a+1):n)}else s+=n}return t.length>0?{errors:t,str:s}:s}parseCharCode(t,n,r){const{src:i}=this.context,o=i.substr(t,n),s=o.length===n&&/^[0-9a-fA-F]+$/.test(o)?parseInt(o,16):NaN;return isNaN(s)?(r.push(new e.YAMLSyntaxError(this,`Invalid escape sequence ${i.substr(t-2,n+2)}`)),i.substr(t-2,n+2)):String.fromCodePoint(s)}parse(t,n){this.context=t;const{src:r}=t;let i=_.endOfQuote(r,n+1);return this.valueRange=new e.Range(n,i),i=e.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i}}class m extends e.Node{static endOfQuote(e,t){let n=e[t];for(;n;)if("'"===n){if("'"!==e[t+1])break;n=e[t+=2]}else n=e[t+=1];return t+1}get strValue(){if(!this.valueRange||!this.context)return null;const t=[],{start:n,end:r}=this.valueRange,{indent:i,src:o}=this.context;"'"!==o[r-1]&&t.push(new e.YAMLSyntaxError(this,"Missing closing 'quote"));let s="";for(let a=n+1;ae?o.slice(e,a+1):n)}else s+=n}return t.length>0?{errors:t,str:s}:s}parse(t,n){this.context=t;const{src:r}=t;let i=m.endOfQuote(r,n+1);return this.valueRange=new e.Range(n,i),i=e.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i}}class h{static parseType(t,n,r){switch(t[n]){case"*":return e.Type.ALIAS;case">":return e.Type.BLOCK_FOLDED;case"|":return e.Type.BLOCK_LITERAL;case"{":return e.Type.FLOW_MAP;case"[":return e.Type.FLOW_SEQ;case"?":return!r&&e.Node.atBlank(t,n+1,!0)?e.Type.MAP_KEY:e.Type.PLAIN;case":":return!r&&e.Node.atBlank(t,n+1,!0)?e.Type.MAP_VALUE:e.Type.PLAIN;case"-":return!r&&e.Node.atBlank(t,n+1,!0)?e.Type.SEQ_ITEM:e.Type.PLAIN;case'"':return e.Type.QUOTE_DOUBLE;case"'":return e.Type.QUOTE_SINGLE;default:return e.Type.PLAIN}}constructor(t={},{atLineStart:r,inCollection:i,inFlow:s,indent:a,lineStart:u,parent:l}={}){e._defineProperty(this,"parseNode",((t,r)=>{if(e.Node.atDocumentBoundary(this.src,r))return null;const i=new h(this,t),{props:s,type:a,valueStart:u}=i.parseProps(r),l=function(t,r){switch(t){case e.Type.ALIAS:return new c(t,r);case e.Type.BLOCK_FOLDED:case e.Type.BLOCK_LITERAL:return new p(t,r);case e.Type.FLOW_MAP:case e.Type.FLOW_SEQ:return new f(t,r);case e.Type.MAP_KEY:case e.Type.MAP_VALUE:case e.Type.SEQ_ITEM:return new n(t,r);case e.Type.COMMENT:case e.Type.PLAIN:return new e.PlainValue(t,r);case e.Type.QUOTE_DOUBLE:return new _(t,r);case e.Type.QUOTE_SINGLE:return new m(t,r);default:return null}}(a,s);let d=l.parse(i,u);if(l.range=new e.Range(r,d),d<=r&&(l.error=new Error("Node#parse consumed no characters"),l.error.parseEnd=d,l.error.source=l,l.range.end=r+1),i.nodeStartsCollection(l)){l.error||i.atLineStart||i.parent.type!==e.Type.DOCUMENT||(l.error=new e.YAMLSyntaxError(l,"Block collection must not have preceding content here (e.g. directives-end indicator)"));const t=new o(l);return d=t.parse(new h(i),d),t.range=new e.Range(r,d),t}return l})),this.atLineStart=null!=r?r:t.atLineStart||!1,this.inCollection=null!=i?i:t.inCollection||!1,this.inFlow=null!=s?s:t.inFlow||!1,this.indent=null!=a?a:t.indent,this.lineStart=null!=u?u:t.lineStart,this.parent=null!=l?l:t.parent||{},this.root=t.root,this.src=t.src}nodeStartsCollection(t){const{inCollection:r,inFlow:i,src:o}=this;if(r||i)return!1;if(t instanceof n)return!0;let s=t.range.end;return"\n"!==o[s]&&"\n"!==o[s-1]&&(s=e.Node.endOfWhiteSpace(o,s),":"===o[s])}parseProps(t){const{inFlow:n,parent:r,src:i}=this,o=[];let s=!1,a=i[t=this.atLineStart?e.Node.endOfIndent(i,t):e.Node.endOfWhiteSpace(i,t)];for(;a===e.Char.ANCHOR||a===e.Char.COMMENT||a===e.Char.TAG||"\n"===a;){if("\n"===a){let n,o=t;do{n=o+1,o=e.Node.endOfIndent(i,n)}while("\n"===i[o]);const a=o-(n+this.indent),c=r.type===e.Type.SEQ_ITEM&&r.context.atLineStart;if("#"!==i[o]&&!e.Node.nextNodeIsIndented(i[o],a,!c))break;this.atLineStart=!0,this.lineStart=n,s=!1,t=o}else if(a===e.Char.COMMENT){const n=e.Node.endOfLine(i,t+1);o.push(new e.Range(t,n)),t=n}else{let n=e.Node.endOfIdentifier(i,t+1);a===e.Char.TAG&&","===i[n]&&/^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+,\d\d\d\d(-\d\d){0,2}\/\S/.test(i.slice(t+1,n+13))&&(n=e.Node.endOfIdentifier(i,n+5)),o.push(new e.Range(t,n)),s=!0,t=e.Node.endOfWhiteSpace(i,n)}a=i[t]}s&&":"===a&&e.Node.atBlank(i,t+1,!0)&&(t-=1);return{props:o,type:h.parseType(i,t,n),valueStart:t}}}return parseCst.parse=function(e){const t=[];-1!==e.indexOf("\r")&&(e=e.replace(/\r\n?/g,((e,n)=>(e.length>1&&t.push(n),"\n"))));const n=[];let r=0;do{const t=new a,i=new h({src:e});r=t.parse(i,r),n.push(t)}while(r{if(0===t.length)return!1;for(let e=1;en.join("...\n"),n},parseCst}var Document9b4560a1={},resolveSeqD03cb037={},hasRequiredResolveSeqD03cb037;function requireResolveSeqD03cb037(){if(hasRequiredResolveSeqD03cb037)return resolveSeqD03cb037;hasRequiredResolveSeqD03cb037=1;var e=requirePlainValueEc8e588e();function t(e,t,n){return n?-1===n.indexOf("\n")?`${e} #${n}`:`${e}\n`+n.replace(/^/gm,`${t||""}#`):e}class n{}function r(e,t,n){if(Array.isArray(e))return e.map(((e,t)=>r(e,String(t),n)));if(e&&"function"==typeof e.toJSON){const r=n&&n.anchors&&n.anchors.get(e);r&&(n.onCreate=e=>{r.res=e,delete n.onCreate});const i=e.toJSON(t,n);return r&&n.onCreate&&n.onCreate(i),i}return n&&n.keep||"bigint"!=typeof e?e:Number(e)}class i extends n{constructor(e){super(),this.value=e}toJSON(e,t){return t&&t.keep?this.value:r(this.value,e,t)}toString(){return String(this.value)}}function o(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){const n=t[e];if(Number.isInteger(n)&&n>=0){const e=[];e[n]=r,r=e}else{const e={};Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!0,configurable:!0}),r=e}}return e.createNode(r,!1)}const s=e=>null==e||"object"==typeof e&&e[Symbol.iterator]().next().done;class a extends n{constructor(t){super(),e._defineProperty(this,"items",[]),this.schema=t}addIn(e,t){if(s(e))this.add(t);else{const[n,...r]=e,i=this.get(n,!0);if(i instanceof a)i.addIn(r,t);else{if(void 0!==i||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,o(this.schema,r,t))}}}deleteIn([e,...t]){if(0===t.length)return this.delete(e);const n=this.get(e,!0);if(n instanceof a)return n.deleteIn(t);throw new Error(`Expected YAML collection at ${e}. Remaining path: ${t}`)}getIn([e,...t],n){const r=this.get(e,!0);return 0===t.length?!n&&r instanceof i?r.value:r:r instanceof a?r.getIn(t,n):void 0}hasAllNullValues(){return this.items.every((e=>{if(!e||"PAIR"!==e.type)return!1;const t=e.value;return null==t||t instanceof i&&null==t.value&&!t.commentBefore&&!t.comment&&!t.tag}))}hasIn([e,...t]){if(0===t.length)return this.has(e);const n=this.get(e,!0);return n instanceof a&&n.hasIn(t)}setIn([e,...t],n){if(0===t.length)this.set(e,n);else{const r=this.get(e,!0);if(r instanceof a)r.setIn(t,n);else{if(void 0!==r||!this.schema)throw new Error(`Expected YAML collection at ${e}. Remaining path: ${t}`);this.set(e,o(this.schema,t,n))}}}toJSON(){return null}toString(n,{blockItem:r,flowChars:i,isMap:o,itemIndent:s},c,u){const{indent:l,indentStep:d,stringify:p}=n,f=this.type===e.Type.FLOW_MAP||this.type===e.Type.FLOW_SEQ||n.inFlow;f&&(s+=d);const _=o&&this.hasAllNullValues();n=Object.assign({},n,{allNullValues:_,indent:s,inFlow:f,type:null});let m=!1,h=!1;const g=this.items.reduce(((e,r,i)=>{let o;r&&(!m&&r.spaceBefore&&e.push({type:"comment",str:""}),r.commentBefore&&r.commentBefore.match(/^.*$/gm).forEach((t=>{e.push({type:"comment",str:`#${t}`})})),r.comment&&(o=r.comment),f&&(!m&&r.spaceBefore||r.commentBefore||r.comment||r.key&&(r.key.commentBefore||r.key.comment)||r.value&&(r.value.commentBefore||r.value.comment))&&(h=!0)),m=!1;let a=p(r,n,(()=>o=null),(()=>m=!0));return f&&!h&&a.includes("\n")&&(h=!0),f&&ie.str));if(h||n.reduce(((e,t)=>e+t.length+2),2)>a.maxFlowStringSingleLineLength){A=e;for(const e of n)A+=e?`\n${d}${l}${e}`:"\n";A+=`\n${l}${t}`}else A=`${e} ${n.join(" ")} ${t}`}else{const e=g.map(r);A=e.shift();for(const t of e)A+=t?`\n${l}${t}`:"\n"}return this.comment?(A+="\n"+this.comment.replace(/^/gm,`${l}#`),c&&c()):m&&u&&u(),A}}function c(e){let t=e instanceof i?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),Number.isInteger(t)&&t>=0?t:null}e._defineProperty(a,"maxFlowStringSingleLineLength",60);class u extends a{add(e){this.items.push(e)}delete(e){const t=c(e);if("number"!=typeof t)return!1;return this.items.splice(t,1).length>0}get(e,t){const n=c(e);if("number"!=typeof n)return;const r=this.items[n];return!t&&r instanceof i?r.value:r}has(e){const t=c(e);return"number"==typeof t&&t"comment"===e.type?e.str:`- ${e.str}`,flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(e.indent||"")+" "},t,n):JSON.stringify(this)}}class l extends n{constructor(e,t=null){super(),this.key=e,this.value=t,this.type=l.Type.PAIR}get commentBefore(){return this.key instanceof n?this.key.commentBefore:void 0}set commentBefore(e){if(null==this.key&&(this.key=new i(null)),!(this.key instanceof n)){throw new Error("Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.")}this.key.commentBefore=e}addToJSMap(e,t){const i=r(this.key,"",e);if(t instanceof Map){const n=r(this.value,i,e);t.set(i,n)}else if(t instanceof Set)t.add(i);else{const o=((e,t,r)=>null===t?"":"object"!=typeof t?String(t):e instanceof n&&r&&r.doc?e.toString({anchors:Object.create(null),doc:r.doc,indent:"",indentStep:r.indentStep,inFlow:!0,inStringifyKey:!0,stringify:r.stringify}):JSON.stringify(t))(this.key,i,e),s=r(this.value,o,e);o in t?Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[o]=s}return t}toJSON(e,t){const n=t&&t.mapAsMap?new Map:{};return this.addToJSMap(t,n)}toString(r,o,s){if(!r||!r.doc)return JSON.stringify(this);const{indent:c,indentSeq:l,simpleKeys:d}=r.doc.options;let{key:p,value:f}=this,_=p instanceof n&&p.comment;if(d){if(_)throw new Error("With simple keys, key nodes cannot have comments");if(p instanceof a){throw new Error("With simple keys, collection cannot be used as a key value")}}let m=!d&&(!p||_||(p instanceof n?p instanceof a||p.type===e.Type.BLOCK_FOLDED||p.type===e.Type.BLOCK_LITERAL:"object"==typeof p));const{doc:h,indent:g,indentStep:A,stringify:y}=r;r=Object.assign({},r,{implicitKey:!m,indent:g+A});let v=!1,b=y(p,r,(()=>_=null),(()=>v=!0));if(b=t(b,r.indent,_),!m&&b.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(r.allNullValues&&!d)return this.comment?(b=t(b,r.indent,this.comment),o&&o()):v&&!_&&s&&s(),r.inFlow&&!m?b:`? ${b}`;b=m?`? ${b}\n${g}:`:`${b}:`,this.comment&&(b=t(b,r.indent,this.comment),o&&o());let C="",E=null;if(f instanceof n){if(f.spaceBefore&&(C="\n"),f.commentBefore){C+=`\n${f.commentBefore.replace(/^/gm,`${r.indent}#`)}`}E=f.comment}else f&&"object"==typeof f&&(f=h.schema.createNode(f,!0));r.implicitKey=!1,!m&&!this.comment&&f instanceof i&&(r.indentAtStart=b.length+1),v=!1,!l&&c>=2&&!r.inFlow&&!m&&f instanceof u&&f.type!==e.Type.FLOW_SEQ&&!f.tag&&!h.anchors.getName(f)&&(r.indent=r.indent.substr(2));const x=y(f,r,(()=>E=null),(()=>v=!0));let S=" ";if(C||this.comment)S=`${C}\n${r.indent}`;else if(!m&&f instanceof a){("["===x[0]||"{"===x[0])&&!x.includes("\n")||(S=`\n${r.indent}`)}else"\n"===x[0]&&(S="");return v&&!E&&s&&s(),t(b+S+x,r.indent,E)}}e._defineProperty(l,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});const d=(e,t)=>{if(e instanceof p){const n=t.get(e.source);return n.count*n.aliasCount}if(e instanceof a){let n=0;for(const r of e.items){const e=d(r,t);e>n&&(n=e)}return n}if(e instanceof l){const n=d(e.key,t),r=d(e.value,t);return Math.max(n,r)}return 1};class p extends n{static stringify({range:e,source:t},{anchors:n,doc:r,implicitKey:i,inStringifyKey:o}){let s=Object.keys(n).find((e=>n[e]===t));if(!s&&o&&(s=r.anchors.getName(t)||r.anchors.newName()),s)return`*${s}${i?" ":""}`;const a=r.anchors.getName(t)?"Alias node must be after source node":"Source node not found for alias node";throw new Error(`${a} [${e}]`)}constructor(t){super(),this.source=t,this.type=e.Type.ALIAS}set tag(e){throw new Error("Alias nodes cannot have tags")}toJSON(t,n){if(!n)return r(this.source,t,n);const{anchors:i,maxAliasCount:o}=n,s=i.get(this.source);if(!s||void 0===s.res){const t="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new e.YAMLReferenceError(this.cstNode,t):new ReferenceError(t)}if(o>=0&&(s.count+=1,0===s.aliasCount&&(s.aliasCount=d(this.source,i)),s.count*s.aliasCount>o)){const t="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new e.YAMLReferenceError(this.cstNode,t):new ReferenceError(t)}return s.res}toString(e){return p.stringify(this,e)}}function f(e,t){const n=t instanceof i?t.value:t;for(const r of e)if(r instanceof l){if(r.key===t||r.key===n)return r;if(r.key&&r.key.value===n)return r}}e._defineProperty(p,"default",!0);class _ extends a{add(e,t){e?e instanceof l||(e=new l(e.key||e,e.value)):e=new l(e);const n=f(this.items,e.key),r=this.schema&&this.schema.sortMapEntries;if(n){if(!t)throw new Error(`Key ${e.key} already set`);n.value=e.value}else if(r){const t=this.items.findIndex((t=>r(e,t)<0));-1===t?this.items.push(e):this.items.splice(t,0,e)}else this.items.push(e)}delete(e){const t=f(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=f(this.items,e),r=n&&n.value;return!t&&r instanceof i?r.value:r}has(e){return!!f(this.items,e)}set(e,t){this.add(new l(e,t),!0)}toJSON(e,t,n){const r=n?new n:t&&t.mapAsMap?new Map:{};t&&t.onCreate&&t.onCreate(r);for(const e of this.items)e.addToJSMap(t,r);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(const e of this.items)if(!(e instanceof l))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return super.toString(e,{blockItem:e=>e.str,flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:e.indent||""},t,n)}}class m extends l{constructor(e){if(e instanceof l){let t=e.value;t instanceof u||(t=new u,t.items.push(e.value),t.range=e.value.range),super(e.key,t),this.range=e.range}else super(new i("<<"),new u);this.type=l.Type.MERGE_PAIR}addToJSMap(e,t){for(const{source:n}of this.value.items){if(!(n instanceof _))throw new Error("Merge sources must be maps");const r=n.toJSON(null,e,Map);for(const[e,n]of r)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}return t}toString(e,t){const n=this.value;if(n.items.length>1)return super.toString(e,t);this.value=n.items[0];const r=super.toString(e,t);return this.value=n,r}}const h={defaultType:e.Type.BLOCK_LITERAL,lineWidth:76},g={defaultType:e.Type.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function A(e,t,n){for(const{format:n,test:r,resolve:o}of t)if(r){const t=e.match(r);if(t){let e=o.apply(null,t);return e instanceof i||(e=new i(e)),n&&(e.format=n),e}}return n&&(e=n(e)),new i(e)}const y="flow",v="block",b="quoted",C=(e,t)=>{let n=e[t+1];for(;" "===n||"\t"===n;){do{n=e[t+=1]}while(n&&"\n"!==n);n=e[t+1]}return t};function E(e,t,n,{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}){if(!i||i<0)return e;const c=Math.max(1+o,1+i-t.length);if(e.length<=c)return e;const u=[],l={};let d,p,f=i-t.length;"number"==typeof r&&(r>i-Math.max(2,o)?u.push(0):f=i-r);let _=!1,m=-1,h=-1,g=-1;n===v&&(m=C(e,m),-1!==m&&(f=m+c));for(let t;t=e[m+=1];){if(n===b&&"\\"===t){switch(h=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}g=m}if("\n"===t)n===v&&(m=C(e,m)),f=m+c,d=void 0;else{if(" "===t&&p&&" "!==p&&"\n"!==p&&"\t"!==p){const t=e[m+1];t&&" "!==t&&"\n"!==t&&"\t"!==t&&(d=m)}if(m>=f)if(d)u.push(d),f=d+c,d=void 0;else if(n===b){for(;" "===p||"\t"===p;)p=t,t=e[m+=1],_=!0;const n=m>g+1?m-2:h-1;if(l[n])return e;u.push(n),l[n]=!0,f=n+c,d=void 0}else _=!0}p=t}if(_&&a&&a(),0===u.length)return e;s&&s();let A=e.slice(0,u[0]);for(let r=0;re?Object.assign({indentAtStart:e},g.fold):g.fold,S=e=>/^(%|---|\.\.\.)/m.test(e);function k(e,t){const{implicitKey:n}=t,{jsonEncoding:r,minMultiLineLength:i}=g.doubleQuoted,o=JSON.stringify(e);if(r)return o;const s=t.indent||(S(e)?" ":"");let a="",c=0;for(let e=0,t=o[e];t;t=o[++e])if(" "===t&&"\\"===o[e+1]&&"n"===o[e+2]&&(a+=o.slice(c,e)+"\\ ",e+=1,c=e,t="\\"),"\\"===t)switch(o[e+1]){case"u":{a+=o.slice(c,e);const t=o.substr(e+2,4);switch(t){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:"00"===t.substr(0,2)?a+="\\x"+t.substr(2):a+=o.substr(e,6)}e+=5,c=e+1}break;case"n":if(n||'"'===o[e+2]||o.lengthr)return!0;if(n=t+1,i-n<=r)return!1}return!0}(r,g.fold.lineWidth,a.length));let l=u?"|":">";if(!r)return l+"\n";let d="",p="";if(r=r.replace(/[\n\t ]*$/,(e=>{const t=e.indexOf("\n");return-1===t?l+="-":r!==e&&t===e.length-1||(l+="+",s&&s()),p=e.replace(/\n$/,""),""})).replace(/^[\n ]*/,(e=>{-1!==e.indexOf(" ")&&(l+=c);const t=e.match(/ +$/);return t?(d=e.slice(0,-t[0].length),t[0]):(d=e,"")})),p&&(p=p.replace(/\n+(?!\n|$)/g,`$&${a}`)),d&&(d=d.replace(/\n+/g,`$&${a}`)),t&&(l+=" #"+t.replace(/ ?[\r\n]+/g," "),o&&o()),!r)return`${l}${c}\n${a}${p}`;if(u)return r=r.replace(/\n+/g,`$&${a}`),`${l}\n${a}${d}${r}${p}`;r=r.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${a}`);const f=E(`${d}${r}${p}`,a,v,g.fold);return`${l}\n${a}${f}`}function I(t,n){let r,i,o;switch(n.type){case e.Type.FLOW_MAP:r="}",i="flow map";break;case e.Type.FLOW_SEQ:r="]",i="flow sequence";break;default:return void t.push(new e.YAMLSemanticError(n,"Not a flow collection!?"))}for(let t=n.items.length-1;t>=0;--t){const r=n.items[t];if(!r||r.type!==e.Type.COMMENT){o=r;break}}if(o&&o.char!==r){const s=`Expected ${i} to end with ${r}`;let a;"number"==typeof o.offset?(a=new e.YAMLSemanticError(n,s),a.offset=o.offset+1):(a=new e.YAMLSemanticError(o,s),o.range&&o.range.end&&(a.offset=o.range.end-o.range.start)),t.push(a)}}function T(t,n){const r=n.context.src[n.range.start-1];if("\n"!==r&&"\t"!==r&&" "!==r){const r="Comments must be separated from other tokens by white space characters";t.push(new e.YAMLSemanticError(n,r))}}function R(t,n){const r=String(n),i=r.substr(0,8)+"..."+r.substr(-8);return new e.YAMLSemanticError(t,`The "${i}" key is too long`)}function F(e,t){for(const{afterKey:n,before:r,comment:i}of t){let t=e.items[r];t?(n&&t.value&&(t=t.value),void 0===i?!n&&t.commentBefore||(t.spaceBefore=!0):t.commentBefore?t.commentBefore+="\n"+i:t.commentBefore=i):void 0!==i&&(e.comment?e.comment+="\n"+i:e.comment=i)}}function P(e,t){const n=t.strValue;return n?"string"==typeof n?n:(n.errors.forEach((n=>{n.source||(n.source=t),e.errors.push(n)})),n.str):""}function N(t,n){const{tag:r,type:i}=n;let o=!1;if(r){const{handle:i,suffix:s,verbatim:a}=r;if(a){if("!"!==a&&"!!"!==a)return a;const r=`Verbatim tags aren't resolved, so ${a} is invalid.`;t.errors.push(new e.YAMLSemanticError(n,r))}else if("!"!==i||s)try{return function(t,n){const{handle:r,suffix:i}=n.tag;let o=t.tagPrefixes.find((e=>e.handle===r));if(!o){const i=t.getDefaults().tagPrefixes;if(i&&(o=i.find((e=>e.handle===r))),!o)throw new e.YAMLSemanticError(n,`The ${r} tag handle is non-default and was not declared.`)}if(!i)throw new e.YAMLSemanticError(n,`The ${r} tag has no suffix.`);if("!"===r&&"1.0"===(t.version||t.options.version)){if("^"===i[0])return t.warnings.push(new e.YAMLWarning(n,"YAML 1.0 ^ tag expansion is not supported")),i;if(/[:/]/.test(i)){const e=i.match(/^([a-z0-9-]+)\/(.*)/i);return e?`tag:${e[1]}.yaml.org,2002:${e[2]}`:`tag:${i}`}}return o.prefix+decodeURIComponent(i)}(t,n)}catch(e){t.errors.push(e)}else o=!0}switch(i){case e.Type.BLOCK_FOLDED:case e.Type.BLOCK_LITERAL:case e.Type.QUOTE_DOUBLE:case e.Type.QUOTE_SINGLE:return e.defaultTags.STR;case e.Type.FLOW_MAP:case e.Type.MAP:return e.defaultTags.MAP;case e.Type.FLOW_SEQ:case e.Type.SEQ:return e.defaultTags.SEQ;case e.Type.PLAIN:return o?e.defaultTags.STR:null;default:return null}}function B(e,t,n){const{tags:r}=e.schema,o=[];for(const s of r)if(s.tag===n){if(!s.test){const n=s.resolve(e,t);return n instanceof a?n:new i(n)}o.push(s)}const s=P(e,t);return"string"==typeof s&&o.length>0?A(s,o,r.scalarFallback):null}function O(t,n,r){try{const e=B(t,n,r);if(e)return r&&n.tag&&(e.tag=r),e}catch(e){return e.source||(e.source=n),t.errors.push(e),null}try{const i=function({type:t}){switch(t){case e.Type.FLOW_MAP:case e.Type.MAP:return e.defaultTags.MAP;case e.Type.FLOW_SEQ:case e.Type.SEQ:return e.defaultTags.SEQ;default:return e.defaultTags.STR}}(n);if(!i)throw new Error(`The tag ${r} is unavailable`);const o=`The tag ${r} is unavailable, falling back to ${i}`;t.warnings.push(new e.YAMLWarning(n,o));const s=B(t,n,i);return s.tag=r,s}catch(r){const i=new e.YAMLReferenceError(n,r.message);return i.stack=r.stack,t.errors.push(i),null}}function q(t,n){const r={before:[],after:[]};let i=!1,o=!1;const s=(t=>{if(!t)return!1;const{type:n}=t;return n===e.Type.MAP_KEY||n===e.Type.MAP_VALUE||n===e.Type.SEQ_ITEM})(n.context.parent)?n.context.parent.props.concat(n.props):n.props;for(const{start:a,end:c}of s)switch(n.context.src[a]){case e.Char.COMMENT:{if(!n.commentHasRequiredWhitespace(a)){const r="Comments must be separated from other tokens by white space characters";t.push(new e.YAMLSemanticError(n,r))}const{header:i,valueRange:o}=n;(o&&(a>o.start||i&&a>i.start)?r.after:r.before).push(n.context.src.slice(a+1,c));break}case e.Char.ANCHOR:if(i){const r="A node can have at most one anchor";t.push(new e.YAMLSemanticError(n,r))}i=!0;break;case e.Char.TAG:if(o){const r="A node can have at most one tag";t.push(new e.YAMLSemanticError(n,r))}o=!0}return{comments:r,hasAnchor:i,hasTag:o}}function $(t,n){if(!n)return null;n.error&&t.errors.push(n.error);const{comments:r,hasAnchor:i,hasTag:o}=q(t.errors,n);if(i){const{anchors:e}=t,r=n.anchor,i=e.getNode(r);i&&(e.map[e.newName(r)]=i),e.map[r]=n}if(n.type===e.Type.ALIAS&&(i||o)){const r="An alias node must not specify any properties";t.errors.push(new e.YAMLSemanticError(n,r))}const s=function(t,n){const{anchors:r,errors:i,schema:o}=t;if(n.type===e.Type.ALIAS){const t=n.rawValue,o=r.getNode(t);if(!o){const r=`Aliased anchor not found: ${t}`;return i.push(new e.YAMLReferenceError(n,r)),null}const s=new p(o);return r._cstAliases.push(s),s}const s=N(t,n);if(s)return O(t,n,s);if(n.type!==e.Type.PLAIN){const t=`Failed to resolve ${n.type} node here`;return i.push(new e.YAMLSyntaxError(n,t)),null}try{return A(P(t,n),o.tags,o.tags.scalarFallback)}catch(e){return e.source||(e.source=n),i.push(e),null}}(t,n);if(s){s.range=[n.range.start,n.range.end],t.options.keepCstNodes&&(s.cstNode=n),t.options.keepNodeTypes&&(s.type=n.type);const e=r.before.join("\n");e&&(s.commentBefore=s.commentBefore?`${s.commentBefore}\n${e}`:e);const i=r.after.join("\n");i&&(s.comment=s.comment?`${s.comment}\n${i}`:i)}return n.resolved=s}const Q=({context:{lineStart:t,node:n,src:r},props:i})=>{if(0===i.length)return!1;const{start:o}=i[0];if(n&&o>n.valueRange.start)return!1;if(r[o]!==e.Char.COMMENT)return!1;for(let e=t;e0){r=new e.PlainValue(e.Type.PLAIN,[]),r.context={parent:c,src:c.context.src};const t=c.range.start+1;if(r.range={start:t,end:t},r.valueRange={start:t,end:t},"number"==typeof c.range.origStart){const e=c.range.origStart+1;r.range.origStart=r.range.origEnd=e,r.valueRange.origStart=r.valueRange.origEnd=e}}const a=new l(o,$(t,r));L(c,a),i.push(a),o&&"number"==typeof s&&c.range.start>s+1024&&t.errors.push(R(n,o)),o=void 0,s=null}break;default:void 0!==o&&i.push(new l(o)),o=$(t,c),s=c.range.start,c.error&&t.errors.push(c.error);e:for(let r=a+1;;++r){const i=n.items[r];switch(i&&i.type){case e.Type.BLANK_LINE:case e.Type.COMMENT:continue e;case e.Type.MAP_VALUE:break e;default:{const n="Implicit map keys need to be followed by map values";t.errors.push(new e.YAMLSemanticError(c,n));break e}}}if(c.valueRangeContainsNewline){const n="Implicit map keys need to be on a single line";t.errors.push(new e.YAMLSemanticError(c,n))}}}void 0!==o&&i.push(new l(o));return{comments:r,items:i}}(t,n),o=new _;o.items=i,F(o,r);let s=!1;for(let r=0;r{if(t instanceof p){const{type:n}=t.source;return n!==e.Type.MAP&&n!==e.Type.FLOW_MAP&&(s="Merge nodes aliases can only point to maps")}return s="Merge nodes can only have Alias nodes as values"})),s&&t.errors.push(new e.YAMLSemanticError(n,s))}else for(let s=r+1;sa+1024&&t.errors.push(R(n,o));const{src:i}=u.context;for(let n=a;ne instanceof l&&e.key instanceof a))){const r="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";t.warnings.push(new e.YAMLWarning(n,r))}return n.resolved=o,o},resolveSeqD03cb037.resolveString=P,resolveSeqD03cb037.strOptions=g,resolveSeqD03cb037.stringifyNumber=function({format:e,minFractionDigits:t,tag:n,value:r}){if("bigint"==typeof r)return String(r);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=JSON.stringify(r);if(!e&&t&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(i)){let e=i.indexOf(".");e<0&&(e=i.length,i+=".");let n=t-(i.length-e-1);for(;n-- >0;)i+="0"}return i},resolveSeqD03cb037.stringifyString=function(t,n,r,i){const{defaultType:o}=g,{implicitKey:s,inFlow:a}=n;let{type:c,value:u}=t;"string"!=typeof u&&(u=String(u),t=Object.assign({},t,{value:u}));const l=o=>{switch(o){case e.Type.BLOCK_FOLDED:case e.Type.BLOCK_LITERAL:return w(t,n,r,i);case e.Type.QUOTE_DOUBLE:return k(u,n);case e.Type.QUOTE_SINGLE:return D(u,n);case e.Type.PLAIN:return function(t,n,r,i){const{comment:o,type:s,value:a}=t,{actualString:c,implicitKey:u,indent:l,inFlow:d}=n;if(u&&/[\n[\]{},]/.test(a)||d&&/[[\]{},]/.test(a))return k(a,n);if(!a||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return u||d||-1===a.indexOf("\n")?-1!==a.indexOf('"')&&-1===a.indexOf("'")?D(a,n):k(a,n):w(t,n,r,i);if(!u&&!d&&s!==e.Type.PLAIN&&-1!==a.indexOf("\n"))return w(t,n,r,i);if(""===l&&S(a))return n.forceBlockIndent=!0,w(t,n,r,i);const p=a.replace(/\n+/g,`$&\n${l}`);if(c){const{tags:e}=n.doc.schema;if("string"!=typeof A(p,e,e.scalarFallback).value)return k(a,n)}const f=u?p:E(p,l,y,x(n));return!o||d||-1===f.indexOf("\n")&&-1===o.indexOf("\n")?f:(r&&r(),function(e,t,n){return n?`#${n.replace(/[\s\S]^/gm,`$&${t}#`)}\n${t}${e}`:e}(f,l,o))}(t,n,r,i);default:return null}};c!==e.Type.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(u)?c=e.Type.QUOTE_DOUBLE:!s&&!a||c!==e.Type.BLOCK_FOLDED&&c!==e.Type.BLOCK_LITERAL||(c=e.Type.QUOTE_DOUBLE);let d=l(c);if(null===d&&(d=l(o),null===d))throw new Error(`Unsupported default string type ${o}`);return d},resolveSeqD03cb037.toJSON=r,resolveSeqD03cb037}var Schema88e323a7={},warnings1000a372={},hasRequiredWarnings1000a372,hasRequiredSchema88e323a7,hasRequiredDocument9b4560a1,hasRequiredDist$1,yaml,hasRequiredYaml,jptr_1,hasRequiredJptr,isref,hasRequiredIsref,clone_1,hasRequiredClone,recurse_1,hasRequiredRecurse,dereference_1,hasRequiredDereference,fastSafeStringify,hasRequiredFastSafeStringify,oasKitCommon,hasRequiredOasKitCommon,oasResolver,hasRequiredOasResolver,oasSchemaWalker,hasRequiredOasSchemaWalker,statusCodes,hasRequiredStatusCodes;function requireWarnings1000a372(){if(hasRequiredWarnings1000a372)return warnings1000a372;hasRequiredWarnings1000a372=1;var e=requirePlainValueEc8e588e(),t=requireResolveSeqD03cb037();const n={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve:(n,r)=>{const i=t.resolveString(n,r);if("function"==typeof Buffer)return Buffer.from(i,"base64");if("function"==typeof atob){const e=atob(i.replace(/[\n\r]/g,"")),t=new Uint8Array(e.length);for(let n=0;n{let c;if("function"==typeof Buffer)c=i instanceof Buffer?i.toString("base64"):Buffer.from(i.buffer).toString("base64");else{if("function"!=typeof btoa)throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");{let e="";for(let t=0;t1){const t="Each pair must have its own sequence indicator";throw new e.YAMLSemanticError(r,t)}const n=o.items[0]||new t.Pair;o.commentBefore&&(n.commentBefore=n.commentBefore?`${o.commentBefore}\n${n.commentBefore}`:o.commentBefore),o.comment&&(n.comment=n.comment?`${o.comment}\n${n.comment}`:o.comment),o=n}i.items[n]=o instanceof t.Pair?o:new t.Pair(o)}}return i}function i(e,n,r){const i=new t.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";for(const t of n){let n,o;if(Array.isArray(t)){if(2!==t.length)throw new TypeError(`Expected [key, value] tuple: ${t}`);n=t[0],o=t[1]}else if(t&&t instanceof Object){const e=Object.keys(t);if(1!==e.length)throw new TypeError(`Expected { key: value } tuple: ${t}`);n=e[0],o=t[n]}else n=t;const s=e.createPair(n,o,r);i.items.push(s)}return i}const o={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:r,createNode:i};class s extends t.YAMLSeq{constructor(){super(),e._defineProperty(this,"add",t.YAMLMap.prototype.add.bind(this)),e._defineProperty(this,"delete",t.YAMLMap.prototype.delete.bind(this)),e._defineProperty(this,"get",t.YAMLMap.prototype.get.bind(this)),e._defineProperty(this,"has",t.YAMLMap.prototype.has.bind(this)),e._defineProperty(this,"set",t.YAMLMap.prototype.set.bind(this)),this.tag=s.tag}toJSON(e,n){const r=new Map;n&&n.onCreate&&n.onCreate(r);for(const e of this.items){let i,o;if(e instanceof t.Pair?(i=t.toJSON(e.key,"",n),o=t.toJSON(e.value,i,n)):i=t.toJSON(e,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}}e._defineProperty(s,"tag","tag:yaml.org,2002:omap");const a={identify:e=>e instanceof Map,nodeClass:s,default:!1,tag:"tag:yaml.org,2002:omap",resolve:function(n,i){const o=r(n,i),a=[];for(const{key:n}of o.items)if(n instanceof t.Scalar){if(a.includes(n.value)){const t="Ordered maps must not include duplicate keys";throw new e.YAMLSemanticError(i,t)}a.push(n.value)}return Object.assign(new s,o)},createNode:function(e,t,n){const r=i(e,t,n),o=new s;return o.items=r.items,o}};class c extends t.YAMLMap{constructor(){super(),this.tag=c.tag}add(e){const n=e instanceof t.Pair?e:new t.Pair(e);t.findPair(this.items,n.key)||this.items.push(n)}get(e,n){const r=t.findPair(this.items,e);return!n&&r instanceof t.Pair?r.key instanceof t.Scalar?r.key.value:r.key:r}set(e,n){if("boolean"!=typeof n)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof n);const r=t.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new t.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues())return super.toString(e,t,n);throw new Error("Set items must all have null values")}}e._defineProperty(c,"tag","tag:yaml.org,2002:set");const u={identify:e=>e instanceof Set,nodeClass:c,default:!1,tag:"tag:yaml.org,2002:set",resolve:function(n,r){const i=t.resolveMap(n,r);if(!i.hasAllNullValues())throw new e.YAMLSemanticError(r,"Set items must all have null values");return Object.assign(new c,i)},createNode:function(e,t,n){const r=new c;for(const i of t)r.items.push(e.createPair(i,null,n));return r}},l=(e,t)=>{const n=t.split(":").reduce(((e,t)=>60*e+Number(t)),0);return"-"===e?-n:n},d=({value:e})=>{if(isNaN(e)||!isFinite(e))return t.stringifyNumber(e);let n="";e<0&&(n="-",e=Math.abs(e));const r=[e%60];return e<60?r.unshift(0):(e=Math.round((e-r[0])/60),r.unshift(e%60),e>=60&&(e=Math.round((e-r[0])/60),r.unshift(e))),n+r.map((e=>e<10?"0"+String(e):String(e))).join(":").replace(/000000\d*$/,"")},p={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:(e,t,n)=>l(t,n.replace(/_/g,"")),stringify:d},f={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:(e,t,n)=>l(t,n.replace(/_/g,"")),stringify:d},_={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$"),resolve:(e,t,n,r,i,o,s,a,c)=>{a&&(a=(a+"00").substr(1,3));let u=Date.UTC(t,n-1,r,i||0,o||0,s||0,a||0);if(c&&"Z"!==c){let e=l(c[0],c.slice(1));Math.abs(e)<30&&(e*=60),u-=6e4*e}return new Date(u)},stringify:({value:e})=>e.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function m(e){const t="undefined"!=typeof process&&process.env||{};return e?"undefined"!=typeof YAML_SILENCE_DEPRECATION_WARNINGS?!YAML_SILENCE_DEPRECATION_WARNINGS:!t.YAML_SILENCE_DEPRECATION_WARNINGS:"undefined"!=typeof YAML_SILENCE_WARNINGS?!YAML_SILENCE_WARNINGS:!t.YAML_SILENCE_WARNINGS}function h(e,t){if(m(!1)){const n="undefined"!=typeof process&&process.emitWarning;n?n(e,t):console.warn(t?`${t}: ${e}`:e)}}const g={};return warnings1000a372.binary=n,warnings1000a372.floatTime=f,warnings1000a372.intTime=p,warnings1000a372.omap=a,warnings1000a372.pairs=o,warnings1000a372.set=u,warnings1000a372.timestamp=_,warnings1000a372.warn=h,warnings1000a372.warnFileDeprecation=function(e){if(m(!0)){h(`The endpoint 'yaml/${e.replace(/.*yaml[/\\]/i,"").replace(/\.js$/,"").replace(/\\/g,"/")}' will be removed in a future release.`,"DeprecationWarning")}},warnings1000a372.warnOptionDeprecation=function(e,t){if(!g[e]&&m(!0)){g[e]=!0;let n=`The option '${e}' will be removed in a future release`;n+=t?`, use '${t}' instead.`:".",h(n,"DeprecationWarning")}},warnings1000a372}function requireSchema88e323a7(){if(hasRequiredSchema88e323a7)return Schema88e323a7;hasRequiredSchema88e323a7=1;var e=requirePlainValueEc8e588e(),t=requireResolveSeqD03cb037(),n=requireWarnings1000a372();const r={createNode:function(e,n,r){const i=new t.YAMLMap(e);if(n instanceof Map)for(const[t,o]of n)i.items.push(e.createPair(t,o,r));else if(n&&"object"==typeof n)for(const t of Object.keys(n))i.items.push(e.createPair(t,n[t],r));return"function"==typeof e.sortMapEntries&&i.items.sort(e.sortMapEntries),i},default:!0,nodeClass:t.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:t.resolveMap};const i={createNode:function(e,n,r){const i=new t.YAMLSeq(e);if(n&&n[Symbol.iterator])for(const t of n){const n=e.createNode(t,r.wrapScalars,null,r);i.items.push(n)}return i},default:!0,nodeClass:t.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:t.resolveSeq},o={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:t.resolveString,stringify:(e,n,r,i)=>(n=Object.assign({actualString:!0},n),t.stringifyString(e,n,r,i)),options:t.strOptions},s=[r,i,o],a=e=>"bigint"==typeof e||Number.isInteger(e),c=(e,n,r)=>t.intOptions.asBigInt?BigInt(e):parseInt(n,r);function u(e,n,r){const{value:i}=e;return a(i)&&i>=0?r+i.toString(n):t.stringifyNumber(e)}const l={identify:e=>null==e,createNode:(e,n,r)=>r.wrapScalars?new t.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:t.nullOptions,stringify:()=>t.nullOptions.nullStr},d={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>"t"===e[0]||"T"===e[0],options:t.boolOptions,stringify:({value:e})=>e?t.boolOptions.trueStr:t.boolOptions.falseStr},p={identify:e=>a(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:(e,t)=>c(e,t,8),options:t.intOptions,stringify:e=>u(e,8,"0o")},f={identify:a,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:e=>c(e,e,10),options:t.intOptions,stringify:t.stringifyNumber},_={identify:e=>a(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:(e,t)=>c(e,t,16),options:t.intOptions,stringify:e=>u(e,16,"0x")},m={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(e,t)=>t?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:t.stringifyNumber},h={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify:({value:e})=>Number(e).toExponential()},g={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(e,n,r){const i=n||r,o=new t.Scalar(parseFloat(e));return i&&"0"===i[i.length-1]&&(o.minFractionDigits=i.length),o},stringify:t.stringifyNumber},A=s.concat([l,d,p,f,_,m,h,g]),y=e=>"bigint"==typeof e||Number.isInteger(e),v=({value:e})=>JSON.stringify(e),b=[r,i,{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:t.resolveString,stringify:v},{identify:e=>null==e,createNode:(e,n,r)=>r.wrapScalars?new t.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:v},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:e=>"true"===e,stringify:v},{identify:y,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:e=>t.intOptions.asBigInt?BigInt(e):parseInt(e,10),stringify:({value:e})=>y(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:v}];b.scalarFallback=e=>{throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(e)}`)};const C=({value:e})=>e?t.boolOptions.trueStr:t.boolOptions.falseStr,E=e=>"bigint"==typeof e||Number.isInteger(e);function x(e,n,r){let i=n.replace(/_/g,"");if(t.intOptions.asBigInt){switch(r){case 2:i=`0b${i}`;break;case 8:i=`0o${i}`;break;case 16:i=`0x${i}`}const t=BigInt(i);return"-"===e?BigInt(-1)*t:t}const o=parseInt(i,r);return"-"===e?-1*o:o}function S(e,n,r){const{value:i}=e;if(E(i)){const e=i.toString(n);return i<0?"-"+r+e.substr(1):r+e}return t.stringifyNumber(e)}const k=s.concat([{identify:e=>null==e,createNode:(e,n,r)=>r.wrapScalars?new t.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:t.nullOptions,stringify:()=>t.nullOptions.nullStr},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>!0,options:t.boolOptions,stringify:C},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>!1,options:t.boolOptions,stringify:C},{identify:E,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:(e,t,n)=>x(t,n,2),stringify:e=>S(e,2,"0b")},{identify:E,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^([-+]?)0([0-7_]+)$/,resolve:(e,t,n)=>x(t,n,8),stringify:e=>S(e,8,"0")},{identify:E,default:!0,tag:"tag:yaml.org,2002:int",test:/^([-+]?)([0-9][0-9_]*)$/,resolve:(e,t,n)=>x(t,n,10),stringify:t.stringifyNumber},{identify:E,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(e,t,n)=>x(t,n,16),stringify:e=>S(e,16,"0x")},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(e,t)=>t?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:t.stringifyNumber},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify:({value:e})=>Number(e).toExponential()},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve(e,n){const r=new t.Scalar(parseFloat(e.replace(/_/g,"")));if(n){const e=n.replace(/_/g,"");"0"===e[e.length-1]&&(r.minFractionDigits=e.length)}return r},stringify:t.stringifyNumber}],n.binary,n.omap,n.pairs,n.set,n.intTime,n.floatTime,n.timestamp),D={core:A,failsafe:s,json:b,yaml11:k},w={binary:n.binary,bool:d,float:g,floatExp:h,floatNaN:m,floatTime:n.floatTime,int:f,intHex:_,intOct:p,intTime:n.intTime,map:r,null:l,omap:n.omap,pairs:n.pairs,seq:i,set:n.set,timestamp:n.timestamp};function I(e,n,o){if(e instanceof t.Node)return e;const{defaultPrefix:s,onTagObj:a,prevObjects:c,schema:u,wrapScalars:l}=o;n&&n.startsWith("!!")&&(n=s+n.slice(2));let d=function(e,t,n){if(t){const e=n.filter((e=>e.tag===t)),r=e.find((e=>!e.format))||e[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find((t=>(t.identify&&t.identify(e)||t.class&&e instanceof t.class)&&!t.format))}(e,n,u.tags);if(!d){if("function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e)return l?new t.Scalar(e):e;d=e instanceof Map?r:e[Symbol.iterator]?i:r}a&&(a(d),delete o.onTagObj);const p={value:void 0,node:void 0};if(e&&"object"==typeof e&&c){const n=c.get(e);if(n){const e=new t.Alias(n);return o.aliasNodes.push(e),e}p.value=e,c.set(e,p)}return p.node=d.createNode?d.createNode(o.schema,e,o):l?new t.Scalar(e):e,n&&p.node instanceof t.Node&&(p.node.tag=n),p.node}const T=(e,t)=>e.keyt.key?1:0;class R{constructor({customTags:e,merge:t,schema:r,sortMapEntries:i,tags:o}){this.merge=!!t,this.name=r,this.sortMapEntries=!0===i?T:i||null,!e&&o&&n.warnOptionDeprecation("tags","customTags"),this.tags=function(e,t,n,r){let i=e[r.replace(/\W/g,"")];if(!i){const t=Object.keys(e).map((e=>JSON.stringify(e))).join(", ");throw new Error(`Unknown schema "${r}"; use one of ${t}`)}if(Array.isArray(n))for(const e of n)i=i.concat(e);else"function"==typeof n&&(i=n(i.slice()));for(let e=0;eJSON.stringify(e))).join(", ");throw new Error(`Unknown custom tag "${n}"; use one of ${e}`)}i[e]=r}}return i}(D,w,e||o,r)}createNode(e,t,n,r){const i={defaultPrefix:R.defaultPrefix,schema:this,wrapScalars:t};return I(e,n,r?Object.assign(r,i):i)}createPair(e,n,r){r||(r={wrapScalars:!0});const i=this.createNode(e,r.wrapScalars,null,r),o=this.createNode(n,r.wrapScalars,null,r);return new t.Pair(i,o)}}return e._defineProperty(R,"defaultPrefix",e.defaultTagPrefix),e._defineProperty(R,"defaultTags",e.defaultTags),Schema88e323a7.Schema=R,Schema88e323a7}function requireDocument9b4560a1(){if(hasRequiredDocument9b4560a1)return Document9b4560a1;hasRequiredDocument9b4560a1=1;var e=requirePlainValueEc8e588e(),t=requireResolveSeqD03cb037(),n=requireSchema88e323a7();const r={get binary(){return t.binaryOptions},set binary(e){Object.assign(t.binaryOptions,e)},get bool(){return t.boolOptions},set bool(e){Object.assign(t.boolOptions,e)},get int(){return t.intOptions},set int(e){Object.assign(t.intOptions,e)},get null(){return t.nullOptions},set null(e){Object.assign(t.nullOptions,e)},get str(){return t.strOptions},set str(e){Object.assign(t.strOptions,e)}},i={"1.0":{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:e.defaultTagPrefix},{handle:"!!",prefix:"tag:private.yaml.org,2002:"}]},1.1:{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:e.defaultTagPrefix}]},1.2:{schema:"core",merge:!1,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:e.defaultTagPrefix}]}};function o(e,t){if("1.0"===(e.version||e.options.version)){const e=t.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);if(e)return"!"+e[1];const n=t.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);return n?`!${n[1]}/${n[2]}`:`!${t.replace(/^tag:/,"")}`}let n=e.tagPrefixes.find((e=>0===t.indexOf(e.prefix)));if(!n){const r=e.getDefaults().tagPrefixes;n=r&&r.find((e=>0===t.indexOf(e.prefix)))}if(!n)return"!"===t[0]?t:`!<${t}>`;const r=t.substr(n.prefix.length).replace(/[!,[\]{}]/g,(e=>({"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"}[e])));return n.handle+r}function s(e,n,r,i){const{anchors:s,schema:a}=n.doc;let c;if(!(e instanceof t.Node)){const t={aliasNodes:[],onTagObj:e=>c=e,prevObjects:new Map};e=a.createNode(e,!0,null,t);for(const e of t.aliasNodes){e.source=e.source.node;let t=s.getName(e.source);t||(t=s.newName(),s.map[t]=e.source)}}if(e instanceof t.Pair)return e.toString(n,r,i);c||(c=function(e,n){if(n instanceof t.Alias)return t.Alias;if(n.tag){const t=e.filter((e=>e.tag===n.tag));if(t.length>0)return t.find((e=>e.format===n.format))||t[0]}let r,i;if(n instanceof t.Scalar){i=n.value;const t=e.filter((e=>e.identify&&e.identify(i)||e.class&&i instanceof e.class));r=t.find((e=>e.format===n.format))||t.find((e=>!e.format))}else i=n,r=e.find((e=>e.nodeClass&&i instanceof e.nodeClass));if(!r){const e=i&&i.constructor?i.constructor.name:typeof i;throw new Error(`Tag not resolved for ${e} value`)}return r}(a.tags,e));const u=function(e,t,{anchors:n,doc:r}){const i=[],s=r.anchors.getName(e);return s&&(n[s]=e,i.push(`&${s}`)),e.tag?i.push(o(r,e.tag)):t.default||i.push(o(r,t.tag)),i.join(" ")}(e,c,n);u.length>0&&(n.indentAtStart=(n.indentAtStart||0)+u.length+1);const l="function"==typeof c.stringify?c.stringify(e,n,r,i):e instanceof t.Scalar?t.stringifyString(e,n,r,i):e.toString(n,r,i);return u?e instanceof t.Scalar||"{"===l[0]||"["===l[0]?`${u} ${l}`:`${u}\n${n.indent}${l}`:l}class a{static validAnchorNode(e){return e instanceof t.Scalar||e instanceof t.YAMLSeq||e instanceof t.YAMLMap}constructor(t){e._defineProperty(this,"map",Object.create(null)),this.prefix=t}createAlias(e,n){return this.setAnchor(e,n),new t.Alias(e)}createMergePair(...e){const n=new t.Merge;return n.value.items=e.map((e=>{if(e instanceof t.Alias){if(e.source instanceof t.YAMLMap)return e}else if(e instanceof t.YAMLMap)return this.createAlias(e);throw new Error("Merge sources must be Map nodes or their Aliases")})),n}getName(e){const{map:t}=this;return Object.keys(t).find((n=>t[n]===e))}getNames(){return Object.keys(this.map)}getNode(e){return this.map[e]}newName(e){e||(e=this.prefix);const t=Object.keys(this.map);for(let n=1;;++n){const r=`${e}${n}`;if(!t.includes(r))return r}}resolveNodes(){const{map:e,_cstAliases:t}=this;Object.keys(e).forEach((t=>{e[t]=e[t].resolved})),t.forEach((e=>{e.source=e.source.resolved})),delete this._cstAliases}setAnchor(e,t){if(null!=e&&!a.validAnchorNode(e))throw new Error("Anchors may only be set for Scalar, Seq and Map nodes");if(t&&/[\x00-\x19\s,[\]{}]/.test(t))throw new Error("Anchor names must not contain whitespace or control characters");const{map:n}=this,r=e&&Object.keys(n).find((t=>n[t]===e));if(r){if(!t)return r;r!==t&&(delete n[r],n[t]=e)}else{if(!t){if(!e)return null;t=this.newName()}n[t]=e}return t}}const c=(e,n)=>{if(e&&"object"==typeof e){const{tag:r}=e;e instanceof t.Collection?(r&&(n[r]=!0),e.items.forEach((e=>c(e,n)))):e instanceof t.Pair?(c(e.key,n),c(e.value,n)):e instanceof t.Scalar&&r&&(n[r]=!0)}return n};function u({tagPrefixes:t},n){const[r,i]=n.parameters;if(!r||!i){const t="Insufficient parameters given for %TAG directive";throw new e.YAMLSemanticError(n,t)}if(t.some((e=>e.handle===r))){const t="The %TAG directive must only be given at most once per handle in the same document.";throw new e.YAMLSemanticError(n,t)}return{handle:r,prefix:i}}function l(t,n){let[r]=n.parameters;if("YAML:1.0"===n.name&&(r="1.0"),!r){const t="Insufficient parameters given for %YAML directive";throw new e.YAMLSemanticError(n,t)}if(!i[r]){const i=`Document will be parsed as YAML ${t.version||t.options.version} rather than YAML ${r}`;t.warnings.push(new e.YAMLWarning(n,i))}return r}function d(e){if(e instanceof t.Collection)return!0;throw new Error("Expected a YAML collection as document contents")}class p{constructor(e){this.anchors=new a(e.anchorPrefix),this.commentBefore=null,this.comment=null,this.contents=null,this.directivesEndMarker=null,this.errors=[],this.options=e,this.schema=null,this.tagPrefixes=[],this.version=null,this.warnings=[]}add(e){return d(this.contents),this.contents.add(e)}addIn(e,t){d(this.contents),this.contents.addIn(e,t)}delete(e){return d(this.contents),this.contents.delete(e)}deleteIn(e){return t.isEmptyPath(e)?null!=this.contents&&(this.contents=null,!0):(d(this.contents),this.contents.deleteIn(e))}getDefaults(){return p.defaults[this.version]||p.defaults[this.options.version]||{}}get(e,n){return this.contents instanceof t.Collection?this.contents.get(e,n):void 0}getIn(e,n){return t.isEmptyPath(e)?!n&&this.contents instanceof t.Scalar?this.contents.value:this.contents:this.contents instanceof t.Collection?this.contents.getIn(e,n):void 0}has(e){return this.contents instanceof t.Collection&&this.contents.has(e)}hasIn(e){return t.isEmptyPath(e)?void 0!==this.contents:this.contents instanceof t.Collection&&this.contents.hasIn(e)}set(e,t){d(this.contents),this.contents.set(e,t)}setIn(e,n){t.isEmptyPath(e)?this.contents=n:(d(this.contents),this.contents.setIn(e,n))}setSchema(e,t){if(!e&&!t&&this.schema)return;"number"==typeof e&&(e=e.toFixed(1)),"1.0"===e||"1.1"===e||"1.2"===e?(this.version?this.version=e:this.options.version=e,delete this.options.schema):e&&"string"==typeof e&&(this.options.schema=e),Array.isArray(t)&&(this.options.customTags=t);const r=Object.assign({},this.getDefaults(),this.options);this.schema=new n.Schema(r)}parse(n,r){this.options.keepCstNodes&&(this.cstNode=n),this.options.keepNodeTypes&&(this.type="DOCUMENT");const{directives:i=[],contents:o=[],directivesEndMarker:s,error:a,valueRange:c}=n;if(a&&(a.source||(a.source=this),this.errors.push(a)),function(t,n,r){const i=[];let o=!1;for(const r of n){const{comment:n,name:s}=r;switch(s){case"TAG":try{t.tagPrefixes.push(u(t,r))}catch(e){t.errors.push(e)}o=!0;break;case"YAML":case"YAML:1.0":if(t.version){const n="The %YAML directive must only be given at most once per document.";t.errors.push(new e.YAMLSemanticError(r,n))}try{t.version=l(t,r)}catch(e){t.errors.push(e)}o=!0;break;default:if(s){const n=`YAML only supports %TAG and %YAML directives, and not %${s}`;t.warnings.push(new e.YAMLWarning(r,n))}}n&&i.push(n)}if(r&&!o&&"1.1"===(t.version||r.version||t.options.version)){const e=({handle:e,prefix:t})=>({handle:e,prefix:t});t.tagPrefixes=r.tagPrefixes.map(e),t.version=r.version}t.commentBefore=i.join("\n")||null}(this,i,r),s&&(this.directivesEndMarker=!0),this.range=c?[c.start,c.end]:null,this.setSchema(),this.anchors._cstAliases=[],function(n,r){const i={before:[],after:[]};let o,s=!1;for(const a of r)if(a.valueRange){if(void 0!==o){const t="Document contains trailing content not separated by a ... or --- line";n.errors.push(new e.YAMLSyntaxError(a,t));break}const r=t.resolveNode(n,a);s&&(r.spaceBefore=!0,s=!1),o=r}else null!==a.comment?(void 0===o?i.before:i.after).push(a.comment):a.type===e.Type.BLANK_LINE&&(s=!0,void 0===o&&i.before.length>0&&!n.commentBefore&&(n.commentBefore=i.before.join("\n"),i.before=[]));if(n.contents=o||null,o){const e=i.before.join("\n");if(e){const n=o instanceof t.Collection&&o.items[0]?o.items[0]:o;n.commentBefore=n.commentBefore?`${e}\n${n.commentBefore}`:e}n.comment=i.after.join("\n")||null}else n.comment=i.before.concat(i.after).join("\n")||null}(this,o),this.anchors.resolveNodes(),this.options.prettyErrors){for(const t of this.errors)t instanceof e.YAMLError&&t.makePretty();for(const t of this.warnings)t instanceof e.YAMLError&&t.makePretty()}return this}listNonDefaultTags(){return(e=>Object.keys(c(e,{})))(this.contents).filter((e=>0!==e.indexOf(n.Schema.defaultPrefix)))}setTagPrefix(e,t){if("!"!==e[0]||"!"!==e[e.length-1])throw new Error("Handle must start and end with !");if(t){const n=this.tagPrefixes.find((t=>t.handle===e));n?n.prefix=t:this.tagPrefixes.push({handle:e,prefix:t})}else this.tagPrefixes=this.tagPrefixes.filter((t=>t.handle!==e))}toJSON(e,n){const{keepBlobsInJSON:r,mapAsMap:i,maxAliasCount:o}=this.options,a=r&&("string"!=typeof e||!(this.contents instanceof t.Scalar)),c={doc:this,indentStep:" ",keep:a,mapAsMap:a&&!!i,maxAliasCount:o,stringify:s},u=Object.keys(this.anchors.map);u.length>0&&(c.anchors=new Map(u.map((e=>[this.anchors.map[e],{alias:[],aliasCount:0,count:1}]))));const l=t.toJSON(this.contents,e,c);if("function"==typeof n&&c.anchors)for(const{count:e,res:t}of c.anchors.values())n(t,e);return l}toString(){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");const e=this.options.indent;if(!Number.isInteger(e)||e<=0){const t=JSON.stringify(e);throw new Error(`"indent" option must be a positive integer, not ${t}`)}this.setSchema();const n=[];let r=!1;if(this.version){let e="%YAML 1.2";"yaml-1.1"===this.schema.name&&("1.0"===this.version?e="%YAML:1.0":"1.1"===this.version&&(e="%YAML 1.1")),n.push(e),r=!0}const i=this.listNonDefaultTags();this.tagPrefixes.forEach((({handle:e,prefix:t})=>{i.some((e=>0===e.indexOf(t)))&&(n.push(`%TAG ${e} ${t}`),r=!0)})),(r||this.directivesEndMarker)&&n.push("---"),this.commentBefore&&(!r&&this.directivesEndMarker||n.unshift(""),n.unshift(this.commentBefore.replace(/^/gm,"#")));const o={anchors:Object.create(null),doc:this,indent:"",indentStep:" ".repeat(e),stringify:s};let a=!1,c=null;if(this.contents){this.contents instanceof t.Node&&(this.contents.spaceBefore&&(r||this.directivesEndMarker)&&n.push(""),this.contents.commentBefore&&n.push(this.contents.commentBefore.replace(/^/gm,"#")),o.forceBlockIndent=!!this.comment,c=this.contents.comment);const e=c?null:()=>a=!0,i=s(this.contents,o,(()=>c=null),e);n.push(t.addComment(i,"",c))}else void 0!==this.contents&&n.push(s(this.contents,o));return this.comment&&(a&&!c||""===n[n.length-1]||n.push(""),n.push(this.comment.replace(/^/gm,"#"))),n.join("\n")+"\n"}}return e._defineProperty(p,"defaults",i),Document9b4560a1.Document=p,Document9b4560a1.defaultOptions={anchorPrefix:"a",customTags:null,indent:2,indentSeq:!0,keepCstNodes:!1,keepNodeTypes:!0,keepBlobsInJSON:!0,mapAsMap:!1,maxAliasCount:100,prettyErrors:!1,simpleKeys:!1,version:"1.2"},Document9b4560a1.scalarOptions=r,Document9b4560a1}function requireDist$1(){if(hasRequiredDist$1)return dist$1;hasRequiredDist$1=1;var e=requireParseCst(),t=requireDocument9b4560a1(),n=requireSchema88e323a7(),r=requirePlainValueEc8e588e(),i=requireWarnings1000a372();requireResolveSeqD03cb037();class o extends t.Document{constructor(e){super(Object.assign({},t.defaultOptions,e))}}function s(t,n){const i=e.parse(t),s=new o(n).parse(i[0]);if(i.length>1){const e="Source contains multiple documents; please use YAML.parseAllDocuments()";s.errors.unshift(new r.YAMLSemanticError(i[1],e))}return s}const a={createNode:function(e,r=!0,i){void 0===i&&"string"==typeof r&&(i=r,r=!0);const o=Object.assign({},t.Document.defaults[t.defaultOptions.version],t.defaultOptions);return new n.Schema(o).createNode(e,r,i)},defaultOptions:t.defaultOptions,Document:o,parse:function(e,t){const n=s(e,t);if(n.warnings.forEach((e=>i.warn(e))),n.errors.length>0)throw n.errors[0];return n.toJSON()},parseAllDocuments:function(t,n){const r=[];let i;for(const s of e.parse(t)){const e=new o(n);e.parse(s,i),r.push(e),i=e}return r},parseCST:e.parse,parseDocument:s,scalarOptions:t.scalarOptions,stringify:function(e,t){const n=new o(t);return n.contents=e,String(n)}};return dist$1.YAML=a,dist$1}function requireYaml(){return hasRequiredYaml?yaml:(hasRequiredYaml=1,yaml=requireDist$1().YAML)}function requireJptr(){if(hasRequiredJptr)return jptr_1;function e(e){return e.replace(/\~1/g,"/").replace(/~0/g,"~")}return hasRequiredJptr=1,jptr_1={jptr:function(t,n,r){if(void 0===t)return!1;if(!n||"string"!=typeof n||"#"===n)return void 0!==r?r:t;if(n.indexOf("#")>=0){let e=n.split("#");if(e[0])return!1;n=e[1],n=decodeURIComponent(n.slice(1).split("+").join(" "))}n.startsWith("/")&&(n=n.slice(1));let i=n.split("/");for(let n=0;n0?i[n-1]:"",-1!=s||t&&t.hasOwnProperty(i[n]))if(s>=0)o&&(t[s]=r),t=t[s];else{if(-2===s)return o?(Array.isArray(t)&&t.push(r),r):void 0;o&&(t[i[n]]=r),t=t[i[n]]}else{if(void 0===r||"object"!=typeof t||Array.isArray(t))return!1;t[i[n]]=o?r:"0"===i[n+1]||"-"===i[n+1]?[]:{},t=t[i[n]]}}return t},jpescape:function(e){return e.replace(/\~/g,"~0").replace(/\//g,"~1")},jpunescape:e},jptr_1}function requireIsref(){if(hasRequiredIsref)return isref;return hasRequiredIsref=1,isref={isRef:function(e,t){return"$ref"===t&&!!e&&"string"==typeof e[t]}}}function requireClone(){if(hasRequiredClone)return clone_1;return hasRequiredClone=1,clone_1={nop:function(e){return e},clone:function(e){return JSON.parse(JSON.stringify(e))},shallowClone:function(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},deepClone:function e(t){let n=Array.isArray(t)?[]:{};for(let r in t)(t.hasOwnProperty(r)||Array.isArray(t))&&(n[r]="object"==typeof t[r]?e(t[r]):t[r]);return n},fastClone:function(e){return Object.assign({},e)},circularClone:function e(t,n){if(n||(n=new WeakMap),Object(t)!==t||t instanceof Function)return t;if(n.has(t))return n.get(t);try{var r=new t.constructor}catch(e){r=Object.create(Object.getPrototypeOf(t))}return n.set(t,r),Object.assign(r,...Object.keys(t).map((r=>({[r]:e(t[r],n)}))))}},clone_1}function requireRecurse(){if(hasRequiredRecurse)return recurse_1;hasRequiredRecurse=1;const e=requireJptr().jpescape;return recurse_1={recurse:function t(n,r,i){if(r||(r={depth:0}),r.depth||(r=Object.assign({},{path:"#",depth:0,pkey:"",parent:{},payload:{},seen:new WeakMap,identity:!1,identityDetection:!1},r)),"object"!=typeof n)return;let o=r.path;for(let s in n){if(r.key=s,r.path=r.path+"/"+encodeURIComponent(e(s)),r.identityPath=r.seen.get(n[s]),r.identity=void 0!==r.identityPath,n.hasOwnProperty(s)&&i(n,s,r),"object"==typeof n[s]&&!r.identity){r.identityDetection&&!Array.isArray(n[s])&&null!==n[s]&&r.seen.set(n[s],r.path);let e={};e.parent=n,e.path=r.path,e.depth=r.depth?r.depth+1:1,e.pkey=s,e.payload=r.payload,e.seen=r.seen,e.identity=!1,e.identityDetection=r.identityDetection,t(n[s],e,i)}r.path=o}}},recurse_1}function requireDereference(){if(hasRequiredDereference)return dereference_1;hasRequiredDereference=1;const e=requireRecurse().recurse,t=requireClone().shallowClone,n=requireJptr().jptr,r=requireIsref().isRef;return dereference_1={dereference:function i(o,s,a){a||(a={}),a.cache||(a.cache={}),a.state||(a.state={}),a.state.identityDetection=!0,a.depth=a.depth?a.depth+1:1;let c=a.depth>1?o:t(o),u={data:c},l=a.depth>1?s:t(s);a.master||(a.master=c);let d=function(e){return e&&e.verbose?{warn:function(){var e=Array.prototype.slice.call(arguments);console.warn.apply(console,e)}}:{warn:function(){}}}(a),p=1;for(;p>0;)p=0,e(u,a.state,(function(e,t,o){if(r(e,t)){let r=e[t];if(p++,a.cache[r]){let e=a.cache[r];if(e.resolved)d.warn("Patching %s for %s",r,e.path),o.parent[o.pkey]=e.data,a.$ref&&"object"==typeof o.parent[o.pkey]&&null!==o.parent[o.pkey]&&(o.parent[o.pkey][a.$ref]=r);else{if(r===e.path)throw new Error(`Tight circle at ${e.path}`);d.warn("Unresolved ref"),o.parent[o.pkey]=n(e.source,e.path),!1===o.parent[o.pkey]&&(o.parent[o.pkey]=n(e.source,e.key)),a.$ref&&"object"==typeof o.parent[o.pkey]&&null!==o.parent[o.pkey]&&(o.parent[a.$ref]=r)}}else{let e={};e.path=o.path.split("/$ref")[0],e.key=r,d.warn("Dereffing %s at %s",r,e.path),e.source=l,e.data=n(e.source,e.key),!1===e.data&&(e.data=n(a.master,e.key),e.source=a.master),!1===e.data&&d.warn("Missing $ref target",e.key),a.cache[r]=e,e.data=o.parent[o.pkey]=i(n(e.source,e.key),e.source,a),a.$ref&&"object"==typeof o.parent[o.pkey]&&null!==o.parent[o.pkey]&&(o.parent[o.pkey][a.$ref]=r),e.resolved=!0}}}));return u.data}},dereference_1}function requireFastSafeStringify(){if(hasRequiredFastSafeStringify)return fastSafeStringify;hasRequiredFastSafeStringify=1,fastSafeStringify=o,o.default=o,o.stable=u,o.stableStringify=u;var e="[...]",t="[Circular]",n=[],r=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function o(e,t,o,s){var c;void 0===s&&(s=i()),a(e,"",0,[],void 0,0,s);try{c=0===r.length?JSON.stringify(e,t,o):JSON.stringify(e,d(t),o)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var u=n.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return c}function s(e,t,i,o){var s=Object.getOwnPropertyDescriptor(o,i);void 0!==s.get?s.configurable?(Object.defineProperty(o,i,{value:e}),n.push([o,i,t,s])):r.push([t,i,e]):(o[i]=e,n.push([o,i,t]))}function a(n,r,i,o,c,u,l){var d;if(u+=1,"object"==typeof n&&null!==n){for(d=0;dl.depthLimit)return void s(e,n,r,c);if(void 0!==l.edgesLimit&&i+1>l.edgesLimit)return void s(e,n,r,c);if(o.push(n),Array.isArray(n))for(d=0;dt?1:0}function u(e,t,o,s){void 0===s&&(s=i());var a,c=l(e,"",0,[],void 0,0,s)||e;try{a=0===r.length?JSON.stringify(c,t,o):JSON.stringify(c,d(t),o)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var u=n.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return a}function l(r,i,o,a,u,d,p){var f;if(d+=1,"object"==typeof r&&null!==r){for(f=0;fp.depthLimit)return void s(e,r,i,u);if(void 0!==p.edgesLimit&&o+1>p.edgesLimit)return void s(e,r,i,u);if(a.push(r),Array.isArray(r))for(f=0;f0)for(var i=0;i1&&console.warn("Replacing with",t),m++}}else{let n=a(o(t,e[r]));if(d.verbose>1&&console.warn((!1===n?l.colour.red:l.colour.green)+"Fragment resolution",e[r],l.colour.normal),!1===n){if(i.parent[i.pkey]={},d.fatal){let t=new Error("Fragment $ref resolution failed "+e[r]);if(!d.promise)throw t;d.promise.reject(t)}}else m++,i.parent[i.pkey]=n,_[e[r]]=i.path.replace("/%24ref","")}else if(f.protocol){let t=n.resolve(c,e[r]).toString();d.verbose>1&&console.warn(l.colour.yellow+"Rewriting external url ref",e[r],"as",t,l.colour.normal),e["x-miro"]=e[r],d.externalRefs[e[r]]&&(d.externalRefs[t]||(d.externalRefs[t]=d.externalRefs[e[r]]),d.externalRefs[t].failed=d.externalRefs[e[r]].failed),e[r]=t}else if(!e["x-miro"]){let t=n.resolve(c,e[r]).toString(),i=!1;d.externalRefs[e[r]]&&(i=d.externalRefs[e[r]].failed),i||(d.verbose>1&&console.warn(l.colour.yellow+"Rewriting external ref",e[r],"as",t,l.colour.normal),e["x-miro"]=e[r],e[r]=t)}}));return s(e,{},(function(e,t,n){u(e,t)&&void 0!==e.$fixed&&delete e.$fixed})),d.verbose>1&&console.warn("Finished fragment resolution"),e}function p(e,t){if(!t.filters||!t.filters.length)return e;for(let n of t.filters)e=n(e,t);return e}function f(r,s,c,u){var l=n.parse(c.source),f=c.source.split("\\").join("/").split("/");f.pop()||f.pop();let _="",m=s.split("#");m.length>1&&(_="#"+m[1],s=m[0]),f=f.join("/");let h=n.parse(s),g=(A=h.protocol,y=l.protocol,A&&A.length>2?A:y&&y.length>2?y:"file:");var A,y;let v;if(v="file:"===g?t.resolve(f?f+"/":"",s):n.resolve(f?f+"/":"",s),c.cache[v]){c.verbose&&console.warn("CACHED",v,_);let e=a(c.cache[v]),t=c.externalRef=e;if(_&&(t=o(t,_),!1===t&&(t={},c.fatal))){let e=new Error("Cached $ref resolution failed "+v+_);if(!c.promise)throw e;c.promise.reject(e)}return t=d(t,e,s,_,v,c),t=p(t,c),u(a(t),v,c),Promise.resolve(t)}if(c.verbose&&console.warn("GET",v,_),c.handlers&&c.handlers[g])return c.handlers[g](f,s,_,c).then((function(e){return c.externalRef=e,e=p(e,c),c.cache[v]=e,u(e,v,c),e})).catch((function(e){throw c.verbose&&console.warn(e),e}));if(g&&g.startsWith("http")){const e=Object.assign({},c.fetchOptions,{agent:c.agent});return c.fetch(v,e).then((function(e){if(200!==e.status){if(c.ignoreIOErrors)return c.verbose&&console.warn("FAILED",s),c.externalRefs[s].failed=!0,'{"$ref":"'+s+'"}';throw new Error(`Received status code ${e.status}: ${v}`)}return e.text()})).then((function(e){try{let t=i.parse(e,{schema:"core",prettyErrors:!0});if(e=c.externalRef=t,c.cache[v]=a(e),_&&!1===(e=o(e,_))&&(e={},c.fatal)){let e=new Error("Remote $ref resolution failed "+v+_);if(!c.promise)throw e;c.promise.reject(e)}e=p(e=d(e,t,s,_,v,c),c)}catch(e){if(c.verbose&&console.warn(e),!c.promise||!c.fatal)throw e;c.promise.reject(e)}return u(e,v,c),e})).catch((function(e){if(c.verbose&&console.warn(e),c.cache[v]={},!c.promise||!c.fatal)throw e;c.promise.reject(e)}))}{const t='{"$ref":"'+s+'"}';return function(t,n,r,i,o){return new Promise((function(s,a){e.readFile(t,n,(function(e,t){e?r.ignoreIOErrors&&o?(r.verbose&&console.warn("FAILED",i),r.externalRefs[i].failed=!0,s(o)):a(e):s(t)}))}))}(v,c.encoding||"utf8",c,s,t).then((function(e){try{let t=i.parse(e,{schema:"core",prettyErrors:!0});if(e=c.externalRef=t,c.cache[v]=a(e),_&&!1===(e=o(e,_))&&(e={},c.fatal)){let e=new Error("File $ref resolution failed "+v+_);if(!c.promise)throw e;c.promise.reject(e)}e=p(e=d(e,t,s,_,v,c),c)}catch(e){if(c.verbose&&console.warn(e),!c.promise||!c.fatal)throw e;c.promise.reject(e)}return u(e,v,c),e})).catch((function(e){if(c.verbose&&console.warn(e),!c.promise||!c.fatal)throw e;c.promise.reject(e)}))}}function _(e){return new Promise((function(t,n){(function(e){return new Promise((function(t,n){function r(t,n,r){if(t[n]&&u(t[n],"$ref")){let o=t[n].$ref;if(!o.startsWith("#")){let s="";if(!i[o]){let t=Object.keys(i).find((function(e,t,n){return o.startsWith(e+"/")}));t&&(e.verbose&&console.warn("Found potential subschema at",t),s="/"+(o.split("#")[1]||"").replace(t.split("#")[1]||""),s=s.split("/undefined").join(""),o=t)}if(i[o]||(i[o]={resolved:!1,paths:[],extras:{},description:t[n].description}),i[o].resolved)if(i[o].failed);else if(e.rewriteRefs){let r=i[o].resolvedAt;e.verbose>1&&console.warn("Rewriting ref",o,r),t[n]["x-miro"]=o,t[n].$ref=r+s}else t[n]=a(i[o].data);else i[o].paths.push(r.path),i[o].extras[r.path]=s}}}let i=e.externalRefs;if(e.resolver.depth>0&&e.source===e.resolver.base)return t(i);s(e.openapi.definitions,{identityDetection:!0,path:"#/definitions"},r),s(e.openapi.components,{identityDetection:!0,path:"#/components"},r),s(e.openapi,{identityDetection:!0},r),t(i)}))})(e).then((function(t){for(let n in t)if(!t[n].resolved){let r=e.resolver.depth;r>0&&r++,e.resolver.actions[r].push((function(){return f(e.openapi,n,e,(function(e,r,i){if(!t[n].resolved){let o={};o.context=t[n],o.$ref=n,o.original=a(e),o.updated=e,o.source=r,i.externals.push(o),t[n].resolved=!0}let s=Object.assign({},i,{source:"",resolver:{actions:i.resolver.actions,depth:i.resolver.actions.length-1,base:i.resolver.base}});i.patch&&t[n].description&&!e.description&&"object"==typeof e&&(e.description=t[n].description),t[n].data=e;let c=(u=t[n].paths,[...new Set(u)]);var u;c=c.sort((function(e,t){const n=e.startsWith("#/components/")||e.startsWith("#/definitions/"),r=t.startsWith("#/components/")||t.startsWith("#/definitions/");return n&&!r?-1:r&&!n?1:0}));for(let r of c)if(t[n].resolvedAt&&r!==t[n].resolvedAt&&r.indexOf("x-ms-examples/")<0)i.verbose>1&&console.warn("Creating pointer to data at",r),o(i.openapi,r,{$ref:t[n].resolvedAt+t[n].extras[r],"x-miro":n+t[n].extras[r]});else{t[n].resolvedAt?i.verbose>1&&console.warn("Avoiding circular reference"):(t[n].resolvedAt=r,i.verbose>1&&console.warn("Creating initial clone of data at",r));let s=a(e);o(i.openapi,r,s)}0===i.resolver.actions[s.resolver.depth].length&&i.resolver.actions[s.resolver.depth].push((function(){return _(s)}))}))}))}})).catch((function(t){e.verbose&&console.warn(t),n(t)}));let r={options:e};r.actions=e.resolver.actions[e.resolver.depth],t(r)}))}function m(e,t,n){e.resolver.actions.push([]),_(e).then((function(r){var i;(i=r.actions,i.reduce(((e,t)=>e.then((e=>t().then(Array.prototype.concat.bind(e))))),Promise.resolve([]))).then((function(){if(e.resolver.depth>=e.resolver.actions.length)return console.warn("Ran off the end of resolver actions"),t(!0);e.resolver.depth++,e.resolver.actions[e.resolver.depth].length?setTimeout((function(){m(r.options,t,n)}),0):(e.verbose>1&&console.warn(l.colour.yellow+"Finished external resolution!",l.colour.normal),e.resolveInternal&&(e.verbose>1&&console.warn(l.colour.yellow+"Starting internal resolution!",l.colour.normal),e.openapi=c(e.openapi,e.original,{verbose:e.verbose-1}),e.verbose>1&&console.warn(l.colour.yellow+"Finished internal resolution!",l.colour.normal)),s(e.openapi,{},(function(t,n,r){u(t,n)&&(e.preserveMiro||delete t["x-miro"])})),t(e))})).catch((function(t){e.verbose&&console.warn(t),n(t)}))})).catch((function(t){e.verbose&&console.warn(t),n(t)}))}function h(e){if(e.cache||(e.cache={}),e.fetch||(e.fetch=r),e.source){let r=n.parse(e.source);(!r.protocol||r.protocol.length<=2)&&(e.source=t.resolve(e.source))}e.externals=[],e.externalRefs={},e.rewriteRefs=!0,e.resolver={},e.resolver.depth=0,e.resolver.base=e.source,e.resolver.actions=[[]]}return oasResolver={optionalResolve:function(e){return h(e),new Promise((function(t,n){e.resolve?m(e,t,n):t(e)}))},resolve:function(e,t,n){return n||(n={}),n.openapi=e,n.source=t,n.resolve=!0,h(n),new Promise((function(e,t){m(n,e,t)}))}},oasResolver}function requireOasSchemaWalker(){if(hasRequiredOasSchemaWalker)return oasSchemaWalker;function e(){return{depth:0,seen:new WeakMap,top:!0,combine:!1,allowRefSiblings:!1}}return hasRequiredOasSchemaWalker=1,oasSchemaWalker={getDefaultState:e,walkSchema:function t(n,r,i,o){if(void 0===i.depth&&(i=e()),null==n)return n;if(void 0!==n.$ref){let e={$ref:n.$ref};return i.allowRefSiblings&&n.description&&(e.description=n.description),o(e,r,i),e}if(i.combine&&(n.allOf&&Array.isArray(n.allOf)&&1===n.allOf.length&&delete(n=Object.assign({},n.allOf[0],n)).allOf,n.anyOf&&Array.isArray(n.anyOf)&&1===n.anyOf.length&&delete(n=Object.assign({},n.anyOf[0],n)).anyOf,n.oneOf&&Array.isArray(n.oneOf)&&1===n.oneOf.length&&delete(n=Object.assign({},n.oneOf[0],n)).oneOf),o(n,r,i),i.seen.has(n))return n;if("object"==typeof n&&null!==n&&i.seen.set(n,!0),i.top=!1,i.depth++,void 0!==n.items&&(i.property="items",t(n.items,n,i,o)),n.additionalItems&&"object"==typeof n.additionalItems&&(i.property="additionalItems",t(n.additionalItems,n,i,o)),n.additionalProperties&&"object"==typeof n.additionalProperties&&(i.property="additionalProperties",t(n.additionalProperties,n,i,o)),n.properties)for(let e in n.properties){let r=n.properties[e];i.property="properties/"+e,t(r,n,i,o)}if(n.patternProperties)for(let e in n.patternProperties){let r=n.patternProperties[e];i.property="patternProperties/"+e,t(r,n,i,o)}if(n.allOf)for(let e in n.allOf){let r=n.allOf[e];i.property="allOf/"+e,t(r,n,i,o)}if(n.anyOf)for(let e in n.anyOf){let r=n.anyOf[e];i.property="anyOf/"+e,t(r,n,i,o)}if(n.oneOf)for(let e in n.oneOf){let r=n.oneOf[e];i.property="oneOf/"+e,t(r,n,i,o)}return n.not&&(i.property="not",t(n.not,n,i,o)),i.depth--,n}},oasSchemaWalker}function requireStatusCodes(){if(hasRequiredStatusCodes)return statusCodes;hasRequiredStatusCodes=1;const e=require$$2$1;return statusCodes={statusCodes:Object.assign({},{default:"Default response","1XX":"Informational",103:"Early hints","2XX":"Successful","3XX":"Redirection","4XX":"Client Error","5XX":"Server Error","7XX":"Developer Error"},e.STATUS_CODES)}}var name="swagger2openapi",version="7.0.8",description="Convert Swagger 2.0 definitions to OpenApi 3.0 and validate",main$1="index.js",bin={swagger2openapi:"./swagger2openapi.js","oas-validate":"./oas-validate.js",boast:"./boast.js"},funding="https://github.com/Mermade/oas-kit?sponsor=1",scripts={test:"mocha"},browserify={transform:[["babelify",{presets:["es2015"]}]]},repository={url:"https://github.com/Mermade/oas-kit.git",type:"git"},bugs={url:"https://github.com/mermade/oas-kit/issues"},author="Mike Ralphson ",license="BSD-3-Clause",dependencies={"call-me-maybe":"^1.0.1","node-fetch":"^2.6.1","node-fetch-h2":"^2.3.0","node-readfiles":"^0.2.0","oas-kit-common":"^1.0.8","oas-resolver":"^2.5.6","oas-schema-walker":"^1.1.5","oas-validator":"^5.0.8",reftools:"^1.1.9",yaml:"^1.10.0",yargs:"^17.0.1"},keywords=["swagger","openapi","openapi2","openapi3","converter","conversion","validator","validation","resolver","lint","linter"],gitHead="b1bba3fc5007e96a991bf2a015cf0534ac36b88b",require$$14={name:name,version:version,description:description,main:main$1,bin:bin,funding:funding,scripts:scripts,browserify:browserify,repository:repository,bugs:bugs,author:author,license:license,dependencies:dependencies,keywords:keywords,gitHead:gitHead},swagger2openapi,hasRequiredSwagger2openapi;function requireSwagger2openapi(){if(hasRequiredSwagger2openapi)return swagger2openapi;hasRequiredSwagger2openapi=1;const e=require$$0$8,t=require$$0$e,n=requireMaybe(),r=require$$4,i=requireYaml(),o=requireJptr(),s=o.jptr,a=requireIsref().isRef,c=requireClone().clone,u=requireClone().circularClone,l=requireRecurse().recurse,d=requireOasResolver(),p=requireOasSchemaWalker(),f=requireOasKitCommon(),_=requireStatusCodes().statusCodes,m=require$$14.version,h="3.0.0";let g;class A extends Error{constructor(e){super(e),this.name="S2OError"}}function y(e,t){let n=new A(e);if(n.options=t,!t.promise)throw n;t.promise.reject(n)}function v(e,t,n){n.warnOnly?t[n.warnProperty||"x-s2o-warning"]=e:y(e,n)}function b(e,t){p.walkSchema(e,{},{},(function(e,n,r){!function(e){if(e["x-required"]&&Array.isArray(e["x-required"])&&(e.required||(e.required=[]),e.required=e.required.concat(e["x-required"]),delete e["x-required"]),e["x-anyOf"]&&(e.anyOf=e["x-anyOf"],delete e["x-anyOf"]),e["x-oneOf"]&&(e.oneOf=e["x-oneOf"],delete e["x-oneOf"]),e["x-not"]&&(e.not=e["x-not"],delete e["x-not"]),"boolean"==typeof e["x-nullable"]&&(e.nullable=e["x-nullable"],delete e["x-nullable"]),"object"==typeof e["x-discriminator"]&&"string"==typeof e["x-discriminator"].propertyName){e.discriminator=e["x-discriminator"],delete e["x-discriminator"];for(let t in e.discriminator.mapping){let n=e.discriminator.mapping[t];n.startsWith("#/definitions/")&&(e.discriminator.mapping[t]=n.replace("#/definitions/","#/components/schemas/"))}}}(e),function(e,t,n){if(e.nullable&&n.patches++,e.discriminator&&"string"==typeof e.discriminator&&(e.discriminator={propertyName:e.discriminator}),e.items&&Array.isArray(e.items)&&(0===e.items.length?e.items={}:1===e.items.length?e.items=e.items[0]:e.items={anyOf:e.items}),e.type&&Array.isArray(e.type))if(n.patch){if(n.patches++,0===e.type.length)delete e.type;else{e.oneOf||(e.oneOf=[]);for(let t of e.type){let n={};if("null"===t)e.nullable=!0;else{n.type=t;for(let t of f.arrayProperties)void 0!==e.prop&&(n[t]=e[t],delete e[t])}n.type&&e.oneOf.push(n)}delete e.type,0===e.oneOf.length?delete e.oneOf:e.oneOf.length<2&&(e.type=e.oneOf[0].type,Object.keys(e.oneOf[0]).length>1&&v("Lost properties from oneOf",e,n),delete e.oneOf)}e.type&&Array.isArray(e.type)&&1===e.type.length&&(e.type=e.type[0])}else y("(Patchable) schema type must not be an array",n);e.type&&"null"===e.type&&(delete e.type,e.nullable=!0),"array"!==e.type||e.items||(e.items={}),"file"===e.type&&(e.type="string",e.format="binary"),"boolean"==typeof e.required&&(e.required&&e.name&&(void 0===t.required&&(t.required=[]),Array.isArray(t.required)&&t.required.push(e.name)),delete e.required),e.xml&&"string"==typeof e.xml.namespace&&(e.xml.namespace||delete e.xml.namespace),void 0!==e.allowEmptyValue&&(n.patches++,delete e.allowEmptyValue)}(e,n,t)}))}function C(e,t,n){let r=n.payload.options;if(a(e,t)){if(e[t].startsWith("#/components/"));else if("#/consumes"===e[t])delete e[t],n.parent[n.pkey]=c(r.openapi.consumes);else if("#/produces"===e[t])delete e[t],n.parent[n.pkey]=c(r.openapi.produces);else if(e[t].startsWith("#/definitions/")){let n=e[t].replace("#/definitions/","").split("/");const i=o.jpunescape(n[0]);let s=g.schemas[decodeURIComponent(i)];s?n[0]=s:v("Could not resolve reference "+e[t],e,r),e[t]="#/components/schemas/"+n.join("/")}else if(e[t].startsWith("#/parameters/"))e[t]="#/components/parameters/"+f.sanitise(e[t].replace("#/parameters/",""));else if(e[t].startsWith("#/responses/"))e[t]="#/components/responses/"+f.sanitise(e[t].replace("#/responses/",""));else if(e[t].startsWith("#")){let n=c(o.jptr(r.openapi,e[t]));if(!1===n)v("direct $ref not found "+e[t],e,r);else if(r.refmap[e[t]])e[t]=r.refmap[e[t]];else{let i=e[t];i=i.replace("/properties/headers/",""),i=i.replace("/properties/responses/",""),i=i.replace("/properties/parameters/",""),i=i.replace("/properties/schemas/","");let s="schemas",a=i.lastIndexOf("/schema");if(s=i.indexOf("/headers/")>a?"headers":i.indexOf("/responses/")>a?"responses":i.indexOf("/example")>a?"examples":i.indexOf("/x-")>a?"extensions":i.indexOf("/parameters/")>a?"parameters":"schemas","schemas"===s&&b(n,r),"responses"!==s&&"extensions"!==s){let i=s.substr(0,s.length-1);"parameter"===i&&n.name&&n.name===f.sanitise(n.name)&&(i=encodeURIComponent(n.name));let a=1;for(e["x-miro"]&&(i=function(e){return e=e.indexOf("#")>=0?e.split("#")[1].split("/").pop():e.split("/").pop().split(".")[0],encodeURIComponent(f.sanitise(e))}(e["x-miro"]),a="");o.jptr(r.openapi,"#/components/"+s+"/"+i+a);)a=""===a?2:++a;let c="#/components/"+s+"/"+i+a,u="";"examples"===s&&(n={value:n},u="/value"),o.jptr(r.openapi,c,n),r.refmap[e[t]]=c+u,e[t]=c+u}}}if(delete e["x-miro"],Object.keys(e).length>1){const i=e[t],o=n.path.indexOf("/schema")>=0;"preserve"===r.refSiblings||(o&&"allOf"===r.refSiblings?(delete e.$ref,n.parent[n.pkey]={allOf:[{$ref:i},e]}):n.parent[n.pkey]={$ref:i})}}if("x-ms-odata"===t&&"string"==typeof e[t]&&e[t].startsWith("#/")){let n=e[t].replace("#/definitions/","").replace("#/components/schemas/","").split("/"),i=g.schemas[decodeURIComponent(n[0])];i?n[0]=i:v("Could not resolve reference "+e[t],e,r),e[t]="#/components/schemas/"+n.join("/")}}function E(e){for(let t in e)for(let n in e[t]){let r=f.sanitise(n);n!==r&&(e[t][r]=e[t][n],delete e[t][n])}}function x(e,t){if("basic"===e.type&&(e.type="http",e.scheme="basic"),"oauth2"===e.type){let n={},r=e.flow;"application"===e.flow&&(r="clientCredentials"),"accessCode"===e.flow&&(r="authorizationCode"),void 0!==e.authorizationUrl&&(n.authorizationUrl=e.authorizationUrl.split("?")[0].trim()||"/"),"string"==typeof e.tokenUrl&&(n.tokenUrl=e.tokenUrl.split("?")[0].trim()||"/"),n.scopes=e.scopes||{},e.flows={},e.flows[r]=n,delete e.flow,delete e.authorizationUrl,delete e.tokenUrl,delete e.scopes,void 0!==e.name&&(t.patch?(t.patches++,delete e.name):y("(Patchable) oauth2 securitySchemes should not have name property",t))}}function S(e){return e&&!e["x-s2o-delete"]}function k(e,t){if(e.$ref)e.$ref=e.$ref.replace("#/responses/","#/components/responses/");else{e.type&&!e.schema&&(e.schema={}),e.type&&(e.schema.type=e.type),e.items&&"array"!==e.items.type&&(e.items.collectionFormat!==e.collectionFormat&&v("Nested collectionFormats are not supported",e,t),delete e.items.collectionFormat),"array"===e.type?("ssv"===e.collectionFormat?v("collectionFormat:ssv is no longer supported for headers",e,t):"pipes"===e.collectionFormat?v("collectionFormat:pipes is no longer supported for headers",e,t):"multi"===e.collectionFormat?e.explode=!0:"tsv"===e.collectionFormat?(v("collectionFormat:tsv is no longer supported",e,t),e["x-collectionFormat"]="tsv"):e.style="simple",delete e.collectionFormat):e.collectionFormat&&(t.patch?(t.patches++,delete e.collectionFormat):y("(Patchable) collectionFormat is only applicable to header.type array",t)),delete e.type;for(let t of f.parameterTypeProperties)void 0!==e[t]&&(e.schema[t]=e[t],delete e[t]);for(let t of f.arrayProperties)void 0!==e[t]&&(e.schema[t]=e[t],delete e[t])}}function D(e,t){if(e.$ref.indexOf("#/parameters/")>=0){let t=e.$ref.split("#/parameters/");e.$ref=t[0]+"#/components/parameters/"+f.sanitise(t[1])}e.$ref.indexOf("#/definitions/")>=0&&v("Definition used as parameter",e,t)}function w(e,t,n,r,i,o,a){let u,d={},p=!0;if(t&&t.consumes&&"string"==typeof t.consumes){if(!a.patch)return y("(Patchable) operation.consumes must be an array",a);a.patches++,t.consumes=[t.consumes]}Array.isArray(o.consumes)||delete o.consumes;let _=((t?t.consumes:null)||o.consumes||[]).filter(f.uniqueOnly);if(e&&e.$ref&&"string"==typeof e.$ref){D(e,a);let t=decodeURIComponent(e.$ref.replace("#/components/parameters/","")),n=!1,r=o.components.parameters[t];if(r&&!r["x-s2o-delete"]||!e.$ref.startsWith("#/")||(e["x-s2o-delete"]=!0,n=!0),n){let t=e.$ref,n=s(o,e.$ref);!n&&t.startsWith("#/")?v("Could not resolve reference "+t,e,a):n&&(e=n)}}if(e&&(e.name||e.in)){"boolean"==typeof e["x-deprecated"]&&(e.deprecated=e["x-deprecated"],delete e["x-deprecated"]),void 0!==e["x-example"]&&(e.example=e["x-example"],delete e["x-example"]),"body"===e.in||e.type||(a.patch?(a.patches++,e.type="string"):y("(Patchable) parameter.type is mandatory for non-body parameters",a)),e.type&&"object"==typeof e.type&&e.type.$ref&&(e.type=s(o,e.type.$ref)),"file"===e.type&&(e["x-s2o-originalType"]=e.type,u=e.type),e.description&&"object"==typeof e.description&&e.description.$ref&&(e.description=s(o,e.description.$ref)),null===e.description&&delete e.description;let t=e.collectionFormat;if("array"!==e.type||t||(t="csv"),t&&("array"!==e.type&&(a.patch?(a.patches++,delete e.collectionFormat):y("(Patchable) collectionFormat is only applicable to param.type array",a)),"csv"!==t||"query"!==e.in&&"cookie"!==e.in||(e.style="form",e.explode=!1),"csv"!==t||"path"!==e.in&&"header"!==e.in||(e.style="simple"),"ssv"===t&&("query"===e.in?e.style="spaceDelimited":v("collectionFormat:ssv is no longer supported except for in:query parameters",e,a)),"pipes"===t&&("query"===e.in?e.style="pipeDelimited":v("collectionFormat:pipes is no longer supported except for in:query parameters",e,a)),"multi"===t&&(e.explode=!0),"tsv"===t&&(v("collectionFormat:tsv is no longer supported",e,a),e["x-collectionFormat"]="tsv"),delete e.collectionFormat),e.type&&"body"!==e.type&&"formData"!==e.in)if(e.items&&e.schema)v("parameter has array,items and schema",e,a);else{e.schema&&a.patches++,e.schema&&"object"==typeof e.schema||(e.schema={}),e.schema.type=e.type,e.items&&(e.schema.items=e.items,delete e.items,l(e.schema.items,null,(function(n,r,i){"collectionFormat"===r&&"string"==typeof n[r]&&(t&&n[r]!==t&&v("Nested collectionFormats are not supported",e,a),delete n[r])})));for(let t of f.parameterTypeProperties)void 0!==e[t]&&(e.schema[t]=e[t]),delete e[t]}e.schema&&b(e.schema,a),e["x-ms-skip-url-encoding"]&&"query"===e.in&&(e.allowReserved=!0,delete e["x-ms-skip-url-encoding"])}if(e&&"formData"===e.in){p=!1,d.content={};let t="application/x-www-form-urlencoded";if(_.length&&_.indexOf("multipart/form-data")>=0&&(t="multipart/form-data"),d.content[t]={},e.schema)d.content[t].schema=e.schema,e.schema.$ref&&(d["x-s2o-name"]=decodeURIComponent(e.schema.$ref.replace("#/components/schemas/","")));else{d.content[t].schema={},d.content[t].schema.type="object",d.content[t].schema.properties={},d.content[t].schema.properties[e.name]={};let n=d.content[t].schema,r=d.content[t].schema.properties[e.name];e.description&&(r.description=e.description),e.example&&(r.example=e.example),e.type&&(r.type=e.type);for(let t of f.parameterTypeProperties)void 0!==e[t]&&(r[t]=e[t]);!0===e.required&&(n.required||(n.required=[]),n.required.push(e.name),d.required=!0),void 0!==e.default&&(r.default=e.default),r.properties&&(r.properties=e.properties),e.allOf&&(r.allOf=e.allOf),"array"===e.type&&e.items&&(r.items=e.items,r.items.collectionFormat&&delete r.items.collectionFormat),"file"!==u&&"file"!==e["x-s2o-originalType"]||(r.type="string",r.format="binary"),I(e,r)}}else e&&"file"===e.type&&(e.required&&(d.required=e.required),d.content={},d.content["application/octet-stream"]={},d.content["application/octet-stream"].schema={},d.content["application/octet-stream"].schema.type="string",d.content["application/octet-stream"].schema.format="binary",I(e,d));if(e&&"body"===e.in){d.content={},e.name&&(d["x-s2o-name"]=(t&&t.operationId?f.sanitiseAll(t.operationId):"")+("_"+e.name).toCamelCase()),e.description&&(d.description=e.description),e.required&&(d.required=e.required),t&&a.rbname&&e.name&&(t[a.rbname]=e.name),e.schema&&e.schema.$ref?d["x-s2o-name"]=decodeURIComponent(e.schema.$ref.replace("#/components/schemas/","")):e.schema&&"array"===e.schema.type&&e.schema.items&&e.schema.items.$ref&&(d["x-s2o-name"]=decodeURIComponent(e.schema.items.$ref.replace("#/components/schemas/",""))+"Array"),_.length||_.push("application/json");for(let t of _)d.content[t]={},d.content[t].schema=c(e.schema||{}),b(d.content[t].schema,a);I(e,d)}if(Object.keys(d).length>0&&(e["x-s2o-delete"]=!0,t))if(t.requestBody&&p){t.requestBody["x-s2o-overloaded"]=!0,v("Operation "+(t.operationId||i)+" has multiple requestBodies",t,a)}else t.requestBody||(t=n[r]=function(e,t){let n={};for(let r of Object.keys(e))n[r]=e[r],"parameters"===r&&(n.requestBody={},t.rbname&&(n[t.rbname]=""));return n.requestBody={},n}(t,a)),t.requestBody.content&&t.requestBody.content["multipart/form-data"]&&t.requestBody.content["multipart/form-data"].schema&&t.requestBody.content["multipart/form-data"].schema.properties&&d.content["multipart/form-data"]&&d.content["multipart/form-data"].schema&&d.content["multipart/form-data"].schema.properties?(t.requestBody.content["multipart/form-data"].schema.properties=Object.assign(t.requestBody.content["multipart/form-data"].schema.properties,d.content["multipart/form-data"].schema.properties),t.requestBody.content["multipart/form-data"].schema.required=(t.requestBody.content["multipart/form-data"].schema.required||[]).concat(d.content["multipart/form-data"].schema.required||[]),t.requestBody.content["multipart/form-data"].schema.required.length||delete t.requestBody.content["multipart/form-data"].schema.required):t.requestBody.content&&t.requestBody.content["application/x-www-form-urlencoded"]&&t.requestBody.content["application/x-www-form-urlencoded"].schema&&t.requestBody.content["application/x-www-form-urlencoded"].schema.properties&&d.content["application/x-www-form-urlencoded"]&&d.content["application/x-www-form-urlencoded"].schema&&d.content["application/x-www-form-urlencoded"].schema.properties?(t.requestBody.content["application/x-www-form-urlencoded"].schema.properties=Object.assign(t.requestBody.content["application/x-www-form-urlencoded"].schema.properties,d.content["application/x-www-form-urlencoded"].schema.properties),t.requestBody.content["application/x-www-form-urlencoded"].schema.required=(t.requestBody.content["application/x-www-form-urlencoded"].schema.required||[]).concat(d.content["application/x-www-form-urlencoded"].schema.required||[]),t.requestBody.content["application/x-www-form-urlencoded"].schema.required.length||delete t.requestBody.content["application/x-www-form-urlencoded"].schema.required):(t.requestBody=Object.assign(t.requestBody,d),t.requestBody["x-s2o-name"]||(t.requestBody.schema&&t.requestBody.schema.$ref?t.requestBody["x-s2o-name"]=decodeURIComponent(t.requestBody.schema.$ref.replace("#/components/schemas/","")).split("/").join(""):t.operationId&&(t.requestBody["x-s2o-name"]=f.sanitiseAll(t.operationId))));if(e&&!e["x-s2o-delete"]){delete e.type;for(let t of f.parameterTypeProperties)delete e[t];"path"!==e.in||void 0!==e.required&&!0===e.required||(a.patch?(a.patches++,e.required=!0):y("(Patchable) path parameters must be required:true ["+e.name+" in "+i+"]",a))}return t}function I(e,t){for(let n in e)n.startsWith("x-")&&!n.startsWith("x-s2o")&&(t[n]=e[n])}function T(e,t,n,r,i){if(!e)return!1;if(e.$ref&&"string"==typeof e.$ref)e.$ref.indexOf("#/definitions/")>=0?v("definition used as response: "+e.$ref,e,i):e.$ref.startsWith("#/responses/")&&(e.$ref="#/components/responses/"+f.sanitise(decodeURIComponent(e.$ref.replace("#/responses/",""))));else{if((void 0===e.description||null===e.description||""===e.description&&i.patch)&&(i.patch?"object"!=typeof e||Array.isArray(e)||(i.patches++,e.description=_[e]||""):y("(Patchable) response.description is mandatory",i)),void 0!==e.schema){if(b(e.schema,i),e.schema.$ref&&"string"==typeof e.schema.$ref&&e.schema.$ref.startsWith("#/responses/")&&(e.schema.$ref="#/components/responses/"+f.sanitise(decodeURIComponent(e.schema.$ref.replace("#/responses/","")))),n&&n.produces&&"string"==typeof n.produces){if(!i.patch)return y("(Patchable) operation.produces must be an array",i);i.patches++,n.produces=[n.produces]}r.produces&&!Array.isArray(r.produces)&&delete r.produces;let t=((n?n.produces:null)||r.produces||[]).filter(f.uniqueOnly);t.length||t.push("*/*"),e.content={};for(let n of t){if(e.content[n]={},e.content[n].schema=c(e.schema),e.examples&&e.examples[n]){let t={};t.value=e.examples[n],e.content[n].examples={},e.content[n].examples.response=t,delete e.examples[n]}"file"===e.content[n].schema.type&&(e.content[n].schema={type:"string",format:"binary"})}delete e.schema}for(let t in e.examples)e.content||(e.content={}),e.content[t]||(e.content[t]={}),e.content[t].examples={},e.content[t].examples.response={},e.content[t].examples.response.value=e.examples[t];if(delete e.examples,e.headers)for(let t in e.headers)"status code"===t.toLowerCase()?i.patch?(i.patches++,delete e.headers[t]):y('(Patchable) "Status Code" is not a valid header',i):k(e.headers[t],i)}}function R(e,n,r,i,a){for(let u in e){let l=e[u];l&&l["x-trace"]&&"object"==typeof l["x-trace"]&&(l.trace=l["x-trace"],delete l["x-trace"]),l&&l["x-summary"]&&"string"==typeof l["x-summary"]&&(l.summary=l["x-summary"],delete l["x-summary"]),l&&l["x-description"]&&"string"==typeof l["x-description"]&&(l.description=l["x-description"],delete l["x-description"]),l&&l["x-servers"]&&Array.isArray(l["x-servers"])&&(l.servers=l["x-servers"],delete l["x-servers"]);for(let e in l)if(f.httpMethods.indexOf(e)>=0||"x-amazon-apigateway-any-method"===e){let d=l[e];if(d&&d.parameters&&Array.isArray(d.parameters)){if(l.parameters)for(let t of l.parameters){"string"==typeof t.$ref&&(D(t,r),t=s(a,t.$ref)),d.parameters.find((function(e,n,r){return e.name===t.name&&e.in===t.in}))||"formData"!==t.in&&"body"!==t.in&&"file"!==t.type||(d=w(t,d,l,e,u,a,r),r.rbname&&""===d[r.rbname]&&delete d[r.rbname])}for(let t of d.parameters)d=w(t,d,l,e,e+":"+u,a,r);r.rbname&&""===d[r.rbname]&&delete d[r.rbname],r.debug||d.parameters&&(d.parameters=d.parameters.filter(S))}if(d&&d.security&&E(d.security),"object"==typeof d){if(!d.responses){let e={description:"Default response"};d.responses={default:e}}for(let e in d.responses){T(d.responses[e],0,d,a,r)}}if(d&&d["x-servers"]&&Array.isArray(d["x-servers"]))d.servers=d["x-servers"],delete d["x-servers"];else if(d&&d.schemes&&d.schemes.length)for(let e of d.schemes)if((!a.schemes||a.schemes.indexOf(e)<0)&&(d.servers||(d.servers=[]),Array.isArray(a.servers)))for(let n of a.servers){let r=c(n),i=t.parse(r.url);i.protocol=e,r.url=i.format(),d.servers.push(r)}if(r.debug&&(d["x-s2o-consumes"]=d.consumes||[],d["x-s2o-produces"]=d.produces||[]),d){if(delete d.consumes,delete d.produces,delete d.schemes,d["x-ms-examples"]){for(let e in d["x-ms-examples"]){let t=d["x-ms-examples"][e],n=f.sanitiseAll(e);if(t.parameters)for(let n in t.parameters){let r=t.parameters[n];for(let t of(d.parameters||[]).concat(l.parameters||[]))t.$ref&&(t=o.jptr(a,t.$ref)),t.name!==n||t.example||(t.examples||(t.examples={}),t.examples[e]={value:r})}if(t.responses)for(let r in t.responses){if(t.responses[r].headers)for(let e in t.responses[r].headers){let n=t.responses[r].headers[e];for(let t in d.responses[r].headers)if(t===e){d.responses[r].headers[t].example=n}}if(t.responses[r].body&&(a.components.examples[n]={value:c(t.responses[r].body)},d.responses[r]&&d.responses[r].content))for(let t in d.responses[r].content){let i=d.responses[r].content[t];i.examples||(i.examples={}),i.examples[e]={$ref:"#/components/examples/"+n}}}}delete d["x-ms-examples"]}if(d.parameters&&0===d.parameters.length&&delete d.parameters,d.requestBody){let t=d.operationId?f.sanitiseAll(d.operationId):f.sanitiseAll(e+u).toCamelCase(),r=f.sanitise(d.requestBody["x-s2o-name"]||t||"");delete d.requestBody["x-s2o-name"];let s=JSON.stringify(d.requestBody),a=f.hash(s);if(!i[a]){let e={};e.name=r,e.body=d.requestBody,e.refs=[],i[a]=e}let c="#/"+n+"/"+encodeURIComponent(o.jpescape(u))+"/"+e+"/requestBody";i[a].refs.push(c)}}}if(l&&l.parameters){for(let e in l.parameters){w(l.parameters[e],null,l,null,u,a,r)}!r.debug&&Array.isArray(l.parameters)&&(l.parameters=l.parameters.filter(S))}}}function F(e,t){let n={};g={schemas:{}},e.security&&E(e.security);for(let n in e.components.securitySchemes){let r=f.sanitise(n);n!==r&&(e.components.securitySchemes[r]&&y("Duplicate sanitised securityScheme name "+r,t),e.components.securitySchemes[r]=e.components.securitySchemes[n],delete e.components.securitySchemes[n]),x(e.components.securitySchemes[r],t)}for(let n in e.components.schemas){let r=f.sanitiseAll(n),i="";if(n!==r){for(;e.components.schemas[r+i];)i=i?++i:2;e.components.schemas[r+i]=e.components.schemas[n],delete e.components.schemas[n]}g.schemas[n]=r+i,b(e.components.schemas[r+i],t)}t.refmap={},l(e,{payload:{options:t}},C),function(e,t){for(let n in t.refmap)o.jptr(e,n,{$ref:t.refmap[n]})}(e,t);for(let n in e.components.parameters){let r=f.sanitise(n);n!==r&&(e.components.parameters[r]&&y("Duplicate sanitised parameter name "+r,t),e.components.parameters[r]=e.components.parameters[n],delete e.components.parameters[n]),w(e.components.parameters[r],null,null,null,r,e,t)}for(let n in e.components.responses){let r=f.sanitise(n);n!==r&&(e.components.responses[r]&&y("Duplicate sanitised response name "+r,t),e.components.responses[r]=e.components.responses[n],delete e.components.responses[n]);let i=e.components.responses[r];if(T(i,0,null,e,t),i.headers)for(let e in i.headers)"status code"===e.toLowerCase()?t.patch?(t.patches++,delete i.headers[e]):y('(Patchable) "Status Code" is not a valid header',t):k(i.headers[e],t)}for(let t in e.components.requestBodies){let r=e.components.requestBodies[t],i=JSON.stringify(r),o=f.hash(i),s={};s.name=t,s.body=r,s.refs=[],n[o]=s}if(R(e.paths,"paths",t,n,e),e["x-ms-paths"]&&R(e["x-ms-paths"],"x-ms-paths",t,n,e),!t.debug)for(let t in e.components.parameters){e.components.parameters[t]["x-s2o-delete"]&&delete e.components.parameters[t]}t.debug&&(e["x-s2o-consumes"]=e.consumes||[],e["x-s2o-produces"]=e.produces||[]),delete e.consumes,delete e.produces,delete e.schemes;let r=[];if(e.components.requestBodies={},!t.resolveInternal){let t=1;for(let i in n){let s=n[i];if(s.refs.length>1){let n="";for(s.name||(s.name="requestBody",n=t++);r.indexOf(s.name+n)>=0;)n=n?++n:2;s.name=s.name+n,r.push(s.name),e.components.requestBodies[s.name]=c(s.body);for(let t in s.refs){let n={};n.$ref="#/components/requestBodies/"+s.name,o.jptr(e,s.refs[t],n)}}}}return e.components.responses&&0===Object.keys(e.components.responses).length&&delete e.components.responses,e.components.parameters&&0===Object.keys(e.components.parameters).length&&delete e.components.parameters,e.components.examples&&0===Object.keys(e.components.examples).length&&delete e.components.examples,e.components.requestBodies&&0===Object.keys(e.components.requestBodies).length&&delete e.components.requestBodies,e.components.securitySchemes&&0===Object.keys(e.components.securitySchemes).length&&delete e.components.securitySchemes,e.components.headers&&0===Object.keys(e.components.headers).length&&delete e.components.headers,e.components.schemas&&0===Object.keys(e.components.schemas).length&&delete e.components.schemas,e.components&&0===Object.keys(e.components).length&&delete e.components,e}function P(e){return e&&e.url&&"string"==typeof e.url?(e.url=e.url.split("{{").join("{"),e.url=e.url.split("}}").join("}"),e.url.replace(/\{(.+?)\}/g,(function(t,n){e.variables||(e.variables={}),e.variables[n]={default:"unknown"}})),e):e}function N(e,t,n){if(void 0===e.info||null===e.info){if(!t.patch)return n(new A("(Patchable) info object is mandatory"));t.patches++,e.info={version:"",title:""}}if("object"!=typeof e.info||Array.isArray(e.info))return n(new A("info must be an object"));if(void 0===e.info.title||null===e.info.title){if(!t.patch)return n(new A("(Patchable) info.title cannot be null"));t.patches++,e.info.title=""}if(void 0===e.info.version||null===e.info.version){if(!t.patch)return n(new A("(Patchable) info.version cannot be null"));t.patches++,e.info.version=""}if("string"!=typeof e.info.version){if(!t.patch)return n(new A("(Patchable) info.version must be a string"));t.patches++,e.info.version=e.info.version.toString()}if(void 0!==e.info.logo){if(!t.patch)return n(new A("(Patchable) info should not have logo property"));t.patches++,e.info["x-logo"]=e.info.logo,delete e.info.logo}if(void 0!==e.info.termsOfService){if(null===e.info.termsOfService){if(!t.patch)return n(new A("(Patchable) info.termsOfService cannot be null"));t.patches++,e.info.termsOfService=""}try{new URL(e.info.termsOfService)}catch(r){if(!t.patch)return n(new A("(Patchable) info.termsOfService must be a URL"));t.patches++,delete e.info.termsOfService}}}function B(e,t,n){if(void 0===e.paths){if(!t.patch)return n(new A("(Patchable) paths object is mandatory"));t.patches++,e.paths={}}}function O(e,t,r){return n(r,new Promise((function(n,r){if(e||(e={}),t.original=e,t.text||(t.text=i.stringify(e)),t.externals=[],t.externalRefs={},t.rewriteRefs=!0,t.preserveMiro=!0,t.promise={},t.promise.resolve=n,t.promise.reject=r,t.patches=0,t.cache||(t.cache={}),t.source&&(t.cache[t.source]=t.original),function(e,t){const n=new WeakSet;l(e,{identityDetection:!0},(function(e,r,i){"object"==typeof e[r]&&null!==e[r]&&(n.has(e[r])?t.anchors?e[r]=c(e[r]):y("YAML anchor or merge key at "+i.path,t):n.add(e[r]))}))}(e,t),e.openapi&&"string"==typeof e.openapi&&e.openapi.startsWith("3."))return t.openapi=u(e),N(t.openapi,t,r),B(t.openapi,t,r),void d.optionalResolve(t).then((function(){return t.direct?n(t.openapi):n(t)})).catch((function(e){console.warn(e),r(e)}));if(!e.swagger||"2.0"!=e.swagger)return r(new A("Unsupported swagger/OpenAPI version: "+(e.openapi?e.openapi:e.swagger)));let o=t.openapi={};if(o.openapi="string"==typeof t.targetVersion&&t.targetVersion.startsWith("3.")?t.targetVersion:h,t.origin){o["x-origin"]||(o["x-origin"]=[]);let n={};n.url=t.source||t.origin,n.format="swagger",n.version=e.swagger,n.converter={},n.converter.url="https://github.com/mermade/oas-kit",n.converter.version=m,o["x-origin"].push(n)}if(o=Object.assign(o,u(e)),delete o.swagger,l(o,{},(function(e,t,n){null===e[t]&&!t.startsWith("x-")&&"default"!==t&&n.path.indexOf("/example")<0&&delete e[t]})),e.host)for(let t of Array.isArray(e.schemes)?e.schemes:[""]){let n={},r=(e.basePath||"").replace(/\/$/,"");n.url=(t?t+":":"")+"//"+e.host+r,P(n),o.servers||(o.servers=[]),o.servers.push(n)}else if(e.basePath){let t={};t.url=e.basePath,P(t),o.servers||(o.servers=[]),o.servers.push(t)}if(delete o.host,delete o.basePath,o["x-servers"]&&Array.isArray(o["x-servers"])&&(o.servers=o["x-servers"],delete o["x-servers"]),e["x-ms-parameterized-host"]){let t=e["x-ms-parameterized-host"],n={};n.url=t.hostTemplate+(e.basePath?e.basePath:""),n.variables={};const r=n.url.match(/\{\w+\}/g);for(let e in t.parameters){let i=t.parameters[e];i.$ref&&(i=c(s(o,i.$ref))),e.startsWith("x-")||(delete i.required,delete i.type,delete i.in,void 0===i.default&&(i.enum?i.default=i.enum[0]:i.default="none"),i.name||(i.name=r[e].replace("{","").replace("}","")),n.variables[i.name]=i,delete i.name)}o.servers||(o.servers=[]),!1===t.useSchemePrefix?o.servers.push(n):e.schemes.forEach((e=>{o.servers.push(Object.assign({},n,{url:e+"://"+n.url}))})),delete o["x-ms-parameterized-host"]}N(o,t,r),B(o,t,r),"string"==typeof o.consumes&&(o.consumes=[o.consumes]),"string"==typeof o.produces&&(o.produces=[o.produces]),o.components={},o["x-callbacks"]&&(o.components.callbacks=o["x-callbacks"],delete o["x-callbacks"]),o.components.examples={},o.components.headers={},o["x-links"]&&(o.components.links=o["x-links"],delete o["x-links"]),o.components.parameters=o.parameters||{},o.components.responses=o.responses||{},o.components.requestBodies={},o.components.securitySchemes=o.securityDefinitions||{},o.components.schemas=o.definitions||{},delete o.definitions,delete o.responses,delete o.parameters,delete o.securityDefinitions,d.optionalResolve(t).then((function(){F(t.openapi,t),t.direct?n(t.openapi):n(t)})).catch((function(e){console.warn(e),r(e)}))})))}function q(e,t,r){return n(r,new Promise((function(n,r){let o=null,s=null;try{o=JSON.parse(e),t.text=JSON.stringify(o,null,2)}catch(n){s=n;try{o=i.parse(e,{schema:"core",prettyErrors:!0}),t.sourceYaml=!0,t.text=e}catch(e){s=e}}o?O(o,t).then((e=>n(e))).catch((e=>r(e))):r(new A(s?s.message:"Could not parse string"))})))}return swagger2openapi={S2OError:A,targetVersion:h,convert:O,convertObj:O,convertUrl:function(e,t,i){return n(i,new Promise((function(n,i){t.origin=!0,t.source||(t.source=e),t.verbose&&console.warn("GET "+e),t.fetch||(t.fetch=r);const o=Object.assign({},t.fetchOptions,{agent:t.agent});t.fetch(e,o).then((function(t){if(200!==t.status)throw new A(`Received status code ${t.status}: ${e}`);return t.text()})).then((function(e){q(e,t).then((e=>n(e))).catch((e=>i(e)))})).catch((function(e){i(e)}))})))},convertStr:q,convertFile:function(t,r,i){return n(i,new Promise((function(n,i){e.readFile(t,r.encoding||"utf8",(function(e,o){e?i(e):(r.sourceFile=t,q(o,r).then((e=>n(e))).catch((e=>i(e))))}))})))},convertStream:function(e,t,r){return n(r,new Promise((function(n,r){let i="";e.on("data",(function(e){i+=e})).on("end",(function(){q(i,t).then((e=>n(e))).catch((e=>r(e)))}))})))}},swagger2openapi}var swagger2openapiExports=requireSwagger2openapi(),converter=getDefaultExportFromCjs(swagger2openapiExports),OASNormalize=class e{constructor(e,t){this.file=e,this.opts={colorizeErrors:!1,enablePaths:!1,...t},this.type=getType(this.file),this.cache={load:!1,bundle:!1,deref:!1}}async load(){if(this.cache.load)return this.cache.load;const e=e=>{const t=stringToJSON(e);return this.cache.load=t,t};switch(this.type){case"json":case"string-json":case"string-yaml":return e(this.file);case"buffer":return e(this.file.toString());case"url":return e(await fetch(normalizeURL(this.file)).then((e=>e.text())));case"path":if(!this.opts.enablePaths)throw new Error("Use `opts.enablePaths` to enable accessing local files.");const t=fs$6.readFileSync(this.file).toString();if(!t.trim())throw new Error("No file contents found.");return e(t);default:throw new Error("Could not load this file.")}}static async convertPostmanToOpenAPI(e){return postmanToOpenAPI(JSON.stringify(e),void 0,{outputFormat:"json",replaceVars:!0}).then(JSON.parse)}async bundle(){return this.cache.bundle?this.cache.bundle:this.load().then((t=>isPostman(t)?e.convertPostmanToOpenAPI(t):t)).then((e=>openapiParser.bundle(e))).then((e=>(this.cache.bundle=e,e)))}async deref(){return this.cache.deref?this.cache.deref:this.load().then((t=>isPostman(t)?e.convertPostmanToOpenAPI(t):t)).then((e=>openapiParser.dereference(e))).then((e=>(this.cache.deref=e,e)))}async convert(){return this.cache.convert?this.cache.convert:this.load().then((async t=>isPostman(t)?e.convertPostmanToOpenAPI(t):t)).then((async e=>{if(!isSwagger(e)&&!isOpenAPI(e))throw new Error("The supplied API definition is unsupported.");if(isOpenAPI(e))return e;if(1===parseInt(e.swagger,10))throw new Error("Swagger v1.2 is unsupported.");return converter.convertObj(e,{anchors:!0}).then((e=>e.openapi))}))}async validate(t={}){const n=t.parser||{};return n.validate||(n.validate={}),n.validate.colorizeErrors=this.opts.colorizeErrors,this.load().then((async t=>isPostman(t)?e.convertPostmanToOpenAPI(t):t)).then((async e=>{if(!isSwagger(e)&&!isOpenAPI(e))throw new Error("The supplied API definition is unsupported.");if(isSwagger(e)){if(1===parseInt(e.swagger,10))throw new Error("Swagger v1.2 is unsupported.")}const t=JSON.parse(JSON.stringify(e));return openapiParser.validate(t,n).then((()=>!0))}))}async version(){return this.load().then((e=>{switch(getAPIDefinitionType(e)){case"openapi":return{specification:"openapi",version:e.openapi};case"postman":let t="unknown";if(e?.info?.schema){const n=(e?.info).schema.match(/http(s?):\/\/schema.getpostman.com\/json\/collection\/v([0-9.]+)\//);n&&(t=n[2])}return{specification:"postman",version:t};case"swagger":return{specification:"swagger",version:e.swagger};default:throw new Error("Unknown file detected.")}}))}};const copyProperty=(e,t,n,r)=>{if("length"===n||"prototype"===n)return;if("arguments"===n||"caller"===n)return;const i=Object.getOwnPropertyDescriptor(e,n),o=Object.getOwnPropertyDescriptor(t,n);!canCopyProperty(i,o)&&r||Object.defineProperty(e,n,o)},canCopyProperty=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},changePrototype=(e,t)=>{const n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},wrappedToString=(e,t)=>`/* Wrapped ${e}*/\n${t}`,toStringDescriptor=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),toStringName=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),changeToString=(e,t,n)=>{const r=""===n?"":`with ${n.trim()}() `,i=wrappedToString.bind(null,r,t.toString());Object.defineProperty(i,"name",toStringName);const{writable:o,enumerable:s,configurable:a}=toStringDescriptor;Object.defineProperty(e,"toString",{value:i,writable:o,enumerable:s,configurable:a})};function mimicFunction(e,t,{ignoreNonConfigurable:n=!1}={}){const{name:r}=e;for(const r of Reflect.ownKeys(t))copyProperty(e,t,r,n);return changePrototype(e,t),changeToString(e,t,r),e}const calledFunctions=new WeakMap,onetime=(e,t={})=>{if("function"!=typeof e)throw new TypeError("Expected a function");let n,r=0;const i=e.displayName||e.name||"",o=function(...s){if(calledFunctions.set(o,++r),1===r)n=e.apply(this,s),e=void 0;else if(!0===t.throw)throw new Error(`Function \`${i}\` can only be called once`);return n};return mimicFunction(o,e),calledFunctions.set(o,r),o};onetime.callCount=e=>{if(!calledFunctions.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return calledFunctions.get(e)};const signals=[];signals.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&signals.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&signals.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const processOk=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,kExitEmitter=Symbol.for("signal-exit emitter"),global$1=globalThis,ObjectDefineProperty=Object.defineProperty.bind(Object);class Emitter{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(global$1[kExitEmitter])return global$1[kExitEmitter];ObjectDefineProperty(global$1,kExitEmitter,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const n=this.listeners[e],r=n.indexOf(t);-1!==r&&(0===r&&1===n.length?n.length=0:n.splice(r,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(const i of this.listeners[e])r=!0===i(t,n)||r;return"exit"===e&&(r=this.emit("afterExit",t,n)||r),r}}class SignalExitBase{}const signalExitWrap=e=>({onExit:(t,n)=>e.onExit(t,n),load:()=>e.load(),unload:()=>e.unload()});class SignalExitFallback extends SignalExitBase{onExit(){return()=>{}}load(){}unload(){}}class SignalExit extends SignalExitBase{#R="win32"===process$1.platform?"SIGINT":"SIGHUP";#F=new Emitter;#P;#N;#B;#O={};#q=!1;constructor(e){super(),this.#P=e,this.#O={};for(const t of signals)this.#O[t]=()=>{const n=this.#P.listeners(t);let{count:r}=this.#F;const i=e;if("object"==typeof i.__signal_exit_emitter__&&"number"==typeof i.__signal_exit_emitter__.count&&(r+=i.__signal_exit_emitter__.count),n.length===r){this.unload();const n=this.#F.emit("exit",null,t),r="SIGHUP"===t?this.#R:t;n||e.kill(e.pid,r)}};this.#B=e.reallyExit,this.#N=e.emit}onExit(e,t){if(!processOk(this.#P))return()=>{};!1===this.#q&&this.load();const n=t?.alwaysLast?"afterExit":"exit";return this.#F.on(n,e),()=>{this.#F.removeListener(n,e),0===this.#F.listeners.exit.length&&0===this.#F.listeners.afterExit.length&&this.unload()}}load(){if(!this.#q){this.#q=!0,this.#F.count+=1;for(const e of signals)try{const t=this.#O[e];t&&this.#P.on(e,t)}catch(e){}this.#P.emit=(e,...t)=>this.#$(e,...t),this.#P.reallyExit=e=>this.#Q(e)}}unload(){this.#q&&(this.#q=!1,signals.forEach((e=>{const t=this.#O[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#P.removeListener(e,t)}catch(e){}})),this.#P.emit=this.#N,this.#P.reallyExit=this.#B,this.#F.count-=1)}#Q(e){return processOk(this.#P)?(this.#P.exitCode=e||0,this.#F.emit("exit",this.#P.exitCode,null),this.#B.call(this.#P,this.#P.exitCode)):0}#$(e,...t){const n=this.#N;if("exit"===e&&processOk(this.#P)){"number"==typeof t[0]&&(this.#P.exitCode=t[0]);const r=n.call(this.#P,e,...t);return this.#F.emit("exit",this.#P.exitCode,null),r}return n.call(this.#P,e,...t)}}const process$1=globalThis.process,{onExit:onExit,load:load,unload:unload}=signalExitWrap(processOk(process$1)?new SignalExit(process$1):new SignalExitFallback),terminal=process$2.stderr.isTTY?process$2.stderr:process$2.stdout.isTTY?process$2.stdout:void 0,restoreCursor=terminal?onetime((()=>{onExit((()=>{terminal.write("[?25h")}),{alwaysLast:!0})})):()=>{};let isHidden=!1;const cliCursor={show:(e=process$2.stderr)=>{e.isTTY&&(isHidden=!1,e.write("[?25h"))},hide:(e=process$2.stderr)=>{e.isTTY&&(restoreCursor(),isHidden=!0,e.write("[?25l"))},toggle:(e,t)=>{void 0!==e&&(isHidden=e),isHidden?cliCursor.show(t):cliCursor.hide(t)}};var cliSpinnersExports=requireCliSpinners(),cliSpinners=getDefaultExportFromCjs(cliSpinnersExports);function isUnicodeSupported$1(){return"win32"!==process$2.platform?"linux"!==process$2.env.TERM:Boolean(process$2.env.CI)||Boolean(process$2.env.WT_SESSION)||Boolean(process$2.env.TERMINUS_SUBLIME)||"{cmd::Cmder}"===process$2.env.ConEmuTask||"Terminus-Sublime"===process$2.env.TERM_PROGRAM||"vscode"===process$2.env.TERM_PROGRAM||"xterm-256color"===process$2.env.TERM||"alacritty"===process$2.env.TERM||"JetBrains-JediTerm"===process$2.env.TERMINAL_EMULATOR}const main={info:chalk.blue("ℹ"),success:chalk.green("✔"),warning:chalk.yellow("⚠"),error:chalk.red("✖")},fallback={info:chalk.blue("i"),success:chalk.green("√"),warning:chalk.yellow("‼"),error:chalk.red("×")},logSymbols=isUnicodeSupported$1()?main:fallback;function ansiRegex({onlyFirst:e=!1}={}){const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}const regex=ansiRegex();function stripAnsi(e){if("string"!=typeof e)throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(regex,"")}function isAmbiguous(e){return 161===e||164===e||167===e||168===e||170===e||173===e||174===e||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||198===e||208===e||215===e||216===e||e>=222&&e<=225||230===e||e>=232&&e<=234||236===e||237===e||240===e||242===e||243===e||e>=247&&e<=250||252===e||254===e||257===e||273===e||275===e||283===e||294===e||295===e||299===e||e>=305&&e<=307||312===e||e>=319&&e<=322||324===e||e>=328&&e<=331||333===e||338===e||339===e||358===e||359===e||363===e||462===e||464===e||466===e||468===e||470===e||472===e||474===e||476===e||593===e||609===e||708===e||711===e||e>=713&&e<=715||717===e||720===e||e>=728&&e<=731||733===e||735===e||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||1025===e||e>=1040&&e<=1103||1105===e||8208===e||e>=8211&&e<=8214||8216===e||8217===e||8220===e||8221===e||e>=8224&&e<=8226||e>=8228&&e<=8231||8240===e||8242===e||8243===e||8245===e||8251===e||8254===e||8308===e||8319===e||e>=8321&&e<=8324||8364===e||8451===e||8453===e||8457===e||8467===e||8470===e||8481===e||8482===e||8486===e||8491===e||8531===e||8532===e||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||8585===e||e>=8592&&e<=8601||8632===e||8633===e||8658===e||8660===e||8679===e||8704===e||8706===e||8707===e||8711===e||8712===e||8715===e||8719===e||8721===e||8725===e||8730===e||e>=8733&&e<=8736||8739===e||8741===e||e>=8743&&e<=8748||8750===e||e>=8756&&e<=8759||8764===e||8765===e||8776===e||8780===e||8786===e||8800===e||8801===e||e>=8804&&e<=8807||8810===e||8811===e||8814===e||8815===e||8834===e||8835===e||8838===e||8839===e||8853===e||8857===e||8869===e||8895===e||8978===e||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||9632===e||9633===e||e>=9635&&e<=9641||9650===e||9651===e||9654===e||9655===e||9660===e||9661===e||9664===e||9665===e||e>=9670&&e<=9672||9675===e||e>=9678&&e<=9681||e>=9698&&e<=9701||9711===e||9733===e||9734===e||9737===e||9742===e||9743===e||9756===e||9758===e||9792===e||9794===e||9824===e||9825===e||e>=9827&&e<=9829||e>=9831&&e<=9834||9836===e||9837===e||9839===e||9886===e||9887===e||9919===e||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||9955===e||9960===e||9961===e||e>=9963&&e<=9969||9972===e||e>=9974&&e<=9977||9979===e||9980===e||9982===e||9983===e||10045===e||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||65533===e||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||127375===e||127376===e||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function isFullWidth(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}function isWide(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function validate(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function eastAsianWidth(e,{ambiguousAsWide:t=!1}={}){return validate(e),isFullWidth(e)||isWide(e)||t&&isAmbiguous(e)?2:1}var emojiRegex=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;const segmenter=new Intl.Segmenter,defaultIgnorableCodePointRegex=/^\p{Default_Ignorable_Code_Point}$/u;function stringWidth(e,t={}){if("string"!=typeof e||0===e.length)return 0;const{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=stripAnsi(e)),0===e.length)return 0;let i=0;const o={ambiguousAsWide:!n};for(const{segment:t}of segmenter.segment(e)){const e=t.codePointAt(0);e<=31||e>=127&&e<=159||(e>=8203&&e<=8207||65279===e||e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=55296&&e<=57343||e>=65024&&e<=65039||defaultIgnorableCodePointRegex.test(t)||(emojiRegex().test(t)?i+=2:i+=eastAsianWidth(e,o)))}return i}function isInteractive({stream:e=process.stdout}={}){return Boolean(e&&e.isTTY&&"dumb"!==process.env.TERM&&!("CI"in process.env))}function isUnicodeSupported(){const{env:e}=process$2,{TERM:t,TERM_PROGRAM:n}=e;return"win32"!==process$2.platform?"linux"!==t:Boolean(e.WT_SESSION)||Boolean(e.TERMINUS_SUBLIME)||"{cmd::Cmder}"===e.ConEmuTask||"Terminus-Sublime"===n||"vscode"===n||"xterm-256color"===t||"alacritty"===t||"rxvt-unicode"===t||"rxvt-unicode-256color"===t||"JetBrains-JediTerm"===e.TERMINAL_EMULATOR}const ASCII_ETX_CODE=3;class StdinDiscarder{#L=0;start(){this.#L++,1===this.#L&&this.#M()}stop(){if(this.#L<=0)throw new Error("`stop` called more times than `start`");this.#L--,0===this.#L&&this.#j()}#M(){"win32"!==process$2.platform&&process$2.stdin.isTTY&&(process$2.stdin.setRawMode(!0),process$2.stdin.on("data",this.#U),process$2.stdin.resume())}#j(){process$2.stdin.isTTY&&(process$2.stdin.off("data",this.#U),process$2.stdin.pause(),process$2.stdin.setRawMode(!1))}#U(e){e[0]===ASCII_ETX_CODE&&process$2.emit("SIGINT")}}const stdinDiscarder=new StdinDiscarder;class Ora{#J=0;#V=!1;#H=0;#G=-1;#W=0;#c;#z;#Y;#K;#X;#Z;#ee;#te;#ne;#re;#ie;color;constructor(e){"string"==typeof e&&(e={text:e}),this.#c={color:"cyan",stream:process$2.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#c.color,this.spinner=this.#c.spinner,this.#X=this.#c.interval,this.#Y=this.#c.stream,this.#Z="boolean"==typeof this.#c.isEnabled?this.#c.isEnabled:isInteractive({stream:this.#Y}),this.#ee="boolean"==typeof this.#c.isSilent&&this.#c.isSilent,this.text=this.#c.text,this.prefixText=this.#c.prefixText,this.suffixText=this.#c.suffixText,this.indent=this.#c.indent,"test"===process$2.env.NODE_ENV&&(this._stream=this.#Y,this._isEnabled=this.#Z,Object.defineProperty(this,"_linesToClear",{get(){return this.#J},set(e){this.#J=e}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#G}}),Object.defineProperty(this,"_lineCount",{get(){return this.#H}}))}get indent(){return this.#te}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#te=e,this.#oe()}get interval(){return this.#X??this.#z.interval??100}get spinner(){return this.#z}set spinner(e){if(this.#G=-1,this.#X=void 0,"object"==typeof e){if(void 0===e.frames)throw new Error("The given spinner must have a `frames` property");this.#z=e}else if(isUnicodeSupported())if(void 0===e)this.#z=cliSpinners.dots;else{if("default"===e||!cliSpinners[e])throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);this.#z=cliSpinners[e]}else this.#z=cliSpinners.line}get text(){return this.#ne}set text(e=""){this.#ne=e,this.#oe()}get prefixText(){return this.#re}set prefixText(e=""){this.#re=e,this.#oe()}get suffixText(){return this.#ie}set suffixText(e=""){this.#ie=e,this.#oe()}get isSpinning(){return void 0!==this.#K}#se(e=this.#re,t=" "){return"string"==typeof e&&""!==e?e+t:"function"==typeof e?e()+t:""}#ae(e=this.#ie,t=" "){return"string"==typeof e&&""!==e?t+e:"function"==typeof e?t+e():""}#oe(){const e=this.#Y.columns??80,t=this.#se(this.#re,"-"),n=this.#ae(this.#ie,"-"),r=" ".repeat(this.#te)+t+"--"+this.#ne+"--"+n;this.#H=0;for(const t of stripAnsi(r).split("\n"))this.#H+=Math.max(1,Math.ceil(stringWidth(t,{countAnsiEscapeCodes:!0})/e))}get isEnabled(){return this.#Z&&!this.#ee}set isEnabled(e){if("boolean"!=typeof e)throw new TypeError("The `isEnabled` option must be a boolean");this.#Z=e}get isSilent(){return this.#ee}set isSilent(e){if("boolean"!=typeof e)throw new TypeError("The `isSilent` option must be a boolean");this.#ee=e}frame(){const e=Date.now();(-1===this.#G||e-this.#W>=this.interval)&&(this.#G=++this.#G%this.#z.frames.length,this.#W=e);const{frames:t}=this.#z;let n=t[this.#G];this.color&&(n=chalk[this.color](n));return("string"==typeof this.#re&&""!==this.#re?this.#re+" ":"")+n+("string"==typeof this.text?" "+this.text:"")+("string"==typeof this.#ie&&""!==this.#ie?" "+this.#ie:"")}clear(){if(!this.#Z||!this.#Y.isTTY)return this;this.#Y.cursorTo(0);for(let e=0;e0&&this.#Y.moveCursor(0,-1),this.#Y.clearLine(1);return(this.#te||this.lastIndent!==this.#te)&&this.#Y.cursorTo(this.#te),this.lastIndent=this.#te,this.#J=0,this}render(){return this.#ee||(this.clear(),this.#Y.write(this.frame()),this.#J=this.#H),this}start(e){return e&&(this.text=e),this.#ee?this:this.#Z?(this.isSpinning||(this.#c.hideCursor&&cliCursor.hide(this.#Y),this.#c.discardStdin&&process$2.stdin.isTTY&&(this.#V=!0,stdinDiscarder.start()),this.render(),this.#K=setInterval(this.render.bind(this),this.interval)),this):(this.text&&this.#Y.write(`- ${this.text}\n`),this)}stop(){return this.#Z?(clearInterval(this.#K),this.#K=void 0,this.#G=0,this.clear(),this.#c.hideCursor&&cliCursor.show(this.#Y),this.#c.discardStdin&&process$2.stdin.isTTY&&this.#V&&(stdinDiscarder.stop(),this.#V=!1),this):this}succeed(e){return this.stopAndPersist({symbol:logSymbols.success,text:e})}fail(e){return this.stopAndPersist({symbol:logSymbols.error,text:e})}warn(e){return this.stopAndPersist({symbol:logSymbols.warning,text:e})}info(e){return this.stopAndPersist({symbol:logSymbols.info,text:e})}stopAndPersist(e={}){if(this.#ee)return this;const t=e.prefixText??this.#re,n=this.#se(t," "),r=e.symbol??" ",i=e.text??this.text,o="string"==typeof i?(r?" ":"")+i:"",s=e.suffixText??this.#ie,a=n+r+o+this.#ae(s," ")+"\n";return this.stop(),this.#Y.write(a),this}}function ora(e){return new Ora(e)}function truthy(e){return!!e}const capitalizeSpecType=e=>"openapi"===e?"OpenAPI":e.charAt(0).toUpperCase()+e.slice(1);async function prepareOas(e,t,n={}){let r=e;if(!r){const e=ora({text:"Looking for API definitions...",...oraOptions()}).start();let n;if("openapi"===t)n="upload";else n=t.split(" ")[1];const i=readdirRecursive(".",!0).filter((e=>e.toLowerCase().endsWith(".json")||e.toLowerCase().endsWith(".yaml")||e.toLowerCase().endsWith(".yml")));debug(`number of JSON or YAML files found: ${i.length}`);const o=(await Promise.all(i.map((e=>{debug(`attempting to oas-normalize ${e}`);return new OASNormalize(e,{enablePaths:!0}).version().then((({specification:t,version:n})=>(debug(`specification type for ${e}: ${t}`),debug(`version for ${e}: ${n}`),["openapi","swagger","postman"].includes(t)?{filePath:e,specType:capitalizeSpecType(t),version:n}:null))).catch((t=>(debug(`error extracting API definition specification version for ${e}: ${t.message}`),null)))})))).filter(truthy);if(debug(`number of possible OpenAPI/Swagger files found: ${o.length}`),!o.length)throw e.fail(),new Error(`We couldn't find an OpenAPI or Swagger definition.\n\nPlease specify the path to your definition with \`rdme ${t} ./path/to/api/definition\`.`);if(r=o[0].filePath,1===o.length)e.stop(),info(chalk.yellow(`We found ${r} and are attempting to ${n} it.`));else if(o.length>1){if(isCI())throw e.fail(),new Error("Multiple API definitions found in current directory. Please specify file.");e.stop();const t=await promptTerminal({name:"file",message:`Multiple potential API definitions found! Which one would you like to ${n}?`,type:"select",choices:o.map((e=>({title:e.filePath,value:e.filePath,description:`${e.specType} ${e.version}`})))});r=t.file}}const i=ora({text:`Validating the API definition located at ${r}...`,...oraOptions()}).start();debug(`about to normalize spec located at ${r}`);const o=new OASNormalize(r,{colorizeErrors:!0,enablePaths:!0});debug("spec normalized");const{specType:s,definitionVersion:a}=await o.load().then((async e=>{const t=getAPIDefinitionType(e);return{specType:capitalizeSpecType(t),definitionVersion:await o.version()}})).catch((e=>{throw i.fail(),debug(`raw oas load error object: ${JSON.stringify(e)}`),e}));let c;await o.validate().catch((e=>{throw i.fail(),debug(`raw validation error object: ${JSON.stringify(e)}`),e})),debug("converting the spec to OpenAPI 3.0 (if necessary)"),c=await o.convert().catch((e=>{throw i.fail(),debug(`raw openapi conversion error object: ${JSON.stringify(e)}`),e})),i.stop(),debug("👇👇👇👇👇 spec validated! logging spec below 👇👇👇👇👇"),debug(c),debug("👆👆👆👆👆 finished logging spec 👆👆👆👆👆"),debug(`spec type: ${s}`),n.title&&(debug(`renaming title field to ${n.title}`),c.info.title=n.title);const u=o.type,l=c.info.version;return debug(`version in spec: ${l}`),["openapi","openapi inspect","openapi reduce"].includes(t)&&(c=await o.bundle(),debug("spec bundled")),{preparedSpec:JSON.stringify(c),specFileType:u,specPath:r,specType:s,specVersion:l,definitionVersion:a}}class OpenAPIConvertCommand extends BaseCommand{static summary="Converts an API definition to OpenAPI and bundles any external references.";static description="Converts Swagger files and Postman collections to OpenAPI and bundles any external references. **Note**: All of our other OpenAPI commands already do this conversion automatically, but this command is available in case you need this functionality exclusively.";static args={spec:specArg};static flags={out:libExports$3.Flags.string({description:"Output file path to write converted file to"}),title:titleFlag,workingDirectory:workingDirectoryFlag};static examples=[{description:"By default, this command will display a comprehensive table of all OpenAPI and ReadMe features found in your API definition:",command:"<%= config.bin %> <%= command.id %> [url-or-local-path-to-file]"},{description:"You can omit the file name and `rdme` will scan your working directory (and any subdirectories) for OpenAPI/Swagger files. This approach will provide you with CLI prompts, so we do not recommend this technique in CI environments.",command:"<%= config.bin %> <%= command.id %>"}];async run(){const{spec:e}=this.args,{out:t,title:n,workingDirectory:r}=this.flags;if(r){const e=process.cwd();process.chdir(r),this.debug(`switching working directory from ${e} to ${process.cwd()}`)}const{preparedSpec:i,specPath:o,specType:s}=await prepareOas(e,"openapi convert",{title:n}),a=JSON.parse(i);"OpenAPI"===s&&warn("The input file is already OpenAPI, so no conversion is necessary. Any external references will be bundled."),prompts.override({outputPath:t});const c=await promptTerminal([{type:"text",name:"outputPath",message:"Enter the path to save your converted/bundled API definition to:",initial:()=>{const e=path$1.extname(o);return`${path$1.basename(o).split(e)[0]}.openapi${e}`},validate:e=>validateFilePath(e)}]);return this.debug(`saving converted/bundled spec to ${c.outputPath}`),fs$6.writeFileSync(c.outputPath,JSON.stringify(a,null,2)),this.debug("converted/bundled spec saved"),Promise.resolve(chalk.green(`Your API definition has been converted and bundled and saved to ${c.outputPath}!`))}}var src$2={},createStream={},alignTableData={},alignString={},utils={},astralRegex_1,hasRequiredAstralRegex,sliceAnsi,hasRequiredSliceAnsi;function requireAstralRegex(){if(hasRequiredAstralRegex)return astralRegex_1;hasRequiredAstralRegex=1;const e="[\ud800-\udbff][\udc00-\udfff]";return astralRegex_1=t=>t&&t.exact?new RegExp(`^${e}$`):new RegExp(e,"g"),astralRegex_1}function requireSliceAnsi(){if(hasRequiredSliceAnsi)return sliceAnsi;hasRequiredSliceAnsi=1;const e=requireIsFullwidthCodePoint(),t=requireAstralRegex(),n=requireAnsiStyles(),r=["","›"],i=e=>`${r[0]}[${e}m`,o=(e,t,r)=>{let o=[];e=[...e];for(let r of e){const s=r;r.includes(";")&&(r=r.split(";")[0][0]+"0");const a=n.codes.get(Number.parseInt(r,10));if(a){const n=e.indexOf(a.toString());-1===n?o.push(i(t?a:s)):e.splice(n,1)}else{if(t){o.push(i(0));break}o.push(i(s))}}if(t&&(o=o.filter(((e,t)=>o.indexOf(e)===t)),void 0!==r)){const e=i(n.codes.get(Number.parseInt(r,10)));o=o.reduce(((t,n)=>n===e?[n,...t]:[...t,n]),[])}return o.join("")};return sliceAnsi=(n,i,s)=>{const a=[...n],c=[];let u,l="number"==typeof s?s:a.length,d=!1,p=0,f="";for(const[_,m]of a.entries()){let a=!1;if(r.includes(m)){const e=/\d[^m]*/.exec(n.slice(_,_+18));u=e&&e.length>0?e[0]:void 0,pi&&p<=l)f+=m;else if(p!==i||d||void 0===u){if(p>=l){f+=o(c,!0,u);break}}else f=o(c)}return f},sliceAnsi}var getBorderCharacters={},hasRequiredGetBorderCharacters,hasRequiredUtils,hasRequiredAlignString,hasRequiredAlignTableData;function requireGetBorderCharacters(){if(hasRequiredGetBorderCharacters)return getBorderCharacters;hasRequiredGetBorderCharacters=1,Object.defineProperty(getBorderCharacters,"__esModule",{value:!0}),getBorderCharacters.getBorderCharacters=void 0;return getBorderCharacters.getBorderCharacters=e=>{if("honeywell"===e)return{topBody:"═",topJoin:"╤",topLeft:"╔",topRight:"╗",bottomBody:"═",bottomJoin:"╧",bottomLeft:"╚",bottomRight:"╝",bodyLeft:"║",bodyRight:"║",bodyJoin:"│",headerJoin:"┬",joinBody:"─",joinLeft:"╟",joinRight:"╢",joinJoin:"┼",joinMiddleDown:"┬",joinMiddleUp:"┴",joinMiddleLeft:"┤",joinMiddleRight:"├"};if("norc"===e)return{topBody:"─",topJoin:"┬",topLeft:"┌",topRight:"┐",bottomBody:"─",bottomJoin:"┴",bottomLeft:"└",bottomRight:"┘",bodyLeft:"│",bodyRight:"│",bodyJoin:"│",headerJoin:"┬",joinBody:"─",joinLeft:"├",joinRight:"┤",joinJoin:"┼",joinMiddleDown:"┬",joinMiddleUp:"┴",joinMiddleLeft:"┤",joinMiddleRight:"├"};if("ramac"===e)return{topBody:"-",topJoin:"+",topLeft:"+",topRight:"+",bottomBody:"-",bottomJoin:"+",bottomLeft:"+",bottomRight:"+",bodyLeft:"|",bodyRight:"|",bodyJoin:"|",headerJoin:"+",joinBody:"-",joinLeft:"|",joinRight:"|",joinJoin:"|",joinMiddleDown:"+",joinMiddleUp:"+",joinMiddleLeft:"+",joinMiddleRight:"+"};if("void"===e)return{topBody:"",topJoin:"",topLeft:"",topRight:"",bottomBody:"",bottomJoin:"",bottomLeft:"",bottomRight:"",bodyLeft:"",bodyRight:"",bodyJoin:"",headerJoin:"",joinBody:"",joinLeft:"",joinRight:"",joinJoin:"",joinMiddleDown:"",joinMiddleUp:"",joinMiddleLeft:"",joinMiddleRight:""};throw new Error('Unknown border template "'+e+'".')},getBorderCharacters}function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1;var e=utils.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(utils,"__esModule",{value:!0}),utils.isCellInRange=utils.areCellEqual=utils.calculateRangeCoordinate=utils.flatten=utils.extractTruncates=utils.sumArray=utils.sequence=utils.distributeUnevenly=utils.countSpaceSequence=utils.groupBySizes=utils.makeBorderConfig=utils.splitAnsi=utils.normalizeString=void 0;const t=e(requireSliceAnsi()),n=e(requireStringWidth()),r=e(requireStripAnsi()),i=requireGetBorderCharacters();utils.normalizeString=e=>e.replace(/\r\n/g,"\n");utils.splitAnsi=e=>{const i=(0,r.default)(e).split("\n").map(n.default),o=[];let s=0;return i.forEach((n=>{o.push(0===n?"":(0,t.default)(e,s,s+n)),s+=n+1})),o};utils.makeBorderConfig=e=>({...(0,i.getBorderCharacters)("honeywell"),...e});utils.groupBySizes=(e,t)=>{let n=0;return t.map((t=>{const r=e.slice(n,n+t);return n+=t,r}))};utils.countSpaceSequence=e=>{var t,n;return null!==(n=null===(t=e.match(/\s+/g))||void 0===t?void 0:t.length)&&void 0!==n?n:0};utils.distributeUnevenly=(e,t)=>Array.from({length:t}).fill(Math.floor(e/t)).map(((n,r)=>n+(rArray.from({length:t-e+1},((t,n)=>n+e));utils.sumArray=e=>e.reduce(((e,t)=>e+t),0);utils.extractTruncates=e=>e.columns.map((({truncate:e})=>e));utils.flatten=e=>[].concat(...e);utils.calculateRangeCoordinate=e=>{const{row:t,col:n,colSpan:r=1,rowSpan:i=1}=e;return{bottomRight:{col:n+r-1,row:t+i-1},topLeft:{col:n,row:t}}};utils.areCellEqual=(e,t)=>e.row===t.row&&e.col===t.col;return utils.isCellInRange=(e,{topLeft:t,bottomRight:n})=>t.row<=e.row&&e.row<=n.row&&t.col<=e.col&&e.col<=n.col,utils}function requireAlignString(){if(hasRequiredAlignString)return alignString;hasRequiredAlignString=1;var e=alignString.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(alignString,"__esModule",{value:!0}),alignString.alignString=void 0;const t=e(requireStringWidth()),n=requireUtils(),r=(e,t)=>e+" ".repeat(t);return alignString.alignString=(e,i,o)=>{const s=(0,t.default)(e);if(s===i)return e;if(s>i)throw new Error("Subject parameter value width cannot be greater than the container width.");if(0===s)return" ".repeat(i);const a=i-s;return"left"===o?r(e,a):"right"===o?((e,t)=>" ".repeat(t)+e)(e,a):"justify"===o?((e,t)=>{const i=(0,n.countSpaceSequence)(e);if(0===i)return r(e,t);const o=(0,n.distributeUnevenly)(t,i);if(Math.max(...o)>3)return r(e,t);let s=0;return e.replace(/\s+/g,(e=>e+" ".repeat(o[s++])))})(e,a):((e,t)=>" ".repeat(Math.floor(t/2))+e+" ".repeat(Math.ceil(t/2)))(e,a)},alignString}function requireAlignTableData(){if(hasRequiredAlignTableData)return alignTableData;hasRequiredAlignTableData=1,Object.defineProperty(alignTableData,"__esModule",{value:!0}),alignTableData.alignTableData=void 0;const e=requireAlignString();return alignTableData.alignTableData=(t,n)=>t.map(((t,r)=>t.map(((t,i)=>{var o;const{width:s,alignment:a}=n.columns[i];return(null===(o=n.spanningCellManager)||void 0===o?void 0:o.getContainingRange({col:i,row:r},{mapped:!0}))?t:(0,e.alignString)(t,s,a)})))),alignTableData}var calculateRowHeights={},calculateCellHeight={},wrapCell={},wrapString={},hasRequiredWrapString;function requireWrapString(){if(hasRequiredWrapString)return wrapString;hasRequiredWrapString=1;var e=wrapString.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wrapString,"__esModule",{value:!0}),wrapString.wrapString=void 0;const t=e(requireSliceAnsi()),n=e(requireStringWidth());return wrapString.wrapString=(e,r)=>{let i=e;const o=[];do{o.push((0,t.default)(i,0,r)),i=(0,t.default)(i,r).trim()}while((0,n.default)(i));return o},wrapString}var wrapWord={},hasRequiredWrapWord,hasRequiredWrapCell,hasRequiredCalculateCellHeight,hasRequiredCalculateRowHeights;function requireWrapWord(){if(hasRequiredWrapWord)return wrapWord;hasRequiredWrapWord=1;var e=wrapWord.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wrapWord,"__esModule",{value:!0}),wrapWord.wrapWord=void 0;const t=e(requireSliceAnsi()),n=e(requireStripAnsi());return wrapWord.wrapWord=(e,r)=>{const i=[];let o=0;return((e,t)=>{let r=(0,n.default)(e);const i=[],o=new RegExp("(^.{1,"+String(Math.max(t,1))+"}(\\s+|$))|(^.{1,"+String(Math.max(t-1,1))+"}(\\\\|/|_|\\.|,|;|-))");do{let e;const n=o.exec(r);if(n){e=n[0],r=r.slice(e.length);const t=e.trim().length,o=e.length-t;i.push([t,o])}else e=r.slice(0,t),r=r.slice(t),i.push([e.length,0])}while(r.length);return i})(e,r).forEach((([n,r])=>{i.push((0,t.default)(e,o,o+n)),o+=n+r})),i},wrapWord}function requireWrapCell(){if(hasRequiredWrapCell)return wrapCell;hasRequiredWrapCell=1,Object.defineProperty(wrapCell,"__esModule",{value:!0}),wrapCell.wrapCell=void 0;const e=requireUtils(),t=requireWrapString(),n=requireWrapWord();return wrapCell.wrapCell=(r,i,o)=>{const s=(0,e.splitAnsi)(r);for(let e=0;e(0,e.wrapCell)(t,n,r).length,calculateCellHeight}function requireCalculateRowHeights(){if(hasRequiredCalculateRowHeights)return calculateRowHeights;hasRequiredCalculateRowHeights=1,Object.defineProperty(calculateRowHeights,"__esModule",{value:!0}),calculateRowHeights.calculateRowHeights=void 0;const e=requireCalculateCellHeight(),t=requireUtils();return calculateRowHeights.calculateRowHeights=(n,r)=>{const i=[];for(const[o,s]of n.entries()){let a=1;s.forEach(((s,c)=>{var u;const l=null===(u=r.spanningCellManager)||void 0===u?void 0:u.getContainingRange({col:c,row:o});if(!l){const t=(0,e.calculateCellHeight)(s,r.columns[c].width,r.columns[c].wrapWord);return void(a=Math.max(a,t))}const{topLeft:d,bottomRight:p,height:f}=l;if(o===p.row){const e=(0,t.sumArray)(i.slice(d.row)),o=p.row-d.row,s=(0,t.sequence)(d.row+1,p.row).filter((e=>{var t;return!(null===(t=r.drawHorizontalLine)||void 0===t?void 0:t.call(r,e,n.length))})).length,c=f-e-o+s;a=Math.max(a,c)}})),i.push(a)}return i},calculateRowHeights}var drawBorder={},drawContent={},hasRequiredDrawContent,hasRequiredDrawBorder;function requireDrawContent(){if(hasRequiredDrawContent)return drawContent;hasRequiredDrawContent=1,Object.defineProperty(drawContent,"__esModule",{value:!0}),drawContent.drawContent=void 0;return drawContent.drawContent=e=>{const{contents:t,separatorGetter:n,drawSeparator:r,spanningCellManager:i,rowIndex:o,elementType:s}=e,a=t.length,c=[];return r(0,a)&&c.push(n(0,a)),t.forEach(((e,t)=>{if(s&&"border"!==s&&"row"!==s||c.push(e),"cell"===s&&void 0===o&&c.push(e),"cell"===s&&void 0!==o){const n=null==i?void 0:i.getContainingRange({col:t,row:o});n&&t!==n.topLeft.col||c.push(e)}if(t+1{const{separator:n,horizontalBorderIndex:r,spanningCellManager:i}=t;return e.map(((e,t)=>{const o=n.body.repeat(e);if(void 0===r)return o;const s=null==i?void 0:i.getContainingRange({col:t,row:r});if(!s)return o;const{topLeft:a}=s;return r===a.row?o:t!==a.col?"":s.extractBorderContent(r)}))};e.createSeparatorGetter=e=>{const{separator:t,spanningCellManager:n,horizontalBorderIndex:r,rowCount:i}=e;return(e,o)=>{const s=null==n?void 0:n.inSameRange;if(void 0!==r&&s){const n={col:e,row:r-1},a={col:e-1,row:r},c={col:e-1,row:r-1},u={col:e,row:r},l=[[c,n],[n,u],[u,a],[a,c]];if(0===e)return s(u,n)&&t.bodyJoinOuter?t.bodyJoinOuter:t.left;if(e===o)return s(c,a)&&t.bodyJoinOuter?t.bodyJoinOuter:t.right;if(0===r)return s(u,a)?t.body:t.join;if(r===i)return s(n,c)?t.body:t.join;const d=l.map((e=>s(...e))).filter(Boolean).length;if(0===d)return t.join;if(4===d)return"";if(2===d)return s(...l[1])&&s(...l[3])&&t.bodyJoinInner?t.bodyJoinInner:t.body;if(1===d){if(!(t.joinRight&&t.joinLeft&&t.joinUp&&t.joinDown))throw new Error(`Can not get border separator for position [${r}, ${e}]`);return s(...l[0])?t.joinDown:s(...l[1])?t.joinLeft:s(...l[2])?t.joinUp:t.joinRight}throw new Error("Invalid case")}return 0===e?t.left:e===o?t.right:t.join}};e.drawBorder=(n,r)=>{const i=(0,e.drawBorderSegments)(n,r),{drawVerticalLine:o,horizontalBorderIndex:s,spanningCellManager:a}=r;return(0,t.drawContent)({contents:i,drawSeparator:o,elementType:"border",rowIndex:s,separatorGetter:(0,e.createSeparatorGetter)(r),spanningCellManager:a})+"\n"};e.drawBorderTop=(t,n)=>{const{border:r}=n,i=(0,e.drawBorder)(t,{...n,separator:{body:r.topBody,join:r.topJoin,left:r.topLeft,right:r.topRight}});return"\n"===i?"":i};e.drawBorderJoin=(t,n)=>{const{border:r}=n;return(0,e.drawBorder)(t,{...n,separator:{body:r.joinBody,bodyJoinInner:r.bodyJoin,bodyJoinOuter:r.bodyLeft,join:r.joinJoin,joinDown:r.joinMiddleDown,joinLeft:r.joinMiddleLeft,joinRight:r.joinMiddleRight,joinUp:r.joinMiddleUp,left:r.joinLeft,right:r.joinRight}})};e.drawBorderBottom=(t,n)=>{const{border:r}=n;return(0,e.drawBorder)(t,{...n,separator:{body:r.bottomBody,join:r.bottomJoin,left:r.bottomLeft,right:r.bottomRight}})};e.createTableBorderGetter=(t,n)=>(r,i)=>{const o={...n,horizontalBorderIndex:r};return 0===r?(0,e.drawBorderTop)(t,o):r===i?(0,e.drawBorderBottom)(t,o):(0,e.drawBorderJoin)(t,o)}}(drawBorder)),drawBorder}var drawRow={},hasRequiredDrawRow;function requireDrawRow(){if(hasRequiredDrawRow)return drawRow;hasRequiredDrawRow=1,Object.defineProperty(drawRow,"__esModule",{value:!0}),drawRow.drawRow=void 0;const e=requireDrawContent();return drawRow.drawRow=(t,n)=>{const{border:r,drawVerticalLine:i,rowIndex:o,spanningCellManager:s}=n;return(0,e.drawContent)({contents:t,drawSeparator:i,elementType:"cell",rowIndex:o,separatorGetter:(e,t)=>0===e?r.bodyLeft:e===t?r.bodyRight:r.bodyJoin,spanningCellManager:s})+"\n"},drawRow}var makeStreamConfig={},validateConfig={},validators={},hasRequiredValidators,hasRequiredValidateConfig,hasRequiredMakeStreamConfig;function requireValidators(){return hasRequiredValidators||(hasRequiredValidators=1,function(e){e["config.json"]=function e(n,{instancePath:i="",parentData:s,parentDataProperty:c,rootData:u=n}={}){let l=null,d=0;if(n&&"object"==typeof n&&!Array.isArray(n)){for(const e in n)if("border"!==e&&"header"!==e&&"columns"!==e&&"columnDefault"!==e&&"drawVerticalLine"!==e&&"drawHorizontalLine"!==e&&"singleLine"!==e&&"spanningCells"!==e){const t={instancePath:i,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:e},message:"must NOT have additional properties"};null===l?l=[t]:l.push(t),d++}if(void 0!==n.border&&(o(n.border,{instancePath:i+"/border",parentData:n,parentDataProperty:"border",rootData:u})||(l=null===l?o.errors:l.concat(o.errors),d=l.length)),void 0!==n.header){let e=n.header;if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.content){const e={instancePath:i+"/header",schemaPath:"#/properties/header/required",keyword:"required",params:{missingProperty:"content"},message:"must have required property 'content'"};null===l?l=[e]:l.push(e),d++}for(const t in e)if("content"!==t&&"alignment"!==t&&"wrapWord"!==t&&"truncate"!==t&&"paddingLeft"!==t&&"paddingRight"!==t){const e={instancePath:i+"/header",schemaPath:"#/properties/header/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:t},message:"must NOT have additional properties"};null===l?l=[e]:l.push(e),d++}if(void 0!==e.content&&"string"!=typeof e.content){const e={instancePath:i+"/header/content",schemaPath:"#/properties/header/properties/content/type",keyword:"type",params:{type:"string"},message:"must be string"};null===l?l=[e]:l.push(e),d++}if(void 0!==e.alignment&&(a(e.alignment,{instancePath:i+"/header/alignment",parentData:e,parentDataProperty:"alignment",rootData:u})||(l=null===l?a.errors:l.concat(a.errors),d=l.length)),void 0!==e.wrapWord&&"boolean"!=typeof e.wrapWord){const e={instancePath:i+"/header/wrapWord",schemaPath:"#/properties/header/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===l?l=[e]:l.push(e),d++}if(void 0!==e.truncate){let t=e.truncate;if("number"!=typeof t||t%1||isNaN(t)||!isFinite(t)){const e={instancePath:i+"/header/truncate",schemaPath:"#/properties/header/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),d++}}if(void 0!==e.paddingLeft){let t=e.paddingLeft;if("number"!=typeof t||t%1||isNaN(t)||!isFinite(t)){const e={instancePath:i+"/header/paddingLeft",schemaPath:"#/properties/header/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),d++}}if(void 0!==e.paddingRight){let t=e.paddingRight;if("number"!=typeof t||t%1||isNaN(t)||!isFinite(t)){const e={instancePath:i+"/header/paddingRight",schemaPath:"#/properties/header/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),d++}}}else{const e={instancePath:i+"/header",schemaPath:"#/properties/header/type",keyword:"type",params:{type:"object"},message:"must be object"};null===l?l=[e]:l.push(e),d++}}if(void 0!==n.columns&&(f(n.columns,{instancePath:i+"/columns",parentData:n,parentDataProperty:"columns",rootData:u})||(l=null===l?f.errors:l.concat(f.errors),d=l.length)),void 0!==n.columnDefault&&(_(n.columnDefault,{instancePath:i+"/columnDefault",parentData:n,parentDataProperty:"columnDefault",rootData:u})||(l=null===l?_.errors:l.concat(_.errors),d=l.length)),void 0!==n.drawVerticalLine&&"function"!=typeof n.drawVerticalLine){const e={instancePath:i+"/drawVerticalLine",schemaPath:"#/properties/drawVerticalLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};null===l?l=[e]:l.push(e),d++}if(void 0!==n.drawHorizontalLine&&"function"!=typeof n.drawHorizontalLine){const e={instancePath:i+"/drawHorizontalLine",schemaPath:"#/properties/drawHorizontalLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};null===l?l=[e]:l.push(e),d++}if(void 0!==n.singleLine&&"boolean"!=typeof n.singleLine){const e={instancePath:i+"/singleLine",schemaPath:"#/properties/singleLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};null===l?l=[e]:l.push(e),d++}if(void 0!==n.spanningCells){let e=n.spanningCells;if(Array.isArray(e)){const n=e.length;for(let o=0;o=",limit:0},message:"must be >= 0"};null===l?l=[e]:l.push(e),d++}}if(void 0!==n.row){let e=n.row;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:i+"/spanningCells/"+o+"/row",schemaPath:"#/properties/spanningCells/items/properties/row/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),d++}if("number"==typeof e&&isFinite(e)&&(e<0||isNaN(e))){const e={instancePath:i+"/spanningCells/"+o+"/row",schemaPath:"#/properties/spanningCells/items/properties/row/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};null===l?l=[e]:l.push(e),d++}}if(void 0!==n.colSpan){let e=n.colSpan;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:i+"/spanningCells/"+o+"/colSpan",schemaPath:"#/properties/spanningCells/items/properties/colSpan/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),d++}if("number"==typeof e&&isFinite(e)&&(e<1||isNaN(e))){const e={instancePath:i+"/spanningCells/"+o+"/colSpan",schemaPath:"#/properties/spanningCells/items/properties/colSpan/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};null===l?l=[e]:l.push(e),d++}}if(void 0!==n.rowSpan){let e=n.rowSpan;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:i+"/spanningCells/"+o+"/rowSpan",schemaPath:"#/properties/spanningCells/items/properties/rowSpan/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),d++}if("number"==typeof e&&isFinite(e)&&(e<1||isNaN(e))){const e={instancePath:i+"/spanningCells/"+o+"/rowSpan",schemaPath:"#/properties/spanningCells/items/properties/rowSpan/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};null===l?l=[e]:l.push(e),d++}}if(void 0!==n.alignment&&(a(n.alignment,{instancePath:i+"/spanningCells/"+o+"/alignment",parentData:n,parentDataProperty:"alignment",rootData:u})||(l=null===l?a.errors:l.concat(a.errors),d=l.length)),void 0!==n.verticalAlignment&&(m(n.verticalAlignment,{instancePath:i+"/spanningCells/"+o+"/verticalAlignment",parentData:n,parentDataProperty:"verticalAlignment",rootData:u})||(l=null===l?m.errors:l.concat(m.errors),d=l.length)),void 0!==n.wrapWord&&"boolean"!=typeof n.wrapWord){const e={instancePath:i+"/spanningCells/"+o+"/wrapWord",schemaPath:"#/properties/spanningCells/items/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===l?l=[e]:l.push(e),d++}if(void 0!==n.truncate){let e=n.truncate;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:i+"/spanningCells/"+o+"/truncate",schemaPath:"#/properties/spanningCells/items/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),d++}}if(void 0!==n.paddingLeft){let e=n.paddingLeft;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:i+"/spanningCells/"+o+"/paddingLeft",schemaPath:"#/properties/spanningCells/items/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),d++}}if(void 0!==n.paddingRight){let e=n.paddingRight;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:i+"/spanningCells/"+o+"/paddingRight",schemaPath:"#/properties/spanningCells/items/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),d++}}}else{const e={instancePath:i+"/spanningCells/"+o,schemaPath:"#/properties/spanningCells/items/type",keyword:"type",params:{type:"object"},message:"must be object"};null===l?l=[e]:l.push(e),d++}}}else{const e={instancePath:i+"/spanningCells",schemaPath:"#/properties/spanningCells/type",keyword:"type",params:{type:"array"},message:"must be array"};null===l?l=[e]:l.push(e),d++}}}else{const e={instancePath:i,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===l?l=[e]:l.push(e),d++}return e.errors=l,0===d};const t={$id:"config.json",$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{border:{$ref:"shared.json#/definitions/borders"},header:{type:"object",properties:{content:{type:"string"},alignment:{$ref:"shared.json#/definitions/alignment"},wrapWord:{type:"boolean"},truncate:{type:"integer"},paddingLeft:{type:"integer"},paddingRight:{type:"integer"}},required:["content"],additionalProperties:!1},columns:{$ref:"shared.json#/definitions/columns"},columnDefault:{$ref:"shared.json#/definitions/column"},drawVerticalLine:{typeof:"function"},drawHorizontalLine:{typeof:"function"},singleLine:{typeof:"boolean"},spanningCells:{type:"array",items:{type:"object",properties:{col:{type:"integer",minimum:0},row:{type:"integer",minimum:0},colSpan:{type:"integer",minimum:1},rowSpan:{type:"integer",minimum:1},alignment:{$ref:"shared.json#/definitions/alignment"},verticalAlignment:{$ref:"shared.json#/definitions/verticalAlignment"},wrapWord:{type:"boolean"},truncate:{type:"integer"},paddingLeft:{type:"integer"},paddingRight:{type:"integer"}},required:["row","col"],additionalProperties:!1}}},additionalProperties:!1},n={type:"object",properties:{topBody:{$ref:"#/definitions/border"},topJoin:{$ref:"#/definitions/border"},topLeft:{$ref:"#/definitions/border"},topRight:{$ref:"#/definitions/border"},bottomBody:{$ref:"#/definitions/border"},bottomJoin:{$ref:"#/definitions/border"},bottomLeft:{$ref:"#/definitions/border"},bottomRight:{$ref:"#/definitions/border"},bodyLeft:{$ref:"#/definitions/border"},bodyRight:{$ref:"#/definitions/border"},bodyJoin:{$ref:"#/definitions/border"},headerJoin:{$ref:"#/definitions/border"},joinBody:{$ref:"#/definitions/border"},joinLeft:{$ref:"#/definitions/border"},joinRight:{$ref:"#/definitions/border"},joinJoin:{$ref:"#/definitions/border"},joinMiddleUp:{$ref:"#/definitions/border"},joinMiddleDown:{$ref:"#/definitions/border"},joinMiddleLeft:{$ref:"#/definitions/border"},joinMiddleRight:{$ref:"#/definitions/border"}},additionalProperties:!1},r=Object.prototype.hasOwnProperty;function i(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,a=0;if("string"!=typeof e){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};null===s?s=[e]:s.push(e),a++}return i.errors=s,0===a}function o(e,{instancePath:t="",parentData:s,parentDataProperty:a,rootData:c=e}={}){let u=null,l=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const i in e)if(!r.call(n.properties,i)){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};null===u?u=[e]:u.push(e),l++}void 0!==e.topBody&&(i(e.topBody,{instancePath:t+"/topBody",parentData:e,parentDataProperty:"topBody",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.topJoin&&(i(e.topJoin,{instancePath:t+"/topJoin",parentData:e,parentDataProperty:"topJoin",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.topLeft&&(i(e.topLeft,{instancePath:t+"/topLeft",parentData:e,parentDataProperty:"topLeft",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.topRight&&(i(e.topRight,{instancePath:t+"/topRight",parentData:e,parentDataProperty:"topRight",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.bottomBody&&(i(e.bottomBody,{instancePath:t+"/bottomBody",parentData:e,parentDataProperty:"bottomBody",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.bottomJoin&&(i(e.bottomJoin,{instancePath:t+"/bottomJoin",parentData:e,parentDataProperty:"bottomJoin",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.bottomLeft&&(i(e.bottomLeft,{instancePath:t+"/bottomLeft",parentData:e,parentDataProperty:"bottomLeft",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.bottomRight&&(i(e.bottomRight,{instancePath:t+"/bottomRight",parentData:e,parentDataProperty:"bottomRight",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.bodyLeft&&(i(e.bodyLeft,{instancePath:t+"/bodyLeft",parentData:e,parentDataProperty:"bodyLeft",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.bodyRight&&(i(e.bodyRight,{instancePath:t+"/bodyRight",parentData:e,parentDataProperty:"bodyRight",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.bodyJoin&&(i(e.bodyJoin,{instancePath:t+"/bodyJoin",parentData:e,parentDataProperty:"bodyJoin",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.headerJoin&&(i(e.headerJoin,{instancePath:t+"/headerJoin",parentData:e,parentDataProperty:"headerJoin",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.joinBody&&(i(e.joinBody,{instancePath:t+"/joinBody",parentData:e,parentDataProperty:"joinBody",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.joinLeft&&(i(e.joinLeft,{instancePath:t+"/joinLeft",parentData:e,parentDataProperty:"joinLeft",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.joinRight&&(i(e.joinRight,{instancePath:t+"/joinRight",parentData:e,parentDataProperty:"joinRight",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.joinJoin&&(i(e.joinJoin,{instancePath:t+"/joinJoin",parentData:e,parentDataProperty:"joinJoin",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.joinMiddleUp&&(i(e.joinMiddleUp,{instancePath:t+"/joinMiddleUp",parentData:e,parentDataProperty:"joinMiddleUp",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.joinMiddleDown&&(i(e.joinMiddleDown,{instancePath:t+"/joinMiddleDown",parentData:e,parentDataProperty:"joinMiddleDown",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.joinMiddleLeft&&(i(e.joinMiddleLeft,{instancePath:t+"/joinMiddleLeft",parentData:e,parentDataProperty:"joinMiddleLeft",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.joinMiddleRight&&(i(e.joinMiddleRight,{instancePath:t+"/joinMiddleRight",parentData:e,parentDataProperty:"joinMiddleRight",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length))}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===u?u=[e]:u.push(e),l++}return o.errors=u,0===l}const s={type:"string",enum:["left","right","center","justify"]};function a(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:i=e}={}){let o=null,c=0;if("string"!=typeof e){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};null===o?o=[e]:o.push(e),c++}if("left"!==e&&"right"!==e&&"center"!==e&&"justify"!==e){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:s.enum},message:"must be equal to one of the allowed values"};null===o?o=[e]:o.push(e),c++}return a.errors=o,0===c}requireEqual().default;const c=new RegExp("^[0-9]+$","u");function u(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:i=e}={}){let o=null,a=0;if("string"!=typeof e){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};null===o?o=[e]:o.push(e),a++}if("left"!==e&&"right"!==e&&"center"!==e&&"justify"!==e){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:s.enum},message:"must be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}return u.errors=o,0===a}const l={type:"string",enum:["top","middle","bottom"]};function d(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:i=e}={}){let o=null,s=0;if("string"!=typeof e){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};null===o?o=[e]:o.push(e),s++}if("top"!==e&&"middle"!==e&&"bottom"!==e){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:l.enum},message:"must be equal to one of the allowed values"};null===o?o=[e]:o.push(e),s++}return d.errors=o,0===s}function p(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:i=e}={}){let o=null,s=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const n in e)if("alignment"!==n&&"verticalAlignment"!==n&&"width"!==n&&"wrapWord"!==n&&"truncate"!==n&&"paddingLeft"!==n&&"paddingRight"!==n){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};null===o?o=[e]:o.push(e),s++}if(void 0!==e.alignment&&(u(e.alignment,{instancePath:t+"/alignment",parentData:e,parentDataProperty:"alignment",rootData:i})||(o=null===o?u.errors:o.concat(u.errors),s=o.length)),void 0!==e.verticalAlignment&&(d(e.verticalAlignment,{instancePath:t+"/verticalAlignment",parentData:e,parentDataProperty:"verticalAlignment",rootData:i})||(o=null===o?d.errors:o.concat(d.errors),s=o.length)),void 0!==e.width){let n=e.width;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/width",schemaPath:"#/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}if("number"==typeof n&&isFinite(n)&&(n<1||isNaN(n))){const e={instancePath:t+"/width",schemaPath:"#/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};null===o?o=[e]:o.push(e),s++}}if(void 0!==e.wrapWord&&"boolean"!=typeof e.wrapWord){const e={instancePath:t+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===o?o=[e]:o.push(e),s++}if(void 0!==e.truncate){let n=e.truncate;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}}if(void 0!==e.paddingLeft){let n=e.paddingLeft;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}}if(void 0!==e.paddingRight){let n=e.paddingRight;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===o?o=[e]:o.push(e),s++}return p.errors=o,0===s}function f(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:i=e}={}){let o=null,s=0;const a=s;let u=!1,l=null;const d=s;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const n in e)if(!c.test(n)){const e={instancePath:t,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};null===o?o=[e]:o.push(e),s++}for(const n in e)c.test(n)&&(p(e[n],{instancePath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:n,rootData:i})||(o=null===o?p.errors:o.concat(p.errors),s=o.length))}else{const e={instancePath:t,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};null===o?o=[e]:o.push(e),s++}(m=d===s)&&(u=!0,l=0);const _=s;if(Array.isArray(e)){const n=e.length;for(let r=0;r=",limit:1},message:"must be >= 1"};null===o?o=[e]:o.push(e),s++}}if(void 0!==e.wrapWord&&"boolean"!=typeof e.wrapWord){const e={instancePath:t+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===o?o=[e]:o.push(e),s++}if(void 0!==e.truncate){let n=e.truncate;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}}if(void 0!==e.paddingLeft){let n=e.paddingLeft;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}}if(void 0!==e.paddingRight){let n=e.paddingRight;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===o?o=[e]:o.push(e),s++}return _.errors=o,0===s}function m(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:i=e}={}){let o=null,s=0;if("string"!=typeof e){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};null===o?o=[e]:o.push(e),s++}if("top"!==e&&"middle"!==e&&"bottom"!==e){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:l.enum},message:"must be equal to one of the allowed values"};null===o?o=[e]:o.push(e),s++}return m.errors=o,0===s}function h(e,{instancePath:t="",parentData:o,parentDataProperty:s,rootData:a=e}={}){let c=null,u=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const i in e)if(!r.call(n.properties,i)){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};null===c?c=[e]:c.push(e),u++}void 0!==e.topBody&&(i(e.topBody,{instancePath:t+"/topBody",parentData:e,parentDataProperty:"topBody",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.topJoin&&(i(e.topJoin,{instancePath:t+"/topJoin",parentData:e,parentDataProperty:"topJoin",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.topLeft&&(i(e.topLeft,{instancePath:t+"/topLeft",parentData:e,parentDataProperty:"topLeft",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.topRight&&(i(e.topRight,{instancePath:t+"/topRight",parentData:e,parentDataProperty:"topRight",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bottomBody&&(i(e.bottomBody,{instancePath:t+"/bottomBody",parentData:e,parentDataProperty:"bottomBody",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bottomJoin&&(i(e.bottomJoin,{instancePath:t+"/bottomJoin",parentData:e,parentDataProperty:"bottomJoin",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bottomLeft&&(i(e.bottomLeft,{instancePath:t+"/bottomLeft",parentData:e,parentDataProperty:"bottomLeft",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bottomRight&&(i(e.bottomRight,{instancePath:t+"/bottomRight",parentData:e,parentDataProperty:"bottomRight",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bodyLeft&&(i(e.bodyLeft,{instancePath:t+"/bodyLeft",parentData:e,parentDataProperty:"bodyLeft",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bodyRight&&(i(e.bodyRight,{instancePath:t+"/bodyRight",parentData:e,parentDataProperty:"bodyRight",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bodyJoin&&(i(e.bodyJoin,{instancePath:t+"/bodyJoin",parentData:e,parentDataProperty:"bodyJoin",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.headerJoin&&(i(e.headerJoin,{instancePath:t+"/headerJoin",parentData:e,parentDataProperty:"headerJoin",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinBody&&(i(e.joinBody,{instancePath:t+"/joinBody",parentData:e,parentDataProperty:"joinBody",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinLeft&&(i(e.joinLeft,{instancePath:t+"/joinLeft",parentData:e,parentDataProperty:"joinLeft",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinRight&&(i(e.joinRight,{instancePath:t+"/joinRight",parentData:e,parentDataProperty:"joinRight",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinJoin&&(i(e.joinJoin,{instancePath:t+"/joinJoin",parentData:e,parentDataProperty:"joinJoin",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinMiddleUp&&(i(e.joinMiddleUp,{instancePath:t+"/joinMiddleUp",parentData:e,parentDataProperty:"joinMiddleUp",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinMiddleDown&&(i(e.joinMiddleDown,{instancePath:t+"/joinMiddleDown",parentData:e,parentDataProperty:"joinMiddleDown",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinMiddleLeft&&(i(e.joinMiddleLeft,{instancePath:t+"/joinMiddleLeft",parentData:e,parentDataProperty:"joinMiddleLeft",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinMiddleRight&&(i(e.joinMiddleRight,{instancePath:t+"/joinMiddleRight",parentData:e,parentDataProperty:"joinMiddleRight",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length))}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===c?c=[e]:c.push(e),u++}return h.errors=c,0===u}function g(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:i=e}={}){let o=null,s=0;const a=s;let u=!1,l=null;const d=s;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const n in e)if(!c.test(n)){const e={instancePath:t,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};null===o?o=[e]:o.push(e),s++}for(const n in e)c.test(n)&&(p(e[n],{instancePath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:n,rootData:i})||(o=null===o?p.errors:o.concat(p.errors),s=o.length))}else{const e={instancePath:t,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};null===o?o=[e]:o.push(e),s++}(_=d===s)&&(u=!0,l=0);const f=s;if(Array.isArray(e)){const n=e.length;for(let r=0;r=",limit:1},message:"must be >= 1"};null===o?o=[e]:o.push(e),s++}}if(void 0!==e.wrapWord&&"boolean"!=typeof e.wrapWord){const e={instancePath:t+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===o?o=[e]:o.push(e),s++}if(void 0!==e.truncate){let n=e.truncate;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}}if(void 0!==e.paddingLeft){let n=e.paddingLeft;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}}if(void 0!==e.paddingRight){let n=e.paddingRight;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===o?o=[e]:o.push(e),s++}return A.errors=o,0===s}e["streamConfig.json"]=function e(t,{instancePath:n="",parentData:r,parentDataProperty:i,rootData:o=t}={}){let s=null,a=0;if(t&&"object"==typeof t&&!Array.isArray(t)){if(void 0===t.columnDefault){const e={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"columnDefault"},message:"must have required property 'columnDefault'"};null===s?s=[e]:s.push(e),a++}if(void 0===t.columnCount){const e={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"columnCount"},message:"must have required property 'columnCount'"};null===s?s=[e]:s.push(e),a++}for(const e in t)if("border"!==e&&"columns"!==e&&"columnDefault"!==e&&"columnCount"!==e&&"drawVerticalLine"!==e){const t={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:e},message:"must NOT have additional properties"};null===s?s=[t]:s.push(t),a++}if(void 0!==t.border&&(h(t.border,{instancePath:n+"/border",parentData:t,parentDataProperty:"border",rootData:o})||(s=null===s?h.errors:s.concat(h.errors),a=s.length)),void 0!==t.columns&&(g(t.columns,{instancePath:n+"/columns",parentData:t,parentDataProperty:"columns",rootData:o})||(s=null===s?g.errors:s.concat(g.errors),a=s.length)),void 0!==t.columnDefault&&(A(t.columnDefault,{instancePath:n+"/columnDefault",parentData:t,parentDataProperty:"columnDefault",rootData:o})||(s=null===s?A.errors:s.concat(A.errors),a=s.length)),void 0!==t.columnCount){let e=t.columnCount;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:n+"/columnCount",schemaPath:"#/properties/columnCount/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===s?s=[e]:s.push(e),a++}if("number"==typeof e&&isFinite(e)&&(e<1||isNaN(e))){const e={instancePath:n+"/columnCount",schemaPath:"#/properties/columnCount/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};null===s?s=[e]:s.push(e),a++}}if(void 0!==t.drawVerticalLine&&"function"!=typeof t.drawVerticalLine){const e={instancePath:n+"/drawVerticalLine",schemaPath:"#/properties/drawVerticalLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};null===s?s=[e]:s.push(e),a++}}else{const e={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===s?s=[e]:s.push(e),a++}return e.errors=s,0===a}}(validators)),validators}function requireValidateConfig(){if(hasRequiredValidateConfig)return validateConfig;hasRequiredValidateConfig=1;var e=validateConfig.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(validateConfig,"__esModule",{value:!0}),validateConfig.validateConfig=void 0;const t=e(requireValidators());return validateConfig.validateConfig=(e,n)=>{const r=t.default[e];if(!r(n)&&r.errors){const e=r.errors.map((e=>({message:e.message,params:e.params,schemaPath:e.schemaPath})));throw console.log("config",n),console.log("errors",e),new Error("Invalid config.")}},validateConfig}function requireMakeStreamConfig(){if(hasRequiredMakeStreamConfig)return makeStreamConfig;hasRequiredMakeStreamConfig=1,Object.defineProperty(makeStreamConfig,"__esModule",{value:!0}),makeStreamConfig.makeStreamConfig=void 0;const e=requireUtils(),t=requireValidateConfig(),n=(e,t={},n)=>Array.from({length:e}).map(((e,r)=>({alignment:"left",paddingLeft:1,paddingRight:1,truncate:Number.POSITIVE_INFINITY,verticalAlignment:"top",wrapWord:!1,...n,...t[r]})));return makeStreamConfig.makeStreamConfig=r=>{if((0,t.validateConfig)("streamConfig.json",r),void 0===r.columnDefault.width)throw new Error("Must provide config.columnDefault.width when creating a stream.");return{drawVerticalLine:()=>!0,...r,border:(0,e.makeBorderConfig)(r.border),columns:n(r.columnCount,r.columns,r.columnDefault)}},makeStreamConfig}var mapDataUsingRowHeights={},hasRequiredMapDataUsingRowHeights;function requireMapDataUsingRowHeights(){return hasRequiredMapDataUsingRowHeights||(hasRequiredMapDataUsingRowHeights=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mapDataUsingRowHeights=e.padCellVertically=void 0;const t=requireUtils(),n=requireWrapCell(),r=e=>new Array(e).fill("");e.padCellVertically=(e,t,n)=>{const i=t-e.length;return"top"===n?[...e,...r(i)]:"bottom"===n?[...r(i),...e]:[...r(Math.floor(i/2)),...e,...r(Math.ceil(i/2))]};e.mapDataUsingRowHeights=(r,i,o)=>{const s=r[0].length,a=r.map(((t,r)=>{const a=i[r],c=Array.from({length:a},(()=>new Array(s).fill("")));return t.forEach(((t,i)=>{var s;const u=null===(s=o.spanningCellManager)||void 0===s?void 0:s.getContainingRange({col:i,row:r});if(u)return void u.extractCellContent(r).forEach(((e,t)=>{c[t][i]=e}));const l=(0,n.wrapCell)(t,o.columns[i].width,o.columns[i].wrapWord);(0,e.padCellVertically)(l,a,o.columns[i].verticalAlignment).forEach(((e,t)=>{c[t][i]=e}))})),c}));return(0,t.flatten)(a)}}(mapDataUsingRowHeights)),mapDataUsingRowHeights}var padTableData={},hasRequiredPadTableData;function requirePadTableData(){return hasRequiredPadTableData||(hasRequiredPadTableData=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.padTableData=e.padString=void 0;e.padString=(e,t,n)=>" ".repeat(t)+e+" ".repeat(n);e.padTableData=(t,n)=>t.map(((t,r)=>t.map(((t,i)=>{var o;if(null===(o=n.spanningCellManager)||void 0===o?void 0:o.getContainingRange({col:i,row:r},{mapped:!0}))return t;const{paddingLeft:s,paddingRight:a}=n.columns[i];return(0,e.padString)(t,s,a)}))))}(padTableData)),padTableData}var stringifyTableData={},hasRequiredStringifyTableData;function requireStringifyTableData(){if(hasRequiredStringifyTableData)return stringifyTableData;hasRequiredStringifyTableData=1,Object.defineProperty(stringifyTableData,"__esModule",{value:!0}),stringifyTableData.stringifyTableData=void 0;const e=requireUtils();return stringifyTableData.stringifyTableData=t=>t.map((t=>t.map((t=>(0,e.normalizeString)(String(t)))))),stringifyTableData}var truncateTableData={},lodash_truncate={exports:{}},hasRequiredLodash_truncate,hasRequiredTruncateTableData,hasRequiredCreateStream;function requireLodash_truncate(){return hasRequiredLodash_truncate||(hasRequiredLodash_truncate=1,function(e,t){var n,r=1/0,i=NaN,o=/^\s+|\s+$/g,s=/\w*$/,a=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l="\\ud800-\\udfff",d="\\u0300-\\u036f\\ufe20-\\ufe23",p="\\u20d0-\\u20f0",f="\\ufe0e\\ufe0f",_="["+l+"]",m="["+d+p+"]",h="\\ud83c[\\udffb-\\udfff]",g="[^"+l+"]",A="(?:\\ud83c[\\udde6-\\uddff]){2}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",b="(?:"+m+"|"+h+")"+"?",C="["+f+"]?",E=C+b+("(?:"+v+"(?:"+[g,A,y].join("|")+")"+C+b+")*"),x="(?:"+[g+m+"?",m,A,y,_].join("|")+")",S=RegExp(h+"(?="+h+")|"+x+E,"g"),k=RegExp("["+v+l+d+p+f+"]"),D=parseInt,w="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,I="object"==typeof self&&self&&self.Object===Object&&self,T=w||I||Function("return this")(),R=t&&!t.nodeType&&t,F=R&&e&&!e.nodeType&&e,P=F&&F.exports===R&&w.process,N=function(){try{return P&&P.binding("util")}catch(e){}}(),B=N&&N.isRegExp,O=(n="length",function(e){return null==e?void 0:e[n]});function q(e){return k.test(e)}function $(e){return q(e)?function(e){var t=S.lastIndex=0;for(;S.test(e);)t++;return t}(e):O(e)}function Q(e){return q(e)?function(e){return e.match(S)||[]}(e):function(e){return e.split("")}(e)}var L=Object.prototype.toString,M=T.Symbol,j=M?M.prototype:void 0,U=j?j.toString:void 0;function J(e){if("string"==typeof e)return e;if(z(e))return U?U.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function V(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r=o)return e;var c=n-$(r);if(c<1)return r;var u=a?V(a,0,c).join(""):e.slice(0,c);if(void 0===i)return u+r;if(a&&(c+=u.length-c),W(i)){if(e.slice(c).search(i)){var l,d=u;for(i.global||(i=RegExp(i.source,K(s.exec(i))+"g")),i.lastIndex=0;l=i.exec(d);)var p=l.index;u=u.slice(0,void 0===p?c:p)}}else if(e.indexOf(J(i),c)!=c){var f=u.lastIndexOf(i);f>-1&&(u=u.slice(0,f))}return u+r}}(lodash_truncate,lodash_truncate.exports)),lodash_truncate.exports}function requireTruncateTableData(){return hasRequiredTruncateTableData||(hasRequiredTruncateTableData=1,function(e){var t=truncateTableData.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.truncateTableData=e.truncateString=void 0;const n=t(requireLodash_truncate());e.truncateString=(e,t)=>(0,n.default)(e,{length:t,omission:"…"});e.truncateTableData=(t,n)=>t.map((t=>t.map(((t,r)=>(0,e.truncateString)(t,n[r])))))}(truncateTableData)),truncateTableData}function requireCreateStream(){if(hasRequiredCreateStream)return createStream;hasRequiredCreateStream=1,Object.defineProperty(createStream,"__esModule",{value:!0}),createStream.createStream=void 0;const e=requireAlignTableData(),t=requireCalculateRowHeights(),n=requireDrawBorder(),r=requireDrawRow(),i=requireMakeStreamConfig(),o=requireMapDataUsingRowHeights(),s=requirePadTableData(),a=requireStringifyTableData(),c=requireTruncateTableData(),u=requireUtils(),l=(n,r)=>{let i=(0,a.stringifyTableData)(n);i=(0,c.truncateTableData)(i,(0,u.extractTruncates)(r));const l=(0,t.calculateRowHeights)(i,r);return i=(0,o.mapDataUsingRowHeights)(i,l,r),i=(0,e.alignTableData)(i,r),i=(0,s.padTableData)(i,r),i};return createStream.createStream=e=>{const t=(0,i.makeStreamConfig)(e),o=Object.values(t.columns).map((e=>e.width+e.paddingLeft+e.paddingRight));let s=!0;return{write:e=>{if(e.length!==t.columnCount)throw new Error("Row cell count does not match the config.columnCount.");s?(s=!1,((e,t,i)=>{const o=l([e],i).map((e=>(0,r.drawRow)(e,i))).join("");let s;s="",s+=(0,n.drawBorderTop)(t,i),s+=o,s+=(0,n.drawBorderBottom)(t,i),s=s.trimEnd(),process.stdout.write(s)})(e,o,t)):((e,t,i)=>{const o=l([e],i).map((e=>(0,r.drawRow)(e,i))).join("");let s="";const a=(0,n.drawBorderBottom)(t,i);"\n"!==a&&(s="\r"),s+=(0,n.drawBorderJoin)(t,i),s+=o,s+=a,s=s.trimEnd(),process.stdout.write(s)})(e,o,t)}}},createStream}lodash_truncate.exports;var table={},calculateOutputColumnWidths={},hasRequiredCalculateOutputColumnWidths;function requireCalculateOutputColumnWidths(){if(hasRequiredCalculateOutputColumnWidths)return calculateOutputColumnWidths;hasRequiredCalculateOutputColumnWidths=1,Object.defineProperty(calculateOutputColumnWidths,"__esModule",{value:!0}),calculateOutputColumnWidths.calculateOutputColumnWidths=void 0;return calculateOutputColumnWidths.calculateOutputColumnWidths=e=>e.columns.map((e=>e.paddingLeft+e.width+e.paddingRight)),calculateOutputColumnWidths}var drawTable={},hasRequiredDrawTable;function requireDrawTable(){if(hasRequiredDrawTable)return drawTable;hasRequiredDrawTable=1,Object.defineProperty(drawTable,"__esModule",{value:!0}),drawTable.drawTable=void 0;const e=requireDrawBorder(),t=requireDrawContent(),n=requireDrawRow(),r=requireUtils();return drawTable.drawTable=(i,o,s,a)=>{const{drawHorizontalLine:c,singleLine:u}=a,l=(0,r.groupBySizes)(i,s).map(((e,t)=>e.map((e=>(0,n.drawRow)(e,{...a,rowIndex:t}))).join("")));return(0,t.drawContent)({contents:l,drawSeparator:(e,t)=>(0===e||e===t||!u)&&c(e,t),elementType:"row",rowIndex:-1,separatorGetter:(0,e.createTableBorderGetter)(o,{...a,rowCount:l.length}),spanningCellManager:a.spanningCellManager})},drawTable}var injectHeaderConfig={},hasRequiredInjectHeaderConfig;function requireInjectHeaderConfig(){if(hasRequiredInjectHeaderConfig)return injectHeaderConfig;hasRequiredInjectHeaderConfig=1,Object.defineProperty(injectHeaderConfig,"__esModule",{value:!0}),injectHeaderConfig.injectHeaderConfig=void 0;return injectHeaderConfig.injectHeaderConfig=(e,t)=>{var n;let r=null!==(n=t.spanningCells)&&void 0!==n?n:[];const i=t.header,o=[...e];if(i){r=r.map((({row:e,...t})=>({...t,row:e+1})));const{content:t,...n}=i;r.unshift({alignment:"center",col:0,colSpan:e[0].length,paddingLeft:1,paddingRight:1,row:0,wrapWord:!1,...n}),o.unshift([t,...Array.from({length:e[0].length-1}).fill("")])}return[o,r]},injectHeaderConfig}var makeTableConfig={},calculateMaximumColumnWidths={},hasRequiredCalculateMaximumColumnWidths;function requireCalculateMaximumColumnWidths(){return hasRequiredCalculateMaximumColumnWidths||(hasRequiredCalculateMaximumColumnWidths=1,function(e){var t=calculateMaximumColumnWidths.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.calculateMaximumColumnWidths=e.calculateMaximumCellWidth=void 0;const n=t(requireStringWidth()),r=requireUtils();e.calculateMaximumCellWidth=e=>Math.max(...e.split("\n").map(n.default));e.calculateMaximumColumnWidths=(t,n=[])=>{const i=new Array(t[0].length).fill(0),o=n.map(r.calculateRangeCoordinate);return t.forEach(((t,n)=>{t.forEach(((t,s)=>{((e,t)=>o.some((n=>(0,r.isCellInRange)({col:t,row:e},n))))(n,s)||(i[s]=Math.max(i[s],(0,e.calculateMaximumCellWidth)(t)))}))})),i}}(calculateMaximumColumnWidths)),calculateMaximumColumnWidths}var spanningCellManager={},alignSpanningCell={},hasRequiredAlignSpanningCell;function requireAlignSpanningCell(){if(hasRequiredAlignSpanningCell)return alignSpanningCell;hasRequiredAlignSpanningCell=1;var e=alignSpanningCell.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(alignSpanningCell,"__esModule",{value:!0}),alignSpanningCell.alignVerticalRangeContent=alignSpanningCell.wrapRangeContent=void 0;const t=e(requireStringWidth()),n=requireAlignString(),r=requireMapDataUsingRowHeights(),i=requirePadTableData(),o=requireTruncateTableData(),s=requireUtils(),a=requireWrapCell();alignSpanningCell.wrapRangeContent=(e,t,r)=>{const{topLeft:s,paddingRight:c,paddingLeft:u,truncate:l,wrapWord:d,alignment:p}=e,f=r.rows[s.row][s.col],_=t-u-c;return(0,a.wrapCell)((0,o.truncateString)(f,l),_,d).map((e=>{const t=(0,n.alignString)(e,_,p);return(0,i.padString)(t,u,c)}))};return alignSpanningCell.alignVerticalRangeContent=(e,n,i)=>{const{rows:o,drawHorizontalLine:a,rowHeights:c}=i,{topLeft:u,bottomRight:l,verticalAlignment:d}=e;if(0===c.length)return[];const p=(0,s.sumArray)(c.slice(u.row,l.row+1))+(l.row-u.row)-(0,s.sequence)(u.row+1,l.row).filter((e=>!a(e,o.length))).length;return(0,r.padCellVertically)(n,p,d).map((e=>0===e.length?" ".repeat((0,t.default)(n[0])):e))},alignSpanningCell}var calculateSpanningCellWidth={},hasRequiredCalculateSpanningCellWidth;function requireCalculateSpanningCellWidth(){if(hasRequiredCalculateSpanningCellWidth)return calculateSpanningCellWidth;hasRequiredCalculateSpanningCellWidth=1,Object.defineProperty(calculateSpanningCellWidth,"__esModule",{value:!0}),calculateSpanningCellWidth.calculateSpanningCellWidth=void 0;const e=requireUtils();return calculateSpanningCellWidth.calculateSpanningCellWidth=(t,n)=>{const{columnsConfig:r,drawVerticalLine:i}=n,{topLeft:o,bottomRight:s}=t;return(0,e.sumArray)(r.slice(o.col,s.col+1).map((({width:e})=>e)))+(o.col===s.col?r[o.col].paddingRight+r[s.col].paddingLeft:(0,e.sumArray)(r.slice(o.col,s.col+1).map((({paddingLeft:e,paddingRight:t})=>e+t))))+(s.col-o.col)-(0,e.sequence)(o.col+1,s.col).filter((e=>!i(e,r.length))).length},calculateSpanningCellWidth}var makeRangeConfig={},hasRequiredMakeRangeConfig,hasRequiredSpanningCellManager;function requireMakeRangeConfig(){if(hasRequiredMakeRangeConfig)return makeRangeConfig;hasRequiredMakeRangeConfig=1,Object.defineProperty(makeRangeConfig,"__esModule",{value:!0}),makeRangeConfig.makeRangeConfig=void 0;const e=requireUtils();return makeRangeConfig.makeRangeConfig=(t,n)=>{var r;const{topLeft:i,bottomRight:o}=(0,e.calculateRangeCoordinate)(t);return{...{...n[i.col],...t,paddingRight:null!==(r=t.paddingRight)&&void 0!==r?r:n[o.col].paddingRight},bottomRight:o,topLeft:i}},makeRangeConfig}function requireSpanningCellManager(){if(hasRequiredSpanningCellManager)return spanningCellManager;hasRequiredSpanningCellManager=1,Object.defineProperty(spanningCellManager,"__esModule",{value:!0}),spanningCellManager.createSpanningCellManager=void 0;const e=requireAlignSpanningCell(),t=requireCalculateSpanningCellWidth(),n=requireMakeRangeConfig(),r=requireUtils(),i=(e,t)=>t.find((t=>(0,r.isCellInRange)(e,t))),o=(n,i)=>{const o=(0,t.calculateSpanningCellWidth)(n,i),s=(0,e.wrapRangeContent)(n,o,i),a=(0,e.alignVerticalRangeContent)(n,s,i);return{...n,extractBorderContent:e=>{const{topLeft:t}=n,o=(0,r.sumArray)(i.rowHeights.slice(t.row,e))+(e-t.row-1);return a[o]},extractCellContent:e=>{const{topLeft:t}=n,{drawHorizontalLine:o,rowHeights:s}=i,c=e-t.row,u=(0,r.sequence)(t.row+1,e).filter((e=>!(null==o?void 0:o(e,s.length)))).length,l=(0,r.sumArray)(s.slice(t.row,e))+c-u;return a.slice(l,l+s[e])},height:s.length,width:o}};return spanningCellManager.createSpanningCellManager=e=>{const{spanningCellConfigs:t,columnsConfig:s}=e,a=t.map((e=>(0,n.makeRangeConfig)(e,s))),c={};let u=[],l=[];return{getContainingRange:(t,n)=>{var r;const s=(null==n?void 0:n.mapped)?l[t.row]:t.row,d=i({...t,row:s},a);if(!d)return;if(0===u.length)return o(d,{...e,rowHeights:u});const p=(e=>{const{row:t,col:n}=e.topLeft;return`${t}/${n}`})(d);return null!==(r=c[p])&&void 0!==r||(c[p]=o(d,{...e,rowHeights:u})),c[p]},inSameRange:(e,t)=>((e,t,n)=>{const o=i(e,n),s=i(t,n);return!(!o||!s)&&(0,r.areCellEqual)(o.topLeft,s.topLeft)})(e,t,a),rowHeights:u,rowIndexMapping:l,setRowHeights:e=>{u=e},setRowIndexMapping:e=>{l=(0,r.flatten)(e.map(((e,t)=>Array.from({length:e},(()=>t)))))}}},spanningCellManager}var validateSpanningCellConfig={},hasRequiredValidateSpanningCellConfig,hasRequiredMakeTableConfig;function requireValidateSpanningCellConfig(){if(hasRequiredValidateSpanningCellConfig)return validateSpanningCellConfig;hasRequiredValidateSpanningCellConfig=1,Object.defineProperty(validateSpanningCellConfig,"__esModule",{value:!0}),validateSpanningCellConfig.validateSpanningCellConfig=void 0;const e=requireUtils(),t=(e,t,n)=>e<=n&&n<=t;return validateSpanningCellConfig.validateSpanningCellConfig=(n,r)=>{const[i,o]=[n.length,n[0].length];r.forEach(((e,t)=>{const{colSpan:n,rowSpan:r}=e;if(void 0===n&&void 0===r)throw new Error(`Expect at least colSpan or rowSpan is provided in config.spanningCells[${t}]`);if(void 0!==n&&n<1)throw new Error(`Expect colSpan is not equal zero, instead got: ${n} in config.spanningCells[${t}]`);if(void 0!==r&&r<1)throw new Error(`Expect rowSpan is not equal zero, instead got: ${r} in config.spanningCells[${t}]`)}));const s=r.map(e.calculateRangeCoordinate);s.forEach((({topLeft:e,bottomRight:n},r)=>{if(!(t(0,o-1,e.col)&&t(0,i-1,e.row)&&t(0,o-1,n.col)&&t(0,i-1,n.row)))throw new Error(`Some cells in config.spanningCells[${r}] are out of the table`)}));const a=Array.from({length:i},(()=>Array.from({length:o})));s.forEach((({topLeft:t,bottomRight:n},r)=>{(0,e.sequence)(t.row,n.row).forEach((i=>{(0,e.sequence)(t.col,n.col).forEach((e=>{if(void 0!==a[i][e])throw new Error(`Spanning cells in config.spanningCells[${a[i][e]}] and config.spanningCells[${r}] are overlap each other`);a[i][e]=r}))}))}))},validateSpanningCellConfig}function requireMakeTableConfig(){if(hasRequiredMakeTableConfig)return makeTableConfig;hasRequiredMakeTableConfig=1,Object.defineProperty(makeTableConfig,"__esModule",{value:!0}),makeTableConfig.makeTableConfig=void 0;const e=requireCalculateMaximumColumnWidths(),t=requireSpanningCellManager(),n=requireUtils(),r=requireValidateConfig(),i=requireValidateSpanningCellConfig();return makeTableConfig.makeTableConfig=(o,s={},a)=>{var c,u,l,d,p;(0,r.validateConfig)("config.json",s),(0,i.validateSpanningCellConfig)(o,null!==(c=s.spanningCells)&&void 0!==c?c:[]);const f=null!==(u=null!=a?a:s.spanningCells)&&void 0!==u?u:[],_=((t,n,r,i)=>{const o=(0,e.calculateMaximumColumnWidths)(t,i);return t[0].map(((e,t)=>({alignment:"left",paddingLeft:1,paddingRight:1,truncate:Number.POSITIVE_INFINITY,verticalAlignment:"top",width:o[t],wrapWord:!1,...r,...null==n?void 0:n[t]})))})(o,s.columns,s.columnDefault,f),m=null!==(l=s.drawVerticalLine)&&void 0!==l?l:()=>!0,h=null!==(d=s.drawHorizontalLine)&&void 0!==d?d:()=>!0;return{...s,border:(0,n.makeBorderConfig)(s.border),columns:_,drawHorizontalLine:h,drawVerticalLine:m,singleLine:null!==(p=s.singleLine)&&void 0!==p&&p,spanningCellManager:(0,t.createSpanningCellManager)({columnsConfig:_,drawHorizontalLine:h,drawVerticalLine:m,rows:o,spanningCellConfigs:f})}},makeTableConfig}var validateTableData={},hasRequiredValidateTableData,hasRequiredTable;function requireValidateTableData(){if(hasRequiredValidateTableData)return validateTableData;hasRequiredValidateTableData=1,Object.defineProperty(validateTableData,"__esModule",{value:!0}),validateTableData.validateTableData=void 0;const e=requireUtils();return validateTableData.validateTableData=t=>{if(!Array.isArray(t))throw new TypeError("Table data must be an array.");if(0===t.length)throw new Error("Table must define at least one row.");if(0===t[0].length)throw new Error("Table must define at least one column.");const n=t[0].length;for(const r of t){if(!Array.isArray(r))throw new TypeError("Table row data must be an array.");if(r.length!==n)throw new Error("Table must have a consistent number of cells.");for(const t of r)if(/[\u0001-\u0006\u0008\u0009\u000B-\u001A]/.test((0,e.normalizeString)(String(t))))throw new Error("Table data must not contain control characters.")}},validateTableData}function requireTable(){if(hasRequiredTable)return table;hasRequiredTable=1,Object.defineProperty(table,"__esModule",{value:!0}),table.table=void 0;const e=requireAlignTableData(),t=requireCalculateOutputColumnWidths(),n=requireCalculateRowHeights(),r=requireDrawTable(),i=requireInjectHeaderConfig(),o=requireMakeTableConfig(),s=requireMapDataUsingRowHeights(),a=requirePadTableData(),c=requireStringifyTableData(),u=requireTruncateTableData(),l=requireUtils(),d=requireValidateTableData();return table.table=(p,f={})=>{(0,d.validateTableData)(p);let _=(0,c.stringifyTableData)(p);const[m,h]=(0,i.injectHeaderConfig)(_,f),g=(0,o.makeTableConfig)(m,f,h);_=(0,u.truncateTableData)(m,(0,l.extractTruncates)(g));const A=(0,n.calculateRowHeights)(_,g);g.spanningCellManager.setRowHeights(A),g.spanningCellManager.setRowIndexMapping(A),_=(0,s.mapDataUsingRowHeights)(_,A,g),_=(0,e.alignTableData)(_,g),_=(0,a.padTableData)(_,g);const y=(0,t.calculateOutputColumnWidths)(g);return(0,r.drawTable)(_,y,A,g)},table}var api={},hasRequiredApi,hasRequiredSrc$2;function requireApi(){return hasRequiredApi||(hasRequiredApi=1,Object.defineProperty(api,"__esModule",{value:!0})),api}function requireSrc$2(){return hasRequiredSrc$2||(hasRequiredSrc$2=1,function(e){var t=src$2.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=src$2.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.getBorderCharacters=e.createStream=e.table=void 0;const r=requireCreateStream();Object.defineProperty(e,"createStream",{enumerable:!0,get:function(){return r.createStream}});const i=requireGetBorderCharacters();Object.defineProperty(e,"getBorderCharacters",{enumerable:!0,get:function(){return i.getBorderCharacters}});const o=requireTable();Object.defineProperty(e,"table",{enumerable:!0,get:function(){return o.table}}),n(requireApi(),e)}(src$2)),src$2}var srcExports$1=requireSrc$2(),jsonpointerExports=requireJsonpointer(),jsonPointer=getDefaultExportFromCjs(jsonpointerExports);function findSchemaDefinition(e,t={}){const n=e;if(""===(e=e.trim()))return!1;if(!e.startsWith("#"))throw new Error(`Could not find a definition for ${n}.`);e=decodeURIComponent(e.substring(1));const r=jsonPointer.get(t,e);if(void 0===r)throw new Error(`Could not find a definition for ${n}.`);return r}var supportedMethods=new Set(["get","put","post","delete","options","head","patch","trace"]),CODE_SAMPLES="code-samples",EXPLORER_ENABLED="explorer-enabled",HEADERS="headers",METRICS_ENABLED="metrics-enabled",OAUTH_OPTIONS="oauth-options",PARAMETER_ORDERING="parameter-ordering",PROXY_ENABLED="proxy-enabled",SAMPLES_LANGUAGES="samples-languages",SIMPLE_MODE="simple-mode",DISABLE_TAG_SORTING="disable-tag-sorting",extensionDefaults={[CODE_SAMPLES]:void 0,[DISABLE_TAG_SORTING]:!1,[EXPLORER_ENABLED]:!0,[HEADERS]:void 0,[METRICS_ENABLED]:!0,[OAUTH_OPTIONS]:{},[PARAMETER_ORDERING]:["path","query","body","cookie","form","header"],[PROXY_ENABLED]:!0,[SAMPLES_LANGUAGES]:["shell","node","ruby","php","python","java","csharp"],[SIMPLE_MODE]:!0},_listCacheClear,hasRequired_listCacheClear,eq_1,hasRequiredEq,_assocIndexOf,hasRequired_assocIndexOf,_listCacheDelete,hasRequired_listCacheDelete,_listCacheGet,hasRequired_listCacheGet,_listCacheHas,hasRequired_listCacheHas,_listCacheSet,hasRequired_listCacheSet,_ListCache,hasRequired_ListCache,_stackClear,hasRequired_stackClear,_stackDelete,hasRequired_stackDelete,_stackGet,hasRequired_stackGet,_stackHas,hasRequired_stackHas,_freeGlobal,hasRequired_freeGlobal,_root,hasRequired_root,_Symbol,hasRequired_Symbol,_getRawTag,hasRequired_getRawTag,_objectToString,hasRequired_objectToString,_baseGetTag,hasRequired_baseGetTag,isObject_1,hasRequiredIsObject$1,isFunction_1,hasRequiredIsFunction$1,_coreJsData,hasRequired_coreJsData,_isMasked,hasRequired_isMasked,_toSource,hasRequired_toSource,_baseIsNative,hasRequired_baseIsNative,_getValue,hasRequired_getValue,_getNative,hasRequired_getNative,_Map,hasRequired_Map,_nativeCreate,hasRequired_nativeCreate,_hashClear,hasRequired_hashClear,_hashDelete,hasRequired_hashDelete,_hashGet,hasRequired_hashGet,_hashHas,hasRequired_hashHas,_hashSet,hasRequired_hashSet,_Hash,hasRequired_Hash,_mapCacheClear,hasRequired_mapCacheClear,_isKeyable,hasRequired_isKeyable,_getMapData,hasRequired_getMapData,_mapCacheDelete,hasRequired_mapCacheDelete,_mapCacheGet,hasRequired_mapCacheGet,_mapCacheHas,hasRequired_mapCacheHas,_mapCacheSet,hasRequired_mapCacheSet,_MapCache,hasRequired_MapCache,_stackSet,hasRequired_stackSet,_Stack,hasRequired_Stack,_arrayEach,hasRequired_arrayEach,_defineProperty,hasRequired_defineProperty,_baseAssignValue,hasRequired_baseAssignValue,_assignValue,hasRequired_assignValue,_copyObject,hasRequired_copyObject,_baseTimes,hasRequired_baseTimes,isObjectLike_1,hasRequiredIsObjectLike,_baseIsArguments,hasRequired_baseIsArguments,isArguments_1,hasRequiredIsArguments$1,isArray_1,hasRequiredIsArray;function hasRootExtension(e,t){return Boolean(t&&e in t)}function getExtension(e,t,n){if(n){if(n.hasExtension("x-readme")){const t=n.getExtension("x-readme");if(t&&"object"==typeof t&&e in t)return t[e]}if(n.hasExtension(`x-${e}`))return n.getExtension(`x-${e}`);if(n.hasExtension(e))return n.getExtension(e)}if(e===CODE_SAMPLES)return extensionDefaults[e];if(hasRootExtension("x-readme",t)){const n=t?.["x-readme"];if(n&&"object"==typeof n&&e in n)return n[e]}return hasRootExtension(`x-${e}`,t)?t?.[`x-${e}`]:hasRootExtension(e,t)?t?.[e]:e in extensionDefaults?extensionDefaults[e]:void 0}function validateParameterOrdering(e,t){const n=extensionDefaults[PARAMETER_ORDERING],r=n.length,i=`${n.slice(0,-1).join(", ")}, and ${n.slice(-1)}`;if(e.length!==r)throw new TypeError(`"${t}" must contain ${r} items comprised of: ${i}`);if(e.filter((e=>n.includes(e.toLowerCase()))).length!==r)throw new TypeError(`"${t}" must contain ${r} items comprised of: ${i}`)}function isRef(e){return void 0!==e.$ref}function isOAS31(e){return"3.1.0"===e.openapi}function isSchema(e,t=!1){return void 0!==e.type||void 0!==e.allOf||void 0!==e.anyOf||void 0!==e.oneOf||t}function require_listCacheClear(){if(hasRequired_listCacheClear)return _listCacheClear;return hasRequired_listCacheClear=1,_listCacheClear=function(){this.__data__=[],this.size=0}}function requireEq(){if(hasRequiredEq)return eq_1;return hasRequiredEq=1,eq_1=function(e,t){return e===t||e!=e&&t!=t}}function require_assocIndexOf(){if(hasRequired_assocIndexOf)return _assocIndexOf;hasRequired_assocIndexOf=1;var e=requireEq();return _assocIndexOf=function(t,n){for(var r=t.length;r--;)if(e(t[r][0],n))return r;return-1},_assocIndexOf}function require_listCacheDelete(){if(hasRequired_listCacheDelete)return _listCacheDelete;hasRequired_listCacheDelete=1;var e=require_assocIndexOf(),t=Array.prototype.splice;return _listCacheDelete=function(n){var r=this.__data__,i=e(r,n);return!(i<0)&&(i==r.length-1?r.pop():t.call(r,i,1),--this.size,!0)},_listCacheDelete}function require_listCacheGet(){if(hasRequired_listCacheGet)return _listCacheGet;hasRequired_listCacheGet=1;var e=require_assocIndexOf();return _listCacheGet=function(t){var n=this.__data__,r=e(n,t);return r<0?void 0:n[r][1]},_listCacheGet}function require_listCacheHas(){if(hasRequired_listCacheHas)return _listCacheHas;hasRequired_listCacheHas=1;var e=require_assocIndexOf();return _listCacheHas=function(t){return e(this.__data__,t)>-1}}function require_listCacheSet(){if(hasRequired_listCacheSet)return _listCacheSet;hasRequired_listCacheSet=1;var e=require_assocIndexOf();return _listCacheSet=function(t,n){var r=this.__data__,i=e(r,t);return i<0?(++this.size,r.push([t,n])):r[i][1]=n,this},_listCacheSet}function require_ListCache(){if(hasRequired_ListCache)return _ListCache;hasRequired_ListCache=1;var e=require_listCacheClear(),t=require_listCacheDelete(),n=require_listCacheGet(),r=require_listCacheHas(),i=require_listCacheSet();function o(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&t%1==0&&t-1&&e%1==0&&e<=9007199254740991}}function require_baseIsTypedArray(){if(hasRequired_baseIsTypedArray)return _baseIsTypedArray;hasRequired_baseIsTypedArray=1;var e=require_baseGetTag(),t=requireIsLength(),n=requireIsObjectLike(),r={};return r["[object Float32Array]"]=r["[object Float64Array]"]=r["[object Int8Array]"]=r["[object Int16Array]"]=r["[object Int32Array]"]=r["[object Uint8Array]"]=r["[object Uint8ClampedArray]"]=r["[object Uint16Array]"]=r["[object Uint32Array]"]=!0,r["[object Arguments]"]=r["[object Array]"]=r["[object ArrayBuffer]"]=r["[object Boolean]"]=r["[object DataView]"]=r["[object Date]"]=r["[object Error]"]=r["[object Function]"]=r["[object Map]"]=r["[object Number]"]=r["[object Object]"]=r["[object RegExp]"]=r["[object Set]"]=r["[object String]"]=r["[object WeakMap]"]=!1,_baseIsTypedArray=function(i){return n(i)&&t(i.length)&&!!r[e(i)]}}function require_baseUnary(){if(hasRequired_baseUnary)return _baseUnary;return hasRequired_baseUnary=1,_baseUnary=function(e){return function(t){return e(t)}}}isBuffer.exports;var _nodeUtil={exports:{}},hasRequired_nodeUtil,isTypedArray_1,hasRequiredIsTypedArray,_arrayLikeKeys,hasRequired_arrayLikeKeys,_isPrototype,hasRequired_isPrototype,_overArg,hasRequired_overArg,_nativeKeys,hasRequired_nativeKeys,_baseKeys,hasRequired_baseKeys,isArrayLike_1,hasRequiredIsArrayLike,keys_1,hasRequiredKeys$1,_baseAssign,hasRequired_baseAssign,_nativeKeysIn,hasRequired_nativeKeysIn,_baseKeysIn,hasRequired_baseKeysIn,keysIn_1,hasRequiredKeysIn,_baseAssignIn,hasRequired_baseAssignIn;function require_nodeUtil(){return hasRequired_nodeUtil||(hasRequired_nodeUtil=1,function(e,t){var n=require_freeGlobal(),r=t&&!t.nodeType&&t,i=r&&e&&!e.nodeType&&e,o=i&&i.exports===r&&n.process,s=function(){try{var e=i&&i.require&&i.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=s}(_nodeUtil,_nodeUtil.exports)),_nodeUtil.exports}function requireIsTypedArray(){if(hasRequiredIsTypedArray)return isTypedArray_1;hasRequiredIsTypedArray=1;var e=require_baseIsTypedArray(),t=require_baseUnary(),n=require_nodeUtil(),r=n&&n.isTypedArray,i=r?t(r):e;return isTypedArray_1=i}function require_arrayLikeKeys(){if(hasRequired_arrayLikeKeys)return _arrayLikeKeys;hasRequired_arrayLikeKeys=1;var e=require_baseTimes(),t=requireIsArguments$1(),n=requireIsArray(),r=requireIsBuffer(),i=require_isIndex(),o=requireIsTypedArray(),s=Object.prototype.hasOwnProperty;return _arrayLikeKeys=function(a,c){var u=n(a),l=!u&&t(a),d=!u&&!l&&r(a),p=!u&&!l&&!d&&o(a),f=u||l||d||p,_=f?e(a.length,String):[],m=_.length;for(var h in a)!c&&!s.call(a,h)||f&&("length"==h||d&&("offset"==h||"parent"==h)||p&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||i(h,m))||_.push(h);return _}}function require_isPrototype(){if(hasRequired_isPrototype)return _isPrototype;hasRequired_isPrototype=1;var e=Object.prototype;return _isPrototype=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||e)}}function require_overArg(){if(hasRequired_overArg)return _overArg;return hasRequired_overArg=1,_overArg=function(e,t){return function(n){return e(t(n))}}}function require_nativeKeys(){if(hasRequired_nativeKeys)return _nativeKeys;hasRequired_nativeKeys=1;var e=require_overArg()(Object.keys,Object);return _nativeKeys=e}function require_baseKeys(){if(hasRequired_baseKeys)return _baseKeys;hasRequired_baseKeys=1;var e=require_isPrototype(),t=require_nativeKeys(),n=Object.prototype.hasOwnProperty;return _baseKeys=function(r){if(!e(r))return t(r);var i=[];for(var o in Object(r))n.call(r,o)&&"constructor"!=o&&i.push(o);return i}}function requireIsArrayLike(){if(hasRequiredIsArrayLike)return isArrayLike_1;hasRequiredIsArrayLike=1;var e=requireIsFunction$1(),t=requireIsLength();return isArrayLike_1=function(n){return null!=n&&t(n.length)&&!e(n)}}function requireKeys$1(){if(hasRequiredKeys$1)return keys_1;hasRequiredKeys$1=1;var e=require_arrayLikeKeys(),t=require_baseKeys(),n=requireIsArrayLike();return keys_1=function(r){return n(r)?e(r):t(r)}}function require_baseAssign(){if(hasRequired_baseAssign)return _baseAssign;hasRequired_baseAssign=1;var e=require_copyObject(),t=requireKeys$1();return _baseAssign=function(n,r){return n&&e(r,t(r),n)},_baseAssign}function require_nativeKeysIn(){if(hasRequired_nativeKeysIn)return _nativeKeysIn;return hasRequired_nativeKeysIn=1,_nativeKeysIn=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}}function require_baseKeysIn(){if(hasRequired_baseKeysIn)return _baseKeysIn;hasRequired_baseKeysIn=1;var e=requireIsObject$1(),t=require_isPrototype(),n=require_nativeKeysIn(),r=Object.prototype.hasOwnProperty;return _baseKeysIn=function(i){if(!e(i))return n(i);var o=t(i),s=[];for(var a in i)("constructor"!=a||!o&&r.call(i,a))&&s.push(a);return s}}function requireKeysIn(){if(hasRequiredKeysIn)return keysIn_1;hasRequiredKeysIn=1;var e=require_arrayLikeKeys(),t=require_baseKeysIn(),n=requireIsArrayLike();return keysIn_1=function(r){return n(r)?e(r,!0):t(r)}}function require_baseAssignIn(){if(hasRequired_baseAssignIn)return _baseAssignIn;hasRequired_baseAssignIn=1;var e=require_copyObject(),t=requireKeysIn();return _baseAssignIn=function(n,r){return n&&e(r,t(r),n)},_baseAssignIn}_nodeUtil.exports;var _cloneBuffer={exports:{}},hasRequired_cloneBuffer,_copyArray,hasRequired_copyArray,_arrayFilter,hasRequired_arrayFilter,stubArray_1,hasRequiredStubArray,_getSymbols,hasRequired_getSymbols,_copySymbols,hasRequired_copySymbols,_arrayPush,hasRequired_arrayPush,_getPrototype,hasRequired_getPrototype,_getSymbolsIn,hasRequired_getSymbolsIn,_copySymbolsIn,hasRequired_copySymbolsIn,_baseGetAllKeys,hasRequired_baseGetAllKeys,_getAllKeys,hasRequired_getAllKeys,_getAllKeysIn,hasRequired_getAllKeysIn,_DataView,hasRequired_DataView,_Promise,hasRequired_Promise,_Set,hasRequired_Set,_WeakMap,hasRequired_WeakMap,_getTag,hasRequired_getTag,_initCloneArray,hasRequired_initCloneArray,_Uint8Array,hasRequired_Uint8Array,_cloneArrayBuffer,hasRequired_cloneArrayBuffer,_cloneDataView,hasRequired_cloneDataView,_cloneRegExp,hasRequired_cloneRegExp,_cloneSymbol,hasRequired_cloneSymbol,_cloneTypedArray,hasRequired_cloneTypedArray,_initCloneByTag,hasRequired_initCloneByTag,_baseCreate,hasRequired_baseCreate,_initCloneObject,hasRequired_initCloneObject,_baseIsMap,hasRequired_baseIsMap,isMap_1,hasRequiredIsMap,_baseIsSet,hasRequired_baseIsSet,isSet_1,hasRequiredIsSet,_baseClone,hasRequired_baseClone,cloneDeep_1,hasRequiredCloneDeep,_setCacheAdd,hasRequired_setCacheAdd,_setCacheHas,hasRequired_setCacheHas,_SetCache,hasRequired_SetCache,_arraySome,hasRequired_arraySome,_cacheHas,hasRequired_cacheHas,_equalArrays,hasRequired_equalArrays,_mapToArray,hasRequired_mapToArray,_setToArray,hasRequired_setToArray,_equalByTag,hasRequired_equalByTag,_equalObjects,hasRequired_equalObjects,_baseIsEqualDeep,hasRequired_baseIsEqualDeep,_baseIsEqual,hasRequired_baseIsEqual,isEqual_1,hasRequiredIsEqual,_isFlattenable,hasRequired_isFlattenable,_baseFlatten,hasRequired_baseFlatten,_arrayMap,hasRequired_arrayMap,isSymbol_1,hasRequiredIsSymbol$1,_isKey,hasRequired_isKey,memoize_1,hasRequiredMemoize,_memoizeCapped,hasRequired_memoizeCapped,_stringToPath,hasRequired_stringToPath,_baseToString,hasRequired_baseToString,toString_1,hasRequiredToString,_castPath,hasRequired_castPath,_toKey,hasRequired_toKey,_baseGet,hasRequired_baseGet,_baseIsMatch,hasRequired_baseIsMatch,_isStrictComparable,hasRequired_isStrictComparable,_getMatchData,hasRequired_getMatchData,_matchesStrictComparable,hasRequired_matchesStrictComparable,_baseMatches,hasRequired_baseMatches,get_1,hasRequiredGet$1,_baseHasIn,hasRequired_baseHasIn,_hasPath,hasRequired_hasPath,hasIn_1,hasRequiredHasIn,_baseMatchesProperty,hasRequired_baseMatchesProperty,identity_1,hasRequiredIdentity,_baseProperty,hasRequired_baseProperty,_basePropertyDeep,hasRequired_basePropertyDeep,property_1,hasRequiredProperty,_baseIteratee,hasRequired_baseIteratee,_createBaseFor,hasRequired_createBaseFor,_baseFor,hasRequired_baseFor,_baseForOwn,hasRequired_baseForOwn,_createBaseEach,hasRequired_createBaseEach,_baseEach,hasRequired_baseEach,_baseMap,hasRequired_baseMap,_baseSortBy,hasRequired_baseSortBy,_compareAscending,hasRequired_compareAscending,_compareMultiple,hasRequired_compareMultiple,_baseOrderBy,hasRequired_baseOrderBy,_apply,hasRequired_apply,_overRest,hasRequired_overRest,constant_1,hasRequiredConstant,_baseSetToString,hasRequired_baseSetToString,_shortOut,hasRequired_shortOut,_setToString,hasRequired_setToString,_baseRest,hasRequired_baseRest,_isIterateeCall,hasRequired_isIterateeCall,sortBy_1,hasRequiredSortBy,_baseFindIndex,hasRequired_baseFindIndex,_baseIsNaN,hasRequired_baseIsNaN,_strictIndexOf,hasRequired_strictIndexOf,_baseIndexOf,hasRequired_baseIndexOf,_arrayIncludes,hasRequired_arrayIncludes,_arrayIncludesWith,hasRequired_arrayIncludesWith,noop_1,hasRequiredNoop$1,_createSet,hasRequired_createSet,_baseUniq,hasRequired_baseUniq,uniq_1,hasRequiredUniq,uniqWith_1,hasRequiredUniqWith,defaults_1,hasRequiredDefaults,_baseIntersection,hasRequired_baseIntersection,isArrayLikeObject_1,hasRequiredIsArrayLikeObject,_castArrayLikeObject,hasRequired_castArrayLikeObject,last_1,hasRequiredLast,intersectionWith_1,hasRequiredIntersectionWith,isPlainObject_1,hasRequiredIsPlainObject,isBoolean_1,hasRequiredIsBoolean,src$1,hasRequiredSrc$1,lib$6,hasRequiredLib$6,lib$5,hasRequiredLib$5,lib$4,hasRequiredLib$4,lib$3,hasRequiredLib$3,lib$2,hasRequiredLib$2,lib$1,hasRequiredLib$1,lib,hasRequiredLib,_assignMergeValue,hasRequired_assignMergeValue,_safeGet,hasRequired_safeGet,toPlainObject_1,hasRequiredToPlainObject,_baseMergeDeep,hasRequired_baseMergeDeep,_baseMerge,hasRequired_baseMerge,_customDefaultsMerge,hasRequired_customDefaultsMerge,_createAssigner,hasRequired_createAssigner,mergeWith_1,hasRequiredMergeWith,defaultsDeep_1,hasRequiredDefaultsDeep,flatten_1,hasRequiredFlatten,flattenDeep_1,hasRequiredFlattenDeep,intersection_1,hasRequiredIntersection,_baseIndexOfWith,hasRequired_baseIndexOfWith,_basePullAll,hasRequired_basePullAll,pullAll_1,hasRequiredPullAll,_castFunction,hasRequired_castFunction,forEach_1,hasRequiredForEach$1,_baseDifference,hasRequired_baseDifference,without_1,hasRequiredWithout,common,hasRequiredCommon,properties,hasRequiredProperties,items,hasRequiredItems,src,hasRequiredSrc;function require_cloneBuffer(){return hasRequired_cloneBuffer||(hasRequired_cloneBuffer=1,function(e,t){var n=require_root(),r=t&&!t.nodeType&&t,i=r&&e&&!e.nodeType&&e,o=i&&i.exports===r?n.Buffer:void 0,s=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}}(_cloneBuffer,_cloneBuffer.exports)),_cloneBuffer.exports}function require_copyArray(){if(hasRequired_copyArray)return _copyArray;return hasRequired_copyArray=1,_copyArray=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++nl))return!1;var p=c.get(r),f=c.get(i);if(p&&f)return p==i&&f==r;var _=-1,m=!0,h=2&o?new e:void 0;for(c.set(r,i),c.set(i,r);++_0&&o(l)?i>1?n(l,i-1,o,s,a):e(a,l):s||(a[a.length]=l)}return a},_baseFlatten}function require_arrayMap(){if(hasRequired_arrayMap)return _arrayMap;return hasRequired_arrayMap=1,_arrayMap=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++nn||s&&a&&u&&!c&&!l||i&&a&&u||!r&&u||!o)return 1;if(!i&&!s&&!l&&t=c?u:u*("desc"==r[i]?-1:1)}return t.index-n.index},_compareMultiple}function require_baseOrderBy(){if(hasRequired_baseOrderBy)return _baseOrderBy;hasRequired_baseOrderBy=1;var e=require_arrayMap(),t=require_baseGet(),n=require_baseIteratee(),r=require_baseMap(),i=require_baseSortBy(),o=require_baseUnary(),s=require_compareMultiple(),a=requireIdentity(),c=requireIsArray();return _baseOrderBy=function(u,l,d){l=l.length?e(l,(function(e){return c(e)?function(n){return t(n,1===e.length?e[0]:e)}:e})):[a];var p=-1;l=e(l,o(n));var f=r(u,(function(t,n,r){return{criteria:e(l,(function(e){return e(t)})),index:++p,value:t}}));return i(f,(function(e,t){return s(e,t,d)}))},_baseOrderBy}function require_apply(){if(hasRequired_apply)return _apply;return hasRequired_apply=1,_apply=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},_apply}function require_overRest(){if(hasRequired_overRest)return _overRest;hasRequired_overRest=1;var e=require_apply(),t=Math.max;return _overRest=function(n,r,i){return r=t(void 0===r?n.length-1:r,0),function(){for(var o=arguments,s=-1,a=t(o.length-r,0),c=Array(a);++s0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}},_shortOut}function require_setToString(){if(hasRequired_setToString)return _setToString;hasRequired_setToString=1;var e=require_baseSetToString(),t=require_shortOut()(e);return _setToString=t}function require_baseRest(){if(hasRequired_baseRest)return _baseRest;hasRequired_baseRest=1;var e=requireIdentity(),t=require_overRest(),n=require_setToString();return _baseRest=function(r,i){return n(t(r,i,e),r+"")}}function require_isIterateeCall(){if(hasRequired_isIterateeCall)return _isIterateeCall;hasRequired_isIterateeCall=1;var e=requireEq(),t=requireIsArrayLike(),n=require_isIndex(),r=requireIsObject$1();return _isIterateeCall=function(i,o,s){if(!r(s))return!1;var a=typeof o;return!!("number"==a?t(s)&&n(o,s.length):"string"==a&&o in s)&&e(s[o],i)},_isIterateeCall}function requireSortBy(){if(hasRequiredSortBy)return sortBy_1;hasRequiredSortBy=1;var e=require_baseFlatten(),t=require_baseOrderBy(),n=require_baseRest(),r=require_isIterateeCall(),i=n((function(n,i){if(null==n)return[];var o=i.length;return o>1&&r(n,i[0],i[1])?i=[]:o>2&&r(i[0],i[1],i[2])&&(i=[i[0]]),t(n,e(i,1),[])}));return sortBy_1=i}function require_baseFindIndex(){if(hasRequired_baseFindIndex)return _baseFindIndex;return hasRequired_baseFindIndex=1,_baseFindIndex=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o-1},_arrayIncludes}function require_arrayIncludesWith(){if(hasRequired_arrayIncludesWith)return _arrayIncludesWith;return hasRequired_arrayIncludesWith=1,_arrayIncludesWith=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r=200){var m=a?null:i(s);if(m)return o(m);p=!1,l=r,_=new e}else _=a?[]:f;e:for(;++u2?s[2]:void 0;for(u&&n(s[0],s[1],u)&&(c=1);++a=120&&g.length>=120)?new e(f&&g):void 0}g=a[0];var A=-1,y=_[0];e:for(;++AArray.isArray(e)?e:[e],u=e=>void 0===e,l=e=>s(e)||Array.isArray(e)?Object.keys(e):[],d=(e,t)=>e.hasOwnProperty(t),p=e=>t(n(e)),f=e=>u(e)||Array.isArray(e)&&0===e.length,_=(t,n)=>u(t)&&0===n||u(n)&&0===t||e(t,n),m=t=>u(t)||e(t,{})||!0===t,h=t=>u(t)||e(t,{}),g=e=>u(e)||s(e)||!0===e||!1===e;function A(t,n){return!(!f(t)||!f(n))||e(p(t),p(n))}function y(t,r,i,o){var s=n(l(t).concat(l(r)));return!(!h(t)||!h(r))||(!h(t)||!l(r).length)&&((!h(r)||!l(t).length)&&s.every((function(n){var i=t[n],s=r[n];return Array.isArray(i)&&Array.isArray(s)?e(p(t),p(r)):!(Array.isArray(i)&&!Array.isArray(s))&&(!(Array.isArray(s)&&!Array.isArray(i))&&((e,t,n,r)=>t&&d(t,n)&&e&&d(e,n)&&r(e[n],t[n]))(t,r,n,o))})))}function v(e,t,n,i){var s=r(e,i),a=r(t,i);return o(s,a,i).length===Math.max(s.length,a.length)}var b={title:e,uniqueItems:(t,n)=>u(t)&&!1===n||u(n)&&!1===t||e(t,n),minLength:_,minItems:_,minProperties:_,required:A,enum:A,type:function(t,n){return t=c(t),n=c(n),e(p(t),p(n))},items:function(t,n,r,i){return s(t)&&s(n)?i(t,n):Array.isArray(t)&&Array.isArray(n)?y(t,n,0,i):e(t,n)},anyOf:v,allOf:v,oneOf:v,properties:y,patternProperties:y,dependencies:y},C=["properties","patternProperties","dependencies","uniqueItems","minLength","minItems","minProperties","required"],E=["additionalProperties","additionalItems","contains","propertyNames","not"];return src$1=function t(r,o,s){if(s=i(s,{ignore:[]}),m(r)&&m(o))return!0;if(!g(r)||!g(o))throw new Error("Either of the values are not a JSON schema.");if(r===o)return!0;if(a(r)&&a(o))return r===o;if(void 0===r&&!1===o||void 0===o&&!1===r)return!1;if(u(r)&&!u(o)||!u(r)&&u(o))return!1;var c=n(Object.keys(r).concat(Object.keys(o)));if(s.ignore.length&&(c=c.filter((e=>-1===s.ignore.indexOf(e)))),!c.length)return!0;function l(e,n){return t(e,n,s)}return c.every((function(n){var i=r[n],c=o[n];if(-1!==E.indexOf(n))return t(i,c,s);var u=b[n];if(u||(u=e),e(i,c))return!0;if(-1===C.indexOf(n)&&(!d(r,n)&&d(o,n)||d(r,n)&&!d(o,n)))return i===c;var p=u(i,c,n,l);if(!a(p))throw new Error("Comparer must return true or false");return p}))},src$1}function requireLib$6(){if(hasRequiredLib$6)return lib$6;return hasRequiredLib$6=1,lib$6=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}}function requireLib$5(){if(hasRequiredLib$5)return lib$5;return hasRequiredLib$5=1,lib$5=function(e){return("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))&&e.valueOf()==e.valueOf()}}function requireLib$4(){if(hasRequiredLib$4)return lib$4;hasRequiredLib$4=1;var e=requireLib$5();return lib$4=function(t){return e(t)&&t%1==0}}function requireLib$3(){if(hasRequiredLib$3)return lib$3;hasRequiredLib$3=1;var e=requireLib$6(),t=requireLib$4();return lib$3=function(n){var r;if(!e(n))return!1;if(!(r=n.length))return!1;for(var i=0;it&&(n=t,t=e,e=n),t-=e}return r*e}function o(e,t){var n,r=0;if(0===e)return t;if(0===t)return e;for(;!(1&e||1&t);)e>>>=1,t>>>=1,r++;for(;!(1&e);)e>>>=1;for(;t;){for(;!(1&t);)t>>>=1;e>t&&(n=t,t=e,e=n),t-=e}return e<1){if(c=s[0],a=s[1],!n(a))throw new TypeError("gcd()::invalid input argument. Accessor must be a function. Value: `"+a+"`.")}else c=s[0]}if((u=c.length)<2)return null;if(a){for(l=new Array(u),p=0;p1){if(s=i[0],o=i[1],!r(o))throw new TypeError("lcm()::invalid input argument. Accessor must be a function. Value: `"+o+"`.")}else s=i[0]}if((a=s.length)<2)return null;if(o){for(c=new Array(a),l=0;l1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(s=n.length>3&&"function"==typeof s?(o--,s):void 0,a&&t(r[0],r[1],a)&&(s=o<3?void 0:s,o=1),e=Object(e);++i-1;)f!==s&&o.call(f,_,1),o.call(s,_,1);return s},_basePullAll}function requirePullAll(){if(hasRequiredPullAll)return pullAll_1;hasRequiredPullAll=1;var e=require_basePullAll();return pullAll_1=function(t,n){return t&&t.length&&n&&n.length?e(t,n):t},pullAll_1}function require_castFunction(){if(hasRequired_castFunction)return _castFunction;hasRequired_castFunction=1;var e=requireIdentity();return _castFunction=function(t){return"function"==typeof t?t:e}}function requireForEach$1(){if(hasRequiredForEach$1)return forEach_1;hasRequiredForEach$1=1;var e=require_arrayEach(),t=require_baseEach(),n=require_castFunction(),r=requireIsArray();return forEach_1=function(i,o){return(r(i)?e:t)(i,n(o))}}function require_baseDifference(){if(hasRequired_baseDifference)return _baseDifference;hasRequired_baseDifference=1;var e=require_SetCache(),t=require_arrayIncludes(),n=require_arrayIncludesWith(),r=require_arrayMap(),i=require_baseUnary(),o=require_cacheHas();return _baseDifference=function(s,a,c,u){var l=-1,d=t,p=!0,f=s.length,_=[],m=a.length;if(!f)return _;c&&(a=r(a,i(c))),u?(d=n,p=!1):a.length>=200&&(d=o,p=!1,a=new e(a));e:for(;++lObject.prototype.hasOwnProperty.call(e,t),a=e=>n(e)||Array.isArray(e)?Object.keys(e):[],c=e=>!a(e).length&&!1!==e&&!0!==e;return common={allUniqueKeys:e=>r(t(e.map(a))),deleteUndefinedProps:function(e){for(const t in e)s(e,t)&&c(e[t])&&delete e[t];return e},getValues:(e,t)=>e.map((e=>e&&e[t])),has:s,isEmptySchema:c,isSchema:e=>n(e)||!0===e||!1===e,keys:a,notUndefined:e=>void 0!==e,uniqWith:i,withoutArr:(t,...n)=>o.apply(null,[t].concat(e(n)))},common}function requireProperties(){if(hasRequiredProperties)return properties;hasRequiredProperties=1;const e=requireSrc$1(),t=requireForEach$1(),{allUniqueKeys:n,deleteUndefinedProps:r,getValues:i,keys:o,notUndefined:s,uniqWith:a,withoutArr:c}=requireCommon();function u(t,r){return n(t).reduce((function(n,o){const c=i(t,o),u=a(c.filter(s),e);return n[o]=r(u,o),n}),{})}return properties={keywords:["properties","patternProperties","additionalProperties"],resolver(e,n,i,s){s.ignoreAdditionalProperties||(e.forEach((function(t){const n=e.filter((e=>e!==t)),r=o(t.properties),s=o(t.patternProperties).map((e=>new RegExp(e)));n.forEach((function(e){const n=o(e.properties),a=n.filter((e=>s.some((t=>t.test(e)))));c(n,r,a).forEach((function(n){e.properties[n]=i.properties([e.properties[n],t.additionalProperties],n)}))}))})),e.forEach((function(t){const n=e.filter((e=>e!==t)),r=o(t.patternProperties);!1===t.additionalProperties&&n.forEach((function(e){const t=o(e.patternProperties);c(t,r).forEach((t=>delete e.patternProperties[t]))}))})));const a={additionalProperties:i.additionalProperties(e.map((e=>e.additionalProperties))),patternProperties:u(e.map((e=>e.patternProperties)),i.patternProperties),properties:u(e.map((e=>e.properties)),i.properties)};var l;return!1===a.additionalProperties&&t(l=a.properties,(function(e,t){!1===e&&delete l[t]})),r(a)}},properties}function requireItems(){if(hasRequiredItems)return items;hasRequiredItems=1;const e=requireSrc$1(),t=requireForEach$1(),{allUniqueKeys:n,deleteUndefinedProps:r,has:i,isSchema:o,notUndefined:s,uniqWith:a}=requireCommon();function c(t,r,c){return n(c).reduce((function(n,c){const u=function(e,t){return e.map((function(e){if(e){if(!Array.isArray(e.items))return e.items;{const n=e.items[t];if(o(n))return n;if(i(e,"additionalItems"))return e.additionalItems}}}))}(t,c),l=a(u.filter(s),e);return n[c]=r(l,c),n}),[])}return items={keywords:["items","additionalItems"],resolver(e,n,i){const a=e.map((e=>e.items)),u=a.filter(s),l={};let d;var p;return u.every(o)?l.items=i.items(a):l.items=c(e,i.items,a),u.every(Array.isArray)?d=e.map((e=>e.additionalItems)):u.some(Array.isArray)&&(d=e.map((function(e){if(e)return Array.isArray(e.items)?e.additionalItems:e.items}))),d&&(l.additionalItems=i.additionalItems(d)),!1===l.additionalItems&&Array.isArray(l.items)&&(p=l.items,t(p,(function(e,t){!1===e&&p.splice(t,1)}))),r(l)}},items}function requireSrc(){if(hasRequiredSrc)return src;hasRequiredSrc=1;const e=requireCloneDeep(),t=requireSrc$1(),n=requireLib(),r=requireDefaultsDeep(),i=requireFlatten(),o=requireFlattenDeep(),s=requireIntersection(),a=requireIntersectionWith(),c=requireIsEqual(),u=requireIsPlainObject(),l=requirePullAll(),d=requireSortBy(),p=requireUniq(),f=requireUniqWith(),_=requireProperties(),m=requireItems(),h=(e,t)=>-1!==e.indexOf(t),g=e=>u(e)||!0===e||!1===e,A=e=>!1===e,y=e=>!0===e,v=(e,t,n)=>n(e),b=e=>d(p(o(e))),C=e=>void 0!==e,E=e=>p(o(e.map(I))),x=e=>e[0],S=e=>Math.max.apply(Math,e),k=e=>Math.min.apply(Math,e);function D(e){let{allOf:t=[],...n}=e;return n=u(e)?n:e,[n,...t.map(D)]}function w(e,t){return e.map((e=>e&&e[t]))}function I(e){return u(e)||Array.isArray(e)?Object.keys(e):[]}function T(e,t){if(t=t||[],!e.length)return t;const n=e.slice(0).shift(),r=e.slice(1);return t.length?T(r,i(t.map((e=>n.map((t=>[t].concat(e))))))):T(r,n.map((e=>e)))}function R(e,t){let n;try{n=e.map((function(e){return JSON.stringify(e,null,2)})).join("\n")}catch(t){n=e.join(", ")}throw new Error('Could not resolve values for path:"'+t.join(".")+'". They are probably incompatible. Values: \n'+n)}function F(e,n,r,i,o,s){if(e.length){const a=o.complexResolvers[n];if(!a||!a.resolver)throw new Error("No resolver found for "+n);const c=r.map((t=>e.reduce(((e,n)=>(void 0!==t[n]&&(e[n]=t[n]),e)),{}))),l=f(c,t),d=a.keywords.reduce(((e,t)=>({...e,[t]:(e,n=[])=>i(e,null,s.concat(t,n))})),{}),p=a.resolver(l,s.concat(n),d,o);return u(p)||R(l,s.concat(n)),p}}function P(e){return{required:e}}const N=["properties","patternProperties","definitions","dependencies"],B=["anyOf","oneOf"],O=["additionalProperties","additionalItems","contains","propertyNames","not","items"],q={type(e){if(e.some(Array.isArray)){const t=e.map((function(e){return Array.isArray(e)?e:[e]})),n=s.apply(null,t);if(1===n.length)return n[0];if(n.length>1)return p(n)}},dependencies:(e,n,r)=>E(e).reduce((function(n,i){const o=w(e,i);let s=f(o.filter(C),c);const a=s.filter(Array.isArray);if(a.length){if(a.length===s.length)n[i]=b(s);else{const e=s.filter(g),t=a.map(P);n[i]=r(e.concat(t),i)}return n}return s=f(s,t),n[i]=r(s,i),n}),{}),oneOf(n,r,i){const o=function(e,t){return e.map((function(e,n){try{return t(e,n)}catch(e){return}})).filter(C)}(T(e(n)),i),s=f(o,t);if(s.length)return s},not:e=>({anyOf:e}),pattern:e=>e.map((e=>"(?="+e+")")).join(""),multipleOf(e){let t=e.slice(0),r=1;for(;t.some((e=>!Number.isInteger(e)));)t=t.map((e=>10*e)),r*=10;return n(t)/r},enum(e){const t=a.apply(null,e.concat(c));if(t.length)return d(t)}};q.$id=x,q.$ref=x,q.$schema=x,q.additionalItems=v,q.additionalProperties=v,q.anyOf=q.oneOf,q.contains=v,q.default=x,q.definitions=q.dependencies,q.description=x,q.examples=e=>f(i(e),c),q.exclusiveMaximum=k,q.exclusiveMinimum=S,q.items=m,q.maximum=k,q.maxItems=k,q.maxLength=k,q.maxProperties=k,q.minimum=S,q.minItems=S,q.minLength=S,q.minProperties=S,q.properties=_,q.propertyNames=v,q.required=e=>b(e),q.title=x,q.uniqueItems=e=>e.some(y);const $={properties:_,items:m};function Q(n,i,s){i=r(i,{ignoreAdditionalProperties:!1,resolvers:q,complexResolvers:$,deep:!0});const a=Object.entries(i.complexResolvers);const c=function n(r,o,s){r=e(r.filter(C)),s=s||[];const c=u(o)?o:{};if(!r.length)return;if(r.some(A))return!1;if(r.every(y))return!0;r=r.filter(u);const d=E(r);if(i.deep&&h(d,"allOf"))return Q({allOf:r},i);const p=a.map((([e,t])=>d.filter((e=>t.keywords.includes(e)))));return p.forEach((e=>l(d,e))),d.forEach((function(e){const o=w(r,e),a=f(o.filter(C),function(e){return function(n,r){return t({[e]:n},{[e]:r})}}(e));if(1===a.length&&h(B,e))c[e]=a[0].map((e=>n([e],e)));else if(1!==a.length||h(N,e)||h(O,e)){const t=i.resolvers[e]||i.resolvers.defaultResolver;if(!t)throw new Error("No resolver found for key "+e+". You can provide a resolver for this keyword in the options, or provide a default resolver.");const r=(t,r=[])=>n(t,null,s.concat(e,r));c[e]=t(a,s.concat(e),r,i),void 0===c[e]?R(a,s.concat(e)):void 0===c[e]&&delete c[e]}else c[e]=a[0]})),a.reduce(((e,[t,o],a)=>({...e,...F(p[a],t,r,n,i,s)})),c)}(o(D(n)));return c}return Q.options={resolvers:q},src=Q}_cloneBuffer.exports;var srcExports=requireSrc(),mergeJSONSchemaAllOf=getDefaultExportFromCjs(srcExports);function isObject$2(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function isEmptyObject(e){return"object"==typeof e&&null!==e&&!Object.keys(e).length}function stripEmptyObjects(e){const t=e;return isObject$2(e)||Array.isArray(t)?null!==e?Array.isArray(t)?(t.forEach(((e,n)=>{let r=e;"object"==typeof r&&null!==r?(r=stripEmptyObjects(r),isEmptyObject(r)?delete t[n]:t[n]=r):null===r&&delete t[n]})),t.filter((e=>void 0!==e))):(Object.keys(t).forEach((e=>{let n=t[e];"object"==typeof n&&null!==n&&(n=stripEmptyObjects(n),isEmptyObject(n)?delete t[e]:t[e]=n)})),t):void 0:t}function removeUndefinedObjects(e){if(void 0===e)return;let t=JSON.parse(JSON.stringify(e));return t=stripEmptyObjects(t),isEmptyObject(t)?void 0:t}function cloneObject(e){if(void 0!==e)return JSON.parse(JSON.stringify(e))}function hasSchemaType(e,t){return Array.isArray(e.type)?e.type.includes(t):e.type===t}function isObject$1(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function isPrimitive(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e}function matchesMediaType(e,t){return e.some((e=>t.indexOf(e)>-1))}var matches_mimetype_default={formUrlEncoded:e=>matchesMediaType(["application/x-www-form-urlencoded"],e),json:e=>matchesMediaType(["application/json","application/x-json","text/json","text/x-json","+json"],e),multipart:e=>matchesMediaType(["multipart/mixed","multipart/related","multipart/form-data","multipart/alternative"],e),wildcard:e=>"*/*"===e,xml:e=>matchesMediaType(["application/xml","application/xml-external-parsed-entity","application/xml-dtd","text/xml","text/xml-external-parsed-entity","+xml"],e)},UNSUPPORTED_SCHEMA_PROPS=["example","externalDocs","xml"];function encodePointer(e){return e.replace("~","~0").replace("/","~1")}function getSchemaVersionString(e,t){return isOAS31(t)?e.$schema?e.$schema:t.jsonSchemaDialect?t.jsonSchemaDialect:"https://json-schema.org/draft/2020-12/schema#":"http://json-schema.org/draft-04/schema#"}function isPolymorphicSchema(e){return"allOf"in e||"anyOf"in e||"oneOf"in e}function isRequestBodySchema(e){return"content"in e}function searchForValueByPropAndPointer(e,t,n=[]){if(!n.length||!t.length)return;const r=t.split("/").filter(Boolean).reverse(),i=[];let o,s="";for(let e=0;e!0,transformer:e=>e,...t};if(isRef(n))return p(n.$ref,"ref"),f({$ref:n.$ref});if(isSchema(n,u)){if("allOf"in n&&Array.isArray(n.allOf)){try{n=mergeJSONSchemaAllOf(n,{ignoreAdditionalProperties:!0,resolvers:{description:e=>e.slice(-1)[0],enum:e=>{let t=[];return e.forEach((e=>{t=t.concat(e)})),t},defaultResolver:mergeJSONSchemaAllOf.options.resolvers.title}})}catch(e){const{...t}=n;n=t,delete n.allOf}if(isRef(n))return p(n.$ref,"ref"),f({$ref:n.$ref})}if(["anyOf","oneOf"].forEach((e=>{e in n&&Array.isArray(n[e])&&n[e].forEach(((t,r)=>{const u={addEnumsToDescriptions:i,currentLocation:`${o}/${r}`,globalDefaults:s,hideReadOnlyProperties:a,hideWriteOnlyProperties:c,isPolymorphicAllOfChild:!1,prevDefaultSchemas:l,prevExampleSchemas:d,refLogger:p,transformer:f};n[e][r]=toJSONSchema("properties"in n?{required:n.required,allOf:[t,{properties:n.properties}]}:"items"in n?{allOf:[t,{items:n.items}]}:t,u),isObject$1(n[e][r])&&"required"in n[e][r]&&"boolean"==typeof n[e][r].required&&delete n[e][r].required}))})),"discriminator"in n&&"mapping"in n.discriminator&&"object"==typeof n.discriminator.mapping){const e=n.discriminator.mapping;Object.keys(e).forEach((t=>{p(e[t],"discriminator")}))}}if("type"in n||isPolymorphicSchema(n)||isRequestBodySchema(n)||("properties"in n?n.type="object":"items"in n&&(n.type="array")),"type"in n)if("nullable"in n&&(n.nullable&&(Array.isArray(n.type)?n.type.push("null"):null!==n.type&&"null"!==n.type&&(n.type=[n.type,"null"])),delete n.nullable),null===n.type)n.type="null";else if(Array.isArray(n.type))if(n.type.includes(null)&&(n.type[n.type.indexOf(null)]="null"),n.type=Array.from(new Set(n.type)),1===n.type.length)n.type=n.type.shift();else if(n.type.includes("array")||n.type.includes("boolean")||n.type.includes("object")){const e=n.type.includes("null");if(2===n.type.length&&e);else{const t=[];Object.entries({array:["additionalItems","contains","items","maxContains","maxItems","minContains","minItems","prefixItems","uniqueItems"],boolean:[],object:["additionalProperties","maxProperties","minProperties","nullable","patternProperties","properties","propertyNames","required"]}).forEach((([r,i])=>{if(!n.type.includes(r))return;const o=removeUndefinedObjects({type:e?[r,"null"]:r,allowEmptyValue:n.allowEmptyValue??void 0,deprecated:n.deprecated??void 0,description:n.description??void 0,readOnly:n.readOnly??void 0,title:n.title??void 0,writeOnly:n.writeOnly??void 0});i.forEach((e=>{e in n&&(o[e]=n[e],delete n[e])})),t.push(o)})),n.type=n.type.filter((e=>"array"!==e&&"boolean"!==e&&"object"!==e)),1===n.type.length&&(n.type=n.type.shift()),n=n.type.length>1?{oneOf:[n,...t]}:{oneOf:t}}}if(isSchema(n,u)){if("default"in n&&isObject$1(n.default)&&l.push({default:n.default}),"example"in n)isPrimitive(n.example)?n.examples=[n.example]:Array.isArray(n.example)?(n.examples=n.example.filter((e=>isPrimitive(e))),n.examples.length||delete n.examples):d.push({example:n.example}),delete n.example;else if("examples"in n){let e=!1;if("object"!=typeof n.examples||Array.isArray(n.examples))Array.isArray(n.examples)&&isPrimitive(n.examples[0])&&(e=!0);else{const t=[];Object.keys(n.examples).forEach((r=>{const i=n.examples[r];"$ref"in i?p(i.$ref,"ref"):"value"in i&&(isPrimitive(i.value)?(t.push(i.value),e=!0):Array.isArray(i.value)&&isPrimitive(i.value[0])?(t.push(i.value[0]),e=!0):d.push({example:i.value}))})),t.length&&(e=!0,n.examples=t)}e||delete n.examples}if(!hasSchemaType(n,"array")&&!hasSchemaType(n,"object")&&!n.examples){const e=searchForValueByPropAndPointer("example",o,d);e&&(isPrimitive(e)||Array.isArray(e)&&isPrimitive(e[0]))&&(n.examples=[e])}if(hasSchemaType(n,"array"))"items"in n?!Array.isArray(n.items)&&1===Object.keys(n.items).length&&isRef(n.items)?p(n.items.$ref,"ref"):!0!==n.items&&(n.items=toJSONSchema(n.items,{addEnumsToDescriptions:i,currentLocation:`${o}/0`,globalDefaults:s,hideReadOnlyProperties:a,hideWriteOnlyProperties:c,prevExampleSchemas:d,refLogger:p,transformer:f}),isObject$1(n.items)&&"required"in n.items&&!Array.isArray(n.items.required)&&delete n.items.required):"properties"in n||"additionalProperties"in n?n.type="object":n.items={};else if(hasSchemaType(n,"object")){if("properties"in n&&(Object.keys(n.properties).forEach((e=>{if(Array.isArray(n.properties[e])||"object"==typeof n.properties[e]&&null!==n.properties[e]){const t=toJSONSchema(n.properties[e],{addEnumsToDescriptions:i,currentLocation:`${o}/${encodePointer(e)}`,globalDefaults:s,hideReadOnlyProperties:a,hideWriteOnlyProperties:c,prevDefaultSchemas:l,prevExampleSchemas:d,refLogger:p,transformer:f});let r=!0;!a&&!c||Object.keys(t).length||Object.keys(n.properties[e]).length>0&&(delete n.properties[e],r=!1),r&&(n.properties[e]=t,isObject$1(t)&&"required"in t&&"boolean"==typeof t.required&&!0===t.required&&("required"in n&&Array.isArray(n.required)?n.required.push(e):n.required=[e],delete n.properties[e].required))}})),(a||c)&&!Object.keys(n.properties).length))return f({});"object"==typeof r&&null!==r&&("type"in r||"$ref"in r||isPolymorphicSchema(r)?n.additionalProperties=toJSONSchema(r,{addEnumsToDescriptions:i,currentLocation:o,globalDefaults:s,hideReadOnlyProperties:a,hideWriteOnlyProperties:c,prevDefaultSchemas:l,prevExampleSchemas:d,refLogger:p,transformer:f}):n.additionalProperties=!0),isPolymorphicSchema(n)||"properties"in n||"additionalProperties"in n||(n.additionalProperties=!0)}}if(isSchema(n,u)&&s&&Object.keys(s).length>0&&o)try{const e=jsonPointer.get(s,o);e&&(n.default=e)}catch(e){}if("default"in n&&void 0!==n.default)hasSchemaType(n,"object")?delete n.default:"allowEmptyValue"in n&&n.allowEmptyValue&&""===n.default||""!==n.default||delete n.default;else if(l.length){const e=searchForValueByPropAndPointer("default",o,l);(isPrimitive(e)||null===e||Array.isArray(e)&&hasSchemaType(n,"array"))&&(n.default=e)}if(isSchema(n,u)&&"enum"in n&&Array.isArray(n.enum)&&(n.enum=Array.from(new Set(n.enum)),i)){const e=n.enum.filter(Boolean).map((e=>`\`${e}\``)).join(" ");e.length&&("description"in n?n.description+=`\n\n${e}`:n.description=e)}("anyOf"in n||"oneOf"in n)&&("properties"in n&&delete n.properties,"items"in n&&delete n.items);for(let e=0;e{const t=i.properties[e];!t.deprecated||s.includes(e)||t.readOnly||(a[e]=t)})),i.properties=a;const c=toJSONSchema(i,{globalDefaults:n.globalDefaults,hideReadOnlyProperties:n.hideReadOnlyProperties,hideWriteOnlyProperties:n.hideWriteOnlyProperties,prevExampleSchemas:[],refLogger:o,transformer:n.transformer});return 0===Object.keys(c).length||0===Object.keys(c.properties).length?null:(Object.keys(e.properties).forEach((t=>{e.properties[t].deprecated&&!s.includes(t)&&delete e.properties[t]})),{type:r,schema:isPrimitive(c)?c:{...c,$schema:getSchemaVersionString(c,t)}})}if(!e.hasParameters()&&!e.hasRequestBody())return null;const a=getExtension(PARAMETER_ORDERING,t,e).map((e=>e.toLowerCase()));a[a.indexOf("form")]="formData",a.push("metadata");const c=[function(){const r=e.getRequestBody();if(!r||!Array.isArray(r))return null;const[i,a,c]=r,u="application/x-www-form-urlencoded"===i?"formData":"body";if(!a.schema||!Object.keys(a.schema).length)return null;const l=[];"example"in a?l.push({example:a.example}):"examples"in a&&l.push({examples:Object.values(a.examples).map((e=>e.value)).filter((e=>void 0!==e))});const d=toJSONSchema(cloneObject(a.schema),{globalDefaults:n.globalDefaults,hideReadOnlyProperties:n.hideReadOnlyProperties,hideWriteOnlyProperties:n.hideWriteOnlyProperties,prevExampleSchemas:l,refLogger:o,transformer:n.transformer});return Object.keys(d).length?{type:u,label:types[u],schema:isPrimitive(d)?d:{...d,$schema:getSchemaVersionString(d,t)},deprecatedProps:s(d,u),...c?{description:c}:{}}:null}()].concat(...function(){const r=e.getParameters(),i=Object.keys(types).map((e=>{const i=[],a=r.filter((t=>t.in===e));if(0===a.length)return null;const c={type:"object",properties:a.reduce(((e,r)=>{let s={};if("schema"in r){const e=r.schema?cloneObject(r.schema):{};r.example?e.example=r.example:r.examples&&(e.examples=r.examples),r.deprecated&&(e.deprecated=r.deprecated);const i=toJSONSchema(e,{currentLocation:`/${r.name}`,globalDefaults:n.globalDefaults,hideReadOnlyProperties:n.hideReadOnlyProperties,hideWriteOnlyProperties:n.hideWriteOnlyProperties,refLogger:o,transformer:n.transformer});s=isPrimitive(i)?i:{...i,$schema:getSchemaVersionString(e,t)}}else if("content"in r&&"object"==typeof r.content){const e=Object.keys(r.content);if(e.length){let i;if(1===e.length)i=e[0];else{const t=e.filter((e=>matches_mimetype_default.json(e)));i=t.length?t[0]:e[0]}if("object"==typeof r.content[i]&&"schema"in r.content[i]){const e=r.content[i].schema?cloneObject(r.content[i].schema):{};r.example?e.example=r.example:r.examples&&(e.examples=r.examples),r.deprecated&&(e.deprecated=r.deprecated);const a=toJSONSchema(e,{currentLocation:`/${r.name}`,globalDefaults:n.globalDefaults,hideReadOnlyProperties:n.hideReadOnlyProperties,hideWriteOnlyProperties:n.hideWriteOnlyProperties,refLogger:o,transformer:n.transformer});s=isPrimitive(a)?a:{...a,$schema:getSchemaVersionString(e,t)}}}}return r.description&&(isPrimitive(s)||(s.description=r.description)),e[r.name]=s,r.required&&i.push(r.name),e}),{}),required:i};return{type:e,label:types[e],schema:c,deprecatedProps:s(c,e)}})).filter(Boolean);if(!n.mergeIntoBodyAndMetadata)return i;if(!i.length)return[];const a=i.map((e=>e.deprecatedProps?.schema||null)).filter(Boolean);return[{type:"metadata",label:types.metadata,schema:{allOf:i.map((e=>e.schema))},deprecatedProps:a.length?{type:"metadata",schema:{allOf:a}}:null}]}()).filter(Boolean),u=r||i&&n.includeDiscriminatorMappingRefs,l=!!u&&function(){if(!("components"in t))return!1;const e={...Object.keys(t.components).map((e=>({[e]:{}}))).reduce(((e,t)=>Object.assign(e,t)),{})};return Object.keys(t.components).forEach((r=>{"object"!=typeof t.components[r]||Array.isArray(t.components[r])||Object.keys(t.components[r]).forEach((i=>{const s=cloneObject(t.components[r][i]);e[r][i]=toJSONSchema(s,{globalDefaults:n.globalDefaults,hideReadOnlyProperties:n.hideReadOnlyProperties,hideWriteOnlyProperties:n.hideWriteOnlyProperties,refLogger:o,transformer:n.transformer})}))})),Object.keys(e).forEach((t=>{Object.keys(e[t]).length||delete e[t]})),e}();return c.map((e=>(l&&u&&(e.schema.components=l),e.deprecatedProps||delete e.deprecatedProps,e))).sort(((e,t)=>a.indexOf(e.type)-a.indexOf(t.type)))}function requireNoop(){return hasRequiredNoop?noop:(hasRequiredNoop=1,noop=function(){})}function requireIsValue(){if(hasRequiredIsValue)return isValue;hasRequiredIsValue=1;var e=requireNoop()();return isValue=function(t){return t!==e&&null!==t}}function requireNormalizeOptions(){if(hasRequiredNormalizeOptions)return normalizeOptions;hasRequiredNormalizeOptions=1;var e=requireIsValue(),t=Array.prototype.forEach,n=Object.create;return normalizeOptions=function(r){var i=n(null);return t.call(arguments,(function(t){e(t)&&function(e,t){var n;for(n in e)t[n]=e[n]}(Object(t),i)})),i},normalizeOptions}function requireIsImplemented$7(){return hasRequiredIsImplemented$7||(hasRequiredIsImplemented$7=1,isImplemented$7=function(){var e=Math.sign;return"function"==typeof e&&(1===e(10)&&-1===e(-20))}),isImplemented$7}function requireShim$5(){return hasRequiredShim$5?shim$5:(hasRequiredShim$5=1,shim$5=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1})}function requireSign(){return hasRequiredSign?sign:(hasRequiredSign=1,sign=requireIsImplemented$7()()?Math.sign:requireShim$5())}function requireToInteger(){if(hasRequiredToInteger)return toInteger;hasRequiredToInteger=1;var e=requireSign(),t=Math.abs,n=Math.floor;return toInteger=function(r){return isNaN(r)?0:0!==(r=Number(r))&&isFinite(r)?e(r)*n(t(r)):r}}function requireToPosInteger(){if(hasRequiredToPosInteger)return toPosInteger;hasRequiredToPosInteger=1;var e=requireToInteger(),t=Math.max;return toPosInteger=function(n){return t(0,e(n))}}function requireResolveLength(){if(hasRequiredResolveLength)return resolveLength;hasRequiredResolveLength=1;var e=requireToPosInteger();return resolveLength=function(t,n,r){var i;return isNaN(t)?(i=n)>=0?r&&i?i-1:i:1:!1!==t&&e(t)}}function requireValidCallable(){return hasRequiredValidCallable?validCallable:(hasRequiredValidCallable=1,validCallable=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e})}function requireValidValue(){if(hasRequiredValidValue)return validValue;hasRequiredValidValue=1;var e=requireIsValue();return validValue=function(t){if(!e(t))throw new TypeError("Cannot use null or undefined");return t}}function require_iterate(){if(hasRequired_iterate)return _iterate;hasRequired_iterate=1;var e=requireValidCallable(),t=requireValidValue(),n=Function.prototype.bind,r=Function.prototype.call,i=Object.keys,o=Object.prototype.propertyIsEnumerable;return _iterate=function(s,a){return function(c,u){var l,d=arguments[2],p=arguments[3];return c=Object(t(c)),e(u),l=i(c),p&&l.sort("function"==typeof p?n.call(p,c):void 0),"function"!=typeof s&&(s=l[s]),r.call(s,l,(function(e,t){return o.call(c,e)?r.call(u,d,c[e],e,c,t):a}))}},_iterate}function requireForEach(){return hasRequiredForEach?forEach:(hasRequiredForEach=1,forEach=require_iterate()("forEach"))}var registeredExtensions={},hasRequiredRegisteredExtensions;function requireRegisteredExtensions(){return hasRequiredRegisteredExtensions||(hasRequiredRegisteredExtensions=1),registeredExtensions}var custom={exports:{}},isImplemented$6,hasRequiredIsImplemented$6,isImplemented$5,hasRequiredIsImplemented$5,shim$4,hasRequiredShim$4,keys,hasRequiredKeys,shim$3,hasRequiredShim$3,assign,hasRequiredAssign,isObject,hasRequiredIsObject,hasRequiredCustom;function requireIsImplemented$6(){return hasRequiredIsImplemented$6||(hasRequiredIsImplemented$6=1,isImplemented$6=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}),isImplemented$6}function requireIsImplemented$5(){return hasRequiredIsImplemented$5?isImplemented$5:(hasRequiredIsImplemented$5=1,isImplemented$5=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}})}function requireShim$4(){if(hasRequiredShim$4)return shim$4;hasRequiredShim$4=1;var e=requireIsValue(),t=Object.keys;return shim$4=function(n){return t(e(n)?Object(n):n)}}function requireKeys(){return hasRequiredKeys?keys:(hasRequiredKeys=1,keys=requireIsImplemented$5()()?Object.keys:requireShim$4())}function requireShim$3(){if(hasRequiredShim$3)return shim$3;hasRequiredShim$3=1;var e=requireKeys(),t=requireValidValue(),n=Math.max;return shim$3=function(r,i){var o,s,a,c=n(arguments.length,2);for(r=Object(t(r)),a=function(e){try{r[e]=i[e]}catch(e){o||(o=e)}},s=1;s-1},shim$2}function requireContains(){return hasRequiredContains?contains:(hasRequiredContains=1,contains=requireIsImplemented$4()()?String.prototype.contains:requireShim$2())}function requireD(){if(hasRequiredD)return d.exports;hasRequiredD=1;var e=requireIs$4(),t=requireIs(),n=requireAssign(),r=requireNormalizeOptions(),i=requireContains(),o=d.exports=function(t,o){var s,a,c,u,l;return arguments.length<2||"string"!=typeof t?(u=o,o=t,t=null):u=arguments[2],e(t)?(s=i.call(t,"c"),a=i.call(t,"e"),c=i.call(t,"w")):(s=c=!0,a=!1),l={value:o,configurable:s,enumerable:a,writable:c},u?n(r(u),l):l};return o.gs=function(o,s,a){var c,u,l,d;return"string"!=typeof o?(l=a,a=s,s=o,o=null):l=arguments[3],e(s)?t(s)?e(a)?t(a)||(l=a,a=void 0):a=void 0:(l=s,s=a=void 0):s=void 0,e(o)?(c=i.call(o,"c"),u=i.call(o,"e")):(c=!0,u=!1),d={get:s,set:a,configurable:c,enumerable:u},l?n(r(l),d):d},d.exports}var eventEmitter={exports:{}},hasRequiredEventEmitter,isImplemented$3,hasRequiredIsImplemented$3,isImplemented$2,hasRequiredIsImplemented$2,implementation,hasRequiredImplementation,globalThis_1,hasRequiredGlobalThis,isImplemented$1,hasRequiredIsImplemented$1,isSymbol,hasRequiredIsSymbol,validateSymbol,hasRequiredValidateSymbol,generateName,hasRequiredGenerateName,standardSymbols,hasRequiredStandardSymbols,symbolRegistry,hasRequiredSymbolRegistry,polyfill,hasRequiredPolyfill,es6Symbol,hasRequiredEs6Symbol,isArguments,hasRequiredIsArguments,isFunction,hasRequiredIsFunction,isString,hasRequiredIsString,shim$1,hasRequiredShim$1,from,hasRequiredFrom,toArray,hasRequiredToArray,resolveResolve,hasRequiredResolveResolve,resolveNormalize,hasRequiredResolveNormalize,configureMap,hasRequiredConfigureMap,plain,hasRequiredPlain,primitive$1,hasRequiredPrimitive,getPrimitiveFixed,hasRequiredGetPrimitiveFixed,isImplemented,hasRequiredIsImplemented,shim,hasRequiredShim,isNan,hasRequiredIsNan,eIndexOf,hasRequiredEIndexOf,get,hasRequiredGet,get1,hasRequiredGet1,getFixed,hasRequiredGetFixed;function requireEventEmitter(){return hasRequiredEventEmitter||(hasRequiredEventEmitter=1,function(e,t){var n,r,i,o,s,a,c,u=requireD(),l=requireValidCallable(),d=Function.prototype.apply,p=Function.prototype.call,f=Object.create,_=Object.defineProperty,m=Object.defineProperties,h=Object.prototype.hasOwnProperty,g={configurable:!0,enumerable:!1,writable:!0};n=function(e,t){var n;return l(t),h.call(this,"__ee__")?n=this.__ee__:(n=g.value=f(null),_(this,"__ee__",g),g.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},r=function(e,t){var r,o;return l(t),o=this,n.call(this,e,r=function(){i.call(o,e,r),d.call(t,this,arguments)}),r.__eeOnceListener__=t,this},i=function(e,t){var n,r,i,o;if(l(t),!h.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"==typeof(r=n[e]))for(o=0;i=r[o];++o)i!==t&&i.__eeOnceListener__!==t||(2===r.length?n[e]=r[o?0:1]:r.splice(o,1));else r!==t&&r.__eeOnceListener__!==t||delete n[e];return this},o=function(e){var t,n,r,i,o;if(h.call(this,"__ee__")&&(i=this.__ee__[e]))if("object"==typeof i){for(n=arguments.length,o=new Array(n-1),t=1;t=55296&&A<=56319&&(C+=p[++_]),C=E?u.call(E,x,C,m):C,f?(l.value=C,d(h,m,l)):h[m]=C,++m;g=m}if(void 0===g)for(g=r(p.length),f&&(h=new f(g)),_=0;_=0?s(l):t(this.length)-s(o(l));c"}}}function requireToShortStringRepresentation(){if(hasRequiredToShortStringRepresentation)return toShortStringRepresentation;hasRequiredToShortStringRepresentation=1;var e=requireSafeToString(),t=/[\n\r\u2028\u2029]/g;return toShortStringRepresentation=function(n){var r=e(n);return r.length>100&&(r=r.slice(0,99)+"…"),r=r.replace(t,(function(e){return JSON.stringify(e).slice(1,-1)}))},toShortStringRepresentation}var isPromise={exports:{}},hasRequiredIsPromise,hasRequiredPromise;function requireIsPromise(){if(hasRequiredIsPromise)return isPromise.exports;function e(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}return hasRequiredIsPromise=1,isPromise.exports=e,isPromise.exports.default=e,isPromise.exports}function requirePromise(){if(hasRequiredPromise)return promise;hasRequiredPromise=1;var e=requireMap(),t=requirePrimitiveSet(),n=requireValidateStringifiableValue(),r=requireToShortStringRepresentation(),i=requireIsPromise(),o=requireNextTick(),s=Object.create,a=t("then","then:finally","done","done:finally");return requireRegisteredExtensions().promise=function(t,c){var u=s(null),l=s(null),d=s(null);if(!0===t)t=null;else if(t=n(t),!a[t])throw new TypeError("'"+r(t)+"' is not valid promise mode");c.on("set",(function(e,n,r){var s=!1;if(!i(r))return l[e]=r,void c.emit("setasync",e,1);u[e]=1,d[e]=r;var a=function(t){var n=u[e];if(s)throw new Error("Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)\nConsider to rely on 'then' or 'done' mode instead.");n&&(delete u[e],l[e]=t,c.emit("setasync",e,n))},p=function(){s=!0,u[e]&&(delete u[e],delete d[e],c.delete(e))},f=t;if(f||(f="then"),"then"===f){var _=function(){o(p)};"function"==typeof(r=r.then((function(e){o(a.bind(this,e))}),_)).finally&&r.finally(_)}else if("done"===f){if("function"!=typeof r.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");r.done(a,p)}else if("done:finally"===f){if("function"!=typeof r.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if("function"!=typeof r.finally)throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");r.done(a),r.finally(p)}})),c.on("get",(function(e,t,n){var r;if(u[e])++u[e];else{r=d[e];var s=function(){c.emit("getasync",e,t,n)};i(r)?"function"==typeof r.done?r.done(s):r.then((function(){o(s)})):s()}})),c.on("delete",(function(e){if(delete d[e],u[e])delete u[e];else if(hasOwnProperty.call(l,e)){var t=l[e];delete l[e],c.emit("deleteasync",e,[t])}})),c.on("clear",(function(){var t=l;l=s(null),u=s(null),d=s(null),c.emit("clearasync",e(t,(function(e){return[e]})))}))},promise}var dispose={},hasRequiredDispose;function requireDispose(){if(hasRequiredDispose)return dispose;hasRequiredDispose=1;var e=requireValidCallable(),t=requireForEach(),n=requireRegisteredExtensions(),r=Function.prototype.apply;return n.dispose=function(i,o,s){var a;if(e(i),s.async&&n.async||s.promise&&n.promise)return o.on("deleteasync",a=function(e,t){r.call(i,null,t)}),void o.on("clearasync",(function(e){t(e,(function(e,t){a(t,e)}))}));o.on("delete",a=function(e,t){i(t)}),o.on("clear",(function(e){t(e,(function(e,t){a(t,e)}))}))},dispose}var maxAge={},maxTimeout,hasRequiredMaxTimeout,validTimeout,hasRequiredValidTimeout,hasRequiredMaxAge;function requireMaxTimeout(){return hasRequiredMaxTimeout?maxTimeout:(hasRequiredMaxTimeout=1,maxTimeout=2147483647)}function requireValidTimeout(){if(hasRequiredValidTimeout)return validTimeout;hasRequiredValidTimeout=1;var e=requireToPosInteger(),t=requireMaxTimeout();return validTimeout=function(n){if((n=e(n))>t)throw new TypeError(n+" exceeds maximum possible timeout");return n}}function requireMaxAge(){if(hasRequiredMaxAge)return maxAge;hasRequiredMaxAge=1;var e=requireFrom(),t=requireForEach(),n=requireNextTick(),r=requireIsPromise(),i=requireValidTimeout(),o=requireRegisteredExtensions(),s=Function.prototype,a=Math.max,c=Math.min,u=Object.create;return o.maxAge=function(l,d,p){var f,_,m,h;(l=i(l))&&(f=u(null),_=p.async&&o.async||p.promise&&o.promise?"async":"",d.on("set"+_,(function(e){f[e]=setTimeout((function(){d.delete(e)}),l),"function"==typeof f[e].unref&&f[e].unref(),h&&(h[e]&&"nextTick"!==h[e]&&clearTimeout(h[e]),h[e]=setTimeout((function(){delete h[e]}),m),"function"==typeof h[e].unref&&h[e].unref())})),d.on("delete"+_,(function(e){clearTimeout(f[e]),delete f[e],h&&("nextTick"!==h[e]&&clearTimeout(h[e]),delete h[e])})),p.preFetch&&(m=!0===p.preFetch||isNaN(p.preFetch)?.333:a(c(Number(p.preFetch),1),0))&&(h={},m=(1-m)*l,d.on("get"+_,(function(t,i,o){h[t]||(h[t]="nextTick",n((function(){var n;"nextTick"===h[t]&&(delete h[t],d.delete(t),p.async&&(i=e(i)).push(s),n=d.memoized.apply(o,i),p.promise&&r(n)&&("function"==typeof n.done?n.done(s,s):n.then(s,s)))})))}))),d.on("clear"+_,(function(){t(f,(function(e){clearTimeout(e)})),f={},h&&(t(h,(function(e){"nextTick"!==e&&clearTimeout(e)})),h={})})))},maxAge}var max={},lruQueue,hasRequiredLruQueue,hasRequiredMax;function requireLruQueue(){if(hasRequiredLruQueue)return lruQueue;hasRequiredLruQueue=1;var e=requireToPosInteger(),t=Object.create,n=Object.prototype.hasOwnProperty;return lruQueue=function(r){var i,o=0,s=1,a=t(null),c=t(null),u=0;return r=e(r),{hit:function(e){var t=c[e],l=++u;if(a[l]=e,c[e]=l,!t){if(++o<=r)return;return e=a[s],i(e),e}if(delete a[t],s===t)for(;!n.call(a,++s);)continue},delete:i=function(e){var t=c[e];if(t&&(delete a[t],delete c[e],--o,s===t)){if(!o)return u=0,void(s=1);for(;!n.call(a,++s);)continue}},clear:function(){o=0,s=1,a=t(null),c=t(null),u=0}}},lruQueue}function requireMax(){if(hasRequiredMax)return max;hasRequiredMax=1;var e=requireToPosInteger(),t=requireLruQueue(),n=requireRegisteredExtensions();return n.max=function(r,i,o){var s,a,c;(r=e(r))&&(a=t(r),s=o.async&&n.async||o.promise&&n.promise?"async":"",i.on("set"+s,c=function(e){void 0!==(e=a.hit(e))&&i.delete(e)}),i.on("get"+s,c),i.on("delete"+s,a.delete),i.on("clear"+s,a.clear))},max}var refCounter={},hasRequiredRefCounter,memoizee,hasRequiredMemoizee;function requireRefCounter(){if(hasRequiredRefCounter)return refCounter;hasRequiredRefCounter=1;var e=requireD(),t=requireRegisteredExtensions(),n=Object.create,r=Object.defineProperties;return t.refCounter=function(i,o,s){var a,c;a=n(null),c=s.async&&t.async||s.promise&&t.promise?"async":"",o.on("set"+c,(function(e,t){a[e]=t||1})),o.on("get"+c,(function(e){++a[e]})),o.on("delete"+c,(function(e){delete a[e]})),o.on("clear"+c,(function(){a={}})),r(o.memoized,{deleteRef:e((function(){var e=o.get(arguments);return null===e?null:a[e]?! --a[e]&&(o.delete(e),!0):null})),getRefCount:e((function(){var e=o.get(arguments);return null===e?0:a[e]?a[e]:0}))})},refCounter}function requireMemoizee(){if(hasRequiredMemoizee)return memoizee;hasRequiredMemoizee=1;var e=requireNormalizeOptions(),t=requireResolveLength(),n=requirePlain();return memoizee=function(r){var i,o=e(arguments[1]);return o.normalizer||0!==(i=o.length=t(o.length,r.length,o.async))&&(o.primitive?!1===i?o.normalizer=requirePrimitive():i>1&&(o.normalizer=requireGetPrimitiveFixed()(i)):o.normalizer=!1===i?requireGet()():1===i?requireGet1()():requireGetFixed()(i)),o.async&&requireAsync(),o.promise&&requirePromise(),o.dispose&&requireDispose(),o.maxAge&&requireMaxAge(),o.max&&requireMax(),o.refCounter&&requireRefCounter(),n(r,o)},memoizee}var memoizeeExports=requireMemoizee(),memoize=getDefaultExportFromCjs(memoizeeExports);function dedupeCommonParameters(e,t){return t.filter((t=>!e.find((e=>t.name&&e.name?t.name===e.name&&t.in===e.in:!(!isRef(t)||!isRef(e))&&t.$ref===e.$ref))))}function usesPolymorphism(e){return e.oneOf?"oneOf":e.anyOf?"anyOf":!!e.allOf&&"allOf"}function objectify(e){return isObject$1(e)?e:{}}function normalizeArray(e){return Array.isArray(e)?e:[e]}function isFunc(e){return"function"==typeof e}function deeplyStripKey(e,t,n=(e,t)=>!0){if("object"!=typeof e||Array.isArray(e)||null===e)return e;const r={...e};return Object.keys(r).forEach((e=>{e===t&&n(r[e],e)?delete r[e]:r[e]=deeplyStripKey(r[e],t,n)})),r}var sampleDefaults=e=>t=>typeof t.default==typeof e?t.default:e,primitives={string:sampleDefaults("string"),string_email:sampleDefaults("user@example.com"),"string_date-time":sampleDefaults((new Date).toISOString()),string_date:sampleDefaults((new Date).toISOString().substring(0,10)),"string_YYYY-MM-DD":sampleDefaults((new Date).toISOString().substring(0,10)),string_uuid:sampleDefaults("3fa85f64-5717-4562-b3fc-2c963f66afa6"),string_hostname:sampleDefaults("example.com"),string_ipv4:sampleDefaults("198.51.100.42"),string_ipv6:sampleDefaults("2001:0db8:5b96:0000:0000:426f:8e17:642a"),number:sampleDefaults(0),number_float:sampleDefaults(0),integer:sampleDefaults(0),boolean:sampleDefaults(!0)},primitive=e=>{e=objectify(e);const{format:t}=e;let{type:n}=e;if("null"===n)return null;Array.isArray(n)&&(1===n.length?n=n[0]:(n.includes("null")&&(n=n.filter((e=>"null"!==e))),n=n.shift()));const r=primitives[`${n}_${t}`]||primitives[n];return isFunc(r)?r(e):`Unknown Type: ${e.type}`};function sampleFromSchema(e,t={}){const n=objectify(e);let{type:r}=n;const i=usesPolymorphism(n);if("allOf"===i)try{return sampleFromSchema(mergeJSONSchemaAllOf(n,{resolvers:{defaultResolver:mergeJSONSchemaAllOf.options.resolvers.title}}),t)}catch(e){return}else if(i){const e=n[i].map((e=>sampleFromSchema(e,t)));return 1===e.length?e[0]:e.some((e=>null===e))?e.find((e=>null!==e)):e[0]}const{example:o,additionalProperties:s,properties:a,items:c}=n,{includeReadOnly:u,includeWriteOnly:l}=t;if(void 0!==o)return deeplyStripKey(o,"$$ref",(e=>"string"==typeof e&&e.indexOf("#")>-1));if(!r)if(a||s)r="object";else{if(!c)return;r="array"}if("object"===r||Array.isArray(r)&&r.includes("object")){const e=objectify(a),n={};for(const r in e)e[r]&&e[r].deprecated||e[r]&&e[r].readOnly&&!u||e[r]&&e[r].writeOnly&&!l||(e[r].examples?.length?n[r]=e[r].examples[0]:n[r]=sampleFromSchema(e[r],t));if(!0===s)n.additionalProp={};else if(s){const e=sampleFromSchema(objectify(s),t);n.additionalProp=e}return n}return"array"===r||Array.isArray(r)&&r.includes("array")?void 0===c?[]:Array.isArray(c.anyOf)?c.anyOf.map((e=>sampleFromSchema(e,t))):Array.isArray(c.oneOf)?c.oneOf.map((e=>sampleFromSchema(e,t))):[sampleFromSchema(c,t)]:e.enum?e.default?e.default:normalizeArray(e.enum)[0]:"file"!==r?primitive(e):void 0}var samples_default=memoize(sampleFromSchema);function getMediaTypeExamples(e,t,n={}){if(t.example)return[{value:t.example}];if(t.examples){const{examples:e}=t,n=Object.keys(e).map((t=>{let n,r=t,i=e[t];if(null!==i&&"object"==typeof i&&("summary"in i&&(r=i.summary),"description"in i&&(n=i.description),"value"in i)){if(null!==i.value&&"object"==typeof i.value&&"$ref"in i.value)return!1;i=i.value}const o={summary:r,title:t,value:i};return n&&(o.description=n),o})).filter(Boolean);if(n.length)return n}return t.schema&&!matches_mimetype_default.xml(e)?[{value:samples_default(JSON.parse(JSON.stringify(t.schema)),n)}]:[]}function getResponseExamples(e){return Object.keys(e.responses||{}).map((t=>{const n=e.responses[t];let r=!1;if(isRef(n))return!1;const i={};return(n.content?Object.keys(n.content):[]).forEach((e=>{if(!e)return;const t=getMediaTypeExamples(e,n.content[e],{includeReadOnly:!0,includeWriteOnly:!1});t&&(i[e]=t)})),n.headers&&Object.keys(n.headers).length&&!Object.keys(i).length&&(i["*/*"]=[],r=!0),!!Object.keys(i).length&&{status:t,mediaTypes:i,...r?{onlyHeaders:r}:{}}})).filter(Boolean)}function getCallbackExamples(e){return[].concat(...Object.keys(e.callbacks||{}).map((t=>{const n=e.callbacks[t];return[].concat(...Object.keys(n).map((e=>Object.keys(n[e]).map((r=>{const i=getResponseExamples(n[e][r]);return 0!==i.length&&{identifier:t,expression:e,method:r,example:i}}))))).filter(Boolean)})))}var noCorrespondingResponseKey="NoCorrespondingResponseForCustomCodeSample";function addMatchingResponseExamples(e,t){t.getResponseExamples().forEach((t=>{Object.entries(t.mediaTypes||{}).forEach((([n,r])=>{r.forEach((r=>{r.title&&Object.keys(e).includes(r.title)&&(e[r.title].response={mediaType:n,mediaTypeExample:r,status:t.status},e[r.title].name||(e[r.title].name=r.summary))}))}))}))}function getDefaultName(e,t){return e.name&&e.name.length>0?e.name:"Default"+(t[e.language]>1?` #${t[e.language]}`:"")}function getExampleGroups(e){const t={},n={},r=getExtension("code-samples",e.api,e);return r?.forEach(((e,r)=>{t[e.language]?t[e.language]+=1:t[e.language]=1;const i=getDefaultName(e,t);n[e.correspondingExample]?.customCodeSamples?.length?n[e.correspondingExample].customCodeSamples.push({...e,name:i,originalIndex:r}):e.correspondingExample?n[e.correspondingExample]={name:i,customCodeSamples:[{...e,name:i,originalIndex:r}]}:n[noCorrespondingResponseKey]?.customCodeSamples?.length?n[noCorrespondingResponseKey].customCodeSamples.push({...e,name:i,originalIndex:r}):n[noCorrespondingResponseKey]={name:i,customCodeSamples:[{...e,name:i,originalIndex:r}]}})),Object.keys(n).length?(addMatchingResponseExamples(n,e),n):(e.getParameters().forEach((e=>{Object.entries(e.examples||{}).forEach((([t,r])=>{n[t]={...n[t],name:n[t]?.name||r.summary,request:{...n[t]?.request,[e.in]:{...n[t]?.request?.[e.in],[e.name]:r.value}}}}))})),e.getRequestBodyExamples().forEach((e=>{e.examples.forEach((t=>{if(t.title){const r="application/x-www-form-urlencoded"===e.mediaType?"formData":"body";n[t.title]={...n[t.title],name:n[t.title]?.name||t.summary,request:{...n[t.title]?.request,[r]:t.value}}}}))})),Object.keys(n).length&&addMatchingResponseExamples(n,e),Object.entries(n).forEach((([e,t])=>{t.request&&!t.response&&delete n[e]})),n)}function getRequestBodyExamples(e){const t=e.requestBody;return t&&t.content?Object.keys(t.content||{}).map((e=>{const n=getMediaTypeExamples(e,t.content[e],{includeReadOnly:!1,includeWriteOnly:!0});return!!n.length&&{mediaType:e,examples:n}})).filter(Boolean):[]}var isJSON=matches_mimetype_default.json;function buildHeadersSchema(e,t){const n=e.headers,r={type:"object",properties:{}};Object.keys(n).forEach((e=>{if(n[e]&&n[e].schema){const i=n[e];r.properties[e]=toJSONSchema(i.schema,{addEnumsToDescriptions:!0,transformer:t.transformer}),i.description&&(r.properties[e].description=i.description)}}));const i={schema:r,type:"object",label:"Headers"};return e.description&&i.schema&&(i.description=e.description),i}function getResponseAsJSONSchema(e,t,n,r){const i=e.getResponseByStatusCode(n),o=[];if(!i)return null;let s=!1,a=!1;function c(e,t){"ref"===t?s=!0:a=!0}const u=function(e){if(!e)return null;const t=Object.keys(e);if(!t.length)return null;for(let n=0;n{matches_mimetype_default.json(e)&&(this.contentType=e)})),this.contentType}isFormUrlEncoded(){return matches_mimetype_default.formUrlEncoded(this.getContentType())}isMultipart(){return matches_mimetype_default.multipart(this.getContentType())}isJson(){return matches_mimetype_default.json(this.getContentType())}isXml(){return matches_mimetype_default.xml(this.getContentType())}isWebhook(){return this instanceof Webhook}getSecurity(){return this.api?.components?.securitySchemes&&Object.keys(this.api.components.securitySchemes).length&&(this.schema.security||this.api.security)||[]}getSecurityWithTypes(e=!1){return this.getSecurity().map((t=>{let n;try{n=Object.keys(t)}catch(e){return!1}const r=n.map((e=>{let n;try{n=this.api.components.securitySchemes[e]}catch(e){return!1}if(!n)return!1;let r=null;if("http"===n.type)r="basic"===n.scheme?"Basic":"bearer"===n.scheme?"Bearer":n.type;else if("oauth2"===n.type)r="OAuth2";else{if("apiKey"!==n.type)return!1;r="query"===n.in?"Query":"header"===n.in?"Header":"cookie"===n.in?"Cookie":n.type}return{type:r,security:{...n,_key:e,_requirements:t[e]}}}));return e?r.filter((e=>!1!==e)):r}))}prepareSecurity(){return this.getSecurityWithTypes().reduce(((e,t)=>t?(t.forEach((t=>{if(!t)return;e[t.type]||(e[t.type]=[]);e[t.type].some((e=>e._key===t.security._key))||(t.security?._requirements&&delete t.security._requirements,e[t.type].push(t.security))})),e):e),{})}getHeaders(){this.headers={request:[],response:[]};const e=this.prepareSecurity();return e.Header&&(this.headers.request=e.Header.map((e=>e.name))),(e.Bearer||e.Basic||e.OAuth2)&&this.headers.request.push("Authorization"),e.Cookie&&this.headers.request.push("Cookie"),this.schema.parameters&&(this.headers.request=this.headers.request.concat(this.schema.parameters.map((e=>{if(e.in&&"header"===e.in)return e.name})).filter((e=>e)))),this.schema.responses&&(this.headers.response=Object.keys(this.schema.responses).filter((e=>this.schema.responses[e].headers)).map((e=>Object.keys(this.schema.responses[e].headers))).reduce(((e,t)=>e.concat(t)),[])),!this.headers.request.includes("Content-Type")&&this.schema.requestBody&&this.schema.requestBody.content&&Object.keys(this.schema.requestBody.content)&&this.headers.request.push("Content-Type"),this.schema.responses&&Object.keys(this.schema.responses).some((e=>!!this.schema.responses[e].content))&&(this.headers.request.includes("Accept")||this.headers.request.push("Accept"),this.headers.response.includes("Content-Type")||this.headers.response.push("Content-Type")),this.headers}hasOperationId(){return Boolean("operationId"in this.schema&&this.schema.operationId.length)}getOperationId(e={}){function t(t){return t.replace(e?.camelCase||e?.friendlyCase?/[^a-zA-Z0-9_]/g:/[^a-zA-Z0-9]/g,"-").replace(/--+/g,"-").replace(/^-|-$/g,"")}let n;n=this.hasOperationId()?this.schema.operationId:t(this.path).toLowerCase();const r=this.method.toLowerCase();return e?.camelCase||e?.friendlyCase?(e?.friendlyCase&&(n=n.replaceAll("_"," "),this.hasOperationId()||(n=n.replace(/[^a-zA-Z0-9_]+(.)/g,((e,t)=>` ${t}`)).split(" ").filter(((e,t,n)=>e!==n[t-1])).join(" "))),n=n.replace(/[^a-zA-Z0-9_]+(.)/g,((e,t)=>t.toUpperCase())),this.hasOperationId()&&(n=t(n)),n=n.replace(/^[0-9]/g,(e=>`_${e}`)),n=n.charAt(0).toLowerCase()+n.slice(1),n.startsWith(r)||this.hasOperationId()?n:(n=n.charAt(0).toUpperCase()+n.slice(1),`${r}${n}`)):this.hasOperationId()?n:`${r}_${n}`}getTags(){if(!("tags"in this.schema))return[];const e=new Map;"tags"in this.api&&this.api.tags.forEach((t=>{e.set(t.name,t)}));const t=Object.fromEntries(e),n=[];return Array.isArray(this.schema.tags)&&this.schema.tags.forEach((e=>{e in t?n.push(t[e]):n.push({name:e})})),n}isDeprecated(){return"deprecated"in this.schema&&this.schema.deprecated}hasParameters(){return!!this.getParameters().length}getParameters(){let e=this.schema?.parameters||[];const t=this.api?.paths?.[this.path]?.parameters||[];return t.length&&(e=e.concat(dedupeCommonParameters(e,t)||[])),e}hasRequiredParameters(){return this.getParameters().some((e=>"required"in e&&e.required))}getParametersAsJSONSchema(e={}){return getParametersAsJSONSchema(this,this.api,{includeDiscriminatorMappingRefs:!0,transformer:e=>e,...e})}getResponseAsJSONSchema(e,t={}){return getResponseAsJSONSchema(this,this.api,e,{includeDiscriminatorMappingRefs:!0,transformer:e=>e,...t})}getResponseStatusCodes(){return this.schema.responses?Object.keys(this.schema.responses):[]}hasRequestBody(){return!!this.schema.requestBody}getRequestBodyMediaTypes(){if(!this.hasRequestBody())return[];const e=this.schema.requestBody;return isRef(e)?[]:Object.keys(e.content)}hasRequiredRequestBody(){if(!this.hasRequestBody())return!1;const e=this.schema.requestBody;return!isRef(e)&&(!!e.required||!!this.getParametersAsJSONSchema().filter((e=>["body","formData"].includes(e.type))).find((e=>e.schema&&Array.isArray(e.schema.required)&&e.schema.required.length)))}getRequestBody(e){if(!this.hasRequestBody())return!1;const t=this.schema.requestBody;if(isRef(t))return!1;if(e)return e in t.content&&t.content[e];let n;const r=this.getRequestBodyMediaTypes();return r.forEach((e=>{!n&&matches_mimetype_default.json(e)&&(n=e)})),n||r.forEach((e=>{n||(n=e)})),!!n&&[n,t.content[n],...t.description?[t.description]:[]]}getRequestBodyExamples(){const e=void 0!==this.requestBodyExamples?.[0]?.examples?.[0].value;return this.requestBodyExamples&&e||(this.requestBodyExamples=getRequestBodyExamples(this.schema)),this.requestBodyExamples}getResponseByStatusCode(e){if(!this.schema.responses)return!1;if(void 0===this.schema.responses[e])return!1;const t=this.schema.responses[e];return!isRef(t)&&t}getResponseExamples(){return this.responseExamples||(this.responseExamples=getResponseExamples(this.schema)),this.responseExamples}hasCallbacks(){return!!this.schema.callbacks}getCallback(e,t,n){if(!this.schema.callbacks)return!1;const r=!!this.schema.callbacks[e]&&this.schema.callbacks[e][t];return!(!r||!r[n])&&new Callback(this.api,t,n,r[n],e,r)}getCallbacks(){const e=[];return!!this.hasCallbacks()&&(Object.keys(this.schema.callbacks).forEach((t=>{Object.keys(this.schema.callbacks[t]).forEach((n=>{const r=this.schema.callbacks[t];if(!isRef(r)){const i=r[n];isRef(i)||Object.keys(i).forEach((r=>{supportedMethods.has(r)&&e.push(this.getCallback(t,n,r))}))}}))})),e)}getCallbackExamples(){return this.callbackExamples||(this.callbackExamples=getCallbackExamples(this.schema)),this.callbackExamples}hasExtension(e){return Boolean(this.schema&&e in this.schema)}getExtension(e){return this.schema?.[e]}getExampleGroups(){if(this.exampleGroups)return this.exampleGroups;const e=getExampleGroups(this);return this.exampleGroups=e,e}},Callback=class extends Operation{constructor(e,t,n,r,i,o){super(e,t,n,r),this.identifier=i,this.parentSchema=o}getIdentifier(){return this.identifier}getSummary(){return this.schema?.summary&&"string"==typeof this.schema.summary?this.schema.summary:this.parentSchema.summary&&"string"==typeof this.parentSchema.summary?this.parentSchema.summary:void 0}getDescription(){return this.schema?.description&&"string"==typeof this.schema.description?this.schema.description:this.parentSchema.description&&"string"==typeof this.parentSchema.description?this.parentSchema.description:void 0}getParameters(){let e=this.schema?.parameters||[];const t=this.parentSchema.parameters||[];return t.length&&(e=e.concat(dedupeCommonParameters(e,t)||[])),e}},Webhook=class extends Operation{getSummary(){return this.schema?.summary&&"string"==typeof this.schema.summary?this.schema.summary:this.api.webhooks[this.path].summary&&"string"==typeof this.api.webhooks[this.path].summary?this.api.webhooks[this.path].summary:void 0}getDescription(){return this.schema?.description&&"string"==typeof this.schema.description?this.schema.description:this.api.webhooks[this.path].description&&"string"==typeof this.api.webhooks[this.path].description?this.api.webhooks[this.path].description:void 0}},libExports=requireLib$d(),$RefParser=getDefaultExportFromCjs(libExports),dist={},hasRequiredDist;function requireDist(){if(hasRequiredDist)return dist;hasRequiredDist=1,Object.defineProperty(dist,"__esModule",{value:!0}),dist.TokenData=void 0,dist.parse=u,dist.compile=function(t,n={}){const{encode:r=encodeURIComponent,delimiter:i=e}=n,o=t instanceof c?t:u(t,n),s=l(o.tokens,i,r);return function(e={}){const[t,...n]=s(e);if(n.length)throw new TypeError(`Missing parameters: ${n.join(", ")}`);return t}},dist.match=function(n,r={}){const{decode:i=decodeURIComponent,delimiter:o=e}=r,{regexp:s,keys:a}=d(n,r),c=a.map((e=>!1===i?t:"param"===e.type?i:e=>e.split(o).map(i)));return function(e){const t=s.exec(e);if(!t)return!1;const n=t[0],r=Object.create(null);for(let e=1;er.test(e)))}(t.name)&&function(e){return"text"!==(null==e?void 0:e.type)||!r.test(e.value[0])}(o[i+1]),a=s?t.name:JSON.stringify(t.name);if("param"===t.type)return`:${a}`;if("wildcard"===t.type)return`*${a}`;throw new TypeError(`Unexpected token: ${t}`)})).join("")};const e="/",t=e=>e,n=/^[$_\p{ID_Start}]$/u,r=/^[$\u200c\u200d\p{ID_Continue}]$/u,i="https://git.new/pathToRegexpError",o={"{":"{","}":"}","(":"(",")":")","[":"[","]":"]","+":"+","?":"?","!":"!"};function s(e){return e.replace(/[.+*?^${}()[\]|/\\]/g,"\\$&")}class a{constructor(e){this.tokens=e}peek(){if(!this._peek){const e=this.tokens.next();this._peek=e.value}return this._peek}tryConsume(e){const t=this.peek();if(t.type===e)return this._peek=void 0,t.value}consume(e){const t=this.tryConsume(e);if(void 0!==t)return t;const{type:n,index:r}=this.peek();throw new TypeError(`Unexpected ${n} at ${r}, expected ${e}: ${i}`)}text(){let e,t="";for(;e=this.tryConsume("CHAR")||this.tryConsume("ESCAPED");)t+=e;return t}}class c{constructor(e){this.tokens=e}}function u(e,s={}){const{encodePath:u=t}=s,l=new a(function*(e){const t=[...e];let s=0;function a(){let e="";if(n.test(t[++s]))for(e+=t[s];r.test(t[++s]);)e+=t[s];else if('"'===t[s]){let n=s;for(;sfunction(e,n,r){if("text"===e.type)return()=>[e.value];if("group"===e.type){const t=l(e.tokens,n,r);return e=>{const[n,...r]=t(e);return r.length?[""]:[n]}}const i=r||t;if("wildcard"===e.type&&!1!==r)return t=>{const r=t[e.name];if(null==r)return["",e.name];if(!Array.isArray(r)||0===r.length)throw new TypeError(`Expected "${e.name}" to be a non-empty array`);return[r.map(((t,n)=>{if("string"!=typeof t)throw new TypeError(`Expected "${e.name}/${n}" to be a string`);return i(t)})).join(n)]};return t=>{const n=t[e.name];if(null==n)return["",e.name];if("string"!=typeof n)throw new TypeError(`Expected "${e.name}" to be a string`);return[i(n)]}}(e,n,r)));return e=>{const t=[""];for(const n of i){const[r,...i]=n(e);t[0]+=r,t.push(...i)}return t}}function d(t,n={}){const{delimiter:r=e,end:i=!0,sensitive:o=!1,trailing:a=!0}=n,l=[],d=[],_=o?"":"i",m=(Array.isArray(t)?t:[t]).map((e=>e instanceof c?e:u(e,n)));for(const{tokens:e}of m)for(const t of p(e,0,[])){const e=f(t,r,l);d.push(e)}let h=`^(?:${d.join("|")})`;a&&(h+=`(?:${s(r)}$)?`),h+=i?"$":`(?=${s(r)}|$)`;return{regexp:new RegExp(h,_),keys:l}}function*p(e,t,n){if(t===e.length)return yield n;const r=e[t];if("group"===r.type){const i=n.slice();for(const n of p(r.tokens,0,i))yield*p(e,t+1,n)}else n.push(r);yield*p(e,t+1,n)}function f(e,t,n){let r="",o="",a=!0;for(let c=0;ce.name===n)):e.keys[0],t):getKey(e,t)}function getAuth(e,t,n){return Object.keys(e?.components?.securitySchemes||{}).map((r=>({[r]:getByScheme(t,{...e.components.securitySchemes[r],_key:r},n)}))).reduce(((e,t)=>Object.assign(e,t)),{})}function getUserVariable(e,t,n){let r=e;return"keys"in e&&Array.isArray(e.keys)&&e.keys.length&&(r=e.keys[0]),r[t]||e[t]||null}var SERVER_VARIABLE_REGEX=/{([-_a-zA-Z0-9:.[\]]+)}/g;function ensureProtocol(e){return e.match(/^\/\//)?`https:${e}`:e.match(/\/\//)?e:`https://${e}`}function stripTrailingSlash(e){return"/"===e[e.length-1]?e.slice(0,-1):e}function normalizedUrl(e,t){const n="https://example.com";let r;try{if(r=e.servers[t].url,!r)throw new Error("no url");if(r=stripTrailingSlash(r),r.startsWith("/")&&!r.startsWith("//")){const e=new URL(n);e.pathname=r,r=e.href}}catch(e){r=n}return ensureProtocol(r)}function transformUrlIntoRegex(e){return stripTrailingSlash(e.replace(SERVER_VARIABLE_REGEX,"([-_a-zA-Z0-9:.[\\]]+)"))}function normalizePath(e){return e.replace(/({?){(.*?)}(}?)/g,((e,...t)=>`:${t[1].replace("-","")}`)).replace(/::/,"\\::").split("?")[0]}function generatePathMatches(e,t,n){const r=t.split("?")[0];return Object.keys(e).map((t=>{const i=normalizePath(t);let o;try{const e=distExports.match(i,{decode:decodeURIComponent});o=e(r)}catch(e){return}const s={};return o&&Object.keys(o.params).length&&Object.keys(o.params).forEach((e=>{s[`:${e}`]=o.params[e]})),{url:{origin:n,path:i.replace(/\\::/,"::"),nonNormalizedPath:t,slugs:s},operation:e[t],match:o}})).filter(Boolean).filter((e=>e.match))}function filterPathMethods(e,t){const n=distExports.pathToRegexp(t);return e.map((e=>{const t=Object.keys(e.operation).filter((e=>n.regexp.exec(e)));if(t.length){const n=t[0];return e.url.method=n.toUpperCase(),{url:e.url,operation:e.operation[n]}}return!1})).filter(Boolean)}function findTargetPath(e){let t,n=Object.keys(e[0].url.slugs).length;for(let r=0;r{n[e]=getUserVariable(this.user,e)||t[e].default||""})),n}splitUrl(e=0){const t=normalizedUrl(this.api,e),n=this.variables(e);return t.split(/({.+?})/).filter(Boolean).map(((e,t)=>{const r=e.match(/[{}]/),i=e.replace(/[{}]/g,""),o=`${i}-${t}`;if(!r)return{type:"text",value:i,key:o};const s=n?.[i];return{type:"variable",value:i,key:o,description:s?.description,enum:s?.enum}}))}splitVariables(e){const t=(this.api.servers||[]).map(((t,n)=>{const r=transformUrlIntoRegex(t.url),i=new RegExp(r).exec(e);if(!i)return!1;const o={};return Array.from(t.url.matchAll(SERVER_VARIABLE_REGEX)).forEach(((e,t)=>{o[e[1]]=i[t+1]})),{selected:n,variables:o}})).filter(Boolean);return!!t.length&&t[0]}replaceUrl(e,t={}){return stripTrailingSlash(e.replace(SERVER_VARIABLE_REGEX,((e,n)=>{if(n in t){const e=t[n];if("object"!=typeof e)return e;if(!Array.isArray(e)&&null!==e&&"default"in e)return e.default}const r=getUserVariable(this.user,n);return r||e})))}operation(e,t,n={}){let r={parameters:[]};if(n.isWebhook){const n=this.api;if(n?.webhooks[e]?.[t])return r=n.webhooks[e][t],new Webhook(n,e,t,r)}return this?.api?.paths?.[e]?.[t]&&(r=this.api.paths[e][t]),new Operation(this.api,e,t,r)}findOperationMatches(e){const{origin:t,hostname:n}=new URL(e),r=new RegExp(t,"i"),{servers:i,paths:o}=this.api;let s,a,c;if(i&&i.length){if(c=i.find((e=>r.exec(this.replaceUrl(e.url,e.variables||{})))),!c){const e=new RegExp(n);c=i.find((t=>e.exec(this.replaceUrl(t.url,t.variables||{}))))}}else c={url:"https://example.com"};if(c)a={...c,url:this.replaceUrl(c.url,c.variables||{})},[,s]=e.split(new RegExp(a.url,"i"));else{const t=i.map((t=>{const n=transformUrlIntoRegex(t.url);if(new RegExp(n).exec(e))return{matchedServer:t,pathName:e.split(new RegExp(n)).slice(-1).pop()}})).filter(Boolean);if(!t.length)return;s=t[0].pathName,a={...t[0].matchedServer}}if(void 0===s)return;""===s&&(s="/");const u=generatePathMatches(o,s,a.url);return u.length?u:void 0}findOperation(e,t){const n=this.findOperationMatches(e);if(!n)return;const r=filterPathMethods(n,t);return r.length?findTargetPath(r):void 0}findOperationWithoutMethod(e){const t=this.findOperationMatches(e);if(t)return findTargetPath(t)}getOperation(e,t){const n=this.findOperation(e,t);if(void 0!==n)return this.operation(n.url.nonNormalizedPath,t)}getOperationById(e){let t;return Object.values(this.getPaths()).forEach((n=>{t||(t=Object.values(n).find((t=>t.getOperationId()===e)))})),t||(Object.entries(this.getWebhooks()).forEach((([,n])=>{t||(t=Object.values(n).find((t=>t.getOperationId()===e)))})),t)}getAuth(e,t){return this.api?.components?.securitySchemes?getAuth(this.api,e,t):{}}getPaths(){const e={};return Object.keys(this.api.paths?this.api.paths:[]).forEach((t=>{t.startsWith("x-")||(e[t]={},"$ref"in this.api.paths[t]&&(this.api.paths[t]=findSchemaDefinition(this.api.paths[t].$ref,this.api)),Object.keys(this.api.paths[t]).forEach((n=>{supportedMethods.has(n)&&(e[t][n]=this.operation(t,n))})))})),e}getWebhooks(){const e={},t=this.api;return Object.keys(t.webhooks?t.webhooks:[]).forEach((n=>{e[n]={},Object.keys(t.webhooks[n]).forEach((t=>{e[n][t]=this.operation(n,t,{isWebhook:!0})}))})),e}getTags(e=!1){const t=new Set,n=this.api.tags?.map((e=>e.name))||[],r=getExtension("disable-tag-sorting",this.api);Object.entries(this.getPaths()).forEach((([n,r])=>{Object.values(r).forEach((r=>{const i=r.getTags();!e||i.length?i.forEach((e=>{t.add(e.name)})):t.add(n)}))})),Object.entries(this.getWebhooks()).forEach((([n,r])=>{Object.values(r).forEach((r=>{const i=r.getTags();!e||i.length?i.forEach((e=>{t.add(e.name)})):t.add(n)}))}));const i=[],o=[];if(r)return Array.from(t);Array.from(t).forEach((e=>{n.includes(e)?o.push(e):i.push(e)}));let s=o.sort(((e,t)=>n.indexOf(e)-n.indexOf(t)));return s=s.concat(i),s}hasExtension(e){return hasRootExtension(e,this.api)}getExtension(e,t){return getExtension(e,this.api,t)}validateExtension(e){if(this.hasExtension("x-readme")){const t=this.getExtension("x-readme");if("object"!=typeof t||Array.isArray(t)||null===t)throw new TypeError('"x-readme" must be of type "Object"');if(e in t)if([CODE_SAMPLES,HEADERS,PARAMETER_ORDERING,SAMPLES_LANGUAGES].includes(e)){if(!Array.isArray(t[e]))throw new TypeError(`"x-readme.${e}" must be of type "Array"`);e===PARAMETER_ORDERING&&validateParameterOrdering(t[e],`x-readme.${e}`)}else if(e===OAUTH_OPTIONS){if("object"!=typeof t[e])throw new TypeError(`"x-readme.${e}" must be of type "Object"`)}else if("boolean"!=typeof t[e])throw new TypeError(`"x-readme.${e}" must be of type "Boolean"`)}if(this.hasExtension(`x-${e}`)){const t=this.getExtension(`x-${e}`);if([CODE_SAMPLES,HEADERS,PARAMETER_ORDERING,SAMPLES_LANGUAGES].includes(e)){if(!Array.isArray(t))throw new TypeError(`"x-${e}" must be of type "Array"`);e===PARAMETER_ORDERING&&validateParameterOrdering(t,`x-${e}`)}else if(e===OAUTH_OPTIONS){if("object"!=typeof t)throw new TypeError(`"x-${e}" must be of type "Object"`)}else if("boolean"!=typeof t)throw new TypeError(`"x-${e}" must be of type "Boolean"`)}}validateExtensions(){Object.keys(extensionDefaults).forEach((e=>{this.validateExtension(e)}))}getCircularReferences(){if(!this.dereferencing.complete)throw new Error("#dereference() must be called first in order for this method to obtain circular references.");return this.dereferencing.circularRefs}async dereference(e={preserveRefAsJSONSchemaTitle:!1}){if(this.dereferencing.complete)return new Promise((e=>{e(!0)}));if(this.dereferencing.processing)return new Promise(((e,t)=>{this.promises.push({resolve:e,reject:t})}));this.dereferencing.processing=!0;const{api:t,promises:n}=this;t&&t.components&&t.components.schemas&&"object"==typeof t.components.schemas&&Object.keys(t.components.schemas).forEach((n=>{isPrimitive(t.components.schemas[n])||Array.isArray(t.components.schemas[n])||null===t.components.schemas[n]||(e.preserveRefAsJSONSchemaTitle&&(t.components.schemas[n].title=n),t.components.schemas[n]["x-readme-ref-name"]=n)}));const r=new $RefParser;return r.dereference(t||{},{resolve:{external:!1},dereference:{circular:"ignore"}}).then((t=>{let i=[];r.$refs.circular&&(i=r.$refs.circularRefs.map((e=>`#${e.split("#")[1]}`))),this.api=t,this.promises=n,this.dereferencing={processing:!1,complete:!0,circularRefs:i},e.cb&&e.cb()})).then((()=>this.promises.map((e=>e.resolve()))))}};class Hooks{add(e,t,n){if("string"!=typeof arguments[0])for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach((function(e){this[e]=this[e]||[],t&&this[e][n?"unshift":"push"](t)}),this)}run(e,t){this[e]=this[e]||[],this[e].forEach((function(e){e.call(t&&t.context?t.context:t,t)}))}}class Plugins{constructor(e){this.jsep=e,this.registered={}}register(...e){e.forEach((e=>{if("object"!=typeof e||!e.name||!e.init)throw new Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)}))}}class Jsep{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+Jsep.version}static addUnaryOp(e){return Jsep.max_unop_len=Math.max(e.length,Jsep.max_unop_len),Jsep.unary_ops[e]=1,Jsep}static addBinaryOp(e,t,n){return Jsep.max_binop_len=Math.max(e.length,Jsep.max_binop_len),Jsep.binary_ops[e]=t,n?Jsep.right_associative.add(e):Jsep.right_associative.delete(e),Jsep}static addIdentifierChar(e){return Jsep.additional_identifier_chars.add(e),Jsep}static addLiteral(e,t){return Jsep.literals[e]=t,Jsep}static removeUnaryOp(e){return delete Jsep.unary_ops[e],e.length===Jsep.max_unop_len&&(Jsep.max_unop_len=Jsep.getMaxKeyLen(Jsep.unary_ops)),Jsep}static removeAllUnaryOps(){return Jsep.unary_ops={},Jsep.max_unop_len=0,Jsep}static removeIdentifierChar(e){return Jsep.additional_identifier_chars.delete(e),Jsep}static removeBinaryOp(e){return delete Jsep.binary_ops[e],e.length===Jsep.max_binop_len&&(Jsep.max_binop_len=Jsep.getMaxKeyLen(Jsep.binary_ops)),Jsep.right_associative.delete(e),Jsep}static removeAllBinaryOps(){return Jsep.binary_ops={},Jsep.max_binop_len=0,Jsep}static removeLiteral(e){return delete Jsep.literals[e],Jsep}static removeAllLiterals(){return Jsep.literals={},Jsep}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new Jsep(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map((e=>e.length)))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return Jsep.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!Jsep.binary_ops[String.fromCharCode(e)]||Jsep.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return Jsep.isIdentifierStart(e)||Jsep.isDecimalDigit(e)}throwError(e){const t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(Jsep.hooks[e]){const n={context:this,node:t};return Jsep.hooks.run(e,n),n.node}return t}searchHook(e){if(Jsep.hooks[e]){const t={context:this};return Jsep.hooks[e].find((function(e){return e.call(t.context,t),t.node})),t.node}}gobbleSpaces(){let e=this.code;for(;e===Jsep.SPACE_CODE||e===Jsep.TAB_CODE||e===Jsep.LF_CODE||e===Jsep.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const e=this.gobbleExpressions(),t=1===e.length?e[0]:{type:Jsep.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t,n,r=[];for(;this.index0;){if(Jsep.binary_ops.hasOwnProperty(e)&&(!Jsep.isIdentifierStart(this.code)||this.index+e.lengthi.right_a&&e.right_a?n>e.prec:n<=e.prec;for(;r.length>2&&a(r[r.length-2]);)s=r.pop(),t=r.pop().value,o=r.pop(),e={type:Jsep.BINARY_EXP,operator:t,left:o,right:s},r.push(e);e=this.gobbleToken(),e||this.throwError("Expected expression after "+c),r.push(i,e)}for(a=r.length-1,e=r[a];a>1;)e={type:Jsep.BINARY_EXP,operator:r[a-1].value,left:r[a-2],right:e},a-=2;return e}gobbleToken(){let e,t,n,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"),r)return this.runHook("after-token",r);if(e=this.code,Jsep.isDecimalDigit(e)||e===Jsep.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===Jsep.SQUOTE_CODE||e===Jsep.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(e===Jsep.OBRACK_CODE)r=this.gobbleArray();else{for(t=this.expr.substr(this.index,Jsep.max_unop_len),n=t.length;n>0;){if(Jsep.unary_ops.hasOwnProperty(t)&&(!Jsep.isIdentifierStart(this.code)||this.index+t.length=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(i===Jsep.COMMA_CODE){if(this.index++,r++,r!==t.length)if(e===Jsep.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===Jsep.CBRACK_CODE)for(let e=t.length;e":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),Jsep.max_unop_len=Jsep.getMaxKeyLen(Jsep.unary_ops),Jsep.max_binop_len=Jsep.getMaxKeyLen(Jsep.binary_ops);const jsep=e=>new Jsep(e).parse(),stdClassProps=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Jsep).filter((e=>!stdClassProps.includes(e)&&void 0===jsep[e])).forEach((e=>{jsep[e]=Jsep[e]})),jsep.Jsep=Jsep;const CONDITIONAL_EXP="ConditionalExpression";var ternary={name:"ternary",init(e){e.hooks.add("after-expression",(function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;const n=t.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;const i=this.gobbleExpression();if(i||this.throwError("Expected expression"),t.node={type:CONDITIONAL_EXP,test:n,consequent:r,alternate:i},n.operator&&e.binary_ops[n.operator]<=.9){let r=n;for(;r.right.operator&&e.binary_ops[r.right.operator]<=.9;)r=r.right;t.node.test=r.right,r.right=t.node,t.node=n}}else this.throwError("Expected :")}}))}};jsep.plugins.register(ternary);const FSLASH_CODE=47,BSLASH_CODE=92;var index={name:"regex",init(e){e.hooks.add("gobble-token",(function(t){if(this.code===FSLASH_CODE){const n=++this.index;let r=!1;for(;this.index=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;o+=this.char}try{i=new RegExp(r,o)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:i,raw:this.expr.slice(n-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?r=!0:r&&this.code===e.CBRACK_CODE&&(r=!1),this.index+=this.code===BSLASH_CODE?2:1}this.throwError("Unclosed Regex")}}))}};const PLUS_CODE=43,MINUS_CODE=45,plugin={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[PLUS_CODE,MINUS_CODE],assignmentPrecedence:.9,init(e){const t=[e.IDENTIFIER,e.MEMBER_EXP];function n(e){plugin.assignmentOperators.has(e.operator)?(e.type="AssignmentExpression",n(e.left),n(e.right)):e.operator||Object.values(e).forEach((e=>{e&&"object"==typeof e&&n(e)}))}plugin.assignmentOperators.forEach((t=>e.addBinaryOp(t,plugin.assignmentPrecedence,!0))),e.hooks.add("gobble-token",(function(e){const n=this.code;plugin.updateOperators.some((e=>e===n&&e===this.expr.charCodeAt(this.index+1)))&&(this.index+=2,e.node={type:"UpdateExpression",operator:n===PLUS_CODE?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},e.node.argument&&t.includes(e.node.argument.type)||this.throwError(`Unexpected ${e.node.operator}`))})),e.hooks.add("after-token",(function(e){if(e.node){const n=this.code;plugin.updateOperators.some((e=>e===n&&e===this.expr.charCodeAt(this.index+1)))&&(t.includes(e.node.type)||this.throwError(`Unexpected ${e.node.operator}`),this.index+=2,e.node={type:"UpdateExpression",operator:n===PLUS_CODE?"++":"--",argument:e.node,prefix:!1})}})),e.hooks.add("after-expression",(function(e){e.node&&n(e.node)}))}};jsep.plugins.register(index,plugin),jsep.addUnaryOp("typeof"),jsep.addLiteral("null",null),jsep.addLiteral("undefined",void 0);const BLOCKED_PROTO_PROPERTIES=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__"]),SafeEval={evalAst(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":return SafeEval.evalBinaryExpression(e,t);case"Compound":return SafeEval.evalCompound(e,t);case"ConditionalExpression":return SafeEval.evalConditionalExpression(e,t);case"Identifier":return SafeEval.evalIdentifier(e,t);case"Literal":return SafeEval.evalLiteral(e,t);case"MemberExpression":return SafeEval.evalMemberExpression(e,t);case"UnaryExpression":return SafeEval.evalUnaryExpression(e,t);case"ArrayExpression":return SafeEval.evalArrayExpression(e,t);case"CallExpression":return SafeEval.evalCallExpression(e,t);case"AssignmentExpression":return SafeEval.evalAssignmentExpression(e,t);default:throw SyntaxError("Unexpected expression",e)}},evalBinaryExpression:(e,t)=>({"||":(e,t)=>e||t(),"&&":(e,t)=>e&&t(),"|":(e,t)=>e|t(),"^":(e,t)=>e^t(),"&":(e,t)=>e&t(),"==":(e,t)=>e==t(),"!=":(e,t)=>e!=t(),"===":(e,t)=>e===t(),"!==":(e,t)=>e!==t(),"<":(e,t)=>e":(e,t)=>e>t(),"<=":(e,t)=>e<=t(),">=":(e,t)=>e>=t(),"<<":(e,t)=>e<>":(e,t)=>e>>t(),">>>":(e,t)=>e>>>t(),"+":(e,t)=>e+t(),"-":(e,t)=>e-t(),"*":(e,t)=>e*t(),"/":(e,t)=>e/t(),"%":(e,t)=>e%t()}[e.operator](SafeEval.evalAst(e.left,t),(()=>SafeEval.evalAst(e.right,t)))),evalCompound(e,t){let n;for(let r=0;rSafeEval.evalAst(e.test,t)?SafeEval.evalAst(e.consequent,t):SafeEval.evalAst(e.alternate,t),evalIdentifier(e,t){if(Object.hasOwn(t,e.name))return t[e.name];throw ReferenceError(`${e.name} is not defined`)},evalLiteral:e=>e.value,evalMemberExpression(e,t){const n=e.computed?SafeEval.evalAst(e.property):e.property.name,r=SafeEval.evalAst(e.object,t);if(null==r)throw TypeError(`Cannot read properties of ${r} (reading '${n}')`);if(!Object.hasOwn(r,n)&&BLOCKED_PROTO_PROPERTIES.has(n))throw TypeError(`Cannot read properties of ${r} (reading '${n}')`);const i=r[n];return"function"==typeof i?i.bind(r):i},evalUnaryExpression:(e,t)=>({"-":e=>-SafeEval.evalAst(e,t),"!":e=>!SafeEval.evalAst(e,t),"~":e=>~SafeEval.evalAst(e,t),"+":e=>+SafeEval.evalAst(e,t),typeof:e=>typeof SafeEval.evalAst(e,t)}[e.operator](e.argument)),evalArrayExpression:(e,t)=>e.elements.map((e=>SafeEval.evalAst(e,t))),evalCallExpression(e,t){const n=e.arguments.map((e=>SafeEval.evalAst(e,t)));return SafeEval.evalAst(e.callee,t)(...n)},evalAssignmentExpression(e,t){if("Identifier"!==e.left.type)throw SyntaxError("Invalid left-hand side in assignment");const n=e.left.name,r=SafeEval.evalAst(e.right,t);return t[n]=r,t[n]}};class SafeScript{constructor(e){this.code=e,this.ast=jsep(this.code)}runInNewContext(e){const t=Object.assign(Object.create(null),e);return SafeEval.evalAst(this.ast,t)}}function push(e,t){return(e=e.slice()).push(t),e}function unshift(e,t){return(t=t.slice()).unshift(e),t}class NewError extends Error{constructor(e){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=e,this.name="NewError"}}function JSONPath(e,t,n,r,i){if(!(this instanceof JSONPath))try{return new JSONPath(e,t,n,r,i)}catch(e){if(!e.avoidNew)throw e;return e.value}"string"==typeof e&&(i=r,r=n,n=t,t=e,e=null);const o=e&&"object"==typeof e;if(e=e||{},this.json=e.json||n,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=!Object.hasOwn(e,"wrap")||e.wrap,this.sandbox=e.sandbox||{},this.eval=void 0===e.eval?"safe":e.eval,this.ignoreEvalErrors=void 0!==e.ignoreEvalErrors&&e.ignoreEvalErrors,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||r||null,this.otherTypeCallback=e.otherTypeCallback||i||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},!1!==e.autostart){const r={path:o?e.path:t};o?"json"in e&&(r.json=e.json):r.json=n;const i=this.evaluate(r);if(!i||"object"!=typeof i)throw new NewError(i);return i}}function query(e,t){const n=e.map((e=>JSONPath({path:e,json:t,resultType:"all"}))).filter((e=>!!e.length&&e)).reduce(((e,t)=>e.concat(t)),[]);return n.sort(((e,t)=>e.pointert.pointer?1:0)),n}function refizePointer(e){return`#${e}`}function additionalProperties(e){return query(["$..additionalProperties"],e).map((e=>refizePointer(e.pointer)))}function callbacks(e){return query(["$.components.callbacks","$.paths..callbacks"],e).map((e=>refizePointer(e.pointer)))}async function circularRefs(e){const t=new Oas(JSON.parse(JSON.stringify(e)));await t.dereference();const n=t.getCircularReferences();return n.sort(),n}function commonParameters(e){return query(["$..paths[*].parameters"],e).map((e=>refizePointer(e.pointer)))}function discriminators(e){return query(["$..discriminator"],e).map((e=>refizePointer(e.pointer)))}function links(e){return query(["$..links"],e).map((e=>refizePointer(e.pointer)))}function mediaTypes(e){const t=Array.from(new Set(query(["$..paths..content"],e).map((e=>Object.keys(e.value))).flat()));return t.sort(),t}function parameterSerialization(e){return query(["$..parameters[*].style^"],e).map((e=>refizePointer(e.pointer)))}function polymorphism(e){const t=Array.from(new Set(query(["$..allOf^","$..anyOf^","$..oneOf^"],e).map((e=>refizePointer(e.pointer)))));return t.sort(),t}function securityTypes(e){return Array.from(new Set(query(["$.components.securitySchemes..type"],e).map((e=>e.value))))}function serverVariables(e){return query(["$.servers..variables^"],e).map((e=>refizePointer(e.pointer)))}function totalOperations(e){return query(["$..paths[*]"],e).map((e=>Object.keys(e.value))).flat().length}function webhooks(e){return query(["$.webhooks[*]"],e).map((e=>refizePointer(e.pointer)))}function xml(e){return query(["$.components.schemas..xml^","$..parameters..xml^","$..requestBody..xml^","$..requestBody..['application/xml']","$..requestBody..['application/xml-external-parsed-entity']","$..requestBody..['application/xml-dtd']","$..requestBody..['text/xml']","$..requestBody..['text/xml-external-parsed-entity']","$..requestBody.content[?(@property.match(/\\+xml$/i))]","$..responses..['application/xml']","$..responses..['application/xml-external-parsed-entity']","$..responses..['application/xml-dtd']","$..responses..['text/xml']","$..responses..['text/xml-external-parsed-entity']","$..responses[*].content[?(@property.match(/\\+xml$/i))]"],e).map((e=>refizePointer(e.pointer)))}function authDefaults(e){return query(["$.components.securitySchemes..['x-default']^"],e).map((e=>refizePointer(e.pointer)))}function codeSampleLanguages(e){const t=Array.from(new Set(query(["$..['x-readme']['samples-languages']","$..['x-samples-languages']"],e).map((e=>e.value)).reduce(((e,t)=>e.concat(t)),[])));return t.sort(),t}function codeSamplesDisabled(e){return Array.from(new Set(query(["$['x-samples-enabled']^","$['x-readme']['samples-enabled']","$..paths[*]..['x-samples-enabled']^","$..paths[*]..['x-readme']['samples-enabled']^^"],e).map((e=>refizePointer(e.pointer)))))}function corsProxyDisabled(e){return Array.from(new Set(query(["$['x-proxy-enabled']^","$['x-readme']['proxy-enabled']","$..paths[*]..['x-proxy-enabled']^","$..paths[*]..['x-readme']['proxy-enabled']^^"],e).map((e=>refizePointer(e.pointer)))))}function customCodeSamples(e){return query(["$..['x-code-samples']","$..['x-readme']['code-samples']"],e).filter((e=>!(!Array.isArray(e.value)||!e.value.length)&&e)).map((e=>refizePointer(e.pointer)))}function explorerDisabled(e){return query(["$['x-explorer-enabled']^","$['x-readme']['explorer-enabled']","$..paths[*]..['x-explorer-enabled']^","$..paths[*]..['x-readme']['explorer-enabled']^^"],e).map((e=>refizePointer(e.pointer)))}function rawBody(e){return query(["$..RAW_BODY^^"],e).map((e=>refizePointer(e.pointer)))}function staticHeaders(e){return query(["$..['x-headers']","$..['x-readme']['headers']"],e).filter((e=>!(!Array.isArray(e.value)||!e.value.length)&&e)).map((e=>refizePointer(e.pointer)))}function refNames(e){return query(["$..['x-readme-ref-name']"],e).map((e=>refizePointer(e.pointer)))}async function analyzer(e){const t=additionalProperties(e),n=callbacks(e),r=await circularRefs(e),i=commonParameters(e),o=discriminators(e),s=links(e),a=parameterSerialization(e),c=polymorphism(e),u=serverVariables(e),l=webhooks(e),d=xml(e),p=authDefaults(e),f=codeSampleLanguages(e),_=customCodeSamples(e),m=codeSamplesDisabled(e),h=corsProxyDisabled(e),g=explorerDisabled(e),A=staticHeaders(e),y=rawBody(e),v=refNames(e),b={general:{mediaTypes:{name:"Media Type",found:mediaTypes(e)},operationTotal:{name:"Operation",found:totalOperations(e)},securityTypes:{name:"Security Type",found:securityTypes(e)}},openapi:{additionalProperties:{present:!!t.length,locations:t},callbacks:{present:!!n.length,locations:n},circularRefs:{present:!!r.length,locations:r},commonParameters:{present:!!i.length,locations:i},discriminators:{present:!!o.length,locations:o},links:{present:!!s.length,locations:s},style:{present:!!a.length,locations:a},polymorphism:{present:!!c.length,locations:c},serverVariables:{present:!!u.length,locations:u},webhooks:{present:!!l.length,locations:l},xml:{present:!!d.length,locations:d}},readme:{"x-default":{present:!!p.length,locations:p},"x-readme.code-samples":{present:!!_.length,locations:_},"x-readme.headers":{present:!!A.length,locations:A},"x-readme.explorer-enabled":{present:!!g.length,locations:g},"x-readme.proxy-enabled":{present:!!h.length,locations:h},"x-readme.samples-languages":{present:!!f.length,locations:f},"x-readme-ref-name":{present:!!v.length,locations:v}}};return m.length&&(b.readme["x-readme.samples-enabled"]={present:!!m.length,locations:m}),y.length&&(b.readme.raw_body={present:!!y.length,locations:y}),b}JSONPath.prototype.evaluate=function(e,t,n,r){let i=this.parent,o=this.parentProperty,{flatten:s,wrap:a}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,n=n||this.callback,this.currOtherTypeCallback=r||this.otherTypeCallback,t=t||this.json,(e=e||this.path)&&"object"==typeof e&&!Array.isArray(e)){if(!e.path&&""!==e.path)throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=e),s=Object.hasOwn(e,"flatten")?e.flatten:s,this.currResultType=Object.hasOwn(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=Object.hasOwn(e,"sandbox")?e.sandbox:this.currSandbox,a=Object.hasOwn(e,"wrap")?e.wrap:a,this.currEval=Object.hasOwn(e,"eval")?e.eval:this.currEval,n=Object.hasOwn(e,"callback")?e.callback:n,this.currOtherTypeCallback=Object.hasOwn(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,i=Object.hasOwn(e,"parent")?e.parent:i,o=Object.hasOwn(e,"parentProperty")?e.parentProperty:o,e=e.path}if(i=i||null,o=o||null,Array.isArray(e)&&(e=JSONPath.toPathString(e)),!e&&""!==e||!t)return;const c=JSONPath.toPathArray(e);"$"===c[0]&&c.length>1&&c.shift(),this._hasParentSelector=null;const u=this._trace(c,t,["$"],i,o,n).filter((function(e){return e&&!e.isParentSelector}));return u.length?a||1!==u.length||u[0].hasArrExpr?u.reduce(((e,t)=>{const n=this._getPreferredOutput(t);return s&&Array.isArray(n)?e=e.concat(n):e.push(n),e}),[]):this._getPreferredOutput(u[0]):a?[]:void 0},JSONPath.prototype._getPreferredOutput=function(e){const t=this.currResultType;switch(t){case"all":{const t=Array.isArray(e.path)?e.path:JSONPath.toPathArray(e.path);return e.pointer=JSONPath.toPointer(t),e.path="string"==typeof e.path?e.path:JSONPath.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return JSONPath.toPathString(e[t]);case"pointer":return JSONPath.toPointer(e.path);default:throw new TypeError("Unknown result type")}},JSONPath.prototype._handleCallback=function(e,t,n){if(t){const r=this._getPreferredOutput(e);e.path="string"==typeof e.path?e.path:JSONPath.toPathString(e.path),t(r,n,e)}},JSONPath.prototype._trace=function(e,t,n,r,i,o,s,a){let c;if(!e.length)return c={path:n,value:t,parent:r,parentProperty:i,hasArrExpr:s},this._handleCallback(c,o,"value"),c;const u=e[0],l=e.slice(1),d=[];function p(e){Array.isArray(e)?e.forEach((e=>{d.push(e)})):d.push(e)}if(("string"!=typeof u||a)&&t&&Object.hasOwn(t,u))p(this._trace(l,t[u],push(n,u),t,u,o,s));else if("*"===u)this._walk(t,(e=>{p(this._trace(l,t[e],push(n,e),t,e,o,!0,!0))}));else if(".."===u)p(this._trace(l,t,n,r,i,o,s)),this._walk(t,(r=>{"object"==typeof t[r]&&p(this._trace(e.slice(),t[r],push(n,r),t,r,o,!0))}));else{if("^"===u)return this._hasParentSelector=!0,{path:n.slice(0,-1),expr:l,isParentSelector:!0};if("~"===u)return c={path:push(n,u),value:i,parent:r,parentProperty:null},this._handleCallback(c,o,"property"),c;if("$"===u)p(this._trace(l,t,n,null,null,o,s));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(u))p(this._slice(u,l,t,n,r,i,o));else if(0===u.indexOf("?(")){if(!1===this.currEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const e=u.replace(/^\?\((.*?)\)$/u,"$1"),s=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(e);s?this._walk(t,(e=>{const a=[s[2]],c=s[1]?t[e][s[1]]:t[e];this._trace(a,c,n,r,i,o,!0).length>0&&p(this._trace(l,t[e],push(n,e),t,e,o,!0))})):this._walk(t,(s=>{this._eval(e,t[s],s,n,r,i)&&p(this._trace(l,t[s],push(n,s),t,s,o,!0))}))}else if("("===u[0]){if(!1===this.currEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(unshift(this._eval(u,t,n.at(-1),n.slice(0,-1),r,i),l),t,n,r,i,o,s))}else if("@"===u[0]){let e=!1;const s=u.slice(1,-2);switch(s){case"scalar":t&&["object","function"].includes(typeof t)||(e=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===s&&(e=!0);break;case"integer":!Number.isFinite(t)||t%1||(e=!0);break;case"number":Number.isFinite(t)&&(e=!0);break;case"nonFinite":"number"!=typeof t||Number.isFinite(t)||(e=!0);break;case"object":t&&typeof t===s&&(e=!0);break;case"array":Array.isArray(t)&&(e=!0);break;case"other":e=this.currOtherTypeCallback(t,n,r,i);break;case"null":null===t&&(e=!0);break;default:throw new TypeError("Unknown value type "+s)}if(e)return c={path:n,value:t,parent:r,parentProperty:i},this._handleCallback(c,o,"value"),c}else if("`"===u[0]&&t&&Object.hasOwn(t,u.slice(1))){const e=u.slice(1);p(this._trace(l,t[e],push(n,e),t,e,o,s,!0))}else if(u.includes(",")){const e=u.split(",");for(const s of e)p(this._trace(unshift(s,l),t,n,r,i,o,!0))}else!a&&t&&Object.hasOwn(t,u)&&p(this._trace(l,t[u],push(n,u),t,u,o,s,!0))}if(this._hasParentSelector)for(let e=0;e{t(e)}))},JSONPath.prototype._slice=function(e,t,n,r,i,o,s){if(!Array.isArray(n))return;const a=n.length,c=e.split(":"),u=c[2]&&Number.parseInt(c[2])||1;let l=c[0]&&Number.parseInt(c[0])||0,d=c[1]&&Number.parseInt(c[1])||a;l=l<0?Math.max(0,l+a):Math.min(a,l),d=d<0?Math.max(0,d+a):Math.min(a,d);const p=[];for(let e=l;e{p.push(e)}))}return p},JSONPath.prototype._eval=function(e,t,n,r,i,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=i,this.currSandbox._$_property=n,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;const s=e.includes("@path");s&&(this.currSandbox._$_path=JSONPath.toPathString(r.concat([n])));const a=this.currEval+"Script:"+e;if(!JSONPath.cache[a]){let t=e.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(s&&(t=t.replaceAll("@path","_$_path")),"safe"===this.currEval||!0===this.currEval||void 0===this.currEval)JSONPath.cache[a]=new this.safeVm.Script(t);else if("native"===this.currEval)JSONPath.cache[a]=new this.vm.Script(t);else if("function"==typeof this.currEval&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const e=this.currEval;JSONPath.cache[a]=new e(t)}else{if("function"!=typeof this.currEval)throw new TypeError(`Unknown "eval" property "${this.currEval}"`);JSONPath.cache[a]={runInNewContext:e=>this.currEval(t,e)}}}try{return JSONPath.cache[a].runInNewContext(this.currSandbox)}catch(t){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+t.message+": "+e)}},JSONPath.cache={},JSONPath.toPathString=function(e){const t=e,n=t.length;let r="$";for(let e=1;e{const t=e;return t.openapi&&Object.entries(OPENAPI_FEATURE_DOCS).forEach((([e,n])=>{t.openapi[e]={...t.openapi[e],...n}})),t.readme&&Object.entries(README_FEATURE_DOCS).forEach((([e,n])=>{e in t.readme&&(t.readme[e]={...t.readme[e],...n})})),t}))}function getSupportedFeatures(){return[...Object.keys(OPENAPI_FEATURE_DOCS),"readme"]}class SoftError extends Error{constructor(e){super(e),this.name="SoftError"}}function pluralize(e,t){return t>1?`${e}s`:e}function getFeatureDocsURL(e,t){if(e.url)return"object"==typeof e.url?t.startsWith("3.0")?e.url?.["3.0"]||"This feature is not available on OpenAPI v3.0.":t.startsWith("3.1")?e.url?.[3.1]||"This feature is not available on OpenAPI v3.1.":"":e.url}function buildFeaturesReport(e,t){let n=!1;const r=[""];return t.forEach((t=>{if(t in e.openapi){const i=e.openapi[t];i.present?(r.push(""),r.push(`${t}:`),r.push(...i.locations.map((e=>` · ${chalk.yellow(e)}`)))):(r.length&&r[r.length-1].length&&r.push(""),r.push(`${t}: You do not use this.`),n=!0)}})),t.includes("readme")&&(t.length>1&&r[r.length-1].length&&r.push(""),Object.entries(e.readme).forEach((([e,t])=>{t.hidden||(t.present?(r.push(`${e}:`),r.push(...t.locations.map((e=>` · ${chalk.yellow(e)}`))),r.push("")):(r.push(`${e}: You do not use this.`),n=!0))}))),r[1].length||r.splice(0,1),r[r.length-1].length||r.pop(),{report:r.join("\n"),hasUnusedFeature:n}}function buildFullReport(e,t,n){const r=["Here are some interesting things we found in your API definition. 🕵️",""];return r.push(...Object.entries(e.general||{}).map((([,e])=>{if(Array.isArray(e.found)){if(!e.found.length)return!1;const t=e.found.map((e=>chalk.yellow(e)));if(e.found.length>1){const n=pluralize(e.name.toLowerCase(),e.found.length);return`You are using ${chalk.bold(e.found.length)} ${n} throughout your API: ${new Intl.ListFormat("en").format(t)}`}return`You are using a single ${e.name.toLowerCase()} throughout your API: ${t[0]}`}if(e.found>1){let t;return t=`You have a total of ${chalk.bold(e.found)} ${pluralize(e.name.toLowerCase(),e.found)} in your API.`,e.found>200&&(t+=` ${chalk.cyanBright("Wow! 🤯")}`),t}return`You have a single ${e.name.toLowerCase()} in your API.`})).filter(Boolean).map((e=>` · ${e}`))),r.push(""),[{component:"openapi",header:"OpenAPI Features",emoji:"🌲"},{component:"readme",header:"ReadMe-Specific Features and Extensions",emoji:"🦉"}].forEach((({component:i,header:o,emoji:s})=>{const a=[[chalk.bold.yellow("Feature"),chalk.bold.yellow("Used?"),chalk.bold.yellow("Description")],...Object.entries(e[i]).map((([e,n])=>{if(n.hidden)return!1;const r=[];n.description&&r.push(n.description);const i=getFeatureDocsURL(n,t);return i&&r.push(chalk.dim(i)),[e,n.present?"🟢":"🔴",r.join("\n\n")]})).filter(Boolean)];r.push(`${s} ${o}`),r.push(srcExports$1.table(a,{border:n,columns:{0:{width:26},2:{width:80,wrapWord:!0}}}))})),r.join("\n")}class OpenAPIInspectCommand extends BaseCommand{static summary="Analyze an OpenAPI/Swagger definition for various OpenAPI and ReadMe feature usage.";static description="This command will perform a comprehensive analysis of your API definition to determine how it's utilizing aspects of the OpenAPI Specification (such as circular references, polymorphism, etc.) and any ReadMe-specific extensions you might be using.";static args={spec:specArg};static flags={feature:libExports$3.Flags.string({description:"A specific OpenAPI or ReadMe feature you wish to see detailed information on (if it exists). If any features supplied do not exist within the API definition an exit(1) code will be returned alongside the report.",multiple:!0,options:getSupportedFeatures()}),workingDirectory:workingDirectoryFlag};static examples=[{description:"By default, this command will display a comprehensive table of all OpenAPI and ReadMe features found in your API definition:",command:"<%= config.bin %> <%= command.id %> [url-or-local-path-to-file]"},{description:"You can omit the file name and `rdme` will scan your working directory (and any subdirectories) for OpenAPI/Swagger files. This approach will provide you with CLI prompts, so we do not recommend this technique in CI environments.",command:"<%= config.bin %> <%= command.id %>"},{description:"If you wish to automate this command, it contains a `--feature` flag so you can filter for one or several specific features. If you pass in one or more `--feature` flags, the command returns a `0` exit code if your definition contains all of the given features and a `1` exit code if your definition lacks any of the given features:",command:"<%= config.bin %> <%= command.id %> [url-or-local-path-to-file] --feature circularRefs --feature polymorphism"}];async run(){const{spec:e}=this.args,{workingDirectory:t,feature:n}=this.flags,r=Object.entries(srcExports$1.getBorderCharacters("norc")).map((([e,t])=>({[e]:chalk.gray(t)}))).reduce(((e,t)=>Object.assign(e,t)));if(t){const e=process.cwd();process.chdir(t),this.debug(`switching working directory from ${e} to ${process.cwd()}`)}const{preparedSpec:i,definitionVersion:o}=await prepareOas(e,"openapi inspect"),s=JSON.parse(i),a=ora({...oraOptions()});n?.length?a.start(`Analyzing your API definition for usage of ${new Intl.ListFormat("en").format(n.map((e=>"readme"===e?"ReadMe extensions":e)))}...`):a.start("Analyzing your API definition for OpenAPI and ReadMe feature usage...");const c=await analyzeOas(s).catch((e=>{throw this.debug(`analyzer err: ${e.message}`),a.fail(),e}));if(n?.length){a.succeed(`${a.text} done! ✅`);const{report:e,hasUnusedFeature:t}=buildFeaturesReport(c,n);return t?Promise.reject(new SoftError(e)):Promise.resolve(e)}return a.stop(),Promise.resolve(buildFullReport(c,o.version,r))}}function getUsedRefs(e){return query(["$..['$ref']"],e)}function accumulateUsedRefs(e,t,n){let r;"string"==typeof n&&(r=jsonPointer.get(e,n.substring(1))),void 0!==r&&getUsedRefs(r).forEach((({value:n})=>{t.has(n)||(t.add(n),accumulateUsedRefs(e,t,n))}))}function reducer(e,t={}){const n="tags"in t?t.tags.map((e=>e.toLowerCase())):[],r="paths"in t?Object.entries(t.paths).reduce(((e,[t,n])=>{const r=t.toLowerCase(),i=Array.isArray(n)?n.map((e=>e.toLowerCase())):n.toLowerCase();return e[r]=i,e}),{}):{},i=new Set,o=new Set;if(!e.openapi)throw new Error("Sorry, only OpenAPI definitions are supported.");const s=JSON.parse(JSON.stringify(e));if("security"in s&&Object.values(s.security).forEach((e=>{Object.keys(e).forEach((e=>{i.add(`#/components/securitySchemes/${e}`)}))})),"paths"in s&&(Object.keys(s.paths).forEach((e=>{const t=e.toLowerCase();!Object.keys(r).length||t in r?(Object.keys(s.paths[e]).forEach((a=>{if("parameters"!==a&&Object.keys(r).length&&"*"!==r[t]&&Array.isArray(r[t])&&!r[t].includes(a))return void delete s.paths[e][a];const c=s.paths[e][a];if(n.length){if(!("tags"in c))return void delete s.paths[e][a];if(!c.tags.filter((e=>n.includes(e.toLowerCase()))).length)return void delete s.paths[e][a]}"tags"in c&&c.tags.forEach((e=>{o.add(e)})),getUsedRefs(c).forEach((({value:e})=>{i.add(e)})),"security"in c&&Object.values(c.security).forEach((e=>{Object.keys(e).forEach((e=>{i.add(`#/components/securitySchemes/${e}`)}))}))})),Object.keys(s.paths[e]).length||delete s.paths[e]):delete s.paths[e]})),!Object.keys(s.paths).length))throw new Error("All paths in the API definition were removed. Did you supply the right path name to reduce by?");return i.forEach((e=>accumulateUsedRefs(s,i,e))),"components"in s&&(Object.keys(s.components).forEach((e=>{Object.keys(s.components[e]).forEach((t=>{i.has(`#/components/${e}/${t}`)||delete s.components[e][t]})),Object.keys(s.components[e]).length||delete s.components[e]})),Object.keys(s.components).length||delete s.components),"tags"in s&&(s.tags.forEach(((e,t)=>{o.has(e.name)||delete s.tags[t]})),s.tags=s.tags.filter(Boolean),s.tags.length||delete s.tags),s}class OpenAPIReduceCommand extends BaseCommand{static summary="Reduce an OpenAPI definition into a smaller subset.";static description="Reduce your API definition down to a specific set of tags or paths, which can be useful if you're debugging a problematic schema somewhere, or if you have a file that is too big to maintain.";static args={spec:specArg};static flags={method:libExports$3.Flags.string({description:"Methods to reduce by (can only be used alongside the `path` option)",multiple:!0}),out:libExports$3.Flags.string({description:"Output file path to write reduced file to"}),path:libExports$3.Flags.string({description:"Paths to reduce by",multiple:!0}),tag:libExports$3.Flags.string({description:"Tags to reduce by",multiple:!0}),title:titleFlag,workingDirectory:workingDirectoryFlag};static examples=[{description:"By default, this command will ask you a couple questions about how you wish to reduce the file and then do so:",command:"<%= config.bin %> <%= command.id %> [url-or-local-path-to-file]"},{description:"You can omit the file name and `rdme` will scan your working directory (and any subdirectories) for OpenAPI/Swagger files. This approach will provide you with CLI prompts, so we do not recommend this technique in CI environments.",command:"<%= config.bin %> <%= command.id %>"},{description:"If you wish to automate this command, you can pass in CLI arguments to bypass the prompts:",command:"<%= config.bin %> <%= command.id %> petstore.json --path /pet/{id} --method get --method put --out petstore.reduced.json"}];async run(){const{spec:e}=this.args,t=this.flags,{title:n,workingDirectory:r}=t;if(r){const e=process.cwd();process.chdir(r),this.debug(`switching working directory from ${e} to ${process.cwd()}`)}const{preparedSpec:i,specPath:o,specType:s}=await prepareOas(e,"openapi reduce",{title:n}),a=JSON.parse(i);if("OpenAPI"!==s)throw new Error("Sorry, this reducer feature in rdme only supports OpenAPI 3.0+ definitions.");if((t.path?.length||t.method?.length)&&t.tag?.length)throw new Error("You can pass in either tags or paths/methods, but not both.");prompts.override({reduceBy:t.tag?.length?"tags":t.path?.length?"paths":void 0,tags:t.tag,paths:t.path,methods:t.method,outputPath:t.out});const c=await promptTerminal([{type:"select",name:"reduceBy",message:"Would you like to reduce by paths or tags?",choices:[{title:"Tags",value:"tags"},{title:"Paths",value:"paths"}]},{type:(e,t)=>"tags"===t.reduceBy?"multiselect":null,name:"tags",message:"Choose which tags to reduce by:",min:1,choices:()=>new Oas(a).getTags().map((e=>({title:e,value:e})))},{type:(e,t)=>"paths"===t.reduceBy?"multiselect":null,name:"paths",message:"Choose which paths to reduce by:",min:1,choices:()=>Object.keys(a.paths||[]).map((e=>({title:e,value:e})))},{type:(e,t)=>"paths"===t.reduceBy?"multiselect":null,name:"methods",message:"Choose which HTTP methods that are available across these paths to reduce by:",min:1,choices:(e,n)=>{let r=n.paths.map((e=>Object.keys(a.paths?.[e]||{}))).flat().filter((e=>"parameters"!==e.toLowerCase()));if(!r.length&&!t.method?.length)throw new Error("All paths in the API definition were removed. Did you supply the right path name to reduce by?");return r=[...new Set(r)],r.sort(),r.map((e=>({title:e.toUpperCase(),value:e})))}},{type:"text",name:"outputPath",message:"Enter the path to save your reduced API definition to:",initial:()=>{const e=path$1.extname(o);return`${path$1.basename(o).split(e)[0]}.reduced${e}`},validate:e=>validateFilePath(e)}]);this.debug(`reducing by ${c.reduceBy}`),this.debug(`options being supplied to the reducer: ${JSON.stringify({tags:c.tags,paths:c.paths,methods:c.methods})}`),this.debug(`about to reduce spec located at ${o}`);const u=ora({...oraOptions()});let l;u.start("Reducing your API definition...");try{l=reducer(a,{tags:c.tags||[],paths:(c.paths||[]).reduce(((e,t)=>(e[t]=c.methods,e)),{})}),u.succeed(`${u.text} done! ✅`)}catch(e){throw this.debug(`reducer err: ${e.message}`),u.fail(),e}return this.debug(`saving reduced spec to ${c.outputPath}`),fs$6.writeFileSync(c.outputPath,JSON.stringify(l,null,2)),this.debug("reduced spec saved"),Promise.resolve(chalk.green(`Your reduced API definition has been saved to ${c.outputPath}! 🤏`))}}var slugify$2={exports:{}},slugify$1=slugify$2.exports,hasRequiredSlugify;function requireSlugify(){return hasRequiredSlugify||(hasRequiredSlugify=1,function(e){!function(t,n,r){e.exports=r(),e.exports.default=r()}(0,0,(function(){var e=JSON.parse('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E\'","Ը":"Y\'","Թ":"T\'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C\'","Կ":"K","Հ":"H","Ձ":"D\'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R\'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P\'","Ք":"Q\'","Օ":"O\'\'","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"\'","’":"\'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}'),t=JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');function n(n,r){if("string"!=typeof n)throw new Error("slugify: string argument expected");var i=t[(r="string"==typeof r?{replacement:r}:r||{}).locale]||{},o=void 0===r.replacement?"-":r.replacement,s=void 0===r.trim||r.trim,a=n.normalize().split("").reduce((function(t,n){var s=i[n];return void 0===s&&(s=e[n]),void 0===s&&(s=n),s===o&&(s=" "),t+s.replace(r.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")}),"");return r.strict&&(a=a.replace(/[^A-Za-z0-9\s]/g,"")),s&&(a=a.trim()),a=a.replace(/\s+/g,o),r.lower&&(a=a.toLowerCase()),a}return n.extend=function(t){Object.assign(e,t)},n}))}(slugify$2)),slugify$2.exports}var slugifyExports=requireSlugify(),slugify=getDefaultExportFromCjs(slugifyExports),tmpPromise={exports:{}},tmp={exports:{}},hasRequiredTmp,hasRequiredTmpPromise;function requireTmp(){return hasRequiredTmp||(hasRequiredTmp=1,function(e){const t=require$$0$8,n=require$$0$a,r=require$$0$9,i=require$$0$g,o={fs:t.constants,os:n.constants},s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",a=/XXXXXX/,c=(o.O_CREAT||o.fs.O_CREAT)|(o.O_EXCL||o.fs.O_EXCL)|(o.O_RDWR||o.fs.O_RDWR),u="win32"===n.platform(),l=o.EBADF||o.os.errno.EBADF,d=o.ENOENT||o.os.errno.ENOENT,p=[],f=t.rmdirSync.bind(t);let _=!1;function m(e,n){return t.rm(e,{recursive:!0},n)}function h(e){return t.rmSync(e,{recursive:!0})}function g(e,n){const r=k(e,n),i=r[0],o=r[1];try{w(i)}catch(e){return o(e)}let s=i.tries;!function e(){try{const n=D(i);t.stat(n,(function(t){if(!t)return s-- >0?e():o(new Error("Could not get a unique tmp filename, max tries reached "+n));o(null,n)}))}catch(e){o(e)}}()}function A(e){const n=k(e)[0];w(n);let r=n.tries;do{const e=D(n);try{t.statSync(e)}catch(t){return e}}while(r-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function y(e,n){const r=function(e){if(e&&!R(e))return n(e);n()};0<=e[0]?t.close(e[0],(function(){t.unlink(e[1],r)})):t.unlink(e[1],r)}function v(e){let n=null;try{0<=e[0]&&t.closeSync(e[0])}catch(e){if(!function(e){return F(e,-l,"EBADF")}(e)&&!R(e))throw e}finally{try{t.unlinkSync(e[1])}catch(e){R(e)||(n=e)}}if(null!==n)throw n}function b(e,t,n,r){const i=E(v,[t,e],r),o=E(y,[t,e],r,i);return n.keep||p.unshift(i),r?i:o}function C(e,n,r){const i=n.unsafeCleanup?m:t.rmdir.bind(t),o=E(n.unsafeCleanup?h:f,e,r),s=E(i,e,r,o);return n.keep||p.unshift(o),r?o:s}function E(e,t,n,r){let i=!1;return function o(s){if(!i){const a=r||o,c=p.indexOf(a);return c>=0&&p.splice(c,1),i=!0,n||e===f||e===h?e(t):e(t,s||function(){})}}}function x(e){let t=[],n=null;try{n=i.randomBytes(e)}catch(t){n=i.pseudoRandomBytes(e)}for(var r=0;rn.file(e,((e,n,i,o)=>e?r(e):r(void 0,{path:n,fd:i,cleanup:t(o)})))));e.exports.file=async e=>r(e),e.exports.withFile=async function(t,n){const{path:r,fd:i,cleanup:o}=await e.exports.file(n);try{return await t({path:r,fd:i})}finally{await o()}},e.exports.dirSync=n.dirSync;const i=t(((e,r)=>n.dir(e,((e,n,i)=>e?r(e):r(void 0,{path:n,cleanup:t(i)})))));e.exports.dir=async e=>i(e),e.exports.withDir=async function(t,n){const{path:r,cleanup:i}=await e.exports.dir(n);try{return await t({path:r})}finally{await i()}},e.exports.tmpNameSync=n.tmpNameSync,e.exports.tmpName=t(n.tmpName),e.exports.tmpdir=n.tmpdir,e.exports.setGracefulCleanup=n.setGracefulCleanup}(tmpPromise)),tmpPromise.exports}var tmpPromiseExports=requireTmpPromise();class OpenAPIUploadCommand extends BaseCommand{static summary="Upload (or re-upload) your API definition to ReadMe.";static description=["By default, the slug (i.e., the unique identifier for your API definition resource in ReadMe) will be inferred from the spec name and path. As long as you maintain these directory/file names and run `rdme` from the same location relative to your file, the inferred slug will be preserved and any updates you make to this file will be synced to the same resource in ReadMe.","If the spec is a local file, the inferred slug takes the relative path and slugifies it (e.g., the slug for `docs/api/petstore.json` will be `docs-api-petstore.json`).","If the spec is a URL, the inferred slug is the base file name from the URL (e.g., the slug for `https://example.com/docs/petstore.json` will be `petstore.json`)."].join("\n\n");static args={spec:specArg};static flags={key:keyFlag,slug:libExports$3.Flags.string({summary:"Override the slug (i.e., the unique identifier) for your API definition.",description:["Allows you to override the slug (i.e., the unique identifier for your API definition resource in ReadMe) that's inferred from the API definition's file/URL path.","You do not need to include a file extension (i.e., either `custom-slug.json` or `custom-slug` will work). If you do, it must match the file extension of the file you're uploading."].join("\n\n")}),useSpecVersion:libExports$3.Flags.boolean({summary:"Use the OpenAPI `info.version` field for your ReadMe project version",description:"If included, use the version specified in the `info.version` field in your OpenAPI definition for your ReadMe project version. This flag is mutually exclusive with `--version`.",exclusive:["version"]}),version:libExports$3.Flags.string({summary:"ReadMe project version",description:"Defaults to `stable` (i.e., your main project version). This flag is mutually exclusive with `--useSpecVersion`.",default:"stable"})};static examples=[{description:"You can pass in a file name like so:",command:"<%= config.bin %> <%= command.id %> --version=1.0.0 openapi.json"},{description:"You can also pass in a file in a subdirectory (we recommend always running the CLI from the root of your repository):",command:"<%= config.bin %> <%= command.id %> --version=v1.0.0 example-directory/petstore.json"},{description:"You can also pass in a URL:",command:"<%= config.bin %> <%= command.id %> --version=1.0.0 https://example.com/openapi.json"},{description:"If you specify your ReadMe project version in the `info.version` field in your OpenAPI definition, you can use that:",command:"<%= config.bin %> <%= command.id %> --useSpecVersion https://example.com/openapi.json"}];async pollAPIUntilUploadIsComplete(e,t){let n=0,r="pending";for(;"pending"===r&&n<10;){await new Promise((e=>{setTimeout(e,Math.min(isTest()?1:1e3*2**n,3e4))})),this.debug(`polling API for status of ${e}, count is ${n}`);const i=await this.readmeAPIFetch(e,{headers:t}).then((e=>this.handleAPIRes(e)));r=i?.data?.upload?.status,n+=1}if("pending"===r)throw new Error("Sorry, this upload timed out. Please try again later.");return r}async run(){const{spec:e}=this.args,{preparedSpec:t,specFileType:n,specPath:r,specVersion:i}=await prepareOas(e,"openapi"),o=this.flags.useSpecVersion?i:this.flags.version;let s="url"===n?path$1.basename(r):slugify.default(r);if(this.flags.slug){const e=path$1.extname(s),t=path$1.extname(this.flags.slug);if(t&&(![".json",".yaml",".yml"].includes(t)||e!==t))throw new Error("Please provide a valid file extension that matches the extension on the file you provided. Must be `.json`, `.yaml`, or `.yml`.");s=`${this.flags.slug.replace(t,"")}${e}`}const a=new Headers({authorization:`Bearer ${this.flags.key}`}),c=await this.readmeAPIFetch(`/versions/${o}/apis`,{headers:a}).then((e=>this.handleAPIRes(e))),u=c?.data?.some((e=>e.filename===s))?"PUT":"POST";if(this.debug(`making a ${u} request`),"PUT"===u){prompts.override({confirm:!!isCI()||void 0});const{confirm:e}=await promptTerminal({type:"confirm",name:"confirm",message:`This will overwrite the existing API definition for ${s}. Are you sure you want to continue?`});if(!e)throw new Error("Aborting, no changes were made.")}const l=new FormData;if("url"===n)this.debug("attaching URL to form data payload"),l.append("url",r);else{const{path:e}=await tmpPromiseExports.file({prefix:"rdme-openapi-",postfix:".json"});this.debug(`creating temporary file at ${e}`),fs$6.writeFileSync(e,t);const n=fs$6.createReadStream(e);this.debug("file and stream created, streaming into form data payload"),l.append("schema",{[Symbol.toStringTag]:"File",name:s,stream:()=>n,type:"application/json"})}const d={headers:a,method:u,body:l},p=ora({...oraOptions()}).start(("POST"===u?"Creating":"Updating")+" your API definition to ReadMe..."),f=await this.readmeAPIFetch(`/versions/${o}/apis${"POST"===u?"":`/${s}`}`,d).then((e=>this.handleAPIRes(e))).catch((e=>{throw p.fail(),e}));if(f?.data?.upload?.status&&f?.data?.uri){let e=f.data.upload.status;if("pending"===e&&(p.text=`${p.text} uploaded but not yet processed by ReadMe. Polling for completion...`,e=await this.pollAPIUntilUploadIsComplete(f.data.uri,a)),"done"===e)return p.succeed(`${p.text} done!`),this.log(`🚀 Your API definition (${s}) was successfully ${"POST"===u?"created":"updated"} in ReadMe!`),{uri:f.data.uri,status:e}}throw p.fail(),new Error("Your API definition upload failed with an unexpected error. Please get in touch with us at support@readme.io.")}}class OpenAPIValidateCommand extends BaseCommand{static summary="Validate your OpenAPI/Swagger definition.";static description="Perform a local validation of your API definition (no ReadMe account required!), which can be useful when constructing or editing your API definition.";static id="openapi validate";static args={spec:specArg};static examples=[{description:"This will validate the API definition at the given URL or path:",command:"<%= config.bin %> <%= command.id %> [url-or-local-path-to-file]"},{description:"You can omit the file name and `rdme` will scan your working directory (and any subdirectories) for OpenAPI/Swagger files. This approach will provide you with CLI prompts, so we do not recommend this technique in CI environments.",command:"<%= config.bin %> <%= command.id %>"}];static flags={github:githubFlag,workingDirectory:workingDirectoryFlag};async run(){if(this.flags.workingDirectory){const e=process.cwd();process.chdir(this.flags.workingDirectory),this.debug(`switching working directory from ${e} to ${process.cwd()}`)}const{specPath:e,specType:t}=await prepareOas(this.args.spec,OpenAPIValidateCommand.id);return this.runCreateGHAHook({parsedOpts:{...this.flags,spec:e},result:chalk.green(`${e} is a valid ${t} API definition!`)})}}class WhoAmICommand extends BaseCommand{static description="Displays the current user and project authenticated with ReadMe.";async run(){const{email:e,project:t}=getCurrentConfig();return e&&t?Promise.resolve(`You are currently logged in as ${chalk.green(e)} to the ${chalk.blue(t)} project.`):Promise.reject(new Error(`Please login using \`${this.config.bin} login\`.`))}}const hook$1=async function(e){const t=e.result,n=e.command,r=e.parsedOpts;return createGHA.call(this,t,n,r)},hook=async function(e){this.debug("configstore location:",configstore.path),e.Command?.flags?.key?(this.debug("current command has --key flag"),isTest()?e.Command.flags.key=keyFlag:e.Command.flags.key=libExports$3.Flags.string({parse:async e=>{this.debug("--key flag detected in parse function");const{email:t,project:n}=getCurrentConfig.call(this);return e&&configstore.get("apiKey")===e&&info(`🔑 ${chalk.green(t)} is currently logged in, using the stored API key for this project: ${chalk.blue(n)}`,{includeEmojiPrefix:!1}),e},default:async()=>{this.debug("no --key flag detected, running default function");const{apiKey:e}=getCurrentConfig.call(this);if(e)return this.debug("api key found in config, returning"),e;if(isCI())throw new Error("No project API key provided. Please use `--key`.");info("Looks like you're missing a ReadMe API key, let's fix that! 🦉",{includeEmojiPrefix:!1});return info(await loginFlow(),{includeEmojiPrefix:!1}),configstore.get("apiKey")}})):this.debug("current command does not have --key flag"),e.Command?.flags?.github?(this.debug("current command has --github flag"),isCI()&&(this.debug("in CI environment"),e.Command.flags.github=libExports$3.Flags.boolean({parse:()=>{throw new Error("The `--github` flag is only for usage in non-CI environments.")}})),process.env.TEST_RDME_CREATEGHA&&(e.Command.flags.github=githubFlag)):this.debug("current command does not have --github flag")},COMMANDS={changelogs:ChangelogsCommand,login:LoginCommand,logout:LogoutCommand,"openapi:convert":OpenAPIConvertCommand,"openapi:inspect":OpenAPIInspectCommand,"openapi:reduce":OpenAPIReduceCommand,"openapi:upload":OpenAPIUploadCommand,"openapi:validate":OpenAPIValidateCommand,whoami:WhoAmICommand};export{COMMANDS,hook$1 as createGHA,hook as prerun}; +var e=Object.prototype.toString,t=Array.isArray||function(t){return"[object Array]"===e.call(t)};function n(e){return"function"==typeof e}function r(e){return t(e)?"array":typeof e}function i(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(e,t){return null!=e&&"object"==typeof e&&t in e}function s(e,t){return null!=e&&"object"!=typeof e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var a=RegExp.prototype.test;function c(e,t){return a.call(e,t)}var u=/\S/;function l(e){return!c(u,e)}var d={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function p(e){return String(e).replace(/[&<>"'`=\/]/g,(function(e){return d[e]}))}var f=/\s*/,_=/\s+/,m=/\s*=/,h=/\s*\}/,g=/#|\^|\/|>|\{|&|=|!/;function A(e,n){if(!e)return[];var r,o,s,a=!1,c=[],u=[],d=[],p=!1,A=!1,C="",E=0;function S(){if(p&&!A)for(;d.length;)delete u[d.pop()];else d=[];p=!1,A=!1}function k(e){if("string"==typeof e&&(e=e.split(_,2)),!t(e)||2!==e.length)throw new Error("Invalid tags: "+e);r=new RegExp(i(e[0])+"\\s*"),o=new RegExp("\\s*"+i(e[1])),s=new RegExp("\\s*"+i("}"+e[1]))}k(n||x.tags);for(var D,w,I,T,R,F,P=new b(e);!P.eos();){if(D=P.pos,I=P.scanUntil(r))for(var N=0,B=I.length;N0?i[i.length-1][4]:n;break;default:r.push(t)}return n}function b(e){this.string=e,this.tail=e,this.pos=0}function C(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function E(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}b.prototype.eos=function(){return""===this.tail},b.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},b.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},C.prototype.push=function(e){return new C(e,this)},C.prototype.lookup=function(e){var t,r=this.cache;if(r.hasOwnProperty(e))t=r[e];else{for(var i,a,c,u=this,l=!1;u;){if(e.indexOf(".")>0)for(i=u.view,a=e.split("."),c=0;null!=i&&c"===s?a=this.renderPartial(o,t,n,i):"&"===s?a=this.unescapedValue(o,t):"name"===s?a=this.escapedValue(o,t,i):"text"===s&&(a=this.rawValue(o)),void 0!==a&&(c+=a);return c},E.prototype.renderSection=function(e,r,i,o,s){var a=this,c="",u=r.lookup(e[1]);function l(e){return a.render(e,r,i,s)}if(u){if(t(u))for(var d=0,p=u.length;d0||!n)&&(i[o]=r+i[o]);return i.join("\n")},E.prototype.renderPartial=function(e,t,r,i){if(r){var o=this.getConfigTags(i),s=n(r)?r(e[1]):r[e[1]];if(null!=s){var a=e[6],c=e[5],u=e[4],l=s;0==c&&u&&(l=this.indentPartial(s,u,a));var d=this.parse(l,o);return this.renderTokens(d,t,r,l,i)}}},E.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return n},E.prototype.escapedValue=function(e,t,n){var r=this.getConfigEscape(n)||x.escape,i=t.lookup(e[1]);if(null!=i)return"number"==typeof i&&r===x.escape?String(i):r(i)},E.prototype.rawValue=function(e){return e[1]},E.prototype.getConfigTags=function(e){return t(e)?e:e&&"object"==typeof e?e.tags:void 0},E.prototype.getConfigEscape=function(e){return e&&"object"==typeof e&&!t(e)?e.escape:void 0};var x={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){S.templateCache=e},get templateCache(){return S.templateCache}},S=new E;return x.clearCache=function(){return S.clearCache()},x.parse=function(e,t){return S.parse(e,t)},x.render=function(e,t,n,i){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+r(e)+'" was given as the first argument for mustache#render(template, view, partials)');return S.render(e,t,n,i)},x.escape=p,x.Scanner=b,x.Context=C,x.Writer=E,x}()),mustache$1.exports}function requireVarReplacer(){if(hasRequiredVarReplacer)return varReplacer;hasRequiredVarReplacer=1;const e=requireMustache();return e.Writer.prototype.escapedValue=function(e,t){const n=t.lookup(e[1])||`{{${e[1]}}}`;return String(n)},varReplacer=function(t,n={}){const r=JSON.parse(t),{variable:i=[]}=r,o={...i.reduce(((e,{key:t,value:n})=>(e[t]=n,e)),{}),...n};return e.render(t,o)}}function requireSrc$3(){if(hasRequiredSrc$3)return src$3;hasRequiredSrc$3=1;const{promises:{writeFile:e,readFile:t}}=require$$0$8,{getStatusCodeMessage:n}=requireSrc$4(),{dump:r}=requireJsYaml(),i=require$$3,o=requireLodash_camelcase(),{parseMdTable:s}=requireMdUtils(),a=requireVarReplacer();function c({tag:e,name:t},{separator:n=" > ",concat:r=!0}){return e&&r?`${e}${n}${t}`:t}function u(e,t){const{info:{name:n,description:r},variable:i=[]}=e,o=y(i,"version","1.0.0"),{title:s=n,description:a=r,version:c=o,termsOfService:u,license:f,contact:_,xLogo:m}=t;return{title:s,description:a,version:c,...l(i,m),...u?{termsOfService:u}:{},...p(i,_),...d(i,f)}}function l(e,t={}){const n=y(e,"x-logo.urlVar"),r=y(e,"x-logo.backgroundColorVar"),i=y(e,"x-logo.altTextVar"),o=y(e,"x-logo.hrefVar"),{url:s=n,backgroundColor:a=r,altText:c=i,href:u=o}=t;return null!=s?{"x-logo":{url:s,backgroundColor:a,altText:c,href:u}}:{}}function d(e,t={}){const n=y(e,"license.name"),r=y(e,"license.url"),{name:i=n,url:o=r}=t;return null!=i?{license:{name:i,...o?{url:o}:{}}}:{}}function p(e,t={}){const n=y(e,"contact.name"),r=y(e,"contact.url"),i=y(e,"contact.email"),{name:o=n,url:s=r,email:a=i}=t;return[o,s,a].some((e=>null!=e))?{contact:{...o?{name:o}:{},...s?{url:s}:{},...a?{email:a}:{}}}:{}}function f(e,t){const n=y(e,"externalDocs.description"),r=y(e,"externalDocs.url"),{description:i=n,url:o=r}=t;return null!=o?{externalDocs:{url:o,...i?{description:i}:{}}}:{}}function _(e={},t){if(["GET","DELETE"].includes(t))return{};const{mode:n,raw:r,options:o={raw:r}}=e;let s={};switch(n){case"raw":{const{raw:{language:e}}=o;let t="";if("json"===e){if(r){const e=[];t=i.parse(r,e),e.length>0&&(t=r)}s={"application/json":{schema:{type:"object",example:t}}}}else s="text"===e?{"text/plain":{schema:{type:"string",example:r}}}:{"*/*":{schema:{type:"string",example:JSON.stringify(r)}}};break}case"file":s={"text/plain":{}};break;case"formdata":s={"multipart/form-data":m(e.formdata)};break;case"urlencoded":s={"application/x-www-form-urlencoded":m(e.urlencoded)}}return{requestBody:{content:s}}}function m(e){return e.reduce(((e,{key:t,type:n,description:r,value:i})=>{const{schema:o}=e;return function(e){return/\[required\]/gi.test(e)}(r)&&(o.required=o.required||[]).push(t),(o.properties=o.properties||{})[t]={type:v(i),...r?{description:r.replace(/ ?\[required\] ?/gi,"")}:{},...i?{example:i}:{},..."file"===n?{format:"binary"}:{}},e}),{schema:{type:"object"}})}const h=(e,t)=>(e.has(t.name)||e.set(t.name,t),e);function g(e,t,n,r={},i,{includeQuery:o=!1,includeHeader:s=!1},a=h){const c=[...t.reduce(A("header",s,a),new Map).values()];return c.push(...e.reduce(A("query",o,a),new Map).values()),c.push(...function(e,t,n){const r=e.match(/{\s*[\w-]+\s*}/g)||[];return r.map((e=>{const r=e.slice(1,-1),{type:i="string",description:o,value:s}=n[r]||{},{type:a=i,description:c=o,example:u=s}=t[r]||{};return{name:r,in:"path",schema:{type:a},required:!0,...c?{description:c}:{},...u?{example:u}:{}}}))}(n,r,i)),c.length?{parameters:c}:{}}function A(e,t,n){return(r,{key:i,description:o,value:s,disabled:a})=>{if(!t&&!0===a)return r;const c=/\[required\]/gi.test(o);return n(r,{name:i,in:e,schema:{type:v(s)},...c?{required:c}:{},...o?{description:o.replace(/ ?\[required\] ?/gi,"")}:{},...s?{example:s}:{}}),r}}function y(e,t,n=void 0){const r=e.find((({key:e})=>e===t));return r?r.value:n}function v(e){return/^\d+$/.test(e)?"integer":/^[+-]?([0-9]*[.])?[0-9]+$/.test(e)?"number":/^(true|false)$/.test(e)?"boolean":"string"}function b({auth:e},t,n){return null!=t?function(e){const t={},n=[];for(const[r,i]of Object.entries(e)){const{type:e,scheme:o,...s}=i;"http"===e&&["bearer","basic"].includes(o)&&(t[r]={type:"http",scheme:o,...s},n.push({[r]:[]}))}return 0===Object.keys(t).length?{}:{components:{securitySchemes:t},security:n}}(t):function(e={},t){const{type:n}=e;if(null!=n)return t[`${n}Auth`]={type:"http",scheme:n},{components:{securitySchemes:t},security:[{[`${n}Auth`]:[]}]};return 0===Object.keys(t).length?{}:{components:{securitySchemes:t}}}(e,n)}function C(e,t,n){if(null==e||null!=n)return{};const{type:r}=e;return t[`${r}Auth`]={type:"http",scheme:r},{security:[{[`${r}Auth`]:[]}]}}function E(e,t){return`/${(e=e.slice(t)).map((e=>e=(e=e.replace(/([{}])\1+/g,"$1")).replace(/^:(.*)/g,"{$1}"))).join("/")}`}function x(e,t,n){return`${e}://${t.join(".")}${n?`:${n}`:""}`}function S(e){if(void 0===e||""===e||""===e.raw)return{valid:!1};const t="string"==typeof e||e instanceof String?e:e.raw,n=t.startsWith("{{")?`http://${t}`:t,r=new URL(n);return{raw:t,path:decodeURIComponent(r.pathname).slice(1).split("/"),query:k(r.searchParams,e.query),protocol:r.protocol.slice(0,-1),host:decodeURIComponent(r.hostname).split("."),port:r.port,valid:!0,pathVars:null==e.variable?{}:e.variable.reduce(((e,{key:t,value:n,description:r})=>(e[t]={value:n,description:r,type:v(n)},e)),{})}}function k(e,t=[]){return t}function D(e,t){let n;return n=null!=t?t.map((({url:e,description:t})=>({url:e,description:t}))):Array.from(e).map((e=>({url:e}))),n.length>0?{servers:n}:{}}function w(e){const t=Object.entries(e).map((([e,t])=>({name:e,description:t})));return t.length>0?{tags:t}:{}}function I(e){if(null==e)return{description:e};const t=e.split(/# postman-to-openapi/gi);return 1===t.length?{description:e}:{description:t[0].trim(),paramsMeta:s(t[1])}}function T(e,t,r){return null!=e&&Array.isArray(e)&&e.length>0?function(e,t){const r=e.reduce(((e,{name:t,code:r,status:i,header:o,body:s,_postman_previewlanguage:a})=>{if(void 0===r&&(r="default"),!i)try{i=n({code:r})}catch(e){i=r}return r in e?(a in e[r].bodies||(e[r].bodies[a]=[]),e[r].bodies[a].push({name:t,body:s})):e[r]={description:i,header:o,bodies:{[a]:[{name:t,body:s}]}},e}),{}),i=Object.entries(r).reduce(((e,[n,{description:r,header:i,bodies:o}])=>(e[n]={description:r,...B(i,t),...F(o)},e)),{});return{responses:i}}(e,r):{responses:R(t)}}function R(e=[]){let t=200;const n=e.filter((e=>"test"===e.listen));if(n.length>0){const e=n[0].script.exec.join().match(/\.response\.code\)\.to\.eql\((\d{3})\)|\.to\.have\.status\((\d{3})\)/);t=e&&null!=e[1]?e[1]:e&&null!=e[2]?e[2]:t}return{[t]:{description:"Successful response",content:{"application/json":{}}}}}function F(e){return{content:Object.entries(e).reduce(((e,[t,n])=>("json"===t?e["application/json"]={schema:{type:"object"},...P(n,"json")}:e["text/plain"]={schema:{type:"string"},...P(n,"text")},e)),{})}}function P(e,t){if(Array.isArray(e)&&e.length>1)return{examples:e.reduce(((e,{name:n,body:r},i)=>(e[`example-${i}`]={summary:n,value:N(r,n,t)},e)),{})};const{body:n,name:r}=e[0];return{example:N(n,r,t)}}function N(e,t,n){if("json"===n){const n=[],r=i.parse(null==e||0===e.trim().length?"{}":e,n);if(n.length>0)throw new Error(`Error parsing response example "${t}"`);return r}return e}function B(e,t){if(!t)return{};const n=(e=e||[]).reduce(((e,{key:t,value:n})=>(e[t]={schema:{type:v(n),example:n}},e)),{});return Object.keys(n).length>0?{headers:n}:{}}function O(e,t,n){let r;switch(e){case"off":break;case"auto":r=o(n);break;case"brackets":{const e=t.match(/\[([^\[\]]*)\]/);r=e?e[1]:void 0;break}}return r?{operationId:r}:{}}return src$3=async function(n,i,{info:o={},defaultTag:s="default",pathDepth:l=0,auth:d,servers:p,externalDocs:m={},folders:h={},responseHeaders:A=!0,replaceVars:y=!1,additionalVars:v={},outputFormat:k="yaml",disabledParams:R={includeQuery:!1,includeHeader:!1},operationId:F="off"}={}){let P=await async function(e){if(e.trim().startsWith("{"))return e;return t(e,"utf8")}(n);y&&(P=a(P,v));const N=JSON.parse(P),B=N.collection||N,{item:q,variable:$=[]}=B,Q={},L=new Set,M={},j={};for(let[e,t]of q.entries()){for(;null!=t&&null!=t.item;){const{item:n,description:r}=t,i=c(t,h),o=n.map((e=>({...e,tag:i})));M[i]=r,q.splice(e,1,...o),t=o.length>0?o.shift():q[e]}if(null!=t){const{request:{url:e,method:n,body:r,description:i,header:o=[],auth:a},name:c,tag:u=s,event:p,response:f}=t,{path:m,query:h,protocol:y,host:v,port:b,valid:k,pathVars:D}=S(e);if(k){const e=c.replace(/ \[([^\[\]]*)\]/gi,"");L.add(x(y,v,b));const t=E(m,l);Q[t]||(Q[t]={});const{description:s,paramsMeta:S}=I(i);Q[t][n.toLowerCase()]={tags:[u],summary:e,...O(F,c,e),...s?{description:s}:{},..._(r,n),...C(a,j,d),...g(h,o,t,S,D,R),...T(f,p,A)}}}}const U={openapi:"3.0.0",info:u(B,o),...f($,m),...D(L,p),...b(B,d,j),...w(M),paths:Q},J="json"===k?JSON.stringify(U,null,4):r(U,{skipInvalid:!0});return null!=i&&await e(i,J,"utf8"),J},src$3}var srcExports$2=requireSrc$3(),postmanToOpenAPI=getDefaultExportFromCjs(srcExports$2),utils$1,hasRequiredUtils$1,requestOptions,hasRequiredRequestOptions,request,hasRequiredRequest,http_1,hasRequiredHttp,https_1,hasRequiredHttps,lib$8,hasRequiredLib$7;function requireUtils$1(){if(hasRequiredUtils$1)return utils$1;hasRequiredUtils$1=1;class e extends TypeError{constructor(e,t,n){e.includes(".");determiner}}return utils$1={ERR_INVALID_ARG_TYPE:e,assertIsObject:function t(n,r,i="Object"){if(void 0!==n&&(null===n||"object"!=typeof n||Array.isArray(n))){const o=new e(r,i,n);throw Error.captureStackTrace(o,t),o}},DebounceTimers:class{constructor(e,t){this.cb=e,this.delay=t,this.timers={},this.pausers={}}setDelay(e){e>=0&&(this.delay=e)}pause(e){this.pausers[e]=this.pausers[e]||0,this.pausers[e]++}unpause(e){var t=this.pausers[e]||0;t>0&&t--,this.pausers[e]=t}unpauseAndTime(e){this.unpause(e),this.time(e)}time(e){var t=this,n=this.timers,r=this.timers[e];this.pausers[e]>0||(r&&clearTimeout(r),n[e]=setTimeout((function(){t.cb(e),delete n[e]}),t.delay))}}},utils$1}function requireRequestOptions(){if(hasRequiredRequestOptions)return requestOptions;hasRequiredRequestOptions=1;const{assertIsObject:e}=requireUtils$1();function t(t){return e(t,"options"),(t=Object.assign({},t)).allowHalfOpen=!0,t.rejectUnauthorized=!1,e(t.settings,"options.settings"),t.settings=Object.assign({},t.settings),t.Http1IncomingMessage=t.Http1IncomingMessage||this.http.IncomingMessage,t.Http1ServerResponse=t.Http1ServerResponse||this.http.ServerResponse,t.Http2ServerRequest=t.Http2ServerRequest||(this.http2||{}).Http2ServerRequest,t.Http2ServerResponse=t.Http2ServerResponse||(this.http2||{}).Http2ServerResponse,t}return requestOptions={initializeTLSOptions:function(e,n){var r=(e=t.call(this,e)).ALPNProtocols=[];return this.http2Support&&r.push("h2"),1!=e.allowHTTP1&&this.http2Support||r.push("http/1.1"),void 0!==n&&void 0===e.servername&&(e.servername=n),e}},requestOptions}function requireRequest(){if(hasRequiredRequest)return request;hasRequiredRequest=1;const{URL:e}=require$$0$e,{EventEmitter:t}=require$$0$d,n=require$$0__default._extend,{DebounceTimers:r,assertIsObject:i,ERR_INVALID_ARG_TYPE:o}=requireUtils$1(),{initializeTLSOptions:s}=requireRequestOptions(),a=require$$2$1,c=require$$1$4,{Stream:u}=require$$0$c;function l(e,t){const n=t.prototype;Object.keys(n).forEach((t=>{-1==e.indexOf(t)&&0!=t.indexOf("_")&&"function"==typeof n[t]&&e.push(t)}))}const d=[];l(d,a.ClientRequest),l(d,a.OutgoingMessage),l(d,t),l(d,u);const p=["httpVersionMajor","httpVersionMinor","httpVersion"],f=["host","connection"],_=Symbol("stubs");function m(){this.http2Mimic=!0,this[_]=[];for(var t=0;te.agent?"https:"==e.agent.protocol?y.globalManager:b.globalManager:h.globalManager,genericStubber(e,t){return this[_]?(this[_].push([e,t]),!0):this[e](...arguments)},on(e,t){"response"==e&&(t.http2Safe||(arguments[0]=e="http1.response")),this._on?this._on(...arguments):this.genericStubber("on",arguments)},once(e,t){"response"==e&&(t.http2Safe||(e="http1.response")),this._once?this._once(...arguments):this.genericStubber("once",arguments)},emitError(e){if(!this[_])return this.emit("error",e);this[_].forEach((([t,n])=>{"on"!==t&&"once"!==t||"error"!==n[0]||n[1](e)}))},take(e){for(var t=0;to};process.nextTick(function(){r.makeRequest(e,i,t,n,s)}.bind(r))}else r.holdConnectionToIdentification(i,t,function(o,s){o?e.emitError(o):r.makeRequest(e,i,t,n,s)}.bind(r))}getClientKey(e){return`${e.protocol||this.enforceProtocol}${e.servername||e.host||e.hostname}:${e.port}`}getHttp2Client(e){return this.http2Clients[e]}setHttp2Client(e,t){const n=this,r=n.http2Clients[e];function i(){n.removeHttp2Client(e,t)}r&&n.removeHttp2Client(e,r),n.http2Clients[e]=t,t.on("close",i),t.on("goaway",i),t.on("error",i),t.on("frameError",i),t.on("timeout",i)}removeHttp2Client(e,t){try{delete this.http2Clients[e],t.closed||t.close()}catch(e){}t.removeAllListeners("close"),t.removeAllListeners("error"),t.removeAllListeners("frameError"),t.removeAllListeners("timeout")}request(e,t,n){var r=new A(arguments);return this.enforceProtocol&&(r.protocol=this.enforceProtocol),new m(r)}get(){var e=new A(arguments);e.method="GET";var t=this.request(e);return t.end(),t}hasCachedConnection(e){return!!this.getHttp2Client(e)||this.cachedHTTP1Result[e]+this.keepH1IdentificationCacheFori};if("h2"==s&&this.http2Support){var c=this.http2.connect(t,a);this.setHttp2Client(e,c)}else this.cachedHTTP1Result[e]=Date.now();n(null,a),this.emit(r,a)}.bind(this))}}makeHttpRequest(t,r,i,o,s){i instanceof e&&(i=g(i));const a=n({},i);s&&(a.createConnection=s.createConnection);const c=("https:"==a.protocol?this.https:this.http).request(a,o);r.take(c),r._on("response",(function(e){this.emit("http1.response",e)}))}makeHttp2Request(e,t,r,i,o){var s=this.http2Debouncer;s.pause(e);var a=n({},i.headers||{});i.method&&(a[":method"]=i.method),i.path&&(a[":path"]=i.path),Object.keys(a).forEach((e=>{-1!=f.indexOf((e+"").toLowerCase())&&delete a[e]})),i.headers=a;var c=r.request(a);let u;t.emit("socket",i.createConnection());let l=0;function d(n){u=parseInt(n["content-length"]),u<0&&this.http2Debouncer.unpauseAndTime(e),h.httpCompatibleResponse(c,i,n),t.emit("http1.response",c),o&&o(c)}c.on("data",(function(t){l+=t.length,l>=u&&s.unpauseAndTime(e)})),t.take(c),d.http2Safe=!0,c.once("response",d.bind(this))}static httpCompatibleResponse(e,t,n){e.httpVersion="2.0",e.rawHeaders=n,e.headers=n,e.statusCode=n[":status"],delete n[":status"]}identifyConnection(e,t){var n=this.connect(e,{allowHTTP1:!0},(function(){n.removeListener("error",t),"h2"==n.alpnProtocol?t(null,"h2"):(n.end(),t(null,"h1"))}));return n.on("error",t),n}connect(t,n,r){"function"==typeof n&&(r=n,n=void 0),i(n,"options"),n=Object.assign({},n),"string"==typeof t&&(t=new e(t)),i(t,"authority",["string","Object","URL"]);var o,a=t.protocol||n.protocol||("detect"!=this.enforceProtocol?this.enforceProtocol:null)||"http:",c=""+(""!==t.port?t.port:"http:"===t.protocol?80:443),u=t.hostname||t.host||"localhost";if("function"==typeof n.createConnection)o=n.createConnection(t,n);else switch(a){case"http:":o=this.net.connect(c,u,r);break;case"https:":o=this.tls.connect(c,u,s.call(this,n,u),r);break;default:throw new Error("Not supprted"+a)}return o}}function g(e){var t={protocol:e.protocol,hostname:e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:`${e.pathname}${e.search}`,href:e.href};return""!==e.port&&(t.port=Number(e.port)),(e.username||e.password)&&(t.auth=`${e.username}:${e.password}`),t}class A{constructor(e){if(e[0]instanceof A)return e[0];this.args=e,this.method=null,this.protocol=null}}class y extends h{constructor(){super(...arguments),this.Agent=c.Agent,this.globalAgent=c.globalAgent,this.enforceProtocol="https:"}}const v=new y;y.globalManager=v,y.Manager=y;class b extends h{constructor(){super(...arguments),this.Agent=a.Agent,this.globalAgent=a.globalAgent,this.enforceProtocol="http:"}}const C=new b;b.globalManager=C,b.Manager=b;const E=new h;return E.enforceProtocol="detect",h.globalManager=E,request={HttpRequest:b,HttpsRequest:y,HTTP2OutgoingMessage:m,ClientRequest:m,HttpRequestManager:h}}function requireHttp(){if(hasRequiredHttp)return http_1;hasRequiredHttp=1;const{HttpRequest:e,ClientRequest:t}=requireRequest(),n=e.globalManager,r=n.request.bind(n),i=n.get.bind(n),o=Object.assign({},require$$2$1);return http_1=Object.assign(o,{ClientRequest:t,globalManager:n,request:r,get:i})}function requireHttps(){if(hasRequiredHttps)return https_1;hasRequiredHttps=1;const{HttpsRequest:e,ClientRequest:t}=requireRequest(),n=e.globalManager,r=n.request.bind(n),i=n.get.bind(n),o=Object.assign({},require$$1$4);return https_1=Object.assign(o,{ClientRequest:t,globalManager:n,request:r,get:i})}function requireLib$7(){if(hasRequiredLib$7)return lib$8;hasRequiredLib$7=1;const{HttpRequestManager:e,HTTP2OutgoingMessage:t,ClientRequest:n}=requireRequest(),r=requireHttp(),i=requireHttps(),o=new e;e.globalManager=o;const s=o.request.bind(o),a=o.get.bind(o);return lib$8={HTTP2OutgoingMessage:t,ClientRequest:n,globalManager:e.globalManager,request:s,get:a,http:r,https:i}}var libExports$1=requireLib$7(),h2=getDefaultExportFromCjs(libExports$1);const BUFFER=Symbol("buffer"),TYPE=Symbol("type");let Blob$1=class e{constructor(){this[TYPE]="";const t=arguments[0],n=arguments[1],r=[];if(t){const n=t,i=Number(n.length);for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:{},r=n.size;let i=void 0===r?0:r;var o=n.timeout;let s=void 0===o?0:o;null==e?e=null:isURLSearchParams(e)?e=Buffer.from(e.toString()):e instanceof Blob$1?e=e[BUFFER]:Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof require$$0$c||(e=Buffer.from(String(e)))),this[INTERNALS]={body:e,disturbed:!1,error:null},this.size=i,this.timeout=s,e instanceof require$$0$c&&e.on("error",(function(e){const n="AbortError"===e.name?e:new FetchError(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[INTERNALS].error=n}))}function consumeBody(){var e=this;if(this[INTERNALS].disturbed)return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[INTERNALS].disturbed=!0,this[INTERNALS].error)return Body.Promise.reject(this[INTERNALS].error);if(null===this.body)return Body.Promise.resolve(Buffer.alloc(0));if(Buffer.isBuffer(this.body))return Body.Promise.resolve(this.body);if(!(this.body instanceof require$$0$c))return Body.Promise.resolve(Buffer.alloc(0));let t=[],n=0,r=!1;return new Body.Promise((function(i,o){let s;e.timeout&&(s=setTimeout((function(){r=!0,o(new FetchError(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)),e.body.on("error",(function(t){"AbortError"===t.name?(r=!0,o(t)):o(new FetchError(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))})),e.body.on("data",(function(i){if(!r&&null!==i){if(e.size&&n+i.length>e.size)return r=!0,void o(new FetchError(`content size at ${e.url} over limit: ${e.size}`,"max-size"));n+=i.length,t.push(i)}})),e.body.on("end",(function(){if(!r){clearTimeout(s);try{i(Buffer.concat(t))}catch(t){o(new FetchError(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}}))}))}function convertBody(e,t){if("function"!=typeof convert)throw new Error("The package `encoding` must be installed to use the textConverted() function");const n=t.get("content-type");let r,i,o="utf-8";return n&&(r=/charset=([^;]*)/i.exec(n)),i=e.slice(0,1024).toString(),!r&&i&&(r=/0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[MAP]=Object.create(null),t instanceof e){const e=t.raw(),n=Object.keys(e);for(const t of n)for(const n of e[t])this.append(t,n)}else if(null==t);else{if("object"!=typeof t)throw new TypeError("Provided initializer must be an object");{const e=t[Symbol.iterator];if(null!=e){if("function"!=typeof e)throw new TypeError("Header pairs must be iterable");const n=[];for(const e of t){if("object"!=typeof e||"function"!=typeof e[Symbol.iterator])throw new TypeError("Each header pair must be iterable");n.push(Array.from(e))}for(const e of n){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const e of Object.keys(t)){const n=t[e];this.append(e,n)}}}}get(e){validateName(e=`${e}`);const t=find(this[MAP],e);return void 0===t?null:this[MAP][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=getHeaders(this),r=0;for(;r1&&void 0!==arguments[1]?arguments[1]:"key+value";return Object.keys(e[MAP]).sort().map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[MAP][t].join(", ")}:function(t){return[t.toLowerCase(),e[MAP][t].join(", ")]})}Headers$1.prototype.entries=Headers$1.prototype[Symbol.iterator],Object.defineProperty(Headers$1.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(Headers$1.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const INTERNAL=Symbol("internal");function createHeadersIterator(e,t){const n=Object.create(HeadersIteratorPrototype);return n[INTERNAL]={target:e,kind:t,index:0},n}const HeadersIteratorPrototype=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==HeadersIteratorPrototype)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[INTERNAL];const t=e.target,n=e.kind,r=e.index,i=getHeaders(t,n);return r>=i.length?{value:void 0,done:!0}:(this[INTERNAL].index=r+1,{value:i[r],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function exportNodeCompatibleHeaders(e){const t=Object.assign({__proto__:null},e[MAP]),n=find(e[MAP],"Host");return void 0!==n&&(t[n]=t[n][0]),t}function createHeadersLenient(e){const t=new Headers$1;for(const n of Object.keys(e))if(!invalidTokenRegex.test(n))if(Array.isArray(e[n]))for(const r of e[n])invalidHeaderCharRegex.test(r)||(void 0===t[MAP][n]?t[MAP][n]=[r]:t[MAP][n].push(r));else invalidHeaderCharRegex.test(e[n])||(t[MAP][n]=[e[n]]);return t}Object.defineProperty(HeadersIteratorPrototype,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const INTERNALS$1=Symbol("Response internals"),STATUS_CODES=require$$2$1.STATUS_CODES;class Response{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Body.call(this,e,t);const n=t.status||200,r=new Headers$1(t.headers);if(null!=e&&!r.has("Content-Type")){const t=extractContentType(e);t&&r.append("Content-Type",t)}this[INTERNALS$1]={url:t.url,status:n,statusText:t.statusText||STATUS_CODES[n],headers:r}}get url(){return this[INTERNALS$1].url}get status(){return this[INTERNALS$1].status}get ok(){return this[INTERNALS$1].status>=200&&this[INTERNALS$1].status<300}get statusText(){return this[INTERNALS$1].statusText}get headers(){return this[INTERNALS$1].headers}clone(){return new Response(clone(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok})}}Body.mixIn(Response.prototype),Object.defineProperties(Response.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(Response.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const INTERNALS$2=Symbol("Request internals"),parse_url=require$$0$e.parse,format_url=require$$0$e.format,streamDestructionSupported="destroy"in require$$0$c.Readable.prototype;function isRequest(e){return"object"==typeof e&&"object"==typeof e[INTERNALS$2]}function isAbortSignal(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}class Request{constructor(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};isRequest(e)?t=parse_url(e.url):(t=e&&e.href?parse_url(e.href):parse_url(`${e}`),e={});let r=n.method||e.method||"GET";if(r=r.toUpperCase(),(null!=n.body||isRequest(e)&&null!==e.body)&&("GET"===r||"HEAD"===r))throw new TypeError("Request with GET/HEAD method cannot have body");let i=null!=n.body?n.body:isRequest(e)&&null!==e.body?clone(e):null;Body.call(this,i,{timeout:n.timeout||e.timeout||0,size:n.size||e.size||0});const o=new Headers$1(n.headers||e.headers||{});if(null!=i&&!o.has("Content-Type")){const e=extractContentType(i);e&&o.append("Content-Type",e)}let s=isRequest(e)?e.signal:null;if("signal"in n&&(s=n.signal),null!=s&&!isAbortSignal(s))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[INTERNALS$2]={method:r,redirect:n.redirect||e.redirect||"follow",headers:o,parsedURL:t,signal:s},this.follow=void 0!==n.follow?n.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==n.compress?n.compress:void 0===e.compress||e.compress,this.counter=n.counter||e.counter||0,this.agent=n.agent||e.agent}get method(){return this[INTERNALS$2].method}get url(){return format_url(this[INTERNALS$2].parsedURL)}get headers(){return this[INTERNALS$2].headers}get redirect(){return this[INTERNALS$2].redirect}get signal(){return this[INTERNALS$2].signal}clone(){return new Request(this)}}function getNodeRequestOptions(e){const t=e[INTERNALS$2].parsedURL,n=new Headers$1(e[INTERNALS$2].headers);if(n.has("Accept")||n.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof require$$0$c.Readable&&!streamDestructionSupported)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let r=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(r="0"),null!=e.body){const t=getTotalBytes(e);"number"==typeof t&&(r=String(t))}return r&&n.set("Content-Length",r),n.has("User-Agent")||n.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!n.has("Accept-Encoding")&&n.set("Accept-Encoding","gzip,deflate"),n.has("Connection")||e.agent||n.set("Connection","close"),Object.assign({},t,{method:e.method,headers:exportNodeCompatibleHeaders(n),agent:e.agent})}function AbortError(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}Body.mixIn(Request.prototype),Object.defineProperty(Request.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(Request.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),AbortError.prototype=Object.create(Error.prototype),AbortError.prototype.constructor=AbortError,AbortError.prototype.name="AbortError";const PassThrough$1=require$$0$c.PassThrough,resolve_url=require$$0$e.resolve;function fetch$1(e,t){if(!fetch$1.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return Body.Promise=fetch$1.Promise,new fetch$1.Promise((function(n,r){const i=new Request(e,t),o=getNodeRequestOptions(i),s=h2.request,a=i.signal;let c=null;const u=function(){let e=new AbortError("The user aborted a request.");r(e),i.body&&i.body instanceof require$$0$c.Readable&&i.body.destroy(e),c&&c.body&&c.body.emit("error",e)};if(a&&a.aborted)return void u();const l=function(){u(),f()},d=s(o);let p;function f(){d.abort(),a&&a.removeEventListener("abort",l),clearTimeout(p)}a&&a.addEventListener("abort",l),i.timeout&&d.once("socket",(function(e){p=setTimeout((function(){r(new FetchError(`network timeout at: ${i.url}`,"request-timeout")),f()}),i.timeout)})),d.on("error",(function(e){r(new FetchError(`request to ${i.url} failed, reason: ${e.message}`,"system",e)),f()})),d.on("response",(function(e){clearTimeout(p);const t=createHeadersLenient(e.headers);if(fetch$1.isRedirect(e.statusCode)){const o=t.get("Location"),s=null===o?null:resolve_url(i.url,o);switch(i.redirect){case"error":return r(new FetchError(`redirect mode is set to error: ${i.url}`,"no-redirect")),void f();case"manual":if(null!==s)try{t.set("Location",s)}catch(e){r(e)}break;case"follow":if(null===s)break;if(i.counter>=i.follow)return r(new FetchError(`maximum redirect reached at: ${i.url}`,"max-redirect")),void f();const o={headers:new Headers$1(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:i.body,signal:i.signal};return 303!==e.statusCode&&i.body&&null===getTotalBytes(i)?(r(new FetchError("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void f()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==i.method)||(o.method="GET",o.body=void 0,o.headers.delete("content-length")),n(fetch$1(new Request(s,o))),void f())}}e.once("end",(function(){a&&a.removeEventListener("abort",l)}));let o=e.pipe(new PassThrough$1);const s={url:i.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:i.size,timeout:i.timeout},u=t.get("Content-Encoding");if(!i.compress||"HEAD"===i.method||null===u||204===e.statusCode||304===e.statusCode)return c=new Response(o,s),void n(c);const d={flush:zlib.Z_SYNC_FLUSH,finishFlush:zlib.Z_SYNC_FLUSH};if("gzip"==u||"x-gzip"==u)return o=o.pipe(zlib.createGunzip(d)),c=new Response(o,s),void n(c);if("deflate"!=u&&"x-deflate"!=u)c=new Response(o,s),n(c);else{e.pipe(new PassThrough$1).once("data",(function(e){o=8==(15&e[0])?o.pipe(zlib.createInflate()):o.pipe(zlib.createInflateRaw()),c=new Response(o,s),n(c)}))}})),writeToStream(d,i)}))}fetch$1.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},fetch$1.Promise=global.Promise;var lib$7=Object.freeze({__proto__:null,FetchError:FetchError,Headers:Headers$1,Request:Request,Response:Response,default:fetch$1}),require$$4=getAugmentedNamespace(lib$7),dist$1={},parseCst={},PlainValueEc8e588e={},hasRequiredPlainValueEc8e588e,hasRequiredParseCst;function requirePlainValueEc8e588e(){if(hasRequiredPlainValueEc8e588e)return PlainValueEc8e588e;hasRequiredPlainValueEc8e588e=1;const e={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},t={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"};function n(e){const t=[0];let n=e.indexOf("\n");for(;-1!==n;)n+=1,t.push(n),n=e.indexOf("\n",n);return t}function r(e){let t,r;return"string"==typeof e?(t=n(e),r=e):(Array.isArray(e)&&(e=e[0]),e&&e.context&&(e.lineStarts||(e.lineStarts=n(e.context.src)),t=e.lineStarts,r=e.context.src)),{lineStarts:t,src:r}}function i(e,t){if("number"!=typeof e||e<0)return null;const{lineStarts:n,src:i}=r(t);if(!n||!i||e>i.length)return null;for(let t=0;t=1)||e>n.length)return null;const o=n[e-1];let s=n[e];for(;s&&s>o&&"\n"===i[s-1];)--s;return i.slice(o,s)}(e.line,n);if(!o)return null;let{col:s}=e;if(o.length>i)if(s<=i-10)o=o.substr(0,i-1)+"…";else{const e=Math.round(i/2);o.length>s+e&&(o=o.substr(0,s+e-1)+"…"),s-=o.length-i,o="…"+o.substr(1-i)}let a=1,c="";t&&(t.line===e.line&&s+(t.col-e.col)<=i+1?a=t.col-e.col:(a=Math.min(o.length+1,i)-s,c="…"));return`${o}\n${s>1?" ".repeat(s-1):""}${"^".repeat(a)}${c}`}class s{static copy(e){return new s(e.start,e.end)}constructor(e,t){this.start=e,this.end=t||e}isEmpty(){return"number"!=typeof this.start||!this.end||this.end<=this.start}setOrigRange(e,t){const{start:n,end:r}=this;if(0===e.length||r<=e[0])return this.origStart=n,this.origEnd=r,t;let i=t;for(;in);)++i;this.origStart=n+i;const o=i;for(;i=r);)++i;return this.origEnd=r+i,o}}class a{static addStringTerminator(e,t,n){if("\n"===n[n.length-1])return n;const r=a.endOfWhiteSpace(e,t);return r>=e.length||"\n"===e[r]?n+"\n":n}static atDocumentBoundary(t,n,r){const i=t[n];if(!i)return!0;const o=t[n-1];if(o&&"\n"!==o)return!1;if(r){if(i!==r)return!1}else if(i!==e.DIRECTIVES_END&&i!==e.DOCUMENT_END)return!1;const s=t[n+1],a=t[n+2];if(s!==i||a!==i)return!1;const c=t[n+3];return!c||"\n"===c||"\t"===c||" "===c}static endOfIdentifier(e,t){let n=e[t];const r="<"===n,i=r?["\n","\t"," ",">"]:["\n","\t"," ","[","]","{","}",","];for(;n&&-1===i.indexOf(n);)n=e[t+=1];return r&&">"===n&&(t+=1),t}static endOfIndent(e,t){let n=e[t];for(;" "===n;)n=e[t+=1];return t}static endOfLine(e,t){let n=e[t];for(;n&&"\n"!==n;)n=e[t+=1];return t}static endOfWhiteSpace(e,t){let n=e[t];for(;"\t"===n||" "===n;)n=e[t+=1];return t}static startOfLine(e,t){let n=e[t-1];if("\n"===n)return t;for(;n&&"\n"!==n;)n=e[t-=1];return t+1}static endOfBlockIndent(e,t,n){const r=a.endOfIndent(e,n);if(r>n+t)return r;{const t=a.endOfWhiteSpace(e,r),n=e[t];if(!n||"\n"===n)return t}return null}static atBlank(e,t,n){const r=e[t];return"\n"===r||"\t"===r||" "===r||n&&!r}static nextNodeIsIndented(e,t,n){return!(!e||t<0)&&(t>0||n&&"-"===e)}static normalizeOffset(e,t){const n=e[t];return n?"\n"!==n&&"\n"===e[t-1]?t-1:a.endOfWhiteSpace(e,t):t}static foldNewline(e,t,n){let r=0,i=!1,o="",s=e[t+1];for(;" "===s||"\t"===s||"\n"===s;){switch(s){case"\n":r=0,t+=1,o+="\n";break;case"\t":r<=n&&(i=!0),t=a.endOfWhiteSpace(e,t+2)-1;break;case" ":r+=1,t+=1}s=e[t+1]}return o||(o=" "),s&&r<=n&&(i=!0),{fold:o,offset:t,error:i}}constructor(e,t,n){Object.defineProperty(this,"context",{value:n||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=t||[],this.type=e,this.value=null}getPropValue(e,t,n){if(!this.context)return null;const{src:r}=this.context,i=this.props[e];return i&&r[i.start]===t?r.slice(i.start+(n?1:0),i.end):null}get anchor(){for(let t=0;t0?t.join("\n"):null}commentHasRequiredWhitespace(e){const{src:t}=this.context;if(this.header&&e===this.header.end)return!1;if(!this.valueRange)return!1;const{end:n}=this.valueRange;return e!==n||a.atBlank(t,n-1)}get hasComment(){if(this.context){const{src:t}=this.context;for(let n=0;nn.setOrigRange(e,t))),t}toString(){const{context:{src:e},range:t,value:n}=this;if(null!=n)return n;const r=e.slice(t.start,t.end);return a.addStringTerminator(e,t.end,r)}}class c extends Error{constructor(e,t,n){if(!(n&&t instanceof a))throw new Error(`Invalid arguments for new ${e}`);super(),this.name=e,this.message=n,this.source=t}makePretty(){if(!this.source)return;this.nodeType=this.source.type;const e=this.source.context&&this.source.context.root;if("number"==typeof this.offset){this.range=new s(this.offset,this.offset+1);const t=e&&i(this.offset,e);if(t){const e={line:t.line,col:t.col+1};this.linePos={start:t,end:e}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){const{line:t,col:n}=this.linePos.start;this.message+=` at line ${t}, column ${n}`;const r=e&&o(this.linePos,e);r&&(this.message+=`:\n\n${r}\n`)}delete this.source}}class u extends c{constructor(e,t){super("YAMLSemanticError",e,t)}}class l extends a{static endOfLine(e,t,n){let r=e[t],i=t;for(;r&&"\n"!==r&&(!n||"["!==r&&"]"!==r&&"{"!==r&&"}"!==r&&","!==r);){const t=e[i+1];if(":"===r&&(!t||"\n"===t||"\t"===t||" "===t||n&&","===t))break;if((" "===r||"\t"===r)&&"#"===t)break;i+=1,r=t}return i}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:t}=this.valueRange;const{src:n}=this.context;let r=n[t-1];for(;eo?n.slice(o,r+1):e)}else i+=e}const o=n[e];switch(o){case"\t":return{errors:[new u(this,"Plain value cannot start with a tab character")],str:i};case"@":case"`":return{errors:[new u(this,`Plain value cannot start with reserved character ${o}`)],str:i};default:return i}}parseBlockValue(e){const{indent:t,inFlow:n,src:r}=this.context;let i=e,o=e;for(let e=r[i];"\n"===e&&!a.atDocumentBoundary(r,i+1);e=r[i]){const e=a.endOfBlockIndent(r,t,i+1);if(null===e||"#"===r[e])break;"\n"===r[e]?i=e:(o=l.endOfLine(r,e,n),i=o)}return this.valueRange.isEmpty()&&(this.valueRange.start=e),this.valueRange.end=o,o}parse(e,t){this.context=e;const{inFlow:n,src:r}=e;let i=t;const o=r[i];return o&&"#"!==o&&"\n"!==o&&(i=l.endOfLine(r,t,n)),this.valueRange=new s(t,i),i=a.endOfWhiteSpace(r,i),i=this.parseComment(i),this.hasComment&&!this.valueRange.isEmpty()||(i=this.parseBlockValue(i)),i}}return PlainValueEc8e588e.Char=e,PlainValueEc8e588e.Node=a,PlainValueEc8e588e.PlainValue=l,PlainValueEc8e588e.Range=s,PlainValueEc8e588e.Type=t,PlainValueEc8e588e.YAMLError=c,PlainValueEc8e588e.YAMLReferenceError=class extends c{constructor(e,t){super("YAMLReferenceError",e,t)}},PlainValueEc8e588e.YAMLSemanticError=u,PlainValueEc8e588e.YAMLSyntaxError=class extends c{constructor(e,t){super("YAMLSyntaxError",e,t)}},PlainValueEc8e588e.YAMLWarning=class extends c{constructor(e,t){super("YAMLWarning",e,t)}},PlainValueEc8e588e._defineProperty=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},PlainValueEc8e588e.defaultTagPrefix="tag:yaml.org,2002:",PlainValueEc8e588e.defaultTags={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"},PlainValueEc8e588e}function requireParseCst(){if(hasRequiredParseCst)return parseCst;hasRequiredParseCst=1;var e=requirePlainValueEc8e588e();class t extends e.Node{constructor(){super(e.Type.BLANK_LINE)}get includesTrailingLines(){return!0}parse(t,n){return this.context=t,this.range=new e.Range(n,n+1),n+1}}class n extends e.Node{constructor(e,t){super(e,t),this.node=null}get includesTrailingLines(){return!!this.node&&this.node.includesTrailingLines}parse(n,r){this.context=n;const{parseNode:i,src:o}=n;let{atLineStart:s,lineStart:a}=n;s||this.type!==e.Type.SEQ_ITEM||(this.error=new e.YAMLSemanticError(this,"Sequence items must not have preceding content on the same line"));const c=s?r-a:n.indent;let u=e.Node.endOfWhiteSpace(o,r+1),l=o[u];const d="#"===l,p=[];let f=null;for(;"\n"===l||"#"===l;){if("#"===l){const t=e.Node.endOfLine(o,u+1);p.push(new e.Range(u,t)),u=t}else{s=!0,a=u+1;"\n"===o[e.Node.endOfWhiteSpace(o,a)]&&0===p.length&&(f=new t,a=f.parse({src:o},a)),u=e.Node.endOfIndent(o,a)}l=o[u]}if(e.Node.nextNodeIsIndented(l,u-(a+c),this.type!==e.Type.SEQ_ITEM)?this.node=i({atLineStart:s,inCollection:!1,indent:c,lineStart:a,parent:this},u):l&&a>r+1&&(u=a-1),this.node){if(f){const e=n.parent.items||n.parent.contents;e&&e.push(f)}p.length&&Array.prototype.push.apply(this.props,p),u=this.node.range.end}else if(d){const e=p[0];this.props.push(e),u=e.end}else u=e.Node.endOfLine(o,r+1);const _=this.node?this.node.valueRange.end:u;return this.valueRange=new e.Range(r,_),u}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.node?this.node.setOrigRanges(e,t):t}toString(){const{context:{src:t},node:n,range:r,value:i}=this;if(null!=i)return i;const o=n?t.slice(r.start,n.range.start)+String(n):t.slice(r.start,r.end);return e.Node.addStringTerminator(t,r.end,o)}}class r extends e.Node{constructor(){super(e.Type.COMMENT)}parse(t,n){this.context=t;const r=this.parseComment(n);return this.range=new e.Range(n,r),r}}function i(t){let r=t;for(;r instanceof n;)r=r.node;if(!(r instanceof o))return null;const i=r.items.length;let s=-1;for(let t=i-1;t>=0;--t){const n=r.items[t];if(n.type===e.Type.COMMENT){const{indent:e,lineStart:r}=n.context;if(e>0&&n.range.start>=r+e)break;s=t}else{if(n.type!==e.Type.BLANK_LINE)break;s=t}}if(-1===s)return null;const a=r.items.splice(s,i-s),c=a[0].range.start;for(;r.range.end=c,r.valueRange&&r.valueRange.end>c&&(r.valueRange.end=c),r!==t;)r=r.context.parent;return a}class o extends e.Node{static nextContentHasIndent(t,n,r){const i=e.Node.endOfLine(t,n)+1,s=t[n=e.Node.endOfWhiteSpace(t,i)];return!!s&&(n>=i+r||("#"===s||"\n"===s)&&o.nextContentHasIndent(t,n,r))}constructor(t){super(t.type===e.Type.SEQ_ITEM?e.Type.SEQ:e.Type.MAP);for(let e=t.props.length-1;e>=0;--e)if(t.props[e].start0}parse(n,s){this.context=n;const{parseNode:a,src:c}=n;let u=e.Node.startOfLine(c,s);const l=this.items[0];l.context.parent=this,this.valueRange=e.Range.copy(l.valueRange);const d=l.range.start-l.context.lineStart;let p=s;p=e.Node.normalizeOffset(c,p);let f=c[p],_=e.Node.endOfWhiteSpace(c,u)===p,m=!1;for(;f;){for(;"\n"===f||"#"===f;){if(_&&"\n"===f&&!m){const e=new t;if(p=e.parse({src:c},p),this.valueRange.end=p,p>=c.length){f=null;break}this.items.push(e),p-=1}else if("#"===f){if(p=c.length){f=null;break}}if(u=p+1,p=e.Node.endOfIndent(c,u),e.Node.atBlank(c,p)){const t=e.Node.endOfWhiteSpace(c,p),n=c[t];n&&"\n"!==n&&"#"!==n||(p=t)}f=c[p],_=!0}if(!f)break;if(p!==u+d&&(_||":"!==f)){if(ps&&(p=u);break}if(!this.error){const t="All collection items must start at the same column";this.error=new e.YAMLSyntaxError(this,t)}}if(l.type===e.Type.SEQ_ITEM){if("-"!==f){u>s&&(p=u);break}}else if("-"===f&&!this.error){const t=c[p+1];if(!t||"\n"===t||"\t"===t||" "===t){const t="A collection cannot be both a mapping and a sequence";this.error=new e.YAMLSyntaxError(this,t)}}const n=a({atLineStart:_,inCollection:!0,indent:d,lineStart:u,parent:this},p);if(!n)return p;if(this.items.push(n),this.valueRange.end=n.valueRange.end,p=e.Node.normalizeOffset(c,n.range.end),f=c[p],_=!1,m=n.includesTrailingLines,f){let e=p-1,t=c[e];for(;" "===t||"\t"===t;)t=c[--e];"\n"===t&&(u=e+1,_=!0)}const h=i(n);h&&Array.prototype.push.apply(this.items,h)}return p}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.items.forEach((n=>{t=n.setOrigRanges(e,t)})),t}toString(){const{context:{src:t},items:n,range:r,value:i}=this;if(null!=i)return i;let o=t.slice(r.start,n[0].range.start)+String(n[0]);for(let e=1;e0&&(this.contents=this.directives,this.directives=[]),u}return i[u]?(this.directivesEndMarker=new e.Range(u,u+3),u+3):(c?this.error=new e.YAMLSemanticError(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),u)}parseContents(n){const{parseNode:o,src:s}=this.context;this.contents||(this.contents=[]);let c=n;for(;"-"===s[c-1];)c-=1;let u=e.Node.endOfWhiteSpace(s,n),l=c===n;for(this.valueRange=new e.Range(u);!e.Node.atDocumentBoundary(s,u,e.Char.DOCUMENT_END);){switch(s[u]){case"\n":if(l){const e=new t;u=e.parse({src:s},u),u{t=n.setOrigRanges(e,t)})),this.directivesEndMarker&&(t=this.directivesEndMarker.setOrigRange(e,t)),this.contents.forEach((n=>{t=n.setOrigRanges(e,t)})),this.documentEndMarker&&(t=this.documentEndMarker.setOrigRange(e,t)),t}toString(){const{contents:t,directives:n,value:r}=this;if(null!=r)return r;let i=n.join("");return t.length>0&&((n.length>0||t[0].type===e.Type.COMMENT)&&(i+="---\n"),i+=t.join("")),"\n"!==i[i.length-1]&&(i+="\n"),i}}class c extends e.Node{parse(t,n){this.context=t;const{src:r}=t;let i=e.Node.endOfIdentifier(r,n+1);return this.valueRange=new e.Range(n+1,i),i=e.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i}}const u="CLIP",l="KEEP",d="STRIP";class p extends e.Node{constructor(e,t){super(e,t),this.blockIndent=null,this.chomping=u,this.header=null}get includesTrailingLines(){return this.chomping===l}get strValue(){if(!this.valueRange||!this.context)return null;let{start:t,end:n}=this.valueRange;const{indent:r,src:i}=this.context;if(this.valueRange.isEmpty())return"";let o=null,s=i[n-1];for(;"\n"===s||"\t"===s||" "===s;){if(n-=1,n<=t){if(this.chomping===l)break;return""}"\n"===s&&(o=n),s=i[n-1]}let a=n+1;o&&(this.chomping===l?(a=o,n=this.valueRange.end):n=o);const c=r+this.blockIndent,u=this.type===e.Type.BLOCK_FOLDED;let p=!0,f="",_="",m=!1;for(let r=t;ra&&(a=u);o="\n"===r[t]?t:s=e.Node.endOfLine(r,t)}return this.chomping!==l&&(o=r[s]?s+1:s),this.valueRange=new e.Range(t+1,o),o}parse(t,n){this.context=t;const{src:r}=t;let i=this.parseBlockHeader(n);return i=e.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i=this.parseBlockValue(i),i}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.header?this.header.setOrigRange(e,t):t}}class f extends e.Node{constructor(e,t){super(e,t),this.items=null}prevNodeIsJsonLike(t=this.items.length){const n=this.items[t-1];return!!n&&(n.jsonLike||n.type===e.Type.COMMENT&&this.prevNodeIsJsonLike(t-1))}parse(n,i){this.context=n;const{parseNode:o,src:s}=n;let{indent:a,lineStart:c}=n,u=s[i];this.items=[{char:u,offset:i}];let l=e.Node.endOfWhiteSpace(s,i+1);for(u=s[l];u&&"]"!==u&&"}"!==u;){switch(u){case"\n":c=l+1;if("\n"===s[e.Node.endOfWhiteSpace(s,c)]){const e=new t;c=e.parse({src:s},c),this.items.push(e)}if(l=e.Node.endOfIndent(s,c),l<=c+a&&(u=s[l],l{if(r instanceof e.Node)n=r.setOrigRanges(t,n);else if(0===t.length)r.origOffset=r.offset;else{let e=n;for(;er.offset);)++e;r.origOffset=r.offset+e,n=e}})),n}toString(){const{context:{src:t},items:n,range:r,value:i}=this;if(null!=i)return i;const o=n.filter((t=>t instanceof e.Node));let s="",a=r.start;return o.forEach((e=>{const n=t.slice(a,e.range.start);a=e.range.end,s+=n+String(e),"\n"===s[s.length-1]&&"\n"!==t[a-1]&&"\n"===t[a]&&(a+=1)})),s+=t.slice(a,r.end),e.Node.addStringTerminator(t,r.end,s)}}class _ extends e.Node{static endOfQuote(e,t){let n=e[t];for(;n&&'"'!==n;)n=e[t+="\\"===n?2:1];return t+1}get strValue(){if(!this.valueRange||!this.context)return null;const t=[],{start:n,end:r}=this.valueRange,{indent:i,src:o}=this.context;'"'!==o[r-1]&&t.push(new e.YAMLSyntaxError(this,'Missing closing "quote'));let s="";for(let a=n+1;ae?o.slice(e,a+1):n)}else s+=n}return t.length>0?{errors:t,str:s}:s}parseCharCode(t,n,r){const{src:i}=this.context,o=i.substr(t,n),s=o.length===n&&/^[0-9a-fA-F]+$/.test(o)?parseInt(o,16):NaN;return isNaN(s)?(r.push(new e.YAMLSyntaxError(this,`Invalid escape sequence ${i.substr(t-2,n+2)}`)),i.substr(t-2,n+2)):String.fromCodePoint(s)}parse(t,n){this.context=t;const{src:r}=t;let i=_.endOfQuote(r,n+1);return this.valueRange=new e.Range(n,i),i=e.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i}}class m extends e.Node{static endOfQuote(e,t){let n=e[t];for(;n;)if("'"===n){if("'"!==e[t+1])break;n=e[t+=2]}else n=e[t+=1];return t+1}get strValue(){if(!this.valueRange||!this.context)return null;const t=[],{start:n,end:r}=this.valueRange,{indent:i,src:o}=this.context;"'"!==o[r-1]&&t.push(new e.YAMLSyntaxError(this,"Missing closing 'quote"));let s="";for(let a=n+1;ae?o.slice(e,a+1):n)}else s+=n}return t.length>0?{errors:t,str:s}:s}parse(t,n){this.context=t;const{src:r}=t;let i=m.endOfQuote(r,n+1);return this.valueRange=new e.Range(n,i),i=e.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i}}class h{static parseType(t,n,r){switch(t[n]){case"*":return e.Type.ALIAS;case">":return e.Type.BLOCK_FOLDED;case"|":return e.Type.BLOCK_LITERAL;case"{":return e.Type.FLOW_MAP;case"[":return e.Type.FLOW_SEQ;case"?":return!r&&e.Node.atBlank(t,n+1,!0)?e.Type.MAP_KEY:e.Type.PLAIN;case":":return!r&&e.Node.atBlank(t,n+1,!0)?e.Type.MAP_VALUE:e.Type.PLAIN;case"-":return!r&&e.Node.atBlank(t,n+1,!0)?e.Type.SEQ_ITEM:e.Type.PLAIN;case'"':return e.Type.QUOTE_DOUBLE;case"'":return e.Type.QUOTE_SINGLE;default:return e.Type.PLAIN}}constructor(t={},{atLineStart:r,inCollection:i,inFlow:s,indent:a,lineStart:u,parent:l}={}){e._defineProperty(this,"parseNode",((t,r)=>{if(e.Node.atDocumentBoundary(this.src,r))return null;const i=new h(this,t),{props:s,type:a,valueStart:u}=i.parseProps(r),l=function(t,r){switch(t){case e.Type.ALIAS:return new c(t,r);case e.Type.BLOCK_FOLDED:case e.Type.BLOCK_LITERAL:return new p(t,r);case e.Type.FLOW_MAP:case e.Type.FLOW_SEQ:return new f(t,r);case e.Type.MAP_KEY:case e.Type.MAP_VALUE:case e.Type.SEQ_ITEM:return new n(t,r);case e.Type.COMMENT:case e.Type.PLAIN:return new e.PlainValue(t,r);case e.Type.QUOTE_DOUBLE:return new _(t,r);case e.Type.QUOTE_SINGLE:return new m(t,r);default:return null}}(a,s);let d=l.parse(i,u);if(l.range=new e.Range(r,d),d<=r&&(l.error=new Error("Node#parse consumed no characters"),l.error.parseEnd=d,l.error.source=l,l.range.end=r+1),i.nodeStartsCollection(l)){l.error||i.atLineStart||i.parent.type!==e.Type.DOCUMENT||(l.error=new e.YAMLSyntaxError(l,"Block collection must not have preceding content here (e.g. directives-end indicator)"));const t=new o(l);return d=t.parse(new h(i),d),t.range=new e.Range(r,d),t}return l})),this.atLineStart=null!=r?r:t.atLineStart||!1,this.inCollection=null!=i?i:t.inCollection||!1,this.inFlow=null!=s?s:t.inFlow||!1,this.indent=null!=a?a:t.indent,this.lineStart=null!=u?u:t.lineStart,this.parent=null!=l?l:t.parent||{},this.root=t.root,this.src=t.src}nodeStartsCollection(t){const{inCollection:r,inFlow:i,src:o}=this;if(r||i)return!1;if(t instanceof n)return!0;let s=t.range.end;return"\n"!==o[s]&&"\n"!==o[s-1]&&(s=e.Node.endOfWhiteSpace(o,s),":"===o[s])}parseProps(t){const{inFlow:n,parent:r,src:i}=this,o=[];let s=!1,a=i[t=this.atLineStart?e.Node.endOfIndent(i,t):e.Node.endOfWhiteSpace(i,t)];for(;a===e.Char.ANCHOR||a===e.Char.COMMENT||a===e.Char.TAG||"\n"===a;){if("\n"===a){let n,o=t;do{n=o+1,o=e.Node.endOfIndent(i,n)}while("\n"===i[o]);const a=o-(n+this.indent),c=r.type===e.Type.SEQ_ITEM&&r.context.atLineStart;if("#"!==i[o]&&!e.Node.nextNodeIsIndented(i[o],a,!c))break;this.atLineStart=!0,this.lineStart=n,s=!1,t=o}else if(a===e.Char.COMMENT){const n=e.Node.endOfLine(i,t+1);o.push(new e.Range(t,n)),t=n}else{let n=e.Node.endOfIdentifier(i,t+1);a===e.Char.TAG&&","===i[n]&&/^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+,\d\d\d\d(-\d\d){0,2}\/\S/.test(i.slice(t+1,n+13))&&(n=e.Node.endOfIdentifier(i,n+5)),o.push(new e.Range(t,n)),s=!0,t=e.Node.endOfWhiteSpace(i,n)}a=i[t]}s&&":"===a&&e.Node.atBlank(i,t+1,!0)&&(t-=1);return{props:o,type:h.parseType(i,t,n),valueStart:t}}}return parseCst.parse=function(e){const t=[];-1!==e.indexOf("\r")&&(e=e.replace(/\r\n?/g,((e,n)=>(e.length>1&&t.push(n),"\n"))));const n=[];let r=0;do{const t=new a,i=new h({src:e});r=t.parse(i,r),n.push(t)}while(r{if(0===t.length)return!1;for(let e=1;en.join("...\n"),n},parseCst}var Document9b4560a1={},resolveSeqD03cb037={},hasRequiredResolveSeqD03cb037;function requireResolveSeqD03cb037(){if(hasRequiredResolveSeqD03cb037)return resolveSeqD03cb037;hasRequiredResolveSeqD03cb037=1;var e=requirePlainValueEc8e588e();function t(e,t,n){return n?-1===n.indexOf("\n")?`${e} #${n}`:`${e}\n`+n.replace(/^/gm,`${t||""}#`):e}class n{}function r(e,t,n){if(Array.isArray(e))return e.map(((e,t)=>r(e,String(t),n)));if(e&&"function"==typeof e.toJSON){const r=n&&n.anchors&&n.anchors.get(e);r&&(n.onCreate=e=>{r.res=e,delete n.onCreate});const i=e.toJSON(t,n);return r&&n.onCreate&&n.onCreate(i),i}return n&&n.keep||"bigint"!=typeof e?e:Number(e)}class i extends n{constructor(e){super(),this.value=e}toJSON(e,t){return t&&t.keep?this.value:r(this.value,e,t)}toString(){return String(this.value)}}function o(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){const n=t[e];if(Number.isInteger(n)&&n>=0){const e=[];e[n]=r,r=e}else{const e={};Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!0,configurable:!0}),r=e}}return e.createNode(r,!1)}const s=e=>null==e||"object"==typeof e&&e[Symbol.iterator]().next().done;class a extends n{constructor(t){super(),e._defineProperty(this,"items",[]),this.schema=t}addIn(e,t){if(s(e))this.add(t);else{const[n,...r]=e,i=this.get(n,!0);if(i instanceof a)i.addIn(r,t);else{if(void 0!==i||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,o(this.schema,r,t))}}}deleteIn([e,...t]){if(0===t.length)return this.delete(e);const n=this.get(e,!0);if(n instanceof a)return n.deleteIn(t);throw new Error(`Expected YAML collection at ${e}. Remaining path: ${t}`)}getIn([e,...t],n){const r=this.get(e,!0);return 0===t.length?!n&&r instanceof i?r.value:r:r instanceof a?r.getIn(t,n):void 0}hasAllNullValues(){return this.items.every((e=>{if(!e||"PAIR"!==e.type)return!1;const t=e.value;return null==t||t instanceof i&&null==t.value&&!t.commentBefore&&!t.comment&&!t.tag}))}hasIn([e,...t]){if(0===t.length)return this.has(e);const n=this.get(e,!0);return n instanceof a&&n.hasIn(t)}setIn([e,...t],n){if(0===t.length)this.set(e,n);else{const r=this.get(e,!0);if(r instanceof a)r.setIn(t,n);else{if(void 0!==r||!this.schema)throw new Error(`Expected YAML collection at ${e}. Remaining path: ${t}`);this.set(e,o(this.schema,t,n))}}}toJSON(){return null}toString(n,{blockItem:r,flowChars:i,isMap:o,itemIndent:s},c,u){const{indent:l,indentStep:d,stringify:p}=n,f=this.type===e.Type.FLOW_MAP||this.type===e.Type.FLOW_SEQ||n.inFlow;f&&(s+=d);const _=o&&this.hasAllNullValues();n=Object.assign({},n,{allNullValues:_,indent:s,inFlow:f,type:null});let m=!1,h=!1;const g=this.items.reduce(((e,r,i)=>{let o;r&&(!m&&r.spaceBefore&&e.push({type:"comment",str:""}),r.commentBefore&&r.commentBefore.match(/^.*$/gm).forEach((t=>{e.push({type:"comment",str:`#${t}`})})),r.comment&&(o=r.comment),f&&(!m&&r.spaceBefore||r.commentBefore||r.comment||r.key&&(r.key.commentBefore||r.key.comment)||r.value&&(r.value.commentBefore||r.value.comment))&&(h=!0)),m=!1;let a=p(r,n,(()=>o=null),(()=>m=!0));return f&&!h&&a.includes("\n")&&(h=!0),f&&ie.str));if(h||n.reduce(((e,t)=>e+t.length+2),2)>a.maxFlowStringSingleLineLength){A=e;for(const e of n)A+=e?`\n${d}${l}${e}`:"\n";A+=`\n${l}${t}`}else A=`${e} ${n.join(" ")} ${t}`}else{const e=g.map(r);A=e.shift();for(const t of e)A+=t?`\n${l}${t}`:"\n"}return this.comment?(A+="\n"+this.comment.replace(/^/gm,`${l}#`),c&&c()):m&&u&&u(),A}}function c(e){let t=e instanceof i?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),Number.isInteger(t)&&t>=0?t:null}e._defineProperty(a,"maxFlowStringSingleLineLength",60);class u extends a{add(e){this.items.push(e)}delete(e){const t=c(e);if("number"!=typeof t)return!1;return this.items.splice(t,1).length>0}get(e,t){const n=c(e);if("number"!=typeof n)return;const r=this.items[n];return!t&&r instanceof i?r.value:r}has(e){const t=c(e);return"number"==typeof t&&t"comment"===e.type?e.str:`- ${e.str}`,flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(e.indent||"")+" "},t,n):JSON.stringify(this)}}class l extends n{constructor(e,t=null){super(),this.key=e,this.value=t,this.type=l.Type.PAIR}get commentBefore(){return this.key instanceof n?this.key.commentBefore:void 0}set commentBefore(e){if(null==this.key&&(this.key=new i(null)),!(this.key instanceof n)){throw new Error("Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.")}this.key.commentBefore=e}addToJSMap(e,t){const i=r(this.key,"",e);if(t instanceof Map){const n=r(this.value,i,e);t.set(i,n)}else if(t instanceof Set)t.add(i);else{const o=((e,t,r)=>null===t?"":"object"!=typeof t?String(t):e instanceof n&&r&&r.doc?e.toString({anchors:Object.create(null),doc:r.doc,indent:"",indentStep:r.indentStep,inFlow:!0,inStringifyKey:!0,stringify:r.stringify}):JSON.stringify(t))(this.key,i,e),s=r(this.value,o,e);o in t?Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[o]=s}return t}toJSON(e,t){const n=t&&t.mapAsMap?new Map:{};return this.addToJSMap(t,n)}toString(r,o,s){if(!r||!r.doc)return JSON.stringify(this);const{indent:c,indentSeq:l,simpleKeys:d}=r.doc.options;let{key:p,value:f}=this,_=p instanceof n&&p.comment;if(d){if(_)throw new Error("With simple keys, key nodes cannot have comments");if(p instanceof a){throw new Error("With simple keys, collection cannot be used as a key value")}}let m=!d&&(!p||_||(p instanceof n?p instanceof a||p.type===e.Type.BLOCK_FOLDED||p.type===e.Type.BLOCK_LITERAL:"object"==typeof p));const{doc:h,indent:g,indentStep:A,stringify:y}=r;r=Object.assign({},r,{implicitKey:!m,indent:g+A});let v=!1,b=y(p,r,(()=>_=null),(()=>v=!0));if(b=t(b,r.indent,_),!m&&b.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(r.allNullValues&&!d)return this.comment?(b=t(b,r.indent,this.comment),o&&o()):v&&!_&&s&&s(),r.inFlow&&!m?b:`? ${b}`;b=m?`? ${b}\n${g}:`:`${b}:`,this.comment&&(b=t(b,r.indent,this.comment),o&&o());let C="",E=null;if(f instanceof n){if(f.spaceBefore&&(C="\n"),f.commentBefore){C+=`\n${f.commentBefore.replace(/^/gm,`${r.indent}#`)}`}E=f.comment}else f&&"object"==typeof f&&(f=h.schema.createNode(f,!0));r.implicitKey=!1,!m&&!this.comment&&f instanceof i&&(r.indentAtStart=b.length+1),v=!1,!l&&c>=2&&!r.inFlow&&!m&&f instanceof u&&f.type!==e.Type.FLOW_SEQ&&!f.tag&&!h.anchors.getName(f)&&(r.indent=r.indent.substr(2));const x=y(f,r,(()=>E=null),(()=>v=!0));let S=" ";if(C||this.comment)S=`${C}\n${r.indent}`;else if(!m&&f instanceof a){("["===x[0]||"{"===x[0])&&!x.includes("\n")||(S=`\n${r.indent}`)}else"\n"===x[0]&&(S="");return v&&!E&&s&&s(),t(b+S+x,r.indent,E)}}e._defineProperty(l,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});const d=(e,t)=>{if(e instanceof p){const n=t.get(e.source);return n.count*n.aliasCount}if(e instanceof a){let n=0;for(const r of e.items){const e=d(r,t);e>n&&(n=e)}return n}if(e instanceof l){const n=d(e.key,t),r=d(e.value,t);return Math.max(n,r)}return 1};class p extends n{static stringify({range:e,source:t},{anchors:n,doc:r,implicitKey:i,inStringifyKey:o}){let s=Object.keys(n).find((e=>n[e]===t));if(!s&&o&&(s=r.anchors.getName(t)||r.anchors.newName()),s)return`*${s}${i?" ":""}`;const a=r.anchors.getName(t)?"Alias node must be after source node":"Source node not found for alias node";throw new Error(`${a} [${e}]`)}constructor(t){super(),this.source=t,this.type=e.Type.ALIAS}set tag(e){throw new Error("Alias nodes cannot have tags")}toJSON(t,n){if(!n)return r(this.source,t,n);const{anchors:i,maxAliasCount:o}=n,s=i.get(this.source);if(!s||void 0===s.res){const t="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new e.YAMLReferenceError(this.cstNode,t):new ReferenceError(t)}if(o>=0&&(s.count+=1,0===s.aliasCount&&(s.aliasCount=d(this.source,i)),s.count*s.aliasCount>o)){const t="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new e.YAMLReferenceError(this.cstNode,t):new ReferenceError(t)}return s.res}toString(e){return p.stringify(this,e)}}function f(e,t){const n=t instanceof i?t.value:t;for(const r of e)if(r instanceof l){if(r.key===t||r.key===n)return r;if(r.key&&r.key.value===n)return r}}e._defineProperty(p,"default",!0);class _ extends a{add(e,t){e?e instanceof l||(e=new l(e.key||e,e.value)):e=new l(e);const n=f(this.items,e.key),r=this.schema&&this.schema.sortMapEntries;if(n){if(!t)throw new Error(`Key ${e.key} already set`);n.value=e.value}else if(r){const t=this.items.findIndex((t=>r(e,t)<0));-1===t?this.items.push(e):this.items.splice(t,0,e)}else this.items.push(e)}delete(e){const t=f(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=f(this.items,e),r=n&&n.value;return!t&&r instanceof i?r.value:r}has(e){return!!f(this.items,e)}set(e,t){this.add(new l(e,t),!0)}toJSON(e,t,n){const r=n?new n:t&&t.mapAsMap?new Map:{};t&&t.onCreate&&t.onCreate(r);for(const e of this.items)e.addToJSMap(t,r);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(const e of this.items)if(!(e instanceof l))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return super.toString(e,{blockItem:e=>e.str,flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:e.indent||""},t,n)}}class m extends l{constructor(e){if(e instanceof l){let t=e.value;t instanceof u||(t=new u,t.items.push(e.value),t.range=e.value.range),super(e.key,t),this.range=e.range}else super(new i("<<"),new u);this.type=l.Type.MERGE_PAIR}addToJSMap(e,t){for(const{source:n}of this.value.items){if(!(n instanceof _))throw new Error("Merge sources must be maps");const r=n.toJSON(null,e,Map);for(const[e,n]of r)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}return t}toString(e,t){const n=this.value;if(n.items.length>1)return super.toString(e,t);this.value=n.items[0];const r=super.toString(e,t);return this.value=n,r}}const h={defaultType:e.Type.BLOCK_LITERAL,lineWidth:76},g={defaultType:e.Type.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function A(e,t,n){for(const{format:n,test:r,resolve:o}of t)if(r){const t=e.match(r);if(t){let e=o.apply(null,t);return e instanceof i||(e=new i(e)),n&&(e.format=n),e}}return n&&(e=n(e)),new i(e)}const y="flow",v="block",b="quoted",C=(e,t)=>{let n=e[t+1];for(;" "===n||"\t"===n;){do{n=e[t+=1]}while(n&&"\n"!==n);n=e[t+1]}return t};function E(e,t,n,{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}){if(!i||i<0)return e;const c=Math.max(1+o,1+i-t.length);if(e.length<=c)return e;const u=[],l={};let d,p,f=i-t.length;"number"==typeof r&&(r>i-Math.max(2,o)?u.push(0):f=i-r);let _=!1,m=-1,h=-1,g=-1;n===v&&(m=C(e,m),-1!==m&&(f=m+c));for(let t;t=e[m+=1];){if(n===b&&"\\"===t){switch(h=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}g=m}if("\n"===t)n===v&&(m=C(e,m)),f=m+c,d=void 0;else{if(" "===t&&p&&" "!==p&&"\n"!==p&&"\t"!==p){const t=e[m+1];t&&" "!==t&&"\n"!==t&&"\t"!==t&&(d=m)}if(m>=f)if(d)u.push(d),f=d+c,d=void 0;else if(n===b){for(;" "===p||"\t"===p;)p=t,t=e[m+=1],_=!0;const n=m>g+1?m-2:h-1;if(l[n])return e;u.push(n),l[n]=!0,f=n+c,d=void 0}else _=!0}p=t}if(_&&a&&a(),0===u.length)return e;s&&s();let A=e.slice(0,u[0]);for(let r=0;re?Object.assign({indentAtStart:e},g.fold):g.fold,S=e=>/^(%|---|\.\.\.)/m.test(e);function k(e,t){const{implicitKey:n}=t,{jsonEncoding:r,minMultiLineLength:i}=g.doubleQuoted,o=JSON.stringify(e);if(r)return o;const s=t.indent||(S(e)?" ":"");let a="",c=0;for(let e=0,t=o[e];t;t=o[++e])if(" "===t&&"\\"===o[e+1]&&"n"===o[e+2]&&(a+=o.slice(c,e)+"\\ ",e+=1,c=e,t="\\"),"\\"===t)switch(o[e+1]){case"u":{a+=o.slice(c,e);const t=o.substr(e+2,4);switch(t){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:"00"===t.substr(0,2)?a+="\\x"+t.substr(2):a+=o.substr(e,6)}e+=5,c=e+1}break;case"n":if(n||'"'===o[e+2]||o.lengthr)return!0;if(n=t+1,i-n<=r)return!1}return!0}(r,g.fold.lineWidth,a.length));let l=u?"|":">";if(!r)return l+"\n";let d="",p="";if(r=r.replace(/[\n\t ]*$/,(e=>{const t=e.indexOf("\n");return-1===t?l+="-":r!==e&&t===e.length-1||(l+="+",s&&s()),p=e.replace(/\n$/,""),""})).replace(/^[\n ]*/,(e=>{-1!==e.indexOf(" ")&&(l+=c);const t=e.match(/ +$/);return t?(d=e.slice(0,-t[0].length),t[0]):(d=e,"")})),p&&(p=p.replace(/\n+(?!\n|$)/g,`$&${a}`)),d&&(d=d.replace(/\n+/g,`$&${a}`)),t&&(l+=" #"+t.replace(/ ?[\r\n]+/g," "),o&&o()),!r)return`${l}${c}\n${a}${p}`;if(u)return r=r.replace(/\n+/g,`$&${a}`),`${l}\n${a}${d}${r}${p}`;r=r.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${a}`);const f=E(`${d}${r}${p}`,a,v,g.fold);return`${l}\n${a}${f}`}function I(t,n){let r,i,o;switch(n.type){case e.Type.FLOW_MAP:r="}",i="flow map";break;case e.Type.FLOW_SEQ:r="]",i="flow sequence";break;default:return void t.push(new e.YAMLSemanticError(n,"Not a flow collection!?"))}for(let t=n.items.length-1;t>=0;--t){const r=n.items[t];if(!r||r.type!==e.Type.COMMENT){o=r;break}}if(o&&o.char!==r){const s=`Expected ${i} to end with ${r}`;let a;"number"==typeof o.offset?(a=new e.YAMLSemanticError(n,s),a.offset=o.offset+1):(a=new e.YAMLSemanticError(o,s),o.range&&o.range.end&&(a.offset=o.range.end-o.range.start)),t.push(a)}}function T(t,n){const r=n.context.src[n.range.start-1];if("\n"!==r&&"\t"!==r&&" "!==r){const r="Comments must be separated from other tokens by white space characters";t.push(new e.YAMLSemanticError(n,r))}}function R(t,n){const r=String(n),i=r.substr(0,8)+"..."+r.substr(-8);return new e.YAMLSemanticError(t,`The "${i}" key is too long`)}function F(e,t){for(const{afterKey:n,before:r,comment:i}of t){let t=e.items[r];t?(n&&t.value&&(t=t.value),void 0===i?!n&&t.commentBefore||(t.spaceBefore=!0):t.commentBefore?t.commentBefore+="\n"+i:t.commentBefore=i):void 0!==i&&(e.comment?e.comment+="\n"+i:e.comment=i)}}function P(e,t){const n=t.strValue;return n?"string"==typeof n?n:(n.errors.forEach((n=>{n.source||(n.source=t),e.errors.push(n)})),n.str):""}function N(t,n){const{tag:r,type:i}=n;let o=!1;if(r){const{handle:i,suffix:s,verbatim:a}=r;if(a){if("!"!==a&&"!!"!==a)return a;const r=`Verbatim tags aren't resolved, so ${a} is invalid.`;t.errors.push(new e.YAMLSemanticError(n,r))}else if("!"!==i||s)try{return function(t,n){const{handle:r,suffix:i}=n.tag;let o=t.tagPrefixes.find((e=>e.handle===r));if(!o){const i=t.getDefaults().tagPrefixes;if(i&&(o=i.find((e=>e.handle===r))),!o)throw new e.YAMLSemanticError(n,`The ${r} tag handle is non-default and was not declared.`)}if(!i)throw new e.YAMLSemanticError(n,`The ${r} tag has no suffix.`);if("!"===r&&"1.0"===(t.version||t.options.version)){if("^"===i[0])return t.warnings.push(new e.YAMLWarning(n,"YAML 1.0 ^ tag expansion is not supported")),i;if(/[:/]/.test(i)){const e=i.match(/^([a-z0-9-]+)\/(.*)/i);return e?`tag:${e[1]}.yaml.org,2002:${e[2]}`:`tag:${i}`}}return o.prefix+decodeURIComponent(i)}(t,n)}catch(e){t.errors.push(e)}else o=!0}switch(i){case e.Type.BLOCK_FOLDED:case e.Type.BLOCK_LITERAL:case e.Type.QUOTE_DOUBLE:case e.Type.QUOTE_SINGLE:return e.defaultTags.STR;case e.Type.FLOW_MAP:case e.Type.MAP:return e.defaultTags.MAP;case e.Type.FLOW_SEQ:case e.Type.SEQ:return e.defaultTags.SEQ;case e.Type.PLAIN:return o?e.defaultTags.STR:null;default:return null}}function B(e,t,n){const{tags:r}=e.schema,o=[];for(const s of r)if(s.tag===n){if(!s.test){const n=s.resolve(e,t);return n instanceof a?n:new i(n)}o.push(s)}const s=P(e,t);return"string"==typeof s&&o.length>0?A(s,o,r.scalarFallback):null}function O(t,n,r){try{const e=B(t,n,r);if(e)return r&&n.tag&&(e.tag=r),e}catch(e){return e.source||(e.source=n),t.errors.push(e),null}try{const i=function({type:t}){switch(t){case e.Type.FLOW_MAP:case e.Type.MAP:return e.defaultTags.MAP;case e.Type.FLOW_SEQ:case e.Type.SEQ:return e.defaultTags.SEQ;default:return e.defaultTags.STR}}(n);if(!i)throw new Error(`The tag ${r} is unavailable`);const o=`The tag ${r} is unavailable, falling back to ${i}`;t.warnings.push(new e.YAMLWarning(n,o));const s=B(t,n,i);return s.tag=r,s}catch(r){const i=new e.YAMLReferenceError(n,r.message);return i.stack=r.stack,t.errors.push(i),null}}function q(t,n){const r={before:[],after:[]};let i=!1,o=!1;const s=(t=>{if(!t)return!1;const{type:n}=t;return n===e.Type.MAP_KEY||n===e.Type.MAP_VALUE||n===e.Type.SEQ_ITEM})(n.context.parent)?n.context.parent.props.concat(n.props):n.props;for(const{start:a,end:c}of s)switch(n.context.src[a]){case e.Char.COMMENT:{if(!n.commentHasRequiredWhitespace(a)){const r="Comments must be separated from other tokens by white space characters";t.push(new e.YAMLSemanticError(n,r))}const{header:i,valueRange:o}=n;(o&&(a>o.start||i&&a>i.start)?r.after:r.before).push(n.context.src.slice(a+1,c));break}case e.Char.ANCHOR:if(i){const r="A node can have at most one anchor";t.push(new e.YAMLSemanticError(n,r))}i=!0;break;case e.Char.TAG:if(o){const r="A node can have at most one tag";t.push(new e.YAMLSemanticError(n,r))}o=!0}return{comments:r,hasAnchor:i,hasTag:o}}function $(t,n){if(!n)return null;n.error&&t.errors.push(n.error);const{comments:r,hasAnchor:i,hasTag:o}=q(t.errors,n);if(i){const{anchors:e}=t,r=n.anchor,i=e.getNode(r);i&&(e.map[e.newName(r)]=i),e.map[r]=n}if(n.type===e.Type.ALIAS&&(i||o)){const r="An alias node must not specify any properties";t.errors.push(new e.YAMLSemanticError(n,r))}const s=function(t,n){const{anchors:r,errors:i,schema:o}=t;if(n.type===e.Type.ALIAS){const t=n.rawValue,o=r.getNode(t);if(!o){const r=`Aliased anchor not found: ${t}`;return i.push(new e.YAMLReferenceError(n,r)),null}const s=new p(o);return r._cstAliases.push(s),s}const s=N(t,n);if(s)return O(t,n,s);if(n.type!==e.Type.PLAIN){const t=`Failed to resolve ${n.type} node here`;return i.push(new e.YAMLSyntaxError(n,t)),null}try{return A(P(t,n),o.tags,o.tags.scalarFallback)}catch(e){return e.source||(e.source=n),i.push(e),null}}(t,n);if(s){s.range=[n.range.start,n.range.end],t.options.keepCstNodes&&(s.cstNode=n),t.options.keepNodeTypes&&(s.type=n.type);const e=r.before.join("\n");e&&(s.commentBefore=s.commentBefore?`${s.commentBefore}\n${e}`:e);const i=r.after.join("\n");i&&(s.comment=s.comment?`${s.comment}\n${i}`:i)}return n.resolved=s}const Q=({context:{lineStart:t,node:n,src:r},props:i})=>{if(0===i.length)return!1;const{start:o}=i[0];if(n&&o>n.valueRange.start)return!1;if(r[o]!==e.Char.COMMENT)return!1;for(let e=t;e0){r=new e.PlainValue(e.Type.PLAIN,[]),r.context={parent:c,src:c.context.src};const t=c.range.start+1;if(r.range={start:t,end:t},r.valueRange={start:t,end:t},"number"==typeof c.range.origStart){const e=c.range.origStart+1;r.range.origStart=r.range.origEnd=e,r.valueRange.origStart=r.valueRange.origEnd=e}}const a=new l(o,$(t,r));L(c,a),i.push(a),o&&"number"==typeof s&&c.range.start>s+1024&&t.errors.push(R(n,o)),o=void 0,s=null}break;default:void 0!==o&&i.push(new l(o)),o=$(t,c),s=c.range.start,c.error&&t.errors.push(c.error);e:for(let r=a+1;;++r){const i=n.items[r];switch(i&&i.type){case e.Type.BLANK_LINE:case e.Type.COMMENT:continue e;case e.Type.MAP_VALUE:break e;default:{const n="Implicit map keys need to be followed by map values";t.errors.push(new e.YAMLSemanticError(c,n));break e}}}if(c.valueRangeContainsNewline){const n="Implicit map keys need to be on a single line";t.errors.push(new e.YAMLSemanticError(c,n))}}}void 0!==o&&i.push(new l(o));return{comments:r,items:i}}(t,n),o=new _;o.items=i,F(o,r);let s=!1;for(let r=0;r{if(t instanceof p){const{type:n}=t.source;return n!==e.Type.MAP&&n!==e.Type.FLOW_MAP&&(s="Merge nodes aliases can only point to maps")}return s="Merge nodes can only have Alias nodes as values"})),s&&t.errors.push(new e.YAMLSemanticError(n,s))}else for(let s=r+1;sa+1024&&t.errors.push(R(n,o));const{src:i}=u.context;for(let n=a;ne instanceof l&&e.key instanceof a))){const r="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";t.warnings.push(new e.YAMLWarning(n,r))}return n.resolved=o,o},resolveSeqD03cb037.resolveString=P,resolveSeqD03cb037.strOptions=g,resolveSeqD03cb037.stringifyNumber=function({format:e,minFractionDigits:t,tag:n,value:r}){if("bigint"==typeof r)return String(r);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=JSON.stringify(r);if(!e&&t&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(i)){let e=i.indexOf(".");e<0&&(e=i.length,i+=".");let n=t-(i.length-e-1);for(;n-- >0;)i+="0"}return i},resolveSeqD03cb037.stringifyString=function(t,n,r,i){const{defaultType:o}=g,{implicitKey:s,inFlow:a}=n;let{type:c,value:u}=t;"string"!=typeof u&&(u=String(u),t=Object.assign({},t,{value:u}));const l=o=>{switch(o){case e.Type.BLOCK_FOLDED:case e.Type.BLOCK_LITERAL:return w(t,n,r,i);case e.Type.QUOTE_DOUBLE:return k(u,n);case e.Type.QUOTE_SINGLE:return D(u,n);case e.Type.PLAIN:return function(t,n,r,i){const{comment:o,type:s,value:a}=t,{actualString:c,implicitKey:u,indent:l,inFlow:d}=n;if(u&&/[\n[\]{},]/.test(a)||d&&/[[\]{},]/.test(a))return k(a,n);if(!a||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return u||d||-1===a.indexOf("\n")?-1!==a.indexOf('"')&&-1===a.indexOf("'")?D(a,n):k(a,n):w(t,n,r,i);if(!u&&!d&&s!==e.Type.PLAIN&&-1!==a.indexOf("\n"))return w(t,n,r,i);if(""===l&&S(a))return n.forceBlockIndent=!0,w(t,n,r,i);const p=a.replace(/\n+/g,`$&\n${l}`);if(c){const{tags:e}=n.doc.schema;if("string"!=typeof A(p,e,e.scalarFallback).value)return k(a,n)}const f=u?p:E(p,l,y,x(n));return!o||d||-1===f.indexOf("\n")&&-1===o.indexOf("\n")?f:(r&&r(),function(e,t,n){return n?`#${n.replace(/[\s\S]^/gm,`$&${t}#`)}\n${t}${e}`:e}(f,l,o))}(t,n,r,i);default:return null}};c!==e.Type.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(u)?c=e.Type.QUOTE_DOUBLE:!s&&!a||c!==e.Type.BLOCK_FOLDED&&c!==e.Type.BLOCK_LITERAL||(c=e.Type.QUOTE_DOUBLE);let d=l(c);if(null===d&&(d=l(o),null===d))throw new Error(`Unsupported default string type ${o}`);return d},resolveSeqD03cb037.toJSON=r,resolveSeqD03cb037}var Schema88e323a7={},warnings1000a372={},hasRequiredWarnings1000a372,hasRequiredSchema88e323a7,hasRequiredDocument9b4560a1,hasRequiredDist$1,yaml,hasRequiredYaml,jptr_1,hasRequiredJptr,isref,hasRequiredIsref,clone_1,hasRequiredClone,recurse_1,hasRequiredRecurse,dereference_1,hasRequiredDereference,fastSafeStringify,hasRequiredFastSafeStringify,oasKitCommon,hasRequiredOasKitCommon,oasResolver,hasRequiredOasResolver,oasSchemaWalker,hasRequiredOasSchemaWalker,statusCodes,hasRequiredStatusCodes;function requireWarnings1000a372(){if(hasRequiredWarnings1000a372)return warnings1000a372;hasRequiredWarnings1000a372=1;var e=requirePlainValueEc8e588e(),t=requireResolveSeqD03cb037();const n={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve:(n,r)=>{const i=t.resolveString(n,r);if("function"==typeof Buffer)return Buffer.from(i,"base64");if("function"==typeof atob){const e=atob(i.replace(/[\n\r]/g,"")),t=new Uint8Array(e.length);for(let n=0;n{let c;if("function"==typeof Buffer)c=i instanceof Buffer?i.toString("base64"):Buffer.from(i.buffer).toString("base64");else{if("function"!=typeof btoa)throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");{let e="";for(let t=0;t1){const t="Each pair must have its own sequence indicator";throw new e.YAMLSemanticError(r,t)}const n=o.items[0]||new t.Pair;o.commentBefore&&(n.commentBefore=n.commentBefore?`${o.commentBefore}\n${n.commentBefore}`:o.commentBefore),o.comment&&(n.comment=n.comment?`${o.comment}\n${n.comment}`:o.comment),o=n}i.items[n]=o instanceof t.Pair?o:new t.Pair(o)}}return i}function i(e,n,r){const i=new t.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";for(const t of n){let n,o;if(Array.isArray(t)){if(2!==t.length)throw new TypeError(`Expected [key, value] tuple: ${t}`);n=t[0],o=t[1]}else if(t&&t instanceof Object){const e=Object.keys(t);if(1!==e.length)throw new TypeError(`Expected { key: value } tuple: ${t}`);n=e[0],o=t[n]}else n=t;const s=e.createPair(n,o,r);i.items.push(s)}return i}const o={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:r,createNode:i};class s extends t.YAMLSeq{constructor(){super(),e._defineProperty(this,"add",t.YAMLMap.prototype.add.bind(this)),e._defineProperty(this,"delete",t.YAMLMap.prototype.delete.bind(this)),e._defineProperty(this,"get",t.YAMLMap.prototype.get.bind(this)),e._defineProperty(this,"has",t.YAMLMap.prototype.has.bind(this)),e._defineProperty(this,"set",t.YAMLMap.prototype.set.bind(this)),this.tag=s.tag}toJSON(e,n){const r=new Map;n&&n.onCreate&&n.onCreate(r);for(const e of this.items){let i,o;if(e instanceof t.Pair?(i=t.toJSON(e.key,"",n),o=t.toJSON(e.value,i,n)):i=t.toJSON(e,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}}e._defineProperty(s,"tag","tag:yaml.org,2002:omap");const a={identify:e=>e instanceof Map,nodeClass:s,default:!1,tag:"tag:yaml.org,2002:omap",resolve:function(n,i){const o=r(n,i),a=[];for(const{key:n}of o.items)if(n instanceof t.Scalar){if(a.includes(n.value)){const t="Ordered maps must not include duplicate keys";throw new e.YAMLSemanticError(i,t)}a.push(n.value)}return Object.assign(new s,o)},createNode:function(e,t,n){const r=i(e,t,n),o=new s;return o.items=r.items,o}};class c extends t.YAMLMap{constructor(){super(),this.tag=c.tag}add(e){const n=e instanceof t.Pair?e:new t.Pair(e);t.findPair(this.items,n.key)||this.items.push(n)}get(e,n){const r=t.findPair(this.items,e);return!n&&r instanceof t.Pair?r.key instanceof t.Scalar?r.key.value:r.key:r}set(e,n){if("boolean"!=typeof n)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof n);const r=t.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new t.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues())return super.toString(e,t,n);throw new Error("Set items must all have null values")}}e._defineProperty(c,"tag","tag:yaml.org,2002:set");const u={identify:e=>e instanceof Set,nodeClass:c,default:!1,tag:"tag:yaml.org,2002:set",resolve:function(n,r){const i=t.resolveMap(n,r);if(!i.hasAllNullValues())throw new e.YAMLSemanticError(r,"Set items must all have null values");return Object.assign(new c,i)},createNode:function(e,t,n){const r=new c;for(const i of t)r.items.push(e.createPair(i,null,n));return r}},l=(e,t)=>{const n=t.split(":").reduce(((e,t)=>60*e+Number(t)),0);return"-"===e?-n:n},d=({value:e})=>{if(isNaN(e)||!isFinite(e))return t.stringifyNumber(e);let n="";e<0&&(n="-",e=Math.abs(e));const r=[e%60];return e<60?r.unshift(0):(e=Math.round((e-r[0])/60),r.unshift(e%60),e>=60&&(e=Math.round((e-r[0])/60),r.unshift(e))),n+r.map((e=>e<10?"0"+String(e):String(e))).join(":").replace(/000000\d*$/,"")},p={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:(e,t,n)=>l(t,n.replace(/_/g,"")),stringify:d},f={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:(e,t,n)=>l(t,n.replace(/_/g,"")),stringify:d},_={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$"),resolve:(e,t,n,r,i,o,s,a,c)=>{a&&(a=(a+"00").substr(1,3));let u=Date.UTC(t,n-1,r,i||0,o||0,s||0,a||0);if(c&&"Z"!==c){let e=l(c[0],c.slice(1));Math.abs(e)<30&&(e*=60),u-=6e4*e}return new Date(u)},stringify:({value:e})=>e.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function m(e){const t="undefined"!=typeof process&&process.env||{};return e?"undefined"!=typeof YAML_SILENCE_DEPRECATION_WARNINGS?!YAML_SILENCE_DEPRECATION_WARNINGS:!t.YAML_SILENCE_DEPRECATION_WARNINGS:"undefined"!=typeof YAML_SILENCE_WARNINGS?!YAML_SILENCE_WARNINGS:!t.YAML_SILENCE_WARNINGS}function h(e,t){if(m(!1)){const n="undefined"!=typeof process&&process.emitWarning;n?n(e,t):console.warn(t?`${t}: ${e}`:e)}}const g={};return warnings1000a372.binary=n,warnings1000a372.floatTime=f,warnings1000a372.intTime=p,warnings1000a372.omap=a,warnings1000a372.pairs=o,warnings1000a372.set=u,warnings1000a372.timestamp=_,warnings1000a372.warn=h,warnings1000a372.warnFileDeprecation=function(e){if(m(!0)){h(`The endpoint 'yaml/${e.replace(/.*yaml[/\\]/i,"").replace(/\.js$/,"").replace(/\\/g,"/")}' will be removed in a future release.`,"DeprecationWarning")}},warnings1000a372.warnOptionDeprecation=function(e,t){if(!g[e]&&m(!0)){g[e]=!0;let n=`The option '${e}' will be removed in a future release`;n+=t?`, use '${t}' instead.`:".",h(n,"DeprecationWarning")}},warnings1000a372}function requireSchema88e323a7(){if(hasRequiredSchema88e323a7)return Schema88e323a7;hasRequiredSchema88e323a7=1;var e=requirePlainValueEc8e588e(),t=requireResolveSeqD03cb037(),n=requireWarnings1000a372();const r={createNode:function(e,n,r){const i=new t.YAMLMap(e);if(n instanceof Map)for(const[t,o]of n)i.items.push(e.createPair(t,o,r));else if(n&&"object"==typeof n)for(const t of Object.keys(n))i.items.push(e.createPair(t,n[t],r));return"function"==typeof e.sortMapEntries&&i.items.sort(e.sortMapEntries),i},default:!0,nodeClass:t.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:t.resolveMap};const i={createNode:function(e,n,r){const i=new t.YAMLSeq(e);if(n&&n[Symbol.iterator])for(const t of n){const n=e.createNode(t,r.wrapScalars,null,r);i.items.push(n)}return i},default:!0,nodeClass:t.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:t.resolveSeq},o={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:t.resolveString,stringify:(e,n,r,i)=>(n=Object.assign({actualString:!0},n),t.stringifyString(e,n,r,i)),options:t.strOptions},s=[r,i,o],a=e=>"bigint"==typeof e||Number.isInteger(e),c=(e,n,r)=>t.intOptions.asBigInt?BigInt(e):parseInt(n,r);function u(e,n,r){const{value:i}=e;return a(i)&&i>=0?r+i.toString(n):t.stringifyNumber(e)}const l={identify:e=>null==e,createNode:(e,n,r)=>r.wrapScalars?new t.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:t.nullOptions,stringify:()=>t.nullOptions.nullStr},d={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>"t"===e[0]||"T"===e[0],options:t.boolOptions,stringify:({value:e})=>e?t.boolOptions.trueStr:t.boolOptions.falseStr},p={identify:e=>a(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:(e,t)=>c(e,t,8),options:t.intOptions,stringify:e=>u(e,8,"0o")},f={identify:a,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:e=>c(e,e,10),options:t.intOptions,stringify:t.stringifyNumber},_={identify:e=>a(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:(e,t)=>c(e,t,16),options:t.intOptions,stringify:e=>u(e,16,"0x")},m={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(e,t)=>t?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:t.stringifyNumber},h={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify:({value:e})=>Number(e).toExponential()},g={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(e,n,r){const i=n||r,o=new t.Scalar(parseFloat(e));return i&&"0"===i[i.length-1]&&(o.minFractionDigits=i.length),o},stringify:t.stringifyNumber},A=s.concat([l,d,p,f,_,m,h,g]),y=e=>"bigint"==typeof e||Number.isInteger(e),v=({value:e})=>JSON.stringify(e),b=[r,i,{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:t.resolveString,stringify:v},{identify:e=>null==e,createNode:(e,n,r)=>r.wrapScalars?new t.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:v},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:e=>"true"===e,stringify:v},{identify:y,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:e=>t.intOptions.asBigInt?BigInt(e):parseInt(e,10),stringify:({value:e})=>y(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:v}];b.scalarFallback=e=>{throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(e)}`)};const C=({value:e})=>e?t.boolOptions.trueStr:t.boolOptions.falseStr,E=e=>"bigint"==typeof e||Number.isInteger(e);function x(e,n,r){let i=n.replace(/_/g,"");if(t.intOptions.asBigInt){switch(r){case 2:i=`0b${i}`;break;case 8:i=`0o${i}`;break;case 16:i=`0x${i}`}const t=BigInt(i);return"-"===e?BigInt(-1)*t:t}const o=parseInt(i,r);return"-"===e?-1*o:o}function S(e,n,r){const{value:i}=e;if(E(i)){const e=i.toString(n);return i<0?"-"+r+e.substr(1):r+e}return t.stringifyNumber(e)}const k=s.concat([{identify:e=>null==e,createNode:(e,n,r)=>r.wrapScalars?new t.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:t.nullOptions,stringify:()=>t.nullOptions.nullStr},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>!0,options:t.boolOptions,stringify:C},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>!1,options:t.boolOptions,stringify:C},{identify:E,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:(e,t,n)=>x(t,n,2),stringify:e=>S(e,2,"0b")},{identify:E,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^([-+]?)0([0-7_]+)$/,resolve:(e,t,n)=>x(t,n,8),stringify:e=>S(e,8,"0")},{identify:E,default:!0,tag:"tag:yaml.org,2002:int",test:/^([-+]?)([0-9][0-9_]*)$/,resolve:(e,t,n)=>x(t,n,10),stringify:t.stringifyNumber},{identify:E,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(e,t,n)=>x(t,n,16),stringify:e=>S(e,16,"0x")},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(e,t)=>t?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:t.stringifyNumber},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify:({value:e})=>Number(e).toExponential()},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve(e,n){const r=new t.Scalar(parseFloat(e.replace(/_/g,"")));if(n){const e=n.replace(/_/g,"");"0"===e[e.length-1]&&(r.minFractionDigits=e.length)}return r},stringify:t.stringifyNumber}],n.binary,n.omap,n.pairs,n.set,n.intTime,n.floatTime,n.timestamp),D={core:A,failsafe:s,json:b,yaml11:k},w={binary:n.binary,bool:d,float:g,floatExp:h,floatNaN:m,floatTime:n.floatTime,int:f,intHex:_,intOct:p,intTime:n.intTime,map:r,null:l,omap:n.omap,pairs:n.pairs,seq:i,set:n.set,timestamp:n.timestamp};function I(e,n,o){if(e instanceof t.Node)return e;const{defaultPrefix:s,onTagObj:a,prevObjects:c,schema:u,wrapScalars:l}=o;n&&n.startsWith("!!")&&(n=s+n.slice(2));let d=function(e,t,n){if(t){const e=n.filter((e=>e.tag===t)),r=e.find((e=>!e.format))||e[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find((t=>(t.identify&&t.identify(e)||t.class&&e instanceof t.class)&&!t.format))}(e,n,u.tags);if(!d){if("function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e)return l?new t.Scalar(e):e;d=e instanceof Map?r:e[Symbol.iterator]?i:r}a&&(a(d),delete o.onTagObj);const p={value:void 0,node:void 0};if(e&&"object"==typeof e&&c){const n=c.get(e);if(n){const e=new t.Alias(n);return o.aliasNodes.push(e),e}p.value=e,c.set(e,p)}return p.node=d.createNode?d.createNode(o.schema,e,o):l?new t.Scalar(e):e,n&&p.node instanceof t.Node&&(p.node.tag=n),p.node}const T=(e,t)=>e.keyt.key?1:0;class R{constructor({customTags:e,merge:t,schema:r,sortMapEntries:i,tags:o}){this.merge=!!t,this.name=r,this.sortMapEntries=!0===i?T:i||null,!e&&o&&n.warnOptionDeprecation("tags","customTags"),this.tags=function(e,t,n,r){let i=e[r.replace(/\W/g,"")];if(!i){const t=Object.keys(e).map((e=>JSON.stringify(e))).join(", ");throw new Error(`Unknown schema "${r}"; use one of ${t}`)}if(Array.isArray(n))for(const e of n)i=i.concat(e);else"function"==typeof n&&(i=n(i.slice()));for(let e=0;eJSON.stringify(e))).join(", ");throw new Error(`Unknown custom tag "${n}"; use one of ${e}`)}i[e]=r}}return i}(D,w,e||o,r)}createNode(e,t,n,r){const i={defaultPrefix:R.defaultPrefix,schema:this,wrapScalars:t};return I(e,n,r?Object.assign(r,i):i)}createPair(e,n,r){r||(r={wrapScalars:!0});const i=this.createNode(e,r.wrapScalars,null,r),o=this.createNode(n,r.wrapScalars,null,r);return new t.Pair(i,o)}}return e._defineProperty(R,"defaultPrefix",e.defaultTagPrefix),e._defineProperty(R,"defaultTags",e.defaultTags),Schema88e323a7.Schema=R,Schema88e323a7}function requireDocument9b4560a1(){if(hasRequiredDocument9b4560a1)return Document9b4560a1;hasRequiredDocument9b4560a1=1;var e=requirePlainValueEc8e588e(),t=requireResolveSeqD03cb037(),n=requireSchema88e323a7();const r={get binary(){return t.binaryOptions},set binary(e){Object.assign(t.binaryOptions,e)},get bool(){return t.boolOptions},set bool(e){Object.assign(t.boolOptions,e)},get int(){return t.intOptions},set int(e){Object.assign(t.intOptions,e)},get null(){return t.nullOptions},set null(e){Object.assign(t.nullOptions,e)},get str(){return t.strOptions},set str(e){Object.assign(t.strOptions,e)}},i={"1.0":{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:e.defaultTagPrefix},{handle:"!!",prefix:"tag:private.yaml.org,2002:"}]},1.1:{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:e.defaultTagPrefix}]},1.2:{schema:"core",merge:!1,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:e.defaultTagPrefix}]}};function o(e,t){if("1.0"===(e.version||e.options.version)){const e=t.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);if(e)return"!"+e[1];const n=t.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);return n?`!${n[1]}/${n[2]}`:`!${t.replace(/^tag:/,"")}`}let n=e.tagPrefixes.find((e=>0===t.indexOf(e.prefix)));if(!n){const r=e.getDefaults().tagPrefixes;n=r&&r.find((e=>0===t.indexOf(e.prefix)))}if(!n)return"!"===t[0]?t:`!<${t}>`;const r=t.substr(n.prefix.length).replace(/[!,[\]{}]/g,(e=>({"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"}[e])));return n.handle+r}function s(e,n,r,i){const{anchors:s,schema:a}=n.doc;let c;if(!(e instanceof t.Node)){const t={aliasNodes:[],onTagObj:e=>c=e,prevObjects:new Map};e=a.createNode(e,!0,null,t);for(const e of t.aliasNodes){e.source=e.source.node;let t=s.getName(e.source);t||(t=s.newName(),s.map[t]=e.source)}}if(e instanceof t.Pair)return e.toString(n,r,i);c||(c=function(e,n){if(n instanceof t.Alias)return t.Alias;if(n.tag){const t=e.filter((e=>e.tag===n.tag));if(t.length>0)return t.find((e=>e.format===n.format))||t[0]}let r,i;if(n instanceof t.Scalar){i=n.value;const t=e.filter((e=>e.identify&&e.identify(i)||e.class&&i instanceof e.class));r=t.find((e=>e.format===n.format))||t.find((e=>!e.format))}else i=n,r=e.find((e=>e.nodeClass&&i instanceof e.nodeClass));if(!r){const e=i&&i.constructor?i.constructor.name:typeof i;throw new Error(`Tag not resolved for ${e} value`)}return r}(a.tags,e));const u=function(e,t,{anchors:n,doc:r}){const i=[],s=r.anchors.getName(e);return s&&(n[s]=e,i.push(`&${s}`)),e.tag?i.push(o(r,e.tag)):t.default||i.push(o(r,t.tag)),i.join(" ")}(e,c,n);u.length>0&&(n.indentAtStart=(n.indentAtStart||0)+u.length+1);const l="function"==typeof c.stringify?c.stringify(e,n,r,i):e instanceof t.Scalar?t.stringifyString(e,n,r,i):e.toString(n,r,i);return u?e instanceof t.Scalar||"{"===l[0]||"["===l[0]?`${u} ${l}`:`${u}\n${n.indent}${l}`:l}class a{static validAnchorNode(e){return e instanceof t.Scalar||e instanceof t.YAMLSeq||e instanceof t.YAMLMap}constructor(t){e._defineProperty(this,"map",Object.create(null)),this.prefix=t}createAlias(e,n){return this.setAnchor(e,n),new t.Alias(e)}createMergePair(...e){const n=new t.Merge;return n.value.items=e.map((e=>{if(e instanceof t.Alias){if(e.source instanceof t.YAMLMap)return e}else if(e instanceof t.YAMLMap)return this.createAlias(e);throw new Error("Merge sources must be Map nodes or their Aliases")})),n}getName(e){const{map:t}=this;return Object.keys(t).find((n=>t[n]===e))}getNames(){return Object.keys(this.map)}getNode(e){return this.map[e]}newName(e){e||(e=this.prefix);const t=Object.keys(this.map);for(let n=1;;++n){const r=`${e}${n}`;if(!t.includes(r))return r}}resolveNodes(){const{map:e,_cstAliases:t}=this;Object.keys(e).forEach((t=>{e[t]=e[t].resolved})),t.forEach((e=>{e.source=e.source.resolved})),delete this._cstAliases}setAnchor(e,t){if(null!=e&&!a.validAnchorNode(e))throw new Error("Anchors may only be set for Scalar, Seq and Map nodes");if(t&&/[\x00-\x19\s,[\]{}]/.test(t))throw new Error("Anchor names must not contain whitespace or control characters");const{map:n}=this,r=e&&Object.keys(n).find((t=>n[t]===e));if(r){if(!t)return r;r!==t&&(delete n[r],n[t]=e)}else{if(!t){if(!e)return null;t=this.newName()}n[t]=e}return t}}const c=(e,n)=>{if(e&&"object"==typeof e){const{tag:r}=e;e instanceof t.Collection?(r&&(n[r]=!0),e.items.forEach((e=>c(e,n)))):e instanceof t.Pair?(c(e.key,n),c(e.value,n)):e instanceof t.Scalar&&r&&(n[r]=!0)}return n};function u({tagPrefixes:t},n){const[r,i]=n.parameters;if(!r||!i){const t="Insufficient parameters given for %TAG directive";throw new e.YAMLSemanticError(n,t)}if(t.some((e=>e.handle===r))){const t="The %TAG directive must only be given at most once per handle in the same document.";throw new e.YAMLSemanticError(n,t)}return{handle:r,prefix:i}}function l(t,n){let[r]=n.parameters;if("YAML:1.0"===n.name&&(r="1.0"),!r){const t="Insufficient parameters given for %YAML directive";throw new e.YAMLSemanticError(n,t)}if(!i[r]){const i=`Document will be parsed as YAML ${t.version||t.options.version} rather than YAML ${r}`;t.warnings.push(new e.YAMLWarning(n,i))}return r}function d(e){if(e instanceof t.Collection)return!0;throw new Error("Expected a YAML collection as document contents")}class p{constructor(e){this.anchors=new a(e.anchorPrefix),this.commentBefore=null,this.comment=null,this.contents=null,this.directivesEndMarker=null,this.errors=[],this.options=e,this.schema=null,this.tagPrefixes=[],this.version=null,this.warnings=[]}add(e){return d(this.contents),this.contents.add(e)}addIn(e,t){d(this.contents),this.contents.addIn(e,t)}delete(e){return d(this.contents),this.contents.delete(e)}deleteIn(e){return t.isEmptyPath(e)?null!=this.contents&&(this.contents=null,!0):(d(this.contents),this.contents.deleteIn(e))}getDefaults(){return p.defaults[this.version]||p.defaults[this.options.version]||{}}get(e,n){return this.contents instanceof t.Collection?this.contents.get(e,n):void 0}getIn(e,n){return t.isEmptyPath(e)?!n&&this.contents instanceof t.Scalar?this.contents.value:this.contents:this.contents instanceof t.Collection?this.contents.getIn(e,n):void 0}has(e){return this.contents instanceof t.Collection&&this.contents.has(e)}hasIn(e){return t.isEmptyPath(e)?void 0!==this.contents:this.contents instanceof t.Collection&&this.contents.hasIn(e)}set(e,t){d(this.contents),this.contents.set(e,t)}setIn(e,n){t.isEmptyPath(e)?this.contents=n:(d(this.contents),this.contents.setIn(e,n))}setSchema(e,t){if(!e&&!t&&this.schema)return;"number"==typeof e&&(e=e.toFixed(1)),"1.0"===e||"1.1"===e||"1.2"===e?(this.version?this.version=e:this.options.version=e,delete this.options.schema):e&&"string"==typeof e&&(this.options.schema=e),Array.isArray(t)&&(this.options.customTags=t);const r=Object.assign({},this.getDefaults(),this.options);this.schema=new n.Schema(r)}parse(n,r){this.options.keepCstNodes&&(this.cstNode=n),this.options.keepNodeTypes&&(this.type="DOCUMENT");const{directives:i=[],contents:o=[],directivesEndMarker:s,error:a,valueRange:c}=n;if(a&&(a.source||(a.source=this),this.errors.push(a)),function(t,n,r){const i=[];let o=!1;for(const r of n){const{comment:n,name:s}=r;switch(s){case"TAG":try{t.tagPrefixes.push(u(t,r))}catch(e){t.errors.push(e)}o=!0;break;case"YAML":case"YAML:1.0":if(t.version){const n="The %YAML directive must only be given at most once per document.";t.errors.push(new e.YAMLSemanticError(r,n))}try{t.version=l(t,r)}catch(e){t.errors.push(e)}o=!0;break;default:if(s){const n=`YAML only supports %TAG and %YAML directives, and not %${s}`;t.warnings.push(new e.YAMLWarning(r,n))}}n&&i.push(n)}if(r&&!o&&"1.1"===(t.version||r.version||t.options.version)){const e=({handle:e,prefix:t})=>({handle:e,prefix:t});t.tagPrefixes=r.tagPrefixes.map(e),t.version=r.version}t.commentBefore=i.join("\n")||null}(this,i,r),s&&(this.directivesEndMarker=!0),this.range=c?[c.start,c.end]:null,this.setSchema(),this.anchors._cstAliases=[],function(n,r){const i={before:[],after:[]};let o,s=!1;for(const a of r)if(a.valueRange){if(void 0!==o){const t="Document contains trailing content not separated by a ... or --- line";n.errors.push(new e.YAMLSyntaxError(a,t));break}const r=t.resolveNode(n,a);s&&(r.spaceBefore=!0,s=!1),o=r}else null!==a.comment?(void 0===o?i.before:i.after).push(a.comment):a.type===e.Type.BLANK_LINE&&(s=!0,void 0===o&&i.before.length>0&&!n.commentBefore&&(n.commentBefore=i.before.join("\n"),i.before=[]));if(n.contents=o||null,o){const e=i.before.join("\n");if(e){const n=o instanceof t.Collection&&o.items[0]?o.items[0]:o;n.commentBefore=n.commentBefore?`${e}\n${n.commentBefore}`:e}n.comment=i.after.join("\n")||null}else n.comment=i.before.concat(i.after).join("\n")||null}(this,o),this.anchors.resolveNodes(),this.options.prettyErrors){for(const t of this.errors)t instanceof e.YAMLError&&t.makePretty();for(const t of this.warnings)t instanceof e.YAMLError&&t.makePretty()}return this}listNonDefaultTags(){return(e=>Object.keys(c(e,{})))(this.contents).filter((e=>0!==e.indexOf(n.Schema.defaultPrefix)))}setTagPrefix(e,t){if("!"!==e[0]||"!"!==e[e.length-1])throw new Error("Handle must start and end with !");if(t){const n=this.tagPrefixes.find((t=>t.handle===e));n?n.prefix=t:this.tagPrefixes.push({handle:e,prefix:t})}else this.tagPrefixes=this.tagPrefixes.filter((t=>t.handle!==e))}toJSON(e,n){const{keepBlobsInJSON:r,mapAsMap:i,maxAliasCount:o}=this.options,a=r&&("string"!=typeof e||!(this.contents instanceof t.Scalar)),c={doc:this,indentStep:" ",keep:a,mapAsMap:a&&!!i,maxAliasCount:o,stringify:s},u=Object.keys(this.anchors.map);u.length>0&&(c.anchors=new Map(u.map((e=>[this.anchors.map[e],{alias:[],aliasCount:0,count:1}]))));const l=t.toJSON(this.contents,e,c);if("function"==typeof n&&c.anchors)for(const{count:e,res:t}of c.anchors.values())n(t,e);return l}toString(){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");const e=this.options.indent;if(!Number.isInteger(e)||e<=0){const t=JSON.stringify(e);throw new Error(`"indent" option must be a positive integer, not ${t}`)}this.setSchema();const n=[];let r=!1;if(this.version){let e="%YAML 1.2";"yaml-1.1"===this.schema.name&&("1.0"===this.version?e="%YAML:1.0":"1.1"===this.version&&(e="%YAML 1.1")),n.push(e),r=!0}const i=this.listNonDefaultTags();this.tagPrefixes.forEach((({handle:e,prefix:t})=>{i.some((e=>0===e.indexOf(t)))&&(n.push(`%TAG ${e} ${t}`),r=!0)})),(r||this.directivesEndMarker)&&n.push("---"),this.commentBefore&&(!r&&this.directivesEndMarker||n.unshift(""),n.unshift(this.commentBefore.replace(/^/gm,"#")));const o={anchors:Object.create(null),doc:this,indent:"",indentStep:" ".repeat(e),stringify:s};let a=!1,c=null;if(this.contents){this.contents instanceof t.Node&&(this.contents.spaceBefore&&(r||this.directivesEndMarker)&&n.push(""),this.contents.commentBefore&&n.push(this.contents.commentBefore.replace(/^/gm,"#")),o.forceBlockIndent=!!this.comment,c=this.contents.comment);const e=c?null:()=>a=!0,i=s(this.contents,o,(()=>c=null),e);n.push(t.addComment(i,"",c))}else void 0!==this.contents&&n.push(s(this.contents,o));return this.comment&&(a&&!c||""===n[n.length-1]||n.push(""),n.push(this.comment.replace(/^/gm,"#"))),n.join("\n")+"\n"}}return e._defineProperty(p,"defaults",i),Document9b4560a1.Document=p,Document9b4560a1.defaultOptions={anchorPrefix:"a",customTags:null,indent:2,indentSeq:!0,keepCstNodes:!1,keepNodeTypes:!0,keepBlobsInJSON:!0,mapAsMap:!1,maxAliasCount:100,prettyErrors:!1,simpleKeys:!1,version:"1.2"},Document9b4560a1.scalarOptions=r,Document9b4560a1}function requireDist$1(){if(hasRequiredDist$1)return dist$1;hasRequiredDist$1=1;var e=requireParseCst(),t=requireDocument9b4560a1(),n=requireSchema88e323a7(),r=requirePlainValueEc8e588e(),i=requireWarnings1000a372();requireResolveSeqD03cb037();class o extends t.Document{constructor(e){super(Object.assign({},t.defaultOptions,e))}}function s(t,n){const i=e.parse(t),s=new o(n).parse(i[0]);if(i.length>1){const e="Source contains multiple documents; please use YAML.parseAllDocuments()";s.errors.unshift(new r.YAMLSemanticError(i[1],e))}return s}const a={createNode:function(e,r=!0,i){void 0===i&&"string"==typeof r&&(i=r,r=!0);const o=Object.assign({},t.Document.defaults[t.defaultOptions.version],t.defaultOptions);return new n.Schema(o).createNode(e,r,i)},defaultOptions:t.defaultOptions,Document:o,parse:function(e,t){const n=s(e,t);if(n.warnings.forEach((e=>i.warn(e))),n.errors.length>0)throw n.errors[0];return n.toJSON()},parseAllDocuments:function(t,n){const r=[];let i;for(const s of e.parse(t)){const e=new o(n);e.parse(s,i),r.push(e),i=e}return r},parseCST:e.parse,parseDocument:s,scalarOptions:t.scalarOptions,stringify:function(e,t){const n=new o(t);return n.contents=e,String(n)}};return dist$1.YAML=a,dist$1}function requireYaml(){return hasRequiredYaml?yaml:(hasRequiredYaml=1,yaml=requireDist$1().YAML)}function requireJptr(){if(hasRequiredJptr)return jptr_1;function e(e){return e.replace(/\~1/g,"/").replace(/~0/g,"~")}return hasRequiredJptr=1,jptr_1={jptr:function(t,n,r){if(void 0===t)return!1;if(!n||"string"!=typeof n||"#"===n)return void 0!==r?r:t;if(n.indexOf("#")>=0){let e=n.split("#");if(e[0])return!1;n=e[1],n=decodeURIComponent(n.slice(1).split("+").join(" "))}n.startsWith("/")&&(n=n.slice(1));let i=n.split("/");for(let n=0;n0?i[n-1]:"",-1!=s||t&&t.hasOwnProperty(i[n]))if(s>=0)o&&(t[s]=r),t=t[s];else{if(-2===s)return o?(Array.isArray(t)&&t.push(r),r):void 0;o&&(t[i[n]]=r),t=t[i[n]]}else{if(void 0===r||"object"!=typeof t||Array.isArray(t))return!1;t[i[n]]=o?r:"0"===i[n+1]||"-"===i[n+1]?[]:{},t=t[i[n]]}}return t},jpescape:function(e){return e.replace(/\~/g,"~0").replace(/\//g,"~1")},jpunescape:e},jptr_1}function requireIsref(){if(hasRequiredIsref)return isref;return hasRequiredIsref=1,isref={isRef:function(e,t){return"$ref"===t&&!!e&&"string"==typeof e[t]}}}function requireClone(){if(hasRequiredClone)return clone_1;return hasRequiredClone=1,clone_1={nop:function(e){return e},clone:function(e){return JSON.parse(JSON.stringify(e))},shallowClone:function(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},deepClone:function e(t){let n=Array.isArray(t)?[]:{};for(let r in t)(t.hasOwnProperty(r)||Array.isArray(t))&&(n[r]="object"==typeof t[r]?e(t[r]):t[r]);return n},fastClone:function(e){return Object.assign({},e)},circularClone:function e(t,n){if(n||(n=new WeakMap),Object(t)!==t||t instanceof Function)return t;if(n.has(t))return n.get(t);try{var r=new t.constructor}catch(e){r=Object.create(Object.getPrototypeOf(t))}return n.set(t,r),Object.assign(r,...Object.keys(t).map((r=>({[r]:e(t[r],n)}))))}},clone_1}function requireRecurse(){if(hasRequiredRecurse)return recurse_1;hasRequiredRecurse=1;const e=requireJptr().jpescape;return recurse_1={recurse:function t(n,r,i){if(r||(r={depth:0}),r.depth||(r=Object.assign({},{path:"#",depth:0,pkey:"",parent:{},payload:{},seen:new WeakMap,identity:!1,identityDetection:!1},r)),"object"!=typeof n)return;let o=r.path;for(let s in n){if(r.key=s,r.path=r.path+"/"+encodeURIComponent(e(s)),r.identityPath=r.seen.get(n[s]),r.identity=void 0!==r.identityPath,n.hasOwnProperty(s)&&i(n,s,r),"object"==typeof n[s]&&!r.identity){r.identityDetection&&!Array.isArray(n[s])&&null!==n[s]&&r.seen.set(n[s],r.path);let e={};e.parent=n,e.path=r.path,e.depth=r.depth?r.depth+1:1,e.pkey=s,e.payload=r.payload,e.seen=r.seen,e.identity=!1,e.identityDetection=r.identityDetection,t(n[s],e,i)}r.path=o}}},recurse_1}function requireDereference(){if(hasRequiredDereference)return dereference_1;hasRequiredDereference=1;const e=requireRecurse().recurse,t=requireClone().shallowClone,n=requireJptr().jptr,r=requireIsref().isRef;return dereference_1={dereference:function i(o,s,a){a||(a={}),a.cache||(a.cache={}),a.state||(a.state={}),a.state.identityDetection=!0,a.depth=a.depth?a.depth+1:1;let c=a.depth>1?o:t(o),u={data:c},l=a.depth>1?s:t(s);a.master||(a.master=c);let d=function(e){return e&&e.verbose?{warn:function(){var e=Array.prototype.slice.call(arguments);console.warn.apply(console,e)}}:{warn:function(){}}}(a),p=1;for(;p>0;)p=0,e(u,a.state,(function(e,t,o){if(r(e,t)){let r=e[t];if(p++,a.cache[r]){let e=a.cache[r];if(e.resolved)d.warn("Patching %s for %s",r,e.path),o.parent[o.pkey]=e.data,a.$ref&&"object"==typeof o.parent[o.pkey]&&null!==o.parent[o.pkey]&&(o.parent[o.pkey][a.$ref]=r);else{if(r===e.path)throw new Error(`Tight circle at ${e.path}`);d.warn("Unresolved ref"),o.parent[o.pkey]=n(e.source,e.path),!1===o.parent[o.pkey]&&(o.parent[o.pkey]=n(e.source,e.key)),a.$ref&&"object"==typeof o.parent[o.pkey]&&null!==o.parent[o.pkey]&&(o.parent[a.$ref]=r)}}else{let e={};e.path=o.path.split("/$ref")[0],e.key=r,d.warn("Dereffing %s at %s",r,e.path),e.source=l,e.data=n(e.source,e.key),!1===e.data&&(e.data=n(a.master,e.key),e.source=a.master),!1===e.data&&d.warn("Missing $ref target",e.key),a.cache[r]=e,e.data=o.parent[o.pkey]=i(n(e.source,e.key),e.source,a),a.$ref&&"object"==typeof o.parent[o.pkey]&&null!==o.parent[o.pkey]&&(o.parent[o.pkey][a.$ref]=r),e.resolved=!0}}}));return u.data}},dereference_1}function requireFastSafeStringify(){if(hasRequiredFastSafeStringify)return fastSafeStringify;hasRequiredFastSafeStringify=1,fastSafeStringify=o,o.default=o,o.stable=u,o.stableStringify=u;var e="[...]",t="[Circular]",n=[],r=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function o(e,t,o,s){var c;void 0===s&&(s=i()),a(e,"",0,[],void 0,0,s);try{c=0===r.length?JSON.stringify(e,t,o):JSON.stringify(e,d(t),o)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var u=n.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return c}function s(e,t,i,o){var s=Object.getOwnPropertyDescriptor(o,i);void 0!==s.get?s.configurable?(Object.defineProperty(o,i,{value:e}),n.push([o,i,t,s])):r.push([t,i,e]):(o[i]=e,n.push([o,i,t]))}function a(n,r,i,o,c,u,l){var d;if(u+=1,"object"==typeof n&&null!==n){for(d=0;dl.depthLimit)return void s(e,n,r,c);if(void 0!==l.edgesLimit&&i+1>l.edgesLimit)return void s(e,n,r,c);if(o.push(n),Array.isArray(n))for(d=0;dt?1:0}function u(e,t,o,s){void 0===s&&(s=i());var a,c=l(e,"",0,[],void 0,0,s)||e;try{a=0===r.length?JSON.stringify(c,t,o):JSON.stringify(c,d(t),o)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var u=n.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return a}function l(r,i,o,a,u,d,p){var f;if(d+=1,"object"==typeof r&&null!==r){for(f=0;fp.depthLimit)return void s(e,r,i,u);if(void 0!==p.edgesLimit&&o+1>p.edgesLimit)return void s(e,r,i,u);if(a.push(r),Array.isArray(r))for(f=0;f0)for(var i=0;i1&&console.warn("Replacing with",t),m++}}else{let n=a(o(t,e[r]));if(d.verbose>1&&console.warn((!1===n?l.colour.red:l.colour.green)+"Fragment resolution",e[r],l.colour.normal),!1===n){if(i.parent[i.pkey]={},d.fatal){let t=new Error("Fragment $ref resolution failed "+e[r]);if(!d.promise)throw t;d.promise.reject(t)}}else m++,i.parent[i.pkey]=n,_[e[r]]=i.path.replace("/%24ref","")}else if(f.protocol){let t=n.resolve(c,e[r]).toString();d.verbose>1&&console.warn(l.colour.yellow+"Rewriting external url ref",e[r],"as",t,l.colour.normal),e["x-miro"]=e[r],d.externalRefs[e[r]]&&(d.externalRefs[t]||(d.externalRefs[t]=d.externalRefs[e[r]]),d.externalRefs[t].failed=d.externalRefs[e[r]].failed),e[r]=t}else if(!e["x-miro"]){let t=n.resolve(c,e[r]).toString(),i=!1;d.externalRefs[e[r]]&&(i=d.externalRefs[e[r]].failed),i||(d.verbose>1&&console.warn(l.colour.yellow+"Rewriting external ref",e[r],"as",t,l.colour.normal),e["x-miro"]=e[r],e[r]=t)}}));return s(e,{},(function(e,t,n){u(e,t)&&void 0!==e.$fixed&&delete e.$fixed})),d.verbose>1&&console.warn("Finished fragment resolution"),e}function p(e,t){if(!t.filters||!t.filters.length)return e;for(let n of t.filters)e=n(e,t);return e}function f(r,s,c,u){var l=n.parse(c.source),f=c.source.split("\\").join("/").split("/");f.pop()||f.pop();let _="",m=s.split("#");m.length>1&&(_="#"+m[1],s=m[0]),f=f.join("/");let h=n.parse(s),g=(A=h.protocol,y=l.protocol,A&&A.length>2?A:y&&y.length>2?y:"file:");var A,y;let v;if(v="file:"===g?t.resolve(f?f+"/":"",s):n.resolve(f?f+"/":"",s),c.cache[v]){c.verbose&&console.warn("CACHED",v,_);let e=a(c.cache[v]),t=c.externalRef=e;if(_&&(t=o(t,_),!1===t&&(t={},c.fatal))){let e=new Error("Cached $ref resolution failed "+v+_);if(!c.promise)throw e;c.promise.reject(e)}return t=d(t,e,s,_,v,c),t=p(t,c),u(a(t),v,c),Promise.resolve(t)}if(c.verbose&&console.warn("GET",v,_),c.handlers&&c.handlers[g])return c.handlers[g](f,s,_,c).then((function(e){return c.externalRef=e,e=p(e,c),c.cache[v]=e,u(e,v,c),e})).catch((function(e){throw c.verbose&&console.warn(e),e}));if(g&&g.startsWith("http")){const e=Object.assign({},c.fetchOptions,{agent:c.agent});return c.fetch(v,e).then((function(e){if(200!==e.status){if(c.ignoreIOErrors)return c.verbose&&console.warn("FAILED",s),c.externalRefs[s].failed=!0,'{"$ref":"'+s+'"}';throw new Error(`Received status code ${e.status}: ${v}`)}return e.text()})).then((function(e){try{let t=i.parse(e,{schema:"core",prettyErrors:!0});if(e=c.externalRef=t,c.cache[v]=a(e),_&&!1===(e=o(e,_))&&(e={},c.fatal)){let e=new Error("Remote $ref resolution failed "+v+_);if(!c.promise)throw e;c.promise.reject(e)}e=p(e=d(e,t,s,_,v,c),c)}catch(e){if(c.verbose&&console.warn(e),!c.promise||!c.fatal)throw e;c.promise.reject(e)}return u(e,v,c),e})).catch((function(e){if(c.verbose&&console.warn(e),c.cache[v]={},!c.promise||!c.fatal)throw e;c.promise.reject(e)}))}{const t='{"$ref":"'+s+'"}';return function(t,n,r,i,o){return new Promise((function(s,a){e.readFile(t,n,(function(e,t){e?r.ignoreIOErrors&&o?(r.verbose&&console.warn("FAILED",i),r.externalRefs[i].failed=!0,s(o)):a(e):s(t)}))}))}(v,c.encoding||"utf8",c,s,t).then((function(e){try{let t=i.parse(e,{schema:"core",prettyErrors:!0});if(e=c.externalRef=t,c.cache[v]=a(e),_&&!1===(e=o(e,_))&&(e={},c.fatal)){let e=new Error("File $ref resolution failed "+v+_);if(!c.promise)throw e;c.promise.reject(e)}e=p(e=d(e,t,s,_,v,c),c)}catch(e){if(c.verbose&&console.warn(e),!c.promise||!c.fatal)throw e;c.promise.reject(e)}return u(e,v,c),e})).catch((function(e){if(c.verbose&&console.warn(e),!c.promise||!c.fatal)throw e;c.promise.reject(e)}))}}function _(e){return new Promise((function(t,n){(function(e){return new Promise((function(t,n){function r(t,n,r){if(t[n]&&u(t[n],"$ref")){let o=t[n].$ref;if(!o.startsWith("#")){let s="";if(!i[o]){let t=Object.keys(i).find((function(e,t,n){return o.startsWith(e+"/")}));t&&(e.verbose&&console.warn("Found potential subschema at",t),s="/"+(o.split("#")[1]||"").replace(t.split("#")[1]||""),s=s.split("/undefined").join(""),o=t)}if(i[o]||(i[o]={resolved:!1,paths:[],extras:{},description:t[n].description}),i[o].resolved)if(i[o].failed);else if(e.rewriteRefs){let r=i[o].resolvedAt;e.verbose>1&&console.warn("Rewriting ref",o,r),t[n]["x-miro"]=o,t[n].$ref=r+s}else t[n]=a(i[o].data);else i[o].paths.push(r.path),i[o].extras[r.path]=s}}}let i=e.externalRefs;if(e.resolver.depth>0&&e.source===e.resolver.base)return t(i);s(e.openapi.definitions,{identityDetection:!0,path:"#/definitions"},r),s(e.openapi.components,{identityDetection:!0,path:"#/components"},r),s(e.openapi,{identityDetection:!0},r),t(i)}))})(e).then((function(t){for(let n in t)if(!t[n].resolved){let r=e.resolver.depth;r>0&&r++,e.resolver.actions[r].push((function(){return f(e.openapi,n,e,(function(e,r,i){if(!t[n].resolved){let o={};o.context=t[n],o.$ref=n,o.original=a(e),o.updated=e,o.source=r,i.externals.push(o),t[n].resolved=!0}let s=Object.assign({},i,{source:"",resolver:{actions:i.resolver.actions,depth:i.resolver.actions.length-1,base:i.resolver.base}});i.patch&&t[n].description&&!e.description&&"object"==typeof e&&(e.description=t[n].description),t[n].data=e;let c=(u=t[n].paths,[...new Set(u)]);var u;c=c.sort((function(e,t){const n=e.startsWith("#/components/")||e.startsWith("#/definitions/"),r=t.startsWith("#/components/")||t.startsWith("#/definitions/");return n&&!r?-1:r&&!n?1:0}));for(let r of c)if(t[n].resolvedAt&&r!==t[n].resolvedAt&&r.indexOf("x-ms-examples/")<0)i.verbose>1&&console.warn("Creating pointer to data at",r),o(i.openapi,r,{$ref:t[n].resolvedAt+t[n].extras[r],"x-miro":n+t[n].extras[r]});else{t[n].resolvedAt?i.verbose>1&&console.warn("Avoiding circular reference"):(t[n].resolvedAt=r,i.verbose>1&&console.warn("Creating initial clone of data at",r));let s=a(e);o(i.openapi,r,s)}0===i.resolver.actions[s.resolver.depth].length&&i.resolver.actions[s.resolver.depth].push((function(){return _(s)}))}))}))}})).catch((function(t){e.verbose&&console.warn(t),n(t)}));let r={options:e};r.actions=e.resolver.actions[e.resolver.depth],t(r)}))}function m(e,t,n){e.resolver.actions.push([]),_(e).then((function(r){var i;(i=r.actions,i.reduce(((e,t)=>e.then((e=>t().then(Array.prototype.concat.bind(e))))),Promise.resolve([]))).then((function(){if(e.resolver.depth>=e.resolver.actions.length)return console.warn("Ran off the end of resolver actions"),t(!0);e.resolver.depth++,e.resolver.actions[e.resolver.depth].length?setTimeout((function(){m(r.options,t,n)}),0):(e.verbose>1&&console.warn(l.colour.yellow+"Finished external resolution!",l.colour.normal),e.resolveInternal&&(e.verbose>1&&console.warn(l.colour.yellow+"Starting internal resolution!",l.colour.normal),e.openapi=c(e.openapi,e.original,{verbose:e.verbose-1}),e.verbose>1&&console.warn(l.colour.yellow+"Finished internal resolution!",l.colour.normal)),s(e.openapi,{},(function(t,n,r){u(t,n)&&(e.preserveMiro||delete t["x-miro"])})),t(e))})).catch((function(t){e.verbose&&console.warn(t),n(t)}))})).catch((function(t){e.verbose&&console.warn(t),n(t)}))}function h(e){if(e.cache||(e.cache={}),e.fetch||(e.fetch=r),e.source){let r=n.parse(e.source);(!r.protocol||r.protocol.length<=2)&&(e.source=t.resolve(e.source))}e.externals=[],e.externalRefs={},e.rewriteRefs=!0,e.resolver={},e.resolver.depth=0,e.resolver.base=e.source,e.resolver.actions=[[]]}return oasResolver={optionalResolve:function(e){return h(e),new Promise((function(t,n){e.resolve?m(e,t,n):t(e)}))},resolve:function(e,t,n){return n||(n={}),n.openapi=e,n.source=t,n.resolve=!0,h(n),new Promise((function(e,t){m(n,e,t)}))}},oasResolver}function requireOasSchemaWalker(){if(hasRequiredOasSchemaWalker)return oasSchemaWalker;function e(){return{depth:0,seen:new WeakMap,top:!0,combine:!1,allowRefSiblings:!1}}return hasRequiredOasSchemaWalker=1,oasSchemaWalker={getDefaultState:e,walkSchema:function t(n,r,i,o){if(void 0===i.depth&&(i=e()),null==n)return n;if(void 0!==n.$ref){let e={$ref:n.$ref};return i.allowRefSiblings&&n.description&&(e.description=n.description),o(e,r,i),e}if(i.combine&&(n.allOf&&Array.isArray(n.allOf)&&1===n.allOf.length&&delete(n=Object.assign({},n.allOf[0],n)).allOf,n.anyOf&&Array.isArray(n.anyOf)&&1===n.anyOf.length&&delete(n=Object.assign({},n.anyOf[0],n)).anyOf,n.oneOf&&Array.isArray(n.oneOf)&&1===n.oneOf.length&&delete(n=Object.assign({},n.oneOf[0],n)).oneOf),o(n,r,i),i.seen.has(n))return n;if("object"==typeof n&&null!==n&&i.seen.set(n,!0),i.top=!1,i.depth++,void 0!==n.items&&(i.property="items",t(n.items,n,i,o)),n.additionalItems&&"object"==typeof n.additionalItems&&(i.property="additionalItems",t(n.additionalItems,n,i,o)),n.additionalProperties&&"object"==typeof n.additionalProperties&&(i.property="additionalProperties",t(n.additionalProperties,n,i,o)),n.properties)for(let e in n.properties){let r=n.properties[e];i.property="properties/"+e,t(r,n,i,o)}if(n.patternProperties)for(let e in n.patternProperties){let r=n.patternProperties[e];i.property="patternProperties/"+e,t(r,n,i,o)}if(n.allOf)for(let e in n.allOf){let r=n.allOf[e];i.property="allOf/"+e,t(r,n,i,o)}if(n.anyOf)for(let e in n.anyOf){let r=n.anyOf[e];i.property="anyOf/"+e,t(r,n,i,o)}if(n.oneOf)for(let e in n.oneOf){let r=n.oneOf[e];i.property="oneOf/"+e,t(r,n,i,o)}return n.not&&(i.property="not",t(n.not,n,i,o)),i.depth--,n}},oasSchemaWalker}function requireStatusCodes(){if(hasRequiredStatusCodes)return statusCodes;hasRequiredStatusCodes=1;const e=require$$2$1;return statusCodes={statusCodes:Object.assign({},{default:"Default response","1XX":"Informational",103:"Early hints","2XX":"Successful","3XX":"Redirection","4XX":"Client Error","5XX":"Server Error","7XX":"Developer Error"},e.STATUS_CODES)}}var name="swagger2openapi",version="7.0.8",description="Convert Swagger 2.0 definitions to OpenApi 3.0 and validate",main$1="index.js",bin={swagger2openapi:"./swagger2openapi.js","oas-validate":"./oas-validate.js",boast:"./boast.js"},funding="https://github.com/Mermade/oas-kit?sponsor=1",scripts={test:"mocha"},browserify={transform:[["babelify",{presets:["es2015"]}]]},repository={url:"https://github.com/Mermade/oas-kit.git",type:"git"},bugs={url:"https://github.com/mermade/oas-kit/issues"},author="Mike Ralphson ",license="BSD-3-Clause",dependencies={"call-me-maybe":"^1.0.1","node-fetch":"^2.6.1","node-fetch-h2":"^2.3.0","node-readfiles":"^0.2.0","oas-kit-common":"^1.0.8","oas-resolver":"^2.5.6","oas-schema-walker":"^1.1.5","oas-validator":"^5.0.8",reftools:"^1.1.9",yaml:"^1.10.0",yargs:"^17.0.1"},keywords=["swagger","openapi","openapi2","openapi3","converter","conversion","validator","validation","resolver","lint","linter"],gitHead="b1bba3fc5007e96a991bf2a015cf0534ac36b88b",require$$14={name:name,version:version,description:description,main:main$1,bin:bin,funding:funding,scripts:scripts,browserify:browserify,repository:repository,bugs:bugs,author:author,license:license,dependencies:dependencies,keywords:keywords,gitHead:gitHead},swagger2openapi,hasRequiredSwagger2openapi;function requireSwagger2openapi(){if(hasRequiredSwagger2openapi)return swagger2openapi;hasRequiredSwagger2openapi=1;const e=require$$0$8,t=require$$0$e,n=requireMaybe(),r=require$$4,i=requireYaml(),o=requireJptr(),s=o.jptr,a=requireIsref().isRef,c=requireClone().clone,u=requireClone().circularClone,l=requireRecurse().recurse,d=requireOasResolver(),p=requireOasSchemaWalker(),f=requireOasKitCommon(),_=requireStatusCodes().statusCodes,m=require$$14.version,h="3.0.0";let g;class A extends Error{constructor(e){super(e),this.name="S2OError"}}function y(e,t){let n=new A(e);if(n.options=t,!t.promise)throw n;t.promise.reject(n)}function v(e,t,n){n.warnOnly?t[n.warnProperty||"x-s2o-warning"]=e:y(e,n)}function b(e,t){p.walkSchema(e,{},{},(function(e,n,r){!function(e){if(e["x-required"]&&Array.isArray(e["x-required"])&&(e.required||(e.required=[]),e.required=e.required.concat(e["x-required"]),delete e["x-required"]),e["x-anyOf"]&&(e.anyOf=e["x-anyOf"],delete e["x-anyOf"]),e["x-oneOf"]&&(e.oneOf=e["x-oneOf"],delete e["x-oneOf"]),e["x-not"]&&(e.not=e["x-not"],delete e["x-not"]),"boolean"==typeof e["x-nullable"]&&(e.nullable=e["x-nullable"],delete e["x-nullable"]),"object"==typeof e["x-discriminator"]&&"string"==typeof e["x-discriminator"].propertyName){e.discriminator=e["x-discriminator"],delete e["x-discriminator"];for(let t in e.discriminator.mapping){let n=e.discriminator.mapping[t];n.startsWith("#/definitions/")&&(e.discriminator.mapping[t]=n.replace("#/definitions/","#/components/schemas/"))}}}(e),function(e,t,n){if(e.nullable&&n.patches++,e.discriminator&&"string"==typeof e.discriminator&&(e.discriminator={propertyName:e.discriminator}),e.items&&Array.isArray(e.items)&&(0===e.items.length?e.items={}:1===e.items.length?e.items=e.items[0]:e.items={anyOf:e.items}),e.type&&Array.isArray(e.type))if(n.patch){if(n.patches++,0===e.type.length)delete e.type;else{e.oneOf||(e.oneOf=[]);for(let t of e.type){let n={};if("null"===t)e.nullable=!0;else{n.type=t;for(let t of f.arrayProperties)void 0!==e.prop&&(n[t]=e[t],delete e[t])}n.type&&e.oneOf.push(n)}delete e.type,0===e.oneOf.length?delete e.oneOf:e.oneOf.length<2&&(e.type=e.oneOf[0].type,Object.keys(e.oneOf[0]).length>1&&v("Lost properties from oneOf",e,n),delete e.oneOf)}e.type&&Array.isArray(e.type)&&1===e.type.length&&(e.type=e.type[0])}else y("(Patchable) schema type must not be an array",n);e.type&&"null"===e.type&&(delete e.type,e.nullable=!0),"array"!==e.type||e.items||(e.items={}),"file"===e.type&&(e.type="string",e.format="binary"),"boolean"==typeof e.required&&(e.required&&e.name&&(void 0===t.required&&(t.required=[]),Array.isArray(t.required)&&t.required.push(e.name)),delete e.required),e.xml&&"string"==typeof e.xml.namespace&&(e.xml.namespace||delete e.xml.namespace),void 0!==e.allowEmptyValue&&(n.patches++,delete e.allowEmptyValue)}(e,n,t)}))}function C(e,t,n){let r=n.payload.options;if(a(e,t)){if(e[t].startsWith("#/components/"));else if("#/consumes"===e[t])delete e[t],n.parent[n.pkey]=c(r.openapi.consumes);else if("#/produces"===e[t])delete e[t],n.parent[n.pkey]=c(r.openapi.produces);else if(e[t].startsWith("#/definitions/")){let n=e[t].replace("#/definitions/","").split("/");const i=o.jpunescape(n[0]);let s=g.schemas[decodeURIComponent(i)];s?n[0]=s:v("Could not resolve reference "+e[t],e,r),e[t]="#/components/schemas/"+n.join("/")}else if(e[t].startsWith("#/parameters/"))e[t]="#/components/parameters/"+f.sanitise(e[t].replace("#/parameters/",""));else if(e[t].startsWith("#/responses/"))e[t]="#/components/responses/"+f.sanitise(e[t].replace("#/responses/",""));else if(e[t].startsWith("#")){let n=c(o.jptr(r.openapi,e[t]));if(!1===n)v("direct $ref not found "+e[t],e,r);else if(r.refmap[e[t]])e[t]=r.refmap[e[t]];else{let i=e[t];i=i.replace("/properties/headers/",""),i=i.replace("/properties/responses/",""),i=i.replace("/properties/parameters/",""),i=i.replace("/properties/schemas/","");let s="schemas",a=i.lastIndexOf("/schema");if(s=i.indexOf("/headers/")>a?"headers":i.indexOf("/responses/")>a?"responses":i.indexOf("/example")>a?"examples":i.indexOf("/x-")>a?"extensions":i.indexOf("/parameters/")>a?"parameters":"schemas","schemas"===s&&b(n,r),"responses"!==s&&"extensions"!==s){let i=s.substr(0,s.length-1);"parameter"===i&&n.name&&n.name===f.sanitise(n.name)&&(i=encodeURIComponent(n.name));let a=1;for(e["x-miro"]&&(i=function(e){return e=e.indexOf("#")>=0?e.split("#")[1].split("/").pop():e.split("/").pop().split(".")[0],encodeURIComponent(f.sanitise(e))}(e["x-miro"]),a="");o.jptr(r.openapi,"#/components/"+s+"/"+i+a);)a=""===a?2:++a;let c="#/components/"+s+"/"+i+a,u="";"examples"===s&&(n={value:n},u="/value"),o.jptr(r.openapi,c,n),r.refmap[e[t]]=c+u,e[t]=c+u}}}if(delete e["x-miro"],Object.keys(e).length>1){const i=e[t],o=n.path.indexOf("/schema")>=0;"preserve"===r.refSiblings||(o&&"allOf"===r.refSiblings?(delete e.$ref,n.parent[n.pkey]={allOf:[{$ref:i},e]}):n.parent[n.pkey]={$ref:i})}}if("x-ms-odata"===t&&"string"==typeof e[t]&&e[t].startsWith("#/")){let n=e[t].replace("#/definitions/","").replace("#/components/schemas/","").split("/"),i=g.schemas[decodeURIComponent(n[0])];i?n[0]=i:v("Could not resolve reference "+e[t],e,r),e[t]="#/components/schemas/"+n.join("/")}}function E(e){for(let t in e)for(let n in e[t]){let r=f.sanitise(n);n!==r&&(e[t][r]=e[t][n],delete e[t][n])}}function x(e,t){if("basic"===e.type&&(e.type="http",e.scheme="basic"),"oauth2"===e.type){let n={},r=e.flow;"application"===e.flow&&(r="clientCredentials"),"accessCode"===e.flow&&(r="authorizationCode"),void 0!==e.authorizationUrl&&(n.authorizationUrl=e.authorizationUrl.split("?")[0].trim()||"/"),"string"==typeof e.tokenUrl&&(n.tokenUrl=e.tokenUrl.split("?")[0].trim()||"/"),n.scopes=e.scopes||{},e.flows={},e.flows[r]=n,delete e.flow,delete e.authorizationUrl,delete e.tokenUrl,delete e.scopes,void 0!==e.name&&(t.patch?(t.patches++,delete e.name):y("(Patchable) oauth2 securitySchemes should not have name property",t))}}function S(e){return e&&!e["x-s2o-delete"]}function k(e,t){if(e.$ref)e.$ref=e.$ref.replace("#/responses/","#/components/responses/");else{e.type&&!e.schema&&(e.schema={}),e.type&&(e.schema.type=e.type),e.items&&"array"!==e.items.type&&(e.items.collectionFormat!==e.collectionFormat&&v("Nested collectionFormats are not supported",e,t),delete e.items.collectionFormat),"array"===e.type?("ssv"===e.collectionFormat?v("collectionFormat:ssv is no longer supported for headers",e,t):"pipes"===e.collectionFormat?v("collectionFormat:pipes is no longer supported for headers",e,t):"multi"===e.collectionFormat?e.explode=!0:"tsv"===e.collectionFormat?(v("collectionFormat:tsv is no longer supported",e,t),e["x-collectionFormat"]="tsv"):e.style="simple",delete e.collectionFormat):e.collectionFormat&&(t.patch?(t.patches++,delete e.collectionFormat):y("(Patchable) collectionFormat is only applicable to header.type array",t)),delete e.type;for(let t of f.parameterTypeProperties)void 0!==e[t]&&(e.schema[t]=e[t],delete e[t]);for(let t of f.arrayProperties)void 0!==e[t]&&(e.schema[t]=e[t],delete e[t])}}function D(e,t){if(e.$ref.indexOf("#/parameters/")>=0){let t=e.$ref.split("#/parameters/");e.$ref=t[0]+"#/components/parameters/"+f.sanitise(t[1])}e.$ref.indexOf("#/definitions/")>=0&&v("Definition used as parameter",e,t)}function w(e,t,n,r,i,o,a){let u,d={},p=!0;if(t&&t.consumes&&"string"==typeof t.consumes){if(!a.patch)return y("(Patchable) operation.consumes must be an array",a);a.patches++,t.consumes=[t.consumes]}Array.isArray(o.consumes)||delete o.consumes;let _=((t?t.consumes:null)||o.consumes||[]).filter(f.uniqueOnly);if(e&&e.$ref&&"string"==typeof e.$ref){D(e,a);let t=decodeURIComponent(e.$ref.replace("#/components/parameters/","")),n=!1,r=o.components.parameters[t];if(r&&!r["x-s2o-delete"]||!e.$ref.startsWith("#/")||(e["x-s2o-delete"]=!0,n=!0),n){let t=e.$ref,n=s(o,e.$ref);!n&&t.startsWith("#/")?v("Could not resolve reference "+t,e,a):n&&(e=n)}}if(e&&(e.name||e.in)){"boolean"==typeof e["x-deprecated"]&&(e.deprecated=e["x-deprecated"],delete e["x-deprecated"]),void 0!==e["x-example"]&&(e.example=e["x-example"],delete e["x-example"]),"body"===e.in||e.type||(a.patch?(a.patches++,e.type="string"):y("(Patchable) parameter.type is mandatory for non-body parameters",a)),e.type&&"object"==typeof e.type&&e.type.$ref&&(e.type=s(o,e.type.$ref)),"file"===e.type&&(e["x-s2o-originalType"]=e.type,u=e.type),e.description&&"object"==typeof e.description&&e.description.$ref&&(e.description=s(o,e.description.$ref)),null===e.description&&delete e.description;let t=e.collectionFormat;if("array"!==e.type||t||(t="csv"),t&&("array"!==e.type&&(a.patch?(a.patches++,delete e.collectionFormat):y("(Patchable) collectionFormat is only applicable to param.type array",a)),"csv"!==t||"query"!==e.in&&"cookie"!==e.in||(e.style="form",e.explode=!1),"csv"!==t||"path"!==e.in&&"header"!==e.in||(e.style="simple"),"ssv"===t&&("query"===e.in?e.style="spaceDelimited":v("collectionFormat:ssv is no longer supported except for in:query parameters",e,a)),"pipes"===t&&("query"===e.in?e.style="pipeDelimited":v("collectionFormat:pipes is no longer supported except for in:query parameters",e,a)),"multi"===t&&(e.explode=!0),"tsv"===t&&(v("collectionFormat:tsv is no longer supported",e,a),e["x-collectionFormat"]="tsv"),delete e.collectionFormat),e.type&&"body"!==e.type&&"formData"!==e.in)if(e.items&&e.schema)v("parameter has array,items and schema",e,a);else{e.schema&&a.patches++,e.schema&&"object"==typeof e.schema||(e.schema={}),e.schema.type=e.type,e.items&&(e.schema.items=e.items,delete e.items,l(e.schema.items,null,(function(n,r,i){"collectionFormat"===r&&"string"==typeof n[r]&&(t&&n[r]!==t&&v("Nested collectionFormats are not supported",e,a),delete n[r])})));for(let t of f.parameterTypeProperties)void 0!==e[t]&&(e.schema[t]=e[t]),delete e[t]}e.schema&&b(e.schema,a),e["x-ms-skip-url-encoding"]&&"query"===e.in&&(e.allowReserved=!0,delete e["x-ms-skip-url-encoding"])}if(e&&"formData"===e.in){p=!1,d.content={};let t="application/x-www-form-urlencoded";if(_.length&&_.indexOf("multipart/form-data")>=0&&(t="multipart/form-data"),d.content[t]={},e.schema)d.content[t].schema=e.schema,e.schema.$ref&&(d["x-s2o-name"]=decodeURIComponent(e.schema.$ref.replace("#/components/schemas/","")));else{d.content[t].schema={},d.content[t].schema.type="object",d.content[t].schema.properties={},d.content[t].schema.properties[e.name]={};let n=d.content[t].schema,r=d.content[t].schema.properties[e.name];e.description&&(r.description=e.description),e.example&&(r.example=e.example),e.type&&(r.type=e.type);for(let t of f.parameterTypeProperties)void 0!==e[t]&&(r[t]=e[t]);!0===e.required&&(n.required||(n.required=[]),n.required.push(e.name),d.required=!0),void 0!==e.default&&(r.default=e.default),r.properties&&(r.properties=e.properties),e.allOf&&(r.allOf=e.allOf),"array"===e.type&&e.items&&(r.items=e.items,r.items.collectionFormat&&delete r.items.collectionFormat),"file"!==u&&"file"!==e["x-s2o-originalType"]||(r.type="string",r.format="binary"),I(e,r)}}else e&&"file"===e.type&&(e.required&&(d.required=e.required),d.content={},d.content["application/octet-stream"]={},d.content["application/octet-stream"].schema={},d.content["application/octet-stream"].schema.type="string",d.content["application/octet-stream"].schema.format="binary",I(e,d));if(e&&"body"===e.in){d.content={},e.name&&(d["x-s2o-name"]=(t&&t.operationId?f.sanitiseAll(t.operationId):"")+("_"+e.name).toCamelCase()),e.description&&(d.description=e.description),e.required&&(d.required=e.required),t&&a.rbname&&e.name&&(t[a.rbname]=e.name),e.schema&&e.schema.$ref?d["x-s2o-name"]=decodeURIComponent(e.schema.$ref.replace("#/components/schemas/","")):e.schema&&"array"===e.schema.type&&e.schema.items&&e.schema.items.$ref&&(d["x-s2o-name"]=decodeURIComponent(e.schema.items.$ref.replace("#/components/schemas/",""))+"Array"),_.length||_.push("application/json");for(let t of _)d.content[t]={},d.content[t].schema=c(e.schema||{}),b(d.content[t].schema,a);I(e,d)}if(Object.keys(d).length>0&&(e["x-s2o-delete"]=!0,t))if(t.requestBody&&p){t.requestBody["x-s2o-overloaded"]=!0,v("Operation "+(t.operationId||i)+" has multiple requestBodies",t,a)}else t.requestBody||(t=n[r]=function(e,t){let n={};for(let r of Object.keys(e))n[r]=e[r],"parameters"===r&&(n.requestBody={},t.rbname&&(n[t.rbname]=""));return n.requestBody={},n}(t,a)),t.requestBody.content&&t.requestBody.content["multipart/form-data"]&&t.requestBody.content["multipart/form-data"].schema&&t.requestBody.content["multipart/form-data"].schema.properties&&d.content["multipart/form-data"]&&d.content["multipart/form-data"].schema&&d.content["multipart/form-data"].schema.properties?(t.requestBody.content["multipart/form-data"].schema.properties=Object.assign(t.requestBody.content["multipart/form-data"].schema.properties,d.content["multipart/form-data"].schema.properties),t.requestBody.content["multipart/form-data"].schema.required=(t.requestBody.content["multipart/form-data"].schema.required||[]).concat(d.content["multipart/form-data"].schema.required||[]),t.requestBody.content["multipart/form-data"].schema.required.length||delete t.requestBody.content["multipart/form-data"].schema.required):t.requestBody.content&&t.requestBody.content["application/x-www-form-urlencoded"]&&t.requestBody.content["application/x-www-form-urlencoded"].schema&&t.requestBody.content["application/x-www-form-urlencoded"].schema.properties&&d.content["application/x-www-form-urlencoded"]&&d.content["application/x-www-form-urlencoded"].schema&&d.content["application/x-www-form-urlencoded"].schema.properties?(t.requestBody.content["application/x-www-form-urlencoded"].schema.properties=Object.assign(t.requestBody.content["application/x-www-form-urlencoded"].schema.properties,d.content["application/x-www-form-urlencoded"].schema.properties),t.requestBody.content["application/x-www-form-urlencoded"].schema.required=(t.requestBody.content["application/x-www-form-urlencoded"].schema.required||[]).concat(d.content["application/x-www-form-urlencoded"].schema.required||[]),t.requestBody.content["application/x-www-form-urlencoded"].schema.required.length||delete t.requestBody.content["application/x-www-form-urlencoded"].schema.required):(t.requestBody=Object.assign(t.requestBody,d),t.requestBody["x-s2o-name"]||(t.requestBody.schema&&t.requestBody.schema.$ref?t.requestBody["x-s2o-name"]=decodeURIComponent(t.requestBody.schema.$ref.replace("#/components/schemas/","")).split("/").join(""):t.operationId&&(t.requestBody["x-s2o-name"]=f.sanitiseAll(t.operationId))));if(e&&!e["x-s2o-delete"]){delete e.type;for(let t of f.parameterTypeProperties)delete e[t];"path"!==e.in||void 0!==e.required&&!0===e.required||(a.patch?(a.patches++,e.required=!0):y("(Patchable) path parameters must be required:true ["+e.name+" in "+i+"]",a))}return t}function I(e,t){for(let n in e)n.startsWith("x-")&&!n.startsWith("x-s2o")&&(t[n]=e[n])}function T(e,t,n,r,i){if(!e)return!1;if(e.$ref&&"string"==typeof e.$ref)e.$ref.indexOf("#/definitions/")>=0?v("definition used as response: "+e.$ref,e,i):e.$ref.startsWith("#/responses/")&&(e.$ref="#/components/responses/"+f.sanitise(decodeURIComponent(e.$ref.replace("#/responses/",""))));else{if((void 0===e.description||null===e.description||""===e.description&&i.patch)&&(i.patch?"object"!=typeof e||Array.isArray(e)||(i.patches++,e.description=_[e]||""):y("(Patchable) response.description is mandatory",i)),void 0!==e.schema){if(b(e.schema,i),e.schema.$ref&&"string"==typeof e.schema.$ref&&e.schema.$ref.startsWith("#/responses/")&&(e.schema.$ref="#/components/responses/"+f.sanitise(decodeURIComponent(e.schema.$ref.replace("#/responses/","")))),n&&n.produces&&"string"==typeof n.produces){if(!i.patch)return y("(Patchable) operation.produces must be an array",i);i.patches++,n.produces=[n.produces]}r.produces&&!Array.isArray(r.produces)&&delete r.produces;let t=((n?n.produces:null)||r.produces||[]).filter(f.uniqueOnly);t.length||t.push("*/*"),e.content={};for(let n of t){if(e.content[n]={},e.content[n].schema=c(e.schema),e.examples&&e.examples[n]){let t={};t.value=e.examples[n],e.content[n].examples={},e.content[n].examples.response=t,delete e.examples[n]}"file"===e.content[n].schema.type&&(e.content[n].schema={type:"string",format:"binary"})}delete e.schema}for(let t in e.examples)e.content||(e.content={}),e.content[t]||(e.content[t]={}),e.content[t].examples={},e.content[t].examples.response={},e.content[t].examples.response.value=e.examples[t];if(delete e.examples,e.headers)for(let t in e.headers)"status code"===t.toLowerCase()?i.patch?(i.patches++,delete e.headers[t]):y('(Patchable) "Status Code" is not a valid header',i):k(e.headers[t],i)}}function R(e,n,r,i,a){for(let u in e){let l=e[u];l&&l["x-trace"]&&"object"==typeof l["x-trace"]&&(l.trace=l["x-trace"],delete l["x-trace"]),l&&l["x-summary"]&&"string"==typeof l["x-summary"]&&(l.summary=l["x-summary"],delete l["x-summary"]),l&&l["x-description"]&&"string"==typeof l["x-description"]&&(l.description=l["x-description"],delete l["x-description"]),l&&l["x-servers"]&&Array.isArray(l["x-servers"])&&(l.servers=l["x-servers"],delete l["x-servers"]);for(let e in l)if(f.httpMethods.indexOf(e)>=0||"x-amazon-apigateway-any-method"===e){let d=l[e];if(d&&d.parameters&&Array.isArray(d.parameters)){if(l.parameters)for(let t of l.parameters){"string"==typeof t.$ref&&(D(t,r),t=s(a,t.$ref)),d.parameters.find((function(e,n,r){return e.name===t.name&&e.in===t.in}))||"formData"!==t.in&&"body"!==t.in&&"file"!==t.type||(d=w(t,d,l,e,u,a,r),r.rbname&&""===d[r.rbname]&&delete d[r.rbname])}for(let t of d.parameters)d=w(t,d,l,e,e+":"+u,a,r);r.rbname&&""===d[r.rbname]&&delete d[r.rbname],r.debug||d.parameters&&(d.parameters=d.parameters.filter(S))}if(d&&d.security&&E(d.security),"object"==typeof d){if(!d.responses){let e={description:"Default response"};d.responses={default:e}}for(let e in d.responses){T(d.responses[e],0,d,a,r)}}if(d&&d["x-servers"]&&Array.isArray(d["x-servers"]))d.servers=d["x-servers"],delete d["x-servers"];else if(d&&d.schemes&&d.schemes.length)for(let e of d.schemes)if((!a.schemes||a.schemes.indexOf(e)<0)&&(d.servers||(d.servers=[]),Array.isArray(a.servers)))for(let n of a.servers){let r=c(n),i=t.parse(r.url);i.protocol=e,r.url=i.format(),d.servers.push(r)}if(r.debug&&(d["x-s2o-consumes"]=d.consumes||[],d["x-s2o-produces"]=d.produces||[]),d){if(delete d.consumes,delete d.produces,delete d.schemes,d["x-ms-examples"]){for(let e in d["x-ms-examples"]){let t=d["x-ms-examples"][e],n=f.sanitiseAll(e);if(t.parameters)for(let n in t.parameters){let r=t.parameters[n];for(let t of(d.parameters||[]).concat(l.parameters||[]))t.$ref&&(t=o.jptr(a,t.$ref)),t.name!==n||t.example||(t.examples||(t.examples={}),t.examples[e]={value:r})}if(t.responses)for(let r in t.responses){if(t.responses[r].headers)for(let e in t.responses[r].headers){let n=t.responses[r].headers[e];for(let t in d.responses[r].headers)if(t===e){d.responses[r].headers[t].example=n}}if(t.responses[r].body&&(a.components.examples[n]={value:c(t.responses[r].body)},d.responses[r]&&d.responses[r].content))for(let t in d.responses[r].content){let i=d.responses[r].content[t];i.examples||(i.examples={}),i.examples[e]={$ref:"#/components/examples/"+n}}}}delete d["x-ms-examples"]}if(d.parameters&&0===d.parameters.length&&delete d.parameters,d.requestBody){let t=d.operationId?f.sanitiseAll(d.operationId):f.sanitiseAll(e+u).toCamelCase(),r=f.sanitise(d.requestBody["x-s2o-name"]||t||"");delete d.requestBody["x-s2o-name"];let s=JSON.stringify(d.requestBody),a=f.hash(s);if(!i[a]){let e={};e.name=r,e.body=d.requestBody,e.refs=[],i[a]=e}let c="#/"+n+"/"+encodeURIComponent(o.jpescape(u))+"/"+e+"/requestBody";i[a].refs.push(c)}}}if(l&&l.parameters){for(let e in l.parameters){w(l.parameters[e],null,l,null,u,a,r)}!r.debug&&Array.isArray(l.parameters)&&(l.parameters=l.parameters.filter(S))}}}function F(e,t){let n={};g={schemas:{}},e.security&&E(e.security);for(let n in e.components.securitySchemes){let r=f.sanitise(n);n!==r&&(e.components.securitySchemes[r]&&y("Duplicate sanitised securityScheme name "+r,t),e.components.securitySchemes[r]=e.components.securitySchemes[n],delete e.components.securitySchemes[n]),x(e.components.securitySchemes[r],t)}for(let n in e.components.schemas){let r=f.sanitiseAll(n),i="";if(n!==r){for(;e.components.schemas[r+i];)i=i?++i:2;e.components.schemas[r+i]=e.components.schemas[n],delete e.components.schemas[n]}g.schemas[n]=r+i,b(e.components.schemas[r+i],t)}t.refmap={},l(e,{payload:{options:t}},C),function(e,t){for(let n in t.refmap)o.jptr(e,n,{$ref:t.refmap[n]})}(e,t);for(let n in e.components.parameters){let r=f.sanitise(n);n!==r&&(e.components.parameters[r]&&y("Duplicate sanitised parameter name "+r,t),e.components.parameters[r]=e.components.parameters[n],delete e.components.parameters[n]),w(e.components.parameters[r],null,null,null,r,e,t)}for(let n in e.components.responses){let r=f.sanitise(n);n!==r&&(e.components.responses[r]&&y("Duplicate sanitised response name "+r,t),e.components.responses[r]=e.components.responses[n],delete e.components.responses[n]);let i=e.components.responses[r];if(T(i,0,null,e,t),i.headers)for(let e in i.headers)"status code"===e.toLowerCase()?t.patch?(t.patches++,delete i.headers[e]):y('(Patchable) "Status Code" is not a valid header',t):k(i.headers[e],t)}for(let t in e.components.requestBodies){let r=e.components.requestBodies[t],i=JSON.stringify(r),o=f.hash(i),s={};s.name=t,s.body=r,s.refs=[],n[o]=s}if(R(e.paths,"paths",t,n,e),e["x-ms-paths"]&&R(e["x-ms-paths"],"x-ms-paths",t,n,e),!t.debug)for(let t in e.components.parameters){e.components.parameters[t]["x-s2o-delete"]&&delete e.components.parameters[t]}t.debug&&(e["x-s2o-consumes"]=e.consumes||[],e["x-s2o-produces"]=e.produces||[]),delete e.consumes,delete e.produces,delete e.schemes;let r=[];if(e.components.requestBodies={},!t.resolveInternal){let t=1;for(let i in n){let s=n[i];if(s.refs.length>1){let n="";for(s.name||(s.name="requestBody",n=t++);r.indexOf(s.name+n)>=0;)n=n?++n:2;s.name=s.name+n,r.push(s.name),e.components.requestBodies[s.name]=c(s.body);for(let t in s.refs){let n={};n.$ref="#/components/requestBodies/"+s.name,o.jptr(e,s.refs[t],n)}}}}return e.components.responses&&0===Object.keys(e.components.responses).length&&delete e.components.responses,e.components.parameters&&0===Object.keys(e.components.parameters).length&&delete e.components.parameters,e.components.examples&&0===Object.keys(e.components.examples).length&&delete e.components.examples,e.components.requestBodies&&0===Object.keys(e.components.requestBodies).length&&delete e.components.requestBodies,e.components.securitySchemes&&0===Object.keys(e.components.securitySchemes).length&&delete e.components.securitySchemes,e.components.headers&&0===Object.keys(e.components.headers).length&&delete e.components.headers,e.components.schemas&&0===Object.keys(e.components.schemas).length&&delete e.components.schemas,e.components&&0===Object.keys(e.components).length&&delete e.components,e}function P(e){return e&&e.url&&"string"==typeof e.url?(e.url=e.url.split("{{").join("{"),e.url=e.url.split("}}").join("}"),e.url.replace(/\{(.+?)\}/g,(function(t,n){e.variables||(e.variables={}),e.variables[n]={default:"unknown"}})),e):e}function N(e,t,n){if(void 0===e.info||null===e.info){if(!t.patch)return n(new A("(Patchable) info object is mandatory"));t.patches++,e.info={version:"",title:""}}if("object"!=typeof e.info||Array.isArray(e.info))return n(new A("info must be an object"));if(void 0===e.info.title||null===e.info.title){if(!t.patch)return n(new A("(Patchable) info.title cannot be null"));t.patches++,e.info.title=""}if(void 0===e.info.version||null===e.info.version){if(!t.patch)return n(new A("(Patchable) info.version cannot be null"));t.patches++,e.info.version=""}if("string"!=typeof e.info.version){if(!t.patch)return n(new A("(Patchable) info.version must be a string"));t.patches++,e.info.version=e.info.version.toString()}if(void 0!==e.info.logo){if(!t.patch)return n(new A("(Patchable) info should not have logo property"));t.patches++,e.info["x-logo"]=e.info.logo,delete e.info.logo}if(void 0!==e.info.termsOfService){if(null===e.info.termsOfService){if(!t.patch)return n(new A("(Patchable) info.termsOfService cannot be null"));t.patches++,e.info.termsOfService=""}try{new URL(e.info.termsOfService)}catch(r){if(!t.patch)return n(new A("(Patchable) info.termsOfService must be a URL"));t.patches++,delete e.info.termsOfService}}}function B(e,t,n){if(void 0===e.paths){if(!t.patch)return n(new A("(Patchable) paths object is mandatory"));t.patches++,e.paths={}}}function O(e,t,r){return n(r,new Promise((function(n,r){if(e||(e={}),t.original=e,t.text||(t.text=i.stringify(e)),t.externals=[],t.externalRefs={},t.rewriteRefs=!0,t.preserveMiro=!0,t.promise={},t.promise.resolve=n,t.promise.reject=r,t.patches=0,t.cache||(t.cache={}),t.source&&(t.cache[t.source]=t.original),function(e,t){const n=new WeakSet;l(e,{identityDetection:!0},(function(e,r,i){"object"==typeof e[r]&&null!==e[r]&&(n.has(e[r])?t.anchors?e[r]=c(e[r]):y("YAML anchor or merge key at "+i.path,t):n.add(e[r]))}))}(e,t),e.openapi&&"string"==typeof e.openapi&&e.openapi.startsWith("3."))return t.openapi=u(e),N(t.openapi,t,r),B(t.openapi,t,r),void d.optionalResolve(t).then((function(){return t.direct?n(t.openapi):n(t)})).catch((function(e){console.warn(e),r(e)}));if(!e.swagger||"2.0"!=e.swagger)return r(new A("Unsupported swagger/OpenAPI version: "+(e.openapi?e.openapi:e.swagger)));let o=t.openapi={};if(o.openapi="string"==typeof t.targetVersion&&t.targetVersion.startsWith("3.")?t.targetVersion:h,t.origin){o["x-origin"]||(o["x-origin"]=[]);let n={};n.url=t.source||t.origin,n.format="swagger",n.version=e.swagger,n.converter={},n.converter.url="https://github.com/mermade/oas-kit",n.converter.version=m,o["x-origin"].push(n)}if(o=Object.assign(o,u(e)),delete o.swagger,l(o,{},(function(e,t,n){null===e[t]&&!t.startsWith("x-")&&"default"!==t&&n.path.indexOf("/example")<0&&delete e[t]})),e.host)for(let t of Array.isArray(e.schemes)?e.schemes:[""]){let n={},r=(e.basePath||"").replace(/\/$/,"");n.url=(t?t+":":"")+"//"+e.host+r,P(n),o.servers||(o.servers=[]),o.servers.push(n)}else if(e.basePath){let t={};t.url=e.basePath,P(t),o.servers||(o.servers=[]),o.servers.push(t)}if(delete o.host,delete o.basePath,o["x-servers"]&&Array.isArray(o["x-servers"])&&(o.servers=o["x-servers"],delete o["x-servers"]),e["x-ms-parameterized-host"]){let t=e["x-ms-parameterized-host"],n={};n.url=t.hostTemplate+(e.basePath?e.basePath:""),n.variables={};const r=n.url.match(/\{\w+\}/g);for(let e in t.parameters){let i=t.parameters[e];i.$ref&&(i=c(s(o,i.$ref))),e.startsWith("x-")||(delete i.required,delete i.type,delete i.in,void 0===i.default&&(i.enum?i.default=i.enum[0]:i.default="none"),i.name||(i.name=r[e].replace("{","").replace("}","")),n.variables[i.name]=i,delete i.name)}o.servers||(o.servers=[]),!1===t.useSchemePrefix?o.servers.push(n):e.schemes.forEach((e=>{o.servers.push(Object.assign({},n,{url:e+"://"+n.url}))})),delete o["x-ms-parameterized-host"]}N(o,t,r),B(o,t,r),"string"==typeof o.consumes&&(o.consumes=[o.consumes]),"string"==typeof o.produces&&(o.produces=[o.produces]),o.components={},o["x-callbacks"]&&(o.components.callbacks=o["x-callbacks"],delete o["x-callbacks"]),o.components.examples={},o.components.headers={},o["x-links"]&&(o.components.links=o["x-links"],delete o["x-links"]),o.components.parameters=o.parameters||{},o.components.responses=o.responses||{},o.components.requestBodies={},o.components.securitySchemes=o.securityDefinitions||{},o.components.schemas=o.definitions||{},delete o.definitions,delete o.responses,delete o.parameters,delete o.securityDefinitions,d.optionalResolve(t).then((function(){F(t.openapi,t),t.direct?n(t.openapi):n(t)})).catch((function(e){console.warn(e),r(e)}))})))}function q(e,t,r){return n(r,new Promise((function(n,r){let o=null,s=null;try{o=JSON.parse(e),t.text=JSON.stringify(o,null,2)}catch(n){s=n;try{o=i.parse(e,{schema:"core",prettyErrors:!0}),t.sourceYaml=!0,t.text=e}catch(e){s=e}}o?O(o,t).then((e=>n(e))).catch((e=>r(e))):r(new A(s?s.message:"Could not parse string"))})))}return swagger2openapi={S2OError:A,targetVersion:h,convert:O,convertObj:O,convertUrl:function(e,t,i){return n(i,new Promise((function(n,i){t.origin=!0,t.source||(t.source=e),t.verbose&&console.warn("GET "+e),t.fetch||(t.fetch=r);const o=Object.assign({},t.fetchOptions,{agent:t.agent});t.fetch(e,o).then((function(t){if(200!==t.status)throw new A(`Received status code ${t.status}: ${e}`);return t.text()})).then((function(e){q(e,t).then((e=>n(e))).catch((e=>i(e)))})).catch((function(e){i(e)}))})))},convertStr:q,convertFile:function(t,r,i){return n(i,new Promise((function(n,i){e.readFile(t,r.encoding||"utf8",(function(e,o){e?i(e):(r.sourceFile=t,q(o,r).then((e=>n(e))).catch((e=>i(e))))}))})))},convertStream:function(e,t,r){return n(r,new Promise((function(n,r){let i="";e.on("data",(function(e){i+=e})).on("end",(function(){q(i,t).then((e=>n(e))).catch((e=>r(e)))}))})))}},swagger2openapi}var swagger2openapiExports=requireSwagger2openapi(),converter=getDefaultExportFromCjs(swagger2openapiExports),OASNormalize=class e{constructor(e,t){this.file=e,this.opts={colorizeErrors:!1,enablePaths:!1,...t},this.type=getType(this.file),this.cache={load:!1,bundle:!1,deref:!1}}async load(){if(this.cache.load)return this.cache.load;const e=e=>{const t=stringToJSON(e);return this.cache.load=t,t};switch(this.type){case"json":case"string-json":case"string-yaml":return e(this.file);case"buffer":return e(this.file.toString());case"url":return e(await fetch(normalizeURL(this.file)).then((e=>e.text())));case"path":if(!this.opts.enablePaths)throw new Error("Use `opts.enablePaths` to enable accessing local files.");const t=fs$6.readFileSync(this.file).toString();if(!t.trim())throw new Error("No file contents found.");return e(t);default:throw new Error("Could not load this file.")}}static async convertPostmanToOpenAPI(e){return postmanToOpenAPI(JSON.stringify(e),void 0,{outputFormat:"json",replaceVars:!0}).then(JSON.parse)}async bundle(){return this.cache.bundle?this.cache.bundle:this.load().then((t=>isPostman(t)?e.convertPostmanToOpenAPI(t):t)).then((e=>openapiParser.bundle(e))).then((e=>(this.cache.bundle=e,e)))}async deref(){return this.cache.deref?this.cache.deref:this.load().then((t=>isPostman(t)?e.convertPostmanToOpenAPI(t):t)).then((e=>openapiParser.dereference(e))).then((e=>(this.cache.deref=e,e)))}async convert(){return this.cache.convert?this.cache.convert:this.load().then((async t=>isPostman(t)?e.convertPostmanToOpenAPI(t):t)).then((async e=>{if(!isSwagger(e)&&!isOpenAPI(e))throw new Error("The supplied API definition is unsupported.");if(isOpenAPI(e))return e;if(1===parseInt(e.swagger,10))throw new Error("Swagger v1.2 is unsupported.");return converter.convertObj(e,{anchors:!0}).then((e=>e.openapi))}))}async validate(t={}){const n=t.parser||{};return n.validate||(n.validate={}),n.validate.colorizeErrors=this.opts.colorizeErrors,this.load().then((async t=>isPostman(t)?e.convertPostmanToOpenAPI(t):t)).then((async e=>{if(!isSwagger(e)&&!isOpenAPI(e))throw new Error("The supplied API definition is unsupported.");if(isSwagger(e)){if(1===parseInt(e.swagger,10))throw new Error("Swagger v1.2 is unsupported.")}const t=JSON.parse(JSON.stringify(e));return openapiParser.validate(t,n).then((()=>!0))}))}async version(){return this.load().then((e=>{switch(getAPIDefinitionType(e)){case"openapi":return{specification:"openapi",version:e.openapi};case"postman":let t="unknown";if(e?.info?.schema){const n=(e?.info).schema.match(/http(s?):\/\/schema.getpostman.com\/json\/collection\/v([0-9.]+)\//);n&&(t=n[2])}return{specification:"postman",version:t};case"swagger":return{specification:"swagger",version:e.swagger};default:throw new Error("Unknown file detected.")}}))}};const copyProperty=(e,t,n,r)=>{if("length"===n||"prototype"===n)return;if("arguments"===n||"caller"===n)return;const i=Object.getOwnPropertyDescriptor(e,n),o=Object.getOwnPropertyDescriptor(t,n);!canCopyProperty(i,o)&&r||Object.defineProperty(e,n,o)},canCopyProperty=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},changePrototype=(e,t)=>{const n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},wrappedToString=(e,t)=>`/* Wrapped ${e}*/\n${t}`,toStringDescriptor=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),toStringName=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),changeToString=(e,t,n)=>{const r=""===n?"":`with ${n.trim()}() `,i=wrappedToString.bind(null,r,t.toString());Object.defineProperty(i,"name",toStringName);const{writable:o,enumerable:s,configurable:a}=toStringDescriptor;Object.defineProperty(e,"toString",{value:i,writable:o,enumerable:s,configurable:a})};function mimicFunction(e,t,{ignoreNonConfigurable:n=!1}={}){const{name:r}=e;for(const r of Reflect.ownKeys(t))copyProperty(e,t,r,n);return changePrototype(e,t),changeToString(e,t,r),e}const calledFunctions=new WeakMap,onetime=(e,t={})=>{if("function"!=typeof e)throw new TypeError("Expected a function");let n,r=0;const i=e.displayName||e.name||"",o=function(...s){if(calledFunctions.set(o,++r),1===r)n=e.apply(this,s),e=void 0;else if(!0===t.throw)throw new Error(`Function \`${i}\` can only be called once`);return n};return mimicFunction(o,e),calledFunctions.set(o,r),o};onetime.callCount=e=>{if(!calledFunctions.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return calledFunctions.get(e)};const signals=[];signals.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&signals.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&signals.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const processOk=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,kExitEmitter=Symbol.for("signal-exit emitter"),global$1=globalThis,ObjectDefineProperty=Object.defineProperty.bind(Object);class Emitter{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(global$1[kExitEmitter])return global$1[kExitEmitter];ObjectDefineProperty(global$1,kExitEmitter,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const n=this.listeners[e],r=n.indexOf(t);-1!==r&&(0===r&&1===n.length?n.length=0:n.splice(r,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(const i of this.listeners[e])r=!0===i(t,n)||r;return"exit"===e&&(r=this.emit("afterExit",t,n)||r),r}}class SignalExitBase{}const signalExitWrap=e=>({onExit:(t,n)=>e.onExit(t,n),load:()=>e.load(),unload:()=>e.unload()});class SignalExitFallback extends SignalExitBase{onExit(){return()=>{}}load(){}unload(){}}class SignalExit extends SignalExitBase{#R="win32"===process$1.platform?"SIGINT":"SIGHUP";#F=new Emitter;#P;#N;#B;#O={};#q=!1;constructor(e){super(),this.#P=e,this.#O={};for(const t of signals)this.#O[t]=()=>{const n=this.#P.listeners(t);let{count:r}=this.#F;const i=e;if("object"==typeof i.__signal_exit_emitter__&&"number"==typeof i.__signal_exit_emitter__.count&&(r+=i.__signal_exit_emitter__.count),n.length===r){this.unload();const n=this.#F.emit("exit",null,t),r="SIGHUP"===t?this.#R:t;n||e.kill(e.pid,r)}};this.#B=e.reallyExit,this.#N=e.emit}onExit(e,t){if(!processOk(this.#P))return()=>{};!1===this.#q&&this.load();const n=t?.alwaysLast?"afterExit":"exit";return this.#F.on(n,e),()=>{this.#F.removeListener(n,e),0===this.#F.listeners.exit.length&&0===this.#F.listeners.afterExit.length&&this.unload()}}load(){if(!this.#q){this.#q=!0,this.#F.count+=1;for(const e of signals)try{const t=this.#O[e];t&&this.#P.on(e,t)}catch(e){}this.#P.emit=(e,...t)=>this.#$(e,...t),this.#P.reallyExit=e=>this.#Q(e)}}unload(){this.#q&&(this.#q=!1,signals.forEach((e=>{const t=this.#O[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#P.removeListener(e,t)}catch(e){}})),this.#P.emit=this.#N,this.#P.reallyExit=this.#B,this.#F.count-=1)}#Q(e){return processOk(this.#P)?(this.#P.exitCode=e||0,this.#F.emit("exit",this.#P.exitCode,null),this.#B.call(this.#P,this.#P.exitCode)):0}#$(e,...t){const n=this.#N;if("exit"===e&&processOk(this.#P)){"number"==typeof t[0]&&(this.#P.exitCode=t[0]);const r=n.call(this.#P,e,...t);return this.#F.emit("exit",this.#P.exitCode,null),r}return n.call(this.#P,e,...t)}}const process$1=globalThis.process,{onExit:onExit,load:load,unload:unload}=signalExitWrap(processOk(process$1)?new SignalExit(process$1):new SignalExitFallback),terminal=process$2.stderr.isTTY?process$2.stderr:process$2.stdout.isTTY?process$2.stdout:void 0,restoreCursor=terminal?onetime((()=>{onExit((()=>{terminal.write("[?25h")}),{alwaysLast:!0})})):()=>{};let isHidden=!1;const cliCursor={show:(e=process$2.stderr)=>{e.isTTY&&(isHidden=!1,e.write("[?25h"))},hide:(e=process$2.stderr)=>{e.isTTY&&(restoreCursor(),isHidden=!0,e.write("[?25l"))},toggle:(e,t)=>{void 0!==e&&(isHidden=e),isHidden?cliCursor.show(t):cliCursor.hide(t)}};var cliSpinnersExports=requireCliSpinners(),cliSpinners=getDefaultExportFromCjs(cliSpinnersExports);function isUnicodeSupported$1(){return"win32"!==process$2.platform?"linux"!==process$2.env.TERM:Boolean(process$2.env.CI)||Boolean(process$2.env.WT_SESSION)||Boolean(process$2.env.TERMINUS_SUBLIME)||"{cmd::Cmder}"===process$2.env.ConEmuTask||"Terminus-Sublime"===process$2.env.TERM_PROGRAM||"vscode"===process$2.env.TERM_PROGRAM||"xterm-256color"===process$2.env.TERM||"alacritty"===process$2.env.TERM||"JetBrains-JediTerm"===process$2.env.TERMINAL_EMULATOR}const main={info:chalk.blue("ℹ"),success:chalk.green("✔"),warning:chalk.yellow("⚠"),error:chalk.red("✖")},fallback={info:chalk.blue("i"),success:chalk.green("√"),warning:chalk.yellow("‼"),error:chalk.red("×")},logSymbols=isUnicodeSupported$1()?main:fallback;function ansiRegex({onlyFirst:e=!1}={}){const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}const regex=ansiRegex();function stripAnsi(e){if("string"!=typeof e)throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(regex,"")}function isAmbiguous(e){return 161===e||164===e||167===e||168===e||170===e||173===e||174===e||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||198===e||208===e||215===e||216===e||e>=222&&e<=225||230===e||e>=232&&e<=234||236===e||237===e||240===e||242===e||243===e||e>=247&&e<=250||252===e||254===e||257===e||273===e||275===e||283===e||294===e||295===e||299===e||e>=305&&e<=307||312===e||e>=319&&e<=322||324===e||e>=328&&e<=331||333===e||338===e||339===e||358===e||359===e||363===e||462===e||464===e||466===e||468===e||470===e||472===e||474===e||476===e||593===e||609===e||708===e||711===e||e>=713&&e<=715||717===e||720===e||e>=728&&e<=731||733===e||735===e||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||1025===e||e>=1040&&e<=1103||1105===e||8208===e||e>=8211&&e<=8214||8216===e||8217===e||8220===e||8221===e||e>=8224&&e<=8226||e>=8228&&e<=8231||8240===e||8242===e||8243===e||8245===e||8251===e||8254===e||8308===e||8319===e||e>=8321&&e<=8324||8364===e||8451===e||8453===e||8457===e||8467===e||8470===e||8481===e||8482===e||8486===e||8491===e||8531===e||8532===e||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||8585===e||e>=8592&&e<=8601||8632===e||8633===e||8658===e||8660===e||8679===e||8704===e||8706===e||8707===e||8711===e||8712===e||8715===e||8719===e||8721===e||8725===e||8730===e||e>=8733&&e<=8736||8739===e||8741===e||e>=8743&&e<=8748||8750===e||e>=8756&&e<=8759||8764===e||8765===e||8776===e||8780===e||8786===e||8800===e||8801===e||e>=8804&&e<=8807||8810===e||8811===e||8814===e||8815===e||8834===e||8835===e||8838===e||8839===e||8853===e||8857===e||8869===e||8895===e||8978===e||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||9632===e||9633===e||e>=9635&&e<=9641||9650===e||9651===e||9654===e||9655===e||9660===e||9661===e||9664===e||9665===e||e>=9670&&e<=9672||9675===e||e>=9678&&e<=9681||e>=9698&&e<=9701||9711===e||9733===e||9734===e||9737===e||9742===e||9743===e||9756===e||9758===e||9792===e||9794===e||9824===e||9825===e||e>=9827&&e<=9829||e>=9831&&e<=9834||9836===e||9837===e||9839===e||9886===e||9887===e||9919===e||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||9955===e||9960===e||9961===e||e>=9963&&e<=9969||9972===e||e>=9974&&e<=9977||9979===e||9980===e||9982===e||9983===e||10045===e||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||65533===e||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||127375===e||127376===e||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function isFullWidth(e){return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510}function isWide(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||94192===e||94193===e||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function validate(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function eastAsianWidth(e,{ambiguousAsWide:t=!1}={}){return validate(e),isFullWidth(e)||isWide(e)||t&&isAmbiguous(e)?2:1}var emojiRegex=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;const segmenter=new Intl.Segmenter,defaultIgnorableCodePointRegex=/^\p{Default_Ignorable_Code_Point}$/u;function stringWidth(e,t={}){if("string"!=typeof e||0===e.length)return 0;const{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=stripAnsi(e)),0===e.length)return 0;let i=0;const o={ambiguousAsWide:!n};for(const{segment:t}of segmenter.segment(e)){const e=t.codePointAt(0);e<=31||e>=127&&e<=159||(e>=8203&&e<=8207||65279===e||e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=55296&&e<=57343||e>=65024&&e<=65039||defaultIgnorableCodePointRegex.test(t)||(emojiRegex().test(t)?i+=2:i+=eastAsianWidth(e,o)))}return i}function isInteractive({stream:e=process.stdout}={}){return Boolean(e&&e.isTTY&&"dumb"!==process.env.TERM&&!("CI"in process.env))}function isUnicodeSupported(){const{env:e}=process$2,{TERM:t,TERM_PROGRAM:n}=e;return"win32"!==process$2.platform?"linux"!==t:Boolean(e.WT_SESSION)||Boolean(e.TERMINUS_SUBLIME)||"{cmd::Cmder}"===e.ConEmuTask||"Terminus-Sublime"===n||"vscode"===n||"xterm-256color"===t||"alacritty"===t||"rxvt-unicode"===t||"rxvt-unicode-256color"===t||"JetBrains-JediTerm"===e.TERMINAL_EMULATOR}const ASCII_ETX_CODE=3;class StdinDiscarder{#L=0;start(){this.#L++,1===this.#L&&this.#M()}stop(){if(this.#L<=0)throw new Error("`stop` called more times than `start`");this.#L--,0===this.#L&&this.#j()}#M(){"win32"!==process$2.platform&&process$2.stdin.isTTY&&(process$2.stdin.setRawMode(!0),process$2.stdin.on("data",this.#U),process$2.stdin.resume())}#j(){process$2.stdin.isTTY&&(process$2.stdin.off("data",this.#U),process$2.stdin.pause(),process$2.stdin.setRawMode(!1))}#U(e){e[0]===ASCII_ETX_CODE&&process$2.emit("SIGINT")}}const stdinDiscarder=new StdinDiscarder;class Ora{#J=0;#V=!1;#H=0;#G=-1;#W=0;#c;#z;#Y;#K;#X;#Z;#ee;#te;#ne;#re;#ie;color;constructor(e){"string"==typeof e&&(e={text:e}),this.#c={color:"cyan",stream:process$2.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#c.color,this.spinner=this.#c.spinner,this.#X=this.#c.interval,this.#Y=this.#c.stream,this.#Z="boolean"==typeof this.#c.isEnabled?this.#c.isEnabled:isInteractive({stream:this.#Y}),this.#ee="boolean"==typeof this.#c.isSilent&&this.#c.isSilent,this.text=this.#c.text,this.prefixText=this.#c.prefixText,this.suffixText=this.#c.suffixText,this.indent=this.#c.indent,"test"===process$2.env.NODE_ENV&&(this._stream=this.#Y,this._isEnabled=this.#Z,Object.defineProperty(this,"_linesToClear",{get(){return this.#J},set(e){this.#J=e}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#G}}),Object.defineProperty(this,"_lineCount",{get(){return this.#H}}))}get indent(){return this.#te}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#te=e,this.#oe()}get interval(){return this.#X??this.#z.interval??100}get spinner(){return this.#z}set spinner(e){if(this.#G=-1,this.#X=void 0,"object"==typeof e){if(void 0===e.frames)throw new Error("The given spinner must have a `frames` property");this.#z=e}else if(isUnicodeSupported())if(void 0===e)this.#z=cliSpinners.dots;else{if("default"===e||!cliSpinners[e])throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);this.#z=cliSpinners[e]}else this.#z=cliSpinners.line}get text(){return this.#ne}set text(e=""){this.#ne=e,this.#oe()}get prefixText(){return this.#re}set prefixText(e=""){this.#re=e,this.#oe()}get suffixText(){return this.#ie}set suffixText(e=""){this.#ie=e,this.#oe()}get isSpinning(){return void 0!==this.#K}#se(e=this.#re,t=" "){return"string"==typeof e&&""!==e?e+t:"function"==typeof e?e()+t:""}#ae(e=this.#ie,t=" "){return"string"==typeof e&&""!==e?t+e:"function"==typeof e?t+e():""}#oe(){const e=this.#Y.columns??80,t=this.#se(this.#re,"-"),n=this.#ae(this.#ie,"-"),r=" ".repeat(this.#te)+t+"--"+this.#ne+"--"+n;this.#H=0;for(const t of stripAnsi(r).split("\n"))this.#H+=Math.max(1,Math.ceil(stringWidth(t,{countAnsiEscapeCodes:!0})/e))}get isEnabled(){return this.#Z&&!this.#ee}set isEnabled(e){if("boolean"!=typeof e)throw new TypeError("The `isEnabled` option must be a boolean");this.#Z=e}get isSilent(){return this.#ee}set isSilent(e){if("boolean"!=typeof e)throw new TypeError("The `isSilent` option must be a boolean");this.#ee=e}frame(){const e=Date.now();(-1===this.#G||e-this.#W>=this.interval)&&(this.#G=++this.#G%this.#z.frames.length,this.#W=e);const{frames:t}=this.#z;let n=t[this.#G];this.color&&(n=chalk[this.color](n));return("string"==typeof this.#re&&""!==this.#re?this.#re+" ":"")+n+("string"==typeof this.text?" "+this.text:"")+("string"==typeof this.#ie&&""!==this.#ie?" "+this.#ie:"")}clear(){if(!this.#Z||!this.#Y.isTTY)return this;this.#Y.cursorTo(0);for(let e=0;e0&&this.#Y.moveCursor(0,-1),this.#Y.clearLine(1);return(this.#te||this.lastIndent!==this.#te)&&this.#Y.cursorTo(this.#te),this.lastIndent=this.#te,this.#J=0,this}render(){return this.#ee||(this.clear(),this.#Y.write(this.frame()),this.#J=this.#H),this}start(e){return e&&(this.text=e),this.#ee?this:this.#Z?(this.isSpinning||(this.#c.hideCursor&&cliCursor.hide(this.#Y),this.#c.discardStdin&&process$2.stdin.isTTY&&(this.#V=!0,stdinDiscarder.start()),this.render(),this.#K=setInterval(this.render.bind(this),this.interval)),this):(this.text&&this.#Y.write(`- ${this.text}\n`),this)}stop(){return this.#Z?(clearInterval(this.#K),this.#K=void 0,this.#G=0,this.clear(),this.#c.hideCursor&&cliCursor.show(this.#Y),this.#c.discardStdin&&process$2.stdin.isTTY&&this.#V&&(stdinDiscarder.stop(),this.#V=!1),this):this}succeed(e){return this.stopAndPersist({symbol:logSymbols.success,text:e})}fail(e){return this.stopAndPersist({symbol:logSymbols.error,text:e})}warn(e){return this.stopAndPersist({symbol:logSymbols.warning,text:e})}info(e){return this.stopAndPersist({symbol:logSymbols.info,text:e})}stopAndPersist(e={}){if(this.#ee)return this;const t=e.prefixText??this.#re,n=this.#se(t," "),r=e.symbol??" ",i=e.text??this.text,o="string"==typeof i?(r?" ":"")+i:"",s=e.suffixText??this.#ie,a=n+r+o+this.#ae(s," ")+"\n";return this.stop(),this.#Y.write(a),this}}function ora(e){return new Ora(e)}function truthy(e){return!!e}const capitalizeSpecType=e=>"openapi"===e?"OpenAPI":e.charAt(0).toUpperCase()+e.slice(1);async function prepareOas(e,t,n={}){let r=e;if(!r){const e=ora({text:"Looking for API definitions...",...oraOptions()}).start(),n=t.replace("openapi ",""),i=readdirRecursive(".",!0).filter((e=>e.toLowerCase().endsWith(".json")||e.toLowerCase().endsWith(".yaml")||e.toLowerCase().endsWith(".yml")));debug(`number of JSON or YAML files found: ${i.length}`);const o=(await Promise.all(i.map((e=>{debug(`attempting to oas-normalize ${e}`);return new OASNormalize(e,{enablePaths:!0}).version().then((({specification:t,version:n})=>(debug(`specification type for ${e}: ${t}`),debug(`version for ${e}: ${n}`),["openapi","swagger","postman"].includes(t)?{filePath:e,specType:capitalizeSpecType(t),version:n}:null))).catch((t=>(debug(`error extracting API definition specification version for ${e}: ${t.message}`),null)))})))).filter(truthy);if(debug(`number of possible OpenAPI/Swagger files found: ${o.length}`),!o.length)throw e.fail(),new Error(`We couldn't find an OpenAPI or Swagger definition.\n\nPlease specify the path to your definition with \`rdme ${t} ./path/to/api/definition\`.`);if(r=o[0].filePath,1===o.length)e.stop(),info(chalk.yellow(`We found ${r} and are attempting to ${n} it.`));else if(o.length>1){if(isCI())throw e.fail(),new Error("Multiple API definitions found in current directory. Please specify file.");e.stop();const t=await promptTerminal({name:"file",message:`Multiple potential API definitions found! Which one would you like to ${n}?`,type:"select",choices:o.map((e=>({title:e.filePath,value:e.filePath,description:`${e.specType} ${e.version}`})))});r=t.file}}const i=ora({text:`Validating the API definition located at ${r}...`,...oraOptions()}).start();debug(`about to normalize spec located at ${r}`);const o=new OASNormalize(r,{colorizeErrors:!0,enablePaths:!0});debug("spec normalized");const{specType:s,definitionVersion:a}=await o.load().then((async e=>{const t=getAPIDefinitionType(e);return{specType:capitalizeSpecType(t),definitionVersion:await o.version()}})).catch((e=>{throw i.fail(),debug(`raw oas load error object: ${JSON.stringify(e)}`),e}));let c;await o.validate().catch((e=>{throw i.fail(),debug(`raw validation error object: ${JSON.stringify(e)}`),e})),debug("converting the spec to OpenAPI 3.0 (if necessary)"),c=await o.convert().catch((e=>{throw i.fail(),debug(`raw openapi conversion error object: ${JSON.stringify(e)}`),e})),i.stop(),debug("👇👇👇👇👇 spec validated! logging spec below 👇👇👇👇👇"),debug(c),debug("👆👆👆👆👆 finished logging spec 👆👆👆👆👆"),debug(`spec type: ${s}`),n.title&&(debug(`renaming title field to ${n.title}`),c.info.title=n.title);const u=o.type,l=c.info.version;debug(`version in spec: ${l}`);return["openapi inspect","openapi reduce","openapi upload"].includes(t)&&(c=await o.bundle(),debug("spec bundled")),{preparedSpec:JSON.stringify(c),specFileType:u,specPath:r,specType:s,specVersion:l,definitionVersion:a}}class OpenAPIConvertCommand extends BaseCommand{static summary="Converts an API definition to OpenAPI and bundles any external references.";static description="Converts Swagger files and Postman collections to OpenAPI and bundles any external references. **Note**: All of our other OpenAPI commands already do this conversion automatically, but this command is available in case you need this functionality exclusively.";static args={spec:specArg};static flags={out:libExports$3.Flags.string({description:"Output file path to write converted file to"}),title:titleFlag,workingDirectory:workingDirectoryFlag};static examples=[{description:"By default, this command will display a comprehensive table of all OpenAPI and ReadMe features found in your API definition:",command:"<%= config.bin %> <%= command.id %> [url-or-local-path-to-file]"},{description:"You can omit the file name and `rdme` will scan your working directory (and any subdirectories) for OpenAPI/Swagger files. This approach will provide you with CLI prompts, so we do not recommend this technique in CI environments.",command:"<%= config.bin %> <%= command.id %>"}];async run(){const{spec:e}=this.args,{out:t,title:n,workingDirectory:r}=this.flags;if(r){const e=process.cwd();process.chdir(r),this.debug(`switching working directory from ${e} to ${process.cwd()}`)}const{preparedSpec:i,specPath:o,specType:s}=await prepareOas(e,"openapi convert",{title:n}),a=JSON.parse(i);"OpenAPI"===s&&warn("The input file is already OpenAPI, so no conversion is necessary. Any external references will be bundled."),prompts.override({outputPath:t});const c=await promptTerminal([{type:"text",name:"outputPath",message:"Enter the path to save your converted/bundled API definition to:",initial:()=>{const e=path$1.extname(o);return`${path$1.basename(o).split(e)[0]}.openapi${e}`},validate:e=>validateFilePath(e)}]);return this.debug(`saving converted/bundled spec to ${c.outputPath}`),fs$6.writeFileSync(c.outputPath,JSON.stringify(a,null,2)),this.debug("converted/bundled spec saved"),Promise.resolve(chalk.green(`Your API definition has been converted and bundled and saved to ${c.outputPath}!`))}}var src$2={},createStream={},alignTableData={},alignString={},utils={},astralRegex_1,hasRequiredAstralRegex,sliceAnsi,hasRequiredSliceAnsi;function requireAstralRegex(){if(hasRequiredAstralRegex)return astralRegex_1;hasRequiredAstralRegex=1;const e="[\ud800-\udbff][\udc00-\udfff]";return astralRegex_1=t=>t&&t.exact?new RegExp(`^${e}$`):new RegExp(e,"g"),astralRegex_1}function requireSliceAnsi(){if(hasRequiredSliceAnsi)return sliceAnsi;hasRequiredSliceAnsi=1;const e=requireIsFullwidthCodePoint(),t=requireAstralRegex(),n=requireAnsiStyles(),r=["","›"],i=e=>`${r[0]}[${e}m`,o=(e,t,r)=>{let o=[];e=[...e];for(let r of e){const s=r;r.includes(";")&&(r=r.split(";")[0][0]+"0");const a=n.codes.get(Number.parseInt(r,10));if(a){const n=e.indexOf(a.toString());-1===n?o.push(i(t?a:s)):e.splice(n,1)}else{if(t){o.push(i(0));break}o.push(i(s))}}if(t&&(o=o.filter(((e,t)=>o.indexOf(e)===t)),void 0!==r)){const e=i(n.codes.get(Number.parseInt(r,10)));o=o.reduce(((t,n)=>n===e?[n,...t]:[...t,n]),[])}return o.join("")};return sliceAnsi=(n,i,s)=>{const a=[...n],c=[];let u,l="number"==typeof s?s:a.length,d=!1,p=0,f="";for(const[_,m]of a.entries()){let a=!1;if(r.includes(m)){const e=/\d[^m]*/.exec(n.slice(_,_+18));u=e&&e.length>0?e[0]:void 0,pi&&p<=l)f+=m;else if(p!==i||d||void 0===u){if(p>=l){f+=o(c,!0,u);break}}else f=o(c)}return f},sliceAnsi}var getBorderCharacters={},hasRequiredGetBorderCharacters,hasRequiredUtils,hasRequiredAlignString,hasRequiredAlignTableData;function requireGetBorderCharacters(){if(hasRequiredGetBorderCharacters)return getBorderCharacters;hasRequiredGetBorderCharacters=1,Object.defineProperty(getBorderCharacters,"__esModule",{value:!0}),getBorderCharacters.getBorderCharacters=void 0;return getBorderCharacters.getBorderCharacters=e=>{if("honeywell"===e)return{topBody:"═",topJoin:"╤",topLeft:"╔",topRight:"╗",bottomBody:"═",bottomJoin:"╧",bottomLeft:"╚",bottomRight:"╝",bodyLeft:"║",bodyRight:"║",bodyJoin:"│",headerJoin:"┬",joinBody:"─",joinLeft:"╟",joinRight:"╢",joinJoin:"┼",joinMiddleDown:"┬",joinMiddleUp:"┴",joinMiddleLeft:"┤",joinMiddleRight:"├"};if("norc"===e)return{topBody:"─",topJoin:"┬",topLeft:"┌",topRight:"┐",bottomBody:"─",bottomJoin:"┴",bottomLeft:"└",bottomRight:"┘",bodyLeft:"│",bodyRight:"│",bodyJoin:"│",headerJoin:"┬",joinBody:"─",joinLeft:"├",joinRight:"┤",joinJoin:"┼",joinMiddleDown:"┬",joinMiddleUp:"┴",joinMiddleLeft:"┤",joinMiddleRight:"├"};if("ramac"===e)return{topBody:"-",topJoin:"+",topLeft:"+",topRight:"+",bottomBody:"-",bottomJoin:"+",bottomLeft:"+",bottomRight:"+",bodyLeft:"|",bodyRight:"|",bodyJoin:"|",headerJoin:"+",joinBody:"-",joinLeft:"|",joinRight:"|",joinJoin:"|",joinMiddleDown:"+",joinMiddleUp:"+",joinMiddleLeft:"+",joinMiddleRight:"+"};if("void"===e)return{topBody:"",topJoin:"",topLeft:"",topRight:"",bottomBody:"",bottomJoin:"",bottomLeft:"",bottomRight:"",bodyLeft:"",bodyRight:"",bodyJoin:"",headerJoin:"",joinBody:"",joinLeft:"",joinRight:"",joinJoin:"",joinMiddleDown:"",joinMiddleUp:"",joinMiddleLeft:"",joinMiddleRight:""};throw new Error('Unknown border template "'+e+'".')},getBorderCharacters}function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1;var e=utils.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(utils,"__esModule",{value:!0}),utils.isCellInRange=utils.areCellEqual=utils.calculateRangeCoordinate=utils.flatten=utils.extractTruncates=utils.sumArray=utils.sequence=utils.distributeUnevenly=utils.countSpaceSequence=utils.groupBySizes=utils.makeBorderConfig=utils.splitAnsi=utils.normalizeString=void 0;const t=e(requireSliceAnsi()),n=e(requireStringWidth()),r=e(requireStripAnsi()),i=requireGetBorderCharacters();utils.normalizeString=e=>e.replace(/\r\n/g,"\n");utils.splitAnsi=e=>{const i=(0,r.default)(e).split("\n").map(n.default),o=[];let s=0;return i.forEach((n=>{o.push(0===n?"":(0,t.default)(e,s,s+n)),s+=n+1})),o};utils.makeBorderConfig=e=>({...(0,i.getBorderCharacters)("honeywell"),...e});utils.groupBySizes=(e,t)=>{let n=0;return t.map((t=>{const r=e.slice(n,n+t);return n+=t,r}))};utils.countSpaceSequence=e=>{var t,n;return null!==(n=null===(t=e.match(/\s+/g))||void 0===t?void 0:t.length)&&void 0!==n?n:0};utils.distributeUnevenly=(e,t)=>Array.from({length:t}).fill(Math.floor(e/t)).map(((n,r)=>n+(rArray.from({length:t-e+1},((t,n)=>n+e));utils.sumArray=e=>e.reduce(((e,t)=>e+t),0);utils.extractTruncates=e=>e.columns.map((({truncate:e})=>e));utils.flatten=e=>[].concat(...e);utils.calculateRangeCoordinate=e=>{const{row:t,col:n,colSpan:r=1,rowSpan:i=1}=e;return{bottomRight:{col:n+r-1,row:t+i-1},topLeft:{col:n,row:t}}};utils.areCellEqual=(e,t)=>e.row===t.row&&e.col===t.col;return utils.isCellInRange=(e,{topLeft:t,bottomRight:n})=>t.row<=e.row&&e.row<=n.row&&t.col<=e.col&&e.col<=n.col,utils}function requireAlignString(){if(hasRequiredAlignString)return alignString;hasRequiredAlignString=1;var e=alignString.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(alignString,"__esModule",{value:!0}),alignString.alignString=void 0;const t=e(requireStringWidth()),n=requireUtils(),r=(e,t)=>e+" ".repeat(t);return alignString.alignString=(e,i,o)=>{const s=(0,t.default)(e);if(s===i)return e;if(s>i)throw new Error("Subject parameter value width cannot be greater than the container width.");if(0===s)return" ".repeat(i);const a=i-s;return"left"===o?r(e,a):"right"===o?((e,t)=>" ".repeat(t)+e)(e,a):"justify"===o?((e,t)=>{const i=(0,n.countSpaceSequence)(e);if(0===i)return r(e,t);const o=(0,n.distributeUnevenly)(t,i);if(Math.max(...o)>3)return r(e,t);let s=0;return e.replace(/\s+/g,(e=>e+" ".repeat(o[s++])))})(e,a):((e,t)=>" ".repeat(Math.floor(t/2))+e+" ".repeat(Math.ceil(t/2)))(e,a)},alignString}function requireAlignTableData(){if(hasRequiredAlignTableData)return alignTableData;hasRequiredAlignTableData=1,Object.defineProperty(alignTableData,"__esModule",{value:!0}),alignTableData.alignTableData=void 0;const e=requireAlignString();return alignTableData.alignTableData=(t,n)=>t.map(((t,r)=>t.map(((t,i)=>{var o;const{width:s,alignment:a}=n.columns[i];return(null===(o=n.spanningCellManager)||void 0===o?void 0:o.getContainingRange({col:i,row:r},{mapped:!0}))?t:(0,e.alignString)(t,s,a)})))),alignTableData}var calculateRowHeights={},calculateCellHeight={},wrapCell={},wrapString={},hasRequiredWrapString;function requireWrapString(){if(hasRequiredWrapString)return wrapString;hasRequiredWrapString=1;var e=wrapString.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wrapString,"__esModule",{value:!0}),wrapString.wrapString=void 0;const t=e(requireSliceAnsi()),n=e(requireStringWidth());return wrapString.wrapString=(e,r)=>{let i=e;const o=[];do{o.push((0,t.default)(i,0,r)),i=(0,t.default)(i,r).trim()}while((0,n.default)(i));return o},wrapString}var wrapWord={},hasRequiredWrapWord,hasRequiredWrapCell,hasRequiredCalculateCellHeight,hasRequiredCalculateRowHeights;function requireWrapWord(){if(hasRequiredWrapWord)return wrapWord;hasRequiredWrapWord=1;var e=wrapWord.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wrapWord,"__esModule",{value:!0}),wrapWord.wrapWord=void 0;const t=e(requireSliceAnsi()),n=e(requireStripAnsi());return wrapWord.wrapWord=(e,r)=>{const i=[];let o=0;return((e,t)=>{let r=(0,n.default)(e);const i=[],o=new RegExp("(^.{1,"+String(Math.max(t,1))+"}(\\s+|$))|(^.{1,"+String(Math.max(t-1,1))+"}(\\\\|/|_|\\.|,|;|-))");do{let e;const n=o.exec(r);if(n){e=n[0],r=r.slice(e.length);const t=e.trim().length,o=e.length-t;i.push([t,o])}else e=r.slice(0,t),r=r.slice(t),i.push([e.length,0])}while(r.length);return i})(e,r).forEach((([n,r])=>{i.push((0,t.default)(e,o,o+n)),o+=n+r})),i},wrapWord}function requireWrapCell(){if(hasRequiredWrapCell)return wrapCell;hasRequiredWrapCell=1,Object.defineProperty(wrapCell,"__esModule",{value:!0}),wrapCell.wrapCell=void 0;const e=requireUtils(),t=requireWrapString(),n=requireWrapWord();return wrapCell.wrapCell=(r,i,o)=>{const s=(0,e.splitAnsi)(r);for(let e=0;e(0,e.wrapCell)(t,n,r).length,calculateCellHeight}function requireCalculateRowHeights(){if(hasRequiredCalculateRowHeights)return calculateRowHeights;hasRequiredCalculateRowHeights=1,Object.defineProperty(calculateRowHeights,"__esModule",{value:!0}),calculateRowHeights.calculateRowHeights=void 0;const e=requireCalculateCellHeight(),t=requireUtils();return calculateRowHeights.calculateRowHeights=(n,r)=>{const i=[];for(const[o,s]of n.entries()){let a=1;s.forEach(((s,c)=>{var u;const l=null===(u=r.spanningCellManager)||void 0===u?void 0:u.getContainingRange({col:c,row:o});if(!l){const t=(0,e.calculateCellHeight)(s,r.columns[c].width,r.columns[c].wrapWord);return void(a=Math.max(a,t))}const{topLeft:d,bottomRight:p,height:f}=l;if(o===p.row){const e=(0,t.sumArray)(i.slice(d.row)),o=p.row-d.row,s=(0,t.sequence)(d.row+1,p.row).filter((e=>{var t;return!(null===(t=r.drawHorizontalLine)||void 0===t?void 0:t.call(r,e,n.length))})).length,c=f-e-o+s;a=Math.max(a,c)}})),i.push(a)}return i},calculateRowHeights}var drawBorder={},drawContent={},hasRequiredDrawContent,hasRequiredDrawBorder;function requireDrawContent(){if(hasRequiredDrawContent)return drawContent;hasRequiredDrawContent=1,Object.defineProperty(drawContent,"__esModule",{value:!0}),drawContent.drawContent=void 0;return drawContent.drawContent=e=>{const{contents:t,separatorGetter:n,drawSeparator:r,spanningCellManager:i,rowIndex:o,elementType:s}=e,a=t.length,c=[];return r(0,a)&&c.push(n(0,a)),t.forEach(((e,t)=>{if(s&&"border"!==s&&"row"!==s||c.push(e),"cell"===s&&void 0===o&&c.push(e),"cell"===s&&void 0!==o){const n=null==i?void 0:i.getContainingRange({col:t,row:o});n&&t!==n.topLeft.col||c.push(e)}if(t+1{const{separator:n,horizontalBorderIndex:r,spanningCellManager:i}=t;return e.map(((e,t)=>{const o=n.body.repeat(e);if(void 0===r)return o;const s=null==i?void 0:i.getContainingRange({col:t,row:r});if(!s)return o;const{topLeft:a}=s;return r===a.row?o:t!==a.col?"":s.extractBorderContent(r)}))};e.createSeparatorGetter=e=>{const{separator:t,spanningCellManager:n,horizontalBorderIndex:r,rowCount:i}=e;return(e,o)=>{const s=null==n?void 0:n.inSameRange;if(void 0!==r&&s){const n={col:e,row:r-1},a={col:e-1,row:r},c={col:e-1,row:r-1},u={col:e,row:r},l=[[c,n],[n,u],[u,a],[a,c]];if(0===e)return s(u,n)&&t.bodyJoinOuter?t.bodyJoinOuter:t.left;if(e===o)return s(c,a)&&t.bodyJoinOuter?t.bodyJoinOuter:t.right;if(0===r)return s(u,a)?t.body:t.join;if(r===i)return s(n,c)?t.body:t.join;const d=l.map((e=>s(...e))).filter(Boolean).length;if(0===d)return t.join;if(4===d)return"";if(2===d)return s(...l[1])&&s(...l[3])&&t.bodyJoinInner?t.bodyJoinInner:t.body;if(1===d){if(!(t.joinRight&&t.joinLeft&&t.joinUp&&t.joinDown))throw new Error(`Can not get border separator for position [${r}, ${e}]`);return s(...l[0])?t.joinDown:s(...l[1])?t.joinLeft:s(...l[2])?t.joinUp:t.joinRight}throw new Error("Invalid case")}return 0===e?t.left:e===o?t.right:t.join}};e.drawBorder=(n,r)=>{const i=(0,e.drawBorderSegments)(n,r),{drawVerticalLine:o,horizontalBorderIndex:s,spanningCellManager:a}=r;return(0,t.drawContent)({contents:i,drawSeparator:o,elementType:"border",rowIndex:s,separatorGetter:(0,e.createSeparatorGetter)(r),spanningCellManager:a})+"\n"};e.drawBorderTop=(t,n)=>{const{border:r}=n,i=(0,e.drawBorder)(t,{...n,separator:{body:r.topBody,join:r.topJoin,left:r.topLeft,right:r.topRight}});return"\n"===i?"":i};e.drawBorderJoin=(t,n)=>{const{border:r}=n;return(0,e.drawBorder)(t,{...n,separator:{body:r.joinBody,bodyJoinInner:r.bodyJoin,bodyJoinOuter:r.bodyLeft,join:r.joinJoin,joinDown:r.joinMiddleDown,joinLeft:r.joinMiddleLeft,joinRight:r.joinMiddleRight,joinUp:r.joinMiddleUp,left:r.joinLeft,right:r.joinRight}})};e.drawBorderBottom=(t,n)=>{const{border:r}=n;return(0,e.drawBorder)(t,{...n,separator:{body:r.bottomBody,join:r.bottomJoin,left:r.bottomLeft,right:r.bottomRight}})};e.createTableBorderGetter=(t,n)=>(r,i)=>{const o={...n,horizontalBorderIndex:r};return 0===r?(0,e.drawBorderTop)(t,o):r===i?(0,e.drawBorderBottom)(t,o):(0,e.drawBorderJoin)(t,o)}}(drawBorder)),drawBorder}var drawRow={},hasRequiredDrawRow;function requireDrawRow(){if(hasRequiredDrawRow)return drawRow;hasRequiredDrawRow=1,Object.defineProperty(drawRow,"__esModule",{value:!0}),drawRow.drawRow=void 0;const e=requireDrawContent();return drawRow.drawRow=(t,n)=>{const{border:r,drawVerticalLine:i,rowIndex:o,spanningCellManager:s}=n;return(0,e.drawContent)({contents:t,drawSeparator:i,elementType:"cell",rowIndex:o,separatorGetter:(e,t)=>0===e?r.bodyLeft:e===t?r.bodyRight:r.bodyJoin,spanningCellManager:s})+"\n"},drawRow}var makeStreamConfig={},validateConfig={},validators={},hasRequiredValidators,hasRequiredValidateConfig,hasRequiredMakeStreamConfig;function requireValidators(){return hasRequiredValidators||(hasRequiredValidators=1,function(e){e["config.json"]=function e(n,{instancePath:i="",parentData:s,parentDataProperty:c,rootData:u=n}={}){let l=null,d=0;if(n&&"object"==typeof n&&!Array.isArray(n)){for(const e in n)if("border"!==e&&"header"!==e&&"columns"!==e&&"columnDefault"!==e&&"drawVerticalLine"!==e&&"drawHorizontalLine"!==e&&"singleLine"!==e&&"spanningCells"!==e){const t={instancePath:i,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:e},message:"must NOT have additional properties"};null===l?l=[t]:l.push(t),d++}if(void 0!==n.border&&(o(n.border,{instancePath:i+"/border",parentData:n,parentDataProperty:"border",rootData:u})||(l=null===l?o.errors:l.concat(o.errors),d=l.length)),void 0!==n.header){let e=n.header;if(e&&"object"==typeof e&&!Array.isArray(e)){if(void 0===e.content){const e={instancePath:i+"/header",schemaPath:"#/properties/header/required",keyword:"required",params:{missingProperty:"content"},message:"must have required property 'content'"};null===l?l=[e]:l.push(e),d++}for(const t in e)if("content"!==t&&"alignment"!==t&&"wrapWord"!==t&&"truncate"!==t&&"paddingLeft"!==t&&"paddingRight"!==t){const e={instancePath:i+"/header",schemaPath:"#/properties/header/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:t},message:"must NOT have additional properties"};null===l?l=[e]:l.push(e),d++}if(void 0!==e.content&&"string"!=typeof e.content){const e={instancePath:i+"/header/content",schemaPath:"#/properties/header/properties/content/type",keyword:"type",params:{type:"string"},message:"must be string"};null===l?l=[e]:l.push(e),d++}if(void 0!==e.alignment&&(a(e.alignment,{instancePath:i+"/header/alignment",parentData:e,parentDataProperty:"alignment",rootData:u})||(l=null===l?a.errors:l.concat(a.errors),d=l.length)),void 0!==e.wrapWord&&"boolean"!=typeof e.wrapWord){const e={instancePath:i+"/header/wrapWord",schemaPath:"#/properties/header/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===l?l=[e]:l.push(e),d++}if(void 0!==e.truncate){let t=e.truncate;if("number"!=typeof t||t%1||isNaN(t)||!isFinite(t)){const e={instancePath:i+"/header/truncate",schemaPath:"#/properties/header/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),d++}}if(void 0!==e.paddingLeft){let t=e.paddingLeft;if("number"!=typeof t||t%1||isNaN(t)||!isFinite(t)){const e={instancePath:i+"/header/paddingLeft",schemaPath:"#/properties/header/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),d++}}if(void 0!==e.paddingRight){let t=e.paddingRight;if("number"!=typeof t||t%1||isNaN(t)||!isFinite(t)){const e={instancePath:i+"/header/paddingRight",schemaPath:"#/properties/header/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),d++}}}else{const e={instancePath:i+"/header",schemaPath:"#/properties/header/type",keyword:"type",params:{type:"object"},message:"must be object"};null===l?l=[e]:l.push(e),d++}}if(void 0!==n.columns&&(f(n.columns,{instancePath:i+"/columns",parentData:n,parentDataProperty:"columns",rootData:u})||(l=null===l?f.errors:l.concat(f.errors),d=l.length)),void 0!==n.columnDefault&&(_(n.columnDefault,{instancePath:i+"/columnDefault",parentData:n,parentDataProperty:"columnDefault",rootData:u})||(l=null===l?_.errors:l.concat(_.errors),d=l.length)),void 0!==n.drawVerticalLine&&"function"!=typeof n.drawVerticalLine){const e={instancePath:i+"/drawVerticalLine",schemaPath:"#/properties/drawVerticalLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};null===l?l=[e]:l.push(e),d++}if(void 0!==n.drawHorizontalLine&&"function"!=typeof n.drawHorizontalLine){const e={instancePath:i+"/drawHorizontalLine",schemaPath:"#/properties/drawHorizontalLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};null===l?l=[e]:l.push(e),d++}if(void 0!==n.singleLine&&"boolean"!=typeof n.singleLine){const e={instancePath:i+"/singleLine",schemaPath:"#/properties/singleLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};null===l?l=[e]:l.push(e),d++}if(void 0!==n.spanningCells){let e=n.spanningCells;if(Array.isArray(e)){const n=e.length;for(let o=0;o=",limit:0},message:"must be >= 0"};null===l?l=[e]:l.push(e),d++}}if(void 0!==n.row){let e=n.row;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:i+"/spanningCells/"+o+"/row",schemaPath:"#/properties/spanningCells/items/properties/row/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),d++}if("number"==typeof e&&isFinite(e)&&(e<0||isNaN(e))){const e={instancePath:i+"/spanningCells/"+o+"/row",schemaPath:"#/properties/spanningCells/items/properties/row/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};null===l?l=[e]:l.push(e),d++}}if(void 0!==n.colSpan){let e=n.colSpan;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:i+"/spanningCells/"+o+"/colSpan",schemaPath:"#/properties/spanningCells/items/properties/colSpan/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),d++}if("number"==typeof e&&isFinite(e)&&(e<1||isNaN(e))){const e={instancePath:i+"/spanningCells/"+o+"/colSpan",schemaPath:"#/properties/spanningCells/items/properties/colSpan/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};null===l?l=[e]:l.push(e),d++}}if(void 0!==n.rowSpan){let e=n.rowSpan;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:i+"/spanningCells/"+o+"/rowSpan",schemaPath:"#/properties/spanningCells/items/properties/rowSpan/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),d++}if("number"==typeof e&&isFinite(e)&&(e<1||isNaN(e))){const e={instancePath:i+"/spanningCells/"+o+"/rowSpan",schemaPath:"#/properties/spanningCells/items/properties/rowSpan/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};null===l?l=[e]:l.push(e),d++}}if(void 0!==n.alignment&&(a(n.alignment,{instancePath:i+"/spanningCells/"+o+"/alignment",parentData:n,parentDataProperty:"alignment",rootData:u})||(l=null===l?a.errors:l.concat(a.errors),d=l.length)),void 0!==n.verticalAlignment&&(m(n.verticalAlignment,{instancePath:i+"/spanningCells/"+o+"/verticalAlignment",parentData:n,parentDataProperty:"verticalAlignment",rootData:u})||(l=null===l?m.errors:l.concat(m.errors),d=l.length)),void 0!==n.wrapWord&&"boolean"!=typeof n.wrapWord){const e={instancePath:i+"/spanningCells/"+o+"/wrapWord",schemaPath:"#/properties/spanningCells/items/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===l?l=[e]:l.push(e),d++}if(void 0!==n.truncate){let e=n.truncate;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:i+"/spanningCells/"+o+"/truncate",schemaPath:"#/properties/spanningCells/items/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),d++}}if(void 0!==n.paddingLeft){let e=n.paddingLeft;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:i+"/spanningCells/"+o+"/paddingLeft",schemaPath:"#/properties/spanningCells/items/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),d++}}if(void 0!==n.paddingRight){let e=n.paddingRight;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:i+"/spanningCells/"+o+"/paddingRight",schemaPath:"#/properties/spanningCells/items/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===l?l=[e]:l.push(e),d++}}}else{const e={instancePath:i+"/spanningCells/"+o,schemaPath:"#/properties/spanningCells/items/type",keyword:"type",params:{type:"object"},message:"must be object"};null===l?l=[e]:l.push(e),d++}}}else{const e={instancePath:i+"/spanningCells",schemaPath:"#/properties/spanningCells/type",keyword:"type",params:{type:"array"},message:"must be array"};null===l?l=[e]:l.push(e),d++}}}else{const e={instancePath:i,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===l?l=[e]:l.push(e),d++}return e.errors=l,0===d};const t={$id:"config.json",$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{border:{$ref:"shared.json#/definitions/borders"},header:{type:"object",properties:{content:{type:"string"},alignment:{$ref:"shared.json#/definitions/alignment"},wrapWord:{type:"boolean"},truncate:{type:"integer"},paddingLeft:{type:"integer"},paddingRight:{type:"integer"}},required:["content"],additionalProperties:!1},columns:{$ref:"shared.json#/definitions/columns"},columnDefault:{$ref:"shared.json#/definitions/column"},drawVerticalLine:{typeof:"function"},drawHorizontalLine:{typeof:"function"},singleLine:{typeof:"boolean"},spanningCells:{type:"array",items:{type:"object",properties:{col:{type:"integer",minimum:0},row:{type:"integer",minimum:0},colSpan:{type:"integer",minimum:1},rowSpan:{type:"integer",minimum:1},alignment:{$ref:"shared.json#/definitions/alignment"},verticalAlignment:{$ref:"shared.json#/definitions/verticalAlignment"},wrapWord:{type:"boolean"},truncate:{type:"integer"},paddingLeft:{type:"integer"},paddingRight:{type:"integer"}},required:["row","col"],additionalProperties:!1}}},additionalProperties:!1},n={type:"object",properties:{topBody:{$ref:"#/definitions/border"},topJoin:{$ref:"#/definitions/border"},topLeft:{$ref:"#/definitions/border"},topRight:{$ref:"#/definitions/border"},bottomBody:{$ref:"#/definitions/border"},bottomJoin:{$ref:"#/definitions/border"},bottomLeft:{$ref:"#/definitions/border"},bottomRight:{$ref:"#/definitions/border"},bodyLeft:{$ref:"#/definitions/border"},bodyRight:{$ref:"#/definitions/border"},bodyJoin:{$ref:"#/definitions/border"},headerJoin:{$ref:"#/definitions/border"},joinBody:{$ref:"#/definitions/border"},joinLeft:{$ref:"#/definitions/border"},joinRight:{$ref:"#/definitions/border"},joinJoin:{$ref:"#/definitions/border"},joinMiddleUp:{$ref:"#/definitions/border"},joinMiddleDown:{$ref:"#/definitions/border"},joinMiddleLeft:{$ref:"#/definitions/border"},joinMiddleRight:{$ref:"#/definitions/border"}},additionalProperties:!1},r=Object.prototype.hasOwnProperty;function i(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,a=0;if("string"!=typeof e){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};null===s?s=[e]:s.push(e),a++}return i.errors=s,0===a}function o(e,{instancePath:t="",parentData:s,parentDataProperty:a,rootData:c=e}={}){let u=null,l=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const i in e)if(!r.call(n.properties,i)){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};null===u?u=[e]:u.push(e),l++}void 0!==e.topBody&&(i(e.topBody,{instancePath:t+"/topBody",parentData:e,parentDataProperty:"topBody",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.topJoin&&(i(e.topJoin,{instancePath:t+"/topJoin",parentData:e,parentDataProperty:"topJoin",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.topLeft&&(i(e.topLeft,{instancePath:t+"/topLeft",parentData:e,parentDataProperty:"topLeft",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.topRight&&(i(e.topRight,{instancePath:t+"/topRight",parentData:e,parentDataProperty:"topRight",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.bottomBody&&(i(e.bottomBody,{instancePath:t+"/bottomBody",parentData:e,parentDataProperty:"bottomBody",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.bottomJoin&&(i(e.bottomJoin,{instancePath:t+"/bottomJoin",parentData:e,parentDataProperty:"bottomJoin",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.bottomLeft&&(i(e.bottomLeft,{instancePath:t+"/bottomLeft",parentData:e,parentDataProperty:"bottomLeft",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.bottomRight&&(i(e.bottomRight,{instancePath:t+"/bottomRight",parentData:e,parentDataProperty:"bottomRight",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.bodyLeft&&(i(e.bodyLeft,{instancePath:t+"/bodyLeft",parentData:e,parentDataProperty:"bodyLeft",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.bodyRight&&(i(e.bodyRight,{instancePath:t+"/bodyRight",parentData:e,parentDataProperty:"bodyRight",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.bodyJoin&&(i(e.bodyJoin,{instancePath:t+"/bodyJoin",parentData:e,parentDataProperty:"bodyJoin",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.headerJoin&&(i(e.headerJoin,{instancePath:t+"/headerJoin",parentData:e,parentDataProperty:"headerJoin",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.joinBody&&(i(e.joinBody,{instancePath:t+"/joinBody",parentData:e,parentDataProperty:"joinBody",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.joinLeft&&(i(e.joinLeft,{instancePath:t+"/joinLeft",parentData:e,parentDataProperty:"joinLeft",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.joinRight&&(i(e.joinRight,{instancePath:t+"/joinRight",parentData:e,parentDataProperty:"joinRight",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.joinJoin&&(i(e.joinJoin,{instancePath:t+"/joinJoin",parentData:e,parentDataProperty:"joinJoin",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.joinMiddleUp&&(i(e.joinMiddleUp,{instancePath:t+"/joinMiddleUp",parentData:e,parentDataProperty:"joinMiddleUp",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.joinMiddleDown&&(i(e.joinMiddleDown,{instancePath:t+"/joinMiddleDown",parentData:e,parentDataProperty:"joinMiddleDown",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.joinMiddleLeft&&(i(e.joinMiddleLeft,{instancePath:t+"/joinMiddleLeft",parentData:e,parentDataProperty:"joinMiddleLeft",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length)),void 0!==e.joinMiddleRight&&(i(e.joinMiddleRight,{instancePath:t+"/joinMiddleRight",parentData:e,parentDataProperty:"joinMiddleRight",rootData:c})||(u=null===u?i.errors:u.concat(i.errors),l=u.length))}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===u?u=[e]:u.push(e),l++}return o.errors=u,0===l}const s={type:"string",enum:["left","right","center","justify"]};function a(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:i=e}={}){let o=null,c=0;if("string"!=typeof e){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};null===o?o=[e]:o.push(e),c++}if("left"!==e&&"right"!==e&&"center"!==e&&"justify"!==e){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:s.enum},message:"must be equal to one of the allowed values"};null===o?o=[e]:o.push(e),c++}return a.errors=o,0===c}requireEqual().default;const c=new RegExp("^[0-9]+$","u");function u(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:i=e}={}){let o=null,a=0;if("string"!=typeof e){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};null===o?o=[e]:o.push(e),a++}if("left"!==e&&"right"!==e&&"center"!==e&&"justify"!==e){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:s.enum},message:"must be equal to one of the allowed values"};null===o?o=[e]:o.push(e),a++}return u.errors=o,0===a}const l={type:"string",enum:["top","middle","bottom"]};function d(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:i=e}={}){let o=null,s=0;if("string"!=typeof e){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};null===o?o=[e]:o.push(e),s++}if("top"!==e&&"middle"!==e&&"bottom"!==e){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:l.enum},message:"must be equal to one of the allowed values"};null===o?o=[e]:o.push(e),s++}return d.errors=o,0===s}function p(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:i=e}={}){let o=null,s=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const n in e)if("alignment"!==n&&"verticalAlignment"!==n&&"width"!==n&&"wrapWord"!==n&&"truncate"!==n&&"paddingLeft"!==n&&"paddingRight"!==n){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};null===o?o=[e]:o.push(e),s++}if(void 0!==e.alignment&&(u(e.alignment,{instancePath:t+"/alignment",parentData:e,parentDataProperty:"alignment",rootData:i})||(o=null===o?u.errors:o.concat(u.errors),s=o.length)),void 0!==e.verticalAlignment&&(d(e.verticalAlignment,{instancePath:t+"/verticalAlignment",parentData:e,parentDataProperty:"verticalAlignment",rootData:i})||(o=null===o?d.errors:o.concat(d.errors),s=o.length)),void 0!==e.width){let n=e.width;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/width",schemaPath:"#/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}if("number"==typeof n&&isFinite(n)&&(n<1||isNaN(n))){const e={instancePath:t+"/width",schemaPath:"#/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};null===o?o=[e]:o.push(e),s++}}if(void 0!==e.wrapWord&&"boolean"!=typeof e.wrapWord){const e={instancePath:t+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===o?o=[e]:o.push(e),s++}if(void 0!==e.truncate){let n=e.truncate;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}}if(void 0!==e.paddingLeft){let n=e.paddingLeft;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}}if(void 0!==e.paddingRight){let n=e.paddingRight;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===o?o=[e]:o.push(e),s++}return p.errors=o,0===s}function f(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:i=e}={}){let o=null,s=0;const a=s;let u=!1,l=null;const d=s;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const n in e)if(!c.test(n)){const e={instancePath:t,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};null===o?o=[e]:o.push(e),s++}for(const n in e)c.test(n)&&(p(e[n],{instancePath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:n,rootData:i})||(o=null===o?p.errors:o.concat(p.errors),s=o.length))}else{const e={instancePath:t,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};null===o?o=[e]:o.push(e),s++}(m=d===s)&&(u=!0,l=0);const _=s;if(Array.isArray(e)){const n=e.length;for(let r=0;r=",limit:1},message:"must be >= 1"};null===o?o=[e]:o.push(e),s++}}if(void 0!==e.wrapWord&&"boolean"!=typeof e.wrapWord){const e={instancePath:t+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===o?o=[e]:o.push(e),s++}if(void 0!==e.truncate){let n=e.truncate;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}}if(void 0!==e.paddingLeft){let n=e.paddingLeft;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}}if(void 0!==e.paddingRight){let n=e.paddingRight;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===o?o=[e]:o.push(e),s++}return _.errors=o,0===s}function m(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:i=e}={}){let o=null,s=0;if("string"!=typeof e){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};null===o?o=[e]:o.push(e),s++}if("top"!==e&&"middle"!==e&&"bottom"!==e){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:l.enum},message:"must be equal to one of the allowed values"};null===o?o=[e]:o.push(e),s++}return m.errors=o,0===s}function h(e,{instancePath:t="",parentData:o,parentDataProperty:s,rootData:a=e}={}){let c=null,u=0;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const i in e)if(!r.call(n.properties,i)){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};null===c?c=[e]:c.push(e),u++}void 0!==e.topBody&&(i(e.topBody,{instancePath:t+"/topBody",parentData:e,parentDataProperty:"topBody",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.topJoin&&(i(e.topJoin,{instancePath:t+"/topJoin",parentData:e,parentDataProperty:"topJoin",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.topLeft&&(i(e.topLeft,{instancePath:t+"/topLeft",parentData:e,parentDataProperty:"topLeft",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.topRight&&(i(e.topRight,{instancePath:t+"/topRight",parentData:e,parentDataProperty:"topRight",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bottomBody&&(i(e.bottomBody,{instancePath:t+"/bottomBody",parentData:e,parentDataProperty:"bottomBody",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bottomJoin&&(i(e.bottomJoin,{instancePath:t+"/bottomJoin",parentData:e,parentDataProperty:"bottomJoin",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bottomLeft&&(i(e.bottomLeft,{instancePath:t+"/bottomLeft",parentData:e,parentDataProperty:"bottomLeft",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bottomRight&&(i(e.bottomRight,{instancePath:t+"/bottomRight",parentData:e,parentDataProperty:"bottomRight",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bodyLeft&&(i(e.bodyLeft,{instancePath:t+"/bodyLeft",parentData:e,parentDataProperty:"bodyLeft",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bodyRight&&(i(e.bodyRight,{instancePath:t+"/bodyRight",parentData:e,parentDataProperty:"bodyRight",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.bodyJoin&&(i(e.bodyJoin,{instancePath:t+"/bodyJoin",parentData:e,parentDataProperty:"bodyJoin",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.headerJoin&&(i(e.headerJoin,{instancePath:t+"/headerJoin",parentData:e,parentDataProperty:"headerJoin",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinBody&&(i(e.joinBody,{instancePath:t+"/joinBody",parentData:e,parentDataProperty:"joinBody",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinLeft&&(i(e.joinLeft,{instancePath:t+"/joinLeft",parentData:e,parentDataProperty:"joinLeft",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinRight&&(i(e.joinRight,{instancePath:t+"/joinRight",parentData:e,parentDataProperty:"joinRight",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinJoin&&(i(e.joinJoin,{instancePath:t+"/joinJoin",parentData:e,parentDataProperty:"joinJoin",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinMiddleUp&&(i(e.joinMiddleUp,{instancePath:t+"/joinMiddleUp",parentData:e,parentDataProperty:"joinMiddleUp",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinMiddleDown&&(i(e.joinMiddleDown,{instancePath:t+"/joinMiddleDown",parentData:e,parentDataProperty:"joinMiddleDown",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinMiddleLeft&&(i(e.joinMiddleLeft,{instancePath:t+"/joinMiddleLeft",parentData:e,parentDataProperty:"joinMiddleLeft",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length)),void 0!==e.joinMiddleRight&&(i(e.joinMiddleRight,{instancePath:t+"/joinMiddleRight",parentData:e,parentDataProperty:"joinMiddleRight",rootData:a})||(c=null===c?i.errors:c.concat(i.errors),u=c.length))}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===c?c=[e]:c.push(e),u++}return h.errors=c,0===u}function g(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:i=e}={}){let o=null,s=0;const a=s;let u=!1,l=null;const d=s;if(e&&"object"==typeof e&&!Array.isArray(e)){for(const n in e)if(!c.test(n)){const e={instancePath:t,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};null===o?o=[e]:o.push(e),s++}for(const n in e)c.test(n)&&(p(e[n],{instancePath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:n,rootData:i})||(o=null===o?p.errors:o.concat(p.errors),s=o.length))}else{const e={instancePath:t,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};null===o?o=[e]:o.push(e),s++}(_=d===s)&&(u=!0,l=0);const f=s;if(Array.isArray(e)){const n=e.length;for(let r=0;r=",limit:1},message:"must be >= 1"};null===o?o=[e]:o.push(e),s++}}if(void 0!==e.wrapWord&&"boolean"!=typeof e.wrapWord){const e={instancePath:t+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};null===o?o=[e]:o.push(e),s++}if(void 0!==e.truncate){let n=e.truncate;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}}if(void 0!==e.paddingLeft){let n=e.paddingLeft;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}}if(void 0!==e.paddingRight){let n=e.paddingRight;if("number"!=typeof n||n%1||isNaN(n)||!isFinite(n)){const e={instancePath:t+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===o?o=[e]:o.push(e),s++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===o?o=[e]:o.push(e),s++}return A.errors=o,0===s}e["streamConfig.json"]=function e(t,{instancePath:n="",parentData:r,parentDataProperty:i,rootData:o=t}={}){let s=null,a=0;if(t&&"object"==typeof t&&!Array.isArray(t)){if(void 0===t.columnDefault){const e={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"columnDefault"},message:"must have required property 'columnDefault'"};null===s?s=[e]:s.push(e),a++}if(void 0===t.columnCount){const e={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"columnCount"},message:"must have required property 'columnCount'"};null===s?s=[e]:s.push(e),a++}for(const e in t)if("border"!==e&&"columns"!==e&&"columnDefault"!==e&&"columnCount"!==e&&"drawVerticalLine"!==e){const t={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:e},message:"must NOT have additional properties"};null===s?s=[t]:s.push(t),a++}if(void 0!==t.border&&(h(t.border,{instancePath:n+"/border",parentData:t,parentDataProperty:"border",rootData:o})||(s=null===s?h.errors:s.concat(h.errors),a=s.length)),void 0!==t.columns&&(g(t.columns,{instancePath:n+"/columns",parentData:t,parentDataProperty:"columns",rootData:o})||(s=null===s?g.errors:s.concat(g.errors),a=s.length)),void 0!==t.columnDefault&&(A(t.columnDefault,{instancePath:n+"/columnDefault",parentData:t,parentDataProperty:"columnDefault",rootData:o})||(s=null===s?A.errors:s.concat(A.errors),a=s.length)),void 0!==t.columnCount){let e=t.columnCount;if("number"!=typeof e||e%1||isNaN(e)||!isFinite(e)){const e={instancePath:n+"/columnCount",schemaPath:"#/properties/columnCount/type",keyword:"type",params:{type:"integer"},message:"must be integer"};null===s?s=[e]:s.push(e),a++}if("number"==typeof e&&isFinite(e)&&(e<1||isNaN(e))){const e={instancePath:n+"/columnCount",schemaPath:"#/properties/columnCount/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};null===s?s=[e]:s.push(e),a++}}if(void 0!==t.drawVerticalLine&&"function"!=typeof t.drawVerticalLine){const e={instancePath:n+"/drawVerticalLine",schemaPath:"#/properties/drawVerticalLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};null===s?s=[e]:s.push(e),a++}}else{const e={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};null===s?s=[e]:s.push(e),a++}return e.errors=s,0===a}}(validators)),validators}function requireValidateConfig(){if(hasRequiredValidateConfig)return validateConfig;hasRequiredValidateConfig=1;var e=validateConfig.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(validateConfig,"__esModule",{value:!0}),validateConfig.validateConfig=void 0;const t=e(requireValidators());return validateConfig.validateConfig=(e,n)=>{const r=t.default[e];if(!r(n)&&r.errors){const e=r.errors.map((e=>({message:e.message,params:e.params,schemaPath:e.schemaPath})));throw console.log("config",n),console.log("errors",e),new Error("Invalid config.")}},validateConfig}function requireMakeStreamConfig(){if(hasRequiredMakeStreamConfig)return makeStreamConfig;hasRequiredMakeStreamConfig=1,Object.defineProperty(makeStreamConfig,"__esModule",{value:!0}),makeStreamConfig.makeStreamConfig=void 0;const e=requireUtils(),t=requireValidateConfig(),n=(e,t={},n)=>Array.from({length:e}).map(((e,r)=>({alignment:"left",paddingLeft:1,paddingRight:1,truncate:Number.POSITIVE_INFINITY,verticalAlignment:"top",wrapWord:!1,...n,...t[r]})));return makeStreamConfig.makeStreamConfig=r=>{if((0,t.validateConfig)("streamConfig.json",r),void 0===r.columnDefault.width)throw new Error("Must provide config.columnDefault.width when creating a stream.");return{drawVerticalLine:()=>!0,...r,border:(0,e.makeBorderConfig)(r.border),columns:n(r.columnCount,r.columns,r.columnDefault)}},makeStreamConfig}var mapDataUsingRowHeights={},hasRequiredMapDataUsingRowHeights;function requireMapDataUsingRowHeights(){return hasRequiredMapDataUsingRowHeights||(hasRequiredMapDataUsingRowHeights=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mapDataUsingRowHeights=e.padCellVertically=void 0;const t=requireUtils(),n=requireWrapCell(),r=e=>new Array(e).fill("");e.padCellVertically=(e,t,n)=>{const i=t-e.length;return"top"===n?[...e,...r(i)]:"bottom"===n?[...r(i),...e]:[...r(Math.floor(i/2)),...e,...r(Math.ceil(i/2))]};e.mapDataUsingRowHeights=(r,i,o)=>{const s=r[0].length,a=r.map(((t,r)=>{const a=i[r],c=Array.from({length:a},(()=>new Array(s).fill("")));return t.forEach(((t,i)=>{var s;const u=null===(s=o.spanningCellManager)||void 0===s?void 0:s.getContainingRange({col:i,row:r});if(u)return void u.extractCellContent(r).forEach(((e,t)=>{c[t][i]=e}));const l=(0,n.wrapCell)(t,o.columns[i].width,o.columns[i].wrapWord);(0,e.padCellVertically)(l,a,o.columns[i].verticalAlignment).forEach(((e,t)=>{c[t][i]=e}))})),c}));return(0,t.flatten)(a)}}(mapDataUsingRowHeights)),mapDataUsingRowHeights}var padTableData={},hasRequiredPadTableData;function requirePadTableData(){return hasRequiredPadTableData||(hasRequiredPadTableData=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.padTableData=e.padString=void 0;e.padString=(e,t,n)=>" ".repeat(t)+e+" ".repeat(n);e.padTableData=(t,n)=>t.map(((t,r)=>t.map(((t,i)=>{var o;if(null===(o=n.spanningCellManager)||void 0===o?void 0:o.getContainingRange({col:i,row:r},{mapped:!0}))return t;const{paddingLeft:s,paddingRight:a}=n.columns[i];return(0,e.padString)(t,s,a)}))))}(padTableData)),padTableData}var stringifyTableData={},hasRequiredStringifyTableData;function requireStringifyTableData(){if(hasRequiredStringifyTableData)return stringifyTableData;hasRequiredStringifyTableData=1,Object.defineProperty(stringifyTableData,"__esModule",{value:!0}),stringifyTableData.stringifyTableData=void 0;const e=requireUtils();return stringifyTableData.stringifyTableData=t=>t.map((t=>t.map((t=>(0,e.normalizeString)(String(t)))))),stringifyTableData}var truncateTableData={},lodash_truncate={exports:{}},hasRequiredLodash_truncate,hasRequiredTruncateTableData,hasRequiredCreateStream;function requireLodash_truncate(){return hasRequiredLodash_truncate||(hasRequiredLodash_truncate=1,function(e,t){var n,r=1/0,i=NaN,o=/^\s+|\s+$/g,s=/\w*$/,a=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l="\\ud800-\\udfff",d="\\u0300-\\u036f\\ufe20-\\ufe23",p="\\u20d0-\\u20f0",f="\\ufe0e\\ufe0f",_="["+l+"]",m="["+d+p+"]",h="\\ud83c[\\udffb-\\udfff]",g="[^"+l+"]",A="(?:\\ud83c[\\udde6-\\uddff]){2}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",b="(?:"+m+"|"+h+")"+"?",C="["+f+"]?",E=C+b+("(?:"+v+"(?:"+[g,A,y].join("|")+")"+C+b+")*"),x="(?:"+[g+m+"?",m,A,y,_].join("|")+")",S=RegExp(h+"(?="+h+")|"+x+E,"g"),k=RegExp("["+v+l+d+p+f+"]"),D=parseInt,w="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,I="object"==typeof self&&self&&self.Object===Object&&self,T=w||I||Function("return this")(),R=t&&!t.nodeType&&t,F=R&&e&&!e.nodeType&&e,P=F&&F.exports===R&&w.process,N=function(){try{return P&&P.binding("util")}catch(e){}}(),B=N&&N.isRegExp,O=(n="length",function(e){return null==e?void 0:e[n]});function q(e){return k.test(e)}function $(e){return q(e)?function(e){var t=S.lastIndex=0;for(;S.test(e);)t++;return t}(e):O(e)}function Q(e){return q(e)?function(e){return e.match(S)||[]}(e):function(e){return e.split("")}(e)}var L=Object.prototype.toString,M=T.Symbol,j=M?M.prototype:void 0,U=j?j.toString:void 0;function J(e){if("string"==typeof e)return e;if(z(e))return U?U.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function V(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r=o)return e;var c=n-$(r);if(c<1)return r;var u=a?V(a,0,c).join(""):e.slice(0,c);if(void 0===i)return u+r;if(a&&(c+=u.length-c),W(i)){if(e.slice(c).search(i)){var l,d=u;for(i.global||(i=RegExp(i.source,K(s.exec(i))+"g")),i.lastIndex=0;l=i.exec(d);)var p=l.index;u=u.slice(0,void 0===p?c:p)}}else if(e.indexOf(J(i),c)!=c){var f=u.lastIndexOf(i);f>-1&&(u=u.slice(0,f))}return u+r}}(lodash_truncate,lodash_truncate.exports)),lodash_truncate.exports}function requireTruncateTableData(){return hasRequiredTruncateTableData||(hasRequiredTruncateTableData=1,function(e){var t=truncateTableData.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.truncateTableData=e.truncateString=void 0;const n=t(requireLodash_truncate());e.truncateString=(e,t)=>(0,n.default)(e,{length:t,omission:"…"});e.truncateTableData=(t,n)=>t.map((t=>t.map(((t,r)=>(0,e.truncateString)(t,n[r])))))}(truncateTableData)),truncateTableData}function requireCreateStream(){if(hasRequiredCreateStream)return createStream;hasRequiredCreateStream=1,Object.defineProperty(createStream,"__esModule",{value:!0}),createStream.createStream=void 0;const e=requireAlignTableData(),t=requireCalculateRowHeights(),n=requireDrawBorder(),r=requireDrawRow(),i=requireMakeStreamConfig(),o=requireMapDataUsingRowHeights(),s=requirePadTableData(),a=requireStringifyTableData(),c=requireTruncateTableData(),u=requireUtils(),l=(n,r)=>{let i=(0,a.stringifyTableData)(n);i=(0,c.truncateTableData)(i,(0,u.extractTruncates)(r));const l=(0,t.calculateRowHeights)(i,r);return i=(0,o.mapDataUsingRowHeights)(i,l,r),i=(0,e.alignTableData)(i,r),i=(0,s.padTableData)(i,r),i};return createStream.createStream=e=>{const t=(0,i.makeStreamConfig)(e),o=Object.values(t.columns).map((e=>e.width+e.paddingLeft+e.paddingRight));let s=!0;return{write:e=>{if(e.length!==t.columnCount)throw new Error("Row cell count does not match the config.columnCount.");s?(s=!1,((e,t,i)=>{const o=l([e],i).map((e=>(0,r.drawRow)(e,i))).join("");let s;s="",s+=(0,n.drawBorderTop)(t,i),s+=o,s+=(0,n.drawBorderBottom)(t,i),s=s.trimEnd(),process.stdout.write(s)})(e,o,t)):((e,t,i)=>{const o=l([e],i).map((e=>(0,r.drawRow)(e,i))).join("");let s="";const a=(0,n.drawBorderBottom)(t,i);"\n"!==a&&(s="\r"),s+=(0,n.drawBorderJoin)(t,i),s+=o,s+=a,s=s.trimEnd(),process.stdout.write(s)})(e,o,t)}}},createStream}lodash_truncate.exports;var table={},calculateOutputColumnWidths={},hasRequiredCalculateOutputColumnWidths;function requireCalculateOutputColumnWidths(){if(hasRequiredCalculateOutputColumnWidths)return calculateOutputColumnWidths;hasRequiredCalculateOutputColumnWidths=1,Object.defineProperty(calculateOutputColumnWidths,"__esModule",{value:!0}),calculateOutputColumnWidths.calculateOutputColumnWidths=void 0;return calculateOutputColumnWidths.calculateOutputColumnWidths=e=>e.columns.map((e=>e.paddingLeft+e.width+e.paddingRight)),calculateOutputColumnWidths}var drawTable={},hasRequiredDrawTable;function requireDrawTable(){if(hasRequiredDrawTable)return drawTable;hasRequiredDrawTable=1,Object.defineProperty(drawTable,"__esModule",{value:!0}),drawTable.drawTable=void 0;const e=requireDrawBorder(),t=requireDrawContent(),n=requireDrawRow(),r=requireUtils();return drawTable.drawTable=(i,o,s,a)=>{const{drawHorizontalLine:c,singleLine:u}=a,l=(0,r.groupBySizes)(i,s).map(((e,t)=>e.map((e=>(0,n.drawRow)(e,{...a,rowIndex:t}))).join("")));return(0,t.drawContent)({contents:l,drawSeparator:(e,t)=>(0===e||e===t||!u)&&c(e,t),elementType:"row",rowIndex:-1,separatorGetter:(0,e.createTableBorderGetter)(o,{...a,rowCount:l.length}),spanningCellManager:a.spanningCellManager})},drawTable}var injectHeaderConfig={},hasRequiredInjectHeaderConfig;function requireInjectHeaderConfig(){if(hasRequiredInjectHeaderConfig)return injectHeaderConfig;hasRequiredInjectHeaderConfig=1,Object.defineProperty(injectHeaderConfig,"__esModule",{value:!0}),injectHeaderConfig.injectHeaderConfig=void 0;return injectHeaderConfig.injectHeaderConfig=(e,t)=>{var n;let r=null!==(n=t.spanningCells)&&void 0!==n?n:[];const i=t.header,o=[...e];if(i){r=r.map((({row:e,...t})=>({...t,row:e+1})));const{content:t,...n}=i;r.unshift({alignment:"center",col:0,colSpan:e[0].length,paddingLeft:1,paddingRight:1,row:0,wrapWord:!1,...n}),o.unshift([t,...Array.from({length:e[0].length-1}).fill("")])}return[o,r]},injectHeaderConfig}var makeTableConfig={},calculateMaximumColumnWidths={},hasRequiredCalculateMaximumColumnWidths;function requireCalculateMaximumColumnWidths(){return hasRequiredCalculateMaximumColumnWidths||(hasRequiredCalculateMaximumColumnWidths=1,function(e){var t=calculateMaximumColumnWidths.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.calculateMaximumColumnWidths=e.calculateMaximumCellWidth=void 0;const n=t(requireStringWidth()),r=requireUtils();e.calculateMaximumCellWidth=e=>Math.max(...e.split("\n").map(n.default));e.calculateMaximumColumnWidths=(t,n=[])=>{const i=new Array(t[0].length).fill(0),o=n.map(r.calculateRangeCoordinate);return t.forEach(((t,n)=>{t.forEach(((t,s)=>{((e,t)=>o.some((n=>(0,r.isCellInRange)({col:t,row:e},n))))(n,s)||(i[s]=Math.max(i[s],(0,e.calculateMaximumCellWidth)(t)))}))})),i}}(calculateMaximumColumnWidths)),calculateMaximumColumnWidths}var spanningCellManager={},alignSpanningCell={},hasRequiredAlignSpanningCell;function requireAlignSpanningCell(){if(hasRequiredAlignSpanningCell)return alignSpanningCell;hasRequiredAlignSpanningCell=1;var e=alignSpanningCell.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(alignSpanningCell,"__esModule",{value:!0}),alignSpanningCell.alignVerticalRangeContent=alignSpanningCell.wrapRangeContent=void 0;const t=e(requireStringWidth()),n=requireAlignString(),r=requireMapDataUsingRowHeights(),i=requirePadTableData(),o=requireTruncateTableData(),s=requireUtils(),a=requireWrapCell();alignSpanningCell.wrapRangeContent=(e,t,r)=>{const{topLeft:s,paddingRight:c,paddingLeft:u,truncate:l,wrapWord:d,alignment:p}=e,f=r.rows[s.row][s.col],_=t-u-c;return(0,a.wrapCell)((0,o.truncateString)(f,l),_,d).map((e=>{const t=(0,n.alignString)(e,_,p);return(0,i.padString)(t,u,c)}))};return alignSpanningCell.alignVerticalRangeContent=(e,n,i)=>{const{rows:o,drawHorizontalLine:a,rowHeights:c}=i,{topLeft:u,bottomRight:l,verticalAlignment:d}=e;if(0===c.length)return[];const p=(0,s.sumArray)(c.slice(u.row,l.row+1))+(l.row-u.row)-(0,s.sequence)(u.row+1,l.row).filter((e=>!a(e,o.length))).length;return(0,r.padCellVertically)(n,p,d).map((e=>0===e.length?" ".repeat((0,t.default)(n[0])):e))},alignSpanningCell}var calculateSpanningCellWidth={},hasRequiredCalculateSpanningCellWidth;function requireCalculateSpanningCellWidth(){if(hasRequiredCalculateSpanningCellWidth)return calculateSpanningCellWidth;hasRequiredCalculateSpanningCellWidth=1,Object.defineProperty(calculateSpanningCellWidth,"__esModule",{value:!0}),calculateSpanningCellWidth.calculateSpanningCellWidth=void 0;const e=requireUtils();return calculateSpanningCellWidth.calculateSpanningCellWidth=(t,n)=>{const{columnsConfig:r,drawVerticalLine:i}=n,{topLeft:o,bottomRight:s}=t;return(0,e.sumArray)(r.slice(o.col,s.col+1).map((({width:e})=>e)))+(o.col===s.col?r[o.col].paddingRight+r[s.col].paddingLeft:(0,e.sumArray)(r.slice(o.col,s.col+1).map((({paddingLeft:e,paddingRight:t})=>e+t))))+(s.col-o.col)-(0,e.sequence)(o.col+1,s.col).filter((e=>!i(e,r.length))).length},calculateSpanningCellWidth}var makeRangeConfig={},hasRequiredMakeRangeConfig,hasRequiredSpanningCellManager;function requireMakeRangeConfig(){if(hasRequiredMakeRangeConfig)return makeRangeConfig;hasRequiredMakeRangeConfig=1,Object.defineProperty(makeRangeConfig,"__esModule",{value:!0}),makeRangeConfig.makeRangeConfig=void 0;const e=requireUtils();return makeRangeConfig.makeRangeConfig=(t,n)=>{var r;const{topLeft:i,bottomRight:o}=(0,e.calculateRangeCoordinate)(t);return{...{...n[i.col],...t,paddingRight:null!==(r=t.paddingRight)&&void 0!==r?r:n[o.col].paddingRight},bottomRight:o,topLeft:i}},makeRangeConfig}function requireSpanningCellManager(){if(hasRequiredSpanningCellManager)return spanningCellManager;hasRequiredSpanningCellManager=1,Object.defineProperty(spanningCellManager,"__esModule",{value:!0}),spanningCellManager.createSpanningCellManager=void 0;const e=requireAlignSpanningCell(),t=requireCalculateSpanningCellWidth(),n=requireMakeRangeConfig(),r=requireUtils(),i=(e,t)=>t.find((t=>(0,r.isCellInRange)(e,t))),o=(n,i)=>{const o=(0,t.calculateSpanningCellWidth)(n,i),s=(0,e.wrapRangeContent)(n,o,i),a=(0,e.alignVerticalRangeContent)(n,s,i);return{...n,extractBorderContent:e=>{const{topLeft:t}=n,o=(0,r.sumArray)(i.rowHeights.slice(t.row,e))+(e-t.row-1);return a[o]},extractCellContent:e=>{const{topLeft:t}=n,{drawHorizontalLine:o,rowHeights:s}=i,c=e-t.row,u=(0,r.sequence)(t.row+1,e).filter((e=>!(null==o?void 0:o(e,s.length)))).length,l=(0,r.sumArray)(s.slice(t.row,e))+c-u;return a.slice(l,l+s[e])},height:s.length,width:o}};return spanningCellManager.createSpanningCellManager=e=>{const{spanningCellConfigs:t,columnsConfig:s}=e,a=t.map((e=>(0,n.makeRangeConfig)(e,s))),c={};let u=[],l=[];return{getContainingRange:(t,n)=>{var r;const s=(null==n?void 0:n.mapped)?l[t.row]:t.row,d=i({...t,row:s},a);if(!d)return;if(0===u.length)return o(d,{...e,rowHeights:u});const p=(e=>{const{row:t,col:n}=e.topLeft;return`${t}/${n}`})(d);return null!==(r=c[p])&&void 0!==r||(c[p]=o(d,{...e,rowHeights:u})),c[p]},inSameRange:(e,t)=>((e,t,n)=>{const o=i(e,n),s=i(t,n);return!(!o||!s)&&(0,r.areCellEqual)(o.topLeft,s.topLeft)})(e,t,a),rowHeights:u,rowIndexMapping:l,setRowHeights:e=>{u=e},setRowIndexMapping:e=>{l=(0,r.flatten)(e.map(((e,t)=>Array.from({length:e},(()=>t)))))}}},spanningCellManager}var validateSpanningCellConfig={},hasRequiredValidateSpanningCellConfig,hasRequiredMakeTableConfig;function requireValidateSpanningCellConfig(){if(hasRequiredValidateSpanningCellConfig)return validateSpanningCellConfig;hasRequiredValidateSpanningCellConfig=1,Object.defineProperty(validateSpanningCellConfig,"__esModule",{value:!0}),validateSpanningCellConfig.validateSpanningCellConfig=void 0;const e=requireUtils(),t=(e,t,n)=>e<=n&&n<=t;return validateSpanningCellConfig.validateSpanningCellConfig=(n,r)=>{const[i,o]=[n.length,n[0].length];r.forEach(((e,t)=>{const{colSpan:n,rowSpan:r}=e;if(void 0===n&&void 0===r)throw new Error(`Expect at least colSpan or rowSpan is provided in config.spanningCells[${t}]`);if(void 0!==n&&n<1)throw new Error(`Expect colSpan is not equal zero, instead got: ${n} in config.spanningCells[${t}]`);if(void 0!==r&&r<1)throw new Error(`Expect rowSpan is not equal zero, instead got: ${r} in config.spanningCells[${t}]`)}));const s=r.map(e.calculateRangeCoordinate);s.forEach((({topLeft:e,bottomRight:n},r)=>{if(!(t(0,o-1,e.col)&&t(0,i-1,e.row)&&t(0,o-1,n.col)&&t(0,i-1,n.row)))throw new Error(`Some cells in config.spanningCells[${r}] are out of the table`)}));const a=Array.from({length:i},(()=>Array.from({length:o})));s.forEach((({topLeft:t,bottomRight:n},r)=>{(0,e.sequence)(t.row,n.row).forEach((i=>{(0,e.sequence)(t.col,n.col).forEach((e=>{if(void 0!==a[i][e])throw new Error(`Spanning cells in config.spanningCells[${a[i][e]}] and config.spanningCells[${r}] are overlap each other`);a[i][e]=r}))}))}))},validateSpanningCellConfig}function requireMakeTableConfig(){if(hasRequiredMakeTableConfig)return makeTableConfig;hasRequiredMakeTableConfig=1,Object.defineProperty(makeTableConfig,"__esModule",{value:!0}),makeTableConfig.makeTableConfig=void 0;const e=requireCalculateMaximumColumnWidths(),t=requireSpanningCellManager(),n=requireUtils(),r=requireValidateConfig(),i=requireValidateSpanningCellConfig();return makeTableConfig.makeTableConfig=(o,s={},a)=>{var c,u,l,d,p;(0,r.validateConfig)("config.json",s),(0,i.validateSpanningCellConfig)(o,null!==(c=s.spanningCells)&&void 0!==c?c:[]);const f=null!==(u=null!=a?a:s.spanningCells)&&void 0!==u?u:[],_=((t,n,r,i)=>{const o=(0,e.calculateMaximumColumnWidths)(t,i);return t[0].map(((e,t)=>({alignment:"left",paddingLeft:1,paddingRight:1,truncate:Number.POSITIVE_INFINITY,verticalAlignment:"top",width:o[t],wrapWord:!1,...r,...null==n?void 0:n[t]})))})(o,s.columns,s.columnDefault,f),m=null!==(l=s.drawVerticalLine)&&void 0!==l?l:()=>!0,h=null!==(d=s.drawHorizontalLine)&&void 0!==d?d:()=>!0;return{...s,border:(0,n.makeBorderConfig)(s.border),columns:_,drawHorizontalLine:h,drawVerticalLine:m,singleLine:null!==(p=s.singleLine)&&void 0!==p&&p,spanningCellManager:(0,t.createSpanningCellManager)({columnsConfig:_,drawHorizontalLine:h,drawVerticalLine:m,rows:o,spanningCellConfigs:f})}},makeTableConfig}var validateTableData={},hasRequiredValidateTableData,hasRequiredTable;function requireValidateTableData(){if(hasRequiredValidateTableData)return validateTableData;hasRequiredValidateTableData=1,Object.defineProperty(validateTableData,"__esModule",{value:!0}),validateTableData.validateTableData=void 0;const e=requireUtils();return validateTableData.validateTableData=t=>{if(!Array.isArray(t))throw new TypeError("Table data must be an array.");if(0===t.length)throw new Error("Table must define at least one row.");if(0===t[0].length)throw new Error("Table must define at least one column.");const n=t[0].length;for(const r of t){if(!Array.isArray(r))throw new TypeError("Table row data must be an array.");if(r.length!==n)throw new Error("Table must have a consistent number of cells.");for(const t of r)if(/[\u0001-\u0006\u0008\u0009\u000B-\u001A]/.test((0,e.normalizeString)(String(t))))throw new Error("Table data must not contain control characters.")}},validateTableData}function requireTable(){if(hasRequiredTable)return table;hasRequiredTable=1,Object.defineProperty(table,"__esModule",{value:!0}),table.table=void 0;const e=requireAlignTableData(),t=requireCalculateOutputColumnWidths(),n=requireCalculateRowHeights(),r=requireDrawTable(),i=requireInjectHeaderConfig(),o=requireMakeTableConfig(),s=requireMapDataUsingRowHeights(),a=requirePadTableData(),c=requireStringifyTableData(),u=requireTruncateTableData(),l=requireUtils(),d=requireValidateTableData();return table.table=(p,f={})=>{(0,d.validateTableData)(p);let _=(0,c.stringifyTableData)(p);const[m,h]=(0,i.injectHeaderConfig)(_,f),g=(0,o.makeTableConfig)(m,f,h);_=(0,u.truncateTableData)(m,(0,l.extractTruncates)(g));const A=(0,n.calculateRowHeights)(_,g);g.spanningCellManager.setRowHeights(A),g.spanningCellManager.setRowIndexMapping(A),_=(0,s.mapDataUsingRowHeights)(_,A,g),_=(0,e.alignTableData)(_,g),_=(0,a.padTableData)(_,g);const y=(0,t.calculateOutputColumnWidths)(g);return(0,r.drawTable)(_,y,A,g)},table}var api={},hasRequiredApi,hasRequiredSrc$2;function requireApi(){return hasRequiredApi||(hasRequiredApi=1,Object.defineProperty(api,"__esModule",{value:!0})),api}function requireSrc$2(){return hasRequiredSrc$2||(hasRequiredSrc$2=1,function(e){var t=src$2.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=src$2.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.getBorderCharacters=e.createStream=e.table=void 0;const r=requireCreateStream();Object.defineProperty(e,"createStream",{enumerable:!0,get:function(){return r.createStream}});const i=requireGetBorderCharacters();Object.defineProperty(e,"getBorderCharacters",{enumerable:!0,get:function(){return i.getBorderCharacters}});const o=requireTable();Object.defineProperty(e,"table",{enumerable:!0,get:function(){return o.table}}),n(requireApi(),e)}(src$2)),src$2}var srcExports$1=requireSrc$2(),jsonpointerExports=requireJsonpointer(),jsonPointer=getDefaultExportFromCjs(jsonpointerExports);function findSchemaDefinition(e,t={}){const n=e;if(""===(e=e.trim()))return!1;if(!e.startsWith("#"))throw new Error(`Could not find a definition for ${n}.`);e=decodeURIComponent(e.substring(1));const r=jsonPointer.get(t,e);if(void 0===r)throw new Error(`Could not find a definition for ${n}.`);return r}var supportedMethods=new Set(["get","put","post","delete","options","head","patch","trace"]),CODE_SAMPLES="code-samples",EXPLORER_ENABLED="explorer-enabled",HEADERS="headers",METRICS_ENABLED="metrics-enabled",OAUTH_OPTIONS="oauth-options",PARAMETER_ORDERING="parameter-ordering",PROXY_ENABLED="proxy-enabled",SAMPLES_LANGUAGES="samples-languages",SIMPLE_MODE="simple-mode",DISABLE_TAG_SORTING="disable-tag-sorting",extensionDefaults={[CODE_SAMPLES]:void 0,[DISABLE_TAG_SORTING]:!1,[EXPLORER_ENABLED]:!0,[HEADERS]:void 0,[METRICS_ENABLED]:!0,[OAUTH_OPTIONS]:{},[PARAMETER_ORDERING]:["path","query","body","cookie","form","header"],[PROXY_ENABLED]:!0,[SAMPLES_LANGUAGES]:["shell","node","ruby","php","python","java","csharp"],[SIMPLE_MODE]:!0},_listCacheClear,hasRequired_listCacheClear,eq_1,hasRequiredEq,_assocIndexOf,hasRequired_assocIndexOf,_listCacheDelete,hasRequired_listCacheDelete,_listCacheGet,hasRequired_listCacheGet,_listCacheHas,hasRequired_listCacheHas,_listCacheSet,hasRequired_listCacheSet,_ListCache,hasRequired_ListCache,_stackClear,hasRequired_stackClear,_stackDelete,hasRequired_stackDelete,_stackGet,hasRequired_stackGet,_stackHas,hasRequired_stackHas,_freeGlobal,hasRequired_freeGlobal,_root,hasRequired_root,_Symbol,hasRequired_Symbol,_getRawTag,hasRequired_getRawTag,_objectToString,hasRequired_objectToString,_baseGetTag,hasRequired_baseGetTag,isObject_1,hasRequiredIsObject$1,isFunction_1,hasRequiredIsFunction$1,_coreJsData,hasRequired_coreJsData,_isMasked,hasRequired_isMasked,_toSource,hasRequired_toSource,_baseIsNative,hasRequired_baseIsNative,_getValue,hasRequired_getValue,_getNative,hasRequired_getNative,_Map,hasRequired_Map,_nativeCreate,hasRequired_nativeCreate,_hashClear,hasRequired_hashClear,_hashDelete,hasRequired_hashDelete,_hashGet,hasRequired_hashGet,_hashHas,hasRequired_hashHas,_hashSet,hasRequired_hashSet,_Hash,hasRequired_Hash,_mapCacheClear,hasRequired_mapCacheClear,_isKeyable,hasRequired_isKeyable,_getMapData,hasRequired_getMapData,_mapCacheDelete,hasRequired_mapCacheDelete,_mapCacheGet,hasRequired_mapCacheGet,_mapCacheHas,hasRequired_mapCacheHas,_mapCacheSet,hasRequired_mapCacheSet,_MapCache,hasRequired_MapCache,_stackSet,hasRequired_stackSet,_Stack,hasRequired_Stack,_arrayEach,hasRequired_arrayEach,_defineProperty,hasRequired_defineProperty,_baseAssignValue,hasRequired_baseAssignValue,_assignValue,hasRequired_assignValue,_copyObject,hasRequired_copyObject,_baseTimes,hasRequired_baseTimes,isObjectLike_1,hasRequiredIsObjectLike,_baseIsArguments,hasRequired_baseIsArguments,isArguments_1,hasRequiredIsArguments$1,isArray_1,hasRequiredIsArray;function hasRootExtension(e,t){return Boolean(t&&e in t)}function getExtension(e,t,n){if(n){if(n.hasExtension("x-readme")){const t=n.getExtension("x-readme");if(t&&"object"==typeof t&&e in t)return t[e]}if(n.hasExtension(`x-${e}`))return n.getExtension(`x-${e}`);if(n.hasExtension(e))return n.getExtension(e)}if(e===CODE_SAMPLES)return extensionDefaults[e];if(hasRootExtension("x-readme",t)){const n=t?.["x-readme"];if(n&&"object"==typeof n&&e in n)return n[e]}return hasRootExtension(`x-${e}`,t)?t?.[`x-${e}`]:hasRootExtension(e,t)?t?.[e]:e in extensionDefaults?extensionDefaults[e]:void 0}function validateParameterOrdering(e,t){const n=extensionDefaults[PARAMETER_ORDERING],r=n.length,i=`${n.slice(0,-1).join(", ")}, and ${n.slice(-1)}`;if(e.length!==r)throw new TypeError(`"${t}" must contain ${r} items comprised of: ${i}`);if(e.filter((e=>n.includes(e.toLowerCase()))).length!==r)throw new TypeError(`"${t}" must contain ${r} items comprised of: ${i}`)}function isRef(e){return void 0!==e.$ref}function isOAS31(e){return"3.1.0"===e.openapi}function isSchema(e,t=!1){return void 0!==e.type||void 0!==e.allOf||void 0!==e.anyOf||void 0!==e.oneOf||t}function require_listCacheClear(){if(hasRequired_listCacheClear)return _listCacheClear;return hasRequired_listCacheClear=1,_listCacheClear=function(){this.__data__=[],this.size=0}}function requireEq(){if(hasRequiredEq)return eq_1;return hasRequiredEq=1,eq_1=function(e,t){return e===t||e!=e&&t!=t}}function require_assocIndexOf(){if(hasRequired_assocIndexOf)return _assocIndexOf;hasRequired_assocIndexOf=1;var e=requireEq();return _assocIndexOf=function(t,n){for(var r=t.length;r--;)if(e(t[r][0],n))return r;return-1},_assocIndexOf}function require_listCacheDelete(){if(hasRequired_listCacheDelete)return _listCacheDelete;hasRequired_listCacheDelete=1;var e=require_assocIndexOf(),t=Array.prototype.splice;return _listCacheDelete=function(n){var r=this.__data__,i=e(r,n);return!(i<0)&&(i==r.length-1?r.pop():t.call(r,i,1),--this.size,!0)},_listCacheDelete}function require_listCacheGet(){if(hasRequired_listCacheGet)return _listCacheGet;hasRequired_listCacheGet=1;var e=require_assocIndexOf();return _listCacheGet=function(t){var n=this.__data__,r=e(n,t);return r<0?void 0:n[r][1]},_listCacheGet}function require_listCacheHas(){if(hasRequired_listCacheHas)return _listCacheHas;hasRequired_listCacheHas=1;var e=require_assocIndexOf();return _listCacheHas=function(t){return e(this.__data__,t)>-1}}function require_listCacheSet(){if(hasRequired_listCacheSet)return _listCacheSet;hasRequired_listCacheSet=1;var e=require_assocIndexOf();return _listCacheSet=function(t,n){var r=this.__data__,i=e(r,t);return i<0?(++this.size,r.push([t,n])):r[i][1]=n,this},_listCacheSet}function require_ListCache(){if(hasRequired_ListCache)return _ListCache;hasRequired_ListCache=1;var e=require_listCacheClear(),t=require_listCacheDelete(),n=require_listCacheGet(),r=require_listCacheHas(),i=require_listCacheSet();function o(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&t%1==0&&t-1&&e%1==0&&e<=9007199254740991}}function require_baseIsTypedArray(){if(hasRequired_baseIsTypedArray)return _baseIsTypedArray;hasRequired_baseIsTypedArray=1;var e=require_baseGetTag(),t=requireIsLength(),n=requireIsObjectLike(),r={};return r["[object Float32Array]"]=r["[object Float64Array]"]=r["[object Int8Array]"]=r["[object Int16Array]"]=r["[object Int32Array]"]=r["[object Uint8Array]"]=r["[object Uint8ClampedArray]"]=r["[object Uint16Array]"]=r["[object Uint32Array]"]=!0,r["[object Arguments]"]=r["[object Array]"]=r["[object ArrayBuffer]"]=r["[object Boolean]"]=r["[object DataView]"]=r["[object Date]"]=r["[object Error]"]=r["[object Function]"]=r["[object Map]"]=r["[object Number]"]=r["[object Object]"]=r["[object RegExp]"]=r["[object Set]"]=r["[object String]"]=r["[object WeakMap]"]=!1,_baseIsTypedArray=function(i){return n(i)&&t(i.length)&&!!r[e(i)]}}function require_baseUnary(){if(hasRequired_baseUnary)return _baseUnary;return hasRequired_baseUnary=1,_baseUnary=function(e){return function(t){return e(t)}}}isBuffer.exports;var _nodeUtil={exports:{}},hasRequired_nodeUtil,isTypedArray_1,hasRequiredIsTypedArray,_arrayLikeKeys,hasRequired_arrayLikeKeys,_isPrototype,hasRequired_isPrototype,_overArg,hasRequired_overArg,_nativeKeys,hasRequired_nativeKeys,_baseKeys,hasRequired_baseKeys,isArrayLike_1,hasRequiredIsArrayLike,keys_1,hasRequiredKeys$1,_baseAssign,hasRequired_baseAssign,_nativeKeysIn,hasRequired_nativeKeysIn,_baseKeysIn,hasRequired_baseKeysIn,keysIn_1,hasRequiredKeysIn,_baseAssignIn,hasRequired_baseAssignIn;function require_nodeUtil(){return hasRequired_nodeUtil||(hasRequired_nodeUtil=1,function(e,t){var n=require_freeGlobal(),r=t&&!t.nodeType&&t,i=r&&e&&!e.nodeType&&e,o=i&&i.exports===r&&n.process,s=function(){try{var e=i&&i.require&&i.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=s}(_nodeUtil,_nodeUtil.exports)),_nodeUtil.exports}function requireIsTypedArray(){if(hasRequiredIsTypedArray)return isTypedArray_1;hasRequiredIsTypedArray=1;var e=require_baseIsTypedArray(),t=require_baseUnary(),n=require_nodeUtil(),r=n&&n.isTypedArray,i=r?t(r):e;return isTypedArray_1=i}function require_arrayLikeKeys(){if(hasRequired_arrayLikeKeys)return _arrayLikeKeys;hasRequired_arrayLikeKeys=1;var e=require_baseTimes(),t=requireIsArguments$1(),n=requireIsArray(),r=requireIsBuffer(),i=require_isIndex(),o=requireIsTypedArray(),s=Object.prototype.hasOwnProperty;return _arrayLikeKeys=function(a,c){var u=n(a),l=!u&&t(a),d=!u&&!l&&r(a),p=!u&&!l&&!d&&o(a),f=u||l||d||p,_=f?e(a.length,String):[],m=_.length;for(var h in a)!c&&!s.call(a,h)||f&&("length"==h||d&&("offset"==h||"parent"==h)||p&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||i(h,m))||_.push(h);return _}}function require_isPrototype(){if(hasRequired_isPrototype)return _isPrototype;hasRequired_isPrototype=1;var e=Object.prototype;return _isPrototype=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||e)}}function require_overArg(){if(hasRequired_overArg)return _overArg;return hasRequired_overArg=1,_overArg=function(e,t){return function(n){return e(t(n))}}}function require_nativeKeys(){if(hasRequired_nativeKeys)return _nativeKeys;hasRequired_nativeKeys=1;var e=require_overArg()(Object.keys,Object);return _nativeKeys=e}function require_baseKeys(){if(hasRequired_baseKeys)return _baseKeys;hasRequired_baseKeys=1;var e=require_isPrototype(),t=require_nativeKeys(),n=Object.prototype.hasOwnProperty;return _baseKeys=function(r){if(!e(r))return t(r);var i=[];for(var o in Object(r))n.call(r,o)&&"constructor"!=o&&i.push(o);return i}}function requireIsArrayLike(){if(hasRequiredIsArrayLike)return isArrayLike_1;hasRequiredIsArrayLike=1;var e=requireIsFunction$1(),t=requireIsLength();return isArrayLike_1=function(n){return null!=n&&t(n.length)&&!e(n)}}function requireKeys$1(){if(hasRequiredKeys$1)return keys_1;hasRequiredKeys$1=1;var e=require_arrayLikeKeys(),t=require_baseKeys(),n=requireIsArrayLike();return keys_1=function(r){return n(r)?e(r):t(r)}}function require_baseAssign(){if(hasRequired_baseAssign)return _baseAssign;hasRequired_baseAssign=1;var e=require_copyObject(),t=requireKeys$1();return _baseAssign=function(n,r){return n&&e(r,t(r),n)},_baseAssign}function require_nativeKeysIn(){if(hasRequired_nativeKeysIn)return _nativeKeysIn;return hasRequired_nativeKeysIn=1,_nativeKeysIn=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}}function require_baseKeysIn(){if(hasRequired_baseKeysIn)return _baseKeysIn;hasRequired_baseKeysIn=1;var e=requireIsObject$1(),t=require_isPrototype(),n=require_nativeKeysIn(),r=Object.prototype.hasOwnProperty;return _baseKeysIn=function(i){if(!e(i))return n(i);var o=t(i),s=[];for(var a in i)("constructor"!=a||!o&&r.call(i,a))&&s.push(a);return s}}function requireKeysIn(){if(hasRequiredKeysIn)return keysIn_1;hasRequiredKeysIn=1;var e=require_arrayLikeKeys(),t=require_baseKeysIn(),n=requireIsArrayLike();return keysIn_1=function(r){return n(r)?e(r,!0):t(r)}}function require_baseAssignIn(){if(hasRequired_baseAssignIn)return _baseAssignIn;hasRequired_baseAssignIn=1;var e=require_copyObject(),t=requireKeysIn();return _baseAssignIn=function(n,r){return n&&e(r,t(r),n)},_baseAssignIn}_nodeUtil.exports;var _cloneBuffer={exports:{}},hasRequired_cloneBuffer,_copyArray,hasRequired_copyArray,_arrayFilter,hasRequired_arrayFilter,stubArray_1,hasRequiredStubArray,_getSymbols,hasRequired_getSymbols,_copySymbols,hasRequired_copySymbols,_arrayPush,hasRequired_arrayPush,_getPrototype,hasRequired_getPrototype,_getSymbolsIn,hasRequired_getSymbolsIn,_copySymbolsIn,hasRequired_copySymbolsIn,_baseGetAllKeys,hasRequired_baseGetAllKeys,_getAllKeys,hasRequired_getAllKeys,_getAllKeysIn,hasRequired_getAllKeysIn,_DataView,hasRequired_DataView,_Promise,hasRequired_Promise,_Set,hasRequired_Set,_WeakMap,hasRequired_WeakMap,_getTag,hasRequired_getTag,_initCloneArray,hasRequired_initCloneArray,_Uint8Array,hasRequired_Uint8Array,_cloneArrayBuffer,hasRequired_cloneArrayBuffer,_cloneDataView,hasRequired_cloneDataView,_cloneRegExp,hasRequired_cloneRegExp,_cloneSymbol,hasRequired_cloneSymbol,_cloneTypedArray,hasRequired_cloneTypedArray,_initCloneByTag,hasRequired_initCloneByTag,_baseCreate,hasRequired_baseCreate,_initCloneObject,hasRequired_initCloneObject,_baseIsMap,hasRequired_baseIsMap,isMap_1,hasRequiredIsMap,_baseIsSet,hasRequired_baseIsSet,isSet_1,hasRequiredIsSet,_baseClone,hasRequired_baseClone,cloneDeep_1,hasRequiredCloneDeep,_setCacheAdd,hasRequired_setCacheAdd,_setCacheHas,hasRequired_setCacheHas,_SetCache,hasRequired_SetCache,_arraySome,hasRequired_arraySome,_cacheHas,hasRequired_cacheHas,_equalArrays,hasRequired_equalArrays,_mapToArray,hasRequired_mapToArray,_setToArray,hasRequired_setToArray,_equalByTag,hasRequired_equalByTag,_equalObjects,hasRequired_equalObjects,_baseIsEqualDeep,hasRequired_baseIsEqualDeep,_baseIsEqual,hasRequired_baseIsEqual,isEqual_1,hasRequiredIsEqual,_isFlattenable,hasRequired_isFlattenable,_baseFlatten,hasRequired_baseFlatten,_arrayMap,hasRequired_arrayMap,isSymbol_1,hasRequiredIsSymbol$1,_isKey,hasRequired_isKey,memoize_1,hasRequiredMemoize,_memoizeCapped,hasRequired_memoizeCapped,_stringToPath,hasRequired_stringToPath,_baseToString,hasRequired_baseToString,toString_1,hasRequiredToString,_castPath,hasRequired_castPath,_toKey,hasRequired_toKey,_baseGet,hasRequired_baseGet,_baseIsMatch,hasRequired_baseIsMatch,_isStrictComparable,hasRequired_isStrictComparable,_getMatchData,hasRequired_getMatchData,_matchesStrictComparable,hasRequired_matchesStrictComparable,_baseMatches,hasRequired_baseMatches,get_1,hasRequiredGet$1,_baseHasIn,hasRequired_baseHasIn,_hasPath,hasRequired_hasPath,hasIn_1,hasRequiredHasIn,_baseMatchesProperty,hasRequired_baseMatchesProperty,identity_1,hasRequiredIdentity,_baseProperty,hasRequired_baseProperty,_basePropertyDeep,hasRequired_basePropertyDeep,property_1,hasRequiredProperty,_baseIteratee,hasRequired_baseIteratee,_createBaseFor,hasRequired_createBaseFor,_baseFor,hasRequired_baseFor,_baseForOwn,hasRequired_baseForOwn,_createBaseEach,hasRequired_createBaseEach,_baseEach,hasRequired_baseEach,_baseMap,hasRequired_baseMap,_baseSortBy,hasRequired_baseSortBy,_compareAscending,hasRequired_compareAscending,_compareMultiple,hasRequired_compareMultiple,_baseOrderBy,hasRequired_baseOrderBy,_apply,hasRequired_apply,_overRest,hasRequired_overRest,constant_1,hasRequiredConstant,_baseSetToString,hasRequired_baseSetToString,_shortOut,hasRequired_shortOut,_setToString,hasRequired_setToString,_baseRest,hasRequired_baseRest,_isIterateeCall,hasRequired_isIterateeCall,sortBy_1,hasRequiredSortBy,_baseFindIndex,hasRequired_baseFindIndex,_baseIsNaN,hasRequired_baseIsNaN,_strictIndexOf,hasRequired_strictIndexOf,_baseIndexOf,hasRequired_baseIndexOf,_arrayIncludes,hasRequired_arrayIncludes,_arrayIncludesWith,hasRequired_arrayIncludesWith,noop_1,hasRequiredNoop$1,_createSet,hasRequired_createSet,_baseUniq,hasRequired_baseUniq,uniq_1,hasRequiredUniq,uniqWith_1,hasRequiredUniqWith,defaults_1,hasRequiredDefaults,_baseIntersection,hasRequired_baseIntersection,isArrayLikeObject_1,hasRequiredIsArrayLikeObject,_castArrayLikeObject,hasRequired_castArrayLikeObject,last_1,hasRequiredLast,intersectionWith_1,hasRequiredIntersectionWith,isPlainObject_1,hasRequiredIsPlainObject,isBoolean_1,hasRequiredIsBoolean,src$1,hasRequiredSrc$1,lib$6,hasRequiredLib$6,lib$5,hasRequiredLib$5,lib$4,hasRequiredLib$4,lib$3,hasRequiredLib$3,lib$2,hasRequiredLib$2,lib$1,hasRequiredLib$1,lib,hasRequiredLib,_assignMergeValue,hasRequired_assignMergeValue,_safeGet,hasRequired_safeGet,toPlainObject_1,hasRequiredToPlainObject,_baseMergeDeep,hasRequired_baseMergeDeep,_baseMerge,hasRequired_baseMerge,_customDefaultsMerge,hasRequired_customDefaultsMerge,_createAssigner,hasRequired_createAssigner,mergeWith_1,hasRequiredMergeWith,defaultsDeep_1,hasRequiredDefaultsDeep,flatten_1,hasRequiredFlatten,flattenDeep_1,hasRequiredFlattenDeep,intersection_1,hasRequiredIntersection,_baseIndexOfWith,hasRequired_baseIndexOfWith,_basePullAll,hasRequired_basePullAll,pullAll_1,hasRequiredPullAll,_castFunction,hasRequired_castFunction,forEach_1,hasRequiredForEach$1,_baseDifference,hasRequired_baseDifference,without_1,hasRequiredWithout,common,hasRequiredCommon,properties,hasRequiredProperties,items,hasRequiredItems,src,hasRequiredSrc;function require_cloneBuffer(){return hasRequired_cloneBuffer||(hasRequired_cloneBuffer=1,function(e,t){var n=require_root(),r=t&&!t.nodeType&&t,i=r&&e&&!e.nodeType&&e,o=i&&i.exports===r?n.Buffer:void 0,s=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}}(_cloneBuffer,_cloneBuffer.exports)),_cloneBuffer.exports}function require_copyArray(){if(hasRequired_copyArray)return _copyArray;return hasRequired_copyArray=1,_copyArray=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++nl))return!1;var p=c.get(r),f=c.get(i);if(p&&f)return p==i&&f==r;var _=-1,m=!0,h=2&o?new e:void 0;for(c.set(r,i),c.set(i,r);++_0&&o(l)?i>1?n(l,i-1,o,s,a):e(a,l):s||(a[a.length]=l)}return a},_baseFlatten}function require_arrayMap(){if(hasRequired_arrayMap)return _arrayMap;return hasRequired_arrayMap=1,_arrayMap=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++nn||s&&a&&u&&!c&&!l||i&&a&&u||!r&&u||!o)return 1;if(!i&&!s&&!l&&t=c?u:u*("desc"==r[i]?-1:1)}return t.index-n.index},_compareMultiple}function require_baseOrderBy(){if(hasRequired_baseOrderBy)return _baseOrderBy;hasRequired_baseOrderBy=1;var e=require_arrayMap(),t=require_baseGet(),n=require_baseIteratee(),r=require_baseMap(),i=require_baseSortBy(),o=require_baseUnary(),s=require_compareMultiple(),a=requireIdentity(),c=requireIsArray();return _baseOrderBy=function(u,l,d){l=l.length?e(l,(function(e){return c(e)?function(n){return t(n,1===e.length?e[0]:e)}:e})):[a];var p=-1;l=e(l,o(n));var f=r(u,(function(t,n,r){return{criteria:e(l,(function(e){return e(t)})),index:++p,value:t}}));return i(f,(function(e,t){return s(e,t,d)}))},_baseOrderBy}function require_apply(){if(hasRequired_apply)return _apply;return hasRequired_apply=1,_apply=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},_apply}function require_overRest(){if(hasRequired_overRest)return _overRest;hasRequired_overRest=1;var e=require_apply(),t=Math.max;return _overRest=function(n,r,i){return r=t(void 0===r?n.length-1:r,0),function(){for(var o=arguments,s=-1,a=t(o.length-r,0),c=Array(a);++s0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}},_shortOut}function require_setToString(){if(hasRequired_setToString)return _setToString;hasRequired_setToString=1;var e=require_baseSetToString(),t=require_shortOut()(e);return _setToString=t}function require_baseRest(){if(hasRequired_baseRest)return _baseRest;hasRequired_baseRest=1;var e=requireIdentity(),t=require_overRest(),n=require_setToString();return _baseRest=function(r,i){return n(t(r,i,e),r+"")}}function require_isIterateeCall(){if(hasRequired_isIterateeCall)return _isIterateeCall;hasRequired_isIterateeCall=1;var e=requireEq(),t=requireIsArrayLike(),n=require_isIndex(),r=requireIsObject$1();return _isIterateeCall=function(i,o,s){if(!r(s))return!1;var a=typeof o;return!!("number"==a?t(s)&&n(o,s.length):"string"==a&&o in s)&&e(s[o],i)},_isIterateeCall}function requireSortBy(){if(hasRequiredSortBy)return sortBy_1;hasRequiredSortBy=1;var e=require_baseFlatten(),t=require_baseOrderBy(),n=require_baseRest(),r=require_isIterateeCall(),i=n((function(n,i){if(null==n)return[];var o=i.length;return o>1&&r(n,i[0],i[1])?i=[]:o>2&&r(i[0],i[1],i[2])&&(i=[i[0]]),t(n,e(i,1),[])}));return sortBy_1=i}function require_baseFindIndex(){if(hasRequired_baseFindIndex)return _baseFindIndex;return hasRequired_baseFindIndex=1,_baseFindIndex=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o-1},_arrayIncludes}function require_arrayIncludesWith(){if(hasRequired_arrayIncludesWith)return _arrayIncludesWith;return hasRequired_arrayIncludesWith=1,_arrayIncludesWith=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r=200){var m=a?null:i(s);if(m)return o(m);p=!1,l=r,_=new e}else _=a?[]:f;e:for(;++u2?s[2]:void 0;for(u&&n(s[0],s[1],u)&&(c=1);++a=120&&g.length>=120)?new e(f&&g):void 0}g=a[0];var A=-1,y=_[0];e:for(;++AArray.isArray(e)?e:[e],u=e=>void 0===e,l=e=>s(e)||Array.isArray(e)?Object.keys(e):[],d=(e,t)=>e.hasOwnProperty(t),p=e=>t(n(e)),f=e=>u(e)||Array.isArray(e)&&0===e.length,_=(t,n)=>u(t)&&0===n||u(n)&&0===t||e(t,n),m=t=>u(t)||e(t,{})||!0===t,h=t=>u(t)||e(t,{}),g=e=>u(e)||s(e)||!0===e||!1===e;function A(t,n){return!(!f(t)||!f(n))||e(p(t),p(n))}function y(t,r,i,o){var s=n(l(t).concat(l(r)));return!(!h(t)||!h(r))||(!h(t)||!l(r).length)&&((!h(r)||!l(t).length)&&s.every((function(n){var i=t[n],s=r[n];return Array.isArray(i)&&Array.isArray(s)?e(p(t),p(r)):!(Array.isArray(i)&&!Array.isArray(s))&&(!(Array.isArray(s)&&!Array.isArray(i))&&((e,t,n,r)=>t&&d(t,n)&&e&&d(e,n)&&r(e[n],t[n]))(t,r,n,o))})))}function v(e,t,n,i){var s=r(e,i),a=r(t,i);return o(s,a,i).length===Math.max(s.length,a.length)}var b={title:e,uniqueItems:(t,n)=>u(t)&&!1===n||u(n)&&!1===t||e(t,n),minLength:_,minItems:_,minProperties:_,required:A,enum:A,type:function(t,n){return t=c(t),n=c(n),e(p(t),p(n))},items:function(t,n,r,i){return s(t)&&s(n)?i(t,n):Array.isArray(t)&&Array.isArray(n)?y(t,n,0,i):e(t,n)},anyOf:v,allOf:v,oneOf:v,properties:y,patternProperties:y,dependencies:y},C=["properties","patternProperties","dependencies","uniqueItems","minLength","minItems","minProperties","required"],E=["additionalProperties","additionalItems","contains","propertyNames","not"];return src$1=function t(r,o,s){if(s=i(s,{ignore:[]}),m(r)&&m(o))return!0;if(!g(r)||!g(o))throw new Error("Either of the values are not a JSON schema.");if(r===o)return!0;if(a(r)&&a(o))return r===o;if(void 0===r&&!1===o||void 0===o&&!1===r)return!1;if(u(r)&&!u(o)||!u(r)&&u(o))return!1;var c=n(Object.keys(r).concat(Object.keys(o)));if(s.ignore.length&&(c=c.filter((e=>-1===s.ignore.indexOf(e)))),!c.length)return!0;function l(e,n){return t(e,n,s)}return c.every((function(n){var i=r[n],c=o[n];if(-1!==E.indexOf(n))return t(i,c,s);var u=b[n];if(u||(u=e),e(i,c))return!0;if(-1===C.indexOf(n)&&(!d(r,n)&&d(o,n)||d(r,n)&&!d(o,n)))return i===c;var p=u(i,c,n,l);if(!a(p))throw new Error("Comparer must return true or false");return p}))},src$1}function requireLib$6(){if(hasRequiredLib$6)return lib$6;return hasRequiredLib$6=1,lib$6=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}}function requireLib$5(){if(hasRequiredLib$5)return lib$5;return hasRequiredLib$5=1,lib$5=function(e){return("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))&&e.valueOf()==e.valueOf()}}function requireLib$4(){if(hasRequiredLib$4)return lib$4;hasRequiredLib$4=1;var e=requireLib$5();return lib$4=function(t){return e(t)&&t%1==0}}function requireLib$3(){if(hasRequiredLib$3)return lib$3;hasRequiredLib$3=1;var e=requireLib$6(),t=requireLib$4();return lib$3=function(n){var r;if(!e(n))return!1;if(!(r=n.length))return!1;for(var i=0;it&&(n=t,t=e,e=n),t-=e}return r*e}function o(e,t){var n,r=0;if(0===e)return t;if(0===t)return e;for(;!(1&e||1&t);)e>>>=1,t>>>=1,r++;for(;!(1&e);)e>>>=1;for(;t;){for(;!(1&t);)t>>>=1;e>t&&(n=t,t=e,e=n),t-=e}return e<1){if(c=s[0],a=s[1],!n(a))throw new TypeError("gcd()::invalid input argument. Accessor must be a function. Value: `"+a+"`.")}else c=s[0]}if((u=c.length)<2)return null;if(a){for(l=new Array(u),p=0;p1){if(s=i[0],o=i[1],!r(o))throw new TypeError("lcm()::invalid input argument. Accessor must be a function. Value: `"+o+"`.")}else s=i[0]}if((a=s.length)<2)return null;if(o){for(c=new Array(a),l=0;l1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(s=n.length>3&&"function"==typeof s?(o--,s):void 0,a&&t(r[0],r[1],a)&&(s=o<3?void 0:s,o=1),e=Object(e);++i-1;)f!==s&&o.call(f,_,1),o.call(s,_,1);return s},_basePullAll}function requirePullAll(){if(hasRequiredPullAll)return pullAll_1;hasRequiredPullAll=1;var e=require_basePullAll();return pullAll_1=function(t,n){return t&&t.length&&n&&n.length?e(t,n):t},pullAll_1}function require_castFunction(){if(hasRequired_castFunction)return _castFunction;hasRequired_castFunction=1;var e=requireIdentity();return _castFunction=function(t){return"function"==typeof t?t:e}}function requireForEach$1(){if(hasRequiredForEach$1)return forEach_1;hasRequiredForEach$1=1;var e=require_arrayEach(),t=require_baseEach(),n=require_castFunction(),r=requireIsArray();return forEach_1=function(i,o){return(r(i)?e:t)(i,n(o))}}function require_baseDifference(){if(hasRequired_baseDifference)return _baseDifference;hasRequired_baseDifference=1;var e=require_SetCache(),t=require_arrayIncludes(),n=require_arrayIncludesWith(),r=require_arrayMap(),i=require_baseUnary(),o=require_cacheHas();return _baseDifference=function(s,a,c,u){var l=-1,d=t,p=!0,f=s.length,_=[],m=a.length;if(!f)return _;c&&(a=r(a,i(c))),u?(d=n,p=!1):a.length>=200&&(d=o,p=!1,a=new e(a));e:for(;++lObject.prototype.hasOwnProperty.call(e,t),a=e=>n(e)||Array.isArray(e)?Object.keys(e):[],c=e=>!a(e).length&&!1!==e&&!0!==e;return common={allUniqueKeys:e=>r(t(e.map(a))),deleteUndefinedProps:function(e){for(const t in e)s(e,t)&&c(e[t])&&delete e[t];return e},getValues:(e,t)=>e.map((e=>e&&e[t])),has:s,isEmptySchema:c,isSchema:e=>n(e)||!0===e||!1===e,keys:a,notUndefined:e=>void 0!==e,uniqWith:i,withoutArr:(t,...n)=>o.apply(null,[t].concat(e(n)))},common}function requireProperties(){if(hasRequiredProperties)return properties;hasRequiredProperties=1;const e=requireSrc$1(),t=requireForEach$1(),{allUniqueKeys:n,deleteUndefinedProps:r,getValues:i,keys:o,notUndefined:s,uniqWith:a,withoutArr:c}=requireCommon();function u(t,r){return n(t).reduce((function(n,o){const c=i(t,o),u=a(c.filter(s),e);return n[o]=r(u,o),n}),{})}return properties={keywords:["properties","patternProperties","additionalProperties"],resolver(e,n,i,s){s.ignoreAdditionalProperties||(e.forEach((function(t){const n=e.filter((e=>e!==t)),r=o(t.properties),s=o(t.patternProperties).map((e=>new RegExp(e)));n.forEach((function(e){const n=o(e.properties),a=n.filter((e=>s.some((t=>t.test(e)))));c(n,r,a).forEach((function(n){e.properties[n]=i.properties([e.properties[n],t.additionalProperties],n)}))}))})),e.forEach((function(t){const n=e.filter((e=>e!==t)),r=o(t.patternProperties);!1===t.additionalProperties&&n.forEach((function(e){const t=o(e.patternProperties);c(t,r).forEach((t=>delete e.patternProperties[t]))}))})));const a={additionalProperties:i.additionalProperties(e.map((e=>e.additionalProperties))),patternProperties:u(e.map((e=>e.patternProperties)),i.patternProperties),properties:u(e.map((e=>e.properties)),i.properties)};var l;return!1===a.additionalProperties&&t(l=a.properties,(function(e,t){!1===e&&delete l[t]})),r(a)}},properties}function requireItems(){if(hasRequiredItems)return items;hasRequiredItems=1;const e=requireSrc$1(),t=requireForEach$1(),{allUniqueKeys:n,deleteUndefinedProps:r,has:i,isSchema:o,notUndefined:s,uniqWith:a}=requireCommon();function c(t,r,c){return n(c).reduce((function(n,c){const u=function(e,t){return e.map((function(e){if(e){if(!Array.isArray(e.items))return e.items;{const n=e.items[t];if(o(n))return n;if(i(e,"additionalItems"))return e.additionalItems}}}))}(t,c),l=a(u.filter(s),e);return n[c]=r(l,c),n}),[])}return items={keywords:["items","additionalItems"],resolver(e,n,i){const a=e.map((e=>e.items)),u=a.filter(s),l={};let d;var p;return u.every(o)?l.items=i.items(a):l.items=c(e,i.items,a),u.every(Array.isArray)?d=e.map((e=>e.additionalItems)):u.some(Array.isArray)&&(d=e.map((function(e){if(e)return Array.isArray(e.items)?e.additionalItems:e.items}))),d&&(l.additionalItems=i.additionalItems(d)),!1===l.additionalItems&&Array.isArray(l.items)&&(p=l.items,t(p,(function(e,t){!1===e&&p.splice(t,1)}))),r(l)}},items}function requireSrc(){if(hasRequiredSrc)return src;hasRequiredSrc=1;const e=requireCloneDeep(),t=requireSrc$1(),n=requireLib(),r=requireDefaultsDeep(),i=requireFlatten(),o=requireFlattenDeep(),s=requireIntersection(),a=requireIntersectionWith(),c=requireIsEqual(),u=requireIsPlainObject(),l=requirePullAll(),d=requireSortBy(),p=requireUniq(),f=requireUniqWith(),_=requireProperties(),m=requireItems(),h=(e,t)=>-1!==e.indexOf(t),g=e=>u(e)||!0===e||!1===e,A=e=>!1===e,y=e=>!0===e,v=(e,t,n)=>n(e),b=e=>d(p(o(e))),C=e=>void 0!==e,E=e=>p(o(e.map(I))),x=e=>e[0],S=e=>Math.max.apply(Math,e),k=e=>Math.min.apply(Math,e);function D(e){let{allOf:t=[],...n}=e;return n=u(e)?n:e,[n,...t.map(D)]}function w(e,t){return e.map((e=>e&&e[t]))}function I(e){return u(e)||Array.isArray(e)?Object.keys(e):[]}function T(e,t){if(t=t||[],!e.length)return t;const n=e.slice(0).shift(),r=e.slice(1);return t.length?T(r,i(t.map((e=>n.map((t=>[t].concat(e))))))):T(r,n.map((e=>e)))}function R(e,t){let n;try{n=e.map((function(e){return JSON.stringify(e,null,2)})).join("\n")}catch(t){n=e.join(", ")}throw new Error('Could not resolve values for path:"'+t.join(".")+'". They are probably incompatible. Values: \n'+n)}function F(e,n,r,i,o,s){if(e.length){const a=o.complexResolvers[n];if(!a||!a.resolver)throw new Error("No resolver found for "+n);const c=r.map((t=>e.reduce(((e,n)=>(void 0!==t[n]&&(e[n]=t[n]),e)),{}))),l=f(c,t),d=a.keywords.reduce(((e,t)=>({...e,[t]:(e,n=[])=>i(e,null,s.concat(t,n))})),{}),p=a.resolver(l,s.concat(n),d,o);return u(p)||R(l,s.concat(n)),p}}function P(e){return{required:e}}const N=["properties","patternProperties","definitions","dependencies"],B=["anyOf","oneOf"],O=["additionalProperties","additionalItems","contains","propertyNames","not","items"],q={type(e){if(e.some(Array.isArray)){const t=e.map((function(e){return Array.isArray(e)?e:[e]})),n=s.apply(null,t);if(1===n.length)return n[0];if(n.length>1)return p(n)}},dependencies:(e,n,r)=>E(e).reduce((function(n,i){const o=w(e,i);let s=f(o.filter(C),c);const a=s.filter(Array.isArray);if(a.length){if(a.length===s.length)n[i]=b(s);else{const e=s.filter(g),t=a.map(P);n[i]=r(e.concat(t),i)}return n}return s=f(s,t),n[i]=r(s,i),n}),{}),oneOf(n,r,i){const o=function(e,t){return e.map((function(e,n){try{return t(e,n)}catch(e){return}})).filter(C)}(T(e(n)),i),s=f(o,t);if(s.length)return s},not:e=>({anyOf:e}),pattern:e=>e.map((e=>"(?="+e+")")).join(""),multipleOf(e){let t=e.slice(0),r=1;for(;t.some((e=>!Number.isInteger(e)));)t=t.map((e=>10*e)),r*=10;return n(t)/r},enum(e){const t=a.apply(null,e.concat(c));if(t.length)return d(t)}};q.$id=x,q.$ref=x,q.$schema=x,q.additionalItems=v,q.additionalProperties=v,q.anyOf=q.oneOf,q.contains=v,q.default=x,q.definitions=q.dependencies,q.description=x,q.examples=e=>f(i(e),c),q.exclusiveMaximum=k,q.exclusiveMinimum=S,q.items=m,q.maximum=k,q.maxItems=k,q.maxLength=k,q.maxProperties=k,q.minimum=S,q.minItems=S,q.minLength=S,q.minProperties=S,q.properties=_,q.propertyNames=v,q.required=e=>b(e),q.title=x,q.uniqueItems=e=>e.some(y);const $={properties:_,items:m};function Q(n,i,s){i=r(i,{ignoreAdditionalProperties:!1,resolvers:q,complexResolvers:$,deep:!0});const a=Object.entries(i.complexResolvers);const c=function n(r,o,s){r=e(r.filter(C)),s=s||[];const c=u(o)?o:{};if(!r.length)return;if(r.some(A))return!1;if(r.every(y))return!0;r=r.filter(u);const d=E(r);if(i.deep&&h(d,"allOf"))return Q({allOf:r},i);const p=a.map((([e,t])=>d.filter((e=>t.keywords.includes(e)))));return p.forEach((e=>l(d,e))),d.forEach((function(e){const o=w(r,e),a=f(o.filter(C),function(e){return function(n,r){return t({[e]:n},{[e]:r})}}(e));if(1===a.length&&h(B,e))c[e]=a[0].map((e=>n([e],e)));else if(1!==a.length||h(N,e)||h(O,e)){const t=i.resolvers[e]||i.resolvers.defaultResolver;if(!t)throw new Error("No resolver found for key "+e+". You can provide a resolver for this keyword in the options, or provide a default resolver.");const r=(t,r=[])=>n(t,null,s.concat(e,r));c[e]=t(a,s.concat(e),r,i),void 0===c[e]?R(a,s.concat(e)):void 0===c[e]&&delete c[e]}else c[e]=a[0]})),a.reduce(((e,[t,o],a)=>({...e,...F(p[a],t,r,n,i,s)})),c)}(o(D(n)));return c}return Q.options={resolvers:q},src=Q}_cloneBuffer.exports;var srcExports=requireSrc(),mergeJSONSchemaAllOf=getDefaultExportFromCjs(srcExports);function isObject$2(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function isEmptyObject(e){return"object"==typeof e&&null!==e&&!Object.keys(e).length}function stripEmptyObjects(e){const t=e;return isObject$2(e)||Array.isArray(t)?null!==e?Array.isArray(t)?(t.forEach(((e,n)=>{let r=e;"object"==typeof r&&null!==r?(r=stripEmptyObjects(r),isEmptyObject(r)?delete t[n]:t[n]=r):null===r&&delete t[n]})),t.filter((e=>void 0!==e))):(Object.keys(t).forEach((e=>{let n=t[e];"object"==typeof n&&null!==n&&(n=stripEmptyObjects(n),isEmptyObject(n)?delete t[e]:t[e]=n)})),t):void 0:t}function removeUndefinedObjects(e){if(void 0===e)return;let t=JSON.parse(JSON.stringify(e));return t=stripEmptyObjects(t),isEmptyObject(t)?void 0:t}function cloneObject(e){if(void 0!==e)return JSON.parse(JSON.stringify(e))}function hasSchemaType(e,t){return Array.isArray(e.type)?e.type.includes(t):e.type===t}function isObject$1(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function isPrimitive(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e}function matchesMediaType(e,t){return e.some((e=>t.indexOf(e)>-1))}var matches_mimetype_default={formUrlEncoded:e=>matchesMediaType(["application/x-www-form-urlencoded"],e),json:e=>matchesMediaType(["application/json","application/x-json","text/json","text/x-json","+json"],e),multipart:e=>matchesMediaType(["multipart/mixed","multipart/related","multipart/form-data","multipart/alternative"],e),wildcard:e=>"*/*"===e,xml:e=>matchesMediaType(["application/xml","application/xml-external-parsed-entity","application/xml-dtd","text/xml","text/xml-external-parsed-entity","+xml"],e)},UNSUPPORTED_SCHEMA_PROPS=["example","externalDocs","xml"];function encodePointer(e){return e.replace("~","~0").replace("/","~1")}function getSchemaVersionString(e,t){return isOAS31(t)?e.$schema?e.$schema:t.jsonSchemaDialect?t.jsonSchemaDialect:"https://json-schema.org/draft/2020-12/schema#":"http://json-schema.org/draft-04/schema#"}function isPolymorphicSchema(e){return"allOf"in e||"anyOf"in e||"oneOf"in e}function isRequestBodySchema(e){return"content"in e}function searchForValueByPropAndPointer(e,t,n=[]){if(!n.length||!t.length)return;const r=t.split("/").filter(Boolean).reverse(),i=[];let o,s="";for(let e=0;e!0,transformer:e=>e,...t};if(isRef(n))return p(n.$ref,"ref"),f({$ref:n.$ref});if(isSchema(n,u)){if("allOf"in n&&Array.isArray(n.allOf)){try{n=mergeJSONSchemaAllOf(n,{ignoreAdditionalProperties:!0,resolvers:{description:e=>e.slice(-1)[0],enum:e=>{let t=[];return e.forEach((e=>{t=t.concat(e)})),t},defaultResolver:mergeJSONSchemaAllOf.options.resolvers.title}})}catch(e){const{...t}=n;n=t,delete n.allOf}if(isRef(n))return p(n.$ref,"ref"),f({$ref:n.$ref})}if(["anyOf","oneOf"].forEach((e=>{e in n&&Array.isArray(n[e])&&n[e].forEach(((t,r)=>{const u={addEnumsToDescriptions:i,currentLocation:`${o}/${r}`,globalDefaults:s,hideReadOnlyProperties:a,hideWriteOnlyProperties:c,isPolymorphicAllOfChild:!1,prevDefaultSchemas:l,prevExampleSchemas:d,refLogger:p,transformer:f};n[e][r]=toJSONSchema("properties"in n?{required:n.required,allOf:[t,{properties:n.properties}]}:"items"in n?{allOf:[t,{items:n.items}]}:t,u),isObject$1(n[e][r])&&"required"in n[e][r]&&"boolean"==typeof n[e][r].required&&delete n[e][r].required}))})),"discriminator"in n&&"mapping"in n.discriminator&&"object"==typeof n.discriminator.mapping){const e=n.discriminator.mapping;Object.keys(e).forEach((t=>{p(e[t],"discriminator")}))}}if("type"in n||isPolymorphicSchema(n)||isRequestBodySchema(n)||("properties"in n?n.type="object":"items"in n&&(n.type="array")),"type"in n)if("nullable"in n&&(n.nullable&&(Array.isArray(n.type)?n.type.push("null"):null!==n.type&&"null"!==n.type&&(n.type=[n.type,"null"])),delete n.nullable),null===n.type)n.type="null";else if(Array.isArray(n.type))if(n.type.includes(null)&&(n.type[n.type.indexOf(null)]="null"),n.type=Array.from(new Set(n.type)),1===n.type.length)n.type=n.type.shift();else if(n.type.includes("array")||n.type.includes("boolean")||n.type.includes("object")){const e=n.type.includes("null");if(2===n.type.length&&e);else{const t=[];Object.entries({array:["additionalItems","contains","items","maxContains","maxItems","minContains","minItems","prefixItems","uniqueItems"],boolean:[],object:["additionalProperties","maxProperties","minProperties","nullable","patternProperties","properties","propertyNames","required"]}).forEach((([r,i])=>{if(!n.type.includes(r))return;const o=removeUndefinedObjects({type:e?[r,"null"]:r,allowEmptyValue:n.allowEmptyValue??void 0,deprecated:n.deprecated??void 0,description:n.description??void 0,readOnly:n.readOnly??void 0,title:n.title??void 0,writeOnly:n.writeOnly??void 0});i.forEach((e=>{e in n&&(o[e]=n[e],delete n[e])})),t.push(o)})),n.type=n.type.filter((e=>"array"!==e&&"boolean"!==e&&"object"!==e)),1===n.type.length&&(n.type=n.type.shift()),n=n.type.length>1?{oneOf:[n,...t]}:{oneOf:t}}}if(isSchema(n,u)){if("default"in n&&isObject$1(n.default)&&l.push({default:n.default}),"example"in n)isPrimitive(n.example)?n.examples=[n.example]:Array.isArray(n.example)?(n.examples=n.example.filter((e=>isPrimitive(e))),n.examples.length||delete n.examples):d.push({example:n.example}),delete n.example;else if("examples"in n){let e=!1;if("object"!=typeof n.examples||Array.isArray(n.examples))Array.isArray(n.examples)&&isPrimitive(n.examples[0])&&(e=!0);else{const t=[];Object.keys(n.examples).forEach((r=>{const i=n.examples[r];"$ref"in i?p(i.$ref,"ref"):"value"in i&&(isPrimitive(i.value)?(t.push(i.value),e=!0):Array.isArray(i.value)&&isPrimitive(i.value[0])?(t.push(i.value[0]),e=!0):d.push({example:i.value}))})),t.length&&(e=!0,n.examples=t)}e||delete n.examples}if(!hasSchemaType(n,"array")&&!hasSchemaType(n,"object")&&!n.examples){const e=searchForValueByPropAndPointer("example",o,d);e&&(isPrimitive(e)||Array.isArray(e)&&isPrimitive(e[0]))&&(n.examples=[e])}if(hasSchemaType(n,"array"))"items"in n?!Array.isArray(n.items)&&1===Object.keys(n.items).length&&isRef(n.items)?p(n.items.$ref,"ref"):!0!==n.items&&(n.items=toJSONSchema(n.items,{addEnumsToDescriptions:i,currentLocation:`${o}/0`,globalDefaults:s,hideReadOnlyProperties:a,hideWriteOnlyProperties:c,prevExampleSchemas:d,refLogger:p,transformer:f}),isObject$1(n.items)&&"required"in n.items&&!Array.isArray(n.items.required)&&delete n.items.required):"properties"in n||"additionalProperties"in n?n.type="object":n.items={};else if(hasSchemaType(n,"object")){if("properties"in n&&(Object.keys(n.properties).forEach((e=>{if(Array.isArray(n.properties[e])||"object"==typeof n.properties[e]&&null!==n.properties[e]){const t=toJSONSchema(n.properties[e],{addEnumsToDescriptions:i,currentLocation:`${o}/${encodePointer(e)}`,globalDefaults:s,hideReadOnlyProperties:a,hideWriteOnlyProperties:c,prevDefaultSchemas:l,prevExampleSchemas:d,refLogger:p,transformer:f});let r=!0;!a&&!c||Object.keys(t).length||Object.keys(n.properties[e]).length>0&&(delete n.properties[e],r=!1),r&&(n.properties[e]=t,isObject$1(t)&&"required"in t&&"boolean"==typeof t.required&&!0===t.required&&("required"in n&&Array.isArray(n.required)?n.required.push(e):n.required=[e],delete n.properties[e].required))}})),(a||c)&&!Object.keys(n.properties).length))return f({});"object"==typeof r&&null!==r&&("type"in r||"$ref"in r||isPolymorphicSchema(r)?n.additionalProperties=toJSONSchema(r,{addEnumsToDescriptions:i,currentLocation:o,globalDefaults:s,hideReadOnlyProperties:a,hideWriteOnlyProperties:c,prevDefaultSchemas:l,prevExampleSchemas:d,refLogger:p,transformer:f}):n.additionalProperties=!0),isPolymorphicSchema(n)||"properties"in n||"additionalProperties"in n||(n.additionalProperties=!0)}}if(isSchema(n,u)&&s&&Object.keys(s).length>0&&o)try{const e=jsonPointer.get(s,o);e&&(n.default=e)}catch(e){}if("default"in n&&void 0!==n.default)hasSchemaType(n,"object")?delete n.default:"allowEmptyValue"in n&&n.allowEmptyValue&&""===n.default||""!==n.default||delete n.default;else if(l.length){const e=searchForValueByPropAndPointer("default",o,l);(isPrimitive(e)||null===e||Array.isArray(e)&&hasSchemaType(n,"array"))&&(n.default=e)}if(isSchema(n,u)&&"enum"in n&&Array.isArray(n.enum)&&(n.enum=Array.from(new Set(n.enum)),i)){const e=n.enum.filter(Boolean).map((e=>`\`${e}\``)).join(" ");e.length&&("description"in n?n.description+=`\n\n${e}`:n.description=e)}("anyOf"in n||"oneOf"in n)&&("properties"in n&&delete n.properties,"items"in n&&delete n.items);for(let e=0;e{const t=i.properties[e];!t.deprecated||s.includes(e)||t.readOnly||(a[e]=t)})),i.properties=a;const c=toJSONSchema(i,{globalDefaults:n.globalDefaults,hideReadOnlyProperties:n.hideReadOnlyProperties,hideWriteOnlyProperties:n.hideWriteOnlyProperties,prevExampleSchemas:[],refLogger:o,transformer:n.transformer});return 0===Object.keys(c).length||0===Object.keys(c.properties).length?null:(Object.keys(e.properties).forEach((t=>{e.properties[t].deprecated&&!s.includes(t)&&delete e.properties[t]})),{type:r,schema:isPrimitive(c)?c:{...c,$schema:getSchemaVersionString(c,t)}})}if(!e.hasParameters()&&!e.hasRequestBody())return null;const a=getExtension(PARAMETER_ORDERING,t,e).map((e=>e.toLowerCase()));a[a.indexOf("form")]="formData",a.push("metadata");const c=[function(){const r=e.getRequestBody();if(!r||!Array.isArray(r))return null;const[i,a,c]=r,u="application/x-www-form-urlencoded"===i?"formData":"body";if(!a.schema||!Object.keys(a.schema).length)return null;const l=[];"example"in a?l.push({example:a.example}):"examples"in a&&l.push({examples:Object.values(a.examples).map((e=>e.value)).filter((e=>void 0!==e))});const d=toJSONSchema(cloneObject(a.schema),{globalDefaults:n.globalDefaults,hideReadOnlyProperties:n.hideReadOnlyProperties,hideWriteOnlyProperties:n.hideWriteOnlyProperties,prevExampleSchemas:l,refLogger:o,transformer:n.transformer});return Object.keys(d).length?{type:u,label:types[u],schema:isPrimitive(d)?d:{...d,$schema:getSchemaVersionString(d,t)},deprecatedProps:s(d,u),...c?{description:c}:{}}:null}()].concat(...function(){const r=e.getParameters(),i=Object.keys(types).map((e=>{const i=[],a=r.filter((t=>t.in===e));if(0===a.length)return null;const c={type:"object",properties:a.reduce(((e,r)=>{let s={};if("schema"in r){const e=r.schema?cloneObject(r.schema):{};r.example?e.example=r.example:r.examples&&(e.examples=r.examples),r.deprecated&&(e.deprecated=r.deprecated);const i=toJSONSchema(e,{currentLocation:`/${r.name}`,globalDefaults:n.globalDefaults,hideReadOnlyProperties:n.hideReadOnlyProperties,hideWriteOnlyProperties:n.hideWriteOnlyProperties,refLogger:o,transformer:n.transformer});s=isPrimitive(i)?i:{...i,$schema:getSchemaVersionString(e,t)}}else if("content"in r&&"object"==typeof r.content){const e=Object.keys(r.content);if(e.length){let i;if(1===e.length)i=e[0];else{const t=e.filter((e=>matches_mimetype_default.json(e)));i=t.length?t[0]:e[0]}if("object"==typeof r.content[i]&&"schema"in r.content[i]){const e=r.content[i].schema?cloneObject(r.content[i].schema):{};r.example?e.example=r.example:r.examples&&(e.examples=r.examples),r.deprecated&&(e.deprecated=r.deprecated);const a=toJSONSchema(e,{currentLocation:`/${r.name}`,globalDefaults:n.globalDefaults,hideReadOnlyProperties:n.hideReadOnlyProperties,hideWriteOnlyProperties:n.hideWriteOnlyProperties,refLogger:o,transformer:n.transformer});s=isPrimitive(a)?a:{...a,$schema:getSchemaVersionString(e,t)}}}}return r.description&&(isPrimitive(s)||(s.description=r.description)),e[r.name]=s,r.required&&i.push(r.name),e}),{}),required:i};return{type:e,label:types[e],schema:c,deprecatedProps:s(c,e)}})).filter(Boolean);if(!n.mergeIntoBodyAndMetadata)return i;if(!i.length)return[];const a=i.map((e=>e.deprecatedProps?.schema||null)).filter(Boolean);return[{type:"metadata",label:types.metadata,schema:{allOf:i.map((e=>e.schema))},deprecatedProps:a.length?{type:"metadata",schema:{allOf:a}}:null}]}()).filter(Boolean),u=r||i&&n.includeDiscriminatorMappingRefs,l=!!u&&function(){if(!("components"in t))return!1;const e={...Object.keys(t.components).map((e=>({[e]:{}}))).reduce(((e,t)=>Object.assign(e,t)),{})};return Object.keys(t.components).forEach((r=>{"object"!=typeof t.components[r]||Array.isArray(t.components[r])||Object.keys(t.components[r]).forEach((i=>{const s=cloneObject(t.components[r][i]);e[r][i]=toJSONSchema(s,{globalDefaults:n.globalDefaults,hideReadOnlyProperties:n.hideReadOnlyProperties,hideWriteOnlyProperties:n.hideWriteOnlyProperties,refLogger:o,transformer:n.transformer})}))})),Object.keys(e).forEach((t=>{Object.keys(e[t]).length||delete e[t]})),e}();return c.map((e=>(l&&u&&(e.schema.components=l),e.deprecatedProps||delete e.deprecatedProps,e))).sort(((e,t)=>a.indexOf(e.type)-a.indexOf(t.type)))}function requireNoop(){return hasRequiredNoop?noop:(hasRequiredNoop=1,noop=function(){})}function requireIsValue(){if(hasRequiredIsValue)return isValue;hasRequiredIsValue=1;var e=requireNoop()();return isValue=function(t){return t!==e&&null!==t}}function requireNormalizeOptions(){if(hasRequiredNormalizeOptions)return normalizeOptions;hasRequiredNormalizeOptions=1;var e=requireIsValue(),t=Array.prototype.forEach,n=Object.create;return normalizeOptions=function(r){var i=n(null);return t.call(arguments,(function(t){e(t)&&function(e,t){var n;for(n in e)t[n]=e[n]}(Object(t),i)})),i},normalizeOptions}function requireIsImplemented$7(){return hasRequiredIsImplemented$7||(hasRequiredIsImplemented$7=1,isImplemented$7=function(){var e=Math.sign;return"function"==typeof e&&(1===e(10)&&-1===e(-20))}),isImplemented$7}function requireShim$5(){return hasRequiredShim$5?shim$5:(hasRequiredShim$5=1,shim$5=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1})}function requireSign(){return hasRequiredSign?sign:(hasRequiredSign=1,sign=requireIsImplemented$7()()?Math.sign:requireShim$5())}function requireToInteger(){if(hasRequiredToInteger)return toInteger;hasRequiredToInteger=1;var e=requireSign(),t=Math.abs,n=Math.floor;return toInteger=function(r){return isNaN(r)?0:0!==(r=Number(r))&&isFinite(r)?e(r)*n(t(r)):r}}function requireToPosInteger(){if(hasRequiredToPosInteger)return toPosInteger;hasRequiredToPosInteger=1;var e=requireToInteger(),t=Math.max;return toPosInteger=function(n){return t(0,e(n))}}function requireResolveLength(){if(hasRequiredResolveLength)return resolveLength;hasRequiredResolveLength=1;var e=requireToPosInteger();return resolveLength=function(t,n,r){var i;return isNaN(t)?(i=n)>=0?r&&i?i-1:i:1:!1!==t&&e(t)}}function requireValidCallable(){return hasRequiredValidCallable?validCallable:(hasRequiredValidCallable=1,validCallable=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e})}function requireValidValue(){if(hasRequiredValidValue)return validValue;hasRequiredValidValue=1;var e=requireIsValue();return validValue=function(t){if(!e(t))throw new TypeError("Cannot use null or undefined");return t}}function require_iterate(){if(hasRequired_iterate)return _iterate;hasRequired_iterate=1;var e=requireValidCallable(),t=requireValidValue(),n=Function.prototype.bind,r=Function.prototype.call,i=Object.keys,o=Object.prototype.propertyIsEnumerable;return _iterate=function(s,a){return function(c,u){var l,d=arguments[2],p=arguments[3];return c=Object(t(c)),e(u),l=i(c),p&&l.sort("function"==typeof p?n.call(p,c):void 0),"function"!=typeof s&&(s=l[s]),r.call(s,l,(function(e,t){return o.call(c,e)?r.call(u,d,c[e],e,c,t):a}))}},_iterate}function requireForEach(){return hasRequiredForEach?forEach:(hasRequiredForEach=1,forEach=require_iterate()("forEach"))}var registeredExtensions={},hasRequiredRegisteredExtensions;function requireRegisteredExtensions(){return hasRequiredRegisteredExtensions||(hasRequiredRegisteredExtensions=1),registeredExtensions}var custom={exports:{}},isImplemented$6,hasRequiredIsImplemented$6,isImplemented$5,hasRequiredIsImplemented$5,shim$4,hasRequiredShim$4,keys,hasRequiredKeys,shim$3,hasRequiredShim$3,assign,hasRequiredAssign,isObject,hasRequiredIsObject,hasRequiredCustom;function requireIsImplemented$6(){return hasRequiredIsImplemented$6||(hasRequiredIsImplemented$6=1,isImplemented$6=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}),isImplemented$6}function requireIsImplemented$5(){return hasRequiredIsImplemented$5?isImplemented$5:(hasRequiredIsImplemented$5=1,isImplemented$5=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}})}function requireShim$4(){if(hasRequiredShim$4)return shim$4;hasRequiredShim$4=1;var e=requireIsValue(),t=Object.keys;return shim$4=function(n){return t(e(n)?Object(n):n)}}function requireKeys(){return hasRequiredKeys?keys:(hasRequiredKeys=1,keys=requireIsImplemented$5()()?Object.keys:requireShim$4())}function requireShim$3(){if(hasRequiredShim$3)return shim$3;hasRequiredShim$3=1;var e=requireKeys(),t=requireValidValue(),n=Math.max;return shim$3=function(r,i){var o,s,a,c=n(arguments.length,2);for(r=Object(t(r)),a=function(e){try{r[e]=i[e]}catch(e){o||(o=e)}},s=1;s-1},shim$2}function requireContains(){return hasRequiredContains?contains:(hasRequiredContains=1,contains=requireIsImplemented$4()()?String.prototype.contains:requireShim$2())}function requireD(){if(hasRequiredD)return d.exports;hasRequiredD=1;var e=requireIs$4(),t=requireIs(),n=requireAssign(),r=requireNormalizeOptions(),i=requireContains(),o=d.exports=function(t,o){var s,a,c,u,l;return arguments.length<2||"string"!=typeof t?(u=o,o=t,t=null):u=arguments[2],e(t)?(s=i.call(t,"c"),a=i.call(t,"e"),c=i.call(t,"w")):(s=c=!0,a=!1),l={value:o,configurable:s,enumerable:a,writable:c},u?n(r(u),l):l};return o.gs=function(o,s,a){var c,u,l,d;return"string"!=typeof o?(l=a,a=s,s=o,o=null):l=arguments[3],e(s)?t(s)?e(a)?t(a)||(l=a,a=void 0):a=void 0:(l=s,s=a=void 0):s=void 0,e(o)?(c=i.call(o,"c"),u=i.call(o,"e")):(c=!0,u=!1),d={get:s,set:a,configurable:c,enumerable:u},l?n(r(l),d):d},d.exports}var eventEmitter={exports:{}},hasRequiredEventEmitter,isImplemented$3,hasRequiredIsImplemented$3,isImplemented$2,hasRequiredIsImplemented$2,implementation,hasRequiredImplementation,globalThis_1,hasRequiredGlobalThis,isImplemented$1,hasRequiredIsImplemented$1,isSymbol,hasRequiredIsSymbol,validateSymbol,hasRequiredValidateSymbol,generateName,hasRequiredGenerateName,standardSymbols,hasRequiredStandardSymbols,symbolRegistry,hasRequiredSymbolRegistry,polyfill,hasRequiredPolyfill,es6Symbol,hasRequiredEs6Symbol,isArguments,hasRequiredIsArguments,isFunction,hasRequiredIsFunction,isString,hasRequiredIsString,shim$1,hasRequiredShim$1,from,hasRequiredFrom,toArray,hasRequiredToArray,resolveResolve,hasRequiredResolveResolve,resolveNormalize,hasRequiredResolveNormalize,configureMap,hasRequiredConfigureMap,plain,hasRequiredPlain,primitive$1,hasRequiredPrimitive,getPrimitiveFixed,hasRequiredGetPrimitiveFixed,isImplemented,hasRequiredIsImplemented,shim,hasRequiredShim,isNan,hasRequiredIsNan,eIndexOf,hasRequiredEIndexOf,get,hasRequiredGet,get1,hasRequiredGet1,getFixed,hasRequiredGetFixed;function requireEventEmitter(){return hasRequiredEventEmitter||(hasRequiredEventEmitter=1,function(e,t){var n,r,i,o,s,a,c,u=requireD(),l=requireValidCallable(),d=Function.prototype.apply,p=Function.prototype.call,f=Object.create,_=Object.defineProperty,m=Object.defineProperties,h=Object.prototype.hasOwnProperty,g={configurable:!0,enumerable:!1,writable:!0};n=function(e,t){var n;return l(t),h.call(this,"__ee__")?n=this.__ee__:(n=g.value=f(null),_(this,"__ee__",g),g.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},r=function(e,t){var r,o;return l(t),o=this,n.call(this,e,r=function(){i.call(o,e,r),d.call(t,this,arguments)}),r.__eeOnceListener__=t,this},i=function(e,t){var n,r,i,o;if(l(t),!h.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"==typeof(r=n[e]))for(o=0;i=r[o];++o)i!==t&&i.__eeOnceListener__!==t||(2===r.length?n[e]=r[o?0:1]:r.splice(o,1));else r!==t&&r.__eeOnceListener__!==t||delete n[e];return this},o=function(e){var t,n,r,i,o;if(h.call(this,"__ee__")&&(i=this.__ee__[e]))if("object"==typeof i){for(n=arguments.length,o=new Array(n-1),t=1;t=55296&&A<=56319&&(C+=p[++_]),C=E?u.call(E,x,C,m):C,f?(l.value=C,d(h,m,l)):h[m]=C,++m;g=m}if(void 0===g)for(g=r(p.length),f&&(h=new f(g)),_=0;_=0?s(l):t(this.length)-s(o(l));c"}}}function requireToShortStringRepresentation(){if(hasRequiredToShortStringRepresentation)return toShortStringRepresentation;hasRequiredToShortStringRepresentation=1;var e=requireSafeToString(),t=/[\n\r\u2028\u2029]/g;return toShortStringRepresentation=function(n){var r=e(n);return r.length>100&&(r=r.slice(0,99)+"…"),r=r.replace(t,(function(e){return JSON.stringify(e).slice(1,-1)}))},toShortStringRepresentation}var isPromise={exports:{}},hasRequiredIsPromise,hasRequiredPromise;function requireIsPromise(){if(hasRequiredIsPromise)return isPromise.exports;function e(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}return hasRequiredIsPromise=1,isPromise.exports=e,isPromise.exports.default=e,isPromise.exports}function requirePromise(){if(hasRequiredPromise)return promise;hasRequiredPromise=1;var e=requireMap(),t=requirePrimitiveSet(),n=requireValidateStringifiableValue(),r=requireToShortStringRepresentation(),i=requireIsPromise(),o=requireNextTick(),s=Object.create,a=t("then","then:finally","done","done:finally");return requireRegisteredExtensions().promise=function(t,c){var u=s(null),l=s(null),d=s(null);if(!0===t)t=null;else if(t=n(t),!a[t])throw new TypeError("'"+r(t)+"' is not valid promise mode");c.on("set",(function(e,n,r){var s=!1;if(!i(r))return l[e]=r,void c.emit("setasync",e,1);u[e]=1,d[e]=r;var a=function(t){var n=u[e];if(s)throw new Error("Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)\nConsider to rely on 'then' or 'done' mode instead.");n&&(delete u[e],l[e]=t,c.emit("setasync",e,n))},p=function(){s=!0,u[e]&&(delete u[e],delete d[e],c.delete(e))},f=t;if(f||(f="then"),"then"===f){var _=function(){o(p)};"function"==typeof(r=r.then((function(e){o(a.bind(this,e))}),_)).finally&&r.finally(_)}else if("done"===f){if("function"!=typeof r.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");r.done(a,p)}else if("done:finally"===f){if("function"!=typeof r.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if("function"!=typeof r.finally)throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");r.done(a),r.finally(p)}})),c.on("get",(function(e,t,n){var r;if(u[e])++u[e];else{r=d[e];var s=function(){c.emit("getasync",e,t,n)};i(r)?"function"==typeof r.done?r.done(s):r.then((function(){o(s)})):s()}})),c.on("delete",(function(e){if(delete d[e],u[e])delete u[e];else if(hasOwnProperty.call(l,e)){var t=l[e];delete l[e],c.emit("deleteasync",e,[t])}})),c.on("clear",(function(){var t=l;l=s(null),u=s(null),d=s(null),c.emit("clearasync",e(t,(function(e){return[e]})))}))},promise}var dispose={},hasRequiredDispose;function requireDispose(){if(hasRequiredDispose)return dispose;hasRequiredDispose=1;var e=requireValidCallable(),t=requireForEach(),n=requireRegisteredExtensions(),r=Function.prototype.apply;return n.dispose=function(i,o,s){var a;if(e(i),s.async&&n.async||s.promise&&n.promise)return o.on("deleteasync",a=function(e,t){r.call(i,null,t)}),void o.on("clearasync",(function(e){t(e,(function(e,t){a(t,e)}))}));o.on("delete",a=function(e,t){i(t)}),o.on("clear",(function(e){t(e,(function(e,t){a(t,e)}))}))},dispose}var maxAge={},maxTimeout,hasRequiredMaxTimeout,validTimeout,hasRequiredValidTimeout,hasRequiredMaxAge;function requireMaxTimeout(){return hasRequiredMaxTimeout?maxTimeout:(hasRequiredMaxTimeout=1,maxTimeout=2147483647)}function requireValidTimeout(){if(hasRequiredValidTimeout)return validTimeout;hasRequiredValidTimeout=1;var e=requireToPosInteger(),t=requireMaxTimeout();return validTimeout=function(n){if((n=e(n))>t)throw new TypeError(n+" exceeds maximum possible timeout");return n}}function requireMaxAge(){if(hasRequiredMaxAge)return maxAge;hasRequiredMaxAge=1;var e=requireFrom(),t=requireForEach(),n=requireNextTick(),r=requireIsPromise(),i=requireValidTimeout(),o=requireRegisteredExtensions(),s=Function.prototype,a=Math.max,c=Math.min,u=Object.create;return o.maxAge=function(l,d,p){var f,_,m,h;(l=i(l))&&(f=u(null),_=p.async&&o.async||p.promise&&o.promise?"async":"",d.on("set"+_,(function(e){f[e]=setTimeout((function(){d.delete(e)}),l),"function"==typeof f[e].unref&&f[e].unref(),h&&(h[e]&&"nextTick"!==h[e]&&clearTimeout(h[e]),h[e]=setTimeout((function(){delete h[e]}),m),"function"==typeof h[e].unref&&h[e].unref())})),d.on("delete"+_,(function(e){clearTimeout(f[e]),delete f[e],h&&("nextTick"!==h[e]&&clearTimeout(h[e]),delete h[e])})),p.preFetch&&(m=!0===p.preFetch||isNaN(p.preFetch)?.333:a(c(Number(p.preFetch),1),0))&&(h={},m=(1-m)*l,d.on("get"+_,(function(t,i,o){h[t]||(h[t]="nextTick",n((function(){var n;"nextTick"===h[t]&&(delete h[t],d.delete(t),p.async&&(i=e(i)).push(s),n=d.memoized.apply(o,i),p.promise&&r(n)&&("function"==typeof n.done?n.done(s,s):n.then(s,s)))})))}))),d.on("clear"+_,(function(){t(f,(function(e){clearTimeout(e)})),f={},h&&(t(h,(function(e){"nextTick"!==e&&clearTimeout(e)})),h={})})))},maxAge}var max={},lruQueue,hasRequiredLruQueue,hasRequiredMax;function requireLruQueue(){if(hasRequiredLruQueue)return lruQueue;hasRequiredLruQueue=1;var e=requireToPosInteger(),t=Object.create,n=Object.prototype.hasOwnProperty;return lruQueue=function(r){var i,o=0,s=1,a=t(null),c=t(null),u=0;return r=e(r),{hit:function(e){var t=c[e],l=++u;if(a[l]=e,c[e]=l,!t){if(++o<=r)return;return e=a[s],i(e),e}if(delete a[t],s===t)for(;!n.call(a,++s);)continue},delete:i=function(e){var t=c[e];if(t&&(delete a[t],delete c[e],--o,s===t)){if(!o)return u=0,void(s=1);for(;!n.call(a,++s);)continue}},clear:function(){o=0,s=1,a=t(null),c=t(null),u=0}}},lruQueue}function requireMax(){if(hasRequiredMax)return max;hasRequiredMax=1;var e=requireToPosInteger(),t=requireLruQueue(),n=requireRegisteredExtensions();return n.max=function(r,i,o){var s,a,c;(r=e(r))&&(a=t(r),s=o.async&&n.async||o.promise&&n.promise?"async":"",i.on("set"+s,c=function(e){void 0!==(e=a.hit(e))&&i.delete(e)}),i.on("get"+s,c),i.on("delete"+s,a.delete),i.on("clear"+s,a.clear))},max}var refCounter={},hasRequiredRefCounter,memoizee,hasRequiredMemoizee;function requireRefCounter(){if(hasRequiredRefCounter)return refCounter;hasRequiredRefCounter=1;var e=requireD(),t=requireRegisteredExtensions(),n=Object.create,r=Object.defineProperties;return t.refCounter=function(i,o,s){var a,c;a=n(null),c=s.async&&t.async||s.promise&&t.promise?"async":"",o.on("set"+c,(function(e,t){a[e]=t||1})),o.on("get"+c,(function(e){++a[e]})),o.on("delete"+c,(function(e){delete a[e]})),o.on("clear"+c,(function(){a={}})),r(o.memoized,{deleteRef:e((function(){var e=o.get(arguments);return null===e?null:a[e]?! --a[e]&&(o.delete(e),!0):null})),getRefCount:e((function(){var e=o.get(arguments);return null===e?0:a[e]?a[e]:0}))})},refCounter}function requireMemoizee(){if(hasRequiredMemoizee)return memoizee;hasRequiredMemoizee=1;var e=requireNormalizeOptions(),t=requireResolveLength(),n=requirePlain();return memoizee=function(r){var i,o=e(arguments[1]);return o.normalizer||0!==(i=o.length=t(o.length,r.length,o.async))&&(o.primitive?!1===i?o.normalizer=requirePrimitive():i>1&&(o.normalizer=requireGetPrimitiveFixed()(i)):o.normalizer=!1===i?requireGet()():1===i?requireGet1()():requireGetFixed()(i)),o.async&&requireAsync(),o.promise&&requirePromise(),o.dispose&&requireDispose(),o.maxAge&&requireMaxAge(),o.max&&requireMax(),o.refCounter&&requireRefCounter(),n(r,o)},memoizee}var memoizeeExports=requireMemoizee(),memoize=getDefaultExportFromCjs(memoizeeExports);function dedupeCommonParameters(e,t){return t.filter((t=>!e.find((e=>t.name&&e.name?t.name===e.name&&t.in===e.in:!(!isRef(t)||!isRef(e))&&t.$ref===e.$ref))))}function usesPolymorphism(e){return e.oneOf?"oneOf":e.anyOf?"anyOf":!!e.allOf&&"allOf"}function objectify(e){return isObject$1(e)?e:{}}function normalizeArray(e){return Array.isArray(e)?e:[e]}function isFunc(e){return"function"==typeof e}function deeplyStripKey(e,t,n=(e,t)=>!0){if("object"!=typeof e||Array.isArray(e)||null===e)return e;const r={...e};return Object.keys(r).forEach((e=>{e===t&&n(r[e],e)?delete r[e]:r[e]=deeplyStripKey(r[e],t,n)})),r}var sampleDefaults=e=>t=>typeof t.default==typeof e?t.default:e,primitives={string:sampleDefaults("string"),string_email:sampleDefaults("user@example.com"),"string_date-time":sampleDefaults((new Date).toISOString()),string_date:sampleDefaults((new Date).toISOString().substring(0,10)),"string_YYYY-MM-DD":sampleDefaults((new Date).toISOString().substring(0,10)),string_uuid:sampleDefaults("3fa85f64-5717-4562-b3fc-2c963f66afa6"),string_hostname:sampleDefaults("example.com"),string_ipv4:sampleDefaults("198.51.100.42"),string_ipv6:sampleDefaults("2001:0db8:5b96:0000:0000:426f:8e17:642a"),number:sampleDefaults(0),number_float:sampleDefaults(0),integer:sampleDefaults(0),boolean:sampleDefaults(!0)},primitive=e=>{e=objectify(e);const{format:t}=e;let{type:n}=e;if("null"===n)return null;Array.isArray(n)&&(1===n.length?n=n[0]:(n.includes("null")&&(n=n.filter((e=>"null"!==e))),n=n.shift()));const r=primitives[`${n}_${t}`]||primitives[n];return isFunc(r)?r(e):`Unknown Type: ${e.type}`};function sampleFromSchema(e,t={}){const n=objectify(e);let{type:r}=n;const i=usesPolymorphism(n);if("allOf"===i)try{return sampleFromSchema(mergeJSONSchemaAllOf(n,{resolvers:{defaultResolver:mergeJSONSchemaAllOf.options.resolvers.title}}),t)}catch(e){return}else if(i){const e=n[i].map((e=>sampleFromSchema(e,t)));return 1===e.length?e[0]:e.some((e=>null===e))?e.find((e=>null!==e)):e[0]}const{example:o,additionalProperties:s,properties:a,items:c}=n,{includeReadOnly:u,includeWriteOnly:l}=t;if(void 0!==o)return deeplyStripKey(o,"$$ref",(e=>"string"==typeof e&&e.indexOf("#")>-1));if(!r)if(a||s)r="object";else{if(!c)return;r="array"}if("object"===r||Array.isArray(r)&&r.includes("object")){const e=objectify(a),n={};for(const r in e)e[r]&&e[r].deprecated||e[r]&&e[r].readOnly&&!u||e[r]&&e[r].writeOnly&&!l||(e[r].examples?.length?n[r]=e[r].examples[0]:n[r]=sampleFromSchema(e[r],t));if(!0===s)n.additionalProp={};else if(s){const e=sampleFromSchema(objectify(s),t);n.additionalProp=e}return n}return"array"===r||Array.isArray(r)&&r.includes("array")?void 0===c?[]:Array.isArray(c.anyOf)?c.anyOf.map((e=>sampleFromSchema(e,t))):Array.isArray(c.oneOf)?c.oneOf.map((e=>sampleFromSchema(e,t))):[sampleFromSchema(c,t)]:e.enum?e.default?e.default:normalizeArray(e.enum)[0]:"file"!==r?primitive(e):void 0}var samples_default=memoize(sampleFromSchema);function getMediaTypeExamples(e,t,n={}){if(t.example)return[{value:t.example}];if(t.examples){const{examples:e}=t,n=Object.keys(e).map((t=>{let n,r=t,i=e[t];if(null!==i&&"object"==typeof i&&("summary"in i&&(r=i.summary),"description"in i&&(n=i.description),"value"in i)){if(null!==i.value&&"object"==typeof i.value&&"$ref"in i.value)return!1;i=i.value}const o={summary:r,title:t,value:i};return n&&(o.description=n),o})).filter(Boolean);if(n.length)return n}return t.schema&&!matches_mimetype_default.xml(e)?[{value:samples_default(JSON.parse(JSON.stringify(t.schema)),n)}]:[]}function getResponseExamples(e){return Object.keys(e.responses||{}).map((t=>{const n=e.responses[t];let r=!1;if(isRef(n))return!1;const i={};return(n.content?Object.keys(n.content):[]).forEach((e=>{if(!e)return;const t=getMediaTypeExamples(e,n.content[e],{includeReadOnly:!0,includeWriteOnly:!1});t&&(i[e]=t)})),n.headers&&Object.keys(n.headers).length&&!Object.keys(i).length&&(i["*/*"]=[],r=!0),!!Object.keys(i).length&&{status:t,mediaTypes:i,...r?{onlyHeaders:r}:{}}})).filter(Boolean)}function getCallbackExamples(e){return[].concat(...Object.keys(e.callbacks||{}).map((t=>{const n=e.callbacks[t];return[].concat(...Object.keys(n).map((e=>Object.keys(n[e]).map((r=>{const i=getResponseExamples(n[e][r]);return 0!==i.length&&{identifier:t,expression:e,method:r,example:i}}))))).filter(Boolean)})))}var noCorrespondingResponseKey="NoCorrespondingResponseForCustomCodeSample";function addMatchingResponseExamples(e,t){t.getResponseExamples().forEach((t=>{Object.entries(t.mediaTypes||{}).forEach((([n,r])=>{r.forEach((r=>{r.title&&Object.keys(e).includes(r.title)&&(e[r.title].response={mediaType:n,mediaTypeExample:r,status:t.status},e[r.title].name||(e[r.title].name=r.summary))}))}))}))}function getDefaultName(e,t){return e.name&&e.name.length>0?e.name:"Default"+(t[e.language]>1?` #${t[e.language]}`:"")}function getExampleGroups(e){const t={},n={},r=getExtension("code-samples",e.api,e);return r?.forEach(((e,r)=>{t[e.language]?t[e.language]+=1:t[e.language]=1;const i=getDefaultName(e,t);n[e.correspondingExample]?.customCodeSamples?.length?n[e.correspondingExample].customCodeSamples.push({...e,name:i,originalIndex:r}):e.correspondingExample?n[e.correspondingExample]={name:i,customCodeSamples:[{...e,name:i,originalIndex:r}]}:n[noCorrespondingResponseKey]?.customCodeSamples?.length?n[noCorrespondingResponseKey].customCodeSamples.push({...e,name:i,originalIndex:r}):n[noCorrespondingResponseKey]={name:i,customCodeSamples:[{...e,name:i,originalIndex:r}]}})),Object.keys(n).length?(addMatchingResponseExamples(n,e),n):(e.getParameters().forEach((e=>{Object.entries(e.examples||{}).forEach((([t,r])=>{n[t]={...n[t],name:n[t]?.name||r.summary,request:{...n[t]?.request,[e.in]:{...n[t]?.request?.[e.in],[e.name]:r.value}}}}))})),e.getRequestBodyExamples().forEach((e=>{e.examples.forEach((t=>{if(t.title){const r="application/x-www-form-urlencoded"===e.mediaType?"formData":"body";n[t.title]={...n[t.title],name:n[t.title]?.name||t.summary,request:{...n[t.title]?.request,[r]:t.value}}}}))})),Object.keys(n).length&&addMatchingResponseExamples(n,e),Object.entries(n).forEach((([e,t])=>{t.request&&!t.response&&delete n[e]})),n)}function getRequestBodyExamples(e){const t=e.requestBody;return t&&t.content?Object.keys(t.content||{}).map((e=>{const n=getMediaTypeExamples(e,t.content[e],{includeReadOnly:!1,includeWriteOnly:!0});return!!n.length&&{mediaType:e,examples:n}})).filter(Boolean):[]}var isJSON=matches_mimetype_default.json;function buildHeadersSchema(e,t){const n=e.headers,r={type:"object",properties:{}};Object.keys(n).forEach((e=>{if(n[e]&&n[e].schema){const i=n[e];r.properties[e]=toJSONSchema(i.schema,{addEnumsToDescriptions:!0,transformer:t.transformer}),i.description&&(r.properties[e].description=i.description)}}));const i={schema:r,type:"object",label:"Headers"};return e.description&&i.schema&&(i.description=e.description),i}function getResponseAsJSONSchema(e,t,n,r){const i=e.getResponseByStatusCode(n),o=[];if(!i)return null;let s=!1,a=!1;function c(e,t){"ref"===t?s=!0:a=!0}const u=function(e){if(!e)return null;const t=Object.keys(e);if(!t.length)return null;for(let n=0;n{matches_mimetype_default.json(e)&&(this.contentType=e)})),this.contentType}isFormUrlEncoded(){return matches_mimetype_default.formUrlEncoded(this.getContentType())}isMultipart(){return matches_mimetype_default.multipart(this.getContentType())}isJson(){return matches_mimetype_default.json(this.getContentType())}isXml(){return matches_mimetype_default.xml(this.getContentType())}isWebhook(){return this instanceof Webhook}getSecurity(){return this.api?.components?.securitySchemes&&Object.keys(this.api.components.securitySchemes).length&&(this.schema.security||this.api.security)||[]}getSecurityWithTypes(e=!1){return this.getSecurity().map((t=>{let n;try{n=Object.keys(t)}catch(e){return!1}const r=n.map((e=>{let n;try{n=this.api.components.securitySchemes[e]}catch(e){return!1}if(!n)return!1;let r=null;if("http"===n.type)r="basic"===n.scheme?"Basic":"bearer"===n.scheme?"Bearer":n.type;else if("oauth2"===n.type)r="OAuth2";else{if("apiKey"!==n.type)return!1;r="query"===n.in?"Query":"header"===n.in?"Header":"cookie"===n.in?"Cookie":n.type}return{type:r,security:{...n,_key:e,_requirements:t[e]}}}));return e?r.filter((e=>!1!==e)):r}))}prepareSecurity(){return this.getSecurityWithTypes().reduce(((e,t)=>t?(t.forEach((t=>{if(!t)return;e[t.type]||(e[t.type]=[]);e[t.type].some((e=>e._key===t.security._key))||(t.security?._requirements&&delete t.security._requirements,e[t.type].push(t.security))})),e):e),{})}getHeaders(){this.headers={request:[],response:[]};const e=this.prepareSecurity();return e.Header&&(this.headers.request=e.Header.map((e=>e.name))),(e.Bearer||e.Basic||e.OAuth2)&&this.headers.request.push("Authorization"),e.Cookie&&this.headers.request.push("Cookie"),this.schema.parameters&&(this.headers.request=this.headers.request.concat(this.schema.parameters.map((e=>{if(e.in&&"header"===e.in)return e.name})).filter((e=>e)))),this.schema.responses&&(this.headers.response=Object.keys(this.schema.responses).filter((e=>this.schema.responses[e].headers)).map((e=>Object.keys(this.schema.responses[e].headers))).reduce(((e,t)=>e.concat(t)),[])),!this.headers.request.includes("Content-Type")&&this.schema.requestBody&&this.schema.requestBody.content&&Object.keys(this.schema.requestBody.content)&&this.headers.request.push("Content-Type"),this.schema.responses&&Object.keys(this.schema.responses).some((e=>!!this.schema.responses[e].content))&&(this.headers.request.includes("Accept")||this.headers.request.push("Accept"),this.headers.response.includes("Content-Type")||this.headers.response.push("Content-Type")),this.headers}hasOperationId(){return Boolean("operationId"in this.schema&&this.schema.operationId.length)}getOperationId(e={}){function t(t){return t.replace(e?.camelCase||e?.friendlyCase?/[^a-zA-Z0-9_]/g:/[^a-zA-Z0-9]/g,"-").replace(/--+/g,"-").replace(/^-|-$/g,"")}let n;n=this.hasOperationId()?this.schema.operationId:t(this.path).toLowerCase();const r=this.method.toLowerCase();return e?.camelCase||e?.friendlyCase?(e?.friendlyCase&&(n=n.replaceAll("_"," "),this.hasOperationId()||(n=n.replace(/[^a-zA-Z0-9_]+(.)/g,((e,t)=>` ${t}`)).split(" ").filter(((e,t,n)=>e!==n[t-1])).join(" "))),n=n.replace(/[^a-zA-Z0-9_]+(.)/g,((e,t)=>t.toUpperCase())),this.hasOperationId()&&(n=t(n)),n=n.replace(/^[0-9]/g,(e=>`_${e}`)),n=n.charAt(0).toLowerCase()+n.slice(1),n.startsWith(r)||this.hasOperationId()?n:(n=n.charAt(0).toUpperCase()+n.slice(1),`${r}${n}`)):this.hasOperationId()?n:`${r}_${n}`}getTags(){if(!("tags"in this.schema))return[];const e=new Map;"tags"in this.api&&this.api.tags.forEach((t=>{e.set(t.name,t)}));const t=Object.fromEntries(e),n=[];return Array.isArray(this.schema.tags)&&this.schema.tags.forEach((e=>{e in t?n.push(t[e]):n.push({name:e})})),n}isDeprecated(){return"deprecated"in this.schema&&this.schema.deprecated}hasParameters(){return!!this.getParameters().length}getParameters(){let e=this.schema?.parameters||[];const t=this.api?.paths?.[this.path]?.parameters||[];return t.length&&(e=e.concat(dedupeCommonParameters(e,t)||[])),e}hasRequiredParameters(){return this.getParameters().some((e=>"required"in e&&e.required))}getParametersAsJSONSchema(e={}){return getParametersAsJSONSchema(this,this.api,{includeDiscriminatorMappingRefs:!0,transformer:e=>e,...e})}getResponseAsJSONSchema(e,t={}){return getResponseAsJSONSchema(this,this.api,e,{includeDiscriminatorMappingRefs:!0,transformer:e=>e,...t})}getResponseStatusCodes(){return this.schema.responses?Object.keys(this.schema.responses):[]}hasRequestBody(){return!!this.schema.requestBody}getRequestBodyMediaTypes(){if(!this.hasRequestBody())return[];const e=this.schema.requestBody;return isRef(e)?[]:Object.keys(e.content)}hasRequiredRequestBody(){if(!this.hasRequestBody())return!1;const e=this.schema.requestBody;return!isRef(e)&&(!!e.required||!!this.getParametersAsJSONSchema().filter((e=>["body","formData"].includes(e.type))).find((e=>e.schema&&Array.isArray(e.schema.required)&&e.schema.required.length)))}getRequestBody(e){if(!this.hasRequestBody())return!1;const t=this.schema.requestBody;if(isRef(t))return!1;if(e)return e in t.content&&t.content[e];let n;const r=this.getRequestBodyMediaTypes();return r.forEach((e=>{!n&&matches_mimetype_default.json(e)&&(n=e)})),n||r.forEach((e=>{n||(n=e)})),!!n&&[n,t.content[n],...t.description?[t.description]:[]]}getRequestBodyExamples(){const e=void 0!==this.requestBodyExamples?.[0]?.examples?.[0].value;return this.requestBodyExamples&&e||(this.requestBodyExamples=getRequestBodyExamples(this.schema)),this.requestBodyExamples}getResponseByStatusCode(e){if(!this.schema.responses)return!1;if(void 0===this.schema.responses[e])return!1;const t=this.schema.responses[e];return!isRef(t)&&t}getResponseExamples(){return this.responseExamples||(this.responseExamples=getResponseExamples(this.schema)),this.responseExamples}hasCallbacks(){return!!this.schema.callbacks}getCallback(e,t,n){if(!this.schema.callbacks)return!1;const r=!!this.schema.callbacks[e]&&this.schema.callbacks[e][t];return!(!r||!r[n])&&new Callback(this.api,t,n,r[n],e,r)}getCallbacks(){const e=[];return!!this.hasCallbacks()&&(Object.keys(this.schema.callbacks).forEach((t=>{Object.keys(this.schema.callbacks[t]).forEach((n=>{const r=this.schema.callbacks[t];if(!isRef(r)){const i=r[n];isRef(i)||Object.keys(i).forEach((r=>{supportedMethods.has(r)&&e.push(this.getCallback(t,n,r))}))}}))})),e)}getCallbackExamples(){return this.callbackExamples||(this.callbackExamples=getCallbackExamples(this.schema)),this.callbackExamples}hasExtension(e){return Boolean(this.schema&&e in this.schema)}getExtension(e){return this.schema?.[e]}getExampleGroups(){if(this.exampleGroups)return this.exampleGroups;const e=getExampleGroups(this);return this.exampleGroups=e,e}},Callback=class extends Operation{constructor(e,t,n,r,i,o){super(e,t,n,r),this.identifier=i,this.parentSchema=o}getIdentifier(){return this.identifier}getSummary(){return this.schema?.summary&&"string"==typeof this.schema.summary?this.schema.summary:this.parentSchema.summary&&"string"==typeof this.parentSchema.summary?this.parentSchema.summary:void 0}getDescription(){return this.schema?.description&&"string"==typeof this.schema.description?this.schema.description:this.parentSchema.description&&"string"==typeof this.parentSchema.description?this.parentSchema.description:void 0}getParameters(){let e=this.schema?.parameters||[];const t=this.parentSchema.parameters||[];return t.length&&(e=e.concat(dedupeCommonParameters(e,t)||[])),e}},Webhook=class extends Operation{getSummary(){return this.schema?.summary&&"string"==typeof this.schema.summary?this.schema.summary:this.api.webhooks[this.path].summary&&"string"==typeof this.api.webhooks[this.path].summary?this.api.webhooks[this.path].summary:void 0}getDescription(){return this.schema?.description&&"string"==typeof this.schema.description?this.schema.description:this.api.webhooks[this.path].description&&"string"==typeof this.api.webhooks[this.path].description?this.api.webhooks[this.path].description:void 0}},libExports=requireLib$d(),$RefParser=getDefaultExportFromCjs(libExports),dist={},hasRequiredDist;function requireDist(){if(hasRequiredDist)return dist;hasRequiredDist=1,Object.defineProperty(dist,"__esModule",{value:!0}),dist.TokenData=void 0,dist.parse=u,dist.compile=function(t,n={}){const{encode:r=encodeURIComponent,delimiter:i=e}=n,o=t instanceof c?t:u(t,n),s=l(o.tokens,i,r);return function(e={}){const[t,...n]=s(e);if(n.length)throw new TypeError(`Missing parameters: ${n.join(", ")}`);return t}},dist.match=function(n,r={}){const{decode:i=decodeURIComponent,delimiter:o=e}=r,{regexp:s,keys:a}=d(n,r),c=a.map((e=>!1===i?t:"param"===e.type?i:e=>e.split(o).map(i)));return function(e){const t=s.exec(e);if(!t)return!1;const n=t[0],r=Object.create(null);for(let e=1;er.test(e)))}(t.name)&&function(e){return"text"!==(null==e?void 0:e.type)||!r.test(e.value[0])}(o[i+1]),a=s?t.name:JSON.stringify(t.name);if("param"===t.type)return`:${a}`;if("wildcard"===t.type)return`*${a}`;throw new TypeError(`Unexpected token: ${t}`)})).join("")};const e="/",t=e=>e,n=/^[$_\p{ID_Start}]$/u,r=/^[$\u200c\u200d\p{ID_Continue}]$/u,i="https://git.new/pathToRegexpError",o={"{":"{","}":"}","(":"(",")":")","[":"[","]":"]","+":"+","?":"?","!":"!"};function s(e){return e.replace(/[.+*?^${}()[\]|/\\]/g,"\\$&")}class a{constructor(e){this.tokens=e}peek(){if(!this._peek){const e=this.tokens.next();this._peek=e.value}return this._peek}tryConsume(e){const t=this.peek();if(t.type===e)return this._peek=void 0,t.value}consume(e){const t=this.tryConsume(e);if(void 0!==t)return t;const{type:n,index:r}=this.peek();throw new TypeError(`Unexpected ${n} at ${r}, expected ${e}: ${i}`)}text(){let e,t="";for(;e=this.tryConsume("CHAR")||this.tryConsume("ESCAPED");)t+=e;return t}}class c{constructor(e){this.tokens=e}}function u(e,s={}){const{encodePath:u=t}=s,l=new a(function*(e){const t=[...e];let s=0;function a(){let e="";if(n.test(t[++s]))for(e+=t[s];r.test(t[++s]);)e+=t[s];else if('"'===t[s]){let n=s;for(;sfunction(e,n,r){if("text"===e.type)return()=>[e.value];if("group"===e.type){const t=l(e.tokens,n,r);return e=>{const[n,...r]=t(e);return r.length?[""]:[n]}}const i=r||t;if("wildcard"===e.type&&!1!==r)return t=>{const r=t[e.name];if(null==r)return["",e.name];if(!Array.isArray(r)||0===r.length)throw new TypeError(`Expected "${e.name}" to be a non-empty array`);return[r.map(((t,n)=>{if("string"!=typeof t)throw new TypeError(`Expected "${e.name}/${n}" to be a string`);return i(t)})).join(n)]};return t=>{const n=t[e.name];if(null==n)return["",e.name];if("string"!=typeof n)throw new TypeError(`Expected "${e.name}" to be a string`);return[i(n)]}}(e,n,r)));return e=>{const t=[""];for(const n of i){const[r,...i]=n(e);t[0]+=r,t.push(...i)}return t}}function d(t,n={}){const{delimiter:r=e,end:i=!0,sensitive:o=!1,trailing:a=!0}=n,l=[],d=[],_=o?"":"i",m=(Array.isArray(t)?t:[t]).map((e=>e instanceof c?e:u(e,n)));for(const{tokens:e}of m)for(const t of p(e,0,[])){const e=f(t,r,l);d.push(e)}let h=`^(?:${d.join("|")})`;a&&(h+=`(?:${s(r)}$)?`),h+=i?"$":`(?=${s(r)}|$)`;return{regexp:new RegExp(h,_),keys:l}}function*p(e,t,n){if(t===e.length)return yield n;const r=e[t];if("group"===r.type){const i=n.slice();for(const n of p(r.tokens,0,i))yield*p(e,t+1,n)}else n.push(r);yield*p(e,t+1,n)}function f(e,t,n){let r="",o="",a=!0;for(let c=0;ce.name===n)):e.keys[0],t):getKey(e,t)}function getAuth(e,t,n){return Object.keys(e?.components?.securitySchemes||{}).map((r=>({[r]:getByScheme(t,{...e.components.securitySchemes[r],_key:r},n)}))).reduce(((e,t)=>Object.assign(e,t)),{})}function getUserVariable(e,t,n){let r=e;return"keys"in e&&Array.isArray(e.keys)&&e.keys.length&&(r=e.keys[0]),r[t]||e[t]||null}var SERVER_VARIABLE_REGEX=/{([-_a-zA-Z0-9:.[\]]+)}/g;function ensureProtocol(e){return e.match(/^\/\//)?`https:${e}`:e.match(/\/\//)?e:`https://${e}`}function stripTrailingSlash(e){return"/"===e[e.length-1]?e.slice(0,-1):e}function normalizedUrl(e,t){const n="https://example.com";let r;try{if(r=e.servers[t].url,!r)throw new Error("no url");if(r=stripTrailingSlash(r),r.startsWith("/")&&!r.startsWith("//")){const e=new URL(n);e.pathname=r,r=e.href}}catch(e){r=n}return ensureProtocol(r)}function transformUrlIntoRegex(e){return stripTrailingSlash(e.replace(SERVER_VARIABLE_REGEX,"([-_a-zA-Z0-9:.[\\]]+)"))}function normalizePath(e){return e.replace(/({?){(.*?)}(}?)/g,((e,...t)=>`:${t[1].replace("-","")}`)).replace(/::/,"\\::").split("?")[0]}function generatePathMatches(e,t,n){const r=t.split("?")[0];return Object.keys(e).map((t=>{const i=normalizePath(t);let o;try{const e=distExports.match(i,{decode:decodeURIComponent});o=e(r)}catch(e){return}const s={};return o&&Object.keys(o.params).length&&Object.keys(o.params).forEach((e=>{s[`:${e}`]=o.params[e]})),{url:{origin:n,path:i.replace(/\\::/,"::"),nonNormalizedPath:t,slugs:s},operation:e[t],match:o}})).filter(Boolean).filter((e=>e.match))}function filterPathMethods(e,t){const n=distExports.pathToRegexp(t);return e.map((e=>{const t=Object.keys(e.operation).filter((e=>n.regexp.exec(e)));if(t.length){const n=t[0];return e.url.method=n.toUpperCase(),{url:e.url,operation:e.operation[n]}}return!1})).filter(Boolean)}function findTargetPath(e){let t,n=Object.keys(e[0].url.slugs).length;for(let r=0;r{n[e]=getUserVariable(this.user,e)||t[e].default||""})),n}splitUrl(e=0){const t=normalizedUrl(this.api,e),n=this.variables(e);return t.split(/({.+?})/).filter(Boolean).map(((e,t)=>{const r=e.match(/[{}]/),i=e.replace(/[{}]/g,""),o=`${i}-${t}`;if(!r)return{type:"text",value:i,key:o};const s=n?.[i];return{type:"variable",value:i,key:o,description:s?.description,enum:s?.enum}}))}splitVariables(e){const t=(this.api.servers||[]).map(((t,n)=>{const r=transformUrlIntoRegex(t.url),i=new RegExp(r).exec(e);if(!i)return!1;const o={};return Array.from(t.url.matchAll(SERVER_VARIABLE_REGEX)).forEach(((e,t)=>{o[e[1]]=i[t+1]})),{selected:n,variables:o}})).filter(Boolean);return!!t.length&&t[0]}replaceUrl(e,t={}){return stripTrailingSlash(e.replace(SERVER_VARIABLE_REGEX,((e,n)=>{if(n in t){const e=t[n];if("object"!=typeof e)return e;if(!Array.isArray(e)&&null!==e&&"default"in e)return e.default}const r=getUserVariable(this.user,n);return r||e})))}operation(e,t,n={}){let r={parameters:[]};if(n.isWebhook){const n=this.api;if(n?.webhooks[e]?.[t])return r=n.webhooks[e][t],new Webhook(n,e,t,r)}return this?.api?.paths?.[e]?.[t]&&(r=this.api.paths[e][t]),new Operation(this.api,e,t,r)}findOperationMatches(e){const{origin:t,hostname:n}=new URL(e),r=new RegExp(t,"i"),{servers:i,paths:o}=this.api;let s,a,c;if(i&&i.length){if(c=i.find((e=>r.exec(this.replaceUrl(e.url,e.variables||{})))),!c){const e=new RegExp(n);c=i.find((t=>e.exec(this.replaceUrl(t.url,t.variables||{}))))}}else c={url:"https://example.com"};if(c)a={...c,url:this.replaceUrl(c.url,c.variables||{})},[,s]=e.split(new RegExp(a.url,"i"));else{const t=i.map((t=>{const n=transformUrlIntoRegex(t.url);if(new RegExp(n).exec(e))return{matchedServer:t,pathName:e.split(new RegExp(n)).slice(-1).pop()}})).filter(Boolean);if(!t.length)return;s=t[0].pathName,a={...t[0].matchedServer}}if(void 0===s)return;""===s&&(s="/");const u=generatePathMatches(o,s,a.url);return u.length?u:void 0}findOperation(e,t){const n=this.findOperationMatches(e);if(!n)return;const r=filterPathMethods(n,t);return r.length?findTargetPath(r):void 0}findOperationWithoutMethod(e){const t=this.findOperationMatches(e);if(t)return findTargetPath(t)}getOperation(e,t){const n=this.findOperation(e,t);if(void 0!==n)return this.operation(n.url.nonNormalizedPath,t)}getOperationById(e){let t;return Object.values(this.getPaths()).forEach((n=>{t||(t=Object.values(n).find((t=>t.getOperationId()===e)))})),t||(Object.entries(this.getWebhooks()).forEach((([,n])=>{t||(t=Object.values(n).find((t=>t.getOperationId()===e)))})),t)}getAuth(e,t){return this.api?.components?.securitySchemes?getAuth(this.api,e,t):{}}getPaths(){const e={};return Object.keys(this.api.paths?this.api.paths:[]).forEach((t=>{t.startsWith("x-")||(e[t]={},"$ref"in this.api.paths[t]&&(this.api.paths[t]=findSchemaDefinition(this.api.paths[t].$ref,this.api)),Object.keys(this.api.paths[t]).forEach((n=>{supportedMethods.has(n)&&(e[t][n]=this.operation(t,n))})))})),e}getWebhooks(){const e={},t=this.api;return Object.keys(t.webhooks?t.webhooks:[]).forEach((n=>{e[n]={},Object.keys(t.webhooks[n]).forEach((t=>{e[n][t]=this.operation(n,t,{isWebhook:!0})}))})),e}getTags(e=!1){const t=new Set,n=this.api.tags?.map((e=>e.name))||[],r=getExtension("disable-tag-sorting",this.api);Object.entries(this.getPaths()).forEach((([n,r])=>{Object.values(r).forEach((r=>{const i=r.getTags();!e||i.length?i.forEach((e=>{t.add(e.name)})):t.add(n)}))})),Object.entries(this.getWebhooks()).forEach((([n,r])=>{Object.values(r).forEach((r=>{const i=r.getTags();!e||i.length?i.forEach((e=>{t.add(e.name)})):t.add(n)}))}));const i=[],o=[];if(r)return Array.from(t);Array.from(t).forEach((e=>{n.includes(e)?o.push(e):i.push(e)}));let s=o.sort(((e,t)=>n.indexOf(e)-n.indexOf(t)));return s=s.concat(i),s}hasExtension(e){return hasRootExtension(e,this.api)}getExtension(e,t){return getExtension(e,this.api,t)}validateExtension(e){if(this.hasExtension("x-readme")){const t=this.getExtension("x-readme");if("object"!=typeof t||Array.isArray(t)||null===t)throw new TypeError('"x-readme" must be of type "Object"');if(e in t)if([CODE_SAMPLES,HEADERS,PARAMETER_ORDERING,SAMPLES_LANGUAGES].includes(e)){if(!Array.isArray(t[e]))throw new TypeError(`"x-readme.${e}" must be of type "Array"`);e===PARAMETER_ORDERING&&validateParameterOrdering(t[e],`x-readme.${e}`)}else if(e===OAUTH_OPTIONS){if("object"!=typeof t[e])throw new TypeError(`"x-readme.${e}" must be of type "Object"`)}else if("boolean"!=typeof t[e])throw new TypeError(`"x-readme.${e}" must be of type "Boolean"`)}if(this.hasExtension(`x-${e}`)){const t=this.getExtension(`x-${e}`);if([CODE_SAMPLES,HEADERS,PARAMETER_ORDERING,SAMPLES_LANGUAGES].includes(e)){if(!Array.isArray(t))throw new TypeError(`"x-${e}" must be of type "Array"`);e===PARAMETER_ORDERING&&validateParameterOrdering(t,`x-${e}`)}else if(e===OAUTH_OPTIONS){if("object"!=typeof t)throw new TypeError(`"x-${e}" must be of type "Object"`)}else if("boolean"!=typeof t)throw new TypeError(`"x-${e}" must be of type "Boolean"`)}}validateExtensions(){Object.keys(extensionDefaults).forEach((e=>{this.validateExtension(e)}))}getCircularReferences(){if(!this.dereferencing.complete)throw new Error("#dereference() must be called first in order for this method to obtain circular references.");return this.dereferencing.circularRefs}async dereference(e={preserveRefAsJSONSchemaTitle:!1}){if(this.dereferencing.complete)return new Promise((e=>{e(!0)}));if(this.dereferencing.processing)return new Promise(((e,t)=>{this.promises.push({resolve:e,reject:t})}));this.dereferencing.processing=!0;const{api:t,promises:n}=this;t&&t.components&&t.components.schemas&&"object"==typeof t.components.schemas&&Object.keys(t.components.schemas).forEach((n=>{isPrimitive(t.components.schemas[n])||Array.isArray(t.components.schemas[n])||null===t.components.schemas[n]||(e.preserveRefAsJSONSchemaTitle&&(t.components.schemas[n].title=n),t.components.schemas[n]["x-readme-ref-name"]=n)}));const r=new $RefParser;return r.dereference(t||{},{resolve:{external:!1},dereference:{circular:"ignore"}}).then((t=>{let i=[];r.$refs.circular&&(i=r.$refs.circularRefs.map((e=>`#${e.split("#")[1]}`))),this.api=t,this.promises=n,this.dereferencing={processing:!1,complete:!0,circularRefs:i},e.cb&&e.cb()})).then((()=>this.promises.map((e=>e.resolve()))))}};class Hooks{add(e,t,n){if("string"!=typeof arguments[0])for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach((function(e){this[e]=this[e]||[],t&&this[e][n?"unshift":"push"](t)}),this)}run(e,t){this[e]=this[e]||[],this[e].forEach((function(e){e.call(t&&t.context?t.context:t,t)}))}}class Plugins{constructor(e){this.jsep=e,this.registered={}}register(...e){e.forEach((e=>{if("object"!=typeof e||!e.name||!e.init)throw new Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)}))}}class Jsep{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+Jsep.version}static addUnaryOp(e){return Jsep.max_unop_len=Math.max(e.length,Jsep.max_unop_len),Jsep.unary_ops[e]=1,Jsep}static addBinaryOp(e,t,n){return Jsep.max_binop_len=Math.max(e.length,Jsep.max_binop_len),Jsep.binary_ops[e]=t,n?Jsep.right_associative.add(e):Jsep.right_associative.delete(e),Jsep}static addIdentifierChar(e){return Jsep.additional_identifier_chars.add(e),Jsep}static addLiteral(e,t){return Jsep.literals[e]=t,Jsep}static removeUnaryOp(e){return delete Jsep.unary_ops[e],e.length===Jsep.max_unop_len&&(Jsep.max_unop_len=Jsep.getMaxKeyLen(Jsep.unary_ops)),Jsep}static removeAllUnaryOps(){return Jsep.unary_ops={},Jsep.max_unop_len=0,Jsep}static removeIdentifierChar(e){return Jsep.additional_identifier_chars.delete(e),Jsep}static removeBinaryOp(e){return delete Jsep.binary_ops[e],e.length===Jsep.max_binop_len&&(Jsep.max_binop_len=Jsep.getMaxKeyLen(Jsep.binary_ops)),Jsep.right_associative.delete(e),Jsep}static removeAllBinaryOps(){return Jsep.binary_ops={},Jsep.max_binop_len=0,Jsep}static removeLiteral(e){return delete Jsep.literals[e],Jsep}static removeAllLiterals(){return Jsep.literals={},Jsep}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new Jsep(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map((e=>e.length)))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return Jsep.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!Jsep.binary_ops[String.fromCharCode(e)]||Jsep.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return Jsep.isIdentifierStart(e)||Jsep.isDecimalDigit(e)}throwError(e){const t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(Jsep.hooks[e]){const n={context:this,node:t};return Jsep.hooks.run(e,n),n.node}return t}searchHook(e){if(Jsep.hooks[e]){const t={context:this};return Jsep.hooks[e].find((function(e){return e.call(t.context,t),t.node})),t.node}}gobbleSpaces(){let e=this.code;for(;e===Jsep.SPACE_CODE||e===Jsep.TAB_CODE||e===Jsep.LF_CODE||e===Jsep.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const e=this.gobbleExpressions(),t=1===e.length?e[0]:{type:Jsep.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t,n,r=[];for(;this.index0;){if(Jsep.binary_ops.hasOwnProperty(e)&&(!Jsep.isIdentifierStart(this.code)||this.index+e.lengthi.right_a&&e.right_a?n>e.prec:n<=e.prec;for(;r.length>2&&a(r[r.length-2]);)s=r.pop(),t=r.pop().value,o=r.pop(),e={type:Jsep.BINARY_EXP,operator:t,left:o,right:s},r.push(e);e=this.gobbleToken(),e||this.throwError("Expected expression after "+c),r.push(i,e)}for(a=r.length-1,e=r[a];a>1;)e={type:Jsep.BINARY_EXP,operator:r[a-1].value,left:r[a-2],right:e},a-=2;return e}gobbleToken(){let e,t,n,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"),r)return this.runHook("after-token",r);if(e=this.code,Jsep.isDecimalDigit(e)||e===Jsep.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===Jsep.SQUOTE_CODE||e===Jsep.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(e===Jsep.OBRACK_CODE)r=this.gobbleArray();else{for(t=this.expr.substr(this.index,Jsep.max_unop_len),n=t.length;n>0;){if(Jsep.unary_ops.hasOwnProperty(t)&&(!Jsep.isIdentifierStart(this.code)||this.index+t.length=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(i===Jsep.COMMA_CODE){if(this.index++,r++,r!==t.length)if(e===Jsep.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===Jsep.CBRACK_CODE)for(let e=t.length;e":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),Jsep.max_unop_len=Jsep.getMaxKeyLen(Jsep.unary_ops),Jsep.max_binop_len=Jsep.getMaxKeyLen(Jsep.binary_ops);const jsep=e=>new Jsep(e).parse(),stdClassProps=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Jsep).filter((e=>!stdClassProps.includes(e)&&void 0===jsep[e])).forEach((e=>{jsep[e]=Jsep[e]})),jsep.Jsep=Jsep;const CONDITIONAL_EXP="ConditionalExpression";var ternary={name:"ternary",init(e){e.hooks.add("after-expression",(function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;const n=t.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;const i=this.gobbleExpression();if(i||this.throwError("Expected expression"),t.node={type:CONDITIONAL_EXP,test:n,consequent:r,alternate:i},n.operator&&e.binary_ops[n.operator]<=.9){let r=n;for(;r.right.operator&&e.binary_ops[r.right.operator]<=.9;)r=r.right;t.node.test=r.right,r.right=t.node,t.node=n}}else this.throwError("Expected :")}}))}};jsep.plugins.register(ternary);const FSLASH_CODE=47,BSLASH_CODE=92;var index={name:"regex",init(e){e.hooks.add("gobble-token",(function(t){if(this.code===FSLASH_CODE){const n=++this.index;let r=!1;for(;this.index=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;o+=this.char}try{i=new RegExp(r,o)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:i,raw:this.expr.slice(n-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?r=!0:r&&this.code===e.CBRACK_CODE&&(r=!1),this.index+=this.code===BSLASH_CODE?2:1}this.throwError("Unclosed Regex")}}))}};const PLUS_CODE=43,MINUS_CODE=45,plugin={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[PLUS_CODE,MINUS_CODE],assignmentPrecedence:.9,init(e){const t=[e.IDENTIFIER,e.MEMBER_EXP];function n(e){plugin.assignmentOperators.has(e.operator)?(e.type="AssignmentExpression",n(e.left),n(e.right)):e.operator||Object.values(e).forEach((e=>{e&&"object"==typeof e&&n(e)}))}plugin.assignmentOperators.forEach((t=>e.addBinaryOp(t,plugin.assignmentPrecedence,!0))),e.hooks.add("gobble-token",(function(e){const n=this.code;plugin.updateOperators.some((e=>e===n&&e===this.expr.charCodeAt(this.index+1)))&&(this.index+=2,e.node={type:"UpdateExpression",operator:n===PLUS_CODE?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},e.node.argument&&t.includes(e.node.argument.type)||this.throwError(`Unexpected ${e.node.operator}`))})),e.hooks.add("after-token",(function(e){if(e.node){const n=this.code;plugin.updateOperators.some((e=>e===n&&e===this.expr.charCodeAt(this.index+1)))&&(t.includes(e.node.type)||this.throwError(`Unexpected ${e.node.operator}`),this.index+=2,e.node={type:"UpdateExpression",operator:n===PLUS_CODE?"++":"--",argument:e.node,prefix:!1})}})),e.hooks.add("after-expression",(function(e){e.node&&n(e.node)}))}};jsep.plugins.register(index,plugin),jsep.addUnaryOp("typeof"),jsep.addLiteral("null",null),jsep.addLiteral("undefined",void 0);const BLOCKED_PROTO_PROPERTIES=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__"]),SafeEval={evalAst(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":return SafeEval.evalBinaryExpression(e,t);case"Compound":return SafeEval.evalCompound(e,t);case"ConditionalExpression":return SafeEval.evalConditionalExpression(e,t);case"Identifier":return SafeEval.evalIdentifier(e,t);case"Literal":return SafeEval.evalLiteral(e,t);case"MemberExpression":return SafeEval.evalMemberExpression(e,t);case"UnaryExpression":return SafeEval.evalUnaryExpression(e,t);case"ArrayExpression":return SafeEval.evalArrayExpression(e,t);case"CallExpression":return SafeEval.evalCallExpression(e,t);case"AssignmentExpression":return SafeEval.evalAssignmentExpression(e,t);default:throw SyntaxError("Unexpected expression",e)}},evalBinaryExpression:(e,t)=>({"||":(e,t)=>e||t(),"&&":(e,t)=>e&&t(),"|":(e,t)=>e|t(),"^":(e,t)=>e^t(),"&":(e,t)=>e&t(),"==":(e,t)=>e==t(),"!=":(e,t)=>e!=t(),"===":(e,t)=>e===t(),"!==":(e,t)=>e!==t(),"<":(e,t)=>e":(e,t)=>e>t(),"<=":(e,t)=>e<=t(),">=":(e,t)=>e>=t(),"<<":(e,t)=>e<>":(e,t)=>e>>t(),">>>":(e,t)=>e>>>t(),"+":(e,t)=>e+t(),"-":(e,t)=>e-t(),"*":(e,t)=>e*t(),"/":(e,t)=>e/t(),"%":(e,t)=>e%t()}[e.operator](SafeEval.evalAst(e.left,t),(()=>SafeEval.evalAst(e.right,t)))),evalCompound(e,t){let n;for(let r=0;rSafeEval.evalAst(e.test,t)?SafeEval.evalAst(e.consequent,t):SafeEval.evalAst(e.alternate,t),evalIdentifier(e,t){if(Object.hasOwn(t,e.name))return t[e.name];throw ReferenceError(`${e.name} is not defined`)},evalLiteral:e=>e.value,evalMemberExpression(e,t){const n=e.computed?SafeEval.evalAst(e.property):e.property.name,r=SafeEval.evalAst(e.object,t);if(null==r)throw TypeError(`Cannot read properties of ${r} (reading '${n}')`);if(!Object.hasOwn(r,n)&&BLOCKED_PROTO_PROPERTIES.has(n))throw TypeError(`Cannot read properties of ${r} (reading '${n}')`);const i=r[n];return"function"==typeof i?i.bind(r):i},evalUnaryExpression:(e,t)=>({"-":e=>-SafeEval.evalAst(e,t),"!":e=>!SafeEval.evalAst(e,t),"~":e=>~SafeEval.evalAst(e,t),"+":e=>+SafeEval.evalAst(e,t),typeof:e=>typeof SafeEval.evalAst(e,t)}[e.operator](e.argument)),evalArrayExpression:(e,t)=>e.elements.map((e=>SafeEval.evalAst(e,t))),evalCallExpression(e,t){const n=e.arguments.map((e=>SafeEval.evalAst(e,t)));return SafeEval.evalAst(e.callee,t)(...n)},evalAssignmentExpression(e,t){if("Identifier"!==e.left.type)throw SyntaxError("Invalid left-hand side in assignment");const n=e.left.name,r=SafeEval.evalAst(e.right,t);return t[n]=r,t[n]}};class SafeScript{constructor(e){this.code=e,this.ast=jsep(this.code)}runInNewContext(e){const t=Object.assign(Object.create(null),e);return SafeEval.evalAst(this.ast,t)}}function push(e,t){return(e=e.slice()).push(t),e}function unshift(e,t){return(t=t.slice()).unshift(e),t}class NewError extends Error{constructor(e){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=e,this.name="NewError"}}function JSONPath(e,t,n,r,i){if(!(this instanceof JSONPath))try{return new JSONPath(e,t,n,r,i)}catch(e){if(!e.avoidNew)throw e;return e.value}"string"==typeof e&&(i=r,r=n,n=t,t=e,e=null);const o=e&&"object"==typeof e;if(e=e||{},this.json=e.json||n,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=!Object.hasOwn(e,"wrap")||e.wrap,this.sandbox=e.sandbox||{},this.eval=void 0===e.eval?"safe":e.eval,this.ignoreEvalErrors=void 0!==e.ignoreEvalErrors&&e.ignoreEvalErrors,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||r||null,this.otherTypeCallback=e.otherTypeCallback||i||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},!1!==e.autostart){const r={path:o?e.path:t};o?"json"in e&&(r.json=e.json):r.json=n;const i=this.evaluate(r);if(!i||"object"!=typeof i)throw new NewError(i);return i}}function query(e,t){const n=e.map((e=>JSONPath({path:e,json:t,resultType:"all"}))).filter((e=>!!e.length&&e)).reduce(((e,t)=>e.concat(t)),[]);return n.sort(((e,t)=>e.pointert.pointer?1:0)),n}function refizePointer(e){return`#${e}`}function additionalProperties(e){return query(["$..additionalProperties"],e).map((e=>refizePointer(e.pointer)))}function callbacks(e){return query(["$.components.callbacks","$.paths..callbacks"],e).map((e=>refizePointer(e.pointer)))}async function circularRefs(e){const t=new Oas(JSON.parse(JSON.stringify(e)));await t.dereference();const n=t.getCircularReferences();return n.sort(),n}function commonParameters(e){return query(["$..paths[*].parameters"],e).map((e=>refizePointer(e.pointer)))}function discriminators(e){return query(["$..discriminator"],e).map((e=>refizePointer(e.pointer)))}function links(e){return query(["$..links"],e).map((e=>refizePointer(e.pointer)))}function mediaTypes(e){const t=Array.from(new Set(query(["$..paths..content"],e).map((e=>Object.keys(e.value))).flat()));return t.sort(),t}function parameterSerialization(e){return query(["$..parameters[*].style^"],e).map((e=>refizePointer(e.pointer)))}function polymorphism(e){const t=Array.from(new Set(query(["$..allOf^","$..anyOf^","$..oneOf^"],e).map((e=>refizePointer(e.pointer)))));return t.sort(),t}function securityTypes(e){return Array.from(new Set(query(["$.components.securitySchemes..type"],e).map((e=>e.value))))}function serverVariables(e){return query(["$.servers..variables^"],e).map((e=>refizePointer(e.pointer)))}function totalOperations(e){return query(["$..paths[*]"],e).map((e=>Object.keys(e.value))).flat().length}function webhooks(e){return query(["$.webhooks[*]"],e).map((e=>refizePointer(e.pointer)))}function xml(e){return query(["$.components.schemas..xml^","$..parameters..xml^","$..requestBody..xml^","$..requestBody..['application/xml']","$..requestBody..['application/xml-external-parsed-entity']","$..requestBody..['application/xml-dtd']","$..requestBody..['text/xml']","$..requestBody..['text/xml-external-parsed-entity']","$..requestBody.content[?(@property.match(/\\+xml$/i))]","$..responses..['application/xml']","$..responses..['application/xml-external-parsed-entity']","$..responses..['application/xml-dtd']","$..responses..['text/xml']","$..responses..['text/xml-external-parsed-entity']","$..responses[*].content[?(@property.match(/\\+xml$/i))]"],e).map((e=>refizePointer(e.pointer)))}function authDefaults(e){return query(["$.components.securitySchemes..['x-default']^"],e).map((e=>refizePointer(e.pointer)))}function codeSampleLanguages(e){const t=Array.from(new Set(query(["$..['x-readme']['samples-languages']","$..['x-samples-languages']"],e).map((e=>e.value)).reduce(((e,t)=>e.concat(t)),[])));return t.sort(),t}function codeSamplesDisabled(e){return Array.from(new Set(query(["$['x-samples-enabled']^","$['x-readme']['samples-enabled']","$..paths[*]..['x-samples-enabled']^","$..paths[*]..['x-readme']['samples-enabled']^^"],e).map((e=>refizePointer(e.pointer)))))}function corsProxyDisabled(e){return Array.from(new Set(query(["$['x-proxy-enabled']^","$['x-readme']['proxy-enabled']","$..paths[*]..['x-proxy-enabled']^","$..paths[*]..['x-readme']['proxy-enabled']^^"],e).map((e=>refizePointer(e.pointer)))))}function customCodeSamples(e){return query(["$..['x-code-samples']","$..['x-readme']['code-samples']"],e).filter((e=>!(!Array.isArray(e.value)||!e.value.length)&&e)).map((e=>refizePointer(e.pointer)))}function explorerDisabled(e){return query(["$['x-explorer-enabled']^","$['x-readme']['explorer-enabled']","$..paths[*]..['x-explorer-enabled']^","$..paths[*]..['x-readme']['explorer-enabled']^^"],e).map((e=>refizePointer(e.pointer)))}function rawBody(e){return query(["$..RAW_BODY^^"],e).map((e=>refizePointer(e.pointer)))}function staticHeaders(e){return query(["$..['x-headers']","$..['x-readme']['headers']"],e).filter((e=>!(!Array.isArray(e.value)||!e.value.length)&&e)).map((e=>refizePointer(e.pointer)))}function refNames(e){return query(["$..['x-readme-ref-name']"],e).map((e=>refizePointer(e.pointer)))}async function analyzer(e){const t=additionalProperties(e),n=callbacks(e),r=await circularRefs(e),i=commonParameters(e),o=discriminators(e),s=links(e),a=parameterSerialization(e),c=polymorphism(e),u=serverVariables(e),l=webhooks(e),d=xml(e),p=authDefaults(e),f=codeSampleLanguages(e),_=customCodeSamples(e),m=codeSamplesDisabled(e),h=corsProxyDisabled(e),g=explorerDisabled(e),A=staticHeaders(e),y=rawBody(e),v=refNames(e),b={general:{mediaTypes:{name:"Media Type",found:mediaTypes(e)},operationTotal:{name:"Operation",found:totalOperations(e)},securityTypes:{name:"Security Type",found:securityTypes(e)}},openapi:{additionalProperties:{present:!!t.length,locations:t},callbacks:{present:!!n.length,locations:n},circularRefs:{present:!!r.length,locations:r},commonParameters:{present:!!i.length,locations:i},discriminators:{present:!!o.length,locations:o},links:{present:!!s.length,locations:s},style:{present:!!a.length,locations:a},polymorphism:{present:!!c.length,locations:c},serverVariables:{present:!!u.length,locations:u},webhooks:{present:!!l.length,locations:l},xml:{present:!!d.length,locations:d}},readme:{"x-default":{present:!!p.length,locations:p},"x-readme.code-samples":{present:!!_.length,locations:_},"x-readme.headers":{present:!!A.length,locations:A},"x-readme.explorer-enabled":{present:!!g.length,locations:g},"x-readme.proxy-enabled":{present:!!h.length,locations:h},"x-readme.samples-languages":{present:!!f.length,locations:f},"x-readme-ref-name":{present:!!v.length,locations:v}}};return m.length&&(b.readme["x-readme.samples-enabled"]={present:!!m.length,locations:m}),y.length&&(b.readme.raw_body={present:!!y.length,locations:y}),b}JSONPath.prototype.evaluate=function(e,t,n,r){let i=this.parent,o=this.parentProperty,{flatten:s,wrap:a}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,n=n||this.callback,this.currOtherTypeCallback=r||this.otherTypeCallback,t=t||this.json,(e=e||this.path)&&"object"==typeof e&&!Array.isArray(e)){if(!e.path&&""!==e.path)throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=e),s=Object.hasOwn(e,"flatten")?e.flatten:s,this.currResultType=Object.hasOwn(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=Object.hasOwn(e,"sandbox")?e.sandbox:this.currSandbox,a=Object.hasOwn(e,"wrap")?e.wrap:a,this.currEval=Object.hasOwn(e,"eval")?e.eval:this.currEval,n=Object.hasOwn(e,"callback")?e.callback:n,this.currOtherTypeCallback=Object.hasOwn(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,i=Object.hasOwn(e,"parent")?e.parent:i,o=Object.hasOwn(e,"parentProperty")?e.parentProperty:o,e=e.path}if(i=i||null,o=o||null,Array.isArray(e)&&(e=JSONPath.toPathString(e)),!e&&""!==e||!t)return;const c=JSONPath.toPathArray(e);"$"===c[0]&&c.length>1&&c.shift(),this._hasParentSelector=null;const u=this._trace(c,t,["$"],i,o,n).filter((function(e){return e&&!e.isParentSelector}));return u.length?a||1!==u.length||u[0].hasArrExpr?u.reduce(((e,t)=>{const n=this._getPreferredOutput(t);return s&&Array.isArray(n)?e=e.concat(n):e.push(n),e}),[]):this._getPreferredOutput(u[0]):a?[]:void 0},JSONPath.prototype._getPreferredOutput=function(e){const t=this.currResultType;switch(t){case"all":{const t=Array.isArray(e.path)?e.path:JSONPath.toPathArray(e.path);return e.pointer=JSONPath.toPointer(t),e.path="string"==typeof e.path?e.path:JSONPath.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return JSONPath.toPathString(e[t]);case"pointer":return JSONPath.toPointer(e.path);default:throw new TypeError("Unknown result type")}},JSONPath.prototype._handleCallback=function(e,t,n){if(t){const r=this._getPreferredOutput(e);e.path="string"==typeof e.path?e.path:JSONPath.toPathString(e.path),t(r,n,e)}},JSONPath.prototype._trace=function(e,t,n,r,i,o,s,a){let c;if(!e.length)return c={path:n,value:t,parent:r,parentProperty:i,hasArrExpr:s},this._handleCallback(c,o,"value"),c;const u=e[0],l=e.slice(1),d=[];function p(e){Array.isArray(e)?e.forEach((e=>{d.push(e)})):d.push(e)}if(("string"!=typeof u||a)&&t&&Object.hasOwn(t,u))p(this._trace(l,t[u],push(n,u),t,u,o,s));else if("*"===u)this._walk(t,(e=>{p(this._trace(l,t[e],push(n,e),t,e,o,!0,!0))}));else if(".."===u)p(this._trace(l,t,n,r,i,o,s)),this._walk(t,(r=>{"object"==typeof t[r]&&p(this._trace(e.slice(),t[r],push(n,r),t,r,o,!0))}));else{if("^"===u)return this._hasParentSelector=!0,{path:n.slice(0,-1),expr:l,isParentSelector:!0};if("~"===u)return c={path:push(n,u),value:i,parent:r,parentProperty:null},this._handleCallback(c,o,"property"),c;if("$"===u)p(this._trace(l,t,n,null,null,o,s));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(u))p(this._slice(u,l,t,n,r,i,o));else if(0===u.indexOf("?(")){if(!1===this.currEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const e=u.replace(/^\?\((.*?)\)$/u,"$1"),s=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(e);s?this._walk(t,(e=>{const a=[s[2]],c=s[1]?t[e][s[1]]:t[e];this._trace(a,c,n,r,i,o,!0).length>0&&p(this._trace(l,t[e],push(n,e),t,e,o,!0))})):this._walk(t,(s=>{this._eval(e,t[s],s,n,r,i)&&p(this._trace(l,t[s],push(n,s),t,s,o,!0))}))}else if("("===u[0]){if(!1===this.currEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(unshift(this._eval(u,t,n.at(-1),n.slice(0,-1),r,i),l),t,n,r,i,o,s))}else if("@"===u[0]){let e=!1;const s=u.slice(1,-2);switch(s){case"scalar":t&&["object","function"].includes(typeof t)||(e=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===s&&(e=!0);break;case"integer":!Number.isFinite(t)||t%1||(e=!0);break;case"number":Number.isFinite(t)&&(e=!0);break;case"nonFinite":"number"!=typeof t||Number.isFinite(t)||(e=!0);break;case"object":t&&typeof t===s&&(e=!0);break;case"array":Array.isArray(t)&&(e=!0);break;case"other":e=this.currOtherTypeCallback(t,n,r,i);break;case"null":null===t&&(e=!0);break;default:throw new TypeError("Unknown value type "+s)}if(e)return c={path:n,value:t,parent:r,parentProperty:i},this._handleCallback(c,o,"value"),c}else if("`"===u[0]&&t&&Object.hasOwn(t,u.slice(1))){const e=u.slice(1);p(this._trace(l,t[e],push(n,e),t,e,o,s,!0))}else if(u.includes(",")){const e=u.split(",");for(const s of e)p(this._trace(unshift(s,l),t,n,r,i,o,!0))}else!a&&t&&Object.hasOwn(t,u)&&p(this._trace(l,t[u],push(n,u),t,u,o,s,!0))}if(this._hasParentSelector)for(let e=0;e{t(e)}))},JSONPath.prototype._slice=function(e,t,n,r,i,o,s){if(!Array.isArray(n))return;const a=n.length,c=e.split(":"),u=c[2]&&Number.parseInt(c[2])||1;let l=c[0]&&Number.parseInt(c[0])||0,d=c[1]&&Number.parseInt(c[1])||a;l=l<0?Math.max(0,l+a):Math.min(a,l),d=d<0?Math.max(0,d+a):Math.min(a,d);const p=[];for(let e=l;e{p.push(e)}))}return p},JSONPath.prototype._eval=function(e,t,n,r,i,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=i,this.currSandbox._$_property=n,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;const s=e.includes("@path");s&&(this.currSandbox._$_path=JSONPath.toPathString(r.concat([n])));const a=this.currEval+"Script:"+e;if(!JSONPath.cache[a]){let t=e.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(s&&(t=t.replaceAll("@path","_$_path")),"safe"===this.currEval||!0===this.currEval||void 0===this.currEval)JSONPath.cache[a]=new this.safeVm.Script(t);else if("native"===this.currEval)JSONPath.cache[a]=new this.vm.Script(t);else if("function"==typeof this.currEval&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const e=this.currEval;JSONPath.cache[a]=new e(t)}else{if("function"!=typeof this.currEval)throw new TypeError(`Unknown "eval" property "${this.currEval}"`);JSONPath.cache[a]={runInNewContext:e=>this.currEval(t,e)}}}try{return JSONPath.cache[a].runInNewContext(this.currSandbox)}catch(t){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+t.message+": "+e)}},JSONPath.cache={},JSONPath.toPathString=function(e){const t=e,n=t.length;let r="$";for(let e=1;e{const t=e;return t.openapi&&Object.entries(OPENAPI_FEATURE_DOCS).forEach((([e,n])=>{t.openapi[e]={...t.openapi[e],...n}})),t.readme&&Object.entries(README_FEATURE_DOCS).forEach((([e,n])=>{e in t.readme&&(t.readme[e]={...t.readme[e],...n})})),t}))}function getSupportedFeatures(){return[...Object.keys(OPENAPI_FEATURE_DOCS),"readme"]}class SoftError extends Error{constructor(e){super(e),this.name="SoftError"}}function pluralize(e,t){return t>1?`${e}s`:e}function getFeatureDocsURL(e,t){if(e.url)return"object"==typeof e.url?t.startsWith("3.0")?e.url?.["3.0"]||"This feature is not available on OpenAPI v3.0.":t.startsWith("3.1")?e.url?.[3.1]||"This feature is not available on OpenAPI v3.1.":"":e.url}function buildFeaturesReport(e,t){let n=!1;const r=[""];return t.forEach((t=>{if(t in e.openapi){const i=e.openapi[t];i.present?(r.push(""),r.push(`${t}:`),r.push(...i.locations.map((e=>` · ${chalk.yellow(e)}`)))):(r.length&&r[r.length-1].length&&r.push(""),r.push(`${t}: You do not use this.`),n=!0)}})),t.includes("readme")&&(t.length>1&&r[r.length-1].length&&r.push(""),Object.entries(e.readme).forEach((([e,t])=>{t.hidden||(t.present?(r.push(`${e}:`),r.push(...t.locations.map((e=>` · ${chalk.yellow(e)}`))),r.push("")):(r.push(`${e}: You do not use this.`),n=!0))}))),r[1].length||r.splice(0,1),r[r.length-1].length||r.pop(),{report:r.join("\n"),hasUnusedFeature:n}}function buildFullReport(e,t,n){const r=["Here are some interesting things we found in your API definition. 🕵️",""];return r.push(...Object.entries(e.general||{}).map((([,e])=>{if(Array.isArray(e.found)){if(!e.found.length)return!1;const t=e.found.map((e=>chalk.yellow(e)));if(e.found.length>1){const n=pluralize(e.name.toLowerCase(),e.found.length);return`You are using ${chalk.bold(e.found.length)} ${n} throughout your API: ${new Intl.ListFormat("en").format(t)}`}return`You are using a single ${e.name.toLowerCase()} throughout your API: ${t[0]}`}if(e.found>1){let t;return t=`You have a total of ${chalk.bold(e.found)} ${pluralize(e.name.toLowerCase(),e.found)} in your API.`,e.found>200&&(t+=` ${chalk.cyanBright("Wow! 🤯")}`),t}return`You have a single ${e.name.toLowerCase()} in your API.`})).filter(Boolean).map((e=>` · ${e}`))),r.push(""),[{component:"openapi",header:"OpenAPI Features",emoji:"🌲"},{component:"readme",header:"ReadMe-Specific Features and Extensions",emoji:"🦉"}].forEach((({component:i,header:o,emoji:s})=>{const a=[[chalk.bold.yellow("Feature"),chalk.bold.yellow("Used?"),chalk.bold.yellow("Description")],...Object.entries(e[i]).map((([e,n])=>{if(n.hidden)return!1;const r=[];n.description&&r.push(n.description);const i=getFeatureDocsURL(n,t);return i&&r.push(chalk.dim(i)),[e,n.present?"🟢":"🔴",r.join("\n\n")]})).filter(Boolean)];r.push(`${s} ${o}`),r.push(srcExports$1.table(a,{border:n,columns:{0:{width:26},2:{width:80,wrapWord:!0}}}))})),r.join("\n")}class OpenAPIInspectCommand extends BaseCommand{static summary="Analyze an OpenAPI/Swagger definition for various OpenAPI and ReadMe feature usage.";static description="This command will perform a comprehensive analysis of your API definition to determine how it's utilizing aspects of the OpenAPI Specification (such as circular references, polymorphism, etc.) and any ReadMe-specific extensions you might be using.";static args={spec:specArg};static flags={feature:libExports$3.Flags.string({description:"A specific OpenAPI or ReadMe feature you wish to see detailed information on (if it exists). If any features supplied do not exist within the API definition an exit(1) code will be returned alongside the report.",multiple:!0,options:getSupportedFeatures()}),workingDirectory:workingDirectoryFlag};static examples=[{description:"By default, this command will display a comprehensive table of all OpenAPI and ReadMe features found in your API definition:",command:"<%= config.bin %> <%= command.id %> [url-or-local-path-to-file]"},{description:"You can omit the file name and `rdme` will scan your working directory (and any subdirectories) for OpenAPI/Swagger files. This approach will provide you with CLI prompts, so we do not recommend this technique in CI environments.",command:"<%= config.bin %> <%= command.id %>"},{description:"If you wish to automate this command, it contains a `--feature` flag so you can filter for one or several specific features. If you pass in one or more `--feature` flags, the command returns a `0` exit code if your definition contains all of the given features and a `1` exit code if your definition lacks any of the given features:",command:"<%= config.bin %> <%= command.id %> [url-or-local-path-to-file] --feature circularRefs --feature polymorphism"}];async run(){const{spec:e}=this.args,{workingDirectory:t,feature:n}=this.flags,r=Object.entries(srcExports$1.getBorderCharacters("norc")).map((([e,t])=>({[e]:chalk.gray(t)}))).reduce(((e,t)=>Object.assign(e,t)));if(t){const e=process.cwd();process.chdir(t),this.debug(`switching working directory from ${e} to ${process.cwd()}`)}const{preparedSpec:i,definitionVersion:o}=await prepareOas(e,"openapi inspect"),s=JSON.parse(i),a=ora({...oraOptions()});n?.length?a.start(`Analyzing your API definition for usage of ${new Intl.ListFormat("en").format(n.map((e=>"readme"===e?"ReadMe extensions":e)))}...`):a.start("Analyzing your API definition for OpenAPI and ReadMe feature usage...");const c=await analyzeOas(s).catch((e=>{throw this.debug(`analyzer err: ${e.message}`),a.fail(),e}));if(n?.length){a.succeed(`${a.text} done! ✅`);const{report:e,hasUnusedFeature:t}=buildFeaturesReport(c,n);return t?Promise.reject(new SoftError(e)):Promise.resolve(e)}return a.stop(),Promise.resolve(buildFullReport(c,o.version,r))}}function getUsedRefs(e){return query(["$..['$ref']"],e)}function accumulateUsedRefs(e,t,n){let r;"string"==typeof n&&(r=jsonPointer.get(e,n.substring(1))),void 0!==r&&getUsedRefs(r).forEach((({value:n})=>{t.has(n)||(t.add(n),accumulateUsedRefs(e,t,n))}))}function reducer(e,t={}){const n="tags"in t?t.tags.map((e=>e.toLowerCase())):[],r="paths"in t?Object.entries(t.paths).reduce(((e,[t,n])=>{const r=t.toLowerCase(),i=Array.isArray(n)?n.map((e=>e.toLowerCase())):n.toLowerCase();return e[r]=i,e}),{}):{},i=new Set,o=new Set;if(!e.openapi)throw new Error("Sorry, only OpenAPI definitions are supported.");const s=JSON.parse(JSON.stringify(e));if("security"in s&&Object.values(s.security).forEach((e=>{Object.keys(e).forEach((e=>{i.add(`#/components/securitySchemes/${e}`)}))})),"paths"in s&&(Object.keys(s.paths).forEach((e=>{const t=e.toLowerCase();!Object.keys(r).length||t in r?(Object.keys(s.paths[e]).forEach((a=>{if("parameters"!==a&&Object.keys(r).length&&"*"!==r[t]&&Array.isArray(r[t])&&!r[t].includes(a))return void delete s.paths[e][a];const c=s.paths[e][a];if(n.length){if(!("tags"in c))return void delete s.paths[e][a];if(!c.tags.filter((e=>n.includes(e.toLowerCase()))).length)return void delete s.paths[e][a]}"tags"in c&&c.tags.forEach((e=>{o.add(e)})),getUsedRefs(c).forEach((({value:e})=>{i.add(e)})),"security"in c&&Object.values(c.security).forEach((e=>{Object.keys(e).forEach((e=>{i.add(`#/components/securitySchemes/${e}`)}))}))})),Object.keys(s.paths[e]).length||delete s.paths[e]):delete s.paths[e]})),!Object.keys(s.paths).length))throw new Error("All paths in the API definition were removed. Did you supply the right path name to reduce by?");return i.forEach((e=>accumulateUsedRefs(s,i,e))),"components"in s&&(Object.keys(s.components).forEach((e=>{Object.keys(s.components[e]).forEach((t=>{i.has(`#/components/${e}/${t}`)||delete s.components[e][t]})),Object.keys(s.components[e]).length||delete s.components[e]})),Object.keys(s.components).length||delete s.components),"tags"in s&&(s.tags.forEach(((e,t)=>{o.has(e.name)||delete s.tags[t]})),s.tags=s.tags.filter(Boolean),s.tags.length||delete s.tags),s}class OpenAPIReduceCommand extends BaseCommand{static summary="Reduce an OpenAPI definition into a smaller subset.";static description="Reduce your API definition down to a specific set of tags or paths, which can be useful if you're debugging a problematic schema somewhere, or if you have a file that is too big to maintain.";static args={spec:specArg};static flags={method:libExports$3.Flags.string({description:"Methods to reduce by (can only be used alongside the `path` option)",multiple:!0}),out:libExports$3.Flags.string({description:"Output file path to write reduced file to"}),path:libExports$3.Flags.string({description:"Paths to reduce by",multiple:!0}),tag:libExports$3.Flags.string({description:"Tags to reduce by",multiple:!0}),title:titleFlag,workingDirectory:workingDirectoryFlag};static examples=[{description:"By default, this command will ask you a couple questions about how you wish to reduce the file and then do so:",command:"<%= config.bin %> <%= command.id %> [url-or-local-path-to-file]"},{description:"You can omit the file name and `rdme` will scan your working directory (and any subdirectories) for OpenAPI/Swagger files. This approach will provide you with CLI prompts, so we do not recommend this technique in CI environments.",command:"<%= config.bin %> <%= command.id %>"},{description:"If you wish to automate this command, you can pass in CLI arguments to bypass the prompts:",command:"<%= config.bin %> <%= command.id %> petstore.json --path /pet/{id} --method get --method put --out petstore.reduced.json"}];async run(){const{spec:e}=this.args,t=this.flags,{title:n,workingDirectory:r}=t;if(r){const e=process.cwd();process.chdir(r),this.debug(`switching working directory from ${e} to ${process.cwd()}`)}const{preparedSpec:i,specPath:o,specType:s}=await prepareOas(e,"openapi reduce",{title:n}),a=JSON.parse(i);if("OpenAPI"!==s)throw new Error("Sorry, this reducer feature in rdme only supports OpenAPI 3.0+ definitions.");if((t.path?.length||t.method?.length)&&t.tag?.length)throw new Error("You can pass in either tags or paths/methods, but not both.");prompts.override({reduceBy:t.tag?.length?"tags":t.path?.length?"paths":void 0,tags:t.tag,paths:t.path,methods:t.method,outputPath:t.out});const c=await promptTerminal([{type:"select",name:"reduceBy",message:"Would you like to reduce by paths or tags?",choices:[{title:"Tags",value:"tags"},{title:"Paths",value:"paths"}]},{type:(e,t)=>"tags"===t.reduceBy?"multiselect":null,name:"tags",message:"Choose which tags to reduce by:",min:1,choices:()=>new Oas(a).getTags().map((e=>({title:e,value:e})))},{type:(e,t)=>"paths"===t.reduceBy?"multiselect":null,name:"paths",message:"Choose which paths to reduce by:",min:1,choices:()=>Object.keys(a.paths||[]).map((e=>({title:e,value:e})))},{type:(e,t)=>"paths"===t.reduceBy?"multiselect":null,name:"methods",message:"Choose which HTTP methods that are available across these paths to reduce by:",min:1,choices:(e,n)=>{let r=n.paths.map((e=>Object.keys(a.paths?.[e]||{}))).flat().filter((e=>"parameters"!==e.toLowerCase()));if(!r.length&&!t.method?.length)throw new Error("All paths in the API definition were removed. Did you supply the right path name to reduce by?");return r=[...new Set(r)],r.sort(),r.map((e=>({title:e.toUpperCase(),value:e})))}},{type:"text",name:"outputPath",message:"Enter the path to save your reduced API definition to:",initial:()=>{const e=path$1.extname(o);return`${path$1.basename(o).split(e)[0]}.reduced${e}`},validate:e=>validateFilePath(e)}]);this.debug(`reducing by ${c.reduceBy}`),this.debug(`options being supplied to the reducer: ${JSON.stringify({tags:c.tags,paths:c.paths,methods:c.methods})}`),this.debug(`about to reduce spec located at ${o}`);const u=ora({...oraOptions()});let l;u.start("Reducing your API definition...");try{l=reducer(a,{tags:c.tags||[],paths:(c.paths||[]).reduce(((e,t)=>(e[t]=c.methods,e)),{})}),u.succeed(`${u.text} done! ✅`)}catch(e){throw this.debug(`reducer err: ${e.message}`),u.fail(),e}return this.debug(`saving reduced spec to ${c.outputPath}`),fs$6.writeFileSync(c.outputPath,JSON.stringify(l,null,2)),this.debug("reduced spec saved"),Promise.resolve(chalk.green(`Your reduced API definition has been saved to ${c.outputPath}! 🤏`))}}var slugify$2={exports:{}},slugify$1=slugify$2.exports,hasRequiredSlugify;function requireSlugify(){return hasRequiredSlugify||(hasRequiredSlugify=1,function(e){!function(t,n,r){e.exports=r(),e.exports.default=r()}(0,0,(function(){var e=JSON.parse('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E\'","Ը":"Y\'","Թ":"T\'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C\'","Կ":"K","Հ":"H","Ձ":"D\'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R\'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P\'","Ք":"Q\'","Օ":"O\'\'","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"\'","’":"\'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}'),t=JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');function n(n,r){if("string"!=typeof n)throw new Error("slugify: string argument expected");var i=t[(r="string"==typeof r?{replacement:r}:r||{}).locale]||{},o=void 0===r.replacement?"-":r.replacement,s=void 0===r.trim||r.trim,a=n.normalize().split("").reduce((function(t,n){var s=i[n];return void 0===s&&(s=e[n]),void 0===s&&(s=n),s===o&&(s=" "),t+s.replace(r.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")}),"");return r.strict&&(a=a.replace(/[^A-Za-z0-9\s]/g,"")),s&&(a=a.trim()),a=a.replace(/\s+/g,o),r.lower&&(a=a.toLowerCase()),a}return n.extend=function(t){Object.assign(e,t)},n}))}(slugify$2)),slugify$2.exports}var slugifyExports=requireSlugify(),slugify=getDefaultExportFromCjs(slugifyExports),tmpPromise={exports:{}},tmp={exports:{}},hasRequiredTmp,hasRequiredTmpPromise;function requireTmp(){return hasRequiredTmp||(hasRequiredTmp=1,function(e){const t=require$$0$8,n=require$$0$a,r=require$$0$9,i=require$$0$g,o={fs:t.constants,os:n.constants},s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",a=/XXXXXX/,c=(o.O_CREAT||o.fs.O_CREAT)|(o.O_EXCL||o.fs.O_EXCL)|(o.O_RDWR||o.fs.O_RDWR),u="win32"===n.platform(),l=o.EBADF||o.os.errno.EBADF,d=o.ENOENT||o.os.errno.ENOENT,p=[],f=t.rmdirSync.bind(t);let _=!1;function m(e,n){return t.rm(e,{recursive:!0},n)}function h(e){return t.rmSync(e,{recursive:!0})}function g(e,n){const r=k(e,n),i=r[0],o=r[1];try{w(i)}catch(e){return o(e)}let s=i.tries;!function e(){try{const n=D(i);t.stat(n,(function(t){if(!t)return s-- >0?e():o(new Error("Could not get a unique tmp filename, max tries reached "+n));o(null,n)}))}catch(e){o(e)}}()}function A(e){const n=k(e)[0];w(n);let r=n.tries;do{const e=D(n);try{t.statSync(e)}catch(t){return e}}while(r-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function y(e,n){const r=function(e){if(e&&!R(e))return n(e);n()};0<=e[0]?t.close(e[0],(function(){t.unlink(e[1],r)})):t.unlink(e[1],r)}function v(e){let n=null;try{0<=e[0]&&t.closeSync(e[0])}catch(e){if(!function(e){return F(e,-l,"EBADF")}(e)&&!R(e))throw e}finally{try{t.unlinkSync(e[1])}catch(e){R(e)||(n=e)}}if(null!==n)throw n}function b(e,t,n,r){const i=E(v,[t,e],r),o=E(y,[t,e],r,i);return n.keep||p.unshift(i),r?i:o}function C(e,n,r){const i=n.unsafeCleanup?m:t.rmdir.bind(t),o=E(n.unsafeCleanup?h:f,e,r),s=E(i,e,r,o);return n.keep||p.unshift(o),r?o:s}function E(e,t,n,r){let i=!1;return function o(s){if(!i){const a=r||o,c=p.indexOf(a);return c>=0&&p.splice(c,1),i=!0,n||e===f||e===h?e(t):e(t,s||function(){})}}}function x(e){let t=[],n=null;try{n=i.randomBytes(e)}catch(t){n=i.pseudoRandomBytes(e)}for(var r=0;rn.file(e,((e,n,i,o)=>e?r(e):r(void 0,{path:n,fd:i,cleanup:t(o)})))));e.exports.file=async e=>r(e),e.exports.withFile=async function(t,n){const{path:r,fd:i,cleanup:o}=await e.exports.file(n);try{return await t({path:r,fd:i})}finally{await o()}},e.exports.dirSync=n.dirSync;const i=t(((e,r)=>n.dir(e,((e,n,i)=>e?r(e):r(void 0,{path:n,cleanup:t(i)})))));e.exports.dir=async e=>i(e),e.exports.withDir=async function(t,n){const{path:r,cleanup:i}=await e.exports.dir(n);try{return await t({path:r})}finally{await i()}},e.exports.tmpNameSync=n.tmpNameSync,e.exports.tmpName=t(n.tmpName),e.exports.tmpdir=n.tmpdir,e.exports.setGracefulCleanup=n.setGracefulCleanup}(tmpPromise)),tmpPromise.exports}var tmpPromiseExports=requireTmpPromise();class OpenAPIUploadCommand extends BaseCommand{static summary="Upload (or re-upload) your API definition to ReadMe.";static description=["By default, the slug (i.e., the unique identifier for your API definition resource in ReadMe) will be inferred from the spec name and path. As long as you maintain these directory/file names and run `rdme` from the same location relative to your file, the inferred slug will be preserved and any updates you make to this file will be synced to the same resource in ReadMe.","If the spec is a local file, the inferred slug takes the relative path and slugifies it (e.g., the slug for `docs/api/petstore.json` will be `docs-api-petstore.json`).","If the spec is a URL, the inferred slug is the base file name from the URL (e.g., the slug for `https://example.com/docs/petstore.json` will be `petstore.json`)."].join("\n\n");static args={spec:specArg};static flags={key:keyFlag,slug:libExports$3.Flags.string({summary:"Override the slug (i.e., the unique identifier) for your API definition.",description:["Allows you to override the slug (i.e., the unique identifier for your API definition resource in ReadMe) that's inferred from the API definition's file/URL path.","You do not need to include a file extension (i.e., either `custom-slug.json` or `custom-slug` will work). If you do, it must match the file extension of the file you're uploading."].join("\n\n")}),useSpecVersion:libExports$3.Flags.boolean({summary:"Use the OpenAPI `info.version` field for your ReadMe project version",description:"If included, use the version specified in the `info.version` field in your OpenAPI definition for your ReadMe project version. This flag is mutually exclusive with `--version`.",exclusive:["version"]}),version:libExports$3.Flags.string({summary:"ReadMe project version",description:"Defaults to `stable` (i.e., your main project version). This flag is mutually exclusive with `--useSpecVersion`.",default:"stable"})};static examples=[{description:"You can pass in a file name like so:",command:"<%= config.bin %> <%= command.id %> --version=1.0.0 openapi.json"},{description:"You can also pass in a file in a subdirectory (we recommend always running the CLI from the root of your repository):",command:"<%= config.bin %> <%= command.id %> --version=v1.0.0 example-directory/petstore.json"},{description:"You can also pass in a URL:",command:"<%= config.bin %> <%= command.id %> --version=1.0.0 https://example.com/openapi.json"},{description:"If you specify your ReadMe project version in the `info.version` field in your OpenAPI definition, you can use that:",command:"<%= config.bin %> <%= command.id %> --useSpecVersion https://example.com/openapi.json"}];async pollAPIUntilUploadIsComplete(e,t){let n=0,r="pending";for(;"pending"===r&&n<10;){await new Promise((e=>{setTimeout(e,Math.min(isTest()?1:1e3*2**n,3e4))})),this.debug(`polling API for status of ${e}, count is ${n}`);const i=await this.readmeAPIFetch(e,{headers:t}).then((e=>this.handleAPIRes(e)));r=i?.data?.upload?.status,n+=1}if("pending"===r)throw new Error("Sorry, this upload timed out. Please try again later.");return r}async run(){const{spec:e}=this.args,{preparedSpec:t,specFileType:n,specPath:r,specVersion:i}=await prepareOas(e,"openapi upload"),o=this.flags.useSpecVersion?i:this.flags.version;let s="url"===n?path$1.basename(r):slugify.default(r);if(this.flags.slug){const e=path$1.extname(s),t=path$1.extname(this.flags.slug);if(t&&(![".json",".yaml",".yml"].includes(t)||e!==t))throw new Error("Please provide a valid file extension that matches the extension on the file you provided. Must be `.json`, `.yaml`, or `.yml`.");s=`${this.flags.slug.replace(t,"")}${e}`}const a=new Headers({authorization:`Bearer ${this.flags.key}`}),c=await this.readmeAPIFetch(`/versions/${o}/apis`,{headers:a}).then((e=>this.handleAPIRes(e))),u=c?.data?.some((e=>e.filename===s))?"PUT":"POST";if(this.debug(`making a ${u} request`),"PUT"===u){prompts.override({confirm:!!isCI()||void 0});const{confirm:e}=await promptTerminal({type:"confirm",name:"confirm",message:`This will overwrite the existing API definition for ${s}. Are you sure you want to continue?`});if(!e)throw new Error("Aborting, no changes were made.")}const l=new FormData;if("url"===n)this.debug("attaching URL to form data payload"),l.append("url",r);else{const{path:e}=await tmpPromiseExports.file({prefix:"rdme-openapi-",postfix:".json"});this.debug(`creating temporary file at ${e}`),fs$6.writeFileSync(e,t);const n=fs$6.createReadStream(e);this.debug("file and stream created, streaming into form data payload"),l.append("schema",{[Symbol.toStringTag]:"File",name:s,stream:()=>n,type:"application/json"})}const d={headers:a,method:u,body:l},p=ora({...oraOptions()}).start(("POST"===u?"Creating":"Updating")+" your API definition to ReadMe..."),f=await this.readmeAPIFetch(`/versions/${o}/apis${"POST"===u?"":`/${s}`}`,d).then((e=>this.handleAPIRes(e))).catch((e=>{throw p.fail(),e}));if(f?.data?.upload?.status&&f?.data?.uri){let e=f.data.upload.status;if("pending"===e&&(p.text=`${p.text} uploaded but not yet processed by ReadMe. Polling for completion...`,e=await this.pollAPIUntilUploadIsComplete(f.data.uri,a)),"done"===e)return p.succeed(`${p.text} done!`),this.log(`🚀 Your API definition (${s}) was successfully ${"POST"===u?"created":"updated"} in ReadMe!`),{uri:f.data.uri,status:e}}throw p.fail(),new Error("Your API definition upload failed with an unexpected error. Please get in touch with us at support@readme.io.")}}class OpenAPIValidateCommand extends BaseCommand{static summary="Validate your OpenAPI/Swagger definition.";static description="Perform a local validation of your API definition (no ReadMe account required!), which can be useful when constructing or editing your API definition.";static id="openapi validate";static args={spec:specArg};static examples=[{description:"This will validate the API definition at the given URL or path:",command:"<%= config.bin %> <%= command.id %> [url-or-local-path-to-file]"},{description:"You can omit the file name and `rdme` will scan your working directory (and any subdirectories) for OpenAPI/Swagger files. This approach will provide you with CLI prompts, so we do not recommend this technique in CI environments.",command:"<%= config.bin %> <%= command.id %>"}];static flags={github:githubFlag,workingDirectory:workingDirectoryFlag};async run(){if(this.flags.workingDirectory){const e=process.cwd();process.chdir(this.flags.workingDirectory),this.debug(`switching working directory from ${e} to ${process.cwd()}`)}const{specPath:e,specType:t}=await prepareOas(this.args.spec,OpenAPIValidateCommand.id);return this.runCreateGHAHook({parsedOpts:{...this.flags,spec:e},result:chalk.green(`${e} is a valid ${t} API definition!`)})}}class WhoAmICommand extends BaseCommand{static description="Displays the current user and project authenticated with ReadMe.";async run(){const{email:e,project:t}=getCurrentConfig();return e&&t?Promise.resolve(`You are currently logged in as ${chalk.green(e)} to the ${chalk.blue(t)} project.`):Promise.reject(new Error(`Please login using \`${this.config.bin} login\`.`))}}const hook$1=async function(e){const t=e.result,n=e.command,r=e.parsedOpts;return createGHA.call(this,t,n,r)},hook=async function(e){this.debug("configstore location:",configstore.path),e.Command?.flags?.key?(this.debug("current command has --key flag"),isTest()?e.Command.flags.key=keyFlag:e.Command.flags.key=libExports$3.Flags.string({parse:async e=>{this.debug("--key flag detected in parse function");const{email:t,project:n}=getCurrentConfig.call(this);return e&&configstore.get("apiKey")===e&&info(`🔑 ${chalk.green(t)} is currently logged in, using the stored API key for this project: ${chalk.blue(n)}`,{includeEmojiPrefix:!1}),e},default:async()=>{this.debug("no --key flag detected, running default function");const{apiKey:e}=getCurrentConfig.call(this);if(e)return this.debug("api key found in config, returning"),e;if(isCI())throw new Error("No project API key provided. Please use `--key`.");info("Looks like you're missing a ReadMe API key, let's fix that! 🦉",{includeEmojiPrefix:!1});return info(await loginFlow(),{includeEmojiPrefix:!1}),configstore.get("apiKey")}})):this.debug("current command does not have --key flag"),e.Command?.flags?.github?(this.debug("current command has --github flag"),isCI()&&(this.debug("in CI environment"),e.Command.flags.github=libExports$3.Flags.boolean({parse:()=>{throw new Error("The `--github` flag is only for usage in non-CI environments.")}})),process.env.TEST_RDME_CREATEGHA&&(e.Command.flags.github=githubFlag)):this.debug("current command does not have --github flag")},COMMANDS={changelogs:ChangelogsCommand,login:LoginCommand,logout:LogoutCommand,"openapi:convert":OpenAPIConvertCommand,"openapi:inspect":OpenAPIInspectCommand,"openapi:reduce":OpenAPIReduceCommand,"openapi:upload":OpenAPIUploadCommand,"openapi:validate":OpenAPIValidateCommand,whoami:WhoAmICommand};export{COMMANDS,hook$1 as createGHA,hook as prerun}; diff --git a/package-lock.json b/package-lock.json index b3a2852e6..e0eac8570 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rdme", - "version": "10.1.0-next.2", + "version": "10.1.0-next.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rdme", - "version": "10.1.0-next.2", + "version": "10.1.0-next.3", "license": "MIT", "dependencies": { "@actions/core": "^1.6.0", diff --git a/package.json b/package.json index 74abead1b..188cb1f63 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rdme", - "version": "10.1.0-next.2", + "version": "10.1.0-next.3", "description": "ReadMe's official CLI and GitHub Action.", "license": "MIT", "author": "ReadMe (https://readme.com)",