const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"axios-vUo_bRtp.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"rolldown-runtime-Bjp52BOI.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"v1-B1EsIvV8.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"ApiExamples-DTFiS5AN.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"initial-vendor-CbfHqnih.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"utils-DRi8JwoB.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"index-DiVFqI9q.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"_Uint8Array-BVIqJ90l.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"isObjectLike-C8vmzPEN.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"isArray-Dcu1dQ5t.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"cloneDeep-izs3Hzxb.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"utils-D6b6ny2H.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"toString-BX-iyh8G.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"isSymbol-CSH9U2Gm.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"isEqual-BfaiBbcl.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"usePlaygroundInputsStore-DuAEpWYt.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"shallow-BzqLj4xC.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"snippetPresets-u4Are-mZ.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"style-to-object-BY3JEAdk.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"v4-DIgz8zy6.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"getApiPlaygroundDisplay-CKb7GIdu.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"CodeSnippet-BaOQDoQh.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"CodeSnippets-CNRiM0PE.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"inherits_browser-C01ZZYR1.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"index-ClADVa_l.css?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ",(globalThis.__mintAssets||"/docs/_mintlify/assets/")+"v2-BHSGG-Kv.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ"])))=>i.map(i=>d[i]); import{s as e}from"./rolldown-runtime-Bjp52BOI.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{Lr as t,Q as n,ar as r,at as i,dr as a,et as o,jt as s,or as c,ot as l,st as u,ur as d}from"./initial-vendor-CbfHqnih.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{A as f,D as p,E as m,O as h,S as g,T as _,_ as v,a as y,b,c as x,d as S,f as C,g as w,h as T,i as E,j as D,k as O,l as k,m as A,o as j,p as ee,r as M,s as N,t as P,u as F,v as I,w as L,x as te,y as ne}from"./ApiExamples-DTFiS5AN.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{a as re,c as ie,i as ae,n as oe,s as se,t as ce}from"./utils-DRi8JwoB.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{a as R,c as z,d as le,f as ue,g as de,h as fe,i as pe,l as me,m as he,n as ge,o as _e,p as ve,r as ye,s as be,t as xe,u as Se}from"./getPastedJson-qjrnOjTO.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{$ as Ce,A as we,C as Te,E as Ee,F as De,G as Oe,J as ke,K as Ae,Q as je,R as Me,S as Ne,T as Pe,U as Fe,W as Ie,X as Le,Y as Re,Z as ze,_ as Be,a as Ve,b as He,c as Ue,d as We,et as B,f as Ge,g as Ke,h as qe,i as V,j as Je,k as H,l as Ye,m as Xe,n as Ze,o as Qe,p as $e,q as et,r as tt,s as nt,t as rt,u as it,w as at,x as ot,y as st,z as ct}from"./utils-D6b6ny2H.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{n as lt,r as U}from"./addUniqueKeysToSchema-CgBjVdxd.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{t as ut}from"./isEqual-BfaiBbcl.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{a as dt,c as ft,d as pt,f as mt,i as W,l as ht,o as gt,r as _t,s as vt,u as yt}from"./usePlaygroundInputsStore-DuAEpWYt.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{l as bt}from"./snippetPresets-u4Are-mZ.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{t as xt}from"./v4-DIgz8zy6.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{t as St}from"./shallow-BzqLj4xC.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{a as Ct,c as wt,d as Tt,f as G,i as Et,l as Dt,o as Ot,r as kt,s as At,t as jt,u as Mt}from"./SectionHeading-CCarmMPF.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{n as Nt,r as Pt,t as Ft}from"./icon-Dt4VFpdV.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{t as It}from"./getApiPlaygroundDisplay-CKb7GIdu.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{t as Lt}from"./MethodPill-c-UgMFw3.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{A as Rt,Ai as zt,An as Bt,C as Vt,Ca as Ht,Ci as Ut,E as Wt,Ei as Gt,F as Kt,Fn as qt,G as Jt,H as Yt,Hi as Xt,Hn as Zt,Ht as Qt,I as $t,Ia as en,J as K,L as tn,La as nn,M as rn,Ma as an,Mr as on,Na as sn,O as cn,P as ln,Pa as un,Qr as dn,Ra as fn,Si as pn,T as mn,Ti as hn,Tr as gn,U as _n,Ui as vn,V as yn,W as bn,Y as xn,Zr as q,_i as Sn,an as Cn,bi as wn,bn as Tn,cr as En,gi as Dn,h as On,hi as kn,in as An,jt as jn,k as Mn,li as Nn,lr as Pn,mi as Fn,na as In,si as Ln,st as Rn,tr as zn,tt as Bn,un as Vn,vi as Hn,vn as J,w as Un,yi as Wn,yn as Gn,z as Kn}from"./index-DiVFqI9q.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{n as qn,t as Jn}from"./DynamicMarkdown-B7gJlzwx.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{n as Yn}from"./axios-vUo_bRtp.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{t as Xn}from"./CodeSnippet-BaOQDoQh.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";import{t as Zn}from"./CodeSnippets-CNRiM0PE.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ";var Qn=e=>e.in===`path`||!!e.required,$n=e=>[...e].sort((e,t)=>{let n=Qn(e);return n===Qn(t)?0:n?-1:1}),er=e=>{let t=$n(e),n=[],r=[];for(let e of t)Qn(e)?n.push(e):r.push(e);return{required:n,optional:r}},tr=e=>{if(!e)return[];let t=new Map;for(let n of e)for(let{scheme:e,schemeName:r}of n.schemes){let n=ir(e);if(n.length===0)continue;let i=t.get(r);if(!i){t.set(r,{schemeName:r,scheme:e,scopes:[...n]});continue}let a=new Set(i.scopes.map(e=>e.name));for(let e of n)a.has(e.name)||(a.add(e.name),i.scopes.push(e))}return[...t.values()]},nr=(e,t)=>`scope-${rr(e)}-${rr(t)}`,rr=e=>encodeURIComponent(e).replace(/[%_-]/g,e=>e===`%`?`_`:`_${e.charCodeAt(0).toString(16).toUpperCase()}`),ir=e=>{if(!e.scopes||e.scopes.length===0)return[];let t=new Map;e.type===`oauth2`&&Object.values(e.flows).forEach(e=>{e&&Object.entries(e.scopes).forEach(([e,n])=>{n&&!t.has(e)&&t.set(e,n)})});let n=new Set;return e.scopes.flatMap(e=>{if(n.has(e))return[];n.add(e);let r=t.get(e);return[Object.assign({name:e},r?{description:r}:{})]})},ar=`\r `,or=e=>e!==void 0&&!/[\x00-\x1f\x7f]/.test(e)?e:void 0,sr=e=>e.replace(/[\x00-\x1f\x7f]/g,``).replace(/\\/g,`\\\\`).replace(/"/g,`%22`),cr=(e,t,n,r,i)=>{let a=or(_(t,n,r));return sn(e)?{contentType:a??`application/octet-stream`,fileName:e.name,body:i?.get(e)??e}:{contentType:a??L(e),body:p(e)}},lr=(e,t,n)=>Array.isArray(e)?e.flatMap((e,r)=>e==null?[]:[cr(e,t,String(r),r,n)]):nn(e)?Object.entries(e).flatMap(([e,r])=>Array.isArray(r)?r.flatMap((r,i)=>r==null?[]:[cr(r,t,e,i,n)]):r==null?[]:[cr(r,t,e,void 0,n)]):[],ur=new TextDecoder(`latin1`),dr=e=>typeof e.body==`string`?e.body:e.body instanceof Uint8Array?`${e.fileName??``}${ar}${ur.decode(e.body)}`:`${e.fileName??``}`,fr=e=>{let t=ae(e);return t.startsWith(`multipart/`)&&t!==`multipart/form-data`},pr=e=>sn(e)?[e]:Array.isArray(e)?e.flatMap(pr):nn(e)?Object.values(e).flatMap(pr):[],mr=(e,t,n,r)=>{if(!fr(t)||!Array.isArray(e)&&!nn(e))return;let i=lr(e,n,r),a=i.map(dr).join(ar),o=i.some(e=>typeof e.body!=`string`),s=i.some(e=>sn(e.body))?`----MintlifyMultipart${hr()}`:Oe(t)??(o?`----MintlifyMultipart${hr()}`:Le(t)),c=Fe(s,a),l=[];i.forEach((e,t)=>{let n=[`--${c}`,`Content-Type: ${e.contentType}`,...e.fileName===void 0?[]:[`Content-Disposition: attachment; filename="${sr(e.fileName)}"`],``,``].join(ar);l.push(t===0?n:`${ar}${n}`),l.push(e.body)}),l.push(`${ar}--${c}--`);let u=`${t.replace(/;\s*boundary=(?:"[^"]*"|[^;]*)/i,``).trim().replace(/;\s*$/,``)}; boundary=${Ie(c)}`;return{chunks:gr(l),contentType:u}},hr=()=>Array.from(crypto.getRandomValues(new Uint8Array(12)),e=>e.toString(16).padStart(2,`0`)).join(``),gr=e=>e.reduce((e,t)=>{let n=e[e.length-1];return typeof t==`string`&&typeof n==`string`?e[e.length-1]=n+t:e.push(t),e},[]),_r=`mintlify-server-variables`,vr=e=>typeof e!=`object`||!e?!1:Object.values(e).every(e=>typeof e==`object`&&!!e&&Object.values(e).every(e=>typeof e==`string`)),yr=(e,t)=>{let n=e?.baseUrlOptions[t]??``,r=e?.baseUrlNames?.[t];return r===void 0||r===``?n:`${n}#${encodeURIComponent(r)}`},br=(e,t,n)=>e?.[yr(t,n)]??e?.[t?.baseUrlOptions[n]??``]??{},xr=()=>{let e=localStorage.getItem(_r);if(e)try{let t=JSON.parse(e);if(vr(t))return t}catch(e){console.log(`unable to parse stored server variables: ${e}`)}return{}},Sr=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},Cr=c((e,t)=>({locallyStoredCredentials:void 0,setLocallyStoredCredentials:t=>e({locallyStoredCredentials:t}),locallyStoredServerVariables:void 0,setLocallyStoredServerVariables:t=>e({locallyStoredServerVariables:t}),syncCredentialsState:()=>{let{inputs:n,apiReferenceData:r,selectedSecurityOptionIndex:i}=W.getState(),{locallyStoredCredentials:a}=t();r&&a!==void 0&&e({locallyStoredCredentials:wr(n,r,i,a)})},syncServerVariablesState:()=>{let{inputs:n,apiReferenceData:r,selectedBaseUrlIndex:i}=W.getState(),{locallyStoredServerVariables:a}=t();if(!r)return;let o=De(n),s=r.operation?.userInfoPlaygroundInputs,c=Object.assign(Object.assign({},s?.server),o.server),l=yr(r.operation,i);e({locallyStoredServerVariables:Object.assign(Object.assign({},a??{}),{[l]:c})})},updateLocalStorage:e=>void Sr(void 0,void 0,void 0,function*(){let{apiReferenceData:t,selectedBaseUrlIndex:n,inputs:r,selectedSecurityOptionIndex:i}=W.getState();yield Tr({apiReferenceData:t,selectedBaseUrlIndex:n,inputs:r,selectedSecurityOptionIndex:i,storage:e})})})),wr=(e,t,n,r)=>{let i=De(e),a=t.dependencies?.processedSecurityOptions?.[n],o={query:Object.assign({},r?.query),header:Object.assign({},r?.header),cookie:Object.assign({},r?.cookie)};if(a){let e=`schemes`in a?a.schemes:[a];for(let t of e){let e=t.name,n=`in`in t.scheme?t.scheme.in:`header`,r=i[n][e];r!==void 0&&(o[n][e]=r)}}return o},Tr=e=>Sr(void 0,[e],void 0,function*({apiReferenceData:e,selectedBaseUrlIndex:t,inputs:n,selectedSecurityOptionIndex:r,storage:i}){let a=e?.operation?.userInfoPlaygroundInputs,o=De(n),s=xr(),c=Object.assign(Object.assign({},a?.server),o.server),l=yr(e?.operation,t),u=Object.assign(Object.assign({},s),{[l]:c}),d=JSON.stringify(u);localStorage.setItem(_r,d);let f=yield wn(i),p=e?wr(n,e,r,f):f;yield i.store(Wn,p)}),Er=({path:e,baseUrl:t,parameters:n})=>{let r=W(e=>e.getApiPlaygroundInputs)(),i=ce(e,r.path,n);return se(oe(t,r.server),i)},Y=e(t(),1);function Dr({apiReferenceData:e,selectedBaseUrlIndex:t,selectedExampleIndex:n,selectedRequestBodyContentTypeIndex:r,locallyStoredCredentials:i,serverInputs:a}){let o=(0,Y.useRef)(!1),s=(0,Y.useRef)(!1),c=(0,Y.useRef)(n),l=(0,Y.useRef)(void 0);(0,Y.useEffect)(()=>{if(o.current)return;let n=W.getState();n.reset();let u=Or({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:0,selectedExampleIndex:0,selectedContentTypeIndex:r,locallyStoredCredentials:i,serverInputs:a});n.initializeInputs(u),n.initializeApiReferenceData(e),o.current=!0,s.current=!!i,c.current=0,l.current=Ge(e,r)[0]},[]),(0,Y.useEffect)(()=>{if(!o.current||s.current||!i)return;let n=W.getState(),c=Or({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:n.selectedSecurityOptionIndex,selectedExampleIndex:n.selectedExampleIndex,selectedContentTypeIndex:r,locallyStoredCredentials:i,serverInputs:a});n.replaceInputs(c),s.current=!0},[i]),(0,Y.useEffect)(()=>{if(!o.current||c.current===n||!e.operation?.prefillPlaygroundWithExample)return;let s=W.getState();s.clear();let l=Or({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:s.selectedSecurityOptionIndex,selectedExampleIndex:n,selectedContentTypeIndex:r,locallyStoredCredentials:i,serverInputs:a});s.initializeInputs(l),c.current=n},[n,e.operation?.prefillPlaygroundWithExample]);let u=(0,Y.useRef)(r);(0,Y.useEffect)(()=>{if(!o.current||u.current===r)return;let s=W.getState(),d=s.selectedExampleName??l.current,f=d===void 0?0:Math.max(0,Ge(e,r).indexOf(d));f!==n&&(c.current=f,s.setSelectedExampleIndex(f));let p=Or({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:s.selectedSecurityOptionIndex,selectedExampleIndex:f,selectedContentTypeIndex:r,locallyStoredCredentials:i,serverInputs:a});s.replaceBodyInputs(mt(p)),u.current=r},[r]);let d=(0,Y.useRef)(t);(0,Y.useEffect)(()=>{if(!o.current||d.current===t)return;let n=W.getState(),s=Or({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:n.selectedSecurityOptionIndex,selectedExampleIndex:n.selectedExampleIndex,selectedContentTypeIndex:r,locallyStoredCredentials:i,serverInputs:a});n.replaceServerInputs(s),d.current=t},[t]);let f=(0,Y.useRef)(a);f.current=a,(0,Y.useEffect)(()=>{let n=(n,r)=>{kr({server:n,previousServer:r,apiReferenceData:e,selectedBaseUrlIndex:t,fallbackServerInputs:f.current})};return n(Sn()),Hn.subscribe((e,t)=>{n(e.server,t.server)})},[e,t])}function Or({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:n,selectedExampleIndex:r,selectedContentTypeIndex:i,locallyStoredCredentials:a,serverInputs:o}){let s=e.operation?.userInfoPlaygroundInputs,c=Sn();return Ar({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:n,selectedExampleIndex:r,selectedContentTypeIndex:i,mergedUserInfo:{server:Object.assign(Object.assign(Object.assign({},s?.server),o),c),header:Object.assign(Object.assign({},s?.header),a?.header),query:Object.assign(Object.assign({},s?.query),a?.query),cookie:Object.assign(Object.assign({},s?.cookie),a?.cookie),path:Object.assign({},s?.path)}})}function kr({server:e,previousServer:t,apiReferenceData:n,selectedBaseUrlIndex:r,fallbackServerInputs:i}){let a=Object.values(n.dependencies?.servers??{})[r]?.variables;if(!a||Object.keys(a).length===0)return;let o=n.operation?.userInfoPlaygroundInputs?.server??{},{setInput:s,deleteInput:c}=W.getState();for(let[t,n]of Object.entries(e))a[t]&&s(`${B.server}.${V(t)}`,n);if(t!==void 0)for(let n of Object.keys(t)){if(n in e||!a[n])continue;let t=`${B.server}.${V(n)}`,r=a[n],l=typeof r==`object`&&r?qe(r):void 0,u=typeof l==`string`?l:void 0,d=i?.[n]??o[n]??u;d===void 0?c(t):s(t,d)}}var Ar=({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:n,selectedExampleIndex:r=0,selectedContentTypeIndex:i=0,mergedUserInfo:a})=>{let o={},s=e.operation?.prefillPlaygroundWithExample,c=(i===0?e.operation?.prefillPlaygroundExamples??[]:$e(e,i))[r],l=Object.values(e.dependencies?.servers??{})[t]?.variables,u=e.dependencies?.processedSecurityOptions?.[n],d=e.dependencies?.parameters,f=e.dependencies?.requestBody;if(s&&c)o=Object.assign(Object.assign(Object.assign(Object.assign({},jr(l)),Mr(u)),Nr({apiReferenceData:e,parameters:d})),c);else if(bt(f,Xe(e,i))===`examples`)o=Object.assign(Object.assign(Object.assign({},jr(l)),Mr(u)),Nr({apiReferenceData:e,parameters:d}));else{let t=e.operation?.requiredOnlyExamples;o=Object.assign(Object.assign(Object.assign(Object.assign({},jr(l)),Mr(u)),Nr({apiReferenceData:e,parameters:d})),t?{}:Pr({requestBody:f,apiReferenceData:e,selectedContentTypeIndex:i}))}return a&&(o=Object.assign(Object.assign({},o),Fr({mergedUserInfo:a,securityOption:u,serverVariables:l,apiReferenceData:e}))),o};function jr(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{let r=`${B.server}.${V(e)}`;if(typeof n==`object`&&n){let e=qe(n);e&&(t[r]=e)}}),t}function Mr(e){let t={};return e&&e.schemes.forEach(({scheme:e,schema:n,name:r})=>{let i=Be({scheme:e,name:r}),a=qe(n);a&&typeof a==`string`&&(t[i]=a),a&&typeof a==`object`&&(t[i+`.username`]=`username`in a&&typeof a.username==`string`?a.username:``,t[i+`.password`]=`password`in a&&typeof a.password==`string`?a.password:``)}),t}function Nr({apiReferenceData:e,parameters:t}){let n={};if(!t)return n;let{header:r,path:i,query:a,querystring:o,cookie:s}=We(e);return[...r,...i,...a,...o,...s].forEach(e=>{if(e.schema){let t=`${Je(e.in)}.${V(e.name)}`,r=qe(e.schema);r&&(n[t]=r)}}),n}function Pr({requestBody:e,apiReferenceData:t,selectedContentTypeIndex:n}){let r={};if(!e)return r;let i=Xe(t,n);if(i){let t=Ae(e.content[i]),n=typeof t==`object`&&t?qe(t):void 0;if(n)r[`${B.body}`]=n;else if(H(t)){let e=Ue(t);return Object.assign(Object.assign({},r),e)}}return r}function Fr({mergedUserInfo:e,securityOption:t,serverVariables:n,apiReferenceData:r}){let i={};if(t){let n={};t.schemes.forEach(({scheme:e,name:t})=>{n[t]=e}),Object.entries(e.header??{}).forEach(([e,t])=>{let r=n[e];r&&(ot(r)?(typeof t==`object`&&t&&`username`in t&&typeof t.username==`string`&&(i[`${B.header}.Authorization.username`]=t.username),typeof t==`object`&&t&&`password`in t&&typeof t.password==`string`&&(i[`${B.header}.Authorization.password`]=t.password)):typeof t==`string`&&(i[`${B.header}.${V(e)}`]=t))}),Object.entries(e.query??{}).forEach(([e,t])=>{n[e]&&(i[`${B.query}.${V(e)}`]=t)}),Object.entries(e.cookie??{}).forEach(([e,t])=>{n[e]&&(i[`${B.cookie}.${V(e)}`]=t)})}if(n&&Object.keys(n).length>0&&e.server&&Object.entries(e.server).forEach(([e,t])=>{n[e]&&(i[`${B.server}.${V(e)}`]=t)}),e.path&&Object.keys(e.path).length>0){let{path:t}=We(r),n=new Set(t.map(e=>e.name));Object.entries(e.path).forEach(([e,t])=>{n.has(e)&&(i[`${B.path}.${V(e)}`]=t)})}return i}var Ir=(0,Y.createContext)({isSending:!1,isPlaygroundExpanded:!1}),X=e(d(),1),Lr=(0,Y.createContext)({}),Rr=({value:e,children:t})=>(0,X.jsx)(Lr.Provider,{value:e,children:t}),zr=()=>(0,Y.useContext)(Lr);function Br(e,t,n,r){return e===null?`null`:e===void 0?`undefined`:typeof e==`string`?JSON.stringify(e):typeof e==`number`||typeof e==`boolean`?String(e):Array.isArray(e)?Vr(e,t,n,r):typeof e==`object`&&e?Hr(e,t,n,r):String(e)}function Vr(e,t,n,r){if(e.length===0)return`[]`;let i=`[`+e.map(e=>Br(e,t,n,r)).join(`, `)+`]`;if(i.length<=t)return i;n++;let a=`[ `+e.map(e=>r.repeat(n)+Br(e,t,n,r)).join(`, `)+` `+r.repeat(n-1)+`]`;return n--,a}function Hr(e,t,n,r){let i=Object.keys(e);if(i.length===0)return`{}`;let a=`{ `+i.map(i=>`${JSON.stringify(i)}: ${Br(e[i],t,n,r)}`).join(`, `)+` }`;if(a.length<=t)return a;n++;let o=`{ `+i.map(i=>r.repeat(n)+`${JSON.stringify(i)}: ${Br(e[i],t,n,r)}`).join(`, `)+` `+r.repeat(n-1)+`}`;return n--,o}function Ur(e,t=45){return Br(e,t,0,` `)}function Wr({example:e}){return(0,X.jsx)(At,{className:`overflow-wrap-anywhere text-[13px] [&_*]:text-[13px]`,markdown:typeof e==`object`&&e?`\`\`\`json\n${Ur(e)}\n\`\`\``:`\`${e===`null`?null:JSON.stringify(e,void 0,2)}\``})}var Gr=({schema:e})=>{let t=G(),n=e.example,r=e.examples===void 0?void 0:Array.isArray(e.examples)?e.examples:[e.examples],i=n!==void 0||r!==void 0&&r.length>0,o=r&&r.length>1?t[`api.examples`]:t[`api.example`];return i&&(0,X.jsxs)(`div`,{className:a(`flex prose prose-sm prose-gray dark:prose-invert mt-6 gap-1.5`,(typeof n==`object`||typeof r?.[0]==`object`)&&`flex-col gap-y-3`),children:[(0,X.jsxs)(`span`,{children:[o,`:`]}),r===void 0?(0,X.jsx)(Wr,{example:n}):(0,X.jsx)(`div`,{className:a(`*:my-2`,typeof r[0]!=`object`&&`inline *:mr-2 [&_*]:inline`),children:r.map((e,t)=>(0,X.jsx)(Wr,{example:e},t))})]})},Kr=(e,t)=>t==null||t===``||t===!1?[]:t===!0?[e]:typeof t==`string`?[t]:typeof t==`number`?[String(t)]:Array.isArray(t)?t.flatMap(e=>typeof e==`string`?[e]:typeof e==`number`?[String(e)]:[]):[],qr=(e,t=[])=>{if(!e)return{pre:void 0,post:void 0};let n=e[`x-mint`],r=[...n?.pre??[]],i=[];e.readOnly&&i.push(`read-only`),e.writeOnly&&i.push(`write-only`);let a=e;for(let e of t)i.push(...Kr(e,a[e]));return n?.post&&i.push(...n.post),{pre:r.length?r:void 0,post:i.length?i:void 0}},Jr=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Yr=(...e)=>e.filter((e,t,n)=>!!e&&n.indexOf(e)===t).join(` `),Xr={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Zr=(0,Y.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,Y.createElement)(`svg`,{ref:c,...Xr,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Yr(`lucide`,i),...s},[...o.map(([e,t])=>(0,Y.createElement)(e,t)),...Array.isArray(a)?a:[a]])),Qr=((e,t)=>{let n=(0,Y.forwardRef)(({className:n,...r},i)=>(0,Y.createElement)(Zr,{ref:i,iconNode:t,className:Yr(`lucide-${Jr(e)}`,n),...r}));return n.displayName=`${e}`,n})(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),$r=({children:e,open:t,onOpenChange:n})=>(0,X.jsx)(o,{onOpenChange:n,open:t,children:e});$r.displayName=`DropdownMenu`;var ei=({className:e,children:t,...r})=>(0,X.jsx)(n,{className:a(`group group overflow-hidden rounded-lg disabled:pointer-events-none [&>span]:line-clamp-1`,`flex items-center gap-1 py-0.5 text-sm text-stone-950/50 group-hover:text-stone-950/70 dark:text-white/50 dark:group-hover:text-white/70`,e),...r,children:t});ei.displayName=`DropdownMenuTrigger`;var ti=({className:e,sideOffset:t=4,align:n=`start`,...r})=>(0,X.jsx)(l,{children:(0,X.jsx)(i,{align:n,className:`z-50`,collisionPadding:16,sideOffset:t,children:(0,X.jsx)(u,{className:a(`relative max-h-96 min-w-(--anchor-width) overflow-y-auto rounded-2xl border-standard bg-white p-1 text-stone-950/70 shadow-stone-500/5 shadow-xl dark:bg-stone-950 dark:text-white/70 dark:shadow-none dark:shadow-stone-500/5`,`data-[ending-style]:fade-out-0 data-[starting-style]:fade-in-0 data-[ending-style]:zoom-out-95 data-[starting-style]:zoom-in-95`,e),style:{textRendering:`geometricPrecision`},...r})})});ti.displayName=`DropdownMenuContent`;var ni=({className:e,isSelected:t,children:n,onSelect:r,onClick:i,...o})=>(0,X.jsxs)(s,{className:a(`group relative flex w-full cursor-pointer select-none items-center justify-between gap-2 rounded-md px-2 py-1 text-sm outline-0 hover:bg-stone-950/3 focus:bg-stone-950/5 data-disabled:pointer-events-none data-disabled:cursor-default data-disabled:opacity-50 dark:focus:bg-white/5 dark:hover:bg-white/3`,t?`font-medium text-primary dark:text-primary-light`:`text-stone-950/50 hover:text-stone-950/75 focus:text-stone-950/75 dark:text-white/50 dark:focus:text-white/75 dark:hover:text-white/75`,e),onClick:e=>{i?.(e),r?.()},...o,children:[n,(0,X.jsx)(Qr,{className:a(`size-3.5 shrink-0 text-primary dark:text-primary-light`,!t&&`opacity-0`),strokeWidth:2.5})]});ni.displayName=`DropdownMenuItem`;var ri=({children:e,prefix:t,className:n})=>(0,X.jsxs)(`div`,{className:a(`flex items-center gap-1 break-all rounded-md bg-stone-100/50 px-2 py-0.5 font-medium text-stone-600 dark:bg-white/5 dark:text-stone-200`,n),"data-component-part":`field-info-pill`,children:[t&&(0,X.jsx)(`span`,{className:`text-stone-400 dark:text-stone-500`,children:t}),(0,X.jsx)(`span`,{children:e})]}),ii=`user_toggled_expandables`,ai=()=>{try{let e=sessionStorage.getItem(ii);return e?JSON.parse(e):{}}catch{return{}}},oi=(e,t)=>{try{let n={...ai(),[e]:t};sessionStorage.setItem(ii,JSON.stringify(n))}catch{}},si=(e,t=!1)=>{let n=(0,Y.useRef)(null),[r,i]=(0,Y.useState)(!1),[a,o]=(0,Y.useState)(!1),[s,c]=(0,Y.useState)(t);return(0,Y.useEffect)(()=>{if(!e)return;let t=ai();e in t&&(c(!!t[e]),i(!0),o(!0))},[e]),(0,Y.useEffect)(()=>{let e=new IntersectionObserver(e=>{e[0]&&e[0].isIntersecting&&!r&&t&&c(e=>e||!0)},{rootMargin:`100px`,threshold:0}),i=n.current;return i&&e.observe(i),()=>{i&&e.unobserve(i)}},[r,t]),{ref:n,isExpanded:s,onManualToggle:(0,Y.useCallback)(t=>{c(t),i(!0),o(!0),e&&oi(e,t)},[e]),isInSessionStorage:a}},ci=`expandable-content`,li=`Hide`,ui=`Show`,di=`child attributes`,fi=({title:e=di,defaultOpen:t=!1,onChange:n,lazy:i,className:o,children:s,uniqueParamId:c,onMount:l,onOpen:u,onClose:d,openedText:f=li,closedText:p=ui,hasScrolledToAnchorRef:m,anchor:h})=>{let g=!!c,{ref:_,isExpanded:v,onManualToggle:y,isInSessionStorage:b}=si(c||``,t),[x,S]=(0,Y.useState)(t),C=!!(c&&h!=null&&h.includes(c))&&!(m!=null&&m.current),w=g?C?!0:b?v:t:x,[T,E]=(0,Y.useState)(w||!i);(0,Y.useLayoutEffect)(()=>{w&&!T&&E(!0)},[w,T]),(0,Y.useEffect)(()=>{l?.()},[]);let D=e=>{E(!0),n&&n(e),e?u?.():d?.()},O=e=>{g?y(e):S(e),D(e)},k=`${e}-${(0,Y.useId)()}-content`.replace(/\s+/g,`-`);return(0,X.jsxs)(`details`,{className:a(r.Expandable,`mt-4 rounded-xl border-standard`,o),"data-component-part":`expandable`,"data-testid":c?`${c}-children`:void 0,onToggle:e=>{let t=e.currentTarget.open;t!==w&&O(t)},open:w,ref:_,children:[(0,X.jsxs)(`summary`,{"aria-controls":k,"aria-expanded":w,className:a(`not-prose flex w-full cursor-pointer flex-row content-center items-center text-sm`,`rounded-t-xl px-3.5 py-3 text-stone-600 hover:bg-stone-50/50 hover:text-stone-900 dark:text-stone-300 dark:hover:bg-white/5 dark:hover:text-stone-200`,`list-none [&::-webkit-details-marker]:hidden`,!w&&`rounded-b-xl`),"data-component-part":`expandable-button`,children:[(0,X.jsx)(Ft,{className:a(`size-2.5 bg-stone-400 transition-transform`,w&&`rotate-90`),"data-component-part":`expandable-icon`,icon:`angle-right`,overrideColor:!0,overrideSize:!0}),(0,X.jsx)(`div`,{className:`ml-3 text-left leading-tight`,children:(0,X.jsxs)(`p`,{className:`m-0`,contentEditable:!1,children:[w?f:p,` `,e]})})]}),(0,X.jsx)(`div`,{className:a(ci,`mx-3 border-stone-100 border-t px-2 dark:border-white/10`),"data-component-part":ci,id:k,children:T&&s})]},e)},pi=e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``),mi=`Tab Title`,hi=Object.assign(({children:e,defaultTabIndex:t=0,onTabChange:n,className:i,borderBottom:o,ariaLabel:s,panelsRef:c})=>{let l=(0,Y.useRef)([]),u=(0,Y.useId)(),d=(0,Y.useMemo)(()=>Y.Children.toArray(e).filter(e=>(0,Y.isValidElement)(e)),[e]),f=(0,Y.useMemo)(()=>d.map((e,t)=>{if(e.props.id)return e.props.id;let n=e.props.title??mi;return`${u}-${pi(n)}-${t}`}),[d,u]),p=d.length>0?Math.max(0,Math.min(t,d.length-1)):0,[m,h]=(0,Y.useState)(p);(0,Y.useEffect)(()=>{d.length>0&&m>=d.length&&h(d.length-1)},[d.length,m]);let g=(0,Y.useCallback)(e=>{e!==m&&(h(e),n?.(e))},[m,n]),_=(0,Y.useCallback)((e,t)=>{let n=d.length;if(n!==0){if(e.key===`ArrowLeft`||e.key===`ArrowRight`){e.preventDefault();let r=e.key===`ArrowLeft`?(t-1+n)%n:(t+1)%n;g(r),setTimeout(()=>{var e;(e=l.current[r])==null||e.focus()},0)}else if(e.key===`Enter`||e.key===` `)e.preventDefault(),g(t);else if(e.key===`Home`)e.preventDefault(),g(0),setTimeout(()=>{var e;(e=l.current[0])==null||e.focus()},0);else if(e.key===`End`){e.preventDefault();let t=n-1;g(t),setTimeout(()=>{var e;(e=l.current[t])==null||e.focus()},0)}}},[d.length,g]);return(0,X.jsxs)(`div`,{className:a(r.Tabs,`tabs tab-container`,o&&`border-stone-200 border-b pb-6 dark:border-stone-700`,i),children:[(0,X.jsx)(`ul`,{"aria-label":s??`Tabs`,className:`not-prose mb-6 flex min-w-full flex-none gap-x-6 overflow-auto border-stone-200 border-b pb-px dark:border-stone-700`,"data-component-part":`tabs-list`,role:`tablist`,children:d.map((e,t)=>{let n=e.props.title??mi,i=e.props.icon,o=e.props.iconType,s=e.props.iconLibrary,c=t===m;return(0,X.jsx)(`li`,{"aria-controls":`panel-${f[t]}`,"aria-selected":c,className:`cursor-pointer`,"data-child-heading-ids":e.props[Pt],"data-child-tab-ids":e.props[Nt],"data-component-part":`tab`,id:f[t],onClick:e=>{e.stopPropagation(),g(t)},onKeyDown:e=>_(e,t),ref:e=>{l.current[t]=e},role:`tab`,tabIndex:c?0:-1,children:(0,X.jsxs)(`div`,{className:a(`-mb-px flex max-w-max items-center gap-1.5 whitespace-nowrap border-b pt-3 pb-2.5 font-semibold text-sm leading-6`,c?`border-current text-primary dark:text-primary-light`:`border-transparent text-stone-900 hover:border-stone-300 dark:text-stone-200 dark:hover:border-stone-700`),"data-active":c,"data-component-part":`tab-button`,"data-testid":`tab-${n}`,children:[i&&(0,X.jsx)(Ft,{className:a(`size-4 shrink-0`,c?`bg-primary dark:bg-primary-light`:`bg-stone-900 dark:bg-stone-200`,r.TabIcon),icon:i,iconLibrary:s,iconType:o,overrideColor:!0}),n]})},f[t])})}),(0,X.jsx)(`div`,{"data-component-part":`tabs-panels`,ref:c,children:d.map((e,t)=>{let n=t===m;return(0,X.jsx)(`div`,{"aria-hidden":!n,"aria-labelledby":f[t],className:a(`prose dark:prose-invert overflow-x-auto`,!n&&`hidden`),"data-component-part":`tab-content`,id:`panel-${f[t]}`,role:`tabpanel`,tabIndex:n?0:-1,children:e.props.children},f[t])})})]})},{Item:({children:e})=>(0,X.jsx)(X.Fragment,{children:e})}),gi=({displayFlattened:e=!1,fieldType:t,schema:n,name:r,location:i,parentName:o,typeOptions:s,selectedIndex:c,onSelectTypeOption:l,paramId:u,style:d,explode:f,required:p,schemas:m,omitPadding:h,hideName:g,defaultExpanded:_,isLivePreview:v})=>{let{post:y}=zr(),{conditionalRequirements:b}=n,{pre:x,post:S}=qr(He(n)?n:void 0,y);if(!He(n))return null;let C=s?.[c??0]??`unknown`,w=n.items,T=!!e,E=st(n.items),D=T&&!E?n.description??`The ${t} is of type \`${C}\`.`:n.description,O=H(n.items)&&n.items.type===`object`;return(0,X.jsx)(Ot,{paramId:u,className:`array-param-field`,children:(0,X.jsxs)(`div`,{className:a(!e&&!h&&`py-6`),children:[(0,X.jsx)(kt,{id:u,name:g?void 0:r,location:i,required:p??!1,conditionalRequirements:b,deprecated:n.deprecated,typeLabel:C,fieldType:t,typeOptions:s,selectedTypeOptionIndex:c,onSelectTypeOption:l,parentName:o,pre:x,post:S,style:d,explode:f,isLivePreview:v}),(0,X.jsxs)(`div`,{className:a({"mt-4":!h&&D}),children:[r&&D&&(0,X.jsx)(At,{markdown:D}),(0,X.jsx)(_i,{schema:n,description:D}),H(w)&&(0,X.jsx)(Z,{omitPadding:!0,schema:w,displayFlattened:e,fieldType:t,location:i,name:r,parentName:o,style:d,explode:f,onSelectTypeOption:l,schemas:m,hideExampleDescription:!0,hideDescription:O,hideName:!0,defaultExpanded:_,isLivePreview:v}),(0,X.jsx)(Gr,{schema:n})]})]})})},_i=({schema:e,description:t})=>(0,X.jsx)(X.Fragment,{children:(e.minItems!==void 0||e.maxItems!==void 0)&&(0,X.jsx)(`div`,{className:a(`prose prose-sm prose-gray dark:prose-invert`,t&&`mt-6`),children:(0,X.jsx)(vi,{minItems:e.minItems,maxItems:e.maxItems})})}),vi=({minItems:e,maxItems:t})=>e===t&&e!==void 0?(0,X.jsxs)(X.Fragment,{children:[`Required array length: `,(0,X.jsx)(`code`,{children:e}),` element`,e>1?`s`:``]}):e&&t?(0,X.jsxs)(X.Fragment,{children:[`Required array length: `,(0,X.jsx)(`code`,{children:`${e} - ${t}`}),` element`,t>1?`s`:``]}):e?(0,X.jsxs)(X.Fragment,{children:[`Minimum array length: `,(0,X.jsx)(`code`,{children:e})]}):t?(0,X.jsxs)(X.Fragment,{children:[`Maximum array length: `,(0,X.jsx)(`code`,{children:t})]}):``,yi=({options:e,selectedIndex:t,onSelectOption:n})=>(0,X.jsx)(`div`,{className:`-mt-2`,children:(0,X.jsx)(hi,{defaultTabIndex:t,onTabChange:n,className:`!border-gray-100 dark:!border-white/10 [&_[data-component-part=tabs-list]]:!mb-4`,children:e.map(e=>(0,X.jsx)(hi.Item,{title:e},e))})}),bi=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let{properties:C,additionalProperties:w}=xi(t),{anchor:T,hasScrolledToAnchorRef:E}=kn(),D=!!(l&&T?.includes(l)),O=!p,k=O&&D,A=x||D||p,j=(0,Y.useRef)(null),ee=(0,Y.useCallback)(e=>{let t=e.closest(`.expandable-content`);for(;t;){let e=t.previousElementSibling;e?.getAttribute(`aria-expanded`)===`false`&&e.click(),t=t.parentElement?.closest(`.expandable-content`)??null}},[]);(0,Y.useEffect)(()=>{if(!k)return;let e=()=>{Et({shouldReturnEarly:!!E?.current,isLivePreview:S,checkIfShouldScroll(e){return!!j.current&&j.current.contains(e)},preScrollCallback(e){ee(e)},postScrollCallback(){E&&(E.current=!0)}})};return e(),window.addEventListener(`hashchange`,e),()=>{window.removeEventListener(`hashchange`,e)}},[E,ee,k,S]);let M=st(t),N=(h?void 0:o?.[s??0])??nt(t),P=!!p,F=P&&!M?t.description??`The ${e} is of type \`${N}\`.`:t.description,I=!!h,L=!!F,te=L&&P!==I,ne=L&&!te,{post:re}=zr(),{pre:ie,post:ae}=qr(t,re);return(0,X.jsx)(Ot,{noBorder:y,paramId:l,className:`object-param-field`,ref:j,children:(0,X.jsxs)(`div`,{className:a(!P&&!_&&`py-6`),children:[(0,X.jsx)(kt,{id:l,name:b?void 0:n,location:r,required:f??!1,conditionalRequirements:t.conditionalRequirements,deprecated:t.deprecated,typeLabel:N,fieldType:e,typeOptions:o??[N],selectedTypeOptionIndex:s,onSelectTypeOption:c,parentName:i,pre:ie,post:ae,style:u,explode:d,isLivePreview:S}),(0,X.jsxs)(`div`,{className:a({"mt-4":!_&&(L||M)}),children:[te&&!v&&(0,X.jsx)(At,{markdown:F}),(0,X.jsxs)(`div`,{className:a(I&&`mt-4`,I&&!P&&`rounded-xl border border-gray-100 px-4 pb-4 pt-2 dark:border-white/10`),children:[I&&(0,X.jsx)(yi,{selectedIndex:s,options:h,onSelectOption:c}),ne&&!v&&(0,X.jsx)(`div`,{className:a(I&&P&&`pt-6 pb-4`),children:(0,X.jsx)(At,{markdown:F})}),M&&(0,X.jsx)(`div`,{className:a(I&&!P&&`-mt-4`),children:(0,X.jsx)(Ci,{expandable:O,defaultOpen:A,lazy:g??!A,uniqueParamId:l,anchor:T,hasScrolledToAnchorRef:E,children:(0,X.jsxs)(X.Fragment,{children:[C&&Object.entries(C).map(([t,a])=>{let o=u===`deepObject`&&d?pn(n??void 0,i):Ut(n??void 0,i);return(0,X.jsx)(Z,{schema:a,name:t,required:a.isRequired,fieldType:e,location:r,parentName:o,style:u,explode:d,onSelectTypeOption:c,schemas:m,defaultExpanded:x,isLivePreview:S},t)}),typeof w==`object`&&(H(w)||Ne(w))&&(0,X.jsx)(Z,{schema:w,name:`{key}`,required:w.isRequired,fieldType:e,location:r,parentName:Ut(n??void 0,i),style:u,explode:d,onSelectTypeOption:c,schemas:m,defaultExpanded:x,isLivePreview:S},`{key}`)]})})}),O&&!y&&(0,X.jsx)(Gr,{schema:t})]})]})]})})};function Ci(e){var{expandable:t,children:n}=e,r=bi(e,[`expandable`,`children`]);return t?(0,X.jsx)(fi,Object.assign({},r,{children:n})):(0,X.jsx)(X.Fragment,{children:n})}var wi=({schema:e})=>{let t=G(),n=e.type===`boolean`?Ye(e):e.enum;return!n||n.length===0?null:(0,X.jsxs)(`div`,{className:`whitespace-pre-wrap prose-sm mt-6`,children:[t.availableOptions,`:`,` `,n.map((e,t)=>(0,X.jsxs)(`div`,{className:`inline-block`,children:[(0,X.jsx)(`code`,{children:String(e)}),t!==n.length-1&&`,`,` `]},`${e}-${t}`))]})},Ti=({enumTable:e})=>{let t=G();return(0,X.jsxs)(`div`,{className:`whitespace-pre-wrap prose prose-sm mt-6`,children:[t.availableOptions,`:`,(0,X.jsxs)(`table`,{className:`w-fit max-w-full text-sm not-prose`,children:[(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{className:`text-left`,children:t[`api.title`]}),(0,X.jsx)(`th`,{children:t[`api.const`]})]}),e.map(({title:e,const:t})=>(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`td`,{children:e}),(0,X.jsx)(`td`,{children:(0,X.jsx)(`code`,{children:t})})]},e))]})]})},Ei=({schema:e})=>{let t=e.exclusiveMinimum||e.exclusiveMinimum!==void 0,n=e.exclusiveMaximum||e.exclusiveMaximum!==void 0,r=G(),i=``;return e.maximum!==void 0&&(i=`x ${n?`<`:`<=`} ${e.maximum}`),e.minimum!==void 0&&(i=`x ${t?`>`:`>=`} ${e.minimum}`),e.maximum!==void 0&&e.minimum!==void 0&&(i=`${e.minimum} ${t?`<`:`<=`} x ${n?`<`:`<=`} ${e.maximum}`),i===``&&e.multipleOf===void 0?null:(0,X.jsxs)(`div`,{className:`prose prose-sm prose-gray dark:prose-invert mt-6`,children:[i&&(0,X.jsxs)(X.Fragment,{children:[r.requiredRange,`: `,(0,X.jsx)(`code`,{children:i})]}),e.multipleOf&&(0,X.jsxs)(X.Fragment,{children:[r[`api.mustBeMultipleOf`],` `,(0,X.jsx)(`code`,{children:e.multipleOf})]})]})},Di=({schema:e,description:t})=>(0,X.jsxs)(X.Fragment,{children:[`const`in e&&e.const!==void 0&&(0,X.jsxs)(`div`,{className:a(`prose prose-sm prose-gray dark:prose-invert`,t&&`mt-6`),children:[`Allowed value: `,(0,X.jsx)(`code`,{children:`"${e.const}"`})]}),(e.minLength!==void 0||e.maxLength!==void 0)&&(0,X.jsx)(`div`,{className:a(`prose prose-sm prose-gray dark:prose-invert`,t&&`mt-6`),children:(0,X.jsx)(Oi,{minLength:e.minLength,maxLength:e.maxLength})}),`pattern`in e&&e.pattern!==void 0&&(0,X.jsxs)(`div`,{className:a(`prose prose-sm prose-gray dark:prose-invert`,t&&`mt-6`),children:[`Pattern: `,(0,X.jsx)(`code`,{children:e.pattern})]})]}),Oi=({minLength:e,maxLength:t})=>e===t&&e!==void 0?(0,X.jsxs)(X.Fragment,{children:[`Required string length: `,(0,X.jsx)(`code`,{children:e})]}):e&&t?(0,X.jsxs)(X.Fragment,{children:[`Required string length: `,(0,X.jsx)(`code`,{children:`${e} - ${t}`})]}):e?(0,X.jsxs)(X.Fragment,{children:[`Minimum string length: `,(0,X.jsx)(`code`,{children:e})]}):t?(0,X.jsxs)(X.Fragment,{children:[`Maximum string length: `,(0,X.jsx)(`code`,{children:t})]}):``,ki=({fieldType:e,schema:t,name:n,location:r,typeOptions:i,selectedIndex:o,onSelectTypeOption:s,parentName:c,paramId:l,style:u,explode:d,enumTable:f,omitPadding:p,hideExampleDescription:m,isTopLevel:h,hideName:g,isLivePreview:_})=>{let v=i?.[o??0]??`unknown`,y=h?t.description??`The ${e} is of type \`${v}\`.`:t.description,b=m||at(t),{post:x}=zr(),{pre:S,post:C}=qr(t,x);return(0,X.jsx)(Ot,{noBorder:m,paramId:l,className:`primitive-param-field`,children:(0,X.jsxs)(`div`,{className:a(!p&&`py-6`),children:[(0,X.jsx)(kt,{id:l,name:g?void 0:n,typeLabel:v,location:r,fieldType:e,required:t.isRequired,conditionalRequirements:t.conditionalRequirements,deprecated:t.deprecated,defaultValue:t.default,typeOptions:i,selectedTypeOptionIndex:o,onSelectTypeOption:s,parentName:c,pre:S,post:C,style:u,explode:d,isLivePreview:_}),(0,X.jsxs)(`div`,{className:a({"mt-4":!p&&(y||Te(t))}),children:[y&&(0,X.jsx)(At,{className:a(m&&`py-4`),markdown:y}),f&&(0,X.jsx)(Ti,{enumTable:f}),!f&&Te(t)&&(0,X.jsx)(wi,{schema:t}),!f&&we(t)&&(0,X.jsx)(Di,{schema:t,description:y}),!f&&Pe(t)&&(0,X.jsx)(Ei,{schema:t}),!b&&(0,X.jsx)(Gr,{schema:t})]})]})})},Ai=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{let x=lt(e,a,n,s);if(Ne(e)){let r=e[Ce],d=p?.[r];return d?(0,X.jsx)(Si,{lazy:!0,omitPadding:t,schema:Object.assign(Object.assign({},d),{description:e.description}),typeOptions:i,fieldType:a,name:n,location:o,parentName:s,style:c,explode:l,required:u,schemas:p,paramId:x,hideName:v,defaultExpanded:y,isLivePreview:b}):null}if(e.oneOf&&Array.isArray(e.oneOf)&&e.oneOf.length>0){let i=e.oneOf.filter(e=>H(e));if(i.length===0)return null;let m;if(i.some(e=>Te(e)&&`const`in e)&&(i=Ve(i),m=i.filter(e=>Te(e)&&`const`in e).map(e=>({title:e.title??`Unknown`,const:e.const??``}))),i.length===1&&i[0]?.type===`null`&&i[0])return(0,X.jsx)(ki,{omitPadding:t,fieldType:a,enumTable:m,schema:e,name:n,location:o,parentName:s,selectedIndex:f,onSelectTypeOption:d,style:c,explode:l,required:u,paramId:x,hideExampleDescription:h,isTopLevel:_,hideName:v,isLivePreview:b});let g=i.filter(e=>e.type!==`null`),S=i.some(e=>e.type===`null`),C=Qe(g);if(g.length===1&&g[0]){let i=S&&e.typeLabel?[e.typeLabel]:C;return(0,X.jsx)(Z,{schema:g[0],omitPadding:t,displayFlattened:r,typeOptions:i,fieldType:a,name:n,location:o,parentName:s,style:c,explode:l,required:u,schemas:p,hideName:v,defaultExpanded:y,isLivePreview:b})}if(g.every(e=>e.type===`object`||Ee(e)))return(0,X.jsx)(Mi,{omitPadding:t,schema:e,schemas:g,displayFlattened:r,typeOptions:[`object`],fieldType:a,name:n,location:o,style:c,explode:l,parentName:s,required:u,paramId:x,hideName:v,defaultExpanded:y,isLivePreview:b});{let e=g[f??0];return e?(0,X.jsx)(ji,{omitPadding:t,schemas:g,schema:e,enumTable:m,displayFlattened:r,typeOptions:C,fieldType:a,name:n,location:o,style:c,explode:l,required:u,selectedIndex:f,parentName:s,onSelectTypeOption:d,hideName:v,defaultExpanded:y,isLivePreview:b}):null}}let S=Qe([e]);if(e.type!==`array`&&e.type!==`object`)return(0,X.jsx)(ki,{omitPadding:t,fieldType:a,enumTable:m,schema:e,typeOptions:i??S,name:n,location:o,parentName:s,selectedIndex:f,onSelectTypeOption:d,style:c,explode:l,required:u,paramId:x,hideExampleDescription:h,isTopLevel:_,hideName:v,isLivePreview:b});if(e.type===`object`)return(0,X.jsx)(Si,{omitPadding:t,displayFlattened:r,fieldType:a,schema:e,typeOptions:i??S,name:n,location:o,parentName:s,selectedIndex:f,onSelectTypeOption:d,style:c,explode:l,required:u,schemas:p,paramId:x,hideDescription:g,hideExampleDescription:h,hideName:v,defaultExpanded:y,isLivePreview:b});if(e.type===`array`)return(0,X.jsx)(gi,{omitPadding:t,displayFlattened:r,fieldType:a,schema:e,typeOptions:i??S,name:n,location:o,parentName:s,selectedIndex:f,onSelectTypeOption:d,style:c,explode:l,required:u,schemas:p,paramId:x,hideName:v,defaultExpanded:y,isLivePreview:b})};function ji(e){var{schemas:t}=e,n=Ai(e,[`schemas`]);let[r,i]=(0,Y.useState)(0),a=t[r];return a?(0,X.jsx)(Z,Object.assign({},n,{selectedIndex:r,onSelectTypeOption:i,schema:a})):null}function Mi(e){var{schemas:t,paramId:n}=e,r=Ai(e,[`schemas`,`paramId`]);let[i,a]=(0,Y.useState)(0),o=t[i];if(Ee(o)&&(o=o.items),!o)return null;let s=Qe(t),c=n??lt(o,r.fieldType,r.name,r.parentName);return(0,X.jsx)(Si,Object.assign({},r,{oneOfOptions:s,schema:o,selectedIndex:i,onSelectTypeOption:a,paramId:c}))}var Ni=({apiReferenceData:e,pageMetadata:t,localeStrings:n=Mt,markdownComponents:r,docsConfig:i,isLivePreview:o,className:s,readOnly:c,ReadOnlyWrapper:l,children:u})=>{let d=e.schemaData,f=t.mode===`custom`,p=t.mode===`frame`,m=i?.api?.params?.expanded===`all`,h=i?.api?.params?.post;if(!d)return null;let g=c&&l?l:Y.Fragment;return(0,X.jsx)(wt,{value:c??!1,children:(0,X.jsx)(Tt,{localeStrings:n,children:(0,X.jsx)(Rr,{value:{post:h},children:(0,X.jsx)(Dt,{markdownComponents:r,children:(0,X.jsx)(`div`,{className:a(`flex flex-col gap-8 isolate`,s),id:`api-playground-2-schema-page`,children:(0,X.jsx)(F,{children:(0,X.jsxs)(`div`,{className:a(`mdx-content`,`@container/columns-container relative`,!f&&!p&&`prose prose-gray dark:prose-invert`),children:[(0,X.jsx)(F,{children:u}),(0,X.jsx)(g,{children:(0,X.jsx)(F,{children:(0,X.jsx)(`div`,Object.assign({className:a(c&&`mx-7`)},c&&{"data-block-selection-ignore":`true`},{children:(0,X.jsx)(Z,{schema:d,fieldType:`schema`,displayFlattened:!0,defaultExpanded:m,isLivePreview:o})}))})})]})})})})})})})},Pi=({apiReferenceData:e,defaultExpanded:t,isLivePreview:n,fieldType:r=`body`})=>{let i=G(),{selectedRequestBodyContentTypeIndex:a,setSelectedRequestBodyContentTypeIndex:o}=v(),s=e.dependencies?.requestBody,c=s?.description,l=Object.keys(s?.content??{}),u=Object.fromEntries(l.map(e=>[e,Ae(s?.content[e])]).filter(e=>H(e[1]))),d=e.dependencies?.schemas,f=l[a],p=f===void 0?void 0:u[f],m=f?s?.content[f]:void 0,h=m!==void 0&&`itemSchema`in m&&m.itemSchema!==void 0;return Object.keys(u).length===0?null:(0,X.jsxs)(`div`,{className:`api-section`,children:[l.length>1?(0,X.jsx)(jt,{title:i[`api.body`],options:l,selectedIndex:a,onSelectOption:o,subtitle:c,withPadding:!c}):(0,X.jsx)(jt,{title:i[`api.body`],rightElement:l[0],subtitle:c,withPadding:!c}),h&&p!==void 0&&(0,X.jsx)(`div`,{className:`mb-4`,children:(0,X.jsx)(ri,{className:`max-w-fit text-xs font-medium break-words`,children:i[`api.streamItem`]})}),p!==void 0&&(0,X.jsx)(Z,{schema:p,fieldType:r,displayFlattened:!0,omitPadding:!0,schemas:d,isTopLevel:!0,defaultExpanded:t,isLivePreview:n})]})},Fi=({options:e,selectedIndex:t,onSelectOption:n,className:r})=>{let i=e.length>1,o=e[t];return(0,X.jsx)(`div`,{className:a(`relative flex items-center px-2 py-0.5 text-gray-600 dark:text-gray-300 hover:text-gray-950 dark:hover:text-white font-medium`,r),children:(0,X.jsxs)($r,{children:[(0,X.jsx)(ei,{disabled:!i,className:`font-mono text-xs text-gray-600 dark:text-gray-300 hover:text-gray-950 dark:hover:text-white px-2`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(`span`,{children:o?.label}),i&&(0,X.jsx)(de,{className:`h-2.5 w-2.5 text-gray-500 dark:text-gray-400 shrink-0`})]})}),(0,X.jsx)(ti,{className:`min-w-24`,align:`end`,children:e.map((e,r)=>(0,X.jsx)(ni,{isSelected:r===t,onSelect:()=>n(r),className:`text-xs rounded-xl`,children:e.label},r))})]})})},Ii=({apiReferenceData:e,defaultExpanded:t,isLivePreview:n,fieldType:r=`response`})=>{let i=G(),[o,s]=(0,Y.useState)(0),{selectedResponseContentTypeIndex:c,setSelectedResponseContentTypeIndex:l}=w(),u=(0,Y.useRef)(e.operation),d=(0,Y.useMemo)(()=>e.dependencies?.responses??{},[e.dependencies?.responses]),f=e.dependencies?.schemas,p=(0,Y.useMemo)(()=>{let t=e.operation?.responses;return t?Object.entries(t).map(([e,t])=>[e,d[t]?.content??{}]):[]},[d,e.operation?.responses]);(0,Y.useEffect)(()=>{u.current===e.operation?o>=p.length&&p.length>0&&s(0):(u.current=e.operation,s(0))},[e.operation,p.length,o]);let m=(0,Y.useMemo)(()=>{let e=p[o];return!e||!e[1]?[]:Object.entries(e[1])},[p,o]),h=(0,Y.useCallback)(e=>{s(e);let t=p[e];t&&t[1]&&c>=Object.entries(t[1]).length&&l(0)},[p,c,s,l]),g=(0,Y.useCallback)(e=>{l(e)},[l]),{contentType:_,schema:v,description:y,isStreamItem:b}=(0,Y.useMemo)(()=>{let t=p[o],n=t?String(t[0]):void 0,r=n?e.operation?.responses?.[n]:void 0,i=r?d[r]:void 0,a=i?.description||i?.summary,s=m[c];if(!s)return{contentType:void 0,schema:void 0,description:a,isStreamItem:!1};let[l,u]=s,f=`itemSchema`in u?u.itemSchema:void 0,h=f??u.schema;return l===`_mintlify/placeholder`?{schema:h,contentType:``,description:a,isStreamItem:!1}:{schema:h,contentType:l,description:a,isStreamItem:f!==void 0}},[m,c,p,o,d,e.operation?.responses]),x=v?[v]:[];x.some(e=>H(e)&&e.type===`null`)&&(x=x.filter(e=>!H(e)||e.type!==`null`));let S=Qe(x),C=p.map(([e,t])=>({label:String(e),schema:t})),T=m.filter(([e])=>e!==`_mintlify/placeholder`).map(([e,t])=>({label:String(e),schema:t})),E=p[0]?`${p[0][0]}`:``,D=_?`${_}`:``,O=`${E}${E&&D?` - `:``}${D}`,k=p.length>1,A=m.length>1,j=k||A;return(0,X.jsxs)(`div`,{className:`api-section`,children:[(0,X.jsxs)(jt,{title:i[`api.response`],subtitle:y,rightElement:j?(0,X.jsxs)(`div`,{className:`flex items-center gap-x-3 font-mono text-xs`,children:[(0,X.jsx)(Fi,{onSelectOption:h,options:C,selectedIndex:o,className:a(`bg-transparent dark:bg-transparent`,k&&`hover:text-zinc-950 dark:hover:text-white transition-all`)}),T.length>0&&(0,X.jsx)(Fi,{onSelectOption:g,options:T,selectedIndex:c,className:a(`bg-transparent dark:bg-transparent`,A&&`hover:text-zinc-950 dark:hover:text-white transition-all`)})]}):O,children:[S[0]&&S[0].includes(` | null`)&&(0,X.jsx)(`div`,{children:(0,X.jsx)(ri,{className:`max-w-fit text-xs font-medium font-mono break-words`,children:S[0]})}),b&&(0,X.jsx)(`div`,{children:(0,X.jsx)(ri,{className:`max-w-fit text-xs font-medium break-words`,children:i[`api.streamItem`]})})]}),x.length>1?(0,X.jsx)(hi,{children:x.map((e,i)=>(0,X.jsx)(hi.Item,{title:S[i]??``,children:H(e)&&(0,X.jsx)(Z,{schema:e,fieldType:r,displayFlattened:!0,schemas:f,isTopLevel:!0,defaultExpanded:t,isLivePreview:n})},i))}):x[0]&&H(x[0])?(0,X.jsx)(Z,{schema:x[0],fieldType:r,displayFlattened:!0,omitPadding:!0,schemas:f,isTopLevel:!0,defaultExpanded:t,isLivePreview:n}):null]})},Li=({apiReferenceData:e,defaultExpanded:t,isLivePreview:n})=>{let r=G(),i=e.dependencies?.callbacks;return!i||i.length===0?null:(0,X.jsxs)(`div`,{className:`api-section pb-6`,children:[(0,X.jsx)(jt,{title:r[`api.callbacks`],withPadding:!0}),(0,X.jsx)(`div`,{className:`flex flex-col gap-y-3`,children:i.map((e,r)=>(0,X.jsx)(Ri,{callback:e,index:r,defaultExpanded:t,isLivePreview:n},`${e.callbackName}-${e.expression}-${e.method}-${r}`))})]})};function Ri({callback:e,index:t,defaultExpanded:n,isLivePreview:r}){let i=`callback-${t}-`,[o,s]=(0,Y.useState)(n??!1),c=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let e=()=>{typeof window<`u`&&window.location.hash.substring(1).startsWith(i)&&(c.current&&(c.current.open=!0),s(!0))};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[i]);let l=(0,Y.useMemo)(()=>({operation:Object.assign(Object.assign({},e.resolved.operation),{path:e.expression,baseUrlOptions:[],title:e.callbackName,description:e.resolved.operation.description??``}),dependencies:Object.assign(Object.assign({},e.resolved.dependencies),{schemas:e.resolved.schemas,servers:{},security:{}})}),[e]),u=!!l.dependencies?.requestBody,d=l.dependencies?.responses&&Object.keys(l.dependencies.responses).length>0;return!u&&!d?null:(0,X.jsxs)(`details`,{ref:c,className:`rounded-xl border-standard`,open:o,onToggle:e=>s(e.currentTarget.open),children:[(0,X.jsxs)(`summary`,{className:a(`not-prose flex w-full cursor-pointer items-center gap-x-2 px-3.5 py-3`,`list-none [&::-webkit-details-marker]:hidden`,`text-sm text-stone-600 hover:bg-stone-50/50 hover:text-stone-900`,`dark:text-stone-300 dark:hover:bg-white/5 dark:hover:text-stone-200`,`rounded-t-xl`,!o&&`rounded-b-xl`),children:[(0,X.jsx)(Ft,{icon:`angle-right`,className:a(`size-2.5 bg-stone-400 transition-transform`,o&&`rotate-90`),overrideColor:!0,overrideSize:!0}),(0,X.jsx)(Lt,{method:e.method}),(0,X.jsx)(`span`,{className:`font-mono text-sm`,children:e.expression}),(0,X.jsx)(`span`,{className:`ml-auto text-xs text-stone-400`,children:e.callbackName})]}),(0,X.jsx)(`div`,{className:`mx-3 border-t border-stone-100 px-2 dark:border-white/10`,children:(0,X.jsx)(I,{children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-y-4 pb-4`,children:[u&&(0,X.jsx)(Fn,{location:`request`,children:(0,X.jsx)(Pi,{apiReferenceData:l,defaultExpanded:n,isLivePreview:r,fieldType:`callback-${t}-body`})}),d&&(0,X.jsx)(Fn,{location:`response`,children:(0,X.jsx)(Ii,{apiReferenceData:l,defaultExpanded:n,isLivePreview:r,fieldType:`callback-${t}-response`})})]})})})]})}var zi=({apiReferenceData:e,defaultExpanded:t,isLivePreview:n})=>{let r=G(),i=(0,Y.useMemo)(()=>e.dependencies?.parameters??{},[e.dependencies?.parameters]),a=e.dependencies?.schemas,o=(0,Y.useMemo)(()=>{let e={header:{},path:{},query:{},querystring:{},cookie:{}};return Object.entries(i).forEach(([t,n])=>{let r=n.in;r in e&&e[r]&&(e[r][n.name]=n)}),e},[i]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Bi,{title:r[`api.headers`],parameters:o.header??{},schemas:a,defaultExpanded:t,isLivePreview:n}),(0,X.jsx)(Bi,{title:r[`api.pathParameters`],parameters:o.path??{},schemas:a,defaultExpanded:t,isLivePreview:n}),(0,X.jsx)(Bi,{title:r[`api.queryParameters`],parameters:o.query??{},schemas:a,defaultExpanded:t,isLivePreview:n}),(0,X.jsx)(Bi,{title:r[`api.queryString`],parameters:o.querystring??{},schemas:a,defaultExpanded:t,isLivePreview:n}),(0,X.jsx)(Bi,{title:r[`api.cookies`],parameters:o.cookie??{},schemas:a,defaultExpanded:t,isLivePreview:n})]})},Bi=({parameters:e,title:t,schemas:n,defaultExpanded:r,isLivePreview:i})=>{if(Object.keys(e).length===0)return null;let a=Object.entries(e).map(([e,t])=>!t.schema||!H(t.schema)?null:(0,X.jsx)(Z,{schema:t.schema,fieldType:`parameter`,name:t.name,style:t.style,explode:t.explode,required:t.required,schemas:n,defaultExpanded:r,isLivePreview:i},t.name));return(0,X.jsxs)(`div`,{className:`api-section`,children:[(0,X.jsx)(jt,{title:t}),a]})},Vi=({apiReferenceData:e,isLivePreview:t})=>{let n=G(),r=tr(e.dependencies?.processedSecurityOptions);if(r.length===0)return null;let i=new Set(r.map(e=>e.schemeName)).size>1;return(0,X.jsxs)(`div`,{className:`api-section`,"data-component-part":`security-scopes`,children:[(0,X.jsx)(jt,{title:n[`api.scopes`]}),r.flatMap(({schemeName:e,scopes:n})=>n.map(n=>{let r=nr(e,n.name);return(0,X.jsx)(Ot,{paramId:r,className:`primitive-param-field`,children:(0,X.jsxs)(`div`,{className:`py-6`,children:[(0,X.jsx)(kt,{id:r,name:n.name,typeLabel:i?e:void 0,fieldType:`authorization`,isLivePreview:t}),n.description&&(0,X.jsx)(`div`,{className:`mt-4`,children:(0,X.jsx)(At,{markdown:n.description})})]})},r)}))]})},Hi=({apiReferenceData:e})=>{let t=G(),{selectedSecurityOptionIndex:n,setSelectedSecurityOptionIndex:r}=S(),i=e.dependencies?.processedSecurityOptions;if(!i)return null;let a=i[n];if(!a)return null;let o=[];if(a.schemes.forEach(({scheme:e,schema:t,name:n})=>{if(e.type===`apiKey`&&`name`in e&&`in`in e)o.push((0,X.jsx)(ki,{fieldType:`authorization`,schema:t,typeOptions:[`string`],name:n,location:e.in},`${e.in}:${e.name}`));else if(e.type===`http`&&`scheme`in e){if(e.scheme===`basic`){let e=Object.assign(Object.assign({},t),{type:`string`});o.push((0,X.jsx)(ki,{fieldType:`authorization`,schema:e,typeOptions:[`string`],name:n,location:`header`},`header:${t.title}`))}else e.scheme===`bearer`&&o.push((0,X.jsx)(ki,{fieldType:`authorization`,schema:t,typeOptions:[`string`],name:n,location:`header`},`header:${t.title}`))}else e.type===`oauth2`&&o.push((0,X.jsx)(ki,{fieldType:`authorization`,schema:t,typeOptions:[`string`],name:n,location:`header`},`header:${t.title}`))}),o.length===0)return null;let s=i.map(e=>e.deprecated?`${e.title} (${t[`api.deprecated`]})`:e.title);return(0,X.jsxs)(`div`,{className:`api-section`,children:[(0,X.jsx)(jt,{title:t[`api.authorizations`],options:s,selectedIndex:n,onSelectOption:r}),o]})},Ui=({apiReferenceData:e,defaultExpanded:t,isLivePreview:n})=>{let{dependencies:r}=e,i=r?.processedSecurityOptions&&r.processedSecurityOptions.length>0,a=r?.parameters&&Object.keys(r.parameters).length>0,o=r?.requestBody,s=r?.responses&&Object.keys(r.responses).length>0,c=r?.callbacks&&r.callbacks.length>0;return(0,X.jsxs)(X.Fragment,{children:[i&&(0,X.jsx)(Hi,{apiReferenceData:e}),i&&(0,X.jsx)(Vi,{apiReferenceData:e,isLivePreview:n}),a&&(0,X.jsx)(zi,{apiReferenceData:e,defaultExpanded:t,isLivePreview:n}),o&&(0,X.jsx)(Fn,{location:`request`,children:(0,X.jsx)(Pi,{apiReferenceData:e,defaultExpanded:t,isLivePreview:n})}),c&&(0,X.jsx)(Li,{apiReferenceData:e,defaultExpanded:t,isLivePreview:n}),s&&(0,X.jsx)(Fn,{location:`response`,children:(0,X.jsx)(Ii,{apiReferenceData:e,defaultExpanded:t,isLivePreview:n})})]})},Wi=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},Gi=({baseUrlOptions:e,baseUrlNames:t,selectedBaseUrlIndex:n,setSelectedBaseUrlIndex:r,display:i,path:o,method:s,type:c,onBaseUrlChange:l,urlDisplay:u,isInPlaygroundModal:d,parameters:f})=>{let[p,m]=(0,Y.useState)(!1),h=G(),g=Er({path:o,baseUrl:e[n]??``,parameters:f}),_=()=>Wi(void 0,void 0,void 0,function*(){let e=c===`webhook`&&!o.startsWith(`/`)?o:g;(yield Ct(e))===`success`&&(m(!0),setTimeout(()=>{m(!1)},2e3))});return(0,X.jsxs)(`div`,{className:a(`group relative flex-1 flex gap-2 min-w-0 rounded-xl items-center cursor-pointer p-1.5 pr-0 overflow-hidden`,i!=`simple`&&`border-standard`,d&&`bg-gray-50 dark:bg-white/5`),onClick:_,children:[(0,X.jsx)(Lt,{method:c===`webhook`?`webhook`:s,active:!1}),(0,X.jsxs)(j,{className:`flex-1`,children:[(0,X.jsx)(k,{className:`overflow-y-hidden! [--scroll-area-fade-size:16px]`,fade:[`left`],children:(0,X.jsxs)(N,{className:`flex items-center space-x-2 pr-8`,children:[(0,X.jsx)(fe,{baseUrlOptions:e,baseUrlNames:t,selectedBaseUrlIndex:n,setSelectedBaseUrlIndex:r,onBaseUrlChange:l,urlDisplay:u,selectBaseUrlAriaLabel:h[`aria.selectBaseUrl`]}),(0,X.jsx)(he,{path:o,method:s})]})}),(0,X.jsx)(x,{orientation:`horizontal`,className:`-mb-[5px]`,onClick:e=>e.stopPropagation()})]}),(0,X.jsx)(ve,{isCopiedActive:p,hasGrayBackground:d,onCopy:_,copyAriaLabel:h[`tooltip.copy`],copiedStatusText:h.copied})]})},Ki=({apiReferenceData:e})=>{let{selectedBaseUrlIndex:t}=T(),{selectedExampleIndex:n}=ne(),{selectedRequestBodyContentTypeIndex:r}=v();return Dr({apiReferenceData:e,selectedBaseUrlIndex:t,selectedExampleIndex:n,selectedRequestBodyContentTypeIndex:r,locallyStoredCredentials:void 0,serverInputs:void 0}),null},qi=({apiReferenceData:e,pageMetadata:t,docsConfig:n,isLivePreview:r,docsConfigOverrides:i,userGroups:o,localeStrings:s=Mt,markdownComponents:c,mdxRequestExampleData:l,mdxResponseExampleData:u,isChatSheetOpen:d,codeComponents:f,Playground:p,className:m,readOnly:h,ReadOnlyWrapper:g,children:_})=>{let v=e?.operation,b=t?.mode===`custom`,x=t?.mode===`frame`,S=(i?.api?.params?.expanded??n?.api?.params?.expanded)===`all`,C=i?.api?.params?.post??n?.api?.params?.post,w=It({pageMetadata:t,docsConfig:n,isLivePreview:r,docsConfigOverrides:i,apiReferenceData:e,userGroups:o}),[E,D]=(0,Y.useState)(!1),O=w===`none`,k=w===`simple`,A=!O&&!k&&!!p,{selectedBaseUrlIndex:j,setSelectedBaseUrlIndex:ee,baseUrl:M}=T();(0,Y.useEffect)(()=>{typeof window<`u`&&new URLSearchParams(window.location.search).has(`playground`)&&requestAnimationFrame(()=>{D(!0)})},[]);let N=e=>{if(D(e),typeof window<`u`){if(e){let e=new URL(window.location.href);e.searchParams.set(`playground`,`open`),window.history.replaceState({},``,e)}else{let e=new URL(window.location.href);e.searchParams.delete(`playground`),window.history.replaceState({},``,e)}}};if(!v)return null;let{path:P,method:I,baseUrlOptions:L,baseUrlNames:te,type:ne,urlDisplay:re}=v,ie=t?.openapi&&v,ae=h&&g?g:Y.Fragment;return(0,X.jsx)(wt,{value:h??!1,children:(0,X.jsx)(Tt,{localeStrings:s,children:(0,X.jsx)(Rr,{value:{post:C},children:(0,X.jsx)(Dt,{markdownComponents:c,children:(0,X.jsxs)(Ir.Provider,{value:{isPlaygroundExpanded:E,setIsPlaygroundExpanded:N},children:[(0,X.jsxs)(`div`,{className:a(`flex flex-col gap-8 isolate`,m),id:`api-playground-2-operation-page`,children:[(0,X.jsx)(F,{children:(0,X.jsxs)(`div`,{className:a(!O&&`mt-6`,`flex w-full flex-col space-y-4`),children:[O?null:(0,X.jsx)(ae,{children:(0,X.jsx)(F,{children:(0,X.jsx)(`div`,{className:a(`flex flex-col bg-background-light dark:bg-background-dark border-standard rounded-2xl p-1.5`,w===`simple`?`p-1`:`p-1.5`,h?`mx-7`:`w-full`,h&&`pointer-events-none`),children:(0,X.jsxs)(`div`,{className:`flex items-center space-x-1.5`,children:[(0,X.jsx)(Gi,{baseUrlOptions:L,baseUrlNames:te,selectedBaseUrlIndex:j,setSelectedBaseUrlIndex:ee,display:w,path:P,method:I,type:ne,onBaseUrlChange:()=>{},isInPlaygroundModal:!1,urlDisplay:re,parameters:e?.dependencies?.parameters}),k?null:(0,X.jsx)(ue,{label:s.tryIt,sendingRequestAriaLabel:s[`aria.sendingRequest`],method:I,onClick:()=>{p&&!h&&N(!0)}})]})})})}),!h&&(0,X.jsx)(F,{children:(0,X.jsx)(`div`,{className:`mt-8 lg:mt-0 flex flex-col gap-6 max-h-[30rem] print:max-h-none [html:not([data-assistant-state=open])_&]:xl:hidden`,children:(0,X.jsx)(y,{codeComponents:f,openApiReferenceData:e,apiPlaygroundDisplay:w,mdxRequestExampleData:l,mdxResponseExampleData:u,isChatSheetOpen:d})})})]})}),(0,X.jsx)(F,{children:(0,X.jsxs)(`div`,{className:a(`mdx-content`,`@container/columns-container relative`,!b&&!x&&`prose prose-gray dark:prose-invert`),children:[_,ie&&(0,X.jsx)(ae,{children:(0,X.jsx)(`div`,Object.assign({className:a(`mb-14`,!b&&!x&&`prose prose-gray dark:prose-invert`,h&&`mx-7`)},h&&{"data-block-selection-ignore":`true`},{children:(0,X.jsx)(Ui,{apiReferenceData:e,defaultExpanded:S,isLivePreview:r})}))})]})})]}),A?(0,X.jsx)(F,{children:(0,X.jsx)(p,{isPlaygroundExpanded:E,setIsPlaygroundExpanded:N,baseUrl:M,baseUrlOptions:L,apiReferenceData:e})}):!h&&e&&(0,X.jsx)(Ki,{apiReferenceData:e})]})})})})})},Ji=({scheme:e,className:t})=>{let n=G(),r=ir(e);return r.length===0?null:(0,X.jsxs)(`div`,{className:a(`flex flex-wrap items-center gap-x-1.5 gap-y-1 text-xs`,t),"data-component-part":`security-scopes-hint`,children:[(0,X.jsxs)(`span`,{className:`text-gray-500 dark:text-gray-400`,children:[n[`api.scopes`],`:`]}),r.map(e=>(0,X.jsx)(`code`,{title:e.description,className:`rounded-md bg-gray-100/50 px-1.5 py-0.5 font-mono text-gray-700 dark:bg-white/5 dark:text-gray-200`,children:e.name},e.name))]})},Yi={store:Gt,load:hn},Xi=({name:e,schema:t,clearValue:n,parentNames:r,style:i,explode:a,inputKeyPrefix:o,arrayIndices:s,isArrayChild:c,isBody:l,onChangeCallback:u,defaultExpanded:d,depth:f})=>{let p=`oneOf`in t&&t.oneOf?t.oneOf.filter(H):[],m=Qe(p),h=p.map((e,t)=>({label:m[t]??nt(e),schema:e})),g=W(e=>e.setInput),_=W(e=>e.deleteInput),v=U(o,t,s),y=`${v}.oneOf.`,b=W(St(e=>{let t={};return Object.keys(e.inputs).forEach(n=>{n.startsWith(y)&&(t[n]=e.inputs[n])}),t})),x=(0,Y.useMemo)(()=>{let e=Object.keys(b).find(e=>e.startsWith(y));if(e){let t=e.slice(y.length).match(/^(\d+)(?:\.|$)/);if(t&&t[1]){let e=parseInt(t[1],10);if(e>=0&&e{C(x)},[x]);let w=p[S],T=W(e=>e.setInputs),E=e=>{_(v);let t=p[e];if(t&&`type`in t&&t.type===`null`)g(v,null);else if(g(v,void 0),l&&t){let e=Ue(t);Object.keys(e).length>0&&T(e)}C(e)};if(!w)return null;let D=p.every(e=>e.type===`object`||Ee(e));if(!c&&D&&l){let t=Qe(p);return(0,X.jsx)(mn,{defaultTabIndex:S,onClickTab:E,className:`border-gray-100! mb-4! dark:border-white/10!`,children:t.map(t=>(0,X.jsx)(Wt,{title:t,children:(0,X.jsx)($,{skipContainer:!0,arrayIndices:s,name:e,schema:w,clearValue:n,parentNames:r,style:i,explode:a,inputKeyPrefix:o,onChangeCallback:u,defaultExpanded:d,depth:f})},t))})}return(0,X.jsx)($,{name:e,schema:w,typeDropdown:(0,X.jsx)(Fi,{options:h,selectedIndex:S,onSelectOption:E}),clearValue:n,parentNames:r,style:i,explode:a,inputKeyPrefix:o,arrayIndices:s,isArrayChild:c,onChangeCallback:u,defaultExpanded:d,depth:f})},Zi=({schema:e,...t})=>{let n=(0,Y.useMemo)(()=>{let t=rt(),n=e.uniqueKey??``,{type:r,typeLabel:i,oneOf:a,uniqueKey:o,...s}=e;return{...e,oneOf:(t.oneOf??[]).filter(H).map((e,t)=>({...s,...e,uniqueKey:n?`${n}.oneOf.${t}`:`oneOf.${t}`}))}},[e]);return(0,X.jsx)(Xi,{...t,schema:n})},Qi=e=>{let t=it(e);if(t!==`object`&&t!==`array`){let t=qe(e);if(t!==void 0)return t}switch(t){case`object`:return{};case`array`:return[];case`string`:case`enum`:return``;case`number`:case`integer`:case`enum`:case`enum`:return 0;case`boolean`:return!1;case`enum`:return Ye(e)[0]??!1;case`null`:return null;case`oneOf`:if(e.oneOf&&Array.isArray(e.oneOf)&&e.oneOf.length>0){let t=e.oneOf[0];if(H(t)&&t.type!==`null`)return Qi(t);if(e.oneOf.length>1&&H(e.oneOf[1]))return Qi(e.oneOf[1])}return;case`file`:return;default:return}},$i=(e,t,n)=>{let r={};if(!e.properties)return r;for(let i of Object.values(e.properties))if(H(i)){if(i.type===`object`)Object.assign(r,$i(i,t,n));else{let e=qe(i);if(e!==void 0){let a=U(t,i,n);r[a]=e}}}return r},ea=({schema:e,depth:t,parentNames:n,inputKeyPrefix:r,arrayIndices:i,onChangeCallback:o,defaultExpanded:s})=>{let c=q(),l=W(e=>e.setInputs),u=W(e=>e.deleteInput),d=W(St(e=>e.inputs)),f=xt(),p=`items`in e&&H(e.items)?e.items:void 0;if(!p)return null;let m=`${r}.${`uniqueKey`in p?p.uniqueKey:``}`;i?.forEach(e=>{m=m.replace(`[INDEX]`,String(e))}),m=m.replaceAll(`[INDEX]`,``);let h=[];Object.keys(d).forEach(e=>{if(e.startsWith(m)){let t=e.substring(m.length).match(/^(\d+)/);if(t){let e=parseInt(t[1]??`0`,10);h.includes(e)||h.push(e)}}}),h.sort((e,t)=>e-t);let g=h.length>0?Math.max(...h)+1:0;return(0,X.jsxs)(X.Fragment,{children:[h.map(e=>{let a=[...i??[],e],c=U(r,p,a);return(0,X.jsx)($,{schema:p,arrayIndices:a,depth:(t??0)+1,parentNames:n,inputKeyPrefix:r,clearValue:()=>{u(c)},isArrayChild:!0,onChangeCallback:o,defaultExpanded:s},`item-${e}`)}),(0,X.jsx)(ye,{label:c[`api.addItem`],className:a(h.length>0&&`mt-4`),onClick:()=>{let e=[...i??[],g],t=U(r,p,e),n=Qi(p),a=$i(p,r,e);l({[t]:n,...a})},dataTestId:m+`add-item-button`},`add-item-button`+f)]})},ta=({name:e,schema:t,inputKeyPrefix:n,arrayIndices:r})=>{let i=q(),o=(0,Y.useRef)(null),[s,c]=(0,Y.useState)(!1),l=Ke(t)??`Drop a file here or click to upload`,u=U(n,t,r),{value:d,setInput:f}=_t(u),p=typeof window<`u`&&d instanceof File?d:void 0,m=p?.name??l;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`button`,{"aria-label":i[`aria.fileUploadButton`],className:a(`text-left flex text-playground-input overflow-hidden`,p||s?`text-gray-900! dark:text-gray-100!`:`text-gray-400! dark:text-white/30!`),onClick:()=>o.current?.click(),onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=`copy`,c(!0)},onDragLeave:()=>c(!1),onDrop:e=>{e.preventDefault(),c(!1);let t=e.dataTransfer.files[0];t&&(f(u,t),o.current&&(o.current.value=``))},children:m}),(0,X.jsx)(`input`,{type:`file`,"data-testid":`${e??`file`}-input`,onChange:e=>{f(u,e.target.files?.[0])},ref:o,className:`hidden`})]})},Q=({name:e,schema:t,defaultExpanded:n=!0,typeDropdown:r,arrayIndices:i,parentNames:o,clearValue:s,style:c,explode:l,children:u,isArrayChild:d,depth:f})=>{let p=t.type===`array`,m=t.type===`object`,[h,g]=(0,Y.useState)(m&&f!==0?n:!0),_=R({hidden:!h,onReveal:()=>g(!0)}),v=Te(t)&&t.description&&pe(t.description),y=m?Object.keys(t.properties??{}).length:0,b=i&&i.length>0?i[i.length-1]:void 0,x=b!=null&&d;return b!=null&&d&&!m&&!p?(0,X.jsxs)(`div`,{className:`flex space-x-3 items-center`,children:[(0,X.jsx)(_e,{children:b+1}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0 flex items-center gap-2 py-1 my-2`,"data-testid":e?`api-input-${e}`:`api-input-array-item-${b}`,children:[r,(0,X.jsx)(`div`,{className:`flex-1 min-w-0`,children:u})]}),s&&(0,X.jsx)(na,{onClick:()=>s()})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:a(`flex space-x-3 items-start`,x&&!m&&`flex items-center`),children:[x&&(0,X.jsx)(_e,{className:a(m&&`mt-8`),children:b+1}),(0,X.jsxs)(`div`,{className:a(`flex-1 grid lg:grid-cols-2 gap-x-12 gap-y-4 py-5 max-w-full`,p&&`flex flex-col`,m&&`gap-y-0 flex flex-col border border-gray-50 dark:border-white/5 rounded-xl px-4 py-0 my-5`,x&&`py-1 my-2`),"data-testid":e?`api-input-${e}`:void 0,children:[(0,X.jsxs)(`div`,{className:a(`space-y-2`,m&&`pt-8 py-5 border-b border-gray-50 dark:border-white/5`,!h&&`border-none`,x&&!m&&`flex items-center`),children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between font-mono font-bold`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs truncate`,title:o&&o.length>0?`${o.join(`.`)}.${e}`:e,children:[(0,X.jsx)(`div`,{className:a(`text-sm truncate`,e==null&&`hidden`),children:o&&o.length>0&&c===`deepObject`&&l?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`text-gray-500 dark:text-gray-400`,children:o.map((e,t)=>(0,X.jsxs)(X.Fragment,{children:[e,t===0?`[`:`][`]}))}),(0,X.jsx)(`span`,{className:`font-semibold text-gray-900 dark:text-gray-100`,children:e}),(0,X.jsx)(`span`,{className:`text-gray-500 dark:text-gray-400`,children:`]`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`text-gray-500 dark:text-gray-400`,children:o?`${o.join(`.`)}.`:``}),(0,X.jsx)(`span`,{className:`font-semibold text-gray-900 dark:text-gray-100`,children:e})]})}),r??(0,X.jsx)(Mn,{className:`text-wrap`,children:t.typeLabel}),t.isRequired&&(0,X.jsx)(Rt,{}),t.deprecated&&(0,X.jsx)(cn,{})]}),m&&(0,X.jsx)(Se,{onClick:()=>g(!h),count:y,expanded:h})]}),t.description&&!v&&(0,X.jsx)(le,{markdown:t.description,className:`text-gray-500 dark:text-gray-400`})]}),(0,X.jsx)(`div`,{ref:_,className:a(`grid grid-cols-1 w-full items-start divide-y divide-gray-50 dark:divide-white/5`,p&&`divide-y-0`),children:u})]}),(i!=null&&i.length>0||o)&&s&&(0,X.jsx)(na,{className:a(m&&`mt-8`,o&&`mt-7`),onClick:()=>s()})]}),t.description&&v&&(0,X.jsx)(le,{markdown:t.description,className:`text-gray-500 dark:text-gray-400`})]})},na=({className:e,onClick:t})=>{let n=q();return(0,X.jsx)(`button`,{className:a(`px-1 text-gray-400 dark:text-gray-600 hover:text-gray-600 dark:hover:text-gray-400`,e),onClick:t,"aria-label":n[`aria.deleteItem`],children:(0,X.jsx)(gn,{strokeWidth:2,className:`size-4`})})},ra=()=>(0,X.jsx)(`input`,{className:`flex-1 min-w-0 outline-0 bg-transparent text-playground-input`,type:`text`,placeholder:`--`,contentEditable:`false`,disabled:!0}),ia=({name:e,schema:t,inputKeyPrefix:n,numberType:r,arrayIndices:i,onChangeCallback:a})=>{let o=q(),s=Ke(t),c=U(n,t,i),{value:l,setInput:u}=_t(c),d=s??o[`api.enterValue`].replace(`{name}`,e??o[`api.value`]),f=t.type,p=((e,t)=>e===`integer`?un(t)?t:void 0:en(t)?t:void 0)(r,l);return(0,X.jsx)(`input`,{id:Gn.APIPlaygroundInput,className:`flex-1 min-w-0 bg-transparent outline-0 text-playground-input`,placeholder:d,"aria-label":s??o[`aria.enterValue`].replace(`{name}`,e??o[`api.value`]),onKeyDown:e=>{(e.key===`e`||e.key===`.`&&f===`integer`)&&e.preventDefault()},type:`number`,value:p??``,onChange:e=>{if(e.target.value.length===0)u(c,void 0),a?.();else{if(f===`integer`){let t=parseInt(e.target.value);if(isNaN(t))return;u(c,t)}else u(c,parseFloat(e.target.value));a?.()}}})},aa=({count:e,hidden:t,onReveal:n,id:r,children:i,className:o})=>{let s=R({hidden:t&&e>0,onReveal:n});return e===0?null:(0,X.jsx)(`div`,{ref:s,id:r,"data-testid":`optional-fields-group`,className:a(`divide-y divide-gray-100 dark:divide-white/10`,o),children:i})},oa=new Set([`header`,`cookie`,`path`,`query`,`querystring`,`body`]),sa=new Set,ca=(0,Y.createContext)({collapsible:!0,expandedSections:sa,setSectionsExpanded:()=>{}}),la=({resetKey:e,mode:t=`collapsed`,children:n})=>{let r=t!==`static`,i=t===`collapsed`?sa:oa,[a,o]=(0,Y.useState)(i),[s,c]=(0,Y.useState)({resetKey:e,mode:t});(s.resetKey!==e||s.mode!==t)&&(c({resetKey:e,mode:t}),o(i));let l=r?a:oa,u=(0,Y.useCallback)((e,t)=>{o(n=>{let r=new Set(n);return e.forEach(e=>{t?r.add(e):r.delete(e)}),r})},[o]),d=(0,Y.useMemo)(()=>({collapsible:r,expandedSections:l,setSectionsExpanded:u}),[r,l,u]);return(0,X.jsx)(ca.Provider,{value:d,children:n})},ua=()=>(0,Y.useContext)(ca),da=new Map([[B.header,`header`],[B.cookie,`cookie`],[B.path,`path`],[B.query,`query`],[B.querystring,`querystring`],[B.body,`body`]]),fa=e=>{let t=e.split(`.`)[0];return t===void 0?void 0:da.get(t)},pa=({apiReferenceData:e,selectedContentTypeIndex:t})=>{let n=[],{parameters:r,requestBody:i}=e.dependencies??{};if(r&&Object.keys(r).length>0){let{header:t,path:r,query:i,querystring:a,cookie:o}=We(e);[[`header`,t],[`cookie`,o],[`path`,r],[`query`,i],[`querystring`,a]].forEach(([e,t])=>{let{optional:r}=er(t);r.some(e=>H(e.schema))&&n.push(e)})}let a=i?.content??{},o=Object.keys(a)[t],s=o===void 0?void 0:Ae(a[o]);return H(s)&&ha(s)>0&&n.push(`body`),n},ma=e=>e.isRequired!==!0,ha=e=>Array.isArray(e.oneOf)?Math.max(0,...e.oneOf.filter(H).map(ha)):e.type!==`object`||!e.properties?0:Object.values(e.properties).filter(e=>H(e)&&ma(e)).length,ga=[],_a=({schema:e,inputKeyPrefix:t,arrayIndices:n,name:r})=>{let i=q(),a=U(t,e,n),{value:o,setInput:s}=_t(a),c=(0,Y.useCallback)(e=>{if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return``}},[]),l=(0,Y.useMemo)(()=>c(o),[c,o]),[u,d]=(0,Y.useState)(l),f=(0,Y.useRef)(!1);(0,Y.useEffect)(()=>{f.current||d(l)},[l]);let p=(0,Y.useCallback)(e=>{let t=e.target.value;if(d(t),!t.trim())s(a,void 0);else try{let e=JSON.parse(t);typeof e==`object`&&e&&s(a,e)}catch{}},[a,s]),m=(0,Y.useCallback)(()=>{f.current=!0},[]),h=(0,Y.useCallback)(()=>{f.current=!1,d(c(o))},[c,o]),g=Math.max(2,Math.min(15,u.split(` `).length));return(0,X.jsx)(`textarea`,{className:`-mx-3.5 px-3.5 flex-1 min-h-[2.5rem] min-w-0 bg-transparent outline-0 text-playground-input resize-y font-mono text-xs`,rows:g,placeholder:i[`api.enterValueCapitalized`].replace(`{name}`,r??i[`api.value`]),"aria-label":i[`aria.enterValue`].replace(`{name}`,r??i[`api.value`]),value:u,onChange:p,onFocus:m,onBlur:h,spellCheck:!1,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`})},va=({schema:e,depth:t,parentNames:n,style:r,explode:i,inputKeyPrefix:a,name:o,arrayIndices:s,onChangeCallback:c,defaultExpanded:l})=>{let u=W(e=>e.deleteInput),[d,f]=(0,Y.useState)([]),{expandedSections:p,setSectionsExpanded:m}=ua(),h=H(e.additionalProperties),g=W(St(t=>{if(!h)return ga;let n=`${U(a,e,s)}.`,r=new Set(Object.keys(e.properties??{})),i=[];return Object.keys(t.inputs).forEach(e=>{if(!e.startsWith(n))return;let t=e.slice(n.length).match(/^((?:\\.|[^.\\])+)/)?.[1];if(!t)return;let a=Ze(t).replaceAll(`\\.`,`.`);r.has(a)||i.includes(a)||i.push(a)}),i})),_=(0,Y.useMemo)(()=>[...d,...g.filter(e=>!d.includes(e))],[d,g]);if(!(Object.keys(e.properties??{}).length>0)&&!h)return(0,X.jsx)(_a,{schema:e,inputKeyPrefix:a,arrayIndices:s,name:o});let v=[],y=[];Object.entries(e.properties??{}).forEach(([e,u])=>{if(H(u)){let d=o?[...n??[],o]:void 0,f=(0,X.jsx)($,{name:e,schema:u,depth:(t??0)+1,parentNames:d,style:r,explode:i,arrayIndices:s,inputKeyPrefix:a,onChangeCallback:c,defaultExpanded:l},e);ya(u)?v.push(f):y.push(f)}});let b=e.additionalProperties!==!1,x=xt(),S=[];_.forEach(d=>{let p=o?[...n??[],o]:n;if(H(e.additionalProperties)){let n=e.uniqueKey??``,o=n?`${n}.${V(d)}`:V(d),m=e.additionalProperties,h=`uniqueKey`in m&&typeof m.uniqueKey==`string`?m.uniqueKey:``,g=ct(m,h,o),_=U(a,g,s);S.push((0,X.jsx)($,{name:d,schema:g,depth:(t??0)+1,parentNames:p,style:r,explode:i,arrayIndices:s,inputKeyPrefix:a,clearValue:()=>{u(_),f(e=>e.filter(e=>e!==d))},onChangeCallback:c,defaultExpanded:l},d))}else{let n=e.uniqueKey??``,o=rt(),m=`${n}.${V(d)}.oneOf`,h={oneOf:o.oneOf?.map((e,t)=>({...e,uniqueKey:`${m}.${t}`})),uniqueKey:m};H(h)&&S.push((0,X.jsx)($,{name:d,schema:h,depth:(t??0)+1,parentNames:p,style:r,explode:i,arrayIndices:s,inputKeyPrefix:a,clearValue:()=>{let e=U(a,h,s);u(e),f(e=>e.filter(e=>e!==d))},onChangeCallback:c,defaultExpanded:l},d))}});let C=t===0?fa(a):void 0,w=C!==void 0&&!p.has(C),T=(0,X.jsx)(aa,{count:y.length,hidden:w,onReveal:()=>{C!==void 0&&m([C],!0)},children:y});if(t===0)return(0,X.jsxs)(X.Fragment,{children:[v,T,S]});let E=e=>{let t=[...d,e];f(t)},D=[...Object.keys(e.properties??{}),..._];return(0,X.jsxs)(X.Fragment,{children:[v,T,S,b?(0,X.jsx)(ge,{existingKeys:D,onAddKey:E,dataTestId:e.uniqueKey+`.additional-property-button`},`add-property-button`+x):null]})},ya=e=>e.isRequired===!0,ba=({name:e,schema:t,inputKeyPrefix:n,enumType:r,arrayIndices:i,parentNames:o,clearValue:s,onChangeCallback:c})=>{let l=q(),u=Ke(t),d=t.enum?.filter(e=>typeof e==`number`||typeof e==`string`)??[],f=t.type===`boolean`?Ye(t):d,p=U(n,t,i),{value:m,setInput:h}=_t(p),g=W(e=>e.deleteInput),_=((e,t)=>{switch(e){case`integer`:return un(t)?t:void 0;case`number`:return en(t)?t:void 0;case`string`:return fn(t)?t:void 0;case`boolean`:return an(t)?t:void 0;default:return}})(r,m),v=e=>{r===`boolean`?h(p,e.target.value===`true`):r===`integer`?h(p,parseInt(e.target.value,10)):r===`number`?h(p,parseFloat(e.target.value)):h(p,e.target.value),c?.()},y=()=>{g(p)},b=s!==void 0&&((i?.length??0)>0||o);return(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsxs)(`div`,{className:`relative flex-1`,children:[(0,X.jsxs)(`select`,{className:a(`relative text-playground-input w-full text-left flex-1 outline-0 cursor-pointer bg-transparent pr-6`,_===void 0?`text-gray-400! dark:text-white/30!`:`text-gray-900! dark:text-gray-100!`),value:_?.toString()??``,"aria-label":u??l[`aria.selectOption`].replace(`{name}`,e||l[`api.option`]),onChange:v,children:[(0,X.jsx)(`option`,{value:``,disabled:!0,children:u??l[`api.selectOption`].replace(`{name}`,e||l[`api.option`])}),f.map(e=>(0,X.jsx)(`option`,{value:e.toString(),children:e.toString()},e.toString()))]}),(0,X.jsx)(Bt,{strokeWidth:2,className:`absolute right-2 top-1/2 -translate-y-1/2 size-4 text-gray-400 dark:text-white/30 pointer-events-none`})]}),_!==void 0&&!b&&(0,X.jsx)(`button`,{type:`button`,className:`p-0.5 text-gray-400 dark:text-gray-600 hover:text-gray-600 dark:hover:text-gray-400`,onClick:y,"aria-label":l[`aria.deleteItem`],children:(0,X.jsx)(gn,{strokeWidth:2,className:`size-4`})})]})},xa=({name:e,schema:t,inputKeyPrefix:n,arrayIndices:r,onChangeCallback:i})=>{let a=q(),o=Ke(t),{prefix:s,placeholder:c}=Sa(t.format,a[`api.enterBearerToken`]),l=U(n,t,r),{value:u,setInput:d}=_t(l),f=fn(u)?u:void 0,p=s&&f?.startsWith(s)?f.substring(s.length):f,m=e=>{let t=`${s??``}${e}`;t?d(l,t):d(l,void 0)};return(0,X.jsxs)(`div`,{className:`relative flex flex-1 items-center`,children:[(0,X.jsx)(`div`,{className:`absolute left-2.5 top-0 bottom-0 flex items-center justify-center text-sm text-gray-800 dark:text-gray-100`,children:s}),(0,X.jsx)(`input`,{id:Gn.APIPlaygroundInput,className:`flex-1 min-w-0 bg-transparent outline-0 text-playground-input`,style:{paddingLeft:s?s.length*.52+`rem`:void 0},placeholder:o??c??a[`api.enterValue`].replace(`{name}`,e??a[`api.value`]),"aria-label":o??c??a[`aria.enterValue`].replace(`{name}`,e??a[`api.value`]),type:`text`,value:p??``,onChange:e=>{m(e.target.value),i?.()},spellCheck:!1})]})},Sa=(e,t)=>e?.toLowerCase()===`bearer`?{prefix:`Bearer `,placeholder:t}:{},Ca=({name:e,schema:t,inputKeyPrefix:n,arrayIndices:r,onChangeCallback:i})=>{let a=q(),o=U(n,t,r),{value:s,setInput:c}=_t(o),l=fn(s)?s:void 0,u=e=>{c(o,e.target.value),i?.()},d=Ke(t);return(0,X.jsx)(`textarea`,{className:`-mx-3.5 px-3.5 flex-1 min-h-[2.5rem] min-w-0 bg-transparent outline-0 text-playground-input resize-y`,rows:2,placeholder:d??a[`api.enterValueCapitalized`].replace(`{name}`,e??a[`api.value`]),"aria-label":d??a[`aria.enterValue`].replace(`{name}`,e??a[`api.value`]),value:l,onChange:u,spellCheck:!1,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`})},$=({...e})=>{switch(it(e.schema)){case`oneOf`:return(0,X.jsx)(Xi,{...e});case`any`:case void 0:return(0,X.jsx)(Zi,{...e});case`string`:{let t=e.isBody&&e.depth===0||e.skipContainer?Ca:xa;return(0,X.jsx)(Q,{...e,children:(0,X.jsx)(t,{...e})})}case`object`:return e.isBody&&e.depth===0||e.skipContainer?(0,X.jsx)(va,{...e}):(0,X.jsx)(Q,{...e,children:(0,X.jsx)(va,{...e})});case`number`:return(0,X.jsx)(Q,{...e,children:(0,X.jsx)(ia,{...e,numberType:`number`})});case`integer`:return(0,X.jsx)(Q,{...e,children:(0,X.jsx)(ia,{...e,numberType:`integer`})});case`array`:return(0,X.jsx)(Q,{...e,children:(0,X.jsx)(ea,{...e})});case`boolean`:case`enum`:return(0,X.jsx)(Q,{...e,children:(0,X.jsx)(ba,{...e,enumType:`boolean`})});case`enum`:return(0,X.jsx)(Q,{...e,children:(0,X.jsx)(ba,{...e,enumType:`string`})});case`enum`:return(0,X.jsx)(Q,{...e,children:(0,X.jsx)(ba,{...e,enumType:`number`})});case`enum`:return(0,X.jsx)(Q,{...e,children:(0,X.jsx)(ba,{...e,enumType:`integer`})});case`file`:return(0,X.jsx)(Q,{...e,children:(0,X.jsx)(ta,{...e})});case`null`:return(0,X.jsx)(Q,{...e,children:(0,X.jsx)(ra,{})});default:return(0,X.jsx)(Q,{...e,children:(0,X.jsx)(xa,{...e})})}},wa=({name:e,validationState:t,children:n,rightElement:r,footer:i,onPaste:o})=>{let[s,c]=(0,Y.useState)(!0),l=q(),u=s&&n!=null&&n!==!1;return(0,X.jsxs)(`div`,{"data-testid":`api-input-section-${e}`,children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-label":l[`aria.expandInputSection`],onClick:()=>c(e=>!e),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c(e=>!e))},className:a(`flex w-full px-4 py-2.5 items-center justify-between border-standard cursor-pointer hover:bg-gray-50 dark:hover:bg-white/5`,u?`border-b-0! border-t border-x rounded-t-2xl`:`rounded-2xl`),children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-x-1.5`,children:[(0,X.jsx)(J,{icon:`angle-right`,iconType:`solid`,className:a(`h-3 w-3 bg-gray-400 dark:bg-gray-500 transition-transform`,u&&`rotate-90`)}),(0,X.jsxs)(`div`,{className:`flex-1 flex items-center space-x-2`,children:[(0,X.jsx)(`div`,{className:`text-sm font-medium text-gray-800 dark:text-gray-200 leading-6`,children:e}),t?t===`invalid`?(0,X.jsx)(Ta,{}):(0,X.jsx)(Ea,{}):null]})]}),(0,X.jsx)(`div`,{onClick:e=>e.stopPropagation(),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},children:r})]}),(0,X.jsxs)(`div`,{onPaste:o,className:a(`bg-background-light dark:bg-background-dark flex-1 px-4 rounded-b-xl border-standard border-t-0!`,`[&>:not([hidden])~:not([hidden])]:border-t [&>:not([hidden])~:not([hidden])]:border-gray-100 dark:[&>:not([hidden])~:not([hidden])]:border-white/10`,u?``:`hidden`),children:[(0,X.jsx)(`div`,{}),n,i?(0,X.jsx)(`div`,{className:`-mx-4 border-t-0!`,children:i}):null]})]})},Ta=()=>(0,X.jsx)(J,{className:`h-4 w-4 bg-[#2AB673]`,icon:`circle-check`}),Ea=()=>(0,X.jsx)(J,{className:`h-4 w-4 bg-[#CB3A32]`,icon:`circle-exclamation`}),Da=e(ut(),1),Oa=20,ka=12,Aa=6,ja=24,Ma=` `,Na=e=>{let t=xn(),[,n]=(0,Y.useReducer)(e=>e+1,0);if((0,Y.useEffect)(()=>Cn(n),[]),e!==``)return An({codeString:e,codeBlockTheme:t,language:`json`,opts:{structure:`inline`,noAsync:!0}})},Pa=({id:e,value:t,onChange:n,ariaLabel:r,placeholder:i,invalid:o,errorLine:s,ariaDescribedBy:c,actions:l,header:u,footer:d,disabled:f=!1,onCaretLineChange:p,onFocusChange:m})=>{let h=Na(t),g=(0,Y.useRef)(null),_=(0,Y.useRef)(null),v=(0,Y.useRef)(null),[y,b]=(0,Y.useState)(0),x=d!=null;(0,Y.useEffect)(()=>{let e=v.current;if(!x||e===null){b(0);return}if(b(e.offsetHeight),typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>b(e.offsetHeight));return t.observe(e),()=>t.disconnect()},[x]);let S={paddingBottom:ka+y},C=t.split(` `).length,w=Math.min(Math.max(C,Aa),ja),T=e=>{let{scrollTop:t,scrollLeft:n}=e.currentTarget;g.current&&(g.current.style.transform=`translate(${-n}px, ${-t}px)`),_.current&&(_.current.style.transform=`translateY(${-t}px)`)},E=({currentTarget:e})=>{let{selectionStart:t,value:n}=e;p?.(n.slice(0,t).split(` `).length)};return(0,X.jsxs)(`div`,{dir:`ltr`,className:a(on.JsonEditor,`group/json-editor relative flex overflow-hidden font-mono text-xs leading-5`),style:{height:w*Oa+24},children:[(0,X.jsx)(`div`,{"aria-hidden":!0,className:a(`shrink-0 select-none overflow-hidden border-r border-gray-100 text-right text-gray-400 tabular-nums transition-opacity dark:border-white/10 dark:text-gray-500`,f&&`opacity-40`),children:(0,X.jsx)(`div`,{ref:_,className:`py-3 pl-3 pr-2`,children:Array.from({length:C},(e,t)=>(0,X.jsx)(`div`,{className:a(t+1===s&&`font-semibold text-red-600 dark:text-red-400`),children:t+1},t))})}),(0,X.jsxs)(`div`,{className:a(`relative min-w-0 flex-1 overflow-hidden transition-opacity`,f&&`opacity-40`),children:[(0,X.jsx)(`pre`,{ref:g,"aria-hidden":!0,style:S,className:a(Vn,`pointer-events-none absolute left-0 top-0 m-0 min-w-full whitespace-pre px-3 py-3 text-gray-800 dark:text-gray-200`),children:h===void 0?t:(0,X.jsx)(`span`,{dangerouslySetInnerHTML:{__html:h}})}),(0,X.jsx)(`textarea`,{id:e,value:t,onChange:e=>{n(e.target.value),E(e)},onScroll:T,onKeyDown:e=>{if(e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing)return;let{selectionStart:t,value:n}=e.currentTarget,r=n.lastIndexOf(` `,t-1)+1,i=n.slice(r,t),a=/[{[]\s*$/.test(i),o=`${/^[ \t]*/.exec(i)?.[0]??``}${a?Ma:``}`;o!==``&&document.execCommand(`insertText`,!1,`\n${o}`)&&e.preventDefault()},onKeyUp:E,onMouseUp:E,onSelect:E,onFocus:e=>{m?.(!0),E(e)},onBlur:()=>m?.(!1),"aria-label":r,readOnly:f,"aria-disabled":f||void 0,"aria-invalid":o||void 0,"aria-describedby":c,placeholder:i,wrap:`off`,spellCheck:!1,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,"data-testid":`request-body-json-editor`,style:S,className:`absolute inset-0 h-full w-full resize-none overflow-auto whitespace-pre bg-transparent px-3 py-3 text-transparent caret-gray-900 outline-none placeholder:text-gray-400 dark:caret-gray-100 dark:placeholder:text-gray-500`})]}),x?(0,X.jsx)(`div`,{ref:v,"data-testid":`request-body-json-footer`,className:a(`absolute inset-x-0 bottom-0 z-10 rounded-b-[11px] bg-background-light font-sans dark:bg-background-dark`,f&&`*:opacity-40`),children:d}):null,u?(0,X.jsx)(`div`,{"data-testid":`request-body-json-header`,className:`absolute inset-x-0 top-0 z-20 bg-background-light font-sans animate-in fade-in slide-in-from-top-2 duration-200 dark:bg-background-dark`,children:u}):null,l&&!f?(0,X.jsx)(`div`,{"data-testid":`request-body-json-actions`,className:`pointer-events-none absolute top-2 right-4 z-10 flex items-center gap-1.5 font-sans opacity-0 transition-opacity group-hover/json-editor:pointer-events-auto group-hover/json-editor:opacity-100 has-focus-visible:pointer-events-auto has-focus-visible:opacity-100 pointer-coarse:pointer-events-auto pointer-coarse:opacity-100 print:hidden`,children:l}):null]})},Fa=({onContinue:e,onCancel:t})=>{let n=q(),r=Rn.warning;return(0,X.jsxs)(`div`,{role:`alert`,"data-testid":`request-body-form-switch-confirmation`,className:a(`relative flex flex-wrap items-center gap-2.5 px-4 py-2.5 after:pointer-events-none after:absolute after:inset-0 after:border-b after:border-current/16`,r.container,r.contentText),children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2.5 text-sm leading-6 wrap-anywhere`,children:[(0,X.jsx)(`span`,{className:`flex shrink-0 items-center justify-center py-0.5`,children:r.icon}),n[`api.confirmFormSwitch`]]}),(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,X.jsx)(`button`,{type:`button`,onClick:e,className:`inline-flex h-7 items-center justify-center rounded-lg bg-white px-3 text-sm font-medium whitespace-nowrap text-yellow-800 shadow-[0_1px_2px_-0.5px_rgba(0,0,0,0.12),0_0_0_0.5px_color-mix(in_oklab,currentColor_16%,transparent),inset_0_0_0_0.5px_rgba(255,255,255,0.8)] transition-colors hover:bg-yellow-100 focus-visible:outline-2 focus-visible:outline-primary dark:bg-yellow-600/20 dark:text-yellow-300 dark:shadow-[0_1px_2px_0.5px_rgba(0,0,0,0.4),0_0_0_0.5px_color-mix(in_oklab,currentColor_16%,transparent),inset_0_0_0_0.5px_rgba(255,255,255,0.16)] dark:hover:bg-yellow-600/30`,children:n[`api.continue`]}),(0,X.jsxs)(`button`,{type:`button`,onClick:t,autoFocus:!0,className:`inline-flex size-7 items-center justify-center rounded-lg transition-colors hover:bg-yellow-600/10 focus-visible:outline-2 focus-visible:outline-primary dark:hover:bg-yellow-600/20`,children:[(0,X.jsx)(`span`,{className:`sr-only`,children:n.cancel}),(0,X.jsx)(qt,{"aria-hidden":`true`,className:`size-4`})]})]})]})},Ia=`bg-gray-100 dark:bg-gray-800`,La=({onClick:e})=>{let t=q(),n=K();return(0,X.jsx)(Kt,{text:t[`api.resetToDefault`],children:(0,X.jsx)(`div`,{className:`z-10 select-none`,children:(0,X.jsx)(`button`,{type:`button`,onClick:e,"aria-label":t[`api.resetToDefault`],className:a(`size-6.5 flex items-center justify-center rounded-md group/reset-button`,Ia),children:(0,X.jsx)(Pn,{"aria-hidden":`true`,className:a(`size-4 shrink-0`,n===`system`&&`text-gray-400 group-hover/reset-button:text-gray-500 dark:text-white/40 dark:group-hover/reset-button:text-white/60`,n===`dark`&&`text-white/40 group-hover/reset-button:text-white/60`)})})})})},Ra=(e,t)=>e.split(/(\{\w+\})/).map((e,n)=>{let r=/^\{(\w+)\}$/.exec(e)?.[1];return(0,X.jsx)(Y.Fragment,{children:r!==void 0&&r in t?t[r]:e},n)}),za=`rounded px-1 py-px text-[0.9em] leading-none`,Ba=a(za,`bg-red-600/10 text-red-700 dark:bg-red-400/15 dark:text-red-300`),Va=a(za,`bg-amber-600/10 text-amber-800 dark:bg-amber-400/15 dark:text-amber-300`),Ha=e=>e.map((e,t)=>(0,X.jsxs)(Y.Fragment,{children:[t>0?`, `:null,(0,X.jsx)(`code`,{className:Va,children:e})]},e)),Ua={missingComma:`api.jsonError.missingComma`,trailingComma:`api.jsonError.trailingComma`,missingColon:`api.jsonError.missingColon`,unquotedKey:`api.jsonError.unquotedKey`,singleQuotes:`api.jsonError.singleQuotes`,unterminatedString:`api.jsonError.unterminatedString`,unclosedBracket:`api.jsonError.unclosedBracket`,mismatchedBracket:`api.jsonError.mismatchedBracket`,trailingContent:`api.jsonError.trailingContent`,expectedValue:`api.jsonError.expectedValue`},Wa=(e,t)=>{let n={line:String(t.line),column:String(t.column)};if(t.reason===void 0)return Ra(e[`api.invalidJsonAt`],n);let r=Ra(e[Ua[t.reason.kind]],`bracket`in t.reason?{bracket:(0,X.jsx)(`code`,{className:Ba,children:t.reason.bracket})}:`expected`in t.reason?{expected:(0,X.jsx)(`code`,{className:Ba,children:t.reason.expected}),found:(0,X.jsx)(`code`,{className:Ba,children:t.reason.found})}:{});return Ra(e[`api.invalidJsonAtWithReason`],{...n,reason:r})},Ga=({schema:e,onResetBody:t,confirmingFormSwitch:n,onCancelFormSwitch:r,onConfirmFormSwitch:i})=>{let o=q(),s=(0,Y.useId)(),c=W(St(e=>mt(e.inputs))),l=(0,Y.useMemo)(()=>ft(c),[c]),u=A(e=>e.setJsonSyntaxError),[d,f]=(0,Y.useState)(),[p,m]=(0,Y.useState)(!1),[h,g]=(0,Y.useState)(1),[_,v]=(0,Y.useState)(!1),y=d!==void 0&&(0,Da.default)(d.baseline,l)?d:void 0,b=y?.text??dt(l),x=y?.error,S=x!==void 0&&(!p||_||!ht(x,h))?x:void 0,C=x?[]:vt(e,l);S!==void 0&&!_&&v(!0),x===void 0&&_&&v(!1),(0,Y.useEffect)(()=>{u(x)},[x,u]),(0,Y.useEffect)(()=>()=>u(void 0),[u]);let w=t=>{let n=W.getState();return n.replaceBodyInputs(yt({schema:e,value:t,previousInputs:n.inputs})),ft(W.getState().inputs)},T=e=>{let t=pt(e);t.ok?f({text:e,baseline:w(t.value)}):f({text:e,baseline:l,error:t.error})},E=()=>{t(),f(void 0)},D=S?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Zt,{"aria-hidden":`true`,strokeWidth:2,className:`mt-[3px] size-3.5 shrink-0 text-red-600 dark:text-red-400`}),(0,X.jsx)(`span`,{className:`min-w-0 text-red-600 dark:text-red-400`,children:Wa(o,S)}),(0,X.jsx)(`span`,{className:`sr-only`,children:o[`api.fixJsonToSend`]})]}):C.length>0?(0,X.jsx)(`span`,{className:`text-amber-700 dark:text-amber-400`,children:Ra(o[`api.missingRequiredFields`],{fields:Ha(C)})}):null;return(0,X.jsx)(`div`,{className:a(on.RequestBodyJson,`-mx-4`,n&&`border-t-[#eadfc4]! dark:border-t-[rgba(225,178,34,0.328)]!`),"data-testid":`request-body-json`,children:(0,X.jsx)(Pa,{value:b,onChange:T,onCaretLineChange:g,onFocusChange:m,ariaLabel:o[`aria.requestBodyJson`],placeholder:o[`api.requestBodyJsonPlaceholder`],invalid:S!==void 0,errorLine:S?.line,ariaDescribedBy:D?s:void 0,actions:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(La,{onClick:E}),(0,X.jsx)(tn,{textToCopy:b,className:Ia})]}),disabled:n,header:n?(0,X.jsx)(Fa,{onContinue:i,onCancel:r}):void 0,footer:D?(0,X.jsx)(`div`,{id:s,role:`status`,"data-testid":`request-body-json-status`,className:`flex min-h-10 items-start gap-x-1.5 border-t border-gray-100 px-4 py-2.5 text-xs leading-5 dark:border-white/10`,children:D}):void 0})})},Ka=({count:e,expanded:t,onToggle:n,controlsId:r,className:i})=>{let o=q(),{collapsible:s}=ua();if(e===0||!s)return null;let c=o[t?e===1?`api.collapseOptionalFields_one`:`api.collapseOptionalFields_other`:e===1?`api.expandOptionalFields_one`:`api.expandOptionalFields_other`].replace(`{count}`,String(e)),l=t?zn:En;return(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":t,"aria-controls":r,onClick:n,"data-testid":`optional-fields-row`,className:a(`flex h-9 w-full items-center gap-2 rounded-b-[calc(var(--radius-xl)-1px)] border-t border-gray-200 bg-gray-50 px-3.5 text-left text-sm leading-6 text-gray-600 hover:bg-gray-100 dark:border-white/10 dark:bg-white/5 dark:text-gray-400 dark:hover:bg-white/10`,i),children:[(0,X.jsx)(l,{"aria-hidden":`true`,className:`size-4 shrink-0 text-gray-400 dark:text-gray-500`,strokeWidth:1.5}),(0,X.jsx)(`span`,{children:c})]})},qa=({mode:e,onModeChange:t,disabled:n=!1})=>{let r=q();return(0,X.jsx)(On,{size:`sm`,filled:!0,ariaLabel:r[`aria.requestBodyMode`],value:e,onValueChange:t,disabled:n,"data-testid":`request-body-mode-toggle`,options:[{value:`form`,label:r[`api.bodyMode.form`]},{value:`json`,label:r[`api.bodyMode.json`]}]})},Ja=({apiReferenceData:e,selectedContentTypeIndex:t,setSelectedContentTypeIndex:n,defaultExpanded:r})=>{let i=q(),o=W(e=>e.setInputs),s=W(e=>e.deleteInput),{collapsible:c,expandedSections:l,setSectionsExpanded:u}=ua(),d=Xe(e,t),{mode:f,isAvailable:p,setPreferredMode:m}=ee(d),h=C(d),[g,_]=(0,Y.useState)(),{dependencies:v}=e,{requestBody:y}=v??{};if(!y)return null;let b=Object.entries(y.content).map(([e,t])=>({contentType:e,schema:Ae(t),label:e})),x=b[t];if(!x)return null;let S=H(x.schema)?x.schema:void 0,w=`${B.body}`,T=e=>{if(S===void 0)return;let t=xe(e);if(t===void 0||!(S.type===`object`&&(Object.keys(S.properties??{}).length>0||H(S.additionalProperties))||S.type===`array`&&`items`in S&&H(S.items)||Array.isArray(S.oneOf)&&S.oneOf.length>0))return;let n=Me({schema:S,example:t});Object.keys(n).length!==0&&(e.preventDefault(),s(w),o(n))},E=()=>(0,X.jsx)(`div`,{onClick:e=>e.stopPropagation(),className:a(`text-xs font-mono`,b.length<=1&&`hidden`),children:(0,X.jsx)(Fi,{options:b,selectedIndex:t,onSelectOption:e=>{n(e)}})}),D=()=>{let{selectedBaseUrlIndex:n,selectedSecurityOptionIndex:r,selectedExampleIndex:i}=W.getState();return mt(Ar({apiReferenceData:e,selectedBaseUrlIndex:n,selectedSecurityOptionIndex:r,selectedExampleIndex:i,selectedContentTypeIndex:t}))},O=()=>{W.getState().replaceBodyInputs(D())},k=e=>{if(f===`json`&&e===`form`){if(h!==void 0){_(t);return}gt({schema:S,body:ft(W.getState().inputs),initialBody:ft(D())}).length>0&&u([`body`],!0)}m(e)},A=()=>{O(),_(void 0),m(`form`)},j=S===void 0?0:ha(S),M=l.has(`body`),N=f===`json`,P=g===t&&N&&h!==void 0;return g!==void 0&&!P&&_(void 0),(0,X.jsx)(wa,{name:i[`api.body`],rightElement:(0,X.jsxs)(`div`,{className:`flex items-center gap-x-2`,children:[p?(0,X.jsx)(qa,{mode:f,onModeChange:k,disabled:P}):null,(0,X.jsx)(E,{})]}),footer:!N&&c&&j>0?(0,X.jsx)(Ka,{count:j,expanded:M,onToggle:()=>u([`body`],!M)}):void 0,onPaste:N?void 0:T,children:N?(0,X.jsx)(Ga,{schema:S,onResetBody:O,confirmingFormSwitch:P,onCancelFormSwitch:()=>_(void 0),onConfirmFormSwitch:A},x.contentType):S===void 0?null:(0,X.jsx)($,{schema:S,isBody:!0,depth:0,inputKeyPrefix:w,defaultExpanded:r})})},Ya=({sectionsWithOptionalFields:e,onExpandAll:t,className:n})=>{let r=q(),{collapsible:i,expandedSections:o,setSectionsExpanded:s}=ua();if(!i||e.length===0)return null;let c=e.some(e=>!o.has(e));return(0,X.jsx)(`button`,{type:`button`,"aria-expanded":!c,onClick:()=>{s(e,c),c&&t?.()},"data-testid":`optional-fields-toggle`,className:a(`inline-flex h-8 items-center whitespace-nowrap rounded-[10px] border border-gray-200 bg-background-light px-2 text-sm font-medium leading-5 text-gray-800 hover:bg-gray-50 dark:border-white/10 dark:bg-background-dark dark:text-gray-200 dark:hover:bg-white/5`,n),children:(0,X.jsxs)(`span`,{className:`grid justify-items-center`,children:[(0,X.jsx)(`span`,{"aria-hidden":!c,className:a(`col-start-1 row-start-1`,!c&&`invisible`),children:r[`api.expandOptionalFields`]}),(0,X.jsx)(`span`,{"aria-hidden":c,className:a(`col-start-1 row-start-1`,c&&`invisible`),children:r[`api.collapseOptionalFields`]})]})})},Xa=({apiReferenceData:e,defaultExpanded:t})=>{let n=q(),{collapsible:r,expandedSections:i,setSectionsExpanded:a}=ua(),o=(0,Y.useId)(),{dependencies:s}=e,{parameters:c}=s??{};if(!c||Object.keys(c).length===0)return null;let{header:l,path:u,query:d,querystring:f,cookie:p}=We(e),m=e=>{if(e===void 0)return null;if(H(e.schema)){let n=`${Je(e.in)}.${V(e.name)}`;return(0,X.jsx)($,{name:e.name,schema:{...e.schema,description:e.description},style:e.style,explode:e.explode,inputKeyPrefix:n,defaultExpanded:t},e.name)}return null},h=(e,t,n)=>{let{required:s,optional:c}=er(e),l=s.map(m).filter(e=>e!==null),u=c.map(m).filter(e=>e!==null);if(l.length===0&&u.length===0)return null;let d=i.has(n),f=`${o}-${n}`;return(0,X.jsxs)(wa,{name:t,footer:r&&u.length>0?(0,X.jsx)(Ka,{count:u.length,expanded:d,onToggle:()=>a([n],!d),controlsId:f}):void 0,children:[l,(0,X.jsx)(aa,{id:f,count:u.length,hidden:!d,onReveal:()=>a([n],!0),children:u})]})};return(0,X.jsxs)(X.Fragment,{children:[h(l,n[`api.header`],`header`),h(p,n[`api.cookies`],`cookie`),h(u,n[`api.path`],`path`),h(d,n[`api.query`],`query`),h(f,n[`api.queryString`],`querystring`)]})},Za=({apiReferenceData:e,updateLocalStorageCallback:t,defaultExpanded:n})=>{let r=q(),{selectedSecurityOptionIndex:i,setSelectedSecurityOptionIndex:o}=S(),s=e.dependencies?.processedSecurityOptions;if(!s||s.length===0)return null;let c=s[i];if(!c)return null;let l=s.map(e=>({label:e.deprecated?`${e.title} (${r[`api.deprecated`]})`:e.title,schema:e.schemes[0]?.schema??{type:`string`}}));return(0,X.jsx)(wa,{name:r[`api.authorization`],rightElement:(0,X.jsx)(()=>(0,X.jsx)(`div`,{onClick:e=>e.stopPropagation(),className:a(`text-xs font-mono`,s.length<=1&&`hidden`),children:(0,X.jsx)(Fi,{options:l,selectedIndex:i,onSelectOption:e=>{o(e)}})}),{}),children:c.schemes.map(({scheme:e,schema:r,name:i},a)=>{let o=Be({scheme:e,name:i});return(0,X.jsxs)(Y.Fragment,{children:[r.description&&r.type===`object`&&(0,X.jsx)(le,{markdown:r.description,className:`text-gray-500 dark:text-gray-400 py-2`}),(0,X.jsx)($,{name:i,schema:r,inputKeyPrefix:o,skipContainer:r.type===`object`,onChangeCallback:t,defaultExpanded:n},`${e.type}-${i}`),(0,X.jsx)(Ji,{scheme:e,className:`py-2.5`})]},`${e.type}-${i}-${a}`)})})},Qa=({apiReferenceData:e,selectedBaseUrlIndex:t,updateLocalStorageCallback:n})=>{let{dependencies:r}=e,{servers:i}=r??{};if(!i||Object.keys(i).length===0)return null;let a=Object.values(i)[t]?.variables;return!a||Object.keys(a).length===0?null:(0,X.jsx)(wa,{name:`Server`,children:Object.entries(a).map(([e,t])=>{let r={...t,type:`string`},i=`${B.server}.${V(e)}`;return(0,X.jsx)($,{name:e,schema:r,inputKeyPrefix:i,onChangeCallback:n},e)})})},$a=e=>{let t=(0,Y.useRef)(new Map);(0,Y.useEffect)(()=>{if(e===void 0)return;let n=t.current;return clearTimeout(n.get(e)),n.delete(e),()=>{n.set(e,setTimeout(()=>{n.delete(e),URL.revokeObjectURL(e)},0))}},[e])},eo={"image/png":`png`,"image/jpeg":`jpg`,"image/gif":`gif`,"image/webp":`webp`,"image/svg+xml":`svg`,"image/avif":`avif`,"image/bmp":`bmp`,"image/tiff":`tiff`,"image/x-icon":`ico`,"audio/mpeg":`mp3`,"audio/mp4":`m4a`,"audio/ogg":`ogg`,"audio/wav":`wav`,"audio/webm":`weba`,"audio/aac":`aac`,"audio/flac":`flac`,"video/mp4":`mp4`,"video/mpeg":`mpeg`,"video/ogg":`ogv`,"video/webm":`webm`,"video/quicktime":`mov`,"application/pdf":`pdf`,"application/msword":`doc`,"application/vnd.openxmlformats-officedocument.wordprocessingml.document":`docx`,"application/vnd.ms-excel":`xls`,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":`xlsx`,"application/vnd.ms-powerpoint":`ppt`,"application/vnd.openxmlformats-officedocument.presentationml.presentation":`pptx`,"application/json":`json`,"application/xml":`xml`,"application/zip":`zip`,"application/gzip":`gz`,"application/octet-stream":`bin`,"application/javascript":`js`,"application/wasm":`wasm`,"application/yaml":`yaml`,"text/yaml":`yaml`,"text/javascript":`js`,"text/plain":`txt`,"text/html":`html`,"text/css":`css`,"text/csv":`csv`,"text/xml":`xml`,"text/markdown":`md`},to={json:`json`,xml:`xml`,zip:`zip`,gzip:`gz`},no=e=>{let t=eo[e];if(t)return t;let n=e.lastIndexOf(`+`);if(n!==-1)return to[e.slice(n+1)]},ro=({message:e,icon:t})=>{let n=K();return(0,X.jsx)(`div`,{className:a(n===`system`?`bg-response-body-auto`:`bg-response-body-dark`,`rounded-b-xl`),children:(0,X.jsxs)(`div`,{className:`pb-8 pt-10 px-6 space-y-4 flex flex-col items-center`,children:[(0,X.jsx)(J,{icon:t,className:`h-8 w-8 bg-gray-300 dark:bg-white/20`}),(0,X.jsx)(`div`,{className:`text-sm text-center`,children:e})]})})},io=({data:e})=>{let t=K();return(0,X.jsx)(`div`,{className:a(t===`system`?`bg-response-body-auto`:`bg-response-body-dark`,`flex p-12 items-center rounded-b-xl h-full`),children:(0,X.jsx)(`audio`,{controls:!0,className:`w-full`,src:e.url})})},ao=(e,t,n=!1)=>{if(!(n||ke(t)))try{return{json:JSON.parse(e)}}catch(e){console.error(e);return}},oo=({data:e})=>{let t=xn(),n=q(),r=e.content.length>In*5,i=ao(e.content,e.contentType,e.live),o=i!==void 0,s=Kn({codeString:i?JSON.stringify(i.json,null,2):e.content,codeBlockTheme:t,language:o?`json`:`text`,opts:{structure:`inline`}});return(0,X.jsxs)(yn,{className:`h-full`,children:[(0,X.jsx)(Jt,{tabIndex:0,role:`region`,"aria-label":n[`aria.responseContent`],children:(0,X.jsx)(Yt,{className:`h-full`,children:(0,X.jsx)(`div`,{className:a(Vn,`px-3 py-3.5 h-full whitespace-pre border-gray-200 dark:border-gray-700 dark:text-gray-300 font-mono text-xs leading-5`,r&&`whitespace-pre-line`),children:o&&s!==void 0?(0,X.jsx)(`span`,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:s}}):(0,X.jsx)(`span`,{suppressHydrationWarning:!0,children:i?JSON.stringify(i.json,null,2):e.content})})})}),(0,X.jsx)(bn,{orientation:`horizontal`}),(0,X.jsx)(bn,{orientation:`vertical`}),(0,X.jsx)(_n,{})]})},so=({data:e})=>{let t=K();return(0,X.jsx)(`div`,{className:a(t===`system`?`bg-response-body-auto`:`bg-response-body-dark`,`h-60`),children:(0,X.jsx)(`img`,{alt:`image response from the server`,className:`p-6 w-full h-full object-scale-down`,src:e.url})})},co=({data:e})=>{let t=K();return(0,X.jsx)(`div`,{className:a(t===`system`?`bg-response-body-auto`:`bg-response-body-dark`,`flex p-2 items-center h-full rounded-xt`),children:(0,X.jsx)(`video`,{controls:!0,className:`w-full rounded-lg`,src:e.url})})},lo=({data:e})=>{let t=q();if(e==null)return(0,X.jsx)(ro,{message:t[`api.noBodyReceived`],icon:`brackets-curly`});switch(e.type){case`video`:return(0,X.jsx)(co,{data:e});case`audio`:return(0,X.jsx)(io,{data:e});case`image`:return(0,X.jsx)(so,{data:e});case`other`:return(0,X.jsx)(oo,{data:e})}},uo=({message:e})=>{let t=q();return(0,X.jsx)(ro,{message:`${t[`api.requestError`]} ${e}`,icon:`triangle-exclamation`})},fo=({children:e})=>(0,X.jsxs)(yn,{className:`w-full`,children:[(0,X.jsx)(Jt,{className:`overflow-y-hidden!`,children:(0,X.jsx)(Yt,{children:(0,X.jsx)(`div`,{className:`min-w-max`,children:e})})}),(0,X.jsx)(bn,{orientation:`horizontal`})]}),po=e=>e.flatMap(([e,t])=>Array.isArray(t)?t.map(t=>[e,t]):[[e,t]]),mo=({data:e})=>{let t=K();return(0,X.jsx)(`div`,{className:`w-full rounded-b-xl`,children:(0,X.jsx)(`table`,{className:`table-fixed pb-8 w-full pt-10`,children:po(e).map(([e,n],r)=>(0,X.jsxs)(`tr`,{className:a(`w-full flex divide-x border-b last:border-b-0 text-xs text-gray-600 dark:text-gray-400`,t===`system`?`divide-gray-100 dark:divide-white/10 border-gray-100 dark:border-white/10 text-gray-600 dark:text-gray-400`:`divide-white/10 border-white/10 text-gray-400`),children:[(0,X.jsx)(`td`,{className:`flex min-w-0 items-center basis-1/2 py-2 px-4 text-gray-600`,children:(0,X.jsx)(fo,{children:e})}),(0,X.jsx)(`td`,{className:`flex min-w-0 items-center basis-1/2 py-2 px-4`,children:(0,X.jsx)(fo,{children:`${n}`})})]},`${e}-${r}`))})})},ho=({response:e})=>{let t=q(),n=Object.entries(e.headers);return n.length===0?(0,X.jsx)(ro,{message:t[`api.noHeadersReceived`],icon:`table`}):(0,X.jsx)(mo,{data:n})},go=({data:e})=>{let[t,n]=(0,Y.useState)(!1),r=vo(e,()=>{n(!0),setTimeout(()=>{n(!1)},2e3)},e=>console.error(`unable to copy response to clipboard: ${e}`));return r?(0,X.jsx)($t,{onClick:r,isCopiedActive:t}):null},_o=[`image/png`,`text/plain`],vo=(e,t,n)=>(0,Y.useMemo)(()=>{if(e.contentType&&_o.includes(e.contentType))try{let r=new ClipboardItem({[e.contentType]:e.blob.arrayBuffer().then(t=>new Blob([t],{type:e.contentType})).catch(e=>{throw Error(`Failed to process blob: ${e.message}`)})});return()=>navigator.clipboard.write([r]).then(t,n)}catch(e){console.error(`unable to create clipboard item: ${e}`)}if(e.type===`other`)return()=>navigator.clipboard.writeText(e.content).then(t,n)},[e,t,n]),yo=({data:e})=>{let[t,n]=(0,Y.useState)(!1),r=q(),i=()=>{n(!0),setTimeout(()=>{n(!1)},2e3)},o=K();return e.extension?(0,X.jsx)(Kt,{text:t?r[`tooltip.copied`]:r[`tooltip.download`],children:(0,X.jsx)(`a`,{"aria-label":t?r[`aria.fileDownloaded`]:r[`aria.downloadResponseFile`],className:`group h-7 w-7 flex items-center justify-center cursor-pointer`,onClick:i,href:e.url,download:`api-response.${e.extension}`,children:t?(0,X.jsx)(J,{icon:`circle-check`,iconType:`solid`,className:`h-4 w-4 bg-primary dark:bg-primary-light`}):(0,X.jsx)(J,{icon:`arrow-down-to-line`,className:a(`w-4 h-4`,o===`system`?`bg-gray-400 group-hover:bg-gray-500 dark:bg-white/40 dark:group-hover:bg-white/60`:`bg-white/40 group-hover:bg-white/60`)})})}):null},bo=({result:e,selectedSection:t,setSelectedSection:n,data:r})=>(0,X.jsxs)(`div`,{className:`flex w-full px-2 py-1 space-x-3 items-center rounded-t-2xl`,children:[(0,X.jsxs)(`div`,{className:`flex flex-1 space-x-4 items-center`,children:[(0,X.jsx)(So,{status:e.error?void 0:e.response.status,statusText:e.error?void 0:e.response.statusText}),!e.error&&e.stream&&(0,X.jsx)(xo,{stream:e.stream})]}),r?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(wo,{selectedSection:t,setSelectedSection:n}),(0,X.jsx)(yo,{data:r}),(0,X.jsx)(go,{data:r})]}):null]}),xo=({stream:e})=>{let t=q(),n=K(),r=e.done?e.aborted?t[`api.streamStopped`]:e.interrupted?t[`api.streamInterrupted`]:e.truncated?t[`api.streamTruncated`]:void 0:t[`api.streaming`];return r?(0,X.jsx)(`div`,{className:a(`text-xs`,!e.done&&`animate-pulse`,n===`system`?`text-gray-500 dark:text-gray-400`:`text-gray-400`),role:`status`,children:r}):null},So=({status:e,statusText:t})=>{let n=K();return(0,X.jsxs)(`div`,{className:`flex space-x-2 items-center`,children:[(0,X.jsx)(Co,{status:e}),(0,X.jsx)(`div`,{className:a(`text-xs`,n===`system`?`text-gray-800 dark:text-gray-200 font-medium`:`text-gray-200 font-medium`),children:e?`${e} - ${t}`:`--`})]})},Co=({status:e})=>{let t=`w-3.5 h-3.5`;return e===void 0?(0,X.jsx)(J,{icon:`triangle-exclamation`,className:a(t,`bg-red-600 dark:bg-red-500`)}):e>=400?(0,X.jsx)(J,{icon:`circle-x`,className:a(t,`bg-red-600 dark:bg-red-500`)}):e>=200&&e<300?(0,X.jsx)(J,{icon:`circle-check`,className:a(t,`bg-green-600 dark:bg-green-500`)}):(0,X.jsx)(J,{icon:`circle-exclamation`,className:a(t,`bg-orange-600 dark:bg-orange-500`)})},wo=({selectedSection:e,setSelectedSection:t})=>{let n=K(),r=q();return(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`select`,{"aria-label":r[`aria.selectResponseSection`],className:a(`pl-2.5 pr-6 py-1 rounded-lg text-xs font-medium border cursor-pointer focus:outline-0`,n===`system`?`text-gray-600 dark:text-gray-400 border-standard hover:bg-gray-50 dark:hover:bg-white/[0.03]`:`text-gray-200 border-gray-800/50 hover:bg-gray-800/50 bg-gray-800/50`),value:e,onChange:e=>t(e.target.value),children:To.map(e=>(0,X.jsx)(`option`,{value:e,children:(e[0]?.toUpperCase()??``)+e.slice(1)},e))}),(0,X.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-end pr-2.5`,children:(0,X.jsx)(J,{icon:`angle-down`,iconType:`solid`,className:a(`w-2.5 h-2.5`,n===`system`?`bg-gray-400 dark:bg-gray-500`:`bg-gray-200`)})})]})},To=[`body`,`headers`],Eo=({result:e,className:t})=>{let[n,r]=(0,Y.useState)(`body`),i=Do(e),o=K(),s=(0,X.jsxs)(yn,{className:a(`rounded-xt dark:bg-codeblock max-h-[360px]`,o===`system`?`bg-white`:`codeblock-dark bg-codeblock`),children:[(0,X.jsx)(Jt,{className:`max-h-[inherit]`,children:(0,X.jsx)(Yt,{className:`min-w-0! w-full`,children:e.error?(0,X.jsx)(uo,{message:e.errorMessage}):n===`body`?(0,X.jsx)(lo,{data:i}):(0,X.jsx)(ho,{response:e.response})})}),(0,X.jsx)(bn,{orientation:`vertical`})]});return(0,X.jsx)(Xt,{children:(0,X.jsxs)(`div`,{className:a(`w-full grow rounded-2xl border p-0.5`,e.error&&`shrink-0`,o===`system`?`bg-gray-50 dark:bg-white/5 border-gray-950/10 dark:border-white/10`:`bg-codeblock dark:bg-white/5 border-white/10`,t),children:[(0,X.jsx)(bo,{selectedSection:n,setSelectedSection:r,result:e,data:i}),s]})})},Do=e=>{let t=(0,Y.useMemo)(()=>{if(e.error||e.response.data==null)return;let t=Vt(e.response.data),n=Oo(e.response.headers),r=ko(n),i=new Blob([t],{type:n}),a=URL.createObjectURL(i),o=n?no(n):void 0;return n&&r!==`other`?{type:r,contentType:n,blob:i,url:a,extension:o}:{type:`other`,contentType:n,content:new TextDecoder(`utf-8`,{ignoreBOM:!0}).decode(t),live:e.stream!==void 0&&!e.stream.done,blob:i,url:a,extension:o}},[e]);return $a(t?.url),t},Oo=e=>{for(let t in e)if(t.toLowerCase()===`content-type`){let n=e[t];if(typeof n==`string`)return n.split(`;`)[0]?.trim().toLowerCase()}},ko=e=>{let[t]=e?.split(`/`)??[];return t===`image`||t===`audio`||t===`video`?t:`other`},Ao=10485760,jo=150,Mo=1048576,No=e=>jo*(1+Math.floor(e/Mo)),Po=class{bytes=new Uint8Array(65536);encoded=``;encodedLength=0;length=0;append(e){if(this.length+e.byteLength>this.bytes.byteLength){let t=new Uint8Array(Math.max(this.bytes.byteLength*2,this.length+e.byteLength));t.set(this.bytes.subarray(0,this.length)),this.bytes=t}this.bytes.set(e,this.length),this.length+=e.byteLength}view(){return this.bytes.subarray(0,this.length)}base64(){let e=this.length-this.length%3;return ethis.encodedLength&&(this.encoded+=Un(this.bytes.subarray(this.encodedLength,e)),this.encodedLength=e),this.encoded+Un(this.bytes.subarray(e,this.length))}},Fo=e=>({error:!1,response:{status:e?.status??0,statusText:e?.statusText??``,headers:e?.headers??{},data:``},stream:{done:!0,aborted:!0,interrupted:!1,truncated:!1}}),Io=async({body:e,meta:t,onUpdate:n,signal:r,now:i=()=>Date.now()})=>{let a=new Po,o={done:!1,aborted:!1,interrupted:!1,truncated:!1},s=()=>({error:!1,response:{status:t.status,statusText:t.statusText,headers:t.headers,data:a.base64()},stream:{...o}});n(s());let c=i(),l,u=()=>{clearTimeout(l),l=void 0,n(s()),c=i()},d=e?.getReader();if(d){let e=()=>{d.cancel().catch(()=>void 0)};r?.aborted?e():r?.addEventListener(`abort`,e,{once:!0});try{for(;;){let{value:e,done:t}=await d.read();if(t)break;let n=10485761-a.length;if(a.append(e.byteLength>n?e.subarray(0,n):e),a.length>10485760){a.length=Ao,o.truncated=!0,await d.cancel().catch(()=>void 0);break}let r=i()-c,s=No(a.length);r>=s?u():l===void 0&&(l=setTimeout(u,s-r))}}catch(e){r?.aborted||e instanceof DOMException&&e.name===`AbortError`?o.aborted=!0:(o.interrupted=!0,console.error(e))}finally{r?.removeEventListener(`abort`,e)}r?.aborted&&!o.truncated&&!o.interrupted&&(o.aborted=!0)}return clearTimeout(l),o.done=!0,s()},Lo=`x-mintlify-upstream-status`,Ro=`x-mintlify-upstream-status-text`,zo=`x-mintlify-upstream-headers`,Bo=`x-mintlify-upstream-headers-truncated`,Vo=e=>{if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);if(Array.isArray(e)){let t=e.filter(e=>typeof e==`string`);return t.length===0?void 0:t.length===1?t[0]:t}},Ho=(e,t=null)=>{let n=Uo(e),r=Number(t);return Number.isInteger(r)&&r>0?{...n,[Bo]:String(r)}:n},Uo=e=>{if(!e)return{};try{let t=JSON.parse(decodeURIComponent(e));return typeof t!=`object`||!t||Array.isArray(t)?{}:Object.fromEntries(Object.entries(t).flatMap(([e,t])=>{let n=Vo(t);return n===void 0?[]:[[e,n]]}))}catch{return{}}},Wo=e=>{if(!e)return``;try{return decodeURIComponent(e)}catch{return``}},Go=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let{result:e}=r;e instanceof ArrayBuffer?t(e):n(Error(`file could not be read as bytes`))},r.onerror=()=>n(r.error??Error(`file could not be read`)),r.readAsArrayBuffer(e)}),Ko=async e=>new Map(await Promise.all(e.map(async e=>[e,new Uint8Array(await Go(e))]))),qo=e=>{let t=new TextEncoder;return(e?.chunks??[]).reduce((e,n)=>e+(typeof n==`string`?t.encode(n).byteLength:n instanceof Uint8Array?n.byteLength:n.size),0)},Jo=e=>e instanceof Uint8Array?new Uint8Array(e):e,Yo=(e,t)=>{let n=new TextEncoder,r=e.map(e=>{if(typeof e==`string`)return n.encode(e);if(e instanceof Uint8Array)return e;let r=t.get(e);if(r===void 0)throw Error(`${e.name} was not read`);return r}),i=new Uint8Array(new ArrayBuffer(r.reduce((e,t)=>e+t.byteLength,0))),a=0;for(let e of r)i.set(e,a),a+=e.byteLength;return i};function Xo(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Zo=({apiReferenceData:e,baseUrl:t,contentType:n=`application/json`,setResult:r,setIsSending:i,exactBody:a=!1})=>{let o=Tn(`docs.api_playground.request`),s=W(e=>e.getApiPlaygroundInputs),c=W(e=>e.selectedSecurityOptionIndex),l=e.dependencies?.processedSecurityOptions?.[c],u=e.operation?.isCobo,d=e.operation?.disableProxy,f=d&&e.operation?.withCredentials,p=e.operation?.path,_=e.operation?.method,v=e.dependencies?.parameters,y=e.dependencies?.requestBody?.content[n],x=Ae(y),S=H(x)?x:void 0,C=et(n,y),w=e.dependencies?.requestBody?.required,T=Qo(e)&&!n.includes(`multipart/form-data`),E=(0,Y.useRef)(null),[k,A]=(0,Y.useState)(!1);(0,Y.useEffect)(()=>()=>{let e=E.current;E.current=null,e?.abort()},[]);let j=(0,Y.useCallback)(()=>E.current?.abort(),[]);return{sendRequest:(0,Y.useCallback)(async()=>{let e=s();if(i(!0),!p||!t||!_||!n||!t){i(!1),r({error:!0,errorMessage:`Missing required fields to send a playground request`}),console.error(`Missing some required field to send a playground request:\n\npath=${p}\nmethod=${_}\ncontentType=${n}\nbaseUrl=${t}`);return}E.current?.abort();let c=new AbortController;E.current=c,A(T);let x=()=>E.current!==c,k=()=>{x()||(i(!1),E.current=null,A(!1))},j=()=>!c.signal.aborted||x()?!1:(r(Fo()),k(),!0),ee=await Ht(()=>import(`./axios-vUo_bRtp.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ`).then(e=>e.t).then(e=>e.default),__vite__mapDeps([0,1]),import.meta.url);if(x()||j())return;let M=ce(p,e.path,v??{}),N=g({inputs:e,parameters:v??{}}),P=te(v??{})?hs(e.query,l):e.query,F=ms(N,D(O({...e,query:P},v??{}))),I=h(se(oe(t,e.server),M),F),L=ns(e.header)??n,ne=C&&ke(L),ae=ne?ze(L):n,R=ps(e.header),z=a||y===void 0||S!==void 0||!Xo(e.body)?e.body:void 0,le;!a&&Xo(z)&&S&&(z=b(z,S));let ue=fr(L),de=!1;if(!re(L)&&!ne&&!ue&&(z=ie(z)),z===void 0&&w&&(S&&`type`in S?(S.type===`array`&&(z=[]),S.type===`object`&&(z={}),S.type===`string`&&(z=``)):z={}),ne&&z!==void 0){let e=je(z,ae,y);z=e,R=ss(R,Re(ae,e))}else if(ue&&typeof z==`object`&&z&&d){z=m(z,S);let e=mr(z,L,y);e!==void 0&&(de=!0,R=ss(R,e.contentType),z=e.chunks.every(e=>typeof e==`string`)?e.chunks.join(``):new Blob(e.chunks.map(Jo),{type:e.contentType}))}else if(ue&&typeof z==`object`&&z){z=m(z,S);let e=pr(z);if(qo(mr(z,L,y))>10485760){r({error:!0,errorMessage:`request body too large`}),k();return}try{let t=await Ko(e);if(x()||j())return;let n=mr(z,L,y,t);n!==void 0&&(de=!0,R=ss(R,n.contentType),n.chunks.every(e=>typeof e==`string`)?z=n.chunks.join(``):(z=Un(Yo(n.chunks,t)),le=`base64`))}catch(e){if(x()||j())return;r({error:!0,errorMessage:`unable to read the selected file`}),k(),console.error(e);return}}if(u&&(R=M.startsWith(`/v1`)?await cs({method:_,path:p,inputs:{...e,body:z},headers:R}):await ls(_,M,z,e.query,R),x()||j()))return;a&&z!==void 0&&!ne&&re(L)&&(z=JSON.stringify(z)),L.includes(`application/x-www-form-urlencoded`)&&Xo(z)&&(z=as(z)),z!==void 0&&!ne&&(R=os(R,n));let fe={method:_,url:I,header:R,body:z,...le===void 0?{}:{bodyEncoding:le},cookie:e.cookie,query:{}},pe,me=!1;try{if(T){let e=await is({request:fe,contentType:n,disableProxy:d,withCredentials:f,signal:c.signal,onUpdate:e=>{x()||r(e)}});if(x())return;`response`in e&&(pe=e.response.status),r(e)}else if(d){let e=await us({request:fe,withCredentials:f,signal:c.signal});if(x())return;pe=e.status,r({error:!1,response:{status:e.status,statusText:e.statusText,headers:e.headers,data:e.data}})}else if(L.includes(`multipart/form-data`)&&!de){let e=await ds(fe,c.signal);if(x())return;`response`in e&&(pe=e.response.status),r(e)}else{let{data:e}=await ee.post(`${vn.BASE_PATH}/_mintlify/api/request`,fe,{signal:c.signal});if(x())return;`response`in e&&(pe=e.response.status),r(e)}}catch(e){if(x()||j())return;me=!0,r({error:!0,errorMessage:`unable to complete request`}),console.error(e)}k(),o({path:p,method:_,responseStatus:pe,isError:me})},[_,p,i,s,t,n,u,S,y,C,w,o,d,r,f,l,T,a,v]),cancelRequest:j,canCancel:T||k}},Qo=e=>Object.values(e.dependencies?.responses??{}).some(e=>Object.keys(e.content??{}).some(ke)),$o=e=>{let t={};e.forEach((e,n)=>{t[n]=e});let n=typeof e.getSetCookie==`function`?e.getSetCookie():[];return n.length>1&&(t[`set-cookie`]=n),t},es=(e,t)=>{if(e!=null){if(typeof e==`string`&&re(t))try{return JSON.parse(e),e}catch{return JSON.stringify(e)}return typeof e==`string`||e instanceof Blob||e instanceof ArrayBuffer?e:t.includes(`application/x-www-form-urlencoded`)&&Xo(e)?Yn.toFormData(e,new URLSearchParams).toString():JSON.stringify(e)}},ts=new Set([`GET`,`HEAD`]),ns=e=>{let t=Object.keys(e).find(e=>e.toLowerCase()===`content-type`),n=t===void 0?void 0:e[t];return typeof n==`string`&&n!==``?n:void 0},rs=e=>typeof e==`object`&&!!e&&`error`in e&&e.error===!0&&`errorMessage`in e&&typeof e.errorMessage==`string`,is=async({request:e,contentType:t,disableProxy:n,withCredentials:r,signal:i,onUpdate:a})=>{let o,s;try{if(n){let n=Object.fromEntries(Object.entries(e.header).flatMap(([e,t])=>t==null?[]:[[e,String(t)]])),a=e.method.toUpperCase(),c=ns(n)??t;o=await fetch(e.url,{method:a,headers:n,body:ts.has(a)?void 0:es(e.body,c),signal:i,...r?{credentials:`include`}:{}}),s={status:o.status,statusText:o.statusText,headers:$o(o.headers)}}else{if(o=await fetch(`${vn.BASE_PATH}/_mintlify/api/request/stream`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e),signal:i}),o.headers.get(`content-type`)?.includes(`application/json`)){let e=await o.json().catch(()=>void 0);return rs(e)?e:{error:!0,errorMessage:`unable to complete request (${o.status})`}}let t=o.headers.get(Lo);if(t===null)return await o.body?.cancel().catch(()=>void 0),{error:!0,errorMessage:`unable to complete request (${o.status})`};s={status:Number(t),statusText:Wo(o.headers.get(Ro)),headers:Ho(o.headers.get(zo),o.headers.get(Bo))}}}catch(e){if(i.aborted)return Fo();throw e}let c=ns(s.headers);if(c!==void 0&&!ke(c)){let e=await Io({body:o.body,meta:s,onUpdate:()=>void 0,signal:i});return!e.error&&e.stream!==void 0&&!e.stream.aborted&&!e.stream.interrupted&&!e.stream.truncated?{error:!1,response:e.response}:e}return Io({body:o.body,meta:s,onUpdate:a,signal:i})},as=e=>{let t=new URLSearchParams;return Object.entries(e).forEach(([e,n])=>{(Array.isArray(n)?n:[n]).forEach(n=>{n!=null&&t.append(e,typeof n==`object`?JSON.stringify(n,void 0,2):String(n))})}),t.toString()},os=(e,t)=>Object.keys(e).some(e=>e.toLowerCase()===`content-type`)?e:{...e,"content-type":t},ss=(e,t)=>{let n=Object.keys(e).find(e=>e.toLowerCase()===`content-type`)??`content-type`;return{...e,[n]:t}},cs=async({method:e,path:t,inputs:n,headers:r})=>{let i=r[`API-SECRET`],{getCoboV1CustodyGeneratedKeys:a}=await Ht(async()=>{let{getCoboV1CustodyGeneratedKeys:e}=await import(`./v1-B1EsIvV8.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ`);return{getCoboV1CustodyGeneratedKeys:e}},__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url),o={...r,...a(e,t,i,n.body||n.query)};return delete o[`API-SECRET`],o},ls=async(e,t,n,r,i)=>{let{getCoboV2CustodyGeneratedKeys:a}=await Ht(async()=>{let{getCoboV2CustodyGeneratedKeys:e}=await import(`./v2-BHSGG-Kv.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ`);return{getCoboV2CustodyGeneratedKeys:e}},__vite__mapDeps([25,1,7,8,9]),import.meta.url),o=i[`BIZ-API-KEY`];return typeof o==`string`?await a(o,e,t,n,r):{}},us=async({request:e,withCredentials:t,signal:n})=>{let r=await Ht(()=>import(`./axios-vUo_bRtp.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ`).then(e=>e.t).then(e=>e.default),__vite__mapDeps([0,1]),import.meta.url),i=Object.keys(e.header).find(e=>e.toLowerCase()===`content-type`),a=e.body,o=e.header;if(i?.includes(`multipart/form-data`)){let{data:t,headers:n}=fs(e);a=t,o=n}return r({url:e.url,method:e.method,params:e.query,data:a,...t?{withCredentials:t}:{},...n?{signal:n}:{},headers:o,paramsSerializer:{indexes:null},responseType:`arraybuffer`,validateStatus:()=>!0,transformResponse:e=>Un(new Uint8Array(e))})},ds=async(e,t)=>{let n=await Ht(()=>import(`./axios-vUo_bRtp.js?dpl=dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ`).then(e=>e.t).then(e=>e.default),__vite__mapDeps([0,1]),import.meta.url),r=new FormData;r.append(`requestInfo`,JSON.stringify({method:e.method,url:e.url,header:e.header,query:e.query,cookie:e.cookie})),typeof e.body==`object`&&e.body!==null&&Object.entries(e.body).forEach(([e,t])=>{t instanceof File?r.append(e,t):Array.isArray(t)?t.forEach(t=>{t instanceof File?r.append(e,t):t!=null&&r.append(e,typeof t==`object`?JSON.stringify(t):t.toString())}):t!=null&&r.append(e,typeof t==`object`?JSON.stringify(t):t.toString())});let{data:i}=await n.post(`${vn.BASE_PATH}/_mintlify/api/file-request`,r,t?{signal:t}:void 0);return i},fs=e=>{let t=e.body,n=e.header;if(n[`content-type`]?.includes(`multipart/form-data`)){let e=new FormData;typeof t==`object`&&t&&(Object.entries(t).forEach(([t,n])=>{n instanceof File?e.append(t,n):Array.isArray(n)?n.forEach(n=>{n instanceof File?e.append(t,n):n!=null&&e.append(t,typeof n==`object`?JSON.stringify(n):n.toString())}):n!=null&&e.append(t,typeof n==`object`?JSON.stringify(n):n.toString())}),t=e,delete n[`content-type`])}return{data:t,headers:n}},ps=e=>{if(!e.Authorization||typeof e.Authorization!=`object`)return e;if(typeof e.Authorization==`object`){let t=`username`in e.Authorization?e.Authorization.username:``,n=`password`in e.Authorization?e.Authorization.password:``;e.Authorization=`Basic ${tt(t,n)}`,delete e.Authorization.username,delete e.Authorization.password}return e},ms=(...e)=>e.filter(e=>!!e).join(`&`)||void 0,hs=(e,t)=>{let n=f(t);return Object.fromEntries(Object.entries(e).filter(([e])=>n.has(e)))},gs=({apiReferenceData:e,baseUrl:t,selectedRequestBodyContentTypeIndex:n,setResult:r,label:i,method:a,className:o})=>{let[s,c]=(0,Y.useState)(!1),l=q(),u=Xe(e,n),{mode:d}=ee(u),f=C(u),{sendRequest:p,cancelRequest:m,canCancel:h}=Zo({apiReferenceData:e,baseUrl:t,contentType:u,setResult:r,setIsSending:c,exactBody:d===`json`});return(0,X.jsx)(ue,{label:i,method:a,isSending:s,onClick:p,onCancel:h?m:void 0,cancelLabel:l[`api.stop`],className:o,disabled:f!==void 0&&!(s&&h),sendingRequestAriaLabel:l[`aria.sendingRequest`]})},_s=({isPlaygroundExpanded:e,setIsPlaygroundExpanded:t,baseUrl:n,baseUrlOptions:r,apiReferenceData:i})=>{let{selectedBaseUrlIndex:o,setSelectedBaseUrlIndex:s}=T(),{selectedRequestBodyContentTypeIndex:c,setSelectedRequestBodyContentTypeIndex:l}=v(),[u,d]=(0,Y.useState)(),f=q(),{docsConfig:p}=(0,Y.useContext)(Ln),{getDocsConfigOverrides:m}=(0,Y.useContext)(zt),h=m()?.api?.optional??p?.api?.optional??`collapsed`,{selectedExampleIndex:g}=ne(),_=Cr(e=>e.locallyStoredCredentials),y=Cr(e=>e.setLocallyStoredCredentials),b=Cr(e=>e.locallyStoredServerVariables),x=Cr(e=>e.setLocallyStoredServerVariables),S=i.operation?.urlDisplay;(0,Y.useEffect)(()=>{if(typeof window>`u`)return;let e=!1,t=xr();return x(t),(async()=>{let t=await wn(Yi);e||y(t)})(),()=>{e=!0}},[y,x]),Dr({apiReferenceData:i,selectedBaseUrlIndex:o,selectedExampleIndex:g,selectedRequestBodyContentTypeIndex:c,locallyStoredCredentials:_,serverInputs:br(b,i.operation,o)}),Qt({key:`Escape`,callback:e?()=>t(!1):void 0,isSingleKey:!0});let C=(0,Y.useRef)(null),w=(0,Y.useCallback)(()=>{let e=Cr.getState();e.syncCredentialsState(),e.syncServerVariablesState(),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{C.current=null,Cr.getState().updateLocalStorage(Yi)},300)},[]);(0,Y.useEffect)(()=>()=>{C.current&&(clearTimeout(C.current),Cr.getState().updateLocalStorage(Yi))},[]);let E=(0,Y.useRef)(null),D=(0,Y.useCallback)(()=>{E.current?.closest(`[data-component-part="scroll-area-viewport"]`)?.scrollTo({top:0})},[]),{mode:O}=ee(Xe(i,c)),k=pa({apiReferenceData:i,selectedContentTypeIndex:c}),A=k.filter(e=>O===`form`||e!==`body`);if(!i.operation)return null;let{path:j,method:M,title:N,description:F,type:I}=i.operation,L=i.operation[`x-mint`]?.playground?.expand;return(0,X.jsxs)(be,{isPlaygroundExpanded:e,setIsPlaygroundExpanded:t,children:[(0,X.jsx)(`div`,{className:`sticky top-0 z-50 bg-background-light dark:bg-background-dark px-4 pt-4 pb-2`,children:(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-x-2`,children:[(0,X.jsx)(me,{operation:{method:M,title:N}}),(0,X.jsx)(Gi,{baseUrlOptions:r,baseUrlNames:i.operation?.baseUrlNames,selectedBaseUrlIndex:o,setSelectedBaseUrlIndex:s,display:`interactive`,path:j,method:M,type:I,onBaseUrlChange:()=>{},isInPlaygroundModal:!0,urlDisplay:S,parameters:i.dependencies?.parameters}),(0,X.jsx)(gs,{apiReferenceData:i,baseUrl:n,selectedRequestBodyContentTypeIndex:c,setResult:d,label:f.send,method:M,className:`w-20`})]})}),(0,X.jsx)(la,{resetKey:`${M}:${j}`,mode:h,children:(0,X.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-5 gap-x-8 gap-y-6 px-4 pt-3.5`,children:[(0,X.jsxs)(`div`,{ref:E,className:`col-span-1 lg:col-span-3 pb-4`,children:[(0,X.jsxs)(`div`,{className:a(`flex items-start gap-x-2`,k.length>0&&`min-h-8`),children:[(0,X.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,X.jsx)(z,{title:N,description:F})}),(0,X.jsx)(Ya,{sectionsWithOptionalFields:A,onExpandAll:D})]}),u&&(0,X.jsx)(Eo,{result:u,className:`mt-6 block lg:hidden`}),(0,X.jsxs)(`div`,{className:`space-y-2 mt-6`,children:[(0,X.jsx)(Qa,{apiReferenceData:i,selectedBaseUrlIndex:o,updateLocalStorageCallback:w}),(0,X.jsx)(Za,{apiReferenceData:i,updateLocalStorageCallback:w,defaultExpanded:L}),(0,X.jsx)(Xa,{apiReferenceData:i,defaultExpanded:L}),(0,X.jsx)(Ja,{apiReferenceData:i,selectedContentTypeIndex:c,setSelectedContentTypeIndex:l,defaultExpanded:L})]})]}),(0,X.jsxs)(`div`,{className:a(`col-span-1 lg:col-span-2 lg:space-y-6 lg:sticky lg:top-20 lg:self-start max-lg:pb-4`,u&&`lg:flex lg:flex-col`),children:[u&&(0,X.jsx)(Eo,{result:u,className:`hidden lg:block min-h-fit`}),(0,X.jsx)(P,{isModal:!0,"data-testid":`api-playground-request-example`,className:`xl:w-full`})]})]})})]})},vs=({children:e})=>{let{openApiReferenceData:t}=(0,Y.useContext)(Dn),{pageMetadata:n}=(0,Y.useContext)(Nn),{docsConfig:r}=(0,Y.useContext)(Ln),{isLivePreview:i,getDocsConfigOverrides:a}=(0,Y.useContext)(zt),o=a(),s=dn(),c=Bn(`request`),l=Bn(`response`),{isChatSheetOpen:u}=(0,Y.useContext)(jn),d=q(),f=(0,Y.useMemo)(()=>({"api.example":d[`api.example`],"api.examples":d[`api.examples`],"aria.navigateToHeader":d[`aria.navigateToHeader`],"api.default":d[`api.default`],"api.required":d[`api.required`],"api.deprecated":d[`api.deprecated`],"api.if":d[`api.if`],"api.unless":d[`api.unless`],"api.conditionallyRequired":d[`api.conditionallyRequired`],"api.isSet":d[`api.isSet`],"api.and":d[`api.and`],"api.or":d[`api.or`],"aria.selectSchemaType":d[`aria.selectSchemaType`],availableOptions:d.availableOptions,"api.title":d[`api.title`],"api.const":d[`api.const`],requiredRange:d.requiredRange,"api.mustBeMultipleOf":d[`api.mustBeMultipleOf`],tryIt:d.tryIt,"aria.sendingRequest":d[`aria.sendingRequest`],"aria.selectBaseUrl":d[`aria.selectBaseUrl`],"tooltip.copy":d[`tooltip.copy`],copied:d.copied,"api.body":d[`api.body`],"api.headers":d[`api.headers`],"api.pathParameters":d[`api.pathParameters`],"api.queryParameters":d[`api.queryParameters`],"api.queryString":d[`api.queryString`],"api.cookies":d[`api.cookies`],"api.response":d[`api.response`],"api.streamItem":d[`api.streamItem`],"api.callbacks":d[`api.callbacks`],"api.authorizations":d[`api.authorizations`],"api.scopes":d[`api.scopes`],"api.oauth.flow":d[`api.oauth.flow`],"api.oauth.authorizationCode":d[`api.oauth.authorizationCode`],"api.oauth.authorizationUrl":d[`api.oauth.authorizationUrl`],"api.oauth.tokenUrl":d[`api.oauth.tokenUrl`],"api.oauth.callbackUrl":d[`api.oauth.callbackUrl`],"api.oauth.clientId":d[`api.oauth.clientId`],"api.oauth.clientSecret":d[`api.oauth.clientSecret`],"api.oauth.optional":d[`api.oauth.optional`],"api.oauth.connectPreview":d[`api.oauth.connectPreview`]}),[d]),p=(0,Y.useMemo)(()=>({Markdown:Jn,MarkdownWithoutHeaders:qn}),[]),m=(0,Y.useMemo)(()=>({CodeGroup:rn,CodeBlock:ln,CodeSnippet:Xn,CodeSnippets:Zn,MdxCodeExample:M,CodeGroupSelect:E}),[]);return t.operation?(0,X.jsx)(Xt,{children:(0,X.jsx)(qi,{apiReferenceData:t,pageMetadata:n,docsConfig:r,isLivePreview:i,docsConfigOverrides:o,userGroups:s,localeStrings:f,markdownComponents:p,Playground:_s,mdxRequestExampleData:c,mdxResponseExampleData:l,codeComponents:m,isChatSheetOpen:u,children:e})}):t.schemaData?(0,X.jsx)(Xt,{children:(0,X.jsx)(Ni,{apiReferenceData:t,pageMetadata:n,docsConfig:r,localeStrings:f,markdownComponents:p,isLivePreview:i,children:e})}):null};export{vs as OpenApiPage};