@qualcomm-ui/react-swagger 1.3.36 → 1.3.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,2 +1,2980 @@
1
- "use client";import{Fragment as e,createContext as t,memo as n,useCallback as r,useContext as i,useEffect as a,useEffectEvent as o,useMemo as s,useRef as c,useState as l}from"react";import u from"swagger-ui-react";import{clsx as d}from"@qualcomm-ui/utils/clsx";import{ChevronDown as f,ChevronRightIcon as p,ChevronUp as m,ChevronUpIcon as h,DownloadIcon as g,Edit2Icon as _,ExternalLinkIcon as v,FlaskConicalIcon as y,InfinityIcon as b,Link2 as x,Link2Icon as S,LockIcon as C,LockOpenIcon as w,MinusIcon as T,PlayIcon as E,PlusIcon as D,RotateCcw as O,Trash2Icon as k,XIcon as A}from"lucide-react";import{Button as j,IconButton as M}from"@qualcomm-ui/react/button";import{Icon as N}from"@qualcomm-ui/react/icon";import{booleanDataAttr as P}from"@qualcomm-ui/utils/attributes";import{create as F,createStore as I,useStore as L}from"zustand";import{Fragment as R,jsx as z,jsxs as B}from"react/jsx-runtime";import{PasswordInput as V}from"@qualcomm-ui/react/password-input";import{Dialog as H}from"@qualcomm-ui/react/dialog";import{TextInput as U}from"@qualcomm-ui/react/text-input";import{selectCollection as W}from"@qualcomm-ui/core/select";import{Checkbox as G}from"@qualcomm-ui/react/checkbox";import{Select as K}from"@qualcomm-ui/react/select";import q from"immutable";import J from"randombytes";import ee from"sha.js";import Y from"url-parse";import{useEffectOnce as te}from"@qualcomm-ui/react-core/effects";import{langs as X}from"@uiw/codemirror-extensions-langs";import{githubDark as ne,githubLight as re}from"@uiw/codemirror-theme-github";import ie from"@uiw/react-codemirror";import{CopyToClipboardIconButton as ae}from"@qualcomm-ui/react-mdx/copy-to-clipboard";import{Tooltip as oe}from"@qualcomm-ui/react/tooltip";import{sanitizeUrl as se}from"@braintree/sanitize-url";import ce from"css.escape";import{Accordion as Z}from"@qualcomm-ui/react/accordion";import{Tab as Q,Tabs as le}from"@qualcomm-ui/react/tabs";import{Collapsible as $}from"@qualcomm-ui/react/collapsible";import{toString as ue}from"lodash-es";import{Link as de}from"@qualcomm-ui/react/link";import{InlineNotification as fe}from"@qualcomm-ui/react/inline-notification";import{Progress as pe}from"@qualcomm-ui/react/progress";var DefaultKeyRenderer=()=>null;DefaultKeyRenderer.when=()=>!1;var createJsonViewerStore=e=>F()((t,n)=>({collapseStringsAfterLength:e.collapseStringsAfterLength===!1?Number.MAX_VALUE:e.collapseStringsAfterLength??50,colorspace:Ve,defaultInspectControl:e.defaultInspectControl??void 0,defaultInspectDepth:e.defaultInspectDepth??5,displayDataTypes:e.displayDataTypes??!0,displayKeyIndicator:e.displayKeyIndicator??!0,displayNumberKeys:e.displayNumberKeys??!0,displaySize:e.displaySize??!0,getInspectCache:(e,t)=>{let r=t===void 0?e.join(`.`):`${e.join(`.`)}[${t}]nt`;return n().inspectCache[r]},groupArraysAfterLength:e.groupArraysAfterLength??100,highlightUpdates:e.highlightUpdates??!1,hoverPath:null,indentWidth:e.indentWidth??3,inspectCache:{},keyRenderer:e.keyRenderer??DefaultKeyRenderer,maxDisplayLength:e.maxDisplayLength??30,objectSortKeys:e.objectSortKeys??!1,onChange:e.onChange??(()=>{}),prevValue:void 0,quotesOnKeys:e.quotesOnKeys??!1,renderLink:e.renderLink,rootName:e.rootName??`root`,setHover:(e,n)=>{t({hoverPath:e?{nestedIndex:n,path:e}:null})},setInspectCache:(e,n,r)=>{let i=r===void 0?e.join(`.`):`${e.join(`.`)}[${r}]nt`;t(e=>({inspectCache:{...e.inspectCache,[i]:typeof n==`function`?n(e.inspectCache[i]):n}}))},value:e.value})),me=t(null);me.Provider;var useJsonViewerStore=e=>{let t=i(me);if(!t)throw Error(`JsonModelViewer components must be wrapped in <JsonViewerProvider>`);return L(t,e)};RefName.displayName=`RefName`;function RefName({inspect:e,isArray:t,refName:n}){let r=useJsonViewerStore(e=>e.renderLink);return B(`span`,{className:`data-ref-name-wrapper`,children:[B(`span`,{className:d(`data-ref-name`,{inspect:e}),children:[n,t?`[]`:``]}),z(M,{density:`compact`,icon:S,render:z(r,{href:`#model-${n}`}),size:`sm`,variant:`ghost`})]})}function isObject(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`object`)}function isReferenceObject(e){return!!(e&&typeof e==`object`&&`properties`in e&&`type`in e&&e.type===`object`)}function isReferenceArray(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`array`&&`items`in e)}function getRefName(e){let t=``;return isReferenceObject(e)?t=e.$$ref?.substring(e.$$ref?.lastIndexOf(`/`)+1):isReferenceArray(e)&&(t=e.items.$$ref?.substring(e.items.$$ref?.lastIndexOf(`/`)+1)),t}function getArrayType(e){return e?.type&&(e.type===`string`||e.type===`boolean`||e.type===`integer`||e.type===`null`)?e.type:``}Object.prototype.constructor.toString();var isCycleReference=(e,t,n)=>{if(e===null||n===null||typeof e!=`object`||typeof n!=`object`)return!1;if(Object.is(e,n)&&t.length!==0)return``;let r=[],i=[...t],a=e;for(;a!==n||i.length!==0;){if(typeof a!=`object`||!a)return!1;if(Object.is(a,n))return r.reduce((e,t,n)=>typeof t==`number`?`${e}[${t}]`:`${e}${n===0?``:`.`}${t}`,``);let e=i.shift();r.push(e),a=a[e]}return!1};function getValueSize(e){return e===null?0:Array.isArray(e)?e.length:e instanceof Map||e instanceof Set?e.size:e instanceof Date?1:typeof e==`object`?Object.keys(e).length:typeof e==`string`?e.length:1}function segmentArray(e,t){let n=[],r=0;for(;r<e.length;)n.push(e.slice(r,r+t)),r+=t;return n}var he=`{`,ge=`[`,_e=`}`,ve=`]`;function inspectMetadata(e){let t=getValueSize(e),n=``;return(e instanceof Map||e instanceof Set)&&(n=e[Symbol.toStringTag]),Object.hasOwn(e,Symbol.toStringTag)&&(n=e[Symbol.toStringTag]),`${t} Items${n?` (${n})`:``}`}function PreObjectType(e){let t=useJsonViewerStore(e=>e.colorspace.base04),n=s(()=>e.arrayOverride||Array.isArray(e.value),[e.arrayOverride,e.value]),r=s(()=>getValueSize(e.value)===0,[e.value]),i=s(()=>inspectMetadata(e.value),[e.value]),a=useJsonViewerStore(e=>e.displaySize),o=s(()=>typeof a==`function`?a(e.path,e.value):a,[a,e.path,e.value]),c=useJsonViewerStore(e=>e.colorspace.base05),l=useIsCycleReference(e.path,e.value),u=e.refName;return B(`span`,{className:`data-object-start`,style:{color:c},children:[n?ge:he,u?z(RefName,{inspect:e.inspect,refName:u}):null,!u&&o&&e.inspect&&!r&&z(`span`,{className:`data-size-label`,style:{color:t},children:i}),l&&!e.inspect&&B(R,{children:[z(N,{className:`inline-icon`,icon:b,style:{color:c}}),l]})]})}function PostObjectType(e){let t=useJsonViewerStore(e=>e.colorspace.base04),n=s(()=>Array.isArray(e.value),[e.value]),r=s(()=>getValueSize(e.value)===0,[e.value]),i=s(()=>inspectMetadata(e.value),[e.value]),a=useJsonViewerStore(e=>e.displaySize),o=s(()=>typeof a==`function`?a(e.path,e.value):a,[a,e.path,e.value]),c=useJsonViewerStore(e=>e.colorspace.base06),l=e.refName;return B(`span`,{className:`data-object-end`,style:{color:c},children:[n?ve:_e,!l&&o&&(r||!e.inspect)?z(`span`,{className:`data-size-label`,style:{color:t},children:i}):null]})}function ObjectType(e){let t=useTextColor(),n=useJsonViewerStore(e=>e.colorspace.base02),r=useJsonViewerStore(e=>e.groupArraysAfterLength),i=useIsCycleReference(e.path,e.value),[a,o]=l(useJsonViewerStore(e=>e.maxDisplayLength)),c=useJsonViewerStore(e=>e.objectSortKeys),u=s(()=>{if(!e.inspect)return null;let t=e.value;if(Array.isArray(t)){if(t.length<=r){let n=t.slice(0,a).map((t,n)=>{let i=e.nestedIndex?e.nestedIndex*r+n:n,a=[...e.path,i];return z(DataKeyPair,{path:a,prevValue:Array.isArray(e.prevValue)?e.prevValue[i]:void 0,value:t},i)});if(t.length>a){let e=t.length-a;n.push(B(`div`,{className:`rest-spread`,onClick:()=>o(e=>e*2),children:[`hidden `,e,` items…`]},`last`))}return n}let n=segmentArray(t,r),i=Array.isArray(e.prevValue)?segmentArray(e.prevValue,r):void 0;return n.map((t,n)=>z(DataKeyPair,{nestedIndex:n,path:e.path,prevValue:i?.[n],value:t},n))}if(!t)return z(R,{});if(t.type===`object`&&t.properties)return z(DataKeyPair,{path:[],prevValue:e.prevValue,requiredProperties:e.requiredProperties,value:t.properties});let n=Object.entries(t).filter(([e])=>e!==`$$ref`);c&&(n=c===!0?n.sort(([e],[t])=>e.localeCompare(t)):n.sort(([e],[t])=>c(e,t)));let i=n.slice(0,a).map(([t,n])=>{let r=[...e.path,t],i=e.requiredProperties?.includes(t);return z(DataKeyPair,{isRequired:i,path:r,prevValue:e.prevValue?.[t],value:n},t)});if(n.length>a){let e=n.length-a;i.push(B(`div`,{className:`rest-spread no-select`,onClick:()=>o(e=>e*2),children:[`hidden `,e,` items…`]},`last`))}return i},[e,c,a,r]),d=e.inspect?.8:0,f=useJsonViewerStore(e=>e.indentWidth),p=e.inspect?f-d:f;return s(()=>getValueSize(e.value)===0,[e.value])?null:z(`div`,{className:`data-object`,style:{borderLeft:e.inspect?`1px solid ${n}`:`none`,color:t,display:e.inspect?`block`:`inline-block`,marginLeft:d*8,paddingLeft:e.inspect?(p-.6)*8:0},children:e.inspect?u:!i&&!e.refName&&z(`span`,{className:`data-object-body`,onClick:()=>e.setInspect(!0),children:`…`})})}var ye={Component:ObjectType,is:e=>typeof e==`object`,PostComponent:PostObjectType,PreComponent:PreObjectType};function PreArrayType(e){let t=e.refName,n=useJsonViewerStore(e=>e.colorspace.base06),r=getArrayType(e.value);return B(`span`,{className:`data-object-start`,style:{color:n},children:[z(`div`,{className:`indicator`,children:r?``:`[{`}),t?z(RefName,{inspect:e.inspect,isArray:!0,refName:t}):null]})}function PostArrayType(e){let t=useJsonViewerStore(e=>e.colorspace.base06),n=getArrayType(e.value);return z(`span`,{className:`data-object-end`,style:{color:t},children:z(`div`,{className:`indicator`,children:n?``:`}]`})})}function ArrayType(e){let t=getArrayType(e.value),n=useJsonViewerStore(e=>e.colorspace.base09);return t?B(`span`,{style:{color:n},children:[t,`[]`]}):z(ObjectType,{...e})}var be={Component:ArrayType,is:e=>isReferenceArray(e),PostComponent:PostArrayType,PreComponent:PreArrayType},DataTypeLabel=({dataType:e,enable:t=!0})=>t?z(`div`,{className:`data-type-label`,children:e}):null;function defineEasyType({colorKey:e,deserialize:t,displayTypeLabel:r=!0,is:i,Renderer:a,serialize:o,type:s}){let c=n(a),EasyType=t=>{let n=useJsonViewerStore(e=>e.displayDataTypes),i=useJsonViewerStore(t=>t.colorspace[e]);return B(`div`,{className:`simple-type`,style:{color:i},children:[r&&n&&z(DataTypeLabel,{dataType:s}),z(`div`,{className:`${s}-value simple-value`,children:z(c,{inspect:t.inspect,isRequired:t.isRequired,path:t.path,prevValue:t.prevValue,setInspect:t.setInspect,value:t.value})})]})};return EasyType.displayName=`easy-${s}-type`,!o||!t?{Component:EasyType,is:i}:{Component:EasyType,deserialize:t,is:i,serialize:o}}var xe=defineEasyType({colorKey:`base09`,is:e=>!!(e&&typeof e==`object`&&`type`in e&&e.type===`boolean`),Renderer:()=>z(`span`,{className:`data-value`,children:`boolean`}),type:`boolean`}),Se=defineEasyType({colorKey:`base0E`,deserialize:e=>{if(e===`true`)return!0;if(e===`false`)return!1;throw Error(`Invalid boolean value`)},is:e=>typeof e==`boolean`,Renderer:({value:e})=>z(R,{children:e?`true`:`false`}),serialize:e=>e.toString(),type:`bool`}),Ce={day:`numeric`,hour:`2-digit`,minute:`2-digit`,month:`short`,weekday:`short`,year:`numeric`},we=defineEasyType({colorKey:`base0D`,is:e=>e instanceof Date,Renderer:({value:e})=>z(R,{children:e.toLocaleTimeString(`en-us`,Ce)}),type:`date`}),functionBody=e=>{let t=e.toString(),n=!0,r=t.indexOf(`)`),i=t.indexOf(`=>`);return i!==-1&&i>r&&(n=!1),n?t.substring(t.indexOf(`{`,r)+1,t.lastIndexOf(`}`)):t.substring(t.indexOf(`=>`)+2)},functionName=e=>{let t=e.toString();return t.indexOf(`function`)===-1?t.substring(0,t.indexOf(`=>`)+2).trim():t.substring(8,t.indexOf(`{`)).trim()},Te=`{`,Ee=`}`,De={Component:e=>{let t=useJsonViewerStore(e=>e.colorspace.base05);return z(R,{children:z(`div`,{className:`data-function`,style:{color:t,display:e.inspect?`block`:`inline-block`,paddingLeft:e.inspect?16:0},children:e.inspect?functionBody(e.value):z(`span`,{className:`data-function-body`,onClick:()=>e.setInspect(!0),children:`…`})})})},is:e=>typeof e==`function`,PostComponent:()=>z(R,{children:z(`span`,{className:`data-function-end`,children:Ee})}),PreComponent:e=>B(R,{children:[z(DataTypeLabel,{dataType:`function`}),B(`span`,{className:`data-function-start`,children:[functionName(e.value),` `,Te]})]})},Oe=defineEasyType({colorKey:`base08`,displayTypeLabel:!1,is:e=>e===null,Renderer:()=>{let e=useJsonViewerStore(e=>e.colorspace.base02);return z(`div`,{className:`q-font-metadata-md-mono rounded-sm px-0.5 py-[1px]`,style:{backgroundColor:e},children:`NULL`})},type:`null`}),ke=defineEasyType({colorKey:`base09`,is:e=>!!(e&&typeof e==`object`&&`type`in e&&e.type===`integer`),Renderer:()=>z(`span`,{className:`data-value`,children:`integer`}),type:`integer`}),isInt=e=>e%1==0,Ae=defineEasyType({colorKey:`base08`,deserialize:e=>parseFloat(e),displayTypeLabel:!1,is:e=>typeof e==`number`&&isNaN(e),Renderer:()=>{let e=useJsonViewerStore(e=>e.colorspace.base02);return z(`div`,{className:`rounded-sm px-0.5 py-[1px]`,style:{backgroundColor:e},children:`NaN`})},serialize:()=>`NaN`,type:`NaN`}),je=defineEasyType({colorKey:`base0B`,deserialize:e=>parseFloat(e),is:e=>typeof e==`number`&&!isInt(e)&&!isNaN(e),Renderer:({value:e})=>z(R,{children:e}),serialize:e=>e.toString(),type:`float`}),Me=defineEasyType({colorKey:`base0F`,deserialize:e=>parseFloat(e),is:e=>typeof e==`number`&&isInt(e),Renderer:({value:e})=>z(R,{children:e}),serialize:e=>e.toString(),type:`int`}),Ne=defineEasyType({colorKey:`base0F`,deserialize:e=>BigInt(e.replace(/\D/g,``)),is:e=>typeof e==`bigint`,Renderer:({value:e})=>z(R,{children:`${e}n`}),serialize:e=>e.toString(),type:`bigint`});function isEnum(e){return!!(e.value&&typeof e.value==`object`&&`enum`in e.value)}var Pe=defineEasyType({colorKey:`base09`,is:e=>!!(e&&typeof e==`object`&&`type`in e&&e.type===`string`&&isEnum({value:e})),Renderer(e){let t=e.value.enum;return B(R,{children:[z(`div`,{className:`data-value`,children:`string enum`}),B(`div`,{className:`data-value-enum`,children:[`[`,t.map(e=>typeof e==`string`?`"${e}"`:e).join(`, `),`]`]})]})},type:`string`}),Fe=defineEasyType({colorKey:`base09`,is:e=>!!(e&&typeof e==`object`&&`type`in e&&e.type===`string`&&!isEnum({value:e})),Renderer:()=>z(`span`,{className:`data-value`,children:`string`}),type:`string`}),Ie=defineEasyType({colorKey:`base09`,deserialize:e=>e,is:e=>typeof e==`string`,Renderer:e=>{let[t,n]=l(!1),r=useJsonViewerStore(e=>e.collapseStringsAfterLength),i=t?e.value:e.value.slice(0,r),a=e.value.length>r;return B(`span`,{className:`data-value`,onClick:()=>{window.getSelection()?.type!==`Range`&&a&&n(e=>!e)},style:{cursor:a?`pointer`:`inherit`},children:[`"`,i,a&&!t&&z(`span`,{className:`show-rest`,children:`…`}),`"`]})},serialize:e=>e,type:`string`}),Le=defineEasyType({colorKey:`base05`,displayTypeLabel:!1,is:e=>e===void 0,Renderer:()=>{let e=useJsonViewerStore(e=>e.colorspace.base02);return z(`div`,{className:`rounded-sm px-0.5 py-[1px]`,style:{backgroundColor:e},children:`undefined`})},type:`undefined`});function memoizeDataType(e){function compare(e,t){return Object.is(e.value,t.value)&&e.inspect&&t.inspect&&e.path?.join(`.`)===t.path?.join(`.`)}return e.Component=n(e.Component,compare),e.Editor&&=n(e.Editor,function(e,t){return Object.is(e.value,t.value)}),e.PreComponent&&=n(e.PreComponent,compare),e.PostComponent&&=n(e.PostComponent,compare),e}var Re=[memoizeDataType(Se),memoizeDataType(we),memoizeDataType(Oe),memoizeDataType(Le),memoizeDataType(Ie),memoizeDataType(De),memoizeDataType(Ae),memoizeDataType(Me),memoizeDataType(je),memoizeDataType(Ne),memoizeDataType(Fe),memoizeDataType(Pe),memoizeDataType(ke),memoizeDataType(xe),memoizeDataType(be)],createTypeRegistryStore=()=>I()(e=>({registerTypes:t=>{e(e=>({registry:typeof t==`function`?t(e.registry):t}))},registry:Re})),ze=t(null);ze.Provider;var useTypeRegistryStore=(e,t)=>{let n=i(ze);return L(n,e,t)};function matchTypeComponents(e,t,n){let r;for(let i of n)i.is(e,t)&&(r=i);if(r===void 0){if(typeof e==`object`)return ye;throw Error(`No type matched for value`,{cause:e})}return r}function useTypeComponents(e,t){let n=useTypeRegistryStore(e=>e.registry);return s(()=>matchTypeComponents(e,t,n),[e,t,n])}var useTextColor=()=>useJsonViewerStore(e=>e.colorspace.base07);function useIsCycleReference(e,t){let n=useJsonViewerStore(e=>e.value);return s(()=>e[e.length-1]!==`properties`&&isCycleReference(n,e,t),[e,t,n])}function useInspect(e,t,n){let i=e.length,o=useIsCycleReference(e,t),s=useJsonViewerStore(e=>e.getInspectCache),c=useJsonViewerStore(e=>e.setInspectCache),u=useJsonViewerStore(e=>e.defaultInspectDepth),d=useJsonViewerStore(e=>e.defaultInspectControl);a(()=>{if(s(e,n)!==void 0)return;if(n!==void 0){c(e,!1,n);return}let r=o?!1:typeof d==`function`?d(e,t):i<u;c(e,r)},[u,d,i,s,o,n,e,t,c]);let[f,p]=l(()=>{let r=s(e,n);return r===void 0?n===void 0?o?!1:typeof d==`function`?d(e,t):i<u:!1:r});return[f,r(t=>{p(r=>{let i=typeof t==`boolean`?t:t(r);return c(e,i,n),i})},[n,e,c])]}function DataKeyPair(e){let{nestedIndex:t,path:n,prevValue:i,value:o}=e,{Component:u,PostComponent:h,PreComponent:g}=useTypeComponents(o,n),_=n.length,v=n[_-1],y=useJsonViewerStore(e=>e.setHover),b=useJsonViewerStore(e=>e.value),[x,S]=useInspect(n,o,t),C=useTextColor(),w=useJsonViewerStore(e=>e.colorspace.base0C),T=useJsonViewerStore(e=>e.colorspace.base0A),E=useJsonViewerStore(e=>e.quotesOnKeys),D=useJsonViewerStore(e=>e.rootName),O=useJsonViewerStore(e=>e.displayNumberKeys),k=b===o,A=Number.isInteger(Number(v)),j=useJsonViewerStore(e=>e.highlightUpdates),F=s(()=>!j||i===void 0?!1:typeof o==typeof i?typeof o==`number`?isNaN(o)&&isNaN(i)?!1:o!==i:Array.isArray(o)===Array.isArray(i)?typeof o==`object`||typeof o==`function`?!1:o!==i:!0:!0,[j,i,o]),I=c(null);a(()=>{I.current&&F&&`animate`in I.current&&I.current.animate([{backgroundColor:T},{backgroundColor:``}],{duration:1e3,easing:`ease-in`})},[T,F,i,o]);let L=s(()=>getValueSize(o)===0,[o]),V=!L&&!!(g&&h),H=useJsonViewerStore(e=>e.keyRenderer),[U,W]=l(!1),G=s(()=>({inspect:x,isRequired:e.isRequired,nestedIndex:t,path:[...n,`properties`],prevValue:i,refName:getRefName(o),requiredProperties:typeof o==`object`&&o&&`required`in o?o.required:null,setInspect:S,value:isReferenceObject(o)?o.properties:isReferenceArray(o)?`properties`in o.items?o.items.properties:o.items:o}),[x,t,n,i,o,e.isRequired,S]),K=r(e=>{e.isDefaultPrevented()||L||S(e=>!e)},[L,S]),q=r(()=>y(n,t),[y,n,t]),J=useJsonViewerStore(e=>e.colorspace.base05),ee=useJsonViewerStore(e=>e.displayKeyIndicator),Y=typeof e.value==`object`&&e.value&&`description`in e.value?e.value.description:void 0,te=B(`span`,{children:[v,e.isRequired?z(`span`,{className:`key-required-indicator`,children:`*`}):null]});return z(`div`,{className:d(`data-key-pair`,e.className),"data-expandable":P(V),"data-has-description":P(!!Y),"data-is-enum-type":P(isEnum(e)),"data-testid":`data-key-pair-${n.join(`.`)}`,onMouseEnter:q,style:e.style,children:B(`div`,{className:`data-key-pair-content`,children:[B(`span`,{className:`data-key`,"data-expandable":P(V),onClick:K,style:{color:C},children:[V?z(`span`,{className:`inline-icon expand-icon`,children:z(N,{className:`inline-icon`,icon:p,style:{color:J,transform:x?`rotate(90deg)`:`unset`,transition:`transform 161ms ease`}})}):null,z(`span`,{ref:I,children:k&&_===0?D===!1?null:E?B(R,{children:[`"`,D,`"`]}):z(R,{children:D}):H.when(G)?z(H,{...G}):t===void 0&&(A?z(R,{children:O?z(`span`,{style:{color:w},children:v}):null}):E?B(R,{children:[`"`,te,`"`]}):z(R,{children:te}))}),ee?k?D!==!1&&z(`div`,{className:`indicator`,children:`:`}):t===void 0&&z(`div`,{className:`indicator`,children:`:`}):null,g&&z(g,{...G})]}),u?Y&&!isObject(o)&&!isReferenceArray(o)?B(`div`,{className:`data-key-description-container`,children:[z(u,{...G}),z(M,{className:`data-key-description-expand-button`,density:`compact`,icon:U?m:f,onClick:()=>W(!U),size:`sm`,variant:`ghost`})]}):z(u,{...G}):z(`span`,{className:`data-value-fallback`,children:`fallback: ${o}`}),Y&&U?z(`div`,{className:`data-key-description`,children:Y}):null,h&&z(h,{...G})]})})}var Be={author:`mac gainor (https://github.com/mac-s-g)`,base0A:`#ffd500`,base0B:`#859900`,base0C:`#6c71c4`,base0D:`#586e75`,base0E:`#2aa198`,base0F:`#268bd2`,base00:`rgba(0, 0, 0, 0)`,base01:`rgb(245, 245, 245)`,base02:`rgb(235, 235, 235)`,base03:`#93a1a1`,base04:`rgba(0, 0, 0, 0.3)`,base05:`#586e75`,base06:`#073642`,base07:`#002b36`,base08:`#d33682`,base09:`#cb4b16`,scheme:`Light Theme`},Ve={author:`Chris Kempson (http://chriskempson.com)`,base0A:`#f7ca88`,base0B:`#a1b56c`,base0C:`#86c1b9`,base0D:`#7cafc2`,base0E:`#a5d6ff`,base0F:`#e8e8e8`,base00:`#181818`,base01:`#282828`,base02:`#383838`,base03:`#585858`,base04:`#b8b8b8`,base05:`#d8d8d8`,base06:`#e8e8e8`,base07:`#d2a8ff`,base08:`#ab4642`,base09:`#a5d6ff`,scheme:`Dark Theme`},JsonViewerInternal=e=>{let{setState:t}=i(me);a(()=>{t(t=>({prevValue:t.value,value:e.value}))},[e.value,t]),a(()=>{e.theme===`light`?t({colorspace:Be}):e.theme===`dark`?t({colorspace:Ve}):typeof e.theme==`object`&&t({colorspace:e.theme})},[t,e.theme]);let n=s(()=>typeof e.theme==`object`?`json-viewer-theme-custom`:e.theme===`dark`?`json-viewer-theme-dark`:`json-viewer-theme-light`,[e.theme]),o=c(!0),l=useTypeRegistryStore(e=>e.registerTypes);o.current&&=(l(e.valueTypes?[...Re,...e.valueTypes]:[...Re]),!1),a(()=>{let t=e.valueTypes?[...Re,...e.valueTypes]:[...Re];l(t)},[e.valueTypes,l]);let u=useJsonViewerStore(e=>e.value),f=useJsonViewerStore(e=>e.prevValue),p=s(()=>[],[]),m=useJsonViewerStore(e=>e.setHover),h=r(()=>m(null),[m]);return B(`div`,{className:d(`json-model-viewer`,n,e.className),onMouseLeave:h,style:{...e.style,contentVisibility:`auto`},children:[z(`div`,{className:`model-gutter`}),z(DataKeyPair,{path:p,prevValue:f,value:u})]})};function JsonModelViewer(e){process.env.NODE_ENV!==`production`&&`displayObjectSize`in e&&console.error("`displayObjectSize` is deprecated. Use `displaySize` instead.\nSee https://viewer.textea.io/migration/migration-v3#raname-displayobjectsize-to-displaysize for more information.");let t=s(()=>e.theme===`auto`?`dark`:e.theme??`light`,[!0,e.theme]),n={...e,theme:t},r=s(()=>createJsonViewerStore(e),[]),i=s(()=>createTypeRegistryStore(),[]);return z(ze.Provider,{value:i,children:z(me.Provider,{value:r,children:z(JsonViewerInternal,{...n})})})}var He=t(`dark`),Ue=He.Provider;function useThemeContext(){return i(He)}ArrayModel.displayName=`ArrayModel`;function ArrayModel(e){let{schema:t}=e,n=e.getComponent(`RenderLink`),r=t.get(`title`)||e.displayName||e.name,i=r?z(`button`,{className:`model-box-control`,onClick:()=>e.onToggle?.(e.name,!e.expanded),children:z(`span`,{className:`model-title__text`,children:r})}):null,a=t.toJS(),o=useThemeContext();return B(`div`,{className:`array-model`,children:[i,z(JsonModelViewer,{displayDataTypes:!1,displaySize:!1,groupArraysAfterLength:100,highlightUpdates:!0,indentWidth:2,renderLink:n,rootName:!1,theme:o,value:a})]})}function ApiKeyAuth(e){let getValue=()=>{let{authorized:t,name:n}=e;return t&&t.getIn([n,`value`])},[t,n]=l({name:e.name,schema:e.schema,value:getValue()}),onChange=r=>{let i={...t,value:r};n(i),e.onChange?.(i)},{errSelectors:r,getComponent:i,name:a,schema:o}=e,s=i(`Row`),c=i(`Col`),u=i(`authError`),d=i(`Markdown`,!0),f=i(`JumpToPath`,!0),p=getValue(),m=r.allErrors().filter(e=>e.get(`authId`)===a);return B(`div`,{className:`api-key-wrapper`,children:[B(`h4`,{className:`api-key-wrapper-header`,children:[z(`code`,{children:a||o.get(`name`)}),` (apiKey)`,z(f,{path:[`securityDefinitions`,a]})]}),p&&z(`h6`,{children:`Authorized`}),z(s,{children:z(d,{source:o.get(`description`)})}),z(s,{children:B(`p`,{className:`text-body-sm`,children:[`Name: `,z(`code`,{className:`qui-code`,children:o.get(`name`)})]})}),z(s,{children:B(`p`,{className:`text-body-sm`,children:[`In: `,z(`code`,{className:`qui-code`,children:o.get(`in`)})]})}),z(s,{children:z(c,{children:z(V,{"aria-label":o.get(`name`),className:`swagger-input`,disabled:!!p,inputProps:{autoFocus:!0},onValueChange:onChange})})}),m.valueSeq().map((e,t)=>z(u,{error:e},t))]})}function AuthItem(e){let{authorized:t,errSelectors:n,getComponent:r,name:i,onAuthChange:a,schema:o}=e,s=r(`apiKeyAuth`),c=r(`basicAuth`),l,u=o.get(`type`);switch(u){case`apiKey`:l=z(s,{authorized:t,errSelectors:n,getComponent:r,name:i,onChange:a,schema:o},i);break;case`basic`:l=z(c,{authorized:t,errSelectors:n,getComponent:r,name:i,onChange:a,schema:o},i);break;default:l=B(`div`,{children:[`Unknown security definition type `,u]},i)}return z(`div`,{children:l},`${i}-jump`)}function AuthorizationPopup({authActions:e,authSelectors:t,errSelectors:n,fn:r,getComponent:i,specSelectors:a}){let close=()=>{e.showDefinitions(!1)},o=t.shownDefinitions(),s=i(`auths`);return z(H.Root,{defaultOpen:!0,onOpenChange:e=>{e||close()},size:`md`,children:z(H.FloatingPortal,{children:B(H.Body,{className:`swagger-ui`,children:[z(H.CloseButton,{}),z(H.Heading,{children:`Available Authorizations`}),z(H.Description,{className:`authorization-popup-dialog-body`,children:o.valueSeq().map((o,c)=>z(s,{AST:r.AST,authActions:e,authSelectors:t,definitions:o,errSelectors:n,getComponent:i,specSelectors:a},c))})]})})})}function AuthorizeBtn({getComponent:e,isAuthorized:t,onClick:n,showPopup:r}){let i=e(`authorizationPopup`,!0);return B(`div`,{className:`auth-wrapper`,children:[z(j,{emphasis:`primary`,endIcon:t?C:w,onClick:n,variant:`fill`,children:`Authorize`}),r&&z(i,{})]})}AuthorizeOperationBtn.displayName=`AuthorizeOperationBtn`;function AuthorizeOperationBtn(e){function onClick(t){t.stopPropagation(),e.onClick?.()}let{isAuthorized:t}=e;return z(M,{"aria-label":t?`authorization button locked`:`authorization button unlocked`,icon:t?C:w,onClick,size:`sm`,variant:`ghost`})}function Auths(e){let[t,n]=l({}),onAuthChange=e=>{let{name:r}=e;n({...t,[r]:e})},submitAuth=n=>{n.preventDefault();let{authActions:r}=e;r.authorizeWithPersistOption(t)},logoutClick=t=>{t.preventDefault();let{authActions:r,definitions:i}=e,a=i.map((e,t)=>t).toArray();n(a.reduce((e,t)=>({...e,[t]:``}),{})),r.logoutWithPersistOption(a)},close=t=>{t.preventDefault();let{authActions:n}=e;n.showDefinitions(!1)},{authSelectors:r,definitions:i,errSelectors:a,getComponent:o}=e,s=o(`AuthItem`),c=o(`oauth2`,!0),u=r.authorized(),d=i.filter((e,t)=>!!u.get(t)),f=i.filter(e=>e.get(`type`)!==`oauth2`),p=i.filter(e=>e.get(`type`)===`oauth2`),m=f.entrySeq().map(([e,t])=>z(s,{authorized:u,errSelectors:a,getComponent:o,name:e,onAuthChange,schema:t},e));return B(`div`,{className:`auth-container`,children:[!!f.size&&B(`form`,{onSubmit:submitAuth,children:[m,B(`div`,{className:`auth-btn-wrapper`,children:[f.size===d.size?z(j,{"aria-label":`Remove authorization`,onClick:logoutClick,variant:`outline`,children:`Logout`}):z(j,{"aria-label":`Apply credentials`,emphasis:`primary`,type:`submit`,variant:`fill`,children:`Authorize`}),z(j,{onClick:close,variant:`outline`,children:`Close`})]})]}),p&&p.size?B(`div`,{className:`oauth-wrapper`,children:[B(`div`,{className:`scope-def`,children:[z(`p`,{children:`Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.`}),z(`p`,{children:`API requires the following scopes. Select which ones you want to grant to Swagger UI.`})]}),i.filter(e=>e.get(`type`)===`oauth2`).entrySeq().map(([e,t])=>z(`div`,{children:z(c,{authorized:u,name:e,schema:t})},e)).toArray()]}):null]})}function BasicAuth(e){let[t,n]=l({name:e.name,schema:e.schema,value:{}}),getValue=()=>{let{authorized:t,name:n}=e;return t&&t.getIn([n,`value`])||{}},onChange=(r,i)=>{let{onChange:a}=e,o={...t.value,[i]:r};n({...t,value:o}),a(t)},{errSelectors:r,getComponent:i,name:a,schema:o}=e,s=i(`Row`),c=i(`Col`),u=i(`authError`),d=i(`JumpToPath`,!0),f=i(`Markdown`,!0),p=getValue().username,m=r.allErrors().filter(e=>e.get(`authId`)===a);return B(`div`,{children:[B(`h4`,{children:[`Basic authorization`,z(d,{path:[`securityDefinitions`,a]})]}),p&&z(`h6`,{children:`Authorized`}),z(s,{children:z(f,{source:o.get(`description`)})}),z(s,{children:p?z(U,{clearable:!1,disabled:!0,label:`Username`,value:p}):z(c,{children:z(U,{inputProps:{autoFocus:!0,id:`auth_username`},label:`Username`,name:`username`,onValueChange:e=>onChange(e,`username`)})})}),z(s,{children:p?z(V,{clearable:!1,disabled:!0,label:`Password`,value:t.value?.[t.name]||``}):z(c,{children:z(V,{inputProps:{id:`auth_password`},label:`Password`,name:`password`,onValueChange:e=>onChange(e,`password`)})})}),m.valueSeq().map((e,t)=>z(u,{error:e},t))]})}function b64toB64UrlEncoded(e){return e.replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function generateCodeVerifier(){return b64toB64UrlEncoded(J(32).toString(`base64`))}function createCodeChallenge(e){return b64toB64UrlEncoded(ee(`sha256`).update(e).digest(`base64`))}function sanitizeUrl$2(e){if(typeof e!=`string`||e.trim()===``)return``;let t=e.trim(),n=`about:blank`;try{let e=`https://base${String(Math.random()).slice(2)}`,r=new URL(t,e),i=r.protocol.slice(0,-1);return[`javascript`,`data`,`vbscript`].includes(i.toLowerCase())?n:r.origin===e?t.startsWith(`/`)?`${r.pathname}${r.search}${r.hash}`:t.startsWith(`./`)||t.startsWith(`../`)?`${t?.match(/^(\.\.?\/)+/)?.[0]}${r.pathname.substring(1)}${r.search}${r.hash}`:`${r.pathname.substring(1)}${r.search}${r.hash}`:String(r)}catch{return n}}function authorizeOauth2({auth:e,authActions:t,authConfigs:n={},configs:r,currentServer:i,errActions:a}){let{clientId:o,name:s,schema:c,scopes:l}=e,u=c.get(`flow`),d=[];switch(u){case`password`:t.authorizePassword(e);return;case`application`:t.authorizeApplication(e);return;case`accessCode`:d.push(`response_type=code`);break;case`implicit`:d.push(`response_type=token`);break;case`clientCredentials`:case`client_credentials`:t.authorizeApplication(e);return;case`authorizationCode`:case`authorization_code`:d.push(`response_type=code`)}typeof o==`string`&&d.push(`client_id=${encodeURIComponent(o)}`);let f=r.oauth2RedirectUrl;if(f===void 0){a.newAuthErr({authId:s,level:`error`,message:`oauth2RedirectUrl configuration is not passed. Oauth2 authorization cannot be performed.`,source:`validation`});return}d.push(`redirect_uri=${encodeURIComponent(f)}`);let p=[];if(Array.isArray(l)?p=l:q.List.isList(l)&&(p=l.toArray()),p.length>0){let e=n.scopeSeparator||` `;d.push(`scope=${encodeURIComponent(p.join(e))}`)}let m=btoa(new Date().toString());if(d.push(`state=${encodeURIComponent(m)}`),n.realm!==void 0&&d.push(`realm=${encodeURIComponent(n.realm)}`),(u===`authorizationCode`||u===`authorization_code`||u===`accessCode`)&&n.usePkceWithAuthorizationCodeGrant){let t=generateCodeVerifier(),n=createCodeChallenge(t);d.push(`code_challenge=${n}`),d.push(`code_challenge_method=S256`),e.codeVerifier=t}let{additionalQueryStringParams:h}=n;for(let e in h)h[e]!==void 0&&d.push([e,h[e]].map(encodeURIComponent).join(`=`));let g=c.get(`authorizationUrl`),_;_=i?Y(sanitizeUrl$2(g),i,!0).toString():sanitizeUrl$2(g);let v=[_,d.join(`&`)].join(typeof g==`string`&&!g.includes(`?`)?`?`:`&`),y;y=u===`implicit`?t.preAuthorizeImplicit:n.useBasicAuthenticationWithAccessCodeGrant?t.authorizeAccessCodeWithBasicAuthentication:t.authorizeAccessCodeWithFormParams,t.authPopup(v,{auth:e,callback:y,errCb:a.newAuthErr,redirectUrl:f,state:m})}Oauth2.displayName=`Oauth2`;function Oauth2(e){let{authorized:t,authSelectors:n,errSelectors:r,getComponent:i,name:a,schema:o,specSelectors:s}=e,c=t&&t.get(a),u=n.getConfigs()||{},d=c&&c.get(`username`)||``,f=c&&c.get(`clientId`)||u.clientId||``,p=c&&c.get(`clientSecret`)||u.clientSecret||``,m=c&&c.get(`passwordType`)||`basic`,h=c&&c.get(`scopes`)||u.scopes||[];typeof h==`string`&&(h=h.split(u.scopeSeparator||` `));let[g,_]=l({appName:u.appName,clientId:f,clientSecret:p,name:a,password:``,passwordType:m,schema:o,scopes:h,username:d}),close=t=>{t.preventDefault();let{authActions:n}=e;n.showDefinitions(!1)},authorize=()=>{let{authActions:t,authSelectors:n,errActions:r,getConfigs:i,oas3Selectors:o}=e,s=i(),c=n.getConfigs();r.clear({authId:a,source:`auth`,type:`auth`}),authorizeOauth2({auth:g,authActions:t,authConfigs:c,configs:s,currentServer:o.serverEffectiveValue(o.selectedServer()),errActions:r})},onScopeChange=(e,t)=>{if(t&&g.scopes.indexOf(e)===-1){let t=g.scopes.concat([e]);_(e=>({...e,scopes:t}))}else!t&&g.scopes.indexOf(e)>-1&&_(t=>({...t,scopes:g.scopes.filter(t=>t!==e)}))},onInputChange=(e,t)=>{let n={[e]:t};_(e=>({...e,...n}))},selectScopes=t=>{t.target.dataset.all?_(t=>({...t,scopes:Array.from((e.schema.get(`allowedScopes`)||e.schema.get(`scopes`)).keys())})):_(e=>({...e,scopes:[]}))},logout=t=>{t.preventDefault();let{authActions:n,errActions:r,name:i}=e;r.clear({authId:i,source:`auth`,type:`auth`}),n.logoutWithPersistOption([i])},v=i(`Row`),y=i(`Col`),b=i(`authError`),x=i(`JumpToPath`,!0),S=i(`Markdown`,!0),{isOAS3:C}=s,w=C()?o.get(`openIdConnectUrl`):null,T=`implicit`,E=`password`,D=C()?w?`authorization_code`:`authorizationCode`:`accessCode`,O=C()?w?`client_credentials`:`clientCredentials`:`application`;u=n.getConfigs()||{};let k=!!u.usePkceWithAuthorizationCodeGrant,A=o.get(`flow`),M=A===D&&k?`${A} with PKCE`:A;h=o.get(`allowedScopes`)||o.get(`scopes`);let N=!!n.authorized().get(a),P=r.allErrors().filter(e=>e.get(`authId`)===a),F=!P.filter(e=>e.get(`source`)===`validation`).size,I=o.get(`description`);return B(`div`,{className:`oauth2-wrapper`,children:[B(`h4`,{className:`oauth2-heading`,children:[a,` (OAuth2, `,M,`)`,` `,z(x,{path:[`securityDefinitions`,a]})]}),g.appName?B(`h5`,{children:[`Application: `,g.appName,` `]}):null,I&&z(S,{source:o.get(`description`)}),N&&z(`h6`,{children:`Authorized`}),w&&B(`p`,{className:`text-body-sm`,children:[`OpenID Connect URL: `,z(`code`,{className:`qui-code`,children:w})]}),(A===T||A===D)&&B(`p`,{className:`text-body-sm`,children:[`Authorization URL:`,` `,z(`code`,{className:`qui-code`,children:o.get(`authorizationUrl`)})]}),(A===E||A===D||A===O)&&B(`p`,{className:`text-body-sm`,children:[`Token URL:`,B(`code`,{className:`qui-code`,children:[` `,o.get(`tokenUrl`)]})]}),B(`p`,{className:`text-body-sm`,children:[`Flow: `,z(`code`,{className:`qui-code`,children:M})]}),A===E?B(v,{children:[z(v,{children:z(y,{desktop:10,tablet:10,children:z(U,{disabled:N,inputProps:{autoFocus:!0,"data-name":`username`},label:`Username`,onValueChange:e=>onInputChange(`username`,e)})})}),z(v,{children:z(y,{desktop:10,tablet:10,children:z(V,{className:`swagger-input`,disabled:N,onValueChange:e=>onInputChange(`password`,e)})})}),z(v,{children:z(y,{desktop:10,tablet:10,children:z(K,{collection:W({items:[{label:`Authorization header`,value:`basic`},{label:`Request body`,value:`request-body`}]}),defaultValue:[`basic`],disabled:N,label:`Client credentials location:`,onValueChange:e=>onInputChange(`passwordType`,e[0]),size:`sm`})})})]}):null,(A===O||A===T||A===D||A===E)&&(!N||N&&g.clientId)&&z(v,{children:z(y,{desktop:10,tablet:10,children:z(U,{className:`swagger-input`,defaultValue:g.clientId,disabled:N,label:`client_id`,onValueChange:e=>onInputChange(`clientId`,e)})})}),(A===O||A===D||A===E)&&z(v,{children:z(y,{desktop:10,tablet:10,children:z(V,{className:`swagger-input`,defaultValue:g.clientSecret,disabled:N,label:`client_secret`,onValueChange:e=>onInputChange(`clientSecret`,e)})})}),!N&&h&&h.size?B(`div`,{className:`scopes`,children:[B(`div`,{className:`scope-actions`,children:[`Scopes:`,z(`button`,{className:`q-text-link`,"data-all":!0,onClick:selectScopes,children:`select all`}),z(`button`,{className:`q-text-link`,onClick:selectScopes,children:`select none`})]}),h.map((e,t)=>z(v,{children:z(G,{checked:g.scopes.includes(t),controlProps:{"data-value":t},disabled:N,label:B(`div`,{className:`text`,children:[z(`p`,{className:`name`,children:t}),z(`p`,{className:`description`,children:e})]}),onCheckedChange:e=>{onScopeChange(t,e)}})},t)).toArray()]}):null,P.valueSeq().map((e,t)=>z(b,{error:e},t)),B(`div`,{className:`auth-btn-wrapper`,children:[F&&(N?z(j,{"aria-label":`Remove authorization`,onClick:logout,variant:`fill`,children:`Logout`}):z(j,{"aria-label":`Apply given OAuth2 credentials`,emphasis:`primary`,onClick:authorize,variant:`fill`,children:`Authorize`})),z(j,{onClick:close,variant:`outline`,children:`Close`})]})]})}function Clear(e){return z(j,{endIcon:k,onClick:()=>{let{method:t,path:n,specActions:r}=e;r.clearResponse(n,t),r.clearRequest(n,t)},variant:`outline`,children:`Clear`})}function ContentType({ariaControls:e,ariaLabel:t,contentTypes:n,label:r,onChange:i,value:o=null}){let c=s(()=>q.fromJS(n),[n]),l=s(()=>!c||!c.size?null:W({items:c.toArray()}),[c]);return te(()=>{c&&i&&i(c.first())}),a(()=>{c&&o&&!c.includes(o)&&i&&c.size&&i(c.first())},[c,i,o]),!c||!c.size||!l?null:z(K,{clearable:!1,collection:l,controlProps:{"aria-controls":e,"aria-label":t||`Content Type`},label:r?.trim()||void 0,onClick:e=>{e.preventDefault()},onValueChange:e=>i?.(e[0]),size:`sm`,style:{minWidth:180},value:o?[o]:[]})}EnumModel.displayName=`EnumModel`;var KeyRenderer=()=>null;KeyRenderer.when=()=>!0;function EnumModel({getComponent:e,value:t}){let n=e(`RenderLink`),r=useThemeContext();return z(JsonModelViewer,{defaultInspectDepth:25,displayDataTypes:!1,displayKeyIndicator:!1,displaySize:!1,groupArraysAfterLength:100,indentWidth:2,keyRenderer:KeyRenderer,renderLink:n,rootName:!1,theme:r,value:t.toJSON()})}function Execute(e){let handleValidateParameters=()=>{let{method:t,path:n,specActions:r,specSelectors:i}=e;return r.validateParams([n,t]),i.validateBeforeExecute([n,t])},handleValidateRequestBody=()=>{let{method:t,oas3Actions:n,oas3Selectors:r,path:i,specSelectors:a}=e,o={missingBodyValue:!1,missingRequiredKeys:[]};n.clearRequestBodyValidateError({method:t,path:i});let s=a.getOAS3RequiredRequestBodyContentType([i,t]),c=r.requestBodyValue(i,t),l=r.validateBeforeExecute([i,t]),u=r.requestContentType(i,t);if(!l)return o.missingBodyValue=!0,n.setRequestBodyValidateError({method:t,path:i,validationErrors:o}),!1;if(!s)return!0;let d=r.validateShallowRequired({oas3RequestBodyValue:c,oas3RequestContentType:u,oas3RequiredRequestBodyContentType:s});if(!d||d.length<1)return!0;for(let e of d)o.missingRequiredKeys.push(e);return n.setRequestBodyValidateError({method:t,path:i,validationErrors:o}),!1},handleValidationResultPass=()=>{let{method:t,operation:n,path:r,specActions:i}=e;e.onExecute&&e.onExecute(),i.execute({method:t,operation:n,path:r})},handleValidationResultFail=()=>{let{method:t,path:n,specActions:r}=e;r.clearValidateParams([n,t]),setTimeout(()=>{r.validateParams([n,t])},40)},handleValidationResult=e=>{e?handleValidationResultPass():handleValidationResultFail()},onClick=()=>{let e=handleValidateParameters(),t=handleValidateRequestBody();handleValidationResult(e&&t)},{disabled:t}=e;return z(j,{className:`execute-button`,disabled:t,emphasis:`primary`,endIcon:E,onClick,variant:`fill`,children:`Execute`})}DocsCodeMirror.displayName=`DocsCodeMirror`;function DocsCodeMirror({basicSetup:e,copyable:t,downloadable:n,handleDownload:r,language:i=`json`,theme:a=`dark`,value:o,...c}){let l=typeof e==`object`?e:{},u=s(()=>{switch(i){case`bash`:return[X.bash()];case`html`:return[X.html()];case`xml`:return[X.xml()];default:return[X.json()]}},[i]);return B(`div`,{className:`q-code-mirror`,children:[z(ie,{basicSetup:{...l,highlightActiveLine:!1,lineNumbers:!1,lintKeymap:!0,syntaxHighlighting:!0},editable:!1,extensions:u,maxHeight:`700px`,minWidth:`400px`,theme:[a===`dark`?ne:re],value:o,...c}),t||n?B(`div`,{className:`actions-wrapper`,children:[n?z(oe,{trigger:z(M,{"aria-label":`Download`,density:`compact`,emphasis:`primary`,icon:g,onClick:r,variant:`ghost`}),children:`Download`}):null,t?z(ae,{valueOrFn:()=>o}):null]}):null]})}function sanitizeUrl$1(e){return typeof e!=`string`||e===``?``:se(e)}function jsFileDownload(e,t,n,r){let i=new Blob(r===void 0?[e]:[r,e],{type:n||`application/octet-stream`}),a=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(i):window.webkitURL.createObjectURL(i),o=document.createElement(`a`);o.style.display=`none`,o.href=a,o.setAttribute(`download`,t),o.download===void 0&&o.setAttribute(`target`,`_blank`),document.body.appendChild(o),o.click(),setTimeout(function(){document.body.removeChild(o),window.URL.revokeObjectURL(a)},200)}function stringify(e){if(typeof e==`string`)return e;if(e&&e.toJS&&(e=e.toJS()),typeof e==`object`&&e)try{return JSON.stringify(e,null,2)}catch{return String(e)}return e==null?``:e.toString()}function isFunc(e){return typeof e==`function`}function isAbsoluteUrl(e){return e.match(/^(?:[a-z]+:)?\/\//i)}function addProtocol(e){return e.match(/^\/\//i)?`${window.location.protocol}${e}`:e}function buildBaseUrl(e,t){return e?isAbsoluteUrl(e)?addProtocol(e):new URL(e,t).href:t}function buildUrl(e,t,{selectedServer:n=``}={}){if(!e)return;if(isAbsoluteUrl(e))return e;let r=buildBaseUrl(n,t);return isAbsoluteUrl(r)?new URL(e,r).href:new URL(e,window.location.href).href}function safeBuildUrl(e,t,{selectedServer:n=``}={}){try{return buildUrl(e,t,{selectedServer:n})}catch{return}}var createDeepLinkPath=e=>typeof e==`string`?e.trim().replace(/\s/g,`%20`):``,escapeDeepLinkPath=e=>ce(createDeepLinkPath(e).replace(/%20/g,`_`));function getList(e,t){if(!q.Iterable.isIterable(e))return q.List();let n=e.getIn(Array.isArray(t)?t:[t]);return q.List.isList(n)?n:q.List()}var getExtensions=e=>e.filter((e,t)=>t.startsWith(`x-`));function HighlightCode({canCopy:e,children:t,downloadable:n,fileName:r=`response.txt`,language:i}){let handleDownload=()=>{jsFileDownload(t,r)},a=e||t?.startsWith(`{`)||t?.startsWith(`[`),o=useThemeContext();return z(`div`,{className:`qui-code-mirror`,style:{maxWidth:700},children:z(DocsCodeMirror,{copyable:a,downloadable:n,handleDownload,language:i,theme:o,value:t})})}JsonSchemaArrayItemFile.displayName=`JsonSchemaArrayItemFile`;function JsonSchemaArrayItemFile(e){let onFileChange=t=>{let n=t.target.files[0];e.onChange?.(n,e.keyName)},{disabled:t,errors:n,getComponent:r}=e,i=r(`Input`),a=t||!(`FormData`in window);return z(i,{className:n.size?`invalid`:``,disabled:a,onChange:onFileChange,title:n.size?n:``,type:`file`})}JsonSchemaArrayItemText.displayName=`JsonSchemaArrayItemText`;function JsonSchemaArrayItemText(e){let{description:t,disabled:n,errors:r,keyName:i=``,onChange:onChangeProp=()=>{},value:a=``}=e,onChange=e=>{onChangeProp(e,i)},o=r.toJS?r.toJS():[],s=a||``;return z(U,{className:`swagger-input`,disabled:n,errorText:o.length?o[0]:``,invalid:o.length>0,onValueChange:onChange,placeholder:t,size:`sm`,value:s})}JsonSchemaArray.displayName=`JsonSchemaArray`;function valueOrEmptyList(e){return q.List.isList(e)?e:Array.isArray(e)?q.fromJS(e):q.List()}function JsonSchemaArray(e){let{disabled:t,errors:n,fn:r,getComponent:i,onChange:onChangeProp=()=>{},required:o=!1,schema:c={},value:u=``}=e,[d,f]=l(valueOrEmptyList(u)),[p,m]=l(c);a(()=>{m(c)},[c]),a(()=>{d!==u&&f(valueOrEmptyList(u))},[d,u]);let onChange=e=>{onChangeProp?.(e)},onItemChange=(e,t)=>{let n=d.set(t,e);f(n),onChange(n)},removeItem=e=>{let t=d.delete(e);f(t),onChange(t)},addItem=()=>{let e=valueOrEmptyList(d).push(r.getSampleSchema(p.get(`items`),!1,{includeWriteOnly:!0}));f(e),onChange(e)},onEnumChange=e=>{f(e),onChange(e)},h=n.toJS?n.toJS():Array.isArray(n)?n:[],g=h.filter(e=>typeof e==`string`),_=h.filter(e=>e.needRemove!==void 0).map(e=>e.error),v=!!(d&&d.count&&d.count()>0),y=p.getIn([`items`,`enum`]),b=p.getIn([`items`,`type`]),x=p.getIn([`items`,`format`]),S=p.get(`items`),C,w=!1,E=b===`file`||b===`string`&&x===`binary`;b&&x?C=i(`JsonSchema_${b}_${x}`):(b===`boolean`||b===`array`||b===`object`)&&(C=i(`JsonSchema_${b}`)),!C&&!E&&(w=!0);let O=s(()=>y?W({items:y.toArray()}):null,[y]);if(y&&O){let e=d instanceof q.List?d.toArray():Array.from(d);return z(K,{className:`swagger-input`,clearable:!o,collection:O,disabled:t,invalid:h.length>0,multiple:!0,onValueChange:e=>onEnumChange(e),size:`sm`,value:e})}return B(`div`,{className:`json-schema-array`,children:[v?d.map((n,a)=>{let o=q.fromJS([...h.filter(e=>e.index===a).map(e=>e.error)]);return B(`div`,{className:`json-schema-form-item`,children:[E?z(JsonSchemaArrayItemFile,{...e,disabled:t,errors:o,onChange:e=>onItemChange(e,a),value:n}):w?z(JsonSchemaArrayItemText,{...e,disabled:t,errors:o,onChange:e=>onItemChange(e,a),value:n}):z(C,{...e,disabled:t,errors:o,fn:r,getComponent:i,onChange:e=>onItemChange(e,a),schema:S,value:n}),t?null:z(M,{"aria-label":_?.length?_[0]:`Remove Option`,icon:T,onClick:()=>removeItem(a),size:`sm`,variant:`outline`})]},a)}):null,t?null:B(j,{"aria-label":g.length?g[0]:``,className:`qui-json-schema-array-add-btn`,emphasis:g.length?`danger`:`neutral`,endIcon:D,onClick:addItem,variant:`fill`,children:[`Add `,b?`${b} `:``,`item`]})]})}JsonSchemaObject.displayName=`JsonSchemaObject`;function JsonSchemaObject(e){let onChange=t=>{e.onChange?.(t)},handleOnChange=e=>{onChange(e)},{disabled:t,value:n}=e,r=useThemeContext();return z(`div`,{children:z(DocsCodeMirror,{basicSetup:{foldGutter:!1,lineNumbers:!1,lintKeymap:!0},editable:!t,language:`json`,onChange:handleOnChange,theme:r,value:stringify(n)})})}JsonSchemaString.displayName=`JsonSchemaString`;function JsonSchemaString({description:e,disabled:t,errors:n,keyName:r,onChange:i,required:a,schema:o,value:c}){let onFileChange=e=>{let t=e.target.files?.[0];i?.(t,r)},l=o&&o.get?o.get(`enum`):null,u=o&&o.get?o.get(`format`):null,d=o&&o.get?o.get(`type`):null,f=o&&o.get?o.get(`in`):null,p=c||``,m=n.toJS?n.toJS():[],h=s(()=>l?W({items:[...l]}):null,[l]);if(l&&h)return z(K,{clearable:!a,collection:h,disabled:t,invalid:m.length>0,onValueChange:e=>i?.(e[0]),size:`sm`,value:p?[p]:[]});let g=t||!!(f&&f===`formData`&&!(`FormData`in window));return d&&d===`file`?z(`input`,{disabled:g,onChange:e=>onFileChange(e),type:`file`}):z(U,{className:`swagger-input`,disabled:g,errorText:m.length?m[0]:``,inputProps:{type:u&&u===`password`?`password`:`text`},invalid:m.length>0,onValueChange:e=>i?.(e,r),placeholder:e,size:`sm`,value:p})}var We=t(null),Ge=We.Provider;function useSwaggerContext(){let e=i(We);if(!e)throw Error(`QUI Swagger must be wrapped by a <SwaggerContextProvider>`);return e}Layout.displayName=`Layout`;function Layout({errSelectors:e,getComponent:t,specSelectors:n}){let r=t(`SvgAssets`),i=t(`InfoContainer`,!0),a=t(`VersionPragmaFilter`),o=t(`operations`,!0),s=t(`Models`,!0),c=t(`Webhooks`,!0),l=t(`Row`),u=t(`Col`),f=t(`errors`,!0),p=t(`ServersContainer`,!0),m=t(`SchemesContainer`,!0),h=t(`AuthorizeBtnContainer`,!0),g=t(`FilterContainer`,!0),_=n.isSwagger2(),v=n.isOAS3(),y=n.isOAS31(),b=!n.specStr(),x=n.loadingStatus(),{hideTitleSection:S}=useSwaggerContext(),C=null;if(x===`loading`&&(C=z(`div`,{className:`info`,children:z(`div`,{className:`loading-container`,children:z(`div`,{className:`loading`})})})),x===`failed`&&(C=z(`div`,{className:`info`,children:B(`div`,{className:`loading-container`,children:[z(`h4`,{className:`title`,children:`Failed to load API definition.`}),z(f,{})]})})),x===`failedConfig`){let t=e.lastError(),n=t?t.get(`message`):``;C=z(`div`,{className:`info failed-config`,children:B(`div`,{className:`loading-container`,children:[z(`h4`,{className:`title`,children:`Failed to load remote configuration.`}),z(`p`,{children:n})]})})}if(!C&&b&&(C=z(`h4`,{children:`No API definition provided.`})),C)return z(`div`,{className:`swagger-ui`,children:z(`div`,{className:`loading-container`,children:C})});let w=n.servers(),T=n.schemes(),E=w&&w.size,D=T&&T.size,O=!!n.securityDefinitions();return B(`div`,{className:`swagger-ui`,children:[z(r,{}),B(a,{alsoShow:z(f,{}),isOAS3:v,isSwagger2:_,children:[z(f,{}),S?null:z(l,{className:`information-container`,children:z(u,{mobile:12,children:z(i,{})})}),E||D||O?z(`div`,{className:d(`scheme-container`,S?`title-hidden`:``),children:B(`div`,{className:`schemes-wrapper`,children:[E||D?B(`div`,{className:`schemes-server-container`,children:[E?z(p,{}):null,D?z(m,{}):null]}):null,O?z(h,{}):null]})}):null,z(g,{}),z(l,{children:z(u,{desktop:12,mobile:12,children:z(o,{})})}),y&&z(l,{className:`webhooks-container`,children:z(u,{desktop:12,mobile:12,children:z(c,{})})}),z(l,{children:z(u,{desktop:12,mobile:12,children:z(s,{})})})]})]})}ModelCollapse.displayName=`ModelCollapse`;function ModelCollapse({children:e,classes:t,collapsedContent:n=`{...}`,expanded:i=!0,hideSelfOnExpand:s=!1,modelId:u,modelName:d,onToggle:f,title:p}){let[m,h]=l(i),g=c(!1);a(()=>{h(i)},[i]);let _=r(()=>{f?.(d,!m),h(e=>!e)},[m,d,f]),v=o(()=>{_()});a(()=>{if(!g.current&&window.location.hash&&u&&window.location.hash===`#${u}`){let e=document.getElementById(u);e&&(e.scrollIntoView(),m||v())}g.current=!0},[u,d,f,m,_]);let y=o(()=>{u&&window.location.hash===`#${u}`&&!m&&_()});return a(()=>{function onStateChange(){y()}return window.navigation?.addEventListener(`navigatesuccess`,onStateChange),()=>{window.navigation?.removeEventListener(`navigatesuccess`,onStateChange)}},[]),m&&s?z(`span`,{className:t||``,children:e}):z(`span`,{children:z(Z.Root,{onValueChange:_,value:m?[`item`]:[],children:z(Z.Item,{text:p,value:`item`,children:m?e:z(`span`,{children:n})})})})}var usePrevious=e=>{let t=c(void 0);return a(()=>{t.current=e}),t.current},useTabs=({example:e,initialTab:t,isExecute:n,schema:i})=>{let o=s(()=>({example:`example`,model:`model`}),[]),c=!s(()=>Object.keys(o),[o]).includes(t)||!i||n?o.example:t,u=usePrevious(n),[d,f]=l(c),p=r(e=>{f(e)},[]);return a(()=>{u&&!n&&e&&f(o.example)},[u,n,e,o.example]),{activeTab:d,onTabChange:p,tabs:o}};function ModelExample({example:e,getComponent:t,getConfigs:n,includeReadOnly:r=!1,includeWriteOnly:i=!1,isExecute:a=!1,schema:o,specPath:s,specSelectors:c}){let{defaultModelExpandDepth:l,defaultModelRendering:u}=n(),d=t(`ModelWrapper`),f=t(`HighlightCode`,!0),p=J(5).toString(`base64`),m=J(5).toString(`base64`),h=J(5).toString(`base64`),g=J(5).toString(`base64`),_=c.isOAS3(),{activeTab:v,onTabChange:y,tabs:b}=useTabs({example:e,initialTab:u,isExecute:a,schema:o});return z(`div`,{className:`model-example`,children:B(le.Root,{onValueChange:y,value:v,children:[B(le.List,{children:[z(le.Indicator,{}),z(Q.Root,{value:`example`,children:z(Q.Button,{children:a?`Edit Value`:`Example`})}),o?z(Q.Root,{value:`model`,children:z(Q.Button,{children:_?`Schema`:`Model`})}):null]}),z(le.Panel,{value:`example`,children:z(`div`,{"aria-hidden":v!==b.example,"aria-labelledby":p,"data-name":`examplePanel`,id:m,tabIndex:0,children:e||z(f,{children:`(no example available`})})}),o?z(le.Panel,{value:`model`,children:z(`div`,{"aria-hidden":v===b.example,"aria-labelledby":h,"data-name":`modelPanel`,id:g,tabIndex:0,children:z(d,{expandDepth:l,getComponent:t,getConfigs:n,includeReadOnly:r,includeWriteOnly:i,schema:o,specPath:s,specSelectors:c})})}):null]})})}function ModelWrapper(e){let{expandDepth:t,fullPath:n,getComponent:r,getConfigs:i,layoutActions:a,layoutSelectors:o}=e,onToggle=(e,t)=>{a&&a.show(n,t)},s=r(`Model`),c;return o&&(c=o.isShown(n)),z(`div`,{className:`model-box`,children:z(s,{...e,depth:1,expandDepth:t||0,expanded:c,getConfigs:i,onToggle})})}function useJumpToHash(e,t,n){let r=e?.(),i=c(!1);a(()=>{if(!i.current&&r&&t&&r===`#${t}`){let e=document.getElementById(t);e&&(e.scrollIntoView(),i.current||n?.())}i.current=!0},[t,r,n])}Models.displayName=`Models`;function Models(e){let getSchemaBasePath=()=>e.specSelectors.isOAS3()?[`components`,`schemas`]:[`definitions`],handleToggle=(t,n)=>{let{layoutActions:r}=e;r.show([...getSchemaBasePath(),t],n),n&&e.specActions.requestResolvedSubtree([...getSchemaBasePath(),t])},onLoadModels=t=>{t&&e.layoutActions.readyToScroll(getSchemaBasePath(),t)},onLoadModel=t=>{if(t){let n=t.getAttribute(`data-name`);e.layoutActions.readyToScroll([...getSchemaBasePath(),n],t)}},{getComponent:t,getConfigs:n,layoutActions:r,layoutSelectors:i,specSelectors:a}=e,o=a.definitions(),{defaultModelsExpandDepth:s,docExpansion:c}=n(),{hash:l}=useSwaggerContext(),u=l.substring(l.indexOf(`model-`)+6);if(useJumpToHash(e.fn?.getHash,`models`),!o.size||s<0)return null;let f=getSchemaBasePath(),p=i.isShown(f,s>0&&c!==`none`),m=a.isOAS3(),g=t(`ModelWrapper`),_=t(`ModelCollapse`),v=t(`Markdown`);return B(`section`,{ref:onLoadModels,className:p?`models is-open`:`models`,children:[B(`button`,{"aria-expanded":p,className:`model-collapse-title`,id:`models`,onClick:()=>r.show(f,!p),children:[m?`Schemas`:`Models`,z(N,{"aria-label":`Model visibility icon`,className:d(`collapse-icon`,{"is-open":p}),icon:h,size:`md`})]}),z($.Root,{open:p,children:z($.Content,{children:o.entrySeq().map(([o])=>{let c=[...f,o],l=q.List(c),d=a.specResolvedSubtree(c),p=a.specJson().getIn(c),m=q.Map.isMap(d)?d:q.Map(),h=q.Map.isMap(p)?p:q.Map(),y=m.get(`title`)||h.get(`title`)||o,b=i.isShown(c,!1),x=m.get(`description`)||h.get(`description`);b&&m.size===0&&h.size>0&&e.specActions.requestResolvedSubtree(c);let S=u&&u===o,C=z(g,{activeInHash:S,displayName:y,expandDepth:s,fullPath:c,getComponent:t,getConfigs:n,includeReadOnly:!0,includeWriteOnly:!0,layoutActions:r,layoutSelectors:i,name:o,schema:m||q.Map(),specPath:l,specSelectors:a}),w=z(`span`,{className:`model-box`,children:z(`span`,{className:`model model-title`,children:y})}),T=`model-${o}`;return B(`div`,{ref:onLoadModel,className:`model-container`,"data-name":o,children:[z(`span`,{className:`model-box-anchor`,id:T}),z(_,{activeInHash:S,classes:`model-box`,collapsedContent:``,displayName:y,expanded:s>0&&b,getHash:e.fn.getHash,hideSelfOnExpand:!0,layoutActions:r,layoutSelectors:i,modelId:T,modelName:o,onToggle:handleToggle,specPath:l,title:w,children:C}),x?z(v,{source:x}):null]},`models-section-${o}`)}).toArray()})})]})}ObjectModel.displayName=`ObjectModelOriginal`;function ObjectModel(e){let{displayName:t,isRef:n,schema:r}=e,i=useThemeContext(),o=c(!1);if(a(()=>{!e.expanded&&!o.current&&e.onToggle?.(e.name,!e.expanded),o.current=!0},[e]),!r)return null;r.mapEntries(e=>e);let s=r.toJS(),l=r.get(`title`)||t||name,u=l?z(Z.Root,{className:`object-model-accordion`,value:e.expanded?[`item`]:[],children:z(Z.Item,{onClick:()=>e.onToggle?.(e.name,!e.expanded),text:B(R,{children:[n&&r.get(`$$ref`)&&z(`span`,{className:`model-hint`,children:r.get(`$$ref`)}),z(`span`,{children:l})]}),value:`item`})}):null,d=e.getComponent(`RenderLink`);return B(`div`,{className:`object-model`,children:[u,z(JsonModelViewer,{displayDataTypes:!1,displaySize:!1,groupArraysAfterLength:100,highlightUpdates:!0,indentWidth:2,renderLink:d,rootName:!1,theme:i,value:s})]})}OperationSummaryMethod.displayName=`OperationSummaryMethod`;var Ke={delete:{emphasis:`danger`},get:{className:`q-method-get`,emphasis:`primary`},head:{className:`q-purple`,emphasis:`primary`},options:{className:`q-lime`,emphasis:`primary`},patch:{className:`q-orange`,emphasis:`neutral`},post:{emphasis:`primary`},put:{className:`q-method-put`,emphasis:`neutral`},trace:{className:`q-teal`,emphasis:`primary`}};function OperationSummaryMethod({method:e}){let t=Ke[e];return z(j,{...t,className:d(t?.className,`qui-method-button`,e),render:z(`div`,{}),size:`sm`,tabIndex:-1,variant:`fill`,children:e.toUpperCase()})}OperationSummaryPath.displayName=`OperationSummaryPath`;function OperationSummaryPath({operationProps:t}){let{deprecated:n,path:r}=t.toJS(),i=r.split(/(?=\/)/g);for(let e=1;e<i.length;e+=2)i.splice(e,0,z(`wbr`,{},e));return z(`span`,{className:n?`opblock-summary-path__deprecated`:`opblock-summary-path`,"data-path":r,children:i.map((t,n)=>z(e,{children:t},n))})}OperationSummary.displayName=`OperationSummary`;function OperationSummary({authActions:e,authSelectors:t,fn:n,getComponent:r,isShown:i,operationProps:a,specPath:o,toggleShown:s}){let{displayOperationId:c,isAuthorized:l,method:u,op:f,operationId:p,originalOperationId:m,showSummary:g,summary:_}=a.toJS(),{summary:v}=f,y=a.get(`security`),b=r(`authorizeOperationBtn`,!0),S=r(`OperationSummaryMethod`),C=r(`OperationSummaryPath`),w=y&&!!y.count(),T=w&&y.size===1&&y.first().isEmpty(),E=!w||T,D=`${p}-1`,O=r(`RenderLink`);return useJumpToHash(n.getHash,D,()=>{s()}),B(`div`,{className:`opblock-summary`,children:[z(`div`,{className:`opblock-summary-id`,id:D}),B(`button`,{"aria-expanded":i,className:`opblock-summary-control`,onClick:s,children:[z(M,{icon:x,onClick:e=>{i||s(),e.stopPropagation()},render:z(O,{href:`#${D}`}),size:`sm`,style:{marginRight:8},variant:`outline`}),z(S,{method:u}),B(`div`,{className:`opblock-summary-path-description-wrapper`,children:[z(C,{getComponent:r,operationProps:a,specPath:o}),g?z(`div`,{className:`opblock-summary-description`,children:ue(v||_)}):null]}),c&&(m||p)?z(`span`,{className:`opblock-summary-operation-id`,children:m||p}):null,z(N,{className:d(`collapse-icon`,{"is-open":i}),icon:h,size:`sm`})]}),E?null:z(b,{isAuthorized:l,onClick:()=>{let n=t.definitionsForRequirements(y);e.showDefinitions(n)}})]})}function OperationTag(e){let{children:t,getComponent:n,getConfigs:r,layoutActions:i,layoutSelectors:a,oas3Selectors:o,specUrl:s,tag:c,tagObj:l}=e,{deepLinking:u,docExpansion:f}=r(),p=n(`Markdown`,!0),m=n(`DeepLink`),g=l.getIn([`tagDetails`,`description`],null),_=l.getIn([`tagDetails`,`externalDocs`,`description`]),y=l.getIn([`tagDetails`,`externalDocs`,`url`]),b;b=isFunc(o)&&isFunc(o.selectedServer)?safeBuildUrl(y,s,{selectedServer:o.selectedServer()}):y;let x=[`operations-tag`,c],S=a.isShown(x,f===`full`||f===`list`);return B(`div`,{className:S?`opblock-tag-section is-open`:`opblock-tag-section`,children:[B(`h3`,{className:g?`opblock-tag`:`opblock-tag no-desc`,"data-is-open":S,"data-tag":c,id:x.map(e=>escapeDeepLinkPath(e)).join(`-`),onClick:()=>i.show(x,!S),children:[z(m,{enabled:u,isShown:S,path:createDeepLinkPath(c),text:c}),g?z(`small`,{children:z(p,{source:g})}):z(`small`,{}),b?z(de,{className:`info__externaldocs external-link`,endIcon:v,href:sanitizeUrl$1(b),onClick:e=>e.stopPropagation(),render:z(`a`,{target:`_blank`}),children:_||b}):null,z(`button`,{"aria-expanded":S,className:`expand-operation`,onClick:()=>i.show(x,!S),title:S?`Collapse operation`:`Expand operation`,children:z(N,{className:d(`collapse-icon`,{"is-open":S}),icon:h,size:`md`})})]}),z($.Root,{open:S,children:z($.Content,{children:t})})]})}function Operation({authActions:e,authSelectors:t,fn:n,getComponent:r,getConfigs:i,oas3Actions:o,oas3Selectors:s,onCancelClick:c,onExecute:u,onResetClick:d,onTryoutClick:f,operation:p,request:m,response:h,specActions:g,specPath:_=q.List(),specSelectors:v,toggleShown:y}){let{allowTryItOut:b,deprecated:x,displayRequestDuration:S,executeInProgress:C,isShown:w,method:T,op:E,operationId:D,path:O,tag:k,tryItOutEnabled:A}=p.toJS(),{description:j,externalDocs:M,schemes:N}=E,F=M?safeBuildUrl(M.url,v.url(),{selectedServer:s.selectedServer()}):``,I=p.getIn([`op`]),L=I.get(`responses`),R=getList(I,[`parameters`]),V=v.operationScheme(O,T),H=[`operations`,k,D],U=getExtensions(I),W=r(`responses`),G=r(`parameters`),K=r(`execute`),J=r(`Collapse`),ee=r(`clear`),Y=r(`Markdown`,!0),te=r(`schemes`),X=r(`OperationServers`),ne=r(`OperationExt`),re=r(`OperationSummary`),ie=r(`Link`),{showExtensions:ae}=i();if(L&&h&&h.size>0){let e=!L.get(String(h.get(`status`)))&&!L.get(`default`);h=h.set(`notDocumented`,e)}let oe=[O,T],se=v.validationErrors([O,T]),[ce,Z]=l(!1);a(()=>{let e=!0;return w&&setTimeout(()=>{e&&Z(!0)},50),()=>{e=!1}},[w]);let Q=B(`div`,{className:`opblock-body`,children:[I&&I.size||I===null?null:z(pe,{}),x&&z(`h4`,{className:`opblock-title_normal`,children:` Warning: Deprecated`}),j&&z(`div`,{className:`opblock-description-wrapper`,children:z(`div`,{className:`opblock-description`,children:z(Y,{source:j})})}),F?B(`div`,{className:`opblock-external-docs-wrapper`,children:[z(`h4`,{className:`opblock-title_normal`,children:`Find more details`}),B(`div`,{className:`opblock-external-docs`,children:[M.description&&z(`span`,{className:`opblock-external-docs__description`,children:z(Y,{source:M.description})}),z(ie,{className:`opblock-external-docs__link`,href:sanitizeUrl$1(F),target:`_blank`,children:F})]})]}):null,!I||!I.size?null:z(G,{allowTryItOut:b,fn:n,getComponent:r,getConfigs:i,oas3Actions:o,oas3Selectors:s,onCancelClick:c,onChangeKey:oe,onResetClick:d,onTryoutClick:f,operation:I,parameters:R,pathMethod:[O,T],specActions:g,specPath:_.push(`parameters`),specSelectors:v,tryItOutEnabled:A}),A?z(X,{getComponent:r,getEffectiveServerValue:s.serverEffectiveValue,getSelectedServer:s.selectedServer,getServerVariable:s.serverVariableValue,method:T,operationServers:I.get(`servers`),path:O,pathServers:v.paths().getIn([O,`servers`]),setSelectedServer:o.setSelectedServer,setServerVariableValue:o.setServerVariableValue}):null,!A||!b?null:N&&N.size?z(`div`,{className:`opblock-schemes`,children:z(te,{currentScheme:V,method:T,path:O,schemes:N,specActions:g})}):null,!A||!b||se.length<=0?null:z(`div`,{className:`errors-wrapper`,children:z(fe,{description:z(`div`,{children:`Please correct the following validation errors and try again.`}),emphasis:`danger`,label:`Error`})}),B(`div`,{className:!A||!h||!b?`execute-wrapper`:`btn-group`,"data-enabled":P(A),children:[!A||!b?null:z(K,{disabled:C,method:T,oas3Actions:o,oas3Selectors:s,onExecute:u,operation:I,path:O,specActions:g,specSelectors:v}),!A||!h||!b?null:z(ee,{method:T,path:O,specActions:g})]}),C?z(pe,{}):z(`div`,{style:{height:4}}),L?z(W,{displayRequestDuration:S,fn:n,getComponent:r,getConfigs:i,method:T,oas3Actions:o,oas3Selectors:s,path:O,produces:v.producesOptionsFor([O,T]),producesValue:v.currentProducesFor([O,T]),request:m,responses:L,specActions:g,specPath:_.push(`responses`),specSelectors:v,tryItOutResponse:h}):null,!ae||!U.size?null:z(ne,{extensions:U,getComponent:r})]});return B(`div`,{className:x?`opblock opblock-deprecated`:w?`opblock opblock-${T} is-open`:`opblock opblock-${T}`,id:escapeDeepLinkPath(H.join(`-`)),children:[z(re,{authActions:e,authSelectors:t,fn:n,getComponent:r,isShown:w,operationProps:p,specPath:_,toggleShown:y}),ce?z($.Root,{open:w,children:z($.Content,{children:Q})}):z(J,{isOpened:w,children:Q})]})}ParamBody.displayName=`ParamBody`;function ParamBody({consumes:e,consumesValue:t,fn:n,getComponent:i,isExecute:o,language:s,onChange:c,onChangeConsumes:u,param:d=q.fromJS({}),pathMethod:f,specSelectors:p}){let[m,h]=l({isEditBox:!1,value:``}),g=r((e,{isEditBox:t,isXml:n})=>{h({isEditBox:t,value:e}),c?.(e,n)},[c]),v=r(e=>{let t=n.inferSchema(d.toJS());return n.getSampleSchema(t,e,{includeWriteOnly:!0})},[n,d]),y=r(()=>{let e=/xml/i.test(t),n=/json/i.test(t),r=e?d.get(`value_xml`):d.get(`value`);if(r!==void 0){let t=!r&&n?`{}`:r;h(e=>({...e,value:t})),g(t,{isEditBox:o,isXml:e})}else e?g(v(`xml`),{isEditBox:o,isXml:e}):g(v(),{isEditBox:o})},[t,o,g,d,v]);a(()=>{y()},[y]);let handleOnChange=e=>{let n=/xml/i.test(t);g(e,{isEditBox:m.isEditBox,isXml:n})},toggleIsEditBox=()=>h(e=>({...e,isEditBox:!e.isEditBox})),b=i(`contentType`),x=p.contentTypeValues(f).get(`requestContentType`),S=e&&e.size?e:q.fromJS([`application/json`]),{isEditBox:C,value:w}=m,T=`${createHtmlReadyId(`${f[1]}${f[0]}_parameters`)}_select`,E=useThemeContext();return B(`div`,{className:`body-param`,"data-param-in":d.get(`in`),"data-param-name":d.get(`name`),children:[z(DocsCodeMirror,{copyable:!0,editable:C,language:s||`json`,onChange:handleOnChange,theme:E,value:w}),B(`div`,{className:`body-param-options`,children:[o?z(`div`,{className:`body-param-edit`,children:C?z(j,{emphasis:`danger`,endIcon:A,onClick:toggleIsEditBox,variant:`outline`,children:`Cancel`}):z(j,{emphasis:`primary`,endIcon:_,onClick:toggleIsEditBox,variant:`fill`,children:`Edit`})}):null,z(b,{contentTypes:S,controlId:T,label:`Parameter content type`,onChange:u,value:x})]})]})}function createHtmlReadyId(e,t=`_`){return e.replace(/[^\w-]/g,t)}RequestBodyEditor.displayName=`RequestBodyEditor`;function RequestBodyEditor(e){let[t,n]=l(stringify(e.value||e.defaultValue));a(()=>{n(stringify(e.value||e.defaultValue))},[e.defaultValue,e.value]);let r=useThemeContext();return z(DocsCodeMirror,{editable:!0,language:`json`,onChange:t=>{e.onChange?.(t)},theme:r,value:t})}Schemes.displayName=`Schemes`;function Schemes(e){let{currentScheme:t,method:n,path:i,schemes:o,specActions:c}=e,l=r(e=>{c.setScheme(e,i,n)},[n,i,c]),u=s(()=>W({items:o.valueSeq().toArray()}),[o]);return a(()=>{(!t||!o.includes(t))&&l(o.first())},[t,o,l]),z(K,{clearable:!1,collection:u,label:`Schemes`,onValueChange:e=>l(e[0]),size:`sm`,style:{minWidth:100},value:t?[t]:[]})}function Servers({currentServer:e,getEffectiveServerValue:t,getServerVariable:n,servers:i,setSelectedServer:o,setServerVariableValue:c}){let l=(i.find(t=>t.get(`url`)===e)||q.OrderedMap()).get(`variables`)||q.OrderedMap(),u=l.size!==0;a(()=>{e||o(i.first()?.get(`url`))},[e,i,o]),a(()=>{let t=i.find(t=>t.get(`url`)===e);if(!t){o(i.first().get(`url`));return}(t.get(`variables`)||q.OrderedMap()).map((t,n)=>{c({key:n,server:e,val:t.get(`default`)||``})})},[e,i,o,c]);let d=r(e=>{o(e)},[o]),f=r((t,n)=>{c({key:t,server:e,val:n})},[c,e]),p=i.toArray().map(e=>e.get(`url`)),m=s(()=>W({items:p}),[p]);return B(`div`,{className:`servers`,children:[z(K,{className:`swagger-input`,clearable:!1,collection:m,controlProps:{id:`servers`},onValueChange:e=>d(e[0]),value:e?[e]:[]}),u&&B(`div`,{children:[B(`div`,{className:`computed-url`,children:[`Computed URL:`,z(`code`,{children:t(e)})]}),z(`h4`,{children:`Server variables`}),z(`table`,{children:z(`tbody`,{children:l.entrySeq().map(([t,r])=>{let i=r.get(`enum`)?r.get(`enum`).toArray():[];return B(`tr`,{children:[z(`td`,{children:t}),z(`td`,{children:i.length?z(K,{collection:W({items:i}),onValueChange:e=>f(t,e[0]),value:n(e,t)?[n(e,t)]:[]}):z(U,{onValueChange:e=>f(t,e),value:n(e,t)||``})})]},t)})})})]})]})}SyntaxHighlighter.displayName=`SyntaxHighlighter`;function SyntaxHighlighter({children:e,...t}){let n=useThemeContext();return z(DocsCodeMirror,{language:t.language,theme:n,value:e})}TryItOutButton.displayName=`TryItOutButton`;function TryItOutButton({enabled:e,hasUserEditedBody:t,isOAS3:n,onCancelClick:r,onResetClick:i,onTryoutClick:a}){let o=n&&t;return B(`div`,{className:o?`try-out btn-group`:`try-out`,children:[e?z(j,{emphasis:`danger`,endIcon:A,onClick:r,variant:`outline`,children:`Cancel`}):z(j,{emphasis:`primary`,endIcon:y,onClick:a,variant:`outline`,children:`Try it out`}),o&&z(j,{emphasis:`neutral`,endIcon:O,onClick:i,variant:`outline`,children:`Reset`})]})}var quiSwaggerPlugin=()=>({components:{apiKeyAuth:ApiKeyAuth,ArrayModel,AuthItem,authorizationPopup:AuthorizationPopup,authorizeBtn:AuthorizeBtn,authorizeOperationBtn:AuthorizeOperationBtn,auths:Auths,basicAuth:BasicAuth,clear:Clear,contentType:n(ContentType),EnumModel,execute:Execute,HighlightCode,JsonSchema_array:JsonSchemaArray,JsonSchema_object:JsonSchemaObject,JsonSchema_string:JsonSchemaString,Layout,ModelCollapse,modelExample:ModelExample,Models,ModelWrapper,oauth2:Oauth2,ObjectModel,operation:Operation,OperationSummary:n(OperationSummary),OperationSummaryMethod:n(OperationSummaryMethod),OperationSummaryPath:n(OperationSummaryPath),OperationTag,ParamBody,RequestBodyEditor,schemes:Schemes,Servers,SyntaxHighlighter,TryItOutButton:n(TryItOutButton)}});function Swagger({getHash:e,hideTitleSection:t,plugins:n,renderLink:r,theme:i,...a}){let o=s(()=>{let t=[()=>({fn:{getHash:e}}),()=>({components:{RenderLink:r}}),quiSwaggerPlugin];return n?[...t,...n]:t},[r,e,n]),c={hash:e(),hideTitleSection:t};return z(Ge,{value:c,children:z(Ue,{value:i,children:z(u,{defaultModelExpandDepth:1e3,defaultModelRendering:`model`,defaultModelsExpandDepth:1e3,layout:`Layout`,plugins:o,...a})})})}export{Swagger};
1
+ "use client";
2
+ import { Fragment as e, createContext as t, memo as n, useCallback as r, useContext as i, useEffect as a, useEffectEvent as o, useMemo as s, useRef as c, useState as l } from "react";
3
+ import u from "swagger-ui-react";
4
+ import { clsx as d } from "@qualcomm-ui/utils/clsx";
5
+ import { ChevronDown as f, ChevronRightIcon as p, ChevronUp as m, ChevronUpIcon as h, DownloadIcon as g, Edit2Icon as _, ExternalLinkIcon as v, FlaskConicalIcon as y, InfinityIcon as b, Link2 as x, Link2Icon as S, LockIcon as C, LockOpenIcon as w, MinusIcon as T, PlayIcon as E, PlusIcon as D, RotateCcw as O, Trash2Icon as k, XIcon as A } from "lucide-react";
6
+ import { Button as j, IconButton as M } from "@qualcomm-ui/react/button";
7
+ import { Icon as N } from "@qualcomm-ui/react/icon";
8
+ import { booleanDataAttr as P } from "@qualcomm-ui/utils/attributes";
9
+ import { create as F, createStore as I, useStore as L } from "zustand";
10
+ import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
11
+ import { PasswordInput as V } from "@qualcomm-ui/react/password-input";
12
+ import { Dialog as H } from "@qualcomm-ui/react/dialog";
13
+ import { TextInput as U } from "@qualcomm-ui/react/text-input";
14
+ import { selectCollection as W } from "@qualcomm-ui/core/select";
15
+ import { Checkbox as G } from "@qualcomm-ui/react/checkbox";
16
+ import { Select as K } from "@qualcomm-ui/react/select";
17
+ import q from "immutable";
18
+ import J from "randombytes";
19
+ import ee from "sha.js";
20
+ import Y from "url-parse";
21
+ import { useEffectOnce as te } from "@qualcomm-ui/react-core/effects";
22
+ import { langs as X } from "@uiw/codemirror-extensions-langs";
23
+ import { githubDark as ne, githubLight as re } from "@uiw/codemirror-theme-github";
24
+ import ie from "@uiw/react-codemirror";
25
+ import { CopyToClipboardIconButton as ae } from "@qualcomm-ui/react-mdx/copy-to-clipboard";
26
+ import { Tooltip as oe } from "@qualcomm-ui/react/tooltip";
27
+ import { sanitizeUrl as se } from "@braintree/sanitize-url";
28
+ import ce from "css.escape";
29
+ import { Accordion as Z } from "@qualcomm-ui/react/accordion";
30
+ import { Tab as Q, Tabs as le } from "@qualcomm-ui/react/tabs";
31
+ import { Collapsible as $ } from "@qualcomm-ui/react/collapsible";
32
+ import { toString as ue } from "lodash-es";
33
+ import { Link as de } from "@qualcomm-ui/react/link";
34
+ import { InlineNotification as fe } from "@qualcomm-ui/react/inline-notification";
35
+ import { Progress as pe } from "@qualcomm-ui/react/progress";
36
+ //#region src/internal/json-model-viewer/stores/json-viewer-store.ts
37
+ var DefaultKeyRenderer = () => null;
38
+ DefaultKeyRenderer.when = () => !1;
39
+ var createJsonViewerStore = (e) => F()((t, n) => ({
40
+ collapseStringsAfterLength: e.collapseStringsAfterLength === !1 ? Number.MAX_VALUE : e.collapseStringsAfterLength ?? 50,
41
+ colorspace: Ve,
42
+ defaultInspectControl: e.defaultInspectControl ?? void 0,
43
+ defaultInspectDepth: e.defaultInspectDepth ?? 5,
44
+ displayDataTypes: e.displayDataTypes ?? !0,
45
+ displayKeyIndicator: e.displayKeyIndicator ?? !0,
46
+ displayNumberKeys: e.displayNumberKeys ?? !0,
47
+ displaySize: e.displaySize ?? !0,
48
+ getInspectCache: (e, t) => {
49
+ let r = t === void 0 ? e.join(".") : `${e.join(".")}[${t}]nt`;
50
+ return n().inspectCache[r];
51
+ },
52
+ groupArraysAfterLength: e.groupArraysAfterLength ?? 100,
53
+ highlightUpdates: e.highlightUpdates ?? !1,
54
+ hoverPath: null,
55
+ indentWidth: e.indentWidth ?? 3,
56
+ inspectCache: {},
57
+ keyRenderer: e.keyRenderer ?? DefaultKeyRenderer,
58
+ maxDisplayLength: e.maxDisplayLength ?? 30,
59
+ objectSortKeys: e.objectSortKeys ?? !1,
60
+ onChange: e.onChange ?? (() => {}),
61
+ prevValue: void 0,
62
+ quotesOnKeys: e.quotesOnKeys ?? !1,
63
+ renderLink: e.renderLink,
64
+ rootName: e.rootName ?? "root",
65
+ setHover: (e, n) => {
66
+ t({ hoverPath: e ? {
67
+ nestedIndex: n,
68
+ path: e
69
+ } : null });
70
+ },
71
+ setInspectCache: (e, n, r) => {
72
+ let i = r === void 0 ? e.join(".") : `${e.join(".")}[${r}]nt`;
73
+ t((e) => ({ inspectCache: {
74
+ ...e.inspectCache,
75
+ [i]: typeof n == "function" ? n(e.inspectCache[i]) : n
76
+ } }));
77
+ },
78
+ value: e.value
79
+ })), me = t(null);
80
+ me.Provider;
81
+ var useJsonViewerStore = (e) => {
82
+ let t = i(me);
83
+ if (!t) throw Error("JsonModelViewer components must be wrapped in <JsonViewerProvider>");
84
+ return L(t, e);
85
+ };
86
+ //#endregion
87
+ //#region src/internal/json-model-viewer/components/internal/ref-name.tsx
88
+ RefName.displayName = "RefName";
89
+ function RefName({ inspect: e, isArray: t, refName: n }) {
90
+ let r = useJsonViewerStore((e) => e.renderLink);
91
+ return /* @__PURE__ */ B("span", {
92
+ className: "data-ref-name-wrapper",
93
+ children: [/* @__PURE__ */ B("span", {
94
+ className: d("data-ref-name", { inspect: e }),
95
+ children: [n, t ? "[]" : ""]
96
+ }), /* @__PURE__ */ z(M, {
97
+ density: "compact",
98
+ icon: S,
99
+ render: /* @__PURE__ */ z(r, { href: `#model-${n}` }),
100
+ size: "sm",
101
+ variant: "ghost"
102
+ })]
103
+ });
104
+ }
105
+ //#endregion
106
+ //#region src/internal/json-model-viewer/components/internal/utils.ts
107
+ function isObject(e) {
108
+ return !!(e && typeof e == "object" && "type" in e && e.type === "object");
109
+ }
110
+ function isReferenceObject(e) {
111
+ return !!(e && typeof e == "object" && "properties" in e && "type" in e && e.type === "object");
112
+ }
113
+ function isReferenceArray(e) {
114
+ return !!(e && typeof e == "object" && "type" in e && e.type === "array" && "items" in e);
115
+ }
116
+ function getRefName(e) {
117
+ let t = "";
118
+ return isReferenceObject(e) ? t = e.$$ref?.substring(e.$$ref?.lastIndexOf("/") + 1) : isReferenceArray(e) && (t = e.items.$$ref?.substring(e.items.$$ref?.lastIndexOf("/") + 1)), t;
119
+ }
120
+ function getArrayType(e) {
121
+ return e?.type && (e.type === "string" || e.type === "boolean" || e.type === "integer" || e.type === "null") ? e.type : "";
122
+ }
123
+ Object.prototype.constructor.toString();
124
+ var isCycleReference = (e, t, n) => {
125
+ if (e === null || n === null || typeof e != "object" || typeof n != "object") return !1;
126
+ if (Object.is(e, n) && t.length !== 0) return "";
127
+ let r = [], i = [...t], a = e;
128
+ for (; a !== n || i.length !== 0;) {
129
+ if (typeof a != "object" || !a) return !1;
130
+ if (Object.is(a, n)) return r.reduce((e, t, n) => typeof t == "number" ? `${e}[${t}]` : `${e}${n === 0 ? "" : "."}${t}`, "");
131
+ let e = i.shift();
132
+ r.push(e), a = a[e];
133
+ }
134
+ return !1;
135
+ };
136
+ function getValueSize(e) {
137
+ return e === null ? 0 : Array.isArray(e) ? e.length : e instanceof Map || e instanceof Set ? e.size : e instanceof Date ? 1 : typeof e == "object" ? Object.keys(e).length : typeof e == "string" ? e.length : 1;
138
+ }
139
+ function segmentArray(e, t) {
140
+ let n = [], r = 0;
141
+ for (; r < e.length;) n.push(e.slice(r, r + t)), r += t;
142
+ return n;
143
+ }
144
+ //#endregion
145
+ //#region src/internal/json-model-viewer/components/data-types/object.tsx
146
+ var he = "{", ge = "[", _e = "}", ve = "]";
147
+ function inspectMetadata(e) {
148
+ let t = getValueSize(e), n = "";
149
+ return (e instanceof Map || e instanceof Set) && (n = e[Symbol.toStringTag]), Object.hasOwn(e, Symbol.toStringTag) && (n = e[Symbol.toStringTag]), `${t} Items${n ? ` (${n})` : ""}`;
150
+ }
151
+ function PreObjectType(e) {
152
+ let t = useJsonViewerStore((e) => e.colorspace.base04), n = s(() => e.arrayOverride || Array.isArray(e.value), [e.arrayOverride, e.value]), r = s(() => getValueSize(e.value) === 0, [e.value]), i = s(() => inspectMetadata(e.value), [e.value]), a = useJsonViewerStore((e) => e.displaySize), o = s(() => typeof a == "function" ? a(e.path, e.value) : a, [
153
+ a,
154
+ e.path,
155
+ e.value
156
+ ]), c = useJsonViewerStore((e) => e.colorspace.base05), l = useIsCycleReference(e.path, e.value), u = e.refName;
157
+ return /* @__PURE__ */ B("span", {
158
+ className: "data-object-start",
159
+ style: { color: c },
160
+ children: [
161
+ n ? ge : he,
162
+ u ? /* @__PURE__ */ z(RefName, {
163
+ inspect: e.inspect,
164
+ refName: u
165
+ }) : null,
166
+ !u && o && e.inspect && !r && /* @__PURE__ */ z("span", {
167
+ className: "data-size-label",
168
+ style: { color: t },
169
+ children: i
170
+ }),
171
+ l && !e.inspect && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(N, {
172
+ className: "inline-icon",
173
+ icon: b,
174
+ style: { color: c }
175
+ }), l] })
176
+ ]
177
+ });
178
+ }
179
+ function PostObjectType(e) {
180
+ let t = useJsonViewerStore((e) => e.colorspace.base04), n = s(() => Array.isArray(e.value), [e.value]), r = s(() => getValueSize(e.value) === 0, [e.value]), i = s(() => inspectMetadata(e.value), [e.value]), a = useJsonViewerStore((e) => e.displaySize), o = s(() => typeof a == "function" ? a(e.path, e.value) : a, [
181
+ a,
182
+ e.path,
183
+ e.value
184
+ ]), c = useJsonViewerStore((e) => e.colorspace.base06), l = e.refName;
185
+ return /* @__PURE__ */ B("span", {
186
+ className: "data-object-end",
187
+ style: { color: c },
188
+ children: [n ? ve : _e, !l && o && (r || !e.inspect) ? /* @__PURE__ */ z("span", {
189
+ className: "data-size-label",
190
+ style: { color: t },
191
+ children: i
192
+ }) : null]
193
+ });
194
+ }
195
+ function ObjectType(e) {
196
+ let t = useTextColor(), n = useJsonViewerStore((e) => e.colorspace.base02), r = useJsonViewerStore((e) => e.groupArraysAfterLength), i = useIsCycleReference(e.path, e.value), [a, o] = l(useJsonViewerStore((e) => e.maxDisplayLength)), c = useJsonViewerStore((e) => e.objectSortKeys), u = s(() => {
197
+ if (!e.inspect) return null;
198
+ let t = e.value;
199
+ if (Array.isArray(t)) {
200
+ if (t.length <= r) {
201
+ let n = t.slice(0, a).map((t, n) => {
202
+ let i = e.nestedIndex ? e.nestedIndex * r + n : n, a = [...e.path, i];
203
+ return /* @__PURE__ */ z(DataKeyPair, {
204
+ path: a,
205
+ prevValue: Array.isArray(e.prevValue) ? e.prevValue[i] : void 0,
206
+ value: t
207
+ }, i);
208
+ });
209
+ if (t.length > a) {
210
+ let e = t.length - a;
211
+ n.push(/* @__PURE__ */ B("div", {
212
+ className: "rest-spread",
213
+ onClick: () => o((e) => e * 2),
214
+ children: [
215
+ "hidden ",
216
+ e,
217
+ " items…"
218
+ ]
219
+ }, "last"));
220
+ }
221
+ return n;
222
+ }
223
+ let n = segmentArray(t, r), i = Array.isArray(e.prevValue) ? segmentArray(e.prevValue, r) : void 0;
224
+ return n.map((t, n) => /* @__PURE__ */ z(DataKeyPair, {
225
+ nestedIndex: n,
226
+ path: e.path,
227
+ prevValue: i?.[n],
228
+ value: t
229
+ }, n));
230
+ }
231
+ if (!t) return /* @__PURE__ */ z(R, {});
232
+ if (t.type === "object" && t.properties) return /* @__PURE__ */ z(DataKeyPair, {
233
+ path: [],
234
+ prevValue: e.prevValue,
235
+ requiredProperties: e.requiredProperties,
236
+ value: t.properties
237
+ });
238
+ let n = Object.entries(t).filter(([e]) => e !== "$$ref");
239
+ c && (n = c === !0 ? n.sort(([e], [t]) => e.localeCompare(t)) : n.sort(([e], [t]) => c(e, t)));
240
+ let i = n.slice(0, a).map(([t, n]) => {
241
+ let r = [...e.path, t], i = e.requiredProperties?.includes(t);
242
+ return /* @__PURE__ */ z(DataKeyPair, {
243
+ isRequired: i,
244
+ path: r,
245
+ prevValue: e.prevValue?.[t],
246
+ value: n
247
+ }, t);
248
+ });
249
+ if (n.length > a) {
250
+ let e = n.length - a;
251
+ i.push(/* @__PURE__ */ B("div", {
252
+ className: "rest-spread no-select",
253
+ onClick: () => o((e) => e * 2),
254
+ children: [
255
+ "hidden ",
256
+ e,
257
+ " items…"
258
+ ]
259
+ }, "last"));
260
+ }
261
+ return i;
262
+ }, [
263
+ e,
264
+ c,
265
+ a,
266
+ r
267
+ ]), d = e.inspect ? .8 : 0, f = useJsonViewerStore((e) => e.indentWidth), p = e.inspect ? f - d : f;
268
+ return s(() => getValueSize(e.value) === 0, [e.value]) ? null : /* @__PURE__ */ z("div", {
269
+ className: "data-object",
270
+ style: {
271
+ borderLeft: e.inspect ? `1px solid ${n}` : "none",
272
+ color: t,
273
+ display: e.inspect ? "block" : "inline-block",
274
+ marginLeft: d * 8,
275
+ paddingLeft: e.inspect ? (p - .6) * 8 : 0
276
+ },
277
+ children: e.inspect ? u : !i && !e.refName && /* @__PURE__ */ z("span", {
278
+ className: "data-object-body",
279
+ onClick: () => e.setInspect(!0),
280
+ children: "…"
281
+ })
282
+ });
283
+ }
284
+ var ye = {
285
+ Component: ObjectType,
286
+ is: (e) => typeof e == "object",
287
+ PostComponent: PostObjectType,
288
+ PreComponent: PreObjectType
289
+ };
290
+ //#endregion
291
+ //#region src/internal/json-model-viewer/components/data-types/array-schema.tsx
292
+ function PreArrayType(e) {
293
+ let t = e.refName, n = useJsonViewerStore((e) => e.colorspace.base06), r = getArrayType(e.value);
294
+ return /* @__PURE__ */ B("span", {
295
+ className: "data-object-start",
296
+ style: { color: n },
297
+ children: [/* @__PURE__ */ z("div", {
298
+ className: "indicator",
299
+ children: r ? "" : "[{"
300
+ }), t ? /* @__PURE__ */ z(RefName, {
301
+ inspect: e.inspect,
302
+ isArray: !0,
303
+ refName: t
304
+ }) : null]
305
+ });
306
+ }
307
+ function PostArrayType(e) {
308
+ let t = useJsonViewerStore((e) => e.colorspace.base06), n = getArrayType(e.value);
309
+ return /* @__PURE__ */ z("span", {
310
+ className: "data-object-end",
311
+ style: { color: t },
312
+ children: /* @__PURE__ */ z("div", {
313
+ className: "indicator",
314
+ children: n ? "" : "}]"
315
+ })
316
+ });
317
+ }
318
+ function ArrayType(e) {
319
+ let t = getArrayType(e.value), n = useJsonViewerStore((e) => e.colorspace.base09);
320
+ return t ? /* @__PURE__ */ B("span", {
321
+ style: { color: n },
322
+ children: [t, "[]"]
323
+ }) : /* @__PURE__ */ z(ObjectType, { ...e });
324
+ }
325
+ var be = {
326
+ Component: ArrayType,
327
+ is: (e) => isReferenceArray(e),
328
+ PostComponent: PostArrayType,
329
+ PreComponent: PreArrayType
330
+ }, DataTypeLabel = ({ dataType: e, enable: t = !0 }) => t ? /* @__PURE__ */ z("div", {
331
+ className: "data-type-label",
332
+ children: e
333
+ }) : null;
334
+ //#endregion
335
+ //#region src/internal/json-model-viewer/components/data-types/define-easy-type.tsx
336
+ function defineEasyType({ colorKey: e, deserialize: t, displayTypeLabel: r = !0, is: i, Renderer: a, serialize: o, type: s }) {
337
+ let c = n(a), EasyType = (t) => {
338
+ let n = useJsonViewerStore((e) => e.displayDataTypes), i = useJsonViewerStore((t) => t.colorspace[e]);
339
+ return /* @__PURE__ */ B("div", {
340
+ className: "simple-type",
341
+ style: { color: i },
342
+ children: [r && n && /* @__PURE__ */ z(DataTypeLabel, { dataType: s }), /* @__PURE__ */ z("div", {
343
+ className: `${s}-value simple-value`,
344
+ children: /* @__PURE__ */ z(c, {
345
+ inspect: t.inspect,
346
+ isRequired: t.isRequired,
347
+ path: t.path,
348
+ prevValue: t.prevValue,
349
+ setInspect: t.setInspect,
350
+ value: t.value
351
+ })
352
+ })]
353
+ });
354
+ };
355
+ return EasyType.displayName = `easy-${s}-type`, !o || !t ? {
356
+ Component: EasyType,
357
+ is: i
358
+ } : {
359
+ Component: EasyType,
360
+ deserialize: t,
361
+ is: i,
362
+ serialize: o
363
+ };
364
+ }
365
+ //#endregion
366
+ //#region src/internal/json-model-viewer/components/data-types/boolean-schema.tsx
367
+ var xe = defineEasyType({
368
+ colorKey: "base09",
369
+ is: (e) => !!(e && typeof e == "object" && "type" in e && e.type === "boolean"),
370
+ Renderer: () => /* @__PURE__ */ z("span", {
371
+ className: "data-value",
372
+ children: "boolean"
373
+ }),
374
+ type: "boolean"
375
+ }), Se = defineEasyType({
376
+ colorKey: "base0E",
377
+ deserialize: (e) => {
378
+ if (e === "true") return !0;
379
+ if (e === "false") return !1;
380
+ throw Error("Invalid boolean value");
381
+ },
382
+ is: (e) => typeof e == "boolean",
383
+ Renderer: ({ value: e }) => /* @__PURE__ */ z(R, { children: e ? "true" : "false" }),
384
+ serialize: (e) => e.toString(),
385
+ type: "bool"
386
+ }), Ce = {
387
+ day: "numeric",
388
+ hour: "2-digit",
389
+ minute: "2-digit",
390
+ month: "short",
391
+ weekday: "short",
392
+ year: "numeric"
393
+ }, we = defineEasyType({
394
+ colorKey: "base0D",
395
+ is: (e) => e instanceof Date,
396
+ Renderer: ({ value: e }) => /* @__PURE__ */ z(R, { children: e.toLocaleTimeString("en-us", Ce) }),
397
+ type: "date"
398
+ }), functionBody = (e) => {
399
+ let t = e.toString(), n = !0, r = t.indexOf(")"), i = t.indexOf("=>");
400
+ return i !== -1 && i > r && (n = !1), n ? t.substring(t.indexOf("{", r) + 1, t.lastIndexOf("}")) : t.substring(t.indexOf("=>") + 2);
401
+ }, functionName = (e) => {
402
+ let t = e.toString();
403
+ return t.indexOf("function") === -1 ? t.substring(0, t.indexOf("=>") + 2).trim() : t.substring(8, t.indexOf("{")).trim();
404
+ }, Te = "{", Ee = "}", De = {
405
+ Component: (e) => {
406
+ let t = useJsonViewerStore((e) => e.colorspace.base05);
407
+ return /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z("div", {
408
+ className: "data-function",
409
+ style: {
410
+ color: t,
411
+ display: e.inspect ? "block" : "inline-block",
412
+ paddingLeft: e.inspect ? 16 : 0
413
+ },
414
+ children: e.inspect ? functionBody(e.value) : /* @__PURE__ */ z("span", {
415
+ className: "data-function-body",
416
+ onClick: () => e.setInspect(!0),
417
+ children: "…"
418
+ })
419
+ }) });
420
+ },
421
+ is: (e) => typeof e == "function",
422
+ PostComponent: () => /* @__PURE__ */ z(R, { children: /* @__PURE__ */ z("span", {
423
+ className: "data-function-end",
424
+ children: Ee
425
+ }) }),
426
+ PreComponent: (e) => /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(DataTypeLabel, { dataType: "function" }), /* @__PURE__ */ B("span", {
427
+ className: "data-function-start",
428
+ children: [
429
+ functionName(e.value),
430
+ " ",
431
+ Te
432
+ ]
433
+ })] })
434
+ }, Oe = defineEasyType({
435
+ colorKey: "base08",
436
+ displayTypeLabel: !1,
437
+ is: (e) => e === null,
438
+ Renderer: () => {
439
+ let e = useJsonViewerStore((e) => e.colorspace.base02);
440
+ return /* @__PURE__ */ z("div", {
441
+ className: "q-font-metadata-md-mono rounded-sm px-0.5 py-[1px]",
442
+ style: { backgroundColor: e },
443
+ children: "NULL"
444
+ });
445
+ },
446
+ type: "null"
447
+ }), ke = defineEasyType({
448
+ colorKey: "base09",
449
+ is: (e) => !!(e && typeof e == "object" && "type" in e && e.type === "integer"),
450
+ Renderer: () => /* @__PURE__ */ z("span", {
451
+ className: "data-value",
452
+ children: "integer"
453
+ }),
454
+ type: "integer"
455
+ }), isInt = (e) => e % 1 == 0, Ae = defineEasyType({
456
+ colorKey: "base08",
457
+ deserialize: (e) => parseFloat(e),
458
+ displayTypeLabel: !1,
459
+ is: (e) => typeof e == "number" && isNaN(e),
460
+ Renderer: () => {
461
+ let e = useJsonViewerStore((e) => e.colorspace.base02);
462
+ return /* @__PURE__ */ z("div", {
463
+ className: "rounded-sm px-0.5 py-[1px]",
464
+ style: { backgroundColor: e },
465
+ children: "NaN"
466
+ });
467
+ },
468
+ serialize: () => "NaN",
469
+ type: "NaN"
470
+ }), je = defineEasyType({
471
+ colorKey: "base0B",
472
+ deserialize: (e) => parseFloat(e),
473
+ is: (e) => typeof e == "number" && !isInt(e) && !isNaN(e),
474
+ Renderer: ({ value: e }) => /* @__PURE__ */ z(R, { children: e }),
475
+ serialize: (e) => e.toString(),
476
+ type: "float"
477
+ }), Me = defineEasyType({
478
+ colorKey: "base0F",
479
+ deserialize: (e) => parseFloat(e),
480
+ is: (e) => typeof e == "number" && isInt(e),
481
+ Renderer: ({ value: e }) => /* @__PURE__ */ z(R, { children: e }),
482
+ serialize: (e) => e.toString(),
483
+ type: "int"
484
+ }), Ne = defineEasyType({
485
+ colorKey: "base0F",
486
+ deserialize: (e) => BigInt(e.replace(/\D/g, "")),
487
+ is: (e) => typeof e == "bigint",
488
+ Renderer: ({ value: e }) => /* @__PURE__ */ z(R, { children: `${e}n` }),
489
+ serialize: (e) => e.toString(),
490
+ type: "bigint"
491
+ });
492
+ //#endregion
493
+ //#region src/internal/json-model-viewer/components/data-types/string-enum-type.tsx
494
+ function isEnum(e) {
495
+ return !!(e.value && typeof e.value == "object" && "enum" in e.value);
496
+ }
497
+ var Pe = defineEasyType({
498
+ colorKey: "base09",
499
+ is: (e) => !!(e && typeof e == "object" && "type" in e && e.type === "string" && isEnum({ value: e })),
500
+ Renderer(e) {
501
+ let t = e.value.enum;
502
+ return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z("div", {
503
+ className: "data-value",
504
+ children: "string enum"
505
+ }), /* @__PURE__ */ B("div", {
506
+ className: "data-value-enum",
507
+ children: [
508
+ "[",
509
+ t.map((e) => typeof e == "string" ? `"${e}"` : e).join(", "),
510
+ "]"
511
+ ]
512
+ })] });
513
+ },
514
+ type: "string"
515
+ }), Fe = defineEasyType({
516
+ colorKey: "base09",
517
+ is: (e) => !!(e && typeof e == "object" && "type" in e && e.type === "string" && !isEnum({ value: e })),
518
+ Renderer: () => /* @__PURE__ */ z("span", {
519
+ className: "data-value",
520
+ children: "string"
521
+ }),
522
+ type: "string"
523
+ }), Ie = defineEasyType({
524
+ colorKey: "base09",
525
+ deserialize: (e) => e,
526
+ is: (e) => typeof e == "string",
527
+ Renderer: (e) => {
528
+ let [t, n] = l(!1), r = useJsonViewerStore((e) => e.collapseStringsAfterLength), i = t ? e.value : e.value.slice(0, r), a = e.value.length > r;
529
+ return /* @__PURE__ */ B("span", {
530
+ className: "data-value",
531
+ onClick: () => {
532
+ window.getSelection()?.type !== "Range" && a && n((e) => !e);
533
+ },
534
+ style: { cursor: a ? "pointer" : "inherit" },
535
+ children: [
536
+ "\"",
537
+ i,
538
+ a && !t && /* @__PURE__ */ z("span", {
539
+ className: "show-rest",
540
+ children: "…"
541
+ }),
542
+ "\""
543
+ ]
544
+ });
545
+ },
546
+ serialize: (e) => e,
547
+ type: "string"
548
+ }), Le = defineEasyType({
549
+ colorKey: "base05",
550
+ displayTypeLabel: !1,
551
+ is: (e) => e === void 0,
552
+ Renderer: () => {
553
+ let e = useJsonViewerStore((e) => e.colorspace.base02);
554
+ return /* @__PURE__ */ z("div", {
555
+ className: "rounded-sm px-0.5 py-[1px]",
556
+ style: { backgroundColor: e },
557
+ children: "undefined"
558
+ });
559
+ },
560
+ type: "undefined"
561
+ });
562
+ //#endregion
563
+ //#region src/internal/json-model-viewer/stores/type-registry.tsx
564
+ function memoizeDataType(e) {
565
+ function compare(e, t) {
566
+ return Object.is(e.value, t.value) && e.inspect && t.inspect && e.path?.join(".") === t.path?.join(".");
567
+ }
568
+ return e.Component = n(e.Component, compare), e.Editor &&= n(e.Editor, function(e, t) {
569
+ return Object.is(e.value, t.value);
570
+ }), e.PreComponent &&= n(e.PreComponent, compare), e.PostComponent &&= n(e.PostComponent, compare), e;
571
+ }
572
+ var Re = [
573
+ memoizeDataType(Se),
574
+ memoizeDataType(we),
575
+ memoizeDataType(Oe),
576
+ memoizeDataType(Le),
577
+ memoizeDataType(Ie),
578
+ memoizeDataType(De),
579
+ memoizeDataType(Ae),
580
+ memoizeDataType(Me),
581
+ memoizeDataType(je),
582
+ memoizeDataType(Ne),
583
+ memoizeDataType(Fe),
584
+ memoizeDataType(Pe),
585
+ memoizeDataType(ke),
586
+ memoizeDataType(xe),
587
+ memoizeDataType(be)
588
+ ], createTypeRegistryStore = () => I()((e) => ({
589
+ registerTypes: (t) => {
590
+ e((e) => ({ registry: typeof t == "function" ? t(e.registry) : t }));
591
+ },
592
+ registry: Re
593
+ })), ze = t(null);
594
+ ze.Provider;
595
+ var useTypeRegistryStore = (e, t) => {
596
+ let n = i(ze);
597
+ return L(n, e, t);
598
+ };
599
+ function matchTypeComponents(e, t, n) {
600
+ let r;
601
+ for (let i of n) i.is(e, t) && (r = i);
602
+ if (r === void 0) {
603
+ if (typeof e == "object") return ye;
604
+ throw Error("No type matched for value", { cause: e });
605
+ }
606
+ return r;
607
+ }
608
+ function useTypeComponents(e, t) {
609
+ let n = useTypeRegistryStore((e) => e.registry);
610
+ return s(() => matchTypeComponents(e, t, n), [
611
+ e,
612
+ t,
613
+ n
614
+ ]);
615
+ }
616
+ //#endregion
617
+ //#region src/internal/json-model-viewer/hooks/use-color.ts
618
+ var useTextColor = () => useJsonViewerStore((e) => e.colorspace.base07);
619
+ //#endregion
620
+ //#region src/internal/json-model-viewer/hooks/use-is-cycle-reference.ts
621
+ function useIsCycleReference(e, t) {
622
+ let n = useJsonViewerStore((e) => e.value);
623
+ return s(() => e[e.length - 1] !== "properties" && isCycleReference(n, e, t), [
624
+ e,
625
+ t,
626
+ n
627
+ ]);
628
+ }
629
+ //#endregion
630
+ //#region src/internal/json-model-viewer/hooks/use-inspect.ts
631
+ function useInspect(e, t, n) {
632
+ let i = e.length, o = useIsCycleReference(e, t), s = useJsonViewerStore((e) => e.getInspectCache), c = useJsonViewerStore((e) => e.setInspectCache), u = useJsonViewerStore((e) => e.defaultInspectDepth), d = useJsonViewerStore((e) => e.defaultInspectControl);
633
+ a(() => {
634
+ if (s(e, n) !== void 0) return;
635
+ if (n !== void 0) {
636
+ c(e, !1, n);
637
+ return;
638
+ }
639
+ let r = o ? !1 : typeof d == "function" ? d(e, t) : i < u;
640
+ c(e, r);
641
+ }, [
642
+ u,
643
+ d,
644
+ i,
645
+ s,
646
+ o,
647
+ n,
648
+ e,
649
+ t,
650
+ c
651
+ ]);
652
+ let [f, p] = l(() => {
653
+ let r = s(e, n);
654
+ return r === void 0 ? n === void 0 ? o ? !1 : typeof d == "function" ? d(e, t) : i < u : !1 : r;
655
+ });
656
+ return [f, r((t) => {
657
+ p((r) => {
658
+ let i = typeof t == "boolean" ? t : t(r);
659
+ return c(e, i, n), i;
660
+ });
661
+ }, [
662
+ n,
663
+ e,
664
+ c
665
+ ])];
666
+ }
667
+ //#endregion
668
+ //#region src/internal/json-model-viewer/components/data-key-pair.tsx
669
+ function DataKeyPair(e) {
670
+ let { nestedIndex: t, path: n, prevValue: i, value: o } = e, { Component: u, PostComponent: h, PreComponent: g } = useTypeComponents(o, n), _ = n.length, v = n[_ - 1], y = useJsonViewerStore((e) => e.setHover), b = useJsonViewerStore((e) => e.value), [x, S] = useInspect(n, o, t), C = useTextColor(), w = useJsonViewerStore((e) => e.colorspace.base0C), T = useJsonViewerStore((e) => e.colorspace.base0A), E = useJsonViewerStore((e) => e.quotesOnKeys), D = useJsonViewerStore((e) => e.rootName), O = useJsonViewerStore((e) => e.displayNumberKeys), k = b === o, A = Number.isInteger(Number(v)), j = useJsonViewerStore((e) => e.highlightUpdates), F = s(() => !j || i === void 0 ? !1 : typeof o == typeof i ? typeof o == "number" ? isNaN(o) && isNaN(i) ? !1 : o !== i : Array.isArray(o) === Array.isArray(i) ? typeof o == "object" || typeof o == "function" ? !1 : o !== i : !0 : !0, [
671
+ j,
672
+ i,
673
+ o
674
+ ]), I = c(null);
675
+ a(() => {
676
+ I.current && F && "animate" in I.current && I.current.animate([{ backgroundColor: T }, { backgroundColor: "" }], {
677
+ duration: 1e3,
678
+ easing: "ease-in"
679
+ });
680
+ }, [
681
+ T,
682
+ F,
683
+ i,
684
+ o
685
+ ]);
686
+ let L = s(() => getValueSize(o) === 0, [o]), V = !L && !!(g && h), H = useJsonViewerStore((e) => e.keyRenderer), [U, W] = l(!1), G = s(() => ({
687
+ inspect: x,
688
+ isRequired: e.isRequired,
689
+ nestedIndex: t,
690
+ path: [...n, "properties"],
691
+ prevValue: i,
692
+ refName: getRefName(o),
693
+ requiredProperties: typeof o == "object" && o && "required" in o ? o.required : null,
694
+ setInspect: S,
695
+ value: isReferenceObject(o) ? o.properties : isReferenceArray(o) ? "properties" in o.items ? o.items.properties : o.items : o
696
+ }), [
697
+ x,
698
+ t,
699
+ n,
700
+ i,
701
+ o,
702
+ e.isRequired,
703
+ S
704
+ ]), K = r((e) => {
705
+ e.isDefaultPrevented() || L || S((e) => !e);
706
+ }, [L, S]), q = r(() => y(n, t), [
707
+ y,
708
+ n,
709
+ t
710
+ ]), J = useJsonViewerStore((e) => e.colorspace.base05), ee = useJsonViewerStore((e) => e.displayKeyIndicator), Y = typeof e.value == "object" && e.value && "description" in e.value ? e.value.description : void 0, te = /* @__PURE__ */ B("span", { children: [v, e.isRequired ? /* @__PURE__ */ z("span", {
711
+ className: "key-required-indicator",
712
+ children: "*"
713
+ }) : null] });
714
+ return /* @__PURE__ */ z("div", {
715
+ className: d("data-key-pair", e.className),
716
+ "data-expandable": P(V),
717
+ "data-has-description": P(!!Y),
718
+ "data-is-enum-type": P(isEnum(e)),
719
+ "data-testid": `data-key-pair-${n.join(".")}`,
720
+ onMouseEnter: q,
721
+ style: e.style,
722
+ children: /* @__PURE__ */ B("div", {
723
+ className: "data-key-pair-content",
724
+ children: [
725
+ /* @__PURE__ */ B("span", {
726
+ className: "data-key",
727
+ "data-expandable": P(V),
728
+ onClick: K,
729
+ style: { color: C },
730
+ children: [
731
+ V ? /* @__PURE__ */ z("span", {
732
+ className: "inline-icon expand-icon",
733
+ children: /* @__PURE__ */ z(N, {
734
+ className: "inline-icon",
735
+ icon: p,
736
+ style: {
737
+ color: J,
738
+ transform: x ? "rotate(90deg)" : "unset",
739
+ transition: "transform 161ms ease"
740
+ }
741
+ })
742
+ }) : null,
743
+ /* @__PURE__ */ z("span", {
744
+ ref: I,
745
+ children: k && _ === 0 ? D === !1 ? null : E ? /* @__PURE__ */ B(R, { children: [
746
+ "\"",
747
+ D,
748
+ "\""
749
+ ] }) : /* @__PURE__ */ z(R, { children: D }) : H.when(G) ? /* @__PURE__ */ z(H, { ...G }) : t === void 0 && (A ? /* @__PURE__ */ z(R, { children: O ? /* @__PURE__ */ z("span", {
750
+ style: { color: w },
751
+ children: v
752
+ }) : null }) : E ? /* @__PURE__ */ B(R, { children: [
753
+ "\"",
754
+ te,
755
+ "\""
756
+ ] }) : /* @__PURE__ */ z(R, { children: te }))
757
+ }),
758
+ ee ? k ? D !== !1 && /* @__PURE__ */ z("div", {
759
+ className: "indicator",
760
+ children: ":"
761
+ }) : t === void 0 && /* @__PURE__ */ z("div", {
762
+ className: "indicator",
763
+ children: ":"
764
+ }) : null,
765
+ g && /* @__PURE__ */ z(g, { ...G })
766
+ ]
767
+ }),
768
+ u ? Y && !isObject(o) && !isReferenceArray(o) ? /* @__PURE__ */ B("div", {
769
+ className: "data-key-description-container",
770
+ children: [/* @__PURE__ */ z(u, { ...G }), /* @__PURE__ */ z(M, {
771
+ className: "data-key-description-expand-button",
772
+ density: "compact",
773
+ icon: U ? m : f,
774
+ onClick: () => W(!U),
775
+ size: "sm",
776
+ variant: "ghost"
777
+ })]
778
+ }) : /* @__PURE__ */ z(u, { ...G }) : /* @__PURE__ */ z("span", {
779
+ className: "data-value-fallback",
780
+ children: `fallback: ${o}`
781
+ }),
782
+ Y && U ? /* @__PURE__ */ z("div", {
783
+ className: "data-key-description",
784
+ children: Y
785
+ }) : null,
786
+ h && /* @__PURE__ */ z(h, { ...G })
787
+ ]
788
+ })
789
+ });
790
+ }
791
+ //#endregion
792
+ //#region src/internal/json-model-viewer/theme/base16.ts
793
+ var Be = {
794
+ author: "mac gainor (https://github.com/mac-s-g)",
795
+ base0A: "#ffd500",
796
+ base0B: "#859900",
797
+ base0C: "#6c71c4",
798
+ base0D: "#586e75",
799
+ base0E: "#2aa198",
800
+ base0F: "#268bd2",
801
+ base00: "rgba(0, 0, 0, 0)",
802
+ base01: "rgb(245, 245, 245)",
803
+ base02: "rgb(235, 235, 235)",
804
+ base03: "#93a1a1",
805
+ base04: "rgba(0, 0, 0, 0.3)",
806
+ base05: "#586e75",
807
+ base06: "#073642",
808
+ base07: "#002b36",
809
+ base08: "#d33682",
810
+ base09: "#cb4b16",
811
+ scheme: "Light Theme"
812
+ }, Ve = {
813
+ author: "Chris Kempson (http://chriskempson.com)",
814
+ base0A: "#f7ca88",
815
+ base0B: "#a1b56c",
816
+ base0C: "#86c1b9",
817
+ base0D: "#7cafc2",
818
+ base0E: "#a5d6ff",
819
+ base0F: "#e8e8e8",
820
+ base00: "#181818",
821
+ base01: "#282828",
822
+ base02: "#383838",
823
+ base03: "#585858",
824
+ base04: "#b8b8b8",
825
+ base05: "#d8d8d8",
826
+ base06: "#e8e8e8",
827
+ base07: "#d2a8ff",
828
+ base08: "#ab4642",
829
+ base09: "#a5d6ff",
830
+ scheme: "Dark Theme"
831
+ }, JsonViewerInternal = (e) => {
832
+ let { setState: t } = i(me);
833
+ a(() => {
834
+ t((t) => ({
835
+ prevValue: t.value,
836
+ value: e.value
837
+ }));
838
+ }, [e.value, t]), a(() => {
839
+ e.theme === "light" ? t({ colorspace: Be }) : e.theme === "dark" ? t({ colorspace: Ve }) : typeof e.theme == "object" && t({ colorspace: e.theme });
840
+ }, [t, e.theme]);
841
+ let n = s(() => typeof e.theme == "object" ? "json-viewer-theme-custom" : e.theme === "dark" ? "json-viewer-theme-dark" : "json-viewer-theme-light", [e.theme]), o = c(!0), l = useTypeRegistryStore((e) => e.registerTypes);
842
+ o.current &&= (l(e.valueTypes ? [...Re, ...e.valueTypes] : [...Re]), !1), a(() => {
843
+ let t = e.valueTypes ? [...Re, ...e.valueTypes] : [...Re];
844
+ l(t);
845
+ }, [e.valueTypes, l]);
846
+ let u = useJsonViewerStore((e) => e.value), f = useJsonViewerStore((e) => e.prevValue), p = s(() => [], []), m = useJsonViewerStore((e) => e.setHover), h = r(() => m(null), [m]);
847
+ return /* @__PURE__ */ B("div", {
848
+ className: d("json-model-viewer", n, e.className),
849
+ onMouseLeave: h,
850
+ style: {
851
+ ...e.style,
852
+ contentVisibility: "auto"
853
+ },
854
+ children: [/* @__PURE__ */ z("div", { className: "model-gutter" }), /* @__PURE__ */ z(DataKeyPair, {
855
+ path: p,
856
+ prevValue: f,
857
+ value: u
858
+ })]
859
+ });
860
+ };
861
+ function JsonModelViewer(e) {
862
+ process.env.NODE_ENV !== "production" && "displayObjectSize" in e && console.error("`displayObjectSize` is deprecated. Use `displaySize` instead.\nSee https://viewer.textea.io/migration/migration-v3#raname-displayobjectsize-to-displaysize for more information.");
863
+ let t = s(() => e.theme === "auto" ? "dark" : e.theme ?? "light", [!0, e.theme]), n = {
864
+ ...e,
865
+ theme: t
866
+ }, r = s(() => createJsonViewerStore(e), []), i = s(() => createTypeRegistryStore(), []);
867
+ return /* @__PURE__ */ z(ze.Provider, {
868
+ value: i,
869
+ children: /* @__PURE__ */ z(me.Provider, {
870
+ value: r,
871
+ children: /* @__PURE__ */ z(JsonViewerInternal, { ...n })
872
+ })
873
+ });
874
+ }
875
+ //#endregion
876
+ //#region src/internal/use-theme-context.tsx
877
+ var He = t("dark"), Ue = He.Provider;
878
+ function useThemeContext() {
879
+ return i(He);
880
+ }
881
+ //#endregion
882
+ //#region src/internal/array-model.tsx
883
+ ArrayModel.displayName = "ArrayModel";
884
+ function ArrayModel(e) {
885
+ let { schema: t } = e, n = e.getComponent("RenderLink"), r = t.get("title") || e.displayName || e.name, i = r ? /* @__PURE__ */ z("button", {
886
+ className: "model-box-control",
887
+ onClick: () => e.onToggle?.(e.name, !e.expanded),
888
+ children: /* @__PURE__ */ z("span", {
889
+ className: "model-title__text",
890
+ children: r
891
+ })
892
+ }) : null, a = t.toJS(), o = useThemeContext();
893
+ return /* @__PURE__ */ B("div", {
894
+ className: "array-model",
895
+ children: [i, /* @__PURE__ */ z(JsonModelViewer, {
896
+ displayDataTypes: !1,
897
+ displaySize: !1,
898
+ groupArraysAfterLength: 100,
899
+ highlightUpdates: !0,
900
+ indentWidth: 2,
901
+ renderLink: n,
902
+ rootName: !1,
903
+ theme: o,
904
+ value: a
905
+ })]
906
+ });
907
+ }
908
+ //#endregion
909
+ //#region src/internal/auth/api-key-auth.tsx
910
+ function ApiKeyAuth(e) {
911
+ let getValue = () => {
912
+ let { authorized: t, name: n } = e;
913
+ return t && t.getIn([n, "value"]);
914
+ }, [t, n] = l({
915
+ name: e.name,
916
+ schema: e.schema,
917
+ value: getValue()
918
+ }), onChange = (r) => {
919
+ let i = {
920
+ ...t,
921
+ value: r
922
+ };
923
+ n(i), e.onChange?.(i);
924
+ }, { errSelectors: r, getComponent: i, name: a, schema: o } = e, s = i("Row"), c = i("Col"), u = i("authError"), d = i("Markdown", !0), f = i("JumpToPath", !0), p = getValue(), m = r.allErrors().filter((e) => e.get("authId") === a);
925
+ return /* @__PURE__ */ B("div", {
926
+ className: "api-key-wrapper",
927
+ children: [
928
+ /* @__PURE__ */ B("h4", {
929
+ className: "api-key-wrapper-header",
930
+ children: [
931
+ /* @__PURE__ */ z("code", { children: a || o.get("name") }),
932
+ " (apiKey)",
933
+ /* @__PURE__ */ z(f, { path: ["securityDefinitions", a] })
934
+ ]
935
+ }),
936
+ p && /* @__PURE__ */ z("h6", { children: "Authorized" }),
937
+ /* @__PURE__ */ z(s, { children: /* @__PURE__ */ z(d, { source: o.get("description") }) }),
938
+ /* @__PURE__ */ z(s, { children: /* @__PURE__ */ B("p", {
939
+ className: "text-body-sm",
940
+ children: ["Name: ", /* @__PURE__ */ z("code", {
941
+ className: "qui-code",
942
+ children: o.get("name")
943
+ })]
944
+ }) }),
945
+ /* @__PURE__ */ z(s, { children: /* @__PURE__ */ B("p", {
946
+ className: "text-body-sm",
947
+ children: ["In: ", /* @__PURE__ */ z("code", {
948
+ className: "qui-code",
949
+ children: o.get("in")
950
+ })]
951
+ }) }),
952
+ /* @__PURE__ */ z(s, { children: /* @__PURE__ */ z(c, { children: /* @__PURE__ */ z(V, {
953
+ "aria-label": o.get("name"),
954
+ className: "swagger-input",
955
+ disabled: !!p,
956
+ inputProps: { autoFocus: !0 },
957
+ onValueChange: onChange
958
+ }) }) }),
959
+ m.valueSeq().map((e, t) => /* @__PURE__ */ z(u, { error: e }, t))
960
+ ]
961
+ });
962
+ }
963
+ //#endregion
964
+ //#region src/internal/auth/auth-item.tsx
965
+ function AuthItem(e) {
966
+ let { authorized: t, errSelectors: n, getComponent: r, name: i, onAuthChange: a, schema: o } = e, s = r("apiKeyAuth"), c = r("basicAuth"), l, u = o.get("type");
967
+ switch (u) {
968
+ case "apiKey":
969
+ l = /* @__PURE__ */ z(s, {
970
+ authorized: t,
971
+ errSelectors: n,
972
+ getComponent: r,
973
+ name: i,
974
+ onChange: a,
975
+ schema: o
976
+ }, i);
977
+ break;
978
+ case "basic":
979
+ l = /* @__PURE__ */ z(c, {
980
+ authorized: t,
981
+ errSelectors: n,
982
+ getComponent: r,
983
+ name: i,
984
+ onChange: a,
985
+ schema: o
986
+ }, i);
987
+ break;
988
+ default: l = /* @__PURE__ */ B("div", { children: ["Unknown security definition type ", u] }, i);
989
+ }
990
+ return /* @__PURE__ */ z("div", { children: l }, `${i}-jump`);
991
+ }
992
+ //#endregion
993
+ //#region src/internal/auth/authorization-popup.tsx
994
+ function AuthorizationPopup({ authActions: e, authSelectors: t, errSelectors: n, fn: r, getComponent: i, specSelectors: a }) {
995
+ let close = () => {
996
+ e.showDefinitions(!1);
997
+ }, o = t.shownDefinitions(), s = i("auths");
998
+ return /* @__PURE__ */ z(H.Root, {
999
+ defaultOpen: !0,
1000
+ onOpenChange: (e) => {
1001
+ e || close();
1002
+ },
1003
+ size: "md",
1004
+ children: /* @__PURE__ */ z(H.FloatingPortal, { children: /* @__PURE__ */ B(H.Body, {
1005
+ className: "swagger-ui",
1006
+ children: [
1007
+ /* @__PURE__ */ z(H.CloseButton, {}),
1008
+ /* @__PURE__ */ z(H.Heading, { children: "Available Authorizations" }),
1009
+ /* @__PURE__ */ z(H.Description, {
1010
+ className: "authorization-popup-dialog-body",
1011
+ children: o.valueSeq().map((o, c) => /* @__PURE__ */ z(s, {
1012
+ AST: r.AST,
1013
+ authActions: e,
1014
+ authSelectors: t,
1015
+ definitions: o,
1016
+ errSelectors: n,
1017
+ getComponent: i,
1018
+ specSelectors: a
1019
+ }, c))
1020
+ })
1021
+ ]
1022
+ }) })
1023
+ });
1024
+ }
1025
+ //#endregion
1026
+ //#region src/internal/auth/authorize-btn.tsx
1027
+ function AuthorizeBtn({ getComponent: e, isAuthorized: t, onClick: n, showPopup: r }) {
1028
+ let i = e("authorizationPopup", !0);
1029
+ return /* @__PURE__ */ B("div", {
1030
+ className: "auth-wrapper",
1031
+ children: [/* @__PURE__ */ z(j, {
1032
+ emphasis: "primary",
1033
+ endIcon: t ? C : w,
1034
+ onClick: n,
1035
+ variant: "fill",
1036
+ children: "Authorize"
1037
+ }), r && /* @__PURE__ */ z(i, {})]
1038
+ });
1039
+ }
1040
+ //#endregion
1041
+ //#region src/internal/auth/authorize-operation-btn.tsx
1042
+ AuthorizeOperationBtn.displayName = "AuthorizeOperationBtn";
1043
+ function AuthorizeOperationBtn(e) {
1044
+ function onClick(t) {
1045
+ t.stopPropagation(), e.onClick?.();
1046
+ }
1047
+ let { isAuthorized: t } = e;
1048
+ return /* @__PURE__ */ z(M, {
1049
+ "aria-label": t ? "authorization button locked" : "authorization button unlocked",
1050
+ icon: t ? C : w,
1051
+ onClick,
1052
+ size: "sm",
1053
+ variant: "ghost"
1054
+ });
1055
+ }
1056
+ //#endregion
1057
+ //#region src/internal/auth/auths.tsx
1058
+ function Auths(e) {
1059
+ let [t, n] = l({}), onAuthChange = (e) => {
1060
+ let { name: r } = e;
1061
+ n({
1062
+ ...t,
1063
+ [r]: e
1064
+ });
1065
+ }, submitAuth = (n) => {
1066
+ n.preventDefault();
1067
+ let { authActions: r } = e;
1068
+ r.authorizeWithPersistOption(t);
1069
+ }, logoutClick = (t) => {
1070
+ t.preventDefault();
1071
+ let { authActions: r, definitions: i } = e, a = i.map((e, t) => t).toArray();
1072
+ n(a.reduce((e, t) => ({
1073
+ ...e,
1074
+ [t]: ""
1075
+ }), {})), r.logoutWithPersistOption(a);
1076
+ }, close = (t) => {
1077
+ t.preventDefault();
1078
+ let { authActions: n } = e;
1079
+ n.showDefinitions(!1);
1080
+ }, { authSelectors: r, definitions: i, errSelectors: a, getComponent: o } = e, s = o("AuthItem"), c = o("oauth2", !0), u = r.authorized(), d = i.filter((e, t) => !!u.get(t)), f = i.filter((e) => e.get("type") !== "oauth2"), p = i.filter((e) => e.get("type") === "oauth2"), m = f.entrySeq().map(([e, t]) => /* @__PURE__ */ z(s, {
1081
+ authorized: u,
1082
+ errSelectors: a,
1083
+ getComponent: o,
1084
+ name: e,
1085
+ onAuthChange,
1086
+ schema: t
1087
+ }, e));
1088
+ return /* @__PURE__ */ B("div", {
1089
+ className: "auth-container",
1090
+ children: [!!f.size && /* @__PURE__ */ B("form", {
1091
+ onSubmit: submitAuth,
1092
+ children: [m, /* @__PURE__ */ B("div", {
1093
+ className: "auth-btn-wrapper",
1094
+ children: [f.size === d.size ? /* @__PURE__ */ z(j, {
1095
+ "aria-label": "Remove authorization",
1096
+ onClick: logoutClick,
1097
+ variant: "outline",
1098
+ children: "Logout"
1099
+ }) : /* @__PURE__ */ z(j, {
1100
+ "aria-label": "Apply credentials",
1101
+ emphasis: "primary",
1102
+ type: "submit",
1103
+ variant: "fill",
1104
+ children: "Authorize"
1105
+ }), /* @__PURE__ */ z(j, {
1106
+ onClick: close,
1107
+ variant: "outline",
1108
+ children: "Close"
1109
+ })]
1110
+ })]
1111
+ }), p && p.size ? /* @__PURE__ */ B("div", {
1112
+ className: "oauth-wrapper",
1113
+ children: [/* @__PURE__ */ B("div", {
1114
+ className: "scope-def",
1115
+ children: [/* @__PURE__ */ z("p", { children: "Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes." }), /* @__PURE__ */ z("p", { children: "API requires the following scopes. Select which ones you want to grant to Swagger UI." })]
1116
+ }), i.filter((e) => e.get("type") === "oauth2").entrySeq().map(([e, t]) => /* @__PURE__ */ z("div", { children: /* @__PURE__ */ z(c, {
1117
+ authorized: u,
1118
+ name: e,
1119
+ schema: t
1120
+ }) }, e)).toArray()]
1121
+ }) : null]
1122
+ });
1123
+ }
1124
+ //#endregion
1125
+ //#region src/internal/auth/basic-auth.tsx
1126
+ function BasicAuth(e) {
1127
+ let [t, n] = l({
1128
+ name: e.name,
1129
+ schema: e.schema,
1130
+ value: {}
1131
+ }), getValue = () => {
1132
+ let { authorized: t, name: n } = e;
1133
+ return t && t.getIn([n, "value"]) || {};
1134
+ }, onChange = (r, i) => {
1135
+ let { onChange: a } = e, o = {
1136
+ ...t.value,
1137
+ [i]: r
1138
+ };
1139
+ n({
1140
+ ...t,
1141
+ value: o
1142
+ }), a(t);
1143
+ }, { errSelectors: r, getComponent: i, name: a, schema: o } = e, s = i("Row"), c = i("Col"), u = i("authError"), d = i("JumpToPath", !0), f = i("Markdown", !0), p = getValue().username, m = r.allErrors().filter((e) => e.get("authId") === a);
1144
+ return /* @__PURE__ */ B("div", { children: [
1145
+ /* @__PURE__ */ B("h4", { children: ["Basic authorization", /* @__PURE__ */ z(d, { path: ["securityDefinitions", a] })] }),
1146
+ p && /* @__PURE__ */ z("h6", { children: "Authorized" }),
1147
+ /* @__PURE__ */ z(s, { children: /* @__PURE__ */ z(f, { source: o.get("description") }) }),
1148
+ /* @__PURE__ */ z(s, { children: p ? /* @__PURE__ */ z(U, {
1149
+ clearable: !1,
1150
+ disabled: !0,
1151
+ label: "Username",
1152
+ value: p
1153
+ }) : /* @__PURE__ */ z(c, { children: /* @__PURE__ */ z(U, {
1154
+ inputProps: {
1155
+ autoFocus: !0,
1156
+ id: "auth_username"
1157
+ },
1158
+ label: "Username",
1159
+ name: "username",
1160
+ onValueChange: (e) => onChange(e, "username")
1161
+ }) }) }),
1162
+ /* @__PURE__ */ z(s, { children: p ? /* @__PURE__ */ z(V, {
1163
+ clearable: !1,
1164
+ disabled: !0,
1165
+ label: "Password",
1166
+ value: t.value?.[t.name] || ""
1167
+ }) : /* @__PURE__ */ z(c, { children: /* @__PURE__ */ z(V, {
1168
+ inputProps: { id: "auth_password" },
1169
+ label: "Password",
1170
+ name: "password",
1171
+ onValueChange: (e) => onChange(e, "password")
1172
+ }) }) }),
1173
+ m.valueSeq().map((e, t) => /* @__PURE__ */ z(u, { error: e }, t))
1174
+ ] });
1175
+ }
1176
+ //#endregion
1177
+ //#region src/internal/auth/utils.ts
1178
+ function b64toB64UrlEncoded(e) {
1179
+ return e.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
1180
+ }
1181
+ function generateCodeVerifier() {
1182
+ return b64toB64UrlEncoded(J(32).toString("base64"));
1183
+ }
1184
+ function createCodeChallenge(e) {
1185
+ return b64toB64UrlEncoded(ee("sha256").update(e).digest("base64"));
1186
+ }
1187
+ function sanitizeUrl$2(e) {
1188
+ if (typeof e != "string" || e.trim() === "") return "";
1189
+ let t = e.trim(), n = "about:blank";
1190
+ try {
1191
+ let e = `https://base${String(Math.random()).slice(2)}`, r = new URL(t, e), i = r.protocol.slice(0, -1);
1192
+ return [
1193
+ "javascript",
1194
+ "data",
1195
+ "vbscript"
1196
+ ].includes(i.toLowerCase()) ? n : r.origin === e ? t.startsWith("/") ? `${r.pathname}${r.search}${r.hash}` : t.startsWith("./") || t.startsWith("../") ? `${t?.match(/^(\.\.?\/)+/)?.[0]}${r.pathname.substring(1)}${r.search}${r.hash}` : `${r.pathname.substring(1)}${r.search}${r.hash}` : String(r);
1197
+ } catch {
1198
+ return n;
1199
+ }
1200
+ }
1201
+ function authorizeOauth2({ auth: e, authActions: t, authConfigs: n = {}, configs: r, currentServer: i, errActions: a }) {
1202
+ let { clientId: o, name: s, schema: c, scopes: l } = e, u = c.get("flow"), d = [];
1203
+ switch (u) {
1204
+ case "password":
1205
+ t.authorizePassword(e);
1206
+ return;
1207
+ case "application":
1208
+ t.authorizeApplication(e);
1209
+ return;
1210
+ case "accessCode":
1211
+ d.push("response_type=code");
1212
+ break;
1213
+ case "implicit":
1214
+ d.push("response_type=token");
1215
+ break;
1216
+ case "clientCredentials":
1217
+ case "client_credentials":
1218
+ t.authorizeApplication(e);
1219
+ return;
1220
+ case "authorizationCode":
1221
+ case "authorization_code": d.push("response_type=code");
1222
+ }
1223
+ typeof o == "string" && d.push(`client_id=${encodeURIComponent(o)}`);
1224
+ let f = r.oauth2RedirectUrl;
1225
+ if (f === void 0) {
1226
+ a.newAuthErr({
1227
+ authId: s,
1228
+ level: "error",
1229
+ message: "oauth2RedirectUrl configuration is not passed. Oauth2 authorization cannot be performed.",
1230
+ source: "validation"
1231
+ });
1232
+ return;
1233
+ }
1234
+ d.push(`redirect_uri=${encodeURIComponent(f)}`);
1235
+ let p = [];
1236
+ if (Array.isArray(l) ? p = l : q.List.isList(l) && (p = l.toArray()), p.length > 0) {
1237
+ let e = n.scopeSeparator || " ";
1238
+ d.push(`scope=${encodeURIComponent(p.join(e))}`);
1239
+ }
1240
+ let m = btoa((/* @__PURE__ */ new Date()).toString());
1241
+ if (d.push(`state=${encodeURIComponent(m)}`), n.realm !== void 0 && d.push(`realm=${encodeURIComponent(n.realm)}`), (u === "authorizationCode" || u === "authorization_code" || u === "accessCode") && n.usePkceWithAuthorizationCodeGrant) {
1242
+ let t = generateCodeVerifier(), n = createCodeChallenge(t);
1243
+ d.push(`code_challenge=${n}`), d.push("code_challenge_method=S256"), e.codeVerifier = t;
1244
+ }
1245
+ let { additionalQueryStringParams: h } = n;
1246
+ for (let e in h) h[e] !== void 0 && d.push([e, h[e]].map(encodeURIComponent).join("="));
1247
+ let g = c.get("authorizationUrl"), _;
1248
+ _ = i ? Y(sanitizeUrl$2(g), i, !0).toString() : sanitizeUrl$2(g);
1249
+ let v = [_, d.join("&")].join(typeof g == "string" && !g.includes("?") ? "?" : "&"), y;
1250
+ y = u === "implicit" ? t.preAuthorizeImplicit : n.useBasicAuthenticationWithAccessCodeGrant ? t.authorizeAccessCodeWithBasicAuthentication : t.authorizeAccessCodeWithFormParams, t.authPopup(v, {
1251
+ auth: e,
1252
+ callback: y,
1253
+ errCb: a.newAuthErr,
1254
+ redirectUrl: f,
1255
+ state: m
1256
+ });
1257
+ }
1258
+ //#endregion
1259
+ //#region src/internal/auth/oauth2.tsx
1260
+ Oauth2.displayName = "Oauth2";
1261
+ function Oauth2(e) {
1262
+ let { authorized: t, authSelectors: n, errSelectors: r, getComponent: i, name: a, schema: o, specSelectors: s } = e, c = t && t.get(a), u = n.getConfigs() || {}, d = c && c.get("username") || "", f = c && c.get("clientId") || u.clientId || "", p = c && c.get("clientSecret") || u.clientSecret || "", m = c && c.get("passwordType") || "basic", h = c && c.get("scopes") || u.scopes || [];
1263
+ typeof h == "string" && (h = h.split(u.scopeSeparator || " "));
1264
+ let [g, _] = l({
1265
+ appName: u.appName,
1266
+ clientId: f,
1267
+ clientSecret: p,
1268
+ name: a,
1269
+ password: "",
1270
+ passwordType: m,
1271
+ schema: o,
1272
+ scopes: h,
1273
+ username: d
1274
+ }), close = (t) => {
1275
+ t.preventDefault();
1276
+ let { authActions: n } = e;
1277
+ n.showDefinitions(!1);
1278
+ }, authorize = () => {
1279
+ let { authActions: t, authSelectors: n, errActions: r, getConfigs: i, oas3Selectors: o } = e, s = i(), c = n.getConfigs();
1280
+ r.clear({
1281
+ authId: a,
1282
+ source: "auth",
1283
+ type: "auth"
1284
+ }), authorizeOauth2({
1285
+ auth: g,
1286
+ authActions: t,
1287
+ authConfigs: c,
1288
+ configs: s,
1289
+ currentServer: o.serverEffectiveValue(o.selectedServer()),
1290
+ errActions: r
1291
+ });
1292
+ }, onScopeChange = (e, t) => {
1293
+ if (t && g.scopes.indexOf(e) === -1) {
1294
+ let t = g.scopes.concat([e]);
1295
+ _((e) => ({
1296
+ ...e,
1297
+ scopes: t
1298
+ }));
1299
+ } else !t && g.scopes.indexOf(e) > -1 && _((t) => ({
1300
+ ...t,
1301
+ scopes: g.scopes.filter((t) => t !== e)
1302
+ }));
1303
+ }, onInputChange = (e, t) => {
1304
+ let n = { [e]: t };
1305
+ _((e) => ({
1306
+ ...e,
1307
+ ...n
1308
+ }));
1309
+ }, selectScopes = (t) => {
1310
+ t.target.dataset.all ? _((t) => ({
1311
+ ...t,
1312
+ scopes: Array.from((e.schema.get("allowedScopes") || e.schema.get("scopes")).keys())
1313
+ })) : _((e) => ({
1314
+ ...e,
1315
+ scopes: []
1316
+ }));
1317
+ }, logout = (t) => {
1318
+ t.preventDefault();
1319
+ let { authActions: n, errActions: r, name: i } = e;
1320
+ r.clear({
1321
+ authId: i,
1322
+ source: "auth",
1323
+ type: "auth"
1324
+ }), n.logoutWithPersistOption([i]);
1325
+ }, v = i("Row"), y = i("Col"), b = i("authError"), x = i("JumpToPath", !0), S = i("Markdown", !0), { isOAS3: C } = s, w = C() ? o.get("openIdConnectUrl") : null, T = "implicit", E = "password", D = C() ? w ? "authorization_code" : "authorizationCode" : "accessCode", O = C() ? w ? "client_credentials" : "clientCredentials" : "application";
1326
+ u = n.getConfigs() || {};
1327
+ let k = !!u.usePkceWithAuthorizationCodeGrant, A = o.get("flow"), M = A === D && k ? `${A} with PKCE` : A;
1328
+ h = o.get("allowedScopes") || o.get("scopes");
1329
+ let N = !!n.authorized().get(a), P = r.allErrors().filter((e) => e.get("authId") === a), F = !P.filter((e) => e.get("source") === "validation").size, I = o.get("description");
1330
+ return /* @__PURE__ */ B("div", {
1331
+ className: "oauth2-wrapper",
1332
+ children: [
1333
+ /* @__PURE__ */ B("h4", {
1334
+ className: "oauth2-heading",
1335
+ children: [
1336
+ a,
1337
+ " (OAuth2, ",
1338
+ M,
1339
+ ")",
1340
+ " ",
1341
+ /* @__PURE__ */ z(x, { path: ["securityDefinitions", a] })
1342
+ ]
1343
+ }),
1344
+ g.appName ? /* @__PURE__ */ B("h5", { children: [
1345
+ "Application: ",
1346
+ g.appName,
1347
+ " "
1348
+ ] }) : null,
1349
+ I && /* @__PURE__ */ z(S, { source: o.get("description") }),
1350
+ N && /* @__PURE__ */ z("h6", { children: "Authorized" }),
1351
+ w && /* @__PURE__ */ B("p", {
1352
+ className: "text-body-sm",
1353
+ children: ["OpenID Connect URL: ", /* @__PURE__ */ z("code", {
1354
+ className: "qui-code",
1355
+ children: w
1356
+ })]
1357
+ }),
1358
+ (A === T || A === D) && /* @__PURE__ */ B("p", {
1359
+ className: "text-body-sm",
1360
+ children: [
1361
+ "Authorization URL:",
1362
+ " ",
1363
+ /* @__PURE__ */ z("code", {
1364
+ className: "qui-code",
1365
+ children: o.get("authorizationUrl")
1366
+ })
1367
+ ]
1368
+ }),
1369
+ (A === E || A === D || A === O) && /* @__PURE__ */ B("p", {
1370
+ className: "text-body-sm",
1371
+ children: ["Token URL:", /* @__PURE__ */ B("code", {
1372
+ className: "qui-code",
1373
+ children: [" ", o.get("tokenUrl")]
1374
+ })]
1375
+ }),
1376
+ /* @__PURE__ */ B("p", {
1377
+ className: "text-body-sm",
1378
+ children: ["Flow: ", /* @__PURE__ */ z("code", {
1379
+ className: "qui-code",
1380
+ children: M
1381
+ })]
1382
+ }),
1383
+ A === E ? /* @__PURE__ */ B(v, { children: [
1384
+ /* @__PURE__ */ z(v, { children: /* @__PURE__ */ z(y, {
1385
+ desktop: 10,
1386
+ tablet: 10,
1387
+ children: /* @__PURE__ */ z(U, {
1388
+ disabled: N,
1389
+ inputProps: {
1390
+ autoFocus: !0,
1391
+ "data-name": "username"
1392
+ },
1393
+ label: "Username",
1394
+ onValueChange: (e) => onInputChange("username", e)
1395
+ })
1396
+ }) }),
1397
+ /* @__PURE__ */ z(v, { children: /* @__PURE__ */ z(y, {
1398
+ desktop: 10,
1399
+ tablet: 10,
1400
+ children: /* @__PURE__ */ z(V, {
1401
+ className: "swagger-input",
1402
+ disabled: N,
1403
+ onValueChange: (e) => onInputChange("password", e)
1404
+ })
1405
+ }) }),
1406
+ /* @__PURE__ */ z(v, { children: /* @__PURE__ */ z(y, {
1407
+ desktop: 10,
1408
+ tablet: 10,
1409
+ children: /* @__PURE__ */ z(K, {
1410
+ collection: W({ items: [{
1411
+ label: "Authorization header",
1412
+ value: "basic"
1413
+ }, {
1414
+ label: "Request body",
1415
+ value: "request-body"
1416
+ }] }),
1417
+ defaultValue: ["basic"],
1418
+ disabled: N,
1419
+ label: "Client credentials location:",
1420
+ onValueChange: (e) => onInputChange("passwordType", e[0]),
1421
+ size: "sm"
1422
+ })
1423
+ }) })
1424
+ ] }) : null,
1425
+ (A === O || A === T || A === D || A === E) && (!N || N && g.clientId) && /* @__PURE__ */ z(v, { children: /* @__PURE__ */ z(y, {
1426
+ desktop: 10,
1427
+ tablet: 10,
1428
+ children: /* @__PURE__ */ z(U, {
1429
+ className: "swagger-input",
1430
+ defaultValue: g.clientId,
1431
+ disabled: N,
1432
+ label: "client_id",
1433
+ onValueChange: (e) => onInputChange("clientId", e)
1434
+ })
1435
+ }) }),
1436
+ (A === O || A === D || A === E) && /* @__PURE__ */ z(v, { children: /* @__PURE__ */ z(y, {
1437
+ desktop: 10,
1438
+ tablet: 10,
1439
+ children: /* @__PURE__ */ z(V, {
1440
+ className: "swagger-input",
1441
+ defaultValue: g.clientSecret,
1442
+ disabled: N,
1443
+ label: "client_secret",
1444
+ onValueChange: (e) => onInputChange("clientSecret", e)
1445
+ })
1446
+ }) }),
1447
+ !N && h && h.size ? /* @__PURE__ */ B("div", {
1448
+ className: "scopes",
1449
+ children: [/* @__PURE__ */ B("div", {
1450
+ className: "scope-actions",
1451
+ children: [
1452
+ "Scopes:",
1453
+ /* @__PURE__ */ z("button", {
1454
+ className: "q-text-link",
1455
+ "data-all": !0,
1456
+ onClick: selectScopes,
1457
+ children: "select all"
1458
+ }),
1459
+ /* @__PURE__ */ z("button", {
1460
+ className: "q-text-link",
1461
+ onClick: selectScopes,
1462
+ children: "select none"
1463
+ })
1464
+ ]
1465
+ }), h.map((e, t) => /* @__PURE__ */ z(v, { children: /* @__PURE__ */ z(G, {
1466
+ checked: g.scopes.includes(t),
1467
+ controlProps: { "data-value": t },
1468
+ disabled: N,
1469
+ label: /* @__PURE__ */ B("div", {
1470
+ className: "text",
1471
+ children: [/* @__PURE__ */ z("p", {
1472
+ className: "name",
1473
+ children: t
1474
+ }), /* @__PURE__ */ z("p", {
1475
+ className: "description",
1476
+ children: e
1477
+ })]
1478
+ }),
1479
+ onCheckedChange: (e) => {
1480
+ onScopeChange(t, e);
1481
+ }
1482
+ }) }, t)).toArray()]
1483
+ }) : null,
1484
+ P.valueSeq().map((e, t) => /* @__PURE__ */ z(b, { error: e }, t)),
1485
+ /* @__PURE__ */ B("div", {
1486
+ className: "auth-btn-wrapper",
1487
+ children: [F && (N ? /* @__PURE__ */ z(j, {
1488
+ "aria-label": "Remove authorization",
1489
+ onClick: logout,
1490
+ variant: "fill",
1491
+ children: "Logout"
1492
+ }) : /* @__PURE__ */ z(j, {
1493
+ "aria-label": "Apply given OAuth2 credentials",
1494
+ emphasis: "primary",
1495
+ onClick: authorize,
1496
+ variant: "fill",
1497
+ children: "Authorize"
1498
+ })), /* @__PURE__ */ z(j, {
1499
+ onClick: close,
1500
+ variant: "outline",
1501
+ children: "Close"
1502
+ })]
1503
+ })
1504
+ ]
1505
+ });
1506
+ }
1507
+ //#endregion
1508
+ //#region src/internal/clear.tsx
1509
+ function Clear(e) {
1510
+ return /* @__PURE__ */ z(j, {
1511
+ endIcon: k,
1512
+ onClick: () => {
1513
+ let { method: t, path: n, specActions: r } = e;
1514
+ r.clearResponse(n, t), r.clearRequest(n, t);
1515
+ },
1516
+ variant: "outline",
1517
+ children: "Clear"
1518
+ });
1519
+ }
1520
+ //#endregion
1521
+ //#region src/internal/content-type.tsx
1522
+ function ContentType({ ariaControls: e, ariaLabel: t, contentTypes: n, label: r, onChange: i, value: o = null }) {
1523
+ let c = s(() => q.fromJS(n), [n]), l = s(() => !c || !c.size ? null : W({ items: c.toArray() }), [c]);
1524
+ return te(() => {
1525
+ c && i && i(c.first());
1526
+ }), a(() => {
1527
+ c && o && !c.includes(o) && i && c.size && i(c.first());
1528
+ }, [
1529
+ c,
1530
+ i,
1531
+ o
1532
+ ]), !c || !c.size || !l ? null : /* @__PURE__ */ z(K, {
1533
+ clearable: !1,
1534
+ collection: l,
1535
+ controlProps: {
1536
+ "aria-controls": e,
1537
+ "aria-label": t || "Content Type"
1538
+ },
1539
+ label: r?.trim() || void 0,
1540
+ onClick: (e) => {
1541
+ e.preventDefault();
1542
+ },
1543
+ onValueChange: (e) => i?.(e[0]),
1544
+ size: "sm",
1545
+ style: { minWidth: 180 },
1546
+ value: o ? [o] : []
1547
+ });
1548
+ }
1549
+ //#endregion
1550
+ //#region src/internal/enum-model.tsx
1551
+ EnumModel.displayName = "EnumModel";
1552
+ var KeyRenderer = () => null;
1553
+ KeyRenderer.when = () => !0;
1554
+ function EnumModel({ getComponent: e, value: t }) {
1555
+ let n = e("RenderLink"), r = useThemeContext();
1556
+ return /* @__PURE__ */ z(JsonModelViewer, {
1557
+ defaultInspectDepth: 25,
1558
+ displayDataTypes: !1,
1559
+ displayKeyIndicator: !1,
1560
+ displaySize: !1,
1561
+ groupArraysAfterLength: 100,
1562
+ indentWidth: 2,
1563
+ keyRenderer: KeyRenderer,
1564
+ renderLink: n,
1565
+ rootName: !1,
1566
+ theme: r,
1567
+ value: t.toJSON()
1568
+ });
1569
+ }
1570
+ //#endregion
1571
+ //#region src/internal/execute.tsx
1572
+ function Execute(e) {
1573
+ let handleValidateParameters = () => {
1574
+ let { method: t, path: n, specActions: r, specSelectors: i } = e;
1575
+ return r.validateParams([n, t]), i.validateBeforeExecute([n, t]);
1576
+ }, handleValidateRequestBody = () => {
1577
+ let { method: t, oas3Actions: n, oas3Selectors: r, path: i, specSelectors: a } = e, o = {
1578
+ missingBodyValue: !1,
1579
+ missingRequiredKeys: []
1580
+ };
1581
+ n.clearRequestBodyValidateError({
1582
+ method: t,
1583
+ path: i
1584
+ });
1585
+ let s = a.getOAS3RequiredRequestBodyContentType([i, t]), c = r.requestBodyValue(i, t), l = r.validateBeforeExecute([i, t]), u = r.requestContentType(i, t);
1586
+ if (!l) return o.missingBodyValue = !0, n.setRequestBodyValidateError({
1587
+ method: t,
1588
+ path: i,
1589
+ validationErrors: o
1590
+ }), !1;
1591
+ if (!s) return !0;
1592
+ let d = r.validateShallowRequired({
1593
+ oas3RequestBodyValue: c,
1594
+ oas3RequestContentType: u,
1595
+ oas3RequiredRequestBodyContentType: s
1596
+ });
1597
+ if (!d || d.length < 1) return !0;
1598
+ for (let e of d) o.missingRequiredKeys.push(e);
1599
+ return n.setRequestBodyValidateError({
1600
+ method: t,
1601
+ path: i,
1602
+ validationErrors: o
1603
+ }), !1;
1604
+ }, handleValidationResultPass = () => {
1605
+ let { method: t, operation: n, path: r, specActions: i } = e;
1606
+ e.onExecute && e.onExecute(), i.execute({
1607
+ method: t,
1608
+ operation: n,
1609
+ path: r
1610
+ });
1611
+ }, handleValidationResultFail = () => {
1612
+ let { method: t, path: n, specActions: r } = e;
1613
+ r.clearValidateParams([n, t]), setTimeout(() => {
1614
+ r.validateParams([n, t]);
1615
+ }, 40);
1616
+ }, handleValidationResult = (e) => {
1617
+ e ? handleValidationResultPass() : handleValidationResultFail();
1618
+ }, onClick = () => {
1619
+ let e = handleValidateParameters(), t = handleValidateRequestBody();
1620
+ handleValidationResult(e && t);
1621
+ }, { disabled: t } = e;
1622
+ return /* @__PURE__ */ z(j, {
1623
+ className: "execute-button",
1624
+ disabled: t,
1625
+ emphasis: "primary",
1626
+ endIcon: E,
1627
+ onClick,
1628
+ variant: "fill",
1629
+ children: "Execute"
1630
+ });
1631
+ }
1632
+ //#endregion
1633
+ //#region src/code-mirror/docs-code-mirror.tsx
1634
+ DocsCodeMirror.displayName = "DocsCodeMirror";
1635
+ function DocsCodeMirror({ basicSetup: e, copyable: t, downloadable: n, handleDownload: r, language: i = "json", theme: a = "dark", value: o, ...c }) {
1636
+ let l = typeof e == "object" ? e : {}, u = s(() => {
1637
+ switch (i) {
1638
+ case "bash": return [X.bash()];
1639
+ case "html": return [X.html()];
1640
+ case "xml": return [X.xml()];
1641
+ default: return [X.json()];
1642
+ }
1643
+ }, [i]);
1644
+ return /* @__PURE__ */ B("div", {
1645
+ className: "q-code-mirror",
1646
+ children: [/* @__PURE__ */ z(ie, {
1647
+ basicSetup: {
1648
+ ...l,
1649
+ highlightActiveLine: !1,
1650
+ lineNumbers: !1,
1651
+ lintKeymap: !0,
1652
+ syntaxHighlighting: !0
1653
+ },
1654
+ editable: !1,
1655
+ extensions: u,
1656
+ maxHeight: "700px",
1657
+ minWidth: "400px",
1658
+ theme: [a === "dark" ? ne : re],
1659
+ value: o,
1660
+ ...c
1661
+ }), t || n ? /* @__PURE__ */ B("div", {
1662
+ className: "actions-wrapper",
1663
+ children: [n ? /* @__PURE__ */ z(oe, {
1664
+ trigger: /* @__PURE__ */ z(M, {
1665
+ "aria-label": "Download",
1666
+ density: "compact",
1667
+ emphasis: "primary",
1668
+ icon: g,
1669
+ onClick: r,
1670
+ variant: "ghost"
1671
+ }),
1672
+ children: "Download"
1673
+ }) : null, t ? /* @__PURE__ */ z(ae, { valueOrFn: () => o }) : null]
1674
+ }) : null]
1675
+ });
1676
+ }
1677
+ //#endregion
1678
+ //#region src/internal/utils.ts
1679
+ function sanitizeUrl$1(e) {
1680
+ return typeof e != "string" || e === "" ? "" : se(e);
1681
+ }
1682
+ function jsFileDownload(e, t, n, r) {
1683
+ let i = new Blob(r === void 0 ? [e] : [r, e], { type: n || "application/octet-stream" }), a = window.URL && window.URL.createObjectURL ? window.URL.createObjectURL(i) : window.webkitURL.createObjectURL(i), o = document.createElement("a");
1684
+ o.style.display = "none", o.href = a, o.setAttribute("download", t), o.download === void 0 && o.setAttribute("target", "_blank"), document.body.appendChild(o), o.click(), setTimeout(function() {
1685
+ document.body.removeChild(o), window.URL.revokeObjectURL(a);
1686
+ }, 200);
1687
+ }
1688
+ function stringify(e) {
1689
+ if (typeof e == "string") return e;
1690
+ if (e && e.toJS && (e = e.toJS()), typeof e == "object" && e) try {
1691
+ return JSON.stringify(e, null, 2);
1692
+ } catch {
1693
+ return String(e);
1694
+ }
1695
+ return e == null ? "" : e.toString();
1696
+ }
1697
+ function isFunc(e) {
1698
+ return typeof e == "function";
1699
+ }
1700
+ function isAbsoluteUrl(e) {
1701
+ return e.match(/^(?:[a-z]+:)?\/\//i);
1702
+ }
1703
+ function addProtocol(e) {
1704
+ return e.match(/^\/\//i) ? `${window.location.protocol}${e}` : e;
1705
+ }
1706
+ function buildBaseUrl(e, t) {
1707
+ return e ? isAbsoluteUrl(e) ? addProtocol(e) : new URL(e, t).href : t;
1708
+ }
1709
+ function buildUrl(e, t, { selectedServer: n = "" } = {}) {
1710
+ if (!e) return;
1711
+ if (isAbsoluteUrl(e)) return e;
1712
+ let r = buildBaseUrl(n, t);
1713
+ return isAbsoluteUrl(r) ? new URL(e, r).href : new URL(e, window.location.href).href;
1714
+ }
1715
+ function safeBuildUrl(e, t, { selectedServer: n = "" } = {}) {
1716
+ try {
1717
+ return buildUrl(e, t, { selectedServer: n });
1718
+ } catch {
1719
+ return;
1720
+ }
1721
+ }
1722
+ var createDeepLinkPath = (e) => typeof e == "string" ? e.trim().replace(/\s/g, "%20") : "", escapeDeepLinkPath = (e) => ce(createDeepLinkPath(e).replace(/%20/g, "_"));
1723
+ function getList(e, t) {
1724
+ if (!q.Iterable.isIterable(e)) return q.List();
1725
+ let n = e.getIn(Array.isArray(t) ? t : [t]);
1726
+ return q.List.isList(n) ? n : q.List();
1727
+ }
1728
+ var getExtensions = (e) => e.filter((e, t) => t.startsWith("x-"));
1729
+ //#endregion
1730
+ //#region src/internal/highlight-code.tsx
1731
+ function HighlightCode({ canCopy: e, children: t, downloadable: n, fileName: r = "response.txt", language: i }) {
1732
+ let handleDownload = () => {
1733
+ jsFileDownload(t, r);
1734
+ }, a = e || t?.startsWith("{") || t?.startsWith("["), o = useThemeContext();
1735
+ return /* @__PURE__ */ z("div", {
1736
+ className: "qui-code-mirror",
1737
+ style: { maxWidth: 700 },
1738
+ children: /* @__PURE__ */ z(DocsCodeMirror, {
1739
+ copyable: a,
1740
+ downloadable: n,
1741
+ handleDownload,
1742
+ language: i,
1743
+ theme: o,
1744
+ value: t
1745
+ })
1746
+ });
1747
+ }
1748
+ //#endregion
1749
+ //#region src/internal/json-schema-array-item-file.tsx
1750
+ JsonSchemaArrayItemFile.displayName = "JsonSchemaArrayItemFile";
1751
+ function JsonSchemaArrayItemFile(e) {
1752
+ let onFileChange = (t) => {
1753
+ let n = t.target.files[0];
1754
+ e.onChange?.(n, e.keyName);
1755
+ }, { disabled: t, errors: n, getComponent: r } = e, i = r("Input"), a = t || !("FormData" in window);
1756
+ return /* @__PURE__ */ z(i, {
1757
+ className: n.size ? "invalid" : "",
1758
+ disabled: a,
1759
+ onChange: onFileChange,
1760
+ title: n.size ? n : "",
1761
+ type: "file"
1762
+ });
1763
+ }
1764
+ //#endregion
1765
+ //#region src/internal/json-schema-array-item-text.tsx
1766
+ JsonSchemaArrayItemText.displayName = "JsonSchemaArrayItemText";
1767
+ function JsonSchemaArrayItemText(e) {
1768
+ let { description: t, disabled: n, errors: r, keyName: i = "", onChange: onChangeProp = () => {}, value: a = "" } = e, onChange = (e) => {
1769
+ onChangeProp(e, i);
1770
+ }, o = r.toJS ? r.toJS() : [], s = a || "";
1771
+ return /* @__PURE__ */ z(U, {
1772
+ className: "swagger-input",
1773
+ disabled: n,
1774
+ errorText: o.length ? o[0] : "",
1775
+ invalid: o.length > 0,
1776
+ onValueChange: onChange,
1777
+ placeholder: t,
1778
+ size: "sm",
1779
+ value: s
1780
+ });
1781
+ }
1782
+ //#endregion
1783
+ //#region src/internal/json-schema-array.tsx
1784
+ JsonSchemaArray.displayName = "JsonSchemaArray";
1785
+ function valueOrEmptyList(e) {
1786
+ return q.List.isList(e) ? e : Array.isArray(e) ? q.fromJS(e) : q.List();
1787
+ }
1788
+ function JsonSchemaArray(e) {
1789
+ let { disabled: t, errors: n, fn: r, getComponent: i, onChange: onChangeProp = () => {}, required: o = !1, schema: c = {}, value: u = "" } = e, [d, f] = l(valueOrEmptyList(u)), [p, m] = l(c);
1790
+ a(() => {
1791
+ m(c);
1792
+ }, [c]), a(() => {
1793
+ d !== u && f(valueOrEmptyList(u));
1794
+ }, [d, u]);
1795
+ let onChange = (e) => {
1796
+ onChangeProp?.(e);
1797
+ }, onItemChange = (e, t) => {
1798
+ let n = d.set(t, e);
1799
+ f(n), onChange(n);
1800
+ }, removeItem = (e) => {
1801
+ let t = d.delete(e);
1802
+ f(t), onChange(t);
1803
+ }, addItem = () => {
1804
+ let e = valueOrEmptyList(d).push(r.getSampleSchema(p.get("items"), !1, { includeWriteOnly: !0 }));
1805
+ f(e), onChange(e);
1806
+ }, onEnumChange = (e) => {
1807
+ f(e), onChange(e);
1808
+ }, h = n.toJS ? n.toJS() : Array.isArray(n) ? n : [], g = h.filter((e) => typeof e == "string"), _ = h.filter((e) => e.needRemove !== void 0).map((e) => e.error), v = !!(d && d.count && d.count() > 0), y = p.getIn(["items", "enum"]), b = p.getIn(["items", "type"]), x = p.getIn(["items", "format"]), S = p.get("items"), C, w = !1, E = b === "file" || b === "string" && x === "binary";
1809
+ b && x ? C = i(`JsonSchema_${b}_${x}`) : (b === "boolean" || b === "array" || b === "object") && (C = i(`JsonSchema_${b}`)), !C && !E && (w = !0);
1810
+ let O = s(() => y ? W({ items: y.toArray() }) : null, [y]);
1811
+ if (y && O) {
1812
+ let e = d instanceof q.List ? d.toArray() : Array.from(d);
1813
+ return /* @__PURE__ */ z(K, {
1814
+ className: "swagger-input",
1815
+ clearable: !o,
1816
+ collection: O,
1817
+ disabled: t,
1818
+ invalid: h.length > 0,
1819
+ multiple: !0,
1820
+ onValueChange: (e) => onEnumChange(e),
1821
+ size: "sm",
1822
+ value: e
1823
+ });
1824
+ }
1825
+ return /* @__PURE__ */ B("div", {
1826
+ className: "json-schema-array",
1827
+ children: [v ? d.map((n, a) => {
1828
+ let o = q.fromJS([...h.filter((e) => e.index === a).map((e) => e.error)]);
1829
+ return /* @__PURE__ */ B("div", {
1830
+ className: "json-schema-form-item",
1831
+ children: [E ? /* @__PURE__ */ z(JsonSchemaArrayItemFile, {
1832
+ ...e,
1833
+ disabled: t,
1834
+ errors: o,
1835
+ onChange: (e) => onItemChange(e, a),
1836
+ value: n
1837
+ }) : w ? /* @__PURE__ */ z(JsonSchemaArrayItemText, {
1838
+ ...e,
1839
+ disabled: t,
1840
+ errors: o,
1841
+ onChange: (e) => onItemChange(e, a),
1842
+ value: n
1843
+ }) : /* @__PURE__ */ z(C, {
1844
+ ...e,
1845
+ disabled: t,
1846
+ errors: o,
1847
+ fn: r,
1848
+ getComponent: i,
1849
+ onChange: (e) => onItemChange(e, a),
1850
+ schema: S,
1851
+ value: n
1852
+ }), t ? null : /* @__PURE__ */ z(M, {
1853
+ "aria-label": _?.length ? _[0] : "Remove Option",
1854
+ icon: T,
1855
+ onClick: () => removeItem(a),
1856
+ size: "sm",
1857
+ variant: "outline"
1858
+ })]
1859
+ }, a);
1860
+ }) : null, t ? null : /* @__PURE__ */ B(j, {
1861
+ "aria-label": g.length ? g[0] : "",
1862
+ className: "qui-json-schema-array-add-btn",
1863
+ emphasis: g.length ? "danger" : "neutral",
1864
+ endIcon: D,
1865
+ onClick: addItem,
1866
+ variant: "fill",
1867
+ children: [
1868
+ "Add ",
1869
+ b ? `${b} ` : "",
1870
+ "item"
1871
+ ]
1872
+ })]
1873
+ });
1874
+ }
1875
+ //#endregion
1876
+ //#region src/internal/json-schema-object.tsx
1877
+ JsonSchemaObject.displayName = "JsonSchemaObject";
1878
+ function JsonSchemaObject(e) {
1879
+ let onChange = (t) => {
1880
+ e.onChange?.(t);
1881
+ }, handleOnChange = (e) => {
1882
+ onChange(e);
1883
+ }, { disabled: t, value: n } = e, r = useThemeContext();
1884
+ return /* @__PURE__ */ z("div", { children: /* @__PURE__ */ z(DocsCodeMirror, {
1885
+ basicSetup: {
1886
+ foldGutter: !1,
1887
+ lineNumbers: !1,
1888
+ lintKeymap: !0
1889
+ },
1890
+ editable: !t,
1891
+ language: "json",
1892
+ onChange: handleOnChange,
1893
+ theme: r,
1894
+ value: stringify(n)
1895
+ }) });
1896
+ }
1897
+ //#endregion
1898
+ //#region src/internal/json-schema-string.tsx
1899
+ JsonSchemaString.displayName = "JsonSchemaString";
1900
+ function JsonSchemaString({ description: e, disabled: t, errors: n, keyName: r, onChange: i, required: a, schema: o, value: c }) {
1901
+ let onFileChange = (e) => {
1902
+ let t = e.target.files?.[0];
1903
+ i?.(t, r);
1904
+ }, l = o && o.get ? o.get("enum") : null, u = o && o.get ? o.get("format") : null, d = o && o.get ? o.get("type") : null, f = o && o.get ? o.get("in") : null, p = c || "", m = n.toJS ? n.toJS() : [], h = s(() => l ? W({ items: [...l] }) : null, [l]);
1905
+ if (l && h) return /* @__PURE__ */ z(K, {
1906
+ clearable: !a,
1907
+ collection: h,
1908
+ disabled: t,
1909
+ invalid: m.length > 0,
1910
+ onValueChange: (e) => i?.(e[0]),
1911
+ size: "sm",
1912
+ value: p ? [p] : []
1913
+ });
1914
+ let g = t || !(!f || f !== "formData" || "FormData" in window);
1915
+ return d && d === "file" ? /* @__PURE__ */ z("input", {
1916
+ disabled: g,
1917
+ onChange: (e) => onFileChange(e),
1918
+ type: "file"
1919
+ }) : /* @__PURE__ */ z(U, {
1920
+ className: "swagger-input",
1921
+ disabled: g,
1922
+ errorText: m.length ? m[0] : "",
1923
+ inputProps: { type: u && u === "password" ? "password" : "text" },
1924
+ invalid: m.length > 0,
1925
+ onValueChange: (e) => i?.(e, r),
1926
+ placeholder: e,
1927
+ size: "sm",
1928
+ value: p
1929
+ });
1930
+ }
1931
+ //#endregion
1932
+ //#region src/internal/use-swagger-context.tsx
1933
+ var We = t(null), Ge = We.Provider;
1934
+ function useSwaggerContext() {
1935
+ let e = i(We);
1936
+ if (!e) throw Error("QUI Swagger must be wrapped by a <SwaggerContextProvider>");
1937
+ return e;
1938
+ }
1939
+ //#endregion
1940
+ //#region src/internal/layout.tsx
1941
+ Layout.displayName = "Layout";
1942
+ function Layout({ errSelectors: e, getComponent: t, specSelectors: n }) {
1943
+ let r = t("SvgAssets"), i = t("InfoContainer", !0), a = t("VersionPragmaFilter"), o = t("operations", !0), s = t("Models", !0), c = t("Webhooks", !0), l = t("Row"), u = t("Col"), f = t("errors", !0), p = t("ServersContainer", !0), m = t("SchemesContainer", !0), h = t("AuthorizeBtnContainer", !0), g = t("FilterContainer", !0), _ = n.isSwagger2(), v = n.isOAS3(), y = n.isOAS31(), b = !n.specStr(), x = n.loadingStatus(), { hideTitleSection: S } = useSwaggerContext(), C = null;
1944
+ if (x === "loading" && (C = /* @__PURE__ */ z("div", {
1945
+ className: "info",
1946
+ children: /* @__PURE__ */ z("div", {
1947
+ className: "loading-container",
1948
+ children: /* @__PURE__ */ z("div", { className: "loading" })
1949
+ })
1950
+ })), x === "failed" && (C = /* @__PURE__ */ z("div", {
1951
+ className: "info",
1952
+ children: /* @__PURE__ */ B("div", {
1953
+ className: "loading-container",
1954
+ children: [/* @__PURE__ */ z("h4", {
1955
+ className: "title",
1956
+ children: "Failed to load API definition."
1957
+ }), /* @__PURE__ */ z(f, {})]
1958
+ })
1959
+ })), x === "failedConfig") {
1960
+ let t = e.lastError(), n = t ? t.get("message") : "";
1961
+ C = /* @__PURE__ */ z("div", {
1962
+ className: "info failed-config",
1963
+ children: /* @__PURE__ */ B("div", {
1964
+ className: "loading-container",
1965
+ children: [/* @__PURE__ */ z("h4", {
1966
+ className: "title",
1967
+ children: "Failed to load remote configuration."
1968
+ }), /* @__PURE__ */ z("p", { children: n })]
1969
+ })
1970
+ });
1971
+ }
1972
+ if (!C && b && (C = /* @__PURE__ */ z("h4", { children: "No API definition provided." })), C) return /* @__PURE__ */ z("div", {
1973
+ className: "swagger-ui",
1974
+ children: /* @__PURE__ */ z("div", {
1975
+ className: "loading-container",
1976
+ children: C
1977
+ })
1978
+ });
1979
+ let w = n.servers(), T = n.schemes(), E = w && w.size, D = T && T.size, O = !!n.securityDefinitions();
1980
+ return /* @__PURE__ */ B("div", {
1981
+ className: "swagger-ui",
1982
+ children: [/* @__PURE__ */ z(r, {}), /* @__PURE__ */ B(a, {
1983
+ alsoShow: /* @__PURE__ */ z(f, {}),
1984
+ isOAS3: v,
1985
+ isSwagger2: _,
1986
+ children: [
1987
+ /* @__PURE__ */ z(f, {}),
1988
+ S ? null : /* @__PURE__ */ z(l, {
1989
+ className: "information-container",
1990
+ children: /* @__PURE__ */ z(u, {
1991
+ mobile: 12,
1992
+ children: /* @__PURE__ */ z(i, {})
1993
+ })
1994
+ }),
1995
+ E || D || O ? /* @__PURE__ */ z("div", {
1996
+ className: d("scheme-container", S ? "title-hidden" : ""),
1997
+ children: /* @__PURE__ */ B("div", {
1998
+ className: "schemes-wrapper",
1999
+ children: [E || D ? /* @__PURE__ */ B("div", {
2000
+ className: "schemes-server-container",
2001
+ children: [E ? /* @__PURE__ */ z(p, {}) : null, D ? /* @__PURE__ */ z(m, {}) : null]
2002
+ }) : null, O ? /* @__PURE__ */ z(h, {}) : null]
2003
+ })
2004
+ }) : null,
2005
+ /* @__PURE__ */ z(g, {}),
2006
+ /* @__PURE__ */ z(l, { children: /* @__PURE__ */ z(u, {
2007
+ desktop: 12,
2008
+ mobile: 12,
2009
+ children: /* @__PURE__ */ z(o, {})
2010
+ }) }),
2011
+ y && /* @__PURE__ */ z(l, {
2012
+ className: "webhooks-container",
2013
+ children: /* @__PURE__ */ z(u, {
2014
+ desktop: 12,
2015
+ mobile: 12,
2016
+ children: /* @__PURE__ */ z(c, {})
2017
+ })
2018
+ }),
2019
+ /* @__PURE__ */ z(l, { children: /* @__PURE__ */ z(u, {
2020
+ desktop: 12,
2021
+ mobile: 12,
2022
+ children: /* @__PURE__ */ z(s, {})
2023
+ }) })
2024
+ ]
2025
+ })]
2026
+ });
2027
+ }
2028
+ //#endregion
2029
+ //#region src/internal/model-collapse.tsx
2030
+ ModelCollapse.displayName = "ModelCollapse";
2031
+ function ModelCollapse({ children: e, classes: t, collapsedContent: n = "{...}", expanded: i = !0, hideSelfOnExpand: s = !1, modelId: u, modelName: d, onToggle: f, title: p }) {
2032
+ let [m, h] = l(i), g = c(!1);
2033
+ a(() => {
2034
+ h(i);
2035
+ }, [i]);
2036
+ let _ = r(() => {
2037
+ f?.(d, !m), h((e) => !e);
2038
+ }, [
2039
+ m,
2040
+ d,
2041
+ f
2042
+ ]), v = o(() => {
2043
+ _();
2044
+ });
2045
+ a(() => {
2046
+ if (!g.current && window.location.hash && u && window.location.hash === `#${u}`) {
2047
+ let e = document.getElementById(u);
2048
+ e && (e.scrollIntoView(), m || v());
2049
+ }
2050
+ g.current = !0;
2051
+ }, [
2052
+ u,
2053
+ d,
2054
+ f,
2055
+ m,
2056
+ _
2057
+ ]);
2058
+ let y = o(() => {
2059
+ u && window.location.hash === `#${u}` && !m && _();
2060
+ });
2061
+ return a(() => {
2062
+ function onStateChange() {
2063
+ y();
2064
+ }
2065
+ return window.navigation?.addEventListener("navigatesuccess", onStateChange), () => {
2066
+ window.navigation?.removeEventListener("navigatesuccess", onStateChange);
2067
+ };
2068
+ }, []), m && s ? /* @__PURE__ */ z("span", {
2069
+ className: t || "",
2070
+ children: e
2071
+ }) : /* @__PURE__ */ z("span", { children: /* @__PURE__ */ z(Z.Root, {
2072
+ onValueChange: _,
2073
+ value: m ? ["item"] : [],
2074
+ children: /* @__PURE__ */ z(Z.Item, {
2075
+ text: p,
2076
+ value: "item",
2077
+ children: m ? e : /* @__PURE__ */ z("span", { children: n })
2078
+ })
2079
+ }) });
2080
+ }
2081
+ //#endregion
2082
+ //#region src/internal/model-example.tsx
2083
+ var usePrevious = (e) => {
2084
+ let t = c(void 0);
2085
+ return a(() => {
2086
+ t.current = e;
2087
+ }), t.current;
2088
+ }, useTabs = ({ example: e, initialTab: t, isExecute: n, schema: i }) => {
2089
+ let o = s(() => ({
2090
+ example: "example",
2091
+ model: "model"
2092
+ }), []), c = !s(() => Object.keys(o), [o]).includes(t) || !i || n ? o.example : t, u = usePrevious(n), [d, f] = l(c), p = r((e) => {
2093
+ f(e);
2094
+ }, []);
2095
+ return a(() => {
2096
+ u && !n && e && f(o.example);
2097
+ }, [
2098
+ u,
2099
+ n,
2100
+ e,
2101
+ o.example
2102
+ ]), {
2103
+ activeTab: d,
2104
+ onTabChange: p,
2105
+ tabs: o
2106
+ };
2107
+ };
2108
+ function ModelExample({ example: e, getComponent: t, getConfigs: n, includeReadOnly: r = !1, includeWriteOnly: i = !1, isExecute: a = !1, schema: o, specPath: s, specSelectors: c }) {
2109
+ let { defaultModelExpandDepth: l, defaultModelRendering: u } = n(), d = t("ModelWrapper"), f = t("HighlightCode", !0), p = J(5).toString("base64"), m = J(5).toString("base64"), h = J(5).toString("base64"), g = J(5).toString("base64"), _ = c.isOAS3(), { activeTab: v, onTabChange: y, tabs: b } = useTabs({
2110
+ example: e,
2111
+ initialTab: u,
2112
+ isExecute: a,
2113
+ schema: o
2114
+ });
2115
+ return /* @__PURE__ */ z("div", {
2116
+ className: "model-example",
2117
+ children: /* @__PURE__ */ B(le.Root, {
2118
+ onValueChange: y,
2119
+ value: v,
2120
+ children: [
2121
+ /* @__PURE__ */ B(le.List, { children: [
2122
+ /* @__PURE__ */ z(le.Indicator, {}),
2123
+ /* @__PURE__ */ z(Q.Root, {
2124
+ value: "example",
2125
+ children: /* @__PURE__ */ z(Q.Button, { children: a ? "Edit Value" : "Example" })
2126
+ }),
2127
+ o ? /* @__PURE__ */ z(Q.Root, {
2128
+ value: "model",
2129
+ children: /* @__PURE__ */ z(Q.Button, { children: _ ? "Schema" : "Model" })
2130
+ }) : null
2131
+ ] }),
2132
+ /* @__PURE__ */ z(le.Panel, {
2133
+ value: "example",
2134
+ children: /* @__PURE__ */ z("div", {
2135
+ "aria-hidden": v !== b.example,
2136
+ "aria-labelledby": p,
2137
+ "data-name": "examplePanel",
2138
+ id: m,
2139
+ tabIndex: 0,
2140
+ children: e || /* @__PURE__ */ z(f, { children: "(no example available" })
2141
+ })
2142
+ }),
2143
+ o ? /* @__PURE__ */ z(le.Panel, {
2144
+ value: "model",
2145
+ children: /* @__PURE__ */ z("div", {
2146
+ "aria-hidden": v === b.example,
2147
+ "aria-labelledby": h,
2148
+ "data-name": "modelPanel",
2149
+ id: g,
2150
+ tabIndex: 0,
2151
+ children: /* @__PURE__ */ z(d, {
2152
+ expandDepth: l,
2153
+ getComponent: t,
2154
+ getConfigs: n,
2155
+ includeReadOnly: r,
2156
+ includeWriteOnly: i,
2157
+ schema: o,
2158
+ specPath: s,
2159
+ specSelectors: c
2160
+ })
2161
+ })
2162
+ }) : null
2163
+ ]
2164
+ })
2165
+ });
2166
+ }
2167
+ //#endregion
2168
+ //#region src/internal/model-wrapper.tsx
2169
+ function ModelWrapper(e) {
2170
+ let { expandDepth: t, fullPath: n, getComponent: r, getConfigs: i, layoutActions: a, layoutSelectors: o } = e, onToggle = (e, t) => {
2171
+ a && a.show(n, t);
2172
+ }, s = r("Model"), c;
2173
+ return o && (c = o.isShown(n)), /* @__PURE__ */ z("div", {
2174
+ className: "model-box",
2175
+ children: /* @__PURE__ */ z(s, {
2176
+ ...e,
2177
+ depth: 1,
2178
+ expandDepth: t || 0,
2179
+ expanded: c,
2180
+ getConfigs: i,
2181
+ onToggle
2182
+ })
2183
+ });
2184
+ }
2185
+ //#endregion
2186
+ //#region src/internal/use-jump-to-hash.tsx
2187
+ function useJumpToHash(e, t, n) {
2188
+ let r = e?.(), i = c(!1);
2189
+ a(() => {
2190
+ if (!i.current && r && t && r === `#${t}`) {
2191
+ let e = document.getElementById(t);
2192
+ e && (e.scrollIntoView(), i.current || n?.());
2193
+ }
2194
+ i.current = !0;
2195
+ }, [
2196
+ t,
2197
+ r,
2198
+ n
2199
+ ]);
2200
+ }
2201
+ //#endregion
2202
+ //#region src/internal/models.tsx
2203
+ Models.displayName = "Models";
2204
+ function Models(e) {
2205
+ let getSchemaBasePath = () => e.specSelectors.isOAS3() ? ["components", "schemas"] : ["definitions"], handleToggle = (t, n) => {
2206
+ let { layoutActions: r } = e;
2207
+ r.show([...getSchemaBasePath(), t], n), n && e.specActions.requestResolvedSubtree([...getSchemaBasePath(), t]);
2208
+ }, onLoadModels = (t) => {
2209
+ t && e.layoutActions.readyToScroll(getSchemaBasePath(), t);
2210
+ }, onLoadModel = (t) => {
2211
+ if (t) {
2212
+ let n = t.getAttribute("data-name");
2213
+ e.layoutActions.readyToScroll([...getSchemaBasePath(), n], t);
2214
+ }
2215
+ }, { getComponent: t, getConfigs: n, layoutActions: r, layoutSelectors: i, specSelectors: a } = e, o = a.definitions(), { defaultModelsExpandDepth: s, docExpansion: c } = n(), { hash: l } = useSwaggerContext(), u = l.substring(l.indexOf("model-") + 6);
2216
+ if (useJumpToHash(e.fn?.getHash, "models"), !o.size || s < 0) return null;
2217
+ let f = getSchemaBasePath(), p = i.isShown(f, s > 0 && c !== "none"), m = a.isOAS3(), g = t("ModelWrapper"), _ = t("ModelCollapse"), v = t("Markdown");
2218
+ return /* @__PURE__ */ B("section", {
2219
+ ref: onLoadModels,
2220
+ className: p ? "models is-open" : "models",
2221
+ children: [/* @__PURE__ */ B("button", {
2222
+ "aria-expanded": p,
2223
+ className: "model-collapse-title",
2224
+ id: "models",
2225
+ onClick: () => r.show(f, !p),
2226
+ children: [m ? "Schemas" : "Models", /* @__PURE__ */ z(N, {
2227
+ "aria-label": "Model visibility icon",
2228
+ className: d("collapse-icon", { "is-open": p }),
2229
+ icon: h,
2230
+ size: "md"
2231
+ })]
2232
+ }), /* @__PURE__ */ z($.Root, {
2233
+ open: p,
2234
+ children: /* @__PURE__ */ z($.Content, { children: o.entrySeq().map(([o]) => {
2235
+ let c = [...f, o], l = q.List(c), d = a.specResolvedSubtree(c), p = a.specJson().getIn(c), m = q.Map.isMap(d) ? d : q.Map(), h = q.Map.isMap(p) ? p : q.Map(), y = m.get("title") || h.get("title") || o, b = i.isShown(c, !1), x = m.get("description") || h.get("description");
2236
+ b && m.size === 0 && h.size > 0 && e.specActions.requestResolvedSubtree(c);
2237
+ let S = u && u === o, C = /* @__PURE__ */ z(g, {
2238
+ activeInHash: S,
2239
+ displayName: y,
2240
+ expandDepth: s,
2241
+ fullPath: c,
2242
+ getComponent: t,
2243
+ getConfigs: n,
2244
+ includeReadOnly: !0,
2245
+ includeWriteOnly: !0,
2246
+ layoutActions: r,
2247
+ layoutSelectors: i,
2248
+ name: o,
2249
+ schema: m || q.Map(),
2250
+ specPath: l,
2251
+ specSelectors: a
2252
+ }), w = /* @__PURE__ */ z("span", {
2253
+ className: "model-box",
2254
+ children: /* @__PURE__ */ z("span", {
2255
+ className: "model model-title",
2256
+ children: y
2257
+ })
2258
+ }), T = `model-${o}`;
2259
+ return /* @__PURE__ */ B("div", {
2260
+ ref: onLoadModel,
2261
+ className: "model-container",
2262
+ "data-name": o,
2263
+ children: [
2264
+ /* @__PURE__ */ z("span", {
2265
+ className: "model-box-anchor",
2266
+ id: T
2267
+ }),
2268
+ /* @__PURE__ */ z(_, {
2269
+ activeInHash: S,
2270
+ classes: "model-box",
2271
+ collapsedContent: "",
2272
+ displayName: y,
2273
+ expanded: s > 0 && b,
2274
+ getHash: e.fn.getHash,
2275
+ hideSelfOnExpand: !0,
2276
+ layoutActions: r,
2277
+ layoutSelectors: i,
2278
+ modelId: T,
2279
+ modelName: o,
2280
+ onToggle: handleToggle,
2281
+ specPath: l,
2282
+ title: w,
2283
+ children: C
2284
+ }),
2285
+ x ? /* @__PURE__ */ z(v, { source: x }) : null
2286
+ ]
2287
+ }, `models-section-${o}`);
2288
+ }).toArray() })
2289
+ })]
2290
+ });
2291
+ }
2292
+ //#endregion
2293
+ //#region src/internal/object-model.tsx
2294
+ ObjectModel.displayName = "ObjectModelOriginal";
2295
+ function ObjectModel(e) {
2296
+ let { displayName: t, isRef: n, schema: r } = e, i = useThemeContext(), o = c(!1);
2297
+ if (a(() => {
2298
+ !e.expanded && !o.current && e.onToggle?.(e.name, !e.expanded), o.current = !0;
2299
+ }, [e]), !r) return null;
2300
+ r.mapEntries((e) => e);
2301
+ let s = r.toJS(), l = r.get("title") || t || name, u = l ? /* @__PURE__ */ z(Z.Root, {
2302
+ className: "object-model-accordion",
2303
+ value: e.expanded ? ["item"] : [],
2304
+ children: /* @__PURE__ */ z(Z.Item, {
2305
+ onClick: () => e.onToggle?.(e.name, !e.expanded),
2306
+ text: /* @__PURE__ */ B(R, { children: [n && r.get("$$ref") && /* @__PURE__ */ z("span", {
2307
+ className: "model-hint",
2308
+ children: r.get("$$ref")
2309
+ }), /* @__PURE__ */ z("span", { children: l })] }),
2310
+ value: "item"
2311
+ })
2312
+ }) : null, d = e.getComponent("RenderLink");
2313
+ return /* @__PURE__ */ B("div", {
2314
+ className: "object-model",
2315
+ children: [u, /* @__PURE__ */ z(JsonModelViewer, {
2316
+ displayDataTypes: !1,
2317
+ displaySize: !1,
2318
+ groupArraysAfterLength: 100,
2319
+ highlightUpdates: !0,
2320
+ indentWidth: 2,
2321
+ renderLink: d,
2322
+ rootName: !1,
2323
+ theme: i,
2324
+ value: s
2325
+ })]
2326
+ });
2327
+ }
2328
+ //#endregion
2329
+ //#region src/internal/operation-summary-method.tsx
2330
+ OperationSummaryMethod.displayName = "OperationSummaryMethod";
2331
+ var Ke = {
2332
+ delete: { emphasis: "danger" },
2333
+ get: {
2334
+ className: "q-method-get",
2335
+ emphasis: "primary"
2336
+ },
2337
+ head: {
2338
+ className: "q-purple",
2339
+ emphasis: "primary"
2340
+ },
2341
+ options: {
2342
+ className: "q-lime",
2343
+ emphasis: "primary"
2344
+ },
2345
+ patch: {
2346
+ className: "q-orange",
2347
+ emphasis: "neutral"
2348
+ },
2349
+ post: { emphasis: "primary" },
2350
+ put: {
2351
+ className: "q-method-put",
2352
+ emphasis: "neutral"
2353
+ },
2354
+ trace: {
2355
+ className: "q-teal",
2356
+ emphasis: "primary"
2357
+ }
2358
+ };
2359
+ function OperationSummaryMethod({ method: e }) {
2360
+ let t = Ke[e];
2361
+ return /* @__PURE__ */ z(j, {
2362
+ ...t,
2363
+ className: d(t?.className, "qui-method-button", e),
2364
+ render: /* @__PURE__ */ z("div", {}),
2365
+ size: "sm",
2366
+ tabIndex: -1,
2367
+ variant: "fill",
2368
+ children: e.toUpperCase()
2369
+ });
2370
+ }
2371
+ //#endregion
2372
+ //#region src/internal/operation-summary-path.tsx
2373
+ OperationSummaryPath.displayName = "OperationSummaryPath";
2374
+ function OperationSummaryPath({ operationProps: t }) {
2375
+ let { deprecated: n, path: r } = t.toJS(), i = r.split(/(?=\/)/g);
2376
+ for (let e = 1; e < i.length; e += 2) i.splice(e, 0, /* @__PURE__ */ z("wbr", {}, e));
2377
+ return /* @__PURE__ */ z("span", {
2378
+ className: n ? "opblock-summary-path__deprecated" : "opblock-summary-path",
2379
+ "data-path": r,
2380
+ children: i.map((t, n) => /* @__PURE__ */ z(e, { children: t }, n))
2381
+ });
2382
+ }
2383
+ //#endregion
2384
+ //#region src/internal/operation-summary.tsx
2385
+ OperationSummary.displayName = "OperationSummary";
2386
+ function OperationSummary({ authActions: e, authSelectors: t, fn: n, getComponent: r, isShown: i, operationProps: a, specPath: o, toggleShown: s }) {
2387
+ let { displayOperationId: c, isAuthorized: l, method: u, op: f, operationId: p, originalOperationId: m, showSummary: g, summary: _ } = a.toJS(), { summary: v } = f, y = a.get("security"), b = r("authorizeOperationBtn", !0), S = r("OperationSummaryMethod"), C = r("OperationSummaryPath"), w = y && !!y.count(), T = w && y.size === 1 && y.first().isEmpty(), E = !w || T, D = `${p}-1`, O = r("RenderLink");
2388
+ return useJumpToHash(n.getHash, D, () => {
2389
+ s();
2390
+ }), /* @__PURE__ */ B("div", {
2391
+ className: "opblock-summary",
2392
+ children: [
2393
+ /* @__PURE__ */ z("div", {
2394
+ className: "opblock-summary-id",
2395
+ id: D
2396
+ }),
2397
+ /* @__PURE__ */ B("button", {
2398
+ "aria-expanded": i,
2399
+ className: "opblock-summary-control",
2400
+ onClick: s,
2401
+ children: [
2402
+ /* @__PURE__ */ z(M, {
2403
+ icon: x,
2404
+ onClick: (e) => {
2405
+ i || s(), e.stopPropagation();
2406
+ },
2407
+ render: /* @__PURE__ */ z(O, { href: `#${D}` }),
2408
+ size: "sm",
2409
+ style: { marginRight: 8 },
2410
+ variant: "outline"
2411
+ }),
2412
+ /* @__PURE__ */ z(S, { method: u }),
2413
+ /* @__PURE__ */ B("div", {
2414
+ className: "opblock-summary-path-description-wrapper",
2415
+ children: [/* @__PURE__ */ z(C, {
2416
+ getComponent: r,
2417
+ operationProps: a,
2418
+ specPath: o
2419
+ }), g ? /* @__PURE__ */ z("div", {
2420
+ className: "opblock-summary-description",
2421
+ children: ue(v || _)
2422
+ }) : null]
2423
+ }),
2424
+ c && (m || p) ? /* @__PURE__ */ z("span", {
2425
+ className: "opblock-summary-operation-id",
2426
+ children: m || p
2427
+ }) : null,
2428
+ /* @__PURE__ */ z(N, {
2429
+ className: d("collapse-icon", { "is-open": i }),
2430
+ icon: h,
2431
+ size: "sm"
2432
+ })
2433
+ ]
2434
+ }),
2435
+ E ? null : /* @__PURE__ */ z(b, {
2436
+ isAuthorized: l,
2437
+ onClick: () => {
2438
+ let n = t.definitionsForRequirements(y);
2439
+ e.showDefinitions(n);
2440
+ }
2441
+ })
2442
+ ]
2443
+ });
2444
+ }
2445
+ //#endregion
2446
+ //#region src/internal/operation-tag.tsx
2447
+ function OperationTag(e) {
2448
+ let { children: t, getComponent: n, getConfigs: r, layoutActions: i, layoutSelectors: a, oas3Selectors: o, specUrl: s, tag: c, tagObj: l } = e, { deepLinking: u, docExpansion: f } = r(), p = n("Markdown", !0), m = n("DeepLink"), g = l.getIn(["tagDetails", "description"], null), _ = l.getIn([
2449
+ "tagDetails",
2450
+ "externalDocs",
2451
+ "description"
2452
+ ]), y = l.getIn([
2453
+ "tagDetails",
2454
+ "externalDocs",
2455
+ "url"
2456
+ ]), b;
2457
+ b = isFunc(o) && isFunc(o.selectedServer) ? safeBuildUrl(y, s, { selectedServer: o.selectedServer() }) : y;
2458
+ let x = ["operations-tag", c], S = a.isShown(x, f === "full" || f === "list");
2459
+ return /* @__PURE__ */ B("div", {
2460
+ className: S ? "opblock-tag-section is-open" : "opblock-tag-section",
2461
+ children: [/* @__PURE__ */ B("h3", {
2462
+ className: g ? "opblock-tag" : "opblock-tag no-desc",
2463
+ "data-is-open": S,
2464
+ "data-tag": c,
2465
+ id: x.map((e) => escapeDeepLinkPath(e)).join("-"),
2466
+ onClick: () => i.show(x, !S),
2467
+ children: [
2468
+ /* @__PURE__ */ z(m, {
2469
+ enabled: u,
2470
+ isShown: S,
2471
+ path: createDeepLinkPath(c),
2472
+ text: c
2473
+ }),
2474
+ g ? /* @__PURE__ */ z("small", { children: /* @__PURE__ */ z(p, { source: g }) }) : /* @__PURE__ */ z("small", {}),
2475
+ b ? /* @__PURE__ */ z(de, {
2476
+ className: "info__externaldocs external-link",
2477
+ endIcon: v,
2478
+ href: sanitizeUrl$1(b),
2479
+ onClick: (e) => e.stopPropagation(),
2480
+ render: /* @__PURE__ */ z("a", { target: "_blank" }),
2481
+ children: _ || b
2482
+ }) : null,
2483
+ /* @__PURE__ */ z("button", {
2484
+ "aria-expanded": S,
2485
+ className: "expand-operation",
2486
+ onClick: () => i.show(x, !S),
2487
+ title: S ? "Collapse operation" : "Expand operation",
2488
+ children: /* @__PURE__ */ z(N, {
2489
+ className: d("collapse-icon", { "is-open": S }),
2490
+ icon: h,
2491
+ size: "md"
2492
+ })
2493
+ })
2494
+ ]
2495
+ }), /* @__PURE__ */ z($.Root, {
2496
+ open: S,
2497
+ children: /* @__PURE__ */ z($.Content, { children: t })
2498
+ })]
2499
+ });
2500
+ }
2501
+ //#endregion
2502
+ //#region src/internal/operation.tsx
2503
+ function Operation({ authActions: e, authSelectors: t, fn: n, getComponent: r, getConfigs: i, oas3Actions: o, oas3Selectors: s, onCancelClick: c, onExecute: u, onResetClick: d, onTryoutClick: f, operation: p, request: m, response: h, specActions: g, specPath: _ = q.List(), specSelectors: v, toggleShown: y }) {
2504
+ let { allowTryItOut: b, deprecated: x, displayRequestDuration: S, executeInProgress: C, isShown: w, method: T, op: E, operationId: D, path: O, tag: k, tryItOutEnabled: A } = p.toJS(), { description: j, externalDocs: M, schemes: N } = E, F = M ? safeBuildUrl(M.url, v.url(), { selectedServer: s.selectedServer() }) : "", I = p.getIn(["op"]), L = I.get("responses"), R = getList(I, ["parameters"]), V = v.operationScheme(O, T), H = [
2505
+ "operations",
2506
+ k,
2507
+ D
2508
+ ], U = getExtensions(I), W = r("responses"), G = r("parameters"), K = r("execute"), J = r("Collapse"), ee = r("clear"), Y = r("Markdown", !0), te = r("schemes"), X = r("OperationServers"), ne = r("OperationExt"), re = r("OperationSummary"), ie = r("Link"), { showExtensions: ae } = i();
2509
+ if (L && h && h.size > 0) {
2510
+ let e = !L.get(String(h.get("status"))) && !L.get("default");
2511
+ h = h.set("notDocumented", e);
2512
+ }
2513
+ let oe = [O, T], se = v.validationErrors([O, T]), [ce, Z] = l(!1);
2514
+ a(() => {
2515
+ let e = !0;
2516
+ return w && setTimeout(() => {
2517
+ e && Z(!0);
2518
+ }, 50), () => {
2519
+ e = !1;
2520
+ };
2521
+ }, [w]);
2522
+ let Q = /* @__PURE__ */ B("div", {
2523
+ className: "opblock-body",
2524
+ children: [
2525
+ I && I.size || I === null ? null : /* @__PURE__ */ z(pe, {}),
2526
+ x && /* @__PURE__ */ z("h4", {
2527
+ className: "opblock-title_normal",
2528
+ children: " Warning: Deprecated"
2529
+ }),
2530
+ j && /* @__PURE__ */ z("div", {
2531
+ className: "opblock-description-wrapper",
2532
+ children: /* @__PURE__ */ z("div", {
2533
+ className: "opblock-description",
2534
+ children: /* @__PURE__ */ z(Y, { source: j })
2535
+ })
2536
+ }),
2537
+ F ? /* @__PURE__ */ B("div", {
2538
+ className: "opblock-external-docs-wrapper",
2539
+ children: [/* @__PURE__ */ z("h4", {
2540
+ className: "opblock-title_normal",
2541
+ children: "Find more details"
2542
+ }), /* @__PURE__ */ B("div", {
2543
+ className: "opblock-external-docs",
2544
+ children: [M.description && /* @__PURE__ */ z("span", {
2545
+ className: "opblock-external-docs__description",
2546
+ children: /* @__PURE__ */ z(Y, { source: M.description })
2547
+ }), /* @__PURE__ */ z(ie, {
2548
+ className: "opblock-external-docs__link",
2549
+ href: sanitizeUrl$1(F),
2550
+ target: "_blank",
2551
+ children: F
2552
+ })]
2553
+ })]
2554
+ }) : null,
2555
+ !I || !I.size ? null : /* @__PURE__ */ z(G, {
2556
+ allowTryItOut: b,
2557
+ fn: n,
2558
+ getComponent: r,
2559
+ getConfigs: i,
2560
+ oas3Actions: o,
2561
+ oas3Selectors: s,
2562
+ onCancelClick: c,
2563
+ onChangeKey: oe,
2564
+ onResetClick: d,
2565
+ onTryoutClick: f,
2566
+ operation: I,
2567
+ parameters: R,
2568
+ pathMethod: [O, T],
2569
+ specActions: g,
2570
+ specPath: _.push("parameters"),
2571
+ specSelectors: v,
2572
+ tryItOutEnabled: A
2573
+ }),
2574
+ A ? /* @__PURE__ */ z(X, {
2575
+ getComponent: r,
2576
+ getEffectiveServerValue: s.serverEffectiveValue,
2577
+ getSelectedServer: s.selectedServer,
2578
+ getServerVariable: s.serverVariableValue,
2579
+ method: T,
2580
+ operationServers: I.get("servers"),
2581
+ path: O,
2582
+ pathServers: v.paths().getIn([O, "servers"]),
2583
+ setSelectedServer: o.setSelectedServer,
2584
+ setServerVariableValue: o.setServerVariableValue
2585
+ }) : null,
2586
+ !A || !b ? null : N && N.size ? /* @__PURE__ */ z("div", {
2587
+ className: "opblock-schemes",
2588
+ children: /* @__PURE__ */ z(te, {
2589
+ currentScheme: V,
2590
+ method: T,
2591
+ path: O,
2592
+ schemes: N,
2593
+ specActions: g
2594
+ })
2595
+ }) : null,
2596
+ !A || !b || se.length <= 0 ? null : /* @__PURE__ */ z("div", {
2597
+ className: "errors-wrapper",
2598
+ children: /* @__PURE__ */ z(fe, {
2599
+ description: /* @__PURE__ */ z("div", { children: "Please correct the following validation errors and try again." }),
2600
+ emphasis: "danger",
2601
+ label: "Error"
2602
+ })
2603
+ }),
2604
+ /* @__PURE__ */ B("div", {
2605
+ className: !A || !h || !b ? "execute-wrapper" : "btn-group",
2606
+ "data-enabled": P(A),
2607
+ children: [!A || !b ? null : /* @__PURE__ */ z(K, {
2608
+ disabled: C,
2609
+ method: T,
2610
+ oas3Actions: o,
2611
+ oas3Selectors: s,
2612
+ onExecute: u,
2613
+ operation: I,
2614
+ path: O,
2615
+ specActions: g,
2616
+ specSelectors: v
2617
+ }), !A || !h || !b ? null : /* @__PURE__ */ z(ee, {
2618
+ method: T,
2619
+ path: O,
2620
+ specActions: g
2621
+ })]
2622
+ }),
2623
+ C ? /* @__PURE__ */ z(pe, {}) : /* @__PURE__ */ z("div", { style: { height: 4 } }),
2624
+ L ? /* @__PURE__ */ z(W, {
2625
+ displayRequestDuration: S,
2626
+ fn: n,
2627
+ getComponent: r,
2628
+ getConfigs: i,
2629
+ method: T,
2630
+ oas3Actions: o,
2631
+ oas3Selectors: s,
2632
+ path: O,
2633
+ produces: v.producesOptionsFor([O, T]),
2634
+ producesValue: v.currentProducesFor([O, T]),
2635
+ request: m,
2636
+ responses: L,
2637
+ specActions: g,
2638
+ specPath: _.push("responses"),
2639
+ specSelectors: v,
2640
+ tryItOutResponse: h
2641
+ }) : null,
2642
+ !ae || !U.size ? null : /* @__PURE__ */ z(ne, {
2643
+ extensions: U,
2644
+ getComponent: r
2645
+ })
2646
+ ]
2647
+ });
2648
+ return /* @__PURE__ */ B("div", {
2649
+ className: x ? "opblock opblock-deprecated" : w ? `opblock opblock-${T} is-open` : `opblock opblock-${T}`,
2650
+ id: escapeDeepLinkPath(H.join("-")),
2651
+ children: [/* @__PURE__ */ z(re, {
2652
+ authActions: e,
2653
+ authSelectors: t,
2654
+ fn: n,
2655
+ getComponent: r,
2656
+ isShown: w,
2657
+ operationProps: p,
2658
+ specPath: _,
2659
+ toggleShown: y
2660
+ }), ce ? /* @__PURE__ */ z($.Root, {
2661
+ open: w,
2662
+ children: /* @__PURE__ */ z($.Content, { children: Q })
2663
+ }) : /* @__PURE__ */ z(J, {
2664
+ isOpened: w,
2665
+ children: Q
2666
+ })]
2667
+ });
2668
+ }
2669
+ //#endregion
2670
+ //#region src/internal/param-body.tsx
2671
+ ParamBody.displayName = "ParamBody";
2672
+ function ParamBody({ consumes: e, consumesValue: t, fn: n, getComponent: i, isExecute: o, language: s, onChange: c, onChangeConsumes: u, param: d = q.fromJS({}), pathMethod: f, specSelectors: p }) {
2673
+ let [m, h] = l({
2674
+ isEditBox: !1,
2675
+ value: ""
2676
+ }), g = r((e, { isEditBox: t, isXml: n }) => {
2677
+ h({
2678
+ isEditBox: t,
2679
+ value: e
2680
+ }), c?.(e, n);
2681
+ }, [c]), v = r((e) => {
2682
+ let t = n.inferSchema(d.toJS());
2683
+ return n.getSampleSchema(t, e, { includeWriteOnly: !0 });
2684
+ }, [n, d]), y = r(() => {
2685
+ let e = /xml/i.test(t), n = /json/i.test(t), r = e ? d.get("value_xml") : d.get("value");
2686
+ if (r !== void 0) {
2687
+ let t = !r && n ? "{}" : r;
2688
+ h((e) => ({
2689
+ ...e,
2690
+ value: t
2691
+ })), g(t, {
2692
+ isEditBox: o,
2693
+ isXml: e
2694
+ });
2695
+ } else e ? g(v("xml"), {
2696
+ isEditBox: o,
2697
+ isXml: e
2698
+ }) : g(v(), { isEditBox: o });
2699
+ }, [
2700
+ t,
2701
+ o,
2702
+ g,
2703
+ d,
2704
+ v
2705
+ ]);
2706
+ a(() => {
2707
+ y();
2708
+ }, [y]);
2709
+ let handleOnChange = (e) => {
2710
+ let n = /xml/i.test(t);
2711
+ g(e, {
2712
+ isEditBox: m.isEditBox,
2713
+ isXml: n
2714
+ });
2715
+ }, toggleIsEditBox = () => h((e) => ({
2716
+ ...e,
2717
+ isEditBox: !e.isEditBox
2718
+ })), b = i("contentType"), x = p.contentTypeValues(f).get("requestContentType"), S = e && e.size ? e : q.fromJS(["application/json"]), { isEditBox: C, value: w } = m, T = `${createHtmlReadyId(`${f[1]}${f[0]}_parameters`)}_select`, E = useThemeContext();
2719
+ return /* @__PURE__ */ B("div", {
2720
+ className: "body-param",
2721
+ "data-param-in": d.get("in"),
2722
+ "data-param-name": d.get("name"),
2723
+ children: [/* @__PURE__ */ z(DocsCodeMirror, {
2724
+ copyable: !0,
2725
+ editable: C,
2726
+ language: s || "json",
2727
+ onChange: handleOnChange,
2728
+ theme: E,
2729
+ value: w
2730
+ }), /* @__PURE__ */ B("div", {
2731
+ className: "body-param-options",
2732
+ children: [o ? /* @__PURE__ */ z("div", {
2733
+ className: "body-param-edit",
2734
+ children: C ? /* @__PURE__ */ z(j, {
2735
+ emphasis: "danger",
2736
+ endIcon: A,
2737
+ onClick: toggleIsEditBox,
2738
+ variant: "outline",
2739
+ children: "Cancel"
2740
+ }) : /* @__PURE__ */ z(j, {
2741
+ emphasis: "primary",
2742
+ endIcon: _,
2743
+ onClick: toggleIsEditBox,
2744
+ variant: "fill",
2745
+ children: "Edit"
2746
+ })
2747
+ }) : null, /* @__PURE__ */ z(b, {
2748
+ contentTypes: S,
2749
+ controlId: T,
2750
+ label: "Parameter content type",
2751
+ onChange: u,
2752
+ value: x
2753
+ })]
2754
+ })]
2755
+ });
2756
+ }
2757
+ function createHtmlReadyId(e, t = "_") {
2758
+ return e.replace(/[^\w-]/g, t);
2759
+ }
2760
+ //#endregion
2761
+ //#region src/internal/request-body-editor.tsx
2762
+ RequestBodyEditor.displayName = "RequestBodyEditor";
2763
+ function RequestBodyEditor(e) {
2764
+ let [t, n] = l(stringify(e.value || e.defaultValue));
2765
+ a(() => {
2766
+ n(stringify(e.value || e.defaultValue));
2767
+ }, [e.defaultValue, e.value]);
2768
+ let r = useThemeContext();
2769
+ return /* @__PURE__ */ z(DocsCodeMirror, {
2770
+ editable: !0,
2771
+ language: "json",
2772
+ onChange: (t) => {
2773
+ e.onChange?.(t);
2774
+ },
2775
+ theme: r,
2776
+ value: t
2777
+ });
2778
+ }
2779
+ //#endregion
2780
+ //#region src/internal/schemes.tsx
2781
+ Schemes.displayName = "Schemes";
2782
+ function Schemes(e) {
2783
+ let { currentScheme: t, method: n, path: i, schemes: o, specActions: c } = e, l = r((e) => {
2784
+ c.setScheme(e, i, n);
2785
+ }, [
2786
+ n,
2787
+ i,
2788
+ c
2789
+ ]), u = s(() => W({ items: o.valueSeq().toArray() }), [o]);
2790
+ return a(() => {
2791
+ (!t || !o.includes(t)) && l(o.first());
2792
+ }, [
2793
+ t,
2794
+ o,
2795
+ l
2796
+ ]), /* @__PURE__ */ z(K, {
2797
+ clearable: !1,
2798
+ collection: u,
2799
+ label: "Schemes",
2800
+ onValueChange: (e) => l(e[0]),
2801
+ size: "sm",
2802
+ style: { minWidth: 100 },
2803
+ value: t ? [t] : []
2804
+ });
2805
+ }
2806
+ //#endregion
2807
+ //#region src/internal/servers.tsx
2808
+ function Servers({ currentServer: e, getEffectiveServerValue: t, getServerVariable: n, servers: i, setSelectedServer: o, setServerVariableValue: c }) {
2809
+ let l = (i.find((t) => t.get("url") === e) || q.OrderedMap()).get("variables") || q.OrderedMap(), u = l.size !== 0;
2810
+ a(() => {
2811
+ e || o(i.first()?.get("url"));
2812
+ }, [
2813
+ e,
2814
+ i,
2815
+ o
2816
+ ]), a(() => {
2817
+ let t = i.find((t) => t.get("url") === e);
2818
+ t ? (t.get("variables") || q.OrderedMap()).map((t, n) => {
2819
+ c({
2820
+ key: n,
2821
+ server: e,
2822
+ val: t.get("default") || ""
2823
+ });
2824
+ }) : o(i.first().get("url"));
2825
+ }, [
2826
+ e,
2827
+ i,
2828
+ o,
2829
+ c
2830
+ ]);
2831
+ let d = r((e) => {
2832
+ o(e);
2833
+ }, [o]), f = r((t, n) => {
2834
+ c({
2835
+ key: t,
2836
+ server: e,
2837
+ val: n
2838
+ });
2839
+ }, [c, e]), p = i.toArray().map((e) => e.get("url")), m = s(() => W({ items: p }), [p]);
2840
+ return /* @__PURE__ */ B("div", {
2841
+ className: "servers",
2842
+ children: [/* @__PURE__ */ z(K, {
2843
+ className: "swagger-input",
2844
+ clearable: !1,
2845
+ collection: m,
2846
+ controlProps: { id: "servers" },
2847
+ onValueChange: (e) => d(e[0]),
2848
+ value: e ? [e] : []
2849
+ }), u && /* @__PURE__ */ B("div", { children: [
2850
+ /* @__PURE__ */ B("div", {
2851
+ className: "computed-url",
2852
+ children: ["Computed URL:", /* @__PURE__ */ z("code", { children: t(e) })]
2853
+ }),
2854
+ /* @__PURE__ */ z("h4", { children: "Server variables" }),
2855
+ /* @__PURE__ */ z("table", { children: /* @__PURE__ */ z("tbody", { children: l.entrySeq().map(([t, r]) => {
2856
+ let i = r.get("enum") ? r.get("enum").toArray() : [];
2857
+ return /* @__PURE__ */ B("tr", { children: [/* @__PURE__ */ z("td", { children: t }), /* @__PURE__ */ z("td", { children: i.length ? /* @__PURE__ */ z(K, {
2858
+ collection: W({ items: i }),
2859
+ onValueChange: (e) => f(t, e[0]),
2860
+ value: n(e, t) ? [n(e, t)] : []
2861
+ }) : /* @__PURE__ */ z(U, {
2862
+ onValueChange: (e) => f(t, e),
2863
+ value: n(e, t) || ""
2864
+ }) })] }, t);
2865
+ }) }) })
2866
+ ] })]
2867
+ });
2868
+ }
2869
+ //#endregion
2870
+ //#region src/internal/syntax-highlighter.tsx
2871
+ SyntaxHighlighter.displayName = "SyntaxHighlighter";
2872
+ function SyntaxHighlighter({ children: e, ...t }) {
2873
+ let n = useThemeContext();
2874
+ return /* @__PURE__ */ z(DocsCodeMirror, {
2875
+ language: t.language,
2876
+ theme: n,
2877
+ value: e
2878
+ });
2879
+ }
2880
+ //#endregion
2881
+ //#region src/internal/try-it-out-button.tsx
2882
+ TryItOutButton.displayName = "TryItOutButton";
2883
+ function TryItOutButton({ enabled: e, hasUserEditedBody: t, isOAS3: n, onCancelClick: r, onResetClick: i, onTryoutClick: a }) {
2884
+ let o = n && t;
2885
+ return /* @__PURE__ */ B("div", {
2886
+ className: o ? "try-out btn-group" : "try-out",
2887
+ children: [e ? /* @__PURE__ */ z(j, {
2888
+ emphasis: "danger",
2889
+ endIcon: A,
2890
+ onClick: r,
2891
+ variant: "outline",
2892
+ children: "Cancel"
2893
+ }) : /* @__PURE__ */ z(j, {
2894
+ emphasis: "primary",
2895
+ endIcon: y,
2896
+ onClick: a,
2897
+ variant: "outline",
2898
+ children: "Try it out"
2899
+ }), o && /* @__PURE__ */ z(j, {
2900
+ emphasis: "neutral",
2901
+ endIcon: O,
2902
+ onClick: i,
2903
+ variant: "outline",
2904
+ children: "Reset"
2905
+ })]
2906
+ });
2907
+ }
2908
+ //#endregion
2909
+ //#region src/swagger.tsx
2910
+ var quiSwaggerPlugin = () => ({ components: {
2911
+ apiKeyAuth: ApiKeyAuth,
2912
+ ArrayModel,
2913
+ AuthItem,
2914
+ authorizationPopup: AuthorizationPopup,
2915
+ authorizeBtn: AuthorizeBtn,
2916
+ authorizeOperationBtn: AuthorizeOperationBtn,
2917
+ auths: Auths,
2918
+ basicAuth: BasicAuth,
2919
+ clear: Clear,
2920
+ contentType: n(ContentType),
2921
+ EnumModel,
2922
+ execute: Execute,
2923
+ HighlightCode,
2924
+ JsonSchema_array: JsonSchemaArray,
2925
+ JsonSchema_object: JsonSchemaObject,
2926
+ JsonSchema_string: JsonSchemaString,
2927
+ Layout,
2928
+ ModelCollapse,
2929
+ modelExample: ModelExample,
2930
+ Models,
2931
+ ModelWrapper,
2932
+ oauth2: Oauth2,
2933
+ ObjectModel,
2934
+ operation: Operation,
2935
+ OperationSummary: n(OperationSummary),
2936
+ OperationSummaryMethod: n(OperationSummaryMethod),
2937
+ OperationSummaryPath: n(OperationSummaryPath),
2938
+ OperationTag,
2939
+ ParamBody,
2940
+ RequestBodyEditor,
2941
+ schemes: Schemes,
2942
+ Servers,
2943
+ SyntaxHighlighter,
2944
+ TryItOutButton: n(TryItOutButton)
2945
+ } });
2946
+ function Swagger({ getHash: e, hideTitleSection: t, plugins: n, renderLink: r, theme: i, ...a }) {
2947
+ let o = s(() => {
2948
+ let t = [
2949
+ () => ({ fn: { getHash: e } }),
2950
+ () => ({ components: { RenderLink: r } }),
2951
+ quiSwaggerPlugin
2952
+ ];
2953
+ return n ? [...t, ...n] : t;
2954
+ }, [
2955
+ r,
2956
+ e,
2957
+ n
2958
+ ]), c = {
2959
+ hash: e(),
2960
+ hideTitleSection: t
2961
+ };
2962
+ return /* @__PURE__ */ z(Ge, {
2963
+ value: c,
2964
+ children: /* @__PURE__ */ z(Ue, {
2965
+ value: i,
2966
+ children: /* @__PURE__ */ z(u, {
2967
+ defaultModelExpandDepth: 1e3,
2968
+ defaultModelRendering: "model",
2969
+ defaultModelsExpandDepth: 1e3,
2970
+ layout: "Layout",
2971
+ plugins: o,
2972
+ ...a
2973
+ })
2974
+ })
2975
+ });
2976
+ }
2977
+ //#endregion
2978
+ export { Swagger };
2979
+
2
2980
  //# sourceMappingURL=index.js.map