2023-10-27 10:45:46 +02:00

20474 lines
1.1 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @preserve
* RapiDoc 9.3.5-beta - WebComponent to View OpenAPI docs
* License: MIT
* Repo : https://github.com/rapi-doc/RapiDoc
* Author : Mrinmoy Majumdar
*/
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 656:
/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => {
"use strict";
// UNUSED EXPORTS: JsonSchemaViewer, OAuthReceiver, RapiDocMini, default
;// CONCATENATED MODULE: ./node_modules/@lit/reactive-element/css-tag.js
/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const css_tag_t=window,e=css_tag_t.ShadowRoot&&(void 0===css_tag_t.ShadyCSS||css_tag_t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),n=new WeakMap;class o{constructor(t,e,n){if(this._$cssResult$=!0,n!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=n.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&n.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new o("string"==typeof t?t:t+"",void 0,s),i=(t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new o(n,t,s)},S=(s,n)=>{e?s.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((e=>{const n=document.createElement("style"),o=css_tag_t.litNonce;void 0!==o&&n.setAttribute("nonce",o),n.textContent=e.cssText,s.appendChild(n)}))},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;
//# sourceMappingURL=css-tag.js.map
;// CONCATENATED MODULE: ./node_modules/@lit/reactive-element/reactive-element.js
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/var reactive_element_s;const reactive_element_e=window,reactive_element_r=reactive_element_e.trustedTypes,h=reactive_element_r?reactive_element_r.emptyScript:"",reactive_element_o=reactive_element_e.reactiveElementPolyfillSupport,reactive_element_n={toAttribute(t,i){switch(i){case Boolean:t=t?h:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let s=t;switch(i){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},a=(t,i)=>i!==t&&(i==i||t==t),l={attribute:!0,type:String,converter:reactive_element_n,reflect:!1,hasChanged:a},d="finalized";class u extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var i;this.finalize(),(null!==(i=this.h)&&void 0!==i?i:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,s)=>{const e=this._$Ep(s,i);void 0!==e&&(this._$Ev.set(e,s),t.push(e))})),t}static createProperty(t,i=l){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,e=this.getPropertyDescriptor(t,s,i);void 0!==e&&Object.defineProperty(this.prototype,t,e)}}static getPropertyDescriptor(t,i,s){return{get(){return this[i]},set(e){const r=this[t];this[i]=e,this.requestUpdate(t,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||l}static finalize(){if(this.hasOwnProperty(d))return!1;this[d]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of i)this.createProperty(s,t[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(i){const s=[];if(Array.isArray(i)){const e=new Set(i.flat(1/0).reverse());for(const i of e)s.unshift(c(i))}else void 0!==i&&s.push(c(i));return s}static _$Ep(t,i){const s=i.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var i,s;(null!==(i=this._$ES)&&void 0!==i?i:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t))}removeController(t){var i;null===(i=this._$ES)||void 0===i||i.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Ei.set(i,this[i]),delete this[i])}))}createRenderRoot(){var t;const s=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return S(s,this.constructor.elementStyles),s}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}))}attributeChangedCallback(t,i,s){this._$AK(t,s)}_$EO(t,i,s=l){var e;const r=this.constructor._$Ep(t,s);if(void 0!==r&&!0===s.reflect){const h=(void 0!==(null===(e=s.converter)||void 0===e?void 0:e.toAttribute)?s.converter:reactive_element_n).toAttribute(i,s.type);this._$El=t,null==h?this.removeAttribute(r):this.setAttribute(r,h),this._$El=null}}_$AK(t,i){var s;const e=this.constructor,r=e._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=e.getPropertyOptions(r),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:reactive_element_n;this._$El=r,this[r]=h.fromAttribute(i,t.type),this._$El=null}}requestUpdate(t,i,s){let e=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||a)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):e=!1),!this.isUpdatePending&&e&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,i)=>this[i]=t)),this._$Ei=void 0);let i=!1;const s=this._$AL;try{i=this.shouldUpdate(s),i?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(s)):this._$Ek()}catch(t){throw i=!1,this._$Ek(),t}i&&this._$AE(s)}willUpdate(t){}_$AE(t){var i;null===(i=this._$ES)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,i)=>this._$EO(i,this[i],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}u[d]=!0,u.elementProperties=new Map,u.elementStyles=[],u.shadowRootOptions={mode:"open"},null==reactive_element_o||reactive_element_o({ReactiveElement:u}),(null!==(reactive_element_s=reactive_element_e.reactiveElementVersions)&&void 0!==reactive_element_s?reactive_element_s:reactive_element_e.reactiveElementVersions=[]).push("1.6.2");
//# sourceMappingURL=reactive-element.js.map
;// CONCATENATED MODULE: ./node_modules/lit-html/lit-html.js
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
var lit_html_t;const lit_html_i=window,lit_html_s=lit_html_i.trustedTypes,lit_html_e=lit_html_s?lit_html_s.createPolicy("lit-html",{createHTML:t=>t}):void 0,lit_html_o="$lit$",lit_html_n=`lit$${(Math.random()+"").slice(9)}$`,lit_html_l="?"+lit_html_n,lit_html_h=`<${lit_html_l}>`,lit_html_r=document,lit_html_d=()=>lit_html_r.createComment(""),lit_html_u=t=>null===t||"object"!=typeof t&&"function"!=typeof t,lit_html_c=Array.isArray,v=t=>lit_html_c(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),lit_html_a="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,m=/>/g,p=RegExp(`>|${lit_html_a}(?:([^\\s"'>=/]+)(${lit_html_a}*=${lit_html_a}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),g=/'/g,$=/"/g,y=/^(?:script|style|textarea|title)$/i,w=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),lit_html_x=w(1),b=w(2),T=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),E=new WeakMap,C=lit_html_r.createTreeWalker(lit_html_r,129,null,!1),P=(t,i)=>{const s=t.length-1,l=[];let r,d=2===i?"<svg>":"",u=f;for(let i=0;i<s;i++){const s=t[i];let e,c,v=-1,a=0;for(;a<s.length&&(u.lastIndex=a,c=u.exec(s),null!==c);)a=u.lastIndex,u===f?"!--"===c[1]?u=_:void 0!==c[1]?u=m:void 0!==c[2]?(y.test(c[2])&&(r=RegExp("</"+c[2],"g")),u=p):void 0!==c[3]&&(u=p):u===p?">"===c[0]?(u=null!=r?r:f,v=-1):void 0===c[1]?v=-2:(v=u.lastIndex-c[2].length,e=c[1],u=void 0===c[3]?p:'"'===c[3]?$:g):u===$||u===g?u=p:u===_||u===m?u=f:(u=p,r=void 0);const w=u===p&&t[i+1].startsWith("/>")?" ":"";d+=u===f?s+lit_html_h:v>=0?(l.push(e),s.slice(0,v)+lit_html_o+s.slice(v)+lit_html_n+w):s+lit_html_n+(-2===v?(l.push(void 0),i):w)}const c=d+(t[s]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==lit_html_e?lit_html_e.createHTML(c):c,l]};class V{constructor({strings:t,_$litType$:i},e){let h;this.parts=[];let r=0,u=0;const c=t.length-1,v=this.parts,[a,f]=P(t,i);if(this.el=V.createElement(a,e),C.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(h=C.nextNode())&&v.length<c;){if(1===h.nodeType){if(h.hasAttributes()){const t=[];for(const i of h.getAttributeNames())if(i.endsWith(lit_html_o)||i.startsWith(lit_html_n)){const s=f[u++];if(t.push(i),void 0!==s){const t=h.getAttribute(s.toLowerCase()+lit_html_o).split(lit_html_n),i=/([.?@])?(.*)/.exec(s);v.push({type:1,index:r,name:i[2],strings:t,ctor:"."===i[1]?k:"?"===i[1]?I:"@"===i[1]?L:R})}else v.push({type:6,index:r})}for(const i of t)h.removeAttribute(i)}if(y.test(h.tagName)){const t=h.textContent.split(lit_html_n),i=t.length-1;if(i>0){h.textContent=lit_html_s?lit_html_s.emptyScript:"";for(let s=0;s<i;s++)h.append(t[s],lit_html_d()),C.nextNode(),v.push({type:2,index:++r});h.append(t[i],lit_html_d())}}}else if(8===h.nodeType)if(h.data===lit_html_l)v.push({type:2,index:r});else{let t=-1;for(;-1!==(t=h.data.indexOf(lit_html_n,t+1));)v.push({type:7,index:r}),t+=lit_html_n.length-1}r++}}static createElement(t,i){const s=lit_html_r.createElement("template");return s.innerHTML=t,s}}function N(t,i,s=t,e){var o,n,l,h;if(i===T)return i;let r=void 0!==e?null===(o=s._$Co)||void 0===o?void 0:o[e]:s._$Cl;const d=lit_html_u(i)?void 0:i._$litDirective$;return(null==r?void 0:r.constructor)!==d&&(null===(n=null==r?void 0:r._$AO)||void 0===n||n.call(r,!1),void 0===d?r=void 0:(r=new d(t),r._$AT(t,s,e)),void 0!==e?(null!==(l=(h=s)._$Co)&&void 0!==l?l:h._$Co=[])[e]=r:s._$Cl=r),void 0!==r&&(i=N(t,r._$AS(t,i.values),r,e)),i}class lit_html_S{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:lit_html_r).importNode(s,!0);C.currentNode=o;let n=C.nextNode(),l=0,h=0,d=e[0];for(;void 0!==d;){if(l===d.index){let i;2===d.type?i=new M(n,n.nextSibling,this,t):1===d.type?i=new d.ctor(n,d.name,d.strings,this,t):6===d.type&&(i=new z(n,this,t)),this._$AV.push(i),d=e[++h]}l!==(null==d?void 0:d.index)&&(n=C.nextNode(),l++)}return C.currentNode=lit_html_r,o}v(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class M{constructor(t,i,s,e){var o;this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cp=null===(o=null==e?void 0:e.isConnected)||void 0===o||o}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=N(this,t,i),lit_html_u(t)?t===A||null==t||""===t?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):v(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==A&&lit_html_u(this._$AH)?this._$AA.nextSibling.data=t:this.$(lit_html_r.createTextNode(t)),this._$AH=t}g(t){var i;const{values:s,_$litType$:e}=t,o="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=V.createElement(e.h,this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.v(s);else{const t=new lit_html_S(o,this),i=t.u(this.options);t.v(s),this.$(i),this._$AH=t}}_$AC(t){let i=E.get(t.strings);return void 0===i&&E.set(t.strings,i=new V(t)),i}T(t){lit_html_c(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new M(this.k(lit_html_d()),this.k(lit_html_d()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class R{constructor(t,i,s,e,o){this.type=1,this._$AH=A,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=A}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=N(this,t,i,0),n=!lit_html_u(t)||t!==this._$AH&&t!==T,n&&(this._$AH=t);else{const e=t;let l,h;for(t=o[0],l=0;l<o.length-1;l++)h=N(this,e[s+l],i,l),h===T&&(h=this._$AH[l]),n||(n=!lit_html_u(h)||h!==this._$AH[l]),h===A?t=A:t!==A&&(t+=(null!=h?h:"")+o[l+1]),this._$AH[l]=h}n&&!e&&this.j(t)}j(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class k extends R{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===A?void 0:t}}const H=lit_html_s?lit_html_s.emptyScript:"";class I extends R{constructor(){super(...arguments),this.type=4}j(t){t&&t!==A?this.element.setAttribute(this.name,H):this.element.removeAttribute(this.name)}}class L extends R{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5}_$AI(t,i=this){var s;if((t=null!==(s=N(this,t,i,0))&&void 0!==s?s:A)===T)return;const e=this._$AH,o=t===A&&e!==A||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==A&&(e===A||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){N(this,t)}}const Z={O:lit_html_o,P:lit_html_n,A:lit_html_l,C:1,M:P,L:lit_html_S,D:v,R:N,I:M,V:R,H:I,N:L,U:k,F:z},j=lit_html_i.litHtmlPolyfillSupport;null==j||j(V,M),(null!==(lit_html_t=lit_html_i.litHtmlVersions)&&void 0!==lit_html_t?lit_html_t:lit_html_i.litHtmlVersions=[]).push("2.7.4");const B=(t,i,s)=>{var e,o;const n=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let l=n._$litPart$;if(void 0===l){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;n._$litPart$=l=new M(i.insertBefore(lit_html_d(),t),t,void 0,null!=s?s:{})}return l._$AI(t),l};
//# sourceMappingURL=lit-html.js.map
;// CONCATENATED MODULE: ./node_modules/lit-element/lit-element.js
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/var lit_element_l,lit_element_o;const lit_element_r=(/* unused pure expression or super */ null && (t));class lit_element_s extends u{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return T}}lit_element_s.finalized=!0,lit_element_s._$litElement$=!0,null===(lit_element_l=globalThis.litElementHydrateSupport)||void 0===lit_element_l||lit_element_l.call(globalThis,{LitElement:lit_element_s});const lit_element_n=globalThis.litElementPolyfillSupport;null==lit_element_n||lit_element_n({LitElement:lit_element_s});const lit_element_h={_$AK:(t,e,i)=>{t._$AK(e,i)},_$AL:t=>t._$AL};(null!==(lit_element_o=globalThis.litElementVersions)&&void 0!==lit_element_o?lit_element_o:globalThis.litElementVersions=[]).push("3.3.2");
//# sourceMappingURL=lit-element.js.map
;// CONCATENATED MODULE: ./node_modules/lit/index.js
//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ./node_modules/marked/lib/marked.esm.js
/**
* marked v5.1.0 - a markdown parser
* Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)
* https://github.com/markedjs/marked
*/
/**
* DO NOT EDIT THIS FILE
* The code in this file is generated from files in ./src/
*/
function getDefaults() {
return {
async: false,
baseUrl: null,
breaks: false,
extensions: null,
gfm: true,
headerIds: true,
headerPrefix: '',
highlight: null,
hooks: null,
langPrefix: 'language-',
mangle: true,
pedantic: false,
renderer: null,
sanitize: false,
sanitizer: null,
silent: false,
smartypants: false,
tokenizer: null,
walkTokens: null,
xhtml: false
};
}
let defaults = getDefaults();
function changeDefaults(newDefaults) {
defaults = newDefaults;
}
/**
* Helpers
*/
const escapeTest = /[&<>"']/;
const escapeReplace = new RegExp(escapeTest.source, 'g');
const escapeTestNoEncode = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/;
const escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');
const escapeReplacements = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#39;'
};
const getEscapeReplacement = (ch) => escapeReplacements[ch];
function marked_esm_escape(html, encode) {
if (encode) {
if (escapeTest.test(html)) {
return html.replace(escapeReplace, getEscapeReplacement);
}
} else {
if (escapeTestNoEncode.test(html)) {
return html.replace(escapeReplaceNoEncode, getEscapeReplacement);
}
}
return html;
}
const unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
/**
* @param {string} html
*/
function marked_esm_unescape(html) {
// explicitly match decimal, hex, and named HTML entities
return html.replace(unescapeTest, (_, n) => {
n = n.toLowerCase();
if (n === 'colon') return ':';
if (n.charAt(0) === '#') {
return n.charAt(1) === 'x'
? String.fromCharCode(parseInt(n.substring(2), 16))
: String.fromCharCode(+n.substring(1));
}
return '';
});
}
const caret = /(^|[^\[])\^/g;
/**
* @param {string | RegExp} regex
* @param {string} opt
*/
function edit(regex, opt) {
regex = typeof regex === 'string' ? regex : regex.source;
opt = opt || '';
const obj = {
replace: (name, val) => {
val = val.source || val;
val = val.replace(caret, '$1');
regex = regex.replace(name, val);
return obj;
},
getRegex: () => {
return new RegExp(regex, opt);
}
};
return obj;
}
const nonWordAndColonTest = /[^\w:]/g;
const originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
/**
* @param {boolean} sanitize
* @param {string} base
* @param {string} href
*/
function cleanUrl(sanitize, base, href) {
if (sanitize) {
let prot;
try {
prot = decodeURIComponent(marked_esm_unescape(href))
.replace(nonWordAndColonTest, '')
.toLowerCase();
} catch (e) {
return null;
}
if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {
return null;
}
}
if (base && !originIndependentUrl.test(href)) {
href = resolveUrl(base, href);
}
try {
href = encodeURI(href).replace(/%25/g, '%');
} catch (e) {
return null;
}
return href;
}
const baseUrls = {};
const justDomain = /^[^:]+:\/*[^/]*$/;
const protocol = /^([^:]+:)[\s\S]*$/;
const domain = /^([^:]+:\/*[^/]*)[\s\S]*$/;
/**
* @param {string} base
* @param {string} href
*/
function resolveUrl(base, href) {
if (!baseUrls[' ' + base]) {
// we can ignore everything in base after the last slash of its path component,
// but we might need to add _that_
// https://tools.ietf.org/html/rfc3986#section-3
if (justDomain.test(base)) {
baseUrls[' ' + base] = base + '/';
} else {
baseUrls[' ' + base] = rtrim(base, '/', true);
}
}
base = baseUrls[' ' + base];
const relativeBase = base.indexOf(':') === -1;
if (href.substring(0, 2) === '//') {
if (relativeBase) {
return href;
}
return base.replace(protocol, '$1') + href;
} else if (href.charAt(0) === '/') {
if (relativeBase) {
return href;
}
return base.replace(domain, '$1') + href;
} else {
return base + href;
}
}
const noopTest = { exec: function noopTest() {} };
function splitCells(tableRow, count) {
// ensure that every cell-delimiting pipe has a space
// before it to distinguish it from an escaped pipe
const row = tableRow.replace(/\|/g, (match, offset, str) => {
let escaped = false,
curr = offset;
while (--curr >= 0 && str[curr] === '\\') escaped = !escaped;
if (escaped) {
// odd number of slashes means | is escaped
// so we leave it alone
return '|';
} else {
// add space before unescaped |
return ' |';
}
}),
cells = row.split(/ \|/);
let i = 0;
// First/last cell in a row cannot be empty if it has no leading/trailing pipe
if (!cells[0].trim()) { cells.shift(); }
if (cells.length > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }
if (cells.length > count) {
cells.splice(count);
} else {
while (cells.length < count) cells.push('');
}
for (; i < cells.length; i++) {
// leading or trailing whitespace is ignored per the gfm spec
cells[i] = cells[i].trim().replace(/\\\|/g, '|');
}
return cells;
}
/**
* Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').
* /c*$/ is vulnerable to REDOS.
*
* @param {string} str
* @param {string} c
* @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.
*/
function rtrim(str, c, invert) {
const l = str.length;
if (l === 0) {
return '';
}
// Length of suffix matching the invert condition.
let suffLen = 0;
// Step left until we fail to match the invert condition.
while (suffLen < l) {
const currChar = str.charAt(l - suffLen - 1);
if (currChar === c && !invert) {
suffLen++;
} else if (currChar !== c && invert) {
suffLen++;
} else {
break;
}
}
return str.slice(0, l - suffLen);
}
function findClosingBracket(str, b) {
if (str.indexOf(b[1]) === -1) {
return -1;
}
const l = str.length;
let level = 0,
i = 0;
for (; i < l; i++) {
if (str[i] === '\\') {
i++;
} else if (str[i] === b[0]) {
level++;
} else if (str[i] === b[1]) {
level--;
if (level < 0) {
return i;
}
}
}
return -1;
}
function checkDeprecations(opt, callback) {
if (!opt || opt.silent) {
return;
}
if (callback) {
console.warn('marked(): callback is deprecated since version 5.0.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/using_pro#async');
}
if (opt.sanitize || opt.sanitizer) {
console.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');
}
if (opt.highlight || opt.langPrefix !== 'language-') {
console.warn('marked(): highlight and langPrefix parameters are deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-highlight.');
}
if (opt.mangle) {
console.warn('marked(): mangle parameter is enabled by default, but is deprecated since version 5.0.0, and will be removed in the future. To clear this warning, install https://www.npmjs.com/package/marked-mangle, or disable by setting `{mangle: false}`.');
}
if (opt.baseUrl) {
console.warn('marked(): baseUrl parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-base-url.');
}
if (opt.smartypants) {
console.warn('marked(): smartypants parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-smartypants.');
}
if (opt.xhtml) {
console.warn('marked(): xhtml parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-xhtml.');
}
if (opt.headerIds || opt.headerPrefix) {
console.warn('marked(): headerIds and headerPrefix parameters enabled by default, but are deprecated since version 5.0.0, and will be removed in the future. To clear this warning, install https://www.npmjs.com/package/marked-gfm-heading-id, or disable by setting `{headerIds: false}`.');
}
}
function outputLink(cap, link, raw, lexer) {
const href = link.href;
const title = link.title ? marked_esm_escape(link.title) : null;
const text = cap[1].replace(/\\([\[\]])/g, '$1');
if (cap[0].charAt(0) !== '!') {
lexer.state.inLink = true;
const token = {
type: 'link',
raw,
href,
title,
text,
tokens: lexer.inlineTokens(text)
};
lexer.state.inLink = false;
return token;
}
return {
type: 'image',
raw,
href,
title,
text: marked_esm_escape(text)
};
}
function indentCodeCompensation(raw, text) {
const matchIndentToCode = raw.match(/^(\s+)(?:```)/);
if (matchIndentToCode === null) {
return text;
}
const indentToCode = matchIndentToCode[1];
return text
.split('\n')
.map(node => {
const matchIndentInNode = node.match(/^\s+/);
if (matchIndentInNode === null) {
return node;
}
const [indentInNode] = matchIndentInNode;
if (indentInNode.length >= indentToCode.length) {
return node.slice(indentToCode.length);
}
return node;
})
.join('\n');
}
/**
* Tokenizer
*/
class Tokenizer {
constructor(options) {
this.options = options || defaults;
}
space(src) {
const cap = this.rules.block.newline.exec(src);
if (cap && cap[0].length > 0) {
return {
type: 'space',
raw: cap[0]
};
}
}
code(src) {
const cap = this.rules.block.code.exec(src);
if (cap) {
const text = cap[0].replace(/^ {1,4}/gm, '');
return {
type: 'code',
raw: cap[0],
codeBlockStyle: 'indented',
text: !this.options.pedantic
? rtrim(text, '\n')
: text
};
}
}
fences(src) {
const cap = this.rules.block.fences.exec(src);
if (cap) {
const raw = cap[0];
const text = indentCodeCompensation(raw, cap[3] || '');
return {
type: 'code',
raw,
lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, '$1') : cap[2],
text
};
}
}
heading(src) {
const cap = this.rules.block.heading.exec(src);
if (cap) {
let text = cap[2].trim();
// remove trailing #s
if (/#$/.test(text)) {
const trimmed = rtrim(text, '#');
if (this.options.pedantic) {
text = trimmed.trim();
} else if (!trimmed || / $/.test(trimmed)) {
// CommonMark requires space before trailing #s
text = trimmed.trim();
}
}
return {
type: 'heading',
raw: cap[0],
depth: cap[1].length,
text,
tokens: this.lexer.inline(text)
};
}
}
hr(src) {
const cap = this.rules.block.hr.exec(src);
if (cap) {
return {
type: 'hr',
raw: cap[0]
};
}
}
blockquote(src) {
const cap = this.rules.block.blockquote.exec(src);
if (cap) {
const text = cap[0].replace(/^ *>[ \t]?/gm, '');
const top = this.lexer.state.top;
this.lexer.state.top = true;
const tokens = this.lexer.blockTokens(text);
this.lexer.state.top = top;
return {
type: 'blockquote',
raw: cap[0],
tokens,
text
};
}
}
list(src) {
let cap = this.rules.block.list.exec(src);
if (cap) {
let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine,
line, nextLine, rawLine, itemContents, endEarly;
let bull = cap[1].trim();
const isordered = bull.length > 1;
const list = {
type: 'list',
raw: '',
ordered: isordered,
start: isordered ? +bull.slice(0, -1) : '',
loose: false,
items: []
};
bull = isordered ? `\\d{1,9}\\${bull.slice(-1)}` : `\\${bull}`;
if (this.options.pedantic) {
bull = isordered ? bull : '[*+-]';
}
// Get next list item
const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\t ][^\\n]*)?(?:\\n|$))`);
// Check if current bullet point can start a new List Item
while (src) {
endEarly = false;
if (!(cap = itemRegex.exec(src))) {
break;
}
if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)
break;
}
raw = cap[0];
src = src.substring(raw.length);
line = cap[2].split('\n', 1)[0].replace(/^\t+/, (t) => ' '.repeat(3 * t.length));
nextLine = src.split('\n', 1)[0];
if (this.options.pedantic) {
indent = 2;
itemContents = line.trimLeft();
} else {
indent = cap[2].search(/[^ ]/); // Find first non-space char
indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent
itemContents = line.slice(indent);
indent += cap[1].length;
}
blankLine = false;
if (!line && /^ *$/.test(nextLine)) { // Items begin with at most one blank line
raw += nextLine + '\n';
src = src.substring(nextLine.length + 1);
endEarly = true;
}
if (!endEarly) {
const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`);
const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);
const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`);
const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);
// Check if following lines should be included in List Item
while (src) {
rawLine = src.split('\n', 1)[0];
nextLine = rawLine;
// Re-align to follow commonmark nesting rules
if (this.options.pedantic) {
nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');
}
// End list item if found code fences
if (fencesBeginRegex.test(nextLine)) {
break;
}
// End list item if found start of new heading
if (headingBeginRegex.test(nextLine)) {
break;
}
// End list item if found start of new bullet
if (nextBulletRegex.test(nextLine)) {
break;
}
// Horizontal rule found
if (hrRegex.test(src)) {
break;
}
if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible
itemContents += '\n' + nextLine.slice(indent);
} else {
// not enough indentation
if (blankLine) {
break;
}
// paragraph continuation unless last line was a different block level element
if (line.search(/[^ ]/) >= 4) { // indented code block
break;
}
if (fencesBeginRegex.test(line)) {
break;
}
if (headingBeginRegex.test(line)) {
break;
}
if (hrRegex.test(line)) {
break;
}
itemContents += '\n' + nextLine;
}
if (!blankLine && !nextLine.trim()) { // Check if current line is blank
blankLine = true;
}
raw += rawLine + '\n';
src = src.substring(rawLine.length + 1);
line = nextLine.slice(indent);
}
}
if (!list.loose) {
// If the previous item ended with a blank line, the list is loose
if (endsWithBlankLine) {
list.loose = true;
} else if (/\n *\n *$/.test(raw)) {
endsWithBlankLine = true;
}
}
// Check for task list items
if (this.options.gfm) {
istask = /^\[[ xX]\] /.exec(itemContents);
if (istask) {
ischecked = istask[0] !== '[ ] ';
itemContents = itemContents.replace(/^\[[ xX]\] +/, '');
}
}
list.items.push({
type: 'list_item',
raw,
task: !!istask,
checked: ischecked,
loose: false,
text: itemContents
});
list.raw += raw;
}
// Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic
list.items[list.items.length - 1].raw = raw.trimRight();
list.items[list.items.length - 1].text = itemContents.trimRight();
list.raw = list.raw.trimRight();
const l = list.items.length;
// Item child tokens handled here at end because we needed to have the final item to trim it first
for (i = 0; i < l; i++) {
this.lexer.state.top = false;
list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);
if (!list.loose) {
// Check if list should be loose
const spacers = list.items[i].tokens.filter(t => t.type === 'space');
const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\n.*\n/.test(t.raw));
list.loose = hasMultipleLineBreaks;
}
}
// Set all items to loose if list is loose
if (list.loose) {
for (i = 0; i < l; i++) {
list.items[i].loose = true;
}
}
return list;
}
}
html(src) {
const cap = this.rules.block.html.exec(src);
if (cap) {
const token = {
type: 'html',
block: true,
raw: cap[0],
pre: !this.options.sanitizer
&& (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),
text: cap[0]
};
if (this.options.sanitize) {
const text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : marked_esm_escape(cap[0]);
token.type = 'paragraph';
token.text = text;
token.tokens = this.lexer.inline(text);
}
return token;
}
}
def(src) {
const cap = this.rules.block.def.exec(src);
if (cap) {
const tag = cap[1].toLowerCase().replace(/\s+/g, ' ');
const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';
const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];
return {
type: 'def',
tag,
raw: cap[0],
href,
title
};
}
}
table(src) {
const cap = this.rules.block.table.exec(src);
if (cap) {
const item = {
type: 'table',
header: splitCells(cap[1]).map(c => { return { text: c }; }),
align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
rows: cap[3] && cap[3].trim() ? cap[3].replace(/\n[ \t]*$/, '').split('\n') : []
};
if (item.header.length === item.align.length) {
item.raw = cap[0];
let l = item.align.length;
let i, j, k, row;
for (i = 0; i < l; i++) {
if (/^ *-+: *$/.test(item.align[i])) {
item.align[i] = 'right';
} else if (/^ *:-+: *$/.test(item.align[i])) {
item.align[i] = 'center';
} else if (/^ *:-+ *$/.test(item.align[i])) {
item.align[i] = 'left';
} else {
item.align[i] = null;
}
}
l = item.rows.length;
for (i = 0; i < l; i++) {
item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });
}
// parse child tokens inside headers and cells
// header child tokens
l = item.header.length;
for (j = 0; j < l; j++) {
item.header[j].tokens = this.lexer.inline(item.header[j].text);
}
// cell child tokens
l = item.rows.length;
for (j = 0; j < l; j++) {
row = item.rows[j];
for (k = 0; k < row.length; k++) {
row[k].tokens = this.lexer.inline(row[k].text);
}
}
return item;
}
}
}
lheading(src) {
const cap = this.rules.block.lheading.exec(src);
if (cap) {
return {
type: 'heading',
raw: cap[0],
depth: cap[2].charAt(0) === '=' ? 1 : 2,
text: cap[1],
tokens: this.lexer.inline(cap[1])
};
}
}
paragraph(src) {
const cap = this.rules.block.paragraph.exec(src);
if (cap) {
const text = cap[1].charAt(cap[1].length - 1) === '\n'
? cap[1].slice(0, -1)
: cap[1];
return {
type: 'paragraph',
raw: cap[0],
text,
tokens: this.lexer.inline(text)
};
}
}
text(src) {
const cap = this.rules.block.text.exec(src);
if (cap) {
return {
type: 'text',
raw: cap[0],
text: cap[0],
tokens: this.lexer.inline(cap[0])
};
}
}
escape(src) {
const cap = this.rules.inline.escape.exec(src);
if (cap) {
return {
type: 'escape',
raw: cap[0],
text: marked_esm_escape(cap[1])
};
}
}
tag(src) {
const cap = this.rules.inline.tag.exec(src);
if (cap) {
if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {
this.lexer.state.inLink = true;
} else if (this.lexer.state.inLink && /^<\/a>/i.test(cap[0])) {
this.lexer.state.inLink = false;
}
if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
this.lexer.state.inRawBlock = true;
} else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
this.lexer.state.inRawBlock = false;
}
return {
type: this.options.sanitize
? 'text'
: 'html',
raw: cap[0],
inLink: this.lexer.state.inLink,
inRawBlock: this.lexer.state.inRawBlock,
block: false,
text: this.options.sanitize
? (this.options.sanitizer
? this.options.sanitizer(cap[0])
: marked_esm_escape(cap[0]))
: cap[0]
};
}
}
link(src) {
const cap = this.rules.inline.link.exec(src);
if (cap) {
const trimmedUrl = cap[2].trim();
if (!this.options.pedantic && /^</.test(trimmedUrl)) {
// commonmark requires matching angle brackets
if (!(/>$/.test(trimmedUrl))) {
return;
}
// ending angle bracket cannot be escaped
const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\');
if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
return;
}
} else {
// find closing parenthesis
const lastParenIndex = findClosingBracket(cap[2], '()');
if (lastParenIndex > -1) {
const start = cap[0].indexOf('!') === 0 ? 5 : 4;
const linkLen = start + cap[1].length + lastParenIndex;
cap[2] = cap[2].substring(0, lastParenIndex);
cap[0] = cap[0].substring(0, linkLen).trim();
cap[3] = '';
}
}
let href = cap[2];
let title = '';
if (this.options.pedantic) {
// split pedantic href and title
const link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href);
if (link) {
href = link[1];
title = link[3];
}
} else {
title = cap[3] ? cap[3].slice(1, -1) : '';
}
href = href.trim();
if (/^</.test(href)) {
if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {
// pedantic allows starting angle bracket without ending angle bracket
href = href.slice(1);
} else {
href = href.slice(1, -1);
}
}
return outputLink(cap, {
href: href ? href.replace(this.rules.inline._escapes, '$1') : href,
title: title ? title.replace(this.rules.inline._escapes, '$1') : title
}, cap[0], this.lexer);
}
}
reflink(src, links) {
let cap;
if ((cap = this.rules.inline.reflink.exec(src))
|| (cap = this.rules.inline.nolink.exec(src))) {
let link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
link = links[link.toLowerCase()];
if (!link) {
const text = cap[0].charAt(0);
return {
type: 'text',
raw: text,
text
};
}
return outputLink(cap, link, cap[0], this.lexer);
}
}
emStrong(src, maskedSrc, prevChar = '') {
let match = this.rules.inline.emStrong.lDelim.exec(src);
if (!match) return;
// _ can't be between two alphanumerics. \p{L}\p{N} includes non-english alphabet/numbers as well
if (match[3] && prevChar.match(/[\p{L}\p{N}]/u)) return;
const nextChar = match[1] || match[2] || '';
if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {
const lLength = match[0].length - 1;
let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;
const endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;
endReg.lastIndex = 0;
// Clip maskedSrc to same section of string as src (move to lexer?)
maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
while ((match = endReg.exec(maskedSrc)) != null) {
rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
if (!rDelim) continue; // skip single * in __abc*abc__
rLength = rDelim.length;
if (match[3] || match[4]) { // found another Left Delim
delimTotal += rLength;
continue;
} else if (match[5] || match[6]) { // either Left or Right Delim
if (lLength % 3 && !((lLength + rLength) % 3)) {
midDelimTotal += rLength;
continue; // CommonMark Emphasis Rules 9-10
}
}
delimTotal -= rLength;
if (delimTotal > 0) continue; // Haven't found enough closing delimiters
// Remove extra characters. *a*** -> *a*
rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
const raw = src.slice(0, lLength + match.index + rLength + 1);
// Create `em` if smallest delimiter has odd char count. *a***
if (Math.min(lLength, rLength) % 2) {
const text = raw.slice(1, -1);
return {
type: 'em',
raw,
text,
tokens: this.lexer.inlineTokens(text)
};
}
// Create 'strong' if smallest delimiter has even char count. **a***
const text = raw.slice(2, -2);
return {
type: 'strong',
raw,
text,
tokens: this.lexer.inlineTokens(text)
};
}
}
}
codespan(src) {
const cap = this.rules.inline.code.exec(src);
if (cap) {
let text = cap[2].replace(/\n/g, ' ');
const hasNonSpaceChars = /[^ ]/.test(text);
const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);
if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
text = text.substring(1, text.length - 1);
}
text = marked_esm_escape(text, true);
return {
type: 'codespan',
raw: cap[0],
text
};
}
}
br(src) {
const cap = this.rules.inline.br.exec(src);
if (cap) {
return {
type: 'br',
raw: cap[0]
};
}
}
del(src) {
const cap = this.rules.inline.del.exec(src);
if (cap) {
return {
type: 'del',
raw: cap[0],
text: cap[2],
tokens: this.lexer.inlineTokens(cap[2])
};
}
}
autolink(src, mangle) {
const cap = this.rules.inline.autolink.exec(src);
if (cap) {
let text, href;
if (cap[2] === '@') {
text = marked_esm_escape(this.options.mangle ? mangle(cap[1]) : cap[1]);
href = 'mailto:' + text;
} else {
text = marked_esm_escape(cap[1]);
href = text;
}
return {
type: 'link',
raw: cap[0],
text,
href,
tokens: [
{
type: 'text',
raw: text,
text
}
]
};
}
}
url(src, mangle) {
let cap;
if (cap = this.rules.inline.url.exec(src)) {
let text, href;
if (cap[2] === '@') {
text = marked_esm_escape(this.options.mangle ? mangle(cap[0]) : cap[0]);
href = 'mailto:' + text;
} else {
// do extended autolink path validation
let prevCapZero;
do {
prevCapZero = cap[0];
cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];
} while (prevCapZero !== cap[0]);
text = marked_esm_escape(cap[0]);
if (cap[1] === 'www.') {
href = 'http://' + cap[0];
} else {
href = cap[0];
}
}
return {
type: 'link',
raw: cap[0],
text,
href,
tokens: [
{
type: 'text',
raw: text,
text
}
]
};
}
}
inlineText(src, smartypants) {
const cap = this.rules.inline.text.exec(src);
if (cap) {
let text;
if (this.lexer.state.inRawBlock) {
text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : marked_esm_escape(cap[0])) : cap[0];
} else {
text = marked_esm_escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]);
}
return {
type: 'text',
raw: cap[0],
text
};
}
}
}
/**
* Block-Level Grammar
*/
const block = {
newline: /^(?: *(?:\n|$))+/,
code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
fences: /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
hr: /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,
heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
list: /^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,
html: '^ {0,3}(?:' // optional indentation
+ '<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)' // (1)
+ '|comment[^\\n]*(\\n+|$)' // (2)
+ '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3)
+ '|<![A-Z][\\s\\S]*?(?:>\\n*|$)' // (4)
+ '|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)' // (5)
+ '|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (6)
+ '|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) open tag
+ '|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) closing tag
+ ')',
def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,
table: noopTest,
lheading: /^((?:(?!^bull ).|\n(?!\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
// regex template, placeholders will be replaced according to different paragraph
// interruption rules of commonmark and the original markdown spec:
_paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
text: /^[^\n]+/
};
block._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
block.def = edit(block.def)
.replace('label', block._label)
.replace('title', block._title)
.getRegex();
block.bullet = /(?:[*+-]|\d{1,9}[.)])/;
block.listItemStart = edit(/^( *)(bull) */)
.replace('bull', block.bullet)
.getRegex();
block.list = edit(block.list)
.replace(/bull/g, block.bullet)
.replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))')
.replace('def', '\\n+(?=' + block.def.source + ')')
.getRegex();
block._tag = 'address|article|aside|base|basefont|blockquote|body|caption'
+ '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'
+ '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'
+ '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'
+ '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'
+ '|track|ul';
block._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
block.html = edit(block.html, 'i')
.replace('comment', block._comment)
.replace('tag', block._tag)
.replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/)
.getRegex();
block.lheading = edit(block.lheading)
.replace(/bull/g, block.bullet) // lists can interrupt
.getRegex();
block.paragraph = edit(block._paragraph)
.replace('hr', block.hr)
.replace('heading', ' {0,3}#{1,6} ')
.replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
.replace('|table', '')
.replace('blockquote', ' {0,3}>')
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
.replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
.replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)')
.replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
.getRegex();
block.blockquote = edit(block.blockquote)
.replace('paragraph', block.paragraph)
.getRegex();
/**
* Normal Block Grammar
*/
block.normal = { ...block };
/**
* GFM Block Grammar
*/
block.gfm = {
...block.normal,
table: '^ *([^\\n ].*\\|.*)\\n' // Header
+ ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?' // Align
+ '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
};
block.gfm.table = edit(block.gfm.table)
.replace('hr', block.hr)
.replace('heading', ' {0,3}#{1,6} ')
.replace('blockquote', ' {0,3}>')
.replace('code', ' {4}[^\\n]')
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
.replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
.replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)')
.replace('tag', block._tag) // tables can be interrupted by type (6) html blocks
.getRegex();
block.gfm.paragraph = edit(block._paragraph)
.replace('hr', block.hr)
.replace('heading', ' {0,3}#{1,6} ')
.replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
.replace('table', block.gfm.table) // interrupt paragraphs with table
.replace('blockquote', ' {0,3}>')
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
.replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
.replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)')
.replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
.getRegex();
/**
* Pedantic grammar (original John Gruber's loose markdown specification)
*/
block.pedantic = {
...block.normal,
html: edit(
'^ *(?:comment *(?:\\n|\\s*$)'
+ '|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)' // closed tag
+ '|<tag(?:"[^"]*"|\'[^\']*\'|\\s[^\'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))')
.replace('comment', block._comment)
.replace(/tag/g, '(?!(?:'
+ 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'
+ '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'
+ '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b')
.getRegex(),
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
heading: /^(#{1,6})(.*)(?:\n+|$)/,
fences: noopTest, // fences not supported
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
paragraph: edit(block.normal._paragraph)
.replace('hr', block.hr)
.replace('heading', ' *#{1,6} *[^\n]')
.replace('lheading', block.lheading)
.replace('blockquote', ' {0,3}>')
.replace('|fences', '')
.replace('|list', '')
.replace('|html', '')
.getRegex()
};
/**
* Inline-Level Grammar
*/
const inline = {
escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
url: noopTest,
tag: '^comment'
+ '|^</[a-zA-Z][\\w:-]*\\s*>' // self-closing tag
+ '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag
+ '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. <?php ?>
+ '|^<![a-zA-Z]+\\s[\\s\\S]*?>' // declaration, e.g. <!DOCTYPE html>
+ '|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>', // CDATA section
link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
reflink: /^!?\[(label)\]\[(ref)\]/,
nolink: /^!?\[(ref)\](?:\[\])?/,
reflinkSearch: 'reflink|nolink(?!\\()',
emStrong: {
lDelim: /^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,
// (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.
// | Skip orphan inside strong | Consume to delim | (1) #*** | (2) a***#, a*** | (3) #***a, ***a | (4) ***# | (5) #***# | (6) a***a
rDelimAst: /^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,
rDelimUnd: /^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/ // ^- Not allowed for _
},
code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
br: /^( {2,}|\\)\n(?!\s*$)/,
del: noopTest,
text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
punctuation: /^((?![*_])[\spunctuation])/
};
// list of unicode punctuation marks, plus any missing characters from CommonMark spec
inline._punctuation = '\\p{P}$+<=>`^|~';
inline.punctuation = edit(inline.punctuation, 'u').replace(/punctuation/g, inline._punctuation).getRegex();
// sequences em should skip over [title](link), `code`, <html>
inline.blockSkip = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;
inline.anyPunctuation = /\\[punct]/g;
inline._escapes = /\\([punct])/g;
inline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();
inline.emStrong.lDelim = edit(inline.emStrong.lDelim, 'u')
.replace(/punct/g, inline._punctuation)
.getRegex();
inline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'gu')
.replace(/punct/g, inline._punctuation)
.getRegex();
inline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'gu')
.replace(/punct/g, inline._punctuation)
.getRegex();
inline.anyPunctuation = edit(inline.anyPunctuation, 'gu')
.replace(/punct/g, inline._punctuation)
.getRegex();
inline._escapes = edit(inline._escapes, 'gu')
.replace(/punct/g, inline._punctuation)
.getRegex();
inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;
inline.autolink = edit(inline.autolink)
.replace('scheme', inline._scheme)
.replace('email', inline._email)
.getRegex();
inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
inline.tag = edit(inline.tag)
.replace('comment', inline._comment)
.replace('attribute', inline._attribute)
.getRegex();
inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
inline._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
inline.link = edit(inline.link)
.replace('label', inline._label)
.replace('href', inline._href)
.replace('title', inline._title)
.getRegex();
inline.reflink = edit(inline.reflink)
.replace('label', inline._label)
.replace('ref', block._label)
.getRegex();
inline.nolink = edit(inline.nolink)
.replace('ref', block._label)
.getRegex();
inline.reflinkSearch = edit(inline.reflinkSearch, 'g')
.replace('reflink', inline.reflink)
.replace('nolink', inline.nolink)
.getRegex();
/**
* Normal Inline Grammar
*/
inline.normal = { ...inline };
/**
* Pedantic Inline Grammar
*/
inline.pedantic = {
...inline.normal,
strong: {
start: /^__|\*\*/,
middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
endAst: /\*\*(?!\*)/g,
endUnd: /__(?!_)/g
},
em: {
start: /^_|\*/,
middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,
endAst: /\*(?!\*)/g,
endUnd: /_(?!_)/g
},
link: edit(/^!?\[(label)\]\((.*?)\)/)
.replace('label', inline._label)
.getRegex(),
reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/)
.replace('label', inline._label)
.getRegex()
};
/**
* GFM Inline Grammar
*/
inline.gfm = {
...inline.normal,
escape: edit(inline.escape).replace('])', '~|])').getRegex(),
_extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
};
inline.gfm.url = edit(inline.gfm.url, 'i')
.replace('email', inline.gfm._extended_email)
.getRegex();
/**
* GFM + Line Breaks Inline Grammar
*/
inline.breaks = {
...inline.gfm,
br: edit(inline.br).replace('{2,}', '*').getRegex(),
text: edit(inline.gfm.text)
.replace('\\b_', '\\b_| {2,}\\n')
.replace(/\{2,\}/g, '*')
.getRegex()
};
/**
* smartypants text replacement
* @param {string} text
*/
function smartypants(text) {
return text
// em-dashes
.replace(/---/g, '\u2014')
// en-dashes
.replace(/--/g, '\u2013')
// opening singles
.replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018')
// closing singles & apostrophes
.replace(/'/g, '\u2019')
// opening doubles
.replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c')
// closing doubles
.replace(/"/g, '\u201d')
// ellipses
.replace(/\.{3}/g, '\u2026');
}
/**
* mangle email addresses
* @param {string} text
*/
function mangle(text) {
let out = '',
i,
ch;
const l = text.length;
for (i = 0; i < l; i++) {
ch = text.charCodeAt(i);
if (Math.random() > 0.5) {
ch = 'x' + ch.toString(16);
}
out += '&#' + ch + ';';
}
return out;
}
/**
* Block Lexer
*/
class Lexer {
constructor(options) {
this.tokens = [];
this.tokens.links = Object.create(null);
this.options = options || defaults;
this.options.tokenizer = this.options.tokenizer || new Tokenizer();
this.tokenizer = this.options.tokenizer;
this.tokenizer.options = this.options;
this.tokenizer.lexer = this;
this.inlineQueue = [];
this.state = {
inLink: false,
inRawBlock: false,
top: true
};
const rules = {
block: block.normal,
inline: inline.normal
};
if (this.options.pedantic) {
rules.block = block.pedantic;
rules.inline = inline.pedantic;
} else if (this.options.gfm) {
rules.block = block.gfm;
if (this.options.breaks) {
rules.inline = inline.breaks;
} else {
rules.inline = inline.gfm;
}
}
this.tokenizer.rules = rules;
}
/**
* Expose Rules
*/
static get rules() {
return {
block,
inline
};
}
/**
* Static Lex Method
*/
static lex(src, options) {
const lexer = new Lexer(options);
return lexer.lex(src);
}
/**
* Static Lex Inline Method
*/
static lexInline(src, options) {
const lexer = new Lexer(options);
return lexer.inlineTokens(src);
}
/**
* Preprocessing
*/
lex(src) {
src = src
.replace(/\r\n|\r/g, '\n');
this.blockTokens(src, this.tokens);
let next;
while (next = this.inlineQueue.shift()) {
this.inlineTokens(next.src, next.tokens);
}
return this.tokens;
}
/**
* Lexing
*/
blockTokens(src, tokens = []) {
if (this.options.pedantic) {
src = src.replace(/\t/g, ' ').replace(/^ +$/gm, '');
} else {
src = src.replace(/^( *)(\t+)/gm, (_, leading, tabs) => {
return leading + ' '.repeat(tabs.length);
});
}
let token, lastToken, cutSrc, lastParagraphClipped;
while (src) {
if (this.options.extensions
&& this.options.extensions.block
&& this.options.extensions.block.some((extTokenizer) => {
if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
src = src.substring(token.raw.length);
tokens.push(token);
return true;
}
return false;
})) {
continue;
}
// newline
if (token = this.tokenizer.space(src)) {
src = src.substring(token.raw.length);
if (token.raw.length === 1 && tokens.length > 0) {
// if there's a single \n as a spacer, it's terminating the last line,
// so move it there so that we don't get unecessary paragraph tags
tokens[tokens.length - 1].raw += '\n';
} else {
tokens.push(token);
}
continue;
}
// code
if (token = this.tokenizer.code(src)) {
src = src.substring(token.raw.length);
lastToken = tokens[tokens.length - 1];
// An indented code block cannot interrupt a paragraph.
if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {
lastToken.raw += '\n' + token.raw;
lastToken.text += '\n' + token.text;
this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
} else {
tokens.push(token);
}
continue;
}
// fences
if (token = this.tokenizer.fences(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
// heading
if (token = this.tokenizer.heading(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
// hr
if (token = this.tokenizer.hr(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
// blockquote
if (token = this.tokenizer.blockquote(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
// list
if (token = this.tokenizer.list(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
// html
if (token = this.tokenizer.html(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
// def
if (token = this.tokenizer.def(src)) {
src = src.substring(token.raw.length);
lastToken = tokens[tokens.length - 1];
if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {
lastToken.raw += '\n' + token.raw;
lastToken.text += '\n' + token.raw;
this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
} else if (!this.tokens.links[token.tag]) {
this.tokens.links[token.tag] = {
href: token.href,
title: token.title
};
}
continue;
}
// table (gfm)
if (token = this.tokenizer.table(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
// lheading
if (token = this.tokenizer.lheading(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
// top-level paragraph
// prevent paragraph consuming extensions by clipping 'src' to extension start
cutSrc = src;
if (this.options.extensions && this.options.extensions.startBlock) {
let startIndex = Infinity;
const tempSrc = src.slice(1);
let tempStart;
this.options.extensions.startBlock.forEach(function(getStartIndex) {
tempStart = getStartIndex.call({ lexer: this }, tempSrc);
if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }
});
if (startIndex < Infinity && startIndex >= 0) {
cutSrc = src.substring(0, startIndex + 1);
}
}
if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {
lastToken = tokens[tokens.length - 1];
if (lastParagraphClipped && lastToken.type === 'paragraph') {
lastToken.raw += '\n' + token.raw;
lastToken.text += '\n' + token.text;
this.inlineQueue.pop();
this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
} else {
tokens.push(token);
}
lastParagraphClipped = (cutSrc.length !== src.length);
src = src.substring(token.raw.length);
continue;
}
// text
if (token = this.tokenizer.text(src)) {
src = src.substring(token.raw.length);
lastToken = tokens[tokens.length - 1];
if (lastToken && lastToken.type === 'text') {
lastToken.raw += '\n' + token.raw;
lastToken.text += '\n' + token.text;
this.inlineQueue.pop();
this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
} else {
tokens.push(token);
}
continue;
}
if (src) {
const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);
if (this.options.silent) {
console.error(errMsg);
break;
} else {
throw new Error(errMsg);
}
}
}
this.state.top = true;
return tokens;
}
inline(src, tokens = []) {
this.inlineQueue.push({ src, tokens });
return tokens;
}
/**
* Lexing/Compiling
*/
inlineTokens(src, tokens = []) {
let token, lastToken, cutSrc;
// String with links masked to avoid interference with em and strong
let maskedSrc = src;
let match;
let keepPrevChar, prevChar;
// Mask out reflinks
if (this.tokens.links) {
const links = Object.keys(this.tokens.links);
if (links.length > 0) {
while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {
maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
}
}
}
}
// Mask out other blocks
while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
}
// Mask out escaped characters
while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {
maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
}
while (src) {
if (!keepPrevChar) {
prevChar = '';
}
keepPrevChar = false;
// extensions
if (this.options.extensions
&& this.options.extensions.inline
&& this.options.extensions.inline.some((extTokenizer) => {
if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
src = src.substring(token.raw.length);
tokens.push(token);
return true;
}
return false;
})) {
continue;
}
// escape
if (token = this.tokenizer.escape(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
// tag
if (token = this.tokenizer.tag(src)) {
src = src.substring(token.raw.length);
lastToken = tokens[tokens.length - 1];
if (lastToken && token.type === 'text' && lastToken.type === 'text') {
lastToken.raw += token.raw;
lastToken.text += token.text;
} else {
tokens.push(token);
}
continue;
}
// link
if (token = this.tokenizer.link(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
// reflink, nolink
if (token = this.tokenizer.reflink(src, this.tokens.links)) {
src = src.substring(token.raw.length);
lastToken = tokens[tokens.length - 1];
if (lastToken && token.type === 'text' && lastToken.type === 'text') {
lastToken.raw += token.raw;
lastToken.text += token.text;
} else {
tokens.push(token);
}
continue;
}
// em & strong
if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
// code
if (token = this.tokenizer.codespan(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
// br
if (token = this.tokenizer.br(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
// del (gfm)
if (token = this.tokenizer.del(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
// autolink
if (token = this.tokenizer.autolink(src, mangle)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
// url (gfm)
if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
// text
// prevent inlineText consuming extensions by clipping 'src' to extension start
cutSrc = src;
if (this.options.extensions && this.options.extensions.startInline) {
let startIndex = Infinity;
const tempSrc = src.slice(1);
let tempStart;
this.options.extensions.startInline.forEach(function(getStartIndex) {
tempStart = getStartIndex.call({ lexer: this }, tempSrc);
if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); }
});
if (startIndex < Infinity && startIndex >= 0) {
cutSrc = src.substring(0, startIndex + 1);
}
}
if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {
src = src.substring(token.raw.length);
if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started
prevChar = token.raw.slice(-1);
}
keepPrevChar = true;
lastToken = tokens[tokens.length - 1];
if (lastToken && lastToken.type === 'text') {
lastToken.raw += token.raw;
lastToken.text += token.text;
} else {
tokens.push(token);
}
continue;
}
if (src) {
const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);
if (this.options.silent) {
console.error(errMsg);
break;
} else {
throw new Error(errMsg);
}
}
}
return tokens;
}
}
/**
* Renderer
*/
class Renderer {
constructor(options) {
this.options = options || defaults;
}
code(code, infostring, escaped) {
const lang = (infostring || '').match(/\S*/)[0];
if (this.options.highlight) {
const out = this.options.highlight(code, lang);
if (out != null && out !== code) {
escaped = true;
code = out;
}
}
code = code.replace(/\n$/, '') + '\n';
if (!lang) {
return '<pre><code>'
+ (escaped ? code : marked_esm_escape(code, true))
+ '</code></pre>\n';
}
return '<pre><code class="'
+ this.options.langPrefix
+ marked_esm_escape(lang)
+ '">'
+ (escaped ? code : marked_esm_escape(code, true))
+ '</code></pre>\n';
}
/**
* @param {string} quote
*/
blockquote(quote) {
return `<blockquote>\n${quote}</blockquote>\n`;
}
html(html, block) {
return html;
}
/**
* @param {string} text
* @param {string} level
* @param {string} raw
* @param {any} slugger
*/
heading(text, level, raw, slugger) {
if (this.options.headerIds) {
const id = this.options.headerPrefix + slugger.slug(raw);
return `<h${level} id="${id}">${text}</h${level}>\n`;
}
// ignore IDs
return `<h${level}>${text}</h${level}>\n`;
}
hr() {
return this.options.xhtml ? '<hr/>\n' : '<hr>\n';
}
list(body, ordered, start) {
const type = ordered ? 'ol' : 'ul',
startatt = (ordered && start !== 1) ? (' start="' + start + '"') : '';
return '<' + type + startatt + '>\n' + body + '</' + type + '>\n';
}
/**
* @param {string} text
*/
listitem(text) {
return `<li>${text}</li>\n`;
}
checkbox(checked) {
return '<input '
+ (checked ? 'checked="" ' : '')
+ 'disabled="" type="checkbox"'
+ (this.options.xhtml ? ' /' : '')
+ '> ';
}
/**
* @param {string} text
*/
paragraph(text) {
return `<p>${text}</p>\n`;
}
/**
* @param {string} header
* @param {string} body
*/
table(header, body) {
if (body) body = `<tbody>${body}</tbody>`;
return '<table>\n'
+ '<thead>\n'
+ header
+ '</thead>\n'
+ body
+ '</table>\n';
}
/**
* @param {string} content
*/
tablerow(content) {
return `<tr>\n${content}</tr>\n`;
}
tablecell(content, flags) {
const type = flags.header ? 'th' : 'td';
const tag = flags.align
? `<${type} align="${flags.align}">`
: `<${type}>`;
return tag + content + `</${type}>\n`;
}
/**
* span level renderer
* @param {string} text
*/
strong(text) {
return `<strong>${text}</strong>`;
}
/**
* @param {string} text
*/
em(text) {
return `<em>${text}</em>`;
}
/**
* @param {string} text
*/
codespan(text) {
return `<code>${text}</code>`;
}
br() {
return this.options.xhtml ? '<br/>' : '<br>';
}
/**
* @param {string} text
*/
del(text) {
return `<del>${text}</del>`;
}
/**
* @param {string} href
* @param {string} title
* @param {string} text
*/
link(href, title, text) {
href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
if (href === null) {
return text;
}
let out = '<a href="' + href + '"';
if (title) {
out += ' title="' + title + '"';
}
out += '>' + text + '</a>';
return out;
}
/**
* @param {string} href
* @param {string} title
* @param {string} text
*/
image(href, title, text) {
href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
if (href === null) {
return text;
}
let out = `<img src="${href}" alt="${text}"`;
if (title) {
out += ` title="${title}"`;
}
out += this.options.xhtml ? '/>' : '>';
return out;
}
text(text) {
return text;
}
}
/**
* TextRenderer
* returns only the textual part of the token
*/
class TextRenderer {
// no need for block level renderers
strong(text) {
return text;
}
em(text) {
return text;
}
codespan(text) {
return text;
}
del(text) {
return text;
}
html(text) {
return text;
}
text(text) {
return text;
}
link(href, title, text) {
return '' + text;
}
image(href, title, text) {
return '' + text;
}
br() {
return '';
}
}
/**
* Slugger generates header id
*/
class Slugger {
constructor() {
this.seen = {};
}
/**
* @param {string} value
*/
serialize(value) {
return value
.toLowerCase()
.trim()
// remove html tags
.replace(/<[!\/a-z].*?>/ig, '')
// remove unwanted chars
.replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '')
.replace(/\s/g, '-');
}
/**
* Finds the next safe (unique) slug to use
* @param {string} originalSlug
* @param {boolean} isDryRun
*/
getNextSafeSlug(originalSlug, isDryRun) {
let slug = originalSlug;
let occurenceAccumulator = 0;
if (this.seen.hasOwnProperty(slug)) {
occurenceAccumulator = this.seen[originalSlug];
do {
occurenceAccumulator++;
slug = originalSlug + '-' + occurenceAccumulator;
} while (this.seen.hasOwnProperty(slug));
}
if (!isDryRun) {
this.seen[originalSlug] = occurenceAccumulator;
this.seen[slug] = 0;
}
return slug;
}
/**
* Convert string to unique id
* @param {object} [options]
* @param {boolean} [options.dryrun] Generates the next unique slug without
* updating the internal accumulator.
*/
slug(value, options = {}) {
const slug = this.serialize(value);
return this.getNextSafeSlug(slug, options.dryrun);
}
}
/**
* Parsing & Compiling
*/
class Parser {
constructor(options) {
this.options = options || defaults;
this.options.renderer = this.options.renderer || new Renderer();
this.renderer = this.options.renderer;
this.renderer.options = this.options;
this.textRenderer = new TextRenderer();
this.slugger = new Slugger();
}
/**
* Static Parse Method
*/
static parse(tokens, options) {
const parser = new Parser(options);
return parser.parse(tokens);
}
/**
* Static Parse Inline Method
*/
static parseInline(tokens, options) {
const parser = new Parser(options);
return parser.parseInline(tokens);
}
/**
* Parse Loop
*/
parse(tokens, top = true) {
let out = '',
i,
j,
k,
l2,
l3,
row,
cell,
header,
body,
token,
ordered,
start,
loose,
itemBody,
item,
checked,
task,
checkbox,
ret;
const l = tokens.length;
for (i = 0; i < l; i++) {
token = tokens[i];
// Run any renderer extensions
if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {
ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);
if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) {
out += ret || '';
continue;
}
}
switch (token.type) {
case 'space': {
continue;
}
case 'hr': {
out += this.renderer.hr();
continue;
}
case 'heading': {
out += this.renderer.heading(
this.parseInline(token.tokens),
token.depth,
marked_esm_unescape(this.parseInline(token.tokens, this.textRenderer)),
this.slugger);
continue;
}
case 'code': {
out += this.renderer.code(token.text,
token.lang,
token.escaped);
continue;
}
case 'table': {
header = '';
// header
cell = '';
l2 = token.header.length;
for (j = 0; j < l2; j++) {
cell += this.renderer.tablecell(
this.parseInline(token.header[j].tokens),
{ header: true, align: token.align[j] }
);
}
header += this.renderer.tablerow(cell);
body = '';
l2 = token.rows.length;
for (j = 0; j < l2; j++) {
row = token.rows[j];
cell = '';
l3 = row.length;
for (k = 0; k < l3; k++) {
cell += this.renderer.tablecell(
this.parseInline(row[k].tokens),
{ header: false, align: token.align[k] }
);
}
body += this.renderer.tablerow(cell);
}
out += this.renderer.table(header, body);
continue;
}
case 'blockquote': {
body = this.parse(token.tokens);
out += this.renderer.blockquote(body);
continue;
}
case 'list': {
ordered = token.ordered;
start = token.start;
loose = token.loose;
l2 = token.items.length;
body = '';
for (j = 0; j < l2; j++) {
item = token.items[j];
checked = item.checked;
task = item.task;
itemBody = '';
if (item.task) {
checkbox = this.renderer.checkbox(checked);
if (loose) {
if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {
item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;
if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {
item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;
}
} else {
item.tokens.unshift({
type: 'text',
text: checkbox
});
}
} else {
itemBody += checkbox;
}
}
itemBody += this.parse(item.tokens, loose);
body += this.renderer.listitem(itemBody, task, checked);
}
out += this.renderer.list(body, ordered, start);
continue;
}
case 'html': {
out += this.renderer.html(token.text, token.block);
continue;
}
case 'paragraph': {
out += this.renderer.paragraph(this.parseInline(token.tokens));
continue;
}
case 'text': {
body = token.tokens ? this.parseInline(token.tokens) : token.text;
while (i + 1 < l && tokens[i + 1].type === 'text') {
token = tokens[++i];
body += '\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);
}
out += top ? this.renderer.paragraph(body) : body;
continue;
}
default: {
const errMsg = 'Token with "' + token.type + '" type was not found.';
if (this.options.silent) {
console.error(errMsg);
return;
} else {
throw new Error(errMsg);
}
}
}
}
return out;
}
/**
* Parse Inline Tokens
*/
parseInline(tokens, renderer) {
renderer = renderer || this.renderer;
let out = '',
i,
token,
ret;
const l = tokens.length;
for (i = 0; i < l; i++) {
token = tokens[i];
// Run any renderer extensions
if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {
ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);
if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {
out += ret || '';
continue;
}
}
switch (token.type) {
case 'escape': {
out += renderer.text(token.text);
break;
}
case 'html': {
out += renderer.html(token.text);
break;
}
case 'link': {
out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));
break;
}
case 'image': {
out += renderer.image(token.href, token.title, token.text);
break;
}
case 'strong': {
out += renderer.strong(this.parseInline(token.tokens, renderer));
break;
}
case 'em': {
out += renderer.em(this.parseInline(token.tokens, renderer));
break;
}
case 'codespan': {
out += renderer.codespan(token.text);
break;
}
case 'br': {
out += renderer.br();
break;
}
case 'del': {
out += renderer.del(this.parseInline(token.tokens, renderer));
break;
}
case 'text': {
out += renderer.text(token.text);
break;
}
default: {
const errMsg = 'Token with "' + token.type + '" type was not found.';
if (this.options.silent) {
console.error(errMsg);
return;
} else {
throw new Error(errMsg);
}
}
}
}
return out;
}
}
class Hooks {
constructor(options) {
this.options = options || defaults;
}
static passThroughHooks = new Set([
'preprocess',
'postprocess'
]);
/**
* Process markdown before marked
*/
preprocess(markdown) {
return markdown;
}
/**
* Process HTML after marked is finished
*/
postprocess(html) {
return html;
}
}
class Marked {
defaults = getDefaults();
options = this.setOptions;
parse = this.#parseMarkdown(Lexer.lex, Parser.parse);
parseInline = this.#parseMarkdown(Lexer.lexInline, Parser.parseInline);
Parser = Parser;
parser = Parser.parse;
Renderer = Renderer;
TextRenderer = TextRenderer;
Lexer = Lexer;
lexer = Lexer.lex;
Tokenizer = Tokenizer;
Slugger = Slugger;
Hooks = Hooks;
constructor(...args) {
this.use(...args);
}
walkTokens(tokens, callback) {
let values = [];
for (const token of tokens) {
values = values.concat(callback.call(this, token));
switch (token.type) {
case 'table': {
for (const cell of token.header) {
values = values.concat(this.walkTokens(cell.tokens, callback));
}
for (const row of token.rows) {
for (const cell of row) {
values = values.concat(this.walkTokens(cell.tokens, callback));
}
}
break;
}
case 'list': {
values = values.concat(this.walkTokens(token.items, callback));
break;
}
default: {
if (this.defaults.extensions && this.defaults.extensions.childTokens && this.defaults.extensions.childTokens[token.type]) { // Walk any extensions
this.defaults.extensions.childTokens[token.type].forEach((childTokens) => {
values = values.concat(this.walkTokens(token[childTokens], callback));
});
} else if (token.tokens) {
values = values.concat(this.walkTokens(token.tokens, callback));
}
}
}
}
return values;
}
use(...args) {
const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };
args.forEach((pack) => {
// copy options to new object
const opts = { ...pack };
// set async to true if it was set to true before
opts.async = this.defaults.async || opts.async || false;
// ==-- Parse "addon" extensions --== //
if (pack.extensions) {
pack.extensions.forEach((ext) => {
if (!ext.name) {
throw new Error('extension name required');
}
if (ext.renderer) { // Renderer extensions
const prevRenderer = extensions.renderers[ext.name];
if (prevRenderer) {
// Replace extension with func to run new extension but fall back if false
extensions.renderers[ext.name] = function(...args) {
let ret = ext.renderer.apply(this, args);
if (ret === false) {
ret = prevRenderer.apply(this, args);
}
return ret;
};
} else {
extensions.renderers[ext.name] = ext.renderer;
}
}
if (ext.tokenizer) { // Tokenizer Extensions
if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {
throw new Error("extension level must be 'block' or 'inline'");
}
if (extensions[ext.level]) {
extensions[ext.level].unshift(ext.tokenizer);
} else {
extensions[ext.level] = [ext.tokenizer];
}
if (ext.start) { // Function to check for start of token
if (ext.level === 'block') {
if (extensions.startBlock) {
extensions.startBlock.push(ext.start);
} else {
extensions.startBlock = [ext.start];
}
} else if (ext.level === 'inline') {
if (extensions.startInline) {
extensions.startInline.push(ext.start);
} else {
extensions.startInline = [ext.start];
}
}
}
}
if (ext.childTokens) { // Child tokens to be visited by walkTokens
extensions.childTokens[ext.name] = ext.childTokens;
}
});
opts.extensions = extensions;
}
// ==-- Parse "overwrite" extensions --== //
if (pack.renderer) {
const renderer = this.defaults.renderer || new Renderer(this.defaults);
for (const prop in pack.renderer) {
const prevRenderer = renderer[prop];
// Replace renderer with func to run extension, but fall back if false
renderer[prop] = (...args) => {
let ret = pack.renderer[prop].apply(renderer, args);
if (ret === false) {
ret = prevRenderer.apply(renderer, args);
}
return ret;
};
}
opts.renderer = renderer;
}
if (pack.tokenizer) {
const tokenizer = this.defaults.tokenizer || new Tokenizer(this.defaults);
for (const prop in pack.tokenizer) {
const prevTokenizer = tokenizer[prop];
// Replace tokenizer with func to run extension, but fall back if false
tokenizer[prop] = (...args) => {
let ret = pack.tokenizer[prop].apply(tokenizer, args);
if (ret === false) {
ret = prevTokenizer.apply(tokenizer, args);
}
return ret;
};
}
opts.tokenizer = tokenizer;
}
// ==-- Parse Hooks extensions --== //
if (pack.hooks) {
const hooks = this.defaults.hooks || new Hooks();
for (const prop in pack.hooks) {
const prevHook = hooks[prop];
if (Hooks.passThroughHooks.has(prop)) {
hooks[prop] = (arg) => {
if (this.defaults.async) {
return Promise.resolve(pack.hooks[prop].call(hooks, arg)).then(ret => {
return prevHook.call(hooks, ret);
});
}
const ret = pack.hooks[prop].call(hooks, arg);
return prevHook.call(hooks, ret);
};
} else {
hooks[prop] = (...args) => {
let ret = pack.hooks[prop].apply(hooks, args);
if (ret === false) {
ret = prevHook.apply(hooks, args);
}
return ret;
};
}
}
opts.hooks = hooks;
}
// ==-- Parse WalkTokens extensions --== //
if (pack.walkTokens) {
const walkTokens = this.defaults.walkTokens;
opts.walkTokens = function(token) {
let values = [];
values.push(pack.walkTokens.call(this, token));
if (walkTokens) {
values = values.concat(walkTokens.call(this, token));
}
return values;
};
}
this.defaults = { ...this.defaults, ...opts };
});
return this;
}
setOptions(opt) {
this.defaults = { ...this.defaults, ...opt };
return this;
}
#parseMarkdown(lexer, parser) {
return (src, opt, callback) => {
if (typeof opt === 'function') {
callback = opt;
opt = null;
}
const origOpt = { ...opt };
opt = { ...this.defaults, ...origOpt };
const throwError = this.#onError(opt.silent, opt.async, callback);
// throw error in case of non string input
if (typeof src === 'undefined' || src === null) {
return throwError(new Error('marked(): input parameter is undefined or null'));
}
if (typeof src !== 'string') {
return throwError(new Error('marked(): input parameter is of type '
+ Object.prototype.toString.call(src) + ', string expected'));
}
checkDeprecations(opt, callback);
if (opt.hooks) {
opt.hooks.options = opt;
}
if (callback) {
const highlight = opt.highlight;
let tokens;
try {
if (opt.hooks) {
src = opt.hooks.preprocess(src);
}
tokens = lexer(src, opt);
} catch (e) {
return throwError(e);
}
const done = (err) => {
let out;
if (!err) {
try {
if (opt.walkTokens) {
this.walkTokens(tokens, opt.walkTokens);
}
out = parser(tokens, opt);
if (opt.hooks) {
out = opt.hooks.postprocess(out);
}
} catch (e) {
err = e;
}
}
opt.highlight = highlight;
return err
? throwError(err)
: callback(null, out);
};
if (!highlight || highlight.length < 3) {
return done();
}
delete opt.highlight;
if (!tokens.length) return done();
let pending = 0;
this.walkTokens(tokens, (token) => {
if (token.type === 'code') {
pending++;
setTimeout(() => {
highlight(token.text, token.lang, (err, code) => {
if (err) {
return done(err);
}
if (code != null && code !== token.text) {
token.text = code;
token.escaped = true;
}
pending--;
if (pending === 0) {
done();
}
});
}, 0);
}
});
if (pending === 0) {
done();
}
return;
}
if (opt.async) {
return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)
.then(src => lexer(src, opt))
.then(tokens => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)
.then(tokens => parser(tokens, opt))
.then(html => opt.hooks ? opt.hooks.postprocess(html) : html)
.catch(throwError);
}
try {
if (opt.hooks) {
src = opt.hooks.preprocess(src);
}
const tokens = lexer(src, opt);
if (opt.walkTokens) {
this.walkTokens(tokens, opt.walkTokens);
}
let html = parser(tokens, opt);
if (opt.hooks) {
html = opt.hooks.postprocess(html);
}
return html;
} catch (e) {
return throwError(e);
}
};
}
#onError(silent, async, callback) {
return (e) => {
e.message += '\nPlease report this to https://github.com/markedjs/this.';
if (silent) {
const msg = '<p>An error occurred:</p><pre>'
+ marked_esm_escape(e.message + '', true)
+ '</pre>';
if (async) {
return Promise.resolve(msg);
}
if (callback) {
callback(null, msg);
return;
}
return msg;
}
if (async) {
return Promise.reject(e);
}
if (callback) {
callback(e);
return;
}
throw e;
};
}
}
const markedInstance = new Marked(defaults);
/**
* Marked
*/
function marked(src, opt, callback) {
return markedInstance.parse(src, opt, callback);
}
/**
* Options
*/
marked.options =
marked.setOptions = function(opt) {
markedInstance.setOptions(opt);
marked.defaults = markedInstance.defaults;
changeDefaults(marked.defaults);
return marked;
};
marked.getDefaults = getDefaults;
marked.defaults = defaults;
/**
* Use Extension
*/
marked.use = function(...args) {
markedInstance.use(...args);
marked.defaults = markedInstance.defaults;
changeDefaults(marked.defaults);
return marked;
};
/**
* Run callback for every token
*/
marked.walkTokens = function(tokens, callback) {
return markedInstance.walkTokens(tokens, callback);
};
/**
* Parse Inline
* @param {string} src
*/
marked.parseInline = markedInstance.parseInline;
/**
* Expose
*/
marked.Parser = Parser;
marked.parser = Parser.parse;
marked.Renderer = Renderer;
marked.TextRenderer = TextRenderer;
marked.Lexer = Lexer;
marked.lexer = Lexer.lex;
marked.Tokenizer = Tokenizer;
marked.Slugger = Slugger;
marked.Hooks = Hooks;
marked.parse = marked;
const options = marked.options;
const setOptions = marked.setOptions;
const use = marked.use;
const walkTokens = marked.walkTokens;
const parseInline = marked.parseInline;
const parse = (/* unused pure expression or super */ null && (marked));
const parser = Parser.parse;
const lexer = Lexer.lex;
// EXTERNAL MODULE: ./node_modules/prismjs/prism.js
var prism = __webpack_require__(660);
var prism_default = /*#__PURE__*/__webpack_require__.n(prism);
// EXTERNAL MODULE: ./node_modules/prismjs/components/prism-css.js
var prism_css = __webpack_require__(251);
// EXTERNAL MODULE: ./node_modules/prismjs/components/prism-yaml.js
var prism_yaml = __webpack_require__(358);
// EXTERNAL MODULE: ./node_modules/prismjs/components/prism-go.js
var prism_go = __webpack_require__(46);
// EXTERNAL MODULE: ./node_modules/prismjs/components/prism-java.js
var prism_java = __webpack_require__(503);
// EXTERNAL MODULE: ./node_modules/prismjs/components/prism-json.js
var prism_json = __webpack_require__(277);
// EXTERNAL MODULE: ./node_modules/prismjs/components/prism-bash.js
var prism_bash = __webpack_require__(874);
// EXTERNAL MODULE: ./node_modules/prismjs/components/prism-python.js
var prism_python = __webpack_require__(366);
// EXTERNAL MODULE: ./node_modules/prismjs/components/prism-http.js
var prism_http = __webpack_require__(57);
// EXTERNAL MODULE: ./node_modules/prismjs/components/prism-csharp.js
var prism_csharp = __webpack_require__(16);
;// CONCATENATED MODULE: ./src/styles/font-styles.js
/* harmony default export */ const font_styles = (i`
.hover-bg:hover{
background: var(--bg3);
}
::selection {
background: var(--selection-bg);
color: var(--selection-fg);
}
.regular-font{
font-family:var(--font-regular);
}
.mono-font {
font-family:var(--font-mono);
}
.title {
font-size: calc(var(--font-size-small) + 18px);
font-weight: normal
}
.sub-title{ font-size: 20px;}
.req-res-title {
font-family: var(--font-regular);
font-size: calc(var(--font-size-small) + 4px);
font-weight:bold;
margin-bottom:8px;
text-align:left;
}
.tiny-title {
font-size:calc(var(--font-size-small) + 1px);
font-weight:bold;
}
.regular-font-size { font-size: var(--font-size-regular); }
.small-font-size { font-size: var(--font-size-small); }
.upper { text-transform: uppercase; }
.primary-text{ color: var(--primary-color); }
.bold-text { font-weight:bold; }
.gray-text { color: var(--light-fg); }
.red-text {color: var(--red)}
.blue-text {color: var(--blue)}
.multiline {
overflow: scroll;
max-height: var(--resp-area-height, 400px);
color: var(--fg3);
}
.method-fg.put { color: var(--orange); }
.method-fg.post { color: var(--green); }
.method-fg.get { color: var(--blue); }
.method-fg.delete { color: var(--red); }
.method-fg.options,
.method-fg.head,
.method-fg.patch {
color: var(--yellow);
}
h1{ font-family:var(--font-regular); font-size:28px; padding-top: 10px; letter-spacing:normal; font-weight:normal; }
h2{ font-family:var(--font-regular); font-size:24px; padding-top: 10px; letter-spacing:normal; font-weight:normal; }
h3{ font-family:var(--font-regular); font-size:18px; padding-top: 10px; letter-spacing:normal; font-weight:normal; }
h4{ font-family:var(--font-regular); font-size:16px; padding-top: 10px; letter-spacing:normal; font-weight:normal; }
h5{ font-family:var(--font-regular); font-size:14px; padding-top: 10px; letter-spacing:normal; font-weight:normal; }
h6{ font-family:var(--font-regular); font-size:14px; padding-top: 10px; letter-spacing:normal; font-weight:normal; }
h1,h2,h3,h4,h5,h5{
margin-block-end: 0.2em;
}
p { margin-block-start: 0.5em; }
a { color: var(--blue); cursor:pointer; }
a.inactive-link {
color:var(--fg);
text-decoration: none;
cursor:text;
}
code,
pre {
margin: 0px;
font-family: var(--font-mono);
font-size: calc(var(--font-size-mono) - 1px);
}
.m-markdown,
.m-markdown-small {
display:block;
}
.m-markdown p,
.m-markdown span {
font-size: var(--font-size-regular);
line-height:calc(var(--font-size-regular) + 8px);
}
.m-markdown li {
font-size: var(--font-size-regular);
line-height:calc(var(--font-size-regular) + 10px);
}
.m-markdown-small p,
.m-markdown-small span,
.m-markdown-small li {
font-size: var(--font-size-small);
line-height: calc(var(--font-size-small) + 6px);
}
.m-markdown-small li {
line-height: calc(var(--font-size-small) + 8px);
}
.m-markdown p:not(:first-child) {
margin-block-start: 24px;
}
.m-markdown-small p:not(:first-child) {
margin-block-start: 12px;
}
.m-markdown-small p:first-child {
margin-block-start: 0;
}
.m-markdown p,
.m-markdown-small p {
margin-block-end: 0
}
.m-markdown code span {
font-size:var(--font-size-mono);
}
.m-markdown-small code,
.m-markdown code {
padding: 1px 6px;
border-radius: 2px;
color: var(--inline-code-fg);
background-color: var(--bg3);
font-size: calc(var(--font-size-mono));
line-height: 1.2;
}
.m-markdown-small code {
font-size: calc(var(--font-size-mono) - 1px);
}
.m-markdown-small pre,
.m-markdown pre {
white-space: pre-wrap;
overflow-x: auto;
line-height: normal;
border-radius: 2px;
border: 1px solid var(--code-border-color);
}
.m-markdown pre {
padding: 12px;
background-color: var(--code-bg);
color:var(--code-fg);
}
.m-markdown-small pre {
margin-top: 4px;
padding: 2px 4px;
background-color: var(--bg3);
color: var(--fg2);
}
.m-markdown-small pre code,
.m-markdown pre code {
border:none;
padding:0;
}
.m-markdown pre code {
color: var(--code-fg);
background-color: var(--code-bg);
background-color: transparent;
}
.m-markdown-small pre code {
color: var(--fg2);
background-color: var(--bg3);
}
.m-markdown ul,
.m-markdown ol {
padding-inline-start: 30px;
}
.m-markdown-small ul,
.m-markdown-small ol {
padding-inline-start: 20px;
}
.m-markdown-small a,
.m-markdown a {
color:var(--blue);
}
.m-markdown-small img,
.m-markdown img {
max-width: 100%;
}
/* Markdown table */
.m-markdown-small table,
.m-markdown table {
border-spacing: 0;
margin: 10px 0;
border-collapse: separate;
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
font-size: calc(var(--font-size-small) + 1px);
line-height: calc(var(--font-size-small) + 4px);
max-width: 100%;
}
.m-markdown-small table {
font-size: var(--font-size-small);
line-height: calc(var(--font-size-small) + 2px);
margin: 8px 0;
}
.m-markdown-small td,
.m-markdown-small th,
.m-markdown td,
.m-markdown th {
vertical-align: top;
border-top: 1px solid var(--border-color);
line-height: calc(var(--font-size-small) + 4px);
}
.m-markdown-small tr:first-child th,
.m-markdown tr:first-child th {
border-top: 0 none;
}
.m-markdown th,
.m-markdown td {
padding: 10px 12px;
}
.m-markdown-small th,
.m-markdown-small td {
padding: 8px 8px;
}
.m-markdown th,
.m-markdown-small th {
font-weight: 600;
background-color: var(--bg2);
vertical-align: middle;
}
.m-markdown-small table code {
font-size: calc(var(--font-size-mono) - 2px);
}
.m-markdown table code {
font-size: calc(var(--font-size-mono) - 1px);
}
.m-markdown blockquote,
.m-markdown-small blockquote {
margin-inline-start: 0;
margin-inline-end: 0;
border-left: 3px solid var(--border-color);
padding: 6px 0 6px 6px;
}
.m-markdown hr{
border: 1px solid var(--border-color);
}
`);
;// CONCATENATED MODULE: ./src/styles/input-styles.js
/* eslint-disable max-len */
/* harmony default export */ const input_styles = (i`
/* Button */
.m-btn {
border-radius: var(--border-radius);
font-weight: 600;
display: inline-block;
padding: 6px 16px;
font-size: var(--font-size-small);
outline: 0;
line-height: 1;
text-align: center;
white-space: nowrap;
border: 2px solid var(--primary-color);
background-color:transparent;
transition: background-color 0.2s;
user-select: none;
cursor: pointer;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.m-btn.primary {
background-color: var(--primary-color);
color: var(--primary-color-invert);
}
.m-btn.thin-border { border-width: 1px; }
.m-btn.large { padding:8px 14px; }
.m-btn.small { padding:5px 12px; }
.m-btn.tiny { padding:5px 6px; }
.m-btn.circle { border-radius: 50%; }
.m-btn:hover {
background-color: var(--primary-color);
color: var(--primary-color-invert);
}
.m-btn.nav { border: 2px solid var(--nav-accent-color); }
.m-btn.nav:hover {
background-color: var(--nav-accent-color);
}
.m-btn:disabled{
background-color: var(--bg3);
color: var(--fg3);
border-color: var(--fg3);
cursor: not-allowed;
opacity: 0.4;
}
.toolbar-btn{
cursor: pointer;
padding: 4px;
margin:0 2px;
font-size: var(--font-size-small);
min-width: 50px;
color: var(--primary-color-invert);
border-radius: 2px;
border: none;
background-color: var(--primary-color);
}
input, textarea, select, button, pre {
color:var(--fg);
outline: none;
background-color: var(--input-bg);
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
}
button {
font-family: var(--font-regular);
}
/* Form Inputs */
pre,
select,
textarea,
input[type="file"],
input[type="text"],
input[type="password"] {
font-family: var(--font-mono);
font-weight: 400;
font-size: var(--font-size-small);
transition: border .2s;
padding: 6px 5px;
}
select {
font-family: var(--font-regular);
padding: 5px 30px 5px 5px;
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%3E%3Cpath%20d%3D%22M10.3%203.3L6%207.6%201.7%203.3A1%201%200%2000.3%204.7l5%205a1%201%200%20001.4%200l5-5a1%201%200%2010-1.4-1.4z%22%20fill%3D%22%23777777%22%2F%3E%3C%2Fsvg%3E");
background-position: calc(100% - 5px) center;
background-repeat: no-repeat;
background-size: 10px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
cursor: pointer;
}
select:hover {
border-color: var(--primary-color);
}
textarea::placeholder,
input[type="text"]::placeholder,
input[type="password"]::placeholder {
color: var(--placeholder-color);
opacity:1;
}
input[type="file"]{
font-family: var(--font-regular);
padding:2px;
cursor:pointer;
border: 1px solid var(--primary-color);
min-height: calc(var(--font-size-small) + 18px);
}
input[type="file"]::-webkit-file-upload-button {
font-family: var(--font-regular);
font-size: var(--font-size-small);
outline: none;
cursor:pointer;
padding: 3px 8px;
border: 1px solid var(--primary-color);
background-color: var(--primary-color);
color: var(--primary-color-invert);
border-radius: var(--border-radius);;
-webkit-appearance: none;
}
pre,
textarea {
scrollbar-width: thin;
scrollbar-color: var(--border-color) var(--input-bg);
}
pre::-webkit-scrollbar,
textarea::-webkit-scrollbar {
width: 8px;
height: 8px;
}
pre::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track {
background:var(--input-bg);
}
pre::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
border-radius: 2px;
background-color: var(--border-color);
}
.link {
font-size:var(--font-size-small);
text-decoration: underline;
color:var(--blue);
font-family:var(--font-mono);
margin-bottom:2px;
}
/* Toggle Body */
input[type="checkbox"] {
appearance: none;
display: inline-block;
background-color: var(--light-bg);
border: 1px solid var(--light-bg);
border-radius: 9px;
cursor: pointer;
height: 18px;
position: relative;
transition: border .25s .15s, box-shadow .25s .3s, padding .25s;
min-width: 36px;
width: 36px;
vertical-align: top;
}
/* Toggle Thumb */
input[type="checkbox"]:after {
position: absolute;
background-color: var(--bg);
border: 1px solid var(--light-bg);
border-radius: 8px;
content: '';
top: 0px;
left: 0px;
right: 16px;
display: block;
height: 16px;
transition: border .25s .15s, left .25s .1s, right .15s .175s;
}
/* Toggle Body - Checked */
input[type="checkbox"]:checked {
background-color: var(--green);
border-color: var(--green);
}
/* Toggle Thumb - Checked*/
input[type="checkbox"]:checked:after {
border: 1px solid var(--green);
left: 16px;
right: 1px;
transition: border .25s, left .15s .25s, right .25s .175s;
}`);
;// CONCATENATED MODULE: ./src/styles/flex-styles.js
/* harmony default export */ const flex_styles = (i`
.row, .col{
display:flex;
}
.row {
align-items:center;
flex-direction: row;
}
.col {
align-items:stretch;
flex-direction: column;
}
`);
;// CONCATENATED MODULE: ./src/styles/table-styles.js
/* harmony default export */ const table_styles = (i`
.m-table {
border-spacing: 0;
border-collapse: separate;
border: 1px solid var(--light-border-color);
border-radius: var(--border-radius);
margin: 0;
max-width: 100%;
direction: ltr;
}
.m-table tr:first-child td,
.m-table tr:first-child th {
border-top: 0 none;
}
.m-table td,
.m-table th {
font-size: var(--font-size-small);
line-height: calc(var(--font-size-small) + 4px);
padding: 4px 5px 4px;
vertical-align: top;
}
.m-table.padded-12 td,
.m-table.padded-12 th {
padding: 12px;
}
.m-table td:not([align]),
.m-table th:not([align]) {
text-align: left;
}
.m-table th {
color: var(--fg2);
font-size: var(--font-size-small);
line-height: calc(var(--font-size-small) + 18px);
font-weight: 600;
letter-spacing: normal;
background-color: var(--bg2);
vertical-align: bottom;
border-bottom: 1px solid var(--light-border-color);
}
.m-table > tbody > tr > td,
.m-table > tr > td {
border-top: 1px solid var(--light-border-color);
text-overflow: ellipsis;
overflow: hidden;
}
.table-title {
font-size:var(--font-size-small);
font-weight:bold;
vertical-align: middle;
margin: 12px 0 4px 0;
}
`);
;// CONCATENATED MODULE: ./src/styles/endpoint-styles.js
/* harmony default export */ const endpoint_styles = (i`
.only-large-screen { display:none; }
.endpoint-head .path{
display: flex;
font-family:var(--font-mono);
font-size: var(--font-size-small);
align-items: center;
overflow-wrap: break-word;
word-break: break-all;
}
.endpoint-head .descr {
font-size: var(--font-size-small);
color:var(--light-fg);
font-weight:400;
align-items: center;
overflow-wrap: break-word;
word-break: break-all;
display:none;
}
.m-endpoint.expanded{margin-bottom:16px; }
.m-endpoint > .endpoint-head{
border-width:1px 1px 1px 5px;
border-style:solid;
border-color:transparent;
border-top-color:var(--light-border-color);
display:flex;
padding:6px 16px;
align-items: center;
cursor: pointer;
}
.m-endpoint > .endpoint-head.put:hover,
.m-endpoint > .endpoint-head.put.expanded{
border-color:var(--orange);
background-color:var(--light-orange);
}
.m-endpoint > .endpoint-head.post:hover,
.m-endpoint > .endpoint-head.post.expanded {
border-color:var(--green);
background-color:var(--light-green);
}
.m-endpoint > .endpoint-head.get:hover,
.m-endpoint > .endpoint-head.get.expanded {
border-color:var(--blue);
background-color:var(--light-blue);
}
.m-endpoint > .endpoint-head.delete:hover,
.m-endpoint > .endpoint-head.delete.expanded {
border-color:var(--red);
background-color:var(--light-red);
}
.m-endpoint > .endpoint-head.head:hover,
.m-endpoint > .endpoint-head.head.expanded,
.m-endpoint > .endpoint-head.patch:hover,
.m-endpoint > .endpoint-head.patch.expanded,
.m-endpoint > .endpoint-head.options:hover,
.m-endpoint > .endpoint-head.options.expanded {
border-color:var(--yellow);
background-color:var(--light-yellow);
}
.m-endpoint > .endpoint-head.deprecated:hover,
.m-endpoint > .endpoint-head.deprecated.expanded {
border-color:var(--border-color);
filter:opacity(0.6);
}
.m-endpoint .endpoint-body {
flex-wrap:wrap;
padding:16px 0px 0 0px;
border-width:0px 1px 1px 5px;
border-style:solid;
box-shadow: 0px 4px 3px -3px rgba(0, 0, 0, 0.15);
}
.m-endpoint .endpoint-body.delete{ border-color:var(--red); }
.m-endpoint .endpoint-body.put{ border-color:var(--orange); }
.m-endpoint .endpoint-body.post{border-color:var(--green);}
.m-endpoint .endpoint-body.get{ border-color:var(--blue); }
.m-endpoint .endpoint-body.head,
.m-endpoint .endpoint-body.patch,
.m-endpoint .endpoint-body.options {
border-color:var(--yellow);
}
.m-endpoint .endpoint-body.deprecated{
border-color:var(--border-color);
filter:opacity(0.6);
}
.endpoint-head .deprecated{
color: var(--light-fg);
filter:opacity(0.6);
}
.summary{
padding:8px 8px;
}
.summary .title{
font-size:calc(var(--font-size-regular) + 2px);
margin-bottom: 6px;
word-break: break-all;
}
.endpoint-head .method{
padding:2px 5px;
vertical-align: middle;
font-size:var(--font-size-small);
height: calc(var(--font-size-small) + 16px);
line-height: calc(var(--font-size-small) + 8px);
width: 60px;
border-radius: 2px;
display:inline-block;
text-align: center;
font-weight: bold;
text-transform:uppercase;
margin-right:5px;
}
.endpoint-head .method.delete{ border: 2px solid var(--red);}
.endpoint-head .method.put{ border: 2px solid var(--orange); }
.endpoint-head .method.post{ border: 2px solid var(--green); }
.endpoint-head .method.get{ border: 2px solid var(--blue); }
.endpoint-head .method.get.deprecated{ border: 2px solid var(--border-color); }
.endpoint-head .method.head,
.endpoint-head .method.patch,
.endpoint-head .method.options {
border: 2px solid var(--yellow);
}
.req-resp-container {
display: flex;
margin-top:16px;
align-items: stretch;
flex-wrap: wrap;
flex-direction: column;
border-top:1px solid var(--light-border-color);
}
.view-mode-request,
api-response.view-mode {
flex:1;
min-height:100px;
padding:16px 8px;
overflow:hidden;
}
.view-mode-request {
border-width:0 0 1px 0;
border-style:dashed;
}
.head .view-mode-request,
.patch .view-mode-request,
.options .view-mode-request {
border-color:var(--yellow);
}
.put .view-mode-request {
border-color:var(--orange);
}
.post .view-mode-request {
border-color:var(--green);
}
.get .view-mode-request {
border-color:var(--blue);
}
.delete .view-mode-request {
border-color:var(--red);
}
@media only screen and (min-width: 1024px) {
.only-large-screen { display:block; }
.endpoint-head .path{
font-size: var(--font-size-regular);
}
.endpoint-head .descr{
display: flex;
}
.endpoint-head .m-markdown-small,
.descr .m-markdown-small{
display:block;
}
.req-resp-container{
flex-direction: var(--layout, row);
flex-wrap: nowrap;
}
api-response.view-mode {
padding:16px;
}
.view-mode-request.row-layout {
border-width:0 1px 0 0;
padding:16px;
}
.summary{
padding:8px 16px;
}
}
`);
;// CONCATENATED MODULE: ./src/styles/prism-styles.js
/* harmony default export */ const prism_styles = (i`
code[class*="language-"],
pre[class*="language-"] {
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
tab-size: 2;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
white-space: normal;
}
.token.comment,
.token.block-comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: var(--light-fg)
}
.token.punctuation {
color: var(--fg);
}
.token.tag,
.token.attr-name,
.token.namespace,
.token.deleted {
color:var(--pink);
}
.token.function-name {
color: var(--blue);
}
.token.boolean,
.token.number,
.token.function {
color: var(--red);
}
.token.property,
.token.class-name,
.token.constant,
.token.symbol {
color: var(--code-property-color);
}
.token.selector,
.token.important,
.token.atrule,
.token.keyword,
.token.builtin {
color: var(--code-keyword-color);
}
.token.string,
.token.char,
.token.attr-value,
.token.regex,
.token.variable {
color: var(--green);
}
.token.operator,
.token.entity,
.token.url {
color: var(--code-operator-color);
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
.token.inserted {
color: green;
}
`);
;// CONCATENATED MODULE: ./src/styles/tab-styles.js
/* harmony default export */ const tab_styles = (i`
.tab-panel {
border: none;
}
.tab-buttons {
height:30px;
padding: 4px 4px 0 4px;
border-bottom: 1px solid var(--light-border-color) ;
align-items: stretch;
overflow-y: hidden;
overflow-x: auto;
scrollbar-width: thin;
}
.tab-buttons::-webkit-scrollbar {
height: 1px;
background-color: var(--border-color);
}
.tab-btn {
border: none;
border-bottom: 3px solid transparent;
color: var(--light-fg);
background-color: transparent;
white-space: nowrap;
cursor:pointer;
outline:none;
font-family:var(--font-regular);
font-size:var(--font-size-small);
margin-right:16px;
padding:1px;
}
.tab-btn.active {
border-bottom: 3px solid var(--primary-color);
font-weight:bold;
color:var(--primary-color);
}
.tab-btn:hover {
color:var(--primary-color);
}
.tab-content {
margin:-1px 0 0 0;
position:relative;
min-height: 50px;
}
`);
;// CONCATENATED MODULE: ./src/styles/nav-styles.js
/* harmony default export */ const nav_styles = (i`
.nav-bar-info:focus-visible,
.nav-bar-tag:focus-visible,
.nav-bar-path:focus-visible {
outline: 1px solid;
box-shadow: none;
outline-offset: -4px;
}
.nav-bar-expand-all:focus-visible,
.nav-bar-collapse-all:focus-visible,
.nav-bar-tag-icon:focus-visible {
outline: 1px solid;
box-shadow: none;
outline-offset: 2px;
}
.nav-bar {
width:0;
height:100%;
overflow: hidden;
color:var(--nav-text-color);
background-color: var(--nav-bg-color);
background-blend-mode: multiply;
line-height: calc(var(--font-size-small) + 4px);
display:none;
position:relative;
flex-direction:column;
flex-wrap:nowrap;
word-break:break-word;
}
::slotted([slot=nav-logo]){
padding:16px 16px 0 16px;
}
.nav-scroll {
overflow-x: hidden;
overflow-y: auto;
overflow-y: overlay;
scrollbar-width: thin;
scrollbar-color: var(--nav-hover-bg-color) transparent;
}
.nav-bar-tag {
display: flex;
align-items: center;
justify-content: space-between;
flex-direction: row;
}
.nav-bar.read .nav-bar-tag-icon {
display:none;
}
.nav-bar-paths-under-tag {
overflow:hidden;
transition: max-height .2s ease-out, visibility .3s;
}
.collapsed .nav-bar-paths-under-tag {
visibility: hidden;
}
.nav-bar-expand-all {
transform: rotate(90deg);
cursor:pointer;
margin-right:10px;
}
.nav-bar-collapse-all {
transform: rotate(270deg);
cursor:pointer;
}
.nav-bar-expand-all:hover, .nav-bar-collapse-all:hover {
color: var(--primary-color);
}
.nav-bar-tag-icon {
color: var(--nav-text-color);
font-size: 20px;
}
.nav-bar-tag-icon:hover {
color:var(--nav-hover-text-color);
}
.nav-bar.focused .nav-bar-tag-and-paths.collapsed .nav-bar-tag-icon::after {
content: '⌵';
width:16px;
height:16px;
text-align: center;
display: inline-block;
transform: rotate(-90deg);
transition: transform 0.2s ease-out 0s;
}
.nav-bar.focused .nav-bar-tag-and-paths.expanded .nav-bar-tag-icon::after {
content: '⌵';
width:16px;
height:16px;
text-align: center;
display: inline-block;
transition: transform 0.2s ease-out 0s;
}
.nav-scroll::-webkit-scrollbar {
width: var(--scroll-bar-width, 8px);
}
.nav-scroll::-webkit-scrollbar-track {
background:transparent;
}
.nav-scroll::-webkit-scrollbar-thumb {
background-color: var(--nav-hover-bg-color);
}
.nav-bar-tag {
font-size: var(--font-size-regular);
color: var(--nav-accent-color);
border-left:4px solid transparent;
font-weight:bold;
padding: 15px 15px 15px 10px;
text-transform: capitalize;
}
.nav-bar-components,
.nav-bar-h1,
.nav-bar-h2,
.nav-bar-info,
.nav-bar-tag,
.nav-bar-path {
display:flex;
cursor: pointer;
width: 100%;
border: none;
border-radius:4px;
color: var(--nav-text-color);
background: transparent;
border-left:4px solid transparent;
}
.nav-bar-h1,
.nav-bar-h2,
.nav-bar-path {
font-size: calc(var(--font-size-small) + 1px);
padding: var(--nav-item-padding);
}
.nav-bar-path.small-font {
font-size: var(--font-size-small);
}
.nav-bar-info {
font-size: var(--font-size-regular);
padding: 16px 10px;
font-weight:bold;
}
.nav-bar-section {
display: flex;
flex-direction: row;
justify-content: space-between;
font-size: var(--font-size-small);
color: var(--nav-text-color);
padding: var(--nav-item-padding);
font-weight:bold;
}
.nav-bar-section.operations {
cursor:pointer;
}
.nav-bar-section.operations:hover {
color:var(--nav-hover-text-color);
background-color:var(--nav-hover-bg-color);
}
.nav-bar-section:first-child {
display: none;
}
.nav-bar-h2 {margin-left:12px;}
.nav-bar-h1.left-bar.active,
.nav-bar-h2.left-bar.active,
.nav-bar-info.left-bar.active,
.nav-bar-tag.left-bar.active,
.nav-bar-path.left-bar.active,
.nav-bar-section.left-bar.operations.active {
border-left:4px solid var(--nav-accent-color);
color:var(--nav-hover-text-color);
}
.nav-bar-h1.colored-block.active,
.nav-bar-h2.colored-block.active,
.nav-bar-info.colored-block.active,
.nav-bar-tag.colored-block.active,
.nav-bar-path.colored-block.active,
.nav-bar-section.colored-block.operations.active {
background-color: var(--nav-accent-color);
color: var(--nav-accent-text-color);
border-radius: 0;
}
.nav-bar-h1:hover,
.nav-bar-h2:hover,
.nav-bar-info:hover,
.nav-bar-tag:hover,
.nav-bar-path:hover {
color:var(--nav-hover-text-color);
background-color:var(--nav-hover-bg-color);
}
`);
;// CONCATENATED MODULE: ./src/styles/info-styles.js
/* harmony default export */ const info_styles = (i`
#api-info {
font-size: calc(var(--font-size-regular) - 1px);
margin-top: 8px;
margin-left: -15px;
}
#api-info span:before {
content: "|";
display: inline-block;
opacity: 0.5;
width: 15px;
text-align: center;
}
#api-info span:first-child:before {
content: "";
width: 0px;
}
`);
;// CONCATENATED MODULE: ./src/styles/custom-styles.js
/*
This file is reserved for any custom css that developers want to add to
customize their theme. Simply add your css to this file and yarn build.
*/
/* harmony default export */ const custom_styles = (i`
`);
;// CONCATENATED MODULE: ./src/utils/common-utils.js
/* For Delayed Event Handler Execution */
function debounce(fn, delay) {
let timeoutID = null;
return (...args) => {
clearTimeout(timeoutID);
const that = this;
timeoutID = setTimeout(() => {
fn.apply(that, args);
}, delay);
};
}
const invalidCharsRegEx = /[\s#:?&={}]/g; // used for generating valid html element ids by replacing the invalid chars with hyphen (-)
const rapidocApiKey = '_rapidoc_api_key';
function sleep(ms) {
// eslint-disable-next-line no-promise-executor-return
return new Promise(resolve => setTimeout(resolve, ms));
}
function copyToClipboard(data, e) {
const btnEl = e.target;
const textArea = document.createElement('textarea');
textArea.value = data;
textArea.style.position = 'fixed'; // avoid scrolling to bottom
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
document.execCommand('copy');
btnEl.innerText = 'Copied';
setTimeout(() => {
btnEl.innerText = 'Copy';
}, 5000);
} catch (err) {
console.error('Unable to copy', err); // eslint-disable-line no-console
}
document.body.removeChild(textArea);
}
function getBaseUrlFromUrl(url) {
const pathArray = url.split('/');
return `${pathArray[0]}//${pathArray[2]}`;
}
async function wait(ms) {
return new Promise(resolve => {
setTimeout(resolve, ms);
});
}
function componentIsInSearch(searchVal, component) {
return component.name.toLowerCase().includes(searchVal.toLowerCase());
}
function pathIsInSearch(searchVal, path, matchType = 'includes') {
if (matchType === 'includes') {
const stringToSearch = `${path.method} ${path.path} ${path.summary || path.description || ''} ${path.operationId || ''}`.toLowerCase();
return stringToSearch.includes(searchVal.toLowerCase());
}
const regex = new RegExp(searchVal, 'i');
return regex.test(`${path.method} ${path.path}`);
}
function schemaKeys(schemaProps, result = new Set()) {
if (!schemaProps) {
return result;
}
Object.keys(schemaProps).forEach(key => {
var _schemaProps$key$item;
result.add(key);
if (schemaProps[key].properties) {
schemaKeys(schemaProps[key].properties, result);
} else if ((_schemaProps$key$item = schemaProps[key].items) !== null && _schemaProps$key$item !== void 0 && _schemaProps$key$item.properties) {
var _schemaProps$key$item2;
schemaKeys((_schemaProps$key$item2 = schemaProps[key].items) === null || _schemaProps$key$item2 === void 0 ? void 0 : _schemaProps$key$item2.properties, result);
}
});
return result;
}
function advancedSearch(searchVal, allSpecTags, searchOptions = []) {
if (!searchVal.trim() || searchOptions.length === 0) {
return;
}
const pathsMatched = [];
allSpecTags.forEach(tag => {
tag.paths.forEach(path => {
let stringToSearch = '';
if (searchOptions.includes('search-api-path')) {
stringToSearch = path.path;
}
if (searchOptions.includes('search-api-descr')) {
stringToSearch = `${stringToSearch} ${path.summary || path.description || ''}`;
}
if (searchOptions.includes('search-api-params')) {
var _path$parameters;
stringToSearch = `${stringToSearch} ${((_path$parameters = path.parameters) === null || _path$parameters === void 0 ? void 0 : _path$parameters.map(v => v.name).join(' ')) || ''}`;
}
if (searchOptions.includes('search-api-request-body') && path.requestBody) {
let schemaKeySet = new Set();
for (const contentType in (_path$requestBody = path.requestBody) === null || _path$requestBody === void 0 ? void 0 : _path$requestBody.content) {
var _path$requestBody, _path$requestBody$con;
if ((_path$requestBody$con = path.requestBody.content[contentType].schema) !== null && _path$requestBody$con !== void 0 && _path$requestBody$con.properties) {
var _path$requestBody$con2;
schemaKeySet = schemaKeys((_path$requestBody$con2 = path.requestBody.content[contentType].schema) === null || _path$requestBody$con2 === void 0 ? void 0 : _path$requestBody$con2.properties);
}
stringToSearch = `${stringToSearch} ${[...schemaKeySet].join(' ')}`;
}
}
if (searchOptions.includes('search-api-resp-descr')) {
stringToSearch = `${stringToSearch} ${Object.values(path.responses).map(v => v.description || '').join(' ')}`;
}
if (stringToSearch.toLowerCase().includes(searchVal.trim().toLowerCase())) {
pathsMatched.push({
elementId: path.elementId,
method: path.method,
path: path.path,
summary: path.summary || path.description || '',
deprecated: path.deprecated
});
}
});
});
return pathsMatched;
}
/*
export function prettyXml(sourceXmlString) {
const xmlDoc = new DOMParser().parseFromString(sourceXmlString, 'text/xml');
const xsltDoc = new DOMParser().parseFromString([
// describes how we want to modify the XML - indent everything
`<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:strip-space elements="*"/>
<xsl:template match="para[content-style][not(text())]">
<xsl:value-of select="normalize-space(.)"/>
</xsl:template>
<xsl:template match="node()|@*">
<xsl:copy><xsl:apply-templates select="node()|@*"/></xsl:copy>
</xsl:template>
<xsl:output indent="yes"/>
</xsl:stylesheet>`,
].join('\n'), 'application/xml');
const xsltProcessor = new XSLTProcessor();
xsltProcessor.importStylesheet(xsltDoc);
const resultDoc = xsltProcessor.transformToDocument(xmlDoc);
return new XMLSerializer().serializeToString(resultDoc);
}
*/
function downloadResource(url, fileName) {
if (url) {
const a = document.createElement('a');
document.body.appendChild(a);
a.style = 'display: none';
a.href = url;
a.download = fileName;
a.click();
a.remove();
}
}
function viewResource(url) {
if (url) {
const a = document.createElement('a');
document.body.appendChild(a);
a.style = 'display: none';
a.href = url;
a.target = '_blank';
a.click();
a.remove();
}
}
;// CONCATENATED MODULE: ./node_modules/@apitools/openapi-parser/dist/openapi-parser.mjs
function openapi_parser_e(e){return e&&e.t&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function openapi_parser_t(e){if(e.t)return e;var t=e.default;if("function"==typeof t){var n=function e(){if(this instanceof e){var n=[null];n.push.apply(n,arguments);var r=Function.bind.apply(t,n);return new r}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"t",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var openapi_parser_n=function(e){return e&&e.Math==Math&&e},openapi_parser_r=openapi_parser_n("object"==typeof globalThis&&globalThis)||openapi_parser_n("object"==typeof window&&window)||openapi_parser_n("object"==typeof self&&self)||openapi_parser_n("object"==typeof openapi_parser_r&&openapi_parser_r)||function(){return this}()||globalThis||Function("return this")(),openapi_parser_i=function(e){try{return!!e()}catch(e){return!0}},openapi_parser_s=!openapi_parser_i((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),openapi_parser_o=openapi_parser_s,openapi_parser_c=Function.prototype,openapi_parser_a=openapi_parser_c.apply,openapi_parser_u=openapi_parser_c.call,openapi_parser_f="object"==typeof Reflect&&Reflect.apply||(openapi_parser_o?openapi_parser_u.bind(openapi_parser_a):function(){return openapi_parser_u.apply(openapi_parser_a,arguments)}),openapi_parser_l=openapi_parser_s,openapi_parser_h=Function.prototype,openapi_parser_p=openapi_parser_h.call,openapi_parser_m=openapi_parser_l&&openapi_parser_h.bind.bind(openapi_parser_p,openapi_parser_p),openapi_parser_d=openapi_parser_l?openapi_parser_m:function(e){return function(){return openapi_parser_p.apply(e,arguments)}},openapi_parser_v=openapi_parser_d,openapi_parser_y=openapi_parser_v({}.toString),openapi_parser_b=openapi_parser_v("".slice),openapi_parser_j=function(e){return openapi_parser_b(openapi_parser_y(e),8,-1)},openapi_parser_g=openapi_parser_j,openapi_parser_w=openapi_parser_d,O=function(e){if("Function"===openapi_parser_g(e))return openapi_parser_w(e)},openapi_parser_E="object"==typeof document&&document.all,x={all:openapi_parser_E,IS_HTMLDDA:void 0===openapi_parser_E&&void 0!==openapi_parser_E},openapi_parser_S=x.all,openapi_parser_P=x.IS_HTMLDDA?function(e){return"function"==typeof e||e===openapi_parser_S}:function(e){return"function"==typeof e},openapi_parser_$={},openapi_parser_A=!openapi_parser_i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),openapi_parser_T=openapi_parser_s,openapi_parser_R=Function.prototype.call,openapi_parser_I=openapi_parser_T?openapi_parser_R.bind(openapi_parser_R):function(){return openapi_parser_R.apply(openapi_parser_R,arguments)},openapi_parser_k={},F={}.propertyIsEnumerable,openapi_parser_M=Object.getOwnPropertyDescriptor,openapi_parser_N=openapi_parser_M&&!F.call({1:2},1);openapi_parser_k.f=openapi_parser_N?function(e){var t=openapi_parser_M(this,e);return!!t&&t.enumerable}:F;var openapi_parser_C,D,q=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},openapi_parser_=openapi_parser_i,openapi_parser_B=openapi_parser_j,openapi_parser_L=Object,U=openapi_parser_d("".split),J=openapi_parser_((function(){return!openapi_parser_L("z").propertyIsEnumerable(0)}))?function(e){return"String"==openapi_parser_B(e)?U(e,""):openapi_parser_L(e)}:openapi_parser_L,openapi_parser_V=function(e){return null==e},G=openapi_parser_V,openapi_parser_z=TypeError,openapi_parser_H=function(e){if(G(e))throw openapi_parser_z("Can't call method on "+e);return e},W=J,X=openapi_parser_H,Y=function(e){return W(X(e))},K=openapi_parser_P,Q=x.all,openapi_parser_Z=x.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:K(e)||e===Q}:function(e){return"object"==typeof e?null!==e:K(e)},ee={},te=ee,ne=openapi_parser_r,re=openapi_parser_P,ie=function(e){return re(e)?e:void 0},se=function(e,t){return arguments.length<2?ie(te[e])||ie(ne[e]):te[e]&&te[e][t]||ne[e]&&ne[e][t]},oe=openapi_parser_d({}.isPrototypeOf),ce=openapi_parser_r,ae="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ue=ce.process,fe=ce.Deno,le=ue&&ue.versions||fe&&fe.version,he=le&&le.v8;he&&(D=(openapi_parser_C=he.split("."))[0]>0&&openapi_parser_C[0]<4?1:+(openapi_parser_C[0]+openapi_parser_C[1])),!D&&ae&&(!(openapi_parser_C=ae.match(/Edge\/(\d+)/))||openapi_parser_C[1]>=74)&&(openapi_parser_C=ae.match(/Chrome\/(\d+)/))&&(D=+openapi_parser_C[1]);var pe=D,me=pe,de=openapi_parser_i,ve=openapi_parser_r.String,ye=!!Object.getOwnPropertySymbols&&!de((function(){var e=Symbol();return!ve(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&me&&me<41})),be=ye&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,je=se,ge=openapi_parser_P,we=oe,Oe=Object,Ee=be?function(e){return"symbol"==typeof e}:function(e){var t=je("Symbol");return ge(t)&&we(t.prototype,Oe(e))},xe=String,Se=function(e){try{return xe(e)}catch(e){return"Object"}},Pe=openapi_parser_P,$e=Se,Ae=TypeError,Te=function(e){if(Pe(e))return e;throw Ae($e(e)+" is not a function")},Re=Te,Ie=openapi_parser_V,ke=openapi_parser_I,Fe=openapi_parser_P,Me=openapi_parser_Z,Ne=TypeError,Ce={exports:{}},De=openapi_parser_r,qe=Object.defineProperty,_e=function(e,t){try{qe(De,e,{value:t,configurable:!0,writable:!0})}catch(n){De[e]=t}return t},Be=openapi_parser_r["u"]||_e("__core-js_shared__",{}),Le=Be;(Ce.exports=function(e,t){return Le[e]||(Le[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Ue=Ce.exports,Je=openapi_parser_H,Ve=Object,Ge=function(e){return Ve(Je(e))},ze=Ge,He=openapi_parser_d({}.hasOwnProperty),We=Object.hasOwn||function(e,t){return He(ze(e),t)},Xe=openapi_parser_d,Ye=0,Ke=Math.random(),Qe=Xe(1..toString),Ze=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Qe(++Ye+Ke,36)},et=Ue,tt=We,nt=Ze,rt=ye,it=be,st=openapi_parser_r.Symbol,ot=et("wks"),ct=it?st.for||st:st&&st.withoutSetter||nt,at=function(e){return tt(ot,e)||(ot[e]=rt&&tt(st,e)?st[e]:ct("Symbol."+e)),ot[e]},ut=openapi_parser_I,ft=openapi_parser_Z,lt=Ee,ht=function(e,t){var n=e[t];return Ie(n)?void 0:Re(n)},pt=function(e,t){var n,r;if("string"===t&&Fe(n=e.toString)&&!Me(r=ke(n,e)))return r;if(Fe(n=e.valueOf)&&!Me(r=ke(n,e)))return r;if("string"!==t&&Fe(n=e.toString)&&!Me(r=ke(n,e)))return r;throw Ne("Can't convert object to primitive value")},mt=TypeError,dt=at("toPrimitive"),vt=function(e,t){if(!ft(e)||lt(e))return e;var n,r=ht(e,dt);if(r){if(void 0===t&&(t="default"),n=ut(r,e,t),!ft(n)||lt(n))return n;throw mt("Can't convert object to primitive value")}return void 0===t&&(t="number"),pt(e,t)},yt=Ee,bt=function(e){var t=vt(e,"string");return yt(t)?t:t+""},jt=openapi_parser_Z,gt=openapi_parser_r.document,wt=jt(gt)&&jt(gt.createElement),Ot=function(e){return wt?gt.createElement(e):{}},Et=Ot,xt=!openapi_parser_A&&!openapi_parser_i((function(){return 7!=Object.defineProperty(Et("div"),"a",{get:function(){return 7}}).a})),St=openapi_parser_A,Pt=openapi_parser_I,$t=openapi_parser_k,At=q,Tt=Y,Rt=bt,It=We,kt=xt,Ft=Object.getOwnPropertyDescriptor;openapi_parser_$.f=St?Ft:function(e,t){if(e=Tt(e),t=Rt(t),kt)try{return Ft(e,t)}catch(e){}if(It(e,t))return At(!Pt($t.f,e,t),e[t])};var Mt=openapi_parser_i,Nt=openapi_parser_P,Ct=/#|\.prototype\./,Dt=function(e,t){var n=_t[qt(e)];return n==Lt||n!=Bt&&(Nt(t)?Mt(t):!!t)},qt=Dt.normalize=function(e){return String(e).replace(Ct,".").toLowerCase()},_t=Dt.data={},Bt=Dt.NATIVE="N",Lt=Dt.POLYFILL="P",Ut=Dt,Jt=Te,Vt=openapi_parser_s,Gt=O(O.bind),zt=function(e,t){return Jt(e),void 0===t?e:Vt?Gt(e,t):function(){return e.apply(t,arguments)}},Ht={},Wt=openapi_parser_A&&openapi_parser_i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Xt=openapi_parser_Z,Yt=String,Kt=TypeError,Qt=function(e){if(Xt(e))return e;throw Kt(Yt(e)+" is not an object")},Zt=openapi_parser_A,en=xt,tn=Wt,nn=Qt,rn=bt,sn=TypeError,on=Object.defineProperty,cn=Object.getOwnPropertyDescriptor;Ht.f=Zt?tn?function(e,t,n){if(nn(e),t=rn(t),nn(n),"function"==typeof e&&"prototype"===t&&"value"in n&&"writable"in n&&!n.writable){var r=cn(e,t);r&&r.writable&&(e[t]=n.value,n={configurable:"configurable"in n?n.configurable:r.configurable,enumerable:"enumerable"in n?n.enumerable:r.enumerable,writable:!1})}return on(e,t,n)}:on:function(e,t,n){if(nn(e),t=rn(t),nn(n),en)try{return on(e,t,n)}catch(e){}if("get"in n||"set"in n)throw sn("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var an=Ht,un=q,fn=openapi_parser_A?function(e,t,n){return an.f(e,t,un(1,n))}:function(e,t,n){return e[t]=n,e},ln=openapi_parser_r,hn=openapi_parser_f,pn=O,mn=openapi_parser_P,dn=openapi_parser_$.f,vn=Ut,yn=ee,bn=zt,jn=fn,gn=We,wn=function(e){var t=function(n,r,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,i)}return hn(e,this,arguments)};return t.prototype=e.prototype,t},On=function(e,t){var n,r,i,s,o,c,a,u,f,l=e.target,h=e.global,p=e.stat,m=e.proto,d=h?ln:p?ln[l]:(ln[l]||{}).prototype,v=h?yn:yn[l]||jn(yn,l,{})[l],y=v.prototype;for(s in t)r=!(n=vn(h?s:l+(p?".":"#")+s,e.forced))&&d&&gn(d,s),c=v[s],r&&(a=e.dontCallGetSet?(f=dn(d,s))&&f.value:d[s]),o=r&&a?a:t[s],r&&typeof c==typeof o||(u=e.bind&&r?bn(o,ln):e.wrap&&r?wn(o):m&&mn(o)?pn(o):o,(e.sham||o&&o.sham||c&&c.sham)&&jn(u,"sham",!0),jn(v,s,u),m&&(gn(yn,i=l+"Prototype")||jn(yn,i,{}),jn(yn[i],s,o),e.real&&y&&(n||!y[s])&&jn(y,s,o)))},En=Math.ceil,xn=Math.floor,Sn=Math.trunc||function(e){var t=+e;return(t>0?xn:En)(t)},Pn=function(e){var t=+e;return t!=t||0===t?0:Sn(t)},$n=Pn,An=Math.max,Tn=Math.min,Rn=function(e,t){var n=$n(e);return n<0?An(n+t,0):Tn(n,t)},In=Pn,kn=Math.min,Fn=function(e){return e>0?kn(In(e),9007199254740991):0},Mn=function(e){return Fn(e.length)},Nn=Y,Cn=Rn,Dn=Mn,qn=function(e){return function(t,n,r){var i,s=Nn(t),o=Dn(s),c=Cn(r,o);if(e&&n!=n){for(;o>c;)if((i=s[c++])!=i)return!0}else for(;o>c;c++)if((e||c in s)&&s[c]===n)return e||c||0;return!e&&-1}},_n={includes:qn(!0),indexOf:qn(!1)},Bn={},Ln=We,Un=Y,Jn=_n.indexOf,Vn=Bn,Gn=openapi_parser_d([].push),zn=function(e,t){var n,r=Un(e),i=0,s=[];for(n in r)!Ln(Vn,n)&&Ln(r,n)&&Gn(s,n);for(;t.length>i;)Ln(r,n=t[i++])&&(~Jn(s,n)||Gn(s,n));return s},Hn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Wn=zn,Xn=Hn,Yn=Object.keys||function(e){return Wn(e,Xn)},Kn=Ge,Qn=Yn;On({target:"Object",stat:!0,forced:openapi_parser_i((function(){Qn(1)}))},{keys:function(e){return Qn(Kn(e))}});const Zn=openapi_parser_e(ee.Object.keys);var er={};er[at("toStringTag")]="z";var tr="[object z]"===String(er),nr=tr,rr=openapi_parser_P,ir=openapi_parser_j,sr=at("toStringTag"),or=Object,cr="Arguments"==ir(function(){return arguments}()),ar=nr?ir:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=or(e),sr))?n:cr?ir(t):"Object"==(r=ir(t))&&rr(t.callee)?"Arguments":r},ur=ar,fr=String,lr=function(e){if("Symbol"===ur(e))throw TypeError("Cannot convert a Symbol value to a string");return fr(e)},hr={},pr=openapi_parser_A,mr=Wt,dr=Ht,vr=Qt,yr=Y,br=Yn;hr.f=pr&&!mr?Object.defineProperties:function(e,t){vr(e);for(var n,r=yr(t),i=br(t),s=i.length,o=0;s>o;)dr.f(e,n=i[o++],r[n]);return e};var jr,gr=se("document","documentElement"),wr=Ze,Or=Ue("keys"),Er=function(e){return Or[e]||(Or[e]=wr(e))},xr=Qt,Sr=hr,Pr=Hn,$r=Bn,Ar=gr,Tr=Ot,Rr=Er("IE_PROTO"),Ir=function(){},kr=function(e){return"<script>"+e+"<\/script>"},Fr=function(e){e.write(kr("")),e.close();var t=e.parentWindow.Object;return e=null,t},Mr=function(){try{jr=new ActiveXObject("htmlfile")}catch(e){}var e,t;Mr="undefined"!=typeof document?document.domain&&jr?Fr(jr):((t=Tr("iframe")).style.display="none",Ar.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(kr("document.F=Object")),e.close(),e.F):Fr(jr);for(var n=Pr.length;n--;)delete Mr.prototype[Pr[n]];return Mr()};$r[Rr]=!0;var Nr=Object.create||function(e,t){var n;return null!==e?(Ir.prototype=xr(e),n=new Ir,Ir.prototype=null,n[Rr]=e):n=Mr(),void 0===t?n:Sr.f(n,t)},Cr={},Dr=zn,qr=Hn.concat("length","prototype");Cr.f=Object.getOwnPropertyNames||function(e){return Dr(e,qr)};var _r={},Br=bt,Lr=Ht,Ur=q,Jr=function(e,t,n){var r=Br(t);r in e?Lr.f(e,r,Ur(0,n)):e[r]=n},Vr=Rn,Gr=Mn,zr=Jr,Hr=Array,Wr=Math.max,Xr=openapi_parser_j,Yr=Y,Kr=Cr.f,Qr=function(e,t,n){for(var r=Gr(e),i=Vr(t,r),s=Vr(void 0===n?r:n,r),o=Hr(Wr(s-i,0)),c=0;i<s;i++,c++)zr(o,c,e[i]);return o.length=c,o},Zr="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];_r.f=function(e){return Zr&&"Window"==Xr(e)?function(e){try{return Kr(e)}catch(e){return Qr(Zr)}}(e):Kr(Yr(e))};var ei={};ei.f=Object.getOwnPropertySymbols;var ti=fn,ni=function(e,t,n,r){return r&&r.enumerable?e[t]=n:ti(e,t,n),e},ri=Ht,ii={},si=at;ii.f=si;var oi,ci,ai,ui=ee,fi=We,li=ii,hi=Ht.f,pi=function(e){var t=ui.Symbol||(ui.Symbol={});fi(t,e)||hi(t,e,{value:li.f(e)})},mi=openapi_parser_I,di=se,vi=at,yi=ni,bi=function(){var e=di("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,r=vi("toPrimitive");t&&!t[r]&&yi(t,r,(function(e){return mi(n,this)}),{arity:1})},ji=ar,gi=tr?{}.toString:function(){return"[object "+ji(this)+"]"},wi=tr,Oi=Ht.f,Ei=fn,xi=We,Si=gi,Pi=at("toStringTag"),$i=function(e,t,n,r){if(e){var i=n?e:e.prototype;xi(i,Pi)||Oi(i,Pi,{configurable:!0,value:t}),r&&!wi&&Ei(i,"toString",Si)}},Ai=openapi_parser_P,Ti=openapi_parser_r.WeakMap,Ri=Ai(Ti)&&/native code/.test(String(Ti)),Ii=openapi_parser_r,ki=openapi_parser_Z,Fi=fn,Mi=We,Ni=Be,Ci=Er,Di=Bn,qi=Ii.TypeError,_i=Ii.WeakMap;if(Ri||Ni.state){var Bi=Ni.state||(Ni.state=new _i);Bi.get=Bi.get,Bi.has=Bi.has,Bi.set=Bi.set,oi=function(e,t){if(Bi.has(e))throw qi("Object already initialized");return t.facade=e,Bi.set(e,t),t},ci=function(e){return Bi.get(e)||{}},ai=function(e){return Bi.has(e)}}else{var Li=Ci("state");Di[Li]=!0,oi=function(e,t){if(Mi(e,Li))throw qi("Object already initialized");return t.facade=e,Fi(e,Li,t),t},ci=function(e){return Mi(e,Li)?e[Li]:{}},ai=function(e){return Mi(e,Li)}}var Ui={set:oi,get:ci,has:ai,enforce:function(e){return ai(e)?ci(e):oi(e,{})},getterFor:function(e){return function(t){var n;if(!ki(t)||(n=ci(t)).type!==e)throw qi("Incompatible receiver, "+e+" required");return n}}},Ji=openapi_parser_j,Vi=Array.isArray||function(e){return"Array"==Ji(e)},Gi=openapi_parser_P,zi=Be,Hi=openapi_parser_d(Function.toString);Gi(zi.inspectSource)||(zi.inspectSource=function(e){return Hi(e)});var Wi=zi.inspectSource,Xi=openapi_parser_d,Yi=openapi_parser_i,Ki=openapi_parser_P,Qi=ar,Zi=Wi,es=function(){},ts=[],ns=se("Reflect","construct"),rs=/^\s*(?:class|function)\b/,is=Xi(rs.exec),ss=!rs.exec(es),os=function(e){if(!Ki(e))return!1;try{return ns(es,ts,e),!0}catch(e){return!1}},cs=function(e){if(!Ki(e))return!1;switch(Qi(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return ss||!!is(rs,Zi(e))}catch(e){return!0}};cs.sham=!0;var as=!ns||Yi((function(){var e;return os(os.call)||!os(Object)||!os((function(){e=!0}))||e}))?cs:os,us=Vi,fs=as,ls=openapi_parser_Z,hs=at("species"),ps=Array,ms=function(e){var t;return us(e)&&(t=e.constructor,(fs(t)&&(t===ps||us(t.prototype))||ls(t)&&null===(t=t[hs]))&&(t=void 0)),void 0===t?ps:t},ds=function(e,t){return new(ms(e))(0===t?0:t)},vs=zt,ys=J,bs=Ge,js=Mn,gs=ds,ws=openapi_parser_d([].push),Os=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,s=6==e,o=7==e,c=5==e||s;return function(a,u,f,l){for(var h,p,m=bs(a),d=ys(m),v=vs(u,f),y=js(d),b=0,j=l||gs,g=t?j(a,y):n||o?j(a,0):void 0;y>b;b++)if((c||b in d)&&(p=v(h=d[b],b,m),e))if(t)g[b]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return b;case 2:ws(g,h)}else switch(e){case 4:return!1;case 7:ws(g,h)}return s?-1:r||i?i:g}},Es={forEach:Os(0),map:Os(1),filter:Os(2),some:Os(3),every:Os(4),find:Os(5),findIndex:Os(6),filterReject:Os(7)},xs=On,Ss=openapi_parser_r,Ps=openapi_parser_I,$s=openapi_parser_d,As=openapi_parser_A,Ts=ye,Rs=openapi_parser_i,Is=We,ks=oe,Fs=Qt,Ms=Y,Ns=bt,Cs=lr,Ds=q,qs=Nr,_s=Yn,Bs=Cr,Ls=_r,Us=ei,Js=openapi_parser_$,Vs=Ht,Gs=hr,zs=openapi_parser_k,Hs=ni,Ws=function(e,t,n){return ri.f(e,t,n)},Xs=Ue,Ys=Bn,Ks=Ze,Qs=at,Zs=ii,eo=pi,to=bi,no=$i,ro=Ui,io=Es.forEach,so=Er("hidden"),oo=ro.set,co=ro.getterFor("Symbol"),ao=Object.prototype,uo=Ss.Symbol,fo=uo&&uo.prototype,lo=Ss.TypeError,ho=Ss.QObject,po=Js.f,mo=Vs.f,vo=Ls.f,yo=zs.f,bo=$s([].push),jo=Xs("symbols"),go=Xs("op-symbols"),wo=Xs("wks"),Oo=!ho||!ho.prototype||!ho.prototype.findChild,Eo=As&&Rs((function(){return 7!=qs(mo({},"a",{get:function(){return mo(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=po(ao,t);r&&delete ao[t],mo(e,t,n),r&&e!==ao&&mo(ao,t,r)}:mo,xo=function(e,t){var n=jo[e]=qs(fo);return oo(n,{type:"Symbol",tag:e,description:t}),As||(n.description=t),n},So=function(e,t,n){e===ao&&So(go,t,n),Fs(e);var r=Ns(t);return Fs(n),Is(jo,r)?(n.enumerable?(Is(e,so)&&e[so][r]&&(e[so][r]=!1),n=qs(n,{enumerable:Ds(0,!1)})):(Is(e,so)||mo(e,so,Ds(1,{})),e[so][r]=!0),Eo(e,r,n)):mo(e,r,n)},Po=function(e,t){Fs(e);var n=Ms(t),r=_s(n).concat(Ro(n));return io(r,(function(t){As&&!Ps($o,n,t)||So(e,t,n[t])})),e},$o=function(e){var t=Ns(e),n=Ps(yo,this,t);return!(this===ao&&Is(jo,t)&&!Is(go,t))&&(!(n||!Is(this,t)||!Is(jo,t)||Is(this,so)&&this[so][t])||n)},Ao=function(e,t){var n=Ms(e),r=Ns(t);if(n!==ao||!Is(jo,r)||Is(go,r)){var i=po(n,r);return!i||!Is(jo,r)||Is(n,so)&&n[so][r]||(i.enumerable=!0),i}},To=function(e){var t=vo(Ms(e)),n=[];return io(t,(function(e){Is(jo,e)||Is(Ys,e)||bo(n,e)})),n},Ro=function(e){var t=e===ao,n=vo(t?go:Ms(e)),r=[];return io(n,(function(e){!Is(jo,e)||t&&!Is(ao,e)||bo(r,jo[e])})),r};Ts||(Hs(fo=(uo=function(){if(ks(fo,this))throw lo("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?Cs(arguments[0]):void 0,t=Ks(e),n=function(e){this===ao&&Ps(n,go,e),Is(this,so)&&Is(this[so],t)&&(this[so][t]=!1),Eo(this,t,Ds(1,e))};return As&&Oo&&Eo(ao,t,{configurable:!0,set:n}),xo(t,e)}).prototype,"toString",(function(){return co(this).tag})),Hs(uo,"withoutSetter",(function(e){return xo(Ks(e),e)})),zs.f=$o,Vs.f=So,Gs.f=Po,Js.f=Ao,Bs.f=Ls.f=To,Us.f=Ro,Zs.f=function(e){return xo(Qs(e),e)},As&&Ws(fo,"description",{configurable:!0,get:function(){return co(this).description}})),xs({global:!0,constructor:!0,wrap:!0,forced:!Ts,sham:!Ts},{Symbol:uo}),io(_s(wo),(function(e){eo(e)})),xs({target:"Symbol",stat:!0,forced:!Ts},{useSetter:function(){Oo=!0},useSimple:function(){Oo=!1}}),xs({target:"Object",stat:!0,forced:!Ts,sham:!As},{create:function(e,t){return void 0===t?qs(e):Po(qs(e),t)},defineProperty:So,defineProperties:Po,getOwnPropertyDescriptor:Ao}),xs({target:"Object",stat:!0,forced:!Ts},{getOwnPropertyNames:To}),to(),no(uo,"Symbol"),Ys[so]=!0;var Io=ye&&!!Symbol.for&&!!Symbol.keyFor,ko=On,Fo=se,Mo=We,No=lr,Co=Ue,Do=Io,qo=Co("string-to-symbol-registry"),_o=Co("symbol-to-string-registry");ko({target:"Symbol",stat:!0,forced:!Do},{for:function(e){var t=No(e);if(Mo(qo,t))return qo[t];var n=Fo("Symbol")(t);return qo[t]=n,_o[n]=t,n}});var Bo=On,Lo=We,Uo=Ee,Jo=Se,Vo=Io,Go=Ue("symbol-to-string-registry");Bo({target:"Symbol",stat:!0,forced:!Vo},{keyFor:function(e){if(!Uo(e))throw TypeError(Jo(e)+" is not a symbol");if(Lo(Go,e))return Go[e]}});var zo=openapi_parser_d([].slice),Ho=Vi,Wo=openapi_parser_P,Xo=openapi_parser_j,Yo=lr,Ko=openapi_parser_d([].push),Qo=On,Zo=se,ec=openapi_parser_f,tc=openapi_parser_I,nc=openapi_parser_d,rc=openapi_parser_i,ic=openapi_parser_P,sc=Ee,oc=zo,cc=function(e){if(Wo(e))return e;if(Ho(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];"string"==typeof i?Ko(n,i):"number"!=typeof i&&"Number"!=Xo(i)&&"String"!=Xo(i)||Ko(n,Yo(i))}var s=n.length,o=!0;return function(e,t){if(o)return o=!1,t;if(Ho(this))return t;for(var r=0;r<s;r++)if(n[r]===e)return t}}},ac=ye,uc=String,fc=Zo("JSON","stringify"),lc=nc(/./.exec),hc=nc("".charAt),pc=nc("".charCodeAt),mc=nc("".replace),dc=nc(1..toString),vc=/[\uD800-\uDFFF]/g,yc=/^[\uD800-\uDBFF]$/,bc=/^[\uDC00-\uDFFF]$/,jc=!ac||rc((function(){var e=Zo("Symbol")();return"[null]"!=fc([e])||"{}"!=fc({a:e})||"{}"!=fc(Object(e))})),gc=rc((function(){return'"\\udf06\\ud834"'!==fc("\udf06\ud834")||'"\\udead"'!==fc("\udead")})),wc=function(e,t){var n=oc(arguments),r=cc(t);if(ic(r)||void 0!==e&&!sc(e))return n[1]=function(e,t){if(ic(r)&&(t=tc(r,this,uc(e),t)),!sc(t))return t},ec(fc,null,n)},Oc=function(e,t,n){var r=hc(n,t-1),i=hc(n,t+1);return lc(yc,e)&&!lc(bc,i)||lc(bc,e)&&!lc(yc,r)?"\\u"+dc(pc(e,0),16):e};fc&&Qo({target:"JSON",stat:!0,arity:3,forced:jc||gc},{stringify:function(e,t,n){var r=oc(arguments),i=ec(jc?wc:fc,null,r);return gc&&"string"==typeof i?mc(i,vc,Oc):i}});var Ec=ei,xc=Ge;On({target:"Object",stat:!0,forced:!ye||openapi_parser_i((function(){Ec.f(1)}))},{getOwnPropertySymbols:function(e){var t=Ec.f;return t?t(xc(e)):[]}});const Sc=openapi_parser_e(ee.Object.getOwnPropertySymbols);var Pc=openapi_parser_i,$c=pe,Ac=at("species"),Tc=function(e){return $c>=51||!Pc((function(){var t=[];return(t.constructor={})[Ac]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Rc=Es.filter;On({target:"Array",proto:!0,forced:!Tc("filter")},{filter:function(e){return Rc(this,e,arguments.length>1?arguments[1]:void 0)}});var Ic=ee,kc=function(e){return Ic[e+"Prototype"]},Fc=kc("Array").filter,Mc=oe,Nc=Fc,Cc=Array.prototype;const Dc=openapi_parser_e((function(e){var t=e.filter;return e===Cc||Mc(Cc,e)&&t===Cc.filter?Nc:t}));var qc={exports:{}},_c=On,Bc=openapi_parser_i,Lc=Y,Uc=openapi_parser_$.f,Jc=openapi_parser_A;_c({target:"Object",stat:!0,forced:!Jc||Bc((function(){Uc(1)})),sham:!Jc},{getOwnPropertyDescriptor:function(e,t){return Uc(Lc(e),t)}});var Vc=ee.Object,Gc=qc.exports=function(e,t){return Vc.getOwnPropertyDescriptor(e,t)};Vc.getOwnPropertyDescriptor.sham&&(Gc.sham=!0);const zc=openapi_parser_e(qc.exports);var Hc=openapi_parser_A,Wc=Vi,Xc=TypeError,Yc=Object.getOwnPropertyDescriptor,Kc=Hc&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),Qc=TypeError,Zc=function(e){if(e>9007199254740991)throw Qc("Maximum allowed index exceeded");return e},ea=Ge,ta=Mn,na=Kc?function(e,t){if(Wc(e)&&!Yc(e,"length").writable)throw Xc("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},ra=Zc;On({target:"Array",proto:!0,arity:1,forced:openapi_parser_i((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=ea(this),n=ta(t),r=arguments.length;ra(n+r);for(var i=0;i<r;i++)t[n]=arguments[i],n++;return na(t,n),n}});var ia=kc("Array").push,sa=oe,oa=ia,ca=Array.prototype;const aa=openapi_parser_e((function(e){var t=e.push;return e===ca||sa(ca,e)&&t===ca.push?oa:t}));var ua,fa,la,ha={},pa=openapi_parser_A,ma=We,da=Function.prototype,va=pa&&Object.getOwnPropertyDescriptor,ya=ma(da,"name"),ba={EXISTS:ya,PROPER:ya&&"something"===function(){}.name,CONFIGURABLE:ya&&(!pa||pa&&va(da,"name").configurable)},ja=!openapi_parser_i((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),ga=We,wa=openapi_parser_P,Oa=Ge,Ea=ja,xa=Er("IE_PROTO"),Sa=Object,Pa=Sa.prototype,$a=Ea?Sa.getPrototypeOf:function(e){var t=Oa(e);if(ga(t,xa))return t[xa];var n=t.constructor;return wa(n)&&t instanceof n?n.prototype:t instanceof Sa?Pa:null},Aa=openapi_parser_i,Ta=openapi_parser_P,Ra=openapi_parser_Z,Ia=Nr,ka=$a,Fa=ni,Ma=at("iterator"),Na=!1;[].keys&&("next"in(la=[].keys())?(fa=ka(ka(la)))!==Object.prototype&&(ua=fa):Na=!0);var Ca=!Ra(ua)||Aa((function(){var e={};return ua[Ma].call(e)!==e}));Ta((ua=Ca?{}:Ia(ua))[Ma])||Fa(ua,Ma,(function(){return this}));var Da={IteratorPrototype:ua,BUGGY_SAFARI_ITERATORS:Na},qa=Da.IteratorPrototype,_a=Nr,Ba=q,La=$i,Ua=ha,Ja=function(){return this},Va=On,Ga=openapi_parser_I,za=ba,Ha=function(e,t,n,r){var i=t+" Iterator";return e.prototype=_a(qa,{next:Ba(+!r,n)}),La(e,i,!1,!0),Ua[i]=Ja,e},Wa=$a,Xa=$i,Ya=ni,Ka=ha,Qa=Da,Za=za.PROPER,eu=Qa.BUGGY_SAFARI_ITERATORS,tu=at("iterator"),nu=function(){return this},ru=function(e,t,n,r,i,s,o){Ha(n,t,r);var c,a,u,f=function(e){if(e===i&&d)return d;if(!eu&&e in p)return p[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},l=t+" Iterator",h=!1,p=e.prototype,m=p[tu]||p["@@iterator"]||i&&p[i],d=!eu&&m||f(i),v="Array"==t&&p.entries||m;if(v&&(c=Wa(v.call(new e)))!==Object.prototype&&c.next&&(Xa(c,l,!0,!0),Ka[l]=nu),Za&&"values"==i&&m&&"values"!==m.name&&(h=!0,d=function(){return Ga(m,this)}),i)if(a={values:f("values"),keys:s?d:f("keys"),entries:f("entries")},o)for(u in a)(eu||h||!(u in p))&&Ya(p,u,a[u]);else Va({target:t,proto:!0,forced:eu||h},a);return o&&p[tu]!==d&&Ya(p,tu,d,{name:i}),Ka[t]=d,a},iu=function(e,t){return{value:e,done:t}},su=Y,ou=ha,cu=Ui;Ht.f;var au=ru,uu=iu,fu=cu.set,lu=cu.getterFor("Array Iterator");au(Array,"Array",(function(e,t){fu(this,{type:"Array Iterator",target:su(e),index:0,kind:t})}),(function(){var e=lu(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,uu(void 0,!0)):uu("keys"==n?r:"values"==n?t[r]:[r,t[r]],!1)}),"values"),ou.Arguments=ou.Array;var hu={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},pu=openapi_parser_r,mu=ar,du=fn,vu=ha,yu=at("toStringTag");for(var bu in hu){var ju=pu[bu],gu=ju&&ju.prototype;gu&&mu(gu)!==yu&&du(gu,yu,bu),vu[bu]=vu.Array}var wu=openapi_parser_i,Ou=function(e,t){var n=[][e];return!!n&&wu((function(){n.call(null,t||function(){return 1},1)}))},Eu=Es.forEach,xu=Ou("forEach")?[].forEach:function(e){return Eu(this,e,arguments.length>1?arguments[1]:void 0)};On({target:"Array",proto:!0,forced:[].forEach!=xu},{forEach:xu});var Su=kc("Array").forEach,Pu=ar,$u=We,Au=oe,Tu=Su,Ru=Array.prototype,Iu={DOMTokenList:!0,NodeList:!0};const ku=openapi_parser_e((function(e){var t=e.forEach;return e===Ru||Au(Ru,e)&&t===Ru.forEach||$u(Iu,Pu(e))?Tu:t}));var Fu=se,Mu=Cr,Nu=ei,Cu=Qt,Du=openapi_parser_d([].concat),qu=Fu("Reflect","ownKeys")||function(e){var t=Mu.f(Cu(e)),n=Nu.f;return n?Du(t,n(e)):t},_u=qu,Bu=Y,Lu=openapi_parser_$,Uu=Jr;On({target:"Object",stat:!0,sham:!openapi_parser_A},{getOwnPropertyDescriptors:function(e){for(var t,n,r=Bu(e),i=Lu.f,s=_u(r),o={},c=0;s.length>c;)void 0!==(n=i(r,t=s[c++]))&&Uu(o,t,n);return o}});const Ju=openapi_parser_e(ee.Object.getOwnPropertyDescriptors);var Vu={exports:{}},Gu=On,zu=openapi_parser_A,Hu=hr.f;Gu({target:"Object",stat:!0,forced:Object.defineProperties!==Hu,sham:!zu},{defineProperties:Hu});var Wu=ee.Object,Xu=Vu.exports=function(e,t){return Wu.defineProperties(e,t)};Wu.defineProperties.sham&&(Xu.sham=!0);const Yu=openapi_parser_e(Vu.exports);var Ku={exports:{}},Qu=On,Zu=openapi_parser_A,ef=Ht.f;Qu({target:"Object",stat:!0,forced:Object.defineProperty!==ef,sham:!Zu},{defineProperty:ef});var tf=ee.Object,nf=Ku.exports=function(e,t,n){return tf.defineProperty(e,t,n)};tf.defineProperty.sham&&(nf.sham=!0);const rf=openapi_parser_e(Ku.exports);var sf=On,of=openapi_parser_i,cf=Vi,af=openapi_parser_Z,uf=Ge,ff=Mn,lf=Zc,hf=Jr,pf=ds,mf=Tc,df=pe,vf=at("isConcatSpreadable"),yf=df>=51||!of((function(){var e=[];return e[vf]=!1,e.concat()[0]!==e})),bf=function(e){if(!af(e))return!1;var t=e[vf];return void 0!==t?!!t:cf(e)};sf({target:"Array",proto:!0,arity:1,forced:!yf||!mf("concat")},{concat:function(e){var t,n,r,i,s,o=uf(this),c=pf(o,0),a=0;for(t=-1,r=arguments.length;t<r;t++)if(bf(s=-1===t?o:arguments[t]))for(i=ff(s),lf(a+i),n=0;n<i;n++,a++)n in s&&hf(c,a,s[n]);else lf(a+1),hf(c,a++,s);return c.length=a,c}}),pi("asyncIterator"),pi("hasInstance"),pi("isConcatSpreadable"),pi("iterator"),pi("match"),pi("matchAll"),pi("replace"),pi("search"),pi("species"),pi("split");var jf=bi;pi("toPrimitive"),jf();var gf=se,wf=$i;pi("toStringTag"),wf(gf("Symbol"),"Symbol"),pi("unscopables"),$i(openapi_parser_r.JSON,"JSON",!0);var Of=ee.Symbol,Ef=at,xf=Ht.f,Sf=Ef("metadata"),Pf=Function.prototype;void 0===Pf[Sf]&&xf(Pf,Sf,{value:null}),pi("dispose"),pi("metadata");var $f=Of;pi("asyncDispose");var Af=openapi_parser_d,Tf=se("Symbol"),Rf=Tf.keyFor,If=Af(Tf.prototype.valueOf),kf=Tf.isRegisteredSymbol||function(e){try{return void 0!==Rf(If(e))}catch(e){return!1}};On({target:"Symbol",stat:!0},{isRegisteredSymbol:kf});for(var Ff=Ue,Mf=se,Nf=openapi_parser_d,Cf=Ee,Df=at,qf=Mf("Symbol"),_f=qf.isWellKnownSymbol,Bf=Mf("Object","getOwnPropertyNames"),Lf=Nf(qf.prototype.valueOf),Uf=Ff("wks"),Jf=0,Vf=Bf(qf),Gf=Vf.length;Jf<Gf;Jf++)try{var zf=Vf[Jf];Cf(qf[zf])&&Df(zf)}catch(e){}var Hf=function(e){if(_f&&_f(e))return!0;try{for(var t=Lf(e),n=0,r=Bf(Uf),i=r.length;n<i;n++)if(Uf[r[n]]==t)return!0}catch(e){}return!1};On({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:Hf}),pi("matcher"),pi("observable"),On({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:kf}),On({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:Hf}),pi("metadataKey"),pi("patternMatch"),pi("replaceAll");const Wf=openapi_parser_e($f);var Xf=openapi_parser_d,Yf=Pn,Kf=lr,Qf=openapi_parser_H,Zf=Xf("".charAt),el=Xf("".charCodeAt),tl=Xf("".slice),nl=function(e){return function(t,n){var r,i,s=Kf(Qf(t)),o=Yf(n),c=s.length;return o<0||o>=c?e?"":void 0:(r=el(s,o))<55296||r>56319||o+1===c||(i=el(s,o+1))<56320||i>57343?e?Zf(s,o):r:e?tl(s,o,o+2):i-56320+(r-55296<<10)+65536}},rl={codeAt:nl(!1),charAt:nl(!0)}.charAt,il=lr,sl=Ui,ol=ru,cl=iu,al=sl.set,ul=sl.getterFor("String Iterator");ol(String,"String",(function(e){al(this,{type:"String Iterator",string:il(e),index:0})}),(function(){var e,t=ul(this),n=t.string,r=t.index;return r>=n.length?cl(void 0,!0):(e=rl(n,r),t.index+=e.length,cl(e,!1))}));const fl=openapi_parser_e(ii.f("iterator"));function ll(e){return ll="function"==typeof Wf&&"symbol"==typeof fl?function(e){return typeof e}:function(e){return e&&"function"==typeof Wf&&e.constructor===Wf&&e!==Wf.prototype?"symbol":typeof e},ll(e)}const hl=openapi_parser_e(ii.f("toPrimitive"));function pl(e){var t=function(e,t){if("object"!==ll(e)||null===e)return e;var n=e[hl];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ll(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ll(t)?t:String(t)}function ml(e,t,n){return(t=pl(t))in e?rf(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dl(e,t){var n=Zn(e);if(Sc){var r=Sc(e);t&&(r=Dc(r).call(r,(function(t){return zc(e,t).enumerable}))),aa(n).apply(n,r)}return n}function vl(e){for(var t=1;t<arguments.length;t++){var n,r,i=null!=arguments[t]?arguments[t]:{};t%2?ku(n=dl(Object(i),!0)).call(n,(function(t){ml(e,t,i[t])})):Ju?Yu(e,Ju(i)):ku(r=dl(Object(i))).call(r,(function(t){rf(e,t,zc(i,t))}))}return e}var yl={},bl={exports:{}};!function(e,t){!function(n){var r=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,s="object"==typeof global&&global;s.global!==s&&s.window!==s&&s.self!==s||(n=s);var o,c,a=2147483647,u=36,f=/^xn--/,l=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,d=String.fromCharCode;function v(e){throw RangeError(p[e])}function y(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function b(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+y((e=e.replace(h,".")).split("."),t).join(".")}function j(e){for(var t,n,r=[],i=0,s=e.length;i<s;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<s?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}function g(e){return y(e,(function(e){var t="";return e>65535&&(t+=d((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=d(e)})).join("")}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function O(e,t,n){var r=0;for(e=n?m(e/700):e>>1,e+=m(e/t);e>455;r+=u)e=m(e/35);return m(r+36*e/(e+38))}function E(e){var t,n,r,i,s,o,c,f,l,h,p,d=[],y=e.length,b=0,j=128,w=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&v("not-basic"),d.push(e.charCodeAt(r));for(i=n>0?n+1:0;i<y;){for(s=b,o=1,c=u;i>=y&&v("invalid-input"),((f=(p=e.charCodeAt(i++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:u)>=u||f>m((a-b)/o))&&v("overflow"),b+=f*o,!(f<(l=c<=w?1:c>=w+26?26:c-w));c+=u)o>m(a/(h=u-l))&&v("overflow"),o*=h;w=O(b-s,t=d.length+1,0==s),m(b/t)>a-j&&v("overflow"),j+=m(b/t),b%=t,d.splice(b++,0,j)}return g(d)}function x(e){var t,n,r,i,s,o,c,f,l,h,p,y,b,g,E,x=[];for(y=(e=j(e)).length,t=128,n=0,s=72,o=0;o<y;++o)(p=e[o])<128&&x.push(d(p));for(r=i=x.length,i&&x.push("-");r<y;){for(c=a,o=0;o<y;++o)(p=e[o])>=t&&p<c&&(c=p);for(c-t>m((a-n)/(b=r+1))&&v("overflow"),n+=(c-t)*b,t=c,o=0;o<y;++o)if((p=e[o])<t&&++n>a&&v("overflow"),p==t){for(f=n,l=u;!(f<(h=l<=s?1:l>=s+26?26:l-s));l+=u)E=f-h,g=u-h,x.push(d(w(h+E%g,0))),f=m(E/g);x.push(d(w(f,0))),s=O(n,b,r==i),n=0,++r}++n,++t}return x.join("")}if(o={version:"1.3.2",ucs2:{decode:j,encode:g},decode:E,encode:x,toASCII:function(e){return b(e,(function(e){return l.test(e)?"xn--"+x(e):e}))},toUnicode:function(e){return b(e,(function(e){return f.test(e)?E(e.slice(4).toLowerCase()):e}))}},r&&i)if(e.exports==r)i.exports=o;else for(c in o)o.hasOwnProperty(c)&&(r[c]=o[c]);else n.punycode=o}(this)}(bl,bl.exports);var jl=bl.exports,gl={};function wl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Ol=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};gl.decode=gl.parse=function(e,t,n,r){t=t||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;var s=/\+/g;e=e.split(t);var o=1e3;r&&"number"==typeof r.maxKeys&&(o=r.maxKeys);var c=e.length;o>0&&c>o&&(c=o);for(var a=0;a<c;++a){var u,f,l,h,p=e[a].replace(s,"%20"),m=p.indexOf(n);m>=0?(u=p.substr(0,m),f=p.substr(m+1)):(u=p,f=""),l=decodeURIComponent(u),h=decodeURIComponent(f),wl(i,l)?Array.isArray(i[l])?i[l].push(h):i[l]=[i[l],h]:i[l]=h}return i},gl.encode=gl.stringify=function(e,t,n,r){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(r){var i=encodeURIComponent(Ol(r))+n;return Array.isArray(e[r])?e[r].map((function(e){return i+encodeURIComponent(Ol(e))})).join(t):i+encodeURIComponent(Ol(e[r]))})).join(t):r?encodeURIComponent(Ol(r))+n+encodeURIComponent(Ol(e)):""};var El=jl,xl={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}};function Sl(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}yl.parse=_l,yl.resolve=function(e,t){return _l(e,!1,!0).resolve(t)},yl.resolveObject=function(e,t){return e?_l(e,!1,!0).resolveObject(t):t},yl.format=function(e){xl.isString(e)&&(e=_l(e));return e instanceof Sl?e.format():Sl.prototype.format.call(e)},yl.Url=Sl;var Pl=/^([a-z0-9.+-]+:)/i,$l=/:[0-9]*$/,Al=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Tl=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),Rl=["'"].concat(Tl),Il=["%","/","?",";","#"].concat(Rl),kl=["/","?","#"],Fl=/^[+a-z0-9A-Z_-]{0,63}$/,Ml=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Nl={javascript:!0,"javascript:":!0},Cl={javascript:!0,"javascript:":!0},Dl={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},ql=gl;function _l(e,t,n){if(e&&xl.isObject(e)&&e instanceof Sl)return e;var r=new Sl;return r.parse(e,t,n),r}Sl.prototype.parse=function(e,t,n){if(!xl.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),i=-1!==r&&r<e.indexOf("#")?"?":"#",s=e.split(i);s[0]=s[0].replace(/\\/g,"/");var o=e=s.join(i);if(o=o.trim(),!n&&1===e.split("#").length){var c=Al.exec(o);if(c)return this.path=o,this.href=o,this.pathname=c[1],c[2]?(this.search=c[2],this.query=t?ql.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var a=Pl.exec(o);if(a){var u=(a=a[0]).toLowerCase();this.protocol=u,o=o.substr(a.length)}if(n||a||o.match(/^\/\/[^@\/]+@[^@\/]+/)){var f="//"===o.substr(0,2);!f||a&&Cl[a]||(o=o.substr(2),this.slashes=!0)}if(!Cl[a]&&(f||a&&!Dl[a])){for(var l,h,p=-1,m=0;m<kl.length;m++){-1!==(d=o.indexOf(kl[m]))&&(-1===p||d<p)&&(p=d)}-1!==(h=-1===p?o.lastIndexOf("@"):o.lastIndexOf("@",p))&&(l=o.slice(0,h),o=o.slice(h+1),this.auth=decodeURIComponent(l)),p=-1;for(m=0;m<Il.length;m++){var d;-1!==(d=o.indexOf(Il[m]))&&(-1===p||d<p)&&(p=d)}-1===p&&(p=o.length),this.host=o.slice(0,p),o=o.slice(p),this.parseHost(),this.hostname=this.hostname||"";var v="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!v)for(var y=this.hostname.split(/\./),b=(m=0,y.length);m<b;m++){var j=y[m];if(j&&!j.match(Fl)){for(var g="",w=0,O=j.length;w<O;w++)j.charCodeAt(w)>127?g+="x":g+=j[w];if(!g.match(Fl)){var E=y.slice(0,m),x=y.slice(m+1),S=j.match(Ml);S&&(E.push(S[1]),x.unshift(S[2])),x.length&&(o="/"+x.join(".")+o),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),v||(this.hostname=El.toASCII(this.hostname));var P=this.port?":"+this.port:"",$=this.hostname||"";this.host=$+P,this.href+=this.host,v&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!Nl[u])for(m=0,b=Rl.length;m<b;m++){var A=Rl[m];if(-1!==o.indexOf(A)){var T=encodeURIComponent(A);T===A&&(T=escape(A)),o=o.split(A).join(T)}}var R=o.indexOf("#");-1!==R&&(this.hash=o.substr(R),o=o.slice(0,R));var I=o.indexOf("?");if(-1!==I?(this.search=o.substr(I),this.query=o.substr(I+1),t&&(this.query=ql.parse(this.query)),o=o.slice(0,I)):t&&(this.search="",this.query={}),o&&(this.pathname=o),Dl[u]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){P=this.pathname||"";var k=this.search||"";this.path=P+k}return this.href=this.format(),this},Sl.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,s="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&xl.isObject(this.query)&&Object.keys(this.query).length&&(s=ql.stringify(this.query));var o=this.search||s&&"?"+s||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||Dl[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),o&&"?"!==o.charAt(0)&&(o="?"+o),n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})),t+i+n+(o=o.replace("#","%23"))+r},Sl.prototype.resolve=function(e){return this.resolveObject(_l(e,!1,!0)).format()},Sl.prototype.resolveObject=function(e){if(xl.isString(e)){var t=new Sl;t.parse(e,!1,!0),e=t}for(var n=new Sl,r=Object.keys(this),i=0;i<r.length;i++){var s=r[i];n[s]=this[s]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var o=Object.keys(e),c=0;c<o.length;c++){var a=o[c];"protocol"!==a&&(n[a]=e[a])}return Dl[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!Dl[e.protocol]){for(var u=Object.keys(e),f=0;f<u.length;f++){var l=u[f];n[l]=e[l]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||Cl[e.protocol])n.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),n.pathname=h.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var p=n.pathname||"",m=n.search||"";n.path=p+m}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var d=n.pathname&&"/"===n.pathname.charAt(0),v=e.host||e.pathname&&"/"===e.pathname.charAt(0),y=v||d||n.host&&e.pathname,b=y,j=n.pathname&&n.pathname.split("/")||[],g=(h=e.pathname&&e.pathname.split("/")||[],n.protocol&&!Dl[n.protocol]);if(g&&(n.hostname="",n.port=null,n.host&&(""===j[0]?j[0]=n.host:j.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),y=y&&(""===h[0]||""===j[0])),v)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,j=h;else if(h.length)j||(j=[]),j.pop(),j=j.concat(h),n.search=e.search,n.query=e.query;else if(!xl.isNullOrUndefined(e.search)){if(g)n.hostname=n.host=j.shift(),(S=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=S.shift(),n.host=n.hostname=S.shift());return n.search=e.search,n.query=e.query,xl.isNull(n.pathname)&&xl.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!j.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var w=j.slice(-1)[0],O=(n.host||e.host||j.length>1)&&("."===w||".."===w)||""===w,E=0,x=j.length;x>=0;x--)"."===(w=j[x])?j.splice(x,1):".."===w?(j.splice(x,1),E++):E&&(j.splice(x,1),E--);if(!y&&!b)for(;E--;E)j.unshift("..");!y||""===j[0]||j[0]&&"/"===j[0].charAt(0)||j.unshift(""),O&&"/"!==j.join("/").substr(-1)&&j.push("");var S,P=""===j[0]||j[0]&&"/"===j[0].charAt(0);g&&(n.hostname=n.host=P?"":j.length?j.shift():"",(S=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=S.shift(),n.host=n.hostname=S.shift()));return(y=y||n.host&&j.length)&&!P&&j.unshift(""),j.length?n.pathname=j.join("/"):(n.pathname=null,n.path=null),xl.isNull(n.pathname)&&xl.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},Sl.prototype.parseHost=function(){var e=this.host,t=$l.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},function(){!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),s="FormData"in e,o="ArrayBuffer"in e;if(o)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(e){return e&&c.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function f(e){return"string"!=typeof e&&(e=String(e)),e}function l(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function m(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function d(e){var t=new FileReader,n=m(t);return t.readAsArrayBuffer(e),n}function v(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:s&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(e))?this._bodyArrayBuffer=v(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var e,t,n,r=p(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=m(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(e,t){e=u(e),t=f(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},h.prototype.delete=function(e){delete this.map[u(e)]},h.prototype.get=function(e){return e=u(e),this.has(e)?this.map[e]:null},h.prototype.has=function(e){return this.map.hasOwnProperty(u(e))},h.prototype.set=function(e,t){this.map[u(e)]=f(t)},h.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},h.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),l(e)},h.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),l(e)},h.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),l(e)},r&&(h.prototype[Symbol.iterator]=h.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function j(e,t){var n=(t=t||{}).body;if(e instanceof j){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new h(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new h(t.headers)),this.method=function(e){var t=e.toUpperCase();return b.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function g(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}j.prototype.clone=function(){return new j(this,{body:this._bodyInit})},y.call(j.prototype),y.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var O=[301,302,303,307,308];w.redirect=function(e,t){if(-1===O.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(e,n){return new Promise((function(r,s){var o=new j(e,n);if(o.signal&&o.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function a(){c.abort()}c.onload=function(){var e,t,n={status:c.status,statusText:c.statusText,headers:(e=c.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};n.url="responseURL"in c?c.responseURL:n.headers.get("X-Request-URL");var i="response"in c?c.response:c.responseText;r(new w(i,n))},c.onerror=function(){s(new TypeError("Network request failed"))},c.ontimeout=function(){s(new TypeError("Network request failed"))},c.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},c.open(o.method,o.url,!0),"include"===o.credentials?c.withCredentials=!0:"omit"===o.credentials&&(c.withCredentials=!1),"responseType"in c&&i&&(c.responseType="blob"),o.headers.forEach((function(e,t){c.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",a),c.onreadystatechange=function(){4===c.readyState&&o.signal.removeEventListener("abort",a)}),c.send(void 0===o._bodyInit?null:o._bodyInit)}))}E.polyfill=!0,e.fetch||(e.fetch=E,e.Headers=h,e.Request=j,e.Response=w),t.Headers=h,t.Request=j,t.Response=w,t.fetch=E,Object.defineProperty(t,"t",{value:!0})}({})}("undefined"!=typeof self?self:this)}();var Bl="undefined"!=typeof Symbol&&Symbol,Ll=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0},Ul="Function.prototype.bind called on incompatible ",Jl=Array.prototype.slice,Vl=Object.prototype.toString,Gl=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==Vl.call(t))throw new TypeError(Ul+t);for(var n,r=Jl.call(arguments,1),i=function(){if(this instanceof n){var i=t.apply(this,r.concat(Jl.call(arguments)));return Object(i)===i?i:this}return t.apply(e,r.concat(Jl.call(arguments)))},s=Math.max(0,t.length-r.length),o=[],c=0;c<s;c++)o.push("$"+c);if(n=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")(i),t.prototype){var a=function(){};a.prototype=t.prototype,n.prototype=new a,a.prototype=null}return n},zl=Function.prototype.bind||Gl,Hl=zl.call(Function.call,Object.prototype.hasOwnProperty),Wl=SyntaxError,Xl=Function,Yl=TypeError,Kl=function(e){try{return Xl('"use strict"; return ('+e+").constructor;")()}catch(e){}},Ql=Object.getOwnPropertyDescriptor;if(Ql)try{Ql({},"")}catch(e){Ql=null}var Zl=function(){throw new Yl},eh=Ql?function(){try{return Zl}catch(e){try{return Ql(arguments,"callee").get}catch(e){return Zl}}}():Zl,th="function"==typeof Bl&&"function"==typeof Symbol&&"symbol"==typeof Bl("foo")&&"symbol"==typeof Symbol("bar")&&Ll(),nh=Object.getPrototypeOf||function(e){return e.__proto__},rh={},ih="undefined"==typeof Uint8Array?undefined:nh(Uint8Array),sh={"%AggregateError%":"undefined"==typeof AggregateError?undefined:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?undefined:ArrayBuffer,"%ArrayIteratorPrototype%":th?nh([][Symbol.iterator]()):undefined,"%AsyncFromSyncIteratorPrototype%":undefined,"%AsyncFunction%":rh,"%AsyncGenerator%":rh,"%AsyncGeneratorFunction%":rh,"%AsyncIteratorPrototype%":rh,"%Atomics%":"undefined"==typeof Atomics?undefined:Atomics,"%BigInt%":"undefined"==typeof BigInt?undefined:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?undefined:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?undefined:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?undefined:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?undefined:FinalizationRegistry,"%Function%":Xl,"%GeneratorFunction%":rh,"%Int8Array%":"undefined"==typeof Int8Array?undefined:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?undefined:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?undefined:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":th?nh(nh([][Symbol.iterator]())):undefined,"%JSON%":"object"==typeof JSON?JSON:undefined,"%Map%":"undefined"==typeof Map?undefined:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&th?nh((new Map)[Symbol.iterator]()):undefined,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?undefined:Promise,"%Proxy%":"undefined"==typeof Proxy?undefined:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?undefined:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?undefined:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&th?nh((new Set)[Symbol.iterator]()):undefined,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?undefined:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":th?nh(""[Symbol.iterator]()):undefined,"%Symbol%":th?Symbol:undefined,"%SyntaxError%":Wl,"%ThrowTypeError%":eh,"%TypedArray%":ih,"%TypeError%":Yl,"%Uint8Array%":"undefined"==typeof Uint8Array?undefined:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?undefined:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?undefined:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?undefined:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?undefined:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?undefined:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?undefined:WeakSet},oh=function e(t){var n;if("%AsyncFunction%"===t)n=Kl("async function () {}");else if("%GeneratorFunction%"===t)n=Kl("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=Kl("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(n=nh(i.prototype))}return sh[t]=n,n},ch={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ah=zl,uh=Hl,fh=ah.call(Function.call,Array.prototype.concat),lh=ah.call(Function.apply,Array.prototype.splice),hh=ah.call(Function.call,String.prototype.replace),ph=ah.call(Function.call,String.prototype.slice),mh=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,dh=/\\(\\)?/g,vh=function(e){var t=ph(e,0,1),n=ph(e,-1);if("%"===t&&"%"!==n)throw new Wl("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new Wl("invalid intrinsic syntax, expected opening `%`");var r=[];return hh(e,mh,(function(e,t,n,i){r[r.length]=n?hh(i,dh,"$1"):t||e})),r},yh=function(e,t){var n,r=e;if(uh(ch,r)&&(r="%"+(n=ch[r])[0]+"%"),uh(sh,r)){var i=sh[r];if(i===rh&&(i=oh(r)),void 0===i&&!t)throw new Yl("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:i}}throw new Wl("intrinsic "+e+" does not exist!")},bh=function(e,t){if("string"!=typeof e||0===e.length)throw new Yl("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new Yl('"allowMissing" argument must be a boolean');var n=vh(e),r=n.length>0?n[0]:"",i=yh("%"+r+"%",t),s=i.name,o=i.value,c=!1,a=i.alias;a&&(r=a[0],lh(n,fh([0,1],a)));for(var u=1,f=!0;u<n.length;u+=1){var l=n[u],h=ph(l,0,1),p=ph(l,-1);if(('"'===h||"'"===h||"`"===h||'"'===p||"'"===p||"`"===p)&&h!==p)throw new Wl("property names with quotes must have matching quotes");if("constructor"!==l&&f||(c=!0),uh(sh,s="%"+(r+="."+l)+"%"))o=sh[s];else if(null!=o){if(!(l in o)){if(!t)throw new Yl("base intrinsic for "+e+" exists, but the property is not available.");return}if(Ql&&u+1>=n.length){var m=Ql(o,l);o=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:o[l]}else f=uh(o,l),o=o[l];f&&!c&&(sh[s]=o)}}return o},jh={exports:{}};!function(e){var t=zl,n=bh,r=n("%Function.prototype.apply%"),i=n("%Function.prototype.call%"),s=n("%Reflect.apply%",!0)||t.call(i,r),o=n("%Object.getOwnPropertyDescriptor%",!0),c=n("%Object.defineProperty%",!0),a=n("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var n=s(t,i,arguments);if(o&&c){var r=o(n,"length");r.configurable&&c(n,"length",{value:1+a(0,e.length-(arguments.length-1))})}return n};var u=function(){return s(t,r,arguments)};c?c(e.exports,"apply",{value:u}):e.exports.apply=u}(jh);var gh=bh,wh=jh.exports,Oh=wh(gh("String.prototype.indexOf"));const Eh=openapi_parser_t(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var xh="function"==typeof Map&&Map.prototype,Sh=Object.getOwnPropertyDescriptor&&xh?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ph=xh&&Sh&&"function"==typeof Sh.get?Sh.get:null,$h=xh&&Map.prototype.forEach,Ah="function"==typeof Set&&Set.prototype,Th=Object.getOwnPropertyDescriptor&&Ah?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Rh=Ah&&Th&&"function"==typeof Th.get?Th.get:null,Ih=Ah&&Set.prototype.forEach,kh="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,Fh="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,Mh="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,Nh=Boolean.prototype.valueOf,Ch=Object.prototype.toString,Dh=Function.prototype.toString,qh=String.prototype.match,_h=String.prototype.slice,Bh=String.prototype.replace,Lh=String.prototype.toUpperCase,Uh=String.prototype.toLowerCase,Jh=RegExp.prototype.test,Vh=Array.prototype.concat,Gh=Array.prototype.join,zh=Array.prototype.slice,Hh=Math.floor,Wh="function"==typeof BigInt?BigInt.prototype.valueOf:null,Xh=Object.getOwnPropertySymbols,Yh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,Kh="function"==typeof Symbol&&"object"==typeof Symbol.iterator,Qh="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Kh||"symbol")?Symbol.toStringTag:null,Zh=Object.prototype.propertyIsEnumerable,ep=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function tp(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||Jh.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var r=e<0?-Hh(-e):Hh(e);if(r!==e){var i=String(r),s=_h.call(t,i.length+1);return Bh.call(i,n,"$&_")+"."+Bh.call(Bh.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Bh.call(t,n,"$&_")}var np=Eh.custom,rp=np&&cp(np)?np:null;function ip(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function sp(e){return Bh.call(String(e),/"/g,"&quot;")}function op(e){return!("[object Array]"!==fp(e)||Qh&&"object"==typeof e&&Qh in e)}function cp(e){if(Kh)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!Yh)return!1;try{return Yh.call(e),!0}catch(e){}return!1}var ap=Object.prototype.hasOwnProperty||function(e){return e in this};function up(e,t){return ap.call(e,t)}function fp(e){return Ch.call(e)}function lp(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function hp(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return hp(_h.call(e,0,t.maxStringLength),t)+r}return ip(Bh.call(Bh.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,pp),"single",t)}function pp(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+Lh.call(t.toString(16))}function mp(e){return"Object("+e+")"}function dp(e){return e+" { ? }"}function vp(e,t,n,r){return e+" ("+t+") {"+(r?yp(n,r):Gh.call(n,", "))+"}"}function yp(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+Gh.call(e,","+n)+"\n"+t.prev}function bp(e,t){var n=op(e),r=[];if(n){r.length=e.length;for(var i=0;i<e.length;i++)r[i]=up(e,i)?t(e[i],e):""}var s,o="function"==typeof Xh?Xh(e):[];if(Kh){s={};for(var c=0;c<o.length;c++)s["$"+o[c]]=o[c]}for(var a in e)up(e,a)&&(n&&String(Number(a))===a&&a<e.length||Kh&&s["$"+a]instanceof Symbol||(Jh.call(/[^\w$]/,a)?r.push(t(a,e)+": "+t(e[a],e)):r.push(a+": "+t(e[a],e))));if("function"==typeof Xh)for(var u=0;u<o.length;u++)Zh.call(e,o[u])&&r.push("["+t(o[u])+"]: "+t(e[o[u]],e));return r}var jp=bh,gp=function(e,t){var n=gh(e,!!t);return"function"==typeof n&&Oh(e,".prototype.")>-1?wh(n):n},wp=function e(t,n,r,i){var s=n||{};if(up(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(up(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=!up(s,"customInspect")||s.customInspect;if("boolean"!=typeof o&&"symbol"!==o)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(up(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(up(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=s.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return hp(t,s);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var a=String(t);return c?tp(t,a):a}if("bigint"==typeof t){var u=String(t)+"n";return c?tp(t,u):u}var f=void 0===s.depth?5:s.depth;if(void 0===r&&(r=0),r>=f&&f>0&&"object"==typeof t)return op(t)?"[Array]":"[Object]";var l=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=Gh.call(Array(e.indent+1)," ")}return{base:n,prev:Gh.call(Array(t+1),n)}}(s,r);if(void 0===i)i=[];else if(lp(i,t)>=0)return"[Circular]";function h(t,n,o){if(n&&(i=zh.call(i)).push(n),o){var c={depth:s.depth};return up(s,"quoteStyle")&&(c.quoteStyle=s.quoteStyle),e(t,c,r+1,i)}return e(t,s,r+1,i)}if("function"==typeof t){var p=function(e){if(e.name)return e.name;var t=qh.call(Dh.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),m=bp(t,h);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(m.length>0?" { "+Gh.call(m,", ")+" }":"")}if(cp(t)){var d=Kh?Bh.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Yh.call(t);return"object"!=typeof t||Kh?d:mp(d)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var v="<"+Uh.call(String(t.nodeName)),y=t.attributes||[],b=0;b<y.length;b++)v+=" "+y[b].name+"="+ip(sp(y[b].value),"double",s);return v+=">",t.childNodes&&t.childNodes.length&&(v+="..."),v+="</"+Uh.call(String(t.nodeName))+">"}if(op(t)){if(0===t.length)return"[]";var j=bp(t,h);return l&&!function(e){for(var t=0;t<e.length;t++)if(lp(e[t],"\n")>=0)return!1;return!0}(j)?"["+yp(j,l)+"]":"[ "+Gh.call(j,", ")+" ]"}if(function(e){return!("[object Error]"!==fp(e)||Qh&&"object"==typeof e&&Qh in e)}(t)){var g=bp(t,h);return"cause"in t&&!Zh.call(t,"cause")?"{ ["+String(t)+"] "+Gh.call(Vh.call("[cause]: "+h(t.cause),g),", ")+" }":0===g.length?"["+String(t)+"]":"{ ["+String(t)+"] "+Gh.call(g,", ")+" }"}if("object"==typeof t&&o){if(rp&&"function"==typeof t[rp])return t[rp]();if("symbol"!==o&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!Ph||!e||"object"!=typeof e)return!1;try{Ph.call(e);try{Rh.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var w=[];return $h.call(t,(function(e,n){w.push(h(n,t,!0)+" => "+h(e,t))})),vp("Map",Ph.call(t),w,l)}if(function(e){if(!Rh||!e||"object"!=typeof e)return!1;try{Rh.call(e);try{Ph.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var O=[];return Ih.call(t,(function(e){O.push(h(e,t))})),vp("Set",Rh.call(t),O,l)}if(function(e){if(!kh||!e||"object"!=typeof e)return!1;try{kh.call(e,kh);try{Fh.call(e,Fh)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return dp("WeakMap");if(function(e){if(!Fh||!e||"object"!=typeof e)return!1;try{Fh.call(e,Fh);try{kh.call(e,kh)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return dp("WeakSet");if(function(e){if(!Mh||!e||"object"!=typeof e)return!1;try{return Mh.call(e),!0}catch(e){}return!1}(t))return dp("WeakRef");if(function(e){return!("[object Number]"!==fp(e)||Qh&&"object"==typeof e&&Qh in e)}(t))return mp(h(Number(t)));if(function(e){if(!e||"object"!=typeof e||!Wh)return!1;try{return Wh.call(e),!0}catch(e){}return!1}(t))return mp(h(Wh.call(t)));if(function(e){return!("[object Boolean]"!==fp(e)||Qh&&"object"==typeof e&&Qh in e)}(t))return mp(Nh.call(t));if(function(e){return!("[object String]"!==fp(e)||Qh&&"object"==typeof e&&Qh in e)}(t))return mp(h(String(t)));if(!function(e){return!("[object Date]"!==fp(e)||Qh&&"object"==typeof e&&Qh in e)}(t)&&!function(e){return!("[object RegExp]"!==fp(e)||Qh&&"object"==typeof e&&Qh in e)}(t)){var E=bp(t,h),x=ep?ep(t)===Object.prototype:t instanceof Object||t.constructor===Object,S=t instanceof Object?"":"null prototype",P=!x&&Qh&&Object(t)===t&&Qh in t?_h.call(fp(t),8,-1):S?"Object":"",$=(x||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(P||S?"["+Gh.call(Vh.call([],P||[],S||[]),": ")+"] ":"");return 0===E.length?$+"{}":l?$+"{"+yp(E,l)+"}":$+"{ "+Gh.call(E,", ")+" }"}return String(t)},Op=jp("%TypeError%"),Ep=jp("%WeakMap%",!0),xp=jp("%Map%",!0),Sp=gp("WeakMap.prototype.get",!0),Pp=gp("WeakMap.prototype.set",!0),$p=gp("WeakMap.prototype.has",!0),Ap=gp("Map.prototype.get",!0),Tp=gp("Map.prototype.set",!0),Rp=gp("Map.prototype.has",!0),Ip=function(e,t){for(var n,r=e;null!==(n=r.next);r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n},kp=String.prototype.replace,Fp=/%20/g,Mp="RFC3986",Np={default:Mp,formatters:{RFC1738:function(e){return kp.call(e,Fp,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:Mp},Cp=Np,Dp=Object.prototype.hasOwnProperty,qp=Array.isArray,_p=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),Bp=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n},Lp={arrayToObject:Bp,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var i=t[r],s=i.obj[i.prop],o=Object.keys(s),c=0;c<o.length;++c){var a=o[c],u=s[a];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:s,prop:a}),n.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(qp(n)){for(var r=[],i=0;i<n.length;++i)void 0!==n[i]&&r.push(n[i]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n,r,i){if(0===e.length)return e;var s=e;if("symbol"==typeof e?s=Symbol.prototype.toString.call(e):"string"!=typeof e&&(s=String(e)),"iso-8859-1"===n)return escape(s).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var o="",c=0;c<s.length;++c){var a=s.charCodeAt(c);45===a||46===a||95===a||126===a||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||i===Cp.RFC1738&&(40===a||41===a)?o+=s.charAt(c):a<128?o+=_p[a]:a<2048?o+=_p[192|a>>6]+_p[128|63&a]:a<55296||a>=57344?o+=_p[224|a>>12]+_p[128|a>>6&63]+_p[128|63&a]:(c+=1,a=65536+((1023&a)<<10|1023&s.charCodeAt(c)),o+=_p[240|a>>18]+_p[128|a>>12&63]+_p[128|a>>6&63]+_p[128|63&a])}return o},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(qp(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n){if(qp(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!Dp.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var i=t;return qp(t)&&!qp(n)&&(i=Bp(t,r)),qp(t)&&qp(n)?(n.forEach((function(n,i){if(Dp.call(t,i)){var s=t[i];s&&"object"==typeof s&&n&&"object"==typeof n?t[i]=e(s,n,r):t.push(n)}else t[i]=n})),t):Object.keys(n).reduce((function(t,i){var s=n[i];return Dp.call(t,i)?t[i]=e(t[i],s,r):t[i]=s,t}),i)}},Up=function(){var e,t,n,r={assert:function(e){if(!r.has(e))throw new Op("Side channel does not contain "+wp(e))},get:function(r){if(Ep&&r&&("object"==typeof r||"function"==typeof r)){if(e)return Sp(e,r)}else if(xp){if(t)return Ap(t,r)}else if(n)return function(e,t){var n=Ip(e,t);return n&&n.value}(n,r)},has:function(r){if(Ep&&r&&("object"==typeof r||"function"==typeof r)){if(e)return $p(e,r)}else if(xp){if(t)return Rp(t,r)}else if(n)return function(e,t){return!!Ip(e,t)}(n,r);return!1},set:function(r,i){Ep&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new Ep),Pp(e,r,i)):xp?(t||(t=new xp),Tp(t,r,i)):(n||(n={key:{},next:null}),function(e,t,n){var r=Ip(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(n,r,i))}};return r},Jp=Lp,Vp=Np,Gp=Object.prototype.hasOwnProperty,zp={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},Hp=Array.isArray,Wp=String.prototype.split,Xp=Array.prototype.push,Yp=function(e,t){Xp.apply(e,Hp(t)?t:[t])},Kp=Date.prototype.toISOString,Qp=Vp.default,Zp={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Jp.encode,encodeValuesOnly:!1,format:Qp,formatter:Vp.formatters[Qp],indices:!1,serializeDate:function(e){return Kp.call(e)},skipNulls:!1,strictNullHandling:!1},em={},tm=function e(t,n,r,i,s,o,c,a,u,f,l,h,p,m,d){for(var v,y=t,b=d,j=0,g=!1;void 0!==(b=b.get(em))&&!g;){var w=b.get(t);if(j+=1,void 0!==w){if(w===j)throw new RangeError("Cyclic object value");g=!0}void 0===b.get(em)&&(j=0)}if("function"==typeof c?y=c(n,y):y instanceof Date?y=f(y):"comma"===r&&Hp(y)&&(y=Jp.maybeMap(y,(function(e){return e instanceof Date?f(e):e}))),null===y){if(i)return o&&!p?o(n,Zp.encoder,m,"key",l):n;y=""}if("string"==typeof(v=y)||"number"==typeof v||"boolean"==typeof v||"symbol"==typeof v||"bigint"==typeof v||Jp.isBuffer(y)){if(o){var O=p?n:o(n,Zp.encoder,m,"key",l);if("comma"===r&&p){for(var E=Wp.call(String(y),","),x="",S=0;S<E.length;++S)x+=(0===S?"":",")+h(o(E[S],Zp.encoder,m,"value",l));return[h(O)+"="+x]}return[h(O)+"="+h(o(y,Zp.encoder,m,"value",l))]}return[h(n)+"="+h(String(y))]}var P,$=[];if(void 0===y)return $;if("comma"===r&&Hp(y))P=[{value:y.length>0?y.join(",")||null:void 0}];else if(Hp(c))P=c;else{var A=Object.keys(y);P=a?A.sort(a):A}for(var T=0;T<P.length;++T){var R=P[T],I="object"==typeof R&&void 0!==R.value?R.value:y[R];if(!s||null!==I){var k=Hp(y)?"function"==typeof r?r(n,R):n:n+(u?"."+R:"["+R+"]");d.set(t,j);var F=Up();F.set(em,d),Yp($,e(I,k,r,i,s,o,c,a,u,f,l,h,p,m,F))}}return $},nm=Lp,rm=Object.prototype.hasOwnProperty,im=Array.isArray,sm={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:nm.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},om=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},cm=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},am=function(e,t,n,r){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/g,o=n.depth>0&&/(\[[^[\]]*])/.exec(i),c=o?i.slice(0,o.index):i,a=[];if(c){if(!n.plainObjects&&rm.call(Object.prototype,c)&&!n.allowPrototypes)return;a.push(c)}for(var u=0;n.depth>0&&null!==(o=s.exec(i))&&u<n.depth;){if(u+=1,!n.plainObjects&&rm.call(Object.prototype,o[1].slice(1,-1))&&!n.allowPrototypes)return;a.push(o[1])}return o&&a.push("["+i.slice(o.index)+"]"),function(e,t,n,r){for(var i=r?t:cm(t,n),s=e.length-1;s>=0;--s){var o,c=e[s];if("[]"===c&&n.parseArrays)o=[].concat(i);else{o=n.plainObjects?Object.create(null):{};var a="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,u=parseInt(a,10);n.parseArrays||""!==a?!isNaN(u)&&c!==a&&String(u)===a&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(o=[])[u]=i:"__proto__"!==a&&(o[a]=i):o={0:i}}i=o}return i}(a,t,n,r)}},um=function(e,t){var n,r=e,i=function(e){if(!e)return Zp;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||Zp.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Vp.default;if(void 0!==e.format){if(!Gp.call(Vp.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=Vp.formatters[n],i=Zp.filter;return("function"==typeof e.filter||Hp(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:Zp.addQueryPrefix,allowDots:void 0===e.allowDots?Zp.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:Zp.charsetSentinel,delimiter:void 0===e.delimiter?Zp.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:Zp.encode,encoder:"function"==typeof e.encoder?e.encoder:Zp.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:Zp.encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:Zp.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:Zp.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:Zp.strictNullHandling}}(t);"function"==typeof i.filter?r=(0,i.filter)("",r):Hp(i.filter)&&(n=i.filter);var s,o=[];if("object"!=typeof r||null===r)return"";s=t&&t.arrayFormat in zp?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var c=zp[s];n||(n=Object.keys(r)),i.sort&&n.sort(i.sort);for(var a=Up(),u=0;u<n.length;++u){var f=n[u];i.skipNulls&&null===r[f]||Yp(o,tm(r[f],f,c,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,a))}var l=o.join(i.delimiter),h=!0===i.addQueryPrefix?"?":"";return i.charsetSentinel&&("iso-8859-1"===i.charset?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),l.length>0?h+l:""},fm=function(e,t){var n=function(e){if(!e)return sm;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?sm.charset:e.charset;return{allowDots:void 0===e.allowDots?sm.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:sm.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:sm.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:sm.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:sm.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:sm.comma,decoder:"function"==typeof e.decoder?e.decoder:sm.decoder,delimiter:"string"==typeof e.delimiter||nm.isRegExp(e.delimiter)?e.delimiter:sm.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:sm.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:sm.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:sm.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:sm.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:sm.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var r="string"==typeof e?function(e,t){var n,r={},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,s),c=-1,a=t.charset;if(t.charsetSentinel)for(n=0;n<o.length;++n)0===o[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===o[n]?a="utf-8":"utf8=%26%2310003%3B"===o[n]&&(a="iso-8859-1"),c=n,n=o.length);for(n=0;n<o.length;++n)if(n!==c){var u,f,l=o[n],h=l.indexOf("]="),p=-1===h?l.indexOf("="):h+1;-1===p?(u=t.decoder(l,sm.decoder,a,"key"),f=t.strictNullHandling?null:""):(u=t.decoder(l.slice(0,p),sm.decoder,a,"key"),f=nm.maybeMap(cm(l.slice(p+1),t),(function(e){return t.decoder(e,sm.decoder,a,"value")}))),f&&t.interpretNumericEntities&&"iso-8859-1"===a&&(f=om(f)),l.indexOf("[]=")>-1&&(f=im(f)?[f]:f),rm.call(r,u)?r[u]=nm.combine(r[u],f):r[u]=f}return r}(e,n):e,i=n.plainObjects?Object.create(null):{},s=Object.keys(r),o=0;o<s.length;++o){var c=s[o],a=am(c,r[c],n,"string"==typeof e);i=nm.merge(i,a,n)}return!0===n.allowSparse?i:nm.compact(i)};const lm=openapi_parser_e({formats:Np,parse:fm,stringify:um});
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function hm(e){return null==e}var pm=function(e,t){var n,r,i,s;if(t)for(n=0,r=(s=Object.keys(t)).length;n<r;n+=1)e[i=s[n]]=t[i];return e},mm={isNothing:hm,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:hm(e)?[]:[e]},repeat:function(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r},isNegativeZero:function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},extend:pm};function dm(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),r+" "+n):r}function vm(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=dm(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}vm.prototype=Object.create(Error.prototype),vm.prototype.constructor=vm,vm.prototype.toString=function(e){return this.name+": "+dm(this,e)};var ym=vm;function bm(e,t,n,r,i){var s="",o="",c=Math.floor(i/2)-1;return r-t>c&&(t=r-c+(s=" ... ").length),n-r>c&&(n=r+c-(o=" ...").length),{str:s+e.slice(t,n).replace(/\t/g,"→")+o,pos:r-t+s.length}}function jm(e,t){return mm.repeat(" ",t-e.length)+e}var gm=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,r=/\r?\n|\r|\0/g,i=[0],s=[],o=-1;n=r.exec(e.buffer);)s.push(n.index),i.push(n.index+n[0].length),e.position<=n.index&&o<0&&(o=i.length-2);o<0&&(o=i.length-1);var c,a,u="",f=Math.min(e.line+t.linesAfter,s.length).toString().length,l=t.maxLength-(t.indent+f+3);for(c=1;c<=t.linesBefore&&!(o-c<0);c++)a=bm(e.buffer,i[o-c],s[o-c],e.position-(i[o]-i[o-c]),l),u=mm.repeat(" ",t.indent)+jm((e.line-c+1).toString(),f)+" | "+a.str+"\n"+u;for(a=bm(e.buffer,i[o],s[o],e.position,l),u+=mm.repeat(" ",t.indent)+jm((e.line+1).toString(),f)+" | "+a.str+"\n",u+=mm.repeat("-",t.indent+f+3+a.pos)+"^\n",c=1;c<=t.linesAfter&&!(o+c>=s.length);c++)a=bm(e.buffer,i[o+c],s[o+c],e.position-(i[o]-i[o+c]),l),u+=mm.repeat(" ",t.indent)+jm((e.line+c+1).toString(),f)+" | "+a.str+"\n";return u.replace(/\n$/,"")},wm=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Om=["scalar","sequence","mapping"];var Em=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===wm.indexOf(t))throw new ym('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}(t.styleAliases||null),-1===Om.indexOf(this.kind))throw new ym('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function xm(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)})),n[t]=e})),n}function Sm(e){return this.extend(e)}Sm.prototype.extend=function(e){var t=[],n=[];if(e instanceof Em)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new ym("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof Em))throw new ym("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new ym("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new ym("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof Em))throw new ym("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var r=Object.create(Sm.prototype);return r.implicit=(this.implicit||[]).concat(t),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=xm(r,"implicit"),r.compiledExplicit=xm(r,"explicit"),r.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}(r.compiledImplicit,r.compiledExplicit),r};var Pm=Sm,$m=new Em("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}}),Am=new Em("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}}),Tm=new Em("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}}),Rm=new Pm({explicit:[$m,Am,Tm]});var Im=new Em("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});var km=new Em("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Fm(e){return 48<=e&&e<=55}function Mm(e){return 48<=e&&e<=57}var Nm=new Em("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=e.length,i=0,s=!1;if(!r)return!1;if("-"!==(t=e[i])&&"+"!==t||(t=e[++i]),"0"===t){if(i+1===r)return!0;if("b"===(t=e[++i])){for(i++;i<r;i++)if("_"!==(t=e[i])){if("0"!==t&&"1"!==t)return!1;s=!0}return s&&"_"!==t}if("x"===t){for(i++;i<r;i++)if("_"!==(t=e[i])){if(!(48<=(n=e.charCodeAt(i))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;s=!0}return s&&"_"!==t}if("o"===t){for(i++;i<r;i++)if("_"!==(t=e[i])){if(!Fm(e.charCodeAt(i)))return!1;s=!0}return s&&"_"!==t}}if("_"===t)return!1;for(;i<r;i++)if("_"!==(t=e[i])){if(!Mm(e.charCodeAt(i)))return!1;s=!0}return!(!s||"_"===t)},construct:function(e){var t,n=e,r=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(t=n[0])&&"+"!==t||("-"===t&&(r=-1),t=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===t){if("b"===n[1])return r*parseInt(n.slice(2),2);if("x"===n[1])return r*parseInt(n.slice(2),16);if("o"===n[1])return r*parseInt(n.slice(2),8)}return r*parseInt(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!mm.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Cm=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var Dm=/^[-+]?[0-9]+e/;var qm=new Em("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!Cm.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||mm.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(mm.isNegativeZero(e))return"-0.0";return n=e.toString(10),Dm.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),_m=Rm.extend({implicit:[Im,km,Nm,qm]}),Bm=_m,Lm=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Um=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var Jm=new Em("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==Lm.exec(e)||null!==Um.exec(e))},construct:function(e){var t,n,r,i,s,o,c,a,u=0,f=null;if(null===(t=Lm.exec(e))&&(t=Um.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(s=+t[4],o=+t[5],c=+t[6],t[7]){for(u=t[7].slice(0,3);u.length<3;)u+="0";u=+u}return t[9]&&(f=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(f=-f)),a=new Date(Date.UTC(n,r,i,s,o,c,u)),f&&a.setTime(a.getTime()-f),a},instanceOf:Date,represent:function(e){return e.toISOString()}});var Vm=new Em("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),Gm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var zm=new Em("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,i=e.length,s=Gm;for(n=0;n<i;n++)if(!((t=s.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,s=Gm,o=0,c=[];for(t=0;t<i;t++)t%4==0&&t&&(c.push(o>>16&255),c.push(o>>8&255),c.push(255&o)),o=o<<6|s.indexOf(r.charAt(t));return 0===(n=i%4*6)?(c.push(o>>16&255),c.push(o>>8&255),c.push(255&o)):18===n?(c.push(o>>10&255),c.push(o>>2&255)):12===n&&c.push(o>>4&255),new Uint8Array(c)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,r="",i=0,s=e.length,o=Gm;for(t=0;t<s;t++)t%3==0&&t&&(r+=o[i>>18&63],r+=o[i>>12&63],r+=o[i>>6&63],r+=o[63&i]),i=(i<<8)+e[t];return 0===(n=s%3)?(r+=o[i>>18&63],r+=o[i>>12&63],r+=o[i>>6&63],r+=o[63&i]):2===n?(r+=o[i>>10&63],r+=o[i>>4&63],r+=o[i<<2&63],r+=o[64]):1===n&&(r+=o[i>>2&63],r+=o[i<<4&63],r+=o[64],r+=o[64]),r}}),Hm=Object.prototype.hasOwnProperty,Wm=Object.prototype.toString;var Xm=new Em("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,i,s,o=[],c=e;for(t=0,n=c.length;t<n;t+=1){if(r=c[t],s=!1,"[object Object]"!==Wm.call(r))return!1;for(i in r)if(Hm.call(r,i)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==o.indexOf(i))return!1;o.push(i)}return!0},construct:function(e){return null!==e?e:[]}}),Ym=Object.prototype.toString;var Km=new Em("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,i,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],"[object Object]"!==Ym.call(r))return!1;if(1!==(i=Object.keys(r)).length)return!1;s[t]=[i[0],r[i[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,r,i,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),s[t]=[i[0],r[i[0]]];return s}}),Qm=Object.prototype.hasOwnProperty;var Zm=new Em("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(Qm.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}}),ed=Bm.extend({implicit:[Jm,Vm],explicit:[zm,Xm,Km,Zm]}),td=Object.prototype.hasOwnProperty,nd=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,rd=/[\x85\u2028\u2029]/,id=/[,\[\]\{\}]/,sd=/^(?:!|!!|![a-z\-]+!)$/i,od=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function cd(e){return Object.prototype.toString.call(e)}function ad(e){return 10===e||13===e}function ud(e){return 9===e||32===e}function fd(e){return 9===e||32===e||10===e||13===e}function ld(e){return 44===e||91===e||93===e||123===e||125===e}function hd(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function pd(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function md(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var dd=new Array(256),vd=new Array(256),yd=0;yd<256;yd++)dd[yd]=pd(yd)?1:0,vd[yd]=pd(yd);function bd(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||ed,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function jd(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=gm(n),new ym(t,n)}function gd(e,t){throw jd(e,t)}function wd(e,t){e.onWarning&&e.onWarning.call(null,jd(e,t))}var Od={YAML:function(e,t,n){var r,i,s;null!==e.version&&gd(e,"duplication of %YAML directive"),1!==n.length&&gd(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&gd(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),s=parseInt(r[2],10),1!==i&&gd(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,1!==s&&2!==s&&wd(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&gd(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],sd.test(r)||gd(e,"ill-formed tag handle (first argument) of the TAG directive"),td.call(e.tagMap,r)&&gd(e,'there is a previously declared suffix for "'+r+'" tag handle'),od.test(i)||gd(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(t){gd(e,"tag prefix is malformed: "+i)}e.tagMap[r]=i}};function Ed(e,t,n,r){var i,s,o,c;if(t<n){if(c=e.input.slice(t,n),r)for(i=0,s=c.length;i<s;i+=1)9===(o=c.charCodeAt(i))||32<=o&&o<=1114111||gd(e,"expected valid JSON character");else nd.test(c)&&gd(e,"the stream contains non-printable characters");e.result+=c}}function xd(e,t,n,r){var i,s,o,c;for(mm.isObject(n)||gd(e,"cannot merge mappings; the provided source object is unacceptable"),o=0,c=(i=Object.keys(n)).length;o<c;o+=1)s=i[o],td.call(t,s)||(t[s]=n[s],r[s]=!0)}function Sd(e,t,n,r,i,s,o,c,a){var u,f;if(Array.isArray(i))for(u=0,f=(i=Array.prototype.slice.call(i)).length;u<f;u+=1)Array.isArray(i[u])&&gd(e,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===cd(i[u])&&(i[u]="[object Object]");if("object"==typeof i&&"[object Object]"===cd(i)&&(i="[object Object]"),i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(s))for(u=0,f=s.length;u<f;u+=1)xd(e,t,s[u],n);else xd(e,t,s,n);else e.json||td.call(n,i)||!td.call(t,i)||(e.line=o||e.line,e.lineStart=c||e.lineStart,e.position=a||e.position,gd(e,"duplicated mapping key")),"__proto__"===i?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[i]=s,delete n[i];return t}function Pd(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):gd(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function $d(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);0!==i;){for(;ud(i);)9===i&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&35===i)do{i=e.input.charCodeAt(++e.position)}while(10!==i&&13!==i&&0!==i);if(!ad(i))break;for(Pd(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===i;)e.lineIndent++,i=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&wd(e,"deficient indentation"),r}function Ad(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!fd(t)))}function Td(e,t){1===t?e.result+=" ":t>1&&(e.result+=mm.repeat("\n",t-1))}function Rd(e,t){var n,r,i=e.tag,s=e.anchor,o=[],c=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),r=e.input.charCodeAt(e.position);0!==r&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,gd(e,"tab characters must not be used in indentation")),45===r)&&fd(e.input.charCodeAt(e.position+1));)if(c=!0,e.position++,$d(e,!0,-1)&&e.lineIndent<=t)o.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,Fd(e,t,3,!1,!0),o.push(e.result),$d(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)gd(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!c&&(e.tag=i,e.anchor=s,e.kind="sequence",e.result=o,!0)}function Id(e){var t,n,r,i,s=!1,o=!1;if(33!==(i=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&gd(e,"duplication of a tag property"),60===(i=e.input.charCodeAt(++e.position))?(s=!0,i=e.input.charCodeAt(++e.position)):33===i?(o=!0,n="!!",i=e.input.charCodeAt(++e.position)):n="!",t=e.position,s){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&62!==i);e.position<e.length?(r=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):gd(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!fd(i);)33===i&&(o?gd(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),sd.test(n)||gd(e,"named tag handle cannot contain such characters"),o=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),id.test(r)&&gd(e,"tag suffix cannot contain flow indicator characters")}r&&!od.test(r)&&gd(e,"tag name cannot contain such characters: "+r);try{r=decodeURIComponent(r)}catch(t){gd(e,"tag name is malformed: "+r)}return s?e.tag=r:td.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:gd(e,'undeclared tag handle "'+n+'"'),!0}function kd(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&gd(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!fd(n)&&!ld(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&gd(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Fd(e,t,n,r,i){var s,o,c,a,u,f,l,h,p,m=1,d=!1,v=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=o=c=4===n||3===n,r&&$d(e,!0,-1)&&(d=!0,e.lineIndent>t?m=1:e.lineIndent===t?m=0:e.lineIndent<t&&(m=-1)),1===m)for(;Id(e)||kd(e);)$d(e,!0,-1)?(d=!0,c=s,e.lineIndent>t?m=1:e.lineIndent===t?m=0:e.lineIndent<t&&(m=-1)):c=!1;if(c&&(c=d||i),1!==m&&4!==n||(h=1===n||2===n?t:t+1,p=e.position-e.lineStart,1===m?c&&(Rd(e,p)||function(e,t,n){var r,i,s,o,c,a,u,f=e.tag,l=e.anchor,h={},p=Object.create(null),m=null,d=null,v=null,y=!1,b=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=h),u=e.input.charCodeAt(e.position);0!==u;){if(y||-1===e.firstTabInLine||(e.position=e.firstTabInLine,gd(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),s=e.line,63!==u&&58!==u||!fd(r)){if(o=e.line,c=e.lineStart,a=e.position,!Fd(e,n,2,!1,!0))break;if(e.line===s){for(u=e.input.charCodeAt(e.position);ud(u);)u=e.input.charCodeAt(++e.position);if(58===u)fd(u=e.input.charCodeAt(++e.position))||gd(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Sd(e,h,p,m,d,null,o,c,a),m=d=v=null),b=!0,y=!1,i=!1,m=e.tag,d=e.result;else{if(!b)return e.tag=f,e.anchor=l,!0;gd(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!b)return e.tag=f,e.anchor=l,!0;gd(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===u?(y&&(Sd(e,h,p,m,d,null,o,c,a),m=d=v=null),b=!0,y=!0,i=!0):y?(y=!1,i=!0):gd(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,u=r;if((e.line===s||e.lineIndent>t)&&(y&&(o=e.line,c=e.lineStart,a=e.position),Fd(e,t,4,!0,i)&&(y?d=e.result:v=e.result),y||(Sd(e,h,p,m,d,v,o,c,a),m=d=v=null),$d(e,!0,-1),u=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&0!==u)gd(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&Sd(e,h,p,m,d,null,o,c,a),b&&(e.tag=f,e.anchor=l,e.kind="mapping",e.result=h),b}(e,p,h))||function(e,t){var n,r,i,s,o,c,a,u,f,l,h,p,m=!0,d=e.tag,v=e.anchor,y=Object.create(null);if(91===(p=e.input.charCodeAt(e.position)))o=93,u=!1,s=[];else{if(123!==p)return!1;o=125,u=!0,s={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=s),p=e.input.charCodeAt(++e.position);0!==p;){if($d(e,!0,t),(p=e.input.charCodeAt(e.position))===o)return e.position++,e.tag=d,e.anchor=v,e.kind=u?"mapping":"sequence",e.result=s,!0;m?44===p&&gd(e,"expected the node content, but found ','"):gd(e,"missed comma between flow collection entries"),h=null,c=a=!1,63===p&&fd(e.input.charCodeAt(e.position+1))&&(c=a=!0,e.position++,$d(e,!0,t)),n=e.line,r=e.lineStart,i=e.position,Fd(e,t,1,!1,!0),l=e.tag,f=e.result,$d(e,!0,t),p=e.input.charCodeAt(e.position),!a&&e.line!==n||58!==p||(c=!0,p=e.input.charCodeAt(++e.position),$d(e,!0,t),Fd(e,t,1,!1,!0),h=e.result),u?Sd(e,s,y,l,f,h,n,r,i):c?s.push(Sd(e,null,y,l,f,h,n,r,i)):s.push(f),$d(e,!0,t),44===(p=e.input.charCodeAt(e.position))?(m=!0,p=e.input.charCodeAt(++e.position)):m=!1}gd(e,"unexpected end of the stream within a flow collection")}(e,h)?v=!0:(o&&function(e,t){var n,r,i,s,o,c=1,a=!1,u=!1,f=t,l=0,h=!1;if(124===(s=e.input.charCodeAt(e.position)))r=!1;else{if(62!==s)return!1;r=!0}for(e.kind="scalar",e.result="";0!==s;)if(43===(s=e.input.charCodeAt(++e.position))||45===s)1===c?c=43===s?3:2:gd(e,"repeat of a chomping mode identifier");else{if(!((i=48<=(o=s)&&o<=57?o-48:-1)>=0))break;0===i?gd(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?gd(e,"repeat of an indentation width identifier"):(f=t+i-1,u=!0)}if(ud(s)){do{s=e.input.charCodeAt(++e.position)}while(ud(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!ad(s)&&0!==s)}for(;0!==s;){for(Pd(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!u||e.lineIndent<f)&&32===s;)e.lineIndent++,s=e.input.charCodeAt(++e.position);if(!u&&e.lineIndent>f&&(f=e.lineIndent),ad(s))l++;else{if(e.lineIndent<f){3===c?e.result+=mm.repeat("\n",a?1+l:l):1===c&&a&&(e.result+="\n");break}for(r?ud(s)?(h=!0,e.result+=mm.repeat("\n",a?1+l:l)):h?(h=!1,e.result+=mm.repeat("\n",l+1)):0===l?a&&(e.result+=" "):e.result+=mm.repeat("\n",l):e.result+=mm.repeat("\n",a?1+l:l),a=!0,u=!0,l=0,n=e.position;!ad(s)&&0!==s;)s=e.input.charCodeAt(++e.position);Ed(e,n,e.position,!1)}}return!0}(e,h)||function(e,t){var n,r,i;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(Ed(e,r,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;r=e.position,e.position++,i=e.position}else ad(n)?(Ed(e,r,i,!0),Td(e,$d(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Ad(e)?gd(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);gd(e,"unexpected end of the stream within a single quoted scalar")}(e,h)||function(e,t){var n,r,i,s,o,c,a;if(34!==(c=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(c=e.input.charCodeAt(e.position));){if(34===c)return Ed(e,n,e.position,!0),e.position++,!0;if(92===c){if(Ed(e,n,e.position,!0),ad(c=e.input.charCodeAt(++e.position)))$d(e,!1,t);else if(c<256&&dd[c])e.result+=vd[c],e.position++;else if((o=120===(a=c)?2:117===a?4:85===a?8:0)>0){for(i=o,s=0;i>0;i--)(o=hd(c=e.input.charCodeAt(++e.position)))>=0?s=(s<<4)+o:gd(e,"expected hexadecimal character");e.result+=md(s),e.position++}else gd(e,"unknown escape sequence");n=r=e.position}else ad(c)?(Ed(e,n,r,!0),Td(e,$d(e,!1,t)),n=r=e.position):e.position===e.lineStart&&Ad(e)?gd(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}gd(e,"unexpected end of the stream within a double quoted scalar")}(e,h)?v=!0:!function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!fd(r)&&!ld(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&gd(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),td.call(e.anchorMap,n)||gd(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],$d(e,!0,-1),!0}(e)?function(e,t,n){var r,i,s,o,c,a,u,f,l=e.kind,h=e.result;if(fd(f=e.input.charCodeAt(e.position))||ld(f)||35===f||38===f||42===f||33===f||124===f||62===f||39===f||34===f||37===f||64===f||96===f)return!1;if((63===f||45===f)&&(fd(r=e.input.charCodeAt(e.position+1))||n&&ld(r)))return!1;for(e.kind="scalar",e.result="",i=s=e.position,o=!1;0!==f;){if(58===f){if(fd(r=e.input.charCodeAt(e.position+1))||n&&ld(r))break}else if(35===f){if(fd(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&Ad(e)||n&&ld(f))break;if(ad(f)){if(c=e.line,a=e.lineStart,u=e.lineIndent,$d(e,!1,-1),e.lineIndent>=t){o=!0,f=e.input.charCodeAt(e.position);continue}e.position=s,e.line=c,e.lineStart=a,e.lineIndent=u;break}}o&&(Ed(e,i,s,!1),Td(e,e.line-c),i=s=e.position,o=!1),ud(f)||(s=e.position+1),f=e.input.charCodeAt(++e.position)}return Ed(e,i,s,!1),!!e.result||(e.kind=l,e.result=h,!1)}(e,h,1===n)&&(v=!0,null===e.tag&&(e.tag="?")):(v=!0,null===e.tag&&null===e.anchor||gd(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===m&&(v=c&&Rd(e,p))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&gd(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),a=0,u=e.implicitTypes.length;a<u;a+=1)if((l=e.implicitTypes[a]).resolve(e.result)){e.result=l.construct(e.result),e.tag=l.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else if("!"!==e.tag){if(td.call(e.typeMap[e.kind||"fallback"],e.tag))l=e.typeMap[e.kind||"fallback"][e.tag];else for(l=null,a=0,u=(f=e.typeMap.multi[e.kind||"fallback"]).length;a<u;a+=1)if(e.tag.slice(0,f[a].tag.length)===f[a].tag){l=f[a];break}l||gd(e,"unknown tag !<"+e.tag+">"),null!==e.result&&l.kind!==e.kind&&gd(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+l.kind+'", not "'+e.kind+'"'),l.resolve(e.result,e.tag)?(e.result=l.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):gd(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||v}function Md(e){var t,n,r,i,s=e.position,o=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(i=e.input.charCodeAt(e.position))&&($d(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==i));){for(o=!0,i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!fd(i);)i=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&gd(e,"directive name must not be less than one character in length");0!==i;){for(;ud(i);)i=e.input.charCodeAt(++e.position);if(35===i){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&!ad(i));break}if(ad(i))break;for(t=e.position;0!==i&&!fd(i);)i=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==i&&Pd(e),td.call(Od,n)?Od[n](e,n,r):wd(e,'unknown document directive "'+n+'"')}$d(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,$d(e,!0,-1)):o&&gd(e,"directives end mark is expected"),Fd(e,e.lineIndent-1,4,!1,!0),$d(e,!0,-1),e.checkLineBreaks&&rd.test(e.input.slice(s,e.position))&&wd(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Ad(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,$d(e,!0,-1)):e.position<e.length-1&&gd(e,"end of the stream or a document separator is expected")}function Nd(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new bd(e,t),r=e.indexOf("\0");for(-1!==r&&(n.position=r,gd(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Md(n);return n.documents}var Cd=function(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var r=Nd(e,n);if("function"!=typeof t)return r;for(var i=0,s=r.length;i<s;i+=1)t(r[i])},Dd={loadAll:Cd,load:function(e,t){var n=Nd(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new ym("expected a single document in the stream, but found more")}}},qd=Object.prototype.toString,_d=Object.prototype.hasOwnProperty,Bd={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},Ld=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Ud=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Jd(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else{if(!(e<=4294967295))throw new ym("code point within a string may not be greater than 0xFFFFFFFF");n="U",r=8}return"\\"+n+mm.repeat("0",r-t.length)+t}function Vd(e){this.schema=e.schema||ed,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=mm.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,r,i,s,o,c,a;if(null===t)return{};for(n={},i=0,s=(r=Object.keys(t)).length;i<s;i+=1)o=r[i],c=String(t[o]),"!!"===o.slice(0,2)&&(o="tag:yaml.org,2002:"+o.slice(2)),(a=e.compiledTypeMap.fallback[o])&&_d.call(a.styleAliases,c)&&(c=a.styleAliases[c]),n[o]=c;return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType='"'===e.quotingType?2:1,this.forceQuotes=e.forceQuotes||!1,this.replacer="function"==typeof e.replacer?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Gd(e,t){for(var n,r=mm.repeat(" ",t),i=0,s=-1,o="",c=e.length;i<c;)-1===(s=e.indexOf("\n",i))?(n=e.slice(i),i=c):(n=e.slice(i,s+1),i=s+1),n.length&&"\n"!==n&&(o+=r),o+=n;return o}function zd(e,t){return"\n"+mm.repeat(" ",e.indent*t)}function Hd(e){return 32===e||9===e}function Wd(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&65279!==e||65536<=e&&e<=1114111}function Xd(e){return Wd(e)&&65279!==e&&13!==e&&10!==e}function Yd(e,t,n){var r=Xd(e),i=r&&!Hd(e);return(n?r:r&&44!==e&&91!==e&&93!==e&&123!==e&&125!==e)&&35!==e&&!(58===t&&!i)||Xd(t)&&!Hd(t)&&35===e||58===t&&i}function Kd(e,t){var n,r=e.charCodeAt(t);return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1))>=56320&&n<=57343?1024*(r-55296)+n-56320+65536:r}function Qd(e){return/^\n* /.test(e)}function Zd(e,t,n,r,i,s,o,c){var a,u,f=0,l=null,h=!1,p=!1,m=-1!==r,d=-1,v=Wd(u=Kd(e,0))&&65279!==u&&!Hd(u)&&45!==u&&63!==u&&58!==u&&44!==u&&91!==u&&93!==u&&123!==u&&125!==u&&35!==u&&38!==u&&42!==u&&33!==u&&124!==u&&61!==u&&62!==u&&39!==u&&34!==u&&37!==u&&64!==u&&96!==u&&function(e){return!Hd(e)&&58!==e}(Kd(e,e.length-1));if(t||o)for(a=0;a<e.length;f>=65536?a+=2:a++){if(!Wd(f=Kd(e,a)))return 5;v=v&&Yd(f,l,c),l=f}else{for(a=0;a<e.length;f>=65536?a+=2:a++){if(10===(f=Kd(e,a)))h=!0,m&&(p=p||a-d-1>r&&" "!==e[d+1],d=a);else if(!Wd(f))return 5;v=v&&Yd(f,l,c),l=f}p=p||m&&a-d-1>r&&" "!==e[d+1]}return h||p?n>9&&Qd(e)?5:o?2===s?5:2:p?4:3:!v||o||i(e)?2===s?5:2:1}function ev(e,t,n,r,i){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==Ld.indexOf(t)||Ud.test(t)))return 2===e.quotingType?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,n),o=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),c=r||e.flowLevel>-1&&n>=e.flowLevel;switch(Zd(t,c,e.indent,o,(function(t){return function(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)}),e.quotingType,e.forceQuotes&&!r,i)){case 1:return t;case 2:return"'"+t.replace(/'/g,"''")+"'";case 3:return"|"+tv(t,e.indent)+nv(Gd(t,s));case 4:return">"+tv(t,e.indent)+nv(Gd(function(e,t){var n,r,i=/(\n+)([^\n]*)/g,s=(c=e.indexOf("\n"),c=-1!==c?c:e.length,i.lastIndex=c,rv(e.slice(0,c),t)),o="\n"===e[0]||" "===e[0];var c;for(;r=i.exec(e);){var a=r[1],u=r[2];n=" "===u[0],s+=a+(o||n||""===u?"":"\n")+rv(u,t),o=n}return s}(t,o),s));case 5:return'"'+function(e){for(var t,n="",r=0,i=0;i<e.length;r>=65536?i+=2:i++)r=Kd(e,i),!(t=Bd[r])&&Wd(r)?(n+=e[i],r>=65536&&(n+=e[i+1])):n+=t||Jd(r);return n}(t)+'"';default:throw new ym("impossible error: invalid scalar style")}}()}function tv(e,t){var n=Qd(e)?String(t):"",r="\n"===e[e.length-1];return n+(r&&("\n"===e[e.length-2]||"\n"===e)?"+":r?"":"-")+"\n"}function nv(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function rv(e,t){if(""===e||" "===e[0])return e;for(var n,r,i=/ [^ ]/g,s=0,o=0,c=0,a="";n=i.exec(e);)(c=n.index)-s>t&&(r=o>s?o:c,a+="\n"+e.slice(s,r),s=r+1),o=c;return a+="\n",e.length-s>t&&o>s?a+=e.slice(s,o)+"\n"+e.slice(o+1):a+=e.slice(s),a.slice(1)}function iv(e,t,n,r){var i,s,o,c="",a=e.tag;for(i=0,s=n.length;i<s;i+=1)o=n[i],e.replacer&&(o=e.replacer.call(n,String(i),o)),(ov(e,t+1,o,!0,!0,!1,!0)||void 0===o&&ov(e,t+1,null,!0,!0,!1,!0))&&(r&&""===c||(c+=zd(e,t)),e.dump&&10===e.dump.charCodeAt(0)?c+="-":c+="- ",c+=e.dump);e.tag=a,e.dump=c||"[]"}function sv(e,t,n){var r,i,s,o,c,a;for(s=0,o=(i=n?e.explicitTypes:e.implicitTypes).length;s<o;s+=1)if(((c=i[s]).instanceOf||c.predicate)&&(!c.instanceOf||"object"==typeof t&&t instanceof c.instanceOf)&&(!c.predicate||c.predicate(t))){if(n?c.multi&&c.representName?e.tag=c.representName(t):e.tag=c.tag:e.tag="?",c.represent){if(a=e.styleMap[c.tag]||c.defaultStyle,"[object Function]"===qd.call(c.represent))r=c.represent(t,a);else{if(!_d.call(c.represent,a))throw new ym("!<"+c.tag+'> tag resolver accepts not "'+a+'" style');r=c.represent[a](t,a)}e.dump=r}return!0}return!1}function ov(e,t,n,r,i,s,o){e.tag=null,e.dump=n,sv(e,n,!1)||sv(e,n,!0);var c,a=qd.call(e.dump),u=r;r&&(r=e.flowLevel<0||e.flowLevel>t);var f,l,h="[object Object]"===a||"[object Array]"===a;if(h&&(l=-1!==(f=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||l||2!==e.indent&&t>0)&&(i=!1),l&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(h&&l&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),"[object Object]"===a)r&&0!==Object.keys(e.dump).length?(!function(e,t,n,r){var i,s,o,c,a,u,f="",l=e.tag,h=Object.keys(n);if(!0===e.sortKeys)h.sort();else if("function"==typeof e.sortKeys)h.sort(e.sortKeys);else if(e.sortKeys)throw new ym("sortKeys must be a boolean or a function");for(i=0,s=h.length;i<s;i+=1)u="",r&&""===f||(u+=zd(e,t)),c=n[o=h[i]],e.replacer&&(c=e.replacer.call(n,o,c)),ov(e,t+1,o,!0,!0,!0)&&((a=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&10===e.dump.charCodeAt(0)?u+="?":u+="? "),u+=e.dump,a&&(u+=zd(e,t)),ov(e,t+1,c,!0,a)&&(e.dump&&10===e.dump.charCodeAt(0)?u+=":":u+=": ",f+=u+=e.dump));e.tag=l,e.dump=f||"{}"}(e,t,e.dump,i),l&&(e.dump="&ref_"+f+e.dump)):(!function(e,t,n){var r,i,s,o,c,a="",u=e.tag,f=Object.keys(n);for(r=0,i=f.length;r<i;r+=1)c="",""!==a&&(c+=", "),e.condenseFlow&&(c+='"'),o=n[s=f[r]],e.replacer&&(o=e.replacer.call(n,s,o)),ov(e,t,s,!1,!1)&&(e.dump.length>1024&&(c+="? "),c+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),ov(e,t,o,!1,!1)&&(a+=c+=e.dump));e.tag=u,e.dump="{"+a+"}"}(e,t,e.dump),l&&(e.dump="&ref_"+f+" "+e.dump));else if("[object Array]"===a)r&&0!==e.dump.length?(e.noArrayIndent&&!o&&t>0?iv(e,t-1,e.dump,i):iv(e,t,e.dump,i),l&&(e.dump="&ref_"+f+e.dump)):(!function(e,t,n){var r,i,s,o="",c=e.tag;for(r=0,i=n.length;r<i;r+=1)s=n[r],e.replacer&&(s=e.replacer.call(n,String(r),s)),(ov(e,t,s,!1,!1)||void 0===s&&ov(e,t,null,!1,!1))&&(""!==o&&(o+=","+(e.condenseFlow?"":" ")),o+=e.dump);e.tag=c,e.dump="["+o+"]"}(e,t,e.dump),l&&(e.dump="&ref_"+f+" "+e.dump));else{if("[object String]"!==a){if("[object Undefined]"===a)return!1;if(e.skipInvalid)return!1;throw new ym("unacceptable kind of an object to dump "+a)}"?"!==e.tag&&ev(e,e.dump,t,s,u)}null!==e.tag&&"?"!==e.tag&&(c=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21"),c="!"===e.tag[0]?"!"+c:"tag:yaml.org,2002:"===c.slice(0,18)?"!!"+c.slice(18):"!<"+c+">",e.dump=c+" "+e.dump)}return!0}function cv(e,t){var n,r,i=[],s=[];for(av(e,i,s),n=0,r=s.length;n<r;n+=1)t.duplicates.push(i[s[n]]);t.usedDuplicates=new Array(r)}function av(e,t,n){var r,i,s;if(null!==e&&"object"==typeof e)if(-1!==(i=t.indexOf(e)))-1===n.indexOf(i)&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,s=e.length;i<s;i+=1)av(e[i],t,n);else for(i=0,s=(r=Object.keys(e)).length;i<s;i+=1)av(e[r[i]],t,n)}function uv(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var fv=Em,lv=Pm,hv=Rm,pv=_m,mv=Bm,dv=ed,vv=Dd.load,yv=Dd.loadAll,bv={dump:function(e,t){var n=new Vd(t=t||{});n.noRefs||cv(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),ov(n,0,r,!0,!0)?n.dump+"\n":""}}.dump,jv=ym,gv={binary:zm,float:qm,map:Tm,null:Im,pairs:Km,set:Zm,timestamp:Jm,bool:km,int:Nm,merge:Vm,omap:Xm,seq:Am,str:$m},wv=uv("safeLoad","load"),Ov=uv("safeLoadAll","loadAll"),Ev=uv("safeDump","dump"),xv={Type:fv,Schema:lv,FAILSAFE_SCHEMA:hv,JSON_SCHEMA:pv,CORE_SCHEMA:mv,DEFAULT_SCHEMA:dv,load:vv,loadAll:yv,dump:bv,YAMLException:jv,types:gv,safeLoad:wv,safeLoadAll:Ov,safeDump:Ev};const Sv="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:window,{FormData:Pv,Blob:$v,File:Av}=Sv,Tv=e=>":/?#[]@!$&'()*+,;=".indexOf(e)>-1,Rv=e=>/^[a-z0-9\-._~]+$/i.test(e);function Iv(e){let{escape:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return"number"==typeof e&&(e=e.toString()),"string"==typeof e&&e.length&&t?n?JSON.parse(e):[...e].map((e=>{if(Rv(e))return e;if(Tv(e)&&"unsafe"===t)return e;const n=new TextEncoder;return Array.from(n.encode(e)).map((e=>`0${e.toString(16).toUpperCase()}`.slice(-2))).map((e=>`%${e}`)).join("")})).join(""):e}function kv(e){const{value:t}=e;return Array.isArray(t)?function(e){let{key:t,value:n,style:r,explode:i,escape:s}=e;const o=e=>Iv(e,{escape:s});if("simple"===r)return n.map((e=>o(e))).join(",");if("label"===r)return`.${n.map((e=>o(e))).join(".")}`;if("matrix"===r)return n.map((e=>o(e))).reduce(((e,n)=>!e||i?`${e||""};${t}=${n}`:`${e},${n}`),"");if("form"===r){const e=i?`&${t}=`:",";return n.map((e=>o(e))).join(e)}if("spaceDelimited"===r){const e=i?`${t}=`:"";return n.map((e=>o(e))).join(` ${e}`)}if("pipeDelimited"===r){const e=i?`${t}=`:"";return n.map((e=>o(e))).join(`|${e}`)}return}(e):"object"==typeof t?function(e){let{key:t,value:n,style:r,explode:i,escape:s}=e;const o=e=>Iv(e,{escape:s}),c=Object.keys(n);if("simple"===r)return c.reduce(((e,t)=>{const r=o(n[t]);return`${e?`${e},`:""}${t}${i?"=":","}${r}`}),"");if("label"===r)return c.reduce(((e,t)=>{const r=o(n[t]);return`${e?`${e}.`:"."}${t}${i?"=":"."}${r}`}),"");if("matrix"===r&&i)return c.reduce(((e,t)=>`${e?`${e};`:";"}${t}=${o(n[t])}`),"");if("matrix"===r)return c.reduce(((e,r)=>{const i=o(n[r]);return`${e?`${e},`:`;${t}=`}${r},${i}`}),"");if("form"===r)return c.reduce(((e,t)=>{const r=o(n[t]);return`${e?`${e}${i?"&":","}`:""}${t}${i?"=":","}${r}`}),"");return}(e):function(e){let{key:t,value:n,style:r,escape:i}=e;const s=e=>Iv(e,{escape:i});if("simple"===r)return s(n);if("label"===r)return`.${s(n)}`;if("matrix"===r)return`;${t}=${s(n)}`;if("form"===r)return s(n);if("deepObject"===r)return s(n);return}(e)}const Fv=(e,t)=>{t.body=e},Mv={serializeRes:qv,mergeInQueryOrForm:Xv};async function Nv(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"object"==typeof e&&(t=e,e=t.url),t.headers=t.headers||{},Mv.mergeInQueryOrForm(t),t.headers&&Object.keys(t.headers).forEach((e=>{const n=t.headers[e];"string"==typeof n&&(t.headers[e]=n.replace(/\n+/g," "))})),t.requestInterceptor&&(t=await t.requestInterceptor(t)||t);const n=t.headers["content-type"]||t.headers["Content-Type"];let r;/multipart\/form-data/i.test(n)&&t.body instanceof Pv&&(delete t.headers["content-type"],delete t.headers["Content-Type"]);try{r=await(t.userFetch||fetch)(t.url,t),r=await Mv.serializeRes(r,e,t),t.responseInterceptor&&(r=await t.responseInterceptor(r)||r)}catch(e){if(!r)throw e;const t=new Error(r.statusText||`response status is ${r.status}`);throw t.status=r.status,t.statusCode=r.status,t.responseError=e,t}if(!r.ok){const e=new Error(r.statusText||`response status is ${r.status}`);throw e.status=r.status,e.statusCode=r.status,e.response=r,e}return r}const Cv=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/(json|xml|yaml|text)\b/.test(e)};function Dv(e,t){return t&&(0===t.indexOf("application/json")||t.indexOf("+json")>0)?JSON.parse(e):xv.load(e)}function qv(e,t){let{loadSpec:n=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={ok:e.ok,url:e.url||t,status:e.status,statusText:e.statusText,headers:Bv(e.headers)},i=r.headers["content-type"],s=n||Cv(i),o=s?e.text:e.blob||e.buffer;return o.call(e).then((e=>{if(r.text=e,r.data=e,s)try{const t=Dv(e,i);r.body=t,r.obj=t}catch(e){r.parseError=e}return r}))}function _v(e){return e.includes(", ")?e.split(", "):e}function Bv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"function"!=typeof e.entries?{}:Array.from(e.entries()).reduce(((e,t)=>{let[n,r]=t;return e[n]=_v(r),e}),{})}function Lv(e,t){return t||"undefined"==typeof navigator||(t=navigator),t&&"ReactNative"===t.product?!(!e||"object"!=typeof e||"string"!=typeof e.uri):void 0!==Av&&e instanceof Av||(void 0!==$v&&e instanceof $v||(!!ArrayBuffer.isView(e)||null!==e&&"object"==typeof e&&"function"==typeof e.pipe))}function Uv(e,t){return Array.isArray(e)&&e.some((e=>Lv(e,t)))}const Jv={form:",",spaceDelimited:"%20",pipeDelimited:"|"},Vv={csv:",",ssv:"%20",tsv:"%09",pipes:"|"};function Gv(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{collectionFormat:r,allowEmptyValue:i,serializationOption:s,encoding:o}=t,c="object"!=typeof t||Array.isArray(t)?t:t.value,a=n?e=>e.toString():e=>encodeURIComponent(e),u=a(e);if(void 0===c&&i)return[[u,""]];if(Lv(c)||Uv(c))return[[u,c]];if(s)return zv(e,c,n,s);if(o){if([typeof o.style,typeof o.explode,typeof o.allowReserved].some((e=>"undefined"!==e))){const{style:t,explode:r,allowReserved:i}=o;return zv(e,c,n,{style:t,explode:r,allowReserved:i})}if(o.contentType){if("application/json"===o.contentType){return[[u,a("string"==typeof c?c:JSON.stringify(c))]]}return[[u,a(c.toString())]]}return"object"!=typeof c?[[u,a(c)]]:Array.isArray(c)&&c.every((e=>"object"!=typeof e))?[[u,c.map(a).join(",")]]:[[u,a(JSON.stringify(c))]]}return"object"!=typeof c?[[u,a(c)]]:Array.isArray(c)?"multi"===r?[[u,c.map(a)]]:[[u,c.map(a).join(Vv[r||"csv"])]]:[[u,""]]}function zv(e,t,n,r){const i=r.style||"form",s=void 0===r.explode?"form"===i:r.explode,o=!n&&(r&&r.allowReserved?"unsafe":"reserved"),c=e=>Iv(e,{escape:o}),a=n?e=>e:e=>Iv(e,{escape:o});return"object"!=typeof t?[[a(e),c(t)]]:Array.isArray(t)?s?[[a(e),t.map(c)]]:[[a(e),t.map(c).join(Jv[i])]]:"deepObject"===i?Object.keys(t).map((n=>[a(`${e}[${n}]`),c(t[n])])):s?Object.keys(t).map((e=>[a(e),c(t[e])])):[[a(e),Object.keys(t).map((e=>[`${a(e)},${c(t[e])}`])).join(",")]]}function Hv(e){return Object.entries(e).reduce(((e,t)=>{let[n,r]=t;for(const[t,i]of Gv(n,r,!0))if(Array.isArray(i))for(const n of i)if(ArrayBuffer.isView(n)){const r=new $v([n]);e.append(t,r)}else e.append(t,n);else if(ArrayBuffer.isView(i)){const n=new $v([i]);e.append(t,n)}else e.append(t,i);return e}),new Pv)}function Wv(e){const t=Object.keys(e).reduce(((t,n)=>{for(const[r,i]of Gv(n,e[n]))t[r]=i;return t}),{});return lm.stringify(t,{encode:!1,indices:!1})||""}function Xv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{url:t="",query:n,form:r}=e,i=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t.filter((e=>e)).join("&");return r?`?${r}`:""};if(r){const t=Object.keys(r).some((e=>{const{value:t}=r[e];return Lv(t)||Uv(t)})),n=e.headers["content-type"]||e.headers["Content-Type"];if(t||/multipart\/form-data/i.test(n)){const t=Hv(e.form);Fv(t,e)}else e.body=Wv(r);delete e.form}if(n){const[r,s]=t.split("?");let o="";if(s){const e=lm.parse(s);Object.keys(n).forEach((t=>delete e[t])),o=lm.stringify(e,{encode:!0})}const c=i(o,Wv(n));e.url=r+c,delete e.query}return e}function Yv(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{requestInterceptor:n,responseInterceptor:r}=t,i=e.withCredentials?"include":"same-origin";return t=>e({url:t,loadSpec:!0,requestInterceptor:n,responseInterceptor:r,headers:{Accept:"application/json, application/yaml"},credentials:i}).then((e=>e.body))}const Kv=e=>{const{baseDoc:t,url:n}=e;return t||n||""},Qv=e=>{const{fetch:t,http:n}=e;return t||n||Nv};
/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017-2022 Joachim Wester
* MIT licensed
*/
var Zv,ey=globalThis&&globalThis.__extends||(Zv=function(e,t){return Zv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},Zv(e,t)},function(e,t){function n(){this.constructor=e}Zv(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ty=Object.prototype.hasOwnProperty;function ny(e,t){return ty.call(e,t)}function ry(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var r=[];for(var i in e)ny(e,i)&&r.push(i);return r}function iy(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function sy(e){for(var t,n=0,r=e.length;n<r;){if(!((t=e.charCodeAt(n))>=48&&t<=57))return!1;n++}return!0}function oy(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function cy(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function ay(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(ay(e[t]))return!0}else if("object"==typeof e)for(var r=ry(e),i=r.length,s=0;s<i;s++)if(ay(e[r[s]]))return!0;return!1}function uy(e,t){var n=[e];for(var r in t){var i="object"==typeof t[r]?JSON.stringify(t[r],null,2):t[r];void 0!==i&&n.push(r+": "+i)}return n.join("\n")}var fy=function(e){function t(t,n,r,i,s){var o=this.constructor,c=e.call(this,uy(t,{name:n,index:r,operation:i,tree:s}))||this;return c.name=n,c.index=r,c.operation=i,c.tree=s,Object.setPrototypeOf(c,o.prototype),c.message=uy(t,{name:n,index:r,operation:i,tree:s}),c}return ey(t,e),t}(Error),ly=fy,hy=iy,py={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=dy(n,this.path);r&&(r=iy(r));var i=vy(n,{op:"remove",path:this.from}).removed;return vy(n,{op:"add",path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=dy(n,this.from);return vy(n,{op:"add",path:this.path,value:iy(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:gy(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},my={add:function(e,t,n){return sy(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:py.move,copy:py.copy,test:py.test,_get:py._get};function dy(e,t){if(""==t)return e;var n={op:"_get",path:t};return vy(e,n),n.value}function vy(e,t,n,r,i,s){if(void 0===n&&(n=!1),void 0===r&&(r=!0),void 0===i&&(i=!0),void 0===s&&(s=0),n&&("function"==typeof n?n(t,0,e,t.path):by(t,0)),""===t.path){var o={newDocument:e};if("add"===t.op)return o.newDocument=t.value,o;if("replace"===t.op)return o.newDocument=t.value,o.removed=e,o;if("move"===t.op||"copy"===t.op)return o.newDocument=dy(e,t.from),"move"===t.op&&(o.removed=e),o;if("test"===t.op){if(o.test=gy(e,t.value),!1===o.test)throw new ly("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o.newDocument=e,o}if("remove"===t.op)return o.removed=e,o.newDocument=null,o;if("_get"===t.op)return t.value=e,o;if(n)throw new ly("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,t,e);return o}r||(e=iy(e));var c=(t.path||"").split("/"),a=e,u=1,f=c.length,l=void 0,h=void 0,p=void 0;for(p="function"==typeof n?n:by;;){if((h=c[u])&&-1!=h.indexOf("~")&&(h=cy(h)),i&&("__proto__"==h||"prototype"==h&&u>0&&"constructor"==c[u-1]))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&void 0===l&&(void 0===a[h]?l=c.slice(0,u).join("/"):u==f-1&&(l=t.path),void 0!==l&&p(t,0,e,l)),u++,Array.isArray(a)){if("-"===h)h=a.length;else{if(n&&!sy(h))throw new ly("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);sy(h)&&(h=~~h)}if(u>=f){if(n&&"add"===t.op&&h>a.length)throw new ly("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);if(!1===(o=my[t.op].call(t,a,h,e)).test)throw new ly("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}}else if(u>=f){if(!1===(o=py[t.op].call(t,a,h,e)).test)throw new ly("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}if(a=a[h],n&&u<f&&(!a||"object"!=typeof a))throw new ly("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,t,e)}}function yy(e,t,n,r,i){if(void 0===r&&(r=!0),void 0===i&&(i=!0),n&&!Array.isArray(t))throw new ly("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");r||(e=iy(e));for(var s=new Array(t.length),o=0,c=t.length;o<c;o++)s[o]=vy(e,t[o],n,!0,i,o),e=s[o].newDocument;return s.newDocument=e,s}function by(e,t,n,r){if("object"!=typeof e||null===e||Array.isArray(e))throw new ly("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(!py[e.op])throw new ly("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n);if("string"!=typeof e.path)throw new ly("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new ly('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new ly("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new ly("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&ay(e.value))throw new ly("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n)if("add"==e.op){var i=e.path.split("/").length,s=r.split("/").length;if(i!==s+1&&i!==s)throw new ly("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==r)throw new ly("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if("move"===e.op||"copy"===e.op){var o=jy([{op:"_get",path:e.from,value:void 0}],n);if(o&&"OPERATION_PATH_UNRESOLVABLE"===o.name)throw new ly("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}function jy(e,t,n){try{if(!Array.isArray(e))throw new ly("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)yy(iy(t),iy(e),n||!0);else{n=n||by;for(var r=0;r<e.length;r++)n(e[r],r,t,void 0)}}catch(e){if(e instanceof ly)return e;throw e}}function gy(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var n,r,i,s=Array.isArray(e),o=Array.isArray(t);if(s&&o){if((r=e.length)!=t.length)return!1;for(n=r;0!=n--;)if(!gy(e[n],t[n]))return!1;return!0}if(s!=o)return!1;var c=Object.keys(e);if((r=c.length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!t.hasOwnProperty(c[n]))return!1;for(n=r;0!=n--;)if(!gy(e[i=c[n]],t[i]))return!1;return!0}return e!=e&&t!=t}const wy=Object.freeze(Object.defineProperty({__proto__:null,JsonPatchError:ly,_areEquals:gy,applyOperation:vy,applyPatch:yy,applyReducer:function(e,t,n){var r=vy(e,t);if(!1===r.test)throw new ly("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return r.newDocument},deepClone:hy,getValueByPointer:dy,validate:jy,validator:by},Symbol.toStringTag,{value:"Module"}));
/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017-2021 Joachim Wester
* MIT license
*/var Oy=new WeakMap,Ey=function(e){this.observers=new Map,this.obj=e},xy=function(e,t){this.callback=e,this.observer=t};function Sy(e,t){void 0===t&&(t=!1);var n=Oy.get(e.object);Py(n.value,e.object,e.patches,"",t),e.patches.length&&yy(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function Py(e,t,n,r,i){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var s=ry(t),o=ry(e),c=!1,a=o.length-1;a>=0;a--){var u=e[l=o[a]];if(!ny(t,l)||void 0===t[l]&&void 0!==u&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:"test",path:r+"/"+oy(l),value:iy(u)}),n.push({op:"remove",path:r+"/"+oy(l)}),c=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}));else{var f=t[l];"object"==typeof u&&null!=u&&"object"==typeof f&&null!=f&&Array.isArray(u)===Array.isArray(f)?Py(u,f,n,r+"/"+oy(l),i):u!==f&&(i&&n.push({op:"test",path:r+"/"+oy(l),value:iy(u)}),n.push({op:"replace",path:r+"/"+oy(l),value:iy(f)}))}}if(c||s.length!=o.length)for(a=0;a<s.length;a++){var l;ny(e,l=s[a])||void 0===t[l]||n.push({op:"add",path:r+"/"+oy(l),value:iy(t[l])})}}}const $y=Object.freeze(Object.defineProperty({__proto__:null,compare:function(e,t,n){void 0===n&&(n=!1);var r=[];return Py(e,t,r,"",n),r},generate:Sy,observe:function(e,t){var n,r=function(e){return Oy.get(e)}(e);if(r){var i=function(e,t){return e.observers.get(t)}(r,t);n=i&&i.observer}else r=new Ey(e),Oy.set(e,r);if(n)return n;if(n={},r.value=iy(e),t){n.callback=t,n.next=null;var s=function(){Sy(n)},o=function(){clearTimeout(n.next),n.next=setTimeout(s)};"undefined"!=typeof window&&(window.addEventListener("mouseup",o),window.addEventListener("keyup",o),window.addEventListener("mousedown",o),window.addEventListener("keydown",o),window.addEventListener("change",o))}return n.patches=[],n.object=e,n.unobserve=function(){Sy(n),clearTimeout(n.next),function(e,t){e.observers.delete(t.callback)}(r,n),"undefined"!=typeof window&&(window.removeEventListener("mouseup",o),window.removeEventListener("keyup",o),window.removeEventListener("mousedown",o),window.removeEventListener("keydown",o),window.removeEventListener("change",o))},r.observers.set(t,new xy(t,n)),n},unobserve:function(e,t){t.unobserve()}},Symbol.toStringTag,{value:"Module"}));Object.assign({},wy,$y,{JsonPatchError:fy,deepClone:iy,escapePathComponent:oy,unescapePathComponent:cy});var Ay=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Ty}(e)}(e)};var Ty="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Ry(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Ny((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Iy(e,t,n){return e.concat(t).map((function(e){return Ry(e,n)}))}function ky(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function Fy(e,t){try{return t in e}catch(e){return!1}}function My(e,t,n){var r={};return n.isMergeableObject(e)&&ky(e).forEach((function(t){r[t]=Ry(e[t],n)})),ky(t).forEach((function(i){(function(e,t){return Fy(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(Fy(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return Ny;var n=t.customMerge(e);return"function"==typeof n?n:Ny}(i,n)(e[i],t[i],n):r[i]=Ry(t[i],n))})),r}function Ny(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Iy,n.isMergeableObject=n.isMergeableObject||Ay,n.cloneUnlessOtherwiseSpecified=Ry;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):My(e,t,n):Ry(t,n)}Ny.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return Ny(e,n,t)}),{})};const Cy=openapi_parser_e(Ny),Dy={add:function(e,t){return{op:"add",path:e,value:t}},replace:_y,remove:function(e){return{op:"remove",path:e}},merge:function(e,t){return{type:"mutation",op:"merge",path:e,value:t}},mergeDeep:function(e,t){return{type:"mutation",op:"mergeDeep",path:e,value:t}},context:function(e,t){return{type:"context",path:e,value:t}},getIn:function(e,t){return t.reduce(((e,t)=>void 0!==t&&e?e[t]:e),e)},applyPatch:function(e,t,n){if(n=n||{},"merge"===(t=vl(vl({},t),{},{path:t.path&&qy(t.path)})).op){const n=Qy(e,t.path);Object.assign(n,t.value),yy(e,[_y(t.path,n)])}else if("mergeDeep"===t.op){const n=Qy(e,t.path),r=Cy(n,t.value);e=yy(e,[_y(t.path,r)]).newDocument}else if("add"===t.op&&""===t.path&&zy(t.value)){const n=Object.keys(t.value).reduce(((e,n)=>(e.push({op:"add",path:`/${qy(n)}`,value:t.value[n]}),e)),[]);yy(e,n)}else if("replace"===t.op&&""===t.path){let{value:r}=t;n.allowMetaPatches&&t.meta&&Yy(t)&&(Array.isArray(t.value)||zy(t.value))&&(r=vl(vl({},r),t.meta)),e=r}else if(yy(e,[t]),n.allowMetaPatches&&t.meta&&Yy(t)&&(Array.isArray(t.value)||zy(t.value))){const n=vl(vl({},Qy(e,t.path)),t.meta);yy(e,[_y(t.path,n)])}return e},parentPathMatch:function(e,t){if(!Array.isArray(t))return!1;for(let n=0,r=t.length;n<r;n+=1)if(t[n]!==e[n])return!1;return!0},flatten:Vy,fullyNormalizeArray:function(e){return Gy(Vy(Jy(e)))},normalizeArray:Jy,isPromise:function(e){return zy(e)&&Hy(e.then)},forEachNew:function(e,t){try{return By(e,Uy,t)}catch(e){return e}},forEachNewPrimitive:function(e,t){try{return By(e,Ly,t)}catch(e){return e}},isJsonPatch:Wy,isContextPatch:function(e){return Ky(e)&&"context"===e.type},isPatch:Ky,isMutation:Xy,isAdditiveMutation:Yy,isGenerator:function(e){return"[object GeneratorFunction]"===Object.prototype.toString.call(e)},isFunction:Hy,isObject:zy,isError:function(e){return e instanceof Error}};function qy(e){return Array.isArray(e)?e.length<1?"":`/${e.map((e=>(e+"").replace(/~/g,"~0").replace(/\//g,"~1"))).join("/")}`:e}function _y(e,t,n){return{op:"replace",path:e,value:t,meta:n}}function By(e,t,n){return Gy(Vy(e.filter(Yy).map((e=>t(e.value,n,e.path)))||[]))}function Ly(e,t,n){return n=n||[],Array.isArray(e)?e.map(((e,r)=>Ly(e,t,n.concat(r)))):zy(e)?Object.keys(e).map((r=>Ly(e[r],t,n.concat(r)))):t(e,n[n.length-1],n)}function Uy(e,t,n){let r=[];if((n=n||[]).length>0){const i=t(e,n[n.length-1],n);i&&(r=r.concat(i))}if(Array.isArray(e)){const i=e.map(((e,r)=>Uy(e,t,n.concat(r))));i&&(r=r.concat(i))}else if(zy(e)){const i=Object.keys(e).map((r=>Uy(e[r],t,n.concat(r))));i&&(r=r.concat(i))}return r=Vy(r),r}function Jy(e){return Array.isArray(e)?e:[e]}function Vy(e){return[].concat(...e.map((e=>Array.isArray(e)?Vy(e):e)))}function Gy(e){return e.filter((e=>void 0!==e))}function zy(e){return e&&"object"==typeof e}function Hy(e){return e&&"function"==typeof e}function Wy(e){if(Ky(e)){const{op:t}=e;return"add"===t||"remove"===t||"replace"===t}return!1}function Xy(e){return Wy(e)||Ky(e)&&"mutation"===e.type}function Yy(e){return Xy(e)&&("add"===e.op||"replace"===e.op||"merge"===e.op||"mergeDeep"===e.op)}function Ky(e){return e&&"object"==typeof e}function Qy(e,t){try{return dy(e,t)}catch(e){return console.error(e),{}}}function Zy(e,t){function n(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack;for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];[this.message]=n,t&&t.apply(this,n)}return n.prototype=new Error,n.prototype.name=e,n.prototype.constructor=n,n}var eb={exports:{}},tb=eb.exports=function(e){return new nb(e)};function nb(e){this.value=e}function rb(e,t,n){var r=[],i=[],s=!0;return function e(o){var c=n?ib(o):o,a={},u=!0,f={node:c,node_:o,path:[].concat(r),parent:i[i.length-1],parents:i,key:r.slice(-1)[0],isRoot:0===r.length,level:r.length,circular:null,update:function(e,t){f.isRoot||(f.parent.node[f.key]=e),f.node=e,t&&(u=!1)},delete:function(e){delete f.parent.node[f.key],e&&(u=!1)},remove:function(e){cb(f.parent.node)?f.parent.node.splice(f.key,1):delete f.parent.node[f.key],e&&(u=!1)},keys:null,before:function(e){a.before=e},after:function(e){a.after=e},pre:function(e){a.pre=e},post:function(e){a.post=e},stop:function(){s=!1},block:function(){u=!1}};if(!s)return f;function l(){if("object"==typeof f.node&&null!==f.node){f.keys&&f.node_===f.node||(f.keys=sb(f.node)),f.isLeaf=0==f.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===o){f.circular=i[e];break}}else f.isLeaf=!0,f.keys=null;f.notLeaf=!f.isLeaf,f.notRoot=!f.isRoot}l();var h=t.call(f,f.node);return void 0!==h&&f.update&&f.update(h),a.before&&a.before.call(f,f.node),u?("object"!=typeof f.node||null===f.node||f.circular||(i.push(f),l(),ab(f.keys,(function(t,i){r.push(t),a.pre&&a.pre.call(f,f.node[t],t);var s=e(f.node[t]);n&&ub.call(f.node,t)&&(f.node[t]=s.node),s.isLast=i==f.keys.length-1,s.isFirst=0==i,a.post&&a.post.call(f,s),r.pop()})),i.pop()),a.after&&a.after.call(f,f.node),f):f}(e).node}function ib(e){if("object"==typeof e&&null!==e){var t;if(cb(e))t=[];else if("[object Date]"===ob(e))t=new Date(e.getTime?e.getTime():e);else if(function(e){return"[object RegExp]"===ob(e)}(e))t=new RegExp(e);else if(function(e){return"[object Error]"===ob(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===ob(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===ob(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===ob(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},r=function(){};r.prototype=n,t=new r}return ab(sb(e),(function(n){t[n]=e[n]})),t}return e}nb.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!ub.call(t,r)){t=void 0;break}t=t[r]}return t},nb.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!ub.call(t,r))return!1;t=t[r]}return!0},nb.prototype.set=function(e,t){for(var n=this.value,r=0;r<e.length-1;r++){var i=e[r];ub.call(n,i)||(n[i]={}),n=n[i]}return n[e[r]]=t,t},nb.prototype.map=function(e){return rb(this.value,e,!0)},nb.prototype.forEach=function(e){return this.value=rb(this.value,e,!1),this.value},nb.prototype.reduce=function(e,t){var n=1===arguments.length,r=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(r=e.call(this,r,t))})),r},nb.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},nb.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},nb.prototype.clone=function(){var e=[],t=[];return function n(r){for(var i=0;i<e.length;i++)if(e[i]===r)return t[i];if("object"==typeof r&&null!==r){var s=ib(r);return e.push(r),t.push(s),ab(sb(r),(function(e){s[e]=n(r[e])})),e.pop(),t.pop(),s}return r}(this.value)};var sb=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function ob(e){return Object.prototype.toString.call(e)}var cb=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},ab=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};ab(sb(nb.prototype),(function(e){tb[e]=function(t){var n=[].slice.call(arguments,1),r=new nb(t);return r[e].apply(r,n)}}));var ub=Object.hasOwnProperty||function(e,t){return t in e};const fb=openapi_parser_e(eb.exports),lb=["properties"],hb=["properties"],pb=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"],mb=["schema/example","items/example"];function db(e){const t=e[e.length-1],n=e[e.length-2],r=e.join("/");return lb.indexOf(t)>-1&&-1===hb.indexOf(n)||pb.indexOf(r)>-1||mb.some((e=>r.indexOf(e)>-1))}function vb(e,t){const[n,r]=e.split("#"),i=yl.resolve(n||"",t||"");return r?`${i}#${r}`:i}const yb=/^([a-z]+:\/\/|\/\/)/i,bb=Zy("JSONRefError",(function(e,t,n){this.originalError=n,Object.assign(this,t||{})})),jb={},gb=new WeakMap,wb=[e=>"paths"===e[0]&&"responses"===e[3]&&"examples"===e[5],e=>"paths"===e[0]&&"responses"===e[3]&&"content"===e[5]&&"example"===e[7],e=>"paths"===e[0]&&"responses"===e[3]&&"content"===e[5]&&"examples"===e[7]&&"value"===e[9],e=>"paths"===e[0]&&"requestBody"===e[3]&&"content"===e[4]&&"example"===e[6],e=>"paths"===e[0]&&"requestBody"===e[3]&&"content"===e[4]&&"examples"===e[6]&&"value"===e[8],e=>"paths"===e[0]&&"parameters"===e[2]&&"example"===e[4],e=>"paths"===e[0]&&"parameters"===e[3]&&"example"===e[5],e=>"paths"===e[0]&&"parameters"===e[2]&&"examples"===e[4]&&"value"===e[6],e=>"paths"===e[0]&&"parameters"===e[3]&&"examples"===e[5]&&"value"===e[7],e=>"paths"===e[0]&&"parameters"===e[2]&&"content"===e[4]&&"example"===e[6],e=>"paths"===e[0]&&"parameters"===e[2]&&"content"===e[4]&&"examples"===e[6]&&"value"===e[8],e=>"paths"===e[0]&&"parameters"===e[3]&&"content"===e[4]&&"example"===e[7],e=>"paths"===e[0]&&"parameters"===e[3]&&"content"===e[5]&&"examples"===e[7]&&"value"===e[9]],Ob={key:"$ref",plugin:(e,t,n,r)=>{const i=r.getInstance(),s=n.slice(0,-1);if(db(s)||(e=>wb.some((t=>t(e))))(s))return;const{baseDoc:o}=r.getContext(n);if("string"!=typeof e)return new bb("$ref: must be a string (JSON-Ref)",{$ref:e,baseDoc:o,fullPath:n});const c=Pb(e),a=c[0],u=c[1]||"";let f,l,h;try{f=o||a?xb(a,o):null}catch(t){return Sb(t,{pointer:u,$ref:e,basePath:f,fullPath:n})}if(function(e,t,n,r){let i=gb.get(r);i||(i={},gb.set(r,i));const s=function(e){if(0===e.length)return"";return`/${e.map(kb).join("/")}`}(n),o=`${t||"<specmap-base>"}#${e}`,c=s.replace(/allOf\/\d+\/?/g,""),a=r.contextTree.get([]).baseDoc;if(t===a&&Fb(c,e))return!0;let u="";const f=n.some((e=>(u=`${u}/${kb(e)}`,i[u]&&i[u].some((e=>Fb(e,o)||Fb(o,e))))));if(f)return!0;return void(i[c]=(i[c]||[]).concat(o))}(u,f,s,r)&&!i.useCircularStructures){const t=vb(e,f);return e===t?null:Dy.replace(n,t)}if(null==f?(h=Rb(u),l=r.get(h),void 0===l&&(l=new bb(`Could not resolve reference: ${e}`,{pointer:u,$ref:e,baseDoc:o,fullPath:n}))):(l=$b(f,u),l=null!=l.l?l.l:l.catch((t=>{throw Sb(t,{pointer:u,$ref:e,baseDoc:o,fullPath:n})}))),l instanceof Error)return[Dy.remove(n),l];const p=vb(e,f),m=Dy.replace(s,l,{$$ref:p});if(f&&f!==o)return[m,Dy.context(s,{baseDoc:f})];try{if(!function(e,t){const n=[e];return t.path.reduce(((e,t)=>(n.push(e[t]),e[t])),e),r(t.value);function r(e){return Dy.isObject(e)&&(n.indexOf(e)>=0||Object.keys(e).some((t=>r(e[t]))))}}(r.state,m)||i.useCircularStructures)return m}catch(e){return null}}},Eb=Object.assign(Ob,{docCache:jb,absoluteify:xb,clearCache:function(e){void 0!==e?delete jb[e]:Object.keys(jb).forEach((e=>{delete jb[e]}))},JSONRefError:bb,wrapError:Sb,getDoc:Ab,split:Pb,extractFromDoc:$b,fetchJSON:function(e){return fetch(e,{headers:{Accept:"application/json, application/yaml"},loadSpec:!0}).then((e=>e.text())).then((e=>xv.load(e)))},extract:Tb,jsonPointerToArray:Rb,unescapeJsonPointerToken:Ib});function xb(e,t){if(!yb.test(e)){if(!t)throw new bb(`Tried to resolve a relative URL, without having a basePath. path: '${e}' basePath: '${t}'`);return yl.resolve(t,e)}return e}function Sb(e,t){let n;return n=e&&e.response&&e.response.body?`${e.response.body.code} ${e.response.body.message}`:e.message,new bb(`Could not resolve reference: ${n}`,t,e)}function Pb(e){return(e+"").split("#")}function $b(e,t){const n=jb[e];if(n&&!Dy.isPromise(n))try{const e=Tb(t,n);return Object.assign(Promise.resolve(e),{l:e})}catch(e){return Promise.reject(e)}return Ab(e).then((e=>Tb(t,e)))}function Ab(e){const t=jb[e];return t?Dy.isPromise(t)?t:Promise.resolve(t):(jb[e]=Eb.fetchJSON(e).then((t=>(jb[e]=t,t))),jb[e])}function Tb(e,t){const n=Rb(e);if(n.length<1)return t;const r=Dy.getIn(t,n);if(void 0===r)throw new bb(`Could not resolve pointer: ${e} does not exist in document`,{pointer:e});return r}function Rb(e){if("string"!=typeof e)throw new TypeError("Expected a string, got a "+typeof e);return"/"===e[0]&&(e=e.substr(1)),""===e?[]:e.split("/").map(Ib)}function Ib(e){if("string"!=typeof e)return e;return new URLSearchParams(`=${e.replace(/~1/g,"/").replace(/~0/g,"~")}`).get("")}function kb(e){return new URLSearchParams([["",e.replace(/~/g,"~0").replace(/\//g,"~1")]]).toString().slice(1)}function Fb(e,t){if(!(n=t)||"/"===n||"#"===n)return!0;var n;const r=e.charAt(t.length),i=t.slice(-1);return 0===e.indexOf(t)&&(!r||"/"===r||"#"===r)&&"#"!==i}const Mb={key:"allOf",plugin:(e,t,n,r,i)=>{if(i.meta&&i.meta.$$ref)return;const s=n.slice(0,-1);if(db(s))return;if(!Array.isArray(e)){const e=new TypeError("allOf must be an array");return e.fullPath=n,e}let o=!1,c=i.value;if(s.forEach((e=>{c&&(c=c[e])})),c=vl({},c),0===Object.keys(c).length)return;delete c.allOf;const a=[];return a.push(r.replace(s,{})),e.forEach(((e,t)=>{if(!r.isObject(e)){if(o)return null;o=!0;const e=new TypeError("Elements in allOf must be objects");return e.fullPath=n,a.push(e)}a.push(r.mergeDeep(s,e));const i=function(e,t){let{specmap:n,getBaseUrlForNodePath:r=(e=>n.getContext([...t,...e]).baseDoc),targetKeys:i=["$ref","$$ref"]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=[];return fb(e).forEach((function(){if(i.includes(this.key)&&"string"==typeof this.node){const e=this.path,i=t.concat(this.path),o=vb(this.node,r(e));s.push(n.replace(i,o))}})),s}(e,n.slice(0,-1),{getBaseUrlForNodePath:e=>r.getContext([...n,t,...e]).baseDoc,specmap:r});a.push(...i)})),c.example&&a.push(r.remove([].concat(s,"example"))),a.push(r.mergeDeep(s,c)),c.$$ref||a.push(r.remove([].concat(s,"$$ref"))),a}},Nb={key:"parameters",plugin:(e,t,n,r)=>{if(Array.isArray(e)&&e.length){const t=Object.assign([],e),i=n.slice(0,-1),s=vl({},Dy.getIn(r.spec,i));for(let i=0;i<e.length;i+=1){const o=e[i];try{t[i].default=r.parameterMacro(s,o)}catch(e){const t=new Error(e);return t.fullPath=n,t}}return Dy.replace(n,t)}return Dy.replace(n,e)}},Cb={key:"properties",plugin:(e,t,n,r)=>{const i=vl({},e);for(const t in e)try{i[t].default=r.modelPropertyMacro(i[t])}catch(e){const t=new Error(e);return t.fullPath=n,t}return Dy.replace(n,i)}};class Db{constructor(e){this.root=qb(e||{})}set(e,t){const n=this.getParent(e,!0);if(!n)return void _b(this.root,t,null);const r=e[e.length-1],{children:i}=n;i[r]?_b(i[r],t,n):i[r]=qb(t,n)}get(e){if((e=e||[]).length<1)return this.root.value;let t,n,r=this.root;for(let i=0;i<e.length&&(n=e[i],t=r.children,t[n]);i+=1)r=t[n];return r&&r.protoValue}getParent(e,t){return!e||e.length<1?null:e.length<2?this.root:e.slice(0,-1).reduce(((e,n)=>{if(!e)return e;const{children:r}=e;return!r[n]&&t&&(r[n]=qb(null,e)),r[n]}),this.root)}}function qb(e,t){return _b({children:{}},e,t)}function _b(e,t,n){return e.value=t||{},e.protoValue=n?vl(vl({},n.protoValue),e.value):e.value,Object.keys(e.children).forEach((t=>{const n=e.children[t];e.children[t]=_b(n,n.value,e)})),e}const Bb=()=>{};class Lb{static getPluginName(e){return e.pluginName}static getPatchesOfType(e,t){return e.filter(t)}constructor(e){Object.assign(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new Db,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:Object.assign(Object.create(this),Dy,{getInstance:()=>this}),allowMetaPatches:!1},e),this.get=this._get.bind(this),this.getContext=this._getContext.bind(this),this.hasRun=this._hasRun.bind(this),this.wrappedPlugins=this.plugins.map(this.wrapPlugin.bind(this)).filter(Dy.isFunction),this.patches.push(Dy.add([],this.spec)),this.patches.push(Dy.context([],this.context)),this.updatePatches(this.patches)}debug(e){if(this.debugLevel===e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.log(...n)}}verbose(e){if("verbose"===this.debugLevel){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.log(`[${e}] `,...n)}}wrapPlugin(e,t){const{pathDiscriminator:n}=this;let r,i=null;return e[this.pluginProp]?(i=e,r=e[this.pluginProp]):Dy.isFunction(e)?r=e:Dy.isObject(e)&&(r=function(e){const t=(e,t)=>!Array.isArray(e)||e.every(((e,n)=>e===t[n]));return function*(r,i){const s={};for(const e of r.filter(Dy.isAdditiveMutation))yield*o(e.value,e.path,e);function*o(r,c,a){if(Dy.isObject(r)){const u=c.length-1,f=c[u],l=c.indexOf("properties"),h="properties"===f&&u===l,p=i.allowMetaPatches&&s[r.$$ref];for(const u of Object.keys(r)){const f=r[u],l=c.concat(u),m=Dy.isObject(f),d=r.$$ref;if(p||m&&(i.allowMetaPatches&&d&&(s[d]=!0),yield*o(f,l,a)),!h&&u===e.key){const r=t(n,c);n&&!r||(yield e.plugin(f,u,l,i,a))}}}else e.key===c[c.length-1]&&(yield e.plugin(r,e.key,c,i))}}}(e)),Object.assign(r.bind(i),{pluginName:e.name||t,isGenerator:Dy.isGenerator(r)})}nextPlugin(){return this.wrappedPlugins.find((e=>this.getMutationsForPlugin(e).length>0))}nextPromisedPatch(){if(this.promisedPatches.length>0)return Promise.race(this.promisedPatches.map((e=>e.value)))}getPluginHistory(e){const t=this.constructor.getPluginName(e);return this.pluginHistory[t]||[]}getPluginRunCount(e){return this.getPluginHistory(e).length}getPluginHistoryTip(e){const t=this.getPluginHistory(e);return t&&t[t.length-1]||{}}getPluginMutationIndex(e){const t=this.getPluginHistoryTip(e).mutationIndex;return"number"!=typeof t?-1:t}updatePluginHistory(e,t){const n=this.constructor.getPluginName(e);this.pluginHistory[n]=this.pluginHistory[n]||[],this.pluginHistory[n].push(t)}updatePatches(e){Dy.normalizeArray(e).forEach((e=>{if(e instanceof Error)this.errors.push(e);else try{if(!Dy.isObject(e))return void this.debug("updatePatches","Got a non-object patch",e);if(this.showDebug&&this.allPatches.push(e),Dy.isPromise(e.value))return this.promisedPatches.push(e),void this.promisedPatchThen(e);if(Dy.isContextPatch(e))return void this.setContext(e.path,e.value);Dy.isMutation(e)&&this.updateMutations(e)}catch(e){console.error(e),this.errors.push(e)}}))}updateMutations(e){"object"==typeof e.value&&!Array.isArray(e.value)&&this.allowMetaPatches&&(e.value=vl({},e.value));const t=Dy.applyPatch(this.state,e,{allowMetaPatches:this.allowMetaPatches});t&&(this.mutations.push(e),this.state=t)}removePromisedPatch(e){const t=this.promisedPatches.indexOf(e);t<0?this.debug("Tried to remove a promisedPatch that isn't there!"):this.promisedPatches.splice(t,1)}promisedPatchThen(e){return e.value=e.value.then((t=>{const n=vl(vl({},e),{},{value:t});this.removePromisedPatch(e),this.updatePatches(n)})).catch((t=>{this.removePromisedPatch(e),this.updatePatches(t)})),e.value}getMutations(e,t){return e=e||0,"number"!=typeof t&&(t=this.mutations.length),this.mutations.slice(e,t)}getCurrentMutations(){return this.getMutationsForPlugin(this.getCurrentPlugin())}getMutationsForPlugin(e){const t=this.getPluginMutationIndex(e);return this.getMutations(t+1)}getCurrentPlugin(){return this.currentPlugin}getLib(){return this.libMethods}_get(e){return Dy.getIn(this.state,e)}_getContext(e){return this.contextTree.get(e)}setContext(e,t){return this.contextTree.set(e,t)}_hasRun(e){return this.getPluginRunCount(this.getCurrentPlugin())>(e||0)}dispatch(){const e=this,t=this.nextPlugin();if(!t){const e=this.nextPromisedPatch();if(e)return e.then((()=>this.dispatch())).catch((()=>this.dispatch()));const t={spec:this.state,errors:this.errors};return this.showDebug&&(t.patches=this.allPatches),Promise.resolve(t)}if(e.pluginCount=e.pluginCount||{},e.pluginCount[t]=(e.pluginCount[t]||0)+1,e.pluginCount[t]>100)return Promise.resolve({spec:e.state,errors:e.errors.concat(new Error("We've reached a hard limit of 100 plugin runs"))});if(t!==this.currentPlugin&&this.promisedPatches.length){const e=this.promisedPatches.map((e=>e.value));return Promise.all(e.map((e=>e.then(Bb,Bb)))).then((()=>this.dispatch()))}return function(){e.currentPlugin=t;const r=e.getCurrentMutations(),i=e.mutations.length-1;try{if(t.isGenerator)for(const i of t(r,e.getLib()))n(i);else{n(t(r,e.getLib()))}}catch(e){console.error(e),n([Object.assign(Object.create(e),{plugin:t})])}finally{e.updatePluginHistory(t,{mutationIndex:i})}return e.dispatch()}();function n(n){n&&(n=Dy.fullyNormalizeArray(n),e.updatePatches(n,t))}}}const Ub={refs:Eb,allOf:Mb,parameters:Nb,properties:Cb},Jb=e=>e.replace(/\W/gi,"_");function Vb(e,t){let{v2OperationIdCompatibilityMode:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(n){let n=`${t.toLowerCase()}_${e}`.replace(/[\s!@#$%^&*()_+=[{\]};:<>|./?,\\'""-]/g,"_");return n=n||`${e.substring(1)}_${t}`,n.replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return`${t.toLowerCase()}${Jb(e)}`}function Gb(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",{v2OperationIdCompatibilityMode:r}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!e||"object"!=typeof e)return null;const i=(e.operationId||"").replace(/\s/g,"");return i.length?Jb(e.operationId):Vb(t,n,{v2OperationIdCompatibilityMode:r})}function zb(e){const{spec:t}=e,{paths:n}=t,r={};if(!n||t.$$normalized)return e;for(const e in n){const i=n[e];if(null==i||!["object","function"].includes(typeof i))continue;const s=i.parameters;for(const n in i){const o=i[n];if(null==o||!["object","function"].includes(typeof o))continue;const c=Gb(o,e,n);if(c){r[c]?r[c].push(o):r[c]=[o];const e=r[c];if(e.length>1)e.forEach(((e,t)=>{e.h=e.h||e.operationId,e.operationId=`${c}${t+1}`}));else if(void 0!==o.operationId){const t=e[0];t.h=t.h||o.operationId,t.operationId=c}}if("parameters"!==n){const e=[],n={};for(const r in t)"produces"!==r&&"consumes"!==r&&"security"!==r||(n[r]=t[r],e.push(n));if(s&&(n.parameters=s,e.push(n)),e.length)for(const t of e)for(const e in t)if(o[e]){if("parameters"===e)for(const n of t[e]){o[e].some((e=>e.name&&e.name===n.name||e.$ref&&e.$ref===n.$ref||e.$$ref&&e.$$ref===n.$$ref||e===n))||o[e].push(n)}}else o[e]=t[e]}}}return t.$$normalized=!0,e}async function Hb(e){const{spec:t,mode:n,allowMetaPatches:r=!0,pathDiscriminator:i,modelPropertyMacro:s,parameterMacro:o,requestInterceptor:c,responseInterceptor:a,skipNormalization:u,useCircularStructures:f}=e,l=Kv(e),h=Qv(e);return function(e){l&&(Ub.refs.docCache[l]=e);Ub.refs.fetchJSON=Yv(h,{requestInterceptor:c,responseInterceptor:a});const t=[Ub.refs];"function"==typeof o&&t.push(Ub.parameters);"function"==typeof s&&t.push(Ub.properties);"strict"!==n&&t.push(Ub.allOf);return(p={spec:e,context:{baseDoc:l},plugins:t,allowMetaPatches:r,pathDiscriminator:i,parameterMacro:o,modelPropertyMacro:s,useCircularStructures:f},new Lb(p).dispatch()).then(u?async e=>e:zb);var p}(t)}const Wb={name:"generic",match:()=>!0,normalize(e){let{spec:t}=e;const{spec:n}=zb({spec:t});return n},resolve:async e=>Hb(e)};const Xb=e=>{try{const{openapi:t}=e;return"string"==typeof t&&/^3\.0\.([0123])(?:-rc[012])?$/.test(t)}catch{return!1}},Yb=e=>{try{const{openapi:t}=e;return"string"==typeof t&&/^3\.1\.(?:[1-9]\d*|0)$/.test(t)}catch{return!1}},Kb=e=>Xb(e)||Yb(e),Qb={name:"openapi-2",match(e){let{spec:t}=e;return(e=>{try{const{swagger:t}=e;return"2.0"===t}catch{return!1}})(t)},normalize(e){let{spec:t}=e;const{spec:n}=zb({spec:t});return n},resolve:async e=>async function(e){return Hb(e)}(e)};const Zb={name:"openapi-3-0",match(e){let{spec:t}=e;return Xb(t)},normalize(e){let{spec:t}=e;const{spec:n}=zb({spec:t});return n},resolve:async e=>async function(e){return Hb(e)}(e)},ej=e=>async t=>(async e=>{const{spec:t,requestInterceptor:n,responseInterceptor:r}=e,i=Kv(e),s=Qv(e),o=t||await Yv(s,{requestInterceptor:n,responseInterceptor:r})(i),c=vl(vl({},e),{},{spec:o});return e.strategies.find((e=>e.match(c))).resolve(c)})(vl(vl({},e),t)),tj=ej({strategies:[Zb,Qb,Wb]});var nj=Array.isArray,rj="object"==typeof global&&global&&global.Object===Object&&global,ij=rj,sj="object"==typeof self&&self&&self.Object===Object&&self,oj=ij||sj||Function("return this")(),cj=oj.Symbol,aj=cj,uj=Object.prototype,fj=uj.hasOwnProperty,lj=uj.toString,hj=aj?aj.toStringTag:void 0;var pj=function(e){var t=fj.call(e,hj),n=e[hj];try{e[hj]=void 0;var r=!0}catch(e){}var i=lj.call(e);return r&&(t?e[hj]=n:delete e[hj]),i},mj=Object.prototype.toString;var dj=pj,vj=function(e){return mj.call(e)},yj=cj?cj.toStringTag:void 0;var bj=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":yj&&yj in Object(e)?dj(e):vj(e)};var jj=function(e){return null!=e&&"object"==typeof e},gj=bj,wj=jj;var Oj=function(e){return"symbol"==typeof e||wj(e)&&"[object Symbol]"==gj(e)},Ej=nj,xj=Oj,Sj=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pj=/^\w*$/;var $j=function(e,t){if(Ej(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!xj(e))||(Pj.test(e)||!Sj.test(e)||null!=t&&e in Object(t))};var Aj=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Tj=bj,Rj=Aj;var Ij=function(e){if(!Rj(e))return!1;var t=Tj(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},kj=oj["u"],Fj=function(){var e=/[^.]+$/.exec(kj&&kj.keys&&kj.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var Mj=function(e){return!!Fj&&Fj in e},Nj=Function.prototype.toString;var Cj=function(e){if(null!=e){try{return Nj.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Dj=Ij,qj=Mj,_j=Aj,Bj=Cj,Lj=/^\[object .+?Constructor\]$/,Uj=Function.prototype,Jj=Object.prototype,Vj=Uj.toString,Gj=Jj.hasOwnProperty,zj=RegExp("^"+Vj.call(Gj).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Hj=function(e){return!(!_j(e)||qj(e))&&(Dj(e)?zj:Lj).test(Bj(e))},Wj=function(e,t){return null==e?void 0:e[t]};var Xj=function(e,t){var n=Wj(e,t);return Hj(n)?n:void 0},Yj=Xj(Object,"create"),Kj=Yj;var Qj=function(){this.p=Kj?Kj(null):{},this.size=0};var Zj=function(e){var t=this.has(e)&&delete this.p[e];return this.size-=t?1:0,t},eg=Yj,tg=Object.prototype.hasOwnProperty;var ng=function(e){var t=this.p;if(eg){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return tg.call(t,e)?t[e]:void 0},rg=Yj,ig=Object.prototype.hasOwnProperty;var sg=function(e){var t=this.p;return rg?void 0!==t[e]:ig.call(t,e)},og=Yj;var cg=function(e,t){var n=this.p;return this.size+=this.has(e)?0:1,n[e]=og&&void 0===t?"__lodash_hash_undefined__":t,this},ag=Qj,ug=Zj,fg=ng,lg=sg,hg=cg;function pg(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}pg.prototype.clear=ag,pg.prototype.delete=ug,pg.prototype.get=fg,pg.prototype.has=lg,pg.prototype.set=hg;var mg=pg;var dg=function(){this.p=[],this.size=0};var vg=function(e,t){return e===t||e!=e&&t!=t},yg=vg;var bg=function(e,t){for(var n=e.length;n--;)if(yg(e[n][0],t))return n;return-1},jg=bg,gg=Array.prototype.splice;var wg=function(e){var t=this.p,n=jg(t,e);return!(n<0)&&(n==t.length-1?t.pop():gg.call(t,n,1),--this.size,!0)},Og=bg;var Eg=function(e){var t=this.p,n=Og(t,e);return n<0?void 0:t[n][1]},xg=bg;var Sg=bg;var Pg=function(e,t){var n=this.p,r=Sg(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},$g=dg,Ag=wg,Tg=Eg,Rg=function(e){return xg(this.p,e)>-1},Ig=Pg;function kg(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}kg.prototype.clear=$g,kg.prototype.delete=Ag,kg.prototype.get=Tg,kg.prototype.has=Rg,kg.prototype.set=Ig;var Fg=kg,Mg=Xj(oj,"Map"),Ng=mg,Cg=Fg,Dg=Mg;var qg=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},_g=qg;var Bg=function(e,t){var n=e.p;return _g(t)?n["string"==typeof t?"string":"hash"]:n.map},Lg=Bg;var Ug=Bg;var Jg=Bg;var Vg=Bg;var Gg=function(e,t){var n=Vg(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},zg=function(){this.size=0,this.p={hash:new Ng,map:new(Dg||Cg),string:new Ng}},Hg=function(e){var t=Lg(this,e).delete(e);return this.size-=t?1:0,t},Wg=function(e){return Ug(this,e).get(e)},Xg=function(e){return Jg(this,e).has(e)},Yg=Gg;function Kg(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Kg.prototype.clear=zg,Kg.prototype.delete=Hg,Kg.prototype.get=Wg,Kg.prototype.has=Xg,Kg.prototype.set=Yg;var Qg=Kg,Zg=Qg;function ew(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=e.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(ew.Cache||Zg),n}ew.Cache=Zg;var tw=ew;var nw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rw=/\\(\\)?/g,iw=function(e){var t=tw(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(nw,(function(e,n,r,i){t.push(r?i.replace(rw,"$1"):n||e)})),t})),sw=iw;var ow=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},cw=ow,aw=nj,uw=Oj,fw=cj?cj.prototype:void 0,lw=fw?fw.toString:void 0;var hw=function e(t){if("string"==typeof t)return t;if(aw(t))return cw(t,e)+"";if(uw(t))return lw?lw.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n},pw=hw;var mw=nj,dw=$j,vw=sw,yw=function(e){return null==e?"":pw(e)};var bw=Oj;var jw=function(e,t){return mw(e)?e:dw(e,t)?[e]:vw(yw(e))},gw=function(e){if("string"==typeof e||bw(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var ww=function(e,t){for(var n=0,r=(t=jw(t,e)).length;null!=e&&n<r;)e=e[gw(t[n++])];return n&&n==r?e:void 0},Ow=ww;var Ew=function(e,t,n){var r=null==e?void 0:Ow(e,t);return void 0===r?n:r};const xw=openapi_parser_e(Ew),Sw=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{returnEntireTree:r,baseDoc:i,requestInterceptor:s,responseInterceptor:o,parameterMacro:c,modelPropertyMacro:a,useCircularStructures:u,strategies:f}=n,l={spec:e,pathDiscriminator:t,baseDoc:i,requestInterceptor:s,responseInterceptor:o,parameterMacro:c,modelPropertyMacro:a,useCircularStructures:u,strategies:f},h=f.find((e=>e.match(l))),p=h.normalize(l),m=await tj(vl(vl({},l),{},{spec:p,allowMetaPatches:!0,skipNormalization:!0}));return!r&&Array.isArray(t)&&t.length&&(m.spec=xw(m.spec,t)||null),m};const Pw=function(){return!1};const $w=function(){return!0};function Aw(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function Tw(e){return function t(n){return 0===arguments.length||Aw(n)?t:e.apply(this,arguments)}}function Rw(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return Aw(n)?t:Tw((function(t){return e(n,t)}));default:return Aw(n)&&Aw(r)?t:Aw(n)?Tw((function(t){return e(t,r)})):Aw(r)?Tw((function(t){return e(n,t)})):e(n,r)}}}function Iw(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,n){return t.apply(this,arguments)};case 3:return function(e,n,r){return t.apply(this,arguments)};case 4:return function(e,n,r,i){return t.apply(this,arguments)};case 5:return function(e,n,r,i,s){return t.apply(this,arguments)};case 6:return function(e,n,r,i,s,o){return t.apply(this,arguments)};case 7:return function(e,n,r,i,s,o,c){return t.apply(this,arguments)};case 8:return function(e,n,r,i,s,o,c,a){return t.apply(this,arguments)};case 9:return function(e,n,r,i,s,o,c,a,u){return t.apply(this,arguments)};case 10:return function(e,n,r,i,s,o,c,a,u,f){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function kw(e,t,n){return function(){for(var r=[],i=0,s=e,o=0;o<t.length||i<arguments.length;){var c;o<t.length&&(!Aw(t[o])||i>=arguments.length)?c=t[o]:(c=arguments[i],i+=1),r[o]=c,Aw(c)||(s-=1),o+=1}return s<=0?n.apply(this,r):Iw(s,kw(e,r,n))}}const Fw=Rw((function(e,t){return 1===e?Tw(t):Iw(e,kw(e,[],t))}));function Mw(e){return function t(n,r,i){switch(arguments.length){case 0:return t;case 1:return Aw(n)?t:Rw((function(t,r){return e(n,t,r)}));case 2:return Aw(n)&&Aw(r)?t:Aw(n)?Rw((function(t,n){return e(t,r,n)})):Aw(r)?Rw((function(t,r){return e(n,t,r)})):Tw((function(t){return e(n,r,t)}));default:return Aw(n)&&Aw(r)&&Aw(i)?t:Aw(n)&&Aw(r)?Rw((function(t,n){return e(t,n,i)})):Aw(n)&&Aw(i)?Rw((function(t,n){return e(t,r,n)})):Aw(r)&&Aw(i)?Rw((function(t,r){return e(n,t,r)})):Aw(n)?Tw((function(t){return e(t,r,i)})):Aw(r)?Tw((function(t){return e(n,t,i)})):Aw(i)?Tw((function(t){return e(n,r,t)})):e(n,r,i)}}}const Nw=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};function Cw(e){return null!=e&&"function"==typeof e["@@transducer/step"]}function Dw(e,t,n){return function(){if(0===arguments.length)return n();var r=arguments[arguments.length-1];if(!Nw(r)){for(var i=0;i<e.length;){if("function"==typeof r[e[i]])return r[e[i]].apply(r,Array.prototype.slice.call(arguments,0,-1));i+=1}if(Cw(r)){var s=t.apply(null,Array.prototype.slice.call(arguments,0,-1));return s(r)}}return n.apply(this,arguments)}}function qw(e){return e&&e["@@transducer/reduced"]?e:{"@@transducer/value":e,"@@transducer/reduced":!0}}const _w=function(){return this.xf["@@transducer/init"]()},Bw=function(e){return this.xf["@@transducer/result"](e)};var Lw=function(){function e(e,t){this.xf=t,this.f=e,this.all=!0}return e.prototype["@@transducer/init"]=_w,e.prototype["@@transducer/result"]=function(e){return this.all&&(e=this.xf["@@transducer/step"](e,!0)),this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){return this.f(t)||(this.all=!1,e=qw(this.xf["@@transducer/step"](e,!1))),e},e}();function Uw(e){return function(t){return new Lw(e,t)}}const Jw=Rw(Dw(["all"],Uw,(function(e,t){for(var n=0;n<t.length;){if(!e(t[n]))return!1;n+=1}return!0})));function Vw(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function Gw(e,t,n){for(var r=0,i=n.length;r<i;){if(e(t,n[r]))return!0;r+=1}return!1}function zw(e,t){return Object.prototype.hasOwnProperty.call(t,e)}const Hw="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var Ww=Object.prototype.toString,Xw=function(){return"[object Arguments]"===Ww.call(arguments)?function(e){return"[object Arguments]"===Ww.call(e)}:function(e){return zw("callee",e)}}(),Yw=!{toString:null}.propertyIsEnumerable("toString"),Kw=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Qw=function(){return arguments.propertyIsEnumerable("length")}(),Zw=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1},eO="function"!=typeof Object.keys||Qw?Tw((function(e){if(Object(e)!==e)return[];var t,n,r=[],i=Qw&&Xw(e);for(t in e)!zw(t,e)||i&&"length"===t||(r[r.length]=t);if(Yw)for(n=Kw.length-1;n>=0;)zw(t=Kw[n],e)&&!Zw(r,t)&&(r[r.length]=t),n-=1;return r})):Tw((function(e){return Object(e)!==e?[]:Object.keys(e)}));const tO=Tw((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function nO(e,t,n,r){var i=Vw(e);function s(e,t){return rO(e,t,n.slice(),r.slice())}return!Gw((function(e,t){return!Gw(s,t,e)}),Vw(t),i)}function rO(e,t,n,r){if(Hw(e,t))return!0;var i=tO(e);if(i!==tO(t))return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(i){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===function(e){var t=String(e).match(/^function (\w*)/);return null==t?"":t[1]}(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!Hw(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!Hw(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var s=n.length-1;s>=0;){if(n[s]===e)return r[s]===t;s-=1}switch(i){case"Map":return e.size===t.size&&nO(e.entries(),t.entries(),n.concat([e]),r.concat([t]));case"Set":return e.size===t.size&&nO(e.values(),t.values(),n.concat([e]),r.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var o=eO(e);if(o.length!==eO(t).length)return!1;var c=n.concat([e]),a=r.concat([t]);for(s=o.length-1;s>=0;){var u=o[s];if(!zw(u,t)||!rO(t[u],e[u],c,a))return!1;s-=1}return!0}const iO=Rw((function(e,t){return rO(e,t,[],[])}));function sO(e,t){return function(e,t,n){var r,i;if("function"==typeof e.indexOf)switch(typeof t){case"number":if(0===t){for(r=1/t;n<e.length;){if(0===(i=e[n])&&1/i===r)return n;n+=1}return-1}if(t!=t){for(;n<e.length;){if("number"==typeof(i=e[n])&&i!=i)return n;n+=1}return-1}return e.indexOf(t,n);case"string":case"boolean":case"function":case"undefined":return e.indexOf(t,n);case"object":if(null===t)return e.indexOf(t,n)}for(;n<e.length;){if(iO(e[n],t))return n;n+=1}return-1}(t,e,0)>=0}function oO(e,t){for(var n=0,r=t.length,i=Array(r);n<r;)i[n]=e(t[n]),n+=1;return i}function cO(e){return'"'+e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}var aO=function(e){return(e<10?"0":"")+e},uO="function"==typeof Date.prototype.toISOString?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+aO(e.getUTCMonth()+1)+"-"+aO(e.getUTCDate())+"T"+aO(e.getUTCHours())+":"+aO(e.getUTCMinutes())+":"+aO(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function fO(e){return function(){return!e.apply(this,arguments)}}function lO(e,t,n){for(var r=0,i=n.length;r<i;)t=e(t,n[r]),r+=1;return t}function hO(e){return"[object Object]"===Object.prototype.toString.call(e)}var pO=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=_w,e.prototype["@@transducer/result"]=Bw,e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):e},e}();function mO(e){return function(t){return new pO(e,t)}}var dO=Rw(Dw(["fantasy-land/filter","filter"],mO,(function(e,t){return hO(t)?lO((function(n,r){return e(t[r])&&(n[r]=t[r]),n}),{},eO(t)):function(e,t){for(var n=0,r=t.length,i=[];n<r;)e(t[n])&&(i[i.length]=t[n]),n+=1;return i}(e,t)}))),vO=Rw((function(e,t){return dO(fO(e),t)}));function yO(e,t){var n=function(n){var r=t.concat([e]);return sO(n,r)?"<Circular>":yO(n,r)},r=function(e,t){return oO((function(t){return cO(t)+": "+n(e[t])}),t.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+oO(n,e).join(", ")+"))";case"[object Array]":return"["+oO(n,e).concat(r(e,vO((function(e){return/^\d+$/.test(e)}),eO(e)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof e?"new Boolean("+n(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?n(NaN):cO(uO(e)))+")";case"[object Map]":return"new Map("+n(Array.from(e))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof e?"new Number("+n(e.valueOf())+")":1/e==-1/0?"-0":e.toString(10);case"[object Set]":return"new Set("+n(Array.from(e).sort())+")";case"[object String]":return"object"==typeof e?"new String("+n(e.valueOf())+")":cO(e);case"[object Undefined]":return"undefined";default:if("function"==typeof e.toString){var i=e.toString();if("[object Object]"!==i)return i}return"{"+r(e,eO(e)).join(", ")+"}"}}const bO=Tw((function(e){return yO(e,[])}));var jO=Rw((function(e,t){if(e===t)return t;function n(e,t){if(e>t!=t>e)return t>e?t:e}var r=n(e,t);if(void 0!==r)return r;var i=n(typeof e,typeof t);if(void 0!==i)return i===typeof e?e:t;var s=bO(e),o=n(s,bO(t));return void 0!==o&&o===s?e:t})),gO=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=_w,e.prototype["@@transducer/result"]=Bw,e.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},e}();const wO=Rw(Dw(["fantasy-land/map","map"],(function(e){return function(t){return new gO(e,t)}}),(function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return Fw(t.length,(function(){return e.call(this,t.apply(this,arguments))}));case"[object Object]":return lO((function(n,r){return n[r]=e(t[r]),n}),{},eO(t));default:return oO(e,t)}}))),OO=Number.isInteger||function(e){return e<<0===e};function EO(e){return"[object String]"===Object.prototype.toString.call(e)}const xO=Rw((function(e,t){var n=e<0?t.length+e:e;return EO(t)?t.charAt(n):t[n]}));var SO=Rw((function(e,t){if(null!=t)return OO(e)?xO(e,t):t[e]})),PO=Rw((function(e,t){return wO(SO(e),t)})),$O=Tw((function(e){return!!Nw(e)||!!e&&("object"==typeof e&&(!EO(e)&&(0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))})),AO="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function TO(e,t,n){return function(r,i,s){if($O(s))return e(r,i,s);if(null==s)return i;if("function"==typeof s["fantasy-land/reduce"])return t(r,i,s,"fantasy-land/reduce");if(null!=s[AO])return n(r,i,s[AO]());if("function"==typeof s.next)return n(r,i,s);if("function"==typeof s.reduce)return t(r,i,s,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function RO(e,t,n){for(var r=0,i=n.length;r<i;){if((t=e["@@transducer/step"](t,n[r]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r+=1}return e["@@transducer/result"](t)}var IO=Rw((function(e,t){return Iw(e.length,(function(){return e.apply(t,arguments)}))}));function kO(e,t,n){for(var r=n.next();!r.done;){if((t=e["@@transducer/step"](t,r.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r=n.next()}return e["@@transducer/result"](t)}function FO(e,t,n,r){return e["@@transducer/result"](n[r](IO(e["@@transducer/step"],e),t))}var MO=TO(RO,FO,kO),NO=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}();function CO(e){return new NO(e)}const DO=Mw((function(e,t,n){return MO("function"==typeof e?CO(e):e,t,n)}));const qO=Tw((function(e){return Fw(DO(jO,0,PO("length",e)),(function(){for(var t=0,n=e.length;t<n;){if(!e[t].apply(this,arguments))return!1;t+=1}return!0}))}));const _O=Tw((function(e){return function(){return e}}));var BO=Rw((function(e,t){return e&&t}));const LO=Tw((function(e){return Fw(DO(jO,0,PO("length",e)),(function(){for(var t=0,n=e.length;t<n;){if(e[t].apply(this,arguments))return!0;t+=1}return!1}))}));function UO(e,t,n){for(var r=n.next();!r.done;)t=e(t,r.value),r=n.next();return t}function JO(e,t,n,r){return n[r](e,t)}var VO=TO(lO,JO,UO),GO=Rw((function(e,t){return"function"==typeof t["fantasy-land/ap"]?t["fantasy-land/ap"](e):"function"==typeof e.ap?e.ap(t):"function"==typeof e?function(n){return e(n)(t(n))}:VO((function(e,n){return function(e,t){var n;t=t||[];var r=(e=e||[]).length,i=t.length,s=[];for(n=0;n<r;)s[s.length]=e[n],n+=1;for(n=0;n<i;)s[s.length]=t[n],n+=1;return s}(e,wO(n,t))}),[],e)}));const zO=Rw((function(e,t){return e.apply(this,t)}));const HO=Tw((function(e){for(var t=eO(e),n=t.length,r=[],i=0;i<n;)r[i]=e[t[i]],i+=1;return r}));var WO=Tw((function(e){return null==e})),XO=Mw((function e(t,n,r){if(0===t.length)return n;var i=t[0];if(t.length>1){var s=!WO(r)&&zw(i,r)&&"object"==typeof r[i]?r[i]:OO(t[1])?[]:{};n=e(Array.prototype.slice.call(t,1),n,s)}return function(e,t,n){if(OO(e)&&Nw(n)){var r=[].concat(n);return r[e]=t,r}var i={};for(var s in n)i[s]=n[s];return i[e]=t,i}(i,n,r)}));const YO=XO;function KO(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t}var QO=Rw((function(e,t){var n=Fw(e,t);return Fw(e,(function(){return lO(GO,wO(n,arguments[0]),Array.prototype.slice.call(arguments,1))}))}));const ZO=Tw((function(e){return QO(e.length,e)}));const eE=Rw((function(e,t){return KO(e)?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:ZO(BO)(e,t)}));function tE(e){return new RegExp(e.source,e.flags?e.flags:(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.sticky?"y":"")+(e.unicode?"u":"")+(e.dotAll?"s":""))}function nE(e,t,n){if(n||(n=new rE),function(e){var t=typeof e;return null==e||"object"!=t&&"function"!=t}(e))return e;var r=function(r){var i=n.get(e);if(i)return i;for(var s in n.set(e,r),e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=t?nE(e[s],!0,n):e[s]);return r};switch(tO(e)){case"Object":return r(Object.create(Object.getPrototypeOf(e)));case"Array":return r([]);case"Date":return new Date(e.valueOf());case"RegExp":return tE(e);case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":return e.slice();default:return e}}var rE=function(){function e(){this.map={},this.length=0}return e.prototype.set=function(e,t){const n=this.hash(e);let r=this.map[n];r||(this.map[n]=r=[]),r.push([e,t]),this.length+=1},e.prototype.hash=function(e){let t=[];for(var n in e)t.push(Object.prototype.toString.call(e[n]));return t.join()},e.prototype.get=function(e){if(this.length<=180){for(const t in this.map){const n=this.map[t];for(let t=0;t<n.length;t+=1){const r=n[t];if(r[0]===e)return r[1]}}return}const t=this.hash(e),n=this.map[t];if(n)for(let t=0;t<n.length;t+=1){const r=n[t];if(r[0]===e)return r[1]}},e}();const iE=Tw((function(e){return function(t,n){return e(t,n)?-1:e(n,t)?1:0}}));const sE=ZO(Tw((function(e){return!e})));function oE(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function cE(e,t){return function(){var n=arguments.length;if(0===n)return t();var r=arguments[n-1];return Nw(r)||"function"!=typeof r[e]?t.apply(this,arguments):r[e].apply(r,Array.prototype.slice.call(arguments,0,n-1))}}var aE=Mw(cE("slice",(function(e,t,n){return Array.prototype.slice.call(n,e,t)})));const uE=Tw(cE("tail",aE(1,1/0)));function fE(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return Iw(arguments[0].length,DO(oE,arguments[0],uE(arguments)))}const lE=xO(0);function hE(e){return e}const pE=Tw(hE);const mE=Tw((function(e){return Fw(e.length,e)}));var dE=Rw((function(e,t){return Fw(DO(jO,0,PO("length",t)),(function(){var n=arguments,r=this;return e.apply(r,oO((function(e){return e.apply(r,n)}),t))}))}));const vE=dE;var yE=function(){function e(e,t,n,r){this.valueFn=e,this.valueAcc=t,this.keyFn=n,this.xf=r,this.inputs={}}return e.prototype["@@transducer/init"]=_w,e.prototype["@@transducer/result"]=function(e){var t;for(t in this.inputs)if(zw(t,this.inputs)&&(e=this.xf["@@transducer/step"](e,this.inputs[t]))["@@transducer/reduced"]){e=e["@@transducer/value"];break}return this.inputs=null,this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){var n=this.keyFn(t);return this.inputs[n]=this.inputs[n]||[n,nE(this.valueAcc,!1)],this.inputs[n][1]=this.valueFn(this.inputs[n][1],t),e},e}();function bE(e,t,n){return function(r){return new yE(e,t,n,r)}}var jE=kw(4,[],Dw([],bE,(function(e,t,n,r){var i=CO((function(r,i){var s=n(i),o=e(zw(s,r)?r[s]:nE(t,!1),i);return o&&o["@@transducer/reduced"]?qw(r):(r[s]=o,r)}));return MO(i,{},r)})));const gE=Rw((function(e,t){return null==t||t!=t?e:t}));var wE=function(){function e(){this._nativeSet="function"==typeof Set?new Set:null,this._items={}}return e.prototype.add=function(e){return!OE(e,!0,this)},e.prototype.has=function(e){return OE(e,!1,this)},e}();function OE(e,t,n){var r,i=typeof e;switch(i){case"string":case"number":return 0===e&&1/e==-1/0?!!n._items["-0"]||(t&&(n._items["-0"]=!0),!1):null!==n._nativeSet?t?(r=n._nativeSet.size,n._nativeSet.add(e),n._nativeSet.size===r):n._nativeSet.has(e):i in n._items?e in n._items[i]||(t&&(n._items[i][e]=!0),!1):(t&&(n._items[i]={},n._items[i][e]=!0),!1);case"boolean":if(i in n._items){var s=e?1:0;return!!n._items[i][s]||(t&&(n._items[i][s]=!0),!1)}return t&&(n._items[i]=e?[!1,!0]:[!0,!1]),!1;case"function":return null!==n._nativeSet?t?(r=n._nativeSet.size,n._nativeSet.add(e),n._nativeSet.size===r):n._nativeSet.has(e):i in n._items?!!sO(e,n._items[i])||(t&&n._items[i].push(e),!1):(t&&(n._items[i]=[e]),!1);case"undefined":return!!n._items[i]||(t&&(n._items[i]=!0),!1);case"object":if(null===e)return!!n._items.null||(t&&(n._items.null=!0),!1);default:return(i=Object.prototype.toString.call(e))in n._items?!!sO(e,n._items[i])||(t&&n._items[i].push(e),!1):(t&&(n._items[i]=[e]),!1)}}var EE=Rw((function(e,t){for(var n=[],r=0,i=e.length,s=t.length,o=new wE,c=0;c<s;c+=1)o.add(t[c]);for(;r<i;)o.add(e[r])&&(n[n.length]=e[r]),r+=1;return n}));const xE=EE;var SE=function(){function e(e,t){this.xf=t,this.n=e,this.i=0}return e.prototype["@@transducer/init"]=_w,e.prototype["@@transducer/result"]=Bw,e.prototype["@@transducer/step"]=function(e,t){this.i+=1;var n=0===this.n?e:this.xf["@@transducer/step"](e,t);return this.n>=0&&this.i>=this.n?qw(n):n},e}();function PE(e){return function(t){return new SE(e,t)}}var $E=Rw(Dw(["take"],PE,(function(e,t){return aE(0,e<0?1/0:e,t)})));function AE(e,t){for(var n=t.length-1;n>=0&&e(t[n]);)n-=1;return aE(0,n+1,t)}var TE=function(){function e(e,t){this.f=e,this.retained=[],this.xf=t}return e.prototype["@@transducer/init"]=_w,e.prototype["@@transducer/result"]=function(e){return this.retained=null,this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.retain(e,t):this.flush(e,t)},e.prototype.flush=function(e,t){return e=MO(this.xf,e,this.retained),this.retained=[],this.xf["@@transducer/step"](e,t)},e.prototype.retain=function(e,t){return this.retained.push(t),e},e}();function RE(e){return function(t){return new TE(e,t)}}const IE=Rw(Dw([],RE,AE));const kE=xO(-1);var FE=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=_w,e.prototype["@@transducer/result"]=Bw,e.prototype["@@transducer/step"]=function(e,t){if(this.f){if(this.f(t))return e;this.f=null}return this.xf["@@transducer/step"](e,t)},e}();function ME(e){return function(t){return new FE(e,t)}}const NE=Rw(Dw(["dropWhile"],ME,(function(e,t){for(var n=0,r=t.length;n<r&&e(t[n]);)n+=1;return aE(n,1/0,t)})));var CE=Rw((function(e,t){return e||t}));const DE=Rw((function(e,t){return KO(e)?function(){return e.apply(this,arguments)||t.apply(this,arguments)}:ZO(CE)(e,t)}));var qE=Tw((function(e){return null!=e&&"function"==typeof e["fantasy-land/empty"]?e["fantasy-land/empty"]():null!=e&&null!=e.constructor&&"function"==typeof e.constructor["fantasy-land/empty"]?e.constructor["fantasy-land/empty"]():null!=e&&"function"==typeof e.empty?e.empty():null!=e&&null!=e.constructor&&"function"==typeof e.constructor.empty?e.constructor.empty():Nw(e)?[]:EO(e)?"":hO(e)?{}:Xw(e)?function(){return arguments}():function(e){var t=Object.prototype.toString.call(e);return"[object Uint8ClampedArray]"===t||"[object Int8Array]"===t||"[object Uint8Array]"===t||"[object Int16Array]"===t||"[object Uint16Array]"===t||"[object Int32Array]"===t||"[object Uint32Array]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object BigInt64Array]"===t||"[object BigUint64Array]"===t}(e)?e.constructor.from(""):void 0}));const _E=Tw((function(e){return Fw(e.length,(function(t,n){var r=Array.prototype.slice.call(arguments,0);return r[0]=n,r[1]=t,e.apply(this,r)}))}));const BE=Rw(cE("groupBy",jE((function(e,t){return e.push(t),e}),[])));var LE=Rw((function(e,t){if(0===e.length||WO(t))return!1;for(var n=t,r=0;r<e.length;){if(WO(n)||!zw(e[r],n))return!1;n=n[e[r]],r+=1}return!0})),UE=Rw((function(e,t){return LE([e],t)}));const JE=UE;var VE=Rw((function(e,t){return!WO(t)&&e in t}));const GE=VE;var zE=function(e,t){switch(arguments.length){case 0:return zE;case 1:return function t(n){return 0===arguments.length?t:Hw(e,n)};default:return Hw(e,t)}};const HE=zE;const WE=Mw((function(e,t,n){return Fw(Math.max(e.length,t.length,n.length),(function(){return e.apply(this,arguments)?t.apply(this,arguments):n.apply(this,arguments)}))}));const XE=Rw(sO);const YE=aE(0,-1);var KE=Rw((function(e,t){return Fw(e+1,(function(){var n=arguments[e];if(null!=n&&KO(n[t]))return n[t].apply(n,Array.prototype.slice.call(arguments,0,e));throw new TypeError(bO(n)+' does not have a method named "'+t+'"')}))}));const QE=KE;const ZE=Tw((function(e){return null!=e&&iO(e,qE(e))}));const ex=QE(1,"join");function tx(e){return"[object Number]"===Object.prototype.toString.call(e)}const nx=Rw((function(e,t){return function(n){return function(r){return wO((function(e){return t(e,r)}),n(e(r)))}}}));var rx=Rw((function(e,t){return e.map((function(e){for(var n,r=t,i=0;i<e.length;){if(null==r)return;n=e[i],r=OO(n)?xO(n,r):r[n],i+=1}return r}))})),ix=Rw((function(e,t){return rx([e],t)[0]}));const sx=Rw((function(e,t){return lO((function(n,r){return n[r]=e(t[r],r,t),n}),{},eO(t))}));var ox=Mw((function(e,t,n){var r,i={};for(r in n=n||{},t=t||{})zw(r,t)&&(i[r]=zw(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)zw(r,n)&&!zw(r,i)&&(i[r]=n[r]);return i})),cx=Mw((function e(t,n,r){return ox((function(n,r,i){return hO(r)&&hO(i)?e(t,r,i):t(n,r,i)}),n,r)}));const ax=Rw((function(e,t){return cx((function(e,t,n){return n}),e,t)}));const ux=Rw((function(e,t){return Jw(fO(e),t)}));var fx=function(e){return{value:e,map:function(t){return fx(t(e))}}},lx=Mw((function(e,t,n){return e((function(e){return fx(t(e))}))(n).value}));const hx=lx;const px=Mw((function(e,t,n){return gE(e,ix(t,n))}));const mx=Mw((function(e,t,n){return e(ix(t,n))}));const dx=Rw((function(e,t){for(var n={},r=0;r<e.length;)e[r]in t&&(n[e[r]]=t[e[r]]),r+=1;return n}));const vx=Mw((function(e,t,n){return iO(e,SO(t,n))}));const yx=Mw((function(e,t,n){return gE(e,SO(t,n))}));const bx=Mw((function(e,t,n){return e(SO(t,n))}));var jx=Rw((function(e,t){if(!tx(e)||!tx(t))throw new TypeError("Both arguments to range must be numbers");for(var n=[],r=e;r<t;)n.push(r),r+=1;return n}));const gx=jx;const wx=Tw(qw);var Ox=Mw((function(e,t,n){return n.replace(e,t)}));const Ex=Ox;var xx=Rw((function(e,t){return Array.prototype.slice.call(t,0).sort(e)}));const Sx=xx;const Px=QE(1,"split");const $x=Rw((function(e,t){return iO($E(e.length,t),e)}));var Ax=Rw((function(e,t){if(n=e,"[object RegExp]"!==Object.prototype.toString.call(n))throw new TypeError("test requires a value of type RegExp as its first argument; received "+bO(e));var n;return tE(e).test(t)}));const Tx=Ax;var Rx=function(){function e(e,t){this.xf=t,this.pred=e,this.items=[]}return e.prototype["@@transducer/init"]=_w,e.prototype["@@transducer/result"]=Bw,e.prototype["@@transducer/step"]=function(e,t){return Gw(this.pred,t,this.items)?e:(this.items.push(t),this.xf["@@transducer/step"](e,t))},e}();function Ix(e){return function(t){return new Rx(e,t)}}const kx=Rw(Dw([],Ix,(function(e,t){for(var n,r=0,i=t.length,s=[];r<i;)Gw(e,n=t[r],s)||(s[s.length]=n),r+=1;return s})));const Fx=Mw((function(e,t,n){return e(n)?t(n):n}));const Mx=_O(void 0);const Nx=iO(Mx());const Cx=sE(Nx);const Dx=iO(null);const qx=sE(Dx);const _x=sE(WO);const Bx=Fw(1,fE(tO,HE("GeneratorFunction")));const Lx=Fw(1,fE(tO,HE("AsyncFunction")));const Ux=LO([fE(tO,HE("Function")),Bx,Lx]);const Jx=Fw(1,Ux(Array.isArray)?Array.isArray:fE(tO,HE("Array")));const Vx=eE(Jx,ZE);const Gx=sE(ZE);const zx=eE(Jx,Gx);const Hx=Fw(1,fE(tO,HE("String")));const Wx=iO("");function Xx(e){return Xx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xx(e)}const Yx=function(e){return"object"===Xx(e)};var Kx=sE(Fw(1,eE(qx,DE(Yx,Ux))));const Qx=qO([Hx,Kx,Gx]);const Zx=sE(Ux);const eS=Fw(1,eE(qx,Yx));var tS=fE(tO,HE("Object")),nS=fE(bO,iO(bO(Object))),rS=mx(eE(Ux,nS),["constructor"]);const iS=Fw(1,(function(e){if(!eS(e)||!tS(e))return!1;var t=Object.getPrototypeOf(e);return!!Dx(t)||rS(t)}));var sS=eE(Fw(1,fE(tO,HE("Number"))),isFinite);var oS=Fw(1,sS);var cS=eE(Ux(Number.isFinite)?Fw(1,IO(Number.isFinite,Number)):oS,vE(iO,[Math.floor,pE]));var aS=Fw(1,cS);const uS=Ux(Number.isInteger)?Fw(1,IO(Number.isInteger,Number)):aS;const fS=Fw(1,fE(tO,HE("RegExp")));const lS=_O(Mx());const hS=Fw(1,IO(Promise.all,Promise));function pS(e){return function(e){if(Array.isArray(e))return mS(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return mS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mS(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var dS=fE(Sx(iE((function(e,t){return e.length>t.length}))),lE,SO("length")),vS=mE((function(e,t,n){var r=n.apply(void 0,pS(e));return _x(r)?wx(r):t}));const yS=WE(zx,(function(e){var t=dS(e);return Fw(t,(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return DO(vS(n),void 0,e)}))}),Mx);const bS=_E(XE);var jS=Fw(3,(function(e,t,n){var r=ix(e,n),i=ix(YE(e),n);if(!Zx(r)&&!Vx(e)){var s=IO(r,i);return zO(s,t)}}));const gS=jS;const wS=Fx(Hx,Ex(/[.*+?^${}()|[\]\\-]/g,"\\$&"));var OS=function(e,t){if("string"!=typeof e&&!(e instanceof String))throw TypeError("`".concat(t,"` must be a string"))};const ES=function(e,t,n){!function(e,t,n){if(null==n||null==e||null==t)throw TypeError("Input values must not be `null` or `undefined`")}(e,t,n),OS(n,"str"),OS(t,"replaceValue"),function(e){if(!("string"==typeof e||e instanceof String||e instanceof RegExp))throw TypeError("`searchValue` must be a string or an regexp")}(e);var r=new RegExp(fS(e)?e:wS(e),"g");return Ex(r,t,n)};var xS=Fw(3,ES),SS=QE(2,"replaceAll");const PS=Ux(String.prototype.replaceAll)?SS:xS;const $S=mE((function(e,t){return fE(Px(""),IE(bS(e)),ex(""))(t)}));const AS=mE((function(e,t){return fE(Px(""),NE(bS(e)),ex(""))(t)}));var TS=function(e){return null===e},RS=bj,IS=nj,kS=jj;var FS=function(e){return"string"==typeof e||!IS(e)&&kS(e)&&"[object String]"==RS(e)},MS=bj,NS=jj;var CS=function(e){return"number"==typeof e||NS(e)&&"[object Number]"==MS(e)},DS=bj,qS=jj;var _S=function(e){return!0===e||!1===e||qS(e)&&"[object Boolean]"==DS(e)};var BS=class{constructor(e){this.namespace=e||new this.Namespace}serialise(e){if(!(e instanceof this.namespace.elements.Element))throw new TypeError(`Given element \`${e}\` is not an Element instance`);const t={element:e.element};e._meta&&e._meta.length>0&&(t.meta=this.serialiseObject(e.meta)),e._attributes&&e._attributes.length>0&&(t.attributes=this.serialiseObject(e.attributes));const n=this.serialiseContent(e.content);return void 0!==n&&(t.content=n),t}deserialise(e){if(!e.element)throw new Error("Given value is not an object containing an element name");const t=new(this.namespace.getElementClass(e.element));t.element!==e.element&&(t.element=e.element),e.meta&&this.deserialiseObject(e.meta,t.meta),e.attributes&&this.deserialiseObject(e.attributes,t.attributes);const n=this.deserialiseContent(e.content);return void 0===n&&null!==t.content||(t.content=n),t}serialiseContent(e){if(e instanceof this.namespace.elements.Element)return this.serialise(e);if(e instanceof this.namespace.KeyValuePair){const t={key:this.serialise(e.key)};return e.value&&(t.value=this.serialise(e.value)),t}if(e&&e.map){if(0===e.length)return;return e.map(this.serialise,this)}return e}deserialiseContent(e){if(e){if(e.element)return this.deserialise(e);if(e.key){const t=new this.namespace.KeyValuePair(this.deserialise(e.key));return e.value&&(t.value=this.deserialise(e.value)),t}if(e.map)return e.map(this.deserialise,this)}return e}serialiseObject(e){const t={};if(e.forEach(((e,n)=>{e&&(t[n.toValue()]=this.serialise(e))})),0!==Object.keys(t).length)return t}deserialiseObject(e,t){Object.keys(e).forEach((n=>{t.set(n,this.deserialise(e[n]))}))}},LS=Fg;var US=function(e){var t=this.p,n=t.delete(e);return this.size=t.size,n};var JS=Fg,VS=Mg,GS=Qg;var zS=function(e,t){var n=this.p;if(n instanceof JS){var r=n.p;if(!VS||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.p=new GS(r)}return n.set(e,t),this.size=n.size,this},HS=Fg,WS=function(){this.p=new LS,this.size=0},XS=US,YS=function(e){return this.p.get(e)},KS=function(e){return this.p.has(e)},QS=zS;function ZS(e){var t=this.p=new HS(e);this.size=t.size}ZS.prototype.clear=WS,ZS.prototype.delete=XS,ZS.prototype.get=YS,ZS.prototype.has=KS,ZS.prototype.set=QS;var eP=ZS;var tP=Qg,nP=function(e){return this.p.set(e,"__lodash_hash_undefined__"),this},rP=function(e){return this.p.has(e)};function iP(e){var t=-1,n=null==e?0:e.length;for(this.p=new tP;++t<n;)this.add(e[t])}iP.prototype.add=iP.prototype.push=nP,iP.prototype.has=rP;var sP=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};var oP=iP,cP=sP,aP=function(e,t){return e.has(t)};var uP=function(e,t,n,r,i,s){var o=1&n,c=e.length,a=t.length;if(c!=a&&!(o&&a>c))return!1;var u=s.get(e),f=s.get(t);if(u&&f)return u==t&&f==e;var l=-1,h=!0,p=2&n?new oP:void 0;for(s.set(e,t),s.set(t,e);++l<c;){var m=e[l],d=t[l];if(r)var v=o?r(d,m,l,t,e,s):r(m,d,l,e,t,s);if(void 0!==v){if(v)continue;h=!1;break}if(p){if(!cP(t,(function(e,t){if(!aP(p,t)&&(m===e||i(m,e,n,r,s)))return p.push(t)}))){h=!1;break}}else if(m!==d&&!i(m,d,n,r,s)){h=!1;break}}return s.delete(e),s.delete(t),h};var fP=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};var lP=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},hP=oj.Uint8Array,pP=vg,mP=uP,dP=fP,vP=lP,yP=cj?cj.prototype:void 0,bP=yP?yP.valueOf:void 0;var jP=function(e,t,n,r,i,s,o){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new hP(e),new hP(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return pP(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var c=dP;case"[object Set]":var a=1&r;if(c||(c=vP),e.size!=t.size&&!a)return!1;var u=o.get(e);if(u)return u==t;r|=2,o.set(e,t);var f=mP(c(e),c(t),r,i,s,o);return o.delete(e),f;case"[object Symbol]":if(bP)return bP.call(e)==bP.call(t)}return!1};var gP=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},wP=gP,OP=nj;var EP=function(e,t,n){var r=t(e);return OP(e)?r:wP(r,n(e))};var xP=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[i++]=o)}return s};var SP=xP,PP=function(){return[]},$P=Object.prototype.propertyIsEnumerable,AP=Object.getOwnPropertySymbols,TP=AP?function(e){return null==e?[]:(e=Object(e),SP(AP(e),(function(t){return $P.call(e,t)})))}:PP,RP=TP;var IP=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},kP=bj,FP=jj;var MP=function(e){return FP(e)&&"[object Arguments]"==kP(e)},NP=jj,CP=Object.prototype,DP=CP.hasOwnProperty,qP=CP.propertyIsEnumerable,_P=MP(function(){return arguments}())?MP:function(e){return NP(e)&&DP.call(e,"callee")&&!qP.call(e,"callee")},BP={exports:{}};var LP=function(){return!1};!function(e,t){var n=oj,r=LP,i=t&&!t.nodeType&&t,s=i&&e&&!e.nodeType&&e,o=s&&s.exports===i?n.Buffer:void 0,c=(o?o.isBuffer:void 0)||r;e.exports=c}(BP,BP.exports);var UP=BP.exports,JP=/^(?:0|[1-9]\d*)$/;var VP=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&JP.test(e))&&e>-1&&e%1==0&&e<t};var GP=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},zP=bj,HP=GP,WP=jj,XP={};XP["[object Float32Array]"]=XP["[object Float64Array]"]=XP["[object Int8Array]"]=XP["[object Int16Array]"]=XP["[object Int32Array]"]=XP["[object Uint8Array]"]=XP["[object Uint8ClampedArray]"]=XP["[object Uint16Array]"]=XP["[object Uint32Array]"]=!0,XP["[object Arguments]"]=XP["[object Array]"]=XP["[object ArrayBuffer]"]=XP["[object Boolean]"]=XP["[object DataView]"]=XP["[object Date]"]=XP["[object Error]"]=XP["[object Function]"]=XP["[object Map]"]=XP["[object Number]"]=XP["[object Object]"]=XP["[object RegExp]"]=XP["[object Set]"]=XP["[object String]"]=XP["[object WeakMap]"]=!1;var YP=function(e){return WP(e)&&HP(e.length)&&!!XP[zP(e)]};var KP=function(e){return function(t){return e(t)}},QP={exports:{}};!function(e,t){var n=rj,r=t&&!t.nodeType&&t,i=r&&e&&!e.nodeType&&e,s=i&&i.exports===r&&n.process,o=function(){try{var e=i&&i.require&&i.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=o}(QP,QP.exports);var ZP=QP.exports,e$=YP,t$=KP,n$=ZP&&ZP.isTypedArray,r$=n$?t$(n$):e$,i$=IP,s$=_P,o$=nj,c$=UP,a$=VP,u$=r$,f$=Object.prototype.hasOwnProperty;var l$=function(e,t){var n=o$(e),r=!n&&s$(e),i=!n&&!r&&c$(e),s=!n&&!r&&!i&&u$(e),o=n||r||i||s,c=o?i$(e.length,String):[],a=c.length;for(var u in e)!t&&!f$.call(e,u)||o&&("length"==u||i&&("offset"==u||"parent"==u)||s&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||a$(u,a))||c.push(u);return c},h$=Object.prototype;var p$=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||h$)};var m$=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),d$=p$,v$=m$,y$=Object.prototype.hasOwnProperty;var b$=Ij,j$=GP;var g$=l$,w$=function(e){if(!d$(e))return v$(e);var t=[];for(var n in Object(e))y$.call(e,n)&&"constructor"!=n&&t.push(n);return t},O$=function(e){return null!=e&&j$(e.length)&&!b$(e)};var E$=EP,x$=RP,S$=function(e){return O$(e)?g$(e):w$(e)};var P$=function(e){return E$(e,S$,x$)},$$=Object.prototype.hasOwnProperty;var A$=function(e,t,n,r,i,s){var o=1&n,c=P$(e),a=c.length;if(a!=P$(t).length&&!o)return!1;for(var u=a;u--;){var f=c[u];if(!(o?f in t:$$.call(t,f)))return!1}var l=s.get(e),h=s.get(t);if(l&&h)return l==t&&h==e;var p=!0;s.set(e,t),s.set(t,e);for(var m=o;++u<a;){var d=e[f=c[u]],v=t[f];if(r)var y=o?r(v,d,f,t,e,s):r(d,v,f,e,t,s);if(!(void 0===y?d===v||i(d,v,n,r,s):y)){p=!1;break}m||(m="constructor"==f)}if(p&&!m){var b=e.constructor,j=t.constructor;b==j||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof j&&j instanceof j||(p=!1)}return s.delete(e),s.delete(t),p},T$=Xj(oj,"DataView"),R$=Mg,I$=Xj(oj,"Promise"),k$=Xj(oj,"Set"),F$=Xj(oj,"WeakMap"),M$=bj,N$=Cj,C$=N$(T$),D$=N$(R$),q$=N$(I$),_$=N$(k$),B$=N$(F$),L$=M$;(T$&&"[object DataView]"!=L$(new T$(new ArrayBuffer(1)))||R$&&"[object Map]"!=L$(new R$)||I$&&"[object Promise]"!=L$(I$.resolve())||k$&&"[object Set]"!=L$(new k$)||F$&&"[object WeakMap]"!=L$(new F$))&&(L$=function(e){var t=M$(e),n="[object Object]"==t?e.constructor:void 0,r=n?N$(n):"";if(r)switch(r){case C$:return"[object DataView]";case D$:return"[object Map]";case q$:return"[object Promise]";case _$:return"[object Set]";case B$:return"[object WeakMap]"}return t});var U$=eP,J$=uP,V$=jP,G$=A$,z$=L$,H$=nj,W$=UP,X$=r$,Y$="[object Object]",K$=Object.prototype.hasOwnProperty;var Q$=function(e,t,n,r,i,s){var o=H$(e),c=H$(t),a=o?"[object Array]":z$(e),u=c?"[object Array]":z$(t),f=(a="[object Arguments]"==a?Y$:a)==Y$,l=(u="[object Arguments]"==u?Y$:u)==Y$,h=a==u;if(h&&W$(e)){if(!W$(t))return!1;o=!0,f=!1}if(h&&!f)return s||(s=new U$),o||X$(e)?J$(e,t,n,r,i,s):V$(e,t,a,n,r,i,s);if(!(1&n)){var p=f&&K$.call(e,"__wrapped__"),m=l&&K$.call(t,"__wrapped__");if(p||m){var d=p?e.value():e,v=m?t.value():t;return s||(s=new U$),i(d,v,n,r,s)}}return!!h&&(s||(s=new U$),G$(e,t,n,r,i,s))},Z$=jj;var eA=function e(t,n,r,i,s){return t===n||(null==t||null==n||!Z$(t)&&!Z$(n)?t!=t&&n!=n:Q$(t,n,r,i,e,s))},tA=eA;var nA=function(e,t){return tA(e,t)};var rA=class e{constructor(e,t){this.key=e,this.value=t}clone(){const t=new e;return this.key&&(t.key=this.key.clone()),this.value&&(t.value=this.value.clone()),t}};var iA=function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}};const sA=iA;function oA(e){return"string"==typeof e?t=>t.element===e:e.constructor&&e.extend?t=>t instanceof e:e}let cA=class e{constructor(e){this.elements=e||[]}toValue(){return this.elements.map((e=>e.toValue()))}map(e,t){return this.elements.map(e,t)}flatMap(e,t){return this.map(e,t).reduce(((e,t)=>e.concat(t)),[])}compactMap(e,t){const n=[];return this.forEach((r=>{const i=e.bind(t)(r);i&&n.push(i)})),n}filter(t,n){return t=oA(t),new e(this.elements.filter(t,n))}reject(t,n){return t=oA(t),new e(this.elements.filter(sA(t),n))}find(e,t){return e=oA(e),this.elements.find(e,t)}forEach(e,t){this.elements.forEach(e,t)}reduce(e,t){return this.elements.reduce(e,t)}includes(e){return this.elements.some((t=>t.equals(e)))}shift(){return this.elements.shift()}unshift(e){this.elements.unshift(this.refract(e))}push(e){return this.elements.push(this.refract(e)),this}add(e){this.push(e)}get(e){return this.elements[e]}getValue(e){const t=this.elements[e];if(t)return t.toValue()}get length(){return this.elements.length}get isEmpty(){return 0===this.elements.length}get first(){return this.elements[0]}};"undefined"!=typeof Symbol&&(cA.prototype[Symbol.iterator]=function(){return this.elements[Symbol.iterator]()});var aA=cA;const uA=nA,fA=rA,lA=aA;var hA=class e{constructor(e,t,n){t&&(this.meta=t),n&&(this.attributes=n),this.content=e}freeze(){Object.isFrozen(this)||(this._meta&&(this.meta.parent=this,this.meta.freeze()),this._attributes&&(this.attributes.parent=this,this.attributes.freeze()),this.children.forEach((e=>{e.parent=this,e.freeze()}),this),this.content&&Array.isArray(this.content)&&Object.freeze(this.content),Object.freeze(this))}primitive(){}clone(){const e=new this.constructor;return e.element=this.element,this.meta.length&&(e._meta=this.meta.clone()),this.attributes.length&&(e._attributes=this.attributes.clone()),this.content?this.content.clone?e.content=this.content.clone():Array.isArray(this.content)?e.content=this.content.map((e=>e.clone())):e.content=this.content:e.content=this.content,e}toValue(){return this.content instanceof e?this.content.toValue():this.content instanceof fA?{key:this.content.key.toValue(),value:this.content.value?this.content.value.toValue():void 0}:this.content&&this.content.map?this.content.map((e=>e.toValue()),this):this.content}toRef(e){if(""===this.id.toValue())throw Error("Cannot create reference to an element that does not contain an ID");const t=new this.RefElement(this.id.toValue());return e&&(t.path=e),t}findRecursive(...e){if(arguments.length>1&&!this.isFrozen)throw new Error("Cannot find recursive with multiple element names without first freezing the element. Call `element.freeze()`");const t=e.pop();let n=new lA;const r=(e,t)=>(e.push(t),e),i=(e,n)=>{n.element===t&&e.push(n);const s=n.findRecursive(t);return s&&s.reduce(r,e),n.content instanceof fA&&(n.content.key&&i(e,n.content.key),n.content.value&&i(e,n.content.value)),e};return this.content&&(this.content.element&&i(n,this.content),Array.isArray(this.content)&&this.content.reduce(i,n)),e.isEmpty||(n=n.filter((t=>{let n=t.parents.map((e=>e.element));for(const t in e){const r=e[t],i=n.indexOf(r);if(-1===i)return!1;n=n.splice(0,i)}return!0}))),n}set(e){return this.content=e,this}equals(e){return uA(this.toValue(),e)}getMetaProperty(e,t){if(!this.meta.hasKey(e)){if(this.isFrozen){const e=this.refract(t);return e.freeze(),e}this.meta.set(e,t)}return this.meta.get(e)}setMetaProperty(e,t){this.meta.set(e,t)}get element(){return this._storedElement||"element"}set element(e){this._storedElement=e}get content(){return this._content}set content(t){if(t instanceof e)this._content=t;else if(t instanceof lA)this.content=t.elements;else if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"null"===t||null==t)this._content=t;else if(t instanceof fA)this._content=t;else if(Array.isArray(t))this._content=t.map(this.refract);else{if("object"!=typeof t)throw new Error("Cannot set content to given value");this._content=Object.keys(t).map((e=>new this.MemberElement(e,t[e])))}}get meta(){if(!this._meta){if(this.isFrozen){const e=new this.ObjectElement;return e.freeze(),e}this._meta=new this.ObjectElement}return this._meta}set meta(e){e instanceof this.ObjectElement?this._meta=e:this.meta.set(e||{})}get attributes(){if(!this._attributes){if(this.isFrozen){const e=new this.ObjectElement;return e.freeze(),e}this._attributes=new this.ObjectElement}return this._attributes}set attributes(e){e instanceof this.ObjectElement?this._attributes=e:this.attributes.set(e||{})}get id(){return this.getMetaProperty("id","")}set id(e){this.setMetaProperty("id",e)}get classes(){return this.getMetaProperty("classes",[])}set classes(e){this.setMetaProperty("classes",e)}get title(){return this.getMetaProperty("title","")}set title(e){this.setMetaProperty("title",e)}get description(){return this.getMetaProperty("description","")}set description(e){this.setMetaProperty("description",e)}get links(){return this.getMetaProperty("links",[])}set links(e){this.setMetaProperty("links",e)}get isFrozen(){return Object.isFrozen(this)}get parents(){let{parent:e}=this;const t=new lA;for(;e;)t.push(e),e=e.parent;return t}get children(){if(Array.isArray(this.content))return new lA(this.content);if(this.content instanceof fA){const e=new lA([this.content.key]);return this.content.value&&e.push(this.content.value),e}return this.content instanceof e?new lA([this.content]):new lA}get recursiveChildren(){const e=new lA;return this.children.forEach((t=>{e.push(t),t.recursiveChildren.forEach((t=>{e.push(t)}))})),e}};const pA=hA;var mA=class extends pA{constructor(e,t,n){super(e||null,t,n),this.element="null"}primitive(){return"null"}set(){return new Error("Cannot set the value of null")}};const dA=hA;const vA=hA;const yA=hA;const bA=iA,jA=hA,gA=aA;let wA=class extends jA{constructor(e,t,n){super(e||[],t,n),this.element="array"}primitive(){return"array"}get(e){return this.content[e]}getValue(e){const t=this.get(e);if(t)return t.toValue()}getIndex(e){return this.content[e]}set(e,t){return this.content[e]=this.refract(t),this}remove(e){const t=this.content.splice(e,1);return t.length?t[0]:null}map(e,t){return this.content.map(e,t)}flatMap(e,t){return this.map(e,t).reduce(((e,t)=>e.concat(t)),[])}compactMap(e,t){const n=[];return this.forEach((r=>{const i=e.bind(t)(r);i&&n.push(i)})),n}filter(e,t){return new gA(this.content.filter(e,t))}reject(e,t){return this.filter(bA(e),t)}reduce(e,t){let n,r;void 0!==t?(n=0,r=this.refract(t)):(n=1,r="object"===this.primitive()?this.first.value:this.first);for(let t=n;t<this.length;t+=1){const n=this.content[t];r="object"===this.primitive()?this.refract(e(r,n.value,n.key,n,this)):this.refract(e(r,n,t,this))}return r}forEach(e,t){this.content.forEach(((n,r)=>{e.bind(t)(n,this.refract(r))}))}shift(){return this.content.shift()}unshift(e){this.content.unshift(this.refract(e))}push(e){return this.content.push(this.refract(e)),this}add(e){this.push(e)}findElements(e,t){const n=t||{},r=!!n.recursive,i=void 0===n.results?[]:n.results;return this.forEach(((t,n,s)=>{r&&void 0!==t.findElements&&t.findElements(e,{results:i,recursive:r}),e(t,n,s)&&i.push(t)})),i}find(e){return new gA(this.findElements(e,{recursive:!0}))}findByElement(e){return this.find((t=>t.element===e))}findByClass(e){return this.find((t=>t.classes.includes(e)))}getById(e){return this.find((t=>t.id.toValue()===e)).first}includes(e){return this.content.some((t=>t.equals(e)))}contains(e){return this.includes(e)}empty(){return new this.constructor([])}"fantasy-land/empty"(){return this.empty()}concat(e){return new this.constructor(this.content.concat(e.content))}"fantasy-land/concat"(e){return this.concat(e)}"fantasy-land/map"(e){return new this.constructor(this.map(e))}"fantasy-land/chain"(e){return this.map((t=>e(t)),this).reduce(((e,t)=>e.concat(t)),this.empty())}"fantasy-land/filter"(e){return new this.constructor(this.content.filter(e))}"fantasy-land/reduce"(e,t){return this.content.reduce(e,t)}get length(){return this.content.length}get isEmpty(){return 0===this.content.length}get first(){return this.getIndex(0)}get second(){return this.getIndex(1)}get last(){return this.getIndex(this.length-1)}};wA.empty=function(){return new this},wA["fantasy-land/empty"]=wA.empty,"undefined"!=typeof Symbol&&(wA.prototype[Symbol.iterator]=function(){return this.content[Symbol.iterator]()});var OA=wA;const EA=rA,xA=hA;var SA=class extends xA{constructor(e,t,n,r){super(new EA,n,r),this.element="member",this.key=e,this.value=t}get key(){return this.content.key}set key(e){this.content.key=this.refract(e)}get value(){return this.content.value}set value(e){this.content.value=this.refract(e)}};const PA=iA,$A=aA;var AA=class e extends $A{map(e,t){return this.elements.map((n=>e.bind(t)(n.value,n.key,n)))}filter(t,n){return new e(this.elements.filter((e=>t.bind(n)(e.value,e.key,e))))}reject(e,t){return this.filter(PA(e.bind(t)))}forEach(e,t){return this.elements.forEach(((n,r)=>{e.bind(t)(n.value,n.key,n,r)}))}keys(){return this.map(((e,t)=>t.toValue()))}values(){return this.map((e=>e.toValue()))}};const TA=iA,RA=Aj,IA=OA,kA=SA,FA=AA;var MA=class extends IA{constructor(e,t,n){super(e||[],t,n),this.element="object"}primitive(){return"object"}toValue(){return this.content.reduce(((e,t)=>(e[t.key.toValue()]=t.value?t.value.toValue():void 0,e)),{})}get(e){const t=this.getMember(e);if(t)return t.value}getMember(e){if(void 0!==e)return this.content.find((t=>t.key.toValue()===e))}remove(e){let t=null;return this.content=this.content.filter((n=>n.key.toValue()!==e||(t=n,!1))),t}getKey(e){const t=this.getMember(e);if(t)return t.key}set(e,t){if(RA(e))return Object.keys(e).forEach((t=>{this.set(t,e[t])})),this;const n=e,r=this.getMember(n);return r?r.value=t:this.content.push(new kA(n,t)),this}keys(){return this.content.map((e=>e.key.toValue()))}values(){return this.content.map((e=>e.value.toValue()))}hasKey(e){return this.content.some((t=>t.key.equals(e)))}items(){return this.content.map((e=>[e.key.toValue(),e.value.toValue()]))}map(e,t){return this.content.map((n=>e.bind(t)(n.value,n.key,n)))}compactMap(e,t){const n=[];return this.forEach(((r,i,s)=>{const o=e.bind(t)(r,i,s);o&&n.push(o)})),n}filter(e,t){return new FA(this.content).filter(e,t)}reject(e,t){return this.filter(TA(e),t)}forEach(e,t){return this.content.forEach((n=>e.bind(t)(n.value,n.key,n)))}};const NA=hA;const CA=hA;const DA=hA,qA=mA,_A=class extends dA{constructor(e,t,n){super(e,t,n),this.element="string"}primitive(){return"string"}get length(){return this.content.length}},BA=class extends vA{constructor(e,t,n){super(e,t,n),this.element="number"}primitive(){return"number"}},LA=class extends yA{constructor(e,t,n){super(e,t,n),this.element="boolean"}primitive(){return"boolean"}},UA=OA,JA=SA,VA=MA,GA=class extends NA{constructor(e,t,n){super(e||[],t,n),this.element="link"}get relation(){return this.attributes.get("relation")}set relation(e){this.attributes.set("relation",e)}get href(){return this.attributes.get("href")}set href(e){this.attributes.set("href",e)}},zA=class extends CA{constructor(e,t,n){super(e||[],t,n),this.element="ref",this.path||(this.path="element")}get path(){return this.attributes.get("path")}set path(e){this.attributes.set("path",e)}},HA=aA,WA=AA,XA=rA;function YA(e){if(e instanceof DA)return e;if("string"==typeof e)return new _A(e);if("number"==typeof e)return new BA(e);if("boolean"==typeof e)return new LA(e);if(null===e)return new qA;if(Array.isArray(e))return new UA(e.map(YA));if("object"==typeof e){return new VA(e)}return e}DA.prototype.ObjectElement=VA,DA.prototype.RefElement=zA,DA.prototype.MemberElement=JA,DA.prototype.refract=YA,HA.prototype.refract=YA;var KA={Element:DA,NullElement:qA,StringElement:_A,NumberElement:BA,BooleanElement:LA,ArrayElement:UA,MemberElement:JA,ObjectElement:VA,LinkElement:GA,RefElement:zA,refract:YA,ArraySlice:HA,ObjectSlice:WA,KeyValuePair:XA};const QA=TS,ZA=FS,eT=CS,tT=_S,nT=Aj,rT=BS,iT=KA;let sT=class{constructor(e){this.elementMap={},this.elementDetection=[],this.Element=iT.Element,this.KeyValuePair=iT.KeyValuePair,e&&e.noDefault||this.useDefault(),this._attributeElementKeys=[],this._attributeElementArrayKeys=[]}use(e){return e.namespace&&e.namespace({base:this}),e.load&&e.load({base:this}),this}useDefault(){return this.register("null",iT.NullElement).register("string",iT.StringElement).register("number",iT.NumberElement).register("boolean",iT.BooleanElement).register("array",iT.ArrayElement).register("object",iT.ObjectElement).register("member",iT.MemberElement).register("ref",iT.RefElement).register("link",iT.LinkElement),this.detect(QA,iT.NullElement,!1).detect(ZA,iT.StringElement,!1).detect(eT,iT.NumberElement,!1).detect(tT,iT.BooleanElement,!1).detect(Array.isArray,iT.ArrayElement,!1).detect(nT,iT.ObjectElement,!1),this}register(e,t){return this._elements=void 0,this.elementMap[e]=t,this}unregister(e){return this._elements=void 0,delete this.elementMap[e],this}detect(e,t,n){return void 0===n||n?this.elementDetection.unshift([e,t]):this.elementDetection.push([e,t]),this}toElement(e){if(e instanceof this.Element)return e;let t;for(let n=0;n<this.elementDetection.length;n+=1){const r=this.elementDetection[n][0],i=this.elementDetection[n][1];if(r(e)){t=new i(e);break}}return t}getElementClass(e){const t=this.elementMap[e];return void 0===t?this.Element:t}fromRefract(e){return this.serialiser.deserialise(e)}toRefract(e){return this.serialiser.serialise(e)}get elements(){return void 0===this._elements&&(this._elements={Element:this.Element},Object.keys(this.elementMap).forEach((e=>{const t=e[0].toUpperCase()+e.substr(1);this._elements[t]=this.elementMap[e]}))),this._elements}get serialiser(){return new rT(this)}};rT.prototype.Namespace=sT;const oT=KA;var cT=sT,aT=oT.ArraySlice,uT=oT.Element,fT=oT.StringElement,lT=oT.NumberElement,hT=oT.BooleanElement,pT=oT.NullElement,mT=oT.ArrayElement,dT=oT.ObjectElement,vT=oT.MemberElement,yT=oT.RefElement,bT=oT.LinkElement,jT=oT.refract;const gT=class extends fT{constructor(e,t,n){super(e,t,n),this.element="annotation"}get code(){return this.attributes.get("code")}set code(e){this.attributes.set("code",e)}};const wT=class extends fT{constructor(e,t,n){super(e,t,n),this.element="comment"}};const OT=class extends mT{constructor(e,t,n){super(e,t,n),this.element="parseResult"}get api(){return this.children.filter((e=>e.classes.contains("api"))).first}get results(){return this.children.filter((e=>e.classes.contains("result")))}get result(){return this.results.first}get annotations(){return this.children.filter((e=>"annotation"===e.element))}get warnings(){return this.children.filter((e=>"annotation"===e.element&&e.classes.contains("warning")))}get errors(){return this.children.filter((e=>"annotation"===e.element&&e.classes.contains("error")))}get isEmpty(){return this.children.reject((e=>"annotation"===e.element)).isEmpty}replaceResult(e){const{result:t}=this;if(Nx(t))return!1;const n=this.content.findIndex((e=>e===t));return-1!==n&&(this.content[n]=e,!0)}};const ET=class extends mT{constructor(e,t,n){super(e,t,n),this.element="sourceMap"}get positionStart(){return this.children.filter((e=>e.classes.contains("position"))).get(0)}get positionEnd(){return this.children.filter((e=>e.classes.contains("position"))).get(1)}set position(e){if(null===e)return;const t=new mT([e.start.row,e.start.column,e.start.char]),n=new mT([e.end.row,e.end.column,e.end.char]);t.classes.push("position"),n.classes.push("position"),this.push(t).push(n)}};class xT extends cT{constructor(){super(),this.register("annotation",gT),this.register("comment",wT),this.register("parseResult",OT),this.register("sourceMap",ET)}}const ST=new xT,PT=e=>{const t=new xT;return iS(e)&&t.use(e),t};var $T,AT={exports:{}};$T=AT,function(){var e,t,n,r,i,s="properties",o="deepProperties",c="propertyDescriptors",a="staticProperties",u="staticDeepProperties",f="staticPropertyDescriptors",l="configuration",h="deepConfiguration",p="deepProps",m="deepStatics",d="deepConf",v="initializers",y="methods",b="composers",j="compose";function g(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[])}function w(e,t){return Array.prototype.slice.call(arguments,2).reduce(e,t)}var O=w.bind(0,(function(e,t){if(t)for(var n=g(t),r=0;r<n.length;r+=1)Object.defineProperty(e,n[r],Object.getOwnPropertyDescriptor(t,n[r]));return e}));function E(e){return"function"==typeof e}function x(e){return e&&"object"==typeof e||E(e)}function S(e){return e&&"object"==typeof e&&e.__proto__==Object.prototype}var P=w.bind(0,(function t(n,r){if(r===e)return n;if(Array.isArray(r))return(Array.isArray(n)?n:[]).concat(r);if(!S(r))return r;for(var i,s,o=g(r),c=0;c<o.length;)i=o[c++],(s=Object.getOwnPropertyDescriptor(r,i)).hasOwnProperty("value")?s.value!==e&&(n[i]=t(S(n[i])||Array.isArray(r[i])?n[i]:{},r[i])):Object.defineProperty(n,i,s);return n}));function $(){return(t=Array.prototype.concat.apply([],arguments).filter((function(e,t,n){return E(e)&&n.indexOf(e)===t}))).length?t:e}function A(r){return t=function t(n){var r,i,a=t[j]||{},u={__proto__:a[y]},f=a[v],l=Array.prototype.slice.apply(arguments),h=a[o];if(h&&P(u,h),(h=a[s])&&O(u,h),(h=a[c])&&Object.defineProperties(u,h),!f||!f.length)return u;for(n===e&&(n={}),a=0;a<f.length;)E(r=f[a++])&&(u=(i=r.call(u,n,{instance:u,stamp:t,args:l}))===e?u:i);return u},(n=r[u])&&P(t,n),(n=r[a])&&O(t,n),(n=r[f])&&Object.defineProperties(t,n),n=E(t[j])?t[j]:R,O(t[j]=function(){return n.apply(this,arguments)},r),t}function T(e,n){function r(t,r){x(n[t])&&(x(e[t])||(e[t]={}),(r||O)(e[t],n[t]))}function i(r){(t=$(e[r],n[r]))&&(e[r]=t)}return n&&x(n=n[j]||n)&&(r(y),r(s),r(o,P),r(c),r(a),r(u,P),r(f),r(l),r(h,P),i(v),i(b)),e}function R(){return A(Array.prototype.concat.apply([this],arguments).reduce(T,{}))}function I(e){return E(e)&&E(e[j])}var k={};function F(i,s){return function(){return(r={})[i]=s.apply(e,Array.prototype.concat.apply([{}],arguments)),((t=this)&&t[j]||n).call(t,r)}}k[y]=F(y,O),k[s]=k.props=F(s,O),k[v]=k.init=F(v,$),k[b]=F(b,$),k[o]=k[p]=F(o,P),k[a]=k.statics=F(a,O),k[u]=k[m]=F(u,P),k[l]=k.conf=F(l,O),k[h]=k[d]=F(h,P),k[c]=F(c,O),k[f]=F(f,O),n=k[j]=O((function(){for(var g,w,E=0,S=[],A=arguments,T=this;E<A.length;)x(g=A[E++])&&S.push(I(g)?g:((r={})[y]=(w=g)[y]||e,n=w.props,r[s]=x((t=w[s])||n)?O({},n,t):e,r[v]=$(w.init,w[v]),r[b]=$(w[b]),n=w[p],r[o]=x((t=w[o])||n)?P({},n,t):e,r[c]=w[c],n=w.statics,r[a]=x((t=w[a])||n)?O({},n,t):e,n=w[m],r[u]=x((t=w[u])||n)?P({},n,t):e,t=w[f],r[f]=x((n=w.name&&{name:{value:w.name}})||t)?O({},t,n):e,n=w.conf,r[l]=x((t=w[l])||n)?O({},n,t):e,n=w[d],r[h]=x((t=w[h])||n)?P({},n,t):e,r));if(g=R.apply(T||i,S),T&&S.unshift(T),Array.isArray(A=g[j][b]))for(E=0;E<A.length;)g=I(T=A[E++]({stamp:g,composables:S}))?T:g;return g}),k),k.create=function(){return this.apply(e,arguments)},(r={})[a]=k,i=R(r),n[j]=n.bind(),n.version="4.3.2",$T.exports=n}();const TT=openapi_parser_e(AT.exports);var RT=On,IT=_n.indexOf,kT=Ou,FT=O([].indexOf),MT=!!FT&&1/FT([1],1,-0)<0;RT({target:"Array",proto:!0,forced:MT||!kT("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return MT?FT(this,e,t)||0:IT(this,e,t)}});var NT=kc("Array").indexOf,CT=oe,DT=NT,qT=Array.prototype;const _T=openapi_parser_e((function(e){var t=e.indexOf;return e===qT||CT(qT,e)&&t===qT.indexOf?DT:t}));function BT(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},s=Zn(e);for(r=0;r<s.length;r++)n=s[r],_T(t).call(t,n)>=0||(i[n]=e[n]);return i}(e,t);if(Sc){var s=Sc(e);for(r=0;r<s.length;r++)n=s[r],_T(t).call(t,n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}const LT=(e,t,n)=>{const r=e[t];if(null!=r){if(!n&&"function"==typeof r)return r;const e=n?r.leave:r.enter;if("function"==typeof e)return e}else{const r=n?e.leave:e.enter;if(null!=r){if("function"==typeof r)return r;const e=r[t];if("function"==typeof e)return e}}return null},UT={},JT=e=>null==e?void 0:e.type,VT=e=>"string"==typeof JT(e),GT=(e,{visitFnGetter:t=LT,nodeTypeGetter:n=JT}={})=>{const r=new Array(e.length);return{enter(i,...s){for(let o=0;o<e.length;o+=1)if(null==r[o]){const c=t(e[o],n(i),!1);if("function"==typeof c){const t=c.call(e[o],i,...s);if(!1===t)r[o]=i;else if(t===UT)r[o]=UT;else if(void 0!==t)return t}}},leave(i,...s){for(let o=0;o<e.length;o+=1)if(null==r[o]){const c=t(e[o],n(i),!0);if("function"==typeof c){const t=c.call(e[o],i,...s);if(t===UT)r[o]=UT;else if(void 0!==t&&!1!==t)return t}}else r[o]===i&&(r[o]=null)}}},zT=(e,t,{keyMap:n=null,state:r={},breakSymbol:i=UT,deleteNodeSymbol:s=null,skipVisitingNodeSymbol:o=!1,visitFnGetter:c=LT,nodeTypeGetter:a=JT,nodePredicate:u=VT,detectCycles:f=!0}={})=>{const l=n||{};let h,p,m=Array.isArray(e),d=[e],v=-1,y=[];const b=[],j=[];let g=e;do{v+=1;const e=v===d.length;let n,w;const O=e&&0!==y.length;if(e){if(n=0===j.length?void 0:b.pop(),w=p,p=j.pop(),O){w=m?w.slice():Object.create(Object.getPrototypeOf(w),Object.getOwnPropertyDescriptors(w));let e=0;for(let t=0;t<y.length;t+=1){let n=y[t][0];const r=y[t][1];m&&(n-=e),m&&r===s?(w.splice(n,1),e+=1):w[n]=r}}v=h.index,d=h.keys,y=h.edits,m=h.inArray,h=h.prev}else{if(n=p?m?v:d[v]:void 0,w=p?p[n]:g,w===s||void 0===w)continue;p&&b.push(n)}if(j.includes(w))continue;let E;if(!Array.isArray(w)){if(!u(w))throw new Error(`Invalid AST Node: ${JSON.stringify(w)}`);if(f&&j.includes(w)){b.pop();continue}const s=c(t,a(w),e);if(s){for(const[e,n]of Object.entries(r))t[e]=n;if(E=s.call(t,w,n,p,b,j),E===i)break;if(E===o){if(!e){b.pop();continue}}else if(void 0!==E&&(y.push([n,E]),!e)){if(!u(E)){b.pop();continue}w=E}}}void 0===E&&O&&y.push([n,w]),e||(h={inArray:m,index:v,keys:d,edits:y,prev:h},m=Array.isArray(w),d=m?w:l[a(w)]||[],v=-1,y=[],p&&j.push(p),p=w)}while(void 0!==h);return 0!==y.length&&([,g]=y[y.length-1]),g};zT[Symbol.for("nodejs.util.promisify.custom")]=async(e,t,{keyMap:n=null,state:r={},breakSymbol:i=UT,deleteNodeSymbol:s=null,skipVisitingNodeSymbol:o=!1,visitFnGetter:c=LT,nodeTypeGetter:a=JT,nodePredicate:u=VT,detectCycles:f=!0}={})=>{const l=n||{};let h,p,m=Array.isArray(e),d=[e],v=-1,y=[];const b=[],j=[];let g=e;do{v+=1;const e=v===d.length;let n,w;const O=e&&0!==y.length;if(e){if(n=0===j.length?void 0:b.pop(),w=p,p=j.pop(),O){w=m?w.slice():Object.create(Object.getPrototypeOf(w),Object.getOwnPropertyDescriptors(w));let e=0;for(let t=0;t<y.length;t+=1){let n=y[t][0];const r=y[t][1];m&&(n-=e),m&&r===s?(w.splice(n,1),e+=1):w[n]=r}}v=h.index,d=h.keys,y=h.edits,m=h.inArray,h=h.prev}else{if(n=p?m?v:d[v]:void 0,w=p?p[n]:g,w===s||void 0===w)continue;p&&b.push(n)}let E;if(!Array.isArray(w)){if(!u(w))throw new Error(`Invalid AST Node: ${JSON.stringify(w)}`);if(f&&j.includes(w)){b.pop();continue}const s=c(t,a(w),e);if(s){for(const[e,n]of Object.entries(r))t[e]=n;if(E=await s.call(t,w,n,p,b,j),E===i)break;if(E===o){if(!e){b.pop();continue}}else if(void 0!==E&&(y.push([n,E]),!e)){if(!u(E)){b.pop();continue}w=E}}}void 0===E&&O&&y.push([n,w]),e||(h={inArray:m,index:v,keys:d,edits:y,prev:h},m=Array.isArray(w),d=m?w:l[a(w)]||[],v=-1,y=[],p&&j.push(p),p=w)}while(void 0!==h);return 0!==y.length&&([,g]=y[y.length-1]),g};const HT=(e,t)=>"function"==typeof(null==t?void 0:t[e]),WT=e=>null!=e&&Object.prototype.hasOwnProperty.call(e,"_storedElement")&&Object.prototype.hasOwnProperty.call(e,"_content"),XT=(e,t)=>{var n;return(null==t||null===(n=t.primitive)||void 0===n?void 0:n.call(t))===e},YT=(e,t)=>{var n,r;return(null==t||null===(n=t.classes)||void 0===n||null===(r=n.includes)||void 0===r?void 0:r.call(n,e))||!1},KT=(e,t)=>(null==t?void 0:t.element)===e,QT=e=>e({hasMethod:HT,hasBasicElementProps:WT,primitiveEq:XT,isElementType:KT,hasClass:YT}),ZT=QT((({hasBasicElementProps:e,primitiveEq:t})=>n=>n instanceof uT||e(n)&&t(void 0,n))),eR=QT((({hasBasicElementProps:e,primitiveEq:t})=>n=>n instanceof fT||e(n)&&t("string",n))),tR=QT((({hasBasicElementProps:e,primitiveEq:t})=>n=>n instanceof lT||e(n)&&t("number",n))),nR=QT((({hasBasicElementProps:e,primitiveEq:t})=>n=>n instanceof pT||e(n)&&t("null",n))),rR=QT((({hasBasicElementProps:e,primitiveEq:t})=>n=>n instanceof hT||e(n)&&t("boolean",n))),iR=QT((({hasBasicElementProps:e,primitiveEq:t,hasMethod:n})=>r=>r instanceof dT||e(r)&&t("object",r)&&n("keys",r)&&n("values",r)&&n("items",r))),sR=QT((({hasBasicElementProps:e,primitiveEq:t,hasMethod:n})=>r=>r instanceof mT&&!(r instanceof dT)||e(r)&&t("array",r)&&n("push",r)&&n("unshift",r)&&n("map",r)&&n("reduce",r))),oR=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof vT||e(r)&&t("member",r)&&n(void 0,r))),cR=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof bT||e(r)&&t("link",r)&&n(void 0,r))),aR=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof yT||e(r)&&t("ref",r)&&n(void 0,r))),uR=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof gT||e(r)&&t("annotation",r)&&n("array",r))),fR=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof wT||e(r)&&t("comment",r)&&n("string",r))),lR=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof OT||e(r)&&t("parseResult",r)&&n("array",r))),hR=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof ET||e(r)&&t("sourceMap",r)&&n("array",r))),pR=e=>KT("object",e)||KT("array",e)||KT("boolean",e)||KT("number",e)||KT("string",e)||KT("null",e)||KT("member",e),mR=e=>{var t,n;return hR(null==e||null===(t=e.meta)||void 0===t||null===(n=t.get)||void 0===n?void 0:n.call(t,"sourceMap"))},dR=(e,t)=>0===e.length||Jw(bS(t.classes.toValue()),e),vR=Object.freeze(Object.defineProperty({__proto__:null,hasElementSourceMap:mR,includesClasses:dR,includesSymbols:(e,t)=>{if(0===e.length)return!0;const n=t.attributes.get("symbols");return!!sR(n)&&Jw(bS(n.toValue()),e)},isAnnotationElement:uR,isArrayElement:sR,isBooleanElement:rR,isCommentElement:fR,isElement:ZT,isLinkElement:cR,isMemberElement:oR,isNullElement:nR,isNumberElement:tR,isObjectElement:iR,isParseResultElement:lR,isPrimitiveElement:pR,isRefElement:aR,isSourceMapElement:hR,isStringElement:eR},Symbol.toStringTag,{value:"Module"})),yR=["keyMap"],bR=["keyMap"];function jR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jR(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jR(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const wR=e=>iR(e)?"ObjectElement":sR(e)?"ArrayElement":oR(e)?"MemberElement":eR(e)?"StringElement":rR(e)?"BooleanElement":tR(e)?"NumberElement":nR(e)?"NullElement":cR(e)?"LinkElement":aR(e)?"RefElement":void 0,OR=fE(wR,Hx),ER={ObjectElement:["content"],ArrayElement:["content"],MemberElement:["key","value"],StringElement:[],BooleanElement:[],NumberElement:[],NullElement:[],RefElement:[],LinkElement:[],Annotation:[],Comment:[],ParseResultElement:["content"],SourceMap:["content"]},xR=TT({props:{result:[],predicate:Pw,returnOnTrue:void 0,returnOnFalse:void 0},init({predicate:e=this.predicate,returnOnTrue:t=this.returnOnTrue,returnOnFalse:n=this.returnOnFalse}={}){this.result=[],this.predicate=e,this.returnOnTrue=t,this.returnOnFalse=n},methods:{enter(e){return this.predicate(e)?(this.result.push(e),this.returnOnTrue):this.returnOnFalse}}}),SR=(e,t,n={})=>{let{keyMap:r=ER}=n,i=BT(n,yR);return zT(e,t,gR({keyMap:r,nodeTypeGetter:wR,nodePredicate:OR},i))};SR[Symbol.for("nodejs.util.promisify.custom")]=async(e,t,n={})=>{let{keyMap:r=ER}=n,i=BT(n,bR);return zT[Symbol.for("nodejs.util.promisify.custom")](e,t,gR({keyMap:r,nodeTypeGetter:wR,nodePredicate:OR},i))};const PR=["keyMap"],$R=["keyMap"];function AR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function TR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AR(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AR(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const RR=e=>"string"==typeof(null==e?void 0:e.type)?e.type:wR(e),IR=TR({EphemeralObject:["content"],EphemeralArray:["content"]},ER),kR=(e,t,n={})=>{let{keyMap:r=IR}=n,i=BT(n,PR);return SR(e,t,TR({keyMap:r,nodeTypeGetter:RR,nodePredicate:$w,detectCycles:!1,deleteNodeSymbol:Symbol.for("delete-node"),skipVisitingNodeSymbol:Symbol.for("skip-visiting-node")},i))};kR[Symbol.for("nodejs.util.promisify.custom")]=async(e,t={})=>{let{keyMap:n=IR}=t,r=BT(t,$R);return SR[Symbol.for("nodejs.util.promisify.custom")](e,visitor,TR({keyMap:n,nodeTypeGetter:RR,nodePredicate:$w,detectCycles:!1,deleteNodeSymbol:Symbol.for("delete-node"),skipVisitingNodeSymbol:Symbol.for("skip-visiting-node")},r))};const FR=class{constructor(e){ml(this,"type","EphemeralArray"),ml(this,"content",[]),ml(this,"reference",void 0),this.content=e,this.reference=[]}toReference(){return this.reference}toArray(){return this.reference.push(...this.content),this.reference}};const MR=class{constructor(e){ml(this,"type","EphemeralObject"),ml(this,"content",[]),ml(this,"reference",void 0),this.content=e,this.reference={}}toReference(){return this.reference}toObject(){return Object.assign(this.reference,Object.fromEntries(this.content))}},NR=TT.init((function(){const e=new WeakMap;this.BooleanElement=function(e){return e.toValue()},this.NumberElement=function(e){return e.toValue()},this.StringElement=function(e){return e.toValue()},this.NullElement=function(){return null},this.ObjectElement={enter(t){if(e.has(t))return e.get(t).toReference();const n=new MR(t.content);return e.set(t,n),n}},this.EphemeralObject={leave:e=>e.toObject()},this.MemberElement={enter:e=>[e.key,e.value]},this.ArrayElement={enter(t){if(e.has(t))return e.get(t).toReference();const n=new FR(t.content);return e.set(t,n),n}},this.EphemeralArray={leave:e=>e.toArray()}})),CR=e=>kR(e,NR());function DR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const qR=()=>{const e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?DR(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DR(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},vR);return{predicates:e,namespace:ST}},_R=(e,t,n={})=>{if(0===t.length)return e;const r=yx(qR,"toolboxCreator",n),i=yx({},"visitorOptions",n),s=yx(wR,"nodeTypeGetter",i),o=r(),c=t.map((e=>e(o))),a=GT(c.map(yx({},"visitor")),{nodeTypeGetter:s});c.forEach(gS(["pre"],[]));const u=SR(e,a,i);return c.forEach(gS(["post"],[])),u};const BR=class extends Array{constructor(...e){super(...e),ml(this,"unknownMediaType","application/octet-stream")}filterByFormat(){throw new Error("Not implemented!")}findBy(){throw new Error("Not implemented")}latest(){throw new Error("Not implemented!")}};function LR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function UR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LR(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LR(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const JR=e=>(t,n={})=>((e,{Type:t,plugins:n=[]})=>{const r=new t(e);return _R(r,n,{toolboxCreator:qR,visitorOptions:{nodeTypeGetter:wR}})})(t,UR(UR({},n),{},{Type:e}));dT.refract=JR(dT),mT.refract=JR(mT),fT.refract=JR(fT),hT.refract=JR(hT),pT.refract=JR(pT),lT.refract=JR(lT),bT.refract=JR(bT),yT.refract=JR(yT),gT.refract=JR(gT),wT.refract=JR(wT),OT.refract=JR(OT),ET.refract=JR(ET);const VR=(e,t)=>{const n=xR({predicate:e});return SR(t,n),new aT(n.result)},GR=(e,t)=>{const n=xR({predicate:e,returnOnTrue:UT});return SR(t,n),px(void 0,[0],n.result)},zR=(e,t=new WeakMap)=>(oR(e)?(t.set(e.key,e),zR(e.key,t),t.set(e.value,e),zR(e.value,t)):e.children.forEach((n=>{t.set(n,e),zR(n,t)})),t),HR=TT.init((function({element:e}){let t;this.transclude=function(n,r){var i;if(n===e)return r;if(n===r)return e;t=null!==(i=t)&&void 0!==i?i:zR(e);const s=t.get(n);return Nx(s)?void 0:(iR(s)?((e,t,n)=>{const r=n.get(e);iR(r)&&(r.content=r.map(((i,s,o)=>o===e?(n.delete(e),n.set(t,r),t):o)))})(n,r,t):sR(s)?((e,t,n)=>{const r=n.get(e);sR(r)&&(r.content=r.map((i=>i===e?(n.delete(e),n.set(t,r),t):i)))})(n,r,t):oR(s)&&((e,t,n)=>{const r=n.get(e);oR(r)&&(r.key===e&&(r.key=t,n.delete(e),n.set(t,r)),r.value===e&&(r.value=t,n.delete(e),n.set(t,r)))})(n,r,t),e)}})),WR=HR,XR=(e,t)=>{const n=gE(e,t);return sx((e=>{if(iS(e)&&JE("$ref",e)&&bx(Hx,"$ref",e)){const t=ix(["$ref"],e),r=AS("#/",t);return ix(r.split("/"),n)}return iS(e)?XR(e,n):e}),e)};function YR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function KR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?YR(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YR(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const QR=e=>{const t=e.meta.clone(),n=e.attributes.clone();return new e.constructor(void 0,t,n)},ZR=e=>new vT(e.key,e.value,e.meta.clone(),e.attributes.clone()),eI=(e,t)=>t.clone&&t.isMergeableElement(e)?rI(QR(e),e,t):e,tI=(e,t,n)=>e.concat(t)["fantasy-land/map"]((e=>eI(e,n))),nI=(e,t,n)=>{const r=iR(e)?QR(e):QR(t);return iR(e)&&e.forEach(((e,t,i)=>{const s=ZR(i);s.value=eI(e,n),r.content.push(s)})),t.forEach(((t,i,s)=>{const o=i.toValue();let c;if(iR(e)&&e.hasKey(o)&&n.isMergeableElement(t)){const r=e.get(o);c=ZR(s),c.value=((e,t)=>{if("function"!=typeof t.customMerge)return rI;const n=t.customMerge(e,t);return"function"==typeof n?n:rI})(i,n)(r,t)}else c=ZR(s),c.value=eI(t,n);r.remove(o),r.content.push(c)})),r};function rI(e,t,n){var r,i,s;const o={clone:!0,isMergeableElement:e=>iR(e)||sR(e),arrayElementMerge:tI,objectElementMerge:nI,customMerge:void 0},c=KR(KR({},o),n);c.isMergeableElement=null!==(r=c.isMergeableElement)&&void 0!==r?r:o.isMergeableElement,c.arrayElementMerge=null!==(i=c.arrayElementMerge)&&void 0!==i?i:o.arrayElementMerge,c.objectElementMerge=null!==(s=c.objectElementMerge)&&void 0!==s?s:o.objectElementMerge;const a=sR(t);return a===sR(e)?a&&"function"==typeof c.arrayElementMerge?c.arrayElementMerge(e,t,c):c.objectElementMerge(e,t,c):eI(t,c)}rI.all=(e,t)=>{if(!Array.isArray(e))throw new Error("first argument should be an array");return 0===e.length?new dT:e.reduce(((e,n)=>rI(e,n,t)),QR(e[0]))};const iI=(e,t=ST)=>{if(Hx(e))try{return t.fromRefract(JSON.parse(e))}catch{}return iS(e)&&JE("element",e)?t.fromRefract(e):t.toElement(e)},sI=CR;class oI extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack}}class cI extends Error{constructor(e){super(`Invalid $ref pointer "${e}". Pointers must begin with "/"`),this.name=this.constructor.name,this.message=`Invalid $ref pointer "${e}". Pointers must begin with "/"`,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(`Invalid $ref pointer "${e}". Pointers must begin with "/"`).stack}}const aI=fE(Ex(/~/g,"~0"),Ex(/\//g,"~1"),encodeURIComponent),uI=fE(Ex(/~1/g,"/"),Ex(/~0/g,"~"),(e=>{try{return decodeURIComponent(e)}catch{return e}})),fI=(e,t)=>{const n=(e=>{if(Wx(e))return[];if(!$x("/",e))throw new cI(e);const t=fE(Px("/"),wO(uI))(e);return uE(t)})(e);return n.reduce(((e,t)=>{if(iR(e)){if(!e.hasKey(t))throw new oI(`Evaluation failed on token: "${t}"`);return e.get(t)}if(sR(e)){if(!(t in e.content)||!uS(Number(t)))throw new oI(`Evaluation failed on token: "${t}"`);return e.get(Number(t))}throw new oI(`Evaluation failed on token: "${t}"`)}),t)},lI=e=>{const t=(e=>{const t=e.indexOf("#");return-1!==t?e.substring(t):"#"})(e);return AS("#",t)};class hI extends BR{filterByFormat(e="generic"){const t="generic"===e?"openapi;version":e;return this.filter((e=>e.includes(t)))}findBy(e="3.1.0",t="generic"){const n="generic"===t?`vnd.oai.openapi;version=${e}`:`vnd.oai.openapi+${t};version=${e}`;return this.find((e=>e.includes(n)))||this.unknownMediaType}latest(e="generic"){return kE(this.filterByFormat(e))}}const pI=new hI("application/vnd.oai.openapi;version=3.1.0","application/vnd.oai.openapi+json;version=3.1.0","application/vnd.oai.openapi+yaml;version=3.1.0");const mI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="callback"}};const dI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="components"}get schemas(){return this.get("schemas")}set schemas(e){this.set("schemas",e)}get responses(){return this.get("responses")}set responses(e){this.set("responses",e)}get parameters(){return this.get("parameters")}set parameters(e){this.set("parameters",e)}get examples(){return this.get("examples")}set examples(e){this.set("examples",e)}get requestBodies(){return this.get("requestBodies")}set requestBodies(e){this.set("requestBodies",e)}get headers(){return this.get("headers")}set headers(e){this.set("headers",e)}get securitySchemes(){return this.get("securitySchemes")}set securitySchemes(e){this.set("securitySchemes",e)}get links(){return this.get("links")}set links(e){this.set("links",e)}get callbacks(){return this.get("callbacks")}set callbacks(e){this.set("callbacks",e)}};const vI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="contact"}get name(){return this.get("name")}set name(e){this.set("name",e)}get url(){return this.get("url")}set url(e){this.set("url",e)}get email(){return this.get("email")}set email(e){this.set("email",e)}};const yI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="discriminator"}get propertyName(){return this.get("propertyName")}set propertyName(e){this.set("propertyName",e)}get mapping(){return this.get("mapping")}set mapping(e){this.set("mapping",e)}};const bI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="encoding"}get contentType(){return this.get("contentType")}set contentType(e){this.set("contentType",e)}get headers(){return this.get("headers")}set headers(e){this.set("headers",e)}get style(){return this.get("style")}set style(e){this.set("style",e)}get explode(){return this.get("explode")}set explode(e){this.set("explode",e)}get allowedReserved(){return this.get("allowedReserved")}set allowedReserved(e){this.set("allowedReserved",e)}};const jI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="example"}get summary(){return this.get("summary")}set summary(e){this.set("summary",e)}get description(){return this.get("description")}set description(e){this.set("description",e)}get value(){return this.get("value")}set value(e){this.set("value",e)}get externalValue(){return this.get("externalValue")}set externalValue(e){this.set("externalValue",e)}};const gI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="externalDocumentation"}get description(){return this.get("description")}set description(e){this.set("description",e)}get url(){return this.get("url")}set url(e){this.set("url",e)}};let wI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="header"}get required(){return this.hasKey("required")?this.get("required"):new hT(!1)}set required(e){this.set("required",e)}get deprecated(){return this.hasKey("deprecated")?this.get("deprecated"):new hT(!1)}set deprecated(e){this.set("deprecated",e)}get allowEmptyValue(){return this.get("allowEmptyValue")}set allowEmptyValue(e){this.set("allowEmptyValue",e)}get style(){return this.get("style")}set style(e){this.set("style",e)}get explode(){return this.get("explode")}set explode(e){this.set("explode",e)}get allowReserved(){return this.get("allowReserved")}set allowReserved(e){this.set("allowReserved",e)}get schema(){return this.get("schema")}set schema(e){this.set("schema",e)}get example(){return this.get("example")}set example(e){this.set("example",e)}get examples(){return this.get("examples")}set examples(e){this.set("examples",e)}get contentProp(){return this.get("content")}set contentProp(e){this.set("content",e)}};Object.defineProperty(wI.prototype,"description",{get(){return this.get("description")},set(e){this.set("description",e)},enumerable:!0});const OI=wI;const EI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="info",this.classes.push("info")}get title(){return this.get("title")}set title(e){this.set("title",e)}get description(){return this.get("description")}set description(e){this.set("description",e)}get termsOfService(){return this.get("termsOfService")}set termsOfService(e){this.set("termsOfService",e)}get contact(){return this.get("contact")}set contact(e){this.set("contact",e)}get license(){return this.get("license")}set license(e){this.set("license",e)}get version(){return this.get("version")}set version(e){this.set("version",e)}};const xI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="license"}get name(){return this.get("name")}set name(e){this.set("name",e)}get url(){return this.get("url")}set url(e){this.set("url",e)}};const SI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="link"}get operationRef(){return this.get("operationRef")}set operationRef(e){this.set("operationRef",e)}get operationId(){return this.get("operationId")}set operationId(e){this.set("operationId",e)}get operation(){var e,t;return eR(this.operationRef)?null===(e=this.operationRef)||void 0===e?void 0:e.meta.get("operation"):eR(this.operationId)?null===(t=this.operationId)||void 0===t?void 0:t.meta.get("operation"):void 0}set operation(e){this.set("operation",e)}get parameters(){return this.get("parameters")}set parameters(e){this.set("parameters",e)}get requestBody(){return this.get("requestBody")}set requestBody(e){this.set("requestBody",e)}get description(){return this.get("description")}set description(e){this.set("description",e)}get server(){return this.get("server")}set server(e){this.set("server",e)}};const PI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="mediaType"}get schema(){return this.get("schema")}set schema(e){this.set("schema",e)}get example(){return this.get("example")}set example(e){this.set("example",e)}get examples(){return this.get("examples")}set examples(e){this.set("examples",e)}get encoding(){return this.get("encoding")}set encoding(e){this.set("encoding",e)}};const $I=class extends dT{constructor(e,t,n){super(e,t,n),this.element="oAuthFlow"}get authorizationUrl(){return this.get("authorizationUrl")}set authorizationUrl(e){this.set("authorizationUrl",e)}get tokenUrl(){return this.get("tokenUrl")}set tokenUrl(e){this.set("tokenUrl",e)}get refreshUrl(){return this.get("refreshUrl")}set refreshUrl(e){this.set("refreshUrl",e)}get scopes(){return this.get("scopes")}set scopes(e){this.set("scopes",e)}};const AI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="oAuthFlows"}get implicit(){return this.get("implicit")}set implicit(e){this.set("implicit",e)}get password(){return this.get("password")}set password(e){this.set("password",e)}get clientCredentials(){return this.get("clientCredentials")}set clientCredentials(e){this.set("clientCredentials",e)}get authorizationCode(){return this.get("authorizationCode")}set authorizationCode(e){this.set("authorizationCode",e)}};const TI=class extends fT{constructor(e,t,n){super(e,t,n),this.element="openapi",this.classes.push("spec-version"),this.classes.push("version")}};const RI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="openApi3_0",this.classes.push("api")}get openapi(){return this.get("openapi")}set openapi(e){this.set("openapi",e)}get info(){return this.get("info")}set info(e){this.set("info",e)}get servers(){return this.get("servers")}set servers(e){this.set("servers",e)}get paths(){return this.get("paths")}set paths(e){this.set("paths",e)}get components(){return this.get("components")}set components(e){this.set("components",e)}get security(){return this.get("security")}set security(e){this.set("security",e)}get tags(){return this.get("tags")}set tags(e){this.set("tags",e)}get externalDocs(){return this.get("externalDocs")}set externalDocs(e){this.set("externalDocs",e)}};const II=class extends dT{constructor(e,t,n){super(e,t,n),this.element="operation"}get tags(){return this.get("tags")}set tags(e){this.set("tags",e)}get summary(){return this.get("summary")}set summary(e){this.set("summary",e)}get description(){return this.get("description")}set description(e){this.set("description",e)}set externalDocs(e){this.set("externalDocs",e)}get externalDocs(){return this.get("externalDocs")}get operationId(){return this.get("operationId")}set operationId(e){this.set("operationId",e)}get parameters(){return this.get("parameters")}set parameters(e){this.set("parameters",e)}get requestBody(){return this.get("requestBody")}set requestBody(e){this.set("requestBody",e)}get responses(){return this.get("responses")}set responses(e){this.set("responses",e)}get callbacks(){return this.get("callbacks")}set callbacks(e){this.set("callbacks",e)}get deprecated(){return this.hasKey("deprecated")?this.get("deprecated"):new hT(!1)}set deprecated(e){this.set("deprecated",e)}get security(){return this.get("security")}set security(e){this.set("security",e)}get servers(){return this.get("severs")}set servers(e){this.set("servers",e)}};let kI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="parameter"}get name(){return this.get("name")}set name(e){this.set("name",e)}get in(){return this.get("in")}set in(e){this.set("in",e)}get required(){return this.hasKey("required")?this.get("required"):new hT(!1)}set required(e){this.set("required",e)}get deprecated(){return this.hasKey("deprecated")?this.get("deprecated"):new hT(!1)}set deprecated(e){this.set("deprecated",e)}get allowEmptyValue(){return this.get("allowEmptyValue")}set allowEmptyValue(e){this.set("allowEmptyValue",e)}get style(){return this.get("style")}set style(e){this.set("style",e)}get explode(){return this.get("explode")}set explode(e){this.set("explode",e)}get allowReserved(){return this.get("allowReserved")}set allowReserved(e){this.set("allowReserved",e)}get schema(){return this.get("schema")}set schema(e){this.set("schema",e)}get example(){return this.get("example")}set example(e){this.set("example",e)}get examples(){return this.get("examples")}set examples(e){this.set("examples",e)}get contentProp(){return this.get("content")}set contentProp(e){this.set("content",e)}};Object.defineProperty(kI.prototype,"description",{get(){return this.get("description")},set(e){this.set("description",e)},enumerable:!0});const FI=kI;const MI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="pathItem"}get $ref(){return this.get("$ref")}set $ref(e){this.set("$ref",e)}get summary(){return this.get("summary")}set summary(e){this.set("summary",e)}get description(){return this.get("description")}set description(e){this.set("description",e)}get GET(){return this.get("get")}set GET(e){this.set("GET",e)}get PUT(){return this.get("put")}set PUT(e){this.set("PUT",e)}get POST(){return this.get("post")}set POST(e){this.set("POST",e)}get DELETE(){return this.get("delete")}set DELETE(e){this.set("DELETE",e)}get OPTIONS(){return this.get("options")}set OPTIONS(e){this.set("OPTIONS",e)}get HEAD(){return this.get("head")}set HEAD(e){this.set("HEAD",e)}get PATCH(){return this.get("patch")}set PATCH(e){this.set("PATCH",e)}get TRACE(){return this.get("trace")}set TRACE(e){this.set("TRACE",e)}get servers(){return this.get("servers")}set servers(e){this.set("servers",e)}get parameters(){return this.get("parameters")}set parameters(e){this.set("parameters",e)}};const NI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="paths"}};const CI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="reference",this.classes.push("openapi-reference")}get $ref(){return this.get("$ref")}set $ref(e){this.set("$ref",e)}};const DI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="requestBody"}get description(){return this.get("description")}set description(e){this.set("description",e)}get contentProp(){return this.get("content")}set contentProp(e){this.set("content",e)}get required(){return this.hasKey("required")?this.get("required"):new hT(!1)}set required(e){this.set("required",e)}};const qI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="response"}get description(){return this.get("description")}set description(e){this.set("description",e)}get headers(){return this.get("headers")}set headers(e){this.set("headers",e)}get contentProp(){return this.get("content")}set contentProp(e){this.set("content",e)}get links(){return this.get("links")}set links(e){this.set("links",e)}};const _I=class extends dT{constructor(e,t,n){super(e,t,n),this.element="responses"}get default(){return this.get("default")}set default(e){this.set("default",e)}};const BI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="JSONSchemaDraft4"}get idProp(){return this.get("id")}set idProp(e){this.set("id",e)}get $schema(){return this.get("$schema")}set $schema(e){this.set("idProp",e)}get multipleOf(){return this.get("multipleOf")}set multipleOf(e){this.set("multipleOf",e)}get maximum(){return this.get("maximum")}set maximum(e){this.set("maximum",e)}get exclusiveMaximum(){return this.get("exclusiveMaximum")}set exclusiveMaximum(e){this.set("exclusiveMaximum",e)}get minimum(){return this.get("minimum")}set minimum(e){this.set("minimum",e)}get exclusiveMinimum(){return this.get("exclusiveMinimum")}set exclusiveMinimum(e){this.set("exclusiveMinimum",e)}get maxLength(){return this.get("maxLength")}set maxLength(e){this.set("maxLength",e)}get minLength(){return this.get("minLength")}set minLength(e){this.set("minLength",e)}get pattern(){return this.get("pattern")}set pattern(e){this.set("pattern",e)}get additionalItems(){return this.get("additionalItems")}set additionalItems(e){this.set("additionalItems",e)}get items(){return this.get("items")}set items(e){this.set("items",e)}get maxItems(){return this.get("maxItems")}set maxItems(e){this.set("maxItems",e)}get minItems(){return this.get("minItems")}set minItems(e){this.set("minItems",e)}get uniqueItems(){return this.get("uniqueItems")}set uniqueItems(e){this.set("uniqueItems",e)}get maxProperties(){return this.get("maxProperties")}set maxProperties(e){this.set("maxProperties",e)}get minProperties(){return this.get("minProperties")}set minProperties(e){this.set("minProperties",e)}get required(){return this.get("required")}set required(e){this.set("required",e)}get properties(){return this.get("properties")}set properties(e){this.set("properties",e)}get additionalProperties(){return this.get("additionalProperties")}set additionalProperties(e){this.set("additionalProperties",e)}get patternProperties(){return this.get("patternProperties")}set patternProperties(e){this.set("patternProperties",e)}get dependencies(){return this.get("dependencies")}set dependencies(e){this.set("dependencies",e)}get enum(){return this.get("enum")}set enum(e){this.set("enum",e)}get type(){return this.get("type")}set type(e){this.set("type",e)}get allOf(){return this.get("allOf")}set allOf(e){this.set("allOf",e)}get anyOf(){return this.get("anyOf")}set anyOf(e){this.set("anyOf",e)}get oneOf(){return this.get("oneOf")}set oneOf(e){this.set("oneOf",e)}get not(){return this.get("not")}set not(e){this.set("not",e)}get definitions(){return this.get("definitions")}set definitions(e){this.set("definitions",e)}get title(){return this.get("title")}set title(e){this.set("title",e)}get description(){return this.get("description")}set description(e){this.set("description",e)}get default(){return this.get("default")}set default(e){this.set("default",e)}get format(){return this.get("format")}set format(e){this.set("format",e)}get base(){return this.get("base")}set base(e){this.set("base",e)}get links(){return this.get("links")}set links(e){this.set("links",e)}get media(){return this.get("media")}set media(e){this.set("media",e)}get readOnly(){return this.get("readOnly")}set readOnly(e){this.set("readOnly",e)}};const LI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="JSONReference",this.classes.push("json-reference")}get $ref(){return this.get("$ref")}set $ref(e){this.set("$ref",e)}};const UI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="media"}get binaryEncoding(){return this.get("binaryEncoding")}set binaryEncoding(e){this.set("binaryEncoding",e)}get type(){return this.get("type")}set type(e){this.set("type",e)}};const JI=class extends dT{constructor(e,t,n){super(e,t,n),this.element="linkDescription"}get href(){return this.get("href")}set href(e){this.set("href",e)}get rel(){return this.get("rel")}set rel(e){this.set("rel",e)}get title(){return this.get("title")}set title(e){this.set("title",e)}get targetSchema(){return this.get("targetSchema")}set targetSchema(e){this.set("targetSchema",e)}get mediaType(){return this.get("mediaType")}set mediaType(e){this.set("mediaType",e)}get method(){return this.get("method")}set method(e){this.set("method",e)}get encType(){return this.get("encType")}set encType(e){this.set("encType",e)}get schema(){return this.get("schema")}set schema(e){this.set("schema",e)}},VI={namespace:e=>{const{base:t}=e;return t.register("jSONSchemaDraft4",BI),t.register("jSONReference",LI),t.register("media",UI),t.register("linkDescription",JI),t}};function GI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const zI=e=>{if(ZT(e))return`${e.element.charAt(0).toUpperCase()+e.element.slice(1)}Element`},HI=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?GI(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GI(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({JSONSchemaDraft4Element:["content"],JSONReferenceElement:["content"],MediaElement:["content"],LinkDescriptionElement:["content"]},ER),WI=TT({props:{element:null},methods:{copyMetaAndAttributes(e,t){mR(e)&&t.meta.set("sourceMap",e.meta.get("sourceMap"))}}}),XI=WI,YI=TT(XI,{methods:{enter(e){return this.element=e.clone(),UT}}});function KI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function QI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?KI(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KI(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const ZI=TT(XI,{props:{specObj:null,passingOptionsNames:["specObj"]},init({specObj:e=this.specObj}){this.specObj=e},methods:{retrievePassingOptions(){return dx(this.passingOptionsNames,this)},retrieveFixedFields(e){return fE(ix(["visitors",...e,"fixedFields"]),eO)(this.specObj)},retrieveVisitor(e){return mx(Ux,["visitors",...e],this.specObj)?ix(["visitors",...e],this.specObj):ix(["visitors",...e,"$visitor"],this.specObj)},retrieveVisitorInstance(e,t={}){const n=this.retrievePassingOptions();return this.retrieveVisitor(e)(QI(QI({},n),t))},toRefractedElement(e,t,n={}){const r=this.retrieveVisitorInstance(e,n),i=Object.getPrototypeOf(r);return Nx(this.fallbackVisitorPrototype)&&(this.fallbackVisitorPrototype=Object.getPrototypeOf(this.retrieveVisitorInstance(["value"]))),this.fallbackVisitorPrototype===i?t.clone():(SR(t,r,QI({keyMap:HI,nodeTypeGetter:zI},n)),r.element)}}}),ek=TT(ZI,{props:{specPath:lS,ignoredFields:[]},init({specPath:e=this.specPath,ignoredFields:t=this.ignoredFields}={}){this.specPath=e,this.ignoredFields=t},methods:{ObjectElement(e){const t=this.specPath(e),n=this.retrieveFixedFields(t);return e.forEach(((e,r,i)=>{if(eR(r)&&n.includes(r.toValue())&&!this.ignoredFields.includes(r.toValue())){const n=this.toRefractedElement([...t,"fixedFields",r.toValue()],e),s=new vT(r.clone(),n);this.copyMetaAndAttributes(i,s),s.classes.push("fixed-field"),this.element.content.push(s)}else this.ignoredFields.includes(r.toValue())||this.element.content.push(i.clone())})),this.copyMetaAndAttributes(e,this.element),UT}}}),tk=TT(ek,YI,{props:{specPath:_O(["document","objects","JSONSchema"])},init(){this.element=new BI}}),nk=YI,rk=YI,ik=YI,sk=YI,ok=YI,ck=YI,ak=YI,uk=YI,fk=YI,lk=YI,hk=TT({props:{parent:null},init({parent:e=this.parent}){this.parent=e,this.passingOptionsNames=[...this.passingOptionsNames,"parent"]}}),pk=hk,mk=e=>iR(e)&&e.hasKey("$ref"),dk=TT(ZI,pk,YI,{methods:{ObjectElement(e){const t=mk(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"];return this.element=this.toRefractedElement(t,e),UT},ArrayElement(e){return this.element=new mT,this.element.classes.push("json-schema-items"),e.forEach((e=>{const t=mk(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"],n=this.toRefractedElement(t,e);this.element.push(n)})),this.copyMetaAndAttributes(e,this.element),UT}}}),vk=YI,yk=YI,bk=YI,jk=YI,gk=YI,wk=TT(YI,{methods:{ArrayElement(e){return this.element=e.clone(),this.element.classes.push("json-schema-required"),UT}}}),Ok=TT(ZI,{props:{fieldPatternPredicate:Pw,specPath:lS,ignoredFields:[]},init({specPath:e=this.specPath,ignoredFields:t=this.ignoredFields}={}){this.specPath=e,this.ignoredFields=t},methods:{ObjectElement(e){return e.forEach(((e,t,n)=>{if(!this.ignoredFields.includes(t.toValue())&&this.fieldPatternPredicate(t.toValue())){const r=this.specPath(e),i=this.toRefractedElement(r,e),s=new vT(t.clone(),i);this.copyMetaAndAttributes(n,s),s.classes.push("patterned-field"),this.element.content.push(s)}else this.ignoredFields.includes(t.toValue())||this.element.content.push(n.clone())})),this.copyMetaAndAttributes(e,this.element),UT}}}),Ek=TT(Ok,{props:{fieldPatternPredicate:Qx}}),xk=TT(Ek,pk,YI,{props:{specPath:e=>mk(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"]},init(){this.element=new dT,this.element.classes.push("json-schema-properties")}}),Sk=TT(Ek,pk,YI,{props:{specPath:e=>mk(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"]},init(){this.element=new dT,this.element.classes.push("json-schema-patternProperties")}}),Pk=TT(Ek,pk,YI,{props:{specPath:e=>mk(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"]},init(){this.element=new dT,this.element.classes.push("json-schema-dependencies")}}),$k=TT(YI,{methods:{ArrayElement(e){return this.element=e.clone(),this.element.classes.push("json-schema-enum"),UT}}}),Ak=TT(YI,{methods:{StringElement(e){return this.element=e.clone(),this.element.classes.push("json-schema-type"),UT},ArrayElement(e){return this.element=e.clone(),this.element.classes.push("json-schema-type"),UT}}}),Tk=TT(ZI,pk,YI,{init(){this.element=new mT,this.element.classes.push("json-schema-allOf")},methods:{ArrayElement(e){return e.forEach((e=>{const t=mk(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"],n=this.toRefractedElement(t,e);this.element.push(n)})),this.copyMetaAndAttributes(e,this.element),UT}}}),Rk=TT(ZI,pk,YI,{init(){this.element=new mT,this.element.classes.push("json-schema-anyOf")},methods:{ArrayElement(e){return e.forEach((e=>{const t=mk(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"],n=this.toRefractedElement(t,e);this.element.push(n)})),this.copyMetaAndAttributes(e,this.element),UT}}}),Ik=TT(ZI,pk,YI,{init(){this.element=new mT,this.element.classes.push("json-schema-oneOf")},methods:{ArrayElement(e){return e.forEach((e=>{const t=mk(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"],n=this.toRefractedElement(t,e);this.element.push(n)})),this.copyMetaAndAttributes(e,this.element),UT}}}),kk=TT(Ek,pk,YI,{props:{specPath:e=>mk(e)?["document","objects","JSONReference"]:["document","objects","JSONSchema"]},init(){this.element=new dT,this.element.classes.push("json-schema-definitions")}}),Fk=YI,Mk=YI,Nk=YI,Ck=YI,Dk=YI,qk=TT(ZI,pk,YI,{init(){this.element=new mT,this.element.classes.push("json-schema-links")},methods:{ArrayElement(e){return e.forEach((e=>{const t=this.toRefractedElement(["document","objects","LinkDescription"],e);this.element.push(t)})),this.copyMetaAndAttributes(e,this.element),UT}}}),_k=YI,Bk=TT(ek,YI,{props:{specPath:_O(["document","objects","JSONReference"])},init(){this.element=new LI},methods:{ObjectElement(e){const t=ek.compose.methods.ObjectElement.call(this,e);return eR(this.element.$ref)&&this.element.classes.push("reference-element"),t}}}),Lk=TT(YI,{methods:{StringElement(e){return this.element=e.clone(),this.element.classes.push("reference-value"),UT}}}),Uk=TT(ZI,{props:{alternator:[]},methods:{enter(e){const t=this.alternator.map((({predicate:e,specPath:t})=>WE(e,_O(t),Mx))),n=yS(t)(e);return this.element=this.toRefractedElement(n,e),UT}}}),Jk=TT(Uk,{props:{alternator:[{predicate:mk,specPath:["document","objects","JSONReference"]},{predicate:$w,specPath:["document","objects","JSONSchema"]}]}}),Vk={visitors:{value:YI,JSONSchemaOrJSONReferenceVisitor:Jk,document:{objects:{JSONSchema:{$visitor:tk,fixedFields:{id:nk,$schema:rk,multipleOf:ik,maximum:sk,exclusiveMaximum:ok,minimum:ck,exclusiveMinimum:ak,maxLength:uk,minLength:fk,pattern:lk,additionalItems:Jk,items:dk,maxItems:vk,minItems:yk,uniqueItems:bk,maxProperties:jk,minProperties:gk,required:wk,properties:xk,additionalProperties:Jk,patternProperties:Sk,dependencies:Pk,enum:$k,type:Ak,allOf:Tk,anyOf:Rk,oneOf:Ik,not:Jk,definitions:kk,title:Fk,description:Mk,default:Nk,format:Ck,base:Dk,links:qk,media:{$ref:"#/visitors/document/objects/Media"},readOnly:_k}},JSONReference:{$visitor:Bk,fixedFields:{$ref:Lk}},Media:{$visitor:TT(ek,YI,{props:{specPath:_O(["document","objects","Media"])},init(){this.element=new UI}}),fixedFields:{binaryEncoding:YI,type:YI}},LinkDescription:{$visitor:TT(ek,YI,{props:{specPath:_O(["document","objects","LinkDescription"])},init(){this.element=new JI}}),fixedFields:{href:YI,rel:YI,title:YI,targetSchema:Jk,mediaType:YI,method:YI,encType:YI,schema:Jk}}}}}},Gk=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof BI||e(r)&&t("JSONSchemaDraft4",r)&&n("object",r))),zk=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof LI||e(r)&&t("JSONReference",r)&&n("object",r))),Hk=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof UI||e(r)&&t("media",r)&&n("object",r))),Wk=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof JI||e(r)&&t("linkDescription",r)&&n("object",r))),Xk=Object.freeze(Object.defineProperty({__proto__:null,isJSONReferenceElement:zk,isJSONSchemaElement:Gk,isLinkDescriptionElement:Wk,isMediaElement:Hk},Symbol.toStringTag,{value:"Module"}));function Yk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yk(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yk(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Qk=()=>{const e=PT(VI);return{predicates:Kk(Kk({},Xk),{},{isStringElement:eR}),namespace:e}};function Zk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const eF=e=>(t,n={})=>((e,{specPath:t=["visitors","document","objects","JSONSchema","$visitor"],plugins:n=[],specificationObj:r=Vk}={})=>{const i=jT(e),s=XR(r),o=gS(t,[],s);return SR(i,o,{state:{specObj:s}}),_R(o.element,n,{toolboxCreator:Qk,visitorOptions:{keyMap:HI,nodeTypeGetter:zI}})})(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zk(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zk(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({specPath:e},n));BI.refract=eF(["visitors","document","objects","JSONSchema","$visitor"]),LI.refract=eF(["visitors","document","objects","JSONReference","$visitor"]),UI.refract=eF(["visitors","document","objects","Media","$visitor"]),JI.refract=eF(["visitors","document","objects","LinkDescription","$visitor"]);const tF=class extends BI{constructor(e,t,n){super(e,t,n),this.element="schema",this.classes.push("json-schema-draft-4")}get additionalItems(){return this.get("additionalItems")}set additionalItems(e){this.set("additionalItems",e)}get items(){return this.get("items")}set items(e){this.set("items",e)}get additionalProperties(){return this.get("additionalProperties")}set additionalProperties(e){this.set("additionalProperties",e)}get type(){return this.get("type")}set type(e){this.set("type",e)}get not(){return this.get("not")}set not(e){this.set("not",e)}get nullable(){return this.get("nullable")}set nullable(e){this.set("nullable",e)}get discriminator(){return this.get("discriminator")}set discriminator(e){this.set("discriminator",e)}get writeOnly(){return this.get("writeOnly")}set writeOnly(e){this.set("writeOnly",e)}get xml(){return this.get("xml")}set xml(e){this.set("xml",e)}get externalDocs(){return this.get("externalDocs")}set externalDocs(e){this.set("externalDocs",e)}get example(){return this.get("example")}set example(e){this.set("example",e)}get deprecated(){return this.get("deprecated")}set deprecated(e){this.set("deprecated",e)}};const nF=class extends dT{constructor(e,t,n){super(e,t,n),this.element="securityRequirement"}};const rF=class extends dT{constructor(e,t,n){super(e,t,n),this.element="securityScheme"}get type(){return this.get("type")}set type(e){this.set("type",e)}get description(){return this.get("description")}set description(e){this.set("description",e)}get name(){return this.get("name")}set name(e){this.set("name",e)}get in(){return this.get("in")}set in(e){this.set("in",e)}get scheme(){return this.get("scheme")}set scheme(e){this.set("scheme",e)}get bearerFormat(){return this.get("bearerFormat")}set bearerFormat(e){this.set("bearerFormat",e)}get flows(){return this.get("flows")}set flows(e){this.set("flows",e)}get openIdConnectUrl(){return this.get("openIdConnectUrl")}set openIdConnectUrl(e){this.set("openIdConnectUrl",e)}};const iF=class extends dT{constructor(e,t,n){super(e,t,n),this.element="server"}get url(){return this.get("url")}set url(e){this.set("url",e)}get description(){return this.get("description")}set description(e){this.set("description",e)}get variables(){return this.get("variables")}set variables(e){this.set("variables",e)}};const sF=class extends dT{constructor(e,t,n){super(e,t,n),this.element="serverVariable"}get enum(){return this.get("enum")}set enum(e){this.set("enum",e)}get default(){return this.get("default")}set default(e){this.set("default",e)}get description(){return this.get("description")}set description(e){this.set("description",e)}};const oF=class extends dT{constructor(e,t,n){super(e,t,n),this.element="tag"}get name(){return this.get("name")}set name(e){this.set("name",e)}get description(){return this.get("description")}set description(e){this.set("description",e)}get externalDocs(){return this.get("externalDocs")}set externalDocs(e){this.set("externalDocs",e)}};const cF=class extends dT{constructor(e,t,n){super(e,t,n),this.element="xml"}get name(){return this.get("name")}set name(e){this.set("name",e)}get namespace(){return this.get("namespace")}set namespace(e){this.set("namespace",e)}get prefix(){return this.get("prefix")}set prefix(e){this.set("prefix",e)}get attribute(){return this.get("attribute")}set attribute(e){this.set("attribute",e)}get wrapped(){return this.get("wrapped")}set wrapped(e){this.set("wrapped",e)}},aF={namespace:e=>{const{base:t}=e;return t.register("callback",mI),t.register("components",dI),t.register("contact",vI),t.register("discriminator",yI),t.register("encoding",bI),t.register("example",jI),t.register("externalDocumentation",gI),t.register("header",OI),t.register("info",EI),t.register("license",xI),t.register("link",SI),t.register("mediaType",PI),t.register("oAuthFlow",$I),t.register("oAuthFlows",AI),t.register("openapi",TI),t.register("openApi3_0",RI),t.register("operation",II),t.register("parameter",FI),t.register("pathItem",MI),t.register("paths",NI),t.register("reference",CI),t.register("requestBody",DI),t.register("response",qI),t.register("responses",_I),t.register("schema",tF),t.register("securityRequirement",nF),t.register("securityScheme",rF),t.register("server",iF),t.register("serverVariable",sF),t.register("tag",oF),t.register("xml",cF),t}};class uF extends mT{constructor(e,t,n){super(e,t,n),this.classes.push(uF.primaryClass)}}ml(uF,"primaryClass","servers");const fF=uF;class lF extends mT{constructor(e,t,n){super(e,t,n),this.classes.push(lF.primaryClass)}}ml(lF,"primaryClass","security");const hF=lF;class pF extends mT{constructor(e,t,n){super(e,t,n),this.classes.push(pF.primaryClass)}}ml(pF,"primaryClass","tags");const mF=pF;class dF extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(dF.primaryClass)}}ml(dF,"primaryClass","server-variables");const vF=dF;class yF extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(yF.primaryClass)}}ml(yF,"primaryClass","components-schemas");const bF=yF;class jF extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(jF.primaryClass)}}ml(jF,"primaryClass","components-responses");const gF=jF;class wF extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(wF.primaryClass),this.classes.push("parameters")}}ml(wF,"primaryClass","components-parameters");const OF=wF;class EF extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(EF.primaryClass),this.classes.push("examples")}}ml(EF,"primaryClass","components-examples");const xF=EF;class SF extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(SF.primaryClass)}}ml(SF,"primaryClass","components-request-bodies");const PF=SF;class $F extends dT{constructor(e,t,n){super(e,t,n),this.classes.push($F.primaryClass)}}ml($F,"primaryClass","components-headers");const AF=$F;class TF extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(TF.primaryClass)}}ml(TF,"primaryClass","components-security-schemes");const RF=TF;class IF extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(IF.primaryClass)}}ml(IF,"primaryClass","components-links");const kF=IF;class FF extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(FF.primaryClass)}}ml(FF,"primaryClass","components-callbacks");const MF=FF;class NF extends mT{constructor(e,t,n){super(e,t,n),this.classes.push(NF.primaryClass),this.classes.push("servers")}}ml(NF,"primaryClass","path-item-servers");const CF=NF;class DF extends mT{constructor(e,t,n){super(e,t,n),this.classes.push(DF.primaryClass),this.classes.push("parameters")}}ml(DF,"primaryClass","path-item-parameters");const qF=DF;class _F extends mT{constructor(e,t,n){super(e,t,n),this.classes.push(_F.primaryClass),this.classes.push("parameters")}}ml(_F,"primaryClass","operation-parameters");const BF=_F;class LF extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(LF.primaryClass),this.classes.push("examples")}}ml(LF,"primaryClass","parameter-examples");const UF=LF;class JF extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(JF.primaryClass),this.classes.push("content")}}ml(JF,"primaryClass","parameter-content");const VF=JF;class GF extends mT{constructor(e,t,n){super(e,t,n),this.classes.push(GF.primaryClass)}}ml(GF,"primaryClass","operation-tags");const zF=GF;class HF extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(HF.primaryClass)}}ml(HF,"primaryClass","operation-callbacks");const WF=HF;class XF extends mT{constructor(e,t,n){super(e,t,n),this.classes.push(XF.primaryClass),this.classes.push("security")}}ml(XF,"primaryClass","operation-security");const YF=XF;class KF extends mT{constructor(e,t,n){super(e,t,n),this.classes.push(KF.primaryClass),this.classes.push("servers")}}ml(KF,"primaryClass","operation-servers");const QF=KF;class ZF extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(ZF.primaryClass),this.classes.push("content")}}ml(ZF,"primaryClass","request-body-content");const eM=ZF;class tM extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(tM.primaryClass),this.classes.push("examples")}}ml(tM,"primaryClass","media-type-examples");const nM=tM;class rM extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(rM.primaryClass)}}ml(rM,"primaryClass","media-type-encoding");const iM=rM;class sM extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(sM.primaryClass)}}ml(sM,"primaryClass","encoding-headers");const oM=sM;class cM extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(cM.primaryClass)}}ml(cM,"primaryClass","response-headers");const aM=cM;class uM extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(uM.primaryClass),this.classes.push("content")}}ml(uM,"primaryClass","response-content");const fM=uM;class lM extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(lM.primaryClass)}}ml(lM,"primaryClass","response-links");const hM=lM;class pM extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(pM.primaryClass)}}ml(pM,"primaryClass","discriminator-mapping");const mM=pM;class dM extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(dM.primaryClass)}}ml(dM,"primaryClass","oauth-flow-scopes");const vM=dM;class yM extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(yM.primaryClass)}}ml(yM,"primaryClass","link-parameters");const bM=yM;class jM extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(jM.primaryClass),this.classes.push("examples")}}ml(jM,"primaryClass","header-examples");const gM=jM;class wM extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(wM.primaryClass),this.classes.push("content")}}ml(wM,"primaryClass","header-content");const OM=wM;function EM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const xM=e=>{if(ZT(e))return`${e.element.charAt(0).toUpperCase()+e.element.slice(1)}Element`},SM=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?EM(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EM(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({CallbackElement:["content"],ComponentsElement:["content"],ContactElement:["content"],DiscriminatorElement:["content"],Encoding:["content"],Example:["content"],ExternalDocumentationElement:["content"],HeaderElement:["content"],InfoElement:["content"],LicenseElement:["content"],MediaTypeElement:["content"],OAuthFlowElement:["content"],OAuthFlowsElement:["content"],OpenApi3_0Element:["content"],OperationElement:["content"],ParameterElement:["content"],PathItemElement:["content"],PathsElement:["content"],ReferenceElement:["content"],RequestBodyElement:["content"],ResponseElement:["content"],ResponsesElement:["content"],SchemaElement:["content"],SecurityRequirementElement:["content"],SecuritySchemeElement:["content"],ServerElement:["content"],ServerVariableElement:["content"],TagElement:["content"]},ER),PM=TT({props:{element:null},methods:{copyMetaAndAttributes(e,t){mR(e)&&t.meta.set("sourceMap",e.meta.get("sourceMap"))}}}),$M=PM;function AM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function TM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AM(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AM(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const RM=TT($M,{props:{passingOptionsNames:["specObj","openApiGenericElement","openApiSemanticElement"],specObj:null,openApiGenericElement:null,openApiSemanticElement:null},init({specObj:e=this.specObj,openApiGenericElement:t=this.openApiGenericElement,openApiSemanticElement:n=this.openApiSemanticElement}){this.specObj=e,this.openApiGenericElement=t,this.openApiSemanticElement=n},methods:{retrievePassingOptions(){return dx(this.passingOptionsNames,this)},retrieveFixedFields(e){return fE(ix(["visitors",...e,"fixedFields"]),eO)(this.specObj)},retrieveVisitor(e){return mx(Ux,["visitors",...e],this.specObj)?ix(["visitors",...e],this.specObj):ix(["visitors",...e,"$visitor"],this.specObj)},retrieveVisitorInstance(e,t={}){const n=this.retrievePassingOptions();return this.retrieveVisitor(e)(TM(TM({},n),t))},toRefractedElement(e,t,n={}){const r=this.retrieveVisitorInstance(e,n),i=Object.getPrototypeOf(r);return Nx(this.fallbackVisitorPrototype)&&(this.fallbackVisitorPrototype=Object.getPrototypeOf(this.retrieveVisitorInstance(["value"]))),this.fallbackVisitorPrototype===i?t.clone():(SR(t,r,TM({keyMap:SM,nodeTypeGetter:xM},n)),r.element)}}}),IM=RM,kM=e=>iR(e)&&e.hasKey("$ref"),FM=iR,MM=iR,NM=e=>eR(e.key)&&$x("x-",e.key.toValue()),CM=Object.freeze(Object.defineProperty({__proto__:null,isOpenApi3_0LikeElement:e=>iR(e)&&e.hasKey("openapi")&&e.hasKey("info"),isOpenApiExtension:NM,isParameterLikeElement:e=>iR(e)&&e.hasKey("name")&&e.hasKey("in"),isReferenceLikeElement:kM,isRequestBodyLikeElement:e=>iR(e)&&e.hasKey("content"),isResponseLikeElement:e=>iR(e)&&e.hasKey("description"),isServerLikeElement:FM,isTagLikeElement:MM},Symbol.toStringTag,{value:"Module"})),DM=TT(IM,{props:{specPath:lS,ignoredFields:[],canSupportSpecificationExtensions:!0,specificationExtensionPredicate:NM},init({specPath:e=this.specPath,ignoredFields:t=this.ignoredFields,canSupportSpecificationExtensions:n=this.canSupportSpecificationExtensions,specificationExtensionPredicate:r=this.specificationExtensionPredicate}={}){this.specPath=e,this.ignoredFields=t,this.canSupportSpecificationExtensions=n,this.specificationExtensionPredicate=r},methods:{ObjectElement(e){const t=this.specPath(e),n=this.retrieveFixedFields(t);return e.forEach(((e,r,i)=>{if(eR(r)&&n.includes(r.toValue())&&!this.ignoredFields.includes(r.toValue())){const n=this.toRefractedElement([...t,"fixedFields",r.toValue()],e),s=new vT(r.clone(),n);this.copyMetaAndAttributes(i,s),s.classes.push("fixed-field"),this.element.content.push(s)}else if(this.canSupportSpecificationExtensions&&this.specificationExtensionPredicate(i)){const e=this.toRefractedElement(["document","extension"],i);this.element.content.push(e)}else this.ignoredFields.includes(r.toValue())||this.element.content.push(i.clone())})),this.copyMetaAndAttributes(e,this.element),UT}}}),qM=DM,_M=TT($M,{methods:{enter(e){return this.element=e.clone(),UT}}}),BM=_M,LM=TT(qM,BM,{props:{specPath:_O(["document","objects","OpenApi"]),canSupportSpecificationExtensions:!0},init(){this.element=new RI},methods:{ObjectElement(e){return this.unrefractedElement=e,qM.compose.methods.ObjectElement.call(this,e)}}}),UM=LM,JM=TT(IM,BM,{methods:{StringElement(e){const t=new TI(e.toValue());return this.copyMetaAndAttributes(e,t),this.element=t,UT}}}),VM=JM,GM=TT(IM,{methods:{MemberElement(e){return this.element=e.clone(),this.element.classes.push("specification-extension"),UT}}}),zM=GM,HM=TT(qM,BM,{props:{specPath:_O(["document","objects","Info"]),canSupportSpecificationExtensions:!0},init(){this.element=new EI}}),WM=HM,XM=BM,YM=XM,KM=BM,QM=KM,ZM=BM,eN=ZM,tN=TT(BM,{methods:{StringElement(e){return this.element=e.clone(),this.element.classes.push("api-version"),this.element.classes.push("version"),UT}}}),nN=tN,rN=TT(qM,BM,{props:{specPath:_O(["document","objects","Contact"]),canSupportSpecificationExtensions:!0},init(){this.element=new vI}}),iN=rN,sN=BM,oN=sN,cN=BM,aN=cN,uN=BM,fN=uN,lN=TT(qM,BM,{props:{specPath:_O(["document","objects","License"]),canSupportSpecificationExtensions:!0},init(){this.element=new xI}}),hN=lN,pN=BM,mN=pN,dN=BM,vN=dN,yN=TT(qM,BM,{props:{specPath:_O(["document","objects","Link"]),canSupportSpecificationExtensions:!0},init(){this.element=new SI},methods:{ObjectElement(e){const t=qM.compose.methods.ObjectElement.call(this,e);return(eR(this.element.operationId)||eR(this.element.operationRef))&&this.element.classes.push("reference-element"),t}}}),bN=yN,jN=TT(BM,{methods:{StringElement(e){return this.element=e.clone(),this.element.classes.push("reference-value"),UT}}}),gN=jN,wN=TT(BM,{methods:{StringElement(e){return this.element=e.clone(),this.element.classes.push("reference-value"),UT}}}),ON=wN,EN=TT(IM,{props:{fieldPatternPredicate:Pw,specPath:lS,ignoredFields:[],canSupportSpecificationExtensions:!1,specificationExtensionPredicate:NM},init({specPath:e=this.specPath,ignoredFields:t=this.ignoredFields,canSupportSpecificationExtensions:n=this.canSupportSpecificationExtensions,specificationExtensionPredicate:r=this.specificationExtensionPredicate}={}){this.specPath=e,this.ignoredFields=t,this.canSupportSpecificationExtensions=n,this.specificationExtensionPredicate=r},methods:{ObjectElement(e){return e.forEach(((e,t,n)=>{if(this.canSupportSpecificationExtensions&&this.specificationExtensionPredicate(n)){const e=this.toRefractedElement(["document","extension"],n);this.element.content.push(e)}else if(!this.ignoredFields.includes(t.toValue())&&this.fieldPatternPredicate(t.toValue())){const r=this.specPath(e),i=this.toRefractedElement(r,e),s=new vT(t.clone(),i);this.copyMetaAndAttributes(n,s),s.classes.push("patterned-field"),this.element.content.push(s)}else this.ignoredFields.includes(t.toValue())||this.element.content.push(n.clone())})),this.copyMetaAndAttributes(e,this.element),UT}}}),xN=EN,SN=TT(xN,{props:{fieldPatternPredicate:Qx}}),PN=SN,$N=TT(PN,BM,{props:{specPath:_O(["value"])},init(){this.element=new bM}}),AN=$N,TN=BM,RN=TN,IN=BM,kN=IN,FN=TT(qM,BM,{props:{specPath:_O(["document","objects","Server"]),canSupportSpecificationExtensions:!0},init(){this.element=new iF}}),MN=FN,NN=TT(BM,{methods:{StringElement(e){return this.element=e.clone(),this.element.classes.push("server-url"),UT}}}),CN=NN,DN=BM,qN=DN,_N=TT(IM,BM,{init(){this.element=new fF},methods:{ArrayElement(e){return e.forEach((e=>{const t=FM(e)?["document","objects","Server"]:["value"],n=this.toRefractedElement(t,e);this.element.push(n)})),this.copyMetaAndAttributes(e,this.element),UT}}}),BN=_N,LN=TT(qM,BM,{props:{specPath:_O(["document","objects","ServerVariable"]),canSupportSpecificationExtensions:!0},init(){this.element=new sF}}),UN=LN,JN=BM,VN=JN,GN=BM,zN=GN,HN=BM,WN=HN,XN=TT(PN,BM,{props:{specPath:_O(["document","objects","ServerVariable"])},init(){this.element=new vF}}),YN=XN,KN=TT(qM,BM,{props:{specPath:_O(["document","objects","MediaType"]),canSupportSpecificationExtensions:!0},init(){this.element=new PI}}),QN=KN,ZN=TT(IM,{props:{alternator:[]},methods:{enter(e){const t=this.alternator.map((({predicate:e,specPath:t})=>WE(e,_O(t),Mx))),n=yS(t)(e);return this.element=this.toRefractedElement(n,e),UT}}}),eC=ZN,tC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof mI||e(r)&&t("callback",r)&&n("object",r))),nC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof dI||e(r)&&t("components",r)&&n("object",r))),rC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof vI||e(r)&&t("contact",r)&&n("object",r))),iC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof jI||e(r)&&t("example",r)&&n("object",r))),sC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof gI||e(r)&&t("externalDocumentation",r)&&n("object",r))),oC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof OI||e(r)&&t("header",r)&&n("object",r))),cC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof EI||e(r)&&t("info",r)&&n("object",r))),aC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof xI||e(r)&&t("license",r)&&n("object",r))),uC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof SI||e(r)&&t("link",r)&&n("object",r))),fC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof TI||e(r)&&t("openapi",r)&&n("string",r))),lC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n,hasClass:r})=>i=>i instanceof RI||e(i)&&t("openApi3_0",i)&&n("object",i)&&r("api",i))),hC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof II||e(r)&&t("operation",r)&&n("object",r))),pC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof FI||e(r)&&t("parameter",r)&&n("object",r))),mC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof MI||e(r)&&t("pathItem",r)&&n("object",r))),dC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof NI||e(r)&&t("paths",r)&&n("object",r))),vC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof CI||e(r)&&t("reference",r)&&n("object",r))),yC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof DI||e(r)&&t("requestBody",r)&&n("object",r))),bC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof qI||e(r)&&t("response",r)&&n("object",r))),jC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof _I||e(r)&&t("responses",r)&&n("object",r))),gC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof tF||e(r)&&t("schema",r)&&n("object",r))),wC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof nF||e(r)&&t("securityRequirement",r)&&n("object",r))),OC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof iF||e(r)&&t("server",r)&&n("object",r))),EC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof sF||e(r)&&t("serverVariable",r)&&n("object",r))),xC=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof PI||e(r)&&t("mediaType",r)&&n("object",r))),SC=Object.freeze(Object.defineProperty({__proto__:null,isBooleanJsonSchemaElement:e=>rR(e)&&e.classes.includes("boolean-json-schema"),isCallbackElement:tC,isComponentsElement:nC,isContactElement:rC,isExampleElement:iC,isExternalDocumentationElement:sC,isHeaderElement:oC,isInfoElement:cC,isLicenseElement:aC,isLinkElement:uC,isLinkElementExternal:e=>{if(!uC(e))return!1;if(!eR(e.operationRef))return!1;const t=e.operationRef.toValue();return"string"==typeof t&&t.length>0&&!t.startsWith("#")},isMediaTypeElement:xC,isOpenApi3_0Element:lC,isOpenapiElement:fC,isOperationElement:hC,isParameterElement:pC,isPathItemElement:mC,isPathItemElementExternal:e=>{if(!mC(e))return!1;if(!eR(e.$ref))return!1;const t=e.$ref.toValue();return"string"==typeof t&&t.length>0&&!t.startsWith("#")},isPathsElement:dC,isReferenceElement:vC,isReferenceElementExternal:e=>{if(!vC(e))return!1;if(!eR(e.$ref))return!1;const t=e.$ref.toValue();return"string"==typeof t&&t.length>0&&!t.startsWith("#")},isRequestBodyElement:yC,isResponseElement:bC,isResponsesElement:jC,isSchemaElement:gC,isSecurityRequirementElement:wC,isServerElement:OC,isServerVariableElement:EC},Symbol.toStringTag,{value:"Module"})),PC=TT(eC,BM,{props:{alternator:[{predicate:kM,specPath:["document","objects","Reference"]},{predicate:$w,specPath:["document","objects","Schema"]}]},methods:{ObjectElement(e){const t=eC.compose.methods.enter.call(this,e);return vC(this.element)&&this.element.setMetaProperty("referenced-element","schema"),t}}}),$C=PC,AC=BM,TC=AC,RC=TT(PN,BM,{props:{specPath:e=>kM(e)?["document","objects","Reference"]:["document","objects","Example"],canSupportSpecificationExtensions:!0},init(){this.element=new dT,this.element.classes.push("examples")},methods:{ObjectElement(e){const t=PN.compose.methods.ObjectElement.call(this,e);return this.element.filter(vC).forEach((e=>{e.setMetaProperty("referenced-element","example")})),t}}}),IC=RC,kC=TT(IC,{init(){this.element=new nM}}),FC=kC,MC=TT(PN,BM,{props:{specPath:_O(["document","objects","Encoding"])},init(){this.element=new iM}}),NC=MC,CC=TT(PN,BM,{props:{specPath:_O(["value"])},init(){this.element=new nF}}),DC=CC,qC=TT(IM,BM,{init(){this.element=new hF},methods:{ArrayElement(e){return e.forEach((e=>{if(iR(e)){const t=this.toRefractedElement(["document","objects","SecurityRequirement"],e);this.element.push(t)}else this.element.push(e.clone())})),this.copyMetaAndAttributes(e,this.element),UT}}}),_C=qC,BC=TT(qM,BM,{props:{specPath:_O(["document","objects","Components"]),canSupportSpecificationExtensions:!0},init(){this.element=new dI}}),LC=BC,UC=TT(qM,BM,{props:{specPath:_O(["document","objects","Tag"]),canSupportSpecificationExtensions:!0},init(){this.element=new oF}}),JC=UC,VC=BM,GC=VC,zC=BM,HC=zC,WC=TT(qM,BM,{props:{specPath:_O(["document","objects","Reference"]),canSupportSpecificationExtensions:!1},init(){this.element=new CI},methods:{ObjectElement(e){const t=qM.compose.methods.ObjectElement.call(this,e);return eR(this.element.$ref)&&this.element.classes.push("reference-element"),t}}}),XC=WC,YC=TT(BM,{methods:{StringElement(e){return this.element=e.clone(),this.element.classes.push("reference-value"),UT}}}),KC=YC,QC=TT(qM,BM,{props:{specPath:_O(["document","objects","Parameter"]),canSupportSpecificationExtensions:!0},init(){this.element=new FI},methods:{ObjectElement(e){const t=qM.compose.methods.ObjectElement.call(this,e);return iR(this.element.contentProp)&&this.element.contentProp.filter(xC).forEach(((e,t)=>{e.setMetaProperty("media-type",t.toValue())})),t}}}),ZC=QC,eD=BM,tD=eD,nD=BM,rD=nD,iD=BM,sD=iD,oD=BM,cD=oD,aD=BM,uD=aD,fD=BM,lD=fD,hD=BM,pD=hD,mD=BM,dD=mD,vD=BM,yD=vD,bD=TT(eC,BM,{props:{alternator:[{predicate:kM,specPath:["document","objects","Reference"]},{predicate:$w,specPath:["document","objects","Schema"]}]},methods:{ObjectElement(e){const t=eC.compose.methods.enter.call(this,e);return vC(this.element)&&this.element.setMetaProperty("referenced-element","schema"),t}}}),jD=bD,gD=TT(qM,BM,{props:{specPath:_O(["document","objects","Header"]),canSupportSpecificationExtensions:!0},init(){this.element=new OI}}),wD=gD,OD=BM,ED=OD,xD=BM,SD=xD,PD=BM,$D=PD,AD=BM,TD=AD,RD=BM,ID=RD,kD=BM,FD=kD,MD=BM,ND=TT(eC,BM,{props:{alternator:[{predicate:kM,specPath:["document","objects","Reference"]},{predicate:$w,specPath:["document","objects","Schema"]}]},methods:{ObjectElement(e){const t=eC.compose.methods.enter.call(this,e);return vC(this.element)&&this.element.setMetaProperty("referenced-element","schema"),t}}}),CD=BM,DD=TT(IC,{init(){this.element=new gM}}),qD=TT(PN,BM,{props:{specPath:_O(["document","objects","MediaType"])},init(){this.element=new dT,this.element.classes.push("content")}}),_D=TT(qD,{init(){this.element=new OM}}),BD=TT(qM,BM,{props:{specPath:_O(["document","objects","Schema"]),canSupportSpecificationExtensions:!0},init(){this.element=new tF}}),{items:LD}=Vk.visitors.document.objects.JSONSchema.fixedFields,UD=TT(LD,{methods:{ObjectElement(e){const t=LD.compose.methods.ObjectElement.call(this,e);return vC(this.element)&&this.element.setMetaProperty("referenced-element","schema"),t},ArrayElement(e){return this.element=e.clone(),UT}}}),{properties:JD}=Vk.visitors.document.objects.JSONSchema.fixedFields,VD=TT(JD,{methods:{ObjectElement(e){const t=JD.compose.methods.ObjectElement.call(this,e);return this.element.filter(vC).forEach((e=>{e.setMetaProperty("referenced-element","schema")})),t}}}),{type:GD}=Vk.visitors.document.objects.JSONSchema.fixedFields,zD=TT(GD,{methods:{ArrayElement(e){return this.element=e.clone(),UT}}}),HD=BM,WD=BM,XD=BM,YD=BM,{JSONSchemaOrJSONReferenceVisitor:KD}=Vk.visitors,QD=TT(KD,{methods:{ObjectElement(e){const t=KD.compose.methods.enter.call(this,e);return vC(this.element)&&this.element.setMetaProperty("referenced-element","schema"),t}}}),ZD=Object.fromEntries(Object.entries(Vk.visitors.document.objects.JSONSchema.fixedFields).map((([e,t])=>t===Vk.visitors.JSONSchemaOrJSONReferenceVisitor?[e,QD]:[e,t]))),eq=TT(qM,BM,{props:{specPath:_O(["document","objects","Discriminator"]),canSupportSpecificationExtensions:!1},init(){this.element=new yI}}),tq=BM,nq=TT(PN,BM,{props:{specPath:_O(["value"])},init(){this.element=new mM}}),rq=TT(qM,BM,{props:{specPath:_O(["document","objects","XML"]),canSupportSpecificationExtensions:!0},init(){this.element=new cF}}),iq=BM,sq=BM,oq=BM,cq=BM,aq=BM,uq=BM,fq=TT(IC,{init(){this.element=new UF}}),lq=TT(qD,{init(){this.element=new VF}}),hq=TT(PN,BM,{props:{specPath:e=>kM(e)?["document","objects","Reference"]:["document","objects","Schema"]},init(){this.element=new bF},methods:{ObjectElement(e){const t=PN.compose.methods.ObjectElement.call(this,e);return this.element.filter(vC).forEach((e=>{e.setMetaProperty("referenced-element","schema")})),t}}}),pq=TT(PN,BM,{props:{specPath:e=>kM(e)?["document","objects","Reference"]:["document","objects","Response"]},init(){this.element=new gF},methods:{ObjectElement(e){const t=PN.compose.methods.ObjectElement.call(this,e);return this.element.filter(vC).forEach((e=>{e.setMetaProperty("referenced-element","response")})),this.element.filter(bC).forEach(((e,t)=>{e.setMetaProperty("http-status-code",t.toValue())})),t}}}),mq=TT(PN,BM,{props:{specPath:e=>kM(e)?["document","objects","Reference"]:["document","objects","Parameter"]},init(){this.element=new OF},methods:{ObjectElement(e){const t=PN.compose.methods.ObjectElement.call(this,e);return this.element.filter(vC).forEach((e=>{e.setMetaProperty("referenced-element","parameter")})),t}}}),dq=TT(PN,BM,{props:{specPath:e=>kM(e)?["document","objects","Reference"]:["document","objects","Example"]},init(){this.element=new xF},methods:{ObjectElement(e){const t=PN.compose.methods.ObjectElement.call(this,e);return this.element.filter(vC).forEach((e=>{e.setMetaProperty("referenced-element","example")})),t}}}),vq=TT(PN,BM,{props:{specPath:e=>kM(e)?["document","objects","Reference"]:["document","objects","RequestBody"]},init(){this.element=new PF},methods:{ObjectElement(e){const t=PN.compose.methods.ObjectElement.call(this,e);return this.element.filter(vC).forEach((e=>{e.setMetaProperty("referenced-element","requestBody")})),t}}}),yq=TT(PN,BM,{props:{specPath:e=>kM(e)?["document","objects","Reference"]:["document","objects","Header"]},init(){this.element=new AF},methods:{ObjectElement(e){const t=PN.compose.methods.ObjectElement.call(this,e);return this.element.filter(vC).forEach((e=>{e.setMetaProperty("referenced-element","header")})),this.element.filter(oC).forEach(((e,t)=>{e.setMetaProperty("header-name",t.toValue())})),t}}}),bq=TT(PN,BM,{props:{specPath:e=>kM(e)?["document","objects","Reference"]:["document","objects","SecurityScheme"]},init(){this.element=new RF},methods:{ObjectElement(e){const t=PN.compose.methods.ObjectElement.call(this,e);return this.element.filter(vC).forEach((e=>{e.setMetaProperty("referenced-element","securityScheme")})),t}}}),jq=TT(PN,BM,{props:{specPath:e=>kM(e)?["document","objects","Reference"]:["document","objects","Link"]},init(){this.element=new kF},methods:{ObjectElement(e){const t=PN.compose.methods.ObjectElement.call(this,e);return this.element.filter(vC).forEach((e=>{e.setMetaProperty("referenced-element","link")})),t}}}),gq=TT(PN,BM,{props:{specPath:e=>kM(e)?["document","objects","Reference"]:["document","objects","Callback"]},init(){this.element=new MF},methods:{ObjectElement(e){const t=PN.compose.methods.ObjectElement.call(this,e);return this.element.filter(vC).forEach((e=>{e.setMetaProperty("referenced-element","callback")})),t}}}),wq=TT(qM,BM,{props:{specPath:_O(["document","objects","Example"]),canSupportSpecificationExtensions:!0},init(){this.element=new jI},methods:{ObjectElement(e){const t=qM.compose.methods.ObjectElement.call(this,e);return eR(this.element.externalValue)&&this.element.classes.push("reference-element"),t}}}),Oq=BM,Eq=BM,xq=BM,Sq=TT(BM,{methods:{StringElement(e){return this.element=e.clone(),this.element.classes.push("reference-value"),UT}}}),Pq=TT(qM,BM,{props:{specPath:_O(["document","objects","ExternalDocumentation"]),canSupportSpecificationExtensions:!0},init(){this.element=new gI}}),$q=BM,Aq=BM,Tq=TT(qM,BM,{props:{specPath:_O(["document","objects","Encoding"]),canSupportSpecificationExtensions:!0},init(){this.element=new bI},methods:{ObjectElement(e){const t=qM.compose.methods.ObjectElement.call(this,e);return iR(this.element.headers)&&this.element.headers.filter(oC).forEach(((e,t)=>{e.setMetaProperty("header-name",t.toValue())})),t}}}),Rq=BM,Iq=TT(PN,BM,{props:{specPath:e=>kM(e)?["document","objects","Reference"]:["document","objects","Header"]},init(){this.element=new oM},methods:{ObjectElement(e){const t=PN.compose.methods.ObjectElement.call(this,e);return this.element.filter(vC).forEach((e=>{e.setMetaProperty("referenced-element","header")})),this.element.forEach(((e,t)=>{if(!oC(e))return;const n=t.toValue();e.setMetaProperty("headerName",n)})),t}}}),kq=BM,Fq=BM,Mq=BM,Nq=TT(xN,BM,{props:{fieldPatternPredicate:Tx(/^\/(?<path>.*)$/),specPath:_O(["document","objects","PathItem"]),canSupportSpecificationExtensions:!0},init(){this.element=new NI},methods:{ObjectElement(e){const t=xN.compose.methods.ObjectElement.call(this,e);return this.element.filter(mC).forEach(((e,t)=>{e.setMetaProperty("path",t.clone())})),t}}}),Cq=TT(qM,BM,{props:{specPath:_O(["document","objects","RequestBody"])},init(){this.element=new DI},methods:{ObjectElement(e){const t=qM.compose.methods.ObjectElement.call(this,e);return iR(this.element.contentProp)&&this.element.contentProp.filter(xC).forEach(((e,t)=>{e.setMetaProperty("media-type",t.toValue())})),t}}}),Dq=BM,qq=TT(qD,{init(){this.element=new eM}}),_q=BM,Bq=TT(xN,BM,{props:{fieldPatternPredicate:Tx(/{(?<expression>.*)}/),specPath:_O(["document","objects","PathItem"]),canSupportSpecificationExtensions:!0},init(){this.element=new mI},methods:{ObjectElement(e){const t=PN.compose.methods.ObjectElement.call(this,e);return this.element.filter(mC).forEach(((e,t)=>{e.setMetaProperty("runtime-expression",t.toValue())})),t}}}),Lq=TT(qM,BM,{props:{specPath:_O(["document","objects","Response"])},init(){this.element=new qI},methods:{ObjectElement(e){const t=qM.compose.methods.ObjectElement.call(this,e);return iR(this.element.contentProp)&&this.element.contentProp.filter(xC).forEach(((e,t)=>{e.setMetaProperty("media-type",t.toValue())})),iR(this.element.headers)&&this.element.headers.filter(oC).forEach(((e,t)=>{e.setMetaProperty("header-name",t.toValue())})),t}}}),Uq=BM,Jq=TT(PN,BM,{props:{specPath:e=>kM(e)?["document","objects","Reference"]:["document","objects","Header"]},init(){this.element=new aM},methods:{ObjectElement(e){const t=PN.compose.methods.ObjectElement.call(this,e);return this.element.filter(vC).forEach((e=>{e.setMetaProperty("referenced-element","header")})),this.element.forEach(((e,t)=>{if(!oC(e))return;const n=t.toValue();e.setMetaProperty("header-name",n)})),t}}}),Vq=TT(qD,{init(){this.element=new fM}}),Gq=TT(PN,BM,{props:{specPath:e=>kM(e)?["document","objects","Reference"]:["document","objects","Link"]},init(){this.element=new hM},methods:{ObjectElement(e){const t=PN.compose.methods.ObjectElement.call(this,e);return this.element.filter(vC).forEach((e=>{e.setMetaProperty("referenced-element","link")})),t}}}),zq=TT(qM,xN,{props:{specPathFixedFields:lS,specPathPatternedFields:lS},methods:{ObjectElement(e){const{specPath:t,ignoredFields:n}=this;try{this.specPath=this.specPathFixedFields;const t=this.retrieveFixedFields(this.specPath(e));this.ignoredFields=[...n,...xE(e.keys(),t)],qM.compose.methods.ObjectElement.call(this,e),this.specPath=this.specPathPatternedFields,this.ignoredFields=t,xN.compose.methods.ObjectElement.call(this,e)}catch(e){throw this.specPath=t,e}return UT}}}),Hq=TT(zq,BM,{props:{specPathFixedFields:_O(["document","objects","Responses"]),specPathPatternedFields:e=>kM(e)?["document","objects","Reference"]:["document","objects","Response"],fieldPatternPredicate:Tx(new RegExp(`^(1XX|2XX|3XX|4XX|5XX|${gx(100,600).join("|")})$`)),canSupportSpecificationExtensions:!0},init(){this.element=new _I},methods:{ObjectElement(e){const t=zq.compose.methods.ObjectElement.call(this,e);return this.element.filter(vC).forEach((e=>{e.setMetaProperty("referenced-element","response")})),this.element.filter(bC).forEach(((e,t)=>{const n=t.clone();this.fieldPatternPredicate(n.toValue())&&e.setMetaProperty("http-status-code",n)})),t}}}),Wq=TT(eC,BM,{props:{alternator:[{predicate:kM,specPath:["document","objects","Reference"]},{predicate:$w,specPath:["document","objects","Response"]}]},methods:{ObjectElement(e){const t=eC.compose.methods.enter.call(this,e);return vC(this.element)?this.element.setMetaProperty("referenced-element","response"):bC(this.element)&&this.element.setMetaProperty("http-status-code","default"),t}}}),Xq=TT(qM,BM,{props:{specPath:_O(["document","objects","Operation"])},init(){this.element=new II}}),Yq=TT(BM,{init(){this.element=new zF},methods:{ArrayElement(e){return this.element=this.element.concat(e.clone()),UT}}}),Kq=BM,Qq=BM,Zq=BM,e_=TT(IM,BM,{init(){this.element=new mT,this.element.classes.push("parameters")},methods:{ArrayElement(e){return e.forEach((e=>{const t=kM(e)?["document","objects","Reference"]:["document","objects","Parameter"],n=this.toRefractedElement(t,e);vC(n)&&n.setMetaProperty("referenced-element","parameter"),this.element.push(n)})),this.copyMetaAndAttributes(e,this.element),UT}}}),t_=TT(e_,{init(){this.element=new BF}}),n_=TT(eC,{props:{alternator:[{predicate:kM,specPath:["document","objects","Reference"]},{predicate:$w,specPath:["document","objects","RequestBody"]}]},methods:{ObjectElement(e){const t=eC.compose.methods.enter.call(this,e);return vC(this.element)&&this.element.setMetaProperty("referenced-element","requestBody"),t}}}),r_=TT(PN,BM,{props:{specPath:e=>kM(e)?["document","objects","Reference"]:["document","objects","Callback"]},init(){this.element=new WF},methods:{ObjectElement(e){const t=PN.compose.methods.ObjectElement.call(this,e);return this.element.filter(vC).forEach((e=>{e.setMetaProperty("referenced-element","callback")})),t}}}),i_=BM,s_=TT(IM,BM,{init(){this.element=new YF},methods:{ArrayElement(e){return e.forEach((e=>{const t=iR(e)?["document","objects","SecurityRequirement"]:["value"],n=this.toRefractedElement(t,e);this.element.push(n)})),this.copyMetaAndAttributes(e,this.element),UT}}}),o_=TT(BN,{init(){this.element=new QF}}),c_=TT(qM,BM,{props:{specPath:_O(["document","objects","PathItem"])},init(){this.element=new MI},methods:{ObjectElement(e){const t=qM.compose.methods.ObjectElement.call(this,e);return this.element.filter(hC).forEach(((e,t)=>{const n=t.clone();n.content=n.toValue().toUpperCase(),e.setMetaProperty("http-method",n)})),eR(this.element.$ref)&&this.element.classes.push("reference-element"),t}}}),a_=TT(BM,{methods:{StringElement(e){return this.element=e.clone(),this.element.classes.push("reference-value"),UT}}}),u_=BM,f_=BM,l_=TT(BN,{init(){this.element=new CF}}),h_=TT(e_,{init(){this.element=new qF}}),p_=TT(qM,BM,{props:{specPath:_O(["document","objects","SecurityScheme"]),canSupportSpecificationExtensions:!0},init(){this.element=new rF}}),m_=BM,d_=BM,v_=BM,y_=BM,b_=BM,j_=BM,g_=BM,w_=TT(qM,BM,{props:{specPath:_O(["document","objects","OAuthFlows"]),canSupportSpecificationExtensions:!0},init(){this.element=new AI}}),O_=TT(qM,BM,{props:{specPath:_O(["document","objects","OAuthFlow"]),canSupportSpecificationExtensions:!0},init(){this.element=new $I}}),E_=BM,x_=BM,S_=BM,P_=TT(PN,BM,{props:{specPath:_O(["value"])},init(){this.element=new vM}}),$_=TT(IM,BM,{init(){this.element=new mF},methods:{ArrayElement(e){return e.forEach((e=>{const t=MM(e)?["document","objects","Tag"]:["value"],n=this.toRefractedElement(t,e);this.element.push(n)})),this.copyMetaAndAttributes(e,this.element),UT}}});function A_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A_(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const R_={$visitor:XC,fixedFields:{$ref:KC}},I_={$visitor:BD,fixedFields:T_(T_({},ZD),{},{items:UD,properties:VD,type:zD,nullable:HD,discriminator:{$ref:"#/visitors/document/objects/Discriminator"},writeOnly:WD,xml:{$ref:"#/visitors/document/objects/XML"},externalDocs:{$ref:"#/visitors/document/objects/ExternalDocumentation"},example:XD,deprecated:YD})},k_={visitors:{value:BM,document:{objects:{OpenApi:{$visitor:UM,fixedFields:{openapi:VM,info:{$ref:"#/visitors/document/objects/Info"},servers:BN,paths:{$ref:"#/visitors/document/objects/Paths"},components:{$ref:"#/visitors/document/objects/Components"},security:_C,tags:$_,externalDocs:{$ref:"#/visitors/document/objects/ExternalDocumentation"}}},Info:{$visitor:WM,fixedFields:{title:YM,description:QM,termsOfService:eN,contact:{$ref:"#/visitors/document/objects/Contact"},license:{$ref:"#/visitors/document/objects/License"},version:nN}},Contact:{$visitor:iN,fixedFields:{name:oN,url:aN,email:fN}},License:{$visitor:hN,fixedFields:{name:mN,url:vN}},Server:{$visitor:MN,fixedFields:{url:CN,description:qN,variables:YN}},ServerVariable:{$visitor:UN,fixedFields:{enum:VN,default:zN,description:WN}},Components:{$visitor:LC,fixedFields:{schemas:hq,responses:pq,parameters:mq,examples:dq,requestBodies:vq,headers:yq,securitySchemes:bq,links:jq,callbacks:gq}},Paths:{$visitor:Nq},PathItem:{$visitor:c_,fixedFields:{$ref:a_,summary:u_,description:f_,get:{$ref:"#/visitors/document/objects/Operation"},put:{$ref:"#/visitors/document/objects/Operation"},post:{$ref:"#/visitors/document/objects/Operation"},delete:{$ref:"#/visitors/document/objects/Operation"},options:{$ref:"#/visitors/document/objects/Operation"},head:{$ref:"#/visitors/document/objects/Operation"},patch:{$ref:"#/visitors/document/objects/Operation"},trace:{$ref:"#/visitors/document/objects/Operation"},servers:l_,parameters:h_}},Operation:{$visitor:Xq,fixedFields:{tags:Yq,summary:Kq,description:Qq,externalDocs:{$ref:"#/visitors/document/objects/ExternalDocumentation"},operationId:Zq,parameters:t_,requestBody:n_,responses:{$ref:"#/visitors/document/objects/Responses"},callbacks:r_,deprecated:i_,security:s_,servers:o_}},ExternalDocumentation:{$visitor:Pq,fixedFields:{description:$q,url:Aq}},Parameter:{$visitor:ZC,fixedFields:{name:tD,in:rD,description:sD,required:cD,deprecated:uD,allowEmptyValue:lD,style:pD,explode:dD,allowReserved:yD,schema:jD,example:uq,examples:fq,content:lq}},RequestBody:{$visitor:Cq,fixedFields:{description:Dq,content:qq,required:_q}},MediaType:{$visitor:QN,fixedFields:{schema:$C,example:TC,examples:FC,encoding:NC}},Encoding:{$visitor:Tq,fixedFields:{contentType:Rq,headers:Iq,style:kq,explode:Fq,allowReserved:Mq}},Responses:{$visitor:Hq,fixedFields:{default:Wq}},Response:{$visitor:Lq,fixedFields:{description:Uq,headers:Jq,content:Vq,links:Gq}},Callback:{$visitor:Bq},Example:{$visitor:wq,fixedFields:{summary:Oq,description:Eq,value:xq,externalValue:Sq}},Link:{$visitor:bN,fixedFields:{operationRef:gN,operationId:ON,parameters:AN,requestBody:RN,description:kN,server:{$ref:"#/visitors/document/objects/Server"}}},Header:{$visitor:wD,fixedFields:{description:ED,required:SD,deprecated:$D,allowEmptyValue:TD,style:ID,explode:FD,allowReserved:MD,schema:ND,example:CD,examples:DD,content:_D}},Tag:{$visitor:JC,fixedFields:{name:GC,description:HC,externalDocs:{$ref:"#/visitors/document/objects/ExternalDocumentation"}}},JSONReference:R_,Reference:R_,JSONSchema:I_,Schema:I_,LinkDescription:Vk.visitors.document.objects.LinkDescription,Media:Vk.visitors.document.objects.Media,Discriminator:{$visitor:eq,fixedFields:{propertyName:tq,mapping:nq}},XML:{$visitor:rq,fixedFields:{name:iq,namespace:sq,prefix:oq,attribute:cq,wrapped:aq}},SecurityScheme:{$visitor:p_,fixedFields:{type:m_,description:d_,name:v_,in:y_,scheme:b_,bearerFormat:j_,flows:{$ref:"#/visitors/document/objects/OAuthFlows"},openIdConnectUrl:g_}},OAuthFlows:{$visitor:w_,fixedFields:{implicit:{$ref:"#/visitors/document/objects/OAuthFlow"},password:{$ref:"#/visitors/document/objects/OAuthFlow"},clientCredentials:{$ref:"#/visitors/document/objects/OAuthFlow"},authorizationCode:{$ref:"#/visitors/document/objects/OAuthFlow"}}},OAuthFlow:{$visitor:O_,fixedFields:{authorizationUrl:E_,tokenUrl:x_,refreshUrl:S_,scopes:P_}},SecurityRequirement:{$visitor:DC}},extension:{$visitor:zM}}}};function F_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F_(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const N_=()=>{const e=PT(aF);return{predicates:M_(M_(M_({},CM),SC),{},{isStringElement:eR}),namespace:e}};function C_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const D_=e=>(t,n={})=>((e,{specPath:t=["visitors","document","objects","OpenApi","$visitor"],plugins:n=[]}={})=>{const r=jT(e),i=XR(k_),s=gS(t,[],i);return SR(r,s,{state:{specObj:i}}),_R(s.element,n,{toolboxCreator:N_,visitorOptions:{keyMap:SM,nodeTypeGetter:xM}})})(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C_(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({specPath:e},n));mI.refract=D_(["visitors","document","objects","Callback","$visitor"]),dI.refract=D_(["visitors","document","objects","Components","$visitor"]),vI.refract=D_(["visitors","document","objects","Contact","$visitor"]),jI.refract=D_(["visitors","document","objects","Example","$visitor"]),yI.refract=D_(["visitors","document","objects","Discriminator","$visitor"]),bI.refract=D_(["visitors","document","objects","Encoding","$visitor"]),gI.refract=D_(["visitors","document","objects","ExternalDocumentation","$visitor"]),OI.refract=D_(["visitors","document","objects","Header","$visitor"]),EI.refract=D_(["visitors","document","objects","Info","$visitor"]),xI.refract=D_(["visitors","document","objects","License","$visitor"]),SI.refract=D_(["visitors","document","objects","Link","$visitor"]),PI.refract=D_(["visitors","document","objects","MediaType","$visitor"]),$I.refract=D_(["visitors","document","objects","OAuthFlow","$visitor"]),AI.refract=D_(["visitors","document","objects","OAuthFlows","$visitor"]),TI.refract=D_(["visitors","document","objects","OpenApi","fixedFields","openapi"]),RI.refract=D_(["visitors","document","objects","OpenApi","$visitor"]),II.refract=D_(["visitors","document","objects","Operation","$visitor"]),FI.refract=D_(["visitors","document","objects","Parameter","$visitor"]),MI.refract=D_(["visitors","document","objects","PathItem","$visitor"]),NI.refract=D_(["visitors","document","objects","Paths","$visitor"]),CI.refract=D_(["visitors","document","objects","Reference","$visitor"]),DI.refract=D_(["visitors","document","objects","RequestBody","$visitor"]),qI.refract=D_(["visitors","document","objects","Response","$visitor"]),_I.refract=D_(["visitors","document","objects","Responses","$visitor"]),tF.refract=D_(["visitors","document","objects","Schema","$visitor"]),nF.refract=D_(["visitors","document","objects","SecurityRequirement","$visitor"]),rF.refract=D_(["visitors","document","objects","SecurityScheme","$visitor"]),iF.refract=D_(["visitors","document","objects","Server","$visitor"]),sF.refract=D_(["visitors","document","objects","ServerVariable","$visitor"]),oF.refract=D_(["visitors","document","objects","Tag","$visitor"]),cF.refract=D_(["visitors","document","objects","XML","$visitor"]);const q_=class extends mI{};const __=class extends dI{get pathItems(){return this.get("pathItems")}set pathItems(e){this.set("pathItems",e)}};const B_=class extends vI{};const L_=class extends yI{};const U_=class extends bI{};const J_=class extends jI{};const V_=class extends gI{};const G_=class extends OI{get schema(){return this.get("schema")}set schema(e){this.set("schema",e)}};const z_=class extends EI{get license(){return this.get("license")}set license(e){this.set("license",e)}get summary(){return this.get("summary")}set summary(e){this.set("summary",e)}};class H_ extends fT{constructor(e,t,n){super(e,t,n),this.element="jsonSchemaDialect"}}ml(H_,"default",new H_("https://spec.openapis.org/oas/3.1/dialect/base"));const W_=H_;const X_=class extends xI{get identifier(){return this.get("identifier")}set identifier(e){this.set("identifier",e)}};const Y_=class extends SI{};const K_=class extends PI{get schema(){return this.get("schema")}set schema(e){this.set("schema",e)}};const Q_=class extends $I{};const Z_=class extends AI{};const eB=class extends TI{};const tB=class extends dT{constructor(e,t,n){super(e,t,n),this.element="openApi3_1",this.classes.push("api")}get openapi(){return this.get("openapi")}set openapi(e){this.set("openapi",e)}get info(){return this.get("info")}set info(e){this.set("info",e)}get jsonSchemaDialect(){return this.get("jsonSchemaDialect")}set jsonSchemaDialect(e){this.set("jsonSchemaDialect",e)}get servers(){return this.get("servers")}set servers(e){this.set("servers",e)}get paths(){return this.get("paths")}set paths(e){this.set("paths",e)}get components(){return this.get("components")}set components(e){this.set("components",e)}get security(){return this.get("security")}set security(e){this.set("security",e)}get tags(){return this.get("tags")}set tags(e){this.set("tags",e)}get externalDocs(){return this.get("externalDocs")}set externalDocs(e){this.set("externalDocs",e)}get webhooks(){return this.get("webhooks")}set webhooks(e){this.set("webhooks",e)}};const nB=class extends II{get requestBody(){return this.get("requestBody")}set requestBody(e){this.set("requestBody",e)}};const rB=class extends FI{get schema(){return this.get("schema")}set schema(e){this.set("schema",e)}};const iB=class extends MI{get GET(){return this.get("get")}set GET(e){this.set("GET",e)}get PUT(){return this.get("put")}set PUT(e){this.set("PUT",e)}get POST(){return this.get("post")}set POST(e){this.set("POST",e)}get DELETE(){return this.get("delete")}set DELETE(e){this.set("DELETE",e)}get OPTIONS(){return this.get("options")}set OPTIONS(e){this.set("OPTIONS",e)}get HEAD(){return this.get("head")}set HEAD(e){this.set("HEAD",e)}get PATCH(){return this.get("patch")}set PATCH(e){this.set("PATCH",e)}get TRACE(){return this.get("trace")}set TRACE(e){this.set("TRACE",e)}};const sB=class extends NI{};let oB=class extends CI{};Object.defineProperty(oB.prototype,"description",{get(){return this.get("description")},set(e){this.set("description",e)},enumerable:!0}),Object.defineProperty(oB.prototype,"summary",{get(){return this.get("summary")},set(e){this.set("summary",e)},enumerable:!0});const cB=oB;const aB=class extends DI{};const uB=class extends qI{};const fB=class extends _I{};const lB=class extends dT{constructor(e,t,n){super(e,t,n),this.element="schema"}get $schema(){return this.get("$schema")}set $schema(e){this.set("$schema",e)}get $vocabulary(){return this.get("$vocabulary")}set $vocabulary(e){this.set("$vocabulary",e)}get $id(){return this.get("$id")}set $id(e){this.set("$id",e)}get $anchor(){return this.get("$anchor")}set $anchor(e){this.set("$anchor",e)}get $dynamicAnchor(){return this.get("$dynamicAnchor")}set $dynamicAnchor(e){this.set("$dynamicAnchor",e)}get $dynamicRef(){return this.get("$dynamicRef")}set $dynamicRef(e){this.set("$dynamicRef",e)}get $ref(){return this.get("$ref")}set $ref(e){this.set("$ref",e)}get $defs(){return this.get("$defs")}set $defs(e){this.set("$defs",e)}get $comment(){return this.get("$comment")}set $comment(e){this.set("$comment",e)}get allOf(){return this.get("allOf")}set allOf(e){this.set("allOf",e)}get anyOf(){return this.get("anyOf")}set anyOf(e){this.set("anyOf",e)}get oneOf(){return this.get("oneOf")}set oneOf(e){this.set("oneOf",e)}get not(){return this.get("not")}set not(e){this.set("not",e)}get if(){return this.get("if")}set if(e){this.set("if",e)}get then(){return this.get("then")}set then(e){this.set("then",e)}get else(){return this.get("else")}set else(e){this.set("else",e)}get dependentSchemas(){return this.get("dependentSchemas")}set dependentSchemas(e){this.set("dependentSchemas",e)}get prefixItems(){return this.get("prefixItems")}set prefixItems(e){this.set("prefixItems",e)}get items(){return this.get("items")}set items(e){this.set("items",e)}get containsProp(){return this.get("contains")}set containsProp(e){this.set("contains",e)}get properties(){return this.get("properties")}set properties(e){this.set("properties",e)}get patternProperties(){return this.get("patternProperties")}set patternProperties(e){this.set("patternProperties",e)}get additionalProperties(){return this.get("additionalProperties")}set additionalProperties(e){this.set("additionalProperties",e)}get propertyNames(){return this.get("propertyNames")}set propertyNames(e){this.set("propertyNames",e)}get unevaluatedItems(){return this.get("unevaluatedItems")}set unevaluatedItems(e){this.set("unevaluatedItems",e)}get unevaluatedProperties(){return this.get("unevaluatedProperties")}set unevaluatedProperties(e){this.set("unevaluatedProperties",e)}get type(){return this.get("type")}set type(e){this.set("type",e)}get enum(){return this.get("enum")}set enum(e){this.set("enum",e)}get const(){return this.get("const")}set const(e){this.set("const",e)}get multipleOf(){return this.get("multipleOf")}set multipleOf(e){this.set("multipleOf",e)}get maximum(){return this.get("maximum")}set maximum(e){this.set("maximum",e)}get exclusiveMaximum(){return this.get("exclusiveMaximum")}set exclusiveMaximum(e){this.set("exclusiveMaximum",e)}get minimum(){return this.get("minimum")}set minimum(e){this.set("minimum",e)}get exclusiveMinimum(){return this.get("exclusiveMinimum")}set exclusiveMinimum(e){this.set("exclusiveMinimum",e)}get maxLength(){return this.get("maxLength")}set maxLength(e){this.set("maxLength",e)}get minLength(){return this.get("minLength")}set minLength(e){this.set("minLength",e)}get pattern(){return this.get("pattern")}set pattern(e){this.set("pattern",e)}get maxItems(){return this.get("maxItems")}set maxItems(e){this.set("maxItems",e)}get minItems(){return this.get("minItems")}set minItems(e){this.set("minItems",e)}get uniqueItems(){return this.get("uniqueItems")}set uniqueItems(e){this.set("uniqueItems",e)}get maxContains(){return this.get("maxContains")}set maxContains(e){this.set("maxContains",e)}get minContains(){return this.get("minContains")}set minContains(e){this.set("minContains",e)}get maxProperties(){return this.get("maxProperties")}set maxProperties(e){this.set("maxProperties",e)}get minProperties(){return this.get("minProperties")}set minProperties(e){this.set("minProperties",e)}get required(){return this.get("required")}set required(e){this.set("required",e)}get dependentRequired(){return this.get("dependentRequired")}set dependentRequired(e){this.set("dependentRequired",e)}get title(){return this.get("title")}set title(e){this.set("title",e)}get description(){return this.get("description")}set description(e){this.set("description",e)}get default(){return this.get("default")}set default(e){this.set("default",e)}get deprecated(){return this.get("deprecated")}set deprecated(e){this.set("deprecated",e)}get readOnly(){return this.get("readOnly")}set readOnly(e){this.set("readOnly",e)}get writeOnly(){return this.get("writeOnly")}set writeOnly(e){this.set("writeOnly",e)}get examples(){return this.get("examples")}set examples(e){this.set("examples",e)}get format(){return this.get("format")}set format(e){this.set("format",e)}get contentEncoding(){return this.get("contentEncoding")}set contentEncoding(e){this.set("contentEncoding",e)}get contentMediaType(){return this.get("contentMediaType")}set contentMediaType(e){this.set("contentMediaType",e)}get contentSchema(){return this.get("contentSchema")}set contentSchema(e){this.set("contentSchema",e)}get discriminator(){return this.get("discriminator")}set discriminator(e){this.set("discriminator",e)}get xml(){return this.get("xml")}set xml(e){this.set("xml",e)}get externalDocs(){return this.get("externalDocs")}set externalDocs(e){this.set("externalDocs",e)}get example(){return this.get("example")}set example(e){this.set("example",e)}};const hB=class extends nF{};const pB=class extends rF{};const mB=class extends iF{};const dB=class extends sF{};const vB=class extends oF{};const yB=class extends cF{},bB={namespace:e=>{const{base:t}=e;return t.register("callback",q_),t.register("components",__),t.register("contact",B_),t.register("discriminator",L_),t.register("encoding",U_),t.register("example",J_),t.register("externalDocumentation",V_),t.register("header",G_),t.register("info",z_),t.register("jsonSchemaDialect",W_),t.register("license",X_),t.register("link",Y_),t.register("mediaType",K_),t.register("oAuthFlow",Q_),t.register("oAuthFlows",Z_),t.register("openapi",eB),t.register("openApi3_1",tB),t.register("operation",nB),t.register("parameter",rB),t.register("pathItem",iB),t.register("paths",sB),t.register("reference",cB),t.register("requestBody",aB),t.register("response",uB),t.register("responses",fB),t.register("schema",lB),t.register("securityRequirement",hB),t.register("securityScheme",pB),t.register("server",mB),t.register("serverVariable",dB),t.register("tag",vB),t.register("xml",yB),t}};class jB extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(jB.primaryClass)}}ml(jB,"primaryClass","components-path-items");const gB=jB;class wB extends dT{constructor(e,t,n){super(e,t,n),this.classes.push(wB.primaryClass)}}ml(wB,"primaryClass","webhooks");const OB=wB;function EB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const xB=e=>{if(ZT(e))return`${e.element.charAt(0).toUpperCase()+e.element.slice(1)}Element`},SB=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?EB(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EB(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({CallbackElement:["content"],ComponentsElement:["content"],ContactElement:["content"],DiscriminatorElement:["content"],Encoding:["content"],Example:["content"],ExternalDocumentationElement:["content"],HeaderElement:["content"],InfoElement:["content"],LicenseElement:["content"],MediaTypeElement:["content"],OAuthFlowElement:["content"],OAuthFlowsElement:["content"],OpenApi3_1Element:["content"],OperationElement:["content"],ParameterElement:["content"],PathItemElement:["content"],PathsElement:["content"],ReferenceElement:["content"],RequestBodyElement:["content"],ResponseElement:["content"],ResponsesElement:["content"],SchemaElement:["content"],SecurityRequirementElement:["content"],SecuritySchemeElement:["content"],ServerElement:["content"],ServerVariableElement:["content"],TagElement:["content"]},ER),PB=()=>({predicates:e})=>{const t=(t,n)=>!!e.isParameterElement(t)&&(!!e.isParameterElement(n)&&(!!e.isStringElement(t.name)&&(!!e.isStringElement(t.in)&&(!!e.isStringElement(n.name)&&(!!e.isStringElement(n.in)&&(sI(t.name)===sI(n.name)&&sI(t.in)===sI(n.in))))))),n=[];return{visitor:{PathItemElement:{enter(t,r,i,s,o){if(o.some(e.isComponentsElement))return;const{parameters:c}=t;e.isArrayElement(c)?n.push([...c.content]):n.push([])},leave(){n.pop()}},OperationElement:{leave(e){const r=kE(n);if(!Array.isArray(r)||0===r.length)return;const i=px([],["parameters","content"],e),s=kx(t,[...i,...r]);e.parameters=new BF(s)}}}}},$B=()=>({predicates:e})=>{let t;return{visitor:{OpenApi3_1Element:{enter(n){e.isArrayElement(n.security)&&(t=n.security)},leave(){t=void 0}},OperationElement:{leave(n,r,i,s,o){if(o.some(e.isComponentsElement))return;var c;void 0===n.security&&void 0!==t&&(n.security=new YF(null===(c=t)||void 0===c?void 0:c.content))}}}}},AB=()=>({predicates:e})=>{let t;const n=[];return{visitor:{OpenApi3_1Element:{enter(n){var r;e.isArrayElement(n.servers)&&(t=null===(r=n.servers)||void 0===r?void 0:r.content)},leave(){t=void 0}},PathItemElement:{enter(r,i,s,o,c){if(c.some(e.isComponentsElement))return;void 0===r.servers&&void 0!==t&&(r.servers=new CF(t));const{servers:a}=r;void 0!==a&&e.isArrayElement(a)?n.push([...a.content]):n.push(void 0)},leave(){n.pop()}},OperationElement:{enter(t){const r=kE(n);void 0!==r&&(e.isArrayElement(t.servers)||(t.servers=new QF(r)))}}}}},TB=e=>e.replace(/\s/g,""),RB=e=>e.replace(/\W/gi,"_"),IB=(e,t,n)=>{const r=TB(e);return r.length>0?RB(r):((e,t)=>`${RB(TB(t.toLowerCase()))}${RB(TB(e))}`)(t,n)},kB=({operationIdNormalizer:e=IB}={})=>({predicates:t,namespace:n})=>{const r=[],i=[],s=[];return{visitor:{OpenApi3_1Element:{leave(){const e=BE((e=>sI(e.operationId)),i);Object.entries(e).forEach((([e,t])=>{t.length<=1||t.forEach(((t,r)=>{const i=`${e}${r+1}`;t.operationId=new n.elements.String(i)}))})),s.forEach((e=>{var t;if(void 0===e.operationId)return;const n=String(sI(e.operationId)),r=i.find((e=>sI(e.meta.get("originalOperationId"))===n));void 0!==r&&(e.operationId=null===(t=r.operationId)||void 0===t?void 0:t.clone(),e.meta.set("originalOperationId",n),e.set("__originalOperationId",n))})),i.length=0,s.length=0}},PathItemElement:{enter(e){const t=gE("path",sI(e.meta.get("path")));r.push(t)},leave(){r.pop()}},OperationElement:{enter(t){if(void 0===t.operationId)return;const s=String(sI(t.operationId)),o=kE(r),c=gE("method",sI(t.meta.get("http-method"))),a=e(s,o,c);s!==a&&(t.operationId=new n.elements.String(a),t.set("__originalOperationId",s),t.meta.set("originalOperationId",s),i.push(t))}},LinkElement:{leave(e){t.isLinkElement(e)&&void 0!==e.operationId&&s.push(e)}}}}},FB=()=>({predicates:e})=>({visitor:{ParameterElement:{leave(t,n,r,i,s){var o,c;if(!s.some(e.isComponentsElement)&&void 0!==t.schema&&e.isSchemaElement(t.schema)&&(void 0!==(null===(o=t.schema)||void 0===o?void 0:o.example)||void 0!==(null===(c=t.schema)||void 0===c?void 0:c.examples))){if(void 0!==t.examples&&e.isObjectElement(t.examples)){const e=t.examples.map((e=>{var t;return null===(t=e.value)||void 0===t?void 0:t.clone()}));return void 0!==t.schema.examples&&t.schema.set("examples",e),void(void 0!==t.schema.example&&t.schema.set("example",e))}void 0!==t.example&&(void 0!==t.schema.examples&&t.schema.set("examples",[t.example.clone()]),void 0!==t.schema.example&&t.schema.set("example",t.example.clone()))}}}}}),MB=()=>({predicates:e})=>({visitor:{HeaderElement:{leave(t,n,r,i,s){var o,c;if(!s.some(e.isComponentsElement)&&void 0!==t.schema&&e.isSchemaElement(t.schema)&&(void 0!==(null===(o=t.schema)||void 0===o?void 0:o.example)||void 0!==(null===(c=t.schema)||void 0===c?void 0:c.examples))){if(void 0!==t.examples&&e.isObjectElement(t.examples)){const e=t.examples.map((e=>{var t;return null===(t=e.value)||void 0===t?void 0:t.clone()}));return void 0!==t.schema.examples&&t.schema.set("examples",e),void(void 0!==t.schema.example&&t.schema.set("example",e))}void 0!==t.example&&(void 0!==t.schema.examples&&t.schema.set("examples",[t.example.clone()]),void 0!==t.schema.example&&t.schema.set("example",t.example.clone()))}}}}}),NB=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof q_||e(r)&&t("callback",r)&&n("object",r))),CB=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof __||e(r)&&t("components",r)&&n("object",r))),DB=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof B_||e(r)&&t("contact",r)&&n("object",r))),qB=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof J_||e(r)&&t("example",r)&&n("object",r))),_B=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof V_||e(r)&&t("externalDocumentation",r)&&n("object",r))),BB=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof G_||e(r)&&t("header",r)&&n("object",r))),LB=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof z_||e(r)&&t("info",r)&&n("object",r))),UB=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof W_||e(r)&&t("jsonSchemaDialect",r)&&n("string",r))),JB=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof X_||e(r)&&t("license",r)&&n("object",r))),VB=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof Y_||e(r)&&t("link",r)&&n("object",r))),GB=e=>{if(!VB(e))return!1;if(!eR(e.operationRef))return!1;const t=e.operationRef.toValue();return"string"==typeof t&&t.length>0&&!t.startsWith("#")},zB=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof eB||e(r)&&t("openapi",r)&&n("string",r))),HB=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n,hasClass:r})=>i=>i instanceof tB||e(i)&&t("openApi3_1",i)&&n("object",i)&&r("api",i))),WB=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof nB||e(r)&&t("operation",r)&&n("object",r))),XB=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof rB||e(r)&&t("parameter",r)&&n("object",r))),YB=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof iB||e(r)&&t("pathItem",r)&&n("object",r))),KB=e=>{if(!YB(e))return!1;if(!eR(e.$ref))return!1;const t=e.$ref.toValue();return"string"==typeof t&&t.length>0&&!t.startsWith("#")},QB=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof sB||e(r)&&t("paths",r)&&n("object",r))),ZB=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof cB||e(r)&&t("reference",r)&&n("object",r))),eL=e=>{if(!ZB(e))return!1;if(!eR(e.$ref))return!1;const t=e.$ref.toValue();return"string"==typeof t&&t.length>0&&!t.startsWith("#")},tL=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof aB||e(r)&&t("requestBody",r)&&n("object",r))),nL=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof uB||e(r)&&t("response",r)&&n("object",r))),rL=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof fB||e(r)&&t("responses",r)&&n("object",r))),iL=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof lB||e(r)&&t("schema",r)&&n("object",r))),sL=e=>rR(e)&&e.classes.includes("boolean-json-schema"),oL=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof hB||e(r)&&t("securityRequirement",r)&&n("object",r))),cL=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof mB||e(r)&&t("server",r)&&n("object",r))),aL=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof dB||e(r)&&t("serverVariable",r)&&n("object",r))),uL=QT((({hasBasicElementProps:e,isElementType:t,primitiveEq:n})=>r=>r instanceof K_||e(r)&&t("mediaType",r)&&n("object",r))),fL=Object.freeze(Object.defineProperty({__proto__:null,isBooleanJsonSchemaElement:sL,isCallbackElement:NB,isComponentsElement:CB,isContactElement:DB,isExampleElement:qB,isExternalDocumentationElement:_B,isHeaderElement:BB,isInfoElement:LB,isJsonSchemaDialectElement:UB,isLicenseElement:JB,isLinkElement:VB,isLinkElementExternal:GB,isMediaTypeElement:uL,isOpenApi3_1Element:HB,isOpenapiElement:zB,isOperationElement:WB,isParameterElement:XB,isPathItemElement:YB,isPathItemElementExternal:KB,isPathsElement:QB,isReferenceElement:ZB,isReferenceElementExternal:eL,isRequestBodyElement:tL,isResponseElement:nL,isResponsesElement:rL,isSchemaElement:iL,isSecurityRequirementElement:oL,isServerElement:cL,isServerVariableElement:aL},Symbol.toStringTag,{value:"Module"}));function lL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lL(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lL(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const pL=()=>{const e=PT(bB);return{predicates:hL(hL({},fL),{},{isStringElement:eR,isArrayElement:sR,isObjectElement:iR,includesClasses:dR}),namespace:e}},mL=TT(qM,BM,{props:{specPath:_O(["document","objects","OpenApi"]),canSupportSpecificationExtensions:!0},init(){this.element=new tB,this.openApiSemanticElement=this.element},methods:{ObjectElement(e){return this.openApiGenericElement=e,qM.compose.methods.ObjectElement.call(this,e)}}}),dL=mL,{visitors:{document:{objects:{Info:{$visitor:vL}}}}}=k_,yL=TT(vL,{init(){this.element=new z_}}),bL=BM,{visitors:{document:{objects:{Contact:{$visitor:jL}}}}}=k_,gL=TT(jL,{init(){this.element=new B_}}),{visitors:{document:{objects:{License:{$visitor:wL}}}}}=k_,OL=TT(wL,{init(){this.element=new X_}}),EL=BM,{visitors:{document:{objects:{Link:{$visitor:xL}}}}}=k_,SL=TT(xL,{init(){this.element=new Y_}}),PL=TT(IM,BM,{methods:{StringElement(e){const t=new W_(e.toValue());return this.copyMetaAndAttributes(e,t),this.element=t,UT}}}),{visitors:{document:{objects:{Server:{$visitor:$L}}}}}=k_,AL=TT($L,{init(){this.element=new mB}}),{visitors:{document:{objects:{ServerVariable:{$visitor:TL}}}}}=k_,RL=TT(TL,{init(){this.element=new dB}}),{visitors:{document:{objects:{MediaType:{$visitor:IL}}}}}=k_,kL=TT(IL,{init(){this.element=new K_}}),{visitors:{document:{objects:{SecurityRequirement:{$visitor:FL}}}}}=k_,ML=TT(FL,{init(){this.element=new hB}}),{visitors:{document:{objects:{Components:{$visitor:NL}}}}}=k_,CL=TT(NL,{init(){this.element=new __}}),{visitors:{document:{objects:{Tag:{$visitor:DL}}}}}=k_,qL=TT(DL,{init(){this.element=new vB}}),{visitors:{document:{objects:{Reference:{$visitor:_L}}}}}=k_,BL=TT(_L,{init(){this.element=new cB}}),LL=BM,UL=BM,{visitors:{document:{objects:{Parameter:{$visitor:JL}}}}}=k_,VL=TT(JL,{init(){this.element=new rB}}),{visitors:{document:{objects:{Header:{$visitor:GL}}}}}=k_,zL=TT(GL,{init(){this.element=new G_}}),HL=TT({props:{parent:null},init({parent:e=this.parent}){this.parent=e,this.passingOptionsNames=[...this.passingOptionsNames,"parent"]}}),WL=HL,XL=TT(qM,WL,BM,{props:{specPath:_O(["document","objects","Schema"]),canSupportSpecificationExtensions:!0},init(){const e=()=>{let e;return e=null!==this.openApiSemanticElement&&UB(this.openApiSemanticElement.jsonSchemaDialect)?this.openApiSemanticElement.jsonSchemaDialect.toValue():null!==this.openApiGenericElement&&eR(this.openApiGenericElement.get("jsonSchemaDialect"))?this.openApiGenericElement.get("jsonSchemaDialect").toValue():W_.default.toValue(),e},t=t=>{if(Dx(this.parent)&&!eR(t.get("$schema")))this.element.setMetaProperty("inherited$schema",e());else if(iL(this.parent)&&!eR(t.get("$schema"))){var n,r;const e=gE(null===(n=this.parent.meta.get("inherited$schema"))||void 0===n?void 0:n.toValue(),null===(r=this.parent.$schema)||void 0===r?void 0:r.toValue());this.element.setMetaProperty("inherited$schema",e)}},n=e=>{var t;const n=null!==this.parent?this.parent.getMetaProperty("inherited$id",[]).clone():new mT,r=null===(t=e.get("$id"))||void 0===t?void 0:t.toValue();Qx(r)&&n.push(r),this.element.setMetaProperty("inherited$id",n)};this.ObjectElement=function(e){this.element=new lB,t(e),n(e),this.parent=this.element;const r=qM.compose.methods.ObjectElement.call(this,e);return eR(this.element.$ref)&&(this.element.classes.push("reference-element"),this.element.setMetaProperty("referenced-element","schema")),r},this.BooleanElement=function(e){return this.element=e.clone(),this.element.classes.push("boolean-json-schema"),UT}}}),YL=BM,KL=TT(BM,{methods:{ObjectElement(e){return this.element=e.clone(),this.element.classes.push("json-schema-$vocabulary"),UT}}}),QL=BM,ZL=BM,eU=BM,tU=BM,nU=TT(BM,{methods:{StringElement(e){return this.element=e.clone(),this.element.classes.push("reference-value"),UT}}}),rU=TT(PN,WL,BM,{props:{specPath:_O(["document","objects","Schema"])},init(){this.element=new dT,this.element.classes.push("json-schema-$defs")}}),iU=BM,sU=TT(IM,WL,BM,{init(){this.element=new mT,this.element.classes.push("json-schema-allOf")},methods:{ArrayElement(e){return e.forEach((e=>{if(iR(e)){const t=this.toRefractedElement(["document","objects","Schema"],e);this.element.push(t)}else{const t=e.clone();this.element.push(t)}})),this.copyMetaAndAttributes(e,this.element),UT}}}),oU=TT(IM,WL,BM,{init(){this.element=new mT,this.element.classes.push("json-schema-anyOf")},methods:{ArrayElement(e){return e.forEach((e=>{if(iR(e)){const t=this.toRefractedElement(["document","objects","Schema"],e);this.element.push(t)}else{const t=e.clone();this.element.push(t)}})),this.copyMetaAndAttributes(e,this.element),UT}}}),cU=TT(IM,WL,BM,{init(){this.element=new mT,this.element.classes.push("json-schema-oneOf")},methods:{ArrayElement(e){return e.forEach((e=>{if(iR(e)){const t=this.toRefractedElement(["document","objects","Schema"],e);this.element.push(t)}else{const t=e.clone();this.element.push(t)}})),this.copyMetaAndAttributes(e,this.element),UT}}}),aU=TT(PN,WL,BM,{props:{specPath:_O(["document","objects","Schema"])},init(){this.element=new dT,this.element.classes.push("json-schema-dependentSchemas")}}),uU=TT(IM,WL,BM,{init(){this.element=new mT,this.element.classes.push("json-schema-prefixItems")},methods:{ArrayElement(e){return e.forEach((e=>{if(iR(e)){const t=this.toRefractedElement(["document","objects","Schema"],e);this.element.push(t)}else{const t=e.clone();this.element.push(t)}})),this.copyMetaAndAttributes(e,this.element),UT}}}),fU=TT(PN,WL,BM,{props:{specPath:_O(["document","objects","Schema"])},init(){this.element=new dT,this.element.classes.push("json-schema-properties")}}),lU=TT(PN,WL,BM,{props:{specPath:_O(["document","objects","Schema"])},init(){this.element=new dT,this.element.classes.push("json-schema-patternProperties")}}),hU=TT(BM,{methods:{StringElement(e){return this.element=e.clone(),this.element.classes.push("json-schema-type"),UT},ArrayElement(e){return this.element=e.clone(),this.element.classes.push("json-schema-type"),UT}}}),pU=TT(BM,{methods:{ArrayElement(e){return this.element=e.clone(),this.element.classes.push("json-schema-enum"),UT}}}),mU=BM,dU=BM,vU=BM,yU=BM,bU=BM,jU=BM,gU=BM,wU=BM,OU=BM,EU=BM,xU=BM,SU=BM,PU=BM,$U=BM,AU=BM,TU=BM,RU=TT(BM,{methods:{ArrayElement(e){return this.element=e.clone(),this.element.classes.push("json-schema-required"),UT}}}),IU=TT(BM,{methods:{ObjectElement(e){return this.element=e.clone(),this.element.classes.push("json-schema-dependentRequired"),UT}}}),kU=BM,FU=BM,MU=BM,NU=BM,CU=BM,DU=BM,qU=TT(BM,{methods:{ArrayElement(e){return this.element=e.clone(),this.element.classes.push("json-schema-examples"),UT}}}),_U=BM,BU=BM,LU=BM,UU=BM,{visitors:{document:{objects:{Discriminator:{$visitor:JU}}}}}=k_,VU=TT(JU,{props:{canSupportSpecificationExtensions:!0},init(){this.element=new L_}}),{visitors:{document:{objects:{XML:{$visitor:GU}}}}}=k_,zU=TT(GU,{init(){this.element=new yB}}),HU=TT(PN,BM,{props:{specPath:_O(["document","objects","Schema"])},init(){this.element=new bF}}),WU=TT(PN,BM,{props:{specPath:e=>kM(e)?["document","objects","Reference"]:["document","objects","PathItem"]},init(){this.element=new gB},methods:{ObjectElement(e){const t=PN.compose.methods.ObjectElement.call(this,e);return this.element.filter(ZB).forEach((e=>{e.setMetaProperty("referenced-element","pathItem")})),t}}}),{visitors:{document:{objects:{Example:{$visitor:XU}}}}}=k_,YU=TT(XU,{init(){this.element=new J_}}),{visitors:{document:{objects:{ExternalDocumentation:{$visitor:KU}}}}}=k_,QU=TT(KU,{init(){this.element=new V_}}),{visitors:{document:{objects:{Encoding:{$visitor:ZU}}}}}=k_,eJ=TT(ZU,{init(){this.element=new U_}}),{visitors:{document:{objects:{Paths:{$visitor:tJ}}}}}=k_,nJ=TT(tJ,{init(){this.element=new sB}}),{visitors:{document:{objects:{RequestBody:{$visitor:rJ}}}}}=k_,iJ=TT(rJ,{init(){this.element=new aB}}),{visitors:{document:{objects:{Callback:{$visitor:sJ}}}}}=k_,oJ=TT(sJ,{props:{specPath:e=>kM(e)?["document","objects","Reference"]:["document","objects","PathItem"]},init(){this.element=new q_},methods:{ObjectElement(e){const t=sJ.compose.methods.ObjectElement.call(this,e);return this.element.filter(ZB).forEach((e=>{e.setMetaProperty("referenced-element","pathItem")})),t}}}),{visitors:{document:{objects:{Response:{$visitor:cJ}}}}}=k_,aJ=TT(cJ,{init(){this.element=new uB}}),{visitors:{document:{objects:{Responses:{$visitor:uJ}}}}}=k_,fJ=TT(uJ,{init(){this.element=new fB}}),{visitors:{document:{objects:{Operation:{$visitor:lJ}}}}}=k_,hJ=TT(lJ,{init(){this.element=new nB}}),{visitors:{document:{objects:{PathItem:{$visitor:pJ}}}}}=k_,mJ=TT(pJ,{init(){this.element=new iB}}),{visitors:{document:{objects:{SecurityScheme:{$visitor:dJ}}}}}=k_,vJ=TT(dJ,{init(){this.element=new pB}}),{visitors:{document:{objects:{OAuthFlows:{$visitor:yJ}}}}}=k_,bJ=TT(yJ,{init(){this.element=new Z_}}),{visitors:{document:{objects:{OAuthFlow:{$visitor:jJ}}}}}=k_,gJ=TT(jJ,{init(){this.element=new Q_}}),wJ=TT(PN,BM,{props:{specPath:e=>kM(e)?["document","objects","Reference"]:["document","objects","PathItem"]},init(){this.element=new OB},methods:{ObjectElement(e){const t=PN.compose.methods.ObjectElement.call(this,e);return this.element.filter(ZB).forEach((e=>{e.setMetaProperty("referenced-element","pathItem")})),this.element.filter(YB).forEach(((e,t)=>{e.setMetaProperty("webhook-name",t.toValue())})),t}}}),OJ={visitors:{value:k_.visitors.value,document:{objects:{OpenApi:{$visitor:dL,fixedFields:{openapi:k_.visitors.document.objects.OpenApi.fixedFields.openapi,info:{$ref:"#/visitors/document/objects/Info"},jsonSchemaDialect:PL,servers:k_.visitors.document.objects.OpenApi.fixedFields.servers,paths:{$ref:"#/visitors/document/objects/Paths"},webhooks:wJ,components:{$ref:"#/visitors/document/objects/Components"},security:k_.visitors.document.objects.OpenApi.fixedFields.security,tags:k_.visitors.document.objects.OpenApi.fixedFields.tags,externalDocs:{$ref:"#/visitors/document/objects/ExternalDocumentation"}}},Info:{$visitor:yL,fixedFields:{title:k_.visitors.document.objects.Info.fixedFields.title,description:k_.visitors.document.objects.Info.fixedFields.description,summary:bL,termsOfService:k_.visitors.document.objects.Info.fixedFields.termsOfService,contact:{$ref:"#/visitors/document/objects/Contact"},license:{$ref:"#/visitors/document/objects/License"},version:k_.visitors.document.objects.Info.fixedFields.version}},Contact:{$visitor:gL,fixedFields:{name:k_.visitors.document.objects.Contact.fixedFields.name,url:k_.visitors.document.objects.Contact.fixedFields.url,email:k_.visitors.document.objects.Contact.fixedFields.email}},License:{$visitor:OL,fixedFields:{name:k_.visitors.document.objects.License.fixedFields.name,identifier:EL,url:k_.visitors.document.objects.License.fixedFields.url}},Server:{$visitor:AL,fixedFields:{url:k_.visitors.document.objects.Server.fixedFields.url,description:k_.visitors.document.objects.Server.fixedFields.description,variables:k_.visitors.document.objects.Server.fixedFields.variables}},ServerVariable:{$visitor:RL,fixedFields:{enum:k_.visitors.document.objects.ServerVariable.fixedFields.enum,default:k_.visitors.document.objects.ServerVariable.fixedFields.default,description:k_.visitors.document.objects.ServerVariable.fixedFields.description}},Components:{$visitor:CL,fixedFields:{schemas:HU,responses:k_.visitors.document.objects.Components.fixedFields.responses,parameters:k_.visitors.document.objects.Components.fixedFields.parameters,examples:k_.visitors.document.objects.Components.fixedFields.examples,requestBodies:k_.visitors.document.objects.Components.fixedFields.requestBodies,headers:k_.visitors.document.objects.Components.fixedFields.headers,securitySchemes:k_.visitors.document.objects.Components.fixedFields.securitySchemes,links:k_.visitors.document.objects.Components.fixedFields.links,callbacks:k_.visitors.document.objects.Components.fixedFields.callbacks,pathItems:WU}},Paths:{$visitor:nJ},PathItem:{$visitor:mJ,fixedFields:{$ref:k_.visitors.document.objects.PathItem.fixedFields.$ref,summary:k_.visitors.document.objects.PathItem.fixedFields.summary,description:k_.visitors.document.objects.PathItem.fixedFields.description,get:{$ref:"#/visitors/document/objects/Operation"},put:{$ref:"#/visitors/document/objects/Operation"},post:{$ref:"#/visitors/document/objects/Operation"},delete:{$ref:"#/visitors/document/objects/Operation"},options:{$ref:"#/visitors/document/objects/Operation"},head:{$ref:"#/visitors/document/objects/Operation"},patch:{$ref:"#/visitors/document/objects/Operation"},trace:{$ref:"#/visitors/document/objects/Operation"},servers:k_.visitors.document.objects.PathItem.fixedFields.servers,parameters:k_.visitors.document.objects.PathItem.fixedFields.parameters}},Operation:{$visitor:hJ,fixedFields:{tags:k_.visitors.document.objects.Operation.fixedFields.tags,summary:k_.visitors.document.objects.Operation.fixedFields.summary,description:k_.visitors.document.objects.Operation.fixedFields.description,externalDocs:{$ref:"#/visitors/document/objects/ExternalDocumentation"},operationId:k_.visitors.document.objects.Operation.fixedFields.operationId,parameters:k_.visitors.document.objects.Operation.fixedFields.parameters,requestBody:k_.visitors.document.objects.Operation.fixedFields.requestBody,responses:{$ref:"#/visitors/document/objects/Responses"},callbacks:k_.visitors.document.objects.Operation.fixedFields.callbacks,deprecated:k_.visitors.document.objects.Operation.fixedFields.deprecated,security:k_.visitors.document.objects.Operation.fixedFields.security,servers:k_.visitors.document.objects.Operation.fixedFields.servers}},ExternalDocumentation:{$visitor:QU,fixedFields:{description:k_.visitors.document.objects.ExternalDocumentation.fixedFields.description,url:k_.visitors.document.objects.ExternalDocumentation.fixedFields.url}},Parameter:{$visitor:VL,fixedFields:{name:k_.visitors.document.objects.Parameter.fixedFields.name,in:k_.visitors.document.objects.Parameter.fixedFields.in,description:k_.visitors.document.objects.Parameter.fixedFields.description,required:k_.visitors.document.objects.Parameter.fixedFields.required,deprecated:k_.visitors.document.objects.Parameter.fixedFields.deprecated,allowEmptyValue:k_.visitors.document.objects.Parameter.fixedFields.allowEmptyValue,style:k_.visitors.document.objects.Parameter.fixedFields.style,explode:k_.visitors.document.objects.Parameter.fixedFields.explode,allowReserved:k_.visitors.document.objects.Parameter.fixedFields.allowReserved,schema:{$ref:"#/visitors/document/objects/Schema"},example:k_.visitors.document.objects.Parameter.fixedFields.example,examples:k_.visitors.document.objects.Parameter.fixedFields.examples,content:k_.visitors.document.objects.Parameter.fixedFields.content}},RequestBody:{$visitor:iJ,fixedFields:{description:k_.visitors.document.objects.RequestBody.fixedFields.description,content:k_.visitors.document.objects.RequestBody.fixedFields.content,required:k_.visitors.document.objects.RequestBody.fixedFields.required}},MediaType:{$visitor:kL,fixedFields:{schema:{$ref:"#/visitors/document/objects/Schema"},example:k_.visitors.document.objects.MediaType.fixedFields.example,examples:k_.visitors.document.objects.MediaType.fixedFields.examples,encoding:k_.visitors.document.objects.MediaType.fixedFields.encoding}},Encoding:{$visitor:eJ,fixedFields:{contentType:k_.visitors.document.objects.Encoding.fixedFields.contentType,headers:k_.visitors.document.objects.Encoding.fixedFields.headers,style:k_.visitors.document.objects.Encoding.fixedFields.style,explode:k_.visitors.document.objects.Encoding.fixedFields.explode,allowReserved:k_.visitors.document.objects.Encoding.fixedFields.allowReserved}},Responses:{$visitor:fJ,fixedFields:{default:k_.visitors.document.objects.Responses.fixedFields.default}},Response:{$visitor:aJ,fixedFields:{description:k_.visitors.document.objects.Response.fixedFields.description,headers:k_.visitors.document.objects.Response.fixedFields.headers,content:k_.visitors.document.objects.Response.fixedFields.content,links:k_.visitors.document.objects.Response.fixedFields.links}},Callback:{$visitor:oJ},Example:{$visitor:YU,fixedFields:{summary:k_.visitors.document.objects.Example.fixedFields.summary,description:k_.visitors.document.objects.Example.fixedFields.description,value:k_.visitors.document.objects.Example.fixedFields.value,externalValue:k_.visitors.document.objects.Example.fixedFields.externalValue}},Link:{$visitor:SL,fixedFields:{operationRef:k_.visitors.document.objects.Link.fixedFields.operationRef,operationId:k_.visitors.document.objects.Link.fixedFields.operationId,parameters:k_.visitors.document.objects.Link.fixedFields.parameters,requestBody:k_.visitors.document.objects.Link.fixedFields.requestBody,description:k_.visitors.document.objects.Link.fixedFields.description,server:{$ref:"#/visitors/document/objects/Server"}}},Header:{$visitor:zL,fixedFields:{description:k_.visitors.document.objects.Header.fixedFields.description,required:k_.visitors.document.objects.Header.fixedFields.required,deprecated:k_.visitors.document.objects.Header.fixedFields.deprecated,allowEmptyValue:k_.visitors.document.objects.Header.fixedFields.allowEmptyValue,style:k_.visitors.document.objects.Header.fixedFields.style,explode:k_.visitors.document.objects.Header.fixedFields.explode,allowReserved:k_.visitors.document.objects.Header.fixedFields.allowReserved,schema:{$ref:"#/visitors/document/objects/Schema"},example:k_.visitors.document.objects.Header.fixedFields.example,examples:k_.visitors.document.objects.Header.fixedFields.examples,content:k_.visitors.document.objects.Header.fixedFields.content}},Tag:{$visitor:qL,fixedFields:{name:k_.visitors.document.objects.Tag.fixedFields.name,description:k_.visitors.document.objects.Tag.fixedFields.description,externalDocs:{$ref:"#/visitors/document/objects/ExternalDocumentation"}}},Reference:{$visitor:BL,fixedFields:{$ref:k_.visitors.document.objects.Reference.fixedFields.$ref,summary:LL,description:UL}},Schema:{$visitor:XL,fixedFields:{$schema:YL,$vocabulary:KL,$id:QL,$anchor:ZL,$dynamicAnchor:eU,$dynamicRef:tU,$ref:nU,$defs:rU,$comment:iU,allOf:sU,anyOf:oU,oneOf:cU,not:{$ref:"#/visitors/document/objects/Schema"},if:{$ref:"#/visitors/document/objects/Schema"},then:{$ref:"#/visitors/document/objects/Schema"},else:{$ref:"#/visitors/document/objects/Schema"},dependentSchemas:aU,prefixItems:uU,items:{$ref:"#/visitors/document/objects/Schema"},contains:{$ref:"#/visitors/document/objects/Schema"},properties:fU,patternProperties:lU,additionalProperties:{$ref:"#/visitors/document/objects/Schema"},propertyNames:{$ref:"#/visitors/document/objects/Schema"},unevaluatedItems:{$ref:"#/visitors/document/objects/Schema"},unevaluatedProperties:{$ref:"#/visitors/document/objects/Schema"},type:hU,enum:pU,const:mU,multipleOf:dU,maximum:vU,exclusiveMaximum:yU,minimum:bU,exclusiveMinimum:jU,maxLength:gU,minLength:wU,pattern:OU,maxItems:EU,minItems:xU,uniqueItems:SU,maxContains:PU,minContains:$U,maxProperties:AU,minProperties:TU,required:RU,dependentRequired:IU,title:kU,description:FU,default:MU,deprecated:NU,readOnly:CU,writeOnly:DU,examples:qU,format:_U,contentEncoding:BU,contentMediaType:LU,contentSchema:{$ref:"#/visitors/document/objects/Schema"},discriminator:{$ref:"#/visitors/document/objects/Discriminator"},xml:{$ref:"#/visitors/document/objects/XML"},externalDocs:{$ref:"#/visitors/document/objects/ExternalDocumentation"},example:UU}},Discriminator:{$visitor:VU,fixedFields:{propertyName:k_.visitors.document.objects.Discriminator.fixedFields.propertyName,mapping:k_.visitors.document.objects.Discriminator.fixedFields.mapping}},XML:{$visitor:zU,fixedFields:{name:k_.visitors.document.objects.XML.fixedFields.name,namespace:k_.visitors.document.objects.XML.fixedFields.namespace,prefix:k_.visitors.document.objects.XML.fixedFields.prefix,attribute:k_.visitors.document.objects.XML.fixedFields.attribute,wrapped:k_.visitors.document.objects.XML.fixedFields.wrapped}},SecurityScheme:{$visitor:vJ,fixedFields:{type:k_.visitors.document.objects.SecurityScheme.fixedFields.type,description:k_.visitors.document.objects.SecurityScheme.fixedFields.description,name:k_.visitors.document.objects.SecurityScheme.fixedFields.name,in:k_.visitors.document.objects.SecurityScheme.fixedFields.in,scheme:k_.visitors.document.objects.SecurityScheme.fixedFields.scheme,bearerFormat:k_.visitors.document.objects.SecurityScheme.fixedFields.bearerFormat,flows:{$ref:"#/visitors/document/objects/OAuthFlows"},openIdConnectUrl:k_.visitors.document.objects.SecurityScheme.fixedFields.openIdConnectUrl}},OAuthFlows:{$visitor:bJ,fixedFields:{implicit:{$ref:"#/visitors/document/objects/OAuthFlow"},password:{$ref:"#/visitors/document/objects/OAuthFlow"},clientCredentials:{$ref:"#/visitors/document/objects/OAuthFlow"},authorizationCode:{$ref:"#/visitors/document/objects/OAuthFlow"}}},OAuthFlow:{$visitor:gJ,fixedFields:{authorizationUrl:k_.visitors.document.objects.OAuthFlow.fixedFields.authorizationUrl,tokenUrl:k_.visitors.document.objects.OAuthFlow.fixedFields.tokenUrl,refreshUrl:k_.visitors.document.objects.OAuthFlow.fixedFields.refreshUrl,scopes:k_.visitors.document.objects.OAuthFlow.fixedFields.scopes}},SecurityRequirement:{$visitor:ML}},extension:{$visitor:k_.visitors.document.extension.$visitor}}}};function EJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const xJ=e=>(t,n={})=>((e,{specPath:t=["visitors","document","objects","OpenApi","$visitor"],plugins:n=[]}={})=>{const r=jT(e),i=XR(OJ),s=gS(t,[],i);return SR(r,s,{state:{specObj:i}}),_R(s.element,n,{toolboxCreator:pL,visitorOptions:{keyMap:SB,nodeTypeGetter:xB}})})(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?EJ(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EJ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({specPath:e},n));q_.refract=xJ(["visitors","document","objects","Callback","$visitor"]),__.refract=xJ(["visitors","document","objects","Components","$visitor"]),B_.refract=xJ(["visitors","document","objects","Contact","$visitor"]),J_.refract=xJ(["visitors","document","objects","Example","$visitor"]),L_.refract=xJ(["visitors","document","objects","Discriminator","$visitor"]),U_.refract=xJ(["visitors","document","objects","Encoding","$visitor"]),V_.refract=xJ(["visitors","document","objects","ExternalDocumentation","$visitor"]),G_.refract=xJ(["visitors","document","objects","Header","$visitor"]),z_.refract=xJ(["visitors","document","objects","Info","$visitor"]),W_.refract=xJ(["visitors","document","objects","OpenApi","fixedFields","jsonSchemaDialect"]),X_.refract=xJ(["visitors","document","objects","License","$visitor"]),Y_.refract=xJ(["visitors","document","objects","Link","$visitor"]),K_.refract=xJ(["visitors","document","objects","MediaType","$visitor"]),Q_.refract=xJ(["visitors","document","objects","OAuthFlow","$visitor"]),Z_.refract=xJ(["visitors","document","objects","OAuthFlows","$visitor"]),eB.refract=xJ(["visitors","document","objects","OpenApi","fixedFields","openapi"]),tB.refract=xJ(["visitors","document","objects","OpenApi","$visitor"]),nB.refract=xJ(["visitors","document","objects","Operation","$visitor"]),rB.refract=xJ(["visitors","document","objects","Parameter","$visitor"]),iB.refract=xJ(["visitors","document","objects","PathItem","$visitor"]),sB.refract=xJ(["visitors","document","objects","Paths","$visitor"]),cB.refract=xJ(["visitors","document","objects","Reference","$visitor"]),aB.refract=xJ(["visitors","document","objects","RequestBody","$visitor"]),uB.refract=xJ(["visitors","document","objects","Response","$visitor"]),fB.refract=xJ(["visitors","document","objects","Responses","$visitor"]),lB.refract=xJ(["visitors","document","objects","Schema","$visitor"]),hB.refract=xJ(["visitors","document","objects","SecurityRequirement","$visitor"]),pB.refract=xJ(["visitors","document","objects","SecurityScheme","$visitor"]),mB.refract=xJ(["visitors","document","objects","Server","$visitor"]),dB.refract=xJ(["visitors","document","objects","ServerVariable","$visitor"]),vB.refract=xJ(["visitors","document","objects","Tag","$visitor"]),yB.refract=xJ(["visitors","document","objects","XML","$visitor"]);var SJ,PJ,$J={exports:{}},AJ=$J.exports={};function TJ(){throw new Error("setTimeout has not been defined")}function RJ(){throw new Error("clearTimeout has not been defined")}function IJ(e){if(SJ===setTimeout)return setTimeout(e,0);if((SJ===TJ||!SJ)&&setTimeout)return SJ=setTimeout,setTimeout(e,0);try{return SJ(e,0)}catch(t){try{return SJ.call(null,e,0)}catch(t){return SJ.call(this,e,0)}}}!function(){try{SJ="function"==typeof setTimeout?setTimeout:TJ}catch(e){SJ=TJ}try{PJ="function"==typeof clearTimeout?clearTimeout:RJ}catch(e){PJ=RJ}}();var kJ,FJ=[],MJ=!1,NJ=-1;function CJ(){MJ&&kJ&&(MJ=!1,kJ.length?FJ=kJ.concat(FJ):NJ=-1,FJ.length&&DJ())}function DJ(){if(!MJ){var e=IJ(CJ);MJ=!0;for(var t=FJ.length;t;){for(kJ=FJ,FJ=[];++NJ<t;)kJ&&kJ[NJ].run();NJ=-1,t=FJ.length}kJ=null,MJ=!1,function(e){if(PJ===clearTimeout)return clearTimeout(e);if((PJ===RJ||!PJ)&&clearTimeout)return PJ=clearTimeout,clearTimeout(e);try{PJ(e)}catch(t){try{return PJ.call(null,e)}catch(t){return PJ.call(this,e)}}}(e)}}function qJ(e,t){this.fun=e,this.array=t}function _J(){}AJ.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];FJ.push(new qJ(e,t)),1!==FJ.length||MJ||IJ(DJ)},qJ.prototype.run=function(){this.fun.apply(null,this.array)},AJ.title="browser",AJ.browser=!0,AJ.env={},AJ.argv=[],AJ.version="",AJ.versions={},AJ.on=_J,AJ.addListener=_J,AJ.once=_J,AJ.off=_J,AJ.removeListener=_J,AJ.removeAllListeners=_J,AJ.emit=_J,AJ.prependListener=_J,AJ.prependOnceListener=_J,AJ.listeners=function(e){return[]},AJ.binding=function(e){throw new Error("process.binding is not supported")},AJ.cwd=function(){return"/"},AJ.chdir=function(e){throw new Error("process.chdir is not supported")},AJ.umask=function(){return 0};const BJ=openapi_parser_e($J.exports),LJ=()=>mx(Tx(/^win/),["platform"],BJ),UJ=e=>{try{const t=new URL(e);return $S(":",t.protocol)}catch{return}};fE(UJ,Cx);const JJ=e=>{if(BJ.browser)return!1;const t=UJ(e);return Nx(t)||"file"===t||/^[a-zA-Z]$/.test(t)},VJ=e=>{const t=UJ(e);return"http"===t||"https"===t},GJ=(e,t)=>{const n=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],r=yx(!1,"keepFileProtocol",t),i=yx(LJ,"isWindows",t);let s=decodeURI(e);for(let e=0;e<n.length;e+=2)s=s.replace(n[e],n[e+1]);let o="file://"===s.substr(0,7).toLowerCase();return o&&(s="/"===s[7]?s.substr(8):s.substr(7),i()&&"/"===s[1]&&(s=`${s[0]}:${s.substr(1)}`),r?s=`file:///${s}`:(o=!1,s=i()?s:`/${s}`)),i()&&!o&&(s=PS("/","\\",s),":\\"===s.substr(1,2)&&(s=s[0].toUpperCase()+s.substr(1))),s},zJ=e=>{const t=e.indexOf("#");return-1!==t?e.substr(t):"#"},HJ=e=>{const t=e.indexOf("#");let n=e;return t>=0&&(n=e.substr(0,t)),n},WJ=()=>{if(BJ.browser)return HJ(globalThis.location.href);const e=BJ.cwd(),t=kE(e);return["/","\\"].includes(t)?e:e+(LJ()?"\\":"/")},XJ=(e,t)=>{const n=new URL(t,new URL(e,"resolve://"));if("resolve:"===n.protocol){const{pathname:e,search:t,hash:r}=n;return e+t+r}return n.toString()},YJ=e=>JJ(e)?(e=>{const t=[/\?/g,"%3F",/#/g,"%23"];let n=e;LJ()&&(n=n.replace(/\\/g,"/")),n=encodeURI(n);for(let e=0;e<t.length;e+=2)n=n.replace(t[e],t[e+1]);return n})(GJ(e)):encodeURI(decodeURI(e)).replace(/%5B/g,"[").replace(/%5D/g,"]"),KJ=e=>JJ(e)?GJ(e):decodeURI(e),QJ=TT({props:{uri:null,mediaType:"text/plain",data:null,parseResult:null},init({uri:e=this.uri,mediaType:t=this.mediaType,data:n=this.data,parseResult:r=this.parseResult}={}){this.uri=e,this.mediaType=t,this.data=n,this.parseResult=r},methods:{get extension(){return Hx(this.uri)?(e=>{const t=e.lastIndexOf(".");return t>=0?e.substr(t).toLowerCase():""})(this.uri):""},toString(){if("string"==typeof this.data)return this.data;if(this.data instanceof ArrayBuffer||["ArrayBuffer"].includes(tO(this.data))||ArrayBuffer.isView(this.data)){return new TextDecoder("utf-8").decode(this.data)}return String(this.data)}}}),ZJ=QJ,eV={parse:{mediaType:"text/plain",parsers:[],parserOpts:{}},resolve:{baseURI:"",resolvers:[],resolverOpts:{},strategies:[],external:!0,maxDepth:1/0},dereference:{strategies:[],refSet:null,maxDepth:1/0}},tV=nx(ix(["resolve","baseURI"]),YO(["resolve","baseURI"])),nV=e=>Wx(e)?WJ():e;class rV extends Error{constructor(e,t){if(super(e),this.name=this.constructor.name,this.message=e,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack,iS(t)&&GE("cause",t)&&!GE("cause",this)){const{cause:e}=t;this.cause=e,GE("stack",e)&&(this.stack=`${this.stack}\nCAUSE: ${null==e?void 0:e.stack}`)}}}const iV=rV;const sV=class extends iV{constructor(e="Not Implemented",t){super(e,t)}};const oV=class extends iV{};const cV=class extends oV{};const aV=class extends iV{};const uV=class extends iV{constructor(e,t){super(e,{cause:t.cause}),ml(this,"plugin",void 0),this.plugin=t.plugin}};const fV=class extends iV{};const lV=class extends oV{};const hV=class extends iV{};const pV=class extends aV{};const mV=class extends hV{},dV=async(e,t,n)=>{const r=await Promise.all(n.map(gS([e],[t])));return n.filter(((e,t)=>r[t]))},vV=async(e,t,n)=>{let r;for(const i of n)try{const n=await i[e].call(i,...t);return{plugin:i,result:n}}catch(e){r=new uV("Error while running plugin",{cause:e,plugin:i})}return Promise.reject(r)};function yV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yV(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yV(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const jV=async(e,t)=>{const n=ZJ({uri:YJ(HJ(e)),mediaType:t.parse.mediaType}),r=await(async(e,t)=>{const n=t.resolve.resolvers.map((e=>{const n=Object.create(e);return Object.assign(n,t.resolve.resolverOpts)})),r=await dV("canRead",e,n);if(ZE(r))throw new cV(e.uri);try{const{result:t}=await vV("read",[e],r);return t}catch(t){throw new oV(`Error while reading file "${e.uri}"`,{cause:t})}})(n,t);return(async(e,t)=>{const n=t.parse.parsers.map((e=>{const n=Object.create(e);return Object.assign(n,t.parse.parserOpts)})),r=await dV("canParse",e,n);if(ZE(r))throw new cV(e.uri);try{const{plugin:t,result:n}=await vV("parse",[e],r);return!t.allowEmpty&&n.isEmpty?Promise.reject(new aV(`Error while parsing file "${e.uri}". File is empty.`)):n}catch(t){throw new aV(`Error while parsing file "${e.uri}"`,{cause:t})}})(ZJ(bV(bV({},n),{},{data:r})),t)},gV=TT({props:{name:"",allowEmpty:!0,sourceMap:!1,fileExtensions:[],mediaTypes:[]},init({allowEmpty:e=this.allowEmpty,sourceMap:t=this.sourceMap,fileExtensions:n=this.fileExtensions,mediaTypes:r=this.mediaTypes}={}){this.allowEmpty=e,this.sourceMap=t,this.fileExtensions=n,this.mediaTypes=r},methods:{async canParse(){throw new sV},async parse(){throw new sV}}}),wV=gV,OV=TT({props:{name:null},methods:{canRead:()=>!1,async read(){throw new sV}}}),EV=TT(OV,{props:{timeout:5e3,redirects:5,withCredentials:!1},init({timeout:e=this.timeout,redirects:t=this.redirects,withCredentials:n=this.withCredentials}={}){this.timeout=e,this.redirects=t,this.withCredentials=n},methods:{canRead:e=>VJ(e.uri),async read(){throw new sV},getHttpClient(){throw new sV}}}),xV=TT({props:{name:null},methods:{canResolve:()=>!1,async resolve(){throw new sV}}}),SV=TT({props:{name:null},methods:{canDereference:()=>!1,async dereference(){throw new sV}}}),PV=TT({props:{uri:"",value:null,depth:0,refSet:null,errors:[]},init({depth:e=this.depth,refSet:t=this.refSet,uri:n=this.uri,value:r=this.value}={}){this.uri=n,this.value=r,this.depth=e,this.refSet=t,this.errors=[]}}),$V=TT({props:{rootRef:null,refs:[],circular:!1},init({refs:e=[]}={}){this.refs=[],e.forEach((e=>this.add(e)))},methods:{get size(){return this.refs.length},add(e){return this.has(e)||(this.refs.push(e),this.rootRef=null===this.rootRef?e:this.rootRef,e.refSet=this),this},merge(e){for(const t of e.values())this.add(t);return this},has(e){const t=Hx(e)?e:e.uri;return Cx(this.find(vx(t,"uri")))},find(e){return this.refs.find(e)},*values(){yield*this.refs},clean(){this.refs.forEach((e=>{e.refSet=null})),this.refs=[]}}}),AV=async(e,t={})=>(async(e,t)=>{let n=e,r=!1;if(!lR(e)){const t=new e.constructor(e.content,e.meta.clone(),e.attributes);t.classes.push("result"),n=new OT([t]),r=!0}const i=ZJ({uri:t.resolve.baseURI,parseResult:n,mediaType:t.parse.mediaType}),s=await dV("canDereference",i,t.dereference.strategies);if(ZE(s))throw new pV(i.uri);try{const{result:e}=await vV("dereference",[i,t],s);return r?e.get(0):e}catch(e){throw new hV(`Error while dereferencing file "${i.uri}"`,{cause:e})}})(e,((e,t)=>{const n=ax(e,t);return hx(tV,nV,n)})(eV,t)),TV=TT(wV,{props:{name:"binary"},methods:{async canParse(e){return 0===this.fileExtensions.length||this.fileExtensions.includes(e.extension)},async parse(e){try{const t=unescape(encodeURIComponent(e.toString())),n=btoa(t),r=new OT;if(0!==n.length){const e=new fT(n);e.classes.push("result"),r.push(e)}return r}catch(t){throw new aV(`Error parsing "${e.uri}"`,{cause:t})}}}});class RV extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack}}class IV extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack}}class kV extends fV{constructor(e){super(`Invalid JSON Schema $anchor "${e}".`)}}const FV=e=>/^[A-Za-z_][A-Za-z_0-9.-]*$/.test(e),MV=e=>{const t=zJ(e);return AS("#",t)},NV=(e,t)=>{const n=(e=>{if(!FV(e))throw new kV(e);return e})(e),r=GR((e=>{var t;return iL(e)&&(null===(t=e.$anchor)||void 0===t?void 0:t.toValue())===n}),t);if(Nx(r))throw new IV(`Evaluation failed on token: "${n}"`);return r},CV=(e,t)=>{if(void 0===t.$ref)return;const n=zJ(t.$ref.toValue()),r=t.meta.get("inherited$id").toValue();return`${DO(((e,t)=>XJ(e,YJ(HJ(t)))),e,[...r,t.$ref.toValue()])}${"#"===n?"":n}`},DV=e=>{if(DV.cache.has(e))return DV.cache.get(e);const t=lB.refract(e);return DV.cache.set(e,t),t};DV.cache=new WeakMap;const qV=e=>pR(e)?DV(e):e,_V=(e,t)=>{const{cache:n}=_V,r=HJ(e),i=e=>iL(e)&&void 0!==e.$id;if(!n.has(t)){const e=VR(i,t);n.set(t,Array.from(e))}const s=n.get(t).find((e=>((e,t)=>{if(void 0===t.$id)return;const n=t.meta.get("inherited$id").toValue();return DO(((e,t)=>XJ(e,YJ(HJ(t)))),e,[...n,t.$id.toValue()])})(r,e)===r));if(Nx(s))throw new RV(`Evaluation failed on URI: "${e}"`);let o,c;return FV(MV(e))?(o=NV,c=MV(e)):(o=fI,c=lI(e)),o(c,s)};function BV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function LV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?BV(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BV(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}_V.cache=new WeakMap;const UV=SR[Symbol.for("nodejs.util.promisify.custom")],JV=TT({props:{indirections:[],namespace:null,reference:null,crawledElements:null,crawlingMap:null,visited:null,options:null},init({reference:e,namespace:t,indirections:n=[],visited:r=new WeakSet,options:i}){this.indirections=n,this.namespace=t,this.reference=e,this.crawledElements=[],this.crawlingMap={},this.visited=r,this.options=i},methods:{toBaseURI(e){return XJ(this.reference.uri,YJ(HJ(e)))},async toReference(e){if(this.reference.depth>=this.options.resolve.maxDepth)throw new lV(`Maximum resolution depth of ${this.options.resolve.maxDepth} has been exceeded by file "${this.reference.uri}"`);const t=this.toBaseURI(e),{refSet:n}=this.reference;if(n.has(t))return n.find(vx(t,"uri"));const r=await jV(KJ(t),LV(LV({},this.options),{},{parse:LV(LV({},this.options.parse),{},{mediaType:"text/plain"})})),i=PV({uri:t,value:r,depth:this.reference.depth+1});return n.add(i),i},ReferenceElement(e){var t;if(!this.options.resolve.external&&eL(e))return!1;const n=null===(t=e.$ref)||void 0===t?void 0:t.toValue(),r=this.toBaseURI(n);JE(r,this.crawlingMap)||(this.crawlingMap[r]=this.toReference(n)),this.crawledElements.push(e)},PathItemElement(e){var t;if(!eR(e.$ref))return;if(!this.options.resolve.external&&KB(e))return;const n=null===(t=e.$ref)||void 0===t?void 0:t.toValue(),r=this.toBaseURI(n);JE(r,this.crawlingMap)||(this.crawlingMap[r]=this.toReference(n)),this.crawledElements.push(e)},LinkElement(e){if((eR(e.operationRef)||eR(e.operationId))&&(this.options.resolve.external||!GB(e))){if(eR(e.operationRef)&&eR(e.operationId))throw new Error("LinkElement operationRef and operationId are mutually exclusive.");if(GB(e)){var t;const n=null===(t=e.operationRef)||void 0===t?void 0:t.toValue(),r=this.toBaseURI(n);JE(r,this.crawlingMap)||(this.crawlingMap[r]=this.toReference(n))}}},ExampleElement(e){var t;if(!eR(e.externalValue))return;if(!this.options.resolve.external&&eR(e.externalValue))return;if(e.hasKey("value")&&eR(e.externalValue))throw new Error("ExampleElement value and externalValue fields are mutually exclusive.");const n=null===(t=e.externalValue)||void 0===t?void 0:t.toValue(),r=this.toBaseURI(n);JE(r,this.crawlingMap)||(this.crawlingMap[r]=this.toReference(n))},SchemaElement(e){if(this.visited.has(e))return!1;if(!eR(e.$ref))return void this.visited.add(e);const t=this.reference.uri,n=CV(t,e),r=HJ(n),i=ZJ({uri:r}),s=ux((e=>e.canRead(i)),this.options.resolve.resolvers),o=!s,c=!s&&this.reference.uri!==r;if(this.options.resolve.external||!c){if(!JE(r,this.crawlingMap))try{this.crawlingMap[r]=s||o?this.reference:this.toReference(KJ(n))}catch(e){if(!(o&&e instanceof RV))throw e;this.crawlingMap[r]=this.toReference(KJ(n))}this.crawledElements.push(e)}else this.visited.add(e)},async crawlReferenceElement(e){var t;const n=await this.toReference(e.$ref.toValue());this.indirections.push(e);const r=lI(null===(t=e.$ref)||void 0===t?void 0:t.toValue());let i=fI(r,n.value.result);if(pR(i)){const t=e.meta.get("referenced-element").toValue();if(kM(i))i=cB.refract(i),i.setMetaProperty("referenced-element",t);else{i=this.namespace.getElementClass(t).refract(i)}}if(this.indirections.includes(i))throw new Error("Recursive Reference Object detected");if(this.indirections.length>this.options.dereference.maxDepth)throw new mV(`Maximum dereference depth of "${this.options.dereference.maxDepth}" has been exceeded in file "${this.reference.uri}"`);const s=JV({reference:n,namespace:this.namespace,indirections:[...this.indirections],options:this.options});await UV(i,s,{keyMap:SB,nodeTypeGetter:xB}),await s.crawl(),this.indirections.pop()},async crawlPathItemElement(e){var t;const n=await this.toReference(e.$ref.toValue());this.indirections.push(e);const r=lI(null===(t=e.$ref)||void 0===t?void 0:t.toValue());let i=fI(r,n.value.result);if(pR(i)&&(i=iB.refract(i)),this.indirections.includes(i))throw new Error("Recursive Path Item Object reference detected");if(this.indirections.length>this.options.dereference.maxDepth)throw new mV(`Maximum dereference depth of "${this.options.dereference.maxDepth}" has been exceeded in file "${this.reference.uri}"`);const s=JV({reference:n,namespace:this.namespace,indirections:[...this.indirections],options:this.options});await UV(i,s,{keyMap:SB,nodeTypeGetter:xB}),await s.crawl(),this.indirections.pop()},async crawlSchemaElement(e){const t=this.reference.uri,n=CV(t,e),r=HJ(n),i=ZJ({uri:r}),s=ux((e=>e.canRead(i)),this.options.resolve.resolvers),o=!s;let c,a;this.indirections.push(e);try{if(s||o){c=this.reference;a=_V(n,qV(c.value.result))}else{c=await this.toReference(KJ(n));const e=lI(n);a=qV(fI(e,c.value.result))}}catch(e){if(!(o&&e instanceof RV))throw e;if(FV(MV(n))){c=await this.toReference(KJ(n));const e=MV(n);a=NV(e,qV(c.value.result))}else{c=await this.toReference(KJ(n));const e=lI(n);a=qV(fI(e,c.value.result))}}if(this.visited.add(e),this.indirections.includes(a))throw new Error("Recursive Schema Object reference detected");if(this.indirections.length>this.options.dereference.maxDepth)throw new mV(`Maximum dereference depth of "${this.options.dereference.maxDepth}" has been exceeded in file "${this.reference.uri}"`);const u=JV({reference:c,namespace:this.namespace,indirections:[...this.indirections],options:this.options,visited:this.visited});await UV(a,u,{keyMap:SB,nodeTypeGetter:xB}),await u.crawl(),this.indirections.pop()},async crawl(){await fE(HO,hS)(this.crawlingMap),this.crawlingMap=null;for(const e of this.crawledElements)ZB(e)?await this.crawlReferenceElement(e):iL(e)?await this.crawlSchemaElement(e):YB(e)&&await this.crawlPathItemElement(e)}}}),VV=JV,GV=SR[Symbol.for("nodejs.util.promisify.custom")],zV=TT(xV,{init(){this.name="openapi-3-1"},methods:{canResolve(e){var t;return"text/plain"!==e.mediaType?pI.includes(e.mediaType):HB(null===(t=e.parseResult)||void 0===t?void 0:t.result)},async resolve(e,t){const n=PT(bB),r=PV({uri:e.uri,value:e.parseResult}),i=VV({reference:r,namespace:n,options:t}),s=$V();return s.add(r),await GV(s.rootRef.value,i,{keyMap:SB,nodeTypeGetter:xB}),await i.crawl(),s}}}),HV=zV,WV=e=>{if(!iR(e))return e;if(e.hasKey("$$normalized"))return e;const t=[kB({operationIdNormalizer:(e,t,n)=>Gb({operationId:e},t,n,{v2OperationIdCompatibilityMode:!1})}),PB(),$B(),AB(),FB(),MB()],n=_R(e,t,{toolboxCreator:pL,visitorOptions:{keyMap:SB,nodeTypeGetter:xB}});return n.set("$$normalized",!0),n},XV=e=>t=>{if(t?.$$normalized)return t;if(XV.cache.has(t))return t;const n=tB.refract(t),r=e(n),i=sI(r);return XV.cache.set(t,i),i};XV.cache=new WeakMap;const YV=EV.compose({props:{name:"http-swagger-client",swaggerHTTPClient:Nv,swaggerHTTPClientConfig:{}},init(){let{swaggerHTTPClient:e=this.swaggerHTTPClient}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.swaggerHTTPClient=e},methods:{getHttpClient(){return this.swaggerHTTPClient},async read(e){const t=this.getHttpClient(),n=new AbortController,{signal:r}=n,i=setTimeout((()=>{n.abort()}),this.timeout),s=this.getHttpClient().withCredentials||this.withCredentials?"include":"same-origin",o=0===this.redirects?"error":"follow",c=this.redirects>0?this.redirects:void 0;try{return(await t(vl({url:e.uri,signal:r,userFetch:async(e,t)=>{let n=await fetch(e,t);try{n.headers.delete("Content-Type")}catch{n=new Response(n.body,vl(vl({},n),{},{headers:new Headers(n.headers)})),n.headers.delete("Content-Type")}return n},credentials:s,redirects:o,follow:c},this.swaggerHTTPClientConfig))).text.arrayBuffer()}catch(t){throw new oV(`Error downloading "${e.uri}"`,{cause:t})}finally{clearTimeout(i)}}}}),KV=wV.compose({props:{name:"json-swagger-client",fileExtensions:[".json"],mediaTypes:["application/json"]},methods:{async canParse(e){const t=0===this.fileExtensions.length||this.fileExtensions.includes(e.extension),n=this.mediaTypes.includes(e.mediaType);if(!t)return!1;if(n)return!0;if(!n)try{return JSON.parse(e.toString()),!0}catch(e){return!1}return!1},async parse(e){if(this.sourceMap)throw new aV("json-swagger-client parser plugin doesn't support sourceMaps option");const t=new OT,n=e.toString();if(this.allowEmpty&&""===n.trim())return t;try{const e=iI(JSON.parse(n));return e.classes.push("result"),t.push(e),t}catch(t){throw new aV(`Error parsing "${e.uri}"`,{cause:t})}}}}),QV=wV.compose({props:{name:"yaml-1-2-swagger-client",fileExtensions:[".yaml",".yml"],mediaTypes:["text/yaml","application/yaml"]},methods:{async canParse(e){const t=0===this.fileExtensions.length||this.fileExtensions.includes(e.extension),n=this.mediaTypes.includes(e.mediaType);if(!t)return!1;if(n)return!0;if(!n)try{return xv.load(e.toString(),{schema:pv}),!0}catch(e){return!1}return!1},async parse(e){if(this.sourceMap)throw new aV("yaml-1-2-swagger-client parser plugin doesn't support sourceMaps option");const t=new OT,n=e.toString();try{const e=xv.load(n,{schema:pv});if(this.allowEmpty&&void 0===e)return t;const r=iI(e);return r.classes.push("result"),t.push(r),t}catch(t){throw new aV(`Error parsing "${e.uri}"`,{cause:t})}}}}),ZV=wV.compose({props:{name:"openapi-json-3-1-swagger-client",fileExtensions:[".json"],mediaTypes:new hI(...pI.filterByFormat("generic"),...pI.filterByFormat("json")),detectionRegExp:/"openapi"\s*:\s*"(?<version_json>3\.1\.(?:[1-9]\d*|0))"/},methods:{async canParse(e){const t=0===this.fileExtensions.length||this.fileExtensions.includes(e.extension),n=this.mediaTypes.includes(e.mediaType);if(!t)return!1;if(n)return!0;if(!n)try{const t=e.toString();return JSON.parse(t),this.detectionRegExp.test(t)}catch(e){return!1}return!1},async parse(e){if(this.sourceMap)throw new aV("openapi-json-3-1-swagger-client parser plugin doesn't support sourceMaps option");const t=new OT,n=e.toString();if(this.allowEmpty&&""===n.trim())return t;try{const e=JSON.parse(n),r=tB.refract(e,this.refractorOpts);return r.classes.push("result"),t.push(r),t}catch(t){throw new aV(`Error parsing "${e.uri}"`,{cause:t})}}}}),eG=wV.compose({props:{name:"openapi-yaml-3-1-swagger-client",fileExtensions:[".yaml",".yml"],mediaTypes:new hI(...pI.filterByFormat("generic"),...pI.filterByFormat("yaml")),detectionRegExp:/(?<YAML>^(["']?)openapi\2\s*:\s*(["']?)(?<version_yaml>3\.1\.(?:[1-9]\d*|0))\3(?:\s+|$))|(?<JSON>"openapi"\s*:\s*"(?<version_json>3\.1\.(?:[1-9]\d*|0))")/m},methods:{async canParse(e){const t=0===this.fileExtensions.length||this.fileExtensions.includes(e.extension),n=this.mediaTypes.includes(e.mediaType);if(!t)return!1;if(n)return!0;if(!n)try{const t=e.toString();return xv.load(t),this.detectionRegExp.test(t)}catch(e){return!1}return!1},async parse(e){if(this.sourceMap)throw new aV("openapi-yaml-3-1-swagger-client parser plugin doesn't support sourceMaps option");const t=new OT,n=e.toString();try{const e=xv.load(n,{schema:pv});if(this.allowEmpty&&void 0===e)return t;const r=tB.refract(e,this.refractorOpts);return r.classes.push("result"),t.push(r),t}catch(t){throw new aV(`Error parsing "${e.uri}"`,{cause:t})}}}});function tG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function nG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tG(Object(n),!0).forEach((function(t){ml(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tG(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const rG=SR[Symbol.for("nodejs.util.promisify.custom")],iG=TT({props:{indirections:null,namespace:null,reference:null,options:null,ancestors:null},init({indirections:e=[],reference:t,namespace:n,options:r,ancestors:i=[]}){this.indirections=e,this.namespace=n,this.reference=t,this.options=r,this.ancestors=[...i]},methods:{toBaseURI(e){return XJ(this.reference.uri,YJ(HJ(e)))},toAncestorLineage(e){const t=new WeakSet(e.filter(ZT));return[[...this.ancestors,t],t]},async toReference(e){if(this.reference.depth>=this.options.resolve.maxDepth)throw new lV(`Maximum resolution depth of ${this.options.resolve.maxDepth} has been exceeded by file "${this.reference.uri}"`);const t=this.toBaseURI(e),{refSet:n}=this.reference;if(n.has(t))return n.find(vx(t,"uri"));const r=await jV(KJ(t),nG(nG({},this.options),{},{parse:nG(nG({},this.options.parse),{},{mediaType:"text/plain"})})),i=PV({uri:t,value:r,depth:this.reference.depth+1});return n.add(i),i},async ReferenceElement(e,t,n,r,i){var s,o,c,a,u;const[f,l]=this.toAncestorLineage([...i,n]);if(f.some((t=>t.has(e))))return!1;if(!this.options.resolve.external&&eL(e))return!1;const h=await this.toReference(null===(s=e.$ref)||void 0===s?void 0:s.toValue()),p=h.uri,m=XJ(p,null===(o=e.$ref)||void 0===o?void 0:o.toValue());this.indirections.push(e);const d=lI(m);let v=fI(d,h.value.result);if(pR(v)){const t=e.meta.get("referenced-element").toValue();if(kM(v))v=cB.refract(v),v.setMetaProperty("referenced-element",t);else{v=this.namespace.getElementClass(t).refract(v)}}if(this.indirections.includes(v))throw new Error("Recursive Reference Object detected");if(this.indirections.length>this.options.dereference.maxDepth)throw new mV(`Maximum dereference depth of "${this.options.dereference.maxDepth}" has been exceeded in file "${this.reference.uri}"`);l.add(e);const y=iG({reference:h,namespace:this.namespace,indirections:[...this.indirections],options:this.options,ancestors:f});v=await rG(v,y,{keyMap:SB,nodeTypeGetter:xB}),l.delete(e),this.indirections.pop(),v=v.clone(),v.setMetaProperty("ref-fields",{$ref:null===(c=e.$ref)||void 0===c?void 0:c.toValue(),description:null===(a=e.description)||void 0===a?void 0:a.toValue(),summary:null===(u=e.summary)||void 0===u?void 0:u.toValue()}),v.setMetaProperty("ref-origin",h.uri);const b=mx(Cx,["description"],e),j=mx(Cx,["summary"],e);return b&&GE("description",v)&&(v.description=e.description),j&&GE("summary",v)&&(v.summary=e.summary),this.indirections.pop(),v},async PathItemElement(e,t,n,r,i){var s,o,c;const[a,u]=this.toAncestorLineage([...i,n]);if(!eR(e.$ref))return;if(a.some((t=>t.has(e))))return!1;if(!this.options.resolve.external&&KB(e))return;const f=await this.toReference(null===(s=e.$ref)||void 0===s?void 0:s.toValue()),l=f.uri,h=XJ(l,null===(o=e.$ref)||void 0===o?void 0:o.toValue());this.indirections.push(e);const p=lI(h);let m=fI(p,f.value.result);if(pR(m)&&(m=iB.refract(m)),this.indirections.includes(m))throw new Error("Recursive Path Item Object reference detected");if(this.indirections.length>this.options.dereference.maxDepth)throw new mV(`Maximum dereference depth of "${this.options.dereference.maxDepth}" has been exceeded in file "${this.reference.uri}"`);u.add(e);const d=iG({reference:f,namespace:this.namespace,indirections:[...this.indirections],options:this.options,ancestors:a});m=await rG(m,d,{keyMap:SB,nodeTypeGetter:xB}),u.delete(e),this.indirections.pop();const v=new iB([...m.content],m.meta.clone(),m.attributes.clone());return e.forEach(((e,t,n)=>{v.remove(t.toValue()),v.content.push(n)})),v.remove("$ref"),v.setMetaProperty("ref-fields",{$ref:null===(c=e.$ref)||void 0===c?void 0:c.toValue()}),v.setMetaProperty("ref-origin",f.uri),v},async LinkElement(e){if(!eR(e.operationRef)&&!eR(e.operationId))return;if(!this.options.resolve.external&&GB(e))return;if(eR(e.operationRef)&&eR(e.operationId))throw new Error("LinkElement operationRef and operationId fields are mutually exclusive.");let t;if(eR(e.operationRef)){var n,r,i;const s=lI(null===(n=e.operationRef)||void 0===n?void 0:n.toValue()),o=await this.toReference(null===(r=e.operationRef)||void 0===r?void 0:r.toValue());t=fI(s,o.value.result),pR(t)&&(t=nB.refract(t)),t=new nB([...t.content],t.meta.clone(),t.attributes.clone()),t.setMetaProperty("ref-origin",o.uri),null===(i=e.operationRef)||void 0===i||i.meta.set("operation",t)}else if(eR(e.operationId)){var s,o;const n=null===(s=e.operationId)||void 0===s?void 0:s.toValue();if(t=GR((e=>WB(e)&&e.operationId.equals(n)),this.reference.value.result),Nx(t))throw new Error(`OperationElement(operationId=${n}) not found.`);null===(o=e.operationId)||void 0===o||o.meta.set("operation",t)}},async ExampleElement(e){var t;if(!eR(e.externalValue))return;if(!this.options.resolve.external&&eR(e.externalValue))return;if(e.hasKey("value")&&eR(e.externalValue))throw new Error("ExampleElement value and externalValue fields are mutually exclusive.");const n=await this.toReference(null===(t=e.externalValue)||void 0===t?void 0:t.toValue()),r=new n.value.result.constructor(n.value.result.content,n.value.result.meta.clone(),n.value.result.attributes.clone());r.setMetaProperty("ref-origin",n.uri),e.value=r},async SchemaElement(e,t,n,r,i){var s;const[o,c]=this.toAncestorLineage([...i,n]);if(!eR(e.$ref))return;if(o.some((t=>t.has(e))))return!1;let{reference:a}=this,{uri:u}=a;const f=CV(u,e),l=HJ(f),h=ZJ({uri:l}),p=ux((e=>e.canRead(h)),this.options.resolve.resolvers),m=!p,d=m&&u!==l;if(!this.options.resolve.external&&d)return;let v;this.indirections.push(e);try{if(p||m){v=_V(f,qV(a.value.result))}else{a=await this.toReference(KJ(f));const e=lI(f);v=qV(fI(e,a.value.result))}}catch(e){if(!(m&&e instanceof RV))throw e;if(FV(MV(f))){a=await this.toReference(KJ(f)),u=a.uri;const e=MV(f);v=NV(e,qV(a.value.result))}else{a=await this.toReference(KJ(f)),u=a.uri;const e=lI(f);v=qV(fI(e,a.value.result))}}if(this.indirections.includes(v))throw new Error("Recursive Schema Object reference detected");if(this.indirections.length>this.options.dereference.maxDepth)throw new mV(`Maximum dereference depth of "${this.options.dereference.maxDepth}" has been exceeded in file "${this.reference.uri}"`);c.add(e);const y=iG({reference:a,namespace:this.namespace,indirections:[...this.indirections],options:this.options,ancestors:o});if(v=await rG(v,y,{keyMap:SB,nodeTypeGetter:xB}),c.delete(e),this.indirections.pop(),sL(v)){var b;const t=v.clone();return t.setMetaProperty("ref-fields",{$ref:null===(b=e.$ref)||void 0===b?void 0:b.toValue()}),t.setMetaProperty("ref-origin",a.uri),t}const j=new lB([...v.content],v.meta.clone(),v.attributes.clone());return e.forEach(((e,t,n)=>{j.remove(t.toValue()),j.content.push(n)})),j.remove("$ref"),j.setMetaProperty("ref-fields",{$ref:null===(s=e.$ref)||void 0===s?void 0:s.toValue()}),j.setMetaProperty("ref-origin",a.uri),j}}}),sG=iG,oG=SR[Symbol.for("nodejs.util.promisify.custom")],cG=TT(SV,{init(){this.name="openapi-3-1"},methods:{canDereference(e){var t;return"text/plain"!==e.mediaType?pI.includes(e.mediaType):HB(null===(t=e.parseResult)||void 0===t?void 0:t.result)},async dereference(e,t){const n=PT(bB),r=gE($V(),t.dereference.refSet);let i;r.has(e.uri)?i=r.find(vx(e.uri,"uri")):(i=PV({uri:e.uri,value:e.parseResult}),r.add(i));const s=sG({reference:i,namespace:n,options:t}),o=await oG(r.rootRef.value,s,{keyMap:SB,nodeTypeGetter:xB});return null===t.dereference.refSet&&r.clean(),o}}}),aG=cG,uG=e=>{const t=(e=>e.slice(2))(e);return t.reduce(((e,n,r)=>{if(oR(n)){const t=String(n.key.toValue());e.push(t)}else if(sR(t[r-2])){const i=t[r-2].content.indexOf(n);e.push(i)}return e}),[])},fG=e=>{if(null==e.cause)return e;let{cause:t}=e;for(;null!=t.cause;)t=t.cause;return t},lG=Zy("SchemaRefError",(function(e,t,n){this.originalError=n,Object.assign(this,t||{})})),{wrapError:hG}=Eb,pG=SR[Symbol.for("nodejs.util.promisify.custom")],mG=sG.compose({props:{useCircularStructures:!0,allowMetaPatches:!1,basePath:null},init(e){let{allowMetaPatches:t=this.allowMetaPatches,useCircularStructures:n=this.useCircularStructures,basePath:r=this.basePath}=e;this.allowMetaPatches=t,this.useCircularStructures=n,this.basePath=r},methods:{async ReferenceElement(e,t,n,r,i){try{const[t,r]=this.toAncestorLineage([...i,n]);if(dR(["cycle"],e.$ref))return!1;if(t.some((t=>t.has(e))))return!1;if(!this.options.resolve.external&&eL(e))return!1;const s=await this.toReference(e.$ref.toValue()),o=s.uri,c=XJ(o,e.$ref.toValue());this.indirections.push(e);const a=lI(c);let u=fI(a,s.value.result);if(pR(u)){const t=e.meta.get("referenced-element").toValue();if(kM(u))u=cB.refract(u),u.setMetaProperty("referenced-element",t);else{const e=this.namespace.getElementClass(t);u=e.refract(u)}}if(this.indirections.includes(u))throw new Error("Recursive JSON Pointer detected");if(this.indirections.length>this.options.dereference.maxDepth)throw new mV(`Maximum dereference depth of "${this.options.dereference.maxDepth}" has been exceeded in file "${this.reference.uri}"`);if(!this.useCircularStructures){if(t.some((e=>e.has(u)))){if(VJ(o)||JJ(o)){const t=new cB({$ref:c},e.meta.clone(),e.attributes.clone());return t.get("$ref").classes.push("cycle"),t}return!1}}r.add(e);const f=mG({reference:s,namespace:this.namespace,indirections:[...this.indirections],options:this.options,ancestors:t,allowMetaPatches:this.allowMetaPatches,useCircularStructures:this.useCircularStructures,basePath:this.basePath??[...uG([...i,n,e]),"$ref"]});u=await pG(u,f,{keyMap:SB,nodeTypeGetter:xB}),r.delete(e),this.indirections.pop(),u=u.clone(),u.setMetaProperty("ref-fields",{$ref:e.$ref?.toValue(),description:e.description?.toValue(),summary:e.summary?.toValue()}),u.setMetaProperty("ref-origin",s.uri);const l=void 0!==e.description,h=void 0!==e.summary;if(l&&"description"in u&&(u.description=e.description),h&&"summary"in u&&(u.summary=e.summary),this.allowMetaPatches&&iR(u)){const e=u;if(void 0===e.get("$$ref")){const t=XJ(o,c);e.set("$$ref",t)}}return u}catch(t){const r=fG(t),s=hG(r,{baseDoc:this.reference.uri,$ref:e.$ref.toValue(),pointer:lI(e.$ref.toValue()),fullPath:this.basePath??[...uG([...i,n,e]),"$ref"]});return void this.options.dereference.dereferenceOpts?.errors?.push?.(s)}},async PathItemElement(e,t,n,r,i){try{const[t,r]=this.toAncestorLineage([...i,n]);if(!eR(e.$ref))return;if(dR(["cycle"],e.$ref))return!1;if(t.some((t=>t.has(e))))return!1;if(!this.options.resolve.external&&KB(e))return;const s=await this.toReference(e.$ref.toValue()),o=s.uri,c=XJ(o,e.$ref.toValue());this.indirections.push(e);const a=lI(c);let u=fI(a,s.value.result);if(pR(u)&&(u=iB.refract(u)),this.indirections.includes(u))throw new Error("Recursive JSON Pointer detected");if(this.indirections.length>this.options.dereference.maxDepth)throw new mV(`Maximum dereference depth of "${this.options.dereference.maxDepth}" has been exceeded in file "${this.reference.uri}"`);if(!this.useCircularStructures){if(t.some((e=>e.has(u)))){if(VJ(o)||JJ(o)){const t=new iB({$ref:c},e.meta.clone(),e.attributes.clone());return t.get("$ref").classes.push("cycle"),t}return!1}}r.add(e);const f=mG({reference:s,namespace:this.namespace,indirections:[...this.indirections],options:this.options,ancestors:t,allowMetaPatches:this.allowMetaPatches,useCircularStructures:this.useCircularStructures,basePath:this.basePath??[...uG([...i,n,e]),"$ref"]});u=await pG(u,f,{keyMap:SB,nodeTypeGetter:xB}),r.delete(e),this.indirections.pop();const l=new iB([...u.content],u.meta.clone(),u.attributes.clone());if(e.forEach(((e,t,n)=>{l.remove(t.toValue()),l.content.push(n)})),l.remove("$ref"),l.setMetaProperty("ref-fields",{$ref:e.$ref?.toValue()}),l.setMetaProperty("ref-origin",s.uri),this.allowMetaPatches&&void 0===l.get("$$ref")){const e=XJ(o,c);l.set("$$ref",e)}return l}catch(t){const r=fG(t),s=hG(r,{baseDoc:this.reference.uri,$ref:e.$ref.toValue(),pointer:lI(e.$ref.toValue()),fullPath:this.basePath??[...uG([...i,n,e]),"$ref"]});return void this.options.dereference.dereferenceOpts?.errors?.push?.(s)}},async SchemaElement(e,t,n,r,i){try{const[t,r]=this.toAncestorLineage([...i,n]);if(!eR(e.$ref))return;if(dR(["cycle"],e.$ref))return!1;if(t.some((t=>t.has(e))))return!1;let{reference:s}=this,{uri:o}=s;const c=CV(o,e),a=HJ(c),u=ZJ({uri:a}),f=!this.options.resolve.resolvers.some((e=>e.canRead(u))),l=!f,h=l&&o!==a;if(!this.options.resolve.external&&h)return;let p;this.indirections.push(e);try{if(f||l){p=_V(c,qV(s.value.result))}else{s=await this.toReference(KJ(c)),o=s.uri;const e=lI(c);p=qV(fI(e,s.value.result))}}catch(e){if(!(l&&e instanceof RV))throw e;if(FV(MV(c))){s=await this.toReference(KJ(c)),o=s.uri;const e=MV(c);p=NV(e,qV(s.value.result))}else{s=await this.toReference(KJ(c)),o=s.uri;const e=lI(c);p=qV(fI(e,s.value.result))}}if(this.indirections.includes(p))throw new Error("Recursive Schema Object reference detected");if(this.indirections.length>this.options.dereference.maxDepth)throw new mV(`Maximum dereference depth of "${this.options.dereference.maxDepth}" has been exceeded in file "${this.reference.uri}"`);if(!this.useCircularStructures){if(t.some((e=>e.has(p)))){if(VJ(o)||JJ(o)){const t=XJ(o,c),n=new lB({$ref:t},e.meta.clone(),e.attributes.clone());return n.get("$ref").classes.push("cycle"),n}return!1}}r.add(e);const m=mG({reference:s,namespace:this.namespace,indirections:[...this.indirections],options:this.options,useCircularStructures:this.useCircularStructures,allowMetaPatches:this.allowMetaPatches,ancestors:t,basePath:this.basePath??[...uG([...i,n,e]),"$ref"]});if(p=await pG(p,m,{keyMap:SB,nodeTypeGetter:xB}),r.delete(e),this.indirections.pop(),sL(p)){const t=p.clone();return t.setMetaProperty("ref-fields",{$ref:e.$ref?.toValue()}),t.setMetaProperty("ref-origin",o),t}const d=new lB([...p.content],p.meta.clone(),p.attributes.clone());if(e.forEach(((e,t,n)=>{d.remove(t.toValue()),d.content.push(n)})),d.remove("$ref"),d.setMetaProperty("ref-fields",{$ref:e.$ref?.toValue()}),d.setMetaProperty("ref-origin",o),this.allowMetaPatches&&void 0===d.get("$$ref")){const e=XJ(o,c);d.set("$$ref",e)}return d}catch(t){const r=fG(t),s=new lG(`Could not resolve reference: ${r.message}`,{baseDoc:this.reference.uri,$ref:e.$ref.toValue(),fullPath:this.basePath??[...uG([...i,n,e]),"$ref"]},r);return void this.options.dereference.dereferenceOpts?.errors?.push?.(s)}},async LinkElement(){},async ExampleElement(e,t,n,r,i){try{return await sG.compose.methods.ExampleElement.call(this,e,t,n,r,i)}catch(t){const r=fG(t),s=hG(r,{baseDoc:this.reference.uri,externalValue:e.externalValue?.toValue(),fullPath:this.basePath??[...uG([...i,n,e]),"externalValue"]});return void this.options.dereference.dereferenceOpts?.errors?.push?.(s)}}}}),dG=aG.compose.bind(),vG=dG({init(e){let{parameterMacro:t,options:n}=e;this.parameterMacro=t,this.options=n},props:{parameterMacro:null,options:null,macroOperation:null,OperationElement:{enter(e){this.macroOperation=e},leave(){this.macroOperation=null}},ParameterElement:{leave(e,t,n,r,i){const s=null===this.macroOperation?null:sI(this.macroOperation),o=sI(e);try{const t=this.parameterMacro(s,o);e.set("default",t)}catch(e){const t=new Error(e,{cause:e});t.fullPath=uG([...i,n]),this.options.dereference.dereferenceOpts?.errors?.push?.(t)}}}}}),yG=dG({init(e){let{modelPropertyMacro:t,options:n}=e;this.modelPropertyMacro=t,this.options=n},props:{modelPropertyMacro:null,options:null,SchemaElement:{leave(e,t,n,r,i){void 0!==e.properties&&iR(e.properties)&&e.properties.forEach((t=>{if(iR(t))try{const e=this.modelPropertyMacro(sI(t));t.set("default",e)}catch(t){const r=new Error(t,{cause:t});r.fullPath=[...uG([...i,n,e]),"properties"],this.options.dereference.dereferenceOpts?.errors?.push?.(r)}}))}}}}),bG=dG({init(e){let{options:t}=e;this.options=t},props:{options:null,SchemaElement:{leave(e,t,n,r,i){if(void 0===e.allOf)return;if(!sR(e.allOf)){const t=new TypeError("allOf must be an array");return t.fullPath=[...uG([...i,n,e]),"allOf"],void this.options.dereference.dereferenceOpts?.errors?.push?.(t)}if(e.allOf.isEmpty)return new lB(e.content.filter((e=>"allOf"!==e.key.toValue())),e.meta.clone(),e.attributes.clone());if(!e.allOf.content.every(iL)){const t=new TypeError("Elements in allOf must be objects");return t.fullPath=[...uG([...i,n,e]),"allOf"],void this.options.dereference.dereferenceOpts?.errors?.push?.(t)}const s=rI.all([...e.allOf.content,e]);if(e.hasKey("$$ref")||s.remove("$$ref"),e.hasKey("example")){s.getMember("example").value=e.get("example")}if(e.hasKey("examples")){s.getMember("examples").value=e.get("examples")}return s.remove("allOf"),s}}}}),jG=SR[Symbol.for("nodejs.util.promisify.custom")],gG=aG.compose({props:{useCircularStructures:!0,allowMetaPatches:!1,parameterMacro:null,modelPropertyMacro:null,mode:"non-strict",ancestors:null},init(){let{useCircularStructures:e=this.useCircularStructures,allowMetaPatches:t=this.allowMetaPatches,parameterMacro:n=this.parameterMacro,modelPropertyMacro:r=this.modelPropertyMacro,mode:i=this.mode,ancestors:s=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.name="openapi-3-1-swagger-client",this.useCircularStructures=e,this.allowMetaPatches=t,this.parameterMacro=n,this.modelPropertyMacro=r,this.mode=i,this.ancestors=[...s]},methods:{async dereference(e,t){const n=[],r=PT(bB),i=t.dereference.refSet??$V();let s;i.has(e.uri)?s=i.find((t=>t.uri===e.uri)):(s=PV({uri:e.uri,value:e.parseResult}),i.add(s));const o=mG({reference:s,namespace:r,options:t,useCircularStructures:this.useCircularStructures,allowMetaPatches:this.allowMetaPatches,ancestors:this.ancestors});if(n.push(o),"function"==typeof this.parameterMacro){const e=vG({parameterMacro:this.parameterMacro,options:t});n.push(e)}if("function"==typeof this.modelPropertyMacro){const e=yG({modelPropertyMacro:this.modelPropertyMacro,options:t});n.push(e)}if("strict"!==this.mode){const e=bG({options:t});n.push(e)}const c=GT(n,{nodeTypeGetter:xB}),a=await jG(i.rootRef.value,c,{keyMap:SB,nodeTypeGetter:xB});return null===t.dereference.refSet&&i.clean(),a}}}),wG=async e=>{const{spec:t,timeout:n,redirects:r,requestInterceptor:i,responseInterceptor:s,pathDiscriminator:o=[],allowMetaPatches:c=!1,useCircularStructures:a=!1,skipNormalization:u=!1,parameterMacro:f=null,modelPropertyMacro:l=null,mode:h="non-strict"}=e;try{const{cache:m}=wG,d=VJ(WJ())?WJ():"https://smartbear.com/",v=Kv(e),y=XJ(d,v);let b;m.has(t)?b=m.get(t):(b=tB.refract(t),b.classes.push("result"),m.set(t,b));const j=new OT([b]),g=0===(p=o).length?"":`/${p.map(aI).join("/")}`,w=""===g?"":`#${g}`,O=fI(g,b),E=PV({uri:y,value:j}),x=$V({refs:[E]});""!==g&&(x.rootRef=null);const S=[new WeakSet([O])],P=[],$=((e,t,n)=>WR({element:n}).transclude(e,t))(O,await AV(O,{resolve:{baseURI:`${y}${w}`,resolvers:[YV({timeout:n||1e4,redirects:r||10})],resolverOpts:{swaggerHTTPClientConfig:{requestInterceptor:i,responseInterceptor:s}},strategies:[HV()]},parse:{mediaType:pI.latest(),parsers:[ZV({allowEmpty:!1,sourceMap:!1}),eG({allowEmpty:!1,sourceMap:!1}),KV({allowEmpty:!1,sourceMap:!1}),QV({allowEmpty:!1,sourceMap:!1}),TV({allowEmpty:!1,sourceMap:!1})]},dereference:{maxDepth:100,strategies:[gG({allowMetaPatches:c,useCircularStructures:a,parameterMacro:f,modelPropertyMacro:l,mode:h,ancestors:S})],refSet:x,dereferenceOpts:{errors:P}}}),b),A=u?$:WV($);return{spec:sI(A),errors:P}}catch(e){if(e instanceof cI||e instanceof oI)return{spec:null,errors:[]};throw e}var p};wG.cache=new WeakMap;const OG={name:"openapi-3-1-apidom",match(e){let{spec:t}=e;return Yb(t)},normalize(e){let{spec:t}=e;return XV(WV)(t)},resolve:async e=>wG(e)};function EG(e,t,n){if(!e||"object"!=typeof e||!e.paths||"object"!=typeof e.paths)return null;const{paths:r}=e;for(const i in r)for(const s in r[i]){if("PARAMETERS"===s.toUpperCase())continue;const o=r[i][s];if(!o||"object"!=typeof o)continue;const c={spec:e,pathName:i,method:s.toUpperCase(),operation:o},a=t(c);if(n&&a)return c}}function xG(e,t){return`${t.toLowerCase()}-${e}`}function SG(e,t){return e&&e.paths?function(e,t){return EG(e,t,!0)||null}(e,(e=>{let{pathName:n,method:r,operation:i}=e;if(!i||"object"!=typeof i)return!1;const s=i.operationId;return[Gb(i,n,r),xG(n,r),s].some((e=>e&&e===t))})):null}const PG=()=>null,$G={mapTagOperations:function(e){let{spec:t,cb:n=PG,defaultTag:r="default",v2OperationIdCompatibilityMode:i}=e;const s={},o={};return EG(t,(e=>{let{pathName:c,method:a,operation:u}=e;var f;(u.tags?(f=u.tags,Array.isArray(f)?f:[f]):[r]).forEach((e=>{if("string"!=typeof e)return;o[e]=o[e]||{};const r=o[e],f=Gb(u,c,a,{v2OperationIdCompatibilityMode:i}),l=n({spec:t,pathName:c,method:a,operation:u,operationId:f});if(s[f])s[f]+=1,r[`${f}${s[f]}`]=l;else if(void 0!==r[f]){const e=s[f]||1;s[f]=e+1,r[`${f}${s[f]}`]=l;const t=r[f];delete r[f],r[`${f}${e}`]=t}else r[f]=l}))})),o},makeExecute:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let{pathName:n,method:r,operationId:i}=t;return function(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{requestInterceptor:o,responseInterceptor:c,userFetch:a}=e;return e.execute(vl({spec:e.spec,requestInterceptor:o,responseInterceptor:c,userFetch:a,pathName:n,method:r,parameters:t,operationId:i},s))}}}};var AG={
/*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
parse:function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var n={},r=(t||{}).decode||IG,i=0;for(;i<e.length;){var s=e.indexOf("=",i);if(-1===s)break;var o=e.indexOf(";",i);if(-1===o)o=e.length;else if(o<s){i=e.lastIndexOf(";",s-1)+1;continue}var c=e.slice(i,s).trim();if(void 0===n[c]){var a=e.slice(s+1,o).trim();34===a.charCodeAt(0)&&(a=a.slice(1,-1)),n[c]=FG(a,r)}i=o+1}return n},serialize:function(e,t,n){var r=n||{},i=r.encode||kG;if("function"!=typeof i)throw new TypeError("option encode is invalid");if(!RG.test(e))throw new TypeError("argument name is invalid");var s=i(t);if(s&&!RG.test(s))throw new TypeError("argument val is invalid");var o=e+"="+s;if(null!=r.maxAge){var c=r.maxAge-0;if(isNaN(c)||!isFinite(c))throw new TypeError("option maxAge is invalid");o+="; Max-Age="+Math.floor(c)}if(r.domain){if(!RG.test(r.domain))throw new TypeError("option domain is invalid");o+="; Domain="+r.domain}if(r.path){if(!RG.test(r.path))throw new TypeError("option path is invalid");o+="; Path="+r.path}if(r.expires){var a=r.expires;if(!function(e){return"[object Date]"===TG.call(e)||e instanceof Date}(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");o+="; Expires="+a.toUTCString()}r.httpOnly&&(o+="; HttpOnly");r.secure&&(o+="; Secure");if(r.priority){switch("string"==typeof r.priority?r.priority.toLowerCase():r.priority){case"low":o+="; Priority=Low";break;case"medium":o+="; Priority=Medium";break;case"high":o+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o}},TG=Object.prototype.toString,RG=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function IG(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function kG(e){return encodeURIComponent(e)}function FG(e,t){try{return t(e)}catch(t){return e}}
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/function MG(e){return"[object Object]"===Object.prototype.toString.call(e)}function NG(e){var t,n;return!1!==MG(e)&&(void 0===(t=e.constructor)||!1!==MG(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}const CG={body:function(e){let{req:t,value:n}=e;t.body=n},header:function(e){let{req:t,parameter:n,value:r}=e;t.headers=t.headers||{},void 0!==r&&(t.headers[n.name]=r)},query:function(e){let{req:t,value:n,parameter:r}=e;t.query=t.query||{},!1===n&&"boolean"===r.type&&(n="false");0===n&&["number","integer"].indexOf(r.type)>-1&&(n="0");if(n)t.query[r.name]={collectionFormat:r.collectionFormat,value:n};else if(r.allowEmptyValue&&void 0!==n){const e=r.name;t.query[e]=t.query[e]||{},t.query[e].allowEmptyValue=!0}},path:function(e){let{req:t,value:n,parameter:r}=e;t.url=t.url.split(`{${r.name}}`).join(encodeURIComponent(n))},formData:function(e){let{req:t,value:n,parameter:r}=e;(n||r.allowEmptyValue)&&(t.form=t.form||{},t.form[r.name]={value:n,allowEmptyValue:r.allowEmptyValue,collectionFormat:r.collectionFormat})}};function DG(e,t){return t.includes("application/json")?"string"==typeof e?e:JSON.stringify(e):e.toString()}const qG=["accept","authorization","content-type"];const _G=Object.freeze(Object.defineProperty({__proto__:null,cookie:function(e){let{req:t,parameter:n,value:r}=e;t.headers=t.headers||{};const i=typeof r;if(n.content){const e=Object.keys(n.content)[0];t.headers.Cookie=`${n.name}=${DG(r,e)}`}else if("undefined"!==i){const e="object"===i&&!Array.isArray(r)&&n.explode?"":`${n.name}=`;t.headers.Cookie=e+kv({key:n.name,value:r,escape:!1,style:n.style||"form",explode:void 0!==n.explode&&n.explode})}},header:function(e){let{req:t,parameter:n,value:r}=e;if(t.headers=t.headers||{},!(qG.indexOf(n.name.toLowerCase())>-1))if(n.content){const e=Object.keys(n.content)[0];t.headers[n.name]=DG(r,e)}else void 0!==r&&(t.headers[n.name]=kv({key:n.name,value:r,style:n.style||"simple",explode:void 0!==n.explode&&n.explode,escape:!1}))},path:function(e){let{req:t,value:n,parameter:r}=e;const{name:i,style:s,explode:o,content:c}=r;if(c){const e=Object.keys(c)[0];return void(t.url=t.url.split(`{${i}}`).join(Iv(DG(n,e),{escape:!0})))}const a=kv({key:r.name,value:n,style:s||"simple",explode:o||!1,escape:!0});t.url=t.url.split(`{${i}}`).join(a)},query:function(e){let{req:t,value:n,parameter:r}=e;if(t.query=t.query||{},r.content){const e=DG(n,Object.keys(r.content)[0]);if(e)t.query[r.name]=e;else if(r.allowEmptyValue&&void 0!==n){const e=r.name;t.query[e]=t.query[e]||{},t.query[e].allowEmptyValue=!0}}else if(!1===n&&(n="false"),0===n&&(n="0"),n){const{style:e,explode:i,allowReserved:s}=r;t.query[r.name]={value:n,serializationOption:{style:e,explode:i,allowReserved:s}}}else if(r.allowEmptyValue&&void 0!==n){const e=r.name;t.query[e]=t.query[e]||{},t.query[e].allowEmptyValue=!0}}},Symbol.toStringTag,{value:"Module"})),BG="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:window,{btoa:LG}=BG;function UG(e,t){const{operation:n,requestBody:r,securities:i,spec:s,attachContentTypeForEmptyPayload:o}=e;let{requestContentType:c}=e;t=function(e){let{request:t,securities:n={},operation:r={},spec:i}=e;const s=vl({},t),{authorized:o={}}=n,c=r.security||i.security||[],a=o&&!!Object.keys(o).length,u=xw(i,["components","securitySchemes"])||{};if(s.headers=s.headers||{},s.query=s.query||{},!Object.keys(n).length||!a||!c||Array.isArray(r.security)&&!r.security.length)return t;return c.forEach((e=>{Object.keys(e).forEach((e=>{const t=o[e],n=u[e];if(!t)return;const r=t.value||t,{type:i}=n;if(t)if("apiKey"===i)"query"===n.in&&(s.query[n.name]=r),"header"===n.in&&(s.headers[n.name]=r),"cookie"===n.in&&(s.cookies[n.name]=r);else if("http"===i){if(/^basic$/i.test(n.scheme)){const e=r.username||"",t=r.password||"",n=LG(`${e}:${t}`);s.headers.Authorization=`Basic ${n}`}/^bearer$/i.test(n.scheme)&&(s.headers.Authorization=`Bearer ${r}`)}else if("oauth2"===i||"openIdConnect"===i){const e=t.token||{},r=e[n["x-tokenName"]||"access_token"];let i=e.token_type;i&&"bearer"!==i.toLowerCase()||(i="Bearer"),s.headers.Authorization=`${i} ${r}`}}))})),s}({request:t,securities:i,operation:n,spec:s});const a=n.requestBody||{},u=Object.keys(a.content||{}),f=c&&u.indexOf(c)>-1;if(r||o){if(c&&f)t.headers["Content-Type"]=c;else if(!c){const e=u[0];e&&(t.headers["Content-Type"]=e,c=e)}}else c&&f&&(t.headers["Content-Type"]=c);if(!e.responseContentType&&n.responses){const e=Object.entries(n.responses).filter((e=>{let[t,n]=e;const r=parseInt(t,10);return r>=200&&r<300&&NG(n.content)})).reduce(((e,t)=>{let[,n]=t;return e.concat(Object.keys(n.content))}),[]);e.length>0&&(t.headers.accept=e.join(", "))}if(r)if(c){if(u.indexOf(c)>-1)if("application/x-www-form-urlencoded"===c||"multipart/form-data"===c)if("object"==typeof r){const e=(a.content[c]||{}).encoding||{};t.form={},Object.keys(r).forEach((n=>{t.form[n]={value:r[n],encoding:e[n]||{}}}))}else t.form=r;else t.body=r}else t.body=r;return t}function JG(e,t){const{spec:n,operation:r,securities:i,requestContentType:s,responseContentType:o,attachContentTypeForEmptyPayload:c}=e;if(t=function(e){let{request:t,securities:n={},operation:r={},spec:i}=e;const s=vl({},t),{authorized:o={},specSecurity:c=[]}=n,a=r.security||c,u=o&&!!Object.keys(o).length,f=i.securityDefinitions;if(s.headers=s.headers||{},s.query=s.query||{},!Object.keys(n).length||!u||!a||Array.isArray(r.security)&&!r.security.length)return t;return a.forEach((e=>{Object.keys(e).forEach((e=>{const t=o[e];if(!t)return;const{token:n}=t,r=t.value||t,i=f[e],{type:c}=i,a=i["x-tokenName"]||"access_token",u=n&&n[a];let l=n&&n.token_type;if(t)if("apiKey"===c){const e="query"===i.in?"query":"headers";s[e]=s[e]||{},s[e][i.name]=r}else if("basic"===c)if(r.header)s.headers.authorization=r.header;else{const e=r.username||"",t=r.password||"";r.base64=LG(`${e}:${t}`),s.headers.authorization=`Basic ${r.base64}`}else"oauth2"===c&&u&&(l=l&&"bearer"!==l.toLowerCase()?l:"Bearer",s.headers.authorization=`${l} ${u}`)}))})),s}({request:t,securities:i,operation:r,spec:n}),t.body||t.form||c)s?t.headers["Content-Type"]=s:Array.isArray(r.consumes)?[t.headers["Content-Type"]]=r.consumes:Array.isArray(n.consumes)?[t.headers["Content-Type"]]=n.consumes:r.parameters&&r.parameters.filter((e=>"file"===e.type)).length?t.headers["Content-Type"]="multipart/form-data":r.parameters&&r.parameters.filter((e=>"formData"===e.in)).length&&(t.headers["Content-Type"]="application/x-www-form-urlencoded");else if(s){const e=r.parameters&&r.parameters.filter((e=>"body"===e.in)).length>0,n=r.parameters&&r.parameters.filter((e=>"formData"===e.in)).length>0;(e||n)&&(t.headers["Content-Type"]=s)}return!o&&Array.isArray(r.produces)&&r.produces.length>0&&(t.headers.accept=r.produces.join(", ")),t}const VG=["http","fetch","spec","operationId","pathName","method","parameters","securities"],GG=e=>Array.isArray(e)?e:[],zG=Zy("OperationNotFoundError",(function(e,t,n){this.originalError=n,Object.assign(this,t||{})})),HG={buildRequest:WG};function WG(e){const{spec:t,operationId:n,responseContentType:r,scheme:i,requestInterceptor:s,responseInterceptor:o,contextUrl:c,userFetch:a,server:u,serverVariables:f,http:l,signal:h}=e;let{parameters:p,parameterBuilders:m}=e;const d=Kb(t);m||(m=d?_G:CG);let v={url:"",credentials:l&&l.withCredentials?"include":"same-origin",headers:{},cookies:{}};h&&(v.signal=h),s&&(v.requestInterceptor=s),o&&(v.responseInterceptor=o),a&&(v.userFetch=a);const y=SG(t,n);if(!y)throw new zG(`Operation ${n} not found`);const{operation:b={},method:j,pathName:g}=y;if(v.url+=YG({spec:t,scheme:i,contextUrl:c,server:u,serverVariables:f,pathName:g,method:j}),!n)return delete v.cookies,v;v.url+=g,v.method=`${j}`.toUpperCase(),p=p||{};const w=t.paths[g]||{};r&&(v.headers.accept=r);const O=(e=>{const t={};e.forEach((e=>{t[e.in]||(t[e.in]={}),t[e.in][e.name]=e}));const n=[];return Object.keys(t).forEach((e=>{Object.keys(t[e]).forEach((r=>{n.push(t[e][r])}))})),n})([].concat(GG(b.parameters)).concat(GG(w.parameters)));O.forEach((e=>{const n=m[e.in];let r;if("body"===e.in&&e.schema&&e.schema.properties&&(r=p),r=e&&e.name&&p[e.name],void 0===r?r=e&&e.name&&p[`${e.in}.${e.name}`]:((e,t)=>t.filter((t=>t.name===e)))(e.name,O).length>1&&console.warn(`Parameter '${e.name}' is ambiguous because the defined spec has more than one parameter with the name: '${e.name}' and the passed-in parameter values did not define an 'in' value.`),null!==r){if(void 0!==e.default&&void 0===r&&(r=e.default),void 0===r&&e.required&&!e.allowEmptyValue)throw new Error(`Required parameter ${e.name} is not provided`);if(d&&e.schema&&"object"===e.schema.type&&"string"==typeof r)try{r=JSON.parse(r)}catch(e){throw new Error("Could not parse object parameter value string as JSON")}n&&n({req:v,parameter:e,value:r,operation:b,spec:t})}}));const E=vl(vl({},e),{},{operation:b});if(v=d?UG(E,v):JG(E,v),v.cookies&&Object.keys(v.cookies).length){const e=Object.keys(v.cookies).reduce(((e,t)=>{const n=v.cookies[t];return e+(e?"&":"")+AG.serialize(t,n)}),"");v.headers.Cookie=e}return v.cookies&&delete v.cookies,Xv(v),v}const XG=e=>e?e.replace(/\W/g,""):null;function YG(e){return Kb(e.spec)?function(e){let{spec:t,pathName:n,method:r,server:i,contextUrl:s,serverVariables:o={}}=e;const c=xw(t,["paths",n,(r||"").toLowerCase(),"servers"])||xw(t,["paths",n,"servers"])||xw(t,["servers"]);let a="",u=null;if(i&&c&&c.length){const e=c.map((e=>e.url));e.indexOf(i)>-1&&(a=i,u=c[e.indexOf(i)])}!a&&c&&c.length&&(a=c[0].url,[u]=c);if(a.indexOf("{")>-1){const e=function(e){const t=[],n=/{([^}]+)}/g;let r;for(;r=n.exec(e);)t.push(r[1]);return t}(a);e.forEach((e=>{if(u.variables&&u.variables[e]){const t=u.variables[e],n=o[e]||t.default,r=new RegExp(`{${e}}`,"g");a=a.replace(r,n)}}))}return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e&&t?yl.parse(yl.resolve(t,e)):yl.parse(e),r=yl.parse(t),i=XG(n.protocol)||XG(r.protocol)||"",s=n.host||r.host,o=n.pathname||"";let c;c=i&&s?`${i}://${s+o}`:o;return"/"===c[c.length-1]?c.slice(0,-1):c}(a,s)}(e):function(e){let{spec:t,scheme:n,contextUrl:r=""}=e;const i=yl.parse(r),s=Array.isArray(t.schemes)?t.schemes[0]:null,o=n||s||XG(i.protocol)||"http",c=t.host||i.host||"",a=t.basePath||"";let u;u=o&&c?`${o}://${c+a}`:a;return"/"===u[u.length-1]?u.slice(0,-1):u}(e)}function KG(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof e?t.url=e:t=e,!(this instanceof KG))return new KG(t);Object.assign(this,t);const n=this.resolve().then((()=>(this.disableInterfaces||Object.assign(this,KG.makeApisTagOperation(this)),this)));return n.client=this,n}KG.http=Nv,KG.makeHttp=function(e,t,n){return n=n||(e=>e),t=t||(e=>e),r=>("string"==typeof r&&(r={url:r}),Mv.mergeInQueryOrForm(r),r=t(r),n(e(r)))}.bind(null,KG.http),KG.resolveStrategies={"openapi-3-1-apidom":OG,"openapi-3-0":Zb,"openapi-2-0":Qb,generic:Wb},KG.resolve=ej({strategies:[KG.resolveStrategies["openapi-3-1-apidom"],KG.resolveStrategies["openapi-3-0"],KG.resolveStrategies["openapi-2-0"],KG.resolveStrategies.generic]}),KG.resolveSubtree=(e=>async function(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=vl(vl({},e),r);return Sw(t,n,i)})({strategies:[KG.resolveStrategies["openapi-3-1-apidom"],KG.resolveStrategies["openapi-3-0"],KG.resolveStrategies["openapi-2-0"],KG.resolveStrategies.generic]}),KG.execute=function(e){let{http:t,fetch:n,spec:r,operationId:i,pathName:s,method:o,parameters:c,securities:a}=e,u=BT(e,VG);const f=t||n||Nv;s&&o&&!i&&(i=xG(s,o));const l=HG.buildRequest(vl({spec:r,operationId:i,parameters:c,securities:a,http:f},u));return l.body&&(NG(l.body)||Array.isArray(l.body))&&(l.body=JSON.stringify(l.body)),f(l)},KG.serializeRes=qv,KG.serializeHeaders=Bv,KG.clearCache=function(){Ub.refs.clearCache()},KG.makeApisTagOperation=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=$G.makeExecute(e);return{apis:$G.mapTagOperations({v2OperationIdCompatibilityMode:e.v2OperationIdCompatibilityMode,spec:e.spec,cb:t})}},KG.buildRequest=WG,KG.helpers={opId:Gb},KG.getBaseUrl=YG,KG.apidom={resolve:{resolvers:{HttpResolverSwaggerClient:YV}},parse:{parsers:{JsonParser:KV,YamlParser:QV,OpenApiJson3_1Parser:ZV,OpenApiYaml3_1Parser:eG}},dereference:{strategies:{OpenApi3_1SwaggerClientDereferenceStrategy:gG}}},KG.prototype={http:Nv,execute(e){return this.applyDefaults(),KG.execute(vl({spec:this.spec,http:this.http,securities:{authorized:this.authorizations},contextUrl:"string"==typeof this.url?this.url:void 0,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null},e))},resolve(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return KG.resolve(vl({spec:this.spec,url:this.url,http:this.http||this.fetch,allowMetaPatches:this.allowMetaPatches,useCircularStructures:this.useCircularStructures,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null,skipNormalization:this.skipNormalization||!1},e)).then((e=>(this.originalSpec=this.spec,this.spec=e.spec,this.errors=e.errors,this)))}},KG.prototype.applyDefaults=function(){const{spec:e}=this,t=this.url;if(t&&t.startsWith("http")){const n=yl.parse(t);e.host||(e.host=n.host),e.schemes||(e.schemes=[n.protocol.replace(":","")]),e.basePath||(e.basePath="/")}};function QG(e){const t=(e=e.replace("[]","Array")).split("/");return t[0]=t[0].replace(/[^A-Za-z0-9_\-\.]+|\s+/gm,"_"),t.join("/")}const ZG={parameterTypeProperties:["format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","minLength","maxLength","multipleOf","minItems","maxItems","uniqueItems","minProperties","maxProperties","additionalProperties","pattern","enum","default"],arrayProperties:["items","minItems","maxItems","uniqueItems"],httpMethods:["get","post","put","delete","patch","head","options","trace"],uniqueOnly:function(e,t,n){return n.indexOf(e)===t},createHash:function(e){let t,n=0;if(0===e.length)return n;for(let r=0;r<e.length;r++)t=e.charCodeAt(r),n=(n<<5)-n+t,n|=0;return n},sanitise:QG,sanitiseAll:function(e){return QG(e.split("/").join("_"))},camelize:function(e){return e.toLowerCase().replace(/[-_ \/\.](.)/g,((e,t)=>t.toUpperCase()))},clone:function(e){return JSON.parse(JSON.stringify(e))},circularClone:function e(t,n=null){if(n||(n=new WeakMap),Object(t)!==t||t instanceof Function)return t;if(n.has(t))return n.get(t);let r;try{r=new t.constructor}catch(e){r=Object.create(Object.getPrototypeOf(t))}return n.set(t,r),Object.assign(r,...Object.keys(t).map((r=>({[r]:e(t[r],n)}))))}};function ez(){return{depth:0,seen:new WeakMap,top:!0,combine:!1,allowRefSiblings:!1}}const tz={getDefaultState:ez,walkSchema:function e(t,n,r,i){if(void 0===r.depth&&(r=ez()),null==t)return t;if(r.combine&&(t.allOf&&Array.isArray(t.allOf)&&1===t.allOf.length&&delete(t={...t.allOf[0],...t})?.allOf,t?.anyOf&&Array.isArray(t.anyOf)&&1===t.anyOf.length&&delete(t={...t.anyOf[0],...t})?.anyOf,t?.oneOf&&Array.isArray(t.oneOf)&&1===t.oneOf.length&&delete(t={...t.oneOf[0],...t})?.oneOf),i(t,n,r),r.seen.has(t))return t;if("object"==typeof t&&null!==t&&r.seen.set(t,!0),r.top=!1,r.depth++,void 0!==t?.items&&(r.property="items",e(t.items,t,r,i)),t?.additionalItems&&"object"==typeof t.additionalItems&&(r.property="additionalItems",e(t.additionalItems,t,r,i)),t?.additionalProperties&&"object"==typeof t.additionalProperties&&(r.property="additionalProperties",e(t.additionalProperties,t,r,i)),t?.properties)for(const n in t.properties){const s=t.properties[n];r.property=`properties/${n}`,e(s,t,r,i)}if(t?.patternProperties)for(const n in t.patternProperties){const s=t.patternProperties[n];r.property=`patternProperties/${n}`,e(s,t,r,i)}if(t?.allOf)for(const n in t.allOf){const s=t.allOf[n];r.property=`allOf/${n}`,e(s,t,r,i)}if(t?.anyOf)for(const n in t.anyOf){const s=t.anyOf[n];r.property=`anyOf/${n}`,e(s,t,r,i)}if(t?.oneOf)for(const n in t.oneOf){const s=t.oneOf[n];r.property=`oneOf/${n}`,e(s,t,r,i)}return t?.not&&(r.property="not",e(t.not,t,r,i)),r.depth--,t}};function nz(e,t,n){if(t||(t={depth:0}),t.depth||(t={path:"#",depth:0,pkey:"",parent:{},payload:{},seen:new WeakMap,identity:!1,identityDetection:!1,...t}),"object"!=typeof e)return;const r=t.path;for(const i in e){if(t.key=i,t.path=`${t.path}/${encodeURIComponent(i)}`,t.identityPath=t.seen.get(e[i]),t.identity=void 0!==t.identityPath,e.hasOwnProperty(i)&&n(e,i,t),"object"==typeof e[i]&&!t.identity){t.identityDetection&&!Array.isArray(e[i])&&null!==e[i]&&t.seen.set(e[i],t.path);const r={};r.parent=e,r.path=t.path,r.depth=t.depth?t.depth+1:1,r.pkey=i,r.payload=t.payload,r.seen=t.seen,r.identity=!1,r.identityDetection=t.identityDetection,nz(e[i],r,n)}t.path=r}}let rz;function iz(e,t){for(const n in e)n.startsWith("x-")&&!n.startsWith("x-s2o")&&(t[n]=e[n])}function sz(e,t){tz.walkSchema(e,{},{},((e,n)=>{!function(e){if(e["x-required"]&&Array.isArray(e["x-required"])&&(e.required||(e.required=[]),e.required=e.required.concat(e["x-required"]),delete e["x-required"]),e["x-anyOf"]&&(e.anyOf=e["x-anyOf"],delete e["x-anyOf"]),e["x-oneOf"]&&(e.oneOf=e["x-oneOf"],delete e["x-oneOf"]),e["x-not"]&&(e.not=e["x-not"],delete e["x-not"]),"boolean"==typeof e["x-nullable"]&&(e.nullable=e["x-nullable"],delete e["x-nullable"]),"object"==typeof e["x-discriminator"]&&"string"==typeof e["x-discriminator"].propertyName){e.discriminator=e["x-discriminator"],delete e["x-discriminator"];for(const t in e.discriminator.mapping){const n=e.discriminator.mapping[t];n.startsWith("#/definitions/")&&(e.discriminator.mapping[t]=n.replace("#/definitions/","#/components/schemas/"))}}}(e),function(e,t,n){if(e.nullable&&n.patches++,e.discriminator&&"string"==typeof e.discriminator&&(e.discriminator={propertyName:e.discriminator}),e.items&&Array.isArray(e.items)&&(0===e.items.length?e.items={}:1===e.items.length?e.items=e.items[0]:e.items={anyOf:e.items}),e.type&&Array.isArray(e.type)){if(n.patches++,n.warnings.push("(Patchable) schema type must not be an array"),0===e.type.length)delete e.type;else{e.oneOf||(e.oneOf=[]);for(const t of e.type){const n={};if("null"===t)e.nullable=!0;else{n.type=t;for(const t of ZG.arrayProperties)void 0!==e.prop&&(n[t]=e[t],delete e[t])}n.type&&e.oneOf.push(n)}delete e.type,0===e.oneOf.length?delete e.oneOf:e.oneOf.length<2&&(e.type=e.oneOf[0].type,Object.keys(e.oneOf[0]).length>1&&(n.patches++,n.warnings.push("Lost properties from oneOf")),delete e.oneOf)}e.type&&Array.isArray(e.type)&&1===e.type.length&&(e.type=e.type[0])}e.type&&"null"===e.type&&(delete e.type,e.nullable=!0),"array"!==e.type||e.items||(e.items={}),"file"===e.type&&(e.type="string",e.format="binary"),"boolean"==typeof e.required&&(e.required&&e.name&&(void 0===t.required&&(t.required=[]),Array.isArray(t.required)&&t.required.push(e.name)),delete e.required),e.xml&&"string"==typeof e.xml.namespace&&(e.xml.namespace||delete e.xml.namespace),e.allowEmptyValue&&(delete e.allowEmptyValue,n.patches++,n.warnings.push("(Patchable): deleted schema.allowEmptyValue"))}(e,n,t)}))}function oz(e){for(const t in e)for(const n in e[t]){const r=ZG.sanitise(n);n!==r&&(e[t][r]=e[t][n],delete e[t][n])}}function cz(e,t){if("basic"===e.type&&(e.type="http",e.scheme="basic"),"oauth2"===e.type){const n={};let r=e.flow;"application"===e.flow&&(r="clientCredentials"),"accessCode"===e.flow&&(r="authorizationCode"),"string"==typeof e.authorizationUrl&&(n.authorizationUrl=e.authorizationUrl.split("?")[0].trim()||"/"),"string"==typeof e.tokenUrl&&(n.tokenUrl=e.tokenUrl.split("?")[0].trim()||"/"),n.scopes=e.scopes||{},e.flows={},e.flows[r]=n,delete e.flow,delete e.authorizationUrl,delete e.tokenUrl,delete e.scopes,e.name&&(delete e.name,t.patches++,t.warnings.push("(Patchable) oauth2 securitySchemes should not have name property"))}}function az(e){return e&&!e["x-s2o-delete"]}function uz(e,t){if(e.type&&!e.schema&&(e.schema={}),e.type&&(e.schema.type=e.type),e.items&&"array"!==e.items.type){if(e.items.collectionFormat!==e.collectionFormat)return t.errCount++,void t.errors.push({message:"Nested collectionFormats are not supported",pointer:"/.../responses/header"});delete e.items.collectionFormat}"array"===e.type?("ssv"===e.collectionFormat?(t.patches++,t.warnings.push("collectionFormat:ssv is no longer supported for headers")):"pipes"===e.collectionFormat?(t.patches++,t.warnings.push("collectionFormat:pipes is no longer supported for headers")):"multi"===e.collectionFormat?e.explode=!0:"tsv"===e.collectionFormat?(e["x-collectionFormat"]="tsv",t.patches++,t.warnings.push("collectionFormat:tsv is no longer supported")):e.style="simple",delete e.collectionFormat):e.collectionFormat&&(delete e.collectionFormat,t.patches++,t.warnings.push("(Patchable) collectionFormat is only applicable to header.type array")),delete e.type;for(const t of ZG.parameterTypeProperties)void 0!==e[t]&&(e.schema[t]=e[t],delete e[t]);for(const t of ZG.arrayProperties)void 0!==e[t]&&(e.schema[t]=e[t],delete e[t])}function fz(e,t,n,r,i,s,o){const c={};let a,u=!0;t&&t.consumes&&"string"==typeof t.consumes&&(t.consumes=[t.consumes],o.patches++,o.warnings.push("(Patchable) operation.consumes must be an array")),Array.isArray(s.consumes)||delete s.consumes;const f=((t?t.consumes:null)||s.consumes||[]).filter(ZG.uniqueOnly);if(e&&(e.name||e.in)){"boolean"==typeof e["x-deprecated"]&&(e.deprecated=e["x-deprecated"],delete e["x-deprecated"]),void 0!==e["x-example"]&&(e.example=e["x-example"],delete e["x-example"]),"body"===e.in||e.type||(e.type="string",o.patches++,o.warnings.push("(Patchable) parameter.type is mandatory for non-body parameters")),"file"===e.type&&(e["x-s2o-originalType"]=e.type,a=e.type),null===e.description&&delete e.description;let t=e.collectionFormat;if("array"!==e.type||t||(t="csv"),t&&("array"!==e.type&&(delete e.collectionFormat,o.patches++,o.warnings.push("(Patchable) collectionFormat is only applicable to param.type array")),"csv"!==t||"query"!==e.in&&"cookie"!==e.in||(e.style="form",e.explode=!1),"csv"!==t||"path"!==e.in&&"header"!==e.in||(e.style="simple"),"ssv"===t&&("query"===e.in?e.style="spaceDelimited":o.warnings.push(`${e.name} collectionFormat:ssv is no longer supported except for in:query parameters`)),"pipes"===t&&("query"===e.in?e.style="pipeDelimited":o.warnings.push(`${e.name} collectionFormat:pipes is no longer supported except for in:query parameters`)),"multi"===t&&(e.explode=!0),"tsv"===t&&(o.warnings.push("collectionFormat:tsv is no longer supported"),e["x-collectionFormat"]="tsv"),delete e.collectionFormat),e.type&&"body"!==e.type&&"formData"!==e.in)if(e.items&&e.schema)o.warnings.push(`${e.name} parameter has array,items and schema`);else{e.schema&&o.patches++,e.schema&&"object"==typeof e.schema||(e.schema={}),e.schema.type=e.type,e.items&&(e.schema.items=e.items,delete e.items,nz(e.schema.items,null,((n,r)=>{"collectionFormat"===r&&"string"==typeof n[r]&&(t&&n[r]!==t&&o.warnings.push(`${e.name} Nested collectionFormats are not supported`),delete n[r])})));for(const t of ZG.parameterTypeProperties)void 0!==e[t]&&(e.schema[t]=e[t]),delete e[t]}e.schema&&sz(e.schema,o),e["x-ms-skip-url-encoding"]&&"query"===e.in&&(e.allowReserved=!0,delete e["x-ms-skip-url-encoding"])}if(e&&"formData"===e.in){u=!1,c.content={};let t="application/x-www-form-urlencoded";if(f.length&&f.indexOf("multipart/form-data")>=0&&(t="multipart/form-data"),c.content[t]={},e.schema)c.content[t].schema=e.schema;else{c.content[t].schema={},c.content[t].schema.type="object",c.content[t].schema.properties={},c.content[t].schema.properties[e.name]={};const n=c.content[t].schema,r=c.content[t].schema.properties[e.name];e.description&&(r.description=e.description),e.example&&(r.example=e.example),e.type&&(r.type=e.type);for(const t of ZG.parameterTypeProperties)void 0!==e[t]&&(r[t]=e[t]);!0===e.required&&(n.required||(n.required=[]),n.required.push(e.name),c.required=!0),void 0!==e.default&&(r.default=e.default),r.properties&&(r.properties=e.properties),e.allOf&&(r.allOf=e.allOf),"array"===e.type&&e.items&&(r.items=e.items,r.items.collectionFormat&&delete r.items.collectionFormat),"file"!==a&&"file"!==e["x-s2o-originalType"]||(r.type="string",r.format="binary"),iz(e,r)}}else e&&"file"===e.type&&(e.required&&(c.required=e.required),c.content={},c.content["application/octet-stream"]={},c.content["application/octet-stream"].schema={},c.content["application/octet-stream"].schema.type="string",c.content["application/octet-stream"].schema.format="binary",iz(e,c));if(e&&"body"===e.in){c.content={},e.name&&(c["x-s2o-name"]=(t&&t.operationId?ZG.sanitiseAll(t.operationId):"")+ZG.camelize(`_${e.name}`)),e.description&&(c.description=e.description),e.required&&(c.required=e.required),f.length||f.push("application/json");for(const t of f)c.content[t]={},c.content[t].schema=ZG.clone(e.schema||{}),sz(c.content[t].schema,o);iz(e,c)}if(Object.keys(c).length>0&&(e["x-s2o-delete"]=!0,t))if(t.requestBody&&u){t.requestBody["x-s2o-overloaded"]=!0;const e=t.operationId||i;o.warnings.push(`Operation ${e} has multiple requestBodies`)}else t.requestBody||(t=function(e,t){const n={};for(const r of Object.keys(e))n[r]=e[r],"parameters"===r&&(n.requestBody={},t.rbname&&(n[t.rbname]=""));return n.requestBody={},n}(t,o),n[r]=t),t.requestBody.content&&t.requestBody.content["multipart/form-data"]&&t.requestBody.content["multipart/form-data"].schema&&t.requestBody.content["multipart/form-data"].schema.properties&&c.content["multipart/form-data"]&&c.content["multipart/form-data"].schema&&c.content["multipart/form-data"].schema.properties?(t.requestBody.content["multipart/form-data"].schema.properties=Object.assign(t.requestBody.content["multipart/form-data"].schema.properties,c.content["multipart/form-data"].schema.properties),t.requestBody.content["multipart/form-data"].schema.required=(t.requestBody.content["multipart/form-data"].schema.required||[]).concat(c.content["multipart/form-data"].schema.required||[]),t.requestBody.content["multipart/form-data"].schema.required.length||delete t.requestBody.content["multipart/form-data"].schema.required):t.requestBody.content&&t.requestBody.content["application/x-www-form-urlencoded"]&&t.requestBody.content["application/x-www-form-urlencoded"].schema&&t.requestBody.content["application/x-www-form-urlencoded"].schema.properties&&c.content["application/x-www-form-urlencoded"]&&c.content["application/x-www-form-urlencoded"].schema&&c.content["application/x-www-form-urlencoded"].schema.properties?(t.requestBody.content["application/x-www-form-urlencoded"].schema.properties=Object.assign(t.requestBody.content["application/x-www-form-urlencoded"].schema.properties,c.content["application/x-www-form-urlencoded"].schema.properties),t.requestBody.content["application/x-www-form-urlencoded"].schema.required=(t.requestBody.content["application/x-www-form-urlencoded"].schema.required||[]).concat(c.content["application/x-www-form-urlencoded"].schema.required||[]),t.requestBody.content["application/x-www-form-urlencoded"].schema.required.length||delete t.requestBody.content["application/x-www-form-urlencoded"].schema.required):(t.requestBody=Object.assign(t.requestBody,c),t.requestBody["x-s2o-name"]||t.operationId&&(t.requestBody["x-s2o-name"]=ZG.sanitiseAll(t.operationId)));if(e&&!e["x-s2o-delete"]){delete e.type;for(const t of ZG.parameterTypeProperties)delete e[t];"path"!==e.in||void 0!==e.required&&!0===e.required||(e.required=!0,o.patches++,o.warnings.push(`(Patchable) path parameters must be required:true [${e.name} in ${i}]`))}return t}function lz(e,t,n,r){if(!e)return!1;if(e.description||"object"!=typeof e||Array.isArray(e)||(r.patches++,r.warnings.push("(Patchable) response.description is mandatory")),void 0!==e.schema){sz(e.schema,r),t&&t.produces&&"string"==typeof t.produces&&(t.produces=[t.produces],r.patches++,r.warnings.push("(Patchable) operation.produces must be an array")),n.produces&&!Array.isArray(n.produces)&&delete n.produces;const i=((t?t.produces:null)||n.produces||[]).filter(ZG.uniqueOnly);i.length||i.push("*/*"),e.content={};for(const t of i){if(e.content[t]={},e.content[t].schema=ZG.clone(e.schema),e.examples&&e.examples[t]){const n={};n.value=e.examples[t],e.content[t].examples={},e.content[t].examples.response=n,delete e.examples[t]}"file"===e.content[t].schema.type&&(e.content[t].schema={type:"string",format:"binary"})}delete e.schema}for(const t in e.examples)e.content||(e.content={}),e.content[t]||(e.content[t]={}),e.content[t].examples={},e.content[t].examples.response={},e.content[t].examples.response.value=e.examples[t];if(delete e.examples,e.headers)for(const t in e.headers)"status code"===t.toLowerCase()?(delete e.headers[t],r.patches++,r.warnings.push('(Patchable) "Status Code" is not a valid header')):uz(e.headers[t],r)}function hz(e,t,n,r,i){for(const s in e){const o=e[s];o&&o["x-trace"]&&"object"==typeof o["x-trace"]&&(o.trace=o["x-trace"],delete o["x-trace"]),o&&o["x-summary"]&&"string"==typeof o["x-summary"]&&(o.summary=o["x-summary"],delete o["x-summary"]),o&&o["x-description"]&&"string"==typeof o["x-description"]&&(o.description=o["x-description"],delete o["x-description"]),o&&o["x-servers"]&&Array.isArray(o["x-servers"])&&(o.servers=o["x-servers"],delete o["x-servers"]);for(const e in o)if(ZG.httpMethods.indexOf(e)>=0||"x-amazon-apigateway-any-method"===e){let c=o[e];if(c&&c.parameters&&Array.isArray(c.parameters)){if(o.parameters)for(const t of o.parameters){c.parameters.find((e=>e.name===t.name&&e.in===t.in))||"formData"!==t.in&&"body"!==t.in&&"file"!==t.type||(c=fz(t,c,o,e,s,i,n))}for(const t of c.parameters)c=fz(t,c,o,e,`${e}: ${s}`,i,n);c.parameters&&(c.parameters=c.parameters.filter(az))}if(c&&c.security&&oz(c.security),"object"==typeof c){if(!c.responses){const e={description:"Default response"};c.responses={default:e}}for(const e in c.responses){lz(c.responses[e],c,i,n)}}if(c&&c["x-servers"]&&Array.isArray(c["x-servers"]))c.servers=c["x-servers"],delete c["x-servers"];else if(c&&c.schemes&&c.schemes.length)for(const e of c.schemes)if((!i.schemes||i.schemes.indexOf(e)<0)&&(c.servers||(c.servers=[]),Array.isArray(i.servers)))for(const e of i.servers){const t=ZG.clone(e);c.servers.push(t)}if(c){if(delete c.consumes,delete c.produces,delete c.schemes,c["x-ms-examples"]){for(const e in c["x-ms-examples"]){const t=c["x-ms-examples"][e],n=ZG.sanitiseAll(e);if(t.parameters)for(const n in t.parameters){const r=t.parameters[n];for(const t of(c.parameters||[]).concat(o.parameters||[]))t.name!==n||t.example||(t.examples||(t.examples={}),t.examples[e]={value:r})}if(t.responses)for(const r in t.responses){if(t.responses[r].headers)for(const e in t.responses[r].headers){const n=t.responses[r].headers[e];for(const t in c.responses[r].headers)if(t===e){c.responses[r].headers[t].example=n}}if(t.responses[r].body&&(i.components.examples[n]={value:ZG.clone(t.responses[r].body)},c.responses[r]&&c.responses[r].content))for(const t in c.responses[r].content){const i=c.responses[r].content[t];i.examples||(i.examples={}),i.examples[e]={$ref:`#/components/examples/${n}`}}}}delete c["x-ms-examples"]}if(c.parameters&&0===c.parameters.length&&delete c.parameters,c.requestBody){const n=c.operationId?ZG.sanitiseAll(c.operationId):ZG.camelize(ZG.sanitiseAll(e+s)),i=ZG.sanitise(c.requestBody["x-s2o-name"]||n||"");delete c.requestBody["x-s2o-name"];const o=JSON.stringify(c.requestBody),a=ZG.createHash(o);if(!r[a]){const e={};e.name=i,e.body=c.requestBody,e.refs=[],r[a]=e}const u=`#/${t}/${encodeURIComponent(s)}/${e}/requestBody`;r[a].refs.push(u)}}}if(o&&o.parameters){for(const e in o.parameters){fz(o.parameters[e],null,o,null,s,i,n)}Array.isArray(o.parameters)&&(o.parameters=o.parameters.filter(az))}}}function pz(e){return e&&e.url&&"string"==typeof e.url?(e.url=e.url.split("{{").join("{"),e.url=e.url.split("}}").join("}"),e.url.replace(/\{(.+?)\}/g,((t,n)=>{e.variables||(e.variables={}),e.variables[n]={default:"unknown"}})),e):e}function mz(e,t){void 0!==e.info&&null!==e.info||(e.info={version:"",title:""},t.patches++,t.warnings.push("(Patchable) info object is mandatory")),("object"!=typeof e.info||Array.isArray(e.info))&&(t.errCount++,t.errors.push({message:"info must be an object",pointer:"/info"})),e.info&&(void 0===e.info.title&&(t.patches++,e.info.title="",t.warnings.push({message:"(Patchable) info.title cannot be null",pointer:"/info/title",patchable:!0})),void 0===e.info.version?(t.patches++,e.info.version="",t.warnings.push("(Patchable) info.version cannot be null")):"string"!=typeof e.info.version&&(t.patches++,e.info.version=e.info.version.toString(),t.warnings.push("(Patchable) info.version must be a string")))}function dz(e,t){e.paths||(t.patches++,e.paths={},t.warnings.push("(Patchable) paths object is mandatory"))}function vz(e={}){const t={original:e,openapi:{},patches:0,warnings:[],errCount:0,errors:[]};if(e.openapi&&"string"==typeof e.openapi&&e.openapi.startsWith("3."))return t.openapi=ZG.circularClone(e),mz(t.openapi,t),dz(t.openapi,t),t;if("2.0"!==e.swagger)return t.errCount++,t.errors.push({message:`Unsupported swagger/OpenAPI version: ${e.openapi?e.openapi:e.swagger}`,pointer:"/swagger"}),t;if(t.openapi=ZG.circularClone(e),t.openapi.openapi="3.0.0",delete t.openapi.swagger,nz(t.openapi,{},((e,t,n)=>{null===e[t]&&!t.startsWith("x-")&&"default"!==t&&n.path.indexOf("/example")<0&&delete e[t]})),e.host)(e.schemes||[]).forEach((n=>{const r={},i=(e.basePath||"").replace(/\/$/,"");r.url=`${n?`${n}:`:""}//${e.host}${i}`,pz(r),t.openapi.servers||(t.openapi.servers=[]),t.openapi.servers.push(r)}));else if(e.basePath){const n={};n.url=e.basePath,pz(n),t.openapi.servers||(t.openapi.servers=[]),t.openapi.servers.push(n)}if(delete t.openapi.host,delete t.openapi.basePath,e["x-ms-parameterized-host"]){const n=e["x-ms-parameterized-host"],r={};r.url=n.hostTemplate+(e.basePath?e.basePath:""),r.variables={};const i=r.url.match(/\{\w+\}/g);for(const e in n.parameters){const t=n.parameters[e];e.startsWith("x-")||(delete t.required,delete t.type,delete t.in,void 0===t.default&&(t.enum?t.default=t.enum[0]:t.default="none"),t.name||(t.name=i[e].replace("{","").replace("}","")),r.variables[t.name]=t,delete t.name)}t.openapi.servers||(t.openapi.servers=[]),!1===n.useSchemePrefix?t.openapi.servers.push(r):e.schemes.forEach((e=>{t.openapi.servers.push({...r,url:`${e}://${r.url}`})})),delete t.openapi["x-ms-parameterized-host"]}return mz(t.openapi,t),dz(t.openapi,t),"string"==typeof t.openapi.consumes&&(t.openapi.consumes=[t.openapi.consumes]),"string"==typeof t.openapi.produces&&(t.openapi.produces=[t.openapi.produces]),t.openapi.components={},t.openapi["x-callbacks"]&&(t.openapi.components.callbacks=t.openapi["x-callbacks"],delete t.openapi["x-callbacks"]),t.openapi.components.examples={},t.openapi.components.headers={},t.openapi["x-links"]&&(t.openapi.components.links=t.openapi["x-links"],delete t.openapi["x-links"]),t.openapi.components.parameters=t.openapi.parameters||{},t.openapi.components.responses=t.openapi.responses||{},t.openapi.components.requestBodies={},t.openapi.components.securitySchemes=t.openapi.securityDefinitions||{},t.openapi.components.schemas=t.openapi.definitions||{},delete t.openapi.definitions,delete t.openapi.responses,delete t.openapi.parameters,delete t.openapi.securityDefinitions,function(e){const t=e.openapi,n={};rz={schemas:{}},t.security&&oz(t.security);for(const n in t.components.securitySchemes){const r=ZG.sanitise(n);if(n!==r){if(t.components.securitySchemes[r])return e.errCount++,e.errors.push({message:`Duplicate sanitised securityScheme name ${r}`,pointer:`/components/securitySchemes/${r}`}),e;t.components.securitySchemes[r]=t.components.securitySchemes[n],delete t.components.securitySchemes[n]}cz(t.components.securitySchemes[r],e)}for(const n in t.components.schemas){const r=ZG.sanitiseAll(n);let i=0;if(n!==r){for(;t.components.schemas[r+i];)i=i?++i:2;t.components.schemas[r+i]=t.components.schemas[n],delete t.components.schemas[n]}rz.schemas[n]=r+i,sz(t.components.schemas[`${r}${i}`],e)}for(const n in t.components.parameters){const r=ZG.sanitise(n);if(n!==r){if(t.components.parameters[r])return e.errCount++,e.errors.push({message:`Duplicate sanitised parameter name ${r}`,pointer:`/components/parameters/${r}`}),e;t.components.parameters[r]=t.components.parameters[n],delete t.components.parameters[n]}fz(t.components.parameters[r],null,null,null,r,t,e)}for(const n in t.components.responses){const r=ZG.sanitise(n);if(n!==r){if(t.components.responses[r])return e.errCount++,e.errors.push({message:`Duplicate sanitised response name ${r}`,pointer:`/components/responses/${r}`}),e;t.components.responses[r]=t.components.responses[n],delete t.components.responses[n]}const i=t.components.responses[r];if(lz(i,null,t,e),i.headers)for(const t in i.headers)"status code"===t.toLowerCase()?(delete i.headers[t],e.patches++,e.warnings.push('(Patchable) "Status Code" is not a valid header')):uz(i.headers[t],e)}for(const e in t.components.requestBodies){const r=t.components.requestBodies[e],i=JSON.stringify(r),s=ZG.createHash(i),o={};o.name=e,o.body=r,o.refs=[],n[s]=o}hz(t.paths,"paths",e,n,t),t["x-ms-paths"]&&hz(t["x-ms-paths"],"x-ms-paths",e,n,t);for(const e in t.components.parameters)t.components.parameters[e]["x-s2o-delete"]&&delete t.components.parameters[e];return delete t.consumes,delete t.produces,delete t.schemes,t.components.requestBodies={},t.components.responses&&0===Object.keys(t.components.responses).length&&delete t.components.responses,t.components.parameters&&0===Object.keys(t.components.parameters).length&&delete t.components.parameters,t.components.examples&&0===Object.keys(t.components.examples).length&&delete t.components.examples,t.components.requestBodies&&0===Object.keys(t.components.requestBodies).length&&delete t.components.requestBodies,t.components.securitySchemes&&0===Object.keys(t.components.securitySchemes).length&&delete t.components.securitySchemes,t.components.headers&&0===Object.keys(t.components.headers).length&&delete t.components.headers,t.components.schemas&&0===Object.keys(t.components.schemas).length&&delete t.components.schemas,t.components&&0===Object.keys(t.components).length&&delete t.components,e}(t)}function yz(e){return e.ok&&e.text&&e.parseError&&"YAMLException"===e.parseError.name&&(!e.headers["content-type"]||e.headers["content-type"].match("text/plain"))&&(e.body=e.text),e}const bz={convertObj:vz,resolve:function(e){return new Promise((async t=>{try{const n=await KG.resolve(e,yz);if(n.errors&&n.errors.length>0)t(n);else{n.spec.openapi&&(n.resolvedSpec=n.spec,t(n));const e=vz(n.spec);e.errors&&e.errors.length>0&&(Array.isArray(n.errors)?n.errors.concat(n.errors):n.errors=e.errors),e.warnings&&e.warnings.length>0&&(n.warnings=e.warnings),n.resolvedSpec=n.spec,n.spec=e.openapi,t(n)}}catch(e){t(e)}}))}};
;// CONCATENATED MODULE: ./src/utils/spec-parser.js
/* eslint-disable no-use-before-define */
async function ProcessSpec(specUrl, generateMissingTags = false, sortTags = false, sortEndpointsBy = '', attrApiKey = '', attrApiKeyLocation = '', attrApiKeyValue = '', serverUrl = '') {
var _jsonParsedSpec$info, _jsonParsedSpec$compo;
let jsonParsedSpec;
try {
var _specMeta$resolvedSpe, _specMeta$resolvedSpe2;
this.requestUpdate(); // important to show the initial loader
let specMeta;
if (typeof specUrl === 'string') {
specMeta = await bz.resolve({
url: specUrl,
allowMetaPatches: false
}); // Swagger(specUrl);
} else {
specMeta = await bz.resolve({
spec: specUrl,
allowMetaPatches: false
}); // Swagger({ spec: specUrl });
}
await sleep(0); // important to show the initial loader (allows for rendering updates)
// If JSON Schema Viewer
if ((_specMeta$resolvedSpe = specMeta.resolvedSpec) !== null && _specMeta$resolvedSpe !== void 0 && _specMeta$resolvedSpe.jsonSchemaViewer && (_specMeta$resolvedSpe2 = specMeta.resolvedSpec) !== null && _specMeta$resolvedSpe2 !== void 0 && _specMeta$resolvedSpe2.schemaAndExamples) {
this.dispatchEvent(new CustomEvent('before-render', {
detail: {
spec: specMeta.resolvedSpec
}
}));
const schemaAndExamples = Object.entries(specMeta.resolvedSpec.schemaAndExamples).map(v => ({
show: true,
expanded: true,
selectedExample: null,
name: v[0],
elementId: v[0].replace(invalidCharsRegEx, '-'),
...v[1]
}));
const parsedSpec = {
specLoadError: false,
isSpecLoading: false,
info: specMeta.resolvedSpec.info,
schemaAndExamples
};
return parsedSpec;
}
if (specMeta.spec && (specMeta.spec.components || specMeta.spec.info || specMeta.spec.servers || specMeta.spec.tags || specMeta.spec.paths)) {
jsonParsedSpec = specMeta.spec;
this.dispatchEvent(new CustomEvent('before-render', {
detail: {
spec: jsonParsedSpec
}
}));
} else {
var _specMeta$response, _specMeta$response2, _specMeta$response3, _specMeta$response4;
console.info('RapiDoc: %c There was an issue while parsing the spec %o ', 'color:orangered', specMeta); // eslint-disable-line no-console
return {
specLoadError: true,
isSpecLoading: false,
info: {
title: 'Error loading the spec',
description: (_specMeta$response = specMeta.response) !== null && _specMeta$response !== void 0 && _specMeta$response.url ? `${(_specMeta$response2 = specMeta.response) === null || _specMeta$response2 === void 0 ? void 0 : _specMeta$response2.url} ┃ ${(_specMeta$response3 = specMeta.response) === null || _specMeta$response3 === void 0 ? void 0 : _specMeta$response3.status} ${(_specMeta$response4 = specMeta.response) === null || _specMeta$response4 === void 0 ? void 0 : _specMeta$response4.statusText}` : 'Unable to load the Spec',
version: ' '
},
tags: []
};
}
} catch (err) {
console.info('RapiDoc: %c There was an issue while parsing the spec %o ', 'color:orangered', err); // eslint-disable-line no-console
}
// const pathGroups = groupByPaths(jsonParsedSpec);
// Tags with Paths and WebHooks
const tags = groupByTags(jsonParsedSpec, sortEndpointsBy, generateMissingTags, sortTags);
// Components
const components = getComponents(jsonParsedSpec);
// Info Description Headers
const infoDescriptionHeaders = (_jsonParsedSpec$info = jsonParsedSpec.info) !== null && _jsonParsedSpec$info !== void 0 && _jsonParsedSpec$info.description ? getHeadersFromMarkdown(jsonParsedSpec.info.description) : [];
// Security Scheme
const securitySchemes = [];
if ((_jsonParsedSpec$compo = jsonParsedSpec.components) !== null && _jsonParsedSpec$compo !== void 0 && _jsonParsedSpec$compo.securitySchemes) {
const securitySchemeSet = new Set();
Object.entries(jsonParsedSpec.components.securitySchemes).forEach(kv => {
if (!securitySchemeSet.has(kv[0])) {
securitySchemeSet.add(kv[0]);
const securityObj = {
securitySchemeId: kv[0],
...kv[1]
};
securityObj.value = '';
securityObj.finalKeyValue = '';
if (kv[1].type === 'apiKey' || kv[1].type === 'http') {
securityObj.in = kv[1].in || 'header';
securityObj.name = kv[1].name || 'Authorization';
securityObj.user = '';
securityObj.password = '';
} else if (kv[1].type === 'oauth2') {
securityObj.in = 'header';
securityObj.name = 'Authorization';
securityObj.clientId = '';
securityObj.clientSecret = '';
}
securitySchemes.push(securityObj);
}
});
}
if (attrApiKey && attrApiKeyLocation && attrApiKeyValue) {
securitySchemes.push({
securitySchemeId: rapidocApiKey,
description: 'api-key provided in rapidoc element attributes',
type: 'apiKey',
oAuthFlow: '',
name: attrApiKey,
in: attrApiKeyLocation,
value: attrApiKeyValue,
finalKeyValue: attrApiKeyValue
});
}
// Updated Security Type Display Text based on Type
securitySchemes.forEach(v => {
if (v.type === 'http') {
v.typeDisplay = v.scheme === 'basic' ? 'HTTP Basic' : 'HTTP Bearer';
} else if (v.type === 'apiKey') {
v.typeDisplay = `API Key (${v.name})`;
} else if (v.type === 'oauth2') {
v.typeDisplay = `OAuth (${v.securitySchemeId})`;
} else {
v.typeDisplay = v.type || 'None';
}
});
// Servers
let servers = [];
if (jsonParsedSpec.servers && Array.isArray(jsonParsedSpec.servers)) {
jsonParsedSpec.servers.forEach(v => {
let computedUrl = v.url.trim();
if (!(computedUrl.startsWith('http') || computedUrl.startsWith('//') || computedUrl.startsWith('{'))) {
if (window.location.origin.startsWith('http')) {
v.url = window.location.origin + v.url;
computedUrl = v.url;
}
}
// Apply server-variables to generate final computed-url
if (v.variables) {
Object.entries(v.variables).forEach(kv => {
const regex = new RegExp(`{${kv[0]}}`, 'g');
computedUrl = computedUrl.replace(regex, kv[1].default || '');
kv[1].value = kv[1].default || '';
});
}
v.computedUrl = computedUrl;
});
if (serverUrl) {
jsonParsedSpec.servers.push({
url: serverUrl,
computedUrl: serverUrl
});
}
} else if (serverUrl) {
jsonParsedSpec.servers = [{
url: serverUrl,
computedUrl: serverUrl
}];
} else if (window.location.origin.startsWith('http')) {
jsonParsedSpec.servers = [{
url: window.location.origin,
computedUrl: window.location.origin
}];
} else {
jsonParsedSpec.servers = [{
url: 'http://localhost',
computedUrl: 'http://localhost'
}];
}
servers = jsonParsedSpec.servers;
const parsedSpec = {
specLoadError: false,
isSpecLoading: false,
info: jsonParsedSpec.info,
infoDescriptionHeaders,
tags,
components,
externalDocs: jsonParsedSpec.externalDocs,
securitySchemes,
servers
};
return parsedSpec;
}
function getHeadersFromMarkdown(markdownContent) {
const tokens = marked.lexer(markdownContent);
const headers = tokens.filter(v => v.type === 'heading' && v.depth <= 2);
return headers || [];
}
function getComponents(openApiSpec) {
if (!openApiSpec.components) {
return [];
}
const components = [];
for (const component in openApiSpec.components) {
const subComponents = [];
for (const sComponent in openApiSpec.components[component]) {
const scmp = {
show: true,
id: `${component.toLowerCase()}-${sComponent.toLowerCase()}`.replace(invalidCharsRegEx, '-'),
name: sComponent,
component: openApiSpec.components[component][sComponent]
};
subComponents.push(scmp);
}
let cmpDescription = component;
let cmpName = component;
switch (component) {
case 'schemas':
cmpName = 'Schemas';
cmpDescription = 'Schemas allows the definition of input and output data types. These types can be objects, but also primitives and arrays.';
break;
case 'responses':
cmpName = 'Responses';
cmpDescription = 'Describes responses from an API Operation, including design-time, static links to operations based on the response.';
break;
case 'parameters':
cmpName = 'Parameters';
cmpDescription = 'Describes operation parameters. A unique parameter is defined by a combination of a name and location.';
break;
case 'examples':
cmpName = 'Examples';
cmpDescription = 'List of Examples for operations, can be requests, responses and objects examples.';
break;
case 'requestBodies':
cmpName = 'Request Bodies';
cmpDescription = 'Describes common request bodies that are used across the API operations.';
break;
case 'headers':
cmpName = 'Headers';
cmpDescription = 'Headers follows the structure of the Parameters but they are explicitly in "header"';
break;
case 'securitySchemes':
cmpName = 'Security Schemes';
// eslint-disable-next-line max-len
cmpDescription = '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':
cmpName = 'Links';
cmpDescription = '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':
cmpName = 'Callbacks';
// eslint-disable-next-line max-len
cmpDescription = '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:
cmpName = component;
cmpDescription = component;
break;
}
const cmp = {
show: true,
name: cmpName,
description: cmpDescription,
subComponents
};
components.push(cmp);
}
return components || [];
}
function groupByTags(openApiSpec, sortEndpointsBy, generateMissingTags = false, sortTags = false) {
const supportedMethods = ['get', 'put', 'post', 'delete', 'patch', 'head', 'options']; // this is also used for ordering endpoints by methods
const tags = openApiSpec.tags && Array.isArray(openApiSpec.tags) ? openApiSpec.tags.map(v => ({
show: true,
elementId: `tag--${v.name.replace(invalidCharsRegEx, '-')}`,
name: v.name,
description: v.description || '',
headers: v.description ? getHeadersFromMarkdown(v.description) : [],
paths: [],
expanded: v['x-tag-expanded'] !== false
})) : [];
const pathsAndWebhooks = openApiSpec.paths || {};
if (openApiSpec.webhooks) {
for (const [key, value] of Object.entries(openApiSpec.webhooks)) {
value._type = 'webhook'; // eslint-disable-line no-underscore-dangle
pathsAndWebhooks[key] = value;
}
}
// For each path find the tag and push it into the corresponding tag
for (const pathOrHookName in pathsAndWebhooks) {
const commonParams = pathsAndWebhooks[pathOrHookName].parameters;
const commonPathProp = {
servers: pathsAndWebhooks[pathOrHookName].servers || [],
parameters: pathsAndWebhooks[pathOrHookName].parameters || []
};
const isWebhook = pathsAndWebhooks[pathOrHookName]._type === 'webhook'; // eslint-disable-line no-underscore-dangle
supportedMethods.forEach(methodName => {
if (pathsAndWebhooks[pathOrHookName][methodName]) {
const pathOrHookObj = openApiSpec.paths[pathOrHookName][methodName];
// If path.methods are tagged, else generate it from path
const pathTags = pathOrHookObj.tags || [];
if (pathTags.length === 0) {
if (generateMissingTags) {
const pathOrHookNameKey = pathOrHookName.replace(/^\/+|\/+$/g, '');
const firstWordEndIndex = pathOrHookNameKey.indexOf('/');
if (firstWordEndIndex === -1) {
pathTags.push(pathOrHookNameKey);
} else {
// firstWordEndIndex -= 1;
pathTags.push(pathOrHookNameKey.substr(0, firstWordEndIndex));
}
} else {
pathTags.push('General ⦂');
}
}
pathTags.forEach(tag => {
let tagObj;
let specTagsItem;
if (openApiSpec.tags) {
specTagsItem = openApiSpec.tags.find(v => v.name.toLowerCase() === tag.toLowerCase());
}
tagObj = tags.find(v => v.name === tag);
if (!tagObj) {
var _specTagsItem, _specTagsItem2;
tagObj = {
show: true,
elementId: `tag--${tag.replace(invalidCharsRegEx, '-')}`,
name: tag,
description: ((_specTagsItem = specTagsItem) === null || _specTagsItem === void 0 ? void 0 : _specTagsItem.description) || '',
headers: (_specTagsItem2 = specTagsItem) !== null && _specTagsItem2 !== void 0 && _specTagsItem2.description ? getHeadersFromMarkdown(specTagsItem.description) : [],
paths: [],
expanded: specTagsItem ? specTagsItem['x-tag-expanded'] !== false : true
};
tags.push(tagObj);
}
// Generate a short summary which is broken
let shortSummary = (pathOrHookObj.summary || pathOrHookObj.description || `${methodName.toUpperCase()} ${pathOrHookName}`).trim();
if (shortSummary.length > 100) {
[shortSummary] = shortSummary.split(/[.|!|?]\s|[\r?\n]/); // take the first line (period or carriage return)
}
// Merge Common Parameters with This methods parameters
let finalParameters = [];
if (commonParams) {
if (pathOrHookObj.parameters) {
finalParameters = commonParams.filter(commonParam => {
if (!pathOrHookObj.parameters.some(param => commonParam.name === param.name && commonParam.in === param.in)) {
return commonParam;
}
}).concat(pathOrHookObj.parameters);
} else {
finalParameters = commonParams.slice(0);
}
} else {
finalParameters = pathOrHookObj.parameters ? pathOrHookObj.parameters.slice(0) : [];
}
// Filter callbacks to contain only objects.
if (pathOrHookObj.callbacks) {
for (const [callbackName, callbackConfig] of Object.entries(pathOrHookObj.callbacks)) {
const filteredCallbacks = Object.entries(callbackConfig).filter(entry => typeof entry[1] === 'object') || [];
pathOrHookObj.callbacks[callbackName] = Object.fromEntries(filteredCallbacks);
}
}
// Update Responses
tagObj.paths.push({
show: true,
expanded: false,
isWebhook,
expandedAtLeastOnce: false,
summary: pathOrHookObj.summary || '',
description: pathOrHookObj.description || '',
externalDocs: pathOrHookObj.externalDocs,
shortSummary,
method: methodName,
path: pathOrHookName,
operationId: pathOrHookObj.operationId,
elementId: `${methodName}-${pathOrHookName.replace(invalidCharsRegEx, '-')}`,
servers: pathOrHookObj.servers ? commonPathProp.servers.concat(pathOrHookObj.servers) : commonPathProp.servers,
parameters: finalParameters,
requestBody: pathOrHookObj.requestBody,
responses: pathOrHookObj.responses,
callbacks: pathOrHookObj.callbacks,
deprecated: pathOrHookObj.deprecated,
security: pathOrHookObj.security,
// commonSummary: commonPathProp.summary,
// commonDescription: commonPathProp.description,
xBadges: pathOrHookObj['x-badges'] || undefined,
xCodeSamples: pathOrHookObj['x-codeSamples'] || pathOrHookObj['x-code-samples'] || ''
});
}); // End of tag path create
}
}); // End of Methods
}
const tagsWithSortedPaths = tags.filter(tag => tag.paths && tag.paths.length > 0);
tagsWithSortedPaths.forEach(tag => {
if (sortEndpointsBy === 'method') {
tag.paths.sort((a, b) => supportedMethods.indexOf(a.method).toString().localeCompare(supportedMethods.indexOf(b.method)));
} else if (sortEndpointsBy === 'summary') {
tag.paths.sort((a, b) => a.shortSummary.localeCompare(b.shortSummary));
} else if (sortEndpointsBy === 'path') {
tag.paths.sort((a, b) => a.path.localeCompare(b.path));
} else if (sortEndpointsBy === 'none') {
// don't sort if sortEndpointsBy is 'none'
}
tag.firstPathId = tag.paths[0].elementId;
});
return sortTags ? tagsWithSortedPaths.sort((a, b) => a.name.localeCompare(b.name)) : tagsWithSortedPaths;
}
;// CONCATENATED MODULE: ./node_modules/lit-html/directive.js
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const directive_t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},directive_e=t=>(...e)=>({_$litDirective$:t,values:e});class directive_i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
//# sourceMappingURL=directive.js.map
;// CONCATENATED MODULE: ./node_modules/lit-html/directives/unsafe-html.js
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/class unsafe_html_e extends directive_i{constructor(i){if(super(i),this.et=A,i.type!==directive_t.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===A||null==r)return this.ft=void 0,this.et=r;if(r===T)return r;if("string"!=typeof r)throw Error(this.constructor.directiveName+"() called with a non-string value");if(r===this.et)return this.ft;this.et=r;const s=[r];return s.raw=s,this.ft={_$litType$:this.constructor.resultType,strings:s,values:[]}}}unsafe_html_e.directiveName="unsafeHTML",unsafe_html_e.resultType=1;const unsafe_html_o=directive_e(unsafe_html_e);
//# sourceMappingURL=unsafe-html.js.map
;// CONCATENATED MODULE: ./node_modules/lit/directives/unsafe-html.js
//# sourceMappingURL=unsafe-html.js.map
;// CONCATENATED MODULE: ./src/templates/security-scheme-template.js
/* provided dependency */ var Buffer = __webpack_require__(764)["lW"];
/* eslint-disable arrow-body-style */
// eslint-disable-line import/extensions
const codeVerifier = '731DB1C3F7EA533B85E29492D26AA-1234567890-1234567890';
const codeChallenge = '4FatVDBJKPAo4JgLLaaQFMUcQPn5CrPRvLlaob9PTYc'; // Base64 encoded SHA-256
const localStorageKey = 'rapidoc';
function applyApiKey(securitySchemeId, username = '', password = '', providedApikeyVal = '') {
var _this$resolvedSpec$se, _securityObj$scheme;
const securityObj = (_this$resolvedSpec$se = this.resolvedSpec.securitySchemes) === null || _this$resolvedSpec$se === void 0 ? void 0 : _this$resolvedSpec$se.find(v => v.securitySchemeId === securitySchemeId);
if (!securityObj) {
return false;
}
let finalApiKeyValue = '';
if (((_securityObj$scheme = securityObj.scheme) === null || _securityObj$scheme === void 0 ? void 0 : _securityObj$scheme.toLowerCase()) === 'basic') {
if (username) {
finalApiKeyValue = `Basic ${Buffer.from(`${username}:${password}`, 'utf8').toString('base64')}`;
}
} else if (providedApikeyVal) {
var _securityObj$scheme2;
securityObj.value = providedApikeyVal;
finalApiKeyValue = `${((_securityObj$scheme2 = securityObj.scheme) === null || _securityObj$scheme2 === void 0 ? void 0 : _securityObj$scheme2.toLowerCase()) === 'bearer' ? 'Bearer ' : ''}${providedApikeyVal}`;
}
if (finalApiKeyValue) {
securityObj.finalKeyValue = finalApiKeyValue;
this.requestUpdate();
return true;
}
return false;
}
function onClearAllApiKeys() {
var _this$resolvedSpec$se2;
(_this$resolvedSpec$se2 = this.resolvedSpec.securitySchemes) === null || _this$resolvedSpec$se2 === void 0 ? void 0 : _this$resolvedSpec$se2.forEach(v => {
v.user = '';
v.password = '';
v.value = '';
v.finalKeyValue = '';
});
this.requestUpdate();
}
function getPersistedApiKeys() {
return JSON.parse(localStorage.getItem(localStorageKey)) || {};
}
function setPersistedApiKeys(obj) {
localStorage.setItem(localStorageKey, JSON.stringify(obj));
}
function recoverPersistedApiKeys() {
const rapidocLs = getPersistedApiKeys.call(this);
Object.values(rapidocLs).forEach(p => {
applyApiKey.call(this, p.securitySchemeId, p.username, p.password, p.value);
});
}
function onApiKeyChange(securitySchemeId) {
let apiKeyValue = '';
const securityObj = this.resolvedSpec.securitySchemes.find(v => v.securitySchemeId === securitySchemeId);
if (securityObj) {
const trEl = this.shadowRoot.getElementById(`security-scheme-${securitySchemeId}`);
if (trEl) {
if (securityObj.type && securityObj.scheme && securityObj.type === 'http' && securityObj.scheme.toLowerCase() === 'basic') {
const userVal = trEl.querySelector('.api-key-user').value.trim();
const passwordVal = trEl.querySelector('.api-key-password').value.trim();
applyApiKey.call(this, securitySchemeId, userVal, passwordVal);
} else {
apiKeyValue = trEl.querySelector('.api-key-input').value.trim();
applyApiKey.call(this, securitySchemeId, '', '', apiKeyValue);
}
if (this.persistAuth === 'true') {
const rapidocLs = getPersistedApiKeys.call(this);
rapidocLs[securitySchemeId] = securityObj;
setPersistedApiKeys.call(this, rapidocLs);
}
}
}
}
// Updates the OAuth Access Token (API key), so it reflects in UI and gets used in TRY calls
function updateOAuthKey(securitySchemeId, accessToken, tokenType = 'Bearer') {
const securityObj = this.resolvedSpec.securitySchemes.find(v => v.securitySchemeId === securitySchemeId);
securityObj.finalKeyValue = `${tokenType.toLowerCase() === 'bearer' ? 'Bearer' : tokenType.toLowerCase() === 'mac' ? 'MAC' : tokenType} ${accessToken}`;
this.requestUpdate();
}
/* eslint-disable no-console */
// Gets Access-Token in exchange of Authorization Code
async function fetchAccessToken(tokenUrl, clientId, clientSecret, redirectUrl, grantType, authCode, securitySchemeId, authFlowDivEl, sendClientSecretIn = 'header', scopes = null, username = null, password = null) {
const respDisplayEl = authFlowDivEl ? authFlowDivEl.querySelector('.oauth-resp-display') : undefined;
const urlFormParams = new URLSearchParams();
const headers = new Headers();
urlFormParams.append('grant_type', grantType);
if (grantType === 'authorization_code') {
urlFormParams.append('client_id', clientId);
urlFormParams.append('client_secret', clientSecret);
}
if (grantType !== 'client_credentials' && grantType !== 'password') {
urlFormParams.append('redirect_uri', redirectUrl);
}
if (authCode) {
urlFormParams.append('code', authCode);
urlFormParams.append('code_verifier', codeVerifier); // for PKCE
}
if (sendClientSecretIn === 'header') {
headers.set('Authorization', `Basic ${Buffer.from(`${clientId}:${clientSecret}`, 'utf8').toString('base64')}`);
} else if (grantType !== 'authorization_code') {
urlFormParams.append('client_id', clientId);
urlFormParams.append('client_secret', clientSecret);
}
if (grantType === 'password') {
urlFormParams.append('username', username);
urlFormParams.append('password', password);
}
if (scopes) {
urlFormParams.append('scope', scopes);
}
try {
const resp = await fetch(tokenUrl, {
method: 'POST',
headers,
body: urlFormParams
});
const tokenResp = await resp.json();
if (resp.ok) {
if (tokenResp.token_type && tokenResp.access_token) {
updateOAuthKey.call(this, securitySchemeId, tokenResp.access_token, tokenResp.token_type);
if (respDisplayEl) {
respDisplayEl.innerHTML = '<span style="color:var(--green)">Access Token Received</span>';
}
return true;
}
} else {
if (respDisplayEl) {
respDisplayEl.innerHTML = `<span style="color:var(--red)">${tokenResp.error_description || tokenResp.error_description || 'Unable to get access token'}</span>`;
}
return false;
}
} catch (err) {
if (respDisplayEl) {
respDisplayEl.innerHTML = '<span style="color:var(--red)">Failed to get access token</span>';
}
return false;
}
}
// Gets invoked when it receives the Authorization Code from the other window via message-event
async function onWindowMessageEvent(msgEvent, winObj, tokenUrl, clientId, clientSecret, redirectUrl, grantType, sendClientSecretIn, securitySchemeId, authFlowDivEl) {
sessionStorage.removeItem('winMessageEventActive');
winObj.close();
if (msgEvent.data.fake) {
return;
}
if (!msgEvent.data) {
console.warn('RapiDoc: Received no data with authorization message');
}
if (msgEvent.data.error) {
console.warn('RapiDoc: Error while receiving data');
}
if (msgEvent.data) {
if (msgEvent.data.responseType === 'code') {
// Authorization Code flow
fetchAccessToken.call(this, tokenUrl, clientId, clientSecret, redirectUrl, grantType, msgEvent.data.code, securitySchemeId, authFlowDivEl, sendClientSecretIn);
} else if (msgEvent.data.responseType === 'token') {
// Implicit flow
updateOAuthKey.call(this, securitySchemeId, msgEvent.data.access_token, msgEvent.data.token_type);
}
}
}
// code_challenge generator for PKCE flow
// TODO: Implement dynamic generation of code-challenge based on code-verifier
/*
async function generateCodeChallenge() {
const encoder = new TextEncoder();
const data = encoder.encode(codeVerifier);
const sha256Hash = await window.crypto.subtle.digest('SHA-256', data); // returns Unit8Array
// const utf8Decoder = new TextDecoder();
// const b64EncodedSha256 = btoa(utf8Decoder.decode(sha256Hash));
const b64EncodedSha256 = base64encode(sha256Hash);
return b64EncodedSha256;
}
*/
async function onInvokeOAuthFlow(securitySchemeId, flowType, authUrl, tokenUrl, e) {
const authFlowDivEl = e.target.closest('.oauth-flow');
const clientId = authFlowDivEl.querySelector('.oauth-client-id') ? authFlowDivEl.querySelector('.oauth-client-id').value.trim() : '';
const clientSecret = authFlowDivEl.querySelector('.oauth-client-secret') ? authFlowDivEl.querySelector('.oauth-client-secret').value.trim() : '';
const username = authFlowDivEl.querySelector('.api-key-user') ? authFlowDivEl.querySelector('.api-key-user').value.trim() : '';
const password = authFlowDivEl.querySelector('.api-key-password') ? authFlowDivEl.querySelector('.api-key-password').value.trim() : '';
const sendClientSecretIn = authFlowDivEl.querySelector('.oauth-send-client-secret-in') ? authFlowDivEl.querySelector('.oauth-send-client-secret-in').value.trim() : 'header';
const checkedScopeEls = [...authFlowDivEl.querySelectorAll('.scope-checkbox:checked')];
const pkceCheckboxEl = authFlowDivEl.querySelector(`#${securitySchemeId}-pkce`);
const state = `${Math.random().toString(36).slice(2, 9)}random${Math.random().toString(36).slice(2, 9)}`;
const nonce = `${Math.random().toString(36).slice(2, 9)}random${Math.random().toString(36).slice(2, 9)}`;
// const codeChallenge = await generateCodeChallenge(codeVerifier);
const redirectUrlObj = new URL(`${window.location.origin}${window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/'))}/${this.oauthReceiver}`);
let grantType = '';
let responseType = '';
let newWindow;
// clear previous error messages
const errEls = [...authFlowDivEl.parentNode.querySelectorAll('.oauth-resp-display')];
errEls.forEach(v => {
v.innerHTML = '';
});
if (flowType === 'authorizationCode' || flowType === 'implicit') {
const authUrlObj = new URL(authUrl);
if (flowType === 'authorizationCode') {
grantType = 'authorization_code';
responseType = 'code';
} else if (flowType === 'implicit') {
responseType = 'token';
}
const authCodeParams = new URLSearchParams(authUrlObj.search);
const selectedScopes = checkedScopeEls.map(v => v.value).join(' ');
if (selectedScopes) {
authCodeParams.set('scope', selectedScopes);
}
authCodeParams.set('client_id', clientId);
authCodeParams.set('redirect_uri', redirectUrlObj.toString());
authCodeParams.set('response_type', responseType);
authCodeParams.set('state', state);
authCodeParams.set('nonce', nonce);
if (pkceCheckboxEl && pkceCheckboxEl.checked) {
authCodeParams.set('code_challenge', codeChallenge);
authCodeParams.set('code_challenge_method', 'S256');
}
authCodeParams.set('show_dialog', true);
authUrlObj.search = authCodeParams.toString();
// If any older message-event-listener is active then fire a fake message to remove it (these are single time listeners)
if (sessionStorage.getItem('winMessageEventActive') === 'true') {
window.postMessage({
fake: true
}, this);
}
setTimeout(() => {
newWindow = window.open(authUrlObj.toString());
if (!newWindow) {
console.error(`RapiDoc: Unable to open ${authUrlObj.toString()} in a new window`);
} else {
sessionStorage.setItem('winMessageEventActive', 'true');
window.addEventListener('message', msgEvent => onWindowMessageEvent.call(this, msgEvent, newWindow, tokenUrl, clientId, clientSecret, redirectUrlObj.toString(), grantType, sendClientSecretIn, securitySchemeId, authFlowDivEl), {
once: true
});
}
}, 10);
} else if (flowType === 'clientCredentials') {
grantType = 'client_credentials';
const selectedScopes = checkedScopeEls.map(v => v.value).join(' ');
fetchAccessToken.call(this, tokenUrl, clientId, clientSecret, redirectUrlObj.toString(), grantType, '', securitySchemeId, authFlowDivEl, sendClientSecretIn, selectedScopes);
} else if (flowType === 'password') {
grantType = 'password';
const selectedScopes = checkedScopeEls.map(v => v.value).join(' ');
fetchAccessToken.call(this, tokenUrl, clientId, clientSecret, redirectUrlObj.toString(), grantType, '', securitySchemeId, authFlowDivEl, sendClientSecretIn, selectedScopes, username, password);
}
}
/* eslint-enable no-console */
/* eslint-disable indent */
function oAuthFlowTemplate(flowName, clientId, clientSecret, securitySchemeId, authFlow, defaultScopes = [], receiveTokenIn = 'header', receiveTokenInOptions = undefined) {
let {
authorizationUrl,
tokenUrl,
refreshUrl
} = authFlow;
const pkceOnly = authFlow['x-pkce-only'] || false;
const isUrlAbsolute = url => url.indexOf('://') > 0 || url.indexOf('//') === 0;
// Calculcate base URL
const url = new URL(this.selectedServer.computedUrl);
const baseUrl = url.origin;
if (refreshUrl && !isUrlAbsolute(refreshUrl)) {
refreshUrl = `${baseUrl}/${refreshUrl.replace(/^\//, '')}`;
}
if (tokenUrl && !isUrlAbsolute(tokenUrl)) {
tokenUrl = `${baseUrl}/${tokenUrl.replace(/^\//, '')}`;
}
if (authorizationUrl && !isUrlAbsolute(authorizationUrl)) {
authorizationUrl = `${baseUrl}/${authorizationUrl.replace(/^\//, '')}`;
}
let flowNameDisplay;
if (flowName === 'authorizationCode') {
flowNameDisplay = 'Authorization Code Flow';
} else if (flowName === 'clientCredentials') {
flowNameDisplay = 'Client Credentials Flow';
} else if (flowName === 'implicit') {
flowNameDisplay = 'Implicit Flow';
} else if (flowName === 'password') {
flowNameDisplay = 'Password Flow';
} else {
flowNameDisplay = flowName;
}
return lit_html_x`
<div class="oauth-flow ${flowName}" style="padding: 12px 0; margin-bottom:12px;">
<div class="tiny-title upper" style="margin-bottom:8px;">${flowNameDisplay}</div>
${authorizationUrl ? lit_html_x`<div style="margin-bottom:5px"><span style="width:75px; display: inline-block;">Auth URL</span> <span class="mono-font"> ${authorizationUrl} </span></div>` : ''}
${tokenUrl ? lit_html_x`<div style="margin-bottom:5px"><span style="width:75px; display: inline-block;">Token URL</span> <span class="mono-font">${tokenUrl}</span></div>` : ''}
${refreshUrl ? lit_html_x`<div style="margin-bottom:5px"><span style="width:75px; display: inline-block;">Refresh URL</span> <span class="mono-font">${refreshUrl}</span></div>` : ''}
${flowName === 'authorizationCode' || flowName === 'clientCredentials' || flowName === 'implicit' || flowName === 'password' ? lit_html_x`
${authFlow.scopes ? lit_html_x`
<span> Scopes </span>
<div class= "oauth-scopes" part="section-auth-scopes" style = "width:100%; display:flex; flex-direction:column; flex-wrap:wrap; margin:0 0 10px 24px">
${Object.entries(authFlow.scopes).map((scopeAndDescr, index) => lit_html_x`
<div class="m-checkbox" style="display:inline-flex; align-items:center">
<input type="checkbox" part="checkbox checkbox-auth-scope" class="scope-checkbox" id="${securitySchemeId}${flowName}${index}" ?checked="${defaultScopes.includes(scopeAndDescr[0])}" value="${scopeAndDescr[0]}">
<label for="${securitySchemeId}${flowName}${index}" style="margin-left:5px; cursor:pointer">
<span class="mono-font">${scopeAndDescr[0]}</span>
${scopeAndDescr[0] !== scopeAndDescr[1] ? ` - ${scopeAndDescr[1] || ''}` : ''}
</label>
</div>
`)}
</div>
` : ''}
${flowName === 'password' ? lit_html_x`
<div style="margin:5px 0">
<input type="text" value = "" placeholder="username" spellcheck="false" class="oauth2 ${flowName} ${securitySchemeId} api-key-user" part="textbox textbox-username">
<input type="password" value = "" placeholder="password" spellcheck="false" class="oauth2 ${flowName} ${securitySchemeId} api-key-password" style = "margin:0 5px;" part="textbox textbox-password">
</div>` : ''}
<div>
${flowName === 'authorizationCode' ? lit_html_x`
<div style="margin: 16px 0 4px">
<input type="checkbox" part="checkbox checkbox-auth-scope" id="${securitySchemeId}-pkce" checked ?disabled=${pkceOnly}>
<label for="${securitySchemeId}-pkce" style="margin:0 16px 0 4px; line-height:24px; cursor:pointer">
Send Proof Key for Code Exchange (PKCE)
</label>
</div>
` : ''}
<input type="text" part="textbox textbox-auth-client-id" value = "${clientId || ''}" placeholder="client-id" spellcheck="false" class="oauth2 ${flowName} ${securitySchemeId} oauth-client-id">
${flowName === 'authorizationCode' || flowName === 'clientCredentials' || flowName === 'password' ? lit_html_x`
<input
type="password" part="textbox textbox-auth-client-secret"
value = "${clientSecret || ''}" placeholder="client-secret" spellcheck="false"
class="oauth2 ${flowName} ${securitySchemeId}
oauth-client-secret"
style = "margin:0 5px;${pkceOnly ? 'display:none;' : ''}"
>
<select style="margin-right:5px;${pkceOnly ? 'display:none;' : ''}" class="${flowName} ${securitySchemeId} oauth-send-client-secret-in">
${!receiveTokenInOptions || receiveTokenInOptions.includes('header') ? lit_html_x`<option value = 'header' .selected = ${receiveTokenIn === 'header'} > Authorization Header </option>` : ''}
${!receiveTokenInOptions || receiveTokenInOptions.includes('request-body') ? lit_html_x` <option value = 'request-body' .selected = ${receiveTokenIn === 'request-body'}> Request Body </option>` : ''}
</select>` : ''}
${flowName === 'authorizationCode' || flowName === 'clientCredentials' || flowName === 'implicit' || flowName === 'password' ? lit_html_x`
<button class="m-btn thin-border" part="btn btn-outline"
@click="${e => {
onInvokeOAuthFlow.call(this, securitySchemeId, flowName, authorizationUrl, tokenUrl, e);
}}"
> GET TOKEN </button>` : ''}
</div>
<div class="oauth-resp-display red-text small-font-size"></div>
` : ''}
</div>
`;
}
function removeApiKey(securitySchemeId) {
var _this$resolvedSpec$se3;
const securityObj = (_this$resolvedSpec$se3 = this.resolvedSpec.securitySchemes) === null || _this$resolvedSpec$se3 === void 0 ? void 0 : _this$resolvedSpec$se3.find(v => v.securitySchemeId === securitySchemeId);
securityObj.user = '';
securityObj.password = '';
securityObj.value = '';
securityObj.finalKeyValue = '';
if (this.persistAuth === 'true') {
const rapidocLs = getPersistedApiKeys.call(this);
delete rapidocLs[securityObj.securitySchemeId];
setPersistedApiKeys.call(this, rapidocLs);
}
this.requestUpdate();
}
function securitySchemeTemplate() {
var _this$resolvedSpec$se4;
if (!this.resolvedSpec) {
return '';
}
const providedApiKeys = (_this$resolvedSpec$se4 = this.resolvedSpec.securitySchemes) === null || _this$resolvedSpec$se4 === void 0 ? void 0 : _this$resolvedSpec$se4.filter(v => v.finalKeyValue);
if (!providedApiKeys) {
return;
}
return lit_html_x`
<section id='auth' part="section-auth" style="text-align:left; direction:ltr; margin-top:24px; margin-bottom:24px;" class = 'observe-me ${'read focused'.includes(this.renderStyle) ? 'section-gap--read-mode' : 'section-gap '}'>
<div class='sub-title regular-font'> AUTHENTICATION </div>
<div class="small-font-size" style="display:flex; align-items: center; min-height:30px">
${providedApiKeys.length > 0 ? lit_html_x`
<div class="blue-text"> ${providedApiKeys.length} API key applied </div>
<div style="flex:1"></div>
<button class="m-btn thin-border" part="btn btn-outline" @click=${() => {
onClearAllApiKeys.call(this);
}}>CLEAR ALL API KEYS</button>` : lit_html_x`<div class="red-text">No API key applied</div>`}
</div>
${this.resolvedSpec.securitySchemes && this.resolvedSpec.securitySchemes.length > 0 ? lit_html_x`
<table role="presentation" id="auth-table" class='m-table padded-12' style="width:100%;">
${this.resolvedSpec.securitySchemes.map(v => lit_html_x`
<tr id="security-scheme-${v.securitySchemeId}" class="${v.type.toLowerCase()}">
<td style="max-width:500px; overflow-wrap: break-word;">
<div style="line-height:28px; margin-bottom:5px;">
<span style="font-weight:bold; font-size:var(--font-size-regular)">${v.typeDisplay}</span>
${v.finalKeyValue ? lit_html_x`
<span class='blue-text'> ${v.finalKeyValue ? 'Key Applied' : ''} </span>
<button class="m-btn thin-border small" part="btn btn-outline" @click=${() => {
removeApiKey.call(this, v.securitySchemeId);
}}>REMOVE</button>
` : ''}
</div>
${v.description ? lit_html_x`
<div class="m-markdown">
${unsafe_html_o(marked(v.description || ''))}
</div>` : ''}
${v.type.toLowerCase() === 'apikey' || v.type.toLowerCase() === 'http' && v.scheme.toLowerCase() === 'bearer' ? lit_html_x`
<div style="margin-bottom:5px">
${v.type.toLowerCase() === 'apikey' ? lit_html_x`Send <code>${v.name}</code> in <code>${v.in}</code>` : lit_html_x`Send <code>Authorization</code> in <code>header</code> containing the word <code>Bearer</code> followed by a space and a Token String.`}
</div>
<div style="max-height:28px;">
${v.in !== 'cookie' ? lit_html_x`
<input type = "text" value = "${v.value}" class="${v.type} ${v.securitySchemeId} api-key-input" placeholder = "api-token" spellcheck = "false">
<button class="m-btn thin-border" style = "margin-left:5px;"
part = "btn btn-outline"
@click="${e => {
onApiKeyChange.call(this, v.securitySchemeId, e);
}}">
${v.finalKeyValue ? 'UPDATE' : 'SET'}
</button>` : lit_html_x`<span class="gray-text" style="font-size::var(--font-size-small)"> cookies cannot be set from here</span>`}
</div>` : ''}
${v.type.toLowerCase() === 'http' && v.scheme.toLowerCase() === 'basic' ? lit_html_x`
<div style="margin-bottom:5px">
Send <code>Authorization</code> in <code>header</code> containing the word <code>Basic</code> followed by a space and a base64 encoded string of <code>username:password</code>.
</div>
<div>
<input type="text" value = "${v.user}" placeholder="username" spellcheck="false" class="${v.type} ${v.securitySchemeId} api-key-user" style="width:100px">
<input type="password" value = "${v.password}" placeholder="password" spellcheck="false" class="${v.type} ${v.securitySchemeId} api-key-password" style = "width:100px; margin:0 5px;">
<button class="m-btn thin-border"
@click="${e => {
onApiKeyChange.call(this, v.securitySchemeId, e);
}}"
part = "btn btn-outline"
>
${v.finalKeyValue ? 'UPDATE' : 'SET'}
</button>
</div>` : ''}
</td>
</tr>
${v.type.toLowerCase() === 'oauth2' ? lit_html_x`
<tr>
<td style="border:none; padding-left:48px">
${Object.keys(v.flows).map(f => oAuthFlowTemplate.call(this, f, v.flows[f]['x-client-id'] || v['x-client-id'] || '', v.flows[f]['x-client-secret'] || v['x-client-secret'] || '', v.securitySchemeId, v.flows[f], v.flows[f]['x-default-scopes'] || v['x-default-scopes'], v.flows[f]['x-receive-token-in'] || v['x-receive-token-in'], v.flows[f]['x-receive-token-in-options'] || v['x-receive-token-in-options']))}
</td>
</tr>
` : ''}
`)}
</table>` : ''}
<slot name="auth"></slot>
</section>
`;
}
function pathSecurityTemplate(pathSecurity) {
if (this.resolvedSpec.securitySchemes && pathSecurity) {
const orSecurityKeys1 = [];
if (Array.isArray(pathSecurity)) {
if (pathSecurity.length === 0) {
return '';
}
} else {
return '';
}
pathSecurity.forEach(pSecurity => {
const andSecurityKeys1 = [];
const andKeyTypes = [];
if (Object.keys(pSecurity).length === 0) {
orSecurityKeys1.push({
securityTypes: 'None',
securityDefs: []
});
} else {
Object.keys(pSecurity).forEach(pathSecurityKey => {
let pathScopes = '';
const s = this.resolvedSpec.securitySchemes.find(ss => ss.securitySchemeId === pathSecurityKey);
if (pSecurity[pathSecurityKey] && Array.isArray(pSecurity[pathSecurityKey])) {
pathScopes = pSecurity[pathSecurityKey].join(', ');
}
if (s) {
andKeyTypes.push(s.typeDisplay);
andSecurityKeys1.push({
...s,
...{
scopes: pathScopes
}
});
}
});
orSecurityKeys1.push({
securityTypes: andKeyTypes.length > 1 ? `${andKeyTypes[0]} + ${andKeyTypes.length - 1} more` : andKeyTypes[0],
securityDefs: andSecurityKeys1
});
}
});
return lit_html_x`<div style="position:absolute; top:3px; right:2px; font-size:var(--font-size-small); line-height: 1.5;">
<div style="position:relative; display:flex; min-width:350px; max-width:700px; justify-content: flex-end;">
<svg width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" fill="none" style="stroke:var(--fg3)"> <rect x="5" y="11" width="14" height="10" rx="2" /> <circle cx="12" cy="16" r="1" /> <path d="M8 11v-4a4 4 0 0 1 8 0v4" /></svg>
${orSecurityKeys1.map((orSecurityItem1, i) => lit_html_x`
${orSecurityItem1.securityTypes ? lit_html_x`
${i !== 0 ? lit_html_x`<div style="padding:3px 4px;"> OR </div>` : ''}
<div class="tooltip">
<div style = "padding:2px 4px; white-space:nowrap; text-overflow:ellipsis;max-width:150px; overflow:hidden;">
${this.updateRoute === 'true' && this.allowAuthentication === 'true' ? lit_html_x`<a part="anchor anchor-operation-security" href="#auth"> ${orSecurityItem1.securityTypes} </a>` : lit_html_x`${orSecurityItem1.securityTypes}`}
</div>
<div class="tooltip-text" style="position:absolute; color: var(--fg); top:26px; right:0; border:1px solid var(--border-color);padding:2px 4px; display:block;">
${orSecurityItem1.securityDefs.length > 1 ? lit_html_x`<div>Requires <b>all</b> of the following </div>` : ''}
<div style="padding-left: 8px">
${orSecurityItem1.securityDefs.map((andSecurityItem, j) => {
const scopeHtml = lit_html_x`${andSecurityItem.scopes !== '' ? lit_html_x`
<div>
<b>Required scopes:</b>
<br/>
<div style="margin-left:8px">
${andSecurityItem.scopes.split(',').map((scope, cnt) => lit_html_x`${cnt === 0 ? '' : '┃'}<span>${scope}</span>`)}
</div>
</div>` : ''}`;
return lit_html_x`
${andSecurityItem.type === 'oauth2' ? lit_html_x`
<div>
${orSecurityItem1.securityDefs.length > 1 ? lit_html_x`<b>${j + 1}.</b> &nbsp;` : 'Needs'}
OAuth Token <span style="font-family:var(--font-mono); color:var(--primary-color);">${andSecurityItem.securitySchemeId}</span> in <b>Authorization header</b>
${scopeHtml}
</div>` : andSecurityItem.type === 'http' ? lit_html_x`
<div>
${orSecurityItem1.securityDefs.length > 1 ? lit_html_x`<b>${j + 1}.</b> &nbsp;` : lit_html_x`Requires`}
${andSecurityItem.scheme === 'basic' ? 'Base 64 encoded username:password' : 'Bearer Token'} in <b>Authorization header</b>
${scopeHtml}
</div>` : lit_html_x`
<div>
${orSecurityItem1.securityDefs.length > 1 ? lit_html_x`<b>${j + 1}.</b> &nbsp;` : lit_html_x`Requires`}
Token in <b>${andSecurityItem.name} ${andSecurityItem.in}</b>
${scopeHtml}
</div>`}`;
})}
</div>
</div>
</div>
` : ''}
`)}
</div>
`;
}
return '';
}
/* eslint-enable indent */
;// CONCATENATED MODULE: ./src/templates/code-samples-template.js
// eslint-disable-line import/extensions
/* eslint-disable indent */
function codeSamplesTemplate(xCodeSamples) {
return lit_html_x`
<section class="table-title" style="margin-top:24px;">CODE SAMPLES</div>
<div class="tab-panel col"
@click="${e => {
if (!e.target.classList.contains('tab-btn')) {
return;
}
const clickedTab = e.target.dataset.tab;
const tabButtons = [...e.currentTarget.querySelectorAll('.tab-btn')];
const tabContents = [...e.currentTarget.querySelectorAll('.tab-content')];
tabButtons.forEach(tabBtnEl => tabBtnEl.classList[tabBtnEl.dataset.tab === clickedTab ? 'add' : 'remove']('active'));
tabContents.forEach(tabBodyEl => {
tabBodyEl.style.display = tabBodyEl.dataset.tab === clickedTab ? 'block' : 'none';
});
}}">
<div class="tab-buttons row" style="width:100; overflow">
${xCodeSamples.map((v, i) => lit_html_x`<button class="tab-btn ${i === 0 ? 'active' : ''}" data-tab = '${v.lang}${i}'> ${v.label || v.lang} </button>`)}
</div>
${xCodeSamples.map((v, i) => {
var _v$lang, _v$lang2, _v$lang3;
return lit_html_x`
<div class="tab-content m-markdown" style= "display:${i === 0 ? 'block' : 'none'}" data-tab = '${v.lang}${i}'>
<button class="toolbar-btn" style = "position:absolute; top:12px; right:8px" @click='${e => {
copyToClipboard(v.source, e);
}}'> Copy </button>
<pre><code class="language">${(prism_default()).languages[(_v$lang = v.lang) === null || _v$lang === void 0 ? void 0 : _v$lang.toLowerCase()] ? unsafe_html_o(prism_default().highlight(v.source, (prism_default()).languages[(_v$lang2 = v.lang) === null || _v$lang2 === void 0 ? void 0 : _v$lang2.toLowerCase()], (_v$lang3 = v.lang) === null || _v$lang3 === void 0 ? void 0 : _v$lang3.toLowerCase())) : v.source}</code></pre>
</div>`;
})}
</div>
</section>`;
}
/* eslint-enable indent */
;// CONCATENATED MODULE: ./src/templates/callback-template.js
/* eslint-disable indent */
function callbackTemplate(callbacks) {
return lit_html_x`
<div class="req-res-title" style="margin-top:12px">CALLBACKS</div>
${Object.entries(callbacks).map(kv => lit_html_x`
<div class="tiny-title" style="padding: 12px; border:1px solid var(--light-border-color)">
${kv[0]}
${Object.entries(kv[1]).map(pathObj => lit_html_x`
<div class="mono-font small-font-size" style="display:flex; margin-left:16px;">
<div style="width:100%">
${Object.entries(pathObj[1]).map(method => {
var _method$, _method$2, _method$3;
return lit_html_x`
<div>
<div style="margin-top:12px;">
<div class="method method-fg ${method[0]}" style="width:70px; border:none; margin:0; padding:0; line-height:20px; vertical-align: baseline;text-align:left">
<span style="font-size:20px;"> &#x2944; </span>
${method[0]}
</div>
<span style="line-height:20px; vertical-align: baseline;">${pathObj[0]} </span>
</div>
<div class='expanded-req-resp-container'>
<api-request
class = "${this.renderStyle}-mode callback"
style = "width:100%;"
callback = "true"
method = "${method[0] || ''}",
path = "${pathObj[0] || ''}"
.parameters = "${((_method$ = method[1]) === null || _method$ === void 0 ? void 0 : _method$.parameters) || ''}"
.request_body = "${((_method$2 = method[1]) === null || _method$2 === void 0 ? void 0 : _method$2.requestBody) || ''}"
fill-request-fields-with-example = "${this.fillRequestFieldsWithExample}"
allow-try = "false"
render-style="${this.renderStyle}"
schema-style = "${this.schemaStyle}"
active-schema-tab = "${this.defaultSchemaTab}"
schema-expand-level = "${this.schemaExpandLevel}"
schema-description-expanded = "${this.schemaDescriptionExpanded}"
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
schema-hide-read-only = "false"
schema-hide-write-only = "${this.schemaHideWriteOnly === 'never' ? 'false' : 'true'}"
fetch-credentials = "${this.fetchCredentials}"
exportparts = "wrap-request-btn:wrap-request-btn, btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, btn-clear:btn-clear, btn-clear-resp:btn-clear-resp,
file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param,
anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
> </api-request>
<api-response
style = "width:100%;"
class = "${this.renderStyle}-mode"
callback = "true"
.responses="${(_method$3 = method[1]) === null || _method$3 === void 0 ? void 0 : _method$3.responses}"
render-style="${this.renderStyle}"
schema-style="${this.schemaStyle}"
active-schema-tab = "${this.defaultSchemaTab}"
schema-expand-level = "${this.schemaExpandLevel}"
schema-description-expanded = "${this.schemaDescriptionExpanded}"
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
schema-hide-read-only = "${this.schemaHideReadOnly === 'never' ? 'false' : 'true'}"
schema-hide-write-only = "false"
exportparts = "btn:btn, btn-response-status:btn-response-status, btn-selected-response-status:btn-selected-response-status, btn-fill:btn-fill, btn-copy:btn-copy,
schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
> </api-response>
</div>
</div>
`;
})}
</div>
</div>
`)}
</div>
`)}
`;
}
/* eslint-enable indent */
;// CONCATENATED MODULE: ./node_modules/lit-html/directives/guard.js
/**
* @license
* Copyright 2018 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const guard_e={},guard_i=directive_e(class extends directive_i{constructor(){super(...arguments),this.st=guard_e}render(r,t){return t()}update(t,[s,e]){if(Array.isArray(s)){if(Array.isArray(this.st)&&this.st.length===s.length&&s.every(((r,t)=>r===this.st[t])))return T}else if(this.st===s)return T;return this.st=Array.isArray(s)?Array.from(s):s,this.render(s,e)}});
//# sourceMappingURL=guard.js.map
;// CONCATENATED MODULE: ./node_modules/lit/directives/guard.js
//# sourceMappingURL=guard.js.map
;// CONCATENATED MODULE: ./node_modules/lit-html/directive-helpers.js
/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const{I:directive_helpers_l}=Z,directive_helpers_t=o=>null===o||"object"!=typeof o&&"function"!=typeof o,directive_helpers_i={HTML:1,SVG:2},directive_helpers_n=(o,l)=>void 0===l?void 0!==(null==o?void 0:o._$litType$):(null==o?void 0:o._$litType$)===l,directive_helpers_d=o=>void 0!==(null==o?void 0:o._$litDirective$),directive_helpers_v=o=>null==o?void 0:o._$litDirective$,directive_helpers_e=o=>void 0===o.strings,directive_helpers_c=()=>document.createComment(""),directive_helpers_r=(o,t,i)=>{var n;const d=o._$AA.parentNode,v=void 0===t?o._$AB:t._$AA;if(void 0===i){const t=d.insertBefore(directive_helpers_c(),v),n=d.insertBefore(directive_helpers_c(),v);i=new directive_helpers_l(t,n,o,o.options)}else{const l=i._$AB.nextSibling,t=i._$AM,e=t!==o;if(e){let l;null===(n=i._$AQ)||void 0===n||n.call(i,o),i._$AM=o,void 0!==i._$AP&&(l=o._$AU)!==t._$AU&&i._$AP(l)}if(l!==v||e){let o=i._$AA;for(;o!==l;){const l=o.nextSibling;d.insertBefore(o,v),o=l}}}return i},directive_helpers_u=(o,l,t=o)=>(o._$AI(l,t),o),directive_helpers_f={},directive_helpers_s=(o,l=directive_helpers_f)=>o._$AH=l,directive_helpers_m=o=>o._$AH,directive_helpers_p=o=>{var l;null===(l=o._$AP)||void 0===l||l.call(o,!1,!0);let t=o._$AA;const i=o._$AB.nextSibling;for(;t!==i;){const o=t.nextSibling;t.remove(),t=o}},directive_helpers_a=o=>{o._$AR()};
//# sourceMappingURL=directive-helpers.js.map
;// CONCATENATED MODULE: ./node_modules/lit-html/directives/live.js
/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const live_l=directive_e(class extends directive_i{constructor(r){if(super(r),r.type!==directive_t.PROPERTY&&r.type!==directive_t.ATTRIBUTE&&r.type!==directive_t.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!directive_helpers_e(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(i,[t]){if(t===T||t===A)return t;const o=i.element,l=i.name;if(i.type===directive_t.PROPERTY){if(t===o[l])return T}else if(i.type===directive_t.BOOLEAN_ATTRIBUTE){if(!!t===o.hasAttribute(l))return T}else if(i.type===directive_t.ATTRIBUTE&&o.getAttribute(l)===t+"")return T;return directive_helpers_s(i),t}});
//# sourceMappingURL=live.js.map
;// CONCATENATED MODULE: ./node_modules/lit/directives/live.js
//# sourceMappingURL=live.js.map
// EXTERNAL MODULE: ./node_modules/xml-but-prettier/dist/index.js
var dist = __webpack_require__(131);
var dist_default = /*#__PURE__*/__webpack_require__.n(dist);
;// CONCATENATED MODULE: ./src/styles/border-styles.js
/* harmony default export */ const border_styles = (i`
.border-top {
border-top:1px solid var(--border-color);
}
.border{
border:1px solid var(--border-color);
border-radius: var(--border-radius);
}
.light-border{
border:1px solid var(--light-border-color);
border-radius: var(--border-radius);
}
.pad-8-16{
padding: 8px 16px;
}
.pad-top-8{
padding-top: 8px;
}
.mar-top-8{
margin-top: 8px;
}
`);
;// CONCATENATED MODULE: ./src/utils/schema-utils.js
// Takes a value as input and provides a printable string to replresent null values, spaces, blankstring etc
function getPrintableVal(val) {
if (val === undefined) {
return '';
}
if (val === null) {
return 'null';
}
if (val === '') {
return '∅';
}
if (typeof val === 'boolean' || typeof val === 'number') {
return `${val}`;
}
if (Array.isArray(val)) {
return val.map(v => v === null ? 'null' : v === '' ? '∅' : v.toString().replace(/^ +| +$/g, m => '●'.repeat(m.length)) || '').join(', ');
}
if (typeof val === 'object') {
const keys = Object.keys(val);
return `{ ${keys[0]}:${val[keys[0]]}${keys.length > 1 ? ',' : ''} ... }`;
}
return val.toString().replace(/^ +| +$/g, m => '●'.repeat(m.length)) || '';
}
/* Generates an schema object containing type and constraint info */
function getTypeInfo(schema) {
if (!schema) {
return;
}
let dataType = '';
let constrain = '';
// let examples;
if (schema.$ref) {
const n = schema.$ref.lastIndexOf('/');
const schemaNode = schema.$ref.substring(n + 1);
dataType = `{recursive: ${schemaNode}} `;
} else if (schema.type) {
dataType = Array.isArray(schema.type) ? schema.type.join(schema.length === 2 ? ' or ' : '┃') : schema.type;
if (schema.format || schema.enum || schema.const) {
dataType = dataType.replace('string', schema.enum ? 'enum' : schema.const ? 'const' : schema.format);
}
if (schema.nullable) {
dataType += '┃null';
}
} else if (schema.const) {
dataType = 'const';
} else if (Object.keys(schema).length === 0) {
dataType = 'any';
} else {
dataType = '{missing-type-info}';
}
const info = {
type: dataType,
format: schema.format || '',
pattern: schema.pattern && !schema.enum ? schema.pattern : '',
readOrWriteOnly: schema.readOnly ? '🆁' : schema.writeOnly ? '🆆' : '',
deprecated: schema.deprecated ? '❌' : '',
examples: schema.examples || schema.example,
default: getPrintableVal(schema.default),
description: schema.description || '',
constrain: '',
allowedValues: '',
arrayType: '',
html: ''
};
if (info.type === '{recursive}') {
info.description = schema.$ref.substring(schema.$ref.lastIndexOf('/') + 1);
} else if (info.type === '{missing-type-info}' || info.type === 'any') {
info.description = info.description || '';
}
// Set Allowed Values
info.allowedValues = schema.const ? schema.const : Array.isArray(schema.enum) ? schema.enum.map(v => getPrintableVal(v)).join('┃') : '';
if (dataType === 'array' && schema.items) {
var _schema$items, _schema$items2;
const arrayItemType = (_schema$items = schema.items) === null || _schema$items === void 0 ? void 0 : _schema$items.type;
const arrayItemDefault = getPrintableVal(schema.items.default);
info.arrayType = `${schema.type} of ${Array.isArray(arrayItemType) ? arrayItemType.join('') : arrayItemType}`;
info.default = arrayItemDefault;
info.allowedValues = schema.items.const ? schema.const : Array.isArray((_schema$items2 = schema.items) === null || _schema$items2 === void 0 ? void 0 : _schema$items2.enum) ? schema.items.enum.map(v => getPrintableVal(v)).join('┃') : '';
}
if (dataType.match(/integer|number/g)) {
if (schema.minimum !== undefined || schema.exclusiveMinimum !== undefined) {
constrain += schema.minimum !== undefined ? `Min ${schema.minimum}` : `More than ${schema.exclusiveMinimum}`;
}
if (schema.maximum !== undefined || schema.exclusiveMaximum !== undefined) {
constrain += schema.maximum !== undefined ? `${constrain ? '┃' : ''}Max ${schema.maximum}` : `${constrain ? '┃' : ''}Less than ${schema.exclusiveMaximum}`;
}
if (schema.multipleOf !== undefined) {
constrain += `${constrain ? '┃' : ''} multiple of ${schema.multipleOf}`;
}
}
if (dataType.match(/string/g)) {
if (schema.minLength !== undefined && schema.maxLength !== undefined) {
constrain += `${constrain ? '┃' : ''}${schema.minLength} to ${schema.maxLength} chars`;
} else if (schema.minLength !== undefined) {
constrain += `${constrain ? '┃' : ''}Min ${schema.minLength} chars`;
} else if (schema.maxLength !== undefined) {
constrain += `Max ${constrain ? '┃' : ''}${schema.maxLength} chars`;
}
}
info.constrain = constrain;
info.html = `${info.type}~|~${info.readOrWriteOnly}~|~${info.constrain}~|~${info.default}~|~${info.allowedValues}~|~${info.pattern}~|~${info.description}~|~${schema.title || ''}~|~${info.deprecated ? 'deprecated' : ''}`;
return info;
}
function nestExampleIfPresent(example) {
if (typeof example === 'boolean' || typeof example === 'number') {
return {
Example: {
value: `${example}`
}
};
}
if (example === '') {
return {
Example: {
value: ''
}
};
}
return example ? {
Example: {
value: example
}
} : example;
}
/**
* Normalize example object in the following format (List of object which is used to render example links and fill the input boxes)
* [{
* exampleVal : 'value to be rendered on the input control (text-box)',
* exampleList : [
* value : '',
* printableValue: '',
* summary : '',
* description : ''
* ]
* }]
* */
function normalizeExamples(examples, dataType = 'string') {
if (!examples) {
return {
exampleVal: '',
exampleList: []
};
}
if (examples.constructor === Object) {
const exampleList = Object.values(examples).filter(v => v['x-example-show-value'] !== false).map(v => ({
value: typeof v.value === 'boolean' || typeof v.value === 'number' ? `${v.value}` : v.value || '',
printableValue: getPrintableVal(v.value),
summary: v.summary || '',
description: v.description || ''
}));
const exampleVal = exampleList.length > 0 ? exampleList[0].value : '';
return {
exampleVal,
exampleList
};
}
// This is non-standard way to provide example but will support for now
if (!Array.isArray(examples)) {
examples = examples ? [examples] : [];
}
if (examples.length === 0) {
return {
exampleVal: '',
exampleList: []
};
}
if (dataType === 'array') {
const [exampleVal] = examples;
const exampleList = examples.map(v => ({
value: v,
printableValue: getPrintableVal(v)
}));
return {
exampleVal,
exampleList
};
}
const exampleVal = examples[0].toString();
const exampleList = examples.map(v => ({
value: v.toString(),
printableValue: getPrintableVal(v)
}));
return {
exampleVal,
exampleList
};
}
function anyExampleWithSummaryOrDescription(examples) {
return examples.some(x => {
var _x$summary, _x$description;
return ((_x$summary = x.summary) === null || _x$summary === void 0 ? void 0 : _x$summary.length) > 0 || ((_x$description = x.description) === null || _x$description === void 0 ? void 0 : _x$description.length) > 0;
});
}
function getSampleValueByType(schemaObj) {
const example = schemaObj.examples ? schemaObj.examples[0] : schemaObj.example === null ? null : schemaObj.example || undefined;
if (example === '') {
return '';
}
if (example === null) {
return null;
}
if (example === 0) {
return 0;
}
if (example === false) {
return false;
}
if (example instanceof Date) {
switch (schemaObj.format.toLowerCase()) {
case 'date':
return example.toISOString().split('T')[0];
case 'time':
return example.toISOString().split('T')[1];
default:
return example.toISOString();
}
}
if (example) {
return example;
}
if (Object.keys(schemaObj).length === 0) {
return null;
}
if (schemaObj.$ref) {
// Indicates a Circular ref
return schemaObj.$ref;
}
if (schemaObj.const === false || schemaObj.const === 0 || schemaObj.const === null || schemaObj.const === '') {
return schemaObj.const;
}
if (schemaObj.const) {
return schemaObj.const;
}
const typeValue = Array.isArray(schemaObj.type) ? schemaObj.type[0] : schemaObj.type;
if (!typeValue) {
return '?';
}
if (typeValue.match(/^integer|^number/g)) {
const multipleOf = Number.isNaN(Number(schemaObj.multipleOf)) ? undefined : Number(schemaObj.multipleOf);
const maximum = Number.isNaN(Number(schemaObj.maximum)) ? undefined : Number(schemaObj.maximum);
const minimumPossibleVal = Number.isNaN(Number(schemaObj.minimum)) ? Number.isNaN(Number(schemaObj.exclusiveMinimum)) ? maximum || 0 : Number(schemaObj.exclusiveMinimum) + (typeValue.startsWith('integer') ? 1 : 0.001) : Number(schemaObj.minimum);
const finalVal = multipleOf ? multipleOf >= minimumPossibleVal ? multipleOf : minimumPossibleVal % multipleOf === 0 ? minimumPossibleVal : Math.ceil(minimumPossibleVal / multipleOf) * multipleOf : minimumPossibleVal;
return finalVal;
}
if (typeValue.match(/^boolean/g)) {
return false;
}
if (typeValue.match(/^null/g)) {
return null;
}
if (typeValue.match(/^string/g)) {
if (schemaObj.enum) {
return schemaObj.enum[0];
}
if (schemaObj.const) {
return schemaObj.const;
}
if (schemaObj.pattern) {
return schemaObj.pattern;
}
if (schemaObj.format) {
const u = `${Date.now().toString(16)}${Math.random().toString(16)}0`.repeat(16);
switch (schemaObj.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';
// P=Period 3-Years 6-Months 4-Days 12-Hours 30-Minutes 5-Seconds
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 [u.substr(0, 8), u.substr(8, 4), `4000-8${u.substr(13, 3)}`, u.substr(16, 12)].join('-');
case 'byte':
return 'ZXhhbXBsZQ==';
// 'example' base64 encoded. See https://spec.openapis.org/oas/v3.0.0#data-types
default:
return '';
}
} else {
const minLength = Number.isNaN(schemaObj.minLength) ? undefined : Number(schemaObj.minLength);
const maxLength = Number.isNaN(schemaObj.maxLength) ? undefined : Number(schemaObj.maxLength);
const finalLength = minLength || (maxLength > 6 ? 6 : maxLength || undefined);
return finalLength ? 'A'.repeat(finalLength) : 'string';
}
}
// If type cannot be determined
return '?';
}
/*
json2xml- TestCase
{
'prop1' : 'one',
'prop2' : 'two',
'prop3' : [ 'a', 'b', 'c' ],
'prop4' : {
'ob1' : 'val-1',
'ob2' : 'val-2'
}
}
<root>
<prop1>simple</prop1>
<prop2>
<0>a</0>
<1>b</1>
<2>c</2>
</prop2>
<prop3>
<ob1>val-1</ob1>
<ob2>val-2</ob2>
</prop3>
</root>
*/
function json2xml(obj, level = 1) {
const indent = ' '.repeat(level);
let xmlText = '';
if (level === 1 && typeof obj !== 'object') {
return `\n${indent}${obj.toString()}`;
}
for (const prop in obj) {
const tagNameOrProp = obj[prop]['::XML_TAG'] || prop;
let tagName = '';
if (Array.isArray(obj[prop])) {
tagName = tagNameOrProp[0]['::XML_TAG'] || `${prop}`;
} else {
tagName = tagNameOrProp;
}
if (prop.startsWith('::')) {
continue;
}
if (Array.isArray(obj[prop])) {
xmlText = `${xmlText}\n${indent}<${tagName}>${json2xml(obj[prop], level + 1)}\n${indent}</${tagName}>`;
} else if (typeof obj[prop] === 'object') {
xmlText = `${xmlText}\n${indent}<${tagName}>${json2xml(obj[prop], level + 1)}\n${indent}</${tagName}>`;
} else {
xmlText = `${xmlText}\n${indent}<${tagName}>${obj[prop].toString()}</${tagName}>`;
}
}
return xmlText;
}
function addSchemaInfoToExample(schema, obj) {
var _schema$xml, _schema$xml3;
if (typeof obj !== 'object' || obj === null) {
return;
}
if (schema.title) {
obj['::TITLE'] = schema.title;
}
if (schema.description) {
obj['::DESCRIPTION'] = schema.description;
}
if ((_schema$xml = schema.xml) !== null && _schema$xml !== void 0 && _schema$xml.name) {
var _schema$xml2;
obj['::XML_TAG'] = (_schema$xml2 = schema.xml) === null || _schema$xml2 === void 0 ? void 0 : _schema$xml2.name;
}
if ((_schema$xml3 = schema.xml) !== null && _schema$xml3 !== void 0 && _schema$xml3.wrapped) {
var _schema$xml4;
obj['::XML_WRAP'] = (_schema$xml4 = schema.xml) === null || _schema$xml4 === void 0 ? void 0 : _schema$xml4.wrapped.toString();
}
}
function removeTitlesAndDescriptions(obj) {
if (typeof obj !== 'object' || obj === null) {
return;
}
delete obj['::TITLE'];
delete obj['::DESCRIPTION'];
delete obj['::XML_TAG'];
delete obj['::XML_WRAP'];
for (const k in obj) {
removeTitlesAndDescriptions(obj[k]);
}
}
function addPropertyExampleToObjectExamples(example, obj, propertyKey) {
for (const key in obj) {
obj[key][propertyKey] = example;
}
}
function mergePropertyExamples(obj, propertyName, propExamples) {
// Create an example for each variant of the propertyExample, merging them with the current (parent) example
let i = 0;
const maxCombinations = 10;
const mergedObj = {};
for (const exampleKey in obj) {
for (const propExampleKey in propExamples) {
mergedObj[`example-${i}`] = {
...obj[exampleKey]
};
mergedObj[`example-${i}`][propertyName] = propExamples[propExampleKey];
i++;
if (i >= maxCombinations) {
break;
}
}
if (i >= maxCombinations) {
break;
}
}
return mergedObj;
}
/* For changing JSON-Schema to a Sample Object, as per the schema (to generate examples based on schema) */
function schemaToSampleObj(schema, config = {}) {
let obj = {};
if (!schema) {
return;
}
if (schema.allOf) {
var _schema$allOf$, _schema$allOf$2;
const objWithAllProps = {};
if (schema.allOf.length === 1 && !((_schema$allOf$ = schema.allOf[0]) !== null && _schema$allOf$ !== void 0 && _schema$allOf$.properties) && !((_schema$allOf$2 = schema.allOf[0]) !== null && _schema$allOf$2 !== void 0 && _schema$allOf$2.items)) {
// If allOf has single item and the type is not an object or array, then its a primitive
if (schema.allOf[0].$ref) {
return '{ }';
}
if (schema.allOf[0].readOnly && config.includeReadOnly) {
const tempSchema = schema.allOf[0];
return getSampleValueByType(tempSchema);
}
return;
}
schema.allOf.forEach(v => {
if (v.type === 'object' || v.properties || v.allOf || v.anyOf || v.oneOf) {
const partialObj = schemaToSampleObj(v, config);
Object.assign(objWithAllProps, partialObj);
} else if (v.type === 'array' || v.items) {
const partialObj = [schemaToSampleObj(v, config)];
Object.assign(objWithAllProps, partialObj);
} else if (v.type) {
const prop = `prop${Object.keys(objWithAllProps).length}`;
objWithAllProps[prop] = getSampleValueByType(v);
} else {
return '';
}
});
obj = objWithAllProps;
} else if (schema.oneOf) {
// 1. First create example with scheme.properties
const objWithSchemaProps = {};
if (schema.properties) {
for (const propertyName in schema.properties) {
var _schema$properties$pr;
if (schema.properties[propertyName].properties || (_schema$properties$pr = schema.properties[propertyName].properties) !== null && _schema$properties$pr !== void 0 && _schema$properties$pr.items) {
objWithSchemaProps[propertyName] = schemaToSampleObj(schema.properties[propertyName], config);
} else {
objWithSchemaProps[propertyName] = getSampleValueByType(schema.properties[propertyName]);
}
}
}
if (schema.oneOf.length > 0) {
/*
oneOf:
- type: object
properties:
option1_PropA:
type: string
option1_PropB:
type: string
- type: object
properties:
option2_PropX:
type: string
properties:
prop1:
type: string
prop2:
type: string
minLength: 10
The aboove Schem should generate the following 2 examples
Example-1
{
prop1: 'string',
prop2: 'AAAAAAAAAA', <-- min-length 10
option1_PropA: 'string',
option1_PropB: 'string'
}
Example-2
{
prop1: 'string',
prop2: 'AAAAAAAAAA', <-- min-length 10
option2_PropX: 'string'
}
*/
let i = 0;
// Merge all examples of each oneOf-schema
for (const key in schema.oneOf) {
const oneOfSamples = schemaToSampleObj(schema.oneOf[key], config);
for (const sampleKey in oneOfSamples) {
// 2. In the final example include a one-of item along with properties
let finalExample;
if (Object.keys(objWithSchemaProps).length > 0) {
if (oneOfSamples[sampleKey] === null || typeof oneOfSamples[sampleKey] !== 'object') {
// This doesn't really make sense since every oneOf schema _should_ be an object if there are common properties, so we'll skip this
continue;
} else {
finalExample = Object.assign(oneOfSamples[sampleKey], objWithSchemaProps);
}
} else {
finalExample = oneOfSamples[sampleKey];
}
obj[`example-${i}`] = finalExample;
addSchemaInfoToExample(schema.oneOf[key], obj[`example-${i}`]);
i++;
}
}
}
} else if (schema.anyOf) {
// First generate values for regular properties
let commonObj;
if (schema.type === 'object' || schema.properties) {
commonObj = {
'example-0': {}
};
for (const propertyName in schema.properties) {
if (schema.example) {
commonObj = schema;
break;
}
if (schema.properties[propertyName].deprecated && !config.includeDeprecated) {
continue;
}
if (schema.properties[propertyName].readOnly && !config.includeReadOnly) {
continue;
}
if (schema.properties[propertyName].writeOnly && !config.includeWriteOnly) {
continue;
}
commonObj = mergePropertyExamples(commonObj, propertyName, schemaToSampleObj(schema.properties[propertyName], config));
}
}
// Combine every variant of the regular properties with every variant of the anyOf samples
let i = 0;
for (const key in schema.anyOf) {
const anyOfSamples = schemaToSampleObj(schema.anyOf[key], config);
for (const sampleKey in anyOfSamples) {
if (typeof commonObj !== 'undefined') {
for (const commonKey in commonObj) {
obj[`example-${i}`] = {
...commonObj[commonKey],
...anyOfSamples[sampleKey]
};
}
} else {
obj[`example-${i}`] = anyOfSamples[sampleKey];
}
addSchemaInfoToExample(schema.anyOf[key], obj[`example-${i}`]);
i++;
}
}
} else if (schema.type === 'object' || schema.properties) {
obj['example-0'] = {};
addSchemaInfoToExample(schema, obj['example-0']);
if (schema.example) {
obj['example-0'] = schema.example;
} else {
for (const propertyName in schema.properties) {
var _schema$properties$pr2, _schema$properties$pr3, _schema$properties$pr4, _schema$properties$pr5, _schema$properties$pr6;
if ((_schema$properties$pr2 = schema.properties[propertyName]) !== null && _schema$properties$pr2 !== void 0 && _schema$properties$pr2.deprecated && !config.includeDeprecated) {
continue;
}
if ((_schema$properties$pr3 = schema.properties[propertyName]) !== null && _schema$properties$pr3 !== void 0 && _schema$properties$pr3.readOnly && !config.includeReadOnly) {
continue;
}
if ((_schema$properties$pr4 = schema.properties[propertyName]) !== null && _schema$properties$pr4 !== void 0 && _schema$properties$pr4.writeOnly && !config.includeWriteOnly) {
continue;
}
if (((_schema$properties$pr5 = schema.properties[propertyName]) === null || _schema$properties$pr5 === void 0 ? void 0 : _schema$properties$pr5.type) === 'array' || (_schema$properties$pr6 = schema.properties[propertyName]) !== null && _schema$properties$pr6 !== void 0 && _schema$properties$pr6.items) {
var _schema$properties$pr7, _schema$properties$pr8;
if (schema.properties[propertyName].example) {
addPropertyExampleToObjectExamples(schema.properties[propertyName].example, obj, propertyName);
} else if ((_schema$properties$pr7 = schema.properties[propertyName]) !== null && _schema$properties$pr7 !== void 0 && (_schema$properties$pr8 = _schema$properties$pr7.items) !== null && _schema$properties$pr8 !== void 0 && _schema$properties$pr8.example) {
// schemas and properties support single example but not multiple examples.
addPropertyExampleToObjectExamples([schema.properties[propertyName].items.example], obj, propertyName);
} else {
const itemSamples = schemaToSampleObj(schema.properties[propertyName].items, config);
if (config.useXmlTagForProp) {
var _schema$properties$pr9, _schema$properties$pr10;
const xmlTagName = ((_schema$properties$pr9 = schema.properties[propertyName].xml) === null || _schema$properties$pr9 === void 0 ? void 0 : _schema$properties$pr9.name) || propertyName;
if ((_schema$properties$pr10 = schema.properties[propertyName].xml) !== null && _schema$properties$pr10 !== void 0 && _schema$properties$pr10.wrapped) {
const wrappedItemSample = JSON.parse(`{ "${xmlTagName}" : { "${xmlTagName}" : ${JSON.stringify(itemSamples['example-0'])} } }`);
obj = mergePropertyExamples(obj, xmlTagName, wrappedItemSample);
} else {
obj = mergePropertyExamples(obj, xmlTagName, itemSamples);
}
} else {
const arraySamples = [];
for (const key in itemSamples) {
arraySamples[key] = [itemSamples[key]];
}
obj = mergePropertyExamples(obj, propertyName, arraySamples);
}
}
continue;
}
obj = mergePropertyExamples(obj, propertyName, schemaToSampleObj(schema.properties[propertyName], config));
}
}
} else if (schema.type === 'array' || schema.items) {
if (schema.items || schema.example) {
var _schema$items3;
if (schema.example) {
obj['example-0'] = schema.example;
} else if ((_schema$items3 = schema.items) !== null && _schema$items3 !== void 0 && _schema$items3.example) {
// schemas and properties support single example but not multiple examples.
obj['example-0'] = [schema.items.example];
} else {
const samples = schemaToSampleObj(schema.items, config);
let i = 0;
for (const key in samples) {
obj[`example-${i}`] = [samples[key]];
addSchemaInfoToExample(schema.items, obj[`example-${i}`]);
i++;
}
}
} else {
obj['example-0'] = [];
}
} else {
return {
'example-0': getSampleValueByType(schema)
};
}
return obj;
}
function generateMarkdownForArrayAndObjectDescription(schema, level = 0) {
var _schema$items4;
let markdown = (schema.description || schema.title) && (schema.minItems || schema.maxItems) ? '<span class="descr-expand-toggle">➔</span>' : '';
if (schema.title) {
if (schema.description) {
markdown = `${markdown} <b>${schema.title}:</b> ${schema.description}<br/>`;
} else {
markdown = `${markdown} ${schema.title}<br/>`;
}
} else if (schema.description) {
markdown = `${markdown} ${schema.description}<br/>`;
}
if (schema.minItems) {
markdown = `${markdown} <b>Min Items:</b> ${schema.minItems}`;
}
if (schema.maxItems) {
markdown = `${markdown} <b>Max Items:</b> ${schema.maxItems}`;
}
if (level > 0 && (_schema$items4 = schema.items) !== null && _schema$items4 !== void 0 && _schema$items4.description) {
let itemsMarkdown = '';
if (schema.items.minProperties) {
itemsMarkdown = `<b>Min Properties:</b> ${schema.items.minProperties}`;
}
if (schema.items.maxProperties) {
itemsMarkdown = `${itemsMarkdown} <b>Max Properties:</b> ${schema.items.maxProperties}`;
}
markdown = `${markdown} ⮕ ${itemsMarkdown} [ ${schema.items.description} ] `;
}
return markdown;
}
/**
* For changing OpenAPI-Schema to an Object Notation,
* This Object would further be an input to UI Components to generate an Object-Tree
* @param {object} schema - Schema object from OpenAPI spec
* @param {object} obj - recursivly pass this object to generate object notation
* @param {number} level - recursion level
* @param {string} suffix - used for suffixing property names to avoid duplicate props during object composion
*/
function schemaInObjectNotation(schema, obj, level = 0, suffix = '') {
if (!schema) {
return;
}
if (schema.allOf) {
const objWithAllProps = {};
if (schema.allOf.length === 1 && !schema.allOf[0].properties && !schema.allOf[0].items) {
// If allOf has single item and the type is not an object or array, then its a primitive
const tempSchema = schema.allOf[0];
return `${getTypeInfo(tempSchema).html}`;
}
// If allOf is an array of multiple elements, then all the keys makes a single object
schema.allOf.map((v, i) => {
if (v.type === 'object' || v.properties || v.allOf || v.anyOf || v.oneOf) {
const propSuffix = (v.anyOf || v.oneOf) && i > 0 ? i : '';
const partialObj = schemaInObjectNotation(v, {}, level + 1, propSuffix);
Object.assign(objWithAllProps, partialObj);
} else if (v.type === 'array' || v.items) {
const partialObj = schemaInObjectNotation(v, {}, level + 1);
Object.assign(objWithAllProps, partialObj);
} else if (v.type) {
const prop = `prop${Object.keys(objWithAllProps).length}`;
const typeObj = getTypeInfo(v);
objWithAllProps[prop] = `${typeObj.html}`;
} else {
return '';
}
});
obj = objWithAllProps;
} else if (schema.anyOf || schema.oneOf) {
obj['::description'] = schema.description || '';
// 1. First iterate the regular properties
if (schema.type === 'object' || schema.properties) {
obj['::description'] = schema.description || '';
obj['::type'] = 'object';
// obj['::deprecated'] = schema.deprecated || false;
for (const key in schema.properties) {
if (schema.required && schema.required.includes(key)) {
obj[`${key}*`] = schemaInObjectNotation(schema.properties[key], {}, level + 1);
} else {
obj[key] = schemaInObjectNotation(schema.properties[key], {}, level + 1);
}
}
}
// 2. Then show allof/anyof objects
const objWithAnyOfProps = {};
const xxxOf = schema.anyOf ? 'anyOf' : 'oneOf';
schema[xxxOf].forEach((v, index) => {
if (v.type === 'object' || v.properties || v.allOf || v.anyOf || v.oneOf) {
const partialObj = schemaInObjectNotation(v, {});
objWithAnyOfProps[`::OPTION~${index + 1}${v.title ? `~${v.title}` : ''}`] = partialObj;
objWithAnyOfProps[`::OPTION~${index + 1}${v.title ? `~${v.title}` : ''}`]['::readwrite'] = ''; // xxx-options cannot be read or write only
objWithAnyOfProps['::type'] = 'xxx-of-option';
} else if (v.type === 'array' || v.items) {
// This else-if block never seems to get executed
const partialObj = schemaInObjectNotation(v, {});
objWithAnyOfProps[`::OPTION~${index + 1}${v.title ? `~${v.title}` : ''}`] = partialObj;
objWithAnyOfProps[`::OPTION~${index + 1}${v.title ? `~${v.title}` : ''}`]['::readwrite'] = ''; // xxx-options cannot be read or write only
objWithAnyOfProps['::type'] = 'xxx-of-array';
} else {
const prop = `::OPTION~${index + 1}${v.title ? `~${v.title}` : ''}`;
objWithAnyOfProps[prop] = `${getTypeInfo(v).html}`;
objWithAnyOfProps['::type'] = 'xxx-of-option';
}
});
obj[schema.anyOf ? `::ANY~OF ${suffix}` : `::ONE~OF ${suffix}`] = objWithAnyOfProps;
// obj['::type'] = 'object';
obj['::type'] = 'object';
} else if (Array.isArray(schema.type)) {
// When a property has multiple types, then check further if any of the types are array or object, if yes then modify the schema using one-of
// Clone the schema - as it will be modified to replace multi-data-types with one-of;
const subSchema = JSON.parse(JSON.stringify(schema));
const primitiveType = [];
const complexTypes = [];
subSchema.type.forEach(v => {
var _subSchema$items, _subSchema$items2;
if (v.match(/integer|number|string|null|boolean/g)) {
primitiveType.push(v);
} else if (v === 'array' && typeof ((_subSchema$items = subSchema.items) === null || _subSchema$items === void 0 ? void 0 : _subSchema$items.type) === 'string' && (_subSchema$items2 = subSchema.items) !== null && _subSchema$items2 !== void 0 && _subSchema$items2.type.match(/integer|number|string|null|boolean/g)) {
// Array with primitive types should also be treated as primitive type
if (subSchema.items.type === 'string' && subSchema.items.format) {
primitiveType.push(`[${subSchema.items.format}]`);
} else {
primitiveType.push(`[${subSchema.items.type}]`);
}
} else {
complexTypes.push(v);
}
});
let multiPrimitiveTypes;
if (primitiveType.length > 0) {
subSchema.type = primitiveType.join(primitiveType.length === 2 ? ' or ' : '┃');
multiPrimitiveTypes = getTypeInfo(subSchema);
if (complexTypes.length === 0) {
var _multiPrimitiveTypes;
return `${((_multiPrimitiveTypes = multiPrimitiveTypes) === null || _multiPrimitiveTypes === void 0 ? void 0 : _multiPrimitiveTypes.html) || ''}`;
}
}
if (complexTypes.length > 0) {
var _multiPrimitiveTypes2;
obj['::type'] = 'object';
const multiTypeOptions = {
'::type': 'xxx-of-option'
};
// Generate ONE-OF options for complexTypes
complexTypes.forEach((v, i) => {
if (v === 'null') {
multiTypeOptions[`::OPTION~${i + 1}`] = 'NULL~|~~|~~|~~|~~|~~|~~|~~|~';
} else if ('integer, number, string, boolean,'.includes(`${v},`)) {
subSchema.type = Array.isArray(v) ? v.join('┃') : v;
const primitiveTypeInfo = getTypeInfo(subSchema);
multiTypeOptions[`::OPTION~${i + 1}`] = primitiveTypeInfo.html;
} else if (v === 'object') {
// If object type iterate all the properties and create an object-type-option
const objTypeOption = {
'::title': schema.title || '',
'::description': schema.description || '',
'::type': 'object',
'::deprecated': schema.deprecated || false
};
for (const key in schema.properties) {
if (schema.required && schema.required.includes(key)) {
objTypeOption[`${key}*`] = schemaInObjectNotation(schema.properties[key], {}, level + 1);
} else {
objTypeOption[key] = schemaInObjectNotation(schema.properties[key], {}, level + 1);
}
}
multiTypeOptions[`::OPTION~${i + 1}`] = objTypeOption;
} else if (v === 'array') {
multiTypeOptions[`::OPTION~${i + 1}`] = {
'::title': schema.title || '',
'::description': schema.description || '',
'::type': 'array',
'::props': schemaInObjectNotation(schema.items, {}, level + 1)
};
}
});
multiTypeOptions[`::OPTION~${complexTypes.length + 1}`] = ((_multiPrimitiveTypes2 = multiPrimitiveTypes) === null || _multiPrimitiveTypes2 === void 0 ? void 0 : _multiPrimitiveTypes2.html) || '';
obj['::ONE~OF'] = multiTypeOptions;
}
} else if (schema.type === 'object' || schema.properties) {
// If Object
obj['::title'] = schema.title || '';
obj['::description'] = generateMarkdownForArrayAndObjectDescription(schema, level);
obj['::type'] = 'object';
if (Array.isArray(schema.type) && schema.type.includes('null') || schema.nullable) {
obj['::dataTypeLabel'] = 'object or null';
obj['::nullable'] = true;
}
obj['::deprecated'] = schema.deprecated || false;
obj['::readwrite'] = schema.readOnly ? 'readonly' : schema.writeOnly ? 'writeonly' : '';
for (const key in schema.properties) {
if (schema.required && schema.required.includes(key)) {
obj[`${key}*`] = schemaInObjectNotation(schema.properties[key], {}, level + 1);
} else {
obj[key] = schemaInObjectNotation(schema.properties[key], {}, level + 1);
}
}
for (const key in schema.patternProperties) {
obj[`[pattern: ${key}]`] = schemaInObjectNotation(schema.patternProperties[key], obj, level + 1);
}
if (schema.additionalProperties) {
obj['[any-key]'] = schemaInObjectNotation(schema.additionalProperties, {});
}
} else if (schema.type === 'array' || schema.items) {
var _schema$items5;
// If Array
obj['::title'] = schema.title || '';
obj['::description'] = generateMarkdownForArrayAndObjectDescription(schema, level);
obj['::type'] = 'array';
if (Array.isArray(schema.type) && schema.type.includes('null') || schema.nullable) {
obj['::dataTypeLabel'] = 'array or null';
obj['::nullable'] = true;
}
obj['::deprecated'] = schema.deprecated || false;
obj['::readwrite'] = schema.readOnly ? 'readonly' : schema.writeOnly ? 'writeonly' : '';
if ((_schema$items5 = schema.items) !== null && _schema$items5 !== void 0 && _schema$items5.items) {
obj['::array-type'] = schema.items.items.type;
}
obj['::props'] = schemaInObjectNotation(schema.items, {}, level + 1);
} else {
const typeObj = getTypeInfo(schema);
if (typeObj !== null && typeObj !== void 0 && typeObj.html) {
return `${typeObj.html}`;
}
return '';
}
return obj;
}
/* Create Example object */
function generateExample(schema, mimeType, examples = '', example = '', includeReadOnly = true, includeWriteOnly = true, outputType = 'json', includeGeneratedExample = false) {
const finalExamples = [];
// First check if examples is provided
if (examples) {
for (const eg in examples) {
let egContent = '';
let egFormat = 'json';
if (mimeType !== null && mimeType !== void 0 && mimeType.toLowerCase().includes('json')) {
if (outputType === 'text') {
egContent = typeof examples[eg].value === 'string' ? examples[eg].value : JSON.stringify(examples[eg].value, undefined, 2);
egFormat = 'text';
} else {
egContent = examples[eg].value;
if (typeof examples[eg].value === 'string') {
try {
// const fixedJsonString = examples[eg].value.replace((/([\w]+)(:)/g), '"$1"$2').replace((/'/g), '"');
const fixedJsonString = examples[eg].value;
egContent = JSON.parse(fixedJsonString);
egFormat = 'json';
} catch (err) {
egFormat = 'text';
egContent = examples[eg].value;
}
}
}
} else {
egContent = examples[eg].value;
egFormat = 'text';
}
finalExamples.push({
exampleId: eg,
exampleSummary: examples[eg].summary || eg,
exampleDescription: examples[eg].description || '',
exampleType: mimeType,
exampleValue: egContent,
exampleFormat: egFormat
});
}
} else if (example) {
let egContent = '';
let egFormat = 'json';
if (mimeType !== null && mimeType !== void 0 && mimeType.toLowerCase().includes('json')) {
if (outputType === 'text') {
egContent = typeof example === 'string' ? example : JSON.stringify(example, undefined, 2);
egFormat = 'text';
} else if (typeof example === 'object') {
egContent = example;
egFormat = 'json';
} else if (typeof example === 'string') {
try {
egContent = JSON.parse(example);
egFormat = 'json';
} catch (err) {
egFormat = 'text';
egContent = example;
}
}
} else {
egContent = example;
egFormat = 'text';
}
finalExamples.push({
exampleId: 'Example',
exampleSummary: '',
exampleDescription: '',
exampleType: mimeType,
exampleValue: egContent,
exampleFormat: egFormat
});
}
// If schema-level examples are not provided or includeGeneratedExample === true then generate one based on the schema field types
if (finalExamples.length === 0 || includeGeneratedExample === true) {
if (schema) {
if (schema.example) {
// Note: Deprecated: The 'example' property has been deprecated in 3.1.0 in favor of the JSON Schema 'examples' keyword
finalExamples.push({
exampleId: 'Example',
exampleSummary: '',
exampleDescription: '',
exampleType: mimeType,
exampleValue: schema.example,
exampleFormat: mimeType !== null && mimeType !== void 0 && mimeType.toLowerCase().includes('json') && typeof schema.example === 'object' ? 'json' : 'text'
});
} else if (mimeType !== null && mimeType !== void 0 && mimeType.toLowerCase().includes('json') || mimeType !== null && mimeType !== void 0 && mimeType.toLowerCase().includes('text') || mimeType !== null && mimeType !== void 0 && mimeType.toLowerCase().includes('*/*') || mimeType !== null && mimeType !== void 0 && mimeType.toLowerCase().includes('xml')) {
let xmlRootStart = '';
let xmlRootEnd = '';
let exampleFormat = '';
let exampleValue = '';
if (mimeType !== null && mimeType !== void 0 && mimeType.toLowerCase().includes('xml')) {
var _schema$xml5, _schema$xml6;
xmlRootStart = (_schema$xml5 = schema.xml) !== null && _schema$xml5 !== void 0 && _schema$xml5.name ? `<${schema.xml.name} ${schema.xml.namespace ? `xmlns="${schema.xml.namespace}"` : ''}>` : '<root>';
xmlRootEnd = (_schema$xml6 = schema.xml) !== null && _schema$xml6 !== void 0 && _schema$xml6.name ? `</${schema.xml.name}>` : '</root>';
exampleFormat = 'text';
} else {
exampleFormat = outputType;
}
const samples = schemaToSampleObj(schema, {
includeReadOnly,
includeWriteOnly,
deprecated: true,
useXmlTagForProp: mimeType === null || mimeType === void 0 ? void 0 : mimeType.toLowerCase().includes('xml')
});
let i = 0;
for (const samplesKey in samples) {
if (!samples[samplesKey]) {
continue;
}
const summary = samples[samplesKey]['::TITLE'] || `Example ${++i}`;
const description = samples[samplesKey]['::DESCRIPTION'] || '';
if (mimeType !== null && mimeType !== void 0 && mimeType.toLowerCase().includes('xml')) {
exampleValue = `<?xml version="1.0" encoding="UTF-8"?>\n${xmlRootStart}${json2xml(samples[samplesKey], 1)}\n${xmlRootEnd}`;
} else {
removeTitlesAndDescriptions(samples[samplesKey]);
exampleValue = outputType === 'text' ? JSON.stringify(samples[samplesKey], null, 2) : samples[samplesKey];
}
finalExamples.push({
exampleId: samplesKey,
exampleSummary: summary,
exampleDescription: description,
exampleType: mimeType,
exampleFormat,
exampleValue
});
}
} else if (mimeType !== null && mimeType !== void 0 && mimeType.toLowerCase().includes('jose')) {
finalExamples.push({
exampleId: 'Example',
exampleSummary: 'Base64 Encoded',
exampleDescription: '',
exampleType: mimeType,
exampleValue: schema.pattern || 'bXJpbg==',
exampleFormat: 'text'
});
} else {
finalExamples.push({
exampleId: 'Example',
exampleSummary: '',
exampleDescription: '',
exampleType: mimeType,
exampleValue: '',
exampleFormat: 'text'
});
}
} else {
// No Example or Schema provided (should never reach here)
finalExamples.push({
exampleId: 'Example',
exampleSummary: '',
exampleDescription: '',
exampleType: mimeType,
exampleValue: '',
exampleFormat: 'text'
});
}
}
return finalExamples;
}
function getSerializeStyleForContentType(contentType) {
if (contentType === 'application/json') {
return 'json';
}
if (contentType === 'application/xml') {
return 'xml';
}
return null;
}
function getSchemaFromParam(param) {
if (param.schema) {
return [param.schema, null, null];
}
if (param.content) {
// we gonna use the first content-encoding
for (const contentType of Object.keys(param.content)) {
if (param.content[contentType].schema) {
return [param.content[contentType].schema, getSerializeStyleForContentType(contentType), param.content[contentType]];
}
}
}
return [null, null, null];
}
;// CONCATENATED MODULE: ./src/components/json-tree.js
class JsonTree extends lit_element_s {
static get properties() {
return {
data: {
type: Object
},
renderStyle: {
type: String,
attribute: 'render-style'
}
};
}
static get styles() {
return [font_styles, border_styles, input_styles, i`
:host{
display:flex;
}
:where(button, input[type="checkbox"], [tabindex="0"]):focus-visible { box-shadow: var(--focus-shadow); }
:where(input[type="text"], input[type="password"], select, textarea):focus-visible { border-color: var(--primary-color); }
.json-tree {
position: relative;
font-family: var(--font-mono);
font-size: var(--font-size-small);
display:inline-block;
overflow:hidden;
word-break: break-all;
flex:1;
line-height: calc(var(--font-size-small) + 6px);
min-height: 40px;
direction: ltr;
text-align: left;
}
.open-bracket {
display:inline-block;
padding: 0 20px 0 0;
cursor:pointer;
border: 1px solid transparent;
border-radius:3px;
}
.close-bracket {
border: 1px solid transparent;
border-radius:3px;
display:inline-block;
}
.open-bracket:hover {
color:var(--primary-color);
background-color:var(--hover-color);
border: 1px solid var(--border-color);
}
.open-bracket.expanded:hover ~ .inside-bracket {
border-left: 1px solid var(--fg3);
}
.open-bracket.expanded:hover ~ .close-bracket {
color:var(--primary-color);
}
.inside-bracket {
padding-left:12px;
overflow: hidden;
border-left:1px dotted var(--border-color);
}
.open-bracket.collapsed + .inside-bracket,
.open-bracket.collapsed + .inside-bracket + .close-bracket {
display:none;
}
.string{color:var(--green);}
.number{color:var(--blue);}
.null{color:var(--red);}
.boolean{color:var(--purple);}
.object{color:var(--fg)}
.toolbar {
position: absolute;
top:5px;
right:6px;
display:flex;
padding:2px;
align-items: center;
}`, custom_styles];
}
/* eslint-disable indent */
render() {
return lit_html_x`
<div class = "json-tree" @click='${e => {
if (e.target.classList.contains('btn-copy')) {
copyToClipboard(JSON.stringify(this.data, null, 2), e);
} else {
this.toggleExpand(e);
}
}}'>
<div class='toolbar'>
<button class="toolbar-btn btn-copy" part="btn btn-fill btn-copy"> Copy </button>
</div>
${this.generateTree(this.data, true)}
</div>
`;
}
generateTree(data, isLast = false) {
if (data === null) {
return lit_html_x`<div class="null" style="display:inline;">null</div>`;
}
if (typeof data === 'object' && data instanceof Date === false) {
const detailType = Array.isArray(data) ? 'array' : 'pure_object';
if (Object.keys(data).length === 0) {
return lit_html_x`${Array.isArray(data) ? '[ ],' : '{ },'}`;
}
return lit_html_x`
<div class="open-bracket expanded ${detailType === 'array' ? 'array' : 'object'}" > ${detailType === 'array' ? '[' : '{'}</div>
<div class="inside-bracket">
${Object.keys(data).map((key, i, a) => lit_html_x`
<div class="item">
${detailType === 'pure_object' ? lit_html_x`"${key}":` : ''}
${this.generateTree(data[key], i === a.length - 1)}
</div>`)}
</div>
<div class="close-bracket">${detailType === 'array' ? ']' : '}'}${isLast ? '' : ','}</div>
`;
}
return typeof data === 'string' || data instanceof Date ? lit_html_x`<span class="${typeof data}">"${data}"</span>${isLast ? '' : ','}` : lit_html_x`<span class="${typeof data}">${data}</span>${isLast ? '' : ','}`;
}
/* eslint-enable indent */
toggleExpand(e) {
const openBracketEl = e.target;
if (e.target.classList.contains('open-bracket')) {
if (openBracketEl.classList.contains('expanded')) {
openBracketEl.classList.replace('expanded', 'collapsed');
e.target.innerHTML = e.target.classList.contains('array') ? '[...]' : '{...}';
} else {
openBracketEl.classList.replace('collapsed', 'expanded');
e.target.innerHTML = e.target.classList.contains('array') ? '[' : '{';
}
}
}
}
// Register the element with the browser
customElements.define('json-tree', JsonTree);
;// CONCATENATED MODULE: ./src/styles/schema-styles.js
/* harmony default export */ const schema_styles = (i`
*, *:before, *:after { box-sizing: border-box; }
.tr {
display: flex;
flex: none;
width: 100%;
box-sizing: content-box;
border-bottom: 1px dotted transparent;
transition: max-height 0.3s ease-out;
}
.td {
display: block;
flex: 0 0 auto;
}
.key {
font-family: var(--font-mono);
white-space: normal;
word-break: break-all;
}
.collapsed-all-descr .key {
overflow:hidden;
}
.expanded-all-descr .key-descr .descr-expand-toggle {
display:none;
}
.key-descr .descr-expand-toggle {
display:inline-block;
user-select:none;
color: var(--fg);
cursor: pointer;
transform: rotate(45deg);
transition: transform .2s ease;
}
.expanded-descr .key-descr .descr-expand-toggle {
transform: rotate(270deg)
}
.key-descr .descr-expand-toggle:hover {
color: var(--primary-color);
}
.expanded-descr .more-content { display:none; }
.key-descr {
font-family:var(--font-regular);
color:var(--light-fg);
flex-shrink: 1;
text-overflow: ellipsis;
overflow: hidden;
display: none;
}
.expanded-descr .key-descr{
max-height:auto;
overflow:hidden;
display: none;
}
.xxx-of-key {
font-size: calc(var(--font-size-small) - 2px);
font-weight:bold;
background-color:var(--primary-color);
color:var(--primary-color-invert);
border-radius:2px;
line-height:calc(var(--font-size-small) + 6px);
padding:0px 5px;
margin-bottom:1px;
display:inline-block;
}
.xxx-of-descr {
font-family: var(--font-regular);
color: var(--primary-color);
font-size: calc(var(--font-size-small) - 1px);
margin-left: 2px;
}
.stri, .string, .uri, .url, .byte, .bina, .date, .pass, .ipv4, .ipv4, .uuid, .emai, .host {color:var(--green);}
.inte, .numb, .number, .int6, .int3, .floa, .doub, .deci .blue {color:var(--blue);}
.null {color:var(--red);}
.bool, .boolean{color:var(--orange)}
.enum {color:var(--purple)}
.cons {color:var(--purple)}
.recu {color:var(--brown)}
.toolbar {
display:flex;
width:100%;
padding: 2px 0;
color:var(--primary-color);
}
.toolbar-item {
cursor:pointer;
padding:5px 0;
margin:0 2px;
}
.schema-root-type {
cursor:auto;
color:var(--fg2);
font-weight: bold;
text-transform: uppercase;
}
.toolbar-item:first-of-type { margin:0 2px 0 0;}
@media only screen and (min-width: 500px) {
.key-descr {
display: block;
}
.expanded-descr .key-descr{
display: block;
}
}
`);
;// CONCATENATED MODULE: ./src/components/schema-tree.js
// eslint-disable-line import/extensions
class SchemaTree extends lit_element_s {
static get properties() {
return {
data: {
type: Object
},
schemaExpandLevel: {
type: Number,
attribute: 'schema-expand-level'
},
schemaDescriptionExpanded: {
type: String,
attribute: 'schema-description-expanded'
},
allowSchemaDescriptionExpandToggle: {
type: String,
attribute: 'allow-schema-description-expand-toggle'
},
schemaHideReadOnly: {
type: String,
attribute: 'schema-hide-read-only'
},
schemaHideWriteOnly: {
type: String,
attribute: 'schema-hide-write-only'
}
};
}
connectedCallback() {
super.connectedCallback();
if (!this.schemaExpandLevel || this.schemaExpandLevel < 1) {
this.schemaExpandLevel = 99999;
}
if (!this.schemaDescriptionExpanded || !'true false'.includes(this.schemaDescriptionExpanded)) {
this.schemaDescriptionExpanded = 'false';
}
if (!this.schemaHideReadOnly || !'true false'.includes(this.schemaHideReadOnly)) {
this.schemaHideReadOnly = 'true';
}
if (!this.schemaHideWriteOnly || !'true false'.includes(this.schemaHideWriteOnly)) {
this.schemaHideWriteOnly = 'true';
}
}
static get styles() {
return [font_styles, schema_styles, border_styles, i`
.tree {
font-size:var(--font-size-small);
text-align: left;
direction: ltr;
line-height:calc(var(--font-size-small) + 6px);
}
.tree .tr:hover{
background-color:var(--hover-color);
}
.collapsed-all-descr .tr:not(.expanded-descr) {
overflow: hidden;
max-height:calc(var(--font-size-small) + 8px);
}
.tree .key {
max-width: 300px;
}
.key.deprecated .key-label {
color: var(--red);
}
.tr.expanded:hover > .td.key > .open-bracket {
color: var(--primary-color);
}
.tr.expanded:hover + .inside-bracket {
border-left: 1px solid var(--fg3);
}
.tr.expanded:hover + .inside-bracket + .close-bracket {
color: var(--primary-color);
}
.inside-bracket.xxx-of-option {
border-left: 1px solid transparent;
}
.open-bracket{
display:inline-block;
padding: 0 20px 0 0;
cursor:pointer;
border: 1px solid transparent;
border-radius:3px;
}
.open-bracket:hover {
color:var(--primary-color);
background-color:var(--hover-color);
border: 1px solid var(--border-color);
}
.close-bracket{
display:inline-block;
font-family: var(--font-mono);
}
.tr.collapsed + .inside-bracket,
.tr.collapsed + .inside-bracket + .close-bracket{
overflow: hidden;
display:none;
}
.inside-bracket.object,
.inside-bracket.array {
border-left: 1px dotted var(--border-color);
}`, custom_styles];
}
/* eslint-disable indent */
render() {
var _this$data, _this$data2, _this$data3;
return lit_html_x`
<div class="tree ${this.schemaDescriptionExpanded === 'true' ? 'expanded-all-descr' : 'collapsed-all-descr'}" @click="${e => this.handleAllEvents(e)}">
<div class="toolbar">
<div class="toolbar-item schema-root-type ${((_this$data = this.data) === null || _this$data === void 0 ? void 0 : _this$data['::type']) || ''} "> ${((_this$data2 = this.data) === null || _this$data2 === void 0 ? void 0 : _this$data2['::type']) || ''} </div>
${this.allowSchemaDescriptionExpandToggle === 'true' ? lit_html_x`
<div style="flex:1"></div>
<div part="schema-toolbar-item schema-multiline-toggle" class='toolbar-item schema-multiline-toggle'>
${this.schemaDescriptionExpanded === 'true' ? 'Single line description' : 'Multiline description'}
</div>` : ''}
</div>
<span part="schema-description" class='m-markdown'> ${unsafe_html_o(marked(((_this$data3 = this.data) === null || _this$data3 === void 0 ? void 0 : _this$data3['::description']) || ''))}</span>
${this.data ? lit_html_x`
${this.generateTree(this.data['::type'] === 'array' ? this.data['::props'] : this.data, this.data['::type'], this.data['::array-type'] || '')}` : lit_html_x`<span class='mono-font' style='color:var(--red)'> Schema not found </span>`}
</div>
`;
}
generateTree(data, dataType = 'object', arrayType = '', key = '', description = '', schemaLevel = 0, indentLevel = 0, readOrWrite = '') {
var _data$Type;
if (this.schemaHideReadOnly === 'true') {
if (dataType === 'array') {
if (readOrWrite === 'readonly') {
return;
}
}
if ((data === null || data === void 0 ? void 0 : data['::readwrite']) === 'readonly') {
return;
}
}
if (this.schemaHideWriteOnly === 'true') {
if (dataType === 'array') {
if (readOrWrite === 'writeonly') {
return;
}
}
if ((data === null || data === void 0 ? void 0 : data['::readwrite']) === 'writeonly') {
return;
}
}
if (!data) {
return lit_html_x`<div class="null" style="display:inline;">
<span class="key-label xxx-of-key"> ${key.replace('::OPTION~', '')}</span>
${dataType === 'array' ? lit_html_x`<span class='mono-font'> [ ] </span>` : dataType === 'object' ? lit_html_x`<span class='mono-font'> { } </span>` : lit_html_x`<span class='mono-font'> schema undefined </span>`}
</div>`;
}
if (Object.keys(data).length === 0) {
return lit_html_x`<span class="key object">${key}:{ }</span>`;
}
let keyLabel = '';
let keyDescr = '';
if (key.startsWith('::ONE~OF') || key.startsWith('::ANY~OF')) {
keyLabel = key.replace('::', '').replace('~', ' ');
} else if (key.startsWith('::OPTION')) {
const parts = key.split('~');
[, keyLabel, keyDescr] = parts;
} else {
keyLabel = key;
}
const leftPadding = 12;
const minFieldColWidth = 400 - indentLevel * leftPadding;
let openBracket = '';
let closeBracket = '';
const newSchemaLevel = (_data$Type = data['::type']) !== null && _data$Type !== void 0 && _data$Type.startsWith('xxx-of') ? schemaLevel : schemaLevel + 1;
// const newIndentLevel = dataType === 'xxx-of-option' || data['::type'] === 'xxx-of-option' ? indentLevel : (indentLevel + 1);
const newIndentLevel = dataType === 'xxx-of-option' || data['::type'] === 'xxx-of-option' || key.startsWith('::OPTION') ? indentLevel : indentLevel + 1;
if (data['::type'] === 'object') {
if (dataType === 'array') {
if (schemaLevel < this.schemaExpandLevel) {
openBracket = lit_html_x`<span class="open-bracket array-of-object" >[{</span>`;
} else {
openBracket = lit_html_x`<span class="open-bracket array-of-object">[{...}]</span>`;
}
closeBracket = '}]';
} else {
if (schemaLevel < this.schemaExpandLevel) {
openBracket = lit_html_x`<span class="open-bracket object">${data['::nullable'] ? 'null┃' : ''}{</span>`;
} else {
openBracket = lit_html_x`<span class="open-bracket object">${data['::nullable'] ? 'null┃' : ''}{...}</span>`;
}
closeBracket = '}';
}
} else if (data['::type'] === 'array') {
if (dataType === 'array') {
const arrType = arrayType !== 'object' ? arrayType : '';
if (schemaLevel < this.schemaExpandLevel) {
openBracket = lit_html_x`<span class="open-bracket array-of-array" data-array-type="${arrType}">[[ ${arrType} </span>`;
} else {
openBracket = lit_html_x`<span class="open-bracket array-of-array" data-array-type="${arrType}">[[...]]</span>`;
}
closeBracket = ']]';
} else {
if (schemaLevel < this.schemaExpandLevel) {
openBracket = lit_html_x`<span class="open-bracket array">[</span>`;
} else {
openBracket = lit_html_x`<span class="open-bracket array">[...]</span>`;
}
closeBracket = ']';
}
}
if (typeof data === 'object') {
var _data$Type2;
return lit_html_x`
<div class="tr ${schemaLevel < this.schemaExpandLevel || (_data$Type2 = data['::type']) !== null && _data$Type2 !== void 0 && _data$Type2.startsWith('xxx-of') ? 'expanded' : 'collapsed'} ${data['::type'] || 'no-type-info'}${data['::nullable'] ? ' nullable' : ''}" title="${data['::deprecated'] ? 'Deprecated' : ''}">
<div class="td key ${data['::deprecated'] ? 'deprecated' : ''}" style='min-width:${minFieldColWidth}px'>
${data['::type'] === 'xxx-of-option' || data['::type'] === 'xxx-of-array' || key.startsWith('::OPTION') ? lit_html_x`<span class='key-label xxx-of-key'> ${keyLabel}</span><span class="xxx-of-descr">${keyDescr}</span>` : keyLabel === '::props' || keyLabel === '::ARRAY~OF' ? '' : schemaLevel > 0 ? lit_html_x`<span class="key-label" title="${readOrWrite === 'readonly' ? 'Read-Only' : readOrWrite === 'writeonly' ? 'Write-Only' : ''}">
${data['::deprecated'] ? '✗' : ''}
${keyLabel.replace(/\*$/, '')}${keyLabel.endsWith('*') ? lit_html_x`<span style="color:var(--red)">*</span>` : ''}${readOrWrite === 'readonly' ? lit_html_x` 🆁` : readOrWrite === 'writeonly' ? lit_html_x` 🆆` : readOrWrite}:
</span>` : ''}
${openBracket}
</div>
<div class='td key-descr m-markdown-small'>${unsafe_html_o(marked(description || ''))}</div>
</div>
<div class='inside-bracket ${data['::type'] || 'no-type-info'}' style='padding-left:${data['::type'] === 'xxx-of-option' || data['::type'] === 'xxx-of-array' ? 0 : leftPadding}px;'>
${Array.isArray(data) && data[0] ? lit_html_x`${this.generateTree(data[0], 'xxx-of-option', '', '::ARRAY~OF', '', newSchemaLevel, newIndentLevel, data[0]['::readwrite'])}` : lit_html_x`
${Object.keys(data).map(dataKey => {
var _data$dataKey;
return lit_html_x`
${['::title', '::description', '::type', '::props', '::deprecated', '::array-type', '::readwrite', '::dataTypeLabel', '::nullable'].includes(dataKey) ? data[dataKey]['::type'] === 'array' || data[dataKey]['::type'] === 'object' ? lit_html_x`${this.generateTree(data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey], data[dataKey]['::type'], data[dataKey]['::array-type'] || '', dataKey, data[dataKey]['::description'], newSchemaLevel, newIndentLevel, data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '')}` : '' : lit_html_x`${this.generateTree(data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey], data[dataKey]['::type'], data[dataKey]['::array-type'] || '', dataKey, ((_data$dataKey = data[dataKey]) === null || _data$dataKey === void 0 ? void 0 : _data$dataKey['::description']) || '', newSchemaLevel, newIndentLevel, data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '')}`}
`;
})}
`}
</div>
${data['::type'] && data['::type'].includes('xxx-of') ? '' : lit_html_x`<div class='close-bracket'> ${closeBracket} </div>`}
`;
}
// For Primitive types and array of Primitives
// eslint-disable-next-line no-unused-vars
const [type, primitiveReadOrWrite, constraint, defaultValue, allowedValues, pattern, schemaDescription, schemaTitle, deprecated] = data.split('~|~');
if (primitiveReadOrWrite === '🆁' && this.schemaHideReadOnly === 'true') {
return;
}
if (primitiveReadOrWrite === '🆆' && this.schemaHideWriteOnly === 'true') {
return;
}
const dataTypeCss = type.replace(/┃.*/g, '').replace(/[^a-zA-Z0-9+]/g, '').substring(0, 4).toLowerCase();
const descrExpander = `${constraint || defaultValue || allowedValues || pattern ? `<span class="descr-expand-toggle ${this.schemaDescriptionExpanded === 'true' ? 'expanded-descr' : ''}">➔</span>` : ''}`;
let finalReadWriteText = '';
let finalReadWriteTip = '';
if (dataType === 'array') {
if (readOrWrite === 'readonly') {
finalReadWriteText = '🆁';
finalReadWriteTip = 'Read-Only';
} else if (readOrWrite === 'writeonly') {
finalReadWriteText = '🆆';
finalReadWriteTip = 'Write-Only';
}
} else if (primitiveReadOrWrite === '🆁') {
finalReadWriteText = '🆁';
finalReadWriteTip = 'Read-Only';
} else if (primitiveReadOrWrite === '🆆') {
finalReadWriteText = '🆆';
finalReadWriteTip = 'Write-Only';
}
return lit_html_x`
<div class = "tr primitive" title="${deprecated ? 'Deprecated' : ''}">
<div class="td key ${deprecated}" style='min-width:${minFieldColWidth}px'>
${deprecated ? lit_html_x`<span style='color:var(--red);'>✗</span>` : ''}
${keyLabel.endsWith('*') ? lit_html_x`<span class="key-label">${keyLabel.substring(0, keyLabel.length - 1)}</span><span style='color:var(--red);'>*</span>:` : key.startsWith('::OPTION') ? lit_html_x`<span class='key-label xxx-of-key'>${keyLabel}</span><span class="xxx-of-descr">${keyDescr}</span>` : lit_html_x`<span class="key-label">${keyLabel}:</span>`}
<span class="${dataTypeCss}" title="${finalReadWriteTip}">
${dataType === 'array' ? `[${type}]` : `${type}`}
${finalReadWriteText}
</span>
</div>
<div class='td key-descr'>
${description || schemaTitle || schemaDescription ? lit_html_x`${lit_html_x`<span class="m-markdown-small">
${unsafe_html_o(marked(dataType === 'array' ? `${descrExpander} ${description}` : schemaTitle ? `${descrExpander} <b>${schemaTitle}:</b> ${schemaDescription}` : `${descrExpander} ${schemaDescription}`))}
</span>`}` : ''}
${constraint ? lit_html_x`<div style='display:inline-block; line-break:anywhere; margin-right:8px'><span class='bold-text'>Constraints: </span>${constraint}</div>` : ''}
${defaultValue ? lit_html_x`<div style='display:inline-block; line-break:anywhere; margin-right:8px'><span class='bold-text'>Default: </span>${defaultValue}</div>` : ''}
${allowedValues ? lit_html_x`<div style='display:inline-block; line-break:anywhere; margin-right:8px'><span class='bold-text'>${type === 'const' ? 'Value' : 'Allowed'}: </span>${allowedValues}</div>` : ''}
${pattern ? lit_html_x`<div style='display:inline-block; line-break: anywhere; margin-right:8px'><span class='bold-text'>Pattern: </span>${pattern}</div>` : ''}
</div>
</div>
`;
}
/* eslint-enable indent */
handleAllEvents(e) {
if (e.target.classList.contains('open-bracket')) {
this.toggleObjectExpand(e);
} else if (e.target.classList.contains('schema-multiline-toggle')) {
this.schemaDescriptionExpanded = this.schemaDescriptionExpanded === 'true' ? 'false' : 'true';
} else if (e.target.classList.contains('descr-expand-toggle')) {
const trEl = e.target.closest('.tr');
if (trEl) {
trEl.classList.toggle('expanded-descr');
trEl.style.maxHeight = trEl.scrollHeight;
}
}
}
toggleObjectExpand(e) {
const rowEl = e.target.closest('.tr');
const nullable = rowEl.classList.contains('nullable');
if (rowEl.classList.contains('expanded')) {
rowEl.classList.replace('expanded', 'collapsed');
e.target.innerHTML = e.target.classList.contains('array-of-object') ? '[{...}]' : e.target.classList.contains('array-of-array') ? '[[...]]' : e.target.classList.contains('array') ? '[...]' : `${nullable ? 'null┃' : ''}{...}`;
} else {
rowEl.classList.replace('collapsed', 'expanded');
e.target.innerHTML = e.target.classList.contains('array-of-object') ? '[{' : e.target.classList.contains('array-of-array') ? `[[ ${e.target.dataset.arrayType}` : e.target.classList.contains('object') ? `${nullable ? 'null┃' : ''}{` : '[';
}
}
}
customElements.define('schema-tree', SchemaTree);
;// CONCATENATED MODULE: ./src/components/tag-input.js
class TagInput extends lit_element_s {
/* eslint-disable indent */
render() {
let tagItemTmpl = '';
if (Array.isArray(this.value)) {
tagItemTmpl = lit_html_x`${this.value.filter(v => typeof v === 'string' && v.trim() !== '').map(v => lit_html_x`<span class='tag'>${v}</span>`)}`;
}
return lit_html_x`
<div class='tags'>
${tagItemTmpl}
<input type="text" class='editor' @paste="${e => this.afterPaste(e)}" @keydown="${this.afterKeyDown}" @blur="${this.onBlur}" placeholder="${this.placeholder || ''}">
</div>
`;
}
/* eslint-enable indent */
static get properties() {
return {
placeholder: {
type: String
},
value: {
type: Array,
attribute: 'value'
}
};
}
attributeChangedCallback(name, oldVal, newVal) {
if (name === 'value') {
if (newVal && oldVal !== newVal) {
this.value = newVal.split(',').filter(v => v.trim() !== '');
}
}
super.attributeChangedCallback(name, oldVal, newVal);
}
afterPaste(e) {
const clipboardData = e.clipboardData || window.clipboardData;
const pastedData = clipboardData.getData('Text');
const pastedArray = pastedData ? pastedData.split(',').filter(v => v.trim() !== '') : '';
if (pastedArray) {
if (Array.isArray(this.value)) {
this.value = [...this.value, ...pastedArray];
} else {
this.value = pastedArray;
}
}
e.preventDefault();
}
afterKeyDown(e) {
if (e.keyCode === 13) {
e.stopPropagation();
e.preventDefault();
if (e.target.value) {
if (Array.isArray(this.value)) {
this.value = [...this.value, e.target.value];
} else {
this.value = [e.target.value];
}
e.target.value = '';
}
} else if (e.keyCode === 8) {
if (e.target.value.length === 0) {
if (Array.isArray(this.value) && this.value.length > 0) {
this.value.splice(-1);
this.value = [...this.value];
}
}
}
}
onBlur(e) {
if (e.target.value) {
if (Array.isArray(this.value)) {
this.value = [...this.value, e.target.value];
} else {
this.value = [e.target.value];
}
e.target.value = '';
}
}
static get styles() {
return [i`
.tags {
display:flex;
flex-wrap: wrap;
outline: none;
padding:0;
border-radius:var(--border-radius);
border:1px solid var(--border-color);
cursor:text;
overflow:hidden;
background:var(--input-bg);
}
.tag, .editor {
padding:3px;
margin:2px;
}
.tag{
border:1px solid var(--border-color);
background-color:var(--bg3);
color:var(--fg3);
border-radius:var(--border-radius);
word-break: break-all;
font-size: var(--font-size-small);
}
.tag:hover ~ #cursor {
display: block;
}
.editor {
flex:1;
border:1px solid transparent;
color:var(--fg);
min-width:60px;
outline: none;
line-height: inherit;
font-family:inherit;
background:transparent;
font-size: calc(var(--font-size-small) + 1px);
}
.editor:focus-visible {
outline: 1px solid;
}
.editor::placeholder {
color: var(--placeholder-color);
opacity:1;
}
`];
}
}
// Register the element with the browser
customElements.define('tag-input', TagInput);
;// CONCATENATED MODULE: ./src/components/api-request.js
// eslint-disable-line import/extensions
// eslint-disable-line import/extensions
// eslint-disable-line import/extensions
class ApiRequest extends lit_element_s {
constructor() {
super();
this.responseMessage = '';
this.responseStatus = 'success';
this.responseHeaders = '';
this.responseText = '';
this.responseUrl = '';
this.curlSyntax = '';
this.activeResponseTab = 'response'; // allowed values: response, headers, curl
this.selectedRequestBodyType = '';
this.selectedRequestBodyExample = '';
this.activeParameterSchemaTabs = {};
}
static get properties() {
return {
serverUrl: {
type: String,
attribute: 'server-url'
},
servers: {
type: Array
},
method: {
type: String
},
path: {
type: String
},
security: {
type: Array
},
parameters: {
type: Array
},
request_body: {
type: Object
},
api_keys: {
type: Array
},
parser: {
type: Object
},
accept: {
type: String
},
callback: {
type: String
},
webhook: {
type: String
},
responseMessage: {
type: String,
attribute: false
},
responseText: {
type: String,
attribute: false
},
responseHeaders: {
type: String,
attribute: false
},
responseStatus: {
type: String,
attribute: false
},
responseUrl: {
type: String,
attribute: false
},
curlSyntax: {
type: String,
attribute: false
},
fillRequestFieldsWithExample: {
type: String,
attribute: 'fill-request-fields-with-example'
},
allowTry: {
type: String,
attribute: 'allow-try'
},
showCurlBeforeTry: {
type: String,
attribute: 'show-curl-before-try'
},
renderStyle: {
type: String,
attribute: 'render-style'
},
schemaStyle: {
type: String,
attribute: 'schema-style'
},
activeSchemaTab: {
type: String,
attribute: 'active-schema-tab'
},
activeParameterSchemaTabs: {
type: Object,
converter: {
fromAttribute: attr => JSON.parse(attr),
toAttribute: prop => JSON.stringify(prop)
},
attribute: 'active-parameter-schema-tabs'
},
schemaExpandLevel: {
type: Number,
attribute: 'schema-expand-level'
},
schemaDescriptionExpanded: {
type: String,
attribute: 'schema-description-expanded'
},
allowSchemaDescriptionExpandToggle: {
type: String,
attribute: 'allow-schema-description-expand-toggle'
},
schemaHideReadOnly: {
type: String,
attribute: 'schema-hide-read-only'
},
schemaHideWriteOnly: {
type: String,
attribute: 'schema-hide-write-only'
},
fetchCredentials: {
type: String,
attribute: 'fetch-credentials'
},
// properties for internal tracking
activeResponseTab: {
type: String
},
// internal tracking of response-tab not exposed as a attribute
selectedRequestBodyType: {
type: String,
attribute: 'selected-request-body-type'
},
// internal tracking of selected request-body type
selectedRequestBodyExample: {
type: String,
attribute: 'selected-request-body-example'
} // internal tracking of selected request-body example
};
}
static get styles() {
return [table_styles, input_styles, font_styles, flex_styles, border_styles, tab_styles, prism_styles, i`
*, *:before, *:after { box-sizing: border-box; }
:where(button, input[type="checkbox"], [tabindex="0"]):focus-visible { box-shadow: var(--focus-shadow); }
:where(input[type="text"], input[type="password"], select, textarea):focus-visible { border-color: var(--primary-color); }
tag-input:focus-within { outline: 1px solid;}
.read-mode {
margin-top: 24px;
}
.param-name,
.param-type {
margin: 1px 0;
text-align: right;
line-height: var(--font-size-small);
}
.param-name {
color: var(--fg);
font-family: var(--font-mono);
}
.param-name.deprecated {
color: var(--red);
}
.param-type{
color: var(--light-fg);
font-family: var(--font-regular);
}
.param-constraint{
min-width:100px;
}
.param-constraint:empty{
display:none;
}
.top-gap{margin-top:24px;}
.textarea {
min-height:220px;
padding:5px;
resize:vertical;
direction: ltr;
}
.example:first-child {
margin-top: -9px;
}
.response-message{
font-weight:bold;
text-overflow: ellipsis;
}
.response-message.error {
color:var(--red);
}
.response-message.success {
color:var(--blue);
}
.file-input-container {
align-items:flex-end;
}
.file-input-container .input-set:first-child .file-input-remove-btn{
visibility:hidden;
}
.file-input-remove-btn{
font-size:16px;
color:var(--red);
outline: none;
border: none;
background:none;
cursor:pointer;
}
.v-tab-btn {
font-size: var(--smal-font-size);
height:24px;
border:none;
background:none;
opacity: 0.3;
cursor: pointer;
padding: 4px 8px;
}
.v-tab-btn.active {
font-weight: bold;
background: var(--bg);
opacity: 1;
}
@media only screen and (min-width: 768px) {
.textarea {
padding:8px;
}
}
@media only screen and (max-width: 470px) {
.hide-in-small-screen {
display:none;
}
}
`, custom_styles];
}
render() {
return lit_html_x`
<div class="col regular-font request-panel ${'read focused'.includes(this.renderStyle) || this.callback === 'true' ? 'read-mode' : 'view-mode'}">
<div class=" ${this.callback === 'true' ? 'tiny-title' : 'req-res-title'} ">
${this.callback === 'true' ? 'CALLBACK REQUEST' : 'REQUEST'}
</div>
<div>
${guard_i([this.method, this.path, this.allowTry, this.parameters, this.activeParameterSchemaTabs], () => this.inputParametersTemplate('path'))}
${guard_i([this.method, this.path, this.allowTry, this.parameters, this.activeParameterSchemaTabs], () => this.inputParametersTemplate('query'))}
${this.requestBodyTemplate()}
${guard_i([this.method, this.path, this.allowTry, this.parameters, this.activeParameterSchemaTabs], () => this.inputParametersTemplate('header'))}
${guard_i([this.method, this.path, this.allowTry, this.parameters, this.activeParameterSchemaTabs], () => this.inputParametersTemplate('cookie'))}
${this.allowTry === 'false' ? '' : lit_html_x`${this.apiCallTemplate()}`}
</div>
</div>
`;
}
async updated() {
if (this.showCurlBeforeTry === 'true') {
this.applyCURLSyntax(this.shadowRoot);
}
// In focused mode after rendering the request component, update the text-areas(which contains examples) using
// the original values from hidden textareas
// This is done coz, user may update the dom by editing the textarea's and once the DOM is updated externally change detection wont happen, therefore update the values manually
// if (this.renderStyle === 'focused') {
// if (changedProperties.size === 1 && changedProperties.has('activeSchemaTab')) {
// // dont update example as only tabs is switched
// } else {
// this.requestUpdate();
// }
// }
if (this.webhook === 'true') {
this.allowTry = 'false';
}
}
async saveExampleState() {
if (this.renderStyle === 'focused') {
const reqBodyTextAreaEls = [...this.shadowRoot.querySelectorAll('textarea.request-body-param-user-input')];
reqBodyTextAreaEls.forEach(el => {
el.dataset.user_example = el.value;
});
const exampleTextAreaEls = [...this.shadowRoot.querySelectorAll('textarea[data-ptype="form-data"]')];
exampleTextAreaEls.forEach(el => {
el.dataset.user_example = el.value;
});
this.requestUpdate();
}
}
async updateExamplesFromDataAttr() {
// In focused mode after rendering the request component, update the text-areas(which contains examples) using
// the original values from hidden textareas
// This is done coz, user may update the dom by editing the textarea's and once the DOM is updated externally change detection wont happen, therefore update the values manually
if (this.renderStyle === 'focused') {
const reqBodyTextAreaEls = [...this.shadowRoot.querySelectorAll('textarea.request-body-param-user-input')];
reqBodyTextAreaEls.forEach(el => {
el.value = el.dataset.user_example || el.dataset.example;
});
const exampleTextAreaEls = [...this.shadowRoot.querySelectorAll('textarea[data-ptype="form-data"]')];
exampleTextAreaEls.forEach(el => {
el.value = el.dataset.user_example || el.dataset.example;
});
this.requestUpdate();
}
}
/* eslint-disable indent */
renderExample(example, paramType, paramName) {
var _example$value, _example$value2;
return lit_html_x`
${paramType === 'array' ? '[' : ''}
<a
part="anchor anchor-param-example"
style="display:inline-block; min-width:24px; text-align:center"
class="${this.allowTry === 'true' ? '' : 'inactive-link'}"
data-example-type="${paramType === 'array' ? paramType : 'string'}"
data-example="${example.value && Array.isArray(example.value) ? (_example$value = example.value) === null || _example$value === void 0 ? void 0 : _example$value.join('~|~') : (typeof example.value === 'object' ? JSON.stringify(example.value, null, 2) : example.value) || ''}"
title="${example.value && Array.isArray(example.value) ? (_example$value2 = example.value) === null || _example$value2 === void 0 ? void 0 : _example$value2.join('~|~') : (typeof example.value === 'object' ? JSON.stringify(example.value, null, 2) : example.value) || ''}"
@click="${e => {
const inputEl = e.target.closest('table').querySelector(`[data-pname="${paramName}"]`);
if (inputEl) {
inputEl.value = e.target.dataset.exampleType === 'array' ? e.target.dataset.example.split('~|~') : e.target.dataset.example;
}
}}"
> ${example.printableValue || example.value} </a>
${paramType === 'array' ? '] ' : ''}
`;
}
renderShortFormatExamples(examples, paramType, paramName) {
return lit_html_x`${examples.map((x, i) => lit_html_x`
${i === 0 ? '' : '┃'}
${this.renderExample(x, paramType, paramName)}`)}`;
}
renderLongFormatExamples(exampleList, paramType, paramName) {
return lit_html_x` <ul style="list-style-type: disclosure-closed;">
${exampleList.map(v => {
var _v$summary, _v$description;
return lit_html_x`
<li>
${this.renderExample(v, paramType, paramName)}
${((_v$summary = v.summary) === null || _v$summary === void 0 ? void 0 : _v$summary.length) > 0 ? lit_html_x`<span>&lpar;${v.summary}&rpar;</span>` : ''}
${((_v$description = v.description) === null || _v$description === void 0 ? void 0 : _v$description.length) > 0 ? lit_html_x`<p>${unsafe_html_o(marked(v.description))}</p>` : ''}
</li>
`;
})}
</ul>`;
}
exampleListTemplate(paramName, paramType, exampleList = []) {
return lit_html_x` ${exampleList.length > 0 ? lit_html_x`<span style="font-weight:bold">Examples: </span>
${anyExampleWithSummaryOrDescription(exampleList) ? this.renderLongFormatExamples(exampleList, paramType, paramName) : this.renderShortFormatExamples(exampleList, paramType, paramName)}` : ''}`;
}
inputParametersTemplate(paramType) {
const filteredParams = this.parameters ? this.parameters.filter(param => param.in === paramType) : [];
if (filteredParams.length === 0) {
return '';
}
let title = '';
if (paramType === 'path') {
title = 'PATH PARAMETERS';
} else if (paramType === 'query') {
title = 'QUERY-STRING PARAMETERS';
} else if (paramType === 'header') {
title = 'REQUEST HEADERS';
} else if (paramType === 'cookie') {
title = 'COOKIES';
}
const tableRows = [];
for (const param of filteredParams) {
const [declaredParamSchema, serializeStyle, mimeTypeElem] = getSchemaFromParam(param);
if (!declaredParamSchema) {
continue;
}
const paramSchema = getTypeInfo(declaredParamSchema);
if (!paramSchema) {
continue; // eslint-disable-line no-continue
}
const schemaAsObj = schemaInObjectNotation(declaredParamSchema, {});
// let exampleVal = '';
// let exampleList = [];
let paramStyle = 'form';
let paramExplode = true;
let paramAllowReserved = false;
if (paramType === 'query') {
if (param.style && 'form spaceDelimited pipeDelimited'.includes(param.style)) {
paramStyle = param.style;
} else if (serializeStyle) {
paramStyle = serializeStyle;
}
if (typeof param.explode === 'boolean') {
paramExplode = param.explode;
}
if (typeof param.allowReserved === 'boolean') {
paramAllowReserved = param.allowReserved;
}
}
// openapi 3.1.0 spec based examples (which must be Object(string : { value:any, summary?: string, description?: string})
const example = normalizeExamples(param.examples || nestExampleIfPresent(param.example) || nestExampleIfPresent(mimeTypeElem === null || mimeTypeElem === void 0 ? void 0 : mimeTypeElem.example) || (mimeTypeElem === null || mimeTypeElem === void 0 ? void 0 : mimeTypeElem.examples) || nestExampleIfPresent(paramSchema.examples) || nestExampleIfPresent(paramSchema.example), paramSchema.type);
if (!example.exampleVal && paramSchema.type === 'object') {
example.exampleVal = generateExample(declaredParamSchema, serializeStyle || 'json', '', '', this.callback === 'true' || this.webhook === 'true' ? true : false,
// eslint-disable-line no-unneeded-ternary
this.callback === 'true' || this.webhook === 'true' ? false : true,
// eslint-disable-line no-unneeded-ternary
true, 'text', false)[0].exampleValue;
}
const labelColWidth = 'read focused'.includes(this.renderStyle) ? '200px' : '160px';
tableRows.push(lit_html_x`
<tr title="${param.deprecated ? 'Deprecated' : ''}">
<td rowspan="${this.allowTry === 'true' ? '1' : '2'}" style="width:${labelColWidth}; min-width:100px;">
<div class="param-name ${param.deprecated ? 'deprecated' : ''}" >
${param.deprecated ? lit_html_x`<span style='color:var(--red);'>✗</span>` : ''}
${param.required ? lit_html_x`<span style='color:var(--red)'>*</span>` : ''}
${param.name}
</div>
<div class="param-type">
${paramSchema.type === 'array' ? `${paramSchema.arrayType}` : `${paramSchema.format ? paramSchema.format : paramSchema.type}`}
</div>
</td>
${this.allowTry === 'true' ? lit_html_x`
<td style="min-width:100px;" colspan="${paramSchema.default || paramSchema.constrain || paramSchema.allowedValues || paramSchema.pattern ? '1' : '2'}">
${paramSchema.type === 'array' ? lit_html_x`
<tag-input class="request-param"
style = "width:100%"
data-ptype = "${paramType}"
data-pname = "${param.name}"
data-example = "${Array.isArray(example.exampleVal) ? example.exampleVal.join('~|~') : example.exampleVal}"
data-param-serialize-style = "${paramStyle}"
data-param-serialize-explode = "${paramExplode}"
data-param-allow-reserved = "${paramAllowReserved}"
data-x-fill-example = "${param['x-fill-example'] || 'yes'}"
data-array = "true"
placeholder = "add-multiple &#x21a9;"
.value="${param['x-fill-example'] === 'no' ? [] : live_l(this.fillRequestFieldsWithExample === 'true' ? Array.isArray(example.exampleVal) ? example.exampleVal : [example.exampleVal] : [])}"
>
</tag-input>` : paramSchema.type === 'object' ? lit_html_x`
<div class="tab-panel col" style="border-width:0 0 1px 0;">
<div class="tab-buttons row" @click="${e => {
if (e.target.tagName.toLowerCase() === 'button') {
const newState = {
...this.activeParameterSchemaTabs
};
newState[param.name] = e.target.dataset.tab;
this.activeParameterSchemaTabs = newState;
}
}}">
<button class="tab-btn ${this.activeParameterSchemaTabs[param.name] === 'example' ? 'active' : ''}" data-tab = 'example'>EXAMPLE </button>
<button class="tab-btn ${this.activeParameterSchemaTabs[param.name] !== 'example' ? 'active' : ''}" data-tab = 'schema'>SCHEMA</button>
</div>
${this.activeParameterSchemaTabs[param.name] === 'example' ? lit_html_x`<div class="tab-content col">
<textarea
class = "textarea request-param"
part = "textarea textarea-param"
data-ptype = "${paramType}-object"
data-pname = "${param.name}"
data-example = "${example.exampleVal}"
data-param-serialize-style = "${paramStyle}"
data-param-serialize-explode = "${paramExplode}"
data-param-allow-reserved = "${paramAllowReserved}"
data-x-fill-example = "${param['x-fill-example'] || 'yes'}"
spellcheck = "false"
.textContent="${param['x-fill-example'] === 'no' ? '' : live_l(this.fillRequestFieldsWithExample === 'true' ? typeof example.exampleVal === 'object' ? JSON.stringify(example.exampleVal, null, 2) : example.exampleVal : '')}"
style = "resize:vertical; width:100%; height: ${'read focused'.includes(this.renderStyle) ? '180px' : '120px'};"
@input=${e => {
const requestPanelEl = this.getRequestPanel(e);
this.liveCURLSyntaxUpdate(requestPanelEl);
}}
></textarea>
</div>` : lit_html_x`
<div class="tab-content col">
<schema-tree
class = 'json'
style = 'display: block'
.data = '${schemaAsObj}'
schema-expand-level = "${this.schemaExpandLevel}"
schema-description-expanded = "${this.schemaDescriptionExpanded}"
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
schema-hide-read-only = "${this.schemaHideReadOnly.includes(this.method)}"
schema-hide-write-only = "${this.schemaHideWriteOnly.includes(this.method)}"
exportparts = "wrap-request-btn:wrap-request-btn, btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, btn-clear:btn-clear, btn-clear-resp:btn-clear-resp,
file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param,
anchor:anchor, anchor-param-example:anchor-param-example"
> </schema-tree>
</div>`}
</div>` : lit_html_x`
<input type="${paramSchema.format === 'password' ? 'password' : 'text'}" spellcheck="false" style="width:100%"
class="request-param"
part="textbox textbox-param"
data-ptype="${paramType}"
data-pname="${param.name}"
data-example="${Array.isArray(example.exampleVal) ? example.exampleVal.join('~|~') : example.exampleVal}"
data-param-allow-reserved = "${paramAllowReserved}"
data-x-fill-example = "${param['x-fill-example'] || 'yes'}"
data-array="false"
.value="${param['x-fill-example'] === 'no' ? '' : live_l(this.fillRequestFieldsWithExample === 'true' ? example.exampleVal : '')}"
@input=${e => {
const requestPanelEl = this.getRequestPanel(e);
this.liveCURLSyntaxUpdate(requestPanelEl);
}}
/>`}
</td>` : ''}
${paramSchema.default || paramSchema.constrain || paramSchema.allowedValues || paramSchema.pattern ? lit_html_x`
<td colspan="${this.allowTry === 'true' ? '1' : '2'}">
<div class="param-constraint">
${paramSchema.default ? lit_html_x`<span style="font-weight:bold">Default: </span>${paramSchema.default}<br/>` : ''}
${paramSchema.pattern ? lit_html_x`<span style="font-weight:bold">Pattern: </span>${paramSchema.pattern}<br/>` : ''}
${paramSchema.constrain ? lit_html_x`${paramSchema.constrain}<br/>` : ''}
${paramSchema.allowedValues && paramSchema.allowedValues.split('┃').map((v, i) => lit_html_x`
${i > 0 ? '┃' : lit_html_x`<span style="font-weight:bold">Allowed: </span>`}
${lit_html_x`
<a part="anchor anchor-param-constraint" class = "${this.allowTry === 'true' ? '' : 'inactive-link'}"
data-type="${paramSchema.type === 'array' ? paramSchema.type : 'string'}"
data-enum="${v.trim()}"
@click="${e => {
const inputEl = e.target.closest('table').querySelector(`[data-pname="${param.name}"]`);
if (inputEl) {
if (e.target.dataset.type === 'array') {
inputEl.value = [e.target.dataset.enum];
} else {
inputEl.value = e.target.dataset.enum;
}
}
}}"
>${v}</a>`}`)}
</div>
</td>` : lit_html_x`<td></td>`}
</tr>
<tr>
${this.allowTry === 'true' ? lit_html_x`<td style="border:none"> </td>` : ''}
<td colspan="2" style="border:none">
<span class="m-markdown-small">${unsafe_html_o(marked(param.description || ''))}</span>
${this.exampleListTemplate.call(this, param.name, paramSchema.type, example.exampleList)}
</td>
</tr>
`);
}
return lit_html_x`
<div class="table-title top-gap">${title}</div>
<div style="display:block; overflow-x:auto; max-width:100%;">
<table role="presentation" class="m-table" style="width:100%; word-break:break-word;">
${tableRows}
</table>
</div>`;
}
// This method is called before navigation change in focused mode
async beforeNavigationFocusedMode() {
// this.saveExampleState();
}
// This method is called after navigation change in focused mode
async afterNavigationFocusedMode() {
this.selectedRequestBodyType = '';
this.selectedRequestBodyExample = '';
this.updateExamplesFromDataAttr();
this.clearResponseData();
}
// Request-Body Event Handlers
onSelectExample(e) {
this.selectedRequestBodyExample = e.target.value;
const exampleDropdownEl = e.target;
window.setTimeout(selectEl => {
const readOnlyExampleEl = selectEl.closest('.example-panel').querySelector('.request-body-param');
const userInputExampleTextareaEl = selectEl.closest('.example-panel').querySelector('.request-body-param-user-input');
userInputExampleTextareaEl.value = readOnlyExampleEl.innerText;
const requestPanelEl = this.getRequestPanel({
target: selectEl
});
this.liveCURLSyntaxUpdate(requestPanelEl);
}, 0, exampleDropdownEl);
}
onMimeTypeChange(e) {
this.selectedRequestBodyType = e.target.value;
const mimeDropdownEl = e.target;
this.selectedRequestBodyExample = '';
window.setTimeout(selectEl => {
const readOnlyExampleEl = selectEl.closest('.request-body-container').querySelector('.request-body-param');
if (readOnlyExampleEl) {
const userInputExampleTextareaEl = selectEl.closest('.request-body-container').querySelector('.request-body-param-user-input');
userInputExampleTextareaEl.value = readOnlyExampleEl.innerText;
}
}, 0, mimeDropdownEl);
}
requestBodyTemplate() {
if (!this.request_body) {
return '';
}
if (Object.keys(this.request_body).length === 0) {
return '';
}
// Variable to store partial HTMLs
let reqBodyTypeSelectorHtml = '';
let reqBodyFileInputHtml = '';
let reqBodyFormHtml = '';
let reqBodySchemaHtml = '';
let reqBodyExampleHtml = '';
const requestBodyTypes = [];
const {
content
} = this.request_body;
for (const mimeType in content) {
requestBodyTypes.push({
mimeType,
schema: content[mimeType].schema,
example: content[mimeType].example,
examples: content[mimeType].examples
});
if (!this.selectedRequestBodyType) {
this.selectedRequestBodyType = mimeType;
}
}
// MIME Type selector
reqBodyTypeSelectorHtml = requestBodyTypes.length === 1 ? '' : lit_html_x`
<select style="min-width:100px; max-width:100%; margin-bottom:-1px;" @change = '${e => this.onMimeTypeChange(e)}'>
${requestBodyTypes.map(reqBody => lit_html_x`
<option value = '${reqBody.mimeType}' ?selected = '${reqBody.mimeType === this.selectedRequestBodyType}'>
${reqBody.mimeType}
</option> `)}
</select>
`;
// For Loop - Main
requestBodyTypes.forEach(reqBody => {
let schemaAsObj;
let reqBodyExamples = [];
if (this.selectedRequestBodyType.includes('json') || this.selectedRequestBodyType.includes('xml') || this.selectedRequestBodyType.includes('text') || this.selectedRequestBodyType.includes('jose')) {
// Generate Example
if (reqBody.mimeType === this.selectedRequestBodyType) {
reqBodyExamples = generateExample(reqBody.schema, reqBody.mimeType, reqBody.examples, reqBody.example, this.callback === 'true' || this.webhook === 'true' ? true : false,
// eslint-disable-line no-unneeded-ternary
this.callback === 'true' || this.webhook === 'true' ? false : true,
// eslint-disable-line no-unneeded-ternary
'text', false);
if (!this.selectedRequestBodyExample) {
this.selectedRequestBodyExample = reqBodyExamples.length > 0 ? reqBodyExamples[0].exampleId : '';
}
reqBodyExampleHtml = lit_html_x`
${reqBodyExampleHtml}
<div class = 'example-panel border-top pad-top-8'>
${reqBodyExamples.length === 1 ? '' : lit_html_x`
<select style="min-width:100px; max-width:100%; margin-bottom:-1px;" @change='${e => this.onSelectExample(e)}'>
${reqBodyExamples.map(v => lit_html_x`<option value="${v.exampleId}" ?selected=${v.exampleId === this.selectedRequestBodyExample} >
${v.exampleSummary.length > 80 ? v.exampleId : v.exampleSummary ? v.exampleSummary : v.exampleId}
</option>`)}
</select>
`}
${reqBodyExamples.filter(v => v.exampleId === this.selectedRequestBodyExample).map(v => lit_html_x`
<div class="example ${v.exampleId === this.selectedRequestBodyExample ? 'example-selected' : ''}" data-example = '${v.exampleId}'>
${v.exampleSummary && v.exampleSummary.length > 80 ? lit_html_x`<div style="padding: 4px 0"> ${v.exampleSummary} </div>` : ''}
${v.exampleDescription ? lit_html_x`<div class="m-markdown-small" style="padding: 4px 0"> ${unsafe_html_o(marked(v.exampleDescription || ''))} </div>` : ''}
<!-- This pre(hidden) is to store the original example value, this will remain unchanged when users switches from one example to another, its is used to populate the editable textarea -->
<pre
class = "textarea is-hidden request-body-param ${reqBody.mimeType.substring(reqBody.mimeType.indexOf('/') + 1)}"
spellcheck = "false"
data-ptype = "${reqBody.mimeType}"
style="width:100%; resize:vertical; display:none"
>${v.exampleFormat === 'text' ? v.exampleValue : JSON.stringify(v.exampleValue, null, 2)}</pre>
<!-- this textarea is for user to edit the example -->
<textarea
class = "textarea request-body-param-user-input"
part = "textarea textarea-param"
spellcheck = "false"
data-ptype = "${reqBody.mimeType}"
data-example = "${v.exampleFormat === 'text' ? v.exampleValue : JSON.stringify(v.exampleValue, null, 2)}"
data-example-format = "${v.exampleFormat}"
style="width:100%; resize:vertical;"
.textContent = "${this.fillRequestFieldsWithExample === 'true' ? v.exampleFormat === 'text' ? v.exampleValue : JSON.stringify(v.exampleValue, null, 2) : ''}"
@input=${e => {
const requestPanelEl = this.getRequestPanel(e);
this.liveCURLSyntaxUpdate(requestPanelEl);
}}
></textarea>
</div>
`)}
</div>
`;
}
} else if (this.selectedRequestBodyType.includes('form-urlencoded') || this.selectedRequestBodyType.includes('form-data')) {
if (reqBody.mimeType === this.selectedRequestBodyType) {
const ex = generateExample(reqBody.schema, reqBody.mimeType, reqBody.examples, reqBody.example, this.callback === 'true' || this.webhook === 'true' ? true : false,
// eslint-disable-line no-unneeded-ternary
this.callback === 'true' || this.webhook === 'true' ? false : true,
// eslint-disable-line no-unneeded-ternary
'text', false);
if (reqBody.schema) {
reqBodyFormHtml = this.formDataTemplate(reqBody.schema, reqBody.mimeType, ex[0] ? ex[0].exampleValue : '');
}
}
} else if (/^audio\/|^image\/|^video\/|^font\/|tar$|zip$|7z$|rtf$|msword$|excel$|\/pdf$|\/octet-stream$/.test(this.selectedRequestBodyType)) {
if (reqBody.mimeType === this.selectedRequestBodyType) {
reqBodyFileInputHtml = lit_html_x`
<div class = "small-font-size bold-text row">
<input type="file" part="file-input" style="max-width:100%" class="request-body-param-file" data-ptype="${reqBody.mimeType}" spellcheck="false" />
</div>
`;
}
}
// Generate Schema
if (reqBody.mimeType.includes('json') || reqBody.mimeType.includes('xml') || reqBody.mimeType.includes('text') || this.selectedRequestBodyType.includes('jose')) {
schemaAsObj = schemaInObjectNotation(reqBody.schema, {});
if (this.schemaStyle === 'table') {
reqBodySchemaHtml = lit_html_x`
${reqBodySchemaHtml}
<schema-table
class = '${reqBody.mimeType.substring(reqBody.mimeType.indexOf('/') + 1)}'
style = 'display: ${this.selectedRequestBodyType === reqBody.mimeType ? 'block' : 'none'};'
.data = '${schemaAsObj}'
schema-expand-level = "${this.schemaExpandLevel}"
schema-description-expanded = "${this.schemaDescriptionExpanded}"
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
schema-hide-read-only = "${this.schemaHideReadOnly}"
schema-hide-write-only = "${this.schemaHideWriteOnly}"
exportparts = "schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
> </schema-table>
`;
} else if (this.schemaStyle === 'tree') {
reqBodySchemaHtml = lit_html_x`
${reqBodySchemaHtml}
<schema-tree
class = "${reqBody.mimeType.substring(reqBody.mimeType.indexOf('/') + 1)}"
style = "display: ${this.selectedRequestBodyType === reqBody.mimeType ? 'block' : 'none'};"
.data = "${schemaAsObj}"
schema-expand-level = "${this.schemaExpandLevel}"
schema-description-expanded = "${this.schemaDescriptionExpanded}"
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
schema-hide-read-only = "${this.schemaHideReadOnly}"
schema-hide-write-only = "${this.schemaHideWriteOnly}"
exportparts = "schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
> </schema-tree>
`;
}
}
});
return lit_html_x`
<div class='request-body-container' data-selected-request-body-type="${this.selectedRequestBodyType}">
<div class="table-title top-gap row">
REQUEST BODY ${this.request_body.required ? lit_html_x`<span class="mono-font" style='color:var(--red)'>*</span>` : ''}
<span style = "font-weight:normal; margin-left:5px"> ${this.selectedRequestBodyType}</span>
<span style="flex:1"></span>
${reqBodyTypeSelectorHtml}
</div>
${this.request_body.description ? lit_html_x`<div class="m-markdown" style="margin-bottom:12px">${unsafe_html_o(marked(this.request_body.description))}</div>` : ''}
${this.selectedRequestBodyType.includes('json') || this.selectedRequestBodyType.includes('xml') || this.selectedRequestBodyType.includes('text') || this.selectedRequestBodyType.includes('jose') ? lit_html_x`
<div class="tab-panel col" style="border-width:0 0 1px 0;">
<div class="tab-buttons row" @click="${e => {
if (e.target.tagName.toLowerCase() === 'button') {
this.activeSchemaTab = e.target.dataset.tab;
}
}}">
<button class="tab-btn ${this.activeSchemaTab === 'example' ? 'active' : ''}" data-tab = 'example'>EXAMPLE</button>
<button class="tab-btn ${this.activeSchemaTab !== 'example' ? 'active' : ''}" data-tab = 'schema'>SCHEMA</button>
</div>
${lit_html_x`<div class="tab-content col" style="display:${this.activeSchemaTab === 'example' ? 'block' : 'none'};"> ${reqBodyExampleHtml}</div>`}
${lit_html_x`<div class="tab-content col" style="display:${this.activeSchemaTab === 'example' ? 'none' : 'block'};"> ${reqBodySchemaHtml}</div>`}
</div>` : lit_html_x`
${reqBodyFileInputHtml}
${reqBodyFormHtml}`}
</div>
`;
}
formDataParamAsObjectTemplate(fieldName, fieldSchema, mimeType) {
var _formdataPartExample$;
// This template is used when form-data param should be send as a object (application/json, application/xml)
const formdataPartSchema = schemaInObjectNotation(fieldSchema, {});
const formdataPartExample = generateExample(fieldSchema, 'json', fieldSchema.examples, fieldSchema.example, this.callback === 'true' || this.webhook === 'true' ? true : false,
// eslint-disable-line no-unneeded-ternary
this.callback === 'true' || this.webhook === 'true' ? false : true,
// eslint-disable-line no-unneeded-ternary
'text', false);
return lit_html_x`
<div class="tab-panel row" style="min-height:220px; border-left: 6px solid var(--light-border-color); align-items: stretch;">
<div style="width:24px; background-color:var(--light-border-color)">
<div class="row" style="flex-direction:row-reverse; width:160px; height:24px; transform:rotate(270deg) translateX(-160px); transform-origin:top left; display:block;" @click="${e => {
if (e.target.classList.contains('v-tab-btn')) {
const {
tab
} = e.target.dataset;
if (tab) {
const tabPanelEl = e.target.closest('.tab-panel');
const selectedTabBtnEl = tabPanelEl.querySelector(`.v-tab-btn[data-tab="${tab}"]`);
const otherTabBtnEl = [...tabPanelEl.querySelectorAll(`.v-tab-btn:not([data-tab="${tab}"])`)];
const selectedTabContentEl = tabPanelEl.querySelector(`.tab-content[data-tab="${tab}"]`);
const otherTabContentEl = [...tabPanelEl.querySelectorAll(`.tab-content:not([data-tab="${tab}"])`)];
selectedTabBtnEl.classList.add('active');
selectedTabContentEl.style.display = 'block';
otherTabBtnEl.forEach(el => {
el.classList.remove('active');
});
otherTabContentEl.forEach(el => {
el.style.display = 'none';
});
}
}
if (e.target.tagName.toLowerCase() === 'button') {
this.activeSchemaTab = e.target.dataset.tab;
}
}}">
<button class="v-tab-btn ${this.activeSchemaTab === 'example' ? 'active' : ''}" data-tab = 'example'>EXAMPLE</button>
<button class="v-tab-btn ${this.activeSchemaTab !== 'example' ? 'active' : ''}" data-tab = 'schema'>SCHEMA</button>
</div>
</div>
${lit_html_x`
<div class="tab-content col" data-tab = 'example' style="display:${this.activeSchemaTab === 'example' ? 'block' : 'none'}; padding-left:5px; width:100%">
<textarea
class = "textarea"
part = "textarea textarea-param"
style = "width:100%; border:none; resize:vertical;"
data-array = "false"
data-ptype = "${mimeType.includes('form-urlencode') ? 'form-urlencode' : 'form-data'}"
data-pname = "${fieldName}"
data-example = "${((_formdataPartExample$ = formdataPartExample[0]) === null || _formdataPartExample$ === void 0 ? void 0 : _formdataPartExample$.exampleValue) || ''}"
.textContent = "${this.fillRequestFieldsWithExample === 'true' ? formdataPartExample[0].exampleValue : ''}"
spellcheck = "false"
></textarea>
</div>`}
${lit_html_x`
<div class="tab-content col" data-tab = 'schema' style="display:${this.activeSchemaTab !== 'example' ? 'block' : 'none'}; padding-left:5px; width:100%;">
<schema-tree
.data = '${formdataPartSchema}'
schema-expand-level = "${this.schemaExpandLevel}"
schema-description-expanded = "${this.schemaDescriptionExpanded}"
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}",
> </schema-tree>
</div>`}
</div>
`;
}
formDataTemplate(schema, mimeType, exampleValue = '') {
const formDataTableRows = [];
if (schema.properties) {
for (const fieldName in schema.properties) {
var _schema$required, _fieldSchema$items;
const fieldSchema = schema.properties[fieldName];
if (fieldSchema.readOnly) {
continue;
}
const fieldExamples = fieldSchema.examples || fieldSchema.example || '';
const fieldType = fieldSchema.type;
const paramSchema = getTypeInfo(fieldSchema);
const labelColWidth = 'read focused'.includes(this.renderStyle) ? '200px' : '160px';
const example = normalizeExamples(paramSchema.examples || paramSchema.example, paramSchema.type);
formDataTableRows.push(lit_html_x`
<tr title="${fieldSchema.deprecated ? 'Deprecated' : ''}">
<td style="width:${labelColWidth}; min-width:100px;">
<div class="param-name ${fieldSchema.deprecated ? 'deprecated' : ''}">
${fieldName}${(_schema$required = schema.required) !== null && _schema$required !== void 0 && _schema$required.includes(fieldName) || fieldSchema.required ? lit_html_x`<span style='color:var(--red);'>*</span>` : ''}
</div>
<div class="param-type">${paramSchema.type}</div>
</td>
<td
style="${fieldType === 'object' ? 'width:100%; padding:0;' : this.allowTry === 'true' ? '' : 'display:none;'} min-width:100px;"
colspan="${fieldType === 'object' ? 2 : 1}">
${fieldType === 'array' ? ((_fieldSchema$items = fieldSchema.items) === null || _fieldSchema$items === void 0 ? void 0 : _fieldSchema$items.format) === 'binary' ? lit_html_x`
<div class="file-input-container col" style='align-items:flex-end;' @click="${e => this.onAddRemoveFileInput(e, fieldName, mimeType)}">
<div class='input-set row'>
<input
type = "file"
part = "file-input"
style = "width:100%"
data-pname = "${fieldName}"
data-ptype = "${mimeType.includes('form-urlencode') ? 'form-urlencode' : 'form-data'}"
data-array = "false"
data-file-array = "true"
/>
<button class="file-input-remove-btn"> &#x2715; </button>
</div>
<button class="m-btn primary file-input-add-btn" part="btn btn-fill" style="margin:2px 25px 0 0; padding:2px 6px;">ADD</button>
</div>
` : lit_html_x`
<tag-input
style = "width:100%"
data-ptype = "${mimeType.includes('form-urlencode') ? 'form-urlencode' : 'form-data'}"
data-pname = "${fieldName}"
data-example = "${Array.isArray(fieldExamples) ? fieldExamples.join('~|~') : fieldExamples}"
data-array = "true"
placeholder = "add-multiple &#x21a9;"
.value = "${Array.isArray(fieldExamples) ? Array.isArray(fieldExamples[0]) ? fieldExamples[0] : [fieldExamples[0]] : [fieldExamples]}"
>
</tag-input>
` : lit_html_x`
${fieldType === 'object' ? this.formDataParamAsObjectTemplate.call(this, fieldName, fieldSchema, mimeType) : lit_html_x`
${this.allowTry === 'true' ? lit_html_x`<input
.value = "${this.fillRequestFieldsWithExample === 'true' ? example.exampleVal : ''}"
spellcheck = "false"
type = "${fieldSchema.format === 'binary' ? 'file' : fieldSchema.format === 'password' ? 'password' : 'text'}"
part = "textbox textbox-param"
style = "width:100%"
data-ptype = "${mimeType.includes('form-urlencode') ? 'form-urlencode' : 'form-data'}"
data-pname = "${fieldName}"
data-example = "${Array.isArray(fieldExamples) ? fieldExamples[0] : fieldExamples}"
data-array = "false"
/>` : ''}
`}`}
</td>
${fieldType === 'object' ? '' : lit_html_x`
<td>
${paramSchema.default || paramSchema.constrain || paramSchema.allowedValues || paramSchema.pattern ? lit_html_x`
<div class="param-constraint">
${paramSchema.default ? lit_html_x`<span style="font-weight:bold">Default: </span>${paramSchema.default}<br/>` : ''}
${paramSchema.pattern ? lit_html_x`<span style="font-weight:bold">Pattern: </span>${paramSchema.pattern}<br/>` : ''}
${paramSchema.constrain ? lit_html_x`${paramSchema.constrain}<br/>` : ''}
${paramSchema.allowedValues && paramSchema.allowedValues.split('┃').map((v, i) => lit_html_x`
${i > 0 ? '┃' : lit_html_x`<span style="font-weight:bold">Allowed: </span>`}
${lit_html_x`
<a part="anchor anchor-param-constraint" class = "${this.allowTry === 'true' ? '' : 'inactive-link'}"
data-type="${paramSchema.type === 'array' ? paramSchema.type : 'string'}"
data-enum="${v.trim()}"
@click="${e => {
const inputEl = e.target.closest('table').querySelector(`[data-pname="${fieldName}"]`);
if (inputEl) {
if (e.target.dataset.type === 'array') {
inputEl.value = [e.target.dataset.enum];
} else {
inputEl.value = e.target.dataset.enum;
}
}
}}"
>
${v}
</a>`}`)}
</div>` : ''}
</td>`}
</tr>
${fieldType === 'object' ? '' : lit_html_x`
<tr>
<td style="border:none"> </td>
<td colspan="2" style="border:none; margin-top:0; padding:0 5px 8px 5px;">
<span class="m-markdown-small">${unsafe_html_o(marked(fieldSchema.description || ''))}</span>
${this.exampleListTemplate.call(this, fieldName, paramSchema.type, example.exampleList)}
</td>
</tr>
`}`);
}
return lit_html_x`
<table role="presentation" style="width:100%;" class="m-table">
${formDataTableRows}
</table>
`;
}
return lit_html_x`
<textarea
class = "textarea dynamic-form-param ${mimeType}"
part = "textarea textarea-param"
spellcheck = "false"
data-pname="dynamic-form"
data-ptype="${mimeType}"
.textContent = "${exampleValue}"
style="width:100%"
></textarea>
${schema.description ? lit_html_x`<span class="m-markdown-small">${unsafe_html_o(marked(schema.description))}</span>` : ''}
`;
}
curlSyntaxTemplate(display = 'flex') {
return lit_html_x`
<div class="col m-markdown" style="flex:1; display:${display}; position:relative; max-width: 100%;">
<button class="toolbar-btn" style = "position:absolute; top:12px; right:8px" @click='${e => {
copyToClipboard(this.curlSyntax.replace(/\\$/, ''), e);
}}' part="btn btn-fill"> Copy </button>
<pre style="white-space:pre"><code>${unsafe_html_o(prism_default().highlight(this.curlSyntax.trim().replace(/\\$/, ''), (prism_default()).languages.shell, 'shell'))}</code></pre>
</div>
`;
}
apiResponseTabTemplate() {
let responseFormat = '';
let responseContent = '';
if (!this.responseIsBlob) {
if (this.responseHeaders.includes('application/x-ndjson')) {
responseFormat = 'json';
const prismLines = this.responseText.split('\n').map(q => prism_default().highlight(q, (prism_default()).languages[responseFormat], responseFormat)).join('\n');
responseContent = lit_html_x`<code>${unsafe_html_o(prismLines)}</code>`;
} else if (this.responseHeaders.includes('json')) {
responseFormat = 'json';
responseContent = lit_html_x`<code>${unsafe_html_o(prism_default().highlight(this.responseText, (prism_default()).languages[responseFormat], responseFormat))}</code>`;
} else if (this.responseHeaders.includes('html') || this.responseHeaders.includes('xml')) {
responseFormat = 'html';
responseContent = lit_html_x`<code>${unsafe_html_o(prism_default().highlight(this.responseText, (prism_default()).languages[responseFormat], responseFormat))}</code>`;
} else {
responseFormat = 'text';
responseContent = lit_html_x`<code>${this.responseText}</code>`;
}
}
return lit_html_x`
<div class="row" style="font-size:var(--font-size-small); margin:5px 0">
<div class="response-message ${this.responseStatus}">Response Status: ${this.responseMessage}</div>
<div style="flex:1"></div>
<button class="m-btn" part="btn btn-outline btn-clear-response" @click="${this.clearResponseData}">CLEAR RESPONSE</button>
</div>
<div class="tab-panel col" style="border-width:0 0 1px 0;">
<div id="tab_buttons" class="tab-buttons row" @click="${e => {
if (e.target.classList.contains('tab-btn') === false) {
return;
}
this.activeResponseTab = e.target.dataset.tab;
}}">
<button class="tab-btn ${this.activeResponseTab === 'response' ? 'active' : ''}" data-tab = 'response' > RESPONSE</button>
<button class="tab-btn ${this.activeResponseTab === 'headers' ? 'active' : ''}" data-tab = 'headers' > RESPONSE HEADERS</button>
${this.showCurlBeforeTry === 'true' ? '' : lit_html_x`<button class="tab-btn ${this.activeResponseTab === 'curl' ? 'active' : ''}" data-tab = 'curl'>CURL</button>`}
</div>
${this.responseIsBlob ? lit_html_x`
<div class="tab-content col" style="flex:1; display:${this.activeResponseTab === 'response' ? 'flex' : 'none'};">
<button class="m-btn thin-border mar-top-8" style="width:135px" @click='${e => {
downloadResource(this.responseBlobUrl, this.respContentDisposition, e);
}}' part="btn btn-outline">
DOWNLOAD
</button>
${this.responseBlobType === 'view' ? lit_html_x`<button class="m-btn thin-border mar-top-8" style="width:135px" @click='${e => {
viewResource(this.responseBlobUrl, e);
}}' part="btn btn-outline">VIEW (NEW TAB)</button>` : ''}
</div>` : lit_html_x`
<div class="tab-content col m-markdown" style="flex:1; display:${this.activeResponseTab === 'response' ? 'flex' : 'none'};" >
<button class="toolbar-btn" style="position:absolute; top:12px; right:8px" @click='${e => {
copyToClipboard(this.responseText, e);
}}' part="btn btn-fill"> Copy </button>
<pre style="white-space:pre; min-height:50px; height:var(--resp-area-height, 400px); resize:vertical; overflow:auto">${responseContent}</pre>
</div>`}
<div class="tab-content col m-markdown" style="flex:1; display:${this.activeResponseTab === 'headers' ? 'flex' : 'none'};" >
<button class="toolbar-btn" style = "position:absolute; top:12px; right:8px" @click='${e => {
copyToClipboard(this.responseHeaders, e);
}}' part="btn btn-fill"> Copy </button>
<pre style="white-space:pre"><code>${unsafe_html_o(prism_default().highlight(this.responseHeaders, (prism_default()).languages.css, 'css'))}</code></pre>
</div>
${this.showCurlBeforeTry === 'true' ? '' : this.curlSyntaxTemplate(this.activeResponseTab === 'curl' ? 'flex' : 'none')}
</div>`;
}
apiCallTemplate() {
var _this$security, _this$api_keys$;
let selectServerDropdownHtml = '';
if (this.servers && this.servers.length > 0) {
selectServerDropdownHtml = lit_html_x`
<select style="min-width:100px;" @change='${e => {
this.serverUrl = e.target.value;
}}'>
${this.servers.map(v => lit_html_x`<option value = "${v.url}"> ${v.url} - ${v.description} </option>`)}
</select>
`;
}
const selectedServerHtml = lit_html_x`
<div style="display:flex; flex-direction:column;">
${selectServerDropdownHtml}
${this.serverUrl ? lit_html_x`
<div style="display:flex; align-items:baseline;">
<div style="font-weight:bold; padding-right:5px;">API Server</div>
<span class = "gray-text"> ${this.serverUrl} </span>
</div>
` : ''}
</div>
`;
return lit_html_x`
<div style="display:flex; align-items:flex-end; margin:16px 0; font-size:var(--font-size-small);" part="wrap-request-btn">
<div class="hide-in-small-screen" style="flex-direction:column; margin:0; width:calc(100% - 60px);">
<div style="display:flex; flex-direction:row; align-items:center; overflow:hidden;">
${selectedServerHtml}
</div>
<div style="display:flex;">
<div style="font-weight:bold; padding-right:5px;">Authentication</div>
${((_this$security = this.security) === null || _this$security === void 0 ? void 0 : _this$security.length) > 0 ? lit_html_x`
${this.api_keys.length > 0 ? lit_html_x`<div style="color:var(--blue); overflow:hidden;">
${this.api_keys.length === 1 ? `${(_this$api_keys$ = this.api_keys[0]) === null || _this$api_keys$ === void 0 ? void 0 : _this$api_keys$.typeDisplay} in ${this.api_keys[0].in}` : `${this.api_keys.length} API keys applied`}
</div>` : lit_html_x`<div class="gray-text">Required <span style="color:var(--red)">(None Applied)</span>`}` : lit_html_x`<span class="gray-text"> Not Required </span>`}
</div>
</div>
${this.parameters.length > 0 || this.request_body ? lit_html_x`
<button class="m-btn thin-border" part="btn btn-outline btn-fill" style="margin-right:5px;" @click="${this.onFillRequestData}" title="Fills with example data (if provided)">
FILL EXAMPLE
</button>
<button class="m-btn thin-border" part="btn btn-outline btn-clear" style="margin-right:5px;" @click="${this.onClearRequestData}">
CLEAR
</button>` : ''}
<button class="m-btn primary thin-border" part="btn btn-try" @click="${this.onTryClick}">TRY</button>
</div>
<div class="row" style="font-size:var(--font-size-small); margin:5px 0">
${this.showCurlBeforeTry === 'true' ? this.curlSyntaxTemplate() : ''}
</div>
${this.responseMessage === '' ? '' : this.apiResponseTabTemplate()}
`;
}
/* eslint-enable indent */
async onFillRequestData(e) {
const requestPanelEl = e.target.closest('.request-panel');
const requestPanelInputEls = [...requestPanelEl.querySelectorAll('input, tag-input, textarea:not(.is-hidden)')];
requestPanelInputEls.forEach(el => {
if (el.dataset.example) {
if (el.tagName.toUpperCase() === 'TAG-INPUT') {
el.value = el.dataset.example.split('~|~');
} else {
el.value = el.dataset.example;
}
}
});
}
async onClearRequestData(e) {
const requestPanelEl = e.target.closest('.request-panel');
const requestPanelInputEls = [...requestPanelEl.querySelectorAll('input, tag-input, textarea:not(.is-hidden)')];
requestPanelInputEls.forEach(el => {
el.value = '';
});
}
buildFetchURL(requestPanelEl) {
let fetchUrl;
const pathParamEls = [...requestPanelEl.querySelectorAll("[data-ptype='path']")];
const queryParamEls = [...requestPanelEl.querySelectorAll("[data-ptype='query']")];
const queryParamObjTypeEls = [...requestPanelEl.querySelectorAll("[data-ptype='query-object']")];
fetchUrl = this.path;
// Generate URL using Path Params
pathParamEls.map(el => {
fetchUrl = fetchUrl.replace(`{${el.dataset.pname}}`, encodeURIComponent(el.value));
});
// Query Params
const urlQueryParamsMap = new Map();
const queryParamsWithReservedCharsAllowed = [];
if (queryParamEls.length > 0) {
queryParamEls.forEach(el => {
const queryParam = new URLSearchParams();
if (el.dataset.paramAllowReserved === 'true') {
queryParamsWithReservedCharsAllowed.push(el.dataset.pname);
}
if (el.dataset.array === 'false') {
if (el.value !== '') {
queryParam.append(el.dataset.pname, el.value);
}
} else {
const {
paramSerializeStyle,
paramSerializeExplode
} = el.dataset;
let vals = el.value && Array.isArray(el.value) ? el.value : [];
vals = Array.isArray(vals) ? vals.filter(v => v !== '') : [];
if (vals.length > 0) {
if (paramSerializeStyle === 'spaceDelimited') {
queryParam.append(el.dataset.pname, vals.join(' ').replace(/^\s|\s$/g, ''));
} else if (paramSerializeStyle === 'pipeDelimited') {
queryParam.append(el.dataset.pname, vals.join('|').replace(/^\||\|$/g, ''));
} else {
if (paramSerializeExplode === 'true') {
// eslint-disable-line no-lonely-if
vals.forEach(v => {
queryParam.append(el.dataset.pname, v);
});
} else {
queryParam.append(el.dataset.pname, vals.join(',').replace(/^,|,$/g, ''));
}
}
}
}
if (queryParam.toString()) {
urlQueryParamsMap.set(el.dataset.pname, queryParam);
}
});
}
// Query Params (Dynamic - create from JSON)
if (queryParamObjTypeEls.length > 0) {
queryParamObjTypeEls.map(el => {
const queryParam = new URLSearchParams();
try {
let queryParamObj = {};
const {
paramSerializeStyle,
paramSerializeExplode,
pname
} = el.dataset;
queryParamObj = Object.assign(queryParamObj, JSON.parse(el.value.replace(/\s+/g, ' ')));
if (el.dataset.paramAllowReserved === 'true') {
queryParamsWithReservedCharsAllowed.push(el.dataset.pname);
}
if ('json xml'.includes(paramSerializeStyle)) {
if (paramSerializeStyle === 'json') {
queryParam.append(el.dataset.pname, JSON.stringify(queryParamObj));
} else if (paramSerializeStyle === 'xml') {
queryParam.append(el.dataset.pname, json2xml(queryParamObj));
}
} else {
for (const key in queryParamObj) {
const pKey = `${pname}[${key}]`;
if (typeof queryParamObj[key] === 'object') {
if (Array.isArray(queryParamObj[key])) {
if (paramSerializeStyle === 'spaceDelimited') {
queryParam.append(pKey, queryParamObj[key].join(' '));
} else if (paramSerializeStyle === 'pipeDelimited') {
queryParam.append(pKey, queryParamObj[key].join('|'));
} else {
if (paramSerializeExplode === 'true') {
// eslint-disable-line no-lonely-if
queryParamObj[key].forEach(v => {
queryParam.append(pKey, v);
});
} else {
queryParam.append(pKey, queryParamObj[key]);
}
}
}
} else {
queryParam.append(pKey, queryParamObj[key]);
}
}
}
} catch (err) {
console.error('RapiDoc: unable to parse %s into object', el.value); // eslint-disable-line no-console
}
if (queryParam.toString()) {
urlQueryParamsMap.set(el.dataset.pname, queryParam);
}
});
}
let urlQueryParamString = '';
if (urlQueryParamsMap.size) {
urlQueryParamsMap.forEach((val, pname) => {
if (queryParamsWithReservedCharsAllowed.includes(pname)) {
urlQueryParamString += `${pname}=`;
urlQueryParamString += val.getAll(pname).join(`&${pname}=`);
urlQueryParamString += '&';
} else {
urlQueryParamString += `${val.toString()}&`;
}
});
urlQueryParamString = urlQueryParamString.slice(0, -1);
}
if (urlQueryParamString.length !== 0) {
fetchUrl = `${fetchUrl}${fetchUrl.includes('?') ? '&' : '?'}${urlQueryParamString}`;
}
// Add authentication Query-Param if provided
this.api_keys.filter(v => v.in === 'query').forEach(v => {
fetchUrl = `${fetchUrl}${fetchUrl.includes('?') ? '&' : '?'}${v.name}=${encodeURIComponent(v.finalKeyValue)}`;
});
fetchUrl = `${this.serverUrl.replace(/\/$/, '')}${fetchUrl}`;
return fetchUrl;
}
buildFetchHeaders(requestPanelEl) {
var _this$closest;
const respEl = (_this$closest = this.closest('.expanded-req-resp-container, .req-resp-container')) === null || _this$closest === void 0 ? void 0 : _this$closest.getElementsByTagName('api-response')[0];
const headerParamEls = [...requestPanelEl.querySelectorAll("[data-ptype='header']")];
const requestBodyContainerEl = requestPanelEl.querySelector('.request-body-container');
const acceptHeader = respEl === null || respEl === void 0 ? void 0 : respEl.selectedMimeType;
const reqHeaders = new Headers();
if (acceptHeader) {
// Uses the acceptHeader from Response panel
reqHeaders.append('Accept', acceptHeader);
} else if (this.accept) {
reqHeaders.append('Accept', this.accept);
}
// Add Authentication Header if provided
this.api_keys.filter(v => v.in === 'header').forEach(v => {
reqHeaders.append(v.name, v.finalKeyValue);
});
// Add Header Params
headerParamEls.map(el => {
if (el.value) {
reqHeaders.append(el.dataset.pname, el.value);
}
});
if (requestBodyContainerEl) {
const requestBodyType = requestBodyContainerEl.dataset.selectedRequestBodyType;
// Common for all request-body
if (!requestBodyType.includes('form-data')) {
// For multipart/form-data dont set the content-type to allow creation of browser generated part boundaries
reqHeaders.append('Content-Type', requestBodyType);
}
}
return reqHeaders;
}
buildFetchBodyOptions(requestPanelEl) {
const requestBodyContainerEl = requestPanelEl.querySelector('.request-body-container');
const fetchOptions = {
method: this.method.toUpperCase()
};
if (requestBodyContainerEl) {
const requestBodyType = requestBodyContainerEl.dataset.selectedRequestBodyType;
if (requestBodyType.includes('form-urlencoded')) {
// url-encoded Form Params (dynamic) - Parse JSON and generate Params
const formUrlDynamicTextAreaEl = requestPanelEl.querySelector("[data-ptype='dynamic-form']");
if (formUrlDynamicTextAreaEl) {
const val = formUrlDynamicTextAreaEl.value;
const formUrlDynParams = new URLSearchParams();
let proceed = true;
let tmpObj;
if (val) {
try {
tmpObj = JSON.parse(val);
} catch (err) {
proceed = false;
console.warn('RapiDoc: Invalid JSON provided', err); // eslint-disable-line no-console
}
} else {
proceed = false;
}
if (proceed) {
for (const prop in tmpObj) {
formUrlDynParams.append(prop, JSON.stringify(tmpObj[prop]));
}
fetchOptions.body = formUrlDynParams;
}
} else {
// url-encoded Form Params (regular)
const formUrlEls = [...requestPanelEl.querySelectorAll("[data-ptype='form-urlencode']")];
const formUrlParams = new URLSearchParams();
formUrlEls.filter(v => v.type !== 'file').forEach(el => {
if (el.dataset.array === 'false') {
if (el.value) {
formUrlParams.append(el.dataset.pname, el.value);
}
} else {
const vals = el.value && Array.isArray(el.value) ? el.value.join(',') : '';
formUrlParams.append(el.dataset.pname, vals);
}
});
fetchOptions.body = formUrlParams;
}
} else if (requestBodyType.includes('form-data')) {
const formDataParams = new FormData();
const formDataEls = [...requestPanelEl.querySelectorAll("[data-ptype='form-data']")];
formDataEls.forEach(el => {
if (el.dataset.array === 'false') {
if (el.type === 'file' && el.files[0]) {
formDataParams.append(el.dataset.pname, el.files[0], el.files[0].name);
} else if (el.value) {
formDataParams.append(el.dataset.pname, el.value);
}
} else if (el.value && Array.isArray(el.value)) {
formDataParams.append(el.dataset.pname, el.value.join(','));
}
});
fetchOptions.body = formDataParams;
} else if (/^audio\/|^image\/|^video\/|^font\/|tar$|zip$|7z$|rtf$|msword$|excel$|\/pdf$|\/octet-stream$/.test(requestBodyType)) {
const bodyParamFileEl = requestPanelEl.querySelector('.request-body-param-file');
if (bodyParamFileEl !== null && bodyParamFileEl !== void 0 && bodyParamFileEl.files[0]) {
fetchOptions.body = bodyParamFileEl.files[0]; // eslint-disable-line prefer-destructuring
}
} else if (requestBodyType.includes('json') || requestBodyType.includes('xml') || requestBodyType.includes('text')) {
const exampleTextAreaEl = requestPanelEl.querySelector('.request-body-param-user-input');
if (exampleTextAreaEl !== null && exampleTextAreaEl !== void 0 && exampleTextAreaEl.value) {
fetchOptions.body = exampleTextAreaEl.value;
}
}
}
return fetchOptions;
}
async onTryClick(e) {
const tryBtnEl = e.target;
const requestPanelEl = tryBtnEl.closest('.request-panel');
const fetchUrl = this.buildFetchURL(requestPanelEl);
const fetchOptions = this.buildFetchBodyOptions(requestPanelEl);
const reqHeaders = this.buildFetchHeaders(requestPanelEl);
this.responseUrl = '';
this.responseHeaders = [];
this.curlSyntax = this.generateCURLSyntax(fetchUrl, reqHeaders, fetchOptions, requestPanelEl);
this.responseStatus = 'success';
this.responseIsBlob = false;
this.respContentDisposition = '';
if (this.responseBlobUrl) {
URL.revokeObjectURL(this.responseBlobUrl);
this.responseBlobUrl = '';
}
if (this.fetchCredentials) {
fetchOptions.credentials = this.fetchCredentials;
}
const controller = new AbortController();
const {
signal
} = controller;
fetchOptions.headers = reqHeaders;
const tempRequest = {
url: fetchUrl,
...fetchOptions
};
this.dispatchEvent(new CustomEvent('before-try', {
bubbles: true,
composed: true,
detail: {
request: tempRequest,
controller
}
}));
const updatedFetchOptions = {
method: tempRequest.method,
headers: tempRequest.headers,
credentials: tempRequest.credentials,
body: tempRequest.body
};
const fetchRequest = new Request(tempRequest.url, updatedFetchOptions);
let fetchResponse;
let responseClone;
try {
let respBlob;
let respJson;
let respText;
tryBtnEl.disabled = true;
this.responseText = '⌛';
this.responseMessage = '';
this.requestUpdate();
const startTime = performance.now();
fetchResponse = await fetch(fetchRequest, {
signal
});
const endTime = performance.now();
responseClone = fetchResponse.clone(); // create a response clone to allow reading response body again (response.json, response.text etc)
tryBtnEl.disabled = false;
this.responseMessage = lit_html_x`${fetchResponse.statusText ? `${fetchResponse.statusText}:${fetchResponse.status}` : fetchResponse.status} <div style="color:var(--light-fg)"> Took ${Math.round(endTime - startTime)} milliseconds </div>`;
this.responseUrl = fetchResponse.url;
const respHeadersObj = {};
fetchResponse.headers.forEach((hdrVal, hdr) => {
respHeadersObj[hdr] = hdrVal;
this.responseHeaders = `${this.responseHeaders}${hdr}: ${hdrVal}\n`;
});
const contentType = fetchResponse.headers.get('content-type');
const respEmpty = (await fetchResponse.clone().text()).length === 0;
if (respEmpty) {
this.responseText = '';
} else if (contentType) {
if (contentType === 'application/x-ndjson') {
this.responseText = await fetchResponse.text();
} else if (contentType.includes('json')) {
if (/charset=[^"']+/.test(contentType)) {
const encoding = contentType.split('charset=')[1];
const buffer = await fetchResponse.arrayBuffer();
try {
respText = new TextDecoder(encoding).decode(buffer);
} catch {
respText = new TextDecoder('utf-8').decode(buffer);
}
try {
respJson = JSON.parse(respText);
this.responseText = JSON.stringify(respJson, null, 2);
} catch {
this.responseText = respText;
}
} else {
respJson = await fetchResponse.json();
this.responseText = JSON.stringify(respJson, null, 2);
}
// eslint-disable-next-line no-useless-escape
} else if (/^font\/|tar$|zip$|7z$|rtf$|msword$|excel$|\/pdf$|\/octet-stream$|^application\/vnd\./.test(contentType)) {
this.responseIsBlob = true;
this.responseBlobType = 'download';
} else if (/^audio|^image|^video/.test(contentType)) {
this.responseIsBlob = true;
this.responseBlobType = 'view';
} else {
respText = await fetchResponse.text();
if (contentType.includes('xml')) {
this.responseText = dist_default()(respText, {
textNodesOnSameLine: true,
indentor: ' '
});
} else {
this.responseText = respText;
}
}
if (this.responseIsBlob) {
const contentDisposition = fetchResponse.headers.get('content-disposition');
this.respContentDisposition = contentDisposition ? contentDisposition.split('filename=')[1].replace(/"|'/g, '') : 'filename';
respBlob = await fetchResponse.blob();
this.responseBlobUrl = URL.createObjectURL(respBlob);
}
} else {
respText = await fetchResponse.text();
this.responseText = respText;
}
this.dispatchEvent(new CustomEvent('after-try', {
bubbles: true,
composed: true,
detail: {
request: fetchRequest,
response: responseClone,
responseHeaders: respHeadersObj,
responseBody: respJson || respText || respBlob,
responseStatus: responseClone.ok
}
}));
} catch (err) {
tryBtnEl.disabled = false;
if (err.name === 'AbortError') {
this.dispatchEvent(new CustomEvent('request-aborted', {
bubbles: true,
composed: true,
detail: {
err,
request: fetchRequest
}
}));
this.responseMessage = 'Request Aborted';
this.responseText = 'Request Aborted';
} else {
this.dispatchEvent(new CustomEvent('after-try', {
bubbles: true,
composed: true,
detail: {
err,
request: fetchRequest
}
}));
this.responseMessage = `${err.message} (CORS or Network Issue)`;
}
}
this.requestUpdate();
}
liveCURLSyntaxUpdate(requestPanelEl) {
this.applyCURLSyntax(requestPanelEl);
this.requestUpdate();
}
onGenerateCURLClick(e) {
const requestPanelEl = this.getRequestPanel(e);
this.applyCURLSyntax(requestPanelEl);
}
getRequestPanel(e) {
return e.target.closest('.request-panel');
}
applyCURLSyntax(requestPanelEl) {
const fetchUrl = this.buildFetchURL(requestPanelEl);
const fetchOptions = this.buildFetchBodyOptions(requestPanelEl);
const fetchHeaders = this.buildFetchHeaders(requestPanelEl);
this.curlSyntax = this.generateCURLSyntax(fetchUrl, fetchHeaders, fetchOptions, requestPanelEl);
}
generateCURLSyntax(fetchUrl, fetchHeaders, fetchOptions, requestPanelEl) {
let curlUrl;
let curl = '';
let curlHeaders = '';
let curlData = '';
let curlForm = '';
const requestBodyContainerEl = requestPanelEl.querySelector('.request-body-container');
if (fetchUrl.startsWith('http') === false) {
const url = new URL(fetchUrl, window.location.href);
curlUrl = url.href;
} else {
curlUrl = fetchUrl;
}
curl = `curl -X ${this.method.toUpperCase()} "${curlUrl}" \\\n`;
curlHeaders = Array.from(fetchHeaders).map(([key, value]) => ` -H "${key}: ${value}"`).join('\\\n');
if (curlHeaders) {
curlHeaders = `${curlHeaders} \\\n`;
}
if (fetchOptions.body instanceof URLSearchParams) {
curlData = ` -d ${fetchOptions.body.toString()} \\\n`;
} else if (fetchOptions.body instanceof File) {
curlData = ` --data-binary @${fetchOptions.body.name} \\\n`;
} else if (fetchOptions.body instanceof FormData) {
curlForm = Array.from(fetchOptions.body).reduce((aggregator, [key, value]) => {
if (value instanceof File) {
return [...aggregator, ` -F "${key}=@${value.name}"`];
}
const multiple = value.match(/([^,],)/gm);
if (multiple) {
const multipleResults = multiple.map(one => `-F "${key}[]=${one}"`);
return [...aggregator, ...multipleResults];
}
return [...aggregator, ` -F "${key}=${value}"`];
}, []).join('\\\n');
} else if (requestBodyContainerEl && requestBodyContainerEl.dataset.selectedRequestBodyType) {
const requestBodyType = requestBodyContainerEl.dataset.selectedRequestBodyType;
const exampleTextAreaEl = requestPanelEl.querySelector('.request-body-param-user-input');
if (exampleTextAreaEl !== null && exampleTextAreaEl !== void 0 && exampleTextAreaEl.value) {
fetchOptions.body = exampleTextAreaEl.value;
if (requestBodyType.includes('json')) {
try {
curlData = ` -d '${JSON.stringify(JSON.parse(exampleTextAreaEl.value))}' \\\n`;
} catch (err) {
// Ignore.
}
}
if (!curlData) {
curlData = ` -d '${exampleTextAreaEl.value.replace(/'/g, '\'"\'"\'')}' \\\n`;
}
}
}
return `${curl}${curlHeaders}${curlData}${curlForm}`;
}
onAddRemoveFileInput(e, pname, ptype) {
if (e.target.tagName.toLowerCase() !== 'button') {
return;
}
if (e.target.classList.contains('file-input-remove-btn')) {
// Remove File Input Set
const el = e.target.closest('.input-set');
el.remove();
return;
}
const el = e.target.closest('.file-input-container');
// Add File Input Set
// Container
const newInputContainerEl = document.createElement('div');
newInputContainerEl.setAttribute('class', 'input-set row');
// File Input
const newInputEl = document.createElement('input');
newInputEl.type = 'file';
newInputEl.style = 'width:200px; margin-top:2px;';
newInputEl.setAttribute('data-pname', pname);
newInputEl.setAttribute('data-ptype', ptype.includes('form-urlencode') ? 'form-urlencode' : 'form-data');
newInputEl.setAttribute('data-array', 'false');
newInputEl.setAttribute('data-file-array', 'true');
// Remover Button
const newRemoveBtnEl = document.createElement('button');
newRemoveBtnEl.setAttribute('class', 'file-input-remove-btn');
newRemoveBtnEl.innerHTML = '&#x2715;';
newInputContainerEl.appendChild(newInputEl);
newInputContainerEl.appendChild(newRemoveBtnEl);
el.insertBefore(newInputContainerEl, e.target);
// el.appendChild(newInputContainerEl);
}
clearResponseData() {
this.responseUrl = '';
this.responseHeaders = '';
this.responseText = '';
this.responseStatus = 'success';
this.responseMessage = '';
this.responseIsBlob = false;
this.responseBlobType = '';
this.respContentDisposition = '';
if (this.responseBlobUrl) {
URL.revokeObjectURL(this.responseBlobUrl);
this.responseBlobUrl = '';
}
}
disconnectedCallback() {
this.curlSyntax = '';
// Cleanup ObjectURL for the blob data if this component created one
if (this.responseBlobUrl) {
URL.revokeObjectURL(this.responseBlobUrl);
this.responseBlobUrl = '';
}
super.disconnectedCallback();
}
}
// Register the element with the browser
customElements.define('api-request', ApiRequest);
;// CONCATENATED MODULE: ./src/components/schema-table.js
// eslint-disable-line import/extensions
class SchemaTable extends lit_element_s {
static get properties() {
return {
schemaExpandLevel: {
type: Number,
attribute: 'schema-expand-level'
},
schemaDescriptionExpanded: {
type: String,
attribute: 'schema-description-expanded'
},
allowSchemaDescriptionExpandToggle: {
type: String,
attribute: 'allow-schema-description-expand-toggle'
},
schemaHideReadOnly: {
type: String,
attribute: 'schema-hide-read-only'
},
schemaHideWriteOnly: {
type: String,
attribute: 'schema-hide-write-only'
},
data: {
type: Object
}
};
}
connectedCallback() {
super.connectedCallback();
if (!this.schemaExpandLevel || this.schemaExpandLevel < 1) {
this.schemaExpandLevel = 99999;
}
if (!this.schemaDescriptionExpanded || !'true false'.includes(this.schemaDescriptionExpanded)) {
this.schemaDescriptionExpanded = 'false';
}
if (!this.schemaHideReadOnly || !'true false'.includes(this.schemaHideReadOnly)) {
this.schemaHideReadOnly = 'true';
}
if (!this.schemaHideWriteOnly || !'true false'.includes(this.schemaHideWriteOnly)) {
this.schemaHideWriteOnly = 'true';
}
}
static get styles() {
return [font_styles, schema_styles, i`
.table {
font-size: var(--font-size-small);
text-align: left;
line-height: calc(var(--font-size-small) + 6px);
}
.table .tr {
width: calc(100% - 5px);
padding: 0 0 0 5px;
border-bottom: 1px dotted var(--light-border-color);
}
.table .td {
padding: 4px 0;
}
.table .key {
width: 240px;
}
.key .key-label {
font-size: var(--font-size-mono);
}
.key.deprecated .key-label {
color: var(--red);
}
.table .key-type {
white-space: normal;
width: 150px;
}
.collapsed-all-descr .tr:not(.expanded-descr) {
max-height: calc(var(--font-size-small) + var(--font-size-small));
}
.obj-toggle {
padding: 0 2px;
border-radius:2px;
border: 1px solid transparent;
display: inline-block;
margin-left: -16px;
color:var(--primary-color);
cursor:pointer;
font-size: calc(var(--font-size-small) + 4px);
font-family: var(--font-mono);
background-clip: border-box;
}
.obj-toggle:hover {
border-color: var(--primary-color);
}
.tr.expanded + .object-body {
display:block;
}
.tr.collapsed + .object-body {
display:none;
}`, custom_styles];
}
/* eslint-disable indent */
render() {
var _this$data, _this$data2, _this$data3;
return lit_html_x`
<div class="table ${this.schemaDescriptionExpanded === 'true' ? 'expanded-all-descr' : 'collapsed-all-descr'}" @click="${e => this.handleAllEvents(e)}">
<div class='toolbar'>
<div class="toolbar-item schema-root-type ${((_this$data = this.data) === null || _this$data === void 0 ? void 0 : _this$data['::type']) || ''} "> ${((_this$data2 = this.data) === null || _this$data2 === void 0 ? void 0 : _this$data2['::type']) || ''} </div>
${this.allowSchemaDescriptionExpandToggle === 'true' ? lit_html_x`
<div style="flex:1"></div>
<div part="schema-multiline-toggle" class='toolbar-item schema-multiline-toggle' >
${this.schemaDescriptionExpanded === 'true' ? 'Single line description' : 'Multiline description'}
</div>
` : ''}
</div>
<span part="schema-description" class='m-markdown'> ${unsafe_html_o(marked(((_this$data3 = this.data) === null || _this$data3 === void 0 ? void 0 : _this$data3['::description']) || ''))} </span>
<div style = 'border:1px solid var(--light-border-color)'>
<div style='display:flex; background-color: var(--bg2); padding:8px 4px; border-bottom:1px solid var(--light-border-color);'>
<div class='key' style='font-family:var(--font-regular); font-weight:bold; color:var(--fg);'> Field </div>
<div class='key-type' style='font-family:var(--font-regular); font-weight:bold; color:var(--fg);'> Type </div>
<div class='key-descr' style='font-family:var(--font-regular); font-weight:bold; color:var(--fg);'> Description </div>
</div>
${this.data ? lit_html_x`
${this.generateTree(this.data['::type'] === 'array' ? this.data['::props'] : this.data, this.data['::type'], this.data['::array-type'])}` : ''}
</div>
</div>
`;
}
generateTree(data, dataType = 'object', arrayType = '', key = '', description = '', schemaLevel = 0, indentLevel = 0, readOrWrite = '') {
var _data$Type, _keyLabel;
if (this.schemaHideReadOnly === 'true') {
if (dataType === 'array') {
if (readOrWrite === 'readonly') {
return;
}
}
if (data && data['::readwrite'] === 'readonly') {
return;
}
}
if (this.schemaHideWriteOnly === 'true') {
if (dataType === 'array') {
if (readOrWrite === 'writeonly') {
return;
}
}
if (data && data['::readwrite'] === 'writeonly') {
return;
}
}
if (!data) {
return lit_html_x`<div class="null" style="display:inline;">
<span style='margin-left:${(schemaLevel + 1) * 16}px'> &nbsp; </span>
<span class="key-label xxx-of-key"> ${key.replace('::OPTION~', '')}</span>
${dataType === 'array' ? lit_html_x`<span class='mono-font'> [ ] </span>` : dataType === 'object' ? lit_html_x`<span class='mono-font'> { } </span>` : lit_html_x`<span class='mono-font'> schema undefined </span>`}
</div>`;
}
const newSchemaLevel = (_data$Type = data['::type']) !== null && _data$Type !== void 0 && _data$Type.startsWith('xxx-of') ? schemaLevel : schemaLevel + 1;
const newIndentLevel = dataType === 'xxx-of-option' || data['::type'] === 'xxx-of-option' || key.startsWith('::OPTION') ? indentLevel : indentLevel + 1;
const leftPadding = 16 * newIndentLevel; // 2 space indentation at each level
if (Object.keys(data).length === 0) {
return lit_html_x`<span class="td key object" style='padding-left:${leftPadding}px'>${key}</span>`;
}
let keyLabel = '';
let keyDescr = '';
let isOneOfLabel = false;
if (key.startsWith('::ONE~OF') || key.startsWith('::ANY~OF')) {
keyLabel = key.replace('::', '').replace('~', ' ');
isOneOfLabel = true;
} else if (key.startsWith('::OPTION')) {
const parts = key.split('~');
keyLabel = parts[1]; // eslint-disable-line prefer-destructuring
keyDescr = parts[2]; // eslint-disable-line prefer-destructuring
} else {
keyLabel = key;
}
let detailObjType = '';
if (data['::type'] === 'object') {
if (dataType === 'array') {
detailObjType = 'array of object'; // Array of Object
} else {
detailObjType = data['::dataTypeLabel'] || data['::type'];
}
} else if (data['::type'] === 'array') {
if (dataType === 'array') {
// detailObjType = 'array of array'; // Array of array
detailObjType = `array of array ${arrayType !== 'object' ? `of ${arrayType}` : ''}`; // Array of array
} else {
detailObjType = data['::dataTypeLabel'] || data['::type'];
}
}
if (typeof data === 'object') {
return lit_html_x`
${newSchemaLevel >= 0 && key ? lit_html_x`
<div class='tr ${newSchemaLevel <= this.schemaExpandLevel ? 'expanded' : 'collapsed'} ${data['::type']}' data-obj='${keyLabel}' title="${data['::deprecated'] ? 'Deprecated' : ''}">
<div class="td key ${data['::deprecated'] ? 'deprecated' : ''}" style='padding-left:${leftPadding}px'>
${keyLabel || keyDescr ? lit_html_x`
<span class='obj-toggle ${newSchemaLevel < this.schemaExpandLevel ? 'expanded' : 'collapsed'}' data-obj='${keyLabel}'>
${schemaLevel < this.schemaExpandLevel ? '-' : '+'}
</span>` : ''}
${data['::type'] === 'xxx-of-option' || data['::type'] === 'xxx-of-array' || key.startsWith('::OPTION') ? lit_html_x`<span class="xxx-of-key" style="margin-left:-6px">${keyLabel}</span><span class="${isOneOfLabel ? 'xxx-of-key' : 'xxx-of-descr'}">${keyDescr}</span>` : keyLabel.endsWith('*') ? lit_html_x`<span class="key-label" style="display:inline-block; margin-left:-6px;">${data['::deprecated'] ? '✗' : ''} ${keyLabel.substring(0, keyLabel.length - 1)}</span><span style='color:var(--red);'>*</span>` : lit_html_x`<span class="key-label" style="display:inline-block; margin-left:-6px;">${data['::deprecated'] ? '✗' : ''} ${keyLabel === '::props' ? '' : keyLabel}</span>`}
${data['::type'] === 'xxx-of' && dataType === 'array' ? lit_html_x`<span style="color:var(--primary-color)">ARRAY</span>` : ''}
</div>
<div class='td key-type' title="${data['::readwrite'] === 'readonly' ? 'Read-Only' : data['::readwrite'] === 'writeonly' ? 'Write-Only' : ''}">
${(data['::type'] || '').includes('xxx-of') ? '' : detailObjType}
${data['::readwrite'] === 'readonly' ? ' 🆁' : data['::readwrite'] === 'writeonly' ? ' 🆆' : ''}
</div>
<div class='td key-descr m-markdown-small' style='line-height:1.7'>${unsafe_html_o(marked(description || ''))}</div>
</div>` : lit_html_x`
${data['::type'] === 'array' && dataType === 'array' ? lit_html_x`
<div class='tr'>
<div class='td key'></div>
<div class='td key-type'>
${arrayType && arrayType !== 'object' ? `${dataType} of ${arrayType}` : dataType}
</div>
<div class='td key-descr'></div>
</div>` : ''}`}
<div class='object-body'>
${Array.isArray(data) && data[0] ? lit_html_x`${this.generateTree(data[0], 'xxx-of-option', '', '::ARRAY~OF', '', newSchemaLevel, newIndentLevel, '')}` : lit_html_x`
${Object.keys(data).map(dataKey => {
var _data$dataKey;
return lit_html_x`
${['::title', '::description', '::type', '::props', '::deprecated', '::array-type', '::readwrite', '::dataTypeLabel', '::nullable'].includes(dataKey) ? data[dataKey]['::type'] === 'array' || data[dataKey]['::type'] === 'object' ? lit_html_x`${this.generateTree(data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey], data[dataKey]['::type'], data[dataKey]['::array-type'] || '', dataKey, data[dataKey]['::description'], newSchemaLevel, newIndentLevel, data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '')}` : '' : lit_html_x`${this.generateTree(data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey], data[dataKey]['::type'], data[dataKey]['::array-type'] || '', dataKey, ((_data$dataKey = data[dataKey]) === null || _data$dataKey === void 0 ? void 0 : _data$dataKey['::description']) || '', newSchemaLevel, newIndentLevel, data[dataKey]['::readwrite'] ? data[dataKey]['::readwrite'] : '')}`}
`;
})}
`}
<div>
`;
}
// For Primitive Data types
// eslint-disable-next-line no-unused-vars
const [type, readOrWriteOnly, constraint, defaultValue, allowedValues, pattern, schemaDescription, schemaTitle, deprecated] = data.split('~|~');
if (readOrWriteOnly === '🆁' && this.schemaHideReadOnly === 'true') {
return;
}
if (readOrWriteOnly === '🆆' && this.schemaHideWriteOnly === 'true') {
return;
}
const dataTypeCss = type.replace(/┃.*/g, '').replace(/[^a-zA-Z0-9+]/g, '').substring(0, 4).toLowerCase();
const descrExpander = `${constraint || defaultValue || allowedValues || pattern ? '<span class="descr-expand-toggle">➔</span>' : ''}`;
let dataTypeHtml = '';
if (dataType === 'array') {
dataTypeHtml = lit_html_x`
<div class='td key-type ${dataTypeCss}' title="${readOrWrite === 'readonly' ? 'Read-Only' : readOrWriteOnly === 'writeonly' ? 'Write-Only' : ''}">
[${type}] ${readOrWrite === 'readonly' ? '🆁' : readOrWrite === 'writeonly' ? '🆆' : ''}
</div>`;
} else {
dataTypeHtml = lit_html_x`
<div class='td key-type ${dataTypeCss}' title="${readOrWriteOnly === '🆁' ? 'Read-Only' : readOrWriteOnly === '🆆' ? 'Write-Only' : ''}">
${type} ${readOrWriteOnly}
</div>`;
}
return lit_html_x`
<div class = "tr primitive" title="${deprecated ? 'Deprecated' : ''}">
<div class="td key ${deprecated}" style='padding-left:${leftPadding}px'>
${deprecated ? lit_html_x`<span style='color:var(--red);'>✗</span>` : ''}
${(_keyLabel = keyLabel) !== null && _keyLabel !== void 0 && _keyLabel.endsWith('*') ? lit_html_x`
<span class="key-label">${keyLabel.substring(0, keyLabel.length - 1)}</span>
<span style='color:var(--red);'>*</span>` : key.startsWith('::OPTION') ? lit_html_x`<span class='xxx-of-key'>${keyLabel}</span><span class="xxx-of-descr">${keyDescr}</span>` : lit_html_x`${keyLabel ? lit_html_x`<span class="key-label"> ${keyLabel}</span>` : lit_html_x`<span class="xxx-of-descr">${schemaTitle}</span>`}`}
</div>
${dataTypeHtml}
<div class='td key-descr' style='font-size: var(--font-size-small)'>
${lit_html_x`<span class="m-markdown-small">
${unsafe_html_o(marked(dataType === 'array' ? `${descrExpander} ${description}` : schemaTitle ? `${descrExpander} <b>${schemaTitle}:</b> ${schemaDescription}` : `${descrExpander} ${schemaDescription}`))}
</span>`}
${constraint ? lit_html_x`<div class='' style='display:inline-block; line-break:anywhere; margin-right:8px;'> <span class='bold-text'>Constraints: </span> ${constraint}</div>` : ''}
${defaultValue ? lit_html_x`<div style='display:inline-block; line-break:anywhere; margin-right:8px;'> <span class='bold-text'>Default: </span>${defaultValue}</div>` : ''}
${allowedValues ? lit_html_x`<div style='display:inline-block; line-break:anywhere; margin-right:8px;'> <span class='bold-text'>${type === 'const' ? 'Value' : 'Allowed'}: </span>${allowedValues}</div>` : ''}
${pattern ? lit_html_x`<div style='display:inline-block; line-break:anywhere; margin-right:8px;'> <span class='bold-text'>Pattern: </span>${pattern}</div>` : ''}
</div>
</div>
`;
}
/* eslint-enable indent */
handleAllEvents(e) {
if (e.target.classList.contains('obj-toggle')) {
this.toggleObjectExpand(e);
} else if (e.target.classList.contains('schema-multiline-toggle')) {
this.schemaDescriptionExpanded = this.schemaDescriptionExpanded === 'true' ? 'false' : 'true';
} else if (e.target.classList.contains('descr-expand-toggle')) {
const trEl = e.target.closest('.tr');
if (trEl) {
trEl.classList.toggle('expanded-descr');
trEl.style.maxHeight = trEl.scrollHeight;
}
}
}
toggleObjectExpand(e) {
const rowEl = e.target.closest('.tr');
if (rowEl.classList.contains('expanded')) {
rowEl.classList.add('collapsed');
rowEl.classList.remove('expanded');
e.target.innerText = '+';
} else {
rowEl.classList.remove('collapsed');
rowEl.classList.add('expanded');
e.target.innerText = '-';
}
}
}
customElements.define('schema-table', SchemaTable);
;// CONCATENATED MODULE: ./src/components/api-response.js
// eslint-disable-line import/extensions
class ApiResponse extends lit_element_s {
constructor() {
super();
this.selectedStatus = '';
this.headersForEachRespStatus = {};
this.mimeResponsesForEachStatus = {};
this.activeSchemaTab = 'schema';
}
static get properties() {
return {
callback: {
type: String
},
webhook: {
type: String
},
responses: {
type: Object
},
parser: {
type: Object
},
schemaStyle: {
type: String,
attribute: 'schema-style'
},
renderStyle: {
type: String,
attribute: 'render-style'
},
selectedStatus: {
type: String,
attribute: 'selected-status'
},
selectedMimeType: {
type: String,
attribute: 'selected-mime-type'
},
activeSchemaTab: {
type: String,
attribute: 'active-schema-tab'
},
schemaExpandLevel: {
type: Number,
attribute: 'schema-expand-level'
},
schemaDescriptionExpanded: {
type: String,
attribute: 'schema-description-expanded'
},
allowSchemaDescriptionExpandToggle: {
type: String,
attribute: 'allow-schema-description-expand-toggle'
},
schemaHideReadOnly: {
type: String,
attribute: 'schema-hide-read-only'
},
schemaHideWriteOnly: {
type: String,
attribute: 'schema-hide-write-only'
}
};
}
static get styles() {
return [font_styles, flex_styles, tab_styles, table_styles, input_styles, border_styles, i`
:where(button, input[type="checkbox"], [tabindex="0"]):focus-visible { box-shadow: var(--focus-shadow); }
:where(input[type="text"], input[type="password"], select, textarea):focus-visible { border-color: var(--primary-color); }
.resp-head{
vertical-align: middle;
padding:16px 0 8px;
}
.resp-head.divider{
border-top: 1px solid var(--border-color);
margin-top:10px;
}
.resp-status{
font-weight:bold;
font-size:calc(var(--font-size-small) + 1px);
}
.resp-descr{
font-size:calc(var(--font-size-small) + 1px);
color:var(--light-fg);
text-align:left;
}
.top-gap{margin-top:16px;}
.example-panel{
font-size:var(--font-size-small);
margin:0;
}
.focused-mode,
.read-mode {
padding-top:24px;
margin-top:12px;
border-top: 1px dashed var(--border-color);
}`, custom_styles];
}
render() {
return lit_html_x`
<div class="col regular-font response-panel ${this.renderStyle}-mode">
<div class=" ${this.callback === 'true' ? 'tiny-title' : 'req-res-title'} ">
${this.callback === 'true' ? 'CALLBACK RESPONSE' : 'RESPONSE'}
</div>
<div>
${this.responseTemplate()}
<div>
</div>
`;
}
resetSelection() {
this.selectedStatus = '';
this.selectedMimeType = '';
}
/* eslint-disable indent */
responseTemplate() {
if (!this.responses) {
return '';
}
for (const statusCode in this.responses) {
if (!this.selectedStatus) {
this.selectedStatus = statusCode;
}
const allMimeResp = {};
for (const mimeResp in (_this$responses$statu = this.responses[statusCode]) === null || _this$responses$statu === void 0 ? void 0 : _this$responses$statu.content) {
var _this$responses$statu, _respExamples$;
const mimeRespObj = this.responses[statusCode].content[mimeResp];
if (!this.selectedMimeType) {
this.selectedMimeType = mimeResp;
}
// Generate Schema
const schemaTree = schemaInObjectNotation(mimeRespObj.schema, {});
// Generate Example
const respExamples = generateExample(mimeRespObj.schema, mimeResp, mimeRespObj.examples, mimeRespObj.example, this.callback === 'true' || this.webhook === 'true' ? false : true,
// eslint-disable-line no-unneeded-ternary
this.callback === 'true' || this.webhook === 'true' ? true : false,
// eslint-disable-line no-unneeded-ternary
mimeResp.includes('json') ? 'json' : 'text');
allMimeResp[mimeResp] = {
description: this.responses[statusCode].description,
examples: respExamples,
selectedExample: ((_respExamples$ = respExamples[0]) === null || _respExamples$ === void 0 ? void 0 : _respExamples$.exampleId) || '',
schemaTree
};
}
// Headers for each response status
const tempHeaders = [];
for (const key in (_this$responses$statu2 = this.responses[statusCode]) === null || _this$responses$statu2 === void 0 ? void 0 : _this$responses$statu2.headers) {
var _this$responses$statu2;
tempHeaders.push({
name: key,
...this.responses[statusCode].headers[key]
});
}
this.headersForEachRespStatus[statusCode] = tempHeaders;
this.mimeResponsesForEachStatus[statusCode] = allMimeResp;
}
return lit_html_x`
${Object.keys(this.responses).length > 1 ? lit_html_x`<div class='row' style='flex-wrap:wrap'>
${Object.keys(this.responses).map(respStatus => lit_html_x`
${respStatus === '$$ref' // Swagger-Client parser creates '$$ref' object if JSON references are used to create responses - this should be ignored
? '' : lit_html_x`
<button
@click="${() => {
this.selectedStatus = respStatus;
if (this.responses[respStatus].content && Object.keys(this.responses[respStatus].content)[0]) {
this.selectedMimeType = Object.keys(this.responses[respStatus].content)[0]; // eslint-disable-line prefer-destructuring
} else {
this.selectedMimeType = undefined;
}
}}"
class='m-btn small ${this.selectedStatus === respStatus ? 'primary' : ''}'
part="btn ${this.selectedStatus === respStatus ? 'btn-response-status btn-selected-response-status' : ' btn-response-status'}"
style='margin: 8px 4px 0 0'
>
${respStatus}
</button>`}`)}` : lit_html_x`<span>${Object.keys(this.responses)[0]}</span>`}
</div>
${Object.keys(this.responses).map(status => {
var _this$responses$statu3, _this$headersForEachR;
return lit_html_x`
<div style = 'display: ${status === this.selectedStatus ? 'block' : 'none'}' >
<div class="top-gap">
<span class="resp-descr m-markdown ">${unsafe_html_o(marked(((_this$responses$statu3 = this.responses[status]) === null || _this$responses$statu3 === void 0 ? void 0 : _this$responses$statu3.description) || ''))}</span>
${this.headersForEachRespStatus[status] && ((_this$headersForEachR = this.headersForEachRespStatus[status]) === null || _this$headersForEachR === void 0 ? void 0 : _this$headersForEachR.length) > 0 ? lit_html_x`${this.responseHeaderListTemplate(this.headersForEachRespStatus[status])}` : ''}
</div>
${Object.keys(this.mimeResponsesForEachStatus[status]).length === 0 ? '' : lit_html_x`
<div class="tab-panel col">
<div class="tab-buttons row" @click="${e => {
if (e.target.tagName.toLowerCase() === 'button') {
this.activeSchemaTab = e.target.dataset.tab;
}
}}" >
<button class="tab-btn ${this.activeSchemaTab === 'example' ? 'active' : ''}" data-tab = 'example'>EXAMPLE </button>
<button class="tab-btn ${this.activeSchemaTab !== 'example' ? 'active' : ''}" data-tab = 'schema' >SCHEMA</button>
<div style="flex:1"></div>
${Object.keys(this.mimeResponsesForEachStatus[status]).length === 1 ? lit_html_x`<span class='small-font-size gray-text' style='align-self:center; margin-top:8px;'> ${Object.keys(this.mimeResponsesForEachStatus[status])[0]} </span>` : lit_html_x`${this.mimeTypeDropdownTemplate(Object.keys(this.mimeResponsesForEachStatus[status]))}`}
</div>
${this.activeSchemaTab === 'example' ? lit_html_x`<div class ='tab-content col' style = 'flex:1;'>
${this.mimeExampleTemplate(this.mimeResponsesForEachStatus[status][this.selectedMimeType])}
</div>` : lit_html_x`<div class ='tab-content col' style = 'flex:1;'>
${this.mimeSchemaTemplate(this.mimeResponsesForEachStatus[status][this.selectedMimeType])}
</div>`}
</div>
`}`;
})}
`;
}
responseHeaderListTemplate(respHeaders) {
return lit_html_x`
<div style="padding:16px 0 8px 0" class="resp-headers small-font-size bold-text">RESPONSE HEADERS</div>
<table role="presentation" style="border-collapse: collapse; margin-bottom:16px; border:1px solid var(--border-color); border-radius: var(--border-radius)" class="small-font-size mono-font">
${respHeaders.map(v => {
var _v$schema, _v$schema2;
return lit_html_x`
<tr>
<td style="padding:8px; vertical-align: baseline; min-width:120px; border-top: 1px solid var(--light-border-color); text-overflow: ellipsis;">
${v.name || ''}
</td>
<td style="padding:4px; vertical-align: baseline; padding:0 5px; border-top: 1px solid var(--light-border-color); text-overflow: ellipsis;">
${((_v$schema = v.schema) === null || _v$schema === void 0 ? void 0 : _v$schema.type) || ''}
</td>
<td style="padding:8px; vertical-align: baseline; border-top: 1px solid var(--light-border-color);text-overflow: ellipsis;">
<div class="m-markdown-small regular-font" >${unsafe_html_o(marked(v.description || ''))}</div>
</td>
<td style="padding:8px; vertical-align: baseline; border-top: 1px solid var(--light-border-color); text-overflow: ellipsis;">
${((_v$schema2 = v.schema) === null || _v$schema2 === void 0 ? void 0 : _v$schema2.example) || ''}
</td>
</tr>
`;
})}
</table>`;
}
mimeTypeDropdownTemplate(mimeTypes) {
return lit_html_x`
<select aria-label='mime types' @change="${e => {
this.selectedMimeType = e.target.value;
}}" style='margin-bottom: -1px; z-index:1'>
${mimeTypes.map(mimeType => lit_html_x`<option value='${mimeType}' ?selected = '${mimeType === this.selectedMimeType}'> ${mimeType} </option>`)}
</select>`;
}
onSelectExample(e) {
const exampleContainerEl = e.target.closest('.example-panel');
const exampleEls = [...exampleContainerEl.querySelectorAll('.example')];
exampleEls.forEach(v => {
v.style.display = v.dataset.example === e.target.value ? 'block' : 'none';
});
}
mimeExampleTemplate(mimeRespDetails) {
if (!mimeRespDetails) {
return lit_html_x`
<pre style='color:var(--red)' class = '${this.renderStyle === 'read' ? 'read example-panel border pad-8-16' : 'example-panel border-top'}'> No example provided </pre>
`;
}
return lit_html_x`
${mimeRespDetails.examples.length === 1 ? lit_html_x`
${mimeRespDetails.examples[0].exampleFormat === 'json' ? lit_html_x`
${mimeRespDetails.examples[0].exampleSummary && mimeRespDetails.examples[0].exampleSummary.length > 80 ? lit_html_x`<div style="padding: 4px 0"> ${mimeRespDetails.examples[0].exampleSummary} </div>` : ''}
${mimeRespDetails.examples[0].exampleDescription ? lit_html_x`<div class="m-markdown-small" style="padding: 4px 0"> ${unsafe_html_o(marked(mimeRespDetails.examples[0].exampleDescription || ''))} </div>` : ''}
<json-tree
render-style = '${this.renderStyle}'
.data="${mimeRespDetails.examples[0].exampleValue}"
class = 'example-panel ${this.renderStyle === 'read' ? 'border pad-8-16' : 'border-top pad-top-8'}'
exportparts = "btn:btn, btn-fill:btn-fill, btn-copy:btn-copy"
></json-tree>` : lit_html_x`
${mimeRespDetails.examples[0].exampleSummary && mimeRespDetails.examples[0].exampleSummary.length > 80 ? lit_html_x`<div style="padding: 4px 0"> ${mimeRespDetails.examples[0].exampleSummary} </div>` : ''}
${mimeRespDetails.examples[0].exampleDescription ? lit_html_x`<div class="m-markdown-small" style="padding: 4px 0"> ${unsafe_html_o(marked(mimeRespDetails.examples[0].exampleDescription || ''))} </div>` : ''}
<pre class = 'example-panel ${this.renderStyle === 'read' ? 'border pad-8-16' : 'border-top pad-top-8'}'>${mimeRespDetails.examples[0].exampleValue}</pre>
`}` : lit_html_x`
<span class = 'example-panel ${this.renderStyle === 'read' ? 'border pad-8-16' : 'border-top pad-top-8'}'>
<select aria-label='response examples' style="min-width:100px; max-width:100%" @change='${e => this.onSelectExample(e)}'>
${mimeRespDetails.examples.map(v => lit_html_x`<option value="${v.exampleId}" ?selected=${v.exampleId === mimeRespDetails.selectedExample} >
${v.exampleSummary.length > 80 ? v.exampleId : v.exampleSummary}
</option>`)}
</select>
${mimeRespDetails.examples.map(v => lit_html_x`
<div class="example" data-example = '${v.exampleId}' style = "display: ${v.exampleId === mimeRespDetails.selectedExample ? 'block' : 'none'}">
${v.exampleSummary && v.exampleSummary.length > 80 ? lit_html_x`<div style="padding: 4px 0"> ${v.exampleSummary} </div>` : ''}
${v.exampleDescription ? lit_html_x`<div class="m-markdown-small" style="padding: 4px 0"> ${unsafe_html_o(marked(v.exampleDescription || ''))} </div>` : ''}
${v.exampleFormat === 'json' ? lit_html_x`
<json-tree
render-style = '${this.renderStyle}'
.data = '${v.exampleValue}'
exportparts = "btn:btn, btn-fill:btn-fill, btn-copy:btn-copy"
></json-tree>` : lit_html_x`<pre>${v.exampleValue}</pre>`}
</div>
`)}
</span>
`}
`;
}
mimeSchemaTemplate(mimeRespDetails) {
if (!mimeRespDetails) {
return lit_html_x`
<pre style='color:var(--red)' class = '${this.renderStyle === 'read' ? 'border pad-8-16' : 'border-top'}'> Schema not found</pre>
`;
}
return lit_html_x`
${this.schemaStyle === 'table' ? lit_html_x`
<schema-table
.data = "${mimeRespDetails.schemaTree}"
schema-expand-level = "${this.schemaExpandLevel}"
schema-description-expanded = "${this.schemaDescriptionExpanded}"
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
schema-hide-read-only = "${this.schemaHideReadOnly}"
schema-hide-write-only = "${this.schemaHideWriteOnly}"
exportparts = "schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
> </schema-table> ` : lit_html_x`
<schema-tree
.data = '${mimeRespDetails.schemaTree}'
schema-expand-level = "${this.schemaExpandLevel}"
schema-description-expanded = "${this.schemaDescriptionExpanded}"
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
schema-hide-read-only = "${this.schemaHideReadOnly}"
schema-hide-write-only = "${this.schemaHideWriteOnly}"
exportparts = "schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
> </schema-tree>`}`;
}
/* eslint-enable indent */
}
// Register the element with the browser
customElements.define('api-response', ApiResponse);
;// CONCATENATED MODULE: ./src/templates/expanded-endpoint-template.js
// eslint-disable-line import/extensions
/* eslint-disable indent */
function headingRenderer(tagElementId) {
const renderer = new marked.Renderer();
renderer.heading = (text, level, raw, slugger) => `<h${level} class="observe-me" id="${tagElementId}--${slugger.slug(raw)}">${text}</h${level}>`;
return renderer;
}
function expandCollapseTagDescription(e) {
const tagDescriptionEl = e.target.closest('.tag-container').querySelector('.tag-description');
const tagIconEl = e.target.closest('.tag-container').querySelector('.tag-icon');
if (tagDescriptionEl && tagIconEl) {
const isExpanded = tagDescriptionEl.classList.contains('expanded');
if (isExpanded) {
tagDescriptionEl.style.maxHeight = 0;
tagDescriptionEl.classList.replace('expanded', 'collapsed');
tagIconEl.classList.replace('expanded', 'collapsed');
} else {
tagDescriptionEl.style.maxHeight = `${tagDescriptionEl.scrollHeight}px`;
tagDescriptionEl.classList.replace('collapsed', 'expanded');
tagIconEl.classList.replace('collapsed', 'expanded');
}
}
}
function expandedEndpointBodyTemplate(path, tagName = '', tagDescription = '') {
var _path$xBadges, _path$externalDocs, _path$externalDocs2, _path$externalDocs3, _path$externalDocs4, _path$externalDocs5, _path$externalDocs6, _path$servers, _path$servers$;
const acceptContentTypes = new Set();
for (const respStatus in path.responses) {
for (const acceptContentType in (_path$responses$respS = path.responses[respStatus]) === null || _path$responses$respS === void 0 ? void 0 : _path$responses$respS.content) {
var _path$responses$respS;
acceptContentTypes.add(acceptContentType.trim());
}
}
const accept = [...acceptContentTypes].join(', ');
// Filter API Keys that are non-empty and are applicable to the the path
const nonEmptyApiKeys = this.resolvedSpec.securitySchemes.filter(v => {
var _path$security;
return v.finalKeyValue && ((_path$security = path.security) === null || _path$security === void 0 ? void 0 : _path$security.some(ps => v.securitySchemeId in ps));
}) || [];
// If a RapiDoc API Key is specified on the element and its value is not hyphen(-) then include it for all paths
const rapiDocApiKey = this.resolvedSpec.securitySchemes.find(v => v.securitySchemeId === rapidocApiKey && v.value !== '-');
if (rapiDocApiKey) {
nonEmptyApiKeys.push(rapiDocApiKey);
}
const codeSampleTabPanel = path.xCodeSamples ? codeSamplesTemplate.call(this, path.xCodeSamples) : '';
return lit_html_x`
${this.renderStyle === 'read' ? lit_html_x`<div class='divider' part="operation-divider"></div>` : ''}
<div class='expanded-endpoint-body observe-me ${path.method} ${path.deprecated ? 'deprecated' : ''} ' part="section-operation ${path.elementId}" id='${path.elementId}'>
${this.renderStyle === 'focused' && tagName !== 'General ⦂' ? lit_html_x`
<div class="tag-container" part="section-operation-tag">
<span class="upper" style="font-weight:bold; font-size:18px;"> ${tagName} </span>
${tagDescription ? lit_html_x`
<svg class="tag-icon collapsed" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" fill="none" style="stroke:var(--primary-color); vertical-align:top; cursor:pointer"
@click="${e => {
expandCollapseTagDescription.call(this, e);
}}"
>
<path d="M12 20h-6a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h8"></path><path d="M18 4v17"></path><path d="M15 18l3 3l3 -3"></path>
</svg>
<div class="tag-description collapsed" style="max-height:0px; overflow:hidden; margin-top:16px; border:1px solid var(--border-color)">
<div class="m-markdown" style="padding:8px"> ${unsafe_html_o(marked(tagDescription))}</div>
</div>` : ''}
</div>
` : ''}
${path.deprecated ? lit_html_x`<div class="bold-text red-text"> DEPRECATED </div>` : ''}
${lit_html_x`
${path.xBadges && ((_path$xBadges = path.xBadges) === null || _path$xBadges === void 0 ? void 0 : _path$xBadges.length) > 0 ? lit_html_x`
<div style="display:flex; flex-wrap:wrap; margin-bottom: -24px; font-size: var(--font-size-small);">
${path.xBadges.map(v => lit_html_x`<span style="margin:1px; margin-right:5px; padding:1px 8px; font-weight:bold; border-radius:12px; background-color: var(--light-${v.color}, var(--input-bg)); color:var(--${v.color}); border:1px solid var(--${v.color})">${v.label}</span>`)}
</div>
` : ''}
<h2 part="section-operation-summary"> ${path.shortSummary || `${path.method.toUpperCase()} ${path.path}`}</h2>
${path.isWebhook ? lit_html_x`<span part="section-operation-webhook" style="color:var(--primary-color); font-weight:bold; font-size: var(--font-size-regular);"> WEBHOOK </span>` : lit_html_x`
<div part="section-operation-webhook-method" class="mono-font regular-font-size" style="text-align:left; direction:ltr; padding: 8px 0; color:var(--fg3)">
<span part="label-operation-method" class="regular-font upper method-fg bold-text ${path.method}">${path.method}</span>
<span part="label-operation-path">${path.path}</span>
</div>
`}
<slot name="${path.elementId}"></slot>`}
${path.description ? lit_html_x`<div class="m-markdown"> ${unsafe_html_o(marked(path.description))}</div>` : ''}
${pathSecurityTemplate.call(this, path.security)}
${(_path$externalDocs = path.externalDocs) !== null && _path$externalDocs !== void 0 && _path$externalDocs.url || (_path$externalDocs2 = path.externalDocs) !== null && _path$externalDocs2 !== void 0 && _path$externalDocs2.description ? lit_html_x`<div style="background-color:var(--bg3); padding:2px 8px 8px 8px; margin:8px 0; border-radius:var(--border-radius)">
<div class="m-markdown"> ${unsafe_html_o(marked(((_path$externalDocs3 = path.externalDocs) === null || _path$externalDocs3 === void 0 ? void 0 : _path$externalDocs3.description) || ''))} </div>
${(_path$externalDocs4 = path.externalDocs) !== null && _path$externalDocs4 !== void 0 && _path$externalDocs4.url ? lit_html_x`<a style="font-family:var(--font-mono); font-size:var(--font-size-small)" href="${(_path$externalDocs5 = path.externalDocs) === null || _path$externalDocs5 === void 0 ? void 0 : _path$externalDocs5.url}" target="_blank">
${(_path$externalDocs6 = path.externalDocs) === null || _path$externalDocs6 === void 0 ? void 0 : _path$externalDocs6.url} <div style="transform: rotate(270deg) scale(1.5); display: inline-block; margin-left:5px">⇲</div>
</a>` : ''}
</div>` : ''}
${codeSampleTabPanel}
<div class='expanded-req-resp-container'>
<api-request
class = "${this.renderStyle}-mode"
style = "width:100%;"
webhook = "${path.isWebhook}"
method = "${path.method}"
path = "${path.path}"
.security = "${path.security}"
.parameters = "${path.parameters}"
.request_body = "${path.requestBody}"
.api_keys = "${nonEmptyApiKeys}"
.servers = "${path.servers}"
server-url = "${((_path$servers = path.servers) === null || _path$servers === void 0 ? void 0 : (_path$servers$ = _path$servers[0]) === null || _path$servers$ === void 0 ? void 0 : _path$servers$.url) || this.selectedServer.computedUrl}"
fill-request-fields-with-example = "${this.fillRequestFieldsWithExample}"
allow-try = "${this.allowTry}"
show-curl-before-try = "${this.showCurlBeforeTry}"
accept = "${accept}"
render-style="${this.renderStyle}"
schema-style = "${this.schemaStyle}"
active-schema-tab = "${this.defaultSchemaTab}"
schema-expand-level = "${this.schemaExpandLevel}"
schema-description-expanded = "${this.schemaDescriptionExpanded}"
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
schema-hide-read-only = "${this.schemaHideReadOnly === 'never' ? 'false' : path.isWebhook ? 'false' : 'true'}"
schema-hide-write-only = "${this.schemaHideWriteOnly === 'never' ? 'false' : path.isWebhook ? 'true' : 'false'}"
fetch-credentials = "${this.fetchCredentials}"
exportparts = "wrap-request-btn:wrap-request-btn, btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, btn-clear:btn-clear, btn-clear-resp:btn-clear-resp,
file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param,
anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
> </api-request>
${path.callbacks ? callbackTemplate.call(this, path.callbacks) : ''}
<api-response
class = "${this.renderStyle}-mode"
style = "width:100%;"
webhook = "${path.isWebhook}"
.responses = "${path.responses}"
render-style = "${this.renderStyle}"
schema-style = "${this.schemaStyle}"
active-schema-tab = "${this.defaultSchemaTab}"
schema-expand-level = "${this.schemaExpandLevel}"
schema-description-expanded = "${this.schemaDescriptionExpanded}"
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
schema-hide-read-only = "${this.schemaHideReadOnly === 'never' ? 'false' : path.isWebhook ? 'true' : 'false'}"
schema-hide-write-only = "${this.schemaHideWriteOnly === 'never' ? 'false' : path.isWebhook ? 'false' : 'true'}"
selected-status = "${Object.keys(path.responses || {})[0] || ''}"
exportparts = "btn:btn, btn-response-status:btn-response-status, btn-selected-response-status:btn-selected-response-status, btn-fill:btn-fill, btn-copy:btn-copy,
schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
> </api-response>
</div>
</div>
`;
}
function expandedEndpointTemplate() {
if (!this.resolvedSpec) {
return '';
}
return lit_html_x`
${this.resolvedSpec.tags.map(tag => lit_html_x`
<section id="${tag.elementId}" part="section-tag" class="regular-font section-gap--read-mode observe-me" style="border-top:1px solid var(--primary-color);">
<div class="title tag" part="section-tag-title label-tag-title">${tag.name}</div>
<slot name="${tag.elementId}"></slot>
<div class="regular-font-size">
${unsafe_html_o(`
<div class="m-markdown regular-font">
${marked(tag.description || '', this.infoDescriptionHeadingsInNavBar === 'true' ? {
renderer: headingRenderer(tag.elementId)
} : undefined)}
</div>`)}
</div>
</section>
<section class="regular-font section-gap--read-mode" part="section-operations-in-tag">
${tag.paths.map(path => expandedEndpointBodyTemplate.call(this, path))}
</section>
`)}
`;
}
/* eslint-enable indent */
;// CONCATENATED MODULE: ./src/templates/components-template.js
// eslint-disable-line import/extensions
function schemaBodyTemplate(sComponent) {
return lit_html_x`
<div class='divider'></div>
<div class='expanded-endpoint-body observe-me ${sComponent.name}' id='cmp--${sComponent.id}' >
<div style="font-weight:bold"> ${sComponent.name} <span style="color:var(--light-fg); font-size:var(--font-size-small); font-weight:400;"> Schema </span></div>
${this.schemaStyle === 'table' ? lit_html_x`
<schema-table
.data = '${schemaInObjectNotation(sComponent.component, {})}'
schema-expand-level = "${this.schemaExpandLevel}"
schema-description-expanded = "${this.schemaDescriptionExpanded}"
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
schema-hide-read-only = "false"
schema-hide-write-only = "${this.schemaHideWriteOnly}"
exportparts = "schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
> </schema-table>` : lit_html_x`
<schema-tree
.data = '${schemaInObjectNotation(sComponent.component, {})}'
schema-expand-level = "${this.schemaExpandLevel}"
schema-description-expanded = "${this.schemaDescriptionExpanded}"
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
schema-hide-read-only = "false"
schema-hide-write-only = "${this.schemaHideWriteOnly}"
exportparts = "schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
> </schema-tree>`}
</div>`;
}
function componentBodyTemplate(sComponent, componentType) {
if (sComponent.id.indexOf('schemas-') !== -1) {
return schemaBodyTemplate.call(this, sComponent);
}
return lit_html_x`
<div class='divider'></div>
<div class='expanded-endpoint-body observe-me ${sComponent.name}' id='cmp--${sComponent.id}' >
${lit_html_x`
<div style="font-weight:bold"> ${sComponent.name} <span style="color:var(--light-fg); font-size:var(--font-size-small); font-weight:400"> ${componentType} </span> </div>
${sComponent.component ? lit_html_x`
<div class='mono-font regular-font-size' style='padding: 8px 0; color:var(--fg2)'>
<json-tree class="border tree" render-style='${this.renderStyle}' .data="${sComponent.component}"> </json-tree>
</div>` : ''}
`}
</div>
`;
}
function componentsTemplate() {
if (!this.resolvedSpec) {
return '';
}
return lit_html_x`
${this.resolvedSpec.components.map(component => lit_html_x`
<div id="cmp--${component.name.toLowerCase()}" class='regular-font section-gap--read-mode observe-me' style="border-top:1px solid var(--primary-color);">
<div class="title tag">${component.name}</div>
<div class="regular-font-size">
${unsafe_html_o(`<div class='m-markdown regular-font'>${marked(component.description ? component.description : '')}</div>`)}
</div>
</div>
<div class='regular-font section-gap--read-mode'>
${component.subComponents.filter(c => c.expanded !== false).map(sComponent => componentBodyTemplate.call(this, sComponent, component.name))}
</div>
`)}
`;
}
/* eslint-enable indent */
;// CONCATENATED MODULE: ./src/templates/overview-template.js
// eslint-disable-line import/extensions
/* eslint-disable indent */
function overview_template_headingRenderer() {
const renderer = new marked.Renderer();
renderer.heading = (text, level, raw, slugger) => `<h${level} class="observe-me" id="overview--${slugger.slug(raw)}">${text}</h${level}>`;
return renderer;
}
function overviewTemplate() {
var _this$resolvedSpec, _this$resolvedSpec$in, _this$resolvedSpec$in2, _this$specUrl;
return lit_html_x`
<section id="overview" part="section-overview"
class="observe-me ${this.renderStyle === 'view' ? 'section-gap' : 'section-gap--read-mode'}">
${(_this$resolvedSpec = this.resolvedSpec) !== null && _this$resolvedSpec !== void 0 && _this$resolvedSpec.info ? lit_html_x`
<div id="api-title" part="section-overview-title" style="font-size:32px">
${this.resolvedSpec.info.title}
${!this.resolvedSpec.info.version ? '' : lit_html_x`
<span style = 'font-size:var(--font-size-small);font-weight:bold'>
${this.resolvedSpec.info.version}
</span>`}
</div>
<div id="api-info" style="font-size:calc(var(--font-size-regular) - 1px); margin-top:8px;">
${(_this$resolvedSpec$in = this.resolvedSpec.info.contact) !== null && _this$resolvedSpec$in !== void 0 && _this$resolvedSpec$in.email ? lit_html_x`<span>${this.resolvedSpec.info.contact.name || 'Email'}:
<a href="mailto:${this.resolvedSpec.info.contact.email}" part="anchor anchor-overview">${this.resolvedSpec.info.contact.email}</a>
</span>` : ''}
${(_this$resolvedSpec$in2 = this.resolvedSpec.info.contact) !== null && _this$resolvedSpec$in2 !== void 0 && _this$resolvedSpec$in2.url ? lit_html_x`<span>URL: <a href="${this.resolvedSpec.info.contact.url}" part="anchor anchor-overview">${this.resolvedSpec.info.contact.url}</a></span>` : ''}
${this.resolvedSpec.info.license ? lit_html_x`<span>License:
${this.resolvedSpec.info.license.url ? lit_html_x`<a href="${this.resolvedSpec.info.license.url}" part="anchor anchor-overview">${this.resolvedSpec.info.license.name}</a>` : this.resolvedSpec.info.license.name} </span>` : ''}
${this.resolvedSpec.info.termsOfService ? lit_html_x`<span><a href="${this.resolvedSpec.info.termsOfService}" part="anchor anchor-overview">Terms of Service</a></span>` : ''}
${this.specUrl && this.allowSpecFileDownload === 'true' ? lit_html_x`
<div style="display:flex; margin:12px 0; gap:8px; justify-content: start;">
<button class="m-btn thin-border" style="min-width:170px" part="btn btn-outline" @click='${e => {
downloadResource(this.specUrl, 'openapi-spec', e);
}}'>Download OpenAPI spec</button>
${(_this$specUrl = this.specUrl) !== null && _this$specUrl !== void 0 && _this$specUrl.trim().toLowerCase().endsWith('json') ? lit_html_x`<button class="m-btn thin-border" style="width:200px" part="btn btn-outline" @click='${e => {
viewResource(this.specUrl, e);
}}'>View OpenAPI spec (New Tab)</button>` : ''}
</div>` : ''}
</div>
<slot name="overview"></slot>
<div id="api-description">
${this.resolvedSpec.info.description ? lit_html_x`${unsafe_html_o(`
<div class="m-markdown regular-font">
${marked(this.resolvedSpec.info.description, this.infoDescriptionHeadingsInNavBar === 'true' ? {
renderer: overview_template_headingRenderer()
} : undefined)}
</div>`)}` : ''}
</div>
` : ''}
</section>
`;
}
/* eslint-enable indent */
;// CONCATENATED MODULE: ./src/templates/server-template.js
// eslint-disable-line import/extensions
function setApiServer(serverUrl) {
var _this$resolvedSpec;
const serverObj = (_this$resolvedSpec = this.resolvedSpec) === null || _this$resolvedSpec === void 0 ? void 0 : _this$resolvedSpec.servers.find(s => s.url === serverUrl);
if (!serverObj) {
return false;
}
this.selectedServer = serverObj;
this.requestUpdate();
this.dispatchEvent(new CustomEvent('api-server-change', {
bubbles: true,
composed: true,
detail: {
selectedServer: serverObj
}
}));
return true;
}
function onApiServerVarChange(e, serverObj) {
const inputEls = [...e.currentTarget.closest('table').querySelectorAll('input, select')];
let tempUrl = serverObj.url;
inputEls.forEach(v => {
const regex = new RegExp(`{${v.dataset.var}}`, 'g');
tempUrl = tempUrl.replace(regex, v.value);
});
serverObj.computedUrl = tempUrl;
this.requestUpdate();
}
/* eslint-disable indent */
function serverVarsTemplate() {
// const selectedServerObj = this.resolvedSpec.servers.find((v) => (v.url === this.selectedServer));
return this.selectedServer && this.selectedServer.variables ? lit_html_x`
<div class="table-title">SERVER VARIABLES</div>
<table class='m-table' role='presentation'>
${Object.entries(this.selectedServer.variables).map(kv => lit_html_x`
<tr>
<td style="vertical-align: middle;" >${kv[0]}</td>
<td>
${kv[1].enum ? lit_html_x`
<select
data-var = "${kv[0]}"
@input = ${e => {
onApiServerVarChange.call(this, e, this.selectedServer);
}}
>
${Object.entries(kv[1].enum).map(e => kv[1].default === e[1] ? lit_html_x`
<option
selected
label = ${e[1]}
value = ${e[1]}
/>` : lit_html_x`
<option
label = ${e[1]}
value = ${e[1]}
/>`)}
</select>` : lit_html_x`
<input
type = "text"
part="textbox textbox-server-var"
spellcheck = "false"
data-var = "${kv[0]}"
value = "${kv[1].default}"
@input = ${e => {
onApiServerVarChange.call(this, e, this.selectedServer);
}}
/>`}
</td>
</tr>
${kv[1].description ? lit_html_x`<tr><td colspan="2" style="border:none"><span class="m-markdown-small"> ${unsafe_html_o(marked(kv[1].description))} </span></td></tr>` : ''}
`)}
</table>
` : '';
}
function serverTemplate() {
var _this$resolvedSpec$se, _this$resolvedSpec2, _this$selectedServer;
if (!this.resolvedSpec || this.resolvedSpec.specLoadError) {
return '';
}
return lit_html_x`
<section id = 'servers' part="section-servers" style="text-align:left; direction:ltr; margin-top:24px; margin-bottom:24px;" class='regular-font observe-me ${'read focused'.includes(this.renderStyle) ? 'section-gap--read-mode' : 'section-gap'}'>
<div part = "section-servers-title" class = "sub-title">API SERVER</div>
<div class = 'mono-font' style='margin: 12px 0; font-size:calc(var(--font-size-small) + 1px);'>
${!this.resolvedSpec.servers || ((_this$resolvedSpec$se = this.resolvedSpec.servers) === null || _this$resolvedSpec$se === void 0 ? void 0 : _this$resolvedSpec$se.length) === 0 ? '' : lit_html_x`
${(_this$resolvedSpec2 = this.resolvedSpec) === null || _this$resolvedSpec2 === void 0 ? void 0 : _this$resolvedSpec2.servers.map((server, i) => lit_html_x`
<input type = 'radio'
name = 'api_server'
id = 'srvr-opt-${i}'
value = '${server.url}'
@change = ${() => {
setApiServer.call(this, server.url);
}}
.checked = '${this.selectedServer.url === server.url}'
style = 'margin:4px 0; cursor:pointer'
/>
<label style='cursor:pointer' for='srvr-opt-${i}'>
${server.url} ${server.description ? lit_html_x`- <span class='regular-font'>${server.description} </span>` : ''}
</label>
<br/>
`)}
`}
<div class="table-title primary-text" part="label-selected-server"> SELECTED: ${((_this$selectedServer = this.selectedServer) === null || _this$selectedServer === void 0 ? void 0 : _this$selectedServer.computedUrl) || 'none'}</div>
</div>
<slot name="servers"></slot>
${serverVarsTemplate.call(this)}
</section>`;
}
/* eslint-enable indent */
;// CONCATENATED MODULE: ./src/templates/navbar-template.js
function expandCollapseNavBarTag(navLinkEl, action = 'toggle') {
const tagAndPathEl = navLinkEl === null || navLinkEl === void 0 ? void 0 : navLinkEl.closest('.nav-bar-tag-and-paths');
const pathsUnderTagEl = tagAndPathEl === null || tagAndPathEl === void 0 ? void 0 : tagAndPathEl.querySelector('.nav-bar-paths-under-tag');
if (tagAndPathEl) {
const isExpanded = tagAndPathEl.classList.contains('expanded');
if (isExpanded && (action === 'toggle' || action === 'collapse')) {
pathsUnderTagEl.style.maxHeight = 0;
tagAndPathEl.classList.replace('expanded', 'collapsed');
} else if (!isExpanded && (action === 'toggle' || action === 'expand')) {
tagAndPathEl.classList.replace('collapsed', 'expanded');
pathsUnderTagEl.style.maxHeight = `${pathsUnderTagEl.scrollHeight}px`;
}
}
}
function expandCollapseAll(event, action = 'expand-all') {
if (!(event.type === 'click' || event.type === 'keyup' && event.keyCode === 13)) {
return;
}
const navEl = event.target.closest('.nav-scroll');
const elList = [...navEl.querySelectorAll('.nav-bar-tag-and-paths')];
if (action === 'expand-all') {
elList.forEach(el => {
const navBarPathsUnderTagEl = el.querySelector('.nav-bar-paths-under-tag');
el.classList.replace('collapsed', 'expanded');
navBarPathsUnderTagEl.style.maxHeight = `${navBarPathsUnderTagEl === null || navBarPathsUnderTagEl === void 0 ? void 0 : navBarPathsUnderTagEl.scrollHeight}px`;
});
} else {
elList.forEach(el => {
el.classList.replace('expanded', 'collapsed');
el.querySelector('.nav-bar-paths-under-tag').style.maxHeight = 0;
});
}
}
function navBarClickAndEnterHandler(event) {
var _navEl$dataset, _navEl$dataset2, _navEl$dataset3, _navEl$dataset4;
if (!(event.type === 'click' || event.type === 'keyup' && event.keyCode === 13)) {
return;
}
const navEl = event.target;
event.stopPropagation();
if (((_navEl$dataset = navEl.dataset) === null || _navEl$dataset === void 0 ? void 0 : _navEl$dataset.action) === 'navigate') {
this.scrollToEventTarget(event, false);
} else if (((_navEl$dataset2 = navEl.dataset) === null || _navEl$dataset2 === void 0 ? void 0 : _navEl$dataset2.action) === 'expand-all' || ((_navEl$dataset3 = navEl.dataset) === null || _navEl$dataset3 === void 0 ? void 0 : _navEl$dataset3.action) === 'collapse-all') {
expandCollapseAll(event, navEl.dataset.action);
} else if (((_navEl$dataset4 = navEl.dataset) === null || _navEl$dataset4 === void 0 ? void 0 : _navEl$dataset4.action) === 'expand-collapse-tag') {
expandCollapseNavBarTag(navEl, 'toggle');
}
}
/* eslint-disable indent */
function navbarTemplate() {
var _this$resolvedSpec$in, _this$resolvedSpec$in2, _this$resolvedSpec$in3, _this$resolvedSpec$in4;
if (!this.resolvedSpec || this.resolvedSpec.specLoadError) {
return lit_html_x`
<nav class='nav-bar' part='section-navbar'>
<slot name='nav-logo' class='logo'></slot>
</nav>
`;
}
return lit_html_x`
<nav class='nav-bar ${this.renderStyle}' part='section-navbar'>
<slot name='nav-logo' class='logo'></slot>
${this.allowSearch === 'false' && this.allowAdvancedSearch === 'false' ? '' : lit_html_x`
<div style='display:flex; flex-direction:row; justify-content:center; align-items:stretch; padding:8px 24px 12px 24px; ${this.allowAdvancedSearch === 'false' ? 'border-bottom: 1px solid var(--nav-hover-bg-color)' : ''}' part='section-navbar-search'>
${this.allowSearch === 'false' ? '' : lit_html_x`
<div style = 'display:flex; flex:1; line-height:22px;'>
<input id = 'nav-bar-search'
part = 'textbox textbox-nav-filter'
style = 'width:100%; padding-right:20px; color:var(--nav-hover-text-color); border-color:var(--nav-accent-color); background-color:var(--nav-hover-bg-color)'
type = 'text'
placeholder = 'Filter'
@change = '${this.onSearchChange}'
spellcheck = 'false'
>
<div style='margin: 6px 5px 0 -24px; font-size:var(--font-size-regular); cursor:pointer;'>&#x21a9;</div>
</div>
${this.matchPaths ? lit_html_x`
<button @click = '${this.onClearSearch}' class='m-btn thin-border' style='margin-left:5px; color:var(--nav-text-color); width:75px; padding:6px 8px;' part='btn btn-outline btn-clear-filter'>
CLEAR
</button>` : ''}
`}
${this.allowAdvancedSearch === 'false' || this.matchPaths ? '' : lit_html_x`
<button class='m-btn primary' part='btn btn-fill btn-search' style='margin-left:5px; padding:6px 8px; width:75px' @click='${this.onShowSearchModalClicked}'>
SEARCH
</button>
`}
</div>
`}
${lit_html_x`<nav class='nav-scroll' tabindex='-1' part='section-navbar-scroll' @click='${e => navBarClickAndEnterHandler.call(this, e)}' @keyup='${e => navBarClickAndEnterHandler.call(this, e)}' >
${this.showInfo === 'false' || !this.resolvedSpec.info ? '' : lit_html_x`
${this.infoDescriptionHeadingsInNavBar === 'true' ? lit_html_x`
${this.resolvedSpec.infoDescriptionHeaders.length > 0 ? lit_html_x`<div class='nav-bar-info ${this.navActiveItemMarker}' id='link-overview' data-content-id='overview' data-action='navigate' tabindex='0' part='section-navbar-item section-navbar-overview'>
${((_this$resolvedSpec$in = this.resolvedSpec.info) === null || _this$resolvedSpec$in === void 0 ? void 0 : (_this$resolvedSpec$in2 = _this$resolvedSpec$in.title) === null || _this$resolvedSpec$in2 === void 0 ? void 0 : _this$resolvedSpec$in2.trim()) || 'Overview'}
</div>` : ''}
<div class='overview-headers'>
${this.resolvedSpec.infoDescriptionHeaders.map(header => lit_html_x`
<div
class='nav-bar-h${header.depth} ${this.navActiveItemMarker}'
id='link-overview--${new marked.Slugger().slug(header.text)}'
data-action='navigate'
data-content-id='overview--${new marked.Slugger().slug(header.text)}'
>
${header.text}
</div>`)}
</div>
${this.resolvedSpec.infoDescriptionHeaders.length > 0 ? lit_html_x`<hr style='border-top: 1px solid var(--nav-hover-bg-color); border-width:1px 0 0 0; margin: 15px 0 0 0'/>` : ''}
` : lit_html_x`<div class='nav-bar-info ${this.navActiveItemMarker}' id='link-overview' data-action='navigate' data-content-id='overview' tabindex='0'>
${((_this$resolvedSpec$in3 = this.resolvedSpec.info) === null || _this$resolvedSpec$in3 === void 0 ? void 0 : (_this$resolvedSpec$in4 = _this$resolvedSpec$in3.title) === null || _this$resolvedSpec$in4 === void 0 ? void 0 : _this$resolvedSpec$in4.trim()) || 'Overview'}
</div>`}
`}
${this.allowServerSelection === 'false' ? '' : lit_html_x`<div class='nav-bar-info ${this.navActiveItemMarker}' id='link-servers' data-action='navigate' data-content-id='servers' tabindex='0' part='section-navbar-item section-navbar-servers'> API Servers </div>`}
${this.allowAuthentication === 'false' || !this.resolvedSpec.securitySchemes ? '' : lit_html_x`<div class='nav-bar-info ${this.navActiveItemMarker}' id='link-auth' data-action='navigate' data-content-id='auth' tabindex='0' part='section-navbar-item section-navbar-auth'> Authentication </div>`}
<div id='link-operations-top' class='nav-bar-section operations' data-action='navigate' data-content-id='${this.renderStyle === 'focused' ? '' : 'operations-top'}' part='section-navbar-item section-navbar-operations-top'>
<div style='font-size:16px; display:flex; margin-left:10px;'>
${this.renderStyle === 'focused' ? lit_html_x`
<div class='nav-bar-expand-all'
data-action='expand-all'
tabindex='0'
title='Expand all'
>▸</div>
<div class='nav-bar-collapse-all'
data-action='collapse-all'
tabindex='0'
title='Collapse all'
>▸</div>` : ''}
</div>
<div class='nav-bar-section-title'> OPERATIONS </div>
</div>
<!-- TAGS AND PATHS-->
${this.resolvedSpec.tags.filter(tag => tag.paths.filter(path => pathIsInSearch(this.matchPaths, path, this.matchType)).length).map(tag => {
var _tag$paths;
return lit_html_x`
<div class='nav-bar-tag-and-paths ${this.renderStyle === 'read' ? 'expanded' : tag.expanded ? 'expanded' : 'collapsed'}' >
${tag.name === 'General ⦂' ? lit_html_x`<hr style='border:none; border-top: 1px dotted var(--nav-text-color); opacity:0.3; margin:-1px 0 0 0;'/>` : lit_html_x`
<div
class='nav-bar-tag ${this.navActiveItemMarker}'
part='section-navbar-item section-navbar-tag'
id='link-${tag.elementId}'
data-action='${(this.renderStyle === 'read' ? 'navigate' : this.onNavTagClick === 'show-description') ? 'navigate' : 'expand-collapse-tag'}'
data-content-id='${(this.renderStyle === 'read' ? `${tag.elementId}` : this.onNavTagClick === 'show-description') ? `${tag.elementId}` : ''}'
data-first-path-id='${tag.firstPathId}'
tabindex='0'
>
<div style="pointer-events:none;">${tag.name}</div>
<div class='nav-bar-tag-icon' tabindex='0' data-action='expand-collapse-tag'></div>
</div>
`}
${this.infoDescriptionHeadingsInNavBar === 'true' ? lit_html_x`
${this.renderStyle === 'focused' && this.onNavTagClick === 'expand-collapse' ? '' : lit_html_x`
<div class='tag-headers'>
${tag.headers.map(header => lit_html_x`
<div
class='nav-bar-h${header.depth} ${this.navActiveItemMarker}'
part='section-navbar-item section-navbar-h${header.depth}'
id='link-${tag.elementId}--${new marked.Slugger().slug(header.text)}'
data-action='navigate'
data-content-id='${tag.elementId}--${new marked.Slugger().slug(header.text)}'
tabindex='0'
> ${header.text}</div>`)}
</div>`}` : ''}
<div class='nav-bar-paths-under-tag' style='max-height:${tag.expanded || this.renderStyle === 'read' ? (((_tag$paths = tag.paths) === null || _tag$paths === void 0 ? void 0 : _tag$paths.length) || 1) * 50 : 0}px;'>
<!-- Paths in each tag (endpoints) -->
${tag.paths.filter(v => {
if (this.matchPaths) {
return pathIsInSearch(this.matchPaths, v, this.matchType);
}
return true;
}).map(p => lit_html_x`
<div
class='nav-bar-path ${this.navActiveItemMarker} ${this.usePathInNavBar === 'true' ? 'small-font' : ''}'
part='section-navbar-item section-navbar-path'
data-action='navigate'
data-content-id='${p.elementId}'
id='link-${p.elementId}'
tabindex='0'
>
<span style = 'display:flex; pointer-events: none; align-items:start; ${p.deprecated ? 'filter:opacity(0.5)' : ''}'>
${lit_html_x`<span class='nav-method ${this.showMethodInNavBar} ${p.method}' style='pointer-events: none;'>
${this.showMethodInNavBar === 'as-colored-block' ? p.method.substring(0, 3).toUpperCase() : p.method.toUpperCase()}
</span>`}
${p.isWebhook ? lit_html_x`<span style='font-weight:bold; pointer-events: none; margin-right:8px; font-size: calc(var(--font-size-small) - 2px)'>WEBHOOK</span>` : ''}
${this.usePathInNavBar === 'true' ? lit_html_x`<span style='pointer-events: none;' class='mono-font'>${p.path}</span>` : p.summary || p.shortSummary}
</span>
</div>`)}
</div>
</div>
`;
})}
<!-- COMPONENTS -->
${this.resolvedSpec.components && this.showComponents === 'true' && this.renderStyle === 'focused' ? lit_html_x`
<div id='link-components' class='nav-bar-section components'>
<div></div>
<div class='nav-bar-section-title'>COMPONENTS</div>
</div>
${this.resolvedSpec.components.map(component => component.subComponents.length ? lit_html_x`
<div class='nav-bar-tag'
part='section-navbar-item section-navbar-tag'
data-action='navigate'
data-content-id='cmp--${component.name.toLowerCase()}'
id='link-cmp--${component.name.toLowerCase()}'
>
${component.name}
</div>
${component.subComponents.filter(p => p.expanded !== false).map(p => lit_html_x`
<div class='nav-bar-path' data-action='navigate' data-content-id='cmp--${p.id}' id='link-cmp--${p.id}'>
<span> ${p.name} </span>
</div>`)}` : '')}` : ''}
</nav>`}
</nav>
`;
}
/* eslint-enable indent */
;// CONCATENATED MODULE: ./src/templates/focused-endpoint-template.js
// eslint-disable-line import/extensions
function focused_endpoint_template_headingRenderer(tagElementId) {
const renderer = new marked.Renderer();
renderer.heading = (text, level, raw, slugger) => `<h${level} class="observe-me" id="${tagElementId}--${slugger.slug(raw)}">${text}</h${level}>`;
return renderer;
}
function wrapFocusedTemplate(templateToWrap) {
return lit_html_x`
<div class='regular-font section-gap--focused-mode' part="section-operations-in-tag">
${templateToWrap}
</div>`;
}
function defaultContentTemplate() {
var _this$resolvedSpec$ta;
// In focused mode default content is overview or first path
if (this.showInfo === 'true') {
return wrapFocusedTemplate(overviewTemplate.call(this));
}
const selectedTagObj = this.resolvedSpec.tags[0];
const selectedPathObj = (_this$resolvedSpec$ta = this.resolvedSpec.tags[0]) === null || _this$resolvedSpec$ta === void 0 ? void 0 : _this$resolvedSpec$ta.paths[0];
return selectedTagObj && selectedPathObj ? wrapFocusedTemplate(expandedEndpointBodyTemplate.call(this, selectedPathObj, selectedTagObj.name)) : wrapFocusedTemplate('');
}
/* eslint-disable indent */
function focusedTagBodyTemplate(tag) {
return lit_html_x`
<h1 id="${tag.elementId}">${tag.name}</h1>
${this.onNavTagClick === 'show-description' && tag.description ? lit_html_x`
<div class="m-markdown">
${unsafe_html_o(`
<div class="m-markdown regular-font">
${marked(tag.description || '', this.infoDescriptionHeadingsInNavBar === 'true' ? {
renderer: focused_endpoint_template_headingRenderer(tag.elementId)
} : undefined)}
</div>`)}
</div>` : ''}
`;
}
function focusedEndpointTemplate() {
if (!this.focusedElementId || !this.resolvedSpec) {
return;
}
const focusElId = this.focusedElementId;
let selectedPathObj = null;
let selectedTagObj = null;
let focusedTemplate;
let i = 0;
if (focusElId.startsWith('overview') && this.showInfo === 'true') {
focusedTemplate = overviewTemplate.call(this);
} else if (focusElId === 'auth' && this.allowAuthentication === 'true') {
focusedTemplate = securitySchemeTemplate.call(this);
} else if (focusElId === 'servers' && this.allowServerSelection === 'true') {
focusedTemplate = serverTemplate.call(this);
} else if (focusElId === 'operations-top') {
focusedTemplate = lit_html_x`
<div id="operations-top" class="observe-me">
<slot name="operations-top"></slot>
</div>`;
} else if (focusElId.startsWith('cmp--') && this.showComponents === 'true') {
focusedTemplate = componentsTemplate.call(this);
} else if (focusElId.startsWith('tag--')) {
const idToFocus = focusElId.indexOf('--', 4) > 0 ? focusElId.substring(0, focusElId.indexOf('--', 5)) : focusElId;
selectedTagObj = this.resolvedSpec.tags.find(v => v.elementId === idToFocus);
if (selectedTagObj) {
focusedTemplate = wrapFocusedTemplate.call(this, focusedTagBodyTemplate.call(this, selectedTagObj));
} else {
focusedTemplate = defaultContentTemplate.call(this);
}
} else {
for (i = 0; i < this.resolvedSpec.tags.length; i += 1) {
selectedTagObj = this.resolvedSpec.tags[i];
selectedPathObj = this.resolvedSpec.tags[i].paths.find(v => `${v.elementId}` === focusElId);
if (selectedPathObj) {
break;
}
}
if (selectedPathObj) {
// In focused mode we must expand the nav-bar tag element if it is collapsed
const newNavEl = this.shadowRoot.getElementById(`link-${focusElId}`);
expandCollapseNavBarTag(newNavEl, 'expand');
focusedTemplate = wrapFocusedTemplate.call(this, expandedEndpointBodyTemplate.call(this, selectedPathObj, selectedTagObj.name || '', selectedTagObj.description || ''));
} else {
// if focusedElementId is not found then show the default content (overview or first-path)
focusedTemplate = defaultContentTemplate.call(this);
}
}
return focusedTemplate;
}
/* eslint-enable indent */
;// CONCATENATED MODULE: ./src/templates/endpoint-template.js
// eslint-disable-line import/extensions
function toggleExpand(path) {
if (path.expanded) {
path.expanded = false; // collapse
if (this.updateRoute === 'true') {
this.replaceHistoryState('');
}
} else {
path.expanded = true; // Expand
if (this.updateRoute === 'true') {
const newHash = `${this.routePrefix || '#'}${path.elementId}`;
if (window.location.hash !== newHash) {
this.replaceHistoryState(path.elementId);
}
}
}
this.requestUpdate();
}
function endpoint_template_expandCollapseAll(operationsRootEl, action = 'expand-all') {
const elList = [...operationsRootEl.querySelectorAll('.section-tag')];
if (action === 'expand-all') {
elList.map(el => {
el.classList.replace('collapsed', 'expanded');
});
} else {
elList.map(el => {
el.classList.replace('expanded', 'collapsed');
});
}
}
function onExpandCollapseAll(e, action = 'expand-all') {
endpoint_template_expandCollapseAll.call(this, e.target.closest('.operations-root'), action);
}
/* eslint-disable indent */
function endpointHeadTemplate(path, pathsExpanded = false) {
return lit_html_x`
<summary @click="${e => {
toggleExpand.call(this, path, e);
}}" part="section-endpoint-head-${path.expanded ? 'expanded' : 'collapsed'}" class='endpoint-head ${path.method} ${path.deprecated ? 'deprecated' : ''} ${pathsExpanded || path.expanded ? 'expanded' : 'collapsed'}'>
<div part="section-endpoint-head-method" class="method ${path.method} ${path.deprecated ? 'deprecated' : ''}"> ${path.method} </div>
<div part="section-endpoint-head-path" class="path ${path.deprecated ? 'deprecated' : ''}">
${path.path}
${path.isWebhook ? lit_html_x`<span style="font-family: var(--font-regular); font-size: var(--); font-size: var(--font-size-small); color:var(--primary-color); margin-left: 16px"> Webhook</span>` : ''}
</div>
${path.deprecated ? lit_html_x`
<span style="font-size:var(--font-size-small); text-transform:uppercase; font-weight:bold; color:var(--red); margin:2px 0 0 5px;">
deprecated
</span>` : ''}
${this.showSummaryWhenCollapsed ? lit_html_x`
<div class="only-large-screen" style="min-width:60px; flex:1"></div>
<div part="section-endpoint-head-description" class="descr">${path.summary || path.shortSummary} </div>` : ''}
</summary>
`;
}
function endpointBodyTemplate(path) {
var _path$xBadges, _path$externalDocs, _path$externalDocs2, _path$externalDocs3, _path$externalDocs4, _path$externalDocs5, _path$externalDocs6;
const acceptContentTypes = new Set();
for (const respStatus in path.responses) {
for (const acceptContentType in (_path$responses$respS = path.responses[respStatus]) === null || _path$responses$respS === void 0 ? void 0 : _path$responses$respS.content) {
var _path$responses$respS;
acceptContentTypes.add(acceptContentType.trim());
}
}
const accept = [...acceptContentTypes].join(', ');
// Filter API Keys that are non-empty and are applicable to the the path
const nonEmptyApiKeys = this.resolvedSpec.securitySchemes.filter(v => {
var _path$security;
return v.finalKeyValue && ((_path$security = path.security) === null || _path$security === void 0 ? void 0 : _path$security.some(ps => v.securitySchemeId in ps));
}) || [];
// If a RapiDoc API Key is specified on the element and its value is not hyphen(-) then include it for all paths
const rapiDocApiKey = this.resolvedSpec.securitySchemes.find(v => v.securitySchemeId === rapidocApiKey && v.value !== '-');
if (rapiDocApiKey) {
nonEmptyApiKeys.push(rapiDocApiKey);
}
const codeSampleTabPanel = path.xCodeSamples ? codeSamplesTemplate(path.xCodeSamples) : '';
return lit_html_x`
<div part="section-endpoint-body-${path.expanded ? 'expanded' : 'collapsed'}" class='endpoint-body ${path.method} ${path.deprecated ? 'deprecated' : ''}'>
<div class="summary">
${path.summary ? lit_html_x`<div class="title" part="section-endpoint-body-title">${path.summary}<div>` : path.shortSummary !== path.description ? lit_html_x`<div class="title" part="section-endpoint-body-title">${path.shortSummary}</div>` : ''}
${path.xBadges && ((_path$xBadges = path.xBadges) === null || _path$xBadges === void 0 ? void 0 : _path$xBadges.length) > 0 ? lit_html_x`
<div style="display:flex; flex-wrap:wrap;font-size: var(--font-size-small);">
${path.xBadges.map(v => lit_html_x`<span part="endpoint-badge" style="margin:1px; margin-right:5px; padding:1px 8px; font-weight:bold; border-radius:12px; background-color: var(--light-${v.color}, var(--input-bg)); color:var(--${v.color}); border:1px solid var(--${v.color})">${v.label}</span>`)}
</div>
` : ''}
${path.description ? lit_html_x`<div part="section-endpoint-body-description" class="m-markdown"> ${unsafe_html_o(marked(path.description))}</div>` : ''}
${(_path$externalDocs = path.externalDocs) !== null && _path$externalDocs !== void 0 && _path$externalDocs.url || (_path$externalDocs2 = path.externalDocs) !== null && _path$externalDocs2 !== void 0 && _path$externalDocs2.description ? lit_html_x`<div style="background-color:var(--bg3); padding:2px 8px 8px 8px; margin:8px 0; border-radius:var(--border-radius)">
<div class="m-markdown"> ${unsafe_html_o(marked(((_path$externalDocs3 = path.externalDocs) === null || _path$externalDocs3 === void 0 ? void 0 : _path$externalDocs3.description) || ''))} </div>
${(_path$externalDocs4 = path.externalDocs) !== null && _path$externalDocs4 !== void 0 && _path$externalDocs4.url ? lit_html_x`<a style="font-family:var(--font-mono); font-size:var(--font-size-small)" href="${(_path$externalDocs5 = path.externalDocs) === null || _path$externalDocs5 === void 0 ? void 0 : _path$externalDocs5.url}" target="_blank">
${(_path$externalDocs6 = path.externalDocs) === null || _path$externalDocs6 === void 0 ? void 0 : _path$externalDocs6.url} <div style="transform: rotate(270deg) scale(1.5); display: inline-block; margin-left:5px">⇲</div>
</a>` : ''}
</div>` : ''}
<slot name="${path.elementId}"></slot>
${pathSecurityTemplate.call(this, path.security)}
${codeSampleTabPanel}
</div>
<div class='req-resp-container'>
<div style="display:flex; flex-direction:column" class="view-mode-request ${this.layout}-layout">
<api-request
class = "${this.renderStyle}-mode ${this.layout}-layout"
style = "width:100%;"
webhook = "${path.isWebhook}"
method = "${path.method}"
path = "${path.path}"
.security = "${path.security}"
.parameters = "${path.parameters}"
.request_body = "${path.requestBody}"
.api_keys = "${nonEmptyApiKeys}"
.servers = "${path.servers}"
server-url = "${path.servers && path.servers.length > 0 ? path.servers[0].url : this.selectedServer.computedUrl}"
active-schema-tab = "${this.defaultSchemaTab}"
fill-request-fields-with-example = "${this.fillRequestFieldsWithExample}"
allow-try = "${this.allowTry}"
show-curl-before-try = "${this.showCurlBeforeTry}"
accept = "${accept}"
render-style="${this.renderStyle}"
schema-style = "${this.schemaStyle}"
schema-expand-level = "${this.schemaExpandLevel}"
schema-description-expanded = "${this.schemaDescriptionExpanded}"
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
schema-hide-read-only = "${this.schemaHideReadOnly === 'never' ? 'false' : path.isWebhook ? 'false' : 'true'}"
schema-hide-write-only = "${this.schemaHideWriteOnly === 'never' ? 'false' : path.isWebhook ? 'true' : 'false'}"
fetch-credentials = "${this.fetchCredentials}"
exportparts = "wrap-request-btn:wrap-request-btn, btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, btn-clear:btn-clear, btn-clear-resp:btn-clear-resp,
file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param,
anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
> </api-request>
${path.callbacks ? callbackTemplate.call(this, path.callbacks) : ''}
</div>
<api-response
class = "${this.renderStyle}-mode"
style = "width:100%;"
webhook = "${path.isWebhook}"
.responses="${path.responses}"
active-schema-tab = "${this.defaultSchemaTab}"
render-style="${this.renderStyle}"
schema-style="${this.schemaStyle}"
schema-expand-level = "${this.schemaExpandLevel}"
schema-description-expanded = "${this.schemaDescriptionExpanded}"
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
schema-hide-read-only = "${this.schemaHideReadOnly === 'never' ? 'false' : path.isWebhook ? 'true' : 'false'}"
schema-hide-write-only = "${this.schemaHideWriteOnly === 'never' ? 'false' : path.isWebhook ? 'false' : 'true'}"
selected-status = "${Object.keys(path.responses || {})[0] || ''}"
exportparts = "btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, file-input:file-input,
textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param, anchor:anchor, anchor-param-example:anchor-param-example, btn-clear-resp:btn-clear-resp,
schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"
> </api-response>
</div>
</div>`;
}
function endpointTemplate(showExpandCollapse = true, showTags = true, pathsExpanded = false) {
if (!this.resolvedSpec) {
return '';
}
return lit_html_x`
${showExpandCollapse ? lit_html_x`
<div style="display:flex; justify-content:flex-end;">
<span @click="${e => onExpandCollapseAll(e, 'expand-all')}" style="color:var(--primary-color); cursor:pointer;">
Expand all
</span>
&nbsp;|&nbsp;
<span @click="${e => onExpandCollapseAll(e, 'collapse-all')}" style="color:var(--primary-color); cursor:pointer;" >
Collapse all
</span>
&nbsp; sections
</div>` : ''}
${this.resolvedSpec.tags.map(tag => lit_html_x`
${showTags ? lit_html_x`
<div class='regular-font section-gap section-tag ${tag.expanded ? 'expanded' : 'collapsed'}'>
<div class='section-tag-header' @click="${() => {
tag.expanded = !tag.expanded;
this.requestUpdate();
}}">
<div id='${tag.elementId}' class="sub-title tag" style="color:var(--primary-color)">${tag.name}</div>
</div>
<div class='section-tag-body'>
<slot name="${tag.elementId}"></slot>
<div class="regular-font regular-font-size m-markdown" style="padding-bottom:12px">
${unsafe_html_o(marked(tag.description || ''))}
</div>
${tag.paths.filter(v => {
if (this.matchPaths) {
return pathIsInSearch(this.matchPaths, v, this.matchType);
}
return true;
}).map(path => lit_html_x`
<section part="section-endpoint" id='${path.elementId}' class='m-endpoint regular-font ${path.method} ${pathsExpanded || path.expanded ? 'expanded' : 'collapsed'}'>
${endpointHeadTemplate.call(this, path, pathsExpanded)}
${pathsExpanded || path.expanded ? endpointBodyTemplate.call(this, path) : ''}
</section>`)}
</div>
</div>` : lit_html_x`
<div class='section-tag-body'>
${tag.paths.filter(v => {
if (this.matchPaths) {
return pathIsInSearch(this.matchPaths, v, this.matchType);
}
return true;
}).map(path => lit_html_x`
<section id='${path.elementId}' class='m-endpoint regular-font ${path.method} ${pathsExpanded || path.expanded ? 'expanded' : 'collapsed'}'>
${endpointHeadTemplate.call(this, path, pathsExpanded)}
${pathsExpanded || path.expanded ? endpointBodyTemplate.call(this, path) : ''}
</section>`)}
</div>
`}
`)}`;
}
/* eslint-enable indent */
;// CONCATENATED MODULE: ./src/templates/logo-template.js
/* eslint-disable indent */
function logoTemplate(style) {
return lit_html_x`
<div style=${style}>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="1 0 511 512">
<path d="M351 411a202 202 0 01-350 0 203 203 0 01333-24 203 203 0 0117 24zm0 0" fill="#adc165"/>
<path d="M334 387a202 202 0 01-216-69 202 202 0 01216 69zm78 32H85a8 8 0 01-8-8 8 8 0 018-8h327a8 8 0 017 8 8 8 0 01-7 8zm0 0" fill="#99aa52"/>
<path d="M374 338l-5 30a202 202 0 01-248-248 203 203 0 01253 218zm0 0" fill="#ffc73b"/>
<path d="M374 338a202 202 0 01-100-197 203 203 0 01100 197zm38 81l-6-2-231-231a8 8 0 0111-11l231 230a8 8 0 01-5 14zm0 0" fill="#efb025"/>
<path d="M311 175c0 75 40 140 101 175a202 202 0 000-350 202 202 0 00-101 175zm0 0" fill="#ff903e"/>
<path d="M412 419a8 8 0 01-8-8V85a8 8 0 0115 0v326a8 8 0 01-7 8zm0 0" fill="#e87425"/>
</svg>
</div>
`;
}
/* eslint-enable indent */
;// CONCATENATED MODULE: ./src/templates/header-template.js
/* eslint-disable indent */
function headerTemplate() {
return lit_html_x`
<header class="row main-header regular-font" part="section-header" style="padding:8px 4px 8px 4px;min-height:48px;">
<div class="only-large-screen-flex" style="align-items: center;">
<slot name="logo" class="logo" part="section-logo">
${logoTemplate('height:36px;width:36px;margin-left:5px')}
<!-- m-logo style="height:36px;width:36px;margin-left:5px"></m-logo -->
</slot>
<div class="header-title" part="label-header-title">${this.headingText}</div>
</div>
<div style="margin: 0px 8px;display:flex;flex:1">
${this.allowSpecUrlLoad === 'false' ? '' : lit_html_x`
<input id="spec-url"
type="text"
style="font-size:var(--font-size-small)"
class="header-input mono-font"
part="textbox textbox-spec-url"
placeholder="Spec URL"
value="${this.specUrl || ''}"
@change="${this.onSpecUrlChange}"
spellcheck="false"
>
<div style="margin: 6px 5px 0 -24px; font-size:var(--font-size-regular); cursor:pointer;">&#x21a9;</div>
`}
${this.allowSpecFileLoad === 'false' ? '' : lit_html_x`
<input id="spec-file"
part = "file-input"
type="file"
style="display:none"
value="${this.specFile || ''}"
@change="${this.onSpecFileChange}"
spellcheck="false"
>
<button class="m-btn primary only-large-screen" style="margin-left:10px;" part="btn btn-fill" @click="${this.onFileLoadClick}"> LOCAL JSON FILE </button>
`}
<slot name="header"></slot>
${this.allowSearch === 'false' || 'read focused'.includes(this.renderStyle) ? '' : lit_html_x`
<input id="search" class="header-input" type="text" part="textbox textbox-header-filter" placeholder="Filter" @change="${this.onSearchChange}" style="max-width:130px;margin-left:10px;" spellcheck="false" >
<div style="margin: 6px 5px 0 -24px; font-size:var(--font-size-regular); cursor:pointer;">&#x21a9;</div>
`}
${this.allowAdvancedSearch === 'false' || 'read focused'.includes(this.renderStyle) ? '' : lit_html_x`
<button class="m-btn primary only-large-screen" part="btn btn-fill btn-search" style="margin-left:10px;" @click="${this.onShowSearchModalClicked}">
Search
</button>
`}
</div>
</header>`;
}
/* eslint-enable indent */
;// CONCATENATED MODULE: ./src/styles/dialog-box-styles.js
/* harmony default export */ const dialog_box_styles = (i`
*, *:before, *:after { box-sizing: border-box; }
.dialog-box-overlay {
background-color: var(--overlay-bg);
position: fixed;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
overflow: hidden;
z-index: var(--dialog-z-index);
}
.dialog-box {
position: fixed;
top: 100px;
left: 50%;
transform: translate(-50%, 0%);
display: flex;
flex-direction: column;
width: 70vw;
background-color: var(--bg2);
color: var(--fg2);
border-radius: 4px;
max-height: 500px;
overflow: hidden;
border: 1px solid var(--border-color);
box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
}
.dialog-box-header {
position: sticky;
top: 0;
align-self: stretch;
display: flex;
align-items: center;
padding: 0px 16px;
min-height: 60px;
max-height: 60px;
border-bottom: 1px solid var(--light-border-color);
overflow: hidden;
}
.dialog-box-header button {
font-size: 1.5rem;
font-weight: 700;
line-height: 1;
color: var(--fg);
border: none;
outline: none;
background-color: transparent;
cursor:pointer;
border: 1px solid transparent;
border-radius: 50%;
margin-right: -8px;
}
.dialog-box-header button:hover {
border-color: var(--primary-color);
}
.dialog-box-content {
padding: 16px;
display:block;
overflow: auto;
height: 100%;
}
.dialog-box-title {
flex-grow: 1;
font-size:24px;
}
`);
;// CONCATENATED MODULE: ./src/components/dialog-box.js
class DialogBox extends lit_element_s {
static get properties() {
return {
heading: {
type: String,
attribute: 'heading'
},
show: {
type: String,
attribute: 'show'
}
};
}
static get styles() {
return [dialog_box_styles];
}
connectedCallback() {
super.connectedCallback();
document.addEventListener('keydown', e => {
if (e.code === 'Escape') {
this.onClose();
}
});
}
attributeChangedCallback(name, oldVal, newVal) {
if (oldVal !== newVal) {
if (name === 'heading') {
this.heading = newVal;
}
if (name === 'show') {
this.show = newVal;
if (newVal === 'true') {
document.dispatchEvent(new CustomEvent('open', {
bubbles: true,
composed: true,
detail: this
}));
}
}
}
super.attributeChangedCallback(name, oldVal, newVal);
}
/* eslint-disable indent */
render() {
return lit_html_x`
${this.show === 'true' ? lit_html_x`
<div class="dialog-box-overlay">
<div class="dialog-box">
<header class="dialog-box-header">
<span class="dialog-box-title">${this.heading}</span>
<button type="button" @click="${this.onClose}">&times;</button>
</header>
<div class="dialog-box-content">
<slot></slot>
</div>
</div>
</div>` : ''}`;
}
/* eslint-enable indent */
onClose() {
document.dispatchEvent(new CustomEvent('close', {
bubbles: true,
composed: true
}));
}
}
customElements.define('dialog-box', DialogBox);
;// CONCATENATED MODULE: ./src/templates/advance-search-template.js
/* eslint-disable indent */
function searchByPropertiesModalTemplate() {
var _this$advancedSearchM;
document.addEventListener('close', () => {
this.showAdvancedSearchDialog = false;
});
document.addEventListener('open', this.onOpenSearchDialog);
return lit_html_x`
<dialog-box
heading="Search"
show="${!!this.showAdvancedSearchDialog}"
>
<span class="advanced-search-options">
<input
style="width:100%; padding-right:20px;"
type="text"
part="textbox textbox-search-dialog"
placeholder="search text..."
spellcheck="false"
@keyup = "${e => this.onAdvancedSearch(e, 400)}"
>
<div style="display:flex; margin:8px 0 24px;">
<div>
<input style="cursor:pointer;" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-path" checked @change = "${e => this.onAdvancedSearch(e, 0)}">
<label for="search-api-path" style="cursor:pointer;"> API Path </label>
</div>
<div style="margin-left: 16px;">
<input style="cursor:pointer;" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-descr" checked @change = "${e => this.onAdvancedSearch(e, 0)}">
<label style="cursor:pointer;" for="search-api-descr"> API Description </label>
</div>
<div style="margin-left: 16px;">
<input style="cursor:pointer;" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-params" @change = "${e => this.onAdvancedSearch(e, 0)}">
<label style="cursor:pointer;" for="search-api-params"> API Parameters </label>
</div>
<div style="margin-left: 16px;">
<input style="cursor:pointer;" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-request-body" @change = "${e => this.onAdvancedSearch(e, 0)}">
<label style="cursor:pointer;" for="search-api-request-body"> Request Body Parameters </label>
</div>
<div style="margin-left: 16px;">
<input style="cursor:pointer;" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-resp-descr" @change = "${e => this.onAdvancedSearch(e, 0)}">
<label style="cursor:pointer;" for="search-api-resp-descr"> Response Description </label>
</div>
</div>
</span>
${(_this$advancedSearchM = this.advancedSearchMatches) === null || _this$advancedSearchM === void 0 ? void 0 : _this$advancedSearchM.map(path => lit_html_x`
<div
class="mono-font small-font-size hover-bg"
style='padding: 5px; cursor: pointer; border-bottom: 1px solid var(--light-border-color); ${path.deprecated ? 'filter:opacity(0.5);' : ''}'
data-content-id='${path.elementId}'
tabindex = '0'
@click="${e => {
this.matchPaths = ''; // clear quick filter if applied
this.showAdvancedSearchDialog = false; // Hide Search Dialog
this.requestUpdate();
this.scrollToEventTarget(e, true);
}}"
>
<span class="upper bold-text method-fg ${path.method}">${path.method}</span>
<span>${path.path}</span>
<span class="regular-font gray-text">${path.summary}</span>
</div>
`)}
</dialog-box>
`;
}
/* eslint-enable indent */
;// CONCATENATED MODULE: ./src/utils/color-utils.js
/* harmony default export */ const color_utils = ({
color: {
inputReverseFg: '#fff',
inputReverseBg: '#333',
headerBg: '#444',
getRgb(hex) {
if (hex.indexOf('#') === 0) {
hex = hex.slice(1, 7);
}
// convert 3-digit hex to 6-digits.
if (hex.length === 3 || hex.length === 4) {
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
}
if (hex.length !== 6) {
throw new Error('Invalid HEX color.');
}
return {
r: parseInt(hex.slice(0, 2), 16),
g: parseInt(hex.slice(2, 4), 16),
b: parseInt(hex.slice(4, 6), 16)
};
},
luminanace(hexColorCode) {
const rgb = this.getRgb(hexColorCode);
return rgb.r * 0.299 + rgb.g * 0.587 + rgb.b * 0.114;
},
invert(hexColorCode) {
return this.luminanace(hexColorCode) > 135 ? '#000' : '#fff'; // compare with `>=128`, but giving little more preference to white over black
},
opacity(hex, opacity) {
const rgb = this.getRgb(hex);
return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${opacity})`;
},
brightness(hex, amt) {
const rgb = this.getRgb(hex);
rgb.r += amt;
rgb.g += amt;
rgb.b += amt;
if (rgb.r > 255) rgb.r = 255;else if (rgb.r < 0) rgb.r = 0;
if (rgb.g > 255) rgb.g = 255;else if (rgb.g < 0) rgb.g = 0;
if (rgb.b > 255) rgb.b = 255;else if (rgb.b < 0) rgb.b = 0;
return `#${rgb.r.toString(16).padStart(2, '0')}${rgb.g.toString(16).padStart(2, '0')}${rgb.b.toString(16).padStart(2, '0')}`;
},
hasGoodContrast(hexColorCode1, hexColorCode2) {
const lum1 = this.luminanace(hexColorCode1);
const lum2 = this.luminanace(hexColorCode2);
return lum1 - lum2;
}
}
});
function isValidHexColor(colorCode) {
return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/i.test(colorCode);
}
;// CONCATENATED MODULE: ./src/utils/theme.js
/* Generates an schema object containing type and constraint info */
function setTheme(baseTheme, theme = {}) {
let newTheme = {};
// Common Theme colors
const primaryColor = theme.primaryColor ? theme.primaryColor : baseTheme === 'dark' ? '#f76b39' : '#ff591e';
const primaryColorInvert = color_utils.color.invert(primaryColor);
const primaryColorTrans = color_utils.color.opacity(primaryColor, '0.4');
// Dark and Light Theme colors
if (baseTheme === 'dark') {
const bg1 = theme.bg1 ? theme.bg1 : '#2a2b2c';
const fg1 = theme.fg1 ? theme.fg1 : '#bbb';
const bg2 = theme.bg2 ? theme.bg2 : color_utils.color.brightness(bg1, 5); // or #383838;
const bg3 = theme.bg3 ? theme.bg3 : color_utils.color.brightness(bg1, 17); // or #444;
const lightBg = theme.bg3 ? theme.bg3 : color_utils.color.brightness(bg1, 35);
const fg2 = theme.fg2 ? theme.fg2 : color_utils.color.brightness(fg1, -15); // or #ababab
const fg3 = theme.fg3 ? theme.fg3 : color_utils.color.brightness(fg1, -20); // or #aaa
const lightFg = theme.fg3 ? theme.fg3 : color_utils.color.brightness(fg1, -65); // or #777
const inlineCodeFg = theme.inlineCodeFg ? theme.inlineCodeFg : '#aaa';
const selectionBg = '#bbb';
const selectionFg = '#eee';
const headerColor = theme.headerColor ? theme.headerColor : color_utils.color.brightness(bg1, 10);
const navBgColor = theme.navBgColor ? theme.navBgColor : color_utils.color.brightness(bg1, 10);
const navTextColor = theme.navTextColor ? theme.navTextColor : color_utils.color.opacity(color_utils.color.invert(navBgColor), '0.50');
const navHoverBgColor = theme.navHoverBgColor ? theme.navHoverBgColor : color_utils.color.brightness(navBgColor, -15);
const navHoverTextColor = theme.navHoverTextColor ? theme.navHoverTextColor : color_utils.color.invert(navBgColor);
const navAccentColor = theme.navAccentColor ? theme.navAccentColor : color_utils.color.brightness(primaryColor, 25);
const navAccentTextColor = theme.navAccentTextColor ? theme.navAccenttextColor : color_utils.color.invert(navAccentColor);
const overlayBg = 'rgba(80, 80, 80, 0.4)';
newTheme = {
bg1,
bg2,
bg3,
lightBg,
fg1,
fg2,
fg3,
lightFg,
inlineCodeFg,
primaryColor,
primaryColorTrans,
primaryColorInvert,
selectionBg,
selectionFg,
overlayBg,
navBgColor,
navTextColor,
navHoverBgColor,
navHoverTextColor,
navAccentColor,
navAccentTextColor,
headerColor,
headerColorInvert: color_utils.color.invert(headerColor),
headerColorDarker: color_utils.color.brightness(headerColor, -20),
headerColorBorder: color_utils.color.brightness(headerColor, 10),
borderColor: theme.borderColor || color_utils.color.brightness(bg1, 20),
// #555
lightBorderColor: theme.lightBorderColor || color_utils.color.brightness(bg1, 15),
// #444
codeBorderColor: theme.codeBorderColor || color_utils.color.brightness(bg1, 30),
inputBg: theme.inputBg || color_utils.color.brightness(bg1, -5),
// #2f2f2f
placeHolder: theme.placeHolder || color_utils.color.opacity(fg1, '0.3'),
hoverColor: theme.hoverColor || color_utils.color.brightness(bg1, -10),
// #2a2a2a
red: theme.red ? theme.red : '#F06560',
lightRed: theme.lightRed ? theme.lightRed : color_utils.color.brightness(bg1, -10),
// #2a2a2a
pink: theme.pink ? theme.pink : '#ffb2b2',
lightPink: theme.lightPink || color_utils.color.brightness(bg1, -10),
green: theme.green || '#7ec699',
lightGreen: theme.lightGreen || color_utils.color.brightness(bg1, -10),
// #2a2a2a
blue: theme.blue || '#71b7ff',
lightBlue: theme.lightBlue || color_utils.color.brightness(bg1, -10),
// #2a2a2a
orange: theme.orange ? theme.orange : '#f08d49',
lightOrange: theme.lightOrange || color_utils.color.brightness(bg1, -10),
// #2a2a2a
yellow: theme.yellow || '#827717',
lightYellow: theme.lightYellow || color_utils.color.brightness(bg1, -10),
// #2a2a2a
purple: theme.purple || '#786FF1',
brown: theme.brown || '#D4AC0D',
codeBg: theme.codeBg || color_utils.color.opacity(color_utils.color.brightness(bg1, -15), 0.7),
codeFg: theme.codeFg || '#aaa',
codePropertyColor: theme.codePropertyColor || '#f8c555',
codeKeywordColor: theme.codeKeywordColor || '#cc99cd',
codeOperatorColor: theme.codeOperatorColor || '#67cdcc'
};
} else {
const bg1 = theme.bg1 ? theme.bg1 : '#fafbfc';
const fg1 = theme.fg1 ? theme.fg1 : '#444444';
const bg2 = theme.bg2 ? theme.bg2 : color_utils.color.brightness(bg1, -5); // or '#fafafa'
const bg3 = theme.bg3 ? theme.bg3 : color_utils.color.brightness(bg1, -15); // or '#f6f6f6'
const lightBg = theme.bg3 ? theme.bg3 : color_utils.color.brightness(bg1, -45);
const fg2 = theme.fg2 ? theme.fg2 : color_utils.color.brightness(fg1, 17); // or '#555'
const fg3 = theme.fg3 ? theme.fg3 : color_utils.color.brightness(fg1, 30); // or #666
const lightFg = theme.fg3 ? theme.fg3 : color_utils.color.brightness(fg1, 70); // or #999
const inlineCodeFg = theme.inlineCodeFg ? theme.inlineCodeFg : 'brown';
const selectionBg = '#444';
const selectionFg = '#eee';
const headerColor = theme.headerColor ? theme.headerColor : color_utils.color.brightness(bg1, -180);
/*
const navBgColor = theme.navBgColor ? theme.navBgColor : ColorUtils.color.brightness(bg1, -10);
const navTextColor = theme.navTextColor ? theme.navTextColor : ColorUtils.color.brightness(fg1, 5);
const navHoverBgColor = theme.navHoverBgColor ? theme.navHoverBgColor : bg1;
const navHoverTextColor = theme.navHoverTextColor ? theme.navHoverTextColor : primaryColor;
const navAccentColor = theme.navAccentColor ? theme.navAccentColor : primaryColor;
*/
const navBgColor = theme.navBgColor ? theme.navBgColor : color_utils.color.brightness(bg1, -200);
const navTextColor = theme.navTextColor ? theme.navTextColor : color_utils.color.opacity(color_utils.color.invert(navBgColor), '0.65');
const navHoverBgColor = theme.navHoverBgColor ? theme.navHoverBgColor : color_utils.color.brightness(navBgColor, -15);
const navHoverTextColor = theme.navHoverTextColor ? theme.navHoverTextColor : color_utils.color.invert(navBgColor);
const navAccentColor = theme.navAccentColor ? theme.navAccentColor : color_utils.color.brightness(primaryColor, 25);
const navAccentTextColor = theme.navAccentTextColor ? theme.navAccenttextColor : color_utils.color.invert(navAccentColor);
const overlayBg = 'rgba(0, 0, 0, 0.4)';
newTheme = {
bg1,
bg2,
bg3,
lightBg,
fg1,
fg2,
fg3,
lightFg,
inlineCodeFg,
primaryColor,
primaryColorTrans,
primaryColorInvert,
selectionBg,
selectionFg,
overlayBg,
navBgColor,
navTextColor,
navHoverBgColor,
navHoverTextColor,
navAccentColor,
navAccentTextColor,
headerColor,
headerColorInvert: color_utils.color.invert(headerColor),
headerColorDarker: color_utils.color.brightness(headerColor, -20),
headerColorBorder: color_utils.color.brightness(headerColor, 10),
borderColor: theme.borderColor || color_utils.color.brightness(bg1, -38),
lightBorderColor: theme.lightBorderColor || color_utils.color.brightness(bg1, -23),
codeBorderColor: theme.codeBorderColor || 'transparent',
inputBg: theme.inputBg || color_utils.color.brightness(bg1, 10),
// #fff
placeHolder: theme.placeHolder || color_utils.color.brightness(lightFg, 20),
// #dedede
hoverColor: theme.hoverColor || color_utils.color.brightness(bg1, -5),
// # f1f1f1
red: theme.red || '#F06560',
lightRed: theme.lightRed || '#fff0f0',
pink: theme.pink ? theme.pink : '#990055',
lightPink: theme.lightPink ? theme.lightPink : '#ffb2b2',
green: theme.green || '#690',
lightGreen: theme.lightGreen || '#fbfff0',
blue: theme.blue || '#47AFE8',
lightBlue: theme.lightBlue || '#eff8fd',
orange: theme.orange || '#FF9900',
lightOrange: theme.lightOrange || '#fff5e6',
yellow: theme.yellow || '#827717',
lightYellow: theme.lightYellow || '#fff5cc',
purple: theme.purple || '#786FF1',
brown: theme.brown || '#D4AC0D',
codeBg: theme.codeBg || color_utils.color.opacity(color_utils.color.brightness(bg1, -15), 0.7),
codeFg: theme.codeFg || '#666',
codePropertyColor: theme.codePropertyColor || '#905',
codeKeywordColor: theme.codeKeywordColor || '#07a',
codeOperatorColor: theme.codeOperatorColor || '#9a6e3a'
};
}
return lit_html_x`
<style>
*, *:before, *:after { box-sizing: border-box; }
:host {
/* Common Styles - irrespective of themes */
--border-radius: 2px;
--layout: ${this.layout || 'row'};
--font-mono: ${this.monoFont || 'Monaco, "Andale Mono", "Roboto Mono", Consolas, monospace'};
--font-regular: ${this.regularFont || '"Open Sans", Avenir, "Segoe UI", Arial, sans-serif'};
--scroll-bar-width: 8px;
--nav-item-padding: ${this.navItemSpacing === 'relaxed' ? '10px 16px 10px 10px' : this.navItemSpacing === 'compact' ? '5px 16px 5px 10px' : '7px 16px 7px 10px'};
--resp-area-height: ${this.responseAreaHeight};
--font-size-small: ${this.fontSize === 'default' ? '12px' : this.fontSize === 'large' ? '13px' : '14px'};
--font-size-mono: ${this.fontSize === 'default' ? '13px' : this.fontSize === 'large' ? '14px' : '15px'};
--font-size-regular: ${this.fontSize === 'default' ? '14px' : this.fontSize === 'large' ? '15px' : '16px'};
--dialog-z-index: 1000;
--focus-shadow: 0 0 0 1px transparent, 0 0 0 3px ${newTheme.primaryColorTrans};
/* Theme specific styles */
--bg:${newTheme.bg1};
--bg2:${newTheme.bg2};
--bg3:${newTheme.bg3};
--light-bg:${newTheme.lightBg};
--fg:${newTheme.fg1};
--fg2:${newTheme.fg2};
--fg3:${newTheme.fg3};
--light-fg:${newTheme.lightFg};
--selection-bg:${newTheme.selectionBg};
--selection-fg:${newTheme.selectionFg};
--overlay-bg:${newTheme.overlayBg};
/* Border Colors */
--border-color:${newTheme.borderColor};
--light-border-color:${newTheme.lightBorderColor};
--code-border-color:${newTheme.codeBorderColor};
--input-bg:${newTheme.inputBg};
--placeholder-color:${newTheme.placeHolder};
--hover-color:${newTheme.hoverColor};
--red:${newTheme.red};
--light-red:${newTheme.lightRed};
--pink:${newTheme.pink};
--light-pink:${newTheme.lightPink};
--green:${newTheme.green};
--light-green:${newTheme.lightGreen};
--blue:${newTheme.blue};
--light-blue:${newTheme.lightBlue};
--orange:${newTheme.orange};
--light-orange:${newTheme.lightOrange};
--yellow:${newTheme.yellow};
--light-yellow:${newTheme.lightYellow};
--purple:${newTheme.purple};
--brown:${newTheme.brown};
/* Header Color */
--header-bg:${newTheme.headerColor};
--header-fg:${newTheme.headerColorInvert};
--header-color-darker:${newTheme.headerColorDarker};
--header-color-border:${newTheme.headerColorBorder};
/* Nav Colors */
--nav-bg-color:${newTheme.navBgColor};
--nav-text-color:${newTheme.navTextColor};
--nav-hover-bg-color:${newTheme.navHoverBgColor};
--nav-hover-text-color:${newTheme.navHoverTextColor};
--nav-accent-color:${newTheme.navAccentColor};
--nav-accent-text-color:${newTheme.navAccentTextColor};
/* Nav API Method Colors*/
--nav-get-color:${newTheme.blue};
--nav-put-color:${newTheme.orange};
--nav-post-color:${newTheme.green};
--nav-delete-color:${newTheme.red};
--nav-head-color:${newTheme.yellow};
/* Primary Colors */
--primary-color:${newTheme.primaryColor};
--primary-color-invert:${newTheme.primaryColorInvert};
--primary-color-trans:${newTheme.primaryColorTrans};
/*Code Syntax Color*/
--code-bg:${newTheme.codeBg};
--code-fg:${newTheme.codeFg};
--inline-code-fg:${newTheme.inlineCodeFg};
--code-property-color:${newTheme.codePropertyColor};
--code-keyword-color:${newTheme.codeKeywordColor};
--code-operator-color:${newTheme.codeOperatorColor};
}
</style>`;
}
;// CONCATENATED MODULE: ./src/templates/main-body-template.js
// Templates
function mainBodyTemplate(isMini = false, showExpandCollapse = true, showTags = true, pathsExpanded = false) {
if (!this.resolvedSpec) {
return '';
}
if (this.persistAuth === 'true') {
recoverPersistedApiKeys.call(this);
}
const newTheme = {
bg1: isValidHexColor(this.bgColor) ? this.bgColor : '',
fg1: isValidHexColor(this.textColor) ? this.textColor : '',
headerColor: isValidHexColor(this.headerColor) ? this.headerColor : '',
primaryColor: isValidHexColor(this.primaryColor) ? this.primaryColor : '',
navBgColor: isValidHexColor(this.navBgColor) ? this.navBgColor : '',
navTextColor: isValidHexColor(this.navTextColor) ? this.navTextColor : '',
navHoverBgColor: isValidHexColor(this.navHoverBgColor) ? this.navHoverBgColor : '',
navHoverTextColor: isValidHexColor(this.navHoverTextColor) ? this.navHoverTextColor : '',
navAccentColor: isValidHexColor(this.navAccentColor) ? this.navAccentColor : '',
navAccentTextColor: isValidHexColor(this.navAccentTextColor) ? this.navAccentTextColor : ''
};
/* eslint-disable indent */
if (this.resolvedSpec.specLoadError) {
if (isMini) {
return lit_html_x`
${this.theme === 'dark' ? setTheme.call(this, 'dark', newTheme) : setTheme.call(this, 'light', newTheme)}
<div style='display:flex; align-items:center; border:1px dashed var(--border-color); height:42px; padding:5px; font-size:var(--font-size-small); color:var(--red); font-family:var(--font-mono)'> ${this.resolvedSpec.info.description} </div>
`;
}
return lit_html_x`
${this.theme === 'dark' ? setTheme.call(this, 'dark', newTheme) : setTheme.call(this, 'light', newTheme)}
<!-- Header -->
${headerTemplate.call(this)}
<main class='main-content regular-font' part='section-main-content'>
<slot></slot>
<div style='margin:24px; text-align: center;'>
<h1 style='color: var(--red)'> ${this.resolvedSpec.info.title} </h1>
<div style='font-family:var(--font-mono)'> ${this.resolvedSpec.info.description} </div>
</div>
</main>
`;
}
if (this.resolvedSpec.isSpecLoading) {
return lit_html_x`
${this.theme === 'dark' ? setTheme.call(this, 'dark', newTheme) : setTheme.call(this, 'light', newTheme)}
<main class='main-content regular-font' part='section-main-content'>
<slot></slot>
<div class='main-content-inner--${this.renderStyle}-mode'>
<div class='loader'></div>
</div>
</main>
`;
}
return lit_html_x`
${this.theme === 'dark' ? setTheme.call(this, 'dark', newTheme) : setTheme.call(this, 'light', newTheme)}
<!-- Header -->
${this.showHeader === 'false' ? '' : headerTemplate.call(this)}
<!-- Advanced Search -->
${this.allowAdvancedSearch === 'false' ? '' : searchByPropertiesModalTemplate.call(this)}
<div id='the-main-body' class='body ${this.cssClasses}' dir='${this.pageDirection}' >
<!-- Side Nav -->
${(this.renderStyle === 'read' || this.renderStyle === 'focused') && this.showSideNav === 'true' && this.resolvedSpec ? navbarTemplate.call(this) : ''}
<!-- Main Content -->
<main class='main-content regular-font' tabindex='-1' part='section-main-content'>
<slot></slot>
<div class='main-content-inner--${this.renderStyle}-mode'>
${this.loading === true ? lit_html_x`<div class='loader'></div>` : lit_html_x`
${this.loadFailed === true ? lit_html_x`<div style='text-align: center;margin: 16px;'> Unable to load the Spec</div>` : lit_html_x`
<div class='operations-root' @click='${e => {
this.handleHref(e);
}}'>
${this.renderStyle === 'focused' ? lit_html_x`${focusedEndpointTemplate.call(this)}` : lit_html_x`
${this.showInfo === 'true' ? overviewTemplate.call(this) : ''}
${this.allowServerSelection === 'true' ? serverTemplate.call(this) : ''}
${this.allowAuthentication === 'true' ? securitySchemeTemplate.call(this) : ''}
<div id='operations-top' class='observe-me'>
<slot name='operations-top'></slot>
</div>
${this.renderStyle === 'read' ? expandedEndpointTemplate.call(this) : endpointTemplate.call(this, showExpandCollapse, showTags, pathsExpanded)}
`}
</div>
`}`}
</div>
<slot name='footer'></slot>
</main>
</div>
`;
}
/* eslint-enable indent */
;// CONCATENATED MODULE: ./src/rapidoc.js
// Styles
// import { expandCollapseNavBarTag } from '@/templates/navbar-template';
class RapiDoc extends lit_element_s {
constructor() {
super();
const intersectionObserverOptions = {
root: this.getRootNode().host,
rootMargin: '-50px 0px -50px 0px',
// when the element is visible 100px from bottom
threshold: 0
};
this.showSummaryWhenCollapsed = true;
// Will activate intersection observer only after spec load and hash analyze
// to scroll to the proper element without being reverted by observer behavior
this.isIntersectionObserverActive = false;
this.intersectionObserver = new IntersectionObserver(entries => {
this.onIntersect(entries);
}, intersectionObserverOptions);
}
static get properties() {
return {
// Heading
headingText: {
type: String,
attribute: 'heading-text'
},
gotoPath: {
type: String,
attribute: 'goto-path'
},
// Spec
updateRoute: {
type: String,
attribute: 'update-route'
},
routePrefix: {
type: String,
attribute: 'route-prefix'
},
specUrl: {
type: String,
attribute: 'spec-url'
},
sortTags: {
type: String,
attribute: 'sort-tags'
},
generateMissingTags: {
type: String,
attribute: 'generate-missing-tags'
},
sortEndpointsBy: {
type: String,
attribute: 'sort-endpoints-by'
},
specFile: {
type: String,
attribute: false
},
// UI Layouts
layout: {
type: String
},
renderStyle: {
type: String,
attribute: 'render-style'
},
defaultSchemaTab: {
type: String,
attribute: 'default-schema-tab'
},
responseAreaHeight: {
type: String,
attribute: 'response-area-height'
},
fillRequestFieldsWithExample: {
type: String,
attribute: 'fill-request-fields-with-example'
},
persistAuth: {
type: String,
attribute: 'persist-auth'
},
onNavTagClick: {
type: String,
attribute: 'on-nav-tag-click'
},
// Schema Styles
schemaStyle: {
type: String,
attribute: 'schema-style'
},
schemaExpandLevel: {
type: Number,
attribute: 'schema-expand-level'
},
schemaDescriptionExpanded: {
type: String,
attribute: 'schema-description-expanded'
},
schemaHideReadOnly: {
type: String,
attribute: 'schema-hide-read-only'
},
schemaHideWriteOnly: {
type: String,
attribute: 'schema-hide-write-only'
},
// API Server
apiKeyName: {
type: String,
attribute: 'api-key-name'
},
apiKeyLocation: {
type: String,
attribute: 'api-key-location'
},
apiKeyValue: {
type: String,
attribute: 'api-key-value'
},
defaultApiServerUrl: {
type: String,
attribute: 'default-api-server'
},
serverUrl: {
type: String,
attribute: 'server-url'
},
oauthReceiver: {
type: String,
attribute: 'oauth-receiver'
},
// Hide/Show Sections & Enable Disable actions
showHeader: {
type: String,
attribute: 'show-header'
},
showSideNav: {
type: String,
attribute: 'show-side-nav'
},
showInfo: {
type: String,
attribute: 'show-info'
},
allowAuthentication: {
type: String,
attribute: 'allow-authentication'
},
allowTry: {
type: String,
attribute: 'allow-try'
},
showCurlBeforeTry: {
type: String,
attribute: 'show-curl-before-try'
},
allowSpecUrlLoad: {
type: String,
attribute: 'allow-spec-url-load'
},
allowSpecFileLoad: {
type: String,
attribute: 'allow-spec-file-load'
},
allowSpecFileDownload: {
type: String,
attribute: 'allow-spec-file-download'
},
allowSearch: {
type: String,
attribute: 'allow-search'
},
allowAdvancedSearch: {
type: String,
attribute: 'allow-advanced-search'
},
allowServerSelection: {
type: String,
attribute: 'allow-server-selection'
},
allowSchemaDescriptionExpandToggle: {
type: String,
attribute: 'allow-schema-description-expand-toggle'
},
showComponents: {
type: String,
attribute: 'show-components'
},
pageDirection: {
type: String,
attribute: 'page-direction'
},
// Main Colors and Font
theme: {
type: String
},
bgColor: {
type: String,
attribute: 'bg-color'
},
textColor: {
type: String,
attribute: 'text-color'
},
headerColor: {
type: String,
attribute: 'header-color'
},
primaryColor: {
type: String,
attribute: 'primary-color'
},
fontSize: {
type: String,
attribute: 'font-size'
},
regularFont: {
type: String,
attribute: 'regular-font'
},
monoFont: {
type: String,
attribute: 'mono-font'
},
loadFonts: {
type: String,
attribute: 'load-fonts'
},
cssFile: {
type: String,
attribute: 'css-file'
},
cssClasses: {
type: String,
attribute: 'css-classes'
},
// Nav Bar Colors
navBgColor: {
type: String,
attribute: 'nav-bg-color'
},
navTextColor: {
type: String,
attribute: 'nav-text-color'
},
navHoverBgColor: {
type: String,
attribute: 'nav-hover-bg-color'
},
navHoverTextColor: {
type: String,
attribute: 'nav-hover-text-color'
},
navAccentColor: {
type: String,
attribute: 'nav-accent-color'
},
navAccentTextColor: {
type: String,
attribute: 'nav-accent-text-color'
},
navActiveItemMarker: {
type: String,
attribute: 'nav-active-item-marker'
},
navItemSpacing: {
type: String,
attribute: 'nav-item-spacing'
},
showMethodInNavBar: {
type: String,
attribute: 'show-method-in-nav-bar'
},
usePathInNavBar: {
type: String,
attribute: 'use-path-in-nav-bar'
},
infoDescriptionHeadingsInNavBar: {
type: String,
attribute: 'info-description-headings-in-navbar'
},
// Fetch Options
fetchCredentials: {
type: String,
attribute: 'fetch-credentials'
},
// Filters
matchPaths: {
type: String,
attribute: 'match-paths'
},
matchType: {
type: String,
attribute: 'match-type'
},
// Internal Properties
loading: {
type: Boolean
},
// indicates spec is being loaded
focusedElementId: {
type: String
},
// updating the focusedElementId will automatically render appropriate section in focused mode
showAdvancedSearchDialog: {
type: Boolean
},
advancedSearchMatches: {
type: Object
}
};
}
static get styles() {
return [font_styles, input_styles, flex_styles, table_styles, endpoint_styles, prism_styles, tab_styles, nav_styles, info_styles, i`
:host {
display:flex;
flex-direction: column;
min-width:360px;
width:100%;
height:100%;
margin:0;
padding:0;
overflow: hidden;
letter-spacing:normal;
color:var(--fg);
background-color:var(--bg);
font-family:var(--font-regular);
}
:where(button, input[type="checkbox"], [tabindex="0"]):focus-visible { box-shadow: var(--focus-shadow); }
:where(input[type="text"], input[type="password"], select, textarea):focus-visible { border-color: var(--primary-color); }
.body {
display:flex;
height:100%;
width:100%;
overflow:hidden;
}
.main-content {
margin:0;
padding: 0;
display:block;
flex:1;
height:100%;
overflow-y: auto;
overflow-x: hidden;
scrollbar-width: thin;
scrollbar-color: var(--border-color) transparent;
}
.main-content-inner--view-mode {
padding: 0 8px;
}
.main-content::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.main-content::-webkit-scrollbar-track {
background:transparent;
}
.main-content::-webkit-scrollbar-thumb {
background-color: var(--border-color);
}
.section-gap.section-tag {
border-bottom:1px solid var(--border-color);
}
.section-gap,
.section-gap--focused-mode,
.section-gap--read-mode {
padding: 0px 4px;
}
.section-tag-header {
position:relative;
cursor: n-resize;
padding: 12px 0;
}
.collapsed .section-tag-header:hover{
cursor: s-resize;
}
.section-tag-header:hover{
background-image: linear-gradient(to right, rgba(0,0,0,0), var(--border-color), rgba(0,0,0,0));
}
.section-tag-header:hover::after {
position:absolute;
margin-left:-24px;
font-size:20px;
top: calc(50% - 14px);
color:var(--primary-color);
content: '⬆';
}
.collapsed .section-tag-header::after {
position:absolute;
margin-left:-24px;
font-size:20px;
top: calc(50% - 14px);
color: var(--border-color);
content: '⬇';
}
.collapsed .section-tag-header:hover::after {
color:var(--primary-color);
}
.collapsed .section-tag-body {
display:none;
}
.logo {
height:36px;
width:36px;
margin-left:5px;
}
.only-large-screen-flex,
.only-large-screen{
display:none;
}
.tag.title {
text-transform: uppercase;
}
.main-header {
background-color:var(--header-bg);
color:var(--header-fg);
width:100%;
}
.header-title {
font-size:calc(var(--font-size-regular) + 8px);
padding:0 8px;
}
input.header-input{
background:var(--header-color-darker);
color:var(--header-fg);
border:1px solid var(--header-color-border);
flex:1;
padding-right:24px;
border-radius:3px;
}
input.header-input::placeholder {
opacity:0.4;
}
.loader {
margin: 16px auto 16px auto;
border: 4px solid var(--bg3);
border-radius: 50%;
border-top: 4px solid var(--primary-color);
width: 36px;
height: 36px;
animation: spin 2s linear infinite;
}
.expanded-endpoint-body {
position: relative;
padding: 6px 0px;
}
.expanded-endpoint-body .tag-description {
background: var(--code-bg);
border-radius: var(--border-radius);
transition: max-height .2s ease-out;
}
.expanded-endpoint-body .tag-icon {
transition: transform .2s ease-out;
}
.expanded-endpoint-body .tag-icon.expanded {
transform: rotate(180deg);
}
.divider {
border-top: 2px solid var(--border-color);
margin: 24px 0;
width:100%;
}
.tooltip {
cursor:pointer;
border: 1px solid var(--border-color);
border-left-width: 4px;
margin-left:2px;
}
.tooltip a {
color: var(--fg2);
text-decoration: none;
}
.tooltip-text {
color: var(--fg2);
max-width: 400px;
position: absolute;
z-index:1;
background-color: var(--bg2);
visibility: hidden;
overflow-wrap: break-word;
}
.tooltip:hover {
color: var(--primary-color);
border-color: var(--primary-color);
}
.tooltip:hover a:hover {
color: var(--primary-color);
}
.tooltip:hover .tooltip-text {
visibility: visible;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.nav-method { font-weight: bold; margin-right: 4px; font-size: calc(var(--font-size-small) - 2px); white-space: nowrap; }
.nav-method.false { display: none; }
.nav-method.as-colored-text.get { color:var(--nav-get-color); }
.nav-method.as-colored-text.put { color:var(--nav-put-color); }
.nav-method.as-colored-text.post { color:var(--nav-post-color); }
.nav-method.as-colored-text.delete { color:var(--nav-delete-color); }
.nav-method.as-colored-text.head, .nav-method.as-colored-text.patch, .nav-method.as-colored-text.options { color:var(--nav-head-color); }
.nav-method.as-colored-block {
padding: 1px 4px;
min-width: 30px;
border-radius: 4px 0 0 4px;
color: #000;
}
.colored-block .nav-method.as-colored-block {
outline: 1px solid;
}
.nav-method.as-colored-block.get { background-color: var(--blue); }
.nav-method.as-colored-block.put { background-color: var(--orange); }
.nav-method.as-colored-block.post { background-color: var(--green); }
.nav-method.as-colored-block.delete { background-color: var(--red); }
.nav-method.as-colored-block.head, .nav-method.as-colored-block.patch , .nav-method.as-colored-block.options {
background-color: var(--yellow);
}
@media only screen and (min-width: 768px) {
.nav-bar {
width: 260px;
display:flex;
}
.only-large-screen{
display:block;
}
.only-large-screen-flex{
display:flex;
}
.section-gap {
padding: 0 0 0 24px;
}
.section-gap--focused-mode {
padding: 24px 8px;
}
.section-gap--read-mode {
padding: 24px 8px;
}
.endpoint-body {
position: relative;
padding:36px 0 48px 0;
}
}
@media only screen and (min-width: 1024px) {
.nav-bar {
width: ${r(this.fontSize === 'default' ? '300px' : this.fontSize === 'large' ? '315px' : '330px')};
display:flex;
}
.section-gap--focused-mode {
padding: 12px 80px 12px 80px;
}
.section-gap--read-mode {
padding: 24px 80px 12px 80px;
}
}`, custom_styles];
}
// Startup
connectedCallback() {
super.connectedCallback();
const parent = this.parentElement;
if (parent) {
if (parent.offsetWidth === 0 && parent.style.width === '') {
parent.style.width = '100vw';
}
if (parent.offsetHeight === 0 && parent.style.height === '') {
parent.style.height = '100vh';
}
if (parent.tagName === 'BODY') {
if (!parent.style.marginTop) {
parent.style.marginTop = '0';
}
if (!parent.style.marginRight) {
parent.style.marginRight = '0';
}
if (!parent.style.marginBottom) {
parent.style.marginBottom = '0';
}
if (!parent.style.marginLeft) {
parent.style.marginLeft = '0';
}
}
}
if (this.loadFonts !== 'false') {
const fontDescriptor = {
family: 'Open Sans',
style: 'normal',
weight: '300',
unicodeRange: 'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD'
};
const fontWeight300 = new FontFace('Open Sans', "url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')", fontDescriptor);
fontDescriptor.weight = '600';
const fontWeight600 = new FontFace('Open Sans', "url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')", fontDescriptor);
fontWeight300.load().then(font => {
document.fonts.add(font);
});
fontWeight600.load().then(font => {
document.fonts.add(font);
});
}
if (!this.layout || !'row, column,'.includes(`${this.layout},`)) {
this.layout = 'row';
}
if (!this.renderStyle || !'read, view, focused,'.includes(`${this.renderStyle},`)) {
this.renderStyle = 'focused';
}
if (!this.schemaStyle || !'tree, table,'.includes(`${this.schemaStyle},`)) {
this.schemaStyle = 'tree';
}
if (!this.theme || !'light, dark,'.includes(`${this.theme},`)) {
this.theme = window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
}
if (!this.defaultSchemaTab || !'example, schema, model,'.includes(`${this.defaultSchemaTab},`)) {
this.defaultSchemaTab = 'example';
} else if (this.defaultSchemaTab === 'model') {
this.defaultSchemaTab = 'schema';
}
if (!this.schemaExpandLevel || this.schemaExpandLevel < 1) {
this.schemaExpandLevel = 99999;
}
if (!this.schemaDescriptionExpanded || !'true, false,'.includes(`${this.schemaDescriptionExpanded},`)) {
this.schemaDescriptionExpanded = 'false';
}
if (!this.schemaHideReadOnly || !'default, never,'.includes(`${this.schemaHideReadOnly},`)) {
this.schemaHideReadOnly = 'default';
}
if (!this.schemaHideWriteOnly || !'default, never,'.includes(`${this.schemaHideWriteOnly},`)) {
this.schemaHideWriteOnly = 'default';
}
if (!this.fillRequestFieldsWithExample || !'true, false,'.includes(`${this.fillRequestFieldsWithExample},`)) {
this.fillRequestFieldsWithExample = 'true';
}
if (!this.persistAuth || !'true, false,'.includes(`${this.persistAuth},`)) {
this.persistAuth = 'false';
}
if (!this.responseAreaHeight) {
this.responseAreaHeight = '400px';
}
if (!this.allowSearch || !'true, false,'.includes(`${this.allowSearch},`)) {
this.allowSearch = 'true';
}
if (!this.allowAdvancedSearch || !'true, false,'.includes(`${this.allowAdvancedSearch},`)) {
this.allowAdvancedSearch = 'true';
}
if (!this.allowTry || !'true, false,'.includes(`${this.allowTry},`)) {
this.allowTry = 'true';
}
if (!this.apiKeyValue) {
this.apiKeyValue = '-';
}
if (!this.apiKeyLocation) {
this.apiKeyLocation = 'header';
}
if (!this.apiKeyName) {
this.apiKeyName = '';
}
if (!this.oauthReceiver) {
this.oauthReceiver = 'oauth-receiver.html';
}
if (!this.updateRoute || !'true, false,'.includes(`${this.updateRoute},`)) {
this.updateRoute = 'true';
}
if (!this.routePrefix) {
this.routePrefix = '#';
}
if (!this.sortTags || !'true, false,'.includes(`${this.sortTags},`)) {
this.sortTags = 'false';
}
if (!this.generateMissingTags || !'true, false,'.includes(`${this.generateMissingTags},`)) {
this.generateMissingTags = 'false';
}
if (!this.sortEndpointsBy || !'method, path, summary, none,'.includes(`${this.sortEndpointsBy},`)) {
this.sortEndpointsBy = 'path';
}
if (!this.onNavTagClick || !'expand-collapse, show-description,'.includes(`${this.onNavTagClick},`)) {
this.onNavTagClick = 'expand-collapse';
}
if (!this.navItemSpacing || !'compact, relaxed, default,'.includes(`${this.navItemSpacing},`)) {
this.navItemSpacing = 'default';
}
if (!this.showMethodInNavBar || !'false, as-plain-text, as-colored-text, as-colored-block,'.includes(`${this.showMethodInNavBar},`)) {
this.showMethodInNavBar = 'false';
}
if (!this.usePathInNavBar || !'true, false,'.includes(`${this.usePathInNavBar},`)) {
this.usePathInNavBar = 'false';
}
if (!this.navActiveItemMarker || !'left-bar, colored-block'.includes(`${this.navActiveItemMarker},`)) {
this.navActiveItemMarker = 'left-bar';
}
if (!this.fontSize || !'default, large, largest,'.includes(`${this.fontSize},`)) {
this.fontSize = 'default';
}
if (!this.showInfo || !'true, false,'.includes(`${this.showInfo},`)) {
this.showInfo = 'true';
}
if (!this.allowServerSelection || !'true, false,'.includes(`${this.allowServerSelection},`)) {
this.allowServerSelection = 'true';
}
if (!this.allowAuthentication || !'true, false,'.includes(`${this.allowAuthentication},`)) {
this.allowAuthentication = 'true';
}
if (!this.allowSchemaDescriptionExpandToggle || !'true, false,'.includes(`${this.allowSchemaDescriptionExpandToggle},`)) {
this.allowSchemaDescriptionExpandToggle = 'true';
}
if (!this.showSideNav || !'true false'.includes(this.showSideNav)) {
this.showSideNav = 'true';
}
if (!this.showComponents || !'true false'.includes(this.showComponents)) {
this.showComponents = 'false';
}
if (!this.infoDescriptionHeadingsInNavBar || !'true, false,'.includes(`${this.infoDescriptionHeadingsInNavBar},`)) {
this.infoDescriptionHeadingsInNavBar = 'false';
}
if (!this.fetchCredentials || !'omit, same-origin, include,'.includes(`${this.fetchCredentials},`)) {
this.fetchCredentials = '';
}
if (!this.matchType || !'includes regex'.includes(this.matchType)) {
this.matchType = 'includes';
}
if (!this.showAdvancedSearchDialog) {
this.showAdvancedSearchDialog = false;
}
if (!this.cssFile) {
this.cssFile = null;
}
if (!this.cssClasses) {
this.cssClasses = '';
}
marked.setOptions({
highlight: (code, lang) => {
if ((prism_default()).languages[lang]) {
return prism_default().highlight(code, (prism_default()).languages[lang], lang);
}
return code;
}
});
window.addEventListener('hashchange', () => {
this.scrollToPath(this.getElementIDFromURL());
}, true);
}
// Cleanup
disconnectedCallback() {
if (this.intersectionObserver) {
this.intersectionObserver.disconnect();
}
super.disconnectedCallback();
}
infoDescriptionHeadingRenderer() {
const renderer = new marked.Renderer();
renderer.heading = (text, level, raw, slugger) => `<h${level} class="observe-me" id="${slugger.slug(raw)}">${text}</h${level}>`;
return renderer;
}
render() {
// return render(mainBodyTemplate(this), this.shadowRoot, { eventContext: this });
const cssLinkEl = document.querySelector(`link[href*="${this.cssFile}"]`);
// adding custom style for RapiDoc
if (cssLinkEl) {
this.shadowRoot.appendChild(cssLinkEl.cloneNode());
}
return mainBodyTemplate.call(this);
}
observeExpandedContent() {
// Main Container
const observeOverviewEls = this.shadowRoot.querySelectorAll('.observe-me');
observeOverviewEls.forEach(targetEl => {
this.intersectionObserver.observe(targetEl);
});
}
attributeChangedCallback(name, oldVal, newVal) {
if (name === 'spec-url') {
if (oldVal !== newVal) {
// put it at the end of event-loop to load all the attributes
window.setTimeout(async () => {
await this.loadSpec(newVal);
// If goto-path is provided and no location-hash is present then try to scroll there
if (this.gotoPath && !window.location.hash) {
this.scrollToPath(this.gotoPath);
}
}, 0);
}
}
if (name === 'render-style') {
if (newVal === 'read') {
window.setTimeout(() => {
this.observeExpandedContent();
}, 100);
} else {
this.intersectionObserver.disconnect();
}
}
if (name === 'api-key-name' || name === 'api-key-location' || name === 'api-key-value') {
let updateSelectedApiKey = false;
let apiKeyName = '';
let apiKeyLocation = '';
let apiKeyValue = '';
if (name === 'api-key-name') {
if (this.getAttribute('api-key-location') && this.getAttribute('api-key-value')) {
apiKeyName = newVal;
apiKeyLocation = this.getAttribute('api-key-location');
apiKeyValue = this.getAttribute('api-key-value');
updateSelectedApiKey = true;
}
} else if (name === 'api-key-location') {
if (this.getAttribute('api-key-name') && this.getAttribute('api-key-value')) {
apiKeyLocation = newVal;
apiKeyName = this.getAttribute('api-key-name');
apiKeyValue = this.getAttribute('api-key-value');
updateSelectedApiKey = true;
}
} else if (name === 'api-key-value') {
if (this.getAttribute('api-key-name') && this.getAttribute('api-key-location')) {
apiKeyValue = newVal;
apiKeyLocation = this.getAttribute('api-key-location');
apiKeyName = this.getAttribute('api-key-name');
updateSelectedApiKey = true;
}
}
if (updateSelectedApiKey) {
if (this.resolvedSpec) {
const rapiDocApiKey = this.resolvedSpec.securitySchemes.find(v => v.securitySchemeId === rapidocApiKey);
if (!rapiDocApiKey) {
this.resolvedSpec.securitySchemes.push({
securitySchemeId: rapidocApiKey,
description: 'api-key provided in rapidoc element attributes',
type: 'apiKey',
name: apiKeyName,
in: apiKeyLocation,
value: apiKeyValue,
finalKeyValue: apiKeyValue
});
} else {
rapiDocApiKey.name = apiKeyName;
rapiDocApiKey.in = apiKeyLocation;
rapiDocApiKey.value = apiKeyValue;
rapiDocApiKey.finalKeyValue = apiKeyValue;
}
this.requestUpdate();
}
}
}
super.attributeChangedCallback(name, oldVal, newVal);
}
onSpecUrlChange() {
this.setAttribute('spec-url', this.shadowRoot.getElementById('spec-url').value);
}
onSpecFileChange(e) {
this.setAttribute('spec-file', this.shadowRoot.getElementById('spec-file').value);
const specFile = e.target.files[0];
const reader = new FileReader();
reader.onload = () => {
try {
const specObj = JSON.parse(reader.result);
this.loadSpec(specObj);
this.shadowRoot.getElementById('spec-url').value = '';
} catch (err) {
console.error('RapiDoc: Unable to read or parse json'); // eslint-disable-line no-console
}
};
// Read the Text file
reader.readAsText(specFile);
}
onFileLoadClick() {
this.shadowRoot.getElementById('spec-file').click();
}
onSearchChange(e) {
this.matchPaths = e.target.value;
this.resolvedSpec.tags.forEach(tag => tag.paths.filter(v => {
if (this.matchPaths) {
// v.expanded = false;
if (pathIsInSearch(this.matchPaths, v, this.matchType)) {
tag.expanded = true;
}
}
}));
this.resolvedSpec.components.forEach(component => component.subComponents.filter(v => {
v.expanded = false;
if (!this.matchPaths || componentIsInSearch(this.matchPaths, v)) {
v.expanded = true;
}
}));
this.requestUpdate();
}
onClearSearch() {
const searchEl = this.shadowRoot.getElementById('nav-bar-search');
searchEl.value = '';
this.matchPaths = '';
this.resolvedSpec.components.forEach(component => component.subComponents.filter(v => {
v.expanded = true;
}));
}
onShowSearchModalClicked() {
this.showAdvancedSearchDialog = true;
}
// Event Handler on Dialog-Box is opened
async onOpenSearchDialog(e) {
// Set focus to text input
const inputEl = e.detail.querySelector('input');
await sleep(0);
if (inputEl) {
inputEl.focus();
}
}
// Public Method
async loadSpec(specUrl) {
if (!specUrl) {
return;
}
this.matchPaths = '';
try {
this.resolvedSpec = {
specLoadError: false,
isSpecLoading: true,
tags: []
};
this.loading = true;
this.loadFailed = false;
const spec = await ProcessSpec.call(this, specUrl, this.generateMissingTags === 'true', this.sortTags === 'true', this.getAttribute('sort-endpoints-by'), this.getAttribute('api-key-name'), this.getAttribute('api-key-location'), this.getAttribute('api-key-value'), this.getAttribute('server-url'));
this.loading = false;
this.afterSpecParsedAndValidated(spec);
} catch (err) {
this.loading = false;
this.loadFailed = true;
this.resolvedSpec = null;
console.error(`RapiDoc: Unable to resolve the API spec.. ${err.message}`); // eslint-disable-line no-console
}
}
async afterSpecParsedAndValidated(spec) {
this.resolvedSpec = spec;
this.selectedServer = undefined;
if (this.defaultApiServerUrl) {
if (this.defaultApiServerUrl === this.serverUrl) {
this.selectedServer = {
url: this.serverUrl,
computedUrl: this.serverUrl
};
} else if (this.resolvedSpec.servers) {
this.selectedServer = this.resolvedSpec.servers.find(v => v.url === this.defaultApiServerUrl);
}
}
if (!this.selectedServer) {
if (this.resolvedSpec.servers) {
this.selectedServer = this.resolvedSpec.servers[0]; // eslint-disable-line prefer-destructuring
}
}
this.requestUpdate();
// eslint-disable-next-line no-await-in-loop
while (!(await this.updateComplete));
const specLoadedEvent = new CustomEvent('spec-loaded', {
detail: spec
});
this.dispatchEvent(specLoadedEvent);
// Initiate IntersectionObserver and put it at the end of event loop, to allow loading all the child elements (must for larger specs)
this.intersectionObserver.disconnect();
if (this.renderStyle === 'read') {
await sleep(100);
this.observeExpandedContent(); // This will auto-highlight the selected nav-item in read-mode
}
this.isIntersectionObserverActive = true;
// On first time Spec load, try to navigate to location hash if provided
const elementId = this.getElementIDFromURL();
if (elementId) {
if (this.renderStyle === 'view') {
this.expandAndGotoOperation(elementId, true, true);
} else {
this.scrollToPath(elementId);
}
} else if (this.renderStyle === 'focused') {
// If goto-path is provided and no location-hash is present then try to scroll to default element
if (!this.gotoPath) {
var _this$resolvedSpec$ta;
const defaultElementId = this.showInfo ? 'overview' : (_this$resolvedSpec$ta = this.resolvedSpec.tags[0]) === null || _this$resolvedSpec$ta === void 0 ? void 0 : _this$resolvedSpec$ta.paths[0];
this.scrollToPath(defaultElementId);
}
}
}
/**
* Return the URL from where is served the RapiDoc component, removing any hash and route prefix
*/
getComponentBaseURL() {
const {
href
} = window.location;
// Remove end of string # or /
const cleanRouterPrefix = this.routePrefix.replace(/(#|\/)$/, '');
if (!cleanRouterPrefix) {
return href.split('#')[0];
}
const indexOfRoutePrefix = href.lastIndexOf(cleanRouterPrefix);
if (indexOfRoutePrefix === -1) {
return href;
}
return href.slice(0, indexOfRoutePrefix);
}
/**
* From the URL return the ID of the element whether it is in the hash or if used a router prefix without a hash
*/
getElementIDFromURL() {
const baseURL = this.getComponentBaseURL();
const elementId = window.location.href.replace(baseURL + this.routePrefix, '');
return elementId;
}
replaceHistoryState(hashId) {
const baseURL = this.getComponentBaseURL();
window.history.replaceState(null, null, `${baseURL}${this.routePrefix || '#'}${hashId}`);
}
expandAndGotoOperation(elementId, scrollToElement = true) {
if (!this.resolvedSpec) {
return;
}
// Expand full operation and tag
let isExpandingNeeded = true;
const tmpElementId = elementId.indexOf('#') === -1 ? elementId : elementId.substring(1);
if (tmpElementId.startsWith('overview') || tmpElementId === 'servers' || tmpElementId === 'auth') {
isExpandingNeeded = false;
} else {
for (let i = 0; i < ((_this$resolvedSpec$ta2 = this.resolvedSpec.tags) === null || _this$resolvedSpec$ta2 === void 0 ? void 0 : _this$resolvedSpec$ta2.length); i++) {
var _this$resolvedSpec$ta2, _tag$paths;
const tag = this.resolvedSpec.tags[i];
const path = (_tag$paths = tag.paths) === null || _tag$paths === void 0 ? void 0 : _tag$paths.find(p => p.elementId === elementId);
if (path) {
if (path.expanded && tag.expanded) {
isExpandingNeeded = false;
} else {
path.expanded = true;
tag.expanded = true;
}
}
}
}
if (scrollToElement) {
// requestUpdate() and delay required, else we cant find element
if (isExpandingNeeded) {
this.requestUpdate();
}
window.setTimeout(() => {
const gotoEl = this.shadowRoot.getElementById(tmpElementId);
if (gotoEl) {
gotoEl.scrollIntoView({
behavior: 'auto',
block: 'start'
});
if (this.updateRoute === 'true') {
this.replaceHistoryState(tmpElementId);
}
}
}, isExpandingNeeded ? 150 : 0);
}
}
isValidTopId(id) {
return id.startsWith('overview') || id === 'servers' || id === 'auth';
}
isValidPathId(id) {
var _this$resolvedSpec2, _this$resolvedSpec2$t;
if (id === 'overview' && this.showInfo) {
return true;
}
if (id === 'servers' && this.allowServerSelection) {
return true;
}
if (id === 'auth' && this.allowAuthentication) {
return true;
}
if (id.startsWith('tag--')) {
var _this$resolvedSpec, _this$resolvedSpec$ta3;
return (_this$resolvedSpec = this.resolvedSpec) === null || _this$resolvedSpec === void 0 ? void 0 : (_this$resolvedSpec$ta3 = _this$resolvedSpec.tags) === null || _this$resolvedSpec$ta3 === void 0 ? void 0 : _this$resolvedSpec$ta3.find(tag => tag.elementId === id);
}
return (_this$resolvedSpec2 = this.resolvedSpec) === null || _this$resolvedSpec2 === void 0 ? void 0 : (_this$resolvedSpec2$t = _this$resolvedSpec2.tags) === null || _this$resolvedSpec2$t === void 0 ? void 0 : _this$resolvedSpec2$t.find(tag => tag.paths.find(path => path.elementId === id));
}
onIntersect(entries) {
if (this.isIntersectionObserverActive === false) {
return;
}
entries.forEach(entry => {
if (entry.isIntersecting && entry.intersectionRatio > 0) {
const oldNavEl = this.shadowRoot.querySelector('.nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active');
const newNavEl = this.shadowRoot.getElementById(`link-${entry.target.id}`);
// Add active class in the new element
if (newNavEl) {
if (this.updateRoute === 'true') {
this.replaceHistoryState(entry.target.id);
}
newNavEl.scrollIntoView({
behavior: 'auto',
block: 'center'
});
newNavEl.classList.add('active');
newNavEl.part.add('section-navbar-active-item');
}
// Remove active class from previous element
// if it is different from the new one (edge case on loading in read render style)
if (oldNavEl && oldNavEl !== newNavEl) {
oldNavEl.classList.remove('active');
oldNavEl.part.remove('section-navbar-active-item');
}
}
});
}
// Called by anchor tags created using markdown
handleHref(e) {
if (e.target.tagName.toLowerCase() === 'a') {
if (e.target.getAttribute('href').startsWith('#')) {
const gotoEl = this.shadowRoot.getElementById(e.target.getAttribute('href').replace('#', ''));
if (gotoEl) {
gotoEl.scrollIntoView({
behavior: 'auto',
block: 'start'
});
}
}
}
}
/**
* Called by
* - onClick of Navigation Bar
* - onClick of Advanced Search items
*
* Functionality:
* 1. First deactivate IntersectionObserver
* 2. Scroll to the element
* 3. Activate IntersectionObserver (after little delay)
*
*/
async scrollToEventTarget(event, scrollNavItemToView = true) {
if (!(event.type === 'click' || event.type === 'keyup' && event.keyCode === 13)) {
return;
}
const navEl = event.target;
if (!navEl.dataset.contentId) {
return;
}
this.isIntersectionObserverActive = false;
if (this.renderStyle === 'focused') {
const requestEl = this.shadowRoot.querySelector('api-request');
if (requestEl) {
requestEl.beforeNavigationFocusedMode();
}
}
this.scrollToPath(navEl.dataset.contentId, true, scrollNavItemToView);
setTimeout(() => {
this.isIntersectionObserverActive = true;
}, 300);
}
// Public Method (scrolls to a given path and highlights the left-nav selection)
async scrollToPath(elementId, expandPath = true, scrollNavItemToView = true) {
if (this.renderStyle === 'focused') {
// for focused mode update this.focusedElementId to update the rendering, else it wont find the needed html elements
// focusedElementId will get validated in the template
this.focusedElementId = elementId;
await sleep(0);
}
if (this.renderStyle === 'view') {
this.expandAndGotoOperation(elementId, expandPath, true);
} else {
let isValidElementId = false;
const contentEl = this.shadowRoot.getElementById(elementId);
if (contentEl) {
isValidElementId = true;
contentEl.scrollIntoView({
behavior: 'auto',
block: 'start'
});
} else {
isValidElementId = false;
}
if (isValidElementId) {
// for focused style it is important to reset request-body-selection and response selection which maintains the state for in case of multiple req-body or multiple response mime-type
if (this.renderStyle === 'focused') {
const requestEl = this.shadowRoot.querySelector('api-request');
if (requestEl) {
requestEl.afterNavigationFocusedMode();
}
const responseEl = this.shadowRoot.querySelector('api-response');
if (responseEl) {
responseEl.resetSelection();
}
}
// Update Location Hash
if (this.updateRoute === 'true') {
this.replaceHistoryState(elementId);
}
// Update NavBar View and Styles
const newNavEl = this.shadowRoot.getElementById(`link-${elementId}`);
if (newNavEl) {
if (scrollNavItemToView) {
newNavEl.scrollIntoView({
behavior: 'auto',
block: 'center'
});
}
await sleep(0);
const oldNavEl = this.shadowRoot.querySelector('.nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active');
if (oldNavEl) {
oldNavEl.classList.remove('active');
oldNavEl.part.remove('active');
oldNavEl.part.remove('section-navbar-active-item');
}
newNavEl.classList.add('active'); // must add the class after scrolling
newNavEl.part.add('section-navbar-active-item');
// this.requestUpdate();
}
}
}
}
// Public Method - to update security-scheme of type http
setHttpUserNameAndPassword(securitySchemeId, username, password) {
return applyApiKey.call(this, securitySchemeId, username, password);
}
// Public Method - to update security-scheme of type apiKey or OAuth
setApiKey(securitySchemeId, apiKeyValue) {
return applyApiKey.call(this, securitySchemeId, '', '', apiKeyValue);
}
// Public Method
removeAllSecurityKeys() {
return onClearAllApiKeys.call(this);
}
// Public Method
setApiServer(apiServerUrl) {
// return apiServerUrl;
return setApiServer.call(this, apiServerUrl);
}
// Event handler for Advanced Search text-inputs and checkboxes
onAdvancedSearch(ev, delay) {
const eventTargetEl = ev.target;
clearTimeout(this.timeoutId);
this.timeoutId = setTimeout(() => {
let searchInputEl;
if (eventTargetEl.type === 'text') {
searchInputEl = eventTargetEl;
} else {
searchInputEl = eventTargetEl.closest('.advanced-search-options').querySelector('input[type=text]');
}
const searchOptions = [...eventTargetEl.closest('.advanced-search-options').querySelectorAll('input:checked')].map(v => v.id);
this.advancedSearchMatches = advancedSearch(searchInputEl.value, this.resolvedSpec.tags, searchOptions);
}, delay);
}
}
customElements.define('rapi-doc', RapiDoc);
;// CONCATENATED MODULE: ./src/rapidoc-mini.js
// Styles
class RapiDocMini extends lit_element_s {
constructor() {
super();
this.isMini = true;
this.updateRoute = 'false';
this.renderStyle = 'view';
this.showHeader = 'false';
this.allowAdvancedSearch = 'false';
}
static get properties() {
return {
// Spec
specUrl: {
type: String,
attribute: 'spec-url'
},
sortEndpointsBy: {
type: String,
attribute: 'sort-endpoints-by'
},
// UI Layouts
layout: {
type: String
},
pathsExpanded: {
type: String,
attribute: 'paths-expanded'
},
defaultSchemaTab: {
type: String,
attribute: 'default-schema-tab'
},
responseAreaHeight: {
type: String,
attribute: 'response-area-height'
},
showSummaryWhenCollapsed: {
type: String,
attribute: 'show-summary-when-collapsed'
},
fillRequestFieldsWithExample: {
type: String,
attribute: 'fill-request-fields-with-example'
},
persistAuth: {
type: String,
attribute: 'persist-auth'
},
// Schema Styles
schemaStyle: {
type: String,
attribute: 'schema-style'
},
schemaExpandLevel: {
type: Number,
attribute: 'schema-expand-level'
},
schemaDescriptionExpanded: {
type: String,
attribute: 'schema-description-expanded'
},
// API Server
apiKeyName: {
type: String,
attribute: 'api-key-name'
},
apiKeyLocation: {
type: String,
attribute: 'api-key-location'
},
apiKeyValue: {
type: String,
attribute: 'api-key-value'
},
defaultApiServerUrl: {
type: String,
attribute: 'default-api-server'
},
serverUrl: {
type: String,
attribute: 'server-url'
},
oauthReceiver: {
type: String,
attribute: 'oauth-receiver'
},
allowTry: {
type: String,
attribute: 'allow-try'
},
// Main Colors and Font
theme: {
type: String
},
bgColor: {
type: String,
attribute: 'bg-color'
},
textColor: {
type: String,
attribute: 'text-color'
},
primaryColor: {
type: String,
attribute: 'primary-color'
},
fontSize: {
type: String,
attribute: 'font-size'
},
regularFont: {
type: String,
attribute: 'regular-font'
},
monoFont: {
type: String,
attribute: 'mono-font'
},
loadFonts: {
type: String,
attribute: 'load-fonts'
},
// Fetch Options
fetchCredentials: {
type: String,
attribute: 'fetch-credentials'
},
// Filters
matchPaths: {
type: String,
attribute: 'match-paths'
},
matchType: {
type: String,
attribute: 'match-type'
},
// Internal Properties
loading: {
type: Boolean
} // indicates spec is being loaded
};
}
static get styles() {
return [font_styles, input_styles, flex_styles, table_styles, endpoint_styles, prism_styles, tab_styles, nav_styles, info_styles, i`
:host {
display:flex;
flex-direction: column;
min-width:360px;
width:100%;
height:100%;
margin:0;
padding:0;
overflow: hidden;
letter-spacing:normal;
color:var(--fg);
background-color:var(--bg);
font-family:var(--font-regular);
}
@media only screen and (min-width: 768px) {
.only-large-screen{
display:block;
}
.only-large-screen-flex{
display:flex;
}
}`];
}
// Startup
connectedCallback() {
super.connectedCallback();
if (this.loadFonts !== 'false') {
const fontDescriptor = {
family: 'Open Sans',
style: 'normal',
weight: '300',
unicodeRange: 'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD'
};
const fontWeight300 = new FontFace('Open Sans', "url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')", fontDescriptor);
fontDescriptor.weight = '600';
const fontWeight600 = new FontFace('Open Sans', "url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')", fontDescriptor);
fontWeight300.load().then(font => {
document.fonts.add(font);
});
fontWeight600.load().then(font => {
document.fonts.add(font);
});
}
if (!this.showSummaryWhenCollapsed || !'true, false,'.includes(`${this.showSummaryWhenCollapsed},`)) {
this.showSummaryWhenCollapsed = 'true';
}
if (!this.layout || !'row, column,'.includes(`${this.layout},`)) {
this.layout = 'row';
}
if (!this.schemaStyle || !'tree, table,'.includes(`${this.schemaStyle},`)) {
this.schemaStyle = 'tree';
}
if (!this.theme || !'light, dark,'.includes(`${this.theme},`)) {
this.theme = window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
}
if (!this.defaultSchemaTab || !'example, schema, model,'.includes(`${this.defaultSchemaTab},`)) {
this.defaultSchemaTab = 'example';
} else if (this.defaultSchemaTab === 'model') {
this.defaultSchemaTab = 'schema';
}
this.pathsExpanded = this.pathsExpanded === 'true';
if (!this.schemaExpandLevel || this.schemaExpandLevel < 1) {
this.schemaExpandLevel = 99999;
}
if (!this.schemaDescriptionExpanded || !'true, false,'.includes(`${this.schemaDescriptionExpanded},`)) {
this.schemaDescriptionExpanded = 'false';
}
if (!this.fillRequestFieldsWithExample || !'true, false,'.includes(`${this.fillRequestFieldsWithExample},`)) {
this.fillRequestFieldsWithExample = 'true';
}
if (!this.persistAuth || !'true, false,'.includes(`${this.persistAuth},`)) {
this.persistAuth = 'false';
}
if (!this.responseAreaHeight) {
this.responseAreaHeight = '300px';
}
if (!this.allowTry || !'true, false,'.includes(`${this.allowTry},`)) {
this.allowTry = 'true';
}
if (!this.apiKeyValue) {
this.apiKeyValue = '-';
}
if (!this.apiKeyLocation) {
this.apiKeyLocation = 'header';
}
if (!this.apiKeyName) {
this.apiKeyName = '';
}
if (!this.oauthReceiver) {
this.oauthReceiver = 'oauth-receiver.html';
}
if (!this.sortTags || !'true, false,'.includes(`${this.sortTags},`)) {
this.sortTags = 'false';
}
if (!this.sortEndpointsBy || !'method, path, summary,'.includes(`${this.sortEndpointsBy},`)) {
this.sortEndpointsBy = 'path';
}
if (!this.fontSize || !'default, large, largest,'.includes(`${this.fontSize},`)) {
this.fontSize = 'default';
}
if (!this.matchType || !'includes regex'.includes(this.matchType)) {
this.matchType = 'includes';
}
if (!this.allowSchemaDescriptionExpandToggle || !'true, false,'.includes(`${this.allowSchemaDescriptionExpandToggle},`)) {
this.allowSchemaDescriptionExpandToggle = 'true';
}
if (!this.fetchCredentials || !'omit, same-origin, include,'.includes(`${this.fetchCredentials},`)) {
this.fetchCredentials = '';
}
marked.setOptions({
highlight: (code, lang) => {
if ((prism_default()).languages[lang]) {
return prism_default().highlight(code, (prism_default()).languages[lang], lang);
}
return code;
}
});
}
render() {
return mainBodyTemplate.call(this, true, false, false, this.pathsExpanded);
}
attributeChangedCallback(name, oldVal, newVal) {
if (name === 'spec-url') {
if (oldVal !== newVal) {
// put it at the end of event-loop to load all the attributes
window.setTimeout(async () => {
await this.loadSpec(newVal);
}, 0);
}
}
if (name === 'api-key-name' || name === 'api-key-location' || name === 'api-key-value') {
let updateSelectedApiKey = false;
let apiKeyName = '';
let apiKeyLocation = '';
let apiKeyValue = '';
if (name === 'api-key-name') {
if (this.getAttribute('api-key-location') && this.getAttribute('api-key-value')) {
apiKeyName = newVal;
apiKeyLocation = this.getAttribute('api-key-location');
apiKeyValue = this.getAttribute('api-key-value');
updateSelectedApiKey = true;
}
} else if (name === 'api-key-location') {
if (this.getAttribute('api-key-name') && this.getAttribute('api-key-value')) {
apiKeyLocation = newVal;
apiKeyName = this.getAttribute('api-key-name');
apiKeyValue = this.getAttribute('api-key-value');
updateSelectedApiKey = true;
}
} else if (name === 'api-key-value') {
if (this.getAttribute('api-key-name') && this.getAttribute('api-key-location')) {
apiKeyValue = newVal;
apiKeyLocation = this.getAttribute('api-key-location');
apiKeyName = this.getAttribute('api-key-name');
updateSelectedApiKey = true;
}
}
if (updateSelectedApiKey) {
if (this.resolvedSpec) {
const rapiDocApiKey = this.resolvedSpec.securitySchemes.find(v => v.securitySchemeId === rapidocApiKey);
if (!rapiDocApiKey) {
this.resolvedSpec.securitySchemes.push({
apiKeyId: rapidocApiKey,
description: 'api-key provided in rapidoc element attributes',
type: 'apiKey',
name: apiKeyName,
in: apiKeyLocation,
value: apiKeyValue,
finalKeyValue: apiKeyValue
});
} else {
rapiDocApiKey.name = apiKeyName;
rapiDocApiKey.in = apiKeyLocation;
rapiDocApiKey.value = apiKeyValue;
rapiDocApiKey.finalKeyValue = apiKeyValue;
}
this.requestUpdate();
}
}
}
super.attributeChangedCallback(name, oldVal, newVal);
}
onSpecUrlChange() {
this.setAttribute('spec-url', this.shadowRoot.getElementById('spec-url').value);
}
// Public Method
async loadSpec(specUrl) {
if (!specUrl) {
return;
}
try {
this.resolvedSpec = {
specLoadError: false,
isSpecLoading: true,
tags: []
};
this.loading = true;
this.loadFailed = false;
this.requestUpdate();
const spec = await ProcessSpec.call(this, specUrl, this.generateMissingTags === 'true', this.sortTags === 'true', this.getAttribute('sort-endpoints-by'), this.getAttribute('api-key-name'), this.getAttribute('api-key-location'), this.getAttribute('api-key-value'), this.getAttribute('server-url'));
this.loading = false;
this.afterSpecParsedAndValidated(spec);
} catch (err) {
this.loading = false;
this.loadFailed = true;
this.resolvedSpec = null;
console.error(`RapiDoc: Unable to resolve the API spec.. ${err.message}`); // eslint-disable-line no-console
}
}
// Public Method - to update security-scheme of type http
setHttpUserNameAndPassword(securitySchemeId, username, password) {
return applyApiKey.call(this, securitySchemeId, username, password);
}
// Public Method - to update security-scheme of type apiKey or OAuth
setApiKey(securitySchemeId, apiKeyValue) {
return applyApiKey.call(this, securitySchemeId, '', '', apiKeyValue);
}
// Public Method
removeAllSecurityKeys() {
return onClearAllApiKeys.call(this);
}
// Public Method
setApiServer(apiServerUrl) {
// return apiServerUrl;
return setApiServer.call(this, apiServerUrl);
}
async afterSpecParsedAndValidated(spec) {
this.resolvedSpec = spec;
this.selectedServer = undefined;
if (this.defaultApiServerUrl) {
if (this.defaultApiServerUrl === this.serverUrl) {
this.selectedServer = {
url: this.serverUrl,
computedUrl: this.serverUrl
};
} else if (this.resolvedSpec.servers) {
this.selectedServer = this.resolvedSpec.servers.find(v => v.url === this.defaultApiServerUrl);
}
}
if (!this.selectedServer) {
if (this.resolvedSpec.servers) {
this.selectedServer = this.resolvedSpec.servers[0]; // eslint-disable-line prefer-destructuring
}
}
this.requestUpdate();
// eslint-disable-next-line no-await-in-loop
while (!(await this.updateComplete));
const specLoadedEvent = new CustomEvent('spec-loaded', {
detail: spec
});
this.dispatchEvent(specLoadedEvent);
}
// Called by anchor tags created using markdown
handleHref(e) {
if (e.target.tagName.toLowerCase() === 'a') {
if (e.target.getAttribute('href').startsWith('#')) {
const gotoEl = this.shadowRoot.getElementById(e.target.getAttribute('href').replace('#', ''));
if (gotoEl) {
gotoEl.scrollIntoView({
behavior: 'auto',
block: 'start'
});
}
}
}
}
}
customElements.define('rapi-doc-mini', RapiDocMini);
;// CONCATENATED MODULE: ./src/oauth-receiver.js
class OauthReceiver extends HTMLElement {
connectedCallback() {
this.receiveAuthParms();
window.addEventListener('storage', e => this.receiveStorage(e), true);
}
/**
* Read OAuth2 parameters and sends them off
* to the window opener through `window.postMessage`.
*/
receiveAuthParms() {
let authData = {};
if (document.location.search) {
// Applies to authorizationCode flow
const params = new URLSearchParams(document.location.search);
const code = params.get('code');
const error = params.get('error');
const state = params.get('state');
authData = {
code,
error,
state,
responseType: 'code'
};
} else if (window.location.hash) {
// Applies to Implicit flow
const token_type = this.parseQueryString(window.location.hash.substring(1), 'token_type'); // eslint-disable-line camelcase
const access_token = this.parseQueryString(window.location.hash.substring(1), 'access_token'); // eslint-disable-line camelcase
authData = {
token_type,
access_token,
responseType: 'token'
}; // eslint-disable-line camelcase
}
if (window.opener) {
window.opener.postMessage(authData, this.target);
return;
}
sessionStorage.setItem('rapidoc-oauth-data', JSON.stringify(authData)); // Fallback to session storage if window.opener dont exist
}
relayAuthParams(e) {
if (window.parent) {
if (e.key === 'rapidoc-oauth-data') {
const authData = JSON.parse(e.newValue);
window.parent.postMessage(authData, this.target);
}
}
}
parseQueryString(queryString, key) {
const vars = queryString.split('&');
for (let i = 0; i < vars.length; i++) {
const pair = vars[i].split('=');
if (decodeURIComponent(pair[0]) === key) {
return decodeURIComponent(pair[1]);
}
}
}
}
customElements.define('oauth-receiver', OauthReceiver);
;// CONCATENATED MODULE: ./src/templates/json-schema-viewer-template.js
// eslint-disable-line import/extensions
// Templates
/* eslint-disable indent */
// Json Schema Nav Template
function jsonSchemaNavTemplate() {
return lit_html_x`
<nav class='nav-bar' part="section-navbar">
<slot name="nav-logo" class="logo"></slot>
<div style="display:flex;line-height:22px; padding:8px">
<input id="nav-bar-search"
part = "textbox textbox-nav-filter"
style = "width:100%; height: 26px; padding-right:20px; color:var(--nav-hover-text-color); border-color:var(--nav-accent-color); background-color:var(--nav-hover-bg-color)"
type = "text"
placeholder = "Filter"
@change = "${this.onSearchChange}"
spellcheck = "false"
>
<div style="margin: 6px 5px 0 -24px; font-size:var(--font-size-regular); cursor:pointer;">&#x21a9;</div>
</div>
<nav style="flex:1" class='nav-scroll' part="section-navbar-scroll">
${this.resolvedSpec.schemaAndExamples.map(v => lit_html_x`
<div class='nav-bar-path' data-content-id='${v.elementId}' id='link-${v.elementId}'
@click = '${e => {
this.scrollToEventTarget(e, false);
}}'
>
${v.name}
</div>`)}
</nav>
</nav>
`;
}
// Json Schema Body Template
function jsonSchemaBodyTemplate() {
return lit_html_x`
${this.showInfo === 'true' ? overviewTemplate.call(this) : ''}
<div style="font-size:var(--font-size-regular);">
${this.resolvedSpec.schemaAndExamples.map(jSchemaBody => {
var _examplesObj$;
const examplesObj = generateExample(jSchemaBody.schema, 'json', jSchemaBody.examples, jSchemaBody.example, true, false, 'json', true);
jSchemaBody.selectedExample = (_examplesObj$ = examplesObj[0]) === null || _examplesObj$ === void 0 ? void 0 : _examplesObj$.exampleId;
return lit_html_x`
<section id='${jSchemaBody.elementId}' class='json-schema-and-example regular-font' style="display:flex; flex-direction: column; border:1px solid var(--border-color); margin-bottom:32px; border-top: 5px solid var(--border-color)">
<div style="padding:16px; border-bottom: 1px solid var(--border-color)">
<div style="font-size:var(--font-size-small); font-weight:bold">${jSchemaBody.name}</div>
<span class="json-schema-description m-markdown ">${unsafe_html_o(marked(jSchemaBody.description || ''))}</span>
</div>
<div style="display:flex; flex-direction: row; gap:16px;">
<div class="json-schema-def" style="flex:1; padding:16px 0 16px 16px; ">
<schema-tree
.data = "${schemaInObjectNotation(jSchemaBody.schema, {})}"
schema-expand-level = "${this.schemaExpandLevel}"
schema-description-expanded = "${this.schemaDescriptionExpanded}"
allow-schema-description-expand-toggle = "${this.allowSchemaDescriptionExpandToggle}"
schema-hide-read-only = "false"
schema-hide-write-only = "false"
> </schema-tree>
</div>
<div class="json-schema-example-panel" style="width:400px; background-color: var(--input-bg); padding:16px 0 16px 16px; border-left: 1px dashed var(--border-color);">
${examplesObj.length > 1 ? lit_html_x`<select style="min-width:100px; max-width:100%" @change='${e => this.onSelectExample(e, jSchemaBody)}'>
${examplesObj.map(v => lit_html_x`
<option value="${v.exampleId}" ?selected=${v.exampleId === jSchemaBody.selectedExample}>
${v.exampleSummary.length > 80 ? v.exampleId : v.exampleSummary}
</option>`)}
</select>` : lit_html_x`<div style="font-size: var(--font-size-small);font-weight:700; margin:5px 0"> ${examplesObj[0].exampleSummary}</div>`}
${examplesObj.map(v => lit_html_x`
<json-tree
.data = "${v.exampleValue}"
data-example = "${v.exampleId}"
class = "example"
style = "margin-top:16px; display: ${v.exampleId === jSchemaBody.selectedExample ? 'flex' : 'none'}"
></json-tree>`)}
</div>
</div>
</section>`;
})}
</div>
`;
}
/* eslint-enable indent */
// Json Schema Root Template
function jsonSchemaViewerTemplate(isMini = false) {
// export default function jsonSchemaViewerTemplate(isMini = false, showExpandCollapse = true, showTags = true, pathsExpanded = false) {
if (!this.resolvedSpec) {
return '';
}
const newTheme = {
bg1: isValidHexColor(this.bgColor) ? this.bgColor : '',
fg1: isValidHexColor(this.textColor) ? this.textColor : '',
headerColor: isValidHexColor(this.headerColor) ? this.headerColor : '',
primaryColor: isValidHexColor(this.primaryColor) ? this.primaryColor : '',
navBgColor: isValidHexColor(this.navBgColor) ? this.navBgColor : '',
navTextColor: isValidHexColor(this.navTextColor) ? this.navTextColor : '',
navHoverBgColor: isValidHexColor(this.navHoverBgColor) ? this.navHoverBgColor : '',
navHoverTextColor: isValidHexColor(this.navHoverTextColor) ? this.navHoverTextColor : '',
navAccentColor: isValidHexColor(this.navAccentColor) ? this.navAccentColor : '',
navAccenttextColor: isValidHexColor(this.navAccentTextColor) ? this.navAccentTextColor : ''
};
/* eslint-disable indent */
if (this.resolvedSpec.specLoadError) {
if (isMini) {
return lit_html_x`
${this.theme === 'dark' ? setTheme.call(this, 'dark', newTheme) : setTheme.call(this, 'light', newTheme)}
<div style="display:flex; align-items:center; border:1px dashed var(--border-color); height:42px; padding:5px; font-size:var(--font-size-small); color:var(--red); font-family:var(--font-mono)"> ${this.resolvedSpec.info.description} </div>
`;
}
return lit_html_x`
${this.theme === 'dark' ? setTheme.call(this, 'dark', newTheme) : setTheme.call(this, 'light', newTheme)}
<!-- Header -->
${headerTemplate.call(this)}
<h1> Header </h1>
<main class="main-content regular-font" part="section-main-content">
<slot></slot>
<div style="margin:24px; text-align: center;">
<h1 style="color: var(--red)"> ${this.resolvedSpec.info.title} </h1>
<div style="font-family:var(--font-mono)"> ${this.resolvedSpec.info.description} </div>
</div>
</main>
`;
}
if (this.resolvedSpec.isSpecLoading) {
return lit_html_x`
${this.theme === 'dark' ? setTheme.call(this, 'dark', newTheme) : setTheme.call(this, 'light', newTheme)}
<main class="main-content regular-font" part="section-main-content">
<slot></slot>
<div class="main-content-inner--${this.renderStyle}-mode">
<div class="loader"></div>
</div>
</main>
`;
}
return lit_html_x`
${this.theme === 'dark' ? setTheme.call(this, 'dark', newTheme) : setTheme.call(this, 'light', newTheme)}
<!-- Header -->
${this.showHeader === 'false' ? '' : headerTemplate.call(this)}
<div id='the-main-body' class="body ${this.cssClasses}" dir= ${this.pageDirection}>
<!-- Side Nav -->
${jsonSchemaNavTemplate.call(this)}
<!-- Main Content -->
<main class="main-content regular-font" part="section-main-content">
<slot></slot>
<div class="main-content-inner--${this.renderStyle}-mode">
${this.loading === true ? lit_html_x`<div class="loader"></div>` : lit_html_x`
${this.loadFailed === true ? lit_html_x`<div style="text-align: center;margin: 16px;"> Unable to load the Spec</div>` : lit_html_x`
<div class="operations-root" @click="${e => {
this.handleHref(e);
}}">
${jsonSchemaBodyTemplate.call(this)}
</div>
`}`}
</div>
<slot name="footer"></slot>
</main>
</div>
`;
}
/* eslint-enable indent */
;// CONCATENATED MODULE: ./src/json-schema-viewer.js
// Styles
class JsonSchemaViewer extends lit_element_s {
constructor() {
super();
this.isMini = false;
this.updateRoute = 'false';
this.renderStyle = 'focused';
this.showHeader = 'true';
this.allowAdvancedSearch = 'false';
this.selectedExampleForEachSchema = {};
}
static get properties() {
return {
// Spec
specUrl: {
type: String,
attribute: 'spec-url'
},
// Schema Styles
schemaStyle: {
type: String,
attribute: 'schema-style'
},
schemaExpandLevel: {
type: Number,
attribute: 'schema-expand-level'
},
schemaDescriptionExpanded: {
type: String,
attribute: 'schema-description-expanded'
},
allowSchemaDescriptionExpandToggle: {
type: String,
attribute: 'allow-schema-description-expand-toggle'
},
// Hide/show Sections
showHeader: {
type: String,
attribute: 'show-header'
},
showSideNav: {
type: String,
attribute: 'show-side-nav'
},
showInfo: {
type: String,
attribute: 'show-info'
},
// Allow or restrict features
allowSpecUrlLoad: {
type: String,
attribute: 'allow-spec-url-load'
},
allowSpecFileLoad: {
type: String,
attribute: 'allow-spec-file-load'
},
allowSpecFileDownload: {
type: String,
attribute: 'allow-spec-file-download'
},
allowSearch: {
type: String,
attribute: 'allow-search'
},
// Main Colors and Font
theme: {
type: String
},
bgColor: {
type: String,
attribute: 'bg-color'
},
textColor: {
type: String,
attribute: 'text-color'
},
primaryColor: {
type: String,
attribute: 'primary-color'
},
fontSize: {
type: String,
attribute: 'font-size'
},
regularFont: {
type: String,
attribute: 'regular-font'
},
monoFont: {
type: String,
attribute: 'mono-font'
},
loadFonts: {
type: String,
attribute: 'load-fonts'
},
// Internal Properties
loading: {
type: Boolean
} // indicates spec is being loaded
};
}
static get styles() {
return [font_styles, input_styles, flex_styles, table_styles, endpoint_styles, prism_styles, tab_styles, nav_styles, info_styles, i`
:host {
display:flex;
flex-direction: column;
min-width:360px;
width:100%;
height:100%;
margin:0;
padding:0;
overflow: hidden;
letter-spacing:normal;
color:var(--fg);
background-color:var(--bg);
font-family:var(--font-regular);
}
.body {
display:flex;
height:100%;
width:100%;
overflow:hidden;
}
.nav-bar {
width: 230px;
display:flex;
}
.main-content {
margin:0;
padding: 16px;
display:block;
flex:1;
height:100%;
overflow-y: auto;
overflow-x: hidden;
scrollbar-width: thin;
scrollbar-color: var(--border-color) transparent;
}
.main-content-inner--view-mode {
padding: 0 8px;
}
.main-content::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.main-content::-webkit-scrollbar-track {
background:transparent;
}
.main-content::-webkit-scrollbar-thumb {
background-color: var(--border-color);
}
.main-header {
background-color:var(--header-bg);
color:var(--header-fg);
width:100%;
}
.header-title {
font-size:calc(var(--font-size-regular) + 8px);
padding:0 8px;
}
input.header-input{
background:var(--header-color-darker);
color:var(--header-fg);
border:1px solid var(--header-color-border);
flex:1;
padding-right:24px;
border-radius:3px;
}
input.header-input::placeholder {
opacity:0.4;
}
.loader {
margin: 16px auto 16px auto;
border: 4px solid var(--bg3);
border-radius: 50%;
border-top: 4px solid var(--primary-color);
width: 36px;
height: 36px;
animation: spin 2s linear infinite;
}
@media only screen and (min-width: 768px) {
.only-large-screen{
display:block;
}
.only-large-screen-flex{
display:flex;
}
}`];
}
// Startup
connectedCallback() {
super.connectedCallback();
const parent = this.parentElement;
if (parent) {
if (parent.offsetWidth === 0 && parent.style.width === '') {
parent.style.width = '100vw';
}
if (parent.offsetHeight === 0 && parent.style.height === '') {
parent.style.height = '100vh';
}
if (parent.tagName === 'BODY') {
if (!parent.style.marginTop) {
parent.style.marginTop = '0';
}
if (!parent.style.marginRight) {
parent.style.marginRight = '0';
}
if (!parent.style.marginBottom) {
parent.style.marginBottom = '0';
}
if (!parent.style.marginLeft) {
parent.style.marginLeft = '0';
}
}
}
if (this.loadFonts !== 'false') {
const fontDescriptor = {
family: 'Open Sans',
style: 'normal',
weight: '300',
unicodeRange: 'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD'
};
const fontWeight300 = new FontFace('Open Sans', "url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')", fontDescriptor);
fontDescriptor.weight = '600';
const fontWeight600 = new FontFace('Open Sans', "url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')", fontDescriptor);
fontWeight300.load().then(font => {
document.fonts.add(font);
});
fontWeight600.load().then(font => {
document.fonts.add(font);
});
}
this.renderStyle = 'focused';
this.pathsExpanded = this.pathsExpanded === 'true';
if (!this.showInfo || !'true, false,'.includes(`${this.showInfo},`)) {
this.showInfo = 'true';
}
if (!this.showSideNav || !'true false'.includes(this.showSideNav)) {
this.showSideNav = 'true';
}
if (!this.showHeader || !'true, false,'.includes(`${this.showHeader},`)) {
this.showHeader = 'true';
}
if (!this.schemaStyle || !'tree, table,'.includes(`${this.schemaStyle},`)) {
this.schemaStyle = 'tree';
}
if (!this.theme || !'light, dark,'.includes(`${this.theme},`)) {
this.theme = window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
}
if (!this.allowSearch || !'true, false,'.includes(`${this.allowSearch},`)) {
this.allowSearch = 'true';
}
if (!this.schemaExpandLevel || this.schemaExpandLevel < 1) {
this.schemaExpandLevel = 99999;
}
if (!this.schemaDescriptionExpanded || !'true, false,'.includes(`${this.schemaDescriptionExpanded},`)) {
this.schemaDescriptionExpanded = 'false';
}
if (!this.fontSize || !'default, large, largest,'.includes(`${this.fontSize},`)) {
this.fontSize = 'default';
}
if (!this.matchType || !'includes regex'.includes(this.matchType)) {
this.matchType = 'includes';
}
if (!this.allowSchemaDescriptionExpandToggle || !'true, false,'.includes(`${this.allowSchemaDescriptionExpandToggle},`)) {
this.allowSchemaDescriptionExpandToggle = 'true';
}
marked.setOptions({
highlight: (code, lang) => {
if ((prism_default()).languages[lang]) {
return prism_default().highlight(code, (prism_default()).languages[lang], lang);
}
return code;
}
});
}
render() {
return jsonSchemaViewerTemplate.call(this, true, false, false, this.pathsExpanded);
}
attributeChangedCallback(name, oldVal, newVal) {
if (name === 'spec-url') {
if (oldVal !== newVal) {
// put it at the end of event-loop to load all the attributes
window.setTimeout(async () => {
await this.loadSpec(newVal);
}, 0);
}
}
super.attributeChangedCallback(name, oldVal, newVal);
}
onSpecUrlChange() {
this.setAttribute('spec-url', this.shadowRoot.getElementById('spec-url').value);
}
onSearchChange(e) {
// Todo: Filter Search
this.matchPaths = e.target.value;
}
// Public Method
async loadSpec(specUrl) {
if (!specUrl) {
return;
}
try {
this.resolvedSpec = {
specLoadError: false,
isSpecLoading: true,
tags: []
};
this.loading = true;
this.loadFailed = false;
this.requestUpdate();
const spec = await ProcessSpec.call(this, specUrl, this.generateMissingTags === 'true', this.sortTags === 'true', this.getAttribute('sort-endpoints-by'));
this.loading = false;
this.afterSpecParsedAndValidated(spec);
} catch (err) {
this.loading = false;
this.loadFailed = true;
this.resolvedSpec = null;
console.error(`RapiDoc: Unable to resolve the API spec.. ${err.message}`); // eslint-disable-line no-console
}
}
async afterSpecParsedAndValidated(spec) {
this.resolvedSpec = spec;
const specLoadedEvent = new CustomEvent('spec-loaded', {
detail: spec
});
this.dispatchEvent(specLoadedEvent);
}
// Called by anchor tags created using markdown
handleHref(e) {
if (e.target.tagName.toLowerCase() === 'a') {
if (e.target.getAttribute('href').startsWith('#')) {
const gotoEl = this.shadowRoot.getElementById(e.target.getAttribute('href').replace('#', ''));
if (gotoEl) {
gotoEl.scrollIntoView({
behavior: 'auto',
block: 'start'
});
}
}
}
}
// Example Dropdown @change Handler
onSelectExample(e) {
const exampleContainerEl = e.target.closest('.json-schema-example-panel');
const exampleEls = [...exampleContainerEl.querySelectorAll('.example')];
exampleEls.forEach(v => {
v.style.display = v.dataset.example === e.target.value ? 'flex' : 'none';
});
}
async scrollToEventTarget(event) {
const navEl = event.currentTarget;
if (!navEl.dataset.contentId) {
return;
}
const contentEl = this.shadowRoot.getElementById(navEl.dataset.contentId);
if (contentEl) {
contentEl.scrollIntoView({
behavior: 'auto',
block: 'start'
});
}
}
}
customElements.define('json-schema-viewer', JsonSchemaViewer);
;// CONCATENATED MODULE: ./src/index.js
/* harmony default export */ const src = ({
RapiDoc: RapiDoc
});
/***/ }),
/***/ 742:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
exports.byteLength = byteLength
exports.toByteArray = toByteArray
exports.fromByteArray = fromByteArray
var lookup = []
var revLookup = []
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
for (var i = 0, len = code.length; i < len; ++i) {
lookup[i] = code[i]
revLookup[code.charCodeAt(i)] = i
}
// Support decoding URL-safe base64 strings, as Node.js does.
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
revLookup['-'.charCodeAt(0)] = 62
revLookup['_'.charCodeAt(0)] = 63
function getLens (b64) {
var len = b64.length
if (len % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4')
}
// Trim off extra bytes after placeholder bytes are found
// See: https://github.com/beatgammit/base64-js/issues/42
var validLen = b64.indexOf('=')
if (validLen === -1) validLen = len
var placeHoldersLen = validLen === len
? 0
: 4 - (validLen % 4)
return [validLen, placeHoldersLen]
}
// base64 is 4/3 + up to two characters of the original data
function byteLength (b64) {
var lens = getLens(b64)
var validLen = lens[0]
var placeHoldersLen = lens[1]
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}
function _byteLength (b64, validLen, placeHoldersLen) {
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}
function toByteArray (b64) {
var tmp
var lens = getLens(b64)
var validLen = lens[0]
var placeHoldersLen = lens[1]
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
var curByte = 0
// if there are placeholders, only get up to the last complete 4 chars
var len = placeHoldersLen > 0
? validLen - 4
: validLen
var i
for (i = 0; i < len; i += 4) {
tmp =
(revLookup[b64.charCodeAt(i)] << 18) |
(revLookup[b64.charCodeAt(i + 1)] << 12) |
(revLookup[b64.charCodeAt(i + 2)] << 6) |
revLookup[b64.charCodeAt(i + 3)]
arr[curByte++] = (tmp >> 16) & 0xFF
arr[curByte++] = (tmp >> 8) & 0xFF
arr[curByte++] = tmp & 0xFF
}
if (placeHoldersLen === 2) {
tmp =
(revLookup[b64.charCodeAt(i)] << 2) |
(revLookup[b64.charCodeAt(i + 1)] >> 4)
arr[curByte++] = tmp & 0xFF
}
if (placeHoldersLen === 1) {
tmp =
(revLookup[b64.charCodeAt(i)] << 10) |
(revLookup[b64.charCodeAt(i + 1)] << 4) |
(revLookup[b64.charCodeAt(i + 2)] >> 2)
arr[curByte++] = (tmp >> 8) & 0xFF
arr[curByte++] = tmp & 0xFF
}
return arr
}
function tripletToBase64 (num) {
return lookup[num >> 18 & 0x3F] +
lookup[num >> 12 & 0x3F] +
lookup[num >> 6 & 0x3F] +
lookup[num & 0x3F]
}
function encodeChunk (uint8, start, end) {
var tmp
var output = []
for (var i = start; i < end; i += 3) {
tmp =
((uint8[i] << 16) & 0xFF0000) +
((uint8[i + 1] << 8) & 0xFF00) +
(uint8[i + 2] & 0xFF)
output.push(tripletToBase64(tmp))
}
return output.join('')
}
function fromByteArray (uint8) {
var tmp
var len = uint8.length
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
var parts = []
var maxChunkLength = 16383 // must be multiple of 3
// go through the array every three bytes, we'll deal with trailing stuff later
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
}
// pad the end with zeros, but make sure to not forget the extra bytes
if (extraBytes === 1) {
tmp = uint8[len - 1]
parts.push(
lookup[tmp >> 2] +
lookup[(tmp << 4) & 0x3F] +
'=='
)
} else if (extraBytes === 2) {
tmp = (uint8[len - 2] << 8) + uint8[len - 1]
parts.push(
lookup[tmp >> 10] +
lookup[(tmp >> 4) & 0x3F] +
lookup[(tmp << 2) & 0x3F] +
'='
)
}
return parts.join('')
}
/***/ }),
/***/ 764:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
var __webpack_unused_export__;
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
/* eslint-disable no-proto */
const base64 = __webpack_require__(742)
const ieee754 = __webpack_require__(645)
const customInspectSymbol =
(typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation
? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
: null
exports.lW = Buffer
__webpack_unused_export__ = SlowBuffer
exports.h2 = 50
const K_MAX_LENGTH = 0x7fffffff
__webpack_unused_export__ = K_MAX_LENGTH
/**
* If `Buffer.TYPED_ARRAY_SUPPORT`:
* === true Use Uint8Array implementation (fastest)
* === false Print warning and recommend using `buffer` v4.x which has an Object
* implementation (most compatible, even IE6)
*
* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
* Opera 11.6+, iOS 4.2+.
*
* We report that the browser does not support typed arrays if the are not subclassable
* using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
* (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
* for __proto__ and has a buggy typed array implementation.
*/
Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
typeof console.error === 'function') {
console.error(
'This browser lacks typed array (Uint8Array) support which is required by ' +
'`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
)
}
function typedArraySupport () {
// Can typed array instances can be augmented?
try {
const arr = new Uint8Array(1)
const proto = { foo: function () { return 42 } }
Object.setPrototypeOf(proto, Uint8Array.prototype)
Object.setPrototypeOf(arr, proto)
return arr.foo() === 42
} catch (e) {
return false
}
}
Object.defineProperty(Buffer.prototype, 'parent', {
enumerable: true,
get: function () {
if (!Buffer.isBuffer(this)) return undefined
return this.buffer
}
})
Object.defineProperty(Buffer.prototype, 'offset', {
enumerable: true,
get: function () {
if (!Buffer.isBuffer(this)) return undefined
return this.byteOffset
}
})
function createBuffer (length) {
if (length > K_MAX_LENGTH) {
throw new RangeError('The value "' + length + '" is invalid for option "size"')
}
// Return an augmented `Uint8Array` instance
const buf = new Uint8Array(length)
Object.setPrototypeOf(buf, Buffer.prototype)
return buf
}
/**
* The Buffer constructor returns instances of `Uint8Array` that have their
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
* returns a single octet.
*
* The `Uint8Array` prototype remains unmodified.
*/
function Buffer (arg, encodingOrOffset, length) {
// Common case.
if (typeof arg === 'number') {
if (typeof encodingOrOffset === 'string') {
throw new TypeError(
'The "string" argument must be of type string. Received type number'
)
}
return allocUnsafe(arg)
}
return from(arg, encodingOrOffset, length)
}
Buffer.poolSize = 8192 // not used by this implementation
function from (value, encodingOrOffset, length) {
if (typeof value === 'string') {
return fromString(value, encodingOrOffset)
}
if (ArrayBuffer.isView(value)) {
return fromArrayView(value)
}
if (value == null) {
throw new TypeError(
'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
'or Array-like Object. Received type ' + (typeof value)
)
}
if (isInstance(value, ArrayBuffer) ||
(value && isInstance(value.buffer, ArrayBuffer))) {
return fromArrayBuffer(value, encodingOrOffset, length)
}
if (typeof SharedArrayBuffer !== 'undefined' &&
(isInstance(value, SharedArrayBuffer) ||
(value && isInstance(value.buffer, SharedArrayBuffer)))) {
return fromArrayBuffer(value, encodingOrOffset, length)
}
if (typeof value === 'number') {
throw new TypeError(
'The "value" argument must not be of type number. Received type number'
)
}
const valueOf = value.valueOf && value.valueOf()
if (valueOf != null && valueOf !== value) {
return Buffer.from(valueOf, encodingOrOffset, length)
}
const b = fromObject(value)
if (b) return b
if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&
typeof value[Symbol.toPrimitive] === 'function') {
return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)
}
throw new TypeError(
'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
'or Array-like Object. Received type ' + (typeof value)
)
}
/**
* Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
* if value is a number.
* Buffer.from(str[, encoding])
* Buffer.from(array)
* Buffer.from(buffer)
* Buffer.from(arrayBuffer[, byteOffset[, length]])
**/
Buffer.from = function (value, encodingOrOffset, length) {
return from(value, encodingOrOffset, length)
}
// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
// https://github.com/feross/buffer/pull/148
Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)
Object.setPrototypeOf(Buffer, Uint8Array)
function assertSize (size) {
if (typeof size !== 'number') {
throw new TypeError('"size" argument must be of type number')
} else if (size < 0) {
throw new RangeError('The value "' + size + '" is invalid for option "size"')
}
}
function alloc (size, fill, encoding) {
assertSize(size)
if (size <= 0) {
return createBuffer(size)
}
if (fill !== undefined) {
// Only pay attention to encoding if it's a string. This
// prevents accidentally sending in a number that would
// be interpreted as a start offset.
return typeof encoding === 'string'
? createBuffer(size).fill(fill, encoding)
: createBuffer(size).fill(fill)
}
return createBuffer(size)
}
/**
* Creates a new filled Buffer instance.
* alloc(size[, fill[, encoding]])
**/
Buffer.alloc = function (size, fill, encoding) {
return alloc(size, fill, encoding)
}
function allocUnsafe (size) {
assertSize(size)
return createBuffer(size < 0 ? 0 : checked(size) | 0)
}
/**
* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
* */
Buffer.allocUnsafe = function (size) {
return allocUnsafe(size)
}
/**
* Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
*/
Buffer.allocUnsafeSlow = function (size) {
return allocUnsafe(size)
}
function fromString (string, encoding) {
if (typeof encoding !== 'string' || encoding === '') {
encoding = 'utf8'
}
if (!Buffer.isEncoding(encoding)) {
throw new TypeError('Unknown encoding: ' + encoding)
}
const length = byteLength(string, encoding) | 0
let buf = createBuffer(length)
const actual = buf.write(string, encoding)
if (actual !== length) {
// Writing a hex string, for example, that contains invalid characters will
// cause everything after the first invalid character to be ignored. (e.g.
// 'abxxcd' will be treated as 'ab')
buf = buf.slice(0, actual)
}
return buf
}
function fromArrayLike (array) {
const length = array.length < 0 ? 0 : checked(array.length) | 0
const buf = createBuffer(length)
for (let i = 0; i < length; i += 1) {
buf[i] = array[i] & 255
}
return buf
}
function fromArrayView (arrayView) {
if (isInstance(arrayView, Uint8Array)) {
const copy = new Uint8Array(arrayView)
return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)
}
return fromArrayLike(arrayView)
}
function fromArrayBuffer (array, byteOffset, length) {
if (byteOffset < 0 || array.byteLength < byteOffset) {
throw new RangeError('"offset" is outside of buffer bounds')
}
if (array.byteLength < byteOffset + (length || 0)) {
throw new RangeError('"length" is outside of buffer bounds')
}
let buf
if (byteOffset === undefined && length === undefined) {
buf = new Uint8Array(array)
} else if (length === undefined) {
buf = new Uint8Array(array, byteOffset)
} else {
buf = new Uint8Array(array, byteOffset, length)
}
// Return an augmented `Uint8Array` instance
Object.setPrototypeOf(buf, Buffer.prototype)
return buf
}
function fromObject (obj) {
if (Buffer.isBuffer(obj)) {
const len = checked(obj.length) | 0
const buf = createBuffer(len)
if (buf.length === 0) {
return buf
}
obj.copy(buf, 0, 0, len)
return buf
}
if (obj.length !== undefined) {
if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
return createBuffer(0)
}
return fromArrayLike(obj)
}
if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
return fromArrayLike(obj.data)
}
}
function checked (length) {
// Note: cannot use `length < K_MAX_LENGTH` here because that fails when
// length is NaN (which is otherwise coerced to zero.)
if (length >= K_MAX_LENGTH) {
throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
}
return length | 0
}
function SlowBuffer (length) {
if (+length != length) { // eslint-disable-line eqeqeq
length = 0
}
return Buffer.alloc(+length)
}
Buffer.isBuffer = function isBuffer (b) {
return b != null && b._isBuffer === true &&
b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false
}
Buffer.compare = function compare (a, b) {
if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)
if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)
if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
throw new TypeError(
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
)
}
if (a === b) return 0
let x = a.length
let y = b.length
for (let i = 0, len = Math.min(x, y); i < len; ++i) {
if (a[i] !== b[i]) {
x = a[i]
y = b[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
Buffer.isEncoding = function isEncoding (encoding) {
switch (String(encoding).toLowerCase()) {
case 'hex':
case 'utf8':
case 'utf-8':
case 'ascii':
case 'latin1':
case 'binary':
case 'base64':
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return true
default:
return false
}
}
Buffer.concat = function concat (list, length) {
if (!Array.isArray(list)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
if (list.length === 0) {
return Buffer.alloc(0)
}
let i
if (length === undefined) {
length = 0
for (i = 0; i < list.length; ++i) {
length += list[i].length
}
}
const buffer = Buffer.allocUnsafe(length)
let pos = 0
for (i = 0; i < list.length; ++i) {
let buf = list[i]
if (isInstance(buf, Uint8Array)) {
if (pos + buf.length > buffer.length) {
if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)
buf.copy(buffer, pos)
} else {
Uint8Array.prototype.set.call(
buffer,
buf,
pos
)
}
} else if (!Buffer.isBuffer(buf)) {
throw new TypeError('"list" argument must be an Array of Buffers')
} else {
buf.copy(buffer, pos)
}
pos += buf.length
}
return buffer
}
function byteLength (string, encoding) {
if (Buffer.isBuffer(string)) {
return string.length
}
if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
return string.byteLength
}
if (typeof string !== 'string') {
throw new TypeError(
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' +
'Received type ' + typeof string
)
}
const len = string.length
const mustMatch = (arguments.length > 2 && arguments[2] === true)
if (!mustMatch && len === 0) return 0
// Use a for loop to avoid recursion
let loweredCase = false
for (;;) {
switch (encoding) {
case 'ascii':
case 'latin1':
case 'binary':
return len
case 'utf8':
case 'utf-8':
return utf8ToBytes(string).length
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return len * 2
case 'hex':
return len >>> 1
case 'base64':
return base64ToBytes(string).length
default:
if (loweredCase) {
return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8
}
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.byteLength = byteLength
function slowToString (encoding, start, end) {
let loweredCase = false
// No need to verify that "this.length <= MAX_UINT32" since it's a read-only
// property of a typed array.
// This behaves neither like String nor Uint8Array in that we set start/end
// to their upper/lower bounds if the value passed is out of range.
// undefined is handled specially as per ECMA-262 6th Edition,
// Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
if (start === undefined || start < 0) {
start = 0
}
// Return early if start > this.length. Done here to prevent potential uint32
// coercion fail below.
if (start > this.length) {
return ''
}
if (end === undefined || end > this.length) {
end = this.length
}
if (end <= 0) {
return ''
}
// Force coercion to uint32. This will also coerce falsey/NaN values to 0.
end >>>= 0
start >>>= 0
if (end <= start) {
return ''
}
if (!encoding) encoding = 'utf8'
while (true) {
switch (encoding) {
case 'hex':
return hexSlice(this, start, end)
case 'utf8':
case 'utf-8':
return utf8Slice(this, start, end)
case 'ascii':
return asciiSlice(this, start, end)
case 'latin1':
case 'binary':
return latin1Slice(this, start, end)
case 'base64':
return base64Slice(this, start, end)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return utf16leSlice(this, start, end)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = (encoding + '').toLowerCase()
loweredCase = true
}
}
}
// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
// reliably in a browserify context because there could be multiple different
// copies of the 'buffer' package in use. This method works even for Buffer
// instances that were created from another copy of the `buffer` package.
// See: https://github.com/feross/buffer/issues/154
Buffer.prototype._isBuffer = true
function swap (b, n, m) {
const i = b[n]
b[n] = b[m]
b[m] = i
}
Buffer.prototype.swap16 = function swap16 () {
const len = this.length
if (len % 2 !== 0) {
throw new RangeError('Buffer size must be a multiple of 16-bits')
}
for (let i = 0; i < len; i += 2) {
swap(this, i, i + 1)
}
return this
}
Buffer.prototype.swap32 = function swap32 () {
const len = this.length
if (len % 4 !== 0) {
throw new RangeError('Buffer size must be a multiple of 32-bits')
}
for (let i = 0; i < len; i += 4) {
swap(this, i, i + 3)
swap(this, i + 1, i + 2)
}
return this
}
Buffer.prototype.swap64 = function swap64 () {
const len = this.length
if (len % 8 !== 0) {
throw new RangeError('Buffer size must be a multiple of 64-bits')
}
for (let i = 0; i < len; i += 8) {
swap(this, i, i + 7)
swap(this, i + 1, i + 6)
swap(this, i + 2, i + 5)
swap(this, i + 3, i + 4)
}
return this
}
Buffer.prototype.toString = function toString () {
const length = this.length
if (length === 0) return ''
if (arguments.length === 0) return utf8Slice(this, 0, length)
return slowToString.apply(this, arguments)
}
Buffer.prototype.toLocaleString = Buffer.prototype.toString
Buffer.prototype.equals = function equals (b) {
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
if (this === b) return true
return Buffer.compare(this, b) === 0
}
Buffer.prototype.inspect = function inspect () {
let str = ''
const max = exports.h2
str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()
if (this.length > max) str += ' ... '
return '<Buffer ' + str + '>'
}
if (customInspectSymbol) {
Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect
}
Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
if (isInstance(target, Uint8Array)) {
target = Buffer.from(target, target.offset, target.byteLength)
}
if (!Buffer.isBuffer(target)) {
throw new TypeError(
'The "target" argument must be one of type Buffer or Uint8Array. ' +
'Received type ' + (typeof target)
)
}
if (start === undefined) {
start = 0
}
if (end === undefined) {
end = target ? target.length : 0
}
if (thisStart === undefined) {
thisStart = 0
}
if (thisEnd === undefined) {
thisEnd = this.length
}
if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
throw new RangeError('out of range index')
}
if (thisStart >= thisEnd && start >= end) {
return 0
}
if (thisStart >= thisEnd) {
return -1
}
if (start >= end) {
return 1
}
start >>>= 0
end >>>= 0
thisStart >>>= 0
thisEnd >>>= 0
if (this === target) return 0
let x = thisEnd - thisStart
let y = end - start
const len = Math.min(x, y)
const thisCopy = this.slice(thisStart, thisEnd)
const targetCopy = target.slice(start, end)
for (let i = 0; i < len; ++i) {
if (thisCopy[i] !== targetCopy[i]) {
x = thisCopy[i]
y = targetCopy[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
//
// Arguments:
// - buffer - a Buffer to search
// - val - a string, Buffer, or number
// - byteOffset - an index into `buffer`; will be clamped to an int32
// - encoding - an optional encoding, relevant is val is a string
// - dir - true for indexOf, false for lastIndexOf
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
// Empty buffer means no match
if (buffer.length === 0) return -1
// Normalize byteOffset
if (typeof byteOffset === 'string') {
encoding = byteOffset
byteOffset = 0
} else if (byteOffset > 0x7fffffff) {
byteOffset = 0x7fffffff
} else if (byteOffset < -0x80000000) {
byteOffset = -0x80000000
}
byteOffset = +byteOffset // Coerce to Number.
if (numberIsNaN(byteOffset)) {
// byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
byteOffset = dir ? 0 : (buffer.length - 1)
}
// Normalize byteOffset: negative offsets start from the end of the buffer
if (byteOffset < 0) byteOffset = buffer.length + byteOffset
if (byteOffset >= buffer.length) {
if (dir) return -1
else byteOffset = buffer.length - 1
} else if (byteOffset < 0) {
if (dir) byteOffset = 0
else return -1
}
// Normalize val
if (typeof val === 'string') {
val = Buffer.from(val, encoding)
}
// Finally, search either indexOf (if dir is true) or lastIndexOf
if (Buffer.isBuffer(val)) {
// Special case: looking for empty string/buffer always fails
if (val.length === 0) {
return -1
}
return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
} else if (typeof val === 'number') {
val = val & 0xFF // Search for a byte value [0-255]
if (typeof Uint8Array.prototype.indexOf === 'function') {
if (dir) {
return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
} else {
return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
}
}
return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)
}
throw new TypeError('val must be string, number or Buffer')
}
function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
let indexSize = 1
let arrLength = arr.length
let valLength = val.length
if (encoding !== undefined) {
encoding = String(encoding).toLowerCase()
if (encoding === 'ucs2' || encoding === 'ucs-2' ||
encoding === 'utf16le' || encoding === 'utf-16le') {
if (arr.length < 2 || val.length < 2) {
return -1
}
indexSize = 2
arrLength /= 2
valLength /= 2
byteOffset /= 2
}
}
function read (buf, i) {
if (indexSize === 1) {
return buf[i]
} else {
return buf.readUInt16BE(i * indexSize)
}
}
let i
if (dir) {
let foundIndex = -1
for (i = byteOffset; i < arrLength; i++) {
if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
if (foundIndex === -1) foundIndex = i
if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
} else {
if (foundIndex !== -1) i -= i - foundIndex
foundIndex = -1
}
}
} else {
if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
for (i = byteOffset; i >= 0; i--) {
let found = true
for (let j = 0; j < valLength; j++) {
if (read(arr, i + j) !== read(val, j)) {
found = false
break
}
}
if (found) return i
}
}
return -1
}
Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
return this.indexOf(val, byteOffset, encoding) !== -1
}
Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
}
Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
}
function hexWrite (buf, string, offset, length) {
offset = Number(offset) || 0
const remaining = buf.length - offset
if (!length) {
length = remaining
} else {
length = Number(length)
if (length > remaining) {
length = remaining
}
}
const strLen = string.length
if (length > strLen / 2) {
length = strLen / 2
}
let i
for (i = 0; i < length; ++i) {
const parsed = parseInt(string.substr(i * 2, 2), 16)
if (numberIsNaN(parsed)) return i
buf[offset + i] = parsed
}
return i
}
function utf8Write (buf, string, offset, length) {
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
}
function asciiWrite (buf, string, offset, length) {
return blitBuffer(asciiToBytes(string), buf, offset, length)
}
function base64Write (buf, string, offset, length) {
return blitBuffer(base64ToBytes(string), buf, offset, length)
}
function ucs2Write (buf, string, offset, length) {
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
}
Buffer.prototype.write = function write (string, offset, length, encoding) {
// Buffer#write(string)
if (offset === undefined) {
encoding = 'utf8'
length = this.length
offset = 0
// Buffer#write(string, encoding)
} else if (length === undefined && typeof offset === 'string') {
encoding = offset
length = this.length
offset = 0
// Buffer#write(string, offset[, length][, encoding])
} else if (isFinite(offset)) {
offset = offset >>> 0
if (isFinite(length)) {
length = length >>> 0
if (encoding === undefined) encoding = 'utf8'
} else {
encoding = length
length = undefined
}
} else {
throw new Error(
'Buffer.write(string, encoding, offset[, length]) is no longer supported'
)
}
const remaining = this.length - offset
if (length === undefined || length > remaining) length = remaining
if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
throw new RangeError('Attempt to write outside buffer bounds')
}
if (!encoding) encoding = 'utf8'
let loweredCase = false
for (;;) {
switch (encoding) {
case 'hex':
return hexWrite(this, string, offset, length)
case 'utf8':
case 'utf-8':
return utf8Write(this, string, offset, length)
case 'ascii':
case 'latin1':
case 'binary':
return asciiWrite(this, string, offset, length)
case 'base64':
// Warning: maxLength not taken into account in base64Write
return base64Write(this, string, offset, length)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return ucs2Write(this, string, offset, length)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.prototype.toJSON = function toJSON () {
return {
type: 'Buffer',
data: Array.prototype.slice.call(this._arr || this, 0)
}
}
function base64Slice (buf, start, end) {
if (start === 0 && end === buf.length) {
return base64.fromByteArray(buf)
} else {
return base64.fromByteArray(buf.slice(start, end))
}
}
function utf8Slice (buf, start, end) {
end = Math.min(buf.length, end)
const res = []
let i = start
while (i < end) {
const firstByte = buf[i]
let codePoint = null
let bytesPerSequence = (firstByte > 0xEF)
? 4
: (firstByte > 0xDF)
? 3
: (firstByte > 0xBF)
? 2
: 1
if (i + bytesPerSequence <= end) {
let secondByte, thirdByte, fourthByte, tempCodePoint
switch (bytesPerSequence) {
case 1:
if (firstByte < 0x80) {
codePoint = firstByte
}
break
case 2:
secondByte = buf[i + 1]
if ((secondByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
if (tempCodePoint > 0x7F) {
codePoint = tempCodePoint
}
}
break
case 3:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
codePoint = tempCodePoint
}
}
break
case 4:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
fourthByte = buf[i + 3]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
codePoint = tempCodePoint
}
}
}
}
if (codePoint === null) {
// we did not generate a valid codePoint so insert a
// replacement char (U+FFFD) and advance only 1 byte
codePoint = 0xFFFD
bytesPerSequence = 1
} else if (codePoint > 0xFFFF) {
// encode to utf16 (surrogate pair dance)
codePoint -= 0x10000
res.push(codePoint >>> 10 & 0x3FF | 0xD800)
codePoint = 0xDC00 | codePoint & 0x3FF
}
res.push(codePoint)
i += bytesPerSequence
}
return decodeCodePointsArray(res)
}
// Based on http://stackoverflow.com/a/22747272/680742, the browser with
// the lowest limit is Chrome, with 0x10000 args.
// We go 1 magnitude less, for safety
const MAX_ARGUMENTS_LENGTH = 0x1000
function decodeCodePointsArray (codePoints) {
const len = codePoints.length
if (len <= MAX_ARGUMENTS_LENGTH) {
return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
}
// Decode in chunks to avoid "call stack size exceeded".
let res = ''
let i = 0
while (i < len) {
res += String.fromCharCode.apply(
String,
codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
)
}
return res
}
function asciiSlice (buf, start, end) {
let ret = ''
end = Math.min(buf.length, end)
for (let i = start; i < end; ++i) {
ret += String.fromCharCode(buf[i] & 0x7F)
}
return ret
}
function latin1Slice (buf, start, end) {
let ret = ''
end = Math.min(buf.length, end)
for (let i = start; i < end; ++i) {
ret += String.fromCharCode(buf[i])
}
return ret
}
function hexSlice (buf, start, end) {
const len = buf.length
if (!start || start < 0) start = 0
if (!end || end < 0 || end > len) end = len
let out = ''
for (let i = start; i < end; ++i) {
out += hexSliceLookupTable[buf[i]]
}
return out
}
function utf16leSlice (buf, start, end) {
const bytes = buf.slice(start, end)
let res = ''
// If bytes.length is odd, the last 8 bits must be ignored (same as node.js)
for (let i = 0; i < bytes.length - 1; i += 2) {
res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
}
return res
}
Buffer.prototype.slice = function slice (start, end) {
const len = this.length
start = ~~start
end = end === undefined ? len : ~~end
if (start < 0) {
start += len
if (start < 0) start = 0
} else if (start > len) {
start = len
}
if (end < 0) {
end += len
if (end < 0) end = 0
} else if (end > len) {
end = len
}
if (end < start) end = start
const newBuf = this.subarray(start, end)
// Return an augmented `Uint8Array` instance
Object.setPrototypeOf(newBuf, Buffer.prototype)
return newBuf
}
/*
* Need to make sure that buffer isn't trying to write out of bounds.
*/
function checkOffset (offset, ext, length) {
if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
}
Buffer.prototype.readUintLE =
Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
let val = this[offset]
let mul = 1
let i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
return val
}
Buffer.prototype.readUintBE =
Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) {
checkOffset(offset, byteLength, this.length)
}
let val = this[offset + --byteLength]
let mul = 1
while (byteLength > 0 && (mul *= 0x100)) {
val += this[offset + --byteLength] * mul
}
return val
}
Buffer.prototype.readUint8 =
Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 1, this.length)
return this[offset]
}
Buffer.prototype.readUint16LE =
Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 2, this.length)
return this[offset] | (this[offset + 1] << 8)
}
Buffer.prototype.readUint16BE =
Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 2, this.length)
return (this[offset] << 8) | this[offset + 1]
}
Buffer.prototype.readUint32LE =
Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return ((this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16)) +
(this[offset + 3] * 0x1000000)
}
Buffer.prototype.readUint32BE =
Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] * 0x1000000) +
((this[offset + 1] << 16) |
(this[offset + 2] << 8) |
this[offset + 3])
}
Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {
offset = offset >>> 0
validateNumber(offset, 'offset')
const first = this[offset]
const last = this[offset + 7]
if (first === undefined || last === undefined) {
boundsError(offset, this.length - 8)
}
const lo = first +
this[++offset] * 2 ** 8 +
this[++offset] * 2 ** 16 +
this[++offset] * 2 ** 24
const hi = this[++offset] +
this[++offset] * 2 ** 8 +
this[++offset] * 2 ** 16 +
last * 2 ** 24
return BigInt(lo) + (BigInt(hi) << BigInt(32))
})
Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {
offset = offset >>> 0
validateNumber(offset, 'offset')
const first = this[offset]
const last = this[offset + 7]
if (first === undefined || last === undefined) {
boundsError(offset, this.length - 8)
}
const hi = first * 2 ** 24 +
this[++offset] * 2 ** 16 +
this[++offset] * 2 ** 8 +
this[++offset]
const lo = this[++offset] * 2 ** 24 +
this[++offset] * 2 ** 16 +
this[++offset] * 2 ** 8 +
last
return (BigInt(hi) << BigInt(32)) + BigInt(lo)
})
Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
let val = this[offset]
let mul = 1
let i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
let i = byteLength
let mul = 1
let val = this[offset + --i]
while (i > 0 && (mul *= 0x100)) {
val += this[offset + --i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 1, this.length)
if (!(this[offset] & 0x80)) return (this[offset])
return ((0xff - this[offset] + 1) * -1)
}
Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 2, this.length)
const val = this[offset] | (this[offset + 1] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 2, this.length)
const val = this[offset + 1] | (this[offset] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16) |
(this[offset + 3] << 24)
}
Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] << 24) |
(this[offset + 1] << 16) |
(this[offset + 2] << 8) |
(this[offset + 3])
}
Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {
offset = offset >>> 0
validateNumber(offset, 'offset')
const first = this[offset]
const last = this[offset + 7]
if (first === undefined || last === undefined) {
boundsError(offset, this.length - 8)
}
const val = this[offset + 4] +
this[offset + 5] * 2 ** 8 +
this[offset + 6] * 2 ** 16 +
(last << 24) // Overflow
return (BigInt(val) << BigInt(32)) +
BigInt(first +
this[++offset] * 2 ** 8 +
this[++offset] * 2 ** 16 +
this[++offset] * 2 ** 24)
})
Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {
offset = offset >>> 0
validateNumber(offset, 'offset')
const first = this[offset]
const last = this[offset + 7]
if (first === undefined || last === undefined) {
boundsError(offset, this.length - 8)
}
const val = (first << 24) + // Overflow
this[++offset] * 2 ** 16 +
this[++offset] * 2 ** 8 +
this[++offset]
return (BigInt(val) << BigInt(32)) +
BigInt(this[++offset] * 2 ** 24 +
this[++offset] * 2 ** 16 +
this[++offset] * 2 ** 8 +
last)
})
Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, true, 23, 4)
}
Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, false, 23, 4)
}
Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, true, 52, 8)
}
Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
offset = offset >>> 0
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, false, 52, 8)
}
function checkInt (buf, value, offset, ext, max, min) {
if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
if (offset + ext > buf.length) throw new RangeError('Index out of range')
}
Buffer.prototype.writeUintLE =
Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) {
const maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
let mul = 1
let i = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUintBE =
Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
byteLength = byteLength >>> 0
if (!noAssert) {
const maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
let i = byteLength - 1
let mul = 1
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUint8 =
Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
this[offset] = (value & 0xff)
return offset + 1
}
Buffer.prototype.writeUint16LE =
Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
return offset + 2
}
Buffer.prototype.writeUint16BE =
Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
return offset + 2
}
Buffer.prototype.writeUint32LE =
Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
this[offset + 3] = (value >>> 24)
this[offset + 2] = (value >>> 16)
this[offset + 1] = (value >>> 8)
this[offset] = (value & 0xff)
return offset + 4
}
Buffer.prototype.writeUint32BE =
Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
return offset + 4
}
function wrtBigUInt64LE (buf, value, offset, min, max) {
checkIntBI(value, min, max, buf, offset, 7)
let lo = Number(value & BigInt(0xffffffff))
buf[offset++] = lo
lo = lo >> 8
buf[offset++] = lo
lo = lo >> 8
buf[offset++] = lo
lo = lo >> 8
buf[offset++] = lo
let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))
buf[offset++] = hi
hi = hi >> 8
buf[offset++] = hi
hi = hi >> 8
buf[offset++] = hi
hi = hi >> 8
buf[offset++] = hi
return offset
}
function wrtBigUInt64BE (buf, value, offset, min, max) {
checkIntBI(value, min, max, buf, offset, 7)
let lo = Number(value & BigInt(0xffffffff))
buf[offset + 7] = lo
lo = lo >> 8
buf[offset + 6] = lo
lo = lo >> 8
buf[offset + 5] = lo
lo = lo >> 8
buf[offset + 4] = lo
let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))
buf[offset + 3] = hi
hi = hi >> 8
buf[offset + 2] = hi
hi = hi >> 8
buf[offset + 1] = hi
hi = hi >> 8
buf[offset] = hi
return offset + 8
}
Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {
return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))
})
Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {
return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))
})
Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) {
const limit = Math.pow(2, (8 * byteLength) - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
let i = 0
let mul = 1
let sub = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) {
const limit = Math.pow(2, (8 * byteLength) - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
let i = byteLength - 1
let mul = 1
let sub = 0
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
if (value < 0) value = 0xff + value + 1
this[offset] = (value & 0xff)
return offset + 1
}
Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
return offset + 2
}
Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
return offset + 2
}
Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
this[offset + 2] = (value >>> 16)
this[offset + 3] = (value >>> 24)
return offset + 4
}
Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (value < 0) value = 0xffffffff + value + 1
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
return offset + 4
}
Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {
return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))
})
Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {
return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))
})
function checkIEEE754 (buf, value, offset, ext, max, min) {
if (offset + ext > buf.length) throw new RangeError('Index out of range')
if (offset < 0) throw new RangeError('Index out of range')
}
function writeFloat (buf, value, offset, littleEndian, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) {
checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
}
ieee754.write(buf, value, offset, littleEndian, 23, 4)
return offset + 4
}
Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
return writeFloat(this, value, offset, true, noAssert)
}
Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
return writeFloat(this, value, offset, false, noAssert)
}
function writeDouble (buf, value, offset, littleEndian, noAssert) {
value = +value
offset = offset >>> 0
if (!noAssert) {
checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
}
ieee754.write(buf, value, offset, littleEndian, 52, 8)
return offset + 8
}
Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
return writeDouble(this, value, offset, true, noAssert)
}
Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
return writeDouble(this, value, offset, false, noAssert)
}
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')
if (!start) start = 0
if (!end && end !== 0) end = this.length
if (targetStart >= target.length) targetStart = target.length
if (!targetStart) targetStart = 0
if (end > 0 && end < start) end = start
// Copy 0 bytes; we're done
if (end === start) return 0
if (target.length === 0 || this.length === 0) return 0
// Fatal error conditions
if (targetStart < 0) {
throw new RangeError('targetStart out of bounds')
}
if (start < 0 || start >= this.length) throw new RangeError('Index out of range')
if (end < 0) throw new RangeError('sourceEnd out of bounds')
// Are we oob?
if (end > this.length) end = this.length
if (target.length - targetStart < end - start) {
end = target.length - targetStart + start
}
const len = end - start
if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
// Use built-in when available, missing from IE11
this.copyWithin(targetStart, start, end)
} else {
Uint8Array.prototype.set.call(
target,
this.subarray(start, end),
targetStart
)
}
return len
}
// Usage:
// buffer.fill(number[, offset[, end]])
// buffer.fill(buffer[, offset[, end]])
// buffer.fill(string[, offset[, end]][, encoding])
Buffer.prototype.fill = function fill (val, start, end, encoding) {
// Handle string cases:
if (typeof val === 'string') {
if (typeof start === 'string') {
encoding = start
start = 0
end = this.length
} else if (typeof end === 'string') {
encoding = end
end = this.length
}
if (encoding !== undefined && typeof encoding !== 'string') {
throw new TypeError('encoding must be a string')
}
if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
throw new TypeError('Unknown encoding: ' + encoding)
}
if (val.length === 1) {
const code = val.charCodeAt(0)
if ((encoding === 'utf8' && code < 128) ||
encoding === 'latin1') {
// Fast path: If `val` fits into a single byte, use that numeric value.
val = code
}
}
} else if (typeof val === 'number') {
val = val & 255
} else if (typeof val === 'boolean') {
val = Number(val)
}
// Invalid ranges are not set to a default, so can range check early.
if (start < 0 || this.length < start || this.length < end) {
throw new RangeError('Out of range index')
}
if (end <= start) {
return this
}
start = start >>> 0
end = end === undefined ? this.length : end >>> 0
if (!val) val = 0
let i
if (typeof val === 'number') {
for (i = start; i < end; ++i) {
this[i] = val
}
} else {
const bytes = Buffer.isBuffer(val)
? val
: Buffer.from(val, encoding)
const len = bytes.length
if (len === 0) {
throw new TypeError('The value "' + val +
'" is invalid for argument "value"')
}
for (i = 0; i < end - start; ++i) {
this[i + start] = bytes[i % len]
}
}
return this
}
// CUSTOM ERRORS
// =============
// Simplified versions from Node, changed for Buffer-only usage
const errors = {}
function E (sym, getMessage, Base) {
errors[sym] = class NodeError extends Base {
constructor () {
super()
Object.defineProperty(this, 'message', {
value: getMessage.apply(this, arguments),
writable: true,
configurable: true
})
// Add the error code to the name to include it in the stack trace.
this.name = `${this.name} [${sym}]`
// Access the stack to generate the error message including the error code
// from the name.
this.stack // eslint-disable-line no-unused-expressions
// Reset the name to the actual name.
delete this.name
}
get code () {
return sym
}
set code (value) {
Object.defineProperty(this, 'code', {
configurable: true,
enumerable: true,
value,
writable: true
})
}
toString () {
return `${this.name} [${sym}]: ${this.message}`
}
}
}
E('ERR_BUFFER_OUT_OF_BOUNDS',
function (name) {
if (name) {
return `${name} is outside of buffer bounds`
}
return 'Attempt to access memory outside buffer bounds'
}, RangeError)
E('ERR_INVALID_ARG_TYPE',
function (name, actual) {
return `The "${name}" argument must be of type number. Received type ${typeof actual}`
}, TypeError)
E('ERR_OUT_OF_RANGE',
function (str, range, input) {
let msg = `The value of "${str}" is out of range.`
let received = input
if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {
received = addNumericalSeparator(String(input))
} else if (typeof input === 'bigint') {
received = String(input)
if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {
received = addNumericalSeparator(received)
}
received += 'n'
}
msg += ` It must be ${range}. Received ${received}`
return msg
}, RangeError)
function addNumericalSeparator (val) {
let res = ''
let i = val.length
const start = val[0] === '-' ? 1 : 0
for (; i >= start + 4; i -= 3) {
res = `_${val.slice(i - 3, i)}${res}`
}
return `${val.slice(0, i)}${res}`
}
// CHECK FUNCTIONS
// ===============
function checkBounds (buf, offset, byteLength) {
validateNumber(offset, 'offset')
if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {
boundsError(offset, buf.length - (byteLength + 1))
}
}
function checkIntBI (value, min, max, buf, offset, byteLength) {
if (value > max || value < min) {
const n = typeof min === 'bigint' ? 'n' : ''
let range
if (byteLength > 3) {
if (min === 0 || min === BigInt(0)) {
range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`
} else {
range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +
`${(byteLength + 1) * 8 - 1}${n}`
}
} else {
range = `>= ${min}${n} and <= ${max}${n}`
}
throw new errors.ERR_OUT_OF_RANGE('value', range, value)
}
checkBounds(buf, offset, byteLength)
}
function validateNumber (value, name) {
if (typeof value !== 'number') {
throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)
}
}
function boundsError (value, length, type) {
if (Math.floor(value) !== value) {
validateNumber(value, type)
throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)
}
if (length < 0) {
throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()
}
throw new errors.ERR_OUT_OF_RANGE(type || 'offset',
`>= ${type ? 1 : 0} and <= ${length}`,
value)
}
// HELPER FUNCTIONS
// ================
const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
function base64clean (str) {
// Node takes equal signs as end of the Base64 encoding
str = str.split('=')[0]
// Node strips out invalid characters like \n and \t from the string, base64-js does not
str = str.trim().replace(INVALID_BASE64_RE, '')
// Node converts strings with length < 2 to ''
if (str.length < 2) return ''
// Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
while (str.length % 4 !== 0) {
str = str + '='
}
return str
}
function utf8ToBytes (string, units) {
units = units || Infinity
let codePoint
const length = string.length
let leadSurrogate = null
const bytes = []
for (let i = 0; i < length; ++i) {
codePoint = string.charCodeAt(i)
// is surrogate component
if (codePoint > 0xD7FF && codePoint < 0xE000) {
// last char was a lead
if (!leadSurrogate) {
// no lead yet
if (codePoint > 0xDBFF) {
// unexpected trail
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
} else if (i + 1 === length) {
// unpaired lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
}
// valid lead
leadSurrogate = codePoint
continue
}
// 2 leads in a row
if (codePoint < 0xDC00) {
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
leadSurrogate = codePoint
continue
}
// valid surrogate pair
codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
} else if (leadSurrogate) {
// valid bmp char, but last char was a lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
}
leadSurrogate = null
// encode utf8
if (codePoint < 0x80) {
if ((units -= 1) < 0) break
bytes.push(codePoint)
} else if (codePoint < 0x800) {
if ((units -= 2) < 0) break
bytes.push(
codePoint >> 0x6 | 0xC0,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x10000) {
if ((units -= 3) < 0) break
bytes.push(
codePoint >> 0xC | 0xE0,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x110000) {
if ((units -= 4) < 0) break
bytes.push(
codePoint >> 0x12 | 0xF0,
codePoint >> 0xC & 0x3F | 0x80,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else {
throw new Error('Invalid code point')
}
}
return bytes
}
function asciiToBytes (str) {
const byteArray = []
for (let i = 0; i < str.length; ++i) {
// Node's code seems to be doing this and not & 0x7F..
byteArray.push(str.charCodeAt(i) & 0xFF)
}
return byteArray
}
function utf16leToBytes (str, units) {
let c, hi, lo
const byteArray = []
for (let i = 0; i < str.length; ++i) {
if ((units -= 2) < 0) break
c = str.charCodeAt(i)
hi = c >> 8
lo = c % 256
byteArray.push(lo)
byteArray.push(hi)
}
return byteArray
}
function base64ToBytes (str) {
return base64.toByteArray(base64clean(str))
}
function blitBuffer (src, dst, offset, length) {
let i
for (i = 0; i < length; ++i) {
if ((i + offset >= dst.length) || (i >= src.length)) break
dst[i + offset] = src[i]
}
return i
}
// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass
// the `instanceof` check but they should be treated as of that type.
// See: https://github.com/feross/buffer/issues/166
function isInstance (obj, type) {
return obj instanceof type ||
(obj != null && obj.constructor != null && obj.constructor.name != null &&
obj.constructor.name === type.name)
}
function numberIsNaN (obj) {
// For IE11 support
return obj !== obj // eslint-disable-line no-self-compare
}
// Create lookup table for `toString('hex')`
// See: https://github.com/feross/buffer/issues/219
const hexSliceLookupTable = (function () {
const alphabet = '0123456789abcdef'
const table = new Array(256)
for (let i = 0; i < 16; ++i) {
const i16 = i * 16
for (let j = 0; j < 16; ++j) {
table[i16 + j] = alphabet[i] + alphabet[j]
}
}
return table
})()
// Return not function with Error if BigInt not supported
function defineBigIntMethod (fn) {
return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn
}
function BufferBigIntNotDefined () {
throw new Error('BigInt not supported')
}
/***/ }),
/***/ 645:
/***/ ((__unused_webpack_module, exports) => {
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
var e, m
var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var nBits = -7
var i = isLE ? (nBytes - 1) : 0
var d = isLE ? -1 : 1
var s = buffer[offset + i]
i += d
e = s & ((1 << (-nBits)) - 1)
s >>= (-nBits)
nBits += eLen
for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
m = e & ((1 << (-nBits)) - 1)
e >>= (-nBits)
nBits += mLen
for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
if (e === 0) {
e = 1 - eBias
} else if (e === eMax) {
return m ? NaN : ((s ? -1 : 1) * Infinity)
} else {
m = m + Math.pow(2, mLen)
e = e - eBias
}
return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
}
exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
var e, m, c
var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
var i = isLE ? 0 : (nBytes - 1)
var d = isLE ? 1 : -1
var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
value = Math.abs(value)
if (isNaN(value) || value === Infinity) {
m = isNaN(value) ? 1 : 0
e = eMax
} else {
e = Math.floor(Math.log(value) / Math.LN2)
if (value * (c = Math.pow(2, -e)) < 1) {
e--
c *= 2
}
if (e + eBias >= 1) {
value += rt / c
} else {
value += rt * Math.pow(2, 1 - eBias)
}
if (value * c >= 2) {
e++
c /= 2
}
if (e + eBias >= eMax) {
m = 0
e = eMax
} else if (e + eBias >= 1) {
m = ((value * c) - 1) * Math.pow(2, mLen)
e = e + eBias
} else {
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
e = 0
}
}
for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
e = (e << mLen) | m
eLen += mLen
for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
buffer[offset + i - d] |= s * 128
}
/***/ }),
/***/ 874:
/***/ (() => {
(function (Prism) {
// $ set | grep '^[A-Z][^[:space:]]*=' | cut -d= -f1 | tr '\n' '|'
// + LC_ALL, RANDOM, REPLY, SECONDS.
// + make sure PS1..4 are here as they are not always set,
// - some useless things.
var envVars = '\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b';
var commandAfterHeredoc = {
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
lookbehind: true,
alias: 'punctuation', // this looks reasonably well in all themes
inside: null // see below
};
var insideString = {
'bash': commandAfterHeredoc,
'environment': {
pattern: RegExp('\\$' + envVars),
alias: 'constant'
},
'variable': [
// [0]: Arithmetic Environment
{
pattern: /\$?\(\([\s\S]+?\)\)/,
greedy: true,
inside: {
// If there is a $ sign at the beginning highlight $(( and )) as variable
'variable': [
{
pattern: /(^\$\(\([\s\S]+)\)\)/,
lookbehind: true
},
/^\$\(\(/
],
'number': /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
// Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
'operator': /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
// If there is no $ sign at the beginning highlight (( and )) as punctuation
'punctuation': /\(\(?|\)\)?|,|;/
}
},
// [1]: Command Substitution
{
pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
greedy: true,
inside: {
'variable': /^\$\(|^`|\)$|`$/
}
},
// [2]: Brace expansion
{
pattern: /\$\{[^}]+\}/,
greedy: true,
inside: {
'operator': /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
'punctuation': /[\[\]]/,
'environment': {
pattern: RegExp('(\\{)' + envVars),
lookbehind: true,
alias: 'constant'
}
}
},
/\$(?:\w+|[#?*!@$])/
],
// Escape sequences from echo and printf's manuals, and escaped quotes.
'entity': /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
};
Prism.languages.bash = {
'shebang': {
pattern: /^#!\s*\/.*/,
alias: 'important'
},
'comment': {
pattern: /(^|[^"{\\$])#.*/,
lookbehind: true
},
'function-name': [
// a) function foo {
// b) foo() {
// c) function foo() {
// but not “foo {”
{
// a) and c)
pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
lookbehind: true,
alias: 'function'
},
{
// b)
pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
alias: 'function'
}
],
// Highlight variable names as variables in for and select beginnings.
'for-or-select': {
pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
alias: 'variable',
lookbehind: true
},
// Highlight variable names as variables in the left-hand part
// of assignments (“=” and “+=”).
'assign-left': {
pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
inside: {
'environment': {
pattern: RegExp('(^|[\\s;|&]|[<>]\\()' + envVars),
lookbehind: true,
alias: 'constant'
}
},
alias: 'variable',
lookbehind: true
},
// Highlight parameter names as variables
'parameter': {
pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
alias: 'variable',
lookbehind: true
},
'string': [
// Support for Here-documents https://en.wikipedia.org/wiki/Here_document
{
pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
lookbehind: true,
greedy: true,
inside: insideString
},
// Here-document with quotes around the tag
// → No expansion (so no “inside”).
{
pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
lookbehind: true,
greedy: true,
inside: {
'bash': commandAfterHeredoc
}
},
// “Normal” string
{
// https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
lookbehind: true,
greedy: true,
inside: insideString
},
{
// https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
pattern: /(^|[^$\\])'[^']*'/,
lookbehind: true,
greedy: true
},
{
// https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
greedy: true,
inside: {
'entity': insideString.entity
}
}
],
'environment': {
pattern: RegExp('\\$?' + envVars),
alias: 'constant'
},
'variable': insideString.variable,
'function': {
pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
lookbehind: true
},
'keyword': {
pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
lookbehind: true
},
// https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
'builtin': {
pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
lookbehind: true,
// Alias added to make those easier to distinguish from strings.
alias: 'class-name'
},
'boolean': {
pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
lookbehind: true
},
'file-descriptor': {
pattern: /\B&\d\b/,
alias: 'important'
},
'operator': {
// Lots of redirections here, but not just that.
pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
inside: {
'file-descriptor': {
pattern: /^\d/,
alias: 'important'
}
}
},
'punctuation': /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
'number': {
pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
lookbehind: true
}
};
commandAfterHeredoc.inside = Prism.languages.bash;
/* Patterns in command substitution. */
var toBeCopied = [
'comment',
'function-name',
'for-or-select',
'assign-left',
'parameter',
'string',
'environment',
'function',
'keyword',
'builtin',
'boolean',
'file-descriptor',
'operator',
'punctuation',
'number'
];
var inside = insideString.variable[1].inside;
for (var i = 0; i < toBeCopied.length; i++) {
inside[toBeCopied[i]] = Prism.languages.bash[toBeCopied[i]];
}
Prism.languages.sh = Prism.languages.bash;
Prism.languages.shell = Prism.languages.bash;
}(Prism));
/***/ }),
/***/ 16:
/***/ (() => {
(function (Prism) {
/**
* Replaces all placeholders "<<n>>" of given pattern with the n-th replacement (zero based).
*
* Note: This is a simple text based replacement. Be careful when using backreferences!
*
* @param {string} pattern the given pattern.
* @param {string[]} replacements a list of replacement which can be inserted into the given pattern.
* @returns {string} the pattern with all placeholders replaced with their corresponding replacements.
* @example replace(/a<<0>>a/.source, [/b+/.source]) === /a(?:b+)a/.source
*/
function replace(pattern, replacements) {
return pattern.replace(/<<(\d+)>>/g, function (m, index) {
return '(?:' + replacements[+index] + ')';
});
}
/**
* @param {string} pattern
* @param {string[]} replacements
* @param {string} [flags]
* @returns {RegExp}
*/
function re(pattern, replacements, flags) {
return RegExp(replace(pattern, replacements), flags || '');
}
/**
* Creates a nested pattern where all occurrences of the string `<<self>>` are replaced with the pattern itself.
*
* @param {string} pattern
* @param {number} depthLog2
* @returns {string}
*/
function nested(pattern, depthLog2) {
for (var i = 0; i < depthLog2; i++) {
pattern = pattern.replace(/<<self>>/g, function () { return '(?:' + pattern + ')'; });
}
return pattern.replace(/<<self>>/g, '[^\\s\\S]');
}
// https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/
var keywordKinds = {
// keywords which represent a return or variable type
type: 'bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void',
// keywords which are used to declare a type
typeDeclaration: 'class enum interface record struct',
// contextual keywords
// ("var" and "dynamic" are missing because they are used like types)
contextual: 'add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)',
// all other keywords
other: 'abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield'
};
// keywords
function keywordsToPattern(words) {
return '\\b(?:' + words.trim().replace(/ /g, '|') + ')\\b';
}
var typeDeclarationKeywords = keywordsToPattern(keywordKinds.typeDeclaration);
var keywords = RegExp(keywordsToPattern(keywordKinds.type + ' ' + keywordKinds.typeDeclaration + ' ' + keywordKinds.contextual + ' ' + keywordKinds.other));
var nonTypeKeywords = keywordsToPattern(keywordKinds.typeDeclaration + ' ' + keywordKinds.contextual + ' ' + keywordKinds.other);
var nonContextualKeywords = keywordsToPattern(keywordKinds.type + ' ' + keywordKinds.typeDeclaration + ' ' + keywordKinds.other);
// types
var generic = nested(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source, 2); // the idea behind the other forbidden characters is to prevent false positives. Same for tupleElement.
var nestedRound = nested(/\((?:[^()]|<<self>>)*\)/.source, 2);
var name = /@?\b[A-Za-z_]\w*\b/.source;
var genericName = replace(/<<0>>(?:\s*<<1>>)?/.source, [name, generic]);
var identifier = replace(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source, [nonTypeKeywords, genericName]);
var array = /\[\s*(?:,\s*)*\]/.source;
var typeExpressionWithoutTuple = replace(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source, [identifier, array]);
var tupleElement = replace(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source, [generic, nestedRound, array]);
var tuple = replace(/\(<<0>>+(?:,<<0>>+)+\)/.source, [tupleElement]);
var typeExpression = replace(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source, [tuple, identifier, array]);
var typeInside = {
'keyword': keywords,
'punctuation': /[<>()?,.:[\]]/
};
// strings & characters
// https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#character-literals
// https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#string-literals
var character = /'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source; // simplified pattern
var regularString = /"(?:\\.|[^\\"\r\n])*"/.source;
var verbatimString = /@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;
Prism.languages.csharp = Prism.languages.extend('clike', {
'string': [
{
pattern: re(/(^|[^$\\])<<0>>/.source, [verbatimString]),
lookbehind: true,
greedy: true
},
{
pattern: re(/(^|[^@$\\])<<0>>/.source, [regularString]),
lookbehind: true,
greedy: true
}
],
'class-name': [
{
// Using static
// using static System.Math;
pattern: re(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source, [identifier]),
lookbehind: true,
inside: typeInside
},
{
// Using alias (type)
// using Project = PC.MyCompany.Project;
pattern: re(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source, [name, typeExpression]),
lookbehind: true,
inside: typeInside
},
{
// Using alias (alias)
// using Project = PC.MyCompany.Project;
pattern: re(/(\busing\s+)<<0>>(?=\s*=)/.source, [name]),
lookbehind: true
},
{
// Type declarations
// class Foo<A, B>
// interface Foo<out A, B>
pattern: re(/(\b<<0>>\s+)<<1>>/.source, [typeDeclarationKeywords, genericName]),
lookbehind: true,
inside: typeInside
},
{
// Single catch exception declaration
// catch(Foo)
// (things like catch(Foo e) is covered by variable declaration)
pattern: re(/(\bcatch\s*\(\s*)<<0>>/.source, [identifier]),
lookbehind: true,
inside: typeInside
},
{
// Name of the type parameter of generic constraints
// where Foo : class
pattern: re(/(\bwhere\s+)<<0>>/.source, [name]),
lookbehind: true
},
{
// Casts and checks via as and is.
// as Foo<A>, is Bar<B>
// (things like if(a is Foo b) is covered by variable declaration)
pattern: re(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source, [typeExpressionWithoutTuple]),
lookbehind: true,
inside: typeInside
},
{
// Variable, field and parameter declaration
// (Foo bar, Bar baz, Foo[,,] bay, Foo<Bar, FooBar<Bar>> bax)
pattern: re(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source, [typeExpression, nonContextualKeywords, name]),
inside: typeInside
}
],
'keyword': keywords,
// https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#literals
'number': /(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,
'operator': />>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,
'punctuation': /\?\.?|::|[{}[\];(),.:]/
});
Prism.languages.insertBefore('csharp', 'number', {
'range': {
pattern: /\.\./,
alias: 'operator'
}
});
Prism.languages.insertBefore('csharp', 'punctuation', {
'named-parameter': {
pattern: re(/([(,]\s*)<<0>>(?=\s*:)/.source, [name]),
lookbehind: true,
alias: 'punctuation'
}
});
Prism.languages.insertBefore('csharp', 'class-name', {
'namespace': {
// namespace Foo.Bar {}
// using Foo.Bar;
pattern: re(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source, [name]),
lookbehind: true,
inside: {
'punctuation': /\./
}
},
'type-expression': {
// default(Foo), typeof(Foo<Bar>), sizeof(int)
pattern: re(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source, [nestedRound]),
lookbehind: true,
alias: 'class-name',
inside: typeInside
},
'return-type': {
// Foo<Bar> ForBar(); Foo IFoo.Bar() => 0
// int this[int index] => 0; T IReadOnlyList<T>.this[int index] => this[index];
// int Foo => 0; int Foo { get; set } = 0;
pattern: re(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source, [typeExpression, identifier]),
inside: typeInside,
alias: 'class-name'
},
'constructor-invocation': {
// new List<Foo<Bar[]>> { }
pattern: re(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [typeExpression]),
lookbehind: true,
inside: typeInside,
alias: 'class-name'
},
/*'explicit-implementation': {
// int IFoo<Foo>.Bar => 0; void IFoo<Foo<Foo>>.Foo<T>();
pattern: replace(/\b<<0>>(?=\.<<1>>)/, className, methodOrPropertyDeclaration),
inside: classNameInside,
alias: 'class-name'
},*/
'generic-method': {
// foo<Bar>()
pattern: re(/<<0>>\s*<<1>>(?=\s*\()/.source, [name, generic]),
inside: {
'function': re(/^<<0>>/.source, [name]),
'generic': {
pattern: RegExp(generic),
alias: 'class-name',
inside: typeInside
}
}
},
'type-list': {
// The list of types inherited or of generic constraints
// class Foo<F> : Bar, IList<FooBar>
// where F : Bar, IList<int>
pattern: re(
/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,
[typeDeclarationKeywords, genericName, name, typeExpression, keywords.source, nestedRound, /\bnew\s*\(\s*\)/.source]
),
lookbehind: true,
inside: {
'record-arguments': {
pattern: re(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source, [genericName, nestedRound]),
lookbehind: true,
greedy: true,
inside: Prism.languages.csharp
},
'keyword': keywords,
'class-name': {
pattern: RegExp(typeExpression),
greedy: true,
inside: typeInside
},
'punctuation': /[,()]/
}
},
'preprocessor': {
pattern: /(^[\t ]*)#.*/m,
lookbehind: true,
alias: 'property',
inside: {
// highlight preprocessor directives as keywords
'directive': {
pattern: /(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,
lookbehind: true,
alias: 'keyword'
}
}
}
});
// attributes
var regularStringOrCharacter = regularString + '|' + character;
var regularStringCharacterOrComment = replace(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source, [regularStringOrCharacter]);
var roundExpression = nested(replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [regularStringCharacterOrComment]), 2);
// https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/attributes/#attribute-targets
var attrTarget = /\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source;
var attr = replace(/<<0>>(?:\s*\(<<1>>*\))?/.source, [identifier, roundExpression]);
Prism.languages.insertBefore('csharp', 'class-name', {
'attribute': {
// Attributes
// [Foo], [Foo(1), Bar(2, Prop = "foo")], [return: Foo(1), Bar(2)], [assembly: Foo(Bar)]
pattern: re(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source, [attrTarget, attr]),
lookbehind: true,
greedy: true,
inside: {
'target': {
pattern: re(/^<<0>>(?=\s*:)/.source, [attrTarget]),
alias: 'keyword'
},
'attribute-arguments': {
pattern: re(/\(<<0>>*\)/.source, [roundExpression]),
inside: Prism.languages.csharp
},
'class-name': {
pattern: RegExp(identifier),
inside: {
'punctuation': /\./
}
},
'punctuation': /[:,]/
}
}
});
// string interpolation
var formatString = /:[^}\r\n]+/.source;
// multi line
var mInterpolationRound = nested(replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [regularStringCharacterOrComment]), 2);
var mInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [mInterpolationRound, formatString]);
// single line
var sInterpolationRound = nested(replace(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source, [regularStringOrCharacter]), 2);
var sInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [sInterpolationRound, formatString]);
function createInterpolationInside(interpolation, interpolationRound) {
return {
'interpolation': {
pattern: re(/((?:^|[^{])(?:\{\{)*)<<0>>/.source, [interpolation]),
lookbehind: true,
inside: {
'format-string': {
pattern: re(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source, [interpolationRound, formatString]),
lookbehind: true,
inside: {
'punctuation': /^:/
}
},
'punctuation': /^\{|\}$/,
'expression': {
pattern: /[\s\S]+/,
alias: 'language-csharp',
inside: Prism.languages.csharp
}
}
},
'string': /[\s\S]+/
};
}
Prism.languages.insertBefore('csharp', 'string', {
'interpolation-string': [
{
pattern: re(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source, [mInterpolation]),
lookbehind: true,
greedy: true,
inside: createInterpolationInside(mInterpolation, mInterpolationRound),
},
{
pattern: re(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source, [sInterpolation]),
lookbehind: true,
greedy: true,
inside: createInterpolationInside(sInterpolation, sInterpolationRound),
}
],
'char': {
pattern: RegExp(character),
greedy: true
}
});
Prism.languages.dotnet = Prism.languages.cs = Prism.languages.csharp;
}(Prism));
/***/ }),
/***/ 251:
/***/ (() => {
(function (Prism) {
var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
Prism.languages.css = {
'comment': /\/\*[\s\S]*?\*\//,
'atrule': {
pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source),
inside: {
'rule': /^@[\w-]+/,
'selector-function-argument': {
pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
lookbehind: true,
alias: 'selector'
},
'keyword': {
pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
lookbehind: true
}
// See rest below
}
},
'url': {
// https://drafts.csswg.org/css-values-3/#urls
pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
greedy: true,
inside: {
'function': /^url/i,
'punctuation': /^\(|\)$/,
'string': {
pattern: RegExp('^' + string.source + '$'),
alias: 'url'
}
}
},
'selector': {
pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
lookbehind: true
},
'string': {
pattern: string,
greedy: true
},
'property': {
pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
lookbehind: true
},
'important': /!important\b/i,
'function': {
pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
lookbehind: true
},
'punctuation': /[(){};:,]/
};
Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
var markup = Prism.languages.markup;
if (markup) {
markup.tag.addInlined('style', 'css');
markup.tag.addAttribute('style', 'css');
}
}(Prism));
/***/ }),
/***/ 46:
/***/ (() => {
Prism.languages.go = Prism.languages.extend('clike', {
'string': {
pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,
lookbehind: true,
greedy: true
},
'keyword': /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,
'boolean': /\b(?:_|false|iota|nil|true)\b/,
'number': [
// binary and octal integers
/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,
// hexadecimal integers and floats
/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,
// decimal integers and floats
/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i
],
'operator': /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,
'builtin': /\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/
});
Prism.languages.insertBefore('go', 'string', {
'char': {
pattern: /'(?:\\.|[^'\\\r\n]){0,10}'/,
greedy: true
}
});
delete Prism.languages.go['class-name'];
/***/ }),
/***/ 57:
/***/ (() => {
(function (Prism) {
/**
* @param {string} name
* @returns {RegExp}
*/
function headerValueOf(name) {
return RegExp('(^(?:' + name + '):[ \t]*(?![ \t]))[^]+', 'i');
}
Prism.languages.http = {
'request-line': {
pattern: /^(?:CONNECT|DELETE|GET|HEAD|OPTIONS|PATCH|POST|PRI|PUT|SEARCH|TRACE)\s(?:https?:\/\/|\/)\S*\sHTTP\/[\d.]+/m,
inside: {
// HTTP Method
'method': {
pattern: /^[A-Z]+\b/,
alias: 'property'
},
// Request Target e.g. http://example.com, /path/to/file
'request-target': {
pattern: /^(\s)(?:https?:\/\/|\/)\S*(?=\s)/,
lookbehind: true,
alias: 'url',
inside: Prism.languages.uri
},
// HTTP Version
'http-version': {
pattern: /^(\s)HTTP\/[\d.]+/,
lookbehind: true,
alias: 'property'
},
}
},
'response-status': {
pattern: /^HTTP\/[\d.]+ \d+ .+/m,
inside: {
// HTTP Version
'http-version': {
pattern: /^HTTP\/[\d.]+/,
alias: 'property'
},
// Status Code
'status-code': {
pattern: /^(\s)\d+(?=\s)/,
lookbehind: true,
alias: 'number'
},
// Reason Phrase
'reason-phrase': {
pattern: /^(\s).+/,
lookbehind: true,
alias: 'string'
}
}
},
'header': {
pattern: /^[\w-]+:.+(?:(?:\r\n?|\n)[ \t].+)*/m,
inside: {
'header-value': [
{
pattern: headerValueOf(/Content-Security-Policy/.source),
lookbehind: true,
alias: ['csp', 'languages-csp'],
inside: Prism.languages.csp
},
{
pattern: headerValueOf(/Public-Key-Pins(?:-Report-Only)?/.source),
lookbehind: true,
alias: ['hpkp', 'languages-hpkp'],
inside: Prism.languages.hpkp
},
{
pattern: headerValueOf(/Strict-Transport-Security/.source),
lookbehind: true,
alias: ['hsts', 'languages-hsts'],
inside: Prism.languages.hsts
},
{
pattern: headerValueOf(/[^:]+/.source),
lookbehind: true
}
],
'header-name': {
pattern: /^[^:]+/,
alias: 'keyword'
},
'punctuation': /^:/
}
}
};
// Create a mapping of Content-Type headers to language definitions
var langs = Prism.languages;
var httpLanguages = {
'application/javascript': langs.javascript,
'application/json': langs.json || langs.javascript,
'application/xml': langs.xml,
'text/xml': langs.xml,
'text/html': langs.html,
'text/css': langs.css,
'text/plain': langs.plain
};
// Declare which types can also be suffixes
var suffixTypes = {
'application/json': true,
'application/xml': true
};
/**
* Returns a pattern for the given content type which matches it and any type which has it as a suffix.
*
* @param {string} contentType
* @returns {string}
*/
function getSuffixPattern(contentType) {
var suffix = contentType.replace(/^[a-z]+\//, '');
var suffixPattern = '\\w+/(?:[\\w.-]+\\+)+' + suffix + '(?![+\\w.-])';
return '(?:' + contentType + '|' + suffixPattern + ')';
}
// Insert each content type parser that has its associated language
// currently loaded.
var options;
for (var contentType in httpLanguages) {
if (httpLanguages[contentType]) {
options = options || {};
var pattern = suffixTypes[contentType] ? getSuffixPattern(contentType) : contentType;
options[contentType.replace(/\//g, '-')] = {
pattern: RegExp(
'(' + /content-type:\s*/.source + pattern + /(?:(?:\r\n?|\n)[\w-].*)*(?:\r(?:\n|(?!\n))|\n)/.source + ')' +
// This is a little interesting:
// The HTTP format spec required 1 empty line before the body to make everything unambiguous.
// However, when writing code by hand (e.g. to display on a website) people can forget about this,
// so we want to be liberal here. We will allow the empty line to be omitted if the first line of
// the body does not start with a [\w-] character (as headers do).
/[^ \t\w-][\s\S]*/.source,
'i'
),
lookbehind: true,
inside: httpLanguages[contentType]
};
}
}
if (options) {
Prism.languages.insertBefore('http', 'header', options);
}
}(Prism));
/***/ }),
/***/ 503:
/***/ (() => {
(function (Prism) {
var keywords = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/;
// full package (optional) + parent classes (optional)
var classNamePrefix = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source;
// based on the java naming conventions
var className = {
pattern: RegExp(/(^|[^\w.])/.source + classNamePrefix + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
lookbehind: true,
inside: {
'namespace': {
pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,
inside: {
'punctuation': /\./
}
},
'punctuation': /\./
}
};
Prism.languages.java = Prism.languages.extend('clike', {
'string': {
pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,
lookbehind: true,
greedy: true
},
'class-name': [
className,
{
// variables, parameters, and constructor references
// this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
pattern: RegExp(/(^|[^\w.])/.source + classNamePrefix + /[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),
lookbehind: true,
inside: className.inside
},
{
// class names based on keyword
// this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
pattern: RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source + classNamePrefix + /[A-Z]\w*\b/.source),
lookbehind: true,
inside: className.inside
}
],
'keyword': keywords,
'function': [
Prism.languages.clike.function,
{
pattern: /(::\s*)[a-z_]\w*/,
lookbehind: true
}
],
'number': /\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,
'operator': {
pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,
lookbehind: true
},
'constant': /\b[A-Z][A-Z_\d]+\b/
});
Prism.languages.insertBefore('java', 'string', {
'triple-quoted-string': {
// http://openjdk.java.net/jeps/355#Description
pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
greedy: true,
alias: 'string'
},
'char': {
pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/,
greedy: true
}
});
Prism.languages.insertBefore('java', 'class-name', {
'annotation': {
pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/,
lookbehind: true,
alias: 'punctuation'
},
'generics': {
pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,
inside: {
'class-name': className,
'keyword': keywords,
'punctuation': /[<>(),.:]/,
'operator': /[?&|]/
}
},
'import': [
{
pattern: RegExp(/(\bimport\s+)/.source + classNamePrefix + /(?:[A-Z]\w*|\*)(?=\s*;)/.source),
lookbehind: true,
inside: {
'namespace': className.inside.namespace,
'punctuation': /\./,
'operator': /\*/,
'class-name': /\w+/
}
},
{
pattern: RegExp(/(\bimport\s+static\s+)/.source + classNamePrefix + /(?:\w+|\*)(?=\s*;)/.source),
lookbehind: true,
alias: 'static',
inside: {
'namespace': className.inside.namespace,
'static': /\b\w+$/,
'punctuation': /\./,
'operator': /\*/,
'class-name': /\w+/
}
}
],
'namespace': {
pattern: RegExp(
/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/
.source.replace(/<keyword>/g, function () { return keywords.source; })),
lookbehind: true,
inside: {
'punctuation': /\./,
}
}
});
}(Prism));
/***/ }),
/***/ 277:
/***/ (() => {
// https://www.json.org/json-en.html
Prism.languages.json = {
'property': {
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
lookbehind: true,
greedy: true
},
'string': {
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
lookbehind: true,
greedy: true
},
'comment': {
pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
greedy: true
},
'number': /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
'punctuation': /[{}[\],]/,
'operator': /:/,
'boolean': /\b(?:false|true)\b/,
'null': {
pattern: /\bnull\b/,
alias: 'keyword'
}
};
Prism.languages.webmanifest = Prism.languages.json;
/***/ }),
/***/ 366:
/***/ (() => {
Prism.languages.python = {
'comment': {
pattern: /(^|[^\\])#.*/,
lookbehind: true,
greedy: true
},
'string-interpolation': {
pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
greedy: true,
inside: {
'interpolation': {
// "{" <expression> <optional "!s", "!r", or "!a"> <optional ":" format specifier> "}"
pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
lookbehind: true,
inside: {
'format-spec': {
pattern: /(:)[^:(){}]+(?=\}$)/,
lookbehind: true
},
'conversion-option': {
pattern: /![sra](?=[:}]$)/,
alias: 'punctuation'
},
rest: null
}
},
'string': /[\s\S]+/
}
},
'triple-quoted-string': {
pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
greedy: true,
alias: 'string'
},
'string': {
pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
greedy: true
},
'function': {
pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
lookbehind: true
},
'class-name': {
pattern: /(\bclass\s+)\w+/i,
lookbehind: true
},
'decorator': {
pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
lookbehind: true,
alias: ['annotation', 'punctuation'],
inside: {
'punctuation': /\./
}
},
'keyword': /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
'builtin': /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
'boolean': /\b(?:False|None|True)\b/,
'number': /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
'operator': /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
'punctuation': /[{}[\];(),.:]/
};
Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python;
Prism.languages.py = Prism.languages.python;
/***/ }),
/***/ 358:
/***/ (() => {
(function (Prism) {
// https://yaml.org/spec/1.2/spec.html#c-ns-anchor-property
// https://yaml.org/spec/1.2/spec.html#c-ns-alias-node
var anchorOrAlias = /[*&][^\s[\]{},]+/;
// https://yaml.org/spec/1.2/spec.html#c-ns-tag-property
var tag = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/;
// https://yaml.org/spec/1.2/spec.html#c-ns-properties(n,c)
var properties = '(?:' + tag.source + '(?:[ \t]+' + anchorOrAlias.source + ')?|'
+ anchorOrAlias.source + '(?:[ \t]+' + tag.source + ')?)';
// https://yaml.org/spec/1.2/spec.html#ns-plain(n,c)
// This is a simplified version that doesn't support "#" and multiline keys
// All these long scarry character classes are simplified versions of YAML's characters
var plainKey = /(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source
.replace(/<PLAIN>/g, function () { return /[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source; });
var string = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;
/**
*
* @param {string} value
* @param {string} [flags]
* @returns {RegExp}
*/
function createValuePattern(value, flags) {
flags = (flags || '').replace(/m/g, '') + 'm'; // add m flag
var pattern = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source
.replace(/<<prop>>/g, function () { return properties; }).replace(/<<value>>/g, function () { return value; });
return RegExp(pattern, flags);
}
Prism.languages.yaml = {
'scalar': {
pattern: RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source
.replace(/<<prop>>/g, function () { return properties; })),
lookbehind: true,
alias: 'string'
},
'comment': /#.*/,
'key': {
pattern: RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source
.replace(/<<prop>>/g, function () { return properties; })
.replace(/<<key>>/g, function () { return '(?:' + plainKey + '|' + string + ')'; })),
lookbehind: true,
greedy: true,
alias: 'atrule'
},
'directive': {
pattern: /(^[ \t]*)%.+/m,
lookbehind: true,
alias: 'important'
},
'datetime': {
pattern: createValuePattern(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),
lookbehind: true,
alias: 'number'
},
'boolean': {
pattern: createValuePattern(/false|true/.source, 'i'),
lookbehind: true,
alias: 'important'
},
'null': {
pattern: createValuePattern(/null|~/.source, 'i'),
lookbehind: true,
alias: 'important'
},
'string': {
pattern: createValuePattern(string),
lookbehind: true,
greedy: true
},
'number': {
pattern: createValuePattern(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source, 'i'),
lookbehind: true
},
'tag': tag,
'important': anchorOrAlias,
'punctuation': /---|[:[\]{}\-,|>?]|\.\.\./
};
Prism.languages.yml = Prism.languages.yaml;
}(Prism));
/***/ }),
/***/ 660:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/* **********************************************
Begin prism-core.js
********************************************** */
/// <reference lib="WebWorker"/>
var _self = (typeof window !== 'undefined')
? window // if in browser
: (
(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)
? self // if in worker
: {} // if in node js
);
/**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/
var Prism = (function (_self) {
// Private helper vars
var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
var uniqueId = 0;
// The grammar object for plaintext
var plainTextGrammar = {};
var _ = {
/**
* By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
* current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
* additional languages or plugins yourself.
*
* By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
*
* You obviously have to change this value before the automatic highlighting started. To do this, you can add an
* empty Prism object into the global scope before loading the Prism script like this:
*
* ```js
* window.Prism = window.Prism || {};
* Prism.manual = true;
* // add a new <script> to load Prism's script
* ```
*
* @default false
* @type {boolean}
* @memberof Prism
* @public
*/
manual: _self.Prism && _self.Prism.manual,
/**
* By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
* `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
* own worker, you don't want it to do this.
*
* By setting this value to `true`, Prism will not add its own listeners to the worker.
*
* You obviously have to change this value before Prism executes. To do this, you can add an
* empty Prism object into the global scope before loading the Prism script like this:
*
* ```js
* window.Prism = window.Prism || {};
* Prism.disableWorkerMessageHandler = true;
* // Load Prism's script
* ```
*
* @default false
* @type {boolean}
* @memberof Prism
* @public
*/
disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
/**
* A namespace for utility methods.
*
* All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
* change or disappear at any time.
*
* @namespace
* @memberof Prism
*/
util: {
encode: function encode(tokens) {
if (tokens instanceof Token) {
return new Token(tokens.type, encode(tokens.content), tokens.alias);
} else if (Array.isArray(tokens)) {
return tokens.map(encode);
} else {
return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
}
},
/**
* Returns the name of the type of the given value.
*
* @param {any} o
* @returns {string}
* @example
* type(null) === 'Null'
* type(undefined) === 'Undefined'
* type(123) === 'Number'
* type('foo') === 'String'
* type(true) === 'Boolean'
* type([1, 2]) === 'Array'
* type({}) === 'Object'
* type(String) === 'Function'
* type(/abc+/) === 'RegExp'
*/
type: function (o) {
return Object.prototype.toString.call(o).slice(8, -1);
},
/**
* Returns a unique number for the given object. Later calls will still return the same number.
*
* @param {Object} obj
* @returns {number}
*/
objId: function (obj) {
if (!obj['__id']) {
Object.defineProperty(obj, '__id', { value: ++uniqueId });
}
return obj['__id'];
},
/**
* Creates a deep clone of the given object.
*
* The main intended use of this function is to clone language definitions.
*
* @param {T} o
* @param {Record<number, any>} [visited]
* @returns {T}
* @template T
*/
clone: function deepClone(o, visited) {
visited = visited || {};
var clone; var id;
switch (_.util.type(o)) {
case 'Object':
id = _.util.objId(o);
if (visited[id]) {
return visited[id];
}
clone = /** @type {Record<string, any>} */ ({});
visited[id] = clone;
for (var key in o) {
if (o.hasOwnProperty(key)) {
clone[key] = deepClone(o[key], visited);
}
}
return /** @type {any} */ (clone);
case 'Array':
id = _.util.objId(o);
if (visited[id]) {
return visited[id];
}
clone = [];
visited[id] = clone;
(/** @type {Array} */(/** @type {any} */(o))).forEach(function (v, i) {
clone[i] = deepClone(v, visited);
});
return /** @type {any} */ (clone);
default:
return o;
}
},
/**
* Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
*
* If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
*
* @param {Element} element
* @returns {string}
*/
getLanguage: function (element) {
while (element) {
var m = lang.exec(element.className);
if (m) {
return m[1].toLowerCase();
}
element = element.parentElement;
}
return 'none';
},
/**
* Sets the Prism `language-xxxx` class of the given element.
*
* @param {Element} element
* @param {string} language
* @returns {void}
*/
setLanguage: function (element, language) {
// remove all `language-xxxx` classes
// (this might leave behind a leading space)
element.className = element.className.replace(RegExp(lang, 'gi'), '');
// add the new `language-xxxx` class
// (using `classList` will automatically clean up spaces for us)
element.classList.add('language-' + language);
},
/**
* Returns the script element that is currently executing.
*
* This does __not__ work for line script element.
*
* @returns {HTMLScriptElement | null}
*/
currentScript: function () {
if (typeof document === 'undefined') {
return null;
}
if ('currentScript' in document && 1 < 2 /* hack to trip TS' flow analysis */) {
return /** @type {any} */ (document.currentScript);
}
// IE11 workaround
// we'll get the src of the current script by parsing IE11's error stack trace
// this will not work for inline scripts
try {
throw new Error();
} catch (err) {
// Get file src url from stack. Specifically works with the format of stack traces in IE.
// A stack will look like this:
//
// Error
// at _.util.currentScript (http://localhost/components/prism-core.js:119:5)
// at Global code (http://localhost/components/prism-core.js:606:1)
var src = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(err.stack) || [])[1];
if (src) {
var scripts = document.getElementsByTagName('script');
for (var i in scripts) {
if (scripts[i].src == src) {
return scripts[i];
}
}
}
return null;
}
},
/**
* Returns whether a given class is active for `element`.
*
* The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
* if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
* given class is just the given class with a `no-` prefix.
*
* Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
* closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
* ancestors have the given class or the negated version of it, then the default activation will be returned.
*
* In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
* version of it, the class is considered active.
*
* @param {Element} element
* @param {string} className
* @param {boolean} [defaultActivation=false]
* @returns {boolean}
*/
isActive: function (element, className, defaultActivation) {
var no = 'no-' + className;
while (element) {
var classList = element.classList;
if (classList.contains(className)) {
return true;
}
if (classList.contains(no)) {
return false;
}
element = element.parentElement;
}
return !!defaultActivation;
}
},
/**
* This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
*
* @namespace
* @memberof Prism
* @public
*/
languages: {
/**
* The grammar for plain, unformatted text.
*/
plain: plainTextGrammar,
plaintext: plainTextGrammar,
text: plainTextGrammar,
txt: plainTextGrammar,
/**
* Creates a deep copy of the language with the given id and appends the given tokens.
*
* If a token in `redef` also appears in the copied language, then the existing token in the copied language
* will be overwritten at its original position.
*
* ## Best practices
*
* Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
* doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
* understand the language definition because, normally, the order of tokens matters in Prism grammars.
*
* Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
* Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
*
* @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
* @param {Grammar} redef The new tokens to append.
* @returns {Grammar} The new language created.
* @public
* @example
* Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
* // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
* // at its original position
* 'comment': { ... },
* // CSS doesn't have a 'color' token, so this token will be appended
* 'color': /\b(?:red|green|blue)\b/
* });
*/
extend: function (id, redef) {
var lang = _.util.clone(_.languages[id]);
for (var key in redef) {
lang[key] = redef[key];
}
return lang;
},
/**
* Inserts tokens _before_ another token in a language definition or any other grammar.
*
* ## Usage
*
* This helper method makes it easy to modify existing languages. For example, the CSS language definition
* not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
* in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
* appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
* this:
*
* ```js
* Prism.languages.markup.style = {
* // token
* };
* ```
*
* then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
* before existing tokens. For the CSS example above, you would use it like this:
*
* ```js
* Prism.languages.insertBefore('markup', 'cdata', {
* 'style': {
* // token
* }
* });
* ```
*
* ## Special cases
*
* If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
* will be ignored.
*
* This behavior can be used to insert tokens after `before`:
*
* ```js
* Prism.languages.insertBefore('markup', 'comment', {
* 'comment': Prism.languages.markup.comment,
* // tokens after 'comment'
* });
* ```
*
* ## Limitations
*
* The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
* properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
* differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
* deleting properties which is necessary to insert at arbitrary positions.
*
* To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
* Instead, it will create a new object and replace all references to the target object with the new one. This
* can be done without temporarily deleting properties, so the iteration order is well-defined.
*
* However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
* you hold the target object in a variable, then the value of the variable will not change.
*
* ```js
* var oldMarkup = Prism.languages.markup;
* var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
*
* assert(oldMarkup !== Prism.languages.markup);
* assert(newMarkup === Prism.languages.markup);
* ```
*
* @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
* object to be modified.
* @param {string} before The key to insert before.
* @param {Grammar} insert An object containing the key-value pairs to be inserted.
* @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
* object to be modified.
*
* Defaults to `Prism.languages`.
* @returns {Grammar} The new grammar object.
* @public
*/
insertBefore: function (inside, before, insert, root) {
root = root || /** @type {any} */ (_.languages);
var grammar = root[inside];
/** @type {Grammar} */
var ret = {};
for (var token in grammar) {
if (grammar.hasOwnProperty(token)) {
if (token == before) {
for (var newToken in insert) {
if (insert.hasOwnProperty(newToken)) {
ret[newToken] = insert[newToken];
}
}
}
// Do not insert token which also occur in insert. See #1525
if (!insert.hasOwnProperty(token)) {
ret[token] = grammar[token];
}
}
}
var old = root[inside];
root[inside] = ret;
// Update references in other language definitions
_.languages.DFS(_.languages, function (key, value) {
if (value === old && key != inside) {
this[key] = ret;
}
});
return ret;
},
// Traverse a language definition with Depth First Search
DFS: function DFS(o, callback, type, visited) {
visited = visited || {};
var objId = _.util.objId;
for (var i in o) {
if (o.hasOwnProperty(i)) {
callback.call(o, i, o[i], type || i);
var property = o[i];
var propertyType = _.util.type(property);
if (propertyType === 'Object' && !visited[objId(property)]) {
visited[objId(property)] = true;
DFS(property, callback, null, visited);
} else if (propertyType === 'Array' && !visited[objId(property)]) {
visited[objId(property)] = true;
DFS(property, callback, i, visited);
}
}
}
}
},
plugins: {},
/**
* This is the most high-level function in Prisms API.
* It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
* each one of them.
*
* This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
*
* @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
* @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
* @memberof Prism
* @public
*/
highlightAll: function (async, callback) {
_.highlightAllUnder(document, async, callback);
},
/**
* Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
* {@link Prism.highlightElement} on each one of them.
*
* The following hooks will be run:
* 1. `before-highlightall`
* 2. `before-all-elements-highlight`
* 3. All hooks of {@link Prism.highlightElement} for each element.
*
* @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
* @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
* @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
* @memberof Prism
* @public
*/
highlightAllUnder: function (container, async, callback) {
var env = {
callback: callback,
container: container,
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
};
_.hooks.run('before-highlightall', env);
env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
_.hooks.run('before-all-elements-highlight', env);
for (var i = 0, element; (element = env.elements[i++]);) {
_.highlightElement(element, async === true, env.callback);
}
},
/**
* Highlights the code inside a single element.
*
* The following hooks will be run:
* 1. `before-sanity-check`
* 2. `before-highlight`
* 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
* 4. `before-insert`
* 5. `after-highlight`
* 6. `complete`
*
* Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
* the element's language.
*
* @param {Element} element The element containing the code.
* It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
* @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
* to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
* [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
*
* Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
* asynchronous highlighting to work. You can build your own bundle on the
* [Download page](https://prismjs.com/download.html).
* @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
* Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
* @memberof Prism
* @public
*/
highlightElement: function (element, async, callback) {
// Find language
var language = _.util.getLanguage(element);
var grammar = _.languages[language];
// Set language on the element, if not present
_.util.setLanguage(element, language);
// Set language on the parent, for styling
var parent = element.parentElement;
if (parent && parent.nodeName.toLowerCase() === 'pre') {
_.util.setLanguage(parent, language);
}
var code = element.textContent;
var env = {
element: element,
language: language,
grammar: grammar,
code: code
};
function insertHighlightedCode(highlightedCode) {
env.highlightedCode = highlightedCode;
_.hooks.run('before-insert', env);
env.element.innerHTML = env.highlightedCode;
_.hooks.run('after-highlight', env);
_.hooks.run('complete', env);
callback && callback.call(env.element);
}
_.hooks.run('before-sanity-check', env);
// plugins may change/add the parent/element
parent = env.element.parentElement;
if (parent && parent.nodeName.toLowerCase() === 'pre' && !parent.hasAttribute('tabindex')) {
parent.setAttribute('tabindex', '0');
}
if (!env.code) {
_.hooks.run('complete', env);
callback && callback.call(env.element);
return;
}
_.hooks.run('before-highlight', env);
if (!env.grammar) {
insertHighlightedCode(_.util.encode(env.code));
return;
}
if (async && _self.Worker) {
var worker = new Worker(_.filename);
worker.onmessage = function (evt) {
insertHighlightedCode(evt.data);
};
worker.postMessage(JSON.stringify({
language: env.language,
code: env.code,
immediateClose: true
}));
} else {
insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
}
},
/**
* Low-level function, only use if you know what youre doing. It accepts a string of text as input
* and the language definitions to use, and returns a string with the HTML produced.
*
* The following hooks will be run:
* 1. `before-tokenize`
* 2. `after-tokenize`
* 3. `wrap`: On each {@link Token}.
*
* @param {string} text A string with the code to be highlighted.
* @param {Grammar} grammar An object containing the tokens to use.
*
* Usually a language definition like `Prism.languages.markup`.
* @param {string} language The name of the language definition passed to `grammar`.
* @returns {string} The highlighted HTML.
* @memberof Prism
* @public
* @example
* Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
*/
highlight: function (text, grammar, language) {
var env = {
code: text,
grammar: grammar,
language: language
};
_.hooks.run('before-tokenize', env);
if (!env.grammar) {
throw new Error('The language "' + env.language + '" has no grammar.');
}
env.tokens = _.tokenize(env.code, env.grammar);
_.hooks.run('after-tokenize', env);
return Token.stringify(_.util.encode(env.tokens), env.language);
},
/**
* This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
* and the language definitions to use, and returns an array with the tokenized code.
*
* When the language definition includes nested tokens, the function is called recursively on each of these tokens.
*
* This method could be useful in other contexts as well, as a very crude parser.
*
* @param {string} text A string with the code to be highlighted.
* @param {Grammar} grammar An object containing the tokens to use.
*
* Usually a language definition like `Prism.languages.markup`.
* @returns {TokenStream} An array of strings and tokens, a token stream.
* @memberof Prism
* @public
* @example
* let code = `var foo = 0;`;
* let tokens = Prism.tokenize(code, Prism.languages.javascript);
* tokens.forEach(token => {
* if (token instanceof Prism.Token && token.type === 'number') {
* console.log(`Found numeric literal: ${token.content}`);
* }
* });
*/
tokenize: function (text, grammar) {
var rest = grammar.rest;
if (rest) {
for (var token in rest) {
grammar[token] = rest[token];
}
delete grammar.rest;
}
var tokenList = new LinkedList();
addAfter(tokenList, tokenList.head, text);
matchGrammar(text, tokenList, grammar, tokenList.head, 0);
return toArray(tokenList);
},
/**
* @namespace
* @memberof Prism
* @public
*/
hooks: {
all: {},
/**
* Adds the given callback to the list of callbacks for the given hook.
*
* The callback will be invoked when the hook it is registered for is run.
* Hooks are usually directly run by a highlight function but you can also run hooks yourself.
*
* One callback function can be registered to multiple hooks and the same hook multiple times.
*
* @param {string} name The name of the hook.
* @param {HookCallback} callback The callback function which is given environment variables.
* @public
*/
add: function (name, callback) {
var hooks = _.hooks.all;
hooks[name] = hooks[name] || [];
hooks[name].push(callback);
},
/**
* Runs a hook invoking all registered callbacks with the given environment variables.
*
* Callbacks will be invoked synchronously and in the order in which they were registered.
*
* @param {string} name The name of the hook.
* @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
* @public
*/
run: function (name, env) {
var callbacks = _.hooks.all[name];
if (!callbacks || !callbacks.length) {
return;
}
for (var i = 0, callback; (callback = callbacks[i++]);) {
callback(env);
}
}
},
Token: Token
};
_self.Prism = _;
// Typescript note:
// The following can be used to import the Token type in JSDoc:
//
// @typedef {InstanceType<import("./prism-core")["Token"]>} Token
/**
* Creates a new token.
*
* @param {string} type See {@link Token#type type}
* @param {string | TokenStream} content See {@link Token#content content}
* @param {string|string[]} [alias] The alias(es) of the token.
* @param {string} [matchedStr=""] A copy of the full string this token was created from.
* @class
* @global
* @public
*/
function Token(type, content, alias, matchedStr) {
/**
* The type of the token.
*
* This is usually the key of a pattern in a {@link Grammar}.
*
* @type {string}
* @see GrammarToken
* @public
*/
this.type = type;
/**
* The strings or tokens contained by this token.
*
* This will be a token stream if the pattern matched also defined an `inside` grammar.
*
* @type {string | TokenStream}
* @public
*/
this.content = content;
/**
* The alias(es) of the token.
*
* @type {string|string[]}
* @see GrammarToken
* @public
*/
this.alias = alias;
// Copy of the full string this token was created from
this.length = (matchedStr || '').length | 0;
}
/**
* A token stream is an array of strings and {@link Token Token} objects.
*
* Token streams have to fulfill a few properties that are assumed by most functions (mostly internal ones) that process
* them.
*
* 1. No adjacent strings.
* 2. No empty strings.
*
* The only exception here is the token stream that only contains the empty string and nothing else.
*
* @typedef {Array<string | Token>} TokenStream
* @global
* @public
*/
/**
* Converts the given token or token stream to an HTML representation.
*
* The following hooks will be run:
* 1. `wrap`: On each {@link Token}.
*
* @param {string | Token | TokenStream} o The token or token stream to be converted.
* @param {string} language The name of current language.
* @returns {string} The HTML representation of the token or token stream.
* @memberof Token
* @static
*/
Token.stringify = function stringify(o, language) {
if (typeof o == 'string') {
return o;
}
if (Array.isArray(o)) {
var s = '';
o.forEach(function (e) {
s += stringify(e, language);
});
return s;
}
var env = {
type: o.type,
content: stringify(o.content, language),
tag: 'span',
classes: ['token', o.type],
attributes: {},
language: language
};
var aliases = o.alias;
if (aliases) {
if (Array.isArray(aliases)) {
Array.prototype.push.apply(env.classes, aliases);
} else {
env.classes.push(aliases);
}
}
_.hooks.run('wrap', env);
var attributes = '';
for (var name in env.attributes) {
attributes += ' ' + name + '="' + (env.attributes[name] || '').replace(/"/g, '&quot;') + '"';
}
return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + attributes + '>' + env.content + '</' + env.tag + '>';
};
/**
* @param {RegExp} pattern
* @param {number} pos
* @param {string} text
* @param {boolean} lookbehind
* @returns {RegExpExecArray | null}
*/
function matchPattern(pattern, pos, text, lookbehind) {
pattern.lastIndex = pos;
var match = pattern.exec(text);
if (match && lookbehind && match[1]) {
// change the match to remove the text matched by the Prism lookbehind group
var lookbehindLength = match[1].length;
match.index += lookbehindLength;
match[0] = match[0].slice(lookbehindLength);
}
return match;
}
/**
* @param {string} text
* @param {LinkedList<string | Token>} tokenList
* @param {any} grammar
* @param {LinkedListNode<string | Token>} startNode
* @param {number} startPos
* @param {RematchOptions} [rematch]
* @returns {void}
* @private
*
* @typedef RematchOptions
* @property {string} cause
* @property {number} reach
*/
function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
for (var token in grammar) {
if (!grammar.hasOwnProperty(token) || !grammar[token]) {
continue;
}
var patterns = grammar[token];
patterns = Array.isArray(patterns) ? patterns : [patterns];
for (var j = 0; j < patterns.length; ++j) {
if (rematch && rematch.cause == token + ',' + j) {
return;
}
var patternObj = patterns[j];
var inside = patternObj.inside;
var lookbehind = !!patternObj.lookbehind;
var greedy = !!patternObj.greedy;
var alias = patternObj.alias;
if (greedy && !patternObj.pattern.global) {
// Without the global flag, lastIndex won't work
var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
patternObj.pattern = RegExp(patternObj.pattern.source, flags + 'g');
}
/** @type {RegExp} */
var pattern = patternObj.pattern || patternObj;
for ( // iterate the token list and keep track of the current token/string position
var currentNode = startNode.next, pos = startPos;
currentNode !== tokenList.tail;
pos += currentNode.value.length, currentNode = currentNode.next
) {
if (rematch && pos >= rematch.reach) {
break;
}
var str = currentNode.value;
if (tokenList.length > text.length) {
// Something went terribly wrong, ABORT, ABORT!
return;
}
if (str instanceof Token) {
continue;
}
var removeCount = 1; // this is the to parameter of removeBetween
var match;
if (greedy) {
match = matchPattern(pattern, pos, text, lookbehind);
if (!match || match.index >= text.length) {
break;
}
var from = match.index;
var to = match.index + match[0].length;
var p = pos;
// find the node that contains the match
p += currentNode.value.length;
while (from >= p) {
currentNode = currentNode.next;
p += currentNode.value.length;
}
// adjust pos (and p)
p -= currentNode.value.length;
pos = p;
// the current node is a Token, then the match starts inside another Token, which is invalid
if (currentNode.value instanceof Token) {
continue;
}
// find the last node which is affected by this match
for (
var k = currentNode;
k !== tokenList.tail && (p < to || typeof k.value === 'string');
k = k.next
) {
removeCount++;
p += k.value.length;
}
removeCount--;
// replace with the new match
str = text.slice(pos, p);
match.index -= pos;
} else {
match = matchPattern(pattern, 0, str, lookbehind);
if (!match) {
continue;
}
}
// eslint-disable-next-line no-redeclare
var from = match.index;
var matchStr = match[0];
var before = str.slice(0, from);
var after = str.slice(from + matchStr.length);
var reach = pos + str.length;
if (rematch && reach > rematch.reach) {
rematch.reach = reach;
}
var removeFrom = currentNode.prev;
if (before) {
removeFrom = addAfter(tokenList, removeFrom, before);
pos += before.length;
}
removeRange(tokenList, removeFrom, removeCount);
var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);
currentNode = addAfter(tokenList, removeFrom, wrapped);
if (after) {
addAfter(tokenList, currentNode, after);
}
if (removeCount > 1) {
// at least one Token object was removed, so we have to do some rematching
// this can only happen if the current pattern is greedy
/** @type {RematchOptions} */
var nestedRematch = {
cause: token + ',' + j,
reach: reach
};
matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);
// the reach might have been extended because of the rematching
if (rematch && nestedRematch.reach > rematch.reach) {
rematch.reach = nestedRematch.reach;
}
}
}
}
}
}
/**
* @typedef LinkedListNode
* @property {T} value
* @property {LinkedListNode<T> | null} prev The previous node.
* @property {LinkedListNode<T> | null} next The next node.
* @template T
* @private
*/
/**
* @template T
* @private
*/
function LinkedList() {
/** @type {LinkedListNode<T>} */
var head = { value: null, prev: null, next: null };
/** @type {LinkedListNode<T>} */
var tail = { value: null, prev: head, next: null };
head.next = tail;
/** @type {LinkedListNode<T>} */
this.head = head;
/** @type {LinkedListNode<T>} */
this.tail = tail;
this.length = 0;
}
/**
* Adds a new node with the given value to the list.
*
* @param {LinkedList<T>} list
* @param {LinkedListNode<T>} node
* @param {T} value
* @returns {LinkedListNode<T>} The added node.
* @template T
*/
function addAfter(list, node, value) {
// assumes that node != list.tail && values.length >= 0
var next = node.next;
var newNode = { value: value, prev: node, next: next };
node.next = newNode;
next.prev = newNode;
list.length++;
return newNode;
}
/**
* Removes `count` nodes after the given node. The given node will not be removed.
*
* @param {LinkedList<T>} list
* @param {LinkedListNode<T>} node
* @param {number} count
* @template T
*/
function removeRange(list, node, count) {
var next = node.next;
for (var i = 0; i < count && next !== list.tail; i++) {
next = next.next;
}
node.next = next;
next.prev = node;
list.length -= i;
}
/**
* @param {LinkedList<T>} list
* @returns {T[]}
* @template T
*/
function toArray(list) {
var array = [];
var node = list.head.next;
while (node !== list.tail) {
array.push(node.value);
node = node.next;
}
return array;
}
if (!_self.document) {
if (!_self.addEventListener) {
// in Node.js
return _;
}
if (!_.disableWorkerMessageHandler) {
// In worker
_self.addEventListener('message', function (evt) {
var message = JSON.parse(evt.data);
var lang = message.language;
var code = message.code;
var immediateClose = message.immediateClose;
_self.postMessage(_.highlight(code, _.languages[lang], lang));
if (immediateClose) {
_self.close();
}
}, false);
}
return _;
}
// Get current script and highlight
var script = _.util.currentScript();
if (script) {
_.filename = script.src;
if (script.hasAttribute('data-manual')) {
_.manual = true;
}
}
function highlightAutomaticallyCallback() {
if (!_.manual) {
_.highlightAll();
}
}
if (!_.manual) {
// If the document state is "loading", then we'll use DOMContentLoaded.
// If the document state is "interactive" and the prism.js script is deferred, then we'll also use the
// DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they
// might take longer one animation frame to execute which can create a race condition where only some plugins have
// been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded.
// See https://github.com/PrismJS/prism/issues/2102
var readyState = document.readyState;
if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) {
document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback);
} else {
if (window.requestAnimationFrame) {
window.requestAnimationFrame(highlightAutomaticallyCallback);
} else {
window.setTimeout(highlightAutomaticallyCallback, 16);
}
}
}
return _;
}(_self));
if ( true && module.exports) {
module.exports = Prism;
}
// hack for components to work correctly in node.js
if (typeof __webpack_require__.g !== 'undefined') {
__webpack_require__.g.Prism = Prism;
}
// some additional documentation/types
/**
* The expansion of a simple `RegExp` literal to support additional properties.
*
* @typedef GrammarToken
* @property {RegExp} pattern The regular expression of the token.
* @property {boolean} [lookbehind=false] If `true`, then the first capturing group of `pattern` will (effectively)
* behave as a lookbehind group meaning that the captured text will not be part of the matched text of the new token.
* @property {boolean} [greedy=false] Whether the token is greedy.
* @property {string|string[]} [alias] An optional alias or list of aliases.
* @property {Grammar} [inside] The nested grammar of this token.
*
* The `inside` grammar will be used to tokenize the text value of each token of this kind.
*
* This can be used to make nested and even recursive language definitions.
*
* Note: This can cause infinite recursion. Be careful when you embed different languages or even the same language into
* each another.
* @global
* @public
*/
/**
* @typedef Grammar
* @type {Object<string, RegExp | GrammarToken | Array<RegExp | GrammarToken>>}
* @property {Grammar} [rest] An optional grammar object that will be appended to this grammar.
* @global
* @public
*/
/**
* A function which will invoked after an element was successfully highlighted.
*
* @callback HighlightCallback
* @param {Element} element The element successfully highlighted.
* @returns {void}
* @global
* @public
*/
/**
* @callback HookCallback
* @param {Object<string, any>} env The environment variables of the hook.
* @returns {void}
* @global
* @public
*/
/* **********************************************
Begin prism-markup.js
********************************************** */
Prism.languages.markup = {
'comment': {
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
greedy: true
},
'prolog': {
pattern: /<\?[\s\S]+?\?>/,
greedy: true
},
'doctype': {
// https://www.w3.org/TR/xml/#NT-doctypedecl
pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
greedy: true,
inside: {
'internal-subset': {
pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
lookbehind: true,
greedy: true,
inside: null // see below
},
'string': {
pattern: /"[^"]*"|'[^']*'/,
greedy: true
},
'punctuation': /^<!|>$|[[\]]/,
'doctype-tag': /^DOCTYPE/i,
'name': /[^\s<>'"]+/
}
},
'cdata': {
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
greedy: true
},
'tag': {
pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
greedy: true,
inside: {
'tag': {
pattern: /^<\/?[^\s>\/]+/,
inside: {
'punctuation': /^<\/?/,
'namespace': /^[^\s>\/:]+:/
}
},
'special-attr': [],
'attr-value': {
pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
inside: {
'punctuation': [
{
pattern: /^=/,
alias: 'attr-equals'
},
{
pattern: /^(\s*)["']|["']$/,
lookbehind: true
}
]
}
},
'punctuation': /\/?>/,
'attr-name': {
pattern: /[^\s>\/]+/,
inside: {
'namespace': /^[^\s>\/:]+:/
}
}
}
},
'entity': [
{
pattern: /&[\da-z]{1,8};/i,
alias: 'named-entity'
},
/&#x?[\da-f]{1,8};/i
]
};
Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
Prism.languages.markup['entity'];
Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;
// Plugin to make entity title show the real entity, idea by Roman Komarov
Prism.hooks.add('wrap', function (env) {
if (env.type === 'entity') {
env.attributes['title'] = env.content.replace(/&amp;/, '&');
}
});
Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
/**
* Adds an inlined language to markup.
*
* An example of an inlined language is CSS with `<style>` tags.
*
* @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
* case insensitive.
* @param {string} lang The language key.
* @example
* addInlined('style', 'css');
*/
value: function addInlined(tagName, lang) {
var includedCdataInside = {};
includedCdataInside['language-' + lang] = {
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
lookbehind: true,
inside: Prism.languages[lang]
};
includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
var inside = {
'included-cdata': {
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
inside: includedCdataInside
}
};
inside['language-' + lang] = {
pattern: /[\s\S]+/,
inside: Prism.languages[lang]
};
var def = {};
def[tagName] = {
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () { return tagName; }), 'i'),
lookbehind: true,
greedy: true,
inside: inside
};
Prism.languages.insertBefore('markup', 'cdata', def);
}
});
Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
/**
* Adds an pattern to highlight languages embedded in HTML attributes.
*
* An example of an inlined language is CSS with `style` attributes.
*
* @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
* case insensitive.
* @param {string} lang The language key.
* @example
* addAttribute('style', 'css');
*/
value: function (attrName, lang) {
Prism.languages.markup.tag.inside['special-attr'].push({
pattern: RegExp(
/(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
'i'
),
lookbehind: true,
inside: {
'attr-name': /^[^\s=]+/,
'attr-value': {
pattern: /=[\s\S]+/,
inside: {
'value': {
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
lookbehind: true,
alias: [lang, 'language-' + lang],
inside: Prism.languages[lang]
},
'punctuation': [
{
pattern: /^=/,
alias: 'attr-equals'
},
/"|'/
]
}
}
}
});
}
});
Prism.languages.html = Prism.languages.markup;
Prism.languages.mathml = Prism.languages.markup;
Prism.languages.svg = Prism.languages.markup;
Prism.languages.xml = Prism.languages.extend('markup', {});
Prism.languages.ssml = Prism.languages.xml;
Prism.languages.atom = Prism.languages.xml;
Prism.languages.rss = Prism.languages.xml;
/* **********************************************
Begin prism-css.js
********************************************** */
(function (Prism) {
var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
Prism.languages.css = {
'comment': /\/\*[\s\S]*?\*\//,
'atrule': {
pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source),
inside: {
'rule': /^@[\w-]+/,
'selector-function-argument': {
pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
lookbehind: true,
alias: 'selector'
},
'keyword': {
pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
lookbehind: true
}
// See rest below
}
},
'url': {
// https://drafts.csswg.org/css-values-3/#urls
pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
greedy: true,
inside: {
'function': /^url/i,
'punctuation': /^\(|\)$/,
'string': {
pattern: RegExp('^' + string.source + '$'),
alias: 'url'
}
}
},
'selector': {
pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
lookbehind: true
},
'string': {
pattern: string,
greedy: true
},
'property': {
pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
lookbehind: true
},
'important': /!important\b/i,
'function': {
pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
lookbehind: true
},
'punctuation': /[(){};:,]/
};
Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
var markup = Prism.languages.markup;
if (markup) {
markup.tag.addInlined('style', 'css');
markup.tag.addAttribute('style', 'css');
}
}(Prism));
/* **********************************************
Begin prism-clike.js
********************************************** */
Prism.languages.clike = {
'comment': [
{
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
lookbehind: true,
greedy: true
},
{
pattern: /(^|[^\\:])\/\/.*/,
lookbehind: true,
greedy: true
}
],
'string': {
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
greedy: true
},
'class-name': {
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
lookbehind: true,
inside: {
'punctuation': /[.\\]/
}
},
'keyword': /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
'boolean': /\b(?:false|true)\b/,
'function': /\b\w+(?=\()/,
'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
'punctuation': /[{}[\];(),.:]/
};
/* **********************************************
Begin prism-javascript.js
********************************************** */
Prism.languages.javascript = Prism.languages.extend('clike', {
'class-name': [
Prism.languages.clike['class-name'],
{
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
lookbehind: true
}
],
'keyword': [
{
pattern: /((?:^|\})\s*)catch\b/,
lookbehind: true
},
{
pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
lookbehind: true
},
],
// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
'number': {
pattern: RegExp(
/(^|[^\w$])/.source +
'(?:' +
(
// constant
/NaN|Infinity/.source +
'|' +
// binary integer
/0[bB][01]+(?:_[01]+)*n?/.source +
'|' +
// octal integer
/0[oO][0-7]+(?:_[0-7]+)*n?/.source +
'|' +
// hexadecimal integer
/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source +
'|' +
// decimal bigint
/\d+(?:_\d+)*n/.source +
'|' +
// decimal number (integer or float) but no bigint
/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source
) +
')' +
/(?![\w$])/.source
),
lookbehind: true
},
'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
});
Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
Prism.languages.insertBefore('javascript', 'keyword', {
'regex': {
pattern: RegExp(
// lookbehind
// eslint-disable-next-line regexp/no-dupe-characters-character-class
/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source +
// Regex pattern:
// There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
// classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
// with the only syntax, so we have to define 2 different regex patterns.
/\//.source +
'(?:' +
/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source +
'|' +
// `v` flag syntax. This supports 3 levels of nested character classes.
/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source +
')' +
// lookahead
/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
),
lookbehind: true,
greedy: true,
inside: {
'regex-source': {
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
lookbehind: true,
alias: 'language-regex',
inside: Prism.languages.regex
},
'regex-delimiter': /^\/|\/$/,
'regex-flags': /^[a-z]+$/,
}
},
// This must be declared before keyword because we use "function" inside the look-forward
'function-variable': {
pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
alias: 'function'
},
'parameter': [
{
pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
lookbehind: true,
inside: Prism.languages.javascript
},
{
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
lookbehind: true,
inside: Prism.languages.javascript
},
{
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
lookbehind: true,
inside: Prism.languages.javascript
},
{
pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
lookbehind: true,
inside: Prism.languages.javascript
}
],
'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
});
Prism.languages.insertBefore('javascript', 'string', {
'hashbang': {
pattern: /^#!.*/,
greedy: true,
alias: 'comment'
},
'template-string': {
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
greedy: true,
inside: {
'template-punctuation': {
pattern: /^`|`$/,
alias: 'string'
},
'interpolation': {
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
lookbehind: true,
inside: {
'interpolation-punctuation': {
pattern: /^\$\{|\}$/,
alias: 'punctuation'
},
rest: Prism.languages.javascript
}
},
'string': /[\s\S]+/
}
},
'string-property': {
pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
lookbehind: true,
greedy: true,
alias: 'property'
}
});
Prism.languages.insertBefore('javascript', 'operator', {
'literal-property': {
pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
lookbehind: true,
alias: 'property'
},
});
if (Prism.languages.markup) {
Prism.languages.markup.tag.addInlined('script', 'javascript');
// add attribute support for all DOM events.
// https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events
Prism.languages.markup.tag.addAttribute(
/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
'javascript'
);
}
Prism.languages.js = Prism.languages.javascript;
/* **********************************************
Begin prism-file-highlight.js
********************************************** */
(function () {
if (typeof Prism === 'undefined' || typeof document === 'undefined') {
return;
}
// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill
if (!Element.prototype.matches) {
Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
}
var LOADING_MESSAGE = 'Loading…';
var FAILURE_MESSAGE = function (status, message) {
return '✖ Error ' + status + ' while fetching file: ' + message;
};
var FAILURE_EMPTY_MESSAGE = '✖ Error: File does not exist or is empty';
var EXTENSIONS = {
'js': 'javascript',
'py': 'python',
'rb': 'ruby',
'ps1': 'powershell',
'psm1': 'powershell',
'sh': 'bash',
'bat': 'batch',
'h': 'c',
'tex': 'latex'
};
var STATUS_ATTR = 'data-src-status';
var STATUS_LOADING = 'loading';
var STATUS_LOADED = 'loaded';
var STATUS_FAILED = 'failed';
var SELECTOR = 'pre[data-src]:not([' + STATUS_ATTR + '="' + STATUS_LOADED + '"])'
+ ':not([' + STATUS_ATTR + '="' + STATUS_LOADING + '"])';
/**
* Loads the given file.
*
* @param {string} src The URL or path of the source file to load.
* @param {(result: string) => void} success
* @param {(reason: string) => void} error
*/
function loadFile(src, success, error) {
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
success(xhr.responseText);
} else {
if (xhr.status >= 400) {
error(FAILURE_MESSAGE(xhr.status, xhr.statusText));
} else {
error(FAILURE_EMPTY_MESSAGE);
}
}
}
};
xhr.send(null);
}
/**
* Parses the given range.
*
* This returns a range with inclusive ends.
*
* @param {string | null | undefined} range
* @returns {[number, number | undefined] | undefined}
*/
function parseRange(range) {
var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(range || '');
if (m) {
var start = Number(m[1]);
var comma = m[2];
var end = m[3];
if (!comma) {
return [start, start];
}
if (!end) {
return [start, undefined];
}
return [start, Number(end)];
}
return undefined;
}
Prism.hooks.add('before-highlightall', function (env) {
env.selector += ', ' + SELECTOR;
});
Prism.hooks.add('before-sanity-check', function (env) {
var pre = /** @type {HTMLPreElement} */ (env.element);
if (pre.matches(SELECTOR)) {
env.code = ''; // fast-path the whole thing and go to complete
pre.setAttribute(STATUS_ATTR, STATUS_LOADING); // mark as loading
// add code element with loading message
var code = pre.appendChild(document.createElement('CODE'));
code.textContent = LOADING_MESSAGE;
var src = pre.getAttribute('data-src');
var language = env.language;
if (language === 'none') {
// the language might be 'none' because there is no language set;
// in this case, we want to use the extension as the language
var extension = (/\.(\w+)$/.exec(src) || [, 'none'])[1];
language = EXTENSIONS[extension] || extension;
}
// set language classes
Prism.util.setLanguage(code, language);
Prism.util.setLanguage(pre, language);
// preload the language
var autoloader = Prism.plugins.autoloader;
if (autoloader) {
autoloader.loadLanguages(language);
}
// load file
loadFile(
src,
function (text) {
// mark as loaded
pre.setAttribute(STATUS_ATTR, STATUS_LOADED);
// handle data-range
var range = parseRange(pre.getAttribute('data-range'));
if (range) {
var lines = text.split(/\r\n?|\n/g);
// the range is one-based and inclusive on both ends
var start = range[0];
var end = range[1] == null ? lines.length : range[1];
if (start < 0) { start += lines.length; }
start = Math.max(0, Math.min(start - 1, lines.length));
if (end < 0) { end += lines.length; }
end = Math.max(0, Math.min(end, lines.length));
text = lines.slice(start, end).join('\n');
// add data-start for line numbers
if (!pre.hasAttribute('data-start')) {
pre.setAttribute('data-start', String(start + 1));
}
}
// highlight code
code.textContent = text;
Prism.highlightElement(code);
},
function (error) {
// mark as failed
pre.setAttribute(STATUS_ATTR, STATUS_FAILED);
code.textContent = error;
}
);
}
});
Prism.plugins.fileHighlight = {
/**
* Executes the File Highlight plugin for all matching `pre` elements under the given container.
*
* Note: Elements which are already loaded or currently loading will not be touched by this method.
*
* @param {ParentNode} [container=document]
*/
highlight: function highlight(container) {
var elements = (container || document).querySelectorAll(SELECTOR);
for (var i = 0, element; (element = elements[i++]);) {
Prism.highlightElement(element);
}
}
};
var logged = false;
/** @deprecated Use `Prism.plugins.fileHighlight.highlight` instead. */
Prism.fileHighlight = function () {
if (!logged) {
console.warn('Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead.');
logged = true;
}
Prism.plugins.fileHighlight.highlight.apply(this, arguments);
};
}());
/***/ }),
/***/ 464:
/***/ ((module) => {
"use strict";
/*!
* repeat-string <https://github.com/jonschlinkert/repeat-string>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
*/
/**
* Results cache
*/
var res = '';
var cache;
/**
* Expose `repeat`
*/
module.exports = repeat;
/**
* Repeat the given `string` the specified `number`
* of times.
*
* **Example:**
*
* ```js
* var repeat = require('repeat-string');
* repeat('A', 5);
* //=> AAAAA
* ```
*
* @param {String} `string` The string to repeat
* @param {Number} `number` The number of times to repeat the string
* @return {String} Repeated string
* @api public
*/
function repeat(str, num) {
if (typeof str !== 'string') {
throw new TypeError('expected a string');
}
// cover common, quick use cases
if (num === 1) return str;
if (num === 2) return str + str;
var max = str.length * num;
if (cache !== str || typeof cache === 'undefined') {
cache = str;
res = '';
} else if (res.length >= max) {
return res.substr(0, max);
}
while (max > res.length && num > 1) {
if (num & 1) {
res += str;
}
num >>= 1;
str += str;
}
res += str;
res = res.substr(0, max);
return res;
}
/***/ }),
/***/ 131:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var repeat = __webpack_require__(464);
var splitOnTags = function splitOnTags(str) {
return str.split(/(<\/?[^>]+>)/g).filter(function (line) {
return line.trim() !== '';
});
};
var isTag = function isTag(str) {
return (/<[^>!]+>/.test(str)
);
};
var isClosingTag = function isClosingTag(str) {
return (/<\/+[^>]+>/.test(str)
);
};
var isSelfClosingTag = function isSelfClosingTag(str) {
return (/<[^>]+\/>/.test(str)
);
};
var isOpeningTag = function isOpeningTag(str) {
return isTag(str) && !isClosingTag(str) && !isSelfClosingTag(str);
};
module.exports = function (xml) {
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var indentor = config.indentor,
textNodesOnSameLine = config.textNodesOnSameLine;
var depth = 0;
var indicesToRemove = [];
indentor = indentor || ' ';
var rawResult = lexer(xml).map(function (element, i, arr) {
var value = element.value,
type = element.type;
if (type === 'ClosingTag') {
depth--;
}
var indentation = repeat(indentor, depth);
var line = indentation + value;
if (type === 'OpeningTag') {
depth++;
}
if (textNodesOnSameLine) {
// Lookbehind for [OpeningTag][Text][ClosingTag]
var oneBefore = arr[i - 1];
var twoBefore = arr[i - 2];
if (type === "ClosingTag" && oneBefore.type === "Text" && twoBefore.type === "OpeningTag") {
// collapse into a single line
line = '' + indentation + twoBefore.value + oneBefore.value + value;
indicesToRemove.push(i - 2, i - 1);
}
}
return line;
});
indicesToRemove.forEach(function (idx) {
return rawResult[idx] = null;
});
return rawResult.filter(function (val) {
return !!val;
}).join('\n');
};
function lexer(xmlStr) {
var values = splitOnTags(xmlStr);
return values.map(function (value) {
return {
value: value,
type: getType(value)
};
});
}
// Helpers
function getType(str) {
if (isClosingTag(str)) {
return 'ClosingTag';
}
if (isOpeningTag(str)) {
return 'OpeningTag';
}
if (isSelfClosingTag(str)) {
return 'SelfClosingTag';
}
return 'Text';
}
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ if (cachedModule.error !== undefined) throw cachedModule.error;
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ try {
/******/ var execOptions = { id: moduleId, module: module, factory: __webpack_modules__[moduleId], require: __webpack_require__ };
/******/ __webpack_require__.i.forEach(function(handler) { handler(execOptions); });
/******/ module = execOptions.module;
/******/ execOptions.factory.call(module.exports, module, module.exports, execOptions.require);
/******/ } catch(e) {
/******/ module.error = e;
/******/ throw e;
/******/ }
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = __webpack_modules__;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = __webpack_module_cache__;
/******/
/******/ // expose the module execution interceptor
/******/ __webpack_require__.i = [];
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/get javascript update chunk filename */
/******/ (() => {
/******/ // This function allow to reference all chunks
/******/ __webpack_require__.hu = (chunkId) => {
/******/ // return url for filenames based on template
/******/ return "" + chunkId + "." + __webpack_require__.h() + ".hot-update.js";
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/get update manifest filename */
/******/ (() => {
/******/ __webpack_require__.hmrF = () => ("main." + __webpack_require__.h() + ".hot-update.json");
/******/ })();
/******/
/******/ /* webpack/runtime/getFullHash */
/******/ (() => {
/******/ __webpack_require__.h = () => ("373f37ab7534d66db541")
/******/ })();
/******/
/******/ /* webpack/runtime/global */
/******/ (() => {
/******/ __webpack_require__.g = (function() {
/******/ if (typeof globalThis === 'object') return globalThis;
/******/ try {
/******/ return this || new Function('return this')();
/******/ } catch (e) {
/******/ if (typeof window === 'object') return window;
/******/ }
/******/ })();
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/load script */
/******/ (() => {
/******/ var inProgress = {};
/******/ var dataWebpackPrefix = "rapidoc:";
/******/ // loadScript function to load a script via script tag
/******/ __webpack_require__.l = (url, done, key, chunkId) => {
/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
/******/ var script, needAttach;
/******/ if(key !== undefined) {
/******/ var scripts = document.getElementsByTagName("script");
/******/ for(var i = 0; i < scripts.length; i++) {
/******/ var s = scripts[i];
/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
/******/ }
/******/ }
/******/ if(!script) {
/******/ needAttach = true;
/******/ script = document.createElement('script');
/******/
/******/ script.charset = 'utf-8';
/******/ script.timeout = 120;
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
/******/
/******/ script.src = url;
/******/ }
/******/ inProgress[url] = [done];
/******/ var onScriptComplete = (prev, event) => {
/******/ // avoid mem leaks in IE.
/******/ script.onerror = script.onload = null;
/******/ clearTimeout(timeout);
/******/ var doneFns = inProgress[url];
/******/ delete inProgress[url];
/******/ script.parentNode && script.parentNode.removeChild(script);
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
/******/ needAttach && document.head.appendChild(script);
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hot module replacement */
/******/ (() => {
/******/ var currentModuleData = {};
/******/ var installedModules = __webpack_require__.c;
/******/
/******/ // module and require creation
/******/ var currentChildModule;
/******/ var currentParents = [];
/******/
/******/ // status
/******/ var registeredStatusHandlers = [];
/******/ var currentStatus = "idle";
/******/
/******/ // while downloading
/******/ var blockingPromises = 0;
/******/ var blockingPromisesWaiting = [];
/******/
/******/ // The update info
/******/ var currentUpdateApplyHandlers;
/******/ var queuedInvalidatedModules;
/******/
/******/ // eslint-disable-next-line no-unused-vars
/******/ __webpack_require__.hmrD = currentModuleData;
/******/
/******/ __webpack_require__.i.push(function (options) {
/******/ var module = options.module;
/******/ var require = createRequire(options.require, options.id);
/******/ module.hot = createModuleHotObject(options.id, module);
/******/ module.parents = currentParents;
/******/ module.children = [];
/******/ currentParents = [];
/******/ options.require = require;
/******/ });
/******/
/******/ __webpack_require__.hmrC = {};
/******/ __webpack_require__.hmrI = {};
/******/
/******/ function createRequire(require, moduleId) {
/******/ var me = installedModules[moduleId];
/******/ if (!me) return require;
/******/ var fn = function (request) {
/******/ if (me.hot.active) {
/******/ if (installedModules[request]) {
/******/ var parents = installedModules[request].parents;
/******/ if (parents.indexOf(moduleId) === -1) {
/******/ parents.push(moduleId);
/******/ }
/******/ } else {
/******/ currentParents = [moduleId];
/******/ currentChildModule = request;
/******/ }
/******/ if (me.children.indexOf(request) === -1) {
/******/ me.children.push(request);
/******/ }
/******/ } else {
/******/ console.warn(
/******/ "[HMR] unexpected require(" +
/******/ request +
/******/ ") from disposed module " +
/******/ moduleId
/******/ );
/******/ currentParents = [];
/******/ }
/******/ return require(request);
/******/ };
/******/ var createPropertyDescriptor = function (name) {
/******/ return {
/******/ configurable: true,
/******/ enumerable: true,
/******/ get: function () {
/******/ return require[name];
/******/ },
/******/ set: function (value) {
/******/ require[name] = value;
/******/ }
/******/ };
/******/ };
/******/ for (var name in require) {
/******/ if (Object.prototype.hasOwnProperty.call(require, name) && name !== "e") {
/******/ Object.defineProperty(fn, name, createPropertyDescriptor(name));
/******/ }
/******/ }
/******/ fn.e = function (chunkId) {
/******/ return trackBlockingPromise(require.e(chunkId));
/******/ };
/******/ return fn;
/******/ }
/******/
/******/ function createModuleHotObject(moduleId, me) {
/******/ var _main = currentChildModule !== moduleId;
/******/ var hot = {
/******/ // private stuff
/******/ _acceptedDependencies: {},
/******/ _acceptedErrorHandlers: {},
/******/ _declinedDependencies: {},
/******/ _selfAccepted: false,
/******/ _selfDeclined: false,
/******/ _selfInvalidated: false,
/******/ _disposeHandlers: [],
/******/ _main: _main,
/******/ _requireSelf: function () {
/******/ currentParents = me.parents.slice();
/******/ currentChildModule = _main ? undefined : moduleId;
/******/ __webpack_require__(moduleId);
/******/ },
/******/
/******/ // Module API
/******/ active: true,
/******/ accept: function (dep, callback, errorHandler) {
/******/ if (dep === undefined) hot._selfAccepted = true;
/******/ else if (typeof dep === "function") hot._selfAccepted = dep;
/******/ else if (typeof dep === "object" && dep !== null) {
/******/ for (var i = 0; i < dep.length; i++) {
/******/ hot._acceptedDependencies[dep[i]] = callback || function () {};
/******/ hot._acceptedErrorHandlers[dep[i]] = errorHandler;
/******/ }
/******/ } else {
/******/ hot._acceptedDependencies[dep] = callback || function () {};
/******/ hot._acceptedErrorHandlers[dep] = errorHandler;
/******/ }
/******/ },
/******/ decline: function (dep) {
/******/ if (dep === undefined) hot._selfDeclined = true;
/******/ else if (typeof dep === "object" && dep !== null)
/******/ for (var i = 0; i < dep.length; i++)
/******/ hot._declinedDependencies[dep[i]] = true;
/******/ else hot._declinedDependencies[dep] = true;
/******/ },
/******/ dispose: function (callback) {
/******/ hot._disposeHandlers.push(callback);
/******/ },
/******/ addDisposeHandler: function (callback) {
/******/ hot._disposeHandlers.push(callback);
/******/ },
/******/ removeDisposeHandler: function (callback) {
/******/ var idx = hot._disposeHandlers.indexOf(callback);
/******/ if (idx >= 0) hot._disposeHandlers.splice(idx, 1);
/******/ },
/******/ invalidate: function () {
/******/ this._selfInvalidated = true;
/******/ switch (currentStatus) {
/******/ case "idle":
/******/ currentUpdateApplyHandlers = [];
/******/ Object.keys(__webpack_require__.hmrI).forEach(function (key) {
/******/ __webpack_require__.hmrI[key](
/******/ moduleId,
/******/ currentUpdateApplyHandlers
/******/ );
/******/ });
/******/ setStatus("ready");
/******/ break;
/******/ case "ready":
/******/ Object.keys(__webpack_require__.hmrI).forEach(function (key) {
/******/ __webpack_require__.hmrI[key](
/******/ moduleId,
/******/ currentUpdateApplyHandlers
/******/ );
/******/ });
/******/ break;
/******/ case "prepare":
/******/ case "check":
/******/ case "dispose":
/******/ case "apply":
/******/ (queuedInvalidatedModules = queuedInvalidatedModules || []).push(
/******/ moduleId
/******/ );
/******/ break;
/******/ default:
/******/ // ignore requests in error states
/******/ break;
/******/ }
/******/ },
/******/
/******/ // Management API
/******/ check: hotCheck,
/******/ apply: hotApply,
/******/ status: function (l) {
/******/ if (!l) return currentStatus;
/******/ registeredStatusHandlers.push(l);
/******/ },
/******/ addStatusHandler: function (l) {
/******/ registeredStatusHandlers.push(l);
/******/ },
/******/ removeStatusHandler: function (l) {
/******/ var idx = registeredStatusHandlers.indexOf(l);
/******/ if (idx >= 0) registeredStatusHandlers.splice(idx, 1);
/******/ },
/******/
/******/ //inherit from previous dispose call
/******/ data: currentModuleData[moduleId]
/******/ };
/******/ currentChildModule = undefined;
/******/ return hot;
/******/ }
/******/
/******/ function setStatus(newStatus) {
/******/ currentStatus = newStatus;
/******/ var results = [];
/******/
/******/ for (var i = 0; i < registeredStatusHandlers.length; i++)
/******/ results[i] = registeredStatusHandlers[i].call(null, newStatus);
/******/
/******/ return Promise.all(results);
/******/ }
/******/
/******/ function unblock() {
/******/ if (--blockingPromises === 0) {
/******/ setStatus("ready").then(function () {
/******/ if (blockingPromises === 0) {
/******/ var list = blockingPromisesWaiting;
/******/ blockingPromisesWaiting = [];
/******/ for (var i = 0; i < list.length; i++) {
/******/ list[i]();
/******/ }
/******/ }
/******/ });
/******/ }
/******/ }
/******/
/******/ function trackBlockingPromise(promise) {
/******/ switch (currentStatus) {
/******/ case "ready":
/******/ setStatus("prepare");
/******/ /* fallthrough */
/******/ case "prepare":
/******/ blockingPromises++;
/******/ promise.then(unblock, unblock);
/******/ return promise;
/******/ default:
/******/ return promise;
/******/ }
/******/ }
/******/
/******/ function waitForBlockingPromises(fn) {
/******/ if (blockingPromises === 0) return fn();
/******/ return new Promise(function (resolve) {
/******/ blockingPromisesWaiting.push(function () {
/******/ resolve(fn());
/******/ });
/******/ });
/******/ }
/******/
/******/ function hotCheck(applyOnUpdate) {
/******/ if (currentStatus !== "idle") {
/******/ throw new Error("check() is only allowed in idle status");
/******/ }
/******/ return setStatus("check")
/******/ .then(__webpack_require__.hmrM)
/******/ .then(function (update) {
/******/ if (!update) {
/******/ return setStatus(applyInvalidatedModules() ? "ready" : "idle").then(
/******/ function () {
/******/ return null;
/******/ }
/******/ );
/******/ }
/******/
/******/ return setStatus("prepare").then(function () {
/******/ var updatedModules = [];
/******/ currentUpdateApplyHandlers = [];
/******/
/******/ return Promise.all(
/******/ Object.keys(__webpack_require__.hmrC).reduce(function (
/******/ promises,
/******/ key
/******/ ) {
/******/ __webpack_require__.hmrC[key](
/******/ update.c,
/******/ update.r,
/******/ update.m,
/******/ promises,
/******/ currentUpdateApplyHandlers,
/******/ updatedModules
/******/ );
/******/ return promises;
/******/ },
/******/ [])
/******/ ).then(function () {
/******/ return waitForBlockingPromises(function () {
/******/ if (applyOnUpdate) {
/******/ return internalApply(applyOnUpdate);
/******/ } else {
/******/ return setStatus("ready").then(function () {
/******/ return updatedModules;
/******/ });
/******/ }
/******/ });
/******/ });
/******/ });
/******/ });
/******/ }
/******/
/******/ function hotApply(options) {
/******/ if (currentStatus !== "ready") {
/******/ return Promise.resolve().then(function () {
/******/ throw new Error(
/******/ "apply() is only allowed in ready status (state: " +
/******/ currentStatus +
/******/ ")"
/******/ );
/******/ });
/******/ }
/******/ return internalApply(options);
/******/ }
/******/
/******/ function internalApply(options) {
/******/ options = options || {};
/******/
/******/ applyInvalidatedModules();
/******/
/******/ var results = currentUpdateApplyHandlers.map(function (handler) {
/******/ return handler(options);
/******/ });
/******/ currentUpdateApplyHandlers = undefined;
/******/
/******/ var errors = results
/******/ .map(function (r) {
/******/ return r.error;
/******/ })
/******/ .filter(Boolean);
/******/
/******/ if (errors.length > 0) {
/******/ return setStatus("abort").then(function () {
/******/ throw errors[0];
/******/ });
/******/ }
/******/
/******/ // Now in "dispose" phase
/******/ var disposePromise = setStatus("dispose");
/******/
/******/ results.forEach(function (result) {
/******/ if (result.dispose) result.dispose();
/******/ });
/******/
/******/ // Now in "apply" phase
/******/ var applyPromise = setStatus("apply");
/******/
/******/ var error;
/******/ var reportError = function (err) {
/******/ if (!error) error = err;
/******/ };
/******/
/******/ var outdatedModules = [];
/******/ results.forEach(function (result) {
/******/ if (result.apply) {
/******/ var modules = result.apply(reportError);
/******/ if (modules) {
/******/ for (var i = 0; i < modules.length; i++) {
/******/ outdatedModules.push(modules[i]);
/******/ }
/******/ }
/******/ }
/******/ });
/******/
/******/ return Promise.all([disposePromise, applyPromise]).then(function () {
/******/ // handle errors in accept handlers and self accepted module load
/******/ if (error) {
/******/ return setStatus("fail").then(function () {
/******/ throw error;
/******/ });
/******/ }
/******/
/******/ if (queuedInvalidatedModules) {
/******/ return internalApply(options).then(function (list) {
/******/ outdatedModules.forEach(function (moduleId) {
/******/ if (list.indexOf(moduleId) < 0) list.push(moduleId);
/******/ });
/******/ return list;
/******/ });
/******/ }
/******/
/******/ return setStatus("idle").then(function () {
/******/ return outdatedModules;
/******/ });
/******/ });
/******/ }
/******/
/******/ function applyInvalidatedModules() {
/******/ if (queuedInvalidatedModules) {
/******/ if (!currentUpdateApplyHandlers) currentUpdateApplyHandlers = [];
/******/ Object.keys(__webpack_require__.hmrI).forEach(function (key) {
/******/ queuedInvalidatedModules.forEach(function (moduleId) {
/******/ __webpack_require__.hmrI[key](
/******/ moduleId,
/******/ currentUpdateApplyHandlers
/******/ );
/******/ });
/******/ });
/******/ queuedInvalidatedModules = undefined;
/******/ return true;
/******/ }
/******/ }
/******/ })();
/******/
/******/ /* webpack/runtime/publicPath */
/******/ (() => {
/******/ __webpack_require__.p = "";
/******/ })();
/******/
/******/ /* webpack/runtime/jsonp chunk loading */
/******/ (() => {
/******/ // no baseURI
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ var installedChunks = __webpack_require__.hmrS_jsonp = __webpack_require__.hmrS_jsonp || {
/******/ 179: 0
/******/ };
/******/
/******/ // no chunk on demand loading
/******/
/******/ // no prefetching
/******/
/******/ // no preloaded
/******/
/******/ var currentUpdatedModulesList;
/******/ var waitingUpdateResolves = {};
/******/ function loadUpdateChunk(chunkId, updatedModulesList) {
/******/ currentUpdatedModulesList = updatedModulesList;
/******/ return new Promise((resolve, reject) => {
/******/ waitingUpdateResolves[chunkId] = resolve;
/******/ // start update chunk loading
/******/ var url = __webpack_require__.p + __webpack_require__.hu(chunkId);
/******/ // create error before stack unwound to get useful stacktrace later
/******/ var error = new Error();
/******/ var loadingEnded = (event) => {
/******/ if(waitingUpdateResolves[chunkId]) {
/******/ waitingUpdateResolves[chunkId] = undefined
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
/******/ var realSrc = event && event.target && event.target.src;
/******/ error.message = 'Loading hot update chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
/******/ error.name = 'ChunkLoadError';
/******/ error.type = errorType;
/******/ error.request = realSrc;
/******/ reject(error);
/******/ }
/******/ };
/******/ __webpack_require__.l(url, loadingEnded);
/******/ });
/******/ }
/******/
/******/ self["webpackHotUpdaterapidoc"] = (chunkId, moreModules, runtime) => {
/******/ for(var moduleId in moreModules) {
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
/******/ currentUpdate[moduleId] = moreModules[moduleId];
/******/ if(currentUpdatedModulesList) currentUpdatedModulesList.push(moduleId);
/******/ }
/******/ }
/******/ if(runtime) currentUpdateRuntime.push(runtime);
/******/ if(waitingUpdateResolves[chunkId]) {
/******/ waitingUpdateResolves[chunkId]();
/******/ waitingUpdateResolves[chunkId] = undefined;
/******/ }
/******/ };
/******/
/******/ var currentUpdateChunks;
/******/ var currentUpdate;
/******/ var currentUpdateRemovedChunks;
/******/ var currentUpdateRuntime;
/******/ function applyHandler(options) {
/******/ if (__webpack_require__.f) delete __webpack_require__.f.jsonpHmr;
/******/ currentUpdateChunks = undefined;
/******/ function getAffectedModuleEffects(updateModuleId) {
/******/ var outdatedModules = [updateModuleId];
/******/ var outdatedDependencies = {};
/******/
/******/ var queue = outdatedModules.map(function (id) {
/******/ return {
/******/ chain: [id],
/******/ id: id
/******/ };
/******/ });
/******/ while (queue.length > 0) {
/******/ var queueItem = queue.pop();
/******/ var moduleId = queueItem.id;
/******/ var chain = queueItem.chain;
/******/ var module = __webpack_require__.c[moduleId];
/******/ if (
/******/ !module ||
/******/ (module.hot._selfAccepted && !module.hot._selfInvalidated)
/******/ )
/******/ continue;
/******/ if (module.hot._selfDeclined) {
/******/ return {
/******/ type: "self-declined",
/******/ chain: chain,
/******/ moduleId: moduleId
/******/ };
/******/ }
/******/ if (module.hot._main) {
/******/ return {
/******/ type: "unaccepted",
/******/ chain: chain,
/******/ moduleId: moduleId
/******/ };
/******/ }
/******/ for (var i = 0; i < module.parents.length; i++) {
/******/ var parentId = module.parents[i];
/******/ var parent = __webpack_require__.c[parentId];
/******/ if (!parent) continue;
/******/ if (parent.hot._declinedDependencies[moduleId]) {
/******/ return {
/******/ type: "declined",
/******/ chain: chain.concat([parentId]),
/******/ moduleId: moduleId,
/******/ parentId: parentId
/******/ };
/******/ }
/******/ if (outdatedModules.indexOf(parentId) !== -1) continue;
/******/ if (parent.hot._acceptedDependencies[moduleId]) {
/******/ if (!outdatedDependencies[parentId])
/******/ outdatedDependencies[parentId] = [];
/******/ addAllToSet(outdatedDependencies[parentId], [moduleId]);
/******/ continue;
/******/ }
/******/ delete outdatedDependencies[parentId];
/******/ outdatedModules.push(parentId);
/******/ queue.push({
/******/ chain: chain.concat([parentId]),
/******/ id: parentId
/******/ });
/******/ }
/******/ }
/******/
/******/ return {
/******/ type: "accepted",
/******/ moduleId: updateModuleId,
/******/ outdatedModules: outdatedModules,
/******/ outdatedDependencies: outdatedDependencies
/******/ };
/******/ }
/******/
/******/ function addAllToSet(a, b) {
/******/ for (var i = 0; i < b.length; i++) {
/******/ var item = b[i];
/******/ if (a.indexOf(item) === -1) a.push(item);
/******/ }
/******/ }
/******/
/******/ // at begin all updates modules are outdated
/******/ // the "outdated" status can propagate to parents if they don't accept the children
/******/ var outdatedDependencies = {};
/******/ var outdatedModules = [];
/******/ var appliedUpdate = {};
/******/
/******/ var warnUnexpectedRequire = function warnUnexpectedRequire(module) {
/******/ console.warn(
/******/ "[HMR] unexpected require(" + module.id + ") to disposed module"
/******/ );
/******/ };
/******/
/******/ for (var moduleId in currentUpdate) {
/******/ if (__webpack_require__.o(currentUpdate, moduleId)) {
/******/ var newModuleFactory = currentUpdate[moduleId];
/******/ /** @type {TODO} */
/******/ var result;
/******/ if (newModuleFactory) {
/******/ result = getAffectedModuleEffects(moduleId);
/******/ } else {
/******/ result = {
/******/ type: "disposed",
/******/ moduleId: moduleId
/******/ };
/******/ }
/******/ /** @type {Error|false} */
/******/ var abortError = false;
/******/ var doApply = false;
/******/ var doDispose = false;
/******/ var chainInfo = "";
/******/ if (result.chain) {
/******/ chainInfo = "\nUpdate propagation: " + result.chain.join(" -> ");
/******/ }
/******/ switch (result.type) {
/******/ case "self-declined":
/******/ if (options.onDeclined) options.onDeclined(result);
/******/ if (!options.ignoreDeclined)
/******/ abortError = new Error(
/******/ "Aborted because of self decline: " +
/******/ result.moduleId +
/******/ chainInfo
/******/ );
/******/ break;
/******/ case "declined":
/******/ if (options.onDeclined) options.onDeclined(result);
/******/ if (!options.ignoreDeclined)
/******/ abortError = new Error(
/******/ "Aborted because of declined dependency: " +
/******/ result.moduleId +
/******/ " in " +
/******/ result.parentId +
/******/ chainInfo
/******/ );
/******/ break;
/******/ case "unaccepted":
/******/ if (options.onUnaccepted) options.onUnaccepted(result);
/******/ if (!options.ignoreUnaccepted)
/******/ abortError = new Error(
/******/ "Aborted because " + moduleId + " is not accepted" + chainInfo
/******/ );
/******/ break;
/******/ case "accepted":
/******/ if (options.onAccepted) options.onAccepted(result);
/******/ doApply = true;
/******/ break;
/******/ case "disposed":
/******/ if (options.onDisposed) options.onDisposed(result);
/******/ doDispose = true;
/******/ break;
/******/ default:
/******/ throw new Error("Unexception type " + result.type);
/******/ }
/******/ if (abortError) {
/******/ return {
/******/ error: abortError
/******/ };
/******/ }
/******/ if (doApply) {
/******/ appliedUpdate[moduleId] = newModuleFactory;
/******/ addAllToSet(outdatedModules, result.outdatedModules);
/******/ for (moduleId in result.outdatedDependencies) {
/******/ if (__webpack_require__.o(result.outdatedDependencies, moduleId)) {
/******/ if (!outdatedDependencies[moduleId])
/******/ outdatedDependencies[moduleId] = [];
/******/ addAllToSet(
/******/ outdatedDependencies[moduleId],
/******/ result.outdatedDependencies[moduleId]
/******/ );
/******/ }
/******/ }
/******/ }
/******/ if (doDispose) {
/******/ addAllToSet(outdatedModules, [result.moduleId]);
/******/ appliedUpdate[moduleId] = warnUnexpectedRequire;
/******/ }
/******/ }
/******/ }
/******/ currentUpdate = undefined;
/******/
/******/ // Store self accepted outdated modules to require them later by the module system
/******/ var outdatedSelfAcceptedModules = [];
/******/ for (var j = 0; j < outdatedModules.length; j++) {
/******/ var outdatedModuleId = outdatedModules[j];
/******/ var module = __webpack_require__.c[outdatedModuleId];
/******/ if (
/******/ module &&
/******/ (module.hot._selfAccepted || module.hot._main) &&
/******/ // removed self-accepted modules should not be required
/******/ appliedUpdate[outdatedModuleId] !== warnUnexpectedRequire &&
/******/ // when called invalidate self-accepting is not possible
/******/ !module.hot._selfInvalidated
/******/ ) {
/******/ outdatedSelfAcceptedModules.push({
/******/ module: outdatedModuleId,
/******/ require: module.hot._requireSelf,
/******/ errorHandler: module.hot._selfAccepted
/******/ });
/******/ }
/******/ }
/******/
/******/ var moduleOutdatedDependencies;
/******/
/******/ return {
/******/ dispose: function () {
/******/ currentUpdateRemovedChunks.forEach(function (chunkId) {
/******/ delete installedChunks[chunkId];
/******/ });
/******/ currentUpdateRemovedChunks = undefined;
/******/
/******/ var idx;
/******/ var queue = outdatedModules.slice();
/******/ while (queue.length > 0) {
/******/ var moduleId = queue.pop();
/******/ var module = __webpack_require__.c[moduleId];
/******/ if (!module) continue;
/******/
/******/ var data = {};
/******/
/******/ // Call dispose handlers
/******/ var disposeHandlers = module.hot._disposeHandlers;
/******/ for (j = 0; j < disposeHandlers.length; j++) {
/******/ disposeHandlers[j].call(null, data);
/******/ }
/******/ __webpack_require__.hmrD[moduleId] = data;
/******/
/******/ // disable module (this disables requires from this module)
/******/ module.hot.active = false;
/******/
/******/ // remove module from cache
/******/ delete __webpack_require__.c[moduleId];
/******/
/******/ // when disposing there is no need to call dispose handler
/******/ delete outdatedDependencies[moduleId];
/******/
/******/ // remove "parents" references from all children
/******/ for (j = 0; j < module.children.length; j++) {
/******/ var child = __webpack_require__.c[module.children[j]];
/******/ if (!child) continue;
/******/ idx = child.parents.indexOf(moduleId);
/******/ if (idx >= 0) {
/******/ child.parents.splice(idx, 1);
/******/ }
/******/ }
/******/ }
/******/
/******/ // remove outdated dependency from module children
/******/ var dependency;
/******/ for (var outdatedModuleId in outdatedDependencies) {
/******/ if (__webpack_require__.o(outdatedDependencies, outdatedModuleId)) {
/******/ module = __webpack_require__.c[outdatedModuleId];
/******/ if (module) {
/******/ moduleOutdatedDependencies =
/******/ outdatedDependencies[outdatedModuleId];
/******/ for (j = 0; j < moduleOutdatedDependencies.length; j++) {
/******/ dependency = moduleOutdatedDependencies[j];
/******/ idx = module.children.indexOf(dependency);
/******/ if (idx >= 0) module.children.splice(idx, 1);
/******/ }
/******/ }
/******/ }
/******/ }
/******/ },
/******/ apply: function (reportError) {
/******/ // insert new code
/******/ for (var updateModuleId in appliedUpdate) {
/******/ if (__webpack_require__.o(appliedUpdate, updateModuleId)) {
/******/ __webpack_require__.m[updateModuleId] = appliedUpdate[updateModuleId];
/******/ }
/******/ }
/******/
/******/ // run new runtime modules
/******/ for (var i = 0; i < currentUpdateRuntime.length; i++) {
/******/ currentUpdateRuntime[i](__webpack_require__);
/******/ }
/******/
/******/ // call accept handlers
/******/ for (var outdatedModuleId in outdatedDependencies) {
/******/ if (__webpack_require__.o(outdatedDependencies, outdatedModuleId)) {
/******/ var module = __webpack_require__.c[outdatedModuleId];
/******/ if (module) {
/******/ moduleOutdatedDependencies =
/******/ outdatedDependencies[outdatedModuleId];
/******/ var callbacks = [];
/******/ var errorHandlers = [];
/******/ var dependenciesForCallbacks = [];
/******/ for (var j = 0; j < moduleOutdatedDependencies.length; j++) {
/******/ var dependency = moduleOutdatedDependencies[j];
/******/ var acceptCallback =
/******/ module.hot._acceptedDependencies[dependency];
/******/ var errorHandler =
/******/ module.hot._acceptedErrorHandlers[dependency];
/******/ if (acceptCallback) {
/******/ if (callbacks.indexOf(acceptCallback) !== -1) continue;
/******/ callbacks.push(acceptCallback);
/******/ errorHandlers.push(errorHandler);
/******/ dependenciesForCallbacks.push(dependency);
/******/ }
/******/ }
/******/ for (var k = 0; k < callbacks.length; k++) {
/******/ try {
/******/ callbacks[k].call(null, moduleOutdatedDependencies);
/******/ } catch (err) {
/******/ if (typeof errorHandlers[k] === "function") {
/******/ try {
/******/ errorHandlers[k](err, {
/******/ moduleId: outdatedModuleId,
/******/ dependencyId: dependenciesForCallbacks[k]
/******/ });
/******/ } catch (err2) {
/******/ if (options.onErrored) {
/******/ options.onErrored({
/******/ type: "accept-error-handler-errored",
/******/ moduleId: outdatedModuleId,
/******/ dependencyId: dependenciesForCallbacks[k],
/******/ error: err2,
/******/ originalError: err
/******/ });
/******/ }
/******/ if (!options.ignoreErrored) {
/******/ reportError(err2);
/******/ reportError(err);
/******/ }
/******/ }
/******/ } else {
/******/ if (options.onErrored) {
/******/ options.onErrored({
/******/ type: "accept-errored",
/******/ moduleId: outdatedModuleId,
/******/ dependencyId: dependenciesForCallbacks[k],
/******/ error: err
/******/ });
/******/ }
/******/ if (!options.ignoreErrored) {
/******/ reportError(err);
/******/ }
/******/ }
/******/ }
/******/ }
/******/ }
/******/ }
/******/ }
/******/
/******/ // Load self accepted modules
/******/ for (var o = 0; o < outdatedSelfAcceptedModules.length; o++) {
/******/ var item = outdatedSelfAcceptedModules[o];
/******/ var moduleId = item.module;
/******/ try {
/******/ item.require(moduleId);
/******/ } catch (err) {
/******/ if (typeof item.errorHandler === "function") {
/******/ try {
/******/ item.errorHandler(err, {
/******/ moduleId: moduleId,
/******/ module: __webpack_require__.c[moduleId]
/******/ });
/******/ } catch (err2) {
/******/ if (options.onErrored) {
/******/ options.onErrored({
/******/ type: "self-accept-error-handler-errored",
/******/ moduleId: moduleId,
/******/ error: err2,
/******/ originalError: err
/******/ });
/******/ }
/******/ if (!options.ignoreErrored) {
/******/ reportError(err2);
/******/ reportError(err);
/******/ }
/******/ }
/******/ } else {
/******/ if (options.onErrored) {
/******/ options.onErrored({
/******/ type: "self-accept-errored",
/******/ moduleId: moduleId,
/******/ error: err
/******/ });
/******/ }
/******/ if (!options.ignoreErrored) {
/******/ reportError(err);
/******/ }
/******/ }
/******/ }
/******/ }
/******/
/******/ return outdatedModules;
/******/ }
/******/ };
/******/ }
/******/ __webpack_require__.hmrI.jsonp = function (moduleId, applyHandlers) {
/******/ if (!currentUpdate) {
/******/ currentUpdate = {};
/******/ currentUpdateRuntime = [];
/******/ currentUpdateRemovedChunks = [];
/******/ applyHandlers.push(applyHandler);
/******/ }
/******/ if (!__webpack_require__.o(currentUpdate, moduleId)) {
/******/ currentUpdate[moduleId] = __webpack_require__.m[moduleId];
/******/ }
/******/ };
/******/ __webpack_require__.hmrC.jsonp = function (
/******/ chunkIds,
/******/ removedChunks,
/******/ removedModules,
/******/ promises,
/******/ applyHandlers,
/******/ updatedModulesList
/******/ ) {
/******/ applyHandlers.push(applyHandler);
/******/ currentUpdateChunks = {};
/******/ currentUpdateRemovedChunks = removedChunks;
/******/ currentUpdate = removedModules.reduce(function (obj, key) {
/******/ obj[key] = false;
/******/ return obj;
/******/ }, {});
/******/ currentUpdateRuntime = [];
/******/ chunkIds.forEach(function (chunkId) {
/******/ if (
/******/ __webpack_require__.o(installedChunks, chunkId) &&
/******/ installedChunks[chunkId] !== undefined
/******/ ) {
/******/ promises.push(loadUpdateChunk(chunkId, updatedModulesList));
/******/ currentUpdateChunks[chunkId] = true;
/******/ } else {
/******/ currentUpdateChunks[chunkId] = false;
/******/ }
/******/ });
/******/ if (__webpack_require__.f) {
/******/ __webpack_require__.f.jsonpHmr = function (chunkId, promises) {
/******/ if (
/******/ currentUpdateChunks &&
/******/ __webpack_require__.o(currentUpdateChunks, chunkId) &&
/******/ !currentUpdateChunks[chunkId]
/******/ ) {
/******/ promises.push(loadUpdateChunk(chunkId));
/******/ currentUpdateChunks[chunkId] = true;
/******/ }
/******/ };
/******/ }
/******/ };
/******/
/******/ __webpack_require__.hmrM = () => {
/******/ if (typeof fetch === "undefined") throw new Error("No browser support: need fetch API");
/******/ return fetch(__webpack_require__.p + __webpack_require__.hmrF()).then((response) => {
/******/ if(response.status === 404) return; // no update available
/******/ if(!response.ok) throw new Error("Failed to fetch update manifest " + response.statusText);
/******/ return response.json();
/******/ });
/******/ };
/******/
/******/ // no on chunks loaded
/******/
/******/ // no jsonp function
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // module cache are used so entry inlining is disabled
/******/ // startup
/******/ // Load entry module and return exports
/******/ var __webpack_exports__ = __webpack_require__(656);
/******/
/******/ })()
;