apiuikit 1.8.2 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CodeSamples-CL8eb-T3.js → CodeSamples-BotKIQ6C.js} +895 -913
- package/dist/CodeSamples-D2iaaOjz.cjs +50 -0
- package/dist/{LogoExtension-DU3IhX6X.js → LogoExtension-CmDeWrqV.js} +1 -1
- package/dist/{LogoExtension-CPGCplgQ.cjs → LogoExtension-Dc_SUJhG.cjs} +1 -1
- package/dist/apiuikit.cjs.js +1 -1
- package/dist/apiuikit.css +1 -1
- package/dist/apiuikit.es.js +1 -1
- package/dist/components/DocumentTopBar.d.ts +4 -2
- package/dist/config/config.d.ts +15 -2
- package/dist/hooks/useDocumentProviderValue.d.ts +1 -0
- package/dist/hooks/useSystemColorScheme.d.ts +6 -0
- package/dist/{index-BknhLZWz.js → index-B5IqdQwF.js} +1 -1
- package/dist/{index-DQ7J7s-P.js → index-BW_gDunt.js} +2763 -2753
- package/dist/index-BaryvbmB.cjs +178 -0
- package/dist/{index-CRgA--GI.js → index-BnwQArUz.js} +1 -1
- package/dist/{index-COqgZ4Yj.cjs → index-BuZVtHPG.cjs} +1 -1
- package/dist/{index-AW9A5hmB.cjs → index-D7aNsAD6.cjs} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{protoToJsonSchema-BMBlvMH-.cjs → protoToJsonSchema-DAbk8Ysk.cjs} +1 -1
- package/dist/{protoToJsonSchema-DqNgaYMA.js → protoToJsonSchema-DUOthusN.js} +1 -1
- package/dist/{protobufSchemaParser-DpLRfSmz.cjs → protobufSchemaParser-BJ8lDMuw.cjs} +1 -1
- package/dist/{protobufSchemaParser-iQvfvNCx.js → protobufSchemaParser-kcEjdu3A.js} +2 -2
- package/dist/utils/scrollLock.d.ts +0 -1
- package/dist/utils/theme.d.ts +11 -1
- package/package.json +1 -1
- package/dist/CodeSamples-Cv-2sVZy.cjs +0 -50
- package/dist/index-BQPvrcDl.cjs +0 -178
- package/dist/utils/useScrollClipAncestor.d.ts +0 -12
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";var Ya=Object.defineProperty;var Qa=(e,t,r)=>t in e?Ya(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var re=(e,t,r)=>Qa(e,typeof t!="symbol"?t+"":t,r);const o=require("react/jsx-runtime"),g=require("react"),pt=require("react-dom"),No=require("isomorphic-dompurify"),Or=["#14b8a6","#22c55e","#84cc16","#3b82f6","#06b6d4","#8b5cf6"],_r=(e,t)=>{const r=t.length>0?t:Or,n=(e%r.length+r.length)%r.length;return r[n]},gt={show:{sidebar:!0,info:!0,servers:!0,operations:!0,messages:!0,messageExamples:!1,schemas:!0},theme:{colors:{primary:{50:"#ddf4ff",100:"#b6e3ff",200:"#80ccff",300:"#54aeff",500:"#58a6ff",600:"#1f6feb",700:"#0d419d"}},light:{background:"#f8fafc",surface:"#ffffff",border:"#e2e8f0",textPrimary:"#1e293b",textSecondary:"#475569",textMuted:"#64748b"},dark:{background:"#0d1117",surface:"#161b22",border:"#30363d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#6e7681"},depthColors:Or},expand:{schemas:!1},sidebar:{useChannelAddressAsIdentifier:!0},sidePanel:{containment:"viewport"}},Mr=e=>typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string",qa=e=>typeof e=="object"&&e!==null;function el(e){try{return decodeURIComponent(e).replace(/~1/g,"/").replace(/~0/g,"~")}catch{return}}function Ao(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(const n of t.slice(2).split("/")){if(!qa(r))return;const s=el(n);if(s===void 0||(r=r[s],r===void 0))return}return r}function Lt(e){const t=new Map;return r=>{if(t.has(r))return t.get(r);const n=Ao(e,r);return t.set(r,n),n}}const Un=e=>typeof e=="object"&&e!==null,tl=e=>e.replace(/^#\//,"").split("/").pop()??e,Rr=(e,t=new Set)=>typeof e!="object"||e===null||t.has(e)?!1:(t.add(e),Mr(e)?!0:(Array.isArray(e)?e:Object.values(e)).some(n=>Rr(n,t))),Eo=(e,t=new Set,r=new Set)=>{if(typeof e!="object"||e===null)return!1;if(t.has(e))return!0;if(r.has(e))return!1;if(r.add(e),Mr(e))return!0;t.add(e);try{return(Array.isArray(e)?e:Object.values(e)).some(s=>Eo(s,t,r))}finally{t.delete(e)}},nl=e=>e.replace(/~/g,"~0").replace(/\//g,"~1"),js=e=>e.length?`#/${e.map(nl).join("/")}`:"#";function xt(e){if(!Eo(e))return e;const t=new Map,r=new Set,n=new Map,s=(i,a)=>{if(Array.isArray(i)){if(r.has(i))return{$ref:n.get(i)};const l=t.get(i);if(l!==void 0)return l;const c=[];n.set(i,js(a)),t.set(i,c),r.add(i);try{i.forEach((u,d)=>c.push(s(u,[...a,String(d)])))}finally{r.delete(i)}return c}if(Mr(i)){const l=Ao(e,i.$ref),c=Un(l)||Array.isArray(l);if(c&&!r.has(l)){const u=s(l,a);return Un(u)&&u["x-parser-schema-id"]===void 0&&(u["x-parser-schema-id"]=tl(i.$ref)),u}if(l!==void 0&&!c)return l}if(Un(i)){if(r.has(i))return{$ref:n.get(i)};const l=t.get(i);if(l!==void 0)return l;const c={};n.set(i,js(a)),t.set(i,c),r.add(i);try{for(const[u,d]of Object.entries(i))c[u]=s(d,[...a,u])}finally{r.delete(i)}return c}return i};return s(e,[])}class $n extends g.Component{constructor(){super(...arguments);re(this,"state",{error:null});re(this,"reset",()=>{this.setState({error:null})})}static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,n){var s,i;console.error("[apiuikit] Rendering error:",r,n.componentStack),(i=(s=this.props).onError)==null||i.call(s,r,n)}render(){const{error:r}=this.state;if(!r)return this.props.children;const{fallback:n}=this.props;return typeof n=="function"?n(r,this.reset):n!==void 0?n:o.jsxs("div",{role:"alert",className:"flex flex-col items-start gap-3 rounded-lg border border-border bg-surface p-6 text-foreground",children:[o.jsx("p",{className:"font-semibold text-foreground",children:"Something went wrong rendering this API specification."}),o.jsx("p",{className:"text-sm text-foreground-secondary break-words",children:r.message}),o.jsx("button",{type:"button",onClick:this.reset,className:"rounded-md bg-primary-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-primary-600",children:"Try again"})]})}}const bt=g.createContext(null),Ke=()=>{const e=g.useContext(bt);if(!e)throw new Error("useDocumentContext must be used within a document provider (AsyncAPIDocumentProvider or OpenAPIDocumentProvider)");return e},$o=()=>{const e=Ke();if(e.specType!=="asyncapi")throw new Error(`useAsyncAPIDocumentContext expected an AsyncAPI document provider, but received provider type "${e.specType}"`);return e},Co=()=>{const e=Ke();if(e.specType!=="openapi")throw new Error(`useOpenAPIDocumentContext expected an OpenAPI document provider, but received provider type "${e.specType}"`);return e},be=Ke;var hn=(e=>(e.SEND="send",e.RECEIVE="receive",e))(hn||{});const rl="Contact",sl="Email",Ss="License",Ns="External Documentation",ol="Tags",il="Implicit",al=`The Implicit flow is a simplified OAuth flow previously recommended
|
|
2
|
+
for native apps and JavaScript apps where the access token is returned
|
|
3
|
+
immediately without an extra authorization code exchange step.`,ll="Client Credentials",cl="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",ul="Password",dl="The Password grant type is a legacy way to exchange a user's credentials for an access token.",fl="Authorization Code",pl="The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token.",To="Connecting to a server",hl="",mn=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],ml=[50,100,200,300,500,600,700],gl={kafka:{label:"Kafka",color:"bg-primary-100 text-primary-700 border-primary-200"},mqtt:{label:"MQTT",color:"bg-purple-100 text-purple-700 border-purple-200"},http:{label:"HTTP",color:"bg-blue-100 text-blue-700 border-blue-200"},https:{label:"HTTPS",color:"bg-blue-100 text-blue-700 border-blue-200"},ws:{label:"WebSocket",color:"bg-green-100 text-green-700 border-green-200"},wss:{label:"WebSocket Secure",color:"bg-green-100 text-green-700 border-green-200"},amqp:{label:"AMQP",color:"bg-yellow-100 text-yellow-700 border-yellow-200"},amqps:{label:"AMQPS",color:"bg-yellow-100 text-yellow-700 border-yellow-200"},ibmmq:{label:"IBM MQ",color:"bg-indigo-100 text-indigo-700 border-indigo-200"},solace:{label:"Solace",color:"bg-pink-100 text-pink-700 border-pink-200"},nats:{label:"NATS",color:"bg-teal-100 text-teal-700 border-teal-200"}},xl=[{location:"path",label:"Path Parameters"},{location:"query",label:"Query Parameters"},{location:"header",label:"Header Parameters"},{location:"cookie",label:"Cookie Parameters"}],bl={get:"bg-blue-100 text-blue-800",post:"bg-green-100 text-green-800",put:"bg-yellow-100 text-yellow-800",patch:"bg-orange-100 text-orange-800",delete:"bg-red-100 text-red-800",options:"bg-neutral-100 text-foreground-secondary",head:"bg-neutral-100 text-foreground-secondary",trace:"bg-neutral-100 text-foreground-secondary",[hn.SEND]:"bg-green-100 text-green-800",[hn.RECEIVE]:"bg-blue-100 text-blue-800"};function Io(e){const t=e.replace("#","").padEnd(6,"0"),r=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),s=parseInt(t.slice(4,6),16);return`${r} ${n} ${s}`}function Wn(e,t,r){if(e)for(const n of ml){const s=e[n];s&&(r[`--color-${t}-${n}`]=Io(s))}}const yl=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],kl={50:"15 23 42",100:"30 41 59",200:"51 65 85",300:"71 85 105",500:"148 163 184",600:"203 213 225",700:"226 232 240",800:"241 245 249",900:"248 250 252"};function wl(e,t){const r=e==null?void 0:e.mode;return r==="light"||r==="dark"?r:r==="system"?t?"dark":"light":e!=null&&e.dark&&!(e!=null&&e.light)?"dark":"light"}function vl(e,t){const r={},n=t==="dark"?e.dark:e.light;if(t==="dark")for(const[s,i]of Object.entries(kl))r[`--color-neutral-${s}`]=i;if(n)for(const[s,i]of yl){const a=n[s];a&&(r[i]=Io(a))}return e.colors&&(Wn(e.colors.primary,"primary",r),Wn(e.colors.secondary,"secondary",r),Wn(e.colors.neutral,"neutral",r)),r}const jl=e=>e.endsWith(".tab"),As=new WeakMap;let Sl=0;const Nl=e=>{const t=As.get(e);if(t)return t;const r=`plugin-${Sl++}`;return As.set(e,r),r};function Oo(e){const t=new Map;for(const r of e){const n=Nl(r);for(const s of Object.keys(r.slots)){const i=r.slots[s];if(!i)continue;const a=t.get(s)??[];if(t.has(s)||t.set(s,a),jl(s)){const l=i;a.push({id:`${s.replace(/\./g,"-")}-${n}`,pluginName:r.name,label:l.label,Component:l.component})}else a.push({id:`${s.replace(/\./g,"-")}-${n}`,pluginName:r.name,Component:i})}}return t}function Al(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function El(e){const[t,r]=g.useState(()=>e?Al():!1);return g.useEffect(()=>{if(!e||typeof window>"u"||typeof window.matchMedia!="function")return;const n=window.matchMedia("(prefers-color-scheme: dark)");r(n.matches);const s=i=>r(i.matches);return n.addEventListener("change",s),()=>n.removeEventListener("change",s)},[e]),t}const $l=[];function _o(e,t,r=gt,n=$l){var x,$,T,C,P,z,G,j,A;const[s,i]=g.useState(null),[a,l]=g.useState(null),c=g.useMemo(()=>Lt(t),[t]),u=((x=r.expand)==null?void 0:x.schemas)===!0,d=(T=($=r.theme)==null?void 0:$.depthColors)!=null&&T.length?r.theme.depthColors:Or,f=((C=r.show)==null?void 0:C.extensions)!==!1,p=((P=r.show)==null?void 0:P.codeSamples)!==!1,h=r.topOffset,m=typeof h=="number"&&Number.isFinite(h)?Math.max(0,h):0,y=((z=r.sidePanel)==null?void 0:z.containment)??"viewport",b=(G=r.sidePanel)==null?void 0:G.topOffset,v=typeof b=="number"&&Number.isFinite(b)?Math.max(0,b):m,S=(j=r.markdown)==null?void 0:j.url,w=g.useMemo(()=>{if(typeof S=="function")return S;if(typeof S=="string")return()=>S},[S]),I=g.useMemo(()=>Oo(n),[n]),B=g.useMemo(()=>({specType:e,document:t,deref:c,portalHost:s,rootElement:a,topOffset:m,sidePanelContainment:y,sidePanelTopOffset:v,defaultSchemaExpanded:u,depthColors:d,showExtensions:f,showCodeSamples:p,markdownUrl:w,plugins:n,pluginSlotRegistry:I,config:r}),[e,t,c,s,a,m,y,v,u,d,f,p,w,n,I,r]),F=El(((A=r.theme)==null?void 0:A.mode)==="system"),N=g.useMemo(()=>wl(r.theme,F),[r.theme,F]),k=g.useMemo(()=>r.theme?vl(r.theme,N):{},[r.theme,N]);return{contextValue:B,themeVars:k,resolvedMode:N,setPortalHost:i,setRootElement:l}}function Cn({document:e,config:t=gt,plugins:r,className:n="",children:s}){const{contextValue:i,themeVars:a,resolvedMode:l,setPortalHost:c,setRootElement:u}=_o("asyncapi",e,t,r);return o.jsx(bt.Provider,{value:i,children:o.jsxs("div",{ref:u,"data-theme":l,style:a,className:`apiuikit-root relative @container bg-background text-foreground ${n}`,children:[o.jsx("div",{ref:c,className:"asyncapi-portal-root"}),s]})})}const Mo="@lg:mx-auto @lg:max-w-[calc(70ch+28rem)]";function Xe({title:e,content:t,sideContent:r,stickySideContent:n=!1,info:s=!1,reverseLayoutOnMobile:i=!1,mobileLeadContent:a,layout:l="columns"}){const c=l==="stacked",u=r!=null&&r!==!1,d=`${s?"text-4xl inline-block text-3xl font-extrabold text-foreground tracking-tight":"text-2xl"} mb-4 @lg:mb-0 font-bold`;return o.jsxs("div",{className:`w-full mt-6 mb-6 ${c?"":Mo}`,children:[a&&o.jsx("div",{className:"@lg:hidden mb-3",children:a}),e&&o.jsx("div",{className:c?"w-full":"@lg:w-prose",children:o.jsx("h1",{className:d,children:e})}),o.jsxs("section",{className:`border-border text-lg flex gap-6 @lg:gap-0 ${c?"flex-col":u&&i?"flex-col-reverse @lg:flex-row":"flex-col @lg:flex-row"}`,children:[o.jsx("div",{className:`${c?"w-full":"@lg:w-prose"} min-w-0`,children:t}),c?u&&o.jsx("div",{className:n?"@lg:sticky @lg:top-4":void 0,children:r}):o.jsx("div",{className:"@lg:pl-12 @lg:w-[400px] shrink-0","data-testid":"section-side-column",children:o.jsx("div",{className:`${n&&"@lg:sticky @lg:top-4"}`,children:r})})]})]})}function et(...e){return e.filter(Boolean).join(" ")}function yt({className:e}){return o.jsx("svg",{className:e,id:"Layer_1",version:"1.1",viewBox:"0 0 50 50",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:o.jsx("polygon",{points:"47.25,15 45.164,12.914 25,33.078 4.836,12.914 2.75,15 25,37.25 "})})}const on=(e,t)=>`${e?`${e}-`:""}tab-${t}`,an=(e,t)=>`${e?`${e}-`:""}panel-${t}`;function it({tabs:e,current:t,onChange:r=()=>{},ariaLabel:n="Tabs",selectLabel:s="Select a tab",idPrefix:i,placeholder:a,variant:l}){var y;const c=g.useId(),u=g.useRef([]),d=t??(a?"":((y=e[0])==null?void 0:y.id)??""),f=e.some(b=>!!b.icon),p=t?e.findIndex(b=>b.id===t):-1,h=p>=0?p:0,m=(b,v)=>{var I;if(e.length===0)return;const S=B=>(B+e.length)%e.length;let w=v;if(b.key==="ArrowRight"&&(b.preventDefault(),w=S(v+1)),b.key==="ArrowLeft"&&(b.preventDefault(),w=S(v-1)),b.key==="Home"&&(b.preventDefault(),w=0),b.key==="End"&&(b.preventDefault(),w=e.length-1),w!==v){const B=e[w];r(B.id),(I=u.current[w])==null||I.focus()}};return e.length?o.jsxs("div",{children:[o.jsxs("div",{className:et("@sm:hidden relative",f?"mt-0":"mt-4"),children:[o.jsx("label",{htmlFor:c,className:"sr-only",children:s}),o.jsxs("select",{id:c,name:"tabs",value:d,onChange:b=>r(b.target.value),className:"block w-full appearance-none rounded-md border border-border bg-surface py-2 pl-3 pr-9 text-sm text-foreground-secondary focus:border-secondary-500 focus:outline-none focus:ring-1 focus:ring-secondary-500",children:[a&&o.jsx("option",{value:"",children:a}),e.map(b=>o.jsx("option",{value:b.id,children:b.name},b.id))]}),o.jsx(yt,{className:"pointer-events-none absolute right-3 top-1/2 h-3 w-3 -translate-y-1/2 text-foreground-muted"})]}),o.jsx("div",{className:et("hidden @sm:block",f||l==="segmented"?"":"mt-6"),children:l==="segmented"?o.jsx("div",{className:"inline-flex h-9.5 w-77.5 items-center gap-1 rounded-lg bg-neutral-100 p-1",role:"tablist","aria-label":n,children:e.map((b,v)=>{const S=b.id===t;return o.jsx("button",{ref:w=>{u.current[v]=w},id:on(i,b.id),type:"button",role:"tab",tabIndex:v===h?0:-1,"aria-selected":S,"aria-controls":an(i,b.id),onClick:()=>r(b.id),onKeyDown:w=>m(w,v),className:et("h-full flex-1 cursor-pointer rounded-md text-sm font-medium transition-colors",S?"bg-surface text-foreground shadow-sm":"text-foreground-muted hover:text-foreground-secondary"),children:b.name},b.id)})}):f?o.jsx("div",{className:"border-b border-border",role:"tablist","aria-label":n,children:o.jsx("div",{className:"flex flex-wrap gap-6",children:e.map((b,v)=>{const S=b.id===t,w=b.icon;return o.jsx("button",{ref:I=>{u.current[v]=I},id:on(i,b.id),type:"button",role:"tab",tabIndex:v===h?0:-1,"aria-selected":S,"aria-controls":an(i,b.id),onClick:()=>r(b.id),onKeyDown:I=>m(I,v),className:et("cursor-pointer border-b-2 px-1 py-3 text-sm font-semibold transition-colors",S?"border-primary-500 text-primary-600":"border-transparent text-foreground-muted hover:text-foreground"),children:o.jsxs("span",{className:"inline-flex items-center gap-2",children:[w?o.jsx(w,{className:"h-4 w-4 shrink-0"}):null,o.jsx("span",{children:b.name})]})},b.id)})})}):o.jsx("nav",{className:"relative z-0 flex divide-x divide-border rounded-lg shadow",role:"tablist","aria-label":n,children:e.map((b,v)=>{const S=b.id===t;return o.jsxs("button",{ref:w=>{u.current[v]=w},id:on(i,b.id),type:"button",role:"tab",tabIndex:v===h?0:-1,"aria-selected":S,"aria-controls":an(i,b.id),onClick:()=>r(b.id),onKeyDown:w=>m(w,v),className:et(S?"text-foreground":"text-foreground-muted hover:text-foreground-secondary",v===0?"rounded-l-lg":"",v===e.length-1?"rounded-r-lg":"","group relative min-w-0 flex-1 cursor-pointer overflow-hidden bg-surface px-4 py-4 text-center text-sm font-medium hover:bg-neutral-50 focus:z-10"),children:[o.jsx("span",{children:b.name}),o.jsx("span",{"aria-hidden":"true",className:et(S?"bg-primary-500":"bg-transparent","absolute inset-x-0 bottom-0 h-0.5")})]},b.id)})})})]}):null}function Cl({tabs:e,current:t,idPrefix:r,renderPanel:n}){return o.jsx(o.Fragment,{children:e.map(s=>{const i=s.id===t;return o.jsx("div",{id:an(r,s.id),role:"tabpanel","aria-labelledby":on(r,s.id),hidden:!i,className:i?"flex flex-col gap-6":void 0,children:n(s,i)},s.id)})})}function Ro(e){const t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight}function Pr(e){let t=e;for(;t&&t!==document.body;){if(Ro(t))return t;t=t.parentElement}return document.documentElement}function Tl(e,t){if(!e||!t||!t.contains(e))return null;let r=e;for(;r;){if(Ro(r))return r;if(r===t)break;r=r.parentElement}return null}function Po(e){const t=e.style.overflow,r=e.style.paddingRight,n=e.offsetWidth-e.clientWidth;if(e.style.overflow="hidden",n>0){const s=parseFloat(getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${s+n}px`}return()=>{e.style.overflow=t,e.style.paddingRight=r}}function Lo({tabs:e,current:t,onChange:r}){const{rootElement:n,topOffset:s=0}=Ke();if(!e.length)return null;const i=typeof document<"u"&&Pr(n)===document.documentElement?s:0,a=o.jsx("div",{className:"w-full mt-10 @lg:mt-0",children:o.jsx(it,{tabs:e,current:t,onChange:r,ariaLabel:"AsyncAPI sections",selectLabel:"Select an AsyncAPI section"})});return o.jsx("div",{className:"sticky z-10 flex w-full justify-center bg-background",style:{top:i},children:o.jsx(Xe,{content:a,stickySideContent:!1})})}function Il(e,t){const[r,n]=g.useState("docked"),s=g.useRef(t);return s.current=t,g.useEffect(()=>{if(!e)return;let i=null,a=null;const l=()=>{a=null;const u=e.getBoundingClientRect().top,d=i===null?0:u-i;i=u,u>=0?n("docked"):s.current||d>0?n("pinned"):d<0?n("hidden"):n(f=>f==="docked"?"hidden":f)},c=()=>{a===null&&(a=requestAnimationFrame(l))};return l(),window.addEventListener("scroll",c,!0),window.addEventListener("resize",c),()=>{a!==null&&cancelAnimationFrame(a),window.removeEventListener("scroll",c,!0),window.removeEventListener("resize",c)}},[e]),g.useEffect(()=>{t&&n(i=>i==="hidden"?"pinned":i)},[t]),r}const Ol=10,_l=10,Ml=40,Rl=8;function Bo({logo:e,children:t,forceVisible:r=!1}){const{rootElement:n,topOffset:s=0}=Ke(),i=Il(n,r),a=s+Ol,l=a-_l+Ml+Rl,c={top:a,transform:`translateY(${i==="hidden"?`-${l}px`:"0px"})`,pointerEvents:i==="hidden"?"none":void 0};return o.jsx("header",{className:"document-topbar",style:c,"aria-label":"Document toolbar",children:o.jsxs("div",{className:`document-topbar-inner w-full ${Mo}`,children:[o.jsx("div",{className:"document-logo",children:e}),o.jsx("div",{className:"document-topbar-controls",children:t})]})})}function Do(e){if(e.length===0)return o.jsx("span",{children:"No allowed values."});if(e.length===1)return o.jsxs("span",{children:["Allowed value is ",o.jsx("code",{children:e[0]})]});const t=e.slice(0,-1).map((n,s)=>o.jsxs(g.Fragment,{children:[o.jsx("code",{children:n}),", "," "]},s)),r=o.jsx("code",{children:e[e.length-1]},"last");return o.jsxs("span",{children:["Allowed values are ",t," and ",r]})}function Pl(e){return e.map(t=>`\`${t}\``).join(", ")}function ir(e,{align:t="center",gap:r=8,clearance:n=40,width:s=0,margin:i=8}={}){const a=e.getBoundingClientRect(),l=a.top<n?"bottom":"top",c=l==="top"?a.top-r:a.bottom+r;if(t==="center")return{top:c,left:a.left+a.width/2,placement:l};const u=a.right-s,d=window.innerWidth-s-i;return{top:c,left:Math.max(i,Math.min(u,d)),placement:l}}function Ll(e){const t=[],r=/\{([^}]+)\}/g;let n=0,s;for(;(s=r.exec(e))!==null;)s.index>n&&t.push({type:"text",value:e.slice(n,s.index)}),t.push({type:"param",value:s[1]}),n=s.index+s[0].length;return n<e.length&&t.push({type:"text",value:e.slice(n)}),t}const Es=360;function Bl(e){let t=0;return e.map((r,n)=>r.type==="text"?o.jsx("span",{children:r.value},n):o.jsx("span",{className:`font-semibold ${mn[t++%mn.length]}`,children:`{${r.value}}`},n))}function Je({address:e,parameters:t,className:r="text-xs",truncate:n=!1,peek:s=!1,padded:i=!0}){const{portalHost:a}=be(),[l,c]=g.useState(null),[u,d]=g.useState({top:0,left:0,placement:"top"}),[f,p]=g.useState(!1),[h,m]=g.useState(null),y=g.useRef(null),b=g.useId(),v=Ll(e);let S=0;g.useEffect(()=>{if(!n)return;const x=y.current;if(!x)return;const $=()=>p(x.scrollWidth>x.clientWidth);$();const T=new ResizeObserver($);return T.observe(x),()=>T.disconnect()},[n,e]);const w=(x,$)=>{d(ir($)),c(x)},I=()=>c(null),B=x=>m(ir(x,{align:"end",width:Es})),F=()=>m(null),N=v.map((x,$)=>{if(x.type==="text")return o.jsx("span",{children:x.value},$);const T=t==null?void 0:t[x.value],C=mn[S++%mn.length],P=l===$,z=!!T&&(T.description||T.type||T.default||T.enum&&T.enum.length>0||T.examples&&T.examples.length>0),G=`channel-address-tooltip-${$}`,j=z&&P?G:void 0;return o.jsxs("span",{className:"inline-block",onMouseEnter:A=>z&&w($,A.currentTarget),onMouseLeave:I,children:[o.jsx("span",{className:`font-semibold ${C} ${z?"cursor-help underline decoration-dotted":""}`,role:z?"button":void 0,tabIndex:z?0:void 0,"aria-expanded":z?P:void 0,"aria-describedby":j,onFocus:A=>z&&w($,A.currentTarget),onBlur:I,onKeyDown:A=>{z&&((A.key==="Enter"||A.key===" ")&&(A.preventDefault(),w($,A.currentTarget)),A.key==="Escape"&&(A.preventDefault(),I(),A.currentTarget.blur()))},children:`{${x.value}}`}),z&&P&&a&&pt.createPortal(o.jsxs("div",{id:G,className:`fixed -translate-x-1/2 max-w-xs px-2.5 py-1.5 bg-neutral-50 text-foreground-muted text-xs rounded pointer-events-none z-[60] shadow-lg text-left leading-snug ${u.placement==="top"?"-translate-y-full":""}`,style:{top:u.top,left:u.left},children:[T.description&&o.jsx("div",{children:T.description}),T.type&&o.jsx("div",{className:"mt-1",children:o.jsx("code",{children:T.type})}),T.default&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Default:"})," ",o.jsx("code",{children:T.default})]}),T.enum&&T.enum.length>0&&o.jsx("div",{className:"mt-1",children:Do(T.enum)}),T.examples&&T.examples.length>0&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Examples:"})," ",T.examples.join(", ")]})]}),a)]},$)}),k=i?"px-2 py-1 ":"";return n?o.jsxs("code",{className:`${k}rounded text-foreground-secondary flex items-center min-w-0 ${r}`,children:[o.jsx("span",{ref:y,className:"overflow-hidden whitespace-nowrap min-w-0",children:N}),f&&(s?o.jsx("span",{role:"button",tabIndex:0,"aria-label":"Show full address","aria-expanded":!!h,"aria-describedby":h?b:void 0,className:"shrink-0 cursor-help px-0.5 text-foreground-muted hover:text-foreground-secondary focus:outline-none focus-visible:ring-1 focus-visible:ring-neutral-300 rounded",onMouseEnter:x=>B(x.currentTarget),onMouseLeave:F,onFocus:x=>B(x.currentTarget),onBlur:F,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),x.stopPropagation(),B(x.currentTarget)),x.key==="Escape"&&(x.preventDefault(),F(),x.currentTarget.blur())},children:"…"}):o.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:"…"})),s&&f&&h&&a&&pt.createPortal(o.jsx("div",{id:b,role:"tooltip",style:{top:h.top,left:h.left,width:Es},className:`fixed z-[60] rounded-lg border border-border bg-surface px-3 py-2 shadow-lg pointer-events-none ${h.placement==="top"?"-translate-y-full":""}`,children:o.jsx("code",{className:"block break-all font-mono text-xs leading-relaxed text-foreground-secondary",children:Bl(v)})}),a)]}):o.jsx("code",{className:`${k}rounded text-foreground-secondary break-all ${r}`,children:N})}const Dl={sm:"px-2.5 py-1 rounded-md text-xs",xs:"px-1.5 py-0.5 rounded text-[10px]"};function Ze({method:e,size:t="sm",className:r=""}){return e?o.jsx("span",{className:`inline-flex items-center justify-center font-medium uppercase ${Dl[t]} ${bl[e]} ${r}`,children:e}):null}function ar(e,t){const[r,n]=g.useState(null);return g.useLayoutEffect(()=>{if(!e||!t){n(null);return}let s=null;const i=()=>{s===null&&(s=requestAnimationFrame(()=>{s=null,n(e.getBoundingClientRect())}))};n(e.getBoundingClientRect());const a=new ResizeObserver(i);return a.observe(e),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),()=>{s!==null&&cancelAnimationFrame(s),a.disconnect(),window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i)}},[e,t]),r}const $s=6,Fl=12,zl=8,Hl=.7;function Ul(e,t){if(e===0)return 1/0;const r=e*Hl-zl*2,n=t*$s+Math.max(0,t-1)*Fl;return Math.max(1,Math.floor((r-n)/$s))}function Wl(e,t){const r=e.reduce((s,i)=>s+i,0);if(r<=t)return e;if(t<=e.length)return e.map(()=>1);const n=t-e.length;return e.map(s=>Math.min(s,1+Math.floor(s/r*n)))}const Cs=20;function Kl({sections:e,activeSection:t,onTabChange:r,onItemSelect:n,selectedItem:s}){const[i,a]=g.useState(!1),[l,c]=g.useState(!1),u=i||l,{rootElement:d,portalHost:f,topOffset:p=0}=be(),h=g.useRef(null),m=g.useRef(null),[y,b]=g.useState(null),v=g.useMemo(()=>e.filter(E=>E.items.length>0),[e]),S=g.useMemo(()=>v.filter(E=>E.isTab===!1||E.id===t),[v,t]),w=g.useMemo(()=>v.filter(E=>E.showInPopover!==!1),[v]),[I,B]=g.useState(null),F=g.useRef(null),N=g.useRef(null),k=g.useCallback((E,L)=>{B({section:E,key:L}),F.current={section:E,key:L},N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{F.current=null},600)},[]);g.useEffect(()=>()=>{N.current&&clearTimeout(N.current)},[]),g.useEffect(()=>{const L=e.filter(H=>H.items.length>0).flatMap(H=>H.items.map(Q=>({section:H.id,key:H.itemKey(Q),id:H.targetId(Q)}))).map(H=>({...H,el:document.getElementById(H.id)})).filter(H=>!!H.el);if(L.length===0)return;const J=new Map(L.map(H=>[H.el,H])),Z=new Map,oe=new IntersectionObserver(H=>{for(const fe of H)fe.isIntersecting?Z.set(fe.target,fe.boundingClientRect.top):Z.delete(fe.target);if(Z.size===0)return;let Q=null,he=-1/0;for(const[fe,D]of Z)D>he&&(Q=fe,he=D);const q=Q&&J.get(Q);if(!q)return;const $e=F.current;if($e){if(q.section!==$e.section||q.key!==$e.key)return;F.current=null}B({section:q.section,key:q.key})},{rootMargin:"-10% 0px -75% 0px",threshold:0});return L.forEach(H=>oe.observe(H.el)),()=>oe.disconnect()},[e]);const x=(I==null?void 0:I.section)??t,$=I??s,T=ar(d,!0),C=typeof window>"u"?0:window.innerWidth,P=typeof window>"u"?0:window.innerHeight,z=!!T&&T.bottom>p&&T.top<P,G=Math.max(0,P-p),j=p+G/2,A=!!T&&T.width<1024,M={opacity:z?1:0,pointerEvents:z?"auto":"none",transition:"opacity 0.2s ease"},V={position:"fixed",top:j,left:((T==null?void 0:T.left)??0)+Cs,transform:"translateY(-50%)",zIndex:51,...M},Y={position:"sticky",bottom:0,height:0,zIndex:51,pointerEvents:"none"},te=ar(y,A),ue=A?{position:"fixed",bottom:te?P-te.top+8:68,right:te?C-te.right:16,zIndex:52}:{position:"fixed",top:j,left:((T==null?void 0:T.left)??0)+Cs,transform:"translateY(-50%)",maxHeight:`calc(100vh - ${p+32}px)`,zIndex:52};g.useEffect(()=>{if(!i)return;const E=J=>{J.key==="Escape"&&a(!1)},L=J=>{var oe,H;const Z=J.target;(oe=h.current)!=null&&oe.contains(Z)||(H=m.current)!=null&&H.contains(Z)||a(!1)};return document.addEventListener("keydown",E),document.addEventListener("mousedown",L),()=>{document.removeEventListener("keydown",E),document.removeEventListener("mousedown",L)}},[i]);const de=g.useCallback((E,L)=>{E.isTab!==!1&&r(E.id),L&&setTimeout(()=>{var J;(J=document.getElementById(L))==null||J.scrollIntoView({behavior:"smooth",block:"start"})},50)},[r]),le=g.useMemo(()=>w.map(E=>{const L=x===E.id,J=($==null?void 0:$.section)===E.id,Z=E.icon;return o.jsxs("div",{className:"pb-1",children:[o.jsxs("button",{onClick:()=>{de(E),k(E.id,""),A&&a(!1)},className:`group flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors ${L?"bg-primary-50":"hover:bg-neutral-50"}`,children:[o.jsx(Z,{className:`h-3.5 w-3.5 shrink-0 transition-colors ${L?"text-primary-500":"text-foreground-muted group-hover:text-foreground-secondary"}`}),o.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider transition-colors ${L?"text-primary-600":"text-foreground-muted group-hover:text-foreground-secondary"}`,children:E.label}),o.jsx("span",{className:`ml-auto inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full px-1 font-mono text-[10px] transition-colors ${L?"border border-primary-200 bg-primary-100 text-primary-500":"bg-neutral-100 text-foreground-muted"}`,children:E.items.length})]}),E.items.length>0&&o.jsx("ul",{className:"ml-4 mt-0.5 border-l border-border pl-3",children:E.items.map(oe=>{const H=E.itemKey(oe),Q=J&&($==null?void 0:$.key)===H;return o.jsx("li",{children:o.jsx("button",{onClick:()=>{de(E,E.targetId(oe)),n(E.id,H),k(E.id,H),A&&a(!1)},className:`flex w-full items-center gap-2 rounded-md px-2 py-0.5 text-left text-xs transition-colors ${Q?"bg-primary-50 font-medium text-primary-500":L?"text-foreground-secondary hover:bg-primary-50 hover:text-foreground":"text-foreground-muted hover:bg-neutral-50 hover:text-foreground-secondary"}`,children:E.renderItem(oe,{isSelected:Q,isSectionActive:L})})},H)})})]},E.id)}),[w,x,$,A,de,n,k]),ae=Ul(G,S.length),se=g.useMemo(()=>{const E=Wl(S.map(L=>L.items.length),ae);return S.map((L,J)=>{const Z=x===L.id,oe=L.items.length,H=E[J];let Q=-1;if(($==null?void 0:$.section)===L.id){const he=L.items.findIndex(q=>L.itemKey(q)===$.key);he>=0&&(Q=Math.min(H-1,Math.floor(he*H/oe)))}return o.jsxs("div",{className:"flex flex-col items-start gap-1",children:[o.jsx("span",{className:`block h-[2px] rounded-full transition-all duration-150 ${Z?"w-6 bg-foreground-secondary":"w-4 bg-neutral-300 group-hover:bg-neutral-400"}`}),o.jsx("div",{className:"flex flex-col items-start gap-1",children:Array.from({length:H},(he,q)=>o.jsx("span",{className:`block h-[2px] w-3 rounded-full transition-colors duration-150 ${q===Q?"bg-neutral-500":"bg-neutral-200 group-hover:bg-neutral-300"}`},q))})]},L.id)})},[S,x,$,ae]);return o.jsxs(o.Fragment,{children:[!A&&o.jsx("button",{ref:h,onClick:()=>a(E=>!E),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),title:u?"Close navigation":"Open navigation","aria-label":u?"Close navigation":"Open navigation",className:"group flex flex-col items-start gap-3 p-2",style:V,children:se}),A&&o.jsx("div",{style:Y,children:o.jsx("button",{ref:E=>{h.current=E,b(E)},onClick:()=>a(E=>!E),title:i?"Close navigation":"Open navigation","aria-label":i?"Close navigation":"Open navigation",className:"absolute bottom-4 right-4 flex h-11 w-11 items-center justify-center rounded-full border border-border bg-background shadow-lg",style:M,children:o.jsxs("span",{className:"flex flex-col items-start gap-1",children:[o.jsx("span",{className:"block h-[2px] w-4 rounded-full bg-foreground-secondary"}),o.jsx("span",{className:"block h-[2px] w-3 rounded-full bg-neutral-400"}),o.jsx("span",{className:"block h-[2px] w-3 rounded-full bg-neutral-300"})]})})}),f&&pt.createPortal(o.jsx("div",{ref:m,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),className:`max-h-[70vh] w-96 max-w-[calc(100vw-2rem)] overflow-y-auto rounded-xl border border-border bg-background p-2 shadow-xl transition-all duration-150 ${A?"origin-bottom-right":""} ${u?"opacity-100 scale-100 pointer-events-auto":"opacity-0 scale-95 pointer-events-none"}`,style:ue,children:le}),f)]})}function Fo({sections:e,activeTab:t,onTabChange:r,onItemSelect:n,onSelectServer:s,selectedItem:i}){return o.jsx(Kl,{sections:e,activeSection:t,onTabChange:a=>r(a),onItemSelect:(a,l)=>{a!=="info"&&(a==="servers"?s==null||s(l):n==null||n(a,l))},selectedItem:i?{section:i.tab,key:i.key}:null})}function Lr({className:e,children:t,...r}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",...r,children:t})}function Gl(e){return o.jsxs(Lr,{stroke:"url(#icon-book-open-gradient)",...e,children:[o.jsxs("linearGradient",{id:"icon-book-open-gradient",x2:"1",y2:"1",children:[o.jsx("stop",{offset:"0%",className:"primary-gradient-color-stop"}),o.jsx("stop",{offset:"100%",className:"secondary-gradient-color-stop"})]}),o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})]})}function Br({className:e}){return o.jsxs("svg",{className:e||"inline-block",viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:[o.jsx("path",{clipRule:"evenodd",fillRule:"evenodd",d:"M14 20C17.3137 20 20 17.3137 20 14C20 10.6863 17.3137 8 14 8C10.6863 8 8 10.6863 8 14C8 17.3137 10.6863 20 14 20ZM18 14C18 16.2091 16.2091 18 14 18C11.7909 18 10 16.2091 10 14C10 11.7909 11.7909 10 14 10C16.2091 10 18 11.7909 18 14Z"}),o.jsx("path",{clipRule:"evenodd",fillRule:"evenodd",d:"M0 12.9996V14.9996C0 16.5478 1.17261 17.822 2.67809 17.9826C2.80588 18.3459 2.95062 18.7011 3.11133 19.0473C2.12484 20.226 2.18536 21.984 3.29291 23.0916L4.70712 24.5058C5.78946 25.5881 7.49305 25.6706 8.67003 24.7531C9.1044 24.9688 9.55383 25.159 10.0163 25.3218C10.1769 26.8273 11.4511 28 12.9993 28H14.9993C16.5471 28 17.8211 26.8279 17.9821 25.3228C18.4024 25.175 18.8119 25.0046 19.2091 24.8129C20.3823 25.6664 22.0344 25.564 23.0926 24.5058L24.5068 23.0916C25.565 22.0334 25.6674 20.3813 24.814 19.2081C25.0054 18.8113 25.1757 18.4023 25.3234 17.9824C26.8282 17.8211 28 16.5472 28 14.9996V12.9996C28 11.452 26.8282 10.1782 25.3234 10.0169C25.1605 9.55375 24.9701 9.10374 24.7541 8.66883C25.6708 7.49189 25.5882 5.78888 24.5061 4.70681L23.0919 3.29259C21.9846 2.18531 20.2271 2.12455 19.0485 3.1103C18.7017 2.94935 18.3459 2.80441 17.982 2.67647C17.8207 1.17177 16.5468 0 14.9993 0H12.9993C11.4514 0 10.1773 1.17231 10.0164 2.6775C9.60779 2.8213 9.20936 2.98653 8.82251 3.17181C7.64444 2.12251 5.83764 2.16276 4.70782 3.29259L3.2936 4.7068C2.16377 5.83664 2.12352 7.64345 3.17285 8.82152C2.98737 9.20877 2.82199 9.60763 2.67809 10.0167C1.17261 10.1773 0 11.4515 0 12.9996ZM15.9993 3C15.9993 2.44772 15.5516 2 14.9993 2H12.9993C12.447 2 11.9993 2.44772 11.9993 3V3.38269C11.9993 3.85823 11.6626 4.26276 11.2059 4.39542C10.4966 4.60148 9.81974 4.88401 9.18495 5.23348C8.76836 5.46282 8.24425 5.41481 7.90799 5.07855L7.53624 4.70681C7.14572 4.31628 6.51256 4.31628 6.12203 4.7068L4.70782 6.12102C4.31729 6.51154 4.31729 7.14471 4.70782 7.53523L5.07958 7.90699C5.41584 8.24325 5.46385 8.76736 5.23451 9.18395C4.88485 9.8191 4.6022 10.4963 4.39611 11.2061C4.2635 11.6629 3.85894 11.9996 3.38334 11.9996H3C2.44772 11.9996 2 12.4474 2 12.9996V14.9996C2 15.5519 2.44772 15.9996 3 15.9996H3.38334C3.85894 15.9996 4.26349 16.3364 4.39611 16.7931C4.58954 17.4594 4.85042 18.0969 5.17085 18.6979C5.39202 19.1127 5.34095 19.6293 5.00855 19.9617L4.70712 20.2632C4.3166 20.6537 4.3166 21.2868 4.70712 21.6774L6.12134 23.0916C6.51186 23.4821 7.14503 23.4821 7.53555 23.0916L7.77887 22.8483C8.11899 22.5081 8.65055 22.4633 9.06879 22.7008C9.73695 23.0804 10.4531 23.3852 11.2059 23.6039C11.6626 23.7365 11.9993 24.1411 11.9993 24.6166V25C11.9993 25.5523 12.447 26 12.9993 26H14.9993C15.5516 26 15.9993 25.5523 15.9993 25V24.6174C15.9993 24.1418 16.3361 23.7372 16.7929 23.6046C17.5032 23.3985 18.1809 23.1157 18.8164 22.7658C19.233 22.5365 19.7571 22.5845 20.0934 22.9208L20.2642 23.0916C20.6547 23.4821 21.2879 23.4821 21.6784 23.0916L23.0926 21.6774C23.4831 21.2868 23.4831 20.6537 23.0926 20.2632L22.9218 20.0924C22.5855 19.7561 22.5375 19.232 22.7669 18.8154C23.1166 18.1802 23.3992 17.503 23.6053 16.7931C23.7379 16.3364 24.1425 15.9996 24.6181 15.9996H25C25.5523 15.9996 26 15.5519 26 14.9996V12.9996C26 12.4474 25.5523 11.9996 25 11.9996H24.6181C24.1425 11.9996 23.7379 11.6629 23.6053 11.2061C23.3866 10.4529 23.0817 9.73627 22.7019 9.06773C22.4643 8.64949 22.5092 8.11793 22.8493 7.77781L23.0919 7.53523C23.4824 7.14471 23.4824 6.51154 23.0919 6.12102L21.6777 4.7068C21.2872 4.31628 20.654 4.31628 20.2635 4.7068L19.9628 5.00748C19.6304 5.33988 19.1137 5.39096 18.6989 5.16979C18.0976 4.84915 17.4596 4.58815 16.7929 4.39467C16.3361 4.2621 15.9993 3.85752 15.9993 3.38187V3Z"})]})}function zo(e){return{id:"info",label:"Info",icon:Gl,isTab:!1,showInPopover:!1,items:e?["info"]:[],itemKey:()=>"info",targetId:()=>"info-panel",renderItem:()=>o.jsx("span",{className:"truncate",children:"Overview"})}}function Ho(e){return{id:"schemas",label:"Schemas",icon:Br,items:Object.keys(e),itemKey:t=>t,targetId:t=>`schema-${t}`,renderItem:t=>o.jsx("span",{className:"truncate",children:t})}}function Uo({className:e}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.948 1.5H18.052C18.9505 1.49997 19.6997 1.49995 20.2945 1.57991C20.9223 1.66432 21.4891 1.84999 21.9445 2.30546C22.4 2.76093 22.5857 3.32773 22.6701 3.95552C22.7501 4.5503 22.75 5.29953 22.75 6.19801V6.302C22.75 7.20048 22.7501 7.9497 22.6701 8.54448C22.5857 9.17228 22.4 9.73907 21.9445 10.1945C21.4891 10.65 20.9223 10.8357 20.2945 10.9201C19.6997 11.0001 18.9505 11 18.052 11H5.94801C5.04953 11 4.3003 11.0001 3.70552 10.9201C3.07773 10.8357 2.51093 10.65 2.05546 10.1945C1.59999 9.73907 1.41432 9.17228 1.32991 8.54448C1.24995 7.9497 1.24997 7.20048 1.25 6.302V6.198C1.24997 5.29952 1.24995 4.5503 1.32991 3.95552C1.41432 3.32773 1.59999 2.76093 2.05546 2.30546C2.51093 1.84999 3.07773 1.66432 3.70552 1.57991C4.3003 1.49995 5.04952 1.49997 5.948 1.5ZM3.90539 3.06654C3.44393 3.12858 3.24644 3.2358 3.11612 3.36612C2.9858 3.49643 2.87858 3.69393 2.81654 4.15539C2.7516 4.63843 2.75 5.28599 2.75 6.25C2.75 7.21401 2.7516 7.86157 2.81654 8.34461C2.87858 8.80607 2.9858 9.00357 3.11612 9.13388C3.24644 9.2642 3.44393 9.37142 3.90539 9.43347C4.38843 9.49841 5.03599 9.5 6 9.5H18C18.964 9.5 19.6116 9.49841 20.0946 9.43347C20.5561 9.37142 20.7536 9.2642 20.8839 9.13388C21.0142 9.00357 21.1214 8.80607 21.1835 8.34461C21.2484 7.86157 21.25 7.21401 21.25 6.25C21.25 5.28599 21.2484 4.63843 21.1835 4.15539C21.1214 3.69393 21.0142 3.49643 20.8839 3.36612C20.7536 3.2358 20.5561 3.12858 20.0946 3.06654C19.6116 3.00159 18.964 3 18 3H6C5.03599 3 4.38843 3.00159 3.90539 3.06654ZM5.25 6.25C5.25 5.83579 5.58579 5.5 6 5.5H8C8.41422 5.5 8.75 5.83579 8.75 6.25C8.75 6.66422 8.41422 7 8 7H6C5.58579 7 5.25 6.66422 5.25 6.25ZM10.25 6.25C10.25 5.83579 10.5858 5.5 11 5.5H18C18.4142 5.5 18.75 5.83579 18.75 6.25C18.75 6.66422 18.4142 7 18 7H11C10.5858 7 10.25 6.66422 10.25 6.25ZM5.94801 12.5H18.052C18.9505 12.5 19.6997 12.4999 20.2945 12.5799C20.9223 12.6643 21.4891 12.85 21.9445 13.3055C22.4 13.7609 22.5857 14.3277 22.6701 14.9555C22.7501 15.5503 22.75 16.2995 22.75 17.198V17.302C22.75 18.2005 22.7501 18.9497 22.6701 19.5445C22.5857 20.1723 22.4 20.7391 21.9445 21.1945C21.4891 21.65 20.9223 21.8357 20.2945 21.9201C19.6997 22.0001 18.9505 22 18.052 22H5.94801C5.04953 22 4.30031 22.0001 3.70552 21.9201C3.07773 21.8357 2.51093 21.65 2.05546 21.1945C1.59999 20.7391 1.41432 20.1723 1.32991 19.5445C1.24995 18.9497 1.24997 18.2005 1.25 17.302V17.198C1.24997 16.2995 1.24995 15.5503 1.32991 14.9555C1.41432 14.3277 1.59999 13.7609 2.05546 13.3055C2.51093 12.85 3.07773 12.6643 3.70552 12.5799C4.30031 12.4999 5.04953 12.5 5.94801 12.5ZM3.90539 14.0665C3.44393 14.1286 3.24644 14.2358 3.11612 14.3661C2.9858 14.4964 2.87858 14.6939 2.81654 15.1554C2.7516 15.6384 2.75 16.286 2.75 17.25C2.75 18.214 2.7516 18.8616 2.81654 19.3446C2.87858 19.8061 2.9858 20.0036 3.11612 20.1339C3.24644 20.2642 3.44393 20.3714 3.90539 20.4335C4.38843 20.4984 5.03599 20.5 6 20.5H18C18.964 20.5 19.6116 20.4984 20.0946 20.4335C20.5561 20.3714 20.7536 20.2642 20.8839 20.1339C21.0142 20.0036 21.1214 19.8061 21.1835 19.3446C21.2484 18.8616 21.25 18.214 21.25 17.25C21.25 16.286 21.2484 15.6384 21.1835 15.1554C21.1214 14.6939 21.0142 14.4964 20.8839 14.3661C20.7536 14.2358 20.5561 14.1286 20.0946 14.0665C19.6116 14.0016 18.964 14 18 14H6C5.03599 14 4.38843 14.0016 3.90539 14.0665ZM5.25 17.25C5.25 16.8358 5.58579 16.5 6 16.5H8C8.41422 16.5 8.75 16.8358 8.75 17.25C8.75 17.6642 8.41422 18 8 18H6C5.58579 18 5.25 17.6642 5.25 17.25ZM10.25 17.25C10.25 16.8358 10.5858 16.5 11 16.5H18C18.4142 16.5 18.75 16.8358 18.75 17.25C18.75 17.6642 18.4142 18 18 18H11C10.5858 18 10.25 17.6642 10.25 17.25Z",fill:"currentColor"})})}function Tn({className:e}){return o.jsx("svg",{className:e||"inline-block",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:o.jsx("path",{d:"M389.44 768a96.064 96.064 0 0 1 181.12 0H896v64H570.56a96.064 96.064 0 0 1-181.12 0H128v-64h261.44zm192-288a96.064 96.064 0 0 1 181.12 0H896v64H762.56a96.064 96.064 0 0 1-181.12 0H128v-64h453.44zm-320-288a96.064 96.064 0 0 1 181.12 0H896v64H442.56a96.064 96.064 0 0 1-181.12 0H128v-64h133.44z"})})}function Wo({className:e}){return o.jsxs("svg",{className:e||"inline-block",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:[o.jsx("path",{d:"M128 224v512a64 64 0 0 0 64 64h640a64 64 0 0 0 64-64V224H128zm0-64h768a64 64 0 0 1 64 64v512a128 128 0 0 1-128 128H192A128 128 0 0 1 64 736V224a64 64 0 0 1 64-64z"}),o.jsx("path",{d:"M904 224 656.512 506.88a192 192 0 0 1-289.024 0L120 224h784zm-698.944 0 210.56 240.704a128 128 0 0 0 192.704 0L818.944 224H205.056z"})]})}const Zt={};function Vl({operations:e=Zt,messages:t=Zt,schemas:r=Zt,servers:n=Zt,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u,sidebarConfig:d}){const f=g.useMemo(()=>{const p=h=>{var y;return d!=null&&d.useChannelAddressAsIdentifier?((y=e[h])==null?void 0:y.channel)??null:null};return[zo(s),{id:"servers",label:"Servers",icon:Uo,isTab:!1,items:Object.keys(n),itemKey:h=>h,targetId:h=>`server-${h}`,renderItem:h=>o.jsx("span",{className:"truncate",children:h})},{id:"operations",label:"Operations",icon:Tn,items:Object.keys(e),itemKey:h=>h,targetId:h=>`operation-${h}`,renderItem:h=>{var y;const m=p(h);return m!=null&&m.address?o.jsx(Je,{address:m.address,parameters:m.parameters,truncate:!0,padded:!1,className:"text-xs bg-transparent"}):o.jsxs(o.Fragment,{children:[o.jsx(Ze,{method:(y=e[h])==null?void 0:y.action,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:h})]})}},{id:"messages",label:"Messages",icon:Wo,items:Object.keys(t),itemKey:h=>h,targetId:h=>`message-${h}`,renderItem:h=>o.jsx("span",{className:"truncate",children:h})},Ho(r)]},[e,t,r,n,s,d]);return o.jsx(Fo,{sections:f,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u})}const In=["get","put","post","delete","options","head","patch","trace"],Jl=(e,t)=>`${e} ${t}`;function Ts(e,t){const r=new Map;for(const n of(e==null?void 0:e.parameters)??[])r.set(`${n.in}:${n.name}`,n);for(const n of(t==null?void 0:t.parameters)??[])r.set(`${n.in}:${n.name}`,n);return Array.from(r.values())}function Tt(e){return Object.keys(e).sort().flatMap(t=>{const r=e[t];return r?In.filter(n=>r[n]).map(n=>({key:Jl(n,t),method:n,path:t})):[]})}function Dr({className:e}){return o.jsxs("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 5v14m7-7H5m10-3l-3 3 3 3m-6-6l3 3-3 3"}),o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 6.873a9 9 0 011 4.127 9 9 0 01-1 4.127M5 6.873a9 9 0 00-1 4.127 9 9 0 001 4.127"}),o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 8.873a6 6 0 011 3.127 6 6 0 01-1 3.127M8 8.873a6 6 0 00-1 3.127 6 6 0 001 3.127"})]})}const Is={},Zl={},Xl=[];function Yl({paths:e=Is,webhooks:t=Is,schemas:r=Zl,servers:n=Xl,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u}){const d=g.useMemo(()=>Tt(e),[e]),f=g.useMemo(()=>Tt(t),[t]),p=g.useMemo(()=>{const h=n.map((m,y)=>({key:`server-${y}`,url:m}));return[zo(s),{id:"servers",label:"Servers",icon:Uo,isTab:!1,items:h,itemKey:m=>m.key,targetId:m=>m.key,renderItem:m=>o.jsx("span",{className:"truncate",children:m.url})},{id:"endpoints",label:"Endpoints",icon:Tn,items:d,itemKey:m=>m.key,targetId:m=>`endpoint-${m.key}`,renderItem:m=>o.jsxs(o.Fragment,{children:[o.jsx(Ze,{method:m.method,size:"xs",className:"shrink-0"}),o.jsx(Je,{address:m.path,className:"text-[10px] bg-transparent p-0"})]})},{id:"webhooks",label:"Webhooks",icon:Dr,items:f,itemKey:m=>m.key,targetId:m=>`webhook-${m.key}`,renderItem:m=>o.jsxs(o.Fragment,{children:[o.jsx(Ze,{method:m.method,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:m.path})]})},Ho(r)]},[d,f,r,n,s]);return o.jsx(Fo,{sections:p,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u})}const Ql=e=>o.jsxs("svg",{width:18,height:18,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("circle",{cx:"7",cy:"7",r:"5"}),o.jsx("path",{d:"M14 14l-3.5-3.5"})]});function Ko({query:e,onQueryChange:t,results:r,onSelectResult:n,onOpenChange:s}){const i=g.useRef(null),a=g.useRef(null),[l,c]=g.useState(!1),[u,d]=g.useState(-1),f="asyncapi-search-results",p=k=>`asyncapi-search-result-${k}`,{portalHost:h,rootElement:m,topOffset:y=0}=be(),b=()=>{c(!1),d(-1)};g.useEffect(()=>(s==null||s(l),()=>s==null?void 0:s(!1)),[l,s]);const v=g.useRef(!1),S=g.useRef(!1);g.useEffect(()=>{if(!m)return;const k=()=>{v.current=!0},x=()=>{v.current=!1};return m.addEventListener("mouseenter",k),m.addEventListener("mouseleave",x),()=>{m.removeEventListener("mouseenter",k),m.removeEventListener("mouseleave",x)}},[m]),g.useEffect(()=>{if(!m)return;const k=x=>{S.current=m.contains(x.target)};return document.addEventListener("mousedown",k,!0),()=>document.removeEventListener("mousedown",k,!0)},[m]),g.useEffect(()=>{if(!m)return;const k=x=>{!(x.metaKey||x.ctrlKey)||x.key.toLowerCase()!=="k"||!(m.contains(document.activeElement)||v.current||S.current)||(x.preventDefault(),c(!0))};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[m]),g.useEffect(()=>{if(!l)return;const k=requestAnimationFrame(()=>{var x;return(x=a.current)==null?void 0:x.focus()});return()=>cancelAnimationFrame(k)},[l]),g.useEffect(()=>{if(!(!l||!h))return Po(Pr(h))},[l,h]),g.useEffect(()=>{if(!l)return;const k=x=>{x.key==="Escape"&&b()};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[l]),g.useEffect(()=>{if(!l)return;const k=x=>{i.current&&!i.current.contains(x.target)&&b()};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[l]),g.useEffect(()=>{u>=r.length&&d(r.length-1)},[u,r.length]),g.useEffect(()=>{var k;u<0||(k=document.getElementById(p(u)))==null||k.scrollIntoView({block:"nearest"})},[u]);const w=l&&e.trim().length>0,I=k=>{b(),n(k)},B=k=>{if(k.key==="Escape"){k.preventDefault(),b();return}if(w){if(k.key==="ArrowDown"){k.preventDefault(),d(x=>r.length===0?-1:Math.min(x+1,r.length-1));return}if(k.key==="ArrowUp"){k.preventDefault(),d(x=>r.length===0?-1:Math.max(x-1,0));return}if(k.key==="Home"){k.preventDefault(),r.length>0&&d(0);return}if(k.key==="End"){k.preventDefault(),r.length>0&&d(r.length-1);return}if((k.key==="Enter"||k.key===" ")&&u>=0&&r[u]){k.preventDefault(),I(r[u]);return}}},F=w?`${r.length} result${r.length===1?"":"s"} found`:"",N=typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.userAgent);return o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:()=>c(!0),title:"Search","aria-label":"Search",className:"panel-toggle-btn bg-neutral-100",children:o.jsx(Ql,{})}),l&&h&&pt.createPortal(o.jsxs("div",{className:"fixed inset-0 z-[60] flex justify-center px-4 pt-24",style:{top:y},children:[o.jsx("div",{className:"absolute inset-0 bg-black/30"}),o.jsxs("div",{ref:i,className:"relative h-fit w-full max-w-[36rem] overflow-hidden rounded-lg border border-border bg-surface shadow-xl",children:[o.jsx("div",{className:"p-4",children:o.jsx("input",{ref:a,id:"asyncapi-search",type:"search",value:e,onChange:k=>t(k.target.value),onKeyDown:B,placeholder:"Search document...","aria-label":"Search document",role:"combobox","aria-haspopup":"listbox","aria-expanded":w,"aria-controls":f,"aria-autocomplete":"list","aria-activedescendant":u>=0?p(u):void 0,className:"w-full rounded-md bg-surface px-4 py-3 text-sm text-foreground placeholder:text-foreground-muted focus:outline-none"})}),o.jsx("div",{"aria-live":"polite",className:"sr-only",children:F}),w&&o.jsx("div",{id:f,role:"listbox",className:"max-h-80 overflow-y-auto",children:r.length>0?o.jsx("ul",{className:"divide-y divide-border",children:r.map((k,x)=>o.jsx("li",{children:o.jsxs("button",{id:p(x),type:"button",role:"option","aria-selected":u===x,onClick:()=>I(k),className:"w-full text-left px-4 py-3 hover:bg-neutral-50 "+(u===x?"bg-neutral-100":""),children:[o.jsx("div",{className:"text-sm font-semibold text-foreground",children:k.name}),o.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-foreground-muted",children:[o.jsx("span",{children:k.location}),k.subtitle&&o.jsxs("span",{children:["• ",k.subtitle]})]})]})},k.id))}):o.jsx("div",{className:"px-4 py-4 text-sm text-foreground-muted",children:"No results found."})}),o.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3 px-4 py-1.5 text-xs text-foreground-muted",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"↑"}),o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"↓"}),"to navigate"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"↵"}),"to select"]}),o.jsxs("span",{className:"flex items-center gap-1",children:["Press",o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:N?"⌘ Cmd":"Ctrl"}),o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"K"}),"to search"]})]})]})]}),h)]})}function Go({className:e}){return o.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:e,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),o.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function Vo({className:e}){return o.jsx("svg",{className:e||"inline-block",fill:"currentColor",viewBox:"0 0 20 20",children:o.jsx("path",{d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"})})}function On({className:e}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})}const ql=["The following is API documentation in Markdown.","Use it to answer questions about this API and help write client code.","Stick to what is documented below - do not invent endpoints, fields, or behavior."];function Jo(e){return`${["> ## Agent Instructions",...ql.map(r=>`> ${r}`)].join(`
|
|
4
|
+
`)}
|
|
5
|
+
|
|
6
|
+
${e.trimStart()}`}function Zo({serialize:e,onOpenChange:t}){const[r,n]=g.useState(!1),[s,i]=g.useState(!1),a=g.useRef(null),l=g.useRef(void 0),{deref:c}=be(),u=()=>Jo(e(c));g.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]),g.useEffect(()=>(t==null||t(r),()=>t==null?void 0:t(!1)),[r,t]),g.useEffect(()=>{if(!r)return;const p=h=>{h.key==="Escape"&&n(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[r]),g.useEffect(()=>{if(!r)return;const p=h=>{a.current&&!a.current.contains(h.target)&&n(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[r]);const d=async()=>{const p=u();console.log("[MarkdownExportMenu] Copy for LLM clicked",{markdownLength:p.length,hasClipboardApi:!!navigator.clipboard,isSecureContext:window.isSecureContext});try{if(!navigator.clipboard)throw new Error("navigator.clipboard is unavailable (requires a secure context: https or localhost)");await navigator.clipboard.writeText(p),console.log("[MarkdownExportMenu] clipboard.writeText succeeded"),i(!0),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>i(!1),2e3)}catch(h){console.error("[MarkdownExportMenu] Copy for LLM failed:",h)}n(!1)},f=()=>{const p=u(),h=new Blob([p],{type:"text/markdown"}),m=URL.createObjectURL(h);console.log("[MarkdownExportMenu] View as Markdown clicked",{markdownLength:p.length,blobUrl:m}),window.open(m,"_blank")||console.error("[MarkdownExportMenu] window.open returned null — the popup was likely blocked by the browser's popup blocker."),setTimeout(()=>URL.revokeObjectURL(m),3e4),n(!1)};return o.jsxs("div",{ref:a,className:"relative",children:[o.jsxs("button",{type:"button",onClick:()=>n(p=>!p),title:"Copy as Markdown","aria-label":"Copy as Markdown","aria-haspopup":"menu","aria-expanded":r,className:"panel-toggle-btn panel-toggle-btn--labeled bg-neutral-100 hover:bg-neutral-200",children:[s?o.jsx(Vo,{className:"w-4 h-4 shrink-0 text-green-600"}):o.jsx(Go,{className:"w-4 h-4 shrink-0"}),o.jsx("span",{children:s?"Copied!":"Copy as Markdown"}),o.jsx(yt,{className:`w-3 h-3 shrink-0 transition-transform duration-200 ${r?"rotate-180":""}`})]}),r&&o.jsxs("div",{role:"menu",className:"absolute right-0 top-11 z-[41] w-56 overflow-hidden rounded-lg border border-border bg-surface shadow-xl",children:[o.jsxs("button",{type:"button",role:"menuitem",onClick:d,className:"flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left hover:bg-neutral-100",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:s?"Copied!":"Copy for LLM"}),o.jsx("span",{className:"text-xs text-foreground-muted",children:"Copy page as Markdown"})]}),o.jsxs("button",{type:"button",role:"menuitem",onClick:f,className:"flex w-full items-start justify-between gap-2 px-3 py-2 text-left hover:bg-neutral-100 border-t border-border",children:[o.jsxs("span",{className:"flex flex-col items-start gap-0.5",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:"View as Markdown"}),o.jsx("span",{className:"text-xs text-foreground-muted",children:"Open this page as Markdown"})]}),o.jsx(On,{className:"w-3.5 h-3.5 mt-0.5 shrink-0 text-foreground-muted"})]})]})]})}const ze=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),ln=(e,t=new Set)=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(r=>ln(r,t)).join(" "):e instanceof Map?Array.from(e.entries()).flatMap(([r,n])=>[r,ln(n,t)]).join(" "):ze(e)?t.has(e)?"":(t.add(e),Object.entries(e).flatMap(([r,n])=>[r,ln(n,t)]).join(" ")):"",je=e=>ln(e).trim().replace(/\s+/g," "),ec=(e,t)=>t.length?`schema-${e}-${t.join("-")}`:`schema-${e}`,tc=new Set(["properties","items","allOf","oneOf","anyOf","additionalProperties","patternProperties","propertyNames","not","if","then","else","contains","additionalItems","prefixItems","definitions","$defs"]),nc=e=>{if(!ze(e))return e;const t={};for(const[r,n]of Object.entries(e))tc.has(r)||(t[r]=n);return t},Xo=(e,t,r,n)=>{const s=`schema-${r}`,i=(l,c,u,d)=>{const f=`components.schemas.${r}${c.length?`.${c.join(".")}`:""}`,p=`Schemas > ${n}${u.length?` > ${u.join(" > ")}`:""}`,h=ze(l)?l.description:void 0,m=c.length?`${n}.${c.join(".")}`:n;e.push({id:`schema-${r}-${c.join("-")||"root"}`,targetId:d?ec(r,d):s,type:"schema",tab:"schemas",key:r,name:m,path:f,location:p,subtitle:h,text:je([nc(l)]),schemaFocusTokens:d&&d.length>0?d:void 0})},a=(l,c=[],u=[],d=[],f=new Set)=>{if(i(l,c,u,d),!ze(l)||f.has(l))return;if(f.add(l),ze(l.properties))for(const[h,m]of Object.entries(l.properties))a(m,[...c,"properties",h],[...u,h],d?[...d,"properties",h]:null,f);const p=l.items;ze(p)?a(p,[...c,"items"],[...u,"items"],d?[...d,"items"]:null,f):Array.isArray(p)&&p.forEach((h,m)=>{a(h,[...c,`items[${m}]`],[...u,`items[${m}]`],null,f)});for(const h of["allOf","oneOf","anyOf"]){const m=l[h];Array.isArray(m)&&m.forEach((y,b)=>{a(y,[...c,`${h}[${b}]`],[...u,`${h}[${b}]`],d&&h!=="allOf"?[...d,`${h}[${b}]`]:null,f)})}ze(l.additionalProperties)&&a(l.additionalProperties,[...c,"additionalProperties"],[...u,"additionalProperties"],null,f)};a(t)};function rc(e){var r,n;const t=[];if(e.info){const s=e.info.title??"Info",i=e.info.description??void 0;t.push({id:"info-panel",targetId:"info-panel",type:"info",tab:"info",key:"info",name:s,path:"info",location:"Info",subtitle:i,text:je([e.info,e.info.title,e.info.description,e.info.license,e.info.externalDocs,e.info.contact,e.info.tags])})}if(e.servers)for(const[s,i]of Object.entries(e.servers)){const a=i,l=a.description??s,c=[a.protocol,a.host].filter(Boolean).join(" ");t.push({id:`server-${s}`,targetId:`server-${s}`,type:"server",tab:"servers",key:s,name:s,path:`servers.${s}`,location:`Servers > ${s}`,subtitle:c,text:je([s,l,c,a.description,a.protocol,a.host,a.variables,a.security,a.bindings])});const u=a.security;Array.isArray(u)&&u.length>0&&t.push({id:`server-${s}-security`,targetId:`server-${s}-security`,type:"server",tab:"servers",key:s,name:`${s} > Authorization`,path:`servers.${s}.security`,location:`Servers > ${s} > Authorization`,focusSection:"security",text:je(u)});const d=a.bindings,f=ze(d)&&a.protocol?d[a.protocol]:void 0;f!=null&&t.push({id:`server-${s}-bindings`,targetId:`server-${s}-bindings`,type:"server",tab:"servers",key:s,name:`${s} > ${a.protocol} configuration`,path:`servers.${s}.bindings.${a.protocol}`,location:`Servers > ${s} > ${a.protocol} configuration`,focusSection:`binding:${a.protocol}`,text:je(f)})}if(e.operations)for(const[s,i]of Object.entries(e.operations)){const a=i.title??s,l=i.summary??i.description??i.action??"";t.push({id:`operation-${s}`,targetId:`operation-${s}-detail`,type:"operation",tab:"operations",key:s,name:a,path:`operations.${s}`,location:`Operations > ${a}`,subtitle:l,text:je([s,a,l,i.action,i.channel,i.messages,i.reply,i.traits,i.bindings,i.security,i.tags])});const c=i.security;Array.isArray(c)&&c.length>0&&t.push({id:`operation-${s}-security`,targetId:`operation-${s}-security`,type:"operation",tab:"operations",key:s,name:`${a} > Authorization`,path:`operations.${s}.security`,location:`Operations > ${a} > Authorization`,focusSection:"security",text:je(c)});const u=i.bindings;if(ze(u))for(const[d,f]of Object.entries(u))f!=null&&t.push({id:`operation-${s}-bindings-${d}`,targetId:`operation-${s}-bindings-${d}`,type:"operation",tab:"operations",key:s,name:`${a} > ${d} configuration`,path:`operations.${s}.bindings.${d}`,location:`Operations > ${a} > ${d} configuration`,focusSection:`binding:${d}`,text:je(f)})}if((r=e.components)!=null&&r.messages)for(const[s,i]of Object.entries(e.components.messages)){const a=i.title??i.name??s,l=i.summary??i.description??i.contentType??"";t.push({id:`message-${s}`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:a,path:`components.messages.${s}`,location:`Messages > ${a}`,subtitle:l,text:je([s,a,l,i.contentType,i.payload,i.headers,i.correlationId,i.tags,i.externalDocs,i.bindings])}),i.payload&&t.push({id:`message-${s}-payload`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:`${a} > Payload`,path:`components.messages.${s}.payload`,location:`Messages > ${a} > Payload`,focusSection:"payload",text:je(i.payload)}),i.headers&&t.push({id:`message-${s}-headers`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:`${a} > Headers`,path:`components.messages.${s}.headers`,location:`Messages > ${a} > Headers`,focusSection:"headers",text:je(i.headers)})}if((n=e.components)!=null&&n.schemas)for(const[s,i]of Object.entries(e.components.schemas))Xo(t,i,s,s);return t}function Ye(e){return Array.isArray?Array.isArray(e):Qo(e)==="[object Array]"}function sc(e){if(typeof e=="string")return e;if(typeof e=="bigint")return e.toString();const t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function lr(e){return e==null?"":sc(e)}function xe(e){return typeof e=="string"}function cn(e){return typeof e=="number"}function oc(e){return e===!0||e===!1||ic(e)&&Qo(e)=="[object Boolean]"}function Yo(e){return typeof e=="object"}function ic(e){return Yo(e)&&e!==null}function Ae(e){return e!=null}function Xt(e){return!e.trim().length}function Qo(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const ac="Incorrect 'index' type",cr="Invalid doc index: must be a non-negative integer within the bounds of the docs array",lc=e=>`Invalid value for key ${e}`,cc=e=>`Pattern length exceeds max of ${e}.`,uc=e=>`Missing ${e} property in key`,dc=e=>`Property 'weight' in key '${e}' must be a positive integer`,fc="Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.",Os=Object.prototype.hasOwnProperty;var pc=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(r=>{const n=qo(r);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(r=>{r.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function qo(e){let t=null,r=null,n=null,s=1,i=null;if(xe(e)||Ye(e))n=e,t=_s(e),r=un(e);else{if(!Os.call(e,"name"))throw new Error(uc("name"));const a=e.name;if(n=a,Os.call(e,"weight")&&e.weight!==void 0&&(s=e.weight,s<=0))throw new Error(dc(un(a)));t=_s(a),r=un(a),i=e.getFn??null}return{path:t,id:r,weight:s,src:n,getFn:i}}function _s(e){return Ye(e)?e:e.split(".")}function un(e){return Ye(e)?e.join("."):e}function hc(e,t){const r=[];let n=!1;const s=(i,a,l,c)=>{if(Ae(i))if(!a[l])r.push(c!==void 0?{v:i,i:c}:i);else{const u=i[a[l]];if(!Ae(u))return;if(l===a.length-1&&(xe(u)||cn(u)||oc(u)||typeof u=="bigint"))r.push(c!==void 0?{v:lr(u),i:c}:lr(u));else if(Ye(u)){n=!0;for(let d=0,f=u.length;d<f;d+=1)s(u[d],a,l+1,d)}else a.length&&s(u,a,l+1,c)}};return s(e,xe(t)?t.split("."):t,0),n?r:r[0]}const mc={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},gc={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},xc={location:0,threshold:.6,distance:100},bc={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:hc,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},U=Object.freeze({...gc,...mc,...xc,...bc});function yc(e){return e>=9&&e<=13||e===32||e===160}function kc(e=1,t=3){const r=new Map,n=Math.pow(10,t);return{get(s){let i=0,a=!1;for(let c=0;c<s.length;c++)yc(s.charCodeAt(c))?a=!1:a||(i++,a=!0);if(i===0&&(i=1),r.has(i))return r.get(i);const l=Math.round(n/Math.pow(i,.5*e))/n;return r.set(i,l),l},clear(){r.clear()}}}var Fr=class{constructor({getFn:e=U.getFn,fieldNormWeight:t=U.fieldNormWeight}={}){this.norm=kc(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,r)=>{this._keysMap[t.id]=r})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;const e=this.docs.length;this.records=new Array(e);let t=0;if(xe(this.docs[0]))for(let r=0;r<e;r++){const n=this._createStringRecord(this.docs[r],r);n&&(this.records[t++]=n)}else for(let r=0;r<e;r++)this.records[t++]=this._createObjectRecord(this.docs[r],r);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw new Error(cr);if(xe(e)){const n=this._createStringRecord(e,t);return n&&this.records.push(n),n}const r=this._createObjectRecord(e,t);return this.records.push(r),r}removeAt(e){if(!Number.isInteger(e)||e<0)throw new Error(cr);for(let t=0,r=this.records.length;t<r;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,r=this.records.length;t<r;t+=1)this.records[t].i>e&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const n of e)Number.isInteger(n)&&n>=0&&t.add(n);if(t.size===0)return;this.records=this.records.filter(n=>!t.has(n.i));const r=Array.from(t).sort((n,s)=>n-s);for(const n of this.records){let s=0,i=r.length;for(;s<i;){const a=s+i>>>1;r[a]<n.i?s=a+1:i=a}n.i-=s}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!Ae(e)||Xt(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){const r={i:t,$:{}};for(let n=0,s=this.keys.length;n<s;n++){const i=this.keys[n],a=i.getFn?i.getFn(e):this.getFn(e,i.path);if(Ae(a)){if(Ye(a)){const l=[];for(let c=0,u=a.length;c<u;c+=1){const d=a[c];if(Ae(d)){if(xe(d)){if(!Xt(d)){const f={v:d,i:c,n:this.norm.get(d)};l.push(f)}}else if(Ae(d.v)){const f=xe(d.v)?d.v:lr(d.v);if(!Xt(f)){const p={v:f,i:d.i,n:this.norm.get(f)};l.push(p)}}}}r.$[n]=l}else if(xe(a)&&!Xt(a)){const l={v:a,n:this.norm.get(a)};r.$[n]=l}}}return r}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function ei(e,t,{getFn:r=U.getFn,fieldNormWeight:n=U.fieldNormWeight}={}){const s=new Fr({getFn:r,fieldNormWeight:n});return s.setKeys(e.map(qo)),s.setSources(t),s.create(),s}function wc(e,{getFn:t=U.getFn,fieldNormWeight:r=U.fieldNormWeight}={}){const{keys:n,records:s}=e,i=new Fr({getFn:t,fieldNormWeight:r});return i.setKeys(n),i.setIndexRecords(s),i}function vc(e=[],t=U.minMatchCharLength){const r=[];let n=-1,s=-1,i=0;for(let a=e.length;i<a;i+=1){const l=e[i];l&&n===-1?n=i:!l&&n!==-1&&(s=i-1,s-n+1>=t&&r.push([n,s]),n=-1)}return e[i-1]&&i-n>=t&&r.push([n,i-1]),r}function jc(e,t,r,{location:n=U.location,distance:s=U.distance,threshold:i=U.threshold,findAllMatches:a=U.findAllMatches,minMatchCharLength:l=U.minMatchCharLength,includeMatches:c=U.includeMatches,ignoreLocation:u=U.ignoreLocation}={}){if(t.length>32)throw new Error(cc(32));const d=t.length,f=e.length,p=Math.max(0,Math.min(n,f));let h=i,m=p;const y=(x,$)=>{const T=x/d;if(u)return T;const C=Math.abs(p-$);return s?T+C/s:C?1:T},b=l>1||c,v=b?Array(f):[];let S;for(;(S=e.indexOf(t,m))>-1;){const x=y(0,S);if(h=Math.min(x,h),m=S+d,b){let $=0;for(;$<d;)v[S+$]=1,$+=1}}m=-1;let w=[],I=1,B=0,F=d+f;const N=1<<d-1;for(let x=0;x<d;x+=1){let $=0,T=F;for(;$<T;)y(x,p+T)<=h?$=T:F=T,T=Math.floor((F-$)/2+$);F=T;let C=Math.max(1,p-T+1);const P=a?f:Math.min(p+T,f)+d,z=Array(P+2);z[P+1]=(1<<x)-1;for(let G=P;G>=C;G-=1){const j=G-1,A=r[e[j]];if(z[G]=(z[G+1]<<1|1)&A,x&&(z[G]|=(w[G+1]|w[G])<<1|1|w[G+1]),z[G]&N&&(I=y(x,j),I<=h)){if(h=I,m=j,B=x,m<=p)break;C=Math.max(1,2*p-m)}}if(y(x+1,p)>h)break;w=z}if(b&&m>=0){const x=Math.min(f-1,m+d-1+B);for(let $=m;$<=x;$+=1)r[e[$]]&&(v[$]=1)}const k={isMatch:m>=0,score:Math.max(.001,I)};if(b){const x=vc(v,l);x.length?c&&(k.indices=x):k.isMatch=!1}return k}function Sc(e){const t={};for(let r=0,n=e.length;r<n;r+=1){const s=e.charAt(r);t[s]=(t[s]||0)|1<<n-r-1}return t}function zr(e){if(e.length<=1)return e;e.sort((r,n)=>r[0]-n[0]||r[1]-n[1]);const t=[e[0]];for(let r=1,n=e.length;r<n;r+=1){const s=t[t.length-1],i=e[r];i[0]<=s[1]+1?s[1]=Math.max(s[1],i[1]):t.push(i)}return t}const ti={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},Nc=new RegExp("["+Object.keys(ti).join("")+"]","g"),It=typeof String.prototype.normalize=="function"?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(Nc,t=>ti[t]):e=>e;var Hr=class{constructor(e,{location:t=U.location,threshold:r=U.threshold,distance:n=U.distance,includeMatches:s=U.includeMatches,findAllMatches:i=U.findAllMatches,minMatchCharLength:a=U.minMatchCharLength,isCaseSensitive:l=U.isCaseSensitive,ignoreDiacritics:c=U.ignoreDiacritics,ignoreLocation:u=U.ignoreLocation}={}){if(this.options={location:t,threshold:r,distance:n,includeMatches:s,findAllMatches:i,minMatchCharLength:a,isCaseSensitive:l,ignoreDiacritics:c,ignoreLocation:u},e=l?e:e.toLowerCase(),e=c?It(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const d=(p,h)=>{this.chunks.push({pattern:p,alphabet:Sc(p),startIndex:h})},f=this.pattern.length;if(f>32){let p=0;const h=f%32,m=f-h;for(;p<m;)d(this.pattern.substr(p,32),p),p+=32;if(h){const y=f-32;d(this.pattern.substr(y),y)}}else d(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:r,includeMatches:n}=this.options;if(e=t?e:e.toLowerCase(),e=r?It(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};const m={isMatch:!0,score:0};return n&&(m.indices=[[0,e.length-1]]),m}const{location:s,distance:i,threshold:a,findAllMatches:l,minMatchCharLength:c,ignoreLocation:u}=this.options,d=[];let f=0,p=!1;this.chunks.forEach(({pattern:m,alphabet:y,startIndex:b})=>{const{isMatch:v,score:S,indices:w}=jc(e,m,y,{location:s+b,distance:i,threshold:a,findAllMatches:l,minMatchCharLength:c,includeMatches:n,ignoreLocation:u});v&&(p=!0),f+=S,v&&w&&d.push(...w)});const h={isMatch:p,score:p?f/this.chunks.length:1};return p&&n&&(h.indices=zr(d)),h}};const Ac=new Set(["fuzzy","include"]);function Ec(e){return e.startsWith("inverse")}const ur=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const r=t===e;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let r=0,n;const s=[],i=e.length;for(;(n=t.indexOf(e,r))>-1;)r=n+i,s.push([n,r-1]);const a=!!s.length;return{isMatch:a,score:a?0:1,indices:s}}})},{type:"prefix-exact",multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:"prefix-exact",search(t){const r=t.startsWith(e);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const r=!t.startsWith(e);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const r=!t.endsWith(e);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const r=t.endsWith(e);return{isMatch:r,score:r?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const r=t.indexOf(e)===-1;return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const r=new Hr(e,{location:t.location??U.location,threshold:t.threshold??U.threshold,distance:t.distance??U.distance,includeMatches:t.includeMatches??U.includeMatches,findAllMatches:t.findAllMatches??U.findAllMatches,minMatchCharLength:t.minMatchCharLength??U.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??U.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??U.ignoreDiacritics,ignoreLocation:t.ignoreLocation??U.ignoreLocation});return{type:"fuzzy",search(n){return r.searchIn(n)}}}}],Ms=ur.length,$c="\0",Cc="|";function Tc(e){const t=[],r=e.length;let n=0;for(;n<r;){for(;n<r&&e[n]===" ";)n++;if(n>=r)break;let s=n;for(;s<r&&e[s]!==" "&&e[s]!=='"';)s++;if(s<r&&e[s]==='"'){for(s++;s<r;){if(e[s]==='"'){const i=s+1;if(i>=r||e[i]===" "){s++;break}if(e[i]==="$"&&(i+1>=r||e[i+1]===" ")){s+=2;break}}s++}t.push(e.substring(n,s)),n=s}else{for(;s<r&&e[s]!==" ";)s++;t.push(e.substring(n,s)),n=s}}return t}function Rs(e,t){const r=e.match(t);return r?r[1]:null}function Ic(e,t={}){return e.replace(/\\\|/g,$c).split(Cc).map(r=>{const n=Tc(r.replace(/\u0000/g,"|").trim()).filter(i=>i&&!!i.trim()),s=[];for(let i=0,a=n.length;i<a;i+=1){const l=n[i];let c=!1,u=-1;for(;!c&&++u<Ms;){const d=ur[u],f=Rs(l,d.multiRegex);f&&(s.push(d.create(f,t)),c=!0)}if(!c)for(u=-1;++u<Ms;){const d=ur[u],f=Rs(l,d.singleRegex);if(f){s.push(d.create(f,t));break}}}return s})}var Oc=class{constructor(e,{isCaseSensitive:t=U.isCaseSensitive,ignoreDiacritics:r=U.ignoreDiacritics,includeMatches:n=U.includeMatches,minMatchCharLength:s=U.minMatchCharLength,ignoreLocation:i=U.ignoreLocation,findAllMatches:a=U.findAllMatches,location:l=U.location,threshold:c=U.threshold,distance:u=U.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:r,includeMatches:n,minMatchCharLength:s,findAllMatches:a,ignoreLocation:i,location:l,threshold:c,distance:u},e=t?e:e.toLowerCase(),e=r?It(e):e,this.pattern=e,this.query=Ic(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:n,ignoreDiacritics:s}=this.options;e=n?e:e.toLowerCase(),e=s?It(e):e;let i=0;const a=[];let l=0,c=!1;for(let u=0,d=t.length;u<d;u+=1){const f=t[u];a.length=0,i=0,c=!1;for(let p=0,h=f.length;p<h;p+=1){const m=f[p],{isMatch:y,indices:b,score:v}=m.search(e);if(y)i+=1,l+=v,Ec(m.type)&&(c=!0),r&&(Ac.has(m.type)?a.push(...b):a.push(b));else{l=0,i=0,a.length=0,c=!1;break}}if(i){const p={isMatch:!0,score:l/i};return c&&(p.hasInverse=!0),r&&(p.indices=zr(a)),p}}return{isMatch:!1,score:1}}};const dr=[];function Ur(...e){dr.push(...e)}function gn(e,t){for(let r=0,n=dr.length;r<n;r+=1){const s=dr[r];if(s.condition(e,t))return new s(e,t)}return new Hr(e,t)}const xn={AND:"$and",OR:"$or"},fr={PATH:"$path",PATTERN:"$val"},pr=e=>!!(e[xn.AND]||e[xn.OR]),_c=e=>!!e[fr.PATH],Mc=e=>!Ye(e)&&Yo(e)&&!pr(e),Ps=e=>({[xn.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function ni(e,t,{auto:r=!0}={}){const n=s=>{if(xe(s)){const c={keyId:null,pattern:s};return r&&(c.searcher=gn(s,t)),c}const i=Object.keys(s),a=_c(s);if(!a&&i.length>1&&!pr(s))return n(Ps(s));if(Mc(s)){const c=a?s[fr.PATH]:i[0],u=a?s[fr.PATTERN]:s[c];if(!xe(u))throw new Error(lc(c));const d={keyId:un(c),pattern:u};return r&&(d.searcher=gn(u,t)),d}const l={children:[],operator:i[0]};return i.forEach(c=>{const u=s[c];Ye(u)&&u.forEach(d=>{l.children.push(n(d))})}),l};return pr(e)||(e=Ps(e)),n(e)}function hr(e,{ignoreFieldNorm:t=U.ignoreFieldNorm}){let r=1;return e.forEach(({key:n,norm:s,score:i})=>{const a=n?n.weight:null;r*=Math.pow(i===0&&a?Number.EPSILON:i,(a||1)*(t?1:s))}),r}function Rc(e,{ignoreFieldNorm:t=U.ignoreFieldNorm}){e.forEach(r=>{r.score=hr(r.matches,{ignoreFieldNorm:t})})}var Pc=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):this.comparator(e,this.heap[0])<0&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(){return this.heap.sort(this.comparator)}_bubbleUp(e){const t=this.heap;for(;e>0;){const r=e-1>>1;if(this.comparator(t[e],t[r])<=0)break;const n=t[e];t[e]=t[r],t[r]=n,e=r}}_sinkDown(e){const t=this.heap,r=t.length;let n=e;do{e=n;const s=2*e+1,i=2*e+2;if(s<r&&this.comparator(t[s],t[n])>0&&(n=s),i<r&&this.comparator(t[i],t[n])>0&&(n=i),n!==e){const a=t[e];t[e]=t[n],t[n]=a}}while(n!==e)}};function Lc(e){const t=[];return e.matches.forEach(r=>{if(!Ae(r.indices)||!r.indices.length)return;const n={indices:r.indices,value:r.value};r.key&&(n.key=r.key.id),r.idx>-1&&(n.refIndex=r.idx),t.push(n)}),t}function Bc(e,t,{includeMatches:r=U.includeMatches,includeScore:n=U.includeScore}={}){return e.map(s=>{const{idx:i}=s,a={item:t[i],refIndex:i};return r&&(a.matches=Lc(s)),n&&(a.score=s.score),a})}const Dc=/[\p{L}\p{M}\p{N}_]+/gu,Ls=new WeakSet;function Fc(e){Ls.has(e)||(Ls.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function zc(e){if(typeof e=="function"){let t=!1;return r=>{const n=e(r);if(!t&&(t=!0,!Array.isArray(n)||n.some(s=>typeof s!="string")))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(n)?"array containing non-strings":typeof n}.`);return n}}return e instanceof RegExp?(e.global||Fc(e),t=>t.match(e)||[]):t=>t.match(Dc)||[]}function mr({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:r}={}){const n=zc(r);return{tokenize(s){return e||(s=s.toLowerCase()),t&&(s=It(s)),n(s)}}}var Hc=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=mr({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const r=this.analyzer.tokenize(e),{df:n,fieldCount:s}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const i of r){this.termSearchers.push(new Hr(i,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const a=n.get(i)||0,l=Math.log(1+(s-a+.5)/(a+.5));this.idfWeights.push(l)}this.combineAll=t.tokenMatch==="all",this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let r=0,n=0,s=0,i=0;const a=this.combineAll&&!this.useMask?new Set:null;for(let u=0;u<this.termSearchers.length;u++){const d=this.termSearchers[u].searchIn(e),f=this.idfWeights[u];n+=f,d.isMatch&&(s++,r+=f*(1-d.score),d.indices&&t.push(...d.indices),this.combineAll&&(this.useMask?i|=1<<u:a.add(u)))}if(s===0)return{isMatch:!1,score:1};const l=n>0?1-r/n:0,c={isMatch:!0,score:Math.max(.001,l)};return this.options.includeMatches&&t.length&&(c.indices=zr(t)),this.combineAll&&(this.useMask?c.matchedMask=i:c.matchedTerms=a,c.termCount=this.numTerms),c}};function Kn(e,t,r,n){const s=n.tokenize(t);if(!s.length)return;e.fieldCount++,e.docFieldCount.set(r,(e.docFieldCount.get(r)||0)+1);const i=new Set(s);let a=e.docTermFieldHits.get(r);a||(a=new Map,e.docTermFieldHits.set(r,a));for(const l of i)a.set(l,(a.get(l)||0)+1),e.df.set(l,(e.df.get(l)||0)+1)}function ri(e,t,r,n){const{i:s,v:i,$:a}=t;if(i!==void 0){Kn(e,i,s,n);return}if(a)for(let l=0;l<r;l++){const c=a[l];if(c)if(Array.isArray(c))for(const u of c)Kn(e,u.v,s,n);else Kn(e,c.v,s,n)}}function Uc(e,t,r){const n={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const s of e)ri(n,s,t,r);return n}function Wc(e,t,r,n){ri(e,t,r,n)}function Kc(e,t){const r=e.docFieldCount.get(t);if(r===void 0)return;e.fieldCount-=r,e.docFieldCount.delete(t);const n=e.docTermFieldHits.get(t);if(n){for(const[s,i]of n){const a=(e.df.get(s)||0)-i;a<=0?e.df.delete(s):e.df.set(s,a)}e.docTermFieldHits.delete(t)}}function Bs(e,t){if(t.length===0)return;const r=Array.from(new Set(t)).sort((l,c)=>l-c);for(const l of r)Kc(e,l);const n=l=>{let c=0,u=r.length;for(;c<u;){const d=c+u>>>1;r[d]<l?c=d+1:u=d}return l-c},s=r[0],i=new Map;for(const[l,c]of e.docFieldCount)i.set(l>s?n(l):l,c);e.docFieldCount=i;const a=new Map;for(const[l,c]of e.docTermFieldHits)a.set(l>s?n(l):l,c);e.docTermFieldHits=a}var Qe=class{constructor(e,t,r){this.options={...U,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new pc(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,r),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const t=gn(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Fr))throw new Error(ac);if(this._myIndex=t||ei(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const r=mr({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Uc(this._myIndex.records,this._myIndex.keys.length,r)}this._invalidateSearcherCache()}add(e){if(!Ae(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const r=mr({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});Wc(this._invertedIndex,t,this._myIndex.keys.length,r)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],r=[];for(let n=0,s=this._docs.length;n<s;n+=1)e(this._docs[n],n)&&(t.push(this._docs[n]),r.push(n));if(r.length){this._invertedIndex&&Bs(this._invertedIndex,r);const n=new Set(r);this._docs=this._docs.filter((s,i)=>!n.has(i)),this._myIndex.removeAll(r),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(cr);this._invertedIndex&&Bs(this._invertedIndex,[e]);const t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){const{limit:r=-1}=t||{},{includeMatches:n,includeScore:s,shouldSort:i,sortFn:a,ignoreFieldNorm:l}=this.options;if(xe(e)&&!e.trim()){let p=this._docs.map((h,m)=>({item:h,refIndex:m}));return cn(r)&&r>-1&&(p=p.slice(0,r)),p}const c=i&&cn(r)&&r>0&&xe(e),u=a,d=(p,h)=>u(p,h)||p.idx-h.idx;let f;if(c){const p=new Pc(r,d);xe(this._docs[0])?this._searchStringList(e,{heap:p,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:p,ignoreFieldNorm:l}),f=p.extractSorted()}else f=xe(e)?xe(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Rc(f,{ignoreFieldNorm:l}),i&&f.sort(xe(e)?d:u),cn(r)&&r>-1&&(f=f.slice(0,r));return Bc(f,this._docs,{includeMatches:n,includeScore:s})}_searchStringList(e,{heap:t,ignoreFieldNorm:r}={}){const n=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:i}=this._myIndex,a=t?null:[];return i.forEach(({v:l,i:c,n:u})=>{if(!Ae(l))return;const d=n.searchIn(l);if(d.isMatch){const f={score:d.score,value:l,norm:u,indices:d.indices};s&&(f.matchedMask=d.matchedMask,f.matchedTerms=d.matchedTerms,f.termCount=d.termCount);const p=[f];if(!s||this._coversAllTokens(p)){const h={item:l,idx:c,matches:p};t?(h.score=hr(h.matches,{ignoreFieldNorm:r}),t.insert(h)):a.push(h)}}}),a}_searchLogical(e){const t=ni(e,this.options),r=this._normalizedKeys(),n=(l,c,u)=>{if(!("children"in l)){const{keyId:h,searcher:m}=l;let y;return h===null?(y=[],r.forEach((b,v)=>{y.push(...this._findMatches({key:b,value:c[v],searcher:m}))})):y=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(c,h),searcher:m}),y&&y.length?[{idx:u,item:c,matches:y}]:[]}const{children:d,operator:f}=l,p=[];for(let h=0,m=d.length;h<m;h+=1){const y=d[h],b=n(y,c,u);if(b.length)p.push(...b);else if(f===xn.AND)return[]}return p},s=this._myIndex.records,i=new Map,a=[];return s.forEach(({$:l,i:c})=>{if(Ae(l)){const u=n(t,l,c);u.length&&(i.has(c)||(i.set(c,{idx:c,item:l,matches:[]}),a.push(i.get(c))),u.forEach(({matches:d})=>{i.get(c).matches.push(...d)}))}}),a}_searchObjectList(e,{heap:t,ignoreFieldNorm:r}={}){const n=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:i}=this._myIndex,a=this._normalizedKeys(),l=t?null:[];return i.forEach(({$:c,i:u})=>{if(!Ae(c))return;const d=[];let f=!1,p=!1;if(a.forEach((h,m)=>{const y=this._findMatches({key:h,value:c[m],searcher:n});y.length?(d.push(...y),y[0].hasInverse&&(p=!0)):f=!0}),!(p&&f)&&d.length&&(!s||this._coversAllTokens(d))){const h={idx:u,item:c,matches:d};t?(h.score=hr(h.matches,{ignoreFieldNorm:r}),t.insert(h)):l.push(h)}}),l}_findMatches({key:e,value:t,searcher:r}){if(!Ae(t))return[];const n=[];if(Ye(t))t.forEach(({v:s,i,n:a})=>{if(!Ae(s))return;const l=r.searchIn(s);if(l.isMatch){const c={score:l.score,key:e,value:s,idx:i,norm:a,indices:l.indices,hasInverse:l.hasInverse};l.termCount!==void 0&&(c.matchedMask=l.matchedMask,c.matchedTerms=l.matchedTerms,c.termCount=l.termCount),n.push(c)}});else{const{v:s,n:i}=t,a=r.searchIn(s);if(a.isMatch){const l={score:a.score,key:e,value:s,norm:i,indices:a.indices,hasInverse:a.hasInverse};a.termCount!==void 0&&(l.matchedMask=a.matchedMask,l.matchedTerms=a.matchedTerms,l.termCount=a.termCount),n.push(l)}}return n}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let n=0;for(let s=0;s<e.length;s++)n|=e[s].matchedMask||0;return n===2**t-1}const r=new Set;for(let n=0;n<e.length;n++){const s=e[n].matchedTerms;if(s)for(const i of s)r.add(i)}return r.size===t}};Qe.version="7.5.0";Qe.createIndex=ei;Qe.parseIndex=wc;Qe.config=U;Qe.match=function(e,t,r){if(r&&r.useTokenSearch)throw new Error(fc);return gn(e,{...U,...r}).searchIn(t)};Qe.parseQuery=ni;Ur(Oc);Ur(Hc);Qe.use=function(...e){e.forEach(t=>Ur(t))};var Gc=Qe;function si(e,t,r={}){const[n,s]=g.useState(""),[i,a]=g.useState(""),l=r.debounceMs??150;g.useEffect(()=>{const f=setTimeout(()=>a(n),l);return()=>clearTimeout(f)},[n,l]);const c=g.useMemo(()=>t(e),[e,t]),u=g.useMemo(()=>new Gc(c,{keys:[{name:"name",weight:2},{name:"text",weight:1}],threshold:r.threshold??.3,ignoreLocation:!0,ignoreFieldNorm:!0,includeScore:!0}),[c,r.threshold]),d=g.useMemo(()=>i.trim()?u.search(i.trim(),{limit:r.limit??20}).map(f=>f.item):[],[u,i,r.limit]);return{query:n,setQuery:s,results:d,searchIndex:c}}function Vc(e,t={}){return si(e,rc,t)}const gr="search-match",oi=()=>typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u";function Jc(e,t){const r=t.trim().toLowerCase();if(!r)return[];const n=[],s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let i=s.nextNode();i;i=s.nextNode()){const a=(i.textContent??"").toLowerCase();let l=0;for(let c=a.indexOf(r);c!==-1;c=a.indexOf(r,l)){const u=document.createRange();u.setStart(i,c),u.setEnd(i,c+r.length),n.push(u),l=c+r.length}}return n}function Zc(e,t){if(!oi())return;const r=Jc(e,t);if(!r.length){CSS.highlights.delete(gr);return}CSS.highlights.set(gr,new Highlight(...r))}function Gn(){oi()&&CSS.highlights.delete(gr)}function Xc(e,t){const r=g.useRef(null);g.useEffect(()=>{if(!e)return;const{targetId:n,query:s,highlight:i}=e;let a=!1;const l=u=>{if(a)return;const d=document.getElementById(n);if(!d){u<40&&setTimeout(()=>l(u+1),50);return}if(r.current!==n){try{d.scrollIntoView({behavior:"smooth",block:"start"})}catch{}r.current=n}i&&c(0)},c=u=>{if(a)return;const d=document.getElementById(n);d&&Zc(d,s),u<6&&setTimeout(()=>c(u+1),100)};return setTimeout(()=>l(0),50),()=>{a=!0}},[e,...t])}function ii({tabs:e,defaultTab:t,isTabKey:r,sections:n,searchQuery:s}){var T;const i=((T=e[0])==null?void 0:T.id)??t,[a,l]=g.useState(i),[c,u]=g.useState(null),d=C=>{l(C),u(C)},[f,p]=g.useState({}),h=e.some(C=>C.id===a)?a:i,m={};for(const C of n)m[C.id]=C.visible?f[C.id]??null:null;const y=(C,P)=>p(z=>({...z,[C]:P})),[b,v]=g.useState(null),[S,w]=g.useState(null),[I,B]=g.useState(null),F=C=>{r(C.tab)?d(C.tab):C.tab==="servers"&&u("servers");const P={};for(const z of n)P[z.id]=z.id===C.tab?C.key:null;p(P),v(C.focusSection??null),w(C.tab==="schemas"&&C.schemaFocusTokens?{tokens:C.schemaFocusTokens,id:C.targetId}:null),C.tab==="schemas"&&Gn(),B({targetId:C.targetId,query:s,highlight:C.tab!=="schemas"})},N=(C,P)=>{d(C),p(z=>{const G={...z};for(const j of n)j.id!=="servers"&&(G[j.id]=j.id===C?P:null);return G})},k=C=>{u("servers");const P={};for(const z of n)P[z.id]=z.id==="servers"?C:null;p(P)},x=C=>{r(C)&&d(C)},$=(()=>{for(const C of n){const P=m[C.id];if(P)return{tab:C.id,key:P}}return null})();return Xc(I,[h,b,S,...n.map(C=>m[C.id])]),g.useEffect(()=>{s.trim()||(B(null),Gn())},[s]),g.useEffect(()=>Gn,[]),{effectiveTab:h,focusTab:d,navActiveSection:c??h,selected:m,setSelectedKey:y,selectedNavItem:$,handleSearchSelect:F,handleNavItemSelect:N,handleNavServerSelect:k,handleContentTabChange:x,focusSection:b,schemaFocusTarget:S}}const K=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),De=e=>K(e)?e:null,Ds="^[\0-ÿ]*$",Yc=Math.pow(-2,31),Qc=Math.pow(2,31)-1,qc=Math.pow(-2,63),eu=Math.pow(2,63)-1,tu={null:"null",boolean:"boolean",int:"integer",long:"integer",float:"number",double:"number",bytes:"string",string:"string",fixed:"string",map:"object",array:"array",enum:"string",record:"object",uuid:"string"},Wr=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};function Ot(e){const t=Wr(e);if(typeof t.name=="string")return typeof t.namespace=="string"?`${t.namespace}.${t.name}`:t.name}function xr(e,t,r){e.doc&&(t.description=e.doc),e.default!==void 0&&(t.default=e.default);const n=Ot(e);n!==void 0&&r[n]&&(t["x-parser-schema-id"]=n)}function Fs(e,t,r){!(Array.isArray(e.type)&&e.type.includes("null"))&&!r&&(t.required=t.required||[],t.required.push(e.name))}function nu(e,t){let r=e,n=t;if(Array.isArray(e)&&e.length>0){const s=e.length>1&&e[0]==="null";r=e[+s],n.oneOf!==void 0&&(n=n.oneOf[0])}return{type:r,jsonSchema:n}}function ru(e,t,r){if(!(t===void 0||r.examples||Array.isArray(e)))switch(e){case"boolean":r.examples=[typeof t=="boolean"?t:t==="true"];break;case"int":r.examples=[parseInt(t,10)];break;default:r.examples=[t]}}function br(e){return Object.keys(e).some(t=>t!=="type"&&t!=="name"&&t!=="namespace")}function yr(e,t,r){const{type:n,jsonSchema:s}=nu(e,r);ru(n,t.example,s);function i(...a){a.forEach(l=>{let c=!0;l==="minLength"||l==="maxLength"?c=t[l]>-1:l==="multipleOf"&&(c=t[l]>0),t[l]!==void 0&&c&&(s[l]=t[l])})}switch(n){case"int":case"long":case"float":case"double":i("minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf");break;case"string":t.logicalType&&(s.format=t.logicalType),i("pattern","minLength","maxLength");break;case"array":i("minItems","maxItems","uniqueItems");break}}function Kr(e,t,r){t!==void 0&&(e[t]=r)}function _t(e,t){let r={};if(Array.isArray(e))return ou(r,e,t);const n=Wr(e),s=typeof e=="string"?e:n.type;switch(r.type=tu[s],s){case"int":{r.minimum=Yc,r.maximum=Qc;break}case"long":{r.minimum=qc,r.maximum=eu;break}case"bytes":{r.pattern=Ds;break}case"fixed":{r.pattern=Ds,r.minLength=n.size,r.maxLength=n.size;break}case"map":{r.additionalProperties=_t(n.values,t);break}case"array":{r.items=_t(n.items,t);break}case"enum":{r.enum=n.symbols;break}case"float":case"double":{r.format=s;break}case"record":{const i=su(n,t,r);Kr(t,Ot(e),r),r.properties=Object.fromEntries(i.entries());break}default:{const i=t[Ot(e)]??(typeof s=="string"?t[s]:void 0);i&&(r=br(n)?{...i}:i);break}}return xr(n,r,t),yr(s,n,r),r}function su(e,t,r){const n=new Map;for(const s of e.fields??[]){const i=typeof s.type=="string"?t[s.type]:void 0;if(i){const a=br(s)?{...i}:i;Fs(s,r,s.default!==void 0),br(s)&&(xr(s,a,t),yr(s.type,s,a)),n.set(s.name,a)}else{const a=_t(s.type,t);Fs(s,r,s.default!==void 0),xr(s,a,t),yr(s.type,s,a),n.set(s.name,a),Kr(t,Ot(s.type),a)}}return n}function ou(e,t,r){const n=[];let s=null;for(const i of t){const a=_t(i,r);(typeof i=="string"?i:Wr(i).type)==="null"?s=a:(n.push(a),Kr(r,Ot(i),a))}return s&&n.push(s),e.oneOf=n,e}function kr(e){return _t(e,{})}const zs=new Set(["null","boolean","int","long","float","double","bytes","string","uuid"]),iu=new Set(["record","enum","array","map","fixed"]),Hs=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;function Gr(e){const t=[];return ut(e,"schema",t,new Set),t}function ut(e,t,r,n){if(typeof e=="string"){!zs.has(e)&&!Hs.test(e)&&r.push(`${t}: "${e}" is not a valid Avro type name`);return}if(Array.isArray(e)){e.length===0&&r.push(`${t}: union must have at least one alternative`),e.forEach((i,a)=>ut(i,`${t}[${a}]`,r,n));return}if(!K(e)){r.push(`${t}: expected an Avro type string, object, or union`);return}if(n.has(e))return;n.add(e);const s=e.type;if(typeof s!="string"){Array.isArray(s)||K(s)?ut(s,`${t}.type`,r,n):r.push(`${t}: missing "type"`);return}if(!zs.has(s)&&!iu.has(s)&&!Hs.test(s)){r.push(`${t}: unknown Avro type "${s}"`);return}switch(s){case"record":{if(!Array.isArray(e.fields)){r.push(`${t}: record must have a "fields" array`);return}e.fields.forEach((i,a)=>{const l=`${t}.fields[${a}]`;if(!K(i)||typeof i.name!="string"){r.push(`${l}: field must have a string "name"`);return}ut(i.type,`${l}.type`,r,n)});break}case"enum":{const i=e.symbols;(!Array.isArray(i)||i.some(a=>typeof a!="string"))&&r.push(`${t}: enum must have a "symbols" array of strings`);break}case"array":{e.items===void 0?r.push(`${t}: array must have "items"`):ut(e.items,`${t}.items`,r,n);break}case"map":{e.values===void 0?r.push(`${t}: map must have "values"`):ut(e.values,`${t}.values`,r,n);break}case"fixed":{typeof e.size!="number"&&r.push(`${t}: fixed must have a numeric "size"`);break}}}let bn=null,Vn=null;const wr=new Set;function au(){return Vn||(Vn=Promise.resolve().then(()=>require("./protoToJsonSchema-DAbk8Ysk.cjs")).then(e=>{bn=e.protoToJsonSchema,wr.forEach(t=>t())})),Vn}function lu(){return bn||au(),bn}function cu(e){return wr.add(e),()=>wr.delete(e)}function Us(){return bn!==null}function Vr(){return g.useSyncExternalStore(cu,Us,Us)}const uu="x-parser-original-payload",yn="x-lib-conversion-error",du=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,fu=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function Bt(e){return typeof e=="string"&&du.test(e)}function Dt(e){return typeof e=="string"&&fu.test(e)}function ai(e){return K(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function li(e){var t,r;if(typeof e!="string")return null;if(Bt(e)){const n=(t=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:t[1];return n?`avro ${n}`:"avro"}if(Dt(e)){const n=(r=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:r[1];return n?`protobuf ${n}`:"protobuf"}return e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")?null:e}function ci(e){return Bt(e)?"Avro":Dt(e)?"Protobuf":null}function pu(e,t){return t?!1:!e||Bt(e)||Dt(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const hu=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],mu=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function gu(e){return typeof e=="string"||Array.isArray(e)?!0:K(e)?typeof e.type=="string"&&mu.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!hu.some(t=>t in e):!1}function Mt(e,t){let r=e;if(t&&K(r)&&typeof r.$ref=="string"){const a=t(r.$ref);a!==void 0&&(r=a)}const n=xu(r),s=n.schema.description;if(typeof s=="string")return{...n,description:s};const i=ai(r)?r.description:void 0;return typeof i=="string"?{...n,description:i}:n}function xu(e){var a;if(!ai(e))return{schema:De(e)??e};const{schemaFormat:t}=e,r=e.schema,n=e[uu],s=(a=De(r))==null?void 0:a[yn];if(typeof s=="string")return{schema:De(n)??{},schemaFormat:t,originalSchema:n,conversionError:s};if(n!==void 0)return{schema:De(r)??{},schemaFormat:t,originalSchema:n};if(Bt(t)&&gu(r)){const l=Gr(r);if(l.length>0)return{schema:De(r)??{},schemaFormat:t,originalSchema:r,conversionError:l[0]};try{return{schema:kr(r),schemaFormat:t,originalSchema:r}}catch(c){return{schema:De(r)??{},schemaFormat:t,originalSchema:r,conversionError:c instanceof Error?c.message:"Failed to convert Avro schema"}}}if(Dt(t)&&typeof r=="string"){const l=lu();if(!l)return{schema:{},schemaFormat:t,originalSchema:r,pendingConversion:!0};try{return{schema:l(r),schemaFormat:t,originalSchema:r}}catch(c){return{schema:{},schemaFormat:t,originalSchema:r,conversionError:c instanceof Error?c.message:"Failed to convert Protobuf schema"}}}const i=De(r);return i?{schema:i,schemaFormat:t}:{schema:{},schemaFormat:t,originalSchema:r}}const ce=(e,t)=>`${"#".repeat(e)} ${t}`,_=e=>typeof e=="string"?e.replace(/`/g,"'"):String(e??""),vt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),bu={objects:new Set,refs:new Set};function dn(e,t,r=bu){if(e===null||typeof e!="object")return e;if(r.objects.has(e)||vt(e)&&typeof e.$ref=="string"&&r.refs.has(e.$ref)){const i=vt(e)?e["x-parser-schema-id"]:void 0;return typeof i=="string"?{$ref:`#/components/schemas/${i} (circular)`}:"[circular reference]"}const n={objects:new Set(r.objects).add(e),refs:vt(e)&&typeof e.$ref=="string"?new Set(r.refs).add(e.$ref):r.refs};if(Array.isArray(e))return e.map(i=>dn(i,t,n));if(vt(e)&&typeof e.$ref=="string"){const i=t==null?void 0:t(e.$ref);return vt(i)||Array.isArray(i)?dn(i,t,n):{$ref:e.$ref}}const s={};for(const[i,a]of Object.entries(e))s[i]=dn(a,t,n);return s}function kn(e,t,r){if(!t)return"";const n=dn(t,r);return`${ce(4,`\`${_(e)}\``)}
|
|
7
|
+
|
|
8
|
+
\`\`\`json
|
|
9
|
+
${JSON.stringify(n,null,2)}
|
|
10
|
+
\`\`\``}function Et(e,t,r){if(!t||typeof t=="boolean")return"";const{schema:n,description:s,conversionError:i,pendingConversion:a}=Mt(t,r);if(a)return`${ce(4,`\`${_(e)}\``)}
|
|
11
|
+
|
|
12
|
+
_(schema conversion still in progress)_`;if(i)return`${ce(4,`\`${_(e)}\``)}
|
|
13
|
+
|
|
14
|
+
_(could not convert schema: ${_(i)})_`;const l=s&&!n.description?{...n,description:s}:n;return kn(e,l,r)}function ui(e){var t;switch(e.type){case"apiKey":case"httpApiKey":return`API Key (${_(e.in)}${e.name?`: \`${_(e.name)}\``:""})`;case"http":return((t=e.scheme)==null?void 0:t.toLowerCase())==="basic"?"HTTP Basic":`HTTP Bearer${e.bearerFormat?` (format: ${_(e.bearerFormat)})`:""}`;case"openIdConnect":return"OpenID Connect";case"oauth2":return"OAuth2";case"mutualTLS":return"Mutual TLS";case"X509":return"X.509 Certificate";case"userPassword":return"User / Password";case"plain":case"scramSha256":case"scramSha512":return"SASL";case"gssapi":return"SASL (GSSAPI)";case"symmetricEncryption":return"Symmetric Encryption";case"asymmetricEncryption":return"Asymmetric Encryption";default:return _(e.type)}}function yu(e){if(!(e!=null&&e.length))return"";const t=[];for(const r of e)if(r!=null&&r.type&&(t.push(`- **${ui(r)}**`),r.description&&t.push(` ${_(r.description)}`),r.type==="openIdConnect"&&r.openIdConnectUrl&&t.push(` - OpenID Connect URL: \`${_(r.openIdConnectUrl)}\``),r.type==="oauth2"))for(const[n,s]of Object.entries(r.flows??{})){t.push(` - Flow \`${_(n)}\`:`),s.authorizationUrl&&t.push(` - Authorization URL: \`${_(s.authorizationUrl)}\``),s.tokenUrl&&t.push(` - Token URL: \`${_(s.tokenUrl)}\``),s.refreshUrl&&t.push(` - Refresh URL: \`${_(s.refreshUrl)}\``);const i=Object.keys(s.availableScopes??s.scopes??{});i.length&&t.push(` - Available scopes: ${i.map(a=>`\`${_(a)}\``).join(", ")}`)}return t.length?["**Authorization:**",t.join(`
|
|
15
|
+
`)].join(`
|
|
16
|
+
|
|
17
|
+
`):""}function di(e){const t=[],{info:r}=e;t.push(ce(1,_(r.title)));const n=[`**Version:** ${_(r.version)}`];if(r.license&&n.push(`**License:** ${_(r.license.name)}${r.license.url?` (${_(r.license.url)})`:""}`),r.contact){const s=[r.contact.name,r.contact.email].filter(Boolean).map(_).join(" ");s&&n.push(`**Contact:** ${s}`)}if(t.push(n.join(`
|
|
18
|
+
`)),r.description&&t.push(_(r.description)),e.servers&&Object.keys(e.servers).length){const s=[ce(2,"Servers")];for(const[i,a]of Object.entries(e.servers)){s.push(ce(3,_(i)));const l=[`**Host:** \`${_(a.host)}${a.pathname?_(a.pathname):""}\``];l.push(`**Protocol:** ${_(a.protocol)}${a.protocolVersion?` ${_(a.protocolVersion)}`:""}`),a.description&&l.push(_(a.description)),s.push(l.join(`
|
|
19
|
+
`));const c=yu(a.security);c&&s.push(c)}t.push(s.join(`
|
|
20
|
+
|
|
21
|
+
`))}return t}function Jr(e,t=Lt(e)){var i,a,l;const r=di(e);if(e.operations&&Object.keys(e.operations).length){const c=[ce(2,"Operations")];for(const[u,d]of Object.entries(e.operations)){const f=d.channel;c.push(ce(3,`${_((i=d.action)==null?void 0:i.toUpperCase())} \`${_(u)}\``));const p=[];f!=null&&f.address&&p.push(`**Channel:** \`${_(f.address)}\``),d.summary&&p.push(_(d.summary)),d.description&&p.push(_(d.description));const h=d.messages??[];h.length&&p.push(`**Messages:** ${h.map(m=>`\`${_(m.name??m.title??"message")}\``).join(", ")}`),c.push(p.join(`
|
|
22
|
+
|
|
23
|
+
`))}r.push(c.join(`
|
|
24
|
+
|
|
25
|
+
`))}const n=(a=e.components)==null?void 0:a.messages;if(n&&Object.keys(n).length){const c=[ce(2,"Messages")];for(const[u,d]of Object.entries(n)){c.push(ce(3,_(d.title??d.name??u)));const f=[];d.summary&&f.push(_(d.summary)),d.description&&f.push(_(d.description)),d.contentType&&f.push(`**Content-Type:** \`${_(d.contentType)}\``),c.push(f.join(`
|
|
26
|
+
|
|
27
|
+
`)),d.payload&&c.push(Et("payload",d.payload,t)),d.headers&&c.push(Et("headers",d.headers,t))}r.push(c.join(`
|
|
28
|
+
|
|
29
|
+
`))}const s=(l=e.components)==null?void 0:l.schemas;if(s&&Object.keys(s).length){const c=[ce(2,"Schemas")];for(const[u,d]of Object.entries(s))c.push(Et(u,d,t));r.push(c.join(`
|
|
30
|
+
|
|
31
|
+
`))}return r.filter(Boolean).join(`
|
|
32
|
+
|
|
33
|
+
`)}function ku(e,t,r){var l;const n=t.channel,s=[ce(3,`${_((l=t.action)==null?void 0:l.toUpperCase())} \`${_(e)}\``)],i=[];n!=null&&n.address&&i.push(`**Channel:** \`${_(n.address)}\``),t.summary&&i.push(_(t.summary)),t.description&&i.push(_(t.description)),s.push(i.join(`
|
|
34
|
+
|
|
35
|
+
`));const a=t.messages??[];for(const c of a){const u=[ce(4,_(c.title??c.name??"Message"))],d=[];c.summary&&d.push(_(c.summary)),c.description&&d.push(_(c.description)),c.contentType&&d.push(`**Content-Type:** \`${_(c.contentType)}\``),d.length&&u.push(d.join(`
|
|
36
|
+
|
|
37
|
+
`)),s.push(u.join(`
|
|
38
|
+
|
|
39
|
+
`)),c.payload&&s.push(Et("payload",c.payload,r)),c.headers&&s.push(Et("headers",c.headers,r))}return s.filter(Boolean).join(`
|
|
40
|
+
|
|
41
|
+
`)}function fi(e,t,r=Lt(e)){var i;const n=(i=e.operations)==null?void 0:i[t];if(!n)return"";const s=di(e);return s.push(ku(t,n,r)),s.filter(Boolean).join(`
|
|
42
|
+
|
|
43
|
+
`)}function wu(e,t){if(!e.length||!t)return"";const r=new Map;for(const i of e)for(const[a,l]of Object.entries(i)){if(!l.length)continue;const c=r.get(a)??[];r.set(a,Array.from(new Set([...c,...l])))}const n=Array.from(new Set(e.flatMap(i=>Object.keys(i)))),s=[];for(const i of n){const a=t[i];if(!a)continue;const l=r.get(i);if(s.push(`- **${ui(a)}** (\`${_(i)}\`)`),a.description&&s.push(` ${_(a.description)}`),a.type==="openIdConnect"&&a.openIdConnectUrl&&s.push(` - OpenID Connect URL: \`${_(a.openIdConnectUrl)}\``),a.type==="oauth2")for(const[c,u]of Object.entries(a.flows??{})){s.push(` - Flow \`${_(c)}\`:`),u.authorizationUrl&&s.push(` - Authorization URL: \`${_(u.authorizationUrl)}\``),u.tokenUrl&&s.push(` - Token URL: \`${_(u.tokenUrl)}\``),u.refreshUrl&&s.push(` - Refresh URL: \`${_(u.refreshUrl)}\``);const d=l!=null&&l.length?l:Object.keys(u.scopes??{});d.length&&s.push(` - ${l!=null&&l.length?"Required scopes":"Scopes"}: ${d.map(f=>`\`${_(f)}\``).join(", ")}`)}else l!=null&&l.length&&s.push(` - Required scopes: ${l.map(c=>`\`${_(c)}\``).join(", ")}`)}return s.length?["**Authorization:**",s.join(`
|
|
44
|
+
`)].join(`
|
|
45
|
+
|
|
46
|
+
`):""}function pi(e,t,r,n,s,i){var p;const a=[ce(3,`${e.toUpperCase()} \`${_(t)}\``)],l=[];r.summary&&l.push(_(r.summary)),r.description&&l.push(_(r.description)),r.deprecated&&l.push("**Deprecated**");const c=r.security??i??[],u=wu(c,s);u&&l.push(u);for(const h of["path","query","header","cookie"]){const m=(r.parameters??[]).filter(y=>y.in===h);if(m.length){l.push(`**${h[0].toUpperCase()}${h.slice(1)} Parameters:**`);for(const y of m){const b=y.schema;l.push(`- \`${_(y.name)}\`${y.required?" (required)":""}${b!=null&&b.type?` — ${_(b.type)}`:""}${y.description?`: ${_(y.description)}`:""}`)}}}a.push(l.join(`
|
|
47
|
+
|
|
48
|
+
`));const d=((p=r.requestBody)==null?void 0:p.content)??{};for(const[h,m]of Object.entries(d))a.push([`**Request Body** (\`${_(h)}\`)`,kn("body",m.schema,n)].join(`
|
|
49
|
+
|
|
50
|
+
`));const f=r.responses??{};for(const[h,m]of Object.entries(f)){const y=[ce(4,`${h}${m.description?`: ${_(m.description)}`:""}`)];for(const[b,v]of Object.entries(m.content??{}))y.push([`**Body** (\`${_(b)}\`)`,kn("body",v.schema,n)].join(`
|
|
51
|
+
|
|
52
|
+
`));a.push(y.join(`
|
|
53
|
+
|
|
54
|
+
`))}return a.join(`
|
|
55
|
+
|
|
56
|
+
`)}function Zr(e,t=Lt(e)){var a,l,c,u,d;const r=[],{info:n}=e;if(r.push(ce(1,_(n.title))),r.push(`**Version:** ${_(n.version)}`),n.description&&r.push(_(n.description)),(a=e.servers)!=null&&a.length){const f=[ce(2,"Servers")];for(const p of e.servers)f.push(`- \`${_(p.url)}\`${p.description?` — ${_(p.description)}`:""}`);r.push(f.join(`
|
|
57
|
+
`))}const s=e.paths?Tt(e.paths):[];if(s.length){const f=[ce(2,"Endpoints")];for(const{method:p,path:h}of s){const m=(c=(l=e.paths)==null?void 0:l[h])==null?void 0:c[p];m&&f.push(pi(p,h,m,t,(u=e.components)==null?void 0:u.securitySchemes,e.security))}r.push(f.join(`
|
|
58
|
+
|
|
59
|
+
`))}const i=(d=e.components)==null?void 0:d.schemas;if(i&&Object.keys(i).length){const f=[ce(2,"Schemas")];for(const[p,h]of Object.entries(i))f.push(kn(p,h,t));r.push(f.join(`
|
|
60
|
+
|
|
61
|
+
`))}return r.filter(Boolean).join(`
|
|
62
|
+
|
|
63
|
+
`)}function hi(e,t,r,n=Lt(e)){var l,c,u,d;const s=(c=(l=e.paths)==null?void 0:l[r])==null?void 0:c[t];if(!s)return"";const i=[],{info:a}=e;if(i.push(ce(1,_(a.title))),i.push(`**Version:** ${_(a.version)}`),a.description&&i.push(_(a.description)),(u=e.servers)!=null&&u.length){const f=[ce(2,"Servers")];for(const p of e.servers)f.push(`- \`${_(p.url)}\`${p.description?` — ${_(p.description)}`:""}`);i.push(f.join(`
|
|
64
|
+
`))}return i.push(pi(t,r,s,n,(d=e.components)==null?void 0:d.securitySchemes,e.security)),i.filter(Boolean).join(`
|
|
65
|
+
|
|
66
|
+
`)}const vu=/^(https?:|data:image\/)/i;function Xr(e){const t=typeof e=="string";if(!t&&(typeof e!="object"||e===null))return null;const{url:r,altText:n,backgroundColor:s}=t?{url:e,altText:void 0,backgroundColor:void 0}:e;return typeof r!="string"||!vu.test(r)?null:{url:r,altText:typeof n=="string"&&n?n:void 0,backgroundColor:typeof s=="string"?s:void 0}}const mi={"x-x":()=>Promise.resolve().then(()=>require("./XExtension-jAiATfg-.cjs")),"x-linkedin":()=>Promise.resolve().then(()=>require("./LinkedInExtension-6xekO5bX.cjs"))},ju=()=>Promise.resolve().then(()=>require("./LogoExtension-Dc_SUJhG.cjs"));function Yr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var at=Yr();function gi(e){at=e}var $t={exec:()=>null};function ee(e,t=""){let r=typeof e=="string"?e:e.source;const n={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(ke.caret,"$1"),r=r.replace(s,a),n},getRegex:()=>new RegExp(r,t)};return n}var ke={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Su=/^(?:[ \t]*(?:\n|$))+/,Nu=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Au=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ft=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Eu=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Qr=/(?:[*+-]|\d{1,9}[.)])/,xi=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,bi=ee(xi).replace(/bull/g,Qr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),$u=ee(xi).replace(/bull/g,Qr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),qr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Cu=/^[^\n]+/,es=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Tu=ee(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",es).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Iu=ee(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Qr).getRegex(),_n="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ts=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ou=ee("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ts).replace("tag",_n).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),yi=ee(qr).replace("hr",Ft).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_n).getRegex(),_u=ee(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",yi).getRegex(),ns={blockquote:_u,code:Nu,def:Tu,fences:Au,heading:Eu,hr:Ft,html:Ou,lheading:bi,list:Iu,newline:Su,paragraph:yi,table:$t,text:Cu},Ws=ee("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ft).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_n).getRegex(),Mu={...ns,lheading:$u,table:Ws,paragraph:ee(qr).replace("hr",Ft).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ws).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_n).getRegex()},Ru={...ns,html:ee(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ts).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:$t,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ee(qr).replace("hr",Ft).replace("heading",` *#{1,6} *[^
|
|
67
|
+
]`).replace("lheading",bi).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Pu=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Lu=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ki=/^( {2,}|\\)\n(?!\s*$)/,Bu=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Mn=/[\p{P}\p{S}]/u,rs=/[\s\p{P}\p{S}]/u,wi=/[^\s\p{P}\p{S}]/u,Du=ee(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,rs).getRegex(),vi=/(?!~)[\p{P}\p{S}]/u,Fu=/(?!~)[\s\p{P}\p{S}]/u,zu=/(?:[^\s\p{P}\p{S}]|~)/u,Hu=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,ji=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Uu=ee(ji,"u").replace(/punct/g,Mn).getRegex(),Wu=ee(ji,"u").replace(/punct/g,vi).getRegex(),Si="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ku=ee(Si,"gu").replace(/notPunctSpace/g,wi).replace(/punctSpace/g,rs).replace(/punct/g,Mn).getRegex(),Gu=ee(Si,"gu").replace(/notPunctSpace/g,zu).replace(/punctSpace/g,Fu).replace(/punct/g,vi).getRegex(),Vu=ee("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,wi).replace(/punctSpace/g,rs).replace(/punct/g,Mn).getRegex(),Ju=ee(/\\(punct)/,"gu").replace(/punct/g,Mn).getRegex(),Zu=ee(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Xu=ee(ts).replace("(?:-->|$)","-->").getRegex(),Yu=ee("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Xu).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),wn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Qu=ee(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",wn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ni=ee(/^!?\[(label)\]\[(ref)\]/).replace("label",wn).replace("ref",es).getRegex(),Ai=ee(/^!?\[(ref)\](?:\[\])?/).replace("ref",es).getRegex(),qu=ee("reflink|nolink(?!\\()","g").replace("reflink",Ni).replace("nolink",Ai).getRegex(),ss={_backpedal:$t,anyPunctuation:Ju,autolink:Zu,blockSkip:Hu,br:ki,code:Lu,del:$t,emStrongLDelim:Uu,emStrongRDelimAst:Ku,emStrongRDelimUnd:Vu,escape:Pu,link:Qu,nolink:Ai,punctuation:Du,reflink:Ni,reflinkSearch:qu,tag:Yu,text:Bu,url:$t},ed={...ss,link:ee(/^!?\[(label)\]\((.*?)\)/).replace("label",wn).getRegex(),reflink:ee(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",wn).getRegex()},vr={...ss,emStrongRDelimAst:Gu,emStrongLDelim:Wu,url:ee(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},td={...vr,br:ee(ki).replace("{2,}","*").getRegex(),text:ee(vr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Yt={normal:ns,gfm:Mu,pedantic:Ru},jt={normal:ss,gfm:vr,breaks:td,pedantic:ed},nd={"&":"&","<":"<",">":">",'"':""","'":"'"},Ks=e=>nd[e];function Re(e,t){if(t){if(ke.escapeTest.test(e))return e.replace(ke.escapeReplace,Ks)}else if(ke.escapeTestNoEncode.test(e))return e.replace(ke.escapeReplaceNoEncode,Ks);return e}function Gs(e){try{e=encodeURI(e).replace(ke.percentDecode,"%")}catch{return null}return e}function Vs(e,t){var i;const r=e.replace(ke.findPipe,(a,l,c)=>{let u=!1,d=l;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),n=r.split(ke.splitPipe);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!((i=n.at(-1))!=null&&i.trim())&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(ke.slashPipe,"|");return n}function St(e,t,r){const n=e.length;if(n===0)return"";let s=0;for(;s<n&&e.charAt(n-s-1)===t;)s++;return e.slice(0,n-s)}function rd(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return r>0?-2:-1}function Js(e,t,r,n,s){const i=t.href,a=t.title||null,l=e[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;const c={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:a,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,c}function sd(e,t,r){const n=e.match(r.other.indentCodeCompensation);if(n===null)return t;const s=n[1];return t.split(`
|
|
68
|
+
`).map(i=>{const a=i.match(r.other.beginningSpace);if(a===null)return i;const[l]=a;return l.length>=s.length?i.slice(s.length):i}).join(`
|
|
69
|
+
`)}var vn=class{constructor(e){re(this,"options");re(this,"rules");re(this,"lexer");this.options=e||at}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const r=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:St(r,`
|
|
70
|
+
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const r=t[0],n=sd(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){const n=St(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:St(t[0],`
|
|
71
|
+
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let r=St(t[0],`
|
|
72
|
+
`).split(`
|
|
73
|
+
`),n="",s="";const i=[];for(;r.length>0;){let a=!1;const l=[];let c;for(c=0;c<r.length;c++)if(this.rules.other.blockquoteStart.test(r[c]))l.push(r[c]),a=!0;else if(!a)l.push(r[c]);else break;r=r.slice(c);const u=l.join(`
|
|
74
|
+
`),d=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
75
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
76
|
+
${u}`:u,s=s?`${s}
|
|
77
|
+
${d}`:d;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,i,!0),this.lexer.state.top=f,r.length===0)break;const p=i.at(-1);if((p==null?void 0:p.type)==="code")break;if((p==null?void 0:p.type)==="blockquote"){const h=p,m=h.raw+`
|
|
78
|
+
`+r.join(`
|
|
79
|
+
`),y=this.blockquote(m);i[i.length-1]=y,n=n.substring(0,n.length-h.raw.length)+y.raw,s=s.substring(0,s.length-h.text.length)+y.text;break}else if((p==null?void 0:p.type)==="list"){const h=p,m=h.raw+`
|
|
80
|
+
`+r.join(`
|
|
81
|
+
`),y=this.list(m);i[i.length-1]=y,n=n.substring(0,n.length-p.raw.length)+y.raw,s=s.substring(0,s.length-h.raw.length)+y.raw,r=m.substring(i.at(-1).raw.length).split(`
|
|
82
|
+
`);continue}}return{type:"blockquote",raw:n,tokens:i,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const n=r.length>1,s={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");const i=this.rules.other.listItemRegex(r);let a=!1;for(;e;){let c=!1,u="",d="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let f=t[2].split(`
|
|
83
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,v=>" ".repeat(3*v.length)),p=e.split(`
|
|
84
|
+
`,1)[0],h=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):h?m=t[1].length+1:(m=t[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=t[1].length),h&&this.rules.other.blankLine.test(p)&&(u+=p+`
|
|
85
|
+
`,e=e.substring(p.length+1),c=!0),!c){const v=this.rules.other.nextBulletRegex(m),S=this.rules.other.hrRegex(m),w=this.rules.other.fencesBeginRegex(m),I=this.rules.other.headingBeginRegex(m),B=this.rules.other.htmlBeginRegex(m);for(;e;){const F=e.split(`
|
|
86
|
+
`,1)[0];let N;if(p=F,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),N=p):N=p.replace(this.rules.other.tabCharGlobal," "),w.test(p)||I.test(p)||B.test(p)||v.test(p)||S.test(p))break;if(N.search(this.rules.other.nonSpaceChar)>=m||!p.trim())d+=`
|
|
87
|
+
`+N.slice(m);else{if(h||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(f)||I.test(f)||S.test(f))break;d+=`
|
|
88
|
+
`+p}!h&&!p.trim()&&(h=!0),u+=F+`
|
|
89
|
+
`,e=e.substring(F.length+1),f=N.slice(m)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0));let y=null,b;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(b=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:u,task:!!y,checked:b,loose:!1,text:d,tokens:[]}),s.raw+=u}const l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;c<s.items.length;c++)if(this.lexer.state.top=!1,s.items[c].tokens=this.lexer.blockTokens(s.items[c].text,[]),!s.loose){const u=s.items[c].tokens.filter(f=>f.type==="space"),d=u.length>0&&u.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=d}if(s.loose)for(let c=0;c<s.items.length;c++)s.items[c].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:n,title:s}}}table(e){var a;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const r=Vs(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(a=t[3])!=null&&a.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
90
|
+
`):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(const l of n)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<r.length;l++)i.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:i.align[l]});for(const l of s)i.rows.push(Vs(l,i.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:i.align[u]})));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const r=t[1].charAt(t[1].length-1)===`
|
|
91
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const i=St(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{const i=rd(t[2],"()");if(i===-2)return;if(i>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(n);i&&(n=i[1],s=i[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),Js(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){const n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[n.toLowerCase()];if(!s){const i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return Js(r,s,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!n||n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(n[1]||n[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const i=[...n[0]].length-1;let a,l,c=i,u=0;const d=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(n=d.exec(t))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(l=[...a].length,n[3]||n[4]){c+=l;continue}else if((n[5]||n[6])&&i%3&&!((i+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);const f=[...n[0]][0].length,p=e.slice(0,i+n.index+f+l);if(Math.min(i,l)%2){const m=p.slice(1,-1);return{type:"em",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}const h=p.slice(2,-2);return{type:"strong",raw:p,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let r,n;return t[2]==="@"?(r=t[1],n="mailto:"+r):(r=t[1],n=r),{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(e){var r;let t;if(t=this.rules.inline.url.exec(e)){let n,s;if(t[2]==="@")n=t[0],s="mailto:"+n;else{let i;do i=t[0],t[0]=((r=this.rules.inline._backpedal.exec(t[0]))==null?void 0:r[0])??"";while(i!==t[0]);n=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}},He=class jr{constructor(t){re(this,"tokens");re(this,"options");re(this,"state");re(this,"tokenizer");re(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||at,this.options.tokenizer=this.options.tokenizer||new vn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={other:ke,block:Yt.normal,inline:jt.normal};this.options.pedantic?(r.block=Yt.pedantic,r.inline=jt.pedantic):this.options.gfm&&(r.block=Yt.gfm,this.options.breaks?r.inline=jt.breaks:r.inline=jt.gfm),this.tokenizer.rules=r}static get rules(){return{block:Yt,inline:jt}}static lex(t,r){return new jr(r).lex(t)}static lexInline(t,r){return new jr(r).inlineTokens(t)}lex(t){t=t.replace(ke.carriageReturn,`
|
|
92
|
+
`),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){const n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],n=!1){var s,i,a;for(this.options.pedantic&&(t=t.replace(ke.tabCharGlobal," ").replace(ke.spaceLine,""));t;){let l;if((i=(s=this.options.extensions)==null?void 0:s.block)!=null&&i.some(u=>(l=u.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);const u=r.at(-1);l.raw.length===1&&u!==void 0?u.raw+=`
|
|
93
|
+
`:r.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);const u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
|
|
94
|
+
`+l.raw,u.text+=`
|
|
95
|
+
`+l.text,this.inlineQueue.at(-1).src=u.text):r.push(l);continue}if(l=this.tokenizer.fences(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.heading(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.hr(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.blockquote(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.list(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.html(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.def(t)){t=t.substring(l.raw.length);const u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
|
|
96
|
+
`+l.raw,u.text+=`
|
|
97
|
+
`+l.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title});continue}if(l=this.tokenizer.table(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.lheading(t)){t=t.substring(l.raw.length),r.push(l);continue}let c=t;if((a=this.options.extensions)!=null&&a.startBlock){let u=1/0;const d=t.slice(1);let f;this.options.extensions.startBlock.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(c=t.substring(0,u+1))}if(this.state.top&&(l=this.tokenizer.paragraph(c))){const u=r.at(-1);n&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=`
|
|
98
|
+
`+l.raw,u.text+=`
|
|
99
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(l),n=c.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);const u=r.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=`
|
|
100
|
+
`+l.raw,u.text+=`
|
|
101
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(l);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){var l,c,u;let n=t,s=null;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)d.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,s.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a="";for(;t;){i||(a=""),i=!1;let d;if((c=(l=this.options.extensions)==null?void 0:l.inline)!=null&&c.some(p=>(d=p.call({lexer:this},t,r))?(t=t.substring(d.raw.length),r.push(d),!0):!1))continue;if(d=this.tokenizer.escape(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.tag(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.link(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(d.raw.length);const p=r.at(-1);d.type==="text"&&(p==null?void 0:p.type)==="text"?(p.raw+=d.raw,p.text+=d.text):r.push(d);continue}if(d=this.tokenizer.emStrong(t,n,a)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.del(t)){t=t.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),r.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),r.push(d);continue}let f=t;if((u=this.options.extensions)!=null&&u.startInline){let p=1/0;const h=t.slice(1);let m;this.options.extensions.startInline.forEach(y=>{m=y.call({lexer:this},h),typeof m=="number"&&m>=0&&(p=Math.min(p,m))}),p<1/0&&p>=0&&(f=t.substring(0,p+1))}if(d=this.tokenizer.inlineText(f)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(a=d.raw.slice(-1)),i=!0;const p=r.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=d.raw,p.text+=d.text):r.push(d);continue}if(t){const p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return r}},jn=class{constructor(e){re(this,"options");re(this,"parser");this.options=e||at}space(e){return""}code({text:e,lang:t,escaped:r}){var i;const n=(i=(t||"").match(ke.notSpaceStart))==null?void 0:i[0],s=e.replace(ke.endingNewline,"")+`
|
|
102
|
+
`;return n?'<pre><code class="language-'+Re(n)+'">'+(r?s:Re(s,!0))+`</code></pre>
|
|
103
|
+
`:"<pre><code>"+(r?s:Re(s,!0))+`</code></pre>
|
|
104
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
105
|
+
${this.parser.parse(e)}</blockquote>
|
|
106
|
+
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
107
|
+
`}hr(e){return`<hr>
|
|
108
|
+
`}list(e){const t=e.ordered,r=e.start;let n="";for(let a=0;a<e.items.length;a++){const l=e.items[a];n+=this.listitem(l)}const s=t?"ol":"ul",i=t&&r!==1?' start="'+r+'"':"";return"<"+s+i+`>
|
|
109
|
+
`+n+"</"+s+`>
|
|
110
|
+
`}listitem(e){var r;let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?((r=e.tokens[0])==null?void 0:r.type)==="paragraph"?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=n+" "+Re(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
111
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
112
|
+
`}table(e){let t="",r="";for(let s=0;s<e.header.length;s++)r+=this.tablecell(e.header[s]);t+=this.tablerow({text:r});let n="";for(let s=0;s<e.rows.length;s++){const i=e.rows[s];r="";for(let a=0;a<i.length;a++)r+=this.tablecell(i[a]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
113
|
+
<thead>
|
|
114
|
+
`+t+`</thead>
|
|
115
|
+
`+n+`</table>
|
|
116
|
+
`}tablerow({text:e}){return`<tr>
|
|
117
|
+
${e}</tr>
|
|
118
|
+
`}tablecell(e){const t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
|
|
119
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Re(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){const n=this.parser.parseInline(r),s=Gs(e);if(s===null)return n;e=s;let i='<a href="'+e+'"';return t&&(i+=' title="'+Re(t)+'"'),i+=">"+n+"</a>",i}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));const s=Gs(e);if(s===null)return Re(r);e=s;let i=`<img src="${e}" alt="${r}"`;return t&&(i+=` title="${Re(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Re(e.text)}},os=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Ue=class Sr{constructor(t){re(this,"options");re(this,"renderer");re(this,"textRenderer");this.options=t||at,this.options.renderer=this.options.renderer||new jn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new os}static parse(t,r){return new Sr(r).parse(t)}static parseInline(t,r){return new Sr(r).parseInline(t)}parse(t,r=!0){var s,i;let n="";for(let a=0;a<t.length;a++){const l=t[a];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[l.type]){const u=l,d=this.options.extensions.renderers[u.type].call({parser:this},u);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)){n+=d||"";continue}}const c=l;switch(c.type){case"space":{n+=this.renderer.space(c);continue}case"hr":{n+=this.renderer.hr(c);continue}case"heading":{n+=this.renderer.heading(c);continue}case"code":{n+=this.renderer.code(c);continue}case"table":{n+=this.renderer.table(c);continue}case"blockquote":{n+=this.renderer.blockquote(c);continue}case"list":{n+=this.renderer.list(c);continue}case"html":{n+=this.renderer.html(c);continue}case"paragraph":{n+=this.renderer.paragraph(c);continue}case"text":{let u=c,d=this.renderer.text(u);for(;a+1<t.length&&t[a+1].type==="text";)u=t[++a],d+=`
|
|
120
|
+
`+this.renderer.text(u);r?n+=this.renderer.paragraph({type:"paragraph",raw:d,text:d,tokens:[{type:"text",raw:d,text:d,escaped:!0}]}):n+=d;continue}default:{const u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}parseInline(t,r=this.renderer){var s,i;let n="";for(let a=0;a<t.length;a++){const l=t[a];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[l.type]){const u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){n+=u||"";continue}}const c=l;switch(c.type){case"escape":{n+=r.text(c);break}case"html":{n+=r.html(c);break}case"link":{n+=r.link(c);break}case"image":{n+=r.image(c);break}case"strong":{n+=r.strong(c);break}case"em":{n+=r.em(c);break}case"codespan":{n+=r.codespan(c);break}case"br":{n+=r.br(c);break}case"del":{n+=r.del(c);break}case"text":{n+=r.text(c);break}default:{const u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}},or,fn=(or=class{constructor(e){re(this,"options");re(this,"block");this.options=e||at}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?He.lex:He.lexInline}provideParser(){return this.block?Ue.parse:Ue.parseInline}},re(or,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),or),Ei=class{constructor(...e){re(this,"defaults",Yr());re(this,"options",this.setOptions);re(this,"parse",this.parseMarkdown(!0));re(this,"parseInline",this.parseMarkdown(!1));re(this,"Parser",Ue);re(this,"Renderer",jn);re(this,"TextRenderer",os);re(this,"Lexer",He);re(this,"Tokenizer",vn);re(this,"Hooks",fn);this.use(...e)}walkTokens(e,t){var n,s;let r=[];for(const i of e)switch(r=r.concat(t.call(this,i)),i.type){case"table":{const a=i;for(const l of a.header)r=r.concat(this.walkTokens(l.tokens,t));for(const l of a.rows)for(const c of l)r=r.concat(this.walkTokens(c.tokens,t));break}case"list":{const a=i;r=r.concat(this.walkTokens(a.items,t));break}default:{const a=i;(s=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&s[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{const c=a[l].flat(1/0);r=r.concat(this.walkTokens(c,t))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,t)))}}return r}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{const n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const i=t.renderers[s.name];i?t.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=i.apply(this,a)),l}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=t[s.level];i?i.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),n.extensions=t),r.renderer){const s=this.defaults.renderer||new jn(this.defaults);for(const i in r.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const a=i,l=r.renderer[a],c=s[a];s[a]=(...u)=>{let d=l.apply(s,u);return d===!1&&(d=c.apply(s,u)),d||""}}n.renderer=s}if(r.tokenizer){const s=this.defaults.tokenizer||new vn(this.defaults);for(const i in r.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const a=i,l=r.tokenizer[a],c=s[a];s[a]=(...u)=>{let d=l.apply(s,u);return d===!1&&(d=c.apply(s,u)),d}}n.tokenizer=s}if(r.hooks){const s=this.defaults.hooks||new fn;for(const i in r.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const a=i,l=r.hooks[a],c=s[a];fn.passThroughHooks.has(i)?s[a]=u=>{if(this.defaults.async)return Promise.resolve(l.call(s,u)).then(f=>c.call(s,f));const d=l.call(s,u);return c.call(s,d)}:s[a]=(...u)=>{let d=l.apply(s,u);return d===!1&&(d=c.apply(s,u)),d}}n.hooks=s}if(r.walkTokens){const s=this.defaults.walkTokens,i=r.walkTokens;n.walkTokens=function(a){let l=[];return l.push(i.call(this,a)),s&&(l=l.concat(s.call(this,a))),l}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return He.lex(e,t??this.defaults)}parser(e,t){return Ue.parse(e,t??this.defaults)}parseMarkdown(e){return(r,n)=>{const s={...n},i={...this.defaults,...s},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);const l=i.hooks?i.hooks.provideLexer():e?He.lex:He.lexInline,c=i.hooks?i.hooks.provideParser():e?Ue.parse:Ue.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(r):r).then(u=>l(u,i)).then(u=>i.hooks?i.hooks.processAllTokens(u):u).then(u=>i.walkTokens?Promise.all(this.walkTokens(u,i.walkTokens)).then(()=>u):u).then(u=>c(u,i)).then(u=>i.hooks?i.hooks.postprocess(u):u).catch(a);try{i.hooks&&(r=i.hooks.preprocess(r));let u=l(r,i);i.hooks&&(u=i.hooks.processAllTokens(u)),i.walkTokens&&this.walkTokens(u,i.walkTokens);let d=c(u,i);return i.hooks&&(d=i.hooks.postprocess(d)),d}catch(u){return a(u)}}}onError(e,t){return r=>{if(r.message+=`
|
|
121
|
+
Please report this to https://github.com/markedjs/marked.`,e){const n="<p>An error occurred:</p><pre>"+Re(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},rt=new Ei;function ie(e,t){return rt.parse(e,t)}ie.options=ie.setOptions=function(e){return rt.setOptions(e),ie.defaults=rt.defaults,gi(ie.defaults),ie};ie.getDefaults=Yr;ie.defaults=at;ie.use=function(...e){return rt.use(...e),ie.defaults=rt.defaults,gi(ie.defaults),ie};ie.walkTokens=function(e,t){return rt.walkTokens(e,t)};ie.parseInline=rt.parseInline;ie.Parser=Ue;ie.parser=Ue.parse;ie.Renderer=jn;ie.TextRenderer=os;ie.Lexer=He;ie.lexer=He.lex;ie.Tokenizer=vn;ie.Hooks=fn;ie.parse=ie;ie.options;ie.setOptions;ie.use;ie.walkTokens;ie.parseInline;Ue.parse;He.lex;function od(e){if(typeof e=="function"&&(e={highlight:e}),!e||typeof e.highlight!="function")throw new Error("Must provide highlight function");return typeof e.langPrefix!="string"&&(e.langPrefix="language-"),typeof e.emptyLangClass!="string"&&(e.emptyLangClass=""),{async:!!e.async,walkTokens(t){if(t.type!=="code")return;const r=Zs(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,r,t.lang||"")).then(Xs(t));const n=e.highlight(t.text,r,t.lang||"");if(n instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");Xs(t)(n)},useNewRenderer:!0,renderer:{code(t,r,n){typeof t=="object"&&(n=t.escaped,r=t.lang,t=t.text);const s=Zs(r),i=s?e.langPrefix+Qs(s):e.emptyLangClass,a=i?` class="${i}"`:"";return t=t.replace(/\n$/,""),`<pre><code${a}>${n?t:Qs(t,!0)}
|
|
122
|
+
</code></pre>`}}}}function Zs(e){return(e||"").match(/\S*/)[0]}function Xs(e){return t=>{typeof t=="string"&&t!==e.text&&(e.escaped=!0,e.text=t)}}const $i=/[&<>"']/,id=new RegExp($i.source,"g"),Ci=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ad=new RegExp(Ci.source,"g"),ld={"&":"&","<":"<",">":">",'"':""","'":"'"},Ys=e=>ld[e];function Qs(e,t){if(t){if($i.test(e))return e.replace(id,Ys)}else if(Ci.test(e))return e.replace(ad,Ys);return e}var cd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ti(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ud(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}function Ii(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const r=e[t],n=typeof r;(n==="object"||n==="function")&&!Object.isFrozen(r)&&Ii(r)}),e}class qs{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Oi(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ve(e,...t){const r=Object.create(null);for(const n in e)r[n]=e[n];return t.forEach(function(n){for(const s in n)r[s]=n[s]}),r}const dd="</span>",eo=e=>!!e.scope,fd=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const r=e.split(".");return[`${t}${r.shift()}`,...r.map((n,s)=>`${n}${"_".repeat(s+1)}`)].join(" ")}return`${t}${e}`};class pd{constructor(t,r){this.buffer="",this.classPrefix=r.classPrefix,t.walk(this)}addText(t){this.buffer+=Oi(t)}openNode(t){if(!eo(t))return;const r=fd(t.scope,{prefix:this.classPrefix});this.span(r)}closeNode(t){eo(t)&&(this.buffer+=dd)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const to=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class is{constructor(){this.rootNode=to(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const r=to({scope:t});this.add(r),this.stack.push(r)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,r){return typeof r=="string"?t.addText(r):r.children&&(t.openNode(r),r.children.forEach(n=>this._walk(t,n)),t.closeNode(r)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(r=>typeof r=="string")?t.children=[t.children.join("")]:t.children.forEach(r=>{is._collapse(r)}))}}class hd extends is{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,r){const n=t.root;r&&(n.scope=`language:${r}`),this.add(n)}toHTML(){return new pd(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Rt(e){return e?typeof e=="string"?e:e.source:null}function _i(e){return lt("(?=",e,")")}function md(e){return lt("(?:",e,")*")}function gd(e){return lt("(?:",e,")?")}function lt(...e){return e.map(r=>Rt(r)).join("")}function xd(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function as(...e){return"("+(xd(e).capture?"":"?:")+e.map(n=>Rt(n)).join("|")+")"}function Mi(e){return new RegExp(e.toString()+"|").exec("").length-1}function bd(e,t){const r=e&&e.exec(t);return r&&r.index===0}const yd=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ls(e,{joinWith:t}){let r=0;return e.map(n=>{r+=1;const s=r;let i=Rt(n),a="";for(;i.length>0;){const l=yd.exec(i);if(!l){a+=i;break}a+=i.substring(0,l.index),i=i.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+s):(a+=l[0],l[0]==="("&&r++)}return a}).map(n=>`(${n})`).join(t)}const kd=/\b\B/,Ri="[a-zA-Z]\\w*",cs="[a-zA-Z_]\\w*",Pi="\\b\\d+(\\.\\d+)?",Li="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Bi="\\b(0b[01]+)",wd="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",vd=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=lt(t,/.*\b/,e.binary,/\b.*/)),Ve({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(r,n)=>{r.index!==0&&n.ignoreMatch()}},e)},Pt={begin:"\\\\[\\s\\S]",relevance:0},jd={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Pt]},Sd={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Pt]},Nd={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Rn=function(e,t,r={}){const n=Ve({scope:"comment",begin:e,end:t,contains:[]},r);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const s=as("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:lt(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},Ad=Rn("//","$"),Ed=Rn("/\\*","\\*/"),$d=Rn("#","$"),Cd={scope:"number",begin:Pi,relevance:0},Td={scope:"number",begin:Li,relevance:0},Id={scope:"number",begin:Bi,relevance:0},Od={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Pt,{begin:/\[/,end:/\]/,relevance:0,contains:[Pt]}]},_d={scope:"title",begin:Ri,relevance:0},Md={scope:"title",begin:cs,relevance:0},Rd={begin:"\\.\\s*"+cs,relevance:0},Pd=function(e){return Object.assign(e,{"on:begin":(t,r)=>{r.data._beginMatch=t[1]},"on:end":(t,r)=>{r.data._beginMatch!==t[1]&&r.ignoreMatch()}})};var Qt=Object.freeze({__proto__:null,APOS_STRING_MODE:jd,BACKSLASH_ESCAPE:Pt,BINARY_NUMBER_MODE:Id,BINARY_NUMBER_RE:Bi,COMMENT:Rn,C_BLOCK_COMMENT_MODE:Ed,C_LINE_COMMENT_MODE:Ad,C_NUMBER_MODE:Td,C_NUMBER_RE:Li,END_SAME_AS_BEGIN:Pd,HASH_COMMENT_MODE:$d,IDENT_RE:Ri,MATCH_NOTHING_RE:kd,METHOD_GUARD:Rd,NUMBER_MODE:Cd,NUMBER_RE:Pi,PHRASAL_WORDS_MODE:Nd,QUOTE_STRING_MODE:Sd,REGEXP_MODE:Od,RE_STARTERS_RE:wd,SHEBANG:vd,TITLE_MODE:_d,UNDERSCORE_IDENT_RE:cs,UNDERSCORE_TITLE_MODE:Md});function Ld(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Bd(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Dd(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Ld,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Fd(e,t){Array.isArray(e.illegal)&&(e.illegal=as(...e.illegal))}function zd(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function Hd(e,t){e.relevance===void 0&&(e.relevance=1)}const Ud=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const r=Object.assign({},e);Object.keys(e).forEach(n=>{delete e[n]}),e.keywords=r.keywords,e.begin=lt(r.beforeMatch,_i(r.begin)),e.starts={relevance:0,contains:[Object.assign(r,{endsParent:!0})]},e.relevance=0,delete r.beforeMatch},Wd=["of","and","for","in","not","or","if","then","parent","list","value"],Kd="keyword";function Di(e,t,r=Kd){const n=Object.create(null);return typeof e=="string"?s(r,e.split(" ")):Array.isArray(e)?s(r,e):Object.keys(e).forEach(function(i){Object.assign(n,Di(e[i],t,i))}),n;function s(i,a){t&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const c=l.split("|");n[c[0]]=[i,Gd(c[0],c[1])]})}}function Gd(e,t){return t?Number(t):Vd(e)?0:1}function Vd(e){return Wd.includes(e.toLowerCase())}const no={},nt=e=>{console.error(e)},ro=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ct=(e,t)=>{no[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),no[`${e}/${t}`]=!0)},Sn=new Error;function Fi(e,t,{key:r}){let n=0;const s=e[r],i={},a={};for(let l=1;l<=t.length;l++)a[l+n]=s[l],i[l+n]=!0,n+=Mi(t[l-1]);e[r]=a,e[r]._emit=i,e[r]._multi=!0}function Jd(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw nt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Sn;if(typeof e.beginScope!="object"||e.beginScope===null)throw nt("beginScope must be object"),Sn;Fi(e,e.begin,{key:"beginScope"}),e.begin=ls(e.begin,{joinWith:""})}}function Zd(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw nt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Sn;if(typeof e.endScope!="object"||e.endScope===null)throw nt("endScope must be object"),Sn;Fi(e,e.end,{key:"endScope"}),e.end=ls(e.end,{joinWith:""})}}function Xd(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Yd(e){Xd(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Jd(e),Zd(e)}function Qd(e){function t(a,l){return new RegExp(Rt(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=Mi(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(ls(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);if(!c)return null;const u=c.findIndex((f,p)=>p>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new r;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(a){const l=new n;return a.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),a.terminatorEnd&&l.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&l.addRule(a.illegal,{type:"illegal"}),l}function i(a,l){const c=a;if(a.isCompiled)return c;[Bd,zd,Yd,Ud].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[Dd,Fd,Hd].forEach(d=>d(a,l)),a.isCompiled=!0;let u=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),u=a.keywords.$pattern,delete a.keywords.$pattern),u=u||/\w+/,a.keywords&&(a.keywords=Di(a.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(a.begin||(a.begin=/\B|\b/),c.beginRe=t(c.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(c.endRe=t(c.end)),c.terminatorEnd=Rt(c.end)||"",a.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+l.terminatorEnd)),a.illegal&&(c.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return qd(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,c)}),a.starts&&i(a.starts,l),c.matcher=s(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Ve(e.classNameAliases||{}),i(e)}function zi(e){return e?e.endsWithParent||zi(e.starts):!1}function qd(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Ve(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:zi(e)?Ve(e,{starts:e.starts?Ve(e.starts):null}):Object.isFrozen(e)?Ve(e):e}var ef="11.11.1";class tf extends Error{constructor(t,r){super(t),this.name="HTMLInjectionError",this.html=r}}const Jn=Oi,so=Ve,oo=Symbol("nomatch"),nf=7,Hi=function(e){const t=Object.create(null),r=Object.create(null),n=[];let s=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:hd};function c(j){return l.noHighlightRe.test(j)}function u(j){let A=j.className+" ";A+=j.parentNode?j.parentNode.className:"";const M=l.languageDetectRe.exec(A);if(M){const V=k(M[1]);return V||(ro(i.replace("{}",M[1])),ro("Falling back to no-highlight mode for this block.",j)),V?M[1]:"no-highlight"}return A.split(/\s+/).find(V=>c(V)||k(V))}function d(j,A,M){let V="",Y="";typeof A=="object"?(V=j,M=A.ignoreIllegals,Y=A.language):(ct("10.7.0","highlight(lang, code, ...args) has been deprecated."),ct("10.7.0",`Please use highlight(code, options) instead.
|
|
123
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),Y=j,V=A),M===void 0&&(M=!0);const te={code:V,language:Y};z("before:highlight",te);const ue=te.result?te.result:f(te.language,te.code,M);return ue.code=te.code,z("after:highlight",ue),ue}function f(j,A,M,V){const Y=Object.create(null);function te(O,R){return O.keywords[R]}function ue(){if(!D.keywords){pe.addText(ne);return}let O=0;D.keywordPatternRe.lastIndex=0;let R=D.keywordPatternRe.exec(ne),W="";for(;R;){W+=ne.substring(O,R.index);const X=q.case_insensitive?R[0].toLowerCase():R[0],me=te(D,X);if(me){const[Be,Za]=me;if(pe.addText(W),W="",Y[X]=(Y[X]||0)+1,Y[X]<=nf&&(qe+=Za),Be.startsWith("_"))W+=R[0];else{const Xa=q.classNameAliases[Be]||Be;ae(R[0],Xa)}}else W+=R[0];O=D.keywordPatternRe.lastIndex,R=D.keywordPatternRe.exec(ne)}W+=ne.substring(O),pe.addText(W)}function de(){if(ne==="")return;let O=null;if(typeof D.subLanguage=="string"){if(!t[D.subLanguage]){pe.addText(ne);return}O=f(D.subLanguage,ne,!0,ge[D.subLanguage]),ge[D.subLanguage]=O._top}else O=h(ne,D.subLanguage.length?D.subLanguage:null);D.relevance>0&&(qe+=O.relevance),pe.__addSublanguage(O._emitter,O.language)}function le(){D.subLanguage!=null?de():ue(),ne=""}function ae(O,R){O!==""&&(pe.startScope(R),pe.addText(O),pe.endScope())}function se(O,R){let W=1;const X=R.length-1;for(;W<=X;){if(!O._emit[W]){W++;continue}const me=q.classNameAliases[O[W]]||O[W],Be=R[W];me?ae(Be,me):(ne=Be,ue(),ne=""),W++}}function E(O,R){return O.scope&&typeof O.scope=="string"&&pe.openNode(q.classNameAliases[O.scope]||O.scope),O.beginScope&&(O.beginScope._wrap?(ae(ne,q.classNameAliases[O.beginScope._wrap]||O.beginScope._wrap),ne=""):O.beginScope._multi&&(se(O.beginScope,R),ne="")),D=Object.create(O,{parent:{value:D}}),D}function L(O,R,W){let X=bd(O.endRe,W);if(X){if(O["on:end"]){const me=new qs(O);O["on:end"](R,me),me.isMatchIgnored&&(X=!1)}if(X){for(;O.endsParent&&O.parent;)O=O.parent;return O}}if(O.endsWithParent)return L(O.parent,R,W)}function J(O){return D.matcher.regexIndex===0?(ne+=O[0],1):(Le=!0,0)}function Z(O){const R=O[0],W=O.rule,X=new qs(W),me=[W.__beforeBegin,W["on:begin"]];for(const Be of me)if(Be&&(Be(O,X),X.isMatchIgnored))return J(R);return W.skip?ne+=R:(W.excludeBegin&&(ne+=R),le(),!W.returnBegin&&!W.excludeBegin&&(ne=R)),E(W,O),W.returnBegin?0:R.length}function oe(O){const R=O[0],W=A.substring(O.index),X=L(D,O,W);if(!X)return oo;const me=D;D.endScope&&D.endScope._wrap?(le(),ae(R,D.endScope._wrap)):D.endScope&&D.endScope._multi?(le(),se(D.endScope,O)):me.skip?ne+=R:(me.returnEnd||me.excludeEnd||(ne+=R),le(),me.excludeEnd&&(ne=R));do D.scope&&pe.closeNode(),!D.skip&&!D.subLanguage&&(qe+=D.relevance),D=D.parent;while(D!==X.parent);return X.starts&&E(X.starts,O),me.returnEnd?0:R.length}function H(){const O=[];for(let R=D;R!==q;R=R.parent)R.scope&&O.unshift(R.scope);O.forEach(R=>pe.openNode(R))}let Q={};function he(O,R){const W=R&&R[0];if(ne+=O,W==null)return le(),0;if(Q.type==="begin"&&R.type==="end"&&Q.index===R.index&&W===""){if(ne+=A.slice(R.index,R.index+1),!s){const X=new Error(`0 width match regex (${j})`);throw X.languageName=j,X.badRule=Q.rule,X}return 1}if(Q=R,R.type==="begin")return Z(R);if(R.type==="illegal"&&!M){const X=new Error('Illegal lexeme "'+W+'" for mode "'+(D.scope||"<unnamed>")+'"');throw X.mode=D,X}else if(R.type==="end"){const X=oe(R);if(X!==oo)return X}if(R.type==="illegal"&&W==="")return ne+=`
|
|
124
|
+
`,1;if(wt>1e5&&wt>R.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ne+=W,W.length}const q=k(j);if(!q)throw nt(i.replace("{}",j)),new Error('Unknown language: "'+j+'"');const $e=Qd(q);let fe="",D=V||$e;const ge={},pe=new l.__emitter(l);H();let ne="",qe=0,Me=0,wt=0,Le=!1;try{if(q.__emitTokens)q.__emitTokens(A,pe);else{for(D.matcher.considerAll();;){wt++,Le?Le=!1:D.matcher.considerAll(),D.matcher.lastIndex=Me;const O=D.matcher.exec(A);if(!O)break;const R=A.substring(Me,O.index),W=he(R,O);Me=O.index+W}he(A.substring(Me))}return pe.finalize(),fe=pe.toHTML(),{language:j,value:fe,relevance:qe,illegal:!1,_emitter:pe,_top:D}}catch(O){if(O.message&&O.message.includes("Illegal"))return{language:j,value:Jn(A),illegal:!0,relevance:0,_illegalBy:{message:O.message,index:Me,context:A.slice(Me-100,Me+100),mode:O.mode,resultSoFar:fe},_emitter:pe};if(s)return{language:j,value:Jn(A),illegal:!1,relevance:0,errorRaised:O,_emitter:pe,_top:D};throw O}}function p(j){const A={value:Jn(j),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return A._emitter.addText(j),A}function h(j,A){A=A||l.languages||Object.keys(t);const M=p(j),V=A.filter(k).filter($).map(le=>f(le,j,!1));V.unshift(M);const Y=V.sort((le,ae)=>{if(le.relevance!==ae.relevance)return ae.relevance-le.relevance;if(le.language&&ae.language){if(k(le.language).supersetOf===ae.language)return 1;if(k(ae.language).supersetOf===le.language)return-1}return 0}),[te,ue]=Y,de=te;return de.secondBest=ue,de}function m(j,A,M){const V=A&&r[A]||M;j.classList.add("hljs"),j.classList.add(`language-${V}`)}function y(j){let A=null;const M=u(j);if(c(M))return;if(z("before:highlightElement",{el:j,language:M}),j.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",j);return}if(j.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(j)),l.throwUnescapedHTML))throw new tf("One of your code blocks includes unescaped HTML.",j.innerHTML);A=j;const V=A.textContent,Y=M?d(V,{language:M,ignoreIllegals:!0}):h(V);j.innerHTML=Y.value,j.dataset.highlighted="yes",m(j,M,Y.language),j.result={language:Y.language,re:Y.relevance,relevance:Y.relevance},Y.secondBest&&(j.secondBest={language:Y.secondBest.language,relevance:Y.secondBest.relevance}),z("after:highlightElement",{el:j,result:Y,text:V})}function b(j){l=so(l,j)}const v=()=>{I(),ct("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function S(){I(),ct("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let w=!1;function I(){function j(){I()}if(document.readyState==="loading"){w||window.addEventListener("DOMContentLoaded",j,!1),w=!0;return}document.querySelectorAll(l.cssSelector).forEach(y)}function B(j,A){let M=null;try{M=A(e)}catch(V){if(nt("Language definition for '{}' could not be registered.".replace("{}",j)),s)nt(V);else throw V;M=a}M.name||(M.name=j),t[j]=M,M.rawDefinition=A.bind(null,e),M.aliases&&x(M.aliases,{languageName:j})}function F(j){delete t[j];for(const A of Object.keys(r))r[A]===j&&delete r[A]}function N(){return Object.keys(t)}function k(j){return j=(j||"").toLowerCase(),t[j]||t[r[j]]}function x(j,{languageName:A}){typeof j=="string"&&(j=[j]),j.forEach(M=>{r[M.toLowerCase()]=A})}function $(j){const A=k(j);return A&&!A.disableAutodetect}function T(j){j["before:highlightBlock"]&&!j["before:highlightElement"]&&(j["before:highlightElement"]=A=>{j["before:highlightBlock"](Object.assign({block:A.el},A))}),j["after:highlightBlock"]&&!j["after:highlightElement"]&&(j["after:highlightElement"]=A=>{j["after:highlightBlock"](Object.assign({block:A.el},A))})}function C(j){T(j),n.push(j)}function P(j){const A=n.indexOf(j);A!==-1&&n.splice(A,1)}function z(j,A){const M=j;n.forEach(function(V){V[M]&&V[M](A)})}function G(j){return ct("10.7.0","highlightBlock will be removed entirely in v12.0"),ct("10.7.0","Please use highlightElement now."),y(j)}Object.assign(e,{highlight:d,highlightAuto:h,highlightAll:I,highlightElement:y,highlightBlock:G,configure:b,initHighlighting:v,initHighlightingOnLoad:S,registerLanguage:B,unregisterLanguage:F,listLanguages:N,getLanguage:k,registerAliases:x,autoDetection:$,inherit:so,addPlugin:C,removePlugin:P}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=ef,e.regex={concat:lt,lookahead:_i,either:as,optional:gd,anyNumberOfTimes:md};for(const j in Qt)typeof Qt[j]=="object"&&Ii(Qt[j]);return Object.assign(e,Qt),e},ht=Hi({});ht.newInstance=()=>Hi({});var rf=ht;ht.HighlightJS=ht;ht.default=ht;const Ie=Ti(rf);function sf(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},n=["true","false","null"],s={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:n},contains:[t,r,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function of(e){const t="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},l=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},m={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},y={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},b=[n,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},p,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,y,i,a],v=[...b];return v.pop(),v.push(l),h.contains=v,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:b}}function af(e){const t=e.regex,r={},n={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,r,s]};s.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=e.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},y=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],b=["true","false"],v={match:/(\/[a-z._-]+)+/},S=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],w=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],I=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],B=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:y,literal:b,built_in:[...S,...w,"set","shopt",...I,...B]},contains:[h,e.SHEBANG(),m,f,i,a,v,l,c,u,d,r]}}const io="[A-Za-z$_][0-9A-Za-z$_]*",lf=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],cf=["true","false","null","undefined","NaN","Infinity"],Ui=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Wi=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ki=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],uf=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],df=[].concat(Ki,Ui,Wi);function ff(e){const t=e.regex,r=(M,{after:V})=>{const Y="</"+M[0].slice(1);return M.input.indexOf(Y,V)!==-1},n=io,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,V)=>{const Y=M[0].length+M.index,te=M.input[Y];if(te==="<"||te===","){V.ignoreMatch();return}te===">"&&(r(M,{after:Y})||V.ignoreMatch());let ue;const de=M.input.substring(Y);if(ue=de.match(/^\s*=/)){V.ignoreMatch();return}if((ue=de.match(/^\s+extends\s+/))&&ue.index===0){V.ignoreMatch();return}}},l={$pattern:io,keyword:lf,literal:cf,built_in:df,"variable.language":uf},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},y={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},S={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,y,b,{match:/\$\d+/},f];p.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const I=[].concat(S,p.contains),B=I.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(I)}]),F={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B},N={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ui,...Wi]}},x={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},$={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[F],illegal:/%/},T={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function C(M){return t.concat("(?!",M.join("|"),")")}const P={match:t.concat(/\b/,C([...Ki,"super","import"].map(M=>`${M}\\s*\\(`)),n,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},z={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},G={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},F]},j="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[F]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),x,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,y,b,S,{match:/\$\d+/},f,k,{scope:"attr",match:n+t.lookahead(":"),relevance:0},A,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[S,e.REGEXP_MODE,{className:"function",begin:j,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},$,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[F,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},z,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[F]},P,T,N,G,{match:/\$[(.]/}]}}function pf(e){const t=e.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},p="[0-9](_?[0-9])*",h=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,m=`\\b|${n.join("|")}`,y={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${h}))[eE][+-]?(${p})[jJ]?(?=${m})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${p})[jJ](?=${m})`}]},b={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},v={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,y,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,y,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,y,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,b,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[v]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[y,v,f]}]}}Ie.registerLanguage("json",sf);Ie.registerLanguage("yaml",of);Ie.registerLanguage("bash",af);Ie.registerLanguage("javascript",ff);Ie.registerLanguage("python",pf);const Gi=new Ei(od({emptyLangClass:"hljs",langPrefix:"hljs language-",highlight(e,t){if(!Ie.getLanguage(t))return e;try{return Ie.highlight(e,{language:t}).value}catch{return e}}}));Gi.use({extensions:[{name:"link",renderer(e){return`<a class="hover:underline hover:text-secondary-600" href="${e.href}" rel="noopener noreferrer" target="_blank">${e.text}</a>`}}]});function hf(e){return Gi.parse(e)}const mf={"--tw-prose-body":"rgb(var(--color-text-secondary) / 1)","--tw-prose-headings":"rgb(var(--color-text-primary) / 1)","--tw-prose-lead":"rgb(var(--color-text-secondary) / 1)","--tw-prose-links":"rgb(var(--color-primary-600) / 1)","--tw-prose-bold":"rgb(var(--color-text-primary) / 1)","--tw-prose-counters":"rgb(var(--color-text-muted) / 1)","--tw-prose-bullets":"rgb(var(--color-text-muted) / 1)","--tw-prose-hr":"rgb(var(--color-border) / 1)","--tw-prose-quotes":"rgb(var(--color-text-secondary) / 1)","--tw-prose-quote-borders":"rgb(var(--color-border) / 1)","--tw-prose-captions":"rgb(var(--color-text-muted) / 1)","--tw-prose-kbd":"rgb(var(--color-text-primary) / 1)","--tw-prose-code":"rgb(var(--color-text-secondary) / 1)","--tw-prose-th-borders":"rgb(var(--color-border) / 1)","--tw-prose-td-borders":"rgb(var(--color-border) / 1)"},Oe=({children:e,className:t=""})=>e?typeof e!="string"?o.jsx(o.Fragment,{children:e}):o.jsx("div",{className:`prose max-w-none prose-code:before:content-none prose-code:after:content-none ${t}`,style:mf,dangerouslySetInnerHTML:{__html:No.sanitize(hf(e))}}):null;function gf({className:e}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9m4.5-1.206a8.959 8.959 0 01-4.5 1.207"})})}function xf({className:e}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}function bf({className:e,...t}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",...t,children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 6l3 1m0 0l-3 9a5.002 5.002 0 006.001 0M6 7l3 9M6 7l6-2m6 2l3-1m-3 1l-3 9a5.002 5.002 0 006.001 0M18 7l3 9m-3-9l-6-2m0-2v2m0 16V5m0 16H9m3 0h3"})})}function yf({className:e}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"})})}function Nt({IconClass:e,term:t,visibleTerm:r=!0,text:n,href:s,vertical:i=!1,className:a=""}){const l=s?c=>o.jsx("a",{href:s,target:"_blank",...c}):c=>o.jsx("div",{...c});return o.jsxs("div",{className:`${!i&&"flex"} ${a}`,children:[o.jsx("dt",{children:o.jsxs(l,{className:"flex",children:[e&&o.jsx(e,{className:"w-5 h-5",title:`${n}`,alt:`${n}`}),r?o.jsx("span",{className:"pl-2 text-sm",children:t}):o.jsx("span",{className:"sr-only",children:t})]})}),o.jsxs("dd",{className:`${i&&"pt-2"} pl-2 text-sm`,children:[!r&&o.jsx(l,{children:n}),i&&o.jsx(l,{children:n})]})]})}function us({name:e,href:t,title:r}){return o.jsx("a",{className:`text-xs whitespace-nowrap break-all mt-2 rounded-md bg-neutral-300 py-[2px] px-[4px] mr-1 -mt-1 ${t&&"hover:bg-cyan-500 hover:text-white"}`,href:t,target:"_blank",title:r,children:e})}function kf({license:e,externalDocs:t,contact:r,tags:n,logo:s}){const i={licenseName:(e==null?void 0:e.name)??null,licenseUrl:(e==null?void 0:e.url)??null,externalDocsTitle:(t==null?void 0:t.description)??"External documentation",externalDocsUrl:(t==null?void 0:t.url)??null,externalDocsDescription:(t==null?void 0:t.description)??null,contactName:(r==null?void 0:r.name)??null,contactUrl:(r==null?void 0:r.url)??null,contactEmail:(r==null?void 0:r.email)??null,tags:n};return o.jsxs(o.Fragment,{children:[s&&o.jsx("div",{className:"hidden @lg:block mb-3",children:s}),o.jsxs("dl",{className:"flex flex-wrap @lg:flex-unwrap gap-2 ",children:[i.licenseName&&o.jsx(Nt,{IconClass:bf,text:`${i.licenseName} ${Ss}`,term:Ss,visibleTerm:!i.licenseName,href:i.licenseUrl,className:"text-foreground-secondary hover:text-pink-500"}),i.externalDocsUrl&&o.jsx(Nt,{IconClass:On,text:Ns,href:i.externalDocsUrl,term:Ns,visibleTerm:!i.externalDocsTitle,className:"text-foreground-secondary hover:text-secondary-500"}),i.contactEmail&&o.jsx(Nt,{IconClass:gf,text:`${i.contactEmail}`,term:sl,visibleTerm:!i.contactEmail,href:`mailto:${i.contactEmail}`,className:"text-foreground-secondary hover:text-green-500"}),i.contactUrl&&o.jsx(Nt,{IconClass:xf,text:`${i.contactName}`,term:rl,visibleTerm:!i.contactName,href:i.contactUrl,className:"text-foreground-secondary hover:text-green-500"})]}),o.jsx("dl",{className:"mt-[10px]",children:i.tags&&o.jsx(Nt,{IconClass:yf,term:ol,className:"mb-2 text-foreground-secondary inline-block",vertical:!0,text:i.tags&&o.jsx("div",{className:"flex flex-wrap gap-1 -ml-2",children:i.tags.map((a,l)=>{const c=a,u=c.externalDocs;return o.jsx(us,{href:u&&u.url,title:c.description||(u&&u.description?u.description:void 0),name:c.name},l)})})})})]})}const wf=[/^x-parser-/i,/^x-lib-/i];function vf(e){return wf.some(t=>t.test(e))}const ao=new Map;function jf(e){let t=ao.get(e);return t||(t=g.lazy(mi[e]),ao.set(e,t)),t}const Sf=e=>e.startsWith("x-"),ds=(e,t)=>e?e[t]:void 0;function Nf({source:e,pathPrefix:t}){const{showExtensions:r}=be();if(!r||!e)return null;const n=Object.keys(e).filter(s=>Sf(s)&&!vf(s)&&Object.prototype.hasOwnProperty.call(mi,s));return n.length===0?null:o.jsx(o.Fragment,{children:n.map(s=>{const i=jf(s);return o.jsx(g.Suspense,{fallback:null,children:o.jsx(i,{value:ds(e,s),path:`${t}.${s}`})},s)})})}const Af=g.lazy(ju),Vi=e=>Xr(ds(e,"x-logo"))!==null;function fs({source:e}){const t=ds(e,"x-logo");return Xr(t)?o.jsx(g.Suspense,{fallback:null,children:o.jsx(Af,{value:t,path:"info.x-logo"})}):null}function Ji({title:e,description:t,license:r,contact:n,externalDocs:s,tags:i,extensionsSource:a,layout:l,showLogo:c=!0}){const u=c?o.jsx(fs,{source:a}):null,d=o.jsx("div",{className:"mt-4 w-full",children:o.jsx(Oe,{children:t})}),f=o.jsxs(o.Fragment,{children:[o.jsx(kf,{logo:u,license:r,externalDocs:s,contact:n,tags:i}),a&&o.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:o.jsx(Nf,{source:a,pathPrefix:"info"})})]});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Xe,{title:e,content:d,sideContent:f,stickySideContent:!0,reverseLayoutOnMobile:!0,info:!0,mobileLeadContent:u,layout:l})})}const Zi=({title:e,description:t,license:r,externalDocs:n,contact:s,tags:i,layout:a,showLogo:l,...c})=>o.jsx(Ji,{title:e,description:t,license:r,externalDocs:n,contact:s,tags:i,extensionsSource:c,layout:a,showLogo:l}),Ef=1500,$f=320,Cf=48,Tf="#011627";function If(e){const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy")}catch{return!1}finally{document.body.removeChild(t)}}async function Of(e){try{return await navigator.clipboard.writeText(e),!0}catch{return If(e)}}function Pn({code:e,className:t,language:r="json",collapsedMaxHeight:n=$f}){const[s,i]=g.useState("idle"),a=g.useRef(void 0),[l,c]=g.useState(!1),[u,d]=g.useState(!1),[f,p]=g.useState(0),h=g.useRef(null),m=g.useRef(null),y=g.useId();g.useEffect(()=>()=>clearTimeout(a.current),[]),g.useEffect(()=>{const N=m.current;if(!N)return;const k=()=>{p(N.scrollHeight),d(N.scrollHeight>n+Cf)};k();const x=new ResizeObserver(k);return x.observe(N),()=>x.disconnect()},[e,r,n]);const b=()=>{Of(e).then(N=>{i(N?"copied":"error"),clearTimeout(a.current),a.current=setTimeout(()=>i("idle"),Ef)})},S=Ie.getLanguage(r)?Ie.highlight(e,{language:r}).value:null,w=s==="copied"?"Copied":s==="error"?"Copy failed":"Copy to clipboard",I=u&&!l,B=e.replace(/\n+$/,"").split(`
|
|
125
|
+
`).length,F=()=>{var N,k;l&&(((N=h.current)==null?void 0:N.getBoundingClientRect().top)??0)<0&&((k=h.current)==null||k.scrollIntoView({block:"nearest"})),c(x=>!x)};return o.jsxs("div",{ref:h,className:`relative ${t??""}`,children:[o.jsx("button",{type:"button",onClick:b,"aria-label":w,title:w,className:"absolute top-2 right-2 z-10 p-1 rounded text-foreground-muted hover:text-foreground-secondary hover:bg-neutral-100 transition-colors",children:s==="copied"?o.jsx(Vo,{className:"w-4 h-4 text-green-600"}):o.jsx(Go,{className:`w-4 h-4 ${s==="error"?"text-red-500":""}`})}),o.jsxs("div",{className:"relative",children:[o.jsx("pre",{ref:m,id:y,style:u?{maxHeight:l?f:n}:void 0,className:`text-xs rounded overflow-x-auto transition-[max-height] duration-300 ease-in-out ${u?"overflow-y-hidden":""}`,children:S!==null?o.jsx("code",{className:`hljs language-${r}`,dangerouslySetInnerHTML:{__html:No.sanitize(S)}}):o.jsx("code",{className:"hljs",children:e})}),u&&o.jsx("div",{"aria-hidden":"true",className:`pointer-events-none absolute inset-x-0 bottom-0 h-16 rounded-b transition-opacity duration-300 ease-in-out ${I?"opacity-100":"opacity-0"}`,style:{background:`linear-gradient(to bottom, transparent, ${Tf})`}})]}),u&&o.jsxs("button",{type:"button",onClick:F,"aria-expanded":l,"aria-controls":y,className:"flex items-center gap-1 mt-1 px-1 py-0.5 rounded text-xs text-foreground-muted hover:text-foreground-secondary transition-colors",children:[l?"Show less":`Show all ${B} lines`,o.jsx(yt,{className:`w-3 h-3 transition-transform ${l?"rotate-180":""}`})]})]})}const _f=/^x-parser-/i;function Nr(e,t=new Set){if(e!==null&&typeof e=="object"){if(t.has(e))return"[circular]";t.add(e);try{if(Array.isArray(e))return e.map(n=>Nr(n,t));const r={};for(const[n,s]of Object.entries(e))_f.test(n)||(r[n]=Nr(s,t));return r}finally{t.delete(e)}}return e}const Xi=({schema:e})=>{const t=typeof e=="string"?e:JSON.stringify(Nr(e),null,2);return o.jsx(Pn,{code:t})},lo=new Set,ps=e=>e.replace(/^#\//,"").split("/").pop()??e,Ar=e=>{const t=e["x-parser-schema-id"];return typeof t=="string"&&!t.startsWith("<")?t:void 0},Mf={objects:new Set,refs:new Set},Fe=(e,t,r)=>{if(!e.$ref)return{schema:e,refLabel:Ar(e)};const n=e.$ref,s=ps(n);if(r.has(n))return{schema:e,refLabel:s,circular:!0};const i=De(t(n));if(!i)return{schema:e,refLabel:s};const{schema:a}=Mt(i);r.add(n);try{const l=Fe(a,t,r);return{schema:l.schema,refLabel:l.circular?void 0:s,circular:l.circular}}finally{r.delete(n)}},st=e=>{const t=e.items,r=Array.isArray(t)?t[0]:t;return K(r)?r:null},Yi=e=>{const t=e.items;if(!Array.isArray(t)||t.length===0)return null;const r=t.filter(n=>K(n));return r.length>0?r:null},Rf=e=>!Array.isArray(e.items)||e.additionalItems===void 0?null:typeof e.additionalItems=="boolean"||K(e.additionalItems)?e.additionalItems:null,Pf=e=>e.contains===void 0?null:typeof e.contains=="boolean"||K(e.contains)?e.contains:null,Qi=e=>e.contains!==void 0,Nn=(e,t)=>{if(!(!e&&!t))return!t||e===t?e??t:e?`${e}
|
|
126
|
+
|
|
127
|
+
${t}`:t},Lf=new Set(["allOf","oneOf","anyOf","not","if","then","else","_allOfConditionals","$ref","properties","patternProperties","propertyNames","additionalProperties","required","description","items"]),Ge=(e,t,r,n)=>{if(e===t)return e;const s={...e};if(t.description&&(s.description=Nn(typeof s.description=="string"?s.description:void 0,typeof t.description=="string"?t.description:void 0)),t.required&&(s.required=Array.from(new Set([...s.required??[],...t.required]))),t.properties){s.properties={...s.properties??{}};for(const[i,a]of Object.entries(t.properties)){if(!K(a))continue;const l=s.properties[i];K(l)?s.properties[i]=Ge(l,a):s.properties[i]=a}}if(t.items)if(Array.isArray(t.items))Array.isArray(s.items)?s.items=t.items.map((i,a)=>{const l=s.items[a];return K(i)&&K(l)?Ge(l,i):K(i)?i:l}):s.items=t.items;else{const i=st(t),a=st(s);i&&a?s.items=Ge(a,i):i&&(s.items=t.items)}if(t.patternProperties&&K(t.patternProperties)){const i={...K(s.patternProperties)?s.patternProperties:{}};for(const[a,l]of Object.entries(t.patternProperties)){if(!K(l)){i[a]=l;continue}const c=i[a];K(c)?i[a]=Ge(c,l):i[a]=l}s.patternProperties=i}if(t.propertyNames!==void 0)if(K(t.propertyNames)){const i=s.propertyNames;s.propertyNames=K(i)?Ge(i,t.propertyNames):t.propertyNames}else s.propertyNames=t.propertyNames;if(t.additionalProperties!==void 0)if(K(t.additionalProperties)){const i=s.additionalProperties;s.additionalProperties=K(i)?Ge(i,t.additionalProperties):t.additionalProperties}else s.additionalProperties=t.additionalProperties;for(const[i,a]of Object.entries(t))Lf.has(i)||a===void 0||(s[i]=a);return s},co=(e,t,r,n)=>{const s={...e};delete s.allOf,s.properties&&(s.properties=Object.fromEntries(Object.entries(s.properties).map(([u,d])=>K(d)?[u,ye(d,t,r,n)]:[u,d])));const i=st(s);i&&(s.items=ye(i,t,r,n));const a=Ut(s);a!==null&&K(a)&&(s.propertyNames=ye(a,t,r,n));const l=kt(s);l!==null&&K(l)&&(s.additionalProperties=ye(l,t,r,n));const c=hs(s);return c.length>0&&(s.patternProperties=Object.fromEntries(c.map(([u,d])=>[u,ye(d,t,r,n)]))),s},ye=(e,t,r,n=new Set)=>{if(n.has(e))return e;n.add(e);try{const s=e.allOf;if(Array.isArray(s)&&s.length>0){const i=[];let a={};for(const d of s){if(!K(d))continue;const{schema:f,circular:p}=Fe(d,t,r);if(p)continue;const h=ye(f,t,r,n);if(h.if!==void 0){const m={if:h.if};h.then!==void 0&&(m.then=h.then),h.else!==void 0&&(m.else=h.else),i.push(m)}i.push(...ta(h)),a=Ge(a,h,t,r)}if(e.if!==void 0){const d={if:e.if};e.then!==void 0&&(d.then=e.then),e.else!==void 0&&(d.else=e.else),i.push(d)}const l={...e};delete l.allOf;const c=Object.keys(l).length>0?Ge(a,l,t,r):a,u=co(c,t,r,n);if(i.length===1){const d=i[0];u.if=d.if,d.then!==void 0&&(u.then=d.then),d.else!==void 0&&(u.else=d.else)}else i.length>1&&(u._allOfConditionals=i);return u}return co(e,t,r,n)}finally{n.delete(e)}},zt=e=>{const t=e.oneOf;if(!Array.isArray(t)||t.length===0)return null;const r=t.filter(n=>K(n));return r.length>0?r:null},Ht=e=>{const t=e.anyOf;if(!Array.isArray(t)||t.length===0)return null;const r=t.filter(n=>K(n));return r.length>0?r:null},qi=e=>e.not===void 0?null:typeof e.not=="boolean"||K(e.not)?e.not:null,ve=e=>qi(e)!==null,ea=e=>{const{not:t,...r}=e;return r},Bf=e=>{const{if:t,then:r,else:n,...s}=e;return s},Se=e=>e.if!==void 0,Zn=e=>e===void 0?null:typeof e=="boolean"||K(e)?e:null,ta=e=>Array.isArray(e._allOfConditionals)?e._allOfConditionals.filter(t=>K(t)):[],Ne=e=>Array.isArray(e._allOfConditionals)&&e._allOfConditionals.length>0,Ut=e=>e.propertyNames===void 0?null:typeof e.propertyNames=="boolean"||K(e.propertyNames)?e.propertyNames:null,kt=e=>e.additionalProperties===void 0?null:typeof e.additionalProperties=="boolean"||K(e.additionalProperties)?e.additionalProperties:null,hs=e=>{const t=e.patternProperties;return K(t)?Object.entries(t).flatMap(([r,n])=>K(n)?[[r,n]]:[]):[]},Df=(e,t)=>`${e}.[pattern:${t}]`,Wt=e=>e.properties!==void 0&&Object.keys(e.properties).length>0,Ln=e=>{const t=Ut(e);if(t!==null&&K(t))return!0;const r=kt(e);return r!==null&&K(r)?!0:hs(e).length>0},na=e=>!!(zt(e)||Ht(e)||Wt(e)||Ln(e)||e.type==="array"||e.items||e.type!==void 0),Te=e=>!(ve(e)||Se(e)||Ne(e)||zt(e)||Ht(e)||Wt(e)||Ln(e)||e.items||Qi(e)||e.type==="array"||e.type==="object");function Ff(e){if(typeof kt(e)=="boolean")return!0;const r=Ut(e);return!!(typeof r=="boolean"||r!==null&&K(r)&&Te(r)&&typeof r.pattern=="string"&&r.pattern.length>0)}function uo(e){return typeof e.multipleOf=="number"||typeof e.minimum=="number"||typeof e.exclusiveMinimum=="number"||typeof e.maximum=="number"||typeof e.exclusiveMaximum=="number"||typeof e.minLength=="number"||typeof e.maxLength=="number"||typeof e.minItems=="number"||typeof e.maxItems=="number"||typeof e.minProperties=="number"||typeof e.maxProperties=="number"||typeof e.pattern=="string"&&e.pattern.length>0||Array.isArray(e.enum)&&e.enum.length>0||e.const!==void 0||e.uniqueItems===!0||Ff(e)}const ra=(e,t)=>uo(e)?!0:t?uo(t):!1,zf=(e,t)=>{if(ve(e)||Se(e)||Ne(e)||zt(e)||Ht(e)||Wt(e)||Ln(e))return!0;if(e.type==="array"||e.items){if(Qi(e)||Yi(e)!==null)return!0;const r=st(e);if(!r)return!1;if(r.$ref&&t){const{schema:n}=Fe(r,t,lo),s=ye(n,t,lo);return!Te(s)}return!Te(r)}return!1};function sa(e){return JSON.stringify(e)}function fo(e){return typeof e=="string"?e:JSON.stringify(e)}function Ee({children:e}){return o.jsx("span",{className:"text-xs text-foreground-muted",children:e})}function oa({children:e,mono:t=!1,title:r}){return o.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",title:r,children:t?o.jsx("span",{className:"font-mono text-foreground",children:e}):e})}function Hf(e){return typeof e.exclusiveMinimum=="number"?{value:e.exclusiveMinimum,op:"<"}:typeof e.minimum=="number"?{value:e.minimum,op:"≤"}:null}function Uf(e){return typeof e.exclusiveMaximum=="number"?{value:e.exclusiveMaximum,op:"<"}:typeof e.maximum=="number"?{value:e.maximum,op:"≤"}:null}function Wf(e){return typeof e.minLength=="number"?{value:e.minLength,op:"≤"}:null}function Kf(e){return typeof e.maxLength=="number"?{value:e.maxLength,op:"≤"}:null}function po(e,t){const r=e[t];return typeof r=="number"?{value:r,op:"≤"}:null}function ho(e,t){const r=e[t];return typeof r=="number"?{value:r,op:"≤"}:null}function qt({name:e,lower:t,upper:r,suffix:n}){return!t&&!r?null:o.jsxs("span",{className:"inline-flex items-center gap-1",children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(Ee,{children:String(t.value)}),o.jsx(Ee,{children:t.op})]}),o.jsx(Ee,{children:e}),r&&o.jsxs(o.Fragment,{children:[o.jsx(Ee,{children:r.op}),o.jsx(Ee,{children:String(r.value)})]}),n&&o.jsx(Ee,{children:n})]})}function pn({value:e,displayValue:t}){const r=()=>{var i;(i=window.getSelection())!=null&&i.toString()||navigator.clipboard.writeText(fo(e))},n=s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),navigator.clipboard.writeText(fo(e)))};return o.jsx("span",{role:"button",tabIndex:0,className:"inline-flex cursor-pointer select-text items-center rounded-md bg-neutral-100 px-2 py-1 font-mono text-xs font-medium text-foreground hover:bg-neutral-200",title:"Click to copy",onClick:r,onKeyDown:n,children:t??sa(e)})}function Gf({schema:e}){const t=kt(e);return typeof t!="boolean"?null:o.jsx(Ee,{children:t?"additional properties allowed":"additional properties not allowed"})}function Vf({schema:e}){const t=Ut(e);return typeof t=="boolean"?o.jsx(oa,{children:t?"any property name":"no property names"}):t!==null&&K(t)&&Te(t)&&typeof t.pattern=="string"&&t.pattern.length>0?o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(Ee,{children:"property name pattern:"}),o.jsx(pn,{value:t.pattern,displayValue:t.pattern})]}):null}function mo({schema:e,rangeName:t="value"}){const r=Array.isArray(e.enum)&&e.enum.length>0?e.enum:null,n=Hf(e),s=Uf(e),i=Wf(e),a=Kf(e),l=po(e,"minItems"),c=ho(e,"maxItems"),u=po(e,"minProperties"),d=ho(e,"maxProperties");return o.jsxs(o.Fragment,{children:[typeof e.multipleOf=="number"&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(Ee,{children:"multiple of :"}),o.jsx(oa,{children:String(e.multipleOf)})]}),(n||s)&&o.jsx(qt,{name:t,lower:n,upper:s}),(i||a)&&o.jsx(qt,{name:t,lower:i,upper:a,suffix:"chars"}),(l||c)&&o.jsx(qt,{name:t,lower:l,upper:c,suffix:"items"}),(u||d)&&o.jsx(qt,{name:t,lower:u,upper:d,suffix:"props"}),typeof e.pattern=="string"&&e.pattern.length>0&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(Ee,{children:"regex pattern:"}),o.jsx(pn,{value:e.pattern,displayValue:e.pattern})]}),r&&o.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1",children:[o.jsx(Ee,{children:"enum values:"}),r.map((f,p)=>o.jsx(pn,{value:f},`${p}-${sa(f)}`))]}),e.const!==void 0&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(Ee,{children:"const value:"}),o.jsx(pn,{value:e.const})]}),e.uniqueItems===!0&&o.jsx(Ee,{children:"unique"}),o.jsx(Gf,{schema:e}),o.jsx(Vf,{schema:e})]})}function ia({schema:e,itemSchema:t,fieldName:r,className:n="flex flex-col gap-1"}){const s=t!=null&&Te(t),i=r??"value";return o.jsxs("div",{className:n,children:[o.jsx(mo,{schema:e,rangeName:i}),s&&o.jsx(mo,{schema:t,rangeName:"item"})]})}const aa=(e,t)=>{const r=zt(e);if(r)return{text:`one of (${r.length})`};const n=Ht(e);if(n)return{text:`any of (${n.length})`};if(ve(e)&&!na(ea(e)))return{text:"not"};if(e.type==="array"||e.items){const u=st(e);if(u){const d=u.type;if(d==="object"){const f=u.$ref?ps(u.$ref):t;return f?{text:"Array of objects",refHint:f}:{text:"Array of objects"}}if(typeof d=="string"){const f=typeof u.format=="string"?u.format:void 0;return{text:`Array of ${d}`,format:f}}}return{text:"array"}}const s=Array.isArray(e.type)?e.type.join(" | "):e.type;let i=s?`${s}`:"type: unknown";const a=kt(e);!Wt(e)&&a!==null&&K(a)&&(s==="object"||i==="type: unknown")&&(i=s==="object"?"object (map)":"map");const l=typeof e.format=="string"?e.format:void 0,c=t&&(s==="object"||i.startsWith("object"))?t:void 0;return{text:i,format:l,refHint:c}},Jf=(e,t)=>{if(!t)return!1;const r=aa(e,t);return!r.refHint&&!r.text.includes(`(${t})`)};function la({schema:e,refLabel:t,className:r="text-xs text-foreground-muted"}){const{text:n,format:s,refHint:i}=aa(e,t);return o.jsxs("span",{className:r,children:[s??n,i&&!n.includes(`(${i})`)&&o.jsxs("span",{className:"text-foreground-muted",children:[" (",i,")"]})]})}const go="ml-6";function en({schema:e,showBorder:t=!0}){const r=typeof e.description=="string"?e.description:void 0;return o.jsxs("div",{className:`py-2 ${t?"border-b border-border last:border-b-0":""}`,children:[o.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[o.jsx("span",{className:"w-4 shrink-0","aria-hidden":"true"}),o.jsx(la,{schema:e})]}),ra(e)&&o.jsx(ia,{schema:e,className:`flex flex-col gap-1 mt-1 ${go}`}),r&&r.split(`
|
|
128
|
+
|
|
129
|
+
`).map((n,s)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${go} leading-relaxed`,children:n},s))]})}function Xn({children:e}){return o.jsxs("div",{className:"py-2",children:[o.jsxs("div",{className:"flex flex-col items-start",children:[o.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border border-border rounded-md bg-surface",children:"Should Not match:"}),o.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),e]})}function Zf({value:e}){const t=e?"any value":"false schema";return o.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:t})}function ca({tabs:e,selected:t,onChange:r,ariaLabel:n}){const s=g.useRef([]),i=l=>(l+e.length)%e.length,a=(l,c)=>{var d;let u=c;l.key==="ArrowRight"&&(l.preventDefault(),u=i(c+1)),l.key==="ArrowLeft"&&(l.preventDefault(),u=i(c-1)),l.key==="Home"&&(l.preventDefault(),u=0),l.key==="End"&&(l.preventDefault(),u=e.length-1),u!==c&&(r(e[u].id),(d=s.current[u])==null||d.focus())};return o.jsx("div",{className:"inline-flex items-center gap-0.5 p-0.5 bg-neutral-100 rounded-md border border-border",role:"tablist","aria-label":n,children:e.map(({id:l,label:c},u)=>{const d=l===t;return o.jsx("button",{ref:f=>{s.current[u]=f},type:"button",role:"tab","aria-selected":d,tabIndex:0,onClick:()=>r(l),onKeyDown:f=>a(f,u),className:d?"px-3 py-1 text-xs font-semibold text-foreground bg-surface rounded-md shadow-sm border border-border":"px-3 py-1 text-xs font-medium text-foreground-muted hover:text-foreground-secondary rounded-md",children:c},l)})})}function Xf({variant:e="oneOf",caseCount:t,caseLabels:r,selectedCase:n,onSelectCase:s,children:i}){if(t===0)return null;const a=(r==null?void 0:r.length)===t?r:Array.from({length:t},(u,d)=>`case ${d+1}`),l=e==="anyOf"?"Any of:":"One of:",c=e==="anyOf"?"Any of cases":"One of cases";return o.jsxs("div",{className:"py-2",children:[o.jsxs("div",{className:"flex flex-col items-start",children:[o.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border border-border rounded-md bg-surface",children:l}),o.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),o.jsx(ca,{tabs:a.map((u,d)=>({id:String(d),label:u})),selected:String(n),onChange:u=>s(Number(u)),ariaLabel:c}),o.jsx("div",{role:"tabpanel",className:"mt-2",children:i})]})}const Yf="ml-0 border-dashed border-border";function tt({depth:e,children:t,lineVariant:r="depth"}){const{depthColors:n}=be();return r==="none"?o.jsx("div",{children:t}):r==="muted"?o.jsx("div",{className:`pl-3 border-l-2 ${Yf}`,children:t}):o.jsx("div",{className:"pl-3 border-l-2 ml-1.5",style:{borderColor:_r(e,n)},children:t})}function Qf({depth:e,expanded:t,onToggle:r}){const{depthColors:n}=be(),s=_r(e,n);return o.jsxs("button",{type:"button",onClick:r,"aria-expanded":t,"aria-label":t?"Hide details":void 0,className:"cursor-pointer mt-1 flex items-center gap-1.5 shrink-0 text-left hover:opacity-80",children:[o.jsx("span",{"aria-hidden":"true",className:"w-4 h-4 rounded-full border-2 flex items-center justify-center text-[10px] leading-none font-bold hover:bg-neutral-100",style:{borderColor:s,color:s},children:t?"−":"+"}),!t&&o.jsx("span",{className:"text-xs text-foreground-muted",children:"Show details"})]})}const qf="ml-6";function we({id:e,path:t,depth:r,schema:n,refLabel:s,itemSchema:i,typeLabelOverride:a,required:l,description:c,expandable:u,expanded:d,onToggle:f,showBorder:p=!0}){const{depthColors:h}=be(),m=_r(r,h),y=n&&Jf(n,s),b=u?qf:"";let v="",S=t;if(t.endsWith("[]")){const w=t.slice(0,-2),I=w.lastIndexOf(".");I>=0?(v=w.slice(0,I+1),S=`${w.slice(I+1)}[]`):S=t}else{const w=t.lastIndexOf("."),I=t.lastIndexOf("[]"),B=Math.max(w,I);B>=0&&(v=t.slice(0,B+(t[B]==="."?1:2)),S=t.slice(B+(t[B]==="."?1:2)))}return p=p&&!d,o.jsxs("div",{id:e,className:`py-2 ${p?"border-b border-border last:border-b-0":""}`,children:[o.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[o.jsxs("span",{className:"text-xs font-mono flex-1 min-w-0 flex items-center",children:[o.jsxs("span",{className:"truncate min-w-0",children:[v&&o.jsx("span",{className:"text-foreground-muted",children:v}),o.jsx("span",{className:"font-semibold",style:{color:m},children:S})]}),l&&o.jsx("span",{className:"shrink-0 text-red-500 ml-2 text-[10px]",children:"required"}),(n==null?void 0:n.readOnly)===!0&&o.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"readOnly"}),(n==null?void 0:n.writeOnly)===!0&&o.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"writeOnly"}),(n==null?void 0:n.deprecated)===!0&&o.jsx("span",{className:"shrink-0 text-amber-600 ml-2 text-[10px]",children:"deprecated"})]}),n?o.jsxs("div",{className:"shrink-0 text-right",children:[o.jsx(la,{schema:n,refLabel:s}),y&&o.jsxs("span",{className:"text-xs text-foreground-muted",children:[" (ref: ",s,")"]})]}):a&&o.jsx("span",{className:"text-xs text-foreground-muted shrink-0",children:a})]}),n&&ra(n,i)&&o.jsx(ia,{schema:n,itemSchema:i,fieldName:S,className:`flex flex-col gap-1 mt-1 ${b}`}),c&&c.split(`
|
|
130
|
+
|
|
131
|
+
`).map((w,I)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${b} leading-relaxed`,children:w},I)),u&&o.jsx(Qf,{depth:r,expanded:d,onToggle:f})]})}function Yn({label:e,children:t}){return o.jsxs("div",{children:[o.jsx("div",{className:"pt-2 pb-0.5 first:pt-0",children:o.jsx("span",{className:"text-xs font-medium text-foreground-secondary",children:e})}),o.jsx("div",{children:t})]})}function ep({ifContent:e,thenContent:t,elseContent:r}){return o.jsxs("div",{className:"py-2 pt-5 px-1",children:[o.jsx("div",{className:"flex flex-col items-start",children:o.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border-2 border-dashed border-border rounded-md bg-surface",children:"Conditions apply:"})}),o.jsx(tt,{depth:0,lineVariant:"muted",children:o.jsxs("div",{className:"divide-y divide-border",children:[o.jsx(Yn,{label:"If schema matches:",children:e}),t!=null&&o.jsx(Yn,{label:"Then schema should follow:",children:t}),r!=null&&o.jsx(Yn,{label:"Else schema should follow:",children:r})]})})]})}function tn({label:e,children:t}){return o.jsxs("div",{className:"py-2",children:[o.jsxs("div",{className:"flex flex-col items-start",children:[o.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border border-border rounded-md bg-surface",children:e}),o.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),t]})}const tp=e=>e==="none"?"depth":e;function Ce({schema:e,path:t,depth:r,required:n,refStack:s,deref:i,suppressRow:a=!1,branchLineVariant:l="depth",defaultExpanded:c=!1,ancestors:u=Mf,focusTokens:d=null,focusId:f=null}){var se;const p=tp(l),h=d!=null,y=h&&d.length===0?f??void 0:void 0,[b,v]=g.useState(c||h),[S,w]=g.useState(c);S!==c&&(w(c),v(c||h)),g.useEffect(()=>{h&&v(!0)},[h]);const[I,B]=g.useState(0),F=(se=d==null?void 0:d[0])==null?void 0:se.match(/^(?:oneOf|anyOf)\[(\d+)\]$/),N=F?Number(F[1]):-1;g.useEffect(()=>{N>=0&&B(N)},[N]);const k=Vr(),{schema:x,refLabel:$,circular:T}=g.useMemo(()=>{if(u.objects.has(e)||typeof e.$ref=="string"&&u.refs.has(e.$ref))return{schema:e,refLabel:Ar(e),circular:!0};const E=Fe(e,i,s);return E.circular?E:{...E,schema:ye(E.schema,i,s)}},[e,i,s,u,k]),C=g.useMemo(()=>({objects:new Set(u.objects).add(e),refs:typeof e.$ref=="string"?new Set(u.refs).add(e.$ref):u.refs}),[u,e]),P=ea(Bf(x)),z=!na(P)&&(ve(x)||Se(x)||Ne(x)),G=()=>{const E=qi(x);if(E===null)return null;if(typeof E=="boolean")return o.jsx(Xn,{children:o.jsx(Zf,{value:E})});const L=Fe(E,i,s);if(L.circular)return o.jsx(Xn,{children:o.jsx(we,{path:t,depth:r+1,typeLabelOverride:`↩ ${E.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1})});const J=ye(L.schema,i,s),Z=Te(J);return o.jsx(Xn,{children:Z?o.jsx(en,{schema:J,showBorder:!1}):o.jsx(Ce,{schema:E,path:t,depth:r+1,refStack:s,deref:i,ancestors:C,suppressRow:!0,branchLineVariant:p,defaultExpanded:c})})},j=(E,L)=>{if(typeof E=="boolean")return o.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:E?"any value":"false schema"});const J=Fe(E,i,s);if(J.circular)return o.jsx(we,{path:L,depth:r+1,typeLabelOverride:`↩ ${E.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const Z=ye(J.schema,i,s);return Te(Z)?o.jsx(en,{schema:Z,showBorder:!1}):o.jsx(Ce,{schema:E,path:L,depth:r+1,refStack:s,deref:i,ancestors:C,suppressRow:!0,branchLineVariant:"none",defaultExpanded:c})},A=E=>{const L=Zn(E.if);if(L===null)return null;const J=Zn(E.then),Z=Zn(E.else);return o.jsx(ep,{ifContent:j(L,t),thenContent:J!==null?j(J,t):void 0,elseContent:Z!==null?j(Z,t):void 0})},M=()=>{const E=ta(x);return E.length===0?null:o.jsx(o.Fragment,{children:E.map((L,J)=>o.jsx("div",{children:A(L)},J))})};if(T)return o.jsx(we,{id:y,path:t,depth:r,typeLabelOverride:`↩ ${e.$ref??$??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{}});if(z){const E=o.jsxs(o.Fragment,{children:[ve(x)&&G(),Se(x)&&A(x),Ne(x)&&M()]});return a?E:o.jsxs(o.Fragment,{children:[o.jsx(we,{id:y,path:t,depth:r,schema:x,refLabel:$,required:n,description:x.description,expandable:!0,expanded:b,onToggle:()=>v(L=>!L)}),b&&o.jsx(tt,{depth:r,lineVariant:l,children:E})]})}const V=zt(P),Y=Ht(P),te=V??Y,ue=V?"oneOf":"anyOf";if(te){const E=te.map((fe,D)=>typeof fe.title=="string"?fe.title:`case ${D+1}`),L=a?1:r+1,J=te[I],Z=Fe(J,i,s),oe=Z.circular?Z.schema:ye(Z.schema,i,s),H=!Z.circular&&Te(oe),Q=d&&N===I?d.slice(1):null,he=H?o.jsx(en,{schema:oe,showBorder:!1}):o.jsx(Ce,{schema:J,path:t,depth:L-1,refStack:s,deref:i,ancestors:C,suppressRow:!0,branchLineVariant:"none",defaultExpanded:c,focusTokens:Q,focusId:f},I),q=o.jsx(Xf,{variant:ue,caseCount:te.length,caseLabels:E,selectedCase:I,onSelectCase:B,children:he}),$e=o.jsxs(o.Fragment,{children:[q,ve(x)&&G(),Se(x)&&A(x),Ne(x)&&M()]});return a?$e:o.jsxs(o.Fragment,{children:[o.jsx(we,{id:y,path:t,depth:r,schema:x,refLabel:$,required:n,description:x.description,expandable:!0,expanded:b,onToggle:()=>v(fe=>!fe)}),b&&o.jsx(tt,{depth:r,lineVariant:l,children:$e})]})}const de=(E,L,J)=>{const Z=Fe(E,i,s);if(Z.circular)return o.jsx(we,{path:L,depth:J,typeLabelOverride:`↩ ${E.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const oe=ye(Z.schema,i,s);return Te(oe)?o.jsx(en,{schema:oe,showBorder:!1}):o.jsx(Ce,{schema:E,path:L,depth:J,refStack:s,deref:i,ancestors:C,branchLineVariant:p,defaultExpanded:c})},le=E=>{const L=P.properties??{},J=new Set(P.required??[]),Z=Ut(P),oe=kt(P),H=hs(P);return o.jsxs(o.Fragment,{children:[Object.entries(L).map(([Q,he])=>{if(!K(he))return null;const q=d&&d[0]==="properties"&&d[1]===Q?d.slice(2):null;return o.jsx(Ce,{schema:he,path:`${t}.${Q}`,depth:E,required:J.has(Q),refStack:s,deref:i,ancestors:C,branchLineVariant:p,defaultExpanded:c,focusTokens:q,focusId:f},Q)}),Z!==null&&K(Z)&&o.jsx(tn,{label:"Property names must adhere to:",children:de(Z,`${t}.[propertyName]`,E)}),H.map(([Q,he])=>o.jsx(Ce,{schema:he,path:Df(t,Q),depth:E,refStack:s,deref:i,ancestors:C,branchLineVariant:p,defaultExpanded:c},Q)),oe!==null&&K(oe)&&o.jsx(tn,{label:"Additional properties must adhere to:",children:de(oe,`${t}.[additionalProperty]`,E)}),ve(x)&&G(),Se(x)&&A(x),Ne(x)&&M()]})};if(Wt(P)||Ln(P))return a?le(r+1):o.jsxs(o.Fragment,{children:[o.jsx(we,{id:y,path:t,depth:r,schema:x,refLabel:$,required:n,description:x.description,expandable:!0,expanded:b,onToggle:()=>v(E=>!E)}),b&&o.jsx(tt,{depth:r,lineVariant:l,children:le(r+1)})]});if(P.type==="array"||P.items){const E=Yi(P),L=E!==null,J=L?Rf(P):null,Z=Pf(P),oe=Z!==null,H=L?null:st(P),Q=H!==null,he=L||Q||oe||ve(x)||Se(x)||Ne(x),q=`${t}[]`,$e=a?t:q,fe=Q?Fe(H,i,s):null,D=(fe==null?void 0:fe.schema)??null,ge=D?ye(D,i,s):null,pe=D!==null&&(C.objects.has(D)||typeof(H==null?void 0:H.$ref)=="string"&&C.refs.has(H.$ref)),ne=D!==null?{objects:new Set(C.objects).add(D),refs:typeof(H==null?void 0:H.$ref)=="string"?new Set(C.refs).add(H.$ref):C.refs}:C,qe=!L&&!oe&&ge!==null&&Te(ge),Me=ge!=null&&ge.properties?Object.entries(ge.properties).filter(([,R])=>K(R)):[],wt=new Set(ge&&Array.isArray(ge.required)?ge.required:[]),Le=!L&&d&&d[0]==="items"?d.slice(1):null,O=R=>o.jsxs(o.Fragment,{children:[L?o.jsxs(o.Fragment,{children:[E.map((W,X)=>o.jsx(Ce,{schema:W,path:`${t}[${X}]`,depth:R,refStack:s,deref:i,ancestors:C,branchLineVariant:p,defaultExpanded:c},X)),J!==null&&typeof J!="boolean"&&o.jsx(tn,{label:"Additional items:",children:de(J,`${t}[*]`,R)}),J===!1&&o.jsx("div",{className:"py-1 pl-6 text-xs text-foreground-muted",children:"no additional items allowed"})]}):Q&&(pe?o.jsx(we,{path:$e,depth:R,typeLabelOverride:`↩ ${H.$ref??Ar(D)??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1}):Me.length>0?Me.map(([W,X])=>{const me=Le&&Le[0]==="properties"&&Le[1]===W?Le.slice(2):null;return o.jsx(Ce,{schema:X,path:`${$e}.${W}`,depth:R,required:wt.has(W),refStack:s,deref:i,ancestors:ne,branchLineVariant:p,defaultExpanded:c,focusTokens:me,focusId:f},W)}):o.jsx(Ce,{schema:H,path:$e,depth:R,refStack:s,deref:i,ancestors:ne,branchLineVariant:p,defaultExpanded:c,focusTokens:Le,focusId:f})),oe&&o.jsx(tn,{label:"Contains at least one:",children:typeof Z=="boolean"?o.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:Z?"any item":"impossible constraint"}):de(Z,`${t}[contains]`,R)}),ve(x)&&G(),Se(x)&&A(x),Ne(x)&&M()]});return qe&&!ve(x)&&!Se(x)&&!Ne(x)?o.jsx(we,{id:y,path:q,depth:r,schema:x,itemSchema:ge,refLabel:$,required:n,description:Nn(x.description,ge.description),expandable:!1,expanded:!1,onToggle:()=>{}}):qe?o.jsxs(o.Fragment,{children:[o.jsx(we,{id:y,path:q,depth:r,schema:x,itemSchema:ge,refLabel:$,required:n,description:Nn(x.description,ge.description),expandable:!0,expanded:b,onToggle:()=>v(R=>!R)}),b&&o.jsxs(tt,{depth:r,lineVariant:l,children:[ve(x)&&G(),Se(x)&&A(x),Ne(x)&&M()]})]}):a?he?O(r+1):null:o.jsxs(o.Fragment,{children:[o.jsx(we,{id:y,path:q,depth:r,schema:x,itemSchema:ge,refLabel:$,required:n,description:x.description,expandable:L||Q||oe||ve(x)||Se(x)||Ne(x),expanded:b,onToggle:()=>v(R=>!R)}),b&&o.jsx(tt,{depth:r,lineVariant:l,children:O(r+1)})]})}if(ve(x)||Se(x)||Ne(x)){const E=o.jsxs(o.Fragment,{children:[ve(x)&&G(),Se(x)&&A(x),Ne(x)&&M()]});return a?E:o.jsxs(o.Fragment,{children:[o.jsx(we,{id:y,path:t,depth:r,schema:x,refLabel:$,required:n,description:x.description,expandable:!0,expanded:b,onToggle:()=>v(L=>!L)}),b&&o.jsx(tt,{depth:r,lineVariant:l,children:E})]})}return a?null:o.jsx(we,{id:y,path:t,depth:r,schema:x,refLabel:$,required:n,description:x.description,expandable:!1,expanded:!1,onToggle:()=>{}})}function ms({schema:e,rootName:t,className:r="",focusTokens:n=null,focusId:s=null}){const{deref:i,defaultSchemaExpanded:a=!1}=be(),l=g.useMemo(()=>new Set,[]),c=De(e),u=g.useMemo(()=>c?ye(c,i,l):null,[c,i,l]);if(!c||!u)return o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No schema details available."});const d=t??(c.$ref?ps(c.$ref):void 0)??"schema",f=!!t;if(!zf(u,i)&&!c.$ref){if(f)return u.type==="array"||u.items?o.jsx("div",{className:r,children:o.jsx(Ce,{schema:c,path:d,depth:0,refStack:l,deref:i,defaultExpanded:a,focusTokens:n,focusId:s})}):null;const h=u.type==="array"||u.items?`${d}[]`:d,m=st(u),y=m?ye(m,i,l):null,b=y!==null&&Te(y);return o.jsx("div",{className:r,children:o.jsx(we,{path:h,depth:0,schema:u,itemSchema:b?y:void 0,description:u.type==="array"||u.items?Nn(u.description,m==null?void 0:m.description):u.description,expandable:!1,expanded:!1,onToggle:()=>{}})})}return o.jsx("div",{className:r,children:o.jsx(Ce,{schema:c,path:d,depth:f?-1:0,refStack:l,deref:i,suppressRow:f,defaultExpanded:a,focusTokens:n,focusId:s})})}const np=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function nn(e,t){return e.type===t||Array.isArray(e.type)&&e.type.includes(t)}function dt(e,t=()=>{},r=new Set,n=new Set){if(typeof e.$ref=="string"){const s=e.$ref,i=t(s);return np(i)?n.has(s)?nn(i,"null")?{type:"null"}:{}:dt(i,t,new Set,new Set(n).add(s)):{}}if(r.has(e))return nn(e,"null")?{type:"null"}:{};if(Array.isArray(e.oneOf)&&e.oneOf.length>0){const{oneOf:s,...i}=e;return dt({...i,...s[0]},t,r,n)}if(Array.isArray(e.anyOf)&&e.anyOf.length>0){const{anyOf:s,...i}=e;return dt({...i,...s[0]},t,r,n)}if(nn(e,"object")&&e.properties&&typeof e.properties=="object"){r.add(e);try{const s={};for(const[i,a]of Object.entries(e.properties)){const l=/id$/i.test(i)&&a.type==="string"&&!a.format&&!a.examples,c=a.type==="string"&&!a.format&&!a.examples&&!a.enum;s[i]=l?{...a,format:"uuid"}:c?{...a,examples:["string"]}:dt(a,t,r,n)}return{...e,properties:s}}finally{r.delete(e)}}if(nn(e,"array")&&e.items&&typeof e.items=="object"){r.add(e);try{return{...e,items:dt(e.items,t,r,n)}}finally{r.delete(e)}}return e}function rp({schema:e,providedExample:t}){const r=t!==void 0,[n,s]=g.useState(r?t:null),{deref:i}=be();if(g.useEffect(()=>{if(r){s(t);return}let l=!1;return Promise.resolve().then(()=>require("./index-d8kJa7YD.cjs")).then(({generate:c})=>c(dt(e,i),{seed:42,useExamplesValue:!0,optionalsProbability:1})).then(c=>{l||s(c)}).catch(()=>{}),()=>{l=!0}},[e,i,r,t]),n===null)return null;const a=JSON.stringify(n,null,2);return o.jsxs("div",{children:[o.jsx(Pn,{code:a}),!r&&o.jsx("span",{className:"text-xs text-foreground-muted italic mt-2 font-bold inline-block",children:"This example is auto generated"})]})}function ot({schema:e,label:t,rootName:r,description:n,schemaFormat:s,originalSchema:i,conversionError:a,pendingConversion:l,example:c,defaultView:u="example"}){const d=li(s),f=!l&&pu(s,a),[p,h]=g.useState(f&&u==="example"?"example":"schema");return g.useEffect(()=>{!f&&p==="example"&&h("schema")},[f,p]),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider",children:t}),d&&o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",title:s,children:d})]}),n&&o.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed mt-2 mb-2",children:n})]}),o.jsx(ca,{tabs:[...f?[{id:"example",label:"Example"}]:[],{id:"schema",label:"Schema"},{id:"json",label:"JSON"}],selected:p,onChange:m=>h(m),ariaLabel:"Schema view toggle"})]}),a&&o.jsxs("p",{className:"text-xs text-amber-700 bg-amber-50 border border-amber-200 rounded px-2 py-1.5 mb-2",children:["Could not convert ",ci(s)??"the"," schema, showing raw definition. ",a]}),l?o.jsx("p",{className:"text-xs text-foreground-muted",children:"Loading Protobuf definition…"}):o.jsxs(o.Fragment,{children:[p==="schema"&&o.jsx(ms,{schema:e,rootName:r??(typeof t=="string"?t:void 0)}),p==="json"&&o.jsx(Xi,{schema:i??e}),p==="example"&&f&&o.jsx(rp,{schema:e,providedExample:c})]})]})}function ua({message:e,expanded:t,onToggleExpanded:r,paddingX:n="px-4",focusSection:s=null}){var h;const[i,a]=g.useState("payload");g.useEffect(()=>{(s==="headers"||s==="payload")&&a(s)},[s]);const{deref:l}=be(),c=Vr(),u=g.useMemo(()=>e.payload?Mt(e.payload,l):null,[e.payload,l,c]),d=g.useMemo(()=>e.headers?Mt(e.headers,l):null,[e.headers,l,c]),f=(h=e.examples)==null?void 0:h[0],p=e.description||e.payload||e.headers||e.deprecated||e.tags&&e.tags.length>0;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`grid transition-all duration-200 ease-in-out ${t?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:o.jsx("div",{className:"overflow-hidden",children:o.jsxs("div",{className:`${n} pb-4 space-y-4 border-t border-border pt-3`,children:[e.description&&o.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed",children:e.description}),(e.payload||e.headers)&&o.jsxs("div",{children:[e.payload&&e.headers&&o.jsx(it,{tabs:[{id:"payload",name:"Payload"},{id:"headers",name:"Headers"}],current:i,onChange:m=>a(m)}),o.jsxs("div",{className:"mt-4",children:[(i==="payload"||!e.headers)&&u&&o.jsx(ot,{schema:u.schema,label:"Payload",description:u.description,schemaFormat:u.schemaFormat,originalSchema:u.originalSchema,conversionError:u.conversionError,pendingConversion:u.pendingConversion,example:f==null?void 0:f.payload}),(i==="headers"||!e.payload)&&d&&o.jsx(ot,{schema:d.schema,label:"Headers",description:d.description,schemaFormat:d.schemaFormat,originalSchema:d.originalSchema,conversionError:d.conversionError,pendingConversion:d.pendingConversion,example:f==null?void 0:f.headers})]})]}),e.tags&&e.tags.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map((m,y)=>o.jsx(us,{name:`#${m.name}`},y))})]})})}),p&&o.jsxs("button",{onClick:r,className:"w-full flex items-center justify-center gap-1.5 py-2 border-t border-border bg-neutral-50 hover:bg-neutral-100 transition-colors text-xs text-foreground-muted hover:text-foreground-secondary",children:[o.jsx("span",{children:t?"Show less":"Show more"}),o.jsx(yt,{className:`w-3 h-3 transition-transform duration-200 ${t?"rotate-180":""}`})]})]})}function sp({messageKey:e,message:t,first:r,isSelected:n,focusSection:s}){const[i,a]=g.useState(!1);return g.useEffect(()=>{n&&a(!0)},[n]),o.jsxs("tbody",{id:`message-${e}`,className:`${r?"":"border-t border-border"} ${n?"bg-primary-50/60 outline outline-1 outline-primary-300":""}`,children:[o.jsxs("tr",{className:"",children:[o.jsx("td",{className:"px-6 py-4",children:o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.title??t.name??e}),o.jsx("span",{className:"w-fit text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200 px-1.5 py-0.5 rounded",children:e})]})}),o.jsx("td",{className:"px-6 py-4 text-sm text-foreground-muted",children:t.summary??"—"}),o.jsx("td",{className:"px-6 py-4",children:o.jsxs("div",{className:"flex flex-col items-start gap-1.5",children:[o.jsxs("div",{className:"flex justify-between w-full",children:[o.jsx("div",{}),o.jsx("div",{children:t.contentType&&o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",children:t.contentType??"—"})})]}),t.deprecated&&o.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"}),o.jsxs("div",{className:"flex justify-between w-full",children:[o.jsx("div",{}),o.jsx("div",{children:t.correlationId&&o.jsx("span",{className:"text-xs bg-secondary-50 text-secondary-500 px-1.5 py-0.5 rounded border border-secondary-200",title:t.correlationId.description??t.correlationId.location,children:t.correlationId.location})})]})]})})]}),o.jsx("tr",{children:o.jsx("td",{colSpan:3,className:"p-0",children:o.jsx(ua,{message:t,expanded:i,onToggleExpanded:()=>a(l=>!l),paddingX:"px-6",focusSection:n?s:null})})})]})}function da({messages:e,selectedKey:t,focusSection:r,layout:n}){const s=Object.entries(e),i=s.length?o.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{className:"bg-neutral-100",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Message"}),o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Summary"}),o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Details"})]})}),s.map(([a,l],c)=>o.jsx(sp,{messageKey:a,message:l,first:c===0,isSelected:t===a,focusSection:r},a))]})})}):o.jsx("div",{className:"mt-10 rounded-xl border border-dashed border-neutral-300 bg-surface p-8 text-center text-sm text-foreground-muted",children:"No messages defined in this AsyncAPI document."});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Xe,{content:i,stickySideContent:!1,layout:n})})}function fa({serverNames:e=[],current:t,setCurrent:r}){return o.jsx("nav",{className:"space-y-1 w-max mt-10 @lg:mt-0","aria-label":"Sidebar",children:e.map(n=>o.jsx("button",{type:"button",onClick:()=>r(n),"aria-current":t===n?"page":void 0,className:et(t===n?"border-l-4 border-neutral-300 text-foreground":"text-foreground-secondary hover:text-foreground","flex items-center px-3 py-2 text-sm font-medium cursor-pointer w-full text-left"),children:o.jsx("span",{className:"truncate",children:n})},n))})}function pa(e){return o.jsx(Lr,{...e,children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})})}function op(e){return o.jsx(Lr,{...e,children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})})}function ha({address:e,variables:t,children:r}){return o.jsxs("div",{className:"font-bold text-foreground-secondary mt-8 mb-4 bg-neutral-200 border border-neutral-500 p-4 rounded-lg",children:[o.jsxs("div",{className:"border border-dotted border-black p-2 rounded-lg bg-surface",children:[o.jsx(op,{className:"inline-block mr-1 -mt-1 h-6 text-foreground-muted"}),e&&o.jsx(Je,{address:e,parameters:t,className:"font-bold leading-tight tracking-tight px-0"})]}),r]})}function ma({className:e}){return o.jsx("svg",{viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",className:e,fill:"currentColor",children:o.jsx("path",{d:"M202.1,450a15,15,0,0,1-10.6-25.61L365.79,250.1,191.5,75.81A15,15,0,0,1,212.71,54.6l184.9,184.9a15,15,0,0,1,0,21.21l-184.9,184.9A15,15,0,0,1,202.1,450Z"})})}function Kt({trigger:e,children:t,defaultExpanded:r=!1,forceExpanded:n=!1,ariaLabelledBy:s,className:i=""}){const[a,l]=g.useState(r),c=g.useId();return g.useEffect(()=>{n&&l(!0)},[n]),o.jsxs("div",{className:`rounded-lg border border-border overflow-hidden ${i}`,children:[o.jsxs("button",{type:"button","aria-expanded":a,"aria-controls":c,"aria-labelledby":s,onClick:()=>l(u=>!u),className:"flex w-full items-center justify-between px-4 py-3 bg-neutral-50 text-left hover:bg-neutral-100 transition-colors",children:[e,a?o.jsx(yt,{className:"w-4 h-4 text-foreground-muted shrink-0"}):o.jsx(ma,{className:"w-4 h-4 text-foreground-muted shrink-0"})]}),o.jsx("div",{id:c,className:`grid transition-all duration-200 ease-in-out ${a?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:o.jsx("div",{className:"overflow-hidden",children:t})})]})}const Qn={userPassword:"User/Password",oauth2:"OAuth2",apiKey:"API key",bearer:"Bearer Token",openIdConnect:"OpenID",X509:"X.509 certificate",scramSha256:"SASL",scramSha512:"SASL",plain:"SASL",gssapi:"SASL"};function qn(e){var r,n;const t=(r=e.type)==null?void 0:r.toLowerCase();if(t==="httpapikey")return"apiKey";if(t==="http"){const s=(n=e.scheme)==null?void 0:n.toLowerCase();return s==="basic"?"userPassword":s!=null&&s.includes("mutual")||s!=null&&s.includes("tls")?"X509":"bearer"}return e.type}function ip(e){return e.name||e.scheme||e.bearerFormat||e.type||void 0}function ap(e){const t=(e??[]).filter(s=>Qn[qn(s)]),r=new Map;for(const s of t){const i=Qn[qn(s)];r.set(i,(r.get(i)??0)+1)}const n=new Set;return t.map((s,i)=>{const a=qn(s),l=Qn[a],c=(r.get(l)??0)>1?ip(s):void 0;let u=c?`${l} (${c})`:l;return n.has(u)&&(u=`${u} #${i+1}`),n.add(u),{id:`${a}-${i}`,name:u,kind:a,scheme:s}})}function gs({securities:e}){var u;const t=g.useMemo(()=>ap(e),[e]),r=t.length>1,[n,s]=g.useState(r?null:((u=t[0])==null?void 0:u.id)??null);g.useEffect(()=>{if(t.length===0){s(null);return}if(t.length===1){s(t[0].id);return}s(d=>d&&t.some(f=>f.id===d)?d:null)},[t]);const i=t.find(d=>d.id===n),a=i==null?void 0:i.kind,l=i==null?void 0:i.scheme,c=l==null?void 0:l.description;return o.jsxs("div",{children:[r&&o.jsx(it,{tabs:t,current:n,onChange:d=>s(f=>d&&f===d?null:d||null),placeholder:"Select an authorization method"}),o.jsxs("div",{className:"py-4 prose text-foreground-muted",children:[a==="userPassword"&&o.jsxs(rn,{description:c,children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide user and password"})," ","to connect to this server."]}),a&&["scramSha256","scramSha512","plain"].includes(a)&&o.jsxs(rn,{description:c,children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide username and password"})," ","to connect to this server."]}),a==="gssapi"&&o.jsxs(rn,{description:c,children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"authenticate using Kerberos (GSSAPI)"})," ","to connect to this server."]}),a==="X509"&&o.jsxs(rn,{description:c,children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"download the certificate file"})," ","from the service provider to connect to this server."]}),a==="bearer"&&o.jsx(lp,{security:l}),a==="apiKey"&&o.jsx(cp,{security:l}),a==="openIdConnect"&&o.jsx(up,{security:l}),a==="oauth2"&&o.jsx(dp,{security:l})]})]})}const rn=({description:e,children:t})=>e?o.jsx(o.Fragment,{children:o.jsx(Oe,{children:e})}):o.jsx("span",{children:t}),lp=({security:e})=>e!=null&&e.description?o.jsx(Oe,{children:e.description}):o.jsxs("span",{children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide a bearer token"})," ","in the ",o.jsx("code",{children:"Authorization"})," header",e!=null&&e.bearerFormat?o.jsxs(o.Fragment,{children:[" (format: ",e.bearerFormat,")"]}):null," to connect to this server."]}),cp=({security:e})=>{if(e!=null&&e.description)return o.jsx(Oe,{children:e.description});const t=e==null?void 0:e.in;return t==="header"||t==="query"||t==="cookie"?o.jsxs("span",{children:["You have to"," ",o.jsxs("strong",{className:"text-foreground-secondary",children:["provide your API key in the ",t," parameter",e!=null&&e.name?o.jsxs(o.Fragment,{children:[" named ",o.jsx("code",{children:e.name})]}):null]})," ","to connect to this server."]}):t==="password"?o.jsxs("span",{children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide your API key as the password and leave the user name empty"})," ","to connect to this server."]}):o.jsxs("span",{children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide your API key as the user name and leave the password empty"})," ","to connect to this server."]})},up=({security:e})=>{var r,n;const t=(r=e.requiredScopes)!=null&&r.length?e.requiredScopes:e.scopes;return o.jsxs(o.Fragment,{children:[e!=null&&e.description?o.jsx(Oe,{children:e.description}):o.jsx("p",{children:"You can use OpenID to connect to this server."}),o.jsxs("p",{children:["The OpenID Connect URL is"," ",o.jsx("a",{href:e.openIdConnectUrl,target:"_blank",rel:"noreferrer",children:e.openIdConnectUrl}),"."]}),t&&t.length>0&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 items-center @sm:gap-4",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:(n=e.requiredScopes)!=null&&n.length?"Required scopes":"Scopes"}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("code",{children:Pl(t)})})]})]})},dp=({security:e})=>{const t=e==null?void 0:e.flows;return o.jsxs(o.Fragment,{children:[(e==null?void 0:e.description)&&o.jsx(Oe,{children:e.description}),t&&Object.entries(t).map(([r,n])=>{var c,u;let s="",i="";switch(r){case"clientCredentials":s=ll,i=cl;break;case"implicit":s=il,i=al;break;case"password":s=ul,i=dl;break;case"authorizationCode":s=fl,i=pl;break}const a=(c=e.requiredScopes)!=null&&c.length?e.requiredScopes:n.availableScopes??n.scopes,l=(u=e.requiredScopes)!=null&&u.length?"Required scopes":"Available scopes";return o.jsxs("div",{children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-lg leading-6 font-bold text-foreground",children:s}),o.jsx("p",{className:"mt-1 max-w-2xl text-sm text-foreground-muted",children:i})]}),o.jsx("div",{className:"mt-5 border-t border-border",children:o.jsxs("dl",{className:"@sm:divide-y @sm:divide-border",children:[n.authorizationUrl&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Authorization URL"}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("a",{href:n.authorizationUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:n.authorizationUrl})})]}),n.tokenUrl&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Token URL"}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("a",{href:n.tokenUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:n.tokenUrl})})]}),n.refreshUrl&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Refresh URL"}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("a",{href:n.refreshUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:n.refreshUrl})})]}),a&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:l}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("div",{className:"flex flex-wrap gap-1.5",children:(Array.isArray(a)?a:Object.keys(a)).map(d=>o.jsx("code",{className:"text-xs bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:d},d))})})]})]})})]},r)})]})};function fp(e){return e.startsWith("http://")||e.startsWith("https://")}function ga(e){return e.replace(/([A-Z])/g," $1").replace(/^(.)/,t=>t.toUpperCase()).trim()}function xa({value:e}){if(e==null)return null;if(typeof e=="string"&&fp(e))return o.jsx("a",{href:e,target:"_blank",rel:"noreferrer",className:"text-xs text-blue-600 underline underline-offset-2 break-all hover:text-blue-800",children:e});if(typeof e=="boolean")return o.jsx("span",{className:`text-xs font-medium ${e?"text-green-600":"text-red-500"}`,children:e?"true":"false"});if(typeof e=="number")return o.jsx("span",{className:"text-xs font-mono text-blue-600",children:e});if(typeof e=="object"){const t=e;return"type"in t&&Array.isArray(t.enum)?o.jsx("div",{className:"flex flex-wrap gap-1",children:t.enum.map((r,n)=>o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:String(r)},n))}):typeof t.type=="string"&&typeof t.description=="string"&&Object.keys(t).length===2?o.jsx(Oe,{className:"prose-sm",children:t.description}):o.jsx("div",{className:"mt-1 border-l-2 border-border pl-3 space-y-2",children:Object.entries(t).map(([r,n])=>o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx("span",{className:"text-xs text-foreground-muted shrink-0 w-36",children:ga(r)}),o.jsx(xa,{value:n})]},r))})}return o.jsx("span",{className:"text-xs text-foreground-secondary",children:String(e)})}function ba({bindings:e,expand:t=!1,protocol:r,focused:n}){const s=gl[r.toLowerCase()]??{label:r,color:"bg-neutral-100 text-foreground-secondary border-border"},i=Object.entries(e??{}).filter(([a,l])=>a!=="bindingVersion"&&l!==void 0&&l!==null);return i.length===0?null:o.jsx(Kt,{className:"mt-2",defaultExpanded:t,forceExpanded:n,trigger:o.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded border ${s.color}`,children:s.label}),children:o.jsx("div",{className:"divide-y divide-neutral-100",children:i.length===0?o.jsx("p",{className:"px-4 py-3 text-xs text-foreground-muted italic",children:"No binding properties defined."}):i.map(([a,l])=>o.jsxs("div",{className:"flex items-center items-start gap-4 px-4 py-3",children:[o.jsx("span",{className:"text-xs font-medium text-foreground-muted w-40 shrink-0 pt-0.5",children:ga(a)}),o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(xa,{value:l})})]},a))})})}function pp({host:e,protocol:t,description:r,tags:n,variables:s,security:i,bindings:a,serverKey:l,focusSection:c=null}){const u=s,d=g.useId();return o.jsxs("div",{children:[o.jsx(ha,{address:e,variables:u,children:o.jsx("div",{className:"mt-2",children:n&&n.map((f,p)=>{const h=f,m=h.externalDocs;return o.jsx(us,{href:m&&m.url,title:h.description||(m&&m.description?m.description:void 0),name:h.name},p)})})}),o.jsx(Oe,{children:r}),i&&i.length>0&&o.jsxs("div",{id:l?`server-${l}-security`:void 0,children:[o.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[o.jsx(pa,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Authorization"]}),o.jsxs("p",{className:"prose text-foreground-muted mt-4",children:["This server accepts the following authorization mechanism",i.length>1?"s":"",":"]}),o.jsx(Kt,{className:"mt-4",ariaLabelledBy:d,forceExpanded:c==="security",trigger:o.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:i.length}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(gs,{securities:i})})})]}),(()=>{const f=a==null?void 0:a[t];return f&&Object.keys(f).some(h=>h!=="bindingVersion")?o.jsxs("div",{id:l?`server-${l}-bindings`:void 0,children:[o.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[o.jsx(Dr,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Connection Settings"]}),o.jsx("p",{className:"prose text-foreground-muted mt-4",children:"This server accepts the following connection configuration:"}),o.jsx(ba,{bindings:f,protocol:t,focused:c===`binding:${t}`})]}):null})()]})}function ya({servers:e,selectedServer:t,onSelectServer:r,focusSection:n=null,layout:s}){const i=Object.keys(e),[a,l]=g.useState(void 0),c=[t,a].find(f=>!!f&&i.includes(f))??i[0],u=f=>{l(f),r==null||r(f)},d=o.jsx(pp,{...e[c],serverKey:c,focusSection:t||a?n:null});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Xe,{title:To,content:d,sideContent:o.jsx(fa,{serverNames:i,current:c,setCurrent:u}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:s})})}const ka=g.forwardRef(function({isOpen:t,side:r,onClose:n,title:s,headerActions:i,children:a,width:l="w-[50rem]"},c){g.useEffect(()=>{const S=w=>{w.key==="Escape"&&n()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[n]);const u=r==="right"?"right-0":"left-0",d=r==="right"?"translateX(100%)":"translateX(-100%)",{portalHost:f,rootElement:p,sidePanelContainment:h,sidePanelTopOffset:m=0}=be(),y=h==="component";g.useEffect(()=>{if(!t||!f)return;const S=y?Tl(f,p):Pr(f);if(S)return Po(S)},[y,t,f,p]);const b=ar(p,y),v=(()=>{if(!y)return{position:"fixed",inset:0};if(!b)return{position:"fixed",inset:0};const S=Math.max(m,b.top),w=Math.max(0,b.left),I=Math.min(window.innerHeight,b.bottom),B=Math.min(window.innerWidth,b.right);return{position:"fixed",top:S,left:w,width:Math.max(0,B-w),height:Math.max(0,I-S)}})();return f?pt.createPortal(o.jsxs("div",{className:"z-50 overflow-hidden",style:{...v,pointerEvents:t?"auto":"none"},children:[o.jsx("div",{onClick:n,className:`absolute inset-0 bg-black/30 transition-opacity duration-300 ${t?"opacity-100":"opacity-0"}`,style:{pointerEvents:t?"auto":"none"}}),o.jsxs("div",{ref:c,className:`absolute top-0 ${u} h-full ${l} max-w-[100cqw] bg-background ${t?"shadow-xl":""} flex flex-col transition-transform duration-300 ease-in-out`,style:{transform:t?"translateX(0)":d},children:[s&&o.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[o.jsx("div",{className:"text-sm font-semibold text-foreground min-w-0 flex-1 overflow-hidden",children:typeof s=="string"?o.jsx("span",{className:"truncate block",children:s}):s}),i,o.jsx("button",{onClick:n,className:"ml-4 p-1 rounded hover:bg-neutral-100 text-foreground-muted hover:text-foreground-secondary transition-colors","aria-label":"Close panel",children:o.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M2 2l12 12M14 2L2 14"})})})]}),o.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:a})]})]}),f):null});function wa({message:e,messageId:t,i:r}){const[n,s]=g.useState(!1);return o.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[o.jsxs("div",{className:"px-4 py-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:e.title??e.name??`Message ${r+1}`}),(t??e.name)&&o.jsx("span",{className:"text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200 p-0.5 rounded shrink-0",children:t??e.name})]}),e.summary&&o.jsx("p",{className:"text-xs text-foreground-muted mt-1.5 leading-relaxed",children:e.summary}),o.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 mt-4",children:[e.contentType&&o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",children:e.contentType}),e.correlationId&&o.jsx("span",{className:"text-xs bg-secondary-50 text-secondary-500 px-1.5 py-0.5 rounded border border-secondary-200",title:e.correlationId.description??e.correlationId.location,children:e.correlationId.location}),e.deprecated&&o.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"})]})]}),o.jsx(ua,{message:e,expanded:n,onToggleExpanded:()=>s(i=>!i)})]})}function hp({requestMessages:e,reply:t,isSend:r,operationId:n}){const[s,i]=g.useState("request"),a=t.messages??[],l=t.channel,c=t.address,u=s==="request"?e:a,d=s==="request"?r?"accepts":"expects":o.jsxs(o.Fragment,{children:["replies to"," ",c?o.jsxs(o.Fragment,{children:["a channel in"," ",o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary",children:c.location})]}):(l==null?void 0:l.address)&&o.jsx(Je,{address:l.address,parameters:l.parameters,className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary"})]});return o.jsxs("div",{children:[o.jsx("div",{className:"flex items-end gap-0.5 -ml-2",children:["request","reply"].map(f=>o.jsx("button",{onClick:()=>i(f),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize
|
|
132
|
+
${s===f?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:f},f))}),o.jsx("div",{className:"-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32",children:u.length>0?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"text-sm text-foreground-secondary mb-3",children:[o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary",children:n})," ",d,u.length>1?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 font-bold text-foreground-secondary",children:"one of"}),"the following messages:"]}):o.jsxs("span",{children:[" "," with the following message:"]})]}),o.jsx("div",{className:"space-y-2",children:u.map((f,p)=>o.jsx(wa,{message:f,messageId:f.name,i:p},p))})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No messages defined."})})]})}const mp="",gp=`
|
|
133
|
+
`;var Pe=class{constructor({indent:e,join:t}={}){this.code=[],this.indentLine=(r,n=0)=>`${this.indentationCharacter.repeat(n)}${r}`,this.push=(r,n=0)=>{this.code.push(this.indentLine(r,n))},this.blank=()=>{this.code.push("")},this.join=()=>this.code.join(this.lineJoin),this.indentationCharacter=e??mp,this.lineJoin=t??gp}},Gt=class extends Error{constructor(e){super(e),this.name="AsyncSnippetError"}},xp=class extends Gt{constructor(e){super(`No operation found with id "${e}"`),this.name="UnknownOperationError"}},bp=class extends Gt{constructor(e,t,r=[]){const n=r.length>0?` Registered targetId/clientId pairs: ${r.join(", ")}.`:" No targets are registered — did you forget to import a client module?";super(`Unsupported target "${e}/${t}".${n}`),this.name="UnsupportedTargetError"}},yp=class extends Gt{constructor(e){super(`Operation "${e}" has no channels`),this.name="MissingChannelError"}},kp=class extends Gt{constructor(e,t){super(`Operation "${e}" is not reachable over "${t}": no server it's associated with declares that protocol (or a secure variant of it), and its channel has no explicit "${t}" binding`),this.name="MissingBindingError"}},xo=class extends Gt{constructor(e){super(`Operation "${e}"'s message has no "examples" entry, and no "payload" schema to generate one from (or its schema has no recognizable type — composition keywords like oneOf/anyOf/allOf aren't resolved into an example).`),this.name="MissingExampleError"}};const bo=10;function wp(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function vp(e,t){if(!t.startsWith("#/"))throw new Error(`Unsupported $ref "${t}": only local refs (starting with "#/") are supported`);const r=t.slice(2).split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let n=e;for(const s of r){if(typeof n!="object"||n===null)throw new Error(`Cannot resolve $ref "${t}": no value at "${s}"`);n=n[s]}return n}function We(e,t){let r=t;for(let n=0;wp(r);n++){if(n>=bo)throw new Error(`Exceeded max $ref depth (${bo}) resolving "${r.$ref}" — possible cycle`);r=vp(e,r.$ref)}return r}const jp=10;function Sp(e){switch(e){case"date-time":return"2024-01-01T00:00:00Z";case"date":return"2024-01-01";case"time":return"00:00:00Z";case"email":return"user@example.com";case"uuid":return"00000000-0000-0000-0000-000000000000";case"uri":case"url":return"https://example.com";case"hostname":return"example.com";case"ipv4":return"192.0.2.1";case"ipv6":return"::1";default:return"string"}}function Np(e){return Array.isArray(e)?e.find(t=>t!=="null")??e[0]:e}function Er(e,t,r=0){if(r>jp)return;const n=We(e,t);if(!n||typeof n!="object")return;const s=n;if(s.examples&&s.examples.length>0)return s.examples[0];if(s.default!==void 0)return s.default;if(s.const!==void 0)return s.const;if(s.enum&&s.enum.length>0)return s.enum[0];switch(Np(s.type)){case"object":{const i={};for(const[a,l]of Object.entries(s.properties??{})){const c=Er(e,l,r+1);c!==void 0&&(i[a]=c)}return i}case"array":{if(s.items===void 0)return[];const i=Er(e,s.items,r+1);return i!==void 0?[i]:[]}case"string":return Sp(s.format);case"integer":case"number":return 0;case"boolean":return!1;case"null":return null;default:return}}const Ap=10;function Ep(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function Ct(e,t,r=0){if(r>=Ap||t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(s=>Ct(e,s,r+1));if(Ep(t))return Ct(e,We(e,t),r+1);const n={};for(const[s,i]of Object.entries(t))n[s]=Ct(e,i,r+1);return n}function va(e,t,r){return e!==void 0?{value:String(e),isPlaceholder:!1}:t&&t.length>0?{value:String(t[0]),isPlaceholder:!1}:{value:`<${r}>`,isPlaceholder:!0}}function sn(e,t){return e?va(e.default,e.examples,t):{value:`<${t}>`,isPlaceholder:!0}}function yo(e){const t={},r=[];for(const[n,s]of Object.entries((e==null?void 0:e.properties)??{})){const i=va(s.default,s.examples,n);t[n]=i.value,i.isPlaceholder&&r.push(n)}return{values:t,placeholders:r}}function ko(e,t){return t!=null&&t.length?t.map(r=>We(e,r)).filter(r=>!!(r!=null&&r.type)):[]}const $p={"kafka-secure":"kafka",wss:"ws"};function Cp(e){return $p[e]??e}function Tp(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function Ip(e){return e.slice(e.lastIndexOf("/")+1)}function Op(e,t){return t&&t.length>0?t.map(r=>{const n=We(e,r);if(n)return{name:Tp(r)?Ip(r.$ref):"",server:n}}).filter(r=>!!r):Object.entries(e.servers??{}).map(([r,n])=>{const s=We(e,n);return s?{name:r,server:s}:void 0}).filter(r=>!!r)}function ja(e,t){var i;const r=(i=e.operations)==null?void 0:i[t],n=r&&We(e,r);if(!n)throw new xp(t);const s=We(e,n.channel);if(!s)throw new yp(t);return{operation:n,channel:s}}function Sa(e,t,r,n){var l;const s=Op(e,r.servers??t.servers),i=s.find(c=>Cp(c.server.protocol)===n),a=(l=t.bindings)==null?void 0:l[n];return{servers:s,matchedServer:i,eligible:!!(i||a)}}function _p(e,t,r){try{const{operation:n,channel:s}=ja(e,t);return Sa(e,s,n,r).eligible}catch{return!1}}function Mp(e,t,r){var T,C,P,z,G,j,A,M,V,Y,te,ue,de,le;const{operation:n,channel:s}=ja(e,t),{servers:i,matchedServer:a,eligible:l}=Sa(e,s,n,r);if(!l)throw new kp(t,r);const c=[];let u={},d={},f;if(r==="ws"){const ae=yo((C=(T=s.bindings)==null?void 0:T.ws)==null?void 0:C.query),se=yo((z=(P=s.bindings)==null?void 0:P.ws)==null?void 0:z.headers);u=ae.values,d=se.values,c.push(...ae.placeholders.map(E=>`query param "${E}"`)),c.push(...se.placeholders.map(E=>`header "${E}"`))}else r==="kafka"&&(f=(j=(G=s.bindings)==null?void 0:G.kafka)==null?void 0:j.topic);const p=s.address??"";let h=p;for(const[ae,se]of Object.entries(s.parameters??{})){const E=sn(se,ae);h=h.replace(`{${ae}}`,E.value),E.isPlaceholder&&c.push(`channel parameter "${ae}"`)}r==="kafka"&&f&&(h=f);const m=(A=a??i[0])==null?void 0:A.server,y=m?`${m.protocol}://${m.host}${m.pathname??""}`:"",b=(m==null?void 0:m.host)??"",v=ko(e,m==null?void 0:m.security),S=i.map(({name:ae,server:se})=>({name:ae,host:se.host,protocol:se.protocol,pathname:se.pathname,url:`${se.protocol}://${se.host}${se.pathname??""}`,description:se.description,security:ko(e,se.security)})),w=n.messages!==void 0?We(e,n.messages[0]):We(e,Object.values(s.messages??{})[0]),I=(M=w==null?void 0:w.examples)==null?void 0:M[0];let B,F;if(I)B=I.name,F=I.payload;else if((w==null?void 0:w.payload)!==void 0){if(F=Er(e,w.payload),F===void 0)throw new xo(t);c.push("message payload (no explicit example — generated from its schema)")}else throw new xo(t);const N=(w==null?void 0:w.payload)!==void 0?Ct(e,w.payload):void 0,k=(w==null?void 0:w.headers)!==void 0?Ct(e,w.headers):void 0,x=n.action==="send"?"send":"receive";let $;if(r==="kafka"){const ae=(Y=(V=w==null?void 0:w.bindings)==null?void 0:V.kafka)==null?void 0:Y.key,se=ae?sn(ae,"kafka message key"):void 0;se!=null&&se.isPlaceholder&&c.push("kafka message key");const E=sn((ue=(te=n.bindings)==null?void 0:te.kafka)==null?void 0:ue.clientId,"kafka clientId");E.isPlaceholder&&c.push("kafka clientId");let L;x==="receive"&&(L=sn((le=(de=n.bindings)==null?void 0:de.kafka)==null?void 0:le.groupId,"kafka consumer group id"),L.isPlaceholder&&c.push("kafka consumer group id")),$={key:se==null?void 0:se.value,groupId:L==null?void 0:L.value,clientId:E.value}}return{operationId:t,action:x,protocol:r,serverUrl:y,serverHost:b,servers:S,channelAddress:h,channelTemplate:p,query:u,headers:d,operationSummary:n.summary,operationDescription:n.description,message:{name:B,payload:F,title:(w==null?void 0:w.title)??(w==null?void 0:w.name),summary:w==null?void 0:w.summary,description:w==null?void 0:w.description,contentType:w==null?void 0:w.contentType,payloadSchema:N,headersSchema:k},placeholders:c,info:e.info,security:v,...$?{kafka:$}:{}}}function Rp(e){switch(e.type){case"apiKey":case"httpApiKey":return`API key${e.in?` (in ${e.in}${e.name?`: \`${e.name}\``:""})`:""}`;case"http":return e.scheme?`HTTP ${e.scheme}`:"HTTP authentication";case"oauth2":return"OAuth2";case"openIdConnect":return"OpenID Connect";case"userPassword":return"Username/password";case"X509":return"X.509 certificate";case"symmetricEncryption":return"Symmetric encryption";case"asymmetricEncryption":return"Asymmetric encryption";case"plain":return"SASL/PLAIN";case"scramSha256":return"SASL/SCRAM-SHA-256";case"scramSha512":return"SASL/SCRAM-SHA-512";case"gssapi":return"SASL/GSSAPI (Kerberos)";default:return e.type}}function Pp(e,t){if(t.length!==0){e("**Authorization:**");for(const r of t)if(e(`- **${Rp(r)}**`),r.description&&e(r.description,1),r.type==="openIdConnect"&&r.openIdConnectUrl&&e(`- OpenID Connect URL: \`${r.openIdConnectUrl}\``,1),r.type==="oauth2")for(const[n,s]of Object.entries(r.flows??{})){e(`- Flow \`${n}\`:`,1),s.authorizationUrl&&e(`- Authorization URL: \`${s.authorizationUrl}\``,2),s.tokenUrl&&e(`- Token URL: \`${s.tokenUrl}\``,2),s.refreshUrl&&e(`- Refresh URL: \`${s.refreshUrl}\``,2);const i=Object.keys(s.scopes??{});i.length>0&&e(`- Scopes: ${i.map(a=>`\`${a}\``).join(", ")}`,2)}}}function Lp(e,t,r){e(`### ${r.name||r.host}`),t(),e(`**Host:** \`${r.host}${r.pathname??""}\``),e(`**Protocol:** ${r.protocol}`),r.description&&e(r.description),t(),r.security.length>0&&(Pp(e,r.security),t())}function wo(e,t,r,n){e(`#### \`${r}\``),t(),e("```json");for(const s of JSON.stringify(n,null,2).split(`
|
|
134
|
+
`))e(s);e("```"),t()}function Na(e,t){var u,d,f,p,h,m,y;const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent});n(`# ${((u=e.info)==null?void 0:u.title)??e.operationId}`),s();const a=(d=e.info)==null?void 0:d.license;if(n(`**Version:** ${((f=e.info)==null?void 0:f.version)??"unknown"}${a?" ":""}`),a&&n(`**License:** ${a.name??""}${a.url?` (${a.url})`:""}`),s(),(p=e.info)!=null&&p.description&&(n(e.info.description),s()),n(`You are an AI agent that needs to ${e.action==="send"?"send a message to":"receive messages from"} an asynchronous (${e.protocol}) API operation ("${e.operationId}"). Use only the details below — do not invent field names, URLs, topics, or values that aren't given here.`),s(),e.servers.length>0){n("## Servers"),s();for(const b of e.servers)Lp(n,s,b)}n(`### ${e.action.toUpperCase()} \`${e.operationId}\``),s(),n(`**Channel:** \`${e.channelTemplate}\``);const l=Object.keys(e.query),c=Object.keys(e.headers);if(l.length>0&&n(`**Query parameters:** ${l.map(b=>`\`${b}=${e.query[b]}\``).join(", ")}`),c.length>0&&n(`**Headers:** ${c.map(b=>`\`${b}: ${e.headers[b]}\``).join(", ")}`),((h=e.kafka)==null?void 0:h.clientId)!==void 0&&n(`**Kafka client ID:** \`${e.kafka.clientId}\``),e.action==="receive"&&((m=e.kafka)==null?void 0:m.groupId)!==void 0&&n(`**Kafka consumer group ID:** \`${e.kafka.groupId}\``),((y=e.kafka)==null?void 0:y.key)!==void 0&&n(`**Kafka message key:** \`${e.kafka.key}\``),s(),e.operationSummary&&(n(e.operationSummary),s()),e.operationDescription&&(n(e.operationDescription),s()),n(`#### ${e.message.title??e.operationId}`),s(),e.message.summary&&(n(e.message.summary),s()),e.message.description&&(n(e.message.description),s()),e.message.contentType&&(n(`**Content-Type:** \`${e.message.contentType}\``),s()),e.message.payloadSchema!==void 0&&wo(n,s,"payload",e.message.payloadSchema),e.message.headersSchema!==void 0&&wo(n,s,"headers",e.message.headersSchema),n("## Instructions"),s(),e.action==="send"?(n("1. Construct a JSON payload that conforms to the `payload` schema above."),n(`2. Send it to the channel/topic \`${e.channelAddress}\` on the server described above, using the authorization details given (if any).`)):(n(`1. Subscribe/listen on the channel/topic \`${e.channelAddress}\` on the server described above, using the authorization details given (if any).`),n("2. Expect incoming messages conforming to the `payload` schema above.")),e.placeholders.length>0){n("3. Some values above could not be resolved from the AsyncAPI document's `default`/`examples` and are placeholders — replace them with real values before acting:");for(const b of e.placeholders)n(`- ${b}`,1)}return i()}const Bp={info:{key:"kafka",title:"Agent Prompt (Kafka)",description:"Self-contained Markdown prompt describing this operation — intro, broker, authorization, and an example payload — for an LLM agent to act on directly, instead of a runnable code snippet.",link:"https://www.asyncapi.com/",extname:".md",protocol:"kafka"},convert:(e,t)=>Na(e,t)},Dp={info:{key:"ws",title:"Agent Prompt (WebSocket)",description:"Self-contained Markdown prompt describing this operation — intro, server, authorization, and an example payload — for an LLM agent to act on directly, instead of a runnable code snippet.",link:"https://www.asyncapi.com/",extname:".md",protocol:"ws"},convert:(e,t)=>Na(e,t)};function Vt(e,t,r){const n=e.replace(/\/$/,""),s=t.startsWith("/")?t:`/${t}`,i=new URLSearchParams(r).toString();return i?`${n}${s}?${i}`:`${n}${s}`}const Fp={info:{key:"tokio-tungstenite",title:"tokio-tungstenite",description:"Rust WebSocket client built on tokio-tungstenite, driven with async/await on the Tokio runtime.",link:"https://github.com/snapview/tokio-tungstenite",extname:".rs",protocol:"ws"},convert:(e,t)=>{const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent});if(e.placeholders.length>0){n("// NOTE: some values could not be resolved from the AsyncAPI document's"),n("// default/examples and were filled with a placeholder — replace them"),n("// with real values before running this snippet:");for(const c of e.placeholders)n(`// - ${c}`);s()}const a=Vt(e.serverUrl,e.channelAddress,e.query),l=Object.entries(e.headers);if(n("use futures_util::{SinkExt, StreamExt};"),l.length>0?n("use tokio_tungstenite::{connect_async, tungstenite::client::IntoClientRequest, tungstenite::Message};"):n("use tokio_tungstenite::{connect_async, tungstenite::Message};"),s(),s(),n("#[tokio::main]"),n("async fn main() {"),n(`let url = ${JSON.stringify(a)};`,1),s(),l.length>0){n('let mut request = url.into_client_request().expect("Invalid URL");',1);for(const[c,u]of l)n("request",1),n(".headers_mut()",2),n(`.insert(${JSON.stringify(c)}, ${JSON.stringify(u)}.parse().expect("Invalid header value"));`,2);s(),n('let (ws_stream, _) = connect_async(request).await.expect("Failed to connect");',1)}else n('let (ws_stream, _) = connect_async(url).await.expect("Failed to connect");',1);if(n(`let (${e.action==="send"?"mut write":"_write"}, mut read) = ws_stream.split();`,1),s(),e.action==="send"){const c=JSON.stringify(e.message.payload,null,2).split(`
|
|
135
|
+
`);c[c.length-1]+=");",n(`let payload = serde_json::json!(${c[0]}`,1);for(const u of c.slice(1))n(u,1);s(),n("write",1),n(".send(Message::Text(payload.to_string().into()))",2),n(".await",2),n('.expect("Failed to send message");',2),s(),n("if let Some(msg) = read.next().await {",1),n('println!("{}", msg.expect("Failed to read message"));',2),n("}",1)}else{n(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`,1);for(const c of JSON.stringify(e.message.payload,null,2).split(`
|
|
136
|
+
`))n(`// ${c}`,1);s(),n("while let Some(msg) = read.next().await {",1),n('println!("{}", msg.expect("Failed to read message"));',2),n("}",1)}return n("}"),i()}},zp={info:{key:"rdkafka",title:"rdkafka",description:"Kafka producer/consumer client using the rdkafka crate, a librdkafka binding driven with async/await on the Tokio runtime.",link:"https://github.com/fede1024/rust-rdkafka",extname:".rs",protocol:"kafka"},convert:(e,t)=>{var l,c,u;const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent});if(e.placeholders.length>0){n("// NOTE: some values could not be resolved from the AsyncAPI document's"),n("// default/examples and were filled with a placeholder — replace them"),n("// with real values before running this snippet:");for(const d of e.placeholders)n(`// - ${d}`);s()}const a=((l=e.kafka)==null?void 0:l.clientId)??"";if(e.action==="send"){n("use rdkafka::config::ClientConfig;"),n("use rdkafka::producer::{FutureProducer, FutureRecord};"),n("use std::time::Duration;"),s(),s(),n("#[tokio::main]"),n("async fn main() {"),n("let producer: FutureProducer = ClientConfig::new()",1),n(`.set("bootstrap.servers", ${JSON.stringify(e.serverHost)})`,2),n(`.set("client.id", ${JSON.stringify(a)})`,2),n(".create()",2),n('.expect("Failed to create producer");',2),s();const d=JSON.stringify(e.message.payload,null,2).split(`
|
|
137
|
+
`);d[d.length-1]+=");",n(`let payload = serde_json::json!(${d[0]}`,1);for(const f of d.slice(1))n(f,1);s(),n(`let record = FutureRecord::to(${JSON.stringify(e.channelAddress)})`,1),n(".payload(&payload.to_string())",2),((c=e.kafka)==null?void 0:c.key)!==void 0?n(`.key(${JSON.stringify(e.kafka.key)});`,2):n('.key("");',2),s(),n("producer",1),n(".send(record, Duration::from_secs(0))",2),n(".await",2),n('.expect("Failed to send message");',2),n("}")}else{const d=((u=e.kafka)==null?void 0:u.groupId)??"";n("use rdkafka::config::ClientConfig;"),n("use rdkafka::consumer::{Consumer, StreamConsumer};"),n("use rdkafka::Message;"),n("use futures_util::StreamExt;"),s(),s(),n(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const f of JSON.stringify(e.message.payload,null,2).split(`
|
|
138
|
+
`))n(`// ${f}`);s(),n("#[tokio::main]"),n("async fn main() {"),n("let consumer: StreamConsumer = ClientConfig::new()",1),n(`.set("bootstrap.servers", ${JSON.stringify(e.serverHost)})`,2),n(`.set("group.id", ${JSON.stringify(d)})`,2),n(`.set("client.id", ${JSON.stringify(a)})`,2),n('.set("auto.offset.reset", "earliest")',2),n(".create()",2),n('.expect("Failed to create consumer");',2),s(),n(`consumer.subscribe(&[${JSON.stringify(e.channelAddress)}]).expect("Failed to subscribe");`,1),s(),n("let mut stream = consumer.stream();",1),n("while let Some(message) = stream.next().await {",1),n('let message = message.expect("Failed to read message");',2),n("if let Some(payload) = message.payload_view::<str>().and_then(Result::ok) {",2),n('println!("{}", payload);',3),n("}",2),n("}",1),n("}")}return i()}};function $r(e,t,r=0){const n=t.repeat(r),s=t.repeat(r+1);if(e==null)return"None";if(typeof e=="boolean")return e?"True":"False";if(typeof e=="number")return String(e);if(typeof e=="string")return JSON.stringify(e);if(Array.isArray(e))return e.length===0?"[]":`[
|
|
139
|
+
${e.map(a=>`${s}${$r(a,t,r+1)}`).join(`,
|
|
140
|
+
`)},
|
|
141
|
+
${n}]`;const i=Object.entries(e);return i.length===0?"{}":`{
|
|
142
|
+
${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${$r(l,t,r+1)}`).join(`,
|
|
143
|
+
`)},
|
|
144
|
+
${n}}`}const Hp={info:{key:"websockets",title:"websockets",description:"Python WebSocket client using the `websockets` package's asyncio API.",link:"https://websockets.readthedocs.io/",extname:".py",protocol:"ws"},convert:(e,t)=>{const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent});if(e.placeholders.length>0){n("# NOTE: some values could not be resolved from the AsyncAPI document's"),n("# default/examples and were filled with a placeholder — replace them"),n("# with real values before running this snippet:");for(const c of e.placeholders)n(`# - ${c}`);s()}n("import asyncio"),e.action==="send"&&n("import json"),s(),n("import websockets"),s(),s(),n("async def main() -> None:");const a=Vt(e.serverUrl,e.channelAddress,e.query),l=Object.entries(e.headers);if(l.length>0){n("async with websockets.connect(",1),n(`${JSON.stringify(a)},`,2),n("additional_headers={",2);for(const[c,u]of l)n(`${JSON.stringify(c)}: ${JSON.stringify(u)},`,3);n("},",2),n(") as websocket:",1)}else n(`async with websockets.connect(${JSON.stringify(a)}) as websocket:`,1);if(s(),e.action==="send"){const c=$r(e.message.payload,r.indent).split(`
|
|
145
|
+
`);c[c.length-1]+=")",n("await websocket.send(",2),n(`json.dumps(${c[0]}`,3);for(const u of c.slice(1))n(u,3);n(")",2),s(),n("message = await websocket.recv()",2),n("print(message)",2)}else{n(`# Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`,2);for(const c of JSON.stringify(e.message.payload,null,2).split(`
|
|
146
|
+
`))n(`# ${c}`,2);s(),n("async for message in websocket:",2),n("print(message)",3)}return s(),s(),n("asyncio.run(main())"),i()}};function Cr(e,t,r=0){const n=t.repeat(r),s=t.repeat(r+1);if(e==null)return"None";if(typeof e=="boolean")return e?"True":"False";if(typeof e=="number")return String(e);if(typeof e=="string")return JSON.stringify(e);if(Array.isArray(e))return e.length===0?"[]":`[
|
|
147
|
+
${e.map(a=>`${s}${Cr(a,t,r+1)}`).join(`,
|
|
148
|
+
`)},
|
|
149
|
+
${n}]`;const i=Object.entries(e);return i.length===0?"{}":`{
|
|
150
|
+
${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${Cr(l,t,r+1)}`).join(`,
|
|
151
|
+
`)},
|
|
152
|
+
${n}}`}const Up={info:{key:"confluent-kafka",title:"confluent-kafka",description:"Kafka producer/consumer client using the confluent-kafka package — a librdkafka-backed client for Python.",link:"https://github.com/confluentinc/confluent-kafka-python",extname:".py",protocol:"kafka"},convert:(e,t)=>{var l,c,u;const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent});if(e.placeholders.length>0){n("# NOTE: some values could not be resolved from the AsyncAPI document's"),n("# default/examples and were filled with a placeholder — replace them"),n("# with real values before running this snippet:");for(const d of e.placeholders)n(`# - ${d}`);s()}n("import json"),s(),e.action==="send"?n("from confluent_kafka import Producer"):n("from confluent_kafka import Consumer"),s(),s();const a=((l=e.kafka)==null?void 0:l.clientId)??"";if(e.action==="send"){n("producer = Producer({",0),n(`"bootstrap.servers": ${JSON.stringify(e.serverHost)},`,1),n(`"client.id": ${JSON.stringify(a)},`,1),n("})"),s();const d=Cr(e.message.payload,r.indent).split(`
|
|
153
|
+
`);d[d.length-1]+=")",n(`payload = json.dumps(${d[0]}`);for(const f of d.slice(1))n(f);s(),n("producer.produce(",0),n(`${JSON.stringify(e.channelAddress)},`,1),n("value=payload.encode('utf-8'),",1),((c=e.kafka)==null?void 0:c.key)!==void 0&&n(`key=${JSON.stringify(e.kafka.key)},`,1),n(")"),n("producer.flush()")}else{const d=((u=e.kafka)==null?void 0:u.groupId)??"";n("consumer = Consumer({",0),n(`"bootstrap.servers": ${JSON.stringify(e.serverHost)},`,1),n(`"group.id": ${JSON.stringify(d)},`,1),n(`"client.id": ${JSON.stringify(a)},`,1),n('"auto.offset.reset": "earliest",',1),n("})"),s(),n(`# Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const f of JSON.stringify(e.message.payload,null,2).split(`
|
|
154
|
+
`))n(`# ${f}`);s(),n(`consumer.subscribe([${JSON.stringify(e.channelAddress)}])`),s(),n("try:"),n("while True:",1),n("msg = consumer.poll(1.0)",2),n("if msg is None:",2),n("continue",3),n("if msg.error():",2),n("print(msg.error())",3),n("continue",3),n("print(msg.value().decode('utf-8'))",2),n("finally:"),n("consumer.close()",1)}return i()}},Wp={info:{key:"websocket",title:"WebSocket (browser)",description:"Browser-native WHATWG WebSocket API — no dependency to install, but it cannot set custom handshake headers, so only query-param bindings are supported.",link:"https://developer.mozilla.org/en-US/docs/Web/API/WebSocket",extname:".js",protocol:"ws"},convert:(e,t)=>{const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent}),a=Object.keys(e.headers);if(a.length>0&&(n(`// NOTE: this operation's "ws" binding declares handshake headers`),n(`// (${a.join(", ")}), but the browser-native WebSocket API cannot`),n("// set custom headers on the handshake request — they are omitted below."),n("// Move any required auth into the query string, or generate a Node.js"),n('// snippet instead (targetId: "javascript", clientId: "ws").'),s()),e.placeholders.length>0){n("// NOTE: some values could not be resolved from the AsyncAPI document's"),n("// default/examples and were filled with a placeholder — replace them"),n("// with real values before running this snippet:");for(const l of e.placeholders)n(`// - ${l}`);s()}if(n(`const socket = new WebSocket('${Vt(e.serverUrl,e.channelAddress,e.query)}');`),s(),e.action==="send"){n("socket.addEventListener('open', () => {");const l=JSON.stringify(e.message.payload,null,2).split(`
|
|
155
|
+
`);l[l.length-1]+="));",n(`socket.send(JSON.stringify(${l[0]}`,1);for(const c of l.slice(1))n(c,1);n("});"),s(),n("socket.addEventListener('message', (event) => {"),n("console.log(event.data);",1),n("});")}else{n(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const l of JSON.stringify(e.message.payload,null,2).split(`
|
|
156
|
+
`))n(`// ${l}`);s(),n("socket.addEventListener('message', (event) => {"),n("console.log(event.data);",1),n("});")}return i()}},Kp={info:{key:"kafkajs",title:"kafkajs",description:"Kafka producer/consumer client using the kafkajs package — a pure JavaScript Kafka client for Node.js (no native build step, unlike node-rdkafka).",link:"https://kafka.js.org/",extname:".js",protocol:"kafka"},convert:(e,t)=>{var c,u,d;const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent});if(e.placeholders.length>0){n("// NOTE: some values could not be resolved from the AsyncAPI document's"),n("// default/examples and were filled with a placeholder — replace them"),n("// with real values before running this snippet:");for(const f of e.placeholders)n(`// - ${f}`);s()}n("import { Kafka } from 'kafkajs';"),s();const a=e.serverHost.split(",").map(f=>f.trim()).filter(Boolean),l=((c=e.kafka)==null?void 0:c.clientId)??"";if(n("const kafka = new Kafka({"),n(`clientId: '${l}',`,1),n(`brokers: [${a.map(f=>`'${f}'`).join(", ")}],`,1),n("});"),s(),e.action==="send"){n("const producer = kafka.producer();"),s(),n("async function main() {"),n("await producer.connect();",1),n("await producer.send({",1),n(`topic: '${e.channelAddress}',`,2),n("messages: [",2),n("{",3),((u=e.kafka)==null?void 0:u.key)!==void 0&&n(`key: '${e.kafka.key}',`,4);const f=JSON.stringify(e.message.payload,null,2).split(`
|
|
157
|
+
`);f[f.length-1]+="),",n(`value: JSON.stringify(${f[0]}`,4);for(const p of f.slice(1))n(p,4);n("},",3),n("],",2),n("});",1),n("await producer.disconnect();",1),n("}"),s(),n("main();")}else{n(`const consumer = kafka.consumer({ groupId: '${((d=e.kafka)==null?void 0:d.groupId)??""}' });`),s(),n(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const f of JSON.stringify(e.message.payload,null,2).split(`
|
|
158
|
+
`))n(`// ${f}`);s(),n("async function main() {"),n("await consumer.connect();",1),n(`await consumer.subscribe({ topic: '${e.channelAddress}', fromBeginning: true });`,1),s(),n("await consumer.run({",1),n("eachMessage: async ({ message }) => {",2),n("console.log(message.value?.toString());",3),n("},",2),n("});",1),n("}"),s(),n("main();")}return i()}};function Tr(e,t,r=0){const n=t.repeat(r),s=t.repeat(r+1);if(e==null)return"nil";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number")return String(e);if(typeof e=="string")return JSON.stringify(e);if(Array.isArray(e))return e.length===0?"[]interface{}{}":`[]interface{}{
|
|
159
|
+
${e.map(a=>`${s}${Tr(a,t,r+1)}`).join(`,
|
|
160
|
+
`)},
|
|
161
|
+
${n}}`;const i=Object.entries(e);return i.length===0?"map[string]interface{}{}":`map[string]interface{}{
|
|
162
|
+
${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${Tr(l,t,r+1)}`).join(`,
|
|
163
|
+
`)},
|
|
164
|
+
${n}}`}const Gp={info:{key:"gorilla",title:"gorilla/websocket",description:"Go WebSocket client using the gorilla/websocket package's Dialer API.",link:"https://github.com/gorilla/websocket",extname:".go",protocol:"ws"},convert:(e,t)=>{const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent});if(e.placeholders.length>0){n("// NOTE: some values could not be resolved from the AsyncAPI document's"),n("// default/examples and were filled with a placeholder — replace them"),n("// with real values before running this snippet:");for(const c of e.placeholders)n(`// - ${c}`);s()}const a=Vt(e.serverUrl,e.channelAddress,e.query),l=Object.entries(e.headers);if(n("package main"),s(),n("import ("),e.action==="send"&&n('"encoding/json"',1),n('"log"',1),l.length>0&&n('"net/http"',1),s(),n('"github.com/gorilla/websocket"',1),n(")"),s(),n("func main() {"),n(`url := ${JSON.stringify(a)}`,1),s(),l.length>0){n("header := http.Header{}",1);for(const[c,u]of l)n(`header.Set(${JSON.stringify(c)}, ${JSON.stringify(u)})`,1);s(),n("conn, _, err := websocket.DefaultDialer.Dial(url, header)",1)}else n("conn, _, err := websocket.DefaultDialer.Dial(url, nil)",1);if(n("if err != nil {",1),n('log.Fatal("dial:", err)',2),n("}",1),n("defer conn.Close()",1),s(),e.action==="send"){const c=Tr(e.message.payload,r.indent).split(`
|
|
165
|
+
`);n(`payload := ${c[0]}`,1);for(const u of c.slice(1))n(u,1);s(),n("data, err := json.Marshal(payload)",1),n("if err != nil {",1),n('log.Fatal("marshal:", err)',2),n("}",1),n("if err := conn.WriteMessage(websocket.TextMessage, data); err != nil {",1),n('log.Fatal("write:", err)',2),n("}",1),s(),n("_, message, err := conn.ReadMessage()",1),n("if err != nil {",1),n('log.Fatal("read:", err)',2),n("}",1),n("log.Println(string(message))",1)}else{n(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`,1);for(const c of JSON.stringify(e.message.payload,null,2).split(`
|
|
166
|
+
`))n(`// ${c}`,1);s(),n("for {",1),n("_, message, err := conn.ReadMessage()",2),n("if err != nil {",2),n('log.Println("read:", err)',3),n("return",3),n("}",2),n("log.Println(string(message))",2),n("}",1)}return n("}"),i()}};function Ir(e,t,r=0){const n=t.repeat(r),s=t.repeat(r+1);if(e==null)return"nil";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number")return String(e);if(typeof e=="string")return JSON.stringify(e);if(Array.isArray(e))return e.length===0?"[]interface{}{}":`[]interface{}{
|
|
167
|
+
${e.map(a=>`${s}${Ir(a,t,r+1)}`).join(`,
|
|
168
|
+
`)},
|
|
169
|
+
${n}}`;const i=Object.entries(e);return i.length===0?"map[string]interface{}{}":`map[string]interface{}{
|
|
170
|
+
${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${Ir(l,t,r+1)}`).join(`,
|
|
171
|
+
`)},
|
|
172
|
+
${n}}`}const Vp={info:{key:"kafka-go",title:"kafka-go",description:"Kafka producer/consumer client using the segmentio/kafka-go package — a pure Go client (no cgo, unlike confluent-kafka-go).",link:"https://github.com/segmentio/kafka-go",extname:".go",protocol:"kafka"},convert:(e,t)=>{var l,c;const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent});if(e.placeholders.length>0){n("// NOTE: some values could not be resolved from the AsyncAPI document's"),n("// default/examples and were filled with a placeholder — replace them"),n("// with real values before running this snippet:");for(const u of e.placeholders)n(`// - ${u}`);s()}const a=e.serverHost.split(",").map(u=>u.trim()).filter(Boolean);if(n("package main"),s(),n("import ("),e.action==="send"?(n('"context"',1),n('"encoding/json"',1),n('"log"',1)):(n('"context"',1),n('"log"',1)),s(),n('"github.com/segmentio/kafka-go"',1),n(")"),s(),n("func main() {"),e.action==="send"){n("writer := &kafka.Writer{",1),n(`Addr: kafka.TCP(${a.map(d=>JSON.stringify(d)).join(", ")}),`,2),n(`Topic: ${JSON.stringify(e.channelAddress)},`,2),n("Balancer: &kafka.LeastBytes{},",2),n("}",1),n("defer writer.Close()",1),s();const u=Ir(e.message.payload,r.indent).split(`
|
|
173
|
+
`);n(`payload := ${u[0]}`,1);for(const d of u.slice(1))n(d,1);s(),n("data, err := json.Marshal(payload)",1),n("if err != nil {",1),n('log.Fatal("marshal:", err)',2),n("}",1),s(),n("message := kafka.Message{Value: data}",1),((l=e.kafka)==null?void 0:l.key)!==void 0&&n(`message.Key = []byte(${JSON.stringify(e.kafka.key)})`,1),s(),n("if err := writer.WriteMessages(context.Background(), message); err != nil {",1),n('log.Fatal("write:", err)',2),n("}",1)}else{const u=((c=e.kafka)==null?void 0:c.groupId)??"";n("reader := kafka.NewReader(kafka.ReaderConfig{",1),n(`Brokers: []string{${a.map(d=>JSON.stringify(d)).join(", ")}},`,2),n(`Topic: ${JSON.stringify(e.channelAddress)},`,2),n(`GroupID: ${JSON.stringify(u)},`,2),n("})",1),n("defer reader.Close()",1),s(),n(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`,1);for(const d of JSON.stringify(e.message.payload,null,2).split(`
|
|
174
|
+
`))n(`// ${d}`,1);s(),n("for {",1),n("message, err := reader.ReadMessage(context.Background())",2),n("if err != nil {",2),n('log.Println("read:", err)',3),n("return",3),n("}",2),n("log.Println(string(message.Value))",2),n("}",1)}return n("}"),i()}},Jp={info:{key:"ws",title:"ws",description:"WebSocket client for Node.js — chosen over the browser-native WebSocket API because it supports custom handshake headers",link:"https://github.com/websockets/ws",extname:".js",protocol:"ws"},convert:(e,t)=>{const r={indent:" ",...t},{push:n,blank:s,join:i}=new Pe({indent:r.indent});if(e.placeholders.length>0){n("// NOTE: some values could not be resolved from the AsyncAPI document's"),n("// default/examples and were filled with a placeholder — replace them"),n("// with real values before running this snippet:");for(const l of e.placeholders)n(`// - ${l}`);s()}n("import WebSocket from 'ws';"),s();const a=Vt(e.serverUrl,e.channelAddress,e.query);if(Object.keys(e.headers).length>0){n(`const socket = new WebSocket('${a}', {`),n("headers: {",1);const l=Object.entries(e.headers);l.forEach(([c,u],d)=>{const f=d<l.length-1?",":"";n(`'${c}': '${u}'${f}`,2)}),n("},",1),n("});")}else n(`const socket = new WebSocket('${a}');`);if(s(),e.action==="send"){n("socket.on('open', () => {");const l=JSON.stringify(e.message.payload,null,2).split(`
|
|
175
|
+
`);l[l.length-1]+="));",n(`socket.send(JSON.stringify(${l[0]}`,1);for(const c of l.slice(1))n(c,1);n("});"),s(),n("socket.on('message', (data) => {"),n("console.log(data.toString());",1),n("});")}else{n(`// Example message shape for this operation${e.message.name?` ("${e.message.name}")`:""}:`);for(const l of JSON.stringify(e.message.payload,null,2).split(`
|
|
176
|
+
`))n(`// ${l}`);s(),n("socket.on('message', (data) => {"),n("console.log(data.toString());",1),n("});")}return i()}},mt={};function Jt(e){if(mt[e.info.key])throw new Error(`Target "${e.info.key}" is already registered`);mt[e.info.key]={...e,clientsById:{...e.clientsById}}}function _e(e,t){const r=mt[e];if(!r)throw new Error(`Cannot register client "${t.info.key}": target "${e}" is not registered. Call addTarget() first.`);if(r.clientsById[t.info.key])throw new Error(`Client "${t.info.key}" is already registered for target "${e}"`);r.clientsById[t.info.key]=t}function Zp(){return Object.values(mt).map(e=>({key:e.info.key,title:e.info.title,default:e.info.default,clients:Object.values(e.clientsById).map(t=>t.info)}))}function Xp(e,t){const r=[];for(const n of Zp()){const s=n.clients.filter(i=>_p(e,t,i.protocol));s.length>0&&r.push({...n,default:s[0].key,clients:s})}return r}Jt({info:{key:"agent",title:"Agent Prompt",default:"ws"},clientsById:{}});_e("agent",Dp);_e("agent",Bp);Jt({info:{key:"javascript",title:"JavaScript",default:"ws"},clientsById:{}});_e("javascript",Jp);_e("javascript",Wp);_e("javascript",Kp);Jt({info:{key:"python",title:"Python",default:"websockets"},clientsById:{}});_e("python",Hp);_e("python",Up);Jt({info:{key:"rust",title:"Rust",default:"tokio-tungstenite"},clientsById:{}});_e("rust",Fp);_e("rust",zp);Jt({info:{key:"go",title:"Go",default:"gorilla"},clientsById:{}});_e("go",Gp);_e("go",Vp);var Yp=class{constructor(e){this.document=e}convert(e,t,r,n={}){var a;const s=(a=mt[t])==null?void 0:a.clientsById[r];if(!s){const l=Object.values(mt).flatMap(c=>Object.keys(c.clientsById).map(u=>`${c.info.key}/${u}`));throw new bp(t,r,l)}const i=Mp(this.document,e,s.info.protocol);return s.convert(i,n)}};const Qp="javascript",qp="ws";function eh(e,t){return Xp(e,t)}function Aa(e,t,r,n){try{return new Yp(e).convert(t,r,n)}catch{return null}}function th(e,t,r){if(t){for(const n of r)for(const s of n.clients)if(Aa(e,t,n.key,s.key)!==null)return`${n.key}:${s.key}`}return`${Qp}:${qp}`}const nh={agent:"plaintext",c:"c",clojure:"clojure",crystal:"crystal",csharp:"csharp",go:"go",http:"http",java:"java",javascript:"javascript",json:"json",kotlin:"kotlin",node:"javascript",objc:"objectivec",ocaml:"ocaml",php:"php",powershell:"powershell",python:"python",r:"r",ruby:"ruby",rust:"rust",shell:"bash",swift:"swift"};function Ea(e){return nh[e]??"plaintext"}const rh={c:()=>Promise.resolve().then(()=>require("./c-C_Sx7N-F.cjs")),clojure:()=>Promise.resolve().then(()=>require("./clojure-DWYEZwCD.cjs")),crystal:()=>Promise.resolve().then(()=>require("./crystal-BcGgviMR.cjs")),csharp:()=>Promise.resolve().then(()=>require("./csharp-yuAGIuP4.cjs")),go:()=>Promise.resolve().then(()=>require("./go-BpetKc7b.cjs")),http:()=>Promise.resolve().then(()=>require("./http--XH4hLDt.cjs")),java:()=>Promise.resolve().then(()=>require("./java-BIk0G-rH.cjs")),kotlin:()=>Promise.resolve().then(()=>require("./kotlin-kGuORR5a.cjs")),objectivec:()=>Promise.resolve().then(()=>require("./objectivec-CoeV81Tz.cjs")),ocaml:()=>Promise.resolve().then(()=>require("./ocaml-0j7KDjso.cjs")),php:()=>Promise.resolve().then(()=>require("./php-DF4zG2hq.cjs")),powershell:()=>Promise.resolve().then(()=>require("./powershell-CvydS3ek.cjs")),r:()=>Promise.resolve().then(()=>require("./r-CYaZnHkA.cjs")),ruby:()=>Promise.resolve().then(()=>require("./ruby-nPcbuC2a.cjs")),rust:()=>Promise.resolve().then(()=>require("./rust-DKnYCg2f.cjs")),swift:()=>Promise.resolve().then(()=>require("./swift-CAnH__EC.cjs"))};function An(e){return e==="plaintext"||!!Ie.getLanguage(e)}async function $a(e){if(An(e))return;const t=rh[e];if(!t)return;const r=await t();Ie.registerLanguage(e,r.default)}function sh({operationId:e}){const{document:t,showCodeSamples:r}=Ke(),n=g.useId(),s=g.useMemo(()=>e?eh(t,e):[],[t,e]),i=g.useMemo(()=>th(t,e,s),[t,e,s]),[a,l]=g.useState(null),c=(a==null?void 0:a.document)===t&&a.operationId===e?a.selection:i,[u,d]=c.split(":"),f=Ea(u),[,p]=g.useState(()=>An(f));g.useEffect(()=>{p(An(f));let m=!1;return $a(f).then(()=>{m||p(!0)}),()=>{m=!0}},[f]);const h=g.useMemo(()=>e?Aa(t,e,u,d):null,[t,e,u,d]);return!r||!h?null:o.jsxs("div",{id:`operation-${e}-code-sample`,children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("label",{htmlFor:n,className:"text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Example"}),o.jsx("select",{id:n,value:c,onChange:m=>l({document:t,operationId:e,selection:m.target.value}),"aria-label":"Code sample language",className:"text-xs font-medium rounded-md border border-border bg-surface px-2 py-1 text-foreground-secondary focus:border-secondary-500 focus:ring-secondary-500",children:s.map(m=>o.jsx("optgroup",{label:m.title,children:m.clients.map(y=>o.jsx("option",{value:`${m.key}:${y.key}`,children:y.title},y.key))},m.key))})]}),o.jsx(Pn,{code:h,language:f})]})}function Ca({label:e,children:t}){return o.jsx($n,{fallback:null,onError:r=>console.error(`[apiuikit] plugin error in slot "${e}":`,r),children:o.jsx(g.Suspense,{fallback:null,children:t})})}function Ta(){const{plugins:e,pluginSlotRegistry:t}=Ke();return g.useMemo(()=>t??Oo(e??[]),[t,e])}function Ia(e){return Ta().get(e)??[]}function xs({name:e,context:t}){const r=Ia(e);return r.length===0?null:o.jsx(o.Fragment,{children:r.map(({id:n,pluginName:s,Component:i})=>o.jsx(Ca,{label:`${e}:${s} (${n})`,children:o.jsx(i,{...t})},n))})}function Oa(e){return Ta().get(e)??[]}const At="reference";function _a({name:e,context:t,enabled:r=!0,children:n}){const s=Oa(e),[i,a]=g.useState(At),[l,c]=g.useState(()=>new Set([At])),u=g.useId(),d=g.useMemo(()=>new Map(s.map(b=>[b.id,b])),[s]),f=r&&s.length>0,p=f?d.get(i):void 0,h=(p==null?void 0:p.id)??At,m=[{id:At,name:"Reference"},...s.map(b=>({id:b.id,name:b.label}))],y=b=>{c(v=>v.has(b)?v:new Set([...v,b])),a(b)};return f?o.jsxs(o.Fragment,{children:[o.jsx(it,{variant:"segmented",ariaLabel:"Operation view",selectLabel:"Select operation view",idPrefix:u,tabs:m,current:h,onChange:y}),o.jsx(Cl,{tabs:m,current:h,idPrefix:u,renderPanel:(b,v)=>{if(!v&&!l.has(b.id))return null;if(b.id===At)return n;const S=d.get(b.id);if(!S)return null;const w=S.Component;return o.jsx(Ca,{label:`${e}:${S.pluginName}`,children:o.jsx(w,{...t})})}})]}):o.jsx(o.Fragment,{children:n})}function oh({op:e,id:t,focusSection:r=null}){var y;const{document:n}=$o(),s=g.useId(),i=e.messages??[],a=e.tags??[],l=e.bindings,c=e.traits,u=e.reply,d=e.externalDocs,f=e.security,p=l??(Array.isArray(c)?(y=c.find(b=>b.bindings))==null?void 0:y.bindings:void 0),h=e.action===hn.SEND,m=o.jsx("div",{className:"flex flex-col gap-2",children:i.map((b,v)=>o.jsx(wa,{message:b,messageId:b.name,i:v},v))});return o.jsx("div",{className:"flex flex-col gap-6",id:`operation-${t}-detail`,children:o.jsx(_a,{name:"asyncapi.operation.tab",context:{document:n,operationId:t??""},enabled:!!t,children:o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("span",{className:"inline-flex items-center px-2.5 py-1 rounded-md text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200",children:["ID: ",t]}),(d==null?void 0:d.url)&&o.jsxs("a",{href:d.url,target:"_blank",rel:"noreferrer",title:d.description||d.url,className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium bg-neutral-100 text-foreground-secondary border border-border hover:bg-neutral-200 transition-colors",children:["External Documentation",o.jsx(On,{className:"w-3.5 h-3.5"})]})]}),e.description&&o.jsx("div",{children:o.jsx(Oe,{children:e.description})}),e.summary&&o.jsx("div",{children:o.jsx("p",{className:"text-sm text-foreground-secondary",children:e.summary})}),o.jsx(sh,{operationId:t}),t&&o.jsx(xs,{name:"asyncapi.operation.reference.supplementary",context:{document:n,operationId:t}}),f&&f.length>0&&o.jsxs("div",{id:`operation-${t}-security`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Operation Authorization"}),o.jsx(Kt,{ariaLabelledBy:s,forceExpanded:r==="security",trigger:o.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:f.length}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(gs,{securities:f})})})]}),p&&Object.entries(p).map(([b,v])=>v?o.jsxs("div",{id:`operation-${t}-bindings-${b}`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-1",children:"Operation configuration"}),o.jsx(ba,{protocol:b,bindings:v,focused:r===`binding:${b}`})]},b):null),u?o.jsx(hp,{requestMessages:i,reply:u,isSend:h,operationId:t}):i.length>0&&o.jsxs("div",{children:[o.jsxs("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:[o.jsx("span",{className:"font-bold",children:t})," ",h?"accepts":"expects",i.length>1?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-bold text-foreground-mute",children:"one of"}),"the following messages:"]}):" the following message:"]}),m]}),a.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Tags"}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map((b,v)=>o.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-neutral-100 text-foreground-secondary",children:b.name},v))})]})]})})})}function Ma({operations:e,selectedKey:t=null,onSelectKey:r,focusSection:n=null,layout:s}){const i=f=>r==null?void 0:r(f);if(!Object.keys(e).length)return null;const a=t?e[t]:null,l=Object.keys(e).map(f=>{var S;const p=e[f],h=p.channel,m=h==null?void 0:h.address,y=h==null?void 0:h.parameters,b=((S=p.action)==null?void 0:S.toUpperCase())??"",v=t===f;return o.jsxs("tr",{id:`operation-${f}`,onClick:()=>i(f),role:"button",tabIndex:0,"aria-label":`${b||"Operation"} ${m??f}`,"aria-current":v?"true":void 0,onKeyDown:w=>{w.key!=="Enter"&&w.key!==" "||(w.preventDefault(),i(f))},className:`cursor-pointer hover:bg-neutral-50 ${v?"bg-neutral-50":""}`,children:[o.jsx("td",{className:"px-6 py-4 max-w-0 w-full",children:m&&o.jsx(Je,{address:m,parameters:y,truncate:!0})}),o.jsx("td",{className:"px-6 py-4 w-32",children:o.jsx(Ze,{method:p.action,className:"w-24"})})]},f)}),c=a?a.channel:null,u=a&&(c!=null&&c.address)?o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(Ze,{method:a.action}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(Je,{address:c.address,parameters:c.parameters,truncate:!0,peek:!0})})]}):t??"Operation",d=o.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{className:"bg-neutral-100 w-full",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Operation"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Method"})]})}),o.jsx("tbody",{className:"bg-surface divide-y divide-border",children:l})]})});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Xe,{title:hl,content:d,stickySideContent:!1,layout:s})}),o.jsx(ka,{isOpen:!!a,side:"right",onClose:()=>i(null),title:u,children:a&&o.jsx(oh,{op:a,id:t,focusSection:n},t)})]})}function bs({schemas:e,selectedKey:t,focusTarget:r,layout:n}){const{deref:s}=be(),i=Vr(),a=g.useMemo(()=>Object.entries(e).map(([c,u])=>[c,Mt(u,s)]),[e,s,i]),l=a.length?o.jsx("div",{className:"grid gap-6 w-full",children:a.map(([c,u])=>{const d=u.schema,f=li(u.schemaFormat),p=d.properties?Object.keys(d.properties).length:0;return o.jsxs("article",{id:`schema-${c}`,className:`rounded-xl border bg-surface p-5 shadow-sm transition-colors ${t===c?"border-primary-300 ring-1 ring-primary-200":"border-border"}`,children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-base font-semibold text-foreground",children:c}),u.description&&o.jsx("p",{className:"mt-1 text-sm text-foreground-secondary",children:u.description})]}),o.jsx("span",{className:"inline-flex rounded-full bg-neutral-100 px-3 py-1 text-xs font-semibold uppercase tracking-wide text-foreground-secondary",children:d.type??"unknown"})]}),(d.format||f||p>0)&&o.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-foreground-secondary",children:[d.format&&o.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:["Format: ",d.format]}),f&&o.jsx("span",{className:"rounded-full bg-neutral-100 px-3 py-1",title:u.schemaFormat,children:f}),p>0&&o.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:[p," properties"]})]}),u.conversionError&&o.jsxs("p",{className:"mt-4 text-xs text-amber-700 bg-amber-50 border border-amber-200 rounded px-2 py-1.5",children:["Could not convert"," ",ci(u.schemaFormat)??"the"," schema — showing raw definition. ",u.conversionError]}),u.pendingConversion&&o.jsx("p",{className:"mt-4 text-xs text-foreground-muted",children:"Loading Protobuf definition…"}),u.pendingConversion?null:u.conversionError&&typeof u.originalSchema=="string"?o.jsx("div",{className:"mt-4",children:o.jsx(Xi,{schema:u.originalSchema})}):o.jsx(ms,{schema:d,rootName:c,className:"mt-4",focusTokens:c===t?(r==null?void 0:r.tokens)??null:null,focusId:c===t?(r==null?void 0:r.id)??null:null})]},c)})}):o.jsx("div",{className:"mt-10 rounded-xl border border-dashed border-neutral-300 bg-surface p-8 text-center text-sm text-foreground-muted",children:"No schemas defined in this document."});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Xe,{content:l,stickySideContent:!1,layout:n})})}const ih=e=>e==="operations"||e==="messages"||e==="schemas";function ah({asyncapi:e,config:t,plugins:r}){var P,z,G,j;const n=t.show??{},[s,i]=g.useState(!1),[a,l]=g.useState(!1),c=n.search!==!1||n.copyMarkdown!==!1,u=n.info!==!1&&Vi(e.info),d=c||u,f=[...n.operations!==!1?[{id:"operations",name:"Operations",icon:Tn}]:[],...n.messages!==!1?[{id:"messages",name:"Messages",icon:Wo}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Br}]:[]],{query:p,setQuery:h,results:m}=Vc(e,{threshold:.3,limit:20}),{effectiveTab:y,focusTab:b,navActiveSection:v,selected:S,setSelectedKey:w,selectedNavItem:I,handleSearchSelect:B,handleNavItemSelect:F,handleNavServerSelect:N,handleContentTabChange:k,focusSection:x,schemaFocusTarget:$}=ii({tabs:f,defaultTab:"operations",isTabKey:ih,sections:[{id:"operations",visible:n.operations!==!1},{id:"messages",visible:n.messages!==!1},{id:"schemas",visible:n.schemas!==!1},{id:"servers",visible:n.servers!==!1}],searchQuery:p}),T=e.servers?Object.keys(e.servers):[],C=y==="operations"?o.jsx(Ma,{operations:e.operations??{},selectedKey:S.operations,onSelectKey:A=>w("operations",A),focusSection:x}):y==="messages"?o.jsx(da,{messages:((P=e.components)==null?void 0:P.messages)??{},selectedKey:S.messages,focusSection:x}):y==="schemas"?o.jsx(bs,{schemas:((z=e.components)==null?void 0:z.schemas)??{},selectedKey:S.schemas,focusTarget:$}):null;return o.jsx(Cn,{document:e,config:t,plugins:r,children:o.jsxs("div",{className:`px-4 ${d&&f.length>0?"pt-14":""}`,children:[d&&o.jsxs(Bo,{logo:u?o.jsx(fs,{source:e.info}):void 0,forceVisible:s||a,children:[n.search!==!1&&o.jsx(Ko,{query:p,onQueryChange:h,results:m,onSelectResult:B,onOpenChange:i}),n.copyMarkdown!==!1&&o.jsx(Zo,{serialize:A=>Jr(e,A),onOpenChange:l})]}),n.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(Zi,{...e.info,showLogo:!1})}),n.servers!==!1&&T.length>0&&o.jsx("div",{id:`server-${S.servers??T[0]}`,children:o.jsx(ya,{servers:e.servers,selectedServer:S.servers,onSelectServer:A=>w("servers",A),focusSection:x})}),n.sidebar!==!1&&o.jsx(Vl,{operations:n.operations!==!1?e.operations:void 0,messages:n.messages!==!1?(G=e.components)==null?void 0:G.messages:void 0,schemas:n.schemas!==!1?(j=e.components)==null?void 0:j.schemas:void 0,servers:n.servers!==!1?e.servers:void 0,hasInfo:n.info!==!1,sidebarConfig:t.sidebar,activeTab:v,onTabChange:b,onItemSelect:F,onSelectServer:N,selectedItem:I}),o.jsx(Lo,{tabs:f,current:y,onChange:k}),y&&o.jsx("div",{id:`panel-${y}`,role:"tabpanel","aria-labelledby":`tab-${y}`,children:C})]})})}const ys=e=>o.jsx($n,{fallback:e.errorFallback,onError:e.onError,children:o.jsx(lh,{...e})}),lh=e=>{const t=e.asyncapi,r=g.useMemo(()=>xt(t),[t]),n=e.kind;g.useEffect(()=>{n==="resolved"&&r!==t&&Rr(t)&&console.warn('[apiuikit] <AsyncAPI kind="resolved"> received a document that still contains $ref nodes. They were resolved anyway; fix the upstream resolution or drop the kind prop.')},[n,t,r]);const s=e.config??gt;return o.jsx(ah,{asyncapi:r,config:s,plugins:e.plugins})};function Bn({document:e,config:t=gt,plugins:r,className:n="",children:s}){const{contextValue:i,themeVars:a,resolvedMode:l,setPortalHost:c,setRootElement:u}=_o("openapi",e,t,r);return o.jsx(bt.Provider,{value:i,children:o.jsxs("div",{ref:u,"data-theme":l,style:a,className:`apiuikit-root relative @container bg-background text-foreground ${n}`,children:[o.jsx("div",{ref:c,className:"openapi-portal-root"}),s]})})}function ch(e){var n;const t=[];if(e.info){const s=e.info.title??"Info";t.push({id:"info-panel",targetId:"info-panel",type:"info",tab:"info",key:"info",name:s,path:"info",location:"Info",subtitle:e.info.description,text:je([e.info,e.tags,e.externalDocs])})}e.servers&&e.servers.forEach((s,i)=>{const a=`server-${i}`;t.push({id:a,targetId:a,type:"server",tab:"servers",key:a,name:s.description??s.url??a,path:`servers[${i}]`,location:`Servers > ${s.url??a}`,subtitle:s.url,text:je([s.url,s.description,s.variables])})});const r=(s,{tab:i,type:a,idPrefix:l,docKey:c,sectionLabel:u})=>{for(const d of Object.keys(s)){const f=s[d];if(f)for(const p of In){const h=f[p];if(!h)continue;const m=`${p} ${d}`,y=h.summary??`${p.toUpperCase()} ${d}`;t.push({id:`${l}-${m}`,targetId:`${l}-${m}-detail`,type:a,tab:i,key:m,name:y,path:`${c}.${d}.${p}`,location:`${u} > ${p.toUpperCase()} ${d}`,subtitle:h.description,text:je([p,d,h.summary,h.description,h.operationId,h.tags,h.parameters,h.security])})}}};if(e.paths&&r(e.paths,{tab:"endpoints",type:"endpoint",idPrefix:"endpoint",docKey:"paths",sectionLabel:"Endpoints"}),e.webhooks&&r(e.webhooks,{tab:"webhooks",type:"webhook",idPrefix:"webhook",docKey:"webhooks",sectionLabel:"Webhooks"}),(n=e.components)!=null&&n.schemas)for(const[s,i]of Object.entries(e.components.schemas))Xo(t,i,s,s);return t}function uh(e,t={}){return si(e,ch,t)}function Ra({info:e,tags:t,externalDocs:r,layout:n,showLogo:s}){const{title:i,description:a,license:l,contact:c}=e;return o.jsx(Ji,{title:i,description:a,license:l,contact:c,externalDocs:r,tags:t,extensionsSource:e,layout:n,showLogo:s})}function dh({url:e,description:t,variables:r}){return o.jsxs("div",{children:[o.jsx(ha,{address:e,variables:r}),t&&o.jsx(Oe,{children:t})]})}const er=e=>`server-${e}`,tr=e=>Number(e.slice(7));function Pa({servers:e,selectedServer:t,onSelectServer:r,layout:n}){const s=e.map((p,h)=>p.url||er(h)),[i,a]=g.useState(void 0),l=p=>!!p&&tr(p)>=0&&tr(p)<e.length,c=l(t)?t:l(i)?i:er(0),u=e[tr(c)],d=p=>{a(p),r==null||r(p)},f=u?o.jsx(dh,{...u}):null;return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Xe,{title:To,content:f,sideContent:o.jsx(fa,{serverNames:s,current:(u==null?void 0:u.url)||c,setCurrent:p=>{const h=s.indexOf(p);d(h>=0?er(h):p)}}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:n})})}const vo=320;function fh({parameters:e}){const{portalHost:t}=be(),[r,n]=g.useState(!1),[s,i]=g.useState({top:0,left:0,placement:"bottom"}),a=g.useRef(null),l=g.useRef(null),c=g.useId();return g.useEffect(()=>{if(!r)return;const u=a.current;if(!u)return;const d=()=>i(ir(u,{align:"end",width:vo}));return d(),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[r]),g.useEffect(()=>{if(!r)return;const u=f=>{var p;f.key==="Escape"&&(f.stopPropagation(),n(!1),(p=a.current)==null||p.focus())},d=f=>{var h;const p=((h=f.composedPath)==null?void 0:h.call(f))??[];p.includes(l.current)||p.includes(a.current)||n(!1)};return document.addEventListener("keydown",u,!0),document.addEventListener("pointerdown",d,!0),()=>{document.removeEventListener("keydown",u,!0),document.removeEventListener("pointerdown",d,!0)}},[r]),e.length===0?null:o.jsxs(o.Fragment,{children:[o.jsxs("button",{ref:a,type:"button",onClick:()=>n(u=>!u),"aria-expanded":r,"aria-haspopup":"dialog","aria-controls":r?c:void 0,"aria-label":`${e.length} query ${e.length===1?"parameter":"parameters"}`,className:`shrink-0 inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 font-mono text-[11px] leading-4 transition-colors ${r?"border-neutral-300 bg-neutral-200/70 text-foreground-secondary":"border-border bg-neutral-100 text-foreground-muted hover:border-neutral-300 hover:text-foreground-secondary"}`,children:[o.jsxs("span",{"aria-hidden":!0,children:["?",e.length]}),o.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 10 10",className:`h-2 w-2 transition-transform ${r?"rotate-180":""}`,fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M1.5 3.5L5 7l3.5-3.5"})})]}),r&&t&&pt.createPortal(o.jsxs("div",{ref:l,id:c,role:"dialog","aria-label":"Query parameters",style:{top:s.top,left:s.left,width:vo},className:`fixed z-[60] max-h-80 overflow-y-auto rounded-lg border border-border bg-surface shadow-lg ${s.placement==="top"?"-translate-y-full":""}`,children:[o.jsx("p",{className:"sticky top-0 border-b border-border bg-surface px-3 py-2 text-[10px] font-medium uppercase tracking-wider text-foreground-muted",children:"Query parameters"}),o.jsx("ul",{className:"divide-y divide-border",children:e.map(u=>o.jsxs("li",{className:"px-3 py-2",children:[o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("code",{className:"font-mono text-xs font-semibold text-foreground",children:u.name}),u.type&&o.jsx("span",{className:"text-[10px] text-foreground-muted",children:u.type}),u.required&&o.jsx("span",{className:"ml-auto shrink-0 text-[10px] font-medium uppercase tracking-wide text-red-600",children:"Required"})]}),u.description&&o.jsx("p",{className:"mt-1 text-xs leading-snug text-foreground-secondary",children:u.description}),u.default&&o.jsxs("p",{className:"mt-1 text-[11px] text-foreground-muted",children:[o.jsx("span",{className:"font-medium",children:"Default:"})," ",o.jsx("code",{children:u.default})]}),u.enum&&u.enum.length>0&&o.jsx("p",{className:"mt-1 text-[11px] text-foreground-muted",children:Do(u.enum)}),u.examples&&u.examples.length>0&&o.jsxs("p",{className:"mt-1 text-[11px] text-foreground-muted",children:[o.jsx("span",{className:"font-medium",children:"Examples:"})," ",u.examples.join(", ")]})]},u.name))})]}),t)]})}function ph({className:e}){return o.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:e,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("circle",{cx:"12",cy:"12",r:"9"}),o.jsx("path",{d:"M12 11v5"}),o.jsx("path",{d:"M12 8h.01"})]})}function La(e){return typeof e!="string"?JSON.stringify(e):e.startsWith("$")?e.slice(1).replace(/#\//g,".").replace(/\//g,"."):e}function hh(e){return e.replace(/\{\$([^}]+)\}/g,(t,r)=>`{${La(`$${r}`)}}`)}function mh(e){return e.operationId??e.operationRef??null}const gh=e=>e.trim().replace(/[.:;]+$/,""),nr=({children:e})=>o.jsx("code",{className:"font-mono text-foreground-secondary",children:e});function xh({links:e,onFollowOperation:t,isOperationKnown:r}){return o.jsx("div",{className:"mt-3 space-y-1",children:Object.entries(e).map(([n,s])=>{var d;const i=mh(s),a=Object.entries(s.parameters??{}),l=s.description?gh(s.description):null,c=!!s.operationId&&!!t&&!!(r!=null&&r(s.operationId)),u=l??i??n;return o.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-foreground-muted leading-relaxed",children:[o.jsx(ph,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),o.jsxs("span",{children:[c?o.jsx("button",{type:"button",onClick:()=>t(s.operationId),className:"text-primary-600 underline underline-offset-2 hover:text-primary-500",children:u}):o.jsx("span",{className:"text-foreground-secondary",children:u}),a.length>0&&o.jsxs(o.Fragment,{children:[" using ",a.map(([f,p],h)=>o.jsxs(g.Fragment,{children:[h>0&&(h===a.length-1?" and ":", "),o.jsx(nr,{children:f})," from ",o.jsx(nr,{children:La(p)})]},f))]}),(d=s.server)!=null&&d.url?o.jsxs(o.Fragment,{children:[" via ",o.jsx(nr,{children:s.server.url})]}):null,"."]})]},n)})})}function bh(e){return Object.entries(e).flatMap(([t,r])=>Object.entries(r??{}).flatMap(([n,s],i)=>In.filter(a=>s==null?void 0:s[a]).map(a=>({name:t,url:n,method:a,op:s[a],urlIndex:i}))))}function yh({callbacks:e,id:t,renderOperation:r,depth:n}){const s=bh(e);return s.length===0?null:o.jsxs("div",{children:[o.jsx("p",{className:"text-xs text-foreground-muted mb-3",children:"Requests the API sends to you after this operation, not ones you call."}),o.jsx("div",{className:"space-y-2",children:s.map(({name:i,url:a,method:l,op:c,urlIndex:u})=>o.jsx(Kt,{trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal min-w-0",children:[o.jsx(Ze,{method:l,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"font-medium text-foreground-secondary shrink-0",children:i}),o.jsx("code",{className:"font-mono text-foreground-muted truncate",children:hh(a)})]}),children:o.jsx("div",{className:"px-4 py-3 border-t border-border",children:o.jsx(r,{method:l,path:a,op:c,id:`${t}-${i}-${u}-${l}`,idPrefix:"callback",depth:n+1})})},`${i}-${u}-${l}`))})]})}const kh=g.lazy(()=>Promise.resolve().then(()=>require("./CodeSamples-D2iaaOjz.cjs")).then(({CodeSamples:e})=>({default:e})));function wh(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function Ba({prefix:e,mediaTypes:t,selected:r,onChange:n}){return t.length<=1?o.jsx(o.Fragment,{children:t[0]?`${e} (${t[0]})`:e}):o.jsxs(o.Fragment,{children:[e," (",o.jsx("select",{"aria-label":`${e} media type`,value:r,onChange:s=>n(s.target.value),className:"bg-transparent border-0 p-0 cursor-pointer underline decoration-dotted focus:outline-none",children:t.map(s=>o.jsx("option",{value:s,children:s},s))}),")"]})}function Da(e){if(!e)return;if(e.example!==void 0)return e.example;const t=e.examples?Object.values(e.examples)[0]:void 0;return t&&"value"in t?t.value:void 0}function vh(e){return e.startsWith("2")?"bg-green-100 text-green-800":e.startsWith("4")||e.startsWith("5")?"bg-red-100 text-red-800":"bg-neutral-100 text-foreground-secondary"}function jh({responses:e,onFollowOperation:t,isOperationKnown:r}){var F,N;const n=Object.keys(e),[s,i]=g.useState(n[0]),a=e[s],l=Object.keys((a==null?void 0:a.content)??{}),[c,u]=g.useState(l[0]),d=c?(F=a==null?void 0:a.content)==null?void 0:F[c]:void 0,f=(a==null?void 0:a.headers)??{},p=(a==null?void 0:a.links)??{},[h,m]=g.useState("body"),y=l.length>0&&!!d,b=Object.keys(f).length>0,v=Object.keys(p).length>0,S=[...y?[{id:"body",name:"Body"}]:[],...b?[{id:"headers",name:"Headers"}]:[]],w=S.length>1,I=S.some(k=>k.id===h)?h:(N=S[0])==null?void 0:N.id,B=S.length>0;return g.useEffect(()=>{u(Object.keys((a==null?void 0:a.content)??{})[0]),m("body")},[s]),o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center gap-1.5 flex-wrap mb-3",role:"tablist","aria-label":"Response status",children:n.map(k=>o.jsx("button",{role:"tab","aria-selected":s===k,onClick:()=>i(k),className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-mono transition-all ${vh(k)} ${s===k?"ring-1 ring-inset ring-foreground-muted/40":"opacity-50 hover:opacity-80"}`,children:k},k))}),(a==null?void 0:a.description)&&o.jsx("p",{className:"text-sm text-foreground-secondary mb-3",children:a.description}),B?o.jsxs(o.Fragment,{children:[w&&o.jsx(it,{tabs:S,current:I,onChange:k=>m(k)}),o.jsx("div",{className:w?"mt-4":void 0,children:I==="headers"?o.jsx(ot,{schema:Nh(f),label:"Headers",rootName:"Headers",defaultView:"schema"},"headers"):o.jsx(ot,{schema:(d==null?void 0:d.schema)??{},label:o.jsx(Ba,{prefix:"Body",mediaTypes:l,selected:c,onChange:u}),rootName:"Body",example:Da(d)},"body")})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No response body."}),v&&o.jsx(xh,{links:p,onFollowOperation:t,isOperationKnown:r})]})}function Fa(e){const t={},r=[];for(const n of e){const s=n.schema??{};t[n.name]={...s,description:s.description??n.description},n.required&&r.push(n.name)}return{type:"object",properties:t,...r.length>0?{required:r}:{}}}const Sh=e=>Fa(e),Nh=e=>Fa(Object.entries(e).map(([t,r])=>({name:t,...r})));function Ah({parameters:e}){var l;const t=xl.filter(({location:c})=>e.some(u=>u.in===c)),[r,n]=g.useState(((l=t[0])==null?void 0:l.location)??null);if(t.length===0)return null;const s=t.some(c=>c.location===r)?r:t[0].location,i=t.find(c=>c.location===s),a=Sh(e.filter(c=>c.in===s));return o.jsxs("div",{children:[t.length>1&&o.jsx(it,{tabs:t.map(({location:c,label:u})=>({id:c,name:u.replace(/ Parameters$/,"")})),current:s,onChange:n}),o.jsx("div",{className:t.length>1?"mt-4":void 0,children:o.jsx(ot,{schema:a,label:i.label,rootName:i.label,defaultView:"schema"})})]})}function Eh({label:e,parameters:t,requestBodyContent:r,requestBodyDescription:n}){const s=t.length>0,i=Object.keys(r),a=i.length>0,[l,c]=g.useState(s?"parameters":"body"),[u,d]=g.useState(i[0]),f=u?r[u]:void 0;if(!s&&!a)return o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No request body or parameters."});const p=[a?"request body":null,t.some(h=>h.in==="header")?"headers":null,t.some(h=>h.in==="cookie")?"cookie":null].filter(h=>!!h);return o.jsxs("div",{children:[o.jsxs("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-3",children:[o.jsx("span",{className:"font-bold",children:e})," expects the following ",$h(p),":"]}),s&&a&&o.jsx(it,{tabs:[{id:"parameters",name:"Parameters"},{id:"body",name:"Request Body"}],current:l,onChange:h=>c(h)}),o.jsxs("div",{className:s&&a?"mt-4":void 0,children:[(l==="parameters"||!a)&&s&&o.jsx(Ah,{parameters:t}),(l==="body"||!s)&&a&&f&&o.jsx(ot,{schema:f.schema??{},label:o.jsx(Ba,{prefix:"Request Body",mediaTypes:i,selected:u,onChange:d}),rootName:"Body ",description:n,example:Da(f)})]})]})}function $h(e){return e.length<=1?e[0]??"request":e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`}function Ch({label:e,parameters:t,requestBodyContent:r,requestBodyDescription:n,responses:s,callbacks:i,id:a,depth:l,fillHeight:c=!1,onFollowOperation:u,isOperationKnown:d}){const f=t.length>0||Object.keys(r).length>0,p=Object.keys(s).length>0,h=!!i&&Object.keys(i).length>0&&l<Th,m=[...f?["request"]:[],...p?["response"]:[],...h?["callbacks"]:[]],[y,b]=g.useState(m[0]??"request");if(m.length===0)return null;const v=m.includes(y)?y:m[0];return o.jsxs("div",{className:c?"flex-1 flex flex-col min-h-0":void 0,children:[o.jsx("div",{className:"flex items-end gap-0.5 -ml-2",role:"tablist","aria-label":"Operation exchange",children:m.map(S=>o.jsx("button",{role:"tab","aria-selected":v===S,onClick:()=>b(S),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize ${v===S?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:S},S))}),o.jsxs("div",{className:`-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32 ${c?"flex-1 -mb-4":""}`,children:[v==="request"&&o.jsx(Eh,{label:e,parameters:t,requestBodyContent:r,requestBodyDescription:n}),v==="response"&&o.jsx(jh,{responses:s,onFollowOperation:u,isOperationKnown:d}),v==="callbacks"&&i&&o.jsx(yh,{callbacks:i,id:a,depth:l,renderOperation:za})]})]})}const Th=1;function za({method:e,path:t,op:r,id:n,idPrefix:s="endpoint",globalSecurity:i,securitySchemes:a,onFollowOperation:l,isOperationKnown:c,depth:u=0}){var w,I,B,F;const{document:d}=Co(),f=(r.parameters??[]).filter(N=>N.in!=="query"&&N.in!=="path"),p=r.security??i??[],h=r.responses??{},m=((w=r.requestBody)==null?void 0:w.content)??{},y=r.operationId?wh(r.operationId):`${e.toUpperCase()} ${t}`,b=new Map;for(const N of p)for(const[k,x]of Object.entries(N)){if(x.length===0)continue;const $=b.get(k)??[];b.set(k,Array.from(new Set([...$,...x])))}const v=Array.from(new Set(p.flatMap(N=>Object.keys(N)))).map(N=>{const k=a==null?void 0:a[N];if(!k)return null;const x=b.get(N);return x?{...k,requiredScopes:x}:k}).filter(N=>!!N),S=u===0;return o.jsx("div",{className:`flex flex-col gap-6 ${S?"min-h-full":""}`,id:`${s}-${n}-detail`,children:o.jsx(_a,{name:"openapi.operation.tab",context:{document:d,method:e,path:t},enabled:S,children:o.jsxs(o.Fragment,{children:[(r.deprecated||((I=r.externalDocs)==null?void 0:I.url))&&o.jsxs("div",{className:"flex items-center gap-2",children:[r.deprecated&&o.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-amber-100 text-amber-800",children:"Deprecated"}),((B=r.externalDocs)==null?void 0:B.url)&&o.jsxs("a",{href:r.externalDocs.url,target:"_blank",rel:"noreferrer",title:r.externalDocs.description||r.externalDocs.url,className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium bg-neutral-100 text-foreground-secondary border border-border hover:bg-neutral-200 transition-colors",children:["External Documentation",o.jsx(On,{className:"w-3.5 h-3.5"})]})]}),r.summary&&o.jsx("p",{className:"text-sm text-foreground-secondary",children:r.summary}),r.description&&o.jsx(Oe,{children:r.description}),o.jsx(g.Suspense,{fallback:null,children:o.jsx(kh,{method:e,path:t,parameters:f,requestBody:r.requestBody,security:p,id:n})}),o.jsx(xs,{name:"openapi.operation.reference.supplementary",context:{document:d,method:e,path:t}}),p.length>0&&o.jsxs("div",{id:`${s}-${n}-security`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Authorization"}),v.length>0&&o.jsx(Kt,{className:"mt-3",trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal text-foreground-muted",children:[o.jsx(pa,{className:"h-4 w-4 text-foreground-muted"}),o.jsx("span",{className:"bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:v.length})]}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(gs,{securities:v})})})]}),o.jsx(Ch,{label:y,parameters:f,requestBodyContent:m,requestBodyDescription:(F=r.requestBody)==null?void 0:F.description,responses:h,callbacks:r.callbacks,id:n,depth:u,fillHeight:S,onFollowOperation:l,isOperationKnown:c})]})})})}function Ha(e){var r;const t=e.schema;return{description:e.description,type:t==null?void 0:t.type,default:(t==null?void 0:t.default)!==void 0?String(t.default):void 0,enum:(r=t==null?void 0:t.enum)==null?void 0:r.map(String),examples:"example"in e&&e.example!==void 0?[String(e.example)]:void 0}}function jo(e){const t={};for(const r of e)t[r.name]=Ha(r);return t}function Ih(e){return e.filter(t=>t.in==="query").map(t=>({...Ha(t),name:t.name,required:t.required}))}function En({paths:e,security:t,securitySchemes:r,selectedKey:n=null,onSelectKey:s,columnLabel:i="Path",idPrefix:a="endpoint",layout:l}){var F;const c=N=>s==null?void 0:s(N),u=g.useMemo(()=>Tt(e),[e]),d=g.useMemo(()=>{var k,x,$;const N=new Map;for(const T of u){const C=(($=(x=(k=e[T.path])==null?void 0:k[T.method])==null?void 0:x.tags)==null?void 0:$[0])||"Other",P=N.get(C)??[];P.push(T),N.set(C,P)}return Array.from(N,([T,C])=>({label:T,items:C}))},[u,e]),[f,p]=g.useState(()=>new Set),h=f.size===0;g.useEffect(()=>{if(!n)return;const N=d.find(({items:k})=>k.some(({key:x})=>x===n));N&&p(k=>{if(!k.has(N.label))return k;const x=new Set(k);return x.delete(N.label),x})},[d,n]);const m=g.useMemo(()=>{var k,x;const N=new Map;for(const{key:$,method:T,path:C}of u){const P=(x=(k=e[C])==null?void 0:k[T])==null?void 0:x.operationId;P&&N.set(P,$)}return N},[u,e]);if(u.length===0)return null;const y=n?u.find(N=>N.key===n):null,b=y?(F=e[y.path])==null?void 0:F[y.method]:null,v=({key:N,method:k,path:x},$)=>{var P;const T=n===N,C=Ts(e[x],(P=e[x])==null?void 0:P[k]);return o.jsxs("tr",{id:`${a}-${N}`,onClick:()=>c(N),role:"button",tabIndex:$?0:-1,"aria-hidden":!$,"aria-label":`${k.toUpperCase()} ${x}`,"aria-current":T?"true":void 0,onKeyDown:z=>{z.key!=="Enter"&&z.key!==" "||(z.preventDefault(),c(N))},className:`group transition-[opacity,visibility] duration-300 ease-in-out ${$?`cursor-pointer opacity-100 visible ${T?"bg-neutral-50":""}`:"pointer-events-none invisible opacity-0"}`,children:[o.jsx("td",{className:`px-6 max-w-0 w-full group-hover:bg-neutral-50 transition-[padding] duration-300 ease-in-out ${$?"py-2":"py-0"}`,children:o.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${$?"max-h-12":"max-h-0"}`,children:o.jsx(Je,{address:x,parameters:jo(C),truncate:!0,className:"text-xs"})})}),o.jsx("td",{className:`px-6 w-28 group-hover:bg-neutral-50 transition-[padding] duration-300 ease-in-out ${$?"py-2":"py-0"}`,children:o.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${$?"max-h-12":"max-h-0"}`,children:o.jsx(Ze,{method:k,className:"w-20"})})})]},N)},S=d.map(({label:N,items:k},x)=>{const $=!f.has(N),T=`${a}-group-${x}-${N.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return o.jsxs(g.Fragment,{children:[o.jsx("tbody",{className:"border-y border-border first:border-t-0",children:o.jsx("tr",{className:"bg-neutral-50/70",children:o.jsx("th",{colSpan:2,scope:"rowgroup",className:"p-0 text-left",children:o.jsxs("button",{type:"button","aria-label":`${N} endpoints (${k.length})`,"aria-expanded":$,"aria-controls":T,onClick:()=>p(C=>{const P=new Set(C);return $?P.add(N):P.delete(N),P}),className:"group/header flex w-full items-center gap-3 px-6 py-3.5 text-left hover:bg-neutral-100/80 transition-colors",children:[o.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-border bg-surface text-foreground-muted shadow-sm transition-colors group-hover/header:border-neutral-300 group-hover/header:text-foreground-secondary",children:$?o.jsx(yt,{className:"h-2.5 w-2.5"}):o.jsx(ma,{className:"h-2.5 w-2.5"})}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold tracking-wide text-foreground-secondary",children:N}),o.jsx("span",{className:"inline-flex min-w-6 items-center justify-center rounded-full bg-neutral-200/70 px-2 py-0.5 text-xs font-medium tabular-nums text-foreground-muted",children:k.length})]})})})}),o.jsx("tbody",{id:T,"aria-hidden":!$,className:`bg-surface ${$?"divide-y divide-border":""}`,children:k.map(C=>v(C,$))})]},N)}),w=Ts(y?e[y.path]:void 0,b),I=y?o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(Ze,{method:y.method}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(Je,{address:y.path,parameters:jo(w),truncate:!0,peek:!0,className:"text-xs"})}),o.jsx(fh,{parameters:Ih(w)})]}):n,B=o.jsxs("div",{children:[o.jsx("div",{className:"mb-3 flex justify-end",children:o.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-foreground-secondary",children:[o.jsx("input",{type:"checkbox",checked:h,onChange:N=>p(N.target.checked?new Set:new Set(d.map(({label:k})=>k))),onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),p(h?new Set(d.map(({label:k})=>k)):new Set))},className:"h-3.5 w-3.5 cursor-pointer rounded border-border"}),o.jsx("span",{children:"Expand all"})]})}),o.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{className:"bg-neutral-100 w-full",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:i}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Method"})]})}),S]})})]});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Xe,{content:B,stickySideContent:!1,layout:l})}),o.jsx(ka,{isOpen:!!y,side:"right",onClose:()=>c(null),title:I,children:y&&b&&o.jsx(za,{method:y.method,path:y.path,op:{...b,parameters:w},id:y.key,idPrefix:a,globalSecurity:t,securitySchemes:r,isOperationKnown:N=>m.has(N),onFollowOperation:N=>{const k=m.get(N);k&&c(k)}},y.key)})]})}const Oh=e=>e==="endpoints"||e==="webhooks"||e==="schemas";function _h({openapi:e,config:t,plugins:r}){var z,G,j,A;const n=t.show??{},[s,i]=g.useState(!1),[a,l]=g.useState(!1),c=n.search!==!1||n.copyMarkdown!==!1,u=n.info!==!1&&Vi(e.info),d=c||u,f=e.webhooks??{},p=Object.keys(f).length>0,h=[...n.endpoints!==!1?[{id:"endpoints",name:"Endpoints",icon:Tn}]:[],...p&&n.webhooks!==!1?[{id:"webhooks",name:"Webhooks",icon:Dr}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Br}]:[]],{query:m,setQuery:y,results:b}=uh(e,{threshold:.3,limit:20}),{effectiveTab:v,focusTab:S,navActiveSection:w,selected:I,setSelectedKey:B,selectedNavItem:F,handleSearchSelect:N,handleNavItemSelect:k,handleNavServerSelect:x,handleContentTabChange:$,schemaFocusTarget:T}=ii({tabs:h,defaultTab:"endpoints",isTabKey:Oh,sections:[{id:"endpoints",visible:n.endpoints!==!1},{id:"webhooks",visible:p&&n.webhooks!==!1},{id:"schemas",visible:n.schemas!==!1},{id:"servers",visible:n.servers!==!1}],searchQuery:m}),C=(e.servers??[]).map(M=>M.url),P=v==="endpoints"?o.jsx(En,{paths:e.paths??{},security:e.security,securitySchemes:(z=e.components)==null?void 0:z.securitySchemes,selectedKey:I.endpoints,onSelectKey:M=>B("endpoints",M)}):v==="webhooks"?o.jsx(En,{paths:f,security:e.security,securitySchemes:(G=e.components)==null?void 0:G.securitySchemes,selectedKey:I.webhooks,onSelectKey:M=>B("webhooks",M),columnLabel:"Webhook",idPrefix:"webhook"}):v==="schemas"?o.jsx(bs,{schemas:((j=e.components)==null?void 0:j.schemas)??{},selectedKey:I.schemas,focusTarget:T}):null;return o.jsx(Bn,{document:e,config:t,plugins:r,children:o.jsxs("div",{className:`px-4 ${d&&h.length>0?"pt-14":""}`,children:[d&&o.jsxs(Bo,{logo:u?o.jsx(fs,{source:e.info}):void 0,forceVisible:s||a,children:[n.search!==!1&&o.jsx(Ko,{query:m,onQueryChange:y,results:b,onSelectResult:N,onOpenChange:i}),n.copyMarkdown!==!1&&o.jsx(Zo,{serialize:M=>Zr(e,M),onOpenChange:l})]}),n.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(Ra,{info:e.info,tags:e.tags,externalDocs:e.externalDocs,showLogo:!1})}),n.servers!==!1&&C.length>0&&o.jsx("div",{id:I.servers??"server-0",children:o.jsx(Pa,{servers:e.servers,selectedServer:I.servers,onSelectServer:M=>B("servers",M)})}),n.sidebar!==!1&&o.jsx(Yl,{paths:n.endpoints!==!1?e.paths:void 0,webhooks:p&&n.webhooks!==!1?f:void 0,schemas:n.schemas!==!1?(A=e.components)==null?void 0:A.schemas:void 0,servers:n.servers!==!1?C:void 0,hasInfo:n.info!==!1,activeTab:w,onTabChange:S,onItemSelect:k,onSelectServer:x,selectedItem:F}),o.jsx(Lo,{tabs:h,current:v,onChange:$}),v&&o.jsx("div",{id:`panel-${v}`,role:"tabpanel","aria-labelledby":`tab-${v}`,children:P})]})})}const ks=e=>o.jsx($n,{fallback:e.errorFallback,onError:e.onError,children:o.jsx(Mh,{...e})}),Mh=e=>{const t=e.openapi,r=g.useMemo(()=>xt(t),[t]),n=e.kind;g.useEffect(()=>{n==="resolved"&&r!==t&&Rr(t)&&console.warn('[apiuikit] <OpenAPI kind="resolved"> received a document that still contains $ref nodes. They were resolved anyway; fix the upstream resolution or drop the kind prop.')},[n,t,r]);const s=e.config??gt;return o.jsx(_h,{openapi:r,config:s,plugins:e.plugins})};function Ua(e){return{...e,title:t=>e.title(t),summary:t=>e.summary(t),targets:t=>e.targets(t),toMarkdown:(t,r)=>e.toMarkdown(t,r)}}const ft=e=>{var r;return typeof e!="string"?void 0:((r=e.trim().split(`
|
|
177
|
+
`)[0])==null?void 0:r.trim())||void 0},Rh=e=>In.some(t=>t===e),Ph=Ua({name:"OpenAPI",matches:e=>typeof e.openapi=="string"||typeof e.swagger=="string",sectionTitle:"Endpoints",title:e=>{var t;return((t=e.info)==null?void 0:t.title)??"API"},summary:e=>{var t;return ft((t=e.info)==null?void 0:t.description)},targets:e=>Tt(e.paths??{}).map(({key:t,method:r,path:n})=>{var i,a;const s=(a=(i=e.paths)==null?void 0:i[n])==null?void 0:a[r];return{key:t,label:`${r.toUpperCase()} ${n}`,summary:ft(s==null?void 0:s.summary)??ft(s==null?void 0:s.description),target:{kind:"operation",document:e,method:r,path:n}}}),toMarkdown:(e,t)=>{if(!t||t.kind==="document")return Zr(e);if(typeof t.path!="string"||!Rh(t.method))throw new Error("[apiuikit] An OpenAPI operation target requires a valid method and path.");return hi(e,t.method,t.path)}}),Lh=Ua({name:"AsyncAPI",matches:e=>typeof e.asyncapi=="string",sectionTitle:"Operations",title:e=>{var t;return((t=e.info)==null?void 0:t.title)??"API"},summary:e=>{var t;return ft((t=e.info)==null?void 0:t.description)},targets:e=>Object.entries(e.operations??{}).map(([t,r])=>({key:t,label:r!=null&&r.action?`${r.action.toUpperCase()} ${t}`:t,summary:ft(r==null?void 0:r.summary)??ft(r==null?void 0:r.description),target:{kind:"operation",document:e,id:t}})),toMarkdown:(e,t)=>{if(!t||t.kind==="document")return Jr(e);if(typeof t.id!="string"||!t.id)throw new Error("[apiuikit] An AsyncAPI operation target requires an operation id.");return fi(e,t.id)}}),So=[Ph,Lh];function ws(e){const t=typeof e=="object"&&e!==null?e:{},r=So.find(n=>n.matches(t));if(!r)throw new Error(`[apiuikit] Unrecognized document: expected a top-level "openapi", "swagger", or "asyncapi" version key. Supported specs: ${So.map(n=>n.name).join(", ")}.`);return r}function Wa(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Bh(e){return ws(e).targets(e)}function Dh(e,t){const r=ws(e);if(t&&t.document!==e)throw new Error("[apiuikit] Markdown target belongs to a different document.");return r.toMarkdown(e,t)}function Fh(e,t={}){const r=ws(e),{baseUrl:n,url:s,optional:i}=t,a=(n==null?void 0:n.replace(/\/+$/,""))??"",c=s??(p=>`${a}/${Wa(p.key)}.md`),u=[`# ${t.title??r.title(e)}`],d=t.summary??r.summary(e);d&&u.push("",`> ${d}`);const f=r.targets(e).map(p=>({entry:p,href:c(p)})).filter(p=>!!p.href);if(f.length){u.push("",`## ${r.sectionTitle}`,"");for(const{entry:p,href:h}of f)u.push(`- [${p.label}](${h})${p.summary?`: ${p.summary}`:""}`)}if(i!=null&&i.length){u.push("","## Optional","");for(const p of i)u.push(`- [${p.label}](${p.url})${p.description?`: ${p.description}`:""}`)}return u.push(""),u.join(`
|
|
178
|
+
`)}function Ka(e,t,r){e.registerSchemaParser(t);const n=e.parserRegistry,s=n.get.bind(n);n.get=i=>{const a=s(i);return a!==void 0?a:r(i)?t:void 0}}const zh=["application/vnd.apache.avro","application/vnd.apache.avro+json","application/vnd.apache.avro+yaml","application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0","application/vnd.apache.avro;version=1.8.2","application/vnd.apache.avro+json;version=1.8.2","application/vnd.apache.avro+yaml;version=1.8.2"];function Hh(){return{validate:Wh,parse:Kh,getMimeTypes:()=>zh}}function Uh(e){Ka(e,Hh(),Bt)}function Wh(e){return Gr(e.data).map(t=>({message:t,path:e.path}))}function Kh(e){var r,n;const t=Gr(e.data);if(t.length>0)return{[yn]:t[0]};try{const s=kr(e.data),i=e.meta.message,a=(n=(r=i==null?void 0:i.bindings)==null?void 0:r.kafka)==null?void 0:n.key;return a&&i&&(i["x-parser-original-bindings-kafka-key"]=a,i.bindings.kafka.key=kr(a)),s}catch(s){return{[yn]:s instanceof Error?s.message:"Failed to convert Avro schema"}}}async function Gh(){try{const e=await Promise.resolve().then(()=>require("./index-BuZVtHPG.cjs")).then(r=>r.index),t=e.default??e;if(typeof t!="function")throw new Error("Unexpected export shape from '@asyncapi/parser/browser'.");return t}catch(e){throw console.error("[apiuikit] Failed to load '@asyncapi/parser/browser':",e),new Error("[apiuikit] The parsed entry requires '@asyncapi/parser'. Install it (`npm i @asyncapi/parser`), or use the `AsyncAPI` component with a pre-resolved document instead.")}}async function Ga(e){try{const t=await Gh(),r=new t;Uh(r);const{registerProtobufSchemaParser:n}=await Promise.resolve().then(()=>require("./protobufSchemaParser-BJ8lDMuw.cjs"));n(r);const{document:s,diagnostics:i}=await r.parse(e);return{diagnostics:i,document:s?Jh(s):null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function Vh(e,t){const{diagnostics:r,document:n}=await Ga(e);return{diagnostics:r,view:n?o.jsx(ys,{kind:"resolved",asyncapi:n,config:t}):null}}function Jh(e){return e.json()}function Zh({raw:e,config:t,plugins:r,onDiagnostics:n,errorFallback:s,onError:i}){const[a,l]=g.useState(null),c=g.useRef(n);return c.current=n,g.useEffect(()=>{let u=!0;return Ga(e).then(({document:d,diagnostics:f})=>{var p;u&&(l(d),(p=c.current)==null||p.call(c,f))}),()=>{u=!1}},[e]),a?o.jsx(ys,{kind:"resolved",asyncapi:a,config:t,plugins:r,errorFallback:s,onError:i}):null}async function Xh(){try{return await Promise.resolve().then(()=>require("./index-D7aNsAD6.cjs"))}catch(e){throw console.error("[apiuikit] Failed to load '@scalar/openapi-parser':",e),new Error("[apiuikit] The parsed entry requires '@scalar/openapi-parser'. Install it (`npm i @scalar/openapi-parser`), or use the `OpenAPI` component with a pre-resolved document instead.")}}const rr=(e,t)=>({message:e.message,path:Array.isArray(e.path)?e.path:[],severity:t});async function Va(e){try{const{validate:t,dereference:r}=await Xh(),n=await t(e);if(!n.valid)return{diagnostics:n.errors.map(l=>rr(l,0)),document:null};const s=(n.errors??[]).map(l=>rr(l,1)),{schema:i,errors:a}=r(e);return a!=null&&a.length&&s.push(...a.map(l=>rr(l,0))),{diagnostics:s,document:i??null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function Yh(e,t){const{diagnostics:r,document:n}=await Va(e);return{diagnostics:r,view:n?o.jsx(ks,{kind:"resolved",openapi:n,config:t}):null}}function Qh({raw:e,config:t,plugins:r,onDiagnostics:n,errorFallback:s,onError:i}){const[a,l]=g.useState(null),c=g.useRef(n);return c.current=n,g.useEffect(()=>{let u=!0;return Va(e).then(({document:d,diagnostics:f})=>{var p;u&&(l(d),(p=c.current)==null||p.call(c,f))}),()=>{u=!1}},[e]),a?o.jsx(ks,{kind:"resolved",openapi:a,config:t,plugins:r,errorFallback:s,onError:i}):null}function Ja(e,t,r){return function({document:s,config:i,plugins:a,children:l}){const c=g.useContext(bt),u=g.useMemo(()=>s?xt(s):null,[s]),d=!!c&&c.specType!==r;if(g.useEffect(()=>{d&&console.warn(`[apiuikit] A ${t} section is rendered inside a ${c.specType} document provider, which cannot supply the document it needs. `+(u?"Using the section's own `document` prop instead.":`Wrap it in <${t}Provider> or pass it a \`document\` prop.`))},[c,d,u]),c&&!d)return o.jsx(o.Fragment,{children:l});if(!u){if(c)return o.jsx(o.Fragment,{children:l});throw new Error(`This ${t} section needs a \`document\` prop unless it is rendered inside <${t}Provider>.`)}return o.jsx(e,{document:u,config:i,plugins:a,children:l})}}function qh({document:e,config:t,plugins:r,children:n}){const s=g.useMemo(()=>xt(e),[e]);return o.jsx(Cn,{document:s,config:t,plugins:r,children:n})}const Dn=Ja(Cn,"AsyncAPI","asyncapi");function Fn(){const e=be();return e.specType==="asyncapi",e.document}function em({layout:e}){const t=Fn();return!t.servers||Object.keys(t.servers).length===0?null:o.jsx(ya,{servers:t.servers,layout:e})}function tm({layout:e,...t}){return o.jsx(Dn,{...t,children:o.jsx(em,{layout:e})})}function nm({layout:e}){const t=Fn(),[r,n]=g.useState(null);return o.jsx(Ma,{operations:t.operations??{},selectedKey:r,onSelectKey:n,layout:e})}function rm({layout:e,...t}){return o.jsx(Dn,{...t,children:o.jsx(nm,{layout:e})})}function sm({layout:e}){var r;const t=Fn();return o.jsx(da,{messages:((r=t.components)==null?void 0:r.messages)??{},layout:e})}function om({layout:e,...t}){return o.jsx(Dn,{...t,children:o.jsx(sm,{layout:e})})}function im({layout:e}){const t=Fn();return t.info?o.jsx(Zi,{...t.info,layout:e}):null}function am({layout:e,...t}){return o.jsx(Dn,{...t,children:o.jsx(im,{layout:e})})}const lm=e=>{const t=e;return typeof t.openapi=="string"||typeof t.swagger=="string"};function sr({layout:e}){var n,s;const t=g.useContext(bt),r=((s=(n=t==null?void 0:t.document)==null?void 0:n.components)==null?void 0:s.schemas)??{};return o.jsx(bs,{schemas:r,layout:e})}function vs({document:e,config:t,plugins:r,layout:n}){const s=g.useContext(bt),i=g.useMemo(()=>e?xt(e):null,[e]);if(s)return o.jsx(sr,{layout:n});if(!i)throw new Error("The Schemas section needs a `document` prop unless it is rendered inside <AsyncAPIProvider> or <OpenAPIProvider>.");return lm(i)?o.jsx(Bn,{document:i,config:t,plugins:r,children:o.jsx(sr,{layout:n})}):o.jsx(Cn,{document:i,config:t,plugins:r,children:o.jsx(sr,{layout:n})})}const cm=vs,um=vs;function dm({document:e,config:t,plugins:r,children:n}){const s=g.useMemo(()=>xt(e),[e]);return o.jsx(Bn,{document:s,config:t,plugins:r,children:n})}const zn=Ja(Bn,"OpenAPI","openapi");function Hn(){const e=Ke();return e.specType==="openapi",e.document}function fm({layout:e}){const t=Hn();return!t.servers||t.servers.length===0?null:o.jsx(Pa,{servers:t.servers,layout:e})}function pm({layout:e,...t}){return o.jsx(zn,{...t,children:o.jsx(fm,{layout:e})})}function hm({layout:e}){var s;const t=Hn(),[r,n]=g.useState(null);return o.jsx(En,{paths:t.paths??{},security:t.security,securitySchemes:(s=t.components)==null?void 0:s.securitySchemes,selectedKey:r,onSelectKey:n,layout:e})}function mm({layout:e,...t}){return o.jsx(zn,{...t,children:o.jsx(hm,{layout:e})})}function gm({layout:e}){var i;const t=Hn(),[r,n]=g.useState(null),s=t.webhooks??{};return Object.keys(s).length===0?null:o.jsx(En,{paths:s,security:t.security,securitySchemes:(i=t.components)==null?void 0:i.securitySchemes,selectedKey:r,onSelectKey:n,columnLabel:"Webhook",idPrefix:"webhook",layout:e})}function xm({layout:e,...t}){return o.jsx(zn,{...t,children:o.jsx(gm,{layout:e})})}function bm({layout:e}){const t=Hn();return t.info?o.jsx(Ra,{info:t.info,tags:t.tags,externalDocs:t.externalDocs,layout:e}):null}function ym({layout:e,...t}){return o.jsx(zn,{...t,children:o.jsx(bm,{layout:e})})}exports.AsyncAPI=ys;exports.AsyncAPIInfo=am;exports.AsyncAPIMessages=om;exports.AsyncAPIOperations=rm;exports.AsyncAPIProvider=qh;exports.AsyncAPIRenderer=Zh;exports.AsyncAPISchemas=cm;exports.AsyncAPIServers=tm;exports.CodeBlock=Pn;exports.ErrorBoundary=$n;exports.OpenAPI=ks;exports.OpenAPIEndpoints=mm;exports.OpenAPIInfo=ym;exports.OpenAPIProvider=dm;exports.OpenAPIRenderer=Qh;exports.OpenAPISchemas=um;exports.OpenAPIServers=pm;exports.OpenAPIWebhooks=xm;exports.PluginSlot=xs;exports.SchemaTabs=ot;exports.SchemaTree=ms;exports.Schemas=vs;exports.X_LIB_CONVERSION_ERROR=yn;exports.asyncApiOperationToMarkdown=fi;exports.asyncApiToMarkdown=Jr;exports.commonjsGlobal=cd;exports.defaultConfig=gt;exports.documentToLlmsTxt=Fh;exports.documentToMarkdown=Dh;exports.ensureHljsLanguage=$a;exports.getAugmentedNamespace=ud;exports.getDefaultExportFromCjs=Ti;exports.hljsLanguageForTarget=Ea;exports.isHljsLanguageReady=An;exports.isProtobufSchemaFormat=Dt;exports.listDocumentTargets=Bh;exports.markdownForLlm=Jo;exports.openApiEndpointToMarkdown=hi;exports.openApiToMarkdown=Zr;exports.parseAndRender=Vh;exports.parseAndRender$1=Yh;exports.registerSchemaParserWithFallback=Ka;exports.resolveLogo=Xr;exports.targetSlug=Wa;exports.useAsyncAPIDocument=be;exports.useAsyncAPIDocumentContext=$o;exports.useDocumentContext=Ke;exports.useOpenAPIDocumentContext=Co;exports.useOperationTabPlugins=Oa;exports.usePluginSlot=Ia;
|