\n`}tablecell(e,t){const r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`${r}>\n`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return this.options.xhtml?" ":" "}del(e){return`${e}`}link(e,t,r){if(null===(e=ke(this.options.sanitize,this.options.baseUrl,e)))return r;let n='"+r+"",n}image(e,t,r){if(null===(e=ke(this.options.sanitize,this.options.baseUrl,e)))return r;let n=`":">",n}text(e){return e}}class Be{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,r){return""+r}image(e,t,r){return""+r}br(){return""}}class He{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let r=e,n=0;if(this.seen.hasOwnProperty(r)){n=this.seen[e];do{n++,r=e+"-"+n}while(this.seen.hasOwnProperty(r))}return t||(this.seen[e]=n,this.seen[r]=0),r}slug(e,t={}){const r=this.serialize(e);return this.getNextSafeSlug(r,t.dryrun)}}class ze{constructor(e){this.options=e||de,this.options.renderer=this.options.renderer||new qe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Be,this.slugger=new He}static parse(e,t){return new ze(t).parse(e)}static parseInline(e,t){return new ze(t).parseInline(e)}parse(e,t=!0){let r,n,a,o,i,s,l,c,p,d,u,h,f,m,g,y,v,b,x,w="";const $=e.length;for(r=0;r<$;r++)if(d=e[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[d.type]&&(x=this.options.extensions.renderers[d.type].call({parser:this},d),!1!==x||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)))w+=x||"";else switch(d.type){case"space":continue;case"hr":w+=this.renderer.hr();continue;case"heading":w+=this.renderer.heading(this.parseInline(d.tokens),d.depth,xe(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue;case"code":w+=this.renderer.code(d.text,d.lang,d.escaped);continue;case"table":for(c="",l="",o=d.header.length,n=0;n0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=b+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=b+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:b}):m+=b),m+=this.parse(g.tokens,f),p+=this.renderer.listitem(m,v,y);w+=this.renderer.list(p,u,h);continue;case"html":w+=this.renderer.html(d.text);continue;case"paragraph":w+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(p=d.tokens?this.parseInline(d.tokens):d.text;r+1<$&&"text"===e[r+1].type;)d=e[++r],p+="\n"+(d.tokens?this.parseInline(d.tokens):d.text);w+=t?this.renderer.paragraph(p):p;continue;default:{const e='Token with "'+d.type+'" type was not found.';if(this.options.silent)return void ce.error(e);throw new Error(e)}}return w}parseInline(e,t){t=t||this.renderer;let r,n,a,o="";const i=e.length;for(r=0;r{"function"==typeof n&&(a=n,n=null);const o={...n},i=function(e,t,r){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="
An error occurred:
"+ve(n.message+"",!0)+"
";return t?Promise.resolve(e):r?void r(null,e):e}if(t)return Promise.reject(n);if(!r)throw n;r(n)}}((n={...Ve.defaults,...o}).silent,n.async,a);if(null==r)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof r)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(function(e){e&&e.sanitize&&!e.silent&&ce.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}(n),n.hooks&&(n.hooks.options=n),a){const o=n.highlight;let s;try{n.hooks&&(r=n.hooks.preprocess(r)),s=e(r,n)}catch(e){return i(e)}const l=function(e){let r;if(!e)try{n.walkTokens&&Ve.walkTokens(s,n.walkTokens),r=t(s,n),n.hooks&&(r=n.hooks.postprocess(r))}catch(t){e=t}return n.highlight=o,e?i(e):a(null,r)};if(!o||o.length<3)return l();if(delete n.highlight,!s.length)return l();let c=0;return Ve.walkTokens(s,(function(e){"code"===e.type&&(c++,setTimeout((()=>{o(e.text,e.lang,(function(t,r){if(t)return l(t);null!=r&&r!==e.text&&(e.text=r,e.escaped=!0),c--,0===c&&l()}))}),0))})),void(0===c&&l())}if(n.async)return Promise.resolve(n.hooks?n.hooks.preprocess(r):r).then((t=>e(t,n))).then((e=>n.walkTokens?Promise.all(Ve.walkTokens(e,n.walkTokens)).then((()=>e)):e)).then((e=>t(e,n))).then((e=>n.hooks?n.hooks.postprocess(e):e)).catch(i);try{n.hooks&&(r=n.hooks.preprocess(r));const a=e(r,n);n.walkTokens&&Ve.walkTokens(a,n.walkTokens);let o=t(a,n);return n.hooks&&(o=n.hooks.postprocess(o)),o}catch(e){return i(e)}}}function Ve(e,t,r){return Ze(Ue.lex,ze.parse)(e,t,r)}Ve.options=Ve.setOptions=function(e){var t;return Ve.defaults={...Ve.defaults,...e},t=Ve.defaults,de=t,Ve},Ve.getDefaults=pe,Ve.defaults=de,Ve.use=function(...e){const t=Ve.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((e=>{const r={...e};if(r.async=Ve.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const r=t.renderers[e.name];t.renderers[e.name]=r?function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=r.apply(this,t)),n}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");t[e.level]?t[e.level].unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),r.extensions=t),e.renderer){const t=Ve.defaults.renderer||new qe;for(const r in e.renderer){const n=t[r];t[r]=(...a)=>{let o=e.renderer[r].apply(t,a);return!1===o&&(o=n.apply(t,a)),o}}r.renderer=t}if(e.tokenizer){const t=Ve.defaults.tokenizer||new De;for(const r in e.tokenizer){const n=t[r];t[r]=(...a)=>{let o=e.tokenizer[r].apply(t,a);return!1===o&&(o=n.apply(t,a)),o}}r.tokenizer=t}if(e.hooks){const t=Ve.defaults.hooks||new We;for(const r in e.hooks){const n=t[r];We.passThroughHooks.has(r)?t[r]=a=>{if(Ve.defaults.async)return Promise.resolve(e.hooks[r].call(t,a)).then((e=>n.call(t,e)));const o=e.hooks[r].call(t,a);return n.call(t,o)}:t[r]=(...a)=>{let o=e.hooks[r].apply(t,a);return!1===o&&(o=n.apply(t,a)),o}}r.hooks=t}if(e.walkTokens){const t=Ve.defaults.walkTokens;r.walkTokens=function(r){let n=[];return n.push(e.walkTokens.call(this,r)),t&&(n=n.concat(t.call(this,r))),n}}Ve.setOptions(r)}))},Ve.walkTokens=function(e,t){let r=[];for(const n of e)switch(r=r.concat(t.call(Ve,n)),n.type){case"table":for(const e of n.header)r=r.concat(Ve.walkTokens(e.tokens,t));for(const e of n.rows)for(const n of e)r=r.concat(Ve.walkTokens(n.tokens,t));break;case"list":r=r.concat(Ve.walkTokens(n.items,t));break;default:Ve.defaults.extensions&&Ve.defaults.extensions.childTokens&&Ve.defaults.extensions.childTokens[n.type]?Ve.defaults.extensions.childTokens[n.type].forEach((function(e){r=r.concat(Ve.walkTokens(n[e],t))})):n.tokens&&(r=r.concat(Ve.walkTokens(n.tokens,t)))}return r},Ve.parseInline=Ze(Ue.lexInline,ze.parseInline),Ve.Parser=ze,Ve.parser=ze.parse,Ve.Renderer=qe,Ve.TextRenderer=Be,Ve.Lexer=Ue,Ve.lexer=Ue.lex,Ve.Tokenizer=De,Ve.Slugger=He,Ve.Hooks=We,Ve.parse=Ve;Ve.options,Ve.setOptions,Ve.use,Ve.walkTokens,Ve.parseInline,ze.parse,Ue.lex;var Ke=r(8325),Ge=r.n(Ke);r(7874),r(5433),r(4335),r(9980),r(9385),r(6854),r(9945),r(366),r(4277),r(5712),r(5251),r(3358),r(7046),r(2503),r(57),r(9016);const Ye=c`
.hover-bg:hover{
background: var(--bg3);
}
@@ -86,54 +86,27 @@
grid-template-columns: 20px 1fr;
}
+ .m-markdown .callout-icon {
+ display: inline-block;
+ flex-shrink: 0;
+ grid-row: 1;
+ }
+
.m-markdown .info-blockquote {
background: #f8f7fc;
border: 1px solid #ccced8;
}
- .m-markdown .info-blockquote:before {
- display: inline-block;
- height: 20px;
- width: 20px;
- content: '';
- background: url('https://vtex-dev-portal-navigation.fra1.digitaloceanspaces.com/info.svg')
- no-repeat 0 0;
- background-size: 20px 20px;
- position: absolute;
- }
-
.m-markdown .warning-blockquote {
background: #fff2d4;
border: 1px solid #ffb100;
}
- .m-markdown .warning-blockquote:before {
- display: inline-block;
- height: 20px;
- width: 20px;
- content: '';
- background: url('https://vtex-dev-portal-navigation.fra1.digitaloceanspaces.com/warning.svg')
- no-repeat 0 0;
- background-size: 20px 20px;
- position: absolute;
- }
-
.m-markdown .danger-blockquote {
background: #fdefef;
border: 1px solid #dc5a41;
}
- .m-markdown .danger-blockquote:before {
- display: inline-block;
- height: 20px;
- width: 20px;
- content: '';
- background: url('https://vtex-dev-portal-navigation.fra1.digitaloceanspaces.com/danger.svg')
- no-repeat 0 0;
- background-size: 20px 20px;
- position: absolute;
- }
-
blockquote p{
grid-column: 2 / -1;
margin: 0;
@@ -274,7 +247,6 @@
/* Button */
.m-btn {
display: flex;
- flex-direction: column;
align-items: center;
border-radius: var(--border-radius);
font-weight: 400;
@@ -290,6 +262,10 @@
text-transform: uppercase;
letter-spacing: 0.5px;
}
+.m-btn-image {
+ flex-direction: row;
+ column-gap: 10px;
+}
.m-btn-primary {
background-color: var(--primary-color);
color: var(--primary-color-invert);
@@ -1267,8 +1243,7 @@ pre[class*="language-"] {
}
`,ot=c`
.code-container {
- padding-inline: 32px;
- padding-top: 16px;
+ tab-size: 4;
}
.code-container > code {
font-size: 14px;
@@ -1357,6 +1332,7 @@ pre[class*="language-"] {
.right-box-container {
margin-top: 16px;
+ padding-inline: 16px;
}
.right-box-label {
@@ -1371,6 +1347,18 @@ pre[class*="language-"] {
height: 44px;
}
+.right-box-content {
+ border: 1px solid rgb(204, 206, 216);
+ border-radius: 4px;
+ padding-block: 24px;
+ margin-top: 24px;
+}
+
+.right-box-select {
+ padding-inline: 16px;
+ width: 100%;
+}
+
.server-template {
position: relative;
}
@@ -1531,7 +1519,7 @@ pre[class*="language-"] {
transition: visibility 0.3s linear,opacity 0.3s linear;
}
-`;var it=r(5108);const st=/[\s#:?&={}]/g,lt="_rapidoc_api_key";function ct(e){return new Promise((t=>setTimeout(t,e)))}function pt(e,t){const r=t.target.closest("button"),n=document.createElement("textarea");n.value=e,n.style.position="fixed",document.body.appendChild(n),n.focus(),n.select();try{document.execCommand("copy"),r.innerHTML='',setTimeout((()=>{r.innerHTML='\n '}),5e3)}catch(e){it.error("Unable to copy",e)}document.body.removeChild(n)}function dt(e,t,r="includes"){if("includes"===r){return`${t.method} ${t.path} ${t.summary||t.description||""} ${t.operationId||""}`.toLowerCase().includes(e.toLowerCase())}return new RegExp(`^${e}$`,"i").test(`${t.method} ${t.path}`)}function ut(e,t=new Set){return e?(Object.keys(e).forEach((r=>{var n;if(t.add(r),e[r].properties)ut(e[r].properties,t);else if(null!==(n=e[r].items)&&void 0!==n&&n.properties){var a;ut(null===(a=e[r].items)||void 0===a?void 0:a.properties,t)}})),t):t}function ht(e,t){if(e){const r=document.createElement("a");document.body.appendChild(r),r.style="display: none",r.href=e,r.download=t,r.click(),r.remove()}}function ft(e){if(e){const t=document.createElement("a");document.body.appendChild(t),t.style="display: none",t.href=e,t.target="_blank",t.click(),t.remove()}}var mt=r(9682),gt=r.n(mt),yt=r(5108);async function vt(e,t,r=!1,n=!1,a="",o="",i="",s="",l=""){var c,p;let d,u;try{var h,f;if(this.requestUpdate(),t)u=JSON.parse(t);else{const t=await gt().dereference(e);u=await gt().parse(t)}if(null!==(h=u)&&void 0!==h&&h.jsonSchemaViewer&&null!==(f=u)&&void 0!==f&&f.schemaAndExamples){this.dispatchEvent(new CustomEvent("before-render",{detail:{spec:u.resolvedSpec}}));const e=Object.entries(u.resolvedSpec.schemaAndExamples).map((e=>({show:!0,expanded:!0,selectedExample:null,name:e[0],elementId:e[0].replace(st,"-"),...e[1]})));return{specLoadError:!1,isSpecLoading:!1,info:u.resolvedSpec.info,schemaAndExamples:e}}if(!u||!(u.components||u.info||u.servers||u.tags||u.paths))return yt.info("RapiDoc: %c There was an issue while parsing the spec %o ","color:orangered",u),{specLoadError:!0,isSpecLoading:!1,info:{title:"Error loading the spec",description:"Unable to load the Spec",version:" "},tags:[]};d=u,this.dispatchEvent(new CustomEvent("before-render",{detail:{spec:d}}))}catch(e){yt.info("RapiDoc: %c There was an issue while parsing the spec %o ","color:orangered",e)}const m=function(e,t,r=!1,n=!1){const a=["get","put","post","delete","patch","head","options"],o=e.tags&&Array.isArray(e.tags)?e.tags.map((e=>({show:!0,elementId:`tag--${e.name.replace(st,"-")}`,name:e.name,description:e.description||"",headers:e.description?bt(e.description):[],paths:[],expanded:!1!==e["x-tag-expanded"]}))):[],i=e.paths||{};if(e.webhooks)for(const[t,r]of Object.entries(e.webhooks))r._type="webhook",i[t]=r;for(const t in i){const n=i[t].parameters,s={servers:i[t].servers||[],parameters:i[t].parameters||[]},l="webhook"===i[t]._type;a.forEach((a=>{if(i[t][a]){const i=e.paths[t][a],c=i.tags||[];if(0===c.length)if(r){const e=t.replace(/^\/+|\/+$/g,""),r=e.indexOf("/");-1===r?c.push(e):c.push(e.substr(0,r))}else c.push("General ⦂");c.forEach((r=>{let c,p;var d,u;(e.tags&&(p=e.tags.find((e=>e.name.toLowerCase()===r.toLowerCase()))),c=o.find((e=>e.name===r)),c)||(c={show:!0,elementId:`tag--${r.replace(st,"-")}`,name:r,description:(null===(d=p)||void 0===d?void 0:d.description)||"",headers:null!==(u=p)&&void 0!==u&&u.description?bt(p.description):[],paths:[],expanded:!p||!1!==p["x-tag-expanded"]},o.push(c));let h=(i.summary||i.description||`${a.toUpperCase()} ${t}`).trim();h.length>100&&([h]=h.split(/[.|!|?]\s|[\r?\n]/));let f=[];if(f=n?i.parameters?n.filter((e=>{if(!i.parameters.some((t=>e.name===t.name&&e.in===t.in)))return e})).concat(i.parameters):n.slice(0):i.parameters?i.parameters.slice(0):[],i.callbacks)for(const[e,t]of Object.entries(i.callbacks)){const r=Object.entries(t).filter((e=>"object"==typeof e[1]))||[];i.callbacks[e]=Object.fromEntries(r)}c.paths.push({show:!0,expanded:!1,isWebhook:l,expandedAtLeastOnce:!1,summary:i.summary||"",description:i.description||"",externalDocs:i.externalDocs,shortSummary:h,method:a,path:t,operationId:i.operationId,elementId:`${a}-${t.replace(st,"-")}`,servers:i.servers?s.servers.concat(i.servers):s.servers,parameters:f,requestBody:i.requestBody,responses:i.responses,callbacks:i.callbacks,deprecated:i.deprecated,security:i.security,xBadges:i["x-badges"]||void 0,xCodeSamples:i["x-codeSamples"]||i["x-code-samples"]||""})}))}}))}const s=o.filter((e=>e.paths&&e.paths.length>0));return s.forEach((e=>{"method"===t?e.paths.sort(((e,t)=>a.indexOf(e.method).toString().localeCompare(a.indexOf(t.method)))):"summary"===t?e.paths.sort(((e,t)=>e.shortSummary.localeCompare(t.shortSummary))):"path"===t&&e.paths.sort(((e,t)=>e.path.localeCompare(t.path))),e.firstPathId=e.paths[0].elementId})),n?s.sort(((e,t)=>e.name.localeCompare(t.name))):s}(d,a,r,n),g=function(e){if(!e.components)return[];const t=[];for(const r in e.components){const n=[];for(const t in e.components[r]){const a={show:!0,id:`${r.toLowerCase()}-${t.toLowerCase()}`.replace(st,"-"),name:t,component:e.components[r][t]};n.push(a)}let a=r,o=r;switch(r){case"schemas":o="Schemas",a="Schemas allows the definition of input and output data types. These types can be objects, but also primitives and arrays.";break;case"responses":o="Responses",a="Describes responses from an API Operation, including design-time, static links to operations based on the response.";break;case"parameters":o="Parameters",a="Describes operation parameters. A unique parameter is defined by a combination of a name and location.";break;case"examples":o="Examples",a="List of Examples for operations, can be requests, responses and objects examples.";break;case"requestBodies":o="Request Bodies",a="Describes common request bodies that are used across the API operations.";break;case"headers":o="Headers",a='Headers follows the structure of the Parameters but they are explicitly in "header"';break;case"securitySchemes":o="Security Schemes",a="Defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), OAuth2's common flows(implicit, password, client credentials and authorization code) as defined in RFC6749, and OpenID Connect Discovery.";break;case"links":o="Links",a="Links represent a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.";break;case"callbacks":o="Callbacks",a="A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the path item object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.";break;default:o=r,a=r}const i={show:!0,name:o,description:a,subComponents:n};t.push(i)}return t||[]}(d),y=null!==(c=d.info)&&void 0!==c&&c.description?bt(d.info.description):[],v=[];if(null!==(p=d.components)&&void 0!==p&&p.securitySchemes){const e=new Set;Object.entries(d.components.securitySchemes).forEach((t=>{if(!e.has(t[0])){e.add(t[0]);const r={securitySchemeId:t[0],...t[1]};r.value="",r.finalKeyValue="","apiKey"===t[1].type||"http"===t[1].type?(r.in=t[1].in||"header",r.name=t[1].name||"Authorization",r.user="",r.password=""):"oauth2"===t[1].type&&(r.in="header",r.name="Authorization",r.clientId="",r.clientSecret=""),v.push(r)}}))}o&&i&&s&&v.push({securitySchemeId:lt,description:"api-key provided in rapidoc element attributes",type:"apiKey",oAuthFlow:"",name:o,in:i,value:s,finalKeyValue:s}),v.forEach((e=>{"http"===e.type?e.typeDisplay="basic"===e.scheme?"HTTP Basic":"HTTP Bearer":"apiKey"===e.type?e.typeDisplay=`API Key (${e.name})`:"oauth2"===e.type?e.typeDisplay=`OAuth (${e.securitySchemeId})`:e.typeDisplay=e.type||"None"}));let b=[];d.servers&&Array.isArray(d.servers)?(d.servers.forEach((e=>{let t=e.url.trim();t.startsWith("http")||t.startsWith("//")||t.startsWith("{")||window.location.origin.startsWith("http")&&(e.url=window.location.origin+e.url,t=e.url),e.variables&&Object.entries(e.variables).forEach((e=>{const r=new RegExp(`{${e[0]}}`,"g");t=t.replace(r,e[1].default||""),e[1].value=e[1].default||""})),e.computedUrl=t})),l&&d.servers.push({url:l,computedUrl:l})):l?d.servers=[{url:l,computedUrl:l}]:window.location.origin.startsWith("http")?d.servers=[{url:window.location.origin,computedUrl:window.location.origin}]:d.servers=[{url:"http://localhost",computedUrl:"http://localhost"}],b=d.servers;return{specLoadError:!1,isSpecLoading:!1,info:d.info,infoDescriptionHeaders:y,tags:m,components:g,externalDocs:d.externalDocs,securitySchemes:v,servers:b}}function bt(e){const t=Ze.lexer(e).filter((e=>"heading"===e.type&&e.depth<=2));return t||[]}const xt=2,wt=e=>(...t)=>({_$litDirective$:e,values:t});class $t{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}class St extends $t{constructor(e){if(super(e),this.et=z,e.type!==xt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===z||null==e)return this.ft=void 0,this.et=e;if(e===H)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.et)return this.ft;this.et=e;const t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}}St.directiveName="unsafeHTML",St.resultType=1;const Et=wt(St);var kt=r(212),At=r.n(kt);function _t(e){if(void 0===e)return"";if(null===e)return"null";if(""===e)return"∅";if("boolean"==typeof e||"number"==typeof e)return`${e}`;if(Array.isArray(e))return e.map((e=>null===e?"null":""===e?"∅":e.toString().replace(/^ +| +$/g,(e=>"●".repeat(e.length)))||"")).join(", ");if("object"==typeof e){const t=Object.keys(e);return`{ ${t[0]}:${e[t[0]]}${t.length>1?",":""} ... }`}return e.toString().replace(/^ +| +$/g,(e=>"●".repeat(e.length)))||""}function Ot(e){if(!e)return;let t="",r="";if(e.$ref){const r=e.$ref.lastIndexOf("/");t=`{recursive: ${e.$ref.substring(r+1)}} `}else e.type?(t=Array.isArray(e.type)?e.type.join(2===e.length?" or ":"┃"):e.type,(e.format||e.enum||e.const)&&(t=t.replace("string",e.enum?"enum":e.const?"const":e.format)),e.nullable&&(t+="┃null")):t=e.const?"const":0===Object.keys(e).length?"any":"{missing-type-info}";const n={type:t,format:e.format||"",pattern:e.pattern&&!e.enum?e.pattern:"",readOrWriteOnly:e.readOnly?"🆁":e.writeOnly?"🆆":"",deprecated:e.deprecated?"❌":"",examples:e.examples||e.example,default:_t(e.default),description:e.description||"",constrain:"",allowedValues:"",arrayType:"",html:""};if("{recursive}"===n.type?n.description=e.$ref.substring(e.$ref.lastIndexOf("/")+1):"{missing-type-info}"!==n.type&&"any"!==n.type||(n.description=n.description||""),n.allowedValues=e.const?e.const:Array.isArray(e.enum)?e.enum.map((e=>_t(e))).join("┃"):"","array"===t&&e.items){var a,o;const t=null===(a=e.items)||void 0===a?void 0:a.type,r=_t(e.items.default);n.arrayType=`${e.type} of ${Array.isArray(t)?t.join(""):t}`,n.default=r,n.allowedValues=e.items.const?e.const:Array.isArray(null===(o=e.items)||void 0===o?void 0:o.enum)?e.items.enum.map((e=>_t(e))).join("┃"):""}return t.match(/integer|number/g)&&(void 0===e.minimum&&void 0===e.exclusiveMinimum||(r+=void 0!==e.minimum?`Min ${e.minimum}`:`More than ${e.exclusiveMinimum}`),void 0===e.maximum&&void 0===e.exclusiveMaximum||(r+=void 0!==e.maximum?`${r?"┃":""}Max ${e.maximum}`:`${r?"┃":""}Less than ${e.exclusiveMaximum}`),void 0!==e.multipleOf&&(r+=`${r?"┃":""} multiple of ${e.multipleOf}`)),t.match(/string/g)&&(void 0!==e.minLength&&void 0!==e.maxLength?r+=`${r?"┃":""}${e.minLength} to ${e.maxLength} chars`:void 0!==e.minLength?r+=`${r?"┃":""}Min ${e.minLength} chars`:void 0!==e.maxLength&&(r+=`Max ${r?"┃":""}${e.maxLength} chars`)),n.constrain=r,n.html=`${n.type}~|~${n.readOrWriteOnly}~|~${n.constrain}~|~${n.default}~|~${n.allowedValues}~|~${n.pattern}~|~${n.description}~|~${e.title||""}~|~${n.deprecated?"deprecated":""}`,n}function Pt(e){return"boolean"==typeof e||"number"==typeof e?{Example:{value:`${e}`}}:""===e?{Example:{value:""}}:e?{Example:{value:e}}:e}function Tt(e,t="string"){if(!e)return{exampleVal:"",exampleList:[]};if(e.constructor===Object){const t=Object.values(e).filter((e=>!1!==e["x-example-show-value"])).map((e=>({value:"boolean"==typeof e.value||"number"==typeof e.value?`${e.value}`:e.value||"",printableValue:_t(e.value),summary:e.summary||"",description:e.description||""})));return{exampleVal:t.length>0?t[0].value:"",exampleList:t}}if(Array.isArray(e)||(e=e?[e]:[]),0===e.length)return{exampleVal:"",exampleList:[]};if("array"===t){const[t]=e,r=e.map((e=>({value:e,printableValue:_t(e)})));return{exampleVal:t,exampleList:r}}const r=e[0].toString(),n=e.map((e=>({value:e.toString(),printableValue:_t(e)})));return{exampleVal:r,exampleList:n}}function jt(e){const t=e.examples?e.examples[0]:null===e.example?null:e.example||void 0;if(""===t)return"";if(null===t)return null;if(0===t)return 0;if(!1===t)return!1;if(t instanceof Date)switch(e.format.toLowerCase()){case"date":return t.toISOString().split("T")[0];case"time":return t.toISOString().split("T")[1];default:return t.toISOString()}if(t)return t;if(0===Object.keys(e).length)return null;if(e.$ref)return e.$ref;if(!1===e.const||0===e.const||null===e.const||""===e.const)return e.const;if(e.const)return e.const;const r=Array.isArray(e.type)?e.type[0]:e.type;if(!r)return"?";if(r.match(/^integer|^number/g)){const t=Number.isNaN(Number(e.multipleOf))?void 0:Number(e.multipleOf),n=Number.isNaN(Number(e.maximum))?void 0:Number(e.maximum),a=Number.isNaN(Number(e.minimum))?Number.isNaN(Number(e.exclusiveMinimum))?n||0:Number(e.exclusiveMinimum)+(r.startsWith("integer")?1:.001):Number(e.minimum);return t?t>=a?t:a%t==0?a:Math.ceil(a/t)*t:a}if(r.match(/^boolean/g))return!1;if(r.match(/^null/g))return null;if(r.match(/^string/g)){if(e.enum)return e.enum[0];if(e.const)return e.const;if(e.pattern)return e.pattern;if(!e.format){const t=Number.isNaN(e.minLength)?void 0:Number(e.minLength),r=Number.isNaN(e.maxLength)?void 0:Number(e.maxLength),n=t||(r>6?6:r||void 0);return n?"A".repeat(n):"string"}{const t=`${Date.now().toString(16)}${Math.random().toString(16)}0`.repeat(16);switch(e.format.toLowerCase()){case"url":case"uri":return"http://example.com";case"date":return new Date(0).toISOString().split("T")[0];case"time":return new Date(0).toISOString().split("T")[1];case"date-time":return new Date(0).toISOString();case"duration":return"P3Y6M4DT12H30M5S";case"email":case"idn-email":return"user@example.com";case"hostname":case"idn-hostname":return"www.example.com";case"ipv4":return"198.51.100.42";case"ipv6":return"2001:0db8:5b96:0000:0000:426f:8e17:642a";case"uuid":return[t.substr(0,8),t.substr(8,4),`4000-8${t.substr(13,3)}`,t.substr(16,12)].join("-");default:return""}}}return"?"}function Rt(e,t=1){const r=" ".repeat(t);let n="";if(1===t&&"object"!=typeof e)return`\n${r}${e.toString()}`;for(const a in e){const o=e[a]["::XML_TAG"]||a;let i="";i=Array.isArray(e[a])?o[0]["::XML_TAG"]||`${a}`:o,a.startsWith("::")||(n=Array.isArray(e[a])||"object"==typeof e[a]?`${n}\n${r}<${i}>${Rt(e[a],t+1)}\n${r}${i}>`:`${n}\n${r}<${i}>${e[a].toString()}${i}>`)}return n}function Ct(e,t){var r,n;if("object"==typeof t&&null!==t){var a,o;if(e.title&&(t["::TITLE"]=e.title),e.description&&(t["::DESCRIPTION"]=e.description),null!==(r=e.xml)&&void 0!==r&&r.name)t["::XML_TAG"]=null===(a=e.xml)||void 0===a?void 0:a.name;if(null!==(n=e.xml)&&void 0!==n&&n.wrapped)t["::XML_WRAP"]=null===(o=e.xml)||void 0===o?void 0:o.wrapped.toString()}}function It(e){if("object"==typeof e&&null!==e){delete e["::TITLE"],delete e["::DESCRIPTION"],delete e["::XML_TAG"],delete e["::XML_WRAP"];for(const t in e)It(e[t])}}function Dt(e,t,r){for(const n in t)t[n][r]=e}function Mt(e,t,r){let n=0;const a={};for(const o in e){for(const i in r)if(a[`example-${n}`]={...e[o]},a[`example-${n}`][t]=r[i],n++,n>=10)break;if(n>=10)break}return a}function Lt(e,t={}){let r={};if(e){if(e.allOf){var n,a;const o={};if(!(1!==e.allOf.length||null!==(n=e.allOf[0])&&void 0!==n&&n.properties||null!==(a=e.allOf[0])&&void 0!==a&&a.items)){if(e.allOf[0].$ref)return"{ }";if(e.allOf[0].readOnly&&t.includeReadOnly){return jt(e.allOf[0])}return}e.allOf.forEach((e=>{if("object"===e.type||e.properties||e.allOf||e.anyOf||e.oneOf){const r=Lt(e,t);Object.assign(o,r)}else if("array"===e.type||e.items){const r=[Lt(e,t)];Object.assign(o,r)}else{if(!e.type)return"";{const t=`prop${Object.keys(o).length}`;o[t]=jt(e)}}})),r=o}else if(e.oneOf){const n={};if(e.properties)for(const r in e.properties){var o;e.properties[r].properties||null!==(o=e.properties[r].properties)&&void 0!==o&&o.items?n[r]=Lt(e.properties[r],t):n[r]=jt(e.properties[r])}if(e.oneOf.length>0){let a=0;for(const o in e.oneOf){const i=Lt(e.oneOf[o],t);for(const t in i){let s;if(Object.keys(n).length>0){if(null===i[t]||"object"!=typeof i[t])continue;s=Object.assign(i[t],n)}else s=i[t];r[`example-${a}`]=s,Ct(e.oneOf[o],r[`example-${a}`]),a++}}}}else if(e.anyOf){let n;if("object"===e.type||e.properties){n={"example-0":{}};for(const r in e.properties){if(e.example){n=e;break}e.properties[r].deprecated&&!t.includeDeprecated||(e.properties[r].readOnly&&!t.includeReadOnly||e.properties[r].writeOnly&&!t.includeWriteOnly||(n=Mt(n,r,Lt(e.properties[r],t))))}}let a=0;for(const o in e.anyOf){const i=Lt(e.anyOf[o],t);for(const t in i){if(void 0!==n)for(const e in n)r[`example-${a}`]={...n[e],...i[t]};else r[`example-${a}`]=i[t];Ct(e.anyOf[o],r[`example-${a}`]),a++}}}else if("object"===e.type||e.properties)if(r["example-0"]={},Ct(e,r["example-0"]),e.example)r["example-0"]=e.example;else for(const n in e.properties){var i,s,l,c,p,d,u;if(null===(i=e.properties[n])||void 0===i||!i.deprecated||t.includeDeprecated)if(null===(s=e.properties[n])||void 0===s||!s.readOnly||t.includeReadOnly)if(null===(l=e.properties[n])||void 0===l||!l.writeOnly||t.includeWriteOnly)if("array"===(null===(c=e.properties[n])||void 0===c?void 0:c.type)||null!==(p=e.properties[n])&&void 0!==p&&p.items)if(e.properties[n].example)Dt(e.properties[n].example,r,n);else if(null!==(d=e.properties[n])&&void 0!==d&&null!==(u=d.items)&&void 0!==u&&u.example)Dt([e.properties[n].items.example],r,n);else{const a=Lt(e.properties[n].items,t);if(t.useXmlTagForProp){var h,f;const t=(null===(h=e.properties[n].xml)||void 0===h?void 0:h.name)||n;if(null!==(f=e.properties[n].xml)&&void 0!==f&&f.wrapped){r=Mt(r,t,JSON.parse(`{ "${t}" : { "${t}" : ${JSON.stringify(a["example-0"])} } }`))}else r=Mt(r,t,a)}else{const e=[];for(const t in a)e[t]=[a[t]];r=Mt(r,n,e)}}else r=Mt(r,n,Lt(e.properties[n],t))}else{if("array"!==e.type&&!e.items)return{"example-0":jt(e)};var m;if(e.items||e.example)if(e.example)r["example-0"]=e.example;else if(null!==(m=e.items)&&void 0!==m&&m.example)r["example-0"]=[e.items.example];else{const n=Lt(e.items,t);let a=0;for(const t in n)r[`example-${a}`]=[n[t]],Ct(e.items,r[`example-${a}`]),a++}else r["example-0"]=[]}return r}}function Nt(e,t=0){var r;let n=(e.description||e.title)&&(e.minItems||e.maxItems)?'➔':"";if(e.title?n=e.description?`${n} ${e.title}: ${e.description} `:`${n} ${e.title} `:e.description&&(n=`${n} ${e.description} `),e.minItems&&(n=`${n} Min Items: ${e.minItems}`),e.maxItems&&(n=`${n} Max Items: ${e.maxItems}`),t>0&&null!==(r=e.items)&&void 0!==r&&r.description){let t="";e.items.minProperties&&(t=`Min Properties: ${e.items.minProperties}`),e.items.maxProperties&&(t=`${t} Max Properties: ${e.items.maxProperties}`),n=`${n} ⮕ ${t} [ ${e.items.description} ] `}return n}function Ft(e,t,r=0,n=""){if(e){if(e.allOf){const n={};if(1===e.allOf.length&&!e.allOf[0].properties&&!e.allOf[0].items){return`${Ot(e.allOf[0]).html}`}e.allOf.map(((e,t)=>{if("object"===e.type||e.properties||e.allOf||e.anyOf||e.oneOf){const a=(e.anyOf||e.oneOf)&&t>0?t:"",o=Ft(e,{},r+1,a);Object.assign(n,o)}else if("array"===e.type||e.items){const t=Ft(e,{},r+1);Object.assign(n,t)}else{if(!e.type)return"";{const t=`prop${Object.keys(n).length}`,r=Ot(e);n[t]=`${r.html}`}}})),t=n}else if(e.anyOf||e.oneOf){if(t["::description"]=e.description||"","object"===e.type||e.properties){t["::description"]=e.description||"",t["::type"]="object";for(const n in e.properties)e.required&&e.required.includes(n)?t[`${n}*`]=Ft(e.properties[n],{},r+1):t[n]=Ft(e.properties[n],{},r+1)}const a={},o=e.anyOf?"anyOf":"oneOf";e[o].forEach(((e,t)=>{if("object"===e.type||e.properties||e.allOf||e.anyOf||e.oneOf){const r=Ft(e,{});a[`::OPTION~${t+1}${e.title?`~${e.title}`:""}`]=r,a[`::OPTION~${t+1}${e.title?`~${e.title}`:""}`]["::readwrite"]="",a["::type"]="xxx-of-option"}else if("array"===e.type||e.items){const r=Ft(e,{});a[`::OPTION~${t+1}${e.title?`~${e.title}`:""}`]=r,a[`::OPTION~${t+1}${e.title?`~${e.title}`:""}`]["::readwrite"]="",a["::type"]="xxx-of-array"}else{const r=`::OPTION~${t+1}${e.title?`~${e.title}`:""}`;a[r]=`${Ot(e).html}`,a["::type"]="xxx-of-option"}})),t[e.anyOf?`::ANY~OF ${n}`:`::ONE~OF ${n}`]=a,t["::type"]="object"}else if(Array.isArray(e.type)){const n=JSON.parse(JSON.stringify(e)),i=[],s=[];let l;var a;if(n.type.forEach((e=>{var t,r;e.match(/integer|number|string|null|boolean/g)?i.push(e):"array"===e&&"string"==typeof(null===(t=n.items)||void 0===t?void 0:t.type)&&null!==(r=n.items)&&void 0!==r&&r.type.match(/integer|number|string|null|boolean/g)?"string"===n.items.type&&n.items.format?i.push(`[${n.items.format}]`):i.push(`[${n.items.type}]`):s.push(e)})),i.length>0)if(n.type=i.join(2===i.length?" or ":"┃"),l=Ot(n),0===s.length)return`${(null===(a=l)||void 0===a?void 0:a.html)||""}`;if(s.length>0){var o;t["::type"]="object";const a={"::type":"xxx-of-option"};s.forEach(((t,o)=>{if("null"===t)a[`::OPTION~${o+1}`]="NULL~|~~|~~|~~|~~|~~|~~|~~|~";else if("integer, number, string, boolean,".includes(`${t},`)){n.type=Array.isArray(t)?t.join("┃"):t;const e=Ot(n);a[`::OPTION~${o+1}`]=e.html}else if("object"===t){const t={"::title":e.title||"","::description":e.description||"","::type":"object","::deprecated":e.deprecated||!1};for(const n in e.properties)e.required&&e.required.includes(n)?t[`${n}*`]=Ft(e.properties[n],{},r+1):t[n]=Ft(e.properties[n],{},r+1);a[`::OPTION~${o+1}`]=t}else"array"===t&&(a[`::OPTION~${o+1}`]={"::title":e.title||"","::description":e.description||"","::type":"array","::props":Ft(e.items,{},r+1)})})),a[`::OPTION~${s.length+1}`]=(null===(o=l)||void 0===o?void 0:o.html)||"",t["::ONE~OF"]=a}}else if("object"===e.type||e.properties){t["::title"]=e.title||"",t["::description"]=Nt(e,r),t["::type"]="object",(Array.isArray(e.type)&&e.type.includes("null")||e.nullable)&&(t["::dataTypeLabel"]="object or null"),t["::deprecated"]=e.deprecated||!1,t["::readwrite"]=e.readOnly?"readonly":e.writeOnly?"writeonly":"";for(const n in e.properties)e.required&&e.required.includes(n)?t[`${n}*`]=Ft(e.properties[n],{},r+1):t[n]=Ft(e.properties[n],{},r+1);for(const n in e.patternProperties)t[`[pattern: ${n}]`]=Ft(e.patternProperties[n],t,r+1);e.additionalProperties&&(t["[any-key]"]=Ft(e.additionalProperties,{}))}else{if("array"!==e.type&&!e.items){const t=Ot(e);return null!=t&&t.html?`${t.html}`:""}var i;t["::title"]=e.title||"",t["::description"]=Nt(e,r),t["::type"]="array",(Array.isArray(e.type)&&e.type.includes("null")||e.nullable)&&(t["::dataTypeLabel"]="array or null"),t["::deprecated"]=e.deprecated||!1,t["::readwrite"]=e.readOnly?"readonly":e.writeOnly?"writeonly":"",null!==(i=e.items)&&void 0!==i&&i.items&&(t["::array-type"]=e.items.items.type),t["::props"]=Ft(e.items,{},r+1)}return t}}function Ut(e,t,r="",n="",a=!0,o=!0,i="json",s=!1){const l=[];if(r)for(const e in r){let n="",a="json";if(null!=t&&t.toLowerCase().includes("json")){if("text"===i)n="string"==typeof r[e].value?r[e].value:JSON.stringify(r[e].value,void 0,2),a="text";else if(n=r[e].value,"string"==typeof r[e].value)try{const t=r[e].value;n=JSON.parse(t),a="json"}catch(t){a="text",n=r[e].value}}else n=r[e].value,a="text";l.push({exampleId:e,exampleSummary:r[e].summary||e,exampleDescription:r[e].description||"",exampleType:t,exampleValue:n,exampleFormat:a})}else if(n){let e="",r="json";if(null!=t&&t.toLowerCase().includes("json")){if("text"===i)e="string"==typeof n?n:JSON.stringify(n,void 0,2),r="text";else if("object"==typeof n)e=n,r="json";else if("string"==typeof n)try{e=JSON.parse(n),r="json"}catch(t){r="text",e=n}}else e=n,r="text";l.push({exampleId:"Example",exampleSummary:"",exampleDescription:"",exampleType:t,exampleValue:e,exampleFormat:r})}if(0===l.length||!0===s)if(e)if(e.example)l.push({exampleId:"Example",exampleSummary:"",exampleDescription:"",exampleType:t,exampleValue:e.example,exampleFormat:null!=t&&t.toLowerCase().includes("json")&&"object"==typeof e.example?"json":"text"});else if(null!=t&&t.toLowerCase().includes("json")||null!=t&&t.toLowerCase().includes("text")||null!=t&&t.toLowerCase().includes("*/*")||null!=t&&t.toLowerCase().includes("xml")){let r="",n="",s="",d="";var c,p;if(null!=t&&t.toLowerCase().includes("xml"))r=null!==(c=e.xml)&&void 0!==c&&c.name?`<${e.xml.name} ${e.xml.namespace?`xmlns="${e.xml.namespace}"`:""}>`:"",n=null!==(p=e.xml)&&void 0!==p&&p.name?`${e.xml.name}>`:"",s="text";else s=i;const u=Lt(e,{includeReadOnly:a,includeWriteOnly:o,deprecated:!0,useXmlTagForProp:null==t?void 0:t.toLowerCase().includes("xml")});let h=0;for(const e in u){if(!u[e])continue;const a=u[e]["::TITLE"]||"Example "+ ++h,o=u[e]["::DESCRIPTION"]||"";null!=t&&t.toLowerCase().includes("xml")?d=`\n${r}${Rt(u[e],1)}\n${n}`:(It(u[e]),d="text"===i?JSON.stringify(u[e],null,2):u[e]),l.push({exampleId:e,exampleSummary:a,exampleDescription:o,exampleType:t,exampleFormat:s,exampleValue:d})}}else null!=t&&t.toLowerCase().includes("jose")?l.push({exampleId:"Example",exampleSummary:"Base64 Encoded",exampleDescription:"",exampleType:t,exampleValue:e.pattern||"bXJpbg==",exampleFormat:"text"}):l.push({exampleId:"Example",exampleSummary:"",exampleDescription:"",exampleType:t,exampleValue:"",exampleFormat:"text"});else l.push({exampleId:"Example",exampleSummary:"",exampleDescription:"",exampleType:t,exampleValue:"",exampleFormat:"text"});return l}function qt(e){return"application/json"===e?"json":"application/xml"===e?"xml":null}function Bt(e){if(e.schema)return[e.schema,null,null];if(e.content)for(const t of Object.keys(e.content))if(e.content[t].schema)return[e.content[t].schema,qt(t),e.content[t]];return[null,null,null]}var Ht=r(5108);function zt(e){let t=this.path;const r=[],n=[...e.querySelectorAll("[data-ptype='path']")],a=[...e.querySelectorAll("[data-ptype='query']")],o=[...e.querySelectorAll("[data-ptype='query-object']")];n.map((e=>{t=t.replace(`{${e.dataset.pname}}`,encodeURIComponent(e.value))}));const i=new Map,s=[];a.length>0&&a.forEach((e=>{const t=new URLSearchParams;if("true"===e.dataset.paramAllowReserved&&s.push(e.dataset.pname),"false"===e.dataset.array)""!==e.value&&(r.push({name:e.dataset.pname,value:e.value}),t.append(e.dataset.pname,e.value));else{const{paramSerializeStyle:n,paramSerializeExplode:a}=e.dataset;let o=e.value&&Array.isArray(e.value)?e.value:[];o=Array.isArray(o)?o.filter((e=>""!==e)):[],o.length>0&&("spaceDelimited"===n?(r.push({name:e.dataset.pname,value:o.join(" ").replace(/^\s|\s$/g,"")}),t.append(e.dataset.pname,o.join(" ").replace(/^\s|\s$/g,""))):"pipeDelimited"===n?(r.push({name:e.dataset.pname,value:o.join("|").replace(/^\||\|$/g,"")}),t.append(e.dataset.pname,o.join("|").replace(/^\||\|$/g,""))):"true"===a?o.forEach((n=>{r.push({name:e.dataset.pname,value:n}),t.append(e.dataset.pname,n)})):(r.push({name:e.dataset.pname,value:o.join(",").replace(/^,|,$/g,"")}),t.append(e.dataset.pname,o.join(",").replace(/^,|,$/g,""))))}t.toString()&&i.set(e.dataset.pname,t)})),o.length>0&&o.map((e=>{const t=new URLSearchParams;try{let n={};const{paramSerializeStyle:a,paramSerializeExplode:o,pname:i}=e.dataset;if(n=Object.assign(n,JSON.parse(e.value.replace(/\s+/g," "))),"true"===e.dataset.paramAllowReserved&&s.push(e.dataset.pname),"json xml".includes(a))"json"===a?(r.push({name:e.dataset.pname,value:JSON.stringify(n)}),t.append(e.dataset.pname,JSON.stringify(n))):"xml"===a&&(r.push({name:e.dataset.pname,value:Rt(n)}),t.append(e.dataset.pname,Rt(n)));else for(const e in n){const s=`${i}[${e}]`;"object"==typeof n[e]?Array.isArray(n[e])&&("spaceDelimited"===a?(r.push({name:s,value:n[e].join(" ")}),t.append(s,n[e].join(" "))):"pipeDelimited"===a?(r.push({name:s,value:n[e].join("|")}),t.append(s,n[e].join("|"))):"true"===o?n[e].forEach((e=>{r.push({name:s,value:e}),t.append(s,e)})):(r.push({name:s,value:n[e]}),t.append(s,n[e]))):(r.push({name:s,value:n[e]}),t.append(s,n[e]))}}catch(t){Ht.log("RapiDoc: unable to parse %s into object",e.value)}t.toString()&&i.set(e.dataset.pname,t)}));let l="";return i.size&&(i.forEach(((e,t)=>{s.includes(t)?(l+=`${t}=`,l+=e.getAll(t).join(`&${t}=`),l+="&"):l+=`${e.toString()}&`})),l=l.slice(0,-1)),0!==l.length&&(t=`${t}${t.includes("?")?"&":"?"}${l}`),this.api_keys.filter((e=>"query"===e.in)).forEach((e=>{t=`${t}${t.includes("?")?"&":"?"}${e.name}=${encodeURIComponent(e.finalKeyValue)}`})),t=`${this.selectedServer.computedUrl.replace(/\/$/,"")}${t}`,{fetchUrl:t,queryString:r}}function Wt(e){const t={method:this.method.toUpperCase()},r={mimeType:""},n=e.querySelector(".request-body-container"),a=n?n.dataset.selectedRequestBodyType:"";if(n)if(a.includes("form-urlencoded")){const n=e.querySelector("[data-ptype='dynamic-form']");if(n){const e=n.value,a=new URLSearchParams;let o,i=!0;if(e)try{o=JSON.parse(e)}catch(e){i=!1,Ht.warn("RapiDoc: Invalid JSON provided",e)}else i=!1;if(i){for(const e in o)a.append(e,JSON.stringify(o[e]));t.body=a,r.params=a}}else{const n=[...e.querySelectorAll("[data-ptype='form-urlencode']")],a=new URLSearchParams,o=[];n.filter((e=>"file"!==e.type)).forEach((e=>{if("false"===e.dataset.array)e.value&&(a.append(e.dataset.pname,e.value),o.push({name:e.dataset.pname,value:e.value}));else{const t=e.value&&Array.isArray(e.value)?e.value.join(","):"";a.append(e.dataset.pname,t),o.push({name:e.dataset.pname,value:t})}})),t.body=a,r.params=o}}else if(a.includes("form-data")){const n=new FormData,a=[];[...e.querySelectorAll("[data-ptype='form-data']")].forEach((e=>{"false"===e.dataset.array?"file"===e.type&&e.files[0]?(n.append(e.dataset.pname,e.files[0],e.files[0].name),a.push({name:e.dataset.pname,value:e.files[0],fileName:e.files[0].name})):e.value&&(n.append(e.dataset.pname,e.value),a.push({name:e.dataset.pname,value:e.value})):e.value&&Array.isArray(e.value)&&(n.append(e.dataset.pname,e.value.join(",")),a.push({name:e.dataset.pname,value:e.value.join(",")}))})),t.body=n,r.params=a}else if(/^audio\/|^image\/|^video\/|^font\/|tar$|zip$|7z$|rtf$|msword$|excel$|\/pdf$|\/octet-stream$/.test(a)){const r=e.querySelector(".request-body-param-file");null!=r&&r.files[0]&&(t.body=r.files[0])}else if(a.includes("json")||a.includes("xml")||a.includes("text")){const n=e.querySelector(".request-body-param-user-input");if(null!=n&&n.value){if(t.body=n.value,a.includes("json"))try{r.text=JSON.stringify(JSON.parse(n.value))}catch(e){}r.text&&0===r.text.length&&(r.text=n.value.replace(/'/g,"'\"'\"'"))}}return n&&(r.mimeType=a),{fetchOptions:t,postData:r}}function Vt(e){var t;let r="",n="";const a=new Headers,o=[],i=e.querySelector(".request-body-container"),s=[...e.querySelectorAll("[data-ptype='header']")],l=null===(t=this.closest(".expanded-req-resp-container, .req-resp-container"))||void 0===t?void 0:t.getElementsByTagName("api-response")[0],c=null==l?void 0:l.selectedMimeType;return s.map((e=>{e.value&&("Accept"===e.dataset.pname?r=e.value:"Content-Type"===e.dataset.pname?n=e.value:(a.append(e.dataset.pname,e.value),o.push({name:e.dataset.pname,value:e.value})))})),r?(a.append("Accept",r),o.push({name:"Accept",value:r})):c?(a.append("Accept",c),o.push({name:"Accept",value:c})):this.accept&&(a.append("Accept",this.accept),o.push({name:"Accept",value:this.accept})),n?(a.append("Content-Type",n),o.push({name:"Content-Type",value:n})):i&&(a.append("Content-Type",i.dataset.selectedRequestBodyType),o.push({name:"Content-Type",value:i.dataset.selectedRequestBodyType})),this.resolvedSpec.securitySchemes.forEach((e=>{a.append(e.name,e.value),o.push({name:e.name,value:e.value})})),{reqHeaders:a,headers:o}}function Zt(e){return e=e.replace(/\/?%7B/gm,"{").replace(/\/?%7D/gm,"}")}function Gt(e){const t=e.closest(".request-panel"),{fetchUrl:r,queryString:n}=zt.call(this,t),{fetchOptions:a,postData:o}=Wt.call(this,t),{reqHeaders:i,headers:s}=Vt.call(this,t),l=new(At())({method:this.method,url:r,queryString:n,headers:s,postData:o});l.requests[0].url=Zt(l.requests[0].url),l.requests[0].fullUrl=Zt(l.requests[0].fullUrl);const c=l.convert(this.selectedLanguage,{indent:"\t"});return this.codeExample=c,{fetchUrl:r,fetchOptions:a,reqHeaders:i}}var Kt=r(8764).Buffer,Yt=r(5108);const Jt="731DB1C3F7EA533B85E29492D26AA-1234567890-1234567890",Xt="4FatVDBJKPAo4JgLLaaQFMUcQPn5CrPRvLlaob9PTYc",Qt="rapidoc";function er(e,t="",r="",n=""){var a,o;const i=null===(a=this.resolvedSpec.securitySchemes)||void 0===a?void 0:a.find((t=>t.securitySchemeId===e));if(!i)return!1;let s="";if("basic"===(null===(o=i.scheme)||void 0===o?void 0:o.toLowerCase()))t&&(s=`Basic ${Kt.from(`${t}:${r}`,"utf8").toString("base64")}`);else if(n){var l;i.value=n,s=`${"bearer"===(null===(l=i.scheme)||void 0===l?void 0:l.toLowerCase())?"Bearer ":""}${n}`}return!!s&&(i.finalKeyValue=s,this.requestUpdate(),!0)}function tr(){var e;null===(e=this.resolvedSpec.securitySchemes)||void 0===e||e.forEach((e=>{e.user="",e.password="",e.value="",e.finalKeyValue=""})),this.requestUpdate()}function rr(){return JSON.parse(localStorage.getItem(Qt))||{}}function nr(e){localStorage.setItem(Qt,JSON.stringify(e))}function ar(){const e=rr.call(this);Object.values(e).forEach((e=>{er.call(this,e.securitySchemeId,e.username,e.password,e.value)}))}function or(e){let t="";const r=this.resolvedSpec.securitySchemes.find((t=>t.securitySchemeId===e));if(r){const n=this.shadowRoot.getElementById(`security-scheme-${e}`);if(n){if(r.type&&r.scheme&&"http"===r.type&&"basic"===r.scheme.toLowerCase()){const t=n.querySelector(".api-key-user").value.trim(),r=n.querySelector(".api-key-password").value.trim();er.call(this,e,t,r)}else t=n.querySelector(".api-key-input").value.trim(),er.call(this,e,"","",t);if("true"===this.persistAuth){const t=rr.call(this);t[e]=r,nr.call(this,t)}}}}function ir(e,t,r="Bearer"){const n=this.resolvedSpec.securitySchemes.find((t=>t.securitySchemeId===e));n.finalKeyValue=`${"bearer"===r.toLowerCase()?"Bearer":"mac"===r.toLowerCase()?"MAC":r} ${t}`,this.requestUpdate()}async function sr(e,t,r,n,a,o,i,s,l="header",c=null,p=null,d=null){const u=s?s.querySelector(".oauth-resp-display"):void 0,h=new URLSearchParams,f=new Headers;h.append("grant_type",a),"authorization_code"===a&&(h.append("client_id",t),h.append("client_secret",r)),"client_credentials"!==a&&"password"!==a&&h.append("redirect_uri",n),o&&(h.append("code",o),h.append("code_verifier",Jt)),"header"===l?f.set("Authorization",`Basic ${Kt.from(`${t}:${r}`,"utf8").toString("base64")}`):"authorization_code"!==a&&(h.append("client_id",t),h.append("client_secret",r)),"password"===a&&(h.append("username",p),h.append("password",d)),c&&h.append("scope",c);try{const t=await fetch(e,{method:"POST",headers:f,body:h}),r=await t.json();if(!t.ok)return u&&(u.innerHTML=`${r.error_description||r.error_description||"Unable to get access token"}`),!1;if(r.token_type&&r.access_token)return ir.call(this,i,r.access_token,r.token_type),u&&(u.innerHTML='Access Token Received'),!0}catch(e){return u&&(u.innerHTML='Failed to get access token'),!1}}async function lr(e,t,r,n,a,o,i,s,l,c){sessionStorage.removeItem("winMessageEventActive"),t.close(),e.data.fake||(e.data||Yt.warn("RapiDoc: Received no data with authorization message"),e.data.error&&Yt.warn("RapiDoc: Error while receiving data"),e.data&&("code"===e.data.responseType?sr.call(this,r,n,a,o,i,e.data.code,l,c,s):"token"===e.data.responseType&&ir.call(this,l,e.data.access_token,e.data.token_type)))}async function cr(e,t,r,n,a){const o=a.target.closest(".oauth-flow"),i=o.querySelector(".oauth-client-id")?o.querySelector(".oauth-client-id").value.trim():"",s=o.querySelector(".oauth-client-secret")?o.querySelector(".oauth-client-secret").value.trim():"",l=o.querySelector(".api-key-user")?o.querySelector(".api-key-user").value.trim():"",c=o.querySelector(".api-key-password")?o.querySelector(".api-key-password").value.trim():"",p=o.querySelector(".oauth-send-client-secret-in")?o.querySelector(".oauth-send-client-secret-in").value.trim():"header",d=[...o.querySelectorAll(".scope-checkbox:checked")],u=o.querySelector(`#${e}-pkce`),h=`${Math.random().toString(36).slice(2,9)}random${Math.random().toString(36).slice(2,9)}`,f=`${Math.random().toString(36).slice(2,9)}random${Math.random().toString(36).slice(2,9)}`,m=new URL(`${window.location.origin}${window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))}/${this.oauthReceiver}`);let g,y="",v="";if([...o.parentNode.querySelectorAll(".oauth-resp-display")].forEach((e=>{e.innerHTML=""})),"authorizationCode"===t||"implicit"===t){const a=new URL(r);"authorizationCode"===t?(y="authorization_code",v="code"):"implicit"===t&&(v="token");const l=new URLSearchParams(a.search),c=d.map((e=>e.value)).join(" ");c&&l.set("scope",c),l.set("client_id",i),l.set("redirect_uri",m.toString()),l.set("response_type",v),l.set("state",h),l.set("nonce",f),u&&u.checked&&(l.set("code_challenge",Xt),l.set("code_challenge_method","S256")),l.set("show_dialog",!0),a.search=l.toString(),"true"===sessionStorage.getItem("winMessageEventActive")&&window.postMessage({fake:!0},this),setTimeout((()=>{g=window.open(a.toString()),g?(sessionStorage.setItem("winMessageEventActive","true"),window.addEventListener("message",(t=>lr.call(this,t,g,n,i,s,m.toString(),y,p,e,o)),{once:!0})):Yt.error(`RapiDoc: Unable to open ${a.toString()} in a new window`)}),10)}else if("clientCredentials"===t){y="client_credentials";const t=d.map((e=>e.value)).join(" ");sr.call(this,n,i,s,m.toString(),y,"",e,o,p,t)}else if("password"===t){y="password";const t=d.map((e=>e.value)).join(" ");sr.call(this,n,i,s,m.toString(),y,"",e,o,p,t,l,c)}}function pr(e,t,r,n,a,o=[],i="header"){let{authorizationUrl:s,tokenUrl:l,refreshUrl:c}=a;const p=a["x-pkce-only"]||!1,d=e=>e.indexOf("://")>0||0===e.indexOf("//"),u=new URL(this.selectedServer.computedUrl).origin;let h;return c&&!d(c)&&(c=`${u}/${c.replace(/^\//,"")}`),l&&!d(l)&&(l=`${u}/${l.replace(/^\//,"")}`),s&&!d(s)&&(s=`${u}/${s.replace(/^\//,"")}`),h="authorizationCode"===e?"Authorization Code Flow":"clientCredentials"===e?"Client Credentials Flow":"implicit"===e?"Implicit Flow":"password"===e?"Password Flow":e,B`
+`;var it=r(5108);const st=/[\s#:?&={}]/g,lt="_rapidoc_api_key";function ct(e){return new Promise((t=>setTimeout(t,e)))}function pt(e,t){const r=t.target.closest("button"),n=document.createElement("textarea");n.value=e,n.style.position="fixed",document.body.appendChild(n),n.focus(),n.select();try{document.execCommand("copy"),r.innerHTML='',setTimeout((()=>{r.innerHTML='\n '}),5e3)}catch(e){it.error("Unable to copy",e)}document.body.removeChild(n)}function dt(e,t,r="includes"){if("includes"===r){return`${t.method} ${t.path} ${t.summary||t.description||""} ${t.operationId||""}`.toLowerCase().includes(e.toLowerCase())}return new RegExp(`^${e}$`,"i").test(`${t.method} ${t.path}`)}function ut(e,t=new Set){return e?(Object.keys(e).forEach((r=>{var n;if(t.add(r),e[r].properties)ut(e[r].properties,t);else if(null!==(n=e[r].items)&&void 0!==n&&n.properties){var a;ut(null===(a=e[r].items)||void 0===a?void 0:a.properties,t)}})),t):t}function ht(e,t){if(e){const r=document.createElement("a");document.body.appendChild(r),r.style="display: none",r.href=e,r.download=t,r.click(),r.remove()}}function ft(e){if(e){const t=document.createElement("a");document.body.appendChild(t),t.style="display: none",t.href=e,t.target="_blank",t.click(),t.remove()}}var mt=r(9682),gt=r.n(mt),yt=r(5108);async function vt(e,t,r=!1,n=!1,a="",o="",i="",s="",l=""){var c,p;let d,u;try{var h,f;if(this.requestUpdate(),t)u=JSON.parse(t);else{const t=await gt().dereference(e);u=await gt().parse(t)}if(null!==(h=u)&&void 0!==h&&h.jsonSchemaViewer&&null!==(f=u)&&void 0!==f&&f.schemaAndExamples){this.dispatchEvent(new CustomEvent("before-render",{detail:{spec:u.resolvedSpec}}));const e=Object.entries(u.resolvedSpec.schemaAndExamples).map((e=>({show:!0,expanded:!0,selectedExample:null,name:e[0],elementId:e[0].replace(st,"-"),...e[1]})));return{specLoadError:!1,isSpecLoading:!1,info:u.resolvedSpec.info,schemaAndExamples:e}}if(!u||!(u.components||u.info||u.servers||u.tags||u.paths))return yt.info("RapiDoc: %c There was an issue while parsing the spec %o ","color:orangered",u),{specLoadError:!0,isSpecLoading:!1,info:{title:"Error loading the spec",description:"Unable to load the Spec",version:" "},tags:[]};d=u,this.dispatchEvent(new CustomEvent("before-render",{detail:{spec:d}}))}catch(e){yt.info("RapiDoc: %c There was an issue while parsing the spec %o ","color:orangered",e)}const m=function(e,t,r=!1,n=!1){const a=["get","put","post","delete","patch","head","options"],o=e.tags&&Array.isArray(e.tags)?e.tags.map((e=>({show:!0,elementId:`tag--${e.name.replace(st,"-")}`,name:e.name,description:e.description||"",headers:e.description?bt(e.description):[],paths:[],expanded:!1!==e["x-tag-expanded"]}))):[],i=e.paths||{};if(e.webhooks)for(const[t,r]of Object.entries(e.webhooks))r._type="webhook",i[t]=r;for(const t in i){const n=i[t].parameters,s={servers:i[t].servers||[],parameters:i[t].parameters||[]},l="webhook"===i[t]._type;a.forEach((a=>{if(i[t][a]){const i=e.paths[t][a],c=i.tags||[];if(0===c.length)if(r){const e=t.replace(/^\/+|\/+$/g,""),r=e.indexOf("/");-1===r?c.push(e):c.push(e.substr(0,r))}else c.push("General ⦂");c.forEach((r=>{let c,p;var d,u;(e.tags&&(p=e.tags.find((e=>e.name.toLowerCase()===r.toLowerCase()))),c=o.find((e=>e.name===r)),c)||(c={show:!0,elementId:`tag--${r.replace(st,"-")}`,name:r,description:(null===(d=p)||void 0===d?void 0:d.description)||"",headers:null!==(u=p)&&void 0!==u&&u.description?bt(p.description):[],paths:[],expanded:!p||!1!==p["x-tag-expanded"]},o.push(c));let h=(i.summary||i.description||`${a.toUpperCase()} ${t}`).trim();h.length>100&&([h]=h.split(/[.|!|?]\s|[\r?\n]/));let f=[];if(f=n?i.parameters?n.filter((e=>{if(!i.parameters.some((t=>e.name===t.name&&e.in===t.in)))return e})).concat(i.parameters):n.slice(0):i.parameters?i.parameters.slice(0):[],i.callbacks)for(const[e,t]of Object.entries(i.callbacks)){const r=Object.entries(t).filter((e=>"object"==typeof e[1]))||[];i.callbacks[e]=Object.fromEntries(r)}c.paths.push({show:!0,expanded:!1,isWebhook:l,expandedAtLeastOnce:!1,summary:i.summary||"",description:i.description||"",externalDocs:i.externalDocs,shortSummary:h,method:a,path:t,operationId:i.operationId,elementId:`${a}-${t.replace(st,"-")}`,servers:i.servers?s.servers.concat(i.servers):s.servers,parameters:f,requestBody:i.requestBody,responses:i.responses,callbacks:i.callbacks,deprecated:i.deprecated,security:i.security,xBadges:i["x-badges"]||void 0,xCodeSamples:i["x-codeSamples"]||i["x-code-samples"]||""})}))}}))}const s=o.filter((e=>e.paths&&e.paths.length>0));return s.forEach((e=>{"method"===t?e.paths.sort(((e,t)=>a.indexOf(e.method).toString().localeCompare(a.indexOf(t.method)))):"summary"===t?e.paths.sort(((e,t)=>e.shortSummary.localeCompare(t.shortSummary))):"path"===t&&e.paths.sort(((e,t)=>e.path.localeCompare(t.path))),e.firstPathId=e.paths[0].elementId})),n?s.sort(((e,t)=>e.name.localeCompare(t.name))):s}(d,a,r,n),g=function(e){if(!e.components)return[];const t=[];for(const r in e.components){const n=[];for(const t in e.components[r]){const a={show:!0,id:`${r.toLowerCase()}-${t.toLowerCase()}`.replace(st,"-"),name:t,component:e.components[r][t]};n.push(a)}let a=r,o=r;switch(r){case"schemas":o="Schemas",a="Schemas allows the definition of input and output data types. These types can be objects, but also primitives and arrays.";break;case"responses":o="Responses",a="Describes responses from an API Operation, including design-time, static links to operations based on the response.";break;case"parameters":o="Parameters",a="Describes operation parameters. A unique parameter is defined by a combination of a name and location.";break;case"examples":o="Examples",a="List of Examples for operations, can be requests, responses and objects examples.";break;case"requestBodies":o="Request Bodies",a="Describes common request bodies that are used across the API operations.";break;case"headers":o="Headers",a='Headers follows the structure of the Parameters but they are explicitly in "header"';break;case"securitySchemes":o="Security Schemes",a="Defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), OAuth2's common flows(implicit, password, client credentials and authorization code) as defined in RFC6749, and OpenID Connect Discovery.";break;case"links":o="Links",a="Links represent a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.";break;case"callbacks":o="Callbacks",a="A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the path item object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.";break;default:o=r,a=r}const i={show:!0,name:o,description:a,subComponents:n};t.push(i)}return t||[]}(d),y=null!==(c=d.info)&&void 0!==c&&c.description?bt(d.info.description):[],v=[];let b=[];if(null!==(p=d.components)&&void 0!==p&&p.securitySchemes){var x;b=d.security?d.security:[null===(x=d.components)||void 0===x?void 0:x.securitySchemes];const e=new Set;Object.entries(d.components.securitySchemes).forEach((t=>{if(!e.has(t[0])){e.add(t[0]);const r={securitySchemeId:t[0],...t[1]};r.value="",r.finalKeyValue="","apiKey"===t[1].type||"http"===t[1].type?(r.in=t[1].in||"header",r.name=t[1].name||"Authorization",r.user="",r.password=""):"oauth2"===t[1].type&&(r.in="header",r.name="Authorization",r.clientId="",r.clientSecret=""),v.push(r)}}))}o&&i&&s&&v.push({securitySchemeId:lt,description:"api-key provided in rapidoc element attributes",type:"apiKey",oAuthFlow:"",name:o,in:i,value:s,finalKeyValue:s}),v.forEach((e=>{"http"===e.type?e.typeDisplay="basic"===e.scheme?"HTTP Basic":"HTTP Bearer":"apiKey"===e.type?e.typeDisplay=`API Key (${e.name})`:"oauth2"===e.type?e.typeDisplay=`OAuth (${e.securitySchemeId})`:e.typeDisplay=e.type||"None"}));let w=[];d.servers&&Array.isArray(d.servers)?(d.servers.forEach((e=>{let t=e.url.trim();t.startsWith("http")||t.startsWith("//")||t.startsWith("{")||window.location.origin.startsWith("http")&&(e.url=window.location.origin+e.url,t=e.url),e.variables&&Object.entries(e.variables).forEach((e=>{const r=new RegExp(`{${e[0]}}`,"g");t=t.replace(r,e[1].default||""),e[1].value=e[1].default||""})),e.computedUrl=t})),l&&d.servers.push({url:l,computedUrl:l})):l?d.servers=[{url:l,computedUrl:l}]:window.location.origin.startsWith("http")?d.servers=[{url:window.location.origin,computedUrl:window.location.origin}]:d.servers=[{url:"http://localhost",computedUrl:"http://localhost"}],w=d.servers;return{specLoadError:!1,isSpecLoading:!1,info:d.info,infoDescriptionHeaders:y,tags:m,components:g,externalDocs:d.externalDocs,securitySchemes:v,servers:w,security:b}}function bt(e){const t=Ve.lexer(e).filter((e=>"heading"===e.type&&e.depth<=2));return t||[]}const xt=2,wt=e=>(...t)=>({_$litDirective$:e,values:t});class $t{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}class St extends $t{constructor(e){if(super(e),this.et=z,e.type!==xt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===z||null==e)return this.ft=void 0,this.et=e;if(e===H)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.et)return this.ft;this.et=e;const t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}}St.directiveName="unsafeHTML",St.resultType=1;const Et=wt(St);function kt(e,t){return!e||e.some((e=>e.hasOwnProperty(t)&&Array.isArray(e[t])&&0===e[t].length))}var At=r(212),_t=r.n(At);function Ot(e){if(void 0===e)return"";if(null===e)return"null";if(""===e)return"∅";if("boolean"==typeof e||"number"==typeof e)return`${e}`;if(Array.isArray(e))return e.map((e=>null===e?"null":""===e?"∅":e.toString().replace(/^ +| +$/g,(e=>"●".repeat(e.length)))||"")).join(", ");if("object"==typeof e){const t=Object.keys(e);return`{ ${t[0]}:${e[t[0]]}${t.length>1?",":""} ... }`}return e.toString().replace(/^ +| +$/g,(e=>"●".repeat(e.length)))||""}function Pt(e){if(!e)return;let t="",r="";if(e.$ref){const r=e.$ref.lastIndexOf("/");t=`{recursive: ${e.$ref.substring(r+1)}} `}else e.type?(t=Array.isArray(e.type)?e.type.join(2===e.length?" or ":"┃"):e.type,(e.format||e.enum||e.const)&&(t=t.replace("string",e.enum?"enum":e.const?"const":e.format)),e.nullable&&(t+="┃null")):t=e.const?"const":0===Object.keys(e).length?"any":"{missing-type-info}";const n={type:t,format:e.format||"",pattern:e.pattern&&!e.enum?e.pattern:"",readOrWriteOnly:e.readOnly?"🆁":e.writeOnly?"🆆":"",deprecated:e.deprecated?"❌":"",examples:e.examples||e.example,default:Ot(e.default),description:e.description||"",constrain:"",allowedValues:"",arrayType:"",html:""};if("{recursive}"===n.type?n.description=e.$ref.substring(e.$ref.lastIndexOf("/")+1):"{missing-type-info}"!==n.type&&"any"!==n.type||(n.description=n.description||""),n.allowedValues=e.const?e.const:Array.isArray(e.enum)?e.enum.map((e=>Ot(e))).join("┃"):"","array"===t&&e.items){var a,o;const t=null===(a=e.items)||void 0===a?void 0:a.type,r=Ot(e.items.default);n.arrayType=`${e.type} of ${Array.isArray(t)?t.join(""):t}`,n.default=r,n.allowedValues=e.items.const?e.const:Array.isArray(null===(o=e.items)||void 0===o?void 0:o.enum)?e.items.enum.map((e=>Ot(e))).join("┃"):""}return t.match(/integer|number/g)&&(void 0===e.minimum&&void 0===e.exclusiveMinimum||(r+=void 0!==e.minimum?`Min ${e.minimum}`:`More than ${e.exclusiveMinimum}`),void 0===e.maximum&&void 0===e.exclusiveMaximum||(r+=void 0!==e.maximum?`${r?"┃":""}Max ${e.maximum}`:`${r?"┃":""}Less than ${e.exclusiveMaximum}`),void 0!==e.multipleOf&&(r+=`${r?"┃":""} multiple of ${e.multipleOf}`)),t.match(/string/g)&&(void 0!==e.minLength&&void 0!==e.maxLength?r+=`${r?"┃":""}${e.minLength} to ${e.maxLength} chars`:void 0!==e.minLength?r+=`${r?"┃":""}Min ${e.minLength} chars`:void 0!==e.maxLength&&(r+=`Max ${r?"┃":""}${e.maxLength} chars`)),n.constrain=r,n.html=`${n.type}~|~${n.readOrWriteOnly}~|~${n.constrain}~|~${n.default}~|~${n.allowedValues}~|~${n.pattern}~|~${n.description}~|~${e.title||""}~|~${n.deprecated?"deprecated":""}`,n}function Tt(e){return"boolean"==typeof e||"number"==typeof e?{Example:{value:`${e}`}}:""===e?{Example:{value:""}}:e?{Example:{value:e}}:e}function jt(e,t="string"){if(!e)return{exampleVal:"",exampleList:[]};if(e.constructor===Object){const t=Object.values(e).filter((e=>!1!==e["x-example-show-value"])).map((e=>({value:"boolean"==typeof e.value||"number"==typeof e.value?`${e.value}`:e.value||"",printableValue:Ot(e.value),summary:e.summary||"",description:e.description||""})));return{exampleVal:t.length>0?t[0].value:"",exampleList:t}}if(Array.isArray(e)||(e=e?[e]:[]),0===e.length)return{exampleVal:"",exampleList:[]};if("array"===t){const[t]=e,r=e.map((e=>({value:e,printableValue:Ot(e)})));return{exampleVal:t,exampleList:r}}const r=e[0].toString(),n=e.map((e=>({value:e.toString(),printableValue:Ot(e)})));return{exampleVal:r,exampleList:n}}function Ct(e){const t=e.examples?e.examples[0]:null===e.example?null:e.example||void 0;if(""===t)return"";if(null===t)return null;if(0===t)return 0;if(!1===t)return!1;if(t instanceof Date)switch(e.format.toLowerCase()){case"date":return t.toISOString().split("T")[0];case"time":return t.toISOString().split("T")[1];default:return t.toISOString()}if(t)return t;if(0===Object.keys(e).length)return null;if(e.$ref)return e.$ref;if(!1===e.const||0===e.const||null===e.const||""===e.const)return e.const;if(e.const)return e.const;const r=Array.isArray(e.type)?e.type[0]:e.type;if(!r)return"?";if(r.match(/^integer|^number/g)){const t=Number.isNaN(Number(e.multipleOf))?void 0:Number(e.multipleOf),n=Number.isNaN(Number(e.maximum))?void 0:Number(e.maximum),a=Number.isNaN(Number(e.minimum))?Number.isNaN(Number(e.exclusiveMinimum))?n||0:Number(e.exclusiveMinimum)+(r.startsWith("integer")?1:.001):Number(e.minimum);return t?t>=a?t:a%t==0?a:Math.ceil(a/t)*t:a}if(r.match(/^boolean/g))return!1;if(r.match(/^null/g))return null;if(r.match(/^string/g)){if(e.enum)return e.enum[0];if(e.const)return e.const;if(e.pattern)return e.pattern;if(!e.format){const t=Number.isNaN(e.minLength)?void 0:Number(e.minLength),r=Number.isNaN(e.maxLength)?void 0:Number(e.maxLength),n=t||(r>6?6:r||void 0);return n?"A".repeat(n):"string"}{const t=`${Date.now().toString(16)}${Math.random().toString(16)}0`.repeat(16);switch(e.format.toLowerCase()){case"url":case"uri":return"http://example.com";case"date":return new Date(0).toISOString().split("T")[0];case"time":return new Date(0).toISOString().split("T")[1];case"date-time":return new Date(0).toISOString();case"duration":return"P3Y6M4DT12H30M5S";case"email":case"idn-email":return"user@example.com";case"hostname":case"idn-hostname":return"www.example.com";case"ipv4":return"198.51.100.42";case"ipv6":return"2001:0db8:5b96:0000:0000:426f:8e17:642a";case"uuid":return[t.substr(0,8),t.substr(8,4),`4000-8${t.substr(13,3)}`,t.substr(16,12)].join("-");default:return""}}}return"?"}function Rt(e,t=1){const r=" ".repeat(t);let n="";if(1===t&&"object"!=typeof e)return`\n${r}${e.toString()}`;for(const a in e){const o=e[a]["::XML_TAG"]||a;let i="";i=Array.isArray(e[a])?o[0]["::XML_TAG"]||`${a}`:o,a.startsWith("::")||(n=Array.isArray(e[a])||"object"==typeof e[a]?`${n}\n${r}<${i}>${Rt(e[a],t+1)}\n${r}${i}>`:`${n}\n${r}<${i}>${e[a].toString()}${i}>`)}return n}function It(e,t){var r,n;if("object"==typeof t&&null!==t){var a,o;if(e.title&&(t["::TITLE"]=e.title),e.description&&(t["::DESCRIPTION"]=e.description),null!==(r=e.xml)&&void 0!==r&&r.name)t["::XML_TAG"]=null===(a=e.xml)||void 0===a?void 0:a.name;if(null!==(n=e.xml)&&void 0!==n&&n.wrapped)t["::XML_WRAP"]=null===(o=e.xml)||void 0===o?void 0:o.wrapped.toString()}}function Dt(e){if("object"==typeof e&&null!==e){delete e["::TITLE"],delete e["::DESCRIPTION"],delete e["::XML_TAG"],delete e["::XML_WRAP"];for(const t in e)Dt(e[t])}}function Lt(e,t,r){for(const n in t)t[n][r]=e}function Mt(e,t,r){let n=0;const a={};for(const o in e){for(const i in r)if(a[`example-${n}`]={...e[o]},a[`example-${n}`][t]=r[i],n++,n>=10)break;if(n>=10)break}return a}function Nt(e,t={}){let r={};if(e){if(e.allOf){var n,a;const o={};if(!(1!==e.allOf.length||null!==(n=e.allOf[0])&&void 0!==n&&n.properties||null!==(a=e.allOf[0])&&void 0!==a&&a.items)){if(e.allOf[0].$ref)return"{ }";if(e.allOf[0].readOnly&&t.includeReadOnly){return Ct(e.allOf[0])}return}e.allOf.forEach((e=>{if("object"===e.type||e.properties||e.allOf||e.anyOf||e.oneOf){const r=Nt(e,t);Object.assign(o,r)}else if("array"===e.type||e.items){const r=[Nt(e,t)];Object.assign(o,r)}else{if(!e.type)return"";{const t=`prop${Object.keys(o).length}`;o[t]=Ct(e)}}})),r=o}else if(e.oneOf){const n={};if(e.properties)for(const r in e.properties){var o;e.properties[r].properties||null!==(o=e.properties[r].properties)&&void 0!==o&&o.items?n[r]=Nt(e.properties[r],t):n[r]=Ct(e.properties[r])}if(e.oneOf.length>0){let a=0;for(const o in e.oneOf){const i=Nt(e.oneOf[o],t);for(const t in i){let s;if(Object.keys(n).length>0){if(null===i[t]||"object"!=typeof i[t])continue;s=Object.assign(i[t],n)}else s=i[t];r[`example-${a}`]=s,It(e.oneOf[o],r[`example-${a}`]),a++}}}}else if(e.anyOf){let n;if("object"===e.type||e.properties){n={"example-0":{}};for(const r in e.properties){if(e.example){n=e;break}e.properties[r].deprecated&&!t.includeDeprecated||(e.properties[r].readOnly&&!t.includeReadOnly||e.properties[r].writeOnly&&!t.includeWriteOnly||(n=Mt(n,r,Nt(e.properties[r],t))))}}let a=0;for(const o in e.anyOf){const i=Nt(e.anyOf[o],t);for(const t in i){if(void 0!==n)for(const e in n)r[`example-${a}`]={...n[e],...i[t]};else r[`example-${a}`]=i[t];It(e.anyOf[o],r[`example-${a}`]),a++}}}else if("object"===e.type||e.properties)if(r["example-0"]={},It(e,r["example-0"]),e.example)r["example-0"]=e.example;else for(const n in e.properties){var i,s,l,c,p,d,u;if(null===(i=e.properties[n])||void 0===i||!i.deprecated||t.includeDeprecated)if(null===(s=e.properties[n])||void 0===s||!s.readOnly||t.includeReadOnly)if(null===(l=e.properties[n])||void 0===l||!l.writeOnly||t.includeWriteOnly)if("array"===(null===(c=e.properties[n])||void 0===c?void 0:c.type)||null!==(p=e.properties[n])&&void 0!==p&&p.items)if(e.properties[n].example)Lt(e.properties[n].example,r,n);else if(null!==(d=e.properties[n])&&void 0!==d&&null!==(u=d.items)&&void 0!==u&&u.example)Lt([e.properties[n].items.example],r,n);else{const a=Nt(e.properties[n].items,t);if(t.useXmlTagForProp){var h,f;const t=(null===(h=e.properties[n].xml)||void 0===h?void 0:h.name)||n;if(null!==(f=e.properties[n].xml)&&void 0!==f&&f.wrapped){r=Mt(r,t,JSON.parse(`{ "${t}" : { "${t}" : ${JSON.stringify(a["example-0"])} } }`))}else r=Mt(r,t,a)}else{const e=[];for(const t in a)e[t]=[a[t]];r=Mt(r,n,e)}}else r=Mt(r,n,Nt(e.properties[n],t))}else{if("array"!==e.type&&!e.items)return{"example-0":Ct(e)};var m;if(e.items||e.example)if(e.example)r["example-0"]=e.example;else if(null!==(m=e.items)&&void 0!==m&&m.example)r["example-0"]=[e.items.example];else{const n=Nt(e.items,t);let a=0;for(const t in n)r[`example-${a}`]=[n[t]],It(e.items,r[`example-${a}`]),a++}else r["example-0"]=[]}return r}}function Ft(e,t=0){var r;let n=(e.description||e.title)&&(e.minItems||e.maxItems)?'➔':"";if(e.title?n=e.description?`${n} ${e.description} `:`${n} ${e.title} `:e.description&&(n=`${n} ${e.description} `),e.minItems&&(n=`${n} Min Items: ${e.minItems}`),e.maxItems&&(n=`${n} Max Items: ${e.maxItems}`),t>0&&null!==(r=e.items)&&void 0!==r&&r.description){let t="";e.items.minProperties&&(t=`Min Properties: ${e.items.minProperties}`),e.items.maxProperties&&(t=`${t} Max Properties: ${e.items.maxProperties}`),n=`${n} ⮕ ${t} [ ${e.items.description} ] `}return n}function Ut(e,t,r=0,n=""){if(e){if(e.allOf){const n={};if(1===e.allOf.length&&!e.allOf[0].properties&&!e.allOf[0].items){return`${Pt(e.allOf[0]).html}`}e.allOf.map(((e,t)=>{if("object"===e.type||e.properties||e.allOf||e.anyOf||e.oneOf){const a=(e.anyOf||e.oneOf)&&t>0?t:"",o=Ut(e,{},r+1,a);Object.assign(n,o)}else if("array"===e.type||e.items){const t=Ut(e,{},r+1);Object.assign(n,t)}else{if(!e.type)return"";{const t=`prop${Object.keys(n).length}`,r=Pt(e);n[t]=`${r.html}`}}})),t=n}if(e.anyOf||e.oneOf){if(t["::description"]=e.description||"","object"===e.type||e.properties){t["::description"]=e.description||"",t["::type"]="object";for(const n in e.properties)e.required&&e.required.includes(n)?t[`${n}*`]=Ut(e.properties[n],{},r+1):t[n]=Ut(e.properties[n],{},r+1)}const a={},o=e.anyOf?"anyOf":"oneOf";e[o].forEach(((e,t)=>{if("object"===e.type||e.properties||e.allOf||e.anyOf||e.oneOf){const r=Ut(e,{});a[`::OPTION~${t+1}${e.title?`~${e.title}`:""}`]=r,a[`::OPTION~${t+1}${e.title?`~${e.title}`:""}`]["::readwrite"]="",a["::type"]="xxx-of-option"}else if("array"===e.type||e.items){const r=Ut(e,{});a[`::OPTION~${t+1}${e.title?`~${e.title}`:""}`]=r,a[`::OPTION~${t+1}${e.title?`~${e.title}`:""}`]["::readwrite"]="",a["::type"]="xxx-of-array"}else{const r=`::OPTION~${t+1}${e.title?`~${e.title}`:""}`;a[r]=`${Pt(e).html}`,a["::type"]="xxx-of-option"}})),t[e.anyOf?`::ANY~OF ${n}`:`::ONE~OF ${n}`]=a,t["::type"]="object"}else if(Array.isArray(e.type)){const n=JSON.parse(JSON.stringify(e)),i=[],s=[];let l;var a;if(n.type.forEach((e=>{var t,r;e.match(/integer|number|string|null|boolean/g)?i.push(e):"array"===e&&"string"==typeof(null===(t=n.items)||void 0===t?void 0:t.type)&&null!==(r=n.items)&&void 0!==r&&r.type.match(/integer|number|string|null|boolean/g)?"string"===n.items.type&&n.items.format?i.push(`[${n.items.format}]`):i.push(`[${n.items.type}]`):s.push(e)})),i.length>0)if(n.type=i.join(2===i.length?" or ":"┃"),l=Pt(n),0===s.length)return`${(null===(a=l)||void 0===a?void 0:a.html)||""}`;if(s.length>0){var o;t["::type"]="object";const a={"::type":"xxx-of-option"};s.forEach(((t,o)=>{if("null"===t)a[`::OPTION~${o+1}`]="NULL~|~~|~~|~~|~~|~~|~~|~~|~";else if("integer, number, string, boolean,".includes(`${t},`)){n.type=Array.isArray(t)?t.join("┃"):t;const e=Pt(n);a[`::OPTION~${o+1}`]=e.html}else if("object"===t){const t={"::title":e.title||"","::description":e.description||"","::type":"object","::deprecated":e.deprecated||!1};for(const n in e.properties)e.required&&e.required.includes(n)?t[`${n}*`]=Ut(e.properties[n],{},r+1):t[n]=Ut(e.properties[n],{},r+1);a[`::OPTION~${o+1}`]=t}else"array"===t&&(a[`::OPTION~${o+1}`]={"::title":e.title||"","::description":e.description||"","::type":"array","::props":Ut(e.items,{},r+1)})})),a[`::OPTION~${s.length+1}`]=(null===(o=l)||void 0===o?void 0:o.html)||"",t["::ONE~OF"]=a}}else if("object"===e.type||e.properties){t["::title"]=e.title||"",t["::description"]=Ft(e,r),t["::type"]="object",(Array.isArray(e.type)&&e.type.includes("null")||e.nullable)&&(t["::dataTypeLabel"]="object or null"),t["::deprecated"]=e.deprecated||!1,t["::readwrite"]=e.readOnly?"readonly":e.writeOnly?"writeonly":"";for(const n in e.properties)e.required&&e.required.includes(n)?t[`${n}*`]=Ut(e.properties[n],{},r+1):t[n]=Ut(e.properties[n],{},r+1);for(const n in e.patternProperties)t[`[pattern: ${n}]`]=Ut(e.patternProperties[n],t,r+1);e.additionalProperties&&(t["[any-key]"]=Ut(e.additionalProperties,{}))}else if("array"===e.type||e.items){var i;t["::title"]=e.title||"",t["::description"]=Ft(e,r),t["::type"]="array",(Array.isArray(e.type)&&e.type.includes("null")||e.nullable)&&(t["::dataTypeLabel"]="array or null"),t["::deprecated"]=e.deprecated||!1,t["::readwrite"]=e.readOnly?"readonly":e.writeOnly?"writeonly":"",null!==(i=e.items)&&void 0!==i&&i.items&&(t["::array-type"]=e.items.items.type),t["::props"]=Ut(e.items,{},r+1)}else if(!e.allOf){const t=Pt(e);return null!=t&&t.html?`${t.html}`:""}return t}}function qt(e,t,r="",n="",a=!0,o=!0,i="json",s=!1){const l=[];if(r)for(const e in r){let n="",a="json";if(null!=t&&t.toLowerCase().includes("json")){if("text"===i)n="string"==typeof r[e].value?r[e].value:JSON.stringify(r[e].value,void 0,2),a="text";else if(n=r[e].value,"string"==typeof r[e].value)try{const t=r[e].value;n=JSON.parse(t),a="json"}catch(t){a="text",n=r[e].value}}else n=r[e].value,a="text";l.push({exampleId:e,exampleSummary:r[e].summary||e,exampleDescription:r[e].description||"",exampleType:t,exampleValue:n,exampleFormat:a})}else if(n){let e="",r="json";if(null!=t&&t.toLowerCase().includes("json")){if("text"===i)e="string"==typeof n?n:JSON.stringify(n,void 0,2),r="text";else if("object"==typeof n)e=n,r="json";else if("string"==typeof n)try{e=JSON.parse(n),r="json"}catch(t){r="text",e=n}}else e=n,r="text";l.push({exampleId:"Example",exampleSummary:"",exampleDescription:"",exampleType:t,exampleValue:e,exampleFormat:r})}if(0===l.length||!0===s)if(e)if(e.example)l.push({exampleId:"Example",exampleSummary:"",exampleDescription:"",exampleType:t,exampleValue:e.example,exampleFormat:null!=t&&t.toLowerCase().includes("json")&&"object"==typeof e.example?"json":"text"});else if(null!=t&&t.toLowerCase().includes("json")||null!=t&&t.toLowerCase().includes("text")||null!=t&&t.toLowerCase().includes("*/*")||null!=t&&t.toLowerCase().includes("xml")){let r="",n="",s="",d="";var c,p;if(null!=t&&t.toLowerCase().includes("xml"))r=null!==(c=e.xml)&&void 0!==c&&c.name?`<${e.xml.name} ${e.xml.namespace?`xmlns="${e.xml.namespace}"`:""}>`:"",n=null!==(p=e.xml)&&void 0!==p&&p.name?`${e.xml.name}>`:"",s="text";else s=i;const u=Nt(e,{includeReadOnly:a,includeWriteOnly:o,deprecated:!0,useXmlTagForProp:null==t?void 0:t.toLowerCase().includes("xml")});let h=0;for(const e in u){if(!u[e])continue;const a=u[e]["::TITLE"]||"Example "+ ++h,o=u[e]["::DESCRIPTION"]||"";null!=t&&t.toLowerCase().includes("xml")?d=`\n${r}${Rt(u[e],1)}\n${n}`:(Dt(u[e]),d="text"===i?JSON.stringify(u[e],null,2):u[e]),l.push({exampleId:e,exampleSummary:a,exampleDescription:o,exampleType:t,exampleFormat:s,exampleValue:d})}}else null!=t&&t.toLowerCase().includes("jose")?l.push({exampleId:"Example",exampleSummary:"Base64 Encoded",exampleDescription:"",exampleType:t,exampleValue:e.pattern||"bXJpbg==",exampleFormat:"text"}):l.push({exampleId:"Example",exampleSummary:"",exampleDescription:"",exampleType:t,exampleValue:"",exampleFormat:"text"});else l.push({exampleId:"Example",exampleSummary:"",exampleDescription:"",exampleType:t,exampleValue:"",exampleFormat:"text"});return l}function Bt(e){return"application/json"===e?"json":"application/xml"===e?"xml":null}function Ht(e){if(e.schema)return[e.schema,null,null];if(e.content)for(const t of Object.keys(e.content))if(e.content[t].schema)return[e.content[t].schema,Bt(t),e.content[t]];return[null,null,null]}var zt=r(5108);function Wt(e){let t=this.path;const r=[],n=[...e.querySelectorAll("[data-ptype='path']")],a=[...e.querySelectorAll("[data-ptype='query']")],o=[...e.querySelectorAll("[data-ptype='query-object']")];n.map((e=>{t=t.replace(`{${e.dataset.pname}}`,encodeURIComponent(e.value))}));const i=new Map,s=[];a.length>0&&a.forEach((e=>{const t=new URLSearchParams;if("true"===e.dataset.paramAllowReserved&&s.push(e.dataset.pname),"false"===e.dataset.array)""!==e.value&&(r.push({name:e.dataset.pname,value:e.value}),t.append(e.dataset.pname,e.value));else{const{paramSerializeStyle:n,paramSerializeExplode:a}=e.dataset;let o=e.value&&Array.isArray(e.value)?e.value:[];o=Array.isArray(o)?o.filter((e=>""!==e)):[],o.length>0&&("spaceDelimited"===n?(r.push({name:e.dataset.pname,value:o.join(" ").replace(/^\s|\s$/g,"")}),t.append(e.dataset.pname,o.join(" ").replace(/^\s|\s$/g,""))):"pipeDelimited"===n?(r.push({name:e.dataset.pname,value:o.join("|").replace(/^\||\|$/g,"")}),t.append(e.dataset.pname,o.join("|").replace(/^\||\|$/g,""))):"true"===a?o.forEach((n=>{r.push({name:e.dataset.pname,value:n}),t.append(e.dataset.pname,n)})):(r.push({name:e.dataset.pname,value:o.join(",").replace(/^,|,$/g,"")}),t.append(e.dataset.pname,o.join(",").replace(/^,|,$/g,""))))}t.toString()&&i.set(e.dataset.pname,t)})),o.length>0&&o.map((e=>{const t=new URLSearchParams;try{let n={};const{paramSerializeStyle:a,paramSerializeExplode:o,pname:i}=e.dataset;if(n=Object.assign(n,JSON.parse(e.value.replace(/\s+/g," "))),"true"===e.dataset.paramAllowReserved&&s.push(e.dataset.pname),"json xml".includes(a))"json"===a?(r.push({name:e.dataset.pname,value:JSON.stringify(n)}),t.append(e.dataset.pname,JSON.stringify(n))):"xml"===a&&(r.push({name:e.dataset.pname,value:Rt(n)}),t.append(e.dataset.pname,Rt(n)));else for(const e in n){const s=`${i}[${e}]`;"object"==typeof n[e]?Array.isArray(n[e])&&("spaceDelimited"===a?(r.push({name:s,value:n[e].join(" ")}),t.append(s,n[e].join(" "))):"pipeDelimited"===a?(r.push({name:s,value:n[e].join("|")}),t.append(s,n[e].join("|"))):"true"===o?n[e].forEach((e=>{r.push({name:s,value:e}),t.append(s,e)})):(r.push({name:s,value:n[e]}),t.append(s,n[e]))):(r.push({name:s,value:n[e]}),t.append(s,n[e]))}}catch(t){zt.log("RapiDoc: unable to parse %s into object",e.value)}t.toString()&&i.set(e.dataset.pname,t)}));let l="";return i.size&&(i.forEach(((e,t)=>{s.includes(t)?(l+=`${t}=`,l+=e.getAll(t).join(`&${t}=`),l+="&"):l+=`${e.toString()}&`})),l=l.slice(0,-1)),0!==l.length&&(t=`${t}${t.includes("?")?"&":"?"}${l}`),this.api_keys.filter((e=>"query"===e.in)).forEach((e=>{t=`${t}${t.includes("?")?"&":"?"}${e.name}=${encodeURIComponent(e.finalKeyValue)}`})),t=`${this.selectedServer.computedUrl.replace(/\/$/,"")}${t}`,{fetchUrl:t,queryString:r}}function Zt(e){const t={method:this.method.toUpperCase()},r={mimeType:""},n=e.querySelector(".request-body-container"),a=n?n.dataset.selectedRequestBodyType:"";if(n)if(a.includes("form-urlencoded")){const n=e.querySelector("[data-ptype='dynamic-form']");if(n){const e=n.value,a=new URLSearchParams;let o,i=!0;if(e)try{o=JSON.parse(e)}catch(e){i=!1,zt.warn("RapiDoc: Invalid JSON provided",e)}else i=!1;if(i){for(const e in o)a.append(e,JSON.stringify(o[e]));t.body=a,r.params=a}}else{const n=[...e.querySelectorAll("[data-ptype='form-urlencode']")],a=new URLSearchParams,o=[];n.filter((e=>"file"!==e.type)).forEach((e=>{if("false"===e.dataset.array)e.value&&(a.append(e.dataset.pname,e.value),o.push({name:e.dataset.pname,value:e.value}));else{const t=e.value&&Array.isArray(e.value)?e.value.join(","):"";a.append(e.dataset.pname,t),o.push({name:e.dataset.pname,value:t})}})),t.body=a,r.params=o}}else if(a.includes("form-data")){const n=new FormData,a=[];[...e.querySelectorAll("[data-ptype='form-data']")].forEach((e=>{"false"===e.dataset.array?"file"===e.type&&e.files[0]?(n.append(e.dataset.pname,e.files[0],e.files[0].name),a.push({name:e.dataset.pname,value:e.files[0],fileName:e.files[0].name})):e.value&&(n.append(e.dataset.pname,e.value),a.push({name:e.dataset.pname,value:e.value})):e.value&&Array.isArray(e.value)&&(n.append(e.dataset.pname,e.value.join(",")),a.push({name:e.dataset.pname,value:e.value.join(",")}))})),t.body=n,r.params=a}else if(/^audio\/|^image\/|^video\/|^font\/|tar$|zip$|7z$|rtf$|msword$|excel$|\/pdf$|\/octet-stream$/.test(a)){const r=e.querySelector(".request-body-param-file");null!=r&&r.files[0]&&(t.body=r.files[0])}else if(a.includes("json")||a.includes("xml")||a.includes("text")){const n=e.querySelector(".request-body-param-user-input");if(null!=n&&n.value){if(t.body=n.value,a.includes("json"))try{r.text=JSON.stringify(JSON.parse(n.value))}catch(e){}r.text&&0===r.text.length&&(r.text=n.value.replace(/'/g,"'\"'\"'"))}}return n&&(r.mimeType=a),{fetchOptions:t,postData:r}}function Vt(e){var t;let r="",n="";const a=[],o=new Headers,i=[],s=e.querySelector(".request-body-container"),l=[...e.querySelectorAll("[data-ptype='header']")],c=null===(t=this.closest(".expanded-req-resp-container, .req-resp-container"))||void 0===t?void 0:t.getElementsByTagName("api-response")[0],p=null==c?void 0:c.selectedMimeType;return l.map((e=>{e.value&&("Accept"===e.dataset.pname?r=e.value:"Content-Type"===e.dataset.pname?n=e.value:(o.append(e.dataset.pname,e.value),i.push({name:e.dataset.pname,value:e.value})))})),r?(o.append("Accept",r),i.push({name:"Accept",value:r})):p?(o.append("Accept",p),i.push({name:"Accept",value:p})):this.accept&&(o.append("Accept",this.accept),i.push({name:"Accept",value:this.accept})),n?(o.append("Content-Type",n),i.push({name:"Content-Type",value:n})):s&&(o.append("Content-Type",s.dataset.selectedRequestBodyType),i.push({name:"Content-Type",value:s.dataset.selectedRequestBodyType})),(this.security?this.security:this.resolvedSpec.security).forEach(((e,t)=>{if(this.selectedAuthScheme===t&&(Object.keys(e).map((e=>{const t=this.resolvedSpec.securitySchemes.find((t=>t.securitySchemeId===e));kt(this.security,t.securitySchemeId)&&("cookie"!==t.in&&(o.append(t.name,t.value),i.push({name:t.name,value:t.value})),"cookie"===t.in&&a.push({name:t.name,value:t.value}))})),a.length>0)){const e=a.map((e=>`${e.name}=${e.value}`));i.push({name:"Cookie",value:e.join("; path=/")})}})),{reqHeaders:o,headers:i,reqCookieHeader:a}}function Kt(e){const t=[];return[...e.querySelectorAll("[data-ptype='cookie']")].forEach((e=>{e.value&&t.push({name:e.dataset.pname,value:e.value})})),{cookies:t}}function Gt(e){return e=e.replace(/%7B/gm,"{").replace(/%7D/gm,"}")}function Yt(e){const t=e.closest(".request-panel"),{fetchUrl:r,queryString:n}=Wt.call(this,t),{fetchOptions:a,postData:o}=Zt.call(this,t),{reqHeaders:i,headers:s,reqCookieHeader:l}=Vt.call(this,t),{cookies:c}=Kt.call(this,t),p=new(_t())({method:this.method,url:r,queryString:n,headers:s,postData:o,cookies:c});p.requests[0].url=Gt(p.requests[0].url),p.requests[0].fullUrl=Gt(p.requests[0].fullUrl);const d=p.convert(this.selectedLanguage,{indent:"\t"});return this.codeExample=d,{fetchUrl:r,fetchOptions:a,reqHeaders:i,reqCookie:c.concat(l)}}var Jt=r(8764).Buffer,Xt=r(5108);const Qt="731DB1C3F7EA533B85E29492D26AA-1234567890-1234567890",er="4FatVDBJKPAo4JgLLaaQFMUcQPn5CrPRvLlaob9PTYc",tr="rapidoc";function rr(e,t="",r="",n=""){var a,o;const i=null===(a=this.resolvedSpec.securitySchemes)||void 0===a?void 0:a.find((t=>t.securitySchemeId===e));if(!i)return!1;let s="";if("basic"===(null===(o=i.scheme)||void 0===o?void 0:o.toLowerCase()))t&&(s=`Basic ${Jt.from(`${t}:${r}`,"utf8").toString("base64")}`);else if(n){var l;i.value=n,s=`${"bearer"===(null===(l=i.scheme)||void 0===l?void 0:l.toLowerCase())?"Bearer ":""}${n}`}return!!s&&(i.finalKeyValue=s,this.requestUpdate(),!0)}function nr(){var e;null===(e=this.resolvedSpec.securitySchemes)||void 0===e||e.forEach((e=>{e.user="",e.password="",e.value="",e.finalKeyValue=""})),this.requestUpdate()}function ar(){return JSON.parse(localStorage.getItem(tr))||{}}function or(e){localStorage.setItem(tr,JSON.stringify(e))}function ir(){const e=ar.call(this);Object.values(e).forEach((e=>{rr.call(this,e.securitySchemeId,e.username,e.password,e.value)}))}function sr(e){let t="";const r=this.resolvedSpec.securitySchemes.find((t=>t.securitySchemeId===e));if(r){const n=this.shadowRoot.getElementById(`security-scheme-${e}`);if(n){if(r.type&&r.scheme&&"http"===r.type&&"basic"===r.scheme.toLowerCase()){const t=n.querySelector(".api-key-user").value.trim(),r=n.querySelector(".api-key-password").value.trim();rr.call(this,e,t,r)}else t=n.querySelector(".api-key-input").value.trim(),rr.call(this,e,"","",t);if("true"===this.persistAuth){const t=ar.call(this);t[e]=r,or.call(this,t)}}}}function lr(e,t,r="Bearer"){const n=this.resolvedSpec.securitySchemes.find((t=>t.securitySchemeId===e));n.finalKeyValue=`${"bearer"===r.toLowerCase()?"Bearer":"mac"===r.toLowerCase()?"MAC":r} ${t}`,this.requestUpdate()}async function cr(e,t,r,n,a,o,i,s,l="header",c=null,p=null,d=null){const u=s?s.querySelector(".oauth-resp-display"):void 0,h=new URLSearchParams,f=new Headers;h.append("grant_type",a),"authorization_code"===a&&(h.append("client_id",t),h.append("client_secret",r)),"client_credentials"!==a&&"password"!==a&&h.append("redirect_uri",n),o&&(h.append("code",o),h.append("code_verifier",Qt)),"header"===l?f.set("Authorization",`Basic ${Jt.from(`${t}:${r}`,"utf8").toString("base64")}`):"authorization_code"!==a&&(h.append("client_id",t),h.append("client_secret",r)),"password"===a&&(h.append("username",p),h.append("password",d)),c&&h.append("scope",c);try{const t=await fetch(e,{method:"POST",headers:f,body:h}),r=await t.json();if(!t.ok)return u&&(u.innerHTML=`${r.error_description||r.error_description||"Unable to get access token"}`),!1;if(r.token_type&&r.access_token)return lr.call(this,i,r.access_token,r.token_type),u&&(u.innerHTML='Access Token Received'),!0}catch(e){return u&&(u.innerHTML='Failed to get access token'),!1}}async function pr(e,t,r,n,a,o,i,s,l,c){sessionStorage.removeItem("winMessageEventActive"),t.close(),e.data.fake||(e.data||Xt.warn("RapiDoc: Received no data with authorization message"),e.data.error&&Xt.warn("RapiDoc: Error while receiving data"),e.data&&("code"===e.data.responseType?cr.call(this,r,n,a,o,i,e.data.code,l,c,s):"token"===e.data.responseType&&lr.call(this,l,e.data.access_token,e.data.token_type)))}async function dr(e,t,r,n,a){const o=a.target.closest(".oauth-flow"),i=o.querySelector(".oauth-client-id")?o.querySelector(".oauth-client-id").value.trim():"",s=o.querySelector(".oauth-client-secret")?o.querySelector(".oauth-client-secret").value.trim():"",l=o.querySelector(".api-key-user")?o.querySelector(".api-key-user").value.trim():"",c=o.querySelector(".api-key-password")?o.querySelector(".api-key-password").value.trim():"",p=o.querySelector(".oauth-send-client-secret-in")?o.querySelector(".oauth-send-client-secret-in").value.trim():"header",d=[...o.querySelectorAll(".scope-checkbox:checked")],u=o.querySelector(`#${e}-pkce`),h=`${Math.random().toString(36).slice(2,9)}random${Math.random().toString(36).slice(2,9)}`,f=`${Math.random().toString(36).slice(2,9)}random${Math.random().toString(36).slice(2,9)}`,m=new URL(`${window.location.origin}${window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))}/${this.oauthReceiver}`);let g,y="",v="";if([...o.parentNode.querySelectorAll(".oauth-resp-display")].forEach((e=>{e.innerHTML=""})),"authorizationCode"===t||"implicit"===t){const a=new URL(r);"authorizationCode"===t?(y="authorization_code",v="code"):"implicit"===t&&(v="token");const l=new URLSearchParams(a.search),c=d.map((e=>e.value)).join(" ");c&&l.set("scope",c),l.set("client_id",i),l.set("redirect_uri",m.toString()),l.set("response_type",v),l.set("state",h),l.set("nonce",f),u&&u.checked&&(l.set("code_challenge",er),l.set("code_challenge_method","S256")),l.set("show_dialog",!0),a.search=l.toString(),"true"===sessionStorage.getItem("winMessageEventActive")&&window.postMessage({fake:!0},this),setTimeout((()=>{g=window.open(a.toString()),g?(sessionStorage.setItem("winMessageEventActive","true"),window.addEventListener("message",(t=>pr.call(this,t,g,n,i,s,m.toString(),y,p,e,o)),{once:!0})):Xt.error(`RapiDoc: Unable to open ${a.toString()} in a new window`)}),10)}else if("clientCredentials"===t){y="client_credentials";const t=d.map((e=>e.value)).join(" ");cr.call(this,n,i,s,m.toString(),y,"",e,o,p,t)}else if("password"===t){y="password";const t=d.map((e=>e.value)).join(" ");cr.call(this,n,i,s,m.toString(),y,"",e,o,p,t,l,c)}}function ur(e,t,r,n,a,o=[],i="header"){let{authorizationUrl:s,tokenUrl:l,refreshUrl:c}=a;const p=a["x-pkce-only"]||!1,d=e=>e.indexOf("://")>0||0===e.indexOf("//"),u=new URL(this.selectedServer.computedUrl).origin;let h;return c&&!d(c)&&(c=`${u}/${c.replace(/^\//,"")}`),l&&!d(l)&&(l=`${u}/${l.replace(/^\//,"")}`),s&&!d(s)&&(s=`${u}/${s.replace(/^\//,"")}`),h="authorizationCode"===e?"Authorization Code Flow":"clientCredentials"===e?"Client Credentials Flow":"implicit"===e?"Implicit Flow":"password"===e?"Password Flow":e,B`
- `}formDataTemplate(e,t,r=""){const n=[];if(e.properties){for(const r in e.properties){var a,o;const i=e.properties[r];if(i.readOnly)continue;const s=i.examples||i.example||"",l=i.type,c=Ot(i),p="read focused".includes(this.renderStyle)?"200px":"160px",d=Tt(c.examples||c.example,c.type);n.push(B`
+ `}formDataTemplate(e,t,r=""){const n=[];if(e.properties){for(const r in e.properties){var a,o;const i=e.properties[r];if(i.readOnly)continue;const s=i.examples||i.example||"",l=i.type,c=Pt(i),p="read focused".includes(this.renderStyle)?"200px":"160px",d=jt(c.examples||c.example,c.type);n.push(B`
`;const p=null!==(l=e["::type"])&&void 0!==l&&l.startsWith("xxx-of")?o:o+1,d="xxx-of-option"===t||"xxx-of-option"===e["::type"]||n.startsWith("::OPTION")?i:i+1,u=10*d;if(0===Object.keys(e).length)return B`${n}`;let h="",f="",m=!1;if(n.startsWith("::ONE~OF")||n.startsWith("::ANY~OF"))h=n.replace("::","").replace("~"," "),m=!0;else if(n.startsWith("::OPTION")){const e=n.split("~");h=e[1],f=e[2]}else h=n;let g="";if("object"===e["::type"]?g="array"===t?"array of object":e["::dataTypeLabel"]||e["::type"]:"array"===e["::type"]&&(g="array"===t?"array of array "+("object"!==r?`of ${r}`:""):e["::dataTypeLabel"]||e["::type"]),"object"==typeof e)return B`
+
${Et(Ve(a))||""}
+
`;const p=null!==(l=e["::type"])&&void 0!==l&&l.startsWith("xxx-of")?o:o+1,d="xxx-of-option"===t||"xxx-of-option"===e["::type"]||n.startsWith("::OPTION")?i:i+1,u=10*d;if(0===Object.keys(e).length)return B`${n}`;let h="",f="",m=!1;if(n.startsWith("::ONE~OF")||n.startsWith("::ANY~OF"))h=n.replace("::","").replace("~"," "),a="Click + to expand or - to hide each valid schema.",m=!0;else if(n.startsWith("::OPTION")){const e=n.split("~");e[2]?(h=e[2],f=""):(h=e[1],f=e[2])}else h=n;let g="";if("object"===e["::type"]?g="array"===t?"array of object":e["::dataTypeLabel"]||e["::type"]:"array"===e["::type"]&&(g="array"===t?"array of array "+("object"!==r?`of ${r}`:""):e["::dataTypeLabel"]||e["::type"]),"object"==typeof e)return B`
${p>=0&&n?B`
- `}resetSelection(){this.selectedStatus="",this.selectedMimeType=""}getResponseStatusType(e){const t=e.toString();return t.startsWith("1")?"informational":t.startsWith("2")?"success":t.startsWith("3")?"redirection":t.startsWith("4")||t.startsWith("5")?"error":""}responseTemplate(){if(!this.responses)return"";for(const n in this.responses){this.selectedStatus||(this.selectedStatus=n);const a={};for(const r in null===(e=this.responses[n])||void 0===e?void 0:e.content){var e,t;const o=this.responses[n].content[r];this.selectedMimeType||(this.selectedMimeType=r);const i=Ft(o.schema,{}),s=Ut(o.schema,r,o.examples,o.example,"true"!==this.callback&&"true"!==this.webhook,"true"===this.callback||"true"===this.webhook,r.includes("json")?"json":"text");a[r]={description:this.responses[n].description,examples:s,selectedExample:(null===(t=s[0])||void 0===t?void 0:t.exampleId)||"",schemaTree:i}}const o=[];for(const e in null===(r=this.responses[n])||void 0===r?void 0:r.headers){var r;o.push({name:e,...this.responses[n].headers[e]})}this.headersForEachRespStatus[n]=o,this.mimeResponsesForEachStatus[n]=a}return B`
+ `}resetSelection(){this.selectedStatus="",this.selectedMimeType=""}getResponseStatusType(e){const t=e.toString();return t.startsWith("1")?"informational":t.startsWith("2")?"success":t.startsWith("3")?"redirection":t.startsWith("4")||t.startsWith("5")?"error":""}responseTemplate(){if(!this.responses)return"";for(const n in this.responses){this.selectedStatus||(this.selectedStatus=n);const a={};for(const r in null===(e=this.responses[n])||void 0===e?void 0:e.content){var e,t;const o=this.responses[n].content[r];this.selectedMimeType||(this.selectedMimeType=r);const i=Ut(o.schema,{}),s=qt(o.schema,r,o.examples,o.example,"true"!==this.callback&&"true"!==this.webhook,"true"===this.callback||"true"===this.webhook,r.includes("json")?"json":"text");a[r]={description:this.responses[n].description,examples:s,selectedExample:(null===(t=s[0])||void 0===t?void 0:t.exampleId)||"",schemaTree:i}}const o=[];for(const e in null===(r=this.responses[n])||void 0===r?void 0:r.headers){var r;o.push({name:e,...this.responses[n].headers[e]})}this.headersForEachRespStatus[n]=o,this.mimeResponsesForEachStatus[n]=a}return B`
${Object.keys(this.responses).length>=1?B`